diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 09422bfd09b866..89e05ef4dc579f 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "microsoft.dotnet.xharness.cli": { - "version": "1.0.0-prerelease.21529.1", + "version": "1.0.0-prerelease.21579.1", "commands": [ "xharness" ] diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b3dfd99aebd89a..41e9c94c00deee 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -12,7 +12,11 @@ "settings": { // Loading projects on demand is better for larger codebases - "omnisharp.enableMsBuildLoadProjectsOnDemand": true + "omnisharp.enableMsBuildLoadProjectsOnDemand": true, + "omnisharp.enableRoslynAnalyzers": true, + "omnisharp.enableEditorConfigSupport": true, + "omnisharp.enableAsyncCompletion": true, + "omnisharp.testRunSettings": "${containerWorkspaceFolder}/artifacts/obj/vscode/.runsettings" }, // Add the IDs of extensions you want installed when the container is created. @@ -23,6 +27,9 @@ // Use 'onCreateCommand' to run pre-build commands inside the codespace "onCreateCommand": "${containerWorkspaceFolder}/.devcontainer/scripts/onCreateCommand.sh", + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "${containerWorkspaceFolder}/.devcontainer/scripts/postCreateCommand.sh", + // Add the locally installed dotnet to the path to ensure that it is activated // This allows developers to just use 'dotnet build' on the command-line, and the local dotnet version will be used. "remoteEnv": { diff --git a/.devcontainer/scripts/onCreateCommand.sh b/.devcontainer/scripts/onCreateCommand.sh index dc0154c619b82e..faf7cb08d1afae 100755 --- a/.devcontainer/scripts/onCreateCommand.sh +++ b/.devcontainer/scripts/onCreateCommand.sh @@ -4,3 +4,8 @@ set -e # prebuild the repo, so it is ready for development ./build.sh libs+clr -rc Release +# restore libs tests so that the project is ready to be loaded by OmniSharp +./build.sh libs.tests -restore + +# save the commit hash of the currently built assemblies, so developers know which version was built +git rev-parse HEAD > ./artifacts/prebuild.sha diff --git a/.devcontainer/scripts/postCreateCommand.sh b/.devcontainer/scripts/postCreateCommand.sh new file mode 100755 index 00000000000000..8086037ab9af43 --- /dev/null +++ b/.devcontainer/scripts/postCreateCommand.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -e + +# reset the repo to the commit hash that was used to build the prebuilt Codespace +git reset --hard $(cat ./artifacts/prebuild.sha) diff --git a/.github/ISSUE_TEMPLATE/02_api_proposal.yml b/.github/ISSUE_TEMPLATE/02_api_proposal.yml index 145095e3bb42b2..541bcf5b73c7a8 100644 --- a/.github/ISSUE_TEMPLATE/02_api_proposal.yml +++ b/.github/ISSUE_TEMPLATE/02_api_proposal.yml @@ -33,7 +33,7 @@ body: public void Fancy(T item); } } - ``` + ``` validations: required: true - type: textarea @@ -41,7 +41,7 @@ body: attributes: label: API Usage description: | - Please provide code examples that highlight how the proposed API additions are meant to be consumed. This will help suggest whether the API has the right shape to be functional, performant and useable. + Please provide code examples that highlight how the proposed API additions are meant to be consumed. This will help suggest whether the API has the right shape to be functional, performant and usable. placeholder: API usage value: | ```C# @@ -52,7 +52,7 @@ body: // Getting the values out foreach (var v in c) Console.WriteLine(v); - ``` + ``` validations: required: true - type: textarea diff --git a/.github/workflows/aspnetcore-sync-checkdiff.ps1 b/.github/workflows/aspnetcore-sync-checkdiff.ps1 new file mode 100644 index 00000000000000..b6ff80a408429b --- /dev/null +++ b/.github/workflows/aspnetcore-sync-checkdiff.ps1 @@ -0,0 +1,3 @@ +# Check the code is in sync +$changed = (select-string "nothing to commit" artifacts\status.txt).count -eq 0 +return $changed \ No newline at end of file diff --git a/.github/workflows/aspnetcore-sync.yml b/.github/workflows/aspnetcore-sync.yml new file mode 100644 index 00000000000000..01aa3dfdabca60 --- /dev/null +++ b/.github/workflows/aspnetcore-sync.yml @@ -0,0 +1,70 @@ +name: AspNetCore->Runtime Code Sync +on: + # Manual run + workflow_dispatch: + +permissions: + contents: write + issues: write + pull-requests: write + +jobs: + compare_repos: + # Comment out this line to test the scripts in a fork + if: github.repository == 'dotnet/runtime' + name: Sync Code + runs-on: windows-latest + steps: + - name: Checkout aspnetcore + uses: actions/checkout@v2.0.0 + with: + # Test this script using changes in a fork + repository: 'dotnet/aspnetcore' + path: aspnetcore + ref: main + - name: Checkout runtime + uses: actions/checkout@v2.0.0 + with: + # Test this script using changes in a fork + repository: 'dotnet/runtime' + path: runtime + ref: main + - name: Copy + shell: cmd + working-directory: .\aspnetcore\src\Shared\runtime\ + env: + RUNTIME_REPO: d:\a\runtime\runtime\runtime\ + run: CopyToRuntime.cmd + - name: Diff + shell: cmd + working-directory: .\runtime\ + run: | + mkdir ..\artifacts + git status > ..\artifacts\status.txt + git diff > ..\artifacts\diff.txt + - uses: actions/upload-artifact@v1 + with: + name: results + path: artifacts + - name: Check + id: check + shell: pwsh + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + $changed = .\runtime\.github\workflows\aspnetcore-sync-checkdiff.ps1 + echo "::set-output name=changed::$changed" + - name: Send PR + if: steps.check.outputs.changed == 'true' + # https://github.com/marketplace/actions/create-pull-request + uses: dotnet/actions-create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + path: .\runtime + commit-message: 'Sync shared code from aspnetcore' + title: 'Sync shared code from aspnetcore' + body: 'This PR was automatically generated to sync shared code changes from aspnetcore. Fixes https://github.com/dotnet/aspnetcore/issues/18943' + labels: area-System.Net.Http + base: main + branch: github-action/sync-aspnetcore + branch-suffix: timestamp diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 9699f4db66961c..99ebe3b43d0cf8 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -3,6 +3,11 @@ on: issue_comment: types: [created] +permissions: + contents: write + issues: write + pull-requests: write + jobs: backport: if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/backport to') diff --git a/.github/workflows/create-codespaces-prebuild.yml b/.github/workflows/create-codespaces-prebuild.yml index db269106e05a5a..cbae714eb4003c 100644 --- a/.github/workflows/create-codespaces-prebuild.yml +++ b/.github/workflows/create-codespaces-prebuild.yml @@ -6,6 +6,10 @@ on: workflow_dispatch: jobs: createPrebuild: + # Only run in the main repository since it will fail in forks + if: github.repository == 'dotnet/runtime' + permissions: + contents: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml index 202d6bbd2bf038..eeb9eb6fefe77c 100644 --- a/.github/workflows/markdownlint.yml +++ b/.github/workflows/markdownlint.yml @@ -1,5 +1,8 @@ name: Markdownlint +permissions: + contents: read + on: pull_request: paths: diff --git a/.gitignore b/.gitignore index dbdbce21b052de..833551119f2d02 100644 --- a/.gitignore +++ b/.gitignore @@ -354,3 +354,7 @@ src/coreclr/System.Private.CoreLib/common !src/coreclr/inc/obj/ !src/coreclr/vm/.vscode/ !src/coreclr/vm/.vscode/c_cpp_properties.json + +# Temporary artifacts from local libraries stress builds +.dotnet-daily/ +run-stress-* \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 043dbed1f5f74a..10a7c114340a5d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -266,13 +266,11 @@ true - $(MSBuildProjectName.Contains('Experimental')) $(MSBuildProjectName.Contains('Private')) - - true - false + + true - false + false $(RepositoryEngineeringDir)_._ @@ -295,9 +293,6 @@ Properties false - - true diff --git a/docs/area-owners.md b/docs/area-owners.md index ef6f0bfd3dffca..b5f4b45a61a56d 100644 --- a/docs/area-owners.md +++ b/docs/area-owners.md @@ -22,39 +22,39 @@ Note: Editing this file doesn't update the mapping used by the `@msftbot` issue | area-CrossGen/NGEN-coreclr | @mangod9 | @dotnet/crossgen-contrib | | | area-crossgen2-coreclr | @mangod9 | @trylek @dotnet/crossgen-contrib | | | area-Debugger-mono | @lewing | @thaystg @radical | | -| area-DependencyModel | @ericstj | @maryamariyan @michaelgsharp @safern @tarekgh | Consultants: @eerhardt | +| area-DependencyModel | @ericstj | @eerhardt @maryamariyan @tarekgh | | | area-Diagnostics-coreclr | @tommcdon | @tommcdon | | | area-EnC-mono | @marek-safar | @lambdageek | Hot Reload on WebAssembly, Android, iOS, etc | | area-ExceptionHandling-coreclr | @mangod9 | @janvorli | | -| area-Extensions-Caching | @ericstj | @maryamariyan @michaelgsharp @safern @tarekgh | Consultants: @eerhardt | -| area-Extensions-Configuration | @ericstj | @maryamariyan @michaelgsharp @safern @tarekgh | Consultants: @eerhardt | -| area-Extensions-DependencyInjection | @ericstj | @maryamariyan @michaelgsharp @safern @tarekgh | Consultants: @eerhardt | -| area-Extensions-FileSystem | @jeffhandley | @adamsitnik @carlossanlop @jozkee | Consultants: @eerhardt @GrabYourPitchforks | -| area-Extensions-Hosting | @ericstj | @maryamariyan @michaelgsharp @safern @tarekgh | Consultants: @eerhardt | +| area-Extensions-Caching | @ericstj | @eerhardt @maryamariyan @tarekgh | Consultants: @adamsitnik | +| area-Extensions-Configuration | @ericstj | @eerhardt @maryamariyan @tarekgh | | +| area-Extensions-DependencyInjection | @ericstj | @eerhardt @maryamariyan @tarekgh | | +| area-Extensions-FileSystem | @jeffhandley | @adamsitnik @carlossanlop @jozkee | Consultants: @eerhardt | +| area-Extensions-Hosting | @ericstj | @eerhardt @maryamariyan @tarekgh | | | area-Extensions-HttpClientFactory | @karelz | @dotnet/ncl | | -| area-Extensions-Logging | @ericstj | @maryamariyan @michaelgsharp @safern @tarekgh | Consultants: @eerhardt | -| area-Extensions-Options | @ericstj | @maryamariyan @michaelgsharp @safern @tarekgh | Consultants: @eerhardt | -| area-Extensions-Primitives | @ericstj | @maryamariyan @michaelgsharp @safern @tarekgh | Consultants: @eerhardt | +| area-Extensions-Logging | @ericstj | @eerhardt @maryamariyan @tarekgh | | +| area-Extensions-Options | @ericstj | @eerhardt @maryamariyan @tarekgh | | +| area-Extensions-Primitives | @ericstj | @eerhardt @maryamariyan @tarekgh | | | area-GC-coreclr | @mangod9 | @Maoni0 | | | area-GC-mono | @SamMonoRT | @BrzVlad | | | area-Host | @agocke | @jeffschwMSFT @vitek-karas @vsadov | Issues with dotnet.exe including bootstrapping, framework detection, hostfxr.dll and hostpolicy.dll | | area-HostModel | @agocke | @vitek-karas | | | area-ILTools-coreclr | @JulieLeeMSFT | @BruceForstall @dotnet/jit-contrib | | | area-ILVerification | @JulieLeeMSFT | @BruceForstall @dotnet/jit-contrib | | -| area-Infrastructure | @ericstj | @Anipik @ViktorHofer @jeffschwMSFT @dleeapho | | +| area-Infrastructure | @agocke | @jeffschwMSFT @dleeapho | | | area-Infrastructure-coreclr | @agocke | @jeffschwMSFT @trylek | | | area-Infrastructure-installer | @dleeapho | @dleeapho @NikolaMilosavljevic | | -| area-Infrastructure-libraries | @ericstj | @Anipik @ViktorHofer | Covers:
| +| area-Infrastructure-libraries | @ericstj | @safern | Covers:
| | area-Infrastructure-mono | @steveisok | @directhex | | | area-Interop-coreclr | @jeffschwMSFT | @jeffschwMSFT @AaronRobinsonMSFT | | | area-Interop-mono | @marek-safar | @lambdageek | | -| area-Meta | @jeffhandley | @buyaa-n @joperezr | Issues without clear association to any specific API/contract, e.g.
| +| area-Meta | @danmoseley | @ericstj @jeffhandley | Cross-cutting concerns that span many or all areas, including project-wide code/test patterns and documentation. | | area-Microsoft.CSharp | @jaredpar | @cston @333fred | Archived component - limited churn/contributions (see [#27790](https://github.com/dotnet/runtime/issues/27790)) | -| area-Microsoft.Extensions | @ericstj | @maryamariyan @michaelgsharp @safern @tarekgh | Consultants: @eerhardt | +| area-Microsoft.Extensions | @ericstj | @eerhardt @maryamariyan @tarekgh | | | area-Microsoft.VisualBasic | @jaredpar | @cston @333fred | Archived component - limited churn/contributions (see [#27790](https://github.com/dotnet/runtime/issues/27790)) | -| area-Microsoft.Win32 | @ericstj | @Anipik @ViktorHofer | Including System.Windows.Extensions | +| area-Microsoft.Win32 | @ericstj | @safern | Including System.Windows.Extensions | +| area-NativeAOT-coreclr | @agocke | @MichalStrehovsky @jkotas | | | area-PAL-coreclr | @mangod9 | @janvorli | | -| area-PAL-libraries | @jeffhandley | @bartonjs @GrabYourPitchforks | | | area-Performance-mono | @SamMonoRT | @SamMonoRT | | | area-R2RDump-coreclr | @mangod9 | @trylek | | | area-ReadyToRun-coreclr | @mangod9 | @trylek | | @@ -62,75 +62,75 @@ Note: Editing this file doesn't update the mapping used by the `@msftbot` issue | area-Setup | @dleeapho | @NikolaMilosavljevic @dleeapho | Distro-specific (Linux, Mac and Windows) setup packages and msi files | | area-Single-File | @agocke | @vitek-karas @vsadov | | | area-Snap | @dleeapho | @dleeapho @leecow @MichaelSimons | | -| area-System.Buffers | @jeffhandley | @tannergooding | Consultants: @GrabYourPitchforks | -| area-System.CodeDom | @jeffhandley | @buyaa-n @joperezr | | -| area-System.Collections | @ericstj | @eiriktsarpalis @layomia @krwq | Excluded: Consultants: @steveharter @GrabYourPitchForks | -| area-System.ComponentModel | @ericstj | @maryamariyan @michaelgsharp @safern @tarekgh | | -| area-System.ComponentModel.Composition | @jeffhandley | @buyaa-n @joperezr | Consultants: @steveharter | +| area-System.Buffers | @jeffhandley | @michaelgsharp @tannergooding | Consultants: @GrabYourPitchforks | +| area-System.CodeDom | @ericstj | @buyaa-n @joperezr @steveharter | | +| area-System.Collections | @jeffhandley | @eiriktsarpalis @krwq @layomia | Excluded: Consultants: @steveharter @GrabYourPitchForks | +| area-System.ComponentModel | @ericstj | @eerhardt @maryamariyan @tarekgh | | +| area-System.ComponentModel.Composition | @jeffhandley | @eerhardt @maryamariyan @tarekgh | | | area-System.ComponentModel.DataAnnotations | @ajcvickers | @lajones @ajcvickers | Included: | -| area-System.Composition | @jeffhandley | @buyaa-n @joperezr | Consultants: @steveharter | -| area-System.Configuration | @jeffhandley | @buyaa-n @joperezr | Consultants: @steveharter | +| area-System.Composition | @jeffhandley | @eerhardt @maryamariyan @tarekgh | | +| area-System.Configuration | @ericstj | @buyaa-n @joperezr @steveharter | | | area-System.Console | @jeffhandley | @adamsitnik @carlossanlop @jozkee | Consultants: @GrabYourPitchForks | -| area-System.Data | @ajcvickers | @ajcvickers @cheenamalhotra @david-engel | | +| area-System.Data | @ajcvickers | @ajcvickers @davoudeshtehari @david-engel | | | area-System.Data.Odbc | @ajcvickers | @ajcvickers | | | area-System.Data.OleDB | @ajcvickers | @ajcvickers | | -| area-System.Data.SqlClient | @David-Engel | @cheenamalhotra @david-engel @karinazhou @JRahnama | Archived component - limited churn/contributions (see https://devblogs.microsoft.com/dotnet/introducing-the-new-microsoftdatasqlclient/) | +| area-System.Data.SqlClient | @David-Engel | @davoudeshtehari @david-engel @jrahnama | Archived component - limited churn/contributions (see https://devblogs.microsoft.com/dotnet/introducing-the-new-microsoftdatasqlclient/) | | area-System.Diagnostics | @tommcdon | @tommcdon | | | area-System.Diagnostics-coreclr | @tommcdon | @tommcdon | | -| area-System.Diagnostics-mono | @lewing | @thaystg @radical | | -| area-System.Diagnostics.Activity | @tommcdon | @tarekgh | | -| area-System.Diagnostics.EventLog | @ericstj | @Anipik @ViktorHofer | | +| area-System.Diagnostics-mono | @lewing | @thaystg @radical | | +| area-System.Diagnostics.Activity | @tommcdon | @eerhardt @maryamariyan @tarekgh | | +| area-System.Diagnostics.EventLog | @ericstj | @safern | | | area-System.Diagnostics.Metric | @tommcdon | @noahfalk | | -| area-System.Diagnostics.PerformanceCounter | @ericstj | @Anipik @ViktorHofer | | +| area-System.Diagnostics.PerformanceCounter | @ericstj | @safern | | | area-System.Diagnostics.Process | @jeffhandley | @adamsitnik @carlossanlop @jozkee | | -| area-System.Diagnostics.Tracing | @tommcdon | @noahfalk @tommcdon @Anipik @ViktorHofer @tarekgh | Included: | -| area-System.Diagnostics.TraceSource | @ericstj | @Anipik @ViktorHofer | | -| area-System.DirectoryServices | @jeffhandley | @buyaa-n @joperezr | Also: @BRDPM @grubioe @jay98014 | -| area-System.Drawing | @ericstj | @maryamariyan @michaelgsharp @safern @tarekgh | | +| area-System.Diagnostics.Tracing | @tommcdon | @noahfalk @tommcdon @safern @tarekgh | Included: | +| area-System.Diagnostics.TraceSource | @ericstj | @safern | | +| area-System.DirectoryServices | @ericstj | @buyaa-n @joperezr @steveharter | Consultants: @BRDPM @grubioe @jay98014 | +| area-System.Drawing | @ericstj | @safern | | | area-System.Dynamic.Runtime | @jaredpar | @cston @333fred | Archived component - limited churn/contributions (see [#27790](https://github.com/dotnet/runtime/issues/27790)) | | area-System.Formats.Asn1 | @jeffhandley | @bartonjs @GrabYourPitchforks | | -| area-System.Formats.Cbor | @ericstj | @eiriktsarpalis @layomia @krwq | Consultants: @bartonjs @GrabYourPitchForks | -| area-System.Globalization | @ericstj | @maryamariyan @michaelgsharp @safern @tarekgh | | +| area-System.Formats.Cbor | @jeffhandley | @bartonjs @GrabYourPitchforks | Consultants: @eiriktsarpalis | +| area-System.Globalization | @ericstj | @eerhardt @maryamariyan @tarekgh | | | area-System.IO | @jeffhandley | @adamsitnik @carlossanlop @jozkee | | -| area-System.IO.Compression | @jeffhandley | @adamsitnik @carlossanlop @jozkee | Consultants: @ericstj | +| area-System.IO.Compression | @jeffhandley | @adamsitnik @carlossanlop @jozkee | | | area-System.IO.Pipelines | @kevinpi | @davidfowl @halter73 @jkotalik | | -| area-System.Linq | @ericstj | @eiriktsarpalis @layomia @krwq | Consultants: @steveharter | +| area-System.Linq | @jeffhandley | @eiriktsarpalis @krwq @layomia | | | area-System.Linq.Expressions | @jaredpar | @cston @333fred | Archived component - limited churn/contributions (see [#27790](https://github.com/dotnet/runtime/issues/27790)) | | area-System.Linq.Parallel | @jeffhandley | @adamsitnik @carlossanlop @jozkee | Consultants: @stephentoub @kouvel | -| area-System.Management | @ericstj | @Anipik @ViktorHofer | WMI | +| area-System.Management | @ericstj | @safern | WMI | | area-System.Memory | @jeffhandley | @adamsitnik @carlossanlop @jozkee | Consultants: @GrabYourPitchforks | | area-System.Net | @karelz | @dotnet/ncl | Included: | | area-System.Net.Http | @karelz | @dotnet/ncl | | | area-System.Net.Quic | @karelz | @dotnet/ncl | | | area-System.Net.Security | @karelz | @dotnet/ncl | | | area-System.Net.Sockets | @karelz | @dotnet/ncl | | -| area-System.Numerics | @jeffhandley | @tannergooding | | -| area-System.Numerics.Tensors | @jeffhandley | @tannergooding | | -| area-System.Reflection | @jeffhandley | @buyaa-n @joperezr @steveharter | | +| area-System.Numerics | @jeffhandley | @michaelgsharp @tannergooding | | +| area-System.Numerics.Tensors | @jeffhandley | @michaelgsharp @tannergooding | | +| area-System.Reflection | @ericstj | @buyaa-n @joperezr @steveharter | | | area-System.Reflection-mono | @SamMonoRT | @lambdageek | MonoVM-specific reflection and reflection-emit issues | -| area-System.Reflection.Emit | @jeffhandley | @buyaa-n @joperezr @steveharter | Consultants: @GrabYourPitchforks | -| area-System.Reflection.Metadata | @jeffhandley | @buyaa-n @joperezr @steveharter | Consultants: @GrabYourPitchforks @tmat | -| area-System.Resources | @jeffhandley | @buyaa-n @joperezr | | -| area-System.Runtime | @jeffhandley | @tannergooding | Consultants: @bartonjs @GrabYourPitchforks
Included:Excluded: | +| area-System.Reflection.Emit | @ericstj | @buyaa-n @joperezr @steveharter | Consultants: @GrabYourPitchforks | +| area-System.Reflection.Metadata | @ericstj | @buyaa-n @joperezr @steveharter | Consultants: @GrabYourPitchforks @tmat | +| area-System.Resources | @ericstj | @buyaa-n @joperezr @steveharter | Consultants: @tarekgh | +| area-System.Runtime | @jeffhandley | @michaelgsharp @tannergooding | Included:Excluded: | | area-System.Runtime.Caching | @HongGit | @StephenMolloy @HongGit | | -| area-System.Runtime.CompilerServices | @jeffhandley | @buyaa-n @joperezr | Consultants: @steveharter | +| area-System.Runtime.CompilerServices | @ericstj | @buyaa-n @joperezr @steveharter | | | area-System.Runtime.InteropServices | @jeffschwMSFT | @AaronRobinsonMSFT @jkoritzinsky | Excluded: | | area-System.Runtime.InteropServices.JavaScript | @lewing | @kjpou1 | | -| area-System.Runtime.Intrinsics | @jeffhandley | @tannergooding @echesakovMSFT | | +| area-System.Runtime.Intrinsics | @jeffhandley | @michaelgsharp @tannergooding | Consultants: @echesakovMSFT @kunalspathak | | area-System.Security | @jeffhandley | @bartonjs @GrabYourPitchforks | | | area-System.ServiceModel | @HongGit | @HongGit @mconnew | Repo: https://github.com/dotnet/WCF
Packages: | | area-System.ServiceModel.Syndication | @HongGit | @StephenMolloy @HongGit | | -| area-System.ServiceProcess | @ericstj | @Anipik @ViktorHofer | | +| area-System.ServiceProcess | @ericstj | @safern | | | area-System.Speech | @danmoseley | @danmoseley | | -| area-System.Text.Encoding | @ericstj | @eiriktsarpalis @layomia @krwq | Consultants: @GrabYourPitchforks | -| area-System.Text.Encodings.Web | @ericstj | @eiriktsarpalis @layomia @krwq | Consultants: @GrabYourPitchforks | -| area-System.Text.Json | @ericstj | @eiriktsarpalis @layomia @krwq @steveharter | | -| area-System.Text.RegularExpressions | @jeffhandley | @tannergooding | Consultants: @eerhardt @stephentoub | +| area-System.Text.Encoding | @jeffhandley | @bartonjs @GrabYourPitchforks | Consultants: @tarekgh | +| area-System.Text.Encodings.Web | @jeffhandley | @bartonjs @GrabYourPitchforks | | +| area-System.Text.Json | @jeffhandley | @eiriktsarpalis @krwq @layomia | Consultants: @steveharter | +| area-System.Text.RegularExpressions | @ericstj | @buyaa-n @joperezr @steveharter | Consultants: @stephentoub | | area-System.Threading | @mangod9 | @kouvel | | -| area-System.Threading.Channels | @jeffhandley | @adamsitnik @carlossanlop @jozkee | Consultants: @stephentoub | -| area-System.Threading.Tasks | @jeffhandley | @adamsitnik @carlossanlop @jozkee | Consultants: @stephentoub | +| area-System.Threading.Channels | @ericstj | @buyaa-n @joperezr @steveharter | Consultants: @stephentoub | +| area-System.Threading.Tasks | @ericstj | @buyaa-n @joperezr @steveharter | Consultants: @stephentoub | | area-System.Transactions | @HongGit | @HongGit | | -| area-System.Xml | @ericstj | @eiriktsarpalis @layomia @krwq | | +| area-System.Xml | @jeffhandley | @eiriktsarpalis @krwq @layomia | | | area-Threading-mono | @SamMonoRT | @lambdageek | | | area-TieredCompilation-coreclr | @mangod9 | @kouvel | | | area-Tracing-coreclr | @tommcdon | @sywhang @josalem | | diff --git a/docs/design/coreclr/botr/vectors-and-intrinsics.md b/docs/design/coreclr/botr/vectors-and-intrinsics.md index 2688db9ca376b2..3c18eecb0a6446 100644 --- a/docs/design/coreclr/botr/vectors-and-intrinsics.md +++ b/docs/design/coreclr/botr/vectors-and-intrinsics.md @@ -16,7 +16,7 @@ Most hardware intrinsics support is tied to the use of various Vector apis. Ther - The fixed length float vectors. `Vector2`, `Vector3`, and `Vector4`. These vector types represent a struct of floats of various lengths. For type layout, ABI and, interop purposes they are represented in exactly the same way as a structure with an appropriate number of floats in it. Operations on these vector types are supported on all architectures and platforms, although some architectures may optimize various operations. - The variable length `Vector`. This represents vector data of runtime-determined length. In any given process the length of a `Vector` is the same in all methods, but this length may differ between various machines or environment variable settings read at startup of the process. The `T` type variable may be the following types (`System.Byte`, `System.SByte`, `System.Int16`, `System.UInt16`, `System.Int32`, `System.UInt32`, `System.Int64`, `System.UInt64`, `System.Single`, and `System.Double`), and allows use of integer or double data within a vector. The length and alignment of `Vector` is unknown to the developer at compile time (although discoverable at runtime by using the `Vector.Count` api), and `Vector` may not exist in any interop signature. Operations on these vector types are supported on all architectures and platforms, although some architectures may optimize various operations if the `Vector.IsHardwareAccelerated` api returns true. - `Vector64`, `Vector128`, and `Vector256` represent fixed-sized vectors that closely resemble the fixed- sized vectors available in C++. These structures can be used in any code that runs, but very few features are supported directly on these types other than creation. They are used primarily in the processor specific hardware intrinsics apis. -- Processor specific hardware intrinsics apis such as `System.Runtime.Intrinsics.X86.Ssse3`. These apis map directly to individual instructions or short instruction sequences that are specific to a particular hardware instruction. These apis are only useable on hardware that supports the particular instruction. See https://github.com/dotnet/designs/blob/master/accepted/2018/platform-intrinsics.md for the design of these. +- Processor specific hardware intrinsics apis such as `System.Runtime.Intrinsics.X86.Ssse3`. These apis map directly to individual instructions or short instruction sequences that are specific to a particular hardware instruction. These apis are only usable on hardware that supports the particular instruction. See https://github.com/dotnet/designs/blob/master/accepted/2018/platform-intrinsics.md for the design of these. # How to use intrinsics apis @@ -185,7 +185,7 @@ Since System.Private.CoreLib.dll is known to be code reviewed with the code revi The JIT receives flags which instruct it on what instruction sets are valid to use, and has access to a new jit interface api `notifyInstructionSetUsage(isa, bool supportBehaviorRequired)`. -The notifyInstructionSetUsage api is used to notify the AOT compiler infrastructure that the code may only execute if the runtime environment of the code is exactly the same as the boolean parameter indicates it should be. For instance, if `notifyInstructionSetUsage(Avx, false)` is used, then the code generated must not be used if the `Avx` instruction set is useable. Similarly `notifyInstructionSetUsage(Avx, true)` will indicate that the code may only be used if the `Avx` instruction set is available. +The notifyInstructionSetUsage api is used to notify the AOT compiler infrastructure that the code may only execute if the runtime environment of the code is exactly the same as the boolean parameter indicates it should be. For instance, if `notifyInstructionSetUsage(Avx, false)` is used, then the code generated must not be used if the `Avx` instruction set is usable. Similarly `notifyInstructionSetUsage(Avx, true)` will indicate that the code may only be used if the `Avx` instruction set is available. While the above api exists, it is not expected that general purpose code within the JIT will use it. In general jitted code is expected to use a number of different apis to understand the available hardware instruction support available. diff --git a/docs/design/features/arm64-intrinsics.md b/docs/design/features/arm64-intrinsics.md index e814833ad126fc..5b602f24cf7102 100644 --- a/docs/design/features/arm64-intrinsics.md +++ b/docs/design/features/arm64-intrinsics.md @@ -173,7 +173,7 @@ It is also worth noting `System.Runtime.Intrinsics.X86` naming conventions will operations which take vector argument(s), but contain an implicit cast(s) to the base type and therefore operate only on the first item of the argument vector(s). -### Intinsic Method Argument and Return Types +### Intrinsic Method Argument and Return Types Intrinsic methods will typically use a standard set of argument and return types: diff --git a/docs/design/libraries/DllImportGenerator/Compatibility.md b/docs/design/libraries/DllImportGenerator/Compatibility.md index 5f5997a36edaaf..9a22b6f6ed8795 100644 --- a/docs/design/libraries/DllImportGenerator/Compatibility.md +++ b/docs/design/libraries/DllImportGenerator/Compatibility.md @@ -33,7 +33,7 @@ These are all part of `NetCoreApp` and will be referenced by default unless [imp Marshalling of `char` will not be supported when configured with any of the following: - [`CharSet.Ansi`, `CharSet.Auto`, or `CharSet.None`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.charset) will not be supported. - - [`UnmangedType.U1` or `UnmangedType.I1`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.unmanagedtype) + - [`UnmanagedType.U1` or `UnmanagedType.I1`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.unmanagedtype) - No explicit marshalling information - either [`DllImportAttribute.CharSet`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.charset) or [`MarshalAsAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute) For `CharSet.Ansi` and `CharSet.None`, the built-in system used the [system default Windows ANSI code page](https://docs.microsoft.com/windows/win32/api/stringapiset/nf-stringapiset-widechartomultibyte) when on Windows and took the first byte of the UTF-8 encoding on non-Windows platforms. The above reasoning also applies to marshalling of a `char` as `UnmanagedType.U1` and `UnmanagedType.I1`. All approaches are fundamentally flawed and therefore not supported. If a single-byte character is expected to be marshalled it is left to the caller to convert a .NET `char` into a single `byte` prior to calling the native function. @@ -44,7 +44,7 @@ For `CharSet.Auto`, the built-in system relied upon detection at runtime of the Marshalling of `string` will not be supported when configured with any of the following: - [`CharSet.None`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.charset) - - [`UnmangedType.VBByRefStr`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.unmanagedtype) + - [`UnmanagedType.VBByRefStr`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.unmanagedtype) - No explicit marshalling information - either [`DllImportAttribute.CharSet`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute.charset) or [`MarshalAsAttribute`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute) When converting from native to managed, the built-in system would throw a [`MarshalDirectiveException`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshaldirectiveexception) if the string's length is over 0x7ffffff0. The generated marshalling code will no longer perform this check. @@ -63,7 +63,7 @@ Using a custom marshaller (i.e. [`ICustomMarshaler`](https://docs.microsoft.com/ ### Array marshalling -Marshalling of arrays will not be supported when using [`UnmangedType.SafeArray`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.unmanagedtype). This implies that the following `MarshalAsAttribute` fields are unsupported: [`SafeArraySubType`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute.safearraysubtype) and [`SafeArrayUserDefinedSubType`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute.safearrayuserdefinedsubtype) +Marshalling of arrays will not be supported when using [`UnmanagedType.SafeArray`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.unmanagedtype). This implies that the following `MarshalAsAttribute` fields are unsupported: [`SafeArraySubType`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute.safearraysubtype) and [`SafeArrayUserDefinedSubType`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute.safearrayuserdefinedsubtype) Specifying array-specific marshalling members on the `MarshalAsAttribute` such as [`SizeConst`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute.sizeconst), [`ArraySubType`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute.arraysubtype), and [`SizeParamIndex`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshalasattribute.sizeparamindex) with non-array `UnmanagedType` types is unsupported. @@ -71,6 +71,8 @@ Only single-dimensional arrays are supported for source generated marshalling. In the source-generated marshalling, arrays will be allocated on the stack (instead of through [`AllocCoTaskMem`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshal.alloccotaskmem)) if they are passed by value or by read-only reference if they contain at most 256 bytes of data. The built-in system does not support this optimization for arrays. +In the built-in system, marshalling a `char` array by value with `CharSet.Unicode` would default to also marshalling data out. In the source-generated marshalling, the `char` array must be marked with the `[Out]` attribute for data to be marshalled out by value. + ### `in` keyword For some types - blittable or Unicode `char` - passed by read-only reference via the [`in` keyword](https://docs.microsoft.com/dotnet/csharp/language-reference/keywords/in-parameter-modifier), the built-in system simply pins the parameter. The generated marshalling code does the same, such that there is no behavioural difference. A consequence of this behaviour is that any modifications made by the invoked function will be reflected in the caller. It is left to the user to avoid the situation in which `in` is used for a parameter that will actually be modified by the invoked function. @@ -94,6 +96,12 @@ Unlike the built-in system, the source generator does not support marshalling fo - [`HandleRef`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.handleref) - [`StringBuilder`](https://docs.microsoft.com/dotnet/api/system.text.stringbuilder) +The source generator also does not support marshalling objects using the following [`UnmanagedType`](https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.unmanagedtype) values: +- `UnmanagedType.Interface` +- `UnmanagedType.IDispatch` +- `UnmanagedType.IInspectable` +- `UnmanagedType.IUnknown` + ## Version 0 This version is the built-in IL Stub generation system that is triggered whenever a method marked with `DllImportAttribute` is invoked. diff --git a/docs/design/libraries/DllImportGenerator/StructMarshalling.md b/docs/design/libraries/DllImportGenerator/StructMarshalling.md index 2852880103c6c6..ab332616b74132 100644 --- a/docs/design/libraries/DllImportGenerator/StructMarshalling.md +++ b/docs/design/libraries/DllImportGenerator/StructMarshalling.md @@ -54,14 +54,16 @@ partial struct TNative } ``` -The analyzer will report an error if neither the construtor nor the ToManaged method is defined. When one of those two methods is missing, the direction of marshalling (managed to native/native to managed) that relies on the missing method is considered unsupported for the corresponding managed type. The FreeNative method is only required when there are resources that need to be released. +The analyzer will report an error if neither the constructor nor the `ToManaged` method is defined. When one of those two methods is missing, the direction of marshalling (managed to native/native to managed) that relies on the missing method is considered unsupported for the corresponding managed type. The `FreeNative` method is only required when there are resources that need to be released. > :question: Does this API surface and shape work for all marshalling scenarios we plan on supporting? It may have issues with the current "layout class" by-value `[Out]` parameter marshalling where the runtime updates a `class` typed object in place. We already recommend against using classes for interop for performance reasons and a struct value passed via `ref` or `out` with the same members would cover this scenario. If the native type `TNative` also has a public `Value` property, then the value of the `Value` property will be passed to native code instead of the `TNative` value itself. As a result, the type `TNative` will be allowed to be non-blittable and the type of the `Value` property will be required to be blittable. If the `Value` property is settable, then when marshalling in the native-to-managed direction, a default value of `TNative` will have its `Value` property set to the native value. If `Value` does not have a setter, then marshalling from native to managed is not supported. -A `ref` or `ref readonly` typed `Value` property is unsupported. If a ref-return is required, the type author can supply a `GetPinnableReference` method on the native type. If a `GetPinnableReference` method is supplied, then the `Value` property must have a pointer-sized primitive type. +If a `Value` property is provided, the developer may also provide a ref-returning or readonly-ref-returning `GetPinnableReference` method. The `GetPinnableReference` method will be called before the `Value` property getter is called. The ref returned by `GetPinnableReference` will be pinned with a `fixed` statement, but the pinned value will not be used (it acts exclusively as a side-effect). + +A `ref` or `ref readonly` typed `Value` property is unsupported. If a ref-return is required, the type author can supply a `GetPinnableReference` method on the native type to pin the desired `ref` to return and then use `System.Runtime.CompilerServices.Unsafe.AsPointer` to get a pointer from the `ref` that will have already been pinned by the time the `Value` getter is called. ```csharp [NativeMarshalling(typeof(TMarshaler))] @@ -72,14 +74,14 @@ public struct TManaged public struct TMarshaler { - public TNative(TManaged managed) {} + public TMarshaler(TManaged managed) {} public TManaged ToManaged() {} public void FreeNative() {} public ref TNative GetPinnableReference() {} - public TNative Value { get; set; } + public TNative* Value { get; set; } } ``` @@ -88,7 +90,7 @@ public struct TMarshaler #### Pinning -Since C# 7.3 added a feature to enable custom pinning logic for user types, we should also add support for custom pinning logic. If the user provides a `GetPinnableReference` method that matches the requirements to be used in a `fixed` statement and the pointed-to type is blittable, then we will support using pinning to marshal the managed value when possible. The analyzer should issue a warning when the pointed-to type would not match the final native type, accounting for the `Value` property on the native type. Since `MarshalUsingAttribute` is applied at usage time instead of at type authoring time, we will not enable the pinning feature since the implementation of `GetPinnableReference` unless the pointed-to return type matches the native type. +Since C# 7.3 added a feature to enable custom pinning logic for user types, we should also add support for custom pinning logic. If the user provides a `GetPinnableReference` method on the managed type that matches the requirements to be used in a `fixed` statement and the pointed-to type is blittable, then we will support using pinning to marshal the managed value when possible. The analyzer should issue a warning when the pointed-to type would not match the final native type, accounting for the `Value` property on the native type. Since `MarshalUsingAttribute` is applied at usage time instead of at type authoring time, we will not enable the pinning feature since the implementation of `GetPinnableReference` is likely designed to match the default marshalling rules provided by the type author, not the rules provided by the marshaller provided by the `MarshalUsingAttribute`. #### Caller-allocated memory @@ -100,14 +102,14 @@ partial struct TNative public TNative(TManaged managed, Span buffer) {} public const int BufferSize = /* */; - + public const bool RequiresStackBuffer = /* */; } ``` When these members are present, the source generator will call the two-parameter constructor with a possibly stack-allocated buffer of `BufferSize` bytes when a stack-allocated buffer is usable. If a stack-allocated buffer is a requirement, the `RequiresStackBuffer` field should be set to `true` and the `buffer` will be guaranteed to be allocated on the stack. Setting the `RequiresStackBuffer` field to `false` is the same as omitting the field definition. Since a dynamically allocated buffer is not usable in all scenarios, for example Reverse P/Invoke and struct marshalling, a one-parameter constructor must also be provided for usage in those scenarios. This may also be provided by providing a two-parameter constructor with a default value for the second parameter. -Type authors can pass down the `buffer` pointer to native code by defining a `GetPinnableReference()` method on the native type that returns a reference to the first element of the span. When the `RequiresStackBuffer` field is set to `true`, the type author is free to use APIs that would be dangerous in non-stack-allocated scenarios such as `MemoryMarshal.GetReference()` and `Unsafe.AsPointer()`. +Type authors can pass down the `buffer` pointer to native code by defining a `Value` property that returns a pointer to the first element, generally through code using `MemoryMarshal.GetReference()` and `Unsafe.AsPointer`. If `RequiresStackBuffer` is not provided or set to `false`, the `buffer` span must be pinned to be used safely. The `buffer` span can be pinned by defining a `GetPinnableReference()` method on the native type that returns a reference to the first element of the span. ### Usage @@ -115,7 +117,7 @@ There are 2 usage mechanisms of these attributes. #### Usage 1, Source-generated interop -The user can apply the `GeneratedMarshallingAttribute` to their structure `S`. The source generator will determine if the type is blittable. If it is blittable, the source generator will generate a partial definition and apply the `BlittableTypeAttribute` to the struct type `S`. Otherwise, it will generate a blittable representation of the struct with the aformentioned requried shape and apply the `NativeMarshallingAttribute` and point it to the blittable representation. The blittable representation can either be generated as a separate top-level type or as a nested type on `S`. +The user can apply the `GeneratedMarshallingAttribute` to their structure `S`. The source generator will determine if the type is blittable. If it is blittable, the source generator will generate a partial definition and apply the `BlittableTypeAttribute` to the struct type `S`. Otherwise, it will generate a blittable representation of the struct with the aformentioned required shape and apply the `NativeMarshallingAttribute` and point it to the blittable representation. The blittable representation can either be generated as a separate top-level type or as a nested type on `S`. #### Usage 2, Manual interop diff --git a/docs/design/mono/debugger.md b/docs/design/mono/debugger.md new file mode 100644 index 00000000000000..3a3a2936b79eb4 --- /dev/null +++ b/docs/design/mono/debugger.md @@ -0,0 +1,21 @@ +# WebAssembly Debugger + +## Overview + +The details of launching a Debugger session for a Blazor WebAssembly application is described [here](https://docs.microsoft.com/en-us/aspnet/core/blazor/debug?view=aspnetcore-6.0&tabs=visual-studio). + +## Debugger Attributes +Web Assembly Debugger supports usage of following attributes: +- __System.Diagnostics.DebuggerHidden__ + + Decorating a method - results: + - Visual Studio Breakpoints: results in disabling all existing breakpoints in the method and no possibility to set new,enabled ones. + - Stepping In/Over: results in stepping over the line with method call. + - Call stack: method does not appear on the call stack, no access to method local variables is provided. + + Decorating a method with a Debugger.Break() call inside: + - Running in the Debug mode: results in pausing the program on the line with the method call. + - Stepping In/Over: results in an additional stepping need to proceed to the next line.

+- __System.Diagnostics.DebuggerDisplay__ +- __System.Diagnostics.DebuggerTypeProxy__ +- ... \ No newline at end of file diff --git a/docs/design/specs/Ecma-335-Augments.md b/docs/design/specs/Ecma-335-Augments.md index 1ebcbc377c9fa6..1c52fedd4d84ce 100644 --- a/docs/design/specs/Ecma-335-Augments.md +++ b/docs/design/specs/Ecma-335-Augments.md @@ -7,6 +7,7 @@ This is a list of additions and edits to be made in ECMA-335 specifications. It - [Signatures](#signatures) - [Heap sizes](#heap-sizes) - [Metadata merging](#metadata-merging) +- [Metadata logical format](#metadata-logical-format) - [Module Initializer](#module-initializer) - [Default Interface Methods](#default-interface-methods) - [Static Interface Methods](#static-interface-methods) @@ -362,6 +363,14 @@ This text should be deleted, and the _metadata merging_ entry should be removed > * ~~If there are duplicates and two or more have an accessibility other than > **compilercontrolled**, an error has occurred.~~ +## Metadata logical format + +The requirement to sort InterfaceImpl table using the Interface column as a secondary key in § II.22 _Metadata logical format: tables_ is a spec bug. The interface declaration order affects resolution and a requirement to sort it would make it impossible to emit certain sequences of interfaces (e.g. not possible to have an interface list I1, I2, while also having interface list I2, I1 elsewhere in the module). + +The text should be deleted: + +> Furthermore, ~~the InterfaceImpl table is sorted using the Interface column as a secondary key, and~~ the GenericParam table is sorted using the Number column as a secondary key. + ## Module Initializer All modules may have a module initializer. A module initializer is defined as the type initializer (§ II.10.5.3) of the `` type (§ II.10.8). diff --git a/docs/project/list-of-diagnostics.md b/docs/project/list-of-diagnostics.md index 6516b71d45553a..1d6dd75bb0085b 100644 --- a/docs/project/list-of-diagnostics.md +++ b/docs/project/list-of-diagnostics.md @@ -91,6 +91,7 @@ The PR that reveals the implementation of the `true` * Add NuGet references by updating the following [test project](https://github.com/dotnet/runtime/blob/main/src/tests/Common/test_dependencies/test_dependencies.csproj). -* Get access to System.Private.CoreLib types and methods that are not exposed via public surface by adding the following to the csproj: - * `true` * Any System.Private.CoreLib types and methods used by tests must be available for building on all platforms. This means there must be enough implementation for the C# compiler to find the referenced types and methods. Unsupported target platforms should simply `throw new PlatformNotSupportedException()` in its dummy method implementations. diff --git a/docs/workflow/testing/libraries/testing-android.md b/docs/workflow/testing/libraries/testing-android.md index 23b6e07d924140..e3c1c4e79c38d0 100644 --- a/docs/workflow/testing/libraries/testing-android.md +++ b/docs/workflow/testing/libraries/testing-android.md @@ -1,18 +1,23 @@ # Testing Libraries on Android +## Prerequisites + The following dependencies should be installed in order to be able to run tests: +- OpenJDK - Android NDK - Android SDK -- OpenJDK -- OpenSSL + +To manage the dependencies, you can install them via terminal or using Android Studio. + +### Using a terminal OpenJDK can be installed on Linux (Ubuntu) using `apt-get`: ```bash sudo apt-get install openjdk-8 zip unzip ``` -Android SDK, NDK and OpenSSL can be automatically installed via the following script: +Android SDK and NDK can be automatically installed via the following script: ```bash #!/usr/bin/env bash set -e @@ -21,7 +26,6 @@ NDK_VER=r21b SDK_VER=6200805_latest SDK_API_LEVEL=29 SDK_BUILD_TOOLS=29.0.3 -OPENSSL_VER=1.1.1g-alpha-1 if [[ "$OSTYPE" == "darwin"* ]]; then HOST_OS=darwin @@ -47,8 +51,21 @@ yes | ${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin/sdkmanager --sdk_root=${ANDROI ${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} "platform-tools" "platforms;android-${SDK_API_LEVEL}" "build-tools;${SDK_BUILD_TOOLS}" ``` +### Using Android Studio + +Android Studio offers a convenient UI: +- to install all the dependencies; +- to manage android virtual devices; +- to make easy use of adb logs. + ## Building Libs and Tests for Android +Before running a build you might want to set the Android SDK and NDK environment variables: +``` +export ANDROID_SDK_ROOT= +export ANDROID_NDK_ROOT= +``` + Now we're ready to build everything for Android: ``` ./build.sh mono+libs -os Android -arch x64 @@ -66,8 +83,35 @@ The following shows how to run tests for a specific library ./dotnet.sh build /t:Test src/libraries/System.Numerics.Vectors/tests /p:TargetOS=Android /p:TargetArchitecture=x64 ``` +### Running the functional tests + +There are [functional tests](https://github.com/dotnet/runtime/tree/main/src/tests/FunctionalTests/) which aim to test some specific features/configurations/modes on a target mobile platform. + +A functional test can be run the same way as any library test suite, e.g.: +``` +./dotnet.sh build /t:Test -c Release /p:TargetOS=Android /p:TargetArchitecture=x64 src/tests/FunctionalTests/Android/Device_Emulator/PInvoke/Android.Device_Emulator.PInvoke.Test.csproj +``` + +Currently functional tests are expected to return `42` as a success code so please be careful when adding a new one. + +### Testing various configurations + +It's possible to test various configurations by setting a combination of additional MSBuild properties such as `RunAOTCompilation`,`MonoForceInterpreter`, and some more. + +1. AOT + +To build for AOT only mode, add `/p:RunAOTCompilation=true /p:MonoForceInterpreter=false` to a build command. + +2. AOT-LLVM + +To build for AOT-LLVM mode, add `/p:RunAOTCompilation=true /p:MonoForceInterpreter=false /p:MonoEnableLLVM=true` to a build command. + +3. Interpreter + +To build for Interpreter mode, add `/p:RunAOTCompilation=false /p:MonoForceInterpreter=true` to a build command. + ### Test App Design -Android app is basically a [Java Instrumentation](https://github.com/dotnet/runtime/blob/main/src/mono/msbuild/AndroidAppBuilder/Templates/MonoRunner.java) and a simple Activity that inits the Mono Runtime via JNI. This Mono Runtime starts a simple xunit test +Android app is basically a [Java Instrumentation](https://github.com/dotnet/runtime/blob/main/src/tasks/AndroidAppBuilder/Templates/MonoRunner.java) and a simple Activity that inits the Mono Runtime via JNI. This Mono Runtime starts a simple xunit test runner called XHarness.TestRunner (see https://github.com/dotnet/xharness) which runs tests for all `*.Tests.dll` libs in the bundle. There is also XHarness.CLI tool with ADB embedded to deploy `*.apk` to a target (device or emulator) and obtain logs once tests are completed. ### Obtaining the logs @@ -75,7 +119,7 @@ XHarness for Android doesn't talk much and only saves test results to a file. Ho ``` adb logcat -s "DOTNET" ``` -Or simply open `logcat` window in Android Studio or Visual Stuido. +Or simply open `logcat` window in Android Studio or Visual Studio. ### AVD Manager If Android Studio is installed, [AVD Manager](https://developer.android.com/studio/run/managing-avds) can be used from the IDE to create and start Android virtual devices. Otherwise, the Android SDK provides the [`avdmanager` command line tool](https://developer.android.com/studio/command-line/avdmanager). diff --git a/docs/workflow/testing/libraries/testing-apple.md b/docs/workflow/testing/libraries/testing-apple.md index 99adf6a87176b8..c303fc737362d2 100644 --- a/docs/workflow/testing/libraries/testing-apple.md +++ b/docs/workflow/testing/libraries/testing-apple.md @@ -1,34 +1,117 @@ -# Testing Libraries on iOS and tvOS +# Testing Libraries on iOS, tvOS, and MacCatalyst -In order to build libraries and tests for iOS or tvOS you need recent version of XCode installed (e.g. 11.3 or higher). +## Prerequisites -Build Libraries for iOS Simulator: +- XCode 11.3 or higher +- a certificate and provisioning profile if using a device +- a simulator with a proper device type and OS version. +Go `XCode > Window > Devices and Simulators` to revise the list of the available simulators and then `"+" button on bottom left > OS Version dropdown selection > Download more simulator runtimes` in case you need to download more simulators. + +## Building Libs and Tests + +You can build and run the library tests: +- on a simulator; +- on a device. + +Run the following command in a terminal: +``` +./build.sh mono+libs -os -arch +``` +where `` is one of the following: +- iOSSimulator +- tvOSSimulator +- MacCatalyst +- iOS +- tvOS + +and `` is one of the following: +- x64 +- arm64 (for device) + +e.g., to build for an iOS simulator, run: ``` ./build.sh mono+libs -os iOSSimulator -arch x64 ``` + Run tests one by one for each test suite on a simulator: ``` ./build.sh libs.tests -os iOSSimulator -arch x64 -test ``` + +### Building for a device + In order to run the tests on a device: -- Set the os to `iOS` instead of `iOSSimulator` -- Specify `DevTeamProvisioning` (see [developer.apple.com/account/#/membership](https://developer.apple.com/account/#/membership), scroll down to `Team ID`): +- Set the `-os` parameter to a device-related value (see above) +- Specify `DevTeamProvisioning` (see [developer.apple.com/account/#/membership](https://developer.apple.com/account/#/membership), scroll down to `Team ID`). + +For example: ``` ./build.sh libs.tests -os iOS -arch x64 -test /p:DevTeamProvisioning=H1A2B3C4D5 ``` -[AppleAppBuilder](https://github.com/dotnet/runtime/blob/main/src/mono/msbuild/AppleAppBuilder/AppleAppBuilder.cs) generates temp Xcode projects you can manually open and resolve provisioning issues there using native UI and deploy to your devices. +[AppleAppBuilder](https://github.com/dotnet/runtime/blob/main/src/tasks/AppleAppBuilder/AppleAppBuilder.cs) generates temp Xcode projects you can manually open and resolve provisioning issues there using native UI and deploy to your devices. ### Running individual test suites + - The following shows how to run tests for a specific library: ``` ./dotnet.sh build src/libraries/System.Numerics.Vectors/tests /t:Test /p:TargetOS=iOS /p:TargetArchitecture=x64 ``` +Also you can run the built test app through Xcode by opening the corresponding `.xcodeproj` and setting up the right scheme, app, and even signing if using a local device. + +There's also an option to run a `.app` through `xcrun`, which is simulator specific. Consider the following shell script: + +``` + xcrun simctl shutdown + xcrun simctl boot + open -a Simulator + xcrun simctl install + xcrun simctl launch --console booted +``` + +where +`` is a name of the simulator to start, e.g. `"iPhone 11"`, +`` is a path to the iOS test app bundle, +`` is a name of the iOS test app + +### Running the functional tests + +There are [functional tests](https://github.com/dotnet/runtime/tree/main/src/tests/FunctionalTests/) which aim to test some specific features/configurations/modes on a target mobile platform. + +A functional test can be run the same way as any library test suite, e.g.: +``` +./dotnet.sh build /t:Test -c Release /p:TargetOS=iOSSimulator /p:TargetArchitecture=x64 src/tests/FunctionalTests/iOS/Simulator/PInvoke/iOS.Simulator.PInvoke.Test.csproj +``` + +Currently functional tests are expected to return `42` as a success code so please be careful when adding a new one. + +### Viewing logs +- see the logs generated by the XHarness tool +- use the `Console` app on macOS: +`Command + Space`, type in `Console`, search the appropriate process (System.Buffers.Tests for example). + +### Testing various configurations + +It's possible to test various configurations by setting a combination of additional MSBuild properties such as `RunAOTCompilation`,`MonoEnableInterpreter`, and some more. + +1. Interpreter Only + +This configuration is necessary for hot reload scenarios. + +To enable the interpreter, add `/p:RunAOTCompilation=true /p:MonoEnableInterpreter=true` to a build command. + +2. AOT only + +To build for AOT only mode, add `/p:RunAOTCompilation=true /p:MonoEnableInterpreter=false` to a build command. + +3. AOT-LLVM + +To build for AOT-LLVM mode, add `/p:RunAOTCompilation=true /p:MonoEnableInterpreter=false /p:MonoEnableLLVM=true` to a build command. + ### Test App Design -iOS/tvOS `*.app` (or `*.ipa`) is basically a simple [ObjC app](https://github.com/dotnet/runtime/blob/main/src/mono/msbuild/AppleAppBuilder/Templates/main-console.m) that inits the Mono Runtime. This Mono Runtime starts a simple xunit test +iOS/tvOS `*.app` (or `*.ipa`) is basically a simple [ObjC app](https://github.com/dotnet/runtime/blob/main/src/tasks/AppleAppBuilder/Templates/main-console.m) that inits the Mono Runtime. This Mono Runtime starts a simple xunit test runner called XHarness.TestRunner (see https://github.com/dotnet/xharness) which runs tests for all `*.Tests.dll` libs in the bundle. There is also XHarness.CLI tool to deploy `*.app` and `*.ipa` to a target (device or simulator) and listens for logs via network sockets. ### Existing Limitations -- Most of the test suites crash on devices due to #35674 - Simulator uses JIT mode only at the moment (to be extended with FullAOT and Interpreter) - Interpreter is not enabled yet. diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index fc5086f52e8f36..14d141e529a3ca 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -93,7 +93,20 @@ For example, the following command is for running System.Runtime tests: make run-tests-corefx-System.Runtime ``` ### Mobile targets and WebAssembly -Build and run library tests against Webassembly, Android or iOS. See instructions located in [Library testing document folder](../libraries/) +Build and run library tests against WebAssembly, Android or iOS. See instructions located in [Library testing document folder](../libraries/) + +## Running the functional tests + +There are the [functional tests](https://github.com/dotnet/runtime/tree/main/src/tests/FunctionalTests/) which aim to test some specific features/configurations/modes on Android, iOS-like platforms (iOS/tvOS + simulators, MacCatalyst), and WebAssembly. + +A functional test can be run the same way as any library test suite, e.g.: +``` +./dotnet.sh build /t:Test -c Release /p:TargetOS=Android /p:TargetArchitecture=x64 src/tests/FunctionalTests/Android/Device_Emulator/PInvoke/Android.Device_Emulator.PInvoke.Test.csproj +``` + +Currently the functional tests are expected to return `42` as a success code so please be careful when adding a new one. + +For more details, see instructions located in [Library testing document folder](../libraries/). # Running the Mono samples There are a few convenient samples located in `$(REPO_ROOT)/src/mono/sample`, which could help you test your program easily with different flavors of Mono or do a sanity check on the build. The samples are set up to work with a specific configuration; please refer to the relevant Makefile for specifics. If you would like to work with a different configuration, you can edit the Makefile. diff --git a/eng/CodeAnalysis.src.globalconfig b/eng/CodeAnalysis.src.globalconfig index 1f1ba7216dc06b..400c8c432c21bf 100644 --- a/eng/CodeAnalysis.src.globalconfig +++ b/eng/CodeAnalysis.src.globalconfig @@ -386,6 +386,12 @@ dotnet_diagnostic.CA1847.severity = warning # CA1848: Use the LoggerMessage delegates dotnet_diagnostic.CA1848.severity = none +# CA1849: Call async methods when in an async method +dotnet_diagnostic.CA1849.severity = suggestion + +# CA1850: Prefer static 'HashData' method over 'ComputeHash' +dotnet_diagnostic.CA1850.severity = warning + # CA2000: Dispose objects before losing scope dotnet_diagnostic.CA2000.severity = none diff --git a/eng/CodeAnalysis.test.globalconfig b/eng/CodeAnalysis.test.globalconfig index 5f31263bf86570..572310d3b86d0a 100644 --- a/eng/CodeAnalysis.test.globalconfig +++ b/eng/CodeAnalysis.test.globalconfig @@ -384,6 +384,12 @@ dotnet_diagnostic.CA1847.severity = none # CA1848: Use the LoggerMessage delegates dotnet_diagnostic.CA1848.severity = none +# CA1849: Call async methods when in an async method +dotnet_diagnostic.CA1849.severity = none + +# CA1850: Prefer static 'HashData' method over 'ComputeHash' +dotnet_diagnostic.CA1850.severity = none + # CA2000: Dispose objects before losing scope dotnet_diagnostic.CA2000.severity = none diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props index 340f5720780367..e191178c9068fc 100644 --- a/eng/SourceBuild.props +++ b/eng/SourceBuild.props @@ -23,14 +23,6 @@ minimal
- - - - - - - - diff --git a/eng/Subsets.props b/eng/Subsets.props index 03dc4a5b59f437..65da9d8861bd68 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -280,7 +280,7 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 004ddccb3d6195..05bd4440e3d153 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,16 +1,16 @@ - + https://github.com/dotnet/icu - 5146c6e78ad134305a4b3e857379bdd134db7ac0 + c454e00c63464ff6b599f23448bcc0a0c9fbac5f https://github.com/dotnet/msquic a7213b4676c1803bb251771291a525482d42e511 - + https://github.com/dotnet/emsdk - efad634a7c316b67654b38690c56b3702363d6ae + 24412d4288fda1d3c9fed49a7961bb4c476c0ce6 https://github.com/dotnet/wcf @@ -18,229 +18,229 @@ - + https://github.com/dotnet/arcade - 0558f85d950fee2838bf02b9ba1f20d67f00b504 + 427c05909067bb2e484116ae2239456bb45adb85 - + https://github.com/dotnet/arcade - 0558f85d950fee2838bf02b9ba1f20d67f00b504 + 427c05909067bb2e484116ae2239456bb45adb85 - + https://github.com/dotnet/arcade - 0558f85d950fee2838bf02b9ba1f20d67f00b504 + 427c05909067bb2e484116ae2239456bb45adb85 - + https://github.com/dotnet/arcade - 0558f85d950fee2838bf02b9ba1f20d67f00b504 + 427c05909067bb2e484116ae2239456bb45adb85 - + https://github.com/dotnet/arcade - 0558f85d950fee2838bf02b9ba1f20d67f00b504 + 427c05909067bb2e484116ae2239456bb45adb85 - + https://github.com/dotnet/arcade - 0558f85d950fee2838bf02b9ba1f20d67f00b504 + 427c05909067bb2e484116ae2239456bb45adb85 - + https://github.com/dotnet/arcade - 0558f85d950fee2838bf02b9ba1f20d67f00b504 + 427c05909067bb2e484116ae2239456bb45adb85 - + https://github.com/dotnet/arcade - 0558f85d950fee2838bf02b9ba1f20d67f00b504 + 427c05909067bb2e484116ae2239456bb45adb85 - + https://github.com/dotnet/arcade - 0558f85d950fee2838bf02b9ba1f20d67f00b504 + 427c05909067bb2e484116ae2239456bb45adb85 - + https://github.com/dotnet/arcade - 0558f85d950fee2838bf02b9ba1f20d67f00b504 + 427c05909067bb2e484116ae2239456bb45adb85 - + https://github.com/dotnet/arcade - 0558f85d950fee2838bf02b9ba1f20d67f00b504 + 427c05909067bb2e484116ae2239456bb45adb85 - + https://github.com/dotnet/arcade - 0558f85d950fee2838bf02b9ba1f20d67f00b504 + 427c05909067bb2e484116ae2239456bb45adb85 - + https://github.com/dotnet/arcade - 0558f85d950fee2838bf02b9ba1f20d67f00b504 + 427c05909067bb2e484116ae2239456bb45adb85 - + https://github.com/dotnet/arcade - 0558f85d950fee2838bf02b9ba1f20d67f00b504 + 427c05909067bb2e484116ae2239456bb45adb85 - + https://github.com/dotnet/arcade - 0558f85d950fee2838bf02b9ba1f20d67f00b504 + 427c05909067bb2e484116ae2239456bb45adb85 - + https://github.com/dotnet/arcade - 0558f85d950fee2838bf02b9ba1f20d67f00b504 + 427c05909067bb2e484116ae2239456bb45adb85 - + https://github.com/dotnet/arcade - 0558f85d950fee2838bf02b9ba1f20d67f00b504 + 427c05909067bb2e484116ae2239456bb45adb85 - + https://github.com/dotnet/arcade - 0558f85d950fee2838bf02b9ba1f20d67f00b504 + 427c05909067bb2e484116ae2239456bb45adb85 https://github.com/microsoft/vstest 140434f7109d357d0158ade9e5164a4861513965 - + https://github.com/dotnet/runtime-assets - e444c9ce30e40a75994fe6b4fd5e87a7ef63355b + 8784c859561193c0a91b2b47108113a9a7c40038 - + https://github.com/dotnet/runtime-assets - e444c9ce30e40a75994fe6b4fd5e87a7ef63355b + 8784c859561193c0a91b2b47108113a9a7c40038 - + https://github.com/dotnet/runtime-assets - e444c9ce30e40a75994fe6b4fd5e87a7ef63355b + 8784c859561193c0a91b2b47108113a9a7c40038 - + https://github.com/dotnet/runtime-assets - e444c9ce30e40a75994fe6b4fd5e87a7ef63355b + 8784c859561193c0a91b2b47108113a9a7c40038 - + https://github.com/dotnet/runtime-assets - e444c9ce30e40a75994fe6b4fd5e87a7ef63355b + 8784c859561193c0a91b2b47108113a9a7c40038 - + https://github.com/dotnet/runtime-assets - e444c9ce30e40a75994fe6b4fd5e87a7ef63355b + 8784c859561193c0a91b2b47108113a9a7c40038 - + https://github.com/dotnet/runtime-assets - e444c9ce30e40a75994fe6b4fd5e87a7ef63355b + 8784c859561193c0a91b2b47108113a9a7c40038 - + https://github.com/dotnet/runtime-assets - e444c9ce30e40a75994fe6b4fd5e87a7ef63355b + 8784c859561193c0a91b2b47108113a9a7c40038 - + https://github.com/dotnet/runtime-assets - e444c9ce30e40a75994fe6b4fd5e87a7ef63355b + 8784c859561193c0a91b2b47108113a9a7c40038 - + https://github.com/dotnet/runtime-assets - e444c9ce30e40a75994fe6b4fd5e87a7ef63355b + 8784c859561193c0a91b2b47108113a9a7c40038 - + https://github.com/dotnet/llvm-project - b1e4b4a52fe087e726d6bb95c78d234352f9e847 + 2e69189f031e16ffb36167d89a658e14cbdba099 - + https://github.com/dotnet/llvm-project - b1e4b4a52fe087e726d6bb95c78d234352f9e847 + 2e69189f031e16ffb36167d89a658e14cbdba099 - + https://github.com/dotnet/llvm-project - b1e4b4a52fe087e726d6bb95c78d234352f9e847 + 2e69189f031e16ffb36167d89a658e14cbdba099 - + https://github.com/dotnet/llvm-project - b1e4b4a52fe087e726d6bb95c78d234352f9e847 + 2e69189f031e16ffb36167d89a658e14cbdba099 - + https://github.com/dotnet/llvm-project - b1e4b4a52fe087e726d6bb95c78d234352f9e847 + 2e69189f031e16ffb36167d89a658e14cbdba099 - + https://github.com/dotnet/llvm-project - b1e4b4a52fe087e726d6bb95c78d234352f9e847 + 2e69189f031e16ffb36167d89a658e14cbdba099 - + https://github.com/dotnet/llvm-project - b1e4b4a52fe087e726d6bb95c78d234352f9e847 + 2e69189f031e16ffb36167d89a658e14cbdba099 - + https://github.com/dotnet/llvm-project - b1e4b4a52fe087e726d6bb95c78d234352f9e847 + 2e69189f031e16ffb36167d89a658e14cbdba099 - + https://github.com/dotnet/runtime - 2a87ffeaedb6b534d6eaa000d5ba9b545f4aac1e + 9ede9a29128629ffde91b16efb51c9dd6ad7d0f7 - + https://github.com/dotnet/runtime - 2a87ffeaedb6b534d6eaa000d5ba9b545f4aac1e + 9ede9a29128629ffde91b16efb51c9dd6ad7d0f7 - + https://github.com/dotnet/runtime - 2a87ffeaedb6b534d6eaa000d5ba9b545f4aac1e + 9ede9a29128629ffde91b16efb51c9dd6ad7d0f7 - + https://github.com/dotnet/runtime - 2a87ffeaedb6b534d6eaa000d5ba9b545f4aac1e + 9ede9a29128629ffde91b16efb51c9dd6ad7d0f7 - + https://github.com/dotnet/runtime - 2a87ffeaedb6b534d6eaa000d5ba9b545f4aac1e + 9ede9a29128629ffde91b16efb51c9dd6ad7d0f7 - + https://github.com/dotnet/runtime - 2a87ffeaedb6b534d6eaa000d5ba9b545f4aac1e + 9ede9a29128629ffde91b16efb51c9dd6ad7d0f7 - + https://github.com/dotnet/runtime - 2a87ffeaedb6b534d6eaa000d5ba9b545f4aac1e + 9ede9a29128629ffde91b16efb51c9dd6ad7d0f7 - + https://github.com/dotnet/runtime - 2a87ffeaedb6b534d6eaa000d5ba9b545f4aac1e + 9ede9a29128629ffde91b16efb51c9dd6ad7d0f7 - + https://github.com/dotnet/linker - a5f8466cb452f50436544572e38ff5faa17e2094 + f2dd65f51f6096f25e00e0d1e4c6af0e85d41865 - + https://github.com/dotnet/xharness - 952c5c3e6082b77d282d8158f6a1361ef23e205f + ed75873fb3b4c0e8746bce1fb325bfb5061b9851 - + https://github.com/dotnet/xharness - 952c5c3e6082b77d282d8158f6a1361ef23e205f + ed75873fb3b4c0e8746bce1fb325bfb5061b9851 - + https://github.com/dotnet/arcade - 0558f85d950fee2838bf02b9ba1f20d67f00b504 + 427c05909067bb2e484116ae2239456bb45adb85 - + https://dev.azure.com/dnceng/internal/_git/dotnet-optimization - 8455e2bb85f250a4f1649fcdc3658c25f4cd78aa + 91d6b3c1f51888d166701510189505f35714665c - + https://dev.azure.com/dnceng/internal/_git/dotnet-optimization - 8455e2bb85f250a4f1649fcdc3658c25f4cd78aa + 91d6b3c1f51888d166701510189505f35714665c - + https://dev.azure.com/dnceng/internal/_git/dotnet-optimization - 8455e2bb85f250a4f1649fcdc3658c25f4cd78aa + 91d6b3c1f51888d166701510189505f35714665c - + https://dev.azure.com/dnceng/internal/_git/dotnet-optimization - 8455e2bb85f250a4f1649fcdc3658c25f4cd78aa + 91d6b3c1f51888d166701510189505f35714665c - + https://github.com/dotnet/hotreload-utils - d7f8f855b9d6d3a7090b3bc2745d1bdc8c323fcc + 49922f7ec53df036084899e597f3c94627d709eb - + https://github.com/dotnet/runtime-assets - e444c9ce30e40a75994fe6b4fd5e87a7ef63355b + 8784c859561193c0a91b2b47108113a9a7c40038 - + https://github.com/dotnet/roslyn-analyzers - 3541eb2b9c85dd1416ba7571f49c0e44019756b7 + ffd024eb265e97e639a2879d869cf82b5b958992 https://github.com/dotnet/sdk diff --git a/eng/Versions.props b/eng/Versions.props index f903d0fbc672e5..257997d3583251 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -16,7 +16,6 @@ false release - true true false false @@ -51,36 +50,34 @@ 3.3.2 4.0.0-4.final 4.0.0-4.final - 7.0.0-preview1.21528.1 - - 4.0.0-5.21453.15 + 7.0.0-preview1.21572.6 2.0.0-alpha.1.21525.11 - 7.0.0-beta.21529.1 - 7.0.0-beta.21529.1 - 7.0.0-beta.21529.1 - 7.0.0-beta.21529.1 - 7.0.0-beta.21529.1 - 7.0.0-beta.21529.1 - 2.5.1-beta.21529.1 - 7.0.0-beta.21529.1 - 7.0.0-beta.21529.1 - 7.0.0-beta.21529.1 - 7.0.0-beta.21529.1 - 7.0.0-beta.21529.1 - 7.0.0-beta.21529.1 - 7.0.0-beta.21529.1 - 7.0.0-beta.21529.1 + 7.0.0-beta.21576.4 + 7.0.0-beta.21576.4 + 7.0.0-beta.21576.4 + 7.0.0-beta.21576.4 + 7.0.0-beta.21576.4 + 7.0.0-beta.21576.4 + 2.5.1-beta.21576.4 + 7.0.0-beta.21576.4 + 7.0.0-beta.21576.4 + 7.0.0-beta.21576.4 + 7.0.0-beta.21576.4 + 7.0.0-beta.21576.4 + 7.0.0-beta.21576.4 + 7.0.0-beta.21576.4 + 7.0.0-beta.21576.4 6.0.0-preview.1.102 - 7.0.0-alpha.1.21551.1 - 7.0.0-alpha.1.21551.1 - 7.0.0-alpha.1.21551.1 + 7.0.0-alpha.1.21576.4 + 7.0.0-alpha.1.21576.4 + 7.0.0-alpha.1.21576.4 3.1.0 - 7.0.0-alpha.1.21551.1 + 7.0.0-alpha.1.21576.4 5.0.0 4.3.0 @@ -115,28 +112,28 @@ 5.0.0 5.0.0 4.9.0-rc2.21473.1 - 7.0.0-alpha.1.21551.1 - 7.0.0-alpha.1.21551.1 + 7.0.0-alpha.1.21576.4 + 7.0.0-alpha.1.21576.4 4.5.4 4.5.0 - 7.0.0-alpha.1.21551.1 + 7.0.0-alpha.1.21576.4 - 7.0.0-beta.21520.1 - 7.0.0-beta.21520.1 - 7.0.0-beta.21520.1 - 7.0.0-beta.21520.1 - 7.0.0-beta.21520.1 - 7.0.0-beta.21520.1 - 7.0.0-beta.21520.1 - 7.0.0-beta.21520.1 - 7.0.0-beta.21520.1 - 7.0.0-beta.21520.1 - 7.0.0-beta.21520.1 + 7.0.0-beta.21579.1 + 7.0.0-beta.21579.1 + 7.0.0-beta.21579.1 + 7.0.0-beta.21579.1 + 7.0.0-beta.21579.1 + 7.0.0-beta.21579.1 + 7.0.0-beta.21579.1 + 7.0.0-beta.21579.1 + 7.0.0-beta.21579.1 + 7.0.0-beta.21579.1 + 7.0.0-beta.21579.1 - 1.0.0-prerelease.21530.2 - 1.0.0-prerelease.21530.2 - 1.0.0-prerelease.21530.2 - 1.0.0-prerelease.21530.2 + 1.0.0-prerelease.21577.2 + 1.0.0-prerelease.21577.2 + 1.0.0-prerelease.21577.2 + 1.0.0-prerelease.21577.2 16.9.0-beta1.21055.5 2.0.0-beta1.20253.1 @@ -146,7 +143,7 @@ 2.0.3 1.0.4-preview6.19326.1 0.2.61701 - 1.0.26 + 1.0.27 16.10.0 $(MicrosoftBuildVersion) 5.8.0 @@ -154,9 +151,9 @@ 1.0.1-prerelease-00006 16.9.0-preview-20201201-01 - 1.0.0-prerelease.21529.1 - 1.0.0-prerelease.21529.1 - 1.0.2-alpha.0.21525.2 + 1.0.0-prerelease.21579.1 + 1.0.0-prerelease.21579.1 + 1.0.2-alpha.0.21579.1 2.4.2-pre.9 2.4.2 1.3.0 @@ -169,23 +166,23 @@ 6.0.0-preview-20211019.1 - 7.0.100-1.21528.2 + 7.0.100-1.21562.1 $(MicrosoftNETILLinkTasksVersion) - 7.0.0-alpha.1.21525.1 + 7.0.0-alpha.1.21579.1 7.0.0-alpha.1.21529.3 - 11.1.0-alpha.1.21529.2 - 11.1.0-alpha.1.21529.2 - 11.1.0-alpha.1.21529.2 - 11.1.0-alpha.1.21529.2 - 11.1.0-alpha.1.21529.2 - 11.1.0-alpha.1.21529.2 - 11.1.0-alpha.1.21529.2 - 11.1.0-alpha.1.21529.2 + 11.1.0-alpha.1.21579.1 + 11.1.0-alpha.1.21579.1 + 11.1.0-alpha.1.21579.1 + 11.1.0-alpha.1.21579.1 + 11.1.0-alpha.1.21579.1 + 11.1.0-alpha.1.21579.1 + 11.1.0-alpha.1.21579.1 + 11.1.0-alpha.1.21579.1 - 7.0.0-alpha.1.21527.1 + 7.0.0-alpha.1.21560.2 $(MicrosoftNETWorkloadEmscriptenManifest70100Version) 1.1.87-gba258badda diff --git a/eng/build.ps1 b/eng/build.ps1 index 08afd6598ce971..83b9e5104d9000 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -266,6 +266,10 @@ foreach ($argument in $PSBoundParameters.Keys) } } +# Disable targeting pack caching as we reference a partially constructed targeting pack and update it later. +# The later changes are ignored when using the cache. +$env:DOTNETSDK_ALLOW_TARGETING_PACK_CACHING=0 + $failedBuilds = @() if ($os -eq "Browser") { diff --git a/eng/build.sh b/eng/build.sh index 1b20d7a922bc58..f1ef5958fdbc92 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -166,7 +166,7 @@ while [[ $# > 0 ]]; do opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" if [[ $firstArgumentChecked -eq 0 && $opt =~ ^[a-zA-Z.+]+$ ]]; then - if [ $opt == "help" ]; then + if [[ "$opt" == "help" ]]; then showSubsetHelp exit 0 fi @@ -190,7 +190,7 @@ while [[ $# > 0 ]]; do exit 0 else passedSubset="$(echo "$2" | tr "[:upper:]" "[:lower:]")" - if [ $passedSubset == "help" ]; then + if [[ "$passedSubset" == "help" ]]; then showSubsetHelp exit 0 fi @@ -461,13 +461,17 @@ if [ ${#actInt[@]} -eq 0 ]; then arguments="-restore -build $arguments" fi -if [ "$os" = "Browser" ] && [ "$arch" != "wasm" ]; then +if [[ "$os" == "Browser" && "$arch" != "wasm" ]]; then # override default arch for Browser, we only support wasm arch=wasm fi initDistroRid $os $arch $crossBuild $portableBuild +# Disable targeting pack caching as we reference a partially constructed targeting pack and update it later. +# The later changes are ignored when using the cache. +export DOTNETSDK_ALLOW_TARGETING_PACK_CACHING=0 + # URL-encode space (%20) to avoid quoting issues until the msbuild call in /eng/common/tools.sh. # In *proj files (XML docs), URL-encoded string are rendered in their decoded form. cmakeargs="${cmakeargs// /%20}" diff --git a/eng/common/build.sh b/eng/common/build.sh index bc07a1c6848243..55b298f16ccd1f 100755 --- a/eng/common/build.sh +++ b/eng/common/build.sh @@ -187,10 +187,6 @@ function InitializeCustomToolset { } function Build { - - if [[ "$ci" == true ]]; then - TryLogClientIpAddress - fi InitializeToolset InitializeCustomToolset diff --git a/eng/common/darc-init.sh b/eng/common/darc-init.sh index 39abdbecdcf11b..84c1d0cc2e75ac 100755 --- a/eng/common/darc-init.sh +++ b/eng/common/darc-init.sh @@ -53,7 +53,7 @@ fi function InstallDarcCli { local darc_cli_package_name="microsoft.dotnet.darc" - InitializeDotNetCli + InitializeDotNetCli true local dotnet_root=$_InitializeDotNetCli if [ -z "$toolpath" ]; then diff --git a/eng/common/msbuild.ps1 b/eng/common/msbuild.ps1 index eea19cd8452fd5..f041e5ddd95892 100644 --- a/eng/common/msbuild.ps1 +++ b/eng/common/msbuild.ps1 @@ -6,6 +6,7 @@ Param( [switch] $ci, [switch] $prepareMachine, [switch] $excludePrereleaseVS, + [string] $msbuildEngine = $null, [Parameter(ValueFromRemainingArguments=$true)][String[]]$extraArgs ) diff --git a/eng/common/native/init-compiler.sh b/eng/common/native/init-compiler.sh index 8c944f30b28649..e361e03fabdd2e 100644 --- a/eng/common/native/init-compiler.sh +++ b/eng/common/native/init-compiler.sh @@ -2,6 +2,7 @@ # # This file detects the C/C++ compiler and exports it to the CC/CXX environment variables # +# NOTE: some scripts source this file and rely on stdout being empty, make sure to not output anything here! if [[ "$#" -lt 3 ]]; then echo "Usage..." @@ -111,12 +112,10 @@ if [[ -z "$CC" ]]; then exit 1 fi -if [[ "$compiler" == "clang" ]]; then - if command -v "lld$desired_version" > /dev/null; then - # Only lld version >= 9 can be considered stable - if [[ "$majorVersion" -ge 9 ]]; then - LDFLAGS="-fuse-ld=lld" - fi +# Only lld version >= 9 can be considered stable +if [[ "$compiler" == "clang" && "$majorVersion" -ge 9 ]]; then + if "$CC" -fuse-ld=lld -Wl,--version >/dev/null 2>&1; then + LDFLAGS="-fuse-ld=lld" fi fi diff --git a/eng/common/post-build/symbols-validation.ps1 b/eng/common/post-build/symbols-validation.ps1 index a4a92efbedf9a9..cd2181bafa057d 100644 --- a/eng/common/post-build/symbols-validation.ps1 +++ b/eng/common/post-build/symbols-validation.ps1 @@ -134,17 +134,17 @@ $CountMissingSymbols = { # Save the output and get diagnostic output $output = & $dotnetSymbolExe --symbols --modules $WindowsPdbVerificationParam $TargetServerParam $FullPath -o $SymbolsPath --diagnostics | Out-String - if (Test-Path $PdbPath) { - return 'PDB' + if ((Test-Path $PdbPath) -and (Test-path $SymbolPath)) { + return 'Module and PDB for Module' } - elseif (Test-Path $NGenPdb) { - return 'NGen PDB' + elseif ((Test-Path $NGenPdb) -and (Test-Path $PdbPath) -and (Test-Path $SymbolPath)) { + return 'Dll, PDB and NGen PDB' } - elseif (Test-Path $SODbg) { - return 'DBG for SO' + elseif ((Test-Path $SODbg) -and (Test-Path $SymbolPath)) { + return 'So and DBG for SO' } - elseif (Test-Path $DylibDwarf) { - return 'Dwarf for Dylib' + elseif ((Test-Path $DylibDwarf) -and (Test-Path $SymbolPath)) { + return 'Dylib and Dwarf for Dylib' } elseif (Test-Path $SymbolPath) { return 'Module' diff --git a/eng/common/sdk-task.ps1 b/eng/common/sdk-task.ps1 index 7ab9baac5c8d9a..b1bca63ab1d82c 100644 --- a/eng/common/sdk-task.ps1 +++ b/eng/common/sdk-task.ps1 @@ -83,9 +83,6 @@ try { } if ($restore) { - if ($ci) { - Try-LogClientIpAddress - } Build 'Restore' } diff --git a/eng/common/sdl/execute-all-sdl-tools.ps1 b/eng/common/sdl/execute-all-sdl-tools.ps1 index 1157151f4862a2..e5bef8ebd3a3b4 100644 --- a/eng/common/sdl/execute-all-sdl-tools.ps1 +++ b/eng/common/sdl/execute-all-sdl-tools.ps1 @@ -124,7 +124,7 @@ try { Exec-BlockVerbosely { & $(Join-Path $PSScriptRoot 'run-sdl.ps1') ` -GuardianCliLocation $guardianCliLocation ` - -WorkingDirectory $workingDirectory ` + -WorkingDirectory $SourceDirectory ` -UpdateBaseline $UpdateBaseline ` -GdnFolder $gdnFolder } diff --git a/eng/common/templates/job/job.yml b/eng/common/templates/job/job.yml index 37dceb1bab0a93..7678b94ce740c0 100644 --- a/eng/common/templates/job/job.yml +++ b/eng/common/templates/job/job.yml @@ -114,6 +114,7 @@ jobs: continueOnError: ${{ parameters.continueOnError }} condition: and(succeeded(), in(variables['_SignType'], 'real', 'test'), eq(variables['Agent.Os'], 'Windows_NT')) + - ${{ if and(eq(parameters.runAsPublic, 'false'), eq(variables['System.TeamProject'], 'internal')) }}: - task: NuGetAuthenticate@0 - ${{ if or(eq(parameters.artifacts.download, 'true'), ne(parameters.artifacts.download, '')) }}: diff --git a/eng/common/templates/job/source-build.yml b/eng/common/templates/job/source-build.yml index 5023d36dcb3c5b..5cd5325d7b4e6b 100644 --- a/eng/common/templates/job/source-build.yml +++ b/eng/common/templates/job/source-build.yml @@ -31,11 +31,6 @@ parameters: # container and pool. platform: {} - # The default VM host AzDO pool. This should be capable of running Docker containers: almost all - # source-build builds run in Docker, including the default managed platform. - defaultContainerHostPool: - vmImage: ubuntu-20.04 - jobs: - job: ${{ parameters.jobNamePrefix }}_${{ parameters.platform.name }} displayName: Source-Build (${{ parameters.platform.name }}) @@ -47,7 +42,15 @@ jobs: container: ${{ parameters.platform.container }} ${{ if eq(parameters.platform.pool, '') }}: - pool: ${{ parameters.defaultContainerHostPool }} + # The default VM host AzDO pool. This should be capable of running Docker containers: almost all + # source-build builds run in Docker, including the default managed platform. + pool: + ${{ if eq(variables['System.TeamProject'], 'public') }}: + name: NetCore1ESPool-Public + demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open + ${{ if eq(variables['System.TeamProject'], 'internal') }}: + name: NetCore1ESPool-Internal + demands: ImageOverride -equals Build.Ubuntu.1804.Amd64 ${{ if ne(parameters.platform.pool, '') }}: pool: ${{ parameters.platform.pool }} diff --git a/eng/common/templates/job/source-index-stage1.yml b/eng/common/templates/job/source-index-stage1.yml index ae85a99a853f4b..4af724eb1a9ec9 100644 --- a/eng/common/templates/job/source-index-stage1.yml +++ b/eng/common/templates/job/source-index-stage1.yml @@ -5,8 +5,6 @@ parameters: sourceIndexBuildCommand: powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "eng/common/build.ps1 -restore -build -binarylog -ci" preSteps: [] binlogPath: artifacts/log/Debug/Build.binlog - pool: - vmImage: 'windows-2019' condition: '' dependsOn: '' @@ -24,7 +22,13 @@ jobs: - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - group: source-dot-net stage1 variables - pool: ${{ parameters.pool }} + pool: + ${{ if eq(variables['System.TeamProject'], 'public') }}: + name: NetCore1ESPool-Public + demands: ImageOverride -equals Build.Server.Amd64.VS2019.Open + ${{ if eq(variables['System.TeamProject'], 'internal') }}: + name: NetCore1ESPool-Internal + demands: ImageOverride -equals Build.Server.Amd64.VS2019 steps: - ${{ each preStep in parameters.preSteps }}: - ${{ preStep }} diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 44484289943ed5..f1e1cb53953bcc 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -163,9 +163,6 @@ function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) { # Disable telemetry on CI. if ($ci) { $env:DOTNET_CLI_TELEMETRY_OPTOUT=1 - - # In case of network error, try to log the current IP for reference - Try-LogClientIpAddress } # Source Build uses DotNetCoreSdkDir variable @@ -301,32 +298,45 @@ function InstallDotNet([string] $dotnetRoot, if ($skipNonVersionedFiles) { $installParameters.SkipNonVersionedFiles = $skipNonVersionedFiles } if ($noPath) { $installParameters.NoPath = $True } - try { - & $installScript @installParameters - } - catch { - if ($runtimeSourceFeed -or $runtimeSourceFeedKey) { - Write-Host "Failed to install dotnet from public location. Trying from '$runtimeSourceFeed'" - if ($runtimeSourceFeed) { $installParameters.AzureFeed = $runtimeSourceFeed } + $variations = @() + $variations += @($installParameters) - if ($runtimeSourceFeedKey) { - $decodedBytes = [System.Convert]::FromBase64String($runtimeSourceFeedKey) - $decodedString = [System.Text.Encoding]::UTF8.GetString($decodedBytes) - $installParameters.FeedCredential = $decodedString - } + $dotnetBuilds = $installParameters.Clone() + $dotnetbuilds.AzureFeed = "https://dotnetbuilds.azureedge.net/public" + $variations += @($dotnetBuilds) - try { - & $installScript @installParameters - } - catch { - Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "Failed to install dotnet from custom location '$runtimeSourceFeed'." - ExitWithExitCode 1 - } + if ($runtimeSourceFeed) { + $runtimeSource = $installParameters.Clone() + $runtimeSource.AzureFeed = $runtimeSourceFeed + if ($runtimeSourceFeedKey) { + $decodedBytes = [System.Convert]::FromBase64String($runtimeSourceFeedKey) + $decodedString = [System.Text.Encoding]::UTF8.GetString($decodedBytes) + $runtimeSource.FeedCredential = $decodedString + } + $variations += @($runtimeSource) + } + + $installSuccess = $false + foreach ($variation in $variations) { + if ($variation | Get-Member AzureFeed) { + $location = $variation.AzureFeed } else { - Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "Failed to install dotnet from public location." - ExitWithExitCode 1 + $location = "public location"; + } + Write-Host "Attempting to install dotnet from $location." + try { + & $installScript @variation + $installSuccess = $true + break + } + catch { + Write-Host "Failed to install dotnet from $location." } } + if (-not $installSuccess) { + Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "Failed to install dotnet from any of the specified locations." + ExitWithExitCode 1 + } } # @@ -882,24 +892,6 @@ if (!$disableConfigureToolsetImport) { } } -function Try-LogClientIpAddress() -{ - Write-Host "Attempting to log this client's IP for Azure Package feed telemetry purposes" - try - { - $result = Invoke-WebRequest -Uri "http://co1.msedge.net/fdv2/diagnostics.aspx" -UseBasicParsing - $lines = $result.Content.Split([Environment]::NewLine) - $socketIp = $lines | Select-String -Pattern "^Socket IP:.*" - Write-Host $socketIp - $clientIp = $lines | Select-String -Pattern "^Client IP:.*" - Write-Host $clientIp - } - catch - { - Write-Host "Unable to get this machine's effective IP address for logging: $_" - } -} - # # If $ci flag is set, turn on (and log that we did) special environment variables for improved Nuget client retry logic. # diff --git a/eng/common/tools.sh b/eng/common/tools.sh index 6a4871ef72b7a9..e555c34269f6e8 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -188,28 +188,29 @@ function InstallDotNet { GetDotNetInstallScript "$root" local install_script=$_GetDotNetInstallScript - local archArg='' + local installParameters=(--version $version --install-dir "$root") + if [[ -n "${3:-}" ]] && [ "$3" != 'unset' ]; then - archArg="--architecture $3" + installParameters+=(--architecture $3) fi - local runtimeArg='' if [[ -n "${4:-}" ]] && [ "$4" != 'sdk' ]; then - runtimeArg="--runtime $4" + installParameters+=(--runtime $4) fi - local skipNonVersionedFilesArg="" if [[ "$#" -ge "5" ]] && [[ "$5" != 'false' ]]; then - skipNonVersionedFilesArg="--skip-non-versioned-files" + installParameters+=(--skip-non-versioned-files) fi - bash "$install_script" --version $version --install-dir "$root" $archArg $runtimeArg $skipNonVersionedFilesArg || { - local exit_code=$? - echo "Failed to install dotnet SDK from public location (exit code '$exit_code')." - local runtimeSourceFeed='' - if [[ -n "${6:-}" ]]; then - runtimeSourceFeed="--azure-feed $6" - fi + local variations=() # list of variable names with parameter arrays in them + + local public_location=("${installParameters[@]}") + variations+=(public_location) - local runtimeSourceFeedKey='' + local dotnetbuilds=("${installParameters[@]}" --azure-feed "https://dotnetbuilds.azureedge.net/public") + variations+=(dotnetbuilds) + + if [[ -n "${6:-}" ]]; then + variations+=(private_feed) + local private_feed=("${installParameters[@]}" --azure-feed $6) if [[ -n "${7:-}" ]]; then # The 'base64' binary on alpine uses '-d' and doesn't support '--decode' # '-d'. To work around this, do a simple detection and switch the parameter @@ -219,22 +220,27 @@ function InstallDotNet { decodeArg="-d" fi decodedFeedKey=`echo $7 | base64 $decodeArg` - runtimeSourceFeedKey="--feed-credential $decodedFeedKey" + private_feed+=(--feed-credential $decodedFeedKey) fi + fi - if [[ -n "$runtimeSourceFeed" || -n "$runtimeSourceFeedKey" ]]; then - bash "$install_script" --version $version --install-dir "$root" $archArg $runtimeArg $skipNonVersionedFilesArg $runtimeSourceFeed $runtimeSourceFeedKey || { - local exit_code=$? - Write-PipelineTelemetryError -category 'InitializeToolset' "Failed to install dotnet SDK from custom location '$runtimeSourceFeed' (exit code '$exit_code')." - ExitWithExitCode $exit_code - } - else - if [[ $exit_code != 0 ]]; then - Write-PipelineTelemetryError -category 'InitializeToolset' "Failed to install dotnet SDK from public location (exit code '$exit_code')." - fi - ExitWithExitCode $exit_code + local installSuccess=0 + for variationName in "${variations[@]}"; do + local name="$variationName[@]" + local variation=("${!name}") + echo "Attempting to install dotnet from $variationName." + bash "$install_script" "${variation[@]}" && installSuccess=1 + if [[ "$installSuccess" -eq 1 ]]; then + break fi - } + + echo "Failed to install dotnet from $variationName." + done + + if [[ "$installSuccess" -eq 0 ]]; then + Write-PipelineTelemetryError -category 'InitializeToolset' "Failed to install dotnet SDK from any of the specified locations." + ExitWithExitCode 1 + fi } function with_retries { @@ -399,13 +405,6 @@ function StopProcesses { return 0 } -function TryLogClientIpAddress () { - echo 'Attempting to log this client''s IP for Azure Package feed telemetry purposes' - if command -v curl > /dev/null; then - curl -s 'http://co1.msedge.net/fdv2/diagnostics.aspx' | grep ' IP: ' || true - fi -} - function MSBuild { local args=$@ if [[ "$pipelines_log" == true ]]; then diff --git a/eng/docker/build-docker-sdk.ps1 b/eng/docker/build-docker-sdk.ps1 index e3fbaef77d1d36..570d4c5ba738aa 100755 --- a/eng/docker/build-docker-sdk.ps1 +++ b/eng/docker/build-docker-sdk.ps1 @@ -6,21 +6,16 @@ Param( [string][Alias('t')]$imageName = "dotnet-sdk-libs-current", [string][Alias('c')]$configuration = "Release", - [switch][Alias('w')]$buildWindowsContainers, - [switch][Alias('pa')]$privateAspNetCore + [switch][Alias('w')]$buildWindowsContainers ) +$dotNetVersion="7.0" $ErrorActionPreference = "Stop" $REPO_ROOT_DIR=$(git -C "$PSScriptRoot" rev-parse --show-toplevel) $dockerFilePrefix="$PSScriptRoot/libraries-sdk" -if ($privateAspNetCore) -{ - $dockerFilePrefix="$PSScriptRoot/libraries-sdk-aspnetcore" -} - if ($buildWindowsContainers) { # Due to size concerns, we don't currently do docker builds on windows. @@ -34,12 +29,39 @@ if ($buildWindowsContainers) } $dockerFile="$dockerFilePrefix.windows.Dockerfile" + + # Collect the following artifacts to folder, that will be used as build context for the container, + # so projects can build and test against the live-built runtime: + # 1. Reference assembly pack (microsoft.netcore.app.ref) + # 2. Runtime pack (microsoft.netcore.app.runtime.win-x64) + # 3. targetingpacks.targets, so stress test builds can target the live-built runtime instead of the one in the pre-installed SDK + # 4. testhost + $binArtifacts = "$REPO_ROOT_DIR\artifacts\bin" + $dockerContext = "$REPO_ROOT_DIR\artifacts\docker-context" + if (Test-Path $dockerContext) { + Remove-Item -Recurse -Force $dockerContext + } + + Copy-Item -Recurse -Path $binArtifacts\microsoft.netcore.app.ref ` + -Destination $dockerContext\microsoft.netcore.app.ref + Copy-Item -Recurse -Path $binArtifacts\microsoft.netcore.app.runtime.win-x64 ` + -Destination $dockerContext\microsoft.netcore.app.runtime.win-x64 + Copy-Item -Recurse -Path $binArtifacts\testhost ` + -Destination $dockerContext\testhost + Copy-Item -Recurse -Path $REPO_ROOT_DIR\eng\targetingpacks.targets ` + -Destination $dockerContext\targetingpacks.targets + + # In case of non-CI builds, testhost may already contain Microsoft.AspNetCore.App (see build-local.ps1 in HttpStress): + $testHostAspNetCorePath="$dockerContext\testhost\net$dotNetVersion-windows-$configuration-x64/shared/Microsoft.AspNetCore.App" + if (Test-Path $testHostAspNetCorePath) { + Remove-Item -Recurse -Force $testHostAspNetCorePath + } + docker build --tag $imageName ` --build-arg CONFIGURATION=$configuration ` - --build-arg TESTHOST_LOCATION=. ` --file $dockerFile ` - "$REPO_ROOT_DIR/artifacts/bin/testhost" + $dockerContext } else { diff --git a/eng/docker/build-docker-sdk.sh b/eng/docker/build-docker-sdk.sh index c2cdb81efae9a3..92fc632ec05e2a 100755 --- a/eng/docker/build-docker-sdk.sh +++ b/eng/docker/build-docker-sdk.sh @@ -23,7 +23,6 @@ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" imagename="dotnet-sdk-libs-current" configuration="Release" -privateaspnetcore=0 while [[ $# > 0 ]]; do opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" @@ -36,10 +35,6 @@ while [[ $# > 0 ]]; do configuration=$2 shift 2 ;; - -privateaspnetcore|-pa) - privateaspnetcore=1 - shift 1 - ;; *) shift 1 ;; @@ -49,13 +44,9 @@ done repo_root=$(git rev-parse --show-toplevel) docker_file="$scriptroot/libraries-sdk.linux.Dockerfile" -if [[ $privateaspnetcore -eq 1 ]]; then - docker_file="$scriptroot/libraries-sdk-aspnetcore.linux.Dockerfile" -fi - docker build --tag $imagename \ --build-arg CONFIGURATION=$configuration \ --file $docker_file \ $repo_root -exit $? +exit $? \ No newline at end of file diff --git a/eng/docker/libraries-sdk-aspnetcore.linux.Dockerfile b/eng/docker/libraries-sdk-aspnetcore.linux.Dockerfile deleted file mode 100644 index 184ffdb8bcc8b4..00000000000000 --- a/eng/docker/libraries-sdk-aspnetcore.linux.Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -# Builds and copies library artifacts into target dotnet sdk image -ARG BUILD_BASE_IMAGE=mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-f39df28-20191023143754 -ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:6.0-bullseye-slim - -FROM $BUILD_BASE_IMAGE as corefxbuild - -WORKDIR /repo -COPY . . - -ARG CONFIGURATION=Release -RUN ./src/coreclr/build.sh -release -skiptests -clang9 && \ - ./libraries.sh -c $CONFIGURATION -runtimeconfiguration release - -FROM $SDK_BASE_IMAGE as target - -ARG TESTHOST_LOCATION=/repo/artifacts/bin/testhost -ARG TFM=net7.0 -ARG OS=Linux -ARG ARCH=x64 -ARG CONFIGURATION=Release - -ARG COREFX_SHARED_FRAMEWORK_NAME=Microsoft.NETCore.App -ARG ASPNETCORE_SHARED_NAME=Microsoft.AspNetCore.App -ARG SOURCE_COREFX_VERSION=7.0.0 -ARG TARGET_SHARED_FRAMEWORK=/usr/share/dotnet/shared -ARG TARGET_COREFX_VERSION=$DOTNET_VERSION - -COPY --from=corefxbuild \ - $TESTHOST_LOCATION/$TFM-$OS-$CONFIGURATION-$ARCH/shared/$COREFX_SHARED_FRAMEWORK_NAME/$SOURCE_COREFX_VERSION/* \ - $TARGET_SHARED_FRAMEWORK/$COREFX_SHARED_FRAMEWORK_NAME/$TARGET_COREFX_VERSION/ -COPY --from=corefxbuild \ - $TESTHOST_LOCATION/$TFM-$OS-$CONFIGURATION-$ARCH/shared/$COREFX_SHARED_FRAMEWORK_NAME/$SOURCE_COREFX_VERSION/* \ - $TARGET_SHARED_FRAMEWORK/$COREFX_SHARED_FRAMEWORK_NAME/$SOURCE_COREFX_VERSION/ -COPY --from=corefxbuild \ - $TESTHOST_LOCATION/$TFM-$OS-$CONFIGURATION-$ARCH/shared/$ASPNETCORE_SHARED_NAME/$SOURCE_COREFX_VERSION/* \ - $TARGET_SHARED_FRAMEWORK/$ASPNETCORE_SHARED_NAME/$TARGET_COREFX_VERSION/ \ No newline at end of file diff --git a/eng/docker/libraries-sdk-aspnetcore.windows.Dockerfile b/eng/docker/libraries-sdk-aspnetcore.windows.Dockerfile deleted file mode 100644 index 75cc112b6acb3e..00000000000000 --- a/eng/docker/libraries-sdk-aspnetcore.windows.Dockerfile +++ /dev/null @@ -1,26 +0,0 @@ -# escape=` -# Simple Dockerfile which copies library build artifacts into target dotnet sdk image -ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:6.0-nanoserver-1809 -FROM $SDK_BASE_IMAGE as target - -ARG TESTHOST_LOCATION=".\\artifacts\\bin\\testhost" -ARG TFM=net7.0 -ARG OS=windows -ARG ARCH=x64 -ARG CONFIGURATION=Release - -ARG COREFX_SHARED_FRAMEWORK_NAME=Microsoft.NETCore.App -ARG ASPNETCORE_SHARED_NAME=Microsoft.AspNetCore.App -ARG SOURCE_COREFX_VERSION=7.0.0 -ARG TARGET_SHARED_FRAMEWORK="C:\\Program Files\\dotnet\\shared" -ARG TARGET_COREFX_VERSION=$DOTNET_VERSION - -COPY ` - $TESTHOST_LOCATION\$TFM-$OS-$CONFIGURATION-$ARCH\shared\$COREFX_SHARED_FRAMEWORK_NAME\$SOURCE_COREFX_VERSION\ ` - $TARGET_SHARED_FRAMEWORK\$COREFX_SHARED_FRAMEWORK_NAME\$TARGET_COREFX_VERSION\ -COPY ` - $TESTHOST_LOCATION\$TFM-$OS-$CONFIGURATION-$ARCH\shared\$COREFX_SHARED_FRAMEWORK_NAME\$SOURCE_COREFX_VERSION\ ` - $TARGET_SHARED_FRAMEWORK\$COREFX_SHARED_FRAMEWORK_NAME\$SOURCE_COREFX_VERSION\ -COPY ` - $TESTHOST_LOCATION\$TFM-$OS-$CONFIGURATION-$ARCH\shared\$ASPNETCORE_SHARED_NAME\$SOURCE_COREFX_VERSION\ ` - $TARGET_SHARED_FRAMEWORK\$ASPNETCORE_SHARED_NAME\$TARGET_COREFX_VERSION\ diff --git a/eng/docker/libraries-sdk.linux.Dockerfile b/eng/docker/libraries-sdk.linux.Dockerfile index 6f79a9c39ee7c3..9d7b339383ac6a 100644 --- a/eng/docker/libraries-sdk.linux.Dockerfile +++ b/eng/docker/libraries-sdk.linux.Dockerfile @@ -4,25 +4,47 @@ ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:6.0-bullseye-slim FROM $BUILD_BASE_IMAGE as corefxbuild +ARG CONFIGURATION=Release + WORKDIR /repo COPY . . - -ARG CONFIGURATION=Release -RUN ./build.sh -ci -subset clr+libs -runtimeconfiguration release -c $CONFIGURATION +RUN ./build.sh clr+libs -runtimeconfiguration Release -configuration $CONFIGURATION -ci FROM $SDK_BASE_IMAGE as target -ARG TESTHOST_LOCATION=/repo/artifacts/bin/testhost -ARG TFM=net7.0 -ARG OS=Linux -ARG ARCH=x64 +ARG VERSION=7.0 ARG CONFIGURATION=Release +ENV _DOTNET_INSTALL_CHANNEL="$VERSION.1xx" + +# Install latest daily SDK: +RUN wget https://dot.net/v1/dotnet-install.sh +RUN bash ./dotnet-install.sh --channel $_DOTNET_INSTALL_CHANNEL --quality daily --install-dir /usr/share/dotnet + +# Collect the following artifacts under /live-runtime-artifacts, +# so projects can build and test against the live-built runtime: +# 1. Reference assembly pack (microsoft.netcore.app.ref) +# 2. Runtime pack (microsoft.netcore.app.runtime.linux-x64) +# 3. targetingpacks.targets, so stress test builds can target the live-built runtime instead of the one in the pre-installed SDK +# 4. testhost -ARG COREFX_SHARED_FRAMEWORK_NAME=Microsoft.NETCore.App -ARG SOURCE_COREFX_VERSION=7.0.0 -ARG TARGET_SHARED_FRAMEWORK=/usr/share/dotnet/shared -ARG TARGET_COREFX_VERSION=$DOTNET_VERSION +COPY --from=corefxbuild \ + /repo/artifacts/bin/microsoft.netcore.app.ref \ + /live-runtime-artifacts/microsoft.netcore.app.ref + +COPY --from=corefxbuild \ + /repo/artifacts/bin/microsoft.netcore.app.runtime.linux-x64 \ + /live-runtime-artifacts/microsoft.netcore.app.runtime.linux-x64 COPY --from=corefxbuild \ - $TESTHOST_LOCATION/$TFM-$OS-$CONFIGURATION-$ARCH/shared/$COREFX_SHARED_FRAMEWORK_NAME/$SOURCE_COREFX_VERSION/* \ - $TARGET_SHARED_FRAMEWORK/$COREFX_SHARED_FRAMEWORK_NAME/$TARGET_COREFX_VERSION/ \ No newline at end of file + /repo/eng/targetingpacks.targets \ + /live-runtime-artifacts/targetingpacks.targets + +COPY --from=corefxbuild \ + /repo/artifacts/bin/testhost \ + /live-runtime-artifacts/testhost + +# Add AspNetCore bits to testhost: +ENV _ASPNETCORE_SOURCE="/usr/share/dotnet/shared/Microsoft.AspNetCore.App/$VERSION*" +ENV _ASPNETCORE_DEST="/live-runtime-artifacts/testhost/net$VERSION-Linux-$CONFIGURATION-x64/shared/Microsoft.AspNetCore.App" +RUN mkdir -p $_ASPNETCORE_DEST +RUN cp -r $_ASPNETCORE_SOURCE $_ASPNETCORE_DEST \ No newline at end of file diff --git a/eng/docker/libraries-sdk.windows.Dockerfile b/eng/docker/libraries-sdk.windows.Dockerfile index 6a7b7764185b3b..c3be811a2cae73 100644 --- a/eng/docker/libraries-sdk.windows.Dockerfile +++ b/eng/docker/libraries-sdk.windows.Dockerfile @@ -3,17 +3,23 @@ ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:6.0-nanoserver-1809 FROM $SDK_BASE_IMAGE as target -ARG TESTHOST_LOCATION=".\\artifacts\\bin\\testhost" -ARG TFM=net7.0 -ARG OS=windows -ARG ARCH=x64 +SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ARG VERSION=7.0 +ENV _DOTNET_INSTALL_CHANNEL="$VERSION.1xx" ARG CONFIGURATION=Release -ARG COREFX_SHARED_FRAMEWORK_NAME=Microsoft.NETCore.App -ARG SOURCE_COREFX_VERSION=7.0.0 -ARG TARGET_SHARED_FRAMEWORK="C:\\Program Files\\dotnet\\shared" -ARG TARGET_COREFX_VERSION=$DOTNET_VERSION +USER ContainerAdministrator + +RUN Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile .\dotnet-install.ps1 +RUN & .\dotnet-install.ps1 -Channel $env:_DOTNET_INSTALL_CHANNEL -Quality daily -InstallDir 'C:/Program Files/dotnet' + +USER ContainerUser + +COPY . /live-runtime-artifacts -COPY ` - $TESTHOST_LOCATION\$TFM-$OS-$CONFIGURATION-$ARCH\shared\$COREFX_SHARED_FRAMEWORK_NAME\$SOURCE_COREFX_VERSION\ ` - $TARGET_SHARED_FRAMEWORK\$COREFX_SHARED_FRAMEWORK_NAME\$TARGET_COREFX_VERSION\ +# Add AspNetCore bits to testhost: +ENV _ASPNETCORE_SOURCE="C:/Program Files/dotnet/shared/Microsoft.AspNetCore.App/$VERSION*" +ENV _ASPNETCORE_DEST="C:/live-runtime-artifacts/testhost/net$VERSION-windows-$CONFIGURATION-x64/shared/Microsoft.AspNetCore.App" +RUN & New-Item -ItemType Directory -Path $env:_ASPNETCORE_DEST +RUN Copy-Item -Recurse -Path $env:_ASPNETCORE_SOURCE -Destination $env:_ASPNETCORE_DEST \ No newline at end of file diff --git a/eng/formatting/format.sh b/eng/formatting/format.sh index 5a9edf4c33997c..eb4908c078c8a2 100644 --- a/eng/formatting/format.sh +++ b/eng/formatting/format.sh @@ -7,14 +7,14 @@ MANAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM "*.cs" "*.vb" | exec 1>&2 -if [[ -n "$NATIVE_FILES" ]]; then +if [ -n "$NATIVE_FILES" ]; then # Format all selected files echo "$NATIVE_FILES" | cat | xargs | sed -e 's/ /,/g' | xargs "./artifacts/tools/clang-format" -style=file -i # Add back the modified files to staging echo "$NATIVE_FILES" | xargs git add fi -if [[ -n "$MANAGED_FILES" ]]; then +if [ -n "$MANAGED_FILES" ]; then # Format all selected files echo "$MANAGED_FILES" | cat | xargs | sed -e 's/ /,/g' | dotnet format --include @@ -22,5 +22,4 @@ if [[ -n "$MANAGED_FILES" ]]; then echo "$MANAGED_FILES" | xargs git add fi - exit 0 diff --git a/eng/generators.targets b/eng/generators.targets index e20fa992012aab..13926ce90bd7ed 100644 --- a/eng/generators.targets +++ b/eng/generators.targets @@ -3,7 +3,6 @@ true - false true @@ -11,32 +10,57 @@ + - references System.Runtime.InteropServices --> + + + + + - - - + + + + + + true @@ -59,16 +83,6 @@ $(DefineConstants);DLLIMPORTGENERATOR_INTERNALUNSAFE - - - - - - - - $(DefineConstants);DLLIMPORTGENERATOR_ENABLED diff --git a/eng/illink.targets b/eng/illink.targets index 6c2d95c8477237..018075d8b660b5 100644 --- a/eng/illink.targets +++ b/eng/illink.targets @@ -236,6 +236,7 @@ $(ILLinkArgs) -b true $(ILLinkArgs) -x "$(ILLinkDescriptorsLibraryBuildXml)" + $(ILLinkArgs) --substitutions "$(ILLinkSubstitutionsLibraryBuildXml)" $(LinkerNoWarn);IL2067;IL2068;IL2069;IL2070;IL2071;IL2072;IL2073;IL2074;IL2075;IL2076;IL2077;IL2078;IL2079;IL2080;IL2081;IL2082;IL2083;IL2084;IL2085;IL2086;IL2087;IL2088;IL2089;IL2090;IL2091 $(ILLinkArgs) --nowarn $(LinkerNoWarn) + $(ILLinkArgs) --disable-opt ipconstprop diff --git a/eng/install-native-dependencies.sh b/eng/install-native-dependencies.sh index a29dfdf78aae49..0b6a8a07abcc42 100755 --- a/eng/install-native-dependencies.sh +++ b/eng/install-native-dependencies.sh @@ -22,7 +22,7 @@ if [ "$1" = "Linux" ]; then if [ "$?" != "0" ]; then exit 1; fi -elif [ "$1" = "MacCatalyst" ] || [ "$1" = "OSX" ] || [ "$1" = "tvOS" ] || [ "$1" = "iOS" ]; then +elif [[ "$1" == "MacCatalyst" || "$1" == "OSX" || "$1" == "tvOS" || "$1" == "iOS" ]]; then engdir=$(dirname "${BASH_SOURCE[0]}") echo "Installed xcode version: `xcode-select -p`" diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index d62f4bcd438d8c..1cd7a1d81a2aae 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -139,13 +139,20 @@ Text="The 'libs' subset must be built before building this project. Missing artifacts: $(LibrariesNativeArtifactsPath). Configuration: '$(LibrariesConfiguration)'. To use a different configuration, specify the 'LibrariesConfiguration' property." /> - + + + + + + + + - - - + + $(RuntimeIdGraphDefinitionFile) diff --git a/eng/native/build-commons.sh b/eng/native/build-commons.sh index 93afd4afec4dfb..4aebd45649a04c 100755 --- a/eng/native/build-commons.sh +++ b/eng/native/build-commons.sh @@ -48,7 +48,9 @@ check_prereqs() build_native() { - eval "$__RepoRootDir/eng/native/version/copy_version_files.sh" + if [[ ! -e "$__RepoRootDir/artifacts/obj/_version.c" ]]; then + eval "$__RepoRootDir/eng/native/version/copy_version_files.sh" + fi targetOS="$1" platformArch="$2" @@ -257,7 +259,7 @@ while :; do break fi - lowerI="$(echo "$1" | tr "[:upper:]" "[:lower:]")" + lowerI="$(echo "${1/--/-}" | tr "[:upper:]" "[:lower:]")" case "$lowerI" in -\?|-h|--help) usage @@ -452,7 +454,7 @@ if [[ "$__CrossBuild" == 1 ]]; then CROSSCOMPILE=1 export CROSSCOMPILE # Darwin that doesn't use rootfs - if [[ ! -n "$ROOTFS_DIR" && "$platform" != "Darwin" ]]; then + if [[ -z "$ROOTFS_DIR" && "$platform" != "Darwin" ]]; then ROOTFS_DIR="$__RepoRootDir/.tools/rootfs/$__BuildArch" export ROOTFS_DIR fi diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index a29857451bc79f..0421f1f03ce0a9 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -525,7 +525,7 @@ if (MSVC) # disable C++ RTTI # /GR is added by default by CMake, so remove it manually. - string(REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + string(REPLACE "/GR " " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") add_compile_options($<$:/FC>) # use full pathnames in diagnostics diff --git a/eng/native/configurepaths.cmake b/eng/native/configurepaths.cmake index 19407a40a1957a..3f41026eee2ac4 100644 --- a/eng/native/configurepaths.cmake +++ b/eng/native/configurepaths.cmake @@ -1,7 +1,6 @@ get_filename_component(CLR_REPO_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../.. ABSOLUTE) set(CLR_ENG_NATIVE_DIR ${CMAKE_CURRENT_LIST_DIR}) get_filename_component(CLR_SRC_NATIVE_DIR ${CMAKE_CURRENT_LIST_DIR}/../../src/native ABSOLUTE) -get_filename_component(CLR_SRC_LIBS_NATIVE_DIR ${CMAKE_CURRENT_LIST_DIR}/../../src/libraries/Native ABSOLUTE) set (CLR_ARTIFACTS_OBJ_DIR "${CLR_REPO_ROOT_DIR}/artifacts/obj") set(VERSION_HEADER_PATH "${CLR_ARTIFACTS_OBJ_DIR}/_version.h") set(VERSION_FILE_PATH "${CLR_ARTIFACTS_OBJ_DIR}/_version.c") diff --git a/eng/native/init-distro-rid.sh b/eng/native/init-distro-rid.sh index 5f6b194600124a..97fd64708163fa 100644 --- a/eng/native/init-distro-rid.sh +++ b/eng/native/init-distro-rid.sh @@ -41,7 +41,7 @@ initNonPortableDistroRid() # We have forced __PortableBuild=0. This is because -portablebuld # has been passed as false. if (( isPortable == 0 )); then - if [ "${ID}" = "rhel" ] || [ "${ID}" = "rocky" ]; then + if [[ "${ID}" == "rhel" || "${ID}" == "rocky" ]]; then # remove the last version digit VERSION_ID="${VERSION_ID%.*}" fi diff --git a/eng/outerBuild.targets b/eng/outerBuild.targets index 2c529a56aa2f91..bb3aa73a8033ff 100644 --- a/eng/outerBuild.targets +++ b/eng/outerBuild.targets @@ -1,5 +1,11 @@ - + + + $(NetCoreAppCurrent) + + + + diff --git a/eng/pipelines/common/evaluate-default-paths.yml b/eng/pipelines/common/evaluate-default-paths.yml index 9a29f4d10ae981..326cc76470341c 100644 --- a/eng/pipelines/common/evaluate-default-paths.yml +++ b/eng/pipelines/common/evaluate-default-paths.yml @@ -9,9 +9,9 @@ jobs: - subset: coreclr include: - src/libraries/System.Private.CoreLib/* - - src/libraries/Native/Unix/System.Globalization.Native/* - - src/libraries/Native/Unix/Common/* - - src/native/* + - src/native/libs/Common/* + - src/native/libs/System.Globalization.Native/* + - src/native/libs/System.IO.Compression.Native/* exclude: - eng/Version.Details.xml - '*.md' @@ -22,6 +22,7 @@ jobs: - src/installer/* - src/mono/* - src/libraries/* + - src/native/libs/* - src/tests/* - eng/pipelines/installer/* - eng/pipelines/mono/* @@ -29,10 +30,9 @@ jobs: - subset: mono include: - src/libraries/System.Private.CoreLib/* - - src/libraries/Native/Unix/System.Globalization.Native/* - - src/libraries/Native/Unix/Common/* - - src/tests/BuildWasmApps/* - - src/native/* + - src/native/libs/Common/* + - src/native/libs/System.Globalization.Native/* + - src/native/libs/System.IO.Compression.Native/* exclude: - eng/Version.Details.xml - '*.md' @@ -43,6 +43,7 @@ jobs: - src/installer/* - src/coreclr/* - src/libraries/* + - src/native/libs/* - src/tests/* - eng/pipelines/installer/* - eng/pipelines/coreclr/* @@ -99,6 +100,22 @@ jobs: - src/coreclr/vm/* exclude: - '*' + - subset: coreclr_jit + include: + - src/coreclr/jit/* + - subset: wasmbuildtests + include: + - src/tasks/* + - src/tests/BuildWasmApps/* + - src/mono/wasm/build/* + - src/mono/wasm/runtime/* + - src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.Manifest/* + - src/mono/nuget/Microsoft.NET.Runtime.WebAssembly.Sdk/* + - src/mono/nuget/Microsoft.NET.Runtime.wasm.Sample.Mono/* + - src/mono/nuget/Microsoft.NETCore.BrowserDebugHost.Transport/* + - src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Task/* + - src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/* + - src/mono/mono/* - ${{ if ne(parameters.extraSubsets, '') }}: - ${{ parameters.extraSubsets }} diff --git a/eng/pipelines/common/global-build-job.yml b/eng/pipelines/common/global-build-job.yml index 7db10e91e68b3c..cf30d702dda60d 100644 --- a/eng/pipelines/common/global-build-job.yml +++ b/eng/pipelines/common/global-build-job.yml @@ -136,7 +136,7 @@ jobs: df -h displayName: Disk Usage before Build - - ${{ if eq(parameters.nameSuffix, 'Browser_wasm_Windows') }}: + - ${{ if contains(parameters.nameSuffix, 'Windows_wasm') }}: # Update machine certs - task: PowerShell@2 displayName: Update machine certs diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index d58606fc5597d1..ad3dbd4db8bc0d 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -65,7 +65,10 @@ jobs: targetRid: linux-arm64 platform: Linux_arm64 container: - image: ubuntu-16.04-cross-arm64-20210719121212-8a8d3be + ${{ if eq(parameters.container, '') }}: + image: ubuntu-16.04-cross-arm64-20210719121212-8a8d3be + ${{ if ne(parameters.container, '') }}: + image: ${{ parameters.container }} registry: mcr jobParameters: runtimeFlavor: ${{ parameters.runtimeFlavor }} diff --git a/eng/pipelines/common/templates/runtimes/build-test-job.yml b/eng/pipelines/common/templates/runtimes/build-test-job.yml index 562b426eebc1fd..f7cc7202d2a25c 100644 --- a/eng/pipelines/common/templates/runtimes/build-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/build-test-job.yml @@ -5,14 +5,6 @@ parameters: osSubgroup: '' container: '' testGroup: '' - liveRuntimeBuildConfig: '' - - # Determines librariesbuild configuration to use for the tests. Setting this property implies - # a dependency of this job on the appropriate libraries build and is used - # to construct the name of the Azure artifact representing libraries build - # to use for building the tests. - liveLibrariesBuildConfig: '' - displayNameArgs: '' condition: true stagedBuild: false @@ -45,13 +37,8 @@ jobs: runtimeVariant: ${{ parameters.runtimeVariant }} testGroup: ${{ parameters.testGroup }} stagedBuild: ${{ parameters.stagedBuild }} - liveLibrariesBuildConfig: ${{ parameters.liveLibrariesBuildConfig }} pool: ${{ parameters.pool }} dependOnEvaluatePaths: ${{ parameters.dependOnEvaluatePaths }} - ${{ if eq(parameters.runtimeFlavor, 'coreclr') }}: - liveRuntimeBuildParams: ${{ format('clr.corelib+libs.ref+libs.native -rc {0} -c {1} -arch {2} -ci', coalesce(parameters.liveRuntimeBuildConfig, parameters.buildConfig), parameters.liveLibrariesBuildConfig, parameters.archType) }} - ${{ if eq(parameters.runtimeFlavor, 'mono') }}: - liveRuntimeBuildParams: ${{ format('mono.corelib+libs.ref+libs.native -rc {0} -c {1} -arch {2} -ci', coalesce(parameters.liveRuntimeBuildConfig, parameters.buildConfig), parameters.liveLibrariesBuildConfig, parameters.archType) }} ${{ if and(ne(parameters.osGroup, 'windows'), ne(parameters.compilerName, 'gcc'), not(and(eq(parameters.osGroup, 'Linux'), eq(parameters.osSubgroup, '_musl'), eq(parameters.archType, 'x64'))), not(eq(parameters.osGroup, 'OSX'))) }}: compilerArg: '-clang9' @@ -86,12 +73,8 @@ jobs: variables: - ${{ each variable in parameters.variables }}: - ${{ variable }} - - ${{ if eq(parameters.runtimeFlavor, 'coreclr') }}: - - name: liveRuntimeBuildParams - value: ${{ format('clr.corelib+libs.ref+libs.native -rc {0} -c {1} -arch {2} -ci', coalesce(parameters.liveRuntimeBuildConfig, parameters.buildConfig), parameters.liveLibrariesBuildConfig, parameters.archType) }} - - ${{ if eq(parameters.runtimeFlavor, 'mono') }}: - - name: liveRuntimeBuildParams - value: ${{ format('mono.corelib+libs.ref+libs.native -rc {0} -c {1} -arch {2} -ci', coalesce(parameters.liveRuntimeBuildConfig, parameters.buildConfig), parameters.liveLibrariesBuildConfig, parameters.archType) }} + - name: liveRuntimeBuildParams + value: 'libs.ref -c Release -ci' - name: compilerArg value: '' - ${{ if and(ne(parameters.osGroup, 'windows'), ne(parameters.compilerName, 'gcc')) }}: @@ -135,7 +118,7 @@ jobs: displayName: Disk Usage before Build # Build managed test components - - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(logRootNameArg)Managed allTargets skipnative skipgeneratelayout skiptestwrappers $(buildConfig) $(archType) $(runtimeFlavorArgs) $(crossArg) $(priorityArg) ci $(librariesOverrideArg) + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(logRootNameArg)Managed allTargets skipnative skipgeneratelayout skiptestwrappers $(buildConfig) $(archType) $(runtimeFlavorArgs) $(crossArg) $(priorityArg) ci /p:TargetOS=AnyOS displayName: Build managed test components - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: @@ -147,7 +130,7 @@ jobs: # Zip and publish managed test components - template: /eng/pipelines/common/upload-artifact-step.yml parameters: - rootFolder: $(managedTestArtifactRootFolderPath) + rootFolder: '$(binTestsPath)/AnyOS.$(archType).$(buildConfigUpper)' includeRootFolder: false archiveExtension: '.tar.gz' archiveType: tar @@ -174,6 +157,6 @@ jobs: displayName: Publish Logs inputs: targetPath: $(Build.SourcesDirectory)/artifacts/log - artifactName: '${{ parameters.runtimeFlavor }}_Common_Runtime_TestBuildLogs_AnyOS_AnyCPU_$(buildConfig)_Lib${{ parameters.liveLibrariesBuildConfig }}_${{ parameters.testGroup }}' + artifactName: '${{ parameters.runtimeFlavor }}_Common_Runtime_TestBuildLogs_AnyOS_AnyCPU_$(buildConfig)_${{ parameters.testGroup }}' continueOnError: true condition: always() diff --git a/eng/pipelines/common/templates/runtimes/run-test-job.yml b/eng/pipelines/common/templates/runtimes/run-test-job.yml index 7439f6ff48ecd1..cc22ce9f1c6774 100644 --- a/eng/pipelines/common/templates/runtimes/run-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/run-test-job.yml @@ -554,7 +554,10 @@ jobs: scenarios: - jitosr - jitosr_stress + - jitosr_pgo - jitpartialcompilation + - jitpartialcompilation_osr + - jitpartialcompilation_osr_pgo - jitobjectstackallocation ${{ if in(parameters.testGroup, 'ilasm') }}: scenarios: diff --git a/eng/pipelines/common/variables.yml b/eng/pipelines/common/variables.yml index dd7fb894cf5b42..d6b84f837c3276 100644 --- a/eng/pipelines/common/variables.yml +++ b/eng/pipelines/common/variables.yml @@ -15,6 +15,10 @@ variables: value: ${{ and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }} - name: isNotFullMatrix value: ${{ and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }} +- name: isNotManualAndIsPR + value: ${{ and(not(in(variables['Build.DefinitionName'], 'runtime-staging-manual', 'runtime-manual')), eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }} +- name: isManualOrIsNotPR + value: ${{ or(in(variables['Build.DefinitionName'], 'runtime-staging-manual', 'runtime-manual'), and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest'))) }} # We only run evaluate paths on runtime, runtime-staging and runtime-community pipelines on PRs # keep in sync with /eng/pipelines/common/xplat-setup.yml diff --git a/eng/pipelines/common/xplat-setup.yml b/eng/pipelines/common/xplat-setup.yml index f82aaa8f5ee571..1c7d6490df5f6b 100644 --- a/eng/pipelines/common/xplat-setup.yml +++ b/eng/pipelines/common/xplat-setup.yml @@ -50,7 +50,7 @@ jobs: value: $(buildConfigUpper) - name: _runSmokeTestsOnlyArg - value: '/p:RunSmokeTestsOnly=$(isNotFullMatrix)' + value: '/p:RunSmokeTestsOnly=$(isNotManualAndIsPR)' - ${{ if or(eq(parameters.osGroup, 'windows'), eq(parameters.hostedOs, 'windows')) }}: - name: archiveExtension value: '.zip' diff --git a/eng/pipelines/coreclr/ci.yml b/eng/pipelines/coreclr/ci.yml index baa13cfef87a26..fab41af74d73e8 100644 --- a/eng/pipelines/coreclr/ci.yml +++ b/eng/pipelines/coreclr/ci.yml @@ -111,8 +111,6 @@ jobs: platforms: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 testGroup: outerloop - jobParameters: - liveLibrariesBuildConfig: Release # # Checked JIT test runs diff --git a/eng/pipelines/coreclr/clrinterpreter.yml b/eng/pipelines/coreclr/clrinterpreter.yml index af74c063ba98e3..204d666e7bde3b 100644 --- a/eng/pipelines/coreclr/clrinterpreter.yml +++ b/eng/pipelines/coreclr/clrinterpreter.yml @@ -34,7 +34,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: clrinterpreter - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/crossgen2-composite.yml b/eng/pipelines/coreclr/crossgen2-composite.yml index df683c547bea9e..feea85ea9d3405 100644 --- a/eng/pipelines/coreclr/crossgen2-composite.yml +++ b/eng/pipelines/coreclr/crossgen2-composite.yml @@ -35,7 +35,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: innerloop - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/crossgen2-gcstress.yml b/eng/pipelines/coreclr/crossgen2-gcstress.yml index 444861b6dfac08..fc00d1d7b9a940 100644 --- a/eng/pipelines/coreclr/crossgen2-gcstress.yml +++ b/eng/pipelines/coreclr/crossgen2-gcstress.yml @@ -33,7 +33,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: gcstress-extra - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/crossgen2-outerloop.yml b/eng/pipelines/coreclr/crossgen2-outerloop.yml index df73f8bddea807..b60cc7860fbc2d 100644 --- a/eng/pipelines/coreclr/crossgen2-outerloop.yml +++ b/eng/pipelines/coreclr/crossgen2-outerloop.yml @@ -20,7 +20,7 @@ jobs: - Linux_arm64 - OSX_arm64 - OSX_x64 - - windows_x86 + - windows_x86 - windows_x64 - windows_arm64 - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 @@ -67,7 +67,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: outerloop - liveLibrariesBuildConfig: Release # Test most platforms in composite mode as the expected mainline shipping mode - template: /eng/pipelines/common/platform-matrix.yml diff --git a/eng/pipelines/coreclr/crossgen2.yml b/eng/pipelines/coreclr/crossgen2.yml index ba38b43211d33d..35edb1df223172 100644 --- a/eng/pipelines/coreclr/crossgen2.yml +++ b/eng/pipelines/coreclr/crossgen2.yml @@ -33,7 +33,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: innerloop - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/gc-longrunning.yml b/eng/pipelines/coreclr/gc-longrunning.yml index c188c756538eff..e685b36da1fdf3 100644 --- a/eng/pipelines/coreclr/gc-longrunning.yml +++ b/eng/pipelines/coreclr/gc-longrunning.yml @@ -32,7 +32,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: gc-longrunning - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/gc-simulator.yml b/eng/pipelines/coreclr/gc-simulator.yml index 16c24cb5dae659..bade23db69eeb9 100644 --- a/eng/pipelines/coreclr/gc-simulator.yml +++ b/eng/pipelines/coreclr/gc-simulator.yml @@ -33,7 +33,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: gc-simulator - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/gc-standalone.yml b/eng/pipelines/coreclr/gc-standalone.yml index ab0c4d0734b0c0..3aa02047610c3e 100644 --- a/eng/pipelines/coreclr/gc-standalone.yml +++ b/eng/pipelines/coreclr/gc-standalone.yml @@ -30,7 +30,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: gc-standalone - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/gcstress-extra.yml b/eng/pipelines/coreclr/gcstress-extra.yml index ab867202f80a79..6700a71d0dc8b1 100644 --- a/eng/pipelines/coreclr/gcstress-extra.yml +++ b/eng/pipelines/coreclr/gcstress-extra.yml @@ -31,7 +31,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: gcstress-extra - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/gcstress0x3-gcstress0xc.yml b/eng/pipelines/coreclr/gcstress0x3-gcstress0xc.yml index 436deaca79677a..dba8e21d60497f 100644 --- a/eng/pipelines/coreclr/gcstress0x3-gcstress0xc.yml +++ b/eng/pipelines/coreclr/gcstress0x3-gcstress0xc.yml @@ -31,7 +31,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: gcstress0x3-gcstress0xc - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/ilasm.yml b/eng/pipelines/coreclr/ilasm.yml index 187719b4377ec4..eff00c788fe5ec 100644 --- a/eng/pipelines/coreclr/ilasm.yml +++ b/eng/pipelines/coreclr/ilasm.yml @@ -44,7 +44,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: ilasm - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/jit-experimental.yml b/eng/pipelines/coreclr/jit-experimental.yml index 02048f1bac6734..f6e4edd422bdeb 100644 --- a/eng/pipelines/coreclr/jit-experimental.yml +++ b/eng/pipelines/coreclr/jit-experimental.yml @@ -29,7 +29,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: jit-experimental - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/jitstress-isas-arm.yml b/eng/pipelines/coreclr/jitstress-isas-arm.yml index c1410678e4a9a7..42cf82b96d94e9 100644 --- a/eng/pipelines/coreclr/jitstress-isas-arm.yml +++ b/eng/pipelines/coreclr/jitstress-isas-arm.yml @@ -30,7 +30,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: jitstress-isas-arm - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/jitstress-isas-x86.yml b/eng/pipelines/coreclr/jitstress-isas-x86.yml index 90453431d8114f..65798ce5252d09 100644 --- a/eng/pipelines/coreclr/jitstress-isas-x86.yml +++ b/eng/pipelines/coreclr/jitstress-isas-x86.yml @@ -31,7 +31,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: jitstress-isas-x86 - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/jitstress.yml b/eng/pipelines/coreclr/jitstress.yml index f1f50f97b66abd..4ea3c6c2a23831 100644 --- a/eng/pipelines/coreclr/jitstress.yml +++ b/eng/pipelines/coreclr/jitstress.yml @@ -35,7 +35,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: jitstress - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/jitstress2-jitstressregs.yml b/eng/pipelines/coreclr/jitstress2-jitstressregs.yml index 0e826e0db010c8..a3eb7c09fc14cd 100644 --- a/eng/pipelines/coreclr/jitstress2-jitstressregs.yml +++ b/eng/pipelines/coreclr/jitstress2-jitstressregs.yml @@ -35,7 +35,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: checked - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/jitstressregs-x86.yml b/eng/pipelines/coreclr/jitstressregs-x86.yml index 204cf5632f159a..006d4ed57f3f28 100644 --- a/eng/pipelines/coreclr/jitstressregs-x86.yml +++ b/eng/pipelines/coreclr/jitstressregs-x86.yml @@ -30,7 +30,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: jitstressregs-x86 - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/jitstressregs.yml b/eng/pipelines/coreclr/jitstressregs.yml index c90d4bb8bc998b..727e0e674b76f3 100644 --- a/eng/pipelines/coreclr/jitstressregs.yml +++ b/eng/pipelines/coreclr/jitstressregs.yml @@ -35,7 +35,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: jitstressregs - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/perf_slow.yml b/eng/pipelines/coreclr/perf_slow.yml index 2be7b5345a1a5f..e8410af6d361f9 100644 --- a/eng/pipelines/coreclr/perf_slow.yml +++ b/eng/pipelines/coreclr/perf_slow.yml @@ -39,6 +39,7 @@ jobs: jobTemplate: /eng/pipelines/mono/templates/build-job.yml runtimeFlavor: mono buildConfig: release + container: ubuntu-18.04-cross-arm64-20211022152824-b2c2436 platforms: - Linux_arm64 @@ -47,6 +48,7 @@ jobs: parameters: jobTemplate: /eng/pipelines/common/build-coreclr-and-libraries-job.yml buildConfig: release + container: ubuntu-18.04-cross-arm64-20211022152824-b2c2436 platforms: - Linux_arm64 jobParameters: @@ -58,6 +60,7 @@ jobs: jobTemplate: /eng/pipelines/coreclr/templates/perf-job.yml buildConfig: release runtimeFlavor: mono + container: ubuntu-18.04-cross-arm64-20211022152824-b2c2436 platforms: - Linux_arm64 jobParameters: @@ -76,6 +79,7 @@ jobs: jobTemplate: /eng/pipelines/common/global-build-job.yml buildConfig: release runtimeFlavor: mono + container: ubuntu-18.04-cross-arm64-20211022152824-b2c2436 platforms: - Browser_wasm jobParameters: @@ -98,6 +102,7 @@ jobs: parameters: jobTemplate: /eng/pipelines/common/build-coreclr-and-libraries-job.yml buildConfig: release + container: ubuntu-18.04-cross-arm64-20211022152824-b2c2436 platforms: - Linux_arm64 - windows_arm64 @@ -109,6 +114,7 @@ jobs: parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml buildConfig: release + container: ubuntu-18.04-cross-arm64-20211022152824-b2c2436 runtimeFlavor: mono platforms: - Browser_wasm @@ -129,6 +135,7 @@ jobs: parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml buildConfig: release + container: ubuntu-18.04-cross-arm64-20211022152824-b2c2436 runtimeFlavor: mono platforms: - Linux_arm64 @@ -154,6 +161,7 @@ jobs: runtimeFlavor: aot platforms: - Linux_arm64 + container: ubuntu-18.04-cross-arm64-20211022152824-b2c2436 jobParameters: testGroup: perf liveLibrariesBuildConfig: Release @@ -172,6 +180,7 @@ jobs: runtimeFlavor: coreclr platforms: - Linux_arm64 + container: ubuntu-18.04-cross-arm64-20211022152824-b2c2436 jobParameters: testGroup: perf liveLibrariesBuildConfig: Release diff --git a/eng/pipelines/coreclr/pgo.yml b/eng/pipelines/coreclr/pgo.yml index 132464b8dad59f..80f1579e1bf1c4 100644 --- a/eng/pipelines/coreclr/pgo.yml +++ b/eng/pipelines/coreclr/pgo.yml @@ -35,7 +35,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: pgo - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/r2r-extra.yml b/eng/pipelines/coreclr/r2r-extra.yml index 9c386ac556e862..940c29d7f3741a 100644 --- a/eng/pipelines/coreclr/r2r-extra.yml +++ b/eng/pipelines/coreclr/r2r-extra.yml @@ -31,7 +31,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: r2r-extra - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/r2r.yml b/eng/pipelines/coreclr/r2r.yml index 4fc7662293c50d..81bee51bc93273 100644 --- a/eng/pipelines/coreclr/r2r.yml +++ b/eng/pipelines/coreclr/r2r.yml @@ -35,7 +35,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: outerloop - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/release-tests.yml b/eng/pipelines/coreclr/release-tests.yml index bfa51bd287826d..fb7cd6ad8adb4e 100644 --- a/eng/pipelines/coreclr/release-tests.yml +++ b/eng/pipelines/coreclr/release-tests.yml @@ -36,7 +36,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: outerloop - liveLibrariesBuildConfig: Release # # Release test runs diff --git a/eng/pipelines/coreclr/runincontext.yml b/eng/pipelines/coreclr/runincontext.yml index 9dcd8f7a1bc779..1588a59bcf539f 100644 --- a/eng/pipelines/coreclr/runincontext.yml +++ b/eng/pipelines/coreclr/runincontext.yml @@ -30,7 +30,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: outerloop - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/superpmi-asmdiffs.yml b/eng/pipelines/coreclr/superpmi-asmdiffs.yml new file mode 100644 index 00000000000000..d8835b40b8133d --- /dev/null +++ b/eng/pipelines/coreclr/superpmi-asmdiffs.yml @@ -0,0 +1,37 @@ +# This pipeline only runs on GitHub PRs, not on merges. +trigger: none + +# Only run on changes to the JIT directory. Don't run if the JIT-EE GUID has changed, +# since there won't be any SuperPMI collections with the new GUID until the collection +# pipeline completes after this PR is merged. +pr: + branches: + include: + - main + paths: + include: + - src/coreclr/jit/* + exclude: + - src/coreclr/inc/jiteeversionguid.h + +jobs: + +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/build-jit-job.yml + buildConfig: checked + platforms: + - windows_x64 + - windows_x86 + jobParameters: + uploadAs: 'pipelineArtifacts' + +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/superpmi-asmdiffs-job.yml + buildConfig: checked + platforms: + - windows_x64 + - windows_x86 + helixQueueGroup: ci + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml \ No newline at end of file diff --git a/eng/pipelines/coreclr/superpmi-collect.yml b/eng/pipelines/coreclr/superpmi-collect.yml index 7b285903a5fef7..0d41f151d6b554 100644 --- a/eng/pipelines/coreclr/superpmi-collect.yml +++ b/eng/pipelines/coreclr/superpmi-collect.yml @@ -12,7 +12,7 @@ trigger: - src/coreclr/inc/jiteeversionguid.h # This pipeline is supposed to be run only on merged changes -# and should not be triggerable from a PR. +# and should not be triggerable from a PR. pr: none schedules: @@ -54,7 +54,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: outerloop - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/coreclr/superpmi-replay.yml b/eng/pipelines/coreclr/superpmi-replay.yml index 90ed1896c03af0..0dca4217b18383 100644 --- a/eng/pipelines/coreclr/superpmi-replay.yml +++ b/eng/pipelines/coreclr/superpmi-replay.yml @@ -1,3 +1,6 @@ +# Only run on changes to the JIT directory. Don't run if the JIT-EE GUID has changed, +# since there won't be any SuperPMI collections with the new GUID until the collection +# pipeline completes. trigger: batch: false branches: @@ -6,6 +9,7 @@ trigger: paths: include: - src/coreclr/jit/* + exclude: - src/coreclr/inc/jiteeversionguid.h jobs: diff --git a/eng/pipelines/coreclr/templates/build-job.yml b/eng/pipelines/coreclr/templates/build-job.yml index 36640298e1f0f3..a8c57eadac6255 100644 --- a/eng/pipelines/coreclr/templates/build-job.yml +++ b/eng/pipelines/coreclr/templates/build-job.yml @@ -45,7 +45,7 @@ jobs: # Compute job name from template parameters ${{ if and(ne(parameters.testGroup, 'clrTools'), eq(parameters.compilerName, 'gcc')) }}: name: ${{ format('coreclr_{0}_product_build_{1}{1}_{3}_{4}', parameters.compilerName, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} - displayName: ${{ format('CoreCLR GCC Product Build {0}{1} {2} {3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + displayName: ${{ format('GCC Product Build {0}{1} {2} {3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} ${{ if and(ne(parameters.testGroup, 'clrTools'), ne(parameters.compilerName, 'gcc')) }}: name: ${{ format('coreclr_{0}_product_build_{1}{2}_{3}_{4}{5}', parameters.runtimeVariant, @@ -228,6 +228,11 @@ jobs: - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) skipmanaged skipgeneratelayout $(buildConfig) $(archType) $(crossArg) $(osArg) $(priorityArg) $(compilerArg) displayName: Build native test components + # Build libs.native, host.native and mono with gcc + - ${{ if eq(parameters.compilerName, 'gcc') }}: + - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) libs.native+host.native+mono $(compilerArg) $(crossArg) -arch $(archType) $(osArg) -c $(buildConfig) $(pgoInstrumentArg) $(officialBuildIdArg) -ci + displayName: Build libs.native+host.native+mono + # Sign and add entitlements to these MacOS binaries - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - ${{ if eq(parameters.osGroup, 'OSX') }}: diff --git a/eng/pipelines/coreclr/templates/perf-job.yml b/eng/pipelines/coreclr/templates/perf-job.yml index 6802056be03a65..50941e60f1c5f5 100644 --- a/eng/pipelines/coreclr/templates/perf-job.yml +++ b/eng/pipelines/coreclr/templates/perf-job.yml @@ -135,7 +135,7 @@ jobs: artifactName: BrowserWasm displayName: BrowserWasm - - script: "mkdir $(librariesDownloadDir)/bin/wasm;unzip -o $(librariesDownloadDir)/BrowserWasm/artifacts/packages/Release/Shipping/Microsoft.NETCore.App.Runtime.Mono.browser-wasm.7.0.0-ci.nupkg data/* runtimes/* -d $(librariesDownloadDir)/bin/wasm;cp src/mono/wasm/runtime-test.js $(librariesDownloadDir)/bin/wasm/runtime-test.js;find $(librariesDownloadDir)/bin/wasm -type f -exec chmod 664 {} \\;" + - script: "mkdir $(librariesDownloadDir)/bin/wasm;unzip -o $(librariesDownloadDir)/BrowserWasm/artifacts/packages/Release/Shipping/Microsoft.NETCore.App.Runtime.Mono.browser-wasm.7.0.0-ci.nupkg data/* runtimes/* -d $(librariesDownloadDir)/bin/wasm;cp src/mono/wasm/test-main.js $(librariesDownloadDir)/bin/wasm/test-main.js;find $(librariesDownloadDir)/bin/wasm -type f -exec chmod 664 {} \\;" displayName: "Create wasm directory (Linux)" # Download mono AOT diff --git a/eng/pipelines/coreclr/templates/run-superpmi-asmdiffs-job.yml b/eng/pipelines/coreclr/templates/run-superpmi-asmdiffs-job.yml new file mode 100644 index 00000000000000..6bf5a3e8d01916 --- /dev/null +++ b/eng/pipelines/coreclr/templates/run-superpmi-asmdiffs-job.yml @@ -0,0 +1,145 @@ +parameters: + steps: [] # optional -- any additional steps that need to happen before pulling down the jitutils repo and sending the jitutils to helix (ie building your repo) + variables: [] # optional -- list of additional variables to send to the template + jobName: '' # required -- job name + displayName: '' # optional -- display name for the job. Will use jobName if not passed + pool: '' # required -- name of the Build pool + container: '' # required -- name of the container + buildConfig: '' # required -- build configuration + archType: '' # required -- targeting CPU architecture + osGroup: '' # required -- operating system for the job + osSubgroup: '' # optional -- operating system subgroup + continueOnError: 'false' # optional -- determines whether to continue the build if the step errors + dependsOn: '' # optional -- dependencies of the job + timeoutInMinutes: 120 # optional -- timeout for the job + enableTelemetry: false # optional -- enable for telemetry + liveLibrariesBuildConfig: '' # optional -- live-live libraries configuration to use for the run + helixQueues: '' # required -- Helix queues + dependOnEvaluatePaths: false + +jobs: +- template: xplat-pipeline-job.yml + parameters: + dependsOn: ${{ parameters.dependsOn }} + buildConfig: ${{ parameters.buildConfig }} + archType: ${{ parameters.archType }} + osGroup: ${{ parameters.osGroup }} + osSubgroup: ${{ parameters.osSubgroup }} + liveLibrariesBuildConfig: ${{ parameters.liveLibrariesBuildConfig }} + enableTelemetry: ${{ parameters.enableTelemetry }} + enablePublishBuildArtifacts: true + continueOnError: ${{ parameters.continueOnError }} + dependOnEvaluatePaths: ${{ parameters.dependOnEvaluatePaths }} + timeoutInMinutes: ${{ parameters.timeoutInMinutes }} + + ${{ if ne(parameters.displayName, '') }}: + displayName: '${{ parameters.displayName }}' + ${{ if eq(parameters.displayName, '') }}: + displayName: '${{ parameters.jobName }}' + + variables: + + - ${{ each variable in parameters.variables }}: + - ${{ if ne(variable.name, '') }}: + - name: ${{ variable.name }} + value: ${{ variable.value }} + - ${{ if ne(variable.group, '') }}: + - group: ${{ variable.group }} + + - name: PythonScript + value: 'py -3' + - name: PipScript + value: 'py -3 -m pip' + - name: SpmiCollectionLocation + value: '$(Build.SourcesDirectory)\artifacts\spmi\' + - name: SpmiLogsLocation + value: '$(Build.SourcesDirectory)\artifacts\spmi_logs\' + - name: SpmiAsmdiffsLocation + value: '$(Build.SourcesDirectory)\artifacts\spmi_asmdiffs\' + - name: HelixResultLocation + value: '$(Build.SourcesDirectory)\artifacts\helixresults\' + + workspace: + clean: all + pool: + ${{ parameters.pool }} + container: ${{ parameters.container }} + steps: + - ${{ parameters.steps }} + + - script: | + mkdir $(SpmiCollectionLocation) + mkdir $(SpmiLogsLocation) + mkdir $(SpmiAsmdiffsLocation) + displayName: Create directories + + - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi_asmdiffs_setup.py -source_directory $(Build.SourcesDirectory) -product_directory $(buildProductRootFolderPath) -arch $(archType) + displayName: ${{ format('SuperPMI asmdiffs setup ({0})', parameters.archType) }} + + # Run superpmi asmdiffs in helix + - template: /eng/pipelines/common/templates/runtimes/send-to-helix-step.yml + parameters: + displayName: 'Send job to Helix' + helixBuild: $(Build.BuildNumber) + helixSource: $(_HelixSource) + helixType: 'build/tests/' + helixQueues: ${{ join(',', parameters.helixQueues) }} + creator: dotnet-bot + WorkItemTimeout: 2:00 # 2 hours + WorkItemDirectory: '$(WorkItemDirectory)' + CorrelationPayloadDirectory: '$(CorrelationPayloadDirectory)' + helixProjectArguments: '$(Build.SourcesDirectory)/src/coreclr/scripts/superpmi-asmdiffs.proj' + BuildConfig: ${{ parameters.buildConfig }} + osGroup: ${{ parameters.osGroup }} + archType: ${{ parameters.archType }} + shouldContinueOnError: true # Run the future step i.e. upload superpmi logs + + # Always upload the available logs for diagnostics + - task: CopyFiles@2 + displayName: Copying superpmi.log of all partitions + inputs: + sourceFolder: '$(HelixResultLocation)' + contents: '**/superpmi_*.log' + targetFolder: '$(SpmiLogsLocation)' + condition: always() + + - task: CopyFiles@2 + displayName: Copying superpmi.md of all partitions + inputs: + sourceFolder: '$(HelixResultLocation)' + contents: '**/superpmi_*.md' + targetFolder: '$(SpmiAsmdiffsLocation)' + condition: always() + + - task: CopyFiles@2 + displayName: Copying dasm files of all partitions + inputs: + sourceFolder: '$(HelixResultLocation)' + contents: '**/Asmdiffs_*.zip' + targetFolder: '$(SpmiAsmdiffsLocation)' + condition: always() + + - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi_asmdiffs_summarize.py -diff_summary_dir $(SpmiAsmdiffsLocation) -arch $(archType) + displayName: ${{ format('Summarize ({0})', parameters.archType) }} + condition: always() + + - task: PublishPipelineArtifact@1 + displayName: Publish SuperPMI logs + inputs: + targetPath: $(SpmiLogsLocation) + artifactName: 'SuperPMI_Logs_$(archType)_$(buildConfig)' + condition: always() + + - task: PublishPipelineArtifact@1 + displayName: Publish SuperPMI asmdiffs files + inputs: + targetPath: $(SpmiAsmdiffsLocation) + artifactName: 'SuperPMI_Asmdiffs_$(archType)_$(buildConfig)' + condition: always() + + - task: PublishPipelineArtifact@1 + displayName: Publish SuperPMI build logs + inputs: + targetPath: $(Build.SourcesDirectory)/artifacts/log + artifactName: 'SuperPMI_BuildLogs_$(archType)_$(buildConfig)' + condition: always() diff --git a/eng/pipelines/coreclr/templates/run-superpmi-collect-job.yml b/eng/pipelines/coreclr/templates/run-superpmi-collect-job.yml index 01726c6b1a339c..1ac235f6f6d08e 100644 --- a/eng/pipelines/coreclr/templates/run-superpmi-collect-job.yml +++ b/eng/pipelines/coreclr/templates/run-superpmi-collect-job.yml @@ -114,7 +114,7 @@ jobs: - script: | mkdir -p $(MergedMchFileLocation) mkdir -p $(SpmiLogsLocation) - displayName: Create directory for merged collection + displayName: Create directories - ${{ if eq(parameters.osGroup, 'windows') }}: - script: | mkdir $(MergedMchFileLocation) diff --git a/eng/pipelines/coreclr/templates/run-superpmi-replay-job.yml b/eng/pipelines/coreclr/templates/run-superpmi-replay-job.yml index 696b2e5e043bca..9b64c380d26056 100644 --- a/eng/pipelines/coreclr/templates/run-superpmi-replay-job.yml +++ b/eng/pipelines/coreclr/templates/run-superpmi-replay-job.yml @@ -66,11 +66,12 @@ jobs: - ${{ parameters.steps }} - script: | - mkdir -p $(SpmiCollectionLocation) - displayName: Create directory for SPMI collection + mkdir $(SpmiCollectionLocation) + mkdir $(SpmiLogsLocation) + displayName: Create directories - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi_replay_setup.py -source_directory $(Build.SourcesDirectory) -product_directory $(buildProductRootFolderPath) -arch $(archType) - displayName: ${{ format('SuperPMI replay setup ({0} {1})', parameters.osGroup, parameters.archType) }} + displayName: ${{ format('SuperPMI replay setup ({0})', parameters.archType) }} # Run superpmi replay in helix - template: /eng/pipelines/common/templates/runtimes/send-to-helix-step.yml diff --git a/eng/pipelines/coreclr/templates/superpmi-asmdiffs-job.yml b/eng/pipelines/coreclr/templates/superpmi-asmdiffs-job.yml new file mode 100644 index 00000000000000..bb05902efe969b --- /dev/null +++ b/eng/pipelines/coreclr/templates/superpmi-asmdiffs-job.yml @@ -0,0 +1,39 @@ +parameters: + buildConfig: '' # required -- build configuration + archType: '' # required -- targeting CPU architecture + osGroup: '' # required -- operating system for the job + osSubgroup: '' # optional -- operating system subgroup + pool: '' + timeoutInMinutes: 120 # build timeout + variables: {} + helixQueues: '' + dependOnEvaluatePaths: false + runJobTemplate: '/eng/pipelines/coreclr/templates/run-superpmi-asmdiffs-job.yml' + +jobs: +- template: ${{ parameters.runJobTemplate }} + parameters: + jobName: ${{ format('superpmi_asmdiffs_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + displayName: ${{ format('SuperPMI asmdiffs {0}{1} {2} {3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + pool: ${{ parameters.pool }} + buildConfig: ${{ parameters.buildConfig }} + archType: ${{ parameters.archType }} + osGroup: ${{ parameters.osGroup }} + osSubgroup: ${{ parameters.osSubgroup }} + dependOnEvaluatePaths: ${{ parameters.dependOnEvaluatePaths }} + timeoutInMinutes: ${{ parameters.timeoutInMinutes }} + helixQueues: ${{ parameters.helixQueues }} + dependsOn: + - ${{ format('coreclr_jit_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + + variables: ${{ parameters.variables }} + + steps: + + # Download jit builds + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + unpackFolder: $(buildProductRootFolderPath) + artifactFileName: '$(buildProductArtifactName)$(archiveExtension)' + artifactName: '$(buildProductArtifactName)' + displayName: 'JIT product build' \ No newline at end of file diff --git a/eng/pipelines/coreclr/tieringtest.yml b/eng/pipelines/coreclr/tieringtest.yml index 7767c3261fbd52..0a57b1e27754af 100644 --- a/eng/pipelines/coreclr/tieringtest.yml +++ b/eng/pipelines/coreclr/tieringtest.yml @@ -30,7 +30,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: outerloop - liveLibrariesBuildConfig: Release - template: /eng/pipelines/common/platform-matrix.yml parameters: diff --git a/eng/pipelines/evaluate-changed-paths.sh b/eng/pipelines/evaluate-changed-paths.sh index 76bc06d5280143..ee9ae31a3363ab 100755 --- a/eng/pipelines/evaluate-changed-paths.sh +++ b/eng/pipelines/evaluate-changed-paths.sh @@ -141,7 +141,7 @@ probePaths() { echo "******* Probing $_subset exclude paths *******"; for _path in "${exclude_paths[@]}"; do echo "$_path" - if [[ "$exclude_path_string" == "" ]]; then + if [[ -z "$exclude_path_string" ]]; then exclude_path_string=":!$_path" else exclude_path_string="$exclude_path_string :!$_path" @@ -159,7 +159,7 @@ probePaths() { echo "******* Probing $_subset include paths *******"; for _path in "${include_paths[@]}"; do echo "$_path" - if [[ "$include_path_string" == "" ]]; then + if [[ -z "$include_path_string" ]]; then include_path_string=":$_path" else include_path_string="$include_path_string :$_path" diff --git a/eng/pipelines/libraries/enterprise/linux.yml b/eng/pipelines/libraries/enterprise/linux.yml index d958c56c1a354b..aa2ccee679549e 100644 --- a/eng/pipelines/libraries/enterprise/linux.yml +++ b/eng/pipelines/libraries/enterprise/linux.yml @@ -14,7 +14,7 @@ pr: - eng/pipelines/libraries/enterprise/* - src/libraries/Common/src/System/Net/* - src/libraries/Common/tests/System/Net/* - - src/libraries/Native/Unix/System.Net.Security.Native/* + - src/native/libs/System.Net.Security.Native/* - src/libraries/System.Net.Http/* - src/libraries/System.Net.Security/* diff --git a/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml index 73432c9c408b1a..60527beb6c052e 100644 --- a/eng/pipelines/libraries/helix-queues-setup.yml +++ b/eng/pipelines/libraries/helix-queues-setup.yml @@ -132,9 +132,11 @@ jobs: - Windows.81.Amd64.Open - Windows.10.Amd64.ServerRS5.Open - Windows.10.Amd64.Server19H1.Open + - Windows.10.Amd64.Server20H2.Open - ${{ if ne(parameters.jobParameters.runtimeFlavor, 'mono') }}: - (Windows.Nano.1809.Amd64.Open)windows.10.amd64.serverrs5.open@mcr.microsoft.com/dotnet-buildtools/prereqs:nanoserver-1809-helix-amd64-08e8e40-20200107182504 - (Windows.Server.Core.1909.Amd64.Open)windows.10.amd64.server20h1.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-2004-helix-amd64-20200904200251-272704c + - (Windows.Server.Core.20H2.Amd64.Open)windows.10.amd64.server20h2.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-20H2-helix-amd64-20210922171304-edc3733 - ${{ if ne(parameters.jobParameters.isFullMatrix, true) }}: - Windows.81.Amd64.Open - Windows.10.Amd64.Server19H1.ES.Open diff --git a/eng/pipelines/libraries/stress/http.yml b/eng/pipelines/libraries/stress/http.yml index 049c979b5e32fd..3561011fa6292a 100644 --- a/eng/pipelines/libraries/stress/http.yml +++ b/eng/pipelines/libraries/stress/http.yml @@ -57,6 +57,7 @@ jobs: export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 3.0" export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 3.0" docker-compose up --abort-on-container-exit --no-color + timeoutInMinutes: 35 # In case the HTTP/3.0 run hangs, we timeout shortly after the expected 30 minute run displayName: Run HttpStress - HTTP 3.0 condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true')) @@ -149,4 +150,4 @@ jobs: - powershell: | Set-NetFirewallProfile -Profile Domain, Public, Private -Enabled True name: enableFirewall - displayName: Enable Firewall + displayName: Enable Firewall \ No newline at end of file diff --git a/eng/pipelines/runtime-manual.yml b/eng/pipelines/runtime-manual.yml new file mode 100644 index 00000000000000..83f9e891dab573 --- /dev/null +++ b/eng/pipelines/runtime-manual.yml @@ -0,0 +1,505 @@ +trigger: none + +variables: + - template: /eng/pipelines/common/variables.yml + +jobs: + +# +# iOS/tvOS interp - requires AOT Compilation and Interp flags +# Build the whole product using Mono and run libraries tests +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: mono + platforms: + - iOSSimulator_x64 + - tvOSSimulator_x64 + - iOSSimulator_arm64 + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_Mono + buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunAOTCompilation=true /p:MonoForceInterpreter=true /p:BuildDarwinFrameworks=true + timeoutInMinutes: 180 + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/libraries/helix.yml + extraStepsParameters: + creator: dotnet-bot + interpreter: true + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + +# +# MacCatalyst interp - requires AOT Compilation and Interp flags +# Build the whole product using Mono and run libraries tests +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: mono + platforms: + - MacCatalyst_x64 + # don't run tests on arm64 PRs until we can get significantly more devices + - ${{ if eq(variables['isFullMatrix'], true) }}: + - MacCatalyst_arm64 + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_Mono + buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=adhoc /p:RunAOTCompilation=true /p:MonoForceInterpreter=true /p:BuildDarwinFrameworks=true + timeoutInMinutes: 180 + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/libraries/helix.yml + extraStepsParameters: + creator: dotnet-bot + interpreter: true + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + +# +# iOS/tvOS devices - Full AOT + AggressiveTrimming to reduce size +# Build the whole product using Mono and run libraries tests +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: mono + platforms: + - iOS_arm64 + - tvOS_arm64 + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_Mono + buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true /p:BuildTestsOnHelix=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true + timeoutInMinutes: 180 + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/libraries/helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true + +# +# Build the whole product using Mono and run libraries tests +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: mono + platforms: + - Android_x86 + - Android_x64 + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_Mono + buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg) + timeoutInMinutes: 180 + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/libraries/helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: mono + platforms: + - Android_arm + - Android_arm64 + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_Mono + buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg) + timeoutInMinutes: 180 + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/libraries/helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + +# +# Build the whole product using Mono and run libraries tests +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: mono + platforms: + - Windows_x64 + jobParameters: + testScope: innerloop + nameSuffix: AllSubsets_Mono + buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true + timeoutInMinutes: 120 + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/libraries/helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + +# +# Build the whole product using Mono for Android and run runtime tests with interpreter +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: mono + platforms: + - Android_x64 + variables: + - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: + - name: _HelixSource + value: pr/dotnet/runtime/$(Build.SourceBranch) + - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: + - name: _HelixSource + value: ci/dotnet/runtime/$(Build.SourceBranch) + - name: timeoutPerTestInMinutes + value: 60 + - name: timeoutPerTestCollectionInMinutes + value: 180 + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_Mono_RuntimeTests_Interp + buildArgs: -s mono+libs -c $(_BuildConfig) + timeoutInMinutes: 240 + runtimeVariant: monointerpreter + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + +# +# Build the whole product using Mono and run runtime tests with the JIT. +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: mono + platforms: + - iOSSimulator_x64 + variables: + - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: + - name: _HelixSource + value: pr/dotnet/runtime/$(Build.SourceBranch) + - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: + - name: _HelixSource + value: ci/dotnet/runtime/$(Build.SourceBranch) + - name: timeoutPerTestInMinutes + value: 60 + - name: timeoutPerTestCollectionInMinutes + value: 180 + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_Mono_RuntimeTests + buildArgs: -s mono+libs -c $(_BuildConfig) + timeoutInMinutes: 240 + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + +# +# Build the whole product using Mono for Android and run runtime tests with Android devices +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: mono + platforms: + - Android_arm64 + variables: + - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: + - name: _HelixSource + value: pr/dotnet/runtime/$(Build.SourceBranch) + - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: + - name: _HelixSource + value: ci/dotnet/runtime/$(Build.SourceBranch) + - name: timeoutPerTestInMinutes + value: 60 + - name: timeoutPerTestCollectionInMinutes + value: 180 + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_Mono_RuntimeTests + buildArgs: -s mono+libs -c $(_BuildConfig) + timeoutInMinutes: 240 + # don't run tests on PRs until we can get significantly more devices + # Turn off the testing for now, until https://github.com/dotnet/xharness/issues/663 gets resolved + # ${{ if eq(variables['isFullMatrix'], true) }}: + # # extra steps, run tests + # extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml + # extraStepsParameters: + # creator: dotnet-bot + # testRunNamePrefixSuffix: Mono_$(_BuildConfig) + +# +# Build Browser_wasm, on windows, run console and browser tests +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + buildConfig: release + runtimeFlavor: mono + platforms: + - Browser_wasm_win + variables: + # map dependencies variables to local variables + - name: librariesContainsChange + value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] + - name: monoContainsChange + value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] + jobParameters: + testGroup: innerloop + nameSuffix: Windows_wasm + buildArgs: -subset mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows + timeoutInMinutes: 180 + condition: >- + or( + eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), + eq(variables['isManualOrIsNotPR'], true), + eq(variables['isFullMatrix'], true)) + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/libraries/helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + extraHelixArguments: /p:BrowserHost=windows + scenarios: + - normal + - wasmtestonbrowser + condition: >- + or( + eq(variables['librariesContainsChange'], true), + eq(variables['monoContainsChange'], true), + eq(variables['isManualOrIsNotPR'], true), + eq(variables['isFullMatrix'], true)) + +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + buildConfig: release + runtimeFlavor: mono + platforms: + - Browser_wasm_win + variables: + # map dependencies variables to local variables + - name: wasmbuildtestsContainsChange + value: $[ dependencies.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'] ] + jobParameters: + testGroup: innerloop + nameSuffix: Windows_wasm_WBT + buildArgs: -subset mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows /p:TestWasmBuildTests=true /p:TestAssemblies=false + timeoutInMinutes: 180 + condition: >- + or( + eq(dependencies.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'], true), + eq(variables['isManualOrIsNotPR'], true), + eq(variables['isFullMatrix'], true)) + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/libraries/helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + extraHelixArguments: /p:BrowserHost=windows + scenarios: + - buildwasmapps + condition: >- + or( + eq(variables['wasmbuildtestsContainsChange'], true), + eq(variables['isManualOrIsNotPR'], true), + eq(variables['isFullMatrix'], true)) + +# Disabled due to https://github.com/dotnet/runtime/issues/61721 +#- template: /eng/pipelines/common/platform-matrix.yml + #parameters: + #jobTemplate: /eng/pipelines/common/global-build-job.yml + #helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + #buildConfig: release + #runtimeFlavor: mono + #platforms: + #- Browser_wasm_win + #variables: + ## map dependencies variables to local variables + #- name: librariesContainsChange + #value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] + #- name: monoContainsChange + #value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] + #jobParameters: + #testGroup: innerloop + #nameSuffix: Windows_wasm_AOT + #buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) + #timeoutInMinutes: 180 + #condition: >- + #or( + #eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), + #eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), + #eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), + #eq(variables['isManualOrIsNotPR'], true), + #eq(variables['isFullMatrix'], true)) + ## extra steps, run tests + #extraStepsTemplate: /eng/pipelines/libraries/helix.yml + #extraStepsParameters: + #creator: dotnet-bot + #testRunNamePrefixSuffix: Mono_$(_BuildConfig) + #extraHelixArguments: /p:BrowserHost=windows /p:NeedsToBuildWasmAppsOnHelix=true $(_runSmokeTestsOnlyArg) + #scenarios: + #- normal + #condition: >- + #or( + #eq(variables['librariesContainsChange'], true), + #eq(variables['monoContainsChange'], true), + #eq(variables['isManualOrIsNotPR'], true), + #eq(variables['isFullMatrix'], true)) + +# +# Build for Browser/wasm, with EnableAggressiveTrimming=true +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: mono + platforms: + - Browser_wasm + variables: + # map dependencies variables to local variables + - name: librariesContainsChange + value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] + - name: monoContainsChange + value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_Mono_EAT + buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=false /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=false + timeoutInMinutes: 180 + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/libraries/helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + extraHelixArguments: /p:NeedsToBuildWasmAppsOnHelix=true /p:RunSmokeTestsOnly=false + scenarios: + - normal + +# +# Build for Browser/wasm with RunAOTCompilation=true +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: mono + platforms: + - Browser_wasm + variables: + # map dependencies variables to local variables + - name: librariesContainsChange + value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] + - name: monoContainsChange + value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_Mono_AOT + buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunSmokeTestsOnly=false /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=true + timeoutInMinutes: 180 + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/libraries/helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + extraHelixArguments: /p:NeedsToBuildWasmAppsOnHelix=true /p:RunSmokeTestsOnly=false + scenarios: + - normal + +# +# Build the whole product using Mono and run runtime tests +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: mono + platforms: + - Browser_wasm + variables: + - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: + - name: _HelixSource + value: pr/dotnet/runtime/$(Build.SourceBranch) + - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: + - name: _HelixSource + value: ci/dotnet/runtime/$(Build.SourceBranch) + - name: timeoutPerTestInMinutes + value: 10 + - name: timeoutPerTestCollectionInMinutes + value: 200 + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_Mono_RuntimeTests + buildArgs: -s mono+libs -c $(_BuildConfig) + timeoutInMinutes: 180 + # NOTE: Per PR test execution is not recommended for mobile runtime tests + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/common/templates/runtimes/wasm-runtime-and-send-to-helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + +# +# Build the whole product using Mono for Android and run runtime tests with Android emulator +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: mono + platforms: + - Android_x64 + variables: + - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}: + - name: _HelixSource + value: pr/dotnet/runtime/$(Build.SourceBranch) + - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: + - name: _HelixSource + value: ci/dotnet/runtime/$(Build.SourceBranch) + - name: timeoutPerTestInMinutes + value: 60 + - name: timeoutPerTestCollectionInMinutes + value: 180 + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_Mono_RuntimeTests + buildArgs: -s mono+libs -c $(_BuildConfig) + timeoutInMinutes: 240 + # NOTE: Per PR test execution is not recommended for mobile runtime tests + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) diff --git a/eng/pipelines/runtime-official.yml b/eng/pipelines/runtime-official.yml index ac295a3994a136..34b0ae68c78e25 100644 --- a/eng/pipelines/runtime-official.yml +++ b/eng/pipelines/runtime-official.yml @@ -342,6 +342,7 @@ stages: extraStepsTemplate: /eng/pipelines/common/upload-intermediate-artifacts-step.yml extraStepsParameters: name: SourceBuildPackages + timeoutInMinutes: 95 # diff --git a/eng/pipelines/runtime-staging.yml b/eng/pipelines/runtime-staging.yml index fb60bef5e7b6e8..a38deea1927a5c 100644 --- a/eng/pipelines/runtime-staging.yml +++ b/eng/pipelines/runtime-staging.yml @@ -75,7 +75,7 @@ jobs: - iOSSimulator_x64 - tvOSSimulator_x64 # don't run tests on arm64 PRs until we can get significantly more devices - - ${{ if eq(variables['isFullMatrix'], true) }}: + - ${{ if eq(variables['isManualOrIsNotPR'], true) }}: - iOSSimulator_arm64 variables: # map dependencies variables to local variables @@ -93,6 +93,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), + eq(variables['isManualOrIsNotPR'], true), eq(variables['isFullMatrix'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml @@ -104,6 +105,7 @@ jobs: or( eq(variables['librariesContainsChange'], true), eq(variables['monoContainsChange'], true), + eq(variables['isManualOrIsNotPR'], true), eq(variables['isFullMatrix'], true)) # @@ -137,6 +139,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), + eq(variables['isManualOrIsNotPR'], true), eq(variables['isFullMatrix'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml @@ -148,6 +151,7 @@ jobs: or( eq(variables['librariesContainsChange'], true), eq(variables['monoContainsChange'], true), + eq(variables['isManualOrIsNotPR'], true), eq(variables['isFullMatrix'], true)) # @@ -179,6 +183,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), + eq(variables['isManualOrIsNotPR'], true), eq(variables['isFullMatrix'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml @@ -190,6 +195,7 @@ jobs: or( eq(variables['librariesContainsChange'], true), eq(variables['monoContainsChange'], true), + eq(variables['isManualOrIsNotPR'], true), eq(variables['isFullMatrix'], true)) # @@ -220,6 +226,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), + eq(variables['isManualOrIsNotPR'], true), eq(variables['isFullMatrix'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml @@ -230,6 +237,7 @@ jobs: or( eq(variables['librariesContainsChange'], true), eq(variables['monoContainsChange'], true), + eq(variables['isManualOrIsNotPR'], true), eq(variables['isFullMatrix'], true)) - template: /eng/pipelines/common/platform-matrix.yml @@ -257,19 +265,19 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), + eq(variables['isManualOrIsNotPR'], true), + eq(variables['isFullMatrix'], true)) + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/libraries/helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + condition: >- + or( + eq(variables['librariesContainsChange'], true), + eq(variables['monoContainsChange'], true), + eq(variables['isManualOrIsNotPR'], true), eq(variables['isFullMatrix'], true)) - # Device tests are rolling build only - ${{ if eq(variables['isFullMatrix'], true) }}: - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/libraries/helix.yml - extraStepsParameters: - creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) - condition: >- - or( - eq(variables['librariesContainsChange'], true), - eq(variables['monoContainsChange'], true), - eq(variables['isFullMatrix'], true)) # # Build the whole product using Mono and run libraries tests @@ -298,6 +306,7 @@ jobs: eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), + eq(variables['isManualOrIsNotPR'], true), eq(variables['isFullMatrix'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml @@ -308,6 +317,7 @@ jobs: or( eq(variables['librariesContainsChange'], true), eq(variables['monoContainsChange'], true), + eq(variables['isManualOrIsNotPR'], true), eq(variables['isFullMatrix'], true)) # @@ -342,9 +352,10 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), + eq(variables['isManualOrIsNotPR'], true), eq(variables['isFullMatrix'], true)) # NOTE: Per PR test execution is not recommended for runtime tests - ${{ if eq(variables['isFullMatrix'], true) }}: + ${{ if eq(variables['isManualOrIsNotPR'], true) }}: # extra steps, run tests extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml extraStepsParameters: @@ -382,8 +393,9 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), + eq(variables['isManualOrIsNotPR'], true), eq(variables['isFullMatrix'], true)) - ${{ if eq(variables['isFullMatrix'], true) }}: + ${{ if eq(variables['isManualOrIsNotPR'], true) }}: # extra steps, run tests extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml extraStepsParameters: @@ -421,6 +433,7 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), + eq(variables['isManualOrIsNotPR'], true), eq(variables['isFullMatrix'], true)) # don't run tests on PRs until we can get significantly more devices # Turn off the testing for now, until https://github.com/dotnet/xharness/issues/663 gets resolved @@ -450,30 +463,116 @@ jobs: value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] jobParameters: testGroup: innerloop - nameSuffix: Browser_wasm_Windows - buildArgs: -subset mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows + nameSuffix: Windows_wasm + buildArgs: -subset mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows $(_runSmokeTestsOnlyArg) timeoutInMinutes: 180 condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), + eq(variables['isManualOrIsNotPR'], true), + eq(variables['isFullMatrix'], true)) + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/libraries/helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + extraHelixArguments: /p:BrowserHost=windows $(_runSmokeTestsOnlyArg) + scenarios: + - normal + - wasmtestonbrowser + condition: >- + or( + eq(variables['librariesContainsChange'], true), + eq(variables['monoContainsChange'], true), + eq(variables['isManualOrIsNotPR'], true), + eq(variables['isFullMatrix'], true)) + +# +# Build Browser_wasm, on windows, and run tests with AOT +# +# Disabled due to https://github.com/dotnet/runtime/issues/61721 +#- template: /eng/pipelines/common/platform-matrix.yml + #parameters: + #jobTemplate: /eng/pipelines/common/global-build-job.yml + #helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + #buildConfig: release + #runtimeFlavor: mono + #platforms: + #- Browser_wasm_win + #variables: + ## map dependencies variables to local variables + #- name: librariesContainsChange + #value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] + #- name: monoContainsChange + #value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] + #jobParameters: + #testGroup: innerloop + #nameSuffix: Windows_wasm_AOT + #buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) + #timeoutInMinutes: 180 + #condition: >- + #or( + #eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), + #eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), + #eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), + #eq(variables['isManualOrIsNotPR'], true), + #eq(variables['isFullMatrix'], true)) + ## extra steps, run tests + #extraStepsTemplate: /eng/pipelines/libraries/helix.yml + #extraStepsParameters: + #creator: dotnet-bot + #testRunNamePrefixSuffix: Mono_$(_BuildConfig) + #extraHelixArguments: /p:BrowserHost=windows /p:NeedsToBuildWasmAppsOnHelix=true $(_runSmokeTestsOnlyArg) + #scenarios: + #- normal + #condition: >- + #or( + #eq(variables['librariesContainsChange'], true), + #eq(variables['monoContainsChange'], true), + #eq(variables['isManualOrIsNotPR'], true), + #eq(variables['isFullMatrix'], true)) + + +# +# Build Browser_wasm, on windows, and run Wasm.Build.Tests +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + buildConfig: release + runtimeFlavor: mono + platforms: + - Browser_wasm_win + variables: + # map dependencies variables to local variables + - name: wasmbuildtestsContainsChange + value: $[ dependencies.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'] ] + jobParameters: + testGroup: innerloop + nameSuffix: Windows_wasm_WBT + buildArgs: -subset mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=windows /p:TestWasmBuildTests=true /p:TestAssemblies=false + timeoutInMinutes: 180 + condition: >- + or( + eq(dependencies.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'], true), + eq(variables['isManualOrIsNotPR'], true), + eq(variables['isFullMatrix'], true)) + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/libraries/helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + extraHelixArguments: /p:BrowserHost=windows + scenarios: + - buildwasmapps + condition: >- + or( + eq(variables['wasmbuildtestsContainsChange'], true), + eq(variables['isManualOrIsNotPR'], true), eq(variables['isFullMatrix'], true)) - ${{ if eq(variables['isFullMatrix'], true) }}: - # extra steps, run tests - extraStepsTemplate: /eng/pipelines/libraries/helix.yml - extraStepsParameters: - creator: dotnet-bot - testRunNamePrefixSuffix: Mono_$(_BuildConfig) - extraHelixArguments: /p:BrowserHost=windows - scenarios: - - normal - - wasmtestonbrowser - condition: >- - or( - eq(variables['librariesContainsChange'], true), - eq(variables['monoContainsChange'], true), - eq(variables['isFullMatrix'], true)) # # CoreCLR Build for running Apple Silicon libraries-innerloop diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 77361bc2be2245..af8b9c116dd80c 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -94,8 +94,8 @@ jobs: eq(variables['isFullMatrix'], true)) # -# Build CoreCLR checked using GCC toolchain -# Only when CoreCLR is changed +# Build the whole product using GNU compiler toolchain +# When CoreCLR, Mono, Libraries, Installer and src/tests are changed # - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -110,6 +110,9 @@ jobs: condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), eq(variables['isFullMatrix'], true)) @@ -190,7 +193,7 @@ jobs: eq(variables['Build.SourceBranchName'], 'main'), eq(variables['System.PullRequest.TargetBranch'], 'main')), or( - eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr_jit.containsChange'], true), eq(variables['isFullMatrix'], true))) # Build and test clr tools @@ -325,15 +328,11 @@ jobs: buildConfig: Release runtimeFlavor: mono platforms: - # BuildWasmApps should only happen on the rolling build. No need to duplicate the build on PR's - - ${{ if eq(variables['isFullMatrix'], true) }}: - - Browser_wasm + - Browser_wasm variables: # map dependencies variables to local variables - - name: monoContainsChange - value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] - - name: installerContainsChange - value: $[ dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'] ] + - name: wasmbuildtestsContainsChange + value: $[ dependencies.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'] ] jobParameters: testGroup: innerloop nameSuffix: AllSubsets_Mono_WasmBuildTests @@ -341,8 +340,7 @@ jobs: timeoutInMinutes: 180 condition: >- or( - eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), - eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'], true), eq(variables['isFullMatrix'], true)) # extra steps, run tests extraStepsTemplate: /eng/pipelines/libraries/helix.yml @@ -353,8 +351,7 @@ jobs: - buildwasmapps condition: >- or( - eq(variables['monoContainsChange'], true), - eq(variables['installerContainsChange'], true), + eq(variables['wasmbuildtestsContainsChange'], true), eq(variables['isFullMatrix'], true)) # @@ -936,7 +933,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: innerloop - liveLibrariesBuildConfig: ${{ variables.debugOnPrReleaseOnRolling }} condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true), @@ -1014,8 +1010,6 @@ jobs: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: innerloop - liveLibrariesBuildConfig: ${{ variables.debugOnPrReleaseOnRolling }} - liveRuntimeBuildConfig: release condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), @@ -1275,4 +1269,4 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), - eq(variables['isFullMatrix'], true)) \ No newline at end of file + eq(variables['isFullMatrix'], true)) diff --git a/eng/pipelines/runtimelab.yml b/eng/pipelines/runtimelab.yml index db73445d799874..9f1cd90822e832 100644 --- a/eng/pipelines/runtimelab.yml +++ b/eng/pipelines/runtimelab.yml @@ -142,7 +142,6 @@ stages: - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: innerloop - liveLibrariesBuildConfig: Release dependsOn: - build_Linux_x64_Checked_ - build_Linux_x64_Release_ diff --git a/eng/run-test.sh b/eng/run-test.sh index e5cf6a3b21d1e0..64474cc435af16 100644 --- a/eng/run-test.sh +++ b/eng/run-test.sh @@ -236,26 +236,22 @@ done # Compute paths to the binaries if they haven't already been computed -if [ -z "$Runtime" ] -then +if [[ -z "$Runtime" ]]; then Runtime="$ProjectRoot/artifacts/bin/testhost/netcoreapp-$OS-$Configuration-$__Arch" fi -if [ -z "$CoreFxTests" ] -then +if [[ -z "$CoreFxTests" ]]; then CoreFxTests="$ProjectRoot/artifacts/bin" fi # Check parameters up front for valid values: -if [ "$Configuration" != "Debug" ] && [ "$Configuration" != "Release" ] -then +if [[ "$Configuration" != "Debug" && "$Configuration" != "Release" ]]; then echo "error: Configuration should be Debug or Release" exit 1 fi -if [ "$OS" != "FreeBSD" ] && [ "$OS" != "Linux" ] && [ "$OS" != "NetBSD" ] && [ "$OS" != "illumos" ] && [ "$OS" != "Solaris" ] -then +if [[ "$OS" != "FreeBSD" && "$OS" != "Linux" && "$OS" != "NetBSD" && "$OS" != "illumos" && "$OS" != "Solaris" ]]; then echo "error: OS should be FreeBSD, Linux, NetBSD or Linux" exit 1 fi @@ -263,8 +259,7 @@ fi export CORECLR_SERVER_GC="$serverGC" export PAL_OUTPUTDEBUGSTRING="1" -if [ -z "$LANG" ] -then +if [[ -z "$LANG" ]]; then export LANG="en_US.UTF-8" fi @@ -281,29 +276,26 @@ ensure_binaries_are_present TestsFailed=0 numberOfProcesses=0 -if [ $RunTestSequential -eq 1 ] -then +if [[ $RunTestSequential -eq 1 ]]; then maxProcesses=1; else platform="$(uname)" - if [ "$platform" = "FreeBSD" ]; then + if [[ "$platform" == "FreeBSD" ]]; then maxProcesses=$(($(sysctl -n hw.ncpu)+1)) - if [ "$platform" = "NetBSD" ] || [ "$platform" = "SunOS" ] ; then + if [[ "$platform" == "NetBSD" || "$platform" == "SunOS" ]]; then maxProcesses=$(($(getconf NPROCESSORS_ONLN)+1)) else maxProcesses=$(($(getconf _NPROCESSORS_ONLN)+1)) fi fi -if [ -n "$TestDirFile" ] || [ -n "$TestDir" ] -then +if [[ -n "$TestDirFile" || -n "$TestDir" ]]; then run_selected_tests else run_all_tests "$CoreFxTests/tests/"*.Tests fi -if [ "$TestsFailed" -gt 0 ] -then +if [[ "$TestsFailed" -gt 0 ]]; then echo "$TestsFailed test(s) failed" else echo "All tests passed." diff --git a/eng/testing/AndroidRunnerTemplate.sh b/eng/testing/AndroidRunnerTemplate.sh index 3dab96f0bf3c43..d981d240c816f9 100644 --- a/eng/testing/AndroidRunnerTemplate.sh +++ b/eng/testing/AndroidRunnerTemplate.sh @@ -9,7 +9,7 @@ TARGET_OS=$3 TEST_NAME=$4 XHARNESS_OUT="$EXECUTION_DIR/xharness-output" -if [ -n "$5" ]; then +if [[ -n "$5" ]]; then ADDITIONAL_ARGS=${@:5} fi @@ -27,7 +27,7 @@ while true; do fi done -if [ ! -z "$XHARNESS_CLI_PATH" ]; then +if [[ -n "$XHARNESS_CLI_PATH" ]]; then # Allow overriding the path to the XHarness CLI DLL, # we need to call it directly via dotnet exec HARNESS_RUNNER="dotnet exec $XHARNESS_CLI_PATH" diff --git a/eng/testing/AppleRunnerTemplate.sh b/eng/testing/AppleRunnerTemplate.sh index 0ebff54c483934..8f66672f739e66 100644 --- a/eng/testing/AppleRunnerTemplate.sh +++ b/eng/testing/AppleRunnerTemplate.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env bash # NOTE: this script is only used locally, on CI we use the Helix SDK from arcade @@ -54,7 +54,7 @@ while true; do fi done -if [ ! -z "$XHARNESS_CLI_PATH" ]; then +if [[ -n "$XHARNESS_CLI_PATH" ]]; then # Allow overriding the path to the XHarness CLI DLL, # we need to call it directly via dotnet exec HARNESS_RUNNER="dotnet exec $XHARNESS_CLI_PATH" diff --git a/eng/testing/RunnerTemplate.sh b/eng/testing/RunnerTemplate.sh index 4770323fdc9c7d..bfaa743ef6f414 100644 --- a/eng/testing/RunnerTemplate.sh +++ b/eng/testing/RunnerTemplate.sh @@ -39,7 +39,7 @@ while [[ $# > 0 ]]; do shift done -if [ "$RUNTIME_PATH" == "" ]; then +if [[ -z "$RUNTIME_PATH" ]]; then echo "error: -r|--runtime-path argument is required." usage exit -1 @@ -127,7 +127,7 @@ function copy_core_file_to_temp_location { } # ========================= BEGIN Core File Setup ============================ -if [ "$(uname -s)" == "Darwin" ]; then +if [[ "$(uname -s)" == "Darwin" ]]; then # On OS X, we will enable core dump generation only if there are no core # files already in /cores/ at this point. This is being done to prevent # inadvertently flooding the CI machines with dumps. @@ -135,7 +135,7 @@ if [ "$(uname -s)" == "Darwin" ]; then ulimit -c unlimited fi -elif [ "$(uname -s)" == "Linux" ]; then +elif [[ "$(uname -s)" == "Linux" ]]; then # On Linux, we'll enable core file generation unconditionally, and if a dump # is generated, we will print some useful information from it and delete the # dump immediately. @@ -163,7 +163,7 @@ test_exitcode=$? popd echo ----- end $(date) ----- exit code $test_exitcode ---------------------------------------------------------- -if [ "${exitcode_list[$test_exitcode]}" != "" ]; then +if [[ -n "${exitcode_list[$test_exitcode]}" ]]; then echo exit code $test_exitcode means ${exitcode_list[$test_exitcode]} fi # ========================= END Test Execution =============================== @@ -200,11 +200,11 @@ if [[ "$(uname -s)" == "Linux" && $test_exitcode -ne 0 ]]; then # or "core." by default. We read /proc/sys/kernel/core_uses_pid to # determine which it is. core_name_uses_pid=0 - if [ -e /proc/sys/kernel/core_uses_pid ] && [ "1" == $(cat /proc/sys/kernel/core_uses_pid) ]; then + if [[ -e /proc/sys/kernel/core_uses_pid && "1" == $(cat /proc/sys/kernel/core_uses_pid) ]]; then core_name_uses_pid=1 fi - if [ $core_name_uses_pid == "1" ]; then + if [[ "$core_name_uses_pid" == "1" ]]; then # We don't know what the PID of the process was, so let's look at all core # files whose name matches core.NUMBER echo Looking for files matching core.* ... @@ -224,7 +224,7 @@ popd >/dev/null # ======================== END Core File Inspection ========================== # The helix work item should not exit with non-zero if tests ran and produced results # The special console runner for runtime returns 1 when tests fail -if [ "$test_exitcode" == "1" ]; then +if [[ "$test_exitcode" == "1" ]]; then if [ -n "$HELIX_WORKITEM_PAYLOAD" ]; then exit 0 fi diff --git a/eng/testing/WasmRunnerAOTTemplate.sh b/eng/testing/WasmRunnerAOTTemplate.sh index 6922b550551b8b..4aa271b960a537 100644 --- a/eng/testing/WasmRunnerAOTTemplate.sh +++ b/eng/testing/WasmRunnerAOTTemplate.sh @@ -11,7 +11,7 @@ else XHARNESS_OUT="$HELIX_WORKITEM_UPLOAD_ROOT/xharness-output" fi -if [ ! -z "$XHARNESS_CLI_PATH" ]; then +if [[ -n "$XHARNESS_CLI_PATH" ]]; then # When running in CI, we only have the .NET runtime available # We need to call the XHarness CLI DLL directly via dotnet exec HARNESS_RUNNER="dotnet exec $XHARNESS_CLI_PATH" @@ -19,7 +19,7 @@ else HARNESS_RUNNER="dotnet xharness" fi -if [ "$SCENARIO" == "WasmTestOnBrowser" ]; then +if [[ "$SCENARIO" == "WasmTestOnBrowser" ]]; then XHARNESS_COMMAND="test-browser" elif [ -z "$XHARNESS_COMMAND" ]; then XHARNESS_COMMAND="test" @@ -38,13 +38,22 @@ function _buildAOTFunc() dotnet msbuild $binLog -clp:PerformanceSummary -v:q -nologo if [[ "$(uname -s)" == "Linux" && $buildExitCode -ne 0 ]]; then echo "\nLast few messages from dmesg:\n" - dmesg | tail -n 20 + local lastLines=`dmesg | tail -n 20` + echo $lastLines + + if [[ "$lastLines" =~ "oom-kill" ]]; then + return 9200 # OOM + fi fi echo echo - return $buildExitCode + if [[ $buildExitCode -ne 0 ]]; then + return 9100 # aot build failure + fi + + return 0 } # RunCommands defined in tests.mobile.targets diff --git a/eng/testing/WasmRunnerTemplate.sh b/eng/testing/WasmRunnerTemplate.sh index 8997e222177cab..412c33724aa158 100644 --- a/eng/testing/WasmRunnerTemplate.sh +++ b/eng/testing/WasmRunnerTemplate.sh @@ -5,13 +5,13 @@ SCENARIO=$3 cd $EXECUTION_DIR -if [ -z "$HELIX_WORKITEM_UPLOAD_ROOT" ]; then +if [[ -z "$HELIX_WORKITEM_UPLOAD_ROOT" ]]; then XHARNESS_OUT="$EXECUTION_DIR/xharness-output" else XHARNESS_OUT="$HELIX_WORKITEM_UPLOAD_ROOT/xharness-output" fi -if [ ! -z "$XHARNESS_CLI_PATH" ]; then +if [[ -n "$XHARNESS_CLI_PATH" ]]; then # When running in CI, we only have the .NET runtime available # We need to call the XHarness CLI DLL directly via dotnet exec HARNESS_RUNNER="dotnet exec $XHARNESS_CLI_PATH" @@ -19,9 +19,9 @@ else HARNESS_RUNNER="dotnet xharness" fi -if [ "$SCENARIO" == "WasmTestOnBrowser" ]; then +if [[ "$SCENARIO" == "WasmTestOnBrowser" ]]; then XHARNESS_COMMAND="test-browser" -elif [ -z "$XHARNESS_COMMAND" ]; then +elif [[ -z "$XHARNESS_COMMAND" ]]; then XHARNESS_COMMAND="test" fi diff --git a/eng/testing/performance/performance-setup.sh b/eng/testing/performance/performance-setup.sh index cffd9ca8d6cdb8..b58a031bac3cda 100755 --- a/eng/testing/performance/performance-setup.sh +++ b/eng/testing/performance/performance-setup.sh @@ -162,7 +162,7 @@ while (($# > 0)); do echo " --internal If the benchmarks are running as an official job." echo " --monodotnet Pass the path to the mono dotnet for mono performance testing." echo " --wasm Path to the unpacked wasm runtime pack." - echo " --wasmaot Indicate wasm aot" + echo " --wasmaot Indicate wasm aot" echo " --latestdotnet --dotnet-versions will not be specified. --dotnet-versions defaults to LKG version in global.json " echo " --alpine Set for runs on Alpine" echo "" @@ -171,7 +171,7 @@ while (($# > 0)); do esac done -if [ "$repository" == "dotnet/performance" ] || [ "$repository" == "dotnet-performance" ]; then +if [[ "$repository" == "dotnet/performance" || "$repository" == "dotnet-performance" ]]; then run_from_perf_repo=true fi @@ -202,38 +202,38 @@ if [[ "$internal" == true ]]; then helix_source_prefix="official" creator= extra_benchmark_dotnet_arguments= - - if [[ "$architecture" = "arm64" ]]; then + + if [[ "$architecture" == "arm64" ]]; then queue=Ubuntu.1804.Arm64.Perf else - if [[ "$logical_machine" = "perfowl" ]]; then + if [[ "$logical_machine" == "perfowl" ]]; then queue=Ubuntu.1804.Amd64.Owl.Perf else queue=Ubuntu.1804.Amd64.Tiger.Perf fi fi - if [[ "$alpine" = "true" ]]; then + if [[ "$alpine" == "true" ]]; then queue=alpine.amd64.tiger.perf fi else - if [[ "$architecture" = "arm64" ]]; then + if [[ "$architecture" == "arm64" ]]; then queue=ubuntu.1804.armarch.open else queue=Ubuntu.1804.Amd64.Open fi - if [[ "$alpine" = "true" ]]; then + if [[ "$alpine" == "true" ]]; then queue=alpine.amd64.tiger.perf fi fi -if [[ "$mono_dotnet" != "" ]] && [[ "$monointerpreter" == "false" ]]; then +if [[ -n "$mono_dotnet" && "$monointerpreter" == "false" ]]; then configurations="$configurations LLVM=$llvm MonoInterpreter=$monointerpreter MonoAOT=$monoaot" extra_benchmark_dotnet_arguments="$extra_benchmark_dotnet_arguments --category-exclusion-filter NoMono" fi -if [[ "$wasm_runtime_loc" != "" ]]; then +if [[ -n "$wasm_runtime_loc" ]]; then if [[ "$wasmaot" == "true" ]]; then configurations="CompilationMode=wasm AOT=true RunKind=$kind" else @@ -245,7 +245,7 @@ if [[ "$wasm_runtime_loc" != "" ]]; then extra_benchmark_dotnet_arguments="$extra_benchmark_dotnet_arguments --category-exclusion-filter NoInterpreter NoWASM NoMono" fi -if [[ "$mono_dotnet" != "" ]] && [[ "$monointerpreter" == "true" ]]; then +if [[ -n "$mono_dotnet" && "$monointerpreter" == "true" ]]; then configurations="$configurations LLVM=$llvm MonoInterpreter=$monointerpreter MonoAOT=$monoaot" extra_benchmark_dotnet_arguments="$extra_benchmark_dotnet_arguments --category-exclusion-filter NoInterpreter NoMono" fi @@ -262,7 +262,7 @@ fi common_setup_arguments="--channel $cleaned_branch_name --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 +if [[ "$run_from_perf_repo" == true ]]; then payload_directory= workitem_directory=$source_directory performance_directory=$workitem_directory @@ -276,7 +276,7 @@ else mv $docs_directory $workitem_directory fi -if [[ "$wasm_runtime_loc" != "" ]]; then +if [[ -n "$wasm_runtime_loc" ]]; then using_wasm=true wasm_dotnet_path=$payload_directory/dotnet-wasm mv $wasm_runtime_loc $wasm_dotnet_path @@ -291,13 +291,13 @@ if [[ "$wasm_runtime_loc" != "" ]]; then rsync -a --progress $wasm_dotnet_path/artifacts/BrowserWasm/artifacts/* $wasm_dotnet_path/artifacts rm -r $wasm_dotnet_path/artifacts/BrowserWasm/artifacts if [[ "$wasmaot" == "true" ]]; then - extra_benchmark_dotnet_arguments="$extra_benchmark_dotnet_arguments --wasmEngine /home/helixbot/.jsvu/$javascript_engine --runtimeSrcDir \$HELIX_CORRELATION_PAYLOAD/dotnet-wasm --aotcompilermode wasm --buildTimeout 3600" + extra_benchmark_dotnet_arguments="$extra_benchmark_dotnet_arguments --wasmEngine /home/helixbot/.jsvu/$javascript_engine --runtimeSrcDir \$HELIX_CORRELATION_PAYLOAD/dotnet-wasm --aotcompilermode wasm --buildTimeout 3600" else extra_benchmark_dotnet_arguments="$extra_benchmark_dotnet_arguments --wasmEngine /home/helixbot/.jsvu/$javascript_engine --runtimeSrcDir \$HELIX_CORRELATION_PAYLOAD/dotnet-wasm" fi fi -if [[ "$mono_dotnet" != "" ]] && [[ "$monoaot" == "false" ]]; then +if [[ -n "$mono_dotnet" && "$monoaot" == "false" ]]; then using_mono=true mono_dotnet_path=$payload_directory/dotnet-mono mv $mono_dotnet $mono_dotnet_path @@ -309,12 +309,12 @@ if [[ "$monoaot" == "true" ]]; then extra_benchmark_dotnet_arguments="$extra_benchmark_dotnet_arguments --runtimes monoaotllvm --aotcompilerpath \$HELIX_CORRELATION_PAYLOAD/monoaot/sgen/mini/mono-sgen --customruntimepack \$HELIX_CORRELATION_PAYLOAD/monoaot/pack --aotcompilermode llvm" fi -if [[ "$use_core_run" = true ]]; then +if [[ "$use_core_run" == true ]]; then new_core_root=$payload_directory/Core_Root mv $core_root_directory $new_core_root fi -if [[ "$use_baseline_core_run" = true ]]; then +if [[ "$use_baseline_core_run" == true ]]; then new_baseline_core_root=$payload_directory/Baseline_Core_Root mv $baseline_core_root_directory $new_baseline_core_root fi diff --git a/eng/testing/runsettings.targets b/eng/testing/runsettings.targets index b5ff64cc9ea26f..a02637840ac456 100644 --- a/eng/testing/runsettings.targets +++ b/eng/testing/runsettings.targets @@ -7,6 +7,7 @@ false $(RunSettingsIntermediateOutputFilePath) $(RunSettingsAppOutputFilePath) + $(ArtifactsObjDir)vscode/.runsettings $(RunSettingsAppOutputFilePath) @@ -46,6 +47,12 @@ WriteOnlyWhenDifferent="true" Overwrite="true" /> + + $(RunSettingsOutputFilePath) diff --git a/eng/testing/tests.wasm.targets b/eng/testing/tests.wasm.targets index 00aa7b19f1701f..0286959859cc1e 100644 --- a/eng/testing/tests.wasm.targets +++ b/eng/testing/tests.wasm.targets @@ -5,9 +5,14 @@ true $(BundleTestAppTargets);BundleTestWasmApp true + false true + + + <_ShellCommandSeparator Condition="'$(OS)' == 'Windows_NT'">&& + <_ShellCommandSeparator Condition="'$(OS)' != 'Windows_NT'">&& @@ -23,13 +28,13 @@ <_XHarnessArgs Condition="'$(OS)' != 'Windows_NT'">wasm $XHARNESS_COMMAND --app=. --output-directory=$XHARNESS_OUT <_XHarnessArgs Condition="'$(OS)' == 'Windows_NT'">wasm %XHARNESS_COMMAND% --app=. --output-directory=%XHARNESS_OUT% - <_XHarnessArgs Condition="'$(Scenario)' != 'WasmTestOnBrowser' and '$(Scenario)' != 'BuildWasmApps'">$(_XHarnessArgs) --engine=$(JSEngine) $(JSEngineArgs) --js-file=runtime.js + <_XHarnessArgs Condition="'$(Scenario)' != 'WasmTestOnBrowser' and '$(Scenario)' != 'BuildWasmApps'">$(_XHarnessArgs) --engine=$(JSEngine) $(JSEngineArgs) --js-file=main.js <_XHarnessArgs Condition="'$(BrowserHost)' == 'windows'">$(_XHarnessArgs) --browser=chrome --browser-path=%HELIX_CORRELATION_PAYLOAD%\chrome-win\chrome.exe <_XHarnessArgs Condition="'$(IsFunctionalTest)' == 'true'" >$(_XHarnessArgs) --expected-exit-code=$(ExpectedExitCode) <_XHarnessArgs Condition="'$(WasmXHarnessArgs)' != ''" >$(_XHarnessArgs) $(WasmXHarnessArgs) <_AppArgs Condition="'$(IsFunctionalTest)' != 'true' and '$(Scenario)' != 'BuildWasmApps'">--run WasmTestRunner.dll $(AssemblyName).dll - <_AppArgs Condition="'$(IsFunctionalTest)' == 'true'">--run $(AssemblyName).dll --testing + <_AppArgs Condition="'$(IsFunctionalTest)' == 'true'">--run $(AssemblyName).dll <_AppArgs Condition="'$(WasmTestAppArgs)' != ''">$(_AppArgs) $(WasmTestAppArgs) @@ -38,16 +43,19 @@ - <_AOTBuildCommand>_buildAOTFunc publish/ProxyProjectForAOTOnHelix.proj $XHARNESS_OUT/AOTBuild.binlog + <_AOTBuildCommand Condition="'$(BrowserHost)' != 'windows'">_buildAOTFunc publish/ProxyProjectForAOTOnHelix.proj $XHARNESS_OUT/AOTBuild.binlog + <_AOTBuildCommand Condition="'$(BrowserHost)' == 'windows'">dotnet msbuild publish/ProxyProjectForAOTOnHelix.proj /bl:%XHARNESS_OUT%/AOTBuild.binlog + + <_AOTBuildCommand Condition="'$(BrowserHost)' == 'windows'">$(_AOTBuildCommand) "/p:WasmCachePath=%USERPROFILE%\.emscripten-cache" <_AOTBuildCommand Condition="'$(ContinuousIntegrationBuild)' != 'true'">$(_AOTBuildCommand) /p:RuntimeSrcDir=$(RepoRoot) /p:RuntimeConfig=$(Configuration) <_AOTBuildCommand>$(_AOTBuildCommand) /p:RunAOTCompilation=$(RunAOTCompilation) - <_AOTBuildCommand>$(_AOTBuildCommand) && cd wasm_build/AppBundle + <_AOTBuildCommand>$(_AOTBuildCommand) $(_ShellCommandSeparator) cd wasm_build/AppBundle $(_AOTBuildCommand) - $(_AOTBuildCommand) && $(RunScriptCommand) + $(_AOTBuildCommand) $(_ShellCommandSeparator) $(RunScriptCommand) @@ -161,7 +169,7 @@ $(BundleDir) WasmTestRunner.dll - $(MonoProjectRoot)\wasm\runtime-test.js + $(MonoProjectRoot)\wasm\test-main.js $(InvariantGlobalization) true false diff --git a/eng/testing/workloads-testing.targets b/eng/testing/workloads-testing.targets index 40f134fc8bb3d8..67a781d1058b67 100644 --- a/eng/testing/workloads-testing.targets +++ b/eng/testing/workloads-testing.targets @@ -89,9 +89,6 @@ WorkingDirectory="$(InstallerProjectRoot)pkg/sfx/Microsoft.NETCore.App" /> - <_NuGetSourceForWorkloads Include="dotnet6" Value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" /> - <_NuGetSourceForWorkloads Include="dotnet7" Value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" /> - <_BuiltNuGets Include="$(LibrariesShippingPackagesDir)\*.nupkg" /> @@ -111,7 +108,7 @@ WorkloadId="@(WorkloadIdForTesting)" VersionBand="$(SdkBandVersion)" LocalNuGetsPath="$(LibrariesShippingPackagesDir)" - ExtraNuGetSources="@(_NuGetSourceForWorkloads)" + TemplateNuGetConfigPath="$(RepoRoot)NuGet.config" SdkDir="$(SdkWithWorkloadForTestingPath)" /> @@ -124,7 +121,7 @@ WorkloadId="@(WorkloadIdForTesting)" VersionBand="$(SdkBandVersion)" LocalNuGetsPath="$(LibrariesShippingPackagesDir)" - ExtraNuGetSources="@(_NuGetSourceForWorkloads)" + TemplateNuGetConfigPath="$(RepoRoot)NuGet.config" SdkDir="$(SdkWithNoWorkloadForTestingPath)" OnlyUpdateManifests="true"/> diff --git a/global.json b/global.json index c87af2701bf6f0..e13e46fe71ce80 100644 --- a/global.json +++ b/global.json @@ -1,23 +1,23 @@ { "sdk": { - "version": "6.0.100-rc.1.21430.12", + "version": "6.0.100", "allowPrerelease": true, "rollForward": "major" }, "tools": { - "dotnet": "6.0.100-rc.1.21430.12" + "dotnet": "6.0.100" }, "native-tools": { "cmake": "3.16.4", "python3": "3.7.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "7.0.0-beta.21529.1", - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.21529.1", - "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.21529.1", - "Microsoft.DotNet.SharedFramework.Sdk": "7.0.0-beta.21529.1", + "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "7.0.0-beta.21576.4", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.21576.4", + "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.21576.4", + "Microsoft.DotNet.SharedFramework.Sdk": "7.0.0-beta.21576.4", "Microsoft.Build.NoTargets": "3.1.0", "Microsoft.Build.Traversal": "3.0.23", - "Microsoft.NET.Sdk.IL": "7.0.0-alpha.1.21551.1" + "Microsoft.NET.Sdk.IL": "7.0.0-alpha.1.21576.4" } } diff --git a/src/coreclr/.nuget/Directory.Build.props b/src/coreclr/.nuget/Directory.Build.props index ad18679d42d5bb..16c84169f75b3f 100644 --- a/src/coreclr/.nuget/Directory.Build.props +++ b/src/coreclr/.nuget/Directory.Build.props @@ -16,10 +16,6 @@ true - - - 7.0.0 - $(PackageVersion) diff --git a/src/coreclr/.nuget/Directory.Build.targets b/src/coreclr/.nuget/Directory.Build.targets index 365d5ed7a9ca60..687a6f40253106 100644 --- a/src/coreclr/.nuget/Directory.Build.targets +++ b/src/coreclr/.nuget/Directory.Build.targets @@ -1,5 +1,13 @@ + + + + $(ProductVersion) + $(PackageVersion) + + + " : " ", pRec->m_construct, @@ -542,7 +538,7 @@ void CONTRACT_ASSERT(const char *szElaboration, pRec->m_lineNum ); - strcat_s(Buf, _countof(Buf), tmpbuf); + strcat_s(Buf, ARRAY_SIZE(Buf), tmpbuf); } pRec = pRec->m_pNext; @@ -560,12 +556,12 @@ void CONTRACT_ASSERT(const char *szElaboration, if (count == 0) { - strcat_s(Buf,_countof(Buf), "\n ..."); + strcat_s(Buf,ARRAY_SIZE(Buf), "\n ..."); } if (exceptionBuildingStack) { - strcat_s(Buf,_countof(Buf), + strcat_s(Buf,ARRAY_SIZE(Buf), "\n" "\nError forming contract stack. Any contract stack displayed above is correct," "\nbut it's most probably truncated. This is probably due to a CONTRACT in a" @@ -579,17 +575,17 @@ void CONTRACT_ASSERT(const char *szElaboration, ); } - strcat_s(Buf,_countof(Buf), "\n\n"); + strcat_s(Buf,ARRAY_SIZE(Buf), "\n\n"); if (!foundconflict && count != 0) { if (whichTest == BaseContract::THROWS_No) { - strcat_s(Buf,_countof(Buf), "You can't throw here because there is no handler on the stack.\n"); + strcat_s(Buf,ARRAY_SIZE(Buf), "You can't throw here because there is no handler on the stack.\n"); } else { - strcat_s(Buf,_countof(Buf), "We can't find the violated contract. Look for an old-style non-holder-based contract.\n"); + strcat_s(Buf,ARRAY_SIZE(Buf), "We can't find the violated contract. Look for an old-style non-holder-based contract.\n"); } } diff --git a/src/coreclr/inc/cordebug.idl b/src/coreclr/inc/cordebug.idl index 9620b2cf771280..97e53150b055e0 100644 --- a/src/coreclr/inc/cordebug.idl +++ b/src/coreclr/inc/cordebug.idl @@ -54,7 +54,7 @@ typedef DWORD CONNID; cpp_quote("#ifndef _COR_IL_MAP") cpp_quote("#define _COR_IL_MAP") -// Note that this structure is also defined in CorProf.idl - PROPOGATE CHANGES +// Note that this structure is also defined in CorProf.idl - PROPAGATE CHANGES // BOTH WAYS, or this'll become a really insidious bug some day. typedef struct _COR_IL_MAP { diff --git a/src/coreclr/inc/cordebuginfo.h b/src/coreclr/inc/cordebuginfo.h index 4de783aae98450..e2683d36ddcd79 100644 --- a/src/coreclr/inc/cordebuginfo.h +++ b/src/coreclr/inc/cordebuginfo.h @@ -52,7 +52,7 @@ class ICorDebugInfo struct OffsetMapping { uint32_t nativeOffset; - uint32_t ilOffset; + uint32_t ilOffset; // IL offset or one of the special values in MappingTypes SourceTypes source; // The debugger needs this so that // we don't put Edit and Continue breakpoints where // the stack isn't empty. We can put regular breakpoints diff --git a/src/coreclr/inc/corhdr.h b/src/coreclr/inc/corhdr.h index 8b3eb42775c451..11dd7029884539 100644 --- a/src/coreclr/inc/corhdr.h +++ b/src/coreclr/inc/corhdr.h @@ -249,7 +249,7 @@ typedef struct IMAGE_COR20_HEADER #else // !__IMAGE_COR20_HEADER_DEFINED__ // @TODO: This is required because we pull in the COM+ 2.0 PE header -// definition from WinNT.h, and these constants have not yet propogated to there. +// definition from WinNT.h, and these constants have not yet propagated to there. // #define COR_VTABLE_FROM_UNMANAGED_RETAIN_APPDOMAIN 0x08 #define COMIMAGE_FLAGS_32BITPREFERRED 0x00020000 diff --git a/src/coreclr/inc/corhlpr.h b/src/coreclr/inc/corhlpr.h index 450514da95c180..427e8cdc0ff5c5 100644 --- a/src/coreclr/inc/corhlpr.h +++ b/src/coreclr/inc/corhlpr.h @@ -336,7 +336,7 @@ struct COR_ILMETHOD_SECT const COR_ILMETHOD_SECT* Next() const { if (!More()) return(0); - return ((COR_ILMETHOD_SECT*)(((BYTE *)this) + DataSize()))->Align(); + return ((COR_ILMETHOD_SECT*)Align(((BYTE *)this) + DataSize())); } const BYTE* Data() const @@ -374,9 +374,9 @@ struct COR_ILMETHOD_SECT return((AsSmall()->Kind & CorILMethod_Sect_FatFormat) != 0); } - const COR_ILMETHOD_SECT* Align() const + static const void* Align(const void* p) { - return((COR_ILMETHOD_SECT*) ((((UINT_PTR) this) + 3) & ~3)); + return((void*) ((((UINT_PTR) p) + 3) & ~3)); } protected: @@ -579,7 +579,7 @@ typedef struct tagCOR_ILMETHOD_FAT : IMAGE_COR_ILMETHOD_FAT const COR_ILMETHOD_SECT* GetSect() const { if (!More()) return (0); - return(((COR_ILMETHOD_SECT*) (GetCode() + GetCodeSize()))->Align()); + return(((COR_ILMETHOD_SECT*) COR_ILMETHOD_SECT::Align(GetCode() + GetCodeSize()))); } } COR_ILMETHOD_FAT; diff --git a/src/coreclr/inc/corinfo.h b/src/coreclr/inc/corinfo.h index b779d795a16b9a..4cc0c44b83c1df 100644 --- a/src/coreclr/inc/corinfo.h +++ b/src/coreclr/inc/corinfo.h @@ -472,7 +472,6 @@ enum CorInfoHelpFunc CORINFO_HELP_GETFIELDADDR, - CORINFO_HELP_GETSTATICFIELDADDR_CONTEXT, // Helper for context-static fields CORINFO_HELP_GETSTATICFIELDADDR_TLS, // Helper for PE TLS fields // There are a variety of specialized helpers for accessing static fields. The JIT should use @@ -811,7 +810,7 @@ enum CorInfoFlag CORINFO_FLG_CONTAINS_GC_PTR = 0x01000000, // does the class contain a gc ptr ? CORINFO_FLG_DELEGATE = 0x02000000, // is this a subclass of delegate or multicast delegate ? // CORINFO_FLG_UNUSED = 0x04000000, - CORINFO_FLG_CONTAINS_STACK_PTR = 0x08000000, // This class has a stack pointer inside it + CORINFO_FLG_BYREF_LIKE = 0x08000000, // it is byref-like value type CORINFO_FLG_VARIANCE = 0x10000000, // MethodTable::HasVariance (sealed does *not* mean uncast-able) CORINFO_FLG_BEFOREFIELDINIT = 0x20000000, // Additional flexibility for when to run .cctor (see code:#ClassConstructionFlags) CORINFO_FLG_GENERIC_TYPE_VARIABLE = 0x40000000, // This is really a handle for a variable type @@ -886,7 +885,6 @@ enum CorInfoIntrinsics CORINFO_INTRINSIC_Array_Get, // Get the value of an element in an array CORINFO_INTRINSIC_Array_Address, // Get the address of an element in an array CORINFO_INTRINSIC_Array_Set, // Set the value of an element in an array - CORINFO_INTRINSIC_InitializeArray, // initialize an array from static data CORINFO_INTRINSIC_RTH_GetValueInternal, CORINFO_INTRINSIC_Object_GetType, CORINFO_INTRINSIC_StubHelpers_GetStubContext, @@ -2302,14 +2300,6 @@ class ICorStaticInfo CORINFO_CLASS_HANDLE cls ) = 0; - // Returns "TRUE" iff "cls" is a struct type such that return buffers used for returning a value - // of this type must be stack-allocated. This will generally be true only if the struct - // contains GC pointers, and does not exceed some size limit. Maintaining this as an invariant allows - // an optimization: the JIT may assume that return buffer pointers for return types for which this predicate - // returns TRUE are always stack allocated, and thus, that stores to the GC-pointer fields of such return - // buffers do not require GC write barriers. - virtual bool isStructRequiringStackAllocRetBuf(CORINFO_CLASS_HANDLE cls) = 0; - virtual CORINFO_MODULE_HANDLE getClassModule ( CORINFO_CLASS_HANDLE cls ) = 0; diff --git a/src/coreclr/inc/corpriv.h b/src/coreclr/inc/corpriv.h index 25102cefdd1cb5..d500b187493cd8 100644 --- a/src/coreclr/inc/corpriv.h +++ b/src/coreclr/inc/corpriv.h @@ -283,9 +283,6 @@ typedef enum CorOpenFlagsInternal #endif // %%Classes: ---------------------------------------------------------------- -#ifndef lengthof -#define lengthof(rg) (sizeof(rg)/sizeof(rg[0])) -#endif #define COR_MODULE_CLASS "" #define COR_WMODULE_CLASS W("") diff --git a/src/coreclr/inc/crsttypes.h b/src/coreclr/inc/crsttypes.h index 23070d7820d61d..d462cbd3c88e1c 100644 --- a/src/coreclr/inc/crsttypes.h +++ b/src/coreclr/inc/crsttypes.h @@ -1,7 +1,6 @@ // // Licensed to the .NET Foundation under one or more 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 __CRST_TYPES_INCLUDED @@ -11,7 +10,7 @@ // This file describes the range of Crst types available and their mapping to a numeric level (used by the // runtime in debug mode to validate we're deadlock free). To modify these settings edit the -// file:CrstTypes.def file and run the clr\bin\CrstTypeTool utility to generate a new version of this file. +// file:CrstTypes.def file and run the clr\artifacts\CrstTypeTool utility to generate a new version of this file. // Each Crst type is declared as a value in the following CrstType enum. enum CrstType @@ -59,85 +58,83 @@ enum CrstType CrstGCCover = 40, CrstGlobalStrLiteralMap = 41, CrstHandleTable = 42, - CrstHostAssemblyMap = 43, - CrstHostAssemblyMapAdd = 44, - CrstIbcProfile = 45, - CrstIJWFixupData = 46, - CrstIJWHash = 47, - CrstILStubGen = 48, - CrstInlineTrackingMap = 49, - CrstInstMethodHashTable = 50, - CrstInterop = 51, - CrstInteropData = 52, - CrstIsJMCMethod = 53, - CrstISymUnmanagedReader = 54, - CrstJit = 55, - CrstJitGenericHandleCache = 56, - CrstJitInlineTrackingMap = 57, - CrstJitPatchpoint = 58, - CrstJitPerf = 59, - CrstJumpStubCache = 60, - CrstLeafLock = 61, - CrstListLock = 62, - CrstLoaderAllocator = 63, - CrstLoaderAllocatorReferences = 64, - CrstLoaderHeap = 65, - CrstManagedObjectWrapperMap = 66, - CrstMethodDescBackpatchInfoTracker = 67, - CrstModule = 68, - CrstModuleFixup = 69, - CrstModuleLookupTable = 70, - CrstMulticoreJitHash = 71, - CrstMulticoreJitManager = 72, - CrstNativeImageEagerFixups = 73, - CrstNativeImageLoad = 74, - CrstNls = 75, - CrstNotifyGdb = 76, - CrstObjectList = 77, - CrstPEImage = 78, - CrstPendingTypeLoadEntry = 79, - CrstPgoData = 80, - CrstPinnedByrefValidation = 81, - CrstProfilerGCRefDataFreeList = 82, - CrstProfilingAPIStatus = 83, - CrstRCWCache = 84, - CrstRCWCleanupList = 85, - CrstReadyToRunEntryPointToMethodDescMap = 86, - CrstReflection = 87, - CrstReJITGlobalRequest = 88, - CrstRetThunkCache = 89, - CrstSavedExceptionInfo = 90, - CrstSaveModuleProfileData = 91, - CrstSecurityStackwalkCache = 92, - CrstSigConvert = 93, - CrstSingleUseLock = 94, - CrstSpecialStatics = 95, - CrstStackSampler = 96, - CrstStressLog = 97, - CrstStubCache = 98, - CrstStubDispatchCache = 99, - CrstStubUnwindInfoHeapSegments = 100, - CrstSyncBlockCache = 101, - CrstSyncHashLock = 102, - CrstSystemBaseDomain = 103, - CrstSystemDomain = 104, - CrstSystemDomainDelayedUnloadList = 105, - CrstThreadIdDispenser = 106, - CrstThreadpoolTimerQueue = 107, - CrstThreadpoolWaitThreads = 108, - CrstThreadpoolWorker = 109, - CrstThreadStore = 110, - CrstTieredCompilation = 111, - CrstTypeEquivalenceMap = 112, - CrstTypeIDMap = 113, - CrstUMEntryThunkCache = 114, - CrstUMEntryThunkFreeListLock = 115, - CrstUniqueStack = 116, - CrstUnresolvedClassLock = 117, - CrstUnwindInfoTableLock = 118, - CrstVSDIndirectionCellLock = 119, - CrstWrapperTemplate = 120, - kNumberOfCrstTypes = 121 + CrstIbcProfile = 43, + CrstIJWFixupData = 44, + CrstIJWHash = 45, + CrstILStubGen = 46, + CrstInlineTrackingMap = 47, + CrstInstMethodHashTable = 48, + CrstInterop = 49, + CrstInteropData = 50, + CrstIsJMCMethod = 51, + CrstISymUnmanagedReader = 52, + CrstJit = 53, + CrstJitGenericHandleCache = 54, + CrstJitInlineTrackingMap = 55, + CrstJitPatchpoint = 56, + CrstJitPerf = 57, + CrstJumpStubCache = 58, + CrstLeafLock = 59, + CrstListLock = 60, + CrstLoaderAllocator = 61, + CrstLoaderAllocatorReferences = 62, + CrstLoaderHeap = 63, + CrstManagedObjectWrapperMap = 64, + CrstMethodDescBackpatchInfoTracker = 65, + CrstModule = 66, + CrstModuleFixup = 67, + CrstModuleLookupTable = 68, + CrstMulticoreJitHash = 69, + CrstMulticoreJitManager = 70, + CrstNativeImageEagerFixups = 71, + CrstNativeImageLoad = 72, + CrstNls = 73, + CrstNotifyGdb = 74, + CrstObjectList = 75, + CrstPEImage = 76, + CrstPendingTypeLoadEntry = 77, + CrstPgoData = 78, + CrstPinnedByrefValidation = 79, + CrstProfilerGCRefDataFreeList = 80, + CrstProfilingAPIStatus = 81, + CrstRCWCache = 82, + CrstRCWCleanupList = 83, + CrstReadyToRunEntryPointToMethodDescMap = 84, + CrstReflection = 85, + CrstReJITGlobalRequest = 86, + CrstRetThunkCache = 87, + CrstSavedExceptionInfo = 88, + CrstSaveModuleProfileData = 89, + CrstSecurityStackwalkCache = 90, + CrstSigConvert = 91, + CrstSingleUseLock = 92, + CrstSpecialStatics = 93, + CrstStackSampler = 94, + CrstStressLog = 95, + CrstStubCache = 96, + CrstStubDispatchCache = 97, + CrstStubUnwindInfoHeapSegments = 98, + CrstSyncBlockCache = 99, + CrstSyncHashLock = 100, + CrstSystemBaseDomain = 101, + CrstSystemDomain = 102, + CrstSystemDomainDelayedUnloadList = 103, + CrstThreadIdDispenser = 104, + CrstThreadpoolTimerQueue = 105, + CrstThreadpoolWaitThreads = 106, + CrstThreadpoolWorker = 107, + CrstThreadStore = 108, + CrstTieredCompilation = 109, + CrstTypeEquivalenceMap = 110, + CrstTypeIDMap = 111, + CrstUMEntryThunkCache = 112, + CrstUMEntryThunkFreeListLock = 113, + CrstUniqueStack = 114, + CrstUnresolvedClassLock = 115, + CrstUnwindInfoTableLock = 116, + CrstVSDIndirectionCellLock = 117, + CrstWrapperTemplate = 118, + kNumberOfCrstTypes = 119 }; #endif // __CRST_TYPES_INCLUDED @@ -191,8 +188,6 @@ int g_rgCrstLevelMap[] = 10, // CrstGCCover 13, // CrstGlobalStrLiteralMap 1, // CrstHandleTable - 0, // CrstHostAssemblyMap - 3, // CrstHostAssemblyMapAdd 0, // CrstIbcProfile 8, // CrstIJWFixupData 0, // CrstIJWHash @@ -317,8 +312,6 @@ LPCSTR g_rgCrstNameMap[] = "CrstGCCover", "CrstGlobalStrLiteralMap", "CrstHandleTable", - "CrstHostAssemblyMap", - "CrstHostAssemblyMapAdd", "CrstIbcProfile", "CrstIJWFixupData", "CrstIJWHash", diff --git a/src/coreclr/inc/icorjitinfoimpl_generated.h b/src/coreclr/inc/icorjitinfoimpl_generated.h index 4cb3e3f012d925..da724e75da6073 100644 --- a/src/coreclr/inc/icorjitinfoimpl_generated.h +++ b/src/coreclr/inc/icorjitinfoimpl_generated.h @@ -207,9 +207,6 @@ CorInfoInlineTypeCheck canInlineTypeCheck( uint32_t getClassAttribs( CORINFO_CLASS_HANDLE cls) override; -bool isStructRequiringStackAllocRetBuf( - CORINFO_CLASS_HANDLE cls) override; - CORINFO_MODULE_HANDLE getClassModule( CORINFO_CLASS_HANDLE cls) override; diff --git a/src/coreclr/inc/jiteeversionguid.h b/src/coreclr/inc/jiteeversionguid.h index ea71b2ad61e8dd..b51f56b2df5c78 100644 --- a/src/coreclr/inc/jiteeversionguid.h +++ b/src/coreclr/inc/jiteeversionguid.h @@ -43,11 +43,11 @@ typedef const GUID *LPCGUID; #define GUID_DEFINED #endif // !GUID_DEFINED -constexpr GUID JITEEVersionIdentifier = { /* 3df3e3ec-b1f6-4e6d-8439-2e7f3f7fa2ac */ - 0x3df3e3ec, - 0xb1f6, - 0x4e6d, - {0x84, 0x39, 0x2e, 0x7f, 0x3f, 0x7f, 0xa2, 0xac} +constexpr GUID JITEEVersionIdentifier = { /* 0c6f2d8d-f1b7-4c28-bbe8-36c8f6b35fbf */ + 0xc6f2d8d, + 0xf1b7, + 0x4c28, + { 0xbb, 0xe8, 0x36, 0xc8, 0xf6, 0xb3, 0x5f, 0xbf} }; ////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/coreclr/inc/jithelpers.h b/src/coreclr/inc/jithelpers.h index b15d770e672891..4d1fc11f0e8cb2 100644 --- a/src/coreclr/inc/jithelpers.h +++ b/src/coreclr/inc/jithelpers.h @@ -173,7 +173,6 @@ JITHELPER(CORINFO_HELP_GETFIELDADDR, JIT_GetFieldAddr,CORINFO_HELP_SIG_REG_ONLY) - JITHELPER(CORINFO_HELP_GETSTATICFIELDADDR_CONTEXT, NULL, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) JITHELPER(CORINFO_HELP_GETSTATICFIELDADDR_TLS, NULL, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB) JITHELPER(CORINFO_HELP_GETGENERICS_GCSTATIC_BASE, JIT_GetGenericsGCStaticBase,CORINFO_HELP_SIG_REG_ONLY) diff --git a/src/coreclr/inc/metamodelpub.h b/src/coreclr/inc/metamodelpub.h index 37e77e9123b101..b1eb8b961dbc5f 100644 --- a/src/coreclr/inc/metamodelpub.h +++ b/src/coreclr/inc/metamodelpub.h @@ -17,11 +17,6 @@ #include #include "contract.h" - -#ifndef lengthof -# define lengthof(x) (sizeof(x)/sizeof((x)[0])) -#endif - template inline T Align4(T p) { LIMITED_METHOD_CONTRACT; diff --git a/src/coreclr/inc/nsutilpriv.h b/src/coreclr/inc/nsutilpriv.h index 519d0acc72f54e..108e8e61479b25 100644 --- a/src/coreclr/inc/nsutilpriv.h +++ b/src/coreclr/inc/nsutilpriv.h @@ -170,7 +170,7 @@ bool MakeAssemblyQualifiedName( // true if ok, static bool MakeAssemblyQualifiedName( // true ok, false truncation - __out_ecount (dwBuffer) WCHAR* pBuffer, // Buffer to recieve the results + __out_ecount (dwBuffer) WCHAR* pBuffer, // Buffer to receive the results int dwBuffer, // Number of characters total in buffer const WCHAR *szTypeName, // Namespace for name. int dwTypeName, // Number of characters (not including null) diff --git a/src/coreclr/inc/patchpointinfo.h b/src/coreclr/inc/patchpointinfo.h index 1445d8f79bce9c..d6bd2b6aee9a41 100644 --- a/src/coreclr/inc/patchpointinfo.h +++ b/src/coreclr/inc/patchpointinfo.h @@ -40,6 +40,7 @@ struct PatchpointInfo m_genericContextArgOffset = -1; m_keptAliveThisOffset = -1; m_securityCookieOffset = -1; + m_monitorAcquiredOffset = -1; } // Total size of this patchpoint info record, in bytes @@ -108,6 +109,22 @@ struct PatchpointInfo m_securityCookieOffset = offset; } + // Original method FP relative offset for monitor acquired flag + int MonitorAcquiredOffset() const + { + return m_monitorAcquiredOffset; + } + + bool HasMonitorAcquired() const + { + return m_monitorAcquiredOffset != -1; + } + + void SetMonitorAcquiredOffset(int offset) + { + m_monitorAcquiredOffset = offset; + } + // True if this local was address exposed in the original method bool IsExposed(unsigned localNum) const { @@ -141,6 +158,7 @@ struct PatchpointInfo int m_genericContextArgOffset; int m_keptAliveThisOffset; int m_securityCookieOffset; + int m_monitorAcquiredOffset; int m_offsetAndExposureData[]; }; diff --git a/src/coreclr/inc/pgo_formatprocessing.h b/src/coreclr/inc/pgo_formatprocessing.h index 8d111bf2c89491..18fe5601c0d283 100644 --- a/src/coreclr/inc/pgo_formatprocessing.h +++ b/src/coreclr/inc/pgo_formatprocessing.h @@ -361,6 +361,35 @@ bool ReadInstrumentationSchemaWithLayout(const uint8_t *pByte, size_t cbDataMax, }); } + +// Return true if schemaTable entries are a subset of the schema described by pByte, with matching entries in the same order. +// Also updates offset of the matching entries in schemaTable to those of the pByte schema. +// +inline bool CheckIfPgoSchemaIsCompatibleAndSetOffsets(const uint8_t *pByte, size_t cbDataMax, ICorJitInfo::PgoInstrumentationSchema* schemaTable, size_t cSchemas) +{ + size_t nMatched = 0; + size_t initialOffset = cbDataMax; + + auto handler = [schemaTable, cSchemas, &nMatched](const ICorJitInfo::PgoInstrumentationSchema& schema) + { + if ((nMatched < cSchemas) + && (schema.InstrumentationKind == schemaTable[nMatched].InstrumentationKind) + && (schema.ILOffset == schemaTable[nMatched].ILOffset) + && (schema.Count == schemaTable[nMatched].Count) + && (schema.Other == schemaTable[nMatched].Other)) + { + schemaTable[nMatched].Offset = schema.Offset; + nMatched++; + } + + return true; + }; + + ReadInstrumentationSchemaWithLayout(pByte, cbDataMax, initialOffset, handler); + + return (nMatched == cSchemas); +} + inline bool ReadInstrumentationSchemaWithLayoutIntoSArray(const uint8_t *pByte, size_t cbDataMax, size_t initialOffset, SArray* pSchemas) { auto lambda = [pSchemas](const ICorJitInfo::PgoInstrumentationSchema &schema) diff --git a/src/coreclr/inc/shash.h b/src/coreclr/inc/shash.h index 163e2e8c4dfdb1..f2ef79e5c1738b 100644 --- a/src/coreclr/inc/shash.h +++ b/src/coreclr/inc/shash.h @@ -264,11 +264,6 @@ class EMPTY_BASES_DECL SHash : public TRAITS // NoThrow version of CheckGrowth function. Returns FALSE on failure. BOOL CheckGrowthNoThrow(); - // See if it is OK to grow the hash table by one element. If not, allocate new - // hash table and return it together with its size *pcNewSize (used by code:AddPhases). - // Returns NULL if there already is space for one element. - element_t * CheckGrowth_OnlyAllocateNewTable(count_t * pcNewSize); - // Allocates new resized hash table for growth. Does not update the hash table on the object. // The new size is computed based on the current population, growth factor, and maximum density factor. element_t * Grow_OnlyAllocateNewTable(count_t * pcNewSize); @@ -278,7 +273,7 @@ class EMPTY_BASES_DECL SHash : public TRAITS // Utility function to allocate new table (does not copy the values into it yet). Returns the size of new table in // *pcNewTableSize (finds next prime). - // Phase 1 of code:Reallocate - it is split to support code:AddPhases. + // Phase 1 of code:Reallocate element_t * AllocateNewTable(count_t requestedSize, count_t * pcNewTableSize); // NoThrow version of AllocateNewTable utility function. Returns NULL on failure. @@ -287,11 +282,11 @@ class EMPTY_BASES_DECL SHash : public TRAITS // Utility function to replace old table with newly allocated table (as allocated by // code:AllocateNewTable). Copies all 'old' values into the new table first. // Returns the old table. Caller is expected to delete it (via code:DeleteOldTable). - // Phase 2 of code:Reallocate - it is split to support code:AddPhases. + // Phase 2 of code:Reallocate element_t * ReplaceTable(element_t * newTable, count_t newTableSize); // Utility function to delete old table (as returned by code:ReplaceTable). - // Phase 3 of code:Reallocate - it is split to support code:AddPhases. + // Phase 3 of code:Reallocate void DeleteOldTable(element_t * oldTable); // Utility function that does not call code:CheckGrowth. @@ -502,92 +497,6 @@ class EMPTY_BASES_DECL SHash : public TRAITS } }; - // Wrapper and holder for adding an element to the hash table. Useful for Add operations that have to happen - // under a rare lock that does not allow call out into host. - // There are 3 phases: - // 1. code:PreallocateForAdd ... Can allocate memory (calls into host). - // 2. code:Add ... Adds one element (does NOT call into host). - // or code:AddNothing_PublishPreallocatedTable ... Publishes the pre-allocated memory from step #1 (if any). - // 3. code:DeleteOldTable (or destructor) ... Can delete the old memory (calls into host). - // Example: - // CrstHolder lockAdd(&crstLockForAdd); // Serialize all Add operations. - // HostAssemblyMap::AddPhases addCall; - // addCall.PreallocateForAdd(&shash); // 1. Allocates memory for one Add call (if needed). addCall serves as holder for the allocated memory. - // { - // // We cannot call out into host from ForbidSuspend region (i.e. no allocations/deallocations). - // ForbidSuspendThreadHolder suspend; // Required by the 'special' read-lock - // { - // CrstHolder lock(&crstLock); - // if (some_condition) - // { // 2a. Add item. This may replace SHash inner table with the one pre-allocated in step 1. - // addCall.Add(shashItem); - // } - // else - // { // 2b. Skip adding item. This may replace SHash inner table with the one pre-allocated in step 1. - // addCall.AddNothing_PublishPreallocatedTable(); - // } - // } - // } - // addCall.DeleteOldTable(); // 3. Cleanup old table memory from shash (if it was replaced by pre-allocated table in step 2). - // // Note: addCall destructor would take care of deleting the memory as well. - class AddPhases - { - public: - AddPhases(); - ~AddPhases(); - - // Prepares object for one call to code:Add. Pre-allocates new table memory if needed, does not publish - // the table yet (it is kept ready only in this holder for call to code:Add). - // Calls out into host. - void PreallocateForAdd(SHash * pHash); - - // Add an element to the hash table. This will never replace an element; multiple elements may be stored - // with the same key. - // Will use/publish pre-allocated memory from code:PreallocateForAdd. - // Does not call out into host. - // Only one Add* method can be called once per object! (Create a new object for each call) - void Add(const element_t & element); - - // Element will not be added to the hash table. - // Will use/publish pre-allocated memory from code:PreallocateForAdd. - // Does not call out into host. - // Only one Add* method can be called once per object! (Create a new object for each call) - void AddNothing_PublishPreallocatedTable(); - - // Deletes old table if it was replaced by call to code:Add or code:AddNothing_PublishPreallocatedTable. - // Calls out into host. - void DeleteOldTable(); - - private: - SHash * m_pHash; - element_t * m_newTable; - count_t m_newTableSize; - element_t * m_oldTable; - - #ifdef _DEBUG - PTR_element_t dbg_m_table; - count_t dbg_m_tableSize; - count_t dbg_m_tableCount; - count_t dbg_m_tableOccupied; - count_t dbg_m_tableMax; - BOOL dbg_m_fAddCalled; - #endif //_DEBUG - }; // class SHash::AddPhases - - // Adds an entry to the hash table according to the guidelines above for - // avoiding a callout to the host while the read lock is held. - // Returns true if elem was added to the map, otherwise false. - // When elem was not added (false is returned), and if ppStoredElem is non-null, - // then it is set to point to the value in the map. - template - bool CheckAddInPhases( - element_t const & elem, - LockT & lock, - AddLockT & addLock, - IUnknown * addRefObject = nullptr); private: diff --git a/src/coreclr/inc/shash.inl b/src/coreclr/inc/shash.inl index ef4e79ed4cf393..d5c2bd41d781e7 100644 --- a/src/coreclr/inc/shash.inl +++ b/src/coreclr/inc/shash.inl @@ -374,26 +374,6 @@ BOOL SHash::CheckGrowthNoThrow() RETURN result; } -template -typename SHash::element_t * -SHash::CheckGrowth_OnlyAllocateNewTable(count_t * pcNewSize) -{ - CONTRACT(element_t *) - { - THROWS; - GC_NOTRIGGER; - INSTANCE_CHECK; - } - CONTRACT_END; - - if (m_tableOccupied == m_tableMax) - { - RETURN Grow_OnlyAllocateNewTable(pcNewSize); - } - - RETURN NULL; -} - template void SHash::Grow() { @@ -898,202 +878,6 @@ COUNT_T SHash::NextPrime(COUNT_T number) ThrowOutOfMemory(); } -template -SHash::AddPhases::AddPhases() -{ - LIMITED_METHOD_CONTRACT; - - m_pHash = NULL; - m_newTable = NULL; - m_newTableSize = 0; - m_oldTable = NULL; - - INDEBUG(dbg_m_fAddCalled = FALSE;) -} - -template -SHash::AddPhases::~AddPhases() -{ - LIMITED_METHOD_CONTRACT; - - if (m_newTable != NULL) - { // The new table was not applied to the hash yet - _ASSERTE((m_pHash != NULL) && (m_newTableSize != 0) && (m_oldTable == NULL)); - - delete [] m_newTable; - } - DeleteOldTable(); -} - -template -void SHash::AddPhases::PreallocateForAdd(SHash * pHash) -{ - CONTRACT_VOID - { - THROWS; - GC_NOTRIGGER; - } - CONTRACT_END; - - _ASSERTE((m_pHash == NULL) && (m_newTable == NULL) && (m_newTableSize == 0) && (m_oldTable == NULL)); - - m_pHash = pHash; - // May return NULL if the allocation was not needed - m_newTable = m_pHash->CheckGrowth_OnlyAllocateNewTable(&m_newTableSize); - -#ifdef _DEBUG - dbg_m_table = pHash->m_table; - dbg_m_tableSize = pHash->m_tableSize; - dbg_m_tableCount = pHash->m_tableCount; - dbg_m_tableOccupied = pHash->m_tableOccupied; - dbg_m_tableMax = pHash->m_tableMax; -#endif //_DEBUG - - RETURN; -} - -template -void SHash::AddPhases::Add(const element_t & element) -{ - CONTRACT_VOID - { - NOTHROW_UNLESS_TRAITS_THROWS; - GC_NOTRIGGER; - } - CONTRACT_END; - - _ASSERTE((m_pHash != NULL) && (m_oldTable == NULL)); - // Add can be called only once on this object - _ASSERTE(!dbg_m_fAddCalled); - - // Check that the hash table didn't change since call to code:PreallocateForAdd - _ASSERTE(dbg_m_table == m_pHash->m_table); - _ASSERTE(dbg_m_tableSize == m_pHash->m_tableSize); - _ASSERTE(dbg_m_tableCount >= m_pHash->m_tableCount); // Remove operation might have removed elements - _ASSERTE(dbg_m_tableOccupied == m_pHash->m_tableOccupied); - _ASSERTE(dbg_m_tableMax == m_pHash->m_tableMax); - - if (m_newTable != NULL) - { // We have pre-allocated table from code:PreallocateForAdd, use it. - _ASSERTE(m_newTableSize != 0); - - // May return NULL if there was not table allocated yet - m_oldTable = m_pHash->ReplaceTable(m_newTable, m_newTableSize); - - m_newTable = NULL; - m_newTableSize = 0; - } - // We know that we have enough space, direcly add the element - m_pHash->Add_GrowthChecked(element); - - INDEBUG(dbg_m_fAddCalled = TRUE;) - - RETURN; -} - -template -void SHash::AddPhases::AddNothing_PublishPreallocatedTable() -{ - CONTRACT_VOID - { - NOTHROW_UNLESS_TRAITS_THROWS; - GC_NOTRIGGER; - } - CONTRACT_END; - - _ASSERTE((m_pHash != NULL) && (m_oldTable == NULL)); - // Add can be called only once on this object - _ASSERTE(!dbg_m_fAddCalled); - - // Check that the hash table didn't change since call to code:PreallocateForAdd - _ASSERTE(dbg_m_table == m_pHash->m_table); - _ASSERTE(dbg_m_tableSize == m_pHash->m_tableSize); - _ASSERTE(dbg_m_tableCount >= m_pHash->m_tableCount); // Remove operation might have removed elements - _ASSERTE(dbg_m_tableOccupied == m_pHash->m_tableOccupied); - _ASSERTE(dbg_m_tableMax == m_pHash->m_tableMax); - - if (m_newTable != NULL) - { // We have pre-allocated table from code:PreallocateForAdd, use it. - _ASSERTE(m_newTableSize != 0); - - // May return NULL if there was not table allocated yet - m_oldTable = m_pHash->ReplaceTable(m_newTable, m_newTableSize); - - m_newTable = NULL; - m_newTableSize = 0; - } - - INDEBUG(dbg_m_fAddCalled = TRUE;) - - RETURN; -} - -template -void SHash::AddPhases::DeleteOldTable() -{ - LIMITED_METHOD_CONTRACT; - - if (m_oldTable != NULL) - { - _ASSERTE((m_pHash != NULL) && (m_newTable == NULL) && (m_newTableSize == 0)); - - delete [] m_oldTable; - m_oldTable = NULL; - } -} - -template -template -bool SHash::CheckAddInPhases( - element_t const & elem, - LockT & lock, - AddLockT & addLock, - IUnknown * addRefObject) -{ - CONTRACTL - { - THROWS; - GC_NOTRIGGER; - INSTANCE_CHECK; - } - CONTRACTL_END; - - AddLockHolderT hAddLock(&addLock); - AddPhases addCall; - - // 1. Preallocate one element - addCall.PreallocateForAdd(this); - { - // 2. Take the reader lock. Host callouts now forbidden. - LockHolderT hLock(&lock); - - element_t const * pEntry = LookupPtr(TRAITS::GetKey(elem)); - if (pEntry != nullptr) - { - // 3a. Use the newly allocated table (if any) to avoid later redundant allocation. - addCall.AddNothing_PublishPreallocatedTable(); - return false; - } - else - { - // 3b. Add the element to the hash table. - addCall.Add(elem); - - if (addRefObject != nullptr) - { - clr::SafeAddRef(addRefObject); - } - - return true; - } - } - - // 4. addCall's destructor will take care of any required cleanup. -} - template BOOL MapSHash::Lookup(KEY key, VALUE* pValue) const { diff --git a/src/coreclr/inc/sigparser.h b/src/coreclr/inc/sigparser.h index 9152727aee4585..1e861c4cd3edf8 100644 --- a/src/coreclr/inc/sigparser.h +++ b/src/coreclr/inc/sigparser.h @@ -13,6 +13,7 @@ #include "corhdr.h" #include "corinfo.h" #include "corpriv.h" +#include //--------------------------------------------------------------------------------------- // These macros define how arguments are mapped to the stack in the managed calling convention. @@ -27,7 +28,6 @@ #define STACK_GROWS_UP_ON_ARGS_WALK #endif - //------------------------------------------------------------------------ // Encapsulates how compressed integers and typeref tokens are encoded into // a bytestream. @@ -793,7 +793,7 @@ class CorTypeInfo } CONTRACTL_END; - if (type >= (CorElementType)_countof(info)) + if (type >= (CorElementType)ARRAY_SIZE(info)) { ThrowHR(COR_E_BADIMAGEFORMAT); } @@ -803,7 +803,7 @@ class CorTypeInfo { LIMITED_METHOD_DAC_CONTRACT; - if (type >= (CorElementType)_countof(info)) + if (type >= (CorElementType)ARRAY_SIZE(info)) { return info[ELEMENT_TYPE_END]; } @@ -830,7 +830,7 @@ class CorTypeInfo { LIMITED_METHOD_CONTRACT; - for (int i = 0; i < (int)_countof(info); i++) + for (int i = 0; i < (int)ARRAY_SIZE(info); i++) { _ASSERTE(info[i].type == i); } diff --git a/src/coreclr/inc/sstring.h b/src/coreclr/inc/sstring.h index 99a5219239578e..57db682e002707 100644 --- a/src/coreclr/inc/sstring.h +++ b/src/coreclr/inc/sstring.h @@ -22,7 +22,7 @@ // string. // // If you need a direct non-unicode representation, you will have to provide a fresh SString which can -// recieve a conversion operation if necessary. +// receive a conversion operation if necessary. // // The alternate encodings available are: // 1. ASCII - string consisting entirely of ASCII (7 bit) characters. This is the only 1 byte encoding diff --git a/src/coreclr/inc/stdmacros.h b/src/coreclr/inc/stdmacros.h index f2417c7637545a..2d0a0576172aa5 100644 --- a/src/coreclr/inc/stdmacros.h +++ b/src/coreclr/inc/stdmacros.h @@ -331,12 +331,6 @@ inline ULONG RoundUpToPower2(ULONG x) #define UNIQUE_LABEL(a) UNIQUE_LABEL_DEF_X(_unique_label_##a##_, __LINE__) #endif - -#ifndef _countof -#define _countof(_array) (sizeof(_array)/sizeof(_array[0])) -#endif - - // This is temporary. LKG should provide these macros and we should then // remove STRUNCATE and _TRUNCATE from here. diff --git a/src/coreclr/inc/utilcode.h b/src/coreclr/inc/utilcode.h index 77df9dfa94d2a9..bae570f3f43ce3 100644 --- a/src/coreclr/inc/utilcode.h +++ b/src/coreclr/inc/utilcode.h @@ -39,6 +39,8 @@ #include "contract.h" #include "entrypoints.h" +#include + #include "clrnt.h" #include "random.h" @@ -150,17 +152,7 @@ typedef LPSTR LPUTF8; #endif #include // for offsetof - -#ifndef NumItems -// Number of elements in a fixed-size array -#define NumItems(s) (sizeof(s) / sizeof(s[0])) -#endif - -#ifndef StrLen -// Number of characters in a string literal. Excludes terminating NULL. -#define StrLen(str) (NumItems(str) - 1) -#endif - +#include #define IS_DIGIT(ch) (((ch) >= W('0')) && ((ch) <= W('9'))) #define DIGIT_TO_INT(ch) ((ch) - W('0')) @@ -647,8 +639,8 @@ class CCulturedHInstance { if (id != UICULTUREID_DONTCARE) { - wcsncpy_s(m_LangId, NumItems(m_LangId), id, NumItems(m_LangId)); - m_LangId[NumItems(m_LangId)-1] = W('\0'); + wcsncpy_s(m_LangId, ARRAY_SIZE(m_LangId), id, ARRAY_SIZE(m_LangId)); + m_LangId[STRING_LENGTH(m_LangId)] = W('\0'); } else { diff --git a/src/coreclr/interop/comwrappers.cpp b/src/coreclr/interop/comwrappers.cpp index aad3d6fa235913..f07786e580c0c9 100644 --- a/src/coreclr/interop/comwrappers.cpp +++ b/src/coreclr/interop/comwrappers.cpp @@ -4,6 +4,7 @@ #include "comwrappers.hpp" #include #include +#include #ifdef _WIN32 #include // placement new @@ -398,8 +399,8 @@ HRESULT ManagedObjectWrapper::Create( curr.IID = IID_IReferenceTrackerTarget; curr.Vtable = &ManagedObjectWrapper_IReferenceTrackerTargetImpl; } - - _ASSERTE(runtimeDefinedCount <= (int) ARRAYSIZE(runtimeDefinedLocal)); + + _ASSERTE(runtimeDefinedCount <= (int) ARRAY_SIZE(runtimeDefinedLocal)); // Compute size for ManagedObjectWrapper instance. const size_t totalRuntimeDefinedSize = runtimeDefinedCount * sizeof(ABI::ComInterfaceEntry); @@ -438,7 +439,7 @@ HRESULT ManagedObjectWrapper::Create( { userDefined, userDefinedCount } }; - ABI::ComInterfaceDispatch* dispSection = ABI::PopulateDispatchSection(wrapperMem, dispatchSectionOffset, ARRAYSIZE(AllEntries), AllEntries); + ABI::ComInterfaceDispatch* dispSection = ABI::PopulateDispatchSection(wrapperMem, dispatchSectionOffset, ARRAY_SIZE(AllEntries), AllEntries); ManagedObjectWrapper* wrapper = new (wrapperMem) ManagedObjectWrapper { diff --git a/src/coreclr/interop/platform.h b/src/coreclr/interop/platform.h index 351b5ebf6ec486..64bfd76d352a66 100644 --- a/src/coreclr/interop/platform.h +++ b/src/coreclr/interop/platform.h @@ -16,10 +16,6 @@ #include #endif // _WIN32 -#ifndef ARRAYSIZE -#define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0])) -#endif // !ARRAYSIZE - #if defined(_WIN32) || defined(HOST_UNIX) #include // COM interfaces diff --git a/src/coreclr/jit/CMakeLists.txt b/src/coreclr/jit/CMakeLists.txt index e468b3a59c7c75..c46cdd18a164ee 100644 --- a/src/coreclr/jit/CMakeLists.txt +++ b/src/coreclr/jit/CMakeLists.txt @@ -28,14 +28,19 @@ function(create_standalone_jit) if(TARGETDETAILS_ARCH STREQUAL "x64") set(JIT_ARCH_SOURCES ${JIT_AMD64_SOURCES}) + set(JIT_ARCH_HEADERS ${JIT_AMD64_HEADERS}) elseif((TARGETDETAILS_ARCH STREQUAL "arm") OR (TARGETDETAILS_ARCH STREQUAL "armel")) set(JIT_ARCH_SOURCES ${JIT_ARM_SOURCES}) + set(JIT_ARCH_HEADERS ${JIT_ARM_HEADERS}) elseif(TARGETDETAILS_ARCH STREQUAL "x86") set(JIT_ARCH_SOURCES ${JIT_I386_SOURCES}) + set(JIT_ARCH_HEADERS ${JIT_I386_HEADERS}) elseif(TARGETDETAILS_ARCH STREQUAL "arm64") set(JIT_ARCH_SOURCES ${JIT_ARM64_SOURCES}) + set(JIT_ARCH_HEADERS ${JIT_ARM64_HEADERS}) elseif(TARGETDETAILS_ARCH STREQUAL "s390x") set(JIT_ARCH_SOURCES ${JIT_S390X_SOURCES}) + set(JIT_ARCH_HEADERS ${JIT_S390X_HEADERS}) else() clr_unknown_arch() endif() @@ -80,6 +85,7 @@ set( JIT_SOURCES codegenlinear.cpp compiler.cpp copyprop.cpp + debuginfo.cpp disasm.cpp earlyprop.cpp ee_il_dll.cpp @@ -149,144 +155,10 @@ set( JIT_SOURCES valuenum.cpp ) -# Add header files to Visual Studio vcxproj, not required for unixes -# change has effect on editor experience and has no impact on build if (CLR_CMAKE_TARGET_WIN32) - set( JIT_HEADERS - ../inc/corinfo.h - ../inc/corjit.h - ../inc/corjitflags.h - ../inc/corjithost.h - _typeinfo.h - alloc.h - arraystack.h - bitset.h - layout.h - bitsetasshortlong.h - bitsetasuint64.h - bitsetasuint64inclass.h - bitsetops.h - bitvec.h - block.h - blockset.h - codegen.h - codegeninterface.h - compiler.h - compiler.hpp - compilerbitsettraits.h - compilerbitsettraits.hpp - compmemkind.h - compphases.h - dataflow.h - decomposelongs.h - disasm.h - emit.h - emitdef.h - emitfmts.h - emitinl.h - emitjmps.h - emitpub.h - error.h - gentree.h - gtlist.h - gtstructs.h - hashbv.h - host.h - hostallocator.h - hwintrinsic.h - ICorJitInfo_API_names.h - ICorJitInfo_API_wrapper.hpp - inline.h - inlinepolicy.h - instr.h - instrs.h - jit.h - jitconfig.h - jitconfigvalues.h - jitee.h - jiteh.h - jitexpandarray.h - jitgcinfo.h - jithashtable.h - jitpch.h - jitstd.h - jittelemetry.h - lir.h - loopcloning.h - loopcloningopts.h - lower.h - lsra_reftypes.h - lsra_stats.h - lsra_score.h - lsra.h - namedintrinsiclist.h - objectalloc.h - opcode.h - phase.h - rangecheck.h - rationalize.h - regalloc.h - register_arg_convention.h - register.h - reglist.h - regset.h - sideeffects.h - simd.h - simdashwintrinsic.h - simdintrinsiclist.h - sm.h - smallhash.h - smcommon.h - smopenum.h - ssabuilder.h - ssaconfig.h - ssarenamestate.h - stacklevelsetter.h - target.h - targetx86.h - targetamd64.h - targetarm.h - targetarm64.h - tinyarray.h - titypes.h - treelifeupdater.h - typelist.h - unwind.h - utils.h - valuenum.h - valuenumfuncs.h - valuenumtype.h - varset.h - vartype.h - vartypesdef.h - ) - # Append clrjit.natvis file list (APPEND JIT_SOURCES clrjit.natvis) - - if (CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_ARM) - list (APPEND JIT_HEADERS - emitarm.h - emitarm64.h - emitfmtsarm.h - emitfmtsarm64.h - hwintrinsic.h - hwintrinsiclistarm64.h - instrsarm.h - instrsarm64.h - registerarm.h - registerarm64.h - simdashwintrinsiclistarm64.h) - elseif (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386) - list (APPEND JIT_HEADERS - emitfmtsxarch.h - emitxarch.h - hwintrinsiclistxarch.h - hwintrinsic.h - instrsxarch.h - simdashwintrinsiclistxarch.h) - endif () endif(CLR_CMAKE_TARGET_WIN32) # Define all the architecture-specific source files @@ -352,35 +224,184 @@ set( JIT_S390X_SOURCES # Not supported as JIT target ) +# We include the headers here for better experience in IDEs. +set( JIT_HEADERS + ../inc/corinfo.h + ../inc/corjit.h + ../inc/corjitflags.h + ../inc/corjithost.h + _typeinfo.h + alloc.h + arraystack.h + bitset.h + layout.h + bitsetasshortlong.h + bitsetasuint64.h + bitsetasuint64inclass.h + bitsetops.h + bitvec.h + block.h + blockset.h + codegen.h + codegeninterface.h + compiler.h + compiler.hpp + compilerbitsettraits.h + compilerbitsettraits.hpp + compmemkind.h + compphases.h + dataflow.h + debuginfo.h + decomposelongs.h + disasm.h + emit.h + emitdef.h + emitfmts.h + emitinl.h + emitjmps.h + emitpub.h + error.h + gentree.h + gtlist.h + gtstructs.h + hashbv.h + host.h + hostallocator.h + hwintrinsic.h + ICorJitInfo_API_names.h + ICorJitInfo_API_wrapper.hpp + inline.h + inlinepolicy.h + instr.h + instrs.h + jit.h + jitconfig.h + jitconfigvalues.h + jitee.h + jiteh.h + jitexpandarray.h + jitgcinfo.h + jithashtable.h + jitpch.h + jitstd.h + jittelemetry.h + lir.h + loopcloning.h + loopcloningopts.h + lower.h + lsra_reftypes.h + lsra_stats.h + lsra_score.h + lsra.h + namedintrinsiclist.h + objectalloc.h + opcode.h + phase.h + rangecheck.h + rationalize.h + regalloc.h + register_arg_convention.h + register.h + regset.h + sideeffects.h + simd.h + simdashwintrinsic.h + simdintrinsiclist.h + sm.h + smallhash.h + smcommon.h + smopenum.h + ssabuilder.h + ssaconfig.h + ssarenamestate.h + stacklevelsetter.h + target.h + targetx86.h + targetamd64.h + targetarm.h + targetarm64.h + tinyarray.h + titypes.h + treelifeupdater.h + typelist.h + unwind.h + utils.h + valuenum.h + valuenumfuncs.h + valuenumtype.h + varset.h + vartype.h + vartypesdef.h +) + +# Arch specific headers +set( JIT_AMD64_HEADERS + emitfmtsxarch.h + emitxarch.h + hwintrinsiclistxarch.h + hwintrinsic.h + instrsxarch.h + simdashwintrinsiclistxarch.h +) + +set( JIT_I386_HEADERS ${JIT_AMD64_HEADERS} ) + +set( JIT_ARM64_HEADERS + emitarm64.h + emitfmtsarm64.h + hwintrinsiclistarm64.h + instrsarm64.h + registerarm64.h + simdashwintrinsiclistarm64.h +) + +set( JIT_ARM_HEADERS + emitarm.h + emitfmtsarm.h + instrsarm.h + registerarm.h +) + +set ( JIT_S390X_HEADERS + # Not supported as JIT target +) + +convert_to_absolute_path(JIT_SOURCES ${JIT_SOURCES}) +convert_to_absolute_path(JIT_HEADERS ${JIT_HEADERS}) +convert_to_absolute_path(JIT_RESOURCES ${JIT_RESOURCES}) + +# Also convert the per-architecture sources to absolute paths, if the subdirs want to use them. + +convert_to_absolute_path(JIT_AMD64_SOURCES ${JIT_AMD64_SOURCES}) +convert_to_absolute_path(JIT_AMD64_HEADERS ${JIT_AMD64_HEADERS}) +convert_to_absolute_path(JIT_ARM_SOURCES ${JIT_ARM_SOURCES}) +convert_to_absolute_path(JIT_ARM_HEADERS ${JIT_ARM_HEADERS}) +convert_to_absolute_path(JIT_I386_SOURCES ${JIT_I386_SOURCES}) +convert_to_absolute_path(JIT_I386_HEADERS ${JIT_I386_HEADERS}) +convert_to_absolute_path(JIT_ARM64_SOURCES ${JIT_ARM64_SOURCES}) +convert_to_absolute_path(JIT_ARM64_HEADERS ${JIT_ARM64_HEADERS}) +convert_to_absolute_path(JIT_S390X_SOURCES ${JIT_S390X_SOURCES}) +convert_to_absolute_path(JIT_S390X_HEADERS ${JIT_S390X_HEADERS}) + if(CLR_CMAKE_TARGET_ARCH_AMD64) set(JIT_ARCH_SOURCES ${JIT_AMD64_SOURCES}) + set(JIT_ARCH_HEADERS ${JIT_AMD64_HEADERS}) elseif(CLR_CMAKE_TARGET_ARCH_ARM) set(JIT_ARCH_SOURCES ${JIT_ARM_SOURCES}) + set(JIT_ARCH_HEADERS ${JIT_ARM_HEADERS}) elseif(CLR_CMAKE_TARGET_ARCH_I386) set(JIT_ARCH_SOURCES ${JIT_I386_SOURCES}) + set(JIT_ARCH_HEADERS ${JIT_I386_HEADERS}) elseif(CLR_CMAKE_TARGET_ARCH_ARM64) set(JIT_ARCH_SOURCES ${JIT_ARM64_SOURCES}) + set(JIT_ARCH_HEADERS ${JIT_ARM64_HEADERS}) elseif(CLR_CMAKE_TARGET_ARCH_S390X) set(JIT_ARCH_SOURCES ${JIT_S390X_SOURCES}) + set(JIT_ARCH_HEADERS ${JIT_S390X_HEADERS}) else() clr_unknown_arch() endif() -set(JIT_CORE_SOURCES - ${JIT_SOURCES} - ${JIT_HEADERS} -) - -convert_to_absolute_path(JIT_CORE_SOURCES ${JIT_CORE_SOURCES}) -convert_to_absolute_path(JIT_ARCH_SOURCES ${JIT_ARCH_SOURCES}) -convert_to_absolute_path(JIT_RESOURCES ${JIT_RESOURCES}) - -# Also convert the per-architecture sources to absolute paths, if the subdirs want to use them. - -convert_to_absolute_path(JIT_AMD64_SOURCES ${JIT_AMD64_SOURCES}) -convert_to_absolute_path(JIT_ARM_SOURCES ${JIT_ARM_SOURCES}) -convert_to_absolute_path(JIT_I386_SOURCES ${JIT_I386_SOURCES}) -convert_to_absolute_path(JIT_ARM64_SOURCES ${JIT_ARM64_SOURCES}) set(JIT_DLL_MAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/dllmain.cpp) @@ -445,14 +466,29 @@ function(add_jit jitName) set_source_files_properties(${JIT_EXPORTS_FILE} PROPERTIES GENERATED TRUE) - add_library_clr(${jitName} - SHARED - ${JIT_CORE_SOURCES} - ${JIT_RESOURCES} - ${JIT_ARCH_SOURCES} - ${JIT_DEF_FILE} - ${JIT_DLL_MAIN_FILE} - ) + if (CLR_CMAKE_TARGET_WIN32) + # If generating for Visual Studio then include headers for a better + # IDE experience. + add_library_clr(${jitName} + SHARED + ${JIT_SOURCES} + ${JIT_ARCH_SOURCES} + ${JIT_HEADERS} + ${JIT_ARCH_HEADERS} + ${JIT_RESOURCES} + ${JIT_DEF_FILE} + ${JIT_DLL_MAIN_FILE} + ) + else() + add_library_clr(${jitName} + SHARED + ${JIT_SOURCES} + ${JIT_ARCH_SOURCES} + ${JIT_RESOURCES} + ${JIT_DEF_FILE} + ${JIT_DLL_MAIN_FILE} + ) + endif(CLR_CMAKE_TARGET_WIN32) if(CLR_CMAKE_TARGET_WIN32) target_compile_definitions(${jitName} PRIVATE FX_VER_INTERNALNAME_STR=${jitName}.dll) diff --git a/src/coreclr/jit/ICorJitInfo_API_names.h b/src/coreclr/jit/ICorJitInfo_API_names.h index 39e74fc1949f10..64e8db858b9440 100644 --- a/src/coreclr/jit/ICorJitInfo_API_names.h +++ b/src/coreclr/jit/ICorJitInfo_API_names.h @@ -49,7 +49,6 @@ DEF_CLR_API(appendClassName) DEF_CLR_API(isValueClass) DEF_CLR_API(canInlineTypeCheck) DEF_CLR_API(getClassAttribs) -DEF_CLR_API(isStructRequiringStackAllocRetBuf) DEF_CLR_API(getClassModule) DEF_CLR_API(getModuleAssembly) DEF_CLR_API(getAssemblyName) diff --git a/src/coreclr/jit/ICorJitInfo_API_wrapper.hpp b/src/coreclr/jit/ICorJitInfo_API_wrapper.hpp index 0fade44a4fef39..9f51c43b765ee0 100644 --- a/src/coreclr/jit/ICorJitInfo_API_wrapper.hpp +++ b/src/coreclr/jit/ICorJitInfo_API_wrapper.hpp @@ -455,15 +455,6 @@ uint32_t WrapICorJitInfo::getClassAttribs( return temp; } -bool WrapICorJitInfo::isStructRequiringStackAllocRetBuf( - CORINFO_CLASS_HANDLE cls) -{ - API_ENTER(isStructRequiringStackAllocRetBuf); - bool temp = wrapHnd->isStructRequiringStackAllocRetBuf(cls); - API_LEAVE(isStructRequiringStackAllocRetBuf); - return temp; -} - CORINFO_MODULE_HANDLE WrapICorJitInfo::getClassModule( CORINFO_CLASS_HANDLE cls) { diff --git a/src/coreclr/jit/assertionprop.cpp b/src/coreclr/jit/assertionprop.cpp index 2c286ab4bcc850..1ae2176674a7d8 100644 --- a/src/coreclr/jit/assertionprop.cpp +++ b/src/coreclr/jit/assertionprop.cpp @@ -660,12 +660,11 @@ void Compiler::optAddCopies() Statement* stmt; unsigned copyLclNum = lvaGrabTemp(false DEBUGARG("optAddCopies")); - // Because lvaGrabTemp may have reallocated the lvaTable, ensure varDsc - // is still in sync with lvaTable[lclNum]; - varDsc = &lvaTable[lclNum]; + // Because lvaGrabTemp may have reallocated the lvaTable, ensure varDsc is still in sync. + varDsc = lvaGetDesc(lclNum); // Set lvType on the new Temp Lcl Var - lvaTable[copyLclNum].lvType = typ; + lvaGetDesc(copyLclNum)->lvType = typ; #ifdef DEBUG if (verbose) @@ -909,7 +908,7 @@ void Compiler::optAssertionInit(bool isLocalProp) // Note this tracks at most only 256 assertions. static const AssertionIndex countFunc[] = {64, 128, 256, 64}; static const unsigned lowerBound = 0; - static const unsigned upperBound = _countof(countFunc) - 1; + static const unsigned upperBound = ArrLen(countFunc) - 1; const unsigned codeSize = info.compILCodeSize / 512; optMaxAssertionCount = countFunc[isLocalProp ? lowerBound : min(upperBound, codeSize)]; @@ -1103,9 +1102,7 @@ void Compiler::optPrintAssertion(AssertionDsc* curAssertion, AssertionIndex asse else { unsigned lclNum = curAssertion->op1.lcl.lclNum; - assert(lclNum < lvaCount); - LclVarDsc* varDsc = lvaTable + lclNum; - op1Type = varDsc->lvType; + op1Type = lvaGetDesc(lclNum)->lvType; } if (op1Type == TYP_REF) @@ -1258,8 +1255,7 @@ AssertionIndex Compiler::optCreateAssertion(GenTree* op1, optAssertionKind assertionKind, bool helperCallArgs) { - assert((op1 != nullptr) && !op1->OperIs(GT_LIST)); - assert((op2 == nullptr) || !op2->OperIs(GT_LIST)); + assert(op1 != nullptr); assert(!helperCallArgs || (op2 != nullptr)); AssertionDsc assertion = {OAK_INVALID}; @@ -1316,9 +1312,8 @@ AssertionIndex Compiler::optCreateAssertion(GenTree* op1, goto DONE_ASSERTION; // Don't make an assertion } - unsigned lclNum = op1->AsLclVarCommon()->GetLclNum(); - noway_assert(lclNum < lvaCount); - LclVarDsc* lclVar = &lvaTable[lclNum]; + unsigned lclNum = op1->AsLclVarCommon()->GetLclNum(); + LclVarDsc* lclVar = lvaGetDesc(lclNum); ValueNum vn; @@ -1395,9 +1390,8 @@ AssertionIndex Compiler::optCreateAssertion(GenTree* op1, // else if (op1->gtOper == GT_LCL_VAR) { - unsigned lclNum = op1->AsLclVarCommon()->GetLclNum(); - noway_assert(lclNum < lvaCount); - LclVarDsc* lclVar = &lvaTable[lclNum]; + unsigned lclNum = op1->AsLclVarCommon()->GetLclNum(); + LclVarDsc* lclVar = lvaGetDesc(lclNum); // If the local variable has its address exposed then bail if (lclVar->IsAddressExposed()) @@ -1560,9 +1554,8 @@ AssertionIndex Compiler::optCreateAssertion(GenTree* op1, goto DONE_ASSERTION; // Don't make an assertion } - unsigned lclNum2 = op2->AsLclVarCommon()->GetLclNum(); - noway_assert(lclNum2 < lvaCount); - LclVarDsc* lclVar2 = &lvaTable[lclNum2]; + unsigned lclNum2 = op2->AsLclVarCommon()->GetLclNum(); + LclVarDsc* lclVar2 = lvaGetDesc(lclNum2); // If the two locals are the same then bail if (lclNum == lclNum2) @@ -1633,7 +1626,6 @@ AssertionIndex Compiler::optCreateAssertion(GenTree* op1, if (op1->gtOper == GT_LCL_VAR) { unsigned lclNum = op1->AsLclVarCommon()->GetLclNum(); - noway_assert(lclNum < lvaCount); // If the local variable is not in SSA then bail if (!lvaInSsa(lclNum)) @@ -1657,7 +1649,7 @@ AssertionIndex Compiler::optCreateAssertion(GenTree* op1, assert((assertion.op1.lcl.ssaNum == SsaConfig::RESERVED_SSA_NUM) || (assertion.op1.vn == vnStore->VNConservativeNormalValue( - lvaTable[lclNum].GetPerSsaData(assertion.op1.lcl.ssaNum)->m_vnPair))); + lvaGetDesc(lclNum)->GetPerSsaData(assertion.op1.lcl.ssaNum)->m_vnPair))); ssize_t cnsValue = 0; GenTreeFlags iconFlags = GTF_EMPTY; @@ -1972,9 +1964,8 @@ void Compiler::optDebugCheckAssertion(AssertionDsc* assertion) case O1K_LCLVAR: case O1K_EXACT_TYPE: case O1K_SUBTYPE: - assert(assertion->op1.lcl.lclNum < lvaCount); assert(optLocalAssertionProp || - lvaTable[assertion->op1.lcl.lclNum].lvPerSsaData.IsValidSsaNum(assertion->op1.lcl.ssaNum)); + lvaGetDesc(assertion->op1.lcl.lclNum)->lvPerSsaData.IsValidSsaNum(assertion->op1.lcl.ssaNum)); break; case O1K_ARR_BND: // It would be good to check that bnd.vnIdx and bnd.vnLen are valid value numbers. @@ -2007,7 +1998,7 @@ void Compiler::optDebugCheckAssertion(AssertionDsc* assertion) assert(assertion->op2.u1.iconFlags != GTF_EMPTY); break; case O1K_LCLVAR: - assert((lvaTable[assertion->op1.lcl.lclNum].lvType != TYP_REF) || + assert((lvaGetDesc(assertion->op1.lcl.lclNum)->lvType != TYP_REF) || (assertion->op2.u1.iconVal == 0) || doesMethodHaveFrozenString()); break; case O1K_VALUE_NUMBER: @@ -5605,8 +5596,9 @@ Compiler::fgWalkResult Compiler::optVNConstantPropCurStmt(BasicBlock* block, Sta break; case GT_LCL_VAR: + case GT_LCL_FLD: // Make sure the local variable is an R-value. - if ((tree->gtFlags & (GTF_VAR_DEF | GTF_DONT_CSE))) + if ((tree->gtFlags & (GTF_VAR_USEASG | GTF_VAR_DEF | GTF_DONT_CSE)) != GTF_EMPTY) { return WALK_CONTINUE; } diff --git a/src/coreclr/jit/bitsetasshortlong.h b/src/coreclr/jit/bitsetasshortlong.h index d343edeeda4cd2..365cf346a10ac2 100644 --- a/src/coreclr/jit/bitsetasshortlong.h +++ b/src/coreclr/jit/bitsetasshortlong.h @@ -345,7 +345,7 @@ class BitSetOpsStatements()) { - auto newExpr = compiler->gtCloneExpr(fromStmt->GetRootNode(), GTF_EMPTY, varNum, varVal); + GenTree* newExpr = compiler->gtCloneExpr(fromStmt->GetRootNode(), GTF_EMPTY, varNum, varVal); if (!newExpr) { // gtCloneExpr doesn't handle all opcodes, so may fail to clone a statement. @@ -782,7 +782,7 @@ bool BasicBlock::CloneBlockState( // return `false` to the caller to indicate that cloning was unsuccessful. return false; } - compiler->fgInsertStmtAtEnd(to, compiler->fgNewStmtFromTree(newExpr)); + compiler->fgInsertStmtAtEnd(to, compiler->fgNewStmtFromTree(newExpr, fromStmt->GetDebugInfo())); } return true; } @@ -841,14 +841,6 @@ Statement* BasicBlock::lastStmt() const return result; } -//------------------------------------------------------------------------ -// BasicBlock::firstNode: Returns the first node in the block. -// -GenTree* BasicBlock::firstNode() const -{ - return IsLIR() ? GetFirstLIRNode() : Compiler::fgGetFirstNode(firstStmt()->GetRootNode()); -} - //------------------------------------------------------------------------ // BasicBlock::lastNode: Returns the last node in the block. // @@ -1662,3 +1654,22 @@ BBswtDesc::BBswtDesc(Compiler* comp, const BBswtDesc* other) bbsDstTab[i] = other->bbsDstTab[i]; } } + +//------------------------------------------------------------------------ +// unmarkLoopAlign: Unmarks the LOOP_ALIGN flag from the block and reduce the +// loop alignment count. +// +// Arguments: +// compiler - Compiler instance +// reason - Reason to print in JITDUMP +// +void BasicBlock::unmarkLoopAlign(Compiler* compiler DEBUG_ARG(const char* reason)) +{ + // Make sure we unmark and count just once. + if (isLoopAlign()) + { + compiler->loopAlignCandidates--; + bbFlags &= ~BBF_LOOP_ALIGN; + JITDUMP("Unmarking LOOP_ALIGN from " FMT_BB ". Reason= %s.\n", bbNum, reason); + } +} diff --git a/src/coreclr/jit/block.h b/src/coreclr/jit/block.h index ec7918d4aac953..2a90e55ab8ddcf 100644 --- a/src/coreclr/jit/block.h +++ b/src/coreclr/jit/block.h @@ -552,6 +552,7 @@ enum BasicBlockFlags : unsigned __int64 BBF_PATCHPOINT = MAKE_BBFLAG(36), // Block is a patchpoint BBF_HAS_CLASS_PROFILE = MAKE_BBFLAG(37), // BB contains a call needing a class profile BBF_PARTIAL_COMPILATION_PATCHPOINT = MAKE_BBFLAG(38), // Block is a partial compilation patchpoint + BBF_HAS_ALIGN = MAKE_BBFLAG(39), // BB ends with 'align' instruction // The following are sets of flags. @@ -653,11 +654,19 @@ struct BasicBlock : private LIR::Range { return ((bbFlags & BBF_LOOP_HEAD) != 0); } + bool isLoopAlign() const { return ((bbFlags & BBF_LOOP_ALIGN) != 0); } + void unmarkLoopAlign(Compiler* comp DEBUG_ARG(const char* reason)); + + bool hasAlign() const + { + return ((bbFlags & BBF_HAS_ALIGN) != 0); + } + #ifdef DEBUG void dspFlags(); // Print the flags unsigned dspCheapPreds(); // Print the predecessors (bbCheapPreds) @@ -1239,7 +1248,6 @@ struct BasicBlock : private LIR::Range return StatementList(FirstNonPhiDef()); } - GenTree* firstNode() const; GenTree* lastNode() const; bool endsWithJmpMethod(Compiler* comp) const; diff --git a/src/coreclr/jit/codegen.h b/src/coreclr/jit/codegen.h index c6b789f86f3cb2..6161feb05ef33d 100644 --- a/src/coreclr/jit/codegen.h +++ b/src/coreclr/jit/codegen.h @@ -434,10 +434,10 @@ class CodeGen final : public CodeGenInterface CORINFO_METHOD_HANDLE methHnd, INDEBUG_LDISASM_COMMA(CORINFO_SIG_INFO* sigInfo) void* addr - X86_ARG(int argSize), + X86_ARG(int argSize), emitAttr retSize MULTIREG_HAS_SECOND_GC_RET_ONLY_ARG(emitAttr secondRetSize), - IL_OFFSETX ilOffset, + const DebugInfo& di, regNumber base, bool isJump); // clang-format on @@ -447,10 +447,10 @@ class CodeGen final : public CodeGenInterface CORINFO_METHOD_HANDLE methHnd, INDEBUG_LDISASM_COMMA(CORINFO_SIG_INFO* sigInfo) GenTreeIndir* indir - X86_ARG(int argSize), + X86_ARG(int argSize), emitAttr retSize MULTIREG_HAS_SECOND_GC_RET_ONLY_ARG(emitAttr secondRetSize), - IL_OFFSETX ilOffset, + const DebugInfo& di, bool isJump); // clang-format on @@ -552,15 +552,21 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ #ifdef DEBUG - void genIPmappingDisp(unsigned mappingNum, Compiler::IPmappingDsc* ipMapping); + void genIPmappingDisp(unsigned mappingNum, IPmappingDsc* ipMapping); void genIPmappingListDisp(); #endif // DEBUG - void genIPmappingAdd(IL_OFFSETX offset, bool isLabel); - void genIPmappingAddToFront(IL_OFFSETX offset); + void genIPmappingAdd(IPmappingDscKind kind, const DebugInfo& di, bool isLabel); + void genIPmappingAddToFront(IPmappingDscKind kind, const DebugInfo& di, bool isLabel); void genIPmappingGen(); - void genEnsureCodeEmitted(IL_OFFSETX offsx); +#ifdef DEBUG + void genDumpPreciseDebugInfo(); + void genDumpPreciseDebugInfoInlineTree(FILE* file, InlineContext* context, bool* first); + void genAddPreciseIPMappingHere(const DebugInfo& di); +#endif + + void genEnsureCodeEmitted(const DebugInfo& di); //------------------------------------------------------------------------- // scope info for the variables @@ -967,9 +973,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX regNumber targetReg); void genSIMDIntrinsic32BitConvert(GenTreeSIMD* simdNode); void genSIMDIntrinsic64BitConvert(GenTreeSIMD* simdNode); - void genSIMDIntrinsicNarrow(GenTreeSIMD* simdNode); void genSIMDExtractUpperHalf(GenTreeSIMD* simdNode, regNumber srcReg, regNumber tgtReg); - void genSIMDIntrinsicWiden(GenTreeSIMD* simdNode); void genSIMDIntrinsic(GenTreeSIMD* simdNode); // TYP_SIMD12 (i.e Vector3 of size 12 bytes) is not a hardware supported size and requires @@ -1126,9 +1130,9 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX void genConsumeRegs(GenTree* tree); void genConsumeOperands(GenTreeOp* tree); -#ifdef FEATURE_HW_INTRINSICS - void genConsumeHWIntrinsicOperands(GenTreeHWIntrinsic* tree); -#endif // FEATURE_HW_INTRINSICS +#if defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) + void genConsumeMultiOpOperands(GenTreeMultiOp* tree); +#endif void genEmitGSCookieCheck(bool pushReg); void genCodeForShift(GenTree* tree); @@ -1248,6 +1252,8 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX void genCodeForJumpTrue(GenTreeOp* jtrue); #ifdef TARGET_ARM64 void genCodeForJumpCompare(GenTreeOp* tree); + void genCodeForMadd(GenTreeOp* tree); + void genCodeForBfiz(GenTreeOp* tree); #endif // TARGET_ARM64 #if defined(FEATURE_EH_FUNCLETS) @@ -1296,8 +1302,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX { return false; } - const LclVarDsc* varDsc = &compiler->lvaTable[tree->AsLclVarCommon()->GetLclNum()]; - return (varDsc->lvIsRegCandidate()); + return compiler->lvaGetDesc(tree->AsLclVarCommon())->lvIsRegCandidate(); } #ifdef FEATURE_PUT_STRUCT_ARG_STK @@ -1470,7 +1475,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX static const GenConditionDesc& Get(GenCondition condition) { - assert(condition.GetCode() < _countof(map)); + assert(condition.GetCode() < ArrLen(map)); const GenConditionDesc& desc = map[condition.GetCode()]; assert(desc.jumpKind1 != EJ_NONE); assert((desc.oper == GT_NONE) || (desc.oper == GT_AND) || (desc.oper == GT_OR)); diff --git a/src/coreclr/jit/codegenarm.cpp b/src/coreclr/jit/codegenarm.cpp index 23beb66352978d..9dd13cdc125332 100644 --- a/src/coreclr/jit/codegenarm.cpp +++ b/src/coreclr/jit/codegenarm.cpp @@ -313,8 +313,8 @@ void CodeGen::genCodeForBinary(GenTreeOp* treeNode) var_types targetType = treeNode->TypeGet(); emitter* emit = GetEmitter(); - assert(oper == GT_ADD || oper == GT_SUB || oper == GT_MUL || oper == GT_ADD_LO || oper == GT_ADD_HI || - oper == GT_SUB_LO || oper == GT_SUB_HI || oper == GT_OR || oper == GT_XOR || oper == GT_AND); + assert(treeNode->OperIs(GT_ADD, GT_SUB, GT_MUL, GT_ADD_LO, GT_ADD_HI, GT_SUB_LO, GT_SUB_HI, GT_OR, GT_XOR, GT_AND, + GT_AND_NOT)); GenTree* op1 = treeNode->gtGetOp1(); GenTree* op2 = treeNode->gtGetOp2(); @@ -671,6 +671,9 @@ instruction CodeGen::genGetInsForOper(genTreeOps oper, var_types type) case GT_AND: ins = INS_AND; break; + case GT_AND_NOT: + ins = INS_bic; + break; case GT_MUL: ins = INS_MUL; break; @@ -963,7 +966,7 @@ void CodeGen::genCodeForLclVar(GenTreeLclVar* tree) // lcl_vars are not defs assert((tree->gtFlags & GTF_VAR_DEF) == 0); - bool isRegCandidate = compiler->lvaTable[tree->GetLclNum()].lvIsRegCandidate(); + bool isRegCandidate = compiler->lvaGetDesc(tree)->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. @@ -998,9 +1001,8 @@ void CodeGen::genCodeForStoreLclFld(GenTreeLclFld* tree) // We must have a stack store with GT_STORE_LCL_FLD noway_assert(targetReg == REG_NA); - unsigned varNum = tree->GetLclNum(); - assert(varNum < compiler->lvaCount); - LclVarDsc* varDsc = &(compiler->lvaTable[varNum]); + unsigned varNum = tree->GetLclNum(); + LclVarDsc* varDsc = compiler->lvaGetDesc(varNum); // Ensure that lclVar nodes are typed correctly. assert(!varDsc->lvNormalizeOnStore() || targetType == genActualType(varDsc->TypeGet())); @@ -1080,8 +1082,7 @@ void CodeGen::genCodeForStoreLclVar(GenTreeLclVar* tree) } if (regCount == 1) { - unsigned varNum = tree->GetLclNum(); - assert(varNum < compiler->lvaCount); + unsigned varNum = tree->GetLclNum(); LclVarDsc* varDsc = compiler->lvaGetDesc(varNum); var_types targetType = varDsc->GetRegisterType(tree); @@ -1629,8 +1630,7 @@ void CodeGen::genEmitHelperCall(unsigned helper, int argSize, emitAttr retSize, GetEmitter()->emitIns_Call(emitter::EC_INDIR_R, compiler->eeFindHelper(helper), INDEBUG_LDISASM_COMMA(nullptr) NULL, // addr argSize, retSize, gcInfo.gcVarPtrSetCur, gcInfo.gcRegGCrefSetCur, - gcInfo.gcRegByrefSetCur, - BAD_IL_OFFSET, // ilOffset + gcInfo.gcRegByrefSetCur, DebugInfo(), callTargetReg, // ireg REG_NA, 0, 0, // xreg, xmul, disp false // isJump @@ -1640,7 +1640,7 @@ void CodeGen::genEmitHelperCall(unsigned helper, int argSize, emitAttr retSize, { GetEmitter()->emitIns_Call(emitter::EC_FUNC_TOKEN, compiler->eeFindHelper(helper), INDEBUG_LDISASM_COMMA(nullptr) addr, argSize, retSize, gcInfo.gcVarPtrSetCur, - gcInfo.gcRegGCrefSetCur, gcInfo.gcRegByrefSetCur, BAD_IL_OFFSET, REG_NA, REG_NA, 0, + gcInfo.gcRegGCrefSetCur, gcInfo.gcRegByrefSetCur, DebugInfo(), REG_NA, REG_NA, 0, 0, /* ilOffset, ireg, xreg, xmul, disp */ false /* isJump */ ); diff --git a/src/coreclr/jit/codegenarm64.cpp b/src/coreclr/jit/codegenarm64.cpp index d68da1a1e2a9bf..076df275868a36 100644 --- a/src/coreclr/jit/codegenarm64.cpp +++ b/src/coreclr/jit/codegenarm64.cpp @@ -1817,7 +1817,7 @@ void CodeGen::genCodeForMulHi(GenTreeOp* treeNode) genProduceReg(treeNode); } -// Generate code for ADD, SUB, MUL, DIV, UDIV, AND, OR and XOR +// Generate code for ADD, SUB, MUL, DIV, UDIV, AND, AND_NOT, OR and XOR // This method is expected to have called genConsumeOperands() before calling it. void CodeGen::genCodeForBinary(GenTreeOp* treeNode) { @@ -1826,8 +1826,7 @@ void CodeGen::genCodeForBinary(GenTreeOp* treeNode) var_types targetType = treeNode->TypeGet(); emitter* emit = GetEmitter(); - assert(oper == GT_ADD || oper == GT_SUB || oper == GT_MUL || oper == GT_DIV || oper == GT_UDIV || oper == GT_AND || - oper == GT_OR || oper == GT_XOR); + assert(treeNode->OperIs(GT_ADD, GT_SUB, GT_MUL, GT_DIV, GT_UDIV, GT_AND, GT_AND_NOT, GT_OR, GT_XOR)); GenTree* op1 = treeNode->gtGetOp1(); GenTree* op2 = treeNode->gtGetOp2(); @@ -1846,6 +1845,9 @@ void CodeGen::genCodeForBinary(GenTreeOp* treeNode) case GT_AND: ins = INS_ands; break; + case GT_AND_NOT: + ins = INS_bics; + break; default: noway_assert(!"Unexpected BinaryOp with GTF_SET_FLAGS set"); } @@ -1869,8 +1871,7 @@ void CodeGen::genCodeForBinary(GenTreeOp* treeNode) void CodeGen::genCodeForLclVar(GenTreeLclVar* tree) { - unsigned varNum = tree->GetLclNum(); - assert(varNum < compiler->lvaCount); + unsigned varNum = tree->GetLclNum(); LclVarDsc* varDsc = compiler->lvaGetDesc(varNum); var_types targetType = varDsc->GetRegisterType(tree); @@ -1924,9 +1925,8 @@ void CodeGen::genCodeForStoreLclFld(GenTreeLclFld* tree) // We must have a stack store with GT_STORE_LCL_FLD noway_assert(targetReg == REG_NA); - unsigned varNum = tree->GetLclNum(); - assert(varNum < compiler->lvaCount); - LclVarDsc* varDsc = &(compiler->lvaTable[varNum]); + unsigned varNum = tree->GetLclNum(); + LclVarDsc* varDsc = compiler->lvaGetDesc(varNum); // Ensure that lclVar nodes are typed correctly. assert(!varDsc->lvNormalizeOnStore() || targetType == genActualType(varDsc->TypeGet())); @@ -2118,15 +2118,14 @@ void CodeGen::genSimpleReturn(GenTree* treeNode) if (op1->OperGet() == GT_LCL_VAR) { GenTreeLclVarCommon* lcl = op1->AsLclVarCommon(); - bool isRegCandidate = compiler->lvaTable[lcl->GetLclNum()].lvIsRegCandidate(); + const LclVarDsc* varDsc = compiler->lvaGetDesc(lcl); + bool isRegCandidate = varDsc->lvIsRegCandidate(); if (isRegCandidate && ((op1->gtFlags & GTF_SPILLED) == 0)) { // We may need to generate a zero-extending mov instruction to load the value from this GT_LCL_VAR - unsigned lclNum = lcl->GetLclNum(); - LclVarDsc* varDsc = &(compiler->lvaTable[lclNum]); - var_types op1Type = genActualType(op1->TypeGet()); - var_types lclType = genActualType(varDsc->TypeGet()); + var_types op1Type = genActualType(op1->TypeGet()); + var_types lclType = genActualType(varDsc->TypeGet()); if (genTypeSize(op1Type) < genTypeSize(lclType)) { @@ -3081,7 +3080,7 @@ void CodeGen::genCodeForCmpXchg(GenTreeCmpXchg* treeNode) instruction CodeGen::genGetInsForOper(genTreeOps oper, var_types type) { - instruction ins = INS_brk; + instruction ins = INS_BREAKPOINT; if (varTypeIsFloating(type)) { @@ -3119,6 +3118,9 @@ instruction CodeGen::genGetInsForOper(genTreeOps oper, var_types type) case GT_AND: ins = INS_and; break; + case GT_AND_NOT: + ins = INS_bic; + break; case GT_DIV: ins = INS_sdiv; break; @@ -3305,10 +3307,10 @@ void CodeGen::genCodeForSwap(GenTreeOp* tree) assert(genIsRegCandidateLocal(tree->gtOp1) && genIsRegCandidateLocal(tree->gtOp2)); GenTreeLclVarCommon* lcl1 = tree->gtOp1->AsLclVarCommon(); - LclVarDsc* varDsc1 = &(compiler->lvaTable[lcl1->GetLclNum()]); + LclVarDsc* varDsc1 = compiler->lvaGetDesc(lcl1); var_types type1 = varDsc1->TypeGet(); GenTreeLclVarCommon* lcl2 = tree->gtOp2->AsLclVarCommon(); - LclVarDsc* varDsc2 = &(compiler->lvaTable[lcl2->GetLclNum()]); + LclVarDsc* varDsc2 = compiler->lvaGetDesc(lcl2); var_types type2 = varDsc2->TypeGet(); // We must have both int or both fp regs @@ -3566,7 +3568,6 @@ void CodeGen::genCodeForCompare(GenTreeOp* tree) var_types op2Type = genActualType(op2->TypeGet()); assert(!op1->isUsedFromMemory()); - assert(!op2->isUsedFromMemory()); genConsumeOperands(tree); @@ -3580,7 +3581,7 @@ void CodeGen::genCodeForCompare(GenTreeOp* tree) assert(!op1->isContained()); assert(op1Type == op2Type); - if (op2->IsIntegralConst(0)) + if (op2->IsFPZero()) { assert(op2->isContained()); emit->emitIns_R_F(INS_fcmp, cmpSize, op1->GetRegNum(), 0.0); @@ -3841,10 +3842,9 @@ void CodeGen::genEmitHelperCall(unsigned helper, int argSize, emitAttr retSize, GetEmitter()->emitIns_Call(callType, compiler->eeFindHelper(helper), INDEBUG_LDISASM_COMMA(nullptr) addr, argSize, retSize, EA_UNKNOWN, gcInfo.gcVarPtrSetCur, gcInfo.gcRegGCrefSetCur, - gcInfo.gcRegByrefSetCur, BAD_IL_OFFSET, /* IL offset */ - callTarget, /* ireg */ - REG_NA, 0, 0, /* xreg, xmul, disp */ - false /* isJump */ + gcInfo.gcRegByrefSetCur, DebugInfo(), callTarget, /* ireg */ + REG_NA, 0, 0, /* xreg, xmul, disp */ + false /* isJump */ ); regMaskTP killMask = compiler->compHelperCallKillSet((CorInfoHelpFunc)helper); @@ -3876,7 +3876,7 @@ void CodeGen::genSIMDIntrinsic(GenTreeSIMD* simdNode) noway_assert(!"SIMD intrinsic with unsupported base type."); } - switch (simdNode->gtSIMDIntrinsicID) + switch (simdNode->GetSIMDIntrinsicId()) { case SIMDIntrinsicInit: genSIMDIntrinsicInit(simdNode); @@ -3894,15 +3894,6 @@ void CodeGen::genSIMDIntrinsic(GenTreeSIMD* simdNode) genSIMDIntrinsicUnOp(simdNode); break; - case SIMDIntrinsicWidenLo: - case SIMDIntrinsicWidenHi: - genSIMDIntrinsicWiden(simdNode); - break; - - case SIMDIntrinsicNarrow: - genSIMDIntrinsicNarrow(simdNode); - break; - case SIMDIntrinsicSub: case SIMDIntrinsicBitwiseAnd: case SIMDIntrinsicBitwiseOr: @@ -3991,20 +3982,9 @@ instruction CodeGen::getOpForSIMDIntrinsic(SIMDIntrinsicID intrinsicId, var_type case SIMDIntrinsicEqual: result = INS_fcmeq; break; - case SIMDIntrinsicNarrow: - // Use INS_fcvtn lower bytes of result followed by INS_fcvtn2 for upper bytes - // Return lower bytes instruction here - result = INS_fcvtn; - break; case SIMDIntrinsicSub: result = INS_fsub; break; - case SIMDIntrinsicWidenLo: - result = INS_fcvtl; - break; - case SIMDIntrinsicWidenHi: - result = INS_fcvtl2; - break; default: assert(!"Unsupported SIMD intrinsic"); unreached(); @@ -4032,20 +4012,9 @@ instruction CodeGen::getOpForSIMDIntrinsic(SIMDIntrinsicID intrinsicId, var_type case SIMDIntrinsicEqual: result = INS_cmeq; break; - case SIMDIntrinsicNarrow: - // Use INS_xtn lower bytes of result followed by INS_xtn2 for upper bytes - // Return lower bytes instruction here - result = INS_xtn; - break; case SIMDIntrinsicSub: result = INS_sub; break; - case SIMDIntrinsicWidenLo: - result = isUnsigned ? INS_uxtl : INS_sxtl; - break; - case SIMDIntrinsicWidenHi: - result = isUnsigned ? INS_uxtl2 : INS_sxtl2; - break; default: assert(!"Unsupported SIMD intrinsic"); unreached(); @@ -4067,15 +4036,15 @@ instruction CodeGen::getOpForSIMDIntrinsic(SIMDIntrinsicID intrinsicId, var_type // void CodeGen::genSIMDIntrinsicInit(GenTreeSIMD* simdNode) { - assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicInit); + assert(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicInit); - GenTree* op1 = simdNode->gtGetOp1(); + GenTree* op1 = simdNode->Op(1); var_types baseType = simdNode->GetSimdBaseType(); regNumber targetReg = simdNode->GetRegNum(); assert(targetReg != REG_NA); var_types targetType = simdNode->TypeGet(); - genConsumeOperands(simdNode); + genConsumeMultiOpOperands(simdNode); regNumber op1Reg = op1->IsIntegralConst(0) ? REG_ZR : op1->GetRegNum(); // TODO-ARM64-CQ Add LD1R to allow SIMDIntrinsicInit from contained memory @@ -4118,16 +4087,18 @@ void CodeGen::genSIMDIntrinsicInit(GenTreeSIMD* simdNode) // void CodeGen::genSIMDIntrinsicInitN(GenTreeSIMD* simdNode) { - assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicInitN); + assert(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicInitN); regNumber targetReg = simdNode->GetRegNum(); assert(targetReg != REG_NA); - var_types targetType = simdNode->TypeGet(); - - var_types baseType = simdNode->GetSimdBaseType(); + var_types targetType = simdNode->TypeGet(); + var_types baseType = simdNode->GetSimdBaseType(); + emitAttr baseTypeSize = emitTypeSize(baseType); + regNumber vectorReg = targetReg; + size_t initCount = simdNode->GetOperandCount(); - regNumber vectorReg = targetReg; + assert((initCount * baseTypeSize) <= simdNode->GetSimdSize()); if (varTypeIsFloating(baseType)) { @@ -4136,24 +4107,17 @@ void CodeGen::genSIMDIntrinsicInitN(GenTreeSIMD* simdNode) vectorReg = simdNode->GetSingleTempReg(RBM_ALLFLOAT); } - emitAttr baseTypeSize = emitTypeSize(baseType); - // We will first consume the list items in execution (left to right) order, // and record the registers. regNumber operandRegs[FP_REGSIZE_BYTES]; - unsigned initCount = 0; - for (GenTree* list = simdNode->gtGetOp1(); list != nullptr; list = list->gtGetOp2()) + for (size_t i = 1; i <= initCount; i++) { - assert(list->OperGet() == GT_LIST); - GenTree* listItem = list->gtGetOp1(); - assert(listItem->TypeGet() == baseType); - assert(!listItem->isContained()); - regNumber operandReg = genConsumeReg(listItem); - operandRegs[initCount] = operandReg; - initCount++; - } + GenTree* operand = simdNode->Op(i); + assert(operand->TypeIs(baseType)); + assert(!operand->isContained()); - assert((initCount * baseTypeSize) <= simdNode->GetSimdSize()); + operandRegs[i - 1] = genConsumeReg(operand); + } if (initCount * baseTypeSize < EA_16BYTE) { @@ -4192,25 +4156,25 @@ void CodeGen::genSIMDIntrinsicInitN(GenTreeSIMD* simdNode) // void CodeGen::genSIMDIntrinsicUnOp(GenTreeSIMD* simdNode) { - assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicCast || - simdNode->gtSIMDIntrinsicID == SIMDIntrinsicConvertToSingle || - simdNode->gtSIMDIntrinsicID == SIMDIntrinsicConvertToInt32 || - simdNode->gtSIMDIntrinsicID == SIMDIntrinsicConvertToDouble || - simdNode->gtSIMDIntrinsicID == SIMDIntrinsicConvertToInt64); + assert((simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicCast) || + (simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicConvertToSingle) || + (simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicConvertToInt32) || + (simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicConvertToDouble) || + (simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicConvertToInt64)); - GenTree* op1 = simdNode->gtGetOp1(); + GenTree* op1 = simdNode->Op(1); var_types baseType = simdNode->GetSimdBaseType(); regNumber targetReg = simdNode->GetRegNum(); assert(targetReg != REG_NA); var_types targetType = simdNode->TypeGet(); - genConsumeOperands(simdNode); + genConsumeMultiOpOperands(simdNode); regNumber op1Reg = op1->GetRegNum(); assert(genIsValidFloatReg(op1Reg)); assert(genIsValidFloatReg(targetReg)); - instruction ins = getOpForSIMDIntrinsic(simdNode->gtSIMDIntrinsicID, baseType); + instruction ins = getOpForSIMDIntrinsic(simdNode->GetSIMDIntrinsicId(), baseType); emitAttr attr = (simdNode->GetSimdSize() > 8) ? EA_16BYTE : EA_8BYTE; if (GetEmitter()->IsMovInstruction(ins)) @@ -4224,113 +4188,6 @@ void CodeGen::genSIMDIntrinsicUnOp(GenTreeSIMD* simdNode) genProduceReg(simdNode); } -//-------------------------------------------------------------------------------- -// genSIMDIntrinsicWiden: Generate code for SIMD Intrinsic Widen operations -// -// Arguments: -// simdNode - The GT_SIMD node -// -// Notes: -// The Widen intrinsics are broken into separate intrinsics for the two results. -// -void CodeGen::genSIMDIntrinsicWiden(GenTreeSIMD* simdNode) -{ - assert((simdNode->gtSIMDIntrinsicID == SIMDIntrinsicWidenLo) || - (simdNode->gtSIMDIntrinsicID == SIMDIntrinsicWidenHi)); - - GenTree* op1 = simdNode->gtGetOp1(); - var_types baseType = simdNode->GetSimdBaseType(); - regNumber targetReg = simdNode->GetRegNum(); - assert(targetReg != REG_NA); - var_types simdType = simdNode->TypeGet(); - - genConsumeOperands(simdNode); - regNumber op1Reg = op1->GetRegNum(); - regNumber srcReg = op1Reg; - emitAttr emitSize = emitActualTypeSize(simdType); - - instruction ins = getOpForSIMDIntrinsic(simdNode->gtSIMDIntrinsicID, baseType); - - emitAttr attr = (simdNode->gtSIMDIntrinsicID == SIMDIntrinsicWidenHi) ? EA_16BYTE : EA_8BYTE; - insOpts opt = genGetSimdInsOpt(attr, baseType); - - GetEmitter()->emitIns_R_R(ins, attr, targetReg, op1Reg, opt); - - genProduceReg(simdNode); -} - -//-------------------------------------------------------------------------------- -// genSIMDIntrinsicNarrow: Generate code for SIMD Intrinsic Narrow operations -// -// Arguments: -// simdNode - The GT_SIMD node -// -// Notes: -// This intrinsic takes two arguments. The first operand is narrowed to produce the -// lower elements of the results, and the second operand produces the high elements. -// -void CodeGen::genSIMDIntrinsicNarrow(GenTreeSIMD* simdNode) -{ - assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicNarrow); - - GenTree* op1 = simdNode->gtGetOp1(); - GenTree* op2 = simdNode->gtGetOp2(); - var_types baseType = simdNode->GetSimdBaseType(); - regNumber targetReg = simdNode->GetRegNum(); - assert(targetReg != REG_NA); - var_types simdType = simdNode->TypeGet(); - emitAttr emitSize = emitTypeSize(simdType); - - genConsumeOperands(simdNode); - regNumber op1Reg = op1->GetRegNum(); - regNumber op2Reg = op2->GetRegNum(); - - assert(genIsValidFloatReg(op1Reg)); - assert(genIsValidFloatReg(op2Reg)); - assert(genIsValidFloatReg(targetReg)); - assert(op2Reg != targetReg); - assert(simdNode->GetSimdSize() == 16); - - instruction ins = getOpForSIMDIntrinsic(simdNode->gtSIMDIntrinsicID, baseType); - assert((ins == INS_fcvtn) || (ins == INS_xtn)); - - instruction ins2 = (ins == INS_fcvtn) ? INS_fcvtn2 : INS_xtn2; - - insOpts opt = INS_OPTS_NONE; - insOpts opt2 = INS_OPTS_NONE; - - // This is not the same as genGetSimdInsOpt() - // Basetype is the soure operand type - // However encoding is based on the destination operand type which is 1/2 the basetype. - switch (baseType) - { - case TYP_ULONG: - case TYP_LONG: - case TYP_DOUBLE: - opt = INS_OPTS_2S; - opt2 = INS_OPTS_4S; - break; - case TYP_UINT: - case TYP_INT: - opt = INS_OPTS_4H; - opt2 = INS_OPTS_8H; - break; - case TYP_USHORT: - case TYP_SHORT: - opt = INS_OPTS_8B; - opt2 = INS_OPTS_16B; - break; - default: - assert(!"Unsupported narrowing element type"); - unreached(); - } - - GetEmitter()->emitIns_R_R(ins, EA_8BYTE, targetReg, op1Reg, opt); - GetEmitter()->emitIns_R_R(ins2, EA_16BYTE, targetReg, op2Reg, opt2); - - genProduceReg(simdNode); -} - //-------------------------------------------------------------------------------- // genSIMDIntrinsicBinOp: Generate code for SIMD Intrinsic binary operations // add, sub, mul, bit-wise And, AndNot and Or. @@ -4343,17 +4200,19 @@ void CodeGen::genSIMDIntrinsicNarrow(GenTreeSIMD* simdNode) // void CodeGen::genSIMDIntrinsicBinOp(GenTreeSIMD* simdNode) { - assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicSub || simdNode->gtSIMDIntrinsicID == SIMDIntrinsicBitwiseAnd || - simdNode->gtSIMDIntrinsicID == SIMDIntrinsicBitwiseOr || simdNode->gtSIMDIntrinsicID == SIMDIntrinsicEqual); + assert((simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicSub) || + (simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicBitwiseAnd) || + (simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicBitwiseOr) || + (simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicEqual)); - GenTree* op1 = simdNode->gtGetOp1(); - GenTree* op2 = simdNode->gtGetOp2(); + GenTree* op1 = simdNode->Op(1); + GenTree* op2 = simdNode->Op(2); var_types baseType = simdNode->GetSimdBaseType(); regNumber targetReg = simdNode->GetRegNum(); assert(targetReg != REG_NA); var_types targetType = simdNode->TypeGet(); - genConsumeOperands(simdNode); + genConsumeMultiOpOperands(simdNode); regNumber op1Reg = op1->GetRegNum(); regNumber op2Reg = op2->GetRegNum(); @@ -4363,7 +4222,7 @@ void CodeGen::genSIMDIntrinsicBinOp(GenTreeSIMD* simdNode) // TODO-ARM64-CQ Contain integer constants where posible - instruction ins = getOpForSIMDIntrinsic(simdNode->gtSIMDIntrinsicID, baseType); + instruction ins = getOpForSIMDIntrinsic(simdNode->GetSIMDIntrinsicId(), baseType); emitAttr attr = (simdNode->GetSimdSize() > 8) ? EA_16BYTE : EA_8BYTE; insOpts opt = genGetSimdInsOpt(attr, baseType); @@ -4392,9 +4251,9 @@ void CodeGen::genSIMDIntrinsicBinOp(GenTreeSIMD* simdNode) // void CodeGen::genSIMDIntrinsicUpperSave(GenTreeSIMD* simdNode) { - assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicUpperSave); + assert(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicUpperSave); - GenTree* op1 = simdNode->gtGetOp1(); + GenTree* op1 = simdNode->Op(1); GenTreeLclVar* lclNode = op1->AsLclVar(); LclVarDsc* varDsc = compiler->lvaGetDesc(lclNode); assert(emitTypeSize(varDsc->GetRegisterType(lclNode)) == 16); @@ -4442,9 +4301,9 @@ void CodeGen::genSIMDIntrinsicUpperSave(GenTreeSIMD* simdNode) // void CodeGen::genSIMDIntrinsicUpperRestore(GenTreeSIMD* simdNode) { - assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicUpperRestore); + assert(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicUpperRestore); - GenTree* op1 = simdNode->gtGetOp1(); + GenTree* op1 = simdNode->Op(1); assert(op1->IsLocal()); GenTreeLclVar* lclNode = op1->AsLclVar(); LclVarDsc* varDsc = compiler->lvaGetDesc(lclNode); @@ -9564,4 +9423,76 @@ void CodeGen::instGen_MemoryBarrier(BarrierKind barrierKind) } } +//----------------------------------------------------------------------------------- +// genCodeForMadd: Emit a madd/msub (Multiply-Add) instruction +// +// Arguments: +// tree - GT_MADD tree where op1 or op2 is GT_ADD +// +void CodeGen::genCodeForMadd(GenTreeOp* tree) +{ + assert(tree->OperIs(GT_MADD) && varTypeIsIntegral(tree) && !(tree->gtFlags & GTF_SET_FLAGS)); + genConsumeOperands(tree); + + GenTree* a; + GenTree* b; + GenTree* c; + if (tree->gtGetOp1()->OperIs(GT_MUL) && tree->gtGetOp1()->isContained()) + { + a = tree->gtGetOp1()->gtGetOp1(); + b = tree->gtGetOp1()->gtGetOp2(); + c = tree->gtGetOp2(); + } + else + { + assert(tree->gtGetOp2()->OperIs(GT_MUL) && tree->gtGetOp2()->isContained()); + a = tree->gtGetOp2()->gtGetOp1(); + b = tree->gtGetOp2()->gtGetOp2(); + c = tree->gtGetOp1(); + } + + bool useMsub = false; + if (a->OperIs(GT_NEG) && a->isContained()) + { + a = a->gtGetOp1(); + useMsub = true; + } + if (b->OperIs(GT_NEG) && b->isContained()) + { + b = b->gtGetOp1(); + useMsub = !useMsub; // it's either "a * -b" or "-a * -b" which is the same as "a * b" + } + + GetEmitter()->emitIns_R_R_R_R(useMsub ? INS_msub : INS_madd, emitActualTypeSize(tree), tree->GetRegNum(), + a->GetRegNum(), b->GetRegNum(), c->GetRegNum()); + genProduceReg(tree); +} + +//------------------------------------------------------------------------ +// genCodeForBfiz: Generates the code sequence for a GenTree node that +// represents a bitfield insert in zero with sign/zero extension. +// +// Arguments: +// tree - the bitfield insert in zero node. +// +void CodeGen::genCodeForBfiz(GenTreeOp* tree) +{ + assert(tree->OperIs(GT_BFIZ)); + + emitAttr size = emitActualTypeSize(tree); + unsigned shiftBy = (unsigned)tree->gtGetOp2()->AsIntCon()->IconValue(); + unsigned shiftByImm = shiftBy & (emitter::getBitWidth(size) - 1); + GenTreeCast* cast = tree->gtGetOp1()->AsCast(); + GenTree* castOp = cast->CastOp(); + + genConsumeRegs(castOp); + unsigned srcBits = varTypeIsSmall(cast->CastToType()) ? genTypeSize(cast->CastToType()) * BITS_PER_BYTE + : genTypeSize(castOp) * BITS_PER_BYTE; + const bool isUnsigned = cast->IsUnsigned() || varTypeIsUnsigned(cast->CastToType()); + GetEmitter()->emitIns_R_R_I_I(isUnsigned ? INS_ubfiz : INS_sbfiz, size, tree->GetRegNum(), castOp->GetRegNum(), + (int)shiftByImm, (int)srcBits); + + genProduceReg(tree); +} + #endif // TARGET_ARM64 diff --git a/src/coreclr/jit/codegenarmarch.cpp b/src/coreclr/jit/codegenarmarch.cpp index 469a145f12dbcf..22379e3c9dbed6 100644 --- a/src/coreclr/jit/codegenarmarch.cpp +++ b/src/coreclr/jit/codegenarmarch.cpp @@ -213,6 +213,7 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode) case GT_OR: case GT_XOR: case GT_AND: + case GT_AND_NOT: assert(varTypeIsIntegralOrI(treeNode)); FALLTHROUGH; @@ -300,6 +301,9 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode) break; #ifdef TARGET_ARM64 + case GT_MADD: + genCodeForMadd(treeNode->AsOp()); + break; case GT_INC_SATURATE: genCodeForIncSaturate(treeNode); @@ -312,6 +316,10 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode) case GT_SWAP: genCodeForSwap(treeNode->AsOp()); break; + + case GT_BFIZ: + genCodeForBfiz(treeNode->AsOp()); + break; #endif // TARGET_ARM64 case GT_JMP: @@ -382,7 +390,6 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode) // This is handled at the time we call genConsumeReg() on the GT_COPY break; - case GT_LIST: case GT_FIELD_LIST: // Should always be marked contained. assert(!"LIST, FIELD_LIST nodes should always be marked contained."); @@ -542,7 +549,7 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode) { #ifdef DEBUG char message[256]; - _snprintf_s(message, _countof(message), _TRUNCATE, "NYI: Unimplemented node type %s", + _snprintf_s(message, ArrLen(message), _TRUNCATE, "NYI: Unimplemented node type %s", GenTree::OpName(treeNode->OperGet())); NYIRAW(message); #else @@ -705,7 +712,7 @@ void CodeGen::genPutArgStk(GenTreePutArgStk* treeNode) // Since it is a fast tail call, the existence of first incoming arg is guaranteed // because fast tail call requires that in-coming arg area of caller is >= out-going // arg area required for tail call. - LclVarDsc* varDsc = &(compiler->lvaTable[varNumOut]); + LclVarDsc* varDsc = compiler->lvaGetDesc(varNumOut); assert(varDsc != nullptr); #endif // FEATURE_FASTTAILCALL } @@ -1240,10 +1247,9 @@ void CodeGen::genPutArgSplit(GenTreePutArgSplit* treeNode) { assert(varNode->isContained()); srcVarNum = varNode->GetLclNum(); - assert(srcVarNum < compiler->lvaCount); // handle promote situation - LclVarDsc* varDsc = compiler->lvaTable + srcVarNum; + LclVarDsc* varDsc = compiler->lvaGetDesc(srcVarNum); // This struct also must live in the stack frame // And it can't live in a register (SIMD) @@ -1614,8 +1620,9 @@ void CodeGen::genCodeForShift(GenTree* tree) genTreeOps oper = tree->OperGet(); instruction ins = genGetInsForOper(oper, targetType); emitAttr size = emitActualTypeSize(tree); + regNumber dstReg = tree->GetRegNum(); - assert(tree->GetRegNum() != REG_NA); + assert(dstReg != REG_NA); genConsumeOperands(tree->AsOp()); @@ -1623,14 +1630,13 @@ void CodeGen::genCodeForShift(GenTree* tree) GenTree* shiftBy = tree->gtGetOp2(); if (!shiftBy->IsCnsIntOrI()) { - GetEmitter()->emitIns_R_R_R(ins, size, tree->GetRegNum(), operand->GetRegNum(), shiftBy->GetRegNum()); + GetEmitter()->emitIns_R_R_R(ins, size, dstReg, operand->GetRegNum(), shiftBy->GetRegNum()); } else { unsigned immWidth = emitter::getBitWidth(size); // For ARM64, immWidth will be set to 32 or 64 unsigned shiftByImm = (unsigned)shiftBy->AsIntCon()->gtIconVal & (immWidth - 1); - - GetEmitter()->emitIns_R_R_I(ins, size, tree->GetRegNum(), operand->GetRegNum(), shiftByImm); + GetEmitter()->emitIns_R_R_I(ins, size, dstReg, operand->GetRegNum(), shiftByImm); } genProduceReg(tree); @@ -2455,16 +2461,14 @@ void CodeGen::genCallInstruction(GenTreeCall* call) } } - // We need to propagate the IL offset information to the call instruction, so we can emit + DebugInfo di; + // We need to propagate the debug information to the call instruction, so we can emit // an IL to native mapping record for the call, to support managed return value debugging. // We don't want tail call helper calls that were converted from normal calls to get a record, // so we skip this hash table lookup logic in that case. - - IL_OFFSETX ilOffset = BAD_IL_OFFSET; - - if (compiler->opts.compDbgInfo && compiler->genCallSite2ILOffsetMap != nullptr && !call->IsTailCall()) + if (compiler->opts.compDbgInfo && compiler->genCallSite2DebugInfoMap != nullptr && !call->IsTailCall()) { - (void)compiler->genCallSite2ILOffsetMap->Lookup(call, &ilOffset); + (void)compiler->genCallSite2DebugInfoMap->Lookup(call, &di); } CORINFO_SIG_INFO* sigInfo = nullptr; @@ -2504,7 +2508,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call) nullptr, // addr retSize MULTIREG_HAS_SECOND_GC_RET_ONLY_ARG(secondRetSize), - ilOffset, + di, target->GetRegNum(), call->IsFastTailCall()); // clang-format on @@ -2544,7 +2548,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call) nullptr, // addr retSize MULTIREG_HAS_SECOND_GC_RET_ONLY_ARG(secondRetSize), - ilOffset, + di, targetAddrReg, call->IsFastTailCall()); // clang-format on @@ -2592,7 +2596,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call) INDEBUG_LDISASM_COMMA(sigInfo) NULL, retSize, - ilOffset, + di, tmpReg, call->IsFastTailCall()); // clang-format on @@ -2607,7 +2611,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call) addr, retSize MULTIREG_HAS_SECOND_GC_RET_ONLY_ARG(secondRetSize), - ilOffset, + di, REG_NA, call->IsFastTailCall()); // clang-format on @@ -2643,16 +2647,16 @@ void CodeGen::genJmpMethod(GenTree* jmp) // But that would require us to deal with circularity while moving values around. Spilling // to stack makes the implementation simple, which is not a bad trade off given Jmp calls // are not frequent. - for (varNum = 0; (varNum < compiler->info.compArgsCount); varNum++) + for (varNum = 0; varNum < compiler->info.compArgsCount; varNum++) { - varDsc = compiler->lvaTable + varNum; + varDsc = compiler->lvaGetDesc(varNum); if (varDsc->lvPromoted) { noway_assert(varDsc->lvFieldCnt == 1); // We only handle one field here unsigned fieldVarNum = varDsc->lvFieldLclStart; - varDsc = compiler->lvaTable + fieldVarNum; + varDsc = compiler->lvaGetDesc(fieldVarNum); } noway_assert(varDsc->lvIsParam); @@ -2718,15 +2722,15 @@ void CodeGen::genJmpMethod(GenTree* jmp) // Next move any un-enregistered register arguments back to their register. regMaskTP fixedIntArgMask = RBM_NONE; // tracks the int arg regs occupying fixed args in case of a vararg method. unsigned firstArgVarNum = BAD_VAR_NUM; // varNum of the first argument in case of a vararg method. - for (varNum = 0; (varNum < compiler->info.compArgsCount); varNum++) + for (varNum = 0; varNum < compiler->info.compArgsCount; varNum++) { - varDsc = compiler->lvaTable + varNum; + varDsc = compiler->lvaGetDesc(varNum); if (varDsc->lvPromoted) { noway_assert(varDsc->lvFieldCnt == 1); // We only handle one field here unsigned fieldVarNum = varDsc->lvFieldLclStart; - varDsc = compiler->lvaTable + fieldVarNum; + varDsc = compiler->lvaGetDesc(fieldVarNum); } noway_assert(varDsc->lvIsParam); @@ -3248,9 +3252,9 @@ void CodeGen::genCreateAndStoreGCInfo(unsigned codeSize, if (compiler->opts.IsReversePInvoke()) { unsigned reversePInvokeFrameVarNumber = compiler->lvaReversePInvokeFrameVar; - assert(reversePInvokeFrameVarNumber != BAD_VAR_NUM && reversePInvokeFrameVarNumber < compiler->lvaRefCount); - LclVarDsc& reversePInvokeFrameVar = compiler->lvaTable[reversePInvokeFrameVarNumber]; - gcInfoEncoder->SetReversePInvokeFrameSlot(reversePInvokeFrameVar.GetStackOffset()); + assert(reversePInvokeFrameVarNumber != BAD_VAR_NUM); + const LclVarDsc* reversePInvokeFrameVar = compiler->lvaGetDesc(reversePInvokeFrameVarNumber); + gcInfoEncoder->SetReversePInvokeFrameSlot(reversePInvokeFrameVar->GetStackOffset()); } gcInfoEncoder->Build(); diff --git a/src/coreclr/jit/codegencommon.cpp b/src/coreclr/jit/codegencommon.cpp index 8c788286f292d0..ef0c34ec5a01d2 100644 --- a/src/coreclr/jit/codegencommon.cpp +++ b/src/coreclr/jit/codegencommon.cpp @@ -122,10 +122,7 @@ CodeGen::CodeGen(Compiler* theCompiler) : CodeGenInterface(theCompiler) compiler->compVSQuirkStackPaddingNeeded = 0; #endif // TARGET_AMD64 - // Initialize the IP-mapping logic. - compiler->genIPmappingList = nullptr; - compiler->genIPmappingLast = nullptr; - compiler->genCallSite2ILOffsetMap = nullptr; + compiler->genCallSite2DebugInfoMap = nullptr; /* Assume that we not fully interruptible */ @@ -503,15 +500,16 @@ regMaskTP CodeGenInterface::genGetRegMask(GenTree* tree) assert(tree->gtOper == GT_LCL_VAR); regMaskTP regMask = RBM_NONE; - const LclVarDsc* varDsc = compiler->lvaTable + tree->AsLclVarCommon()->GetLclNum(); + const LclVarDsc* varDsc = compiler->lvaGetDesc(tree->AsLclVarCommon()); if (varDsc->lvPromoted) { for (unsigned i = varDsc->lvFieldLclStart; i < varDsc->lvFieldLclStart + varDsc->lvFieldCnt; ++i) { - noway_assert(compiler->lvaTable[i].lvIsStructField); - if (compiler->lvaTable[i].lvIsInReg()) + const LclVarDsc* fieldVarDsc = compiler->lvaGetDesc(i); + noway_assert(fieldVarDsc->lvIsStructField); + if (fieldVarDsc->lvIsInReg()) { - regMask |= genGetRegMask(&compiler->lvaTable[i]); + regMask |= genGetRegMask(fieldVarDsc); } } } @@ -533,7 +531,8 @@ void CodeGenInterface::genUpdateRegLife(const LclVarDsc* varDsc, bool isBorn, bo #ifdef DEBUG if (compiler->verbose) { - printf("\t\t\t\t\t\t\tV%02u in reg ", (varDsc - compiler->lvaTable)); + printf("\t\t\t\t\t\t\tV%02u in reg ", compiler->lvaGetLclNum(varDsc)); + varDsc->PrintVarReg(); printf(" is becoming %s ", (isDying) ? "dead" : "live"); Compiler::printTreeID(tree); @@ -1199,8 +1198,7 @@ unsigned CodeGenInterface::InferStructOpSizeAlign(GenTree* op, unsigned* alignme } else if (op->gtOper == GT_LCL_VAR) { - unsigned varNum = op->AsLclVarCommon()->GetLclNum(); - LclVarDsc* varDsc = compiler->lvaTable + varNum; + const LclVarDsc* varDsc = compiler->lvaGetDesc(op->AsLclVarCommon()); assert(varDsc->lvType == TYP_STRUCT); opSize = varDsc->lvSize(); #ifndef TARGET_64BIT @@ -1214,43 +1212,6 @@ unsigned CodeGenInterface::InferStructOpSizeAlign(GenTree* op, unsigned* alignme alignment = TARGET_POINTER_SIZE; } } - else if (op->OperIsCopyBlkOp()) - { - GenTree* op2 = op->AsOp()->gtOp2; - - if (op2->OperGet() == GT_CNS_INT) - { - if (op2->IsIconHandle(GTF_ICON_CLASS_HDL)) - { - CORINFO_CLASS_HANDLE clsHnd = (CORINFO_CLASS_HANDLE)op2->AsIntCon()->gtIconVal; - opSize = roundUp(compiler->info.compCompHnd->getClassSize(clsHnd), TARGET_POINTER_SIZE); - alignment = - roundUp(compiler->info.compCompHnd->getClassAlignmentRequirement(clsHnd), TARGET_POINTER_SIZE); - } - else - { - opSize = (unsigned)op2->AsIntCon()->gtIconVal; - GenTree* op1 = op->AsOp()->gtOp1; - assert(op1->OperGet() == GT_LIST); - GenTree* dstAddr = op1->AsOp()->gtOp1; - if (dstAddr->OperGet() == GT_ADDR) - { - InferStructOpSizeAlign(dstAddr->AsOp()->gtOp1, &alignment); - } - else - { - assert(!"Unhandle dstAddr node"); - alignment = TARGET_POINTER_SIZE; - } - } - } - else - { - noway_assert(!"Variable sized COPYBLK register arg!"); - opSize = 0; - alignment = TARGET_POINTER_SIZE; - } - } else if (op->gtOper == GT_MKREFANY) { opSize = TARGET_POINTER_SIZE * 2; @@ -1798,7 +1759,7 @@ void CodeGen::genExitCode(BasicBlock* block) that this is ok */ // For non-optimized debuggable code, there is only one epilog. - genIPmappingAdd((IL_OFFSETX)ICorDebugInfo::EPILOG, true); + genIPmappingAdd(IPmappingDscKind::Epilog, DebugInfo(), true); bool jmpEpilog = ((block->bbFlags & BBF_HAS_JMP) != 0); if (compiler->getNeedsGSSecurityCookie()) @@ -2446,6 +2407,8 @@ void CodeGen::genEmitUnwindDebugGCandEH() genIPmappingGen(); + INDEBUG(genDumpPreciseDebugInfo()); + /* Finalize the Local Var info in terms of generated code */ genSetScopeInfo(); @@ -3193,7 +3156,7 @@ void CodeGen::genGCWriteBarrier(GenTree* tgt, GCInfo::WriteBarrierForm wbf) } else { - LclVarDsc* varDsc = &compiler->lvaTable[lclNum]; + const LclVarDsc* varDsc = compiler->lvaGetDesc(lclNum); if (varDsc->lvIsParam && varDsc->lvType == TYP_BYREF) { wbKind = CWBKind_ByRefArg; // Out (or in/out) arg @@ -3365,16 +3328,16 @@ void CodeGen::genFnPrologCalleeRegArgs(regNumber xtraReg, bool* pXtraRegClobbere // In other cases, we simply use the type of the lclVar to determine the type of the register. var_types getRegType(Compiler* compiler) { - const LclVarDsc& varDsc = compiler->lvaTable[varNum]; + const LclVarDsc* varDsc = compiler->lvaGetDesc(varNum); // Check if this is an HFA register arg and return the HFA type - if (varDsc.lvIsHfaRegArg()) + if (varDsc->lvIsHfaRegArg()) { // Cannot have hfa types on windows arm targets // in vararg methods. assert(!TargetOS::IsWindows || !compiler->info.compIsVarArgs); - return varDsc.GetHfaType(); + return varDsc->GetHfaType(); } - return compiler->mangleVarArgsType(varDsc.lvType); + return compiler->mangleVarArgsType(varDsc->lvType); } #endif // !UNIX_AMD64_ABI @@ -3385,7 +3348,7 @@ void CodeGen::genFnPrologCalleeRegArgs(regNumber xtraReg, bool* pXtraRegClobbere for (varNum = 0; varNum < compiler->lvaCount; ++varNum) { - varDsc = compiler->lvaTable + varNum; + varDsc = compiler->lvaGetDesc(varNum); // Is this variable a register arg? if (!varDsc->lvIsParam) @@ -3409,7 +3372,7 @@ void CodeGen::genFnPrologCalleeRegArgs(regNumber xtraReg, bool* pXtraRegClobbere if (varDsc->lvIsStructField) { assert(!varDsc->lvPromoted); - parentVarDsc = &compiler->lvaTable[varDsc->lvParentLcl]; + parentVarDsc = compiler->lvaGetDesc(varDsc->lvParentLcl); } Compiler::lvaPromotionType promotionType = compiler->lvaGetPromotionType(parentVarDsc); @@ -3756,9 +3719,8 @@ void CodeGen::genFnPrologCalleeRegArgs(regNumber xtraReg, bool* pXtraRegClobbere continue; } - varNum = regArgTab[argNum].varNum; - noway_assert(varNum < compiler->lvaCount); - varDsc = compiler->lvaTable + varNum; + varNum = regArgTab[argNum].varNum; + varDsc = compiler->lvaGetDesc(varNum); const var_types varRegType = varDsc->GetRegisterType(); noway_assert(varDsc->lvIsParam && varDsc->lvIsRegArg); @@ -3896,8 +3858,7 @@ void CodeGen::genFnPrologCalleeRegArgs(regNumber xtraReg, bool* pXtraRegClobbere } varNum = regArgTab[argNum].varNum; - noway_assert(varNum < compiler->lvaCount); - varDsc = compiler->lvaTable + varNum; + varDsc = compiler->lvaGetDesc(varNum); #ifndef TARGET_64BIT // If this arg is never on the stack, go to the next one. @@ -4094,14 +4055,12 @@ void CodeGen::genFnPrologCalleeRegArgs(regNumber xtraReg, bool* pXtraRegClobbere srcReg = regArgTab[argNum].trashBy; varNumDest = regArgTab[destReg].varNum; - noway_assert(varNumDest < compiler->lvaCount); - varDscDest = compiler->lvaTable + varNumDest; + varDscDest = compiler->lvaGetDesc(varNumDest); noway_assert(varDscDest->lvIsParam && varDscDest->lvIsRegArg); noway_assert(srcReg < argMax); varNumSrc = regArgTab[srcReg].varNum; - noway_assert(varNumSrc < compiler->lvaCount); - varDscSrc = compiler->lvaTable + varNumSrc; + varDscSrc = compiler->lvaGetDesc(varNumSrc); noway_assert(varDscSrc->lvIsParam && varDscSrc->lvIsRegArg); emitAttr size = EA_PTRSIZE; @@ -4117,8 +4076,7 @@ void CodeGen::genFnPrologCalleeRegArgs(regNumber xtraReg, bool* pXtraRegClobbere /* only 2 registers form the circular dependency - use "xchg" */ varNum = regArgTab[argNum].varNum; - noway_assert(varNum < compiler->lvaCount); - varDsc = compiler->lvaTable + varNum; + varDsc = compiler->lvaGetDesc(varNum); noway_assert(varDsc->lvIsParam && varDsc->lvIsRegArg); noway_assert(genTypeSize(genActualType(varDscSrc->TypeGet())) <= REGSIZE_BYTES); @@ -4163,7 +4121,7 @@ void CodeGen::genFnPrologCalleeRegArgs(regNumber xtraReg, bool* pXtraRegClobbere unsigned iter = begReg; do { - if (compiler->lvaTable[regArgTab[iter].varNum].TypeGet() != TYP_DOUBLE) + if (compiler->lvaGetDesc(regArgTab[iter].varNum)->TypeGet() != TYP_DOUBLE) { cycleAllDouble = false; break; @@ -4250,8 +4208,7 @@ void CodeGen::genFnPrologCalleeRegArgs(regNumber xtraReg, bool* pXtraRegClobbere } #endif varNumSrc = regArgTab[srcReg].varNum; - noway_assert(varNumSrc < compiler->lvaCount); - varDscSrc = compiler->lvaTable + varNumSrc; + varDscSrc = compiler->lvaGetDesc(varNumSrc); noway_assert(varDscSrc->lvIsParam && varDscSrc->lvIsRegArg); if (destMemType == TYP_REF) @@ -4312,9 +4269,8 @@ void CodeGen::genFnPrologCalleeRegArgs(regNumber xtraReg, bool* pXtraRegClobbere continue; } - varNum = regArgTab[argNum].varNum; - noway_assert(varNum < compiler->lvaCount); - varDsc = compiler->lvaTable + varNum; + varNum = regArgTab[argNum].varNum; + varDsc = compiler->lvaGetDesc(varNum); const var_types regType = regArgTab[argNum].getRegType(compiler); const regNumber regNum = genMapRegArgNumToRegNum(argNum, regType); const var_types varRegType = varDsc->GetRegisterType(); @@ -6394,7 +6350,7 @@ void CodeGen::genReportGenericContextArg(regNumber initReg, bool* pInitRegZeroed unsigned contextArg = reportArg ? compiler->info.compTypeCtxtArg : compiler->info.compThisArg; noway_assert(contextArg != BAD_VAR_NUM); - LclVarDsc* varDsc = &compiler->lvaTable[contextArg]; + LclVarDsc* varDsc = compiler->lvaGetDesc(contextArg); // We are still in the prolog and compiler->info.compTypeCtxtArg has not been // moved to its final home location. So we need to use it from the @@ -6978,7 +6934,7 @@ void CodeGen::genFnProlog() // Do this so we can put the prolog instruction group ahead of // other instruction groups - genIPmappingAddToFront((IL_OFFSETX)ICorDebugInfo::PROLOG); + genIPmappingAddToFront(IPmappingDscKind::Prolog, DebugInfo(), true); #ifdef DEBUG if (compiler->opts.dspCode) @@ -7029,7 +6985,7 @@ void CodeGen::genFnProlog() // as it will overwrite the real value if (compiler->lvaPSPSym != BAD_VAR_NUM) { - LclVarDsc* varDsc = &compiler->lvaTable[compiler->lvaPSPSym]; + const LclVarDsc* varDsc = compiler->lvaGetDesc(compiler->lvaPSPSym); assert(!varDsc->lvMustInit); } @@ -7260,13 +7216,11 @@ void CodeGen::genFnProlog() assert((!compiler->opts.ShouldUsePInvokeHelpers()) || (compiler->info.compLvFrameListRoot == BAD_VAR_NUM)); if (!compiler->opts.ShouldUsePInvokeHelpers()) { - noway_assert(compiler->info.compLvFrameListRoot < compiler->lvaCount); - excludeMask |= (RBM_PINVOKE_TCB | RBM_PINVOKE_SCRATCH); // We also must exclude the register used by compLvFrameListRoot when it is enregistered // - LclVarDsc* varDsc = &compiler->lvaTable[compiler->info.compLvFrameListRoot]; + const LclVarDsc* varDsc = compiler->lvaGetDesc(compiler->info.compLvFrameListRoot); if (varDsc->lvRegister) { excludeMask |= genRegMask(varDsc->GetRegNum()); @@ -7679,9 +7633,9 @@ void CodeGen::genFnProlog() // (our argument pointer register has a refcount > 0). unsigned argsStartVar = compiler->lvaVarargsBaseOfStkArgs; - if (compiler->info.compIsVarArgs && compiler->lvaTable[argsStartVar].lvRefCnt() > 0) + if (compiler->info.compIsVarArgs && compiler->lvaGetDesc(argsStartVar)->lvRefCnt() > 0) { - varDsc = &compiler->lvaTable[argsStartVar]; + varDsc = compiler->lvaGetDesc(argsStartVar); noway_assert(compiler->info.compArgsCount > 0); @@ -7695,7 +7649,7 @@ void CodeGen::genFnProlog() // EDX might actually be holding something here. So make sure to only use EAX for this code // sequence. - LclVarDsc* lastArg = &compiler->lvaTable[compiler->info.compArgsCount - 1]; + const LclVarDsc* lastArg = compiler->lvaGetDesc(compiler->info.compArgsCount - 1); noway_assert(!lastArg->lvRegister); signed offset = lastArg->GetStackOffset(); assert(offset != BAD_STK_OFFS); @@ -7721,8 +7675,8 @@ void CodeGen::genFnProlog() if (compiler->opts.compStackCheckOnRet) { noway_assert(compiler->lvaReturnSpCheck != 0xCCCCCCCC && - compiler->lvaTable[compiler->lvaReturnSpCheck].lvDoNotEnregister && - compiler->lvaTable[compiler->lvaReturnSpCheck].lvOnFrame); + compiler->lvaGetDesc(compiler->lvaReturnSpCheck)->lvDoNotEnregister && + compiler->lvaGetDesc(compiler->lvaReturnSpCheck)->lvOnFrame); GetEmitter()->emitIns_S_R(ins_Store(TYP_I_IMPL), EA_PTRSIZE, REG_SPBASE, compiler->lvaReturnSpCheck, 0); } #endif // defined(DEBUG) && defined(TARGET_XARCH) @@ -8068,7 +8022,7 @@ void CodeGen::genFnEpilog(BasicBlock* block) gcInfo.gcVarPtrSetCur, gcInfo.gcRegGCrefSetCur, gcInfo.gcRegByrefSetCur, - BAD_IL_OFFSET, // IL offset + DebugInfo(), indCallReg, // ireg REG_NA, // xreg 0, // xmul @@ -8469,7 +8423,8 @@ void CodeGen::genFnEpilog(BasicBlock* block) gcInfo.gcVarPtrSetCur, gcInfo.gcRegGCrefSetCur, gcInfo.gcRegByrefSetCur, - BAD_IL_OFFSET, indCallReg, REG_NA, 0, 0, /* iloffset, ireg, xreg, xmul, disp */ + DebugInfo(), + indCallReg, REG_NA, 0, 0, /* ireg, xreg, xmul, disp */ true /* isJump */ ); // clang-format on @@ -9815,7 +9770,7 @@ unsigned CodeGen::getFirstArgWithStackSlot() LclVarDsc* varDsc = nullptr; for (unsigned i = 0; i < compiler->info.compArgsCount; i++) { - varDsc = &(compiler->lvaTable[i]); + varDsc = compiler->lvaGetDesc(i); // We should have found a stack parameter (and broken out of this loop) before // we find any non-parameters. @@ -10266,7 +10221,7 @@ void CodeGen::genSetScopeInfo(unsigned which, // Is this a varargs function? if (compiler->info.compIsVarArgs && varNum != compiler->lvaVarargsHandleArg && - varNum < compiler->info.compArgsCount && !compiler->lvaTable[varNum].lvIsRegArg) + varNum < compiler->info.compArgsCount && !compiler->lvaGetDesc(varNum)->lvIsRegArg) { noway_assert(varLoc->vlType == VLT_STK || varLoc->vlType == VLT_STK2); @@ -10275,7 +10230,7 @@ void CodeGen::genSetScopeInfo(unsigned which, // and just find its position relative to the varargs handle PREFIX_ASSUME(compiler->lvaVarargsHandleArg < compiler->info.compArgsCount); - if (!compiler->lvaTable[compiler->lvaVarargsHandleArg].lvOnFrame) + if (!compiler->lvaGetDesc(compiler->lvaVarargsHandleArg)->lvOnFrame) { noway_assert(!compiler->opts.compDbgCode); return; @@ -10283,9 +10238,9 @@ void CodeGen::genSetScopeInfo(unsigned which, // Can't check compiler->lvaTable[varNum].lvOnFrame as we don't set it for // arguments of vararg functions to avoid reporting them to GC. - noway_assert(!compiler->lvaTable[varNum].lvRegister); - unsigned cookieOffset = compiler->lvaTable[compiler->lvaVarargsHandleArg].GetStackOffset(); - unsigned varOffset = compiler->lvaTable[varNum].GetStackOffset(); + noway_assert(!compiler->lvaGetDesc(varNum)->lvRegister); + unsigned cookieOffset = compiler->lvaGetDesc(compiler->lvaVarargsHandleArg)->GetStackOffset(); + unsigned varOffset = compiler->lvaGetDesc(varNum)->GetStackOffset(); noway_assert(cookieOffset < varOffset); unsigned offset = varOffset - cookieOffset; @@ -10401,32 +10356,38 @@ const char* CodeGen::siStackVarName(size_t offs, size_t size, unsigned reg, unsi * Display a IPmappingDsc. Pass -1 as mappingNum to not display a mapping number. */ -void CodeGen::genIPmappingDisp(unsigned mappingNum, Compiler::IPmappingDsc* ipMapping) +void CodeGen::genIPmappingDisp(unsigned mappingNum, IPmappingDsc* ipMapping) { if (mappingNum != unsigned(-1)) { printf("%d: ", mappingNum); } - IL_OFFSETX offsx = ipMapping->ipmdILoffsx; - - if (offsx == BAD_IL_OFFSET) + switch (ipMapping->ipmdKind) { - printf("???"); - } - else - { - Compiler::eeDispILOffs(jitGetILoffsAny(offsx)); + case IPmappingDscKind::Prolog: + printf("PROLOG"); + break; + case IPmappingDscKind::Epilog: + printf("EPILOG"); + break; + case IPmappingDscKind::NoMapping: + printf("NO_MAP"); + break; + case IPmappingDscKind::Normal: + const ILLocation& loc = ipMapping->ipmdLoc; + Compiler::eeDispILOffs(loc.GetOffset()); + if (loc.IsStackEmpty()) + { + printf(" STACK_EMPTY"); + } - if (jitIsStackEmpty(offsx)) - { - printf(" STACK_EMPTY"); - } + if (loc.IsCall()) + { + printf(" CALL_INSTRUCTION"); + } - if (jitIsCallInstruction(offsx)) - { - printf(" CALL_INSTRUCTION"); - } + break; } printf(" "); @@ -10444,12 +10405,11 @@ void CodeGen::genIPmappingDisp(unsigned mappingNum, Compiler::IPmappingDsc* ipMa void CodeGen::genIPmappingListDisp() { - unsigned mappingNum = 0; - Compiler::IPmappingDsc* ipMapping; + unsigned mappingNum = 0; - for (ipMapping = compiler->genIPmappingList; ipMapping != nullptr; ipMapping = ipMapping->ipmdNext) + for (IPmappingDsc& dsc : compiler->genIPmappings) { - genIPmappingDisp(mappingNum, ipMapping); + genIPmappingDisp(mappingNum, &dsc); ++mappingNum; } } @@ -10463,66 +10423,54 @@ void CodeGen::genIPmappingListDisp() * Record the instr offset as being at the current code gen position. */ -void CodeGen::genIPmappingAdd(IL_OFFSETX offsx, bool isLabel) +void CodeGen::genIPmappingAdd(IPmappingDscKind kind, const DebugInfo& di, bool isLabel) { if (!compiler->opts.compDbgInfo) { return; } - assert(offsx != BAD_IL_OFFSET); + assert((kind == IPmappingDscKind::Normal) == di.IsValid()); - switch ((int)offsx) // Need the cast since offs is unsigned and the case statements are comparing to signed. + switch (kind) { - case ICorDebugInfo::PROLOG: - case ICorDebugInfo::EPILOG: + case IPmappingDscKind::Prolog: + case IPmappingDscKind::Epilog: break; default: - if (offsx != (IL_OFFSETX)ICorDebugInfo::NO_MAPPING) + if (kind == IPmappingDscKind::Normal) { - noway_assert(jitGetILoffs(offsx) <= compiler->info.compILCodeSize); + noway_assert(di.GetLocation().GetOffset() <= compiler->info.compILCodeSize); } - // Ignore this one if it's the same IL offset as the last one we saw. + // Ignore this one if it's the same IL location as the last one we saw. // Note that we'll let through two identical IL offsets if the flag bits // differ, or two identical "special" mappings (e.g., PROLOG). - if ((compiler->genIPmappingLast != nullptr) && (offsx == compiler->genIPmappingLast->ipmdILoffsx)) + if ((compiler->genIPmappings.size() > 0) && (kind == compiler->genIPmappings.back().ipmdKind) && + (di.GetLocation() == compiler->genIPmappings.back().ipmdLoc)) { - JITDUMP("genIPmappingAdd: ignoring duplicate IL offset 0x%x\n", offsx); + JITDUMP("genIPmappingAdd: ignoring duplicate IL offset 0x%x\n", di.GetLocation().GetOffset()); return; } break; } - /* Create a mapping entry and append it to the list */ - - Compiler::IPmappingDsc* addMapping = compiler->getAllocator(CMK_DebugInfo).allocate(1); - addMapping->ipmdNativeLoc.CaptureLocation(GetEmitter()); - addMapping->ipmdILoffsx = offsx; - addMapping->ipmdIsLabel = isLabel; - addMapping->ipmdNext = nullptr; - - if (compiler->genIPmappingList != nullptr) - { - assert(compiler->genIPmappingLast != nullptr); - assert(compiler->genIPmappingLast->ipmdNext == nullptr); - compiler->genIPmappingLast->ipmdNext = addMapping; - } - else - { - assert(compiler->genIPmappingLast == nullptr); - compiler->genIPmappingList = addMapping; - } + IPmappingDsc addMapping; + addMapping.ipmdNativeLoc.CaptureLocation(GetEmitter()); + addMapping.ipmdKind = kind; + addMapping.ipmdLoc = di.GetLocation(); + addMapping.ipmdIsLabel = isLabel; - compiler->genIPmappingLast = addMapping; + assert((kind == IPmappingDscKind::Normal) == addMapping.ipmdLoc.IsValid()); + compiler->genIPmappings.push_back(addMapping); #ifdef DEBUG if (verbose) { printf("Added IP mapping: "); - genIPmappingDisp(unsigned(-1), addMapping); + genIPmappingDisp(unsigned(-1), &addMapping); } #endif // DEBUG } @@ -10531,210 +10479,73 @@ void CodeGen::genIPmappingAdd(IL_OFFSETX offsx, bool isLabel) * * Prepend an IPmappingDsc struct to the list that we're maintaining * for the debugger. - * Record the instr offset as being at the current code gen position. */ -void CodeGen::genIPmappingAddToFront(IL_OFFSETX offsx) +void CodeGen::genIPmappingAddToFront(IPmappingDscKind kind, const DebugInfo& di, bool isLabel) { if (!compiler->opts.compDbgInfo) { return; } - assert(offsx != BAD_IL_OFFSET); - assert(compiler->compGeneratingProlog); // We only ever do this during prolog generation. - - switch ((int)offsx) // Need the cast since offs is unsigned and the case statements are comparing to signed. - { - case ICorDebugInfo::NO_MAPPING: - case ICorDebugInfo::PROLOG: - case ICorDebugInfo::EPILOG: - break; - - default: - noway_assert(jitGetILoffs(offsx) <= compiler->info.compILCodeSize); - break; - } + noway_assert((kind != IPmappingDscKind::Normal) || + (di.IsValid() && (di.GetLocation().GetOffset() <= compiler->info.compILCodeSize))); /* Create a mapping entry and prepend it to the list */ - Compiler::IPmappingDsc* addMapping = compiler->getAllocator(CMK_DebugInfo).allocate(1); - addMapping->ipmdNativeLoc.CaptureLocation(GetEmitter()); - addMapping->ipmdILoffsx = offsx; - addMapping->ipmdIsLabel = true; - addMapping->ipmdNext = nullptr; - - addMapping->ipmdNext = compiler->genIPmappingList; - compiler->genIPmappingList = addMapping; - - if (compiler->genIPmappingLast == nullptr) - { - compiler->genIPmappingLast = addMapping; - } + IPmappingDsc addMapping; + addMapping.ipmdNativeLoc.CaptureLocation(GetEmitter()); + addMapping.ipmdKind = kind; + addMapping.ipmdLoc = di.GetLocation(); + addMapping.ipmdIsLabel = isLabel; + compiler->genIPmappings.push_front(addMapping); #ifdef DEBUG if (verbose) { printf("Added IP mapping to front: "); - genIPmappingDisp(unsigned(-1), addMapping); + genIPmappingDisp(unsigned(-1), &addMapping); } #endif // DEBUG } /*****************************************************************************/ -C_ASSERT(IL_OFFSETX(ICorDebugInfo::NO_MAPPING) != IL_OFFSETX(BAD_IL_OFFSET)); -C_ASSERT(IL_OFFSETX(ICorDebugInfo::PROLOG) != IL_OFFSETX(BAD_IL_OFFSET)); -C_ASSERT(IL_OFFSETX(ICorDebugInfo::EPILOG) != IL_OFFSETX(BAD_IL_OFFSET)); - -C_ASSERT(IL_OFFSETX(BAD_IL_OFFSET) > MAX_IL_OFFSET); -C_ASSERT(IL_OFFSETX(ICorDebugInfo::NO_MAPPING) > MAX_IL_OFFSET); -C_ASSERT(IL_OFFSETX(ICorDebugInfo::PROLOG) > MAX_IL_OFFSET); -C_ASSERT(IL_OFFSETX(ICorDebugInfo::EPILOG) > MAX_IL_OFFSET); - -//------------------------------------------------------------------------ -// jitGetILoffs: Returns the IL offset portion of the IL_OFFSETX type. -// Asserts if any ICorDebugInfo distinguished value (like ICorDebugInfo::NO_MAPPING) -// is seen; these are unexpected here. Also asserts if passed BAD_IL_OFFSET. -// -// Arguments: -// offsx - the IL_OFFSETX value with the IL offset to extract. -// -// Return Value: -// The IL offset. - -IL_OFFSET jitGetILoffs(IL_OFFSETX offsx) -{ - assert(offsx != BAD_IL_OFFSET); - - switch ((int)offsx) // Need the cast since offs is unsigned and the case statements are comparing to signed. - { - case ICorDebugInfo::NO_MAPPING: - case ICorDebugInfo::PROLOG: - case ICorDebugInfo::EPILOG: - unreached(); - - default: - return IL_OFFSET(offsx & ~IL_OFFSETX_BITS); - } -} - -//------------------------------------------------------------------------ -// jitGetILoffsAny: Similar to jitGetILoffs(), but passes through ICorDebugInfo -// distinguished values. Asserts if passed BAD_IL_OFFSET. -// -// Arguments: -// offsx - the IL_OFFSETX value with the IL offset to extract. -// -// Return Value: -// The IL offset. - -IL_OFFSET jitGetILoffsAny(IL_OFFSETX offsx) -{ - assert(offsx != BAD_IL_OFFSET); - - switch ((int)offsx) // Need the cast since offs is unsigned and the case statements are comparing to signed. - { - case ICorDebugInfo::NO_MAPPING: - case ICorDebugInfo::PROLOG: - case ICorDebugInfo::EPILOG: - return IL_OFFSET(offsx); - - default: - return IL_OFFSET(offsx & ~IL_OFFSETX_BITS); - } -} - -//------------------------------------------------------------------------ -// jitIsStackEmpty: Does the IL offset have the stack empty bit set? -// Asserts if passed BAD_IL_OFFSET. -// -// Arguments: -// offsx - the IL_OFFSETX value to check -// -// Return Value: -// 'true' if the stack empty bit is set; 'false' otherwise. - -bool jitIsStackEmpty(IL_OFFSETX offsx) -{ - assert(offsx != BAD_IL_OFFSET); - - switch ((int)offsx) // Need the cast since offs is unsigned and the case statements are comparing to signed. - { - case ICorDebugInfo::NO_MAPPING: - case ICorDebugInfo::PROLOG: - case ICorDebugInfo::EPILOG: - return true; - - default: - return (offsx & IL_OFFSETX_STKBIT) == 0; - } -} - -//------------------------------------------------------------------------ -// jitIsCallInstruction: Does the IL offset have the call instruction bit set? -// Asserts if passed BAD_IL_OFFSET. -// -// Arguments: -// offsx - the IL_OFFSETX value to check -// -// Return Value: -// 'true' if the call instruction bit is set; 'false' otherwise. - -bool jitIsCallInstruction(IL_OFFSETX offsx) -{ - assert(offsx != BAD_IL_OFFSET); - - switch ((int)offsx) // Need the cast since offs is unsigned and the case statements are comparing to signed. - { - case ICorDebugInfo::NO_MAPPING: - case ICorDebugInfo::PROLOG: - case ICorDebugInfo::EPILOG: - return false; - - default: - return (offsx & IL_OFFSETX_CALLINSTRUCTIONBIT) != 0; - } -} - -/*****************************************************************************/ - -void CodeGen::genEnsureCodeEmitted(IL_OFFSETX offsx) +void CodeGen::genEnsureCodeEmitted(const DebugInfo& di) { if (!compiler->opts.compDbgCode) { return; } - if (offsx == BAD_IL_OFFSET) + if (!di.IsValid()) { return; } - /* If other IL were offsets reported, skip */ + // If other IL were offsets reported, skip - if (compiler->genIPmappingLast == nullptr) + if (compiler->genIPmappings.size() <= 0) { return; } - if (compiler->genIPmappingLast->ipmdILoffsx != offsx) + const IPmappingDsc& prev = compiler->genIPmappings.back(); + if (prev.ipmdLoc != di.GetLocation()) { return; } - /* offsx was the last reported offset. Make sure that we generated native code */ + // di represents the last reported offset. Make sure that we generated native code - if (compiler->genIPmappingLast->ipmdNativeLoc.IsCurrentLocation(GetEmitter())) + if (prev.ipmdNativeLoc.IsCurrentLocation(GetEmitter())) { instGen(INS_nop); } } -/***************************************************************************** - * - * Shut down the IP-mapping logic, report the info to the EE. - */ - +//------------------------------------------------------------------------ +// genIPmappingGen: Shut down the IP-mapping logic, report the info to the EE. +// void CodeGen::genIPmappingGen() { if (!compiler->opts.compDbgInfo) @@ -10749,136 +10560,101 @@ void CodeGen::genIPmappingGen() } #endif - if (compiler->genIPmappingList == nullptr) + if (compiler->genIPmappings.size() <= 0) { compiler->eeSetLIcount(0); compiler->eeSetLIdone(); return; } - Compiler::IPmappingDsc* tmpMapping; - Compiler::IPmappingDsc* prevMapping; - unsigned mappingCnt; - UNATIVE_OFFSET lastNativeOfs; - - /* First count the number of distinct mapping records */ - - mappingCnt = 0; - lastNativeOfs = UNATIVE_OFFSET(~0); - - for (prevMapping = nullptr, tmpMapping = compiler->genIPmappingList; tmpMapping != nullptr; - tmpMapping = tmpMapping->ipmdNext) + UNATIVE_OFFSET prevNativeOfs = UNATIVE_OFFSET(~0); + for (jitstd::list::iterator it = compiler->genIPmappings.begin(); + it != compiler->genIPmappings.end();) { - IL_OFFSETX srcIP = tmpMapping->ipmdILoffsx; - - // Managed RetVal - since new sequence points are emitted to identify IL calls, - // make sure that those are not filtered and do not interfere with filtering of - // other sequence points. - if (jitIsCallInstruction(srcIP)) + UNATIVE_OFFSET dscNativeOfs = it->ipmdNativeLoc.CodeOffset(GetEmitter()); + if (dscNativeOfs != prevNativeOfs) { - mappingCnt++; + prevNativeOfs = dscNativeOfs; + ++it; continue; } - UNATIVE_OFFSET nextNativeOfs = tmpMapping->ipmdNativeLoc.CodeOffset(GetEmitter()); + // If we have a previous offset we should have a previous mapping. + assert(it != compiler->genIPmappings.begin()); + jitstd::list::iterator prev = it; + --prev; - if (nextNativeOfs != lastNativeOfs) + // Prev and current mappings have same native offset. + // If one does not map to IL then remove that one. + if (prev->ipmdKind == IPmappingDscKind::NoMapping) { - mappingCnt++; - lastNativeOfs = nextNativeOfs; - prevMapping = tmpMapping; + compiler->genIPmappings.erase(prev); + ++it; continue; } - /* If there are mappings with the same native offset, then: - o If one of them is NO_MAPPING, ignore it - o If one of them is a label, report that and ignore the other one - o Else report the higher IL offset - */ - - PREFIX_ASSUME(prevMapping != nullptr); // We would exit before if this was true - if (prevMapping->ipmdILoffsx == (IL_OFFSETX)ICorDebugInfo::NO_MAPPING) - { - // If the previous entry was NO_MAPPING, ignore it - prevMapping->ipmdNativeLoc.Init(); - prevMapping = tmpMapping; - } - else if (srcIP == (IL_OFFSETX)ICorDebugInfo::NO_MAPPING) - { - // If the current entry is NO_MAPPING, ignore it - // Leave prevMapping unchanged as tmpMapping is no longer valid - tmpMapping->ipmdNativeLoc.Init(); - } - else if (srcIP == (IL_OFFSETX)ICorDebugInfo::EPILOG || srcIP == 0) + if (it->ipmdKind == IPmappingDscKind::NoMapping) { - // counting for special cases: see below - mappingCnt++; - prevMapping = tmpMapping; + it = compiler->genIPmappings.erase(it); + continue; } - else - { - noway_assert(prevMapping != nullptr); - noway_assert(!prevMapping->ipmdNativeLoc.Valid() || - lastNativeOfs == prevMapping->ipmdNativeLoc.CodeOffset(GetEmitter())); - /* The previous block had the same native offset. We have to - discard one of the mappings. Simply reinitialize ipmdNativeLoc - and prevMapping will be ignored later. */ - - if (prevMapping->ipmdIsLabel) - { - // Leave prevMapping unchanged as tmpMapping is no longer valid - tmpMapping->ipmdNativeLoc.Init(); - } - else - { - prevMapping->ipmdNativeLoc.Init(); - prevMapping = tmpMapping; - } + // Both have mappings. + // If previous is the prolog, keep both if this one is at IL offset 0. + // (TODO: Why? Debugger has no problem breaking on the prolog mapping + // it seems.) + if ((prev->ipmdKind == IPmappingDscKind::Prolog) && (it->ipmdKind == IPmappingDscKind::Normal) && + (it->ipmdLoc.GetOffset() == 0)) + { + ++it; + continue; } - } - - /* Tell them how many mapping records we've got */ - compiler->eeSetLIcount(mappingCnt); - - /* Now tell them about the mappings */ - - mappingCnt = 0; - lastNativeOfs = UNATIVE_OFFSET(~0); - - for (tmpMapping = compiler->genIPmappingList; tmpMapping != nullptr; tmpMapping = tmpMapping->ipmdNext) - { - // Do we have to skip this record ? - if (!tmpMapping->ipmdNativeLoc.Valid()) + // For the special case of an IL instruction with no body followed by + // the epilog (say ret void immediately preceding the method end), we + // leave both entries in, so that we'll stop at the (empty) ret + // statement if the user tries to put a breakpoint there, and then have + // the option of seeing the epilog or not based on SetUnmappedStopMask + // for the stepper. + if (it->ipmdKind == IPmappingDscKind::Epilog) { + ++it; continue; } - UNATIVE_OFFSET nextNativeOfs = tmpMapping->ipmdNativeLoc.CodeOffset(GetEmitter()); - IL_OFFSETX srcIP = tmpMapping->ipmdILoffsx; - - if (jitIsCallInstruction(srcIP)) + // For managed return values we store all calls. Keep both in this case + // too. + if (((prev->ipmdKind == IPmappingDscKind::Normal) && (prev->ipmdLoc.IsCall())) || + ((it->ipmdKind == IPmappingDscKind::Normal) && (it->ipmdLoc.IsCall()))) { - compiler->eeSetLIinfo(mappingCnt++, nextNativeOfs, jitGetILoffs(srcIP), jitIsStackEmpty(srcIP), true); + ++it; + continue; } - else if (nextNativeOfs != lastNativeOfs) + + // Otherwise report the higher offset unless the previous mapping is a + // label. + if (prev->ipmdIsLabel) { - compiler->eeSetLIinfo(mappingCnt++, nextNativeOfs, jitGetILoffsAny(srcIP), jitIsStackEmpty(srcIP), false); - lastNativeOfs = nextNativeOfs; + it = compiler->genIPmappings.erase(it); } - else if (srcIP == (IL_OFFSETX)ICorDebugInfo::EPILOG || srcIP == 0) + else { - // For the special case of an IL instruction with no body - // followed by the epilog (say ret void immediately preceding - // the method end), we put two entries in, so that we'll stop - // at the (empty) ret statement if the user tries to put a - // breakpoint there, and then have the option of seeing the - // epilog or not based on SetUnmappedStopMask for the stepper. - compiler->eeSetLIinfo(mappingCnt++, nextNativeOfs, jitGetILoffsAny(srcIP), jitIsStackEmpty(srcIP), false); + compiler->genIPmappings.erase(prev); + ++it; } } + // Tell them how many mapping records we've got + + compiler->eeSetLIcount(static_cast(compiler->genIPmappings.size())); + + // Now tell them about the mappings + unsigned int mappingIdx = 0; + for (const IPmappingDsc& dsc : compiler->genIPmappings) + { + compiler->eeSetLIinfo(mappingIdx++, dsc.ipmdNativeLoc.CodeOffset(GetEmitter()), dsc.ipmdKind, dsc.ipmdLoc); + } + #if 0 // TODO-Review: //This check is disabled. It is always true that any time this check asserts, the debugger would have a @@ -10899,12 +10675,12 @@ void CodeGen::genIPmappingGen() if ((block->bbRefs > 1) && (stmt != nullptr)) { bool found = false; - if (stmt->GetILOffsetX() != BAD_IL_OFFSET) + DebugInfo rootInfo = stmt->GetDebugInfo().GetRoot(); + if (rootInfo.IsValid()) { - IL_OFFSET ilOffs = jitGetILoffs(stmt->GetILOffsetX()); - for (unsigned i = 0; i < eeBoundariesCount; ++i) + for (unsigned i = 0; i < compiler->eeBoundariesCount; ++i) { - if (eeBoundaries[i].ilOffset == ilOffs) + if (compiler->eeBoundaries[i].ilOffset == rootInfo.GetLocation().GetOffset()) { found = true; break; @@ -10920,6 +10696,87 @@ void CodeGen::genIPmappingGen() compiler->eeSetLIdone(); } +#ifdef DEBUG +void CodeGen::genDumpPreciseDebugInfoInlineTree(FILE* file, InlineContext* context, bool* first) +{ + if (context->GetSibling() != nullptr) + { + genDumpPreciseDebugInfoInlineTree(file, context->GetSibling(), first); + } + + if (context->IsSuccess()) + { + if (!*first) + { + fprintf(file, ","); + } + + *first = false; + + fprintf(file, "{\"Ordinal\":%u,", context->GetOrdinal()); + fprintf(file, "\"MethodID\":%lld,", (INT64)context->GetCallee()); + const char* className; + const char* methodName = compiler->eeGetMethodName(context->GetCallee(), &className); + fprintf(file, "\"MethodName\":\"%s\",", methodName); + fprintf(file, "\"Inlinees\":["); + if (context->GetChild() != nullptr) + { + bool childFirst = true; + genDumpPreciseDebugInfoInlineTree(file, context->GetChild(), &childFirst); + } + fprintf(file, "]}"); + } +} + +void CodeGen::genDumpPreciseDebugInfo() +{ + if (JitConfig.JitDumpPreciseDebugInfoFile() == nullptr) + return; + + static CritSecObject s_critSect; + CritSecHolder holder(s_critSect); + + FILE* file = _wfopen(JitConfig.JitDumpPreciseDebugInfoFile(), W("a")); + if (file == nullptr) + return; + + // MethodID in ETW events are the method handles. + fprintf(file, "{\"MethodID\":%lld,", (INT64)compiler->info.compMethodHnd); + // Print inline tree. + fprintf(file, "\"InlineTree\":"); + + bool first = true; + genDumpPreciseDebugInfoInlineTree(file, compiler->compInlineContext, &first); + fprintf(file, ",\"Mappings\":["); + first = true; + for (PreciseIPMapping& mapping : compiler->genPreciseIPmappings) + { + if (!first) + { + fprintf(file, ","); + } + + first = false; + + fprintf(file, "{\"NativeOffset\":%u,\"InlineContext\":%u,\"ILOffset\":%u}", + mapping.nativeLoc.CodeOffset(GetEmitter()), mapping.debugInfo.GetInlineContext()->GetOrdinal(), + mapping.debugInfo.GetLocation().GetOffset()); + } + + fprintf(file, "]}\n"); + + fclose(file); +} + +void CodeGen::genAddPreciseIPMappingHere(const DebugInfo& di) +{ + PreciseIPMapping mapping; + mapping.nativeLoc.CaptureLocation(GetEmitter()); + mapping.debugInfo = di; + compiler->genPreciseIPmappings.push_back(mapping); +} +#endif + /*============================================================================ * * These are empty stubs to help the late dis-assembler to compile @@ -11262,7 +11119,7 @@ void CodeGen::genStructReturn(GenTree* treeNode) LclVarDsc* varDsc = nullptr; if (actualOp1->OperIs(GT_LCL_VAR)) { - varDsc = compiler->lvaGetDesc(actualOp1->AsLclVar()->GetLclNum()); + varDsc = compiler->lvaGetDesc(actualOp1->AsLclVar()); retTypeDesc.InitializeStructReturnType(compiler, varDsc->GetStructHnd(), compiler->info.compCallConv); assert(varDsc->lvIsMultiRegRet); } @@ -11291,7 +11148,7 @@ void CodeGen::genStructReturn(GenTree* treeNode) else if (actualOp1->OperIs(GT_LCL_VAR) && !actualOp1->AsLclVar()->IsMultiReg()) { GenTreeLclVar* lclNode = actualOp1->AsLclVar(); - LclVarDsc* varDsc = compiler->lvaGetDesc(lclNode->GetLclNum()); + LclVarDsc* varDsc = compiler->lvaGetDesc(lclNode); assert(varDsc->lvIsMultiRegRet); int offset = 0; for (unsigned i = 0; i < regCount; ++i) @@ -11673,7 +11530,7 @@ regNumber CodeGen::genRegCopy(GenTree* treeNode, unsigned multiRegIndex) var_types type; if (op1->IsMultiRegLclVar()) { - LclVarDsc* parentVarDsc = compiler->lvaGetDesc(op1->AsLclVar()->GetLclNum()); + LclVarDsc* parentVarDsc = compiler->lvaGetDesc(op1->AsLclVar()); unsigned fieldVarNum = parentVarDsc->lvFieldLclStart + multiRegIndex; LclVarDsc* fieldVarDsc = compiler->lvaGetDesc(fieldVarNum); type = fieldVarDsc->TypeGet(); @@ -11728,8 +11585,8 @@ void CodeGen::genStackPointerCheck(bool doStackPointerCheck, unsigned lvaStackPo { if (doStackPointerCheck) { - noway_assert(lvaStackPointerVar != 0xCCCCCCCC && compiler->lvaTable[lvaStackPointerVar].lvDoNotEnregister && - compiler->lvaTable[lvaStackPointerVar].lvOnFrame); + noway_assert(lvaStackPointerVar != 0xCCCCCCCC && compiler->lvaGetDesc(lvaStackPointerVar)->lvDoNotEnregister && + compiler->lvaGetDesc(lvaStackPointerVar)->lvOnFrame); GetEmitter()->emitIns_S_R(INS_cmp, EA_PTRSIZE, REG_SPBASE, lvaStackPointerVar, 0); BasicBlock* sp_check = genCreateTempLabel(); @@ -12565,7 +12422,19 @@ void CodeGenInterface::VariableLiveKeeper::dumpLvaVariableLiveRanges() const void CodeGen::genPoisonFrame(regMaskTP regLiveIn) { assert(compiler->compShouldPoisonFrame()); - assert((regLiveIn & genRegMask(REG_SCRATCH)) == 0); +#if defined(TARGET_XARCH) + regNumber poisonValReg = REG_EAX; + assert((regLiveIn & (RBM_EDI | RBM_ECX | RBM_EAX)) == 0); +#else + regNumber poisonValReg = REG_SCRATCH; + assert((regLiveIn & (genRegMask(REG_SCRATCH) | RBM_ARG_0 | RBM_ARG_1 | RBM_ARG_2)) == 0); +#endif + +#ifdef TARGET_64BIT + const ssize_t poisonVal = (ssize_t)0xcdcdcdcdcdcdcdcd; +#else + const ssize_t poisonVal = (ssize_t)0xcdcdcdcd; +#endif // The first time we need to poison something we will initialize a register to the largest immediate cccccccc that // we can fit. @@ -12580,39 +12449,63 @@ void CodeGen::genPoisonFrame(regMaskTP regLiveIn) assert(varDsc->lvOnFrame); - if (!hasPoisonImm) + unsigned int size = compiler->lvaLclSize(varNum); + if ((size / TARGET_POINTER_SIZE) > 16) { -#ifdef TARGET_64BIT - instGen_Set_Reg_To_Imm(EA_8BYTE, REG_SCRATCH, (ssize_t)0xcdcdcdcdcdcdcdcd); + // This will require more than 16 instructions, switch to rep stosd/memset call. + CLANG_FORMAT_COMMENT_ANCHOR; +#if defined(TARGET_XARCH) + GetEmitter()->emitIns_R_S(INS_lea, EA_PTRSIZE, REG_EDI, (int)varNum, 0); + assert(size % 4 == 0); + instGen_Set_Reg_To_Imm(EA_4BYTE, REG_ECX, size / 4); + // On xarch we can leave the value in eax and only set eax once + // since rep stosd does not kill eax. + if (!hasPoisonImm) + { + instGen_Set_Reg_To_Imm(EA_PTRSIZE, REG_EAX, poisonVal); + hasPoisonImm = true; + } + instGen(INS_r_stosd); #else - instGen_Set_Reg_To_Imm(EA_4BYTE, REG_SCRATCH, (ssize_t)0xcdcdcdcd); + GetEmitter()->emitIns_R_S(INS_lea, EA_PTRSIZE, REG_ARG_0, (int)varNum, 0); + instGen_Set_Reg_To_Imm(EA_4BYTE, REG_ARG_1, static_cast(poisonVal)); + instGen_Set_Reg_To_Imm(EA_4BYTE, REG_ARG_2, size); + genEmitHelperCall(CORINFO_HELP_MEMSET, 0, EA_UNKNOWN); + // May kill REG_SCRATCH, so we need to reload it. + hasPoisonImm = false; #endif - hasPoisonImm = true; } + else + { + if (!hasPoisonImm) + { + instGen_Set_Reg_To_Imm(EA_PTRSIZE, poisonValReg, poisonVal); + hasPoisonImm = true; + } // For 64-bit we check if the local is 8-byte aligned. For 32-bit, we assume everything is always 4-byte aligned. #ifdef TARGET_64BIT - bool fpBased; - int addr = compiler->lvaFrameAddress((int)varNum, &fpBased); + bool fpBased; + int addr = compiler->lvaFrameAddress((int)varNum, &fpBased); #else - int addr = 0; + int addr = 0; #endif - int size = (int)compiler->lvaLclSize(varNum); - int end = addr + size; - for (int offs = addr; offs < end;) - { -#ifdef TARGET_64BIT - if ((offs % 8) == 0 && end - offs >= 8) + int end = addr + (int)size; + for (int offs = addr; offs < end;) { - GetEmitter()->emitIns_S_R(ins_Store(TYP_LONG), EA_8BYTE, REG_SCRATCH, (int)varNum, offs - addr); - offs += 8; - continue; - } +#ifdef TARGET_64BIT + if ((offs % 8) == 0 && end - offs >= 8) + { + GetEmitter()->emitIns_S_R(ins_Store(TYP_LONG), EA_8BYTE, REG_SCRATCH, (int)varNum, offs - addr); + offs += 8; + continue; + } #endif - assert((offs % 4) == 0 && end - offs >= 4); - GetEmitter()->emitIns_S_R(ins_Store(TYP_INT), EA_4BYTE, REG_SCRATCH, (int)varNum, offs - addr); - offs += 4; + assert((offs % 4) == 0 && end - offs >= 4); + GetEmitter()->emitIns_S_R(ins_Store(TYP_INT), EA_4BYTE, REG_SCRATCH, (int)varNum, offs - addr); + offs += 4; + } } } } diff --git a/src/coreclr/jit/codegenlinear.cpp b/src/coreclr/jit/codegenlinear.cpp index e0f48954c65cd3..38ac9a92d86d4a 100644 --- a/src/coreclr/jit/codegenlinear.cpp +++ b/src/coreclr/jit/codegenlinear.cpp @@ -174,6 +174,7 @@ void CodeGen::genCodeForBBlist() for (block = compiler->fgFirstBB; block != nullptr; block = block->bbNext) { + #ifdef DEBUG if (compiler->verbose) { @@ -343,8 +344,8 @@ void CodeGen::genCodeForBBlist() #if FEATURE_LOOP_ALIGN if (GetEmitter()->emitEndsWithAlignInstr()) { - // we had better be planning on starting a new IG - assert(needLabel); + // Force new label if current IG ends with an align instruction. + needLabel = true; } #endif @@ -376,7 +377,7 @@ void CodeGen::genCodeForBBlist() !compiler->fgBBisScratch(block)) // If the block is the distinguished first scratch block, then no need to // emit a NO_MAPPING entry, immediately after the prolog. { - genIPmappingAdd((IL_OFFSETX)ICorDebugInfo::NO_MAPPING, true); + genIPmappingAdd(IPmappingDscKind::NoMapping, DebugInfo(), true); } bool firstMapping = true; @@ -423,20 +424,33 @@ void CodeGen::genCodeForBBlist() } } } + + bool addPreciseMappings = + (JitConfig.JitDumpPreciseDebugInfoFile() != nullptr) || (JitConfig.JitDisasmWithDebugInfo() != 0); #endif // DEBUG - IL_OFFSETX currentILOffset = BAD_IL_OFFSET; + DebugInfo currentDI; for (GenTree* node : LIR::AsRange(block)) { // Do we have a new IL offset? if (node->OperGet() == GT_IL_OFFSET) { GenTreeILOffset* ilOffset = node->AsILOffset(); - genEnsureCodeEmitted(currentILOffset); - currentILOffset = ilOffset->gtStmtILoffsx; - genIPmappingAdd(currentILOffset, firstMapping); - firstMapping = false; + DebugInfo rootDI = ilOffset->gtStmtDI.GetRoot(); + if (rootDI.IsValid()) + { + genEnsureCodeEmitted(currentDI); + currentDI = rootDI; + genIPmappingAdd(IPmappingDscKind::Normal, currentDI, firstMapping); + firstMapping = false; + } + #ifdef DEBUG + if (addPreciseMappings && ilOffset->gtStmtDI.IsValid()) + { + genAddPreciseIPMappingHere(ilOffset->gtStmtDI); + } + assert(ilOffset->gtStmtLastILoffs <= compiler->info.compILCodeSize || ilOffset->gtStmtLastILoffs == BAD_IL_OFFSET); @@ -529,7 +543,7 @@ void CodeGen::genCodeForBBlist() // // This can lead to problems when debugging the generated code. To prevent these issues, make sure // we've generated code for the last IL offset we saw in the block. - genEnsureCodeEmitted(currentILOffset); + genEnsureCodeEmitted(currentDI); /* Is this the last block, and are there any open scopes left ? */ @@ -778,21 +792,29 @@ void CodeGen::genCodeForBBlist() } #if FEATURE_LOOP_ALIGN + if (block->hasAlign()) + { + // If this block has 'align' instruction in the end (identified by BBF_HAS_ALIGN), + // then need to add align instruction in the current "block". + // + // For non-adaptive alignment, add alignment instruction of size depending on the + // compJitAlignLoopBoundary. + // For adaptive alignment, alignment instruction will always be of 15 bytes for xarch + // and 16 bytes for arm64. + assert(ShouldAlignLoops()); - // If next block is the first block of a loop (identified by BBF_LOOP_ALIGN), - // then need to add align instruction in current "block". Also mark the - // corresponding IG with IGF_LOOP_ALIGN to know that there will be align - // instructions at the end of that IG. - // - // For non-adaptive alignment, add alignment instruction of size depending on the - // compJitAlignLoopBoundary. - // For adaptive alignment, alignment instruction will always be of 15 bytes. + GetEmitter()->emitLoopAlignment(DEBUG_ARG1(block->bbJumpKind == BBJ_ALWAYS)); + } if ((block->bbNext != nullptr) && (block->bbNext->isLoopAlign())) { - assert(ShouldAlignLoops()); - - GetEmitter()->emitLoopAlignment(); + if (compiler->opts.compJitHideAlignBehindJmp) + { + // The current IG is the one that is just before the IG having loop start. + // Establish a connection of recent align instruction emitted to the loop + // it actually is aligning using 'idaLoopHeadPredIG'. + GetEmitter()->emitConnectAlignInstrWithCurIG(); + } } #endif @@ -855,7 +877,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX void CodeGen::genSpillVar(GenTree* tree) { unsigned varNum = tree->AsLclVarCommon()->GetLclNum(); - LclVarDsc* varDsc = &(compiler->lvaTable[varNum]); + LclVarDsc* varDsc = compiler->lvaGetDesc(varNum); assert(varDsc->lvIsRegCandidate()); @@ -1184,7 +1206,7 @@ void CodeGen::genUnspillRegIfNeeded(GenTree* tree) unspillTree->gtFlags &= ~GTF_SPILLED; GenTreeLclVar* lcl = unspillTree->AsLclVar(); - LclVarDsc* varDsc = compiler->lvaGetDesc(lcl->GetLclNum()); + LclVarDsc* varDsc = compiler->lvaGetDesc(lcl); var_types spillType = varDsc->GetRegisterType(lcl); assert(spillType != TYP_UNDEF); @@ -1223,7 +1245,7 @@ void CodeGen::genUnspillRegIfNeeded(GenTree* tree) assert(tree == unspillTree); GenTreeLclVar* lclNode = unspillTree->AsLclVar(); - LclVarDsc* varDsc = compiler->lvaGetDesc(lclNode->GetLclNum()); + LclVarDsc* varDsc = compiler->lvaGetDesc(lclNode); unsigned regCount = varDsc->lvFieldCnt; for (unsigned i = 0; i < regCount; ++i) @@ -1453,7 +1475,7 @@ regNumber CodeGen::genConsumeReg(GenTree* tree) if (genIsRegCandidateLocal(tree)) { GenTreeLclVarCommon* lcl = tree->AsLclVarCommon(); - LclVarDsc* varDsc = &compiler->lvaTable[lcl->GetLclNum()]; + LclVarDsc* varDsc = compiler->lvaGetDesc(lcl); if (varDsc->GetRegNum() != REG_STK) { var_types regType = varDsc->GetRegisterType(lcl); @@ -1476,7 +1498,7 @@ regNumber CodeGen::genConsumeReg(GenTree* tree) assert(tree->gtHasReg()); GenTreeLclVarCommon* lcl = tree->AsLclVar(); - LclVarDsc* varDsc = &compiler->lvaTable[lcl->GetLclNum()]; + LclVarDsc* varDsc = compiler->lvaGetDesc(lcl); assert(varDsc->lvLRACandidate); if (varDsc->GetRegNum() == REG_STK) @@ -1497,7 +1519,7 @@ regNumber CodeGen::genConsumeReg(GenTree* tree) unsigned firstFieldVarNum = varDsc->lvFieldLclStart; for (unsigned i = 0; i < varDsc->lvFieldCnt; ++i) { - LclVarDsc* fldVarDsc = &(compiler->lvaTable[firstFieldVarNum + i]); + LclVarDsc* fldVarDsc = compiler->lvaGetDesc(firstFieldVarNum + i); assert(fldVarDsc->lvLRACandidate); regNumber reg; if (tree->OperIs(GT_COPY, GT_RELOAD) && (tree->AsCopyOrReload()->GetRegByIndex(i) != REG_NA)) @@ -1574,12 +1596,21 @@ void CodeGen::genConsumeRegs(GenTree* tree) { genConsumeAddress(tree); } +#ifdef TARGET_ARM64 + else if (tree->OperIs(GT_BFIZ)) + { + // Can be contained as part of LEA on ARM64 + GenTreeCast* cast = tree->gtGetOp1()->AsCast(); + assert(cast->isContained()); + genConsumeAddress(cast->CastOp()); + } +#endif else if (tree->OperIsLocalRead()) { // A contained lcl var must be living on stack and marked as reg optional, or not be a // register candidate. unsigned varNum = tree->AsLclVarCommon()->GetLclNum(); - LclVarDsc* varDsc = compiler->lvaTable + varNum; + LclVarDsc* varDsc = compiler->lvaGetDesc(varNum); noway_assert(varDsc->GetRegNum() == REG_STK); noway_assert(tree->IsRegOptional() || !varDsc->lvLRACandidate); @@ -1592,14 +1623,18 @@ void CodeGen::genConsumeRegs(GenTree* tree) else if (tree->OperIs(GT_HWINTRINSIC)) { // Only load/store HW intrinsics can be contained (and the address may also be contained). - HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(tree->AsHWIntrinsic()->gtHWIntrinsicId); + HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(tree->AsHWIntrinsic()->GetHWIntrinsicId()); assert((category == HW_Category_MemoryLoad) || (category == HW_Category_MemoryStore)); - int numArgs = HWIntrinsicInfo::lookupNumArgs(tree->AsHWIntrinsic()); - genConsumeAddress(tree->gtGetOp1()); + size_t numArgs = tree->AsHWIntrinsic()->GetOperandCount(); + genConsumeAddress(tree->AsHWIntrinsic()->Op(1)); if (category == HW_Category_MemoryStore) { - assert((numArgs == 2) && !tree->gtGetOp2()->isContained()); - genConsumeReg(tree->gtGetOp2()); + assert(numArgs == 2); + + GenTree* op2 = tree->AsHWIntrinsic()->Op(2); + assert(op2->isContained()); + + genConsumeReg(op2); } else { @@ -1643,7 +1678,6 @@ void CodeGen::genConsumeRegs(GenTree* tree) // Return Value: // None. // - void CodeGen::genConsumeOperands(GenTreeOp* tree) { GenTree* firstOp = tree->gtOp1; @@ -1659,54 +1693,25 @@ void CodeGen::genConsumeOperands(GenTreeOp* tree) } } -#ifdef FEATURE_HW_INTRINSICS +#if defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) //------------------------------------------------------------------------ -// genConsumeHWIntrinsicOperands: Do liveness update for the operands of a GT_HWINTRINSIC node +// genConsumeOperands: Do liveness update for the operands of a multi-operand node, +// currently GT_SIMD or GT_HWINTRINSIC // // Arguments: -// node - the GenTreeHWIntrinsic node whose operands will have their liveness updated. +// tree - the GenTreeMultiOp whose operands will have their liveness updated. // // Return Value: // None. // - -void CodeGen::genConsumeHWIntrinsicOperands(GenTreeHWIntrinsic* node) +void CodeGen::genConsumeMultiOpOperands(GenTreeMultiOp* tree) { - int numArgs = HWIntrinsicInfo::lookupNumArgs(node); - GenTree* op1 = node->gtGetOp1(); - if (op1 == nullptr) - { - assert((numArgs == 0) && (node->gtGetOp2() == nullptr)); - return; - } - if (op1->OperIs(GT_LIST)) - { - int foundArgs = 0; - assert(node->gtGetOp2() == nullptr); - for (GenTreeArgList* list = op1->AsArgList(); list != nullptr; list = list->Rest()) - { - GenTree* operand = list->Current(); - genConsumeRegs(operand); - foundArgs++; - } - assert(foundArgs == numArgs); - } - else + for (GenTree* operand : tree->Operands()) { - genConsumeRegs(op1); - GenTree* op2 = node->gtGetOp2(); - if (op2 != nullptr) - { - genConsumeRegs(op2); - assert(numArgs == 2); - } - else - { - assert(numArgs == 1); - } + genConsumeRegs(operand); } } -#endif // FEATURE_HW_INTRINSICS +#endif // defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) #if FEATURE_PUT_STRUCT_ARG_STK //------------------------------------------------------------------------ @@ -2246,7 +2251,7 @@ void CodeGen::genProduceReg(GenTree* tree) { assert(compiler->lvaEnregMultiRegVars); GenTreeLclVar* lclNode = tree->AsLclVar(); - LclVarDsc* varDsc = compiler->lvaGetDesc(lclNode->GetLclNum()); + LclVarDsc* varDsc = compiler->lvaGetDesc(lclNode); unsigned regCount = varDsc->lvFieldCnt; for (unsigned i = 0; i < regCount; i++) { @@ -2302,7 +2307,7 @@ void CodeGen::genEmitCall(int callType, X86_ARG(int argSize), emitAttr retSize MULTIREG_HAS_SECOND_GC_RET_ONLY_ARG(emitAttr secondRetSize), - IL_OFFSETX ilOffset, + const DebugInfo& di, regNumber base, bool isJump) { @@ -2324,7 +2329,7 @@ void CodeGen::genEmitCall(int callType, gcInfo.gcVarPtrSetCur, gcInfo.gcRegGCrefSetCur, gcInfo.gcRegByrefSetCur, - ilOffset, base, REG_NA, 0, 0, isJump); + di, base, REG_NA, 0, 0, isJump); } // clang-format on @@ -2340,7 +2345,7 @@ void CodeGen::genEmitCallIndir(int callType, X86_ARG(int argSize), emitAttr retSize MULTIREG_HAS_SECOND_GC_RET_ONLY_ARG(emitAttr secondRetSize), - IL_OFFSETX ilOffset, + const DebugInfo& di, bool isJump) { #if !defined(TARGET_X86) @@ -2365,7 +2370,7 @@ void CodeGen::genEmitCallIndir(int callType, gcInfo.gcVarPtrSetCur, gcInfo.gcRegGCrefSetCur, gcInfo.gcRegByrefSetCur, - ilOffset, + di, iReg, xReg, indir->Scale(), @@ -2553,7 +2558,7 @@ void CodeGen::genStoreLongLclVar(GenTree* treeNode) GenTreeLclVarCommon* lclNode = treeNode->AsLclVarCommon(); unsigned lclNum = lclNode->GetLclNum(); - LclVarDsc* varDsc = &(compiler->lvaTable[lclNum]); + LclVarDsc* varDsc = compiler->lvaGetDesc(lclNum); assert(varDsc->TypeGet() == TYP_LONG); assert(!varDsc->lvPromoted); GenTree* op1 = treeNode->AsOp()->gtOp1; @@ -2618,6 +2623,16 @@ void CodeGen::genCodeForJumpTrue(GenTreeOp* jtrue) condition = GenCondition(GenCondition::P); } + + if (relop->MarkedForSignJumpOpt()) + { + // If relop was previously marked for a signed jump check optimization because of SF flag + // reuse, replace jge/jl with jns/js. + + assert(relop->OperGet() == GT_LT || relop->OperGet() == GT_GE); + condition = (relop->OperGet() == GT_LT) ? GenCondition(GenCondition::S) : GenCondition(GenCondition::NS); + } + #endif inst_JCC(condition, compiler->compCurBB->bbJumpDest); diff --git a/src/coreclr/jit/codegenxarch.cpp b/src/coreclr/jit/codegenxarch.cpp index 128de7c9fcd5b3..7b50388ad3138b 100644 --- a/src/coreclr/jit/codegenxarch.cpp +++ b/src/coreclr/jit/codegenxarch.cpp @@ -167,8 +167,8 @@ void CodeGen::genEmitGSCookieCheck(bool pushReg) // we are generating GS cookie check after a GT_RETURN block. // Note: On Amd64 System V RDX is an arg register - REG_ARG_2 - as well // as return register for two-register-returned structs. - if (compiler->lvaKeepAliveAndReportThis() && compiler->lvaTable[compiler->info.compThisArg].lvIsInReg() && - (compiler->lvaTable[compiler->info.compThisArg].GetRegNum() == REG_ARG_0)) + if (compiler->lvaKeepAliveAndReportThis() && compiler->lvaGetDesc(compiler->info.compThisArg)->lvIsInReg() && + (compiler->lvaGetDesc(compiler->info.compThisArg)->GetRegNum() == REG_ARG_0)) { regGSCheck = REG_ARG_1; } @@ -1197,9 +1197,9 @@ void CodeGen::genFloatReturn(GenTree* treeNode) GenTree* op1 = treeNode->gtGetOp1(); // Spill the return value register from an XMM register to the stack, then load it on the x87 stack. // If it already has a home location, use that. Otherwise, we need a temp. - if (genIsRegCandidateLocal(op1) && compiler->lvaTable[op1->AsLclVarCommon()->GetLclNum()].lvOnFrame) + if (genIsRegCandidateLocal(op1) && compiler->lvaGetDesc(op1->AsLclVarCommon())->lvOnFrame) { - if (compiler->lvaTable[op1->AsLclVarCommon()->GetLclNum()].GetRegNum() != REG_STK) + if (compiler->lvaGetDesc(op1->AsLclVarCommon())->GetRegNum() != REG_STK) { op1->gtFlags |= GTF_SPILL; inst_TT_RV(ins_Store(op1->gtType, compiler->isSIMDTypeLocalAligned(op1->AsLclVarCommon()->GetLclNum())), @@ -1673,7 +1673,6 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode) // This is handled at the time we call genConsumeReg() on the GT_COPY break; - case GT_LIST: case GT_FIELD_LIST: // Should always be marked contained. assert(!"LIST, FIELD_LIST nodes should always be marked contained."); @@ -1853,7 +1852,7 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode) { #ifdef DEBUG char message[256]; - _snprintf_s(message, _countof(message), _TRUNCATE, "NYI: Unimplemented node type %s\n", + _snprintf_s(message, ArrLen(message), _TRUNCATE, "NYI: Unimplemented node type %s\n", GenTree::OpName(treeNode->OperGet())); NYIRAW(message); #endif @@ -2582,8 +2581,8 @@ void CodeGen::genLclHeap(GenTree* tree) if (compiler->opts.compStackCheckOnRet) { noway_assert(compiler->lvaReturnSpCheck != 0xCCCCCCCC && - compiler->lvaTable[compiler->lvaReturnSpCheck].lvDoNotEnregister && - compiler->lvaTable[compiler->lvaReturnSpCheck].lvOnFrame); + compiler->lvaGetDesc(compiler->lvaReturnSpCheck)->lvDoNotEnregister && + compiler->lvaGetDesc(compiler->lvaReturnSpCheck)->lvOnFrame); GetEmitter()->emitIns_S_R(ins_Store(TYP_I_IMPL), EA_PTRSIZE, REG_SPBASE, compiler->lvaReturnSpCheck, 0); } #endif @@ -3492,7 +3491,7 @@ void CodeGen::genClearStackVec3ArgUpperBits() for (unsigned varNum = 0; varNum < compiler->info.compArgsCount; varNum++) { - LclVarDsc* varDsc = &(compiler->lvaTable[varNum]); + const LclVarDsc* varDsc = compiler->lvaGetDesc(varNum); assert(varDsc->lvIsParam); // Does var has simd12 type? @@ -4960,10 +4959,10 @@ void CodeGen::genCodeForSwap(GenTreeOp* tree) assert(genIsRegCandidateLocal(tree->gtOp1) && genIsRegCandidateLocal(tree->gtOp2)); GenTreeLclVarCommon* lcl1 = tree->gtOp1->AsLclVarCommon(); - LclVarDsc* varDsc1 = &(compiler->lvaTable[lcl1->GetLclNum()]); + LclVarDsc* varDsc1 = compiler->lvaGetDesc(lcl1); var_types type1 = varDsc1->TypeGet(); GenTreeLclVarCommon* lcl2 = tree->gtOp2->AsLclVarCommon(); - LclVarDsc* varDsc2 = &(compiler->lvaTable[lcl2->GetLclNum()]); + LclVarDsc* varDsc2 = compiler->lvaGetDesc(lcl2); var_types type2 = varDsc2->TypeGet(); // We must have both int or both fp regs @@ -5258,8 +5257,8 @@ void CodeGen::genCall(GenTreeCall* call) if (compiler->opts.compStackCheckOnCall && call->gtCallType == CT_USER_FUNC) { noway_assert(compiler->lvaCallSpCheck != 0xCCCCCCCC && - compiler->lvaTable[compiler->lvaCallSpCheck].lvDoNotEnregister && - compiler->lvaTable[compiler->lvaCallSpCheck].lvOnFrame); + compiler->lvaGetDesc(compiler->lvaCallSpCheck)->lvDoNotEnregister && + compiler->lvaGetDesc(compiler->lvaCallSpCheck)->lvOnFrame); GetEmitter()->emitIns_S_R(ins_Store(TYP_I_IMPL), EA_PTRSIZE, REG_SPBASE, compiler->lvaCallSpCheck, 0); } #endif // defined(DEBUG) && defined(TARGET_X86) @@ -5384,8 +5383,8 @@ void CodeGen::genCall(GenTreeCall* call) if (compiler->opts.compStackCheckOnCall && call->gtCallType == CT_USER_FUNC) { noway_assert(compiler->lvaCallSpCheck != 0xCCCCCCCC && - compiler->lvaTable[compiler->lvaCallSpCheck].lvDoNotEnregister && - compiler->lvaTable[compiler->lvaCallSpCheck].lvOnFrame); + compiler->lvaGetDesc(compiler->lvaCallSpCheck)->lvDoNotEnregister && + compiler->lvaGetDesc(compiler->lvaCallSpCheck)->lvOnFrame); if (!call->CallerPop() && (stackArgBytes != 0)) { // ECX is trashed, so can be used to compute the expected SP. We saved the value of SP @@ -5506,11 +5505,11 @@ void CodeGen::genCallInstruction(GenTreeCall* call X86_ARG(target_ssize_t stackA // We don't want tail call helper calls that were converted from normal calls to get a record, // so we skip this hash table lookup logic in that case. - IL_OFFSETX ilOffset = BAD_IL_OFFSET; + DebugInfo di; - if (compiler->opts.compDbgInfo && compiler->genCallSite2ILOffsetMap != nullptr && !call->IsTailCall()) + if (compiler->opts.compDbgInfo && compiler->genCallSite2DebugInfoMap != nullptr && !call->IsTailCall()) { - (void)compiler->genCallSite2ILOffsetMap->Lookup(call, &ilOffset); + (void)compiler->genCallSite2DebugInfoMap->Lookup(call, &di); } CORINFO_SIG_INFO* sigInfo = nullptr; @@ -5562,7 +5561,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call X86_ARG(target_ssize_t stackA gcInfo.gcVarPtrSetCur, gcInfo.gcRegGCrefSetCur, gcInfo.gcRegByrefSetCur, - ilOffset, REG_VIRTUAL_STUB_TARGET, REG_NA, 1, 0); + di, REG_VIRTUAL_STUB_TARGET, REG_NA, 1, 0); // clang-format on } else @@ -5583,7 +5582,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call X86_ARG(target_ssize_t stackA X86_ARG(argSizeForEmitter), retSize MULTIREG_HAS_SECOND_GC_RET_ONLY_ARG(secondRetSize), - ilOffset, + di, REG_NA, call->IsFastTailCall()); // clang-format on @@ -5605,7 +5604,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call X86_ARG(target_ssize_t stackA X86_ARG(argSizeForEmitter), retSize MULTIREG_HAS_SECOND_GC_RET_ONLY_ARG(secondRetSize), - ilOffset, + di, call->IsFastTailCall()); // clang-format on } @@ -5631,7 +5630,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call X86_ARG(target_ssize_t stackA X86_ARG(argSizeForEmitter), retSize MULTIREG_HAS_SECOND_GC_RET_ONLY_ARG(secondRetSize), - ilOffset, + di, target->GetRegNum(), call->IsFastTailCall()); // clang-format on @@ -5661,7 +5660,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call X86_ARG(target_ssize_t stackA gcInfo.gcVarPtrSetCur, gcInfo.gcRegGCrefSetCur, gcInfo.gcRegByrefSetCur, - ilOffset, indirCellReg, REG_NA, 0, 0, + di, indirCellReg, REG_NA, 0, 0, call->IsFastTailCall()); // clang-format on } @@ -5678,7 +5677,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call X86_ARG(target_ssize_t stackA X86_ARG(argSizeForEmitter), retSize MULTIREG_HAS_SECOND_GC_RET_ONLY_ARG(secondRetSize), - ilOffset, + di, REG_NA, call->IsFastTailCall()); // clang-format on @@ -5718,7 +5717,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call X86_ARG(target_ssize_t stackA X86_ARG(argSizeForEmitter), retSize MULTIREG_HAS_SECOND_GC_RET_ONLY_ARG(secondRetSize), - ilOffset, + di, REG_NA, call->IsFastTailCall()); // clang-format on @@ -5753,16 +5752,16 @@ void CodeGen::genJmpMethod(GenTree* jmp) // But that would require us to deal with circularity while moving values around. Spilling // to stack makes the implementation simple, which is not a bad trade off given Jmp calls // are not frequent. - for (varNum = 0; (varNum < compiler->info.compArgsCount); varNum++) + for (varNum = 0; varNum < compiler->info.compArgsCount; varNum++) { - varDsc = compiler->lvaTable + varNum; + varDsc = compiler->lvaGetDesc(varNum); if (varDsc->lvPromoted) { noway_assert(varDsc->lvFieldCnt == 1); // We only handle one field here unsigned fieldVarNum = varDsc->lvFieldLclStart; - varDsc = compiler->lvaTable + fieldVarNum; + varDsc = compiler->lvaGetDesc(fieldVarNum); } noway_assert(varDsc->lvIsParam); @@ -5789,7 +5788,7 @@ void CodeGen::genJmpMethod(GenTree* jmp) // assert should hold. assert(varDsc->GetRegNum() != REG_STK); - assert(!varDsc->lvIsStructField || (compiler->lvaTable[varDsc->lvParentLcl].lvFieldCnt == 1)); + assert(!varDsc->lvIsStructField || (compiler->lvaGetDesc(varDsc->lvParentLcl)->lvFieldCnt == 1)); var_types storeType = varDsc->GetActualRegisterType(); // We own the memory and can use the full move. GetEmitter()->emitIns_S_R(ins_Store(storeType), emitTypeSize(storeType), varDsc->GetRegNum(), varNum, 0); @@ -5825,15 +5824,15 @@ void CodeGen::genJmpMethod(GenTree* jmp) // Next move any un-enregistered register arguments back to their register. regMaskTP fixedIntArgMask = RBM_NONE; // tracks the int arg regs occupying fixed args in case of a vararg method. unsigned firstArgVarNum = BAD_VAR_NUM; // varNum of the first argument in case of a vararg method. - for (varNum = 0; (varNum < compiler->info.compArgsCount); varNum++) + for (varNum = 0; varNum < compiler->info.compArgsCount; varNum++) { - varDsc = compiler->lvaTable + varNum; + varDsc = compiler->lvaGetDesc(varNum); if (varDsc->lvPromoted) { noway_assert(varDsc->lvFieldCnt == 1); // We only handle one field here unsigned fieldVarNum = varDsc->lvFieldLclStart; - varDsc = compiler->lvaTable + fieldVarNum; + varDsc = compiler->lvaGetDesc(fieldVarNum); } noway_assert(varDsc->lvIsParam); @@ -6227,11 +6226,18 @@ void CodeGen::genCompareInt(GenTree* treeNode) assert(genTypeSize(type) <= genTypeSize(TYP_I_IMPL)); // TYP_UINT and TYP_ULONG should not appear here, only small types can be unsigned assert(!varTypeIsUnsigned(type) || varTypeIsSmall(type)); + // Sign jump optimization should only be set the following check + assert((tree->gtFlags & GTF_RELOP_SJUMP_OPT) == 0); if (canReuseFlags && emit->AreFlagsSetToZeroCmp(op1->GetRegNum(), emitTypeSize(type), tree->OperGet())) { JITDUMP("Not emitting compare due to flags being already set\n"); } + else if (canReuseFlags && emit->AreFlagsSetForSignJumpOpt(op1->GetRegNum(), emitTypeSize(type), tree)) + { + JITDUMP("Not emitting compare due to sign being already set, follow up instr will transform jump\n"); + tree->gtFlags |= GTF_RELOP_SJUMP_OPT; + } else { emit->emitInsBinary(ins, emitTypeSize(type), op1, op2); @@ -7141,8 +7147,7 @@ void CodeGen::genSSE41RoundOp(GenTreeOp* treeNode) case GT_LCL_VAR: { - assert(srcNode->IsRegOptional() || - !compiler->lvaTable[srcNode->AsLclVar()->GetLclNum()].lvIsRegCandidate()); + assert(srcNode->IsRegOptional() || !compiler->lvaGetDesc(srcNode->AsLclVar())->lvIsRegCandidate()); varNum = srcNode->AsLclVar()->GetLclNum(); offset = 0; @@ -7256,7 +7261,7 @@ unsigned CodeGen::getBaseVarForPutArgStk(GenTree* treeNode) // Since it is a fast tail call, the existence of first incoming arg is guaranteed // because fast tail call requires that in-coming arg area of caller is >= out-going // arg area required for tail call. - LclVarDsc* varDsc = &(compiler->lvaTable[baseVarNum]); + LclVarDsc* varDsc = compiler->lvaGetDesc(baseVarNum); assert(varDsc != nullptr); #ifdef UNIX_AMD64_ABI @@ -8323,9 +8328,9 @@ void CodeGen::genCreateAndStoreGCInfoX64(unsigned codeSize, unsigned prologSize if (compiler->opts.IsReversePInvoke()) { unsigned reversePInvokeFrameVarNumber = compiler->lvaReversePInvokeFrameVar; - assert(reversePInvokeFrameVarNumber != BAD_VAR_NUM && reversePInvokeFrameVarNumber < compiler->lvaRefCount); - LclVarDsc& reversePInvokeFrameVar = compiler->lvaTable[reversePInvokeFrameVarNumber]; - gcInfoEncoder->SetReversePInvokeFrameSlot(reversePInvokeFrameVar.GetStackOffset()); + assert(reversePInvokeFrameVarNumber != BAD_VAR_NUM); + const LclVarDsc* reversePInvokeFrameVar = compiler->lvaGetDesc(reversePInvokeFrameVarNumber); + gcInfoEncoder->SetReversePInvokeFrameSlot(reversePInvokeFrameVar->GetStackOffset()); } gcInfoEncoder->Build(); @@ -8408,7 +8413,7 @@ void CodeGen::genEmitHelperCall(unsigned helper, int argSize, emitAttr retSize, gcInfo.gcVarPtrSetCur, gcInfo.gcRegGCrefSetCur, gcInfo.gcRegByrefSetCur, - BAD_IL_OFFSET, // IL offset + DebugInfo(), callTarget, // ireg REG_NA, 0, 0, // xreg, xmul, disp false // isJump @@ -8900,9 +8905,9 @@ void CodeGen::genProfilingLeaveCallback(unsigned helper) // If thisPtr needs to be kept alive and reported, it cannot be one of the callee trash // registers that profiler callback kills. - if (compiler->lvaKeepAliveAndReportThis() && compiler->lvaTable[compiler->info.compThisArg].lvIsInReg()) + if (compiler->lvaKeepAliveAndReportThis() && compiler->lvaGetDesc(compiler->info.compThisArg)->lvIsInReg()) { - regMaskTP thisPtrMask = genRegMask(compiler->lvaTable[compiler->info.compThisArg].GetRegNum()); + regMaskTP thisPtrMask = genRegMask(compiler->lvaGetDesc(compiler->info.compThisArg)->GetRegNum()); noway_assert((RBM_PROFILER_LEAVE_TRASH & thisPtrMask) == 0); } @@ -8941,7 +8946,7 @@ void CodeGen::genProfilingLeaveCallback(unsigned helper) // cannot use caller's SP offset since it is an estimate. For now we require the // method to have at least a single arg so that we can use it to obtain caller's // SP. - LclVarDsc* varDsc = compiler->lvaTable; + LclVarDsc* varDsc = compiler->lvaGetDesc(0U); NYI_IF((varDsc == nullptr) || !varDsc->lvIsParam, "Profiler ELT callback for a method without any params"); // lea rdx, [FramePointer + Arg0's offset] @@ -8974,7 +8979,7 @@ void CodeGen::genProfilingLeaveCallback(unsigned helper) } else { - LclVarDsc* varDsc = compiler->lvaTable; + LclVarDsc* varDsc = compiler->lvaGetDesc(0U); NYI_IF((varDsc == nullptr) || !varDsc->lvIsParam, "Profiler ELT callback for a method without any params"); // lea rdx, [FramePointer + Arg0's offset] diff --git a/src/coreclr/jit/compiler.cpp b/src/coreclr/jit/compiler.cpp index a26a003a455fb9..e56c96b026c0b1 100644 --- a/src/coreclr/jit/compiler.cpp +++ b/src/coreclr/jit/compiler.cpp @@ -174,128 +174,6 @@ void Compiler::JitLogEE(unsigned level, const char* fmt, ...) va_end(args); } -void Compiler::compDspSrcLinesByLineNum(unsigned line, bool seek) -{ - if (!jitSrcFilePtr) - { - return; - } - - if (jitCurSrcLine == line) - { - return; - } - - if (jitCurSrcLine > line) - { - if (!seek) - { - return; - } - - if (fseek(jitSrcFilePtr, 0, SEEK_SET) != 0) - { - printf("Compiler::compDspSrcLinesByLineNum: fseek returned an error.\n"); - } - jitCurSrcLine = 0; - } - - if (!seek) - { - printf(";\n"); - } - - do - { - char temp[128]; - size_t llen; - - if (!fgets(temp, sizeof(temp), jitSrcFilePtr)) - { - return; - } - - if (seek) - { - continue; - } - - llen = strlen(temp); - if (llen && temp[llen - 1] == '\n') - { - temp[llen - 1] = 0; - } - - printf("; %s\n", temp); - } while (++jitCurSrcLine < line); - - if (!seek) - { - printf(";\n"); - } -} - -/*****************************************************************************/ - -void Compiler::compDspSrcLinesByNativeIP(UNATIVE_OFFSET curIP) -{ - static IPmappingDsc* nextMappingDsc; - static unsigned lastLine; - - if (!opts.dspLines) - { - return; - } - - if (curIP == 0) - { - if (genIPmappingList) - { - nextMappingDsc = genIPmappingList; - lastLine = jitGetILoffs(nextMappingDsc->ipmdILoffsx); - - unsigned firstLine = jitGetILoffs(nextMappingDsc->ipmdILoffsx); - - unsigned earlierLine = (firstLine < 5) ? 0 : firstLine - 5; - - compDspSrcLinesByLineNum(earlierLine, true); // display previous 5 lines - compDspSrcLinesByLineNum(firstLine, false); - } - else - { - nextMappingDsc = nullptr; - } - - return; - } - - if (nextMappingDsc) - { - UNATIVE_OFFSET offset = nextMappingDsc->ipmdNativeLoc.CodeOffset(GetEmitter()); - - if (offset <= curIP) - { - IL_OFFSET nextOffs = jitGetILoffs(nextMappingDsc->ipmdILoffsx); - - if (lastLine < nextOffs) - { - compDspSrcLinesByLineNum(nextOffs); - } - else - { - // This offset corresponds to a previous line. Rewind to that line - - compDspSrcLinesByLineNum(nextOffs - 2, true); - compDspSrcLinesByLineNum(nextOffs); - } - - lastLine = nextOffs; - nextMappingDsc = nextMappingDsc->ipmdNext; - } - } -} - -/*****************************************************************************/ #endif // DEBUG /*****************************************************************************/ @@ -1969,6 +1847,11 @@ void Compiler::compInit(ArenaAllocator* pAlloc, impSpillCliquePredMembers = JitExpandArray(getAllocator()); impSpillCliqueSuccMembers = JitExpandArray(getAllocator()); + new (&genIPmappings, jitstd::placement_t()) jitstd::list(getAllocator(CMK_DebugInfo)); +#ifdef DEBUG + new (&genPreciseIPmappings, jitstd::placement_t()) jitstd::list(getAllocator(CMK_DebugOnly)); +#endif + lvMemoryPerSsaData = SsaDefArray(); // @@ -1995,6 +1878,8 @@ void Compiler::compInit(ArenaAllocator* pAlloc, compJmpOpUsed = false; compLongUsed = false; compTailCallUsed = false; + compTailPrefixSeen = false; + compLocallocSeen = false; compLocallocUsed = false; compLocallocOptimized = false; compQmarkRationalized = false; @@ -2616,7 +2501,6 @@ void Compiler::compInitOptions(JitFlags* jitFlags) assert(!jitFlags->IsSet(JitFlags::JIT_FLAG_BBINSTR)); assert(!jitFlags->IsSet(JitFlags::JIT_FLAG_PROF_ENTERLEAVE)); assert(!jitFlags->IsSet(JitFlags::JIT_FLAG_DEBUG_EnC)); - assert(!jitFlags->IsSet(JitFlags::JIT_FLAG_DEBUG_INFO)); assert(!jitFlags->IsSet(JitFlags::JIT_FLAG_REVERSE_PINVOKE)); assert(!jitFlags->IsSet(JitFlags::JIT_FLAG_TRACK_TRANSITIONS)); } @@ -2670,11 +2554,13 @@ void Compiler::compInitOptions(JitFlags* jitFlags) opts.compJitAlignLoopForJcc = JitConfig.JitAlignLoopForJcc() == 1; opts.compJitAlignLoopMaxCodeSize = (unsigned short)JitConfig.JitAlignLoopMaxCodeSize(); + opts.compJitHideAlignBehindJmp = JitConfig.JitHideAlignBehindJmp() == 1; #else opts.compJitAlignLoopAdaptive = true; opts.compJitAlignLoopBoundary = DEFAULT_ALIGN_LOOP_BOUNDARY; opts.compJitAlignLoopMinBlockWeight = DEFAULT_ALIGN_LOOP_MIN_BLOCK_WEIGHT; opts.compJitAlignLoopMaxCodeSize = DEFAULT_MAX_LOOPSIZE_FOR_ALIGN; + opts.compJitHideAlignBehindJmp = true; #endif #ifdef TARGET_XARCH @@ -2744,6 +2630,7 @@ void Compiler::compInitOptions(JitFlags* jitFlags) verboseSsa = verbose && shouldUseVerboseSsa(); asciiTrees = shouldDumpASCIITrees(); opts.dspDiffable = compIsForInlining() ? impInlineInfo->InlinerCompiler->opts.dspDiffable : false; + #endif opts.altJit = false; @@ -2899,6 +2786,18 @@ void Compiler::compInitOptions(JitFlags* jitFlags) verboseDump = (JitConfig.JitDumpTier0() > 0); } + // Optionally suppress dumping some OSR jit requests. + // + if (verboseDump && jitFlags->IsSet(JitFlags::JIT_FLAG_OSR)) + { + const int desiredOffset = JitConfig.JitDumpAtOSROffset(); + + if (desiredOffset != -1) + { + verboseDump = (((IL_OFFSET)desiredOffset) == info.compILEntry); + } + } + if (verboseDump) { verbose = true; @@ -3740,8 +3639,6 @@ bool Compiler::compPromoteFewerStructs(unsigned lclNum) void Compiler::compInitDebuggingInfo() { - assert(!compIsForInlining()); - #ifdef DEBUG if (verbose) { @@ -4539,8 +4436,8 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl if (info.compPublishStubParam) { assert(lvaStubArgumentVar == BAD_VAR_NUM); - lvaStubArgumentVar = lvaGrabTempWithImplicitUse(false DEBUGARG("stub argument")); - lvaTable[lvaStubArgumentVar].lvType = TYP_I_IMPL; + lvaStubArgumentVar = lvaGrabTempWithImplicitUse(false DEBUGARG("stub argument")); + lvaGetDesc(lvaStubArgumentVar)->lvType = TYP_I_IMPL; // TODO-CQ: there is no need to mark it as doNotEnreg. There are no stores for this local // before codegen so liveness and LSRA mark it as "liveIn" and always allocate a stack slot for it. // However, it would be better to process it like other argument locals and keep it in @@ -4571,6 +4468,10 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl // DoPhase(this, PHASE_IMPORTATION, &Compiler::fgImport); + // Expand any patchpoints + // + DoPhase(this, PHASE_PATCHPOINTS, &Compiler::fgTransformPatchpoints); + // If instrumenting, add block and class probes. // if (compileFlags->IsSet(JitFlags::JIT_FLAG_BBINSTR)) @@ -4582,10 +4483,6 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl // DoPhase(this, PHASE_INDXCALL, &Compiler::fgTransformIndirectCalls); - // Expand any patchpoints - // - DoPhase(this, PHASE_PATCHPOINTS, &Compiler::fgTransformPatchpoints); - // PostImportPhase: cleanup inlinees // auto postImportPhase = [this]() { @@ -4695,7 +4592,7 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl { for (unsigned i = 0; i < info.compArgsCount; i++) { - if (lvaTable[i].TypeGet() == TYP_REF) + if (lvaGetDesc(i)->TypeGet() == TYP_REF) { // confirm that the argument is a GC pointer (for debugging (GC stress)) GenTree* op = gtNewLclvNode(i, TYP_REF); @@ -4720,15 +4617,15 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl { lvaReturnSpCheck = lvaGrabTempWithImplicitUse(false DEBUGARG("ReturnSpCheck")); lvaSetVarDoNotEnregister(lvaReturnSpCheck, DoNotEnregisterReason::ReturnSpCheck); - lvaTable[lvaReturnSpCheck].lvType = TYP_I_IMPL; + lvaGetDesc(lvaReturnSpCheck)->lvType = TYP_I_IMPL; } #endif // defined(DEBUG) && defined(TARGET_XARCH) #if defined(DEBUG) && defined(TARGET_X86) if (opts.compStackCheckOnCall) { - lvaCallSpCheck = lvaGrabTempWithImplicitUse(false DEBUGARG("CallSpCheck")); - lvaTable[lvaCallSpCheck].lvType = TYP_I_IMPL; + lvaCallSpCheck = lvaGrabTempWithImplicitUse(false DEBUGARG("CallSpCheck")); + lvaGetDesc(lvaCallSpCheck)->lvType = TYP_I_IMPL; } #endif // defined(DEBUG) && defined(TARGET_X86) @@ -5001,14 +4898,12 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl // DoPhase(this, PHASE_COMPUTE_REACHABILITY, &Compiler::fgComputeReachability); - // Discover and classify natural loops - // (e.g. mark iterative loops as such). Also marks loop blocks - // and sets bbWeight to the loop nesting levels + // Discover and classify natural loops (e.g. mark iterative loops as such). Also marks loop blocks + // and sets bbWeight to the loop nesting levels. // DoPhase(this, PHASE_FIND_LOOPS, &Compiler::optFindLoops); - // Clone loops with optimization opportunities, and - // choose one based on dynamic condition evaluation. + // Clone loops with optimization opportunities, and choose one based on dynamic condition evaluation. // DoPhase(this, PHASE_CLONE_LOOPS, &Compiler::optCloneLoops); @@ -5266,6 +5161,11 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl fgDebugCheckLinks(); #endif +#if FEATURE_LOOP_ALIGN + // Place loop alignment instructions + DoPhase(this, PHASE_ALIGN_LOOPS, &Compiler::placeLoopAlignInstructions); +#endif + // Generate code codeGen->genGenerateCode(methodCodePtr, methodCodeSize); @@ -5322,6 +5222,83 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl #endif // FUNC_INFO_LOGGING } +#if FEATURE_LOOP_ALIGN + +//------------------------------------------------------------------------ +// placeLoopAlignInstructions: Iterate over all the blocks and determine +// the best position to place the 'align' instruction. Inserting 'align' +// instructions after an unconditional branch is preferred over inserting +// in the block before the loop. In case there are multiple blocks +// having 'jmp', the one that has lower weight is preferred. +// If the block having 'jmp' is hotter than the block before the loop, +// the align will still be placed after 'jmp' because the processor should +// be smart enough to not fetch extra instruction beyond jmp. +// +void Compiler::placeLoopAlignInstructions() +{ + if (loopAlignCandidates == 0) + { + return; + } + + int loopsToProcess = loopAlignCandidates; + JITDUMP("Inside placeLoopAlignInstructions for %d loops.\n", loopAlignCandidates); + + // Add align only if there were any loops that needed alignment + weight_t minBlockSoFar = BB_MAX_WEIGHT; + BasicBlock* bbHavingAlign = nullptr; + for (BasicBlock* const block : Blocks()) + { + if ((block == fgFirstBB) && block->isLoopAlign()) + { + // Adding align instruction in prolog is not supported + // hence skip the align block if it is the first block. + loopsToProcess--; + continue; + } + + // If there is a unconditional jump + if (opts.compJitHideAlignBehindJmp && (block->bbJumpKind == BBJ_ALWAYS)) + { + if (block->bbWeight < minBlockSoFar) + { + minBlockSoFar = block->bbWeight; + bbHavingAlign = block; + JITDUMP(FMT_BB ", bbWeight=" FMT_WT " ends with unconditional 'jmp' \n", block->bbNum, block->bbWeight); + } + } + + if ((block->bbNext != nullptr) && (block->bbNext->isLoopAlign())) + { + // If jmp was not found, then block before the loop start is where align instruction will be added. + if (bbHavingAlign == nullptr) + { + bbHavingAlign = block; + JITDUMP("Marking " FMT_BB " before the loop with BBF_HAS_ALIGN for loop at " FMT_BB "\n", block->bbNum, + block->bbNext->bbNum); + } + else + { + JITDUMP("Marking " FMT_BB " that ends with unconditional jump with BBF_HAS_ALIGN for loop at " FMT_BB + "\n", + bbHavingAlign->bbNum, block->bbNext->bbNum); + } + + bbHavingAlign->bbFlags |= BBF_HAS_ALIGN; + minBlockSoFar = BB_MAX_WEIGHT; + bbHavingAlign = nullptr; + + if (--loopsToProcess == 0) + { + break; + } + } + } + + assert(loopsToProcess == 0); +} +#endif + //------------------------------------------------------------------------ // generatePatchpointInfo: allocate and fill in patchpoint info data, // and report it to the VM @@ -5398,6 +5375,14 @@ void Compiler::generatePatchpointInfo() patchpointInfo->SecurityCookieOffset()); } + if (lvaMonAcquired != BAD_VAR_NUM) + { + LclVarDsc* const varDsc = lvaGetDesc(lvaMonAcquired); + patchpointInfo->SetMonitorAcquiredOffset(varDsc->GetStackOffset()); + JITDUMP("--OSR-- monitor acquired V%02u offset is FP %d\n", lvaMonAcquired, + patchpointInfo->MonitorAcquiredOffset()); + } + // Register this with the runtime. info.compCompHnd->setPatchpointInfo(patchpointInfo); } @@ -6207,7 +6192,8 @@ int Compiler::compCompileHelper(CORINFO_MODULE_HANDLE classPtr, assert((methAttr_Old & (~flagsToIgnore)) == (methAttr_New & (~flagsToIgnore))); #endif - info.compFlags = impInlineInfo->inlineCandidateInfo->methAttr; + info.compFlags = impInlineInfo->inlineCandidateInfo->methAttr; + compInlineContext = impInlineInfo->inlineContext; } else { @@ -6215,6 +6201,7 @@ int Compiler::compCompileHelper(CORINFO_MODULE_HANDLE classPtr, #ifdef PSEUDORANDOM_NOP_INSERTION info.compChecksum = getMethodBodyChecksum((char*)methodInfo->ILCode, methodInfo->ILCodeSize); #endif + compInlineContext = m_inlineStrategy->GetRootContext(); } compSwitchedToOptimized = false; @@ -6292,7 +6279,8 @@ int Compiler::compCompileHelper(CORINFO_MODULE_HANDLE classPtr, info.compTotalColdCodeSize = 0; info.compClassProbeCount = 0; - compHasBackwardJump = false; + compHasBackwardJump = false; + compHasBackwardJumpInHandler = false; #ifdef DEBUG compCurBB = nullptr; @@ -6352,10 +6340,7 @@ int Compiler::compCompileHelper(CORINFO_MODULE_HANDLE classPtr, lvaInitTypeRef(); - if (!compIsForInlining()) - { - compInitDebuggingInfo(); - } + compInitDebuggingInfo(); #ifdef DEBUG if (compIsForInlining()) @@ -6449,10 +6434,51 @@ int Compiler::compCompileHelper(CORINFO_MODULE_HANDLE classPtr, goto _Next; } - if (compHasBackwardJump && (info.compFlags & CORINFO_FLG_DISABLE_TIER0_FOR_LOOPS) != 0 && fgCanSwitchToOptimized()) + // We may decide to optimize this method, + // to avoid spending a long time stuck in Tier0 code. + // + if (fgCanSwitchToOptimized()) { - // Method likely has a loop, switch to the OptimizedTier to avoid spending too much time running slower code - fgSwitchToOptimized(); + // We only expect to be able to do this at Tier0. + // + assert(opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER0)); + + // Normal tiering should bail us out of Tier0 tail call induced loops. + // So keep these methods in Tier0 if we're gathering PGO data. + // If we're not gathering PGO, then switch these to optimized to + // minimize the number of tail call helper stubs we might need. + // Reconsider this if/when we're able to share those stubs. + // + // Honor the config setting that tells the jit to + // always optimize methods with loops. + // + // If that's not set, and OSR is enabled, the jit may still + // decide to optimize, if there's something in the method that + // OSR currently cannot handle. + // + const char* reason = nullptr; + + if (compTailPrefixSeen && !opts.jitFlags->IsSet(JitFlags::JIT_FLAG_BBINSTR)) + { + reason = "tail.call and not BBINSTR"; + } + else if ((info.compFlags & CORINFO_FLG_DISABLE_TIER0_FOR_LOOPS) != 0) + { + if (compHasBackwardJump) + { + reason = "loop"; + } + } + else if (JitConfig.TC_OnStackReplacement() > 0) + { + const bool patchpointsOK = compCanHavePatchpoints(&reason); + assert(patchpointsOK || (reason != nullptr)); + } + + if (reason != nullptr) + { + fgSwitchToOptimized(reason); + } } compSetOptimizationLevel(); @@ -6500,9 +6526,21 @@ int Compiler::compCompileHelper(CORINFO_MODULE_HANDLE classPtr, #ifdef DEBUG if ((JitConfig.DumpJittedMethods() == 1) && !compIsForInlining()) { + enum + { + BUFSIZE = 20 + }; + char osrBuffer[BUFSIZE] = {0}; + if (opts.IsOSR()) + { + // Tiering name already includes "OSR", we just want the IL offset + // + sprintf_s(osrBuffer, BUFSIZE, " @0x%x", info.compILEntry); + } + printf("Compiling %4d %s::%s, IL size = %u, hash=0x%08x %s%s%s\n", Compiler::jitTotalMethodCompiled, info.compClassName, info.compMethodName, info.compILCodeSize, info.compMethodHash(), - compGetTieringName(), opts.IsOSR() ? " OSR" : "", compGetStressMessage()); + compGetTieringName(), osrBuffer, compGetStressMessage()); } if (compIsForInlining()) { @@ -7753,9 +7791,9 @@ CompTimeInfo::CompTimeInfo(unsigned byteCodeBytes) } #if MEASURE_CLRAPI_CALLS - assert(ARRAYSIZE(m_perClrAPIcalls) == API_ICorJitInfo_Names::API_COUNT); - assert(ARRAYSIZE(m_perClrAPIcycles) == API_ICorJitInfo_Names::API_COUNT); - assert(ARRAYSIZE(m_maxClrAPIcycles) == API_ICorJitInfo_Names::API_COUNT); + assert(ArrLen(m_perClrAPIcalls) == API_ICorJitInfo_Names::API_COUNT); + assert(ArrLen(m_perClrAPIcycles) == API_ICorJitInfo_Names::API_COUNT); + assert(ArrLen(m_maxClrAPIcycles) == API_ICorJitInfo_Names::API_COUNT); for (int i = 0; i < API_ICorJitInfo_Names::API_COUNT; i++) { m_perClrAPIcalls[i] = 0; @@ -7931,7 +7969,7 @@ void CompTimeSummaryInfo::Print(FILE* f) extraHdr2); // Ensure that at least the names array and the Phases enum have the same number of entries: - assert(_countof(PhaseNames) == PHASE_NUMBER_OF); + assert(ArrLen(PhaseNames) == PHASE_NUMBER_OF); for (int i = 0; i < PHASE_NUMBER_OF; i++) { double phase_tot_ms = (((double)m_total.m_cyclesByPhase[i]) / countsPerSec) * 1000.0; @@ -7994,7 +8032,7 @@ void CompTimeSummaryInfo::Print(FILE* f) fprintf(f, " PHASE inv/meth Mcycles time (ms) %% of total\n"); fprintf(f, " --------------------------------------------------------------------------------------\n"); // Ensure that at least the names array and the Phases enum have the same number of entries: - assert(_countof(PhaseNames) == PHASE_NUMBER_OF); + assert(ArrLen(PhaseNames) == PHASE_NUMBER_OF); for (int i = 0; i < PHASE_NUMBER_OF; i++) { double phase_tot_ms = (((double)m_filtered.m_cyclesByPhase[i]) / countsPerSec) * 1000.0; @@ -8726,7 +8764,7 @@ void cVarDsc(Compiler* comp, LclVarDsc* varDsc) { static unsigned sequenceNumber = 0; // separate calls with a number to indicate this function has been called printf("===================================================================== *VarDsc %u\n", sequenceNumber++); - unsigned lclNum = (unsigned)(varDsc - comp->lvaTable); + unsigned lclNum = comp->lvaGetLclNum(varDsc); comp->lvaDumpEntry(lclNum, Compiler::FINAL_FRAME_LAYOUT); } @@ -8800,7 +8838,6 @@ void cLoop(Compiler* comp, Compiler::LoopDsc* loop) static unsigned sequenceNumber = 0; // separate calls with a number to indicate this function has been called printf("===================================================================== Loop %u\n", sequenceNumber++); printf("HEAD " FMT_BB "\n", loop->lpHead->bbNum); - printf("FIRST " FMT_BB "\n", loop->lpFirst->bbNum); printf("TOP " FMT_BB "\n", loop->lpTop->bbNum); printf("ENTRY " FMT_BB "\n", loop->lpEntry->bbNum); if (loop->lpExitCnt == 1) @@ -8949,8 +8986,6 @@ BasicBlock* dbBlock; GenTree* dFindTree(GenTree* tree, unsigned id) { - GenTree* child; - if (tree == nullptr) { return nullptr; @@ -8962,18 +8997,13 @@ GenTree* dFindTree(GenTree* tree, unsigned id) return tree; } - unsigned childCount = tree->NumChildren(); - for (unsigned childIndex = 0; childIndex < childCount; childIndex++) - { - child = tree->GetChild(childIndex); + GenTree* child = nullptr; + tree->VisitOperands([&child, id](GenTree* operand) -> GenTree::VisitResult { child = dFindTree(child, id); - if (child != nullptr) - { - return child; - } - } + return (child != nullptr) ? GenTree::VisitResult::Abort : GenTree::VisitResult::Continue; + }); - return nullptr; + return child; } GenTree* dFindTree(unsigned id) @@ -9252,10 +9282,6 @@ void cTreeFlags(Compiler* comp, GenTree* tree) { chars += printf("[RELOP_JMP_USED]"); } - if (tree->gtFlags & GTF_RELOP_QMARK) - { - chars += printf("[RELOP_QMARK]"); - } break; case GT_QMARK: @@ -9277,7 +9303,7 @@ void cTreeFlags(Compiler* comp, GenTree* tree) case GT_CNS_INT: { - unsigned handleKind = (tree->gtFlags & GTF_ICON_HDL_MASK); + GenTreeFlags handleKind = (tree->gtFlags & GTF_ICON_HDL_MASK); switch (handleKind) { @@ -9361,6 +9387,10 @@ void cTreeFlags(Compiler* comp, GenTree* tree) chars += printf("[ICON_FIELD_OFF]"); break; + + default: + assert(!"a forgotten handle flag"); + break; } } break; @@ -9517,7 +9547,7 @@ void cTreeFlags(Compiler* comp, GenTree* tree) default: { - unsigned flags = (tree->gtFlags & (~(unsigned)(GTF_COMMON_MASK | GTF_OVERFLOW))); + GenTreeFlags flags = (tree->gtFlags & (~(GTF_COMMON_MASK | GTF_OVERFLOW))); if (flags != 0) { chars += printf("[%08X]", flags); diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index cd46b491ea95ea..cbd45e04c319ba 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -27,6 +27,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #include "jitstd.h" #include "jithashtable.h" #include "gentree.h" +#include "debuginfo.h" #include "lir.h" #include "block.h" #include "inline.h" @@ -41,7 +42,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #include "jitexpandarray.h" #include "tinyarray.h" #include "valuenum.h" -#include "reglist.h" #include "jittelemetry.h" #include "namedintrinsiclist.h" #ifdef LATE_DISASM @@ -2515,6 +2515,30 @@ inline LoopFlags& operator&=(LoopFlags& a, LoopFlags b) return a = (LoopFlags)((unsigned short)a & (unsigned short)b); } +// The following holds information about instr offsets in terms of generated code. + +enum class IPmappingDscKind +{ + Prolog, // The mapping represents the start of a prolog. + Epilog, // The mapping represents the start of an epilog. + NoMapping, // This does not map to any IL offset. + Normal, // The mapping maps to an IL offset. +}; + +struct IPmappingDsc +{ + emitLocation ipmdNativeLoc; // the emitter location of the native code corresponding to the IL offset + IPmappingDscKind ipmdKind; // The kind of mapping + ILLocation ipmdLoc; // The location for normal mappings + bool ipmdIsLabel; // Can this code be a branch label? +}; + +struct PreciseIPMapping +{ + emitLocation nativeLoc; + DebugInfo debugInfo; +}; + /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX @@ -2959,6 +2983,8 @@ class Compiler bool fgNormalizeEHCase2(); bool fgNormalizeEHCase3(); + void fgCheckForLoopsInHandlers(); + #ifdef DEBUG void dispIncomingEHClause(unsigned num, const CORINFO_EH_CLAUSE& clause); void dispOutgoingEHClause(unsigned num, const CORINFO_EH_CLAUSE& clause); @@ -2987,7 +3013,8 @@ class Compiler */ // Functions to create nodes - Statement* gtNewStmt(GenTree* expr = nullptr, IL_OFFSETX offset = BAD_IL_OFFSET); + Statement* gtNewStmt(GenTree* expr = nullptr); + Statement* gtNewStmt(GenTree* expr, const DebugInfo& di); // For unary opers. GenTree* gtNewOperNode(genTreeOps oper, var_types type, GenTree* op1, bool doSimplifications = TRUE); @@ -3058,8 +3085,6 @@ class Compiler GenTree* gtNewCpObjNode(GenTree* dst, GenTree* src, CORINFO_CLASS_HANDLE structHnd, bool isVolatile); - GenTreeArgList* gtNewListNode(GenTree* op1, GenTreeArgList* op2); - GenTreeCall::Use* gtNewCallArgs(GenTree* node); GenTreeCall::Use* gtNewCallArgs(GenTree* node1, GenTree* node2); GenTreeCall::Use* gtNewCallArgs(GenTree* node1, GenTree* node2, GenTree* node3); @@ -3071,12 +3096,12 @@ class Compiler CORINFO_METHOD_HANDLE handle, var_types type, GenTreeCall::Use* args, - IL_OFFSETX ilOffset = BAD_IL_OFFSET); + const DebugInfo& di = DebugInfo()); GenTreeCall* gtNewIndCallNode(GenTree* addr, var_types type, GenTreeCall::Use* args, - IL_OFFSETX ilOffset = BAD_IL_OFFSET); + const DebugInfo& di = DebugInfo()); GenTreeCall* gtNewHelperCallNode(unsigned helper, var_types type, GenTreeCall::Use* args = nullptr); @@ -3084,8 +3109,8 @@ class Compiler GenTree* ctxTree, void* compileTimeHandle); - GenTreeLclVar* gtNewLclvNode(unsigned lnum, var_types type DEBUGARG(IL_OFFSETX ILoffs = BAD_IL_OFFSET)); - GenTreeLclVar* gtNewLclLNode(unsigned lnum, var_types type DEBUGARG(IL_OFFSETX ILoffs = BAD_IL_OFFSET)); + GenTreeLclVar* gtNewLclvNode(unsigned lnum, var_types type DEBUGARG(IL_OFFSET offs = BAD_IL_OFFSET)); + GenTreeLclVar* gtNewLclLNode(unsigned lnum, var_types type DEBUGARG(IL_OFFSET offs = BAD_IL_OFFSET)); GenTreeLclVar* gtNewLclVarAddrNode(unsigned lclNum, var_types type = TYP_I_IMPL); GenTreeLclFld* gtNewLclFldAddrNode(unsigned lclNum, @@ -3141,6 +3166,19 @@ class Compiler CorInfoType simdBaseJitType, unsigned simdSize, bool isSimdAsHWIntrinsic = false); + GenTreeHWIntrinsic* gtNewSimdHWIntrinsicNode(var_types type, + GenTree** operands, + size_t operandCount, + NamedIntrinsic hwIntrinsicID, + CorInfoType simdBaseJitType, + unsigned simdSize, + bool isSimdAsHWIntrinsic = false); + GenTreeHWIntrinsic* gtNewSimdHWIntrinsicNode(var_types type, + IntrinsicNodeBuilder&& nodeBuilder, + NamedIntrinsic hwIntrinsicID, + CorInfoType simdBaseJitType, + unsigned simdSize, + bool isSimdAsHWIntrinsic = false); GenTreeHWIntrinsic* gtNewSimdAsHWIntrinsicNode(var_types type, NamedIntrinsic hwIntrinsicID, @@ -3262,6 +3300,13 @@ class Compiler unsigned simdSize, bool isSimdAsHWIntrinsic); + GenTree* gtNewSimdNarrowNode(var_types type, + GenTree* op1, + GenTree* op2, + CorInfoType simdBaseJitType, + unsigned simdSize, + bool isSimdAsHWIntrinsic); + GenTree* gtNewSimdSqrtNode( var_types type, GenTree* op1, CorInfoType simdBaseJitType, unsigned simdSize, bool isSimdAsHWIntrinsic); @@ -3272,6 +3317,12 @@ class Compiler unsigned simdSize, bool isSimdAsHWIntrinsic); + GenTree* gtNewSimdWidenLowerNode( + var_types type, GenTree* op1, CorInfoType simdBaseJitType, unsigned simdSize, bool isSimdAsHWIntrinsic); + + GenTree* gtNewSimdWidenUpperNode( + var_types type, GenTree* op1, CorInfoType simdBaseJitType, unsigned simdSize, bool isSimdAsHWIntrinsic); + GenTree* gtNewSimdWithElementNode(var_types type, GenTree* op1, GenTree* op2, @@ -3285,6 +3336,7 @@ class Compiler unsigned simdSize, bool isSimdAsHWIntrinsic); + GenTreeHWIntrinsic* gtNewScalarHWIntrinsicNode(var_types type, NamedIntrinsic hwIntrinsicID); GenTreeHWIntrinsic* gtNewScalarHWIntrinsicNode(var_types type, GenTree* op1, NamedIntrinsic hwIntrinsicID); GenTreeHWIntrinsic* gtNewScalarHWIntrinsicNode(var_types type, GenTree* op1, @@ -3316,11 +3368,6 @@ class Compiler void gtChangeOperToNullCheck(GenTree* tree, BasicBlock* block); - GenTreeArgList* gtNewArgList(GenTree* op); - GenTreeArgList* gtNewArgList(GenTree* op1, GenTree* op2); - GenTreeArgList* gtNewArgList(GenTree* op1, GenTree* op2, GenTree* op3); - GenTreeArgList* gtNewArgList(GenTree* op1, GenTree* op2, GenTree* op3, GenTree* op4); - static fgArgTabEntry* gtArgEntryByArgNum(GenTreeCall* call, unsigned argNum); static fgArgTabEntry* gtArgEntryByNode(GenTreeCall* call, GenTree* node); fgArgTabEntry* gtArgEntryByLateArgIndex(GenTreeCall* call, unsigned lateArgInx); @@ -3328,11 +3375,11 @@ class Compiler GenTreeOp* gtNewAssignNode(GenTree* dst, GenTree* src); - GenTree* gtNewTempAssign(unsigned tmp, - GenTree* val, - Statement** pAfterStmt = nullptr, - IL_OFFSETX ilOffset = BAD_IL_OFFSET, - BasicBlock* block = nullptr); + GenTree* gtNewTempAssign(unsigned tmp, + GenTree* val, + Statement** pAfterStmt = nullptr, + const DebugInfo& di = DebugInfo(), + BasicBlock* block = nullptr); GenTree* gtNewRefCOMfield(GenTree* objPtr, CORINFO_RESOLVED_TOKEN* pResolvedToken, @@ -3387,7 +3434,7 @@ class Compiler Statement* gtCloneStmt(Statement* stmt) { GenTree* exprClone = gtCloneExpr(stmt->GetRootNode()); - return gtNewStmt(exprClone, stmt->GetILOffsetX()); + return gtNewStmt(exprClone, stmt->GetDebugInfo()); } // Internal helper for cloning a call @@ -3399,8 +3446,6 @@ class Compiler // Create copy of an inline or guarded devirtualization candidate tree. GenTreeCall* gtCloneCandidateCall(GenTreeCall* call); - GenTree* gtReplaceTree(Statement* stmt, GenTree* tree, GenTree* replacementTree); - void gtUpdateSideEffects(Statement* stmt, GenTree* tree); void gtUpdateTreeAncestorsSideEffects(GenTree* tree); @@ -3419,16 +3464,14 @@ class Compiler // before they have been set.) bool gtComplexityExceeds(GenTree** tree, unsigned limit); - bool gtCompareTree(GenTree* op1, GenTree* op2); - GenTree* gtReverseCond(GenTree* tree); bool gtHasRef(GenTree* tree, ssize_t lclNum, bool defOnly); bool gtHasLocalsWithAddrOp(GenTree* tree); - unsigned gtSetListOrder(GenTree* list, bool regs, bool isListCallArgs); unsigned gtSetCallArgsOrder(const GenTreeCall::UseList& args, bool lateArgs, int* callCostEx, int* callCostSz); + unsigned gtSetMultiOpOrder(GenTreeMultiOp* multiOp); void gtWalkOp(GenTree** op1, GenTree** op2, GenTree* base, bool constOnly); @@ -3455,20 +3498,20 @@ class Compiler void gtSetStmtInfo(Statement* stmt); // Returns "true" iff "node" has any of the side effects in "flags". - bool gtNodeHasSideEffects(GenTree* node, unsigned flags); + bool gtNodeHasSideEffects(GenTree* node, GenTreeFlags flags); // Returns "true" iff "tree" or its (transitive) children have any of the side effects in "flags". - bool gtTreeHasSideEffects(GenTree* tree, unsigned flags); + bool gtTreeHasSideEffects(GenTree* tree, GenTreeFlags flags); // Appends 'expr' in front of 'list' // 'list' will typically start off as 'nullptr' // when 'list' is non-null a GT_COMMA node is used to insert 'expr' GenTree* gtBuildCommaList(GenTree* list, GenTree* expr); - void gtExtractSideEffList(GenTree* expr, - GenTree** pList, - unsigned flags = GTF_SIDE_EFFECT, - bool ignoreRoot = false); + void gtExtractSideEffList(GenTree* expr, + GenTree** pList, + GenTreeFlags GenTreeFlags = GTF_SIDE_EFFECT, + bool ignoreRoot = false); GenTree* gtGetThisArg(GenTreeCall* call); @@ -3580,11 +3623,12 @@ class Compiler void gtDispLclVar(unsigned lclNum, bool padForBiggestDisp = true); void gtDispLclVarStructType(unsigned lclNum); void gtDispClassLayout(ClassLayout* layout, var_types type); + void gtDispILLocation(const ILLocation& loc); void gtDispStmt(Statement* stmt, const char* msg = nullptr); void gtDispBlockStmts(BasicBlock* block); void gtGetArgMsg(GenTreeCall* call, GenTree* arg, unsigned argNum, char* bufp, unsigned bufLength); void gtGetLateArgMsg(GenTreeCall* call, GenTree* arg, int argNum, char* bufp, unsigned bufLength); - void gtDispArgList(GenTreeCall* call, IndentStack* indentStack); + void gtDispArgList(GenTreeCall* call, GenTree* lastCallOperand, IndentStack* indentStack); void gtDispFieldSeq(FieldSeqNode* pfsn); void gtDispRange(LIR::ReadOnlyRange const& range); @@ -3606,9 +3650,6 @@ class Compiler typedef fgWalkResult(fgWalkPreFn)(GenTree** pTree, fgWalkData* data); typedef fgWalkResult(fgWalkPostFn)(GenTree** pTree, fgWalkData* data); -#ifdef DEBUG - static fgWalkPreFn gtAssertColonCond; -#endif static fgWalkPreFn gtMarkColonCond; static fgWalkPreFn gtClearColonCond; @@ -3636,6 +3677,7 @@ class Compiler #endif BasicBlock* bbNewBasicBlock(BBjumpKinds jumpKind); + void placeLoopAlignInstructions(); /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX @@ -3690,7 +3732,6 @@ class Compiler unsigned lvaCount; // total number of locals, which includes function arguments, // special arguments, IL local variables, and JIT temporary variables - unsigned lvaRefCount; // total number of references to locals LclVarDsc* lvaTable; // variable descriptor table unsigned lvaTableCnt; // lvaTable size (>= lvaCount) @@ -3775,15 +3816,6 @@ class Compiler // where it is used to detect tail-call chains. unsigned lvaRetAddrVar; -#ifdef TARGET_ARM - // On architectures whose ABIs allow structs to be passed in registers, struct promotion will sometimes - // require us to "rematerialize" a struct from it's separate constituent field variables. Packing several sub-word - // field variables into an argument register is a hard problem. It's easier to reserve a word of memory into which - // such field can be copied, after which the assembled memory word can be read into the register. We will allocate - // this variable to be this scratch word whenever struct promotion occurs. - unsigned lvaPromotedStructAssemblyScratchVar; -#endif // TARGET_ARM - #if defined(DEBUG) && defined(TARGET_XARCH) unsigned lvaReturnSpCheck; // Stores SP to confirm it is not corrupted on return. @@ -3921,10 +3953,15 @@ class Compiler return &lvaTable[lclNum]; } + LclVarDsc* lvaGetDesc(unsigned lclNum) const + { + assert(lclNum < lvaCount); + return &lvaTable[lclNum]; + } + LclVarDsc* lvaGetDesc(const GenTreeLclVarCommon* lclVar) { - assert(lclVar->GetLclNum() < lvaCount); - return &lvaTable[lclVar->GetLclNum()]; + return lvaGetDesc(lclVar->GetLclNum()); } unsigned lvaTrackedIndexToLclNum(unsigned trackedIndex) @@ -3940,6 +3977,16 @@ class Compiler return lvaGetDesc(lvaTrackedIndexToLclNum(trackedIndex)); } + unsigned lvaGetLclNum(const LclVarDsc* varDsc) + { + assert((lvaTable <= varDsc) && (varDsc < lvaTable + lvaCount)); // varDsc must point within the table + assert(((char*)varDsc - (char*)lvaTable) % sizeof(LclVarDsc) == + 0); // varDsc better not point in the middle of a variable + unsigned varNum = (unsigned)(varDsc - lvaTable); + assert(varDsc == &lvaTable[varNum]); + return varNum; + } + unsigned lvaLclSize(unsigned varNum); unsigned lvaLclExactSize(unsigned varNum); @@ -4155,9 +4202,11 @@ class Compiler unsigned lvaPSPSym; // variable representing the PSPSym #endif - InlineInfo* impInlineInfo; + InlineInfo* impInlineInfo; // Only present for inlinees InlineStrategy* m_inlineStrategy; + InlineContext* compInlineContext; // Always present + // The Compiler* that is the root of the inlining tree of which "this" is a member. Compiler* impInlineRoot(); @@ -4251,7 +4300,7 @@ class Compiler CORINFO_CONTEXT_HANDLE* exactContextHandle, bool isLateDevirtualization, bool isExplicitTailCall, - IL_OFFSETX ilOffset = BAD_IL_OFFSET); + IL_OFFSET ilOffset = BAD_IL_OFFSET); //========================================================================= // PROTECTED @@ -4298,7 +4347,7 @@ class Compiler bool impCanPInvokeInlineCallSite(BasicBlock* block); void impCheckForPInvokeCall( GenTreeCall* call, CORINFO_METHOD_HANDLE methHnd, CORINFO_SIG_INFO* sig, unsigned mflags, BasicBlock* block); - GenTreeCall* impImportIndirectCall(CORINFO_SIG_INFO* sig, IL_OFFSETX ilOffset = BAD_IL_OFFSET); + GenTreeCall* impImportIndirectCall(CORINFO_SIG_INFO* sig, const DebugInfo& di = DebugInfo()); void impPopArgsForUnmanagedCall(GenTree* call, CORINFO_SIG_INFO* sig); void impInsertHelperCall(CORINFO_HELPER_DESC* helperCall); @@ -4434,6 +4483,7 @@ class Compiler bool readonlyCall, CorInfoIntrinsics intrinsicID); GenTree* impInitializeArrayIntrinsic(CORINFO_SIG_INFO* sig); + GenTree* impCreateSpanIntrinsic(CORINFO_SIG_INFO* sig); GenTree* impKeepAliveIntrinsic(GenTree* objToKeepAlive); @@ -4459,23 +4509,23 @@ class Compiler void impEndTreeList(BasicBlock* block, Statement* firstStmt, Statement* lastStmt); void impEndTreeList(BasicBlock* block); void impAppendStmtCheck(Statement* stmt, unsigned chkLevel); - void impAppendStmt(Statement* stmt, unsigned chkLevel); + void impAppendStmt(Statement* stmt, unsigned chkLevel, bool checkConsumedDebugInfo = true); void impAppendStmt(Statement* stmt); void impInsertStmtBefore(Statement* stmt, Statement* stmtBefore); - Statement* impAppendTree(GenTree* tree, unsigned chkLevel, IL_OFFSETX offset); - void impInsertTreeBefore(GenTree* tree, IL_OFFSETX offset, Statement* stmtBefore); - void impAssignTempGen(unsigned tmp, - GenTree* val, - unsigned curLevel, - Statement** pAfterStmt = nullptr, - IL_OFFSETX ilOffset = BAD_IL_OFFSET, - BasicBlock* block = nullptr); + Statement* impAppendTree(GenTree* tree, unsigned chkLevel, const DebugInfo& di, bool checkConsumedDebugInfo = true); + void impInsertTreeBefore(GenTree* tree, const DebugInfo& di, Statement* stmtBefore); + void impAssignTempGen(unsigned tmp, + GenTree* val, + unsigned curLevel, + Statement** pAfterStmt = nullptr, + const DebugInfo& di = DebugInfo(), + BasicBlock* block = nullptr); void impAssignTempGen(unsigned tmpNum, GenTree* val, CORINFO_CLASS_HANDLE structHnd, unsigned curLevel, Statement** pAfterStmt = nullptr, - IL_OFFSETX ilOffset = BAD_IL_OFFSET, + const DebugInfo& di = DebugInfo(), BasicBlock* block = nullptr); Statement* impExtractLastStmt(); @@ -4489,14 +4539,14 @@ class Compiler CORINFO_CLASS_HANDLE structHnd, unsigned curLevel, Statement** pAfterStmt = nullptr, - IL_OFFSETX ilOffset = BAD_IL_OFFSET, + const DebugInfo& di = DebugInfo(), BasicBlock* block = nullptr); GenTree* impAssignStructPtr(GenTree* dest, GenTree* src, CORINFO_CLASS_HANDLE structHnd, unsigned curLevel, Statement** pAfterStmt = nullptr, - IL_OFFSETX ilOffset = BAD_IL_OFFSET, + const DebugInfo& di = DebugInfo(), BasicBlock* block = nullptr); GenTree* impGetStructAddr(GenTree* structVal, CORINFO_CLASS_HANDLE structHnd, unsigned curLevel, bool willDeref); @@ -4573,21 +4623,20 @@ class Compiler void impNoteLastILoffs(); #endif - /* IL offset of the stmt currently being imported. It gets set to - BAD_IL_OFFSET after it has been set in the appended trees. Then it gets - updated at IL offsets for which we have to report mapping info. - It also includes flag bits, so use jitGetILoffs() - to get the actual IL offset value. - */ + // Debug info of current statement being imported. It gets set to contain + // no IL location (!impCurStmtDI.GetLocation().IsValid) after it has been + // set in the appended trees. Then it gets updated at IL instructions for + // which we have to report mapping info. + // It will always contain the current inline context. + DebugInfo impCurStmtDI; - IL_OFFSETX impCurStmtOffs; + DebugInfo impCreateDIWithCurrentStackInfo(IL_OFFSET offs, bool isCall); void impCurStmtOffsSet(IL_OFFSET offs); void impNoteBranchOffs(); unsigned impInitBlockLineInfo(); - GenTree* impCheckForNullPointer(GenTree* obj); bool impIsThis(GenTree* obj); bool impIsLDFTN_TOKEN(const BYTE* delegateCreateStart, const BYTE* newobjCodeAddr); bool impIsDUP_LDVIRTFTN_TOKEN(const BYTE* delegateCreateStart, const BYTE* newobjCodeAddr); @@ -4603,11 +4652,6 @@ class Compiler GenTreeCall::Use* impPopReverseCallArgs(unsigned count, CORINFO_SIG_INFO* sig, unsigned skipReverseCount = 0); - /* - * Get current IL offset with stack-empty info incoporated - */ - IL_OFFSETX impCurILOffset(IL_OFFSET offs, bool callInstruction = false); - //---------------- Spilling the importer stack ---------------------------- // The maximum number of bytes of IL processed without clean stack state. @@ -4773,7 +4817,7 @@ class Compiler void impLoadVar(unsigned lclNum, IL_OFFSET offset, const typeInfo& tiRetVal); void impLoadVar(unsigned lclNum, IL_OFFSET offset) { - impLoadVar(lclNum, offset, lvaTable[lclNum].lvVerTypeInfo); + impLoadVar(lclNum, offset, lvaGetDesc(lclNum)->lvVerTypeInfo); } void impLoadArg(unsigned ilArgNum, IL_OFFSET offset); void impLoadLoc(unsigned ilLclNum, IL_OFFSET offset); @@ -5210,10 +5254,10 @@ class Compiler BasicBlock* fgSplitBlockAfterNode(BasicBlock* curr, GenTree* node); // for LIR BasicBlock* fgSplitEdge(BasicBlock* curr, BasicBlock* succ); - Statement* fgNewStmtFromTree(GenTree* tree, BasicBlock* block, IL_OFFSETX offs); + Statement* fgNewStmtFromTree(GenTree* tree, BasicBlock* block, const DebugInfo& di); Statement* fgNewStmtFromTree(GenTree* tree); Statement* fgNewStmtFromTree(GenTree* tree, BasicBlock* block); - Statement* fgNewStmtFromTree(GenTree* tree, IL_OFFSETX offs); + Statement* fgNewStmtFromTree(GenTree* tree, const DebugInfo& di); GenTree* fgGetTopLevelQmark(GenTree* expr, GenTree** ppDst = nullptr); void fgExpandQmarkForCastInstOf(BasicBlock* block, Statement* stmt); @@ -5448,6 +5492,8 @@ class Compiler // For a store to an address-exposed local at curTree, record the new curMemoryVN and update curTree's MemorySsaMap. void recordAddressExposedLocalStore(GenTree* curTree, ValueNum memoryVN DEBUGARG(const char* msg)); + void fgSetCurrentMemoryVN(MemoryKind memoryKind, ValueNum newMemoryVN); + // Tree caused an update in the current memory VN. If "tree" has an associated heap SSA #, record that // value in that SSA #. void fgValueNumberRecordMemorySsa(MemoryKind memoryKind, GenTree* tree); @@ -5480,12 +5526,12 @@ class Compiler #ifdef FEATURE_SIMD // Does value-numbering for a GT_SIMD tree - void fgValueNumberSimd(GenTree* tree); + void fgValueNumberSimd(GenTreeSIMD* tree); #endif // FEATURE_SIMD #ifdef FEATURE_HW_INTRINSICS // Does value-numbering for a GT_HWINTRINSIC tree - void fgValueNumberHWIntrinsic(GenTree* tree); + void fgValueNumberHWIntrinsic(GenTreeHWIntrinsic* tree); #endif // FEATURE_HW_INTRINSICS // Does value-numbering for a call. We interpret some helper calls. @@ -6041,7 +6087,7 @@ class Compiler BasicBlock* fgLookupBB(unsigned addr); bool fgCanSwitchToOptimized(); - void fgSwitchToOptimized(); + void fgSwitchToOptimized(const char* reason); bool fgMayExplicitTailCall(); @@ -6144,10 +6190,10 @@ class Compiler #endif public: - Statement* fgNewStmtAtBeg(BasicBlock* block, GenTree* tree); + Statement* fgNewStmtAtBeg(BasicBlock* block, GenTree* tree, const DebugInfo& di = DebugInfo()); void fgInsertStmtAtEnd(BasicBlock* block, Statement* stmt); - Statement* fgNewStmtAtEnd(BasicBlock* block, GenTree* tree); - Statement* fgNewStmtNearEnd(BasicBlock* block, GenTree* tree); + Statement* fgNewStmtAtEnd(BasicBlock* block, GenTree* tree, const DebugInfo& di = DebugInfo()); + Statement* fgNewStmtNearEnd(BasicBlock* block, GenTree* tree, const DebugInfo& di = DebugInfo()); private: void fgInsertStmtNearEnd(BasicBlock* block, Statement* stmt); @@ -6290,12 +6336,8 @@ class Compiler GenTreeFieldList* fgMorphLclArgToFieldlist(GenTreeLclVarCommon* lcl); void fgInitArgInfo(GenTreeCall* call); GenTreeCall* fgMorphArgs(GenTreeCall* call); - GenTreeArgList* fgMorphArgList(GenTreeArgList* args, MorphAddrContext* mac); - void fgMakeOutgoingStructArgCopy(GenTreeCall* call, - GenTreeCall::Use* args, - unsigned argIndex, - CORINFO_CLASS_HANDLE copyBlkClass); + void fgMakeOutgoingStructArgCopy(GenTreeCall* call, GenTreeCall::Use* args, CORINFO_CLASS_HANDLE copyBlkClass); GenTree* fgMorphLocalVar(GenTree* tree, bool forceRemorph); @@ -6331,17 +6373,17 @@ class Compiler GenTree* fgGetStubAddrArg(GenTreeCall* call); unsigned fgGetArgTabEntryParameterLclNum(GenTreeCall* call, fgArgTabEntry* argTabEntry); void fgMorphRecursiveFastTailCallIntoLoop(BasicBlock* block, GenTreeCall* recursiveTailCall); - Statement* fgAssignRecursiveCallArgToCallerParam(GenTree* arg, - fgArgTabEntry* argTabEntry, - unsigned lclParamNum, - BasicBlock* block, - IL_OFFSETX callILOffset, - Statement* tmpAssignmentInsertionPoint, - Statement* paramAssignmentInsertionPoint); + Statement* fgAssignRecursiveCallArgToCallerParam(GenTree* arg, + fgArgTabEntry* argTabEntry, + unsigned lclParamNum, + BasicBlock* block, + const DebugInfo& callDI, + Statement* tmpAssignmentInsertionPoint, + Statement* paramAssignmentInsertionPoint); GenTree* fgMorphCall(GenTreeCall* call); GenTree* fgExpandVirtualVtableCallTarget(GenTreeCall* call); void fgMorphCallInline(GenTreeCall* call, InlineResult* result); - void fgMorphCallInlineHelper(GenTreeCall* call, InlineResult* result); + void fgMorphCallInlineHelper(GenTreeCall* call, InlineResult* result, InlineContext** createdContext); #if DEBUG void fgNoteNonInlineCandidate(Statement* stmt, GenTreeCall* call); static fgWalkPreFn fgFindNonInlineCandidate; @@ -6366,6 +6408,7 @@ class Compiler GenTree* fgMorphRetInd(GenTreeUnOp* tree); GenTree* fgMorphModToSubMulDiv(GenTreeOp* tree); GenTree* fgMorphSmpOpOptional(GenTreeOp* tree); + GenTree* fgMorphMultiOp(GenTreeMultiOp* multiOp); GenTree* fgMorphConst(GenTree* tree); bool fgMorphCanUseLclFldForCopy(unsigned lclNum1, unsigned lclNum2); @@ -6467,7 +6510,7 @@ class Compiler unsigned fgBigOffsetMorphingTemps[TYP_COUNT]; unsigned fgCheckInlineDepthAndRecursion(InlineInfo* inlineInfo); - void fgInvokeInlineeCompiler(GenTreeCall* call, InlineResult* result); + void fgInvokeInlineeCompiler(GenTreeCall* call, InlineResult* result, InlineContext** createdContext); void fgInsertInlineeBlocks(InlineInfo* pInlineInfo); Statement* fgInlinePrependStatements(InlineInfo* inlineInfo); void fgInlineAppendStatements(InlineInfo* inlineInfo, BasicBlock* block, Statement* stmt); @@ -6682,18 +6725,16 @@ class Compiler // bbNext order) sequence of basic blocks. (At times, we may require the blocks in a loop to be "properly numbered" // in bbNext order; we use comparisons on the bbNum to decide order.) // The blocks that define the body are - // first <= top <= entry <= bottom . + // top <= entry <= bottom // The "head" of the loop is a block outside the loop that has "entry" as a successor. We only support loops with a // single 'head' block. The meanings of these blocks are given in the definitions below. Also see the picture at // Compiler::optFindNaturalLoops(). struct LoopDsc { - BasicBlock* lpHead; // HEAD of the loop (not part of the looping of the loop) -- has ENTRY as a successor. - BasicBlock* lpFirst; // FIRST block (in bbNext order) reachable within this loop. (May be part of a nested - // loop, but not the outer loop.) - BasicBlock* lpTop; // loop TOP (the back edge from lpBottom reaches here) (in most cases FIRST and TOP are the - // same) - BasicBlock* lpEntry; // the ENTRY in the loop (in most cases TOP or BOTTOM) + BasicBlock* lpHead; // HEAD of the loop (not part of the looping of the loop) -- has ENTRY as a successor. + BasicBlock* lpTop; // loop TOP (the back edge from lpBottom reaches here). Lexically first block (in bbNext + // order) reachable in this loop. + BasicBlock* lpEntry; // the ENTRY in the loop (in most cases TOP or BOTTOM) BasicBlock* lpBottom; // loop BOTTOM (from here we have a back edge to the TOP) BasicBlock* lpExit; // if a single exit loop this is the EXIT (in most cases BOTTOM) @@ -6794,51 +6835,50 @@ class Compiler // Returns "true" iff "*this" contains the blk. bool lpContains(BasicBlock* blk) const { - return lpFirst->bbNum <= blk->bbNum && blk->bbNum <= lpBottom->bbNum; + return lpTop->bbNum <= blk->bbNum && blk->bbNum <= lpBottom->bbNum; } // Returns "true" iff "*this" (properly) contains the range [first, bottom] (allowing firsts // to be equal, but requiring bottoms to be different.) bool lpContains(BasicBlock* first, BasicBlock* bottom) const { - return lpFirst->bbNum <= first->bbNum && bottom->bbNum < lpBottom->bbNum; + return lpTop->bbNum <= first->bbNum && bottom->bbNum < lpBottom->bbNum; } // Returns "true" iff "*this" (properly) contains "lp2" (allowing firsts to be equal, but requiring // bottoms to be different.) bool lpContains(const LoopDsc& lp2) const { - return lpContains(lp2.lpFirst, lp2.lpBottom); + return lpContains(lp2.lpTop, lp2.lpBottom); } // Returns "true" iff "*this" is (properly) contained by the range [first, bottom] // (allowing firsts to be equal, but requiring bottoms to be different.) bool lpContainedBy(BasicBlock* first, BasicBlock* bottom) const { - return first->bbNum <= lpFirst->bbNum && lpBottom->bbNum < bottom->bbNum; + return first->bbNum <= lpTop->bbNum && lpBottom->bbNum < bottom->bbNum; } // Returns "true" iff "*this" is (properly) contained by "lp2" // (allowing firsts to be equal, but requiring bottoms to be different.) bool lpContainedBy(const LoopDsc& lp2) const { - return lpContains(lp2.lpFirst, lp2.lpBottom); + return lpContains(lp2.lpTop, lp2.lpBottom); } // Returns "true" iff "*this" is disjoint from the range [top, bottom]. bool lpDisjoint(BasicBlock* first, BasicBlock* bottom) const { - return bottom->bbNum < lpFirst->bbNum || lpBottom->bbNum < first->bbNum; + return bottom->bbNum < lpTop->bbNum || lpBottom->bbNum < first->bbNum; } // Returns "true" iff "*this" is disjoint from "lp2". bool lpDisjoint(const LoopDsc& lp2) const { - return lpDisjoint(lp2.lpFirst, lp2.lpBottom); + return lpDisjoint(lp2.lpTop, lp2.lpBottom); } // Returns "true" iff the loop is well-formed (see code for defn). bool lpWellFormed() const { - return lpFirst->bbNum <= lpTop->bbNum && lpTop->bbNum <= lpEntry->bbNum && - lpEntry->bbNum <= lpBottom->bbNum && + return lpTop->bbNum <= lpEntry->bbNum && lpEntry->bbNum <= lpBottom->bbNum && (lpHead->bbNum < lpTop->bbNum || lpHead->bbNum > lpBottom->bbNum); } @@ -6846,30 +6886,29 @@ class Compiler // blocks in a loop, e.g.: // for (BasicBlock* const block : loop->LoopBlocks()) ... // Currently, the loop blocks are expected to be in linear, lexical, `bbNext` order - // from `lpFirst` through `lpBottom`, inclusive. All blocks in this range are considered + // from `lpTop` through `lpBottom`, inclusive. All blocks in this range are considered // to be part of the loop. // BasicBlockRangeList LoopBlocks() const { - return BasicBlockRangeList(lpFirst, lpBottom); + return BasicBlockRangeList(lpTop, lpBottom); } }; protected: - bool fgMightHaveLoop(); // returns true if there are any backedges + bool fgMightHaveLoop(); // returns true if there are any back edges bool fgHasLoops; // True if this method has any loops, set in fgComputeReachability public: - LoopDsc* optLoopTable; // loop descriptor table - unsigned char optLoopCount; // number of tracked loops + LoopDsc* optLoopTable; // loop descriptor table + unsigned char optLoopCount; // number of tracked loops + unsigned char loopAlignCandidates; // number of loops identified for alignment #ifdef DEBUG - unsigned char loopAlignCandidates; // number of loops identified for alignment - unsigned char loopsAligned; // number of loops actually aligned -#endif // DEBUG + unsigned char loopsAligned; // number of loops actually aligned +#endif // DEBUG bool optRecordLoop(BasicBlock* head, - BasicBlock* first, BasicBlock* top, BasicBlock* entry, BasicBlock* bottom, @@ -6885,7 +6924,6 @@ class Compiler #ifdef DEBUG void optPrintLoopInfo(unsigned loopNum, BasicBlock* lpHead, - BasicBlock* lpFirst, BasicBlock* lpTop, BasicBlock* lpEntry, BasicBlock* lpBottom, @@ -6898,9 +6936,12 @@ class Compiler void optCheckPreds(); #endif + // Determine if there are any potential loops, and set BBF_LOOP_HEAD on potential loop heads. + void optMarkLoopHeads(); + void optSetBlockWeights(); - void optMarkLoopBlocks(BasicBlock* begBlk, BasicBlock* endBlk, bool excludeEndBlk); + void optScaleLoopBlocks(BasicBlock* begBlk, BasicBlock* endBlk); void optUnmarkLoopBlocks(BasicBlock* begBlk, BasicBlock* endBlk); @@ -7242,7 +7283,7 @@ class Compiler // bool lclNumIsCSE(unsigned lclNum) const { - return lvaTable[lclNum].lvIsCSE; + return lvaGetDesc(lclNum)->lvIsCSE; } #ifdef DEBUG @@ -7363,7 +7404,7 @@ class Compiler } void considerGuardedDevirtualization(GenTreeCall* call, - IL_OFFSETX iloffset, + IL_OFFSET ilOffset, bool isInterface, CORINFO_METHOD_HANDLE baseMethod, CORINFO_CLASS_HANDLE baseClass, @@ -7470,6 +7511,7 @@ class Compiler // Redundant branch opts // PhaseStatus optRedundantBranches(); + bool optRedundantRelop(BasicBlock* const block); bool optRedundantBranch(BasicBlock* const block); bool optJumpThread(BasicBlock* const block, BasicBlock* const domBlock, bool domIsSameRelop); bool optReachable(BasicBlock* const fromBlock, BasicBlock* const toBlock, BasicBlock* const excludedBlock); @@ -7940,7 +7982,7 @@ class Compiler { #ifdef TARGET_X86 - LclVarDsc* varDsc = &lvaTable[lclNum]; + LclVarDsc* varDsc = lvaGetDesc(lclNum); assert(varDsc->lvIsParam); @@ -7985,39 +8027,10 @@ class Compiler bool eeIsJitIntrinsic(CORINFO_METHOD_HANDLE ftn); bool eeIsFieldStatic(CORINFO_FIELD_HANDLE fldHnd); - var_types eeGetFieldType(CORINFO_FIELD_HANDLE fldHnd); + var_types eeGetFieldType(CORINFO_FIELD_HANDLE fldHnd, CORINFO_CLASS_HANDLE* pStructHnd = nullptr); #if defined(DEBUG) || defined(FEATURE_JIT_METHOD_PERF) || defined(FEATURE_SIMD) || defined(TRACK_LSRA_STATS) - bool IsSuperPMIException(unsigned code) - { - // Copied from NDP\clr\src\ToolBox\SuperPMI\SuperPMI-Shared\ErrorHandling.h - - const unsigned EXCEPTIONCODE_DebugBreakorAV = 0xe0421000; - const unsigned EXCEPTIONCODE_MC = 0xe0422000; - const unsigned EXCEPTIONCODE_LWM = 0xe0423000; - const unsigned EXCEPTIONCODE_SASM = 0xe0424000; - const unsigned EXCEPTIONCODE_SSYM = 0xe0425000; - const unsigned EXCEPTIONCODE_CALLUTILS = 0xe0426000; - const unsigned EXCEPTIONCODE_TYPEUTILS = 0xe0427000; - const unsigned EXCEPTIONCODE_ASSERT = 0xe0440000; - - switch (code) - { - case EXCEPTIONCODE_DebugBreakorAV: - case EXCEPTIONCODE_MC: - case EXCEPTIONCODE_LWM: - case EXCEPTIONCODE_SASM: - case EXCEPTIONCODE_SSYM: - case EXCEPTIONCODE_CALLUTILS: - case EXCEPTIONCODE_TYPEUTILS: - case EXCEPTIONCODE_ASSERT: - return true; - default: - return false; - } - } - const char* eeGetMethodName(CORINFO_METHOD_HANDLE hnd, const char** className); const char* eeGetMethodFullName(CORINFO_METHOD_HANDLE hnd); unsigned compMethodHash(CORINFO_METHOD_HANDLE methodHandle); @@ -8156,19 +8169,15 @@ class Compiler unsigned eeBoundariesCount; - struct boundariesDsc - { - UNATIVE_OFFSET nativeIP; - IL_OFFSET ilOffset; - unsigned sourceReason; - } * eeBoundaries; // Boundaries to report to EE + ICorDebugInfo::OffsetMapping* eeBoundaries; // Boundaries to report to the EE void eeSetLIcount(unsigned count); - void eeSetLIinfo(unsigned which, UNATIVE_OFFSET offs, unsigned srcIP, bool stkEmpty, bool callInstruction); + void eeSetLIinfo(unsigned which, UNATIVE_OFFSET offs, IPmappingDscKind kind, const ILLocation& loc); void eeSetLIdone(); #ifdef DEBUG static void eeDispILOffs(IL_OFFSET offs); - static void eeDispLineInfo(const boundariesDsc* line); + static void eeDispSourceMappingOffs(uint32_t offs); + static void eeDispLineInfo(const ICorDebugInfo::OffsetMapping* line); void eeDispLineInfos(); #endif // DEBUG @@ -8259,9 +8268,8 @@ class Compiler static CORINFO_METHOD_HANDLE eeFindHelper(unsigned helper); static CorInfoHelpFunc eeGetHelperNum(CORINFO_METHOD_HANDLE method); - static fgWalkPreFn CountSharedStaticHelper; static bool IsSharedStaticHelper(GenTree* tree); - static bool IsGcSafePoint(GenTree* tree); + static bool IsGcSafePoint(GenTreeCall* call); static CORINFO_FIELD_HANDLE eeFindJitDataOffs(unsigned jitDataOffs); // returns true/false if 'field' is a Jit Data offset @@ -8284,34 +8292,27 @@ class Compiler public: CodeGenInterface* codeGen; - // The following holds information about instr offsets in terms of generated code. - - struct IPmappingDsc - { - IPmappingDsc* ipmdNext; // next line# record - emitLocation ipmdNativeLoc; // the emitter location of the native code corresponding to the IL offset - IL_OFFSETX ipmdILoffsx; // the instr offset - bool ipmdIsLabel; // Can this code be a branch label? - }; - // Record the instr offset mapping to the generated code - IPmappingDsc* genIPmappingList; - IPmappingDsc* genIPmappingLast; + jitstd::list genIPmappings; + +#ifdef DEBUG + jitstd::list genPreciseIPmappings; +#endif // Managed RetVal - A side hash table meant to record the mapping from a - // GT_CALL node to its IL offset. This info is used to emit sequence points + // GT_CALL node to its debug info. This info is used to emit sequence points // that can be used by debugger to determine the native offset at which the // managed RetVal will be available. // - // In fact we can store IL offset in a GT_CALL node. This was ruled out in - // favor of a side table for two reasons: 1) We need IL offset for only those + // In fact we can store debug info in a GT_CALL node. This was ruled out in + // favor of a side table for two reasons: 1) We need debug info for only those // GT_CALL nodes (created during importation) that correspond to an IL call and // whose return type is other than TYP_VOID. 2) GT_CALL node is a frequently used // structure and IL offset is needed only when generating debuggable code. Therefore // it is desirable to avoid memory size penalty in retail scenarios. - typedef JitHashTable, IL_OFFSETX> CallSiteILOffsetTable; - CallSiteILOffsetTable* genCallSite2ILOffsetMap; + typedef JitHashTable, DebugInfo> CallSiteDebugInfoTable; + CallSiteDebugInfoTable* genCallSite2DebugInfoMap; unsigned genReturnLocal; // Local number for the return value when applicable. BasicBlock* genReturnBB; // jumped to when not optimizing for speed. @@ -8886,7 +8887,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX // type of an arg node is TYP_BYREF and a local node is TYP_SIMD or TYP_STRUCT. bool isSIMDTypeLocal(GenTree* tree) { - return tree->OperIsLocal() && lvaTable[tree->AsLclVarCommon()->GetLclNum()].lvSIMDType; + return tree->OperIsLocal() && lvaGetDesc(tree->AsLclVarCommon())->lvSIMDType; } // Returns true if the lclVar is an opaque SIMD type. @@ -8910,7 +8911,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX { if (isSIMDTypeLocal(tree)) { - return lvaTable[tree->AsLclVarCommon()->GetLclNum()].GetSimdBaseJitType(); + return lvaGetDesc(tree->AsLclVarCommon())->GetSimdBaseJitType(); } return CORINFO_TYPE_UNDEF; @@ -9063,7 +9064,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX else { // Verify and record that AVX2 isn't supported - compVerifyInstructionSetUnuseable(InstructionSet_AVX2); + compVerifyInstructionSetUnusable(InstructionSet_AVX2); assert(getSIMDSupportLevel() >= SIMD_SSE2_Supported); return TYP_SIMD16; } @@ -9106,7 +9107,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX assert(getSIMDSupportLevel() >= SIMD_SSE2_Supported); // Verify and record that AVX2 isn't supported - compVerifyInstructionSetUnuseable(InstructionSet_AVX2); + compVerifyInstructionSetUnusable(InstructionSet_AVX2); return XMM_REGSIZE_BYTES; } #elif defined(TARGET_ARM64) @@ -9243,8 +9244,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX // Is this var is of type simd struct? bool lclVarIsSIMDType(unsigned varNum) { - LclVarDsc* varDsc = lvaTable + varNum; - return varDsc->lvIsSIMDType(); + return lvaGetDesc(varNum)->lvIsSIMDType(); } // Is this Local node a SIMD local? @@ -9341,15 +9341,15 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #endif } - // Ensure that code will not execute if an instruction set is useable. Call only - // if the instruction set has previously reported as unuseable, but when + // Ensure that code will not execute if an instruction set is usable. Call only + // if the instruction set has previously reported as unusable, but when // that that status has not yet been recorded to the AOT compiler - void compVerifyInstructionSetUnuseable(CORINFO_InstructionSet isa) + void compVerifyInstructionSetUnusable(CORINFO_InstructionSet isa) { // use compExactlyDependsOn to capture are record the use of the isa - bool isaUseable = compExactlyDependsOn(isa); - // Assert that the is unuseable. If true, this function should never be called. - assert(!isaUseable); + bool isaUsable = compExactlyDependsOn(isa); + // Assert that the is unusable. If true, this function should never be called. + assert(!isaUsable); } // Answer the question: Is a particular ISA allowed to be used implicitly by optimizations? @@ -9403,20 +9403,23 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX InlineResult* compInlineResult; // The result of importing the inlinee method. - bool compDoAggressiveInlining; // If true, mark every method as CORINFO_FLG_FORCEINLINE - bool compJmpOpUsed; // Does the method do a JMP - bool compLongUsed; // Does the method use TYP_LONG - bool compFloatingPointUsed; // Does the method use TYP_FLOAT or TYP_DOUBLE - bool compTailCallUsed; // Does the method do a tailcall - bool compLocallocUsed; // Does the method use localloc. - bool compLocallocOptimized; // Does the method have an optimized localloc - bool compQmarkUsed; // Does the method use GT_QMARK/GT_COLON - bool compQmarkRationalized; // Is it allowed to use a GT_QMARK/GT_COLON node. - bool compUnsafeCastUsed; // Does the method use LDIND/STIND to cast between scalar/refernce types - bool compHasBackwardJump; // Does the method (or some inlinee) have a lexically backwards jump? - bool compSwitchedToOptimized; // Codegen initially was Tier0 but jit switched to FullOpts - bool compSwitchedToMinOpts; // Codegen initially was Tier1/FullOpts but jit switched to MinOpts - bool compSuppressedZeroInit; // There are vars with lvSuppressedZeroInit set + bool compDoAggressiveInlining; // If true, mark every method as CORINFO_FLG_FORCEINLINE + bool compJmpOpUsed; // Does the method do a JMP + bool compLongUsed; // Does the method use TYP_LONG + bool compFloatingPointUsed; // Does the method use TYP_FLOAT or TYP_DOUBLE + bool compTailCallUsed; // Does the method do a tailcall + bool compTailPrefixSeen; // Does the method IL have tail. prefix + bool compLocallocSeen; // Does the method IL have localloc opcode + bool compLocallocUsed; // Does the method use localloc. + bool compLocallocOptimized; // Does the method have an optimized localloc + bool compQmarkUsed; // Does the method use GT_QMARK/GT_COLON + bool compQmarkRationalized; // Is it allowed to use a GT_QMARK/GT_COLON node. + bool compUnsafeCastUsed; // Does the method use LDIND/STIND to cast between scalar/refernce types + bool compHasBackwardJump; // Does the method (or some inlinee) have a lexically backwards jump? + bool compHasBackwardJumpInHandler; // Does the method have a lexically backwards jump in a handler? + bool compSwitchedToOptimized; // Codegen initially was Tier0 but jit switched to FullOpts + bool compSwitchedToMinOpts; // Codegen initially was Tier1/FullOpts but jit switched to MinOpts + bool compSuppressedZeroInit; // There are vars with lvSuppressedZeroInit set // NOTE: These values are only reliable after // the importing is completely finished. @@ -9718,6 +9721,9 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX // If set, perform adaptive loop alignment that limits number of padding based on loop size. bool compJitAlignLoopAdaptive; + // If set, tries to hide alignment instructions behind unconditional jumps. + bool compJitHideAlignBehindJmp; + #ifdef LATE_DISASM bool doLateDisasm; // Run the late disassembler #endif // LATE_DISASM @@ -9999,7 +10005,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX bool compInitMem : 1; // Is the CORINFO_OPT_INIT_LOCALS bit set in the method info options? bool compProfilerCallback : 1; // JIT inserted a profiler Enter callback bool compPublishStubParam : 1; // EAX captured in prolog will be available through an intrinsic - bool compRetBuffDefStack : 1; // The ret buff argument definitely points into the stack. bool compHasNextCallRetAddr : 1; // The NextCallReturnAddress intrinsic is used. var_types compRetType; // Return type of the method as declared in IL @@ -10223,6 +10228,10 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX return !info.compInitMem && opts.compDbgCode; } + // Returns true if the jit supports having patchpoints in this method. + // Optionally, get the reason why not. + bool compCanHavePatchpoints(const char** reason = nullptr); + #if defined(DEBUG) void compDispLocalVars(); @@ -10452,6 +10461,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX VarName compVarName(regNumber reg, bool isFloatReg = false); const char* compRegVarName(regNumber reg, bool displayVar = false, bool isFloatReg = false); const char* compRegNameForSize(regNumber reg, size_t size); + const char* compFPregVarName(unsigned fpReg, bool displayVar = false); void compDspSrcLinesByNativeIP(UNATIVE_OFFSET curIP); void compDspSrcLinesByLineNum(unsigned line, bool seek = false); #endif // DEBUG @@ -11531,6 +11541,42 @@ class GenTreeVisitor break; } +#if defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) +#if defined(FEATURE_SIMD) + case GT_SIMD: +#endif +#if defined(FEATURE_HW_INTRINSICS) + case GT_HWINTRINSIC: +#endif + if (TVisitor::UseExecutionOrder && node->IsReverseOp()) + { + assert(node->AsMultiOp()->GetOperandCount() == 2); + + result = WalkTree(&node->AsMultiOp()->Op(2), node); + if (result == fgWalkResult::WALK_ABORT) + { + return result; + } + result = WalkTree(&node->AsMultiOp()->Op(1), node); + if (result == fgWalkResult::WALK_ABORT) + { + return result; + } + } + else + { + for (GenTree** use : node->AsMultiOp()->UseEdges()) + { + result = WalkTree(use, node); + if (result == fgWalkResult::WALK_ABORT) + { + return result; + } + } + } + break; +#endif // defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) + // Binary nodes default: { @@ -11955,7 +12001,9 @@ const instruction INS_SQRT = INS_vsqrt; const instruction INS_MULADD = INS_madd; inline const instruction INS_BREAKPOINT_osHelper() { - return TargetOS::IsUnix ? INS_brk : INS_bkpt; + // GDB needs the encoding of brk #0 + // Windbg needs the encoding of brk #F000 + return TargetOS::IsUnix ? INS_brk_unix : INS_brk_windows; } #define INS_BREAKPOINT INS_BREAKPOINT_osHelper() diff --git a/src/coreclr/jit/compiler.hpp b/src/coreclr/jit/compiler.hpp index 0c446f2020d0b9..8fad38af36f846 100644 --- a/src/coreclr/jit/compiler.hpp +++ b/src/coreclr/jit/compiler.hpp @@ -543,7 +543,7 @@ extern const BYTE genTypeSizes[TYP_COUNT]; template inline unsigned genTypeSize(T value) { - assert((unsigned)TypeGet(value) < _countof(genTypeSizes)); + assert((unsigned)TypeGet(value) < ArrLen(genTypeSizes)); return genTypeSizes[TypeGet(value)]; } @@ -559,7 +559,7 @@ extern const BYTE genTypeStSzs[TYP_COUNT]; template inline unsigned genTypeStSz(T value) { - assert((unsigned)TypeGet(value) < _countof(genTypeStSzs)); + assert((unsigned)TypeGet(value) < ArrLen(genTypeStSzs)); return genTypeStSzs[TypeGet(value)]; } @@ -822,9 +822,16 @@ inline GenTree::GenTree(genTreeOps oper, var_types type DEBUGARG(bool largeNode) /*****************************************************************************/ -inline Statement* Compiler::gtNewStmt(GenTree* expr, IL_OFFSETX offset) +inline Statement* Compiler::gtNewStmt(GenTree* expr) { - Statement* stmt = new (this->getAllocator(CMK_ASTNode)) Statement(expr, offset DEBUGARG(compStatementID++)); + Statement* stmt = new (this->getAllocator(CMK_ASTNode)) Statement(expr DEBUGARG(compStatementID++)); + return stmt; +} + +inline Statement* Compiler::gtNewStmt(GenTree* expr, const DebugInfo& di) +{ + Statement* stmt = gtNewStmt(expr); + stmt->SetDebugInfo(di); return stmt; } @@ -1377,6 +1384,10 @@ inline void GenTree::SetOperRaw(genTreeOps oper) // Please do not do anything here other than assign to gtOper (debug-only // code is OK, but should be kept to a minimum). RecordOperBashing(OperGet(), oper); // nop unless NODEBASH_STATS is enabled + + // Bashing to MultiOp nodes is not currently supported. + assert(!OperIsMultiOp(oper)); + gtOper = oper; } @@ -1778,7 +1789,7 @@ inline unsigned Compiler::lvaGrabTempWithImplicitUse(bool shortLifetime DEBUGARG unsigned lclNum = lvaGrabTemp(shortLifetime DEBUGARG(reason)); - LclVarDsc* varDsc = &lvaTable[lclNum]; + LclVarDsc* varDsc = lvaGetDesc(lclNum); // Note the implicit use varDsc->lvImplicitlyReferenced = 1; @@ -1866,7 +1877,7 @@ inline void LclVarDsc::incRefCnts(weight_t weight, Compiler* comp, RefCountState { // Depending on the promotion type, increment the ref count for the parent struct as well. promotionType = comp->lvaGetParentPromotionType(this); - LclVarDsc* parentvarDsc = &comp->lvaTable[lvParentLcl]; + LclVarDsc* parentvarDsc = comp->lvaGetDesc(lvParentLcl); assert(!parentvarDsc->lvRegStruct); if (promotionType == Compiler::PROMOTION_TYPE_DEPENDENT) { @@ -1877,9 +1888,7 @@ inline void LclVarDsc::incRefCnts(weight_t weight, Compiler* comp, RefCountState #ifdef DEBUG if (comp->verbose) { - unsigned varNum = (unsigned)(this - comp->lvaTable); - assert(&comp->lvaTable[varNum] == this); - printf("New refCnts for V%02u: refCnt = %2u, refCntWtd = %s\n", varNum, lvRefCnt(state), + printf("New refCnts for V%02u: refCnt = %2u, refCntWtd = %s\n", comp->lvaGetLclNum(this), lvRefCnt(state), refCntWtd2str(lvRefCntWtd(state))); } #endif @@ -1893,9 +1902,7 @@ inline void LclVarDsc::incRefCnts(weight_t weight, Compiler* comp, RefCountState inline VARSET_VALRET_TP Compiler::lvaStmtLclMask(Statement* stmt) { - unsigned varNum; - LclVarDsc* varDsc; - VARSET_TP lclMask(VarSetOps::MakeEmpty(this)); + VARSET_TP lclMask(VarSetOps::MakeEmpty(this)); assert(fgStmtListThreaded); @@ -1906,9 +1913,7 @@ inline VARSET_VALRET_TP Compiler::lvaStmtLclMask(Statement* stmt) continue; } - varNum = tree->AsLclVarCommon()->GetLclNum(); - assert(varNum < lvaCount); - varDsc = lvaTable + varNum; + const LclVarDsc* varDsc = lvaGetDesc(tree->AsLclVarCommon()); if (!varDsc->lvTracked) { @@ -2067,11 +2072,8 @@ inline bool fConservative = false; if (varNum >= 0) { - LclVarDsc* varDsc; - - assert((unsigned)varNum < lvaCount); - varDsc = lvaTable + varNum; - bool isPrespilledArg = false; + LclVarDsc* varDsc = lvaGetDesc(varNum); + bool isPrespilledArg = false; #if defined(TARGET_ARM) && defined(PROFILING_SUPPORTED) isPrespilledArg = varDsc->lvIsParam && compIsProfilerHookNeeded() && lvaIsPreSpilled(varNum, codeGen->regSet.rsMaskPreSpillRegs(false)); @@ -2237,21 +2239,13 @@ inline inline bool Compiler::lvaIsParameter(unsigned varNum) { - LclVarDsc* varDsc; - - assert(varNum < lvaCount); - varDsc = lvaTable + varNum; - + const LclVarDsc* varDsc = lvaGetDesc(varNum); return varDsc->lvIsParam; } inline bool Compiler::lvaIsRegArgument(unsigned varNum) { - LclVarDsc* varDsc; - - assert(varNum < lvaCount); - varDsc = lvaTable + varNum; - + LclVarDsc* varDsc = lvaGetDesc(varNum); return varDsc->lvIsRegArg; } @@ -2264,7 +2258,7 @@ inline bool Compiler::lvaIsOriginalThisArg(unsigned varNum) #ifdef DEBUG if (isOriginalThisArg) { - LclVarDsc* varDsc = lvaTable + varNum; + LclVarDsc* varDsc = lvaGetDesc(varNum); // Should never write to or take the address of the original 'this' arg CLANG_FORMAT_COMMENT_ANCHOR; @@ -3243,7 +3237,7 @@ inline void Compiler::optAssertionReset(AssertionIndex limit) AssertionDsc* curAssertion = optGetAssertion(index); optAssertionCount--; unsigned lclNum = curAssertion->op1.lcl.lclNum; - assert(lclNum < lvaTableCnt); + assert(lclNum < lvaCount); BitVecOps::RemoveElemD(apTraits, GetAssertionDep(lclNum), index - 1); // @@ -3610,17 +3604,6 @@ inline CorInfoHelpFunc Compiler::eeGetHelperNum(CORINFO_METHOD_HANDLE method) return ((CorInfoHelpFunc)(((size_t)method) >> 2)); } -inline Compiler::fgWalkResult Compiler::CountSharedStaticHelper(GenTree** pTree, fgWalkData* data) -{ - if (Compiler::IsSharedStaticHelper(*pTree)) - { - int* pCount = (int*)data->pCallbackData; - (*pCount)++; - } - - return WALK_CONTINUE; -} - // TODO-Cleanup: Replace calls to IsSharedStaticHelper with new HelperCallProperties // @@ -3639,9 +3622,8 @@ inline bool Compiler::IsSharedStaticHelper(GenTree* tree) helper == CORINFO_HELP_STRCNS || helper == CORINFO_HELP_BOX || // helpers being added to IsSharedStaticHelper - helper == CORINFO_HELP_GETSTATICFIELDADDR_CONTEXT || helper == CORINFO_HELP_GETSTATICFIELDADDR_TLS || - helper == CORINFO_HELP_GETGENERICS_GCSTATIC_BASE || helper == CORINFO_HELP_GETGENERICS_NONGCSTATIC_BASE || - helper == CORINFO_HELP_GETGENERICS_GCTHREADSTATIC_BASE || + helper == CORINFO_HELP_GETSTATICFIELDADDR_TLS || helper == CORINFO_HELP_GETGENERICS_GCSTATIC_BASE || + helper == CORINFO_HELP_GETGENERICS_NONGCSTATIC_BASE || helper == CORINFO_HELP_GETGENERICS_GCTHREADSTATIC_BASE || helper == CORINFO_HELP_GETGENERICS_NONGCTHREADSTATIC_BASE || helper == CORINFO_HELP_GETSHARED_GCSTATIC_BASE || helper == CORINFO_HELP_GETSHARED_NONGCSTATIC_BASE || @@ -3667,34 +3649,30 @@ inline bool Compiler::IsSharedStaticHelper(GenTree* tree) return result1; } -inline bool Compiler::IsGcSafePoint(GenTree* tree) +inline bool Compiler::IsGcSafePoint(GenTreeCall* call) { - if (tree->IsCall()) + if (!call->IsFastTailCall()) { - GenTreeCall* call = tree->AsCall(); - if (!call->IsFastTailCall()) + if (call->IsUnmanaged() && call->IsSuppressGCTransition()) { - if (call->IsUnmanaged() && call->IsSuppressGCTransition()) - { - // Both an indirect and user calls can be unmanaged - // and have a request to suppress the GC transition so - // the check is done prior to the separate handling of - // indirect and user calls. - return false; - } - else if (call->gtCallType == CT_INDIRECT) + // Both an indirect and user calls can be unmanaged + // and have a request to suppress the GC transition so + // the check is done prior to the separate handling of + // indirect and user calls. + return false; + } + else if (call->gtCallType == CT_INDIRECT) + { + return true; + } + else if (call->gtCallType == CT_USER_FUNC) + { + if ((call->gtCallMoreFlags & GTF_CALL_M_NOGCCHECK) == 0) { return true; } - else if (call->gtCallType == CT_USER_FUNC) - { - if ((call->gtCallMoreFlags & GTF_CALL_M_NOGCCHECK) == 0) - { - return true; - } - } - // otherwise we have a CT_HELPER } + // otherwise we have a CT_HELPER } return false; @@ -3773,59 +3751,6 @@ inline bool Compiler::compIsProfilerHookNeeded() #endif // !PROFILING_SUPPORTED } -/***************************************************************************** - * - * Check for the special case where the object is the constant 0. - * As we can't even fold the tree (null+fldOffs), we are left with - * op1 and op2 both being a constant. This causes lots of problems. - * We simply grab a temp and assign 0 to it and use it in place of the NULL. - */ - -inline GenTree* Compiler::impCheckForNullPointer(GenTree* obj) -{ - /* If it is not a GC type, we will be able to fold it. - So don't need to do anything */ - - if (!varTypeIsGC(obj->TypeGet())) - { - return obj; - } - - if (obj->gtOper == GT_CNS_INT) - { - assert(obj->gtType == TYP_REF || obj->gtType == TYP_BYREF); - - // We can see non-zero byrefs for RVA statics or for frozen strings. - if (obj->AsIntCon()->gtIconVal != 0) - { -#ifdef DEBUG - if (!obj->TypeIs(TYP_BYREF)) - { - assert(obj->TypeIs(TYP_REF)); - assert(obj->IsIconHandle(GTF_ICON_STR_HDL)); - if (!doesMethodHaveFrozenString()) - { - assert(compIsForInlining()); - assert(impInlineInfo->InlinerCompiler->doesMethodHaveFrozenString()); - } - } -#endif // DEBUG - return obj; - } - - unsigned tmp = lvaGrabTemp(true DEBUGARG("CheckForNullPointer")); - - // We don't need to spill while appending as we are only assigning - // NULL to a freshly-grabbed temp. - - impAssignTempGen(tmp, obj, (unsigned)CHECK_SPILL_NONE); - - obj = gtNewLclvNode(tmp, obj->gtType); - } - - return obj; -} - /***************************************************************************** * * Check for the special case where the object is the methods original 'this' pointer. @@ -3961,8 +3886,7 @@ inline Compiler::lvaPromotionType Compiler::lvaGetPromotionType(const LclVarDsc* inline Compiler::lvaPromotionType Compiler::lvaGetPromotionType(unsigned varNum) { - assert(varNum < lvaCount); - return lvaGetPromotionType(&lvaTable[varNum]); + return lvaGetPromotionType(lvaGetDesc(varNum)); } /***************************************************************************** @@ -3973,7 +3897,6 @@ inline Compiler::lvaPromotionType Compiler::lvaGetPromotionType(unsigned varNum) inline Compiler::lvaPromotionType Compiler::lvaGetParentPromotionType(const LclVarDsc* varDsc) { assert(varDsc->lvIsStructField); - assert(varDsc->lvParentLcl < lvaCount); lvaPromotionType promotionType = lvaGetPromotionType(varDsc->lvParentLcl); assert(promotionType != PROMOTION_TYPE_NONE); @@ -3987,8 +3910,7 @@ inline Compiler::lvaPromotionType Compiler::lvaGetParentPromotionType(const LclV inline Compiler::lvaPromotionType Compiler::lvaGetParentPromotionType(unsigned varNum) { - assert(varNum < lvaCount); - return lvaGetParentPromotionType(&lvaTable[varNum]); + return lvaGetParentPromotionType(lvaGetDesc(varNum)); } /***************************************************************************** @@ -4311,6 +4233,7 @@ void GenTree::VisitOperands(TVisitor visitor) case GT_BOX: case GT_ALLOCOBJ: case GT_INIT_VAL: + case GT_RUNTIMELOOKUP: case GT_JTRUE: case GT_SWITCH: case GT_NULLCHECK: @@ -4327,32 +4250,22 @@ void GenTree::VisitOperands(TVisitor visitor) return; // Variadic nodes -#ifdef FEATURE_SIMD +#if defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) +#if defined(FEATURE_SIMD) case GT_SIMD: - if (this->AsSIMD()->gtSIMDIntrinsicID == SIMDIntrinsicInitN) - { - assert(this->AsSIMD()->gtOp1 != nullptr); - this->AsSIMD()->gtOp1->VisitListOperands(visitor); - } - else - { - VisitBinOpOperands(visitor); - } - return; -#endif // FEATURE_SIMD - -#ifdef FEATURE_HW_INTRINSICS +#endif +#if defined(FEATURE_HW_INTRINSICS) case GT_HWINTRINSIC: - if ((this->AsHWIntrinsic()->gtOp1 != nullptr) && this->AsHWIntrinsic()->gtOp1->OperIsList()) - { - this->AsHWIntrinsic()->gtOp1->VisitListOperands(visitor); - } - else +#endif + for (GenTree* operand : this->AsMultiOp()->Operands()) { - VisitBinOpOperands(visitor); + if (visitor(operand) == VisitResult::Abort) + { + break; + } } return; -#endif // FEATURE_HW_INTRINSICS +#endif // defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) // Special nodes case GT_PHI: @@ -4498,20 +4411,6 @@ void GenTree::VisitOperands(TVisitor visitor) } } -template -GenTree::VisitResult GenTree::VisitListOperands(TVisitor visitor) -{ - for (GenTreeArgList* node = this->AsArgList(); node != nullptr; node = node->Rest()) - { - if (visitor(node->gtOp1) == VisitResult::Abort) - { - return VisitResult::Abort; - } - } - - return VisitResult::Continue; -} - template void GenTree::VisitBinOpOperands(TVisitor visitor) { @@ -4778,6 +4677,45 @@ inline void LclVarDsc::setLvRefCntWtd(weight_t newValue, RefCountState state) m_lvRefCntWtd = newValue; } +//------------------------------------------------------------------------------ +// compCanHavePatchpoints: return true if patchpoints are supported in this +// method. +// +// Arguments: +// reason - [out, optional] reason why patchpoints are not supported +// +// Returns: +// True if patchpoints are supported in this method. +// +inline bool Compiler::compCanHavePatchpoints(const char** reason) +{ + const char* whyNot = nullptr; + +#ifdef FEATURE_ON_STACK_REPLACEMENT + if (compLocallocSeen) + { + whyNot = "localloc"; + } + else if (compHasBackwardJumpInHandler) + { + whyNot = "loop in handler"; + } + else if (opts.IsReversePInvoke()) + { + whyNot = "reverse pinvoke"; + } +#else + whyNot = "OSR feature not defined in build"; +#endif + + if (reason != nullptr) + { + *reason = whyNot; + } + + return whyNot == nullptr; +} + /*****************************************************************************/ #endif //_COMPILER_HPP_ /*****************************************************************************/ diff --git a/src/coreclr/jit/compphases.h b/src/coreclr/jit/compphases.h index bb992440f8e3d4..b8805fca753529 100644 --- a/src/coreclr/jit/compphases.h +++ b/src/coreclr/jit/compphases.h @@ -87,6 +87,7 @@ CompPhaseNameMacro(PHASE_INSERT_GC_POLLS, "Insert GC Polls", CompPhaseNameMacro(PHASE_DETERMINE_FIRST_COLD_BLOCK, "Determine first cold block", "COLD-BLK", false, -1, true) CompPhaseNameMacro(PHASE_RATIONALIZE, "Rationalize IR", "RAT", false, -1, false) CompPhaseNameMacro(PHASE_SIMPLE_LOWERING, "Do 'simple' lowering", "SMP-LWR", false, -1, false) +CompPhaseNameMacro(PHASE_ALIGN_LOOPS, "Place 'align' instructions", "LOOP-ALIGN", false, -1, false) CompPhaseNameMacro(PHASE_LCLVARLIVENESS, "Local var liveness", "LIVENESS", true, -1, false) CompPhaseNameMacro(PHASE_LCLVARLIVENESS_INIT, "Local var liveness init", "LIV-INIT", false, PHASE_LCLVARLIVENESS, false) diff --git a/src/coreclr/jit/copyprop.cpp b/src/coreclr/jit/copyprop.cpp index 6e0583c043e587..1c80436902f90e 100644 --- a/src/coreclr/jit/copyprop.cpp +++ b/src/coreclr/jit/copyprop.cpp @@ -213,7 +213,7 @@ void Compiler::optCopyProp(BasicBlock* block, Statement* stmt, GenTree* tree, Lc { continue; } - if (optCopyProp_LclVarScore(&lvaTable[lclNum], &lvaTable[newLclNum], true) <= 0) + if (optCopyProp_LclVarScore(lvaGetDesc(lclNum), lvaGetDesc(newLclNum), true) <= 0) { continue; } diff --git a/src/coreclr/jit/debuginfo.cpp b/src/coreclr/jit/debuginfo.cpp new file mode 100644 index 00000000000000..ed5edeb113da3d --- /dev/null +++ b/src/coreclr/jit/debuginfo.cpp @@ -0,0 +1,145 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "jitpch.h" +#include "debuginfo.h" + +#ifdef DEBUG +//------------------------------------------------------------------------ +// Dump: Print a textual representation of this ILLocation. +// +// Notes: +// For invalid ILLocations, we print '???'. +// Otherwise the offset and flags are printed in the format 0xabc[EC]. +// +void ILLocation::Dump() const +{ + if (!IsValid()) + { + printf("???"); + } + else + { + printf("0x%03X[", GetOffset()); + printf("%c", IsStackEmpty() ? 'E' : '-'); + printf("%c", IsCall() ? 'C' : '-'); + printf("]"); + } +} + +//------------------------------------------------------------------------ +// Dump: Print a textual representation of this DebugInfo. +// +// Parameters: +// recurse - print the full path back to the root, separated by arrows. +// +// Notes: +// The DebugInfo is printed in the format +// +// INL02 @ 0xabc[EC] +// +// Before '@' is the ordinal of the inline context, then comes the IL +// offset, and then comes the IL location flags (stack Empty, isCall). +// +// If 'recurse' is specified then dump the full DebugInfo path to the +// root in the format +// +// INL02 @ 0xabc[EC] <- INL01 @ 0x123[EC] <- ... <- INLRT @ 0x456[EC] +// +// with the left most entry being the inner most inlined statement. +void DebugInfo::Dump(bool recurse) const +{ + InlineContext* context = GetInlineContext(); + if (context != nullptr) + { + if (context->IsRoot()) + { + printf("INLRT @ "); + } + else if (context->GetOrdinal() != 0) + { + printf(FMT_INL_CTX " @ ", context->GetOrdinal()); + } + } + + GetLocation().Dump(); + + DebugInfo par; + if (recurse && GetParent(&par)) + { + printf(" <- "); + par.Dump(recurse); + } +} + +//------------------------------------------------------------------------ +// Validate: Validate this DebugInfo instance. +// +// Notes: +// This validates that if there is DebugInfo, then it looks sane by checking +// that the IL location correctly points to the beginning of an IL instruction. +// +void DebugInfo::Validate() const +{ + DebugInfo di = *this; + do + { + if (!di.IsValid()) + continue; + + bool isValidOffs = di.GetLocation().GetOffset() < di.GetInlineContext()->GetILSize(); + if (isValidOffs) + { + bool isValidStart = di.GetInlineContext()->GetILInstsSet()->bitVectTest(di.GetLocation().GetOffset()); + assert(isValidStart && + "Detected invalid debug info: IL offset does not refer to the start of an IL instruction"); + } + else + { + assert(!"Detected invalid debug info: IL offset is out of range"); + } + + } while (di.GetParent(&di)); +} +#endif + +//------------------------------------------------------------------------ +// GetParent: Get debug info for the parent statement that inlined the +// statement for this debug info. +// +// Parameters: +// parent [out] - Debug info for the location that inlined this statement. +// +// Return Value: +// True if the current debug info is valid and has a parent; otherwise false. +// On false return, the 'parent' parameter is unaffected. +// +bool DebugInfo::GetParent(DebugInfo* parent) const +{ + if ((m_inlineContext == nullptr) || m_inlineContext->IsRoot()) + return false; + + *parent = DebugInfo(m_inlineContext->GetParent(), m_inlineContext->GetLocation()); + return true; +} + +//------------------------------------------------------------------------ +// GetRoot: Get debug info for the statement in the root function that +// eventually led to this debug info through inlines. +// +// Return Value: +// If this DebugInfo instance is valid, returns a DebugInfo instance +// representing the call in the root function that eventually inlined the +// statement this DebugInfo describes. +// +// If this DebugInfo instance is invalid, returns an invalid DebugInfo instance. +// +DebugInfo DebugInfo::GetRoot() const +{ + DebugInfo result = *this; + while (result.GetParent(&result)) + { + } + + return result; +} diff --git a/src/coreclr/jit/debuginfo.h b/src/coreclr/jit/debuginfo.h new file mode 100644 index 00000000000000..c107c3dc519de8 --- /dev/null +++ b/src/coreclr/jit/debuginfo.h @@ -0,0 +1,136 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef _DEBUGINFO_H_ +#define _DEBUGINFO_H_ + +#include "jit.h" + +class InlineContext; + +// Represents information about the location of an IL instruction. +class ILLocation +{ +public: + ILLocation() : m_offset(BAD_IL_OFFSET), m_isStackEmpty(false), m_isCall(false) + { + } + + ILLocation(IL_OFFSET offset, bool isStackEmpty, bool isCall) + : m_offset(offset), m_isStackEmpty(isStackEmpty), m_isCall(isCall) + { + } + + IL_OFFSET GetOffset() const + { + return m_offset; + } + + // Is this source location at a stack empty point? We need to be able to + // report this information back to the debugger since we only allow EnC + // transitions at stack empty points. + bool IsStackEmpty() const + { + return m_isStackEmpty; + } + + // Is this a call instruction? Used for managed return values. + bool IsCall() const + { + return m_isCall; + } + + bool IsValid() const + { + return m_offset != BAD_IL_OFFSET; + } + + inline bool operator==(const ILLocation& other) const + { + return (m_offset == other.m_offset) && (m_isStackEmpty == other.m_isStackEmpty) && (m_isCall == other.m_isCall); + } + + inline bool operator!=(const ILLocation& other) const + { + return !(*this == other); + } + +#ifdef DEBUG + // Dump textual representation of this ILLocation to jitstdout. + void Dump() const; +#endif + +private: + IL_OFFSET m_offset; + bool m_isStackEmpty : 1; + bool m_isCall : 1; +}; + +// Represents debug information about a statement. +class DebugInfo +{ +public: + DebugInfo() : m_inlineContext(nullptr) + { + } + + DebugInfo(InlineContext* inlineContext, ILLocation loc) : m_inlineContext(inlineContext), m_location(loc) + { + } + + InlineContext* GetInlineContext() const + { + return m_inlineContext; + } + + ILLocation GetLocation() const + { + return m_location; + } + + // Retrieve information about the location that inlined this statement. + // Note that there can be associated parent information even when IsValid + // below returns false. + bool GetParent(DebugInfo* parent) const; + + // Get debug info in the root. If this debug info is in the root, then + // returns *this. Otherwise returns information of the call in the root + // that eventually produced this statement through inlines. + DebugInfo GetRoot() const; + +#ifdef DEBUG + void Validate() const; +#else + void Validate() const + { + } +#endif + +#ifdef DEBUG + // Dump textual representation of this DebugInfo to jitstdout. + void Dump(bool recurse) const; +#endif + + // Check if this debug info has both a valid inline context and valid + // location. + bool IsValid() const + { + return m_inlineContext != nullptr && m_location.IsValid(); + } + + inline bool operator==(const DebugInfo& other) const + { + return (m_inlineContext == other.m_inlineContext) && (m_location == other.m_location); + } + + inline bool operator!=(const DebugInfo& other) const + { + return !(*this == other); + } + +private: + InlineContext* m_inlineContext; + ILLocation m_location; +}; + +#endif diff --git a/src/coreclr/jit/decomposelongs.cpp b/src/coreclr/jit/decomposelongs.cpp index 50a1c054062852..9b75e4c73727b9 100644 --- a/src/coreclr/jit/decomposelongs.cpp +++ b/src/coreclr/jit/decomposelongs.cpp @@ -124,7 +124,7 @@ GenTree* DecomposeLongs::DecomposeNode(GenTree* tree) // Handle the case where we are implicitly using the lower half of a long lclVar. if ((tree->TypeGet() == TYP_INT) && tree->OperIsLocal()) { - LclVarDsc* varDsc = m_compiler->lvaTable + tree->AsLclVarCommon()->GetLclNum(); + LclVarDsc* varDsc = m_compiler->lvaGetDesc(tree->AsLclVarCommon()); if (varTypeIsLong(varDsc) && varDsc->lvPromoted) { #ifdef DEBUG @@ -346,7 +346,7 @@ GenTree* DecomposeLongs::DecomposeLclVar(LIR::Use& use) GenTree* tree = use.Def(); unsigned varNum = tree->AsLclVarCommon()->GetLclNum(); - LclVarDsc* varDsc = m_compiler->lvaTable + varNum; + LclVarDsc* varDsc = m_compiler->lvaGetDesc(varNum); GenTree* loResult = tree; loResult->gtType = TYP_INT; @@ -426,8 +426,7 @@ GenTree* DecomposeLongs::DecomposeStoreLclVar(LIR::Use& use) noway_assert(rhs->OperGet() == GT_LONG); - unsigned varNum = tree->AsLclVarCommon()->GetLclNum(); - LclVarDsc* varDsc = m_compiler->lvaTable + varNum; + const LclVarDsc* varDsc = m_compiler->lvaGetDesc(tree->AsLclVarCommon()); if (!varDsc->lvPromoted) { // We cannot decompose a st.lclVar that is not promoted because doing so @@ -1650,7 +1649,7 @@ GenTree* DecomposeLongs::DecomposeHWIntrinsic(LIR::Use& use) GenTreeHWIntrinsic* hwintrinsicTree = tree->AsHWIntrinsic(); - switch (hwintrinsicTree->gtHWIntrinsicId) + switch (hwintrinsicTree->GetHWIntrinsicId()) { case NI_Vector128_GetElement: case NI_Vector256_GetElement: @@ -1693,10 +1692,11 @@ GenTree* DecomposeLongs::DecomposeHWIntrinsicGetElement(LIR::Use& use, GenTreeHW { assert(node == use.Def()); assert(varTypeIsLong(node)); - assert((node->gtHWIntrinsicId == NI_Vector128_GetElement) || (node->gtHWIntrinsicId == NI_Vector256_GetElement)); + assert((node->GetHWIntrinsicId() == NI_Vector128_GetElement) || + (node->GetHWIntrinsicId() == NI_Vector256_GetElement)); - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); + GenTree* op1 = node->Op(1); + GenTree* op2 = node->Op(2); var_types simdBaseType = node->GetSimdBaseType(); unsigned simdSize = node->GetSimdSize(); @@ -1712,24 +1712,24 @@ GenTree* DecomposeLongs::DecomposeHWIntrinsicGetElement(LIR::Use& use, GenTreeHW index = op2->AsIntCon()->IconValue(); } - GenTree* simdTmpVar = RepresentOpAsLocalVar(op1, node, &node->gtOp1); + GenTree* simdTmpVar = RepresentOpAsLocalVar(op1, node, &node->Op(1)); unsigned simdTmpVarNum = simdTmpVar->AsLclVarCommon()->GetLclNum(); JITDUMP("[DecomposeHWIntrinsicGetElement]: Saving op1 tree to a temp var:\n"); DISPTREERANGE(Range(), simdTmpVar); Range().Remove(simdTmpVar); - op1 = node->gtGetOp1(); + op1 = node->Op(1); GenTree* indexTmpVar = nullptr; unsigned indexTmpVarNum = 0; if (!indexIsConst) { - indexTmpVar = RepresentOpAsLocalVar(op2, node, &node->gtOp2); + indexTmpVar = RepresentOpAsLocalVar(op2, node, &node->Op(2)); indexTmpVarNum = indexTmpVar->AsLclVarCommon()->GetLclNum(); JITDUMP("[DecomposeHWIntrinsicGetElement]: Saving op2 tree to a temp var:\n"); DISPTREERANGE(Range(), indexTmpVar); Range().Remove(indexTmpVar); - op2 = node->gtGetOp2(); + op2 = node->Op(2); } // Create: @@ -1756,7 +1756,7 @@ GenTree* DecomposeLongs::DecomposeHWIntrinsicGetElement(LIR::Use& use, GenTreeHW } GenTree* loResult = m_compiler->gtNewSimdHWIntrinsicNode(TYP_INT, simdTmpVar1, indexTimesTwo1, - node->gtHWIntrinsicId, CORINFO_TYPE_INT, simdSize); + node->GetHWIntrinsicId(), CORINFO_TYPE_INT, simdSize); Range().InsertBefore(node, loResult); // Create: @@ -1782,7 +1782,7 @@ GenTree* DecomposeLongs::DecomposeHWIntrinsicGetElement(LIR::Use& use, GenTreeHW } GenTree* hiResult = m_compiler->gtNewSimdHWIntrinsicNode(TYP_INT, simdTmpVar2, indexTimesTwoPlusOne, - node->gtHWIntrinsicId, CORINFO_TYPE_INT, simdSize); + node->GetHWIntrinsicId(), CORINFO_TYPE_INT, simdSize); Range().InsertBefore(node, hiResult); // Done with the original tree; remove it. diff --git a/src/coreclr/jit/disasm.cpp b/src/coreclr/jit/disasm.cpp index 9a91b457107d7e..d92013ed80dd27 100644 --- a/src/coreclr/jit/disasm.cpp +++ b/src/coreclr/jit/disasm.cpp @@ -1102,7 +1102,7 @@ size_t DisAssembler::CbDisassemble(DIS* pdis, } wchar_t wz[MAX_CLASSNAME_LENGTH]; - pdis->CchFormatInstr(wz, _countof(wz)); + pdis->CchFormatInstr(wz, ArrLen(wz)); if (printit) { @@ -1133,7 +1133,7 @@ size_t DisAssembler::CbDisassemble(DIS* pdis, wchar_t wzBytes[MAX_CLASSNAME_LENGTH]; assert(cchBytesMax < MAX_CLASSNAME_LENGTH); - size_t cchBytes = pdis->CchFormatBytes(wzBytes, _countof(wzBytes)); + size_t cchBytes = pdis->CchFormatBytes(wzBytes, ArrLen(wzBytes)); if (cchBytes > CCH_INDENT) { @@ -1168,7 +1168,7 @@ size_t CbDisassembleWithBytes(DIS* pdis, DIS::ADDR addr, const BYTE* pb, size_t wchar_t wz[MAX_CLASSNAME_LENGTH]; - pdis->CchFormatAddr(addr, wz, _countof(wz)); + pdis->CchFormatAddr(addr, wz, ArrLen(wz)); size_t cchIndent = (size_t)fprintf(pfile, " %ls: ", wz); @@ -1190,7 +1190,7 @@ size_t CbDisassembleWithBytes(DIS* pdis, DIS::ADDR addr, const BYTE* pb, size_t } wchar_t wzBytes[64]; - size_t cchBytes = pdis->CchFormatBytes(wzBytes, _countof(wzBytes)); + size_t cchBytes = pdis->CchFormatBytes(wzBytes, ArrLen(wzBytes)); wchar_t* pwzBytes; wchar_t* pwzNext; @@ -1228,7 +1228,7 @@ size_t CbDisassembleWithBytes(DIS* pdis, DIS::ADDR addr, const BYTE* pb, size_t if (fFirst) { - pdis->CchFormatInstr(wz, _countof(wz)); + pdis->CchFormatInstr(wz, ArrLen(wz)); fprintf(pfile, "%-*ls %ls\n", cchBytesMax, pwzBytes, wz); } diff --git a/src/coreclr/jit/earlyprop.cpp b/src/coreclr/jit/earlyprop.cpp index 74f3c36c1bb185..e4b29df2166dd9 100644 --- a/src/coreclr/jit/earlyprop.cpp +++ b/src/coreclr/jit/earlyprop.cpp @@ -700,7 +700,7 @@ bool Compiler::optIsNullCheckFoldingLegal(GenTree* tree, assert(fgStmtListThreaded); while (canRemoveNullCheck && (currentTree != tree) && (currentTree != nullptr)) { - if ((*nullCheckParent == nullptr) && (nullCheckTree->gtGetChildPointer(currentTree) != nullptr)) + if ((*nullCheckParent == nullptr) && currentTree->TryGetUse(nullCheckTree)) { *nullCheckParent = currentTree; } diff --git a/src/coreclr/jit/ee_il_dll.cpp b/src/coreclr/jit/ee_il_dll.cpp index 07ad7dfc90b9cd..ebf1ea2945195f 100644 --- a/src/coreclr/jit/ee_il_dll.cpp +++ b/src/coreclr/jit/ee_il_dll.cpp @@ -608,7 +608,17 @@ void Compiler::eeGetStmtOffsets() uint32_t* offsets; ICorDebugInfo::BoundaryTypes offsetsImplicit; - info.compCompHnd->getBoundaries(info.compMethodHnd, &offsetsCount, &offsets, &offsetsImplicit); + if (compIsForInlining()) + { + // We do not get explicit boundaries for inlinees, only implicit ones. + offsetsImplicit = impInlineRoot()->info.compStmtOffsetsImplicit; + offsetsCount = 0; + offsets = nullptr; + } + else + { + info.compCompHnd->getBoundaries(info.compMethodHnd, &offsetsCount, &offsets, &offsetsImplicit); + } /* Set the implicit boundaries */ @@ -960,7 +970,8 @@ void Compiler::eeSetLIcount(unsigned count) eeBoundariesCount = count; if (eeBoundariesCount) { - eeBoundaries = (boundariesDsc*)info.compCompHnd->allocateArray(eeBoundariesCount * sizeof(eeBoundaries[0])); + eeBoundaries = + (ICorDebugInfo::OffsetMapping*)info.compCompHnd->allocateArray(eeBoundariesCount * sizeof(eeBoundaries[0])); } else { @@ -968,19 +979,39 @@ void Compiler::eeSetLIcount(unsigned count) } } -void Compiler::eeSetLIinfo( - unsigned which, UNATIVE_OFFSET nativeOffset, IL_OFFSET ilOffset, bool stkEmpty, bool callInstruction) +void Compiler::eeSetLIinfo(unsigned which, UNATIVE_OFFSET nativeOffset, IPmappingDscKind kind, const ILLocation& loc) { assert(opts.compDbgInfo); - assert(eeBoundariesCount > 0); + assert(eeBoundariesCount > 0 && eeBoundaries != nullptr); assert(which < eeBoundariesCount); - if (eeBoundaries != nullptr) + eeBoundaries[which].nativeOffset = nativeOffset; + eeBoundaries[which].source = (ICorDebugInfo::SourceTypes)0; + + switch (kind) { - eeBoundaries[which].nativeIP = nativeOffset; - eeBoundaries[which].ilOffset = ilOffset; - eeBoundaries[which].sourceReason = stkEmpty ? ICorDebugInfo::STACK_EMPTY : 0; - eeBoundaries[which].sourceReason |= callInstruction ? ICorDebugInfo::CALL_INSTRUCTION : 0; + int source; + + case IPmappingDscKind::Normal: + eeBoundaries[which].ilOffset = loc.GetOffset(); + source = loc.IsStackEmpty() ? ICorDebugInfo::STACK_EMPTY : 0; + source |= loc.IsCall() ? ICorDebugInfo::CALL_INSTRUCTION : 0; + eeBoundaries[which].source = (ICorDebugInfo::SourceTypes)source; + break; + case IPmappingDscKind::Prolog: + eeBoundaries[which].ilOffset = ICorDebugInfo::PROLOG; + eeBoundaries[which].source = ICorDebugInfo::STACK_EMPTY; + break; + case IPmappingDscKind::Epilog: + eeBoundaries[which].ilOffset = ICorDebugInfo::EPILOG; + eeBoundaries[which].source = ICorDebugInfo::STACK_EMPTY; + break; + case IPmappingDscKind::NoMapping: + eeBoundaries[which].ilOffset = ICorDebugInfo::NO_MAPPING; + eeBoundaries[which].source = ICorDebugInfo::STACK_EMPTY; + break; + default: + unreached(); } } @@ -1005,8 +1036,13 @@ void Compiler::eeSetLIdone() #if defined(DEBUG) -/* static */ void Compiler::eeDispILOffs(IL_OFFSET offs) +{ + printf("0x%04X", offs); +} + +/* static */ +void Compiler::eeDispSourceMappingOffs(uint32_t offs) { const char* specialOffs[] = {"EPILOG", "PROLOG", "NO_MAP"}; @@ -1022,33 +1058,34 @@ void Compiler::eeDispILOffs(IL_OFFSET offs) printf("%s", specialOffs[specialOffsNum]); break; default: - printf("0x%04X", offs); + eeDispILOffs(offs); + break; } } /* static */ -void Compiler::eeDispLineInfo(const boundariesDsc* line) +void Compiler::eeDispLineInfo(const ICorDebugInfo::OffsetMapping* line) { printf("IL offs "); - eeDispILOffs(line->ilOffset); + eeDispSourceMappingOffs(line->ilOffset); - printf(" : 0x%08X", line->nativeIP); - if (line->sourceReason != 0) + printf(" : 0x%08X", line->nativeOffset); + if (line->source != 0) { // It seems like it should probably never be zero since ICorDebugInfo::SOURCE_TYPE_INVALID is zero. // However, the JIT has always generated this and printed "stack non-empty". printf(" ( "); - if ((line->sourceReason & ICorDebugInfo::STACK_EMPTY) != 0) + if ((line->source & ICorDebugInfo::STACK_EMPTY) != 0) { printf("STACK_EMPTY "); } - if ((line->sourceReason & ICorDebugInfo::CALL_INSTRUCTION) != 0) + if ((line->source & ICorDebugInfo::CALL_INSTRUCTION) != 0) { printf("CALL_INSTRUCTION "); } - if ((line->sourceReason & ICorDebugInfo::CALL_SITE) != 0) + if ((line->source & ICorDebugInfo::CALL_SITE) != 0) { printf("CALL_SITE "); } @@ -1057,7 +1094,7 @@ void Compiler::eeDispLineInfo(const boundariesDsc* line) printf("\n"); // We don't expect to see any other bits. - assert((line->sourceReason & ~(ICorDebugInfo::STACK_EMPTY | ICorDebugInfo::CALL_INSTRUCTION)) == 0); + assert((line->source & ~(ICorDebugInfo::STACK_EMPTY | ICorDebugInfo::CALL_INSTRUCTION)) == 0); } void Compiler::eeDispLineInfos() diff --git a/src/coreclr/jit/ee_il_dll.hpp b/src/coreclr/jit/ee_il_dll.hpp index 5f98a701468521..abedfa4ddf0778 100644 --- a/src/coreclr/jit/ee_il_dll.hpp +++ b/src/coreclr/jit/ee_il_dll.hpp @@ -68,9 +68,9 @@ bool Compiler::eeIsFieldStatic(CORINFO_FIELD_HANDLE fldHnd) } FORCEINLINE -var_types Compiler::eeGetFieldType(CORINFO_FIELD_HANDLE fldHnd) +var_types Compiler::eeGetFieldType(CORINFO_FIELD_HANDLE fldHnd, CORINFO_CLASS_HANDLE* pStructHnd) { - return JITtype2varType(info.compCompHnd->getFieldType(fldHnd)); + return JITtype2varType(info.compCompHnd->getFieldType(fldHnd, pStructHnd)); } FORCEINLINE diff --git a/src/coreclr/jit/emit.cpp b/src/coreclr/jit/emit.cpp index 9975cd5041945c..ba4ab8f7b6caab 100644 --- a/src/coreclr/jit/emit.cpp +++ b/src/coreclr/jit/emit.cpp @@ -115,7 +115,7 @@ const char* emitter::emitIfName(unsigned f) static char errBuff[32]; - if (f < _countof(ifNames)) + if (f < ArrLen(ifNames)) { return ifNames[f]; } @@ -872,7 +872,7 @@ insGroup* emitter::emitSavIG(bool emitAdd) // Move align instructions to the global list, update their 'next' links do { - // Grab the jump and remove it from the list + // Grab the align and remove it from the list instrDescAlign* oa = emitCurIGAlignList; emitCurIGAlignList = oa->idaNext; @@ -913,6 +913,14 @@ insGroup* emitter::emitSavIG(bool emitAdd) } emitAlignLast = last; + + // Point to the first instruction of most recent + // align instruction(s) added. + // + // Since emitCurIGAlignList is created in inverse of + // program order, the `list` reverses that in forms it + // in correct order. + emitAlignLastGroup = list; } #endif @@ -1071,8 +1079,8 @@ void emitter::emitBegFN(bool hasFramePtr #if FEATURE_LOOP_ALIGN /* We don't have any align instructions */ - emitAlignList = emitAlignLast = nullptr; - emitCurIGAlignList = nullptr; + emitAlignList = emitAlignLastGroup = emitAlignLast = nullptr; + emitCurIGAlignList = nullptr; #endif /* We have not recorded any live sets */ @@ -1401,7 +1409,7 @@ void* emitter::emitAllocAnyInstr(size_t sz, emitAttr opsz) // the prolog/epilog placeholder groups ARE generated in order, and are // re-used. But generating additional groups would not work. if (emitComp->compStressCompile(Compiler::STRESS_EMITTER, 1) && emitCurIGinsCnt && !emitIGisInProlog(emitCurIG) && - !emitIGisInEpilog(emitCurIG) && !emitCurIG->isLoopAlign() + !emitIGisInEpilog(emitCurIG) && !emitCurIG->endsWithAlignInstr() #if defined(FEATURE_EH_FUNCLETS) && !emitIGisInFuncletProlog(emitCurIG) && !emitIGisInFuncletEpilog(emitCurIG) #endif // FEATURE_EH_FUNCLETS @@ -1574,7 +1582,7 @@ void emitter::emitCheckIGoffsets() { if (tempIG->igOffs != currentOffset) { - printf("Block #%u has offset %08X, expected %08X\n", tempIG->igNum, tempIG->igOffs, currentOffset); + printf("IG%02u has offset %08X, expected %08X\n", tempIG->igNum, tempIG->igOffs, currentOffset); assert(!"bad block offset"); } @@ -1815,11 +1823,11 @@ void emitter::emitCreatePlaceholderIG(insGroupPlaceholderType igType, { if (igType == IGPT_FUNCLET_PROLOG) { - codeGen->genIPmappingAdd((IL_OFFSETX)ICorDebugInfo::PROLOG, true); + codeGen->genIPmappingAdd(IPmappingDscKind::Prolog, DebugInfo(), true); } else if (igType == IGPT_FUNCLET_EPILOG) { - codeGen->genIPmappingAdd((IL_OFFSETX)ICorDebugInfo::EPILOG, true); + codeGen->genIPmappingAdd(IPmappingDscKind::Epilog, DebugInfo(), true); } } #endif // FEATURE_EH_FUNCLETS @@ -3348,7 +3356,7 @@ const BYTE emitter::emitFmtToOps[] = { }; #ifdef DEBUG -const unsigned emitter::emitFmtCount = _countof(emitFmtToOps); +const unsigned emitter::emitFmtCount = ArrLen(emitFmtToOps); #endif //------------------------------------------------------------------------ @@ -3373,6 +3381,15 @@ const size_t hexEncodingSize = 11; #ifdef DEBUG //------------------------------------------------------------------------ +// emitDispInsIndent: Print indentation corresponding to an instruction's +// indentation. +// +void emitter::emitDispInsIndent() +{ + size_t indent = emitComp->opts.disDiffable ? basicIndent : basicIndent + hexEncodingSize; + printf("%.*s", indent, " "); +} +//------------------------------------------------------------------------ // emitDispGCDeltaTitle: Print an appropriately indented title for a GC info delta // // Arguments: @@ -3380,8 +3397,8 @@ const size_t hexEncodingSize = 11; // void emitter::emitDispGCDeltaTitle(const char* title) { - size_t indent = emitComp->opts.disDiffable ? basicIndent : basicIndent + hexEncodingSize; - printf("%.*s; %s", indent, " ", title); + emitDispInsIndent(); + printf("; %s", title); } //------------------------------------------------------------------------ @@ -3555,7 +3572,7 @@ void emitter::emitDispIGflags(unsigned flags) { printf(", extend"); } - if (flags & IGF_LOOP_ALIGN) + if (flags & IGF_HAS_ALIGN) { printf(", align"); } @@ -4804,9 +4821,9 @@ void emitter::emitJumpDistBind() // Arguments: // nAlignInstr - Number of align instructions about to be added. // -void emitter::emitCheckAlignFitInCurIG(unsigned short nAlignInstr) +void emitter::emitCheckAlignFitInCurIG(unsigned nAlignInstr) { - unsigned short instrDescSize = nAlignInstr * sizeof(instrDescAlign); + unsigned instrDescSize = nAlignInstr * sizeof(instrDescAlign); // Ensure that all align instructions fall in same IG. if (emitCurIGfreeNext + instrDescSize >= emitCurIGfreeEndp) @@ -4817,11 +4834,15 @@ void emitter::emitCheckAlignFitInCurIG(unsigned short nAlignInstr) //----------------------------------------------------------------------------- // -// The next instruction will be a loop head entry point -// So insert an alignment instruction here to ensure that -// we can properly align the code. +// emitLoopAlign: The next instruction will be a loop head entry point +// So insert an alignment instruction of "paddingBytes" to ensure that +// the code is properly aligned. +// Arguments: +// paddingBytes - Number of padding bytes to insert. +// isFirstAlign - For multiple 'align' instructions case, if this is the first +// 'align' instruction of that group. // -void emitter::emitLoopAlign(unsigned short paddingBytes) +void emitter::emitLoopAlign(unsigned paddingBytes, bool isFirstAlign DEBUG_ARG(bool isPlacedBehindJmp)) { // Determine if 'align' instruction about to be generated will // fall in current IG or next. @@ -4831,7 +4852,7 @@ void emitter::emitLoopAlign(unsigned short paddingBytes) { // If align fits in current IG, then mark that it contains alignment // instruction in the end. - emitCurIG->igFlags |= IGF_LOOP_ALIGN; + emitCurIG->igFlags |= IGF_HAS_ALIGN; } /* Insert a pseudo-instruction to ensure that we align @@ -4842,12 +4863,12 @@ void emitter::emitLoopAlign(unsigned short paddingBytes) { // Mark this IG has alignment in the end, so during emitter we can check the instruction count // heuristics of all IGs that follows this IG that participate in a loop. - emitCurIG->igFlags |= IGF_LOOP_ALIGN; + emitCurIG->igFlags |= IGF_HAS_ALIGN; } else { // Otherwise, make sure it was already marked such. - assert(emitCurIG->isLoopAlign()); + assert(emitCurIG->endsWithAlignInstr()); } #if defined(TARGET_XARCH) @@ -4859,6 +4880,22 @@ void emitter::emitLoopAlign(unsigned short paddingBytes) id->idaIG = emitCurIG; + if (isFirstAlign) + { + // For multiple align instructions, set the idaLoopHeadPredIG only for the + // first align instruction + id->idaLoopHeadPredIG = emitCurIG; + emitAlignLastGroup = id; + } + else + { + id->idaLoopHeadPredIG = nullptr; + } + +#ifdef DEBUG + id->isPlacedAfterJmp = isPlacedBehindJmp; +#endif + /* Append this instruction to this IG's alignment list */ id->idaNext = emitCurIGAlignList; @@ -4870,25 +4907,28 @@ void emitter::emitLoopAlign(unsigned short paddingBytes) //----------------------------------------------------------------------------- // -// The next instruction will be a loop head entry point +// emitLongLoopAlign: The next instruction will be a loop head entry point // So insert alignment instruction(s) here to ensure that // we can properly align the code. // // This emits more than one `INS_align` instruction depending on the // alignmentBoundary parameter. // -void emitter::emitLongLoopAlign(unsigned short alignmentBoundary) +// Arguments: +// alignmentBoundary - The boundary at which loop needs to be aligned. +// +void emitter::emitLongLoopAlign(unsigned alignmentBoundary DEBUG_ARG(bool isPlacedBehindJmp)) { #if defined(TARGET_XARCH) - unsigned short nPaddingBytes = alignmentBoundary - 1; - unsigned short nAlignInstr = (nPaddingBytes + (MAX_ENCODED_SIZE - 1)) / MAX_ENCODED_SIZE; - unsigned short insAlignCount = nPaddingBytes / MAX_ENCODED_SIZE; - unsigned short lastInsAlignSize = nPaddingBytes % MAX_ENCODED_SIZE; - unsigned short paddingBytes = MAX_ENCODED_SIZE; + unsigned nPaddingBytes = alignmentBoundary - 1; + unsigned nAlignInstr = (nPaddingBytes + (MAX_ENCODED_SIZE - 1)) / MAX_ENCODED_SIZE; + unsigned insAlignCount = nPaddingBytes / MAX_ENCODED_SIZE; + unsigned lastInsAlignSize = nPaddingBytes % MAX_ENCODED_SIZE; + unsigned paddingBytes = MAX_ENCODED_SIZE; #elif defined(TARGET_ARM64) - unsigned short nAlignInstr = alignmentBoundary / INSTR_ENCODED_SIZE; - unsigned short insAlignCount = nAlignInstr; - unsigned short paddingBytes = INSTR_ENCODED_SIZE; + unsigned nAlignInstr = alignmentBoundary / INSTR_ENCODED_SIZE; + unsigned insAlignCount = nAlignInstr; + unsigned paddingBytes = INSTR_ENCODED_SIZE; #endif emitCheckAlignFitInCurIG(nAlignInstr); @@ -4896,25 +4936,49 @@ void emitter::emitLongLoopAlign(unsigned short alignmentBoundary) /* Insert a pseudo-instruction to ensure that we align the next instruction properly */ + bool isFirstAlign = true; while (insAlignCount) { - emitLoopAlign(paddingBytes); + emitLoopAlign(paddingBytes, isFirstAlign DEBUG_ARG(isPlacedBehindJmp)); insAlignCount--; + isFirstAlign = false; } #if defined(TARGET_XARCH) - emitLoopAlign(lastInsAlignSize); + emitLoopAlign(lastInsAlignSize, isFirstAlign DEBUG_ARG(isPlacedBehindJmp)); #endif } +//----------------------------------------------------------------------------- +// emitConnectAlignInstrWithCurIG: If "align" instruction is not just before the loop start, +// setting idaLoopHeadPredIG lets us know the exact IG that the "align" +// instruction is trying to align. This is used to track the last IG that +// needs alignment after which VEX encoding optimization is enabled. +// +// TODO: Once over-estimation problem is solved, consider replacing +// idaLoopHeadPredIG with idaLoopHeadIG itself. +// +void emitter::emitConnectAlignInstrWithCurIG() +{ + JITDUMP("Mapping 'align' instruction in IG%02u to target IG%02u\n", emitAlignLastGroup->idaIG->igNum, + emitCurIG->igNum); + // Since we never align overlapping instructions, it is always guaranteed that + // the emitAlignLastGroup points to the loop that is in process of getting aligned. + + emitAlignLastGroup->idaLoopHeadPredIG = emitCurIG; + + // For a new IG to ensure that loop doesn't start from IG that idaLoopHeadPredIG points to. + emitNxtIG(); +} + //----------------------------------------------------------------------------- // emitLoopAlignment: Insert an align instruction at the end of emitCurIG and -// mark it as IGF_LOOP_ALIGN to indicate that next IG is a -// loop needing alignment. +// mark it as IGF_HAS_ALIGN to indicate that a next or a future +// IG is a loop that needs alignment. // -void emitter::emitLoopAlignment() +void emitter::emitLoopAlignment(DEBUG_ARG1(bool isPlacedBehindJmp)) { - unsigned short paddingBytes; + unsigned paddingBytes; #if defined(TARGET_XARCH) // For xarch, each align instruction can be maximum of MAX_ENCODED_SIZE bytes and if @@ -4922,13 +4986,13 @@ void emitter::emitLoopAlignment() if ((emitComp->opts.compJitAlignLoopBoundary > 16) && (!emitComp->opts.compJitAlignLoopAdaptive)) { paddingBytes = emitComp->opts.compJitAlignLoopBoundary; - emitLongLoopAlign(paddingBytes); + emitLongLoopAlign(paddingBytes DEBUG_ARG(isPlacedBehindJmp)); } else { emitCheckAlignFitInCurIG(1); paddingBytes = MAX_ENCODED_SIZE; - emitLoopAlign(paddingBytes); + emitLoopAlign(paddingBytes, true DEBUG_ARG(isPlacedBehindJmp)); } #elif defined(TARGET_ARM64) // For Arm64, each align instruction is 4-bytes long because of fixed-length encoding. @@ -4941,14 +5005,12 @@ void emitter::emitLoopAlignment() { paddingBytes = emitComp->opts.compJitAlignLoopBoundary; } - emitLongLoopAlign(paddingBytes); + emitLongLoopAlign(paddingBytes DEBUG_ARG(isPlacedBehindJmp)); #endif - JITDUMP("Adding 'align' instruction of %d bytes in %s.\n", paddingBytes, emitLabelString(emitCurIG)); + assert(emitLastIns->idIns() == INS_align); -#ifdef DEBUG - emitComp->loopAlignCandidates++; -#endif // DEBUG + JITDUMP("Adding 'align' instruction of %d bytes in %s.\n", paddingBytes, emitLabelString(emitCurIG)); } //----------------------------------------------------------------------------- @@ -4958,7 +5020,7 @@ void emitter::emitLoopAlignment() // bool emitter::emitEndsWithAlignInstr() { - return emitCurIG->isLoopAlign(); + return emitCurIG->endsWithAlignInstr(); } //----------------------------------------------------------------------------- @@ -4982,9 +5044,13 @@ unsigned emitter::getLoopSize(insGroup* igLoopHeader, unsigned maxLoopSize DEBUG for (insGroup* igInLoop = igLoopHeader; igInLoop != nullptr; igInLoop = igInLoop->igNext) { loopSize += igInLoop->igSize; - if (igInLoop->isLoopAlign()) + if (igInLoop->endsWithAlignInstr()) { - // If igInLoop is marked as "IGF_LOOP_ALIGN", the basic block flow detected a loop start. + // If IGF_HAS_ALIGN is present, igInLoop contains align instruction at the end, + // for next IG or some future IG. + // + // For both cases, remove the padding bytes from igInLoop's size so it is not included in loopSize. + // // If the loop was formed because of forward jumps like the loop IG18 below, the backedge is not // set for them and such loops are not aligned. For such cases, the loop size threshold will never // be met and we would break as soon as loopSize > maxLoopSize. @@ -4997,9 +5063,9 @@ unsigned emitter::getLoopSize(insGroup* igLoopHeader, unsigned maxLoopSize DEBUG // ... // jne IG05 // - // If igInLoop is a legitimate loop, and igInLoop's next IG is also a loop that needs alignment, - // then igInLoop should be the last IG of the current loop and should have backedge to current - // loop header. + // If igInLoop is a legitimate loop, and igInLoop's end with another 'align' instruction for different IG + // representing a loop that needs alignment, then igInLoop should be the last IG of the current loop and + // should have backedge to current loop header. // // Below, IG05 is the last IG of loop IG04-IG05 and its backedge points to IG04. // @@ -5149,25 +5215,33 @@ void emitter::emitSetLoopBackEdge(BasicBlock* loopTopBlock) bool markedCurrLoop = alignCurrentLoop; while ((alignInstr != nullptr)) { - // Find the IG before current loop and clear the IGF_LOOP_ALIGN flag - if (!alignCurrentLoop && (alignInstr->idaIG->igNext == dstIG)) + insGroup* loopHeadIG = alignInstr->loopHeadIG(); + + // Find the IG that has 'align' instruction to align the current loop + // and clear the IGF_HAS_ALIGN flag. + if (!alignCurrentLoop && (loopHeadIG == dstIG)) { assert(!markedCurrLoop); - alignInstr->idaIG->igFlags &= ~IGF_LOOP_ALIGN; + + // This IG should no longer contain alignment instruction + alignInstr->removeAlignFlags(); + markedCurrLoop = true; JITDUMP("** Skip alignment for current loop IG%02u ~ IG%02u because it encloses an aligned loop " "IG%02u ~ IG%02u.\n", currLoopStart, currLoopEnd, emitLastLoopStart, emitLastLoopEnd); } - // Find the IG before the last loop and clear the IGF_LOOP_ALIGN flag - if (!alignLastLoop && (alignInstr->idaIG->igNext != nullptr) && - (alignInstr->idaIG->igNext->igNum == emitLastLoopStart)) + // Find the IG that has 'align' instruction to align the last loop + // and clear the IGF_HAS_ALIGN flag. + if (!alignLastLoop && (loopHeadIG != nullptr) && (loopHeadIG->igNum == emitLastLoopStart)) { assert(!markedLastLoop); - assert(alignInstr->idaIG->isLoopAlign()); + assert(alignInstr->idaIG->endsWithAlignInstr()); + + // This IG should no longer contain alignment instruction + alignInstr->removeAlignFlags(); - alignInstr->idaIG->igFlags &= ~IGF_LOOP_ALIGN; markedLastLoop = true; JITDUMP("** Skip alignment for aligned loop IG%02u ~ IG%02u because it encloses the current loop " "IG%02u ~ IG%02u.\n", @@ -5179,21 +5253,7 @@ void emitter::emitSetLoopBackEdge(BasicBlock* loopTopBlock) break; } -#if defined(TARGET_XARCH) - if (!emitComp->opts.compJitAlignLoopAdaptive) -#endif - { - // If there are multiple align instructions, skip the align instructions after - // the first align instruction and fast forward to the next IG - insGroup* alignIG = alignInstr->idaIG; - while ((alignInstr != nullptr) && (alignInstr->idaNext != nullptr) && - (alignInstr->idaNext->idaIG == alignIG)) - { - alignInstr = alignInstr->idaNext; - } - } - - alignInstr = alignInstr->idaNext; + alignInstr = emitAlignInNextIG(alignInstr); } assert(markedLastLoop && markedCurrLoop); @@ -5232,21 +5292,32 @@ void emitter::emitLoopAlignAdjustments() unsigned loopIGOffset = 0; instrDescAlign* alignInstr = emitAlignList; - for (; alignInstr != nullptr; alignInstr = alignInstr->idaNext) + for (; alignInstr != nullptr;) { assert(alignInstr->idIns() == INS_align); - insGroup* alignIG = alignInstr->idaIG; + insGroup* loopHeadPredIG = alignInstr->idaLoopHeadPredIG; + insGroup* loopHeadIG = alignInstr->loopHeadIG(); + insGroup* containingIG = alignInstr->idaIG; + + JITDUMP(" Adjusting 'align' instruction in IG%02u that is targeted for IG%02u \n", containingIG->igNum, + loopHeadIG->igNum); + + // Since we only adjust the padding up to the next align instruction which is behind the jump, we make sure + // that we take into account all the alignBytes we removed until that point. Hence " - alignBytesRemoved" - loopIGOffset = alignIG->igOffs + alignIG->igSize; + loopIGOffset = loopHeadIG->igOffs - alignBytesRemoved; // igSize also includes INS_align instruction, take it off. loopIGOffset -= estimatedPaddingNeeded; // IG can be marked as not needing alignment if during setting igLoopBackEdge, it is detected // that the igLoopBackEdge encloses an IG that is marked for alignment. + unsigned actualPaddingNeeded = - alignIG->isLoopAlign() ? emitCalculatePaddingForLoopAlignment(alignIG, loopIGOffset DEBUG_ARG(false)) : 0; + containingIG->endsWithAlignInstr() + ? emitCalculatePaddingForLoopAlignment(loopHeadIG, loopIGOffset DEBUG_ARG(false)) + : 0; assert(estimatedPaddingNeeded >= actualPaddingNeeded); @@ -5254,15 +5325,15 @@ void emitter::emitLoopAlignAdjustments() if (diff != 0) { - alignIG->igSize -= diff; + containingIG->igSize -= diff; alignBytesRemoved += diff; emitTotalCodeSize -= diff; // Update the flags - alignIG->igFlags |= IGF_UPD_ISZ; + containingIG->igFlags |= IGF_UPD_ISZ; if (actualPaddingNeeded == 0) { - alignIG->igFlags &= ~IGF_LOOP_ALIGN; + alignInstr->removeAlignFlags(); } #ifdef TARGET_XARCH @@ -5312,21 +5383,19 @@ void emitter::emitLoopAlignAdjustments() } assert(paddingToAdj == 0); assert(instrAdjusted == 0); - - // fast forward the align instruction to next IG - alignInstr = prevAlignInstr; } - JITDUMP("Adjusted alignment of %s from %u to %u.\n", emitLabelString(alignIG), estimatedPaddingNeeded, + JITDUMP("Adjusted alignment for %s from %u to %u.\n", emitLabelString(loopHeadIG), estimatedPaddingNeeded, actualPaddingNeeded); - JITDUMP("Adjusted size of %s from %u to %u.\n", emitLabelString(alignIG), (alignIG->igSize + diff), - alignIG->igSize); + JITDUMP("Adjusted size of %s from %u to %u.\n", emitLabelString(containingIG), + (containingIG->igSize + diff), containingIG->igSize); } // Adjust the offset of all IGs starting from next IG until we reach the IG having the next // align instruction or the end of IG list. - insGroup* adjOffIG = alignIG->igNext; - insGroup* adjOffUptoIG = alignInstr->idaNext != nullptr ? alignInstr->idaNext->idaIG : emitIGlast; + insGroup* adjOffIG = containingIG->igNext; + instrDescAlign* nextAlign = emitAlignInNextIG(alignInstr); + insGroup* adjOffUptoIG = nextAlign != nullptr ? nextAlign->idaIG : emitIGlast; while ((adjOffIG != nullptr) && (adjOffIG->igNum <= adjOffUptoIG->igNum)) { JITDUMP("Adjusted offset of %s from %04X to %04X\n", emitLabelString(adjOffIG), adjOffIG->igOffs, @@ -5335,11 +5404,14 @@ void emitter::emitLoopAlignAdjustments() adjOffIG = adjOffIG->igNext; } + alignInstr = nextAlign; + if (actualPaddingNeeded > 0) { - // Record the last IG that has align instruction. No overestimation + // Record the last loop IG that will be aligned. No overestimation // adjustment will be done after emitLastAlignedIgNum. - emitLastAlignedIgNum = alignIG->igNum; + JITDUMP("Recording last aligned IG: %s\n", emitLabelString(loopHeadPredIG)); + emitLastAlignedIgNum = loopHeadPredIG->igNum; } } @@ -5353,7 +5425,7 @@ void emitter::emitLoopAlignAdjustments() // end of 'ig' so the loop that starts after 'ig' is aligned. // // Arguments: -// ig - The IG having 'align' instruction in the end. +// loopHeadIG - The IG that has the loop head that need to be aligned. // offset - The offset at which the IG that follows 'ig' starts. // isAlignAdjusted - Determine if adjustments are done to the align instructions or not. // During generating code, it is 'false' (because we haven't adjusted the size yet). @@ -5381,15 +5453,15 @@ void emitter::emitLoopAlignAdjustments() // 3b. If the loop already fits in minimum alignmentBoundary blocks, then return 0. // already best aligned // 3c. return paddingNeeded. // -unsigned emitter::emitCalculatePaddingForLoopAlignment(insGroup* ig, size_t offset DEBUG_ARG(bool isAlignAdjusted)) +unsigned emitter::emitCalculatePaddingForLoopAlignment(insGroup* loopHeadIG, + size_t offset DEBUG_ARG(bool isAlignAdjusted)) { - assert(ig->isLoopAlign()); unsigned alignmentBoundary = emitComp->opts.compJitAlignLoopBoundary; // No padding if loop is already aligned if ((offset & (alignmentBoundary - 1)) == 0) { - JITDUMP(";; Skip alignment: 'Loop at %s already aligned at %dB boundary.'\n", emitLabelString(ig->igNext), + JITDUMP(";; Skip alignment: 'Loop at %s already aligned at %dB boundary.'\n", emitLabelString(loopHeadIG), alignmentBoundary); return 0; } @@ -5409,12 +5481,12 @@ unsigned emitter::emitCalculatePaddingForLoopAlignment(insGroup* ig, size_t offs maxLoopSize = emitComp->opts.compJitAlignLoopMaxCodeSize; } - unsigned loopSize = getLoopSize(ig->igNext, maxLoopSize DEBUG_ARG(isAlignAdjusted)); + unsigned loopSize = getLoopSize(loopHeadIG, maxLoopSize DEBUG_ARG(isAlignAdjusted)); // No padding if loop is big if (loopSize > maxLoopSize) { - JITDUMP(";; Skip alignment: 'Loop at %s is big. LoopSize= %d, MaxLoopSize= %d.'\n", emitLabelString(ig->igNext), + JITDUMP(";; Skip alignment: 'Loop at %s is big. LoopSize= %d, MaxLoopSize= %d.'\n", emitLabelString(loopHeadIG), loopSize, maxLoopSize); return 0; } @@ -5451,7 +5523,7 @@ unsigned emitter::emitCalculatePaddingForLoopAlignment(insGroup* ig, size_t offs { skipPadding = true; JITDUMP(";; Skip alignment: 'Loop at %s already aligned at %uB boundary.'\n", - emitLabelString(ig->igNext), alignmentBoundary); + emitLabelString(loopHeadIG), alignmentBoundary); } // Check if the alignment exceeds new maxPadding limit else if (nPaddingBytes > nMaxPaddingBytes) @@ -5459,7 +5531,7 @@ unsigned emitter::emitCalculatePaddingForLoopAlignment(insGroup* ig, size_t offs skipPadding = true; JITDUMP(";; Skip alignment: 'Loop at %s PaddingNeeded= %d, MaxPadding= %d, LoopSize= %d, " "AlignmentBoundary= %dB.'\n", - emitLabelString(ig->igNext), nPaddingBytes, nMaxPaddingBytes, loopSize, alignmentBoundary); + emitLabelString(loopHeadIG), nPaddingBytes, nMaxPaddingBytes, loopSize, alignmentBoundary); } } @@ -5482,7 +5554,7 @@ unsigned emitter::emitCalculatePaddingForLoopAlignment(insGroup* ig, size_t offs { // Otherwise, the loop just fits in minBlocksNeededForLoop and so can skip alignment. JITDUMP(";; Skip alignment: 'Loop at %s is aligned to fit in %d blocks of %d chunks.'\n", - emitLabelString(ig->igNext), minBlocksNeededForLoop, alignmentBoundary); + emitLabelString(loopHeadIG), minBlocksNeededForLoop, alignmentBoundary); } } } @@ -5511,12 +5583,12 @@ unsigned emitter::emitCalculatePaddingForLoopAlignment(insGroup* ig, size_t offs { // Otherwise, the loop just fits in minBlocksNeededForLoop and so can skip alignment. JITDUMP(";; Skip alignment: 'Loop at %s is aligned to fit in %d blocks of %d chunks.'\n", - emitLabelString(ig->igNext), minBlocksNeededForLoop, alignmentBoundary); + emitLabelString(loopHeadIG), minBlocksNeededForLoop, alignmentBoundary); } } JITDUMP(";; Calculated padding to add %d bytes to align %s at %dB boundary.\n", paddingToAdd, - emitLabelString(ig->igNext), alignmentBoundary); + emitLabelString(loopHeadIG), alignmentBoundary); // Either no padding is added because it is too expensive or the offset gets aligned // to the alignment boundary @@ -5525,6 +5597,25 @@ unsigned emitter::emitCalculatePaddingForLoopAlignment(insGroup* ig, size_t offs return paddingToAdd; } +// emitAlignInNextIG: On xarch, for adaptive alignment, this will usually return the next instruction in +// 'emitAlignList'. But for arm64 or non-adaptive alignment on xarch, where multiple +// align instructions are emitted, this method will skip the 'align' instruction present +// in the same IG and return the first instruction that is present in next IG. +// Arguments: +// alignInstr - Current 'align' instruction for which next IG's first 'align' should be returned. +// +emitter::instrDescAlign* emitter::emitAlignInNextIG(instrDescAlign* alignInstr) +{ + // If there are multiple align instructions, skip the align instructions after + // the first align instruction and fast forward to the next IG + insGroup* alignIG = alignInstr->idaIG; + while ((alignInstr != nullptr) && (alignInstr->idaNext != nullptr) && (alignInstr->idaNext->idaIG == alignIG)) + { + alignInstr = alignInstr->idaNext; + } + return alignInstr != nullptr ? alignInstr->idaNext : nullptr; +} + #endif // FEATURE_LOOP_ALIGN void emitter::emitCheckFuncletBranch(instrDesc* jmp, insGroup* jmpIG) @@ -5982,7 +6073,7 @@ unsigned emitter::emitEndCodeGen(Compiler* comp, if (emitComp->lvaKeepAliveAndReportThis()) { assert(emitComp->lvaIsOriginalThisArg(0)); - LclVarDsc* thisDsc = &emitComp->lvaTable[0]; + LclVarDsc* thisDsc = emitComp->lvaGetDesc(0U); /* If "this" (which is passed in as a register argument in REG_ARG_0) is enregistered, we normally spot the "mov REG_ARG_0 -> thisReg" @@ -6151,7 +6242,8 @@ unsigned emitter::emitEndCodeGen(Compiler* comp, #define DEFAULT_CODE_BUFFER_INIT 0xcc #ifdef DEBUG - *instrCount = 0; + *instrCount = 0; + jitstd::list::iterator nextMapping = emitComp->genPreciseIPmappings.begin(); #endif for (insGroup* ig = emitIGlist; ig != nullptr; ig = ig->igNext) { @@ -6320,6 +6412,34 @@ unsigned emitter::emitEndCodeGen(Compiler* comp, #ifdef DEBUG size_t curInstrAddr = (size_t)cp; instrDesc* curInstrDesc = id; + + if ((emitComp->opts.disAsm || emitComp->verbose) && (JitConfig.JitDisasmWithDebugInfo() != 0) && + (id->idCodeSize() > 0)) + { + UNATIVE_OFFSET curCodeOffs = emitCurCodeOffs(cp); + while (nextMapping != emitComp->genPreciseIPmappings.end()) + { + UNATIVE_OFFSET mappingOffs = nextMapping->nativeLoc.CodeOffset(this); + + if (mappingOffs > curCodeOffs) + { + // Still haven't reached instruction that next mapping belongs to. + break; + } + + // We reached the mapping or went past it. + if (mappingOffs == curCodeOffs) + { + emitDispInsIndent(); + printf("; "); + nextMapping->debugInfo.Dump(true); + printf("\n"); + } + + ++nextMapping; + } + } + #endif castto(id, BYTE*) += emitIssue1Instr(ig, id, &cp); @@ -7233,7 +7353,7 @@ void emitter::emitDispDataSec(dataSecDsc* section) { const char* labelFormat = "%-7s"; char label[64]; - sprintf_s(label, _countof(label), "RWD%02u", offset); + sprintf_s(label, ArrLen(label), "RWD%02u", offset); printf(labelFormat, label); offset += data->dsSize; @@ -8251,8 +8371,8 @@ void emitter::emitGCvarLiveUpd(int offs, int varNum, GCtype gcType, BYTE* addr D if (varNum >= 0) { // This is NOT a spill temp - LclVarDsc* varDsc = &emitComp->lvaTable[varNum]; - isTracked = emitComp->lvaIsGCTracked(varDsc); + const LclVarDsc* varDsc = emitComp->lvaGetDesc(varNum); + isTracked = emitComp->lvaIsGCTracked(varDsc); } if (!isTracked) diff --git a/src/coreclr/jit/emit.h b/src/coreclr/jit/emit.h index 3f6607a9966a52..ade4f7c3ca2c12 100644 --- a/src/coreclr/jit/emit.h +++ b/src/coreclr/jit/emit.h @@ -275,8 +275,8 @@ struct insGroup #define IGF_PLACEHOLDER 0x0100 // this is a placeholder group, to be filled in later #define IGF_EXTEND 0x0200 // this block is conceptually an extension of the previous block // and the emitter should continue to track GC info as if there was no new block. -#define IGF_LOOP_ALIGN 0x0400 // this group contains alignment instruction(s) at the end; the next IG is the - // head of a loop that needs alignment. +#define IGF_HAS_ALIGN 0x0400 // this group contains an alignment instruction(s) at the end to align either the next + // IG, or, if this IG contains with an unconditional branch, some subsequent IG. // Mask of IGF_* flags that should be propagated to new blocks when they are created. // This allows prologs and epilogs to be any number of IGs, but still be @@ -349,9 +349,9 @@ struct insGroup return *(unsigned*)ptr; } - bool isLoopAlign() + bool endsWithAlignInstr() const { - return (igFlags & IGF_LOOP_ALIGN) != 0; + return (igFlags & IGF_HAS_ALIGN) != 0; } }; // end of struct insGroup @@ -1240,21 +1240,22 @@ class emitter #define PERFSCORE_THROUGHPUT_1C 1.0f // Single Issue -#define PERFSCORE_THROUGHPUT_2C 2.0f // slower - 2 cycles -#define PERFSCORE_THROUGHPUT_3C 3.0f // slower - 3 cycles -#define PERFSCORE_THROUGHPUT_4C 4.0f // slower - 4 cycles -#define PERFSCORE_THROUGHPUT_5C 5.0f // slower - 5 cycles -#define PERFSCORE_THROUGHPUT_6C 6.0f // slower - 6 cycles -#define PERFSCORE_THROUGHPUT_7C 7.0f // slower - 7 cycles -#define PERFSCORE_THROUGHPUT_8C 8.0f // slower - 8 cycles -#define PERFSCORE_THROUGHPUT_9C 9.0f // slower - 9 cycles -#define PERFSCORE_THROUGHPUT_10C 10.0f // slower - 10 cycles -#define PERFSCORE_THROUGHPUT_13C 13.0f // slower - 13 cycles -#define PERFSCORE_THROUGHPUT_19C 19.0f // slower - 19 cycles -#define PERFSCORE_THROUGHPUT_25C 25.0f // slower - 25 cycles -#define PERFSCORE_THROUGHPUT_33C 33.0f // slower - 33 cycles -#define PERFSCORE_THROUGHPUT_52C 52.0f // slower - 52 cycles -#define PERFSCORE_THROUGHPUT_57C 57.0f // slower - 57 cycles +#define PERFSCORE_THROUGHPUT_2C 2.0f // slower - 2 cycles +#define PERFSCORE_THROUGHPUT_3C 3.0f // slower - 3 cycles +#define PERFSCORE_THROUGHPUT_4C 4.0f // slower - 4 cycles +#define PERFSCORE_THROUGHPUT_5C 5.0f // slower - 5 cycles +#define PERFSCORE_THROUGHPUT_6C 6.0f // slower - 6 cycles +#define PERFSCORE_THROUGHPUT_7C 7.0f // slower - 7 cycles +#define PERFSCORE_THROUGHPUT_8C 8.0f // slower - 8 cycles +#define PERFSCORE_THROUGHPUT_9C 9.0f // slower - 9 cycles +#define PERFSCORE_THROUGHPUT_10C 10.0f // slower - 10 cycles +#define PERFSCORE_THROUGHPUT_13C 13.0f // slower - 13 cycles +#define PERFSCORE_THROUGHPUT_19C 19.0f // slower - 19 cycles +#define PERFSCORE_THROUGHPUT_25C 25.0f // slower - 25 cycles +#define PERFSCORE_THROUGHPUT_33C 33.0f // slower - 33 cycles +#define PERFSCORE_THROUGHPUT_52C 52.0f // slower - 52 cycles +#define PERFSCORE_THROUGHPUT_57C 57.0f // slower - 57 cycles +#define PERFSCORE_THROUGHPUT_140C 140.0f // slower - 140 cycles #define PERFSCORE_LATENCY_ILLEGAL -1024.0f @@ -1281,6 +1282,7 @@ class emitter #define PERFSCORE_LATENCY_26C 26.0f #define PERFSCORE_LATENCY_62C 62.0f #define PERFSCORE_LATENCY_69C 69.0f +#define PERFSCORE_LATENCY_140C 140.0f #define PERFSCORE_LATENCY_400C 400.0f // Intel microcode issue with these instuctions #define PERFSCORE_LATENCY_BRANCH_DIRECT 1.0f // cost of an unconditional branch @@ -1381,14 +1383,29 @@ class emitter #if FEATURE_LOOP_ALIGN struct instrDescAlign : instrDesc { - instrDescAlign* idaNext; // next align in the group/method - insGroup* idaIG; // containing group - }; + instrDescAlign* idaNext; // next align in the group/method + insGroup* idaIG; // containing group + insGroup* idaLoopHeadPredIG; // The IG before the loop IG. + // If no 'jmp' instructions were found until idaLoopHeadPredIG, + // then idaLoopHeadPredIG == idaIG. +#ifdef DEBUG + bool isPlacedAfterJmp; // Is the 'align' instruction placed after jmp. Used to decide + // if the instruction cost should be included in PerfScore + // calculation or not. +#endif - void emitCheckAlignFitInCurIG(unsigned short nAlignInstr); - void emitLoopAlign(unsigned short paddingBytes); - void emitLongLoopAlign(unsigned short alignmentBoundary); + inline insGroup* loopHeadIG() + { + assert(idaLoopHeadPredIG); + return idaLoopHeadPredIG->igNext; + } + void removeAlignFlags() + { + idaIG->igFlags &= ~IGF_HAS_ALIGN; + } + }; + void emitCheckAlignFitInCurIG(unsigned nAlignInstr); #endif // FEATURE_LOOP_ALIGN #if !defined(TARGET_ARM64) // This shouldn't be needed for ARM32, either, but I don't want to touch the ARM32 JIT. @@ -1531,6 +1548,7 @@ class emitter regPtrDsc* debugPrevRegPtrDsc; regMaskTP debugPrevGCrefRegs; regMaskTP debugPrevByrefRegs; + void emitDispInsIndent(); void emitDispGCDeltaTitle(const char* title); void emitDispGCRegDelta(const char* title, regMaskTP prevRegs, regMaskTP curRegs); void emitDispGCVarDelta(); @@ -1546,6 +1564,14 @@ class emitter void emitDispInsAddr(BYTE* code); void emitDispInsOffs(unsigned offs, bool doffs); void emitDispInsHex(instrDesc* id, BYTE* code, size_t sz); + void emitDispIns(instrDesc* id, + bool isNew, + bool doffs, + bool asmfm, + unsigned offs = 0, + BYTE* pCode = nullptr, + size_t sz = 0, + insGroup* ig = nullptr); #else // !DEBUG #define emitVarRefOffs 0 @@ -1778,15 +1804,26 @@ class emitter unsigned emitLastLoopStart; // Start IG of last inner loop unsigned emitLastLoopEnd; // End IG of last inner loop unsigned emitLastAlignedIgNum; // last IG that has align instruction - instrDescAlign* emitAlignList; // list of local align instructions in method + instrDescAlign* emitAlignList; // list of all align instructions in method instrDescAlign* emitAlignLast; // last align instruction in method + + // Points to the most recent added align instruction. If there are multiple align instructions like in arm64 or + // non-adaptive alignment on xarch, this points to the first align instruction of the series of align instructions. + instrDescAlign* emitAlignLastGroup; + unsigned getLoopSize(insGroup* igLoopHeader, unsigned maxLoopSize DEBUG_ARG(bool isAlignAdjusted)); // Get the smallest loop size - void emitLoopAlignment(); + void emitLoopAlignment(DEBUG_ARG1(bool isPlacedBehindJmp)); bool emitEndsWithAlignInstr(); // Validate if newLabel is appropriate void emitSetLoopBackEdge(BasicBlock* loopTopBlock); void emitLoopAlignAdjustments(); // Predict if loop alignment is needed and make appropriate adjustments unsigned emitCalculatePaddingForLoopAlignment(insGroup* ig, size_t offset DEBUG_ARG(bool isAlignAdjusted)); + + void emitLoopAlign(unsigned paddingBytes, bool isFirstAlign DEBUG_ARG(bool isPlacedBehindJmp)); + void emitLongLoopAlign(unsigned alignmentBoundary DEBUG_ARG(bool isPlacedBehindJmp)); + instrDescAlign* emitAlignInNextIG(instrDescAlign* alignInstr); + void emitConnectAlignInstrWithCurIG(); + #endif void emitCheckFuncletBranch(instrDesc* jmp, insGroup* jmpIG); // Check for illegal branches between funclets diff --git a/src/coreclr/jit/emitarm.cpp b/src/coreclr/jit/emitarm.cpp index 7ed84210741924..0b11fcc742b263 100644 --- a/src/coreclr/jit/emitarm.cpp +++ b/src/coreclr/jit/emitarm.cpp @@ -4678,7 +4678,7 @@ void emitter::emitIns_Call(EmitCallType callType, VARSET_VALARG_TP ptrVars, regMaskTP gcrefRegs, regMaskTP byrefRegs, - IL_OFFSETX ilOffset /* = BAD_IL_OFFSET */, + const DebugInfo& di /* = DebugInfo() */, regNumber ireg /* = REG_NA */, regNumber xreg /* = REG_NA */, unsigned xmul /* = 0 */, @@ -4719,9 +4719,9 @@ void emitter::emitIns_Call(EmitCallType callType, #endif /* Managed RetVal: emit sequence point for the call */ - if (emitComp->opts.compDbgInfo && ilOffset != BAD_IL_OFFSET) + if (emitComp->opts.compDbgInfo && di.GetLocation().IsValid()) { - codeGen->genIPmappingAdd(ilOffset, false); + codeGen->genIPmappingAdd(IPmappingDscKind::Normal, di, false); } /* @@ -7670,6 +7670,22 @@ void emitter::emitDispInsHelp( printf("\n"); } +//-------------------------------------------------------------------- +// emitDispIns: Dump the given instruction to jitstdout. +// +// Arguments: +// id - The instruction +// isNew - Whether the instruction is newly generated (before encoding). +// doffs - If true, always display the passed-in offset. +// asmfm - Whether the instruction should be displayed in assembly format. +// If false some additional information may be printed for the instruction. +// offset - The offset of the instruction. Only displayed if doffs is true or if +// !isNew && !asmfm. +// code - Pointer to the actual code, used for displaying the address and encoded bytes +// if turned on. +// sz - The size of the instruction, used to display the encoded bytes. +// ig - The instruction group containing the instruction. +// void emitter::emitDispIns( instrDesc* id, bool isNew, bool doffs, bool asmfm, unsigned offset, BYTE* code, size_t sz, insGroup* ig) { @@ -7767,12 +7783,7 @@ void emitter::emitDispFrameRef(int varx, int disp, int offs, bool asmfm) if (varx >= 0 && emitComp->opts.varNames) { - LclVarDsc* varDsc; - const char* varName; - - assert((unsigned)varx < emitComp->lvaCount); - varDsc = emitComp->lvaTable + varx; - varName = emitComp->compLocalVarName(varx, offs); + const char* varName = emitComp->compLocalVarName(varx, offs); if (varName) { @@ -7973,9 +7984,7 @@ void emitter::emitInsLoadStoreOp(instruction ins, emitAttr attr, regNumber dataR // no logic here to track local variable lifetime changes, like we do in the contained case // above. E.g., for a `str r0,[r1]` for byref `r1` to local `V01`, we won't store the local // `V01` and so the emitter can't update the GC lifetime for `V01` if this is a variable birth. - GenTreeLclVarCommon* varNode = addr->AsLclVarCommon(); - unsigned lclNum = varNode->GetLclNum(); - LclVarDsc* varDsc = emitComp->lvaGetDesc(lclNum); + LclVarDsc* varDsc = emitComp->lvaGetDesc(addr->AsLclVarCommon()); assert(!varDsc->lvTracked); } #endif // DEBUG @@ -8095,7 +8104,7 @@ regNumber emitter::emitInsTernary(instruction ins, emitAttr attr, GenTree* dst, if (dst->gtSetFlags()) { assert((ins == INS_add) || (ins == INS_adc) || (ins == INS_sub) || (ins == INS_sbc) || (ins == INS_and) || - (ins == INS_orr) || (ins == INS_eor) || (ins == INS_orn)); + (ins == INS_orr) || (ins == INS_eor) || (ins == INS_orn) || (ins == INS_bic)); flags = INS_FLAGS_SET; } diff --git a/src/coreclr/jit/emitarm.h b/src/coreclr/jit/emitarm.h index 744b8676c45b2c..9dd2c175190dcb 100644 --- a/src/coreclr/jit/emitarm.h +++ b/src/coreclr/jit/emitarm.h @@ -52,14 +52,6 @@ void emitDispInsHelp(instrDesc* id, BYTE* code = 0, size_t sz = 0, insGroup* ig = NULL); -void emitDispIns(instrDesc* id, - bool isNew, - bool doffs, - bool asmfm, - unsigned offs = 0, - BYTE* code = 0, - size_t sz = 0, - insGroup* ig = NULL); #endif // DEBUG @@ -328,12 +320,12 @@ void emitIns_Call(EmitCallType callType, VARSET_VALARG_TP ptrVars, regMaskTP gcrefRegs, regMaskTP byrefRegs, - IL_OFFSETX ilOffset = BAD_IL_OFFSET, - regNumber ireg = REG_NA, - regNumber xreg = REG_NA, - unsigned xmul = 0, - ssize_t disp = 0, - bool isJump = false); + const DebugInfo& di = DebugInfo(), + regNumber ireg = REG_NA, + regNumber xreg = REG_NA, + unsigned xmul = 0, + ssize_t disp = 0, + bool isJump = false); /***************************************************************************** * diff --git a/src/coreclr/jit/emitarm64.cpp b/src/coreclr/jit/emitarm64.cpp index c810029aa238bf..1bcda1dd0a88a3 100644 --- a/src/coreclr/jit/emitarm64.cpp +++ b/src/coreclr/jit/emitarm64.cpp @@ -3649,21 +3649,20 @@ void emitter::emitIns_I(instruction ins, emitAttr attr, ssize_t imm) insFormat fmt = IF_NONE; /* Figure out the encoding format of the instruction */ - switch (ins) + if (ins == INS_BREAKPOINT) { - case INS_brk: - if ((imm & 0x0000ffff) == imm) - { - fmt = IF_SI_0A; - } - else - { - assert(!"Instruction cannot be encoded: IF_SI_0A"); - } - break; - default: - unreached(); - break; + if ((imm & 0x0000ffff) == imm) + { + fmt = IF_SI_0A; + } + else + { + assert(!"Instruction cannot be encoded: IF_SI_0A"); + } + } + else + { + unreached(); } assert(fmt != IF_NONE); @@ -6985,6 +6984,14 @@ void emitter::emitIns_R_R_R_Ext(instruction ins, { shiftAmount = insOptsLSL(opt) ? scale : 0; } + + // If target reg is ZR - it means we're doing an implicit nullcheck + // where target type was ignored and set to TYP_INT. + if ((reg1 == REG_ZR) && (shiftAmount > 0)) + { + shiftAmount = scale; + } + assert((shiftAmount == scale) || (shiftAmount == 0)); reg2 = encodingSPtoZR(reg2); @@ -8520,7 +8527,7 @@ void emitter::emitIns_Call(EmitCallType callType, VARSET_VALARG_TP ptrVars, regMaskTP gcrefRegs, regMaskTP byrefRegs, - IL_OFFSETX ilOffset /* = BAD_IL_OFFSET */, + const DebugInfo& di /* = DebugInfo() */, regNumber ireg /* = REG_NA */, regNumber xreg /* = REG_NA */, unsigned xmul /* = 0 */, @@ -8561,9 +8568,9 @@ void emitter::emitIns_Call(EmitCallType callType, #endif /* Managed RetVal: emit sequence point for the call */ - if (emitComp->opts.compDbgInfo && ilOffset != BAD_IL_OFFSET) + if (emitComp->opts.compDbgInfo && di.GetLocation().IsValid()) { - codeGen->genIPmappingAdd(ilOffset, false); + codeGen->genIPmappingAdd(IPmappingDscKind::Normal, di, false); } /* @@ -11431,13 +11438,13 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) // IG can be marked as not needing alignment after emitting align instruction. // Alternatively, there are fewer align instructions needed than emitted. // If that is the case, skip outputting alignment. - if (!ig->isLoopAlign() || id->idIsEmptyAlign()) + if (!ig->endsWithAlignInstr() || id->idIsEmptyAlign()) { skipIns = true; } #ifdef DEBUG - if (!ig->isLoopAlign()) + if (!ig->endsWithAlignInstr()) { // Validate if the state is correctly updated assert(id->idIsEmptyAlign()); @@ -11445,6 +11452,24 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) #endif sz = sizeof(instrDescAlign); ins = INS_nop; + +#ifdef DEBUG + // Under STRESS_EMITTER, if this is the 'align' before the 'jmp' instruction, + // then add "bkpt" instruction. + instrDescAlign* alignInstr = (instrDescAlign*)id; + + if (emitComp->compStressCompile(Compiler::STRESS_EMITTER, 50) && alignInstr->isPlacedAfterJmp && + !skipIns) + { + // There is no good way to squeeze in "bkpt" as well as display it + // in the disassembly because there is no corresponding instrDesc for + // it. As such, leave it as is, the "0xD43E0000" bytecode will be seen + // next to the nop instruction in disasm. + // e.g. D43E0000 align [4 bytes for IG07] + ins = INS_BREAKPOINT; + fmt = IF_SI_0A; + } +#endif } #endif // FEATURE_LOOP_ALIGN @@ -12203,11 +12228,22 @@ void emitter::emitDispInsHex(instrDesc* id, BYTE* code, size_t sz) } } -/**************************************************************************** - * - * Display the given instruction. - */ - +//-------------------------------------------------------------------- +// emitDispIns: Dump the given instruction to jitstdout. +// +// Arguments: +// id - The instruction +// isNew - Whether the instruction is newly generated (before encoding). +// doffs - If true, always display the passed-in offset. +// asmfm - Whether the instruction should be displayed in assembly format. +// If false some additional information may be printed for the instruction. +// offset - The offset of the instruction. Only displayed if doffs is true or if +// !isNew && !asmfm. +// code - Pointer to the actual code, used for displaying the address and encoded bytes +// if turned on. +// sz - The size of the instruction, used to display the encoded bytes. +// ig - The instruction group containing the instruction. +// void emitter::emitDispIns( instrDesc* id, bool isNew, bool doffs, bool asmfm, unsigned offset, BYTE* pCode, size_t sz, insGroup* ig) { @@ -13322,7 +13358,15 @@ void emitter::emitDispIns( case IF_SN_0A: // SN_0A ................ ................ if (ins == INS_align) { - printf("[%d bytes]", id->idIsEmptyAlign() ? 0 : INSTR_ENCODED_SIZE); + instrDescAlign* alignInstrId = (instrDescAlign*)id; + printf("[%d bytes", id->idIsEmptyAlign() ? 0 : INSTR_ENCODED_SIZE); + + // targetIG is only set for 1st of the series of align instruction + if ((alignInstrId->idaLoopHeadPredIG != nullptr) && (alignInstrId->loopHeadIG() != nullptr)) + { + printf(" for IG%02u", alignInstrId->loopHeadIG()->igNum); + } + printf("]"); } break; @@ -13377,12 +13421,7 @@ void emitter::emitDispFrameRef(int varx, int disp, int offs, bool asmfm) if (varx >= 0 && emitComp->opts.varNames) { - LclVarDsc* varDsc; - const char* varName; - - assert((unsigned)varx < emitComp->lvaCount); - varDsc = emitComp->lvaTable + varx; - varName = emitComp->compLocalVarName(varx, offs); + const char* varName = emitComp->compLocalVarName(varx, offs); if (varName) { @@ -13481,8 +13520,23 @@ void emitter::emitInsLoadStoreOp(instruction ins, emitAttr attr, regNumber dataR } else // no scale { - // Then load/store dataReg from/to [memBase + index] - emitIns_R_R_R(ins, attr, dataReg, memBase->GetRegNum(), index->GetRegNum()); + if (index->OperIs(GT_BFIZ) && index->isContained()) + { + // Then load/store dataReg from/to [memBase + index*scale with sign/zero extension] + GenTreeCast* cast = index->gtGetOp1()->AsCast(); + + // For now, this code only supports extensions from i32/u32 + assert(cast->isContained() && varTypeIsInt(cast->CastFromType())); + + emitIns_R_R_R_Ext(ins, attr, dataReg, memBase->GetRegNum(), cast->CastOp()->GetRegNum(), + cast->IsUnsigned() ? INS_OPTS_UXTW : INS_OPTS_SXTW, + (int)index->gtGetOp2()->AsIntCon()->IconValue()); + } + else + { + // Then load/store dataReg from/to [memBase + index] + emitIns_R_R_R(ins, attr, dataReg, memBase->GetRegNum(), index->GetRegNum()); + } } } } @@ -13535,9 +13589,7 @@ void emitter::emitInsLoadStoreOp(instruction ins, emitAttr attr, regNumber dataR // no logic here to track local variable lifetime changes, like we do in the contained case // above. E.g., for a `str r0,[r1]` for byref `r1` to local `V01`, we won't store the local // `V01` and so the emitter can't update the GC lifetime for `V01` if this is a variable birth. - GenTreeLclVarCommon* varNode = addr->AsLclVarCommon(); - unsigned lclNum = varNode->GetLclNum(); - LclVarDsc* varDsc = emitComp->lvaGetDesc(lclNum); + LclVarDsc* varDsc = emitComp->lvaGetDesc(addr->AsLclVarCommon()); assert(!varDsc->lvTracked); } #endif // DEBUG @@ -13597,44 +13649,6 @@ regNumber emitter::emitInsTernary(instruction ins, emitAttr attr, GenTree* dst, // src2 can only be a reg assert(!src2->isContained()); } - else if ((src1->OperIs(GT_MUL) && src1->isContained()) || (src2->OperIs(GT_MUL) && src2->isContained())) - { - assert(ins == INS_add); - - GenTree* mul; - GenTree* c; - if (src1->OperIs(GT_MUL)) - { - mul = src1; - c = src2; - } - else - { - mul = src2; - c = src1; - } - - GenTree* a = mul->gtGetOp1(); - GenTree* b = mul->gtGetOp2(); - - assert(varTypeIsIntegral(mul) && !mul->gtOverflow()); - - bool msub = false; - if (a->OperIs(GT_NEG) && a->isContained()) - { - a = a->gtGetOp1(); - msub = true; - } - if (b->OperIs(GT_NEG) && b->isContained()) - { - b = b->gtGetOp1(); - msub = !msub; // it's either "a * -b" or "-a * -b" which is the same as "a * b" - } - - emitIns_R_R_R_R(msub ? INS_msub : INS_madd, attr, dst->GetRegNum(), a->GetRegNum(), b->GetRegNum(), - c->GetRegNum()); - return dst->GetRegNum(); - } else // not floating point { // src2 can be immed or reg @@ -14596,18 +14610,29 @@ emitter::insExecutionCharacteristics emitter::getInsExecutionCharacteristics(ins } break; - case IF_SN_0A: // bkpt, brk, nop - if (id->idIsEmptyAlign()) + case IF_SN_0A: // nop, yield, align + + if (id->idIns() == INS_align) { - // We're not going to generate any instruction, so it doesn't count for PerfScore. - result.insThroughput = PERFSCORE_THROUGHPUT_ZERO; - result.insLatency = PERFSCORE_LATENCY_ZERO; + if ((id->idInsOpt() == INS_OPTS_NONE) || ((instrDescAlign*)id)->isPlacedAfterJmp) + { + // Either we're not going to generate 'align' instruction, or the 'align' + // instruction is placed immediately after unconditional jmp. + // In both cases, don't count for PerfScore. + + result.insThroughput = PERFSCORE_THROUGHPUT_ZERO; + result.insLatency = PERFSCORE_LATENCY_ZERO; + break; + } } - else + else if (ins == INS_yield) { - result.insThroughput = PERFSCORE_THROUGHPUT_2X; - result.insLatency = PERFSCORE_LATENCY_ZERO; + // @ToDo - find out the actual latency, match x86/x64 for now + result.insThroughput = PERFSCORE_THROUGHPUT_140C; + result.insLatency = PERFSCORE_LATENCY_140C; } + result.insThroughput = PERFSCORE_THROUGHPUT_2X; + result.insLatency = PERFSCORE_LATENCY_ZERO; break; case IF_SI_0B: // dmb, dsb, isb diff --git a/src/coreclr/jit/emitarm64.h b/src/coreclr/jit/emitarm64.h index 77a71a90051577..05909f6d2e175f 100644 --- a/src/coreclr/jit/emitarm64.h +++ b/src/coreclr/jit/emitarm64.h @@ -45,15 +45,6 @@ void emitDispShiftedReg(regNumber reg, insOpts opt, ssize_t imm, emitAttr attr); void emitDispExtendReg(regNumber reg, insOpts opt, ssize_t imm); void emitDispAddrRI(regNumber reg, insOpts opt, ssize_t imm); void emitDispAddrRRExt(regNumber reg1, regNumber reg2, insOpts opt, bool isScaled, emitAttr size); - -void emitDispIns(instrDesc* id, - bool isNew, - bool doffs, - bool asmfm, - unsigned offs = 0, - BYTE* pCode = 0, - size_t sz = 0, - insGroup* ig = NULL); #endif // DEBUG /************************************************************************/ @@ -858,7 +849,7 @@ void emitIns_Call(EmitCallType callType, VARSET_VALARG_TP ptrVars, regMaskTP gcrefRegs, regMaskTP byrefRegs, - IL_OFFSETX ilOffset, + const DebugInfo& di, regNumber ireg, regNumber xreg, unsigned xmul, diff --git a/src/coreclr/jit/emitxarch.cpp b/src/coreclr/jit/emitxarch.cpp index e07984760e018e..d472b1393518fb 100644 --- a/src/coreclr/jit/emitxarch.cpp +++ b/src/coreclr/jit/emitxarch.cpp @@ -164,6 +164,21 @@ bool emitter::DoesWriteZeroFlag(instruction ins) return (CodeGenInterface::instInfo[ins] & Writes_ZF) != 0; } +//------------------------------------------------------------------------ +// DoesWriteSignFlag: check if the instruction writes the +// SF flag. +// +// Arguments: +// ins - instruction to test +// +// Return Value: +// true if instruction writes the SF flag, false otherwise. +// +bool emitter::DoesWriteSignFlag(instruction ins) +{ + return (CodeGenInterface::instInfo[ins] & Writes_SF) != 0; +} + //------------------------------------------------------------------------ // DoesResetOverflowAndCarryFlags: check if the instruction resets the // OF and CF flag to 0. @@ -338,6 +353,11 @@ bool emitter::AreFlagsSetToZeroCmp(regNumber reg, emitAttr opSize, genTreeOps tr { assert(reg != REG_NA); + if (!emitComp->opts.OptimizationEnabled()) + { + return false; + } + // Don't look back across IG boundaries (possible control flow) if (emitCurIGinsCnt == 0 && ((emitCurIG->igFlags & IGF_EXTEND) == 0)) { @@ -393,6 +413,79 @@ bool emitter::AreFlagsSetToZeroCmp(regNumber reg, emitAttr opSize, genTreeOps tr return false; } +//------------------------------------------------------------------------ +// AreFlagsSetToForSignJumpOpt: checks if the previous instruction set the SF if the tree +// node qualifies for a jg/jle to jns/js optimization +// +// Arguments: +// reg - register of interest +// opSize - size of register +// relop - relational tree node +// +// Return Value: +// true if the tree node qualifies for the jg/jle to jns/js optimization +// false if not, or if we can't safely determine +// +// Notes: +// Currently only looks back one instruction. +bool emitter::AreFlagsSetForSignJumpOpt(regNumber reg, emitAttr opSize, GenTree* relop) +{ + assert(reg != REG_NA); + + if (!emitComp->opts.OptimizationEnabled()) + { + return false; + } + + // Don't look back across IG boundaries (possible control flow) + if (emitCurIGinsCnt == 0 && ((emitCurIG->igFlags & IGF_EXTEND) == 0)) + { + return false; + } + + instrDesc* id = emitLastIns; + instruction lastIns = id->idIns(); + insFormat fmt = id->idInsFmt(); + + // make sure op1 is a reg + switch (fmt) + { + case IF_RWR_CNS: + case IF_RRW_CNS: + case IF_RRW_SHF: + case IF_RWR_RRD: + case IF_RRW_RRD: + case IF_RWR_MRD: + case IF_RWR_SRD: + case IF_RRW_SRD: + case IF_RWR_ARD: + case IF_RRW_ARD: + case IF_RWR: + case IF_RRD: + case IF_RRW: + break; + default: + return false; + } + + if (id->idReg1() != reg) + { + return false; + } + + // If we have a GT_GE/GT_LT which generates an jge/jl, and the previous instruction + // sets the SF, we can omit a test instruction and check for jns/js. + if ((relop->OperGet() == GT_GE || relop->OperGet() == GT_LT) && !GenCondition::FromRelop(relop).IsUnsigned()) + { + if (DoesWriteSignFlag(lastIns) && IsFlagsAlwaysModified(id)) + { + return id->idOpSize() == opSize; + } + } + + return false; +} + //------------------------------------------------------------------------ // IsDstSrcImmAvxInstruction: Checks if the instruction has a "reg, reg/mem, imm" or // "reg/mem, reg, imm" form for the legacy, VEX, and EVEX @@ -1293,7 +1386,7 @@ const BYTE emitter::emitInsModeFmtTab[] = // clang-format on #ifdef DEBUG -unsigned const emitter::emitInsModeFmtCnt = _countof(emitInsModeFmtTab); +unsigned const emitter::emitInsModeFmtCnt = ArrLen(emitInsModeFmtTab); #endif /***************************************************************************** @@ -1387,7 +1480,7 @@ inline size_t insCode(instruction ins) }; // clang-format on - assert((unsigned)ins < _countof(insCodes)); + assert((unsigned)ins < ArrLen(insCodes)); assert((insCodes[ins] != BAD_CODE)); return insCodes[ins]; @@ -1420,7 +1513,7 @@ inline size_t insCodeACC(instruction ins) }; // clang-format on - assert((unsigned)ins < _countof(insCodesACC)); + assert((unsigned)ins < ArrLen(insCodesACC)); assert((insCodesACC[ins] != BAD_CODE)); return insCodesACC[ins]; @@ -1453,7 +1546,7 @@ inline size_t insCodeRR(instruction ins) }; // clang-format on - assert((unsigned)ins < _countof(insCodesRR)); + assert((unsigned)ins < ArrLen(insCodesRR)); assert((insCodesRR[ins] != BAD_CODE)); return insCodesRR[ins]; @@ -1482,7 +1575,7 @@ size_t insCodesRM[] = // Returns true iff the give CPU instruction has an RM encoding. inline bool hasCodeRM(instruction ins) { - assert((unsigned)ins < _countof(insCodesRM)); + assert((unsigned)ins < ArrLen(insCodesRM)); return ((insCodesRM[ins] != BAD_CODE)); } @@ -1493,7 +1586,7 @@ inline bool hasCodeRM(instruction ins) inline size_t insCodeRM(instruction ins) { - assert((unsigned)ins < _countof(insCodesRM)); + assert((unsigned)ins < ArrLen(insCodesRM)); assert((insCodesRM[ins] != BAD_CODE)); return insCodesRM[ins]; @@ -1522,7 +1615,7 @@ size_t insCodesMI[] = // Returns true iff the give CPU instruction has an MI encoding. inline bool hasCodeMI(instruction ins) { - assert((unsigned)ins < _countof(insCodesMI)); + assert((unsigned)ins < ArrLen(insCodesMI)); return ((insCodesMI[ins] != BAD_CODE)); } @@ -1533,7 +1626,7 @@ inline bool hasCodeMI(instruction ins) inline size_t insCodeMI(instruction ins) { - assert((unsigned)ins < _countof(insCodesMI)); + assert((unsigned)ins < ArrLen(insCodesMI)); assert((insCodesMI[ins] != BAD_CODE)); return insCodesMI[ins]; @@ -1562,7 +1655,7 @@ size_t insCodesMR[] = // Returns true iff the give CPU instruction has an MR encoding. inline bool hasCodeMR(instruction ins) { - assert((unsigned)ins < _countof(insCodesMR)); + assert((unsigned)ins < ArrLen(insCodesMR)); return ((insCodesMR[ins] != BAD_CODE)); } @@ -1573,7 +1666,7 @@ inline bool hasCodeMR(instruction ins) inline size_t insCodeMR(instruction ins) { - assert((unsigned)ins < _countof(insCodesMR)); + assert((unsigned)ins < ArrLen(insCodesMR)); assert((insCodesMR[ins] != BAD_CODE)); return insCodesMR[ins]; @@ -2177,8 +2270,8 @@ inline UNATIVE_OFFSET emitter::emitInsSizeSV(code_t code, int var, int dsp) CLANG_FORMAT_COMMENT_ANCHOR; #ifdef UNIX_AMD64_ABI - LclVarDsc* varDsc = emitComp->lvaTable + var; - bool isRegPassedArg = varDsc->lvIsParam && varDsc->lvIsRegArg; + const LclVarDsc* varDsc = emitComp->lvaGetDesc(var); + bool isRegPassedArg = varDsc->lvIsParam && varDsc->lvIsRegArg; // Register passed args could have a stack offset of 0. noway_assert((int)offs < 0 || isRegPassedArg || emitComp->opts.IsOSR()); #else // !UNIX_AMD64_ABI @@ -2805,7 +2898,8 @@ void emitter::emitIns(instruction ins) ins == INS_r_movsp || ins == INS_r_stosb || ins == INS_r_stosd || ins == INS_r_stosp || ins == INS_ret || ins == INS_sahf || ins == INS_stosb || ins == INS_stosd || ins == INS_stosp // These instructions take zero operands - || ins == INS_vzeroupper || ins == INS_lfence || ins == INS_mfence || ins == INS_sfence); + || ins == INS_vzeroupper || ins == INS_lfence || ins == INS_mfence || ins == INS_sfence || + ins == INS_pause); assert(assertCond); } @@ -7536,7 +7630,7 @@ void emitter::emitIns_Call(EmitCallType callType, VARSET_VALARG_TP ptrVars, regMaskTP gcrefRegs, regMaskTP byrefRegs, - IL_OFFSETX ilOffset, + const DebugInfo& di, regNumber ireg, regNumber xreg, unsigned xmul, @@ -7577,9 +7671,9 @@ void emitter::emitIns_Call(EmitCallType callType, #endif /* Managed RetVal: emit sequence point for the call */ - if (emitComp->opts.compDbgInfo && ilOffset != BAD_IL_OFFSET) + if (emitComp->opts.compDbgInfo && di.IsValid()) { - codeGen->genIPmappingAdd(ilOffset, false); + codeGen->genIPmappingAdd(IPmappingDscKind::Normal, di, false); } /* @@ -8116,7 +8210,7 @@ const char* emitter::emitXMMregName(unsigned reg) }; assert(reg < REG_COUNT); - assert(reg < _countof(regNames)); + assert(reg < ArrLen(regNames)); return regNames[reg]; } @@ -8134,7 +8228,7 @@ const char* emitter::emitYMMregName(unsigned reg) }; assert(reg < REG_COUNT); - assert(reg < _countof(regNames)); + assert(reg < ArrLen(regNames)); return regNames[reg]; } @@ -8303,12 +8397,7 @@ void emitter::emitDispFrameRef(int varx, int disp, int offs, bool asmfm) if (varx >= 0 && emitComp->opts.varNames) { - LclVarDsc* varDsc; - const char* varName; - - assert((unsigned)varx < emitComp->lvaCount); - varDsc = emitComp->lvaTable + varx; - varName = emitComp->compLocalVarName(varx, offs); + const char* varName = emitComp->compLocalVarName(varx, offs); if (varName) { @@ -8628,11 +8717,22 @@ void emitter::emitDispInsHex(instrDesc* id, BYTE* code, size_t sz) } } -/***************************************************************************** - * - * Display the given instruction. - */ - +//-------------------------------------------------------------------- +// emitDispIns: Dump the given instruction to jitstdout. +// +// Arguments: +// id - The instruction +// isNew - Whether the instruction is newly generated (before encoding). +// doffs - If true, always display the passed-in offset. +// asmfm - Whether the instruction should be displayed in assembly format. +// If false some additional information may be printed for the instruction. +// offset - The offset of the instruction. Only displayed if doffs is true or if +// !isNew && !asmfm. +// code - Pointer to the actual code, used for displaying the address and encoded bytes +// if turned on. +// sz - The size of the instruction, used to display the encoded bytes. +// ig - The instruction group containing the instruction. Not used on xarch. +// void emitter::emitDispIns( instrDesc* id, bool isNew, bool doffs, bool asmfm, unsigned offset, BYTE* code, size_t sz, insGroup* ig) { @@ -9736,7 +9836,14 @@ void emitter::emitDispIns( #if FEATURE_LOOP_ALIGN if (ins == INS_align) { - printf("[%d bytes]", id->idCodeSize()); + instrDescAlign* alignInstrId = (instrDescAlign*)id; + printf("[%d bytes", alignInstrId->idCodeSize()); + // targetIG is only set for 1st of the series of align instruction + if ((alignInstrId->idaLoopHeadPredIG != nullptr) && (alignInstrId->loopHeadIG() != nullptr)) + { + printf(" for IG%02u", alignInstrId->loopHeadIG()->igNum); + } + printf("]"); } #endif break; @@ -9924,32 +10031,74 @@ static BYTE* emitOutputNOP(BYTE* dstRW, size_t nBytes) // BYTE* emitter::emitOutputAlign(insGroup* ig, instrDesc* id, BYTE* dst) { + instrDescAlign* alignInstr = (instrDescAlign*)id; + +#ifdef DEBUG + // For cases where 'align' was placed behing a 'jmp' in an IG that does not + // immediately preced the loop IG, we do not know in advance the offset of + // IG having loop. For such cases, skip the padding calculation validation. + bool validatePadding = !alignInstr->isPlacedAfterJmp; +#endif + // Candidate for loop alignment assert(codeGen->ShouldAlignLoops()); - assert(ig->isLoopAlign()); + assert(ig->endsWithAlignInstr()); unsigned paddingToAdd = id->idCodeSize(); // Either things are already aligned or align them here. - assert((paddingToAdd == 0) || (((size_t)dst & (emitComp->opts.compJitAlignLoopBoundary - 1)) != 0)); + assert(!validatePadding || (paddingToAdd == 0) || + (((size_t)dst & (emitComp->opts.compJitAlignLoopBoundary - 1)) != 0)); // Padding amount should not exceed the alignment boundary assert(0 <= paddingToAdd && paddingToAdd < emitComp->opts.compJitAlignLoopBoundary); #ifdef DEBUG - unsigned paddingNeeded = emitCalculatePaddingForLoopAlignment(ig, (size_t)dst, true); - - // For non-adaptive, padding size is spread in multiple instructions, so don't bother checking - if (emitComp->opts.compJitAlignLoopAdaptive) + if (validatePadding) { - assert(paddingToAdd == paddingNeeded); + unsigned paddingNeeded = + emitCalculatePaddingForLoopAlignment(((instrDescAlign*)id)->idaIG->igNext, (size_t)dst, true); + + // For non-adaptive, padding size is spread in multiple instructions, so don't bother checking + if (emitComp->opts.compJitAlignLoopAdaptive) + { + assert(paddingToAdd == paddingNeeded); + } } emitComp->loopsAligned++; #endif BYTE* dstRW = dst + writeableOffset; - dstRW = emitOutputNOP(dstRW, paddingToAdd); + +#ifdef DEBUG + // Under STRESS_EMITTER, if this is the 'align' before the 'jmp' instruction, + // then add "int3" instruction. Since int3 takes 1 byte, we would only add + // it if paddingToAdd >= 1 byte. + + if (emitComp->compStressCompile(Compiler::STRESS_EMITTER, 50) && alignInstr->isPlacedAfterJmp && paddingToAdd >= 1) + { + size_t int3Code = insCodeMR(INS_BREAKPOINT); + // There is no good way to squeeze in "int3" as well as display it + // in the disassembly because there is no corresponding instrDesc for + // it. As such, leave it as is, the "0xCC" bytecode will be seen next + // to the nop instruction in disasm. + // e.g. CC align [1 bytes for IG29] + // + // if (emitComp->opts.disAsm) + //{ + // emitDispInsAddr(dstRW); + + // emitDispInsOffs(0, false); + + // printf(" %-9s ; stress-mode injected interrupt\n", "int3"); + //} + dstRW += emitOutputByte(dstRW, int3Code); + paddingToAdd -= 1; + } +#endif + + dstRW = emitOutputNOP(dstRW, paddingToAdd); return dstRW - writeableOffset; } @@ -12240,8 +12389,8 @@ BYTE* emitter::emitOutputRR(BYTE* dst, instrDesc* id) // Due to elided register moves, we can't have the following assert. // For example, consider: // t85 = LCL_VAR byref V01 arg1 rdx (last use) REG rdx - // /--* t85 byref - // * STORE_LCL_VAR byref V40 tmp31 rdx REG rdx + // /--* t85 byref + // * STORE_LCL_VAR byref V40 tmp31 rdx REG rdx // Here, V01 is type `long` on entry, then is stored as a byref. But because // the register allocator assigned the same register, no instruction was // generated, and we only (currently) make gcref/byref changes in emitter GC info @@ -13279,7 +13428,7 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) sz = sizeof(instrDescAlign); // IG can be marked as not needing alignment after emitting align instruction // In such case, skip outputting alignment. - if (ig->isLoopAlign()) + if (ig->endsWithAlignInstr()) { dst = emitOutputAlign(ig, id, dst); } @@ -14729,9 +14878,12 @@ emitter::insExecutionCharacteristics emitter::getInsExecutionCharacteristics(ins { case INS_align: #if FEATURE_LOOP_ALIGN - if (id->idCodeSize() == 0) + if ((id->idCodeSize() == 0) || ((instrDescAlign*)id)->isPlacedAfterJmp) { - // We're not going to generate any instruction, so it doesn't count for PerfScore. + // Either we're not going to generate 'align' instruction, or the 'align' + // instruction is placed immediately after unconditional jmp. + // In both cases, don't count for PerfScore. + result.insThroughput = PERFSCORE_THROUGHPUT_ZERO; result.insLatency = PERFSCORE_LATENCY_ZERO; break; @@ -16011,6 +16163,13 @@ emitter::insExecutionCharacteristics emitter::getInsExecutionCharacteristics(ins result.insThroughput = PERFSCORE_THROUGHPUT_2X; break; + case INS_pause: + { + result.insLatency = PERFSCORE_LATENCY_140C; + result.insThroughput = PERFSCORE_THROUGHPUT_140C; + break; + } + default: // unhandled instruction insFmt combination perfScoreUnhandledInstruction(id, &result); diff --git a/src/coreclr/jit/emitxarch.h b/src/coreclr/jit/emitxarch.h index 8217d088417cc1..54575044f13867 100644 --- a/src/coreclr/jit/emitxarch.h +++ b/src/coreclr/jit/emitxarch.h @@ -116,6 +116,7 @@ static bool IsJmpInstruction(instruction ins); bool AreUpper32BitsZero(regNumber reg); bool AreFlagsSetToZeroCmp(regNumber reg, emitAttr opSize, genTreeOps treeOps); +bool AreFlagsSetForSignJumpOpt(regNumber reg, emitAttr opSize, GenTree* tree); bool hasRexPrefix(code_t code) { @@ -190,6 +191,7 @@ void SetContains256bitAVX(bool value) bool IsDstDstSrcAVXInstruction(instruction ins); bool IsDstSrcSrcAVXInstruction(instruction ins); bool DoesWriteZeroFlag(instruction ins); +bool DoesWriteSignFlag(instruction ins); bool DoesResetOverflowAndCarryFlags(instruction ins); bool IsFlagsAlwaysModified(instrDesc* id); @@ -220,15 +222,6 @@ void emitDispReloc(ssize_t value); void emitDispAddrMode(instrDesc* id, bool noDetail = false); void emitDispShift(instruction ins, int cnt = 0); -void emitDispIns(instrDesc* id, - bool isNew, - bool doffs, - bool asmfm, - unsigned offs = 0, - BYTE* code = nullptr, - size_t sz = 0, - insGroup* ig = nullptr); - const char* emitXMMregName(unsigned reg); const char* emitYMMregName(unsigned reg); @@ -539,7 +532,7 @@ void emitIns_Call(EmitCallType callType, VARSET_VALARG_TP ptrVars, regMaskTP gcrefRegs, regMaskTP byrefRegs, - IL_OFFSETX ilOffset = BAD_IL_OFFSET, + const DebugInfo& di = DebugInfo(), regNumber ireg = REG_NA, regNumber xreg = REG_NA, unsigned xmul = 0, diff --git a/src/coreclr/jit/fgbasic.cpp b/src/coreclr/jit/fgbasic.cpp index da643cfd6d4db4..a82898c2595970 100644 --- a/src/coreclr/jit/fgbasic.cpp +++ b/src/coreclr/jit/fgbasic.cpp @@ -895,6 +895,11 @@ void Compiler::fgFindJumpTargets(const BYTE* codeAddr, IL_OFFSET codeSize, Fixed bool preciseScan = makeInlineObservations && compInlineResult->GetPolicy()->RequiresPreciseScan(); const bool resolveTokens = preciseScan && (isPreJit || isTier1); + // Track offsets where IL instructions begin in DEBUG builds. Used to + // validate debug info generated by the JIT. + assert(codeSize == compInlineContext->GetILSize()); + INDEBUG(FixedBitVect* ilInstsSet = FixedBitVect::bitVectInit(codeSize, this)); + if (makeInlineObservations) { // Set default values for profile (to avoid NoteFailed in CALLEE_IL_CODE_SIZE's handler) @@ -946,6 +951,9 @@ void Compiler::fgFindJumpTargets(const BYTE* codeAddr, IL_OFFSET codeSize, Fixed { prevOpcode = opcode; opcode = (OPCODE)getU1LittleEndian(codeAddr); + + INDEBUG(ilInstsSet->bitVectSet((UINT)(codeAddr - codeBegp))); + codeAddr += sizeof(__int8); if (!handled && preciseScan) @@ -1939,9 +1947,8 @@ void Compiler::fgFindJumpTargets(const BYTE* codeAddr, IL_OFFSET codeSize, Fixed // is based in that we know what trees we will // generate for this ldfld, and we require that we // won't need the address of this local at all - noway_assert(varNum < lvaTableCnt); - const bool notStruct = !varTypeIsStruct(&lvaTable[varNum]); + const bool notStruct = !varTypeIsStruct(lvaGetDesc(varNum)); const bool notLastInstr = (codeAddr < codeEndp - sz); const bool notDebugCode = !opts.compDbgCode; @@ -2007,6 +2014,8 @@ void Compiler::fgFindJumpTargets(const BYTE* codeAddr, IL_OFFSET codeSize, Fixed case CEE_LOCALLOC: + compLocallocSeen = true; + // We now allow localloc callees to become candidates in some cases. if (makeInlineObservations) { @@ -2092,6 +2101,8 @@ void Compiler::fgFindJumpTargets(const BYTE* codeAddr, IL_OFFSET codeSize, Fixed " at offset %04X", (IL_OFFSET)(codeAddr - codeBegp)); } + INDEBUG(compInlineContext->SetILInstsSet(ilInstsSet)); + if (makeInlineObservations) { compInlineResult->Note(InlineObservation::CALLEE_END_OPCODE_SCAN); @@ -2726,15 +2737,9 @@ unsigned Compiler::fgMakeBasicBlocks(const BYTE* codeAddr, IL_OFFSET codeSize, F BADCODE3("tail call not followed by ret", " at offset %04X", (IL_OFFSET)(codeAddr - codeBegp)); } - if (fgCanSwitchToOptimized() && fgMayExplicitTailCall()) + if (fgMayExplicitTailCall()) { - // Method has an explicit tail call that may run like a loop or may not be generated as a tail - // call in tier 0, switch to optimized to avoid spending too much time running slower code - if (!opts.jitFlags->IsSet(JitFlags::JIT_FLAG_BBINSTR) || - ((info.compFlags & CORINFO_FLG_DISABLE_TIER0_FOR_LOOPS) != 0)) - { - fgSwitchToOptimized(); - } + compTailPrefixSeen = true; } } else @@ -3522,6 +3527,57 @@ void Compiler::fgFindBasicBlocks() #endif fgNormalizeEH(); + + fgCheckForLoopsInHandlers(); +} + +//------------------------------------------------------------------------ +// fgCheckForLoopsInHandlers: scan blocks seeing if any handler block +// is a backedge target. +// +// Notes: +// Sets compHasBackwardJumpInHandler if so. This will disable +// setting patchpoints in this method and prompt the jit to +// optimize the method instead. +// +// We assume any late-added handler (say for synchronized methods) will +// not introduce any loops. +// +void Compiler::fgCheckForLoopsInHandlers() +{ + // We only care about this if we are going to set OSR patchpoints + // and the method has exception handling. + // + if (!opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER0)) + { + return; + } + + if (JitConfig.TC_OnStackReplacement() == 0) + { + return; + } + + if (info.compXcptnsCount == 0) + { + return; + } + + // Walk blocks in handlers and filters, looing for a backedge target. + // + assert(!compHasBackwardJumpInHandler); + for (BasicBlock* const blk : Blocks()) + { + if (blk->hasHndIndex()) + { + if (blk->bbFlags & BBF_BACKWARD_JUMP_TARGET) + { + JITDUMP("\nHander block " FMT_BB "is backward jump target; can't have patchpoints in this method\n"); + compHasBackwardJumpInHandler = true; + break; + } + } + } } //------------------------------------------------------------------------ @@ -4055,9 +4111,11 @@ IL_OFFSET Compiler::fgFindBlockILOffset(BasicBlock* block) for (Statement* const stmt : block->Statements()) { - if (stmt->GetILOffsetX() != BAD_IL_OFFSET) + // Blocks always contain IL offsets in the root. + DebugInfo di = stmt->GetDebugInfo().GetRoot(); + if (di.IsValid()) { - return jitGetILoffs(stmt->GetILOffsetX()); + return di.GetLocation().GetOffset(); } } @@ -4228,9 +4286,10 @@ BasicBlock* Compiler::fgSplitBlockAfterNode(BasicBlock* curr, GenTree* node) if ((*riter)->gtOper == GT_IL_OFFSET) { GenTreeILOffset* ilOffset = (*riter)->AsILOffset(); - if (ilOffset->gtStmtILoffsx != BAD_IL_OFFSET) + DebugInfo rootDI = ilOffset->gtStmtDI.GetRoot(); + if (rootDI.IsValid()) { - splitPointILOffset = jitGetILoffs(ilOffset->gtStmtILoffsx); + splitPointILOffset = rootDI.GetLocation().GetOffset(); break; } } @@ -4636,6 +4695,7 @@ void Compiler::fgRemoveBlock(BasicBlock* block, bool unreachable) if (block->isLoopAlign()) { + loopAlignCandidates++; succBlock->bbFlags |= BBF_LOOP_ALIGN; JITDUMP("Propagating LOOP_ALIGN flag from " FMT_BB " to " FMT_BB " for loop# %d.", block->bbNum, succBlock->bbNum, block->bbNatLoopNum); @@ -4643,8 +4703,8 @@ void Compiler::fgRemoveBlock(BasicBlock* block, bool unreachable) if (fgDomsComputed && fgReachable(succBlock, block)) { - /* Mark all the reachable blocks between 'succBlock' and 'block', excluding 'block' */ - optMarkLoopBlocks(succBlock, block, true); + // Mark all the reachable blocks between 'succBlock' and 'bPrev' + optScaleLoopBlocks(succBlock, bPrev); } } else if (succBlock->isLoopHead() && bPrev && (succBlock->bbNum <= bPrev->bbNum)) @@ -4652,8 +4712,6 @@ void Compiler::fgRemoveBlock(BasicBlock* block, bool unreachable) skipUnmarkLoop = true; } - noway_assert(succBlock); - // If this is the first Cold basic block update fgFirstColdBlock if (block == fgFirstColdBlock) { @@ -4696,12 +4754,6 @@ void Compiler::fgRemoveBlock(BasicBlock* block, bool unreachable) succBlock->bbRefs++; } - fgUnlinkBlock(block); - - /* mark the block as removed and set the change flag */ - - block->bbFlags |= BBF_REMOVED; - /* Update bbRefs and bbPreds. * All blocks jumping to 'block' now jump to 'succBlock'. * First, remove 'block' from the predecessor list of succBlock. @@ -4791,8 +4843,14 @@ void Compiler::fgRemoveBlock(BasicBlock* block, bool unreachable) break; } } + + fgUnlinkBlock(block); + block->bbFlags |= BBF_REMOVED; } + // If this was marked for alignment, remove it + block->unmarkLoopAlign(this DEBUG_ARG("Removed block")); + if (bPrev != nullptr) { switch (bPrev->bbJumpKind) @@ -5551,7 +5609,17 @@ BasicBlock* Compiler::fgRelocateEHRange(unsigned regionIndex, FG_RELOCATE_TYPE r return bLast; } -// return true if there is a possibility that the method has a loop (a backedge is present) +//------------------------------------------------------------------------ +// fgMightHaveLoop: return true if there is a possibility that the method has a loop (a back edge is present). +// This function doesn't depend on any previous loop computations, including predecessors. It looks for any +// lexical back edge to a block previously seen in a forward walk of the block list. +// +// As it walks all blocks and all successors of each block (including EH successors), it is not cheap. +// It returns as soon as any possible loop is discovered. +// +// Return Value: +// true if there might be a loop +// bool Compiler::fgMightHaveLoop() { // Don't use a BlockSet for this temporary bitset of blocks: we don't want to have to call EnsureBasicBlockEpoch() @@ -5564,7 +5632,7 @@ bool Compiler::fgMightHaveLoop() { BitVecOps::AddElemD(&blockVecTraits, blocksSeen, block->bbNum); - for (BasicBlock* succ : block->GetAllSuccs(this)) + for (BasicBlock* const succ : block->GetAllSuccs(this)) { if (BitVecOps::IsMember(&blockVecTraits, blocksSeen, succ->bbNum)) { diff --git a/src/coreclr/jit/fgdiagnostic.cpp b/src/coreclr/jit/fgdiagnostic.cpp index c1af1a30badfea..8fa10e2f9f18f5 100644 --- a/src/coreclr/jit/fgdiagnostic.cpp +++ b/src/coreclr/jit/fgdiagnostic.cpp @@ -1632,7 +1632,7 @@ bool Compiler::fgDumpFlowGraph(Phases phase, PhasePosition pos) } } - // Add regions for the loops. Note that loops are assumed to be contiguous from `lpFirst` to `lpBottom`. + // Add regions for the loops. Note that loops are assumed to be contiguous from `lpTop` to `lpBottom`. if (includeLoops) { @@ -1645,7 +1645,7 @@ bool Compiler::fgDumpFlowGraph(Phases phase, PhasePosition pos) continue; } sprintf_s(name, sizeof(name), FMT_LP, loopNum); - rgnGraph.Insert(name, RegionGraph::RegionType::Loop, loop.lpFirst, loop.lpBottom); + rgnGraph.Insert(name, RegionGraph::RegionType::Loop, loop.lpTop, loop.lpBottom); } } @@ -2851,6 +2851,11 @@ void Compiler::fgDebugCheckFlags(GenTree* tree) chkFlags |= GTF_EXCEPT; } + if (tree->OperRequiresAsgFlag()) + { + chkFlags |= GTF_ASG; + } + if (tree->OperRequiresCallFlag(this)) { chkFlags |= GTF_CALL; @@ -2931,31 +2936,6 @@ void Compiler::fgDebugCheckFlags(GenTree* tree) } break; - case GT_LIST: - if ((op2 != nullptr) && op2->OperIsAnyList()) - { - ArrayStack stack(getAllocator(CMK_DebugOnly)); - while ((tree->gtGetOp2() != nullptr) && tree->gtGetOp2()->OperIsAnyList()) - { - stack.Push(tree); - tree = tree->gtGetOp2(); - } - - fgDebugCheckFlags(tree); - - while (!stack.Empty()) - { - tree = stack.Pop(); - assert((tree->gtFlags & GTF_REVERSE_OPS) == 0); - fgDebugCheckFlags(tree->AsOp()->gtOp1); - chkFlags |= (tree->AsOp()->gtOp1->gtFlags & GTF_ALL_EFFECT); - chkFlags |= (tree->gtGetOp2()->gtFlags & GTF_ALL_EFFECT); - fgDebugCheckFlagsHelper(tree, (tree->gtFlags & GTF_ALL_EFFECT), chkFlags); - } - - return; - } - break; case GT_ADDR: assert(!op1->CanCSE()); break; @@ -2967,7 +2947,7 @@ void Compiler::fgDebugCheckFlags(GenTree* tree) { // Is this constant a handle of some kind? // - unsigned handleKind = (op1->gtFlags & GTF_ICON_HDL_MASK); + GenTreeFlags handleKind = (op1->gtFlags & GTF_ICON_HDL_MASK); if (handleKind != 0) { // Is the GTF_IND_INVARIANT flag set or unset? @@ -3097,11 +3077,6 @@ void Compiler::fgDebugCheckFlags(GenTree* tree) */ } - if (tree->OperRequiresAsgFlag()) - { - chkFlags |= GTF_ASG; - } - if (oper == GT_ADDR && (op1->OperIsLocal() || op1->gtOper == GT_CLS_VAR || (op1->gtOper == GT_IND && op1->AsOp()->gtOp1->gtOper == GT_CLS_VAR_ADDR))) { @@ -3130,6 +3105,8 @@ void Compiler::fgDebugCheckFlags(GenTree* tree) if ((call->gtCallThisArg->GetNode()->gtFlags & GTF_ASG) != 0) { + // TODO-Cleanup: this is a patch for a violation in our GT_ASG propagation + // see https://github.com/dotnet/runtime/issues/13758 treeFlags |= GTF_ASG; } } @@ -3142,6 +3119,8 @@ void Compiler::fgDebugCheckFlags(GenTree* tree) if ((use.GetNode()->gtFlags & GTF_ASG) != 0) { + // TODO-Cleanup: this is a patch for a violation in our GT_ASG propagation + // see https://github.com/dotnet/runtime/issues/13758 treeFlags |= GTF_ASG; } } @@ -3191,6 +3170,23 @@ void Compiler::fgDebugCheckFlags(GenTree* tree) } break; +#if defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) +#if defined(FEATURE_SIMD) + case GT_SIMD: +#endif +#if defined(FEATURE_HW_INTRINSICS) + case GT_HWINTRINSIC: +#endif + // TODO-List-Cleanup: consider using the general Operands() iterator + // here for the "special" nodes to reduce code duplication. + for (GenTree* operand : tree->AsMultiOp()->Operands()) + { + fgDebugCheckFlags(operand); + chkFlags |= (operand->gtFlags & GTF_ALL_EFFECT); + } + break; +#endif // defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) + case GT_ARR_ELEM: GenTree* arrObj; diff --git a/src/coreclr/jit/fginline.cpp b/src/coreclr/jit/fginline.cpp index 9b2e4080a62a2d..cf73fa123e6fd9 100644 --- a/src/coreclr/jit/fginline.cpp +++ b/src/coreclr/jit/fginline.cpp @@ -29,11 +29,12 @@ unsigned Compiler::fgCheckInlineDepthAndRecursion(InlineInfo* inlineInfo) { BYTE* candidateCode = inlineInfo->inlineCandidateInfo->methInfo.ILCode; - InlineContext* inlineContext = inlineInfo->iciStmt->GetInlineContext(); + InlineContext* inlineContext = inlineInfo->inlineCandidateInfo->inlinersContext; InlineResult* inlineResult = inlineInfo->inlineResult; // There should be a context for all candidates. assert(inlineContext != nullptr); + int depth = 0; for (; inlineContext != nullptr; inlineContext = inlineContext->GetParent()) @@ -101,17 +102,6 @@ PhaseStatus Compiler::fgInline() noway_assert(fgFirstBB != nullptr); - // Set the root inline context on all statements - InlineContext* rootContext = m_inlineStrategy->GetRootContext(); - - for (BasicBlock* const block : Blocks()) - { - for (Statement* const stmt : block->Statements()) - { - stmt->SetInlineContext(rootContext); - } - } - BasicBlock* block = fgFirstBB; bool madeChanges = false; @@ -123,7 +113,7 @@ PhaseStatus Compiler::fgInline() for (Statement* const stmt : block->Statements()) { -#ifdef DEBUG +#if defined(DEBUG) || defined(INLINE_DATA) // In debug builds we want the inline tree to show all failed // inlines. Some inlines may fail very early and never make it to // candidate stage. So scan the tree looking for those early failures. @@ -226,7 +216,7 @@ PhaseStatus Compiler::fgInline() { JITDUMP("**************** Inline Tree"); printf("\n"); - m_inlineStrategy->Dump(verbose); + m_inlineStrategy->Dump(verbose || JitConfig.JitPrintInlinedMethodsVerbose()); } #endif // DEBUG @@ -234,7 +224,7 @@ PhaseStatus Compiler::fgInline() return madeChanges ? PhaseStatus::MODIFIED_EVERYTHING : PhaseStatus::MODIFIED_NOTHING; } -#ifdef DEBUG +#if defined(DEBUG) || defined(INLINE_DATA) //------------------------------------------------------------------------ // fgFindNonInlineCandidate: tree walk helper to ensure that a tree node @@ -283,7 +273,7 @@ void Compiler::fgNoteNonInlineCandidate(Statement* stmt, GenTreeCall* call) return; } - InlineResult inlineResult(this, call, nullptr, "fgNotInlineCandidate"); + InlineResult inlineResult(this, call, nullptr, "fgNoteNonInlineCandidate"); InlineObservation currentObservation = InlineObservation::CALLSITE_NOT_CANDIDATE; // Try and recover the reason left behind when the jit decided @@ -301,8 +291,7 @@ void Compiler::fgNoteNonInlineCandidate(Statement* stmt, GenTreeCall* call) if (call->gtCallType == CT_USER_FUNC) { - // Create InlineContext for the failure - m_inlineStrategy->NewFailure(stmt, &inlineResult); + m_inlineStrategy->NewContext(call->gtInlineContext, stmt, call)->SetFailed(&inlineResult); } } @@ -863,7 +852,7 @@ Compiler::fgWalkResult Compiler::fgDebugCheckInlineCandidates(GenTree** pTree, f #endif // DEBUG -void Compiler::fgInvokeInlineeCompiler(GenTreeCall* call, InlineResult* inlineResult) +void Compiler::fgInvokeInlineeCompiler(GenTreeCall* call, InlineResult* inlineResult, InlineContext** createdContext) { noway_assert(call->gtOper == GT_CALL); noway_assert((call->gtFlags & GTF_CALL_INLINE_CANDIDATE) != 0); @@ -945,6 +934,14 @@ void Compiler::fgInvokeInlineeCompiler(GenTreeCall* call, InlineResult* inlineRe { pParam->inlineInfo->InlineRoot = pParam->pThis->impInlineInfo->InlineRoot; } + + // The inline context is part of debug info and must be created + // before we start creating statements; we lazily create it as + // late as possible, which is here. + pParam->inlineInfo->inlineContext = + pParam->inlineInfo->InlineRoot->m_inlineStrategy + ->NewContext(pParam->inlineInfo->inlineCandidateInfo->inlinersContext, + pParam->inlineInfo->iciStmt, pParam->inlineInfo->iciCall); pParam->inlineInfo->argCnt = pParam->inlineCandidateInfo->methInfo.args.totalILArgs(); pParam->inlineInfo->tokenLookupContextHandle = pParam->inlineCandidateInfo->exactContextHnd; @@ -960,7 +957,6 @@ void Compiler::fgInvokeInlineeCompiler(GenTreeCall* call, InlineResult* inlineRe compileFlagsForInlinee.Clear(JitFlags::JIT_FLAG_BBINSTR); compileFlagsForInlinee.Clear(JitFlags::JIT_FLAG_PROF_ENTERLEAVE); compileFlagsForInlinee.Clear(JitFlags::JIT_FLAG_DEBUG_EnC); - compileFlagsForInlinee.Clear(JitFlags::JIT_FLAG_DEBUG_INFO); compileFlagsForInlinee.Clear(JitFlags::JIT_FLAG_REVERSE_PINVOKE); compileFlagsForInlinee.Clear(JitFlags::JIT_FLAG_TRACK_TRANSITIONS); @@ -1011,6 +1007,8 @@ void Compiler::fgInvokeInlineeCompiler(GenTreeCall* call, InlineResult* inlineRe } } + *createdContext = inlineInfo.inlineContext; + if (inlineResult->IsFailure()) { return; @@ -1117,16 +1115,8 @@ void Compiler::fgInsertInlineeBlocks(InlineInfo* pInlineInfo) #endif // DEBUG - // Create a new inline context and mark the inlined statements with it - InlineContext* calleeContext = m_inlineStrategy->NewSuccess(pInlineInfo); - - for (BasicBlock* const block : InlineeCompiler->Blocks()) - { - for (Statement* const stmt : block->Statements()) - { - stmt->SetInlineContext(calleeContext); - } - } + // Mark success. + pInlineInfo->inlineContext->SetSucceeded(pInlineInfo); // Prepend statements Statement* stmtAfter = fgInlinePrependStatements(pInlineInfo); @@ -1281,9 +1271,10 @@ void Compiler::fgInsertInlineeBlocks(InlineInfo* pInlineInfo) block->copyEHRegion(iciBlock); block->bbFlags |= iciBlock->bbFlags & BBF_BACKWARD_JUMP; - if (iciStmt->GetILOffsetX() != BAD_IL_OFFSET) + DebugInfo di = iciStmt->GetDebugInfo().GetRoot(); + if (di.IsValid()) { - block->bbCodeOffs = jitGetILoffs(iciStmt->GetILOffsetX()); + block->bbCodeOffs = di.GetLocation().GetOffset(); block->bbCodeOffsEnd = block->bbCodeOffs + 1; // TODO: is code size of 1 some magic number for inlining? } else @@ -1469,13 +1460,13 @@ void Compiler::fgInsertInlineeBlocks(InlineInfo* pInlineInfo) Statement* Compiler::fgInlinePrependStatements(InlineInfo* inlineInfo) { - BasicBlock* block = inlineInfo->iciBlock; - Statement* callStmt = inlineInfo->iciStmt; - IL_OFFSETX callILOffset = callStmt->GetILOffsetX(); - Statement* postStmt = callStmt->GetNextStmt(); - Statement* afterStmt = callStmt; // afterStmt is the place where the new statements should be inserted after. - Statement* newStmt = nullptr; - GenTreeCall* call = inlineInfo->iciCall->AsCall(); + BasicBlock* block = inlineInfo->iciBlock; + Statement* callStmt = inlineInfo->iciStmt; + const DebugInfo& callDI = callStmt->GetDebugInfo(); + Statement* postStmt = callStmt->GetNextStmt(); + Statement* afterStmt = callStmt; // afterStmt is the place where the new statements should be inserted after. + Statement* newStmt = nullptr; + GenTreeCall* call = inlineInfo->iciCall->AsCall(); noway_assert(call->gtOper == GT_CALL); @@ -1589,8 +1580,7 @@ Statement* Compiler::fgInlinePrependStatements(InlineInfo* inlineInfo) // argTmpNum here since in-linee compiler instance // would have iterated over these and marked them // accordingly. - impAssignTempGen(tmpNum, argNode, structHnd, (unsigned)CHECK_SPILL_NONE, &afterStmt, callILOffset, - block); + impAssignTempGen(tmpNum, argNode, structHnd, (unsigned)CHECK_SPILL_NONE, &afterStmt, callDI, block); // We used to refine the temp type here based on // the actual arg, but we now do this up front, when @@ -1639,7 +1629,7 @@ Statement* Compiler::fgInlinePrependStatements(InlineInfo* inlineInfo) // Don't put GT_OBJ node under a GT_COMMA. // Codegen can't deal with it. // Just hang the address here in case there are side-effect. - newStmt = gtNewStmt(gtUnusedValNode(argNode->AsOp()->gtOp1), callILOffset); + newStmt = gtNewStmt(gtUnusedValNode(argNode->AsOp()->gtOp1), callDI); } else { @@ -1715,7 +1705,7 @@ Statement* Compiler::fgInlinePrependStatements(InlineInfo* inlineInfo) // just append the arg node as an unused value. if (newStmt == nullptr) { - newStmt = gtNewStmt(gtUnusedValNode(argNode), callILOffset); + newStmt = gtNewStmt(gtUnusedValNode(argNode), callDI); } fgInsertStmtAfter(block, afterStmt, newStmt); @@ -1751,7 +1741,7 @@ Statement* Compiler::fgInlinePrependStatements(InlineInfo* inlineInfo) CORINFO_CLASS_HANDLE exactClass = eeGetClassFromContext(inlineInfo->inlineCandidateInfo->exactContextHnd); tree = fgGetSharedCCtor(exactClass); - newStmt = gtNewStmt(tree, callILOffset); + newStmt = gtNewStmt(tree, callDI); fgInsertStmtAfter(block, afterStmt, newStmt); afterStmt = newStmt; } @@ -1759,7 +1749,7 @@ Statement* Compiler::fgInlinePrependStatements(InlineInfo* inlineInfo) // Insert the nullcheck statement now. if (nullcheck) { - newStmt = gtNewStmt(nullcheck, callILOffset); + newStmt = gtNewStmt(nullcheck, callDI); fgInsertStmtAfter(block, afterStmt, newStmt); afterStmt = newStmt; } @@ -1812,7 +1802,7 @@ Statement* Compiler::fgInlinePrependStatements(InlineInfo* inlineInfo) // Unsafe value cls check is not needed here since in-linee compiler instance would have // iterated over locals and marked accordingly. impAssignTempGen(tmpNum, gtNewZeroConNode(genActualType(lclTyp)), NO_CLASS_HANDLE, - (unsigned)CHECK_SPILL_NONE, &afterStmt, callILOffset, block); + (unsigned)CHECK_SPILL_NONE, &afterStmt, callDI, block); } else { @@ -1821,7 +1811,7 @@ Statement* Compiler::fgInlinePrependStatements(InlineInfo* inlineInfo) false, // isVolatile false); // not copyBlock - newStmt = gtNewStmt(tree, callILOffset); + newStmt = gtNewStmt(tree, callDI); fgInsertStmtAfter(block, afterStmt, newStmt); afterStmt = newStmt; } @@ -1836,15 +1826,6 @@ Statement* Compiler::fgInlinePrependStatements(InlineInfo* inlineInfo) } } - // Update any newly added statements with the appropriate context. - InlineContext* context = callStmt->GetInlineContext(); - assert(context != nullptr); - for (Statement* addedStmt = callStmt->GetNextStmt(); addedStmt != postStmt; addedStmt = addedStmt->GetNextStmt()) - { - assert(addedStmt->GetInlineContext() == nullptr); - addedStmt->SetInlineContext(context); - } - return afterStmt; } @@ -1881,7 +1862,7 @@ void Compiler::fgInlineAppendStatements(InlineInfo* inlineInfo, BasicBlock* bloc JITDUMP("fgInlineAppendStatements: nulling out gc ref inlinee locals.\n"); Statement* callStmt = inlineInfo->iciStmt; - IL_OFFSETX callILOffset = callStmt->GetILOffsetX(); + const DebugInfo& callDI = callStmt->GetDebugInfo(); CORINFO_METHOD_INFO* InlineeMethodInfo = InlineeCompiler->info.compMethodInfo; const unsigned lclCnt = InlineeMethodInfo->locals.numArgs; InlLclVarInfo* lclVarInfo = inlineInfo->lclVarInfo; @@ -1930,7 +1911,7 @@ void Compiler::fgInlineAppendStatements(InlineInfo* inlineInfo, BasicBlock* bloc // Assign null to the local. GenTree* nullExpr = gtNewTempAssign(tmpNum, gtNewZeroConNode(lclTyp)); - Statement* nullStmt = gtNewStmt(nullExpr, callILOffset); + Statement* nullStmt = gtNewStmt(nullExpr, callDI); if (stmtAfter == nullptr) { diff --git a/src/coreclr/jit/fgopt.cpp b/src/coreclr/jit/fgopt.cpp index 59f326b0fc13a4..39e1dae21e3519 100644 --- a/src/coreclr/jit/fgopt.cpp +++ b/src/coreclr/jit/fgopt.cpp @@ -364,17 +364,11 @@ void Compiler::fgComputeEnterBlocksSet() // Assumptions: // The reachability sets must be computed and valid. // -// Notes: -// Sets `fgHasLoops` if there are any loops in the function. -// Sets `BBF_LOOP_HEAD` flag on a block if that block is the target of a backward branch and the block can -// reach the source of the branch. -// bool Compiler::fgRemoveUnreachableBlocks() { assert(!fgCheapPredsValid); assert(fgReachabilitySetsValid); - bool hasLoops = false; bool hasUnreachableBlocks = false; bool changed = false; @@ -384,7 +378,7 @@ bool Compiler::fgRemoveUnreachableBlocks() /* Internal throw blocks are also reachable */ if (fgIsThrowHlpBlk(block)) { - goto SKIP_BLOCK; + continue; } else if (block == genReturnBB) { @@ -392,20 +386,20 @@ bool Compiler::fgRemoveUnreachableBlocks() // For example, in VSW 364383, // the profiler hookup needs to have the "void GT_RETURN" statement // to properly set the info.compProfilerCallback flag. - goto SKIP_BLOCK; + continue; } else { // If any of the entry blocks can reach this block, then we skip it. if (!BlockSetOps::IsEmptyIntersection(this, fgEnterBlks, block->bbReach)) { - goto SKIP_BLOCK; + continue; } #if defined(FEATURE_EH_FUNCLETS) && defined(TARGET_ARM) if (!BlockSetOps::IsEmptyIntersection(this, fgAlwaysBlks, block->bbReach)) { - goto SKIP_BLOCK; + continue; } #endif // defined(FEATURE_EH_FUNCLETS) && defined(TARGET_ARM) } @@ -451,54 +445,22 @@ bool Compiler::fgRemoveUnreachableBlocks() hasUnreachableBlocks = true; changed = true; } - continue; - - SKIP_BLOCK:; - - if (block->bbJumpKind == BBJ_RETURN) - { - continue; - } - - // Set BBF_LOOP_HEAD if we have backwards branches to this block. - - unsigned blockNum = block->bbNum; - for (BasicBlock* const predBlock : block->PredBlocks()) - { - if (blockNum <= predBlock->bbNum) - { - if (predBlock->bbJumpKind == BBJ_CALLFINALLY) - { - continue; - } - - /* If block can reach predBlock then we have a loop head */ - if (BlockSetOps::IsMember(this, predBlock->bbReach, blockNum)) - { - hasLoops = true; - - /* Set the BBF_LOOP_HEAD flag */ - block->bbFlags |= BBF_LOOP_HEAD; - break; - } - } - } } - fgHasLoops = hasLoops; - if (hasUnreachableBlocks) { // Now remove the unreachable blocks for (BasicBlock* block = fgFirstBB; block != nullptr; block = block->bbNext) { - // If we mark the block with BBF_REMOVED then - // we need to call fgRemovedBlock() on it + // If we marked a block with BBF_REMOVED then we need to call fgRemoveBlock() on it if (block->bbFlags & BBF_REMOVED) { fgRemoveBlock(block, true); + // TODO: couldn't we have fgRemoveBlock() return the block after the (last)one removed + // so we don't need the code below? + // When we have a BBJ_CALLFINALLY, BBJ_ALWAYS pair; fgRemoveBlock will remove // both blocks, so we must advance 1 extra place in the block list // @@ -521,9 +483,6 @@ bool Compiler::fgRemoveUnreachableBlocks() // Also, compute the list of return blocks `fgReturnBlocks` and set of enter blocks `fgEnterBlks`. // Delete unreachable blocks. // -// Via the call to `fgRemoveUnreachableBlocks`, determine if the flow graph has loops and set 'fgHasLoops' -// accordingly. Set the BBF_LOOP_HEAD flag on the block target of backwards branches. -// // Assumptions: // Assumes the predecessor lists are computed and correct. // @@ -591,8 +550,6 @@ void Compiler::fgComputeReachability() // // Use reachability information to delete unreachable blocks. - // Also, determine if the flow graph has loops and set 'fgHasLoops' accordingly. - // Set the BBF_LOOP_HEAD flag on the block target of backwards branches. // changed = fgRemoveUnreachableBlocks(); @@ -1553,8 +1510,20 @@ void Compiler::fgPostImportationCleanup() // auto addConditionalFlow = [this, entryStateVar, &entryJumpTarget](BasicBlock* fromBlock, BasicBlock* toBlock) { - fgSplitBlockAtBeginning(fromBlock); + + // We may have previously though this try entry was unreachable, but now we're going to + // step through it on the way to the OSR entry. So ensure it has plausible profile weight. + // + if (fgHaveProfileData() && !fromBlock->hasProfileWeight()) + { + JITDUMP("Updating block weight for now-reachable try entry " FMT_BB " via " FMT_BB "\n", + fromBlock->bbNum, fgFirstBB->bbNum); + fromBlock->inheritWeight(fgFirstBB); + } + + BasicBlock* const newBlock = fgSplitBlockAtBeginning(fromBlock); fromBlock->bbFlags |= BBF_INTERNAL; + newBlock->bbFlags &= ~BBF_DONT_REMOVE; GenTree* const entryStateLcl = gtNewLclvNode(entryStateVar, TYP_INT); GenTree* const compareEntryStateToZero = @@ -1565,6 +1534,7 @@ void Compiler::fgPostImportationCleanup() fromBlock->bbJumpKind = BBJ_COND; fromBlock->bbJumpDest = toBlock; fgAddRefPred(toBlock, fromBlock); + newBlock->inheritWeight(fromBlock); entryJumpTarget = fromBlock; }; @@ -2239,13 +2209,6 @@ void Compiler::fgUpdateLoopsAfterCompacting(BasicBlock* block, BasicBlock* bNext optLoopTable[loopNum].lpEntry = block; } - /* Check the loop's first block */ - - if (optLoopTable[loopNum].lpFirst == bNext) - { - optLoopTable[loopNum].lpFirst = block; - } - /* Check the loop top */ if (optLoopTable[loopNum].lpTop == bNext) @@ -3220,7 +3183,9 @@ bool Compiler::fgBlockIsGoodTailDuplicationCandidate(BasicBlock* target, unsigne { *lclNum = BAD_VAR_NUM; - // Here we are looking for blocks with a single statement feeding a conditional branch. + // Here we are looking for small blocks where a local live-into the block + // ultimately feeds a simple conditional branch. + // // These blocks are small, and when duplicated onto the tail of blocks that end in // assignments, there is a high probability of the branch completely going away. // @@ -3237,22 +3202,27 @@ bool Compiler::fgBlockIsGoodTailDuplicationCandidate(BasicBlock* target, unsigne return false; } - Statement* stmt = target->FirstNonPhiDef(); + Statement* const lastStmt = target->lastStmt(); + Statement* const firstStmt = target->FirstNonPhiDef(); - if (stmt != target->lastStmt()) + // We currently allow just one statement aside from the branch. + // + if ((firstStmt != lastStmt) && (firstStmt != lastStmt->GetPrevStmt())) { return false; } - GenTree* tree = stmt->GetRootNode(); + // Verify the branch is just a simple local compare. + // + GenTree* const lastTree = lastStmt->GetRootNode(); - if (tree->gtOper != GT_JTRUE) + if (lastTree->gtOper != GT_JTRUE) { return false; } // must be some kind of relational operator - GenTree* const cond = tree->AsOp()->gtOp1; + GenTree* const cond = lastTree->AsOp()->gtOp1; if (!cond->OperIsCompare()) { return false; @@ -3314,6 +3284,109 @@ bool Compiler::fgBlockIsGoodTailDuplicationCandidate(BasicBlock* target, unsigne return false; } + // If there's no second statement, we're good. + // + if (firstStmt == lastStmt) + { + return true; + } + + // Otherwise check the first stmt. + // Verify the branch is just a simple local compare. + // + GenTree* const firstTree = firstStmt->GetRootNode(); + + if (firstTree->gtOper != GT_ASG) + { + return false; + } + + GenTree* const lhs = firstTree->AsOp()->gtOp1; + if (!lhs->OperIs(GT_LCL_VAR)) + { + return false; + } + + const unsigned lhsLcl = lhs->AsLclVarCommon()->GetLclNum(); + if (lhsLcl != *lclNum) + { + return false; + } + + // Could allow unary here too... + // + GenTree* const rhs = firstTree->AsOp()->gtOp2; + if (!rhs->OperIsBinary()) + { + return false; + } + + // op1 must be some combinations of casts of local or constant + // (or unary) + op1 = rhs->AsOp()->gtOp1; + while (op1->gtOper == GT_CAST) + { + op1 = op1->AsOp()->gtOp1; + } + + if (!op1->IsLocal() && !op1->OperIsConst()) + { + return false; + } + + // op2 must be some combinations of casts of local or constant + // (or unary) + op2 = rhs->AsOp()->gtOp2; + + // A binop may not actually have an op2. + // + if (op2 == nullptr) + { + return false; + } + + while (op2->gtOper == GT_CAST) + { + op2 = op2->AsOp()->gtOp1; + } + + if (!op2->IsLocal() && !op2->OperIsConst()) + { + return false; + } + + // Tree must have one constant and one local, or be comparing + // the same local to itself. + lcl1 = BAD_VAR_NUM; + lcl2 = BAD_VAR_NUM; + + if (op1->IsLocal()) + { + lcl1 = op1->AsLclVarCommon()->GetLclNum(); + } + + if (op2->IsLocal()) + { + lcl2 = op2->AsLclVarCommon()->GetLclNum(); + } + + if ((lcl1 != BAD_VAR_NUM) && op2->OperIsConst()) + { + *lclNum = lcl1; + } + else if ((lcl2 != BAD_VAR_NUM) && op1->OperIsConst()) + { + *lclNum = lcl2; + } + else if ((lcl1 != BAD_VAR_NUM) && (lcl1 == lcl2)) + { + *lclNum = lcl1; + } + else + { + return false; + } + return true; } @@ -3333,6 +3406,8 @@ bool Compiler::fgBlockIsGoodTailDuplicationCandidate(BasicBlock* target, unsigne // bool Compiler::fgOptimizeUncondBranchToSimpleCond(BasicBlock* block, BasicBlock* target) { + JITDUMP("Considering uncond to cond " FMT_BB " -> " FMT_BB "\n", block->bbNum, target->bbNum); + if (!BasicBlock::sameEHRegion(block, target)) { return false; @@ -3360,23 +3435,35 @@ bool Compiler::fgOptimizeUncondBranchToSimpleCond(BasicBlock* block, BasicBlock* // backend always calls `fgUpdateFlowGraph` with `doTailDuplication` set to false. assert(!block->IsLIR()); - Statement* stmt = target->FirstNonPhiDef(); - assert(stmt == target->lastStmt()); - // Duplicate the target block at the end of this block - GenTree* cloned = gtCloneExpr(stmt->GetRootNode()); - noway_assert(cloned); - Statement* jmpStmt = gtNewStmt(cloned); + // + for (Statement* stmt : target->NonPhiStatements()) + { + GenTree* clone = gtCloneExpr(stmt->GetRootNode()); + noway_assert(clone); + Statement* cloneStmt = gtNewStmt(clone); + + if (fgStmtListThreaded) + { + gtSetStmtInfo(cloneStmt); + } + + fgInsertStmtAtEnd(block, cloneStmt); + } + // Fix up block's flow + // block->bbJumpKind = BBJ_COND; block->bbJumpDest = target->bbJumpDest; fgAddRefPred(block->bbJumpDest, block); fgRemoveRefPred(target, block); // add an unconditional block after this block to jump to the target block's fallthrough block + // BasicBlock* next = fgNewBBafter(BBJ_ALWAYS, block, true); // The new block 'next' will inherit its weight from 'block' + // next->inheritWeight(block); next->bbJumpDest = target->bbNext; fgAddRefPred(next, block); @@ -3384,15 +3471,7 @@ bool Compiler::fgOptimizeUncondBranchToSimpleCond(BasicBlock* block, BasicBlock* JITDUMP("fgOptimizeUncondBranchToSimpleCond(from " FMT_BB " to cond " FMT_BB "), created new uncond " FMT_BB "\n", block->bbNum, target->bbNum, next->bbNum); - JITDUMP(" expecting opts to key off V%02u, added cloned compare [%06u] to " FMT_BB "\n", lclNum, - dspTreeID(cloned), block->bbNum); - - if (fgStmtListThreaded) - { - gtSetStmtInfo(jmpStmt); - } - - fgInsertStmtAtEnd(block, jmpStmt); + JITDUMP(" expecting opts to key off V%02u in " FMT_BB "\n", lclNum, block->bbNum); return true; } @@ -3953,7 +4032,7 @@ bool Compiler::fgOptimizeSwitchJumps() // GenTree* const dominantCaseCompare = gtNewOperNode(GT_EQ, TYP_INT, switchValue, gtNewIconNode(dominantCase)); GenTree* const jmpTree = gtNewOperNode(GT_JTRUE, TYP_VOID, dominantCaseCompare); - Statement* const jmpStmt = fgNewStmtFromTree(jmpTree, switchStmt->GetILOffsetX()); + Statement* const jmpStmt = fgNewStmtFromTree(jmpTree, switchStmt->GetDebugInfo()); fgInsertStmtAtEnd(block, jmpStmt); // Reattach switch value to the switch. This may introduce a comma @@ -5855,6 +5934,9 @@ bool Compiler::fgUpdateFlowGraph(bool doTailDuplication) // Update the loop table if we removed the bottom of a loop, for example. fgUpdateLoopsAfterCompacting(block, bNext); + // If this block was aligned, unmark it + bNext->unmarkLoopAlign(this DEBUG_ARG("Optimized jump")); + // If this is the first Cold basic block update fgFirstColdBlock if (bNext == fgFirstColdBlock) { diff --git a/src/coreclr/jit/fgprofile.cpp b/src/coreclr/jit/fgprofile.cpp index d301166966fbfa..25ec5f0c877253 100644 --- a/src/coreclr/jit/fgprofile.cpp +++ b/src/coreclr/jit/fgprofile.cpp @@ -300,10 +300,10 @@ class Instrumentor virtual void BuildSchemaElements(BasicBlock* block, Schema& schema) { } - virtual void Instrument(BasicBlock* block, Schema& schema, BYTE* profileMemory) + virtual void Instrument(BasicBlock* block, Schema& schema, uint8_t* profileMemory) { } - virtual void InstrumentMethodEntry(Schema& schema, BYTE* profileMemory) + virtual void InstrumentMethodEntry(Schema& schema, uint8_t* profileMemory) { } virtual void SuppressProbes() @@ -349,8 +349,8 @@ class BlockCountInstrumentor : public Instrumentor } void Prepare(bool isPreImport) override; void BuildSchemaElements(BasicBlock* block, Schema& schema) override; - void Instrument(BasicBlock* block, Schema& schema, BYTE* profileMemory) override; - void InstrumentMethodEntry(Schema& schema, BYTE* profileMemory) override; + void Instrument(BasicBlock* block, Schema& schema, uint8_t* profileMemory) override; + void InstrumentMethodEntry(Schema& schema, uint8_t* profileMemory) override; }; //------------------------------------------------------------------------ @@ -428,7 +428,7 @@ void BlockCountInstrumentor::BuildSchemaElements(BasicBlock* block, Schema& sche // schema -- instrumentation schema // profileMemory -- profile data slab // -void BlockCountInstrumentor::Instrument(BasicBlock* block, Schema& schema, BYTE* profileMemory) +void BlockCountInstrumentor::Instrument(BasicBlock* block, Schema& schema, uint8_t* profileMemory) { const ICorJitInfo::PgoInstrumentationSchema& entry = schema[block->bbCountSchemaIndex]; @@ -464,7 +464,7 @@ void BlockCountInstrumentor::Instrument(BasicBlock* block, Schema& schema, BYTE* // Notes: // When prejitting, add the method entry callback node // -void BlockCountInstrumentor::InstrumentMethodEntry(Schema& schema, BYTE* profileMemory) +void BlockCountInstrumentor::InstrumentMethodEntry(Schema& schema, uint8_t* profileMemory) { Compiler::Options& opts = m_comp->opts; Compiler::Info& info = m_comp->info; @@ -902,6 +902,26 @@ void Compiler::WalkSpanningTree(SpanningTreeVisitor* visitor) } } +// Map a block into its schema key we will use for storing basic blocks. +// +static int32_t EfficientEdgeCountBlockToKey(BasicBlock* block) +{ + static const int IS_INTERNAL_BLOCK = (int32_t)0x80000000; + int32_t key = (int32_t)block->bbCodeOffs; + // We may see empty BBJ_NONE BBF_INTERNAL blocks that were added + // by fgNormalizeEH. + // + // We'll use their bbNum in place of IL offset, and set + // a high bit as a "flag" + // + if ((block->bbFlags & BBF_INTERNAL) == BBF_INTERNAL) + { + key = block->bbNum | IS_INTERNAL_BLOCK; + } + + return key; +} + //------------------------------------------------------------------------ // EfficientEdgeCountInstrumentor: instrumentor that adds a counter to // selective edges. @@ -982,7 +1002,7 @@ class EfficientEdgeCountInstrumentor : public Instrumentor, public SpanningTreeV return ((block->bbFlags & BBF_IMPORTED) == BBF_IMPORTED); } void BuildSchemaElements(BasicBlock* block, Schema& schema) override; - void Instrument(BasicBlock* block, Schema& schema, BYTE* profileMemory) override; + void Instrument(BasicBlock* block, Schema& schema, uint8_t* profileMemory) override; void Badcode() override { @@ -1086,35 +1106,19 @@ void EfficientEdgeCountInstrumentor::BuildSchemaElements(BasicBlock* block, Sche assert(probe->schemaIndex == -1); probe->schemaIndex = (int)schema.size(); - // Assign the current block's IL offset into the profile data. - // Use the "other" field to hold the target block IL offset. - // - int32_t sourceOffset = (int32_t)block->bbCodeOffs; - int32_t targetOffset = (int32_t)target->bbCodeOffs; - - // We may see empty BBJ_NONE BBF_INTERNAL blocks that were added - // by fgNormalizeEH. + // Normally we use the the offset of the block in the schema, but for certain + // blocks we do not have any information we can use and need to use internal BB numbers. // - // We'll use their bbNum in place of IL offset, and set - // a high bit as a "flag" - // - if ((block->bbFlags & BBF_INTERNAL) == BBF_INTERNAL) - { - sourceOffset = block->bbNum | IL_OFFSETX_CALLINSTRUCTIONBIT; - } - - if ((target->bbFlags & BBF_INTERNAL) == BBF_INTERNAL) - { - targetOffset = target->bbNum | IL_OFFSETX_CALLINSTRUCTIONBIT; - } + int32_t sourceKey = EfficientEdgeCountBlockToKey(block); + int32_t targetKey = EfficientEdgeCountBlockToKey(target); ICorJitInfo::PgoInstrumentationSchema schemaElem; schemaElem.Count = 1; - schemaElem.Other = targetOffset; + schemaElem.Other = targetKey; schemaElem.InstrumentationKind = JitConfig.JitCollect64BitCounts() ? ICorJitInfo::PgoInstrumentationKind::EdgeLongCount : ICorJitInfo::PgoInstrumentationKind::EdgeIntCount; - schemaElem.ILOffset = sourceOffset; + schemaElem.ILOffset = sourceKey; schemaElem.Offset = 0; schema.push_back(schemaElem); @@ -1132,7 +1136,7 @@ void EfficientEdgeCountInstrumentor::BuildSchemaElements(BasicBlock* block, Sche // schema -- instrumentation schema // profileMemory -- profile data slab // -void EfficientEdgeCountInstrumentor::Instrument(BasicBlock* block, Schema& schema, BYTE* profileMemory) +void EfficientEdgeCountInstrumentor::Instrument(BasicBlock* block, Schema& schema, uint8_t* profileMemory) { // Inlinee compilers build their blocks in the root compiler's // graph. So for NumSucc, we use the root compiler instance. @@ -1287,7 +1291,7 @@ class BuildClassProbeSchemaGen schemaElem.InstrumentationKind = JitConfig.JitCollect64BitCounts() ? ICorJitInfo::PgoInstrumentationKind::TypeHandleHistogramLongCount : ICorJitInfo::PgoInstrumentationKind::TypeHandleHistogramIntCount; - schemaElem.ILOffset = jitGetILoffs(call->gtClassProfileCandidateInfo->ilOffset); + schemaElem.ILOffset = (int32_t)call->gtClassProfileCandidateInfo->ilOffset; schemaElem.Offset = 0; m_schema.push_back(schemaElem); @@ -1307,12 +1311,12 @@ class BuildClassProbeSchemaGen class ClassProbeInserter { Schema& m_schema; - BYTE* m_profileMemory; + uint8_t* m_profileMemory; int* m_currentSchemaIndex; unsigned& m_instrCount; public: - ClassProbeInserter(Schema& schema, BYTE* profileMemory, int* pCurrentSchemaIndex, unsigned& instrCount) + ClassProbeInserter(Schema& schema, uint8_t* profileMemory, int* pCurrentSchemaIndex, unsigned& instrCount) : m_schema(schema) , m_profileMemory(profileMemory) , m_currentSchemaIndex(pCurrentSchemaIndex) @@ -1349,7 +1353,7 @@ class ClassProbeInserter // Figure out where the table is located. // - BYTE* classProfile = m_schema[*m_currentSchemaIndex].Offset + m_profileMemory; + uint8_t* classProfile = m_schema[*m_currentSchemaIndex].Offset + m_profileMemory; *m_currentSchemaIndex += 2; // There are 2 schema entries per class probe // Grab a temp to hold the 'this' object as it will be used three times @@ -1426,7 +1430,7 @@ class ClassProbeInstrumentor : public Instrumentor } void Prepare(bool isPreImport) override; void BuildSchemaElements(BasicBlock* block, Schema& schema) override; - void Instrument(BasicBlock* block, Schema& schema, BYTE* profileMemory) override; + void Instrument(BasicBlock* block, Schema& schema, uint8_t* profileMemory) override; void SuppressProbes() override; }; @@ -1490,7 +1494,7 @@ void ClassProbeInstrumentor::BuildSchemaElements(BasicBlock* block, Schema& sche // schema -- instrumentation schema // profileMemory -- profile data slab // -void ClassProbeInstrumentor::Instrument(BasicBlock* block, Schema& schema, BYTE* profileMemory) +void ClassProbeInstrumentor::Instrument(BasicBlock* block, Schema& schema, uint8_t* profileMemory) { if ((block->bbFlags & BBF_HAS_CLASS_PROFILE) == 0) { @@ -1563,21 +1567,43 @@ PhaseStatus Compiler::fgPrepareToInstrumentMethod() // Choose instrumentation technology. // // We enable edge profiling by default, except when: + // // * disabled by option // * we are prejitting - // * we are jitting osr methods + // * we are jitting tier0 methods with patchpoints + // * we are jitting an OSR method // - // Currently, OSR is incompatible with edge profiling. So if OSR is enabled, - // always do block profiling. + // OSR is incompatible with edge profiling. Only portions of the Tier0 + // method will be executed, and the bail-outs at patchpoints won't be obvious + // exit points from the method. So for OSR we always do block profiling. // // Note this incompatibility only exists for methods that actually have - // patchpoints, but we won't know that until we import. + // patchpoints. Currently we will only place patchponts in methods with + // backwards jumps. + // + // And because we want the Tier1 method to see the full set of profile data, + // when OSR is enabled, both Tier0 and any OSR methods need to contribute to + // the same profile data set. Since Tier0 has laid down a dense block-based + // schema, the OSR methods must use this schema as well. + // + // Note that OSR methods may also inline. We currently won't instrument + // any inlinee contributions (which would also need to carefully "share" + // the profile data segment with any Tier0 version and/or any other equivalent + // inlnee), so we'll lose a bit of their profile data. We can support this + // eventually if it turns out to matter. + // + // Similar issues arise with partially jitted methods. Because we currently + // only defer jitting for throw blocks, we currently ignore the impact of partial + // jitting on PGO. If we ever implement a broader pattern of deferral -- say deferring + // based on static PGO -- we will need to reconsider. // CLANG_FORMAT_COMMENT_ANCHOR; - const bool prejit = opts.jitFlags->IsSet(JitFlags::JIT_FLAG_PREJIT); - const bool osr = (opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER0) && (JitConfig.TC_OnStackReplacement() > 0)); - const bool useEdgeProfiles = (JitConfig.JitEdgeProfiling() > 0) && !prejit && !osr; + const bool prejit = opts.jitFlags->IsSet(JitFlags::JIT_FLAG_PREJIT); + const bool tier0WithPatchpoints = opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER0) && + (JitConfig.TC_OnStackReplacement() > 0) && compHasBackwardJump; + const bool osrMethod = opts.IsOSR(); + const bool useEdgeProfiles = (JitConfig.JitEdgeProfiling() > 0) && !prejit && !tier0WithPatchpoints && !osrMethod; if (useEdgeProfiles) { @@ -1586,7 +1612,9 @@ PhaseStatus Compiler::fgPrepareToInstrumentMethod() else { JITDUMP("Using block profiling, because %s\n", - (JitConfig.JitEdgeProfiling() > 0) ? "edge profiles disabled" : prejit ? "prejitting" : "OSR"); + (JitConfig.JitEdgeProfiling() > 0) + ? "edge profiles disabled" + : prejit ? "prejitting" : osrMethod ? "OSR" : "tier0 with patchpoints"); fgCountInstrumentor = new (this, CMK_Pgo) BlockCountInstrumentor(this); } @@ -1636,7 +1664,7 @@ PhaseStatus Compiler::fgInstrumentMethod() { noway_assert(!compIsForInlining()); - // Make post-importpreparations. + // Make post-import preparations. // const bool isPreImport = false; fgCountInstrumentor->Prepare(isPreImport); @@ -1661,7 +1689,17 @@ PhaseStatus Compiler::fgInstrumentMethod() // Verify we created schema for the calls needing class probes. // (we counted those when importing) // - assert(fgClassInstrumentor->SchemaCount() == info.compClassProbeCount); + // This is not true when we do partial compilation; it can/will erase class probes, + // and there's no easy way to figure out how many should be left. + // + if (doesMethodHavePartialCompilationPatchpoints()) + { + assert(fgClassInstrumentor->SchemaCount() <= info.compClassProbeCount); + } + else + { + assert(fgClassInstrumentor->SchemaCount() == info.compClassProbeCount); + } // Optionally, when jitting, if there were no class probes and only one count probe, // suppress instrumentation. @@ -1694,11 +1732,16 @@ PhaseStatus Compiler::fgInstrumentMethod() assert(schema.size() > 0); - // Allocate the profile buffer + // Allocate/retrieve the profile buffer. // - BYTE* profileMemory; - - HRESULT res = info.compCompHnd->allocPgoInstrumentationBySchema(info.compMethodHnd, schema.data(), + // If this is an OSR method, we should use the same buffer that the Tier0 method used. + // + // This is supported by allocPgoInsrumentationDataBySchema, which will verify the schema + // we provide here matches the one from Tier0, and will fill in the data offsets in + // our schema properly. + // + uint8_t* profileMemory; + HRESULT res = info.compCompHnd->allocPgoInstrumentationBySchema(info.compMethodHnd, schema.data(), (UINT32)schema.size(), &profileMemory); // Deal with allocation failures. @@ -1920,6 +1963,14 @@ void Compiler::fgIncorporateBlockCounts() fgSetProfileWeight(block, profileWeight); } } + + // For OSR, give the method entry (which will be a scratch BB) + // the same weight as the OSR Entry. + // + if (opts.IsOSR()) + { + fgFirstBB->inheritWeight(fgOSREntryBB); + } } //------------------------------------------------------------------------ @@ -1988,19 +2039,6 @@ class EfficientEdgeCountReconstructor : public SpanningTreeVisitor unsigned m_unknownEdges; unsigned m_zeroEdges; - // Map a block into its schema key. - // - static int32_t BlockToKey(BasicBlock* block) - { - int32_t key = (int32_t)block->bbCodeOffs; - if ((block->bbFlags & BBF_INTERNAL) == BBF_INTERNAL) - { - key = block->bbNum | IL_OFFSETX_CALLINSTRUCTIONBIT; - } - - return key; - } - // Map correlating block keys to blocks. // typedef JitHashTable, BasicBlock*> KeyToBlockMap; @@ -2018,7 +2056,8 @@ class EfficientEdgeCountReconstructor : public SpanningTreeVisitor } EdgeKey(BasicBlock* sourceBlock, BasicBlock* targetBlock) - : m_sourceKey(BlockToKey(sourceBlock)), m_targetKey(BlockToKey(targetBlock)) + : m_sourceKey(EfficientEdgeCountBlockToKey(sourceBlock)) + , m_targetKey(EfficientEdgeCountBlockToKey(targetBlock)) { } @@ -2241,7 +2280,7 @@ void EfficientEdgeCountReconstructor::Prepare() // for (BasicBlock* const block : m_comp->Blocks()) { - m_keyToBlockMap.Set(BlockToKey(block), block); + m_keyToBlockMap.Set(EfficientEdgeCountBlockToKey(block), block); BlockInfo* const info = new (m_allocator) BlockInfo(); SetBlockInfo(block, info); @@ -3285,11 +3324,17 @@ void Compiler::fgComputeCalledCount(weight_t returnWeight) BasicBlock* firstILBlock = fgFirstBB; // The first block for IL code (i.e. for the IL code at offset 0) - // Skip past any/all BBF_INTERNAL blocks that may have been added before the first real IL block. + // OSR methods can have complex entry flow, and so + // for OSR we ensure fgFirstBB has plausible profile data. // - while (firstILBlock->bbFlags & BBF_INTERNAL) + if (!opts.IsOSR()) { - firstILBlock = firstILBlock->bbNext; + // Skip past any/all BBF_INTERNAL blocks that may have been added before the first real IL block. + // + while (firstILBlock->bbFlags & BBF_INTERNAL) + { + firstILBlock = firstILBlock->bbNext; + } } // The 'firstILBlock' is now expected to have a profile-derived weight @@ -3725,7 +3770,7 @@ bool Compiler::fgProfileWeightsEqual(weight_t weight1, weight_t weight2) } //------------------------------------------------------------------------ -// fgProfileWeightsConsistentEqual: check if two profile weights are within +// fgProfileWeightsConsistent: check if two profile weights are within // some small percentage of one another. // // Arguments: diff --git a/src/coreclr/jit/fgstmt.cpp b/src/coreclr/jit/fgstmt.cpp index 256e8ede73420a..24140b3fc52b98 100644 --- a/src/coreclr/jit/fgstmt.cpp +++ b/src/coreclr/jit/fgstmt.cpp @@ -101,13 +101,14 @@ void Compiler::fgInsertStmtAtBeg(BasicBlock* block, Statement* stmt) // Arguments: // block - the block into which 'tree' will be inserted; // tree - the tree to be inserted. +// di - the debug info to use for the new statement. // // Return Value: // The new created statement with `tree` inserted into `block`. // -Statement* Compiler::fgNewStmtAtBeg(BasicBlock* block, GenTree* tree) +Statement* Compiler::fgNewStmtAtBeg(BasicBlock* block, GenTree* tree, const DebugInfo& di) { - Statement* stmt = gtNewStmt(tree); + Statement* stmt = gtNewStmt(tree, di); fgInsertStmtAtBeg(block, stmt); return stmt; } @@ -153,6 +154,7 @@ void Compiler::fgInsertStmtAtEnd(BasicBlock* block, Statement* stmt) // Arguments: // block - the block into which 'stmt' will be inserted; // tree - the tree to be inserted. +// di - the debug info to use for the new statement. // // Return Value: // The new created statement with `tree` inserted into `block`. @@ -160,9 +162,9 @@ void Compiler::fgInsertStmtAtEnd(BasicBlock* block, Statement* stmt) // Note: // If the block can be a conditional block, use fgNewStmtNearEnd. // -Statement* Compiler::fgNewStmtAtEnd(BasicBlock* block, GenTree* tree) +Statement* Compiler::fgNewStmtAtEnd(BasicBlock* block, GenTree* tree, const DebugInfo& di) { - Statement* stmt = gtNewStmt(tree); + Statement* stmt = gtNewStmt(tree, di); fgInsertStmtAtEnd(block, stmt); return stmt; } @@ -241,13 +243,14 @@ void Compiler::fgInsertStmtNearEnd(BasicBlock* block, Statement* stmt) // Arguments: // block - the block into which 'stmt' will be inserted; // tree - the tree to be inserted. +// di - the debug info to use for the new statement. // // Return Value: // The new created statement with `tree` inserted into `block`. // -Statement* Compiler::fgNewStmtNearEnd(BasicBlock* block, GenTree* tree) +Statement* Compiler::fgNewStmtNearEnd(BasicBlock* block, GenTree* tree, const DebugInfo& di) { - Statement* stmt = gtNewStmt(tree); + Statement* stmt = gtNewStmt(tree, di); fgInsertStmtNearEnd(block, stmt); return stmt; } @@ -379,9 +382,9 @@ Statement* Compiler::fgInsertStmtListAfter(BasicBlock* block, Statement* stmtAft * * Create a new statement from tree and wire the links up. */ -Statement* Compiler::fgNewStmtFromTree(GenTree* tree, BasicBlock* block, IL_OFFSETX offs) +Statement* Compiler::fgNewStmtFromTree(GenTree* tree, BasicBlock* block, const DebugInfo& di) { - Statement* stmt = gtNewStmt(tree, offs); + Statement* stmt = gtNewStmt(tree, di); if (fgStmtListThreaded) { @@ -401,17 +404,17 @@ Statement* Compiler::fgNewStmtFromTree(GenTree* tree, BasicBlock* block, IL_OFFS Statement* Compiler::fgNewStmtFromTree(GenTree* tree) { - return fgNewStmtFromTree(tree, nullptr, BAD_IL_OFFSET); + return fgNewStmtFromTree(tree, nullptr, DebugInfo()); } Statement* Compiler::fgNewStmtFromTree(GenTree* tree, BasicBlock* block) { - return fgNewStmtFromTree(tree, block, BAD_IL_OFFSET); + return fgNewStmtFromTree(tree, block, DebugInfo()); } -Statement* Compiler::fgNewStmtFromTree(GenTree* tree, IL_OFFSETX offs) +Statement* Compiler::fgNewStmtFromTree(GenTree* tree, const DebugInfo& di) { - return fgNewStmtFromTree(tree, nullptr, offs); + return fgNewStmtFromTree(tree, nullptr, di); } //------------------------------------------------------------------------ @@ -455,7 +458,7 @@ void Compiler::fgRemoveStmt(BasicBlock* block, Statement* stmt DEBUGARG(bool isU } #endif // DEBUG - if (opts.compDbgCode && stmt->GetPrevStmt() != stmt && stmt->GetILOffsetX() != BAD_IL_OFFSET) + if (opts.compDbgCode && stmt->GetPrevStmt() != stmt && stmt->GetDebugInfo().IsValid()) { /* TODO: For debuggable code, should we remove significant statement boundaries. Or should we leave a GT_NO_OP in its place? */ diff --git a/src/coreclr/jit/flowgraph.cpp b/src/coreclr/jit/flowgraph.cpp index 5742d8659ac123..e0fdac1da935ca 100644 --- a/src/coreclr/jit/flowgraph.cpp +++ b/src/coreclr/jit/flowgraph.cpp @@ -278,7 +278,7 @@ BasicBlock* Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block) if (nextStmt != nullptr) { // Is it possible for gtNextStmt to be NULL? - newStmt->SetILOffsetX(nextStmt->GetILOffsetX()); + newStmt->SetDebugInfo(nextStmt->GetDebugInfo()); } } @@ -524,6 +524,9 @@ bool Compiler::fgCanSwitchToOptimized() //------------------------------------------------------------------------ // fgSwitchToOptimized: Switch the opt level from tier 0 to optimized // +// Arguments: +// reason - reason why opt level was switched +// // Assumptions: // - fgCanSwitchToOptimized() is true // - compSetOptimizationLevel() has not been called @@ -532,15 +535,16 @@ bool Compiler::fgCanSwitchToOptimized() // This method is to be called at some point before compSetOptimizationLevel() to switch the opt level to optimized // based on information gathered in early phases. -void Compiler::fgSwitchToOptimized() +void Compiler::fgSwitchToOptimized(const char* reason) { assert(fgCanSwitchToOptimized()); // Switch to optimized and re-init options - JITDUMP("****\n**** JIT Tier0 jit request switching to Tier1 because of loop\n****\n"); + JITDUMP("****\n**** JIT Tier0 jit request switching to Tier1 because: %s\n****\n", reason); assert(opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER0)); opts.jitFlags->Clear(JitFlags::JIT_FLAG_TIER0); opts.jitFlags->Clear(JitFlags::JIT_FLAG_BBINSTR); + opts.jitFlags->Clear(JitFlags::JIT_FLAG_OSR); // Leave a note for jit diagnostics compSwitchedToOptimized = true; @@ -976,7 +980,7 @@ bool Compiler::fgAddrCouldBeNull(GenTree* addr) return false; } - LclVarDsc* varDsc = &lvaTable[varNum]; + LclVarDsc* varDsc = lvaGetDesc(varNum); if (varDsc->lvStackByref) { @@ -1333,8 +1337,7 @@ GenTree* Compiler::fgDoNormalizeOnStore(GenTree* tree) // Small-typed arguments and aliased locals are normalized on load. // Other small-typed locals are normalized on store. // If it is an assignment to one of the latter, insert the cast on RHS - unsigned varNum = op1->AsLclVarCommon()->GetLclNum(); - LclVarDsc* varDsc = &lvaTable[varNum]; + LclVarDsc* varDsc = lvaGetDesc(op1->AsLclVarCommon()->GetLclNum()); if (varDsc->lvNormalizeOnStore()) { @@ -1362,7 +1365,7 @@ GenTree* Compiler::fgDoNormalizeOnStore(GenTree* tree) * execute a call or not. */ -inline void Compiler::fgLoopCallTest(BasicBlock* srcBB, BasicBlock* dstBB) +void Compiler::fgLoopCallTest(BasicBlock* srcBB, BasicBlock* dstBB) { /* Bail if this is not a backward edge */ @@ -1436,7 +1439,7 @@ void Compiler::fgLoopCallMark() * Note the fact that the given block is a loop header. */ -inline void Compiler::fgMarkLoopHead(BasicBlock* block) +void Compiler::fgMarkLoopHead(BasicBlock* block) { #ifdef DEBUG if (verbose) @@ -1683,12 +1686,9 @@ void Compiler::fgAddSyncMethodEnterExit() // Create a block for the start of the try region, where the monitor enter call // will go. - - assert(fgFirstBB->bbFallsThrough()); - - BasicBlock* tryBegBB = fgNewBBafter(BBJ_NONE, fgFirstBB, false); - BasicBlock* tryNextBB = tryBegBB->bbNext; - BasicBlock* tryLastBB = fgLastBB; + BasicBlock* const tryBegBB = fgSplitBlockAtEnd(fgFirstBB); + BasicBlock* const tryNextBB = tryBegBB->bbNext; + BasicBlock* const tryLastBB = fgLastBB; // If we have profile data the new block will inherit the next block's weight if (tryNextBB->hasProfileWeight()) @@ -1799,10 +1799,10 @@ void Compiler::fgAddSyncMethodEnterExit() lvaTable[lvaMonAcquired].lvType = typeMonAcquired; - { // Scope the variables of the variable initialization - - // Initialize the 'acquired' boolean. - + // Create IR to initialize the 'acquired' boolean. + // + if (!opts.IsOSR()) + { GenTree* zero = gtNewZeroConNode(genActualType(typeMonAcquired)); GenTree* varNode = gtNewLclvNode(lvaMonAcquired, typeMonAcquired); GenTree* initNode = gtNewAssignNode(varNode, zero); @@ -1825,7 +1825,7 @@ void Compiler::fgAddSyncMethodEnterExit() unsigned lvaCopyThis = 0; if (!info.compIsStatic) { - lvaCopyThis = lvaGrabTemp(true DEBUGARG("Synchronized method monitor acquired boolean")); + lvaCopyThis = lvaGrabTemp(true DEBUGARG("Synchronized method copy of this for handler")); lvaTable[lvaCopyThis].lvType = TYP_REF; GenTree* thisNode = gtNewLclvNode(info.compThisArg, TYP_REF); @@ -1835,7 +1835,12 @@ void Compiler::fgAddSyncMethodEnterExit() fgNewStmtAtEnd(tryBegBB, initNode); } - fgCreateMonitorTree(lvaMonAcquired, info.compThisArg, tryBegBB, true /*enter*/); + // For OSR, we do not need the enter tree as the monitor is acquired by the original method. + // + if (!opts.IsOSR()) + { + fgCreateMonitorTree(lvaMonAcquired, info.compThisArg, tryBegBB, true /*enter*/); + } // exceptional case fgCreateMonitorTree(lvaMonAcquired, lvaCopyThis, faultBB, false /*exit*/); @@ -1994,7 +1999,7 @@ void Compiler::fgAddReversePInvokeEnterExit() lvaReversePInvokeFrameVar = lvaGrabTempWithImplicitUse(false DEBUGARG("Reverse Pinvoke FrameVar")); - LclVarDsc* varDsc = &lvaTable[lvaReversePInvokeFrameVar]; + LclVarDsc* varDsc = lvaGetDesc(lvaReversePInvokeFrameVar); varDsc->lvType = TYP_BLK; varDsc->lvExactSize = eeGetEEInfo()->sizeOfReversePInvokeFrame; @@ -2750,7 +2755,7 @@ void Compiler::fgAddInternal() if (!opts.ShouldUsePInvokeHelpers()) { info.compLvFrameListRoot = lvaGrabTemp(false DEBUGARG("Pinvoke FrameListRoot")); - LclVarDsc* rootVarDsc = &lvaTable[info.compLvFrameListRoot]; + LclVarDsc* rootVarDsc = lvaGetDesc(info.compLvFrameListRoot); rootVarDsc->lvType = TYP_I_IMPL; rootVarDsc->lvImplicitlyReferenced = 1; } @@ -2760,7 +2765,7 @@ void Compiler::fgAddInternal() // Lowering::InsertPInvokeMethodProlog will create a call with this local addr as an argument. lvaSetVarAddrExposed(lvaInlinedPInvokeFrameVar DEBUGARG(AddressExposedReason::ESCAPE_ADDRESS)); - LclVarDsc* varDsc = &lvaTable[lvaInlinedPInvokeFrameVar]; + LclVarDsc* varDsc = lvaGetDesc(lvaInlinedPInvokeFrameVar); varDsc->lvType = TYP_BLK; // Make room for the inlined frame. varDsc->lvExactSize = eeGetEEInfo()->inlinedCallFrameInfo.size; @@ -2771,7 +2776,7 @@ void Compiler::fgAddInternal() if (!opts.ShouldUsePInvokeHelpers() && compJmpOpUsed) { lvaPInvokeFrameRegSaveVar = lvaGrabTempWithImplicitUse(false DEBUGARG("PInvokeFrameRegSave Var")); - varDsc = &lvaTable[lvaPInvokeFrameRegSaveVar]; + varDsc = lvaGetDesc(lvaPInvokeFrameRegSaveVar); varDsc->lvType = TYP_BLK; varDsc->lvExactSize = 2 * REGSIZE_BYTES; } @@ -3901,6 +3906,7 @@ GenTree* Compiler::fgSetTreeSeq(GenTree* tree, GenTree* prevTree, bool isLIR) void Compiler::fgSetTreeSeqHelper(GenTree* tree, bool isLIR) { + // TODO-List-Cleanup: measure what using GenTreeVisitor here brings. genTreeOps oper; unsigned kind; @@ -3960,40 +3966,6 @@ void Compiler::fgSetTreeSeqHelper(GenTree* tree, bool isLIR) GenTree* op1 = tree->AsOp()->gtOp1; GenTree* op2 = tree->gtGetOp2IfPresent(); - // Special handling for GT_LIST - if (tree->OperGet() == GT_LIST) - { - // First, handle the list items, which will be linked in forward order. - // As we go, we will link the GT_LIST nodes in reverse order - we will number - // them and update fgTreeSeqList in a subsequent traversal. - GenTree* nextList = tree; - GenTree* list = nullptr; - while (nextList != nullptr && nextList->OperGet() == GT_LIST) - { - list = nextList; - GenTree* listItem = list->AsOp()->gtOp1; - fgSetTreeSeqHelper(listItem, isLIR); - nextList = list->AsOp()->gtOp2; - if (nextList != nullptr) - { - nextList->gtNext = list; - } - list->gtPrev = nextList; - } - // Next, handle the GT_LIST nodes. - // Note that fgSetTreeSeqFinish() sets the gtNext to null, so we need to capture the nextList - // before we call that method. - nextList = list; - do - { - assert(list != nullptr); - list = nextList; - nextList = list->gtNext; - fgSetTreeSeqFinish(list, isLIR); - } while (list != tree); - return; - } - /* Special handling for AddrMode */ if (tree->OperIsAddrMode()) { @@ -4095,6 +4067,29 @@ void Compiler::fgSetTreeSeqHelper(GenTree* tree, bool isLIR) break; +#if defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) +#if defined(FEATURE_SIMD) + case GT_SIMD: +#endif +#if defined(FEATURE_HW_INTRINSICS) + case GT_HWINTRINSIC: +#endif + if (tree->IsReverseOp()) + { + assert(tree->AsMultiOp()->GetOperandCount() == 2); + fgSetTreeSeqHelper(tree->AsMultiOp()->Op(2), isLIR); + fgSetTreeSeqHelper(tree->AsMultiOp()->Op(1), isLIR); + } + else + { + for (GenTree* operand : tree->AsMultiOp()->Operands()) + { + fgSetTreeSeqHelper(operand, isLIR); + } + } + break; +#endif // defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) + case GT_ARR_ELEM: fgSetTreeSeqHelper(tree->AsArrElem()->gtArrObj, isLIR); @@ -4159,7 +4154,7 @@ void Compiler::fgSetTreeSeqFinish(GenTree* tree, bool isLIR) { tree->gtFlags &= ~GTF_REVERSE_OPS; - if (tree->OperIs(GT_LIST, GT_ARGPLACE)) + if (tree->OperIs(GT_ARGPLACE)) { return; } @@ -4434,32 +4429,29 @@ void Compiler::fgSetBlockOrder(BasicBlock* block) // Return Value: // The first node in execution order, that belongs to tree. // -// Assumptions: -// 'tree' must either be a leaf, or all of its constituent nodes must be contiguous -// in execution order. -// TODO-Cleanup: Add a debug-only method that verifies this. - -/* static */ -GenTree* Compiler::fgGetFirstNode(GenTree* tree) +// Notes: +// This function is only correct for HIR trees. +// +/* static */ GenTree* Compiler::fgGetFirstNode(GenTree* tree) { - GenTree* child = tree; - while (child->NumChildren() > 0) + GenTree* firstNode = tree; + while (true) { - if (child->OperIsBinary() && child->IsReverseOp()) - { - child = child->GetChild(1); - } - else + auto operandsBegin = firstNode->OperandsBegin(); + auto operandsEnd = firstNode->OperandsEnd(); + + if (operandsBegin == operandsEnd) { - child = child->GetChild(0); + break; } + + firstNode = *operandsBegin; } - return child; + + return firstNode; } -/*****************************************************************************/ -/*static*/ -Compiler::fgWalkResult Compiler::fgChkThrowCB(GenTree** pTree, fgWalkData* data) +/*static*/ Compiler::fgWalkResult Compiler::fgChkThrowCB(GenTree** pTree, fgWalkData* data) { GenTree* tree = *pTree; @@ -4501,9 +4493,7 @@ Compiler::fgWalkResult Compiler::fgChkThrowCB(GenTree** pTree, fgWalkData* data) return Compiler::WALK_CONTINUE; } -/*****************************************************************************/ -/*static*/ -Compiler::fgWalkResult Compiler::fgChkLocAllocCB(GenTree** pTree, fgWalkData* data) +/*static*/ Compiler::fgWalkResult Compiler::fgChkLocAllocCB(GenTree** pTree, fgWalkData* data) { GenTree* tree = *pTree; @@ -4515,9 +4505,7 @@ Compiler::fgWalkResult Compiler::fgChkLocAllocCB(GenTree** pTree, fgWalkData* da return Compiler::WALK_CONTINUE; } -/*****************************************************************************/ -/*static*/ -Compiler::fgWalkResult Compiler::fgChkQmarkCB(GenTree** pTree, fgWalkData* data) +/*static*/ Compiler::fgWalkResult Compiler::fgChkQmarkCB(GenTree** pTree, fgWalkData* data) { GenTree* tree = *pTree; diff --git a/src/coreclr/jit/gcinfo.cpp b/src/coreclr/jit/gcinfo.cpp index cc8e1cd585f849..85e7f688c2f2ef 100644 --- a/src/coreclr/jit/gcinfo.cpp +++ b/src/coreclr/jit/gcinfo.cpp @@ -714,7 +714,7 @@ GCInfo::WriteBarrierForm GCInfo::gcWriteBarrierFormFromTargetAddress(GenTree* tg { unsigned lclNum = tgtAddr->AsLclVar()->GetLclNum(); - LclVarDsc* varDsc = &compiler->lvaTable[lclNum]; + LclVarDsc* varDsc = compiler->lvaGetDesc(lclNum); // Instead of marking LclVar with 'lvStackByref', // Consider decomposing the Value Number given to this LclVar to see if it was @@ -728,29 +728,6 @@ GCInfo::WriteBarrierForm GCInfo::gcWriteBarrierFormFromTargetAddress(GenTree* tg assert(varDsc->TypeGet() == TYP_BYREF); return GCInfo::WBF_NoBarrier; } - - // We don't eliminate for inlined methods, where we (can) know where the "retBuff" points. - if (!compiler->compIsForInlining() && lclNum == compiler->info.compRetBuffArg) - { - assert(compiler->info.compRetType == TYP_STRUCT); // Else shouldn't have a ret buff. - - // Are we assured that the ret buff pointer points into the stack of a caller? - if (compiler->info.compRetBuffDefStack) - { -#if 0 - // This is an optional debugging mode. If the #if 0 above is changed to #if 1, - // every barrier we remove for stores to GC ref fields of a retbuff use a special - // helper that asserts that the target is not in the heap. -#ifdef DEBUG - return WBF_NoBarrier_CheckNotHeapInDebug; -#else - return WBF_NoBarrier; -#endif -#else // 0 - return GCInfo::WBF_NoBarrier; -#endif // 0 - } - } } if (tgtAddr->TypeGet() == TYP_REF) { diff --git a/src/coreclr/jit/gentree.cpp b/src/coreclr/jit/gentree.cpp index 90093f9e7bba6c..00c58d70bae1d2 100644 --- a/src/coreclr/jit/gentree.cpp +++ b/src/coreclr/jit/gentree.cpp @@ -170,7 +170,7 @@ static const char* opNames[] = { const char* GenTree::OpName(genTreeOps op) { - assert((unsigned)op < _countof(opNames)); + assert((unsigned)op < ArrLen(opNames)); return opNames[op]; } @@ -186,7 +186,7 @@ static const char* opStructNames[] = { const char* GenTree::OpStructName(genTreeOps op) { - assert((unsigned)op < _countof(opStructNames)); + assert((unsigned)op < ArrLen(opStructNames)); return opStructNames[op]; } @@ -308,7 +308,6 @@ void GenTree::InitNodeSize() static_assert_no_msg(sizeof(GenTreeCast) <= TREE_NODE_SZ_LARGE); // *** large node static_assert_no_msg(sizeof(GenTreeBox) <= TREE_NODE_SZ_LARGE); // *** large node static_assert_no_msg(sizeof(GenTreeField) <= TREE_NODE_SZ_LARGE); // *** large node - static_assert_no_msg(sizeof(GenTreeArgList) <= TREE_NODE_SZ_SMALL); static_assert_no_msg(sizeof(GenTreeFieldList) <= TREE_NODE_SZ_SMALL); static_assert_no_msg(sizeof(GenTreeColon) <= TREE_NODE_SZ_SMALL); static_assert_no_msg(sizeof(GenTreeCall) <= TREE_NODE_SZ_LARGE); // *** large node @@ -1508,29 +1507,6 @@ bool GenTree::Compare(GenTree* op1, GenTree* op2, bool swapOK) return false; } break; -#ifdef FEATURE_SIMD - case GT_SIMD: - if ((op1->AsSIMD()->gtSIMDIntrinsicID != op2->AsSIMD()->gtSIMDIntrinsicID) || - (op1->AsSIMD()->GetSimdBaseType() != op2->AsSIMD()->GetSimdBaseType()) || - (op1->AsSIMD()->GetSimdSize() != op2->AsSIMD()->GetSimdSize())) - { - return false; - } - break; -#endif // FEATURE_SIMD - -#ifdef FEATURE_HW_INTRINSICS - case GT_HWINTRINSIC: - if ((op1->AsHWIntrinsic()->gtHWIntrinsicId != op2->AsHWIntrinsic()->gtHWIntrinsicId) || - (op1->AsHWIntrinsic()->GetSimdBaseType() != op2->AsHWIntrinsic()->GetSimdBaseType()) || - (op1->AsHWIntrinsic()->GetSimdSize() != op2->AsHWIntrinsic()->GetSimdSize()) || - (op1->AsHWIntrinsic()->GetAuxiliaryType() != op2->AsHWIntrinsic()->GetAuxiliaryType()) || - (op1->AsHWIntrinsic()->GetOtherReg() != op2->AsHWIntrinsic()->GetOtherReg())) - { - return false; - } - break; -#endif // For the ones below no extra argument matters for comparison. case GT_QMARK: @@ -1592,6 +1568,16 @@ bool GenTree::Compare(GenTree* op1, GenTree* op2, bool swapOK) case GT_CALL: return GenTreeCall::Equals(op1->AsCall(), op2->AsCall()); +#ifdef FEATURE_SIMD + case GT_SIMD: + return GenTreeSIMD::Equals(op1->AsSIMD(), op2->AsSIMD()); +#endif // FEATURE_SIMD + +#ifdef FEATURE_HW_INTRINSICS + case GT_HWINTRINSIC: + return GenTreeHWIntrinsic::Equals(op1->AsHWIntrinsic(), op2->AsHWIntrinsic()); +#endif + case GT_ARR_ELEM: if (op1->AsArrElem()->gtArrRank != op2->AsArrElem()->gtArrRank) @@ -1653,6 +1639,7 @@ bool GenTree::Compare(GenTree* op1, GenTree* op2, bool swapOK) * Returns non-zero if the given tree contains a use of a local #lclNum. */ +// TODO-List-Cleanup: rewrite with a general visitor. bool Compiler::gtHasRef(GenTree* tree, ssize_t lclNum, bool defOnly) { genTreeOps oper; @@ -1800,6 +1787,23 @@ bool Compiler::gtHasRef(GenTree* tree, ssize_t lclNum, bool defOnly) break; +#if defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) +#if defined(FEATURE_SIMD) + case GT_SIMD: +#endif +#if defined(FEATURE_HW_INTRINSICS) + case GT_HWINTRINSIC: +#endif + for (GenTree* operand : tree->AsMultiOp()->Operands()) + { + if (gtHasRef(operand, lclNum, defOnly)) + { + return true; + } + } + break; +#endif // defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) + case GT_ARR_ELEM: if (gtHasRef(tree->AsArrElem()->gtArrObj, lclNum, defOnly)) { @@ -1902,8 +1906,7 @@ Compiler::fgWalkResult Compiler::gtHasLocalsWithAddrOpCB(GenTree** pTree, fgWalk if (tree->gtOper == GT_LCL_VAR) { - unsigned lclNum = tree->AsLclVarCommon()->GetLclNum(); - LclVarDsc* varDsc = &comp->lvaTable[lclNum]; + const LclVarDsc* varDsc = comp->lvaGetDesc(tree->AsLclVarCommon()); if (varDsc->lvHasLdAddrOp || varDsc->IsAddressExposed()) { @@ -2143,7 +2146,7 @@ unsigned Compiler::gtHashValue(GenTree* tree) #ifdef FEATURE_SIMD case GT_SIMD: - hash += tree->AsSIMD()->gtSIMDIntrinsicID; + hash += tree->AsSIMD()->GetSIMDIntrinsicId(); hash += tree->AsSIMD()->GetSimdBaseType(); hash += tree->AsSIMD()->GetSimdSize(); break; @@ -2151,7 +2154,7 @@ unsigned Compiler::gtHashValue(GenTree* tree) #ifdef FEATURE_HW_INTRINSICS case GT_HWINTRINSIC: - hash += tree->AsHWIntrinsic()->gtHWIntrinsicId; + hash += tree->AsHWIntrinsic()->GetHWIntrinsicId(); hash += tree->AsHWIntrinsic()->GetSimdBaseType(); hash += tree->AsHWIntrinsic()->GetSimdSize(); hash += tree->AsHWIntrinsic()->GetAuxiliaryType(); @@ -2245,6 +2248,21 @@ unsigned Compiler::gtHashValue(GenTree* tree) } break; +#if defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) +#if defined(FEATURE_SIMD) + case GT_SIMD: +#endif +#if defined(FEATURE_HW_INTRINSICS) + case GT_HWINTRINSIC: +#endif + // TODO-List: rewrite with a general visitor / iterator? + for (GenTree* operand : tree->AsMultiOp()->Operands()) + { + hash = genTreeHashAdd(hash, gtHashValue(operand)); + } + break; +#endif // defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) + case GT_PHI: for (GenTreePhi::Use& use : tree->AsPhi()->Uses()) { @@ -2539,123 +2557,6 @@ void GenTreeOp::DebugCheckLongMul() #endif // !defined(TARGET_64BIT) && defined(DEBUG) #endif // !defined(TARGET_64BIT) || defined(TARGET_ARM64) -//------------------------------------------------------------------------------ -// gtSetListOrder : Figure out the evaluation order for a list of values. -// -// -// Arguments: -// list - List to figure out the evaluation order for -// isListCallArgs - True iff the list is a list of call arguments -// callArgsInRegs - True iff the list is a list of call arguments and they are passed in registers -// -// Return Value: -// True if the operation can be a root of a bitwise rotation tree; false otherwise. - -unsigned Compiler::gtSetListOrder(GenTree* list, bool isListCallArgs, bool callArgsInRegs) -{ - assert((list != nullptr) && list->OperIsAnyList()); - assert(!callArgsInRegs || isListCallArgs); - - ArrayStack listNodes(getAllocator(CMK_ArrayStack)); - - do - { - listNodes.Push(list); - list = list->AsOp()->gtOp2; - } while ((list != nullptr) && (list->OperIsAnyList())); - - unsigned nxtlvl = (list == nullptr) ? 0 : gtSetEvalOrder(list); - while (!listNodes.Empty()) - { - list = listNodes.Pop(); - assert(list && list->OperIsAnyList()); - GenTree* next = list->AsOp()->gtOp2; - - unsigned level = 0; - - // TODO: Do we have to compute costs differently for argument lists and - // all other lists? - // https://github.com/dotnet/runtime/issues/6622 - unsigned costSz = (isListCallArgs || (next == nullptr)) ? 0 : 1; - unsigned costEx = (isListCallArgs || (next == nullptr)) ? 0 : 1; - - if (next != nullptr) - { - if (isListCallArgs) - { - if (level < nxtlvl) - { - level = nxtlvl; - } - } - costEx += next->GetCostEx(); - costSz += next->GetCostSz(); - } - - GenTree* op1 = list->AsOp()->gtOp1; - unsigned lvl = gtSetEvalOrder(op1); - - // Swap the level counts - if (list->gtFlags & GTF_REVERSE_OPS) - { - unsigned tmpl; - - tmpl = lvl; - lvl = nxtlvl; - nxtlvl = tmpl; - } - - // TODO: Do we have to compute levels differently for argument lists and - // all other lists? - // https://github.com/dotnet/runtime/issues/6622 - if (isListCallArgs) - { - if (level < lvl) - { - level = lvl; - } - } - else - { - if (lvl < 1) - { - level = nxtlvl; - } - else if (lvl == nxtlvl) - { - level = lvl + 1; - } - else - { - level = lvl; - } - } - - if (op1->GetCostEx() != 0) - { - costEx += op1->GetCostEx(); - costEx += (callArgsInRegs || !isListCallArgs) ? 0 : IND_COST_EX; - } - - if (op1->GetCostSz() != 0) - { - costSz += op1->GetCostSz(); -#ifdef TARGET_XARCH - if (callArgsInRegs) // push is smaller than mov to reg -#endif - { - costSz += 1; - } - } - - list->SetCosts(costEx, costSz); - - nxtlvl = level; - } - - return nxtlvl; -} - unsigned Compiler::gtSetCallArgsOrder(const GenTreeCall::UseList& args, bool lateArgs, int* callCostEx, int* callCostSz) { unsigned level = 0; @@ -2696,6 +2597,172 @@ unsigned Compiler::gtSetCallArgsOrder(const GenTreeCall::UseList& args, bool lat return level; } +#if defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) +//------------------------------------------------------------------------ +// gtSetMultiOpOrder: Calculate the costs for a MultiOp. +// +// Currently this function just preserves the previous behavior. +// TODO-List-Cleanup: implement proper costing for these trees. +// +// Arguments: +// multiOp - The MultiOp tree in question +// +// Return Value: +// The Sethi "complexity" for this tree (the idealized number of +// registers needed to evaluate it). +// +unsigned Compiler::gtSetMultiOpOrder(GenTreeMultiOp* multiOp) +{ + // These default costs preserve previous behavior. + // TODO-CQ: investigate opportunities for tuning them. + int costEx = 1; + int costSz = 1; + unsigned level = 0; + unsigned lvl2 = 0; + +#if defined(FEATURE_HW_INTRINSICS) && defined(TARGET_XARCH) + if (multiOp->OperIs(GT_HWINTRINSIC) && (multiOp->GetOperandCount() == 1) && + multiOp->AsHWIntrinsic()->OperIsMemoryLoadOrStore()) + { + costEx = IND_COST_EX; + costSz = 2; + + GenTree* addr = multiOp->Op(1)->gtEffectiveVal(); + level = gtSetEvalOrder(addr); + + // See if we can form a complex addressing mode. + if (addr->OperIs(GT_ADD) && gtMarkAddrMode(addr, &costEx, &costSz, multiOp->TypeGet())) + { + // Nothing to do, costs have been set. + } + else + { + costEx += addr->GetCostEx(); + costSz += addr->GetCostSz(); + } + + multiOp->SetCosts(costEx, costSz); + return level; + } +#endif // defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) + + // This code is here to preserve previous behavior. + switch (multiOp->GetOperandCount()) + { + case 0: + // This is a constant HWIntrinsic, we already have correct costs. + break; + + case 1: + // A "unary" case. + level = gtSetEvalOrder(multiOp->Op(1)); + costEx += multiOp->Op(1)->GetCostEx(); + costSz += multiOp->Op(1)->GetCostSz(); + break; + + case 2: + // A "binary" case. + + // This way we have "level" be the complexity of the + // first tree to be evaluated, and "lvl2" - the second. + if (multiOp->IsReverseOp()) + { + level = gtSetEvalOrder(multiOp->Op(2)); + lvl2 = gtSetEvalOrder(multiOp->Op(1)); + } + else + { + level = gtSetEvalOrder(multiOp->Op(1)); + lvl2 = gtSetEvalOrder(multiOp->Op(2)); + } + + // We want the more complex tree to be evaluated first. + if (level < lvl2) + { + bool canSwap = multiOp->IsReverseOp() ? gtCanSwapOrder(multiOp->Op(2), multiOp->Op(1)) + : gtCanSwapOrder(multiOp->Op(1), multiOp->Op(2)); + + // The InitN intrinsic for two operands used to be not reversible, so preserve this. + // TODO-List-Cleanup: delete this only-needed-for-zero-diffs quirk. + if (multiOp->OperIs(GT_SIMD) && (multiOp->AsSIMD()->GetSIMDIntrinsicId() == SIMDIntrinsicInitN)) + { + canSwap = false; + } + + if (canSwap) + { + if (multiOp->IsReverseOp()) + { + multiOp->ClearReverseOp(); + } + else + { + multiOp->SetReverseOp(); + } + + std::swap(level, lvl2); + } + } + + if (level < 1) + { + level = lvl2; + } + else if (level == lvl2) + { + level += 1; + } + + costEx += (multiOp->Op(1)->GetCostEx() + multiOp->Op(2)->GetCostEx()); + costSz += (multiOp->Op(1)->GetCostSz() + multiOp->Op(2)->GetCostSz()); + break; + + default: + // The former "ArgList" case... we'll be emulating it here. + // The old implementation pushed the nodes on the list, in pre-order. + // Then it popped and costed them in "reverse order", so that's what + // we'll be doing here as well. + + unsigned nxtlvl = 0; + for (size_t i = multiOp->GetOperandCount(); i >= 1; i--) + { + GenTree* op = multiOp->Op(i); + unsigned lvl = gtSetEvalOrder(op); + + if (lvl < 1) + { + level = nxtlvl; + } + else if (lvl == nxtlvl) + { + level = lvl + 1; + } + else + { + level = lvl; + } + + costEx += op->GetCostEx(); + costSz += op->GetCostSz(); + + // Preserving previous behavior... + CLANG_FORMAT_COMMENT_ANCHOR; +#ifndef TARGET_XARCH + if (op->GetCostSz() != 0) + { + costSz += 1; + } +#endif + nxtlvl = level; + } + break; + } + + multiOp->SetCosts(costEx, costSz); + return level; +} +#endif + //----------------------------------------------------------------------------- // gtWalkOp: Traverse and mark an address expression // @@ -2845,8 +2912,7 @@ bool Compiler::gtIsLikelyRegVar(GenTree* tree) return false; } - assert(tree->AsLclVar()->GetLclNum() < lvaTableCnt); - LclVarDsc* varDsc = lvaTable + tree->AsLclVar()->GetLclNum(); + const LclVarDsc* varDsc = lvaGetDesc(tree->AsLclVar()); if (varDsc->lvDoNotEnregister) { @@ -3809,7 +3875,6 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) break; - case GT_LIST: case GT_NOP: costEx = 0; costSz = 0; @@ -3948,26 +4013,6 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) costSz = 2 * 2; break; -#if defined(FEATURE_HW_INTRINSICS) && defined(TARGET_XARCH) - case GT_HWINTRINSIC: - { - if (tree->AsHWIntrinsic()->OperIsMemoryLoadOrStore()) - { - costEx = IND_COST_EX; - costSz = 2; - // See if we can form a complex addressing mode. - - GenTree* addr = op1->gtEffectiveVal(); - - if (addr->OperIs(GT_ADD) && gtMarkAddrMode(addr, &costEx, &costSz, tree->TypeGet())) - { - goto DONE; - } - } - } - break; -#endif // FEATURE_HW_INTRINSICS && TARGET_XARCH - case GT_BLK: case GT_IND: @@ -4225,13 +4270,6 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) goto DONE; - case GT_LIST: - { - const bool isListCallArgs = false; - const bool callArgsInRegs = false; - return gtSetListOrder(tree, isListCallArgs, callArgsInRegs); - } - case GT_INDEX_ADDR: costEx = 6; // cmp reg,reg; jae throw; mov reg, [addrmode] (not taken) costSz = 9; // jump to cold section @@ -4529,9 +4567,6 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) case GT_MKREFANY: break; - case GT_LIST: - break; - default: /* Mark the operand's evaluation order to be swapped */ @@ -4701,6 +4736,16 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) costEx += 3 * IND_COST_EX; break; +#if defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) +#if defined(FEATURE_SIMD) + case GT_SIMD: +#endif +#if defined(FEATURE_HW_INTRINSICS) + case GT_HWINTRINSIC: +#endif + return gtSetMultiOpOrder(tree->AsMultiOp()); +#endif // defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) + case GT_ARR_ELEM: { GenTreeArrElem* arrElem = tree->AsArrElem(); @@ -4857,16 +4902,6 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) } DONE: - -#ifdef FEATURE_HW_INTRINSICS - if ((oper == GT_HWINTRINSIC) && (tree->gtGetOp1() == nullptr)) - { - // We can have nullary HWIntrinsic nodes, and we must have non-zero cost. - costEx = 1; - costSz = 1; - } -#endif // FEATURE_HW_INTRINSICS - // Some path through this function must have set the costs. assert(costEx != -1); assert(costSz != -1); @@ -4949,183 +4984,20 @@ unsigned GenTree::GetScaledIndex() } //------------------------------------------------------------------------ -// gtGetChildPointer: If 'parent' is the parent of this node, return the pointer -// to the child node so that it can be modified; otherwise, return nullptr. +// TryGetUse: Get the use edge for an operand of this tree. // // Arguments: -// parent - The possible parent of this node +// operand - the node to find the use for +// pUse - [out] parameter for the use // // Return Value: -// If "child" is a child of "parent", returns a pointer to the child node in the parent -// (i.e. a pointer to a GenTree pointer). -// Otherwise, returns nullptr. -// -// Assumptions: -// 'parent' must be non-null -// -// Notes: -// When FEATURE_MULTIREG_ARGS is defined we can get here with GT_OBJ tree. -// This happens when we have a struct that is passed in multiple registers. +// Whether "operand" is a child of this node. If it is, "*pUse" is set, +// allowing for the replacement of "operand" with some other node. // -// Also note that when UNIX_AMD64_ABI is defined the GT_LDOBJ -// later gets converted to a GT_FIELD_LIST with two GT_LCL_FLDs in Lower/LowerXArch. -// - -GenTree** GenTree::gtGetChildPointer(GenTree* parent) const - +bool GenTree::TryGetUse(GenTree* operand, GenTree*** pUse) { - switch (parent->OperGet()) - { - default: - if (!parent->OperIsSimple()) - { - return nullptr; - } - if (this == parent->AsOp()->gtOp1) - { - return &(parent->AsOp()->gtOp1); - } - if (this == parent->AsOp()->gtOp2) - { - return &(parent->AsOp()->gtOp2); - } - break; - - case GT_PHI: - for (GenTreePhi::Use& use : parent->AsPhi()->Uses()) - { - if (use.GetNode() == this) - { - return &use.NodeRef(); - } - } - break; - - case GT_FIELD_LIST: - for (GenTreeFieldList::Use& use : parent->AsFieldList()->Uses()) - { - if (this == use.GetNode()) - { - return &use.NodeRef(); - } - } - break; - - case GT_CMPXCHG: - if (this == parent->AsCmpXchg()->gtOpLocation) - { - return &(parent->AsCmpXchg()->gtOpLocation); - } - if (this == parent->AsCmpXchg()->gtOpValue) - { - return &(parent->AsCmpXchg()->gtOpValue); - } - if (this == parent->AsCmpXchg()->gtOpComparand) - { - return &(parent->AsCmpXchg()->gtOpComparand); - } - break; - - case GT_ARR_ELEM: - if (this == parent->AsArrElem()->gtArrObj) - { - return &(parent->AsArrElem()->gtArrObj); - } - for (int i = 0; i < GT_ARR_MAX_RANK; i++) - { - if (this == parent->AsArrElem()->gtArrInds[i]) - { - return &(parent->AsArrElem()->gtArrInds[i]); - } - } - break; - - case GT_ARR_OFFSET: - if (this == parent->AsArrOffs()->gtOffset) - { - return &(parent->AsArrOffs()->gtOffset); - } - if (this == parent->AsArrOffs()->gtIndex) - { - return &(parent->AsArrOffs()->gtIndex); - } - if (this == parent->AsArrOffs()->gtArrObj) - { - return &(parent->AsArrOffs()->gtArrObj); - } - break; - - case GT_STORE_DYN_BLK: - case GT_DYN_BLK: - if (this == parent->AsDynBlk()->gtOp1) - { - return &(parent->AsDynBlk()->gtOp1); - } - if (this == parent->AsDynBlk()->gtOp2) - { - return &(parent->AsDynBlk()->gtOp2); - } - if (this == parent->AsDynBlk()->gtDynamicSize) - { - return &(parent->AsDynBlk()->gtDynamicSize); - } - break; - - case GT_RET_EXPR: - if (this == parent->AsRetExpr()->gtInlineCandidate) - { - return &(parent->AsRetExpr()->gtInlineCandidate); - } - break; - - case GT_CALL: - { - GenTreeCall* call = parent->AsCall(); - - if ((call->gtCallThisArg != nullptr) && (this == call->gtCallThisArg->GetNode())) - { - return &call->gtCallThisArg->NodeRef(); - } - for (GenTreeCall::Use& use : call->Args()) - { - if (this == use.GetNode()) - { - return &use.NodeRef(); - } - } - for (GenTreeCall::Use& use : call->LateArgs()) - { - if (this == use.GetNode()) - { - return &use.NodeRef(); - } - } - if (this == call->gtControlExpr) - { - return &(call->gtControlExpr); - } - if (call->gtCallType == CT_INDIRECT) - { - if (this == call->gtCallCookie) - { - return &(call->gtCallCookie); - } - if (this == call->gtCallAddr) - { - return &(call->gtCallAddr); - } - } - } - break; - } - - return nullptr; -} - -bool GenTree::TryGetUse(GenTree* def, GenTree*** use) -{ - assert(def != nullptr); - assert(use != nullptr); + assert(operand != nullptr); + assert(pUse != nullptr); switch (OperGet()) { @@ -5199,9 +5071,9 @@ bool GenTree::TryGetUse(GenTree* def, GenTree*** use) case GT_BSWAP16: case GT_KEEPALIVE: case GT_INC_SATURATE: - if (def == this->AsUnOp()->gtOp1) + if (operand == this->AsUnOp()->gtOp1) { - *use = &this->AsUnOp()->gtOp1; + *pUse = &this->AsUnOp()->gtOp1; return true; } return false; @@ -5211,44 +5083,41 @@ bool GenTree::TryGetUse(GenTree* def, GenTree*** use) case GT_PUTARG_SPLIT: if (this->AsUnOp()->gtOp1->gtOper == GT_FIELD_LIST) { - return this->AsUnOp()->gtOp1->TryGetUse(def, use); + return this->AsUnOp()->gtOp1->TryGetUse(operand, pUse); } - if (def == this->AsUnOp()->gtOp1) + if (operand == this->AsUnOp()->gtOp1) { - *use = &this->AsUnOp()->gtOp1; + *pUse = &this->AsUnOp()->gtOp1; return true; } return false; #endif // FEATURE_ARG_SPLIT -#ifdef FEATURE_SIMD +#if defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) +#if defined(FEATURE_SIMD) case GT_SIMD: - if (this->AsSIMD()->gtSIMDIntrinsicID == SIMDIntrinsicInitN) - { - assert(this->AsSIMD()->gtOp1 != nullptr); - return this->AsSIMD()->gtOp1->TryGetUseList(def, use); - } - - return TryGetUseBinOp(def, use); -#endif // FEATURE_SIMD - -#ifdef FEATURE_HW_INTRINSICS +#endif +#if defined(FEATURE_HW_INTRINSICS) case GT_HWINTRINSIC: - if ((this->AsHWIntrinsic()->gtOp1 != nullptr) && this->AsHWIntrinsic()->gtOp1->OperIsList()) +#endif + for (GenTree** opUse : this->AsMultiOp()->UseEdges()) { - return this->AsHWIntrinsic()->gtOp1->TryGetUseList(def, use); + if (*opUse == operand) + { + *pUse = opUse; + return true; + } } - - return TryGetUseBinOp(def, use); -#endif // FEATURE_HW_INTRINSICS + return false; +#endif // defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) // Special nodes case GT_PHI: for (GenTreePhi::Use& phiUse : AsPhi()->Uses()) { - if (phiUse.GetNode() == def) + if (phiUse.GetNode() == operand) { - *use = &phiUse.NodeRef(); + *pUse = &phiUse.NodeRef(); return true; } } @@ -5257,9 +5126,9 @@ bool GenTree::TryGetUse(GenTree* def, GenTree*** use) case GT_FIELD_LIST: for (GenTreeFieldList::Use& fieldUse : AsFieldList()->Uses()) { - if (fieldUse.GetNode() == def) + if (fieldUse.GetNode() == operand) { - *use = &fieldUse.NodeRef(); + *pUse = &fieldUse.NodeRef(); return true; } } @@ -5268,19 +5137,19 @@ bool GenTree::TryGetUse(GenTree* def, GenTree*** use) case GT_CMPXCHG: { GenTreeCmpXchg* const cmpXchg = this->AsCmpXchg(); - if (def == cmpXchg->gtOpLocation) + if (operand == cmpXchg->gtOpLocation) { - *use = &cmpXchg->gtOpLocation; + *pUse = &cmpXchg->gtOpLocation; return true; } - if (def == cmpXchg->gtOpValue) + if (operand == cmpXchg->gtOpValue) { - *use = &cmpXchg->gtOpValue; + *pUse = &cmpXchg->gtOpValue; return true; } - if (def == cmpXchg->gtOpComparand) + if (operand == cmpXchg->gtOpComparand) { - *use = &cmpXchg->gtOpComparand; + *pUse = &cmpXchg->gtOpComparand; return true; } return false; @@ -5289,16 +5158,16 @@ bool GenTree::TryGetUse(GenTree* def, GenTree*** use) case GT_ARR_ELEM: { GenTreeArrElem* const arrElem = this->AsArrElem(); - if (def == arrElem->gtArrObj) + if (operand == arrElem->gtArrObj) { - *use = &arrElem->gtArrObj; + *pUse = &arrElem->gtArrObj; return true; } for (unsigned i = 0; i < arrElem->gtArrRank; i++) { - if (def == arrElem->gtArrInds[i]) + if (operand == arrElem->gtArrInds[i]) { - *use = &arrElem->gtArrInds[i]; + *pUse = &arrElem->gtArrInds[i]; return true; } } @@ -5308,19 +5177,19 @@ bool GenTree::TryGetUse(GenTree* def, GenTree*** use) case GT_ARR_OFFSET: { GenTreeArrOffs* const arrOffs = this->AsArrOffs(); - if (def == arrOffs->gtOffset) + if (operand == arrOffs->gtOffset) { - *use = &arrOffs->gtOffset; + *pUse = &arrOffs->gtOffset; return true; } - if (def == arrOffs->gtIndex) + if (operand == arrOffs->gtIndex) { - *use = &arrOffs->gtIndex; + *pUse = &arrOffs->gtIndex; return true; } - if (def == arrOffs->gtArrObj) + if (operand == arrOffs->gtArrObj) { - *use = &arrOffs->gtArrObj; + *pUse = &arrOffs->gtArrObj; return true; } return false; @@ -5329,14 +5198,14 @@ bool GenTree::TryGetUse(GenTree* def, GenTree*** use) case GT_DYN_BLK: { GenTreeDynBlk* const dynBlock = this->AsDynBlk(); - if (def == dynBlock->gtOp1) + if (operand == dynBlock->gtOp1) { - *use = &dynBlock->gtOp1; + *pUse = &dynBlock->gtOp1; return true; } - if (def == dynBlock->gtDynamicSize) + if (operand == dynBlock->gtDynamicSize) { - *use = &dynBlock->gtDynamicSize; + *pUse = &dynBlock->gtDynamicSize; return true; } return false; @@ -5345,19 +5214,19 @@ bool GenTree::TryGetUse(GenTree* def, GenTree*** use) case GT_STORE_DYN_BLK: { GenTreeDynBlk* const dynBlock = this->AsDynBlk(); - if (def == dynBlock->gtOp1) + if (operand == dynBlock->gtOp1) { - *use = &dynBlock->gtOp1; + *pUse = &dynBlock->gtOp1; return true; } - if (def == dynBlock->gtOp2) + if (operand == dynBlock->gtOp2) { - *use = &dynBlock->gtOp2; + *pUse = &dynBlock->gtOp2; return true; } - if (def == dynBlock->gtDynamicSize) + if (operand == dynBlock->gtDynamicSize) { - *use = &dynBlock->gtDynamicSize; + *pUse = &dynBlock->gtDynamicSize; return true; } return false; @@ -5366,42 +5235,42 @@ bool GenTree::TryGetUse(GenTree* def, GenTree*** use) case GT_CALL: { GenTreeCall* const call = this->AsCall(); - if ((call->gtCallThisArg != nullptr) && (def == call->gtCallThisArg->GetNode())) + if ((call->gtCallThisArg != nullptr) && (operand == call->gtCallThisArg->GetNode())) { - *use = &call->gtCallThisArg->NodeRef(); + *pUse = &call->gtCallThisArg->NodeRef(); return true; } - if (def == call->gtControlExpr) + if (operand == call->gtControlExpr) { - *use = &call->gtControlExpr; + *pUse = &call->gtControlExpr; return true; } if (call->gtCallType == CT_INDIRECT) { - if (def == call->gtCallCookie) + if (operand == call->gtCallCookie) { - *use = &call->gtCallCookie; + *pUse = &call->gtCallCookie; return true; } - if (def == call->gtCallAddr) + if (operand == call->gtCallAddr) { - *use = &call->gtCallAddr; + *pUse = &call->gtCallAddr; return true; } } for (GenTreeCall::Use& argUse : call->Args()) { - if (argUse.GetNode() == def) + if (argUse.GetNode() == operand) { - *use = &argUse.NodeRef(); + *pUse = &argUse.NodeRef(); return true; } } for (GenTreeCall::Use& argUse : call->LateArgs()) { - if (argUse.GetNode() == def) + if (argUse.GetNode() == operand) { - *use = &argUse.NodeRef(); + *pUse = &argUse.NodeRef(); return true; } } @@ -5411,41 +5280,25 @@ bool GenTree::TryGetUse(GenTree* def, GenTree*** use) // Binary nodes default: assert(this->OperIsBinary()); - return TryGetUseBinOp(def, use); - } -} - -bool GenTree::TryGetUseList(GenTree* def, GenTree*** use) -{ - assert(def != nullptr); - assert(use != nullptr); - - for (GenTreeArgList* node = this->AsArgList(); node != nullptr; node = node->Rest()) - { - if (def == node->gtOp1) - { - *use = &node->gtOp1; - return true; - } + return TryGetUseBinOp(operand, pUse); } - return false; } -bool GenTree::TryGetUseBinOp(GenTree* def, GenTree*** use) +bool GenTree::TryGetUseBinOp(GenTree* operand, GenTree*** pUse) { - assert(def != nullptr); - assert(use != nullptr); + assert(operand != nullptr); + assert(pUse != nullptr); assert(this->OperIsBinary()); GenTreeOp* const binOp = this->AsOp(); - if (def == binOp->gtOp1) + if (operand == binOp->gtOp1) { - *use = &binOp->gtOp1; + *pUse = &binOp->gtOp1; return true; } - if (def == binOp->gtOp2) + if (operand == binOp->gtOp2) { - *use = &binOp->gtOp2; + *pUse = &binOp->gtOp2; return true; } return false; @@ -5482,37 +5335,38 @@ void GenTree::ReplaceOperand(GenTree** useEdge, GenTree* replacement) // pointer to the child so that it can be modified. // // Arguments: -// parentChildPointer - A pointer to a GenTree** (yes, that's three -// levels, i.e. GenTree ***), which if non-null, -// will be set to point to the field in the parent -// that points to this node. -// -// Return value - The parent of this node. +// pUse - A pointer to a GenTree** (yes, that's three +// levels, i.e. GenTree ***), which if non-null, +// will be set to point to the field in the parent +// that points to this node. // -// Notes: +// Return value +// The parent of this node. // +// Notes: // This requires that the execution order must be defined (i.e. gtSetEvalOrder() has been called). -// To enable the child to be replaced, it accepts an argument, parentChildPointer that, if non-null, +// To enable the child to be replaced, it accepts an argument, "pUse", that, if non-null, // will be set to point to the child pointer in the parent that points to this node. - -GenTree* GenTree::gtGetParent(GenTree*** parentChildPtrPtr) const +// +GenTree* GenTree::gtGetParent(GenTree*** pUse) { // Find the parent node; it must be after this node in the execution order. - GenTree** parentChildPtr = nullptr; - GenTree* parent; - for (parent = gtNext; parent != nullptr; parent = parent->gtNext) + GenTree* user; + GenTree** use = nullptr; + for (user = gtNext; user != nullptr; user = user->gtNext) { - parentChildPtr = gtGetChildPointer(parent); - if (parentChildPtr != nullptr) + if (user->TryGetUse(this, &use)) { break; } } - if (parentChildPtrPtr != nullptr) + + if (pUse != nullptr) { - *parentChildPtrPtr = parentChildPtr; + *pUse = use; } - return parent; + + return user; } //------------------------------------------------------------------------- @@ -5972,8 +5826,7 @@ GenTree* Compiler::gtNewOperNode(genTreeOps oper, var_types type, GenTree* op1, GenTreeQmark* Compiler::gtNewQmarkNode(var_types type, GenTree* cond, GenTreeColon* colon) { - compQmarkUsed = true; - cond->gtFlags |= GTF_RELOP_QMARK; + compQmarkUsed = true; GenTreeQmark* result = new (this, GT_QMARK) GenTreeQmark(type, cond, colon); #ifdef DEBUG if (compQmarkRationalized) @@ -6345,17 +6198,17 @@ GenTree* Compiler::gtNewSIMDVectorZero(var_types simdType, CorInfoType simdBaseJ var_types simdBaseType = genActualType(JitType2PreciseVarType(simdBaseJitType)); GenTree* initVal = gtNewZeroConNode(simdBaseType); initVal->gtType = simdBaseType; - return gtNewSIMDNode(simdType, initVal, nullptr, SIMDIntrinsicInit, simdBaseJitType, simdSize); + return gtNewSIMDNode(simdType, initVal, SIMDIntrinsicInit, simdBaseJitType, simdSize); } #endif // FEATURE_SIMD -GenTreeCall* Compiler::gtNewIndCallNode(GenTree* addr, var_types type, GenTreeCall::Use* args, IL_OFFSETX ilOffset) +GenTreeCall* Compiler::gtNewIndCallNode(GenTree* addr, var_types type, GenTreeCall::Use* args, const DebugInfo& di) { - return gtNewCallNode(CT_INDIRECT, (CORINFO_METHOD_HANDLE)addr, type, args, ilOffset); + return gtNewCallNode(CT_INDIRECT, (CORINFO_METHOD_HANDLE)addr, type, args, di); } GenTreeCall* Compiler::gtNewCallNode( - gtCallTypes callType, CORINFO_METHOD_HANDLE callHnd, var_types type, GenTreeCall::Use* args, IL_OFFSETX ilOffset) + gtCallTypes callType, CORINFO_METHOD_HANDLE callHnd, var_types type, GenTreeCall::Use* args, const DebugInfo& di) { GenTreeCall* node = new (this, GT_CALL) GenTreeCall(genActualType(type)); @@ -6399,14 +6252,15 @@ GenTreeCall* Compiler::gtNewCallNode( // These get updated after call node is built. node->gtInlineObservation = InlineObservation::CALLEE_UNUSED_INITIAL; node->gtRawILOffset = BAD_IL_OFFSET; + node->gtInlineContext = compInlineContext; #endif // Spec: Managed Retval sequence points needs to be generated while generating debug info for debuggable code. // // Implementation note: if not generating MRV info genCallSite2ILOffsetMap will be NULL and - // codegen will pass BAD_IL_OFFSET as IL offset of a call node to emitter, which will cause emitter + // codegen will pass DebugInfo() to emitter, which will cause emitter // not to emit IP mapping entry. - if (opts.compDbgCode && opts.compDbgInfo) + if (opts.compDbgCode && opts.compDbgInfo && di.IsValid()) { // Managed Retval - IL offset of the call. This offset is used to emit a // CALL_INSTRUCTION type sequence point while emitting corresponding native call. @@ -6418,14 +6272,14 @@ GenTreeCall* Compiler::gtNewCallNode( // // b) (Opt) Add new sequence points only if requested by debugger through // a new boundary type - ICorDebugInfo::BoundaryTypes - if (genCallSite2ILOffsetMap == nullptr) + if (genCallSite2DebugInfoMap == nullptr) { - genCallSite2ILOffsetMap = new (getAllocator()) CallSiteILOffsetTable(getAllocator()); + genCallSite2DebugInfoMap = new (getAllocator()) CallSiteDebugInfoTable(getAllocator()); } // Make sure that there are no duplicate entries for a given call node - assert(!genCallSite2ILOffsetMap->Lookup(node)); - genCallSite2ILOffsetMap->Set(node, ilOffset); + assert(!genCallSite2DebugInfoMap->Lookup(node)); + genCallSite2DebugInfoMap->Set(node, di); } // Initialize gtOtherRegs @@ -6446,7 +6300,7 @@ GenTreeCall* Compiler::gtNewCallNode( return node; } -GenTreeLclVar* Compiler::gtNewLclvNode(unsigned lnum, var_types type DEBUGARG(IL_OFFSETX ILoffs)) +GenTreeLclVar* Compiler::gtNewLclvNode(unsigned lnum, var_types type DEBUGARG(IL_OFFSET offs)) { assert(type != TYP_VOID); // We need to ensure that all struct values are normalized. @@ -6466,7 +6320,7 @@ GenTreeLclVar* Compiler::gtNewLclvNode(unsigned lnum, var_types type DEBUGARG(IL assert((type == varDsc->lvType) || simd12ToSimd16Widening || (lvaIsImplicitByRefLocal(lnum) && fgGlobalMorph && (varDsc->lvType == TYP_BYREF))); } - GenTreeLclVar* node = new (this, GT_LCL_VAR) GenTreeLclVar(GT_LCL_VAR, type, lnum DEBUGARG(ILoffs)); + GenTreeLclVar* node = new (this, GT_LCL_VAR) GenTreeLclVar(GT_LCL_VAR, type, lnum DEBUGARG(offs)); /* Cannot have this assert because the inliner uses this function * to add temporaries */ @@ -6476,7 +6330,7 @@ GenTreeLclVar* Compiler::gtNewLclvNode(unsigned lnum, var_types type DEBUGARG(IL return node; } -GenTreeLclVar* Compiler::gtNewLclLNode(unsigned lnum, var_types type DEBUGARG(IL_OFFSETX ILoffs)) +GenTreeLclVar* Compiler::gtNewLclLNode(unsigned lnum, var_types type DEBUGARG(IL_OFFSET offs)) { // We need to ensure that all struct values are normalized. // It might be nice to assert this in general, but we have assignments of int to long. @@ -6491,7 +6345,7 @@ GenTreeLclVar* Compiler::gtNewLclLNode(unsigned lnum, var_types type DEBUGARG(IL // This local variable node may later get transformed into a large node assert(GenTree::s_gtNodeSizes[LargeOpOpcode()] > GenTree::s_gtNodeSizes[GT_LCL_VAR]); GenTreeLclVar* node = - new (this, LargeOpOpcode()) GenTreeLclVar(GT_LCL_VAR, type, lnum DEBUGARG(ILoffs) DEBUGARG(/*largeNode*/ true)); + new (this, LargeOpOpcode()) GenTreeLclVar(GT_LCL_VAR, type, lnum DEBUGARG(offs) DEBUGARG(/*largeNode*/ true)); return node; } @@ -6575,53 +6429,6 @@ GenTreeCall::Use* Compiler::gtNewCallArgs(GenTree* node1, GenTree* node2, GenTre return new (this, CMK_ASTNode) GenTreeCall::Use(node1, gtNewCallArgs(node2, node3, node4)); } -GenTreeArgList* Compiler::gtNewListNode(GenTree* op1, GenTreeArgList* op2) -{ - assert((op1 != nullptr) && (op1->OperGet() != GT_LIST)); - - return new (this, GT_LIST) GenTreeArgList(op1, op2); -} - -/***************************************************************************** - * - * Create a list out of one value. - */ - -GenTreeArgList* Compiler::gtNewArgList(GenTree* arg) -{ - return new (this, GT_LIST) GenTreeArgList(arg); -} - -/***************************************************************************** - * - * Create a list out of the two values. - */ - -GenTreeArgList* Compiler::gtNewArgList(GenTree* arg1, GenTree* arg2) -{ - return new (this, GT_LIST) GenTreeArgList(arg1, gtNewArgList(arg2)); -} - -/***************************************************************************** - * - * Create a list out of the three values. - */ - -GenTreeArgList* Compiler::gtNewArgList(GenTree* arg1, GenTree* arg2, GenTree* arg3) -{ - return new (this, GT_LIST) GenTreeArgList(arg1, gtNewArgList(arg2, arg3)); -} - -/***************************************************************************** - * - * Create a list out of the three values. - */ - -GenTreeArgList* Compiler::gtNewArgList(GenTree* arg1, GenTree* arg2, GenTree* arg3, GenTree* arg4) -{ - return new (this, GT_LIST) GenTreeArgList(arg1, gtNewArgList(arg2, arg3, arg4)); -} - /***************************************************************************** * * Given a GT_CALL node, access the fgArgInfo and find the entry @@ -7798,14 +7605,6 @@ GenTree* Compiler::gtCloneExpr( tree->AsCast()->gtCastType DEBUGARG(/*largeNode*/ TRUE)); break; - // The nodes below this are not bashed, so they can be allocated at their individual sizes. - - case GT_LIST: - assert((tree->AsOp()->gtOp2 == nullptr) || tree->AsOp()->gtOp2->OperIsList()); - copy = new (this, GT_LIST) GenTreeArgList(tree->AsOp()->gtOp1); - copy->AsOp()->gtOp2 = tree->AsOp()->gtOp2; - break; - case GT_INDEX: { GenTreeIndex* asInd = tree->AsIndex(); @@ -7934,30 +7733,6 @@ GenTree* Compiler::gtCloneExpr( } break; -#ifdef FEATURE_SIMD - case GT_SIMD: - { - GenTreeSIMD* simdOp = tree->AsSIMD(); - copy = gtNewSIMDNode(simdOp->TypeGet(), simdOp->gtGetOp1(), simdOp->gtGetOp2IfPresent(), - simdOp->gtSIMDIntrinsicID, simdOp->GetSimdBaseJitType(), simdOp->GetSimdSize()); - } - break; -#endif - -#ifdef FEATURE_HW_INTRINSICS - case GT_HWINTRINSIC: - { - GenTreeHWIntrinsic* hwintrinsicOp = tree->AsHWIntrinsic(); - copy = new (this, GT_HWINTRINSIC) - GenTreeHWIntrinsic(hwintrinsicOp->TypeGet(), hwintrinsicOp->gtGetOp1(), - hwintrinsicOp->gtGetOp2IfPresent(), hwintrinsicOp->gtHWIntrinsicId, - hwintrinsicOp->GetSimdBaseJitType(), hwintrinsicOp->GetSimdSize(), - hwintrinsicOp->IsSimdAsHWIntrinsic()); - copy->AsHWIntrinsic()->SetAuxiliaryJitType(hwintrinsicOp->GetAuxiliaryJitType()); - } - break; -#endif - default: assert(!GenTree::IsExOp(tree->OperKind()) && tree->OperIsSimple()); // We're in the SimpleOp case, so it's always unary or binary. @@ -8054,6 +7829,33 @@ GenTree* Compiler::gtCloneExpr( copy = gtCloneExprCallHelper(tree->AsCall(), addFlags, deepVarNum, deepVarVal); break; +#ifdef FEATURE_SIMD + case GT_SIMD: + copy = new (this, GT_SIMD) + GenTreeSIMD(tree->TypeGet(), IntrinsicNodeBuilder(getAllocator(CMK_ASTNode), tree->AsSIMD()), + tree->AsSIMD()->GetSIMDIntrinsicId(), tree->AsSIMD()->GetSimdBaseJitType(), + tree->AsSIMD()->GetSimdSize()); + goto CLONE_MULTIOP_OPERANDS; +#endif +#ifdef FEATURE_HW_INTRINSICS + case GT_HWINTRINSIC: + copy = new (this, GT_HWINTRINSIC) + GenTreeHWIntrinsic(tree->TypeGet(), IntrinsicNodeBuilder(getAllocator(CMK_ASTNode), tree->AsMultiOp()), + tree->AsHWIntrinsic()->GetHWIntrinsicId(), + tree->AsHWIntrinsic()->GetSimdBaseJitType(), tree->AsHWIntrinsic()->GetSimdSize(), + tree->AsHWIntrinsic()->IsSimdAsHWIntrinsic()); + copy->AsHWIntrinsic()->SetAuxiliaryJitType(tree->AsHWIntrinsic()->GetAuxiliaryJitType()); + goto CLONE_MULTIOP_OPERANDS; +#endif +#if defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) + CLONE_MULTIOP_OPERANDS: + for (GenTree** use : copy->AsMultiOp()->UseEdges()) + { + *use = gtCloneExpr(*use, addFlags, deepVarNum, deepVarVal); + } + break; +#endif + case GT_ARR_ELEM: { GenTreeArrElem* arrElem = tree->AsArrElem(); @@ -8149,18 +7951,6 @@ GenTree* Compiler::gtCloneExpr( /* GTF_NODE_MASK should not be propagated from 'tree' to 'copy' */ addFlags &= ~GTF_NODE_MASK; #endif - // Some other flags depend on the context of the expression, and should not be preserved. - // For example, GTF_RELOP_QMARK: - if (copy->OperKind() & GTK_RELOP) - { - addFlags &= ~GTF_RELOP_QMARK; - } - // On the other hand, if we're creating such a context, restore this flag. - if (copy->OperGet() == GT_QMARK) - { - copy->AsOp()->gtOp1->gtFlags |= GTF_RELOP_QMARK; - } - copy->gtFlags |= addFlags; // Update side effect flags since they may be different from the source side effect flags. @@ -8235,11 +8025,6 @@ GenTreeCall* Compiler::gtCloneExprCallHelper(GenTreeCall* tree, argsTail = &((*argsTail)->NextRef()); } -#if !FEATURE_FIXED_OUT_ARGS - copy->regArgList = tree->regArgList; - copy->regArgListCount = tree->regArgListCount; -#endif - // The call sig comes from the EE and doesn't change throughout the compilation process, meaning // we only really need one physical copy of it. Therefore a shallow pointer copy will suffice. // (Note that this still holds even if the tree we are cloning was created by an inlinee compiler, @@ -8294,7 +8079,8 @@ GenTreeCall* Compiler::gtCloneExprCallHelper(GenTreeCall* tree, #if defined(DEBUG) || defined(INLINE_DATA) copy->gtInlineObservation = tree->gtInlineObservation; - copy->gtRawILOffset = tree->AsCall()->gtRawILOffset; + copy->gtRawILOffset = tree->gtRawILOffset; + copy->gtInlineContext = tree->gtInlineContext; #endif copy->CopyOtherRegFlags(tree); @@ -8345,106 +8131,6 @@ GenTreeCall* Compiler::gtCloneCandidateCall(GenTreeCall* call) return result; } -//------------------------------------------------------------------------ -// gtReplaceTree: Replace a tree with a new tree. -// -// Arguments: -// stmt - The top-level root stmt of the tree being replaced. -// Must not be null. -// tree - The tree being replaced. Must not be null. -// replacementTree - The replacement tree. Must not be null. -// -// Return Value: -// The tree node that replaces the old tree. -// -// Assumptions: -// The sequencing of the stmt has been done. -// -// Notes: -// The caller must ensure that the original statement has been sequenced, -// and the side effect flags are updated on the statement nodes, -// but this method will sequence 'replacementTree', and insert it into the -// proper place in the statement sequence. - -GenTree* Compiler::gtReplaceTree(Statement* stmt, GenTree* tree, GenTree* replacementTree) -{ - assert(fgStmtListThreaded); - assert(tree != nullptr); - assert(stmt != nullptr); - assert(replacementTree != nullptr); - - GenTree** treePtr = nullptr; - GenTree* treeParent = tree->gtGetParent(&treePtr); - - assert(treeParent != nullptr || tree == stmt->GetRootNode()); - - if (treePtr == nullptr) - { - // Replace the stmt expr and rebuild the linear order for "stmt". - assert(treeParent == nullptr); - assert(fgOrder != FGOrderLinear); - stmt->SetRootNode(tree); - fgSetStmtSeq(stmt); - } - else - { - assert(treeParent != nullptr); - - // Check to see if the node to be replaced is a call argument and if so, - // set `treeParent` to the call node. - GenTree* cursor = treeParent; - while ((cursor != nullptr) && (cursor->OperGet() == GT_LIST)) - { - cursor = cursor->gtNext; - } - - if ((cursor != nullptr) && (cursor->OperGet() == GT_CALL)) - { - treeParent = cursor; - } - -#ifdef DEBUG - GenTree** useEdge; - assert(treeParent->TryGetUse(tree, &useEdge)); - assert(useEdge == treePtr); -#endif // DEBUG - - GenTree* treeFirstNode = fgGetFirstNode(tree); - GenTree* treeLastNode = tree; - GenTree* treePrevNode = treeFirstNode->gtPrev; - GenTree* treeNextNode = treeLastNode->gtNext; - - treeParent->ReplaceOperand(treePtr, replacementTree); - - // Build the linear order for "replacementTree". - fgSetTreeSeq(replacementTree, treePrevNode); - - // Restore linear-order Prev and Next for "replacementTree". - if (treePrevNode != nullptr) - { - treeFirstNode = fgGetFirstNode(replacementTree); - treeFirstNode->gtPrev = treePrevNode; - treePrevNode->gtNext = treeFirstNode; - } - else - { - // Update the linear oder start of "stmt" if treeFirstNode - // appears to have replaced the original first node. - assert(treeFirstNode == stmt->GetTreeList()); - stmt->SetTreeList(fgGetFirstNode(replacementTree)); - } - - if (treeNextNode != nullptr) - { - treeLastNode = replacementTree; - treeLastNode->gtNext = treeNextNode; - treeNextNode->gtPrev = treeLastNode; - } - } - - return replacementTree; -} - //------------------------------------------------------------------------ // gtUpdateSideEffects: Update the side effects of a tree and its ancestors // @@ -8586,15 +8272,10 @@ void Compiler::gtUpdateNodeOperSideEffectsPost(GenTree* tree) void Compiler::gtUpdateNodeSideEffects(GenTree* tree) { gtUpdateNodeOperSideEffects(tree); - unsigned nChildren = tree->NumChildren(); - for (unsigned childNum = 0; childNum < nChildren; childNum++) - { - GenTree* child = tree->GetChild(childNum); - if (child != nullptr) - { - tree->gtFlags |= (child->gtFlags & GTF_ALL_EFFECT); - } - } + tree->VisitOperands([tree](GenTree* operand) -> GenTree::VisitResult { + tree->gtFlags |= (operand->gtFlags & GTF_ALL_EFFECT); + return GenTree::VisitResult::Continue; + }); } //------------------------------------------------------------------------ @@ -8649,135 +8330,36 @@ Compiler::fgWalkResult Compiler::fgUpdateSideEffectsPost(GenTree** pTree, fgWalk return WALK_CONTINUE; } -/***************************************************************************** - * - * Compares two trees and returns true when both trees are the same. - * Instead of fully comparing the two trees this method can just return false. - * Thus callers should not assume that the trees are different when false is returned. - * Only when true is returned can the caller perform code optimizations. - * The current implementation only compares a limited set of LEAF/CONST node - * and returns false for all othere trees. - */ -bool Compiler::gtCompareTree(GenTree* op1, GenTree* op2) +//------------------------------------------------------------------------ +// gtGetThisArg: Return this pointer node for the call. +// +// Arguments: +// call - the call node with a this argument. +// +// Return value: +// the this pointer node. +// +GenTree* Compiler::gtGetThisArg(GenTreeCall* call) { - /* Make sure that both trees are of the same GT node kind */ - if (op1->OperGet() != op2->OperGet()) - { - return false; - } + assert(call->gtCallThisArg != nullptr); - /* Make sure that both trees are returning the same type */ - if (op1->gtType != op2->gtType) + GenTree* thisArg = call->gtCallThisArg->GetNode(); + if (!thisArg->OperIs(GT_ASG)) { - return false; + if ((thisArg->gtFlags & GTF_LATE_ARG) == 0) + { + return thisArg; + } } - /* Figure out what kind of a node we have */ + assert(call->gtCallLateArgs != nullptr); - genTreeOps oper = op1->OperGet(); - unsigned kind = op1->OperKind(); + unsigned argNum = 0; + fgArgTabEntry* thisArgTabEntry = gtArgEntryByArgNum(call, argNum); + GenTree* result = thisArgTabEntry->GetNode(); - /* Is this a constant or leaf node? */ - - if (kind & (GTK_CONST | GTK_LEAF)) - { - switch (oper) - { - case GT_CNS_INT: - if ((op1->AsIntCon()->gtIconVal == op2->AsIntCon()->gtIconVal) && GenTree::SameIconHandleFlag(op1, op2)) - { - return true; - } - break; - - case GT_CNS_LNG: - if (op1->AsLngCon()->gtLconVal == op2->AsLngCon()->gtLconVal) - { - return true; - } - break; - - case GT_CNS_STR: - if (op1->AsStrCon()->gtSconCPX == op2->AsStrCon()->gtSconCPX) - { - return true; - } - break; - - case GT_LCL_VAR: - if (op1->AsLclVarCommon()->GetLclNum() == op2->AsLclVarCommon()->GetLclNum()) - { - return true; - } - break; - - case GT_CLS_VAR: - if (op1->AsClsVar()->gtClsVarHnd == op2->AsClsVar()->gtClsVarHnd) - { - return true; - } - break; - - default: - // we return false for these unhandled 'oper' kinds - break; - } - } - return false; -} - -//------------------------------------------------------------------------ -// gtGetThisArg: Return this pointer node for the call. -// -// Arguments: -// call - the call node with a this argument. -// -// Return value: -// the this pointer node. -// -GenTree* Compiler::gtGetThisArg(GenTreeCall* call) -{ - assert(call->gtCallThisArg != nullptr); - - GenTree* thisArg = call->gtCallThisArg->GetNode(); - if (!thisArg->OperIs(GT_ASG)) - { - if ((thisArg->gtFlags & GTF_LATE_ARG) == 0) - { - return thisArg; - } - } - - assert(call->gtCallLateArgs != nullptr); - - unsigned argNum = 0; - fgArgTabEntry* thisArgTabEntry = gtArgEntryByArgNum(call, argNum); - GenTree* result = thisArgTabEntry->GetNode(); - - // Assert if we used DEBUG_DESTROY_NODE. - assert(result->gtOper != GT_COUNT); - -#if !FEATURE_FIXED_OUT_ARGS && defined(DEBUG) - // Check that call->fgArgInfo used in gtArgEntryByArgNum was not - // left outdated by assertion propogation updates. - // There is no information about registers of late args for platforms - // with FEATURE_FIXED_OUT_ARGS that is why this debug check is under - // !FEATURE_FIXED_OUT_ARGS. - regNumber thisReg = REG_ARG_0; - regList list = call->regArgList; - int index = 0; - for (GenTreeCall::Use& use : call->LateArgs()) - { - assert(index < call->regArgListCount); - regNumber curArgReg = list[index]; - if (curArgReg == thisReg) - { - assert(result == use.GetNode()); - } - - index++; - } -#endif // !FEATURE_FIXED_OUT_ARGS && defined(DEBUG) + // Assert if we used DEBUG_DESTROY_NODE. + assert(result->gtOper != GT_COUNT); return result; } @@ -8859,514 +8441,162 @@ bool GenTree::gtRequestSetFlags() return result; } -unsigned GenTree::NumChildren() +GenTreeUseEdgeIterator::GenTreeUseEdgeIterator() + : m_advance(nullptr), m_node(nullptr), m_edge(nullptr), m_statePtr(nullptr), m_state(-1) { - if (OperIsConst() || OperIsLeaf()) - { - return 0; - } - else if (OperIsUnary()) - { - if (AsUnOp()->gtOp1 == nullptr) - { - return 0; - } - else - { - return 1; - } - } - else if (OperIsBinary()) +} + +GenTreeUseEdgeIterator::GenTreeUseEdgeIterator(GenTree* node) + : m_advance(nullptr), m_node(node), m_edge(nullptr), m_statePtr(nullptr), m_state(0) +{ + assert(m_node != nullptr); + + // NOTE: the switch statement below must be updated when introducing new nodes. + + switch (m_node->OperGet()) { - // All binary operators except LEA have at least one arg; the second arg may sometimes be null, however. - if (OperGet() == GT_LEA) - { - unsigned childCount = 0; - if (AsOp()->gtOp1 != nullptr) + // Leaf nodes + case GT_LCL_VAR: + case GT_LCL_FLD: + case GT_LCL_VAR_ADDR: + case GT_LCL_FLD_ADDR: + case GT_CATCH_ARG: + case GT_LABEL: + case GT_FTN_ADDR: + case GT_RET_EXPR: + case GT_CNS_INT: + case GT_CNS_LNG: + case GT_CNS_DBL: + case GT_CNS_STR: + case GT_MEMORYBARRIER: + case GT_JMP: + case GT_JCC: + case GT_SETCC: + case GT_NO_OP: + case GT_START_NONGC: + case GT_START_PREEMPTGC: + case GT_PROF_HOOK: +#if !defined(FEATURE_EH_FUNCLETS) + case GT_END_LFIN: +#endif // !FEATURE_EH_FUNCLETS + case GT_PHI_ARG: + case GT_JMPTABLE: + case GT_CLS_VAR: + case GT_CLS_VAR_ADDR: + case GT_ARGPLACE: + case GT_PHYSREG: + case GT_EMITNOP: + case GT_PINVOKE_PROLOG: + case GT_PINVOKE_EPILOG: + case GT_IL_OFFSET: + m_state = -1; + return; + + // Standard unary operators + case GT_STORE_LCL_VAR: + case GT_STORE_LCL_FLD: + case GT_NOT: + case GT_NEG: + case GT_COPY: + case GT_RELOAD: + case GT_ARR_LENGTH: + case GT_CAST: + case GT_BITCAST: + case GT_CKFINITE: + case GT_LCLHEAP: + case GT_ADDR: + case GT_IND: + case GT_OBJ: + case GT_BLK: + case GT_BOX: + case GT_ALLOCOBJ: + case GT_RUNTIMELOOKUP: + case GT_INIT_VAL: + case GT_JTRUE: + case GT_SWITCH: + case GT_NULLCHECK: + case GT_PUTARG_REG: + case GT_PUTARG_STK: + case GT_PUTARG_TYPE: + case GT_BSWAP: + case GT_BSWAP16: + case GT_KEEPALIVE: + case GT_INC_SATURATE: +#if FEATURE_ARG_SPLIT + case GT_PUTARG_SPLIT: +#endif // FEATURE_ARG_SPLIT + case GT_RETURNTRAP: + m_edge = &m_node->AsUnOp()->gtOp1; + assert(*m_edge != nullptr); + m_advance = &GenTreeUseEdgeIterator::Terminate; + return; + + // Unary operators with an optional operand + case GT_NOP: + case GT_FIELD: + case GT_RETURN: + case GT_RETFILT: + if (m_node->AsUnOp()->gtOp1 == nullptr) { - childCount++; + assert(m_node->NullOp1Legal()); + m_state = -1; } - if (AsOp()->gtOp2 != nullptr) + else { - childCount++; + m_edge = &m_node->AsUnOp()->gtOp1; + m_advance = &GenTreeUseEdgeIterator::Terminate; } - return childCount; - } + return; + +// Variadic nodes +#ifdef FEATURE_SIMD + case GT_SIMD: +#endif #ifdef FEATURE_HW_INTRINSICS - // GT_HWINTRINSIC require special handling - if (OperGet() == GT_HWINTRINSIC) - { - if (AsOp()->gtOp1 == nullptr) - { - return 0; - } - } + case GT_HWINTRINSIC: #endif - assert(AsOp()->gtOp1 != nullptr); - if (AsOp()->gtOp2 == nullptr) - { - return 1; - } - else - { - return 2; - } - } - else - { - // Special - switch (OperGet()) - { - case GT_PHI: +#if defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) + SetEntryStateForMultiOp(); + return; +#endif // defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) + + // LEA, which may have no first operand + case GT_LEA: + if (m_node->AsAddrMode()->gtOp1 == nullptr) { - unsigned count = 0; - for (GenTreePhi::Use& use : AsPhi()->Uses()) - { - count++; - } - return count; + m_edge = &m_node->AsAddrMode()->gtOp2; + m_advance = &GenTreeUseEdgeIterator::Terminate; } - - case GT_FIELD_LIST: + else { - unsigned count = 0; - for (GenTreeFieldList::Use& use : AsFieldList()->Uses()) - { - count++; - } - return count; + SetEntryStateForBinOp(); } + return; - case GT_CMPXCHG: - return 3; + // Special nodes + case GT_FIELD_LIST: + m_statePtr = m_node->AsFieldList()->Uses().GetHead(); + m_advance = &GenTreeUseEdgeIterator::AdvanceFieldList; + AdvanceFieldList(); + return; - case GT_ARR_ELEM: - return 1 + AsArrElem()->gtArrRank; + case GT_PHI: + m_statePtr = m_node->AsPhi()->gtUses; + m_advance = &GenTreeUseEdgeIterator::AdvancePhi; + AdvancePhi(); + return; - case GT_DYN_BLK: - return 2; + case GT_CMPXCHG: + m_edge = &m_node->AsCmpXchg()->gtOpLocation; + assert(*m_edge != nullptr); + m_advance = &GenTreeUseEdgeIterator::AdvanceCmpXchg; + return; - case GT_ARR_OFFSET: - case GT_STORE_DYN_BLK: - return 3; - - case GT_CALL: - { - GenTreeCall* call = AsCall(); - unsigned res = 0; - if (call->gtCallThisArg != nullptr) - { - res++; - } - for (GenTreeCall::Use& use : call->Args()) - { - res++; - } - for (GenTreeCall::Use& use : call->LateArgs()) - { - res++; - } - if (call->gtControlExpr != nullptr) - { - res++; - } - - if (call->gtCallType == CT_INDIRECT) - { - if (call->gtCallCookie != nullptr) - { - res++; - } - if (call->gtCallAddr != nullptr) - { - res++; - } - } - return res; - } - case GT_NONE: - return 0; - default: - unreached(); - } - } -} - -GenTree* GenTree::GetChild(unsigned childNum) -{ - assert(childNum < NumChildren()); // Precondition. - assert(!(OperIsConst() || OperIsLeaf())); - if (OperIsUnary()) - { - return AsUnOp()->gtOp1; - } - // Special case for assignment of dynamic block. - // This code is here to duplicate the former case where the size may be evaluated prior to the - // source and destination addresses. In order to do this, we treat the size as a child of the - // assignment. - // TODO-1stClassStructs: Revisit the need to duplicate former behavior, so that we can remove - // these special cases. - if ((OperGet() == GT_ASG) && (AsOp()->gtOp1->OperGet() == GT_DYN_BLK) && (childNum == 2)) - { - return AsOp()->gtOp1->AsDynBlk()->gtDynamicSize; - } - else if (OperIsBinary()) - { - if (OperIsAddrMode()) - { - // If this is the first (0th) child, only return op1 if it is non-null - // Otherwise, we return gtOp2. - if (childNum == 0 && AsOp()->gtOp1 != nullptr) - { - return AsOp()->gtOp1; - } - return AsOp()->gtOp2; - } - // TODO-Cleanup: Consider handling ReverseOps here, and then we wouldn't have to handle it in - // fgGetFirstNode(). However, it seems that it causes loop hoisting behavior to change. - if (childNum == 0) - { - return AsOp()->gtOp1; - } - else - { - return AsOp()->gtOp2; - } - } - else - { - // Special - switch (OperGet()) - { - case GT_PHI: - for (GenTreePhi::Use& use : AsPhi()->Uses()) - { - if (childNum == 0) - { - return use.GetNode(); - } - childNum--; - } - unreached(); - - case GT_FIELD_LIST: - for (GenTreeFieldList::Use& use : AsFieldList()->Uses()) - { - if (childNum == 0) - { - return use.GetNode(); - } - childNum--; - } - unreached(); - - case GT_CMPXCHG: - switch (childNum) - { - case 0: - return AsCmpXchg()->gtOpLocation; - case 1: - return AsCmpXchg()->gtOpValue; - case 2: - return AsCmpXchg()->gtOpComparand; - default: - unreached(); - } - - case GT_STORE_DYN_BLK: - switch (childNum) - { - case 0: - return AsDynBlk()->Addr(); - case 1: - return AsDynBlk()->Data(); - case 2: - return AsDynBlk()->gtDynamicSize; - default: - unreached(); - } - case GT_DYN_BLK: - switch (childNum) - { - case 0: - return AsDynBlk()->gtEvalSizeFirst ? AsDynBlk()->gtDynamicSize : AsDynBlk()->Addr(); - case 1: - return AsDynBlk()->gtEvalSizeFirst ? AsDynBlk()->Addr() : AsDynBlk()->gtDynamicSize; - default: - unreached(); - } - - case GT_ARR_ELEM: - if (childNum == 0) - { - return AsArrElem()->gtArrObj; - } - else - { - return AsArrElem()->gtArrInds[childNum - 1]; - } - - case GT_ARR_OFFSET: - switch (childNum) - { - case 0: - return AsArrOffs()->gtOffset; - case 1: - return AsArrOffs()->gtIndex; - case 2: - return AsArrOffs()->gtArrObj; - default: - unreached(); - } - - case GT_CALL: - { - GenTreeCall* call = AsCall(); - - if (call->gtCallThisArg != nullptr) - { - if (childNum == 0) - { - return call->gtCallThisArg->GetNode(); - } - - childNum--; - } - - for (GenTreeCall::Use& use : call->Args()) - { - if (childNum == 0) - { - return use.GetNode(); - } - - childNum--; - } - - for (GenTreeCall::Use& use : call->LateArgs()) - { - if (childNum == 0) - { - return use.GetNode(); - } - - childNum--; - } - - if (call->gtControlExpr != nullptr) - { - if (childNum == 0) - { - return call->gtControlExpr; - } - - childNum--; - } - - if ((call->gtCallType == CT_INDIRECT) && (call->gtCallCookie != nullptr)) - { - if (childNum == 0) - { - return call->gtCallCookie; - } - - childNum--; - } - - if (call->gtCallAddr != nullptr) - { - if (childNum == 0) - { - return call->gtCallAddr; - } - } - - unreached(); - } - case GT_NONE: - unreached(); - default: - unreached(); - } - } -} - -GenTreeUseEdgeIterator::GenTreeUseEdgeIterator() - : m_advance(nullptr), m_node(nullptr), m_edge(nullptr), m_statePtr(nullptr), m_state(-1) -{ -} - -GenTreeUseEdgeIterator::GenTreeUseEdgeIterator(GenTree* node) - : m_advance(nullptr), m_node(node), m_edge(nullptr), m_statePtr(nullptr), m_state(0) -{ - assert(m_node != nullptr); - - // NOTE: the switch statement below must be updated when introducing new nodes. - - switch (m_node->OperGet()) - { - // Leaf nodes - case GT_LCL_VAR: - case GT_LCL_FLD: - case GT_LCL_VAR_ADDR: - case GT_LCL_FLD_ADDR: - case GT_CATCH_ARG: - case GT_LABEL: - case GT_FTN_ADDR: - case GT_RET_EXPR: - case GT_CNS_INT: - case GT_CNS_LNG: - case GT_CNS_DBL: - case GT_CNS_STR: - case GT_MEMORYBARRIER: - case GT_JMP: - case GT_JCC: - case GT_SETCC: - case GT_NO_OP: - case GT_START_NONGC: - case GT_START_PREEMPTGC: - case GT_PROF_HOOK: -#if !defined(FEATURE_EH_FUNCLETS) - case GT_END_LFIN: -#endif // !FEATURE_EH_FUNCLETS - case GT_PHI_ARG: - case GT_JMPTABLE: - case GT_CLS_VAR: - case GT_CLS_VAR_ADDR: - case GT_ARGPLACE: - case GT_PHYSREG: - case GT_EMITNOP: - case GT_PINVOKE_PROLOG: - case GT_PINVOKE_EPILOG: - case GT_IL_OFFSET: - m_state = -1; - return; - - // Standard unary operators - case GT_STORE_LCL_VAR: - case GT_STORE_LCL_FLD: - case GT_NOT: - case GT_NEG: - case GT_COPY: - case GT_RELOAD: - case GT_ARR_LENGTH: - case GT_CAST: - case GT_BITCAST: - case GT_CKFINITE: - case GT_LCLHEAP: - case GT_ADDR: - case GT_IND: - case GT_OBJ: - case GT_BLK: - case GT_BOX: - case GT_ALLOCOBJ: - case GT_RUNTIMELOOKUP: - case GT_INIT_VAL: - case GT_JTRUE: - case GT_SWITCH: - case GT_NULLCHECK: - case GT_PUTARG_REG: - case GT_PUTARG_STK: - case GT_PUTARG_TYPE: - case GT_BSWAP: - case GT_BSWAP16: - case GT_KEEPALIVE: - case GT_INC_SATURATE: -#if FEATURE_ARG_SPLIT - case GT_PUTARG_SPLIT: -#endif // FEATURE_ARG_SPLIT - case GT_RETURNTRAP: - m_edge = &m_node->AsUnOp()->gtOp1; - assert(*m_edge != nullptr); - m_advance = &GenTreeUseEdgeIterator::Terminate; - return; - - // Unary operators with an optional operand - case GT_NOP: - case GT_FIELD: - case GT_RETURN: - case GT_RETFILT: - if (m_node->AsUnOp()->gtOp1 == nullptr) - { - assert(m_node->NullOp1Legal()); - m_state = -1; - } - else - { - m_edge = &m_node->AsUnOp()->gtOp1; - m_advance = &GenTreeUseEdgeIterator::Terminate; - } - return; - -// Variadic nodes -#ifdef FEATURE_SIMD - case GT_SIMD: - if (m_node->AsSIMD()->gtSIMDIntrinsicID == SIMDIntrinsicInitN) - { - SetEntryStateForList(m_node->AsSIMD()->gtOp1->AsArgList()); - } - else - { - SetEntryStateForBinOp(); - } - return; -#endif // FEATURE_SIMD - -#ifdef FEATURE_HW_INTRINSICS - case GT_HWINTRINSIC: - if (m_node->AsHWIntrinsic()->gtOp1 == nullptr) - { - assert(m_node->NullOp1Legal()); - m_state = -1; - } - else if (m_node->AsHWIntrinsic()->gtOp1->OperIsList()) - { - SetEntryStateForList(m_node->AsHWIntrinsic()->gtOp1->AsArgList()); - } - else - { - SetEntryStateForBinOp(); - } - return; -#endif // FEATURE_HW_INTRINSICS - - // LEA, which may have no first operand - case GT_LEA: - if (m_node->AsAddrMode()->gtOp1 == nullptr) - { - m_edge = &m_node->AsAddrMode()->gtOp2; - m_advance = &GenTreeUseEdgeIterator::Terminate; - } - else - { - SetEntryStateForBinOp(); - } - return; - - // Special nodes - case GT_FIELD_LIST: - m_statePtr = m_node->AsFieldList()->Uses().GetHead(); - m_advance = &GenTreeUseEdgeIterator::AdvanceFieldList; - AdvanceFieldList(); - return; - - case GT_PHI: - m_statePtr = m_node->AsPhi()->gtUses; - m_advance = &GenTreeUseEdgeIterator::AdvancePhi; - AdvancePhi(); - return; - - case GT_CMPXCHG: - m_edge = &m_node->AsCmpXchg()->gtOpLocation; - assert(*m_edge != nullptr); - m_advance = &GenTreeUseEdgeIterator::AdvanceCmpXchg; - return; - - case GT_ARR_ELEM: - m_edge = &m_node->AsArrElem()->gtArrObj; - assert(*m_edge != nullptr); - m_advance = &GenTreeUseEdgeIterator::AdvanceArrElem; - return; + case GT_ARR_ELEM: + m_edge = &m_node->AsArrElem()->gtArrObj; + assert(*m_edge != nullptr); + m_advance = &GenTreeUseEdgeIterator::AdvanceArrElem; + return; case GT_ARR_OFFSET: m_edge = &m_node->AsArrOffs()->gtOffset; @@ -9616,37 +8846,76 @@ void GenTreeUseEdgeIterator::SetEntryStateForBinOp() } } +#if defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) //------------------------------------------------------------------------ -// GenTreeUseEdgeIterator::AdvanceList: produces the next operand of a variadic node and advances the state. +// GenTreeUseEdgeIterator::AdvanceMultiOp: produces the next operand of a multi-op node and advances the state. // -// This function does not use `m_state` for anything meaningful; it simply walks the `m_argList` until -// there are no further entries. +// Takes advantage of the fact that GenTreeMultiOp stores the operands in a contigious array, simply +// incrementing the "m_edge" pointer, unless the end, stored in "m_statePtr", has been reached. // -void GenTreeUseEdgeIterator::AdvanceList() +void GenTreeUseEdgeIterator::AdvanceMultiOp() { - assert(m_state == 0); + assert(m_node != nullptr); + assert(m_node->OperIs(GT_SIMD, GT_HWINTRINSIC)); - if (m_statePtr == nullptr) + m_edge++; + if (m_edge == m_statePtr) { - m_state = -1; + Terminate(); } - else +} + +//------------------------------------------------------------------------ +// GenTreeUseEdgeIterator::AdvanceReversedMultiOp: produces the next operand of a multi-op node +// marked with GTF_REVRESE_OPS and advances the state. +// +// Takes advantage of the fact that GenTreeMultiOp stores the operands in a contigious array, simply +// decrementing the "m_edge" pointer, unless the beginning, stored in "m_statePtr", has been reached. +// +void GenTreeUseEdgeIterator::AdvanceReversedMultiOp() +{ + assert(m_node != nullptr); + assert(m_node->OperIs(GT_SIMD, GT_HWINTRINSIC)); + assert((m_node->AsMultiOp()->GetOperandCount() == 2) && m_node->IsReverseOp()); + + m_edge--; + if (m_edge == m_statePtr) { - GenTreeArgList* listNode = static_cast(m_statePtr); - m_edge = &listNode->gtOp1; - m_statePtr = listNode->Rest(); + Terminate(); } } //------------------------------------------------------------------------ -// GenTreeUseEdgeIterator::SetEntryStateForList: produces the first operand of a list node. +// GenTreeUseEdgeIterator::SetEntryStateForMultiOp: produces the first operand of a multi-op node and sets the +// required advance function. // -void GenTreeUseEdgeIterator::SetEntryStateForList(GenTreeArgList* list) +void GenTreeUseEdgeIterator::SetEntryStateForMultiOp() { - m_statePtr = list; - m_advance = &GenTreeUseEdgeIterator::AdvanceList; - AdvanceList(); + size_t operandCount = m_node->AsMultiOp()->GetOperandCount(); + + if (operandCount == 0) + { + Terminate(); + } + else + { + if (m_node->IsReverseOp()) + { + assert(operandCount == 2); + + m_edge = m_node->AsMultiOp()->GetOperandArray() + 1; + m_statePtr = m_node->AsMultiOp()->GetOperandArray() - 1; + m_advance = &GenTreeUseEdgeIterator::AdvanceReversedMultiOp; + } + else + { + m_edge = m_node->AsMultiOp()->GetOperandArray(); + m_statePtr = m_node->AsMultiOp()->GetOperandArray(operandCount); + m_advance = &GenTreeUseEdgeIterator::AdvanceMultiOp; + } + } } +#endif //------------------------------------------------------------------------ // GenTreeUseEdgeIterator::AdvanceCall: produces the next operand of a call node and advances the state. @@ -10476,12 +9745,6 @@ void Compiler::gtDispNode(GenTree* tree, IndentStack* indentStack, __in __in_z _ --msgLength; break; } - if (tree->gtFlags & GTF_RELOP_QMARK) - { - printf("Q"); - --msgLength; - break; - } goto DASH; case GT_JCMP: @@ -10524,7 +9787,7 @@ void Compiler::gtDispNode(GenTree* tree, IndentStack* indentStack, __in __in_z _ /* Then print the general purpose flags */ GenTreeFlags flags = tree->gtFlags; - if (tree->OperIsBinary()) + if (tree->OperIsBinary() || tree->OperIsMultiOp()) { genTreeOps oper = tree->OperGet(); @@ -10537,9 +9800,9 @@ void Compiler::gtDispNode(GenTree* tree, IndentStack* indentStack, __in __in_z _ } } } - else // !tree->OperIsBinary() + else // !(tree->OperIsBinary() || tree->OperIsMultiOp()) { - // the GTF_REVERSE flag only applies to binary operations + // the GTF_REVERSE flag only applies to binary operations (which some MultiOp nodes are). flags &= ~GTF_REVERSE_OPS; // we use this value for GTF_VAR_ARR_INDEX above } @@ -10640,7 +9903,7 @@ void Compiler::gtDispNode(GenTree* tree, IndentStack* indentStack, __in __in_z _ if (tree->gtOper == GT_LCL_VAR || tree->gtOper == GT_STORE_LCL_VAR) { - LclVarDsc* varDsc = &lvaTable[tree->AsLclVarCommon()->GetLclNum()]; + LclVarDsc* varDsc = lvaGetDesc(tree->AsLclVarCommon()); if (varDsc->IsAddressExposed()) { printf("(AX)"); // Variable has address exposed. @@ -10864,12 +10127,6 @@ void Compiler::gtGetLclVarNameInfo(unsigned lclNum, const char** ilKindOut, cons ilName = "OutArgs"; } #endif // FEATURE_FIXED_OUT_ARGS -#ifdef TARGET_ARM - else if (lclNum == lvaPromotedStructAssemblyScratchVar) - { - ilName = "PromotedStructScratch"; - } -#endif // TARGET_ARM #if !defined(FEATURE_EH_FUNCLETS) else if (lclNum == lvaShadowSPslotsVar) { @@ -10993,7 +10250,7 @@ int Compiler::gtGetLclVarName(unsigned lclNum, char* buf, unsigned buf_remaining char* Compiler::gtGetLclVarName(unsigned lclNum) { char buf[BUF_SIZE]; - int charsPrinted = gtGetLclVarName(lclNum, buf, _countof(buf)); + int charsPrinted = gtGetLclVarName(lclNum, buf, ArrLen(buf)); if (charsPrinted < 0) { return nullptr; @@ -11008,7 +10265,7 @@ char* Compiler::gtGetLclVarName(unsigned lclNum) void Compiler::gtDispLclVar(unsigned lclNum, bool padForBiggestDisp) { char buf[BUF_SIZE]; - int charsPrinted = gtGetLclVarName(lclNum, buf, _countof(buf)); + int charsPrinted = gtGetLclVarName(lclNum, buf, ArrLen(buf)); if (charsPrinted < 0) { @@ -11364,7 +10621,7 @@ void Compiler::gtDispLeaf(GenTree* tree, IndentStack* indentStack) for (unsigned i = varDsc->lvFieldLclStart; i < varDsc->lvFieldLclStart + varDsc->lvFieldCnt; ++i) { - LclVarDsc* fieldVarDsc = &lvaTable[i]; + LclVarDsc* fieldVarDsc = lvaGetDesc(i); const char* fieldName; #if !defined(TARGET_64BIT) if (varTypeIsLong(varDsc)) @@ -11476,15 +10733,8 @@ void Compiler::gtDispLeaf(GenTree* tree, IndentStack* indentStack) break; case GT_IL_OFFSET: - printf(" IL offset: "); - if (tree->AsILOffset()->gtStmtILoffsx == BAD_IL_OFFSET) - { - printf("???"); - } - else - { - printf("0x%x", jitGetILoffs(tree->AsILOffset()->gtStmtILoffsx)); - } + printf(" "); + tree->AsILOffset()->gtStmtDI.Dump(true); break; case GT_JCC: @@ -11866,53 +11116,24 @@ void Compiler::gtDispTree(GenTree* tree, } } -#ifdef FEATURE_SIMD - if (tree->gtOper == GT_SIMD) - { - printf(" %s %s", varTypeName(tree->AsSIMD()->GetSimdBaseType()), - simdIntrinsicNames[tree->AsSIMD()->gtSIMDIntrinsicID]); - } -#endif // FEATURE_SIMD - -#ifdef FEATURE_HW_INTRINSICS - if (tree->gtOper == GT_HWINTRINSIC) - { - printf(" %s %s", tree->AsHWIntrinsic()->GetSimdBaseType() == TYP_UNKNOWN - ? "" - : varTypeName(tree->AsHWIntrinsic()->GetSimdBaseType()), - HWIntrinsicInfo::lookupName(tree->AsHWIntrinsic()->gtHWIntrinsicId)); - } -#endif // FEATURE_HW_INTRINSICS - gtDispCommonEndLine(tree); if (!topOnly) { if (tree->AsOp()->gtOp1 != nullptr) { - if (tree->OperIs(GT_PHI)) + // Label the child of the GT_COLON operator + // op1 is the else part + if (tree->gtOper == GT_COLON) { - for (GenTreeArgList* args = tree->gtGetOp1()->AsArgList(); args != nullptr; args = args->Rest()) - { - gtDispChild(args->Current(), indentStack, (args->Rest() == nullptr) ? IIArcBottom : IIArc); - } + childMsg = "else"; } - else + else if (tree->gtOper == GT_QMARK) { - // Label the child of the GT_COLON operator - // op1 is the else part - - if (tree->gtOper == GT_COLON) - { - childMsg = "else"; - } - else if (tree->gtOper == GT_QMARK) - { - childMsg = " if"; - } - gtDispChild(tree->AsOp()->gtOp1, indentStack, - (tree->gtGetOp2IfPresent() == nullptr) ? IIArcBottom : IIArc, childMsg, topOnly); + childMsg = " if"; } + gtDispChild(tree->AsOp()->gtOp1, indentStack, + (tree->gtGetOp2IfPresent() == nullptr) ? IIArcBottom : IIArc, childMsg, topOnly); } if (tree->gtGetOp2IfPresent()) @@ -11980,14 +11201,12 @@ void Compiler::gtDispTree(GenTree* tree, case GT_CALL: { - GenTreeCall* call = tree->AsCall(); - assert(call->gtFlags & GTF_CALL); - unsigned numChildren = call->NumChildren(); - GenTree* lastChild = nullptr; - if (numChildren != 0) - { - lastChild = call->GetChild(numChildren - 1); - } + GenTreeCall* call = tree->AsCall(); + GenTree* lastChild = nullptr; + call->VisitOperands([&lastChild](GenTree* operand) -> GenTree::VisitResult { + lastChild = operand; + return GenTree::VisitResult::Continue; + }); if (call->gtCallType != CT_INDIRECT) { @@ -12035,7 +11254,7 @@ void Compiler::gtDispTree(GenTree* tree, if (call->gtCallArgs) { - gtDispArgList(call, indentStack); + gtDispArgList(call, lastChild, indentStack); } if (call->gtCallType == CT_INDIRECT) @@ -12050,9 +11269,6 @@ void Compiler::gtDispTree(GenTree* tree, (call->gtControlExpr == lastChild) ? IIArcBottom : IIArc, "control expr", topOnly); } -#if !FEATURE_FIXED_OUT_ARGS - regList list = call->regArgList; -#endif int lateArgIndex = 0; for (GenTreeCall::Use& use : call->LateArgs()) { @@ -12065,6 +11281,45 @@ void Compiler::gtDispTree(GenTree* tree, } break; +#if defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) +#if defined(FEATURE_SIMD) + case GT_SIMD: +#endif +#if defined(FEATURE_HW_INTRINSICS) + case GT_HWINTRINSIC: +#endif + +#if defined(FEATURE_SIMD) + if (tree->OperIs(GT_SIMD)) + { + printf(" %s %s", varTypeName(tree->AsSIMD()->GetSimdBaseType()), + simdIntrinsicNames[tree->AsSIMD()->GetSIMDIntrinsicId()]); + } +#endif // defined(FEATURE_SIMD) +#if defined(FEATURE_HW_INTRINSICS) + if (tree->OperIs(GT_HWINTRINSIC)) + { + printf(" %s %s", tree->AsHWIntrinsic()->GetSimdBaseType() == TYP_UNKNOWN + ? "" + : varTypeName(tree->AsHWIntrinsic()->GetSimdBaseType()), + HWIntrinsicInfo::lookupName(tree->AsHWIntrinsic()->GetHWIntrinsicId())); + } +#endif // defined(FEATURE_HW_INTRINSICS) + + gtDispCommonEndLine(tree); + + if (!topOnly) + { + size_t index = 0; + size_t count = tree->AsMultiOp()->GetOperandCount(); + for (GenTree* operand : tree->AsMultiOp()->Operands()) + { + gtDispChild(operand, indentStack, ++index < count ? IIArc : IIArcBottom, nullptr, topOnly); + } + } + break; +#endif // defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) + case GT_ARR_ELEM: gtDispCommonEndLine(tree); @@ -12231,10 +11486,7 @@ void Compiler::gtGetLateArgMsg(GenTreeCall* call, GenTree* argx, int lateArgInde assert(curArgTabEntry); regNumber argReg = curArgTabEntry->GetRegNum(); -#if !FEATURE_FIXED_OUT_ARGS - assert(lateArgIndex < call->regArgListCount); - assert(argReg == call->regArgList[lateArgIndex]); -#else +#if FEATURE_FIXED_OUT_ARGS if (argReg == REG_STK) { sprintf_s(bufp, bufLength, "arg%d in out+%02x%c", curArgTabEntry->argNum, curArgTabEntry->GetByteOffset(), 0); @@ -12298,17 +11550,15 @@ void Compiler::gtGetLateArgMsg(GenTreeCall* call, GenTree* argx, int lateArgInde // gtDispArgList: Dump the tree for a call arg list // // Arguments: -// call - The call to dump arguments for -// indentStack - the specification for the current level of indentation & arcs +// call - the call to dump arguments for +// lastCallOperand - the call's last operand (to determine the arc types) +// indentStack - the specification for the current level of indentation & arcs // // Return Value: // None. // -void Compiler::gtDispArgList(GenTreeCall* call, IndentStack* indentStack) +void Compiler::gtDispArgList(GenTreeCall* call, GenTree* lastCallOperand, IndentStack* indentStack) { - unsigned numChildren = call->NumChildren(); - GenTree* lastArgNode = call->GetChild(numChildren - 1); - unsigned argnum = 0; if (call->gtCallThisArg != nullptr) @@ -12323,7 +11573,7 @@ void Compiler::gtDispArgList(GenTreeCall* call, IndentStack* indentStack) { char buf[256]; gtGetArgMsg(call, argNode, argnum, buf, sizeof(buf)); - gtDispChild(argNode, indentStack, (argNode == lastArgNode) ? IIArcBottom : IIArc, buf, false); + gtDispChild(argNode, indentStack, (argNode == lastCallOperand) ? IIArcBottom : IIArc, buf, false); } argnum++; } @@ -12344,28 +11594,40 @@ void Compiler::gtDispStmt(Statement* stmt, const char* msg /* = nullptr */) printf("%s ", msg); } printStmtID(stmt); - IL_OFFSETX firstILOffsx = stmt->GetILOffsetX(); - printf(" (IL "); - if (firstILOffsx == BAD_IL_OFFSET) + printf(" ( "); + const DebugInfo& di = stmt->GetDebugInfo(); + // For statements in the root we display just the location without the + // inline context info. + if (di.GetInlineContext() == nullptr || di.GetInlineContext()->IsRoot()) { - printf(" ???"); + di.GetLocation().Dump(); } else { - printf("0x%03X", jitGetILoffs(firstILOffsx)); + stmt->GetDebugInfo().Dump(false); } - printf("..."); + printf(" ... "); IL_OFFSET lastILOffs = stmt->GetLastILOffset(); if (lastILOffs == BAD_IL_OFFSET) { - printf(" ???"); + printf("???"); } else { printf("0x%03X", lastILOffs); } - printf(")\n"); + + printf(" )"); + + DebugInfo par; + if (stmt->GetDebugInfo().GetParent(&par)) + { + printf(" <- "); + par.Dump(true); + } + + printf("\n"); } gtDispTree(stmt->GetRootNode()); } @@ -12495,7 +11757,6 @@ void Compiler::gtDispLIRNode(GenTree* node, const char* prefixMsg /* = nullptr * { fgArgTabEntry* curArgTabEntry = gtArgEntryByNode(call, operand); assert(curArgTabEntry); - assert(operand->OperGet() != GT_LIST); if (!curArgTabEntry->isLateArg()) { @@ -12987,7 +12248,7 @@ GenTree* Compiler::gtFoldTypeCompare(GenTree* tree) GenTree* compare = gtCreateHandleCompare(oper, op1ClassFromHandle, op2ClassFromHandle, inliningKind); // Drop any now-irrelvant flags - compare->gtFlags |= tree->gtFlags & (GTF_RELOP_JMP_USED | GTF_RELOP_QMARK | GTF_DONT_CSE); + compare->gtFlags |= tree->gtFlags & (GTF_RELOP_JMP_USED | GTF_DONT_CSE); return compare; } @@ -13027,7 +12288,7 @@ GenTree* Compiler::gtFoldTypeCompare(GenTree* tree) GenTree* compare = gtCreateHandleCompare(oper, arg1, arg2, inliningKind); // Drop any now-irrelvant flags - compare->gtFlags |= tree->gtFlags & (GTF_RELOP_JMP_USED | GTF_RELOP_QMARK | GTF_DONT_CSE); + compare->gtFlags |= tree->gtFlags & (GTF_RELOP_JMP_USED | GTF_DONT_CSE); return compare; } @@ -13125,7 +12386,7 @@ GenTree* Compiler::gtFoldTypeCompare(GenTree* tree) GenTree* const compare = gtCreateHandleCompare(oper, objMT, knownMT, typeCheckInliningResult); // Drop any now irrelevant flags - compare->gtFlags |= tree->gtFlags & (GTF_RELOP_JMP_USED | GTF_RELOP_QMARK | GTF_DONT_CSE); + compare->gtFlags |= tree->gtFlags & (GTF_RELOP_JMP_USED | GTF_DONT_CSE); // And we're done return compare; @@ -14464,11 +13725,6 @@ GenTree* Compiler::gtFoldExprConst(GenTree* tree) return op2; } - if (tree->OperIsAnyList()) - { - return tree; - } - switchType = op1->TypeGet(); // Normally we will just switch on op1 types, but for the case where @@ -15249,7 +14505,7 @@ GenTree* Compiler::gtFoldExprConst(GenTree* tree) // May set compFloatingPointUsed. GenTree* Compiler::gtNewTempAssign( - unsigned tmp, GenTree* val, Statement** pAfterStmt, IL_OFFSETX ilOffset, BasicBlock* block) + unsigned tmp, GenTree* val, Statement** pAfterStmt, const DebugInfo& di, BasicBlock* block) { // Self-assignment is a nop. if (val->OperGet() == GT_LCL_VAR && val->AsLclVarCommon()->GetLclNum() == tmp) @@ -15257,7 +14513,7 @@ GenTree* Compiler::gtNewTempAssign( return gtNewNothingNode(); } - LclVarDsc* varDsc = lvaTable + tmp; + LclVarDsc* varDsc = lvaGetDesc(tmp); if (varDsc->TypeGet() == TYP_I_IMPL && val->TypeGet() == TYP_BYREF) { @@ -15391,7 +14647,7 @@ GenTree* Compiler::gtNewTempAssign( } dest->gtFlags |= GTF_DONT_CSE; valx->gtFlags |= GTF_DONT_CSE; - asg = impAssignStruct(dest, val, valStructHnd, (unsigned)CHECK_SPILL_NONE, pAfterStmt, ilOffset, block); + asg = impAssignStruct(dest, val, valStructHnd, (unsigned)CHECK_SPILL_NONE, pAfterStmt, di, block); } else { @@ -15567,7 +14823,7 @@ GenTree* Compiler::gtNewRefCOMfield(GenTree* objPtr, * assignments too. */ -bool Compiler::gtNodeHasSideEffects(GenTree* tree, unsigned flags) +bool Compiler::gtNodeHasSideEffects(GenTree* tree, GenTreeFlags flags) { if (flags & GTF_ASG) { @@ -15643,10 +14899,10 @@ bool Compiler::gtNodeHasSideEffects(GenTree* tree, unsigned flags) * Returns true if the expr tree has any side effects. */ -bool Compiler::gtTreeHasSideEffects(GenTree* tree, unsigned flags /* = GTF_SIDE_EFFECT*/) +bool Compiler::gtTreeHasSideEffects(GenTree* tree, GenTreeFlags flags /* = GTF_SIDE_EFFECT*/) { // These are the side effect flags that we care about for this tree - unsigned sideEffectFlags = tree->gtFlags & flags; + GenTreeFlags sideEffectFlags = tree->gtFlags & flags; // Does this tree have any Side-effect flags set that we care about? if (sideEffectFlags == 0) @@ -15760,15 +15016,15 @@ GenTree* Compiler::gtBuildCommaList(GenTree* list, GenTree* expr) // each comma node holds the side effect tree and op2 points to the // next comma node. The original side effect execution order is preserved. // -void Compiler::gtExtractSideEffList(GenTree* expr, - GenTree** pList, - unsigned flags /* = GTF_SIDE_EFFECT*/, - bool ignoreRoot /* = false */) +void Compiler::gtExtractSideEffList(GenTree* expr, + GenTree** pList, + GenTreeFlags flags /* = GTF_SIDE_EFFECT*/, + bool ignoreRoot /* = false */) { class SideEffectExtractor final : public GenTreeVisitor { public: - const unsigned m_flags; + const GenTreeFlags m_flags; ArrayStack m_sideEffects; enum @@ -15777,7 +15033,7 @@ void Compiler::gtExtractSideEffList(GenTree* expr, UseExecutionOrder = true }; - SideEffectExtractor(Compiler* compiler, unsigned flags) + SideEffectExtractor(Compiler* compiler, GenTreeFlags flags) : GenTreeVisitor(compiler), m_flags(flags), m_sideEffects(compiler->getAllocator(CMK_SideEffects)) { } @@ -15921,7 +15177,6 @@ void Compiler::gtExtractSideEffList(GenTree* expr, */ #ifdef DEBUG - void dispNodeList(GenTree* list, bool verbose) { GenTree* last = nullptr; @@ -15955,21 +15210,7 @@ void dispNodeList(GenTree* list, bool verbose) } printf(""); // null string means flush } - -/***************************************************************************** - * Callback to assert that the nodes of a qmark-colon subtree are marked - */ - -/* static */ -Compiler::fgWalkResult Compiler::gtAssertColonCond(GenTree** pTree, fgWalkData* data) -{ - assert(data->pCallbackData == nullptr); - - assert((*pTree)->gtFlags & GTF_COLON_COND); - - return WALK_CONTINUE; -} -#endif // DEBUG +#endif /***************************************************************************** * Callback to mark the nodes of a qmark-colon subtree that are conditionally @@ -16522,7 +15763,7 @@ GenTreeLclVarCommon* GenTree::IsLocalAddrExpr() // Returns true if "this" represents the address of a local, or a field of a local. // // Notes: -// It is mostly used for optimizations but assertion propogation depends on it for correctness. +// It is mostly used for optimizations but assertion propagation depends on it for correctness. // So if this function does not recognize a def of a LCL_VAR we can have an incorrect optimization. // bool GenTree::IsLocalAddrExpr(Compiler* comp, @@ -18634,7 +17875,8 @@ GenTreeSIMD* Compiler::gtNewSIMDNode( assert(op1 != nullptr); SetOpLclRelatedToSIMDIntrinsic(op1); - GenTreeSIMD* simdNode = new (this, GT_SIMD) GenTreeSIMD(type, op1, simdIntrinsicID, simdBaseJitType, simdSize); + GenTreeSIMD* simdNode = new (this, GT_SIMD) + GenTreeSIMD(type, getAllocator(CMK_ASTNode), op1, simdIntrinsicID, simdBaseJitType, simdSize); return simdNode; } @@ -18649,7 +17891,8 @@ GenTreeSIMD* Compiler::gtNewSIMDNode(var_types type, SetOpLclRelatedToSIMDIntrinsic(op1); SetOpLclRelatedToSIMDIntrinsic(op2); - GenTreeSIMD* simdNode = new (this, GT_SIMD) GenTreeSIMD(type, op1, op2, simdIntrinsicID, simdBaseJitType, simdSize); + GenTreeSIMD* simdNode = new (this, GT_SIMD) + GenTreeSIMD(type, getAllocator(CMK_ASTNode), op1, op2, simdIntrinsicID, simdBaseJitType, simdSize); return simdNode; } @@ -18690,7 +17933,7 @@ void Compiler::SetOpLclRelatedToSIMDIntrinsic(GenTree* op) bool GenTree::isCommutativeSIMDIntrinsic() { assert(gtOper == GT_SIMD); - switch (AsSIMD()->gtSIMDIntrinsicID) + switch (AsSIMD()->GetSIMDIntrinsicId()) { case SIMDIntrinsicBitwiseAnd: case SIMDIntrinsicBitwiseOr: @@ -18701,6 +17944,81 @@ bool GenTree::isCommutativeSIMDIntrinsic() } } +void GenTreeMultiOp::ResetOperandArray(size_t newOperandCount, + Compiler* compiler, + GenTree** inlineOperands, + size_t inlineOperandCount) +{ + size_t oldOperandCount = GetOperandCount(); + GenTree** oldOperands = GetOperandArray(); + + if (newOperandCount > oldOperandCount) + { + if (newOperandCount <= inlineOperandCount) + { + assert(oldOperandCount <= inlineOperandCount); + assert(oldOperands == inlineOperands); + } + else + { + // The most difficult case: we need to recreate the dynamic array. + assert(compiler != nullptr); + + m_operands = compiler->getAllocator(CMK_ASTNode).allocate(newOperandCount); + } + } + else + { + // We are shrinking the array and may in process switch to an inline representation. + // We choose to do so for simplicity ("if a node has <= InlineOperandCount operands, + // then it stores them inline"), but actually it may be more profitable to not do that, + // it will save us a copy and a potential cache miss (though the latter seems unlikely). + + if ((newOperandCount <= inlineOperandCount) && (oldOperands != inlineOperands)) + { + m_operands = inlineOperands; + } + } + +#ifdef DEBUG + for (size_t i = 0; i < newOperandCount; i++) + { + m_operands[i] = nullptr; + } +#endif // DEBUG + + SetOperandCount(newOperandCount); +} + +/* static */ bool GenTreeMultiOp::OperandsAreEqual(GenTreeMultiOp* op1, GenTreeMultiOp* op2) +{ + if (op1->GetOperandCount() != op2->GetOperandCount()) + { + return false; + } + + for (size_t i = 1; i <= op1->GetOperandCount(); i++) + { + if (!Compare(op1->Op(i), op2->Op(i))) + { + return false; + } + } + + return true; +} + +void GenTreeMultiOp::InitializeOperands(GenTree** operands, size_t operandCount) +{ + for (size_t i = 0; i < operandCount; i++) + { + m_operands[i] = operands[i]; + gtFlags |= (operands[i]->gtFlags & GTF_ALL_EFFECT); + } + + SetOperandCount(operandCount); +} + var_types GenTreeJitIntrinsic::GetAuxiliaryType() const { CorInfoType auxiliaryJitType = GetAuxiliaryJitType(); @@ -18726,12 +18044,20 @@ var_types GenTreeJitIntrinsic::GetSimdBaseType() const // Returns true for the SIMD Intrinsic instructions that have MemoryLoad semantics, false otherwise bool GenTreeSIMD::OperIsMemoryLoad() const { - if (gtSIMDIntrinsicID == SIMDIntrinsicInitArray) + if (GetSIMDIntrinsicId() == SIMDIntrinsicInitArray) { return true; } return false; } + +// TODO-Review: why are layouts not compared here? +/* static */ bool GenTreeSIMD::Equals(GenTreeSIMD* op1, GenTreeSIMD* op2) +{ + return (op1->TypeGet() == op2->TypeGet()) && (op1->GetSIMDIntrinsicId() == op2->GetSIMDIntrinsicId()) && + (op1->GetSimdBaseType() == op2->GetSimdBaseType()) && (op1->GetSimdSize() == op2->GetSimdSize()) && + OperandsAreEqual(op1, op2); +} #endif // FEATURE_SIMD #ifdef FEATURE_HW_INTRINSICS @@ -18740,7 +18066,7 @@ bool GenTree::isCommutativeHWIntrinsic() const assert(gtOper == GT_HWINTRINSIC); #ifdef TARGET_XARCH - return HWIntrinsicInfo::IsCommutative(AsHWIntrinsic()->gtHWIntrinsicId); + return HWIntrinsicInfo::IsCommutative(AsHWIntrinsic()->GetHWIntrinsicId()); #else return false; #endif // TARGET_XARCH @@ -18751,7 +18077,7 @@ bool GenTree::isContainableHWIntrinsic() const assert(gtOper == GT_HWINTRINSIC); #ifdef TARGET_XARCH - switch (AsHWIntrinsic()->gtHWIntrinsicId) + switch (AsHWIntrinsic()->GetHWIntrinsicId()) { case NI_SSE_LoadAlignedVector128: case NI_SSE_LoadScalarVector128: @@ -18785,10 +18111,10 @@ bool GenTree::isRMWHWIntrinsic(Compiler* comp) #if defined(TARGET_XARCH) if (!comp->canUseVexEncoding()) { - return HWIntrinsicInfo::HasRMWSemantics(AsHWIntrinsic()->gtHWIntrinsicId); + return HWIntrinsicInfo::HasRMWSemantics(AsHWIntrinsic()->GetHWIntrinsicId()); } - switch (AsHWIntrinsic()->gtHWIntrinsicId) + switch (AsHWIntrinsic()->GetHWIntrinsicId()) { // TODO-XArch-Cleanup: Move this switch block to be table driven. @@ -18814,7 +18140,7 @@ bool GenTree::isRMWHWIntrinsic(Compiler* comp) } } #elif defined(TARGET_ARM64) - return HWIntrinsicInfo::HasRMWSemantics(AsHWIntrinsic()->gtHWIntrinsicId); + return HWIntrinsicInfo::HasRMWSemantics(AsHWIntrinsic()->GetHWIntrinsicId()); #else return false; #endif @@ -18826,8 +18152,8 @@ GenTreeHWIntrinsic* Compiler::gtNewSimdHWIntrinsicNode(var_types type, unsigned simdSize, bool isSimdAsHWIntrinsic) { - return new (this, GT_HWINTRINSIC) - GenTreeHWIntrinsic(type, hwIntrinsicID, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + return new (this, GT_HWINTRINSIC) GenTreeHWIntrinsic(type, getAllocator(CMK_ASTNode), hwIntrinsicID, + simdBaseJitType, simdSize, isSimdAsHWIntrinsic); } GenTreeHWIntrinsic* Compiler::gtNewSimdHWIntrinsicNode(var_types type, @@ -18839,8 +18165,8 @@ GenTreeHWIntrinsic* Compiler::gtNewSimdHWIntrinsicNode(var_types type, { SetOpLclRelatedToSIMDIntrinsic(op1); - return new (this, GT_HWINTRINSIC) - GenTreeHWIntrinsic(type, op1, hwIntrinsicID, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + return new (this, GT_HWINTRINSIC) GenTreeHWIntrinsic(type, getAllocator(CMK_ASTNode), hwIntrinsicID, + simdBaseJitType, simdSize, isSimdAsHWIntrinsic, op1); } GenTreeHWIntrinsic* Compiler::gtNewSimdHWIntrinsicNode(var_types type, @@ -18854,8 +18180,8 @@ GenTreeHWIntrinsic* Compiler::gtNewSimdHWIntrinsicNode(var_types type, SetOpLclRelatedToSIMDIntrinsic(op1); SetOpLclRelatedToSIMDIntrinsic(op2); - return new (this, GT_HWINTRINSIC) - GenTreeHWIntrinsic(type, op1, op2, hwIntrinsicID, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + return new (this, GT_HWINTRINSIC) GenTreeHWIntrinsic(type, getAllocator(CMK_ASTNode), hwIntrinsicID, + simdBaseJitType, simdSize, isSimdAsHWIntrinsic, op1, op2); } GenTreeHWIntrinsic* Compiler::gtNewSimdHWIntrinsicNode(var_types type, @@ -18871,8 +18197,8 @@ GenTreeHWIntrinsic* Compiler::gtNewSimdHWIntrinsicNode(var_types type, SetOpLclRelatedToSIMDIntrinsic(op2); SetOpLclRelatedToSIMDIntrinsic(op3); - return new (this, GT_HWINTRINSIC) GenTreeHWIntrinsic(type, gtNewArgList(op1, op2, op3), hwIntrinsicID, - simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + return new (this, GT_HWINTRINSIC) GenTreeHWIntrinsic(type, getAllocator(CMK_ASTNode), hwIntrinsicID, + simdBaseJitType, simdSize, isSimdAsHWIntrinsic, op1, op2, op3); } GenTreeHWIntrinsic* Compiler::gtNewSimdHWIntrinsicNode(var_types type, @@ -18890,8 +18216,44 @@ GenTreeHWIntrinsic* Compiler::gtNewSimdHWIntrinsicNode(var_types type, SetOpLclRelatedToSIMDIntrinsic(op3); SetOpLclRelatedToSIMDIntrinsic(op4); - return new (this, GT_HWINTRINSIC) GenTreeHWIntrinsic(type, gtNewArgList(op1, op2, op3, op4), hwIntrinsicID, - simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + return new (this, GT_HWINTRINSIC) + GenTreeHWIntrinsic(type, getAllocator(CMK_ASTNode), hwIntrinsicID, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic, op1, op2, op3, op4); +} + +GenTreeHWIntrinsic* Compiler::gtNewSimdHWIntrinsicNode(var_types type, + GenTree** operands, + size_t operandCount, + NamedIntrinsic hwIntrinsicID, + CorInfoType simdBaseJitType, + unsigned simdSize, + bool isSimdAsHWIntrinsic) +{ + IntrinsicNodeBuilder nodeBuilder(getAllocator(CMK_ASTNode), operandCount); + for (size_t i = 0; i < operandCount; i++) + { + nodeBuilder.AddOperand(i, operands[i]); + SetOpLclRelatedToSIMDIntrinsic(operands[i]); + } + + return new (this, GT_HWINTRINSIC) + GenTreeHWIntrinsic(type, std::move(nodeBuilder), hwIntrinsicID, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); +} + +GenTreeHWIntrinsic* Compiler::gtNewSimdHWIntrinsicNode(var_types type, + IntrinsicNodeBuilder&& nodeBuilder, + NamedIntrinsic hwIntrinsicID, + CorInfoType simdBaseJitType, + unsigned simdSize, + bool isSimdAsHWIntrinsic) +{ + for (size_t i = 0; i < nodeBuilder.GetOperandCount(); i++) + { + SetOpLclRelatedToSIMDIntrinsic(nodeBuilder.GetOperand(i)); + } + + return new (this, GT_HWINTRINSIC) + GenTreeHWIntrinsic(type, std::move(nodeBuilder), hwIntrinsicID, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); } GenTree* Compiler::gtNewSimdAbsNode( @@ -20312,130 +19674,427 @@ GenTree* Compiler::gtNewSimdCndSelNode(var_types type, assert(op1 != nullptr); assert(op1->TypeIs(type)); - assert(op2 != nullptr); - assert(op2->TypeIs(type)); - - assert(op3 != nullptr); - assert(op3->TypeIs(type)); - + assert(op2 != nullptr); + assert(op2->TypeIs(type)); + + assert(op3 != nullptr); + assert(op3->TypeIs(type)); + + var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType); + assert(varTypeIsArithmetic(simdBaseType)); + + NamedIntrinsic intrinsic = NI_Illegal; + +#if defined(TARGET_XARCH) + // TODO-XARCH-CQ: It's likely beneficial to have a dedicated CndSel node so we + // can special case when the condition is the result of various compare operations. + // + // When it is, the condition is AllBitsSet or Zero on a per-element basis and we + // could change this to be a Blend operation in lowering as an optimization. + + assert((simdSize != 32) || compIsaSupportedDebugOnly(InstructionSet_AVX)); + CORINFO_CLASS_HANDLE clsHnd = gtGetStructHandleForSIMD(type, simdBaseJitType); + + GenTree* op1Dup; + op1 = impCloneExpr(op1, &op1Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("Clone op1 for vector conditional select")); + + // op2 = op2 & op1 + op2 = gtNewSimdBinOpNode(GT_AND, type, op2, op1, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + + // op3 = op3 & ~op1Dup + op3 = gtNewSimdBinOpNode(GT_AND_NOT, type, op3, op1Dup, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + + // result = op2 | op3 + return gtNewSimdBinOpNode(GT_OR, type, op2, op3, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); +#elif defined(TARGET_ARM64) + return gtNewSimdAsHWIntrinsicNode(type, op1, op2, op3, NI_AdvSimd_BitwiseSelect, simdBaseJitType, simdSize); +#else +#error Unsupported platform +#endif // !TARGET_XARCH && !TARGET_ARM64 +} + +GenTree* Compiler::gtNewSimdCreateBroadcastNode( + var_types type, GenTree* op1, CorInfoType simdBaseJitType, unsigned simdSize, bool isSimdAsHWIntrinsic) +{ + NamedIntrinsic hwIntrinsicID = NI_Vector128_Create; + var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType); + +#if defined(TARGET_XARCH) +#if defined(TARGET_X86) + if (varTypeIsLong(simdBaseType) && !op1->IsIntegralConst()) + { + // TODO-XARCH-CQ: It may be beneficial to emit the movq + // instruction, which takes a 64-bit memory address and + // works on 32-bit x86 systems. + unreached(); + } +#endif // TARGET_X86 + + if (simdSize == 32) + { + hwIntrinsicID = NI_Vector256_Create; + } +#elif defined(TARGET_ARM64) + if (simdSize == 8) + { + hwIntrinsicID = NI_Vector64_Create; + } +#else +#error Unsupported platform +#endif // !TARGET_XARCH && !TARGET_ARM64 + + return gtNewSimdHWIntrinsicNode(type, op1, hwIntrinsicID, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); +} + +GenTree* Compiler::gtNewSimdDotProdNode(var_types type, + GenTree* op1, + GenTree* op2, + CorInfoType simdBaseJitType, + unsigned simdSize, + bool isSimdAsHWIntrinsic) +{ + assert(IsBaselineSimdIsaSupportedDebugOnly()); + assert(varTypeIsArithmetic(type)); + + var_types simdType = getSIMDTypeForSize(simdSize); + assert(varTypeIsSIMD(simdType)); + + assert(op1 != nullptr); + assert(op1->TypeIs(simdType)); + + assert(op2 != nullptr); + assert(op2->TypeIs(simdType)); + + var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType); + assert(genActualType(simdBaseType) == type); + + NamedIntrinsic intrinsic = NI_Illegal; + +#if defined(TARGET_XARCH) + assert(!varTypeIsByte(simdBaseType) && !varTypeIsLong(simdBaseType)); + + if (simdSize == 32) + { + assert(varTypeIsFloating(simdBaseType) || compIsaSupportedDebugOnly(InstructionSet_AVX2)); + intrinsic = NI_Vector256_Dot; + } + else + { + assert(((simdBaseType != TYP_INT) && (simdBaseType != TYP_UINT)) || + compIsaSupportedDebugOnly(InstructionSet_SSE41)); + intrinsic = NI_Vector128_Dot; + } +#elif defined(TARGET_ARM64) + assert(!varTypeIsLong(simdBaseType)); + intrinsic = (simdSize == 8) ? NI_Vector64_Dot : NI_Vector128_Dot; +#else +#error Unsupported platform +#endif // !TARGET_XARCH && !TARGET_ARM64 + + assert(intrinsic != NI_Illegal); + return gtNewSimdHWIntrinsicNode(type, op1, op2, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); +} + +GenTree* Compiler::gtNewSimdFloorNode( + var_types type, GenTree* op1, CorInfoType simdBaseJitType, unsigned simdSize, bool isSimdAsHWIntrinsic) +{ + assert(IsBaselineSimdIsaSupportedDebugOnly()); + + assert(varTypeIsSIMD(type)); + assert(getSIMDTypeForSize(simdSize) == type); + + assert(op1 != nullptr); + assert(op1->TypeIs(type)); + var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType); - assert(varTypeIsArithmetic(simdBaseType)); + assert(varTypeIsFloating(simdBaseType)); NamedIntrinsic intrinsic = NI_Illegal; #if defined(TARGET_XARCH) - // TODO-XARCH-CQ: It's likely beneficial to have a dedicated CndSel node so we - // can special case when the condition is the result of various compare operations. - // - // When it is, the condition is AllBitsSet or Zero on a per-element basis and we - // could change this to be a Blend operation in lowering as an optimization. - - assert((simdSize != 32) || compIsaSupportedDebugOnly(InstructionSet_AVX)); - CORINFO_CLASS_HANDLE clsHnd = gtGetStructHandleForSIMD(type, simdBaseJitType); - - GenTree* op1Dup; - op1 = impCloneExpr(op1, &op1Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, - nullptr DEBUGARG("Clone op1 for vector conditional select")); - - // op2 = op2 & op1 - op2 = gtNewSimdBinOpNode(GT_AND, type, op2, op1, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); - - // op3 = op3 & ~op1Dup - op3 = gtNewSimdBinOpNode(GT_AND_NOT, type, op3, op1Dup, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); - - // result = op2 | op3 - return gtNewSimdBinOpNode(GT_OR, type, op2, op3, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + if (simdSize == 32) + { + intrinsic = NI_AVX_Floor; + } + else + { + assert(compIsaSupportedDebugOnly(InstructionSet_SSE41)); + intrinsic = NI_SSE41_Floor; + } #elif defined(TARGET_ARM64) - return gtNewSimdAsHWIntrinsicNode(type, op1, op2, op3, NI_AdvSimd_BitwiseSelect, simdBaseJitType, simdSize); + if (simdBaseType == TYP_DOUBLE) + { + intrinsic = (simdSize == 8) ? NI_AdvSimd_FloorScalar : NI_AdvSimd_Arm64_Floor; + } + else + { + intrinsic = NI_AdvSimd_Floor; + } #else #error Unsupported platform #endif // !TARGET_XARCH && !TARGET_ARM64 + + assert(intrinsic != NI_Illegal); + return gtNewSimdHWIntrinsicNode(type, op1, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); } -GenTree* Compiler::gtNewSimdCreateBroadcastNode( - var_types type, GenTree* op1, CorInfoType simdBaseJitType, unsigned simdSize, bool isSimdAsHWIntrinsic) +GenTree* Compiler::gtNewSimdGetElementNode(var_types type, + GenTree* op1, + GenTree* op2, + CorInfoType simdBaseJitType, + unsigned simdSize, + bool isSimdAsHWIntrinsic) { - NamedIntrinsic hwIntrinsicID = NI_Vector128_Create; - var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType); + NamedIntrinsic intrinsicId = NI_Vector128_GetElement; + var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType); + + assert(varTypeIsArithmetic(simdBaseType)); #if defined(TARGET_XARCH) -#if defined(TARGET_X86) - if (varTypeIsLong(simdBaseType) && !op1->IsIntegralConst()) + switch (simdBaseType) { - // TODO-XARCH-CQ: It may be beneficial to emit the movq - // instruction, which takes a 64-bit memory address and - // works on 32-bit x86 systems. - unreached(); + // Using software fallback if simdBaseType is not supported by hardware + case TYP_BYTE: + case TYP_UBYTE: + case TYP_INT: + case TYP_UINT: + case TYP_LONG: + case TYP_ULONG: + assert(compIsaSupportedDebugOnly(InstructionSet_SSE41)); + break; + + case TYP_DOUBLE: + case TYP_FLOAT: + case TYP_SHORT: + case TYP_USHORT: + assert(compIsaSupportedDebugOnly(InstructionSet_SSE2)); + break; + + default: + unreached(); } -#endif // TARGET_X86 if (simdSize == 32) { - hwIntrinsicID = NI_Vector256_Create; + intrinsicId = NI_Vector256_GetElement; } #elif defined(TARGET_ARM64) if (simdSize == 8) { - hwIntrinsicID = NI_Vector64_Create; + intrinsicId = NI_Vector64_GetElement; } #else #error Unsupported platform #endif // !TARGET_XARCH && !TARGET_ARM64 - return gtNewSimdHWIntrinsicNode(type, op1, hwIntrinsicID, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + int immUpperBound = getSIMDVectorLength(simdSize, simdBaseType) - 1; + bool rangeCheckNeeded = !op2->OperIsConst(); + + if (!rangeCheckNeeded) + { + ssize_t imm8 = op2->AsIntCon()->IconValue(); + rangeCheckNeeded = (imm8 < 0) || (imm8 > immUpperBound); + } + + if (rangeCheckNeeded) + { + op2 = addRangeCheckForHWIntrinsic(op2, 0, immUpperBound); + } + + return gtNewSimdHWIntrinsicNode(type, op1, op2, intrinsicId, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); } -GenTree* Compiler::gtNewSimdDotProdNode(var_types type, - GenTree* op1, - GenTree* op2, - CorInfoType simdBaseJitType, - unsigned simdSize, - bool isSimdAsHWIntrinsic) +GenTree* Compiler::gtNewSimdMaxNode(var_types type, + GenTree* op1, + GenTree* op2, + CorInfoType simdBaseJitType, + unsigned simdSize, + bool isSimdAsHWIntrinsic) { assert(IsBaselineSimdIsaSupportedDebugOnly()); - assert(varTypeIsArithmetic(type)); - var_types simdType = getSIMDTypeForSize(simdSize); - assert(varTypeIsSIMD(simdType)); + assert(varTypeIsSIMD(type)); + assert(getSIMDTypeForSize(simdSize) == type); assert(op1 != nullptr); - assert(op1->TypeIs(simdType)); + assert(op1->TypeIs(type)); assert(op2 != nullptr); - assert(op2->TypeIs(simdType)); + assert(op2->TypeIs(type)); var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType); - assert(genActualType(simdBaseType) == type); + assert(varTypeIsArithmetic(simdBaseType)); - NamedIntrinsic intrinsic = NI_Illegal; + NamedIntrinsic intrinsic = NI_Illegal; + CORINFO_CLASS_HANDLE clsHnd = gtGetStructHandleForSIMD(type, simdBaseJitType); #if defined(TARGET_XARCH) - assert(!varTypeIsByte(simdBaseType) && !varTypeIsLong(simdBaseType)); - if (simdSize == 32) { - assert(varTypeIsFloating(simdBaseType) || compIsaSupportedDebugOnly(InstructionSet_AVX2)); - intrinsic = NI_Vector256_Dot; + assert(compIsaSupportedDebugOnly(InstructionSet_AVX)); + + if (varTypeIsFloating(simdBaseType)) + { + intrinsic = NI_AVX_Max; + } + else + { + assert(compIsaSupportedDebugOnly(InstructionSet_AVX2)); + + if (!varTypeIsLong(simdBaseType)) + { + intrinsic = NI_AVX2_Max; + } + } + } + else + { + switch (simdBaseType) + { + case TYP_BYTE: + case TYP_USHORT: + { + GenTree* constVal = nullptr; + CorInfoType opJitType = simdBaseJitType; + var_types opType = simdBaseType; + genTreeOps fixupOp1 = GT_NONE; + genTreeOps fixupOp2 = GT_NONE; + + switch (simdBaseType) + { + case TYP_BYTE: + { + constVal = gtNewIconNode(0x80808080); + fixupOp1 = GT_SUB; + fixupOp2 = GT_ADD; + simdBaseJitType = CORINFO_TYPE_UBYTE; + simdBaseType = TYP_UBYTE; + break; + } + + case TYP_USHORT: + { + constVal = gtNewIconNode(0x80008000); + fixupOp1 = GT_ADD; + fixupOp2 = GT_SUB; + simdBaseJitType = CORINFO_TYPE_SHORT; + simdBaseType = TYP_SHORT; + break; + } + + default: + { + unreached(); + } + } + + assert(constVal != nullptr); + assert(fixupOp1 != GT_NONE); + assert(fixupOp2 != GT_NONE); + assert(opJitType != simdBaseJitType); + assert(opType != simdBaseType); + + GenTree* constVector = + gtNewSimdCreateBroadcastNode(type, constVal, CORINFO_TYPE_INT, simdSize, isSimdAsHWIntrinsic); + + GenTree* constVectorDup1; + constVector = impCloneExpr(constVector, &constVectorDup1, clsHnd, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("Clone constVector for vector Max")); + + GenTree* constVectorDup2; + constVectorDup1 = impCloneExpr(constVectorDup1, &constVectorDup2, clsHnd, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("Clone constVector for vector Max")); + + // op1 = op1 - constVector + // -or- + // op1 = op1 + constVector + op1 = gtNewSimdBinOpNode(fixupOp1, type, op1, constVector, opJitType, simdSize, isSimdAsHWIntrinsic); + + // op2 = op2 - constVectorDup1 + // -or- + // op2 = op2 + constVectorDup1 + op2 = + gtNewSimdBinOpNode(fixupOp1, type, op2, constVectorDup1, opJitType, simdSize, isSimdAsHWIntrinsic); + + // op1 = Max(op1, op2) + op1 = gtNewSimdMaxNode(type, op1, op2, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + + // result = op1 + constVectorDup2 + // -or- + // result = op1 - constVectorDup2 + return gtNewSimdBinOpNode(fixupOp2, type, op1, constVectorDup2, opJitType, simdSize, + isSimdAsHWIntrinsic); + } + + case TYP_INT: + case TYP_UINT: + case TYP_LONG: + case TYP_ULONG: + { + break; + } + + case TYP_FLOAT: + { + intrinsic = NI_SSE_Max; + break; + } + + case TYP_UBYTE: + case TYP_SHORT: + case TYP_DOUBLE: + { + intrinsic = NI_SSE2_Max; + break; + } + + default: + { + unreached(); + } + } } - else +#elif defined(TARGET_ARM64) + if (!varTypeIsLong(simdBaseType)) { - assert(((simdBaseType != TYP_INT) && (simdBaseType != TYP_UINT)) || - compIsaSupportedDebugOnly(InstructionSet_SSE41)); - intrinsic = NI_Vector128_Dot; + if (simdBaseType == TYP_DOUBLE) + { + intrinsic = (simdSize == 8) ? NI_AdvSimd_Arm64_MaxScalar : NI_AdvSimd_Arm64_Max; + } + else + { + intrinsic = NI_AdvSimd_Max; + } } -#elif defined(TARGET_ARM64) - assert(!varTypeIsLong(simdBaseType)); - intrinsic = (simdSize == 8) ? NI_Vector64_Dot : NI_Vector128_Dot; #else #error Unsupported platform #endif // !TARGET_XARCH && !TARGET_ARM64 - assert(intrinsic != NI_Illegal); - return gtNewSimdHWIntrinsicNode(type, op1, op2, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + if (intrinsic != NI_Illegal) + { + return gtNewSimdHWIntrinsicNode(type, op1, op2, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + } + + GenTree* op1Dup; + op1 = impCloneExpr(op1, &op1Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, nullptr DEBUGARG("Clone op1 for vector Max")); + + GenTree* op2Dup; + op2 = impCloneExpr(op2, &op2Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, nullptr DEBUGARG("Clone op2 for vector Max")); + + // op1 = op1 > op2 + op1 = gtNewSimdCmpOpNode(GT_GT, type, op1, op2, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + + // result = ConditionalSelect(op1, op1Dup, op2Dup) + return gtNewSimdCndSelNode(type, op1, op1Dup, op2Dup, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); } -GenTree* Compiler::gtNewSimdFloorNode( - var_types type, GenTree* op1, CorInfoType simdBaseJitType, unsigned simdSize, bool isSimdAsHWIntrinsic) +GenTree* Compiler::gtNewSimdMinNode(var_types type, + GenTree* op1, + GenTree* op2, + CorInfoType simdBaseJitType, + unsigned simdSize, + bool isSimdAsHWIntrinsic) { assert(IsBaselineSimdIsaSupportedDebugOnly()); @@ -20445,110 +20104,181 @@ GenTree* Compiler::gtNewSimdFloorNode( assert(op1 != nullptr); assert(op1->TypeIs(type)); + assert(op2 != nullptr); + assert(op2->TypeIs(type)); + var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType); - assert(varTypeIsFloating(simdBaseType)); + assert(varTypeIsArithmetic(simdBaseType)); - NamedIntrinsic intrinsic = NI_Illegal; + NamedIntrinsic intrinsic = NI_Illegal; + CORINFO_CLASS_HANDLE clsHnd = gtGetStructHandleForSIMD(type, simdBaseJitType); #if defined(TARGET_XARCH) if (simdSize == 32) { - intrinsic = NI_AVX_Floor; - } - else - { - assert(compIsaSupportedDebugOnly(InstructionSet_SSE41)); - intrinsic = NI_SSE41_Floor; - } -#elif defined(TARGET_ARM64) - if (simdBaseType == TYP_DOUBLE) - { - intrinsic = (simdSize == 8) ? NI_AdvSimd_FloorScalar : NI_AdvSimd_Arm64_Floor; + assert(compIsaSupportedDebugOnly(InstructionSet_AVX)); + + if (varTypeIsFloating(simdBaseType)) + { + intrinsic = NI_AVX_Min; + } + else + { + assert(compIsaSupportedDebugOnly(InstructionSet_AVX2)); + + if (!varTypeIsLong(simdBaseType)) + { + intrinsic = NI_AVX2_Min; + } + } } else { - intrinsic = NI_AdvSimd_Floor; - } -#else -#error Unsupported platform -#endif // !TARGET_XARCH && !TARGET_ARM64 + switch (simdBaseType) + { + case TYP_BYTE: + case TYP_USHORT: + { + GenTree* constVal = nullptr; + CorInfoType opJitType = simdBaseJitType; + var_types opType = simdBaseType; + genTreeOps fixupOp1 = GT_NONE; + genTreeOps fixupOp2 = GT_NONE; - assert(intrinsic != NI_Illegal); - return gtNewSimdHWIntrinsicNode(type, op1, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); -} + switch (simdBaseType) + { + case TYP_BYTE: + { + constVal = gtNewIconNode(0x80808080); + fixupOp1 = GT_SUB; + fixupOp2 = GT_ADD; + simdBaseJitType = CORINFO_TYPE_UBYTE; + simdBaseType = TYP_UBYTE; + break; + } -GenTree* Compiler::gtNewSimdGetElementNode(var_types type, - GenTree* op1, - GenTree* op2, - CorInfoType simdBaseJitType, - unsigned simdSize, - bool isSimdAsHWIntrinsic) -{ - NamedIntrinsic intrinsicId = NI_Vector128_GetElement; - var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType); + case TYP_USHORT: + { + constVal = gtNewIconNode(0x80008000); + fixupOp1 = GT_ADD; + fixupOp2 = GT_SUB; + simdBaseJitType = CORINFO_TYPE_SHORT; + simdBaseType = TYP_SHORT; + break; + } - assert(varTypeIsArithmetic(simdBaseType)); + default: + { + unreached(); + } + } -#if defined(TARGET_XARCH) - switch (simdBaseType) - { - // Using software fallback if simdBaseType is not supported by hardware - case TYP_BYTE: - case TYP_UBYTE: - case TYP_INT: - case TYP_UINT: - case TYP_LONG: - case TYP_ULONG: - assert(compIsaSupportedDebugOnly(InstructionSet_SSE41)); - break; + assert(constVal != nullptr); + assert(fixupOp1 != GT_NONE); + assert(fixupOp2 != GT_NONE); + assert(opJitType != simdBaseJitType); + assert(opType != simdBaseType); - case TYP_DOUBLE: - case TYP_FLOAT: - case TYP_SHORT: - case TYP_USHORT: - assert(compIsaSupportedDebugOnly(InstructionSet_SSE2)); - break; + GenTree* constVector = + gtNewSimdCreateBroadcastNode(type, constVal, CORINFO_TYPE_INT, simdSize, isSimdAsHWIntrinsic); - default: - unreached(); - } + GenTree* constVectorDup1; + constVector = impCloneExpr(constVector, &constVectorDup1, clsHnd, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("Clone constVector for vector Min")); - if (simdSize == 32) - { - intrinsicId = NI_Vector256_GetElement; + GenTree* constVectorDup2; + constVectorDup1 = impCloneExpr(constVectorDup1, &constVectorDup2, clsHnd, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("Clone constVector for vector Min")); + + // op1 = op1 - constVector + // -or- + // op1 = op1 + constVector + op1 = gtNewSimdBinOpNode(fixupOp1, type, op1, constVector, opJitType, simdSize, isSimdAsHWIntrinsic); + + // op2 = op2 - constVectorDup1 + // -or- + // op2 = op2 + constVectorDup1 + op2 = + gtNewSimdBinOpNode(fixupOp1, type, op2, constVectorDup1, opJitType, simdSize, isSimdAsHWIntrinsic); + + // op1 = Min(op1, op2) + op1 = gtNewSimdMinNode(type, op1, op2, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + + // result = op1 + constVectorDup2 + // -or- + // result = op1 - constVectorDup2 + return gtNewSimdBinOpNode(fixupOp2, type, op1, constVectorDup2, opJitType, simdSize, + isSimdAsHWIntrinsic); + } + + case TYP_INT: + case TYP_UINT: + case TYP_LONG: + case TYP_ULONG: + { + break; + } + + case TYP_FLOAT: + { + intrinsic = NI_SSE_Min; + break; + } + + case TYP_UBYTE: + case TYP_SHORT: + case TYP_DOUBLE: + { + intrinsic = NI_SSE2_Min; + break; + } + + default: + { + unreached(); + } + } } #elif defined(TARGET_ARM64) - if (simdSize == 8) + if (!varTypeIsLong(simdBaseType)) { - intrinsicId = NI_Vector64_GetElement; + if (simdBaseType == TYP_DOUBLE) + { + intrinsic = (simdSize == 8) ? NI_AdvSimd_Arm64_MinScalar : NI_AdvSimd_Arm64_Min; + } + else + { + intrinsic = NI_AdvSimd_Min; + } } #else #error Unsupported platform #endif // !TARGET_XARCH && !TARGET_ARM64 - int immUpperBound = getSIMDVectorLength(simdSize, simdBaseType) - 1; - bool rangeCheckNeeded = !op2->OperIsConst(); - - if (!rangeCheckNeeded) + if (intrinsic != NI_Illegal) { - ssize_t imm8 = op2->AsIntCon()->IconValue(); - rangeCheckNeeded = (imm8 < 0) || (imm8 > immUpperBound); + return gtNewSimdHWIntrinsicNode(type, op1, op2, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); } - if (rangeCheckNeeded) - { - op2 = addRangeCheckForHWIntrinsic(op2, 0, immUpperBound); - } + GenTree* op1Dup; + op1 = impCloneExpr(op1, &op1Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, nullptr DEBUGARG("Clone op1 for vector Min")); - return gtNewSimdHWIntrinsicNode(type, op1, op2, intrinsicId, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + GenTree* op2Dup; + op2 = impCloneExpr(op2, &op2Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, nullptr DEBUGARG("Clone op2 for vector Min")); + + // op1 = op1 < op2 + op1 = gtNewSimdCmpOpNode(GT_LT, type, op1, op2, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + + // result = ConditionalSelect(op1, op1Dup, op2Dup) + return gtNewSimdCndSelNode(type, op1, op1Dup, op2Dup, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); } -GenTree* Compiler::gtNewSimdMaxNode(var_types type, - GenTree* op1, - GenTree* op2, - CorInfoType simdBaseJitType, - unsigned simdSize, - bool isSimdAsHWIntrinsic) +GenTree* Compiler::gtNewSimdNarrowNode(var_types type, + GenTree* op1, + GenTree* op2, + CorInfoType simdBaseJitType, + unsigned simdSize, + bool isSimdAsHWIntrinsic) { assert(IsBaselineSimdIsaSupportedDebugOnly()); @@ -20562,27 +20292,159 @@ GenTree* Compiler::gtNewSimdMaxNode(var_types type, assert(op2->TypeIs(type)); var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType); - assert(varTypeIsArithmetic(simdBaseType)); + assert(varTypeIsArithmetic(simdBaseType) && !varTypeIsLong(simdBaseType)); - NamedIntrinsic intrinsic = NI_Illegal; - CORINFO_CLASS_HANDLE clsHnd = gtGetStructHandleForSIMD(type, simdBaseJitType); + GenTree* tmp1; + GenTree* tmp2; #if defined(TARGET_XARCH) + GenTree* tmp3; + GenTree* tmp4; + if (simdSize == 32) { assert(compIsaSupportedDebugOnly(InstructionSet_AVX)); - if (varTypeIsFloating(simdBaseType)) - { - intrinsic = NI_AVX_Max; - } - else + switch (simdBaseType) { - assert(compIsaSupportedDebugOnly(InstructionSet_AVX2)); + case TYP_BYTE: + case TYP_UBYTE: + { + assert(compIsaSupportedDebugOnly(InstructionSet_AVX2)); - if (!varTypeIsLong(simdBaseType)) + // This is the same in principle to the other comments below, however due to + // code formatting, its too long to reasonably display here. + + CorInfoType opBaseJitType = (simdBaseType == TYP_BYTE) ? CORINFO_TYPE_SHORT : CORINFO_TYPE_USHORT; + CORINFO_CLASS_HANDLE clsHnd = gtGetStructHandleForSIMD(type, opBaseJitType); + + tmp1 = gtNewSimdHWIntrinsicNode(type, gtNewIconNode(0x00FF), NI_Vector256_Create, opBaseJitType, + simdSize, isSimdAsHWIntrinsic); + + GenTree* tmp1Dup; + tmp1 = impCloneExpr(tmp1, &tmp1Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("Clone tmp1 for vector narrow")); + + tmp2 = gtNewSimdHWIntrinsicNode(type, op1, tmp1, NI_SSE2_And, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + tmp3 = gtNewSimdHWIntrinsicNode(type, op2, tmp1Dup, NI_SSE2_And, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + tmp4 = gtNewSimdHWIntrinsicNode(type, tmp2, tmp3, NI_SSE2_PackUnsignedSaturate, CORINFO_TYPE_UBYTE, + simdSize, isSimdAsHWIntrinsic); + + CorInfoType permuteBaseJitType = (simdBaseType == TYP_BYTE) ? CORINFO_TYPE_LONG : CORINFO_TYPE_ULONG; + return gtNewSimdHWIntrinsicNode(type, tmp4, gtNewIconNode(SHUFFLE_WYZX), NI_AVX2_Permute4x64, + permuteBaseJitType, simdSize, isSimdAsHWIntrinsic); + } + + case TYP_SHORT: + case TYP_USHORT: { - intrinsic = NI_AVX2_Max; + assert(compIsaSupportedDebugOnly(InstructionSet_AVX2)); + + // op1 = Elements 0L, 0U, 1L, 1U, 2L, 2U, 3L, 3U | 4L, 4U, 5L, 5U, 6L, 6U, 7L, 7U + // op2 = Elements 8L, 8U, 9L, 9U, AL, AU, BL, BU | CL, CU, DL, DU, EL, EU, FL, FU + // + // tmp2 = Elements 0L, --, 1L, --, 2L, --, 3L, -- | 4L, --, 5L, --, 6L, --, 7L, -- + // tmp3 = Elements 8L, --, 9L, --, AL, --, BL, -- | CL, --, DL, --, EL, --, FL, -- + // tmp4 = Elements 0L, 1L, 2L, 3L, 8L, 9L, AL, BL | 4L, 5L, 6L, 7L, CL, DL, EL, FL + // return Elements 0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L | 8L, 9L, AL, BL, CL, DL, EL, FL + // + // var tmp1 = Vector256.Create(0x0000FFFF).AsInt16(); + // var tmp2 = Avx2.And(op1.AsInt16(), tmp1); + // var tmp3 = Avx2.And(op2.AsInt16(), tmp1); + // var tmp4 = Avx2.PackUnsignedSaturate(tmp2, tmp3); + // return Avx2.Permute4x64(tmp4.AsUInt64(), SHUFFLE_WYZX).As(); + + CorInfoType opBaseJitType = (simdBaseType == TYP_SHORT) ? CORINFO_TYPE_INT : CORINFO_TYPE_UINT; + CORINFO_CLASS_HANDLE clsHnd = gtGetStructHandleForSIMD(type, opBaseJitType); + + tmp1 = gtNewSimdHWIntrinsicNode(type, gtNewIconNode(0x0000FFFF), NI_Vector256_Create, opBaseJitType, + simdSize, isSimdAsHWIntrinsic); + + GenTree* tmp1Dup; + tmp1 = impCloneExpr(tmp1, &tmp1Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("Clone tmp1 for vector narrow")); + + tmp2 = gtNewSimdHWIntrinsicNode(type, op1, tmp1, NI_SSE2_And, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + tmp3 = gtNewSimdHWIntrinsicNode(type, op2, tmp1Dup, NI_SSE2_And, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + tmp4 = gtNewSimdHWIntrinsicNode(type, tmp2, tmp3, NI_SSE41_PackUnsignedSaturate, CORINFO_TYPE_USHORT, + simdSize, isSimdAsHWIntrinsic); + + CorInfoType permuteBaseJitType = (simdBaseType == TYP_BYTE) ? CORINFO_TYPE_LONG : CORINFO_TYPE_ULONG; + return gtNewSimdHWIntrinsicNode(type, tmp4, gtNewIconNode(SHUFFLE_WYZX), NI_AVX2_Permute4x64, + permuteBaseJitType, simdSize, isSimdAsHWIntrinsic); + } + + case TYP_INT: + case TYP_UINT: + { + assert(compIsaSupportedDebugOnly(InstructionSet_AVX2)); + + // op1 = Elements 0, 1 | 2, 3; 0L, 0U, 1L, 1U | 2L, 2U, 3L, 3U + // op2 = Elements 4, 5 | 6, 7; 4L, 4U, 5L, 5U | 6L, 6U, 7L, 7U + // + // tmp1 = Elements 0L, 4L, 0U, 4U | 2L, 6L, 2U, 6U + // tmp2 = Elements 1L, 5L, 1U, 5U | 3L, 7L, 3U, 7U + // tmp3 = Elements 0L, 1L, 4L, 5L | 2L, 3L, 6L, 7L + // return Elements 0L, 1L, 2L, 3L | 4L, 5L, 6L, 7L + // + // var tmp1 = Avx2.UnpackLow(op1, op2); + // var tmp2 = Avx2.UnpackHigh(op1, op2); + // var tmp3 = Avx2.UnpackLow(tmp1, tmp2); + // return Avx2.Permute4x64(tmp3.AsUInt64(), SHUFFLE_WYZX).AsUInt32(); + + CorInfoType opBaseJitType = (simdBaseType == TYP_INT) ? CORINFO_TYPE_LONG : CORINFO_TYPE_ULONG; + CORINFO_CLASS_HANDLE clsHnd = gtGetStructHandleForSIMD(type, opBaseJitType); + + GenTree* op1Dup; + op1 = impCloneExpr(op1, &op1Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("Clone op1 for vector narrow")); + + GenTree* op2Dup; + op2 = impCloneExpr(op2, &op2Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("Clone op2 for vector narrow")); + + tmp1 = gtNewSimdHWIntrinsicNode(type, op1, op2, NI_AVX2_UnpackLow, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + tmp2 = gtNewSimdHWIntrinsicNode(type, op1Dup, op2Dup, NI_AVX2_UnpackHigh, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + tmp3 = gtNewSimdHWIntrinsicNode(type, tmp1, tmp2, NI_AVX2_UnpackLow, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + + return gtNewSimdHWIntrinsicNode(type, tmp3, gtNewIconNode(SHUFFLE_WYZX), NI_AVX2_Permute4x64, + opBaseJitType, simdSize, isSimdAsHWIntrinsic); + } + + case TYP_FLOAT: + { + // op1 = Elements 0, 1 | 2, 3 + // op2 = Elements 4, 5 | 6, 7 + // + // tmp1 = Elements 0, 1, 2, 3 | -, -, -, - + // tmp1 = Elements 4, 5, 6, 7 + // return Elements 0, 1, 2, 3 | 4, 5, 6, 7 + // + // var tmp1 = Avx.ConvertToVector128Single(op1).ToVector256Unsafe(); + // var tmp2 = Avx.ConvertToVector128Single(op2); + // return Avx.InsertVector128(tmp1, tmp2, 1); + + tmp1 = gtNewSimdHWIntrinsicNode(TYP_SIMD16, op1, NI_AVX_ConvertToVector128Single, simdBaseJitType, + simdSize, isSimdAsHWIntrinsic); + tmp2 = gtNewSimdHWIntrinsicNode(TYP_SIMD16, op2, NI_AVX_ConvertToVector128Single, simdBaseJitType, + simdSize, isSimdAsHWIntrinsic); + + tmp1 = gtNewSimdHWIntrinsicNode(type, tmp1, NI_Vector128_ToVector256Unsafe, simdBaseJitType, 16, + isSimdAsHWIntrinsic); + return gtNewSimdHWIntrinsicNode(type, tmp1, tmp2, gtNewIconNode(1), NI_AVX_InsertVector128, + simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + } + + default: + { + unreached(); } } } @@ -20591,100 +20453,183 @@ GenTree* Compiler::gtNewSimdMaxNode(var_types type, switch (simdBaseType) { case TYP_BYTE: + case TYP_UBYTE: + { + // op1 = Elements 0, 1, 2, 3, 4, 5, 6, 7; 0L, 0U, 1L, 1U, 2L, 2U, 3L, 3U, 4L, 4U, 5L, 5U, 6L, 6U, 7L, 7U + // op2 = Elements 8, 9, A, B, C, D, E, F; 8L, 8U, 9L, 9U, AL, AU, BL, BU, CL, CU, DL, DU, EL, EU, FL, FU + // + // tmp2 = Elements 0L, --, 1L, --, 2L, --, 3L, --, 4L, --, 5L, --, 6L, --, 7L, -- + // tmp3 = Elements 8L, --, 9L, --, AL, --, BL, --, CL, --, DL, --, EL, --, FL, -- + // return Elements 0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, AL, BL, CL, DL, EL, FL + // + // var tmp1 = Vector128.Create((ushort)(0x00FF)).AsSByte(); + // var tmp2 = Sse2.And(op1.AsSByte(), tmp1); + // var tmp3 = Sse2.And(op2.AsSByte(), tmp1); + // return Sse2.PackUnsignedSaturate(tmp1, tmp2).As(); + + CorInfoType opBaseJitType = (simdBaseType == TYP_BYTE) ? CORINFO_TYPE_SHORT : CORINFO_TYPE_USHORT; + CORINFO_CLASS_HANDLE clsHnd = gtGetStructHandleForSIMD(type, opBaseJitType); + + tmp1 = gtNewSimdHWIntrinsicNode(type, gtNewIconNode(0x00FF), NI_Vector128_Create, opBaseJitType, + simdSize, isSimdAsHWIntrinsic); + + GenTree* tmp1Dup; + tmp1 = impCloneExpr(tmp1, &tmp1Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("Clone tmp1 for vector narrow")); + + tmp2 = gtNewSimdHWIntrinsicNode(type, op1, tmp1, NI_SSE2_And, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + tmp3 = gtNewSimdHWIntrinsicNode(type, op2, tmp1Dup, NI_SSE2_And, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + + return gtNewSimdHWIntrinsicNode(type, tmp2, tmp3, NI_SSE2_PackUnsignedSaturate, CORINFO_TYPE_UBYTE, + simdSize, isSimdAsHWIntrinsic); + } + + case TYP_SHORT: case TYP_USHORT: { - GenTree* constVal = nullptr; - CorInfoType opJitType = simdBaseJitType; - var_types opType = simdBaseType; - genTreeOps fixupOp1 = GT_NONE; - genTreeOps fixupOp2 = GT_NONE; + // op1 = Elements 0, 1, 2, 3; 0L, 0U, 1L, 1U, 2L, 2U, 3L, 3U + // op2 = Elements 4, 5, 6, 7; 4L, 4U, 5L, 5U, 6L, 6U, 7L, 7U + // + // ... - switch (simdBaseType) + CorInfoType opBaseJitType = (simdBaseType == TYP_SHORT) ? CORINFO_TYPE_INT : CORINFO_TYPE_UINT; + CORINFO_CLASS_HANDLE clsHnd = gtGetStructHandleForSIMD(type, opBaseJitType); + + if (compOpportunisticallyDependsOn(InstructionSet_SSE41)) { - case TYP_BYTE: - { - constVal = gtNewIconNode(0x80808080); - fixupOp1 = GT_SUB; - fixupOp2 = GT_ADD; - simdBaseJitType = CORINFO_TYPE_UBYTE; - simdBaseType = TYP_UBYTE; - break; - } + // ... + // + // tmp2 = Elements 0L, --, 1L, --, 2L, --, 3L, -- + // tmp3 = Elements 4L, --, 5L, --, 6L, --, 7L, -- + // return Elements 0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L + // + // var tmp1 = Vector128.Create(0x0000FFFF).AsInt16(); + // var tmp2 = Sse2.And(op1.AsInt16(), tmp1); + // var tmp3 = Sse2.And(op2.AsInt16(), tmp1); + // return Sse2.PackUnsignedSaturate(tmp2, tmp3).As(); - case TYP_USHORT: - { - constVal = gtNewIconNode(0x80008000); - fixupOp1 = GT_ADD; - fixupOp2 = GT_SUB; - simdBaseJitType = CORINFO_TYPE_SHORT; - simdBaseType = TYP_SHORT; - break; - } + tmp1 = gtNewSimdHWIntrinsicNode(type, gtNewIconNode(0x0000FFFF), NI_Vector128_Create, opBaseJitType, + simdSize, isSimdAsHWIntrinsic); - default: - { - unreached(); - } + GenTree* tmp1Dup; + tmp1 = impCloneExpr(tmp1, &tmp1Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("Clone tmp1 for vector narrow")); + + tmp2 = gtNewSimdHWIntrinsicNode(type, op1, tmp1, NI_SSE2_And, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + tmp3 = gtNewSimdHWIntrinsicNode(type, op2, tmp1Dup, NI_SSE2_And, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + + return gtNewSimdHWIntrinsicNode(type, tmp2, tmp3, NI_SSE41_PackUnsignedSaturate, + CORINFO_TYPE_USHORT, simdSize, isSimdAsHWIntrinsic); } + else + { + // ... + // + // tmp1 = Elements 0L, 4L, 0U, 4U, 1L, 5L, 1U, 5U + // tmp2 = Elements 2L, 6L, 2U, 6U, 3L, 7L, 3U, 7U + // tmp3 = Elements 0L, 2L, 4L, 6L, 0U, 2U, 4U, 6U + // tmp4 = Elements 1L, 3L, 5L, 7L, 1U, 3U, 5U, 7U + // return Elements 0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L + // + // var tmp1 = Sse2.UnpackLow(op1.AsUInt16(), op2.AsUInt16()); + // var tmp2 = Sse2.UnpackHigh(op1.AsUInt16(), op2.AsUInt16()); + // var tmp3 = Sse2.UnpackLow(tmp1, tmp2); + // var tmp4 = Sse2.UnpackHigh(tmp1, tmp2); + // return Sse2.UnpackLow(tmp3, tmp4).As(); - assert(constVal != nullptr); - assert(fixupOp1 != GT_NONE); - assert(fixupOp2 != GT_NONE); - assert(opJitType != simdBaseJitType); - assert(opType != simdBaseType); + GenTree* op1Dup; + op1 = impCloneExpr(op1, &op1Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("Clone op1 for vector narrow")); - GenTree* constVector = - gtNewSimdCreateBroadcastNode(type, constVal, CORINFO_TYPE_INT, simdSize, isSimdAsHWIntrinsic); + GenTree* op2Dup; + op2 = impCloneExpr(op2, &op2Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("Clone op1 for vector narrow")); - GenTree* constVectorDup1; - constVector = impCloneExpr(constVector, &constVectorDup1, clsHnd, (unsigned)CHECK_SPILL_ALL, - nullptr DEBUGARG("Clone constVector for vector Max")); + tmp1 = gtNewSimdHWIntrinsicNode(type, op1, op2, NI_SSE2_UnpackLow, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + tmp2 = gtNewSimdHWIntrinsicNode(type, op1Dup, op2Dup, NI_SSE2_UnpackHigh, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); - GenTree* constVectorDup2; - constVectorDup1 = impCloneExpr(constVectorDup1, &constVectorDup2, clsHnd, (unsigned)CHECK_SPILL_ALL, - nullptr DEBUGARG("Clone constVector for vector Max")); + clsHnd = gtGetStructHandleForSIMD(type, simdBaseJitType); - // op1 = op1 - constVector - // -or- - // op1 = op1 + constVector - op1 = gtNewSimdBinOpNode(fixupOp1, type, op1, constVector, opJitType, simdSize, isSimdAsHWIntrinsic); + GenTree* tmp1Dup; + tmp1 = impCloneExpr(tmp1, &tmp1Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("Clone tmp1 for vector narrow")); - // op2 = op2 - constVectorDup1 - // -or- - // op2 = op2 + constVectorDup1 - op2 = - gtNewSimdBinOpNode(fixupOp1, type, op2, constVectorDup1, opJitType, simdSize, isSimdAsHWIntrinsic); + GenTree* tmp2Dup; + tmp2 = impCloneExpr(tmp2, &tmp2Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("Clone tmp2 for vector narrow")); - // op1 = Max(op1, op2) - op1 = gtNewSimdMaxNode(type, op1, op2, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + tmp3 = gtNewSimdHWIntrinsicNode(type, tmp1, tmp2, NI_SSE2_UnpackLow, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + tmp4 = gtNewSimdHWIntrinsicNode(type, tmp1Dup, tmp2Dup, NI_SSE2_UnpackHigh, simdBaseJitType, + simdSize, isSimdAsHWIntrinsic); - // result = op1 + constVectorDup2 - // -or- - // result = op1 - constVectorDup2 - return gtNewSimdBinOpNode(fixupOp2, type, op1, constVectorDup2, opJitType, simdSize, - isSimdAsHWIntrinsic); + return gtNewSimdHWIntrinsicNode(type, tmp3, tmp4, NI_SSE2_UnpackLow, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + } } case TYP_INT: case TYP_UINT: - case TYP_LONG: - case TYP_ULONG: { - break; + // op1 = Elements 0, 1; 0L, 0U, 1L, 1U + // op2 = Elements 2, 3; 2L, 2U, 3L, 3U + // + // tmp1 = Elements 0L, 2L, 0U, 2U + // tmp2 = Elements 1L, 3L, 1U, 3U + // return Elements 0L, 1L, 2L, 3L + // + // var tmp1 = Sse2.UnpackLow(op1.AsUInt32(), op2.AsUInt32()); + // var tmp2 = Sse2.UnpackHigh(op1.AsUInt32(), op2.AsUInt32()); + // return Sse2.UnpackLow(tmp1, tmp2).As(); + + CorInfoType opBaseJitType = (simdBaseType == TYP_INT) ? CORINFO_TYPE_LONG : CORINFO_TYPE_ULONG; + CORINFO_CLASS_HANDLE clsHnd = gtGetStructHandleForSIMD(type, opBaseJitType); + + GenTree* op1Dup; + op1 = impCloneExpr(op1, &op1Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("Clone op1 for vector narrow")); + + GenTree* op2Dup; + op2 = impCloneExpr(op2, &op2Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("Clone op2 for vector narrow")); + + tmp1 = gtNewSimdHWIntrinsicNode(type, op1, op2, NI_SSE2_UnpackLow, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + tmp2 = gtNewSimdHWIntrinsicNode(type, op1Dup, op2Dup, NI_SSE2_UnpackHigh, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + + return gtNewSimdHWIntrinsicNode(type, tmp1, tmp2, NI_SSE2_UnpackLow, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); } case TYP_FLOAT: { - intrinsic = NI_SSE_Max; - break; - } + // op1 = Elements 0, 1 + // op2 = Elements 2, 3 + // + // tmp1 = Elements 0, 1, -, - + // tmp1 = Elements 2, 3, -, - + // return Elements 0, 1, 2, 3 + // + // var tmp1 = Sse2.ConvertToVector128Single(op1); + // var tmp2 = Sse2.ConvertToVector128Single(op2); + // return Sse.MoveLowToHigh(tmp1, tmp2); - case TYP_UBYTE: - case TYP_SHORT: - case TYP_DOUBLE: - { - intrinsic = NI_SSE2_Max; - break; + CorInfoType opBaseJitType = CORINFO_TYPE_DOUBLE; + + tmp1 = gtNewSimdHWIntrinsicNode(type, op1, NI_SSE2_ConvertToVector128Single, opBaseJitType, simdSize, + isSimdAsHWIntrinsic); + tmp2 = gtNewSimdHWIntrinsicNode(type, op2, NI_SSE2_ConvertToVector128Single, opBaseJitType, simdSize, + isSimdAsHWIntrinsic); + + return gtNewSimdHWIntrinsicNode(type, tmp1, tmp2, NI_SSE_MoveLowToHigh, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); } default: @@ -20694,45 +20639,118 @@ GenTree* Compiler::gtNewSimdMaxNode(var_types type, } } #elif defined(TARGET_ARM64) - if (!varTypeIsLong(simdBaseType)) + if (simdSize == 16) + { + if (varTypeIsFloating(simdBaseType)) + { + // var tmp1 = AdvSimd.Arm64.ConvertToSingleLower(op1); + // return AdvSimd.Arm64.ConvertToSingleUpper(tmp1, op2); + + tmp1 = gtNewSimdHWIntrinsicNode(TYP_SIMD8, op1, NI_AdvSimd_Arm64_ConvertToSingleLower, simdBaseJitType, 8, + isSimdAsHWIntrinsic); + return gtNewSimdHWIntrinsicNode(type, tmp1, op2, NI_AdvSimd_Arm64_ConvertToSingleUpper, simdBaseJitType, + simdSize, isSimdAsHWIntrinsic); + } + else + { + // var tmp1 = AdvSimd.ExtractNarrowingLower(op1); + // return AdvSimd.ExtractNarrowingUpper(tmp1, op2); + + tmp1 = gtNewSimdHWIntrinsicNode(TYP_SIMD8, op1, NI_AdvSimd_ExtractNarrowingLower, simdBaseJitType, 8, + isSimdAsHWIntrinsic); + return gtNewSimdHWIntrinsicNode(type, tmp1, op2, NI_AdvSimd_ExtractNarrowingUpper, simdBaseJitType, + simdSize, isSimdAsHWIntrinsic); + } + } + else if (varTypeIsFloating(simdBaseType)) + { + // var tmp1 = op1.ToVector128Unsafe(); + // return AdvSimd.Arm64.ConvertToSingleLower(tmp1); + + CorInfoType tmp2BaseJitType = CORINFO_TYPE_DOUBLE; + + tmp1 = gtNewSimdHWIntrinsicNode(TYP_SIMD16, op1, NI_Vector64_ToVector128Unsafe, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + tmp2 = gtNewSimdHWIntrinsicNode(TYP_SIMD16, tmp1, gtNewIconNode(1), op2, NI_AdvSimd_InsertScalar, + tmp2BaseJitType, 16, isSimdAsHWIntrinsic); + + return gtNewSimdHWIntrinsicNode(type, tmp2, NI_AdvSimd_Arm64_ConvertToSingleLower, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + } + else + { + // var tmp1 = op1.ToVector128Unsafe(); + // var tmp2 = AdvSimd.InsertScalar(tmp1.AsUInt64(), 1, op2.AsUInt64()); + // return AdvSimd.ExtractNarrowingUpper(tmp2).As(); + + CorInfoType tmp2BaseJitType = varTypeIsSigned(simdBaseType) ? CORINFO_TYPE_LONG : CORINFO_TYPE_ULONG; + + tmp1 = gtNewSimdHWIntrinsicNode(TYP_SIMD16, op1, NI_Vector64_ToVector128Unsafe, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + tmp2 = gtNewSimdHWIntrinsicNode(TYP_SIMD16, tmp1, gtNewIconNode(1), op2, NI_AdvSimd_InsertScalar, + tmp2BaseJitType, 16, isSimdAsHWIntrinsic); + + return gtNewSimdHWIntrinsicNode(type, tmp2, NI_AdvSimd_ExtractNarrowingLower, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + } +#else +#error Unsupported platform +#endif // !TARGET_XARCH && !TARGET_ARM64 +} + +GenTree* Compiler::gtNewSimdSqrtNode( + var_types type, GenTree* op1, CorInfoType simdBaseJitType, unsigned simdSize, bool isSimdAsHWIntrinsic) +{ + assert(IsBaselineSimdIsaSupportedDebugOnly()); + + assert(varTypeIsSIMD(type)); + assert(getSIMDTypeForSize(simdSize) == type); + + assert(op1 != nullptr); + assert(op1->TypeIs(type)); + + var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType); + assert(varTypeIsFloating(simdBaseType)); + + NamedIntrinsic intrinsic = NI_Illegal; + +#if defined(TARGET_XARCH) + if (simdSize == 32) + { + assert(compIsaSupportedDebugOnly(InstructionSet_AVX)); + intrinsic = NI_AVX_Sqrt; + } + else if (simdBaseType == TYP_FLOAT) + { + intrinsic = NI_SSE_Sqrt; + } + else + { + intrinsic = NI_SSE2_Sqrt; + } +#elif defined(TARGET_ARM64) + if ((simdSize == 8) && (simdBaseType == TYP_DOUBLE)) { - if (simdBaseType == TYP_DOUBLE) - { - intrinsic = (simdSize == 8) ? NI_AdvSimd_Arm64_MaxScalar : NI_AdvSimd_Arm64_Max; - } - else - { - intrinsic = NI_AdvSimd_Max; - } + intrinsic = NI_AdvSimd_SqrtScalar; + } + else + { + intrinsic = NI_AdvSimd_Arm64_Sqrt; } #else #error Unsupported platform #endif // !TARGET_XARCH && !TARGET_ARM64 - if (intrinsic != NI_Illegal) - { - return gtNewSimdHWIntrinsicNode(type, op1, op2, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); - } - - GenTree* op1Dup; - op1 = impCloneExpr(op1, &op1Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, nullptr DEBUGARG("Clone op1 for vector Max")); - - GenTree* op2Dup; - op2 = impCloneExpr(op2, &op2Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, nullptr DEBUGARG("Clone op2 for vector Max")); - - // op1 = op1 > op2 - op1 = gtNewSimdCmpOpNode(GT_GT, type, op1, op2, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); - - // result = ConditionalSelect(op1, op1Dup, op2Dup) - return gtNewSimdCndSelNode(type, op1, op1Dup, op2Dup, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + assert(intrinsic != NI_Illegal); + return gtNewSimdHWIntrinsicNode(type, op1, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); } -GenTree* Compiler::gtNewSimdMinNode(var_types type, - GenTree* op1, - GenTree* op2, - CorInfoType simdBaseJitType, - unsigned simdSize, - bool isSimdAsHWIntrinsic) +GenTree* Compiler::gtNewSimdUnOpNode(genTreeOps op, + var_types type, + GenTree* op1, + CorInfoType simdBaseJitType, + unsigned simdSize, + bool isSimdAsHWIntrinsic) { assert(IsBaselineSimdIsaSupportedDebugOnly()); @@ -20742,132 +20760,134 @@ GenTree* Compiler::gtNewSimdMinNode(var_types type, assert(op1 != nullptr); assert(op1->TypeIs(type)); - assert(op2 != nullptr); - assert(op2->TypeIs(type)); - var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType); assert(varTypeIsArithmetic(simdBaseType)); - NamedIntrinsic intrinsic = NI_Illegal; - CORINFO_CLASS_HANDLE clsHnd = gtGetStructHandleForSIMD(type, simdBaseJitType); + NamedIntrinsic intrinsic = NI_Illegal; + GenTree* op2 = nullptr; -#if defined(TARGET_XARCH) - if (simdSize == 32) + switch (op) { - assert(compIsaSupportedDebugOnly(InstructionSet_AVX)); +#if defined(TARGET_XARCH) + case GT_NEG: + { + if (simdSize == 32) + { + assert(compIsaSupportedDebugOnly(InstructionSet_AVX)); + assert(varTypeIsFloating(simdBaseType) || compIsaSupportedDebugOnly(InstructionSet_AVX2)); + } + op2 = gtNewSimdZeroNode(type, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); - if (varTypeIsFloating(simdBaseType)) + // Zero - op1 + return gtNewSimdBinOpNode(GT_SUB, type, op2, op1, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + } + + case GT_NOT: { - intrinsic = NI_AVX_Min; + assert((simdSize != 32) || compIsaSupportedDebugOnly(InstructionSet_AVX)); + + intrinsic = (simdSize == 32) ? NI_Vector256_get_AllBitsSet : NI_Vector128_get_AllBitsSet; + op2 = gtNewSimdHWIntrinsicNode(type, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + + // op1 ^ AllBitsSet + return gtNewSimdBinOpNode(GT_XOR, type, op1, op2, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); } - else +#elif defined(TARGET_ARM64) + case GT_NEG: { - assert(compIsaSupportedDebugOnly(InstructionSet_AVX2)); + if (varTypeIsSigned(simdBaseType)) + { + if (simdBaseType == TYP_LONG) + { + intrinsic = (simdSize == 8) ? NI_AdvSimd_Arm64_NegateScalar : NI_AdvSimd_Arm64_Negate; + } + else if (simdBaseType == TYP_DOUBLE) + { + intrinsic = (simdSize == 8) ? NI_AdvSimd_NegateScalar : NI_AdvSimd_Arm64_Negate; + } + else + { + intrinsic = NI_AdvSimd_Negate; + } - if (!varTypeIsLong(simdBaseType)) + return gtNewSimdHWIntrinsicNode(type, op1, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + } + else { - intrinsic = NI_AVX2_Min; + // Zero - op1 + op2 = gtNewSimdZeroNode(type, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + return gtNewSimdBinOpNode(GT_SUB, type, op2, op1, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); } } - } - else - { - switch (simdBaseType) - { - case TYP_BYTE: - case TYP_USHORT: - { - GenTree* constVal = nullptr; - CorInfoType opJitType = simdBaseJitType; - var_types opType = simdBaseType; - genTreeOps fixupOp1 = GT_NONE; - genTreeOps fixupOp2 = GT_NONE; - switch (simdBaseType) - { - case TYP_BYTE: - { - constVal = gtNewIconNode(0x80808080); - fixupOp1 = GT_SUB; - fixupOp2 = GT_ADD; - simdBaseJitType = CORINFO_TYPE_UBYTE; - simdBaseType = TYP_UBYTE; - break; - } + case GT_NOT: + { + return gtNewSimdHWIntrinsicNode(type, op1, NI_AdvSimd_Not, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + } +#else +#error Unsupported platform +#endif // !TARGET_XARCH && !TARGET_ARM64 - case TYP_USHORT: - { - constVal = gtNewIconNode(0x80008000); - fixupOp1 = GT_ADD; - fixupOp2 = GT_SUB; - simdBaseJitType = CORINFO_TYPE_SHORT; - simdBaseType = TYP_SHORT; - break; - } + default: + { + unreached(); + } + } +} - default: - { - unreached(); - } - } +GenTree* Compiler::gtNewSimdWidenLowerNode( + var_types type, GenTree* op1, CorInfoType simdBaseJitType, unsigned simdSize, bool isSimdAsHWIntrinsic) +{ + assert(IsBaselineSimdIsaSupportedDebugOnly()); - assert(constVal != nullptr); - assert(fixupOp1 != GT_NONE); - assert(fixupOp2 != GT_NONE); - assert(opJitType != simdBaseJitType); - assert(opType != simdBaseType); + assert(varTypeIsSIMD(type)); + assert(getSIMDTypeForSize(simdSize) == type); - GenTree* constVector = - gtNewSimdCreateBroadcastNode(type, constVal, CORINFO_TYPE_INT, simdSize, isSimdAsHWIntrinsic); + assert(op1 != nullptr); + assert(op1->TypeIs(type)); - GenTree* constVectorDup1; - constVector = impCloneExpr(constVector, &constVectorDup1, clsHnd, (unsigned)CHECK_SPILL_ALL, - nullptr DEBUGARG("Clone constVector for vector Min")); + var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType); + assert(varTypeIsArithmetic(simdBaseType) && !varTypeIsLong(simdBaseType)); - GenTree* constVectorDup2; - constVectorDup1 = impCloneExpr(constVectorDup1, &constVectorDup2, clsHnd, (unsigned)CHECK_SPILL_ALL, - nullptr DEBUGARG("Clone constVector for vector Min")); + NamedIntrinsic intrinsic = NI_Illegal; - // op1 = op1 - constVector - // -or- - // op1 = op1 + constVector - op1 = gtNewSimdBinOpNode(fixupOp1, type, op1, constVector, opJitType, simdSize, isSimdAsHWIntrinsic); + GenTree* tmp1; - // op2 = op2 - constVectorDup1 - // -or- - // op2 = op2 + constVectorDup1 - op2 = - gtNewSimdBinOpNode(fixupOp1, type, op2, constVectorDup1, opJitType, simdSize, isSimdAsHWIntrinsic); +#if defined(TARGET_XARCH) + if (simdSize == 32) + { + assert(compIsaSupportedDebugOnly(InstructionSet_AVX)); + assert(!varTypeIsIntegral(simdBaseType) || compIsaSupportedDebugOnly(InstructionSet_AVX2)); - // op1 = Min(op1, op2) - op1 = gtNewSimdMinNode(type, op1, op2, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + tmp1 = + gtNewSimdHWIntrinsicNode(type, op1, NI_Vector256_GetLower, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); - // result = op1 + constVectorDup2 - // -or- - // result = op1 - constVectorDup2 - return gtNewSimdBinOpNode(fixupOp2, type, op1, constVectorDup2, opJitType, simdSize, - isSimdAsHWIntrinsic); + switch (simdBaseType) + { + case TYP_BYTE: + case TYP_UBYTE: + { + intrinsic = NI_AVX2_ConvertToVector256Int16; + break; } - case TYP_INT: - case TYP_UINT: - case TYP_LONG: - case TYP_ULONG: + case TYP_SHORT: + case TYP_USHORT: { + intrinsic = NI_AVX2_ConvertToVector256Int32; break; } - case TYP_FLOAT: + case TYP_INT: + case TYP_UINT: { - intrinsic = NI_SSE_Min; + intrinsic = NI_AVX2_ConvertToVector256Int64; break; } - case TYP_UBYTE: - case TYP_SHORT: - case TYP_DOUBLE: + case TYP_FLOAT: { - intrinsic = NI_SSE2_Min; + intrinsic = NI_AVX_ConvertToVector256Double; break; } @@ -20876,94 +20896,113 @@ GenTree* Compiler::gtNewSimdMinNode(var_types type, unreached(); } } + + assert(intrinsic != NI_Illegal); + return gtNewSimdHWIntrinsicNode(type, tmp1, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); } -#elif defined(TARGET_ARM64) - if (!varTypeIsLong(simdBaseType)) + else if ((simdBaseType == TYP_FLOAT) || compOpportunisticallyDependsOn(InstructionSet_SSE41)) { - if (simdBaseType == TYP_DOUBLE) - { - intrinsic = (simdSize == 8) ? NI_AdvSimd_Arm64_MinScalar : NI_AdvSimd_Arm64_Min; - } - else + switch (simdBaseType) { - intrinsic = NI_AdvSimd_Min; - } - } -#else -#error Unsupported platform -#endif // !TARGET_XARCH && !TARGET_ARM64 - - if (intrinsic != NI_Illegal) - { - return gtNewSimdHWIntrinsicNode(type, op1, op2, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); - } + case TYP_BYTE: + case TYP_UBYTE: + { + intrinsic = NI_SSE41_ConvertToVector128Int16; + break; + } - GenTree* op1Dup; - op1 = impCloneExpr(op1, &op1Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, nullptr DEBUGARG("Clone op1 for vector Min")); + case TYP_SHORT: + case TYP_USHORT: + { + intrinsic = NI_SSE41_ConvertToVector128Int32; + break; + } - GenTree* op2Dup; - op2 = impCloneExpr(op2, &op2Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, nullptr DEBUGARG("Clone op2 for vector Min")); + case TYP_INT: + case TYP_UINT: + { + intrinsic = NI_SSE41_ConvertToVector128Int64; + break; + } - // op1 = op1 < op2 - op1 = gtNewSimdCmpOpNode(GT_LT, type, op1, op2, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + case TYP_FLOAT: + { + intrinsic = NI_SSE2_ConvertToVector128Double; + break; + } - // result = ConditionalSelect(op1, op1Dup, op2Dup) - return gtNewSimdCndSelNode(type, op1, op1Dup, op2Dup, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); -} + default: + { + unreached(); + } + } -GenTree* Compiler::gtNewSimdSqrtNode( - var_types type, GenTree* op1, CorInfoType simdBaseJitType, unsigned simdSize, bool isSimdAsHWIntrinsic) -{ - assert(IsBaselineSimdIsaSupportedDebugOnly()); + assert(intrinsic != NI_Illegal); + return gtNewSimdHWIntrinsicNode(type, op1, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + } + else + { + tmp1 = gtNewSimdZeroNode(type, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); - assert(varTypeIsSIMD(type)); - assert(getSIMDTypeForSize(simdSize) == type); + if (varTypeIsSigned(simdBaseType)) + { + CORINFO_CLASS_HANDLE clsHnd = gtGetStructHandleForSIMD(type, simdBaseJitType); - assert(op1 != nullptr); - assert(op1->TypeIs(type)); + GenTree* op1Dup; + op1 = impCloneExpr(op1, &op1Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("Clone op1 for vector widen lower")); - var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType); - assert(varTypeIsFloating(simdBaseType)); + tmp1 = gtNewSimdHWIntrinsicNode(type, op1, tmp1, NI_SSE2_CompareLessThan, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); - NamedIntrinsic intrinsic = NI_Illegal; + op1 = op1Dup; + } -#if defined(TARGET_XARCH) - if (simdSize == 32) - { - assert(compIsaSupportedDebugOnly(InstructionSet_AVX)); - intrinsic = NI_AVX_Sqrt; + return gtNewSimdHWIntrinsicNode(type, op1, tmp1, NI_SSE2_UnpackLow, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); } - else if (simdBaseType == TYP_FLOAT) +#elif defined(TARGET_ARM64) + if (simdSize == 16) { - intrinsic = NI_SSE_Sqrt; + tmp1 = gtNewSimdHWIntrinsicNode(TYP_SIMD8, op1, NI_Vector128_GetLower, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); } else { - intrinsic = NI_SSE2_Sqrt; + assert(simdSize == 8); + tmp1 = op1; } -#elif defined(TARGET_ARM64) - if ((simdSize == 8) && (simdBaseType == TYP_DOUBLE)) + + if (varTypeIsFloating(simdBaseType)) { - intrinsic = NI_AdvSimd_SqrtScalar; + assert(simdBaseType == TYP_FLOAT); + intrinsic = NI_AdvSimd_Arm64_ConvertToDouble; + } + else if (varTypeIsSigned(simdBaseType)) + { + intrinsic = NI_AdvSimd_SignExtendWideningLower; } else { - intrinsic = NI_AdvSimd_Arm64_Sqrt; + intrinsic = NI_AdvSimd_ZeroExtendWideningLower; + } + + assert(intrinsic != NI_Illegal); + tmp1 = gtNewSimdHWIntrinsicNode(type, tmp1, intrinsic, simdBaseJitType, 8, isSimdAsHWIntrinsic); + + if (simdSize == 8) + { + tmp1 = gtNewSimdHWIntrinsicNode(type, tmp1, NI_Vector128_GetLower, simdBaseJitType, 16, isSimdAsHWIntrinsic); } + + return tmp1; #else #error Unsupported platform #endif // !TARGET_XARCH && !TARGET_ARM64 - - assert(intrinsic != NI_Illegal); - return gtNewSimdHWIntrinsicNode(type, op1, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); } -GenTree* Compiler::gtNewSimdUnOpNode(genTreeOps op, - var_types type, - GenTree* op1, - CorInfoType simdBaseJitType, - unsigned simdSize, - bool isSimdAsHWIntrinsic) +GenTree* Compiler::gtNewSimdWidenUpperNode( + var_types type, GenTree* op1, CorInfoType simdBaseJitType, unsigned simdSize, bool isSimdAsHWIntrinsic) { assert(IsBaselineSimdIsaSupportedDebugOnly()); @@ -20974,78 +21013,184 @@ GenTree* Compiler::gtNewSimdUnOpNode(genTreeOps op, assert(op1->TypeIs(type)); var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType); - assert(varTypeIsArithmetic(simdBaseType)); + assert(varTypeIsArithmetic(simdBaseType) && !varTypeIsLong(simdBaseType)); NamedIntrinsic intrinsic = NI_Illegal; - GenTree* op2 = nullptr; - switch (op) - { + GenTree* tmp1; + #if defined(TARGET_XARCH) - case GT_NEG: + if (simdSize == 32) + { + assert(compIsaSupportedDebugOnly(InstructionSet_AVX)); + assert(!varTypeIsIntegral(simdBaseType) || compIsaSupportedDebugOnly(InstructionSet_AVX2)); + + tmp1 = gtNewSimdHWIntrinsicNode(type, op1, gtNewIconNode(1), NI_AVX_ExtractVector128, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + + switch (simdBaseType) { - if (simdSize == 32) + case TYP_BYTE: + case TYP_UBYTE: { - assert(compIsaSupportedDebugOnly(InstructionSet_AVX)); - assert(varTypeIsFloating(simdBaseType) || compIsaSupportedDebugOnly(InstructionSet_AVX2)); + intrinsic = NI_AVX2_ConvertToVector256Int16; + break; } - op2 = gtNewSimdZeroNode(type, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); - // Zero - op1 - return gtNewSimdBinOpNode(GT_SUB, type, op2, op1, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); - } + case TYP_SHORT: + case TYP_USHORT: + { + intrinsic = NI_AVX2_ConvertToVector256Int32; + break; + } - case GT_NOT: - { - assert((simdSize != 32) || compIsaSupportedDebugOnly(InstructionSet_AVX)); + case TYP_INT: + case TYP_UINT: + { + intrinsic = NI_AVX2_ConvertToVector256Int64; + break; + } - intrinsic = (simdSize == 32) ? NI_Vector256_get_AllBitsSet : NI_Vector128_get_AllBitsSet; - op2 = gtNewSimdHWIntrinsicNode(type, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + case TYP_FLOAT: + { + intrinsic = NI_AVX_ConvertToVector256Double; + break; + } - // op1 ^ AllBitsSet - return gtNewSimdBinOpNode(GT_XOR, type, op1, op2, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + default: + { + unreached(); + } } -#elif defined(TARGET_ARM64) - case GT_NEG: + + assert(intrinsic != NI_Illegal); + return gtNewSimdHWIntrinsicNode(type, tmp1, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + } + else if (varTypeIsFloating(simdBaseType)) + { + assert(simdBaseType == TYP_FLOAT); + CORINFO_CLASS_HANDLE clsHnd = gtGetStructHandleForSIMD(type, simdBaseJitType); + + GenTree* op1Dup; + op1 = impCloneExpr(op1, &op1Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("Clone op1 for vector widen upper")); + + tmp1 = gtNewSimdHWIntrinsicNode(type, op1, op1Dup, NI_SSE_MoveHighToLow, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + return gtNewSimdHWIntrinsicNode(type, tmp1, NI_SSE2_ConvertToVector128Double, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + } + else if (compOpportunisticallyDependsOn(InstructionSet_SSE41)) + { + tmp1 = gtNewSimdHWIntrinsicNode(type, op1, gtNewIconNode(8), NI_SSE2_ShiftRightLogical128BitLane, + simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + + switch (simdBaseType) { - if (varTypeIsSigned(simdBaseType)) + case TYP_BYTE: + case TYP_UBYTE: { - if (simdBaseType == TYP_LONG) - { - intrinsic = (simdSize == 8) ? NI_AdvSimd_Arm64_NegateScalar : NI_AdvSimd_Arm64_Negate; - } - else if (simdBaseType == TYP_DOUBLE) - { - intrinsic = (simdSize == 8) ? NI_AdvSimd_NegateScalar : NI_AdvSimd_Arm64_Negate; - } - else - { - intrinsic = NI_AdvSimd_Negate; - } + intrinsic = NI_SSE41_ConvertToVector128Int16; + break; + } - return gtNewSimdHWIntrinsicNode(type, op1, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + case TYP_SHORT: + case TYP_USHORT: + { + intrinsic = NI_SSE41_ConvertToVector128Int32; + break; } - else + + case TYP_INT: + case TYP_UINT: { - // Zero - op1 - op2 = gtNewSimdZeroNode(type, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); - return gtNewSimdBinOpNode(GT_SUB, type, op2, op1, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + intrinsic = NI_SSE41_ConvertToVector128Int64; + break; + } + + default: + { + unreached(); } } - case GT_NOT: + assert(intrinsic != NI_Illegal); + return gtNewSimdHWIntrinsicNode(type, tmp1, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + } + else + { + tmp1 = gtNewSimdZeroNode(type, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + + if (varTypeIsSigned(simdBaseType)) { - return gtNewSimdHWIntrinsicNode(type, op1, NI_AdvSimd_Not, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + CORINFO_CLASS_HANDLE clsHnd = gtGetStructHandleForSIMD(type, simdBaseJitType); + + GenTree* op1Dup; + op1 = impCloneExpr(op1, &op1Dup, clsHnd, (unsigned)CHECK_SPILL_ALL, + nullptr DEBUGARG("Clone op1 for vector widen upper")); + + tmp1 = gtNewSimdHWIntrinsicNode(type, op1, tmp1, NI_SSE2_CompareLessThan, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + + op1 = op1Dup; } -#else -#error Unsupported platform -#endif // !TARGET_XARCH && !TARGET_ARM64 - default: + return gtNewSimdHWIntrinsicNode(type, op1, tmp1, NI_SSE2_UnpackHigh, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); + } +#elif defined(TARGET_ARM64) + GenTree* zero; + + if (simdSize == 16) + { + if (varTypeIsFloating(simdBaseType)) { - unreached(); + assert(simdBaseType == TYP_FLOAT); + intrinsic = NI_AdvSimd_Arm64_ConvertToDoubleUpper; + } + else if (varTypeIsSigned(simdBaseType)) + { + intrinsic = NI_AdvSimd_SignExtendWideningUpper; + } + else + { + intrinsic = NI_AdvSimd_ZeroExtendWideningUpper; + } + + assert(intrinsic != NI_Illegal); + return gtNewSimdHWIntrinsicNode(type, op1, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + } + else + { + assert(simdSize == 8); + ssize_t index = 8 / genTypeSize(simdBaseType); + + if (varTypeIsFloating(simdBaseType)) + { + assert(simdBaseType == TYP_FLOAT); + intrinsic = NI_AdvSimd_Arm64_ConvertToDouble; + } + else if (varTypeIsSigned(simdBaseType)) + { + intrinsic = NI_AdvSimd_SignExtendWideningLower; + } + else + { + intrinsic = NI_AdvSimd_ZeroExtendWideningLower; } + + assert(intrinsic != NI_Illegal); + + tmp1 = gtNewSimdHWIntrinsicNode(TYP_SIMD16, op1, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); + zero = gtNewSimdZeroNode(TYP_SIMD16, simdBaseJitType, 16, isSimdAsHWIntrinsic); + tmp1 = gtNewSimdHWIntrinsicNode(TYP_SIMD16, tmp1, zero, gtNewIconNode(index), NI_AdvSimd_ExtractVector128, + simdBaseJitType, 16, isSimdAsHWIntrinsic); + return gtNewSimdHWIntrinsicNode(type, tmp1, NI_Vector128_GetLower, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic); } +#else +#error Unsupported platform +#endif // !TARGET_XARCH && !TARGET_ARM64 } GenTree* Compiler::gtNewSimdWithElementNode(var_types type, @@ -21158,12 +21303,18 @@ GenTree* Compiler::gtNewSimdZeroNode(var_types type, return gtNewSimdHWIntrinsicNode(type, intrinsic, simdBaseJitType, simdSize, isSimdAsHWIntrinsic); } +GenTreeHWIntrinsic* Compiler::gtNewScalarHWIntrinsicNode(var_types type, NamedIntrinsic hwIntrinsicID) +{ + return new (this, GT_HWINTRINSIC) GenTreeHWIntrinsic(type, getAllocator(CMK_ASTNode), hwIntrinsicID, + CORINFO_TYPE_UNDEF, 0, /* isSimdAsHWIntrinsic */ false); +} + GenTreeHWIntrinsic* Compiler::gtNewScalarHWIntrinsicNode(var_types type, GenTree* op1, NamedIntrinsic hwIntrinsicID) { SetOpLclRelatedToSIMDIntrinsic(op1); - return new (this, GT_HWINTRINSIC) - GenTreeHWIntrinsic(type, op1, hwIntrinsicID, CORINFO_TYPE_UNDEF, 0, /* isSimdAsHWIntrinsic */ false); + return new (this, GT_HWINTRINSIC) GenTreeHWIntrinsic(type, getAllocator(CMK_ASTNode), hwIntrinsicID, + CORINFO_TYPE_UNDEF, 0, /* isSimdAsHWIntrinsic */ false, op1); } GenTreeHWIntrinsic* Compiler::gtNewScalarHWIntrinsicNode(var_types type, @@ -21175,7 +21326,8 @@ GenTreeHWIntrinsic* Compiler::gtNewScalarHWIntrinsicNode(var_types type, SetOpLclRelatedToSIMDIntrinsic(op2); return new (this, GT_HWINTRINSIC) - GenTreeHWIntrinsic(type, op1, op2, hwIntrinsicID, CORINFO_TYPE_UNDEF, 0, /* isSimdAsHWIntrinsic */ false); + GenTreeHWIntrinsic(type, getAllocator(CMK_ASTNode), hwIntrinsicID, CORINFO_TYPE_UNDEF, 0, + /* isSimdAsHWIntrinsic */ false, op1, op2); } GenTreeHWIntrinsic* Compiler::gtNewScalarHWIntrinsicNode( @@ -21185,21 +21337,22 @@ GenTreeHWIntrinsic* Compiler::gtNewScalarHWIntrinsicNode( SetOpLclRelatedToSIMDIntrinsic(op2); SetOpLclRelatedToSIMDIntrinsic(op3); - return new (this, GT_HWINTRINSIC) GenTreeHWIntrinsic(type, gtNewArgList(op1, op2, op3), hwIntrinsicID, - CORINFO_TYPE_UNDEF, 0, /* isSimdAsHWIntrinsic */ false); + return new (this, GT_HWINTRINSIC) + GenTreeHWIntrinsic(type, getAllocator(CMK_ASTNode), hwIntrinsicID, CORINFO_TYPE_UNDEF, 0, + /* isSimdAsHWIntrinsic */ false, op1, op2, op3); } // Returns true for the HW Intrinsic instructions that have MemoryLoad semantics, false otherwise bool GenTreeHWIntrinsic::OperIsMemoryLoad() const { #if defined(TARGET_XARCH) || defined(TARGET_ARM64) - HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(gtHWIntrinsicId); + HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(GetHWIntrinsicId()); if (category == HW_Category_MemoryLoad) { return true; } #ifdef TARGET_XARCH - else if (HWIntrinsicInfo::MaybeMemoryLoad(gtHWIntrinsicId)) + else if (HWIntrinsicInfo::MaybeMemoryLoad(GetHWIntrinsicId())) { // Some intrinsics (without HW_Category_MemoryLoad) also have MemoryLoad semantics @@ -21209,19 +21362,19 @@ bool GenTreeHWIntrinsic::OperIsMemoryLoad() const // Vector128 BroadcastScalarToVector128(Vector128 value) // Vector128 BroadcastScalarToVector128(byte* source) // So, we need to check the argument's type is memory-reference or Vector128 - assert(HWIntrinsicInfo::lookupNumArgs(this) == 1); - return (gtHWIntrinsicId == NI_AVX2_BroadcastScalarToVector128 || - gtHWIntrinsicId == NI_AVX2_BroadcastScalarToVector256) && - AsOp()->gtOp1->TypeGet() != TYP_SIMD16; + assert(GetOperandCount() == 1); + return (GetHWIntrinsicId() == NI_AVX2_BroadcastScalarToVector128 || + GetHWIntrinsicId() == NI_AVX2_BroadcastScalarToVector256) && + !Op(1)->TypeIs(TYP_SIMD16); } else if (category == HW_Category_IMM) { // Do we have less than 3 operands? - if (HWIntrinsicInfo::lookupNumArgs(this) < 3) + if (GetOperandCount() < 3) { return false; } - else if (HWIntrinsicInfo::isAVX2GatherIntrinsic(gtHWIntrinsicId)) + else if (HWIntrinsicInfo::isAVX2GatherIntrinsic(GetHWIntrinsicId())) { return true; } @@ -21236,13 +21389,13 @@ bool GenTreeHWIntrinsic::OperIsMemoryLoad() const bool GenTreeHWIntrinsic::OperIsMemoryStore() const { #if defined(TARGET_XARCH) || defined(TARGET_ARM64) - HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(gtHWIntrinsicId); + HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(GetHWIntrinsicId()); if (category == HW_Category_MemoryStore) { return true; } #ifdef TARGET_XARCH - else if (HWIntrinsicInfo::MaybeMemoryStore(gtHWIntrinsicId) && + else if (HWIntrinsicInfo::MaybeMemoryStore(GetHWIntrinsicId()) && (category == HW_Category_IMM || category == HW_Category_Scalar)) { // Some intrinsics (without HW_Category_MemoryStore) also have MemoryStore semantics @@ -21251,9 +21404,9 @@ bool GenTreeHWIntrinsic::OperIsMemoryStore() const // unsafe ulong MultiplyNoFlags(ulong left, ulong right, ulong* low) // // So, the 3-argument form is MemoryStore - if (HWIntrinsicInfo::lookupNumArgs(this) == 3) + if (GetOperandCount() == 3) { - switch (gtHWIntrinsicId) + switch (GetHWIntrinsicId()) { case NI_BMI2_MultiplyNoFlags: case NI_BMI2_X64_MultiplyNoFlags: @@ -21278,6 +21431,39 @@ bool GenTreeHWIntrinsic::OperIsMemoryLoadOrStore() const #endif } +NamedIntrinsic GenTreeHWIntrinsic::GetHWIntrinsicId() const +{ + NamedIntrinsic id = gtHWIntrinsicId; + int numArgs = HWIntrinsicInfo::lookupNumArgs(id); + bool numArgsUnknown = numArgs < 0; + + assert((static_cast(numArgs) == GetOperandCount()) || numArgsUnknown); + + return id; +} + +void GenTreeHWIntrinsic::SetHWIntrinsicId(NamedIntrinsic intrinsicId) +{ +#ifdef DEBUG + size_t oldOperandCount = GetOperandCount(); + int newOperandCount = HWIntrinsicInfo::lookupNumArgs(intrinsicId); + bool newCountUnknown = newOperandCount < 0; + + // We'll choose to trust the programmer here. + assert((oldOperandCount == static_cast(newOperandCount)) || newCountUnknown); +#endif // DEBUG + + gtHWIntrinsicId = intrinsicId; +} + +// TODO-Review: why are layouts not compared here? +/* static */ bool GenTreeHWIntrinsic::Equals(GenTreeHWIntrinsic* op1, GenTreeHWIntrinsic* op2) +{ + return (op1->TypeGet() == op2->TypeGet()) && (op1->GetHWIntrinsicId() == op2->GetHWIntrinsicId()) && + (op1->GetSimdBaseType() == op2->GetSimdBaseType()) && (op1->GetSimdSize() == op2->GetSimdSize()) && + (op1->GetAuxiliaryType() == op2->GetAuxiliaryType()) && (op1->GetOtherReg() == op2->GetOtherReg()) && + OperandsAreEqual(op1, op2); +} #endif // FEATURE_HW_INTRINSICS //--------------------------------------------------------------------------------------- @@ -21712,6 +21898,53 @@ uint16_t GenTreeLclVarCommon::GetLclOffs() const } } +#if defined(TARGET_XARCH) && defined(FEATURE_HW_INTRINSICS) +//------------------------------------------------------------------------ +// GetResultOpNumForFMA: check if the result is written into one of the operands. +// In the case that none of the operand is overwritten, check if any of them is lastUse. +// +// Return Value: +// The operand number overwritten or lastUse. 0 is the default value, where the result is written into +// a destination that is not one of the source operands and there is no last use op. +// +unsigned GenTreeHWIntrinsic::GetResultOpNumForFMA(GenTree* use, GenTree* op1, GenTree* op2, GenTree* op3) +{ + // only FMA intrinsic node should call into this function + assert(HWIntrinsicInfo::lookupIsa(gtHWIntrinsicId) == InstructionSet_FMA); + if (use != nullptr && use->OperIs(GT_STORE_LCL_VAR)) + { + // For store_lcl_var, check if any op is overwritten + + GenTreeLclVarCommon* overwritten = use->AsLclVarCommon(); + unsigned overwrittenLclNum = overwritten->GetLclNum(); + if (op1->IsLocal() && op1->AsLclVarCommon()->GetLclNum() == overwrittenLclNum) + { + return 1; + } + else if (op2->IsLocal() && op2->AsLclVarCommon()->GetLclNum() == overwrittenLclNum) + { + return 2; + } + else if (op3->IsLocal() && op3->AsLclVarCommon()->GetLclNum() == overwrittenLclNum) + { + return 3; + } + } + + // If no overwritten op, check if there is any last use op + // https://github.com/dotnet/runtime/issues/62215 + + if (op1->OperIs(GT_LCL_VAR) && op1->IsLastUse(0)) + return 1; + else if (op2->OperIs(GT_LCL_VAR) && op2->IsLastUse(0)) + return 2; + else if (op3->OperIs(GT_LCL_VAR) && op3->IsLastUse(0)) + return 3; + + return 0; +} +#endif // TARGET_XARCH && FEATURE_HW_INTRINSICS + #ifdef TARGET_ARM //------------------------------------------------------------------------ // IsOffsetMisaligned: check if the field needs a special handling on arm. diff --git a/src/coreclr/jit/gentree.h b/src/coreclr/jit/gentree.h index 091c2464e69502..1a0865073982dc 100644 --- a/src/coreclr/jit/gentree.h +++ b/src/coreclr/jit/gentree.h @@ -21,13 +21,13 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #include "vartype.h" // For "var_types" #include "target.h" // For "regNumber" #include "ssaconfig.h" // For "SsaConfig::RESERVED_SSA_NUM" -#include "reglist.h" #include "valuenumtype.h" #include "jitstd.h" #include "jithashtable.h" #include "simd.h" #include "namedintrinsiclist.h" #include "layout.h" +#include "debuginfo.h" // Debugging GenTree is much easier if we add a magic virtual function to make the debugger able to figure out what type // it's got. This is enabled by default in DEBUG. To enable it in RET builds (temporarily!), you need to change the @@ -527,9 +527,10 @@ enum GenTreeFlags : unsigned int GTF_RELOP_NAN_UN = 0x80000000, // GT_ -- Is branch taken if ops are NaN? GTF_RELOP_JMP_USED = 0x40000000, // GT_ -- result of compare used for jump or ?: - GTF_RELOP_QMARK = 0x20000000, // GT_ -- the node is the condition for ?: GTF_RELOP_ZTT = 0x08000000, // GT_ -- Loop test cloned for converting while-loops into do-while // with explicit "loop test" in the header block. + GTF_RELOP_SJUMP_OPT = 0x04000000, // GT_ -- Swap signed jl/jge with js/jns during emitter, reuses flags + // from previous instruction. GTF_JCMP_EQ = 0x80000000, // GTF_JCMP_EQ -- Branch on equal rather than not equal GTF_JCMP_TST = 0x40000000, // GTF_JCMP_TST -- Use bit test instruction rather than compare against zero instruction @@ -879,6 +880,10 @@ struct GenTree // This stores the register assigned to the node. If a register is not assigned, _gtRegNum is set to REG_NA. regNumberSmall _gtRegNum; + // Count of operands. Used *only* by GenTreeMultiOp, exists solely due to padding constraints. + friend struct GenTreeMultiOp; + uint8_t m_operandCount; + public: // The register number is stored in a small format (8 bits), but the getters return and the setters take // a full-size (unsigned) format, to localize the casts here. @@ -1090,11 +1095,6 @@ struct GenTree // NOPs may only be present in LIR if they do not produce a value. return IsNothingNode(); - case GT_LIST: - // LIST nodes may not be present in a block's LIR sequence, but they may - // be present as children of an LIR node. - return (gtNext == nullptr) && (gtPrev == nullptr); - case GT_ADDR: { // ADDR ndoes may only be present in LIR if the location they refer to is not a @@ -1620,6 +1620,16 @@ struct GenTree OperIsStoreBlk(gtOper) || OperIsAtomicOp(gtOper)); } + static bool OperIsMultiOp(genTreeOps gtOper) + { + return OperIsSIMD(gtOper) || OperIsHWIntrinsic(gtOper); + } + + bool OperIsMultiOp() const + { + return OperIsMultiOp(OperGet()); + } + // This is here for cleaner FEATURE_SIMD #ifdefs. static bool OperIsSIMD(genTreeOps gtOper) { @@ -1703,16 +1713,13 @@ struct GenTree #ifdef DEBUG bool NullOp1Legal() const { - assert(OperIsSimple(gtOper)); + assert(OperIsSimple()); switch (gtOper) { case GT_LEA: case GT_RETFILT: case GT_NOP: case GT_FIELD: -#ifdef FEATURE_HW_INTRINSICS - case GT_HWINTRINSIC: -#endif // FEATURE_HW_INTRINSICS return true; case GT_RETURN: return gtType == TYP_VOID; @@ -1730,17 +1737,8 @@ struct GenTree } switch (gtOper) { - case GT_LIST: case GT_INTRINSIC: case GT_LEA: -#ifdef FEATURE_SIMD - case GT_SIMD: -#endif // !FEATURE_SIMD - -#ifdef FEATURE_HW_INTRINSICS - case GT_HWINTRINSIC: -#endif // FEATURE_HW_INTRINSICS - #if defined(TARGET_ARM) case GT_PUTARG_REG: #endif // defined(TARGET_ARM) @@ -1762,52 +1760,29 @@ struct GenTree inline bool IsBoxedValue(); - static bool OperIsList(genTreeOps gtOper) - { - return gtOper == GT_LIST; - } - - bool OperIsList() const - { - return OperIsList(gtOper); - } - - static bool OperIsAnyList(genTreeOps gtOper) - { - return OperIsList(gtOper); - } - - bool OperIsAnyList() const - { - return OperIsAnyList(gtOper); - } - inline GenTree* gtGetOp1() const; // Directly return op2. Asserts the node is binary. Might return nullptr if the binary node allows - // a nullptr op2, such as GT_LIST. This is more efficient than gtGetOp2IfPresent() if you know what + // a nullptr op2, such as GT_LEA. This is more efficient than gtGetOp2IfPresent() if you know what // node type you have. inline GenTree* gtGetOp2() const; // The returned pointer might be nullptr if the node is not binary, or if non-null op2 is not required. inline GenTree* gtGetOp2IfPresent() const; - // Given a tree node, if this is a child of that node, return the pointer to the child node so that it - // can be modified; otherwise, return null. - GenTree** gtGetChildPointer(GenTree* parent) const; + bool TryGetUse(GenTree* operand, GenTree*** pUse); - // Given a tree node, if this node uses that node, return the use as an out parameter and return true. - // Otherwise, return false. - bool TryGetUse(GenTree* def, GenTree*** use); + bool TryGetUse(GenTree* operand) + { + GenTree** unusedUse = nullptr; + return TryGetUse(operand, &unusedUse); + } private: - bool TryGetUseList(GenTree* def, GenTree*** use); - - bool TryGetUseBinOp(GenTree* def, GenTree*** use); + bool TryGetUseBinOp(GenTree* operand, GenTree*** pUse); public: - // Get the parent of this node, and optionally capture the pointer to the child so that it can be modified. - GenTree* gtGetParent(GenTree*** parentChildPtrPtr) const; + GenTree* gtGetParent(GenTree*** pUse); void ReplaceOperand(GenTree** useEdge, GenTree* replacement); @@ -2104,6 +2079,16 @@ struct GenTree return (gtFlags & GTF_REVERSE_OPS) ? true : false; } + void SetReverseOp() + { + gtFlags |= GTF_REVERSE_OPS; + } + + void ClearReverseOp() + { + gtFlags &= ~GTF_REVERSE_OPS; + } + bool IsUnsigned() const { return ((gtFlags & GTF_UNSIGNED) != 0); @@ -2251,12 +2236,6 @@ struct GenTree { } - // Returns the number of children of the current node. - unsigned NumChildren(); - - // Requires "childNum < NumChildren()". Returns the "n"th child of "this." - GenTree* GetChild(unsigned childNum); - // Returns an iterator that will produce the use edge to each operand of this node. Differs // from the sequence of nodes produced by a loop over `GetChild` in its handling of call, phi, // and block op nodes. @@ -2265,13 +2244,11 @@ struct GenTree IteratorPair UseEdges(); - // Returns an iterator that will produce each operand of this node. Differs from the sequence - // of nodes produced by a loop over `GetChild` in its handling of call, phi, and block op - // nodes. + // Returns an iterator that will produce each operand of this node, in execution order. GenTreeOperandIterator OperandsBegin(); GenTreeOperandIterator OperandsEnd(); - // Returns a range that will produce the operands of this node in use order. + // Returns a range that will produce the operands of this node in execution order. IteratorPair Operands(); enum class VisitResult @@ -2301,9 +2278,6 @@ struct GenTree void VisitOperands(TVisitor visitor); private: - template - VisitResult VisitListOperands(TVisitor visitor); - template void VisitBinOpOperands(TVisitor visitor); @@ -2786,10 +2760,6 @@ struct GenTreeFieldList : public GenTree // GenTreeUseEdgeIterator: an iterator that will produce each use edge of a GenTree node in the order in which // they are used. // -// The use edges of a node may not correspond exactly to the nodes on the other ends of its use edges: in -// particular, GT_LIST nodes are expanded into their component parts. This differs from the behavior of -// GenTree::GetChildPointer(), which does not expand lists. -// // Operand iteration is common enough in the back end of the compiler that the implementation of this type has // traded some simplicity for speed: // - As much work as is reasonable is done in the constructor rather than during operand iteration @@ -2822,7 +2792,8 @@ class GenTreeUseEdgeIterator final AdvanceFn m_advance; GenTree* m_node; GenTree** m_edge; - // Pointer sized state storage, GenTreeArgList* or GenTreePhi::Use* or GenTreeCall::Use* currently. + // Pointer sized state storage, GenTreePhi::Use* or GenTreeCall::Use* + // or the exclusive end/beginning of GenTreeMultiOp's operand array. void* m_statePtr; // Integer sized state storage, usually the operand index for non-list based nodes. int m_state; @@ -2842,14 +2813,16 @@ class GenTreeUseEdgeIterator final void AdvanceBinOp(); void SetEntryStateForBinOp(); - // An advance function for list-like nodes (Phi, SIMDIntrinsicInitN, FieldList) - void AdvanceList(); - void SetEntryStateForList(GenTreeArgList* list); - // The advance function for call nodes template void AdvanceCall(); +#if defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) + void AdvanceMultiOp(); + void AdvanceReversedMultiOp(); + void SetEntryStateForMultiOp(); +#endif + void Terminate(); public: @@ -2890,8 +2863,7 @@ class GenTreeUseEdgeIterator final // GenTreeOperandIterator: an iterator that will produce each operand of a // GenTree node in the order in which they are // used. This uses `GenTreeUseEdgeIterator` under -// the covers and comes with the same caveats -// w.r.t. `GetChild`. +// the covers. // // Note: valid values of this type may be obtained by calling // `GenTree::OperandsBegin` and `GenTree::OperandsEnd`. @@ -3027,6 +2999,13 @@ struct GenTreeOp : public GenTreeUnOp { } #endif + + // True if this relop is marked for a transform during the emitter + // phase, e.g., jge => jns + bool MarkedForSignJumpOpt() const + { + return (gtFlags & GTF_RELOP_SJUMP_OPT) != 0; + } }; struct GenTreeVal : public GenTree @@ -3724,54 +3703,6 @@ struct GenTreeField : public GenTreeUnOp } }; -// Represents the Argument list of a call node, as a Lisp-style linked list. -// (Originally I had hoped that this could have *only* the m_arg/m_rest fields, but it turns out -// that enough of the GenTree mechanism is used that it makes sense just to make it a subtype. But -// note that in many ways, this is *not* a "real" node of the tree, but rather a mechanism for -// giving call nodes a flexible number of children. GenTreeArgListNodes never evaluate to registers, -// for example.) - -// Note that while this extends GenTreeOp, it is *not* an EXOP. We don't add any new fields, and one -// is free to allocate a GenTreeOp of type GT_LIST. If you use this type, you get the convenient Current/Rest -// method names for the arguments. -struct GenTreeArgList : public GenTreeOp -{ - GenTree*& Current() - { - return gtOp1; - } - GenTreeArgList*& Rest() - { - assert(gtOp2 == nullptr || gtOp2->OperIsAnyList()); - return *reinterpret_cast(>Op2); - } - -#if DEBUGGABLE_GENTREE - GenTreeArgList() : GenTreeOp() - { - } -#endif - - GenTreeArgList(GenTree* arg) : GenTreeArgList(arg, nullptr) - { - } - - GenTreeArgList(GenTree* arg, GenTreeArgList* rest) : GenTreeArgList(GT_LIST, arg, rest) - { - } - - GenTreeArgList(genTreeOps oper, GenTree* arg, GenTreeArgList* rest) : GenTreeOp(oper, TYP_VOID, arg, rest) - { - assert(OperIsAnyList(oper)); - assert((arg != nullptr) && arg->IsValidCallArgument()); - gtFlags |= arg->gtFlags & GTF_ALL_EFFECT; - if (rest != nullptr) - { - gtFlags |= rest->gtFlags & GTF_ALL_EFFECT; - } - } -}; - // There was quite a bit of confusion in the code base about which of gtOp1 and gtOp2 was the // 'then' and 'else' clause of a colon node. Adding these accessors, while not enforcing anything, // at least *allows* the programmer to be obviously correct. @@ -4244,11 +4175,6 @@ struct GenTreeCall final : public GenTree return UseList(gtCallLateArgs); } -#if !FEATURE_FIXED_OUT_ARGS - int regArgListCount; - regList regArgList; -#endif - #ifdef DEBUG // Used to register callsites with the EE CORINFO_SIG_INFO* callSig; @@ -4866,6 +4792,11 @@ struct GenTreeCall final : public GenTree // IL offset of the call wrt its parent method. IL_OFFSET gtRawILOffset; + + // In DEBUG we report even non inline candidates in the inline tree in + // fgNoteNonInlineCandidate. We need to keep around the inline context for + // this as normally it's part of the candidate info. + class InlineContext* gtInlineContext; #endif // defined(DEBUG) || defined(INLINE_DATA) bool IsHelperCall() const @@ -5116,18 +5047,243 @@ struct GenTreeIntrinsic : public GenTreeOp #endif }; -struct GenTreeJitIntrinsic : public GenTreeOp +// GenTreeMultiOp - a node with a flexible count of operands stored in an array. +// The array can be an inline one, or a dynamic one, or both, with switching +// between them supported. See GenTreeJitIntrinsic for an example of a node +// utilizing GenTreeMultiOp. GTF_REVERSE_OPS is supported for GenTreeMultiOp's +// with two operands. +// +struct GenTreeMultiOp : public GenTree { +public: + class Iterator + { + protected: + GenTree** m_use; + + Iterator(GenTree** use) : m_use(use) + { + } + + public: + Iterator& operator++() + { + m_use++; + return *this; + } + + bool operator==(const Iterator& other) const + { + return m_use == other.m_use; + } + + bool operator!=(const Iterator& other) const + { + return m_use != other.m_use; + } + }; + + class OperandsIterator final : public Iterator + { + public: + OperandsIterator(GenTree** use) : Iterator(use) + { + } + + GenTree* operator*() + { + return *m_use; + } + }; + + class UseEdgesIterator final : public Iterator + { + public: + UseEdgesIterator(GenTree** use) : Iterator(use) + { + } + + GenTree** operator*() + { + return m_use; + } + }; + private: - ClassLayout* gtLayout; + GenTree** m_operands; - unsigned char gtAuxiliaryJitType; // For intrinsics than need another type (e.g. Avx2.Gather* or SIMD (by element)) - regNumberSmall gtOtherReg; // For intrinsics that return 2 registers +protected: + template + GenTreeMultiOp(genTreeOps oper, + var_types type, + CompAllocator allocator, + GenTree* (&inlineOperands)[InlineOperandCount] DEBUGARG(bool largeNode), + Operands... operands) + : GenTree(oper, type DEBUGARG(largeNode)) + { + const size_t OperandCount = sizeof...(Operands); - unsigned char gtSimdBaseJitType; // SIMD vector base JIT type - unsigned char gtSimdSize; // SIMD vector size in bytes, use 0 for scalar intrinsics + m_operands = (OperandCount <= InlineOperandCount) ? inlineOperands : allocator.allocate(OperandCount); + + // "OperandCount + 1" so that it works well when OperandCount is 0. + GenTree* operandsArray[OperandCount + 1]{operands...}; + InitializeOperands(operandsArray, OperandCount); + } + + // Note that this constructor takes the owndership of the "operands" array. + template + GenTreeMultiOp(genTreeOps oper, + var_types type, + GenTree** operands, + size_t operandCount, + GenTree* (&inlineOperands)[InlineOperandCount] DEBUGARG(bool largeNode)) + : GenTree(oper, type DEBUGARG(largeNode)) + { + m_operands = (operandCount <= InlineOperandCount) ? inlineOperands : operands; + + InitializeOperands(operands, operandCount); + } public: +#if DEBUGGABLE_GENTREE + GenTreeMultiOp() : GenTree() + { + } +#endif + + GenTree*& Op(size_t index) + { + size_t actualIndex = index - 1; + assert(actualIndex < m_operandCount); + assert(m_operands[actualIndex] != nullptr); + + return m_operands[actualIndex]; + } + + GenTree* Op(size_t index) const + { + return const_cast(this)->Op(index); + } + + // Note that unlike the general "Operands" iterator, this specialized version does not respect GTF_REVERSE_OPS. + IteratorPair Operands() + { + return MakeIteratorPair(OperandsIterator(GetOperandArray()), + OperandsIterator(GetOperandArray() + GetOperandCount())); + } + + // Note that unlike the general "UseEdges" iterator, this specialized version does not respect GTF_REVERSE_OPS. + IteratorPair UseEdges() + { + return MakeIteratorPair(UseEdgesIterator(GetOperandArray()), + UseEdgesIterator(GetOperandArray() + GetOperandCount())); + } + + size_t GetOperandCount() const + { + return m_operandCount; + } + + GenTree** GetOperandArray(size_t startIndex = 0) const + { + return m_operands + startIndex; + } + +protected: + // Reconfigures the operand array, leaving it in a "dirty" state. + void ResetOperandArray(size_t newOperandCount, + Compiler* compiler, + GenTree** inlineOperands, + size_t inlineOperandCount); + + static bool OperandsAreEqual(GenTreeMultiOp* op1, GenTreeMultiOp* op2); + +private: + void InitializeOperands(GenTree** operands, size_t operandCount); + + void SetOperandCount(size_t newOperandCount) + { + assert(FitsIn(newOperandCount)); + m_operandCount = static_cast(newOperandCount); + } +}; + +// Helper class used to implement the constructor of GenTreeJitIntrinsic which +// transfers the ownership of the passed-in array to the underlying MultiOp node. +class IntrinsicNodeBuilder final +{ + friend struct GenTreeJitIntrinsic; + + GenTree** m_operands; + size_t m_operandCount; + GenTree* m_inlineOperands[2]; + +public: + IntrinsicNodeBuilder(CompAllocator allocator, size_t operandCount) : m_operandCount(operandCount) + { + m_operands = + (operandCount <= ArrLen(m_inlineOperands)) ? m_inlineOperands : allocator.allocate(operandCount); +#ifdef DEBUG + for (size_t i = 0; i < operandCount; i++) + { + m_operands[i] = nullptr; + } +#endif // DEBUG + } + + IntrinsicNodeBuilder(CompAllocator allocator, GenTreeMultiOp* source) : m_operandCount(source->GetOperandCount()) + { + m_operands = (m_operandCount <= ArrLen(m_inlineOperands)) ? m_inlineOperands + : allocator.allocate(m_operandCount); + for (size_t i = 0; i < m_operandCount; i++) + { + m_operands[i] = source->Op(i + 1); + } + } + + void AddOperand(size_t index, GenTree* operand) + { + assert(index < m_operandCount); + assert(m_operands[index] == nullptr); + m_operands[index] = operand; + } + + GenTree* GetOperand(size_t index) const + { + assert(index < m_operandCount); + assert(m_operands[index] != nullptr); + return m_operands[index]; + } + + size_t GetOperandCount() const + { + return m_operandCount; + } + +private: + GenTree** GetBuiltOperands() + { +#ifdef DEBUG + for (size_t i = 0; i < m_operandCount; i++) + { + assert(m_operands[i] != nullptr); + } +#endif // DEBUG + + return m_operands; + } +}; + +struct GenTreeJitIntrinsic : public GenTreeMultiOp +{ +protected: + GenTree* gtInlineOperands[2]; + uint16_t gtLayoutNum; + unsigned char gtAuxiliaryJitType; // For intrinsics than need another type (e.g. Avx2.Gather* or SIMD (by element)) + regNumberSmall gtOtherReg; // For intrinsics that return 2 registers + unsigned char gtSimdBaseJitType; // SIMD vector base JIT type + unsigned char gtSimdSize; // SIMD vector size in bytes, use 0 for scalar intrinsics + #if defined(FEATURE_SIMD) union { SIMDIntrinsicID gtSIMDIntrinsicID; // operation Id @@ -5137,15 +5293,16 @@ struct GenTreeJitIntrinsic : public GenTreeOp NamedIntrinsic gtHWIntrinsicId; #endif - ClassLayout* GetLayout() const +public: + unsigned GetLayoutNum() const { - return gtLayout; + return gtLayoutNum; } - void SetLayout(ClassLayout* layout) + void SetLayoutNum(unsigned layoutNum) { - assert(layout != nullptr); - gtLayout = layout; + assert(FitsIn(layoutNum)); + gtLayoutNum = static_cast(layoutNum); } regNumber GetOtherReg() const @@ -5196,10 +5353,15 @@ struct GenTreeJitIntrinsic : public GenTreeOp assert(gtSimdSize == simdSize); } - GenTreeJitIntrinsic( - genTreeOps oper, var_types type, GenTree* op1, GenTree* op2, CorInfoType simdBaseJitType, unsigned simdSize) - : GenTreeOp(oper, type, op1, op2) - , gtLayout(nullptr) + template + GenTreeJitIntrinsic(genTreeOps oper, + var_types type, + CompAllocator allocator, + CorInfoType simdBaseJitType, + unsigned simdSize, + Operands... operands) + : GenTreeMultiOp(oper, type, allocator, gtInlineOperands DEBUGARG(false), operands...) + , gtLayoutNum(0) , gtAuxiliaryJitType(CORINFO_TYPE_UNDEF) , gtOtherReg(REG_NA) , gtSimdBaseJitType((unsigned char)simdBaseJitType) @@ -5210,16 +5372,39 @@ struct GenTreeJitIntrinsic : public GenTreeOp assert(gtSimdSize == simdSize); } - bool isSIMD() const +#if DEBUGGABLE_GENTREE + GenTreeJitIntrinsic() : GenTreeMultiOp() { - return gtSimdSize != 0; } +#endif -#if DEBUGGABLE_GENTREE - GenTreeJitIntrinsic() : GenTreeOp() +protected: + GenTreeJitIntrinsic(genTreeOps oper, + var_types type, + IntrinsicNodeBuilder&& nodeBuilder, + CorInfoType simdBaseJitType, + unsigned simdSize) + : GenTreeMultiOp(oper, + type, + nodeBuilder.GetBuiltOperands(), + nodeBuilder.GetOperandCount(), + gtInlineOperands DEBUGARG(false)) + , gtLayoutNum(0) + , gtAuxiliaryJitType(CORINFO_TYPE_UNDEF) + , gtOtherReg(REG_NA) + , gtSimdBaseJitType((unsigned char)simdBaseJitType) + , gtSimdSize((unsigned char)simdSize) + , gtHWIntrinsicId(NI_Illegal) { + assert(gtSimdBaseJitType == simdBaseJitType); + assert(gtSimdSize == simdSize); + } + +public: + bool isSIMD() const + { + return gtSimdSize != 0; } -#endif }; #ifdef FEATURE_SIMD @@ -5227,63 +5412,69 @@ struct GenTreeJitIntrinsic : public GenTreeOp /* gtSIMD -- SIMD intrinsic (possibly-binary op [NULL op2 is allowed] with additional fields) */ struct GenTreeSIMD : public GenTreeJitIntrinsic { + GenTreeSIMD(var_types type, + IntrinsicNodeBuilder&& nodeBuilder, + SIMDIntrinsicID simdIntrinsicID, + CorInfoType simdBaseJitType, + unsigned simdSize) + : GenTreeJitIntrinsic(GT_SIMD, type, std::move(nodeBuilder), simdBaseJitType, simdSize) + { + gtSIMDIntrinsicID = simdIntrinsicID; + } - GenTreeSIMD( - var_types type, GenTree* op1, SIMDIntrinsicID simdIntrinsicID, CorInfoType simdBaseJitType, unsigned simdSize) - : GenTreeJitIntrinsic(GT_SIMD, type, op1, nullptr, simdBaseJitType, simdSize) + GenTreeSIMD(var_types type, + CompAllocator allocator, + GenTree* op1, + SIMDIntrinsicID simdIntrinsicID, + CorInfoType simdBaseJitType, + unsigned simdSize) + : GenTreeJitIntrinsic(GT_SIMD, type, allocator, simdBaseJitType, simdSize, op1) { gtSIMDIntrinsicID = simdIntrinsicID; } GenTreeSIMD(var_types type, + CompAllocator allocator, GenTree* op1, GenTree* op2, SIMDIntrinsicID simdIntrinsicID, CorInfoType simdBaseJitType, unsigned simdSize) - : GenTreeJitIntrinsic(GT_SIMD, type, op1, op2, simdBaseJitType, simdSize) + : GenTreeJitIntrinsic(GT_SIMD, type, allocator, simdBaseJitType, simdSize, op1, op2) { gtSIMDIntrinsicID = simdIntrinsicID; } - bool OperIsMemoryLoad() const; // Returns true for the SIMD Intrinsic instructions that have MemoryLoad semantics, - // false otherwise - #if DEBUGGABLE_GENTREE GenTreeSIMD() : GenTreeJitIntrinsic() { } #endif + + bool OperIsMemoryLoad() const; // Returns true for the SIMD Intrinsic instructions that have MemoryLoad semantics, + // false otherwise + + SIMDIntrinsicID GetSIMDIntrinsicId() const + { + return gtSIMDIntrinsicID; + } + + static bool Equals(GenTreeSIMD* op1, GenTreeSIMD* op2); }; #endif // FEATURE_SIMD #ifdef FEATURE_HW_INTRINSICS struct GenTreeHWIntrinsic : public GenTreeJitIntrinsic { - GenTreeHWIntrinsic(var_types type, - NamedIntrinsic hwIntrinsicID, - CorInfoType simdBaseJitType, - unsigned simdSize, - bool isSimdAsHWIntrinsic) - : GenTreeJitIntrinsic(GT_HWINTRINSIC, type, nullptr, nullptr, simdBaseJitType, simdSize) - { - gtHWIntrinsicId = hwIntrinsicID; - - if (isSimdAsHWIntrinsic) - { - gtFlags |= GTF_SIMDASHW_OP; - } - } - - GenTreeHWIntrinsic(var_types type, - GenTree* op1, - NamedIntrinsic hwIntrinsicID, - CorInfoType simdBaseJitType, - unsigned simdSize, - bool isSimdAsHWIntrinsic) - : GenTreeJitIntrinsic(GT_HWINTRINSIC, type, op1, nullptr, simdBaseJitType, simdSize) + GenTreeHWIntrinsic(var_types type, + IntrinsicNodeBuilder&& nodeBuilder, + NamedIntrinsic hwIntrinsicID, + CorInfoType simdBaseJitType, + unsigned simdSize, + bool isSimdAsHWIntrinsic) + : GenTreeJitIntrinsic(GT_HWINTRINSIC, type, std::move(nodeBuilder), simdBaseJitType, simdSize) { - gtHWIntrinsicId = hwIntrinsicID; + SetHWIntrinsicId(hwIntrinsicID); if (OperIsMemoryStore()) { @@ -5296,18 +5487,19 @@ struct GenTreeHWIntrinsic : public GenTreeJitIntrinsic } } + template GenTreeHWIntrinsic(var_types type, - GenTree* op1, - GenTree* op2, + CompAllocator allocator, NamedIntrinsic hwIntrinsicID, CorInfoType simdBaseJitType, unsigned simdSize, - bool isSimdAsHWIntrinsic) - : GenTreeJitIntrinsic(GT_HWINTRINSIC, type, op1, op2, simdBaseJitType, simdSize) + bool isSimdAsHWIntrinsic, + Operands... operands) + : GenTreeJitIntrinsic(GT_HWINTRINSIC, type, allocator, simdBaseJitType, simdSize, operands...) { - gtHWIntrinsicId = hwIntrinsicID; + SetHWIntrinsicId(hwIntrinsicID); - if (OperIsMemoryStore()) + if ((sizeof...(Operands) > 0) && OperIsMemoryStore()) { gtFlags |= (GTF_GLOB_REF | GTF_ASG); } @@ -5318,9 +5510,11 @@ struct GenTreeHWIntrinsic : public GenTreeJitIntrinsic } } - // Note that HW Intrinsic instructions are a sub class of GenTreeOp which only supports two operands - // However there are HW Intrinsic instructions that have 3 or even 4 operands and this is - // supported using a single op1 and using an ArgList for it: gtNewArgList(op1, op2, op3) +#if DEBUGGABLE_GENTREE + GenTreeHWIntrinsic() : GenTreeJitIntrinsic() + { + } +#endif bool OperIsMemoryLoad() const; // Returns true for the HW Intrinsic instructions that have MemoryLoad semantics, // false otherwise @@ -5328,17 +5522,100 @@ struct GenTreeHWIntrinsic : public GenTreeJitIntrinsic // false otherwise bool OperIsMemoryLoadOrStore() const; // Returns true for the HW Intrinsic instructions that have MemoryLoad or // MemoryStore semantics, false otherwise - bool IsSimdAsHWIntrinsic() const { return (gtFlags & GTF_SIMDASHW_OP) != 0; } + unsigned GetResultOpNumForFMA(GenTree* use, GenTree* op1, GenTree* op2, GenTree* op3); -#if DEBUGGABLE_GENTREE - GenTreeHWIntrinsic() : GenTreeJitIntrinsic() + NamedIntrinsic GetHWIntrinsicId() const; + + //--------------------------------------------------------------------------------------- + // ChangeHWIntrinsicId: Change the intrinsic id for this node. + // + // This method just sets the intrinsic id, asserting that the new intrinsic + // has the same number of operands as the old one, optionally setting some of + // the new operands. Intrinsics with an unknown number of operands are exempt + // from the "do I have the same number of operands" check however, so this method must + // be used with care. Use "ResetHWIntrinsicId" if you need to fully reconfigure + // the node for a different intrinsic, with a possibly different number of operands. + // + // Arguments: + // intrinsicId - the new intrinsic id for the node + // operands - optional operands to set while changing the id + // + // Notes: + // It is the caller's responsibility to update side effect flags. + // + template + void ChangeHWIntrinsicId(NamedIntrinsic intrinsicId, Operands... operands) { + const size_t OperandCount = sizeof...(Operands); + assert(OperandCount <= GetOperandCount()); + + SetHWIntrinsicId(intrinsicId); + + GenTree* operandsArray[OperandCount + 1]{operands...}; + GenTree** operandsStore = GetOperandArray(); + + for (size_t i = 0; i < OperandCount; i++) + { + operandsStore[i] = operandsArray[i]; + } } -#endif + + //--------------------------------------------------------------------------------------- + // ResetHWIntrinsicId: Reset the intrinsic id for this node. + // + // This method resets the intrinsic id, fully reconfiguring the node. It must + // be supplied with all the operands the new node needs, and can allocate a + // new dynamic array if the operands do not fit into in an inline one, in which + // case a compiler argument is used to get the memory allocator. + // + // This method is similar to "ChangeHWIntrinsicId" but is more versatile and + // thus more expensive. Use it when you need to bash to an intrinsic id with + // a different number of operands than what the original node had, or, which + // is equivalent, when you do not know the original number of operands. + // + // Arguments: + // intrinsicId - the new intrinsic id for the node + // compiler - compiler to allocate memory with, can be "nullptr" if the + // number of new operands does not exceed the length of the + // inline array (so, there are 2 or fewer of them) + // operands - *all* operands for the new node + // + // Notes: + // It is the caller's responsibility to update side effect flags. + // + template + void ResetHWIntrinsicId(NamedIntrinsic intrinsicId, Compiler* compiler, Operands... operands) + { + const size_t NewOperandCount = sizeof...(Operands); + assert((compiler != nullptr) || (NewOperandCount <= ArrLen(gtInlineOperands))); + + ResetOperandArray(NewOperandCount, compiler, gtInlineOperands, ArrLen(gtInlineOperands)); + ChangeHWIntrinsicId(intrinsicId, operands...); + } + + void ResetHWIntrinsicId(NamedIntrinsic intrinsicId, GenTree* op1, GenTree* op2) + { + ResetHWIntrinsicId(intrinsicId, static_cast(nullptr), op1, op2); + } + + void ResetHWIntrinsicId(NamedIntrinsic intrinsicId, GenTree* op1) + { + ResetHWIntrinsicId(intrinsicId, static_cast(nullptr), op1); + } + + void ResetHWIntrinsicId(NamedIntrinsic intrinsicId) + { + ResetHWIntrinsicId(intrinsicId, static_cast(nullptr)); + } + + static bool Equals(GenTreeHWIntrinsic* op1, GenTreeHWIntrinsic* op2); + +private: + void SetHWIntrinsicId(NamedIntrinsic intrinsicId); }; #endif // FEATURE_HW_INTRINSICS @@ -6132,18 +6409,17 @@ struct GenTreeRetExpr : public GenTree #endif }; -class InlineContext; - +// In LIR there are no longer statements so debug information is inserted linearly using these nodes. struct GenTreeILOffset : public GenTree { - IL_OFFSETX gtStmtILoffsx; // instr offset (if available) + DebugInfo gtStmtDI; // debug info #ifdef DEBUG IL_OFFSET gtStmtLastILoffs; // instr offset at end of stmt #endif - GenTreeILOffset(IL_OFFSETX offset DEBUGARG(IL_OFFSET lastOffset = BAD_IL_OFFSET)) + GenTreeILOffset(const DebugInfo& di DEBUGARG(IL_OFFSET lastOffset = BAD_IL_OFFSET)) : GenTree(GT_IL_OFFSET, TYP_VOID) - , gtStmtILoffsx(offset) + , gtStmtDI(di) #ifdef DEBUG , gtStmtLastILoffs(lastOffset) #endif @@ -6216,13 +6492,11 @@ class GenTreeList struct Statement { public: - Statement(GenTree* expr, IL_OFFSETX offset DEBUGARG(unsigned stmtID)) + Statement(GenTree* expr DEBUGARG(unsigned stmtID)) : m_rootNode(expr) , m_treeList(nullptr) , m_next(nullptr) , m_prev(nullptr) - , m_inlineContext(nullptr) - , m_ILOffsetX(offset) #ifdef DEBUG , m_lastILOffset(BAD_IL_OFFSET) , m_stmtID(stmtID) @@ -6265,24 +6539,15 @@ struct Statement return GenTreeList(GetTreeList()); } - InlineContext* GetInlineContext() const - { - return m_inlineContext; - } - - void SetInlineContext(InlineContext* inlineContext) + const DebugInfo& GetDebugInfo() const { - m_inlineContext = inlineContext; + return m_debugInfo; } - IL_OFFSETX GetILOffsetX() const + void SetDebugInfo(const DebugInfo& di) { - return m_ILOffsetX; - } - - void SetILOffsetX(IL_OFFSETX offsetX) - { - m_ILOffsetX = offsetX; + m_debugInfo = di; + di.Validate(); } #ifdef DEBUG @@ -6363,9 +6628,7 @@ struct Statement Statement* m_next; Statement* m_prev; - InlineContext* m_inlineContext; // The inline context for this statement. - - IL_OFFSETX m_ILOffsetX; // The instr offset (if available). + DebugInfo m_debugInfo; #ifdef DEBUG IL_OFFSET m_lastILOffset; // The instr offset at the end of this statement. @@ -7164,7 +7427,7 @@ struct GenCondition }; // clang-format on - assert(m_code < _countof(names)); + assert(m_code < ArrLen(names)); return names[m_code]; } @@ -7255,7 +7518,7 @@ struct GenCondition }; // clang-format on - assert(condition.m_code < _countof(reverse)); + assert(condition.m_code < ArrLen(reverse)); return GenCondition(reverse[condition.m_code]); } @@ -7272,7 +7535,7 @@ struct GenCondition }; // clang-format on - assert(condition.m_code < _countof(swap)); + assert(condition.m_code < ArrLen(swap)); return GenCondition(swap[condition.m_code]); } }; @@ -7402,11 +7665,11 @@ inline bool GenTree::IsIntegralConstVector(ssize_t constVal) const #ifdef FEATURE_SIMD // SIMDIntrinsicInit intrinsic with a const value as initializer // represents a const vector. - if ((gtOper == GT_SIMD) && (AsSIMD()->gtSIMDIntrinsicID == SIMDIntrinsicInit) && - gtGetOp1()->IsIntegralConst(constVal)) + if ((gtOper == GT_SIMD) && (AsSIMD()->GetSIMDIntrinsicId() == SIMDIntrinsicInit) && + AsSIMD()->Op(1)->IsIntegralConst(constVal)) { assert(varTypeIsIntegral(AsSIMD()->GetSimdBaseType())); - assert(gtGetOp2IfPresent() == nullptr); + assert(AsSIMD()->GetOperandCount() == 1); return true; } #endif // FEATURE_SIMD @@ -7422,34 +7685,23 @@ inline bool GenTree::IsIntegralConstVector(ssize_t constVal) const return false; } - GenTree* op1 = gtGetOp1(); - GenTree* op2 = gtGetOp2(); + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; - - if (op1 == nullptr) + if ((node->GetOperandCount() == 0) && (constVal == 0)) { - assert(op2 == nullptr); - - if (constVal == 0) - { #if defined(TARGET_XARCH) - return (intrinsicId == NI_Vector128_get_Zero) || (intrinsicId == NI_Vector256_get_Zero); + return (intrinsicId == NI_Vector128_get_Zero) || (intrinsicId == NI_Vector256_get_Zero); #elif defined(TARGET_ARM64) - return (intrinsicId == NI_Vector64_get_Zero) || (intrinsicId == NI_Vector128_get_Zero); + return (intrinsicId == NI_Vector64_get_Zero) || (intrinsicId == NI_Vector128_get_Zero); #endif // !TARGET_XARCH && !TARGET_ARM64 - } } - else if ((op2 == nullptr) && !op1->OperIsList()) + else if ((node->GetOperandCount() == 1) && node->Op(1)->IsIntegralConst(constVal)) { - if (op1->IsIntegralConst(constVal)) - { #if defined(TARGET_XARCH) - return (intrinsicId == NI_Vector128_Create) || (intrinsicId == NI_Vector256_Create); + return (intrinsicId == NI_Vector128_Create) || (intrinsicId == NI_Vector256_Create); #elif defined(TARGET_ARM64) - return (intrinsicId == NI_Vector64_Create) || (intrinsicId == NI_Vector128_Create); + return (intrinsicId == NI_Vector64_Create) || (intrinsicId == NI_Vector128_Create); #endif // !TARGET_XARCH && !TARGET_ARM64 - } } } #endif // FEATURE_HW_INTRINSICS @@ -7467,9 +7719,9 @@ inline bool GenTree::IsIntegralConstVector(ssize_t constVal) const inline bool GenTree::IsSIMDZero() const { #ifdef FEATURE_SIMD - if ((gtOper == GT_SIMD) && (AsSIMD()->gtSIMDIntrinsicID == SIMDIntrinsicInit)) + if ((gtOper == GT_SIMD) && (AsSIMD()->GetSIMDIntrinsicId() == SIMDIntrinsicInit)) { - return (gtGetOp1()->IsIntegralConst(0) || gtGetOp1()->IsFPZero()); + return (AsSIMD()->Op(1)->IsIntegralConst(0) || AsSIMD()->Op(1)->IsFPZero()); } #endif @@ -7508,10 +7760,6 @@ inline bool GenTree::IsBoxedValue() inline bool GenTree::IsValidCallArgument() { - if (OperIsList()) - { - return false; - } if (OperIs(GT_FIELD_LIST)) { #if !FEATURE_MULTIREG_ARGS && !FEATURE_PUT_STRUCT_ARG_STK @@ -7581,7 +7829,7 @@ inline GenTree* GenTree::gtGetOp2() const GenTree* op2 = AsOp()->gtOp2; - // Only allow null op2 if the node type allows it, e.g. GT_LIST. + // Only allow null op2 if the node type allows it, e.g. GT_LEA. assert((op2 != nullptr) || !RequiresNonNullOp2(gtOper)); return op2; diff --git a/src/coreclr/jit/gschecks.cpp b/src/coreclr/jit/gschecks.cpp index a8f03890899168..7765231a87551d 100644 --- a/src/coreclr/jit/gschecks.cpp +++ b/src/coreclr/jit/gschecks.cpp @@ -289,7 +289,7 @@ bool Compiler::gsFindVulnerableParams() for (UINT lclNum = 0; lclNum < lvaCount; lclNum++) { - LclVarDsc* varDsc = &lvaTable[lclNum]; + LclVarDsc* varDsc = lvaGetDesc(lclNum); ShadowParamVarInfo* shadowInfo = &gsShadowVarInfo[lclNum]; // If there was an indirection or if unsafe buffer, then we'd call it vulnerable. @@ -367,7 +367,7 @@ void Compiler::gsParamsToShadows() // Create shadow copy for each param candidate for (UINT lclNum = 0; lclNum < lvaOldCount; lclNum++) { - LclVarDsc* varDsc = &lvaTable[lclNum]; + LclVarDsc* varDsc = lvaGetDesc(lclNum); gsShadowVarInfo[lclNum].shadowCopy = NO_SHADOW_COPY; // Only care about params whose values are on the stack @@ -383,8 +383,8 @@ void Compiler::gsParamsToShadows() int shadowVarNum = lvaGrabTemp(false DEBUGARG("shadowVar")); // reload varDsc as lvaGrabTemp may realloc the lvaTable[] - varDsc = &lvaTable[lclNum]; - LclVarDsc* shadowVarDsc = &lvaTable[shadowVarNum]; + varDsc = lvaGetDesc(lclNum); + LclVarDsc* shadowVarDsc = lvaGetDesc(shadowVarNum); // Copy some info @@ -489,7 +489,7 @@ void Compiler::gsParamsToShadows() // Now insert code to copy the params to their shadow copy. for (UINT lclNum = 0; lclNum < lvaOldCount; lclNum++) { - const LclVarDsc* varDsc = &lvaTable[lclNum]; + const LclVarDsc* varDsc = lvaGetDesc(lclNum); const unsigned shadowVarNum = gsShadowVarInfo[lclNum].shadowCopy; if (shadowVarNum == NO_SHADOW_COPY) @@ -497,7 +497,7 @@ void Compiler::gsParamsToShadows() continue; } - const LclVarDsc* shadowVarDsc = &lvaTable[shadowVarNum]; + const LclVarDsc* shadowVarDsc = lvaGetDesc(shadowVarNum); var_types type = shadowVarDsc->TypeGet(); GenTree* src = gtNewLclvNode(lclNum, varDsc->TypeGet()); @@ -541,7 +541,7 @@ void Compiler::gsParamsToShadows() for (UINT lclNum = 0; lclNum < info.compArgsCount; lclNum++) { - const LclVarDsc* varDsc = &lvaTable[lclNum]; + const LclVarDsc* varDsc = lvaGetDesc(lclNum); const unsigned shadowVarNum = gsShadowVarInfo[lclNum].shadowCopy; if (shadowVarNum == NO_SHADOW_COPY) @@ -549,7 +549,7 @@ void Compiler::gsParamsToShadows() continue; } - const LclVarDsc* shadowVarDsc = &lvaTable[shadowVarNum]; + const LclVarDsc* shadowVarDsc = lvaGetDesc(shadowVarNum); GenTree* src = gtNewLclvNode(shadowVarNum, shadowVarDsc->TypeGet()); GenTree* dst = gtNewLclvNode(lclNum, varDsc->TypeGet()); diff --git a/src/coreclr/jit/gtlist.h b/src/coreclr/jit/gtlist.h index aa6f990e7e7212..f756a3b7bd4708 100644 --- a/src/coreclr/jit/gtlist.h +++ b/src/coreclr/jit/gtlist.h @@ -126,32 +126,12 @@ GTNODE(UMOD , GenTreeOp ,0,GTK_BINOP) GTNODE(OR , GenTreeOp ,1,(GTK_BINOP|GTK_LOGOP)) GTNODE(XOR , GenTreeOp ,1,(GTK_BINOP|GTK_LOGOP)) GTNODE(AND , GenTreeOp ,1,(GTK_BINOP|GTK_LOGOP)) -GTNODE(AND_NOT , GenTreeOp ,0,GTK_BINOP) GTNODE(LSH , GenTreeOp ,0,GTK_BINOP) GTNODE(RSH , GenTreeOp ,0,GTK_BINOP) GTNODE(RSZ , GenTreeOp ,0,GTK_BINOP) GTNODE(ROL , GenTreeOp ,0,GTK_BINOP) GTNODE(ROR , GenTreeOp ,0,GTK_BINOP) -GTNODE(INC_SATURATE , GenTreeOp ,0,GTK_UNOP) // saturating increment, used in division by a constant (LowerUnsignedDivOrMod) - -// Returns high bits (top N bits of the 2N bit result of an NxN multiply) -// GT_MULHI is used in division by a constant (LowerUnsignedDivOrMod). We turn -// the div into a MULHI + some adjustments. In codegen, we only use the -// results of the high register, and we drop the low results. -GTNODE(MULHI , GenTreeOp ,1,GTK_BINOP) - -// A mul that returns the 2N bit result of an NxN multiply. This op is used for -// multiplies that take two ints and return a long result. For 32 bit targets, -// all other multiplies with long results are morphed into helper calls. -// It is similar to GT_MULHI, the difference being that GT_MULHI drops the lo -// part of the result, whereas GT_MUL_LONG keeps both parts of the result. -// MUL_LONG is also used on ARM64, where 64 bit multiplication is more expensive. -#if !defined(TARGET_64BIT) -GTNODE(MUL_LONG , GenTreeMultiRegOp ,1,GTK_BINOP) -#elif defined(TARGET_ARM64) -GTNODE(MUL_LONG , GenTreeOp ,1,GTK_BINOP) -#endif GTNODE(ASG , GenTreeOp ,0,(GTK_BINOP|GTK_NOTLIR)) GTNODE(EQ , GenTreeOp ,0,(GTK_BINOP|GTK_RELOP)) @@ -213,13 +193,38 @@ GTNODE(RSH_LO , GenTreeOp ,0,GTK_BINOP) #endif // !defined(TARGET_64BIT) #ifdef FEATURE_SIMD -GTNODE(SIMD , GenTreeSIMD ,0,(GTK_BINOP|GTK_EXOP)) // SIMD functions/operators/intrinsics +GTNODE(SIMD , GenTreeSIMD ,0,GTK_SPECIAL) // SIMD functions/operators/intrinsics #endif // FEATURE_SIMD #ifdef FEATURE_HW_INTRINSICS -GTNODE(HWINTRINSIC , GenTreeHWIntrinsic ,0,(GTK_BINOP|GTK_EXOP)) // hardware intrinsics +GTNODE(HWINTRINSIC , GenTreeHWIntrinsic ,0,GTK_SPECIAL) // hardware intrinsics #endif // FEATURE_HW_INTRINSICS +//----------------------------------------------------------------------------- +// Backend-specific arithmetic nodes: +//----------------------------------------------------------------------------- + +GTNODE(INC_SATURATE , GenTreeOp ,0,GTK_UNOP) // saturating increment, used in division by a constant (LowerUnsignedDivOrMod) + +// Returns high bits (top N bits of the 2N bit result of an NxN multiply) +// GT_MULHI is used in division by a constant (LowerUnsignedDivOrMod). We turn +// the div into a MULHI + some adjustments. In codegen, we only use the +// results of the high register, and we drop the low results. +GTNODE(MULHI , GenTreeOp ,1,GTK_BINOP) + +// A mul that returns the 2N bit result of an NxN multiply. This op is used for +// multiplies that take two ints and return a long result. For 32 bit targets, +// all other multiplies with long results are morphed into helper calls. +// It is similar to GT_MULHI, the difference being that GT_MULHI drops the lo +// part of the result, whereas GT_MUL_LONG keeps both parts of the result. +// MUL_LONG is also used on ARM64, where 64 bit multiplication is more expensive. +#if !defined(TARGET_64BIT) +GTNODE(MUL_LONG , GenTreeMultiRegOp ,1,GTK_BINOP) +#elif defined(TARGET_ARM64) +GTNODE(MUL_LONG , GenTreeOp ,1,GTK_BINOP) +#endif +// AndNot - emitted on ARM/ARM64 as the BIC instruction. Also used for creating AndNot HWINTRINSIC vector nodes in a cross-ISA manner. +GTNODE(AND_NOT , GenTreeOp ,0,GTK_BINOP) //----------------------------------------------------------------------------- // LIR specific compare and conditional branch/set nodes: //----------------------------------------------------------------------------- @@ -241,8 +246,6 @@ GTNODE(BT , GenTreeOp ,0,(GTK_BINOP|GTK_NOVALUE)) // The GTNODE(JTRUE , GenTreeOp ,0,(GTK_UNOP|GTK_NOVALUE)) -GTNODE(LIST , GenTreeArgList ,0,(GTK_BINOP|GTK_NOVALUE)) - //----------------------------------------------------------------------------- // Other nodes that have special structure: //----------------------------------------------------------------------------- @@ -280,8 +283,16 @@ GTNODE(PHI_ARG , GenTreePhiArg ,0,(GTK_LEAF|GTK_LOCAL)) // phi // Nodes used by Lower to generate a closer CPU representation of other nodes //----------------------------------------------------------------------------- +#ifdef TARGET_ARM64 +GTNODE(MADD , GenTreeOp ,0, GTK_BINOP) // Generates the Multiply-Add instruction (madd/msub) + // In future, we might consider enabling it for both armarch and xarch + // for floating-point MADD "unsafe" math +#endif GTNODE(JMPTABLE , GenTree ,0, (GTK_LEAF|GTK_NOCONTAIN)) // Generates the jump table for switches GTNODE(SWITCH_TABLE , GenTreeOp ,0, (GTK_BINOP|GTK_NOVALUE)) // Jump Table based switch construct +#ifdef TARGET_ARM64 +GTNODE(BFIZ , GenTreeOp ,0, GTK_BINOP) // Bitfield Insert in Zero +#endif //----------------------------------------------------------------------------- // Nodes used only within the code generator: diff --git a/src/coreclr/jit/gtstructs.h b/src/coreclr/jit/gtstructs.h index b4bad947fd90f7..70a7901b7aca2a 100644 --- a/src/coreclr/jit/gtstructs.h +++ b/src/coreclr/jit/gtstructs.h @@ -67,7 +67,6 @@ GTSTRUCT_1(Cast , GT_CAST) GTSTRUCT_1(Box , GT_BOX) GTSTRUCT_1(Field , GT_FIELD) GTSTRUCT_1(Call , GT_CALL) -GTSTRUCT_1(ArgList , GT_LIST) GTSTRUCT_1(FieldList , GT_FIELD_LIST) GTSTRUCT_1(Colon , GT_COLON) GTSTRUCT_1(FptrVal , GT_FTN_ADDR) @@ -76,10 +75,13 @@ GTSTRUCT_1(Index , GT_INDEX) GTSTRUCT_1(IndexAddr , GT_INDEX_ADDR) #if defined(FEATURE_HW_INTRINSICS) && defined(FEATURE_SIMD) GTSTRUCT_3(BoundsChk , GT_ARR_BOUNDS_CHECK, GT_SIMD_CHK, GT_HW_INTRINSIC_CHK) +GTSTRUCT_N(MultiOp , GT_SIMD, GT_HWINTRINSIC) #elif defined(FEATURE_SIMD) GTSTRUCT_2(BoundsChk , GT_ARR_BOUNDS_CHECK, GT_SIMD_CHK) +GTSTRUCT_N(MultiOp , GT_SIMD) #elif defined(FEATURE_HW_INTRINSICS) GTSTRUCT_2(BoundsChk , GT_ARR_BOUNDS_CHECK, GT_HW_INTRINSIC_CHK) +GTSTRUCT_N(MultiOp , GT_HWINTRINSIC) #else // !FEATURE_SIMD && !FEATURE_HW_INTRINSICS GTSTRUCT_1(BoundsChk , GT_ARR_BOUNDS_CHECK) #endif // !FEATURE_SIMD && !FEATURE_HW_INTRINSICS diff --git a/src/coreclr/jit/hwintrinsic.cpp b/src/coreclr/jit/hwintrinsic.cpp index 908dac27c60ff6..70ea91dc4032c4 100644 --- a/src/coreclr/jit/hwintrinsic.cpp +++ b/src/coreclr/jit/hwintrinsic.cpp @@ -366,92 +366,6 @@ unsigned HWIntrinsicInfo::lookupSimdSize(Compiler* comp, NamedIntrinsic id, CORI return simdSize; } -//------------------------------------------------------------------------ -// lookupNumArgs: Gets the number of args for a given HWIntrinsic node -// -// Arguments: -// node -- The HWIntrinsic node to get the number of args for -// -// Return Value: -// The number of args for the HWIntrinsic associated with node -int HWIntrinsicInfo::lookupNumArgs(const GenTreeHWIntrinsic* node) -{ - assert(node != nullptr); - - NamedIntrinsic id = node->gtHWIntrinsicId; - int numArgs = lookupNumArgs(id); - - if (numArgs >= 0) - { - return numArgs; - } - - assert(numArgs == -1); - - GenTree* op1 = node->gtGetOp1(); - - if (op1 == nullptr) - { - return 0; - } - - if (op1->OperIsList()) - { - GenTreeArgList* list = op1->AsArgList(); - numArgs = 0; - - do - { - numArgs++; - list = list->Rest(); - } while (list != nullptr); - - return numArgs; - } - - GenTree* op2 = node->gtGetOp2(); - - return (op2 == nullptr) ? 1 : 2; -} - -//------------------------------------------------------------------------ -// lookupLastOp: Gets the last operand for a given HWIntrinsic node -// -// Arguments: -// node -- The HWIntrinsic node to get the last operand for -// -// Return Value: -// The last operand for node -GenTree* HWIntrinsicInfo::lookupLastOp(const GenTreeHWIntrinsic* node) -{ - assert(node != nullptr); - - GenTree* op1 = node->gtGetOp1(); - - if (op1 == nullptr) - { - return nullptr; - } - - if (op1->OperIsList()) - { - GenTreeArgList* list = op1->AsArgList(); - GenTree* last; - - do - { - last = list->Current(); - list = list->Rest(); - } while (list != nullptr); - - return last; - } - - GenTree* op2 = node->gtGetOp2(); - - return (op2 == nullptr) ? op1 : op2; -} - //------------------------------------------------------------------------ // isImmOp: Checks whether the HWIntrinsic node has an imm operand // diff --git a/src/coreclr/jit/hwintrinsic.h b/src/coreclr/jit/hwintrinsic.h index 0b35ca719b6e2f..43bd543c599f1d 100644 --- a/src/coreclr/jit/hwintrinsic.h +++ b/src/coreclr/jit/hwintrinsic.h @@ -309,8 +309,6 @@ struct HWIntrinsicInfo static CORINFO_InstructionSet lookupIsa(const char* className, const char* enclosingClassName); static unsigned lookupSimdSize(Compiler* comp, NamedIntrinsic id, CORINFO_SIG_INFO* sig); - static int lookupNumArgs(const GenTreeHWIntrinsic* node); - static GenTree* lookupLastOp(const GenTreeHWIntrinsic* node); #if defined(TARGET_XARCH) static int lookupImmUpperBound(NamedIntrinsic intrinsic); @@ -725,7 +723,7 @@ struct HWIntrinsic final { assert(node != nullptr); - id = node->gtHWIntrinsicId; + id = node->GetHWIntrinsicId(); category = HWIntrinsicInfo::lookupCategory(id); assert(HWIntrinsicInfo::RequiresCodegen(id)); @@ -749,53 +747,34 @@ struct HWIntrinsic final GenTree* op2; GenTree* op3; GenTree* op4; - int numOperands; + size_t numOperands; var_types baseType; private: void InitializeOperands(const GenTreeHWIntrinsic* node) { - op1 = node->gtGetOp1(); - op2 = node->gtGetOp2(); + numOperands = node->GetOperandCount(); - if (op1 == nullptr) + switch (numOperands) { - numOperands = 0; - } - else if (op1->OperIsList()) - { - assert(op2 == nullptr); - - GenTreeArgList* list = op1->AsArgList(); - op1 = list->Current(); - list = list->Rest(); - op2 = list->Current(); - list = list->Rest(); - op3 = list->Current(); - list = list->Rest(); - - if (list != nullptr) - { - op4 = list->Current(); - assert(list->Rest() == nullptr); + case 4: + op4 = node->Op(4); + FALLTHROUGH; + case 3: + op3 = node->Op(3); + FALLTHROUGH; + case 2: + op2 = node->Op(2); + FALLTHROUGH; + case 1: + op1 = node->Op(1); + FALLTHROUGH; + case 0: + break; - numOperands = 4; - } - else - { - numOperands = 3; - } - } - else if (op2 != nullptr) - { - numOperands = 2; - } - else - { - numOperands = 1; + default: + unreached(); } - - assert(HWIntrinsicInfo::lookupNumArgs(id) == numOperands); } void InitializeBaseType(const GenTreeHWIntrinsic* node) @@ -804,7 +783,7 @@ struct HWIntrinsic final if (baseType == TYP_UNKNOWN) { - assert(category == HW_Category_Scalar); + assert((category == HW_Category_Scalar) || (category == HW_Category_Special)); if (HWIntrinsicInfo::BaseTypeFromFirstArg(id)) { diff --git a/src/coreclr/jit/hwintrinsicarm64.cpp b/src/coreclr/jit/hwintrinsicarm64.cpp index 98795c7941f896..7fea81a34e2c12 100644 --- a/src/coreclr/jit/hwintrinsicarm64.cpp +++ b/src/coreclr/jit/hwintrinsicarm64.cpp @@ -308,9 +308,8 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, var_types retType, unsigned simdSize) { - HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(intrinsic); - int numArgs = sig->numArgs; - var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType); + HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(intrinsic); + int numArgs = sig->numArgs; if (!featureSIMD || !IsBaselineSimdIsaSupported()) { @@ -318,7 +317,14 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, } assert(numArgs >= 0); - assert(varTypeIsArithmetic(simdBaseType)); + + var_types simdBaseType = TYP_UNKNOWN; + + if (intrinsic != NI_ArmBase_Yield) + { + simdBaseType = JitType2PreciseVarType(simdBaseJitType); + assert(varTypeIsArithmetic(simdBaseType)); + } GenTree* retNode = nullptr; GenTree* op1 = nullptr; @@ -327,6 +333,16 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, switch (intrinsic) { + case NI_ArmBase_Yield: + { + assert(sig->numArgs == 0); + assert(JITtype2varType(sig->retType) == TYP_VOID); + assert(simdSize == 0); + + retNode = gtNewScalarHWIntrinsicNode(TYP_VOID, intrinsic); + break; + } + case NI_Vector64_Abs: case NI_Vector128_Abs: { @@ -482,31 +498,14 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, // We shouldn't handle this as an intrinsic if the // respective ISAs have been disabled by the user. - if (sig->numArgs == 1) - { - op1 = impPopStack().val; - retNode = gtNewSimdHWIntrinsicNode(retType, op1, intrinsic, simdBaseJitType, simdSize); - } - else if (sig->numArgs == 2) + IntrinsicNodeBuilder nodeBuilder(getAllocator(CMK_ASTNode), sig->numArgs); + + for (int i = sig->numArgs - 1; i >= 0; i--) { - op2 = impPopStack().val; - op1 = impPopStack().val; - retNode = gtNewSimdHWIntrinsicNode(retType, op1, op2, intrinsic, simdBaseJitType, simdSize); + nodeBuilder.AddOperand(i, impPopStack().val); } - else - { - assert(sig->numArgs >= 3); - - GenTreeArgList* tmp = nullptr; - for (unsigned i = 0; i < sig->numArgs; i++) - { - tmp = gtNewListNode(impPopStack().val, tmp); - } - - op1 = tmp; - retNode = gtNewSimdHWIntrinsicNode(retType, op1, intrinsic, simdBaseJitType, simdSize); - } + retNode = gtNewSimdHWIntrinsicNode(retType, std::move(nodeBuilder), intrinsic, simdBaseJitType, simdSize); break; } @@ -821,7 +820,12 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, case NI_Vector128_Narrow: { assert(sig->numArgs == 2); - // TODO-ARM64-CQ: These intrinsics should be accelerated. + + op2 = impSIMDPopStack(retType); + op1 = impSIMDPopStack(retType); + + retNode = + gtNewSimdNarrowNode(retType, op1, op2, simdBaseJitType, simdSize, /* isSimdAsHWIntrinsic */ false); break; } @@ -899,6 +903,28 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } + case NI_Vector64_WidenLower: + case NI_Vector128_WidenLower: + { + assert(sig->numArgs == 1); + + op1 = impSIMDPopStack(retType); + + retNode = gtNewSimdWidenLowerNode(retType, op1, simdBaseJitType, simdSize, /* isSimdAsHWIntrinsic */ false); + break; + } + + case NI_Vector64_WidenUpper: + case NI_Vector128_WidenUpper: + { + assert(sig->numArgs == 1); + + op1 = impSIMDPopStack(retType); + + retNode = gtNewSimdWidenUpperNode(retType, op1, simdBaseJitType, simdSize, /* isSimdAsHWIntrinsic */ false); + break; + } + case NI_Vector64_WithElement: case NI_Vector128_WithElement: { diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index 3352c9ba595710..706b988f049e51 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -51,7 +51,7 @@ CodeGen::HWIntrinsicImmOpHelper::HWIntrinsicImmOpHelper(CodeGen* codeGen, GenTre } else { - const HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(intrin->gtHWIntrinsicId); + const HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(intrin->GetHWIntrinsicId()); if (category == HW_Category_SIMDByIndexedElement) { @@ -71,13 +71,13 @@ CodeGen::HWIntrinsicImmOpHelper::HWIntrinsicImmOpHelper(CodeGen* codeGen, GenTre assert(varTypeIsSIMD(indexedElementOpType)); const unsigned int indexedElementSimdSize = genTypeSize(indexedElementOpType); - HWIntrinsicInfo::lookupImmBounds(intrin->gtHWIntrinsicId, indexedElementSimdSize, intrin->GetSimdBaseType(), - &immLowerBound, &immUpperBound); + HWIntrinsicInfo::lookupImmBounds(intrin->GetHWIntrinsicId(), indexedElementSimdSize, + intrin->GetSimdBaseType(), &immLowerBound, &immUpperBound); } else { - HWIntrinsicInfo::lookupImmBounds(intrin->gtHWIntrinsicId, intrin->GetSimdSize(), intrin->GetSimdBaseType(), - &immLowerBound, &immUpperBound); + HWIntrinsicInfo::lookupImmBounds(intrin->GetHWIntrinsicId(), intrin->GetSimdSize(), + intrin->GetSimdBaseType(), &immLowerBound, &immUpperBound); } nonConstImmReg = immOp->GetRegNum(); @@ -95,7 +95,7 @@ CodeGen::HWIntrinsicImmOpHelper::HWIntrinsicImmOpHelper(CodeGen* codeGen, GenTre // these by // using the same approach as in hwintrinsicxarch.cpp - adding an additional indirection level in form of a // branch table. - assert(!HWIntrinsicInfo::GeneratesMultipleIns(intrin->gtHWIntrinsicId)); + assert(!HWIntrinsicInfo::GeneratesMultipleIns(intrin->GetHWIntrinsicId())); branchTargetReg = intrin->GetSingleTempReg(); } @@ -255,6 +255,13 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) emitSize = emitActualTypeSize(intrin.baseType); opt = INS_OPTS_NONE; } + else if (intrin.category == HW_Category_Special) + { + assert(intrin.id == NI_ArmBase_Yield); + + emitSize = EA_UNKNOWN; + opt = INS_OPTS_NONE; + } else { emitSize = emitActualTypeSize(Compiler::getSIMDTypeForSize(node->GetSimdSize())); @@ -264,7 +271,7 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) const bool isRMW = node->isRMWHWIntrinsic(compiler); const bool hasImmediateOperand = HWIntrinsicInfo::HasImmediateOperand(intrin.id); - genConsumeHWIntrinsicOperands(node); + genConsumeMultiOpOperands(node); if (intrin.IsTableDriven()) { @@ -443,6 +450,12 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) } break; + case NI_ArmBase_Yield: + { + ins = INS_yield; + break; + } + default: ins = HWIntrinsicInfo::lookupIns(intrin.id, intrin.baseType); break; @@ -735,6 +748,12 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) } break; + case NI_ArmBase_Yield: + { + GetEmitter()->emitIns(ins); + break; + } + // mvni doesn't support the range of element types, so hard code the 'opts' value. case NI_Vector64_get_Zero: case NI_Vector64_get_AllBitsSet: diff --git a/src/coreclr/jit/hwintrinsiccodegenxarch.cpp b/src/coreclr/jit/hwintrinsiccodegenxarch.cpp index 8523b529cbec42..bb6a6daa815d8b 100644 --- a/src/coreclr/jit/hwintrinsiccodegenxarch.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenxarch.cpp @@ -78,10 +78,10 @@ static bool genIsTableDrivenHWIntrinsic(NamedIntrinsic intrinsicId, HWIntrinsicC // void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) { - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); CORINFO_InstructionSet isa = HWIntrinsicInfo::lookupIsa(intrinsicId); HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(intrinsicId); - int numArgs = HWIntrinsicInfo::lookupNumArgs(node); + size_t numArgs = node->GetOperandCount(); int ival = HWIntrinsicInfo::lookupIval(intrinsicId, compiler->compOpportunisticallyDependsOn(InstructionSet_AVX)); @@ -89,11 +89,13 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) if (genIsTableDrivenHWIntrinsic(intrinsicId, category)) { - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); regNumber targetReg = node->GetRegNum(); var_types baseType = node->GetSimdBaseType(); + GenTree* op1 = nullptr; + GenTree* op2 = nullptr; + GenTree* op3 = nullptr; + regNumber op1Reg = REG_NA; regNumber op2Reg = REG_NA; emitter* emit = GetEmitter(); @@ -109,6 +111,8 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) { case 1: { + op1 = node->Op(1); + if (node->OperIsMemoryLoad()) { genConsumeAddress(op1); @@ -150,6 +154,9 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) case 2: { + op1 = node->Op(1); + op2 = node->Op(2); + if (category == HW_Category_MemoryStore) { genConsumeAddress(op1); @@ -158,13 +165,13 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) { GenTreeHWIntrinsic* extract = op2->AsHWIntrinsic(); - assert((extract->gtHWIntrinsicId == NI_AVX_ExtractVector128) || - (extract->gtHWIntrinsicId == NI_AVX2_ExtractVector128)); + assert((extract->GetHWIntrinsicId() == NI_AVX_ExtractVector128) || + (extract->GetHWIntrinsicId() == NI_AVX2_ExtractVector128)); - regNumber regData = genConsumeReg(extract->gtGetOp1()); + regNumber regData = genConsumeReg(extract->Op(1)); - ins = HWIntrinsicInfo::lookupIns(extract->gtHWIntrinsicId, extract->GetSimdBaseType()); - ival = static_cast(extract->gtGetOp2()->AsIntCon()->IconValue()); + ins = HWIntrinsicInfo::lookupIns(extract->GetHWIntrinsicId(), extract->GetSimdBaseType()); + ival = static_cast(extract->Op(2)->AsIntCon()->IconValue()); GenTreeIndir indir = indirForm(TYP_SIMD16, op1); emit->emitIns_A_R_I(ins, EA_32BYTE, &indir, regData, ival); @@ -258,18 +265,16 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) case 3: { - GenTreeArgList* argList = op1->AsArgList(); - op1 = argList->Current(); + op1 = node->Op(1); + op2 = node->Op(2); + op3 = node->Op(3); + genConsumeRegs(op1); op1Reg = op1->GetRegNum(); - argList = argList->Rest(); - op2 = argList->Current(); genConsumeRegs(op2); op2Reg = op2->GetRegNum(); - argList = argList->Rest(); - GenTree* op3 = argList->Current(); genConsumeRegs(op3); regNumber op3Reg = op3->GetRegNum(); @@ -432,7 +437,7 @@ void CodeGen::genHWIntrinsic_R_RM( if (rmOp->isContained() || rmOp->isUsedFromSpillTemp()) { - assert(HWIntrinsicInfo::SupportsContainment(node->gtHWIntrinsicId)); + assert(HWIntrinsicInfo::SupportsContainment(node->GetHWIntrinsicId())); assertIsContainableHWIntrinsicOp(compiler->m_pLowering, node, rmOp); TempDsc* tmpDsc = nullptr; @@ -462,8 +467,8 @@ void CodeGen::genHWIntrinsic_R_RM( else { assert(rmOp->AsHWIntrinsic()->OperIsMemoryLoad()); - assert(HWIntrinsicInfo::lookupNumArgs(rmOp->AsHWIntrinsic()) == 1); - addr = rmOp->gtGetOp1(); + assert(rmOp->AsHWIntrinsic()->GetOperandCount() == 1); + addr = rmOp->AsHWIntrinsic()->Op(1); } switch (addr->OperGet()) @@ -554,7 +559,7 @@ void CodeGen::genHWIntrinsic_R_RM( void CodeGen::genHWIntrinsic_R_RM_I(GenTreeHWIntrinsic* node, instruction ins, emitAttr simdSize, int8_t ival) { regNumber targetReg = node->GetRegNum(); - GenTree* op1 = node->gtGetOp1(); + GenTree* op1 = node->Op(1); // TODO-XArch-CQ: Commutative operations can have op1 be contained // TODO-XArch-CQ: Non-VEX encoded instructions can have both ops contained @@ -564,7 +569,7 @@ void CodeGen::genHWIntrinsic_R_RM_I(GenTreeHWIntrinsic* node, instruction ins, e if (op1->isContained() || op1->isUsedFromSpillTemp()) { - assert(HWIntrinsicInfo::SupportsContainment(node->gtHWIntrinsicId)); + assert(HWIntrinsicInfo::SupportsContainment(node->GetHWIntrinsicId())); assertIsContainableHWIntrinsicOp(compiler->m_pLowering, node, op1); } inst_RV_TT_IV(ins, simdSize, targetReg, op1, ival); @@ -582,8 +587,8 @@ void CodeGen::genHWIntrinsic_R_RM_I(GenTreeHWIntrinsic* node, instruction ins, e void CodeGen::genHWIntrinsic_R_R_RM(GenTreeHWIntrinsic* node, instruction ins, emitAttr attr) { regNumber targetReg = node->GetRegNum(); - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); + GenTree* op1 = node->Op(1); + GenTree* op2 = node->Op(2); regNumber op1Reg = op1->GetRegNum(); assert(targetReg != REG_NA); @@ -612,7 +617,7 @@ void CodeGen::genHWIntrinsic_R_R_RM( if (op2->isContained() || op2->isUsedFromSpillTemp()) { - assert(HWIntrinsicInfo::SupportsContainment(node->gtHWIntrinsicId)); + assert(HWIntrinsicInfo::SupportsContainment(node->GetHWIntrinsicId())); assertIsContainableHWIntrinsicOp(compiler->m_pLowering, node, op2); } @@ -632,29 +637,13 @@ void CodeGen::genHWIntrinsic_R_R_RM( void CodeGen::genHWIntrinsic_R_R_RM_I(GenTreeHWIntrinsic* node, instruction ins, emitAttr simdSize, int8_t ival) { regNumber targetReg = node->GetRegNum(); - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); + GenTree* op1 = node->Op(1); + GenTree* op2 = node->Op(2); emitter* emit = GetEmitter(); // TODO-XArch-CQ: Commutative operations can have op1 be contained // TODO-XArch-CQ: Non-VEX encoded instructions can have both ops contained - if (op1->OperIsList()) - { - assert(op2 == nullptr); - - GenTreeArgList* argList = op1->AsArgList(); - - op1 = argList->Current(); - argList = argList->Rest(); - - op2 = argList->Current(); - argList = argList->Rest(); - - assert(argList->Current() != nullptr); - assert(argList->Rest() == nullptr); - } - regNumber op1Reg = op1->GetRegNum(); assert(targetReg != REG_NA); @@ -662,7 +651,7 @@ void CodeGen::genHWIntrinsic_R_R_RM_I(GenTreeHWIntrinsic* node, instruction ins, if (op2->isContained() || op2->isUsedFromSpillTemp()) { - assert(HWIntrinsicInfo::SupportsContainment(node->gtHWIntrinsicId)); + assert(HWIntrinsicInfo::SupportsContainment(node->GetHWIntrinsicId())); assertIsContainableHWIntrinsicOp(compiler->m_pLowering, node, op2); TempDsc* tmpDsc = nullptr; @@ -692,8 +681,8 @@ void CodeGen::genHWIntrinsic_R_R_RM_I(GenTreeHWIntrinsic* node, instruction ins, else { assert(op2->AsHWIntrinsic()->OperIsMemoryLoad()); - assert(HWIntrinsicInfo::lookupNumArgs(op2->AsHWIntrinsic()) == 1); - addr = op2->gtGetOp1(); + assert(op2->AsHWIntrinsic()->GetOperandCount() == 1); + addr = op2->AsHWIntrinsic()->Op(1); } switch (addr->OperGet()) @@ -795,25 +784,11 @@ void CodeGen::genHWIntrinsic_R_R_RM_I(GenTreeHWIntrinsic* node, instruction ins, void CodeGen::genHWIntrinsic_R_R_RM_R(GenTreeHWIntrinsic* node, instruction ins, emitAttr simdSize) { regNumber targetReg = node->GetRegNum(); - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); - GenTree* op3 = nullptr; + GenTree* op1 = node->Op(1); + GenTree* op2 = node->Op(2); + GenTree* op3 = node->Op(3); emitter* emit = GetEmitter(); - assert(op1->OperIsList()); - assert(op2 == nullptr); - - GenTreeArgList* argList = op1->AsArgList(); - - op1 = argList->Current(); - argList = argList->Rest(); - - op2 = argList->Current(); - argList = argList->Rest(); - - op3 = argList->Current(); - assert(argList->Rest() == nullptr); - regNumber op1Reg = op1->GetRegNum(); regNumber op3Reg = op3->GetRegNum(); @@ -823,7 +798,7 @@ void CodeGen::genHWIntrinsic_R_R_RM_R(GenTreeHWIntrinsic* node, instruction ins, if (op2->isContained() || op2->isUsedFromSpillTemp()) { - assert(HWIntrinsicInfo::SupportsContainment(node->gtHWIntrinsicId)); + assert(HWIntrinsicInfo::SupportsContainment(node->GetHWIntrinsicId())); assertIsContainableHWIntrinsicOp(compiler->m_pLowering, node, op2); TempDsc* tmpDsc = nullptr; @@ -855,8 +830,8 @@ void CodeGen::genHWIntrinsic_R_R_RM_R(GenTreeHWIntrinsic* node, instruction ins, else { assert(op2->AsHWIntrinsic()->OperIsMemoryLoad()); - assert(HWIntrinsicInfo::lookupNumArgs(op2->AsHWIntrinsic()) == 1); - addr = op2->gtGetOp1(); + assert(op2->AsHWIntrinsic()->GetOperandCount() == 1); + addr = op2->AsHWIntrinsic()->Op(1); } switch (addr->OperGet()) @@ -982,8 +957,8 @@ void CodeGen::genHWIntrinsic_R_R_R_RM( else { assert(op3->AsHWIntrinsic()->OperIsMemoryLoad()); - assert(HWIntrinsicInfo::lookupNumArgs(op3->AsHWIntrinsic()) == 1); - addr = op3->gtGetOp1(); + assert(op3->AsHWIntrinsic()->GetOperandCount() == 1); + addr = op3->AsHWIntrinsic()->Op(1); } switch (addr->OperGet()) @@ -1138,17 +1113,17 @@ void CodeGen::genHWIntrinsicJumpTableFallback(NamedIntrinsic intrinsi // void CodeGen::genBaseIntrinsic(GenTreeHWIntrinsic* node) { - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); regNumber targetReg = node->GetRegNum(); var_types baseType = node->GetSimdBaseType(); assert(compiler->compIsaSupportedDebugOnly(InstructionSet_SSE)); assert((baseType >= TYP_BYTE) && (baseType <= TYP_DOUBLE)); - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); + GenTree* op1 = (node->GetOperandCount() >= 1) ? node->Op(1) : nullptr; + GenTree* op2 = (node->GetOperandCount() >= 2) ? node->Op(2) : nullptr; - genConsumeHWIntrinsicOperands(node); + genConsumeMultiOpOperands(node); regNumber op1Reg = (op1 == nullptr) ? REG_NA : op1->GetRegNum(); emitter* emit = GetEmitter(); @@ -1395,13 +1370,11 @@ void CodeGen::genBaseIntrinsic(GenTreeHWIntrinsic* node) case NI_Vector128_get_Zero: case NI_Vector256_get_Zero: { - assert(op1 == nullptr); emit->emitIns_SIMD_R_R_R(ins, attr, targetReg, targetReg, targetReg); break; } case NI_Vector128_get_AllBitsSet: - assert(op1 == nullptr); if (varTypeIsFloating(baseType) && compiler->compOpportunisticallyDependsOn(InstructionSet_AVX)) { // The following corresponds to vcmptrueps pseudo-op and not available without VEX prefix. @@ -1414,7 +1387,6 @@ void CodeGen::genBaseIntrinsic(GenTreeHWIntrinsic* node) break; case NI_Vector256_get_AllBitsSet: - assert(op1 == nullptr); if (varTypeIsIntegral(baseType) && compiler->compOpportunisticallyDependsOn(InstructionSet_AVX2)) { emit->emitIns_SIMD_R_R_R(ins, attr, targetReg, targetReg, targetReg); @@ -1445,7 +1417,9 @@ void CodeGen::genBaseIntrinsic(GenTreeHWIntrinsic* node) // void CodeGen::genX86BaseIntrinsic(GenTreeHWIntrinsic* node) { - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); + + genConsumeMultiOpOperands(node); switch (intrinsicId) { @@ -1454,14 +1428,19 @@ void CodeGen::genX86BaseIntrinsic(GenTreeHWIntrinsic* node) case NI_X86Base_X64_BitScanForward: case NI_X86Base_X64_BitScanReverse: { - GenTree* op1 = node->gtGetOp1(); + GenTree* op1 = node->Op(1); regNumber targetReg = node->GetRegNum(); var_types targetType = node->TypeGet(); instruction ins = HWIntrinsicInfo::lookupIns(intrinsicId, targetType); - genConsumeOperands(node); genHWIntrinsic_R_RM(node, ins, emitTypeSize(targetType), targetReg, op1); - genProduceReg(node); + break; + } + + case NI_X86Base_Pause: + { + assert(node->GetSimdBaseType() == TYP_UNKNOWN); + GetEmitter()->emitIns(INS_pause); break; } @@ -1469,6 +1448,8 @@ void CodeGen::genX86BaseIntrinsic(GenTreeHWIntrinsic* node) unreached(); break; } + + genProduceReg(node); } //------------------------------------------------------------------------ @@ -1479,17 +1460,13 @@ void CodeGen::genX86BaseIntrinsic(GenTreeHWIntrinsic* node) // void CodeGen::genSSEIntrinsic(GenTreeHWIntrinsic* node) { - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); regNumber targetReg = node->GetRegNum(); var_types targetType = node->TypeGet(); var_types baseType = node->GetSimdBaseType(); + emitter* emit = GetEmitter(); - regNumber op1Reg = REG_NA; - emitter* emit = GetEmitter(); - - genConsumeHWIntrinsicOperands(node); + genConsumeMultiOpOperands(node); switch (intrinsicId) { @@ -1497,18 +1474,14 @@ void CodeGen::genSSEIntrinsic(GenTreeHWIntrinsic* node) case NI_SSE_X64_ConvertToInt64WithTruncation: { assert(targetType == TYP_LONG); - assert(op1 != nullptr); - assert(op2 == nullptr); instruction ins = HWIntrinsicInfo::lookupIns(intrinsicId, baseType); - genHWIntrinsic_R_RM(node, ins, EA_8BYTE, targetReg, op1); + genHWIntrinsic_R_RM(node, ins, EA_8BYTE, targetReg, node->Op(1)); break; } case NI_SSE_X64_ConvertScalarToVector128Single: { assert(baseType == TYP_LONG); - assert(op1 != nullptr); - assert(op2 != nullptr); instruction ins = HWIntrinsicInfo::lookupIns(intrinsicId, baseType); genHWIntrinsic_R_R_RM(node, ins, EA_8BYTE); break; @@ -1520,21 +1493,17 @@ void CodeGen::genSSEIntrinsic(GenTreeHWIntrinsic* node) case NI_SSE_PrefetchNonTemporal: { assert(baseType == TYP_UBYTE); - assert(op2 == nullptr); // These do not support containment. - assert(!op1->isContained()); + assert(!node->Op(1)->isContained()); instruction ins = HWIntrinsicInfo::lookupIns(intrinsicId, node->GetSimdBaseType()); - op1Reg = op1->GetRegNum(); - emit->emitIns_AR(ins, emitTypeSize(baseType), op1Reg, 0); + emit->emitIns_AR(ins, emitTypeSize(baseType), node->Op(1)->GetRegNum(), 0); break; } case NI_SSE_StoreFence: { - assert(baseType == TYP_VOID); - assert(op1 == nullptr); - assert(op2 == nullptr); + assert(baseType == TYP_UNKNOWN); emit->emitIns(INS_sfence); break; } @@ -1555,24 +1524,19 @@ void CodeGen::genSSEIntrinsic(GenTreeHWIntrinsic* node) // void CodeGen::genSSE2Intrinsic(GenTreeHWIntrinsic* node) { - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); regNumber targetReg = node->GetRegNum(); var_types targetType = node->TypeGet(); var_types baseType = node->GetSimdBaseType(); - regNumber op1Reg = REG_NA; emitter* emit = GetEmitter(); - genConsumeHWIntrinsicOperands(node); + genConsumeMultiOpOperands(node); switch (intrinsicId) { case NI_SSE2_X64_ConvertScalarToVector128Double: { assert(baseType == TYP_LONG); - assert(op1 != nullptr); - assert(op2 != nullptr); instruction ins = HWIntrinsicInfo::lookupIns(intrinsicId, baseType); genHWIntrinsic_R_R_RM(node, ins, EA_8BYTE); break; @@ -1582,10 +1546,8 @@ void CodeGen::genSSE2Intrinsic(GenTreeHWIntrinsic* node) case NI_SSE2_X64_ConvertScalarToVector128UInt64: { assert(baseType == TYP_LONG || baseType == TYP_ULONG); - assert(op1 != nullptr); - assert(op2 == nullptr); instruction ins = HWIntrinsicInfo::lookupIns(intrinsicId, baseType); - genHWIntrinsic_R_RM(node, ins, emitTypeSize(baseType), targetReg, op1); + genHWIntrinsic_R_RM(node, ins, emitTypeSize(baseType), targetReg, node->Op(1)); break; } @@ -1596,9 +1558,7 @@ void CodeGen::genSSE2Intrinsic(GenTreeHWIntrinsic* node) case NI_SSE2_X64_ConvertToInt64WithTruncation: case NI_SSE2_X64_ConvertToUInt64: { - assert(op2 == nullptr); emitAttr attr; - if (varTypeIsIntegral(baseType)) { assert(baseType == TYP_INT || baseType == TYP_UINT || baseType == TYP_LONG || baseType == TYP_ULONG); @@ -1611,24 +1571,20 @@ void CodeGen::genSSE2Intrinsic(GenTreeHWIntrinsic* node) } instruction ins = HWIntrinsicInfo::lookupIns(intrinsicId, baseType); - genHWIntrinsic_R_RM(node, ins, attr, targetReg, op1); + genHWIntrinsic_R_RM(node, ins, attr, targetReg, node->Op(1)); break; } case NI_SSE2_LoadFence: { - assert(baseType == TYP_VOID); - assert(op1 == nullptr); - assert(op2 == nullptr); + assert(baseType == TYP_UNKNOWN); emit->emitIns(INS_lfence); break; } case NI_SSE2_MemoryFence: { - assert(baseType == TYP_VOID); - assert(op1 == nullptr); - assert(op2 == nullptr); + assert(baseType == TYP_UNKNOWN); emit->emitIns(INS_mfence); break; } @@ -1637,11 +1593,8 @@ void CodeGen::genSSE2Intrinsic(GenTreeHWIntrinsic* node) case NI_SSE2_X64_StoreNonTemporal: { assert(baseType == TYP_INT || baseType == TYP_UINT || baseType == TYP_LONG || baseType == TYP_ULONG); - assert(op1 != nullptr); - assert(op2 != nullptr); - instruction ins = HWIntrinsicInfo::lookupIns(intrinsicId, baseType); - GenTreeStoreInd store = storeIndirForm(node->TypeGet(), op1, op2); + GenTreeStoreInd store = storeIndirForm(node->TypeGet(), node->Op(1), node->Op(2)); emit->emitInsStoreInd(ins, emitTypeSize(baseType), &store); break; } @@ -1662,15 +1615,14 @@ void CodeGen::genSSE2Intrinsic(GenTreeHWIntrinsic* node) // void CodeGen::genSSE41Intrinsic(GenTreeHWIntrinsic* node) { - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); + GenTree* op1 = node->Op(1); regNumber targetReg = node->GetRegNum(); var_types baseType = node->GetSimdBaseType(); emitter* emit = GetEmitter(); - genConsumeHWIntrinsicOperands(node); + genConsumeMultiOpOperands(node); switch (intrinsicId) { @@ -1699,6 +1651,7 @@ void CodeGen::genSSE41Intrinsic(GenTreeHWIntrinsic* node) { assert(!varTypeIsFloating(baseType)); + GenTree* op2 = node->Op(2); instruction ins = HWIntrinsicInfo::lookupIns(intrinsicId, baseType); emitAttr attr = emitActualTypeSize(node->TypeGet()); @@ -1738,20 +1691,19 @@ void CodeGen::genSSE41Intrinsic(GenTreeHWIntrinsic* node) // void CodeGen::genSSE42Intrinsic(GenTreeHWIntrinsic* node) { - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); regNumber targetReg = node->GetRegNum(); - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); + GenTree* op1 = node->Op(1); + GenTree* op2 = node->Op(2); var_types baseType = node->GetSimdBaseType(); var_types targetType = node->TypeGet(); emitter* emit = GetEmitter(); - genConsumeHWIntrinsicOperands(node); + genConsumeMultiOpOperands(node); regNumber op1Reg = op1->GetRegNum(); assert(targetReg != REG_NA); assert(op1Reg != REG_NA); - assert(op2 != nullptr); assert(!node->OperIsCommutative()); switch (intrinsicId) @@ -1795,20 +1747,18 @@ void CodeGen::genSSE42Intrinsic(GenTreeHWIntrinsic* node) // void CodeGen::genAvxOrAvx2Intrinsic(GenTreeHWIntrinsic* node) { - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); var_types baseType = node->GetSimdBaseType(); emitAttr attr = emitActualTypeSize(Compiler::getSIMDTypeForSize(node->GetSimdSize())); var_types targetType = node->TypeGet(); instruction ins = HWIntrinsicInfo::lookupIns(intrinsicId, baseType); - int numArgs = HWIntrinsicInfo::lookupNumArgs(node); - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); + size_t numArgs = node->GetOperandCount(); + GenTree* op1 = node->Op(1); regNumber op1Reg = REG_NA; - regNumber op2Reg = REG_NA; regNumber targetReg = node->GetRegNum(); emitter* emit = GetEmitter(); - genConsumeHWIntrinsicOperands(node); + genConsumeMultiOpOperands(node); switch (intrinsicId) { @@ -1816,7 +1766,6 @@ void CodeGen::genAvxOrAvx2Intrinsic(GenTreeHWIntrinsic* node) case NI_AVX2_ConvertToUInt32: { op1Reg = op1->GetRegNum(); - assert(numArgs == 1); assert((baseType == TYP_INT) || (baseType == TYP_UINT)); instruction ins = HWIntrinsicInfo::lookupIns(intrinsicId, baseType); emit->emitIns_Mov(ins, emitActualTypeSize(baseType), targetReg, op1Reg, /* canSkip */ false); @@ -1848,24 +1797,13 @@ void CodeGen::genAvxOrAvx2Intrinsic(GenTreeHWIntrinsic* node) case NI_AVX2_GatherMaskVector128: case NI_AVX2_GatherMaskVector256: { - GenTreeArgList* list = op1->AsArgList(); - op1 = list->Current(); - op1Reg = op1->GetRegNum(); - - list = list->Rest(); - op2 = list->Current(); - op2Reg = op2->GetRegNum(); - - list = list->Rest(); - GenTree* op3 = list->Current(); - - list = list->Rest(); - GenTree* op4 = nullptr; + GenTree* op2 = node->Op(2); + GenTree* op3 = node->Op(3); GenTree* lastOp = nullptr; GenTree* indexOp = nullptr; - regNumber op3Reg = REG_NA; - regNumber op4Reg = REG_NA; + op1Reg = op1->GetRegNum(); + regNumber op2Reg = op2->GetRegNum(); regNumber addrBaseReg = REG_NA; regNumber addrIndexReg = REG_NA; regNumber maskReg = node->ExtractTempReg(RBM_ALLFLOAT); @@ -1873,11 +1811,13 @@ void CodeGen::genAvxOrAvx2Intrinsic(GenTreeHWIntrinsic* node) if (numArgs == 5) { assert(intrinsicId == NI_AVX2_GatherMaskVector128 || intrinsicId == NI_AVX2_GatherMaskVector256); - op4 = list->Current(); - list = list->Rest(); - lastOp = list->Current(); - op3Reg = op3->GetRegNum(); - op4Reg = op4->GetRegNum(); + + GenTree* op4 = node->Op(4); + lastOp = node->Op(5); + + regNumber op3Reg = op3->GetRegNum(); + regNumber op4Reg = op4->GetRegNum(); + addrBaseReg = op2Reg; addrIndexReg = op3Reg; indexOp = op3; @@ -1974,18 +1914,15 @@ void CodeGen::genAESIntrinsic(GenTreeHWIntrinsic* node) // void CodeGen::genBMI1OrBMI2Intrinsic(GenTreeHWIntrinsic* node) { - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); regNumber targetReg = node->GetRegNum(); - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); var_types targetType = node->TypeGet(); instruction ins = HWIntrinsicInfo::lookupIns(intrinsicId, targetType); emitter* emit = GetEmitter(); assert(targetReg != REG_NA); - assert(op1 != nullptr); - genConsumeHWIntrinsicOperands(node); + genConsumeMultiOpOperands(node); switch (intrinsicId) { @@ -2000,7 +1937,6 @@ void CodeGen::genBMI1OrBMI2Intrinsic(GenTreeHWIntrinsic* node) case NI_BMI2_ZeroHighBits: case NI_BMI2_X64_ZeroHighBits: { - assert(op2 != nullptr); assert((targetType == TYP_INT) || (targetType == TYP_LONG)); genHWIntrinsic_R_R_RM(node, ins, emitTypeSize(node->TypeGet())); break; @@ -2013,16 +1949,14 @@ void CodeGen::genBMI1OrBMI2Intrinsic(GenTreeHWIntrinsic* node) case NI_BMI1_X64_GetMaskUpToLowestSetBit: case NI_BMI1_X64_ResetLowestSetBit: { - assert(op2 == nullptr); assert((targetType == TYP_INT) || (targetType == TYP_LONG)); - genHWIntrinsic_R_RM(node, ins, emitTypeSize(node->TypeGet()), targetReg, op1); + genHWIntrinsic_R_RM(node, ins, emitTypeSize(node->TypeGet()), targetReg, node->Op(1)); break; } case NI_BMI1_TrailingZeroCount: case NI_BMI1_X64_TrailingZeroCount: { - assert(op2 == nullptr); assert((targetType == TYP_INT) || (targetType == TYP_LONG)); genXCNTIntrinsic(node, ins); break; @@ -2031,32 +1965,26 @@ void CodeGen::genBMI1OrBMI2Intrinsic(GenTreeHWIntrinsic* node) case NI_BMI2_MultiplyNoFlags: case NI_BMI2_X64_MultiplyNoFlags: { - int numArgs = HWIntrinsicInfo::lookupNumArgs(node); + size_t numArgs = node->GetOperandCount(); assert(numArgs == 2 || numArgs == 3); - regNumber op1Reg = REG_NA; - regNumber op2Reg = REG_NA; + GenTree* op1 = node->Op(1); + GenTree* op2 = node->Op(2); + + regNumber op1Reg = op1->GetRegNum(); + regNumber op2Reg = op2->GetRegNum(); regNumber op3Reg = REG_NA; regNumber lowReg = REG_NA; if (numArgs == 2) { - op1Reg = op1->GetRegNum(); - op2Reg = op2->GetRegNum(); lowReg = targetReg; } else { - GenTreeArgList* argList = op1->AsArgList(); - op1 = argList->Current(); - op1Reg = op1->GetRegNum(); - argList = argList->Rest(); - op2 = argList->Current(); - op2Reg = op2->GetRegNum(); - argList = argList->Rest(); - GenTree* op3 = argList->Current(); - op3Reg = op3->GetRegNum(); - assert(!op3->isContained()); + op3Reg = node->Op(3)->GetRegNum(); + + assert(!node->Op(3)->isContained()); assert(op3Reg != op1Reg); assert(op3Reg != targetReg); assert(op3Reg != REG_EDX); @@ -2103,78 +2031,85 @@ void CodeGen::genBMI1OrBMI2Intrinsic(GenTreeHWIntrinsic* node) // void CodeGen::genFMAIntrinsic(GenTreeHWIntrinsic* node) { - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); var_types baseType = node->GetSimdBaseType(); emitAttr attr = emitActualTypeSize(Compiler::getSIMDTypeForSize(node->GetSimdSize())); - instruction ins = HWIntrinsicInfo::lookupIns(intrinsicId, baseType); - GenTree* op1 = node->gtGetOp1(); - regNumber targetReg = node->GetRegNum(); - - assert(HWIntrinsicInfo::lookupNumArgs(node) == 3); + instruction ins = HWIntrinsicInfo::lookupIns(intrinsicId, baseType); // 213 form + instruction _132form = (instruction)(ins - 1); + instruction _231form = (instruction)(ins + 1); + GenTree* op1 = node->Op(1); + GenTree* op2 = node->Op(2); + GenTree* op3 = node->Op(3); - genConsumeHWIntrinsicOperands(node); - GenTreeArgList* argList = op1->AsArgList(); - op1 = argList->Current(); + regNumber targetReg = node->GetRegNum(); - argList = argList->Rest(); - GenTree* op2 = argList->Current(); + genConsumeMultiOpOperands(node); - argList = argList->Rest(); - GenTree* op3 = argList->Current(); + regNumber op1NodeReg = op1->GetRegNum(); + regNumber op2NodeReg = op2->GetRegNum(); + regNumber op3NodeReg = op3->GetRegNum(); - regNumber op1Reg; - regNumber op2Reg; + GenTree* emitOp1 = op1; + GenTree* emitOp2 = op2; + GenTree* emitOp3 = op3; - bool isCommutative = false; const bool copiesUpperBits = HWIntrinsicInfo::CopiesUpperBits(intrinsicId); // Intrinsics with CopyUpperBits semantics cannot have op1 be contained assert(!copiesUpperBits || !op1->isContained()); - if (op2->isContained() || op2->isUsedFromSpillTemp()) + if (op1->isContained() || op1->isUsedFromSpillTemp()) { - // 132 form: op1 = (op1 * op3) + [op2] - - ins = (instruction)(ins - 1); - op1Reg = op1->GetRegNum(); - op2Reg = op3->GetRegNum(); - op3 = op2; + if (targetReg == op2NodeReg) + { + std::swap(emitOp1, emitOp2); + // op2 = ([op1] * op2) + op3 + // 132 form: XMM1 = (XMM1 * [XMM3]) + XMM2 + ins = _132form; + std::swap(emitOp2, emitOp3); + } + else + { + // targetReg == op3NodeReg or targetReg == ? + // op3 = ([op1] * op2) + op3 + // 231 form: XMM1 = (XMM2 * [XMM3]) + XMM1 + ins = _231form; + std::swap(emitOp1, emitOp3); + } } - else if (op1->isContained() || op1->isUsedFromSpillTemp()) + else if (op2->isContained() || op2->isUsedFromSpillTemp()) { - // 231 form: op3 = (op2 * op3) + [op1] - - ins = (instruction)(ins + 1); - op1Reg = op3->GetRegNum(); - op2Reg = op2->GetRegNum(); - op3 = op1; + if (!copiesUpperBits && (targetReg == op3NodeReg)) + { + // op3 = (op1 * [op2]) + op3 + // 231 form: XMM1 = (XMM2 * [XMM3]) + XMM1 + ins = _231form; + std::swap(emitOp1, emitOp3); + } + else + { + // targetReg == op1NodeReg or targetReg == ? + // op1 = (op1 * [op2]) + op3 + // 132 form: XMM1 = (XMM1 * [XMM3]) + XMM2 + ins = _132form; + } + std::swap(emitOp2, emitOp3); } else { - // 213 form: op1 = (op2 * op1) + [op3] - - op1Reg = op1->GetRegNum(); - op2Reg = op2->GetRegNum(); - - isCommutative = !copiesUpperBits; - } - - if (isCommutative && (op1Reg != targetReg) && (op2Reg == targetReg)) - { - assert(node->isRMWHWIntrinsic(compiler)); - - // We have "reg2 = (reg1 * reg2) +/- op3" where "reg1 != reg2" on a RMW intrinsic. - // - // For non-commutative intrinsics, we should have ensured that op2 was marked - // delay free in order to prevent it from getting assigned the same register - // as target. However, for commutative intrinsics, we can just swap the operands - // in order to have "reg2 = reg2 op reg1" which will end up producing the right code. - - op2Reg = op1Reg; - op1Reg = targetReg; + // targetReg could be op1NodeReg, op2NodeReg, or not equal to any op + // op1 = (op1 * op2) + [op3] or op2 = (op1 * op2) + [op3] + // ? = (op1 * op2) + [op3] or ? = (op1 * op2) + op3 + // 213 form: XMM1 = (XMM2 * XMM1) + [XMM3] + if (!copiesUpperBits && (targetReg == op2NodeReg)) + { + // op2 = (op1 * op2) + [op3] + // 213 form: XMM1 = (XMM2 * XMM1) + [XMM3] + std::swap(emitOp1, emitOp2); + } } - genHWIntrinsic_R_R_R_RM(ins, attr, targetReg, op1Reg, op2Reg, op3); + genHWIntrinsic_R_R_R_RM(ins, attr, targetReg, emitOp1->GetRegNum(), emitOp2->GetRegNum(), emitOp3); genProduceReg(node); } @@ -2186,10 +2121,10 @@ void CodeGen::genFMAIntrinsic(GenTreeHWIntrinsic* node) // void CodeGen::genLZCNTIntrinsic(GenTreeHWIntrinsic* node) { - assert(node->gtHWIntrinsicId == NI_LZCNT_LeadingZeroCount || - node->gtHWIntrinsicId == NI_LZCNT_X64_LeadingZeroCount); + assert((node->GetHWIntrinsicId() == NI_LZCNT_LeadingZeroCount) || + (node->GetHWIntrinsicId() == NI_LZCNT_X64_LeadingZeroCount)); - genConsumeOperands(node); + genConsumeMultiOpOperands(node); genXCNTIntrinsic(node, INS_lzcnt); genProduceReg(node); } @@ -2213,9 +2148,9 @@ void CodeGen::genPCLMULQDQIntrinsic(GenTreeHWIntrinsic* node) // void CodeGen::genPOPCNTIntrinsic(GenTreeHWIntrinsic* node) { - assert(node->gtHWIntrinsicId == NI_POPCNT_PopCount || node->gtHWIntrinsicId == NI_POPCNT_X64_PopCount); + assert(node->GetHWIntrinsicId() == NI_POPCNT_PopCount || node->GetHWIntrinsicId() == NI_POPCNT_X64_PopCount); - genConsumeOperands(node); + genConsumeMultiOpOperands(node); genXCNTIntrinsic(node, INS_popcnt); genProduceReg(node); } @@ -2234,7 +2169,7 @@ void CodeGen::genXCNTIntrinsic(GenTreeHWIntrinsic* node, instruction ins) // (POPCNT only) processors, so insert a `XOR target, target` to break the dependency via XOR triggering register // renaming, but only if it's not an actual dependency. - GenTree* op1 = node->gtGetOp1(); + GenTree* op1 = node->Op(1); regNumber sourceReg1 = REG_NA; regNumber sourceReg2 = REG_NA; diff --git a/src/coreclr/jit/hwintrinsiclistarm64.h b/src/coreclr/jit/hwintrinsiclistarm64.h index ba185f3afeb917..c7e49b91a05be8 100644 --- a/src/coreclr/jit/hwintrinsiclistarm64.h +++ b/src/coreclr/jit/hwintrinsiclistarm64.h @@ -87,6 +87,8 @@ HARDWARE_INTRINSIC(Vector64, Sqrt, HARDWARE_INTRINSIC(Vector64, ToScalar, 8, 1, {INS_smov, INS_umov, INS_smov, INS_umov, INS_smov, INS_umov, INS_umov, INS_umov, INS_dup, INS_dup}, HW_Category_SIMD, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SIMDScalar|HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Vector64, ToVector128, 8, 1, {INS_mov, INS_mov, INS_mov, INS_mov, INS_mov, INS_mov, INS_mov, INS_mov, INS_mov, INS_mov}, HW_Category_SIMD, HW_Flag_SpecialCodeGen) HARDWARE_INTRINSIC(Vector64, ToVector128Unsafe, 8, 1, {INS_mov, INS_mov, INS_mov, INS_mov, INS_mov, INS_mov, INS_mov, INS_mov, INS_mov, INS_mov}, HW_Category_SIMD, HW_Flag_SpecialCodeGen) +HARDWARE_INTRINSIC(Vector64, WidenLower, 8, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen|HW_Flag_BaseTypeFromFirstArg) +HARDWARE_INTRINSIC(Vector64, WidenUpper, 8, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector64, WithElement, 8, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialImport) HARDWARE_INTRINSIC(Vector64, Xor, 8, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) @@ -171,6 +173,8 @@ HARDWARE_INTRINSIC(Vector128, op_UnaryPlus, HARDWARE_INTRINSIC(Vector128, Subtract, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) HARDWARE_INTRINSIC(Vector128, Sqrt, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) HARDWARE_INTRINSIC(Vector128, ToScalar, 16, 1, {INS_smov, INS_umov, INS_smov, INS_umov, INS_smov, INS_umov, INS_umov, INS_umov, INS_dup, INS_dup}, HW_Category_SIMD, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SIMDScalar|HW_Flag_SpecialCodeGen) +HARDWARE_INTRINSIC(Vector128, WidenLower, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen|HW_Flag_BaseTypeFromFirstArg) +HARDWARE_INTRINSIC(Vector128, WidenUpper, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, WithElement, 16, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialImport) HARDWARE_INTRINSIC(Vector128, Xor, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) @@ -623,6 +627,7 @@ HARDWARE_INTRINSIC(Aes, PolynomialMultiplyWideningUpper, // Base Intrinsics HARDWARE_INTRINSIC(ArmBase, LeadingZeroCount, 0, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_clz, INS_clz, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_BaseTypeFromFirstArg|HW_Flag_NoFloatingPointUsed) HARDWARE_INTRINSIC(ArmBase, ReverseElementBits, 0, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_rbit, INS_rbit, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_NoFloatingPointUsed) +HARDWARE_INTRINSIC(ArmBase, Yield, 0, 0, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Special, HW_Flag_SpecialCodeGen|HW_Flag_SpecialImport) // *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** // ISA Function name SIMD size Number of arguments Instructions Category Flags diff --git a/src/coreclr/jit/hwintrinsiclistxarch.h b/src/coreclr/jit/hwintrinsiclistxarch.h index 00a402260fc42a..ce66b6e6906040 100644 --- a/src/coreclr/jit/hwintrinsiclistxarch.h +++ b/src/coreclr/jit/hwintrinsiclistxarch.h @@ -104,6 +104,8 @@ HARDWARE_INTRINSIC(Vector128, Sqrt, HARDWARE_INTRINSIC(Vector128, ToScalar, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_movss, INS_movsdsse2}, HW_Category_SimpleSIMD, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_BaseTypeFromFirstArg|HW_Flag_NoRMWSemantics) HARDWARE_INTRINSIC(Vector128, ToVector256, 16, 1, {INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movups, INS_movupd}, HW_Category_SimpleSIMD, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_BaseTypeFromFirstArg|HW_Flag_NoRMWSemantics) HARDWARE_INTRINSIC(Vector128, ToVector256Unsafe, 16, 1, {INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movdqu, INS_movups, INS_movupd}, HW_Category_SimpleSIMD, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_BaseTypeFromFirstArg|HW_Flag_NoRMWSemantics) +HARDWARE_INTRINSIC(Vector128, WidenLower, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen|HW_Flag_BaseTypeFromFirstArg) +HARDWARE_INTRINSIC(Vector128, WidenUpper, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, WithElement, 16, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoContainment|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector128, Xor, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) @@ -185,6 +187,8 @@ HARDWARE_INTRINSIC(Vector256, op_UnaryPlus, HARDWARE_INTRINSIC(Vector256, Subtract, 32, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) HARDWARE_INTRINSIC(Vector256, Sqrt, 32, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) HARDWARE_INTRINSIC(Vector256, ToScalar, 32, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_movss, INS_movsdsse2}, HW_Category_SimpleSIMD, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_BaseTypeFromFirstArg|HW_Flag_NoRMWSemantics) +HARDWARE_INTRINSIC(Vector256, WidenLower, 32, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen|HW_Flag_BaseTypeFromFirstArg) +HARDWARE_INTRINSIC(Vector256, WidenUpper, 32, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector256, WithElement, 32, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoContainment|HW_Flag_BaseTypeFromFirstArg) HARDWARE_INTRINSIC(Vector256, Xor, 32, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) @@ -195,6 +199,7 @@ HARDWARE_INTRINSIC(Vector256, Xor, // X86Base Intrinsics HARDWARE_INTRINSIC(X86Base, BitScanForward, 0, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_bsf, INS_bsf, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_NoFloatingPointUsed|HW_Flag_NoRMWSemantics) HARDWARE_INTRINSIC(X86Base, BitScanReverse, 0, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_bsr, INS_bsr, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_NoFloatingPointUsed|HW_Flag_NoRMWSemantics) +HARDWARE_INTRINSIC(X86Base, Pause, 0, 0, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Special, HW_Flag_NoContainment|HW_Flag_NoRMWSemantics) // *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** // ISA Function name SIMD size NumArg Instructions Category Flags diff --git a/src/coreclr/jit/hwintrinsicxarch.cpp b/src/coreclr/jit/hwintrinsicxarch.cpp index 46fb8b7c3f86c5..72c9734afc48b7 100644 --- a/src/coreclr/jit/hwintrinsicxarch.cpp +++ b/src/coreclr/jit/hwintrinsicxarch.cpp @@ -491,6 +491,7 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, { case InstructionSet_Vector256: case InstructionSet_Vector128: + case InstructionSet_X86Base: return impBaseIntrinsic(intrinsic, clsHnd, method, sig, simdBaseJitType, retType, simdSize); case InstructionSet_SSE: return impSSEIntrinsic(intrinsic, method, sig); @@ -548,8 +549,13 @@ GenTree* Compiler::impBaseIntrinsic(NamedIntrinsic intrinsic, return nullptr; } - var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType); - assert(varTypeIsArithmetic(simdBaseType)); + var_types simdBaseType = TYP_UNKNOWN; + + if (intrinsic != NI_X86Base_Pause) + { + simdBaseType = JitType2PreciseVarType(simdBaseJitType); + assert(varTypeIsArithmetic(simdBaseType)); + } switch (intrinsic) { @@ -858,31 +864,14 @@ GenTree* Compiler::impBaseIntrinsic(NamedIntrinsic intrinsic, } #endif // TARGET_X86 - if (sig->numArgs == 1) - { - op1 = impPopStack().val; - retNode = gtNewSimdHWIntrinsicNode(retType, op1, intrinsic, simdBaseJitType, simdSize); - } - else if (sig->numArgs == 2) + IntrinsicNodeBuilder nodeBuilder(getAllocator(CMK_ASTNode), sig->numArgs); + + for (int i = sig->numArgs - 1; i >= 0; i--) { - op2 = impPopStack().val; - op1 = impPopStack().val; - retNode = gtNewSimdHWIntrinsicNode(retType, op1, op2, intrinsic, simdBaseJitType, simdSize); + nodeBuilder.AddOperand(i, impPopStack().val); } - else - { - assert(sig->numArgs >= 3); - GenTreeArgList* tmp = nullptr; - - for (unsigned i = 0; i < sig->numArgs; i++) - { - tmp = gtNewListNode(impPopStack().val, tmp); - } - - op1 = tmp; - retNode = gtNewSimdHWIntrinsicNode(retType, op1, intrinsic, simdBaseJitType, simdSize); - } + retNode = gtNewSimdHWIntrinsicNode(retType, std::move(nodeBuilder), intrinsic, simdBaseJitType, simdSize); break; } @@ -1294,7 +1283,15 @@ GenTree* Compiler::impBaseIntrinsic(NamedIntrinsic intrinsic, case NI_Vector256_Narrow: { assert(sig->numArgs == 2); - // TODO-XARCH-CQ: These intrinsics should be accelerated + + if ((simdSize != 32) || varTypeIsFloating(simdBaseType) || compExactlyDependsOn(InstructionSet_AVX2)) + { + op2 = impSIMDPopStack(retType); + op1 = impSIMDPopStack(retType); + + retNode = + gtNewSimdNarrowNode(retType, op1, op2, simdBaseJitType, simdSize, /* isSimdAsHWIntrinsic */ false); + } break; } @@ -1416,6 +1413,36 @@ GenTree* Compiler::impBaseIntrinsic(NamedIntrinsic intrinsic, break; } + case NI_Vector128_WidenLower: + case NI_Vector256_WidenLower: + { + assert(sig->numArgs == 1); + + if ((simdSize != 32) || varTypeIsFloating(simdBaseType) || compExactlyDependsOn(InstructionSet_AVX2)) + { + op1 = impSIMDPopStack(retType); + + retNode = + gtNewSimdWidenLowerNode(retType, op1, simdBaseJitType, simdSize, /* isSimdAsHWIntrinsic */ false); + } + break; + } + + case NI_Vector128_WidenUpper: + case NI_Vector256_WidenUpper: + { + assert(sig->numArgs == 1); + + if ((simdSize != 32) || varTypeIsFloating(simdBaseType) || compExactlyDependsOn(InstructionSet_AVX2)) + { + op1 = impSIMDPopStack(retType); + + retNode = + gtNewSimdWidenUpperNode(retType, op1, simdBaseJitType, simdSize, /* isSimdAsHWIntrinsic */ false); + } + break; + } + case NI_Vector128_WithElement: case NI_Vector256_WithElement: { @@ -1494,6 +1521,16 @@ GenTree* Compiler::impBaseIntrinsic(NamedIntrinsic intrinsic, break; } + case NI_X86Base_Pause: + { + assert(sig->numArgs == 0); + assert(JITtype2varType(sig->retType) == TYP_VOID); + assert(simdSize == 0); + + retNode = gtNewScalarHWIntrinsicNode(TYP_VOID, intrinsic); + break; + } + default: { return nullptr; @@ -1566,7 +1603,7 @@ GenTree* Compiler::impSSEIntrinsic(NamedIntrinsic intrinsic, CORINFO_METHOD_HAND case NI_SSE_StoreFence: assert(sig->numArgs == 0); assert(JITtype2varType(sig->retType) == TYP_VOID); - retNode = gtNewSimdHWIntrinsicNode(TYP_VOID, intrinsic, CORINFO_TYPE_VOID, 0); + retNode = gtNewScalarHWIntrinsicNode(TYP_VOID, intrinsic); break; default: @@ -1629,7 +1666,7 @@ GenTree* Compiler::impSSE2Intrinsic(NamedIntrinsic intrinsic, CORINFO_METHOD_HAN assert(JITtype2varType(sig->retType) == TYP_VOID); assert(simdSize == 0); - retNode = gtNewSimdHWIntrinsicNode(TYP_VOID, intrinsic, CORINFO_TYPE_VOID, simdSize); + retNode = gtNewScalarHWIntrinsicNode(TYP_VOID, intrinsic); break; } @@ -1713,9 +1750,11 @@ GenTree* Compiler::impAvxOrAvx2Intrinsic(NamedIntrinsic intrinsic, CORINFO_METHO op1 = getArgForHWIntrinsic(argType, argClass); SetOpLclRelatedToSIMDIntrinsic(op1); - GenTree* opList = new (this, GT_LIST) GenTreeArgList(op1, gtNewArgList(op2, op3, op4, op5)); - retNode = new (this, GT_HWINTRINSIC) GenTreeHWIntrinsic(retType, opList, intrinsic, simdBaseJitType, - simdSize, /* isSimdAsHWIntrinsic */ false); + const bool isSimdAsHWIntrinsic = false; + + retNode = new (this, GT_HWINTRINSIC) + GenTreeHWIntrinsic(retType, getAllocator(CMK_ASTNode), intrinsic, simdBaseJitType, simdSize, + isSimdAsHWIntrinsic, op1, op2, op3, op4, op5); retNode->AsHWIntrinsic()->SetAuxiliaryJitType(indexBaseJitType); break; } diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index d1c955fddb321a..5aaf145a3323ea 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -527,14 +527,22 @@ inline void Compiler::impAppendStmtCheck(Statement* stmt, unsigned chkLevel) #endif } -/***************************************************************************** - * - * Append the given statement to the current block's tree list. - * [0..chkLevel) is the portion of the stack which we will check for - * interference with stmt and spill if needed. - */ - -inline void Compiler::impAppendStmt(Statement* stmt, unsigned chkLevel) +//------------------------------------------------------------------------ +// impAppendStmt: Append the given statement to the current block's tree list. +// +// +// Arguments: +// stmt - The statement to add. +// chkLevel - [0..chkLevel) is the portion of the stack which we will check +// for interference with stmt and spill if needed. +// checkConsumedDebugInfo - Whether to check for consumption of impCurStmtDI. impCurStmtDI +// marks the debug info of the current boundary and is set when we +// start importing IL at that boundary. If this parameter is true, +// then the function checks if 'stmt' has been associated with the +// current boundary, and if so, clears it so that we do not attach +// it to more upcoming statements. +// +void Compiler::impAppendStmt(Statement* stmt, unsigned chkLevel, bool checkConsumedDebugInfo) { if (chkLevel == (unsigned)CHECK_SPILL_ALL) { @@ -548,8 +556,8 @@ inline void Compiler::impAppendStmt(Statement* stmt, unsigned chkLevel) /* If the statement being appended has any side-effects, check the stack to see if anything needs to be spilled to preserve correct ordering. */ - GenTree* expr = stmt->GetRootNode(); - unsigned flags = expr->gtFlags & GTF_GLOB_EFFECT; + GenTree* expr = stmt->GetRootNode(); + GenTreeFlags flags = expr->gtFlags & GTF_GLOB_EFFECT; // Assignment to (unaliased) locals don't count as a side-effect as // we handle them specially using impSpillLclRefs(). Temp locals should @@ -558,7 +566,7 @@ inline void Compiler::impAppendStmt(Statement* stmt, unsigned chkLevel) if ((expr->gtOper == GT_ASG) && (expr->AsOp()->gtOp1->gtOper == GT_LCL_VAR) && ((expr->AsOp()->gtOp1->gtFlags & GTF_GLOB_REF) == 0) && !gtHasLocalsWithAddrOp(expr->AsOp()->gtOp2)) { - unsigned op2Flags = expr->AsOp()->gtOp2->gtFlags & GTF_GLOB_EFFECT; + GenTreeFlags op2Flags = expr->AsOp()->gtOp2->gtFlags & GTF_GLOB_EFFECT; assert(flags == (op2Flags | GTF_ASG)); flags = op2Flags; } @@ -615,10 +623,13 @@ inline void Compiler::impAppendStmt(Statement* stmt, unsigned chkLevel) impMarkContiguousSIMDFieldAssignments(stmt); #endif - /* Once we set impCurStmtOffs in an appended tree, we are ready to - report the following offsets. So reset impCurStmtOffs */ + // Once we set the current offset as debug info in an appended tree, we are + // ready to report the following offsets. Note that we need to compare + // offsets here instead of debug info, since we do not set the "is call" + // bit in impCurStmtDI. - if (impLastStmt->GetILOffsetX() == impCurStmtOffs) + if (checkConsumedDebugInfo && + (impLastStmt->GetDebugInfo().GetLocation().GetOffset() == impCurStmtDI.GetLocation().GetOffset())) { impCurStmtOffsSet(BAD_IL_OFFSET); } @@ -707,23 +718,36 @@ inline void Compiler::impInsertStmtBefore(Statement* stmt, Statement* stmtBefore stmtBefore->SetPrevStmt(stmt); } -/***************************************************************************** - * - * Append the given expression tree to the current block's tree list. - * Return the newly created statement. - */ - -Statement* Compiler::impAppendTree(GenTree* tree, unsigned chkLevel, IL_OFFSETX offset) +//------------------------------------------------------------------------ +// impAppendTree: Append the given expression tree to the current block's tree list. +// +// +// Arguments: +// tree - The tree that will be the root of the newly created statement. +// chkLevel - [0..chkLevel) is the portion of the stack which we will check +// for interference with stmt and spill if needed. +// di - Debug information to associate with the statement. +// checkConsumedDebugInfo - Whether to check for consumption of impCurStmtDI. impCurStmtDI +// marks the debug info of the current boundary and is set when we +// start importing IL at that boundary. If this parameter is true, +// then the function checks if 'stmt' has been associated with the +// current boundary, and if so, clears it so that we do not attach +// it to more upcoming statements. +// +// Return value: +// The newly created statement. +// +Statement* Compiler::impAppendTree(GenTree* tree, unsigned chkLevel, const DebugInfo& di, bool checkConsumedDebugInfo) { assert(tree); /* Allocate an 'expression statement' node */ - Statement* stmt = gtNewStmt(tree, offset); + Statement* stmt = gtNewStmt(tree, di); /* Append the statement to the current block's stmt list */ - impAppendStmt(stmt, chkLevel); + impAppendStmt(stmt, chkLevel, checkConsumedDebugInfo); return stmt; } @@ -733,11 +757,11 @@ Statement* Compiler::impAppendTree(GenTree* tree, unsigned chkLevel, IL_OFFSETX * Insert the given expression tree before "stmtBefore" */ -void Compiler::impInsertTreeBefore(GenTree* tree, IL_OFFSETX offset, Statement* stmtBefore) +void Compiler::impInsertTreeBefore(GenTree* tree, const DebugInfo& di, Statement* stmtBefore) { /* Allocate an 'expression statement' node */ - Statement* stmt = gtNewStmt(tree, offset); + Statement* stmt = gtNewStmt(tree, di); /* Append the statement to the current block's stmt list */ @@ -750,12 +774,12 @@ void Compiler::impInsertTreeBefore(GenTree* tree, IL_OFFSETX offset, Statement* * curLevel is the stack level for which the spill to the temp is being done. */ -void Compiler::impAssignTempGen(unsigned tmp, - GenTree* val, - unsigned curLevel, - Statement** pAfterStmt, /* = NULL */ - IL_OFFSETX ilOffset, /* = BAD_IL_OFFSET */ - BasicBlock* block /* = NULL */ +void Compiler::impAssignTempGen(unsigned tmp, + GenTree* val, + unsigned curLevel, + Statement** pAfterStmt, /* = NULL */ + const DebugInfo& di, /* = DebugInfo() */ + BasicBlock* block /* = NULL */ ) { GenTree* asg = gtNewTempAssign(tmp, val); @@ -764,13 +788,13 @@ void Compiler::impAssignTempGen(unsigned tmp, { if (pAfterStmt) { - Statement* asgStmt = gtNewStmt(asg, ilOffset); + Statement* asgStmt = gtNewStmt(asg, di); fgInsertStmtAfter(block, *pAfterStmt, asgStmt); *pAfterStmt = asgStmt; } else { - impAppendTree(asg, curLevel, impCurStmtOffs); + impAppendTree(asg, curLevel, impCurStmtDI); } } } @@ -784,7 +808,7 @@ void Compiler::impAssignTempGen(unsigned tmpNum, CORINFO_CLASS_HANDLE structType, unsigned curLevel, Statement** pAfterStmt, /* = NULL */ - IL_OFFSETX ilOffset, /* = BAD_IL_OFFSET */ + const DebugInfo& di, /* = DebugInfo() */ BasicBlock* block /* = NULL */ ) { @@ -813,7 +837,7 @@ void Compiler::impAssignTempGen(unsigned tmpNum, // calls that may not actually be required - e.g. if we only access a field of a struct. GenTree* dst = gtNewLclvNode(tmpNum, varType); - asg = impAssignStruct(dst, val, structType, curLevel, pAfterStmt, ilOffset, block); + asg = impAssignStruct(dst, val, structType, curLevel, pAfterStmt, di, block); } else { @@ -824,13 +848,13 @@ void Compiler::impAssignTempGen(unsigned tmpNum, { if (pAfterStmt) { - Statement* asgStmt = gtNewStmt(asg, ilOffset); + Statement* asgStmt = gtNewStmt(asg, di); fgInsertStmtAfter(block, *pAfterStmt, asgStmt); *pAfterStmt = asgStmt; } else { - impAppendTree(asg, curLevel, impCurStmtOffs); + impAppendTree(asg, curLevel, impCurStmtDI); } } } @@ -1194,15 +1218,16 @@ GenTree* Compiler::impAssignStruct(GenTree* dest, CORINFO_CLASS_HANDLE structHnd, unsigned curLevel, Statement** pAfterStmt, /* = nullptr */ - IL_OFFSETX ilOffset, /* = BAD_IL_OFFSET */ + const DebugInfo& di, /* = DebugInfo() */ BasicBlock* block /* = nullptr */ ) { assert(varTypeIsStruct(dest)); - if (ilOffset == BAD_IL_OFFSET) + DebugInfo usedDI = di; + if (!usedDI.IsValid()) { - ilOffset = impCurStmtOffs; + usedDI = impCurStmtDI; } while (dest->gtOper == GT_COMMA) @@ -1213,13 +1238,13 @@ GenTree* Compiler::impAssignStruct(GenTree* dest, // Append all the op1 of GT_COMMA trees before we evaluate op2 of the GT_COMMA tree. if (pAfterStmt) { - Statement* newStmt = gtNewStmt(dest->AsOp()->gtOp1, ilOffset); + Statement* newStmt = gtNewStmt(dest->AsOp()->gtOp1, usedDI); fgInsertStmtAfter(block, *pAfterStmt, newStmt); *pAfterStmt = newStmt; } else { - impAppendTree(dest->AsOp()->gtOp1, curLevel, ilOffset); // do the side effect + impAppendTree(dest->AsOp()->gtOp1, curLevel, usedDI); // do the side effect } // set dest to the second thing @@ -1249,7 +1274,7 @@ GenTree* Compiler::impAssignStruct(GenTree* dest, destAddr = gtNewOperNode(GT_ADDR, TYP_BYREF, dest); } - return (impAssignStructPtr(destAddr, src, structHnd, curLevel, pAfterStmt, ilOffset, block)); + return (impAssignStructPtr(destAddr, src, structHnd, curLevel, pAfterStmt, usedDI, block)); } //------------------------------------------------------------------------ @@ -1261,7 +1286,7 @@ GenTree* Compiler::impAssignStruct(GenTree* dest, // structHnd - handle representing the struct type // curLevel - stack level for which a spill may be being done // pAfterStmt - statement to insert any additional statements after -// ilOffset - il offset for new statements +// di - debug info for new statements // block - block to insert any additional statements in // // Return Value: @@ -1275,16 +1300,17 @@ GenTree* Compiler::impAssignStructPtr(GenTree* destAddr, CORINFO_CLASS_HANDLE structHnd, unsigned curLevel, Statement** pAfterStmt, /* = NULL */ - IL_OFFSETX ilOffset, /* = BAD_IL_OFFSET */ + const DebugInfo& di, /* = DebugInfo() */ BasicBlock* block /* = NULL */ ) { GenTree* dest = nullptr; GenTreeFlags destFlags = GTF_EMPTY; - if (ilOffset == BAD_IL_OFFSET) + DebugInfo usedDI = di; + if (!usedDI.IsValid()) { - ilOffset = impCurStmtOffs; + usedDI = impCurStmtDI; } assert(src->OperIs(GT_LCL_VAR, GT_LCL_FLD, GT_FIELD, GT_IND, GT_OBJ, GT_CALL, GT_MKREFANY, GT_RET_EXPR, GT_COMMA) || @@ -1501,13 +1527,13 @@ GenTree* Compiler::impAssignStructPtr(GenTree* destAddr, GenTree* asg = gtNewAssignNode(ptrSlot, src->AsOp()->gtOp1); if (pAfterStmt) { - Statement* newStmt = gtNewStmt(asg, ilOffset); + Statement* newStmt = gtNewStmt(asg, usedDI); fgInsertStmtAfter(block, *pAfterStmt, newStmt); *pAfterStmt = newStmt; } else { - impAppendTree(asg, curLevel, ilOffset); + impAppendTree(asg, curLevel, usedDI); } // return the assign of the type value, to be appended @@ -1520,14 +1546,14 @@ GenTree* Compiler::impAssignStructPtr(GenTree* destAddr, if (pAfterStmt) { // Insert op1 after '*pAfterStmt' - Statement* newStmt = gtNewStmt(src->AsOp()->gtOp1, ilOffset); + Statement* newStmt = gtNewStmt(src->AsOp()->gtOp1, usedDI); fgInsertStmtAfter(block, *pAfterStmt, newStmt); *pAfterStmt = newStmt; } else if (impLastStmt != nullptr) { // Do the side-effect as a separate statement. - impAppendTree(src->AsOp()->gtOp1, curLevel, ilOffset); + impAppendTree(src->AsOp()->gtOp1, curLevel, usedDI); } else { @@ -1535,12 +1561,12 @@ GenTree* Compiler::impAssignStructPtr(GenTree* destAddr, // in the importer where we can append the side effect. // Instead, we're going to sink the assignment below the COMMA. src->AsOp()->gtOp2 = - impAssignStructPtr(destAddr, src->AsOp()->gtOp2, structHnd, curLevel, pAfterStmt, ilOffset, block); + impAssignStructPtr(destAddr, src->AsOp()->gtOp2, structHnd, curLevel, pAfterStmt, usedDI, block); return src; } // Evaluate the second thing using recursion. - return impAssignStructPtr(destAddr, src->AsOp()->gtOp2, structHnd, curLevel, pAfterStmt, ilOffset, block); + return impAssignStructPtr(destAddr, src->AsOp()->gtOp2, structHnd, curLevel, pAfterStmt, usedDI, block); } else if (src->IsLocal()) { @@ -1689,7 +1715,7 @@ GenTree* Compiler::impGetStructAddr(GenTree* structVal, beforeStmt = oldLastStmt->GetNextStmt(); } - impInsertTreeBefore(structVal->AsOp()->gtOp1, impCurStmtOffs, beforeStmt); + impInsertTreeBefore(structVal->AsOp()->gtOp1, impCurStmtDI, beforeStmt); structVal->AsOp()->gtOp1 = gtNewNothingNode(); } @@ -1729,7 +1755,7 @@ var_types Compiler::impNormStructType(CORINFO_CLASS_HANDLE structHnd, CorInfoTyp const DWORD structFlags = info.compCompHnd->getClassAttribs(structHnd); // Don't bother if the struct contains GC references of byrefs, it can't be a SIMD type. - if ((structFlags & (CORINFO_FLG_CONTAINS_GC_PTR | CORINFO_FLG_CONTAINS_STACK_PTR)) == 0) + if ((structFlags & (CORINFO_FLG_CONTAINS_GC_PTR | CORINFO_FLG_BYREF_LIKE)) == 0) { unsigned originalSize = info.compCompHnd->getClassSize(structHnd); @@ -2321,7 +2347,7 @@ GenTree* Compiler::impRuntimeLookupToTree(CORINFO_RESOLVED_TOKEN* pResolvedToken impSpillSideEffects(true, CHECK_SPILL_ALL DEBUGARG("bubbling QMark0")); unsigned slotLclNum = lvaGrabTemp(true DEBUGARG("impRuntimeLookup test")); - impAssignTempGen(slotLclNum, slotPtrTree, NO_CLASS_HANDLE, (unsigned)CHECK_SPILL_ALL, nullptr, impCurStmtOffs); + impAssignTempGen(slotLclNum, slotPtrTree, NO_CLASS_HANDLE, (unsigned)CHECK_SPILL_ALL, nullptr, impCurStmtDI); GenTree* slot = gtNewLclvNode(slotLclNum, TYP_I_IMPL); // downcast the pointer to a TYP_INT on 64-bit targets @@ -2341,7 +2367,7 @@ GenTree* Compiler::impRuntimeLookupToTree(CORINFO_RESOLVED_TOKEN* pResolvedToken GenTree* asg = gtNewAssignNode(slot, indir); GenTreeColon* colon = new (this, GT_COLON) GenTreeColon(TYP_VOID, gtNewNothingNode(), asg); GenTreeQmark* qmark = gtNewQmarkNode(TYP_VOID, relop, colon); - impAppendTree(qmark, (unsigned)CHECK_SPILL_NONE, impCurStmtOffs); + impAppendTree(qmark, (unsigned)CHECK_SPILL_NONE, impCurStmtDI); return gtNewLclvNode(slotLclNum, TYP_I_IMPL); } @@ -2617,7 +2643,7 @@ inline void Compiler::impSpillSideEffects(bool spillGlobEffects, unsigned chkLev assert(chkLevel <= verCurrentState.esStackDepth); - unsigned spillFlags = spillGlobEffects ? GTF_GLOB_EFFECT : GTF_SIDE_EFFECT; + GenTreeFlags spillFlags = spillGlobEffects ? GTF_GLOB_EFFECT : GTF_SIDE_EFFECT; for (unsigned i = 0; i < chkLevel; i++) { @@ -2822,8 +2848,11 @@ BasicBlock* Compiler::impPushCatchArgOnStack(BasicBlock* hndBlk, CORINFO_CLASS_H { // Report the debug info. impImportBlockCode won't treat the actual handler as exception block and thus // won't do it for us. - impCurStmtOffs = newBlk->bbCodeOffs | IL_OFFSETX_STKBIT; - argStmt = gtNewStmt(argAsg, impCurStmtOffs); + // TODO-DEBUGINFO: Previous code always set stack as non-empty + // here. Can we not just use impCurStmtOffsSet? Are we out of sync + // here with the stack? + impCurStmtDI = DebugInfo(compInlineContext, ILLocation(newBlk->bbCodeOffs, false, false)); + argStmt = gtNewStmt(argAsg, impCurStmtDI); } else { @@ -2872,48 +2901,56 @@ GenTree* Compiler::impCloneExpr(GenTree* tree, // specialized type (e.g. a SIMD type). So we will get the type from // the lclVar AFTER calling impAssignTempGen(). - impAssignTempGen(temp, tree, structHnd, curLevel, pAfterStmt, impCurStmtOffs); + impAssignTempGen(temp, tree, structHnd, curLevel, pAfterStmt, impCurStmtDI); var_types type = genActualType(lvaTable[temp].TypeGet()); *pClone = gtNewLclvNode(temp, type); return gtNewLclvNode(temp, type); } -/***************************************************************************** - * Remember the IL offset (including stack-empty info) for the trees we will - * generate now. - */ - -inline void Compiler::impCurStmtOffsSet(IL_OFFSET offs) +//------------------------------------------------------------------------ +// impCreateDIWithCurrentStackInfo: Create a DebugInfo instance with the +// specified IL offset and 'is call' bit, using the current stack to determine +// whether to set the 'stack empty' bit. +// +// Arguments: +// offs - the IL offset for the DebugInfo +// isCall - whether the created DebugInfo should have the IsCall bit set +// +// Return Value: +// The DebugInfo instance. +// +DebugInfo Compiler::impCreateDIWithCurrentStackInfo(IL_OFFSET offs, bool isCall) { - if (compIsForInlining()) - { - Statement* callStmt = impInlineInfo->iciStmt; - impCurStmtOffs = callStmt->GetILOffsetX(); - } - else - { - assert(offs == BAD_IL_OFFSET || (offs & IL_OFFSETX_BITS) == 0); - IL_OFFSETX stkBit = (verCurrentState.esStackDepth > 0) ? IL_OFFSETX_STKBIT : 0; - impCurStmtOffs = offs | stkBit; - } + assert(offs != BAD_IL_OFFSET); + + bool isStackEmpty = verCurrentState.esStackDepth <= 0; + return DebugInfo(compInlineContext, ILLocation(offs, isStackEmpty, isCall)); } -/***************************************************************************** - * Returns current IL offset with stack-empty and call-instruction info incorporated - */ -inline IL_OFFSETX Compiler::impCurILOffset(IL_OFFSET offs, bool callInstruction) +//------------------------------------------------------------------------ +// impCurStmtOffsSet: Set the "current debug info" to attach to statements that +// we are generating next. +// +// Arguments: +// offs - the IL offset +// +// Remarks: +// This function will be called in the main IL processing loop when it is +// determined that we have reached a location in the IL stream for which we +// want to report debug information. This is the main way we determine which +// statements to report debug info for to the EE: for other statements, they +// will have no debug information attached. +// +inline void Compiler::impCurStmtOffsSet(IL_OFFSET offs) { - if (compIsForInlining()) + if (offs == BAD_IL_OFFSET) { - return BAD_IL_OFFSET; + impCurStmtDI = DebugInfo(compInlineContext, ILLocation()); } else { - assert(offs == BAD_IL_OFFSET || (offs & IL_OFFSETX_BITS) == 0); - IL_OFFSETX stkBit = (verCurrentState.esStackDepth > 0) ? IL_OFFSETX_STKBIT : 0; - IL_OFFSETX callInstructionBit = callInstruction ? IL_OFFSETX_CALLINSTRUCTIONBIT : 0; - return offs | stkBit | callInstructionBit; + impCurStmtDI = impCreateDIWithCurrentStackInfo(offs, false); } } @@ -2978,7 +3015,7 @@ void Compiler::impNoteBranchOffs() { if (opts.compDbgCode) { - impAppendTree(gtNewNothingNode(), (unsigned)CHECK_SPILL_NONE, impCurStmtOffs); + impAppendTree(gtNewNothingNode(), (unsigned)CHECK_SPILL_NONE, impCurStmtDI); } } @@ -2999,11 +3036,6 @@ unsigned Compiler::impInitBlockLineInfo() impCurStmtOffsSet(BAD_IL_OFFSET); - if (compIsForInlining()) - { - return ~0; - } - IL_OFFSET blockOffs = compCurBB->bbCodeOffs; if ((verCurrentState.esStackDepth == 0) && (info.compStmtOffsetsImplicit & ICorDebugInfo::STACK_EMPTY_BOUNDARIES)) @@ -3011,11 +3043,6 @@ unsigned Compiler::impInitBlockLineInfo() impCurStmtOffsSet(blockOffs); } - if (false && (info.compStmtOffsetsImplicit & ICorDebugInfo::CALL_SITE_BOUNDARIES)) - { - impCurStmtOffsSet(blockOffs); - } - /* Always report IL offset 0 or some tests get confused. Probably a good idea anyways */ @@ -3624,7 +3651,6 @@ const char* Compiler::impGetIntrinsicName(CorInfoIntrinsics intrinsicID) "CORINFO_INTRINSIC_Array_Get", "CORINFO_INTRINSIC_Array_Address", "CORINFO_INTRINSIC_Array_Set", - "CORINFO_INTRINSIC_InitializeArray", "CORINFO_INTRINSIC_RTH_GetValueInternal", "CORINFO_INTRINSIC_Object_GetType", "CORINFO_INTRINSIC_StubHelpers_GetStubContext", @@ -3647,6 +3673,120 @@ const char* Compiler::impGetIntrinsicName(CorInfoIntrinsics intrinsicID) #endif // DEBUG +GenTree* Compiler::impCreateSpanIntrinsic(CORINFO_SIG_INFO* sig) +{ + assert(sig->numArgs == 1); + assert(sig->sigInst.methInstCount == 1); + + GenTree* fieldTokenNode = impStackTop(0).val; + + // + // Verify that the field token is known and valid. Note that it's also + // possible for the token to come from reflection, in which case we cannot do + // the optimization and must therefore revert to calling the helper. You can + // see an example of this in bvt\DynIL\initarray2.exe (in Main). + // + + // Check to see if the ldtoken helper call is what we see here. + if (fieldTokenNode->gtOper != GT_CALL || (fieldTokenNode->AsCall()->gtCallType != CT_HELPER) || + (fieldTokenNode->AsCall()->gtCallMethHnd != eeFindHelper(CORINFO_HELP_FIELDDESC_TO_STUBRUNTIMEFIELD))) + { + return nullptr; + } + + // Strip helper call away + fieldTokenNode = fieldTokenNode->AsCall()->gtCallArgs->GetNode(); + if (fieldTokenNode->gtOper == GT_IND) + { + fieldTokenNode = fieldTokenNode->AsOp()->gtOp1; + } + + // Check for constant + if (fieldTokenNode->gtOper != GT_CNS_INT) + { + return nullptr; + } + + CORINFO_FIELD_HANDLE fieldToken = (CORINFO_FIELD_HANDLE)fieldTokenNode->AsIntCon()->gtCompileTimeHandle; + if (!fieldTokenNode->IsIconHandle(GTF_ICON_FIELD_HDL) || (fieldToken == nullptr)) + { + return nullptr; + } + + CORINFO_CLASS_HANDLE fieldOwnerHnd = info.compCompHnd->getFieldClass(fieldToken); + + CORINFO_CLASS_HANDLE fieldClsHnd; + var_types fieldElementType = + JITtype2varType(info.compCompHnd->getFieldType(fieldToken, &fieldClsHnd, fieldOwnerHnd)); + unsigned totalFieldSize; + + // Most static initialization data fields are of some structure, but it is possible for them to be of various + // primitive types as well + if (fieldElementType == var_types::TYP_STRUCT) + { + totalFieldSize = info.compCompHnd->getClassSize(fieldClsHnd); + } + else + { + totalFieldSize = genTypeSize(fieldElementType); + } + + // Limit to primitive or enum type - see ArrayNative::GetSpanDataFrom() + CORINFO_CLASS_HANDLE targetElemHnd = sig->sigInst.methInst[0]; + if (info.compCompHnd->getTypeForPrimitiveValueClass(targetElemHnd) == CORINFO_TYPE_UNDEF) + { + return nullptr; + } + + const unsigned targetElemSize = info.compCompHnd->getClassSize(targetElemHnd); + assert(targetElemSize != 0); + + const unsigned count = totalFieldSize / targetElemSize; + if (count == 0) + { + return nullptr; + } + + void* data = info.compCompHnd->getArrayInitializationData(fieldToken, totalFieldSize); + if (!data) + { + return nullptr; + } + + // + // Ready to commit to the work + // + + impPopStack(); + + // Turn count and pointer value into constants. + GenTree* lengthValue = gtNewIconNode(count, TYP_INT); + GenTree* pointerValue = gtNewIconHandleNode((size_t)data, GTF_ICON_CONST_PTR); + + // Construct ReadOnlySpan to return. + CORINFO_CLASS_HANDLE spanHnd = sig->retTypeClass; + unsigned spanTempNum = lvaGrabTemp(true DEBUGARG("ReadOnlySpan for CreateSpan")); + lvaSetStruct(spanTempNum, spanHnd, false); + + CORINFO_FIELD_HANDLE pointerFieldHnd = info.compCompHnd->getFieldInClass(spanHnd, 0); + CORINFO_FIELD_HANDLE lengthFieldHnd = info.compCompHnd->getFieldInClass(spanHnd, 1); + + GenTreeLclFld* pointerField = gtNewLclFldNode(spanTempNum, TYP_BYREF, 0); + pointerField->SetFieldSeq(GetFieldSeqStore()->CreateSingleton(pointerFieldHnd)); + GenTree* pointerFieldAsg = gtNewAssignNode(pointerField, pointerValue); + + GenTreeLclFld* lengthField = gtNewLclFldNode(spanTempNum, TYP_INT, TARGET_POINTER_SIZE); + lengthField->SetFieldSeq(GetFieldSeqStore()->CreateSingleton(lengthFieldHnd)); + GenTree* lengthFieldAsg = gtNewAssignNode(lengthField, lengthValue); + + // Now append a few statements the initialize the span + impAppendTree(lengthFieldAsg, (unsigned)CHECK_SPILL_NONE, impCurStmtDI); + impAppendTree(pointerFieldAsg, (unsigned)CHECK_SPILL_NONE, impCurStmtDI); + + // And finally create a tree that points at the span. + return impCreateLocalNode(spanTempNum DEBUGARG(0)); +} + //------------------------------------------------------------------------ // impIntrinsic: possibly expand intrinsic call into alternate IR sequence // @@ -3806,6 +3946,14 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, return new (this, GT_LABEL) GenTree(GT_LABEL, TYP_I_IMPL); } + if (((ni == NI_System_Runtime_CompilerServices_RuntimeHelpers_CreateSpan) || + (ni == NI_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray)) && + IsTargetAbi(CORINFO_CORERT_ABI)) + { + // CreateSpan must be expanded for NativeAOT + mustExpand = true; + } + GenTree* retNode = nullptr; // Under debug and minopts, only expand what is required. @@ -3828,10 +3976,6 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, { GenTree* op1; - case CORINFO_INTRINSIC_InitializeArray: - retNode = impInitializeArrayIntrinsic(sig); - break; - case CORINFO_INTRINSIC_Array_Address: case CORINFO_INTRINSIC_Array_Get: case CORINFO_INTRINSIC_Array_Set: @@ -4074,6 +4218,18 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, break; } + case NI_System_Runtime_CompilerServices_RuntimeHelpers_CreateSpan: + { + retNode = impCreateSpanIntrinsic(sig); + break; + } + + case NI_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray: + { + retNode = impInitializeArrayIntrinsic(sig); + break; + } + case NI_System_Span_get_Item: case NI_System_ReadOnlySpan_get_Item: { @@ -5190,6 +5346,18 @@ NamedIntrinsic Compiler::lookupNamedIntrinsic(CORINFO_METHOD_HANDLE method) result = SimdAsHWIntrinsicInfo::lookupId(&sig, className, methodName, enclosingClassName, sizeOfVectorT); } #endif // FEATURE_HW_INTRINSICS + else if ((strcmp(namespaceName, "System.Runtime.CompilerServices") == 0) && + (strcmp(className, "RuntimeHelpers") == 0)) + { + if (strcmp(methodName, "CreateSpan") == 0) + { + result = NI_System_Runtime_CompilerServices_RuntimeHelpers_CreateSpan; + } + else if (strcmp(methodName, "InitializeArray") == 0) + { + result = NI_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray; + } + } else if (strncmp(namespaceName, "System.Runtime.Intrinsics", 25) == 0) { // We go down this path even when FEATURE_HW_INTRINSICS isn't enabled @@ -5646,7 +5814,7 @@ void Compiler::verConvertBBToThrowVerificationException(BasicBlock* block DEBUGA GenTree* op1 = gtNewHelperCallNode(CORINFO_HELP_VERIFICATION, TYP_VOID, gtNewCallArgs(gtNewIconNode(block->bbCodeOffs))); // verCurrentState.esStackDepth = 0; - impAppendTree(op1, (unsigned)CHECK_SPILL_NONE, impCurStmtOffs); + impAppendTree(op1, (unsigned)CHECK_SPILL_NONE, impCurStmtDI); // The inliner is not able to handle methods that require throw block, so // make sure this methods never gets inlined. @@ -5871,7 +6039,7 @@ bool Compiler::verIsByRefLike(const typeInfo& ti) { return false; } - return info.compCompHnd->getClassAttribs(ti.GetClassHandleForValueClass()) & CORINFO_FLG_CONTAINS_STACK_PTR; + return info.compCompHnd->getClassAttribs(ti.GetClassHandleForValueClass()) & CORINFO_FLG_BYREF_LIKE; } bool Compiler::verIsSafeToReturnByRef(const typeInfo& ti) @@ -5892,7 +6060,7 @@ bool Compiler::verIsBoxable(const typeInfo& ti) || ti.IsUnboxedGenericTypeVar() || (ti.IsType(TI_STRUCT) && // exclude byreflike structs - !(info.compCompHnd->getClassAttribs(ti.GetClassHandleForValueClass()) & CORINFO_FLG_CONTAINS_STACK_PTR))); + !(info.compCompHnd->getClassAttribs(ti.GetClassHandleForValueClass()) & CORINFO_FLG_BYREF_LIKE))); } // Is it a boxed value type? @@ -7056,7 +7224,7 @@ void Compiler::impImportAndPushBox(CORINFO_RESOLVED_TOKEN* pResolvedToken) // Assign the boxed object to the box temp. // GenTree* asg = gtNewTempAssign(impBoxTemp, op1); - Statement* asgStmt = impAppendTree(asg, (unsigned)CHECK_SPILL_NONE, impCurStmtOffs); + Statement* asgStmt = impAppendTree(asg, (unsigned)CHECK_SPILL_NONE, impCurStmtDI); // If the exprToBox is a call that returns its value via a ret buf arg, // move the assignment statement(s) before the call (which must be a top level tree). @@ -7178,7 +7346,7 @@ void Compiler::impImportAndPushBox(CORINFO_RESOLVED_TOKEN* pResolvedToken) impSpillSideEffects(true, (unsigned)CHECK_SPILL_ALL DEBUGARG("impImportAndPushBox")); // Set up this copy as a second assignment. - Statement* copyStmt = impAppendTree(op1, (unsigned)CHECK_SPILL_NONE, impCurStmtOffs); + Statement* copyStmt = impAppendTree(op1, (unsigned)CHECK_SPILL_NONE, impCurStmtDI); op1 = gtNewLclvNode(impBoxTemp, TYP_REF); @@ -7676,7 +7844,7 @@ void Compiler::impCheckForPInvokeCall( } } -GenTreeCall* Compiler::impImportIndirectCall(CORINFO_SIG_INFO* sig, IL_OFFSETX ilOffset) +GenTreeCall* Compiler::impImportIndirectCall(CORINFO_SIG_INFO* sig, const DebugInfo& di) { var_types callRetTyp = JITtype2varType(sig->retType); @@ -7714,7 +7882,7 @@ GenTreeCall* Compiler::impImportIndirectCall(CORINFO_SIG_INFO* sig, IL_OFFSETX i /* Create the call node */ - GenTreeCall* call = gtNewIndCallNode(fptr, callRetTyp, nullptr, ilOffset); + GenTreeCall* call = gtNewIndCallNode(fptr, callRetTyp, nullptr, di); call->gtFlags |= GTF_EXCEPT | (fptr->gtFlags & GTF_GLOB_EFFECT); #ifdef UNIX_X86_ABI @@ -8065,7 +8233,7 @@ GenTree* Compiler::impImportStaticFieldAccess(CORINFO_RESOLVED_TOKEN* pResolvedT { FieldSeqNode* fs = GetFieldSeqStore()->CreateSingleton(pResolvedToken->hField); op1 = gtNewOperNode(GT_ADD, op1->TypeGet(), op1, - new (this, GT_CNS_INT) GenTreeIntCon(TYP_INT, pFieldInfo->offset, fs)); + new (this, GT_CNS_INT) GenTreeIntCon(TYP_I_IMPL, pFieldInfo->offset, fs)); } break; } @@ -8267,7 +8435,7 @@ void Compiler::impInsertHelperCall(CORINFO_HELPER_DESC* helperInfo) * Also, consider sticking this in the first basic block. */ GenTree* callout = gtNewHelperCallNode(helperInfo->helperNum, TYP_VOID, args); - impAppendTree(callout, (unsigned)CHECK_SPILL_NONE, impCurStmtOffs); + impAppendTree(callout, (unsigned)CHECK_SPILL_NONE, impCurStmtDI); } //------------------------------------------------------------------------ @@ -8454,7 +8622,7 @@ bool Compiler::impIsImplicitTailCallCandidate( // newObjThis - tree for this pointer or uninitalized newobj temp (or nullptr) // prefixFlags - IL prefix flags for the call // callInfo - EE supplied info for the call -// rawILOffset - IL offset of the opcode +// rawILOffset - IL offset of the opcode, used for guarded devirtualization. // // Returns: // Type of the call's return value. @@ -8483,7 +8651,11 @@ var_types Compiler::impImportCall(OPCODE opcode, { assert(opcode == CEE_CALL || opcode == CEE_CALLVIRT || opcode == CEE_NEWOBJ || opcode == CEE_CALLI); - IL_OFFSETX ilOffset = impCurILOffset(rawILOffset, true); + // The current statement DI may not refer to the exact call, but for calls + // we wish to be able to attach the exact IL instruction to get "return + // value" support in the debugger, so create one with the exact IL offset. + DebugInfo di = impCreateDIWithCurrentStackInfo(rawILOffset, true); + var_types callRetTyp = TYP_COUNT; CORINFO_SIG_INFO* sig = nullptr; CORINFO_METHOD_HANDLE methHnd = nullptr; @@ -8566,7 +8738,7 @@ var_types Compiler::impImportCall(OPCODE opcode, callRetTyp = JITtype2varType(calliSig.retType); - call = impImportIndirectCall(&calliSig, ilOffset); + call = impImportIndirectCall(&calliSig, di); // We don't know the target method, so we have to infer the flags, or // assume the worst-case. @@ -8791,7 +8963,7 @@ var_types Compiler::impImportCall(OPCODE opcode, else { // The stub address is known at compile time - call = gtNewCallNode(CT_USER_FUNC, callInfo->hMethod, callRetTyp, nullptr, ilOffset); + call = gtNewCallNode(CT_USER_FUNC, callInfo->hMethod, callRetTyp, nullptr, di); call->AsCall()->gtStubCallStubAddr = callInfo->stubLookup.constLookup.addr; call->gtFlags |= GTF_CALL_VIRT_STUB; assert(callInfo->stubLookup.constLookup.accessType != IAT_PPVALUE && @@ -8821,7 +8993,7 @@ var_types Compiler::impImportCall(OPCODE opcode, { assert(!(mflags & CORINFO_FLG_STATIC)); // can't call a static method assert(!(clsFlags & CORINFO_FLG_VALUECLASS)); - call = gtNewCallNode(CT_USER_FUNC, callInfo->hMethod, callRetTyp, nullptr, ilOffset); + call = gtNewCallNode(CT_USER_FUNC, callInfo->hMethod, callRetTyp, nullptr, di); call->gtFlags |= GTF_CALL_VIRT_VTABLE; // Should we expand virtual call targets early for this method? @@ -8871,7 +9043,7 @@ var_types Compiler::impImportCall(OPCODE opcode, // Create the actual call node - call = gtNewIndCallNode(fptr, callRetTyp, args, ilOffset); + call = gtNewIndCallNode(fptr, callRetTyp, args, di); call->AsCall()->gtCallThisArg = gtNewCallArgs(thisPtrCopy); call->gtFlags |= GTF_EXCEPT | (fptr->gtFlags & GTF_GLOB_EFFECT); @@ -8898,7 +9070,7 @@ var_types Compiler::impImportCall(OPCODE opcode, case CORINFO_CALL: { // This is for a non-virtual, non-interface etc. call - call = gtNewCallNode(CT_USER_FUNC, callInfo->hMethod, callRetTyp, nullptr, ilOffset); + call = gtNewCallNode(CT_USER_FUNC, callInfo->hMethod, callRetTyp, nullptr, di); // We remove the nullcheck for the GetType call intrinsic. // TODO-CQ: JIT64 does not introduce the null check for many more helper calls @@ -8943,7 +9115,7 @@ var_types Compiler::impImportCall(OPCODE opcode, impAssignTempGen(lclNum, fptr, (unsigned)CHECK_SPILL_ALL); fptr = gtNewLclvNode(lclNum, TYP_I_IMPL); - call = gtNewIndCallNode(fptr, callRetTyp, nullptr, ilOffset); + call = gtNewIndCallNode(fptr, callRetTyp, nullptr, di); call->gtFlags |= GTF_EXCEPT | (fptr->gtFlags & GTF_GLOB_EFFECT); if (callInfo->nullInstanceCheck) { @@ -9384,6 +9556,8 @@ var_types Compiler::impImportCall(OPCODE opcode, const bool isLateDevirtualization = false; impDevirtualizeCall(call->AsCall(), pResolvedToken, &callInfo->hMethod, &callInfo->methodFlags, &callInfo->contextHandle, &exactContextHnd, isLateDevirtualization, isExplicitTailCall, + // Take care to pass raw IL offset here as the 'debug info' might be different for + // inlinees. rawILOffset); } @@ -9436,7 +9610,7 @@ var_types Compiler::impImportCall(OPCODE opcode, } // append the call node. - impAppendTree(call, (unsigned)CHECK_SPILL_ALL, impCurStmtOffs); + impAppendTree(call, (unsigned)CHECK_SPILL_ALL, impCurStmtDI); // Now push the value of the 'new onto the stack @@ -9702,11 +9876,11 @@ var_types Compiler::impImportCall(OPCODE opcode, { // we actually did push something, so don't spill the thing we just pushed. assert(verCurrentState.esStackDepth > 0); - impAppendTree(call, verCurrentState.esStackDepth - 1, impCurStmtOffs); + impAppendTree(call, verCurrentState.esStackDepth - 1, impCurStmtDI); } else { - impAppendTree(call, (unsigned)CHECK_SPILL_ALL, impCurStmtOffs); + impAppendTree(call, (unsigned)CHECK_SPILL_ALL, impCurStmtDI); } } else @@ -9774,7 +9948,11 @@ var_types Compiler::impImportCall(OPCODE opcode, assert(!isFatPointerCandidate); // We should not try to inline calli. // Make the call its own tree (spill the stack if needed). - impAppendTree(call, (unsigned)CHECK_SPILL_ALL, impCurStmtOffs); + // Do not consume the debug info here. This is particularly + // important if we give up on the inline, in which case the + // call will typically end up in the statement that contains + // the GT_RET_EXPR that we leave on the stack. + impAppendTree(call, (unsigned)CHECK_SPILL_ALL, impCurStmtDI, false); // TODO: Still using the widened type. GenTree* retExpr = gtNewInlineCandidateReturnExpr(call, genActualType(callRetTyp), compCurBB->bbFlags); @@ -9797,7 +9975,7 @@ var_types Compiler::impImportCall(OPCODE opcode, if (call->OperGet() != GT_LCL_VAR) // can be already converted by impFixupCallStructReturn. { unsigned calliSlot = lvaGrabTemp(true DEBUGARG("calli")); - LclVarDsc* varDsc = &lvaTable[calliSlot]; + LclVarDsc* varDsc = lvaGetDesc(calliSlot); varDsc->lvVerTypeInfo = tiRetVal; impAssignTempGen(calliSlot, call, tiRetVal.GetClassHandle(), (unsigned)CHECK_SPILL_NONE); // impAssignTempGen can change src arg list and return type for call that returns struct. @@ -10299,7 +10477,7 @@ void Compiler::impImportLeave(BasicBlock* block) callBlock->bbJumpKind = BBJ_CALLFINALLY; // convert the BBJ_LEAVE to BBJ_CALLFINALLY if (endCatches) - impAppendTree(endCatches, (unsigned)CHECK_SPILL_NONE, impCurStmtOffs); + impAppendTree(endCatches, (unsigned)CHECK_SPILL_NONE, impCurStmtDI); #ifdef DEBUG if (verbose) @@ -10386,7 +10564,7 @@ void Compiler::impImportLeave(BasicBlock* block) block->bbJumpKind = BBJ_ALWAYS; // convert the BBJ_LEAVE to a BBJ_ALWAYS if (endCatches) - impAppendTree(endCatches, (unsigned)CHECK_SPILL_NONE, impCurStmtOffs); + impAppendTree(endCatches, (unsigned)CHECK_SPILL_NONE, impCurStmtDI); #ifdef DEBUG if (verbose) @@ -11580,21 +11758,38 @@ void Compiler::impImportBlockCode(BasicBlock* block) #ifdef FEATURE_ON_STACK_REPLACEMENT // Are there any places in the method where we might add a patchpoint? + // if (compHasBackwardJump) { - // Are patchpoints enabled? + // Is OSR enabled? + // if (opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER0) && (JitConfig.TC_OnStackReplacement() > 0)) { - // We don't inline at Tier0, if we do, we may need rethink our approach. - // Could probably support inlines that don't introduce flow. - assert(!compIsForInlining()); - - // Is the start of this block a suitable patchpoint? - // Current strategy is blocks that are stack-empty and backwards branch targets - if (block->bbFlags & BBF_BACKWARD_JUMP_TARGET && (verCurrentState.esStackDepth == 0)) + // OSR is not yet supported for methods with explicit tail calls. + // + // But we also may not switch methods to be optimized as we should be + // able to avoid getting trapped in Tier0 code by normal call counting. + // So instead, just suppress adding patchpoints. + // + if (!compTailPrefixSeen) { - block->bbFlags |= BBF_PATCHPOINT; - setMethodHasPatchpoint(); + assert(compCanHavePatchpoints()); + + // We don't inline at Tier0, if we do, we may need rethink our approach. + // Could probably support inlines that don't introduce flow. + assert(!compIsForInlining()); + + // Is the start of this block a suitable patchpoint? + // + if (((block->bbFlags & BBF_BACKWARD_JUMP_TARGET) != 0) && (verCurrentState.esStackDepth == 0)) + { + // We should have noted this earlier and bailed out of OSR. + // + assert(!block->hasHndIndex()); + + block->bbFlags |= BBF_PATCHPOINT; + setMethodHasPatchpoint(); + } } } } @@ -11614,14 +11809,37 @@ void Compiler::impImportBlockCode(BasicBlock* block) // propagate rareness back through flow and place the partial compilation patchpoints "earlier" // so there are fewer overall. // + // Note unlike OSR, it's ok to forgo these. + // // Todo: stress mode... // - if ((JitConfig.TC_PartialCompilation() > 0) && opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER0) && - (block != fgFirstBB) && block->isRunRarely() && (verCurrentState.esStackDepth == 0) && - ((block->bbFlags & BBF_PATCHPOINT) == 0)) + if (opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER0) && (JitConfig.TC_PartialCompilation() > 0) && + compCanHavePatchpoints() && !compTailPrefixSeen) { - block->bbFlags |= BBF_PARTIAL_COMPILATION_PATCHPOINT; - setMethodHasPartialCompilationPatchpoint(); + // Is this block a good place for partial compilation? + // + if ((block != fgFirstBB) && block->isRunRarely() && (verCurrentState.esStackDepth == 0) && + ((block->bbFlags & BBF_PATCHPOINT) == 0) && !block->hasHndIndex()) + { + JITDUMP("\nBlock " FMT_BB " will be a partial compilation patchpoint -- not importing\n", block->bbNum); + block->bbFlags |= BBF_PARTIAL_COMPILATION_PATCHPOINT; + setMethodHasPartialCompilationPatchpoint(); + + // Change block to BBJ_THROW so we won't trigger importation of successors. + // + block->bbJumpKind = BBJ_THROW; + + // If this method has a explicit generic context, the only uses of it may be in + // the IL for this block. So assume it's used. + // + if (info.compMethodInfo->options & + (CORINFO_GENERICS_CTXT_FROM_METHODDESC | CORINFO_GENERICS_CTXT_FROM_METHODTABLE)) + { + lvaGenericsContextInUse = true; + } + + return; + } } #endif // FEATURE_ON_STACK_REPLACEMENT @@ -11705,111 +11923,108 @@ void Compiler::impImportBlockCode(BasicBlock* block) if (opts.compDbgInfo) #endif { - if (!compIsForInlining()) - { - nxtStmtOffs = - (nxtStmtIndex < info.compStmtOffsetsCount) ? info.compStmtOffsets[nxtStmtIndex] : BAD_IL_OFFSET; + nxtStmtOffs = + (nxtStmtIndex < info.compStmtOffsetsCount) ? info.compStmtOffsets[nxtStmtIndex] : BAD_IL_OFFSET; + + /* Have we reached the next stmt boundary ? */ - /* Have we reached the next stmt boundary ? */ + if (nxtStmtOffs != BAD_IL_OFFSET && opcodeOffs >= nxtStmtOffs) + { + assert(nxtStmtOffs == info.compStmtOffsets[nxtStmtIndex]); - if (nxtStmtOffs != BAD_IL_OFFSET && opcodeOffs >= nxtStmtOffs) + if (verCurrentState.esStackDepth != 0 && opts.compDbgCode) { - assert(nxtStmtOffs == info.compStmtOffsets[nxtStmtIndex]); + /* We need to provide accurate IP-mapping at this point. + So spill anything on the stack so that it will form + gtStmts with the correct stmt offset noted */ - if (verCurrentState.esStackDepth != 0 && opts.compDbgCode) - { - /* We need to provide accurate IP-mapping at this point. - So spill anything on the stack so that it will form - gtStmts with the correct stmt offset noted */ + impSpillStackEnsure(true); + } - impSpillStackEnsure(true); - } + // Have we reported debug info for any tree? - // Has impCurStmtOffs been reported in any tree? + if (impCurStmtDI.IsValid() && opts.compDbgCode) + { + GenTree* placeHolder = new (this, GT_NO_OP) GenTree(GT_NO_OP, TYP_VOID); + impAppendTree(placeHolder, (unsigned)CHECK_SPILL_NONE, impCurStmtDI); - if (impCurStmtOffs != BAD_IL_OFFSET && opts.compDbgCode) - { - GenTree* placeHolder = new (this, GT_NO_OP) GenTree(GT_NO_OP, TYP_VOID); - impAppendTree(placeHolder, (unsigned)CHECK_SPILL_NONE, impCurStmtOffs); + assert(!impCurStmtDI.IsValid()); + } - assert(impCurStmtOffs == BAD_IL_OFFSET); - } + if (!impCurStmtDI.IsValid()) + { + /* Make sure that nxtStmtIndex is in sync with opcodeOffs. + If opcodeOffs has gone past nxtStmtIndex, catch up */ - if (impCurStmtOffs == BAD_IL_OFFSET) + while ((nxtStmtIndex + 1) < info.compStmtOffsetsCount && + info.compStmtOffsets[nxtStmtIndex + 1] <= opcodeOffs) { - /* Make sure that nxtStmtIndex is in sync with opcodeOffs. - If opcodeOffs has gone past nxtStmtIndex, catch up */ - - while ((nxtStmtIndex + 1) < info.compStmtOffsetsCount && - info.compStmtOffsets[nxtStmtIndex + 1] <= opcodeOffs) - { - nxtStmtIndex++; - } + nxtStmtIndex++; + } - /* Go to the new stmt */ + /* Go to the new stmt */ - impCurStmtOffsSet(info.compStmtOffsets[nxtStmtIndex]); + impCurStmtOffsSet(info.compStmtOffsets[nxtStmtIndex]); - /* Update the stmt boundary index */ + /* Update the stmt boundary index */ - nxtStmtIndex++; - assert(nxtStmtIndex <= info.compStmtOffsetsCount); + nxtStmtIndex++; + assert(nxtStmtIndex <= info.compStmtOffsetsCount); - /* Are there any more line# entries after this one? */ + /* Are there any more line# entries after this one? */ - if (nxtStmtIndex < info.compStmtOffsetsCount) - { - /* Remember where the next line# starts */ + if (nxtStmtIndex < info.compStmtOffsetsCount) + { + /* Remember where the next line# starts */ - nxtStmtOffs = info.compStmtOffsets[nxtStmtIndex]; - } - else - { - /* No more line# entries */ + nxtStmtOffs = info.compStmtOffsets[nxtStmtIndex]; + } + else + { + /* No more line# entries */ - nxtStmtOffs = BAD_IL_OFFSET; - } + nxtStmtOffs = BAD_IL_OFFSET; } } - else if ((info.compStmtOffsetsImplicit & ICorDebugInfo::STACK_EMPTY_BOUNDARIES) && - (verCurrentState.esStackDepth == 0)) - { - /* At stack-empty locations, we have already added the tree to - the stmt list with the last offset. We just need to update - impCurStmtOffs - */ + } + else if ((info.compStmtOffsetsImplicit & ICorDebugInfo::STACK_EMPTY_BOUNDARIES) && + (verCurrentState.esStackDepth == 0)) + { + /* At stack-empty locations, we have already added the tree to + the stmt list with the last offset. We just need to update + impCurStmtDI + */ + + impCurStmtOffsSet(opcodeOffs); + } + else if ((info.compStmtOffsetsImplicit & ICorDebugInfo::CALL_SITE_BOUNDARIES) && + impOpcodeIsCallSiteBoundary(prevOpcode)) + { + /* Make sure we have a type cached */ + assert(callTyp != TYP_COUNT); + if (callTyp == TYP_VOID) + { impCurStmtOffsSet(opcodeOffs); } - else if ((info.compStmtOffsetsImplicit & ICorDebugInfo::CALL_SITE_BOUNDARIES) && - impOpcodeIsCallSiteBoundary(prevOpcode)) + else if (opts.compDbgCode) { - /* Make sure we have a type cached */ - assert(callTyp != TYP_COUNT); - - if (callTyp == TYP_VOID) - { - impCurStmtOffsSet(opcodeOffs); - } - else if (opts.compDbgCode) - { - impSpillStackEnsure(true); - impCurStmtOffsSet(opcodeOffs); - } + impSpillStackEnsure(true); + impCurStmtOffsSet(opcodeOffs); } - else if ((info.compStmtOffsetsImplicit & ICorDebugInfo::NOP_BOUNDARIES) && (prevOpcode == CEE_NOP)) + } + else if ((info.compStmtOffsetsImplicit & ICorDebugInfo::NOP_BOUNDARIES) && (prevOpcode == CEE_NOP)) + { + if (opts.compDbgCode) { - if (opts.compDbgCode) - { - impSpillStackEnsure(true); - } - - impCurStmtOffsSet(opcodeOffs); + impSpillStackEnsure(true); } - assert(impCurStmtOffs == BAD_IL_OFFSET || nxtStmtOffs == BAD_IL_OFFSET || - jitGetILoffs(impCurStmtOffs) <= nxtStmtOffs); + impCurStmtOffsSet(opcodeOffs); } + + assert(!impCurStmtDI.IsValid() || (nxtStmtOffs == BAD_IL_OFFSET) || + (impCurStmtDI.GetLocation().GetOffset() <= nxtStmtOffs)); } CORINFO_CLASS_HANDLE clsHnd = DUMMY_INIT(NULL); @@ -11937,14 +12152,14 @@ void Compiler::impImportBlockCode(BasicBlock* block) } /* Append 'op1' to the list of statements */ - impAppendTree(op1, (unsigned)CHECK_SPILL_ALL, impCurStmtOffs); + impAppendTree(op1, (unsigned)CHECK_SPILL_ALL, impCurStmtDI); goto DONE_APPEND; APPEND: /* Append 'op1' to the list of statements */ - impAppendTree(op1, (unsigned)CHECK_SPILL_NONE, impCurStmtOffs); + impAppendTree(op1, (unsigned)CHECK_SPILL_NONE, impCurStmtDI); goto DONE_APPEND; DONE_APPEND: @@ -12786,8 +13001,6 @@ void Compiler::impImportBlockCode(BasicBlock* block) } } - op1 = impCheckForNullPointer(op1); - /* Mark the block as containing an index expression */ if (op1->gtOper == GT_LCL_VAR) @@ -13001,8 +13214,6 @@ void Compiler::impImportBlockCode(BasicBlock* block) op2->gtType = TYP_I_IMPL; } - op3 = impCheckForNullPointer(op3); - // Mark the block as containing an index expression if (op3->gtOper == GT_LCL_VAR) @@ -13464,7 +13675,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) /* GT_JTRUE is handled specially for non-empty stacks. See 'addStmt' in impImportBlock(block). For correct line numbers, spill stack. */ - if (opts.compDbgCode && impCurStmtOffs != BAD_IL_OFFSET) + if (opts.compDbgCode && impCurStmtDI.IsValid()) { impSpillStackEnsure(true); } @@ -13634,13 +13845,13 @@ void Compiler::impImportBlockCode(BasicBlock* block) { impSpillSideEffects(false, (unsigned)CHECK_SPILL_ALL DEBUGARG( "Branch to next Optimization, op1 side effect")); - impAppendTree(gtUnusedValNode(op1), (unsigned)CHECK_SPILL_NONE, impCurStmtOffs); + impAppendTree(gtUnusedValNode(op1), (unsigned)CHECK_SPILL_NONE, impCurStmtDI); } if (op2->gtFlags & GTF_GLOB_EFFECT) { impSpillSideEffects(false, (unsigned)CHECK_SPILL_ALL DEBUGARG( "Branch to next Optimization, op2 side effect")); - impAppendTree(gtUnusedValNode(op2), (unsigned)CHECK_SPILL_NONE, impCurStmtOffs); + impAppendTree(gtUnusedValNode(op2), (unsigned)CHECK_SPILL_NONE, impCurStmtDI); } #ifdef DEBUG @@ -14525,7 +14736,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) if (op1->gtFlags & GTF_SIDE_EFFECT) { op1 = gtUnusedValNode(op1); - impAppendTree(op1, (unsigned)CHECK_SPILL_ALL, impCurStmtOffs); + impAppendTree(op1, (unsigned)CHECK_SPILL_ALL, impCurStmtDI); } goto DO_LDFTN; } @@ -14535,7 +14746,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) if (op1->gtFlags & GTF_SIDE_EFFECT) { op1 = gtUnusedValNode(op1); - impAppendTree(op1, (unsigned)CHECK_SPILL_ALL, impCurStmtOffs); + impAppendTree(op1, (unsigned)CHECK_SPILL_ALL, impCurStmtDI); } goto DO_LDFTN; } @@ -14668,7 +14879,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) info.compCompHnd->getChildType(resolvedToken.hClass, &elemTypeHnd); assert(!(elemTypeHnd == nullptr && corType == CORINFO_TYPE_VALUECLASS)); Verify(elemTypeHnd == nullptr || - !(info.compCompHnd->getClassAttribs(elemTypeHnd) & CORINFO_FLG_CONTAINS_STACK_PTR), + !(info.compCompHnd->getClassAttribs(elemTypeHnd) & CORINFO_FLG_BYREF_LIKE), "newarr of byref-like objects"); verVerifyCall(opcode, &resolvedToken, nullptr, ((prefixFlags & PREFIX_TAILCALL_EXPLICIT) != 0), ((prefixFlags & PREFIX_READONLY) != 0), delegateCreateStart, codeAddr - 1, @@ -14787,7 +14998,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) gtNewIconNode(0), // Value false, // isVolatile false); // not copyBlock - impAppendTree(newObjThisPtr, (unsigned)CHECK_SPILL_NONE, impCurStmtOffs); + impAppendTree(newObjThisPtr, (unsigned)CHECK_SPILL_NONE, impCurStmtDI); } else { @@ -15192,7 +15403,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) if (obj->gtFlags & GTF_SIDE_EFFECT) { obj = gtUnusedValNode(obj); - impAppendTree(obj, (unsigned)CHECK_SPILL_ALL, impCurStmtOffs); + impAppendTree(obj, (unsigned)CHECK_SPILL_ALL, impCurStmtDI); } obj = nullptr; } @@ -15212,8 +15423,6 @@ void Compiler::impImportBlockCode(BasicBlock* block) case CORINFO_FIELD_INSTANCE_WITH_BASE: #endif { - obj = impCheckForNullPointer(obj); - // If the object is a struct, what we really want is // for the field to operate on the address of the struct. if (!varTypeGCtype(obj->TypeGet()) && impIsValueType(tiObj)) @@ -15524,7 +15733,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) if (obj->gtFlags & GTF_SIDE_EFFECT) { obj = gtUnusedValNode(obj); - impAppendTree(obj, (unsigned)CHECK_SPILL_ALL, impCurStmtOffs); + impAppendTree(obj, (unsigned)CHECK_SPILL_ALL, impCurStmtDI); } obj = nullptr; } @@ -15542,8 +15751,6 @@ void Compiler::impImportBlockCode(BasicBlock* block) case CORINFO_FIELD_INSTANCE_WITH_BASE: #endif { - obj = impCheckForNullPointer(obj); - /* Create the data member node */ op1 = gtNewFieldRef(lclTyp, resolvedToken.hField, obj, fieldInfo.offset); DWORD typeFlags = info.compCompHnd->getClassAttribs(resolvedToken.hClass); @@ -15790,7 +15997,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) CORINFO_CLASS_HANDLE elemTypeHnd; info.compCompHnd->getChildType(resolvedToken.hClass, &elemTypeHnd); Verify(elemTypeHnd == nullptr || - !(info.compCompHnd->getClassAttribs(elemTypeHnd) & CORINFO_FLG_CONTAINS_STACK_PTR), + !(info.compCompHnd->getClassAttribs(elemTypeHnd) & CORINFO_FLG_BYREF_LIKE), "array of byref-like type"); } @@ -16128,7 +16335,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) // The pointer may have side-effects if (op1->AsOp()->gtOp1->gtFlags & GTF_SIDE_EFFECT) { - impAppendTree(op1->AsOp()->gtOp1, (unsigned)CHECK_SPILL_ALL, impCurStmtOffs); + impAppendTree(op1->AsOp()->gtOp1, (unsigned)CHECK_SPILL_ALL, impCurStmtDI); #ifdef DEBUG impNoteLastILoffs(); #endif @@ -16356,7 +16563,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) // may be other trees on the evaluation stack that side-effect the // sources of the UNBOX operation we must spill the stack. - impAppendTree(op1, (unsigned)CHECK_SPILL_ALL, impCurStmtOffs); + impAppendTree(op1, (unsigned)CHECK_SPILL_ALL, impCurStmtDI); // Create the address-expression to reference past the object header // to the beginning of the value-type. Today this means adjusting @@ -17725,10 +17932,11 @@ bool Compiler::impReturnInstruction(int prefixFlags, OPCODE& opcode) else if (info.compRetBuffArg != BAD_VAR_NUM) { // Assign value to return buff (first param) - GenTree* retBuffAddr = gtNewLclvNode(info.compRetBuffArg, TYP_BYREF DEBUGARG(impCurStmtOffs)); + GenTree* retBuffAddr = + gtNewLclvNode(info.compRetBuffArg, TYP_BYREF DEBUGARG(impCurStmtDI.GetLocation().GetOffset())); op2 = impAssignStructPtr(retBuffAddr, op2, retClsHnd, (unsigned)CHECK_SPILL_ALL); - impAppendTree(op2, (unsigned)CHECK_SPILL_NONE, impCurStmtOffs); + impAppendTree(op2, (unsigned)CHECK_SPILL_NONE, impCurStmtDI); // There are cases where the address of the implicit RetBuf should be returned explicitly (in RAX). CLANG_FORMAT_COMMENT_ANCHOR; @@ -17800,7 +18008,7 @@ bool Compiler::impReturnInstruction(int prefixFlags, OPCODE& opcode) } } - impAppendTree(op1, (unsigned)CHECK_SPILL_NONE, impCurStmtOffs); + impAppendTree(op1, (unsigned)CHECK_SPILL_NONE, impCurStmtDI); #ifdef DEBUG // Remember at which BC offset the tree was finished impNoteLastILoffs(); @@ -18799,10 +19007,7 @@ void Compiler::impRetypeEntryStateTemps(BasicBlock* blk) GenTree* tree = es->esStack[level].val; if ((tree->gtOper == GT_LCL_VAR) || (tree->gtOper == GT_LCL_FLD)) { - unsigned lclNum = tree->AsLclVarCommon()->GetLclNum(); - noway_assert(lclNum < lvaCount); - LclVarDsc* varDsc = lvaTable + lclNum; - es->esStack[level].val->gtType = varDsc->TypeGet(); + es->esStack[level].val->gtType = lvaGetDesc(tree->AsLclVarCommon())->TypeGet(); } } } @@ -18828,7 +19033,7 @@ unsigned Compiler::impGetSpillTmpBase(BasicBlock* block) SetSpillTempsBase callback(baseTmp); // We do *NOT* need to reset the SpillClique*Members because a block can only be the predecessor - // to one spill clique, and similarly can only be the sucessor to one spill clique + // to one spill clique, and similarly can only be the successor to one spill clique impWalkSpillCliqueFromPred(block, &callback); return baseTmp; @@ -19766,6 +19971,7 @@ void Compiler::impCheckCanInline(GenTreeCall* call, pInfo->initClassResult = initClassResult; pInfo->fncRetType = fncRetType; pInfo->exactContextNeedsRuntimeLookup = false; + pInfo->inlinersContext = pParam->pThis->compInlineContext; // Note exactContextNeedsRuntimeLookup is reset later on, // over in impMarkInlineCandidate. @@ -20611,7 +20817,7 @@ GenTree* Compiler::impInlineFetchArg(unsigned lclNum, InlArgInfo* inlArgInfo, In // Enable for all parameterless (=invariant) hw intrinsics such as // Vector128<>.Zero and Vector256<>.AllBitSets. We might consider // doing that for Vector.Create(cns) as well. - if ((argNode->gtGetOp1() == nullptr) && (argNode->gtGetOp2() == nullptr)) + if (argNode->AsHWIntrinsic()->GetOperandCount() == 0) { substitute = true; } @@ -20732,7 +20938,7 @@ bool Compiler::impInlineIsGuaranteedThisDerefBeforeAnySideEffects(GenTree* for (unsigned level = 0; level < verCurrentState.esStackDepth; level++) { - unsigned stackTreeFlags = verCurrentState.esStack[level].val->gtFlags; + GenTreeFlags stackTreeFlags = verCurrentState.esStack[level].val->gtFlags; if (GTF_GLOBALLY_VISIBLE_SIDE_EFFECTS(stackTreeFlags)) { return false; @@ -20874,6 +21080,14 @@ void Compiler::impMarkInlineCandidateHelper(GenTreeCall* call, return; } + // Delegate Invoke method doesn't have a body and gets special cased instead. + // Don't even bother trying to inline it. + if (call->IsDelegateInvoke()) + { + inlineResult.NoteFatal(InlineObservation::CALLEE_HAS_NO_BODY); + return; + } + // Tail recursion elimination takes precedence over inlining. // TODO: We may want to do some of the additional checks from fgMorphCall // here to reduce the chance we don't inline a call that won't be optimized @@ -21233,7 +21447,7 @@ void Compiler::impDevirtualizeCall(GenTreeCall* call, CORINFO_CONTEXT_HANDLE* pExactContextHandle, bool isLateDevirtualization, bool isExplicitTailCall, - IL_OFFSETX ilOffset) + IL_OFFSET ilOffset) { assert(call != nullptr); assert(method != nullptr); @@ -21244,10 +21458,19 @@ void Compiler::impDevirtualizeCall(GenTreeCall* call, // assert(call->IsVirtual()); - // Possibly instrument, if not optimizing. + // Possibly instrument. Note for OSR+PGO we will instrument when + // optimizing and (currently) won't devirtualize. We may want + // to revisit -- if we can devirtualize we should be able to + // suppress the probe. // - if (opts.OptimizationDisabled()) + // We strip BBINSTR from inlinees currently, so we'll only + // do this for the root method calls. + // + if (opts.jitFlags->IsSet(JitFlags::JIT_FLAG_BBINSTR)) { + assert(opts.OptimizationDisabled() || opts.IsOSR()); + assert(!compIsForInlining()); + // During importation, optionally flag this block as one that // contains calls requiring class profiling. Ideally perhaps // we'd just keep track of the calls themselves, so we don't @@ -21277,7 +21500,12 @@ void Compiler::impDevirtualizeCall(GenTreeCall* call, // compCurBB->bbFlags |= BBF_HAS_CLASS_PROFILE; } + return; + } + // Bail if optimizations are disabled. + if (opts.OptimizationDisabled()) + { return; } @@ -22123,7 +22351,7 @@ void Compiler::addFatPointerCandidate(GenTreeCall* call) // Arguments: // // call - potential guarded devirtualization candidate -// ilOffset - IL offset of the call instruction +// ilOffset - IL ofset of the call instruction // isInterface - true if this is an interface call // baseMethod - target method of the call // baseClass - class that introduced the target method @@ -22137,7 +22365,7 @@ void Compiler::addFatPointerCandidate(GenTreeCall* call) // void Compiler::considerGuardedDevirtualization( GenTreeCall* call, - IL_OFFSETX ilOffset, + IL_OFFSET ilOffset, bool isInterface, CORINFO_METHOD_HANDLE baseMethod, CORINFO_CLASS_HANDLE baseClass, @@ -22230,6 +22458,17 @@ void Compiler::considerGuardedDevirtualization( return; } + uint32_t const likelyClassAttribs = info.compCompHnd->getClassAttribs(likelyClass); + + if ((likelyClassAttribs & CORINFO_FLG_ABSTRACT) != 0) + { + // We may see an abstract likely class, if we have a stale profile. + // No point guessing for this. + // + JITDUMP("Not guessing for class; abstract (stale profile)\n"); + return; + } + // Figure out which method will be called. // CORINFO_DEVIRTUALIZATION_INFO dvInfo; @@ -22253,7 +22492,6 @@ void Compiler::considerGuardedDevirtualization( // Add this as a potential candidate. // uint32_t const likelyMethodAttribs = info.compCompHnd->getMethodAttribs(likelyMethod); - uint32_t const likelyClassAttribs = info.compCompHnd->getClassAttribs(likelyClass); addGuardedDevirtualizationCandidate(call, likelyMethod, likelyClass, likelyMethodAttribs, likelyClassAttribs, likelihood); } diff --git a/src/coreclr/jit/indirectcalltransformer.cpp b/src/coreclr/jit/indirectcalltransformer.cpp index 6be64a86b6ebbb..c1922755647940 100644 --- a/src/coreclr/jit/indirectcalltransformer.cpp +++ b/src/coreclr/jit/indirectcalltransformer.cpp @@ -364,7 +364,7 @@ class IndirectCallTransformer GenTree* zero = new (compiler, GT_CNS_INT) GenTreeIntCon(TYP_I_IMPL, 0); GenTree* fatPointerCmp = compiler->gtNewOperNode(GT_NE, TYP_INT, fatPointerAnd, zero); GenTree* jmpTree = compiler->gtNewOperNode(GT_JTRUE, TYP_VOID, fatPointerCmp); - Statement* jmpStmt = compiler->fgNewStmtFromTree(jmpTree, stmt->GetILOffsetX()); + Statement* jmpStmt = compiler->fgNewStmtFromTree(jmpTree, stmt->GetDebugInfo()); compiler->fgInsertStmtAtEnd(checkBlock, jmpStmt); } @@ -595,7 +595,7 @@ class IndirectCallTransformer const unsigned thisTempNum = compiler->lvaGrabTemp(true DEBUGARG("guarded devirt this temp")); // lvaSetClass(thisTempNum, ...); GenTree* asgTree = compiler->gtNewTempAssign(thisTempNum, thisTree); - Statement* asgStmt = compiler->fgNewStmtFromTree(asgTree, stmt->GetILOffsetX()); + Statement* asgStmt = compiler->fgNewStmtFromTree(asgTree, stmt->GetDebugInfo()); compiler->fgInsertStmtAtEnd(checkBlock, asgStmt); thisTree = compiler->gtNewLclvNode(thisTempNum, TYP_REF); @@ -624,7 +624,7 @@ class IndirectCallTransformer // GenTree* methodTableCompare = compiler->gtNewOperNode(GT_NE, TYP_INT, targetMethodTable, methodTable); GenTree* jmpTree = compiler->gtNewOperNode(GT_JTRUE, TYP_VOID, methodTableCompare); - Statement* jmpStmt = compiler->fgNewStmtFromTree(jmpTree, stmt->GetILOffsetX()); + Statement* jmpStmt = compiler->fgNewStmtFromTree(jmpTree, stmt->GetDebugInfo()); compiler->fgInsertStmtAtEnd(checkBlock, jmpStmt); } @@ -781,14 +781,14 @@ class IndirectCallTransformer } else { - compiler->fgNewStmtAtEnd(thenBlock, call); + compiler->fgNewStmtAtEnd(thenBlock, call, stmt->GetDebugInfo()); } } else { // Add the call. // - compiler->fgNewStmtAtEnd(thenBlock, call); + compiler->fgNewStmtAtEnd(thenBlock, call, stmt->GetDebugInfo()); // Re-establish this call as an inline candidate. // @@ -831,7 +831,7 @@ class IndirectCallTransformer elseBlock = CreateAndInsertBasicBlock(BBJ_NONE, thenBlock); elseBlock->bbFlags |= currBlock->bbFlags & BBF_SPLIT_GAINED; GenTreeCall* call = origCall; - Statement* newStmt = compiler->gtNewStmt(call); + Statement* newStmt = compiler->gtNewStmt(call, stmt->GetDebugInfo()); call->gtFlags &= ~GTF_CALL_INLINE_CANDIDATE; call->SetIsGuarded(); @@ -1170,13 +1170,13 @@ class IndirectCallTransformer assert(sizeCheck->OperIs(GT_LE)); GenTree* sizeJmpTree = compiler->gtNewOperNode(GT_JTRUE, TYP_VOID, sizeCheck); - Statement* sizeJmpStmt = compiler->fgNewStmtFromTree(sizeJmpTree, stmt->GetILOffsetX()); + Statement* sizeJmpStmt = compiler->fgNewStmtFromTree(sizeJmpTree, stmt->GetDebugInfo()); 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()); + Statement* nullJmpStmt = compiler->fgNewStmtFromTree(nullJmpTree, stmt->GetDebugInfo()); compiler->fgInsertStmtAtEnd(checkBlock2, nullJmpStmt); } @@ -1195,7 +1195,7 @@ class IndirectCallTransformer origCall->gtCallArgs = argsIter.GetUse(); GenTree* asg = compiler->gtNewTempAssign(resultLclNum, resultHandle); - Statement* asgStmt = compiler->gtNewStmt(asg, stmt->GetILOffsetX()); + Statement* asgStmt = compiler->gtNewStmt(asg, stmt->GetDebugInfo()); compiler->fgInsertStmtAtEnd(thenBlock, asgStmt); } @@ -1206,7 +1206,7 @@ class IndirectCallTransformer { elseBlock = CreateAndInsertBasicBlock(BBJ_NONE, thenBlock); GenTree* asg = compiler->gtNewTempAssign(resultLclNum, origCall); - Statement* asgStmt = compiler->gtNewStmt(asg, stmt->GetILOffsetX()); + Statement* asgStmt = compiler->gtNewStmt(asg, stmt->GetDebugInfo()); compiler->fgInsertStmtAtEnd(elseBlock, asgStmt); } diff --git a/src/coreclr/jit/inline.cpp b/src/coreclr/jit/inline.cpp index fea132190a56bb..546eb2aa376f9d 100644 --- a/src/coreclr/jit/inline.cpp +++ b/src/coreclr/jit/inline.cpp @@ -332,7 +332,6 @@ InlineContext::InlineContext(InlineStrategy* strategy) , m_Code(nullptr) , m_ILSize(0) , m_ImportedILSize(0) - , m_Offset(BAD_IL_OFFSET) , m_Observation(InlineObservation::CALLEE_UNUSED_INITIAL) , m_CodeSizeEstimate(0) , m_Success(true) @@ -344,7 +343,11 @@ InlineContext::InlineContext(InlineStrategy* strategy) , m_Callee(nullptr) , m_TreeID(0) , m_Ordinal(0) + , m_ActualCallOffset(BAD_IL_OFFSET) #endif // defined(DEBUG) || defined(INLINE_DATA) +#ifdef DEBUG + , m_ILInstsSet(nullptr) +#endif { // Empty } @@ -356,13 +359,14 @@ InlineContext::InlineContext(InlineStrategy* strategy) // // Arguments: // indent - indentation level for this node +// verbose - more verbose output if true -void InlineContext::Dump(unsigned indent) +void InlineContext::Dump(bool verbose, unsigned indent) { // Handle fact that siblings are in reverse order. if (m_Sibling != nullptr) { - m_Sibling->Dump(indent); + m_Sibling->Dump(verbose, indent); } // We may not know callee name in some of the failing cases @@ -391,35 +395,63 @@ void InlineContext::Dump(unsigned indent) { // Root method InlinePolicy* policy = InlinePolicy::GetPolicy(compiler, true); - printf("Inlines into %08X [via %s] %s\n", calleeToken, policy->GetName(), calleeName); + + if (verbose) + { + printf("\nInlines into %08X [via %s] %s:\n", calleeToken, policy->GetName(), calleeName); + } + else + { + printf("\nInlines into %s:\n", calleeName); + } } else { // Inline attempt. const char* inlineTarget = InlGetTargetString(m_Observation); const char* inlineReason = InlGetObservationString(m_Observation); - const char* inlineResult = m_Success ? "" : "FAILED: "; - const char* devirtualized = m_Devirtualized ? " devirt" : ""; - const char* guarded = m_Guarded ? " guarded" : ""; - const char* unboxed = m_Unboxed ? " unboxed" : ""; + const char* inlineResult = m_Success ? "INLINED: " : "FAILED: "; + const char* devirtualized = m_Devirtualized ? " DEVIRT" : ""; + const char* guarded = m_Guarded ? " GUARDED" : ""; + const char* unboxed = m_Unboxed ? " UNBOXED" : ""; + + IL_OFFSET offs = BAD_IL_OFFSET; - if (m_Offset == BAD_IL_OFFSET) +#if defined(DEBUG) || defined(INLINE_DATA) + offs = m_ActualCallOffset; +#endif + + if (offs == BAD_IL_OFFSET && m_Location.IsValid()) { - printf("%*s[%u IL=???? TR=%06u %08X] [%s%s: %s%s%s%s] %s\n", indent, "", m_Ordinal, m_TreeID, calleeToken, - inlineResult, inlineTarget, inlineReason, guarded, devirtualized, unboxed, calleeName); + offs = m_Location.GetOffset(); + } + + if (verbose) + { + if (offs == BAD_IL_OFFSET) + { + printf("%*s[" FMT_INL_CTX " IL=???? TR=%06u %08X] [%s%s: %s%s%s%s] %s\n", indent, "", m_Ordinal, + m_TreeID, calleeToken, inlineResult, inlineTarget, inlineReason, guarded, devirtualized, unboxed, + calleeName); + } + else + { + printf("%*s[" FMT_INL_CTX " IL=%04d TR=%06u %08X] [%s%s: %s%s%s%s] %s\n", indent, "", m_Ordinal, offs, + m_TreeID, calleeToken, inlineResult, inlineTarget, inlineReason, guarded, devirtualized, unboxed, + calleeName); + } } else { - IL_OFFSET offset = jitGetILoffs(m_Offset); - printf("%*s[%u IL=%04d TR=%06u %08X] [%s%s: %s%s%s%s] %s\n", indent, "", m_Ordinal, offset, m_TreeID, - calleeToken, inlineResult, inlineTarget, inlineReason, guarded, devirtualized, unboxed, calleeName); + printf("%*s[%s%s%s%s%s] %s\n", indent, "", inlineResult, inlineReason, guarded, devirtualized, unboxed, + calleeName); } } // Recurse to first child if (m_Child != nullptr) { - m_Child->Dump(indent + 2); + m_Child->Dump(verbose, indent + 2); } } @@ -455,7 +487,7 @@ void InlineContext::DumpData(unsigned indent) else if (m_Success) { const char* inlineReason = InlGetObservationString(m_Observation); - printf("%*s%u,\"%s\",\"%s\",", indent, "", m_Ordinal, inlineReason, calleeName); + printf("%*s%u,\"%s\",\"%s\",", indent, "", GetOrdinal(), inlineReason, calleeName); m_Policy->DumpData(jitstdout); printf("\n"); } @@ -537,11 +569,7 @@ void InlineContext::DumpXml(FILE* file, unsigned indent) buf[sizeof(buf) - 1] = 0; EscapeNameForXml(buf); - int offset = -1; - if (m_Offset != BAD_IL_OFFSET) - { - offset = (int)jitGetILoffs(m_Offset); - } + int offset = m_Location.IsValid() ? m_Location.GetOffset() : -1; fprintf(file, "%*s<%s>\n", indent, "", inlineType); fprintf(file, "%*s%08x\n", indent + 2, "", calleeToken); @@ -636,13 +664,13 @@ InlineResult::InlineResult(Compiler* compiler, GenTreeCall* call, Statement* stm // Pass along some optional information to the policy. if (stmt != nullptr) { - m_InlineContext = stmt->GetInlineContext(); + m_InlineContext = stmt->GetDebugInfo().GetInlineContext(); m_Policy->NoteContext(m_InlineContext); #if defined(DEBUG) || defined(INLINE_DATA) m_Policy->NoteOffset(call->gtRawILOffset); #else - m_Policy->NoteOffset(stmt->GetILOffsetX()); + m_Policy->NoteOffset(stmt->GetDebugInfo().GetLocation().GetOffset()); #endif // defined(DEBUG) || defined(INLINE_DATA) } @@ -763,21 +791,7 @@ void InlineResult::Report() if ((m_Callee != nullptr) && (obs != InlineObservation::CALLEE_IS_NOINLINE)) { - -#ifdef DEBUG - - const char* obsString = InlGetObservationString(obs); - - if (VERBOSE) - { - JITDUMP("\nINLINER: Marking %s as NOINLINE because of %s\n", callee, obsString); - } - else if (m_RootCompiler->fgPrintInlinedMethods) - { - printf("Marking %s as NOINLINE because of %s\n", callee, obsString); - } - -#endif // DEBUG + JITDUMP("\nINLINER: Marking %s as NOINLINE because of %s\n", callee, InlGetObservationString(obs)); COMP_HANDLE comp = m_RootCompiler->info.compCompHnd; comp->setMethodAttribs(m_Callee, CORINFO_FLG_BAD_INLINEE); @@ -1237,137 +1251,101 @@ InlineContext* InlineStrategy::NewRoot() return rootContext; } -//------------------------------------------------------------------------ -// NewSuccess: construct an InlineContext for a successful inline -// and link it into the context tree -// -// Arguments: -// inlineInfo - information about this inline -// -// Return Value: -// A new InlineContext for statements brought into the method by -// this inline. - -InlineContext* InlineStrategy::NewSuccess(InlineInfo* inlineInfo) +InlineContext* InlineStrategy::NewContext(InlineContext* parentContext, Statement* stmt, GenTreeCall* call) { - InlineContext* calleeContext = new (m_Compiler, CMK_Inlining) InlineContext(this); - Statement* stmt = inlineInfo->iciStmt; - BYTE* calleeIL = inlineInfo->inlineCandidateInfo->methInfo.ILCode; - unsigned calleeILSize = inlineInfo->inlineCandidateInfo->methInfo.ILCodeSize; - InlineContext* parentContext = stmt->GetInlineContext(); - GenTreeCall* originalCall = inlineInfo->inlineResult->GetCall(); - - noway_assert(parentContext != nullptr); - - calleeContext->m_Code = calleeIL; - calleeContext->m_ILSize = calleeILSize; - calleeContext->m_Parent = parentContext; - // Push on front here will put siblings in reverse lexical - // order which we undo in the dumper - calleeContext->m_Sibling = parentContext->m_Child; - parentContext->m_Child = calleeContext; - calleeContext->m_Child = nullptr; - calleeContext->m_Offset = stmt->GetILOffsetX(); - calleeContext->m_Observation = inlineInfo->inlineResult->GetObservation(); - calleeContext->m_Success = true; - calleeContext->m_Devirtualized = originalCall->IsDevirtualized(); - calleeContext->m_Guarded = originalCall->IsGuarded(); - calleeContext->m_Unboxed = originalCall->IsUnboxed(); - calleeContext->m_ImportedILSize = inlineInfo->inlineResult->GetImportedILSize(); - -#if defined(DEBUG) || defined(INLINE_DATA) - - InlinePolicy* policy = inlineInfo->inlineResult->GetPolicy(); + InlineContext* context = new (m_Compiler, CMK_Inlining) InlineContext(this); - calleeContext->m_Policy = policy; - calleeContext->m_CodeSizeEstimate = policy->CodeSizeEstimate(); - calleeContext->m_Callee = inlineInfo->fncHandle; - // +1 here since we set this before calling NoteOutcome. - calleeContext->m_Ordinal = m_InlineCount + 1; - // Update offset with more accurate info - calleeContext->m_Offset = originalCall->gtRawILOffset; - -#endif // defined(DEBUG) || defined(INLINE_DATA) - -#if defined(DEBUG) + context->m_InlineStrategy = this; + context->m_Parent = parentContext; + context->m_Sibling = parentContext->m_Child; + parentContext->m_Child = context; - calleeContext->m_TreeID = originalCall->gtTreeID; + // In debug builds we record inline contexts in all produced calls to be + // able to show all failed inlines in the inline tree, even non-candidates. + // These should always match the parent context we are seeing here. + assert(parentContext == call->gtInlineContext); -#endif // defined(DEBUG) + if (call->IsInlineCandidate()) + { + InlineCandidateInfo* info = call->gtInlineCandidateInfo; + context->m_Code = info->methInfo.ILCode; + context->m_ILSize = info->methInfo.ILCodeSize; - NoteOutcome(calleeContext); +#ifdef DEBUG + // All inline candidates should get their own statements that have + // appropriate debug info (or no debug info). + InlineContext* diInlineContext = stmt->GetDebugInfo().GetInlineContext(); + assert(diInlineContext == nullptr || diInlineContext == parentContext); +#endif + } - return calleeContext; -} + // TODO-DEBUGINFO: Currently, to keep the same behavior as before, we use + // the location of the statement containing the call being inlined. This is + // not always the exact IL offset of the call instruction, consider e.g. + // ldarg.0 + // call + // which becomes a single statement where the IL location points to the + // ldarg instruction. For SPGO purposes we should consider always storing + // the exact offset of the call instruction which will be more precise. We + // may consider storing the statement itself as well. + context->m_Location = stmt->GetDebugInfo().GetLocation(); + context->m_Devirtualized = call->IsDevirtualized(); + context->m_Guarded = call->IsGuarded(); + context->m_Unboxed = call->IsUnboxed(); #if defined(DEBUG) || defined(INLINE_DATA) + context->m_TreeID = call->gtTreeID; + context->m_Callee = call->gtCallType == CT_INDIRECT ? nullptr : call->gtCallMethHnd; + context->m_ActualCallOffset = call->gtRawILOffset; +#endif -//------------------------------------------------------------------------ -// NewFailure: construct an InlineContext for a failing inline -// and link it into the context tree -// -// Arguments: -// stmt - statement containing the attempted inline -// inlineResult - inlineResult for the attempt -// -// Return Value: -// A new InlineContext for diagnostic purposes + return context; +} -InlineContext* InlineStrategy::NewFailure(Statement* stmt, InlineResult* inlineResult) +void InlineContext::SetSucceeded(const InlineInfo* info) { - // Check for a parent context first. We should now have a parent - // context for all statements. - InlineContext* parentContext = stmt->GetInlineContext(); - assert(parentContext != nullptr); - InlineContext* failedContext = new (m_Compiler, CMK_Inlining) InlineContext(this); - GenTreeCall* originalCall = inlineResult->GetCall(); - - // Pushing the new context on the front of the parent child list - // will put siblings in reverse lexical order which we undo in the - // dumper. - failedContext->m_Parent = parentContext; - failedContext->m_Sibling = parentContext->m_Child; - parentContext->m_Child = failedContext; - failedContext->m_Child = nullptr; - failedContext->m_Offset = stmt->GetILOffsetX(); - failedContext->m_Observation = inlineResult->GetObservation(); - failedContext->m_Callee = inlineResult->GetCallee(); - failedContext->m_Success = false; - failedContext->m_Devirtualized = originalCall->IsDevirtualized(); - failedContext->m_Guarded = originalCall->IsGuarded(); - failedContext->m_Unboxed = originalCall->IsUnboxed(); - - assert(InlIsValidObservation(failedContext->m_Observation)); + assert(InlIsValidObservation(info->inlineResult->GetObservation())); + m_Observation = info->inlineResult->GetObservation(); + m_ImportedILSize = info->inlineResult->GetImportedILSize(); + m_Success = true; #if defined(DEBUG) || defined(INLINE_DATA) + m_Policy = info->inlineResult->GetPolicy(); + m_CodeSizeEstimate = m_Policy->CodeSizeEstimate(); + m_Ordinal = m_InlineStrategy->m_InlineCount + 1; +#endif - // Update offset with more accurate info - failedContext->m_Offset = originalCall->gtRawILOffset; - -#endif // #if defined(DEBUG) || defined(INLINE_DATA) - -#if defined(DEBUG) - - failedContext->m_TreeID = originalCall->gtTreeID; + m_InlineStrategy->NoteOutcome(this); +} -#endif // defined(DEBUG) +void InlineContext::SetFailed(const InlineResult* result) +{ + assert(InlIsValidObservation(result->GetObservation())); + m_Observation = result->GetObservation(); + m_ImportedILSize = result->GetImportedILSize(); + m_Success = false; - NoteOutcome(failedContext); +#if defined(DEBUG) || defined(INLINE_DATA) + m_Policy = result->GetPolicy(); + m_CodeSizeEstimate = m_Policy->CodeSizeEstimate(); +#endif - return failedContext; + m_InlineStrategy->NoteOutcome(this); } +#if defined(DEBUG) || defined(INLINE_DATA) + //------------------------------------------------------------------------ // Dump: dump description of inline behavior // // Arguments: -// showBudget - also dump final budget values +// verbose - print more details such as final budget values and IL offsets -void InlineStrategy::Dump(bool showBudget) +void InlineStrategy::Dump(bool verbose) { - m_RootContext->Dump(); + m_RootContext->Dump(verbose); - if (!showBudget) + if (!verbose) { return; } diff --git a/src/coreclr/jit/inline.h b/src/coreclr/jit/inline.h index 6a39b2d9cb5d01..983f9cf1686f4e 100644 --- a/src/coreclr/jit/inline.h +++ b/src/coreclr/jit/inline.h @@ -233,7 +233,7 @@ class InlinePolicy { (void)context; } - virtual void NoteOffset(IL_OFFSETX offset) + virtual void NoteOffset(IL_OFFSET offset) { (void)offset; } @@ -589,6 +589,7 @@ struct InlineCandidateInfo : public GuardedDevirtualizationCandidateInfo CorInfoInitClassResult initClassResult; var_types fncRetType; bool exactContextNeedsRuntimeLookup; + InlineContext* inlinersContext; }; // InlArgInfo describes inline candidate argument properties. @@ -635,6 +636,7 @@ struct InlineInfo CORINFO_METHOD_HANDLE fncHandle; InlineCandidateInfo* inlineCandidateInfo; + InlineContext* inlineContext; InlineResult* inlineResult; @@ -686,6 +688,8 @@ struct InlineInfo // This makes it possible to detect recursion and to keep track of the // depth of each inline attempt. +#define FMT_INL_CTX "INL%02u" + class InlineContext { // InlineContexts are created by InlineStrategies @@ -695,7 +699,7 @@ class InlineContext #if defined(DEBUG) || defined(INLINE_DATA) // Dump the full subtree, including failures - void Dump(unsigned indent = 0); + void Dump(bool verbose, unsigned indent = 0); // Dump only the success subtree, with rich data void DumpData(unsigned indent = 0); @@ -709,6 +713,11 @@ class InlineContext return m_Callee; } + unsigned GetOrdinal() const + { + return m_Ordinal; + } + #endif // defined(DEBUG) || defined(INLINE_DATA) // Get the parent context for this context. @@ -717,6 +726,18 @@ class InlineContext return m_Parent; } + // Get the sibling context. + InlineContext* GetSibling() const + { + return m_Sibling; + } + + // Get the first child context. + InlineContext* GetChild() const + { + return m_Child; + } + // Get the code pointer for this context. const BYTE* GetCode() const { @@ -747,10 +768,10 @@ class InlineContext return m_CodeSizeEstimate; } - // Get the offset of the call site - IL_OFFSETX GetOffset() const + // Get the loation of the call site within the parent + ILLocation GetLocation() const { - return m_Offset; + return m_Location; } // True if this is the root context @@ -779,10 +800,24 @@ class InlineContext return m_ImportedILSize; } + void SetSucceeded(const InlineInfo* info); + void SetFailed(const InlineResult* result); + +#ifdef DEBUG + FixedBitVect* GetILInstsSet() const + { + return m_ILInstsSet; + } + + void SetILInstsSet(FixedBitVect* set) + { + m_ILInstsSet = set; + } +#endif + private: InlineContext(InlineStrategy* strategy); -private: InlineStrategy* m_InlineStrategy; // overall strategy InlineContext* m_Parent; // logical caller (parent) InlineContext* m_Child; // first child @@ -790,8 +825,8 @@ class InlineContext const BYTE* m_Code; // address of IL buffer for the method unsigned m_ILSize; // size of IL buffer for the method unsigned m_ImportedILSize; // estimated size of imported IL - IL_OFFSETX m_Offset; // call site location within parent - InlineObservation m_Observation; // what lead to this inline + ILLocation m_Location; // inlining statement location within parent + InlineObservation m_Observation; // what lead to this inline success or failure int m_CodeSizeEstimate; // in bytes * 10 bool m_Success : 1; // true if this was a successful inline bool m_Devirtualized : 1; // true if this was a devirtualized call @@ -800,12 +835,17 @@ class InlineContext #if defined(DEBUG) || defined(INLINE_DATA) - InlinePolicy* m_Policy; // policy that evaluated this inline - CORINFO_METHOD_HANDLE m_Callee; // handle to the method - unsigned m_TreeID; // ID of the GenTreeCall - unsigned m_Ordinal; // Ordinal number of this inline + InlinePolicy* m_Policy; // policy that evaluated this inline + CORINFO_METHOD_HANDLE m_Callee; // handle to the method + unsigned m_TreeID; // ID of the GenTreeCall in the parent + unsigned m_Ordinal; // Ordinal number of this inline + IL_OFFSET m_ActualCallOffset; // IL offset of actual call instruction leading to the inline #endif // defined(DEBUG) || defined(INLINE_DATA) + +#ifdef DEBUG + FixedBitVect* m_ILInstsSet; // Set of offsets where instructions begin +#endif }; // The InlineStrategy holds the per-method persistent inline state. @@ -814,16 +854,14 @@ class InlineContext class InlineStrategy { + friend class InlineContext; public: // Construct a new inline strategy. InlineStrategy(Compiler* compiler); - // Create context for a successful inline. - InlineContext* NewSuccess(InlineInfo* inlineInfo); - - // Create context for a failing inline. - InlineContext* NewFailure(Statement* stmt, InlineResult* inlineResult); + // Create context for the specified inline candidate contained in the specified statement. + InlineContext* NewContext(InlineContext* parentContext, Statement* stmt, GenTreeCall* call); // Compiler associated with this strategy Compiler* GetCompiler() const @@ -923,7 +961,7 @@ class InlineStrategy #if defined(DEBUG) || defined(INLINE_DATA) // Dump textual description of inlines done so far. - void Dump(bool showBudget); + void Dump(bool verbose); // Dump data-format description of inlines done so far. void DumpData(); diff --git a/src/coreclr/jit/inlinepolicy.cpp b/src/coreclr/jit/inlinepolicy.cpp index c69453b3565fbd..1ec47378872d54 100644 --- a/src/coreclr/jit/inlinepolicy.cpp +++ b/src/coreclr/jit/inlinepolicy.cpp @@ -3383,7 +3383,7 @@ bool ReplayPolicy::FindContext(InlineContext* context) // Token and Hash we're looking for. mdMethodDef contextToken = m_RootCompiler->info.compCompHnd->getMethodDefFromMethod(context->GetCallee()); unsigned contextHash = m_RootCompiler->compMethodHash(context->GetCallee()); - unsigned contextOffset = (unsigned)context->GetOffset(); + unsigned contextOffset = (unsigned)context->GetLocation().GetOffset(); return FindInline(contextToken, contextHash, contextOffset); } @@ -3573,7 +3573,7 @@ bool ReplayPolicy::FindInline(CORINFO_METHOD_HANDLE callee) int offset = -1; if (m_Offset != BAD_IL_OFFSET) { - offset = (int)jitGetILoffs(m_Offset); + offset = m_Offset; } unsigned calleeOffset = (unsigned)offset; diff --git a/src/coreclr/jit/inlinepolicy.h b/src/coreclr/jit/inlinepolicy.h index e604fd57a36ed5..f5f200e9f5bd71 100644 --- a/src/coreclr/jit/inlinepolicy.h +++ b/src/coreclr/jit/inlinepolicy.h @@ -516,7 +516,7 @@ class ReplayPolicy : public DiscretionaryPolicy m_InlineContext = context; } - void NoteOffset(IL_OFFSETX offset) override + void NoteOffset(IL_OFFSET offset) override { m_Offset = offset; } @@ -542,7 +542,7 @@ class ReplayPolicy : public DiscretionaryPolicy static FILE* s_ReplayFile; static CritSecObject s_XmlReaderLock; InlineContext* m_InlineContext; - IL_OFFSETX m_Offset; + IL_OFFSET m_Offset; bool m_WasForceInline; }; diff --git a/src/coreclr/jit/instr.cpp b/src/coreclr/jit/instr.cpp index 06ee07c405b6bd..bbf204c74caa82 100644 --- a/src/coreclr/jit/instr.cpp +++ b/src/coreclr/jit/instr.cpp @@ -72,7 +72,7 @@ const char* CodeGen::genInsName(instruction ins) }; // clang-format on - assert((unsigned)ins < _countof(insNames)); + assert((unsigned)ins < ArrLen(insNames)); assert(insNames[ins] != nullptr); return insNames[ins]; @@ -243,7 +243,7 @@ void CodeGen::instGen(instruction ins) // static inline bool CodeGenInterface::instIsFP(instruction ins) { - assert((unsigned)ins < _countof(instInfo)); + assert((unsigned)ins < ArrLen(instInfo)); #ifdef TARGET_XARCH return (instInfo[ins] & INS_FLAGS_x87Instr) != 0; @@ -1049,8 +1049,8 @@ void CodeGen::inst_RV_TT_IV(instruction ins, emitAttr attr, regNumber reg1, GenT { #if defined(FEATURE_HW_INTRINSICS) assert(rmOp->AsHWIntrinsic()->OperIsMemoryLoad()); - assert(HWIntrinsicInfo::lookupNumArgs(rmOp->AsHWIntrinsic()) == 1); - addr = rmOp->gtGetOp1(); + assert(rmOp->AsHWIntrinsic()->GetOperandCount() == 1); + addr = rmOp->AsHWIntrinsic()->Op(1); #else unreached(); #endif // FEATURE_HW_INTRINSICS @@ -1100,8 +1100,7 @@ void CodeGen::inst_RV_TT_IV(instruction ins, emitAttr attr, regNumber reg1, GenT case GT_LCL_VAR: { - assert(rmOp->IsRegOptional() || - !compiler->lvaGetDesc(rmOp->AsLclVar()->GetLclNum())->lvIsRegCandidate()); + assert(rmOp->IsRegOptional() || !compiler->lvaGetDesc(rmOp->AsLclVar())->lvIsRegCandidate()); varNum = rmOp->AsLclVar()->GetLclNum(); offset = 0; break; @@ -1178,8 +1177,8 @@ void CodeGen::inst_RV_RV_TT( { #if defined(FEATURE_HW_INTRINSICS) assert(op2->AsHWIntrinsic()->OperIsMemoryLoad()); - assert(HWIntrinsicInfo::lookupNumArgs(op2->AsHWIntrinsic()) == 1); - addr = op2->gtGetOp1(); + assert(op2->AsHWIntrinsic()->GetOperandCount() == 1); + addr = op2->AsHWIntrinsic()->Op(1); #else unreached(); #endif // FEATURE_HW_INTRINSICS @@ -1231,8 +1230,7 @@ void CodeGen::inst_RV_RV_TT( case GT_LCL_VAR: { - assert(op2->IsRegOptional() || - !compiler->lvaGetDesc(op2->AsLclVar()->GetLclNum())->lvIsRegCandidate()); + assert(op2->IsRegOptional() || !compiler->lvaGetDesc(op2->AsLclVar())->lvIsRegCandidate()); varNum = op2->AsLclVar()->GetLclNum(); offset = 0; break; diff --git a/src/coreclr/jit/instrsarm64.h b/src/coreclr/jit/instrsarm64.h index 548c13f339469f..c89b006a418970 100644 --- a/src/coreclr/jit/instrsarm64.h +++ b/src/coreclr/jit/instrsarm64.h @@ -1563,10 +1563,13 @@ INST1(uxth, "uxth", 0, IF_DR_2H, 0x53003C00) INST1(nop, "nop", 0, IF_SN_0A, 0xD503201F) // nop SN_0A 1101010100000011 0010000000011111 D503 201F -INST1(bkpt, "bkpt", 0, IF_SN_0A, 0xD43E0000) - // brpt SN_0A 1101010000111110 0000000000000000 D43E 0000 0xF000 +INST1(yield, "yield", 0, IF_SN_0A, 0xD503203F) + // yield SN_0A 1101010100000011 0010000000111111 D503 203F -INST1(brk, "brk", 0, IF_SI_0A, 0xD4200000) +INST1(brk_windows, "brk_windows", 0, IF_SI_0A, 0xD43E0000) + // brk (windows) SI_0A 1101010000111110 0000000000000000 D43E 0000 0xF000 + +INST1(brk_unix, "brk_unix", 0, IF_SI_0A, 0xD4200000) // brk imm16 SI_0A 11010100001iiiii iiiiiiiiiii00000 D420 0000 imm16 INST1(dsb, "dsb", 0, IF_SI_0B, 0xD503309F) diff --git a/src/coreclr/jit/instrsxarch.h b/src/coreclr/jit/instrsxarch.h index 4dc1fffd098d51..17b94fc81d779e 100644 --- a/src/coreclr/jit/instrsxarch.h +++ b/src/coreclr/jit/instrsxarch.h @@ -640,11 +640,11 @@ INST2(rcl, "rcl", IUM_RW, 0x0010D2, BAD_CODE, INST2(rcl_1, "rcl", IUM_RW, 0x0010D0, 0x0010D0, Writes_OF | Writes_CF | Reads_CF ) INST2(rcl_N, "rcl", IUM_RW, 0x0010C0, 0x0010C0, Undefined_OF | Writes_CF - | Reads_CF ) + | Reads_CF ) INST2(rcr, "rcr", IUM_RW, 0x0018D2, BAD_CODE, Undefined_OF | Writes_CF | Reads_CF ) INST2(rcr_1, "rcr", IUM_RW, 0x0018D0, 0x0018D0, Writes_OF | Writes_CF - | Reads_CF ) + | Reads_CF ) INST2(rcr_N, "rcr", IUM_RW, 0x0018C0, 0x0018C0, Undefined_OF | Writes_CF | Reads_CF ) INST2(shl, "shl", IUM_RW, 0x0020D2, BAD_CODE, Undefined_OF | Writes_SF | Writes_ZF | Undefined_AF | Writes_PF | Writes_CF ) @@ -683,6 +683,7 @@ INST1(stosq, "stosq", IUM_RD, 0x00AB48, INST1(int3, "int3", IUM_RD, 0x0000CC, INS_FLAGS_None ) INST1(nop, "nop", IUM_RD, 0x000090, INS_FLAGS_None ) +INST1(pause, "pause", IUM_RD, 0x0090F3, INS_FLAGS_None ) INST1(lock, "lock", IUM_RD, 0x0000F0, INS_FLAGS_None ) INST1(leave, "leave", IUM_RD, 0x0000C9, INS_FLAGS_None ) diff --git a/src/coreclr/jit/jit.h b/src/coreclr/jit/jit.h index c84bb0b529e4a5..d8cb5cabfb065d 100644 --- a/src/coreclr/jit/jit.h +++ b/src/coreclr/jit/jit.h @@ -288,41 +288,9 @@ const CORINFO_CLASS_HANDLE NO_CLASS_HANDLE = (CORINFO_CLASS_HANDLE) nullptr; /*****************************************************************************/ -// We define two IL offset types, as follows: -// -// IL_OFFSET: either a distinguished value, or an IL offset. -// IL_OFFSETX: either a distinguished value, or the top two bits are a flags, and the remaining bottom -// bits are a IL offset. -// -// In both cases, the set of legal distinguished values is: -// BAD_IL_OFFSET -- A unique illegal IL offset number. Note that it must be different from -// the ICorDebugInfo values, below, and must also not be a legal IL offset. -// ICorDebugInfo::NO_MAPPING -- The IL offset corresponds to no source code (such as EH step blocks). -// ICorDebugInfo::PROLOG -- The IL offset indicates a prolog -// ICorDebugInfo::EPILOG -- The IL offset indicates an epilog -// -// The IL offset must be in the range [0 .. 0x3fffffff]. This is because we steal -// the top two bits in IL_OFFSETX for flags, but we want the maximum range to be the same -// for both types. The IL value can't be larger than the maximum IL offset of the function -// being compiled. -// -// Blocks and statements never store one of the ICorDebugInfo values, even for IL_OFFSETX types. These are -// only stored in the IPmappingDsc struct, ipmdILoffsx field. - typedef unsigned IL_OFFSET; -const IL_OFFSET BAD_IL_OFFSET = 0x80000000; -const IL_OFFSET MAX_IL_OFFSET = 0x3fffffff; - -typedef unsigned IL_OFFSETX; // IL_OFFSET with stack-empty or call-instruction bit -const IL_OFFSETX IL_OFFSETX_STKBIT = 0x80000000; // Note: this bit is set when the stack is NOT empty! -const IL_OFFSETX IL_OFFSETX_CALLINSTRUCTIONBIT = 0x40000000; // Set when the IL offset is for a call instruction. -const IL_OFFSETX IL_OFFSETX_BITS = IL_OFFSETX_STKBIT | IL_OFFSETX_CALLINSTRUCTIONBIT; - -IL_OFFSET jitGetILoffs(IL_OFFSETX offsx); -IL_OFFSET jitGetILoffsAny(IL_OFFSETX offsx); -bool jitIsStackEmpty(IL_OFFSETX offsx); -bool jitIsCallInstruction(IL_OFFSETX offsx); +const IL_OFFSET BAD_IL_OFFSET = 0xffffffff; const unsigned BAD_VAR_NUM = UINT_MAX; diff --git a/src/coreclr/jit/jitconfigvalues.h b/src/coreclr/jit/jitconfigvalues.h index d9aef33b2c7e1b..06211a597c8ed6 100644 --- a/src/coreclr/jit/jitconfigvalues.h +++ b/src/coreclr/jit/jitconfigvalues.h @@ -67,6 +67,11 @@ CONFIG_INTEGER(JitAlignLoopAdaptive, W("JitAlignLoopAdaptive"), 1) // If set, perform adaptive loop alignment that limits number of padding based on loop size. +CONFIG_INTEGER(JitHideAlignBehindJmp, + W("JitHideAlignBehindJmp"), + 1) // If set, try to hide align instruction (if any) behind an unconditional jump instruction (if any) + // that is present before the loop start. + // Print the alignment boundaries in disassembly. CONFIG_INTEGER(JitDasmWithAlignmentBoundaries, W("JitDasmWithAlignmentBoundaries"), 0) @@ -125,7 +130,13 @@ CONFIG_INTEGER(JitQueryCurrentStaticFieldClass, W("JitQueryCurrentStaticFieldCla CONFIG_INTEGER(JitReportFastTailCallDecisions, W("JitReportFastTailCallDecisions"), 0) CONFIG_INTEGER(JitPInvokeCheckEnabled, W("JITPInvokeCheckEnabled"), 0) CONFIG_INTEGER(JitPInvokeEnabled, W("JITPInvokeEnabled"), 1) + +// Controls verbosity for JitPrintInlinedMethods. Ignored for JitDump/NgenDump where +// it's always set. +CONFIG_INTEGER(JitPrintInlinedMethodsVerbose, W("JitPrintInlinedMethodsVerboseLevel"), 0) +// Prints a tree of inlinees for a specific method (use '*' for all methods) CONFIG_METHODSET(JitPrintInlinedMethods, W("JitPrintInlinedMethods")) + CONFIG_METHODSET(JitPrintDevirtualizedMethods, W("JitPrintDevirtualizedMethods")) CONFIG_INTEGER(JitProfileChecks, W("JitProfileChecks"), 0) // 1 enable in dumps, 2 assert if issues found CONFIG_INTEGER(JitRequired, W("JITRequired"), -1) @@ -165,12 +176,13 @@ CONFIG_INTEGER(TreesBeforeAfterMorph, W("JitDumpBeforeAfterMorph"), 0) // If 1, CONFIG_METHODSET(JitBreak, W("JitBreak")) // Stops in the importer when compiling a specified method CONFIG_METHODSET(JitDebugBreak, W("JitDebugBreak")) -CONFIG_METHODSET(JitDisasm, W("JitDisasm")) // Dumps disassembly for specified method -CONFIG_STRING(JitDisasmAssemblies, W("JitDisasmAssemblies")) // Only show JitDisasm and related info for methods - // from this semicolon-delimited list of assemblies. -CONFIG_INTEGER(JitDisasmWithGC, W("JitDisasmWithGC"), 0) // Dump interleaved GC Info for any method disassembled. -CONFIG_METHODSET(JitDump, W("JitDump")) // Dumps trees for specified method -CONFIG_INTEGER(JitDumpTier0, W("JitDumpTier0"), 1) // Dump tier0 requests +CONFIG_METHODSET(JitDisasm, W("JitDisasm")) // Dumps disassembly for specified method +CONFIG_STRING(JitDisasmAssemblies, W("JitDisasmAssemblies")) // Only show JitDisasm and related info for methods + // from this semicolon-delimited list of assemblies. +CONFIG_INTEGER(JitDisasmWithGC, W("JitDisasmWithGC"), 0) // Dump interleaved GC Info for any method disassembled. +CONFIG_METHODSET(JitDump, W("JitDump")) // Dumps trees for specified method +CONFIG_INTEGER(JitDumpTier0, W("JitDumpTier0"), 1) // Dump tier0 requests +CONFIG_INTEGER(JitDumpAtOSROffset, W("JitDumpAtOSROffset"), -1) // Only dump OSR requests for this offset CONFIG_INTEGER(JitDumpInlinePhases, W("JitDumpInlinePhases"), 1) // Dump inline compiler phases CONFIG_METHODSET(JitEHDump, W("JitEHDump")) // Dump the EH table for the method, as reported to the VM CONFIG_METHODSET(JitExclude, W("JitExclude")) @@ -220,6 +232,9 @@ CONFIG_INTEGER(JitDumpFgConstrained, W("JitDumpFgConstrained"), 1) // 0 == don't CONFIG_INTEGER(JitDumpFgBlockID, W("JitDumpFgBlockID"), 0) // 0 == display block with bbNum; 1 == display with both // bbNum and bbID +CONFIG_STRING(JitDumpPreciseDebugInfoFile, W("JitDumpPreciseDebugInfoFile")) +CONFIG_INTEGER(JitDisasmWithDebugInfo, W("JitDisasmWithDebugInfo"), 0) + CONFIG_STRING(JitLateDisasmTo, W("JITLateDisasmTo")) CONFIG_STRING(JitRange, W("JitRange")) CONFIG_STRING(JitStressModeNames, W("JitStressModeNames")) // Internal Jit stress mode: stress using the given set of diff --git a/src/coreclr/jit/jiteh.cpp b/src/coreclr/jit/jiteh.cpp index 12e91d077690ba..c0fd2bf9581ce3 100644 --- a/src/coreclr/jit/jiteh.cpp +++ b/src/coreclr/jit/jiteh.cpp @@ -1405,7 +1405,12 @@ void Compiler::fgRemoveEHTableEntry(unsigned XTnum) if (compHndBBtabCount == 0) { // No more entries remaining. - compHndBBtab = nullptr; + // + // We used to null out compHndBBtab here, but with OSR + Synch method + // we may remove all the initial EH entries if not reachable in the + // OSR portion, then need to add one for the synchronous exit. + // + // So now we just leave it be. } else { diff --git a/src/coreclr/jit/jithashtable.h b/src/coreclr/jit/jithashtable.h index 5b95afbd899caf..85186dfb508e66 100644 --- a/src/coreclr/jit/jithashtable.h +++ b/src/coreclr/jit/jithashtable.h @@ -715,7 +715,7 @@ class JitHashTable // static JitPrimeInfo NextPrime(unsigned number) { - for (int i = 0; i < (int)(_countof(jitPrimeInfo)); i++) + for (int i = 0; i < (int)(ArrLen(jitPrimeInfo)); i++) { if (jitPrimeInfo[i].prime >= number) { diff --git a/src/coreclr/jit/jitstd/algorithm.h b/src/coreclr/jit/jitstd/algorithm.h index 9fa6fbb94dd546..7df9c8488d5b7f 100644 --- a/src/coreclr/jit/jitstd/algorithm.h +++ b/src/coreclr/jit/jitstd/algorithm.h @@ -1,10 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - - #pragma once +#include + namespace jitstd { @@ -148,7 +148,7 @@ void quick_sort(RandomAccessIterator first, RandomAccessIterator last, Less less RandomAccessIterator rightFirst = newLast + 1; RandomAccessIterator rightLast = last; - assert(depth < _countof(firstStack)); + assert(depth < ARRAY_SIZE(firstStack)); // Ideally, the 2 partitions should have the same size, that would guarantee // log2(n) stack space. If that's not the case then push the larger partition diff --git a/src/coreclr/jit/layout.cpp b/src/coreclr/jit/layout.cpp index cbcb631185d9d3..d47d5ae894fc47 100644 --- a/src/coreclr/jit/layout.cpp +++ b/src/coreclr/jit/layout.cpp @@ -82,7 +82,7 @@ class ClassLayoutTable private: bool HasSmallCapacity() const { - return m_layoutCount <= _countof(m_layoutArray); + return m_layoutCount <= ArrLen(m_layoutArray); } ClassLayout* GetLayoutByIndex(unsigned index) const @@ -157,7 +157,7 @@ class ClassLayoutTable unsigned AddBlkLayout(Compiler* compiler, ClassLayout* layout) { - if (m_layoutCount < _countof(m_layoutArray)) + if (m_layoutCount < ArrLen(m_layoutArray)) { m_layoutArray[m_layoutCount] = layout; return m_layoutCount++; @@ -201,7 +201,7 @@ class ClassLayoutTable unsigned AddObjLayout(Compiler* compiler, ClassLayout* layout) { - if (m_layoutCount < _countof(m_layoutArray)) + if (m_layoutCount < ArrLen(m_layoutArray)) { m_layoutArray[m_layoutCount] = layout; return m_layoutCount++; @@ -220,7 +220,7 @@ class ClassLayoutTable unsigned newCapacity = m_layoutCount * 2; ClassLayout** newArray = alloc.allocate(newCapacity); - if (m_layoutCount <= _countof(m_layoutArray)) + if (m_layoutCount <= ArrLen(m_layoutArray)) { BlkLayoutIndexMap* blkLayoutMap = new (alloc) BlkLayoutIndexMap(alloc); ObjLayoutIndexMap* objLayoutMap = new (alloc) ObjLayoutIndexMap(alloc); @@ -370,7 +370,7 @@ void ClassLayout::InitializeGCPtrs(Compiler* compiler) unsigned gcPtrCount = compiler->info.compCompHnd->getClassGClayout(m_classHandle, gcPtrs); assert((gcPtrCount == 0) || ((compiler->info.compCompHnd->getClassAttribs(m_classHandle) & - (CORINFO_FLG_CONTAINS_GC_PTR | CORINFO_FLG_CONTAINS_STACK_PTR)) != 0)); + (CORINFO_FLG_CONTAINS_GC_PTR | CORINFO_FLG_BYREF_LIKE)) != 0)); // Since class size is unsigned there's no way we could have more than 2^30 slots // so it should be safe to fit this into a 30 bits bit field. diff --git a/src/coreclr/jit/lclvars.cpp b/src/coreclr/jit/lclvars.cpp index 2d2ae92df4203f..debf6bafcfeb5c 100644 --- a/src/coreclr/jit/lclvars.cpp +++ b/src/coreclr/jit/lclvars.cpp @@ -56,9 +56,6 @@ void Compiler::lvaInit() lvaOutgoingArgSpaceVar = BAD_VAR_NUM; lvaOutgoingArgSpaceSize = PhasedVar(); #endif // FEATURE_FIXED_OUT_ARGS -#ifdef TARGET_ARM - lvaPromotedStructAssemblyScratchVar = BAD_VAR_NUM; -#endif // TARGET_ARM #ifdef JIT32_GCENCODER lvaLocAllocSPvar = BAD_VAR_NUM; #endif // JIT32_GCENCODER @@ -560,24 +557,8 @@ void Compiler::lvaInitRetBuffArg(InitVarDscInfo* varDscInfo, bool useFixedRetBuf #endif varDsc->lvOnFrame = true; // The final home for this incoming register might be our local stack frame - info.compRetBuffDefStack = 0; - if (info.compRetType == TYP_STRUCT) - { - CORINFO_SIG_INFO sigInfo; - info.compCompHnd->getMethodSig(info.compMethodHnd, &sigInfo); - assert(JITtype2varType(sigInfo.retType) == info.compRetType); // Else shouldn't have a ret buff. - - info.compRetBuffDefStack = (info.compCompHnd->isStructRequiringStackAllocRetBuf(sigInfo.retTypeClass)); - if (info.compRetBuffDefStack) - { - // If we're assured that the ret buff argument points into a callers stack, we will type it as - // "TYP_I_IMPL" - // (native int/unmanaged pointer) so that it's not tracked as a GC ref. - varDsc->lvType = TYP_I_IMPL; - } - } #ifdef FEATURE_SIMD - else if (supportSIMDTypes() && varTypeIsSIMD(info.compRetType)) + if (supportSIMDTypes() && varTypeIsSIMD(info.compRetType)) { varDsc->lvSIMDType = true; @@ -1310,7 +1291,7 @@ void Compiler::lvaInitVarDsc(LclVarDsc* varDsc, CORINFO_ARG_LIST_HANDLE varList, CORINFO_SIG_INFO* varSig) { - noway_assert(varDsc == &lvaTable[varNum]); + noway_assert(varDsc == lvaGetDesc(varNum)); switch (corInfoType) { @@ -1564,9 +1545,7 @@ unsigned Compiler::compMap2ILvarNum(unsigned varNum) const bool Compiler::lvaVarAddrExposed(unsigned varNum) const { - noway_assert(varNum < lvaCount); - const LclVarDsc* varDsc = &lvaTable[varNum]; - + const LclVarDsc* varDsc = lvaGetDesc(varNum); return varDsc->IsAddressExposed(); } @@ -1576,9 +1555,7 @@ bool Compiler::lvaVarAddrExposed(unsigned varNum) const bool Compiler::lvaVarDoNotEnregister(unsigned varNum) { - noway_assert(varNum < lvaCount); - LclVarDsc* varDsc = &lvaTable[varNum]; - + LclVarDsc* varDsc = lvaGetDesc(varNum); return varDsc->lvDoNotEnregister; } @@ -1605,9 +1582,7 @@ void Compiler::lvSetMinOptsDoNotEnreg() CORINFO_CLASS_HANDLE Compiler::lvaGetStruct(unsigned varNum) { - noway_assert(varNum < lvaCount); const LclVarDsc* varDsc = lvaGetDesc(varNum); - return varDsc->GetStructHnd(); } @@ -1838,9 +1813,9 @@ bool Compiler::StructPromotionHelper::CanPromoteStructType(CORINFO_CLASS_HANDLE } // If we saw any GC pointer or by-ref fields above then CORINFO_FLG_CONTAINS_GC_PTR or - // CORINFO_FLG_CONTAINS_STACK_PTR has to be set! + // CORINFO_FLG_BYREF_LIKE has to be set! noway_assert((containsGCpointers == false) || - ((typeFlags & (CORINFO_FLG_CONTAINS_GC_PTR | CORINFO_FLG_CONTAINS_STACK_PTR)) != 0)); + ((typeFlags & (CORINFO_FLG_CONTAINS_GC_PTR | CORINFO_FLG_BYREF_LIKE)) != 0)); // If we have "Custom Layout" then we might have an explicit Size attribute // Managed C++ uses this for its structs, such C++ types will not contain GC pointers. @@ -2010,9 +1985,7 @@ bool Compiler::StructPromotionHelper::CanPromoteStructVar(unsigned lclNum) // bool Compiler::StructPromotionHelper::ShouldPromoteStructVar(unsigned lclNum) { - assert(lclNum < compiler->lvaCount); - - LclVarDsc* varDsc = &compiler->lvaTable[lclNum]; + LclVarDsc* varDsc = compiler->lvaGetDesc(lclNum); assert(varTypeIsStruct(varDsc)); assert(varDsc->GetStructHnd() == structPromotionInfo.typeHnd); assert(structPromotionInfo.canPromote); @@ -2489,9 +2462,7 @@ unsigned Compiler::lvaGetFieldLocal(const LclVarDsc* varDsc, unsigned int fldOff void Compiler::lvaSetVarAddrExposed(unsigned varNum DEBUGARG(AddressExposedReason reason)) { - noway_assert(varNum < lvaCount); - - LclVarDsc* varDsc = &lvaTable[varNum]; + LclVarDsc* varDsc = lvaGetDesc(varNum); varDsc->SetAddressExposed(true DEBUGARG(reason)); @@ -2518,9 +2489,7 @@ void Compiler::lvaSetVarAddrExposed(unsigned varNum DEBUGARG(AddressExposedReaso // void Compiler::lvaSetVarLiveInOutOfHandler(unsigned varNum) { - noway_assert(varNum < lvaCount); - - LclVarDsc* varDsc = &lvaTable[varNum]; + LclVarDsc* varDsc = lvaGetDesc(varNum); varDsc->lvLiveInOutOfHndlr = 1; @@ -2563,8 +2532,7 @@ void Compiler::lvaSetVarLiveInOutOfHandler(unsigned varNum) void Compiler::lvaSetVarDoNotEnregister(unsigned varNum DEBUGARG(DoNotEnregisterReason reason)) { - noway_assert(varNum < lvaCount); - LclVarDsc* varDsc = &lvaTable[varNum]; + LclVarDsc* varDsc = lvaGetDesc(varNum); const bool wasAlreadyMarkedDoNotEnreg = (varDsc->lvDoNotEnregister == 1); varDsc->lvDoNotEnregister = 1; @@ -2711,9 +2679,7 @@ bool Compiler::lvaIsMultiregStruct(LclVarDsc* varDsc, bool isVarArg) void Compiler::lvaSetStruct(unsigned varNum, CORINFO_CLASS_HANDLE typeHnd, bool unsafeValueClsCheck, bool setTypeInfo) { - noway_assert(varNum < lvaCount); - - LclVarDsc* varDsc = &lvaTable[varNum]; + LclVarDsc* varDsc = lvaGetDesc(varNum); if (setTypeInfo) { varDsc->lvVerTypeInfo = typeInfo(TI_STRUCT, typeHnd); @@ -2897,7 +2863,7 @@ void Compiler::lvaSetStructUsedAsVarArg(unsigned varNum) if (GlobalJitOptions::compFeatureHfa && TargetOS::IsWindows) { #if defined(TARGET_ARM64) - LclVarDsc* varDsc = &lvaTable[varNum]; + LclVarDsc* varDsc = lvaGetDesc(varNum); // For varargs methods incoming and outgoing arguments should not be treated // as HFA. varDsc->SetHfaType(TYP_UNDEF); @@ -2930,7 +2896,7 @@ void Compiler::lvaSetClass(unsigned varNum, CORINFO_CLASS_HANDLE clsHnd, bool is // Else we should have a type handle. assert(clsHnd != nullptr); - LclVarDsc* varDsc = &lvaTable[varNum]; + LclVarDsc* varDsc = lvaGetDesc(varNum); assert(varDsc->lvType == TYP_REF); // We shoud not have any ref type information for this var. @@ -3015,7 +2981,7 @@ void Compiler::lvaUpdateClass(unsigned varNum, CORINFO_CLASS_HANDLE clsHnd, bool // Else we should have a class handle to consider assert(clsHnd != nullptr); - LclVarDsc* varDsc = &lvaTable[varNum]; + LclVarDsc* varDsc = lvaGetDesc(varNum); assert(varDsc->lvType == TYP_REF); // We should already have a class @@ -3920,11 +3886,7 @@ void Compiler::lvaMarkLclRefs(GenTree* tree, BasicBlock* block, Statement* stmt, if (!opts.ShouldUsePInvokeHelpers()) { /* Get the special variable descriptor */ - - unsigned lclNum = info.compLvFrameListRoot; - - noway_assert(lclNum <= lvaCount); - LclVarDsc* varDsc = lvaTable + lclNum; + LclVarDsc* varDsc = lvaGetDesc(info.compLvFrameListRoot); /* Increment the ref counts twice */ varDsc->incRefCnts(weight, this); @@ -4023,8 +3985,7 @@ void Compiler::lvaMarkLclRefs(GenTree* tree, BasicBlock* block, Statement* stmt, assert((tree->gtOper == GT_LCL_VAR) || (tree->gtOper == GT_LCL_FLD)); unsigned lclNum = tree->AsLclVarCommon()->GetLclNum(); - noway_assert(lclNum < lvaCount); - LclVarDsc* varDsc = lvaTable + lclNum; + LclVarDsc* varDsc = lvaGetDesc(lclNum); /* Increment the reference counts */ @@ -4035,7 +3996,7 @@ void Compiler::lvaMarkLclRefs(GenTree* tree, BasicBlock* block, Statement* stmt, { // If ref count was increased for struct field, ensure that the // parent struct is still promoted. - LclVarDsc* parentStruct = &lvaTable[varDsc->lvParentLcl]; + LclVarDsc* parentStruct = lvaGetDesc(varDsc->lvParentLcl); assert(!parentStruct->lvUndoneStructPromotion); } #endif @@ -4318,7 +4279,7 @@ void Compiler::lvaMarkLocalVars() slotsNeeded++; lvaShadowSPslotsVar = lvaGrabTempWithImplicitUse(false DEBUGARG("lvaShadowSPslotsVar")); - LclVarDsc* shadowSPslotsVar = &lvaTable[lvaShadowSPslotsVar]; + LclVarDsc* shadowSPslotsVar = lvaGetDesc(lvaShadowSPslotsVar); shadowSPslotsVar->lvType = TYP_BLK; shadowSPslotsVar->lvExactSize = (slotsNeeded * TARGET_POINTER_SIZE); } @@ -4332,7 +4293,7 @@ void Compiler::lvaMarkLocalVars() if (ehNeedsPSPSym()) { lvaPSPSym = lvaGrabTempWithImplicitUse(false DEBUGARG("PSPSym")); - LclVarDsc* lclPSPSym = &lvaTable[lvaPSPSym]; + LclVarDsc* lclPSPSym = lvaGetDesc(lvaPSPSym); lclPSPSym->lvType = TYP_I_IMPL; lvaSetVarDoNotEnregister(lvaPSPSym DEBUGARG(DoNotEnregisterReason::VMNeedsStackAddr)); } @@ -4355,7 +4316,7 @@ void Compiler::lvaMarkLocalVars() if (compLocallocUsed) { lvaLocAllocSPvar = lvaGrabTempWithImplicitUse(false DEBUGARG("LocAllocSPvar")); - LclVarDsc* locAllocSPvar = &lvaTable[lvaLocAllocSPvar]; + LclVarDsc* locAllocSPvar = lvaGetDesc(lvaLocAllocSPvar); locAllocSPvar->lvType = TYP_I_IMPL; } #endif // JIT32_GCENCODER @@ -5211,7 +5172,7 @@ void Compiler::lvaFixVirtualFrameOffsets() // We need to fix the offset of the PSPSym so there is no padding between it and the outgoing argument space. // Without this code, lvaAlignFrame might have put the padding lower than the PSPSym, which would be between // the PSPSym and the outgoing argument space. - varDsc = &lvaTable[lvaPSPSym]; + varDsc = lvaGetDesc(lvaPSPSym); assert(varDsc->lvFramePointerBased); // We always access it RBP-relative. assert(!varDsc->lvMustInit); // It is never "must init". varDsc->SetStackOffset(codeGen->genCallerSPtoInitialSPdelta() + lvaLclSize(lvaOutgoingArgSpaceVar)); @@ -5283,7 +5244,7 @@ void Compiler::lvaFixVirtualFrameOffsets() // if (varDsc->lvIsStructField) { - LclVarDsc* parentvarDsc = &lvaTable[varDsc->lvParentLcl]; + LclVarDsc* parentvarDsc = lvaGetDesc(varDsc->lvParentLcl); lvaPromotionType promotionType = lvaGetPromotionType(parentvarDsc); #if defined(TARGET_X86) @@ -5357,7 +5318,7 @@ void Compiler::lvaFixVirtualFrameOffsets() if (lvaOutgoingArgSpaceVar != BAD_VAR_NUM) { - varDsc = &lvaTable[lvaOutgoingArgSpaceVar]; + varDsc = lvaGetDesc(lvaOutgoingArgSpaceVar); varDsc->SetStackOffset(0); varDsc->lvFramePointerBased = false; varDsc->lvMustInit = false; @@ -5672,7 +5633,6 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum, unsigned fieldVarNum = BAD_VAR_NUM; - noway_assert(lclNum < lvaCount); LclVarDsc* varDsc = lvaGetDesc(lclNum); noway_assert(varDsc->lvIsParam); @@ -5765,7 +5725,6 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum, unsigned fieldVarNum = BAD_VAR_NUM; - noway_assert(lclNum < lvaCount); LclVarDsc* varDsc = lvaGetDesc(lclNum); noway_assert(varDsc->lvIsParam); @@ -6262,10 +6221,27 @@ void Compiler::lvaAssignVirtualFrameOffsetsToLocals() if (lvaMonAcquired != BAD_VAR_NUM) { - // This var must go first, in what is called the 'frame header' for EnC so that it is - // preserved when remapping occurs. See vm\eetwain.cpp for detailed comment specifying frame - // layout requirements for EnC to work. - stkOffs = lvaAllocLocalAndSetVirtualOffset(lvaMonAcquired, lvaLclSize(lvaMonAcquired), stkOffs); + // For OSR we use the flag set up by the original method. + // + if (opts.IsOSR()) + { + assert(info.compPatchpointInfo->HasMonitorAcquired()); + int originalOffset = info.compPatchpointInfo->MonitorAcquiredOffset(); + int offset = originalFrameStkOffs + originalOffset; + + JITDUMP("---OSR--- V%02u (on old frame, monitor aquired) old rbp offset %d old frame offset %d new " + "virt offset %d\n", + lvaMonAcquired, originalOffset, originalFrameStkOffs, offset); + + lvaTable[lvaMonAcquired].SetStackOffset(offset); + } + else + { + // This var must go first, in what is called the 'frame header' for EnC so that it is + // preserved when remapping occurs. See vm\eetwain.cpp for detailed comment specifying frame + // layout requirements for EnC to work. + stkOffs = lvaAllocLocalAndSetVirtualOffset(lvaMonAcquired, lvaLclSize(lvaMonAcquired), stkOffs); + } } #ifdef JIT32_GCENCODER @@ -6426,7 +6402,7 @@ void Compiler::lvaAssignVirtualFrameOffsetsToLocals() alloc_order[cur] = 0; - noway_assert(cur < _countof(alloc_order)); + noway_assert(cur < ArrLen(alloc_order)); // Force first pass to happen UINT assignMore = 0xFFFFFFFF; @@ -7143,7 +7119,7 @@ void Compiler::lvaAssignFrameOffsetsToPromotedStructs() #endif // !defined(UNIX_AMD64_ABI) && !defined(TARGET_ARM) && !defined(TARGET_X86) ) { - LclVarDsc* parentvarDsc = &lvaTable[varDsc->lvParentLcl]; + LclVarDsc* parentvarDsc = lvaGetDesc(varDsc->lvParentLcl); lvaPromotionType promotionType = lvaGetPromotionType(parentvarDsc); if (promotionType == PROMOTION_TYPE_INDEPENDENT) @@ -7261,7 +7237,7 @@ int Compiler::lvaAllocateTemps(int stkOffs, bool mustDoubleAlign) void Compiler::lvaDumpRegLocation(unsigned lclNum) { - LclVarDsc* varDsc = lvaTable + lclNum; + const LclVarDsc* varDsc = lvaGetDesc(lclNum); #ifdef TARGET_ARM if (varDsc->TypeGet() == TYP_DOUBLE) @@ -7513,7 +7489,7 @@ void Compiler::lvaDumpEntry(unsigned lclNum, FrameLayoutState curState, size_t r } if (varDsc->lvIsStructField) { - LclVarDsc* parentvarDsc = &lvaTable[varDsc->lvParentLcl]; + LclVarDsc* parentvarDsc = lvaGetDesc(varDsc->lvParentLcl); #if !defined(TARGET_64BIT) if (varTypeIsLong(parentvarDsc)) { @@ -7738,8 +7714,7 @@ int Compiler::lvaGetSPRelativeOffset(unsigned varNum) { assert(!compLocallocUsed); assert(lvaDoneFrameLayout == FINAL_FRAME_LAYOUT); - assert(varNum < lvaCount); - const LclVarDsc* varDsc = lvaTable + varNum; + const LclVarDsc* varDsc = lvaGetDesc(varNum); assert(varDsc->lvOnFrame); int spRelativeOffset; @@ -7767,8 +7742,7 @@ int Compiler::lvaGetSPRelativeOffset(unsigned varNum) int Compiler::lvaGetCallerSPRelativeOffset(unsigned varNum) { assert(lvaDoneFrameLayout == FINAL_FRAME_LAYOUT); - assert(varNum < lvaCount); - LclVarDsc* varDsc = lvaTable + varNum; + const LclVarDsc* varDsc = lvaGetDesc(varNum); assert(varDsc->lvOnFrame); return lvaToCallerSPRelativeOffset(varDsc->GetStackOffset(), varDsc->lvFramePointerBased); @@ -7837,8 +7811,7 @@ int Compiler::lvaToCallerSPRelativeOffset(int offset, bool isFpBased, bool forRo int Compiler::lvaGetInitialSPRelativeOffset(unsigned varNum) { assert(lvaDoneFrameLayout == FINAL_FRAME_LAYOUT); - assert(varNum < lvaCount); - LclVarDsc* varDsc = lvaTable + varNum; + const LclVarDsc* varDsc = lvaGetDesc(varNum); assert(varDsc->lvOnFrame); return lvaToInitialSPRelativeOffset(varDsc->GetStackOffset(), varDsc->lvFramePointerBased); diff --git a/src/coreclr/jit/likelyclass.cpp b/src/coreclr/jit/likelyclass.cpp index 6e1c55b4c26747..fc6028c0ac4efe 100644 --- a/src/coreclr/jit/likelyclass.cpp +++ b/src/coreclr/jit/likelyclass.cpp @@ -93,7 +93,7 @@ LikelyClassHistogram::LikelyClassHistogram(INT_PTR* histogramEntries, unsigned e if (!found) { - if (countHistogramElements >= _countof(m_histogram)) + if (countHistogramElements >= ArrLen(m_histogram)) { continue; } diff --git a/src/coreclr/jit/lir.cpp b/src/coreclr/jit/lir.cpp index e72d834d2c5938..97f9e4f4807d2b 100644 --- a/src/coreclr/jit/lir.cpp +++ b/src/coreclr/jit/lir.cpp @@ -1486,7 +1486,7 @@ bool LIR::Range::CheckLIR(Compiler* compiler, bool checkUnusedValues) const // Some nodes should never be marked unused, as they must be contained in the backend. // These may be marked as unused during dead code elimination traversal, but they *must* be subsequently // removed. - assert(!node->IsUnusedValue() || !node->OperIs(GT_FIELD_LIST, GT_LIST, GT_INIT_VAL)); + assert(!node->IsUnusedValue() || !node->OperIs(GT_FIELD_LIST, GT_INIT_VAL)); // Verify that the REVERSE_OPS flag is not set. NOTE: if we ever decide to reuse the bit assigned to // GTF_REVERSE_OPS for an LIR-only flag we will need to move this check to the points at which we diff --git a/src/coreclr/jit/liveness.cpp b/src/coreclr/jit/liveness.cpp index bbe75e80b1d008..a0134f214f0f35 100644 --- a/src/coreclr/jit/liveness.cpp +++ b/src/coreclr/jit/liveness.cpp @@ -24,10 +24,8 @@ void Compiler::fgMarkUseDef(GenTreeLclVarCommon* tree) { assert((tree->OperIsLocal() && (tree->OperGet() != GT_PHI_ARG)) || tree->OperIsLocalAddr()); - const unsigned lclNum = tree->GetLclNum(); - assert(lclNum < lvaCount); - - LclVarDsc* const varDsc = &lvaTable[lclNum]; + const unsigned lclNum = tree->GetLclNum(); + LclVarDsc* const varDsc = lvaGetDesc(lclNum); // We should never encounter a reference to a lclVar that has a zero refCnt. if (varDsc->lvRefCnt() == 0 && (!varTypeIsPromotable(varDsc) || !varDsc->lvPromoted)) @@ -371,9 +369,7 @@ void Compiler::fgPerNodeLocalVarLiveness(GenTree* tree) { // Get the FrameRoot local and mark it as used. - noway_assert(info.compLvFrameListRoot < lvaCount); - - LclVarDsc* varDsc = &lvaTable[info.compLvFrameListRoot]; + LclVarDsc* varDsc = lvaGetDesc(info.compLvFrameListRoot); if (varDsc->lvTracked) { @@ -525,8 +521,6 @@ void Compiler::fgPerBlockLocalVarLiveness() assert((!opts.ShouldUsePInvokeHelpers()) || (info.compLvFrameListRoot == BAD_VAR_NUM)); if (!opts.ShouldUsePInvokeHelpers()) { - noway_assert(info.compLvFrameListRoot < lvaCount); - // 32-bit targets always pop the frame in the epilog. // For 64-bit targets, we only do this in the epilog for IL stubs; // for non-IL stubs the frame is popped after every PInvoke call. @@ -535,7 +529,7 @@ void Compiler::fgPerBlockLocalVarLiveness() if (opts.jitFlags->IsSet(JitFlags::JIT_FLAG_IL_STUB)) #endif { - LclVarDsc* varDsc = &lvaTable[info.compLvFrameListRoot]; + LclVarDsc* varDsc = lvaGetDesc(info.compLvFrameListRoot); if (varDsc->lvTracked) { @@ -607,7 +601,7 @@ void Compiler::fgBeginScopeLife(VARSET_TP* inScope, VarScopeDsc* var) { assert(var); - LclVarDsc* lclVarDsc1 = &lvaTable[var->vsdVarNum]; + LclVarDsc* lclVarDsc1 = lvaGetDesc(var->vsdVarNum); if (lclVarDsc1->lvTracked) { @@ -619,7 +613,7 @@ void Compiler::fgEndScopeLife(VARSET_TP* inScope, VarScopeDsc* var) { assert(var); - LclVarDsc* lclVarDsc1 = &lvaTable[var->vsdVarNum]; + LclVarDsc* lclVarDsc1 = lvaGetDesc(var->vsdVarNum); if (lclVarDsc1->lvTracked) { @@ -869,7 +863,7 @@ void Compiler::fgExtendDbgLifetimes() for (unsigned argNum = 0; argNum < info.compArgsCount; argNum++) { - LclVarDsc* argDsc = lvaTable + argNum; + LclVarDsc* argDsc = lvaGetDesc(argNum); if (argDsc->lvPromoted) { lvaPromotionType promotionType = lvaGetPromotionType(argDsc); @@ -879,7 +873,7 @@ void Compiler::fgExtendDbgLifetimes() noway_assert(argDsc->lvFieldCnt == 1); // We only handle one field here unsigned fieldVarNum = argDsc->lvFieldLclStart; - argDsc = lvaTable + fieldVarNum; + argDsc = lvaGetDesc(fieldVarNum); } } noway_assert(argDsc->lvIsParam); @@ -896,7 +890,7 @@ void Compiler::fgExtendDbgLifetimes() for (unsigned i = 0; i < lvaCount; i++) { - LclVarDsc* varDsc = &lvaTable[i]; + LclVarDsc* varDsc = lvaGetDesc(i); if (varTypeIsStruct(varDsc) && varDsc->lvTracked) { VarSetOps::AddElemD(this, noUnmarkVars, varDsc->lvVarIndex); @@ -1460,9 +1454,7 @@ void Compiler::fgComputeLifeCall(VARSET_TP& life, GenTreeCall* call) { // Get the FrameListRoot local and make it live. - noway_assert(info.compLvFrameListRoot < lvaCount); - - LclVarDsc* frameVarDsc = &lvaTable[info.compLvFrameListRoot]; + LclVarDsc* frameVarDsc = lvaGetDesc(info.compLvFrameListRoot); if (frameVarDsc->lvTracked) { @@ -1481,9 +1473,7 @@ void Compiler::fgComputeLifeCall(VARSET_TP& life, GenTreeCall* call) assert((!opts.ShouldUsePInvokeHelpers()) || (info.compLvFrameListRoot == BAD_VAR_NUM)); if (!opts.ShouldUsePInvokeHelpers() && !call->IsSuppressGCTransition()) { - noway_assert(info.compLvFrameListRoot < lvaCount); - - LclVarDsc* frameVarDsc = &lvaTable[info.compLvFrameListRoot]; + LclVarDsc* frameVarDsc = lvaGetDesc(info.compLvFrameListRoot); if (frameVarDsc->lvTracked) { @@ -1839,7 +1829,7 @@ void Compiler::fgComputeLife(VARSET_TP& life, bool isDeadStore = fgComputeLifeLocal(life, keepAliveVars, tree); if (isDeadStore) { - LclVarDsc* varDsc = &lvaTable[tree->AsLclVarCommon()->GetLclNum()]; + LclVarDsc* varDsc = lvaGetDesc(tree->AsLclVarCommon()); bool doAgain = false; if (fgRemoveDeadStore(&tree, varDsc, life, &doAgain, pStmtInfoDirty DEBUGARG(treeModf))) diff --git a/src/coreclr/jit/loopcloning.cpp b/src/coreclr/jit/loopcloning.cpp index 5bc02e47a50371..a1c71f932f5a65 100644 --- a/src/coreclr/jit/loopcloning.cpp +++ b/src/coreclr/jit/loopcloning.cpp @@ -1790,10 +1790,9 @@ void Compiler::optCloneLoop(unsigned loopInd, LoopCloneContext* context) LoopDsc& loop = optLoopTable[loopInd]; - JITDUMP("\nCloning loop " FMT_LP ": [head: " FMT_BB ", first: " FMT_BB ", top: " FMT_BB ", entry: " FMT_BB - ", bottom: " FMT_BB ", child: " FMT_LP "].\n", - loopInd, loop.lpHead->bbNum, loop.lpFirst->bbNum, loop.lpTop->bbNum, loop.lpEntry->bbNum, - loop.lpBottom->bbNum, loop.lpChild); + JITDUMP("\nCloning loop " FMT_LP ": [head: " FMT_BB ", top: " FMT_BB ", entry: " FMT_BB ", bottom: " FMT_BB + ", child: " FMT_LP "].\n", + loopInd, loop.lpHead->bbNum, loop.lpTop->bbNum, loop.lpEntry->bbNum, loop.lpBottom->bbNum, loop.lpChild); // Determine the depth of the loop, so we can properly weight blocks added (outside the cloned loop blocks). unsigned depth = optLoopDepth(loopInd); diff --git a/src/coreclr/jit/lower.cpp b/src/coreclr/jit/lower.cpp index 2c9ed01a1ebebd..1c9febeb131440 100644 --- a/src/coreclr/jit/lower.cpp +++ b/src/coreclr/jit/lower.cpp @@ -139,8 +139,7 @@ GenTree* Lowering::LowerNode(GenTree* node) case GT_AND: case GT_OR: case GT_XOR: - ContainCheckBinary(node->AsOp()); - break; + return LowerBinaryArithmetic(node->AsOp()); case GT_MUL: case GT_MULHI: @@ -1332,9 +1331,8 @@ void Lowering::LowerArg(GenTreeCall* call, GenTree** ppArg) { if ((arg->OperGet() == GT_LCL_VAR) || (arg->OperGet() == GT_STORE_LCL_VAR)) { - unsigned varNum = arg->AsLclVarCommon()->GetLclNum(); - LclVarDsc* varDsc = &comp->lvaTable[varNum]; - type = varDsc->lvType; + const LclVarDsc* varDsc = comp->lvaGetDesc(arg->AsLclVarCommon()); + type = varDsc->lvType; } else if (arg->OperIs(GT_SIMD, GT_HWINTRINSIC)) { @@ -3035,7 +3033,7 @@ void Lowering::LowerRet(GenTreeUnOp* ret) { ReturnTypeDesc retTypeDesc; LclVarDsc* varDsc = nullptr; - varDsc = comp->lvaGetDesc(retVal->AsLclVar()->GetLclNum()); + varDsc = comp->lvaGetDesc(retVal->AsLclVar()); retTypeDesc.InitializeStructReturnType(comp, varDsc->GetStructHnd(), comp->info.compCallConv); if (retTypeDesc.GetReturnRegCount() > 1) { @@ -3374,9 +3372,7 @@ void Lowering::LowerRetStruct(GenTreeUnOp* ret) case GT_LCL_FLD: { #ifdef DEBUG - GenTreeLclFld* lclFld = retVal->AsLclFld(); - unsigned lclNum = lclFld->GetLclNum(); - LclVarDsc* varDsc = comp->lvaGetDesc(lclNum); + LclVarDsc* varDsc = comp->lvaGetDesc(retVal->AsLclFld()); assert(varDsc->lvDoNotEnregister); #endif retVal->ChangeType(nativeReturnType); @@ -5034,6 +5030,28 @@ bool Lowering::TryCreateAddrMode(GenTree* addr, bool isContainable, var_types ta } } +#ifdef TARGET_ARM64 + // Check if we can "contain" LEA(BFIZ) in order to extend 32bit index to 64bit as part of load/store. + if ((index != nullptr) && index->OperIs(GT_BFIZ) && index->gtGetOp1()->OperIs(GT_CAST) && + index->gtGetOp2()->IsCnsIntOrI() && varTypeIsIntegral(targetType)) + { + // BFIZ node is a binary op where op1 is GT_CAST and op2 is GT_CNS_INT + GenTreeCast* cast = index->gtGetOp1()->AsCast(); + assert(cast->isContained()); + + const unsigned shiftBy = (unsigned)index->gtGetOp2()->AsIntCon()->IconValue(); + + // 'scale' and 'offset' have to be unset since we're going to use [base + index * SXTW/UXTW scale] form + // where there is no room for additional offsets/scales on ARM64. 'shiftBy' has to match target's width. + if (cast->CastOp()->TypeIs(TYP_INT) && cast->TypeIs(TYP_LONG) && (genTypeSize(targetType) == (1U << shiftBy)) && + (scale == 1) && (offset == 0)) + { + // TODO: Make sure that genCreateAddrMode marks such BFIZ candidates as GTF_DONT_CSE for better CQ. + MakeSrcContained(addrMode, index); + } + } +#endif + JITDUMP("New addressing mode node:\n "); DISPNODE(addrMode); JITDUMP("\n"); @@ -5104,6 +5122,55 @@ GenTree* Lowering::LowerAdd(GenTreeOp* node) return nullptr; } +//------------------------------------------------------------------------ +// LowerBinaryArithmetic: lowers the given binary arithmetic node. +// +// Recognizes opportunities for using target-independent "combined" nodes +// (currently AND_NOT on ARMArch). Performs containment checks. +// +// Arguments: +// node - the arithmetic node to lower +// +// Returns: +// The next node to lower. +// +GenTree* Lowering::LowerBinaryArithmetic(GenTreeOp* node) +{ + // TODO-CQ-XArch: support BMI2 "andn" in codegen and condition + // this logic on the support for the instruction set on XArch. + CLANG_FORMAT_COMMENT_ANCHOR; + +#ifdef TARGET_ARMARCH + if (comp->opts.OptimizationEnabled() && node->OperIs(GT_AND)) + { + GenTree* opNode = nullptr; + GenTree* notNode = nullptr; + if (node->gtGetOp1()->OperIs(GT_NOT)) + { + notNode = node->gtGetOp1(); + opNode = node->gtGetOp2(); + } + else if (node->gtGetOp2()->OperIs(GT_NOT)) + { + notNode = node->gtGetOp2(); + opNode = node->gtGetOp1(); + } + + if (notNode != nullptr) + { + node->gtOp1 = opNode; + node->gtOp2 = notNode->AsUnOp()->gtGetOp1(); + node->ChangeOper(GT_AND_NOT); + BlockRange().Remove(notNode); + } + } +#endif // TARGET_ARMARCH + + ContainCheckBinary(node); + + return node->gtNext; +} + //------------------------------------------------------------------------ // LowerUnsignedDivOrMod: Lowers a GT_UDIV/GT_UMOD node. // @@ -5753,6 +5820,35 @@ void Lowering::LowerShift(GenTreeOp* shift) shift->gtOp2->ClearContained(); } ContainCheckShiftRotate(shift); + +#ifdef TARGET_ARM64 + // Try to recognize ubfiz/sbfiz idiom in LSH(CAST(X), CNS) tree + if (comp->opts.OptimizationEnabled() && shift->OperIs(GT_LSH) && shift->gtGetOp1()->OperIs(GT_CAST) && + shift->gtGetOp2()->IsCnsIntOrI() && !shift->isContained()) + { + GenTreeIntCon* cns = shift->gtGetOp2()->AsIntCon(); + GenTreeCast* cast = shift->gtGetOp1()->AsCast(); + + if (!cast->isContained() && !cast->IsRegOptional() && !cast->gtOverflow() && + // Smaller CastOp is most likely an IND(X) node which is lowered to a zero-extend load + cast->CastOp()->TypeIs(TYP_LONG, TYP_INT)) + { + // Cast is either "TYP_LONG <- TYP_INT" or "TYP_INT <- %SMALL_INT% <- TYP_INT" (signed or unsigned) + unsigned dstBits = genTypeSize(cast) * BITS_PER_BYTE; + unsigned srcBits = varTypeIsSmall(cast->CastToType()) ? genTypeSize(cast->CastToType()) * BITS_PER_BYTE + : genTypeSize(cast->CastOp()) * BITS_PER_BYTE; + assert(!cast->CastOp()->isContained()); + + // It has to be an upcast and CNS must be in [1..srcBits) range + if ((srcBits < dstBits) && (cns->IconValue() > 0) && (cns->IconValue() < srcBits)) + { + JITDUMP("Recognized ubfix/sbfix pattern in LSH(CAST, CNS). Changing op to GT_BFIZ"); + shift->ChangeOper(GT_BFIZ); + MakeSrcContained(shift, cast); + } + } + } +#endif } void Lowering::WidenSIMD12IfNecessary(GenTreeLclVarCommon* node) @@ -5788,8 +5884,7 @@ void Lowering::WidenSIMD12IfNecessary(GenTreeLclVarCommon* node) // as a return buffer pointer. The callee doesn't write the high 4 bytes, and we don't need to clear // it either. - unsigned varNum = node->AsLclVarCommon()->GetLclNum(); - LclVarDsc* varDsc = &comp->lvaTable[varNum]; + LclVarDsc* varDsc = comp->lvaGetDesc(node->AsLclVarCommon()); if (comp->lvaMapSimd12ToSimd16(varDsc)) { @@ -6121,9 +6216,7 @@ void Lowering::CheckNode(Compiler* compiler, GenTree* node) case GT_LCL_VAR: case GT_STORE_LCL_VAR: { - GenTreeLclVar* lclVar = node->AsLclVar(); - const unsigned lclNum = lclVar->GetLclNum(); - const LclVarDsc* varDsc = compiler->lvaGetDesc(lclNum); + const LclVarDsc* varDsc = compiler->lvaGetDesc(node->AsLclVar()); #if defined(FEATURE_SIMD) && defined(TARGET_64BIT) if (node->TypeIs(TYP_SIMD12)) { @@ -6167,9 +6260,7 @@ void Lowering::CheckNode(Compiler* compiler, GenTree* node) case GT_LCL_FLD: case GT_STORE_LCL_FLD: { - GenTreeLclFld* lclFld = node->AsLclFld(); - const unsigned lclNum = lclFld->GetLclNum(); - const LclVarDsc* varDsc = compiler->lvaGetDesc(lclNum); + const LclVarDsc* varDsc = compiler->lvaGetDesc(node->AsLclFld()); assert(varDsc->lvDoNotEnregister); } break; @@ -6612,8 +6703,7 @@ void Lowering::ContainCheckRet(GenTreeUnOp* ret) // op1 must be either a lclvar or a multi-reg returning call if (op1->OperGet() == GT_LCL_VAR) { - GenTreeLclVarCommon* lclVarCommon = op1->AsLclVarCommon(); - LclVarDsc* varDsc = &(comp->lvaTable[lclVarCommon->GetLclNum()]); + const LclVarDsc* varDsc = comp->lvaGetDesc(op1->AsLclVarCommon()); // This must be a multi-reg return or an HFA of a single element. assert(varDsc->lvIsMultiRegRet || (varDsc->lvIsHfa() && varTypeIsValidHfaType(varDsc->lvType))); @@ -6693,6 +6783,51 @@ void Lowering::LowerStoreIndirCommon(GenTreeStoreInd* ind) TryCreateAddrMode(ind->Addr(), true, ind->TypeGet()); if (!comp->codeGen->gcInfo.gcIsWriteBarrierStoreIndNode(ind)) { + if (varTypeIsFloating(ind) && ind->Data()->IsCnsFltOrDbl()) + { + // Optimize *x = DCON to *x = ICON which can be slightly faster and/or smaller. + GenTree* data = ind->Data(); + double dblCns = data->AsDblCon()->gtDconVal; + ssize_t intCns = 0; + var_types type = TYP_UNKNOWN; + // XARCH: we can always contain the immediates. + // ARM64: zero can always be contained, other cases will use immediates from the data + // section and it is not a clear win to switch them to inline integers. + // ARM: FP constants are assembled from integral ones, so it is always profitable + // to directly use the integers as it avoids the int -> float conversion. + CLANG_FORMAT_COMMENT_ANCHOR; + +#if defined(TARGET_XARCH) || defined(TARGET_ARM) + bool shouldSwitchToInteger = true; +#else // TARGET_ARM64 + bool shouldSwitchToInteger = !data->IsCnsNonZeroFltOrDbl(); +#endif + + if (shouldSwitchToInteger) + { + if (ind->TypeIs(TYP_FLOAT)) + { + float fltCns = static_cast(dblCns); // should be a safe round-trip + intCns = static_cast(*reinterpret_cast(&fltCns)); + type = TYP_INT; + } +#ifdef TARGET_64BIT + else + { + assert(ind->TypeIs(TYP_DOUBLE)); + intCns = static_cast(*reinterpret_cast(&dblCns)); + type = TYP_LONG; + } +#endif + } + + if (type != TYP_UNKNOWN) + { + data->BashToConst(intCns, type); + ind->ChangeType(type); + } + } + LowerStoreIndir(ind); } } @@ -6762,7 +6897,7 @@ void Lowering::TransformUnusedIndirection(GenTreeIndir* ind, Compiler* comp, Bas #ifdef TARGET_ARM64 bool useNullCheck = true; #elif TARGET_ARM - bool useNullCheck = false; + bool useNullCheck = false; #else // TARGET_XARCH bool useNullCheck = !ind->Addr()->isContained(); #endif // !TARGET_XARCH diff --git a/src/coreclr/jit/lower.h b/src/coreclr/jit/lower.h index b64f4a64109448..ed0ecc56619708 100644 --- a/src/coreclr/jit/lower.h +++ b/src/coreclr/jit/lower.h @@ -297,6 +297,7 @@ class Lowering final : public Phase void LowerStoreIndir(GenTreeStoreInd* node); GenTree* LowerAdd(GenTreeOp* node); GenTree* LowerMul(GenTreeOp* mul); + GenTree* LowerBinaryArithmetic(GenTreeOp* node); bool LowerUnsignedDivOrMod(GenTreeOp* divMod); GenTree* LowerConstIntDivOrMod(GenTree* node); GenTree* LowerSignedDivOrMod(GenTree* node); @@ -595,7 +596,7 @@ class Lowering final : public Phase // This ensures that the local's value is valid on-stack as expected for a *LCL_FLD. void verifyLclFldDoNotEnregister(unsigned lclNum) { - LclVarDsc* varDsc = &(comp->lvaTable[lclNum]); + LclVarDsc* varDsc = comp->lvaGetDesc(lclNum); // Do a couple of simple checks before setting lvDoNotEnregister. // This may not cover all cases in 'isRegCandidate()' but we don't want to // do an expensive check here. For non-candidates it is not harmful to set lvDoNotEnregister. diff --git a/src/coreclr/jit/lowerarmarch.cpp b/src/coreclr/jit/lowerarmarch.cpp index 2f1d32e289a5c2..345edc402cc3fb 100644 --- a/src/coreclr/jit/lowerarmarch.cpp +++ b/src/coreclr/jit/lowerarmarch.cpp @@ -48,13 +48,22 @@ bool Lowering::IsCallTargetInRange(void* addr) // True if the immediate can be folded into an instruction, // for example small enough and non-relocatable. // -// TODO-CQ: we can contain a floating point 0.0 constant in a compare instruction -// (vcmp on arm, fcmp on arm64). -// bool Lowering::IsContainableImmed(GenTree* parentNode, GenTree* childNode) const { if (!varTypeIsFloating(parentNode->TypeGet())) { +#ifdef TARGET_ARM64 + if (parentNode->OperIsRelop() && childNode->IsFPZero()) + { + // Contain 0.0 constant in fcmp on arm64 + // TODO: Enable for arm too (vcmp) + + // We currently don't emit these for floating points + assert(!parentNode->OperIs(GT_TEST_EQ, GT_TEST_NE)); + return true; + } +#endif + // Make sure we have an actual immediate if (!childNode->IsCnsIntOrI()) return false; @@ -600,27 +609,25 @@ void Lowering::LowerSIMD(GenTreeSIMD* simdNode) // void Lowering::LowerHWIntrinsicFusedMultiplyAddScalar(GenTreeHWIntrinsic* node) { - assert(node->gtHWIntrinsicId == NI_AdvSimd_FusedMultiplyAddScalar); - - const HWIntrinsic intrin(node); + assert(node->GetHWIntrinsicId() == NI_AdvSimd_FusedMultiplyAddScalar); - GenTree* op1 = intrin.op1; - GenTree* op2 = intrin.op2; - GenTree* op3 = intrin.op3; + GenTree* op1 = node->Op(1); + GenTree* op2 = node->Op(2); + GenTree* op3 = node->Op(3); auto lowerOperand = [this](GenTree* op) { bool wasNegated = false; if (op->OperIsHWIntrinsic() && - ((op->AsHWIntrinsic()->gtHWIntrinsicId == NI_AdvSimd_Arm64_DuplicateToVector64) || - (op->AsHWIntrinsic()->gtHWIntrinsicId == NI_Vector64_CreateScalarUnsafe))) + ((op->AsHWIntrinsic()->GetHWIntrinsicId() == NI_AdvSimd_Arm64_DuplicateToVector64) || + (op->AsHWIntrinsic()->GetHWIntrinsicId() == NI_Vector64_CreateScalarUnsafe))) { GenTreeHWIntrinsic* createVector64 = op->AsHWIntrinsic(); - GenTree* valueOp = createVector64->gtGetOp1(); + GenTree* valueOp = createVector64->Op(1); if (valueOp->OperIs(GT_NEG)) { - createVector64->gtOp1 = valueOp->gtGetOp1(); + createVector64->Op(1) = valueOp->gtGetOp1(); BlockRange().Remove(valueOp); wasNegated = true; } @@ -637,16 +644,16 @@ void Lowering::LowerHWIntrinsicFusedMultiplyAddScalar(GenTreeHWIntrinsic* node) { if (op2WasNegated != op3WasNegated) { - node->gtHWIntrinsicId = NI_AdvSimd_FusedMultiplyAddNegatedScalar; + node->ChangeHWIntrinsicId(NI_AdvSimd_FusedMultiplyAddNegatedScalar); } else { - node->gtHWIntrinsicId = NI_AdvSimd_FusedMultiplySubtractNegatedScalar; + node->ChangeHWIntrinsicId(NI_AdvSimd_FusedMultiplySubtractNegatedScalar); } } else if (op2WasNegated != op3WasNegated) { - node->gtHWIntrinsicId = NI_AdvSimd_FusedMultiplySubtractScalar; + node->ChangeHWIntrinsicId(NI_AdvSimd_FusedMultiplySubtractScalar); } } @@ -667,7 +674,7 @@ void Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node) node->gtType = TYP_SIMD16; } - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); switch (intrinsicId) { @@ -680,7 +687,7 @@ void Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node) // the same intrinsic as when it came in. LowerHWIntrinsicCreate(node); - assert(!node->OperIsHWIntrinsic() || (node->gtHWIntrinsicId != intrinsicId)); + assert(!node->OperIsHWIntrinsic() || (node->GetHWIntrinsicId() != intrinsicId)); LowerNode(node); return; } @@ -730,18 +737,19 @@ void Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node) // This check may end up modifying node->gtOp1 if it is a cast node that can be removed bool Lowering::IsValidConstForMovImm(GenTreeHWIntrinsic* node) { - assert((node->gtHWIntrinsicId == NI_Vector64_Create) || (node->gtHWIntrinsicId == NI_Vector128_Create) || - (node->gtHWIntrinsicId == NI_Vector64_CreateScalarUnsafe) || - (node->gtHWIntrinsicId == NI_Vector128_CreateScalarUnsafe) || - (node->gtHWIntrinsicId == NI_AdvSimd_DuplicateToVector64) || - (node->gtHWIntrinsicId == NI_AdvSimd_DuplicateToVector128) || - (node->gtHWIntrinsicId == NI_AdvSimd_Arm64_DuplicateToVector64) || - (node->gtHWIntrinsicId == NI_AdvSimd_Arm64_DuplicateToVector128)); - assert(HWIntrinsicInfo::lookupNumArgs(node) == 1); - - GenTree* op1 = node->gtOp1; + assert((node->GetHWIntrinsicId() == NI_Vector64_Create) || (node->GetHWIntrinsicId() == NI_Vector128_Create) || + (node->GetHWIntrinsicId() == NI_Vector64_CreateScalarUnsafe) || + (node->GetHWIntrinsicId() == NI_Vector128_CreateScalarUnsafe) || + (node->GetHWIntrinsicId() == NI_AdvSimd_DuplicateToVector64) || + (node->GetHWIntrinsicId() == NI_AdvSimd_DuplicateToVector128) || + (node->GetHWIntrinsicId() == NI_AdvSimd_Arm64_DuplicateToVector64) || + (node->GetHWIntrinsicId() == NI_AdvSimd_Arm64_DuplicateToVector128)); + assert(node->GetOperandCount() == 1); + + GenTree* op1 = node->Op(1); GenTree* castOp = nullptr; + // TODO-Casts: why don't we fold the casts? MinOpts? if (varTypeIsIntegral(node->GetSimdBaseType()) && op1->OperIs(GT_CAST)) { // We will sometimes get a cast around a constant value (such as for @@ -764,8 +772,8 @@ bool Lowering::IsValidConstForMovImm(GenTreeHWIntrinsic* node) // We found a containable immediate under // a cast, so remove the cast from the LIR. - BlockRange().Remove(node->gtOp1); - node->gtOp1 = op1; + BlockRange().Remove(node->Op(1)); + node->Op(1) = op1; } return true; } @@ -791,7 +799,7 @@ bool Lowering::IsValidConstForMovImm(GenTreeHWIntrinsic* node) // void Lowering::LowerHWIntrinsicCmpOp(GenTreeHWIntrinsic* node, genTreeOps cmpOp) { - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); CorInfoType simdBaseJitType = node->GetSimdBaseJitType(); var_types simdBaseType = node->GetSimdBaseType(); unsigned simdSize = node->GetSimdSize(); @@ -811,8 +819,8 @@ void Lowering::LowerHWIntrinsicCmpOp(GenTreeHWIntrinsic* node, genTreeOps cmpOp) // /--* op1 simd // node = * HWINTRINSIC simd T op_Equality - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); + GenTree* op1 = node->Op(1); + GenTree* op2 = node->Op(2); NamedIntrinsic cmpIntrinsic; @@ -886,9 +894,9 @@ void Lowering::LowerHWIntrinsicCmpOp(GenTreeHWIntrinsic* node, genTreeOps cmpOp) node->ChangeOper(cmpOp); - node->gtType = TYP_INT; - node->gtOp1 = val; - node->gtOp2 = zroCns; + node->gtType = TYP_INT; + node->AsOp()->gtOp1 = val; + node->AsOp()->gtOp2 = zroCns; // The CompareEqual will set (condition is true) or clear (condition is false) all bits of the respective element // The MinAcross then ensures we get either all bits set (all conditions are true) or clear (any condition is false) @@ -906,13 +914,20 @@ void Lowering::LowerHWIntrinsicCmpOp(GenTreeHWIntrinsic* node, genTreeOps cmpOp) //---------------------------------------------------------------------------------------------- // Lowering::LowerHWIntrinsicCreate: Lowers a Vector64 or Vector128 Create call // +// Performs the following transformations: +// 1. If all the arguments are constant (including the broadcast case), the vector +// will be loaded from the data section, or turned into Zero/AllBitsSet, if possible. +// 2. Non-constant broadcasts (argCnt == 1) are turned into DuplicateToVector intrinsics. +// 3. Remaining cases get a chain of "Insert"s, from the second element to the last, where +// the vector to be inserted into is created with CreateUnsafeScalar from the first element. +// // Arguments: // node - The hardware intrinsic node. // void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) { - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; - var_types simdType = node->gtType; + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); + var_types simdType = node->TypeGet(); CorInfoType simdBaseJitType = node->GetSimdBaseJitType(); var_types simdBaseType = node->GetSimdBaseType(); unsigned simdSize = node->GetSimdSize(); @@ -929,109 +944,47 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) assert(varTypeIsArithmetic(simdBaseType)); assert(simdSize != 0); - GenTreeArgList* argList = nullptr; - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); + size_t argCnt = node->GetOperandCount(); + size_t cnsArgCnt = 0; - // Spare GenTrees to be used for the lowering logic below - // Defined upfront to avoid naming conflicts, etc... - GenTree* idx = nullptr; - GenTree* tmp1 = nullptr; - GenTree* tmp2 = nullptr; - GenTree* tmp3 = nullptr; - - assert(op1 != nullptr); - - unsigned argCnt = 0; - unsigned cnsArgCnt = 0; - - if (op1->OperIsList()) + // These intrinsics are meant to set the same value to every element. + if ((argCnt == 1) && HandleArgForHWIntrinsicCreate(node->Op(1), 0, vecCns, simdBaseType)) { - assert(op2 == nullptr); - - for (argList = op1->AsArgList(); argList != nullptr; argList = argList->Rest()) + // Now assign the rest of the arguments. + for (unsigned i = 1; i < simdSize / genTypeSize(simdBaseType); i++) { - if (HandleArgForHWIntrinsicCreate(argList->Current(), argCnt, vecCns, simdBaseType)) - { - cnsArgCnt += 1; - } - argCnt += 1; + HandleArgForHWIntrinsicCreate(node->Op(1), i, vecCns, simdBaseType); } + + cnsArgCnt = 1; } else { - if (HandleArgForHWIntrinsicCreate(op1, argCnt, vecCns, simdBaseType)) + for (unsigned i = 1; i <= argCnt; i++) { - cnsArgCnt += 1; - } - argCnt += 1; - - if (op2 != nullptr) - { - if (HandleArgForHWIntrinsicCreate(op2, argCnt, vecCns, simdBaseType)) - { - cnsArgCnt += 1; - } - argCnt += 1; - } - else if (cnsArgCnt == 1) - { - // These intrinsics are meant to set the same value to every element - // so we'll just specially handle it here and copy it into the remaining - // indices. - - for (unsigned i = 1; i < simdSize / genTypeSize(simdBaseType); i++) + if (HandleArgForHWIntrinsicCreate(node->Op(i), i - 1, vecCns, simdBaseType)) { - HandleArgForHWIntrinsicCreate(op1, i, vecCns, simdBaseType); + cnsArgCnt++; } } } assert((argCnt == 1) || (argCnt == (simdSize / genTypeSize(simdBaseType)))); - if ((argCnt == cnsArgCnt) && (argCnt == 1)) + // Check if we have a cast that we can remove. Note that "IsValidConstForMovImm" + // will reset Op(1) if it finds such a cast, so we do not need to handle it here. + // TODO-Casts: why are casts from constants checked for here? + if ((argCnt == cnsArgCnt) && (argCnt == 1) && IsValidConstForMovImm(node)) { - GenTree* castOp = nullptr; - - if (varTypeIsIntegral(simdBaseType) && op1->OperIs(GT_CAST)) - { - // We will sometimes get a cast around a constant value (such as for - // certain long constants) which would block the below containment. - // So we will temporarily check what the cast is from instead so we - // can catch those cases as well. - - castOp = op1->AsCast()->CastOp(); - op1 = castOp; - } - - if (IsValidConstForMovImm(node)) - { - // Set the cnsArgCnt to zero so we get lowered to a DuplicateToVector - // intrinsic, which will itself mark the node as contained. - cnsArgCnt = 0; - - // Reacquire op1 as the above check may have removed a cast node and - // changed op1. - op1 = node->gtOp1; - } + // Set the cnsArgCnt to zero so we get lowered to a DuplicateToVector + // intrinsic, which will itself mark the node as contained. + cnsArgCnt = 0; } if (argCnt == cnsArgCnt) { - if (op1->OperIsList()) + for (GenTree* arg : node->Operands()) { - for (argList = op1->AsArgList(); argList != nullptr; argList = argList->Rest()) - { - BlockRange().Remove(argList->Current()); - } - } - else - { - BlockRange().Remove(op1); - - if (op2 != nullptr) - { - BlockRange().Remove(op2); - } + BlockRange().Remove(arg); } assert((simdSize == 8) || (simdSize == 16)); @@ -1043,16 +996,12 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) if (vecCns.i64[0] == 0) { - node->gtOp1 = nullptr; - node->gtOp2 = nullptr; - node->gtHWIntrinsicId = (simdSize == 8) ? NI_Vector64_get_Zero : NI_Vector128_get_Zero; + node->ResetHWIntrinsicId((simdSize == 8) ? NI_Vector64_get_Zero : NI_Vector128_get_Zero); return; } else if (vecCns.i64[0] == -1) { - node->gtOp1 = nullptr; - node->gtOp2 = nullptr; - node->gtHWIntrinsicId = (simdSize == 8) ? NI_Vector64_get_AllBitsSet : NI_Vector128_get_AllBitsSet; + node->ResetHWIntrinsicId((simdSize == 8) ? NI_Vector64_get_AllBitsSet : NI_Vector128_get_AllBitsSet); return; } } @@ -1067,7 +1016,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) BlockRange().InsertBefore(node, clsVarAddr); node->ChangeOper(GT_IND); - node->gtOp1 = clsVarAddr; + node->AsOp()->gtOp1 = clsVarAddr; // TODO-ARM64-CQ: We should be able to modify at least the paths that use Insert to trivially support partial // vector constants. With this, we can create a constant if say 50% of the inputs are also constant and just @@ -1090,13 +1039,13 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) if (varTypeIsLong(simdBaseType) || (simdBaseType == TYP_DOUBLE)) { - node->gtHWIntrinsicId = - (simdType == TYP_SIMD8) ? NI_AdvSimd_Arm64_DuplicateToVector64 : NI_AdvSimd_Arm64_DuplicateToVector128; + node->ChangeHWIntrinsicId((simdType == TYP_SIMD8) ? NI_AdvSimd_Arm64_DuplicateToVector64 + : NI_AdvSimd_Arm64_DuplicateToVector128); } else { - node->gtHWIntrinsicId = - (simdType == TYP_SIMD8) ? NI_AdvSimd_DuplicateToVector64 : NI_AdvSimd_DuplicateToVector128; + node->ChangeHWIntrinsicId((simdType == TYP_SIMD8) ? NI_AdvSimd_DuplicateToVector64 + : NI_AdvSimd_DuplicateToVector128); } return; } @@ -1107,13 +1056,6 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) // +--* opN T // node = * HWINTRINSIC simd T Create - if (op1->OperIsList()) - { - argList = op1->AsArgList(); - op1 = argList->Current(); - argList = argList->Rest(); - } - // We will be constructing the following parts: // /--* op1 T // tmp1 = * HWINTRINSIC simd8 T CreateScalarUnsafe @@ -1123,67 +1065,50 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) // var tmp1 = Vector64.CreateScalarUnsafe(op1); // ... - NamedIntrinsic createScalarUnsafe = + NamedIntrinsic createScalar = (simdType == TYP_SIMD8) ? NI_Vector64_CreateScalarUnsafe : NI_Vector128_CreateScalarUnsafe; - tmp1 = comp->gtNewSimdHWIntrinsicNode(simdType, op1, createScalarUnsafe, simdBaseJitType, simdSize); - BlockRange().InsertAfter(op1, tmp1); + GenTree* tmp1 = comp->gtNewSimdHWIntrinsicNode(simdType, node->Op(1), createScalar, simdBaseJitType, simdSize); + BlockRange().InsertAfter(node->Op(1), tmp1); LowerNode(tmp1); + // We will be constructing the following parts: + // ... + // idx = CNS_INT int N + // /--* tmp1 simd + // +--* idx int + // +--* opN T + // tmp1 = * HWINTRINSIC simd T Insert + // ... + + // This is roughly the following managed code: + // ... + // tmp1 = AdvSimd.Insert(tmp1, N, opN); + // ... + unsigned N = 0; GenTree* opN = nullptr; + GenTree* idx = nullptr; for (N = 1; N < argCnt - 1; N++) { - // We will be constructing the following parts: - // ... - // idx = CNS_INT int N - // /--* tmp1 simd - // +--* idx int - // +--* opN T - // tmp1 = * HWINTRINSIC simd T Insert - // ... - - // This is roughly the following managed code: - // ... - // tmp1 = AdvSimd.Insert(tmp1, N, opN); - // ... - - opN = argList->Current(); - - idx = comp->gtNewIconNode(N, TYP_INT); + opN = node->Op(N + 1); + idx = comp->gtNewIconNode(N); BlockRange().InsertBefore(opN, idx); tmp1 = comp->gtNewSimdHWIntrinsicNode(simdType, tmp1, idx, opN, NI_AdvSimd_Insert, simdBaseJitType, simdSize); BlockRange().InsertAfter(opN, tmp1); LowerNode(tmp1); - - argList = argList->Rest(); } assert(N == (argCnt - 1)); - // We will be constructing the following parts: - // idx = CNS_INT int N - // /--* tmp1 simd - // +--* idx int - // +--* opN T - // node = * HWINTRINSIC simd T Insert - - // This is roughly the following managed code: - // ... - // tmp1 = AdvSimd.Insert(tmp1, N, opN); - // ... - - opN = (argCnt == 2) ? op2 : argList->Current(); - - idx = comp->gtNewIconNode(N, TYP_INT); + // For the last insert, we will reuse the existing node and so handle it here, outside the loop. + opN = node->Op(argCnt); + idx = comp->gtNewIconNode(N); BlockRange().InsertBefore(opN, idx); - node->gtOp1 = comp->gtNewArgList(tmp1, idx, opN); - node->gtOp2 = nullptr; - - node->gtHWIntrinsicId = NI_AdvSimd_Insert; + node->ResetHWIntrinsicId(NI_AdvSimd_Insert, comp, tmp1, idx, opN); } //---------------------------------------------------------------------------------------------- @@ -1194,7 +1119,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) // void Lowering::LowerHWIntrinsicDot(GenTreeHWIntrinsic* node) { - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); CorInfoType simdBaseJitType = node->GetSimdBaseJitType(); var_types simdBaseType = node->GetSimdBaseType(); unsigned simdSize = node->GetSimdSize(); @@ -1205,12 +1130,8 @@ void Lowering::LowerHWIntrinsicDot(GenTreeHWIntrinsic* node) assert(varTypeIsArithmetic(simdBaseType)); assert(simdSize != 0); - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); - - assert(op1 != nullptr); - assert(op2 != nullptr); - assert(!op1->OperIsList()); + GenTree* op1 = node->Op(1); + GenTree* op2 = node->Op(2); // Spare GenTrees to be used for the lowering logic below // Defined upfront to avoid naming conflicts, etc... @@ -1297,10 +1218,10 @@ void Lowering::LowerHWIntrinsicDot(GenTreeHWIntrinsic* node) // var tmp2 = tmp1; // ... - node->gtOp1 = tmp1; - LIR::Use tmp1Use(BlockRange(), &node->gtOp1, node); + node->Op(1) = tmp1; + LIR::Use tmp1Use(BlockRange(), &node->Op(1), node); ReplaceWithLclVar(tmp1Use); - tmp1 = node->gtOp1; + tmp1 = node->Op(1); tmp2 = comp->gtClone(tmp1); BlockRange().InsertAfter(tmp1, tmp2); @@ -1378,10 +1299,10 @@ void Lowering::LowerHWIntrinsicDot(GenTreeHWIntrinsic* node) // var tmp1 = AdvSimd.Arm64.AddPairwise(tmp1, tmp2); // ... - node->gtOp1 = tmp1; - LIR::Use tmp1Use(BlockRange(), &node->gtOp1, node); + node->Op(1) = tmp1; + LIR::Use tmp1Use(BlockRange(), &node->Op(1), node); ReplaceWithLclVar(tmp1Use); - tmp1 = node->gtOp1; + tmp1 = node->Op(1); tmp2 = comp->gtClone(tmp1); BlockRange().InsertAfter(tmp1, tmp2); @@ -1424,12 +1345,8 @@ void Lowering::LowerHWIntrinsicDot(GenTreeHWIntrinsic* node) // ... // return tmp2.ToScalar(); - node->gtOp1 = tmp2; - node->gtOp2 = nullptr; - - node->gtHWIntrinsicId = (simdSize == 8) ? NI_Vector64_ToScalar : NI_Vector128_ToScalar; + node->ResetHWIntrinsicId((simdSize == 8) ? NI_Vector64_ToScalar : NI_Vector128_ToScalar, tmp2); LowerNode(node); - return; } #endif // FEATURE_HW_INTRINSICS @@ -1605,6 +1522,7 @@ void Lowering::ContainCheckBinary(GenTreeOp* node) } // If both 'a' and 'b' are GT_NEG - MADD will be emitted. + node->ChangeOper(GT_MADD); MakeSrcContained(node, mul); } } @@ -1696,7 +1614,7 @@ void Lowering::ContainCheckStoreLoc(GenTreeLclVarCommon* storeLoc) const MakeSrcContained(storeLoc, op1); if (op1->IsSIMDZero()) { - MakeSrcContained(op1, op1->gtGetOp1()); + MakeSrcContained(op1, op1->AsSIMD()->Op(1)); } } return; @@ -1780,11 +1698,11 @@ void Lowering::ContainCheckBoundsChk(GenTreeBoundsChk* node) // void Lowering::ContainCheckSIMD(GenTreeSIMD* simdNode) { - switch (simdNode->gtSIMDIntrinsicID) + switch (simdNode->GetSIMDIntrinsicId()) { case SIMDIntrinsicInit: { - GenTree* op1 = simdNode->AsOp()->gtOp1; + GenTree* op1 = simdNode->Op(1); if (op1->IsIntegralConst(0)) { MakeSrcContained(simdNode, op1); @@ -1794,7 +1712,7 @@ void Lowering::ContainCheckSIMD(GenTreeSIMD* simdNode) case SIMDIntrinsicInitArray: // We have an array and an index, which may be contained. - CheckImmedAndMakeContained(simdNode, simdNode->gtGetOp2()); + CheckImmedAndMakeContained(simdNode, simdNode->Op(2)); break; default: @@ -1919,10 +1837,7 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) case NI_AdvSimd_Arm64_DuplicateToVector128: if (IsValidConstForMovImm(node)) { - // Use node->gtOp1 as the above check may - // have removed a cast node and changed op1 - - MakeSrcContained(node, node->gtOp1); + MakeSrcContained(node, node->Op(1)); } break; diff --git a/src/coreclr/jit/lowerxarch.cpp b/src/coreclr/jit/lowerxarch.cpp index 8f15e9a04fb8eb..548a6033d872ba 100644 --- a/src/coreclr/jit/lowerxarch.cpp +++ b/src/coreclr/jit/lowerxarch.cpp @@ -51,8 +51,7 @@ void Lowering::LowerStoreLoc(GenTreeLclVarCommon* storeLoc) GenTreeIntCon* con = storeLoc->gtOp1->AsIntCon(); ssize_t ival = con->gtIconVal; - unsigned varNum = storeLoc->GetLclNum(); - LclVarDsc* varDsc = comp->lvaTable + varNum; + LclVarDsc* varDsc = comp->lvaGetDesc(storeLoc); if (varDsc->lvIsSIMDType()) { @@ -130,36 +129,6 @@ void Lowering::LowerStoreIndir(GenTreeStoreInd* node) return; } } - else if (node->Data()->IsCnsFltOrDbl()) - { - // Optimize *x = DCON to *x = ICON which is slightly faster on xarch - GenTree* data = node->Data(); - double dblCns = data->AsDblCon()->gtDconVal; - ssize_t intCns = 0; - var_types type = TYP_UNKNOWN; - - if (node->TypeIs(TYP_FLOAT)) - { - float fltCns = static_cast(dblCns); // should be a safe round-trip - intCns = static_cast(*reinterpret_cast(&fltCns)); - type = TYP_INT; - } -#ifdef TARGET_AMD64 - else - { - assert(node->TypeIs(TYP_DOUBLE)); - intCns = static_cast(*reinterpret_cast(&dblCns)); - type = TYP_LONG; - } -#endif - - if (type != TYP_UNKNOWN) - { - data->SetContained(); - data->BashToConst(intCns, type); - node->ChangeType(type); - } - } // Optimization: do not unnecessarily zero-extend the result of setcc. if (varTypeIsByte(node) && (node->Data()->OperIsCompare() || node->Data()->OperIs(GT_SETCC))) @@ -490,7 +459,7 @@ void Lowering::LowerPutArgStk(GenTreePutArgStk* putArgStk) { if (fieldNode->OperGet() == GT_LCL_VAR) { - LclVarDsc* varDsc = &(comp->lvaTable[fieldNode->AsLclVarCommon()->GetLclNum()]); + const LclVarDsc* varDsc = comp->lvaGetDesc(fieldNode->AsLclVarCommon()); if (!varDsc->lvDoNotEnregister) { fieldNode->SetRegOptional(); @@ -750,35 +719,30 @@ void Lowering::LowerSIMD(GenTreeSIMD* simdNode) simdNode->gtType = TYP_SIMD16; } - if (simdNode->gtSIMDIntrinsicID == SIMDIntrinsicInitN) + if (simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicInitN) { assert(simdNode->GetSimdBaseType() == TYP_FLOAT); - int argCount = 0; - int constArgCount = 0; - float constArgValues[4]{0, 0, 0, 0}; + size_t argCount = simdNode->GetOperandCount(); + size_t constArgCount = 0; + float constArgValues[4]{0, 0, 0, 0}; - for (GenTreeArgList* list = simdNode->gtGetOp1()->AsArgList(); list != nullptr; list = list->Rest()) + for (GenTree* arg : simdNode->Operands()) { - GenTree* arg = list->Current(); - - assert(arg->TypeGet() == simdNode->GetSimdBaseType()); - assert(argCount < (int)_countof(constArgValues)); + assert(arg->TypeIs(simdNode->GetSimdBaseType())); if (arg->IsCnsFltOrDbl()) { constArgValues[constArgCount] = static_cast(arg->AsDblCon()->gtDconVal); constArgCount++; } - - argCount++; } if (constArgCount == argCount) { - for (GenTreeArgList* list = simdNode->gtGetOp1()->AsArgList(); list != nullptr; list = list->Rest()) + for (GenTree* arg : simdNode->Operands()) { - BlockRange().Remove(list->Current()); + BlockRange().Remove(arg); } assert(sizeof(constArgValues) == 16); @@ -791,7 +755,7 @@ void Lowering::LowerSIMD(GenTreeSIMD* simdNode) GenTree* clsVarAddr = new (comp, GT_CLS_VAR_ADDR) GenTreeClsVar(GT_CLS_VAR_ADDR, TYP_I_IMPL, hnd, nullptr); BlockRange().InsertBefore(simdNode, clsVarAddr); simdNode->ChangeOper(GT_IND); - simdNode->gtOp1 = clsVarAddr; + simdNode->AsOp()->gtOp1 = clsVarAddr; ContainCheckIndir(simdNode->AsIndir()); return; @@ -817,8 +781,9 @@ void Lowering::LowerHWIntrinsicCC(GenTreeHWIntrinsic* node, NamedIntrinsic newIn { GenTreeCC* cc = LowerNodeCC(node, condition); - node->gtHWIntrinsicId = newIntrinsicId; - node->gtType = TYP_VOID; + assert(HWIntrinsicInfo::lookupNumArgs(newIntrinsicId) == 2); + node->ChangeHWIntrinsicId(newIntrinsicId); + node->gtType = TYP_VOID; node->ClearUnusedValue(); bool swapOperands = false; @@ -867,8 +832,8 @@ void Lowering::LowerHWIntrinsicCC(GenTreeHWIntrinsic* node, NamedIntrinsic newIn bool op1SupportsRegOptional = false; bool op2SupportsRegOptional = false; - if (!IsContainableHWIntrinsicOp(node, node->gtGetOp2(), &op2SupportsRegOptional) && - IsContainableHWIntrinsicOp(node, node->gtGetOp1(), &op1SupportsRegOptional)) + if (!IsContainableHWIntrinsicOp(node, node->Op(2), &op2SupportsRegOptional) && + IsContainableHWIntrinsicOp(node, node->Op(1), &op1SupportsRegOptional)) { // Swap operands if op2 cannot be contained but op1 can. swapOperands = true; @@ -877,7 +842,7 @@ void Lowering::LowerHWIntrinsicCC(GenTreeHWIntrinsic* node, NamedIntrinsic newIn if (swapOperands) { - std::swap(node->gtOp1, node->gtOp2); + std::swap(node->Op(1), node->Op(2)); if (cc != nullptr) { @@ -908,53 +873,44 @@ void Lowering::LowerHWIntrinsicCC(GenTreeHWIntrinsic* node, NamedIntrinsic newIn // void Lowering::LowerFusedMultiplyAdd(GenTreeHWIntrinsic* node) { - assert(node->gtHWIntrinsicId == NI_FMA_MultiplyAddScalar); - GenTreeArgList* argList = node->gtGetOp1()->AsArgList(); + assert(node->GetHWIntrinsicId() == NI_FMA_MultiplyAddScalar); GenTreeHWIntrinsic* createScalarOps[3]; - for (GenTreeHWIntrinsic*& createScalarOp : createScalarOps) + for (size_t i = 1; i <= 3; i++) { - GenTree*& current = argList->Current(); - assert(current != nullptr); - if (!current->OperIsHWIntrinsic()) - { - return; // Math(F).FusedMultiplyAdd is expected to emit three NI_Vector128_CreateScalarUnsafe - // but it's also possible to use NI_FMA_MultiplyAddScalar directly with any operands - } - GenTreeHWIntrinsic* hwArg = current->AsHWIntrinsic(); - if (hwArg->gtHWIntrinsicId != NI_Vector128_CreateScalarUnsafe) + GenTree* arg = node->Op(i); + if (!arg->OperIsHWIntrinsic() || (arg->AsHWIntrinsic()->GetHWIntrinsicId() != NI_Vector128_CreateScalarUnsafe)) { return; } - createScalarOp = hwArg; - argList = argList->Rest(); + + createScalarOps[i - 1] = arg->AsHWIntrinsic(); } - assert(argList == nullptr); - GenTree* argX = createScalarOps[0]->gtGetOp1(); - GenTree* argY = createScalarOps[1]->gtGetOp1(); - GenTree* argZ = createScalarOps[2]->gtGetOp1(); + GenTree* argX = createScalarOps[0]->Op(1); + GenTree* argY = createScalarOps[1]->Op(1); + GenTree* argZ = createScalarOps[2]->Op(1); const bool negMul = argX->OperIs(GT_NEG) != argY->OperIs(GT_NEG); if (argX->OperIs(GT_NEG)) { - createScalarOps[0]->gtOp1 = argX->gtGetOp1(); + createScalarOps[0]->Op(1) = argX->gtGetOp1(); BlockRange().Remove(argX); } if (argY->OperIs(GT_NEG)) { - createScalarOps[1]->gtOp1 = argY->gtGetOp1(); + createScalarOps[1]->Op(1) = argY->gtGetOp1(); BlockRange().Remove(argY); } if (argZ->OperIs(GT_NEG)) { - createScalarOps[2]->gtOp1 = argZ->gtGetOp1(); + createScalarOps[2]->Op(1) = argZ->gtGetOp1(); BlockRange().Remove(argZ); - node->gtHWIntrinsicId = negMul ? NI_FMA_MultiplySubtractNegatedScalar : NI_FMA_MultiplySubtractScalar; + node->ChangeHWIntrinsicId(negMul ? NI_FMA_MultiplySubtractNegatedScalar : NI_FMA_MultiplySubtractScalar); } else { - node->gtHWIntrinsicId = negMul ? NI_FMA_MultiplyAddNegatedScalar : NI_FMA_MultiplyAddScalar; + node->ChangeHWIntrinsicId(negMul ? NI_FMA_MultiplyAddNegatedScalar : NI_FMA_MultiplyAddScalar); } } @@ -973,7 +929,7 @@ void Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node) node->gtType = TYP_SIMD16; } - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); switch (intrinsicId) { @@ -988,7 +944,7 @@ void Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node) // intrinsics that are not Vector*.Create LowerHWIntrinsicCreate(node); - assert(!node->OperIsHWIntrinsic() || (node->gtHWIntrinsicId != intrinsicId)); + assert(!node->OperIsHWIntrinsic() || (node->GetHWIntrinsicId() != intrinsicId)); LowerNode(node); return; } @@ -1005,8 +961,8 @@ void Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node) { LowerHWIntrinsicGetElement(node); - if ((node->gtHWIntrinsicId == NI_Vector128_GetElement) || - (node->gtHWIntrinsicId == NI_Vector256_GetElement)) + if ((node->GetHWIntrinsicId() == NI_Vector128_GetElement) || + (node->GetHWIntrinsicId() == NI_Vector256_GetElement)) { // Most NI_Vector*_GetElement intrinsics are lowered to // alternative nodes, such as the Extract intrinsics, @@ -1053,11 +1009,9 @@ void Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node) if (varTypeIsFloating(node->GetSimdBaseType())) { assert(node->GetSimdBaseType() == TYP_FLOAT); - assert(node->gtOp1 != nullptr); - assert(node->gtOp2 != nullptr); assert(node->GetSimdSize() == 16); - GenTree* op2 = node->gtGetOp2(); + GenTree* op2 = node->Op(2); if (!op2->OperIsConst()) { @@ -1071,10 +1025,10 @@ void Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node) BlockRange().InsertAfter(msk, tmp); LowerNode(tmp); - node->gtOp2 = tmp; + node->Op(2) = tmp; } - node->gtHWIntrinsicId = NI_Vector128_GetElement; + node->ChangeHWIntrinsicId(NI_Vector128_GetElement); LowerNode(node); } break; @@ -1084,29 +1038,26 @@ void Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node) case NI_SSE41_Insert: case NI_SSE41_X64_Insert: { - assert(HWIntrinsicInfo::lookupNumArgs(node) == 3); - - GenTreeArgList* argList = node->gtOp1->AsArgList(); + assert(node->GetOperandCount() == 3); // Insert takes either a 32-bit register or a memory operand. // In either case, only SimdBaseType bits are read and so // widening or narrowing the operand may be unnecessary and it // can just be used directly. - - argList->Rest()->gtOp1 = TryRemoveCastIfPresent(node->GetSimdBaseType(), argList->Rest()->gtOp1); + node->Op(2) = TryRemoveCastIfPresent(node->GetSimdBaseType(), node->Op(2)); break; } case NI_SSE42_Crc32: { - assert(HWIntrinsicInfo::lookupNumArgs(node) == 2); + assert(node->GetOperandCount() == 2); // Crc32 takes either a bit register or a memory operand. // In either case, only gtType bits are read and so widening // or narrowing the operand may be unnecessary and it can // just be used directly. - node->gtOp2 = TryRemoveCastIfPresent(node->gtType, node->gtOp2); + node->Op(2) = TryRemoveCastIfPresent(node->TypeGet(), node->Op(2)); break; } @@ -1137,7 +1088,7 @@ void Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node) } // pre-AVX doesn't actually support these intrinsics in hardware so we need to swap the operands around - std::swap(node->gtOp1, node->gtOp2); + std::swap(node->Op(1), node->Op(2)); break; } @@ -1152,7 +1103,7 @@ void Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node) assert(varTypeIsIntegral(node->GetSimdBaseType())); // this isn't actually supported in hardware so we need to swap the operands around - std::swap(node->gtOp1, node->gtOp2); + std::swap(node->Op(1), node->Op(2)); break; } @@ -1272,7 +1223,7 @@ void Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node) // void Lowering::LowerHWIntrinsicCmpOp(GenTreeHWIntrinsic* node, genTreeOps cmpOp) { - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); CorInfoType simdBaseJitType = node->GetSimdBaseJitType(); var_types simdBaseType = node->GetSimdBaseType(); unsigned simdSize = node->GetSimdSize(); @@ -1292,8 +1243,8 @@ void Lowering::LowerHWIntrinsicCmpOp(GenTreeHWIntrinsic* node, genTreeOps cmpOp) // /--* op1 simd // node = * HWINTRINSIC simd T op_Equality - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); + GenTree* op1 = node->Op(1); + GenTree* op2 = node->Op(2); GenCondition cmpCnd = (cmpOp == GT_EQ) ? GenCondition::EQ : GenCondition::NE; @@ -1303,34 +1254,35 @@ void Lowering::LowerHWIntrinsicCmpOp(GenTreeHWIntrinsic* node, genTreeOps cmpOp) // just use PTEST. We can't support it for floating-point, however, // as it has both +0.0 and -0.0 where +0.0 == -0.0 - node->gtOp1 = op1; + node->Op(1) = op1; BlockRange().Remove(op2); - op2 = op2->AsOp()->gtGetOp1(); - - if (op2 != nullptr) + if (op2->AsMultiOp()->GetOperandCount() == 1) { // Some zero vectors are Create/Initialization nodes with a constant zero operand // We should also remove this to avoid dead code - BlockRange().Remove(op2); + assert(op2->AsMultiOp()->Op(1)->IsIntegralConst(0)); + BlockRange().Remove(op2->AsMultiOp()->Op(1)); } - LIR::Use op1Use(BlockRange(), &node->gtOp1, node); + LIR::Use op1Use(BlockRange(), &node->Op(1), node); ReplaceWithLclVar(op1Use); - op1 = node->gtOp1; + op1 = node->Op(1); op2 = comp->gtClone(op1); BlockRange().InsertAfter(op1, op2); - node->gtOp2 = op2; + node->Op(2) = op2; if (simdSize == 32) { - node->gtHWIntrinsicId = NI_AVX_TestZ; + // TODO-Review: LowerHWIntrinsicCC resets the id again, so why is this needed? + node->ChangeHWIntrinsicId(NI_AVX_TestZ); LowerHWIntrinsicCC(node, NI_AVX_PTEST, cmpCnd); } else { - node->gtHWIntrinsicId = NI_SSE41_TestZ; + // TODO-Review: LowerHWIntrinsicCC resets the id again, so why is this needed? + node->ChangeHWIntrinsicId(NI_SSE41_TestZ); LowerHWIntrinsicCC(node, NI_SSE41_PTEST, cmpCnd); } @@ -1492,10 +1444,9 @@ void Lowering::LowerHWIntrinsicCmpOp(GenTreeHWIntrinsic* node, genTreeOps cmpOp) } node->ChangeOper(cmpOp); - - node->gtType = TYP_INT; - node->gtOp1 = msk; - node->gtOp2 = mskCns; + node->ChangeType(TYP_INT); + node->AsOp()->gtOp1 = msk; + node->AsOp()->gtOp2 = mskCns; GenTree* cc = LowerNodeCC(node, cmpCnd); @@ -1513,7 +1464,7 @@ void Lowering::LowerHWIntrinsicCmpOp(GenTreeHWIntrinsic* node, genTreeOps cmpOp) // void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) { - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); var_types simdType = node->gtType; CorInfoType simdBaseJitType = node->GetSimdBaseJitType(); var_types simdBaseType = node->GetSimdBaseType(); @@ -1531,9 +1482,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) assert(varTypeIsArithmetic(simdBaseType)); assert(simdSize != 0); - GenTreeArgList* argList = nullptr; - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); + GenTree* op1 = node->Op(1); // Spare GenTrees to be used for the lowering logic below // Defined upfront to avoid naming conflicts, etc... @@ -1542,49 +1491,27 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) GenTree* tmp2 = nullptr; GenTree* tmp3 = nullptr; - assert(op1 != nullptr); - - unsigned argCnt = 0; - unsigned cnsArgCnt = 0; + size_t argCnt = node->GetOperandCount(); + size_t cnsArgCnt = 0; - if (op1->OperIsList()) + // These intrinsics are meant to set the same value to every element. + if ((argCnt == 1) && HandleArgForHWIntrinsicCreate(node->Op(1), 0, vecCns, simdBaseType)) { - assert(op2 == nullptr); - - for (argList = op1->AsArgList(); argList != nullptr; argList = argList->Rest()) + // Now assign the rest of the arguments. + for (unsigned i = 1; i < simdSize / genTypeSize(simdBaseType); i++) { - if (HandleArgForHWIntrinsicCreate(argList->Current(), argCnt, vecCns, simdBaseType)) - { - cnsArgCnt += 1; - } - argCnt += 1; + HandleArgForHWIntrinsicCreate(node->Op(1), i, vecCns, simdBaseType); } + + cnsArgCnt = 1; } else { - if (HandleArgForHWIntrinsicCreate(op1, argCnt, vecCns, simdBaseType)) - { - cnsArgCnt += 1; - } - argCnt += 1; - - if (op2 != nullptr) - { - if (HandleArgForHWIntrinsicCreate(op2, argCnt, vecCns, simdBaseType)) - { - cnsArgCnt += 1; - } - argCnt += 1; - } - else if (cnsArgCnt == 1) + for (unsigned i = 1; i <= argCnt; i++) { - // These intrinsics are meant to set the same value to every element - // so we'll just specially handle it here and copy it into the remaining - // indices. - - for (unsigned i = 1; i < simdSize / genTypeSize(simdBaseType); i++) + if (HandleArgForHWIntrinsicCreate(node->Op(i), i - 1, vecCns, simdBaseType)) { - HandleArgForHWIntrinsicCreate(op1, i, vecCns, simdBaseType); + cnsArgCnt++; } } } @@ -1592,47 +1519,16 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) if (argCnt == cnsArgCnt) { - if (op1->OperIsList()) + for (GenTree* arg : node->Operands()) { - for (argList = op1->AsArgList(); argList != nullptr; argList = argList->Rest()) - { - GenTree* arg = argList->Current(); - #if !defined(TARGET_64BIT) - if (arg->OperIsLong()) - { - BlockRange().Remove(arg->AsOp()->gtOp1); - BlockRange().Remove(arg->AsOp()->gtOp2); - } -#endif // !TARGET_64BIT - - BlockRange().Remove(arg); - } - } - else - { -#if !defined(TARGET_64BIT) - if (op1->OperIsLong()) + if (arg->OperIsLong()) { - BlockRange().Remove(op1->AsOp()->gtOp1); - BlockRange().Remove(op1->AsOp()->gtOp2); + BlockRange().Remove(arg->AsOp()->gtGetOp1()); + BlockRange().Remove(arg->AsOp()->gtGetOp2()); } #endif // !TARGET_64BIT - - BlockRange().Remove(op1); - - if (op2 != nullptr) - { -#if defined(TARGET_64BIT) - if (op2->OperIsLong()) - { - BlockRange().Remove(op2->AsOp()->gtOp1); - BlockRange().Remove(op2->AsOp()->gtOp2); - } -#endif // !TARGET_64BIT - - BlockRange().Remove(op2); - } + BlockRange().Remove(arg); } assert((simdSize == 8) || (simdSize == 12) || (simdSize == 16) || (simdSize == 32)); @@ -1644,16 +1540,12 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) if (vecCns.i64[0] == 0) { - node->gtOp1 = nullptr; - node->gtOp2 = nullptr; - node->gtHWIntrinsicId = (simdSize == 16) ? NI_Vector128_get_Zero : NI_Vector256_get_Zero; + node->ResetHWIntrinsicId((simdSize == 16) ? NI_Vector128_get_Zero : NI_Vector256_get_Zero); return; } else if (vecCns.i64[0] == -1) { - node->gtOp1 = nullptr; - node->gtOp2 = nullptr; - node->gtHWIntrinsicId = (simdSize == 16) ? NI_Vector128_get_AllBitsSet : NI_Vector256_get_AllBitsSet; + node->ResetHWIntrinsicId((simdSize == 16) ? NI_Vector128_get_AllBitsSet : NI_Vector256_get_AllBitsSet); return; } } @@ -1669,7 +1561,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) BlockRange().InsertBefore(node, clsVarAddr); node->ChangeOper(GT_IND); - node->gtOp1 = clsVarAddr; + node->AsOp()->gtOp1 = clsVarAddr; // TODO-XARCH-CQ: We should be able to modify at least the paths that use Insert to trivially support partial // vector constants. With this, we can create a constant if say 50% of the inputs are also constant and just @@ -1702,10 +1594,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) BlockRange().InsertAfter(op1, tmp1); LowerNode(tmp1); - node->gtOp1 = tmp1; - node->gtOp2 = nullptr; - - node->gtHWIntrinsicId = NI_AVX2_BroadcastScalarToVector256; + node->ResetHWIntrinsicId(NI_AVX2_BroadcastScalarToVector256, tmp1); return; } @@ -1736,10 +1625,10 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) BlockRange().InsertAfter(op1, tmp1); LowerNode(tmp1); - node->gtOp1 = tmp1; - LIR::Use tmp1Use(BlockRange(), &node->gtOp1, node); + node->Op(1) = tmp1; + LIR::Use tmp1Use(BlockRange(), &node->Op(1), node); ReplaceWithLclVar(tmp1Use); - tmp1 = node->gtOp1; + tmp1 = node->Op(1); tmp2 = comp->gtClone(tmp1); BlockRange().InsertAfter(tmp1, tmp2); @@ -1752,10 +1641,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) idx = comp->gtNewIconNode(0x01, TYP_INT); BlockRange().InsertAfter(tmp3, idx); - node->gtOp1 = comp->gtNewArgList(tmp3, tmp1, idx); - node->gtOp2 = nullptr; - - node->gtHWIntrinsicId = NI_AVX_InsertVector128; + node->ResetHWIntrinsicId(NI_AVX_InsertVector128, comp, tmp3, tmp1, idx); return; } @@ -1783,10 +1669,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) // ... // return Avx2.BroadcastScalarToVector128(tmp1); - node->gtOp1 = tmp1; - node->gtOp2 = nullptr; - - node->gtHWIntrinsicId = NI_AVX2_BroadcastScalarToVector128; + node->ChangeHWIntrinsicId(NI_AVX2_BroadcastScalarToVector128, tmp1); return; } @@ -1814,10 +1697,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) BlockRange().InsertAfter(tmp1, tmp2); LowerNode(tmp2); - node->gtOp1 = tmp1; - node->gtOp2 = tmp2; - - node->gtHWIntrinsicId = NI_SSSE3_Shuffle; + node->ResetHWIntrinsicId(NI_SSSE3_Shuffle, tmp1, tmp2); break; } @@ -1840,10 +1720,10 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) // tmp1 = Sse2.UnpackLow(tmp1, tmp2); // ... - node->gtOp1 = tmp1; - LIR::Use tmp1Use(BlockRange(), &node->gtOp1, node); + node->Op(1) = tmp1; + LIR::Use tmp1Use(BlockRange(), &node->Op(1), node); ReplaceWithLclVar(tmp1Use); - tmp1 = node->gtOp1; + tmp1 = node->Op(1); tmp2 = comp->gtClone(tmp1); BlockRange().InsertAfter(tmp1, tmp2); @@ -1878,10 +1758,10 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) assert(comp->compIsaSupportedDebugOnly(InstructionSet_SSE2)); - node->gtOp1 = tmp1; - LIR::Use tmp1Use(BlockRange(), &node->gtOp1, node); + node->Op(1) = tmp1; + LIR::Use tmp1Use(BlockRange(), &node->Op(1), node); ReplaceWithLclVar(tmp1Use); - tmp1 = node->gtOp1; + tmp1 = node->Op(1); tmp2 = comp->gtClone(tmp1); BlockRange().InsertAfter(tmp1, tmp2); @@ -1913,12 +1793,8 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) idx = comp->gtNewIconNode(0x00, TYP_INT); BlockRange().InsertAfter(tmp1, idx); - node->gtOp1 = tmp1; - node->gtOp2 = idx; - - node->gtHWIntrinsicId = NI_SSE2_Shuffle; + node->ResetHWIntrinsicId(NI_SSE2_Shuffle, tmp1, idx); node->SetSimdBaseJitType(CORINFO_TYPE_UINT); - break; } @@ -1943,18 +1819,15 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) assert(comp->compIsaSupportedDebugOnly(InstructionSet_SSE2)); - node->gtOp1 = tmp1; - LIR::Use tmp1Use(BlockRange(), &node->gtOp1, node); + node->Op(1) = tmp1; + LIR::Use tmp1Use(BlockRange(), &node->Op(1), node); ReplaceWithLclVar(tmp1Use); - tmp1 = node->gtOp1; + tmp1 = node->Op(1); tmp2 = comp->gtClone(tmp1); BlockRange().InsertAfter(tmp1, tmp2); - node->gtOp1 = tmp1; - node->gtOp2 = tmp2; - - node->gtHWIntrinsicId = NI_SSE2_UnpackLow; + node->ResetHWIntrinsicId(NI_SSE2_UnpackLow, tmp1, tmp2); break; } #endif // TARGET_AMD64 @@ -1977,10 +1850,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) idx = comp->gtNewIconNode(0x00, TYP_INT); BlockRange().InsertAfter(tmp1, idx); - node->gtOp1 = tmp1; - node->gtOp2 = idx; - - node->gtHWIntrinsicId = NI_AVX_Permute; + node->ResetHWIntrinsicId(NI_AVX_Permute, tmp1, idx); break; } @@ -2003,10 +1873,10 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) assert(comp->compIsaSupportedDebugOnly(InstructionSet_SSE)); - node->gtOp1 = tmp1; - LIR::Use tmp1Use(BlockRange(), &node->gtOp1, node); + node->Op(1) = tmp1; + LIR::Use tmp1Use(BlockRange(), &node->Op(1), node); ReplaceWithLclVar(tmp1Use); - tmp1 = node->gtOp1; + tmp1 = node->Op(1); tmp2 = comp->gtClone(tmp1); BlockRange().InsertAfter(tmp1, tmp2); @@ -2014,10 +1884,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) idx = comp->gtNewIconNode(0x00, TYP_INT); BlockRange().InsertAfter(tmp2, idx); - node->gtOp1 = comp->gtNewArgList(tmp1, tmp2, idx); - node->gtOp2 = nullptr; - - node->gtHWIntrinsicId = NI_SSE_Shuffle; + node->ResetHWIntrinsicId(NI_SSE_Shuffle, comp, tmp1, tmp2, idx); break; } @@ -2034,10 +1901,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) // ... // return Sse3.MoveAndDuplicate(tmp1); - node->gtOp1 = tmp1; - node->gtOp2 = nullptr; - - node->gtHWIntrinsicId = NI_SSE3_MoveAndDuplicate; + node->ChangeHWIntrinsicId(NI_SSE3_MoveAndDuplicate, tmp1); break; } @@ -2058,20 +1922,16 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) // var tmp2 = tmp1; // return Sse.MoveLowToHigh(tmp1, tmp2); - node->gtOp1 = tmp1; - LIR::Use tmp1Use(BlockRange(), &node->gtOp1, node); + node->Op(1) = tmp1; + LIR::Use tmp1Use(BlockRange(), &node->Op(1), node); ReplaceWithLclVar(tmp1Use); - tmp1 = node->gtOp1; + tmp1 = node->Op(1); tmp2 = comp->gtClone(tmp1); BlockRange().InsertAfter(tmp1, tmp2); - node->gtOp1 = tmp1; - node->gtOp2 = tmp2; - - node->gtHWIntrinsicId = NI_SSE_MoveLowToHigh; + node->ResetHWIntrinsicId(NI_SSE_MoveLowToHigh, tmp1, tmp2); node->SetSimdBaseJitType(CORINFO_TYPE_FLOAT); - break; } @@ -2084,6 +1944,8 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) return; } + GenTree* op2 = node->Op(2); + // We have the following (where simd is simd16 or simd32): // /--* op1 T // +--* ... T @@ -2117,99 +1979,36 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) // lo = Vector128.Create(op1, op2); // hi = Vector128.Create(op3, op4); // -or- - // lo = Vector128.Create(op1, ..., op3); - // hi = Vector128.Create(op4, ..., op7); + // lo = Vector128.Create(op1, ..., op4); + // hi = Vector128.Create(op5, ..., op8); // -or- - // lo = Vector128.Create(op1, ..., op7); - // hi = Vector128.Create(op8, ..., op15); + // lo = Vector128.Create(op1, ..., op8); + // hi = Vector128.Create(op9, ..., op16); // -or- - // lo = Vector128.Create(op1, ..., op15); - // hi = Vector128.Create(op16, ..., op31); + // lo = Vector128.Create(op1, ..., op16); + // hi = Vector128.Create(op17, ..., op32); - unsigned halfArgCnt = argCnt / 2; + size_t halfArgCnt = argCnt / 2; assert((halfArgCnt * 2) == argCnt); - argList = op1->AsArgList(); - - for (unsigned i = 0; i < halfArgCnt; i++) - { - op2 = argList; - argList = argList->Rest(); - } - - op2->AsArgList()->gtOp2 = nullptr; - op2 = argList; - - // The above for loop splits the operand count into exactly half. - // Once it exits, op1 will point to op1 and op2 will point to the - // last operand that will be passed to the first Vector128.Create - // We will set its op2 to null, terminating the chain and then - // assign op2 to be argList, which is the first operand that will - // get passed to the second Vector128.Create - - GenTree* lo = nullptr; - GenTree* hi = nullptr; - - if (halfArgCnt == 2) - { - // The Vector256.Create calls that take 4 operands are special - // because the half argument count is 2, which means we can't - // actually use the GT_LIST anymore and need to pass them as - // explicit operands instead. - - argList = op1->AsArgList(); - - tmp1 = argList->Current(); - tmp2 = argList->Rest()->Current(); - - lo = comp->gtNewSimdHWIntrinsicNode(TYP_SIMD16, tmp1, tmp2, NI_Vector128_Create, simdBaseJitType, 16); - BlockRange().InsertAfter(tmp2, lo); - LowerNode(lo); - - argList = op2->AsArgList(); - - tmp1 = argList->Current(); - tmp2 = argList->Rest()->Current(); + GenTree* lo = comp->gtNewSimdHWIntrinsicNode(TYP_SIMD16, node->GetOperandArray(), halfArgCnt, + NI_Vector128_Create, simdBaseJitType, 16); + BlockRange().InsertAfter(node->Op(halfArgCnt), lo); + LowerNode(lo); - hi = comp->gtNewSimdHWIntrinsicNode(TYP_SIMD16, tmp1, tmp2, NI_Vector128_Create, simdBaseJitType, 16); - BlockRange().InsertAfter(tmp2, hi); - LowerNode(hi); - } - else - { - // The rest of the Vector256.Create calls take at least 8 operands - // and so the half count is at least 4 and we have to continue - // passing around GT_LIST nodes in op1 with a null op2 - assert(halfArgCnt >= 4); - - tmp1 = op2->AsArgList()->Current(); - - lo = comp->gtNewSimdHWIntrinsicNode(TYP_SIMD16, op1, NI_Vector128_Create, simdBaseJitType, 16); - BlockRange().InsertBefore(tmp1, lo); - LowerNode(lo); - - hi = comp->gtNewSimdHWIntrinsicNode(TYP_SIMD16, op2, NI_Vector128_Create, simdBaseJitType, 16); - BlockRange().InsertBefore(node, hi); - LowerNode(hi); - } + GenTree* hi = comp->gtNewSimdHWIntrinsicNode(TYP_SIMD16, node->GetOperandArray(halfArgCnt), halfArgCnt, + NI_Vector128_Create, simdBaseJitType, 16); + BlockRange().InsertAfter(node->Op(argCnt), hi); + LowerNode(hi); idx = comp->gtNewIconNode(0x01, TYP_INT); BlockRange().InsertAfter(hi, idx); - node->gtOp1 = comp->gtNewArgList(lo, hi, idx); - node->gtOp2 = nullptr; - - node->gtHWIntrinsicId = NI_AVX_InsertVector128; + assert(argCnt >= 3); + node->ResetHWIntrinsicId(NI_AVX_InsertVector128, comp, lo, hi, idx); return; } - if (op1->OperIsList()) - { - argList = op1->AsArgList(); - op1 = argList->Current(); - argList = argList->Rest(); - } - // We will be constructing the following parts: // /--* op1 T // tmp1 = * HWINTRINSIC simd16 T CreateScalarUnsafe @@ -2264,7 +2063,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) // tmp1 = Sse?.Insert(tmp1, opN, N); // ... - opN = argList->Current(); + opN = node->Op(N + 1); idx = comp->gtNewIconNode(N, TYP_INT); BlockRange().InsertAfter(opN, idx); @@ -2273,8 +2072,6 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) simdSize); BlockRange().InsertAfter(idx, tmp1); LowerNode(tmp1); - - argList = argList->Rest(); } assert(N == (argCnt - 1)); @@ -2291,15 +2088,12 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) // tmp1 = Sse?.Insert(tmp1, opN, N); // ... - opN = argList->Current(); + opN = node->Op(argCnt); idx = comp->gtNewIconNode(N, TYP_INT); BlockRange().InsertAfter(opN, idx); - node->gtOp1 = comp->gtNewArgList(tmp1, opN, idx); - node->gtOp2 = nullptr; - - node->gtHWIntrinsicId = insIntrinsic; + node->ResetHWIntrinsicId(insIntrinsic, comp, tmp1, opN, idx); break; } @@ -2311,16 +2105,13 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) for (N = 1; N < argCnt; N++) { - opN = argList->Current(); + opN = node->Op(N + 1); op[N] = comp->gtNewSimdHWIntrinsicNode(TYP_SIMD16, opN, NI_Vector128_CreateScalarUnsafe, simdBaseJitType, 16); BlockRange().InsertAfter(opN, op[N]); LowerNode(op[N]); - - argList = argList->Rest(); } - assert(argList == nullptr); if ((simdBaseType == TYP_BYTE) || (simdBaseType == TYP_UBYTE)) { @@ -2417,10 +2208,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) BlockRange().InsertAfter(op[3], tmp2); LowerNode(tmp2); - node->gtOp1 = tmp1; - node->gtOp2 = tmp2; - - node->gtHWIntrinsicId = NI_SSE2_UnpackLow; + node->ResetHWIntrinsicId(NI_SSE2_UnpackLow, tmp1, tmp2); node->SetSimdBaseJitType(CORINFO_TYPE_ULONG); break; } @@ -2446,10 +2234,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) idx = comp->gtNewIconNode(0x01, TYP_INT); BlockRange().InsertBefore(node, idx); - node->gtOp1 = comp->gtNewArgList(tmp1, op2, idx); - node->gtOp2 = nullptr; - - node->gtHWIntrinsicId = NI_SSE41_X64_Insert; + node->ResetHWIntrinsicId(NI_SSE41_X64_Insert, comp, tmp1, op2, idx); break; } @@ -2473,10 +2258,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) BlockRange().InsertAfter(op2, tmp2); LowerNode(tmp2); - node->gtOp1 = tmp1; - node->gtOp2 = tmp2; - - node->gtHWIntrinsicId = NI_SSE2_UnpackLow; + node->ResetHWIntrinsicId(NI_SSE2_UnpackLow, tmp1, tmp2); break; } #endif // TARGET_AMD64 @@ -2508,7 +2290,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) // tmp1 = Sse41.Insert(tmp1, tmp2, N << 4); // ... - opN = argList->Current(); + opN = node->Op(N + 1); tmp2 = comp->gtNewSimdHWIntrinsicNode(TYP_SIMD16, opN, NI_Vector128_CreateScalarUnsafe, simdBaseJitType, 16); @@ -2522,8 +2304,6 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) simdSize); BlockRange().InsertAfter(idx, tmp1); LowerNode(tmp1); - - argList = argList->Rest(); } // We will be constructing the following parts: @@ -2542,7 +2322,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) // tmp2 = Vector128.CreateScalarUnsafe(opN); // return Sse41.Insert(tmp1, tmp2, N << 4); - opN = argList->Current(); + opN = node->Op(argCnt); tmp2 = comp->gtNewSimdHWIntrinsicNode(TYP_SIMD16, opN, NI_Vector128_CreateScalarUnsafe, simdBaseJitType, 16); @@ -2552,10 +2332,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) idx = comp->gtNewIconNode((argCnt - 1) << 4, TYP_INT); BlockRange().InsertAfter(tmp2, idx); - node->gtOp1 = comp->gtNewArgList(tmp1, tmp2, idx); - node->gtOp2 = nullptr; - - node->gtHWIntrinsicId = NI_SSE41_Insert; + node->ResetHWIntrinsicId(NI_SSE41_Insert, comp, tmp1, tmp2, idx); break; } @@ -2592,16 +2369,13 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) for (N = 1; N < argCnt; N++) { - opN = argList->Current(); + opN = node->Op(N + 1); op[N] = comp->gtNewSimdHWIntrinsicNode(TYP_SIMD16, opN, NI_Vector128_CreateScalarUnsafe, simdBaseJitType, 16); BlockRange().InsertAfter(opN, op[N]); LowerNode(op[N]); - - argList = argList->Rest(); } - assert(argList == nullptr); tmp1 = comp->gtNewSimdHWIntrinsicNode(simdType, op[0], op[1], NI_SSE_UnpackLow, simdBaseJitType, simdSize); BlockRange().InsertAfter(op[1], tmp1); @@ -2611,10 +2385,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) BlockRange().InsertAfter(op[3], tmp2); LowerNode(tmp2); - node->gtOp1 = tmp1; - node->gtOp2 = tmp2; - - node->gtHWIntrinsicId = NI_SSE_MoveLowToHigh; + node->ResetHWIntrinsicId(NI_SSE_MoveLowToHigh, tmp1, tmp2); break; } @@ -2640,12 +2411,8 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) BlockRange().InsertAfter(op2, tmp2); LowerNode(tmp2); - node->gtOp1 = tmp1; - node->gtOp2 = tmp2; - - node->gtHWIntrinsicId = NI_SSE_MoveLowToHigh; + node->ResetHWIntrinsicId(NI_SSE_MoveLowToHigh, tmp1, tmp2); node->SetSimdBaseJitType(CORINFO_TYPE_FLOAT); - break; } @@ -2664,7 +2431,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) // void Lowering::LowerHWIntrinsicGetElement(GenTreeHWIntrinsic* node) { - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); var_types simdType = node->gtType; CorInfoType simdBaseJitType = node->GetSimdBaseJitType(); var_types simdBaseType = node->GetSimdBaseType(); @@ -2674,11 +2441,8 @@ void Lowering::LowerHWIntrinsicGetElement(GenTreeHWIntrinsic* node) assert(varTypeIsArithmetic(simdBaseType)); assert(simdSize != 0); - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); - - assert(op1 != nullptr); - assert(op2 != nullptr); + GenTree* op1 = node->Op(1); + GenTree* op2 = node->Op(2); if (op1->OperIs(GT_IND)) { @@ -2828,7 +2592,7 @@ void Lowering::LowerHWIntrinsicGetElement(GenTreeHWIntrinsic* node) unreached(); } - op2 = nullptr; + node->ResetHWIntrinsicId(resIntrinsic, op1); } else { @@ -2871,18 +2635,15 @@ void Lowering::LowerHWIntrinsicGetElement(GenTreeHWIntrinsic* node) default: unreached(); } - } - assert(resIntrinsic != NI_Illegal); + node->ResetHWIntrinsicId(resIntrinsic, op1, op2); + } - node->gtHWIntrinsicId = resIntrinsic; - node->gtOp1 = op1; - node->gtOp2 = op2; node->SetSimdSize(16); if (!varTypeIsFloating(simdBaseType)) { - assert(node->gtHWIntrinsicId != intrinsicId); + assert(node->GetHWIntrinsicId() != intrinsicId); LowerNode(node); } @@ -2913,8 +2674,8 @@ void Lowering::LowerHWIntrinsicGetElement(GenTreeHWIntrinsic* node) // void Lowering::LowerHWIntrinsicWithElement(GenTreeHWIntrinsic* node) { - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; - var_types simdType = node->gtType; + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); + var_types simdType = node->TypeGet(); CorInfoType simdBaseJitType = node->GetSimdBaseJitType(); var_types simdBaseType = node->GetSimdBaseType(); unsigned simdSize = node->GetSimdSize(); @@ -2923,30 +2684,11 @@ void Lowering::LowerHWIntrinsicWithElement(GenTreeHWIntrinsic* node) assert(varTypeIsArithmetic(simdBaseType)); assert(simdSize != 0); - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = nullptr; - GenTree* op3 = nullptr; - - assert(op1->OperIsList()); - assert(node->gtGetOp2() == nullptr); - - GenTreeArgList* argList = op1->AsArgList(); - - op1 = argList->Current(); - argList = argList->Rest(); - - op2 = argList->Current(); - argList = argList->Rest(); - - op3 = argList->Current(); - argList = argList->Rest(); - - assert(op1 != nullptr); - assert(op2 != nullptr); - assert(op3 != nullptr); + GenTree* op1 = node->Op(1); + GenTree* op2 = node->Op(2); + GenTree* op3 = node->Op(3); assert(op2->OperIsConst()); - assert(argList == nullptr); ssize_t imm8 = op2->AsIntCon()->IconValue(); ssize_t cachedImm8 = imm8; @@ -2985,29 +2727,36 @@ void Lowering::LowerHWIntrinsicWithElement(GenTreeHWIntrinsic* node) // Spare GenTrees to be used for the lowering logic below // Defined upfront to avoid naming conflicts, etc... - GenTree* idx = nullptr; - GenTree* tmp1 = nullptr; - GenTree* tmp2 = nullptr; - GenTree* tmp3 = nullptr; - GenTree* tmpv = nullptr; - + GenTree* idx = nullptr; + GenTree* tmp1 = nullptr; + GenTree* tmp2 = nullptr; + GenTreeHWIntrinsic* result = node; + + // If we have a simd32 WithElement, we will spill the original + // simd32 source into a local, extract the lower/upper half from + // it and then operate on that. At the end, we will insert the simd16 + // result back into the simd32 local, producing our final value. if (intrinsicId == NI_Vector256_WithElement) { assert(comp->compIsaSupportedDebugOnly(InstructionSet_AVX)); + // This copy of "node" will have the simd16 value we need. + result = comp->gtNewSimdHWIntrinsicNode(TYP_SIMD16, op1, op2, op3, intrinsicId, simdBaseJitType, 16); + BlockRange().InsertBefore(node, result); + // We will be constructing the following parts: // ... // /--* op1 simd32 // * STORE_LCL_VAR simd32 - // tmpv = LCL_VAR simd32 - // op1 = LCL_VAR simd32 + // tmp32 = LCL_VAR simd32 + // op1 = LCL_VAR simd32 - node->gtOp1 = op1; - LIR::Use op1Use(BlockRange(), &node->gtOp1, node); + // TODO-CQ: move the tmp32 node closer to the final InsertVector128. + LIR::Use op1Use(BlockRange(), &node->Op(1), node); ReplaceWithLclVar(op1Use); - tmpv = node->gtOp1; + GenTree* tmp32 = node->Op(1); - op1 = comp->gtClone(tmpv); + op1 = comp->gtClone(tmp32); BlockRange().InsertBefore(op3, op1); if (imm8 >= count / 2) @@ -3050,9 +2799,12 @@ void Lowering::LowerHWIntrinsicWithElement(GenTreeHWIntrinsic* node) } op1 = tmp1; - } - NamedIntrinsic resIntrinsic = NI_Illegal; + // Now we will insert our "result" into our simd32 temporary. + idx = comp->gtNewIconNode((cachedImm8 >= count / 2) ? 1 : 0); + BlockRange().InsertBefore(node, idx); + node->ChangeHWIntrinsicId(NI_AVX_InsertVector128, tmp32, result, idx); + } switch (simdBaseType) { @@ -3060,11 +2812,8 @@ void Lowering::LowerHWIntrinsicWithElement(GenTreeHWIntrinsic* node) case TYP_ULONG: { idx = comp->gtNewIconNode(imm8); - BlockRange().InsertBefore(node, idx); - - op1 = comp->gtNewArgList(op1, op3, idx); - op2 = nullptr; - resIntrinsic = NI_SSE41_X64_Insert; + BlockRange().InsertBefore(result, idx); + result->ChangeHWIntrinsicId(NI_SSE41_X64_Insert, op1, op3, idx); break; } @@ -3081,7 +2830,7 @@ void Lowering::LowerHWIntrinsicWithElement(GenTreeHWIntrinsic* node) tmp1 = comp->gtNewSimdHWIntrinsicNode(TYP_SIMD16, op3, NI_Vector128_CreateScalarUnsafe, CORINFO_TYPE_FLOAT, 16); - BlockRange().InsertBefore(node, tmp1); + BlockRange().InsertBefore(result, tmp1); LowerNode(tmp1); if (!comp->compOpportunisticallyDependsOn(InstructionSet_SSE41)) @@ -3098,8 +2847,7 @@ void Lowering::LowerHWIntrinsicWithElement(GenTreeHWIntrinsic* node) // ... // node = Sse.MoveScalar(op1, op2); - op2 = tmp1; - resIntrinsic = NI_SSE_MoveScalar; + result->ResetHWIntrinsicId(NI_SSE_MoveScalar, op1, tmp1); } else { @@ -3125,10 +2873,10 @@ void Lowering::LowerHWIntrinsicWithElement(GenTreeHWIntrinsic* node) // tmp2 = Sse.Shuffle(tmp1, op1, 0 or 48 or 32); // node = Sse.Shuffle(tmp2, op1, 226 or 132 or 36); - node->gtOp1 = op1; - LIR::Use op1Use(BlockRange(), &node->gtOp1, node); + result->Op(1) = op1; + LIR::Use op1Use(BlockRange(), &result->Op(1), result); ReplaceWithLclVar(op1Use); - op2 = node->gtOp1; + op2 = result->Op(1); tmp2 = comp->gtClone(op2); BlockRange().InsertAfter(tmp1, tmp2); @@ -3194,9 +2942,7 @@ void Lowering::LowerHWIntrinsicWithElement(GenTreeHWIntrinsic* node) std::swap(op1, op2); } - op1 = comp->gtNewArgList(op1, op2, idx); - op2 = nullptr; - resIntrinsic = NI_SSE_Shuffle; + result->ChangeHWIntrinsicId(NI_SSE_Shuffle, op1, op2, idx); } break; } @@ -3214,11 +2960,8 @@ void Lowering::LowerHWIntrinsicWithElement(GenTreeHWIntrinsic* node) case TYP_UINT: { idx = comp->gtNewIconNode(imm8); - BlockRange().InsertBefore(node, idx); - - op1 = comp->gtNewArgList(op1, op3, idx); - op2 = nullptr; - resIntrinsic = NI_SSE41_Insert; + BlockRange().InsertBefore(result, idx); + result->ChangeHWIntrinsicId(NI_SSE41_Insert, op1, op3, idx); break; } @@ -3226,11 +2969,8 @@ void Lowering::LowerHWIntrinsicWithElement(GenTreeHWIntrinsic* node) case TYP_USHORT: { idx = comp->gtNewIconNode(imm8); - BlockRange().InsertBefore(node, idx); - - op1 = comp->gtNewArgList(op1, op3, idx); - op2 = nullptr; - resIntrinsic = NI_SSE2_Insert; + BlockRange().InsertBefore(result, idx); + result->ChangeHWIntrinsicId(NI_SSE2_Insert, op1, op3, idx); break; } @@ -3247,11 +2987,10 @@ void Lowering::LowerHWIntrinsicWithElement(GenTreeHWIntrinsic* node) tmp1 = comp->gtNewSimdHWIntrinsicNode(TYP_SIMD16, op3, NI_Vector128_CreateScalarUnsafe, CORINFO_TYPE_DOUBLE, 16); - BlockRange().InsertBefore(node, tmp1); + BlockRange().InsertBefore(result, tmp1); LowerNode(tmp1); - op2 = tmp1; - resIntrinsic = (imm8 == 0) ? NI_SSE2_MoveScalar : NI_SSE2_UnpackLow; + result->ResetHWIntrinsicId((imm8 == 0) ? NI_SSE2_MoveScalar : NI_SSE2_UnpackLow, op1, tmp1); break; } @@ -3259,28 +2998,16 @@ void Lowering::LowerHWIntrinsicWithElement(GenTreeHWIntrinsic* node) unreached(); } - assert(resIntrinsic != NI_Illegal); + assert(result->GetHWIntrinsicId() != intrinsicId); - if (tmpv != nullptr) + LowerNode(result); + if (intrinsicId == NI_Vector256_WithElement) { - tmp1 = comp->gtNewSimdHWIntrinsicNode(TYP_SIMD16, op1, op2, resIntrinsic, simdBaseJitType, 16); - BlockRange().InsertBefore(node, tmp1); - LowerNode(tmp1); - - idx = comp->gtNewIconNode((cachedImm8 >= count / 2) ? 1 : 0); - BlockRange().InsertAfter(tmp1, idx); - - op1 = comp->gtNewArgList(tmpv, tmp1, idx); - op2 = nullptr; - resIntrinsic = NI_AVX_InsertVector128; + // Now that we have finalized the shape of the tree, lower the insertion node as well. + assert(node->GetHWIntrinsicId() == NI_AVX_InsertVector128); + assert(node != result); + LowerNode(node); } - - node->gtHWIntrinsicId = resIntrinsic; - node->gtOp1 = op1; - node->gtOp2 = op2; - - assert(node->gtHWIntrinsicId != intrinsicId); - LowerNode(node); } //---------------------------------------------------------------------------------------------- @@ -3291,7 +3018,7 @@ void Lowering::LowerHWIntrinsicWithElement(GenTreeHWIntrinsic* node) // void Lowering::LowerHWIntrinsicDot(GenTreeHWIntrinsic* node) { - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); CorInfoType simdBaseJitType = node->GetSimdBaseJitType(); var_types simdBaseType = node->GetSimdBaseType(); unsigned simdSize = node->GetSimdSize(); @@ -3303,12 +3030,8 @@ void Lowering::LowerHWIntrinsicDot(GenTreeHWIntrinsic* node) assert(varTypeIsArithmetic(simdBaseType)); assert(simdSize != 0); - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); - - assert(op1 != nullptr); - assert(op2 != nullptr); - assert(!op1->OperIsList()); + GenTree* op1 = node->Op(1); + GenTree* op2 = node->Op(2); // Spare GenTrees to be used for the lowering logic below // Defined upfront to avoid naming conflicts, etc... @@ -3375,10 +3098,10 @@ void Lowering::LowerHWIntrinsicDot(GenTreeHWIntrinsic* node) BlockRange().InsertAfter(idx, tmp1); LowerNode(tmp1); - node->gtOp1 = tmp1; - LIR::Use tmp1Use(BlockRange(), &node->gtOp1, node); + node->Op(1) = tmp1; + LIR::Use tmp1Use(BlockRange(), &node->Op(1), node); ReplaceWithLclVar(tmp1Use); - tmp1 = node->gtOp1; + tmp1 = node->Op(1); tmp2 = comp->gtClone(tmp1); BlockRange().InsertAfter(tmp1, tmp2); @@ -3397,12 +3120,8 @@ void Lowering::LowerHWIntrinsicDot(GenTreeHWIntrinsic* node) node->SetSimdSize(16); - node->gtOp1 = tmp3; - node->gtOp2 = nullptr; - - node->gtHWIntrinsicId = NI_Vector128_ToScalar; + node->ResetHWIntrinsicId(NI_Vector128_ToScalar, tmp3); LowerNode(node); - return; } @@ -3488,12 +3207,8 @@ void Lowering::LowerHWIntrinsicDot(GenTreeHWIntrinsic* node) BlockRange().InsertAfter(idx, tmp3); LowerNode(tmp3); - node->gtOp1 = tmp3; - node->gtOp2 = nullptr; - - node->gtHWIntrinsicId = NI_Vector128_ToScalar; + node->ResetHWIntrinsicId(NI_Vector128_ToScalar, tmp3); LowerNode(node); - return; } @@ -3533,12 +3248,8 @@ void Lowering::LowerHWIntrinsicDot(GenTreeHWIntrinsic* node) BlockRange().InsertAfter(idx, tmp3); LowerNode(tmp3); - node->gtOp1 = tmp3; - node->gtOp2 = nullptr; - - node->gtHWIntrinsicId = NI_Vector128_ToScalar; + node->ResetHWIntrinsicId(NI_Vector128_ToScalar, tmp3); LowerNode(node); - return; } @@ -3646,10 +3357,10 @@ void Lowering::LowerHWIntrinsicDot(GenTreeHWIntrinsic* node) // tmp2 = tmp1; // ... - node->gtOp1 = tmp1; - LIR::Use tmp1Use(BlockRange(), &node->gtOp1, node); + node->Op(1) = tmp1; + LIR::Use tmp1Use(BlockRange(), &node->Op(1), node); ReplaceWithLclVar(tmp1Use); - tmp1 = node->gtOp1; + tmp1 = node->Op(1); tmp2 = comp->gtClone(tmp1); BlockRange().InsertAfter(tmp1, tmp2); @@ -3748,10 +3459,10 @@ void Lowering::LowerHWIntrinsicDot(GenTreeHWIntrinsic* node) // tmp2 = Isa.Shuffle(tmp2, tmp3, shuffleConst); // ... - node->gtOp1 = tmp2; - LIR::Use tmp2Use(BlockRange(), &node->gtOp1, node); + node->Op(1) = tmp2; + LIR::Use tmp2Use(BlockRange(), &node->Op(1), node); ReplaceWithLclVar(tmp2Use); - tmp2 = node->gtOp1; + tmp2 = node->Op(1); tmp3 = comp->gtClone(tmp2); BlockRange().InsertAfter(tmp2, tmp3); @@ -3860,10 +3571,10 @@ void Lowering::LowerHWIntrinsicDot(GenTreeHWIntrinsic* node) // var tmp1 = Isa.Add(tmp1, tmp2); // ... - node->gtOp1 = tmp1; - LIR::Use tmp1Use(BlockRange(), &node->gtOp1, node); + node->Op(1) = tmp1; + LIR::Use tmp1Use(BlockRange(), &node->Op(1), node); ReplaceWithLclVar(tmp1Use); - tmp1 = node->gtOp1; + tmp1 = node->Op(1); tmp2 = comp->gtClone(tmp1); BlockRange().InsertAfter(tmp1, tmp2); @@ -3892,13 +3603,8 @@ void Lowering::LowerHWIntrinsicDot(GenTreeHWIntrinsic* node) // ... // return tmp1.ToScalar(); - node->gtOp1 = tmp1; - node->gtOp2 = nullptr; - - node->gtHWIntrinsicId = NI_Vector128_ToScalar; + node->ResetHWIntrinsicId(NI_Vector128_ToScalar, tmp1); LowerNode(node); - - return; } //---------------------------------------------------------------------------------------------- @@ -3909,7 +3615,7 @@ void Lowering::LowerHWIntrinsicDot(GenTreeHWIntrinsic* node) // void Lowering::LowerHWIntrinsicToScalar(GenTreeHWIntrinsic* node) { - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); CorInfoType simdBaseJitType = node->GetSimdBaseJitType(); var_types simdBaseType = node->GetSimdBaseType(); unsigned simdSize = node->GetSimdSize(); @@ -3928,7 +3634,7 @@ void Lowering::LowerHWIntrinsicToScalar(GenTreeHWIntrinsic* node) { node->gtType = TYP_INT; node->SetSimdBaseJitType(CORINFO_TYPE_INT); - node->gtHWIntrinsicId = NI_SSE2_ConvertToInt32; + node->ChangeHWIntrinsicId(NI_SSE2_ConvertToInt32); break; } @@ -3938,20 +3644,20 @@ void Lowering::LowerHWIntrinsicToScalar(GenTreeHWIntrinsic* node) { node->gtType = TYP_UINT; node->SetSimdBaseJitType(CORINFO_TYPE_UINT); - node->gtHWIntrinsicId = NI_SSE2_ConvertToUInt32; + node->ChangeHWIntrinsicId(NI_SSE2_ConvertToUInt32); break; } #if defined(TARGET_AMD64) case TYP_LONG: { - node->gtHWIntrinsicId = NI_SSE2_X64_ConvertToInt64; + node->ChangeHWIntrinsicId(NI_SSE2_X64_ConvertToInt64); break; } case TYP_ULONG: { - node->gtHWIntrinsicId = NI_SSE2_X64_ConvertToUInt64; + node->ChangeHWIntrinsicId(NI_SSE2_X64_ConvertToUInt64); break; } #endif // TARGET_AMD64 @@ -3983,6 +3689,7 @@ void Lowering::LowerHWIntrinsicToScalar(GenTreeHWIntrinsic* node) { use.ReplaceWith(cast); } + LowerNode(cast); } } @@ -4430,8 +4137,8 @@ GenTree* Lowering::PreferredRegOptionalOperand(GenTree* tree) // mark op1 as reg optional for the same reason as mentioned in (d) above. if (op1->OperGet() == GT_LCL_VAR && op2->OperGet() == GT_LCL_VAR) { - LclVarDsc* v1 = comp->lvaTable + op1->AsLclVarCommon()->GetLclNum(); - LclVarDsc* v2 = comp->lvaTable + op2->AsLclVarCommon()->GetLclNum(); + LclVarDsc* v1 = comp->lvaGetDesc(op1->AsLclVarCommon()); + LclVarDsc* v2 = comp->lvaGetDesc(op2->AsLclVarCommon()); bool v1IsRegCandidate = !v1->lvDoNotEnregister; bool v2IsRegCandidate = !v2->lvDoNotEnregister; @@ -5395,11 +5102,11 @@ void Lowering::ContainCheckIntrinsic(GenTreeOp* node) // void Lowering::ContainCheckSIMD(GenTreeSIMD* simdNode) { - switch (simdNode->gtSIMDIntrinsicID) + switch (simdNode->GetSIMDIntrinsicId()) { case SIMDIntrinsicInit: { - GenTree* op1 = simdNode->AsOp()->gtOp1; + GenTree* op1 = simdNode->Op(1); #ifndef TARGET_64BIT if (op1->OperGet() == GT_LONG) { @@ -5435,13 +5142,13 @@ void Lowering::ContainCheckSIMD(GenTreeSIMD* simdNode) case SIMDIntrinsicInitArray: // We have an array and an index, which may be contained. - CheckImmedAndMakeContained(simdNode, simdNode->gtGetOp2()); + CheckImmedAndMakeContained(simdNode, simdNode->Op(2)); break; case SIMDIntrinsicShuffleSSE2: // Second operand is an integer constant and marked as contained. - assert(simdNode->AsOp()->gtOp2->IsCnsIntOrI()); - MakeSrcContained(simdNode, simdNode->AsOp()->gtOp2); + assert(simdNode->Op(2)->IsCnsIntOrI()); + MakeSrcContained(simdNode, simdNode->Op(2)); break; default: @@ -5465,7 +5172,7 @@ void Lowering::ContainCheckSIMD(GenTreeSIMD* simdNode) // bool Lowering::IsContainableHWIntrinsicOp(GenTreeHWIntrinsic* containingNode, GenTree* node, bool* supportsRegOptional) { - NamedIntrinsic containingIntrinsicId = containingNode->gtHWIntrinsicId; + NamedIntrinsic containingIntrinsicId = containingNode->GetHWIntrinsicId(); HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(containingIntrinsicId); // We shouldn't have called in here if containingNode doesn't support containment @@ -5632,25 +5339,12 @@ bool Lowering::IsContainableHWIntrinsicOp(GenTreeHWIntrinsic* containingNode, Ge assert(supportsGeneralLoads == false); assert(supportsSIMDScalarLoads == false); - GenTree* op1 = containingNode->gtGetOp1(); - GenTree* op2 = nullptr; - GenTree* op3 = nullptr; - - assert(op1->OperIsList()); - assert(containingNode->gtGetOp2() == nullptr); - - GenTreeArgList* argList = op1->AsArgList(); - - op1 = argList->Current(); - argList = argList->Rest(); - - op2 = argList->Current(); - argList = argList->Rest(); + GenTree* op1 = containingNode->Op(1); + GenTree* op2 = containingNode->Op(2); + GenTree* op3 = containingNode->Op(3); assert(node == op2); - op3 = argList->Current(); - // The upper two bits of the immediate value are ignored if // op2 comes from memory. In order to support using the upper // bits, we need to disable containment support if op3 is not @@ -5825,7 +5519,7 @@ bool Lowering::IsContainableHWIntrinsicOp(GenTreeHWIntrinsic* containingNode, Ge // TODO-XArch: Update this to be table driven, if possible. - NamedIntrinsic intrinsicId = node->AsHWIntrinsic()->gtHWIntrinsicId; + NamedIntrinsic intrinsicId = node->AsHWIntrinsic()->GetHWIntrinsicId(); switch (intrinsicId) { @@ -5891,23 +5585,18 @@ void Lowering::ContainCheckHWIntrinsicAddr(GenTreeHWIntrinsic* node, GenTree* ad // void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) { - NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; + NamedIntrinsic intrinsicId = node->GetHWIntrinsicId(); HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(intrinsicId); - int numArgs = HWIntrinsicInfo::lookupNumArgs(node); + size_t numArgs = node->GetOperandCount(); CorInfoType simdBaseJitType = node->GetSimdBaseJitType(); var_types simdBaseType = node->GetSimdBaseType(); - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); - GenTree* op3 = nullptr; - if (!HWIntrinsicInfo::SupportsContainment(intrinsicId)) { // AVX2 gather are not containable and always have constant IMM argument if (HWIntrinsicInfo::isAVX2GatherIntrinsic(intrinsicId)) { - GenTree* lastOp = HWIntrinsicInfo::lookupLastOp(node); - assert(lastOp != nullptr); + GenTree* lastOp = node->Op(numArgs); MakeSrcContained(node, lastOp); } // Exit early if containment isn't supported @@ -5916,8 +5605,7 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) if (HWIntrinsicInfo::lookupCategory(intrinsicId) == HW_Category_IMM) { - GenTree* lastOp = HWIntrinsicInfo::lookupLastOp(node); - assert(lastOp != nullptr); + GenTree* lastOp = node->Op(numArgs); if (HWIntrinsicInfo::isImmOp(intrinsicId, lastOp) && lastOp->IsCnsIntOrI()) { @@ -5940,18 +5628,21 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) const bool isCommutative = HWIntrinsicInfo::IsCommutative(intrinsicId); + GenTree* op1 = nullptr; + GenTree* op2 = nullptr; + GenTree* op3 = nullptr; + if (numArgs == 1) { // One argument intrinsics cannot be commutative assert(!isCommutative); - assert(!op1->OperIsList()); - assert(op2 == nullptr); + op1 = node->Op(1); switch (category) { case HW_Category_MemoryLoad: - ContainCheckHWIntrinsicAddr(node, node->gtGetOp1()); + ContainCheckHWIntrinsicAddr(node, op1); break; case HW_Category_SimpleSIMD: @@ -6004,9 +5695,9 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) case NI_AVX2_ConvertToVector256Int16: case NI_AVX2_ConvertToVector256Int32: case NI_AVX2_ConvertToVector256Int64: - if (!varTypeIsSIMD(op1->gtType)) + if (!varTypeIsSIMD(op1)) { - ContainCheckHWIntrinsicAddr(node, node->gtGetOp1()); + ContainCheckHWIntrinsicAddr(node, op1); return; } break; @@ -6041,29 +5732,28 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) { if (numArgs == 2) { - assert(!op1->OperIsList()); - assert(op2 != nullptr); - assert(!op2->OperIsList()); + op1 = node->Op(1); + op2 = node->Op(2); switch (category) { case HW_Category_MemoryLoad: if ((intrinsicId == NI_AVX_MaskLoad) || (intrinsicId == NI_AVX2_MaskLoad)) { - ContainCheckHWIntrinsicAddr(node, node->gtGetOp1()); + ContainCheckHWIntrinsicAddr(node, op1); } else { - ContainCheckHWIntrinsicAddr(node, node->gtGetOp2()); + ContainCheckHWIntrinsicAddr(node, op2); } break; case HW_Category_MemoryStore: - ContainCheckHWIntrinsicAddr(node, node->gtGetOp1()); + ContainCheckHWIntrinsicAddr(node, op1); if (((intrinsicId == NI_SSE_Store) || (intrinsicId == NI_SSE2_Store)) && op2->OperIsHWIntrinsic() && - ((op2->AsHWIntrinsic()->gtHWIntrinsicId == NI_AVX_ExtractVector128) || - (op2->AsHWIntrinsic()->gtHWIntrinsicId == NI_AVX2_ExtractVector128)) && + ((op2->AsHWIntrinsic()->GetHWIntrinsicId() == NI_AVX_ExtractVector128) || + (op2->AsHWIntrinsic()->GetHWIntrinsicId() == NI_AVX2_ExtractVector128)) && op2->gtGetOp2()->IsIntegralConst()) { MakeSrcContained(node, op2); @@ -6087,8 +5777,8 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) MakeSrcContained(node, op1); // Swap the operands here to make the containment checks in codegen significantly simpler - node->gtOp1 = op2; - node->gtOp2 = op1; + node->Op(1) = op2; + node->Op(2) = op1; } else if (supportsRegOptional) { @@ -6219,15 +5909,13 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) // These intrinsics should have been marked contained by the general-purpose handling // earlier in the method. - GenTree* lastOp = HWIntrinsicInfo::lookupLastOp(node); - assert(lastOp != nullptr); + GenTree* lastOp = node->Op(numArgs); if (HWIntrinsicInfo::isImmOp(intrinsicId, lastOp) && lastOp->IsCnsIntOrI()) { assert(lastOp->isContained()); } #endif - break; } @@ -6296,25 +5984,14 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) // three argument intrinsics should not be marked commutative assert(!isCommutative); - assert(op1->OperIsList()); - assert(op2 == nullptr); - - GenTreeArgList* argList = op1->AsArgList(); - GenTreeArgList* originalArgList = argList; - - op1 = argList->Current(); - argList = argList->Rest(); - - op2 = argList->Current(); - argList = argList->Rest(); - - op3 = argList->Current(); - assert(argList->Rest() == nullptr); + op1 = node->Op(1); + op2 = node->Op(2); + op3 = node->Op(3); switch (category) { case HW_Category_MemoryStore: - ContainCheckHWIntrinsicAddr(node, node->gtGetOp1()->AsOp()->gtGetOp1()); + ContainCheckHWIntrinsicAddr(node, op1); break; case HW_Category_SimpleSIMD: @@ -6323,40 +6000,53 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) { if ((intrinsicId >= NI_FMA_MultiplyAdd) && (intrinsicId <= NI_FMA_MultiplySubtractNegatedScalar)) { - bool supportsRegOptional = false; + bool supportsOp1RegOptional = false; + bool supportsOp2RegOptional = false; + bool supportsOp3RegOptional = false; + unsigned resultOpNum = 0; + LIR::Use use; + GenTree* user = nullptr; + + if (BlockRange().TryGetUse(node, &use)) + { + user = use.User(); + } + resultOpNum = node->GetResultOpNumForFMA(user, op1, op2, op3); + + // Prioritize Containable op. Check if any one of the op is containable first. + // Set op regOptional only if none of them is containable. - if (IsContainableHWIntrinsicOp(node, op3, &supportsRegOptional)) + // Prefer to make op3 contained, + if (resultOpNum != 3 && IsContainableHWIntrinsicOp(node, op3, &supportsOp3RegOptional)) { - // 213 form: op1 = (op2 * op1) + [op3] + // result = (op1 * op2) + [op3] MakeSrcContained(node, op3); } - else if (IsContainableHWIntrinsicOp(node, op2, &supportsRegOptional)) + else if (resultOpNum != 2 && IsContainableHWIntrinsicOp(node, op2, &supportsOp2RegOptional)) { - // 132 form: op1 = (op1 * op3) + [op2] + // result = (op1 * [op2]) + op3 MakeSrcContained(node, op2); } - else if (IsContainableHWIntrinsicOp(node, op1, &supportsRegOptional)) + else if (resultOpNum != 1 && !HWIntrinsicInfo::CopiesUpperBits(intrinsicId) && + IsContainableHWIntrinsicOp(node, op1, &supportsOp1RegOptional)) { - // Intrinsics with CopyUpperBits semantics cannot have op1 be contained - - if (!HWIntrinsicInfo::CopiesUpperBits(intrinsicId)) - { - // 231 form: op3 = (op2 * op3) + [op1] - MakeSrcContained(node, op1); - } + // result = ([op1] * op2) + op3 + MakeSrcContained(node, op1); } - else + else if (supportsOp3RegOptional) { - assert(supportsRegOptional); - - // TODO-XArch-CQ: Technically any one of the three operands can - // be reg-optional. With a limitation on op1 where - // it can only be so if CopyUpperBits is off. - // https://github.com/dotnet/runtime/issues/6358 - - // 213 form: op1 = (op2 * op1) + op3 + assert(resultOpNum != 3); op3->SetRegOptional(); } + else if (supportsOp2RegOptional) + { + assert(resultOpNum != 2); + op2->SetRegOptional(); + } + else if (supportsOp1RegOptional) + { + op1->SetRegOptional(); + } } else { @@ -6403,8 +6093,8 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) MakeSrcContained(node, op1); // MultiplyNoFlags is a Commutative operation, so swap the first two operands here // to make the containment checks in codegen significantly simpler - originalArgList->Current() = op2; - originalArgList->Rest()->Current() = op1; + node->Op(1) = op2; + node->Op(2) = op1; } else if (supportsRegOptional) { diff --git a/src/coreclr/jit/lsra.cpp b/src/coreclr/jit/lsra.cpp index 9283919ae5ef6e..b64930c5913f14 100644 --- a/src/coreclr/jit/lsra.cpp +++ b/src/coreclr/jit/lsra.cpp @@ -190,9 +190,8 @@ weight_t LinearScan::getWeight(RefPosition* refPos) { // Tracked locals: use weighted ref cnt as the weight of the // ref position. - GenTreeLclVarCommon* lclCommon = treeNode->AsLclVarCommon(); - LclVarDsc* varDsc = &(compiler->lvaTable[lclCommon->GetLclNum()]); - weight = varDsc->lvRefCntWtd(); + const LclVarDsc* varDsc = compiler->lvaGetDesc(treeNode->AsLclVarCommon()); + weight = varDsc->lvRefCntWtd(); if (refPos->getInterval()->isSpilled) { // Decrease the weight if the interval has already been spilled. @@ -1385,7 +1384,7 @@ void LinearScan::recordVarLocationsAtStartOfBB(BasicBlock* bb) void Interval::setLocalNumber(Compiler* compiler, unsigned lclNum, LinearScan* linScan) { - LclVarDsc* varDsc = &compiler->lvaTable[lclNum]; + const LclVarDsc* varDsc = compiler->lvaGetDesc(lclNum); assert(varDsc->lvTracked); assert(varDsc->lvVarIndex < compiler->lvaTrackedCount); @@ -1501,7 +1500,7 @@ bool LinearScan::isRegCandidate(LclVarDsc* varDsc) // Pinned variables may not be tracked (a condition of the GCInfo representation) // or enregistered, on x86 -- it is believed that we can enregister pinned (more properly, "pinning") // references when using the general GC encoding. - unsigned lclNum = (unsigned)(varDsc - compiler->lvaTable); + unsigned lclNum = compiler->lvaGetLclNum(varDsc); if (varDsc->IsAddressExposed() || !varDsc->IsEnregisterableType() || (!compiler->compEnregStructLocals() && (varDsc->lvType == TYP_STRUCT))) { @@ -1918,8 +1917,8 @@ void LinearScan::identifyCandidates() } #endif - JITDUMP("floatVarCount = %d; hasLoops = %d, singleExit = %d\n", floatVarCount, compiler->fgHasLoops, - (compiler->fgReturnBlocks == nullptr || compiler->fgReturnBlocks->next == nullptr)); + JITDUMP("floatVarCount = %d; hasLoops = %s, singleExit = %s\n", floatVarCount, dspBool(compiler->fgHasLoops), + dspBool(compiler->fgReturnBlocks == nullptr || compiler->fgReturnBlocks->next == nullptr)); // Determine whether to use the 2nd, more aggressive, threshold for fp callee saves. if (floatVarCount > 6 && compiler->fgHasLoops && @@ -2476,7 +2475,7 @@ void LinearScan::dumpVarRefPositions(const char* title) { printf("--- V%02u", i); - LclVarDsc* varDsc = compiler->lvaTable + i; + const LclVarDsc* varDsc = compiler->lvaGetDesc(i); if (varDsc->lvIsRegCandidate()) { Interval* interval = getIntervalForLocalVar(varDsc->lvVarIndex); @@ -5766,7 +5765,7 @@ void LinearScan::writeLocalReg(GenTreeLclVar* lclNode, unsigned varNum, regNumbe else { assert(compiler->lvaEnregMultiRegVars); - LclVarDsc* parentVarDsc = compiler->lvaGetDesc(lclNode->GetLclNum()); + LclVarDsc* parentVarDsc = compiler->lvaGetDesc(lclNode); assert(parentVarDsc->lvPromoted); unsigned regIndex = varNum - parentVarDsc->lvFieldLclStart; assert(regIndex < MAX_MULTIREG_COUNT); @@ -6275,7 +6274,7 @@ void LinearScan::insertUpperVectorSave(GenTree* tree, return; } - LclVarDsc* varDsc = compiler->lvaTable + lclVarInterval->varNum; + LclVarDsc* varDsc = compiler->lvaGetDesc(lclVarInterval->varNum); assert(Compiler::varTypeNeedsPartialCalleeSave(varDsc->GetRegisterType())); // On Arm64, we must always have a register to save the upper half, @@ -6297,9 +6296,8 @@ void LinearScan::insertUpperVectorSave(GenTree* tree, saveLcl->SetRegNum(lclVarReg); SetLsraAdded(saveLcl); - GenTreeSIMD* simdNode = - new (compiler, GT_SIMD) GenTreeSIMD(LargeVectorSaveType, saveLcl, nullptr, SIMDIntrinsicUpperSave, - varDsc->GetSimdBaseJitType(), genTypeSize(varDsc->lvType)); + GenTreeSIMD* simdNode = compiler->gtNewSIMDNode(LargeVectorSaveType, saveLcl, SIMDIntrinsicUpperSave, + varDsc->GetSimdBaseJitType(), genTypeSize(varDsc)); if (simdNode->GetSimdBaseJitType() == CORINFO_TYPE_UNDEF) { @@ -6356,7 +6354,7 @@ void LinearScan::insertUpperVectorRestore(GenTree* tree, // We should not call this method if the lclVar is not in a register (we should have simply marked the entire // lclVar as spilled). assert(lclVarReg != REG_NA); - LclVarDsc* varDsc = compiler->lvaTable + lclVarInterval->varNum; + LclVarDsc* varDsc = compiler->lvaGetDesc(lclVarInterval->varNum); assert(Compiler::varTypeNeedsPartialCalleeSave(varDsc->GetRegisterType())); GenTree* restoreLcl = nullptr; @@ -6364,9 +6362,8 @@ void LinearScan::insertUpperVectorRestore(GenTree* tree, restoreLcl->SetRegNum(lclVarReg); SetLsraAdded(restoreLcl); - GenTreeSIMD* simdNode = - new (compiler, GT_SIMD) GenTreeSIMD(varDsc->lvType, restoreLcl, nullptr, SIMDIntrinsicUpperRestore, - varDsc->GetSimdBaseJitType(), genTypeSize(varDsc->lvType)); + GenTreeSIMD* simdNode = compiler->gtNewSIMDNode(varDsc->TypeGet(), restoreLcl, SIMDIntrinsicUpperRestore, + varDsc->GetSimdBaseJitType(), genTypeSize(varDsc->lvType)); if (simdNode->GetSimdBaseJitType() == CORINFO_TYPE_UNDEF) { @@ -7223,7 +7220,7 @@ void LinearScan::resolveRegisters() void LinearScan::insertMove( BasicBlock* block, GenTree* insertionPoint, unsigned lclNum, regNumber fromReg, regNumber toReg) { - LclVarDsc* varDsc = compiler->lvaTable + lclNum; + LclVarDsc* varDsc = compiler->lvaGetDesc(lclNum); // the lclVar must be a register candidate assert(isRegCandidate(varDsc)); // One or both MUST be a register @@ -7322,8 +7319,8 @@ void LinearScan::insertSwap( } #endif // DEBUG - LclVarDsc* varDsc1 = compiler->lvaTable + lclNum1; - LclVarDsc* varDsc2 = compiler->lvaTable + lclNum2; + LclVarDsc* varDsc1 = compiler->lvaGetDesc(lclNum1); + LclVarDsc* varDsc2 = compiler->lvaGetDesc(lclNum2); assert(reg1 != REG_STK && reg1 != REG_NA && reg2 != REG_STK && reg2 != REG_NA); GenTree* lcl1 = compiler->gtNewLclvNode(lclNum1, varDsc1->TypeGet()); @@ -9262,9 +9259,8 @@ void LinearScan::lsraGetOperandString(GenTree* tree, if (tree->IsMultiRegNode()) { - unsigned regCount = tree->IsMultiRegLclVar() - ? compiler->lvaGetDesc(tree->AsLclVar()->GetLclNum())->lvFieldCnt - : tree->GetMultiRegCount(); + unsigned regCount = tree->IsMultiRegLclVar() ? compiler->lvaGetDesc(tree->AsLclVar())->lvFieldCnt + : tree->GetMultiRegCount(); for (unsigned regIndex = 1; regIndex < regCount; regIndex++) { charCount = _snprintf_s(operandString, operandStringLength, operandStringLength, ",%s%s", @@ -9321,7 +9317,7 @@ void LinearScan::lsraDispNode(GenTree* tree, LsraTupleDumpMode mode, bool hasDes if (tree->IsLocal()) { varNum = tree->AsLclVarCommon()->GetLclNum(); - varDsc = &(compiler->lvaTable[varNum]); + varDsc = compiler->lvaGetDesc(varNum); if (varDsc->lvLRACandidate) { hasDest = false; @@ -9469,7 +9465,7 @@ void LinearScan::TupleStyleDump(LsraTupleDumpMode mode) { reg = currentRefPosition->assignedReg(); } - LclVarDsc* varDsc = &(compiler->lvaTable[interval->varNum]); + const LclVarDsc* varDsc = compiler->lvaGetDesc(interval->varNum); printf("("); regNumber assignedReg = varDsc->GetRegNum(); regNumber argReg = (varDsc->lvIsRegArg) ? varDsc->GetArgReg() : REG_STK; @@ -10838,8 +10834,8 @@ void LinearScan::verifyResolutionMove(GenTree* resolutionMove, LsraLocation curr GenTreeLclVarCommon* right = dst->gtGetOp2()->AsLclVarCommon(); regNumber leftRegNum = left->GetRegNum(); regNumber rightRegNum = right->GetRegNum(); - LclVarDsc* leftVarDsc = compiler->lvaTable + left->GetLclNum(); - LclVarDsc* rightVarDsc = compiler->lvaTable + right->GetLclNum(); + LclVarDsc* leftVarDsc = compiler->lvaGetDesc(left); + LclVarDsc* rightVarDsc = compiler->lvaGetDesc(right); Interval* leftInterval = getIntervalForLocalVar(leftVarDsc->lvVarIndex); Interval* rightInterval = getIntervalForLocalVar(rightVarDsc->lvVarIndex); assert(leftInterval->physReg == leftRegNum && rightInterval->physReg == rightRegNum); diff --git a/src/coreclr/jit/lsra.h b/src/coreclr/jit/lsra.h index ce94501a396712..1b549424f0fc44 100644 --- a/src/coreclr/jit/lsra.h +++ b/src/coreclr/jit/lsra.h @@ -577,7 +577,7 @@ inline bool leafAddInRange(GenTree* leaf, int lower, int upper, int multiple = 1 return leafInRange(leaf->gtGetOp2(), lower, upper, multiple); } -inline bool isCandidateVar(LclVarDsc* varDsc) +inline bool isCandidateVar(const LclVarDsc* varDsc) { return varDsc->lvLRACandidate; } @@ -1015,10 +1015,7 @@ class LinearScan : public LinearScanInterface { if (tree->IsLocal()) { - unsigned int lclNum = tree->AsLclVarCommon()->GetLclNum(); - assert(lclNum < compiler->lvaCount); - LclVarDsc* varDsc = compiler->lvaTable + tree->AsLclVarCommon()->GetLclNum(); - + const LclVarDsc* varDsc = compiler->lvaGetDesc(tree->AsLclVarCommon()); return isCandidateVar(varDsc); } return false; @@ -1097,7 +1094,7 @@ class LinearScan : public LinearScanInterface Interval* getIntervalForLocalVarNode(GenTreeLclVarCommon* tree) { - LclVarDsc* varDsc = &compiler->lvaTable[tree->GetLclNum()]; + const LclVarDsc* varDsc = compiler->lvaGetDesc(tree); assert(varDsc->lvTracked); return getIntervalForLocalVar(varDsc->lvVarIndex); } @@ -1804,13 +1801,13 @@ class LinearScan : public LinearScanInterface void setDelayFree(RefPosition* use); int BuildBinaryUses(GenTreeOp* node, regMaskTP candidates = RBM_NONE); #ifdef TARGET_XARCH - int BuildRMWUses(GenTreeOp* node, regMaskTP candidates = RBM_NONE); + int BuildRMWUses(GenTree* node, GenTree* op1, GenTree* op2, regMaskTP candidates = RBM_NONE); #endif // !TARGET_XARCH // This is the main entry point for building the RefPositions for a node. // These methods return the number of sources. int BuildNode(GenTree* tree); - void getTgtPrefOperands(GenTreeOp* tree, bool& prefOp1, bool& prefOp2); + void getTgtPrefOperands(GenTree* tree, GenTree* op1, GenTree* op2, bool* prefOp1, bool* prefOp2); bool supportsSpecialPutArg(); int BuildSimple(GenTree* tree); diff --git a/src/coreclr/jit/lsraarm.cpp b/src/coreclr/jit/lsraarm.cpp index b4c61c78c222f2..fb5ad16006dad7 100644 --- a/src/coreclr/jit/lsraarm.cpp +++ b/src/coreclr/jit/lsraarm.cpp @@ -249,7 +249,7 @@ int LinearScan::BuildNode(GenTree* tree) case GT_STORE_LCL_VAR: if (tree->IsMultiRegLclVar() && isCandidateMultiRegLclVar(tree->AsLclVar())) { - dstCount = compiler->lvaGetDesc(tree->AsLclVar()->GetLclNum())->lvFieldCnt; + dstCount = compiler->lvaGetDesc(tree->AsLclVar())->lvFieldCnt; } FALLTHROUGH; @@ -368,6 +368,7 @@ int LinearScan::BuildNode(GenTree* tree) FALLTHROUGH; case GT_AND: + case GT_AND_NOT: case GT_OR: case GT_XOR: case GT_LSH: @@ -432,7 +433,6 @@ int LinearScan::BuildNode(GenTree* tree) srcCount = 0; break; - case GT_LIST: case GT_ARGPLACE: case GT_NO_OP: case GT_START_NONGC: @@ -818,7 +818,7 @@ int LinearScan::BuildNode(GenTree* tree) default: #ifdef DEBUG char message[256]; - _snprintf_s(message, _countof(message), _TRUNCATE, "NYI: Unimplemented node type %s", + _snprintf_s(message, ArrLen(message), _TRUNCATE, "NYI: Unimplemented node type %s", GenTree::OpName(tree->OperGet())); NYIRAW(message); #endif diff --git a/src/coreclr/jit/lsraarm64.cpp b/src/coreclr/jit/lsraarm64.cpp index b7acad960d45e3..8a6393e2351958 100644 --- a/src/coreclr/jit/lsraarm64.cpp +++ b/src/coreclr/jit/lsraarm64.cpp @@ -106,7 +106,7 @@ int LinearScan::BuildNode(GenTree* tree) case GT_STORE_LCL_VAR: if (tree->IsMultiRegLclVar() && isCandidateMultiRegLclVar(tree->AsLclVar())) { - dstCount = compiler->lvaGetDesc(tree->AsLclVar()->GetLclNum())->lvFieldCnt; + dstCount = compiler->lvaGetDesc(tree->AsLclVar())->lvFieldCnt; } FALLTHROUGH; @@ -121,7 +121,6 @@ int LinearScan::BuildNode(GenTree* tree) srcCount = 0; break; - case GT_LIST: case GT_ARGPLACE: case GT_NO_OP: case GT_START_NONGC: @@ -268,6 +267,7 @@ int LinearScan::BuildNode(GenTree* tree) FALLTHROUGH; case GT_AND: + case GT_AND_NOT: case GT_OR: case GT_XOR: case GT_LSH: @@ -279,6 +279,12 @@ int LinearScan::BuildNode(GenTree* tree) BuildDef(tree); break; + case GT_BFIZ: + assert(tree->gtGetOp1()->OperIs(GT_CAST)); + srcCount = BuildOperandUses(tree->gtGetOp1()->gtGetOp1()); + BuildDef(tree); + break; + case GT_RETURNTRAP: // this just turns into a compare of its child with an int // + a conditional call @@ -682,7 +688,16 @@ int LinearScan::BuildNode(GenTree* tree) if (index != nullptr) { srcCount++; - BuildUse(index); + if (index->OperIs(GT_BFIZ) && index->isContained()) + { + GenTreeCast* cast = index->gtGetOp1()->AsCast(); + assert(cast->isContained() && (cns == 0)); + BuildUse(cast->CastOp()); + } + else + { + BuildUse(index); + } } assert(dstCount == 1); @@ -786,17 +801,14 @@ int LinearScan::BuildSIMD(GenTreeSIMD* simdTree) // Only SIMDIntrinsicInit can be contained if (simdTree->isContained()) { - assert(simdTree->gtSIMDIntrinsicID == SIMDIntrinsicInit); + assert(simdTree->GetSIMDIntrinsicId() == SIMDIntrinsicInit); } int dstCount = simdTree->IsValue() ? 1 : 0; assert(dstCount == 1); bool buildUses = true; - GenTree* op1 = simdTree->gtGetOp1(); - GenTree* op2 = simdTree->gtGetOp2(); - - switch (simdTree->gtSIMDIntrinsicID) + switch (simdTree->GetSIMDIntrinsicId()) { case SIMDIntrinsicInit: case SIMDIntrinsicCast: @@ -804,8 +816,6 @@ int LinearScan::BuildSIMD(GenTreeSIMD* simdTree) case SIMDIntrinsicConvertToInt32: case SIMDIntrinsicConvertToDouble: case SIMDIntrinsicConvertToInt64: - case SIMDIntrinsicWidenLo: - case SIMDIntrinsicWidenHi: // No special handling required. break; @@ -816,40 +826,26 @@ int LinearScan::BuildSIMD(GenTreeSIMD* simdTree) // No special handling required. break; - case SIMDIntrinsicNarrow: - { - // Op1 will write to dst before Op2 is free - BuildUse(op1); - RefPosition* op2Use = BuildUse(op2); - setDelayFree(op2Use); - srcCount = 2; - buildUses = false; - break; - } - case SIMDIntrinsicInitN: { var_types baseType = simdTree->GetSimdBaseType(); srcCount = (short)(simdTree->GetSimdSize() / genTypeSize(baseType)); + assert(simdTree->GetOperandCount() == static_cast(srcCount)); if (varTypeIsFloating(simdTree->GetSimdBaseType())) { // Need an internal register to stitch together all the values into a single vector in a SIMD reg. buildInternalFloatRegisterDefForNode(simdTree); } - int initCount = 0; - for (GenTree* list = op1; list != nullptr; list = list->gtGetOp2()) + for (GenTree* operand : simdTree->Operands()) { - assert(list->OperGet() == GT_LIST); - GenTree* listItem = list->gtGetOp1(); - assert(listItem->TypeGet() == baseType); - assert(!listItem->isContained()); - BuildUse(listItem); - initCount++; + assert(operand->TypeIs(baseType)); + assert(!operand->isContained()); + + BuildUse(operand); } - assert(initCount == srcCount); - buildUses = false; + buildUses = false; break; } @@ -863,7 +859,6 @@ int LinearScan::BuildSIMD(GenTreeSIMD* simdTree) case SIMDIntrinsicCopyToArrayX: case SIMDIntrinsicNone: case SIMDIntrinsicHWAccel: - case SIMDIntrinsicWiden: case SIMDIntrinsicInvalid: assert(!"These intrinsics should not be seen during register allocation"); FALLTHROUGH; @@ -874,12 +869,12 @@ int LinearScan::BuildSIMD(GenTreeSIMD* simdTree) } if (buildUses) { - assert(!op1->OperIs(GT_LIST)); assert(srcCount == 0); - srcCount = BuildOperandUses(op1); - if ((op2 != nullptr) && !op2->isContained()) + srcCount = BuildOperandUses(simdTree->Op(1)); + + if ((simdTree->GetOperandCount() == 2) && !simdTree->Op(2)->isContained()) { - srcCount += BuildOperandUses(op2); + srcCount += BuildOperandUses(simdTree->Op(2)); } } assert(internalCount <= MaxInternalCount); diff --git a/src/coreclr/jit/lsrabuild.cpp b/src/coreclr/jit/lsrabuild.cpp index 35ae7eb3564cd5..097df9b2f0ee9c 100644 --- a/src/coreclr/jit/lsrabuild.cpp +++ b/src/coreclr/jit/lsrabuild.cpp @@ -695,7 +695,7 @@ bool LinearScan::isContainableMemoryOp(GenTree* node) { return true; } - LclVarDsc* varDsc = &compiler->lvaTable[node->AsLclVar()->GetLclNum()]; + const LclVarDsc* varDsc = compiler->lvaGetDesc(node->AsLclVar()); return varDsc->lvDoNotEnregister; } return false; @@ -712,6 +712,20 @@ bool LinearScan::isContainableMemoryOp(GenTree* node) // void LinearScan::addRefsForPhysRegMask(regMaskTP mask, LsraLocation currentLoc, RefType refType, bool isLastUse) { + if (refType == RefTypeKill) + { + // The mask identifies a set of registers that will be used during + // codegen. Mark these as modified here, so when we do final frame + // layout, we'll know about all these registers. This is especially + // important if mask contains callee-saved registers, which affect the + // frame size since we need to save/restore them. In the case where we + // have a copyBlk with GC pointers, can need to call the + // CORINFO_HELP_ASSIGN_BYREF helper, which kills callee-saved RSI and + // RDI, if LSRA doesn't assign RSI/RDI, they wouldn't get marked as + // modified until codegen, which is too late. + compiler->codeGen->regSet.rsSetRegsModified(mask DEBUGARG(true)); + } + for (regNumber reg = REG_FIRST; mask; reg = REG_NEXT(reg), mask >>= 1) { if (mask & 1) @@ -971,7 +985,7 @@ regMaskTP LinearScan::getKillSetForHWIntrinsic(GenTreeHWIntrinsic* node) { regMaskTP killMask = RBM_NONE; #ifdef TARGET_XARCH - switch (node->gtHWIntrinsicId) + switch (node->GetHWIntrinsicId()) { case NI_SSE2_MaskMove: // maskmovdqu uses edi as the implicit address register. @@ -1137,16 +1151,6 @@ bool LinearScan::buildKillPositionsForNode(GenTree* tree, LsraLocation currentLo if (killMask != RBM_NONE) { - // The killMask identifies a set of registers that will be used during codegen. - // Mark these as modified here, so when we do final frame layout, we'll know about - // all these registers. This is especially important if killMask contains - // callee-saved registers, which affect the frame size since we need to save/restore them. - // In the case where we have a copyBlk with GC pointers, can need to call the - // CORINFO_HELP_ASSIGN_BYREF helper, which kills callee-saved RSI and RDI, if - // LSRA doesn't assign RSI/RDI, they wouldn't get marked as modified until codegen, - // which is too late. - compiler->codeGen->regSet.rsSetRegsModified(killMask DEBUGARG(true)); - addRefsForPhysRegMask(killMask, currentLoc, RefTypeKill, true); // TODO-CQ: It appears to be valuable for both fp and int registers to avoid killing the callee @@ -1247,7 +1251,7 @@ bool LinearScan::buildKillPositionsForNode(GenTree* tree, LsraLocation currentLo bool LinearScan::isCandidateMultiRegLclVar(GenTreeLclVar* lclNode) { assert(compiler->lvaEnregMultiRegVars && lclNode->IsMultiReg()); - LclVarDsc* varDsc = compiler->lvaGetDesc(lclNode->GetLclNum()); + LclVarDsc* varDsc = compiler->lvaGetDesc(lclNode); assert(varDsc->lvPromoted); bool isMultiReg = (compiler->lvaGetPromotionType(varDsc) == Compiler::PROMOTION_TYPE_INDEPENDENT); if (!isMultiReg) @@ -1679,10 +1683,9 @@ int LinearScan::ComputeAvailableSrcCount(GenTree* node) // void LinearScan::buildRefPositionsForNode(GenTree* tree, LsraLocation currentLoc) { - // The LIR traversal doesn't visit GT_LIST or GT_ARGPLACE nodes. + // The LIR traversal doesn't visit GT_ARGPLACE nodes. // GT_CLS_VAR nodes should have been eliminated by rationalizer. assert(tree->OperGet() != GT_ARGPLACE); - assert(tree->OperGet() != GT_LIST); assert(tree->OperGet() != GT_CLS_VAR); // The set of internal temporary registers used by this node are stored in the @@ -1704,7 +1707,7 @@ void LinearScan::buildRefPositionsForNode(GenTree* tree, LsraLocation currentLoc // address computation. In this case we need to check whether it is a last use. if (tree->IsLocal() && ((tree->gtFlags & GTF_VAR_DEATH) != 0)) { - LclVarDsc* const varDsc = &compiler->lvaTable[tree->AsLclVarCommon()->GetLclNum()]; + LclVarDsc* const varDsc = compiler->lvaGetDesc(tree->AsLclVarCommon()); if (isCandidateVar(varDsc)) { assert(varDsc->lvTracked); @@ -2046,12 +2049,12 @@ void LinearScan::updateRegStateForArg(LclVarDsc* argDsc) if (isFloat) { - JITDUMP("Float arg V%02u in reg %s\n", (argDsc - compiler->lvaTable), getRegName(argDsc->GetArgReg())); + JITDUMP("Float arg V%02u in reg %s\n", compiler->lvaGetLclNum(argDsc), getRegName(argDsc->GetArgReg())); compiler->raUpdateRegStateForArg(floatRegState, argDsc); } else { - JITDUMP("Int arg V%02u in reg %s\n", (argDsc - compiler->lvaTable), getRegName(argDsc->GetArgReg())); + JITDUMP("Int arg V%02u in reg %s\n", compiler->lvaGetLclNum(argDsc), getRegName(argDsc->GetArgReg())); #if FEATURE_MULTIREG_ARGS if (argDsc->GetOtherArgReg() != REG_NA) { @@ -2183,7 +2186,7 @@ void LinearScan::buildIntervals() for (unsigned fieldVarNum = argDsc->lvFieldLclStart; fieldVarNum < argDsc->lvFieldLclStart + argDsc->lvFieldCnt; ++fieldVarNum) { - LclVarDsc* fieldVarDsc = &(compiler->lvaTable[fieldVarNum]); + const LclVarDsc* fieldVarDsc = compiler->lvaGetDesc(fieldVarNum); if (fieldVarDsc->lvLRACandidate) { assert(fieldVarDsc->lvTracked); @@ -2356,7 +2359,15 @@ void LinearScan::buildIntervals() // into the scratch register, so it will be killed here. if (compiler->compShouldPoisonFrame() && compiler->fgFirstBBisScratch() && block == compiler->fgFirstBB) { - addRefsForPhysRegMask(genRegMask(REG_SCRATCH), currentLoc + 1, RefTypeKill, true); + regMaskTP killed; +#if defined(TARGET_XARCH) + // Poisoning uses EAX for small vars and rep stosd that kills edi, ecx and eax for large vars. + killed = RBM_EDI | RBM_ECX | RBM_EAX; +#else + // Poisoning uses REG_SCRATCH for small vars and memset helper for big vars. + killed = genRegMask(REG_SCRATCH) | compiler->compHelperCallKillSet(CORINFO_HELP_MEMSET); +#endif + addRefsForPhysRegMask(killed, currentLoc + 1, RefTypeKill, true); currentLoc += 2; } @@ -2461,8 +2472,8 @@ void LinearScan::buildIntervals() unsigned varIndex = 0; while (iter.NextElem(&varIndex)) { - unsigned varNum = compiler->lvaTrackedToVarNum[varIndex]; - LclVarDsc* varDsc = compiler->lvaTable + varNum; + unsigned varNum = compiler->lvaTrackedToVarNum[varIndex]; + const LclVarDsc* varDsc = compiler->lvaGetDesc(varNum); assert(isCandidateVar(varDsc)); Interval* interval = getIntervalForLocalVar(varIndex); RefPosition* pos = @@ -2480,7 +2491,7 @@ void LinearScan::buildIntervals() while (iter.NextElem(&varIndex)) { unsigned varNum = compiler->lvaTrackedToVarNum[varIndex]; - LclVarDsc* const varDsc = &compiler->lvaTable[varNum]; + LclVarDsc* const varDsc = compiler->lvaGetDesc(varNum); assert(isCandidateVar(varDsc)); RefPosition* const lastRP = getIntervalForLocalVar(varIndex)->lastRefPosition; // We should be able to assert that lastRP is non-null if it is live-out, but sometimes liveness @@ -2515,7 +2526,7 @@ void LinearScan::buildIntervals() // If we need to KeepAliveAndReportThis, add a dummy exposed use of it at the end unsigned keepAliveVarNum = compiler->info.compThisArg; assert(compiler->info.compIsStatic == false); - LclVarDsc* varDsc = compiler->lvaTable + keepAliveVarNum; + const LclVarDsc* varDsc = compiler->lvaGetDesc(keepAliveVarNum); if (isCandidateVar(varDsc)) { JITDUMP("Adding exposed use of this, for lvaKeepAliveAndReportThis\n"); @@ -2533,7 +2544,7 @@ void LinearScan::buildIntervals() while (iter.NextElem(&varIndex)) { unsigned varNum = compiler->lvaTrackedToVarNum[varIndex]; - LclVarDsc* varDsc = compiler->lvaTable + varNum; + LclVarDsc* varDsc = compiler->lvaGetDesc(varNum); Interval* interval = getIntervalForLocalVar(varIndex); assert(interval->isWriteThru); weight_t weight = varDsc->lvRefCntWtd(); @@ -2958,7 +2969,7 @@ RefPosition* LinearScan::BuildUse(GenTree* operand, regMaskTP candidates, int mu else if (operand->IsMultiRegLclVar()) { assert(compiler->lvaEnregMultiRegVars); - LclVarDsc* varDsc = compiler->lvaGetDesc(operand->AsLclVar()->GetLclNum()); + LclVarDsc* varDsc = compiler->lvaGetDesc(operand->AsLclVar()); LclVarDsc* fieldVarDsc = compiler->lvaGetDesc(varDsc->lvFieldLclStart + multiRegIdx); interval = getIntervalForLocalVar(fieldVarDsc->lvVarIndex); if (operand->AsLclVar()->IsLastUse(multiRegIdx)) @@ -3021,10 +3032,22 @@ int LinearScan::BuildAddrUses(GenTree* addr, regMaskTP candidates) BuildUse(addrMode->Base(), candidates); srcCount++; } - if ((addrMode->Index() != nullptr) && !addrMode->Index()->isContained()) + if (addrMode->Index() != nullptr) { - BuildUse(addrMode->Index(), candidates); - srcCount++; + if (!addrMode->Index()->isContained()) + { + BuildUse(addrMode->Index(), candidates); + srcCount++; + } +#ifdef TARGET_ARM64 + else if (addrMode->Index()->OperIs(GT_BFIZ)) + { + GenTreeCast* cast = addrMode->Index()->gtGetOp1()->AsCast(); + assert(cast->isContained()); + BuildUse(cast->CastOp(), candidates); + srcCount++; + } +#endif } return srcCount; } @@ -3065,9 +3088,11 @@ int LinearScan::BuildOperandUses(GenTree* node, regMaskTP candidates) { if (node->AsHWIntrinsic()->OperIsMemoryLoad()) { - return BuildAddrUses(node->gtGetOp1()); + return BuildAddrUses(node->AsHWIntrinsic()->Op(1)); } - BuildUse(node->gtGetOp1(), candidates); + + assert(node->AsHWIntrinsic()->GetOperandCount() == 1); + BuildUse(node->AsHWIntrinsic()->Op(1), candidates); return 1; } #endif // FEATURE_HW_INTRINSICS @@ -3129,10 +3154,13 @@ int LinearScan::BuildDelayFreeUses(GenTree* node, GenTree* rmwNode, regMaskTP ca { use = BuildUse(node, candidates); } +#ifdef FEATURE_HW_INTRINSICS else if (node->OperIsHWIntrinsic()) { - use = BuildUse(node->gtGetOp1(), candidates); + assert(node->AsHWIntrinsic()->GetOperandCount() == 1); + use = BuildUse(node->AsHWIntrinsic()->Op(1), candidates); } +#endif else if (!node->OperIsIndir()) { return 0; @@ -3205,15 +3233,17 @@ int LinearScan::BuildDelayFreeUses(GenTree* node, GenTree* rmwNode, regMaskTP ca // int LinearScan::BuildBinaryUses(GenTreeOp* node, regMaskTP candidates) { + GenTree* op1 = node->gtGetOp1(); + GenTree* op2 = node->gtGetOp2IfPresent(); + #ifdef TARGET_XARCH if (node->OperIsBinary() && isRMWRegOper(node)) { - return BuildRMWUses(node, candidates); + assert(op2 != nullptr); + return BuildRMWUses(node, op1, op2, candidates); } #endif // TARGET_XARCH - int srcCount = 0; - GenTree* op1 = node->gtOp1; - GenTree* op2 = node->gtGetOp2IfPresent(); + int srcCount = 0; if (op1 != nullptr) { srcCount += BuildOperandUses(op1, candidates); @@ -3279,7 +3309,7 @@ void LinearScan::BuildStoreLocDef(GenTreeLclVarCommon* storeLoc, defCandidates = allRegs(type); } #else - defCandidates = allRegs(type); + defCandidates = allRegs(type); #endif // TARGET_X86 RefPosition* def = newRefPosition(varDefInterval, currentLoc + 1, RefTypeDef, storeLoc, defCandidates, index); @@ -3311,7 +3341,7 @@ int LinearScan::BuildMultiRegStoreLoc(GenTreeLclVar* storeLoc) GenTree* op1 = storeLoc->gtGetOp1(); unsigned int dstCount = storeLoc->GetFieldCount(compiler); unsigned int srcCount = dstCount; - LclVarDsc* varDsc = compiler->lvaGetDesc(storeLoc->GetLclNum()); + LclVarDsc* varDsc = compiler->lvaGetDesc(storeLoc); assert(compiler->lvaEnregMultiRegVars); assert(storeLoc->OperGet() == GT_STORE_LCL_VAR); @@ -3388,7 +3418,7 @@ int LinearScan::BuildStoreLoc(GenTreeLclVarCommon* storeLoc) GenTree* op1 = storeLoc->gtGetOp1(); int srcCount; RefPosition* singleUseRef = nullptr; - LclVarDsc* varDsc = compiler->lvaGetDesc(storeLoc->GetLclNum()); + LclVarDsc* varDsc = compiler->lvaGetDesc(storeLoc); if (storeLoc->IsMultiRegLclVar()) { @@ -3600,12 +3630,11 @@ int LinearScan::BuildReturn(GenTree* tree) else { assert(compiler->lvaEnregMultiRegVars); - LclVarDsc* varDsc = compiler->lvaGetDesc(op1->AsLclVar()->GetLclNum()); + LclVarDsc* varDsc = compiler->lvaGetDesc(op1->AsLclVar()); nonCallRetTypeDesc.InitializeStructReturnType(compiler, varDsc->GetStructHnd(), compiler->info.compCallConv); pRetTypeDesc = &nonCallRetTypeDesc; - assert(compiler->lvaGetDesc(op1->AsLclVar()->GetLclNum())->lvFieldCnt == - nonCallRetTypeDesc.GetReturnRegCount()); + assert(compiler->lvaGetDesc(op1->AsLclVar())->lvFieldCnt == nonCallRetTypeDesc.GetReturnRegCount()); } srcCount = pRetTypeDesc->GetReturnRegCount(); // For any source that's coming from a different register file, we need to ensure that diff --git a/src/coreclr/jit/lsraxarch.cpp b/src/coreclr/jit/lsraxarch.cpp index 358630dc9fa30e..ca169600e83f83 100644 --- a/src/coreclr/jit/lsraxarch.cpp +++ b/src/coreclr/jit/lsraxarch.cpp @@ -112,7 +112,7 @@ int LinearScan::BuildNode(GenTree* tree) case GT_STORE_LCL_VAR: if (tree->IsMultiRegLclVar() && isCandidateMultiRegLclVar(tree->AsLclVar())) { - dstCount = compiler->lvaGetDesc(tree->AsLclVar()->GetLclNum())->lvFieldCnt; + dstCount = compiler->lvaGetDesc(tree->AsLclVar())->lvFieldCnt; } srcCount = BuildStoreLoc(tree->AsLclVarCommon()); break; @@ -124,7 +124,6 @@ int LinearScan::BuildNode(GenTree* tree) srcCount = 0; break; - case GT_LIST: case GT_ARGPLACE: case GT_NO_OP: case GT_START_NONGC: @@ -701,6 +700,8 @@ int LinearScan::BuildNode(GenTree* tree) // // Arguments: // tree - the node of interest. +// op1 - its first operand +// op2 - its second operand // prefOp1 - a bool "out" parameter indicating, on return, whether op1 should be preferenced to the target. // prefOp2 - a bool "out" parameter indicating, on return, whether op2 should be preferenced to the target. // @@ -710,27 +711,24 @@ int LinearScan::BuildNode(GenTree* tree) // Notes: // The caller is responsible for initializing the two "out" parameters to false. // -void LinearScan::getTgtPrefOperands(GenTreeOp* tree, bool& prefOp1, bool& prefOp2) +void LinearScan::getTgtPrefOperands(GenTree* tree, GenTree* op1, GenTree* op2, bool* prefOp1, bool* prefOp2) { // If op2 of a binary-op gets marked as contained, then binary-op srcCount will be 1. // Even then we would like to set isTgtPref on Op1. - if (tree->OperIsBinary() && isRMWRegOper(tree)) + if (isRMWRegOper(tree)) { - GenTree* op1 = tree->gtGetOp1(); - GenTree* op2 = tree->gtGetOp2(); - // If we have a read-modify-write operation, we want to preference op1 to the target, // if it is not contained. - if (!op1->isContained() && !op1->OperIs(GT_LIST)) + if (!op1->isContained()) { - prefOp1 = true; + *prefOp1 = true; } // Commutative opers like add/mul/and/or/xor could reverse the order of operands if it is safe to do so. // In that case we will preference both, to increase the chance of getting a match. - if (tree->OperIsCommutative() && op2 != nullptr && !op2->isContained()) + if (tree->OperIsCommutative() && (op2 != nullptr) && !op2->isContained()) { - prefOp2 = true; + *prefOp2 = true; } } } @@ -751,7 +749,13 @@ bool LinearScan::isRMWRegOper(GenTree* tree) { // TODO-XArch-CQ: Make this more accurate. // For now, We assume that most binary operators are of the RMW form. + CLANG_FORMAT_COMMENT_ANCHOR; + +#ifdef FEATURE_HW_INTRINSICS + assert(tree->OperIsBinary() || (tree->OperIsMultiOp() && (tree->AsMultiOp()->GetOperandCount() <= 2))); +#else assert(tree->OperIsBinary()); +#endif if (tree->OperIsCompare() || tree->OperIs(GT_CMP) || tree->OperIs(GT_BT)) { @@ -801,11 +805,9 @@ bool LinearScan::isRMWRegOper(GenTree* tree) } // Support for building RefPositions for RMW nodes. -int LinearScan::BuildRMWUses(GenTreeOp* node, regMaskTP candidates) +int LinearScan::BuildRMWUses(GenTree* node, GenTree* op1, GenTree* op2, regMaskTP candidates) { int srcCount = 0; - GenTree* op1 = node->gtOp1; - GenTree* op2 = node->gtGetOp2IfPresent(); regMaskTP op1Candidates = candidates; regMaskTP op2Candidates = candidates; @@ -828,7 +830,7 @@ int LinearScan::BuildRMWUses(GenTreeOp* node, regMaskTP candidates) bool prefOp1 = false; bool prefOp2 = false; - getTgtPrefOperands(node, prefOp1, prefOp2); + getTgtPrefOperands(node, op1, op2, &prefOp1, &prefOp2); assert(!prefOp2 || node->OperIsCommutative()); // Determine which operand, if any, should be delayRegFree. Normally, this would be op2, @@ -1873,14 +1875,12 @@ int LinearScan::BuildSIMD(GenTreeSIMD* simdTree) if (simdTree->isContained()) { // Only SIMDIntrinsicInit can be contained - assert(simdTree->gtSIMDIntrinsicID == SIMDIntrinsicInit); + assert(simdTree->GetSIMDIntrinsicId() == SIMDIntrinsicInit); } SetContainsAVXFlags(simdTree->GetSimdSize()); - GenTree* op1 = simdTree->gtGetOp1(); - GenTree* op2 = simdTree->gtGetOp2(); - int srcCount = 0; + int srcCount = 0; - switch (simdTree->gtSIMDIntrinsicID) + switch (simdTree->GetSIMDIntrinsicId()) { case SIMDIntrinsicInit: { @@ -1893,6 +1893,8 @@ int LinearScan::BuildSIMD(GenTreeSIMD* simdTree) CLANG_FORMAT_COMMENT_ANCHOR; #if !defined(TARGET_64BIT) + GenTree* op1 = simdTree->Op(1); + if (op1->OperGet() == GT_LONG) { assert(op1->isContained()); @@ -1928,19 +1930,19 @@ int LinearScan::BuildSIMD(GenTreeSIMD* simdTree) { var_types baseType = simdTree->GetSimdBaseType(); srcCount = (short)(simdTree->GetSimdSize() / genTypeSize(baseType)); + assert(simdTree->GetOperandCount() == static_cast(srcCount)); + // Need an internal register to stitch together all the values into a single vector in a SIMD reg. buildInternalFloatRegisterDefForNode(simdTree); - int initCount = 0; - for (GenTree* list = op1; list != nullptr; list = list->gtGetOp2()) + + for (GenTree* operand : simdTree->Operands()) { - assert(list->OperGet() == GT_LIST); - GenTree* listItem = list->gtGetOp1(); - assert(listItem->TypeGet() == baseType); - assert(!listItem->isContained()); - BuildUse(listItem); - initCount++; + assert(operand->TypeIs(baseType)); + assert(!operand->isContained()); + + BuildUse(operand); } - assert(initCount == srcCount); + buildUses = false; } break; @@ -1975,16 +1977,6 @@ int LinearScan::BuildSIMD(GenTreeSIMD* simdTree) case SIMDIntrinsicConvertToInt32: break; - case SIMDIntrinsicWidenLo: - case SIMDIntrinsicWidenHi: - if (varTypeIsIntegral(simdTree->GetSimdBaseType())) - { - // We need an internal register different from targetReg. - setInternalRegsDelayFree = true; - buildInternalFloatRegisterDefForNode(simdTree); - } - break; - case SIMDIntrinsicConvertToInt64: // We need an internal register different from targetReg. setInternalRegsDelayFree = true; @@ -2018,19 +2010,9 @@ int LinearScan::BuildSIMD(GenTreeSIMD* simdTree) buildInternalIntRegisterDefForNode(simdTree); break; - case SIMDIntrinsicNarrow: - // We need an internal register different from targetReg. - setInternalRegsDelayFree = true; - buildInternalFloatRegisterDefForNode(simdTree); - if ((compiler->getSIMDSupportLevel() == SIMD_AVX2_Supported) && (simdTree->GetSimdBaseType() != TYP_DOUBLE)) - { - buildInternalFloatRegisterDefForNode(simdTree); - } - break; - case SIMDIntrinsicShuffleSSE2: // Second operand is an integer constant and marked as contained. - assert(simdTree->gtGetOp2()->isContainedIntOrIImmed()); + assert(simdTree->Op(2)->isContainedIntOrIImmed()); break; default: @@ -2039,10 +2021,11 @@ int LinearScan::BuildSIMD(GenTreeSIMD* simdTree) } if (buildUses) { - assert(!op1->OperIs(GT_LIST)); assert(srcCount == 0); // This is overly conservative, but is here for zero diffs. - srcCount = BuildRMWUses(simdTree); + GenTree* op1 = simdTree->Op(1); + GenTree* op2 = (simdTree->GetOperandCount() == 2) ? simdTree->Op(2) : nullptr; + srcCount = BuildRMWUses(simdTree, op1, op2); } buildInternalRegisterUses(); BuildDef(simdTree, dstCandidates); @@ -2062,10 +2045,10 @@ int LinearScan::BuildSIMD(GenTreeSIMD* simdTree) // int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree) { - NamedIntrinsic intrinsicId = intrinsicTree->gtHWIntrinsicId; + NamedIntrinsic intrinsicId = intrinsicTree->GetHWIntrinsicId(); var_types baseType = intrinsicTree->GetSimdBaseType(); + size_t numArgs = intrinsicTree->GetOperandCount(); HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(intrinsicId); - int numArgs = HWIntrinsicInfo::lookupNumArgs(intrinsicTree); // Set the AVX Flags if this instruction may use VEX encoding for SIMD operations. // Note that this may be true even if the ISA is not AVX (e.g. for platform-agnostic intrinsics @@ -2075,60 +2058,21 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree) SetContainsAVXFlags(intrinsicTree->GetSimdSize()); } - GenTree* op1 = intrinsicTree->gtGetOp1(); - GenTree* op2 = intrinsicTree->gtGetOp2(); - GenTree* op3 = nullptr; - GenTree* lastOp = nullptr; - int srcCount = 0; int dstCount = intrinsicTree->IsValue() ? 1 : 0; regMaskTP dstCandidates = RBM_NONE; - if (op1 == nullptr) + if (intrinsicTree->GetOperandCount() == 0) { - assert(op2 == nullptr); assert(numArgs == 0); } else { - if (op1->OperIsList()) - { - assert(op2 == nullptr); - assert(numArgs >= 3); - - GenTreeArgList* argList = op1->AsArgList(); - - op1 = argList->Current(); - argList = argList->Rest(); - - op2 = argList->Current(); - argList = argList->Rest(); - - op3 = argList->Current(); - - while (argList->Rest() != nullptr) - { - argList = argList->Rest(); - } - - lastOp = argList->Current(); - argList = argList->Rest(); - - assert(argList == nullptr); - } - else if (op2 != nullptr) - { - assert(numArgs == 2); - lastOp = op2; - } - else - { - assert(numArgs == 1); - lastOp = op1; - } - - assert(lastOp != nullptr); + GenTree* op1 = intrinsicTree->Op(1); + GenTree* op2 = (numArgs >= 2) ? intrinsicTree->Op(2) : nullptr; + GenTree* op3 = (numArgs >= 3) ? intrinsicTree->Op(3) : nullptr; + GenTree* lastOp = intrinsicTree->Op(numArgs); bool buildUses = true; @@ -2328,48 +2272,93 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree) const bool copiesUpperBits = HWIntrinsicInfo::CopiesUpperBits(intrinsicId); - // Intrinsics with CopyUpperBits semantics cannot have op1 be contained - assert(!copiesUpperBits || !op1->isContained()); + unsigned resultOpNum = 0; + LIR::Use use; + GenTree* user = nullptr; - if (op2->isContained()) + if (LIR::AsRange(blockSequence[curBBSeqNum]).TryGetUse(intrinsicTree, &use)) { - // 132 form: op1 = (op1 * op3) + [op2] + user = use.User(); + } + resultOpNum = intrinsicTree->GetResultOpNumForFMA(user, op1, op2, op3); - tgtPrefUse = BuildUse(op1); + unsigned containedOpNum = 0; - srcCount += 1; - srcCount += BuildOperandUses(op2); - srcCount += BuildDelayFreeUses(op3, op1); + // containedOpNum remains 0 when no operand is contained or regOptional + if (op1->isContained() || op1->IsRegOptional()) + { + containedOpNum = 1; } - else if (op1->isContained()) + else if (op2->isContained() || op2->IsRegOptional()) { - // 231 form: op3 = (op2 * op3) + [op1] - - tgtPrefUse = BuildUse(op3); - - srcCount += BuildOperandUses(op1); - srcCount += BuildDelayFreeUses(op2, op1); - srcCount += 1; + containedOpNum = 2; } - else + else if (op3->isContained() || op3->IsRegOptional()) { - // 213 form: op1 = (op2 * op1) + [op3] + containedOpNum = 3; + } - tgtPrefUse = BuildUse(op1); - srcCount += 1; + GenTree* emitOp1 = op1; + GenTree* emitOp2 = op2; + GenTree* emitOp3 = op3; - if (copiesUpperBits) + // Intrinsics with CopyUpperBits semantics must have op1 as target + assert(containedOpNum != 1 || !copiesUpperBits); + + if (containedOpNum == 1) + { + // https://github.com/dotnet/runtime/issues/62215 + // resultOpNum might change between lowering and lsra, comment out assertion for now. + // assert(containedOpNum != resultOpNum); + // resultOpNum is 3 or 0: op3/? = ([op1] * op2) + op3 + std::swap(emitOp1, emitOp3); + + if (resultOpNum == 2) { - srcCount += BuildDelayFreeUses(op2, op1); + // op2 = ([op1] * op2) + op3 + std::swap(emitOp2, emitOp3); } - else + } + else if (containedOpNum == 3) + { + // assert(containedOpNum != resultOpNum); + if (resultOpNum == 2 && !copiesUpperBits) { - tgtPrefUse2 = BuildUse(op2); - srcCount += 1; + // op2 = (op1 * op2) + [op3] + std::swap(emitOp1, emitOp2); } + // else: op1/? = (op1 * op2) + [op3] + } + else if (containedOpNum == 2) + { + // assert(containedOpNum != resultOpNum); - srcCount += op3->isContained() ? BuildOperandUses(op3) : BuildDelayFreeUses(op3, op1); + // op1/? = (op1 * [op2]) + op3 + std::swap(emitOp2, emitOp3); + if (resultOpNum == 3 && !copiesUpperBits) + { + // op3 = (op1 * [op2]) + op3 + std::swap(emitOp1, emitOp2); + } + } + else + { + // containedOpNum == 0 + // no extra work when resultOpNum is 0 or 1 + if (resultOpNum == 2) + { + std::swap(emitOp1, emitOp2); + } + else if (resultOpNum == 3) + { + std::swap(emitOp1, emitOp3); + } } + tgtPrefUse = BuildUse(emitOp1); + + srcCount += 1; + srcCount += BuildDelayFreeUses(emitOp2, emitOp1); + srcCount += emitOp3->isContained() ? BuildOperandUses(emitOp3) : BuildDelayFreeUses(emitOp3, emitOp1); buildUses = false; break; @@ -2413,12 +2402,10 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree) case NI_AVX2_GatherMaskVector128: case NI_AVX2_GatherMaskVector256: { - assert(numArgs == 5); assert(!isRMW); - assert(intrinsicTree->gtGetOp1()->OperIsList()); - GenTreeArgList* argList = intrinsicTree->gtGetOp1()->AsArgList()->Rest()->Rest()->Rest(); - GenTree* op4 = argList->Current(); + GenTree* op4 = intrinsicTree->Op(4); + GenTree* op5 = intrinsicTree->Op(5); // Any pair of the index, mask, or destination registers should be different srcCount += BuildOperandUses(op1); @@ -2427,7 +2414,7 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree) srcCount += BuildDelayFreeUses(op4); // op5 should always be contained - assert(argList->Rest()->Current()->isContained()); + assert(op5->isContained()); // get a tmp register for mask that will be cleared by gather instructions buildInternalFloatRegisterDefForNode(intrinsicTree, allSIMDRegs()); @@ -2466,7 +2453,7 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree) { if (op2->OperIs(GT_HWINTRINSIC) && op2->AsHWIntrinsic()->OperIsMemoryLoad() && op2->isContained()) { - srcCount += BuildAddrUses(op2->gtGetOp1()); + srcCount += BuildAddrUses(op2->AsHWIntrinsic()->Op(1)); } else if (isRMW) { diff --git a/src/coreclr/jit/morph.cpp b/src/coreclr/jit/morph.cpp index 83946626f25d92..0900793a167726 100644 --- a/src/coreclr/jit/morph.cpp +++ b/src/coreclr/jit/morph.cpp @@ -1712,27 +1712,6 @@ void fgArgInfo::SortArgs() assert(begTab == (endTab + 1)); assert(argsRemaining == 0); -#if !FEATURE_FIXED_OUT_ARGS - // Finally build the regArgList - // - callTree->AsCall()->regArgList = NULL; - callTree->AsCall()->regArgListCount = regCount; - - unsigned regInx = 0; - for (curInx = 0; curInx < argCount; curInx++) - { - fgArgTabEntry* curArgTabEntry = argTable[curInx]; - - if (curArgTabEntry->GetRegNum() != REG_STK) - { - // Encode the argument register in the register mask - // - callTree->AsCall()->regArgList[regInx] = curArgTabEntry->GetRegNum(); - regInx++; - } - } -#endif // !FEATURE_FIXED_OUT_ARGS - argsSorted = true; } @@ -1761,7 +1740,7 @@ void fgArgInfo::Dump(Compiler* compiler) const GenTree* Compiler::fgMakeTmpArgNode(fgArgTabEntry* curArgTabEntry) { unsigned tmpVarNum = curArgTabEntry->tmpNum; - LclVarDsc* varDsc = &lvaTable[tmpVarNum]; + LclVarDsc* varDsc = lvaGetDesc(tmpVarNum); assert(varDsc->lvIsTemp); var_types type = varDsc->TypeGet(); @@ -1973,7 +1952,7 @@ void fgArgInfo::EvalArgsToTemps() { setupArg = compiler->gtNewTempAssign(tmpVarNum, argx); - LclVarDsc* varDsc = compiler->lvaTable + tmpVarNum; + LclVarDsc* varDsc = compiler->lvaGetDesc(tmpVarNum); var_types lclVarType = genActualType(argx->gtType); var_types scalarType = TYP_UNKNOWN; @@ -2725,7 +2704,11 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) GenTreeCall::Use* nodeArgs = call->gtCallArgs; // It could include many arguments not included in `sig->numArgs`, for example, `this`, runtime lookup, cookie // etc. - unsigned nodeArgsCount = call->NumChildren(); + unsigned nodeArgsCount = 0; + call->VisitOperands([&nodeArgsCount](GenTree* operand) -> GenTree::VisitResult { + nodeArgsCount++; + return GenTree::VisitResult::Continue; + }); if (call->gtCallThisArg != nullptr) { @@ -3722,14 +3705,14 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) if (argObj->gtOper == GT_LCL_VAR) { unsigned lclNum = argObj->AsLclVarCommon()->GetLclNum(); - LclVarDsc* varDsc = &lvaTable[lclNum]; + LclVarDsc* varDsc = lvaGetDesc(lclNum); if (varDsc->lvPromoted) { if (varDsc->lvFieldCnt == 1) { // get the first and only promoted field - LclVarDsc* fieldVarDsc = &lvaTable[varDsc->lvFieldLclStart]; + LclVarDsc* fieldVarDsc = lvaGetDesc(varDsc->lvFieldLclStart); if (genTypeSize(fieldVarDsc->TypeGet()) >= originalSize) { // we will use the first and only promoted field @@ -3829,7 +3812,7 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) if (copyBlkClass != NO_CLASS_HANDLE) { - fgMakeOutgoingStructArgCopy(call, args, argIndex, copyBlkClass); + fgMakeOutgoingStructArgCopy(call, args, copyBlkClass); } if (argx->gtOper == GT_MKREFANY) @@ -4127,7 +4110,7 @@ void Compiler::fgMorphMultiregStructArgs(GenTreeCall* call) else { assert(argx->OperIs(GT_LCL_VAR)); - structSize = lvaGetDesc(argx->AsLclVar()->GetLclNum())->lvExactSize; + structSize = lvaGetDesc(argx->AsLclVar())->lvExactSize; } assert(structSize > 0); if (structSize == genTypeSize(hfaType)) @@ -4275,8 +4258,7 @@ GenTree* Compiler::fgMorphMultiregStructArg(GenTree* arg, fgArgTabEntry* fgEntry // Only update to the same type. if (underlyingTree->OperIs(GT_LCL_VAR)) { - const GenTreeLclVar* lclVar = underlyingTree->AsLclVar(); - const LclVarDsc* varDsc = lvaGetDesc(lclVar); + const LclVarDsc* varDsc = lvaGetDesc(underlyingTree->AsLclVar()); if (ClassLayout::AreCompatible(varDsc->GetLayout(), objLayout)) { argValue = underlyingTree; @@ -4286,12 +4268,8 @@ GenTree* Compiler::fgMorphMultiregStructArg(GenTree* arg, fgArgTabEntry* fgEntry } else if (arg->OperGet() == GT_LCL_VAR) { - GenTreeLclVarCommon* varNode = arg->AsLclVarCommon(); - unsigned varNum = varNode->GetLclNum(); - assert(varNum < lvaCount); - LclVarDsc* varDsc = &lvaTable[varNum]; - - structSize = varDsc->lvExactSize; + LclVarDsc* varDsc = lvaGetDesc(arg->AsLclVarCommon()); + structSize = varDsc->lvExactSize; assert(structSize == info.compCompHnd->getClassSize(objClass)); } else @@ -4398,8 +4376,7 @@ GenTree* Compiler::fgMorphMultiregStructArg(GenTree* arg, fgArgTabEntry* fgEntry { GenTreeLclVarCommon* varNode = argValue->AsLclVarCommon(); unsigned varNum = varNode->GetLclNum(); - assert(varNum < lvaCount); - LclVarDsc* varDsc = &lvaTable[varNum]; + LclVarDsc* varDsc = lvaGetDesc(varNum); // At this point any TYP_STRUCT LclVar must be an aligned struct // or an HFA struct, both which are passed by value. @@ -4481,8 +4458,8 @@ GenTree* Compiler::fgMorphMultiregStructArg(GenTree* arg, fgArgTabEntry* fgEntry // Did we find the promoted fields at the necessary offsets? if ((loVarNum != BAD_VAR_NUM) && (hiVarNum != BAD_VAR_NUM)) { - LclVarDsc* loVarDsc = &lvaTable[loVarNum]; - LclVarDsc* hiVarDsc = &lvaTable[hiVarNum]; + LclVarDsc* loVarDsc = lvaGetDesc(loVarNum); + LclVarDsc* hiVarDsc = lvaGetDesc(hiVarNum); var_types loType = loVarDsc->lvType; var_types hiType = hiVarDsc->lvType; @@ -4547,7 +4524,7 @@ GenTree* Compiler::fgMorphMultiregStructArg(GenTree* arg, fgArgTabEntry* fgEntry for (unsigned inx = 0; inx < elemCount; inx++) { - varDscs[inx] = &lvaTable[varNums[inx]]; + varDscs[inx] = lvaGetDesc(varNums[inx]); varType[inx] = varDscs[inx]->lvType; if (varTypeIsFloating(varType[inx])) { @@ -4598,8 +4575,7 @@ GenTree* Compiler::fgMorphMultiregStructArg(GenTree* arg, fgArgTabEntry* fgEntry { GenTreeLclVarCommon* varNode = argValue->AsLclVarCommon(); unsigned varNum = varNode->GetLclNum(); - assert(varNum < lvaCount); - LclVarDsc* varDsc = &lvaTable[varNum]; + LclVarDsc* varDsc = lvaGetDesc(varNum); unsigned baseOffset = varNode->GetLclOffs(); unsigned lastOffset = baseOffset + structSize; @@ -4764,16 +4740,11 @@ GenTreeFieldList* Compiler::fgMorphLclArgToFieldlist(GenTreeLclVarCommon* lcl) // Arguments: // call - call being processed // args - args for the call -/// argIndex - arg being processed // copyBlkClass - class handle for the struct // -// Return value: -// tree that computes address of the outgoing arg +// The arg is updated if necessary with the copy. // -void Compiler::fgMakeOutgoingStructArgCopy(GenTreeCall* call, - GenTreeCall::Use* args, - unsigned argIndex, - CORINFO_CLASS_HANDLE copyBlkClass) +void Compiler::fgMakeOutgoingStructArgCopy(GenTreeCall* call, GenTreeCall::Use* args, CORINFO_CLASS_HANDLE copyBlkClass) { GenTree* argx = args->GetNode(); noway_assert(argx->gtOper != GT_MKREFANY); @@ -4808,10 +4779,11 @@ void Compiler::fgMakeOutgoingStructArgCopy(GenTreeCall* call, // * (may not copy) if there is exactly one use of the local in the method, // and the call is not in loop, this is a last use. // - const bool isTailCallLastUse = call->IsTailCall(); - const bool isCallLastUse = (totalAppearances == 1) && !fgMightHaveLoop(); - const bool isNoReturnLastUse = (totalAppearances == 1) && call->IsNoReturn(); - if (isTailCallLastUse || isCallLastUse || isNoReturnLastUse) + // fgMightHaveLoop() is expensive; check it last, only if necessary. + // + if (call->IsTailCall() || // + ((totalAppearances == 1) && call->IsNoReturn()) || // + ((totalAppearances == 1) && !fgMightHaveLoop())) { args->SetNode(lcl); assert(argEntry->GetNode() == lcl); @@ -4839,7 +4811,7 @@ void Compiler::fgMakeOutgoingStructArgCopy(GenTreeCall* call, indexType lclNum; FOREACH_HBV_BIT_SET(lclNum, fgOutgoingArgTemps) { - LclVarDsc* varDsc = &lvaTable[lclNum]; + LclVarDsc* varDsc = lvaGetDesc((unsigned)lclNum); if (typeInfo::AreEquivalent(varDsc->lvVerTypeInfo, typeInfo(TI_STRUCT, copyBlkClass)) && !fgCurrentlyInUseArgTemps->testBit(lclNum)) { @@ -4915,8 +4887,6 @@ void Compiler::fgMakeOutgoingStructArgCopy(GenTreeCall* call, args->SetNode(arg); call->fgArgInfo->EvalToTmp(argEntry, tmp, arg); - - return; } #ifdef TARGET_ARM @@ -4930,7 +4900,7 @@ void Compiler::fgAddSkippedRegsInPromotedStructArg(LclVarDsc* varDsc, // integer register arguments are consecutive ints. They are on ARM. // To start, figure out what register contains the last byte of the first argument. - LclVarDsc* firstFldVarDsc = &lvaTable[varDsc->lvFieldLclStart]; + LclVarDsc* firstFldVarDsc = lvaGetDesc(varDsc->lvFieldLclStart); unsigned lastFldRegOfLastByte = (firstFldVarDsc->lvFldOffset + firstFldVarDsc->lvExactSize - 1) / TARGET_POINTER_SIZE; ; @@ -4941,7 +4911,7 @@ void Compiler::fgAddSkippedRegsInPromotedStructArg(LclVarDsc* varDsc, for (unsigned fldVarOffset = 1; fldVarOffset < varDsc->lvFieldCnt; fldVarOffset++) { unsigned fldVarNum = varDsc->lvFieldLclStart + fldVarOffset; - LclVarDsc* fldVarDsc = &lvaTable[fldVarNum]; + LclVarDsc* fldVarDsc = lvaGetDesc(fldVarNum); unsigned fldRegOffset = fldVarDsc->lvFldOffset / TARGET_POINTER_SIZE; assert(fldRegOffset >= lastFldRegOfLastByte); // Assuming sorted fields. // This loop should enumerate the offsets of any registers skipped. @@ -5461,15 +5431,43 @@ GenTree* Compiler::fgMorphArrayIndex(GenTree* tree) // the partial byref will not point within the object, and thus not get updated correctly during a GC. // This is mostly a risk in fully-interruptible code regions. - /* Add the first element's offset */ - - GenTree* cns = gtNewIconNode(elemOffs, TYP_I_IMPL); + // We can generate two types of trees for "addr": + // + // 1) "arrRef + (index + elemOffset)" + // 2) "(arrRef + elemOffset) + index" + // + // XArch has powerful addressing modes such as [base + index*scale + offset] so it's fine with 1), + // while for Arm we better try to make an invariant sub-tree as large as possible, which is usually + // "(arrRef + elemOffset)" and is CSE/LoopHoisting friendly => produces better codegen. + // 2) should still be safe from GC's point of view since both ADD operations are byref and point to + // within the object so GC will be able to correctly track and update them. - addr = gtNewOperNode(GT_ADD, TYP_I_IMPL, addr, cns); + bool groupArrayRefWithElemOffset = false; +#ifdef TARGET_ARMARCH + groupArrayRefWithElemOffset = true; + // TODO: in some cases even on ARM we better use 1) shape because if "index" is invariant and "arrRef" is not + // we at least will be able to hoist/CSE "index + elemOffset" in some cases. + // See https://github.com/dotnet/runtime/pull/61293#issuecomment-964146497 - /* Add the object ref to the element's offset */ + // Use 2) form only for primitive types for now - it significantly reduced number of size regressions + if (!varTypeIsIntegral(elemTyp)) + { + groupArrayRefWithElemOffset = false; + } +#endif - addr = gtNewOperNode(GT_ADD, TYP_BYREF, arrRef, addr); + // First element's offset + GenTree* elemOffset = gtNewIconNode(elemOffs, TYP_I_IMPL); + if (groupArrayRefWithElemOffset) + { + GenTree* basePlusOffset = gtNewOperNode(GT_ADD, TYP_BYREF, arrRef, elemOffset); + addr = gtNewOperNode(GT_ADD, TYP_BYREF, basePlusOffset, addr); + } + else + { + addr = gtNewOperNode(GT_ADD, TYP_I_IMPL, addr, elemOffset); + addr = gtNewOperNode(GT_ADD, TYP_BYREF, arrRef, addr); + } assert(((tree->gtDebugFlags & GTF_DEBUG_NODE_LARGE) != 0) || (GenTree::s_gtNodeSizes[GT_IND] == TREE_NODE_SZ_SMALL)); @@ -5539,16 +5537,16 @@ GenTree* Compiler::fgMorphArrayIndex(GenTree* tree) tree = gtNewOperNode(GT_COMMA, tree->TypeGet(), arrRefDefn, tree); } - JITDUMP("fgMorphArrayIndex (before remorph):\n"); - DISPTREE(tree); + JITDUMP("fgMorphArrayIndex (before remorph):\n") + DISPTREE(tree) // Currently we morph the tree to perform some folding operations prior // to attaching fieldSeq info and labeling constant array index contributions // tree = fgMorphTree(tree); - JITDUMP("fgMorphArrayIndex (after remorph):\n"); - DISPTREE(tree); + JITDUMP("fgMorphArrayIndex (after remorph):\n") + DISPTREE(tree) // Ideally we just want to proceed to attaching fieldSeq info and labeling the // constant array index contributions, but the morphing operation may have changed @@ -5562,48 +5560,66 @@ GenTree* Compiler::fgMorphArrayIndex(GenTree* tree) if (fgIsCommaThrow(tree)) { - if ((arrElem != indTree) || // A new tree node may have been created - (indTree->OperGet() != GT_IND)) // The GT_IND may have been changed to a GT_CNS_INT + if ((arrElem != indTree) || // A new tree node may have been created + (!indTree->OperIs(GT_IND))) // The GT_IND may have been changed to a GT_CNS_INT { return tree; // Just return the Comma-Throw, don't try to attach the fieldSeq info, etc.. } } assert(!fgGlobalMorph || (arrElem->gtDebugFlags & GTF_DEBUG_NODE_MORPHED)); - DBEXEC(fgGlobalMorph && (arrElem == tree), tree->gtDebugFlags &= ~GTF_DEBUG_NODE_MORPHED); + DBEXEC(fgGlobalMorph && (arrElem == tree), tree->gtDebugFlags &= ~GTF_DEBUG_NODE_MORPHED) - addr = arrElem->AsOp()->gtOp1; - - assert(addr->TypeGet() == TYP_BYREF); + addr = arrElem->gtGetOp1(); GenTree* cnsOff = nullptr; - if (addr->OperGet() == GT_ADD) + if (addr->OperIs(GT_ADD)) { - assert(addr->TypeGet() == TYP_BYREF); - assert(addr->AsOp()->gtOp1->TypeGet() == TYP_REF); - - addr = addr->AsOp()->gtOp2; - - // Look for the constant [#FirstElem] node here, or as the RHS of an ADD. - - if (addr->gtOper == GT_CNS_INT) + GenTree* addrOp1 = addr->gtGetOp1(); + if (groupArrayRefWithElemOffset) { - cnsOff = addr; - addr = nullptr; + if (addrOp1->OperIs(GT_ADD) && addrOp1->gtGetOp2()->IsCnsIntOrI()) + { + assert(addrOp1->gtGetOp1()->TypeIs(TYP_REF)); + cnsOff = addrOp1->gtGetOp2(); + addr = addr->gtGetOp2(); + // Label any constant array index contributions with #ConstantIndex and any LclVars with + // GTF_VAR_ARR_INDEX + addr->LabelIndex(this); + } + else + { + assert(addr->gtGetOp2()->IsCnsIntOrI()); + cnsOff = addr->gtGetOp2(); + addr = nullptr; + } } else { - if ((addr->OperGet() == GT_ADD) && (addr->AsOp()->gtOp2->gtOper == GT_CNS_INT)) + assert(addr->TypeIs(TYP_BYREF)); + assert(addr->gtGetOp1()->TypeIs(TYP_REF)); + addr = addr->gtGetOp2(); + + // Look for the constant [#FirstElem] node here, or as the RHS of an ADD. + if (addr->IsCnsIntOrI()) { - cnsOff = addr->AsOp()->gtOp2; - addr = addr->AsOp()->gtOp1; + cnsOff = addr; + addr = nullptr; + } + else + { + if ((addr->OperIs(GT_ADD)) && addr->gtGetOp2()->IsCnsIntOrI()) + { + cnsOff = addr->gtGetOp2(); + addr = addr->gtGetOp1(); + } + // Label any constant array index contributions with #ConstantIndex and any LclVars with + // GTF_VAR_ARR_INDEX + addr->LabelIndex(this); } - - // Label any constant array index contributions with #ConstantIndex and any LclVars with GTF_VAR_ARR_INDEX - addr->LabelIndex(this); } } - else if (addr->OperGet() == GT_CNS_INT) + else if (addr->IsCnsIntOrI()) { cnsOff = addr; } @@ -5653,7 +5669,7 @@ GenTree* Compiler::fgMorphStackArgForVarArgs(unsigned lclNum, var_types varType, through the varargs cookies to access them, except for the cookie itself */ - LclVarDsc* varDsc = &lvaTable[lclNum]; + LclVarDsc* varDsc = lvaGetDesc(lclNum); if (varDsc->lvIsParam && !varDsc->lvIsRegArg && lclNum != lvaVarargsHandleArg) { @@ -5700,7 +5716,7 @@ GenTree* Compiler::fgMorphLocalVar(GenTree* tree, bool forceRemorph) unsigned lclNum = tree->AsLclVarCommon()->GetLclNum(); var_types varType = lvaGetRealType(lclNum); - LclVarDsc* varDsc = &lvaTable[lclNum]; + LclVarDsc* varDsc = lvaGetDesc(lclNum); if (varDsc->IsAddressExposed()) { @@ -5845,7 +5861,7 @@ GenTree* Compiler::fgMorphField(GenTree* tree, MorphAddrContext* mac) GenTree* newTree = fgMorphFieldToSimdGetElement(tree); if (newTree != tree) { - newTree = fgMorphSmpOp(newTree); + newTree = fgMorphTree(newTree); return newTree; } } @@ -6364,8 +6380,9 @@ void Compiler::fgMorphCallInline(GenTreeCall* call, InlineResult* inlineResult) // Is this call an inline candidate? if (call->IsInlineCandidate()) { + InlineContext* createdContext = nullptr; // Attempt the inline - fgMorphCallInlineHelper(call, inlineResult); + fgMorphCallInlineHelper(call, inlineResult, &createdContext); // We should have made up our minds one way or another.... assert(inlineResult->IsDecided()); @@ -6374,13 +6391,21 @@ void Compiler::fgMorphCallInline(GenTreeCall* call, InlineResult* inlineResult) if (inlineResult->IsFailure()) { + if (createdContext != nullptr) + { + // We created a context before we got to the failure, so mark + // it as failed in the tree. + createdContext->SetFailed(inlineResult); + } + else + { #ifdef DEBUG - - // Before we do any cleanup, create a failing InlineContext to - // capture details of the inlining attempt. - m_inlineStrategy->NewFailure(fgMorphStmt, inlineResult); - + // In debug we always put all inline attempts into the inline tree. + InlineContext* ctx = + m_inlineStrategy->NewContext(call->gtInlineCandidateInfo->inlinersContext, fgMorphStmt, call); + ctx->SetFailed(inlineResult); #endif + } inliningFailed = true; @@ -6416,14 +6441,28 @@ void Compiler::fgMorphCallInline(GenTreeCall* call, InlineResult* inlineResult) } } -/***************************************************************************** - * Helper to attempt to inline a call - * Sets success/failure in inline result - * If success, modifies current method's IR with inlinee's IR - * If failed, undoes any speculative modifications to current method - */ - -void Compiler::fgMorphCallInlineHelper(GenTreeCall* call, InlineResult* result) +//------------------------------------------------------------------------------ +// fgMorphCallInlineHelper: Helper to attempt to inline a call +// +// Arguments: +// call - call expression to inline, inline candidate +// result - result to set to success or failure +// createdContext - The context that was created if the inline attempt got to the inliner. +// +// Notes: +// Attempts to inline the call. +// +// If successful, callee's IR is inserted in place of the call, and +// is marked with an InlineContext. +// +// If unsuccessful, the transformations done in anticipation of a +// possible inline are undone, and the candidate flag on the call +// is cleared. +// +// If a context was created because we got to the importer then it is output by this function. +// If the inline succeeded, this context will already be marked as successful. If it failed and +// a context is returned, then it will not have been marked as success or failed. +void Compiler::fgMorphCallInlineHelper(GenTreeCall* call, InlineResult* result, InlineContext** createdContext) { // Don't expect any surprises here. assert(result->IsCandidate()); @@ -6483,7 +6522,7 @@ void Compiler::fgMorphCallInlineHelper(GenTreeCall* call, InlineResult* result) // Invoke the compiler to inline the call. // - fgInvokeInlineeCompiler(call, result); + fgInvokeInlineeCompiler(call, result, createdContext); if (result->IsFailure()) { @@ -7196,7 +7235,8 @@ GenTree* Compiler::fgMorphPotentialTailCall(GenTreeCall* call) bool hasStructParam = false; for (unsigned varNum = 0; varNum < lvaCount; varNum++) { - LclVarDsc* varDsc = lvaTable + varNum; + LclVarDsc* varDsc = lvaGetDesc(varNum); + // If the method is marked as an explicit tail call we will skip the // following three hazard checks. // We still must check for any struct parameters and set 'hasStructParam' @@ -8066,7 +8106,7 @@ GenTree* Compiler::fgCreateCallDispatcherAndGetResult(GenTreeCall* orig CORINFO_METHOD_HANDLE dispatcherHnd) { GenTreeCall* callDispatcherNode = - gtNewCallNode(CT_USER_FUNC, dispatcherHnd, TYP_VOID, nullptr, fgMorphStmt->GetILOffsetX()); + gtNewCallNode(CT_USER_FUNC, dispatcherHnd, TYP_VOID, nullptr, fgMorphStmt->GetDebugInfo()); // The dispatcher has signature // void DispatchTailCalls(void* callersRetAddrSlot, void* callTarget, void* retValue) @@ -8085,37 +8125,29 @@ GenTree* Compiler::fgCreateCallDispatcherAndGetResult(GenTreeCall* orig assert(retBufArg->OperIsLocal()); assert(retBufArg->AsLclVarCommon()->GetLclNum() == info.compRetBuffArg); - if (info.compRetBuffDefStack) - { - // Use existing retbuf. - retValArg = retBufArg; - } - else - { - // Caller return buffer argument retBufArg can point to GC heap while the dispatcher expects - // the return value argument retValArg to point to the stack. - // We use a temporary stack allocated return buffer to hold the value during the dispatcher call - // and copy the value back to the caller return buffer after that. - unsigned int tmpRetBufNum = lvaGrabTemp(true DEBUGARG("substitute local for return buffer")); + // Caller return buffer argument retBufArg can point to GC heap while the dispatcher expects + // the return value argument retValArg to point to the stack. + // We use a temporary stack allocated return buffer to hold the value during the dispatcher call + // and copy the value back to the caller return buffer after that. + unsigned int tmpRetBufNum = lvaGrabTemp(true DEBUGARG("substitute local for return buffer")); - constexpr bool unsafeValueClsCheck = false; - lvaSetStruct(tmpRetBufNum, origCall->gtRetClsHnd, unsafeValueClsCheck); - lvaSetVarAddrExposed(tmpRetBufNum DEBUGARG(AddressExposedReason::DISPATCH_RET_BUF)); + constexpr bool unsafeValueClsCheck = false; + lvaSetStruct(tmpRetBufNum, origCall->gtRetClsHnd, unsafeValueClsCheck); + lvaSetVarAddrExposed(tmpRetBufNum DEBUGARG(AddressExposedReason::DISPATCH_RET_BUF)); - var_types tmpRetBufType = lvaGetDesc(tmpRetBufNum)->TypeGet(); + var_types tmpRetBufType = lvaGetDesc(tmpRetBufNum)->TypeGet(); - retValArg = gtNewOperNode(GT_ADDR, TYP_I_IMPL, gtNewLclvNode(tmpRetBufNum, tmpRetBufType)); + retValArg = gtNewOperNode(GT_ADDR, TYP_I_IMPL, gtNewLclvNode(tmpRetBufNum, tmpRetBufType)); - var_types callerRetBufType = lvaGetDesc(info.compRetBuffArg)->TypeGet(); + var_types callerRetBufType = lvaGetDesc(info.compRetBuffArg)->TypeGet(); - GenTree* dstAddr = gtNewLclvNode(info.compRetBuffArg, callerRetBufType); - GenTree* dst = gtNewObjNode(info.compMethodInfo->args.retTypeClass, dstAddr); - GenTree* src = gtNewLclvNode(tmpRetBufNum, tmpRetBufType); + GenTree* dstAddr = gtNewLclvNode(info.compRetBuffArg, callerRetBufType); + GenTree* dst = gtNewObjNode(info.compMethodInfo->args.retTypeClass, dstAddr); + GenTree* src = gtNewLclvNode(tmpRetBufNum, tmpRetBufType); - constexpr bool isVolatile = false; - constexpr bool isCopyBlock = true; - copyToRetBufNode = gtNewBlkOpNode(dst, src, isVolatile, isCopyBlock); - } + constexpr bool isVolatile = false; + constexpr bool isCopyBlock = true; + copyToRetBufNode = gtNewBlkOpNode(dst, src, isVolatile, isCopyBlock); if (origCall->gtType != TYP_VOID) { @@ -8679,14 +8711,14 @@ void Compiler::fgMorphRecursiveFastTailCallIntoLoop(BasicBlock* block, GenTreeCa // Transform recursive tail call into a loop. - Statement* earlyArgInsertionPoint = lastStmt; - IL_OFFSETX callILOffset = lastStmt->GetILOffsetX(); + Statement* earlyArgInsertionPoint = lastStmt; + const DebugInfo& callDI = lastStmt->GetDebugInfo(); // Hoist arg setup statement for the 'this' argument. GenTreeCall::Use* thisArg = recursiveTailCall->gtCallThisArg; if ((thisArg != nullptr) && !thisArg->GetNode()->IsNothingNode() && !thisArg->GetNode()->IsArgPlaceHolderNode()) { - Statement* thisArgStmt = gtNewStmt(thisArg->GetNode(), callILOffset); + Statement* thisArgStmt = gtNewStmt(thisArg->GetNode(), callDI); fgInsertStmtBefore(block, earlyArgInsertionPoint, thisArgStmt); } @@ -8744,7 +8776,7 @@ void Compiler::fgMorphRecursiveFastTailCallIntoLoop(BasicBlock* block, GenTreeCa if ((earlyArg->gtFlags & GTF_LATE_ARG) != 0) { // This is a setup node so we need to hoist it. - Statement* earlyArgStmt = gtNewStmt(earlyArg, callILOffset); + Statement* earlyArgStmt = gtNewStmt(earlyArg, callDI); fgInsertStmtBefore(block, earlyArgInsertionPoint, earlyArgStmt); } else @@ -8758,7 +8790,7 @@ void Compiler::fgMorphRecursiveFastTailCallIntoLoop(BasicBlock* block, GenTreeCa fgAssignRecursiveCallArgToCallerParam(earlyArg, curArgTabEntry, fgGetArgTabEntryParameterLclNum(recursiveTailCall, curArgTabEntry), - block, callILOffset, tmpAssignmentInsertionPoint, + block, callDI, tmpAssignmentInsertionPoint, paramAssignmentInsertionPoint); if ((tmpAssignmentInsertionPoint == lastStmt) && (paramAssignStmt != nullptr)) { @@ -8785,7 +8817,7 @@ void Compiler::fgMorphRecursiveFastTailCallIntoLoop(BasicBlock* block, GenTreeCa fgAssignRecursiveCallArgToCallerParam(lateArg, curArgTabEntry, fgGetArgTabEntryParameterLclNum(recursiveTailCall, curArgTabEntry), - block, callILOffset, tmpAssignmentInsertionPoint, + block, callDI, tmpAssignmentInsertionPoint, paramAssignmentInsertionPoint); if ((tmpAssignmentInsertionPoint == lastStmt) && (paramAssignStmt != nullptr)) @@ -8805,7 +8837,7 @@ void Compiler::fgMorphRecursiveFastTailCallIntoLoop(BasicBlock* block, GenTreeCa var_types thisType = lvaTable[info.compThisArg].TypeGet(); GenTree* arg0 = gtNewLclvNode(lvaArg0Var, thisType); GenTree* arg0Assignment = gtNewAssignNode(arg0, gtNewLclvNode(info.compThisArg, thisType)); - Statement* arg0AssignmentStmt = gtNewStmt(arg0Assignment, callILOffset); + Statement* arg0AssignmentStmt = gtNewStmt(arg0Assignment, callDI); fgInsertStmtBefore(block, paramAssignmentInsertionPoint, arg0AssignmentStmt); } @@ -8847,7 +8879,7 @@ void Compiler::fgMorphRecursiveFastTailCallIntoLoop(BasicBlock* block, GenTreeCa GenTree* zero = gtNewZeroConNode(genActualType(lclType)); init = gtNewAssignNode(lcl, zero); } - Statement* initStmt = gtNewStmt(init, callILOffset); + Statement* initStmt = gtNewStmt(init, callDI); fgInsertStmtBefore(block, lastStmt, initStmt); } } @@ -8897,13 +8929,13 @@ void Compiler::fgMorphRecursiveFastTailCallIntoLoop(BasicBlock* block, GenTreeCa // Return Value: // parameter assignment statement if one was inserted; nullptr otherwise. -Statement* Compiler::fgAssignRecursiveCallArgToCallerParam(GenTree* arg, - fgArgTabEntry* argTabEntry, - unsigned lclParamNum, - BasicBlock* block, - IL_OFFSETX callILOffset, - Statement* tmpAssignmentInsertionPoint, - Statement* paramAssignmentInsertionPoint) +Statement* Compiler::fgAssignRecursiveCallArgToCallerParam(GenTree* arg, + fgArgTabEntry* argTabEntry, + unsigned lclParamNum, + BasicBlock* block, + const DebugInfo& callDI, + Statement* tmpAssignmentInsertionPoint, + Statement* paramAssignmentInsertionPoint) { // Call arguments should be assigned to temps first and then the temps should be assigned to parameters because // some argument trees may reference parameters directly. @@ -8922,7 +8954,7 @@ Statement* Compiler::fgAssignRecursiveCallArgToCallerParam(GenTree* arg, else if (arg->OperGet() == GT_LCL_VAR) { unsigned lclNum = arg->AsLclVar()->GetLclNum(); - LclVarDsc* varDsc = &lvaTable[lclNum]; + LclVarDsc* varDsc = lvaGetDesc(lclNum); if (!varDsc->lvIsParam) { // The argument is a non-parameter local so it doesn't need to be assigned to a temp. @@ -8953,17 +8985,17 @@ Statement* Compiler::fgAssignRecursiveCallArgToCallerParam(GenTree* arg, GenTree* tempSrc = arg; GenTree* tempDest = gtNewLclvNode(tmpNum, tempSrc->gtType); GenTree* tmpAssignNode = gtNewAssignNode(tempDest, tempSrc); - Statement* tmpAssignStmt = gtNewStmt(tmpAssignNode, callILOffset); + Statement* tmpAssignStmt = gtNewStmt(tmpAssignNode, callDI); fgInsertStmtBefore(block, tmpAssignmentInsertionPoint, tmpAssignStmt); argInTemp = gtNewLclvNode(tmpNum, tempSrc->gtType); } // Now assign the temp to the parameter. - LclVarDsc* paramDsc = lvaTable + lclParamNum; + const LclVarDsc* paramDsc = lvaGetDesc(lclParamNum); assert(paramDsc->lvIsParam); GenTree* paramDest = gtNewLclvNode(lclParamNum, paramDsc->lvType); GenTree* paramAssignNode = gtNewAssignNode(paramDest, argInTemp); - paramAssignStmt = gtNewStmt(paramAssignNode, callILOffset); + paramAssignStmt = gtNewStmt(paramAssignNode, callDI); fgInsertStmtBefore(block, paramAssignmentInsertionPoint, paramAssignStmt); } @@ -9015,7 +9047,7 @@ GenTree* Compiler::fgMorphCall(GenTreeCall* call) assg = fgMorphTree(assg); // Create the assignment statement and insert it before the current statement. - Statement* assgStmt = gtNewStmt(assg, compCurStmt->GetILOffsetX()); + Statement* assgStmt = gtNewStmt(assg, compCurStmt->GetDebugInfo()); fgInsertStmtBefore(compCurBB, compCurStmt, assgStmt); // Return the temp. @@ -9116,48 +9148,6 @@ GenTree* Compiler::fgMorphCall(GenTreeCall* call) compCurBB->bbFlags |= BBF_HAS_CALL; // This block has a call - // Make sure that return buffers containing GC pointers that aren't too large are pointers into the stack. - GenTree* origDest = nullptr; // Will only become non-null if we do the transformation (and thus require - // copy-back). - unsigned retValTmpNum = BAD_VAR_NUM; - CORINFO_CLASS_HANDLE structHnd = nullptr; - if (call->HasRetBufArg() && - call->gtCallLateArgs == nullptr) // Don't do this if we're re-morphing (which will make late args non-null). - { - // We're enforcing the invariant that return buffers pointers (at least for - // struct return types containing GC pointers) are never pointers into the heap. - // The large majority of cases are address of local variables, which are OK. - // Otherwise, allocate a local of the given struct type, pass its address, - // then assign from that into the proper destination. (We don't need to do this - // if we're passing the caller's ret buff arg to the callee, since the caller's caller - // will maintain the same invariant.) - - GenTree* dest = call->gtCallArgs->GetNode(); - assert(dest->OperGet() != GT_ARGPLACE); // If it was, we'd be in a remorph, which we've already excluded above. - if (dest->TypeIs(TYP_BYREF) && !dest->IsLocalAddrExpr()) - { - // We'll exempt helper calls from this, assuming that the helper implementation - // follows the old convention, and does whatever barrier is required. - if (call->gtCallType != CT_HELPER) - { - structHnd = call->gtRetClsHnd; - if (info.compCompHnd->isStructRequiringStackAllocRetBuf(structHnd) && - !(dest->OperGet() == GT_LCL_VAR && dest->AsLclVar()->GetLclNum() == info.compRetBuffArg)) - { - // Force re-evaluating the argInfo as the return argument has changed. - call->fgArgInfo = nullptr; - origDest = dest; - - retValTmpNum = lvaGrabTemp(true DEBUGARG("substitute local for ret buff arg")); - lvaSetStruct(retValTmpNum, structHnd, true); - dest = gtNewOperNode(GT_ADDR, TYP_BYREF, gtNewLclvNode(retValTmpNum, TYP_STRUCT)); - } - } - } - - call->gtCallArgs->SetNode(dest); - } - /* Process the "normal" argument list */ call = fgMorphArgs(call); noway_assert(call->gtOper == GT_CALL); @@ -9176,7 +9166,7 @@ GenTree* Compiler::fgMorphCall(GenTreeCall* call) // call->gtControlExpr = fgMorphTree(call->gtControlExpr); - // Propogate any gtFlags into the call + // Propagate any gtFlags into the call call->gtFlags |= call->gtControlExpr->gtFlags; } @@ -9236,10 +9226,8 @@ GenTree* Compiler::fgMorphCall(GenTreeCall* call) fgWalkTreePost(&value, resetMorphedFlag); #endif // DEBUG - GenTree* const nullCheckedArr = impCheckForNullPointer(arr); - GenTree* const arrIndexNode = gtNewIndexRef(TYP_REF, nullCheckedArr, index); - GenTree* const arrStore = gtNewAssignNode(arrIndexNode, value); - arrStore->gtFlags |= GTF_ASG; + GenTree* const arrIndexNode = gtNewIndexRef(TYP_REF, arr, index); + GenTree* const arrStore = gtNewAssignNode(arrIndexNode, value); GenTree* result = fgMorphTree(arrStore); if (argSetup != nullptr) @@ -9254,31 +9242,6 @@ GenTree* Compiler::fgMorphCall(GenTreeCall* call) } } - if (origDest != nullptr) - { - GenTree* retValVarAddr = gtNewOperNode(GT_ADDR, TYP_BYREF, gtNewLclvNode(retValTmpNum, TYP_STRUCT)); - // If the origDest expression was an assignment to a variable, it might be to an otherwise-unused - // var, which would allow the whole assignment to be optimized away to a NOP. So in that case, make the - // origDest into a comma that uses the var. Note that the var doesn't have to be a temp for this to - // be correct. - if (origDest->OperGet() == GT_ASG) - { - if (origDest->AsOp()->gtOp1->OperGet() == GT_LCL_VAR) - { - GenTree* var = origDest->AsOp()->gtOp1; - origDest = gtNewOperNode(GT_COMMA, var->TypeGet(), origDest, - gtNewLclvNode(var->AsLclVar()->GetLclNum(), var->TypeGet())); - } - } - GenTree* copyBlk = gtNewCpObjNode(origDest, retValVarAddr, structHnd, false); - copyBlk = fgMorphTree(copyBlk); - GenTree* result = gtNewOperNode(GT_COMMA, TYP_VOID, call, copyBlk); -#ifdef DEBUG - result->gtDebugFlags |= GTF_DEBUG_NODE_MORPHED; -#endif - return result; - } - if (call->IsNoReturn()) { // @@ -9374,14 +9337,15 @@ GenTree* Compiler::fgExpandVirtualVtableCallTarget(GenTreeCall* call) // [tmp + vtabOffsOfIndirection] GenTree* tmpTree1 = gtNewOperNode(GT_ADD, TYP_I_IMPL, gtNewLclvNode(varNum1, TYP_I_IMPL), - gtNewIconNode(vtabOffsOfIndirection, TYP_INT)); + gtNewIconNode(vtabOffsOfIndirection, TYP_I_IMPL)); tmpTree1 = gtNewOperNode(GT_IND, TYP_I_IMPL, tmpTree1, false); tmpTree1->gtFlags |= GTF_IND_NONFAULTING; tmpTree1->gtFlags |= GTF_IND_INVARIANT; // var1 + vtabOffsOfIndirection + vtabOffsAfterIndirection - GenTree* tmpTree2 = gtNewOperNode(GT_ADD, TYP_I_IMPL, gtNewLclvNode(varNum1, TYP_I_IMPL), - gtNewIconNode(vtabOffsOfIndirection + vtabOffsAfterIndirection, TYP_INT)); + GenTree* tmpTree2 = + gtNewOperNode(GT_ADD, TYP_I_IMPL, gtNewLclvNode(varNum1, TYP_I_IMPL), + gtNewIconNode(vtabOffsOfIndirection + vtabOffsAfterIndirection, TYP_I_IMPL)); // var1 + vtabOffsOfIndirection + vtabOffsAfterIndirection + [var1 + vtabOffsOfIndirection] tmpTree2 = gtNewOperNode(GT_ADD, TYP_I_IMPL, tmpTree2, tmpTree1); @@ -9400,7 +9364,7 @@ GenTree* Compiler::fgExpandVirtualVtableCallTarget(GenTreeCall* call) else { // result = [vtab + vtabOffsOfIndirection] - result = gtNewOperNode(GT_ADD, TYP_I_IMPL, vtab, gtNewIconNode(vtabOffsOfIndirection, TYP_INT)); + result = gtNewOperNode(GT_ADD, TYP_I_IMPL, vtab, gtNewIconNode(vtabOffsOfIndirection, TYP_I_IMPL)); result = gtNewOperNode(GT_IND, TYP_I_IMPL, result, false); result->gtFlags |= GTF_IND_NONFAULTING; result->gtFlags |= GTF_IND_INVARIANT; @@ -9416,7 +9380,7 @@ GenTree* Compiler::fgExpandVirtualVtableCallTarget(GenTreeCall* call) { // Load the function address // result = [result + vtabOffsAfterIndirection] - result = gtNewOperNode(GT_ADD, TYP_I_IMPL, result, gtNewIconNode(vtabOffsAfterIndirection, TYP_INT)); + result = gtNewOperNode(GT_ADD, TYP_I_IMPL, result, gtNewIconNode(vtabOffsAfterIndirection, TYP_I_IMPL)); // This last indirection is not invariant, but is non-faulting result = gtNewOperNode(GT_IND, TYP_I_IMPL, result, false); result->gtFlags |= GTF_IND_NONFAULTING; @@ -9705,7 +9669,7 @@ GenTree* Compiler::fgMorphOneAsgBlockOp(GenTree* tree) if (impIsAddressInLocal(lhsBlk->Addr(), &destLclVarTree)) { destVarNum = destLclVarTree->AsLclVarCommon()->GetLclNum(); - destVarDsc = &(lvaTable[destVarNum]); + destVarDsc = lvaGetDesc(destVarNum); } if (lhsBlk->OperGet() == GT_OBJ) { @@ -9741,7 +9705,7 @@ GenTree* Compiler::fgMorphOneAsgBlockOp(GenTree* tree) if (destLclVarTree != nullptr) { destVarNum = destLclVarTree->AsLclVarCommon()->GetLclNum(); - destVarDsc = &(lvaTable[destVarNum]); + destVarDsc = lvaGetDesc(destVarNum); if (asgType == TYP_STRUCT) { clsHnd = destVarDsc->GetStructHnd(); @@ -9833,11 +9797,11 @@ GenTree* Compiler::fgMorphOneAsgBlockOp(GenTree* tree) if (src->OperGet() == GT_LCL_VAR) { srcLclVarTree = src; - srcVarDsc = &(lvaTable[src->AsLclVarCommon()->GetLclNum()]); + srcVarDsc = lvaGetDesc(src->AsLclVarCommon()); } else if (src->OperIsIndir() && impIsAddressInLocal(src->AsOp()->gtOp1, &srcLclVarTree)) { - srcVarDsc = &(lvaTable[srcLclVarTree->AsLclVarCommon()->GetLclNum()]); + srcVarDsc = lvaGetDesc(srcLclVarTree->AsLclVarCommon()); } if ((srcVarDsc != nullptr) && varTypeIsStruct(srcLclVarTree) && srcVarDsc->lvPromoted) { @@ -10014,15 +9978,14 @@ GenTree* Compiler::fgMorphOneAsgBlockOp(GenTree* tree) } else // InitBlk { -#if FEATURE_SIMD +#ifdef FEATURE_SIMD if (varTypeIsSIMD(asgType)) { assert(!isCopyBlock); // Else we would have returned the tree above. noway_assert(src->IsIntegralConst(0)); noway_assert(destVarDsc != nullptr); - src = new (this, GT_SIMD) - GenTreeSIMD(asgType, src, SIMDIntrinsicInit, destVarDsc->GetSimdBaseJitType(), size); + src = gtNewSIMDNode(asgType, src, SIMDIntrinsicInit, destVarDsc->GetSimdBaseJitType(), size); } else #endif @@ -10423,7 +10386,7 @@ GenTree* Compiler::fgMorphBlockOperand(GenTree* tree, var_types asgType, unsigne if (lclNode != nullptr) { - LclVarDsc* varDsc = &(lvaTable[lclNode->GetLclNum()]); + const LclVarDsc* varDsc = lvaGetDesc(lclNode); if (varTypeIsStruct(varDsc) && (varDsc->lvExactSize == blockWidth) && (varDsc->lvType == asgType)) { if (effectiveVal != lclNode) @@ -10496,7 +10459,7 @@ GenTree* Compiler::fgMorphBlockOperand(GenTree* tree, var_types asgType, unsigne // false otherwise. // // Notes: -// This check is needed to avoid accesing LCL_VARs with incorrect +// This check is needed to avoid accessing LCL_VARs with incorrect // CORINFO_FIELD_HANDLE that would confuse VN optimizations. // bool Compiler::fgMorphCanUseLclFldForCopy(unsigned lclNum1, unsigned lclNum2) @@ -10633,8 +10596,7 @@ GenTree* Compiler::getSIMDStructFromField(GenTree* tree, if (isSIMDTypeLocal(obj)) { - unsigned lclNum = obj->AsLclVarCommon()->GetLclNum(); - LclVarDsc* varDsc = &lvaTable[lclNum]; + LclVarDsc* varDsc = lvaGetDesc(obj->AsLclVarCommon()); if (varDsc->lvIsUsedInSIMDIntrinsic() || ignoreUsedInSIMDIntrinsic) { *simdSizeOut = varDsc->lvExactSize; @@ -10713,9 +10675,6 @@ GenTree* Compiler::fgMorphFieldToSimdGetElement(GenTree* tree) tree = gtNewSimdGetElementNode(simdBaseType, simdStructNode, op2, simdBaseJitType, simdSize, /* isSimdAsHWIntrinsic */ true); -#ifdef DEBUG - tree->gtDebugFlags |= GTF_DEBUG_NODE_MORPHED; -#endif } return tree; } @@ -10899,7 +10858,8 @@ GenTree* Compiler::fgMorphCastedBitwiseOp(GenTreeOp* tree) var_types toType = op1->AsCast()->CastToType(); bool isUnsigned = op1->IsUnsigned(); - if ((op2->CastFromType() != fromType) || (op2->CastToType() != toType) || (op2->IsUnsigned() != isUnsigned)) + if (varTypeIsFloating(fromType) || (op2->CastFromType() != fromType) || (op2->CastToType() != toType) || + (op2->IsUnsigned() != isUnsigned)) { return nullptr; } @@ -11034,7 +10994,6 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) if (op1->OperKind() & GTK_RELOP) { - noway_assert((oper == GT_JTRUE) || (op1->gtFlags & GTF_RELOP_QMARK)); /* Mark the comparison node with GTF_RELOP_JMP_USED so it knows that it does not need to materialize the result as a 0 or 1. */ @@ -11531,9 +11490,6 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) } break; #endif - case GT_LIST: - // Special handling for the arg list. - return fgMorphArgList(tree->AsArgList(), mac); case GT_PUTARG_TYPE: return fgMorphTree(tree->AsUnOp()->gtGetOp1()); @@ -12007,12 +11963,6 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) effectiveOp1 = op1->gtEffectiveVal(); - if (effectiveOp1->OperIsConst()) - { - op1 = gtNewOperNode(GT_IND, tree->TypeGet(), op1); - tree->AsOp()->gtOp1 = op1; - } - // If we are storing a small type, we might be able to omit a cast. if (effectiveOp1->OperIs(GT_IND) && varTypeIsSmall(effectiveOp1)) { @@ -12332,27 +12282,9 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) if (op2->IsCnsIntOrI() && varTypeIsIntegralOrI(typ)) { - CLANG_FORMAT_COMMENT_ANCHOR; - // Fold (x + 0). - if ((op2->AsIntConCommon()->IconValue() == 0) && !gtIsActiveCSE_Candidate(tree)) { - - // If this addition is adding an offset to a null pointer, - // avoid the work and yield the null pointer immediately. - // Dereferencing the pointer in either case will have the - // same effect. - - if (!optValnumCSE_phase && varTypeIsGC(op2->TypeGet()) && - ((op1->gtFlags & GTF_ALL_EFFECT) == 0)) - { - op2->gtType = tree->gtType; - DEBUG_DESTROY_NODE(op1); - DEBUG_DESTROY_NODE(tree); - return op2; - } - // Remove the addition iff it won't change the tree type // to TYP_REF. @@ -12706,7 +12638,7 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) else if (temp->OperIsLocal()) { unsigned lclNum = temp->AsLclVarCommon()->GetLclNum(); - LclVarDsc* varDsc = &lvaTable[lclNum]; + LclVarDsc* varDsc = lvaGetDesc(lclNum); // We will try to optimize when we have a promoted struct promoted with a zero lvFldOffset if (varDsc->lvPromoted && (varDsc->lvFldOffset == 0)) @@ -12718,7 +12650,7 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) { unsigned lclNumFld = varDsc->lvFieldLclStart; // just grab the promoted field - LclVarDsc* fieldVarDsc = &lvaTable[lclNumFld]; + LclVarDsc* fieldVarDsc = lvaGetDesc(lclNumFld); // Also make sure that the tree type matches the fieldVarType and that it's lvFldOffset // is zero @@ -12879,7 +12811,7 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) assert(temp->OperIsLocal()); const unsigned lclNum = temp->AsLclVarCommon()->GetLclNum(); - LclVarDsc* const varDsc = &lvaTable[lclNum]; + LclVarDsc* const varDsc = lvaGetDesc(lclNum); const var_types tempTyp = temp->TypeGet(); const bool useExactSize = varTypeIsStruct(tempTyp) || (tempTyp == TYP_BLK) || (tempTyp == TYP_LCLBLK); @@ -13090,15 +13022,6 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) return addr; } - else if (op1->gtOper == GT_CAST) - { - GenTree* casting = op1->AsCast()->CastOp(); - if (casting->gtOper == GT_LCL_VAR || casting->gtOper == GT_CLS_VAR) - { - DEBUG_DESTROY_NODE(op1); - tree->AsOp()->gtOp1 = op1 = casting; - } - } else if ((op1->gtOper == GT_COMMA) && !optValnumCSE_phase) { // Perform the transform ADDR(COMMA(x, ..., z)) == COMMA(x, ..., ADDR(z)). @@ -13269,7 +13192,7 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) // Propagate comma throws. // If we are in the Valuenum CSE phase then don't morph away anything as these // nodes may have CSE defs/uses in them. - if (fgGlobalMorph && (oper != GT_ASG) && (oper != GT_COLON) && !tree->OperIsAnyList()) + if (fgGlobalMorph && (oper != GT_ASG) && (oper != GT_COLON)) { if ((op1 != nullptr) && fgIsCommaThrow(op1, true)) { @@ -13509,7 +13432,7 @@ GenTree* Compiler::fgOptimizeEqualityComparisonWithConst(GenTreeOp* cmp) } noway_assert((op1->gtFlags & GTF_RELOP_JMP_USED) == 0); - op1->gtFlags |= cmp->gtFlags & (GTF_RELOP_JMP_USED | GTF_RELOP_QMARK | GTF_DONT_CSE); + op1->gtFlags |= cmp->gtFlags & (GTF_RELOP_JMP_USED | GTF_DONT_CSE); op1->SetVNsFromNode(cmp); DEBUG_DESTROY_NODE(cmp); @@ -14190,52 +14113,72 @@ GenTree* Compiler::fgMorphSmpOpOptional(GenTreeOp* tree) } break; + default: + break; + } + return tree; +} + +#if defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) +//------------------------------------------------------------------------ +// fgMorphMultiOp: Morph a GenTreeMultiOp (SIMD/HWINTRINSIC) tree. +// +// Arguments: +// multiOp - The tree to morph +// +// Return Value: +// The fully morphed tree. +// +GenTree* Compiler::fgMorphMultiOp(GenTreeMultiOp* multiOp) +{ + gtUpdateNodeOperSideEffects(multiOp); + for (GenTree** use : multiOp->UseEdges()) + { + *use = fgMorphTree(*use); + multiOp->gtFlags |= ((*use)->gtFlags & GTF_ALL_EFFECT); + } + #if defined(FEATURE_HW_INTRINSICS) && defined(TARGET_XARCH) - case GT_HWINTRINSIC: + if (opts.OptimizationEnabled() && multiOp->OperIs(GT_HWINTRINSIC)) + { + GenTreeHWIntrinsic* hw = multiOp->AsHWIntrinsic(); + switch (hw->GetHWIntrinsicId()) { - GenTreeHWIntrinsic* hw = tree->AsHWIntrinsic(); - switch (hw->gtHWIntrinsicId) + case NI_SSE_Xor: + case NI_SSE2_Xor: + case NI_AVX_Xor: + case NI_AVX2_Xor: { - case NI_SSE_Xor: - case NI_SSE2_Xor: - case NI_AVX_Xor: - case NI_AVX2_Xor: + // Transform XOR(X, 0) to X for vectors + GenTree* op1 = hw->Op(1); + GenTree* op2 = hw->Op(2); + if (!gtIsActiveCSE_Candidate(hw)) { - // Transform XOR(X, 0) to X for vectors - GenTree* op1 = hw->gtGetOp1(); - GenTree* op2 = hw->gtGetOp2(); - if (!gtIsActiveCSE_Candidate(tree)) + if (op1->IsIntegralConstVector(0) && !gtIsActiveCSE_Candidate(op1)) { - if (op1->IsIntegralConstVector(0) && !gtIsActiveCSE_Candidate(op1)) - { - DEBUG_DESTROY_NODE(tree); - DEBUG_DESTROY_NODE(op1); - INDEBUG(op2->gtDebugFlags |= GTF_DEBUG_NODE_MORPHED); - return op2; - } - if (op2->IsIntegralConstVector(0) && !gtIsActiveCSE_Candidate(op2)) - { - DEBUG_DESTROY_NODE(tree); - DEBUG_DESTROY_NODE(op2); - INDEBUG(op1->gtDebugFlags |= GTF_DEBUG_NODE_MORPHED); - return op1; - } + DEBUG_DESTROY_NODE(hw); + DEBUG_DESTROY_NODE(op1); + return op2; + } + if (op2->IsIntegralConstVector(0) && !gtIsActiveCSE_Candidate(op2)) + { + DEBUG_DESTROY_NODE(hw); + DEBUG_DESTROY_NODE(op2); + return op1; } - break; } - - default: - break; + break; } - break; + + default: + break; } + } #endif // defined(FEATURE_HW_INTRINSICS) && defined(TARGET_XARCH) - default: - break; - } - return tree; + return multiOp; } +#endif // defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) //------------------------------------------------------------------------ // fgMorphModToSubMulDiv: Transform a % b into the equivalent a - (a / b) * b @@ -14530,7 +14473,7 @@ GenTree* Compiler::fgRecognizeAndMorphBitwiseRotation(GenTree* tree) { noway_assert(GenTree::OperIsRotate(rotateOp)); - unsigned inputTreeEffects = tree->gtFlags & GTF_ALL_EFFECT; + GenTreeFlags inputTreeEffects = tree->gtFlags & GTF_ALL_EFFECT; // We can use the same tree only during global morph; reusing the tree in a later morph // may invalidate value numbers. @@ -14806,6 +14749,17 @@ GenTree* Compiler::fgMorphTree(GenTree* tree, MorphAddrContext* mac) tree = fgMorphCall(tree->AsCall()); break; +#if defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) +#if defined(FEATURE_SIMD) + case GT_SIMD: +#endif +#if defined(FEATURE_HW_INTRINSICS) + case GT_HWINTRINSIC: +#endif + tree = fgMorphMultiOp(tree->AsMultiOp()); + break; +#endif // defined(FEATURE_SIMD) || defined(FEATURE_HW_INTRINSICS) + case GT_ARR_ELEM: tree->AsArrElem()->gtArrObj = fgMorphTree(tree->AsArrElem()->gtArrObj); @@ -14968,7 +14922,7 @@ void Compiler::fgKillDependentAssertionsSingle(unsigned lclNum DEBUGARG(GenTree* // void Compiler::fgKillDependentAssertions(unsigned lclNum DEBUGARG(GenTree* tree)) { - LclVarDsc* varDsc = &lvaTable[lclNum]; + LclVarDsc* varDsc = lvaGetDesc(lclNum); if (varDsc->lvPromoted) { @@ -15313,17 +15267,14 @@ bool Compiler::fgFoldConditional(BasicBlock* block) * Remove the loop from the table */ optLoopTable[loopNum].lpFlags |= LPFLG_REMOVED; -#if FEATURE_LOOP_ALIGN - optLoopTable[loopNum].lpFirst->bbFlags &= ~BBF_LOOP_ALIGN; - JITDUMP("Removing LOOP_ALIGN flag from bogus loop in " FMT_BB "\n", - optLoopTable[loopNum].lpFirst->bbNum); -#endif + + optLoopTable[loopNum].lpTop->unmarkLoopAlign(this DEBUG_ARG("Bogus loop")); #ifdef DEBUG if (verbose) { printf("Removing loop " FMT_LP " (from " FMT_BB " to " FMT_BB ")\n\n", loopNum, - optLoopTable[loopNum].lpFirst->bbNum, optLoopTable[loopNum].lpBottom->bbNum); + optLoopTable[loopNum].lpTop->bbNum, optLoopTable[loopNum].lpBottom->bbNum); } #endif } @@ -15978,9 +15929,9 @@ void Compiler::fgMergeBlockReturn(BasicBlock* block) noway_assert(ret->OperGet() == GT_RETURN); noway_assert(ret->gtGetOp1() != nullptr); - Statement* pAfterStatement = lastStmt; - IL_OFFSETX offset = lastStmt->GetILOffsetX(); - GenTree* tree = gtNewTempAssign(genReturnLocal, ret->gtGetOp1(), &pAfterStatement, offset, block); + Statement* pAfterStatement = lastStmt; + const DebugInfo& di = lastStmt->GetDebugInfo(); + GenTree* tree = gtNewTempAssign(genReturnLocal, ret->gtGetOp1(), &pAfterStatement, di, block); if (tree->OperIsCopyBlkOp()) { tree = fgMorphCopyBlock(tree); @@ -15998,7 +15949,7 @@ void Compiler::fgMergeBlockReturn(BasicBlock* block) { // gtNewTempAssign inserted additional statements after last fgRemoveStmt(block, lastStmt); - Statement* newStmt = gtNewStmt(tree, offset); + Statement* newStmt = gtNewStmt(tree, di); fgInsertStmtAfter(block, pAfterStatement, newStmt); lastStmt = newStmt; } @@ -16379,9 +16330,6 @@ void Compiler::fgExpandQmarkForCastInstOf(BasicBlock* block, Statement* stmt) cond2Expr = nestedQmark->gtGetOp1(); true2Expr = nestedQmark->gtGetOp2()->AsColon()->ThenNode(); false2Expr = nestedQmark->gtGetOp2()->AsColon()->ElseNode(); - - assert(cond2Expr->gtFlags & GTF_RELOP_QMARK); - cond2Expr->gtFlags &= ~GTF_RELOP_QMARK; } else { @@ -16399,10 +16347,6 @@ void Compiler::fgExpandQmarkForCastInstOf(BasicBlock* block, Statement* stmt) } assert(false2Expr->OperGet() == trueExpr->OperGet()); - // Clear flags as they are now going to be part of JTRUE. - assert(condExpr->gtFlags & GTF_RELOP_QMARK); - condExpr->gtFlags &= ~GTF_RELOP_QMARK; - // Create the chain of blocks. See method header comment. // The order of blocks after this is the following: // block ... asgBlock ... cond1Block ... cond2Block ... helperBlock ... remainderBlock @@ -16456,23 +16400,23 @@ void Compiler::fgExpandQmarkForCastInstOf(BasicBlock* block, Statement* stmt) // Append cond1 as JTRUE to cond1Block GenTree* jmpTree = gtNewOperNode(GT_JTRUE, TYP_VOID, condExpr); - Statement* jmpStmt = fgNewStmtFromTree(jmpTree, stmt->GetILOffsetX()); + Statement* jmpStmt = fgNewStmtFromTree(jmpTree, stmt->GetDebugInfo()); fgInsertStmtAtEnd(cond1Block, jmpStmt); // Append cond2 as JTRUE to cond2Block jmpTree = gtNewOperNode(GT_JTRUE, TYP_VOID, cond2Expr); - jmpStmt = fgNewStmtFromTree(jmpTree, stmt->GetILOffsetX()); + jmpStmt = fgNewStmtFromTree(jmpTree, stmt->GetDebugInfo()); fgInsertStmtAtEnd(cond2Block, jmpStmt); // AsgBlock should get tmp = op1 assignment. trueExpr = gtNewTempAssign(dst->AsLclVarCommon()->GetLclNum(), trueExpr); - Statement* trueStmt = fgNewStmtFromTree(trueExpr, stmt->GetILOffsetX()); + Statement* trueStmt = fgNewStmtFromTree(trueExpr, stmt->GetDebugInfo()); fgInsertStmtAtEnd(asgBlock, trueStmt); // Since we are adding helper in the JTRUE false path, reverse the cond2 and add the helper. gtReverseCond(cond2Expr); GenTree* helperExpr = gtNewTempAssign(dst->AsLclVarCommon()->GetLclNum(), true2Expr); - Statement* helperStmt = fgNewStmtFromTree(helperExpr, stmt->GetILOffsetX()); + Statement* helperStmt = fgNewStmtFromTree(helperExpr, stmt->GetDebugInfo()); fgInsertStmtAtEnd(helperBlock, helperStmt); // Finally remove the nested qmark stmt. @@ -16573,9 +16517,6 @@ void Compiler::fgExpandQmarkStmt(BasicBlock* block, Statement* stmt) GenTree* trueExpr = qmark->gtGetOp2()->AsColon()->ThenNode(); GenTree* falseExpr = qmark->gtGetOp2()->AsColon()->ElseNode(); - assert(condExpr->gtFlags & GTF_RELOP_QMARK); - condExpr->gtFlags &= ~GTF_RELOP_QMARK; - assert(!varTypeIsFloating(condExpr->TypeGet())); bool hasTrueExpr = (trueExpr->OperGet() != GT_NOP); @@ -16674,7 +16615,7 @@ void Compiler::fgExpandQmarkStmt(BasicBlock* block, Statement* stmt) } GenTree* jmpTree = gtNewOperNode(GT_JTRUE, TYP_VOID, qmark->gtGetOp1()); - Statement* jmpStmt = fgNewStmtFromTree(jmpTree, stmt->GetILOffsetX()); + Statement* jmpStmt = fgNewStmtFromTree(jmpTree, stmt->GetDebugInfo()); fgInsertStmtAtEnd(condBlock, jmpStmt); // Remove the original qmark statement. @@ -16700,7 +16641,7 @@ void Compiler::fgExpandQmarkStmt(BasicBlock* block, Statement* stmt) { trueExpr = gtNewTempAssign(lclNum, trueExpr); } - Statement* trueStmt = fgNewStmtFromTree(trueExpr, stmt->GetILOffsetX()); + Statement* trueStmt = fgNewStmtFromTree(trueExpr, stmt->GetDebugInfo()); fgInsertStmtAtEnd(thenBlock, trueStmt); } @@ -16711,7 +16652,7 @@ void Compiler::fgExpandQmarkStmt(BasicBlock* block, Statement* stmt) { falseExpr = gtNewTempAssign(lclNum, falseExpr); } - Statement* falseStmt = fgNewStmtFromTree(falseExpr, stmt->GetILOffsetX()); + Statement* falseStmt = fgNewStmtFromTree(falseExpr, stmt->GetDebugInfo()); fgInsertStmtAtEnd(elseBlock, falseStmt); } @@ -16859,7 +16800,7 @@ void Compiler::fgPromoteStructs() { // Whether this var got promoted bool promotedVar = false; - LclVarDsc* varDsc = &lvaTable[lclNum]; + LclVarDsc* varDsc = lvaGetDesc(lclNum); // If we have marked this as lvUsedInSIMDIntrinsic, then we do not want to promote // its fields. Instead, we will attempt to enregister the entire struct. @@ -16914,7 +16855,7 @@ void Compiler::fgMorphStructField(GenTree* tree, GenTree* parent) if ((obj != nullptr) && (obj->gtOper == GT_LCL_VAR)) { unsigned lclNum = obj->AsLclVarCommon()->GetLclNum(); - const LclVarDsc* varDsc = &lvaTable[lclNum]; + const LclVarDsc* varDsc = lvaGetDesc(lclNum); if (varTypeIsStruct(obj)) { @@ -16931,7 +16872,7 @@ void Compiler::fgMorphStructField(GenTree* tree, GenTree* parent) return; } - const LclVarDsc* fieldDsc = &lvaTable[fieldLclIndex]; + const LclVarDsc* fieldDsc = lvaGetDesc(fieldLclIndex); var_types fieldType = fieldDsc->TypeGet(); assert(fieldType != TYP_STRUCT); // promoted LCL_VAR can't have a struct type. @@ -17092,7 +17033,7 @@ void Compiler::fgMorphLocalField(GenTree* tree, GenTree* parent) noway_assert(tree->OperGet() == GT_LCL_FLD); unsigned lclNum = tree->AsLclFld()->GetLclNum(); - LclVarDsc* varDsc = &lvaTable[lclNum]; + LclVarDsc* varDsc = lvaGetDesc(lclNum); if (varTypeIsStruct(varDsc)) { @@ -17107,7 +17048,7 @@ void Compiler::fgMorphLocalField(GenTree* tree, GenTree* parent) { fieldLclIndex = lvaGetFieldLocal(varDsc, fldOffset); noway_assert(fieldLclIndex != BAD_VAR_NUM); - fldVarDsc = &lvaTable[fieldLclIndex]; + fldVarDsc = lvaGetDesc(fieldLclIndex); } var_types treeType = tree->TypeGet(); @@ -17209,7 +17150,7 @@ void Compiler::fgRetypeImplicitByRefArgs() for (unsigned lclNum = 0; lclNum < info.compArgsCount; lclNum++) { - LclVarDsc* varDsc = &lvaTable[lclNum]; + LclVarDsc* varDsc = lvaGetDesc(lclNum); if (lvaIsImplicitByRefLocal(lclNum)) { @@ -17237,10 +17178,10 @@ void Compiler::fgRetypeImplicitByRefArgs() } // Update varDsc since lvaGrabTemp might have re-allocated the var dsc array. - varDsc = &lvaTable[lclNum]; + varDsc = lvaGetDesc(lclNum); // Copy the struct promotion annotations to the new temp. - LclVarDsc* newVarDsc = &lvaTable[newLclNum]; + LclVarDsc* newVarDsc = lvaGetDesc(newLclNum); newVarDsc->lvPromoted = true; newVarDsc->lvFieldLclStart = varDsc->lvFieldLclStart; newVarDsc->lvFieldCnt = varDsc->lvFieldCnt; @@ -17316,7 +17257,7 @@ void Compiler::fgRetypeImplicitByRefArgs() for (unsigned fieldLclNum = fieldLclStart; fieldLclNum < fieldLclStop; ++fieldLclNum) { - LclVarDsc* fieldVarDsc = &lvaTable[fieldLclNum]; + LclVarDsc* fieldVarDsc = lvaGetDesc(fieldLclNum); if (undoPromotion) { @@ -17415,7 +17356,7 @@ void Compiler::fgMarkDemotedImplicitByRefArgs() for (unsigned lclNum = 0; lclNum < info.compArgsCount; lclNum++) { - LclVarDsc* varDsc = &lvaTable[lclNum]; + LclVarDsc* varDsc = lvaGetDesc(lclNum); if (lvaIsImplicitByRefLocal(lclNum)) { @@ -17444,7 +17385,7 @@ void Compiler::fgMarkDemotedImplicitByRefArgs() // The temp struct is now unused; set flags appropriately so that we // won't allocate space for it on the stack. - LclVarDsc* structVarDsc = &lvaTable[structLclNum]; + LclVarDsc* structVarDsc = lvaGetDesc(structLclNum); structVarDsc->CleanAddressExposed(); #ifdef DEBUG structVarDsc->lvUnusedStruct = true; @@ -17460,7 +17401,7 @@ void Compiler::fgMarkDemotedImplicitByRefArgs() JITDUMP("Fixing pointer for field V%02d from V%02d to V%02d\n", fieldLclNum, lclNum, structLclNum); // Fix the pointer to the parent local. - LclVarDsc* fieldVarDsc = &lvaTable[fieldLclNum]; + LclVarDsc* fieldVarDsc = lvaGetDesc(fieldLclNum); assert(fieldVarDsc->lvParentLcl == lclNum); fieldVarDsc->lvParentLcl = structLclNum; @@ -17531,7 +17472,7 @@ GenTree* Compiler::fgMorphImplicitByRefArgs(GenTree* tree, bool isAddr) GenTree* lclVarTree = isAddr ? tree->AsOp()->gtOp1 : tree; unsigned lclNum = lclVarTree->AsLclVarCommon()->GetLclNum(); - LclVarDsc* lclVarDsc = &lvaTable[lclNum]; + LclVarDsc* lclVarDsc = lvaGetDesc(lclNum); CORINFO_FIELD_HANDLE fieldHnd; unsigned fieldOffset = 0; @@ -17570,7 +17511,7 @@ GenTree* Compiler::fgMorphImplicitByRefArgs(GenTree* tree, bool isAddr) assert(fieldHnd != nullptr); // Update lclNum/lclVarDsc to refer to the parameter lclNum = lclVarDsc->lvParentLcl; - lclVarDsc = &lvaTable[lclNum]; + lclVarDsc = lvaGetDesc(lclNum); fieldRefType = lclVarTree->TypeGet(); } else @@ -18076,64 +18017,3 @@ bool Compiler::fgCanTailCallViaJitHelper() return true; #endif } - -static const int numberOfTrackedFlags = 5; -static const GenTreeFlags trackedFlags[numberOfTrackedFlags] = {GTF_ASG, GTF_CALL, GTF_EXCEPT, GTF_GLOB_REF, - GTF_ORDER_SIDEEFF}; - -//------------------------------------------------------------------------ -// fgMorphArgList: morph argument list tree without recursion. -// -// Arguments: -// args - argument list tree to morph; -// mac - morph address context, used to morph children. -// -// Return Value: -// morphed argument list. -// -GenTreeArgList* Compiler::fgMorphArgList(GenTreeArgList* args, MorphAddrContext* mac) -{ - // Use a non-recursive algorithm that morphs all actual list values, - // memorizes the last node for each effect flag and resets - // them during the second iteration. - assert((trackedFlags[0] | trackedFlags[1] | trackedFlags[2] | trackedFlags[3] | trackedFlags[4]) == GTF_ALL_EFFECT); - - GenTree* memorizedLastNodes[numberOfTrackedFlags] = {nullptr}; - - for (GenTreeArgList* listNode = args; listNode != nullptr; listNode = listNode->Rest()) - { - // Morph actual list values. - GenTree*& arg = listNode->Current(); - arg = fgMorphTree(arg, mac); - - // Remember the last list node with each flag. - for (int i = 0; i < numberOfTrackedFlags; ++i) - { - if ((arg->gtFlags & trackedFlags[i]) != 0) - { - memorizedLastNodes[i] = listNode; - } - } - } - - for (GenTreeArgList* listNode = args; listNode != nullptr; listNode = listNode->Rest()) - { - // Clear all old effects from the list node. - listNode->gtFlags &= ~GTF_ALL_EFFECT; - - // Spread each flag to all list nodes (to the prefix) before the memorized last node. - for (int i = 0; i < numberOfTrackedFlags; ++i) - { - if (memorizedLastNodes[i] != nullptr) - { - listNode->gtFlags |= trackedFlags[i]; - } - if (listNode == memorizedLastNodes[i]) - { - memorizedLastNodes[i] = nullptr; - } - } - } - - return args; -} diff --git a/src/coreclr/jit/morphblock.cpp b/src/coreclr/jit/morphblock.cpp index fdd0e90b24a380..a8482726a5da23 100644 --- a/src/coreclr/jit/morphblock.cpp +++ b/src/coreclr/jit/morphblock.cpp @@ -189,7 +189,7 @@ GenTree* MorphInitBlockHelper::Morph() // with information about it. // // Notes: -// When assertion propogation is enabled this method kills assertions about the dst local, +// When assertion propagation is enabled this method kills assertions about the dst local, // so the correctness depends on `IsLocalAddrExpr` recognizing all patterns. // void MorphInitBlockHelper::PrepareDst() diff --git a/src/coreclr/jit/namedintrinsiclist.h b/src/coreclr/jit/namedintrinsiclist.h index 8a0af00d3ec47b..62ebb80c089994 100644 --- a/src/coreclr/jit/namedintrinsiclist.h +++ b/src/coreclr/jit/namedintrinsiclist.h @@ -61,6 +61,9 @@ enum NamedIntrinsic : unsigned short NI_System_Array_GetUpperBound, NI_System_Object_MemberwiseClone, + NI_System_Runtime_CompilerServices_RuntimeHelpers_CreateSpan, + NI_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray, + NI_System_String_get_Chars, NI_System_String_get_Length, NI_System_Span_get_Item, diff --git a/src/coreclr/jit/objectalloc.cpp b/src/coreclr/jit/objectalloc.cpp index fc238be39dfa69..0c66dd39a17736 100644 --- a/src/coreclr/jit/objectalloc.cpp +++ b/src/coreclr/jit/objectalloc.cpp @@ -283,7 +283,7 @@ void ObjectAllocator::ComputeStackObjectPointers(BitVecTraits* bitVecTraits) changed = false; for (unsigned int lclNum = 0; lclNum < comp->lvaCount; ++lclNum) { - LclVarDsc* lclVarDsc = comp->lvaTable + lclNum; + LclVarDsc* lclVarDsc = comp->lvaGetDesc(lclNum); var_types type = lclVarDsc->TypeGet(); if (type == TYP_REF || type == TYP_I_IMPL || type == TYP_BYREF) @@ -883,7 +883,7 @@ void ObjectAllocator::RewriteUses() const unsigned int lclNum = tree->AsLclVarCommon()->GetLclNum(); unsigned int newLclNum = BAD_VAR_NUM; - LclVarDsc* lclVarDsc = m_compiler->lvaTable + lclNum; + LclVarDsc* lclVarDsc = m_compiler->lvaGetDesc(lclNum); if ((lclNum < BitVecTraits::GetSize(&m_allocator->m_bitVecTraits)) && m_allocator->MayLclVarPointToStack(lclNum)) diff --git a/src/coreclr/jit/optcse.cpp b/src/coreclr/jit/optcse.cpp index 9aee78d68efca7..b6dadaac185771 100644 --- a/src/coreclr/jit/optcse.cpp +++ b/src/coreclr/jit/optcse.cpp @@ -655,6 +655,7 @@ unsigned Compiler::optValnumCSE_Index(GenTree* tree, Statement* stmt) } } + hval = optCSEKeyToHashIndex(key, newOptCSEhashSize); optCSEhash = newOptCSEhash; optCSEhashSize = newOptCSEhashSize; optCSEhashMaxCountBeforeResize = optCSEhashMaxCountBeforeResize * s_optCSEhashGrowthFactor; @@ -3635,7 +3636,7 @@ bool Compiler::optIsCSEcandidate(GenTree* tree) { GenTreeHWIntrinsic* hwIntrinsicNode = tree->AsHWIntrinsic(); assert(hwIntrinsicNode != nullptr); - HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(hwIntrinsicNode->gtHWIntrinsicId); + HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(hwIntrinsicNode->GetHWIntrinsicId()); switch (category) { diff --git a/src/coreclr/jit/optimizer.cpp b/src/coreclr/jit/optimizer.cpp index 10f14b2b53cf7b..39d2328c2e8d62 100644 --- a/src/coreclr/jit/optimizer.cpp +++ b/src/coreclr/jit/optimizer.cpp @@ -20,16 +20,16 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX void Compiler::optInit() { - optLoopsMarked = false; - fgHasLoops = false; + optLoopsMarked = false; + fgHasLoops = false; + loopAlignCandidates = 0; /* Initialize the # of tracked loops to 0 */ optLoopCount = 0; optLoopTable = nullptr; #ifdef DEBUG - loopAlignCandidates = 0; - loopsAligned = 0; + loopsAligned = 0; #endif /* Keep track of the number of calls and indirect calls made by this method */ @@ -78,13 +78,14 @@ void Compiler::optSetBlockWeights() if (!usingProfileWeights && firstBBDominatesAllReturns) { + // If the weight is already zero (and thus rarely run), there's no point scaling it. if (block->bbWeight != BB_ZERO_WEIGHT) { - // Calculate our bbWeight: - // - // o BB_UNITY_WEIGHT if we dominate all BBJ_RETURN blocks - // o otherwise BB_UNITY_WEIGHT / 2 - // + // If the block dominates all return blocks, leave the weight alone. Otherwise, + // scale the weight by 0.5 as a heuristic that some other path gets some of the dynamic flow. + // Note that `optScaleLoopBlocks` has a similar heuristic for loop blocks that don't dominate + // their loop back edge. + bool blockDominatesAllReturns = true; // Assume that we will dominate for (BasicBlockList* retBlocks = fgReturnBlocks; retBlocks != nullptr; retBlocks = retBlocks->next) @@ -99,6 +100,10 @@ void Compiler::optSetBlockWeights() if (block == fgFirstBB) { firstBBDominatesAllReturns = blockDominatesAllReturns; + + // Don't scale the weight of the first block, since it is guaranteed to execute. + // If the first block does not dominate all the returns, we won't scale any of the function's + // block weights. } else { @@ -108,6 +113,12 @@ void Compiler::optSetBlockWeights() if (!blockDominatesAllReturns) { INDEBUG(changed = true); + + // TODO-Cleanup: we should use: + // block->scaleBBWeight(0.5); + // since we are inheriting "from ourselves", but that leads to asm diffs due to minutely + // different floating-point value in the calculation, and some code that compares weights + // for equality. block->inheritWeightPercentage(block, 50); } } @@ -128,29 +139,25 @@ void Compiler::optSetBlockWeights() #endif } -/***************************************************************************** - * - * Marks the blocks between 'begBlk' and 'endBlk' as part of a loop. - */ - -void Compiler::optMarkLoopBlocks(BasicBlock* begBlk, BasicBlock* endBlk, bool excludeEndBlk) +//------------------------------------------------------------------------ +// optScaleLoopBlocks: Scale the weight of loop blocks from 'begBlk' to 'endBlk'. +// +// Arguments: +// begBlk - first block of range. Must be marked as a loop head (BBF_LOOP_HEAD). +// endBlk - last block of range (inclusive). Must be reachable from `begBlk`. +// +// Operation: +// Calculate the 'loop weight'. This is the amount to scale the weight of each block in the loop. +// Our heuristic is that loops are weighted eight times more than straight-line code +// (scale factor is BB_LOOP_WEIGHT_SCALE). If the loops are all properly formed this gives us these weights: +// +// 1 -- non-loop basic block +// 8 -- single loop nesting +// 64 -- double loop nesting +// 512 -- triple loop nesting +// +void Compiler::optScaleLoopBlocks(BasicBlock* begBlk, BasicBlock* endBlk) { - /* Calculate the 'loopWeight', - this is the amount to increase each block in the loop - Our heuristic is that loops are weighted eight times more - than straight line code. - Thus we increase each block by 7 times the weight of - the loop header block, - if the loops are all properly formed gives us: - (assuming that BB_LOOP_WEIGHT_SCALE is 8) - - 1 -- non loop basic block - 8 -- single loop nesting - 64 -- double loop nesting - 512 -- triple loop nesting - - */ - noway_assert(begBlk->bbNum <= endBlk->bbNum); noway_assert(begBlk->isLoopHead()); noway_assert(fgReachable(begBlk, endBlk)); @@ -159,17 +166,16 @@ void Compiler::optMarkLoopBlocks(BasicBlock* begBlk, BasicBlock* endBlk, bool ex #ifdef DEBUG if (verbose) { - printf("\nMarking a loop from " FMT_BB " to " FMT_BB, begBlk->bbNum, - excludeEndBlk ? endBlk->bbPrev->bbNum : endBlk->bbNum); + printf("\nMarking a loop from " FMT_BB " to " FMT_BB, begBlk->bbNum, endBlk->bbNum); } #endif - /* Build list of backedges for block begBlk */ + // Build list of back edges for block begBlk. flowList* backedgeList = nullptr; for (BasicBlock* const predBlock : begBlk->PredBlocks()) { - /* Is this a backedge? */ + // Is this a back edge? if (predBlock->bbNum >= begBlk->bbNum) { backedgeList = new (this, CMK_FlowList) flowList(predBlock, backedgeList); @@ -181,24 +187,41 @@ void Compiler::optMarkLoopBlocks(BasicBlock* begBlk, BasicBlock* endBlk, bool ex } } - /* At least one backedge must have been found (the one from endBlk) */ + // At least one backedge must have been found (the one from endBlk). noway_assert(backedgeList); - BasicBlock* curBlk = begBlk; + auto reportBlockWeight = [&](BasicBlock* blk, const char* message) { +#ifdef DEBUG + if (verbose) + { + printf("\n " FMT_BB "(wt=" FMT_WT ")%s", blk->bbNum, blk->getBBWeight(this), message); + } +#endif // DEBUG + }; - while (true) + for (BasicBlock* const curBlk : BasicBlockRangeList(begBlk, endBlk)) { - noway_assert(curBlk); + // Don't change the block weight if it came from profile data. + if (curBlk->hasProfileWeight()) + { + reportBlockWeight(curBlk, "; unchanged: has profile weight"); + continue; + } - // For curBlk to be part of a loop that starts at begBlk - // curBlk must be reachable from begBlk and (since this is a loop) - // likewise begBlk must be reachable from curBlk. - // + // Don't change the block weight if it's known to be rarely run. + if (curBlk->isRunRarely()) + { + reportBlockWeight(curBlk, "; unchanged: run rarely"); + continue; + } + + // For curBlk to be part of a loop that starts at begBlk, curBlk must be reachable from begBlk and + // (since this is a loop) begBlk must likewise be reachable from curBlk. if (fgReachable(curBlk, begBlk) && fgReachable(begBlk, curBlk)) { - /* If this block reaches any of the backedge blocks we set reachable */ - /* If this block dominates any of the backedge blocks we set dominates */ + // If `curBlk` reaches any of the back edge blocks we set `reachable`. + // If `curBlk` dominates any of the back edge blocks we set `dominates`. bool reachable = false; bool dominates = false; @@ -206,88 +229,75 @@ void Compiler::optMarkLoopBlocks(BasicBlock* begBlk, BasicBlock* endBlk, bool ex { BasicBlock* backedge = tmp->getBlock(); - if (!curBlk->isRunRarely()) - { - reachable |= fgReachable(curBlk, backedge); - dominates |= fgDominate(curBlk, backedge); + reachable |= fgReachable(curBlk, backedge); + dominates |= fgDominate(curBlk, backedge); - if (dominates && reachable) - { - break; - } + if (dominates && reachable) + { + // No need to keep looking; we've already found all the info we need. + break; } } if (reachable) { + // If the block has BB_ZERO_WEIGHT, then it should be marked as rarely run, and skipped, above. noway_assert(curBlk->bbWeight > BB_ZERO_WEIGHT); - if (!curBlk->hasProfileWeight()) - { - weight_t scale = BB_LOOP_WEIGHT_SCALE; - - if (!dominates) - { - scale = scale / 2; - } + weight_t scale = BB_LOOP_WEIGHT_SCALE; - curBlk->scaleBBWeight(scale); + if (!dominates) + { + // If `curBlk` reaches but doesn't dominate any back edge to `endBlk` then there must be at least + // some other path to `endBlk`, so don't give `curBlk` all the execution weight. + scale = scale / 2; } - JITDUMP("\n " FMT_BB "(wt=" FMT_WT ")", curBlk->bbNum, curBlk->getBBWeight(this)); - } - } - - /* Stop if we've reached the last block in the loop */ + curBlk->scaleBBWeight(scale); - if (curBlk == endBlk) - { - break; + reportBlockWeight(curBlk, ""); + } + else + { + reportBlockWeight(curBlk, "; unchanged: back edge unreachable"); + } } - - curBlk = curBlk->bbNext; - - /* If we are excluding the endBlk then stop if we've reached endBlk */ - - if (excludeEndBlk && (curBlk == endBlk)) + else { - break; + reportBlockWeight(curBlk, "; unchanged: block not in loop"); } } } -/***************************************************************************** - * - * Unmark the blocks between 'begBlk' and 'endBlk' as part of a loop. - */ - +//------------------------------------------------------------------------ +// optUnmarkLoopBlocks: Unmark the blocks between 'begBlk' and 'endBlk' as part of a loop. +// +// Arguments: +// begBlk - first block of range. Must be marked as a loop head (BBF_LOOP_HEAD). +// endBlk - last block of range (inclusive). Must be reachable from `begBlk`. +// +// Operation: +// A set of blocks that were previously marked as a loop are now to be unmarked, since we have decided that +// for some reason this loop no longer exists. Basically we are just resetting the blocks bbWeight to their +// previous values. +// void Compiler::optUnmarkLoopBlocks(BasicBlock* begBlk, BasicBlock* endBlk) { - /* A set of blocks that were previously marked as a loop are now - to be unmarked, since we have decided that for some reason this - loop no longer exists. - Basically we are just reseting the blocks bbWeight to their - previous values. - */ - noway_assert(begBlk->bbNum <= endBlk->bbNum); noway_assert(begBlk->isLoopHead()); - noway_assert(!opts.MinOpts()); unsigned backEdgeCount = 0; for (BasicBlock* const predBlock : begBlk->PredBlocks()) { - /* is this a backward edge? (from predBlock to begBlk) */ - + // Is this a backward edge? (from predBlock to begBlk) if (begBlk->bbNum > predBlock->bbNum) { continue; } - /* We only consider back-edges that are BBJ_COND or BBJ_ALWAYS for loops */ - + // We only consider back-edges that are BBJ_COND or BBJ_ALWAYS for loops. if ((predBlock->bbJumpKind != BBJ_COND) && (predBlock->bbJumpKind != BBJ_ALWAYS)) { continue; @@ -296,7 +306,7 @@ void Compiler::optUnmarkLoopBlocks(BasicBlock* begBlk, BasicBlock* endBlk) backEdgeCount++; } - /* Only unmark the loop blocks if we have exactly one loop back edge */ + // Only unmark the loop blocks if we have exactly one loop back edge. if (backEdgeCount != 1) { #ifdef DEBUG @@ -314,71 +324,62 @@ void Compiler::optUnmarkLoopBlocks(BasicBlock* begBlk, BasicBlock* endBlk) #endif return; } - noway_assert(backEdgeCount == 1); noway_assert(fgReachable(begBlk, endBlk)); #ifdef DEBUG if (verbose) { - printf("\nUnmarking loop at " FMT_BB, begBlk->bbNum); + printf("\nUnmarking a loop from " FMT_BB " to " FMT_BB, begBlk->bbNum, endBlk->bbNum); } #endif - BasicBlock* curBlk = begBlk; - while (true) + for (BasicBlock* const curBlk : BasicBlockRangeList(begBlk, endBlk)) { - noway_assert(curBlk); - - // For curBlk to be part of a loop that starts at begBlk - // curBlk must be reachable from begBlk and (since this is a loop) - // likewise begBlk must be reachable from curBlk. - // - if (!curBlk->isRunRarely() && fgReachable(curBlk, begBlk) && fgReachable(begBlk, curBlk)) + // Stop if we go past the last block in the loop, as it may have been deleted. + if (curBlk->bbNum > endBlk->bbNum) { - // Don't unmark blocks that are set to BB_MAX_WEIGHT - // Don't unmark blocks when we are using profile weights - // - if (!curBlk->isMaxBBWeight() && !curBlk->hasProfileWeight()) - { - weight_t scale = 1.0 / BB_LOOP_WEIGHT_SCALE; - - if (!fgDominate(curBlk, endBlk)) - { - scale *= 2; - } - - curBlk->scaleBBWeight(scale); - } - - JITDUMP("\n " FMT_BB "(wt=" FMT_WT ")", curBlk->bbNum, curBlk->getBBWeight(this)); + break; } - /* Stop if we've reached the last block in the loop */ + // Don't change the block weight if it's known to be rarely run. + if (curBlk->isRunRarely()) + { + continue; + } - if (curBlk == endBlk) + // Don't change the block weight if it came from profile data. + if (curBlk->hasProfileWeight()) { - break; + continue; } - curBlk = curBlk->bbNext; + // Don't unmark blocks that are maximum weight. + if (curBlk->isMaxBBWeight()) + { + continue; + } - /* Stop if we go past the last block in the loop, as it may have been deleted */ - if (curBlk->bbNum > endBlk->bbNum) + // For curBlk to be part of a loop that starts at begBlk, curBlk must be reachable from begBlk and + // (since this is a loop) begBlk must likewise be reachable from curBlk. + // + if (fgReachable(curBlk, begBlk) && fgReachable(begBlk, curBlk)) { - break; + weight_t scale = 1.0 / BB_LOOP_WEIGHT_SCALE; + + if (!fgDominate(curBlk, endBlk)) + { + scale *= 2; + } + + curBlk->scaleBBWeight(scale); + + JITDUMP("\n " FMT_BB "(wt=" FMT_WT ")", curBlk->bbNum, curBlk->getBBWeight(this)); } } JITDUMP("\n"); -#if FEATURE_LOOP_ALIGN - if (begBlk->isLoopAlign()) - { - // Clear the loop alignment bit on the head of a loop, since it's no longer a loop. - begBlk->bbFlags &= ~BBF_LOOP_ALIGN; - JITDUMP("Removing LOOP_ALIGN flag from removed loop in " FMT_BB "\n", begBlk->bbNum); - } -#endif + begBlk->unmarkLoopAlign(this DEBUG_ARG("Removed loop")); } /***************************************************************************************************** @@ -550,13 +551,18 @@ void Compiler::optUpdateLoopsBeforeRemoveBlock(BasicBlock* block, bool skipUnmar { printf("\nUpdateLoopsBeforeRemoveBlock After: "); optPrintLoopInfo(loopNum); + printf("\n"); } #endif } - if ((skipUnmarkLoop == false) && ((block->bbJumpKind == BBJ_ALWAYS) || (block->bbJumpKind == BBJ_COND)) && - (block->bbJumpDest->isLoopHead()) && (block->bbJumpDest->bbNum <= block->bbNum) && fgDomsComputed && - (fgCurBBEpochSize == fgDomBBcount + 1) && fgReachable(block->bbJumpDest, block)) + if ((skipUnmarkLoop == false) && // + ((block->bbJumpKind == BBJ_ALWAYS) || (block->bbJumpKind == BBJ_COND)) && // + block->bbJumpDest->isLoopHead() && // + (block->bbJumpDest->bbNum <= block->bbNum) && // + fgDomsComputed && // + (fgCurBBEpochSize == fgDomBBcount + 1) && // + fgReachable(block->bbJumpDest, block)) { optUnmarkLoopBlocks(block->bbJumpDest, block); } @@ -571,7 +577,6 @@ void Compiler::optUpdateLoopsBeforeRemoveBlock(BasicBlock* block, bool skipUnmar void Compiler::optPrintLoopInfo(unsigned loopInd, BasicBlock* lpHead, - BasicBlock* lpFirst, BasicBlock* lpTop, BasicBlock* lpEntry, BasicBlock* lpBottom, @@ -579,16 +584,8 @@ void Compiler::optPrintLoopInfo(unsigned loopInd, BasicBlock* lpExit, unsigned parentLoop) const { - noway_assert(lpHead); - - printf(FMT_LP ", from " FMT_BB, loopInd, lpFirst->bbNum); - if (lpTop != lpFirst) - { - printf(" (loop top is " FMT_BB ")", lpTop->bbNum); - } - - printf(" to " FMT_BB " (Head=" FMT_BB ", Entry=" FMT_BB ", ExitCnt=%d", lpBottom->bbNum, lpHead->bbNum, - lpEntry->bbNum, lpExitCnt); + printf(FMT_LP ", from " FMT_BB " to " FMT_BB " (Head=" FMT_BB ", Entry=" FMT_BB ", ExitCnt=%d", loopInd, + lpTop->bbNum, lpBottom->bbNum, lpHead->bbNum, lpEntry->bbNum, lpExitCnt); if (lpExitCnt == 1) { @@ -609,15 +606,15 @@ void Compiler::optPrintLoopInfo(unsigned loopInd, void Compiler::optPrintLoopInfo(unsigned lnum) const { - noway_assert(lnum < optLoopCount); + assert(lnum < optLoopCount); - const LoopDsc* ldsc = &optLoopTable[lnum]; // lnum is the INDEX to the loop table. + const LoopDsc* ldsc = &optLoopTable[lnum]; - optPrintLoopInfo(lnum, ldsc->lpHead, ldsc->lpFirst, ldsc->lpTop, ldsc->lpEntry, ldsc->lpBottom, ldsc->lpExitCnt, - ldsc->lpExit, ldsc->lpParent); + optPrintLoopInfo(lnum, ldsc->lpHead, ldsc->lpTop, ldsc->lpEntry, ldsc->lpBottom, ldsc->lpExitCnt, ldsc->lpExit, + ldsc->lpParent); } -#endif +#endif // DEBUG //------------------------------------------------------------------------ // optPopulateInitInfo: Populate loop init info in the loop table. @@ -1035,13 +1032,8 @@ bool Compiler::optExtractInitTestIncr( * out of entries in loop table. */ -bool Compiler::optRecordLoop(BasicBlock* head, - BasicBlock* first, - BasicBlock* top, - BasicBlock* entry, - BasicBlock* bottom, - BasicBlock* exit, - unsigned char exitCnt) +bool Compiler::optRecordLoop( + BasicBlock* head, BasicBlock* top, BasicBlock* entry, BasicBlock* bottom, BasicBlock* exit, unsigned char exitCnt) { // Record this loop in the table, if there's room. @@ -1055,7 +1047,6 @@ bool Compiler::optRecordLoop(BasicBlock* head, } // Assumed preconditions on the loop we're adding. - assert(first->bbNum <= top->bbNum); assert(top->bbNum <= entry->bbNum); assert(entry->bbNum <= bottom->bbNum); assert(head->bbNum < top->bbNum || head->bbNum > bottom->bbNum); @@ -1073,7 +1064,7 @@ bool Compiler::optRecordLoop(BasicBlock* head, for (unsigned char prevPlus1 = optLoopCount; prevPlus1 > 0; prevPlus1--) { unsigned char prev = prevPlus1 - 1; - if (optLoopTable[prev].lpContainedBy(first, bottom)) + if (optLoopTable[prev].lpContainedBy(top, bottom)) { loopInd = prev; } @@ -1091,17 +1082,16 @@ bool Compiler::optRecordLoop(BasicBlock* head, // The loop is well-formed. assert(optLoopTable[i].lpWellFormed()); // Check for disjoint. - if (optLoopTable[i].lpDisjoint(first, bottom)) + if (optLoopTable[i].lpDisjoint(top, bottom)) { continue; } // Otherwise, assert complete containment (of optLoopTable[i] in new loop). - assert(optLoopTable[i].lpContainedBy(first, bottom)); + assert(optLoopTable[i].lpContainedBy(top, bottom)); } #endif // DEBUG optLoopTable[loopInd].lpHead = head; - optLoopTable[loopInd].lpFirst = first; optLoopTable[loopInd].lpTop = top; optLoopTable[loopInd].lpBottom = bottom; optLoopTable[loopInd].lpEntry = entry; @@ -1257,7 +1247,7 @@ void Compiler::optPrintLoopRecording(unsigned loopInd) const printf("Recorded loop %s", (loopInd != optLoopCount ? "(extended) " : "")); optPrintLoopInfo(optLoopCount, // Not necessarily the loop index, but the number of loops that have been added. - loop.lpHead, loop.lpFirst, loop.lpTop, loop.lpEntry, loop.lpBottom, loop.lpExitCnt, loop.lpExit); + loop.lpHead, loop.lpTop, loop.lpEntry, loop.lpBottom, loop.lpExitCnt, loop.lpExit); // If an iterator loop print the iterator and the initialization. if (loop.lpFlags & LPFLG_ITER) @@ -1341,14 +1331,13 @@ namespace { //------------------------------------------------------------------------ // LoopSearch: Class that handles scanning a range of blocks to detect a loop, -// moving blocks to make the loop body contiguous, and recording -// the loop. +// moving blocks to make the loop body contiguous, and recording the loop. // // We will use the following terminology: // HEAD - the basic block that flows into the loop ENTRY block (Currently MUST be lexically before entry). // Not part of the looping of the loop. -// FIRST - the lexically first basic block (in bbNext order) within this loop. -// TOP - the target of the backward edge from BOTTOM. In most cases FIRST and TOP are the same. +// TOP - the target of the backward edge from BOTTOM, and the lexically first basic block (in bbNext order) +// within this loop. // BOTTOM - the lexically last block in the loop (i.e. the block from which we jump to the top) // EXIT - the predecessor of loop's unique exit edge, if it has a unique exit edge; else nullptr // ENTRY - the entry in the loop (not necessarly the TOP), but there must be only one entry @@ -1359,14 +1348,14 @@ namespace // between TOP and BOTTOM as part of the loop even if they aren't part of the SCC. // Regarding nesting: Since a given block can only have one back-edge (we only detect loops with back-edges // from BBJ_COND or BBJ_ALWAYS blocks), no two loops will share the same BOTTOM. Two loops may share the -// same FIRST/TOP/ENTRY as reported by LoopSearch, and optCanonicalizeLoopNest will subsequently re-write -// the CFG so that no two loops share the same FIRST/TOP/ENTRY anymore. +// same TOP/ENTRY as reported by LoopSearch, and optCanonicalizeLoopNest will subsequently re-write +// the CFG so that no two loops share the same TOP/ENTRY anymore. // // | // v // head // | -// | top/first <--+ +// | top <--+ // | | | // | ... | // | | | @@ -1450,7 +1439,10 @@ class LoopSearch { return BlockSetOps::IsMember(comp, newBlocksInLoop, blockNum - oldBlockMaxNum); } - return BlockSetOps::IsMember(comp, oldBlocksInLoop, blockNum); + else + { + return BlockSetOps::IsMember(comp, oldBlocksInLoop, blockNum); + } } void Insert(unsigned int blockNum) @@ -1493,7 +1485,6 @@ class LoopSearch // See LoopSearch class comment header for a diagram relating these fields: BasicBlock* head; // Predecessor of unique entry edge - BasicBlock* first; // Lexically first in-loop block BasicBlock* top; // Successor of back-edge from BOTTOM BasicBlock* bottom; // Predecessor of back-edge to TOP, also lexically last in-loop block BasicBlock* entry; // Successor of unique entry edge @@ -1524,12 +1515,12 @@ class LoopSearch // bool RecordLoop() { - /* At this point we have a compact loop - record it in the loop table - * If we found only one exit, record it in the table too - * (otherwise an exit = nullptr in the loop table means multiple exits) */ + // At this point we have a compact loop - record it in the loop table. + // If we found only one exit, record it in the table too + // (otherwise an exit = nullptr in the loop table means multiple exits). BasicBlock* onlyExit = (exitCount == 1 ? lastExit : nullptr); - if (comp->optRecordLoop(head, first, top, entry, bottom, onlyExit, exitCount)) + if (comp->optRecordLoop(head, top, entry, bottom, onlyExit, exitCount)) { // Record the BOTTOM block for future reference before returning. assert(bottom->bbNum <= oldBlockMaxNum); @@ -1573,12 +1564,11 @@ class LoopSearch // bool FindLoop(BasicBlock* head, BasicBlock* top, BasicBlock* bottom) { - /* Is this a loop candidate? - We look for "back edges", i.e. an edge from BOTTOM - * to TOP (note that this is an abuse of notation since this is not necessarily a back edge - * as the definition says, but merely an indication that we have a loop there). - * Thus, we have to be very careful and after entry discovery check that it is indeed - * the only place we enter the loop (especially for non-reducible flow graphs). - */ + // Is this a loop candidate? - We look for "back edges", i.e. an edge from BOTTOM + // to TOP (note that this is an abuse of notation since this is not necessarily a back edge + // as the definition says, but merely an indication that we have a loop there). + // Thus, we have to be very careful and after entry discovery check that it is indeed + // the only place we enter the loop (especially for non-reducible flow graphs). if (top->bbNum > bottom->bbNum) // is this a backward edge? (from BOTTOM to TOP) { @@ -1597,21 +1587,20 @@ class LoopSearch (bottom->bbJumpKind == BBJ_EHCATCHRET) || (bottom->bbJumpKind == BBJ_CALLFINALLY) || (bottom->bbJumpKind == BBJ_SWITCH)) { - /* BBJ_EHFINALLYRET, BBJ_EHFILTERRET, BBJ_EHCATCHRET, and BBJ_CALLFINALLY can never form a loop. - * BBJ_SWITCH that has a backward jump appears only for labeled break. */ + // BBJ_EHFINALLYRET, BBJ_EHFILTERRET, BBJ_EHCATCHRET, and BBJ_CALLFINALLY can never form a loop. + // BBJ_SWITCH that has a backward jump appears only for labeled break. return false; } - /* The presence of a "back edge" is an indication that a loop might be present here - * - * LOOP: - * 1. A collection of STRONGLY CONNECTED nodes i.e. there is a path from any - * node in the loop to any other node in the loop (wholly within the loop) - * 2. The loop has a unique ENTRY, i.e. there is only one way to reach a node - * in the loop from outside the loop, and that is through the ENTRY - */ + // The presence of a "back edge" is an indication that a loop might be present here. + // + // Definition: A loop is: + // 1. A collection of STRONGLY CONNECTED nodes i.e. there is a path from any + // node in the loop to any other node in the loop (wholly within the loop) + // 2. The loop has a unique ENTRY, i.e. there is only one way to reach a node + // in the loop from outside the loop, and that is through the ENTRY - /* Let's find the loop ENTRY */ + // Let's find the loop ENTRY BasicBlock* entry = FindEntry(head, top, bottom); if (entry == nullptr) @@ -1628,10 +1617,6 @@ class LoopSearch this->lastExit = nullptr; this->exitCount = 0; - // Now we find the "first" block -- the earliest block reachable within the loop. - // With our current algorithm, this is always the same as "top". - this->first = top; - if (!HasSingleEntryCycle()) { // There isn't actually a loop between TOP and BOTTOM @@ -1662,27 +1647,25 @@ class LoopSearch // // Here, BB10 is more nested than BB02. - if (bottom->hasTryIndex() && !comp->bbInTryRegions(bottom->getTryIndex(), first)) + if (bottom->hasTryIndex() && !comp->bbInTryRegions(bottom->getTryIndex(), top)) { - JITDUMP("Loop 'first' " FMT_BB " is in an outer EH region compared to loop 'bottom' " FMT_BB ". Rejecting " + JITDUMP("Loop 'top' " FMT_BB " is in an outer EH region compared to loop 'bottom' " FMT_BB ". Rejecting " "loop.\n", - first->bbNum, bottom->bbNum); + top->bbNum, bottom->bbNum); return false; } #if defined(FEATURE_EH_FUNCLETS) && defined(TARGET_ARM) // Disqualify loops where the first block of the loop is a finally target. - // The main problem is when multiple loops share a 'first' block that is a finally + // The main problem is when multiple loops share a 'top' block that is a finally // target and we canonicalize the loops by adding a new loop head. In that case, we // need to update the blocks so the finally target bit is moved to the newly created - // block, and removed from the old 'first' block. This is 'hard', so at this point - // in the RyuJIT codebase (when we don't expect to keep the "old" ARM32 code generator - // long-term), it's easier to disallow the loop than to update the flow graph to - // support this case. + // block, and removed from the old 'top' block. This is 'hard', so it's easier to disallow + // the loop than to update the flow graph to support this case. - if ((first->bbFlags & BBF_FINALLY_TARGET) != 0) + if ((top->bbFlags & BBF_FINALLY_TARGET) != 0) { - JITDUMP("Loop 'first' " FMT_BB " is a finally target. Rejecting loop.\n", first->bbNum); + JITDUMP("Loop 'top' " FMT_BB " is a finally target. Rejecting loop.\n", top->bbNum); return false; } #endif // defined(FEATURE_EH_FUNCLETS) && defined(TARGET_ARM) @@ -1729,18 +1712,16 @@ class LoopSearch { if (head->bbJumpDest->bbNum <= bottom->bbNum && head->bbJumpDest->bbNum >= top->bbNum) { - /* OK - we enter somewhere within the loop */ - - /* some useful asserts - * Cannot enter at the top - should have being caught by redundant jumps */ + // OK - we enter somewhere within the loop. + // Cannot enter at the top - should have being caught by redundant jumps assert((head->bbJumpDest != top) || (head->bbFlags & BBF_KEEP_BBJ_ALWAYS)); return head->bbJumpDest; } else { - /* special case - don't consider now */ + // special case - don't consider now // assert (!"Loop entered in weird way!"); return nullptr; } @@ -1748,12 +1729,12 @@ class LoopSearch // Can we fall through into the loop? else if (head->bbJumpKind == BBJ_NONE || head->bbJumpKind == BBJ_COND) { - /* The ENTRY is at the TOP (a do-while loop) */ + // The ENTRY is at the TOP (a do-while loop) return top; } else { - return nullptr; // head does not flow into the loop bail for now + return nullptr; // HEAD does not flow into the loop; bail for now } } @@ -1767,8 +1748,7 @@ class LoopSearch // false - Did not find a single-entry cycle. // // Notes: - // Will mark (in `loopBlocks`) all blocks found to participate in the - // cycle. + // Will mark (in `loopBlocks`) all blocks found to participate in the cycle. // bool HasSingleEntryCycle() { @@ -1785,9 +1765,7 @@ class LoopSearch BasicBlock* block = worklist.back(); worklist.pop_back(); - /* Make sure ENTRY dominates all blocks in the loop - * This is necessary to ensure condition 2. above - */ + // Make sure ENTRY dominates all blocks in the loop. if (block->bbNum > oldBlockMaxNum) { // This is a new block we added to connect fall-through, so the @@ -2212,7 +2190,7 @@ class LoopSearch if ((block->bbJumpKind == BBJ_COND) && (block->bbJumpDest == newNext)) { - /* Reverse the jump condition */ + // Reverse the jump condition GenTree* test = block->lastNode(); noway_assert(test->OperIsConditionalJump()); @@ -2280,7 +2258,7 @@ class LoopSearch if (!loopBlocks.IsMember(exitPoint->bbNum)) { - /* exit from a block other than BOTTOM */ + // Exit from a block other than BOTTOM lastExit = block; exitCount++; } @@ -2291,13 +2269,13 @@ class LoopSearch case BBJ_EHFINALLYRET: case BBJ_EHFILTERRET: - /* The "try" associated with this "finally" must be in the - * same loop, so the finally block will return control inside the loop */ + // The "try" associated with this "finally" must be in the same loop, so the + // finally block will return control inside the loop. break; case BBJ_THROW: case BBJ_RETURN: - /* those are exits from the loop */ + // Those are exits from the loop lastExit = block; exitCount++; break; @@ -2326,14 +2304,17 @@ class LoopSearch } } }; -} - -/***************************************************************************** - * Find the natural loops, using dominators. Note that the test for - * a loop is slightly different from the standard one, because we have - * not done a depth first reordering of the basic blocks. - */ +} // end (anonymous) namespace +//------------------------------------------------------------------------ +// optFindNaturalLoops: Find the natural loops, using dominators. Note that the test for +// a loop is slightly different from the standard one, because we have not done a depth +// first reordering of the basic blocks. +// +// See LoopSearch class comment header for a description of the loops found. +// +// We will find and record a maximum of BasicBlock::MAX_LOOP_NUM loops (currently 64). +// void Compiler::optFindNaturalLoops() { #ifdef DEBUG @@ -2358,9 +2339,7 @@ void Compiler::optFindNaturalLoops() { BasicBlock* top = head->bbNext; - // Blocks that are rarely run have a zero bbWeight and should - // never be optimized here - + // Blocks that are rarely run have a zero bbWeight and should never be optimized here. if (top->bbWeight == BB_ZERO_WEIGHT) { continue; @@ -2378,16 +2357,16 @@ void Compiler::optFindNaturalLoops() #if COUNT_LOOPS if (!hasMethodLoops) { - /* mark the method as containing natural loops */ + // Mark the method as containing natural loops totalLoopMethods++; hasMethodLoops = true; } - /* increment total number of loops found */ + // Increment total number of loops found totalLoopCount++; loopsThisMethod++; - /* keep track of the number of exits */ + // Keep track of the number of exits loopExitCountTable.record(static_cast(search.GetExitCount())); // Note that we continue to look for loops even if @@ -2437,13 +2416,13 @@ void Compiler::optFindNaturalLoops() { // Need to renumber blocks now since loop canonicalization // depends on it; can defer the rest of fgUpdateChangedFlowGraph() - // until after canonicalizing loops. Dominator information is + // until after canonicalizing loops. Dominator information is // recorded in terms of block numbers, so flag it invalid. fgDomsComputed = false; fgRenumberBlocks(); } - // Now the loop indices are stable. We can figure out parent/child relationships + // Now the loop indices are stable. We can figure out parent/child relationships // (using table indices to name loops), and label blocks. for (unsigned char loopInd = 1; loopInd < optLoopCount; loopInd++) { @@ -2460,9 +2439,10 @@ void Compiler::optFindNaturalLoops() } } - // Now label the blocks with the innermost loop to which they belong. Since parents + // Now label the blocks with the innermost loop to which they belong. Since parents // precede children in the table, doing the labeling for each loop in order will achieve - // this -- the innermost loop labeling will be done last. + // this -- the innermost loop labeling will be done last. (Inner loop blocks will be + // labeled multiple times before being correct at the end.) for (unsigned char loopInd = 0; loopInd < optLoopCount; loopInd++) { for (BasicBlock* const blk : optLoopTable[loopInd].LoopBlocks()) @@ -2494,7 +2474,7 @@ void Compiler::optFindNaturalLoops() } #ifdef DEBUG - if (verbose && optLoopCount > 0) + if (verbose && (optLoopCount > 0)) { printf("\nFinal natural loop table:\n"); for (unsigned loopInd = 0; loopInd < optLoopCount; loopInd++) @@ -2506,34 +2486,43 @@ void Compiler::optFindNaturalLoops() #endif // DEBUG } -//----------------------------------------------------------------------------- +//------------------------------------------------------------------------ +// optIdentifyLoopsForAlignment: Determine which loops should be considered for alignment. // -// All the inner loops that whose block weight meets a threshold are marked -// as needing alignment. +// All innermost loops whose block weight meets a threshold are candidates for alignment. +// The `first` block of the loop is marked with the BBF_LOOP_ALIGN flag to indicate this +// (the loop table itself is not changed). +// +// Depends on the loop table, and on block weights being set. // - void Compiler::optIdentifyLoopsForAlignment() { #if FEATURE_LOOP_ALIGN if (codeGen->ShouldAlignLoops()) { - for (unsigned char loopInd = 0; loopInd < optLoopCount; loopInd++) + for (BasicBlock::loopNumber loopInd = 0; loopInd < optLoopCount; loopInd++) { - BasicBlock* first = optLoopTable[loopInd].lpFirst; - // An innerloop candidate that might need alignment if (optLoopTable[loopInd].lpChild == BasicBlock::NOT_IN_LOOP) { - if (first->getBBWeight(this) >= (opts.compJitAlignLoopMinBlockWeight * BB_UNITY_WEIGHT)) + BasicBlock* top = optLoopTable[loopInd].lpTop; + weight_t topWeight = top->getBBWeight(this); + if (topWeight >= (opts.compJitAlignLoopMinBlockWeight * BB_UNITY_WEIGHT)) { - first->bbFlags |= BBF_LOOP_ALIGN; - JITDUMP(FMT_LP " that starts at " FMT_BB " needs alignment, weight=" FMT_WT ".\n", loopInd, - first->bbNum, first->getBBWeight(this)); + // Sometimes with JitOptRepeat > 1, we might end up finding the loops twice. In such + // cases, make sure to count them just once. + if (!top->isLoopAlign()) + { + loopAlignCandidates++; + top->bbFlags |= BBF_LOOP_ALIGN; + JITDUMP(FMT_LP " that starts at " FMT_BB " needs alignment, weight=" FMT_WT ".\n", loopInd, + top->bbNum, top->getBBWeight(this)); + } } else { JITDUMP("Skip alignment for " FMT_LP " that starts at " FMT_BB " weight=" FMT_WT ".\n", loopInd, - first->bbNum, first->getBBWeight(this)); + top->bbNum, topWeight); } } } @@ -2649,7 +2638,11 @@ bool Compiler::optIsLoopEntry(BasicBlock* block) const { for (unsigned char loopInd = 0; loopInd < optLoopCount; loopInd++) { - // Traverse the outermost loops as entries into the loop nest; so skip non-outermost. + if ((optLoopTable[loopInd].lpFlags & LPFLG_REMOVED) != 0) + { + continue; + } + if (optLoopTable[loopInd].lpEntry == block) { return true; @@ -2664,7 +2657,7 @@ bool Compiler::optCanonicalizeLoopNest(unsigned char loopInd) { bool modified = false; - // Is the top of the current loop not in any nested loop? + // Is the top of the current loop in any nested loop? if (optLoopTable[loopInd].lpTop->bbNatLoopNum != loopInd) { if (optCanonicalizeLoop(loopInd)) @@ -2673,8 +2666,9 @@ bool Compiler::optCanonicalizeLoopNest(unsigned char loopInd) } } - for (unsigned char child = optLoopTable[loopInd].lpChild; child != BasicBlock::NOT_IN_LOOP; - child = optLoopTable[child].lpSibling) + for (unsigned char child = optLoopTable[loopInd].lpChild; // + child != BasicBlock::NOT_IN_LOOP; // + child = optLoopTable[child].lpSibling) { if (optCanonicalizeLoopNest(child)) { @@ -2702,7 +2696,7 @@ bool Compiler::optCanonicalizeLoop(unsigned char loopInd) // Otherwise, the top of this loop is also part of a nested loop. // // Insert a new unique top for this loop. We must be careful to put this new - // block in the correct EH region. Note that f->bbPrev might be in a different + // block in the correct EH region. Note that t->bbPrev might be in a different // EH region. For example: // // try { @@ -2777,16 +2771,15 @@ bool Compiler::optCanonicalizeLoop(unsigned char loopInd) // simplify things, we disqualify this type of loop, so we should never see this here. BasicBlock* h = optLoopTable[loopInd].lpHead; - BasicBlock* f = optLoopTable[loopInd].lpFirst; BasicBlock* b = optLoopTable[loopInd].lpBottom; // The loop must be entirely contained within a single handler region. - assert(BasicBlock::sameHndRegion(f, b)); + assert(BasicBlock::sameHndRegion(t, b)); // If the bottom block is in the same "try" region, then we extend the EH // region. Otherwise, we add the new block outside the "try" region. - bool extendRegion = BasicBlock::sameTryRegion(f, b); - BasicBlock* newT = fgNewBBbefore(BBJ_NONE, f, extendRegion); + const bool extendRegion = BasicBlock::sameTryRegion(t, b); + BasicBlock* newT = fgNewBBbefore(BBJ_NONE, t, extendRegion); if (!extendRegion) { // We need to set the EH region manually. Set it to be the same @@ -2800,7 +2793,7 @@ bool Compiler::optCanonicalizeLoop(unsigned char loopInd) // a call to fgUpdateChangedFlowGraph which will recompute the reachability sets anyway. // Redirect the "bottom" of the current loop to "newT". - BlockToBlockMap* blockMap = new (getAllocatorLoopHoist()) BlockToBlockMap(getAllocatorLoopHoist()); + BlockToBlockMap* blockMap = new (getAllocator(CMK_LoopOpt)) BlockToBlockMap(getAllocator(CMK_LoopOpt)); blockMap->Set(t, newT); optRedirectBlock(b, blockMap); @@ -2857,14 +2850,7 @@ bool Compiler::optCanonicalizeLoop(unsigned char loopInd) } } - assert(newT->bbNext == f); - if (f != t) - { - newT->bbJumpKind = BBJ_ALWAYS; - newT->bbJumpDest = t; - newT->bbStmtList = nullptr; - fgInsertStmtAtEnd(newT, fgNewStmtFromTree(gtNewOperNode(GT_NOP, TYP_VOID, nullptr))); - } + assert(newT->bbNext == t); // If it had been a do-while loop (top == entry), update entry, as well. BasicBlock* origE = optLoopTable[loopInd].lpEntry; @@ -2872,8 +2858,7 @@ bool Compiler::optCanonicalizeLoop(unsigned char loopInd) { optLoopTable[loopInd].lpEntry = newT; } - optLoopTable[loopInd].lpTop = newT; - optLoopTable[loopInd].lpFirst = newT; + optLoopTable[loopInd].lpTop = newT; newT->bbNatLoopNum = loopInd; @@ -2898,8 +2883,9 @@ bool Compiler::optCanonicalizeLoop(unsigned char loopInd) // If any loops nested in "loopInd" have the same head and entry as "loopInd", // it must be the case that they were do-while's (since "h" fell through to the entry). // The new node "newT" becomes the head of such loops. - for (unsigned char childLoop = optLoopTable[loopInd].lpChild; childLoop != BasicBlock::NOT_IN_LOOP; - childLoop = optLoopTable[childLoop].lpSibling) + for (unsigned char childLoop = optLoopTable[loopInd].lpChild; // + childLoop != BasicBlock::NOT_IN_LOOP; // + childLoop = optLoopTable[childLoop].lpSibling) { if (optLoopTable[childLoop].lpEntry == origE && optLoopTable[childLoop].lpHead == h && newT->bbJumpKind == BBJ_NONE && newT->bbNext == origE) @@ -3792,11 +3778,7 @@ PhaseStatus Compiler::optUnrollLoops() #if FEATURE_LOOP_ALIGN for (block = head->bbNext;; block = block->bbNext) { - if (block->isLoopAlign()) - { - block->bbFlags &= ~BBF_LOOP_ALIGN; - JITDUMP("Removing LOOP_ALIGN flag from unrolled loop in " FMT_BB "\n", block->bbNum); - } + block->unmarkLoopAlign(this DEBUG_ARG("Unrolled loop")); if (block == bottom) { @@ -4399,7 +4381,7 @@ bool Compiler::optInvertWhileLoop(BasicBlock* block) if (opts.compDbgInfo) { - clonedStmt->SetILOffsetX(stmt->GetILOffsetX()); + clonedStmt->SetDebugInfo(stmt->GetDebugInfo()); } clonedStmt->SetCompilerAdded(); @@ -4627,16 +4609,77 @@ PhaseStatus Compiler::optOptimizeLayout() return madeChanges ? PhaseStatus::MODIFIED_EVERYTHING : PhaseStatus::MODIFIED_NOTHING; } +//------------------------------------------------------------------------ +// optMarkLoopHeads: Mark all potential loop heads as BBF_LOOP_HEAD. A potential loop head is a block +// targeted by a lexical back edge, where the source of the back edge is reachable from the block. +// Note that if there are no lexical back edges, there can't be any loops. +// +// If there are any potential loop heads, set `fgHasLoops` to `true`. +// +// Assumptions: +// The reachability sets must be computed and valid. +// +void Compiler::optMarkLoopHeads() +{ + assert(!fgCheapPredsValid); + assert(fgReachabilitySetsValid); + +#ifdef DEBUG + if (verbose) + { + printf("*************** In optMarkLoopHeads()\n"); + } +#endif + + bool hasLoops = false; + + for (BasicBlock* const block : Blocks()) + { + // Set BBF_LOOP_HEAD if we have backwards branches to this block. + + unsigned blockNum = block->bbNum; + for (BasicBlock* const predBlock : block->PredBlocks()) + { + if (blockNum <= predBlock->bbNum) + { + if (predBlock->bbJumpKind == BBJ_CALLFINALLY) + { + // Loops never have BBJ_CALLFINALLY as the source of their "back edge". + continue; + } + + // If block can reach predBlock then we have a loop head + if (BlockSetOps::IsMember(this, predBlock->bbReach, blockNum)) + { + hasLoops = true; + block->bbFlags |= BBF_LOOP_HEAD; + break; // No need to look at more `block` predecessors + } + } + } + } + + fgHasLoops = hasLoops; +} + //----------------------------------------------------------------------------- -// optFindLoops: find and classify natural loops +// optFindLoops: find loops in the function. +// +// The JIT recognizes two types of loops in a function: natural loops and "general" (or "unnatural") loops. +// Natural loops are those which get added to the loop table. Most downstream optimizations require +// using natural loops. See `optFindNaturalLoops` for a definition of the criteria for recognizing a natural loop. +// A general loop is defined as a lexical (program order) range of blocks where a later block branches to an +// earlier block (that is, there is a back edge in the flow graph), and the later block is reachable from the earlier +// block. General loops are used for weighting flow graph blocks (when there is no block profile data), as well as +// for determining if we require fully interruptible GC information. // // Notes: -// Also (re)sets all non-IBC block weights, and marks loops potentially needing -// alignment padding. +// Also (re)sets all non-IBC block weights, and marks loops potentially needing alignment padding. // PhaseStatus Compiler::optFindLoops() { noway_assert(opts.OptimizationEnabled()); + assert(fgDomsComputed); #ifdef DEBUG if (verbose) @@ -4645,50 +4688,46 @@ PhaseStatus Compiler::optFindLoops() } #endif + optMarkLoopHeads(); + optSetBlockWeights(); /* Were there any loops in the flow graph? */ if (fgHasLoops) { - /* now that we have dominator information we can find loops */ - optFindNaturalLoops(); - unsigned loopNum = 0; + // Now find the general loops and scale block weights. - /* Iterate over the flow graph, marking all loops */ + unsigned generalLoopCount = 0; - /* We will use the following terminology: - * top - the first basic block in the loop (i.e. the head of the backward edge) - * bottom - the last block in the loop (i.e. the block from which we jump to the top) - * lastBottom - used when we have multiple back-edges to the same top - */ + // We will use the following terminology: + // top - the first basic block in the loop (i.e. the head of the backward edge) + // bottom - the last block in the loop (i.e. the block from which we jump to the top) + // lastBottom - used when we have multiple back edges to the same top for (BasicBlock* const top : Blocks()) { + // Only consider `top` blocks already determined to be potential loop heads. + if (!top->isLoopHead()) + { + continue; + } + BasicBlock* foundBottom = nullptr; for (BasicBlock* const bottom : top->PredBlocks()) { - /* Is this a loop candidate? - We look for "back edges" */ - - /* is this a backward edge? (from BOTTOM to TOP) */ + // Is this a loop candidate? - We look for "back edges" + // Is this a backward edge? (from BOTTOM to TOP) if (top->bbNum > bottom->bbNum) { continue; } - /* 'top' also must have the BBF_LOOP_HEAD flag set */ - - if (top->isLoopHead() == false) - { - continue; - } - - /* We only consider back-edges that are BBJ_COND or BBJ_ALWAYS for loops */ - + // We only consider back-edges that are BBJ_COND or BBJ_ALWAYS for loops. if ((bottom->bbJumpKind != BBJ_COND) && (bottom->bbJumpKind != BBJ_ALWAYS)) { continue; @@ -4710,15 +4749,15 @@ PhaseStatus Compiler::optFindLoops() if (foundBottom) { - loopNum++; + generalLoopCount++; /* Mark all blocks between 'top' and 'bottom' */ - optMarkLoopBlocks(top, foundBottom, false); + optScaleLoopBlocks(top, foundBottom); } // We track at most 255 loops - if (loopNum == 255) + if (generalLoopCount == 255) { #if COUNT_LOOPS totalUnnatLoopOverflows++; @@ -4727,32 +4766,21 @@ PhaseStatus Compiler::optFindLoops() } } - // Check if any of the loops need alignment - - JITDUMP("\n"); - optIdentifyLoopsForAlignment(); + JITDUMP("\nFound a total of %d general loops.\n", generalLoopCount); #if COUNT_LOOPS - totalUnnatLoopCount += loopNum; + totalUnnatLoopCount += generalLoopCount; #endif -#ifdef DEBUG - if (verbose) - { - if (loopNum > 0) - { - printf("\nFound a total of %d loops.", loopNum); - printf("\nAfter loop weight marking:\n"); - fgDispBasicBlocks(); - printf("\n"); - } - } + // Check if any of the loops need alignment + optIdentifyLoopsForAlignment(); + } - fgDebugCheckLoopTable(); +#ifdef DEBUG + fgDebugCheckLoopTable(); #endif - optLoopsMarked = true; - } + optLoopsMarked = true; return PhaseStatus::MODIFIED_EVERYTHING; } @@ -5482,8 +5510,8 @@ void Compiler::optPerformHoistExpr(GenTree* origExpr, BasicBlock* exprBb, unsign { printf("\nHoisting a copy of "); printTreeID(origExpr); - printf(" into PreHeader for loop " FMT_LP " <" FMT_BB ".." FMT_BB ">:\n", lnum, - optLoopTable[lnum].lpFirst->bbNum, optLoopTable[lnum].lpBottom->bbNum); + printf(" into PreHeader for loop " FMT_LP " <" FMT_BB ".." FMT_BB ">:\n", lnum, optLoopTable[lnum].lpTop->bbNum, + optLoopTable[lnum].lpBottom->bbNum); gtDispTree(origExpr); printf("\n"); } @@ -6752,7 +6780,7 @@ void Compiler::optHoistLoopBlocks(unsigned loopNum, ArrayStack* blo JITDUMP("\n optHoistLoopBlocks " FMT_BB " (weight=%6s) of loop " FMT_LP " <" FMT_BB ".." FMT_BB ">, firstBlock is %s\n", - block->bbNum, refCntWtd2str(blockWeight), loopNum, loopDsc->lpFirst->bbNum, loopDsc->lpBottom->bbNum, + block->bbNum, refCntWtd2str(blockWeight), loopNum, loopDsc->lpTop->bbNum, loopDsc->lpBottom->bbNum, dspBool(block == loopDsc->lpEntry)); if (blockWeight < (BB_UNITY_WEIGHT / 10)) @@ -7243,7 +7271,7 @@ void Compiler::optComputeLoopSideEffects() for (unsigned i = 0; i < lvaCount; i++) { - LclVarDsc* varDsc = &lvaTable[i]; + LclVarDsc* varDsc = lvaGetDesc(i); if (varDsc->lvTracked) { if (varTypeIsFloating(varDsc->lvType)) @@ -7511,6 +7539,15 @@ bool Compiler::optComputeLoopSideEffectsOfBlock(BasicBlock* blk) } break; +#ifdef FEATURE_HW_INTRINSICS + case GT_HWINTRINSIC: + if (tree->AsHWIntrinsic()->OperIsMemoryStore()) + { + memoryHavoc |= memoryKindSet(GcHeap, ByrefExposed); + } + break; +#endif // FEATURE_HW_INTRINSICS + case GT_LOCKADD: case GT_XORR: case GT_XAND: @@ -7519,7 +7556,6 @@ bool Compiler::optComputeLoopSideEffectsOfBlock(BasicBlock* blk) case GT_CMPXCHG: case GT_MEMORYBARRIER: { - assert(!tree->OperIs(GT_LOCKADD) && "LOCKADD should not appear before lowering"); memoryHavoc |= memoryKindSet(GcHeap, ByrefExposed); } break; @@ -7559,6 +7595,7 @@ bool Compiler::optComputeLoopSideEffectsOfBlock(BasicBlock* blk) default: // All other gtOper node kinds, leave 'memoryHavoc' unchanged (i.e. false) + assert(!tree->OperRequiresAsgFlag()); break; } } @@ -7583,10 +7620,9 @@ void Compiler::AddContainsCallAllContainingLoops(unsigned lnum) // alignment if (optLoopTable[lnum].lpChild == BasicBlock::NOT_IN_LOOP) { - BasicBlock* first = optLoopTable[lnum].lpFirst; - first->bbFlags &= ~BBF_LOOP_ALIGN; - JITDUMP("Removing LOOP_ALIGN flag for " FMT_LP " that starts at " FMT_BB " because loop has a call.\n", lnum, - first->bbNum); + BasicBlock* top = optLoopTable[lnum].lpTop; + + top->unmarkLoopAlign(this DEBUG_ARG("Loop with call")); } #endif diff --git a/src/coreclr/jit/patchpoint.cpp b/src/coreclr/jit/patchpoint.cpp index 60308075db7801..15a37150326183 100644 --- a/src/coreclr/jit/patchpoint.cpp +++ b/src/coreclr/jit/patchpoint.cpp @@ -26,7 +26,6 @@ // // * no patchpoints in handler regions // * no patchpoints for localloc methods -// * no patchpoints for synchronized methods (workaround) // class PatchpointTransformer { @@ -57,35 +56,33 @@ class PatchpointTransformer { if (block->bbFlags & BBF_PATCHPOINT) { + // We can't OSR from funclets. + // + assert(!block->hasHndIndex()); + // Clear the patchpoint flag. // block->bbFlags &= ~BBF_PATCHPOINT; - // If block is in a handler region, don't insert a patchpoint. - // We can't OSR from funclets. - // - // TODO: check this earlier, somehow, and fall back to fully - // optimizing the method (ala QJFL=0). - if (compiler->ehGetBlockHndDsc(block) != nullptr) - { - JITDUMP("Patchpoint: skipping patchpoint for " FMT_BB " as it is in a handler\n", block->bbNum); - continue; - } - - JITDUMP("Patchpoint: loop patchpoint in " FMT_BB "\n", block->bbNum); - assert(block != compiler->fgFirstBB); + JITDUMP("Patchpoint: regular patchpoint in " FMT_BB "\n", block->bbNum); TransformBlock(block); count++; } else if (block->bbFlags & BBF_PARTIAL_COMPILATION_PATCHPOINT) { - if (compiler->ehGetBlockHndDsc(block) != nullptr) - { - JITDUMP("Patchpoint: skipping partial compilation patchpoint for " FMT_BB - " as it is in a handler\n", - block->bbNum); - continue; - } + // We can't OSR from funclets. + // Also, we don't import the IL for these blocks. + // + assert(!block->hasHndIndex()); + + // If we're instrumenting, we should not have decided to + // put class probes here, as that is driven by looking at IL. + // + assert((block->bbFlags & BBF_HAS_CLASS_PROFILE) == 0); + + // Clear the partial comp flag. + // + block->bbFlags &= ~BBF_PARTIAL_COMPILATION_PATCHPOINT; JITDUMP("Patchpoint: partial compilation patchpoint in " FMT_BB "\n", block->bbNum); TransformPartialCompilation(block); @@ -273,34 +270,8 @@ PhaseStatus Compiler::fgTransformPatchpoints() // We should only be adding patchpoints at Tier0, so should not be in an inlinee assert(!compIsForInlining()); - // We currently can't do OSR in methods with localloc. - // Such methods don't have a fixed relationship between frame and stack pointers. - // - // This is true whether or not the localloc was executed in the original method. - // - // TODO: handle this case, or else check this earlier and fall back to fully - // optimizing the method (ala QJFL=0). - if (compLocallocUsed) - { - JITDUMP("\n -- unable to handle methods with localloc\n"); - return PhaseStatus::MODIFIED_NOTHING; - } - - // We currently can't do OSR in synchronized methods. We need to alter - // the logic in fgAddSyncMethodEnterExit for OSR to not try and obtain the - // monitor (since the original method will have done so) and set the monitor - // obtained flag to true (or reuse the original method slot value). - if ((info.compFlags & CORINFO_FLG_SYNCH) != 0) - { - JITDUMP("\n -- unable to handle synchronized methods\n"); - return PhaseStatus::MODIFIED_NOTHING; - } - - if (opts.IsReversePInvoke()) - { - JITDUMP(" -- unable to handle Reverse P/Invoke\n"); - return PhaseStatus::MODIFIED_NOTHING; - } + // We should be allowed to have patchpoints in this method. + assert(compCanHavePatchpoints()); PatchpointTransformer ppTransformer(this); int count = ppTransformer.Run(); diff --git a/src/coreclr/jit/rationalize.cpp b/src/coreclr/jit/rationalize.cpp index 9887153d54d47e..aae9f1bca07ace 100644 --- a/src/coreclr/jit/rationalize.cpp +++ b/src/coreclr/jit/rationalize.cpp @@ -77,8 +77,7 @@ void Rationalizer::RewriteIndir(LIR::Use& use) addr->gtGetOp2()->IsIntegralConst(0)) { GenTreeLclVarCommon* lclVarNode = addr->gtGetOp1()->AsLclVarCommon(); - unsigned lclNum = lclVarNode->GetLclNum(); - LclVarDsc* varDsc = comp->lvaTable + lclNum; + const LclVarDsc* varDsc = comp->lvaGetDesc(lclVarNode); if (indir->TypeGet() == varDsc->TypeGet()) { JITDUMP("Rewriting GT_IND(GT_ADD(LCL_VAR_ADDR,0)) to LCL_VAR\n"); @@ -582,26 +581,9 @@ Compiler::fgWalkResult Rationalizer::RewriteNode(GenTree** useEdge, Compiler::Ge const bool isLateArg = (node->gtFlags & GTF_LATE_ARG) != 0; #endif - // First, remove any preceeding list nodes, which are not otherwise visited by the tree walk. - // - // NOTE: GT_LIST nodes used by GT_HWINTRINSIC nodes will in fact be visited. - for (GenTree* prev = node->gtPrev; (prev != nullptr) && prev->OperIs(GT_LIST); prev = node->gtPrev) - { - prev->gtFlags &= ~GTF_REVERSE_OPS; - BlockRange().Remove(prev); - } - - // Now clear the REVERSE_OPS flag on the current node. + // Clear the REVERSE_OPS flag on the current node. node->gtFlags &= ~GTF_REVERSE_OPS; - // In addition, remove the current node if it is a GT_LIST node that is not an aggregate. - if (node->OperIs(GT_LIST)) - { - GenTreeArgList* list = node->AsArgList(); - BlockRange().Remove(list); - return Compiler::WALK_CONTINUE; - } - LIR::Use use; if (parentStack.Height() < 2) { @@ -754,13 +736,16 @@ Compiler::fgWalkResult Rationalizer::RewriteNode(GenTree** useEdge, Compiler::Ge simdNode->gtType = TYP_SIMD8; } // Certain SIMD trees require rationalizing. - if (simdNode->AsSIMD()->gtSIMDIntrinsicID == SIMDIntrinsicInitArray) + if (simdNode->AsSIMD()->GetSIMDIntrinsicId() == SIMDIntrinsicInitArray) { // Rewrite this as an explicit load. JITDUMP("Rewriting GT_SIMD array init as an explicit load:\n"); unsigned int baseTypeSize = genTypeSize(simdNode->GetSimdBaseType()); - GenTree* address = new (comp, GT_LEA) GenTreeAddrMode(TYP_BYREF, simdNode->gtOp1, simdNode->gtOp2, - baseTypeSize, OFFSETOF__CORINFO_Array__data); + + GenTree* base = simdNode->Op(1); + GenTree* index = (simdNode->GetOperandCount() == 2) ? simdNode->Op(2) : nullptr; + GenTree* address = new (comp, GT_LEA) + GenTreeAddrMode(TYP_BYREF, base, index, baseTypeSize, OFFSETOF__CORINFO_Array__data); GenTree* ind = comp->gtNewOperNode(GT_IND, simdType, address); BlockRange().InsertBefore(simdNode, address, ind); @@ -776,16 +761,15 @@ Compiler::fgWalkResult Rationalizer::RewriteNode(GenTree** useEdge, Compiler::Ge // of a different width. If that assumption changes, we will EITHER have to make these type // transformations during importation, and plumb the types all the way through the JIT, // OR add a lot of special handling here. - GenTree* op1 = simdNode->gtGetOp1(); - if (op1 != nullptr && op1->gtType == TYP_STRUCT) - { - op1->gtType = simdType; - } - GenTree* op2 = simdNode->gtGetOp2IfPresent(); - if (op2 != nullptr && op2->gtType == TYP_STRUCT) + // TODO-Review: the comment above seems outdated. TYP_SIMDs have been "plumbed through" the Jit. + // It may be that this code is actually dead. + for (GenTree* operand : simdNode->Operands()) { - op2->gtType = simdType; + if (operand->TypeIs(TYP_STRUCT)) + { + operand->ChangeType(simdType); + } } } } @@ -812,8 +796,8 @@ Compiler::fgWalkResult Rationalizer::RewriteNode(GenTree** useEdge, Compiler::Ge #ifdef TARGET_ARM64 // Special case for GetElement/ToScalar because they take Vector64 and return T // and T can be long or ulong. - if (!(hwIntrinsicNode->gtHWIntrinsicId == NI_Vector64_GetElement || - hwIntrinsicNode->gtHWIntrinsicId == NI_Vector64_ToScalar)) + if (!((hwIntrinsicNode->GetHWIntrinsicId() == NI_Vector64_GetElement) || + (hwIntrinsicNode->GetHWIntrinsicId() == NI_Vector64_ToScalar))) #endif { // This happens when it is consumed by a GT_RET_EXPR. @@ -957,13 +941,19 @@ PhaseStatus Rationalizer::DoPhase() { BlockRange().InsertAtEnd(LIR::Range(statement->GetTreeList(), statement->GetRootNode())); - // If this statement has correct offset information, change it into an IL offset - // node and insert it into the LIR. - if (statement->GetILOffsetX() != BAD_IL_OFFSET) + // If this statement has correct debug information, change it + // into a debug info node and insert it into the LIR. Note that + // we are currently reporting root info only back to the EE, so + // if the leaf debug info is invalid we still attach it. + // Note that we would like to have the invariant di.IsValid() + // => parent.IsValid() but it is currently not the case for + // NEWOBJ IL instructions where the debug info ends up attached + // to the allocation instead of the constructor call. + DebugInfo di = statement->GetDebugInfo(); + if (di.IsValid() || di.GetRoot().IsValid()) { - assert(!statement->IsPhiDefnStmt()); - GenTreeILOffset* ilOffset = new (comp, GT_IL_OFFSET) - GenTreeILOffset(statement->GetILOffsetX() DEBUGARG(statement->GetLastILOffset())); + GenTreeILOffset* ilOffset = + new (comp, GT_IL_OFFSET) GenTreeILOffset(di DEBUGARG(statement->GetLastILOffset())); BlockRange().InsertBefore(statement->GetTreeList(), ilOffset); } diff --git a/src/coreclr/jit/redundantbranchopts.cpp b/src/coreclr/jit/redundantbranchopts.cpp index 97f444943fbeb7..d00de9901da4dc 100644 --- a/src/coreclr/jit/redundantbranchopts.cpp +++ b/src/coreclr/jit/redundantbranchopts.cpp @@ -46,6 +46,7 @@ PhaseStatus Compiler::optRedundantBranches() // if (block->bbJumpKind == BBJ_COND) { + madeChanges |= m_compiler->optRedundantRelop(block); madeChanges |= m_compiler->optRedundantBranch(block); } } @@ -98,7 +99,7 @@ bool Compiler::optRedundantBranch(BasicBlock* const block) GenTree* const tree = jumpTree->AsOp()->gtOp1; - if (!(tree->OperKind() & GTK_RELOP)) + if (!tree->OperIsCompare()) { return false; } @@ -115,6 +116,11 @@ bool Compiler::optRedundantBranch(BasicBlock* const block) return false; } + const ValueNumStore::VN_RELATION_KIND vnRelations[] = {ValueNumStore::VN_RELATION_KIND::VRK_Same, + ValueNumStore::VN_RELATION_KIND::VRK_Reverse, + ValueNumStore::VN_RELATION_KIND::VRK_Swap, + ValueNumStore::VN_RELATION_KIND::VRK_SwapReverse}; + while (domBlock != nullptr) { // Check the current dominator @@ -133,21 +139,21 @@ bool Compiler::optRedundantBranch(BasicBlock* const block) // // Look for an exact match and also try the various swapped/reversed forms. // - const ValueNum treeVN = tree->GetVN(VNK_Liberal); - const ValueNum domCmpVN = domCmpTree->GetVN(VNK_Liberal); - const ValueNum domCmpSwpVN = - vnStore->GetRelatedRelop(domCmpVN, ValueNumStore::VN_RELATION_KIND::VRK_Swap); - const ValueNum domCmpRevVN = - vnStore->GetRelatedRelop(domCmpVN, ValueNumStore::VN_RELATION_KIND::VRK_Reverse); - const ValueNum domCmpSwpRevVN = - vnStore->GetRelatedRelop(domCmpVN, ValueNumStore::VN_RELATION_KIND::VRK_SwapReverse); - - const bool matchCmp = ((domCmpVN != ValueNumStore::NoVN) && (domCmpVN == treeVN)); - const bool matchSwp = ((domCmpSwpVN != ValueNumStore::NoVN) && (domCmpSwpVN == treeVN)); - const bool matchRev = ((domCmpRevVN != ValueNumStore::NoVN) && (domCmpRevVN == treeVN)); - const bool matchSwpRev = ((domCmpSwpRevVN != ValueNumStore::NoVN) && (domCmpSwpRevVN == treeVN)); - const bool domIsSameRelop = matchCmp || matchSwp; - const bool domIsRevRelop = matchRev || matchSwpRev; + const ValueNum treeVN = tree->GetVN(VNK_Liberal); + const ValueNum domCmpVN = domCmpTree->GetVN(VNK_Liberal); + ValueNumStore::VN_RELATION_KIND vnRelationMatch = ValueNumStore::VN_RELATION_KIND::VRK_Same; + bool matched = false; + + for (auto vnRelation : vnRelations) + { + const ValueNum relatedVN = vnStore->GetRelatedRelop(domCmpVN, vnRelation); + if ((relatedVN != ValueNumStore::NoVN) && (relatedVN == treeVN)) + { + vnRelationMatch = vnRelation; + matched = true; + break; + } + } // Note we could also infer the tree relop's value from relops higher in the dom tree // that involve the same operands but are not swaps or reverses. @@ -156,18 +162,20 @@ bool Compiler::optRedundantBranch(BasicBlock* const block) // // That is left as a future enhancement. // - if (domIsSameRelop || domIsRevRelop) + if (matched) { // The compare in "tree" is redundant. // Is there a unique path from the dominating compare? // - JITDUMP("\nDominator " FMT_BB " of " FMT_BB " has %srelop with %s liberal VN\n", domBlock->bbNum, - block->bbNum, matchSwp || matchSwpRev ? "swapped " : "", - domIsSameRelop ? "the same" : "a reverse"); + JITDUMP("\nDominator " FMT_BB " of " FMT_BB " has relop with %s liberal VN\n", domBlock->bbNum, + block->bbNum, ValueNumStore::VNRelationString(vnRelationMatch)); DISPTREE(domCmpTree); JITDUMP(" Redundant compare; current relop:\n"); DISPTREE(tree); + const bool domIsSameRelop = (vnRelationMatch == ValueNumStore::VN_RELATION_KIND::VRK_Same) || + (vnRelationMatch == ValueNumStore::VN_RELATION_KIND::VRK_Swap); + BasicBlock* const trueSuccessor = domBlock->bbJumpDest; BasicBlock* const falseSuccessor = domBlock->bbNext; const bool trueReaches = optReachable(trueSuccessor, block, domBlock); @@ -691,6 +699,447 @@ bool Compiler::optJumpThread(BasicBlock* const block, BasicBlock* const domBlock return true; } +//------------------------------------------------------------------------ +// optRedundantRelop: see if the value of tree is redundant given earlier +// relops in this block. +// +// Arguments: +// block - block of interest (BBJ_COND) +// +// Returns: +// true, if changes were made. +// +// Notes: +// +// Here's a walkthrough of how this operates. Given a block like +// +// STMT00388 (IL 0x30D... ???) +// * ASG ref +// +--* LCL_VAR ref V121 tmp97 d:1 +// \--* IND ref +// \--* LCL_VAR byref V116 tmp92 u:1 (last use) Zero Fseq[m_task] $18c +// +// STMT00390 (IL 0x30D... ???) +// * ASG bool +// +--* LCL_VAR int V123 tmp99 d:1 +// \--* NE int +// +--* LCL_VAR ref V121 tmp97 u:1 +// \--* CNS_INT ref null $VN.Null +// +// STMT00391 +// * ASG ref $133 +// +--* LCL_VAR ref V124 tmp100 d:1 $133 +// \--* IND ref $133 +// \--* CNS_INT(h) long 0x31BD3020 [ICON_STR_HDL] $34f +// +// STMT00392 +// * JTRUE void +// \--* NE int +// +--* LCL_VAR int V123 tmp99 u:1 (last use) +// \--* CNS_INT int 0 $40 +// +// We will first consider STMT00391. It is a local assign but the RHS value number +// isn't related to $8ff. So we continue searching and add V124 to the array +// of defined locals. +// +// Next we consider STMT00390. It is a local assign and the RHS value number is +// the same, $8ff. So this compare is a fwd-sub candidate. We check if any local +// on the RHS is in the defined locals array. The answer is no. So the RHS tree +// can be safely forwarded in place of the compare in STMT00392. We check if V123 is +// live out of the block. The answer is no. So This RHS tree becomes the candidate tree. +// We add V123 to the array of defined locals and keep searching. +// +// Next we consider STMT00388, It is a local assign but the RHS value number +// isn't related to $8ff. So we continue searching and add V121 to the array +// of defined locals. +// +// We reach the end of the block and stop searching. +// +// Since we found a viable candidate, we clone it and substitute into the jump: +// +// STMT00388 (IL 0x30D... ???) +// * ASG ref +// +--* LCL_VAR ref V121 tmp97 d:1 +// \--* IND ref +// \--* LCL_VAR byref V116 tmp92 u:1 (last use) Zero Fseq[m_task] $18c +// +// STMT00390 (IL 0x30D... ???) +// * ASG bool +// +--* LCL_VAR int V123 tmp99 d:1 +// \--* NE int +// +--* LCL_VAR ref V121 tmp97 u:1 +// \--* CNS_INT ref null $VN.Null +// +// STMT00391 +// * ASG ref $133 +// +--* LCL_VAR ref V124 tmp100 d:1 $133 +// \--* IND ref $133 +// \--* CNS_INT(h) long 0x31BD3020 [ICON_STR_HDL] $34f +// +// STMT00392 +// * JTRUE void +// \--* NE int +// +--* LCL_VAR ref V121 tmp97 u:1 +// \--* CNS_INT ref null $VN.Null +// +// We anticipate that STMT00390 will become dead code, and if and so we've +// eliminated one of the two compares in the block. +// +bool Compiler::optRedundantRelop(BasicBlock* const block) +{ + Statement* const stmt = block->lastStmt(); + + if (stmt == nullptr) + { + return false; + } + + // If there's just one statement, bail. + // + if (stmt == block->firstStmt()) + { + JITDUMP(" -- no, no prior stmt\n"); + return false; + } + + GenTree* const jumpTree = stmt->GetRootNode(); + + if (!jumpTree->OperIs(GT_JTRUE)) + { + return false; + } + + GenTree* const tree = jumpTree->AsOp()->gtOp1; + + if (!tree->OperIsCompare()) + { + return false; + } + + // If tree has side effects other than GTF_EXCEPT, bail. + // + if ((tree->gtFlags & GTF_SIDE_EFFECT) != 0) + { + if ((tree->gtFlags & GTF_SIDE_EFFECT) != GTF_EXCEPT) + { + return false; + } + } + + // If relop's value is known, bail. + // + const ValueNum treeVN = vnStore->VNNormalValue(tree->GetVN(VNK_Liberal)); + + if (vnStore->IsVNConstant(treeVN)) + { + JITDUMP(" -- no, jump tree cond is constant\n"); + return false; + } + + // Save off the jump tree's liberal exceptional VN. + // + const ValueNum treeExcVN = vnStore->VNExceptionSet(tree->GetVN(VNK_Liberal)); + + JITDUMP("\noptRedundantRelop in " FMT_BB "; jump tree is\n", block->bbNum); + DISPTREE(jumpTree); + + // We're going to search back to find the earliest tree in block that + // * makes the current relop redundant; + // * can safely and profitably forward substituted to the jump. + // + Statement* prevStmt = stmt; + GenTree* candidateTree = nullptr; + Statement* candidateStmt = nullptr; + ValueNumStore::VN_RELATION_KIND candidateVnRelation = ValueNumStore::VN_RELATION_KIND::VRK_Same; + bool sideEffect = false; + + const ValueNumStore::VN_RELATION_KIND vnRelations[] = {ValueNumStore::VN_RELATION_KIND::VRK_Same, + ValueNumStore::VN_RELATION_KIND::VRK_Reverse, + ValueNumStore::VN_RELATION_KIND::VRK_Swap, + ValueNumStore::VN_RELATION_KIND::VRK_SwapReverse}; + + // We need to keep track of which locals might be killed by + // the trees between the expression we want to forward substitute + // and the jump. + // + // We don't use a varset here because we are indexing by local ID, + // not by tracked index. + // + // The table size here also implicitly limits how far back we'll search. + // + enum + { + DEFINED_LOCALS_SIZE = 10 + }; + unsigned definedLocals[DEFINED_LOCALS_SIZE]; + unsigned definedLocalsCount = 0; + + while (true) + { + // If we've run a cross a side effecting pred tree, stop looking. + // + if (sideEffect) + { + break; + } + + prevStmt = prevStmt->GetPrevStmt(); + + // Backwards statement walks wrap around, so if we get + // back to stmt we've seen everything there is to see. + // + if (prevStmt == stmt) + { + break; + } + + // We are looking for ASG(lcl, ...) + // + GenTree* const prevTree = prevStmt->GetRootNode(); + + JITDUMP(" ... checking previous tree\n"); + DISPTREE(prevTree); + + // Ignore nops. + // + if (prevTree->OperIs(GT_NOP)) + { + continue; + } + + // If prevTree has side effects other than GTF_EXCEPT or GTF_ASG, bail, + // unless it is in the immediately preceeding statement. + // + // (we'll later show that any exception must come from the RHS as the LHS + // will be a simple local). + // + if ((prevTree->gtFlags & GTF_SIDE_EFFECT) != (prevTree->gtFlags & (GTF_EXCEPT | GTF_ASG))) + { + if (prevStmt->GetNextStmt() != stmt) + { + JITDUMP(" -- prev tree has side effects and is not next to jumpTree\n"); + break; + } + + JITDUMP(" -- prev tree has side effects, allowing as prev tree is immediately before jumpTree\n"); + sideEffect = true; + } + + if (!prevTree->OperIs(GT_ASG)) + { + JITDUMP(" -- prev tree not ASG\n"); + break; + } + + GenTree* const prevTreeLHS = prevTree->AsOp()->gtOp1; + GenTree* const prevTreeRHS = prevTree->AsOp()->gtOp2; + + if (!prevTreeLHS->OperIs(GT_LCL_VAR)) + { + JITDUMP(" -- prev tree not ASG(LCL...)\n"); + break; + } + + // If we are seeing PHIs we have run out of interesting stmts. + // + if (prevTreeRHS->OperIs(GT_PHI)) + { + JITDUMP(" -- prev tree is a phi\n"); + break; + } + + // Bail if RHS has an embedded assignment. We could handle this + // if we generalized the interference check we run below. + // + if ((prevTreeRHS->gtFlags & GTF_ASG) != 0) + { + JITDUMP(" -- prev tree RHS has embedded assignment\n"); + break; + } + + // Figure out what local is assigned here. + // + const unsigned prevTreeLcl = prevTreeLHS->AsLclVarCommon()->GetLclNum(); + LclVarDsc* const prevTreeLclDsc = lvaGetDesc(prevTreeLcl); + + // If local is not tracked, assume we can't safely reason about interference + // or liveness. + // + if (!prevTreeLclDsc->lvTracked) + { + JITDUMP(" -- prev tree defs untracked V%02u\n", prevTreeLcl); + break; + } + + // If we've run out of room to keep track of defined locals, bail. + // + if (definedLocalsCount >= DEFINED_LOCALS_SIZE) + { + JITDUMP(" -- ran out of space for tracking kills\n"); + break; + } + + definedLocals[definedLocalsCount++] = prevTreeLcl; + + // If the normal liberal VN of RHS is the normal liberal VN of the current tree, or is "related", + // consider forward sub. + // + const ValueNum domCmpVN = vnStore->VNNormalValue(prevTreeRHS->GetVN(VNK_Liberal)); + bool matched = false; + ValueNumStore::VN_RELATION_KIND vnRelationMatch = ValueNumStore::VN_RELATION_KIND::VRK_Same; + + for (auto vnRelation : vnRelations) + { + const ValueNum relatedVN = vnStore->GetRelatedRelop(domCmpVN, vnRelation); + if ((relatedVN != ValueNumStore::NoVN) && (relatedVN == treeVN)) + { + vnRelationMatch = vnRelation; + matched = true; + break; + } + } + + if (!matched) + { + JITDUMP(" -- prev tree VN is not related\n"); + continue; + } + + JITDUMP(" -- prev tree has relop with %s liberal VN\n", ValueNumStore::VNRelationString(vnRelationMatch)); + + // If the jump tree VN has exceptions, verify that the RHS tree has a superset. + // + if (treeExcVN != vnStore->VNForEmptyExcSet()) + { + const ValueNum prevTreeExcVN = vnStore->VNExceptionSet(prevTreeRHS->GetVN(VNK_Liberal)); + + if (!vnStore->VNExcIsSubset(prevTreeExcVN, treeExcVN)) + { + JITDUMP(" -- prev tree does not anticipate all jump tree exceptions\n"); + break; + } + } + + // See if we can safely move a copy of prevTreeRHS later, to replace tree. + // We can, if none of its lcls are killed. + // + bool interferes = false; + + for (unsigned int i = 0; i < definedLocalsCount; i++) + { + if (gtHasRef(prevTreeRHS, definedLocals[i], /*def only*/ false)) + { + JITDUMP(" -- prev tree ref to V%02u interferes\n", definedLocals[i]); + interferes = true; + break; + } + } + + if (interferes) + { + break; + } + + // Heuristic: only forward sub a relop + // + if (!prevTreeRHS->OperIsCompare()) + { + JITDUMP(" -- prev tree is not relop\n"); + continue; + } + + // If the lcl defined here is live out, forward sub is problematic. + // We'll either create a redundant tree (as the original won't be dead) + // or lose the def (if we actually move the RHS tree). + // + if (VarSetOps::IsMember(this, block->bbLiveOut, prevTreeLclDsc->lvVarIndex)) + { + JITDUMP(" -- prev tree lcl V%02u is live-out\n", prevTreeLcl); + continue; + } + + JITDUMP(" -- prev tree is viable candidate for relop fwd sub!\n"); + candidateTree = prevTreeRHS; + candidateStmt = prevStmt; + candidateVnRelation = vnRelationMatch; + } + + if (candidateTree == nullptr) + { + return false; + } + + GenTree* substituteTree = nullptr; + bool usedCopy = false; + + if (candidateStmt->GetNextStmt() == stmt) + { + // We are going forward-sub candidateTree + // + substituteTree = candidateTree; + } + else + { + // We going to forward-sub a copy of candidateTree + // + assert(!sideEffect); + substituteTree = gtCloneExpr(candidateTree); + usedCopy = true; + } + + // If we need the reverse compare, make it so. + // We also need to set a proper VN. + // + if ((candidateVnRelation == ValueNumStore::VN_RELATION_KIND::VRK_Reverse) || + (candidateVnRelation == ValueNumStore::VN_RELATION_KIND::VRK_SwapReverse)) + { + // Copy the vn info as it will be trashed when we change the oper. + // + ValueNumPair origVNP = substituteTree->gtVNPair; + + // Update the tree. Note we don't actually swap operands...? + // + substituteTree->SetOper(GenTree::ReverseRelop(substituteTree->OperGet())); + + // Compute the right set of VNs for this new tree. + // + ValueNum origNormConVN = vnStore->VNConservativeNormalValue(origVNP); + ValueNum origNormLibVN = vnStore->VNLiberalNormalValue(origVNP); + ValueNum newNormConVN = vnStore->GetRelatedRelop(origNormConVN, ValueNumStore::VN_RELATION_KIND::VRK_Reverse); + ValueNum newNormLibVN = vnStore->GetRelatedRelop(origNormLibVN, ValueNumStore::VN_RELATION_KIND::VRK_Reverse); + ValueNumPair newNormalVNP(newNormLibVN, newNormConVN); + ValueNumPair origExcVNP = vnStore->VNPExceptionSet(origVNP); + ValueNumPair newVNP = vnStore->VNPWithExc(newNormalVNP, origExcVNP); + + substituteTree->SetVNs(newVNP); + } + + // This relop is now a subtree of a jump. + // + substituteTree->gtFlags |= (GTF_RELOP_JMP_USED | GTF_DONT_CSE); + + // Swap in the new tree. + // + GenTree** const treeUse = &(jumpTree->AsOp()->gtOp1); + jumpTree->ReplaceOperand(treeUse, substituteTree); + fgSetStmtSeq(stmt); + gtUpdateStmtSideEffects(stmt); + + DEBUG_DESTROY_NODE(tree); + + // If we didn't forward sub a copy, the candidateStmt must be removed. + // + if (!usedCopy) + { + fgRemoveStmt(block, candidateStmt); + } + + JITDUMP(" -- done! new jump tree is\n"); + DISPTREE(jumpTree); + + return true; +} + //------------------------------------------------------------------------ // optReachable: see if there's a path from one block to another, // including paths involving EH flow. diff --git a/src/coreclr/jit/reglist.h b/src/coreclr/jit/reglist.h deleted file mode 100644 index c8948b80e1b1ca..00000000000000 --- a/src/coreclr/jit/reglist.h +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#ifndef REGLIST_H -#define REGLIST_H - -#include "target.h" -#include "tinyarray.h" - -// The "regList" type is a small set of registerse -#ifdef TARGET_X86 -typedef TinyArray regList; -#else -// The regList is unused for all other targets. -#endif // TARGET* - -#endif // REGLIST_H diff --git a/src/coreclr/jit/regset.cpp b/src/coreclr/jit/regset.cpp index 808a443c10a2b6..58439020fd693a 100644 --- a/src/coreclr/jit/regset.cpp +++ b/src/coreclr/jit/regset.cpp @@ -320,9 +320,8 @@ void RegSet::rsSpillTree(regNumber reg, GenTree* tree, unsigned regIdx /* =0 */) #endif // TARGET_ARM else if (tree->IsMultiRegLclVar()) { - GenTreeLclVar* lcl = tree->AsLclVar(); - LclVarDsc* varDsc = m_rsCompiler->lvaGetDesc(lcl->GetLclNum()); - treeType = varDsc->TypeGet(); + LclVarDsc* varDsc = m_rsCompiler->lvaGetDesc(tree->AsLclVar()); + treeType = varDsc->TypeGet(); } else { @@ -921,7 +920,7 @@ bool RegSet::tmpAllFree() const return false; } - for (unsigned i = 0; i < _countof(tmpUsed); i++) + for (unsigned i = 0; i < ArrLen(tmpUsed); i++) { if (tmpUsed[i] != nullptr) { diff --git a/src/coreclr/jit/scopeinfo.cpp b/src/coreclr/jit/scopeinfo.cpp index b19df93346912b..69a63e020b46cd 100644 --- a/src/coreclr/jit/scopeinfo.cpp +++ b/src/coreclr/jit/scopeinfo.cpp @@ -1093,7 +1093,7 @@ void CodeGen::siOpenScopesForNonTrackedVars(const BasicBlock* block, unsigned in while ((varScope = compiler->compGetNextEnterScope(beginOffs)) != nullptr) { - LclVarDsc* lclVarDsc = &compiler->lvaTable[varScope->vsdVarNum]; + LclVarDsc* lclVarDsc = compiler->lvaGetDesc(varScope->vsdVarNum); // Only report locals that were referenced, if we're not doing debug codegen if (compiler->opts.compDbgCode || (lclVarDsc->lvRefCnt() > 0)) @@ -1179,10 +1179,8 @@ void CodeGen::siEndBlock(BasicBlock* block) JITDUMP("Scope info: ending scope, LVnum=%u [%03X..%03X)\n", varScope->vsdLVnum, varScope->vsdLifeBeg, varScope->vsdLifeEnd); - unsigned varNum = varScope->vsdVarNum; - LclVarDsc* lclVarDsc1 = &compiler->lvaTable[varNum]; - - assert(lclVarDsc1); + unsigned varNum = varScope->vsdVarNum; + const LclVarDsc* lclVarDsc1 = compiler->lvaGetDesc(varNum); if (lclVarDsc1->lvTracked) { @@ -1278,7 +1276,7 @@ void CodeGen::siCheckVarScope(unsigned varNum, IL_OFFSET offs) } siScope* scope; - LclVarDsc* lclVarDsc1 = &compiler->lvaTable[varNum]; + LclVarDsc* lclVarDsc1 = compiler->lvaGetDesc(varNum); // If there is an open scope corresponding to varNum, find it @@ -1525,7 +1523,7 @@ void CodeGen::psiBegProlog() VarScopeDsc* varScope; while ((varScope = compiler->compGetNextEnterScope(0)) != nullptr) { - LclVarDsc* lclVarDsc = &compiler->lvaTable[varScope->vsdVarNum]; + LclVarDsc* lclVarDsc = compiler->lvaGetDesc(varScope->vsdVarNum); if (!lclVarDsc->lvIsParam) { diff --git a/src/coreclr/jit/simd.cpp b/src/coreclr/jit/simd.cpp index a3573b6eeb51e6..cfcc8f0285624b 100644 --- a/src/coreclr/jit/simd.cpp +++ b/src/coreclr/jit/simd.cpp @@ -298,7 +298,7 @@ CorInfoType Compiler::getBaseJitTypeAndSizeOfSIMDType(CORINFO_CLASS_HANDLE typeH // TODO-Throughput: implement product shipping solution to query base type. WCHAR className[256] = {0}; WCHAR* pbuf = &className[0]; - int len = _countof(className); + int len = ArrLen(className); info.compCompHnd->appendClassName((char16_t**)&pbuf, &len, typeHnd, true, false, false); noway_assert(pbuf < &className[256]); JITDUMP("SIMD Candidate Type %S\n", className); @@ -1204,9 +1204,6 @@ const SIMDIntrinsicInfo* Compiler::getSIMDIntrinsicInfo(CORINFO_CLASS_HANDLE* in case SIMDIntrinsicConvertToDouble: case SIMDIntrinsicConvertToInt32: case SIMDIntrinsicConvertToInt64: - case SIMDIntrinsicNarrow: - case SIMDIntrinsicWidenHi: - case SIMDIntrinsicWidenLo: return true; default: @@ -1280,9 +1277,7 @@ GenTree* Compiler::impSIMDPopStack(var_types type, bool expectAddr, CORINFO_CLAS if (tree->OperGet() == GT_LCL_VAR) { - unsigned lclNum = tree->AsLclVarCommon()->GetLclNum(); - LclVarDsc* lclVarDsc = &lvaTable[lclNum]; - isParam = lclVarDsc->lvIsParam; + isParam = lvaGetDesc(tree->AsLclVarCommon())->lvIsParam; } // normalize TYP_STRUCT value @@ -1466,9 +1461,8 @@ SIMDIntrinsicID Compiler::impSIMDRelOp(SIMDIntrinsicID relOpIntrinsicId, tempBaseJitType = CORINFO_TYPE_INT; initVal = gtNewIconNode((ssize_t)constVal); } - initVal->gtType = JITtype2varType(tempBaseJitType); - GenTree* constVector = - gtNewSIMDNode(simdType, initVal, nullptr, SIMDIntrinsicInit, tempBaseJitType, size); + initVal->gtType = JITtype2varType(tempBaseJitType); + GenTree* constVector = gtNewSIMDNode(simdType, initVal, SIMDIntrinsicInit, tempBaseJitType, size); // Assign constVector to a temp, since we intend to use it more than once // TODO-CQ: We have quite a few such constant vectors constructed during @@ -1536,8 +1530,7 @@ GenTree* Compiler::getOp1ForConstructor(OPCODE opcode, GenTree* newobjThis, CORI void Compiler::setLclRelatedToSIMDIntrinsic(GenTree* tree) { assert(tree->OperIsLocal()); - unsigned lclNum = tree->AsLclVarCommon()->GetLclNum(); - LclVarDsc* lclVarDsc = &lvaTable[lclNum]; + LclVarDsc* lclVarDsc = lvaGetDesc(tree->AsLclVarCommon()); lclVarDsc->lvUsedInSIMDIntrinsic = true; } @@ -1986,10 +1979,13 @@ GenTree* Compiler::impSIMDIntrinsic(OPCODE opcode, // SIMDIntrinsicInitN // op2 - list of initializer values stitched into a list // op1 - byref of vector - bool initFromFirstArgIndir = false; + IntrinsicNodeBuilder nodeBuilder(getAllocator(CMK_ASTNode), argCount - 1); + bool initFromFirstArgIndir = false; + if (simdIntrinsicID == SIMDIntrinsicInit) { op2 = impSIMDPopStack(simdBaseType); + nodeBuilder.AddOperand(0, op2); } else { @@ -2000,21 +1996,19 @@ GenTree* Compiler::impSIMDIntrinsic(OPCODE opcode, unsigned elementCount = getSIMDVectorLength(size, simdBaseType); noway_assert(initCount == elementCount); - // Build a GT_LIST with the N values. + // Build an array with the N values. // We must maintain left-to-right order of the args, but we will pop // them off in reverse order (the Nth arg was pushed onto the stack last). - GenTree* list = nullptr; - GenTree* firstArg = nullptr; GenTree* prevArg = nullptr; bool areArgsContiguous = true; for (unsigned i = 0; i < initCount; i++) { - GenTree* nextArg = impSIMDPopStack(simdBaseType); + GenTree* arg = impSIMDPopStack(simdBaseType); + if (areArgsContiguous) { - GenTree* curArg = nextArg; - firstArg = curArg; + GenTree* curArg = arg; if (prevArg != nullptr) { @@ -2024,7 +2018,8 @@ GenTree* Compiler::impSIMDIntrinsic(OPCODE opcode, prevArg = curArg; } - list = new (this, GT_LIST) GenTreeOp(GT_LIST, simdBaseType, nextArg, list); + assert(genActualType(arg) == genActualType(simdBaseType)); + nodeBuilder.AddOperand(initCount - i - 1, arg); } if (areArgsContiguous && simdBaseType == TYP_FLOAT) @@ -2033,20 +2028,15 @@ GenTree* Compiler::impSIMDIntrinsic(OPCODE opcode, // we intialize the vector from first argument address, only when // the simdBaseType is TYP_FLOAT and the arguments are located contiguously in memory initFromFirstArgIndir = true; - GenTree* op2Address = createAddressNodeForSIMDInit(firstArg, size); + GenTree* op2Address = createAddressNodeForSIMDInit(nodeBuilder.GetOperand(0), size); var_types simdType = getSIMDTypeForSize(size); op2 = gtNewOperNode(GT_IND, simdType, op2Address); } - else - { - op2 = list; - } } op1 = getOp1ForConstructor(opcode, newobjThis, clsHnd); assert(op1->TypeGet() == TYP_BYREF); - assert(genActualType(op2->TypeGet()) == genActualType(simdBaseType) || initFromFirstArgIndir); // For integral base types of size less than TYP_INT, expand the initializer // to fill size of TYP_INT bytes. @@ -2086,6 +2076,7 @@ GenTree* Compiler::impSIMDIntrinsic(OPCODE opcode, } else { + // TODO-Casts: this cast is useless. assert(simdBaseType == TYP_UBYTE || simdBaseType == TYP_USHORT); t1 = gtNewCastNode(TYP_INT, op2, false, TYP_INT); } @@ -2095,8 +2086,8 @@ GenTree* Compiler::impSIMDIntrinsic(OPCODE opcode, op2 = gtNewOperNode(GT_MUL, TYP_INT, t1, t2); // Construct a vector of TYP_INT with the new initializer and cast it back to vector of simdBaseType - simdTree = gtNewSIMDNode(simdType, op2, nullptr, simdIntrinsicID, CORINFO_TYPE_INT, size); - simdTree = gtNewSIMDNode(simdType, simdTree, nullptr, SIMDIntrinsicCast, simdBaseJitType, size); + simdTree = gtNewSIMDNode(simdType, op2, simdIntrinsicID, CORINFO_TYPE_INT, size); + simdTree = gtNewSIMDNode(simdType, simdTree, SIMDIntrinsicCast, simdBaseJitType, size); } else { @@ -2113,7 +2104,8 @@ GenTree* Compiler::impSIMDIntrinsic(OPCODE opcode, } else { - simdTree = gtNewSIMDNode(simdType, op2, nullptr, simdIntrinsicID, simdBaseJitType, size); + simdTree = new (this, GT_SIMD) + GenTreeSIMD(simdType, std::move(nodeBuilder), simdIntrinsicID, simdBaseJitType, size); } } @@ -2230,8 +2222,10 @@ GenTree* Compiler::impSIMDIntrinsic(OPCODE opcode, if (simdIntrinsicID == SIMDIntrinsicInitArray || simdIntrinsicID == SIMDIntrinsicInitArrayX) { - op1 = getOp1ForConstructor(opcode, newobjThis, clsHnd); - simdTree = gtNewSIMDNode(simdType, op2, op3, SIMDIntrinsicInitArray, simdBaseJitType, size); + op1 = getOp1ForConstructor(opcode, newobjThis, clsHnd); + simdTree = (op3 != nullptr) + ? gtNewSIMDNode(simdType, op2, op3, SIMDIntrinsicInitArray, simdBaseJitType, size) + : gtNewSIMDNode(simdType, op2, SIMDIntrinsicInitArray, simdBaseJitType, size); copyBlkDst = op1; doCopyBlk = true; } @@ -2340,7 +2334,7 @@ GenTree* Compiler::impSIMDIntrinsic(OPCODE opcode, { op1 = impSIMDPopStack(simdType, instMethod); - simdTree = gtNewSIMDNode(simdType, op1, nullptr, simdIntrinsicID, simdBaseJitType, size); + simdTree = gtNewSIMDNode(simdType, op1, simdIntrinsicID, simdBaseJitType, size); retVal = simdTree; } break; @@ -2350,7 +2344,7 @@ GenTree* Compiler::impSIMDIntrinsic(OPCODE opcode, #ifdef TARGET_64BIT op1 = impSIMDPopStack(simdType, instMethod); - simdTree = gtNewSIMDNode(simdType, op1, nullptr, simdIntrinsicID, simdBaseJitType, size); + simdTree = gtNewSIMDNode(simdType, op1, simdIntrinsicID, simdBaseJitType, size); retVal = simdTree; #else JITDUMP("SIMD Conversion to Int64 is not supported on this platform\n"); @@ -2359,50 +2353,6 @@ GenTree* Compiler::impSIMDIntrinsic(OPCODE opcode, } break; - case SIMDIntrinsicNarrow: - { - assert(!instMethod); - op2 = impSIMDPopStack(simdType); - op1 = impSIMDPopStack(simdType); - // op1 and op2 are two input Vector. - simdTree = gtNewSIMDNode(simdType, op1, op2, simdIntrinsicID, simdBaseJitType, size); - retVal = simdTree; - } - break; - - case SIMDIntrinsicWiden: - { - GenTree* dstAddrHi = impSIMDPopStack(TYP_BYREF); - GenTree* dstAddrLo = impSIMDPopStack(TYP_BYREF); - op1 = impSIMDPopStack(simdType); - // op1 must have a valid class handle; the following method will assert it. - CORINFO_CLASS_HANDLE op1Handle = gtGetStructHandle(op1); - GenTree* dupOp1 = fgInsertCommaFormTemp(&op1, op1Handle); - - // Widen the lower half and assign it to dstAddrLo. - simdTree = gtNewSIMDNode(simdType, op1, nullptr, SIMDIntrinsicWidenLo, simdBaseJitType, size); - // TODO-1stClassStructs: With the introduction of ClassLayout it would be preferrable to use - // GT_OBJ instead of GT_BLK nodes to avoid losing information about the actual vector type. - GenTree* loDest = new (this, GT_BLK) - GenTreeBlk(GT_BLK, simdType, dstAddrLo, typGetBlkLayout(getSIMDTypeSizeInBytes(clsHnd))); - GenTree* loAsg = gtNewBlkOpNode(loDest, simdTree, - false, // not volatile - true); // copyBlock - loAsg->gtFlags |= ((simdTree->gtFlags | dstAddrLo->gtFlags) & GTF_ALL_EFFECT); - - // Widen the upper half and assign it to dstAddrHi. - simdTree = gtNewSIMDNode(simdType, dupOp1, nullptr, SIMDIntrinsicWidenHi, simdBaseJitType, size); - GenTree* hiDest = new (this, GT_BLK) - GenTreeBlk(GT_BLK, simdType, dstAddrHi, typGetBlkLayout(getSIMDTypeSizeInBytes(clsHnd))); - GenTree* hiAsg = gtNewBlkOpNode(hiDest, simdTree, - false, // not volatile - true); // copyBlock - hiAsg->gtFlags |= ((simdTree->gtFlags | dstAddrHi->gtFlags) & GTF_ALL_EFFECT); - - retVal = gtNewOperNode(GT_COMMA, simdType, loAsg, hiAsg); - } - break; - case SIMDIntrinsicHWAccel: { GenTreeIntCon* intConstTree = new (this, GT_CNS_INT) GenTreeIntCon(TYP_INT, 1); diff --git a/src/coreclr/jit/simd.h b/src/coreclr/jit/simd.h index 07d70e20d503d1..8388f1ef3bc617 100644 --- a/src/coreclr/jit/simd.h +++ b/src/coreclr/jit/simd.h @@ -42,7 +42,7 @@ enum SIMDLevel extern const char* const simdIntrinsicNames[]; #endif -enum SIMDIntrinsicID +enum SIMDIntrinsicID : uint16_t { #define SIMD_INTRINSIC(m, i, id, n, r, ac, arg1, arg2, arg3, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10) SIMDIntrinsic##id, #include "simdintrinsiclist.h" diff --git a/src/coreclr/jit/simdashwintrinsic.cpp b/src/coreclr/jit/simdashwintrinsic.cpp index 3aa47a6b50d98b..7f704cd5672926 100644 --- a/src/coreclr/jit/simdashwintrinsic.cpp +++ b/src/coreclr/jit/simdashwintrinsic.cpp @@ -229,7 +229,8 @@ GenTree* Compiler::impSimdAsHWIntrinsic(NamedIntrinsic intrinsic, simdBaseJitType = getBaseJitTypeAndSizeOfSIMDType(clsHnd, &simdSize); } } - else if ((clsHnd == m_simdHandleCache->SIMDVectorHandle) && (numArgs != 0)) + else if ((clsHnd == m_simdHandleCache->SIMDVectorHandle) && (numArgs != 0) && + !SimdAsHWIntrinsicInfo::KeepBaseTypeFromRet(intrinsic)) { // We need to fixup the clsHnd in the case we are an intrinsic on Vector // The first argument will be the appropriate Vector handle to use @@ -674,6 +675,7 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, { return gtNewSimdAbsNode(retType, op1, simdBaseJitType, simdSize, /* isSimdAsHWIntrinsic */ true); } + case NI_VectorT128_Sum: { @@ -693,6 +695,7 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdAsHWIntrinsicNode(retType, op1, NI_Vector128_ToScalar, simdBaseJitType, simdSize); } + case NI_VectorT256_Sum: { // HorizontalAdd combines pairs so we need log2(vectorLength) passes to sum all elements together. @@ -730,11 +733,26 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, return gtNewSimdAsHWIntrinsicNode(retType, op1, NI_Vector128_ToScalar, simdBaseJitType, 16); } + + case NI_VectorT128_WidenLower: + case NI_VectorT256_WidenLower: + { + return gtNewSimdWidenLowerNode(retType, op1, simdBaseJitType, simdSize, + /* isSimdAsHWIntrinsic */ true); + } + + case NI_VectorT128_WidenUpper: + case NI_VectorT256_WidenUpper: + { + return gtNewSimdWidenUpperNode(retType, op1, simdBaseJitType, simdSize, + /* isSimdAsHWIntrinsic */ true); + } #elif defined(TARGET_ARM64) case NI_VectorT128_Abs: { return gtNewSimdAbsNode(retType, op1, simdBaseJitType, simdSize, /* isSimdAsHWIntrinsic */ true); } + case NI_VectorT128_Sum: { GenTree* tmp; @@ -782,6 +800,18 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, } } } + + case NI_VectorT128_WidenLower: + { + return gtNewSimdWidenLowerNode(retType, op1, simdBaseJitType, simdSize, + /* isSimdAsHWIntrinsic */ true); + } + + case NI_VectorT128_WidenUpper: + { + return gtNewSimdWidenUpperNode(retType, op1, simdBaseJitType, simdSize, + /* isSimdAsHWIntrinsic */ true); + } #else #error Unsupported platform #endif // !TARGET_XARCH && !TARGET_ARM64 @@ -915,6 +945,13 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, /* isSimdAsHWIntrinsic */ true); } + case NI_VectorT128_Narrow: + case NI_VectorT256_Narrow: + { + return gtNewSimdNarrowNode(retType, op1, op2, simdBaseJitType, simdSize, + /* isSimdAsHWIntrinsic */ true); + } + case NI_VectorT128_op_Multiply: case NI_VectorT256_op_Multiply: { @@ -954,6 +991,12 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, /* isSimdAsHWIntrinsic */ true); } + case NI_VectorT128_Narrow: + { + return gtNewSimdNarrowNode(retType, op1, op2, simdBaseJitType, simdSize, + /* isSimdAsHWIntrinsic */ true); + } + case NI_VectorT128_op_Multiply: { return gtNewSimdBinOpNode(GT_MUL, retType, op1, op2, simdBaseJitType, simdSize, diff --git a/src/coreclr/jit/simdashwintrinsic.h b/src/coreclr/jit/simdashwintrinsic.h index 176507d0b66531..a48729412b954e 100644 --- a/src/coreclr/jit/simdashwintrinsic.h +++ b/src/coreclr/jit/simdashwintrinsic.h @@ -29,6 +29,9 @@ enum class SimdAsHWIntrinsicFlag : unsigned int // Base type should come from the this argument BaseTypeFromThisArg = 0x08, + + // For SIMDVectorHandle, keep the base type from the result type + KeepBaseTypeFromRet = 0x10, }; inline SimdAsHWIntrinsicFlag operator~(SimdAsHWIntrinsicFlag value) @@ -133,6 +136,12 @@ struct SimdAsHWIntrinsicInfo SimdAsHWIntrinsicFlag flags = lookupFlags(id); return (flags & SimdAsHWIntrinsicFlag::BaseTypeFromThisArg) == SimdAsHWIntrinsicFlag::BaseTypeFromThisArg; } + + static bool KeepBaseTypeFromRet(NamedIntrinsic id) + { + SimdAsHWIntrinsicFlag flags = lookupFlags(id); + return (flags & SimdAsHWIntrinsicFlag::KeepBaseTypeFromRet) == SimdAsHWIntrinsicFlag::KeepBaseTypeFromRet; + } }; #endif // _SIMD_AS_HWINTRINSIC_H_ diff --git a/src/coreclr/jit/simdashwintrinsiclistarm64.h b/src/coreclr/jit/simdashwintrinsiclistarm64.h index 229222882f7202..2810a0e6ecfb1c 100644 --- a/src/coreclr/jit/simdashwintrinsiclistarm64.h +++ b/src/coreclr/jit/simdashwintrinsiclistarm64.h @@ -121,6 +121,7 @@ SIMD_AS_HWINTRINSIC_ID(VectorT128, LessThan, SIMD_AS_HWINTRINSIC_ID(VectorT128, LessThanOrEqual, 2, {NI_AdvSimd_CompareLessThanOrEqual, NI_AdvSimd_CompareLessThanOrEqual, NI_AdvSimd_CompareLessThanOrEqual, NI_AdvSimd_CompareLessThanOrEqual, NI_AdvSimd_CompareLessThanOrEqual, NI_AdvSimd_CompareLessThanOrEqual, NI_AdvSimd_Arm64_CompareLessThanOrEqual, NI_AdvSimd_Arm64_CompareLessThanOrEqual, NI_AdvSimd_CompareLessThanOrEqual, NI_AdvSimd_Arm64_CompareLessThanOrEqual}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT128, Max, 2, {NI_AdvSimd_Max, NI_AdvSimd_Max, NI_AdvSimd_Max, NI_AdvSimd_Max, NI_AdvSimd_Max, NI_AdvSimd_Max, NI_VectorT128_Max, NI_VectorT128_Max, NI_AdvSimd_Max, NI_AdvSimd_Arm64_Max}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT128, Min, 2, {NI_AdvSimd_Min, NI_AdvSimd_Min, NI_AdvSimd_Min, NI_AdvSimd_Min, NI_AdvSimd_Min, NI_AdvSimd_Min, NI_VectorT128_Min, NI_VectorT128_Min, NI_AdvSimd_Min, NI_AdvSimd_Arm64_Min}, SimdAsHWIntrinsicFlag::None) +SIMD_AS_HWINTRINSIC_ID(VectorT128, Narrow, 2, {NI_VectorT128_Narrow, NI_VectorT128_Narrow, NI_VectorT128_Narrow, NI_VectorT128_Narrow, NI_VectorT128_Narrow, NI_VectorT128_Narrow, NI_VectorT128_Narrow, NI_VectorT128_Narrow, NI_VectorT128_Narrow, NI_VectorT128_Narrow}, SimdAsHWIntrinsicFlag::KeepBaseTypeFromRet) SIMD_AS_HWINTRINSIC_ID(VectorT128, op_Addition, 2, {NI_AdvSimd_Add, NI_AdvSimd_Add, NI_AdvSimd_Add, NI_AdvSimd_Add, NI_AdvSimd_Add, NI_AdvSimd_Add, NI_AdvSimd_Add, NI_AdvSimd_Add, NI_AdvSimd_Add, NI_AdvSimd_Arm64_Add}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT128, op_BitwiseAnd, 2, {NI_AdvSimd_And, NI_AdvSimd_And, NI_AdvSimd_And, NI_AdvSimd_And, NI_AdvSimd_And, NI_AdvSimd_And, NI_AdvSimd_And, NI_AdvSimd_And, NI_AdvSimd_And, NI_AdvSimd_And}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT128, op_BitwiseOr, 2, {NI_AdvSimd_Or, NI_AdvSimd_Or, NI_AdvSimd_Or, NI_AdvSimd_Or, NI_AdvSimd_Or, NI_AdvSimd_Or, NI_AdvSimd_Or, NI_AdvSimd_Or, NI_AdvSimd_Or, NI_AdvSimd_Or}, SimdAsHWIntrinsicFlag::None) @@ -133,6 +134,8 @@ SIMD_AS_HWINTRINSIC_ID(VectorT128, op_Multiply, SIMD_AS_HWINTRINSIC_ID(VectorT128, op_Subtraction, 2, {NI_AdvSimd_Subtract, NI_AdvSimd_Subtract, NI_AdvSimd_Subtract, NI_AdvSimd_Subtract, NI_AdvSimd_Subtract, NI_AdvSimd_Subtract, NI_AdvSimd_Subtract, NI_AdvSimd_Subtract, NI_AdvSimd_Subtract, NI_AdvSimd_Arm64_Subtract}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT128, SquareRoot, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_AdvSimd_Arm64_Sqrt, NI_AdvSimd_Arm64_Sqrt}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT128, Sum, 1, {NI_VectorT128_Sum, NI_VectorT128_Sum, NI_VectorT128_Sum, NI_VectorT128_Sum, NI_VectorT128_Sum, NI_VectorT128_Sum, NI_VectorT128_Sum, NI_VectorT128_Sum, NI_VectorT128_Sum, NI_VectorT128_Sum}, SimdAsHWIntrinsicFlag::None) +SIMD_AS_HWINTRINSIC_ID(VectorT128, WidenLower, 1, {NI_VectorT128_WidenLower, NI_VectorT128_WidenLower, NI_VectorT128_WidenLower, NI_VectorT128_WidenLower, NI_VectorT128_WidenLower, NI_VectorT128_WidenLower, NI_VectorT128_WidenLower, NI_VectorT128_WidenLower, NI_VectorT128_WidenLower, NI_VectorT128_WidenLower}, SimdAsHWIntrinsicFlag::None) +SIMD_AS_HWINTRINSIC_ID(VectorT128, WidenUpper, 1, {NI_VectorT128_WidenUpper, NI_VectorT128_WidenUpper, NI_VectorT128_WidenUpper, NI_VectorT128_WidenUpper, NI_VectorT128_WidenUpper, NI_VectorT128_WidenUpper, NI_VectorT128_WidenUpper, NI_VectorT128_WidenUpper, NI_VectorT128_WidenUpper, NI_VectorT128_WidenUpper}, SimdAsHWIntrinsicFlag::None) #undef SIMD_AS_HWINTRINSIC_NM #undef SIMD_AS_HWINTRINSIC_ID diff --git a/src/coreclr/jit/simdashwintrinsiclistxarch.h b/src/coreclr/jit/simdashwintrinsiclistxarch.h index 92d665c2de8a71..08cf5178282832 100644 --- a/src/coreclr/jit/simdashwintrinsiclistxarch.h +++ b/src/coreclr/jit/simdashwintrinsiclistxarch.h @@ -121,6 +121,7 @@ SIMD_AS_HWINTRINSIC_ID(VectorT128, LessThan, SIMD_AS_HWINTRINSIC_ID(VectorT128, LessThanOrEqual, 2, {NI_VectorT128_LessThanOrEqual, NI_VectorT128_LessThanOrEqual, NI_VectorT128_LessThanOrEqual, NI_VectorT128_LessThanOrEqual, NI_VectorT128_LessThanOrEqual, NI_VectorT128_LessThanOrEqual, NI_VectorT128_LessThanOrEqual, NI_VectorT128_LessThanOrEqual, NI_SSE_CompareLessThanOrEqual, NI_SSE2_CompareLessThanOrEqual}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT128, Max, 2, {NI_VectorT128_Max, NI_SSE2_Max, NI_SSE2_Max, NI_VectorT128_Max, NI_VectorT128_Max, NI_VectorT128_Max, NI_VectorT128_Max, NI_VectorT128_Max, NI_SSE_Max, NI_SSE2_Max}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT128, Min, 2, {NI_VectorT128_Min, NI_SSE2_Min, NI_SSE2_Min, NI_VectorT128_Min, NI_VectorT128_Min, NI_VectorT128_Min, NI_VectorT128_Min, NI_VectorT128_Min, NI_SSE_Min, NI_SSE2_Min}, SimdAsHWIntrinsicFlag::None) +SIMD_AS_HWINTRINSIC_ID(VectorT128, Narrow, 2, {NI_VectorT128_Narrow, NI_VectorT128_Narrow, NI_VectorT128_Narrow, NI_VectorT128_Narrow, NI_VectorT128_Narrow, NI_VectorT128_Narrow, NI_VectorT128_Narrow, NI_VectorT128_Narrow, NI_VectorT128_Narrow, NI_VectorT128_Narrow}, SimdAsHWIntrinsicFlag::KeepBaseTypeFromRet) SIMD_AS_HWINTRINSIC_ID(VectorT128, op_Addition, 2, {NI_SSE2_Add, NI_SSE2_Add, NI_SSE2_Add, NI_SSE2_Add, NI_SSE2_Add, NI_SSE2_Add, NI_SSE2_Add, NI_SSE2_Add, NI_SSE_Add, NI_SSE2_Add}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT128, op_BitwiseAnd, 2, {NI_SSE2_And, NI_SSE2_And, NI_SSE2_And, NI_SSE2_And, NI_SSE2_And, NI_SSE2_And, NI_SSE2_And, NI_SSE2_And, NI_SSE_And, NI_SSE2_And}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT128, op_BitwiseOr, 2, {NI_SSE2_Or, NI_SSE2_Or, NI_SSE2_Or, NI_SSE2_Or, NI_SSE2_Or, NI_SSE2_Or, NI_SSE2_Or, NI_SSE2_Or, NI_SSE_Or, NI_SSE2_Or}, SimdAsHWIntrinsicFlag::None) @@ -133,6 +134,8 @@ SIMD_AS_HWINTRINSIC_ID(VectorT128, op_Multiply, SIMD_AS_HWINTRINSIC_ID(VectorT128, op_Subtraction, 2, {NI_SSE2_Subtract, NI_SSE2_Subtract, NI_SSE2_Subtract, NI_SSE2_Subtract, NI_SSE2_Subtract, NI_SSE2_Subtract, NI_SSE2_Subtract, NI_SSE2_Subtract, NI_SSE_Subtract, NI_SSE2_Subtract}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT128, SquareRoot, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_SSE_Sqrt, NI_SSE2_Sqrt}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT128, Sum, 1, {NI_Illegal, NI_Illegal, NI_VectorT128_Sum, NI_VectorT128_Sum, NI_VectorT128_Sum, NI_VectorT128_Sum, NI_Illegal, NI_Illegal, NI_VectorT128_Sum, NI_VectorT128_Sum}, SimdAsHWIntrinsicFlag::None) +SIMD_AS_HWINTRINSIC_ID(VectorT128, WidenLower, 1, {NI_VectorT128_WidenLower, NI_VectorT128_WidenLower, NI_VectorT128_WidenLower, NI_VectorT128_WidenLower, NI_VectorT128_WidenLower, NI_VectorT128_WidenLower, NI_VectorT128_WidenLower, NI_VectorT128_WidenLower, NI_VectorT128_WidenLower, NI_VectorT128_WidenLower}, SimdAsHWIntrinsicFlag::None) +SIMD_AS_HWINTRINSIC_ID(VectorT128, WidenUpper, 1, {NI_VectorT128_WidenUpper, NI_VectorT128_WidenUpper, NI_VectorT128_WidenUpper, NI_VectorT128_WidenUpper, NI_VectorT128_WidenUpper, NI_VectorT128_WidenUpper, NI_VectorT128_WidenUpper, NI_VectorT128_WidenUpper, NI_VectorT128_WidenUpper, NI_VectorT128_WidenUpper}, SimdAsHWIntrinsicFlag::None) // ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************* // ISA ID Name NumArg Instructions Flags @@ -160,6 +163,7 @@ SIMD_AS_HWINTRINSIC_ID(VectorT256, LessThan, SIMD_AS_HWINTRINSIC_ID(VectorT256, LessThanOrEqual, 2, {NI_VectorT256_LessThanOrEqual, NI_VectorT256_LessThanOrEqual, NI_VectorT256_LessThanOrEqual, NI_VectorT256_LessThanOrEqual, NI_VectorT256_LessThanOrEqual, NI_VectorT256_LessThanOrEqual, NI_VectorT256_LessThanOrEqual, NI_VectorT256_LessThanOrEqual, NI_AVX_CompareLessThanOrEqual, NI_AVX_CompareLessThanOrEqual}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT256, Max, 2, {NI_AVX2_Max, NI_AVX2_Max, NI_AVX2_Max, NI_AVX2_Max, NI_AVX2_Max, NI_AVX2_Max, NI_VectorT256_Max, NI_VectorT256_Max, NI_AVX_Max, NI_AVX_Max}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT256, Min, 2, {NI_AVX2_Min, NI_AVX2_Min, NI_AVX2_Min, NI_AVX2_Min, NI_AVX2_Min, NI_AVX2_Min, NI_VectorT256_Min, NI_VectorT256_Min, NI_AVX_Min, NI_AVX_Min}, SimdAsHWIntrinsicFlag::None) +SIMD_AS_HWINTRINSIC_ID(VectorT256, Narrow, 2, {NI_VectorT256_Narrow, NI_VectorT256_Narrow, NI_VectorT256_Narrow, NI_VectorT256_Narrow, NI_VectorT256_Narrow, NI_VectorT256_Narrow, NI_VectorT256_Narrow, NI_VectorT256_Narrow, NI_VectorT256_Narrow, NI_VectorT256_Narrow}, SimdAsHWIntrinsicFlag::KeepBaseTypeFromRet) SIMD_AS_HWINTRINSIC_ID(VectorT256, op_Addition, 2, {NI_AVX2_Add, NI_AVX2_Add, NI_AVX2_Add, NI_AVX2_Add, NI_AVX2_Add, NI_AVX2_Add, NI_AVX2_Add, NI_AVX2_Add, NI_AVX_Add, NI_AVX_Add}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT256, op_BitwiseAnd, 2, {NI_AVX2_And, NI_AVX2_And, NI_AVX2_And, NI_AVX2_And, NI_AVX2_And, NI_AVX2_And, NI_AVX2_And, NI_AVX2_And, NI_AVX_And, NI_AVX_And}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT256, op_BitwiseOr, 2, {NI_AVX2_Or, NI_AVX2_Or, NI_AVX2_Or, NI_AVX2_Or, NI_AVX2_Or, NI_AVX2_Or, NI_AVX2_Or, NI_AVX2_Or, NI_AVX_Or, NI_AVX_Or}, SimdAsHWIntrinsicFlag::None) @@ -172,6 +176,8 @@ SIMD_AS_HWINTRINSIC_ID(VectorT256, op_Multiply, SIMD_AS_HWINTRINSIC_ID(VectorT256, op_Subtraction, 2, {NI_AVX2_Subtract, NI_AVX2_Subtract, NI_AVX2_Subtract, NI_AVX2_Subtract, NI_AVX2_Subtract, NI_AVX2_Subtract, NI_AVX2_Subtract, NI_AVX2_Subtract, NI_AVX_Subtract, NI_AVX_Subtract}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT256, SquareRoot, 1, {NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_Illegal, NI_AVX_Sqrt, NI_AVX_Sqrt}, SimdAsHWIntrinsicFlag::None) SIMD_AS_HWINTRINSIC_ID(VectorT256, Sum, 1, {NI_Illegal, NI_Illegal, NI_VectorT256_Sum, NI_VectorT256_Sum, NI_VectorT256_Sum, NI_VectorT256_Sum, NI_Illegal, NI_Illegal, NI_VectorT256_Sum, NI_VectorT256_Sum}, SimdAsHWIntrinsicFlag::None) +SIMD_AS_HWINTRINSIC_ID(VectorT256, WidenLower, 1, {NI_VectorT256_WidenLower, NI_VectorT256_WidenLower, NI_VectorT256_WidenLower, NI_VectorT256_WidenLower, NI_VectorT256_WidenLower, NI_VectorT256_WidenLower, NI_VectorT256_WidenLower, NI_VectorT256_WidenLower, NI_VectorT256_WidenLower, NI_VectorT256_WidenLower}, SimdAsHWIntrinsicFlag::None) +SIMD_AS_HWINTRINSIC_ID(VectorT256, WidenUpper, 1, {NI_VectorT256_WidenUpper, NI_VectorT256_WidenUpper, NI_VectorT256_WidenUpper, NI_VectorT256_WidenUpper, NI_VectorT256_WidenUpper, NI_VectorT256_WidenUpper, NI_VectorT256_WidenUpper, NI_VectorT256_WidenUpper, NI_VectorT256_WidenUpper, NI_VectorT256_WidenUpper}, SimdAsHWIntrinsicFlag::None) #undef SIMD_AS_HWINTRINSIC_NM #undef SIMD_AS_HWINTRINSIC_ID diff --git a/src/coreclr/jit/simdcodegenxarch.cpp b/src/coreclr/jit/simdcodegenxarch.cpp index 4523fe48a896e4..9362aa05f521a4 100644 --- a/src/coreclr/jit/simdcodegenxarch.cpp +++ b/src/coreclr/jit/simdcodegenxarch.cpp @@ -241,86 +241,6 @@ instruction CodeGen::getOpForSIMDIntrinsic(SIMDIntrinsicID intrinsicId, var_type result = INS_cvttsd2si; break; - case SIMDIntrinsicNarrow: - // Note that for the integer types the caller must zero the upper bits of - // each source element, since the instructions saturate. - switch (baseType) - { - case TYP_INT: - case TYP_UINT: - if (compiler->getSIMDSupportLevel() >= SIMD_SSE4_Supported) - { - result = INS_packusdw; - } - else - { - result = INS_packssdw; - } - break; - case TYP_SHORT: - case TYP_USHORT: - result = INS_packuswb; - break; - default: - assert(!"Invalid baseType for SIMDIntrinsicNarrow"); - result = INS_invalid; - break; - } - break; - - case SIMDIntrinsicWidenLo: - // Some of these have multiple instruction implementations, with one instruction to widen the lo half, - // and another to widen the hi half. - switch (baseType) - { - case TYP_FLOAT: - result = INS_cvtps2pd; - break; - case TYP_INT: - case TYP_UINT: - result = INS_punpckldq; - break; - case TYP_SHORT: - case TYP_USHORT: - result = INS_punpcklwd; - break; - case TYP_BYTE: - case TYP_UBYTE: - result = INS_punpcklbw; - break; - default: - assert(!"Invalid baseType for SIMDIntrinsicWidenLo"); - result = INS_invalid; - break; - } - break; - - case SIMDIntrinsicWidenHi: - switch (baseType) - { - case TYP_FLOAT: - // For this case, we actually use the same instruction. - result = INS_cvtps2pd; - break; - case TYP_INT: - case TYP_UINT: - result = INS_punpckhdq; - break; - case TYP_SHORT: - case TYP_USHORT: - result = INS_punpckhwd; - break; - case TYP_BYTE: - case TYP_UBYTE: - result = INS_punpckhbw; - break; - default: - assert(!"Invalid baseType for SIMDIntrinsicWidenHi"); - result = INS_invalid; - break; - } - break; - case SIMDIntrinsicShiftLeftInternal: switch (baseType) { @@ -467,9 +387,9 @@ void CodeGen::genSIMDZero(var_types targetType, var_types baseType, regNumber ta // void CodeGen::genSIMDIntrinsicInit(GenTreeSIMD* simdNode) { - assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicInit); + assert(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicInit); - GenTree* op1 = simdNode->gtGetOp1(); + GenTree* op1 = simdNode->Op(1); var_types baseType = simdNode->GetSimdBaseType(); regNumber targetReg = simdNode->GetRegNum(); assert(targetReg != REG_NA); @@ -581,7 +501,7 @@ void CodeGen::genSIMDIntrinsicInit(GenTreeSIMD* simdNode) srcReg = targetReg; } - ins = getOpForSIMDIntrinsic(simdNode->gtSIMDIntrinsicID, baseType); + ins = getOpForSIMDIntrinsic(simdNode->GetSIMDIntrinsicId(), baseType); GetEmitter()->emitIns_R_R(ins, emitActualTypeSize(targetType), targetReg, srcReg); } else @@ -649,7 +569,7 @@ void CodeGen::genSIMDIntrinsicInit(GenTreeSIMD* simdNode) // void CodeGen::genSIMDIntrinsicInitN(GenTreeSIMD* simdNode) { - assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicInitN); + assert(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicInitN); // Right now this intrinsic is supported only on TYP_FLOAT vectors var_types baseType = simdNode->GetSimdBaseType(); @@ -678,19 +598,17 @@ void CodeGen::genSIMDIntrinsicInitN(GenTreeSIMD* simdNode) // We will first consume the list items in execution (left to right) order, // and record the registers. regNumber operandRegs[SIMD_INTRINSIC_MAX_PARAM_COUNT]; - unsigned initCount = 0; - for (GenTree* list = simdNode->gtGetOp1(); list != nullptr; list = list->gtGetOp2()) + size_t initCount = simdNode->GetOperandCount(); + for (size_t i = 1; i <= initCount; i++) { - assert(list->OperGet() == GT_LIST); - GenTree* listItem = list->gtGetOp1(); - assert(listItem->TypeGet() == baseType); - assert(!listItem->isContained()); - regNumber operandReg = genConsumeReg(listItem); - operandRegs[initCount] = operandReg; - initCount++; + GenTree* operand = simdNode->Op(i); + assert(operand->TypeIs(baseType)); + assert(!operand->isContained()); + + operandRegs[i - 1] = genConsumeReg(operand); } - unsigned int offset = 0; + unsigned offset = 0; for (unsigned i = 0; i < initCount; i++) { // We will now construct the vector from the list items in reverse order. @@ -729,17 +647,17 @@ void CodeGen::genSIMDIntrinsicInitN(GenTreeSIMD* simdNode) // void CodeGen::genSIMDIntrinsicUnOp(GenTreeSIMD* simdNode) { - assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicCast); + assert(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicCast); - GenTree* op1 = simdNode->gtGetOp1(); + GenTree* op1 = simdNode->Op(1); var_types baseType = simdNode->GetSimdBaseType(); regNumber targetReg = simdNode->GetRegNum(); assert(targetReg != REG_NA); var_types targetType = simdNode->TypeGet(); regNumber op1Reg = genConsumeReg(op1); - instruction ins = getOpForSIMDIntrinsic(simdNode->gtSIMDIntrinsicID, baseType); - if (simdNode->gtSIMDIntrinsicID != SIMDIntrinsicCast) + instruction ins = getOpForSIMDIntrinsic(simdNode->GetSIMDIntrinsicId(), baseType); + if (simdNode->GetSIMDIntrinsicId() != SIMDIntrinsicCast) { inst_RV_RV(ins, targetReg, op1Reg, targetType, emitActualTypeSize(targetType)); } @@ -761,17 +679,17 @@ void CodeGen::genSIMDIntrinsicUnOp(GenTreeSIMD* simdNode) // void CodeGen::genSIMDIntrinsic32BitConvert(GenTreeSIMD* simdNode) { - SIMDIntrinsicID intrinsicID = simdNode->gtSIMDIntrinsicID; + SIMDIntrinsicID intrinsicID = simdNode->GetSIMDIntrinsicId(); assert((intrinsicID == SIMDIntrinsicConvertToSingle) || (intrinsicID == SIMDIntrinsicConvertToInt32)); - GenTree* op1 = simdNode->gtGetOp1(); + GenTree* op1 = simdNode->Op(1); var_types baseType = simdNode->GetSimdBaseType(); regNumber targetReg = simdNode->GetRegNum(); assert(targetReg != REG_NA); var_types targetType = simdNode->TypeGet(); regNumber op1Reg = genConsumeReg(op1); - instruction ins = getOpForSIMDIntrinsic(simdNode->gtSIMDIntrinsicID, baseType); + instruction ins = getOpForSIMDIntrinsic(simdNode->GetSIMDIntrinsicId(), baseType); if (intrinsicID == SIMDIntrinsicConvertToSingle && baseType == TYP_UINT) { regNumber tmpIntReg = simdNode->GetSingleTempReg(RBM_ALLINT); @@ -892,10 +810,10 @@ void CodeGen::genSIMDLo64BitConvert(SIMDIntrinsicID intrinsicID, // void CodeGen::genSIMDIntrinsic64BitConvert(GenTreeSIMD* simdNode) { - SIMDIntrinsicID intrinsicID = simdNode->gtSIMDIntrinsicID; + SIMDIntrinsicID intrinsicID = simdNode->GetSIMDIntrinsicId(); assert((intrinsicID == SIMDIntrinsicConvertToDouble) || (intrinsicID == SIMDIntrinsicConvertToInt64)); - GenTree* op1 = simdNode->gtGetOp1(); + GenTree* op1 = simdNode->Op(1); var_types baseType = simdNode->GetSimdBaseType(); regNumber targetReg = simdNode->GetRegNum(); assert(targetReg != REG_NA); @@ -1193,245 +1111,6 @@ void CodeGen::genSIMDExtractUpperHalf(GenTreeSIMD* simdNode, regNumber srcReg, r } } -//-------------------------------------------------------------------------------- -// genSIMDIntrinsicWiden: Generate code for SIMD Intrinsic Widen operations -// -// Arguments: -// simdNode - The GT_SIMD node -// -// Notes: -// The Widen intrinsics are broken into separate intrinsics for the two results. -// -void CodeGen::genSIMDIntrinsicWiden(GenTreeSIMD* simdNode) -{ - assert((simdNode->gtSIMDIntrinsicID == SIMDIntrinsicWidenLo) || - (simdNode->gtSIMDIntrinsicID == SIMDIntrinsicWidenHi)); - - GenTree* op1 = simdNode->gtGetOp1(); - var_types baseType = simdNode->GetSimdBaseType(); - regNumber targetReg = simdNode->GetRegNum(); - assert(targetReg != REG_NA); - var_types simdType = simdNode->TypeGet(); - SIMDLevel level = compiler->getSIMDSupportLevel(); - - genConsumeOperands(simdNode); - regNumber op1Reg = op1->GetRegNum(); - regNumber srcReg = op1Reg; - emitAttr emitSize = emitActualTypeSize(simdType); - instruction widenIns = getOpForSIMDIntrinsic(simdNode->gtSIMDIntrinsicID, baseType); - - if (baseType == TYP_FLOAT) - { - if (simdNode->gtSIMDIntrinsicID == SIMDIntrinsicWidenHi) - { - genSIMDExtractUpperHalf(simdNode, srcReg, targetReg); - srcReg = targetReg; - } - inst_RV_RV(widenIns, targetReg, srcReg, simdType); - } - else - { - // We will generate the following on AVX: - // vpermq targetReg, op1Reg, 0xd4|0xe8 - // vpxor tmpReg, tmpReg - // vpcmpgt[b|w|d] tmpReg, targetReg (if basetype is signed) - // vpunpck[l|h][bw|wd|dq] targetReg, tmpReg - regNumber tmpReg = simdNode->GetSingleTempReg(RBM_ALLFLOAT); - assert(tmpReg != op1Reg); - - if (level == SIMD_AVX2_Supported) - { - // permute op1Reg and put it into targetReg - unsigned ival = 0xd4; - if (simdNode->gtSIMDIntrinsicID == SIMDIntrinsicWidenHi) - { - ival = 0xe8; - } - assert((ival >= 0) && (ival <= 255)); - GetEmitter()->emitIns_R_R_I(INS_vpermq, emitSize, targetReg, op1Reg, (int8_t)ival); - } - else - { - inst_Mov(simdType, targetReg, op1Reg, /* canSkip */ true); - } - - genSIMDZero(simdType, baseType, tmpReg); - if (!varTypeIsUnsigned(baseType)) - { - instruction compareIns = INS_invalid; - - if (baseType == TYP_INT) - { - compareIns = INS_pcmpgtd; - } - else if (baseType == TYP_SHORT) - { - compareIns = INS_pcmpgtw; - } - else if (baseType == TYP_BYTE) - { - compareIns = INS_pcmpgtb; - } - else if ((baseType == TYP_LONG) && (compiler->getSIMDSupportLevel() >= SIMD_SSE4_Supported)) - { - compareIns = INS_pcmpgtq; - } - - assert(compareIns != INS_invalid); - inst_RV_RV(compareIns, tmpReg, targetReg, simdType, emitSize); - } - inst_RV_RV(widenIns, targetReg, tmpReg, simdType); - } - genProduceReg(simdNode); -} - -//-------------------------------------------------------------------------------- -// genSIMDIntrinsicNarrow: Generate code for SIMD Intrinsic Narrow operations -// -// Arguments: -// simdNode - The GT_SIMD node -// -// Notes: -// This intrinsic takes two arguments. The first operand is narrowed to produce the -// lower elements of the results, and the second operand produces the high elements. -// -void CodeGen::genSIMDIntrinsicNarrow(GenTreeSIMD* simdNode) -{ - assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicNarrow); - - GenTree* op1 = simdNode->gtGetOp1(); - GenTree* op2 = simdNode->gtGetOp2(); - var_types baseType = simdNode->GetSimdBaseType(); - regNumber targetReg = simdNode->GetRegNum(); - assert(targetReg != REG_NA); - var_types simdType = simdNode->TypeGet(); - emitAttr emitSize = emitTypeSize(simdType); - SIMDLevel level = compiler->getSIMDSupportLevel(); - - genConsumeOperands(simdNode); - regNumber op1Reg = op1->GetRegNum(); - regNumber op2Reg = op2->GetRegNum(); - if (baseType == TYP_DOUBLE) - { - regNumber tmpReg = simdNode->GetSingleTempReg(RBM_ALLFLOAT); - - inst_RV_RV(INS_cvtpd2ps, targetReg, op1Reg, simdType); - inst_RV_RV(INS_cvtpd2ps, tmpReg, op2Reg, simdType); - // Now insert the high-order result (in tmpReg) into the upper half of targetReg. - if (level == SIMD_AVX2_Supported) - { - GetEmitter()->emitIns_R_R_I(INS_vinsertf128, EA_32BYTE, targetReg, tmpReg, 0x01); - } - else - { - inst_RV_RV_IV(INS_shufps, EA_16BYTE, targetReg, tmpReg, (int8_t)SHUFFLE_YXYX); - } - } - else if (varTypeIsLong(baseType)) - { - if (level == SIMD_AVX2_Supported) - { - // We have 8 long elements, 0-3 in op1Reg, 4-7 in op2Reg. - // We will generate the following: - // vextracti128 tmpReg, op1Reg, 1 (extract elements 2 and 3 into tmpReg) - // vextracti128 tmpReg2, op2Reg, 1 (extract elements 6 and 7 into tmpReg2) - // vinserti128 tmpReg, tmpReg2, 1 (insert elements 6 and 7 into the high half of tmpReg) - // mov tmpReg2, op1Reg - // vinserti128 tmpReg2, op2Reg, 1 (insert elements 4 and 5 into the high half of tmpReg2) - // pshufd tmpReg, tmpReg, XXZX ( - - 7L 6L - - 3L 2L) in tmpReg - // pshufd tgtReg, tmpReg2, XXZX ( - - 5L 4L - - 1L 0L) in tgtReg - // punpcklqdq tgtReg, tmpReg - regNumber tmpReg = simdNode->ExtractTempReg(RBM_ALLFLOAT); - regNumber tmpReg2 = simdNode->GetSingleTempReg(RBM_ALLFLOAT); - GetEmitter()->emitIns_R_R_I(INS_vextracti128, EA_32BYTE, tmpReg, op1Reg, 0x01); - GetEmitter()->emitIns_R_R_I(INS_vextracti128, EA_32BYTE, tmpReg2, op2Reg, 0x01); - GetEmitter()->emitIns_R_R_I(INS_vinserti128, EA_32BYTE, tmpReg, tmpReg2, 0x01); - inst_Mov(simdType, tmpReg2, op1Reg, /* canSkip */ false, emitSize); - GetEmitter()->emitIns_R_R_I(INS_vinserti128, EA_32BYTE, tmpReg2, op2Reg, 0x01); - GetEmitter()->emitIns_R_R_I(INS_pshufd, emitSize, tmpReg, tmpReg, (int8_t)SHUFFLE_XXZX); - GetEmitter()->emitIns_R_R_I(INS_pshufd, emitSize, targetReg, tmpReg2, (int8_t)SHUFFLE_XXZX); - inst_RV_RV_RV(INS_punpcklqdq, targetReg, targetReg, tmpReg, emitSize); - } - else - { - // We will generate the following: - // pshufd targetReg, op1Reg, ZXXX (extract the low 32-bits into the upper two 32-bit elements) - // psrldq targetReg, 8 (shift them right to get zeros in the high elements) - // pshufd tmpReg, op2Reg, XXZX (same as above, but extract into the lower two 32-bit elements) - // pslldq tmpReg, 8 (now shift these left to get zeros in the low elements) - // por targetReg, tmpReg - regNumber tmpReg = simdNode->GetSingleTempReg(RBM_ALLFLOAT); - instruction shiftLeftIns = getOpForSIMDIntrinsic(SIMDIntrinsicShiftLeftInternal, TYP_SIMD16); - instruction shiftRightIns = getOpForSIMDIntrinsic(SIMDIntrinsicShiftRightInternal, TYP_SIMD16); - emitAttr emitSize = emitTypeSize(simdType); - - GetEmitter()->emitIns_R_R_I(INS_pshufd, emitSize, targetReg, op1Reg, (int8_t)SHUFFLE_ZXXX); - GetEmitter()->emitIns_R_I(shiftRightIns, emitSize, targetReg, 8); - GetEmitter()->emitIns_R_R_I(INS_pshufd, emitSize, tmpReg, op2Reg, (int8_t)SHUFFLE_XXZX); - GetEmitter()->emitIns_R_I(shiftLeftIns, emitSize, tmpReg, 8); - inst_RV_RV(INS_por, targetReg, tmpReg, simdType); - } - } - else - { - // We will generate the following: - // mov targetReg, op1Reg - // mov tmpReg, op2Reg - // psll? targetReg, shiftCount - // pslr? targetReg, shiftCount - // psll? tmpReg, shiftCount - // pslr? tmpReg, shiftCount - // targetReg, tmpReg - // Where shiftCount is the size of the target baseType (i.e. half the size of the source baseType), - // and is the appropriate instruction to pack the result (note that we have to truncate to - // get CLR type semantics; otherwise it will saturate). - // - int shiftCount = genTypeSize(baseType) * (BITS_IN_BYTE / 2); - instruction ins = getOpForSIMDIntrinsic(simdNode->gtSIMDIntrinsicID, baseType); - instruction shiftLeftIns = getOpForSIMDIntrinsic(SIMDIntrinsicShiftLeftInternal, baseType); - instruction shiftRightIns = getOpForSIMDIntrinsic(SIMDIntrinsicShiftRightInternal, baseType); - - assert((shiftCount >= 0) && (shiftCount <= 127)); - - if (level == SIMD_AVX2_Supported) - { - regNumber tmpReg = simdNode->ExtractTempReg(RBM_ALLFLOAT); - regNumber tmpReg2 = simdNode->GetSingleTempReg(RBM_ALLFLOAT); - - // The AVX instructions generally operate on "lanes", so we have to permute the - // inputs so that the destination register has the low 128-bit halves of the two - // inputs, and 'tmpReg' has the high 128-bit halves of the two inputs. - GetEmitter()->emitIns_R_R_R_I(INS_vperm2i128, emitSize, tmpReg2, op1Reg, op2Reg, 0x20); - GetEmitter()->emitIns_R_R_R_I(INS_vperm2i128, emitSize, tmpReg, op1Reg, op2Reg, 0x31); - GetEmitter()->emitIns_R_I(shiftLeftIns, emitSize, tmpReg2, shiftCount); - GetEmitter()->emitIns_R_I(shiftRightIns, emitSize, tmpReg2, shiftCount); - GetEmitter()->emitIns_R_I(shiftLeftIns, emitSize, tmpReg, shiftCount); - GetEmitter()->emitIns_R_I(shiftRightIns, emitSize, tmpReg, shiftCount); - inst_RV_RV_RV(ins, targetReg, tmpReg2, tmpReg, emitActualTypeSize(simdType)); - } - else - { - regNumber tmpReg = simdNode->GetSingleTempReg(RBM_ALLFLOAT); - - inst_Mov(simdType, targetReg, op1Reg, /* canSkip */ false, emitSize); - inst_Mov(simdType, tmpReg, op2Reg, /* canSkip */ false, emitSize); - - instruction tmpShiftRight = shiftRightIns; - if ((baseType == TYP_INT || baseType == TYP_UINT) && level == SIMD_SSE2_Supported) - { - tmpShiftRight = INS_psrad; - } - - GetEmitter()->emitIns_R_I(shiftLeftIns, emitSize, targetReg, shiftCount); - GetEmitter()->emitIns_R_I(tmpShiftRight, emitSize, targetReg, shiftCount); - GetEmitter()->emitIns_R_I(shiftLeftIns, emitSize, tmpReg, shiftCount); - GetEmitter()->emitIns_R_I(tmpShiftRight, emitSize, tmpReg, shiftCount); - inst_RV_RV(ins, targetReg, tmpReg, simdType); - } - } - genProduceReg(simdNode); -} - //-------------------------------------------------------------------------------- // genSIMDIntrinsicBinOp: Generate code for SIMD Intrinsic binary operations // add, sub, mul, bit-wise And, AndNot and Or. @@ -1444,22 +1123,23 @@ void CodeGen::genSIMDIntrinsicNarrow(GenTreeSIMD* simdNode) // void CodeGen::genSIMDIntrinsicBinOp(GenTreeSIMD* simdNode) { - assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicSub || simdNode->gtSIMDIntrinsicID == SIMDIntrinsicBitwiseAnd || - simdNode->gtSIMDIntrinsicID == SIMDIntrinsicBitwiseOr); + assert((simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicSub) || + (simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicBitwiseAnd) || + (simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicBitwiseOr)); - GenTree* op1 = simdNode->gtGetOp1(); - GenTree* op2 = simdNode->gtGetOp2(); + GenTree* op1 = simdNode->Op(1); + GenTree* op2 = simdNode->Op(2); var_types baseType = simdNode->GetSimdBaseType(); regNumber targetReg = simdNode->GetRegNum(); assert(targetReg != REG_NA); var_types targetType = simdNode->TypeGet(); - genConsumeOperands(simdNode); + genConsumeMultiOpOperands(simdNode); regNumber op1Reg = op1->GetRegNum(); regNumber op2Reg = op2->GetRegNum(); regNumber otherReg = op2Reg; - instruction ins = getOpForSIMDIntrinsic(simdNode->gtSIMDIntrinsicID, baseType); + instruction ins = getOpForSIMDIntrinsic(simdNode->GetSIMDIntrinsicId(), baseType); // Currently AVX doesn't support integer. // if the ins is INS_cvtsi2ss or INS_cvtsi2sd, we won't use AVX. @@ -1497,19 +1177,19 @@ void CodeGen::genSIMDIntrinsicBinOp(GenTreeSIMD* simdNode) // void CodeGen::genSIMDIntrinsicRelOp(GenTreeSIMD* simdNode) { - GenTree* op1 = simdNode->gtGetOp1(); - GenTree* op2 = simdNode->gtGetOp2(); + GenTree* op1 = simdNode->Op(1); + GenTree* op2 = simdNode->Op(2); var_types baseType = simdNode->GetSimdBaseType(); regNumber targetReg = simdNode->GetRegNum(); var_types targetType = simdNode->TypeGet(); SIMDLevel level = compiler->getSIMDSupportLevel(); - genConsumeOperands(simdNode); + genConsumeMultiOpOperands(simdNode); regNumber op1Reg = op1->GetRegNum(); regNumber op2Reg = op2->GetRegNum(); regNumber otherReg = op2Reg; - switch (simdNode->gtSIMDIntrinsicID) + switch (simdNode->GetSIMDIntrinsicId()) { case SIMDIntrinsicEqual: { @@ -1525,7 +1205,7 @@ void CodeGen::genSIMDIntrinsicRelOp(GenTreeSIMD* simdNode) #endif unsigned ival = 0; - instruction ins = getOpForSIMDIntrinsic(simdNode->gtSIMDIntrinsicID, baseType, &ival); + instruction ins = getOpForSIMDIntrinsic(simdNode->GetSIMDIntrinsicId(), baseType, &ival); // targetReg = op1reg > op2reg // Therefore, we can optimize if op1Reg == targetReg @@ -1534,7 +1214,7 @@ void CodeGen::genSIMDIntrinsicRelOp(GenTreeSIMD* simdNode) { if (op2Reg == targetReg) { - assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicEqual); + assert(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicEqual); otherReg = op1Reg; } else @@ -1574,11 +1254,11 @@ void CodeGen::genSIMDIntrinsicRelOp(GenTreeSIMD* simdNode) // void CodeGen::genSIMDIntrinsicShuffleSSE2(GenTreeSIMD* simdNode) { - assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicShuffleSSE2); + assert(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicShuffleSSE2); noway_assert(compiler->getSIMDSupportLevel() == SIMD_SSE2_Supported); - GenTree* op1 = simdNode->gtGetOp1(); - GenTree* op2 = simdNode->gtGetOp2(); + GenTree* op1 = simdNode->Op(1); + GenTree* op2 = simdNode->Op(2); assert(op2->isContained()); assert(op2->IsCnsIntOrI()); ssize_t shuffleControl = op2->AsIntConCommon()->IconValue(); @@ -1590,7 +1270,7 @@ void CodeGen::genSIMDIntrinsicShuffleSSE2(GenTreeSIMD* simdNode) regNumber op1Reg = genConsumeReg(op1); inst_Mov(targetType, targetReg, op1Reg, /* canSkip */ true); - instruction ins = getOpForSIMDIntrinsic(simdNode->gtSIMDIntrinsicID, baseType); + instruction ins = getOpForSIMDIntrinsic(simdNode->GetSIMDIntrinsicId(), baseType); assert((shuffleControl >= 0) && (shuffleControl <= 255)); GetEmitter()->emitIns_R_R_I(ins, emitTypeSize(baseType), targetReg, targetReg, (int8_t)shuffleControl); genProduceReg(simdNode); @@ -1844,9 +1524,9 @@ void CodeGen::genPutArgStkSIMD12(GenTree* treeNode) // void CodeGen::genSIMDIntrinsicUpperSave(GenTreeSIMD* simdNode) { - assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicUpperSave); + assert(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicUpperSave); - GenTree* op1 = simdNode->gtGetOp1(); + GenTree* op1 = simdNode->Op(1); assert(op1->IsLocal() && op1->TypeGet() == TYP_SIMD32); regNumber targetReg = simdNode->GetRegNum(); regNumber op1Reg = genConsumeReg(op1); @@ -1886,9 +1566,9 @@ void CodeGen::genSIMDIntrinsicUpperSave(GenTreeSIMD* simdNode) // void CodeGen::genSIMDIntrinsicUpperRestore(GenTreeSIMD* simdNode) { - assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicUpperRestore); + assert(simdNode->GetSIMDIntrinsicId() == SIMDIntrinsicUpperRestore); - GenTree* op1 = simdNode->gtGetOp1(); + GenTree* op1 = simdNode->Op(1); assert(op1->IsLocal() && op1->TypeGet() == TYP_SIMD32); regNumber srcReg = simdNode->GetRegNum(); regNumber lclVarReg = genConsumeReg(op1); @@ -1931,7 +1611,7 @@ void CodeGen::genSIMDIntrinsic(GenTreeSIMD* simdNode) noway_assert(!"SIMD intrinsic with unsupported base type."); } - switch (simdNode->gtSIMDIntrinsicID) + switch (simdNode->GetSIMDIntrinsicId()) { case SIMDIntrinsicInit: genSIMDIntrinsicInit(simdNode); @@ -1955,15 +1635,6 @@ void CodeGen::genSIMDIntrinsic(GenTreeSIMD* simdNode) genSIMDIntrinsic64BitConvert(simdNode); break; - case SIMDIntrinsicWidenLo: - case SIMDIntrinsicWidenHi: - genSIMDIntrinsicWiden(simdNode); - break; - - case SIMDIntrinsicNarrow: - genSIMDIntrinsicNarrow(simdNode); - break; - case SIMDIntrinsicSub: case SIMDIntrinsicBitwiseAnd: case SIMDIntrinsicBitwiseOr: diff --git a/src/coreclr/jit/simdintrinsiclist.h b/src/coreclr/jit/simdintrinsiclist.h index 258fecfdd65783..0b354b533702c3 100644 --- a/src/coreclr/jit/simdintrinsiclist.h +++ b/src/coreclr/jit/simdintrinsiclist.h @@ -78,10 +78,6 @@ SIMD_INTRINSIC("ConvertToDouble", false, ConvertToDouble, SIMD_INTRINSIC("ConvertToInt32", false, ConvertToInt32, "ConvertToInt32", TYP_STRUCT, 1, {TYP_STRUCT, TYP_UNDEF, TYP_UNDEF}, {TYP_FLOAT, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF}) // Convert double to long SIMD_INTRINSIC("ConvertToInt64", false, ConvertToInt64, "ConvertToInt64", TYP_STRUCT, 1, {TYP_STRUCT, TYP_UNDEF, TYP_UNDEF}, {TYP_DOUBLE, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF}) -// Narrow two input Vectors to a single Vector. The return value's lower elements are the elements from src1, and the upper elements are from src2. -SIMD_INTRINSIC("Narrow", false, Narrow, "Narrow", TYP_STRUCT, 2, {TYP_STRUCT, TYP_STRUCT, TYP_UNDEF}, {TYP_INT, TYP_DOUBLE, TYP_LONG, TYP_USHORT, TYP_SHORT, TYP_UINT, TYP_ULONG, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF}) -// Widen one input Vector to two Vectors: dest1 contains the lower half of elements in src, and dest2 contains the upper half of elements in src. -SIMD_INTRINSIC("Widen", false, Widen, "Widen", TYP_VOID, 3, {TYP_STRUCT, TYP_BYREF, TYP_BYREF}, {TYP_INT, TYP_FLOAT, TYP_USHORT, TYP_UBYTE, TYP_BYTE, TYP_SHORT, TYP_UINT, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF}) // Miscellaneous SIMD_INTRINSIC("get_IsHardwareAccelerated", false, HWAccel, "HWAccel", TYP_BOOL, 0, {TYP_UNDEF, TYP_UNDEF, TYP_UNDEF}, {TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF}) @@ -100,10 +96,6 @@ SIMD_INTRINSIC("ShiftRightInternal", false, ShiftRightInternal, SIMD_INTRINSIC("UpperSave", false, UpperSave, "UpperSave Internal", TYP_STRUCT, 2, {TYP_UNDEF, TYP_UNDEF, TYP_UNDEF}, {TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF}) SIMD_INTRINSIC("UpperRestore", false, UpperRestore, "UpperRestore Internal", TYP_STRUCT, 2, {TYP_UNDEF, TYP_UNDEF, TYP_UNDEF}, {TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF}) -// Internal intrinsics for Widen -SIMD_INTRINSIC("WidenHi", false, WidenHi, "WidenHi", TYP_VOID, 2, {TYP_UNDEF, TYP_UNDEF, TYP_UNDEF}, {TYP_INT, TYP_FLOAT, TYP_USHORT, TYP_UBYTE, TYP_BYTE, TYP_SHORT, TYP_UINT, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF}) -SIMD_INTRINSIC("WidenLo", false, WidenLo, "WidenLo", TYP_VOID, 2, {TYP_UNDEF, TYP_UNDEF, TYP_UNDEF}, {TYP_INT, TYP_FLOAT, TYP_USHORT, TYP_UBYTE, TYP_BYTE, TYP_SHORT, TYP_UINT, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF}) - SIMD_INTRINSIC(nullptr, false, Invalid, "Invalid", TYP_UNDEF, 0, {TYP_UNDEF, TYP_UNDEF, TYP_UNDEF}, {TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF, TYP_UNDEF}) #undef SIMD_INTRINSIC #else // !defined(TARGET_XARCH) && !defined(TARGET_ARM64) diff --git a/src/coreclr/jit/smdata.cpp b/src/coreclr/jit/smdata.cpp index 30b0a7b81d7bec..0d6ec896552bb7 100644 --- a/src/coreclr/jit/smdata.cpp +++ b/src/coreclr/jit/smdata.cpp @@ -269,7 +269,7 @@ const SMState g_SMStates[] = }; // clang-format on -static_assert_no_msg(NUM_SM_STATES == _countof(g_SMStates)); +static_assert_no_msg(NUM_SM_STATES == ArrLen(g_SMStates)); const SMState* gp_SMStates = g_SMStates; diff --git a/src/coreclr/jit/smweights.cpp b/src/coreclr/jit/smweights.cpp index ec55072436eb2c..02aa5d647f7db7 100644 --- a/src/coreclr/jit/smweights.cpp +++ b/src/coreclr/jit/smweights.cpp @@ -268,6 +268,6 @@ const short g_StateWeights[] = { DEFAULT_WEIGHT_VALUE, // state 249 [ldarga.s -> ldfld -> ldarga.s -> ldfld -> sub] }; -static_assert_no_msg(NUM_SM_STATES == _countof(g_StateWeights)); +static_assert_no_msg(NUM_SM_STATES == ArrLen(g_StateWeights)); const short* gp_StateWeights = g_StateWeights; diff --git a/src/coreclr/jit/ssabuilder.cpp b/src/coreclr/jit/ssabuilder.cpp index c1f056c7d2aba9..b9c506e29400a8 100644 --- a/src/coreclr/jit/ssabuilder.cpp +++ b/src/coreclr/jit/ssabuilder.cpp @@ -1268,7 +1268,7 @@ void SsaBuilder::AddPhiArgsToSuccessors(BasicBlock* block) // If the variable is live-out of "blk", and is therefore live on entry to the try-block-start // "succ", then we make sure the current SSA name for the // var is one of the args of the phi node. If not, go on. - LclVarDsc* lclVarDsc = &m_pCompiler->lvaTable[lclNum]; + const LclVarDsc* lclVarDsc = m_pCompiler->lvaGetDesc(lclNum); if (!lclVarDsc->lvTracked || !VarSetOps::IsMember(m_pCompiler, block->bbLiveOut, lclVarDsc->lvVarIndex)) { @@ -1361,7 +1361,7 @@ void SsaBuilder::RenameVariables() continue; } - LclVarDsc* varDsc = &m_pCompiler->lvaTable[lclNum]; + LclVarDsc* varDsc = m_pCompiler->lvaGetDesc(lclNum); assert(varDsc->lvTracked); if (varDsc->lvIsParam || m_pCompiler->info.compInitMem || varDsc->lvMustInit || @@ -1628,7 +1628,7 @@ void SsaBuilder::SetupBBRoot() // bool SsaBuilder::IncludeInSsa(unsigned lclNum) { - LclVarDsc* varDsc = &m_pCompiler->lvaTable[lclNum]; + LclVarDsc* varDsc = m_pCompiler->lvaGetDesc(lclNum); if (varDsc->IsAddressExposed()) { diff --git a/src/coreclr/jit/ssabuilder.h b/src/coreclr/jit/ssabuilder.h index 6d1a9fbd5542f2..68ebb084f08dbc 100644 --- a/src/coreclr/jit/ssabuilder.h +++ b/src/coreclr/jit/ssabuilder.h @@ -29,8 +29,9 @@ class SsaBuilder // Requires stmt nodes to be already sequenced in evaluation order. Analyzes the graph // for introduction of phi-nodes as GT_PHI tree nodes at the beginning of each block. // Each GT_LCL_VAR is given its ssa number through its GetSsaNum() field in the node. - // Each GT_PHI node will have gtOp1 set to lhs of the phi node and the gtOp2 to be a - // GT_LIST of GT_PHI_ARG. Each use or def is denoted by the corresponding GT_LCL_VAR + // Each GT_PHI node will be under a GT_ASG node with the LHS set to the local node and + // the RHS to the GT_PHI itself. The inputs to the PHI are represented as a linked list + // of GT_PHI_ARG nodes. Each use or def is denoted by the corresponding GT_LCL_VAR // tree. For example, to get all uses of a particular variable fully defined by its // lclNum and ssaNum, one would use m_uses and look up all the uses. Similarly, a single // def of an SSA variable can be looked up similarly using m_defs member. @@ -70,7 +71,7 @@ class SsaBuilder // Requires "postOrder" to hold the blocks of the flowgraph in topologically sorted order. Requires // count to be the valid entries in the "postOrder" array. Inserts GT_PHI nodes at the beginning // of basic blocks that require them like so: - // GT_ASG(GT_LCL_VAR, GT_PHI(GT_PHI_ARG(GT_LCL_VAR, Block*), GT_LIST(GT_PHI_ARG(GT_LCL_VAR, Block*), NULL)); + // GT_ASG(GT_LCL_VAR, GT_PHI(GT_PHI_ARG(ssaNum, Block*), GT_PHI_ARG(ssaNum, Block*), ...)); void InsertPhiFunctions(BasicBlock** postOrder, int count); // Rename all definitions and uses within the compiled method. diff --git a/src/coreclr/jit/static/CMakeLists.txt b/src/coreclr/jit/static/CMakeLists.txt index 8a9c1ab0cb07a9..99ae15963b506c 100644 --- a/src/coreclr/jit/static/CMakeLists.txt +++ b/src/coreclr/jit/static/CMakeLists.txt @@ -4,7 +4,7 @@ set_source_files_properties(${JIT_EXPORTS_FILE} PROPERTIES GENERATED TRUE) add_library_clr(clrjit_obj OBJECT - ${JIT_CORE_SOURCES} + ${JIT_SOURCES} ${JIT_ARCH_SOURCES} ) diff --git a/src/coreclr/jit/treelifeupdater.cpp b/src/coreclr/jit/treelifeupdater.cpp index 15c32596cc4223..526a3c4f72ac36 100644 --- a/src/coreclr/jit/treelifeupdater.cpp +++ b/src/coreclr/jit/treelifeupdater.cpp @@ -182,7 +182,7 @@ void TreeLifeUpdater::UpdateLifeVar(GenTree* tree) lclVarTree = tree; } unsigned int lclNum = lclVarTree->AsLclVarCommon()->GetLclNum(); - LclVarDsc* varDsc = compiler->lvaTable + lclNum; + LclVarDsc* varDsc = compiler->lvaGetDesc(lclNum); #ifdef DEBUG #if !defined(TARGET_AMD64) @@ -277,7 +277,7 @@ void TreeLifeUpdater::UpdateLifeVar(GenTree* tree) for (unsigned i = 0; i < varDsc->lvFieldCnt; ++i) { bool fieldIsSpilled = spill && ((lclVarTree->GetRegSpillFlagByIdx(i) & GTF_SPILL) != 0); - LclVarDsc* fldVarDsc = &(compiler->lvaTable[firstFieldVarNum + i]); + LclVarDsc* fldVarDsc = compiler->lvaGetDesc(firstFieldVarNum + i); noway_assert(fldVarDsc->lvIsStructField); assert(fldVarDsc->lvTracked); unsigned fldVarIndex = fldVarDsc->lvVarIndex; @@ -451,7 +451,7 @@ void TreeLifeUpdater::UpdateLifeVar(GenTree* tree) #ifdef DEBUG if (compiler->verbose) { - printf("\t\t\t\t\t\t\tVar V%02u becoming live\n", varDsc - compiler->lvaTable); + printf("\t\t\t\t\t\t\tVar V%02u becoming live\n", compiler->lvaGetLclNum(varDsc)); } #endif // DEBUG } diff --git a/src/coreclr/jit/unwindarm.cpp b/src/coreclr/jit/unwindarm.cpp index 2b25ed82942cc5..54c6a011cb0a70 100644 --- a/src/coreclr/jit/unwindarm.cpp +++ b/src/coreclr/jit/unwindarm.cpp @@ -2270,7 +2270,7 @@ void DumpUnwindInfo(Compiler* comp, else { printf(" --- One epilog, unwind codes at %u\n", epilogCount); - assert(epilogCount < _countof(epilogStartAt)); + assert(epilogCount < ArrLen(epilogStartAt)); epilogStartAt[epilogCount] = true; // the one and only epilog starts its unwind codes at this offset } diff --git a/src/coreclr/jit/utils.cpp b/src/coreclr/jit/utils.cpp index e454eb338682bc..d6f9df4ce6b1e4 100644 --- a/src/coreclr/jit/utils.cpp +++ b/src/coreclr/jit/utils.cpp @@ -110,7 +110,7 @@ const char* varTypeName(var_types vt) #undef DEF_TP }; - assert((unsigned)vt < _countof(varTypeNames)); + assert((unsigned)vt < ArrLen(varTypeNames)); return varTypeNames[vt]; } @@ -601,7 +601,7 @@ void dumpILRange(const BYTE* const codeAddr, unsigned codeSize) // in bytes for (IL_OFFSET offs = 0; offs < codeSize;) { char prefix[100]; - sprintf_s(prefix, _countof(prefix), "IL_%04x ", offs); + sprintf_s(prefix, ArrLen(prefix), "IL_%04x ", offs); unsigned codeBytesDumped = dumpSingleInstr(codeAddr, offs, prefix); offs += codeBytesDumped; } @@ -1377,7 +1377,6 @@ void HelperCallProperties::init() case CORINFO_HELP_CLASSINIT_SHARED_DYNAMICCLASS: case CORINFO_HELP_GETSHARED_GCTHREADSTATIC_BASE_DYNAMICCLASS: case CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE_DYNAMICCLASS: - case CORINFO_HELP_GETSTATICFIELDADDR_CONTEXT: case CORINFO_HELP_GETSTATICFIELDADDR_TLS: case CORINFO_HELP_GETGENERICS_GCSTATIC_BASE: case CORINFO_HELP_GETGENERICS_NONGCSTATIC_BASE: diff --git a/src/coreclr/jit/utils.h b/src/coreclr/jit/utils.h index 44521010288426..4e98bc5369df71 100644 --- a/src/coreclr/jit/utils.h +++ b/src/coreclr/jit/utils.h @@ -32,7 +32,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #endif template -unsigned ArrLen(T (&)[size]) +inline constexpr unsigned ArrLen(T (&)[size]) { return size; } diff --git a/src/coreclr/jit/valuenum.cpp b/src/coreclr/jit/valuenum.cpp index 6e31f385d5558e..e4d18a9a0c9f91 100644 --- a/src/coreclr/jit/valuenum.cpp +++ b/src/coreclr/jit/valuenum.cpp @@ -343,11 +343,11 @@ VNFunc GetVNFuncForNode(GenTree* node) #ifdef FEATURE_SIMD case GT_SIMD: - return VNFunc(VNF_SIMD_FIRST + node->AsSIMD()->gtSIMDIntrinsicID); + return VNFunc(VNF_SIMD_FIRST + node->AsSIMD()->GetSIMDIntrinsicId()); #endif // FEATURE_SIMD #ifdef FEATURE_HW_INTRINSICS case GT_HWINTRINSIC: - return VNFunc(VNF_HWI_FIRST + (node->AsHWIntrinsic()->gtHWIntrinsicId - NI_HW_INTRINSIC_START - 1)); + return VNFunc(VNF_HWI_FIRST + (node->AsHWIntrinsic()->GetHWIntrinsicId() - NI_HW_INTRINSIC_START - 1)); #endif // FEATURE_HW_INTRINSICS case GT_CAST: @@ -464,11 +464,9 @@ ValueNumStore::ValueNumStore(Compiler* comp, CompAllocator alloc) { m_VNsForSmallIntConsts[i] = NoVN; } - // We will reserve chunk 0 to hold some special constants, like the constant NULL, the "exception" value, and the - // "zero map." + // We will reserve chunk 0 to hold some special constants. Chunk* specialConstChunk = new (m_alloc) Chunk(m_alloc, &m_nextChunkBase, TYP_REF, CEA_Const); - specialConstChunk->m_numUsed += - SRC_NumSpecialRefConsts; // Implicitly allocate 0 ==> NULL, and 1 ==> Exception, 2 ==> ZeroMap. + specialConstChunk->m_numUsed += SRC_NumSpecialRefConsts; ChunkNum cn = m_chunks.Push(specialConstChunk); assert(cn == 0); @@ -1787,8 +1785,6 @@ ValueNum ValueNumStore::VNForHandle(ssize_t cnsVal, GenTreeFlags handleFlags) } } -// Returns the value number for zero of the given "typ". -// It has an unreached() for a "typ" that has no zero value, such as TYP_VOID. ValueNum ValueNumStore::VNZeroForType(var_types typ) { switch (typ) @@ -1812,15 +1808,18 @@ ValueNum ValueNumStore::VNZeroForType(var_types typ) return VNForNull(); case TYP_BYREF: return VNForByrefCon(0); - case TYP_STRUCT: - return VNForZeroMap(); // Recursion! #ifdef FEATURE_SIMD case TYP_SIMD8: case TYP_SIMD12: case TYP_SIMD16: case TYP_SIMD32: - return VNForLongCon(0); + // We do not have the base type - a "fake" one will have to do. Note that we cannot + // use the HWIntrinsic "get_Zero" VNFunc here. This is because they only represent + // "fully zeroed" vectors, and here we may be loading one from memory, leaving upper + // bits undefined. So using "SIMD_Init" is "the next best thing", so to speak, and + // TYP_FLOAT is one of the more popular base types, so that's why we use it here. + return VNForFunc(typ, VNF_SIMD_Init, VNForFloatCon(0), VNForSimdType(genTypeSize(typ), TYP_FLOAT)); #endif // FEATURE_SIMD // These should be unreached. @@ -1829,6 +1828,16 @@ ValueNum ValueNumStore::VNZeroForType(var_types typ) } } +ValueNum ValueNumStore::VNForZeroObj(CORINFO_CLASS_HANDLE structHnd) +{ + assert(structHnd != NO_CLASS_HANDLE); + + ValueNum structHndVN = VNForHandle(ssize_t(structHnd), GTF_ICON_CLASS_HDL); + ValueNum zeroObjVN = VNForFunc(TYP_STRUCT, VNF_ZeroObj, structHndVN); + + return zeroObjVN; +} + // Returns the value number for one of the given "typ". // It returns NoVN for a "typ" that has no one value, such as TYP_REF. ValueNum ValueNumStore::VNOneForType(var_types typ) @@ -1856,6 +1865,17 @@ ValueNum ValueNumStore::VNOneForType(var_types typ) } } +#ifdef FEATURE_SIMD +ValueNum ValueNumStore::VNForSimdType(unsigned simdSize, var_types simdBaseType) +{ + ValueNum baseTypeVN = VNForIntCon(INT32(simdBaseType)); + ValueNum sizeVN = VNForIntCon(simdSize); + ValueNum simdTypeVN = VNForFunc(TYP_REF, VNF_SimdType, sizeVN, baseTypeVN); + + return simdTypeVN; +} +#endif // FEATURE_SIMD + class Object* ValueNumStore::s_specialRefConsts[] = {nullptr, nullptr, nullptr}; //---------------------------------------------------------------------------------------- @@ -2180,7 +2200,6 @@ ValueNum ValueNumStore::VNForFunc( // // // Arguments: -// type - Type for the new map // map - Map value number // index - Index value number // value - New value for map[index] @@ -2188,17 +2207,17 @@ ValueNum ValueNumStore::VNForFunc( // Return Value: // Value number for "map" with "map[index]" set to "value". // -ValueNum ValueNumStore::VNForMapStore(var_types type, ValueNum map, ValueNum index, ValueNum value) +ValueNum ValueNumStore::VNForMapStore(ValueNum map, ValueNum index, ValueNum value) { BasicBlock* const bb = m_pComp->compCurBB; BasicBlock::loopNumber const loopNum = bb->bbNatLoopNum; - ValueNum const result = VNForFunc(type, VNF_MapStore, map, index, value, loopNum); + ValueNum const result = VNForFunc(TypeOfVN(map), VNF_MapStore, map, index, value, loopNum); #ifdef DEBUG if (m_pComp->verbose) { printf(" VNForMapStore(" FMT_VN ", " FMT_VN ", " FMT_VN "):%s in " FMT_BB " returns ", map, index, value, - varTypeName(type), bb->bbNum); + VNMapTypeName(TypeOfVN(result)), bb->bbNum); m_pComp->vnPrint(result, 1); printf("\n"); } @@ -2236,7 +2255,7 @@ ValueNum ValueNumStore::VNForMapSelect(ValueNumKind vnk, var_types type, ValueNu #ifdef DEBUG if (m_pComp->verbose) { - printf(" VNForMapSelect(" FMT_VN ", " FMT_VN "):%s returns ", map, index, varTypeName(type)); + printf(" VNForMapSelect(" FMT_VN ", " FMT_VN "):%s returns ", map, index, VNMapTypeName(type)); m_pComp->vnPrint(result, 1); printf("\n"); } @@ -2317,14 +2336,9 @@ ValueNum ValueNumStore::VNForMapSelectWork( return RecursiveVN; } - if (map == VNForZeroMap()) - { - return VNZeroForType(type); - } - else if (IsVNFunc(map)) + VNFuncApp funcApp; + if (GetVNFunc(map, &funcApp)) { - VNFuncApp funcApp; - GetVNFunc(map, &funcApp); if (funcApp.m_func == VNF_MapStore) { // select(store(m, i, v), i) == v @@ -2476,6 +2490,22 @@ ValueNum ValueNumStore::VNForMapSelectWork( m_fixedPointMapSels.Pop(); } } + else if (funcApp.m_func == VNF_ZeroObj) + { + // For structs, we need to extract the handle from the selector. + if (type == TYP_STRUCT) + { + // We only expect field selectors here. + assert(GetHandleFlags(index) == GTF_ICON_FIELD_HDL); + CORINFO_FIELD_HANDLE fieldHnd = CORINFO_FIELD_HANDLE(ConstantValue(index)); + CORINFO_CLASS_HANDLE structHnd = NO_CLASS_HANDLE; + m_pComp->eeGetFieldType(fieldHnd, &structHnd); + + return VNForZeroObj(structHnd); + } + + return VNZeroForType(type); + } } // We may have run out of budget and already assigned a result @@ -2495,6 +2525,61 @@ ValueNum ValueNumStore::VNForMapSelectWork( } } +//------------------------------------------------------------------------ +// VNForFieldSelector: A specialized version (with logging) of VNForHandle +// that is used for field handle selectors. +// +// Arguments: +// fieldHnd - handle of the field in question +// pFieldType - [out] parameter for the field's type +// pStructSize - optional [out] parameter for the size of the struct, +// populated if the field in question is of a struct type, +// otherwise set to zero +// +// Return Value: +// Value number corresponding to the given field handle. +// +ValueNum ValueNumStore::VNForFieldSelector(CORINFO_FIELD_HANDLE fieldHnd, var_types* pFieldType, size_t* pStructSize) +{ + CORINFO_CLASS_HANDLE structHnd = NO_CLASS_HANDLE; + ValueNum fldHndVN = VNForHandle(ssize_t(fieldHnd), GTF_ICON_FIELD_HDL); + var_types fieldType = m_pComp->eeGetFieldType(fieldHnd, &structHnd); + size_t structSize = 0; + + if (fieldType == TYP_STRUCT) + { + structSize = m_pComp->info.compCompHnd->getClassSize(structHnd); + + // We have to normalize here since there is no CorInfoType for vectors... + if (m_pComp->structSizeMightRepresentSIMDType(structSize)) + { + fieldType = m_pComp->impNormStructType(structHnd); + } + } + +#ifdef DEBUG + if (m_pComp->verbose) + { + const char* modName; + const char* fldName = m_pComp->eeGetFieldName(fieldHnd, &modName); + printf(" VNForHandle(%s) is " FMT_VN ", fieldType is %s", fldName, fldHndVN, varTypeName(fieldType)); + if (structSize != 0) + { + printf(", size = %u", structSize); + } + printf("\n"); + } +#endif + + if (pStructSize != nullptr) + { + *pStructSize = structSize; + } + *pFieldType = fieldType; + + return fldHndVN; +} + ValueNum ValueNumStore::EvalFuncForConstantArgs(var_types typ, VNFunc func, ValueNum arg0VN) { assert(CanEvalForConstantArgs(func)); @@ -3812,44 +3897,16 @@ ValueNum ValueNumStore::VNApplySelectors(ValueNumKind vnk, assert(field != FieldSeqStore::NotAField()); - CORINFO_FIELD_HANDLE fldHnd = field->m_fieldHnd; - CORINFO_CLASS_HANDLE structHnd = NO_CLASS_HANDLE; - ValueNum fldHndVN = VNForHandle(ssize_t(fldHnd), GTF_ICON_FIELD_HDL); - noway_assert(fldHnd != nullptr); - CorInfoType fieldCit = m_pComp->info.compCompHnd->getFieldType(fldHnd, &structHnd); - var_types fieldType = JITtype2varType(fieldCit); + JITDUMP(" VNApplySelectors:\n"); + var_types fieldType; + size_t structSize; + ValueNum fldHndVN = VNForFieldSelector(field->GetFieldHandle(), &fieldType, &structSize); - size_t structSize = 0; - if (varTypeIsStruct(fieldType)) - { - structSize = m_pComp->info.compCompHnd->getClassSize(structHnd); - // We do not normalize the type field accesses during importation unless they - // are used in a call, return or assignment. - if ((fieldType == TYP_STRUCT) && m_pComp->structSizeMightRepresentSIMDType(structSize)) - { - fieldType = m_pComp->impNormStructType(structHnd); - } - } if (wbFinalStructSize != nullptr) { *wbFinalStructSize = structSize; } -#ifdef DEBUG - if (m_pComp->verbose) - { - printf(" VNApplySelectors:\n"); - const char* modName; - const char* fldName = m_pComp->eeGetFieldName(fldHnd, &modName); - printf(" VNForHandle(%s) is " FMT_VN ", fieldType is %s", fldName, fldHndVN, varTypeName(fieldType)); - if (varTypeIsStruct(fieldType)) - { - printf(", size = %d", structSize); - } - printf("\n"); - } -#endif - map = VNForMapSelect(vnk, fieldType, map, fldHndVN); } @@ -4005,48 +4062,27 @@ ValueNum ValueNumStore::VNApplySelectorsAssign( return VNApplySelectorsAssign(vnk, map, fieldSeq->m_next, value, dstIndType); } + if (fieldSeq->m_next == nullptr) + { + JITDUMP(" VNApplySelectorsAssign:\n"); + } + // Otherwise, fldHnd is a real field handle. - CORINFO_FIELD_HANDLE fldHnd = fieldSeq->m_fieldHnd; - ValueNum fldHndVN = VNForHandle(ssize_t(fldHnd), GTF_ICON_FIELD_HDL); - noway_assert(fldHnd != nullptr); - CorInfoType fieldCit = m_pComp->info.compCompHnd->getFieldType(fldHnd); - var_types fieldType = JITtype2varType(fieldCit); + var_types fieldType; + ValueNum fldHndVN = VNForFieldSelector(fieldSeq->GetFieldHandle(), &fieldType); ValueNum valueAfter; - if (fieldSeq->m_next) + if (fieldSeq->m_next != nullptr) { -#ifdef DEBUG - if (m_pComp->verbose) - { - const char* modName; - const char* fldName = m_pComp->eeGetFieldName(fldHnd, &modName); - printf(" VNForHandle(%s) is " FMT_VN ", fieldType is %s\n", fldName, fldHndVN, - varTypeName(fieldType)); - } -#endif ValueNum fseqMap = VNForMapSelect(vnk, fieldType, map, fldHndVN); valueAfter = VNApplySelectorsAssign(vnk, fseqMap, fieldSeq->m_next, value, dstIndType); } else { -#ifdef DEBUG - if (m_pComp->verbose) - { - if (fieldSeq->m_next == nullptr) - { - printf(" VNApplySelectorsAssign:\n"); - } - const char* modName; - const char* fldName = m_pComp->eeGetFieldName(fldHnd, &modName); - printf(" VNForHandle(%s) is " FMT_VN ", fieldType is %s\n", fldName, fldHndVN, - varTypeName(fieldType)); - } -#endif valueAfter = VNApplySelectorsAssignTypeCoerce(value, dstIndType); } - ValueNum newMap = VNForMapStore(fieldType, map, fldHndVN, valueAfter); - return newMap; + return VNForMapStore(map, fldHndVN, valueAfter); } } @@ -4229,8 +4265,8 @@ ValueNum Compiler::fgValueNumberArrIndexAssign(CORINFO_CLASS_HANDLE elemTypeEq, bool invalidateArray = false; ValueNum elemTypeEqVN = vnStore->VNForHandle(ssize_t(elemTypeEq), GTF_ICON_CLASS_HDL); var_types arrElemType = DecodeElemType(elemTypeEq); - ValueNum hAtArrType = vnStore->VNForMapSelect(VNK_Liberal, TYP_REF, fgCurMemoryVN[GcHeap], elemTypeEqVN); - ValueNum hAtArrTypeAtArr = vnStore->VNForMapSelect(VNK_Liberal, TYP_REF, hAtArrType, arrVN); + ValueNum hAtArrType = vnStore->VNForMapSelect(VNK_Liberal, TYP_MEM, fgCurMemoryVN[GcHeap], elemTypeEqVN); + ValueNum hAtArrTypeAtArr = vnStore->VNForMapSelect(VNK_Liberal, TYP_MEM, hAtArrType, arrVN); ValueNum hAtArrTypeAtArrAtInx = vnStore->VNForMapSelect(VNK_Liberal, arrElemType, hAtArrTypeAtArr, inxVN); ValueNum newValAtInx = ValueNumStore::NoVN; @@ -4243,7 +4279,7 @@ ValueNum Compiler::fgValueNumberArrIndexAssign(CORINFO_CLASS_HANDLE elemTypeEq, JITDUMP(" *** NotAField sequence encountered in fgValueNumberArrIndexAssign\n"); // Store a new unique value for newValAtArrType - newValAtArrType = vnStore->VNForExpr(compCurBB, TYP_REF); + newValAtArrType = vnStore->VNForExpr(compCurBB, TYP_MEM); invalidateArray = true; } else @@ -4252,16 +4288,10 @@ ValueNum Compiler::fgValueNumberArrIndexAssign(CORINFO_CLASS_HANDLE elemTypeEq, // This is the value that should be stored at "arr[inx]". newValAtInx = vnStore->VNApplySelectorsAssign(VNK_Liberal, hAtArrTypeAtArrAtInx, fldSeq, rhsVN, indType); - var_types arrElemFldType = arrElemType; // Uses arrElemType unless we has a non-null fldSeq - if (vnStore->IsVNFunc(newValAtInx)) - { - VNFuncApp funcApp; - vnStore->GetVNFunc(newValAtInx, &funcApp); - if (funcApp.m_func == VNF_MapStore) - { - arrElemFldType = vnStore->TypeOfVN(newValAtInx); - } - } + // TODO-VNTypes: the validation below is a workaround for logic in ApplySelectorsAssignTypeCoerce + // not handling some cases correctly. Remove once ApplySelectorsAssignTypeCoerce has been fixed. + var_types arrElemFldType = + (fldSeq != nullptr) ? eeGetFieldType(fldSeq->GetTail()->GetFieldHandle()) : arrElemType; if (indType != arrElemFldType) { @@ -4271,15 +4301,15 @@ ValueNum Compiler::fgValueNumberArrIndexAssign(CORINFO_CLASS_HANDLE elemTypeEq, JITDUMP(" *** Mismatched types in fgValueNumberArrIndexAssign\n"); // Store a new unique value for newValAtArrType - newValAtArrType = vnStore->VNForExpr(compCurBB, TYP_REF); + newValAtArrType = vnStore->VNForExpr(compCurBB, TYP_MEM); invalidateArray = true; } } if (!invalidateArray) { - newValAtArr = vnStore->VNForMapStore(indType, hAtArrTypeAtArr, inxVN, newValAtInx); - newValAtArrType = vnStore->VNForMapStore(TYP_REF, hAtArrType, arrVN, newValAtArr); + newValAtArr = vnStore->VNForMapStore(hAtArrTypeAtArr, inxVN, newValAtInx); + newValAtArrType = vnStore->VNForMapStore(hAtArrType, arrVN, newValAtArr); } #ifdef DEBUG @@ -4298,7 +4328,7 @@ ValueNum Compiler::fgValueNumberArrIndexAssign(CORINFO_CLASS_HANDLE elemTypeEq, printf(" hAtArrTypeAtArr " FMT_VN " is MapSelect(hAtArrType(" FMT_VN "), arr=" FMT_VN ")\n", hAtArrTypeAtArr, hAtArrType, arrVN); printf(" hAtArrTypeAtArrAtInx " FMT_VN " is MapSelect(hAtArrTypeAtArr(" FMT_VN "), inx=" FMT_VN "):%s\n", - hAtArrTypeAtArrAtInx, hAtArrTypeAtArr, inxVN, varTypeName(arrElemType)); + hAtArrTypeAtArrAtInx, hAtArrTypeAtArr, inxVN, ValueNumStore::VNMapTypeName(arrElemType)); if (!invalidateArray) { @@ -4317,7 +4347,7 @@ ValueNum Compiler::fgValueNumberArrIndexAssign(CORINFO_CLASS_HANDLE elemTypeEq, } #endif // DEBUG - return vnStore->VNForMapStore(TYP_REF, fgCurMemoryVN[GcHeap], elemTypeEqVN, newValAtArrType); + return vnStore->VNForMapStore(fgCurMemoryVN[GcHeap], elemTypeEqVN, newValAtArrType); } ValueNum Compiler::fgValueNumberArrIndexVal(GenTree* tree, VNFuncApp* pFuncApp, ValueNum addrXvn) @@ -4371,8 +4401,8 @@ ValueNum Compiler::fgValueNumberArrIndexVal(GenTree* tree, else { ValueNum elemTypeEqVN = vnStore->VNForHandle(ssize_t(elemTypeEq), GTF_ICON_CLASS_HDL); - ValueNum hAtArrType = vnStore->VNForMapSelect(VNK_Liberal, TYP_REF, fgCurMemoryVN[GcHeap], elemTypeEqVN); - ValueNum hAtArrTypeAtArr = vnStore->VNForMapSelect(VNK_Liberal, TYP_REF, hAtArrType, arrVN); + ValueNum hAtArrType = vnStore->VNForMapSelect(VNK_Liberal, TYP_MEM, fgCurMemoryVN[GcHeap], elemTypeEqVN); + ValueNum hAtArrTypeAtArr = vnStore->VNForMapSelect(VNK_Liberal, TYP_MEM, hAtArrType, arrVN); ValueNum wholeElem = vnStore->VNForMapSelect(VNK_Liberal, elemTyp, hAtArrTypeAtArr, inxVN); #ifdef DEBUG @@ -4548,18 +4578,25 @@ bool ValueNumStore::IsVNHandle(ValueNum vn) // vrk - whether the new vn should swap, reverse, or both // // Returns: -// vn for reversed/swapped comparsion, or NoVN. +// vn for related comparsion, or NoVN. // // Note: // If "vn" corresponds to (x > y), the resulting VN corresponds to +// VRK_Same (x > y) // VRK_Swap (y < x) // VRK_Reverse (x <= y) // VRK_SwapReverse (y >= x) // -// Will return NoVN for all float comparisons. +// VRK_Same will always return the VN passed in. +// For other relations, this method will return NoVN for all float comparisons. // ValueNum ValueNumStore::GetRelatedRelop(ValueNum vn, VN_RELATION_KIND vrk) { + if (vrk == VN_RELATION_KIND::VRK_Same) + { + return vn; + } + if (vn == NoVN) { return NoVN; @@ -4677,23 +4714,27 @@ ValueNum ValueNumStore::GetRelatedRelop(ValueNum vn, VN_RELATION_KIND vrk) ValueNum newVN = VNForFunc(TYP_INT, newFunc, funcAttr.m_args[swap ? 1 : 0], funcAttr.m_args[swap ? 0 : 1]); ValueNum result = VNWithExc(newVN, excepVN); + return result; +} + #ifdef DEBUG - if (m_pComp->verbose) - { - printf("%s of ", swap ? (reverse ? "swap-reverse" : "swap") : "reverse"); - m_pComp->vnPrint(vn, 1); - printf(" => "); - m_pComp->vnPrint(newVN, 1); - if (result != newVN) - { - m_pComp->vnPrint(result, 1); - } - printf("\n"); +const char* ValueNumStore::VNRelationString(VN_RELATION_KIND vrk) +{ + switch (vrk) + { + case VN_RELATION_KIND::VRK_Same: + return "same"; + case VN_RELATION_KIND::VRK_Reverse: + return "reversed"; + case VN_RELATION_KIND::VRK_Swap: + return "swapped"; + case VN_RELATION_KIND::VRK_SwapReverse: + return "swapped and reversed"; + default: + return "unknown vn relation"; } -#endif - - return result; } +#endif bool ValueNumStore::IsVNRelop(ValueNum vn) { @@ -5807,11 +5848,6 @@ void ValueNumStore::vnDump(Compiler* comp, ValueNum vn, bool isPtr) { printf("void"); } - else - { - assert(vn == VNForZeroMap()); - printf("zeroMap"); - } break; case TYP_BYREF: printf("byrefVal"); @@ -5883,6 +5919,9 @@ void ValueNumStore::vnDump(Compiler* comp, ValueNum vn, bool isPtr) case VNF_CastOvf: vnDumpCast(comp, vn); break; + case VNF_ZeroObj: + vnDumpZeroObj(comp, &funcApp); + break; default: printf("%s(", VNFuncName(funcApp.m_func)); @@ -6104,6 +6143,12 @@ void ValueNumStore::vnDumpCast(Compiler* comp, ValueNum castVN) } } +void ValueNumStore::vnDumpZeroObj(Compiler* comp, VNFuncApp* zeroObj) +{ + printf("ZeroObj("); + comp->vnPrint(zeroObj->m_args[0], 0); + printf(": %s)", comp->eeGetClassName(CORINFO_CLASS_HANDLE(ConstantValue(zeroObj->m_args[0])))); +} #endif // DEBUG // Static fields, methods. @@ -6186,10 +6231,6 @@ void ValueNumStore::InitValueNumStoreStatics() // SIMDIntrinsicInit has an entry of 2 for numArgs, but it only has one normal arg ValueNumFuncSetArity(VNF_SIMD_Init, 1); - // SIMDIntrinsicWidenHi has an entry of 2 for numArgs, but it only has one normal arg - ValueNumFuncSetArity(VNF_SIMD_WidenHi, 1); - // SIMDIntrinsicWidenLo has an entry of 2 for numArgs, but it only has one normal arg - ValueNumFuncSetArity(VNF_SIMD_WidenLo, 1); // Some SIMD intrinsic nodes have an extra VNF_SimdType arg // @@ -6235,7 +6276,7 @@ void ValueNumStore::InitValueNumStoreStatics() #undef ValueNumFuncSetArity - for (unsigned i = 0; i < _countof(genTreeOpsIllegalAsVNFunc); i++) + for (unsigned i = 0; i < ArrLen(genTreeOpsIllegalAsVNFunc); i++) { vnfOpAttribs[genTreeOpsIllegalAsVNFunc[i]] |= VNFOA_IllegalGenTreeOp; } @@ -6250,8 +6291,7 @@ const char* ValueNumStore::VNFuncNameArr[] = { #undef ValueNumFuncDef }; -// static -const char* ValueNumStore::VNFuncName(VNFunc vnf) +/* static */ const char* ValueNumStore::VNFuncName(VNFunc vnf) { if (vnf < VNF_Boundary) { @@ -6263,14 +6303,26 @@ const char* ValueNumStore::VNFuncName(VNFunc vnf) } } +/* static */ const char* ValueNumStore::VNMapTypeName(var_types type) +{ + switch (type) + { + case TYP_HEAP: + return "heap"; + case TYP_MEM: + return "mem"; + default: + return varTypeName(type); + } +} + static const char* s_reservedNameArr[] = { "$VN.Recursive", // -2 RecursiveVN "$VN.No", // -1 NoVN "$VN.Null", // 0 VNForNull() - "$VN.ZeroMap", // 1 VNForZeroMap() - "$VN.ReadOnlyHeap", // 2 VNForROH() - "$VN.Void", // 3 VNForVoid() - "$VN.EmptyExcSet" // 4 VNForEmptyExcSet() + "$VN.ReadOnlyHeap", // 1 VNForROH() + "$VN.Void", // 2 VNForVoid() + "$VN.EmptyExcSet" // 3 VNForEmptyExcSet() }; // Returns the string name of "vn" when it is a reserved value number, nullptr otherwise @@ -6631,7 +6683,7 @@ void Compiler::fgValueNumber() continue; } - LclVarDsc* varDsc = &lvaTable[lclNum]; + LclVarDsc* varDsc = lvaGetDesc(lclNum); assert(varDsc->lvTracked); if (varDsc->lvIsParam) @@ -6695,7 +6747,8 @@ void Compiler::fgValueNumber() if (isZeroed) { // By default we will zero init these LclVars - initVal = vnStore->VNZeroForType(typ); + initVal = (typ == TYP_STRUCT) ? vnStore->VNForZeroObj(varDsc->GetStructHnd()) + : vnStore->VNZeroForType(typ); } else { @@ -6716,7 +6769,7 @@ void Compiler::fgValueNumber() } } // Give memory an initial value number (about which we know nothing). - ValueNum memoryInitVal = vnStore->VNForFunc(TYP_REF, VNF_InitVal, vnStore->VNForIntCon(-1)); // Use -1 for memory. + ValueNum memoryInitVal = vnStore->VNForFunc(TYP_HEAP, VNF_InitVal, vnStore->VNForIntCon(-1)); // Use -1 for memory. GetMemoryPerSsaData(SsaConfig::FIRST_SSA_NUM)->m_vnPair.SetBoth(memoryInitVal); #ifdef DEBUG if (verbose) @@ -6853,8 +6906,8 @@ void Compiler::fgValueNumberBlock(BasicBlock* blk) // Is there a phi for this block? if (blk->bbMemorySsaPhiFunc[memoryKind] == nullptr) { - fgCurMemoryVN[memoryKind] = GetMemoryPerSsaData(blk->bbMemorySsaNumIn[memoryKind])->m_vnPair.GetLiberal(); - assert(fgCurMemoryVN[memoryKind] != ValueNumStore::NoVN); + ValueNum newMemoryVN = GetMemoryPerSsaData(blk->bbMemorySsaNumIn[memoryKind])->m_vnPair.GetLiberal(); + fgSetCurrentMemoryVN(memoryKind, newMemoryVN); } else { @@ -6902,7 +6955,7 @@ void Compiler::fgValueNumberBlock(BasicBlock* blk) unsigned phiArgSSANum = phiArgs->GetSsaNum(); ValueNum phiArgSSANumVN = vnStore->VNForIntCon(phiArgSSANum); JITDUMP(" Building phi application: $%x = SSA# %d.\n", phiArgSSANumVN, phiArgSSANum); - phiAppVN = vnStore->VNForFunc(TYP_REF, VNF_Phi, phiArgSSANumVN, phiAppVN); + phiAppVN = vnStore->VNForFunc(TYP_HEAP, VNF_Phi, phiArgSSANumVN, phiAppVN); JITDUMP(" Building phi application: $%x = phi($%x, $%x).\n", phiAppVN, phiArgSSANumVN, oldPhiAppVN); phiArgs = phiArgs->m_nextArg; @@ -6913,16 +6966,16 @@ void Compiler::fgValueNumberBlock(BasicBlock* blk) } else { - newMemoryVN = vnStore->VNForFunc(TYP_REF, VNF_PhiMemoryDef, + newMemoryVN = vnStore->VNForFunc(TYP_HEAP, VNF_PhiMemoryDef, vnStore->VNForHandle(ssize_t(blk), GTF_EMPTY), phiAppVN); } } GetMemoryPerSsaData(blk->bbMemorySsaNumIn[memoryKind])->m_vnPair.SetLiberal(newMemoryVN); - fgCurMemoryVN[memoryKind] = newMemoryVN; + fgSetCurrentMemoryVN(memoryKind, newMemoryVN); if ((memoryKind == GcHeap) && byrefStatesMatchGcHeapStates) { // Keep the CurMemoryVNs in sync - fgCurMemoryVN[ByrefExposed] = newMemoryVN; + fgSetCurrentMemoryVN(ByrefExposed, newMemoryVN); } } #ifdef DEBUG @@ -7020,7 +7073,7 @@ ValueNum Compiler::fgMemoryVNForLoopSideEffects(MemoryKind memoryKind, // If this loop has memory havoc effects, just use a new, unique VN. if (optLoopTable[loopNum].lpLoopHasMemoryHavoc[memoryKind]) { - ValueNum res = vnStore->VNForExpr(entryBlock, TYP_REF); + ValueNum res = vnStore->VNForExpr(entryBlock, TYP_HEAP); #ifdef DEBUG if (verbose) { @@ -7060,7 +7113,7 @@ ValueNum Compiler::fgMemoryVNForLoopSideEffects(MemoryKind memoryKind, } if (multipleNonLoopPreds) { - ValueNum res = vnStore->VNForExpr(entryBlock, TYP_REF); + ValueNum res = vnStore->VNForExpr(entryBlock, TYP_HEAP); #ifdef DEBUG if (verbose) { @@ -7105,12 +7158,11 @@ ValueNum Compiler::fgMemoryVNForLoopSideEffects(MemoryKind memoryKind, } #endif // DEBUG - // Instance field maps get the placeholder TYP_REF - they do not represent "singular" + // Instance field maps get a placeholder type - they do not represent "singular" // values. Static field maps, on the other hand, do, and so must be given proper types. - var_types fldMapType = eeIsFieldStatic(fldHnd) ? eeGetFieldType(fldHnd) : TYP_REF; + var_types fldMapType = eeIsFieldStatic(fldHnd) ? eeGetFieldType(fldHnd) : TYP_MEM; - newMemoryVN = - vnStore->VNForMapStore(TYP_REF, newMemoryVN, fldHndVN, vnStore->VNForExpr(entryBlock, fldMapType)); + newMemoryVN = vnStore->VNForMapStore(newMemoryVN, fldHndVN, vnStore->VNForExpr(entryBlock, fldMapType)); } } // Now do the array maps. @@ -7141,8 +7193,8 @@ ValueNum Compiler::fgMemoryVNForLoopSideEffects(MemoryKind memoryKind, #endif // DEBUG ValueNum elemTypeVN = vnStore->VNForHandle(ssize_t(elemClsHnd), GTF_ICON_CLASS_HDL); - ValueNum uniqueVN = vnStore->VNForExpr(entryBlock, TYP_REF); - newMemoryVN = vnStore->VNForMapStore(TYP_REF, newMemoryVN, elemTypeVN, uniqueVN); + ValueNum uniqueVN = vnStore->VNForExpr(entryBlock, TYP_MEM); + newMemoryVN = vnStore->VNForMapStore(newMemoryVN, elemTypeVN, uniqueVN); } } } @@ -7169,13 +7221,13 @@ ValueNum Compiler::fgMemoryVNForLoopSideEffects(MemoryKind memoryKind, void Compiler::fgMutateGcHeap(GenTree* tree DEBUGARG(const char* msg)) { // Update the current memory VN, and if we're tracking the heap SSA # caused by this node, record it. - recordGcHeapStore(tree, vnStore->VNForExpr(compCurBB, TYP_REF) DEBUGARG(msg)); + recordGcHeapStore(tree, vnStore->VNForExpr(compCurBB, TYP_HEAP) DEBUGARG(msg)); } void Compiler::fgMutateAddressExposedLocal(GenTree* tree DEBUGARG(const char* msg)) { // Update the current ByrefExposed VN, and if we're tracking the heap SSA # caused by this node, record it. - recordAddressExposedLocalStore(tree, vnStore->VNForExpr(compCurBB) DEBUGARG(msg)); + recordAddressExposedLocalStore(tree, vnStore->VNForExpr(compCurBB, TYP_HEAP) DEBUGARG(msg)); } void Compiler::recordGcHeapStore(GenTree* curTree, ValueNum gcHeapVN DEBUGARG(const char* msg)) @@ -7183,13 +7235,13 @@ void Compiler::recordGcHeapStore(GenTree* curTree, ValueNum gcHeapVN DEBUGARG(co // bbMemoryDef must include GcHeap for any block that mutates the GC Heap // and GC Heap mutations are also ByrefExposed mutations assert((compCurBB->bbMemoryDef & memoryKindSet(GcHeap, ByrefExposed)) == memoryKindSet(GcHeap, ByrefExposed)); - fgCurMemoryVN[GcHeap] = gcHeapVN; + fgSetCurrentMemoryVN(GcHeap, gcHeapVN); if (byrefStatesMatchGcHeapStates) { // Since GcHeap and ByrefExposed share SSA nodes, they need to share // value numbers too. - fgCurMemoryVN[ByrefExposed] = gcHeapVN; + fgSetCurrentMemoryVN(ByrefExposed, gcHeapVN); } else { @@ -7197,7 +7249,7 @@ void Compiler::recordGcHeapStore(GenTree* curTree, ValueNum gcHeapVN DEBUGARG(co // assume that this GcHeap store may alias any byref load/store, so don't // bother trying to record the map/select stuff, and instead just an opaque VN // for ByrefExposed - fgCurMemoryVN[ByrefExposed] = vnStore->VNForExpr(compCurBB); + fgSetCurrentMemoryVN(ByrefExposed, vnStore->VNForExpr(compCurBB, TYP_HEAP)); } #ifdef DEBUG @@ -7222,7 +7274,7 @@ void Compiler::recordAddressExposedLocalStore(GenTree* curTree, ValueNum memoryV // bbMemoryDef must include ByrefExposed for any block that mutates an address-exposed local assert((compCurBB->bbMemoryDef & memoryKindSet(ByrefExposed)) != 0); - fgCurMemoryVN[ByrefExposed] = memoryVN; + fgSetCurrentMemoryVN(ByrefExposed, memoryVN); #ifdef DEBUG if (verbose) @@ -7236,6 +7288,13 @@ void Compiler::recordAddressExposedLocalStore(GenTree* curTree, ValueNum memoryV fgValueNumberRecordMemorySsa(ByrefExposed, curTree); } +void Compiler::fgSetCurrentMemoryVN(MemoryKind memoryKind, ValueNum newMemoryVN) +{ + assert(vnStore->VNIsValid(newMemoryVN)); + assert(vnStore->TypeOfVN(newMemoryVN) == TYP_HEAP); + fgCurMemoryVN[memoryKind] = newMemoryVN; +} + void Compiler::fgValueNumberRecordMemorySsa(MemoryKind memoryKind, GenTree* tree) { unsigned ssaNum; @@ -7476,7 +7535,7 @@ void Compiler::fgValueNumberAssignment(GenTreeOp* tree) // through address-taken locals in regions of code with no calls or byref // writes. // For now, just use a new opaque VN. - ValueNum heapVN = vnStore->VNForExpr(compCurBB); + ValueNum heapVN = vnStore->VNForExpr(compCurBB, TYP_HEAP); recordAddressExposedLocalStore(tree, heapVN DEBUGARG("local assign")); } #ifdef DEBUG @@ -7559,7 +7618,7 @@ void Compiler::fgValueNumberAssignment(GenTreeOp* tree) // As with GT_LCL_VAR, we could probably use MapStore here and MapSelect at corresponding // loads, but to do so would have to identify the subset of address-exposed locals // whose fields can be disambiguated. - ValueNum heapVN = vnStore->VNForExpr(compCurBB); + ValueNum heapVN = vnStore->VNForExpr(compCurBB, TYP_HEAP); recordAddressExposedLocalStore(tree, heapVN DEBUGARG("local field assign")); } } @@ -7685,7 +7744,7 @@ void Compiler::fgValueNumberAssignment(GenTreeOp* tree) // through address-taken locals in regions of code with no calls or byref // writes. // For now, just use a new opaque VN. - ValueNum heapVN = vnStore->VNForExpr(compCurBB); + ValueNum heapVN = vnStore->VNForExpr(compCurBB, TYP_HEAP); recordAddressExposedLocalStore(tree, heapVN DEBUGARG("PtrToLoc indir")); } } @@ -7783,82 +7842,79 @@ void Compiler::fgValueNumberAssignment(GenTreeOp* tree) assert(fldSeq != nullptr); } - // Get a field sequence for just the first field in the sequence - // - FieldSeqNode* firstFieldOnly = GetFieldSeqStore()->CreateSingleton(fldSeq->m_fieldHnd); + // The value number from the rhs of the assignment + ValueNum storeVal = rhsVNPair.GetLiberal(); + ValueNum newHeapVN = ValueNumStore::NoVN; - // The final field in the sequence will need to match the 'indType' + // We will check that the final field in the sequence matches 'indType'. var_types indType = lhs->TypeGet(); - ValueNum fldMapVN = - vnStore->VNApplySelectors(VNK_Liberal, fgCurMemoryVN[GcHeap], firstFieldOnly); - - // The type of the field is "struct" if there are more fields in the sequence, - // otherwise it is the type returned from VNApplySelectors above. - var_types firstFieldType = vnStore->TypeOfVN(fldMapVN); - - // The value number from the rhs of the assignment - ValueNum storeVal = rhsVNPair.GetLiberal(); - ValueNum newFldMapVN = ValueNumStore::NoVN; // when (obj != nullptr) we have an instance field, otherwise a static field // when (staticOffset != nullptr) it represents a offset into a static or the call to // Shared Static Base if ((obj != nullptr) || (staticOffset != nullptr)) { - ValueNum valAtAddr = fldMapVN; - ValueNum normVal = ValueNumStore::NoVN; + var_types firstFieldType; + ValueNum firstFieldSelectorVN = + vnStore->VNForFieldSelector(fldSeq->GetFieldHandle(), &firstFieldType); + // Construct the "field map" VN. It represents memory state of the first field + // of all objects on the heap. This is our primary map. + ValueNum fldMapVN = vnStore->VNForMapSelect(VNK_Liberal, TYP_MEM, fgCurMemoryVN[GcHeap], + firstFieldSelectorVN); + + ValueNum firstFieldValueSelectorVN = ValueNumStore::NoVN; if (obj != nullptr) { - // Unpack, Norm,Exc for 'obj' - ValueNum vnObjExcSet; - vnStore->VNUnpackExc(obj->gtVNPair.GetLiberal(), &normVal, &vnObjExcSet); - vnExcSet = vnStore->VNExcSetUnion(vnExcSet, vnObjExcSet); - - // construct the ValueNumber for 'fldMap at obj' - valAtAddr = vnStore->VNForMapSelect(VNK_Liberal, firstFieldType, fldMapVN, normVal); + firstFieldValueSelectorVN = vnStore->VNLiberalNormalValue(obj->gtVNPair); } else // (staticOffset != nullptr) { - // construct the ValueNumber for 'fldMap at staticOffset' - normVal = vnStore->VNLiberalNormalValue(staticOffset->gtVNPair); - valAtAddr = vnStore->VNForMapSelect(VNK_Liberal, firstFieldType, fldMapVN, normVal); + firstFieldValueSelectorVN = vnStore->VNLiberalNormalValue(staticOffset->gtVNPair); + } + + ValueNum newFirstFieldValueVN = ValueNumStore::NoVN; + // Optimization: avoid traversting the maps for the value of the first field if + // we do not need it, which is the case if the rest of the field sequence is empty. + if (fldSeq->m_next == nullptr) + { + newFirstFieldValueVN = vnStore->VNApplySelectorsAssignTypeCoerce(storeVal, indType); } - // Now get rid of any remaining struct field dereferences. (if they exist) - if (fldSeq->m_next) + else { - storeVal = vnStore->VNApplySelectorsAssign(VNK_Liberal, valAtAddr, fldSeq->m_next, - storeVal, indType); + // Construct the ValueNumber for fldMap[obj/offset]. This (struct) + // map represents the specific field we're looking to store to. + ValueNum firstFieldValueVN = + vnStore->VNForMapSelect(VNK_Liberal, firstFieldType, fldMapVN, + firstFieldValueSelectorVN); + + // Construct the maps updating the rest of the fields in the sequence. + newFirstFieldValueVN = + vnStore->VNApplySelectorsAssign(VNK_Liberal, firstFieldValueVN, fldSeq->m_next, + storeVal, indType); } - // From which we can construct the new ValueNumber for 'fldMap at normVal' - newFldMapVN = - vnStore->VNForMapStore(vnStore->TypeOfVN(fldMapVN), fldMapVN, normVal, storeVal); + // Finally, construct the new field map... + ValueNum newFldMapVN = + vnStore->VNForMapStore(fldMapVN, firstFieldValueSelectorVN, newFirstFieldValueVN); + + // ...and a new value for the heap. + newHeapVN = + vnStore->VNForMapStore(fgCurMemoryVN[GcHeap], firstFieldSelectorVN, newFldMapVN); } else { - // plain static field - - // Now get rid of any remaining struct field dereferences. (if they exist) - if (fldSeq->m_next) - { - storeVal = vnStore->VNApplySelectorsAssign(VNK_Liberal, fldMapVN, fldSeq->m_next, - storeVal, indType); - } - - newFldMapVN = vnStore->VNApplySelectorsAssign(VNK_Liberal, fgCurMemoryVN[GcHeap], fldSeq, - storeVal, indType); + // Plain static field. + newHeapVN = vnStore->VNApplySelectorsAssign(VNK_Liberal, fgCurMemoryVN[GcHeap], fldSeq, + storeVal, indType); } // It is not strictly necessary to set the lhs value number, // but the dumps read better with it set to the 'storeVal' that we just computed lhs->gtVNPair.SetBoth(storeVal); - // Update the field map for firstField in GcHeap to this new value. - ValueNum heapVN = vnStore->VNApplySelectorsAssign(VNK_Liberal, fgCurMemoryVN[GcHeap], - firstFieldOnly, newFldMapVN, indType); - - recordGcHeapStore(tree, heapVN DEBUGARG("StoreField")); + // Update the GcHeap value. + recordGcHeapStore(tree, newHeapVN DEBUGARG("StoreField")); } } else @@ -7874,7 +7930,7 @@ void Compiler::fgValueNumberAssignment(GenTreeOp* tree) // through address-taken locals in regions of code with no calls or byref // writes. // For now, just use a new opaque VN. - ValueNum memoryVN = vnStore->VNForExpr(compCurBB); + ValueNum memoryVN = vnStore->VNForExpr(compCurBB, TYP_HEAP); recordAddressExposedLocalStore(tree, memoryVN DEBUGARG("PtrToLoc indir")); } else if (!isLocal) @@ -7957,39 +8013,38 @@ void Compiler::fgValueNumberBlockAssignment(GenTree* tree) // Should not have been recorded as updating the GC heap. assert(!GetMemorySsaMap(GcHeap)->Lookup(tree)); - unsigned lclNum = lclVarTree->GetLclNum(); - unsigned lclDefSsaNum = GetSsaNumForLocalVarDef(lclVarTree); + // Ignore vars that we excluded from SSA (for example, because they're address-exposed). They don't have // SSA names in which to store VN's on defs. We'll yield unique VN's when we read from them. - if (lvaInSsa(lclNum) && lclDefSsaNum != SsaConfig::RESERVED_SSA_NUM) + if (lclDefSsaNum != SsaConfig::RESERVED_SSA_NUM) { + LclVarDsc* lclVarDsc = lvaGetDesc(lclVarTree); + // Should not have been recorded as updating ByrefExposed. assert(!GetMemorySsaMap(ByrefExposed)->Lookup(tree)); - ValueNum initBlkVN = ValueNumStore::NoVN; - GenTree* initConst = rhs; - if (isEntire && initConst->OperGet() == GT_CNS_INT) + ValueNum lclVarVN = ValueNumStore::NoVN; + if (isEntire && rhs->IsIntegralConst(0)) { - unsigned initVal = 0xFF & (unsigned)initConst->AsIntConCommon()->IconValue(); - if (initVal == 0) - { - initBlkVN = vnStore->VNZeroForType(lclVarTree->TypeGet()); - } + // Note that it is possible to see pretty much any kind of type for the local + // (not just TYP_STRUCT) here because of the ASG(BLK(ADDR(LCL_VAR/FLD)), 0) form. + lclVarVN = (lclVarDsc->TypeGet() == TYP_STRUCT) ? vnStore->VNForZeroObj(lclVarDsc->GetStructHnd()) + : vnStore->VNZeroForType(lclVarDsc->TypeGet()); + } + else + { + // Non-zero block init is very rare so we'll use a simple, unique VN here. + lclVarVN = vnStore->VNForExpr(compCurBB, lclVarDsc->TypeGet()); } - ValueNum lclVarVN = (initBlkVN != ValueNumStore::NoVN) - ? initBlkVN - : vnStore->VNForExpr(compCurBB, var_types(lvaTable[lclNum].lvType)); - lvaTable[lclNum].GetPerSsaData(lclDefSsaNum)->m_vnPair.SetBoth(lclVarVN); + lclVarDsc->GetPerSsaData(lclDefSsaNum)->m_vnPair.SetBoth(lclVarVN); #ifdef DEBUG if (verbose) { - printf("N%03u ", tree->gtSeqNum); + printf("Tree "); Compiler::printTreeID(tree); - printf(" "); - gtDispNodeName(tree); - printf(" V%02u/%d => ", lclNum, lclDefSsaNum); + printf(" assigned VN to local var V%02u/%d: ", lclVarTree->GetLclNum(), lclDefSsaNum); vnPrint(lclVarVN, 1); printf("\n"); } @@ -8080,7 +8135,7 @@ void Compiler::fgValueNumberBlockAssignment(GenTree* tree) if (rhs->IsLocalExpr(this, &rhsLclVarTree, &rhsFldSeq)) { unsigned rhsLclNum = rhsLclVarTree->GetLclNum(); - rhsVarDsc = &lvaTable[rhsLclNum]; + rhsVarDsc = lvaGetDesc(rhsLclNum); if (!lvaInSsa(rhsLclNum) || !rhsLclVarTree->HasSsaName() || rhsFldSeq == FieldSeqStore::NotAField()) { @@ -8107,7 +8162,7 @@ void Compiler::fgValueNumberBlockAssignment(GenTree* tree) if (srcAddr->IsLocalAddrExpr(this, &rhsLclVarTree, &rhsFldSeq)) { unsigned rhsLclNum = rhsLclVarTree->GetLclNum(); - rhsVarDsc = &lvaTable[rhsLclNum]; + rhsVarDsc = lvaGetDesc(rhsLclNum); if (!lvaInSsa(rhsLclNum) || !rhsLclVarTree->HasSsaName() || rhsFldSeq == FieldSeqStore::NotAField()) { @@ -8374,12 +8429,12 @@ void Compiler::fgValueNumberTree(GenTree* tree) { GenTreeLclVarCommon* lcl = tree->AsLclVarCommon(); unsigned lclNum = lcl->GetLclNum(); - LclVarDsc* varDsc = &lvaTable[lclNum]; + LclVarDsc* varDsc = lvaGetDesc(lclNum); if (varDsc->CanBeReplacedWithItsField(this)) { lclNum = varDsc->lvFieldLclStart; - varDsc = &lvaTable[lclNum]; + varDsc = lvaGetDesc(lclNum); } // Do we have a Use (read) of the LclVar? @@ -8544,9 +8599,8 @@ void Compiler::fgValueNumberTree(GenTree* tree) // forms (assignment, or initBlk or copyBlk). if (((lclFld->gtFlags & GTF_VAR_DEF) == 0) || (lclFld->gtFlags & GTF_VAR_USEASG)) { - unsigned lclNum = lclFld->GetLclNum(); unsigned ssaNum = lclFld->GetSsaNum(); - LclVarDsc* varDsc = &lvaTable[lclNum]; + LclVarDsc* varDsc = lvaGetDesc(lclFld); var_types indType = tree->TypeGet(); if ((lclFld->GetFieldSeq() == FieldSeqStore::NotAField()) || !lvaInSsa(lclFld->GetLclNum()) || @@ -8914,9 +8968,8 @@ void Compiler::fgValueNumberTree(GenTree* tree) if (addr->IsLocalAddrExpr(this, &lclVarTree, &localFldSeq) && lvaInSsa(lclVarTree->GetLclNum()) && lclVarTree->HasSsaName()) { - unsigned lclNum = lclVarTree->GetLclNum(); unsigned ssaNum = lclVarTree->GetSsaNum(); - LclVarDsc* varDsc = &lvaTable[lclNum]; + LclVarDsc* varDsc = lvaGetDesc(lclVarTree); if ((localFldSeq == FieldSeqStore::NotAField()) || (localFldSeq == nullptr)) { @@ -8968,10 +9021,11 @@ void Compiler::fgValueNumberTree(GenTree* tree) } else if (fldSeq2 != nullptr) { - // Get the first (instance or static) field from field seq. GcHeap[field] will yield the "field - // map". - CLANG_FORMAT_COMMENT_ANCHOR; - + if (fldSeq2->IsFirstElemFieldSeq()) + { + fldSeq2 = fldSeq2->m_next; + assert(fldSeq2 != nullptr); + } #ifdef DEBUG CORINFO_CLASS_HANDLE fldCls = info.compCompHnd->getFieldClass(fldSeq2->m_fieldHnd); if (obj != nullptr) @@ -8983,42 +9037,38 @@ void Compiler::fgValueNumberTree(GenTree* tree) } #endif // DEBUG - // Get a field sequence for just the first field in the sequence - // - FieldSeqNode* firstFieldOnly = GetFieldSeqStore()->CreateSingleton(fldSeq2->m_fieldHnd); - size_t structSize = 0; - ValueNum fldMapVN = - vnStore->VNApplySelectors(VNK_Liberal, fgCurMemoryVN[GcHeap], firstFieldOnly, &structSize); + // The size of the ultimate value we will select, if it is of a struct type. + size_t structSize = 0; - // The final field in the sequence will need to match the 'indType' - var_types indType = tree->TypeGet(); + // Get the selector for the first field. + var_types firstFieldType; + ValueNum firstFieldSelectorVN = + vnStore->VNForFieldSelector(fldSeq2->GetFieldHandle(), &firstFieldType, &structSize); - // The type of the field is "struct" if there are more fields in the sequence, - // otherwise it is the type returned from VNApplySelectors above. - var_types firstFieldType = vnStore->TypeOfVN(fldMapVN); + ValueNum fldMapVN = + vnStore->VNForMapSelect(VNK_Liberal, TYP_MEM, fgCurMemoryVN[GcHeap], firstFieldSelectorVN); - ValueNum valAtAddr = fldMapVN; + ValueNum firstFieldValueSelectorVN; if (obj != nullptr) { - // construct the ValueNumber for 'fldMap at obj' - ValueNum objNormVal = vnStore->VNLiberalNormalValue(obj->gtVNPair); - valAtAddr = vnStore->VNForMapSelect(VNK_Liberal, firstFieldType, fldMapVN, objNormVal); + firstFieldValueSelectorVN = vnStore->VNLiberalNormalValue(obj->gtVNPair); } - else if (staticOffset != nullptr) + else { - // construct the ValueNumber for 'fldMap at staticOffset' - ValueNum offsetNormVal = vnStore->VNLiberalNormalValue(staticOffset->gtVNPair); - valAtAddr = vnStore->VNForMapSelect(VNK_Liberal, firstFieldType, fldMapVN, offsetNormVal); + assert(staticOffset != nullptr); + firstFieldValueSelectorVN = vnStore->VNLiberalNormalValue(staticOffset->gtVNPair); } - // Now get rid of any remaining struct field dereferences. - if (fldSeq2->m_next) - { - valAtAddr = vnStore->VNApplySelectors(VNK_Liberal, valAtAddr, fldSeq2->m_next, &structSize); - } - valAtAddr = vnStore->VNApplySelectorsTypeCheck(valAtAddr, indType, structSize); + // Construct the value number for fldMap[obj/offset]. + ValueNum firstFieldValueVN = + vnStore->VNForMapSelect(VNK_Liberal, firstFieldType, fldMapVN, firstFieldValueSelectorVN); + + // Finally, account for the rest of the fields in the sequence. + ValueNum valueVN = + vnStore->VNApplySelectors(VNK_Liberal, firstFieldValueVN, fldSeq2->m_next, &structSize); - tree->gtVNPair.SetLiberal(valAtAddr); + valueVN = vnStore->VNApplySelectorsTypeCheck(valueVN, tree->TypeGet(), structSize); + tree->gtVNPair.SetLiberal(valueVN); // The conservative value is a new, unique VN. tree->gtVNPair.SetConservative(vnStore->VNForExpr(compCurBB, tree->TypeGet())); @@ -9050,21 +9100,6 @@ void Compiler::fgValueNumberTree(GenTree* tree) { fgValueNumberIntrinsic(tree); } - -#ifdef FEATURE_SIMD - else if (tree->OperGet() == GT_SIMD) - { - fgValueNumberSimd(tree); - } -#endif // FEATURE_SIMD - -#ifdef FEATURE_HW_INTRINSICS - else if (tree->OperGet() == GT_HWINTRINSIC) - { - fgValueNumberHWIntrinsic(tree); - } -#endif // FEATURE_HW_INTRINSICS - else // Look up the VNFunc for the node { VNFunc vnf = GetVNFuncForNode(tree); @@ -9119,7 +9154,7 @@ void Compiler::fgValueNumberTree(GenTree* tree) ValueNumPair op2VNPair; if (tree->AsOp()->gtOp2 == nullptr) { - // Handle any GT_LIST nodes as they can have a nullptr for op2. + // Handle any GT_LEA nodes as they can have a nullptr for op2. op2VNPair.SetBoth(ValueNumStore::VNForNull()); } else @@ -9277,7 +9312,6 @@ void Compiler::fgValueNumberTree(GenTree* tree) } case GT_JTRUE: - case GT_LIST: // These nodes never need to have a ValueNumber tree->gtVNPair.SetBoth(ValueNumStore::NoVN); break; @@ -9311,6 +9345,18 @@ void Compiler::fgValueNumberTree(GenTree* tree) fgValueNumberCall(tree->AsCall()); break; +#ifdef FEATURE_SIMD + case GT_SIMD: + fgValueNumberSimd(tree->AsSIMD()); + break; +#endif // FEATURE_SIMD + +#ifdef FEATURE_HW_INTRINSICS + case GT_HWINTRINSIC: + fgValueNumberHWIntrinsic(tree->AsHWIntrinsic()); + break; +#endif // FEATURE_HW_INTRINSICS + case GT_CMPXCHG: // Specialop { // For CMPXCHG and other intrinsics add an arbitrary side effect on GcHeap/ByrefExposed. @@ -9396,17 +9442,13 @@ void Compiler::fgValueNumberIntrinsic(GenTree* tree) vnStore->VNPWithExc(vnStore->EvalMathFuncUnary(tree->TypeGet(), intrinsic->gtIntrinsicName, arg0VNP), arg0VNPx); } - else if (!intrinsic->AsOp()->gtOp1->OperIsList()) + else { ValueNumPair newVNP = vnStore->EvalMathFuncBinary(tree->TypeGet(), intrinsic->gtIntrinsicName, arg0VNP, arg1VNP); ValueNumPair excSet = vnStore->VNPExcSetUnion(arg0VNPx, arg1VNPx); intrinsic->gtVNPair = vnStore->VNPWithExc(newVNP, excSet); } - else - { - unreached(); - } } else { @@ -9418,30 +9460,24 @@ void Compiler::fgValueNumberIntrinsic(GenTree* tree) #ifdef FEATURE_SIMD // Does value-numbering for a GT_SIMD node. -void Compiler::fgValueNumberSimd(GenTree* tree) +void Compiler::fgValueNumberSimd(GenTreeSIMD* tree) { - assert(tree->OperGet() == GT_SIMD); - GenTreeSIMD* simdNode = tree->AsSIMD(); - assert(simdNode != nullptr); - VNFunc simdFunc = GetVNFuncForNode(tree); ValueNumPair excSetPair; ValueNumPair normalPair; // There are some SIMD operations that have zero args, i.e. NI_Vector128_Zero - if (tree->AsOp()->gtOp1 == nullptr) + if (tree->GetOperandCount() == 0) { excSetPair = ValueNumStore::VNPForEmptyExcSet(); normalPair = vnStore->VNPairForFunc(tree->TypeGet(), simdFunc); } - else if (tree->AsOp()->gtOp1->OperIs(GT_LIST)) + // TODO-List-Cleanup: the "tree->GetSIMDIntrinsicId() == SIMDIntrinsicInitN" case is a quirk + // to get zero diffs - Vector2(float, float) was imported with lists - remove it. + else if ((tree->GetOperandCount() > 2) || (tree->GetSIMDIntrinsicId() == SIMDIntrinsicInitN)) { - assert(tree->AsOp()->gtOp2 == nullptr); - - // We have a SIMD node in the GT_LIST form with 3 or more args - // For now we will generate a unique value number for this case. - - // Generate a unique VN + // We have a SIMD node with 3 or more args. To retain the + // previous behavior, we will generate a unique VN for this case. tree->gtVNPair.SetBoth(vnStore->VNForExpr(compCurBB, tree->TypeGet())); return; } @@ -9450,25 +9486,25 @@ void Compiler::fgValueNumberSimd(GenTree* tree) ValueNumPair resvnp = ValueNumPair(); ValueNumPair op1vnp; ValueNumPair op1Xvnp; - vnStore->VNPUnpackExc(tree->AsOp()->gtOp1->gtVNPair, &op1vnp, &op1Xvnp); + vnStore->VNPUnpackExc(tree->Op(1)->gtVNPair, &op1vnp, &op1Xvnp); ValueNum addrVN = ValueNumStore::NoVN; - bool isMemoryLoad = simdNode->OperIsMemoryLoad(); + bool isMemoryLoad = tree->OperIsMemoryLoad(); if (isMemoryLoad) { // Currently the only SIMD operation with MemoryLoad sematics is SIMDIntrinsicInitArray // and it has to be handled specially since it has an optional op2 // - assert(simdNode->gtSIMDIntrinsicID == SIMDIntrinsicInitArray); + assert(tree->GetSIMDIntrinsicId() == SIMDIntrinsicInitArray); // rationalize rewrites this as an explicit load with op1 as the base address assert(tree->OperIsImplicitIndir()); ValueNumPair op2vnp; - if (tree->AsOp()->gtOp2 == nullptr) + if (tree->GetOperandCount() != 2) { - // a nullptr for op2 means that we have an impicit index of zero + // No op2 means that we have an impicit index of zero op2vnp = ValueNumPair(vnStore->VNZeroForType(TYP_INT), vnStore->VNZeroForType(TYP_INT)); excSetPair = op1Xvnp; @@ -9476,7 +9512,7 @@ void Compiler::fgValueNumberSimd(GenTree* tree) else // We have an explicit index in op2 { ValueNumPair op2Xvnp; - vnStore->VNPUnpackExc(tree->AsOp()->gtOp2->gtVNPair, &op2vnp, &op2Xvnp); + vnStore->VNPUnpackExc(tree->Op(2)->gtVNPair, &op2vnp, &op2Xvnp); excSetPair = vnStore->VNPExcSetUnion(op1Xvnp, op2Xvnp); } @@ -9488,7 +9524,7 @@ void Compiler::fgValueNumberSimd(GenTree* tree) if (verbose) { printf("Treating GT_SIMD %s as a ByrefExposed load , addrVN is ", - simdIntrinsicNames[simdNode->gtSIMDIntrinsicID]); + simdIntrinsicNames[tree->GetSIMDIntrinsicId()]); vnPrint(addrVN, 0); } #endif // DEBUG @@ -9499,17 +9535,15 @@ void Compiler::fgValueNumberSimd(GenTree* tree) tree->gtVNPair.SetLiberal(loadVN); tree->gtVNPair.SetConservative(vnStore->VNForExpr(compCurBB, tree->TypeGet())); tree->gtVNPair = vnStore->VNPWithExc(tree->gtVNPair, excSetPair); - fgValueNumberAddExceptionSetForIndirection(tree, tree->AsOp()->gtOp1); + fgValueNumberAddExceptionSetForIndirection(tree, tree->Op(1)); return; } - bool encodeResultType = vnEncodesResultTypeForSIMDIntrinsic(simdNode->gtSIMDIntrinsicID); + bool encodeResultType = vnEncodesResultTypeForSIMDIntrinsic(tree->GetSIMDIntrinsicId()); if (encodeResultType) { - ValueNum vnSize = vnStore->VNForIntCon(simdNode->GetSimdSize()); - ValueNum vnBaseType = vnStore->VNForIntCon(INT32(simdNode->GetSimdBaseType())); - ValueNum simdTypeVN = vnStore->VNForFunc(TYP_REF, VNF_SimdType, vnSize, vnBaseType); + ValueNum simdTypeVN = vnStore->VNForSimdType(tree->GetSimdSize(), tree->GetSimdBaseType()); resvnp.SetBoth(simdTypeVN); #ifdef DEBUG @@ -9522,9 +9556,9 @@ void Compiler::fgValueNumberSimd(GenTree* tree) #endif } - if (tree->AsOp()->gtOp2 == nullptr) + if (tree->GetOperandCount() == 1) { - // Unary SIMD nodes have a nullptr for op2. + // A unary SIMD node. excSetPair = op1Xvnp; if (encodeResultType) { @@ -9541,7 +9575,7 @@ void Compiler::fgValueNumberSimd(GenTree* tree) { ValueNumPair op2vnp; ValueNumPair op2Xvnp; - vnStore->VNPUnpackExc(tree->AsOp()->gtOp2->gtVNPair, &op2vnp, &op2Xvnp); + vnStore->VNPUnpackExc(tree->Op(2)->gtVNPair, &op2vnp, &op2Xvnp); excSetPair = vnStore->VNPExcSetUnion(op1Xvnp, op2Xvnp); if (encodeResultType) @@ -9562,33 +9596,26 @@ void Compiler::fgValueNumberSimd(GenTree* tree) #ifdef FEATURE_HW_INTRINSICS // Does value-numbering for a GT_HWINTRINSIC node -void Compiler::fgValueNumberHWIntrinsic(GenTree* tree) +void Compiler::fgValueNumberHWIntrinsic(GenTreeHWIntrinsic* tree) { - assert(tree->OperGet() == GT_HWINTRINSIC); - GenTreeHWIntrinsic* hwIntrinsicNode = tree->AsHWIntrinsic(); - assert(hwIntrinsicNode != nullptr); - // For safety/correctness we must mutate the global heap valuenumber // for any HW intrinsic that performs a memory store operation - if (hwIntrinsicNode->OperIsMemoryStore()) + if (tree->OperIsMemoryStore()) { fgMutateGcHeap(tree DEBUGARG("HWIntrinsic - MemoryStore")); } - if ((tree->AsOp()->gtOp1 != nullptr) && tree->gtGetOp1()->OperIs(GT_LIST)) + if (tree->GetOperandCount() > 2) { - // TODO-CQ: allow intrinsics with GT_LIST to be properly VN'ed, it will + // TODO-CQ: allow intrinsics with > 2 operands to be properly VN'ed, it will // allow use to process things like Vector128.Create(1,2,3,4) etc. - // Generate unique VN for now. + // Generate unique VN for now to retaing previois behavior. tree->gtVNPair.SetBoth(vnStore->VNForExpr(compCurBB, tree->TypeGet())); return; } - // We don't expect GT_LIST to be in the second op - assert((tree->AsOp()->gtOp2 == nullptr) || !tree->gtGetOp2()->OperIs(GT_LIST)); - VNFunc func = GetVNFuncForNode(tree); - bool isMemoryLoad = hwIntrinsicNode->OperIsMemoryLoad(); + bool isMemoryLoad = tree->OperIsMemoryLoad(); // If we have a MemoryLoad operation we will use the fgValueNumberByrefExposedLoad // method to assign a value number that depends upon fgCurMemoryVN[ByrefExposed] ValueNumber @@ -9597,7 +9624,7 @@ void Compiler::fgValueNumberHWIntrinsic(GenTree* tree) { ValueNumPair op1vnp; ValueNumPair op1Xvnp; - vnStore->VNPUnpackExc(tree->AsOp()->gtOp1->gtVNPair, &op1vnp, &op1Xvnp); + vnStore->VNPUnpackExc(tree->Op(1)->gtVNPair, &op1vnp, &op1Xvnp); // The addrVN incorporates both op1's ValueNumber and the func operation // The func is used because operations such as LoadLow and LoadHigh perform @@ -9612,11 +9639,11 @@ void Compiler::fgValueNumberHWIntrinsic(GenTree* tree) tree->gtVNPair.SetLiberal(loadVN); tree->gtVNPair.SetConservative(vnStore->VNForExpr(compCurBB, tree->TypeGet())); tree->gtVNPair = vnStore->VNPWithExc(tree->gtVNPair, op1Xvnp); - fgValueNumberAddExceptionSetForIndirection(tree, tree->AsOp()->gtOp1); + fgValueNumberAddExceptionSetForIndirection(tree, tree->Op(1)); return; } - bool encodeResultType = vnEncodesResultTypeForHWIntrinsic(hwIntrinsicNode->gtHWIntrinsicId); + bool encodeResultType = vnEncodesResultTypeForHWIntrinsic(tree->GetHWIntrinsicId()); ValueNumPair excSetPair = ValueNumStore::VNPForEmptyExcSet(); ValueNumPair normalPair; @@ -9624,9 +9651,7 @@ void Compiler::fgValueNumberHWIntrinsic(GenTree* tree) if (encodeResultType) { - ValueNum vnSize = vnStore->VNForIntCon(hwIntrinsicNode->GetSimdSize()); - ValueNum vnBaseType = vnStore->VNForIntCon(INT32(hwIntrinsicNode->GetSimdBaseType())); - ValueNum simdTypeVN = vnStore->VNForFunc(TYP_REF, VNF_SimdType, vnSize, vnBaseType); + ValueNum simdTypeVN = vnStore->VNForSimdType(tree->GetSimdSize(), tree->GetSimdBaseType()); resvnp.SetBoth(simdTypeVN); #ifdef DEBUG @@ -9639,10 +9664,10 @@ void Compiler::fgValueNumberHWIntrinsic(GenTree* tree) #endif } - const bool isVariableNumArgs = HWIntrinsicInfo::lookupNumArgs(hwIntrinsicNode->gtHWIntrinsicId) == -1; + const bool isVariableNumArgs = HWIntrinsicInfo::lookupNumArgs(tree->GetHWIntrinsicId()) == -1; // There are some HWINTRINSICS operations that have zero args, i.e. NI_Vector128_Zero - if (tree->AsOp()->gtOp1 == nullptr) + if (tree->GetOperandCount() == 0) { // Currently we don't have intrinsics with variable number of args with a parameter-less option. assert(!isVariableNumArgs); @@ -9663,9 +9688,9 @@ void Compiler::fgValueNumberHWIntrinsic(GenTree* tree) { ValueNumPair op1vnp; ValueNumPair op1Xvnp; - vnStore->VNPUnpackExc(tree->AsOp()->gtOp1->gtVNPair, &op1vnp, &op1Xvnp); + vnStore->VNPUnpackExc(tree->Op(1)->gtVNPair, &op1vnp, &op1Xvnp); - if (tree->AsOp()->gtOp2 == nullptr) + if (tree->GetOperandCount() == 1) { excSetPair = op1Xvnp; @@ -9684,7 +9709,7 @@ void Compiler::fgValueNumberHWIntrinsic(GenTree* tree) { ValueNumPair op2vnp; ValueNumPair op2Xvnp; - vnStore->VNPUnpackExc(tree->AsOp()->gtOp2->gtVNPair, &op2vnp, &op2Xvnp); + vnStore->VNPUnpackExc(tree->Op(2)->gtVNPair, &op2vnp, &op2Xvnp); excSetPair = vnStore->VNPExcSetUnion(op1Xvnp, op2Xvnp); if (encodeResultType) @@ -10265,9 +10290,6 @@ VNFunc Compiler::fgValueNumberJitHelperMethodVNFunc(CorInfoHelpFunc helpFunc) case CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE_DYNAMICCLASS: vnf = VNF_GetsharedNongcthreadstaticBaseDynamicclass; break; - case CORINFO_HELP_GETSTATICFIELDADDR_CONTEXT: - vnf = VNF_GetStaticAddrContext; - break; case CORINFO_HELP_GETSTATICFIELDADDR_TLS: vnf = VNF_GetStaticAddrTLS; break; diff --git a/src/coreclr/jit/valuenum.h b/src/coreclr/jit/valuenum.h index afb9510090e39a..a45044b6620357 100644 --- a/src/coreclr/jit/valuenum.h +++ b/src/coreclr/jit/valuenum.h @@ -57,17 +57,9 @@ // taken from another map at a given index. As such, it must have a type that corresponds // to the "index/selector", in practical terms - the field's type. // -// Note that the above constraints on the types for maps are not followed currently to the -// letter by the implementation - "opaque" maps can and do have TYP_REF assigned to them -// in various situations such as when initializing the "primary" VNs for loop entries. -// -// Note as well that the meaning of "the type" for a map is overloaded, because maps are used -// both to represent memory "of all fields B of all objects that have this field in the heap" -// and "the field B of this particular object on the heap". Only the latter maps can be used -// as VNs for actual nodes, while the former are used for "the first field" maps and "array -// equivalence type" maps, and, of course, for the heap VNs, which always have the placeholder -// types of TYP_REF or TYP_UNKNOWN. In principle, placeholder types could be given to all the -// maps of the former type. +// Note that we give "placeholder" types (TYP_UNDEF and TYP_UNKNOWN as TYP_MEM and TYP_HEAP) +// to maps that do not represent values found in IR. This is just to avoid confusion and +// facilitate more precise validating checks. // // Let's review the following snippet to demonstrate how the MapSelect/MapStore machinery works // together to deliver the results that it does. Say we have this snippet of (C#) code: @@ -196,6 +188,12 @@ struct VNFuncApp // This define is used with string concatenation to put this in printf format strings #define FMT_VN "$%x" +// We will use this placeholder type for memory maps that do not represent IR values ("field maps", etc). +static const var_types TYP_MEM = TYP_UNDEF; + +// We will use this placeholder type for memory maps representing "the heap" (GcHeap/ByrefExposed). +static const var_types TYP_HEAP = TYP_UNKNOWN; + class ValueNumStore { @@ -420,13 +418,6 @@ class ValueNumStore return ValueNum(SRC_Null); } - // The zero map is the map that returns a zero "for the appropriate type" when indexed at any index. - static ValueNum VNForZeroMap() - { - // We reserve Chunk 0 for "special" VNs. Let SRC_ZeroMap (== 1) be the zero map. - return ValueNum(SRC_ZeroMap); - } - // The ROH map is the map for the "read-only heap". We assume that this is never mutated, and always // has the same value number. static ValueNum VNForROH() @@ -435,8 +426,8 @@ class ValueNumStore return ValueNum(SRC_ReadOnlyHeap); } - // A special value number for "void" -- sometimes a type-void thing is an argument to a - // GT_LIST, and we want the args to be non-NoVN. + // A special value number for "void" -- sometimes a type-void thing is an argument, + // and we want the args to be non-NoVN. static ValueNum VNForVoid() { // We reserve Chunk 0 for "special" VNs. Let SRC_Void (== 4) be the value for "void". @@ -463,10 +454,18 @@ class ValueNumStore // It has an unreached() for a "typ" that has no zero value, such as TYP_VOID. ValueNum VNZeroForType(var_types typ); + // Returns the value number for a zero-initialized struct. + ValueNum VNForZeroObj(CORINFO_CLASS_HANDLE structHnd); + // Returns the value number for one of the given "typ". // It returns NoVN for a "typ" that has no one value, such as TYP_REF. ValueNum VNOneForType(var_types typ); +#ifdef FEATURE_SIMD + // A helper function for constructing VNF_SimdType VNs. + ValueNum VNForSimdType(unsigned simdSize, var_types simdBaseType); +#endif // FEATURE_SIMD + // Create or return the existimg value number representing a singleton exception set // for the the exception value "x". ValueNum VNExcSetSingleton(ValueNum x); @@ -588,7 +587,9 @@ class ValueNumStore ValueNumKind vnk, var_types type, ValueNum map, ValueNum index, int* pBudget, bool* pUsedRecursiveVN); // A specialized version of VNForFunc that is used for VNF_MapStore and provides some logging when verbose is set - ValueNum VNForMapStore(var_types type, ValueNum map, ValueNum index, ValueNum value); + ValueNum VNForMapStore(ValueNum map, ValueNum index, ValueNum value); + + ValueNum VNForFieldSelector(CORINFO_FIELD_HANDLE fieldHnd, var_types* pFieldType, size_t* pStructSize = nullptr); // These functions parallel the ones above, except that they take liberal/conservative VN pairs // as arguments, and return such a pair (the pair of the function applied to the liberal args, and @@ -837,11 +838,16 @@ class ValueNumStore // enum class VN_RELATION_KIND { + VRK_Same, // (x > y) VRK_Swap, // (y > x) VRK_Reverse, // (x <= y) VRK_SwapReverse // (y >= x) }; +#ifdef DEBUG + static const char* VNRelationString(VN_RELATION_KIND vrk); +#endif + ValueNum GetRelatedRelop(ValueNum vn, VN_RELATION_KIND vrk); // Convert a vartype_t to the value number's storage type for that vartype_t. @@ -1021,14 +1027,19 @@ class ValueNumStore // Prints the cast's representation mirroring GT_CAST's dump format. void vnDumpCast(Compiler* comp, ValueNum castVN); + // Requires "zeroObj" to be a VNF_ZeroObj. Prints its representation. + void vnDumpZeroObj(Compiler* comp, VNFuncApp* zeroObj); + // Returns the string name of "vnf". static const char* VNFuncName(VNFunc vnf); // Used in the implementation of the above. static const char* VNFuncNameArr[]; + // Returns a type name used for "maps", i. e. displays TYP_UNDEF and TYP_UNKNOWN as TYP_MEM and TYP_HEAP. + static const char* VNMapTypeName(var_types type); + // Returns the string name of "vn" when it is a reserved value number, nullptr otherwise static const char* reservedName(ValueNum vn); - #endif // DEBUG // Returns true if "vn" is a reserved value number @@ -1449,7 +1460,6 @@ class ValueNumStore enum SpecialRefConsts { SRC_Null, - SRC_ZeroMap, SRC_ReadOnlyHeap, SRC_Void, SRC_EmptyExcSet, diff --git a/src/coreclr/jit/valuenumfuncs.h b/src/coreclr/jit/valuenumfuncs.h index 7665770881bcd9..d5a81d03ca5022 100644 --- a/src/coreclr/jit/valuenumfuncs.h +++ b/src/coreclr/jit/valuenumfuncs.h @@ -12,7 +12,6 @@ ValueNumFuncDef(MapSelect, 2, false, false, false) // Args: 0: map, 1: key. ValueNumFuncDef(FieldSeq, 2, false, false, false) // Sequence (VN of null == empty) of (VN's of) field handles. ValueNumFuncDef(NotAField, 0, false, false, false) // Value number function for FieldSeqStore::NotAField. -ValueNumFuncDef(ZeroMap, 0, false, false, false) // The "ZeroMap": indexing at any index yields "zero of the desired type". ValueNumFuncDef(PtrToLoc, 2, false, false, false) // Pointer (byref) to a local variable. Args: VN's of: 0: var num, 1: FieldSeq. ValueNumFuncDef(PtrToArrElem, 4, false, false, false) // Pointer (byref) to an array element. Args: 0: array elem type eq class var_types value, VN's of: 1: array, 2: index, 3: FieldSeq. @@ -22,6 +21,7 @@ ValueNumFuncDef(Phi, 2, false, false, false) // A phi function. Only occ ValueNumFuncDef(PhiDef, 3, false, false, false) // Args: 0: local var # (or -1 for memory), 1: SSA #, 2: VN of definition. // Wouldn't need this if I'd made memory a regular local variable... ValueNumFuncDef(PhiMemoryDef, 2, false, false, false) // Args: 0: VN for basic block pointer, 1: VN of definition +ValueNumFuncDef(ZeroObj, 1, false, false, false) // Zero-initialized struct. Args: 0: VN of the class handle. ValueNumFuncDef(InitVal, 1, false, false, false) // An input arg, or init val of a local Args: 0: a constant VN. @@ -128,7 +128,6 @@ ValueNumFuncDef(RuntimeHandleMethod, 2, false, true, false) ValueNumFuncDef(RuntimeHandleClass, 2, false, true, false) ValueNumFuncDef(ReadyToRunGenericHandle, 2, false, true, false) -ValueNumFuncDef(GetStaticAddrContext, 1, false, true, false) ValueNumFuncDef(GetStaticAddrTLS, 1, false, true, false) ValueNumFuncDef(JitNew, 2, false, true, false) diff --git a/src/coreclr/jit/vartype.h b/src/coreclr/jit/vartype.h index d43e02a0a30737..33c411032d3308 100644 --- a/src/coreclr/jit/vartype.h +++ b/src/coreclr/jit/vartype.h @@ -247,6 +247,12 @@ inline bool varTypeIsLong(T vt) return (TypeGet(vt) >= TYP_LONG) && (TypeGet(vt) <= TYP_ULONG); } +template +inline bool varTypeIsInt(T vt) +{ + return (TypeGet(vt) >= TYP_INT) && (TypeGet(vt) <= TYP_UINT); +} + template inline bool varTypeIsMultiReg(T vt) { diff --git a/src/coreclr/md/compiler/custattr_emit.cpp b/src/coreclr/md/compiler/custattr_emit.cpp index 47589f93a24208..02d3f8e9e3a4a1 100644 --- a/src/coreclr/md/compiler/custattr_emit.cpp +++ b/src/coreclr/md/compiler/custattr_emit.cpp @@ -198,8 +198,8 @@ DEFINE_CA_NAMED_ARGS(DllImportAttribute) DEFINE_CA_NAMED_ARGS_END() const KnownCaProp DllImportAttributeProps = {"System.Runtime.InteropServices", "DllImportAttribute", DllImportTargets, bDONTKEEPCA, - rDllImportAttributeArgs, lengthof(rDllImportAttributeArgs), - rDllImportAttributeNamedArgs, lengthof(rDllImportAttributeNamedArgs)}; + rDllImportAttributeArgs, ARRAY_SIZE(rDllImportAttributeArgs), + rDllImportAttributeNamedArgs, ARRAY_SIZE(rDllImportAttributeNamedArgs)}; //----------------------------------------------------------------------------- // GUID args, named args (none), and known attribute properties. @@ -208,7 +208,7 @@ DEFINE_CA_CTOR_ARGS(GuidAttribute) DEFINE_CA_CTOR_ARGS_END() const KnownCaProp GuidAttributeProps = {"System.Runtime.InteropServices", "GuidAttribute", GuidTargets, bKEEPCA, - rGuidAttributeArgs, lengthof(rGuidAttributeArgs)}; + rGuidAttributeArgs, ARRAY_SIZE(rGuidAttributeArgs)}; //----------------------------------------------------------------------------- // ComImport args (none), named args (none), and known attribute properties. @@ -221,7 +221,7 @@ DEFINE_CA_CTOR_ARGS(InterfaceTypeAttribute) DEFINE_CA_CTOR_ARGS_END() const KnownCaProp InterfaceTypeAttributeProps = {"System.Runtime.InteropServices", "InterfaceTypeAttribute", InterfaceTypeTargets, bKEEPCA, - rInterfaceTypeAttributeArgs, lengthof(rInterfaceTypeAttributeArgs)}; + rInterfaceTypeAttributeArgs, ARRAY_SIZE(rInterfaceTypeAttributeArgs)}; //----------------------------------------------------------------------------- // Class interface type args, named args (none), and known attribute properties. @@ -230,7 +230,7 @@ DEFINE_CA_CTOR_ARGS(ClassInterfaceAttribute) DEFINE_CA_CTOR_ARGS_END() const KnownCaProp ClassInterfaceAttributeProps = {"System.Runtime.InteropServices", "ClassInterfaceAttribute", ClassInterfaceTargets, bKEEPCA, - rClassInterfaceAttributeArgs, lengthof(rClassInterfaceAttributeArgs)}; + rClassInterfaceAttributeArgs, ARRAY_SIZE(rClassInterfaceAttributeArgs)}; //----------------------------------------------------------------------------- // Serializable args (none), named args (none), and known attribute properties. @@ -275,15 +275,15 @@ DEFINE_CA_NAMED_ARGS_END() const KnownCaProp MethodImplAttribute1Props = {"System.Runtime.CompilerServices", "MethodImplAttribute", MethodImplTargets, bDONTKEEPCA, 0, 0, - rMethodImplAttributeNamedArgs, lengthof(rMethodImplAttributeNamedArgs), + rMethodImplAttributeNamedArgs, ARRAY_SIZE(rMethodImplAttributeNamedArgs), bMATCHBYSIG}; const KnownCaProp MethodImplAttribute2Props = {"System.Runtime.CompilerServices", "MethodImplAttribute", MethodImplTargets, bDONTKEEPCA, - rMethodImplAttribute2Args, lengthof(rMethodImplAttribute2Args), - rMethodImplAttributeNamedArgs, lengthof(rMethodImplAttributeNamedArgs), + rMethodImplAttribute2Args, ARRAY_SIZE(rMethodImplAttribute2Args), + rMethodImplAttributeNamedArgs, ARRAY_SIZE(rMethodImplAttributeNamedArgs), bMATCHBYSIG}; const KnownCaProp MethodImplAttribute3Props = {"System.Runtime.CompilerServices", "MethodImplAttribute", MethodImplTargets, bDONTKEEPCA, - rMethodImplAttribute3Args, lengthof(rMethodImplAttribute3Args), - rMethodImplAttributeNamedArgs, lengthof(rMethodImplAttributeNamedArgs), + rMethodImplAttribute3Args, ARRAY_SIZE(rMethodImplAttribute3Args), + rMethodImplAttributeNamedArgs, ARRAY_SIZE(rMethodImplAttributeNamedArgs), bMATCHBYNAME}; //----------------------------------------------------------------------------- @@ -324,13 +324,13 @@ DEFINE_CA_NAMED_ARGS(MarshalAsAttribute) DEFINE_CA_NAMED_ARGS_END() const KnownCaProp MarshalAsAttribute1Props = {"System.Runtime.InteropServices", "MarshalAsAttribute", MarshalTargets, bDONTKEEPCA, - rMarshalAsAttribute1Args, lengthof(rMarshalAsAttribute1Args), - rMarshalAsAttributeNamedArgs, lengthof(rMarshalAsAttributeNamedArgs), + rMarshalAsAttribute1Args, ARRAY_SIZE(rMarshalAsAttribute1Args), + rMarshalAsAttributeNamedArgs, ARRAY_SIZE(rMarshalAsAttributeNamedArgs), bMATCHBYSIG}; const KnownCaProp MarshalAsAttribute2Props = {"System.Runtime.InteropServices", "MarshalAsAttribute", MarshalTargets, bDONTKEEPCA, - rMarshalAsAttribute2Args, lengthof(rMarshalAsAttribute2Args), - rMarshalAsAttributeNamedArgs, lengthof(rMarshalAsAttributeNamedArgs), + rMarshalAsAttribute2Args, ARRAY_SIZE(rMarshalAsAttribute2Args), + rMarshalAsAttributeNamedArgs, ARRAY_SIZE(rMarshalAsAttributeNamedArgs), bMATCHBYNAME}; //----------------------------------------------------------------------------- @@ -375,12 +375,12 @@ DEFINE_CA_NAMED_ARGS(StructLayoutAttribute) DEFINE_CA_NAMED_ARGS_END() const KnownCaProp StructLayoutAttribute1Props = {"System.Runtime.InteropServices", "StructLayoutAttribute", StructLayoutTargets, bDONTKEEPCA, - rStructLayoutAttribute1Args, lengthof(rStructLayoutAttribute1Args), - rStructLayoutAttributeNamedArgs, lengthof(rStructLayoutAttributeNamedArgs), + rStructLayoutAttribute1Args, ARRAY_SIZE(rStructLayoutAttribute1Args), + rStructLayoutAttributeNamedArgs, ARRAY_SIZE(rStructLayoutAttributeNamedArgs), bMATCHBYSIG}; const KnownCaProp StructLayoutAttribute2Props = {"System.Runtime.InteropServices", "StructLayoutAttribute", StructLayoutTargets, bDONTKEEPCA, - rStructLayoutAttribute2Args, lengthof(rStructLayoutAttribute2Args), - rStructLayoutAttributeNamedArgs, lengthof(rStructLayoutAttributeNamedArgs), + rStructLayoutAttribute2Args, ARRAY_SIZE(rStructLayoutAttribute2Args), + rStructLayoutAttributeNamedArgs, ARRAY_SIZE(rStructLayoutAttributeNamedArgs), bMATCHBYNAME}; //----------------------------------------------------------------------------- @@ -390,7 +390,7 @@ DEFINE_CA_CTOR_ARGS(FieldOffsetAttribute) DEFINE_CA_CTOR_ARGS_END() const KnownCaProp FieldOffsetAttributeProps = {"System.Runtime.InteropServices", "FieldOffsetAttribute", FieldOffsetTargets, bDONTKEEPCA, - rFieldOffsetAttributeArgs, lengthof(rFieldOffsetAttributeArgs)}; + rFieldOffsetAttributeArgs, ARRAY_SIZE(rFieldOffsetAttributeArgs)}; DEFINE_CA_CTOR_ARGS(TypeLibVersionAttribute) DEFINE_CA_CTOR_ARG(SERIALIZATION_TYPE_I4) @@ -398,7 +398,7 @@ DEFINE_CA_CTOR_ARGS(TypeLibVersionAttribute) DEFINE_CA_CTOR_ARGS_END() const KnownCaProp TypeLibVersionAttributeProps = {"System.Runtime.InteropServices", "TypeLibVersionAttribute", TypeLibVersionTargets, bKEEPCA, - rTypeLibVersionAttributeArgs, lengthof(rTypeLibVersionAttributeArgs)}; + rTypeLibVersionAttributeArgs, ARRAY_SIZE(rTypeLibVersionAttributeArgs)}; DEFINE_CA_CTOR_ARGS(ComCompatibleVersionAttribute) @@ -409,7 +409,7 @@ DEFINE_CA_CTOR_ARGS(ComCompatibleVersionAttribute) DEFINE_CA_CTOR_ARGS_END() const KnownCaProp ComCompatibleVersionAttributeProps = {"System.Runtime.InteropServices", "ComCompatibleVersionAttribute", ComCompatibleVersionTargets, bKEEPCA, - rComCompatibleVersionAttributeArgs, lengthof(rComCompatibleVersionAttributeArgs)}; + rComCompatibleVersionAttributeArgs, ARRAY_SIZE(rComCompatibleVersionAttributeArgs)}; //----------------------------------------------------------------------------- diff --git a/src/coreclr/md/compiler/regmeta.cpp b/src/coreclr/md/compiler/regmeta.cpp index ffe28774334698..44acdf6f410574 100644 --- a/src/coreclr/md/compiler/regmeta.cpp +++ b/src/coreclr/md/compiler/regmeta.cpp @@ -910,7 +910,7 @@ const char *DumpMD_DumpRawNameOfType(RegMeta *pMD, ULONG iType) } // default: static char buf[30]; - sprintf_s(buf, NumItems(buf), "unknown type 0x%02x", iType); + sprintf_s(buf, ARRAY_SIZE(buf), "unknown type 0x%02x", iType); return buf; } // const char *DumpMD_DumpRawNameOfType() @@ -1127,7 +1127,7 @@ void DumpMD_DisplayUserStrings( bool bUnprint = false; // Is an unprintable character found? HRESULT hr; // A result. while (SUCCEEDED(hr = pMD->EnumUserStrings( &stringEnum, - Strings, NumItems(Strings), &count)) && + Strings, ARRAY_SIZE(Strings), &count)) && count > 0) { if (totalCount == 1) @@ -1225,7 +1225,7 @@ void DumpMD_DumpRawHeaps( do { pMD->GetBlob(oData, &cbData, (const void**)&pData); - sprintf_s(rcPrefix, NumItems(rcPrefix), "%5x,%-2x", oData, cbData); + sprintf_s(rcPrefix, ARRAY_SIZE(rcPrefix), "%5x,%-2x", oData, cbData); DumpMD_DumpHex(rcPrefix, pData, cbData); hr = pMD->GetNextBlob(oData, &oData); } @@ -1239,7 +1239,7 @@ void DumpMD_DumpRawHeaps( do { pMD->GetString(oData, &pString); - sprintf_s(rcPrefix, NumItems(rcPrefix), "%08x", oData); + sprintf_s(rcPrefix, ARRAY_SIZE(rcPrefix), "%08x", oData); DumpMD_DumpHex(rcPrefix, pString, (ULONG)strlen(pString)+1); if (*pString != 0) DumpMD_VWrite("%08x: %s\n", oData, pString); diff --git a/src/coreclr/md/compiler/regmeta_vm.cpp b/src/coreclr/md/compiler/regmeta_vm.cpp index 04b69c7d5cc3a1..80746137bfbaf1 100644 --- a/src/coreclr/md/compiler/regmeta_vm.cpp +++ b/src/coreclr/md/compiler/regmeta_vm.cpp @@ -27,9 +27,6 @@ #include - - - #define DEFINE_CUSTOM_NODUPCHECK 1 #define DEFINE_CUSTOM_DUPCHECK 2 #define SET_CUSTOM 3 @@ -210,12 +207,12 @@ RegMeta::ResolveTypeRef( _ASSERTE(TypeFromToken(tr) == mdtTypeRef); IfFailGo(pMiniMd->GetTypeRefRecord(RidFromToken(tr), &pTypeRefRec)); - IfFailGo(pMiniMd->getNamespaceOfTypeRef(pTypeRefRec, wzNameSpace, lengthof(wzNameSpace), NULL)); + IfFailGo(pMiniMd->getNamespaceOfTypeRef(pTypeRefRec, wzNameSpace, ARRAY_SIZE(wzNameSpace), NULL)); if (hr != NOERROR) { _ASSERTE(hr == CLDB_S_TRUNCATION); // Truncate the namespace string - wzNameSpace[lengthof(wzNameSpace) - 1] = 0; + wzNameSpace[STRING_LENGTH(wzNameSpace)] = 0; } //*********************** diff --git a/src/coreclr/md/enc/metamodelrw.cpp b/src/coreclr/md/enc/metamodelrw.cpp index bc15f4f6ffcb16..82142503783b11 100644 --- a/src/coreclr/md/enc/metamodelrw.cpp +++ b/src/coreclr/md/enc/metamodelrw.cpp @@ -5219,7 +5219,7 @@ CMiniMdRW::FindGenericParamHelper( if (IsSorted(TBL_GenericParam)) { mdToken tk; - tk = encodeToken(RidFromToken(tkOwner), TypeFromToken(tkOwner), mdtTypeOrMethodDef, lengthof(mdtTypeOrMethodDef)); + tk = encodeToken(RidFromToken(tkOwner), TypeFromToken(tkOwner), mdtTypeOrMethodDef, ARRAY_SIZE(mdtTypeOrMethodDef)); IfFailGo(SearchTableForMultipleRows(TBL_GenericParam, _COLDEF(GenericParam,Owner), tk, diff --git a/src/coreclr/md/inc/metamodel.h b/src/coreclr/md/inc/metamodel.h index cc368146807665..56845d20ff6ceb 100644 --- a/src/coreclr/md/inc/metamodel.h +++ b/src/coreclr/md/inc/metamodel.h @@ -21,6 +21,8 @@ #include "../datablob.h" #include "../debug_metadata.h" +#include + #ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB #include "portablepdbmdds.h" #include "portablepdbmdi.h" @@ -1622,12 +1624,12 @@ template class CMiniMdTemplate : public CMiniMdBase // Return RID to Constant table. __checkReturn HRESULT FindConstantFor(RID rid, mdToken typ, RID *pFoundRid) - { return doSearchTable(TBL_Constant, _COLPAIR(Constant,Parent), encodeToken(rid,typ,mdtHasConstant,lengthof(mdtHasConstant)), pFoundRid); } + { return doSearchTable(TBL_Constant, _COLPAIR(Constant,Parent), encodeToken(rid,typ,mdtHasConstant, ARRAY_SIZE(mdtHasConstant)), pFoundRid); } // Return RID to FieldMarshal table. __checkReturn HRESULT FindFieldMarshalFor(RID rid, mdToken typ, RID *pFoundRid) - { return doSearchTable(TBL_FieldMarshal, _COLPAIR(FieldMarshal,Parent), encodeToken(rid,typ,mdtHasFieldMarshal,lengthof(mdtHasFieldMarshal)), pFoundRid); } + { return doSearchTable(TBL_FieldMarshal, _COLPAIR(FieldMarshal,Parent), encodeToken(rid,typ,mdtHasFieldMarshal, ARRAY_SIZE(mdtHasFieldMarshal)), pFoundRid); } // Return RID to ClassLayout table, given the rid to a TypeDef. __checkReturn @@ -1695,7 +1697,7 @@ template class CMiniMdTemplate : public CMiniMdBase // Return RID to Constant table. __checkReturn HRESULT FindImplMapFor(RID rid, mdToken typ, RID *pFoundRid) - { return doSearchTable(TBL_ImplMap, _COLPAIR(ImplMap,MemberForwarded), encodeToken(rid,typ,mdtMemberForwarded,lengthof(mdtMemberForwarded)), pFoundRid); } + { return doSearchTable(TBL_ImplMap, _COLPAIR(ImplMap,MemberForwarded), encodeToken(rid,typ,mdtMemberForwarded, ARRAY_SIZE(mdtMemberForwarded)), pFoundRid); } // Return RID to FieldRVA table. __checkReturn @@ -1735,7 +1737,7 @@ template class CMiniMdTemplate : public CMiniMdBase { return SearchTableForMultipleRows(TBL_GenericParam, _COLDEF(GenericParam,Owner), - encodeToken(rid, mdtTypeDef, mdtTypeOrMethodDef, lengthof(mdtTypeOrMethodDef)), + encodeToken(rid, mdtTypeDef, mdtTypeOrMethodDef, ARRAY_SIZE(mdtTypeOrMethodDef)), pEnd, pFoundRid); } @@ -1744,7 +1746,7 @@ template class CMiniMdTemplate : public CMiniMdBase { return SearchTableForMultipleRows(TBL_GenericParam, _COLDEF(GenericParam,Owner), - encodeToken(rid, mdtMethodDef, mdtTypeOrMethodDef, lengthof(mdtTypeOrMethodDef)), + encodeToken(rid, mdtMethodDef, mdtTypeOrMethodDef, ARRAY_SIZE(mdtTypeOrMethodDef)), pEnd, pFoundRid); } @@ -1753,7 +1755,7 @@ template class CMiniMdTemplate : public CMiniMdBase { return SearchTableForMultipleRows(TBL_MethodSpec, _COLDEF(MethodSpec,Method), - encodeToken(rid, mdtMethodDef, mdtMethodDefOrRef, lengthof(mdtMethodDefOrRef)), + encodeToken(rid, mdtMethodDef, mdtMethodDefOrRef, ARRAY_SIZE(mdtMethodDefOrRef)), pEnd, pFoundRid); } @@ -1762,7 +1764,7 @@ template class CMiniMdTemplate : public CMiniMdBase { return SearchTableForMultipleRows(TBL_MethodSpec, _COLDEF(MethodSpec,Method), - encodeToken(rid, mdtMemberRef, mdtMethodDefOrRef, lengthof(mdtMethodDefOrRef)), + encodeToken(rid, mdtMemberRef, mdtMethodDefOrRef, ARRAY_SIZE(mdtMethodDefOrRef)), pEnd, pFoundRid); } @@ -1823,7 +1825,7 @@ template class CMiniMdTemplate : public CMiniMdBase { return SearchTableForMultipleRows(TBL_CustomAttribute, _COLDEF(CustomAttribute,Parent), - encodeToken(RidFromToken(tk), TypeFromToken(tk), mdtHasCustomAttribute, lengthof(mdtHasCustomAttribute)), + encodeToken(RidFromToken(tk), TypeFromToken(tk), mdtHasCustomAttribute, ARRAY_SIZE(mdtHasCustomAttribute)), pEnd, pFoundRid); } @@ -1842,7 +1844,7 @@ template class CMiniMdTemplate : public CMiniMdBase { return SearchTableForMultipleRows(TBL_DeclSecurity, _COLDEF(DeclSecurity,Parent), - encodeToken(RidFromToken(tk), TypeFromToken(tk), mdtHasDeclSecurity, lengthof(mdtHasDeclSecurity)), + encodeToken(RidFromToken(tk), TypeFromToken(tk), mdtHasDeclSecurity, ARRAY_SIZE(mdtHasDeclSecurity)), pEnd, pFoundRid); } @@ -1893,7 +1895,7 @@ template class CMiniMdTemplate : public CMiniMdBase { return SearchTableForMultipleRows(TBL_MethodSemantics, _COLDEF(MethodSemantics,Association), - encodeToken(RidFromToken(tk), TypeFromToken(tk), mdtHasSemantic, lengthof(mdtHasSemantic)), + encodeToken(RidFromToken(tk), TypeFromToken(tk), mdtHasSemantic, ARRAY_SIZE(mdtHasSemantic)), pEnd, pFoundRid); } diff --git a/src/coreclr/md/inc/metamodelrw.h b/src/coreclr/md/inc/metamodelrw.h index 90ac20948269ef..a8ccf8ae2effb5 100644 --- a/src/coreclr/md/inc/metamodelrw.h +++ b/src/coreclr/md/inc/metamodelrw.h @@ -24,6 +24,8 @@ #include "../heaps/export.h" #include "../tables/export.h" +#include + struct HENUMInternal; #ifdef FEATURE_METADATA_CUSTOM_DATA_SOURCE struct IMDCustomDataSource; @@ -950,7 +952,7 @@ class CMiniMdRW : public CMiniMdTemplate HRESULT GetGenericParamsForToken(mdToken tk, RID *pRidStart, RID *pRidEnd = 0) { return LookUpTableByCol( - encodeToken(RidFromToken(tk), TypeFromToken(tk), mdtTypeOrMethodDef, lengthof(mdtTypeOrMethodDef)), + encodeToken(RidFromToken(tk), TypeFromToken(tk), mdtTypeOrMethodDef, ARRAY_SIZE(mdtTypeOrMethodDef)), m_pVS[TBL_GenericParam], pRidStart, pRidEnd); } @@ -965,7 +967,7 @@ class CMiniMdRW : public CMiniMdTemplate HRESULT GetMethodSpecsForToken(mdToken tk, RID *pRidStart, RID *pRidEnd = 0) { return LookUpTableByCol( - encodeToken(RidFromToken(tk), TypeFromToken(tk), mdtMethodDefOrRef, lengthof(mdtMethodDefOrRef)), + encodeToken(RidFromToken(tk), TypeFromToken(tk), mdtMethodDefOrRef, ARRAY_SIZE(mdtMethodDefOrRef)), m_pVS[TBL_MethodSpec], pRidStart, pRidEnd); } @@ -973,7 +975,7 @@ class CMiniMdRW : public CMiniMdTemplate HRESULT GetDeclSecurityForToken(mdToken tk, RID *pRidStart, RID *pRidEnd = 0) { return LookUpTableByCol( - encodeToken(RidFromToken(tk), TypeFromToken(tk), mdtHasDeclSecurity, lengthof(mdtHasDeclSecurity)), + encodeToken(RidFromToken(tk), TypeFromToken(tk), mdtHasDeclSecurity, ARRAY_SIZE(mdtHasDeclSecurity)), m_pVS[TBL_DeclSecurity], pRidStart, pRidEnd); @@ -983,7 +985,7 @@ class CMiniMdRW : public CMiniMdTemplate HRESULT GetCustomAttributeForToken(mdToken tk, RID *pRidStart, RID *pRidEnd = 0) { return LookUpTableByCol( - encodeToken(RidFromToken(tk), TypeFromToken(tk), mdtHasCustomAttribute, lengthof(mdtHasCustomAttribute)), + encodeToken(RidFromToken(tk), TypeFromToken(tk), mdtHasCustomAttribute, ARRAY_SIZE(mdtHasCustomAttribute)), m_pVS[TBL_CustomAttribute], pRidStart, pRidEnd); diff --git a/src/coreclr/md/runtime/metamodel.cpp b/src/coreclr/md/runtime/metamodel.cpp index cd1ccde9cc36af..b13ee6a736aaf4 100644 --- a/src/coreclr/md/runtime/metamodel.cpp +++ b/src/coreclr/md/runtime/metamodel.cpp @@ -90,7 +90,7 @@ static const char* rDummy3ColNames[] = { "" }; //----------------------------------------------------------------------------- // Define the array of Coded Token Definitions. -#define MiniMdCodedToken(x) {lengthof(CMiniMdBase::mdt##x), CMiniMdBase::mdt##x, #x}, +#define MiniMdCodedToken(x) {ARRAY_SIZE(CMiniMdBase::mdt##x), CMiniMdBase::mdt##x, #x}, const CCodedTokenDef g_CodedTokens [] = { MiniMdCodedTokens() }; @@ -98,7 +98,7 @@ const CCodedTokenDef g_CodedTokens [] = { // Define the array of Table Definitions. #undef MiniMdTable -#define MiniMdTable(x) { { r##x##Cols, lengthof(r##x##Cols), x##Rec::COL_KEY, 0 }, r##x##ColNames, #x}, +#define MiniMdTable(x) { { r##x##Cols, ARRAY_SIZE(r##x##Cols), x##Rec::COL_KEY, 0 }, r##x##ColNames, #x}, const CMiniTableDefEx g_Tables[TBL_COUNT] = { MiniMdTables() #ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB @@ -107,7 +107,7 @@ const CMiniTableDefEx g_Tables[TBL_COUNT] = { }; // Define a table descriptor for the obsolete v1.0 GenericParam table definition. -const CMiniTableDefEx g_Table_GenericParamV1_1 = { { rGenericParamV1_1Cols, lengthof(rGenericParamV1_1Cols), GenericParamV1_1Rec::COL_KEY, 0 }, rGenericParamV1_1ColNames, "GenericParamV1_"}; +const CMiniTableDefEx g_Table_GenericParamV1_1 = { { rGenericParamV1_1Cols, ARRAY_SIZE(rGenericParamV1_1Cols), GenericParamV1_1Rec::COL_KEY, 0 }, rGenericParamV1_1ColNames, "GenericParamV1_"}; @@ -444,7 +444,7 @@ CMiniMdBase::encodeToken( //***************************************************************************** inline BYTE cbRID(ULONG ixMax) { return ixMax > USHRT_MAX ? (BYTE) sizeof(ULONG) : (BYTE) sizeof(USHORT); } -#define _CBTKN(cRecs,tkns) cbRID((cRecs) << m_cb[lengthof(tkns)]) +#define _CBTKN(cRecs,tkns) cbRID((cRecs) << m_cb[ARRAY_SIZE(tkns)]) //***************************************************************************** // Constructor. @@ -723,7 +723,7 @@ CMiniMdBase::InitColsForTable( HRESULT hr = S_OK; _ASSERTE((bExtra == 0) || (bExtra == 1)); - _ASSERTE(NumItems(pCols) >= pTable->m_cCols); + _ASSERTE(ARRAY_SIZE(pCols) >= pTable->m_cCols); bExtra = 0;//@FUTURE: save in schema header. until then use 0. @@ -751,7 +751,7 @@ CMiniMdBase::InitColsForTable( ULONG iCdTkn = pCols[ixCol].m_Type - iCodedToken; ULONG cRecs = 0; - _ASSERTE(iCdTkn < lengthof(g_CodedTokens)); + _ASSERTE(iCdTkn < ARRAY_SIZE(g_CodedTokens)); CCodedTokenDef const *pCTD = &g_CodedTokens[iCdTkn]; // Iterate the token list of this coded token. @@ -1084,7 +1084,7 @@ CMiniMdBase::FindCustomAttributeFor( { HRESULT hr; int ixFound; // index of some custom value row. - ULONG ulTarget = encodeToken(rid,tkObj,mdtHasCustomAttribute,lengthof(mdtHasCustomAttribute)); // encoded token representing target. + ULONG ulTarget = encodeToken(rid,tkObj,mdtHasCustomAttribute, ARRAY_SIZE(mdtHasCustomAttribute)); // encoded token representing target. ULONG ixCur; // Current row being examined. mdToken tkFound; // Type of some custom value row. void *pCur; // A custom value entry. @@ -1107,7 +1107,7 @@ CMiniMdBase::FindCustomAttributeFor( { // Test the type of the current row. tkFound = getIX(pCur, _COLDEF(CustomAttribute,Type)); - tkFound = decodeToken(tkFound, mdtCustomAttributeType, lengthof(mdtCustomAttributeType)); + tkFound = decodeToken(tkFound, mdtCustomAttributeType, ARRAY_SIZE(mdtCustomAttributeType)); if (tkFound == tkType) { *pFoundRid = ixCur; @@ -1137,7 +1137,7 @@ CMiniMdBase::FindCustomAttributeFor( break; // Test the type of the current row. tkFound = getIX(pCur, _COLDEF(CustomAttribute,Type)); - tkFound = decodeToken(tkFound, mdtCustomAttributeType, lengthof(mdtCustomAttributeType)); + tkFound = decodeToken(tkFound, mdtCustomAttributeType, ARRAY_SIZE(mdtCustomAttributeType)); if (tkFound == tkType) { *pFoundRid = ixCur; diff --git a/src/coreclr/pal/src/debug/debug.cpp b/src/coreclr/pal/src/debug/debug.cpp index 5f6f17a25cf9cd..3e20cb7c1c1534 100644 --- a/src/coreclr/pal/src/debug/debug.cpp +++ b/src/coreclr/pal/src/debug/debug.cpp @@ -742,6 +742,7 @@ PAL_ProbeMemory( BOOL fWriteAccess) { int fds[2]; + int flags; if (pipe(fds) != 0) { @@ -749,8 +750,11 @@ PAL_ProbeMemory( return FALSE; } - fcntl(fds[0], O_NONBLOCK); - fcntl(fds[1], O_NONBLOCK); + flags = fcntl(fds[0], F_GETFL, 0); + fcntl(fds[0], F_SETFL, flags | O_NONBLOCK); + + flags = fcntl(fds[1], F_GETFL, 0); + fcntl(fds[1], F_SETFL, flags | O_NONBLOCK); PVOID pEnd = (PBYTE)pBuffer + cbBuffer; BOOL result = TRUE; diff --git a/src/coreclr/pal/src/exception/machmessage.h b/src/coreclr/pal/src/exception/machmessage.h index c24a979f52089d..01e2bb691d2a41 100644 --- a/src/coreclr/pal/src/exception/machmessage.h +++ b/src/coreclr/pal/src/exception/machmessage.h @@ -35,7 +35,7 @@ using namespace CorUnix; if (machret != KERN_SUCCESS) \ { \ char _szError[1024]; \ - snprintf(_szError, _countof(_szError), "%s: %u: %s", __FUNCTION__, __LINE__, _msg); \ + snprintf(_szError, ARRAY_SIZE(_szError), "%s: %u: %s", __FUNCTION__, __LINE__, _msg); \ mach_error(_szError, machret); \ abort(); \ } \ diff --git a/src/coreclr/pal/src/file/filetime.cpp b/src/coreclr/pal/src/file/filetime.cpp index 7cdde900d2117f..768ee426c4dbfa 100644 --- a/src/coreclr/pal/src/file/filetime.cpp +++ b/src/coreclr/pal/src/file/filetime.cpp @@ -251,7 +251,7 @@ Function FileTimeToSystemTime() Helper function for FileTimeToDosTime. - Converts the necessary file time attibutes to system time, for + Converts the necessary file time attributes to system time, for easier manipulation in FileTimeToDosTime. --*/ diff --git a/src/coreclr/pal/src/include/pal/palinternal.h b/src/coreclr/pal/src/include/pal/palinternal.h index b0abe2aa9be0ac..3a12d789103647 100644 --- a/src/coreclr/pal/src/include/pal/palinternal.h +++ b/src/coreclr/pal/src/include/pal/palinternal.h @@ -617,8 +617,6 @@ function_name() to call the system's implementation #undef assert #define assert (Use__ASSERTE_instead_of_assert) assert -#define string_countof(a) (sizeof(a) / sizeof(a[0]) - 1) - #ifndef __ANDROID__ #define TEMP_DIRECTORY_PATH "/tmp/" #else diff --git a/src/coreclr/pal/src/include/pal/sharedmemory.h b/src/coreclr/pal/src/include/pal/sharedmemory.h index 1ded94e12fcc59..c9cecc750859c0 100644 --- a/src/coreclr/pal/src/include/pal/sharedmemory.h +++ b/src/coreclr/pal/src/include/pal/sharedmemory.h @@ -5,15 +5,12 @@ #define _PAL_SHARED_MEMORY_H_ #include "corunix.hpp" +#include #ifndef static_assert_no_msg #define static_assert_no_msg( cond ) static_assert( cond, #cond ) #endif // !static_assert_no_msg -#ifndef _countof -#define _countof(a) (sizeof(a) / sizeof(a[0])) -#endif // !_countof - // The folder used for storing shared memory files and their lock files is defined in // the gSharedFilesPath global variable. The value of the variable depends on which // OS is being used, and if the application is running in a sandbox in Mac. @@ -28,16 +25,16 @@ // {gSharedFilesPath}/.dotnet/lockfiles/session/ #define SHARED_MEMORY_MAX_FILE_NAME_CHAR_COUNT (_MAX_FNAME - 1) -#define SHARED_MEMORY_MAX_NAME_CHAR_COUNT (string_countof("Global\\") + SHARED_MEMORY_MAX_FILE_NAME_CHAR_COUNT) +#define SHARED_MEMORY_MAX_NAME_CHAR_COUNT (STRING_LENGTH("Global\\") + SHARED_MEMORY_MAX_FILE_NAME_CHAR_COUNT) #define SHARED_MEMORY_RUNTIME_TEMP_DIRECTORY_NAME ".dotnet" #define SHARED_MEMORY_SHARED_MEMORY_DIRECTORY_NAME ".dotnet/shm" #define SHARED_MEMORY_LOCK_FILES_DIRECTORY_NAME ".dotnet/lockfiles" -static_assert_no_msg(_countof(SHARED_MEMORY_LOCK_FILES_DIRECTORY_NAME) >= _countof(SHARED_MEMORY_SHARED_MEMORY_DIRECTORY_NAME)); +static_assert_no_msg(ARRAY_SIZE(SHARED_MEMORY_LOCK_FILES_DIRECTORY_NAME) >= ARRAY_SIZE(SHARED_MEMORY_SHARED_MEMORY_DIRECTORY_NAME)); #define SHARED_MEMORY_GLOBAL_DIRECTORY_NAME "global" #define SHARED_MEMORY_SESSION_DIRECTORY_NAME_PREFIX "session" -static_assert_no_msg(_countof(SHARED_MEMORY_SESSION_DIRECTORY_NAME_PREFIX) >= _countof(SHARED_MEMORY_GLOBAL_DIRECTORY_NAME)); +static_assert_no_msg(ARRAY_SIZE(SHARED_MEMORY_SESSION_DIRECTORY_NAME_PREFIX) >= ARRAY_SIZE(SHARED_MEMORY_GLOBAL_DIRECTORY_NAME)); #define SHARED_MEMORY_UNIQUE_TEMP_NAME_TEMPLATE ".coreclr.XXXXXX" @@ -46,9 +43,9 @@ static_assert_no_msg(_countof(SHARED_MEMORY_SESSION_DIRECTORY_NAME_PREFIX) >= _c // Note that this Max size does not include the prefix folder path size which is unknown (in the case of sandbox) until runtime #define SHARED_MEMORY_MAX_FILE_PATH_CHAR_COUNT \ ( \ - string_countof(SHARED_MEMORY_LOCK_FILES_DIRECTORY_NAME) + \ + STRING_LENGTH(SHARED_MEMORY_LOCK_FILES_DIRECTORY_NAME) + \ 1 /* path separator */ + \ - string_countof(SHARED_MEMORY_SESSION_DIRECTORY_NAME_PREFIX) + \ + STRING_LENGTH(SHARED_MEMORY_SESSION_DIRECTORY_NAME_PREFIX) + \ SHARED_MEMORY_MAX_SESSION_ID_CHAR_COUNT + \ 1 /* path separator */ + \ SHARED_MEMORY_MAX_FILE_NAME_CHAR_COUNT \ diff --git a/src/coreclr/pal/src/init/pal.cpp b/src/coreclr/pal/src/init/pal.cpp index e9dffec3dbb2ae..5469b4bebd483a 100644 --- a/src/coreclr/pal/src/init/pal.cpp +++ b/src/coreclr/pal/src/init/pal.cpp @@ -39,7 +39,7 @@ SET_DEFAULT_DEBUG_CHANNEL(PAL); // some headers have code with asserts, so do th #include "pal/numa.h" #include "pal/stackstring.hpp" #include "pal/cgroup.h" -#include +#include #if HAVE_MACH_EXCEPTIONS #include "../exception/machexception.h" @@ -1371,5 +1371,5 @@ static BOOL INIT_SharedFilesPath(void) return gSharedFilesPath->Set(TEMP_DIRECTORY_PATH); // We can verify statically the non sandboxed case, since the size is known during compile time - static_assert_no_msg(string_countof(TEMP_DIRECTORY_PATH) + SHARED_MEMORY_MAX_FILE_PATH_CHAR_COUNT + 1 /* null terminator */ <= MAX_LONGPATH); + static_assert_no_msg(STRING_LENGTH(TEMP_DIRECTORY_PATH) + SHARED_MEMORY_MAX_FILE_PATH_CHAR_COUNT + 1 /* null terminator */ <= MAX_LONGPATH); } diff --git a/src/coreclr/pal/src/locale/utf8.cpp b/src/coreclr/pal/src/locale/utf8.cpp index 96a633b165d9a2..8ff3229fcbabad 100644 --- a/src/coreclr/pal/src/locale/utf8.cpp +++ b/src/coreclr/pal/src/locale/utf8.cpp @@ -3,8 +3,6 @@ /*++ - - Module Name: unicode/utf8.c @@ -14,8 +12,6 @@ Module Name: Revision History: - - --*/ #include "pal/utf8.h" @@ -25,10 +21,6 @@ using namespace CorUnix; #define FASTLOOP -#ifndef COUNTOF -#define COUNTOF(x) (sizeof(x) / sizeof((x)[0])) -#endif - struct CharUnicodeInfo { static const WCHAR HIGH_SURROGATE_START = 0xd800; @@ -232,7 +224,7 @@ class DecoderReplacementFallback : public DecoderFallback if (bFoundHigh) throw ArgumentException("String 'replacement' contains invalid Unicode code points.", "replacement"); - wcscpy_s(strDefault, COUNTOF(strDefault), replacement); + wcscpy_s(strDefault, ARRAY_SIZE(strDefault), replacement); strDefaultLength = replacementLength; } @@ -429,7 +421,7 @@ class DecoderReplacementFallbackBuffer : public DecoderFallbackBuffer // Construction DecoderReplacementFallbackBuffer(DecoderReplacementFallback* fallback) { - wcscpy_s(strDefault, COUNTOF(strDefault), fallback->GetDefaultString()); + wcscpy_s(strDefault, ARRAY_SIZE(strDefault), fallback->GetDefaultString()); strDefaultLength = PAL_wcslen((const WCHAR *)fallback->GetDefaultString()); } @@ -709,7 +701,7 @@ class EncoderReplacementFallback : public EncoderFallback if (bFoundHigh) throw ArgumentException("String 'replacement' contains invalid Unicode code points.", "replacement"); - wcscpy_s(strDefault, COUNTOF(strDefault), replacement); + wcscpy_s(strDefault, ARRAY_SIZE(strDefault), replacement); strDefaultLength = replacementLength; } @@ -881,8 +873,8 @@ class EncoderReplacementFallbackBuffer : public EncoderFallbackBuffer EncoderReplacementFallbackBuffer(EncoderReplacementFallback* fallback) { // 2X in case we're a surrogate pair - wcscpy_s(strDefault, COUNTOF(strDefault), fallback->GetDefaultString()); - wcscat_s(strDefault, COUNTOF(strDefault), fallback->GetDefaultString()); + wcscpy_s(strDefault, ARRAY_SIZE(strDefault), fallback->GetDefaultString()); + wcscat_s(strDefault, ARRAY_SIZE(strDefault), fallback->GetDefaultString()); strDefaultLength = 2 * PAL_wcslen((const WCHAR *)fallback->GetDefaultString()); } diff --git a/src/coreclr/pal/src/misc/dbgmsg.cpp b/src/coreclr/pal/src/misc/dbgmsg.cpp index a41d2d1036b47d..a5f98a0b0d3231 100644 --- a/src/coreclr/pal/src/misc/dbgmsg.cpp +++ b/src/coreclr/pal/src/misc/dbgmsg.cpp @@ -3,8 +3,6 @@ /*++ - - Module Name: misc/dbgmsg.cpp @@ -13,8 +11,6 @@ Module Name: Implementation of Debug Message utilies. Relay channel information, output functions, etc. - - --*/ /* PAL headers */ @@ -102,7 +98,7 @@ static const char *dbg_channel_names[]= }; // Verify the number of elements in dbg_channel_names -static_assert_no_msg(_countof(dbg_channel_names) == DCI_LAST); +static_assert_no_msg(ARRAY_SIZE(dbg_channel_names) == DCI_LAST); static const char *dbg_level_names[]= { diff --git a/src/coreclr/pal/src/misc/jitsupport.cpp b/src/coreclr/pal/src/misc/jitsupport.cpp index 973de4033e3d4b..2addd1526e64c8 100644 --- a/src/coreclr/pal/src/misc/jitsupport.cpp +++ b/src/coreclr/pal/src/misc/jitsupport.cpp @@ -82,7 +82,7 @@ static const CpuCapability CpuCapabilities[] = { // If the capability name is not recognized or unused at present, zero is returned. static unsigned long LookupCpuCapabilityFlag(const char* start, size_t length) { - for (size_t i = 0; i < _countof(CpuCapabilities); i++) + for (size_t i = 0; i < ARRAY_SIZE(CpuCapabilities); i++) { const char* capabilityName = CpuCapabilities[i].name; if ((length == strlen(capabilityName)) && (memcmp(start, capabilityName, length) == 0)) diff --git a/src/coreclr/pal/src/sharedmemory/sharedmemory.cpp b/src/coreclr/pal/src/sharedmemory/sharedmemory.cpp index 4c946cc5257b74..f82b4c01a47a91 100644 --- a/src/coreclr/pal/src/sharedmemory/sharedmemory.cpp +++ b/src/coreclr/pal/src/sharedmemory/sharedmemory.cpp @@ -444,13 +444,13 @@ SharedMemoryId::SharedMemoryId(LPCSTR name) if (strncmp(name, "Global\\", 7) == 0) { m_isSessionScope = false; - name += _countof("Global\\") - 1; + name += STRING_LENGTH("Global\\"); } else { if (strncmp(name, "Local\\", 6) == 0) { - name += _countof("Local\\") - 1; + name += STRING_LENGTH("Local\\"); } m_isSessionScope = true; } diff --git a/src/coreclr/pal/src/synchmgr/wait.cpp b/src/coreclr/pal/src/synchmgr/wait.cpp index 273b9617a9fb2e..bce09fe91c795e 100644 --- a/src/coreclr/pal/src/synchmgr/wait.cpp +++ b/src/coreclr/pal/src/synchmgr/wait.cpp @@ -56,7 +56,7 @@ static PalObjectTypeId sg_rgSignalableObjectIds[] = otiNamedMutex, otiSemaphore }; -static CAllowedObjectTypes sg_aotSignalableObject(sg_rgSignalableObjectIds, _countof(sg_rgSignalableObjectIds)); +static CAllowedObjectTypes sg_aotSignalableObject(sg_rgSignalableObjectIds, ARRAY_SIZE(sg_rgSignalableObjectIds)); /*++ Function: diff --git a/src/coreclr/pal/src/synchobj/mutex.cpp b/src/coreclr/pal/src/synchobj/mutex.cpp index 85bf3da1e79a64..267176b15118aa 100644 --- a/src/coreclr/pal/src/synchobj/mutex.cpp +++ b/src/coreclr/pal/src/synchobj/mutex.cpp @@ -3,8 +3,6 @@ /*++ - - Module Name: mutex.ccpp @@ -16,8 +14,6 @@ Module Name: Revision History: - - --*/ #include "pal/dbgmsg.h" @@ -90,7 +86,7 @@ CObjectType CorUnix::otNamedMutex( static CAllowedObjectTypes aotNamedMutex(otiNamedMutex); static PalObjectTypeId anyMutexTypeIds[] = {otiMutex, otiNamedMutex}; -static CAllowedObjectTypes aotAnyMutex(anyMutexTypeIds, _countof(anyMutexTypeIds)); +static CAllowedObjectTypes aotAnyMutex(anyMutexTypeIds, ARRAY_SIZE(anyMutexTypeIds)); /*++ Function: @@ -125,7 +121,7 @@ CreateMutexW( if (lpName != nullptr) { - int bytesWritten = WideCharToMultiByte(CP_ACP, 0, lpName, -1, utf8Name, _countof(utf8Name), nullptr, nullptr); + int bytesWritten = WideCharToMultiByte(CP_ACP, 0, lpName, -1, utf8Name, ARRAY_SIZE(utf8Name), nullptr, nullptr); if (bytesWritten == 0) { DWORD errorCode = GetLastError(); @@ -569,7 +565,7 @@ OpenMutexW( } { - int bytesWritten = WideCharToMultiByte(CP_ACP, 0, lpName, -1, utf8Name, _countof(utf8Name), nullptr, nullptr); + int bytesWritten = WideCharToMultiByte(CP_ACP, 0, lpName, -1, utf8Name, ARRAY_SIZE(utf8Name), nullptr, nullptr); if (bytesWritten == 0) { DWORD errorCode = GetLastError(); diff --git a/src/coreclr/pal/src/thread/process.cpp b/src/coreclr/pal/src/thread/process.cpp index 7fe41410386dd5..f9d591bb849478 100644 --- a/src/coreclr/pal/src/thread/process.cpp +++ b/src/coreclr/pal/src/thread/process.cpp @@ -3,8 +3,6 @@ /*++ - - Module Name: process.cpp @@ -13,8 +11,6 @@ Module Name: Implementation of process object and functions related to processes. - - --*/ #include "pal/dbgmsg.h" @@ -99,7 +95,7 @@ extern "C" if (machret != KERN_SUCCESS) \ { \ char _szError[1024]; \ - snprintf(_szError, _countof(_szError), "%s: %u: %s", __FUNCTION__, __LINE__, _msg); \ + snprintf(_szError, ARRAY_SIZE(_szError), "%s: %u: %s", __FUNCTION__, __LINE__, _msg); \ mach_error(_szError, machret); \ abort(); \ } \ @@ -2993,7 +2989,7 @@ CreateProcessModules( int devHi, devLo, inode; char moduleName[PATH_MAX]; - if (sscanf_s(line, "%p-%p %*[-rwxsp] %p %x:%x %d %s\n", &startAddress, &endAddress, &offset, &devHi, &devLo, &inode, moduleName, _countof(moduleName)) == 7) + if (sscanf_s(line, "%p-%p %*[-rwxsp] %p %x:%x %d %s\n", &startAddress, &endAddress, &offset, &devHi, &devLo, &inode, moduleName, ARRAY_SIZE(moduleName)) == 7) { if (inode != 0) { diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/malloc/test1/test1.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/malloc/test1/test1.cpp index 2f713a0ee96faa..067791fe866dfd 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/malloc/test1/test1.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/malloc/test1/test1.cpp @@ -5,7 +5,7 @@ ** ** Source: test1.c ** -** Purpose: Test that malloc returns useable memory +** Purpose: Test that malloc returns usable memory ** ** **==========================================================================*/ diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/sprintf_s/sprintf_s.h b/src/coreclr/pal/tests/palsuite/c_runtime/sprintf_s/sprintf_s.h index 8cfe4507ac1b87..1feb23ecec935b 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/sprintf_s/sprintf_s.h +++ b/src/coreclr/pal/tests/palsuite/c_runtime/sprintf_s/sprintf_s.h @@ -17,13 +17,13 @@ inline void DoStrTest_sprintf_s(const char *formatstr, char* param, const char * { char buf[256] = { 0 }; - sprintf_s(buf, _countof(buf), formatstr, param); + sprintf_s(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0) { Fail("ERROR: failed to insert string \"%s\" into \"%s\"\n" "Expected \"%s\" got \"%s\".\n", param, formatstr, checkstr, buf); - } + } } #define DoStrTest DoStrTest_sprintf_s @@ -31,22 +31,22 @@ inline void DoWStrTest_sprintf_s(const char *formatstr, WCHAR* param, const char { char buf[256] = { 0 }; - sprintf_s(buf, _countof(buf), formatstr, param); + sprintf_s(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0) { Fail("ERROR: failed to insert wide string \"%s\" into \"%s\"\n" "Expected \"%s\" got \"%s\".\n", convertC(param), formatstr, checkstr, buf); - } + } } #define DoWStrTest DoWStrTest_sprintf_s -inline void DoPointerTest_sprintf_s(const char *formatstr, void* param, char* paramstr, +inline void DoPointerTest_sprintf_s(const char *formatstr, void* param, char* paramstr, const char *checkstr1) { char buf[256] = { 0 }; - sprintf_s(buf, _countof(buf), formatstr, param); + sprintf_s(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0) { Fail("ERROR: failed to insert %s into \"%s\"\n" @@ -60,8 +60,8 @@ inline void DoCountTest_sprintf_s(const char *formatstr, int param, const char * { char buf[512] = { 0 }; int n = -1; - - sprintf_s(buf, _countof(buf), formatstr, &n); + + sprintf_s(buf, ARRAY_SIZE(buf), formatstr, &n); if (n != param) { @@ -80,7 +80,7 @@ inline void DoShortCountTest_sprintf_s(const char *formatstr, int param, const c char buf[256] = { 0 }; short int n = -1; - sprintf_s(buf, _countof(buf), formatstr, &n); + sprintf_s(buf, ARRAY_SIZE(buf), formatstr, &n); if (n != param) { @@ -98,7 +98,7 @@ inline void DoCharTest_sprintf_s(const char *formatstr, char param, const char * { char buf[256] = { 0 }; - sprintf_s(buf, _countof(buf), formatstr, param); + sprintf_s(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0) { Fail("ERROR: failed to insert char \'%c\' (%d) into \"%s\"\n" @@ -112,7 +112,7 @@ inline void DoWCharTest_sprintf_s(const char *formatstr, WCHAR param, const char { char buf[256] = { 0 }; - sprintf_s(buf, _countof(buf), formatstr, param); + sprintf_s(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0) { Fail("ERROR: failed to insert wide char \'%c\' (%d) into \"%s\"\n" @@ -126,7 +126,7 @@ inline void DoNumTest_sprintf_s(const char *formatstr, int value, const char *ch { char buf[256] = { 0 }; - sprintf_s(buf, _countof(buf), formatstr, value); + sprintf_s(buf, ARRAY_SIZE(buf), formatstr, value); if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0) { Fail("ERROR: failed to insert %#x into \"%s\"\n" @@ -140,13 +140,13 @@ inline void DoI64Test_sprintf_s(const char *formatstr, INT64 value, char *values { char buf[256] = { 0 }; - sprintf_s(buf, _countof(buf), formatstr, value); + sprintf_s(buf, ARRAY_SIZE(buf), formatstr, value); if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0) { Fail("ERROR: failed to insert %s into \"%s\"\n" "Expected \"%s\", got \"%s\".\n", valuestr, formatstr, checkstr1, buf); - } + } } #define DoI64Test DoI64Test_sprintf_s @@ -155,12 +155,12 @@ inline void DoDoubleTest_sprintf_s(const char *formatstr, double value, const ch { char buf[256] = { 0 }; - sprintf_s(buf, _countof(buf), formatstr, value); + sprintf_s(buf, ARRAY_SIZE(buf), formatstr, value); if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 && memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0) { Fail("ERROR: failed to insert %f into \"%s\"\n" - "Expected \"%s\" or \"%s\", got \"%s\".\n", + "Expected \"%s\" or \"%s\", got \"%s\".\n", value, formatstr, checkstr1, checkstr2, buf); } } @@ -171,7 +171,7 @@ inline void DoArgumentPrecTest_sprintf_s(const char *formatstr, int precision, v { char buf[256]; - sprintf_s(buf, _countof(buf), formatstr, precision, param); + sprintf_s(buf, ARRAY_SIZE(buf), formatstr, precision, param); if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 && memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0) { @@ -188,7 +188,7 @@ inline void DoArgumentPrecDoubleTest_sprintf_s(const char *formatstr, int precis { char buf[256]; - sprintf_s(buf, _countof(buf), formatstr, precision, param); + sprintf_s(buf, ARRAY_SIZE(buf), formatstr, precision, param); if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 && memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0) { diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/sprintf_s/test1/test1.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/sprintf_s/test1/test1.cpp index 12342858aff78b..6cc7fe46846006 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/sprintf_s/test1/test1.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/sprintf_s/test1/test1.cpp @@ -16,7 +16,7 @@ #include #include "../sprintf_s.h" -/* +/* * Depends on memcmp and strlen */ @@ -31,7 +31,7 @@ PALTEST(c_runtime_sprintf_s_test1_paltest_sprintf_test1, "c_runtime/sprintf_s/te } - sprintf_s(buf, _countof(buf), "hello world"); + sprintf_s(buf, ARRAY_SIZE(buf), "hello world"); if (memcmp(checkstr, buf, strlen(checkstr)+1) != 0) { diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/sscanf_s/sscanf_s.h b/src/coreclr/pal/tests/palsuite/c_runtime/sscanf_s/sscanf_s.h index 8c66c98fcb0c6f..f4422866781c70 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/sscanf_s/sscanf_s.h +++ b/src/coreclr/pal/tests/palsuite/c_runtime/sscanf_s/sscanf_s.h @@ -43,7 +43,7 @@ inline void DoStrTest_scanf_s(char *inputstr, const char *formatstr, const char char buf[256] = { 0 }; int ret; - ret = sscanf_s(inputstr, formatstr, buf, _countof(buf)); + ret = sscanf_s(inputstr, formatstr, buf, ARRAY_SIZE(buf)); if (ret != 1) { Fail("ERROR: Expected sscanf_s to return 1, got %d.\n" @@ -53,7 +53,7 @@ inline void DoStrTest_scanf_s(char *inputstr, const char *formatstr, const char if (memcmp(checkstr, buf, strlen(checkstr) + 1) != 0) { Fail("ERROR: scanned string incorrectly from \"%s\" using \"%s\".\n" - "Expected \"%s\", got \"%s\".\n", inputstr, formatstr, checkstr, + "Expected \"%s\", got \"%s\".\n", inputstr, formatstr, checkstr, buf); } @@ -65,7 +65,7 @@ inline void DoWStrTest_scanf_s(char *inputstr, const char *formatstr, const WCHA WCHAR buf[256] = { 0 }; int ret; - ret = sscanf_s(inputstr, formatstr, buf, _countof(buf)); + ret = sscanf_s(inputstr, formatstr, buf, ARRAY_SIZE(buf)); if (ret != 1) { Fail("ERROR: Expected sscanf_s to return 1, got %d.\n" @@ -75,7 +75,7 @@ inline void DoWStrTest_scanf_s(char *inputstr, const char *formatstr, const WCHA if (memcmp(checkstr, buf, wcslen(checkstr)*2 + 2) != 0) { Fail("ERROR: scanned wide string incorrectly from \"%s\" using \"%s\".\n" - "Expected \"%s\", got \"%s\".\n", inputstr, formatstr, + "Expected \"%s\", got \"%s\".\n", inputstr, formatstr, convertC(checkstr), convertC(buf)); } @@ -138,8 +138,8 @@ inline void DoI64NumTest_scanf_s(char *inputstr, const char *formatstr, INT64 ch if (checknum != num) { - sprintf_s(buf, _countof(buf), "%I64d", num); - sprintf_s(check, _countof(check), "%I64d", checknum); + sprintf_s(buf, ARRAY_SIZE(buf), "%I64d", num); + sprintf_s(check, ARRAY_SIZE(check), "%I64d", checknum); Fail("ERROR: scanned I64 number incorrectly from \"%s\" using \"%s\".\n" "Expected %s, got %s.\n", inputstr, formatstr, check, buf); } @@ -155,7 +155,7 @@ inline void DoCharTest_scanf_s(char *inputstr, const char *formatstr, char* chec for (i=0; i<256; i++) buf[i] = (char)-1; - ret = sscanf_s(inputstr, formatstr, buf, _countof(buf)); + ret = sscanf_s(inputstr, formatstr, buf, ARRAY_SIZE(buf)); if (ret != 1) { Fail("ERROR: Expected sscanf_s to return 1, got %d.\n" @@ -167,14 +167,14 @@ inline void DoCharTest_scanf_s(char *inputstr, const char *formatstr, char* chec buf[numchars] = 0; Fail("ERROR: scanned character(s) incorrectly from \"%s\" using \"%s\".\n" - "Expected %s, got %s.\n", inputstr, formatstr, checkchars, + "Expected %s, got %s.\n", inputstr, formatstr, checkchars, buf); } if (buf[numchars] != (char)-1) { Fail("ERROR: overflow occurred in scanning character(s) from \"%s\" " - "using \"%s\".\nExpected %d character(s)\n", inputstr, formatstr, + "using \"%s\".\nExpected %d character(s)\n", inputstr, formatstr, numchars); } } @@ -189,7 +189,7 @@ inline void DoWCharTest_scanf_s(char *inputstr, const char *formatstr, WCHAR* ch for (i=0; i<256; i++) buf[i] = (WCHAR)-1; - ret = sscanf_s(inputstr, formatstr, buf, _countof(buf)); + ret = sscanf_s(inputstr, formatstr, buf, ARRAY_SIZE(buf)); if (ret != 1) { Fail("ERROR: Expected sscanf_s to return 1, got %d.\n" @@ -201,14 +201,14 @@ inline void DoWCharTest_scanf_s(char *inputstr, const char *formatstr, WCHAR* ch buf[numchars] = 0; Fail("ERROR: scanned wide character(s) incorrectly from \"%s\" using \"%s\".\n" - "Expected %s, got %s.\n", inputstr, formatstr, convertC(checkchars), + "Expected %s, got %s.\n", inputstr, formatstr, convertC(checkchars), convertC(buf)); } if (buf[numchars] != (WCHAR)-1) { Fail("ERROR: overflow occurred in scanning wide character(s) from \"%s\" " - "using \"%s\".\nExpected %d character(s)\n", inputstr, formatstr, + "using \"%s\".\nExpected %d character(s)\n", inputstr, formatstr, numchars); } } @@ -236,7 +236,7 @@ inline void DoFloatTest_scanf_s(char *inputstr, const char *formatstr, float che if (val != checkval) { Fail("ERROR: scanned float incorrectly from \"%s\" using \"%s\".\n" - "Expected \"%f\", got \"%f\".\n", inputstr, formatstr, checkval, + "Expected \"%f\", got \"%f\".\n", inputstr, formatstr, checkval, val); } diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/swprintf/swprintf.h b/src/coreclr/pal/tests/palsuite/c_runtime/swprintf/swprintf.h index 5ca39606e8b2e1..b00ca81d8002c1 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/swprintf/swprintf.h +++ b/src/coreclr/pal/tests/palsuite/c_runtime/swprintf/swprintf.h @@ -17,13 +17,13 @@ inline void DoWStrTest_swprintf_s(const WCHAR *formatstr, WCHAR *param, const WC { WCHAR buf[256] = { 0 }; - swprintf_s(buf, _countof(buf), formatstr, param); + swprintf_s(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr, wcslen(checkstr) * 2 + 2) != 0) { Fail("ERROR: failed to insert wide string \"%s\" into \"%s\".\n" - "Expected \"%s\", got \"%s\".\n", - convertC(param), convertC(formatstr), + "Expected \"%s\", got \"%s\".\n", + convertC(param), convertC(formatstr), convertC(checkstr), convertC(buf)); } } @@ -33,13 +33,13 @@ inline void DoStrTest_swprintf_s(const WCHAR *formatstr, char *param, const WCHA { WCHAR buf[256] = { 0 }; - swprintf_s(buf, _countof(buf), formatstr, param); + swprintf_s(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr, wcslen(checkstr) * 2 + 2) != 0) { Fail("ERROR: failed to insert wide string \"%s\" into \"%s\".\n" - "Expected \"%s\", got \"%s\".\n", - param, convertC(formatstr), convertC(checkstr), + "Expected \"%s\", got \"%s\".\n", + param, convertC(formatstr), convertC(checkstr), convertC(buf)); } } @@ -49,13 +49,13 @@ inline void DoPointerTest_swprintf_s(const WCHAR *formatstr, void* param, const { WCHAR buf[256] = { 0 }; - swprintf_s(buf, _countof(buf), formatstr, param); + swprintf_s(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr1, wcslen(checkstr1)*2 + 2) != 0) { Fail("ERROR: failed to insert pointer to %#p into \"%s\"\n" "Expected \"%s\", got \"%s\".\n", param, convertC(formatstr), convertC(checkstr1), convertC(buf)); - } + } } #define DoPointerTest DoPointerTest_swprintf_s @@ -63,7 +63,7 @@ inline void DoCharTest_swprintf_s(const WCHAR *formatstr, char param, const WCHA { WCHAR buf[256] = { 0 }; - swprintf_s(buf, _countof(buf), formatstr, param); + swprintf_s(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr, wcslen(checkstr)*2 + 2) != 0) { Fail("ERROR: failed to insert char \'%c\' (%d) into \"%s\"\n" @@ -77,7 +77,7 @@ inline void DoWCharTest_swprintf_s(const WCHAR *formatstr, WCHAR param, const WC { WCHAR buf[256] = { 0 }; - swprintf_s(buf, _countof(buf), formatstr, param); + swprintf_s(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr, wcslen(checkstr)*2 + 2) != 0) { Fail("ERROR: failed to insert wide char \'%c\' (%d) into \"%s\"\n" @@ -91,7 +91,7 @@ inline void DoNumTest_swprintf_s(const WCHAR *formatstr, int value, const WCHAR { WCHAR buf[256] = { 0 }; - swprintf_s(buf, _countof(buf), formatstr, value); + swprintf_s(buf, ARRAY_SIZE(buf), formatstr, value); if (memcmp(buf, checkstr, wcslen(checkstr)* 2 + 2) != 0) { Fail("ERROR: failed to insert %#x into \"%s\"\n" @@ -106,7 +106,7 @@ inline void DoI64Test_swprintf_s(const WCHAR *formatstr, INT64 param, char *para { WCHAR buf[256] = { 0 }; - swprintf_s(buf, _countof(buf), formatstr, param); + swprintf_s(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr1, wcslen(checkstr1)*2 + 2) != 0) { Fail("ERROR: failed to insert %s into \"%s\"\n" @@ -121,7 +121,7 @@ inline void DoDoubleTest_swprintf_s(const WCHAR *formatstr, double value, const { WCHAR buf[256] = { 0 }; - swprintf_s(buf, _countof(buf), formatstr, value); + swprintf_s(buf, ARRAY_SIZE(buf), formatstr, value); if (memcmp(buf, checkstr1, wcslen(checkstr1)*2 + 2) != 0 && memcmp(buf, checkstr2, wcslen(checkstr2)*2 + 2) != 0) { @@ -138,7 +138,7 @@ inline void DoArgumentPrecTest_swprintf_s(const WCHAR *formatstr, int precision, { WCHAR buf[256]; - swprintf_s(buf, _countof(buf), formatstr, precision, param); + swprintf_s(buf, ARRAY_SIZE(buf), formatstr, precision, param); if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0 && memcmp(buf, checkstr2, wcslen(checkstr2) + 2) != 0) { @@ -155,7 +155,7 @@ inline void DoArgumentPrecDoubleTest_swprintf_s(const WCHAR *formatstr, int prec { WCHAR buf[256]; - swprintf_s(buf, _countof(buf), formatstr, precision, param); + swprintf_s(buf, ARRAY_SIZE(buf), formatstr, precision, param); if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0 && memcmp(buf, checkstr2, wcslen(checkstr2) + 2) != 0) { diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/swprintf/test1/test1.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/swprintf/test1/test1.cpp index 62ec881dfca328..eb1574bbe2e2f0 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/swprintf/test1/test1.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/swprintf/test1/test1.cpp @@ -30,7 +30,7 @@ PALTEST(c_runtime_swprintf_test1_paltest_swprintf_test1, "c_runtime/swprintf/tes } checkstr = convert("hello world"); - swprintf_s(buf, _countof(buf), convert("hello world")); + swprintf_s(buf, ARRAY_SIZE(buf), convert("hello world")); if (memcmp(checkstr, buf, wcslen(checkstr)*2+2) != 0) { diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/swscanf/swscanf.h b/src/coreclr/pal/tests/palsuite/c_runtime/swscanf/swscanf.h index a5b0228bc01f36..0950263bfae63d 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/swscanf/swscanf.h +++ b/src/coreclr/pal/tests/palsuite/c_runtime/swscanf/swscanf.h @@ -23,7 +23,7 @@ inline void DoVoidTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr) if (ret != 0) { Fail("ERROR: Expected sscanf to return 0, got %d.\n" - "Using \"%s\" in \"%s\".\n", ret, convertC(inputstr), + "Using \"%s\" in \"%s\".\n", ret, convertC(inputstr), convertC(formatstr)); } @@ -32,7 +32,7 @@ inline void DoVoidTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr) if (buf[i] != 0) { Fail("ERROR: Parameter unexpectedly modified scanning \"%s\" " - "using \"%s\".\n", convertC(inputstr), + "using \"%s\".\n", convertC(inputstr), convertC(formatstr)); } } @@ -49,15 +49,15 @@ inline void DoStrTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr, const cha if (ret != 1) { Fail("ERROR: Expected swscanf to return 1, got %d.\n" - "Using \"%s\" in \"%s\".\n", ret, convertC(inputstr), + "Using \"%s\" in \"%s\".\n", ret, convertC(inputstr), convertC(formatstr)); } if (memcmp(checkstr, buf, strlen(checkstr) + 1) != 0) { Fail("ERROR: scanned string incorrectly from \"%s\" using \"%s\".\n" - "Expected \"%s\", got \"%s\".\n", convertC(inputstr), - convertC(formatstr), checkstr, + "Expected \"%s\", got \"%s\".\n", convertC(inputstr), + convertC(formatstr), checkstr, buf); } @@ -80,8 +80,8 @@ inline void DoWStrTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr, const WC if (memcmp(checkstr, buf, wcslen(checkstr)*2 + 2) != 0) { Fail("ERROR: scanned wide string incorrectly from \"%s\" using \"%s\".\n" - "Expected \"%s\", got \"%s\".\n", convertC(inputstr), - convertC(formatstr), convertC(checkstr), + "Expected \"%s\", got \"%s\".\n", convertC(inputstr), + convertC(formatstr), convertC(checkstr), convertC(buf)); } @@ -97,14 +97,14 @@ inline void DoNumTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr, int check if (ret != 1) { Fail("ERROR: Expected swscanf to return 1, got %d.\n" - "Using \"%s\" in \"%s\".\n", ret, convertC(inputstr), + "Using \"%s\" in \"%s\".\n", ret, convertC(inputstr), convertC(formatstr)); } if (checknum != num) { Fail("ERROR: scanned number incorrectly from \"%s\" using \"%s\".\n" - "Expected %d, got %d.\n", convertC(inputstr), + "Expected %d, got %d.\n", convertC(inputstr), convertC(formatstr), checknum, num); } } @@ -119,14 +119,14 @@ inline void DoShortNumTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr, shor if (ret != 1) { Fail("ERROR: Expected swscanf to return 1, got %d.\n" - "Using \"%s\" in \"%s\".\n", ret, convertC(inputstr), + "Using \"%s\" in \"%s\".\n", ret, convertC(inputstr), convertC(formatstr)); } if (checknum != num) { Fail("ERROR: scanned number incorrectly from \"%s\" using \"%s\".\n" - "Expected %hd, got %hd.\n", convertC(inputstr), + "Expected %hd, got %hd.\n", convertC(inputstr), convertC(formatstr), checknum, num); } } @@ -143,16 +143,16 @@ inline void DoI64NumTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr, INT64 if (ret != 1) { Fail("ERROR: Expected swscanf to return 1, got %d.\n" - "Using \"%s\" in \"%s\".\n", ret, convertC(inputstr), + "Using \"%s\" in \"%s\".\n", ret, convertC(inputstr), convertC(formatstr)); } if (checknum != num) { - sprintf_s(buf, _countof(buf), "%I64d", num); - sprintf_s(check, _countof(check), "%I64d", checknum); + sprintf_s(buf, ARRAY_SIZE(buf), "%I64d", num); + sprintf_s(check, ARRAY_SIZE(check), "%I64d", checknum); Fail("ERROR: scanned I64 number incorrectly from \"%s\" using \"%s\".\n" - "Expected %s, got %s.\n", convertC(inputstr), + "Expected %s, got %s.\n", convertC(inputstr), convertC(formatstr), check, buf); } } @@ -171,7 +171,7 @@ inline void DoCharTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr, char* ch if (ret != 1) { Fail("ERROR: Expected swscanf to return 1, got %d.\n" - "Using \"%s\" in \"%s\".\n", ret, convertC(inputstr), + "Using \"%s\" in \"%s\".\n", ret, convertC(inputstr), convertC(formatstr)); } @@ -180,14 +180,14 @@ inline void DoCharTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr, char* ch buf[numchars] = 0; Fail("ERROR: scanned character(s) incorrectly from \"%s\" using \"%s\".\n" - "Expected %s, got %s.\n", convertC(inputstr), + "Expected %s, got %s.\n", convertC(inputstr), convertC(formatstr), checkchars, buf); } if (buf[numchars] != (char)-1) { Fail("ERROR: overflow occurred in scanning character(s) from \"%s\" " - "using \"%s\".\nExpected %d character(s)\n", + "using \"%s\".\nExpected %d character(s)\n", convertC(inputstr), convertC(formatstr), numchars); } } @@ -206,7 +206,7 @@ inline void DoWCharTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr, const W if (ret != 1) { Fail("ERROR: Expected swscanf to return 1, got %d.\n" - "Using \"%s\" in \"%s\".\n", ret, convertC(inputstr), + "Using \"%s\" in \"%s\".\n", ret, convertC(inputstr), convertC(formatstr)); } @@ -215,15 +215,15 @@ inline void DoWCharTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr, const W buf[numchars] = 0; Fail("ERROR: scanned wide character(s) incorrectly from \"%s\" using \"%s\".\n" - "Expected %s, got %s.\n", convertC(inputstr), - convertC(formatstr), convertC(checkchars), + "Expected %s, got %s.\n", convertC(inputstr), + convertC(formatstr), convertC(checkchars), convertC(buf)); } if (buf[numchars] != (WCHAR)-1) { Fail("ERROR: overflow occurred in scanning wide character(s) from \"%s\" " - "using \"%s\".\nExpected %d character(s)\n", + "using \"%s\".\nExpected %d character(s)\n", convertC(inputstr), convertC(formatstr), numchars); } } @@ -245,14 +245,14 @@ inline void DoFloatTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr, float c if (ret != 1) { Fail("ERROR: Expected swscanf to return 1, got %d.\n" - "Using \"%s\" in \"%s\".\n", ret, convertC(inputstr), + "Using \"%s\" in \"%s\".\n", ret, convertC(inputstr), convertC(formatstr)); } if (val != checkval) { Fail("ERROR: scanned float incorrectly from \"%s\" using \"%s\".\n" - "Expected \"%f\", got \"%f\".\n", convertC(inputstr), + "Expected \"%f\", got \"%f\".\n", convertC(inputstr), convertC(formatstr), checkval, val); } diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/vsprintf/test1/test1.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/vsprintf/test1/test1.cpp index 09b0b9f011148c..74e4b0c85083d3 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/vsprintf/test1/test1.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/vsprintf/test1/test1.cpp @@ -22,13 +22,13 @@ PALTEST(c_runtime_vsprintf_test1_paltest_vsprintf_test1, "c_runtime/vsprintf/tes char checkstr[] = "hello world"; char buf[256] = { 0 }; int ret; - + if (PAL_Initialize(argc, argv) != 0) { return(FAIL); } - testvsp(buf, _countof(buf), "hello world"); + testvsp(buf, ARRAY_SIZE(buf), "hello world"); if (memcmp(checkstr, buf, strlen(checkstr)+1) != 0) { @@ -36,8 +36,8 @@ PALTEST(c_runtime_vsprintf_test1_paltest_vsprintf_test1, "c_runtime/vsprintf/tes checkstr, 256, buf); } - testvsp(buf, _countof(buf), "xxxxxxxxxxxxxxxxx"); - ret = testvsp(buf, _countof(buf), "hello world"); + testvsp(buf, ARRAY_SIZE(buf), "xxxxxxxxxxxxxxxxx"); + ret = testvsp(buf, ARRAY_SIZE(buf), "hello world"); if (ret != strlen(checkstr)) { diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/vsprintf/vsprintf.h b/src/coreclr/pal/tests/palsuite/c_runtime/vsprintf/vsprintf.h index 00e459b3db0c79..638f90490b70d4 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/vsprintf/vsprintf.h +++ b/src/coreclr/pal/tests/palsuite/c_runtime/vsprintf/vsprintf.h @@ -29,7 +29,7 @@ inline void DoStrTest_vsprintf(const char *formatstr, char* param, const char *c { char buf[256] = { 0 }; - testvsp(buf, _countof(buf), formatstr, param); + testvsp(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr, strlen(buf) + 1) != 0) { Fail("ERROR: failed to insert string \"%s\" into \"%s\"\n" @@ -43,7 +43,7 @@ inline void DoWStrTest_vsprintf(const char *formatstr, WCHAR* param, const char { char buf[256] = { 0 }; - testvsp(buf, _countof(buf), formatstr, param); + testvsp(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr, strlen(buf) + 1) != 0) { Fail("ERROR: failed to insert wide string \"%s\" into \"%s\"\n" @@ -57,7 +57,7 @@ inline void DoCharTest_vsprintf(const char *formatstr, char param, const char *c { char buf[256] = { 0 }; - testvsp(buf, _countof(buf), formatstr, param); + testvsp(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr, strlen(buf) + 1) != 0) { Fail("ERROR: failed to insert char \'%c\' (%d) into \"%s\"\n" @@ -71,7 +71,7 @@ inline void DoWCharTest_vsprintf(const char *formatstr, WCHAR param, const char { char buf[256] = { 0 }; - testvsp(buf, _countof(buf), formatstr, param); + testvsp(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr, strlen(buf) + 1) != 0) { Fail("ERROR: failed to insert wide char \'%c\' (%d) into \"%s\"\n" @@ -85,7 +85,7 @@ inline void DoNumTest_vsprintf(const char *formatstr, int value, const char *che { char buf[256] = { 0 }; - testvsp(buf, _countof(buf), formatstr, value); + testvsp(buf, ARRAY_SIZE(buf), formatstr, value); if (memcmp(buf, checkstr, strlen(buf) + 1) != 0) { Fail("ERROR: failed to insert %#x into \"%s\"\n" @@ -99,7 +99,7 @@ inline void DoI64Test_vsprintf(const char *formatstr, INT64 value, char *valuest { char buf[256] = { 0 }; - testvsp(buf, _countof(buf), formatstr, value); + testvsp(buf, ARRAY_SIZE(buf), formatstr, value); if (memcmp(buf, checkstr, strlen(buf) + 1) != 0) { Fail("ERROR: failed to insert %s into \"%s\"\n" @@ -114,7 +114,7 @@ inline void DoDoubleTest_vsprintf(const char *formatstr, double value, const cha { char buf[256] = { 0 }; - testvsp(buf, _countof(buf), formatstr, value); + testvsp(buf, ARRAY_SIZE(buf), formatstr, value); if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 && memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0) { @@ -131,7 +131,7 @@ inline void DoArgumentPrecTest_vsprintf(const char *formatstr, int precision, vo { char buf[256]; - testvsp(buf, _countof(buf), formatstr, precision, param); + testvsp(buf, ARRAY_SIZE(buf), formatstr, precision, param); if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 && memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0) { @@ -148,7 +148,7 @@ inline void DoArgumentPrecDoubleTest_vsprintf(const char *formatstr, int precisi { char buf[256]; - testvsp(buf, _countof(buf), formatstr, precision, param); + testvsp(buf, ARRAY_SIZE(buf), formatstr, precision, param); if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 && memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0) { @@ -165,7 +165,7 @@ inline void DoPointerTest_vsprintf(const char *formatstr, void* param, char* par { char buf[256] = { 0 }; - testvsp(buf, _countof(buf), formatstr, param); + testvsp(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr1, strlen(checkstr1) + 1)) { Fail("ERROR: failed to insert %s into \"%s\"\n" @@ -180,7 +180,7 @@ inline void DoI64DoubleTest_vsprintf(const char *formatstr, INT64 value, char *v { char buf[256] = { 0 }; - testvsp(buf, _countof(buf), formatstr, value); + testvsp(buf, ARRAY_SIZE(buf), formatstr, value); if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0) { Fail("ERROR: failed to insert %s into \"%s\"\n" @@ -195,7 +195,7 @@ inline void DoTest_vsprintf(const char *formatstr, int param, const char *checks char buf[256] = { 0 }; int n = -1; - testvsp(buf, _countof(buf), formatstr, &n); + testvsp(buf, ARRAY_SIZE(buf), formatstr, &n); if (n != param) { @@ -214,7 +214,7 @@ inline void DoShortTest_vsprintf(const char *formatstr, int param, const char *c char buf[256] = { 0 }; short int n = -1; - testvsp(buf, _countof(buf), formatstr, &n); + testvsp(buf, ARRAY_SIZE(buf), formatstr, &n); if (n != param) { diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/vswprintf/test1/test1.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/vswprintf/test1/test1.cpp index 954f8f99f13e13..41e59d6b3a56a5 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/vswprintf/test1/test1.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/vswprintf/test1/test1.cpp @@ -25,11 +25,11 @@ PALTEST(c_runtime_vswprintf_test1_paltest_vswprintf_test1, "c_runtime/vswprintf/ return(FAIL); checkstr = convert("hello world"); - testvswp(buf, _countof(buf), checkstr); + testvswp(buf, ARRAY_SIZE(buf), checkstr); if (memcmp(checkstr, buf, wcslen(checkstr)*2+2) != 0) { - Fail("ERROR: Expected \"%s\", got \"%s\"\n", + Fail("ERROR: Expected \"%s\", got \"%s\"\n", convertC(checkstr), convertC(buf)); } diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/vswprintf/test19/test19.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/vswprintf/test19/test19.cpp index 482c442f03a2ce..eed7f216d255bb 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/vswprintf/test19/test19.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/vswprintf/test19/test19.cpp @@ -9,7 +9,7 @@ ** ** **===================================================================*/ - + #include #include "../vswprintf.h" @@ -22,38 +22,38 @@ void DoArgumentPrecTest_vswprintf(WCHAR *formatstr, int precision, void *param, WCHAR *paramstr, WCHAR *checkstr1, WCHAR *checkstr2) { WCHAR buf[256]; - - testvswp(buf, _countof(buf), formatstr, precision, param); + + testvswp(buf, ARRAY_SIZE(buf), formatstr, precision, param); if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0 && memcmp(buf, checkstr2, wcslen(checkstr2) + 2) != 0) { Fail("ERROR: failed to insert %s into \"%s\" with precision %d\n" - "Expected \"%s\" or \"%s\", got \"%s\".\n", + "Expected \"%s\" or \"%s\", got \"%s\".\n", paramstr, convertC(formatstr), precision, convertC(checkstr1), convertC(checkstr2), convertC(buf)); - } + } } void DoArgumentPrecDoubleTest_vswprintf(WCHAR *formatstr, int precision, double param, WCHAR *checkstr1, WCHAR *checkstr2) { WCHAR buf[256]; - testvswp(buf, _countof(buf), formatstr, precision, param); + testvswp(buf, ARRAY_SIZE(buf), formatstr, precision, param); if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0 && memcmp(buf, checkstr2, wcslen(checkstr2) + 2) != 0) { Fail("ERROR: failed to insert %f into \"%s\" with precision %d\n" - "Expected \"%s\" or \"%s\", got \"%s\".\n", + "Expected \"%s\" or \"%s\", got \"%s\".\n", param, convertC(formatstr), precision, convertC(checkstr1), convertC(checkstr2), convertC(buf)); - } + } } /* @@ -66,15 +66,15 @@ PALTEST(c_runtime_vswprintf_test19_paltest_vswprintf_test19, "c_runtime/vswprint if (PAL_Initialize(argc, argv) != 0) return(FAIL); - DoArgumentPrecTest_vswprintf(convert("%.*s"), 2, (void*)convert("bar"), convert("bar"), + DoArgumentPrecTest_vswprintf(convert("%.*s"), 2, (void*)convert("bar"), convert("bar"), convert("ba"), convert("ba")); - DoArgumentPrecTest_vswprintf(convert("%.*c"), 0, (void*)'a', convert("a"), + DoArgumentPrecTest_vswprintf(convert("%.*c"), 0, (void*)'a', convert("a"), convert("a"), convert("a")); - DoArgumentPrecTest_vswprintf(convert("%.*c"), 4, (void*)'a', convert("a"), + DoArgumentPrecTest_vswprintf(convert("%.*c"), 4, (void*)'a', convert("a"), convert("a"), convert("a")); - DoArgumentPrecTest_vswprintf(convert("%.*C"), 0, (void*)'a', convert("a"), + DoArgumentPrecTest_vswprintf(convert("%.*C"), 0, (void*)'a', convert("a"), convert("a"), convert("a")); - DoArgumentPrecTest_vswprintf(convert("%.*C"), 4, (void*)'a', convert("a"), + DoArgumentPrecTest_vswprintf(convert("%.*C"), 4, (void*)'a', convert("a"), convert("a"), convert("a")); DoArgumentPrecTest_vswprintf(convert("%.*d"), 1, (void*)42, convert("42"), convert("42"), convert("42")); @@ -96,9 +96,9 @@ PALTEST(c_runtime_vswprintf_test19_paltest_vswprintf_test19, "c_runtime/vswprint convert("42"), convert("42")); DoArgumentPrecTest_vswprintf(convert("%.*x"), 3, (void*)0x42, convert("0x42"), convert("042"), convert("042")); - DoArgumentPrecTest_vswprintf(convert("%.*X"), 1, (void*)0x42, convert("0x42"), + DoArgumentPrecTest_vswprintf(convert("%.*X"), 1, (void*)0x42, convert("0x42"), convert("42"), convert("42")); - DoArgumentPrecTest_vswprintf(convert("%.*X"), 3, (void*)0x42, convert("0x42"), + DoArgumentPrecTest_vswprintf(convert("%.*X"), 3, (void*)0x42, convert("0x42"), convert("042"), convert("042")); @@ -118,7 +118,7 @@ PALTEST(c_runtime_vswprintf_test19_paltest_vswprintf_test19, "c_runtime/vswprint convert("3e+02")); DoArgumentPrecDoubleTest_vswprintf(convert("%.*g"), 3, 256.01, convert("256"), convert("256")); - DoArgumentPrecDoubleTest_vswprintf(convert("%.*g"), 4, 256.01, convert("256"), + DoArgumentPrecDoubleTest_vswprintf(convert("%.*g"), 4, 256.01, convert("256"), convert("256")); DoArgumentPrecDoubleTest_vswprintf(convert("%.*g"), 6, 256.01, convert("256.01"), convert("256.01")); @@ -126,7 +126,7 @@ PALTEST(c_runtime_vswprintf_test19_paltest_vswprintf_test19, "c_runtime/vswprint convert("3E+02")); DoArgumentPrecDoubleTest_vswprintf(convert("%.*G"), 3, 256.01, convert("256"), convert("256")); - DoArgumentPrecDoubleTest_vswprintf(convert("%.*G"), 4, 256.01, convert("256"), + DoArgumentPrecDoubleTest_vswprintf(convert("%.*G"), 4, 256.01, convert("256"), convert("256")); DoArgumentPrecDoubleTest_vswprintf(convert("%.*G"), 6, 256.01, convert("256.01"), convert("256.01")); diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/vswprintf/test4/test4.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/vswprintf/test4/test4.cpp index 8e72f735224a2d..4d933e1dcfbb37 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/vswprintf/test4/test4.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/vswprintf/test4/test4.cpp @@ -20,25 +20,25 @@ static void DoPointerTest(WCHAR *formatstr, void* param, WCHAR* paramstr, { WCHAR buf[256] = { 0 }; - testvswp(buf, _countof(buf), formatstr, param); + testvswp(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0) { Fail("ERROR: failed to insert pointer to %#p into \"%s\"\n" "Expected \"%s\" got \"%s\".\n", paramstr, - convertC(formatstr), - convertC(checkstr1), + convertC(formatstr), + convertC(checkstr1), convertC(buf)); - } + } } static void DoI64DoubleTest(WCHAR *formatstr, INT64 value, WCHAR *valuestr, WCHAR *checkstr1) { WCHAR buf[256] = { 0 }; - - testvswp(buf, _countof(buf), formatstr, value); + + testvswp(buf, ARRAY_SIZE(buf), formatstr, value); if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0) { Fail("ERROR: failed to insert %s into \"%s\"\n" @@ -54,63 +54,63 @@ PALTEST(c_runtime_vswprintf_test4_paltest_vswprintf_test4, "c_runtime/vswprintf/ { void *ptr = (void*) 0x123456; INT64 lptr = I64(0x1234567887654321); - + if (PAL_Initialize(argc, argv) != 0) return(FAIL); - + /* ** Run only on 64 bit platforms */ #if defined(HOST_64BIT) Trace("Testing for 64 Bit Platforms \n"); DoPointerTest(convert("%p"), NULL, convert("NULL"), convert("0000000000000000")); - DoPointerTest(convert("%p"), ptr, convert("pointer to 0x123456"), + DoPointerTest(convert("%p"), ptr, convert("pointer to 0x123456"), convert("0000000000123456")); - DoPointerTest(convert("%17p"), ptr, convert("pointer to 0x123456"), + DoPointerTest(convert("%17p"), ptr, convert("pointer to 0x123456"), convert(" 0000000000123456")); - DoPointerTest(convert("%17p"), ptr, convert("pointer to 0x123456"), + DoPointerTest(convert("%17p"), ptr, convert("pointer to 0x123456"), convert(" 0000000000123456")); - DoPointerTest(convert("%-17p"), ptr, convert("pointer to 0x123456"), + DoPointerTest(convert("%-17p"), ptr, convert("pointer to 0x123456"), convert("0000000000123456 ")); - DoPointerTest(convert("%+p"), ptr, convert("pointer to 0x123456"), + DoPointerTest(convert("%+p"), ptr, convert("pointer to 0x123456"), convert("0000000000123456")); - DoPointerTest(convert("%#p"), ptr, convert("pointer to 0x123456"), + DoPointerTest(convert("%#p"), ptr, convert("pointer to 0x123456"), convert("0X0000000000123456")); - DoPointerTest(convert("%lp"), ptr, convert("pointer to 0x123456"), + DoPointerTest(convert("%lp"), ptr, convert("pointer to 0x123456"), convert("00123456")); - DoPointerTest(convert("%hp"), ptr, convert("pointer to 0x123456"), + DoPointerTest(convert("%hp"), ptr, convert("pointer to 0x123456"), convert("00003456")); - DoPointerTest(convert("%Lp"), ptr, convert("pointer to 0x123456"), + DoPointerTest(convert("%Lp"), ptr, convert("pointer to 0x123456"), convert("00123456")); - DoI64DoubleTest(convert("%I64p"), lptr, + DoI64DoubleTest(convert("%I64p"), lptr, convert("pointer to 0x1234567887654321"), convert("1234567887654321")); #else Trace("Testing for Non 64 Bit Platforms \n"); DoPointerTest(convert("%p"), NULL, convert("NULL"), convert("00000000")); - DoPointerTest(convert("%p"), ptr, convert("pointer to 0x123456"), + DoPointerTest(convert("%p"), ptr, convert("pointer to 0x123456"), convert("00123456")); - DoPointerTest(convert("%9p"), ptr, convert("pointer to 0x123456"), + DoPointerTest(convert("%9p"), ptr, convert("pointer to 0x123456"), convert(" 00123456")); - DoPointerTest(convert("%09p"), ptr, convert("pointer to 0x123456"), + DoPointerTest(convert("%09p"), ptr, convert("pointer to 0x123456"), convert(" 00123456")); - DoPointerTest(convert("%-9p"), ptr, convert("pointer to 0x123456"), + DoPointerTest(convert("%-9p"), ptr, convert("pointer to 0x123456"), convert("00123456 ")); - DoPointerTest(convert("%+p"), ptr, convert("pointer to 0x123456"), + DoPointerTest(convert("%+p"), ptr, convert("pointer to 0x123456"), convert("00123456")); - DoPointerTest(convert("%#p"), ptr, convert("pointer to 0x123456"), + DoPointerTest(convert("%#p"), ptr, convert("pointer to 0x123456"), convert("0X00123456")); - DoPointerTest(convert("%lp"), ptr, convert("pointer to 0x123456"), + DoPointerTest(convert("%lp"), ptr, convert("pointer to 0x123456"), convert("00123456")); - DoPointerTest(convert("%hp"), ptr, convert("pointer to 0x123456"), + DoPointerTest(convert("%hp"), ptr, convert("pointer to 0x123456"), convert("00003456")); - DoPointerTest(convert("%Lp"), ptr, convert("pointer to 0x123456"), + DoPointerTest(convert("%Lp"), ptr, convert("pointer to 0x123456"), convert("00123456")); - DoI64DoubleTest(convert("%I64p"), lptr, + DoI64DoubleTest(convert("%I64p"), lptr, convert("pointer to 0x1234567887654321"), convert("1234567887654321")); #endif - + PAL_Terminate(); return PASS; } diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h b/src/coreclr/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h index c360c00db4e04d..70cee85e7f6170 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h +++ b/src/coreclr/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h @@ -30,13 +30,13 @@ inline void DoWStrTest_vswprintf_s(const WCHAR *formatstr, WCHAR *param, const W { WCHAR buf[256] = { 0 }; - testvswp(buf, _countof(buf), formatstr, param); + testvswp(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr, wcslen(buf) * 2 + 2) != 0) { Fail("ERROR: failed to insert wide string \"%s\" into \"%s\".\n" - "Expected \"%s\", got \"%s\".\n", - convertC(param), convertC(formatstr), + "Expected \"%s\", got \"%s\".\n", + convertC(param), convertC(formatstr), convertC(checkstr), convertC(buf)); } } @@ -46,13 +46,13 @@ inline void DoStrTest_vswprintf_s(const WCHAR *formatstr, char *param, const WCH { WCHAR buf[256] = { 0 }; - testvswp(buf, _countof(buf), formatstr, param); + testvswp(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr, wcslen(buf) * 2 + 2) != 0) { Fail("ERROR: failed to insert wide string \"%s\" into \"%s\".\n" - "Expected \"%s\", got \"%s\".\n", - param, convertC(formatstr), convertC(checkstr), + "Expected \"%s\", got \"%s\".\n", + param, convertC(formatstr), convertC(checkstr), convertC(buf)); } } @@ -62,14 +62,14 @@ inline void DoCharTest_vswprintf_s(const WCHAR *formatstr, char param, const WCH { WCHAR buf[256] = { 0 }; - testvswp(buf, _countof(buf), formatstr, param); + testvswp(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr, wcslen(buf)*2 + 2) != 0) { Fail("ERROR: failed to insert char \'%c\' (%d) into \"%s\"\n" - "Expected \"%s\" got \"%s\".\n", - param, param, convertC(formatstr), convertC(checkstr), + "Expected \"%s\" got \"%s\".\n", + param, param, convertC(formatstr), convertC(checkstr), convertC(buf)); - } + } } #define DoCharTest DoCharTest_vswprintf_s @@ -77,14 +77,14 @@ inline void DoWCharTest_vswprintf_s(const WCHAR *formatstr, WCHAR param, const W { WCHAR buf[256] = { 0 }; - testvswp(buf, _countof(buf), formatstr, param); + testvswp(buf, ARRAY_SIZE(buf), formatstr, param); if (memcmp(buf, checkstr, wcslen(buf)*2 + 2) != 0) { Fail("ERROR: failed to insert wide char \'%c\' (%d) into \"%s\"\n" - "Expected \"%s\" got \"%s\".\n", - (char) param, param, convertC(formatstr), convertC(checkstr), + "Expected \"%s\" got \"%s\".\n", + (char) param, param, convertC(formatstr), convertC(checkstr), convertC(buf)); - } + } } #define DoWCharTest DoWCharTest_vswprintf_s @@ -92,13 +92,13 @@ inline void DoNumTest_vswprintf_s(const WCHAR *formatstr, int value, const WCHAR { WCHAR buf[256] = { 0 }; - testvswp(buf, _countof(buf), formatstr, value); + testvswp(buf, ARRAY_SIZE(buf), formatstr, value); if (memcmp(buf, checkstr, wcslen(buf)* 2 + 2) != 0) { Fail("ERROR: failed to insert %#x into \"%s\"\n" - "Expected \"%s\" got \"%s\".\n", value, convertC(formatstr), + "Expected \"%s\" got \"%s\".\n", value, convertC(formatstr), convertC(checkstr), convertC(buf)); - } + } } #define DoNumTest DoNumTest_vswprintf_s @@ -106,13 +106,13 @@ inline void DoI64NumTest_vswprintf_s(const WCHAR *formatstr, INT64 value, char * { WCHAR buf[256] = { 0 }; - testvswp(buf, _countof(buf), formatstr, value); + testvswp(buf, ARRAY_SIZE(buf), formatstr, value); if (memcmp(buf, checkstr, wcslen(buf)* 2 + 2) != 0) { Fail("ERROR: failed to insert %s into \"%s\"\n" - "Expected \"%s\" got \"%s\".\n", valuestr, convertC(formatstr), + "Expected \"%s\" got \"%s\".\n", valuestr, convertC(formatstr), convertC(checkstr), convertC(buf)); - } + } } #define DoI64NumTest DoI64NumTest_vswprintf_s @@ -121,7 +121,7 @@ inline void DoDoubleTest_vswprintf_s(const WCHAR *formatstr, double value, const { WCHAR buf[256] = { 0 }; - testvswp(buf, _countof(buf), formatstr, value); + testvswp(buf, ARRAY_SIZE(buf), formatstr, value); if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0 && memcmp(buf, checkstr2, wcslen(checkstr2) + 2) != 0) { diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/wcscat/test1/test1.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/wcscat/test1/test1.cpp index da8f581554b5d5..d60d483ac50b86 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/wcscat/test1/test1.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/wcscat/test1/test1.cpp @@ -5,8 +5,8 @@ ** ** Source: test1.c ** -** Purpose: -** Test to that wcscat correctly concatanates wide strings, including placing +** Purpose: +** Test to that wcscat correctly concatanates wide strings, including placing ** null pointers. ** ** @@ -30,7 +30,7 @@ PALTEST(c_runtime_wcscat_test1_paltest_wcscat_test1, "c_runtime/wcscat/test1/pal WCHAR *ptr; char buffer[256]; - + if (PAL_Initialize(argc, argv)) { return FAIL; @@ -59,8 +59,8 @@ PALTEST(c_runtime_wcscat_test1_paltest_wcscat_test1, "c_runtime/wcscat/test1/pal if (memcmp(dest, test, sizeof(test)) != 0) { - sprintf_s(buffer, _countof(buffer), "%S", dest); - Fail("ERROR: Expected wcscat to give \"%s\", got \"%s\"\n", + sprintf_s(buffer, ARRAY_SIZE(buffer), "%S", dest); + Fail("ERROR: Expected wcscat to give \"%s\", got \"%s\"\n", "foo bar baz", buffer); } diff --git a/src/coreclr/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.cpp b/src/coreclr/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.cpp index 2c0c9afa8749cf..ba8336fa423013 100644 --- a/src/coreclr/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.cpp +++ b/src/coreclr/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.cpp @@ -25,7 +25,7 @@ PALTEST(c_runtime_wcscpy_test1_paltest_wcscpy_test1, "c_runtime/wcscpy/test1/pal WCHAR *ret; char buffer[256]; - + if (PAL_Initialize(argc, argv)) { return FAIL; @@ -33,10 +33,10 @@ PALTEST(c_runtime_wcscpy_test1_paltest_wcscpy_test1, "c_runtime/wcscpy/test1/pal ret = wcscpy(dest, str); - + if (ret != dest || memcmp(dest, result, sizeof(result)) != 0) { - sprintf_s(buffer, _countof(buffer), "%S", dest); + sprintf_s(buffer, ARRAY_SIZE(buffer), "%S", dest); Fail("Expected wcscpy to give \"%s\" with a return value of %p, got \"%s\" " "with a return value of %p.\n", "foo", dest, buffer, ret); } diff --git a/src/coreclr/pal/tests/palsuite/common/palsuite.h b/src/coreclr/pal/tests/palsuite/common/palsuite.h index d5e5a921ef1453..57a56772065be0 100644 --- a/src/coreclr/pal/tests/palsuite/common/palsuite.h +++ b/src/coreclr/pal/tests/palsuite/common/palsuite.h @@ -23,6 +23,7 @@ typedef unsigned short char16_t; #include #include #include +#include #define PALTEST(testfunc, testname) \ int __cdecl testfunc(int argc, char* argv[]); \ @@ -38,7 +39,7 @@ enum inline void Trace(const char *format, ...) { va_list arglist; - + va_start(arglist, format); vprintf(format, arglist); @@ -49,10 +50,10 @@ inline void Trace(const char *format, ...) inline void Fail(const char *format, ...) { va_list arglist; - + va_start(arglist, format); - vprintf(format, arglist); + vprintf(format, arglist); va_end(arglist); printf("\n"); @@ -102,7 +103,7 @@ int __cdecl main(int argc, char **argv) // time between PAL_Initialize and PAL_Terminate. However, getenv in PAL // can be run only after PAL_Initialize. szPerfLoopEnv = getenv(PALTEST_LOOP_ENV); - if (szPerfLoopEnv != NULL) + if (szPerfLoopEnv != NULL) { loopCount = atoi(szPerfLoopEnv); if (loopCount <= 0) loopCount = 1; @@ -146,9 +147,9 @@ void Bogus_PAL_Terminate() #ifdef BIGENDIAN inline ULONG VAL32(ULONG x) { - return( ((x & 0xFF000000L) >> 24) | - ((x & 0x00FF0000L) >> 8) | - ((x & 0x0000FF00L) << 8) | + return( ((x & 0xFF000000L) >> 24) | + ((x & 0x00FF0000L) >> 8) | + ((x & 0x0000FF00L) << 8) | ((x & 0x000000FFL) << 24) ); } #define th_htons(w) (w) @@ -157,15 +158,12 @@ inline ULONG VAL32(ULONG x) #define th_htons(w) (((w) >> 8) | ((w) << 8)) #endif // BIGENDIAN -#define _countof(_array) (sizeof(_array)/sizeof(_array[0])) - WCHAR* convert(const char * aString); char* convertC(const WCHAR * wString); UINT64 GetHighPrecisionTimeStamp(LARGE_INTEGER performanceFrequency); extern const char* szTextFile; - int mkAbsoluteFilename( LPSTR dirName, DWORD dwDirLength, @@ -177,10 +175,10 @@ BOOL CleanupHelper (HANDLE *hArray, DWORD dwIndex); BOOL Cleanup(HANDLE *hArray, DWORD dwIndex); -/* +/* * Tokens 0 and 1 are events. Token 2 is the thread. */ -#define NUM_TOKENS 3 +#define NUM_TOKENS 3 extern HANDLE hToken[NUM_TOKENS]; extern CRITICAL_SECTION CriticalSection; @@ -194,11 +192,11 @@ extern CRITICAL_SECTION CriticalSection; * Returns: The number of wide characters in the resulting string. * 0 is returned on Error. */ -int -mkAbsoluteFilenameW ( - LPWSTR dirName, - DWORD dwDirLength, - LPCWSTR fileName, +int +mkAbsoluteFilenameW ( + LPWSTR dirName, + DWORD dwDirLength, + LPCWSTR fileName, DWORD dwFileLength, LPWSTR absPathName ); @@ -211,11 +209,11 @@ mkAbsoluteFilenameW ( * Returns: The number of wide characters in the resulting string. * 0 is returned on Error. */ -int -mkAbsoluteFilenameA ( - LPSTR dirName, - DWORD dwDirLength, - LPCSTR fileName, +int +mkAbsoluteFilenameA ( + LPSTR dirName, + DWORD dwDirLength, + LPCSTR fileName, DWORD dwFileLength, LPSTR absPathName ); diff --git a/src/coreclr/pal/tests/palsuite/composite/synchronization/criticalsection/readme.txt b/src/coreclr/pal/tests/palsuite/composite/synchronization/criticalsection/readme.txt index af6ef5d230bdc7..974497cfaff94e 100644 --- a/src/coreclr/pal/tests/palsuite/composite/synchronization/criticalsection/readme.txt +++ b/src/coreclr/pal/tests/palsuite/composite/synchronization/criticalsection/readme.txt @@ -1,11 +1,11 @@ -To compile: +To compile: 1) create a dat file (say criticalsection.dat) with contents: -PAL,Composite,palsuite\composite\syncronization\criticalsection,criticalsection=mainWrapper.c,criticalsection.c,,, +PAL,Composite,palsuite\composite\synchronization\criticalsection,criticalsection=mainWrapper.c,criticalsection.c,,, 2) perl rrunmod.pl -r criticalsection.dat To execute: -mainwrapper [PROCESS_COUNT] [WORKER_THREAD_MULTIPLIER_COUNT] [REPEAT_COUNT] +mainwrapper [PROCESS_COUNT] [WORKER_THREAD_MULTIPLIER_COUNT] [REPEAT_COUNT] diff --git a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp b/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp index 41f4f825ca2508..f64291b7ec8584 100644 --- a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp +++ b/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp @@ -5,9 +5,9 @@ ** ** Source: test1.c ** -** Purpose: Create a child process and some events for communications with it. +** Purpose: Create a child process and some events for communications with it. ** When the child gets back to us with a memory location and a length, -** Call WriteProcessMemory on this location and check to see that it +** Call WriteProcessMemory on this location and check to see that it ** writes successfully. ** ** @@ -27,7 +27,7 @@ PALTEST(debug_api_WriteProcessMemory_test1_paltest_writeprocessmemory_test1, "de HANDLE hEvToHelper; HANDLE hEvFromHelper; DWORD dwExitCode; - + DWORD dwRet; char cmdComposeBuf[MAX_PATH]; @@ -40,33 +40,33 @@ PALTEST(debug_api_WriteProcessMemory_test1_paltest_writeprocessmemory_test1, "de /* Create the signals we need for cross process communication */ hEvToHelper = CreateEvent(NULL, TRUE, FALSE, szcToHelperEvName); - if (!hEvToHelper) + if (!hEvToHelper) { Fail("WriteProcessMemory: CreateEvent of '%S' failed. " - "GetLastError() returned %d.\n", szcToHelperEvName, + "GetLastError() returned %d.\n", szcToHelperEvName, GetLastError()); } - if (GetLastError() == ERROR_ALREADY_EXISTS) + if (GetLastError() == ERROR_ALREADY_EXISTS) { Fail("WriteProcessMemory: CreateEvent of '%S' failed. " "(already exists!)\n", szcToHelperEvName); } hEvFromHelper = CreateEvent(NULL, TRUE, FALSE, szcFromHelperEvName); - if (!hEvToHelper) + if (!hEvToHelper) { Fail("WriteProcessMemory: CreateEvent of '%S' failed. " - "GetLastError() returned %d.\n", szcFromHelperEvName, + "GetLastError() returned %d.\n", szcFromHelperEvName, GetLastError()); } - if (GetLastError() == ERROR_ALREADY_EXISTS) + if (GetLastError() == ERROR_ALREADY_EXISTS) { Fail("WriteProcessMemory: CreateEvent of '%S' failed. " "(already exists!)\n", szcFromHelperEvName); } ResetEvent(hEvFromHelper); ResetEvent(hEvToHelper); - - if (!sprintf_s(cmdComposeBuf, _countof(cmdComposeBuf), "helper %s", commsFileName)) + + if (!sprintf_s(cmdComposeBuf, ARRAY_SIZE(cmdComposeBuf), "helper %s", commsFileName)) { Fail("Could not convert command line\n"); } @@ -75,11 +75,11 @@ PALTEST(debug_api_WriteProcessMemory_test1_paltest_writeprocessmemory_test1, "de ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); - + /* Create a new process. This is the process that will ask for * memory munging */ - if(!CreateProcess( NULL, uniString, NULL, NULL, - FALSE, 0, NULL, NULL, &si, &pi)) + if(!CreateProcess( NULL, uniString, NULL, NULL, + FALSE, 0, NULL, NULL, &si, &pi)) { Trace("ERROR: CreateProcess failed to load executable '%S'. " "GetLastError() returned %u.\n", @@ -89,7 +89,7 @@ PALTEST(debug_api_WriteProcessMemory_test1_paltest_writeprocessmemory_test1, "de } free(uniString); - while(1) + while(1) { FILE *commsFile; char* pSrcMemory; @@ -122,9 +122,9 @@ PALTEST(debug_api_WriteProcessMemory_test1_paltest_writeprocessmemory_test1, "de } PEDANTIC1(fclose,(commsFile)); sscanf(incomingCMDBuffer, "%u %u", &pDestMemory, &Count); - if (argc > 1) + if (argc > 1) { - Trace("Preparing to write to %u bytes @ %u ('%s')\n", + Trace("Preparing to write to %u bytes @ %u ('%s')\n", Count, pDestMemory, incomingCMDBuffer); } @@ -139,32 +139,32 @@ PALTEST(debug_api_WriteProcessMemory_test1_paltest_writeprocessmemory_test1, "de memset(pSrcMemory, nextValue, Count); /* do the work */ - dwRet = WriteProcessMemory(pi.hProcess, + dwRet = WriteProcessMemory(pi.hProcess, pDestMemory, pSrcMemory, Count, &wpmCount); if (!dwRet) { - Trace("%s: Problem: on a write to %u bytes @ %u ('%s')\n", + Trace("%s: Problem: on a write to %u bytes @ %u ('%s')\n", argv[0], Count, pDestMemory, incomingCMDBuffer); - Trace("test1 WriteProcessMemory returned a%u(!=0) (GLE=%u)\n", + Trace("test1 WriteProcessMemory returned a%u(!=0) (GLE=%u)\n", GetLastError()); } if(Count != wpmCount) { - Trace("%s: Problem: on a write to %u bytes @ %u ('%s')\n", + Trace("%s: Problem: on a write to %u bytes @ %u ('%s')\n", argv[0], Count, pDestMemory, incomingCMDBuffer); Trace("The number of bytes written should have been " "%u, but was reported as %u.\n", Count, wpmCount); } free(pSrcMemory); - doneIteration: + doneIteration: PEDANTIC(ResetEvent, (hEvFromHelper)); PEDANTIC(SetEvent, (hEvToHelper)); } - + /* wait for the child process to complete */ WaitForSingleObject ( pi.hProcess, TIMEOUT ); /* this may return a failure code on a success path */ @@ -172,8 +172,8 @@ PALTEST(debug_api_WriteProcessMemory_test1_paltest_writeprocessmemory_test1, "de /* check the exit code from the process */ if( ! GetExitCodeProcess( pi.hProcess, &dwExitCode ) ) { - Trace( "GetExitCodeProcess call failed with error code %u\n", - GetLastError() ); + Trace( "GetExitCodeProcess call failed with error code %u\n", + GetLastError() ); dwExitCode = FAIL; } diff --git a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp b/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp index 196efb1b2abfe1..1d6cb240dfda90 100644 --- a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp +++ b/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp @@ -7,8 +7,8 @@ ** ** Purpose: Create a child process and debug it. When the child ** raises an exception, it sends back a memory location. Call -** WriteProcessMemory on the memory location, but attempt to write -** more than the memory allows. This should cause an error and the +** WriteProcessMemory on the memory location, but attempt to write +** more than the memory allows. This should cause an error and the ** data should be unchanged. ** ** @@ -28,7 +28,7 @@ PALTEST(debug_api_WriteProcessMemory_test3_paltest_writeprocessmemory_test3, "de HANDLE hEvToHelper; HANDLE hEvFromHelper; DWORD dwExitCode; - + DWORD dwRet; BOOL success = TRUE; /* assume success */ @@ -42,31 +42,31 @@ PALTEST(debug_api_WriteProcessMemory_test3_paltest_writeprocessmemory_test3, "de /* Create the signals we need for cross process communication */ hEvToHelper = CreateEvent(NULL, TRUE, FALSE, szcToHelperEvName); - if (!hEvToHelper) + if (!hEvToHelper) { Fail("WriteProcessMemory: CreateEvent of '%S' failed. " - "GetLastError() returned %u.\n", szcToHelperEvName, + "GetLastError() returned %u.\n", szcToHelperEvName, GetLastError()); } - if (GetLastError() == ERROR_ALREADY_EXISTS) + if (GetLastError() == ERROR_ALREADY_EXISTS) { Fail("WriteProcessMemory: CreateEvent of '%S' failed. " "(already exists!)\n", szcToHelperEvName); } hEvFromHelper = CreateEvent(NULL, TRUE, FALSE, szcFromHelperEvName); - if (!hEvToHelper) + if (!hEvToHelper) { Fail("WriteProcessMemory: CreateEvent of '%S' failed. " - "GetLastError() returned %u.\n", szcFromHelperEvName, + "GetLastError() returned %u.\n", szcFromHelperEvName, GetLastError()); } - if (GetLastError() == ERROR_ALREADY_EXISTS) + if (GetLastError() == ERROR_ALREADY_EXISTS) { Fail("WriteProcessMemory: CreateEvent of '%S' failed. " "(already exists!)\n", szcFromHelperEvName); } - - if (!sprintf_s(cmdComposeBuf, _countof(cmdComposeBuf), "helper %s", commsFileName)) + + if (!sprintf_s(cmdComposeBuf, ARRAY_SIZE(cmdComposeBuf), "helper %s", commsFileName)) { Fail("Could not convert command line\n"); } @@ -75,11 +75,11 @@ PALTEST(debug_api_WriteProcessMemory_test3_paltest_writeprocessmemory_test3, "de ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); - + /* Create a new process. This is the process that will ask for * memory munging */ - if(!CreateProcess( NULL, uniString, NULL, NULL, - FALSE, 0, NULL, NULL, &si, &pi)) + if(!CreateProcess( NULL, uniString, NULL, NULL, + FALSE, 0, NULL, NULL, &si, &pi)) { Trace("ERROR: CreateProcess failed to load executable '%S'. " "GetLastError() returned %u.\n", @@ -127,11 +127,11 @@ PALTEST(debug_api_WriteProcessMemory_test3_paltest_writeprocessmemory_test3, "de goto doneIteration; } PEDANTIC1(fclose,(commsFile)); - sscanf(incomingCMDBuffer, "%u %u %u", + sscanf(incomingCMDBuffer, "%u %u %u", &pDestMemory, &Count, &dwExpectedErrorCode); - if (argc > 1) + if (argc > 1) { - Trace("Preparing to write to %u bytes @ %u ('%s')\n", + Trace("Preparing to write to %u bytes @ %u ('%s')\n", Count, pDestMemory, incomingCMDBuffer); } @@ -147,12 +147,12 @@ PALTEST(debug_api_WriteProcessMemory_test3_paltest_writeprocessmemory_test3, "de memset(pSrcMemory, nextValue, Count); /* do the work */ - dwRet = WriteProcessMemory(pi.hProcess, + dwRet = WriteProcessMemory(pi.hProcess, pDestMemory, pSrcMemory, Count, &wpmCount); - + if(dwRet != 0) { Trace("ERROR: Situation: '%s', return code: %u, bytes 'written': %u\n", @@ -162,7 +162,7 @@ PALTEST(debug_api_WriteProcessMemory_test3_paltest_writeprocessmemory_test3, "de "not completely accessible.\n"); success = FALSE; } - + if(GetLastError() != dwExpectedErrorCode) { Trace("ERROR: GetLastError() should have returned " @@ -172,12 +172,12 @@ PALTEST(debug_api_WriteProcessMemory_test3_paltest_writeprocessmemory_test3, "de } free(pSrcMemory); - doneIteration: + doneIteration: PEDANTIC(ResetEvent, (hEvFromHelper)); PEDANTIC(SetEvent, (hEvToHelper)); } - + /* wait for the child process to complete */ WaitForSingleObject ( pi.hProcess, TIMEOUT ); /* this may return a failure code on a success path */ @@ -185,8 +185,8 @@ PALTEST(debug_api_WriteProcessMemory_test3_paltest_writeprocessmemory_test3, "de /* check the exit code from the process */ if( ! GetExitCodeProcess( pi.hProcess, &dwExitCode ) ) { - Trace( "GetExitCodeProcess call failed with error code %u\n", - GetLastError() ); + Trace( "GetExitCodeProcess call failed with error code %u\n", + GetLastError() ); dwExitCode = FAIL; } if(!success) diff --git a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/test4.cpp b/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/test4.cpp index 577869b78717ee..255d96c832bfec 100644 --- a/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/test4.cpp +++ b/src/coreclr/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/test4.cpp @@ -18,11 +18,11 @@ const int MY_EXCEPTION=999; PALTEST(debug_api_WriteProcessMemory_test4_paltest_writeprocessmemory_test4, "debug_api/WriteProcessMemory/test4/paltest_writeprocessmemory_test4") { - + PROCESS_INFORMATION pi; STARTUPINFO si; DEBUG_EVENT DebugEv; - DWORD dwContinueStatus = DBG_CONTINUE; + DWORD dwContinueStatus = DBG_CONTINUE; int Count, ret; char* DataBuffer[4096]; char* Memory; @@ -31,22 +31,22 @@ PALTEST(debug_api_WriteProcessMemory_test4_paltest_writeprocessmemory_test4, "de { return FAIL; } - + ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); - + memset(DataBuffer, 'z', 4096); /* Create a new process. This is the process to be Debugged */ - if(!CreateProcess( NULL, "helper", NULL, NULL, - FALSE, 0, NULL, NULL, &si, &pi)) + if(!CreateProcess( NULL, "helper", NULL, NULL, + FALSE, 0, NULL, NULL, &si, &pi)) { Fail("ERROR: CreateProcess failed to load executable 'helper'. " "GetLastError() returned %d.\n",GetLastError()); } - /* Call DebugActiveProcess, because the process wasn't created as a + /* Call DebugActiveProcess, because the process wasn't created as a debug process. */ if(DebugActiveProcess(pi.dwProcessId) == 0) @@ -56,11 +56,11 @@ PALTEST(debug_api_WriteProcessMemory_test4_paltest_writeprocessmemory_test4, "de GetLastError()); } - + /* Call WaitForDebugEvent, which will wait until the helper process raises an exception. */ - + while(1) { if(WaitForDebugEvent(&DebugEv, INFINITE) == 0) @@ -68,53 +68,53 @@ PALTEST(debug_api_WriteProcessMemory_test4_paltest_writeprocessmemory_test4, "de Fail("ERROR: WaitForDebugEvent returned 0, indicating failure. " "GetLastError() returned %d.\n",GetLastError()); } - + /* We're waiting for the helper process to send this exception. When it does, we call WriteProcess. If it gets called more than once, it is ignored. */ - + if(DebugEv.u.Exception.ExceptionRecord.ExceptionCode == MY_EXCEPTION) { Memory = (LPVOID) DebugEv.u.Exception.ExceptionRecord.ExceptionInformation[0]; - + /* Write to this memory which we have no access to. */ - ret = WriteProcessMemory(pi.hProcess, + ret = WriteProcessMemory(pi.hProcess, Memory, DataBuffer, 4096, &Count); - + if(ret != 0) { Fail("ERROR: WriteProcessMemory should have failed, as " "it attempted to write to a range of memory which was " "not accessible.\n"); } - + if(GetLastError() != ERROR_NOACCESS) { Fail("ERROR: GetLastError() should have returned " - "ERROR_NOACCESS , but intead it returned " + "ERROR_NOACCESS , but instead it returned " "%d.\n",GetLastError()); } } - + if(DebugEv.dwDebugEventCode == EXIT_PROCESS_DEBUG_EVENT) { break; } - - if(ContinueDebugEvent(DebugEv.dwProcessId, + + if(ContinueDebugEvent(DebugEv.dwProcessId, DebugEv.dwThreadId, dwContinueStatus) == 0) { Fail("ERROR: ContinueDebugEvent failed to continue the thread " "which had a debug event. GetLastError() returned %d.\n", GetLastError()); - } + } } diff --git a/src/coreclr/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.cpp b/src/coreclr/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.cpp index 06af62f9f3a29d..6723f19db31621 100644 --- a/src/coreclr/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.cpp +++ b/src/coreclr/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.cpp @@ -20,7 +20,7 @@ BOOL Cleanup_CreateFileA_test1(void) // loop through all accesses, modes, dispositions and flags for (i=0; i<4*8*4*5; ++i) { - sprintf_s(FileName, _countof(FileName), "test%03d.txt", i); + sprintf_s(FileName, ARRAY_SIZE(FileName), "test%03d.txt", i); if (DeleteFileA(FileName) == FALSE) { if (GetLastError() != ERROR_FILE_NOT_FOUND) { bRet = FALSE; @@ -97,7 +97,7 @@ PALTEST(file_io_CreateFileA_test1_paltest_createfilea_test1, "file_io/CreateFile // creation disp loop for (l = 0; l < 5; l++) { - sprintf_s(lpFileName, _countof(lpFileName), "test%03d.txt", nCounter); + sprintf_s(lpFileName, ARRAY_SIZE(lpFileName), "test%03d.txt", nCounter); hFile = CreateFile(lpFileName, dwDesiredAccess[i], dwShareMode[j], diff --git a/src/coreclr/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.cpp b/src/coreclr/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.cpp index 38d7f5fc9c5664..f256a84c56c8a0 100644 --- a/src/coreclr/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.cpp +++ b/src/coreclr/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.cpp @@ -20,7 +20,7 @@ BOOL Cleanup_CreateFileW_test1(void) // loop through all accesses, modes, dispositions and flags for (i=0; i<4*8*4*5; ++i) { - sprintf_s(FileName, _countof(FileName), "test%03d.txt", i); + sprintf_s(FileName, ARRAY_SIZE(FileName), "test%03d.txt", i); if (DeleteFileA(FileName) == FALSE) { if (GetLastError() != ERROR_FILE_NOT_FOUND) { bRet = FALSE; @@ -98,7 +98,7 @@ PALTEST(file_io_CreateFileW_test1_paltest_createfilew_test1, "file_io/CreateFile // creation disp loop for (l = 0; l < 5; l++) { - sprintf_s(string, _countof(string), "test%03d.txt", nCounter); + sprintf_s(string, ARRAY_SIZE(string), "test%03d.txt", nCounter); lpFileName = convert(string); hFile = CreateFileW(lpFileName, dwDesiredAccess[i], diff --git a/src/coreclr/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.cpp b/src/coreclr/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.cpp index e93d2d9840cbd2..96d45cd90ccfab 100644 --- a/src/coreclr/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.cpp +++ b/src/coreclr/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.cpp @@ -46,7 +46,7 @@ PALTEST(file_io_GetTempFileNameA_test1_paltest_gettempfilenamea_test1, "file_io/ if (GetFileAttributesA(szReturnedName) == -1) { Fail("GetTempFileNameA: ERROR -> GetFileAttributes failed on the " - "returned temp file \"%s\" with error code: %ld.\n", + "returned temp file \"%s\" with error code: %ld.\n", szReturnedName, GetLastError()); } @@ -71,14 +71,14 @@ PALTEST(file_io_GetTempFileNameA_test1_paltest_gettempfilenamea_test1, "file_io/ if (GetFileAttributesA(szReturnedName) == -1) { Fail("GetTempFileNameA: ERROR -> GetFileAttributes failed on the " - "returned temp file \"%s\" with error code: %ld.\n", + "returned temp file \"%s\" with error code: %ld.\n", szReturnedName, GetLastError()); } if (DeleteFileA(szReturnedName) != TRUE) { Fail("GetTempFileNameA: ERROR -> DeleteFileW failed to delete" - "the created temp \"%s\" file with error code: %ld.\n", + "the created temp \"%s\" file with error code: %ld.\n", szReturnedName, GetLastError()); } @@ -97,13 +97,13 @@ PALTEST(file_io_GetTempFileNameA_test1_paltest_gettempfilenamea_test1, "file_io/ if (GetFileAttributesA(szReturnedName) == -1) { Fail("GetTempFileNameA: ERROR -> GetFileAttributes failed on the " - "returned temp file \"%s\" with error code: %ld.\n", + "returned temp file \"%s\" with error code: %ld.\n", szReturnedName, GetLastError()); } /* now verify that it only used the first 3 characters of the prefix */ - sprintf_s(szTempString, _countof(szTempString), "%s\\%s", szDot, szLongValidPrefix); + sprintf_s(szTempString, ARRAY_SIZE(szTempString), "%s\\%s", szDot, szLongValidPrefix); if (strncmp(szTempString, szReturnedName, 6) == 0) { Fail("GetTempFileNameA: ERROR -> It appears that an improper prefix " @@ -113,7 +113,7 @@ PALTEST(file_io_GetTempFileNameA_test1_paltest_gettempfilenamea_test1, "file_io/ if (DeleteFileA(szReturnedName) != TRUE) { Fail("GetTempFileNameA: ERROR -> DeleteFileW failed to delete" - "the created temp file \"%s\" with error code: %ld.\n", + "the created temp file \"%s\" with error code: %ld.\n", szReturnedName, GetLastError()); } diff --git a/src/coreclr/pal/tests/palsuite/file_io/GetTempFileNameW/test1/GetTempFileNameW.cpp b/src/coreclr/pal/tests/palsuite/file_io/GetTempFileNameW/test1/GetTempFileNameW.cpp index 0d6371cd859740..5653609154ecc6 100644 --- a/src/coreclr/pal/tests/palsuite/file_io/GetTempFileNameW/test1/GetTempFileNameW.cpp +++ b/src/coreclr/pal/tests/palsuite/file_io/GetTempFileNameW/test1/GetTempFileNameW.cpp @@ -103,7 +103,7 @@ PALTEST(file_io_GetTempFileNameW_test1_paltest_gettempfilenamew_test1, "file_io/ } // now verify that it only used the first 3 characters of the prefix - swprintf_s(wTempString, _countof(wTempString), convert("%s\\%s"), wPath, wPrefix); + swprintf_s(wTempString, ARRAY_SIZE(wTempString), convert("%s\\%s"), wPath, wPrefix); if (memcmp(wTempString, wReturnedName, wcslen(wTempString)*sizeof(WCHAR)) == 0) { free (wPath); diff --git a/src/coreclr/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp b/src/coreclr/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp index aa9e3bee6baa9a..a14cd04115f975 100644 --- a/src/coreclr/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp +++ b/src/coreclr/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp @@ -133,7 +133,7 @@ PALTEST(file_io_SearchPathW_test1_paltest_searchpathw_test1, "file_io/SearchPath } memset(fileloc_SearchPathW_test1, 0, _MAX_PATH); - sprintf_s(fileloc_SearchPathW_test1, _countof(fileloc_SearchPathW_test1), "%s%s", fullPath, szFileNameExistsWithExt); + sprintf_s(fileloc_SearchPathW_test1, ARRAY_SIZE(fileloc_SearchPathW_test1), "%s%s", fullPath, szFileNameExistsWithExt); RemoveAll_SearchPathW_test1(); diff --git a/src/coreclr/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.cpp b/src/coreclr/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.cpp index bacdc92365cddb..ff18c512c4b926 100644 --- a/src/coreclr/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.cpp +++ b/src/coreclr/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.cpp @@ -33,9 +33,9 @@ PALTEST(filemapping_memmgt_CreateFileMappingW_test2_paltest_createfilemappingw_t } #if WIN32 - sprintf_s(executableFileName, _countof(executableFileName),"%s","executable.exe"); + sprintf_s(executableFileName, ARRAY_SIZE(executableFileName),"%s","executable.exe"); #else - sprintf_s(executableFileName, _countof(executableFileName),"%s","executable"); + sprintf_s(executableFileName, ARRAY_SIZE(executableFileName),"%s","executable"); #endif //conver string to a unicode one @@ -53,7 +53,7 @@ PALTEST(filemapping_memmgt_CreateFileMappingW_test2_paltest_createfilemappingw_t //free this memory free(wpFileName); - + if(INVALID_HANDLE_VALUE == FileHandle) { Fail("Failed to call CreateFile to create a file\n"); @@ -70,7 +70,7 @@ PALTEST(filemapping_memmgt_CreateFileMappingW_test2_paltest_createfilemappingw_t NULL); //unnamed object - if(NULL == FileMappingHandle) + if(NULL == FileMappingHandle) { Trace("\nFailed to call CreateFileMapping to create a mapping object!\n"); err = CloseHandle(FileHandle); diff --git a/src/coreclr/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.cpp b/src/coreclr/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.cpp index 690f1ba071c9ac..beceabf82fdb69 100644 --- a/src/coreclr/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.cpp +++ b/src/coreclr/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.cpp @@ -6,7 +6,7 @@ ** Source: loadlibrarya.c ** ** Purpose: Negative test the LoadLibraryA API. -** Call LoadLibraryA by passing a module name +** Call LoadLibraryA by passing a module name ** without extension but with a trailing dot. ** ** @@ -30,13 +30,13 @@ PALTEST(loader_LoadLibraryA_test5_paltest_loadlibrarya_test5, "loader/LoadLibrar /*Module name without extension but with a trailing dot*/ #if WIN32 - sprintf_s(ModuleName, _countof(ModuleName), "%s", "rotor_pal."); + sprintf_s(ModuleName, ARRAY_SIZE(ModuleName), "%s", "rotor_pal."); #else /* Under FreeBSD */ - sprintf_s(ModuleName, _countof(ModuleName), "%s", "librotor_pal."); + sprintf_s(ModuleName, ARRAY_SIZE(ModuleName), "%s", "librotor_pal."); #endif - /* load a module which does not have the file extension, + /* load a module which does not have the file extension, * but has a trailing dot */ ModuleHandle = LoadLibraryA(ModuleName); diff --git a/src/coreclr/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.cpp b/src/coreclr/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.cpp index 33b46fb0a4064c..e6c97ad555df7f 100644 --- a/src/coreclr/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.cpp +++ b/src/coreclr/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.cpp @@ -6,7 +6,7 @@ ** Source: loadlibraryw.c ** ** Purpose: Negative test the LoadLibraryW API. -** Call LoadLibraryW by passing a module name +** Call LoadLibraryW by passing a module name ** without extension but with a trailing dot. ** ** @@ -32,9 +32,9 @@ PALTEST(loader_LoadLibraryW_test5_paltest_loadlibraryw_test5, "loader/LoadLibrar /*Module name without extension but with a trailing dot*/ #if WIN32 - sprintf_s(ModuleName, _countof(ModuleName),"%s","rotor_pal."); + sprintf_s(ModuleName, ARRAY_SIZE(ModuleName),"%s","rotor_pal."); #else - sprintf_s(ModuleName, _countof(ModuleName),"%s","librotor_pal."); + sprintf_s(ModuleName, ARRAY_SIZE(ModuleName),"%s","librotor_pal."); #endif /* convert a normal string to a wide one */ @@ -52,7 +52,7 @@ PALTEST(loader_LoadLibraryW_test5_paltest_loadlibraryw_test5, "loader/LoadLibrar "call LoadLibraryW with module name which does not have " "extension except a trailing dot, a NULL module handle is" "expected, but no NULL module handle is returned, " - "error code = %u\n", GetLastError()); + "error code = %u\n", GetLastError()); /* decrement the reference count of the loaded dll */ err = FreeLibrary(ModuleHandle); diff --git a/src/coreclr/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/test1.cpp b/src/coreclr/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/test1.cpp index 13f8176f3e6469..ea9cbb331c101b 100644 --- a/src/coreclr/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/test1.cpp +++ b/src/coreclr/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/test1.cpp @@ -5,7 +5,7 @@ ** ** Source: test1.c ** -** Purpose: Tests that GetLocaleInfoW gives the correction information for +** Purpose: Tests that GetLocaleInfoW gives the correction information for ** LOCALE_NEUTRAL. ** ** @@ -14,15 +14,13 @@ #include -int Types[] = { LOCALE_SDECIMAL, LOCALE_STHOUSAND, LOCALE_ILZERO, +int Types[] = { LOCALE_SDECIMAL, LOCALE_STHOUSAND, LOCALE_ILZERO, LOCALE_SCURRENCY, LOCALE_SMONDECIMALSEP, LOCALE_SMONTHOUSANDSEP }; char *TypeStrings[] = { "LOCALE_SDECIMAL", "LOCALE_STHOUSAND", "LOCALE_ILZERO", "LOCALE_SCURRENCY", "LOCALE_SMONDECIMALSEP", "LOCALE_SMONTHOUSANDSEP" }; -#define NUM_TYPES (sizeof(Types) / sizeof(Types[0])) - -typedef WCHAR InfoStrings[NUM_TYPES][4]; +typedef WCHAR InfoStrings[ARRAY_SIZE(Types)][4]; typedef struct { @@ -32,7 +30,7 @@ typedef struct LocalInfoType Locales[] = { - {LOCALE_NEUTRAL, + {LOCALE_NEUTRAL, {{'.',0}, {',',0}, {'1',0}, {'$',0}, {'.',0}, {',',0}}}, }; @@ -40,7 +38,7 @@ int NumLocales = sizeof(Locales) / sizeof(Locales[0]); PALTEST(locale_info_GetLocaleInfoW_test1_paltest_getlocaleinfow_test1, "locale_info/GetLocaleInfoW/test1/paltest_getlocaleinfow_test1") -{ +{ WCHAR buffer[256] = { 0 }; int ret; int i,j; @@ -52,10 +50,10 @@ PALTEST(locale_info_GetLocaleInfoW_test1_paltest_getlocaleinfow_test1, "locale_i for (i=0; i/dev/null - + TEST_XUNIT_NAME=$(dirname $TEST_NAME) TEST_XUNIT_CLASSNAME=$(dirname $TEST_XUNIT_NAME) TEST_XUNIT_NAME=${TEST_XUNIT_NAME#*/} TEST_XUNIT_NAME=${TEST_XUNIT_NAME#*/} - + TEST_XUNIT_NAME=$(echo $TEST_XUNIT_NAME | tr / .) TEST_XUNIT_CLASSNAME=$(echo $TEST_XUNIT_CLASSNAME | tr / .) - + echo -n "> $PAL_XUNIT_TEST_LIST_TMP # If the exit code is 0 then the test passed, otherwise record a failure. @@ -175,10 +175,10 @@ do echo "Pass\" />" >> $PAL_XUNIT_TEST_LIST_TMP else echo "Fail\" >" >> $PAL_XUNIT_TEST_LIST_TMP - echo "" >> $PAL_XUNIT_TEST_LIST_TMP - echo "" >> $PAL_XUNIT_TEST_LIST_TMP - echo "" >> $PAL_XUNIT_TEST_LIST_TMP - echo "" >> $PAL_XUNIT_TEST_LIST_TMP + echo "" >> $PAL_XUNIT_TEST_LIST_TMP + echo "" >> $PAL_XUNIT_TEST_LIST_TMP + echo "" >> $PAL_XUNIT_TEST_LIST_TMP + echo "" >> $PAL_XUNIT_TEST_LIST_TMP echo "" >> $PAL_XUNIT_TEST_LIST_TMP FAILED_TEST="$TEST_NAME. Exit code: $TEST_EXIT_CODE" echo diff --git a/src/coreclr/pal/tests/palsuite/threading/CreateProcessW/test2/parentprocess.cpp b/src/coreclr/pal/tests/palsuite/threading/CreateProcessW/test2/parentprocess.cpp index 5d69ee224d51ec..19bfc74ba6afde 100644 --- a/src/coreclr/pal/tests/palsuite/threading/CreateProcessW/test2/parentprocess.cpp +++ b/src/coreclr/pal/tests/palsuite/threading/CreateProcessW/test2/parentprocess.cpp @@ -6,7 +6,7 @@ ** Source: createprocessw/test2/parentprocess.c ** ** Purpose: Test the following features of CreateProcessW: -** - Check to see if hProcess & hThread are set in +** - Check to see if hProcess & hThread are set in ** return PROCESS_INFORMATION structure ** - Check to see if stdin, stdout, & stderr handles ** are used when STARTF_USESTDHANDLES is specified @@ -19,7 +19,7 @@ ** WaitForSingleObject ** WriteFile, ReadFile ** GetExitCodeProcess -** +** ** **=========================================================*/ @@ -68,11 +68,11 @@ PALTEST(threading_CreateProcessW_test2_paltest_createprocessw_test2, "threading/ } /*Setup SECURITY_ATTRIBUTES structure for CreatePipe*/ - pipeAttributes.nLength = sizeof(SECURITY_ATTRIBUTES); - pipeAttributes.lpSecurityDescriptor = NULL; - pipeAttributes.bInheritHandle = TRUE; - - + pipeAttributes.nLength = sizeof(SECURITY_ATTRIBUTES); + pipeAttributes.lpSecurityDescriptor = NULL; + pipeAttributes.bInheritHandle = TRUE; + + /*Create a StdIn pipe for child*/ bRetVal = CreatePipe(&hTestStdInR, /* read handle*/ &hTestStdInW, /* write handle */ @@ -138,7 +138,7 @@ PALTEST(threading_CreateProcessW_test2_paltest_createprocessw_test2, "threading/ /* Launch the child */ if ( !CreateProcess (NULL, szFullPathNameW, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi )) { - Fail("ERROR: CreateProcess call failed. GetLastError returned %d\n", + Fail("ERROR: CreateProcess call failed. GetLastError returned %d\n", GetLastError() ); } @@ -157,7 +157,7 @@ PALTEST(threading_CreateProcessW_test2_paltest_createprocessw_test2, "threading/ Fail("ERROR: %ld :unable to write to write pipe handle " "hTestStdInW=0x%lx\n", GetLastError(), hTestStdInW); } - + /* Wait for the child to finish, Max 20 seconds */ dwExitCode = WaitForSingleObject(pi.hProcess, 20000); @@ -222,7 +222,7 @@ PALTEST(threading_CreateProcessW_test2_paltest_createprocessw_test2, "threading/ NULL); /* overlapped buffer*/ - /* Confirm that we recieved the same string that we originally */ + /* Confirm that we received the same string that we originally */ /* wrote to the child and was received on both stdout & stderr.*/ if (strncmp(szTestString, szStdOutBuf, strlen(szTestString)) != 0 || strncmp(szTestString, szStdErrBuf, strlen(szTestString)) != 0) diff --git a/src/coreclr/pal/tests/palsuite/threading/NamedMutex/test1/namedmutex.cpp b/src/coreclr/pal/tests/palsuite/threading/NamedMutex/test1/namedmutex.cpp index 7956a955455c7d..b3a73807ed77af 100644 --- a/src/coreclr/pal/tests/palsuite/threading/NamedMutex/test1/namedmutex.cpp +++ b/src/coreclr/pal/tests/palsuite/threading/NamedMutex/test1/namedmutex.cpp @@ -7,10 +7,6 @@ #include -#ifndef _countof -#define _countof(a) (sizeof(a) / sizeof(a[0])) -#endif // !_countof - const char *const SessionPrefix = "Local\\"; const char *const GlobalPrefix = "Global\\"; @@ -207,7 +203,7 @@ bool StartProcess(const char *funcName) if (g_isStress) { test_strcpy(&g_processCommandLinePath[processCommandLinePathLength], " stress"); - processCommandLinePathLength += _countof("stress") - 1; + processCommandLinePathLength += STRING_LENGTH("stress"); } STARTUPINFO si; @@ -416,8 +412,8 @@ bool NameTests() // Name too long. The maximum allowed length depends on the file system, so we're not checking for that. { char name[257]; - memset(name, 'a', _countof(name) - 1); - name[_countof(name) - 1] = '\0'; + memset(name, 'a', STRING_LENGTH(name)); + name[STRING_LENGTH(name)] = '\0'; TestCreateMutex(m, name); TestAssert(m == nullptr); TestAssert(GetLastError() == ERROR_FILENAME_EXCED_RANGE); @@ -579,7 +575,7 @@ bool MutualExclusionTests() HANDLE waitHandles[] = {m2.GetHandle(), m.GetHandle()}; TestAssert( WaitForMultipleObjects( - _countof(waitHandles), + ARRAY_SIZE(waitHandles), waitHandles, false /* waitAll */, FailTimeoutMilliseconds) == @@ -587,7 +583,7 @@ bool MutualExclusionTests() TestAssert(GetLastError() == ERROR_NOT_SUPPORTED); TestAssert( WaitForMultipleObjects( - _countof(waitHandles), + ARRAY_SIZE(waitHandles), waitHandles, true /* waitAll */, FailTimeoutMilliseconds) == @@ -1114,7 +1110,7 @@ bool (*const TestList[])() = bool RunTests() { bool allPassed = true; - for (SIZE_T i = 0; i < _countof(TestList); ++i) + for (SIZE_T i = 0; i < ARRAY_SIZE(TestList); ++i) { if (!TestList[i]()) { @@ -1125,7 +1121,7 @@ bool RunTests() } DWORD g_stressDurationMilliseconds = 0; -LONG g_stressTestCounts[_countof(TestList)] = {0}; +LONG g_stressTestCounts[ARRAY_SIZE(TestList)] = {0}; LONG g_stressResult = true; DWORD PALAPI StressTest(void *arg) @@ -1154,8 +1150,8 @@ bool StressTests(DWORD durationMinutes) g_stressDurationMilliseconds = durationMinutes * (60 * 1000); // Start a thread for each test - HANDLE threadHandles[_countof(TestList)]; - for (SIZE_T i = 0; i < _countof(threadHandles); ++i) + HANDLE threadHandles[ARRAY_SIZE(TestList)]; + for (SIZE_T i = 0; i < ARRAY_SIZE(threadHandles); ++i) { TestAssert(StartThread(StressTest, reinterpret_cast(i), &threadHandles[i])); } @@ -1163,7 +1159,7 @@ bool StressTests(DWORD durationMinutes) while (true) { DWORD waitResult = - WaitForMultipleObjects(_countof(threadHandles), threadHandles, true /* bWaitAll */, 10 * 1000 /* dwMilliseconds */); + WaitForMultipleObjects(ARRAY_SIZE(threadHandles), threadHandles, true /* bWaitAll */, 10 * 1000 /* dwMilliseconds */); TestAssert(waitResult == WAIT_OBJECT_0 || waitResult == WAIT_TIMEOUT); if (waitResult == WAIT_OBJECT_0) { @@ -1171,7 +1167,7 @@ bool StressTests(DWORD durationMinutes) } Trace("'paltest_namedmutex_test1' stress test counts: "); - for (SIZE_T i = 0; i < _countof(g_stressTestCounts); ++i) + for (SIZE_T i = 0; i < ARRAY_SIZE(g_stressTestCounts); ++i) { if (i != 0) { @@ -1183,7 +1179,7 @@ bool StressTests(DWORD durationMinutes) fflush(stdout); } - for (SIZE_T i = 0; i < _countof(threadHandles); ++i) + for (SIZE_T i = 0; i < ARRAY_SIZE(threadHandles); ++i) { CloseHandle(threadHandles[i]); } diff --git a/src/coreclr/pal/tests/palsuite/threading/NamedMutex/test1/nopal.cpp b/src/coreclr/pal/tests/palsuite/threading/NamedMutex/test1/nopal.cpp index 3c18e67d021c8e..d226ff5cf8d82d 100644 --- a/src/coreclr/pal/tests/palsuite/threading/NamedMutex/test1/nopal.cpp +++ b/src/coreclr/pal/tests/palsuite/threading/NamedMutex/test1/nopal.cpp @@ -12,8 +12,7 @@ #include #include #include - -#define _countof(a) (sizeof(a) / sizeof(a[0])) +#include #undef PAGE_SIZE #define PAGE_SIZE (4096) @@ -58,7 +57,7 @@ bool WriteHeaderInfo(const char *path, char sharedMemoryType, char version, int // See SharedMemorySharedDataHeader for format char buffer[] = {sharedMemoryType, version}; - if (write(fd, buffer, _countof(buffer)) != _countof(buffer)) + if (write(fd, buffer, ARRAY_SIZE(buffer)) != ARRAY_SIZE(buffer)) return false; return flock(fd, LOCK_SH | LOCK_NB) == 0; diff --git a/src/coreclr/pal/tools/smarty.sh b/src/coreclr/pal/tools/smarty.sh index d8b407e72c619c..6ab63d94939261 100755 --- a/src/coreclr/pal/tools/smarty.sh +++ b/src/coreclr/pal/tools/smarty.sh @@ -15,8 +15,8 @@ then export BVT_ROOT=$PWD fi -if [ -n "$PERL5LIB" ] ; then - if [ -z "`expr $PERL5LIB : ".*\($BVT_ROOT/Common/Smarty\)"`" ] ; then +if [ -n "$PERL5LIB" ]; then + if [ -z "`expr $PERL5LIB : ".*\($BVT_ROOT/Common/Smarty\)"`" ]; then export PERL5LIB="$PERL5LIB:$BVT_ROOT/Common/Smarty" fi else diff --git a/src/coreclr/palrt/common.h b/src/coreclr/palrt/common.h index 684c134abede95..9946ed67e8d967 100644 --- a/src/coreclr/palrt/common.h +++ b/src/coreclr/palrt/common.h @@ -14,4 +14,5 @@ #include #include #include "shlwapip.h" +#include #endif // _COMMON_H_ diff --git a/src/coreclr/palrt/path.cpp b/src/coreclr/palrt/path.cpp index 7e0d2279f4a9fe..51eb1514769e70 100644 --- a/src/coreclr/palrt/path.cpp +++ b/src/coreclr/palrt/path.cpp @@ -430,15 +430,15 @@ STDAPI_(LPWSTR) PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile) if (!lpszFile || *lpszFile==W('\0')) { // lpszFile is empty - StringCchCopyNW(szTemp, ARRAYSIZE(szTemp), lpszDir, ARRAYSIZE(szTemp)); + StringCchCopyNW(szTemp, ARRAY_SIZE(szTemp), lpszDir, ARRAY_SIZE(szTemp)); } else if (PathIsRelativeW(lpszFile)) { - StringCchCopyNW(szTemp, ARRAYSIZE(szTemp), lpszDir, ARRAYSIZE(szTemp)); + StringCchCopyNW(szTemp, ARRAY_SIZE(szTemp), lpszDir, ARRAY_SIZE(szTemp)); pszT = PathAddBackslashW(szTemp); if (pszT) { - size_t iRemaining = ARRAYSIZE(szTemp) - (pszT - szTemp); + size_t iRemaining = ARRAY_SIZE(szTemp) - (pszT - szTemp); if (wcslen(lpszFile) < iRemaining) { @@ -456,7 +456,7 @@ STDAPI_(LPWSTR) PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile) } else if (IsPathSeparator(*lpszFile) && !PathIsUNCW(lpszFile)) { - StringCchCopyNW(szTemp, ARRAYSIZE(szTemp), lpszDir, ARRAYSIZE(szTemp)); + StringCchCopyNW(szTemp, ARRAY_SIZE(szTemp), lpszDir, ARRAY_SIZE(szTemp)); // FEATURE: Note that we do not check that an actual root is returned; // it is assumed that we are given valid parameters PathStripToRootW(szTemp); @@ -467,7 +467,7 @@ STDAPI_(LPWSTR) PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile) // Skip the backslash when copying // Note: We don't support strings longer than 4GB, but that's // okay because we already fail at MAX_PATH - int iRemaining = (int)(ARRAYSIZE(szTemp) - (pszT - szTemp)); + int iRemaining = (int)(ARRAY_SIZE(szTemp) - (pszT - szTemp)); StringCchCopyNW(pszT, iRemaining, lpszFile+1, iRemaining); } else @@ -478,13 +478,13 @@ STDAPI_(LPWSTR) PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile) else { // already fully qualified file part - StringCchCopyNW(szTemp, ARRAYSIZE(szTemp), lpszFile, ARRAYSIZE(szTemp)); + StringCchCopyNW(szTemp, ARRAY_SIZE(szTemp), lpszFile, ARRAY_SIZE(szTemp)); } } else if (lpszFile && *lpszFile) { // no dir just use file. - StringCchCopyNW(szTemp, ARRAYSIZE(szTemp), lpszFile, ARRAYSIZE(szTemp)); + StringCchCopyNW(szTemp, ARRAY_SIZE(szTemp), lpszFile, ARRAY_SIZE(szTemp)); } // diff --git a/src/coreclr/palrt/shlwapip.h b/src/coreclr/palrt/shlwapip.h index a34c923c346b51..490d73f36a9d95 100644 --- a/src/coreclr/palrt/shlwapip.h +++ b/src/coreclr/palrt/shlwapip.h @@ -12,9 +12,6 @@ #ifndef SHLWAPIP_H_INCLUDED #define SHLWAPIP_H_INCLUDED -#define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0])) -#define SIZECHARS(sz) (sizeof(sz)/sizeof(sz[0])) - #define SIZEOF(x) sizeof(x) #define PRIVATE #define PUBLIC diff --git a/src/coreclr/scripts/antigen_run.py b/src/coreclr/scripts/antigen_run.py index 96146005906d9a..240e1353f75b83 100644 --- a/src/coreclr/scripts/antigen_run.py +++ b/src/coreclr/scripts/antigen_run.py @@ -20,7 +20,7 @@ from os.path import getsize import os from coreclr_arguments import * -from azdo_pipelines_util import run_command, TempDir +from jitutil import run_command, TempDir parser = argparse.ArgumentParser(description="description") diff --git a/src/coreclr/scripts/azdo_pipelines_util.py b/src/coreclr/scripts/azdo_pipelines_util.py deleted file mode 100644 index 83f1d083ee6ad0..00000000000000 --- a/src/coreclr/scripts/azdo_pipelines_util.py +++ /dev/null @@ -1,178 +0,0 @@ -#!/usr/bin/env python3 -# -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. -# -# Title : azdo_pipelines_util.py -# -# Notes: -# -# Utility functions used by Python scripts involved with Azure DevOps Pipelines -# setup. -# -################################################################################ -################################################################################ - -import os -import shutil -import subprocess -import sys -import tempfile - - -def run_command(command_to_run, _cwd=None, _exit_on_fail=False, _output_file=None): - """ Runs the command. - - Args: - command_to_run ([string]): Command to run along with arguments. - _cwd (string): Current working directory. - _exit_on_fail (bool): If it should exit on failure. - Returns: - (string, string, int): Returns a tuple of stdout, stderr, and command return code if _output_file= None - Otherwise stdout, stderr are empty. - """ - print("Running: " + " ".join(command_to_run)) - command_stdout = "" - command_stderr = "" - return_code = 1 - - output_type = subprocess.STDOUT if _output_file else subprocess.PIPE - with subprocess.Popen(command_to_run, stdout=subprocess.PIPE, stderr=output_type, cwd=_cwd) as proc: - - # For long running command, continuously print the output - if _output_file: - while True: - with open(_output_file, 'a') as of: - output = proc.stdout.readline() - if proc.poll() is not None: - break - if output: - output_str = output.strip().decode("utf-8") - print(output_str) - of.write(output_str + "\n") - else: - command_stdout, command_stderr = proc.communicate() - if len(command_stdout) > 0: - print(command_stdout.decode("utf-8")) - if len(command_stderr) > 0: - print(command_stderr.decode("utf-8")) - - return_code = proc.returncode - if _exit_on_fail and return_code != 0: - print("Command failed. Exiting.") - sys.exit(1) - return command_stdout, command_stderr, return_code - - -def copy_directory(src_path, dst_path, verbose_output=True, match_func=lambda path: True): - """Copies directory in 'src_path' to 'dst_path' maintaining the directory - structure. https://docs.python.org/3.5/library/shutil.html#shutil.copytree can't - be used in this case because it expects the destination directory should not - exist, however we do call copy_directory() to copy files to same destination directory. - - Args: - src_path (string): Path of source directory that need to be copied. - dst_path (string): Path where directory should be copied. - verbose_output (bool): True to print every copy or skipped file. - match_func (str -> bool) : Criteria function determining if a file is copied. - """ - if not os.path.exists(dst_path): - os.makedirs(dst_path) - for item in os.listdir(src_path): - src_item = os.path.join(src_path, item) - dst_item = os.path.join(dst_path, item) - if os.path.isdir(src_item): - copy_directory(src_item, dst_item, verbose_output, match_func) - else: - try: - if match_func(src_item): - if verbose_output: - print("> copy {0} => {1}".format(src_item, dst_item)) - try: - shutil.copy2(src_item, dst_item) - except PermissionError as pe_error: - print('Ignoring PermissionError: {0}'.format(pe_error)) - else: - if verbose_output: - print("> skipping {0}".format(src_item)) - except UnicodeEncodeError: - if verbose_output: - print("> Got UnicodeEncodeError") - - -def copy_files(src_path, dst_path, file_names): - """Copy files from 'file_names' list from 'src_path' to 'dst_path'. - It retains the original directory structure of src_path. - - Args: - src_path (string): Source directory from where files are copied. - dst_path (string): Destination directory where files to be copied. - file_names ([string]): List of full path file names to be copied. - """ - - print('### Copying below files from {0} to {1}:'.format(src_path, dst_path)) - print('') - print(os.linesep.join(file_names)) - for f in file_names: - # Create same structure in dst so we don't clobber same files names present in different directories - dst_path_of_file = f.replace(src_path, dst_path) - - dst_directory = os.path.dirname(dst_path_of_file) - if not os.path.exists(dst_directory): - os.makedirs(dst_directory) - try: - shutil.copy2(f, dst_path_of_file) - except PermissionError as pe_error: - print('Ignoring PermissionError: {0}'.format(pe_error)) - - -def set_pipeline_variable(name, value): - """ This method sets pipeline variable. - - Args: - name (string): Name of the variable. - value (string): Value of the variable. - """ - define_variable_format = "##vso[task.setvariable variable={0}]{1}" - print("{0} -> {1}".format(name, value)) # logging - print(define_variable_format.format(name, value)) # set variable - - -class TempDir: - """ Class to create a temporary working directory, or use one that is passed as an argument. - - Use with: "with TempDir() as temp_dir" to change to that directory and then automatically - change back to the original working directory afterwards and remove the temporary - directory and its contents (if skip_cleanup is False). - """ - - def __init__(self, path=None, skip_cleanup=False): - self.mydir = tempfile.mkdtemp() if path is None else path - self.cwd = None - self._skip_cleanup = skip_cleanup - - def __enter__(self): - self.cwd = os.getcwd() - os.chdir(self.mydir) - return self.mydir - - def __exit__(self, exc_type, exc_val, exc_tb): - os.chdir(self.cwd) - if not self._skip_cleanup: - shutil.rmtree(self.mydir) - - -class ChangeDir: - """ Class to temporarily change to a given directory. Use with "with". - """ - - def __init__(self, mydir): - self.mydir = mydir - self.cwd = None - - def __enter__(self): - self.cwd = os.getcwd() - os.chdir(self.mydir) - - def __exit__(self, exc_type, exc_val, exc_tb): - os.chdir(self.cwd) \ No newline at end of file diff --git a/src/coreclr/scripts/fuzzer_setup.py b/src/coreclr/scripts/fuzzer_setup.py index 54ce2f37734fc1..7bc60acc71c4ff 100644 --- a/src/coreclr/scripts/fuzzer_setup.py +++ b/src/coreclr/scripts/fuzzer_setup.py @@ -18,7 +18,7 @@ import os from coreclr_arguments import * from os import path -from azdo_pipelines_util import run_command, copy_directory, set_pipeline_variable, ChangeDir, TempDir +from jitutil import run_command, copy_directory, set_pipeline_variable, ChangeDir, TempDir parser = argparse.ArgumentParser(description="description") @@ -103,7 +103,7 @@ def main(main_args): # create exploratory directory print('Copying {} -> {}'.format(scripts_src_directory, coreroot_directory)) - copy_directory(scripts_src_directory, coreroot_directory, match_func=lambda path: any(path.endswith(extension) for extension in [".py"])) + copy_directory(scripts_src_directory, coreroot_directory, verbose_output=True, match_func=lambda path: any(path.endswith(extension) for extension in [".py"])) if is_windows: acceptable_copy = lambda path: any(path.endswith(extension) for extension in [".py", ".dll", ".exe", ".json"]) @@ -113,7 +113,7 @@ def main(main_args): # copy CORE_ROOT print('Copying {} -> {}'.format(coreclr_args.core_root_directory, coreroot_directory)) - copy_directory(coreclr_args.core_root_directory, coreroot_directory, match_func=acceptable_copy) + copy_directory(coreclr_args.core_root_directory, coreroot_directory, verbose_output=True, match_func=acceptable_copy) try: with TempDir() as tool_code_directory: @@ -136,7 +136,7 @@ def main(main_args): # copy tool print('Copying {} -> {}'.format(publish_dir, dst_directory)) - copy_directory(publish_dir, dst_directory, match_func=acceptable_copy) + copy_directory(publish_dir, dst_directory, verbose_output=True, match_func=acceptable_copy) except PermissionError as pe: print("Skipping file. Got error: %s", pe) diff --git a/src/coreclr/scripts/fuzzlyn_run.py b/src/coreclr/scripts/fuzzlyn_run.py index 7d99b1f504fffb..fa37b6eb4f655c 100644 --- a/src/coreclr/scripts/fuzzlyn_run.py +++ b/src/coreclr/scripts/fuzzlyn_run.py @@ -20,7 +20,7 @@ import re import shutil import threading -from azdo_pipelines_util import run_command, TempDir +from jitutil import run_command, TempDir from coreclr_arguments import * from os import path diff --git a/src/coreclr/scripts/genDummyProvider.py b/src/coreclr/scripts/genDummyProvider.py index 908c09d174db15..b8786c47a7a4f1 100644 --- a/src/coreclr/scripts/genDummyProvider.py +++ b/src/coreclr/scripts/genDummyProvider.py @@ -6,7 +6,7 @@ ## interface from a manifest file ## ## The intended use if for platforms which support event pipe -## but do not have a an eventing platform to recieve report events +## but do not have a an eventing platform to receive report events import os from genEventing import * diff --git a/src/coreclr/scripts/jitrollingbuild.py b/src/coreclr/scripts/jitrollingbuild.py index 0003805b49960d..100aff85c35226 100644 --- a/src/coreclr/scripts/jitrollingbuild.py +++ b/src/coreclr/scripts/jitrollingbuild.py @@ -32,10 +32,10 @@ ################################################################################ az_account_name = "clrjit2" -az_container_name = "jitrollingbuild" +az_jitrollingbuild_container_name = "jitrollingbuild" az_builds_root_folder = "builds" az_blob_storage_account_uri = "https://" + az_account_name + ".blob.core.windows.net/" -az_blob_storage_container_uri = az_blob_storage_account_uri + az_container_name +az_blob_storage_jitrollingbuild_container_uri = az_blob_storage_account_uri + az_jitrollingbuild_container_name ################################################################################ # Argument Parser @@ -50,19 +50,28 @@ """ download_description = """\ -Download clrjit from SuperPMI Azure storage. +Download clrjit from SuperPMI Azure storage. If -git_hash is given, download exactly +that JIT. If -git_hash is not given, find the latest git hash from the main branch that +corresponds to the current tree, and download that JIT. That is, find an appropriate +"baseline" JIT for doing asm diffs. """ list_description = """\ List clrjit in SuperPMI Azure storage. """ -host_os_help = "OS (windows, OSX, Linux). Default: current OS." - arch_help = "Architecture (x64, x86, arm, arm64). Default: current architecture." build_type_help = "Build type (Debug, Checked, Release). Default: Checked." +host_os_help = "OS (windows, OSX, Linux). Default: current OS." + +spmi_location_help = """\ +Directory in which to put SuperPMI files, such as downloaded MCH files, asm diffs, and repro .MC files. +Optional. Default is 'spmi' within the repo 'artifacts' directory. +If 'SUPERPMI_CACHE_DIRECTORY' environment variable is set to a path, it will use that directory. +""" + git_hash_help = "git hash" target_dir_help = "Directory to put the downloaded JIT." @@ -82,6 +91,7 @@ common_parser.add_argument("-arch", help=arch_help) common_parser.add_argument("-build_type", default="Checked", help=build_type_help) common_parser.add_argument("-host_os", help=host_os_help) +common_parser.add_argument("-spmi_location", help=spmi_location_help) # subparser for upload upload_parser = subparsers.add_parser("upload", description=upload_description, parents=[common_parser]) @@ -93,8 +103,8 @@ # subparser for download download_parser = subparsers.add_parser("download", description=download_description, parents=[common_parser]) -download_parser.add_argument("-git_hash", required=True, help=git_hash_help) -download_parser.add_argument("-target_dir", required=True, help=target_dir_help) +download_parser.add_argument("-git_hash", help=git_hash_help) +download_parser.add_argument("-target_dir", help=target_dir_help) download_parser.add_argument("--skip_cleanup", action="store_true", help=skip_cleanup_help) # subparser for list @@ -172,6 +182,111 @@ def determine_jit_name(coreclr_args): raise RuntimeError("Unknown OS.") +def process_git_hash_arg(coreclr_args): + """ Process the -git_hash argument. + + If the argument is present, use that to download a JIT. + If not present, try to find and download a JIT based on the current environment: + 1. Determine the current directory git hash using: + git rev-parse HEAD + Call the result `current_git_hash`. + 2. Determine the baseline: where does this hash meet `main` using: + git merge-base `current_git_hash` main + Call the result `base_git_hash`. + 3. Figure out the latest hash, starting with `base_git_hash`, that contains any changes to + the src/coreclr/jit directory. (We do this because the JIT rolling build only includes + builds for changes to this directory. So, this logic needs to stay in sync with the logic + that determines what causes the JIT rolling build to run. E.g., it should also get + rebuilt if the JIT-EE interface GUID changes. Alternatively, we can take the entire list + of changes, and probe the rolling build drop for all of them.) + 4. Starting with `base_git_hash`, and possibly walking to older changes, look for matching builds + in the JIT rolling build drops. + 5. If a JIT directory in Azure Storage is found, set coreclr_args.git_hash to that git hash to use + for downloading. + + Args: + coreclr_args (CoreclrArguments) : parsed args + + Returns: + Nothing + + coreclr_args.git_hash is set to the git hash to use + + An exception is thrown if the `-git_hash` argument is unspecified, and we don't find an appropriate + JIT to download. + """ + + if coreclr_args.git_hash is not None: + return + + # Do all the remaining commands, including a number of 'git' commands including relative paths, + # from the root of the runtime repo. + + with ChangeDir(coreclr_args.runtime_repo_location): + command = [ "git", "rev-parse", "HEAD" ] + print("Invoking: {}".format(" ".join(command))) + proc = subprocess.Popen(command, stdout=subprocess.PIPE) + stdout_git_rev_parse, _ = proc.communicate() + return_code = proc.returncode + if return_code == 0: + current_git_hash = stdout_git_rev_parse.decode('utf-8').strip() + print("Current hash: {}".format(current_git_hash)) + else: + raise RuntimeError("Couldn't determine current git hash") + + # We've got the current hash; figure out the baseline hash. + command = [ "git", "merge-base", current_git_hash, "origin/main" ] + print("Invoking: {}".format(" ".join(command))) + proc = subprocess.Popen(command, stdout=subprocess.PIPE) + stdout_git_merge_base, _ = proc.communicate() + return_code = proc.returncode + if return_code == 0: + base_git_hash = stdout_git_merge_base.decode('utf-8').strip() + print("Baseline hash: {}".format(base_git_hash)) + else: + raise RuntimeError("Couldn't determine baseline git hash") + + # Enumerate the last 20 changes, starting with the baseline, that included JIT changes. + command = [ "git", "log", "--pretty=format:%H", base_git_hash, "-20", "--", "src/coreclr/jit/*" ] + print("Invoking: {}".format(" ".join(command))) + proc = subprocess.Popen(command, stdout=subprocess.PIPE) + stdout_change_list, _ = proc.communicate() + return_code = proc.returncode + change_list_hashes = [] + if return_code == 0: + change_list_hashes = stdout_change_list.decode('utf-8').strip().splitlines() + else: + raise RuntimeError("Couldn't determine list of JIT changes starting with baseline hash") + + if len(change_list_hashes) == 0: + raise RuntimeError("No JIT changes found starting with baseline hash") + + # For each hash, see if the rolling build contains the JIT. + + hashnum = 1 + for git_hash in change_list_hashes: + print("try {}: {}".format(hashnum, git_hash)) + + # Set the git hash to look for + # Note: there's a slight inefficiency here because this code searches for a JIT at this hash value, and + # then when we go to download, we do the same search again because we don't cache the result and pass it + # directly on to the downloader. + coreclr_args.git_hash = git_hash + urls = get_jit_urls(coreclr_args, find_all=False) + if len(urls) > 1: + if hashnum > 1: + print("Warning: the baseline found is not built with the first git hash with JIT code changes; there may be extraneous diffs") + return + + # We didn't find a baseline; keep looking + hashnum += 1 + + # We ran out of hashes of JIT changes, and didn't find a baseline. Give up. + print("Error: no baseline JIT found") + + raise RuntimeError("No baseline JIT found") + + def list_az_jits(filter_func=lambda unused: True, prefix_string = None): """ List the JITs in Azure Storage using REST api @@ -198,7 +313,7 @@ def list_az_jits(filter_func=lambda unused: True, prefix_string = None): urls = [] - list_az_container_uri_root = az_blob_storage_container_uri + "?restype=container&comp=list&prefix=" + az_builds_root_folder + "/" + list_az_container_uri_root = az_blob_storage_jitrollingbuild_container_uri + "?restype=container&comp=list&prefix=" + az_builds_root_folder + "/" if prefix_string: list_az_container_uri_root += prefix_string @@ -268,7 +383,7 @@ def upload_command(coreclr_args): print("JIT upload") def upload_blob(file, blob_name): - blob_client = blob_service_client.get_blob_client(container=az_container_name, blob=blob_name) + blob_client = blob_service_client.get_blob_client(container=az_jitrollingbuild_container_name, blob=blob_name) # Check if the blob already exists, and delete it if it does, before uploading / replacing it. try: @@ -382,14 +497,14 @@ def upload_blob(file, blob_name): total_bytes_uploaded += zip_stat_result.st_size blob_name = "{}/{}".format(blob_folder_name, zip_name) - print("Uploading: {} ({}) -> {}".format(file, zip_path, az_blob_storage_container_uri + "/" + blob_name)) + print("Uploading: {} ({}) -> {}".format(file, zip_path, az_blob_storage_jitrollingbuild_container_uri + "/" + blob_name)) upload_blob(zip_path, blob_name) else: file_stat_result = os.stat(file) total_bytes_uploaded += file_stat_result.st_size file_name = os.path.basename(file) blob_name = "{}/{}".format(blob_folder_name, file_name) - print("Uploading: {} -> {}".format(file, az_blob_storage_container_uri + "/" + blob_name)) + print("Uploading: {} -> {}".format(file, az_blob_storage_jitrollingbuild_container_uri + "/" + blob_name)) upload_blob(file, blob_name) print("Uploaded {:n} bytes".format(total_bytes_uploaded)) @@ -466,7 +581,7 @@ def get_jit_urls(coreclr_args, find_all=False): """ blob_filter_string = "{}/{}/{}/{}".format(coreclr_args.git_hash, coreclr_args.host_os, coreclr_args.arch, coreclr_args.build_type) - blob_prefix_filter = "{}/{}/{}".format(az_blob_storage_container_uri, az_builds_root_folder, blob_filter_string).lower() + blob_prefix_filter = "{}/{}/{}".format(az_blob_storage_jitrollingbuild_container_uri, az_builds_root_folder, blob_filter_string).lower() # Determine if a URL in Azure Storage should be allowed. The URL looks like: # https://clrjit.blob.core.windows.net/jitrollingbuild/builds/git_hash/Linux/x64/Checked/clrjit.dll @@ -480,17 +595,27 @@ def filter_jits(url): def download_command(coreclr_args): - """ Download the JIT + """ Download the JITs Args: coreclr_args (CoreclrArguments): parsed args """ urls = get_jit_urls(coreclr_args, find_all=False) - if urls is None: + if len(urls) == 0: + print("Nothing to download") return - download_urls(urls, coreclr_args.target_dir) + if coreclr_args.target_dir is None: + # Use the same default download location for the JIT as superpmi.py uses for downloading a baseline JIT. + default_basejit_root_dir = os.path.join(coreclr_args.spmi_location, "basejit") + target_dir = os.path.join(default_basejit_root_dir, "{}.{}.{}.{}".format(coreclr_args.git_hash, coreclr_args.host_os, coreclr_args.arch, coreclr_args.build_type)) + if not os.path.isdir(target_dir): + os.makedirs(target_dir) + else: + target_dir = coreclr_args.target_dir + + download_urls(urls, target_dir) def list_command(coreclr_args): @@ -501,7 +626,8 @@ def list_command(coreclr_args): """ urls = get_jit_urls(coreclr_args, find_all=coreclr_args.all) - if urls is None: + if len(urls) == 0: + print("No JITs found") return count = len(urls) @@ -536,6 +662,21 @@ def setup_args(args): lambda unused: True, "Unable to set mode") + def setup_spmi_location_arg(spmi_location): + if spmi_location is None: + if "SUPERPMI_CACHE_DIRECTORY" in os.environ: + spmi_location = os.environ["SUPERPMI_CACHE_DIRECTORY"] + spmi_location = os.path.abspath(spmi_location) + else: + spmi_location = os.path.abspath(os.path.join(coreclr_args.artifacts_location, "spmi")) + return spmi_location + + coreclr_args.verify(args, + "spmi_location", + lambda unused: True, + "Unable to set spmi_location", + modify_arg=setup_spmi_location_arg) + if coreclr_args.mode == "upload": coreclr_args.verify(args, @@ -575,10 +716,12 @@ def setup_args(args): lambda unused: True, "Unable to set skip_cleanup") - if not os.path.isdir(coreclr_args.target_dir): + if coreclr_args.target_dir is not None and not os.path.isdir(coreclr_args.target_dir): print("--target_dir directory does not exist") raise RuntimeError("Error") + process_git_hash_arg(coreclr_args) + elif coreclr_args.mode == "list": coreclr_args.verify(args, @@ -607,7 +750,6 @@ def main(args): return 1 coreclr_args = setup_args(args) - success = True if coreclr_args.mode == "upload": upload_command(coreclr_args) @@ -621,7 +763,8 @@ def main(args): else: raise NotImplementedError(coreclr_args.mode) - return 0 if success else 1 + # Note that if there is any failure, an exception is raised and the process exit code is then `1` + return 0 ################################################################################ # __main__ diff --git a/src/coreclr/scripts/jitutil.py b/src/coreclr/scripts/jitutil.py new file mode 100644 index 00000000000000..c7906124b45d4b --- /dev/null +++ b/src/coreclr/scripts/jitutil.py @@ -0,0 +1,673 @@ +#!/usr/bin/env python3 +# +# Licensed to the .NET Foundation under one or more agreements. +# The .NET Foundation licenses this file to you under the MIT license. +# +# Title : jitutil.py +# +# Notes: +# +# Utility functions used by Python scripts used by the CLR JIT team. +# +################################################################################ +################################################################################ + +import os +import shutil +import subprocess +import sys +import tempfile +import logging +import urllib +import urllib.request +import zipfile + +################################################################################ +## +## Helper classes +## +################################################################################ + +class TempDir: + """ Class to create a temporary working directory, or use one that is passed as an argument. + + Use with: "with TempDir() as temp_dir" to change to that directory and then automatically + change back to the original working directory afterwards and remove the temporary + directory and its contents (if skip_cleanup is False). + """ + + def __init__(self, path=None, skip_cleanup=False): + self.mydir = tempfile.mkdtemp() if path is None else path + self.cwd = None + self._skip_cleanup = skip_cleanup + + def __enter__(self): + self.cwd = os.getcwd() + os.chdir(self.mydir) + return self.mydir + + def __exit__(self, exc_type, exc_val, exc_tb): + os.chdir(self.cwd) + if not self._skip_cleanup: + shutil.rmtree(self.mydir) + +class ChangeDir: + """ Class to temporarily change to a given directory. Use with "with". + """ + + def __init__(self, mydir): + self.mydir = mydir + self.cwd = None + + def __enter__(self): + self.cwd = os.getcwd() + os.chdir(self.mydir) + + def __exit__(self, exc_type, exc_val, exc_tb): + os.chdir(self.cwd) + + +################################################################################ +## +## Azure DevOps pipelines helper functions +## +################################################################################ + +def set_pipeline_variable(name, value): + """ This method sets pipeline variable. + + Args: + name (string): Name of the variable. + value (string): Value of the variable. + """ + define_variable_format = "##vso[task.setvariable variable={0}]{1}" + print("{0} -> {1}".format(name, value)) # logging + print(define_variable_format.format(name, value)) # set variable + + +################################################################################ +## +## Helper functions +## +################################################################################ + +def run_command(command_to_run, _cwd=None, _exit_on_fail=False, _output_file=None): + """ Runs the command. + + Args: + command_to_run ([string]): Command to run along with arguments. + _cwd (string): Current working directory. + _exit_on_fail (bool): If it should exit on failure. + _output_file (): + Returns: + (string, string, int): Returns a tuple of stdout, stderr, and command return code if _output_file= None + Otherwise stdout, stderr are empty. + """ + print("Running: " + " ".join(command_to_run)) + command_stdout = "" + command_stderr = "" + return_code = 1 + + output_type = subprocess.STDOUT if _output_file else subprocess.PIPE + with subprocess.Popen(command_to_run, stdout=subprocess.PIPE, stderr=output_type, cwd=_cwd) as proc: + + # For long running command, continuously print the output + if _output_file: + while True: + with open(_output_file, 'a') as of: + output = proc.stdout.readline() + if proc.poll() is not None: + break + if output: + output_str = output.strip().decode("utf-8") + print(output_str) + of.write(output_str + "\n") + else: + command_stdout, command_stderr = proc.communicate() + if len(command_stdout) > 0: + print(command_stdout.decode("utf-8")) + if len(command_stderr) > 0: + print(command_stderr.decode("utf-8")) + + return_code = proc.returncode + if _exit_on_fail and return_code != 0: + print("Command failed. Exiting.") + sys.exit(1) + return command_stdout, command_stderr, return_code + + +def copy_directory(src_path, dst_path, verbose_output=False, verbose_copy=False, verbose_skip=False, match_func=lambda path: True): + """Copies directory in 'src_path' to 'dst_path' maintaining the directory + structure. https://docs.python.org/3.5/library/shutil.html#shutil.copytree can't + be used in this case because it expects the destination directory should not + exist, however we do call copy_directory() to copy files to same destination directory. + + Args: + src_path (string): Path of source directory that need to be copied. + dst_path (string): Path where directory should be copied. + verbose_output (bool): True to print every copied or skipped file or error. + verbose_copy (bool): True to print every copied file + verbose_skip (bool): True to print every skipped file. + match_func (str -> bool) : Criteria function determining if a file is copied. + """ + display_copy = verbose_output or verbose_copy + display_skip = verbose_output or verbose_skip + for item in os.listdir(src_path): + src_item = os.path.join(src_path, item) + dst_item = os.path.join(dst_path, item) + if os.path.isdir(src_item): + copy_directory(src_item, dst_item, verbose_output, verbose_copy, verbose_skip, match_func) + else: + try: + if match_func(src_item): + if display_copy: + print("> copy {0} => {1}".format(src_item, dst_item)) + try: + if not os.path.exists(dst_path): + os.makedirs(dst_path) + shutil.copy2(src_item, dst_item) + except PermissionError as pe_error: + print('Ignoring PermissionError: {0}'.format(pe_error)) + else: + if display_skip: + print("> skipping {0}".format(src_item)) + except UnicodeEncodeError: + # Should this always be displayed? Or is it too verbose somehow? + if verbose_output: + print("> Got UnicodeEncodeError") + + +def copy_files(src_path, dst_path, file_names): + """Copy files from 'file_names' list from 'src_path' to 'dst_path'. + It retains the original directory structure of src_path. + + Args: + src_path (string): Source directory from where files are copied. + dst_path (string): Destination directory where files to be copied. + file_names ([string]): List of full path file names to be copied. + """ + + print('### Copying below files from {0} to {1}:'.format(src_path, dst_path)) + print('') + print(os.linesep.join(file_names)) + for f in file_names: + # Create same structure in dst so we don't clobber same files names present in different directories + dst_path_of_file = f.replace(src_path, dst_path) + + dst_directory = os.path.dirname(dst_path_of_file) + if not os.path.exists(dst_directory): + os.makedirs(dst_directory) + try: + shutil.copy2(f, dst_path_of_file) + except PermissionError as pe_error: + print('Ignoring PermissionError: {0}'.format(pe_error)) + + +def remove_prefix(text, prefix): + """ Helper function to remove a prefix `prefix` from a string `text` + """ + if text.startswith(prefix): + return text[len(prefix):] + return text + + +def is_zero_length_file(fpath): + """ Determine if a file system path refers to an existing file that is zero length + + Args: + fpath (str) : file system path to test + + Returns: + bool : true if the path is an existing file that is zero length + """ + return os.path.isfile(fpath) and os.stat(fpath).st_size == 0 + + +def is_nonzero_length_file(fpath): + """ Determine if a file system path refers to an existing file that is non-zero length + + Args: + fpath (str) : file system path to test + + Returns: + bool : true if the path is an existing file that is non-zero length + """ + return os.path.isfile(fpath) and os.stat(fpath).st_size != 0 + + +def make_safe_filename(s): + """ Turn a string into a string usable as a single file name component; replace illegal characters with underscores. + + Args: + s (str) : string to convert to a file name + + Returns: + (str) : The converted string + """ + def safe_char(c): + if c.isalnum(): + return c + else: + return "_" + return "".join(safe_char(c) for c in s) + + +def find_in_path(name, pathlist, match_func=os.path.isfile): + """ Find a name (e.g., directory name or file name) in the file system by searching the directories + in a `pathlist` (e.g., PATH environment variable that has been semi-colon + split into a list). + + Args: + name (str) : name to search for + pathlist (list) : list of directory names to search + match_func (str -> bool) : determines if the name is a match + + Returns: + (str) The pathname of the object, or None if not found. + """ + for dirname in pathlist: + candidate = os.path.join(dirname, name) + if match_func(candidate): + return candidate + return None + + +def find_file(filename, pathlist): + """ Find a filename in the file system by searching the directories + in a `pathlist` (e.g., PATH environment variable that has been semi-colon + split into a list). + + Args: + filename (str) : name to search for + pathlist (list) : list of directory names to search + + Returns: + (str) The pathname of the object, or None if not found. + """ + return find_in_path(filename, pathlist) + + +def find_dir(dirname, pathlist): + """ Find a directory name in the file system by searching the directories + in a `pathlist` (e.g., PATH environment variable that has been semi-colon + split into a list). + + Args: + dirname (str) : name to search for + pathlist (list) : list of directory names to search + + Returns: + (str) The pathname of the object, or None if not found. + """ + return find_in_path(dirname, pathlist, match_func=os.path.isdir) + + +def create_unique_directory_name(root_directory, base_name): + """ Create a unique directory name by joining `root_directory` and `base_name`. + If this name already exists, append ".1", ".2", ".3", etc., to the final + name component until the full directory name is not found. + + Args: + root_directory (str) : root directory in which a new directory will be created + base_name (str) : the base name of the new directory name component to be added + + Returns: + (str) The full absolute path of the new directory. The directory has been created. + """ + root_directory = os.path.abspath(root_directory) + full_path = os.path.join(root_directory, base_name) + + count = 1 + while os.path.isdir(full_path): + new_full_path = os.path.join(root_directory, base_name + "." + str(count)) + count += 1 + full_path = new_full_path + + os.makedirs(full_path) + return full_path + + +def create_unique_file_name(directory, base_name, extension): + """ Create a unique file name in the specified directory by joining `base_name` and `extension`. + If this name already exists, append ".1", ".2", ".3", etc., to the `base_name` + name component until the full file name is not found. + + Args: + directory (str) : directory in which a new file will be created + base_name (str) : the base name of the new filename to be added + extension (str) : the filename extension of the new filename to be added + + Returns: + (str) The full absolute path of the new filename. + """ + directory = os.path.abspath(directory) + if not os.path.isdir(directory): + try: + os.makedirs(directory) + except Exception as exception: + logging.critical(exception) + raise exception + + full_path = os.path.join(directory, base_name + "." + extension) + + count = 1 + while os.path.isfile(full_path): + new_full_path = os.path.join(directory, base_name + "." + str(count) + "." + extension) + count += 1 + full_path = new_full_path + + return full_path + + +def get_files_from_path(path, match_func=lambda path: True): + """ Return all files in a directory tree matching a criteria. + + Args: + path (str) : Either a single file to include, or a directory to traverse looking for matching + files. + match_func (str -> bool) : Criteria function determining if a file is added to the list + + Returns: + Array of absolute paths of matching files + """ + if not(os.path.isdir(path) or os.path.isfile(path)): + logging.warning("Warning: \"%s\" is not a file or directory", path) + return [] + + path = os.path.abspath(path) + + files = [] + + if os.path.isdir(path): + for item in os.listdir(path): + files += get_files_from_path(os.path.join(path, item), match_func) + else: + if match_func(path): + files.append(path) + + return files + + +def is_url(path): + """ Return True if this looks like a URL + + Args: + path (str) : name to check + + Returns: + True it it looks like an URL, False otherwise. + """ + # Probably could use urllib.parse to be more precise. + # If it doesn't look like an URL, treat it like a file, possibly a UNC file. + return path.lower().startswith("http:") or path.lower().startswith("https:") + +################################################################################ +## +## Azure Storage functions +## +################################################################################ + +# Decide if we're going to download and enumerate Azure Storage using anonymous +# read access and urllib functions (False), or Azure APIs including authentication (True). +authenticate_using_azure = False + +# Have we checked whether we have the Azure Storage libraries yet? +azure_storage_libraries_check = False + + +def require_azure_storage_libraries(need_azure_storage_blob=True, need_azure_identity=True): + """ Check for and import the Azure libraries. + We do this lazily, only when we decide we're actually going to need them. + Once we've done it once, we don't do it again. + + For this to work for cross-module usage, after you call this function, you need to add a line like: + from jitutil import BlobClient, AzureCliCredential + naming all the types you want to use. + + The full set of types this function loads: + BlobServiceClient, BlobClient, ContainerClient, AzureCliCredential + """ + global azure_storage_libraries_check, BlobServiceClient, BlobClient, ContainerClient, AzureCliCredential + + if azure_storage_libraries_check: + return + + azure_storage_libraries_check = True + + azure_storage_blob_import_ok = True + if need_azure_storage_blob: + try: + from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient + except: + azure_storage_blob_import_ok = False + + azure_identity_import_ok = True + if need_azure_identity: + try: + from azure.identity import AzureCliCredential + except: + azure_identity_import_ok = False + + if not azure_storage_blob_import_ok or not azure_identity_import_ok: + logging.error("One or more required Azure Storage packages is missing.") + logging.error("") + logging.error("Please install:") + logging.error(" pip install azure-storage-blob azure-identity") + logging.error("or (Windows):") + logging.error(" py -3 -m pip install azure-storage-blob azure-identity") + logging.error("See also https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-python") + raise RuntimeError("Missing Azure Storage package.") + + # The Azure packages spam all kinds of output to the logging channels. + # Restrict this to only ERROR and CRITICAL. + for name in logging.Logger.manager.loggerDict.keys(): + if 'azure' in name: + logging.getLogger(name).setLevel(logging.ERROR) + + +def report_azure_error(): + """ Report an Azure error + """ + logging.error("A problem occurred accessing Azure. Are you properly authenticated using the Azure CLI?") + logging.error("Install the Azure CLI from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli.") + logging.error("Then log in to Azure using `az login`.") + + +def download_with_azure(uri, target_location, fail_if_not_found=True): + """ Do an URI download using Azure blob storage API. Compared to urlretrieve, + there is no progress hook. Maybe if converted to use the async APIs we + could have some kind of progress? + + Args: + uri (string) : URI to download + target_location (string) : local path to put the downloaded object + fail_if_not_found (bool) : if True, fail if a download fails due to file not found (HTTP error 404). + Otherwise, ignore the failure. + + Returns True if successful, False on failure + """ + + require_azure_storage_libraries() + + logging.info("Download: %s -> %s", uri, target_location) + + ok = True + az_credential = AzureCliCredential() + blob = BlobClient.from_blob_url(uri, credential=az_credential) + with open(target_location, "wb") as my_blob: + try: + download_stream = blob.download_blob(retry_total=0) + try: + my_blob.write(download_stream.readall()) + except Exception as ex1: + logging.error("Error writing data to %s", target_location) + report_azure_error() + ok = False + except Exception as ex2: + logging.error("Azure error downloading %s", uri) + report_azure_error() + ok = False + + if not ok and fail_if_not_found: + raise RuntimeError("Azure failed to download") + return ok + +################################################################################ +## +## File downloading functions +## +################################################################################ + + +def download_progress_hook(count, block_size, total_size): + """ A hook for urlretrieve to report download progress + + Args: + count (int) : current block index + block_size (int) : size of a block + total_size (int) : total size of a payload + """ + sys.stdout.write("\rDownloading {0:.1f}/{1:.1f} MB...".format(min(count * block_size, total_size) / 1024 / 1024, total_size / 1024 / 1024)) + sys.stdout.flush() + + +def download_with_progress_urlretrieve(uri, target_location, fail_if_not_found=True, display_progress=True): + """ Do an URI download using urllib.request.urlretrieve with a progress hook. + + Outputs messages using the `logging` package. + + Args: + uri (string) : URI to download + target_location (string) : local path to put the downloaded object + fail_if_not_found (bool) : if True, fail if a download fails due to file not found (HTTP error 404). + Otherwise, ignore the failure. + display_progress (bool) : if True, display download progress (for URL downloads). Otherwise, do not. + + Returns True if successful, False on failure + """ + logging.info("Download: %s -> %s", uri, target_location) + + ok = True + try: + progress_display_method = download_progress_hook if display_progress else None + urllib.request.urlretrieve(uri, target_location, reporthook=progress_display_method) + except urllib.error.HTTPError as httperror: + if (httperror == 404) and fail_if_not_found: + logging.error("HTTP 404 error") + raise httperror + ok = False + + if display_progress: + sys.stdout.write("\n") # Add newline after progress hook + + return ok + + +def download_one_url(uri, target_location, fail_if_not_found=True, is_azure_storage=False, display_progress=True): + """ Do an URI download using urllib.request.urlretrieve or Azure Storage APIs. + + Args: + uri (string) : URI to download + target_location (string) : local path to put the downloaded object + fail_if_not_found (bool) : if True, fail if a download fails due to file not found (HTTP error 404). + Otherwise, ignore the failure. + display_progress (bool) : if True, display download progress (for URL downloads). Otherwise, do not. + + Returns True if successful, False on failure + """ + if is_azure_storage and authenticate_using_azure: + return download_with_azure(uri, target_location, fail_if_not_found) + else: + return download_with_progress_urlretrieve(uri, target_location, fail_if_not_found, display_progress) + + +def download_files(paths, target_dir, verbose=True, fail_if_not_found=True, is_azure_storage=False, display_progress=True): + """ Download a set of files, specified as URLs or paths (such as Windows UNC paths), + to a target directory. If a file is a .ZIP file, then uncompress the file and + copy all its contents to the target directory. + + Args: + paths (list): the URLs and paths to download + target_dir (str): target directory where files are copied. It will be created if it doesn't already exist. + verbose (bool): if True, do verbose logging. + fail_if_not_found (bool): if True, fail if a download fails due to file not found (HTTP error 404). + Otherwise, ignore the failure. + is_azure_storage (bool): if True, treat any URL as an Azure Storage URL + display_progress (bool): if True, display download progress (for URL downloads). Otherwise, do not. + + Returns: + list of full paths of local filenames of downloaded files in the target directory + """ + + if len(paths) == 0: + logging.warning("No files specified to download") + return None + + if verbose: + logging.info("Downloading:") + for item_path in paths: + logging.info(" %s", item_path) + + # Create the target directory now, if it doesn't already exist. + target_dir = os.path.abspath(target_dir) + if not os.path.isdir(target_dir): + os.makedirs(target_dir) + + local_paths = [] + + # In case we'll need a temp directory for ZIP file processing, create it first. + with TempDir() as temp_location: + for item_path in paths: + is_item_url = is_url(item_path) + item_name = item_path.split("/")[-1] if is_item_url else os.path.basename(item_path) + + if item_path.lower().endswith(".zip"): + # Delete everything in the temp_location (from previous iterations of this loop, so previous URL downloads). + temp_location_items = [os.path.join(temp_location, item) for item in os.listdir(temp_location)] + for item in temp_location_items: + if os.path.isdir(item): + shutil.rmtree(item) + else: + os.remove(item) + + download_path = os.path.join(temp_location, item_name) + if is_item_url: + ok = download_one_url(item_path, download_path, fail_if_not_found=fail_if_not_found, is_azure_storage=is_azure_storage, display_progress=display_progress) + if not ok: + continue + else: + if fail_if_not_found or os.path.isfile(item_path): + if verbose: + logging.info("Download: %s -> %s", item_path, download_path) + shutil.copy2(item_path, download_path) + + if verbose: + logging.info("Uncompress %s", download_path) + with zipfile.ZipFile(download_path, "r") as file_handle: + file_handle.extractall(temp_location) + + # Copy everything that was extracted to the target directory. + copy_directory(temp_location, target_dir, verbose_copy=verbose, match_func=lambda path: not path.endswith(".zip")) + + # The caller wants to know where all the files ended up, so compute that. + for dirpath, _, files in os.walk(temp_location, topdown=True): + for file_name in files: + if not file_name.endswith(".zip"): + full_file_path = os.path.join(dirpath, file_name) + target_path = full_file_path.replace(temp_location, target_dir) + local_paths.append(target_path) + else: + # Not a zip file; download directory to target directory + download_path = os.path.join(target_dir, item_name) + if is_item_url: + ok = download_one_url(item_path, download_path, fail_if_not_found=fail_if_not_found, is_azure_storage=is_azure_storage, display_progress=display_progress) + if not ok: + continue + else: + if fail_if_not_found or os.path.isfile(item_path): + if verbose: + logging.info("Download: %s -> %s", item_path, download_path) + shutil.copy2(item_path, download_path) + local_paths.append(download_path) + + return local_paths diff --git a/src/coreclr/scripts/superpmi-asmdiffs.proj b/src/coreclr/scripts/superpmi-asmdiffs.proj new file mode 100644 index 00000000000000..aef782d769cb9e --- /dev/null +++ b/src/coreclr/scripts/superpmi-asmdiffs.proj @@ -0,0 +1,73 @@ + + + + + + + %HELIX_PYTHONPATH% + %HELIX_CORRELATION_PAYLOAD% + %HELIX_WORKITEM_UPLOAD_ROOT% + + $(BUILD_SOURCESDIRECTORY)\artifacts\helixresults + $(Python) $(ProductDirectory)\superpmi_asmdiffs.py -base_jit_directory $(ProductDirectory)\base -diff_jit_directory $(ProductDirectory)\diff -log_directory $(SuperpmiLogsLocation) + 1:00 + + + + false + false + $(_Creator) + $(_HelixAccessToken) + $(_HelixBuild) + $(_HelixSource) + $(_HelixTargetQueues) + $(_HelixType) + + + + + %(Identity) + + + + + + + + + + + + + + + + + + $(WorkItemCommand) -arch %(HelixWorkItem.Architecture) -platform %(HelixWorkItem.Platform) + $(WorkItemTimeout) + superpmi_%(HelixWorkItem.Platform)_%(HelixWorkItem.Architecture).log;superpmi_download_%(HelixWorkItem.Platform)_%(HelixWorkItem.Architecture).log;superpmi_diff_summary_%(HelixWorkItem.Platform)_%(HelixWorkItem.Architecture).md;Asmdiffs_%(HelixWorkItem.Platform)_%(HelixWorkItem.Architecture).zip + + + diff --git a/src/coreclr/scripts/superpmi.py b/src/coreclr/scripts/superpmi.py index e919117d8c39ad..267879c5a9eb54 100755 --- a/src/coreclr/scripts/superpmi.py +++ b/src/coreclr/scripts/superpmi.py @@ -36,13 +36,13 @@ import zipfile from coreclr_arguments import * +from jitutil import TempDir, ChangeDir, remove_prefix, is_zero_length_file, is_nonzero_length_file, \ + make_safe_filename, find_file, download_one_url, download_files, report_azure_error, \ + require_azure_storage_libraries, authenticate_using_azure, \ + create_unique_directory_name, create_unique_file_name, get_files_from_path locale.setlocale(locale.LC_ALL, '') # Use '' for auto, or force e.g. to 'en_US.UTF-8' -# Decide if we're going to download and enumerate Azure Storage using anonymous -# read access and urllib functions (False), or Azure APIs including authentication (True). -authenticate_using_azure = False - ################################################################################ # Azure Storage information ################################################################################ @@ -237,8 +237,9 @@ core_root_parser.add_argument("-log_level", help=log_level_help) core_root_parser.add_argument("-log_file", help=log_file_help) core_root_parser.add_argument("-spmi_location", help=spmi_location_help) +core_root_parser.add_argument("--no_progress", action="store_true", help=download_no_progress_help) -# Create a set of arguments common to target specification. Used for replay, upload, upload-private, download, list-collections. +# Create a set of arguments common to target specification. Used for collect, replay, asmdiffs, upload, upload-private, download, list-collections. target_parser = argparse.ArgumentParser(add_help=False) @@ -311,13 +312,13 @@ asm_diff_parser.add_argument("-git_hash", help="Use this git hash as the current hash for use to find a baseline JIT. Defaults to current git hash of source tree.") asm_diff_parser.add_argument("-base_git_hash", help="Use this git hash as the baseline JIT hash. Default: search for the baseline hash.") asm_diff_parser.add_argument("--diff_jit_dump", action="store_true", help="Generate JitDump output for diffs. Default: only generate asm, not JitDump.") -asm_diff_parser.add_argument("-temp_dir", help="Specify a temporary directory used for a previous ASM diffs run (for which --skip_cleanup was used) to view the results. The replay command is skipped.") asm_diff_parser.add_argument("--gcinfo", action="store_true", help="Include GC info in disassembly (sets COMPlus_JitGCDump/COMPlus_NgenGCDump; requires instructions to be prefixed by offsets).") asm_diff_parser.add_argument("--debuginfo", action="store_true", help="Include debug info after disassembly (sets COMPlus_JitDebugDump/COMPlus_NgenDebugDump).") asm_diff_parser.add_argument("-base_jit_option", action="append", help="Option to pass to the baseline JIT. Format is key=value, where key is the option name without leading COMPlus_...") asm_diff_parser.add_argument("-diff_jit_option", action="append", help="Option to pass to the diff JIT. Format is key=value, where key is the option name without leading COMPlus_...") asm_diff_parser.add_argument("-tag", help="Specify a word to add to the directory name where the asm diffs will be placed") asm_diff_parser.add_argument("-metrics", action="append", help="Metrics option to pass to jit-analyze. Can be specified multiple times, or pass comma-separated values.") +asm_diff_parser.add_argument("-retainOnlyTopFiles", action="store_true", help="Retain only top .dasm files with largest improvements or regressions and delete remaining files.") # subparser for upload upload_parser = subparsers.add_parser("upload", description=upload_description, parents=[core_root_parser, target_parser]) @@ -342,7 +343,6 @@ download_parser.add_argument("-jit_ee_version", help=jit_ee_version_help) download_parser.add_argument("--skip_cleanup", action="store_true", help=skip_cleanup_help) download_parser.add_argument("--force_download", action="store_true", help=force_download_help) -download_parser.add_argument("--no_progress", action="store_true", help=download_no_progress_help) download_parser.add_argument("-mch_files", metavar="MCH_FILE", nargs='+', help=replay_mch_files_help) download_parser.add_argument("-private_store", action="append", help=private_store_help) @@ -363,345 +363,6 @@ ################################################################################ # Helper functions ################################################################################ - -def remove_prefix(text, prefix): - """ Helper method to remove a prefix `prefix` from a string `text` - """ - if text.startswith(prefix): - return text[len(prefix):] - return text - -# Have we checked whether we have the Azure Storage libraries yet? -azure_storage_libraries_check = False - - -def require_azure_storage_libraries(need_azure_storage_blob=True, need_azure_identity=True): - """ Check for and import the Azure libraries. - We do this lazily, only when we decide we're actually going to need them. - Once we've done it once, we don't do it again. - """ - global azure_storage_libraries_check, BlobServiceClient, BlobClient, ContainerClient, AzureCliCredential - - if azure_storage_libraries_check: - return - - azure_storage_libraries_check = True - - azure_storage_blob_import_ok = True - if need_azure_storage_blob: - try: - from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient - except: - azure_storage_blob_import_ok = False - - azure_identity_import_ok = True - if need_azure_identity: - try: - from azure.identity import AzureCliCredential - except: - azure_identity_import_ok = False - - if not azure_storage_blob_import_ok or not azure_identity_import_ok: - logging.error("One or more required Azure Storage packages is missing.") - logging.error("") - logging.error("Please install:") - logging.error(" pip install azure-storage-blob azure-identity") - logging.error("or (Windows):") - logging.error(" py -3 -m pip install azure-storage-blob azure-identity") - logging.error("See also https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-python") - raise RuntimeError("Missing Azure Storage package.") - - # The Azure packages spam all kinds of output to the logging channels. - # Restrict this to only ERROR and CRITICAL. - for name in logging.Logger.manager.loggerDict.keys(): - if 'azure' in name: - logging.getLogger(name).setLevel(logging.ERROR) - - -def download_progress_hook(count, block_size, total_size): - """ A hook for urlretrieve to report download progress - - Args: - count (int) : current block index - block_size (int) : size of a block - total_size (int) : total size of a payload - """ - sys.stdout.write("\rDownloading {0:.1f}/{1:.1f} MB...".format(min(count * block_size, total_size) / 1024 / 1024, total_size / 1024 / 1024)) - sys.stdout.flush() - - -def download_with_progress_urlretrieve(uri, target_location, fail_if_not_found=True, display_progress=True): - """ Do an URI download using urllib.request.urlretrieve with a progress hook. - - Args: - uri (string) : URI to download - target_location (string) : local path to put the downloaded object - fail_if_not_found (bool) : if True, fail if a download fails due to file not found (HTTP error 404). - Otherwise, ignore the failure. - - Returns True if successful, False on failure - """ - logging.info("Download: %s -> %s", uri, target_location) - - ok = True - try: - progress_display_method = download_progress_hook if display_progress else None - urllib.request.urlretrieve(uri, target_location, reporthook=progress_display_method) - except urllib.error.HTTPError as httperror: - if (httperror == 404) and fail_if_not_found: - logging.error("HTTP 404 error") - raise httperror - ok = False - - sys.stdout.write("\n") # Add newline after progress hook - return ok - - -def report_azure_error(): - """ Report an Azure error - """ - logging.error("A problem occurred accessing Azure. Are you properly authenticated using the Azure CLI?") - logging.error("Install the Azure CLI from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli.") - logging.error("Then log in to Azure using `az login`.") - - -def download_with_azure(uri, target_location, fail_if_not_found=True): - """ Do an URI download using Azure blob storage API. Compared to urlretrieve, - there is no progress hook. Maybe if converted to use the async APIs we - could have some kind of progress? - - Args: - uri (string) : URI to download - target_location (string) : local path to put the downloaded object - fail_if_not_found (bool) : if True, fail if a download fails due to file not found (HTTP error 404). - Otherwise, ignore the failure. - - Returns True if successful, False on failure - """ - - require_azure_storage_libraries() - - logging.info("Download: %s -> %s", uri, target_location) - - ok = True - az_credential = AzureCliCredential() - blob = BlobClient.from_blob_url(uri, credential=az_credential) - with open(target_location, "wb") as my_blob: - try: - download_stream = blob.download_blob(retry_total=0) - try: - my_blob.write(download_stream.readall()) - except Exception as ex1: - logging.error("Error writing data to %s", target_location) - report_azure_error() - ok = False - except Exception as ex2: - logging.error("Azure error downloading %s", uri) - report_azure_error() - ok = False - - if not ok and fail_if_not_found: - raise RuntimeError("Azure failed to download") - return ok - - -def download_one_url(uri, target_location, fail_if_not_found=True, display_progress=True): - """ Do an URI download using urllib.request.urlretrieve or Azure Storage APIs. - - Args: - uri (string) : URI to download - target_location (string) : local path to put the downloaded object - fail_if_not_found (bool) : if True, fail if a download fails due to file not found (HTTP error 404). - Otherwise, ignore the failure. - - Returns True if successful, False on failure - """ - if authenticate_using_azure: - return download_with_azure(uri, target_location, fail_if_not_found) - else: - return download_with_progress_urlretrieve(uri, target_location, fail_if_not_found, display_progress) - - -def is_zero_length_file(fpath): - """ Determine if a file system path refers to an existing file that is zero length - - Args: - fpath (str) : file system path to test - - Returns: - bool : true if the path is an existing file that is zero length - """ - return os.path.isfile(fpath) and os.stat(fpath).st_size == 0 - - -def is_nonzero_length_file(fpath): - """ Determine if a file system path refers to an existing file that is non-zero length - - Args: - fpath (str) : file system path to test - - Returns: - bool : true if the path is an existing file that is non-zero length - """ - return os.path.isfile(fpath) and os.stat(fpath).st_size != 0 - - -def make_safe_filename(s): - """ Turn a string into a string usable as a single file name component; replace illegal characters with underscores. - - Args: - s (str) : string to convert to a file name - - Returns: - (str) : The converted string - """ - def safe_char(c): - if c.isalnum(): - return c - else: - return "_" - return "".join(safe_char(c) for c in s) - - -def find_in_path(name, pathlist, match_func=os.path.isfile): - """ Find a name (e.g., directory name or file name) in the file system by searching the directories - in a `pathlist` (e.g., PATH environment variable that has been semi-colon - split into a list). - - Args: - name (str) : name to search for - pathlist (list) : list of directory names to search - match_func (str -> bool) : determines if the name is a match - - Returns: - (str) The pathname of the object, or None if not found. - """ - for dirname in pathlist: - candidate = os.path.join(dirname, name) - if match_func(candidate): - return candidate - return None - - -def find_file(filename, pathlist): - """ Find a filename in the file system by searching the directories - in a `pathlist` (e.g., PATH environment variable that has been semi-colon - split into a list). - - Args: - filename (str) : name to search for - pathlist (list) : list of directory names to search - - Returns: - (str) The pathname of the object, or None if not found. - """ - return find_in_path(filename, pathlist) - - -def find_dir(dirname, pathlist): - """ Find a directory name in the file system by searching the directories - in a `pathlist` (e.g., PATH environment variable that has been semi-colon - split into a list). - - Args: - dirname (str) : name to search for - pathlist (list) : list of directory names to search - - Returns: - (str) The pathname of the object, or None if not found. - """ - return find_in_path(dirname, pathlist, match_func=os.path.isdir) - - -def create_unique_directory_name(root_directory, base_name): - """ Create a unique directory name by joining `root_directory` and `base_name`. - If this name already exists, append ".1", ".2", ".3", etc., to the final - name component until the full directory name is not found. - - Args: - root_directory (str) : root directory in which a new directory will be created - base_name (str) : the base name of the new directory name component to be added - - Returns: - (str) The full absolute path of the new directory. The directory has been created. - """ - - root_directory = os.path.abspath(root_directory) - full_path = os.path.join(root_directory, base_name) - - count = 1 - while os.path.isdir(full_path): - new_full_path = os.path.join(root_directory, base_name + "." + str(count)) - count += 1 - full_path = new_full_path - - os.makedirs(full_path) - return full_path - - -def create_unique_file_name(directory, base_name, extension): - """ Create a unique file name in the specified directory by joining `base_name` and `extension`. - If this name already exists, append ".1", ".2", ".3", etc., to the `base_name` - name component until the full file name is not found. - - Args: - directory (str) : directory in which a new file will be created - base_name (str) : the base name of the new filename to be added - extension (str) : the filename extension of the new filename to be added - - Returns: - (str) The full absolute path of the new filename. - """ - - directory = os.path.abspath(directory) - if not os.path.isdir(directory): - try: - os.makedirs(directory) - except Exception as exception: - logging.critical(exception) - raise exception - - full_path = os.path.join(directory, base_name + "." + extension) - - count = 1 - while os.path.isfile(full_path): - new_full_path = os.path.join(directory, base_name + "." + str(count) + "." + extension) - count += 1 - full_path = new_full_path - - return full_path - - -def get_files_from_path(path, match_func=lambda path: True): - """ Return all files in a directory tree matching a criteria. - - Args: - path (str) : Either a single file to include, or a directory to traverse looking for matching - files. - match_func (str -> bool) : Criteria function determining if a file is added to the list - - Returns: - Array of absolute paths of matching files - """ - - if not(os.path.isdir(path) or os.path.isfile(path)): - logging.warning("Warning: \"%s\" is not a file or directory", path) - return [] - - path = os.path.abspath(path) - - files = [] - - if os.path.isdir(path): - for item in os.listdir(path): - files += get_files_from_path(os.path.join(path, item), match_func) - else: - if match_func(path): - files.append(path) - - return files - - def run_and_log(command, log_level=logging.DEBUG): """ Return a command and log its output to the debug logger @@ -788,19 +449,6 @@ def create_artifacts_base_name(coreclr_args, mch_file): return artifacts_base_name -def is_url(path): - """ Return True if this looks like a URL - - Args: - path (str) : name to check - - Returns: - True it it looks like an URL, False otherwise. - """ - # Probably could use urllib.parse to be more precise. - # If it doesn't look like an URL, treat it like a file, possibly a UNC file. - return path.lower().startswith("http:") or path.lower().startswith("https:") - def read_csv_metrics(path): """ Read a metrics summary file produced by superpmi, and return the single row containing the information as a dictionary. @@ -822,47 +470,6 @@ def read_csv_metrics(path): # Helper classes ################################################################################ - -class TempDir: - """ Class to create a temporary working directory, or use one that is passed as an argument. - - Use with: "with TempDir() as temp_dir" to change to that directory and then automatically - change back to the original working directory afterwards and remove the temporary - directory and its contents (if skip_cleanup is False). - """ - - def __init__(self, path=None, skip_cleanup=False): - self.mydir = tempfile.mkdtemp() if path is None else path - self.cwd = None - self._skip_cleanup = skip_cleanup - - def __enter__(self): - self.cwd = os.getcwd() - os.chdir(self.mydir) - return self.mydir - - def __exit__(self, exc_type, exc_val, exc_tb): - os.chdir(self.cwd) - if not self._skip_cleanup: - shutil.rmtree(self.mydir) - - -class ChangeDir: - """ Class to temporarily change to a given directory. Use with "with". - """ - - def __init__(self, mydir): - self.mydir = mydir - self.cwd = None - - def __enter__(self): - self.cwd = os.getcwd() - os.chdir(self.mydir) - - def __exit__(self, exc_type, exc_val, exc_tb): - os.chdir(self.cwd) - - class AsyncSubprocessHelper: """ Class to help with async multiprocessing tasks. """ @@ -1471,7 +1078,7 @@ def __verify_final_mch__(self): ################################################################################ -def print_superpmi_failure_code(return_code, coreclr_args): +def print_superpmi_result(return_code, coreclr_args, base_metrics, diff_metrics): """ Print a description of a superpmi return (error) code. If the return code is zero, meaning success, don't print anything. Note that Python treats process return codes (at least on Windows) as @@ -1479,8 +1086,7 @@ def print_superpmi_failure_code(return_code, coreclr_args): those return codes. """ if return_code == 0: - # Don't print anything if the code is zero, which is success. - pass + logging.info("Clean SuperPMI {} ({} contexts processed)".format("replay" if diff_metrics is None else "diff", base_metrics["Successful compiles"])) elif return_code == -1 or return_code == 4294967295: logging.error("General fatal error") elif return_code == -2 or return_code == 4294967294: @@ -1490,7 +1096,15 @@ def print_superpmi_failure_code(return_code, coreclr_args): elif return_code == 2: logging.warning("Asm diffs found") elif return_code == 3: - logging.warning("SuperPMI missing data encountered") + missing_base = int(base_metrics["Missing compiles"]) + total_contexts = int(base_metrics["Successful compiles"]) + int(base_metrics["Failing compiles"]) + + if diff_metrics is None: + logging.warning("SuperPMI encountered missing data for {} out of {} contexts".format(missing_base, total_contexts)) + else: + missing_diff = int(diff_metrics["Missing compiles"]) + logging.warning("SuperPMI encountered missing data. Missing with base JIT: {}. Missing with diff JIT: {}. Total contexts: {}.".format(missing_base, missing_diff, total_contexts)) + elif return_code == 139 and coreclr_args.host_os != "windows": logging.error("Fatal error, SuperPMI has returned SIGSEGV (segmentation fault)") else: @@ -1636,31 +1250,35 @@ def replay(self): flags = common_flags.copy() fail_mcl_file = os.path.join(temp_location, os.path.basename(mch_file) + "_fail.mcl") + metrics_summary_file = os.path.join(temp_location, os.path.basename(mch_file) + "_metrics.csv") + flags += [ - "-f", fail_mcl_file # Failing mc List + "-f", fail_mcl_file, # Failing mc List + "-metricsSummary", metrics_summary_file ] command = [self.superpmi_path] + flags + [self.jit_path, mch_file] return_code = run_and_log(command) - print_superpmi_failure_code(return_code, self.coreclr_args) - if return_code == 0: - logging.info("Clean SuperPMI replay") - else: - result = False + + metrics = read_csv_metrics(metrics_summary_file) + + print_superpmi_result(return_code, self.coreclr_args, metrics, None) + if return_code != 0: # Don't report as replay failure missing data (return code 3). # Anything else, such as compilation failure (return code 1, typically a JIT assert) will be # reported as a replay failure. if return_code != 3: + result = False files_with_replay_failures.append(mch_file) - if is_nonzero_length_file(fail_mcl_file): - # Unclean replay. Examine the contents of the fail.mcl file to dig into failures. - if return_code == 0: - logging.warning("Warning: SuperPMI returned a zero exit code, but generated a non-zero-sized mcl file") - print_fail_mcl_file_method_numbers(fail_mcl_file) - repro_base_command_line = "{} {} {}".format(self.superpmi_path, " ".join(repro_flags), self.jit_path) - artifacts_base_name = create_artifacts_base_name(self.coreclr_args, mch_file) - save_repro_mc_files(temp_location, self.coreclr_args, artifacts_base_name, repro_base_command_line) + if is_nonzero_length_file(fail_mcl_file): + # Unclean replay. Examine the contents of the fail.mcl file to dig into failures. + if return_code == 0: + logging.warning("Warning: SuperPMI returned a zero exit code, but generated a non-zero-sized mcl file") + print_fail_mcl_file_method_numbers(fail_mcl_file) + repro_base_command_line = "{} {} {}".format(self.superpmi_path, " ".join(repro_flags), self.jit_path) + artifacts_base_name = create_artifacts_base_name(self.coreclr_args, mch_file) + save_repro_mc_files(temp_location, self.coreclr_args, artifacts_base_name, repro_base_command_line) if not self.coreclr_args.skip_cleanup: if os.path.isfile(fail_mcl_file): @@ -1745,7 +1363,8 @@ def replay_with_asm_diffs(self): if self.coreclr_args.debuginfo: asm_complus_vars.update({ "COMPlus_JitDebugDump": "*", - "COMPlus_NgenDebugDump": "*" }) + "COMPlus_NgenDebugDump": "*", + "COMPlus_JitDisasmWithDebugInfo": "1" }) jit_dump_complus_vars = asm_complus_vars.copy() jit_dump_complus_vars.update({ @@ -1798,7 +1417,7 @@ def replay_with_asm_diffs(self): # List of all Markdown summary files all_md_summary_files = [] - with TempDir(self.coreclr_args.temp_dir, self.coreclr_args.skip_cleanup) as temp_location: + with TempDir(None, self.coreclr_args.skip_cleanup) as temp_location: logging.debug("") logging.debug("Temp Location: %s", temp_location) logging.debug("") @@ -1820,65 +1439,63 @@ def replay_with_asm_diffs(self): base_metrics_summary_file = os.path.join(temp_location, os.path.basename(mch_file) + "_base_metrics.csv") diff_metrics_summary_file = os.path.join(temp_location, os.path.basename(mch_file) + "_diff_metrics.csv") - # If the user passed -temp_dir, we skip the SuperPMI replay process, - # and rely on what we find from a previous run. - if self.coreclr_args.temp_dir is not None: - return_code = 1 - else: - flags = [ - "-a", # Asm diffs - "-v", "ewmi", # display errors, warnings, missing, jit info - "-f", fail_mcl_file, # Failing mc List - "-diffMCList", diff_mcl_file, # Create all of the diffs in an mcl file - "-r", os.path.join(temp_location, "repro"), # Repro name, create .mc repro files - "-baseMetricsSummary", base_metrics_summary_file, # Create summary of metrics we can use to get total code size impact - "-diffMetricsSummary", diff_metrics_summary_file, - ] - flags += altjit_asm_diffs_flags - flags += base_option_flags - flags += diff_option_flags - - if not self.coreclr_args.sequential: - flags += [ "-p" ] - - if self.coreclr_args.break_on_assert: - flags += [ "-boa" ] - - if self.coreclr_args.break_on_error: - flags += [ "-boe" ] - - if self.coreclr_args.spmi_log_file is not None: - flags += [ "-w", self.coreclr_args.spmi_log_file ] - - if self.coreclr_args.error_limit is not None: - flags += ["-failureLimit", self.coreclr_args.error_limit] - - # Change the working directory to the Core_Root we will call SuperPMI from. - # This is done to allow libcoredistools to be loaded correctly on unix - # as the loadlibrary path will be relative to the current directory. - with ChangeDir(self.coreclr_args.core_root): - command = [self.superpmi_path] + flags + [self.base_jit_path, self.diff_jit_path, mch_file] - return_code = run_and_log(command) - print_superpmi_failure_code(return_code, self.coreclr_args) - if return_code == 0: - logging.info("Clean SuperPMI diff") - else: - result = False - # Don't report as replay failure asm diffs (return code 2) or missing data (return code 3). - # Anything else, such as compilation failure (return code 1, typically a JIT assert) will be - # reported as a replay failure. - if return_code != 2 and return_code != 3: - files_with_replay_failures.append(mch_file) + flags = [ + "-a", # Asm diffs + "-v", "ewmi", # display errors, warnings, missing, jit info + "-f", fail_mcl_file, # Failing mc List + "-diffMCList", diff_mcl_file, # Create all of the diffs in an mcl file + "-r", os.path.join(temp_location, "repro"), # Repro name, create .mc repro files + "-baseMetricsSummary", base_metrics_summary_file, # Create summary of metrics we can use to get total code size impact + "-diffMetricsSummary", diff_metrics_summary_file, + ] + flags += altjit_asm_diffs_flags + flags += base_option_flags + flags += diff_option_flags + if not self.coreclr_args.sequential: + flags += [ "-p" ] + + if self.coreclr_args.break_on_assert: + flags += [ "-boa" ] + + if self.coreclr_args.break_on_error: + flags += [ "-boe" ] + + if self.coreclr_args.spmi_log_file is not None: + flags += [ "-w", self.coreclr_args.spmi_log_file ] + + if self.coreclr_args.error_limit is not None: + flags += ["-failureLimit", self.coreclr_args.error_limit] + + # Change the working directory to the Core_Root we will call SuperPMI from. + # This is done to allow libcoredistools to be loaded correctly on unix + # as the loadlibrary path will be relative to the current directory. + with ChangeDir(self.coreclr_args.core_root): + command = [self.superpmi_path] + flags + [self.base_jit_path, self.diff_jit_path, mch_file] + return_code = run_and_log(command) + + base_metrics = read_csv_metrics(base_metrics_summary_file) + diff_metrics = read_csv_metrics(diff_metrics_summary_file) + + print_superpmi_result(return_code, self.coreclr_args, base_metrics, diff_metrics) artifacts_base_name = create_artifacts_base_name(self.coreclr_args, mch_file) - if is_nonzero_length_file(fail_mcl_file): - # Unclean replay. Examine the contents of the fail.mcl file to dig into failures. - if return_code == 0: - logging.warning("Warning: SuperPMI returned a zero exit code, but generated a non-zero-sized mcl file") - print_fail_mcl_file_method_numbers(fail_mcl_file) - repro_base_command_line = "{} {} {}".format(self.superpmi_path, " ".join(altjit_asm_diffs_flags), self.diff_jit_path) - save_repro_mc_files(temp_location, self.coreclr_args, artifacts_base_name, repro_base_command_line) + if return_code != 0: + + # Don't report as replay failure asm diffs (return code 2) or missing data (return code 3). + # Anything else, such as compilation failure (return code 1, typically a JIT assert) will be + # reported as a replay failure. + if return_code != 2 and return_code != 3: + result = False + files_with_replay_failures.append(mch_file) + + if is_nonzero_length_file(fail_mcl_file): + # Unclean replay. Examine the contents of the fail.mcl file to dig into failures. + if return_code == 0: + logging.warning("Warning: SuperPMI returned a zero exit code, but generated a non-zero-sized mcl file") + print_fail_mcl_file_method_numbers(fail_mcl_file) + repro_base_command_line = "{} {} {}".format(self.superpmi_path, " ".join(altjit_asm_diffs_flags), self.diff_jit_path) + save_repro_mc_files(temp_location, self.coreclr_args, artifacts_base_name, repro_base_command_line) # There were diffs. Go through each method that created diffs and # create a base/diff asm file with diffable asm. In addition, create @@ -1983,16 +1600,13 @@ async def create_one_artifact(jit_path: str, location: str, flags) -> str: logging.debug(item) logging.debug("") - base_metrics = read_csv_metrics(base_metrics_summary_file) - diff_metrics = read_csv_metrics(diff_metrics_summary_file) - - if base_metrics is not None and "Code bytes" in base_metrics and diff_metrics is not None and "Code bytes" in diff_metrics: - base_bytes = int(base_metrics["Code bytes"]) - diff_bytes = int(diff_metrics["Code bytes"]) - logging.info("Total Code bytes of base: {}".format(base_bytes)) - logging.info("Total Code bytes of diff: {}".format(diff_bytes)) + if base_metrics is not None and diff_metrics is not None: + base_bytes = int(base_metrics["Diffed code bytes"]) + diff_bytes = int(diff_metrics["Diffed code bytes"]) + logging.info("Total bytes of base: {}".format(base_bytes)) + logging.info("Total bytes of diff: {}".format(diff_bytes)) delta_bytes = diff_bytes - base_bytes - logging.info("Total Code bytes of delta: {} ({:.2%} of base)".format(delta_bytes, delta_bytes / base_bytes)) + logging.info("Total bytes of delta: {} ({:.2%} of base)".format(delta_bytes, delta_bytes / base_bytes)) try: current_text_diff = text_differences.get_nowait() @@ -2004,11 +1618,11 @@ async def create_one_artifact(jit_path: str, location: str, flags) -> str: if current_text_diff is not None: logging.info("Textual differences found in generated asm.") - # Find jit-analyze.bat/sh on PATH, if it exists, then invoke it. + # Find jit-analyze on PATH, if it exists, then invoke it. ran_jit_analyze = False path_var = os.environ.get("PATH") if path_var is not None: - jit_analyze_file = "jit-analyze.bat" if platform.system() == "Windows" else "jit-analyze.sh" + jit_analyze_file = "jit-analyze.exe" if platform.system() == "Windows" else "jit-analyze" jit_analyze_path = find_file(jit_analyze_file, path_var.split(os.pathsep)) if jit_analyze_path is not None: # It appears we have a built jit-analyze on the path, so try to run it. @@ -2016,6 +1630,8 @@ async def create_one_artifact(jit_path: str, location: str, flags) -> str: summary_file_info = ( mch_file, md_summary_file ) all_md_summary_files.append(summary_file_info) command = [ jit_analyze_path, "--md", md_summary_file, "-r", "--base", base_asm_location, "--diff", diff_asm_location ] + if self.coreclr_args.retainOnlyTopFiles: + command += [ "--retainOnlyTopFiles" ] if self.coreclr_args.metrics: command += [ "--metrics", ",".join(self.coreclr_args.metrics) ] elif base_bytes is not None and diff_bytes is not None: @@ -2044,6 +1660,15 @@ async def create_one_artifact(jit_path: str, location: str, flags) -> str: else: logging.warning("No textual differences found in generated JitDump. Is this an issue with coredistools?") + if base_metrics is not None and diff_metrics is not None: + missing_base = int(base_metrics["Missing compiles"]) + missing_diff = int(diff_metrics["Missing compiles"]) + total_contexts = int(base_metrics["Successful compiles"]) + int(base_metrics["Failing compiles"]) + + if missing_base > 0 or missing_diff > 0: + logging.warning("Warning: SuperPMI encountered missing data during the diff. The diff summary printed above may be misleading.") + logging.warning("Missing with base JIT: {}. Missing with diff JIT: {}. Total contexts: {}.".format(missing_base, missing_diff, total_contexts)) + ################################################################################################ end of processing asm diffs (if is_nonzero_length_file(diff_mcl_file)... if not self.coreclr_args.skip_cleanup: @@ -2147,7 +1772,8 @@ def determine_coredis_tools(coreclr_args): logging.warning("Warning: Core_Root does not exist at \"%s\"; creating it now", coreclr_args.core_root) os.makedirs(coreclr_args.core_root) coredistools_uri = az_blob_storage_superpmi_container_uri + "/libcoredistools/{}-{}/{}".format(coreclr_args.host_os.lower(), coreclr_args.arch.lower(), coredistools_dll_name) - download_one_url(coredistools_uri, coredistools_location) + skip_progress = hasattr(coreclr_args, 'no_progress') and coreclr_args.no_progress + download_one_url(coredistools_uri, coredistools_location, is_azure_storage=True, display_progress=not skip_progress) assert os.path.isfile(coredistools_location) return coredistools_location @@ -2183,7 +1809,8 @@ def determine_pmi_location(coreclr_args): logging.info("Using PMI found at %s", pmi_location) else: pmi_uri = az_blob_storage_superpmi_container_uri + "/pmi/pmi.dll" - download_one_url(pmi_uri, pmi_location) + skip_progress = hasattr(coreclr_args, 'no_progress') and coreclr_args.no_progress + download_one_url(pmi_uri, pmi_location, is_azure_storage=True, display_progress=not skip_progress) assert os.path.isfile(pmi_location) return pmi_location @@ -2516,6 +2143,7 @@ def list_superpmi_collections_container_via_azure_api(path_filter=lambda unused: """ require_azure_storage_libraries() + from jitutil import ContainerClient, AzureCliCredential superpmi_container_url = az_blob_storage_superpmi_container_uri @@ -2609,7 +2237,7 @@ def filter_local_path(path): # Download all the urls at once, and add the local cache filenames to our accumulated list of local file names. skip_progress = hasattr(coreclr_args, 'no_progress') and coreclr_args.no_progress if len(urls) != 0: - local_mch_files += download_files(urls, mch_cache_dir, display_progress=not skip_progress) + local_mch_files += download_files(urls, mch_cache_dir, is_azure_storage=True, display_progress=not skip_progress) # Special case: walk the URLs list and for every ".mch" or ".mch.zip" file, check to see that either the associated ".mct" file is already # in the list, or add it to a new list to attempt to download (but don't fail the download if it doesn't exist). @@ -2620,7 +2248,7 @@ def filter_local_path(path): if mct_url not in urls: mct_urls.append(mct_url) if len(mct_urls) != 0: - local_mch_files += download_files(mct_urls, mch_cache_dir, fail_if_not_found=False, display_progress=not skip_progress) + local_mch_files += download_files(mct_urls, mch_cache_dir, fail_if_not_found=False, is_azure_storage=True, display_progress=not skip_progress) # Even though we might have downloaded MCT files, only return the set of MCH files. local_mch_files = [file for file in local_mch_files if any(file.lower().endswith(extension) for extension in [".mch"])] @@ -2716,94 +2344,7 @@ def filter_superpmi_collections(path): urls = [blob_url_prefix + path for path in paths] skip_progress = hasattr(coreclr_args, 'no_progress') and coreclr_args.no_progress - return download_files(urls, target_dir, display_progress=not skip_progress) - -def download_files(paths, target_dir, verbose=True, fail_if_not_found=True, display_progress=True): - """ Download a set of files, specified as URLs or paths (such as Windows UNC paths), - to a target directory. If a file is a .ZIP file, then uncompress the file and - copy all its contents to the target directory. - - Args: - paths (list): the URLs and paths to download - target_dir (str): target directory where files are copied. - verbse (bool): if True, do verbose logging. - fail_if_not_found (bool): if True, fail if a download fails due to file not found (HTTP error 404). - Otherwise, ignore the failure. - - Returns: - list of full paths of local filenames of downloaded files in the target directory - """ - - if len(paths) == 0: - logging.warning("No files specified to download") - return None - - if verbose: - logging.info("Downloading:") - for item_path in paths: - logging.info(" %s", item_path) - - # Create the target directory now, if it doesn't already exist. - target_dir = os.path.abspath(target_dir) - if not os.path.isdir(target_dir): - os.makedirs(target_dir) - - local_paths = [] - - # In case we'll need a temp directory for ZIP file processing, create it first. - with TempDir() as temp_location: - for item_path in paths: - is_item_url = is_url(item_path) - item_name = item_path.split("/")[-1] if is_item_url else os.path.basename(item_path) - - if item_path.lower().endswith(".zip"): - # Delete everything in the temp_location (from previous iterations of this loop, so previous URL downloads). - temp_location_items = [os.path.join(temp_location, item) for item in os.listdir(temp_location)] - for item in temp_location_items: - if os.path.isdir(item): - shutil.rmtree(item) - else: - os.remove(item) - - download_path = os.path.join(temp_location, item_name) - if is_item_url: - ok = download_one_url(item_path, download_path, fail_if_not_found, display_progress) - if not ok: - continue - else: - if fail_if_not_found or os.path.isfile(item_path): - if verbose: - logging.info("Download: %s -> %s", item_path, download_path) - shutil.copy2(item_path, download_path) - - if verbose: - logging.info("Uncompress %s", download_path) - with zipfile.ZipFile(download_path, "r") as file_handle: - file_handle.extractall(temp_location) - - # Copy everything that was extracted to the target directory. - items = [ os.path.join(temp_location, item) for item in os.listdir(temp_location) if not item.endswith(".zip") ] - for item in items: - target_path = os.path.join(target_dir, os.path.basename(item)) - if verbose: - logging.info("Copy %s -> %s", item, target_path) - shutil.copy2(item, target_dir) - local_paths.append(target_path) - else: - # Not a zip file; download directory to target directory - download_path = os.path.join(target_dir, item_name) - if is_item_url: - ok = download_one_url(item_path, download_path, fail_if_not_found, display_progress) - if not ok: - continue - else: - if fail_if_not_found or os.path.isfile(item_path): - if verbose: - logging.info("Download: %s -> %s", item_path, download_path) - shutil.copy2(item_path, download_path) - local_paths.append(download_path) - - return local_paths + return download_files(urls, target_dir, is_azure_storage=True, display_progress=not skip_progress) def upload_mch(coreclr_args): @@ -2814,6 +2355,7 @@ def upload_mch(coreclr_args): """ require_azure_storage_libraries(need_azure_identity=False) + from jitutil import BlobServiceClient def upload_blob(file, blob_name): blob_client = blob_service_client.get_blob_client(container=az_superpmi_container_name, blob=blob_name) @@ -3198,7 +2740,7 @@ def process_base_jit_path_arg(coreclr_args): blob_folder_name = "{}/{}/{}/{}/{}/{}".format(az_builds_root_folder, git_hash, coreclr_args.host_os, coreclr_args.arch, coreclr_args.build_type, jit_name) blob_uri = "{}/{}".format(az_blob_storage_jitrollingbuild_container_uri, blob_folder_name) urls = [ blob_uri ] - local_files = download_files(urls, basejit_dir, verbose=False, fail_if_not_found=False) + local_files = download_files(urls, basejit_dir, verbose=False, is_azure_storage=True, fail_if_not_found=False) if len(local_files) > 0: if hashnum > 1: @@ -3278,6 +2820,11 @@ def setup_spmi_location_arg(spmi_location): "Unable to set spmi_location", modify_arg=setup_spmi_location_arg) + coreclr_args.verify(args, + "no_progress", + lambda unused: True, + "Unable to set no_progress") + # Finish setting up logging. # The spmi_location is the root directory where we put the log file. # Log everything to the log file and only the specified verbosity to the console logger. @@ -3682,11 +3229,6 @@ def verify_replay_common_args(): lambda unused: True, "Unable to set base_git_hash") - coreclr_args.verify(args, - "temp_dir", - lambda unused: True, - "Unable to set temp_dir.") - coreclr_args.verify(args, "gcinfo", lambda unused: True, @@ -3723,6 +3265,11 @@ def verify_replay_common_args(): lambda unused: True, "Unable to set metrics.") + coreclr_args.verify(args, + "retainOnlyTopFiles", + lambda unused: True, + "Unable to set retainOnlyTopFiles.") + process_base_jit_path_arg(coreclr_args) jit_in_product_location = False @@ -3770,10 +3317,6 @@ def verify_replay_common_args(): os.path.isfile, "Unable to find coredistools.") - if coreclr_args.temp_dir is not None: - coreclr_args.temp_dir = os.path.abspath(coreclr_args.temp_dir) - logging.debug("Using temp_dir %s", coreclr_args.temp_dir) - elif coreclr_args.mode == "upload": verify_target_args() @@ -3825,11 +3368,6 @@ def verify_replay_common_args(): lambda unused: True, "Unable to set force_download") - coreclr_args.verify(args, - "no_progress", - lambda unused: True, - "Unable to set no_progress") - coreclr_args.verify(args, "filter", lambda unused: True, diff --git a/src/coreclr/scripts/superpmi_asmdiffs.py b/src/coreclr/scripts/superpmi_asmdiffs.py new file mode 100644 index 00000000000000..8a30850e7282f5 --- /dev/null +++ b/src/coreclr/scripts/superpmi_asmdiffs.py @@ -0,0 +1,251 @@ +#!/usr/bin/env python3 +# +# Licensed to the .NET Foundation under one or more agreements. +# The .NET Foundation licenses this file to you under the MIT license. +# +# Title : superpmi_asmdiffs.py +# +# Notes: +# +# Script to run "superpmi asmdiffs" for various collections on the Helix machines. +# +################################################################################ +################################################################################ + +import argparse +from os import walk, path +import shutil +from coreclr_arguments import * +from jitutil import run_command, TempDir + +parser = argparse.ArgumentParser(description="description") + +parser.add_argument("-arch", help="Architecture") +parser.add_argument("-platform", help="OS platform") +parser.add_argument("-base_jit_directory", help="path to the directory containing base clrjit binaries") +parser.add_argument("-diff_jit_directory", help="path to the directory containing diff clrjit binaries") +parser.add_argument("-log_directory", help="path to the directory containing superpmi log files") + +def setup_args(args): + """ Setup the args for SuperPMI to use. + + Args: + args (ArgParse): args parsed by arg parser + + Returns: + args (CoreclrArguments) + + """ + coreclr_args = CoreclrArguments(args, require_built_core_root=False, require_built_product_dir=False, + require_built_test_dir=False, default_build_type="Checked") + + coreclr_args.verify(args, + "arch", + lambda unused: True, + "Unable to set arch") + + coreclr_args.verify(args, + "platform", + lambda unused: True, + "Unable to set platform") + + coreclr_args.verify(args, + "base_jit_directory", + lambda jit_directory: os.path.isdir(jit_directory), + "base_jit_directory doesn't exist") + + coreclr_args.verify(args, + "diff_jit_directory", + lambda jit_directory: os.path.isdir(jit_directory), + "diff_jit_directory doesn't exist") + + coreclr_args.verify(args, + "log_directory", + lambda log_directory: True, + "log_directory doesn't exist") + + return coreclr_args + +def copy_dasm_files(spmi_location, upload_directory, tag_name): + """Copies .dasm files to a tempDirectory, zip it, and copy the compressed file to the upload directory. + + Args: + spmi_location (string): Location where .dasm files are present + upload_directory (string): Upload directory + tag_name (string): tag_name used in zip file name. + """ + + print("Copy .dasm files") + + # Create upload_directory + if not os.path.isdir(upload_directory): + os.makedirs(upload_directory) + + dasm_file_present = False + # Create temp directory to copy all issues to upload. We don't want to create a sub-folder + # inside issues_directory because that will also get included twice. + with TempDir() as prep_directory: + for file_path, dirs, files in walk(spmi_location, topdown=True): + # Credit: https://stackoverflow.com/a/19859907 + dirs[:] = [d for d in dirs] + for name in files: + if not name.lower().endswith(".dasm"): + continue + + dasm_src_file = path.join(file_path, name) + dasm_dst_file = dasm_src_file.replace(spmi_location, prep_directory) + dst_directory = path.dirname(dasm_dst_file) + if not os.path.exists(dst_directory): + os.makedirs(dst_directory) + try: + shutil.copy2(dasm_src_file, dasm_dst_file) + dasm_file_present = True + except PermissionError as pe_error: + print('Ignoring PermissionError: {0}'.format(pe_error)) + + # If there are no diffs, create an zip file with single file in it. + # Otherwise, Azdo considers it as failed job. + # See https://github.com/dotnet/arcade/issues/8200 + if not dasm_file_present: + no_diff = os.path.join(prep_directory, "nodiff.txt") + with open(no_diff, "w") as no_diff_file: + no_diff_file.write("No diffs found!") + + # Zip compress the files we will upload + zip_path = os.path.join(prep_directory, "Asmdiffs_" + tag_name) + print("Creating archive: " + zip_path) + shutil.make_archive(zip_path, 'zip', prep_directory) + + zip_path += ".zip" + dst_zip_path = os.path.join(upload_directory, "Asmdiffs_" + tag_name + ".zip") + print("Copying {} to {}".format(zip_path, dst_zip_path)) + try: + shutil.copy2(zip_path, dst_zip_path) + except PermissionError as pe_error: + print('Ignoring PermissionError: {0}'.format(pe_error)) + + +def main(main_args): + """ Run superpmi asmdiffs process on the Helix machines. + + See superpmi_asmdiffs_setup.py for how the directory structure is set up in the + correlation payload. This script lives in the root of that directory tree. + + Args: + main_args ([type]): Arguments to the script + """ + + python_path = sys.executable + script_dir = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) + coreclr_args = setup_args(main_args) + + # It doesn't really matter where we put the downloaded SPMI artifacts. + # Here, they are put in /artifacts/spmi. + spmi_location = os.path.join(script_dir, "artifacts", "spmi") + + log_directory = coreclr_args.log_directory + platform_name = coreclr_args.platform + + # Find the built jit-analyze and put its directory on the PATH + jit_analyze_dir = os.path.join(script_dir, "jit-analyze") + if not os.path.isdir(jit_analyze_dir): + print("Error: jit-analyze not found in {} (continuing)".format(jit_analyze_dir)) + else: + # Put the jit-analyze directory on the PATH so superpmi.py can find it. + print("Adding {} to PATH".format(jit_analyze_dir)) + os.environ["PATH"] = jit_analyze_dir + os.pathsep + os.environ["PATH"] + + # Find the portable `git` installation, and put `git.exe` on the PATH, for use by `jit-analyze`. + git_directory = os.path.join(script_dir, "git", "cmd") + git_exe_tool = os.path.join(git_directory, "git.exe") + if not os.path.isfile(git_exe_tool): + print("Error: `git` not found at {} (continuing)".format(git_exe_tool)) + else: + # Put the git/cmd directory on the PATH so jit-analyze can find it. + print("Adding {} to PATH".format(git_directory)) + os.environ["PATH"] = git_directory + os.pathsep + os.environ["PATH"] + + # Figure out which JITs to use + os_name = "win" if platform_name.lower() == "windows" else "unix" + arch_name = coreclr_args.arch + host_arch_name = "x64" if arch_name.endswith("64") else "x86" + os_name = "universal" if arch_name.startswith("arm") else os_name + base_jit_path = os.path.join(coreclr_args.base_jit_directory, 'clrjit_{}_{}_{}.dll'.format(os_name, arch_name, host_arch_name)) + diff_jit_path = os.path.join(coreclr_args.diff_jit_directory, 'clrjit_{}_{}_{}.dll'.format(os_name, arch_name, host_arch_name)) + + # Core_Root is where the superpmi tools (superpmi.exe, mcs.exe) are expected to be found. + # We pass the full path of the JITs to use as arguments. + core_root_dir = script_dir + + print("Running superpmi.py download to get MCH files") + + log_file = os.path.join(log_directory, "superpmi_download_{}_{}.log".format(platform_name, arch_name)) + run_command([ + python_path, + os.path.join(script_dir, "superpmi.py"), + "download", + "--no_progress", + "-core_root", core_root_dir, + "-target_os", platform_name, + "-target_arch", arch_name, + "-spmi_location", spmi_location, + "-log_level", "debug", + "-log_file", log_file + ], _exit_on_fail=True) + + print("Running superpmi.py asmdiffs") + log_file = os.path.join(log_directory, "superpmi_{}_{}.log".format(platform_name, arch_name)) + + overall_md_summary_file = os.path.join(spmi_location, "diff_summary.md") + if os.path.isfile(overall_md_summary_file): + os.remove(overall_md_summary_file) + + _, _, return_code = run_command([ + python_path, + os.path.join(script_dir, "superpmi.py"), + "asmdiffs", + "--no_progress", + "-core_root", core_root_dir, + "-target_os", platform_name, + "-target_arch", arch_name, + "-arch", host_arch_name, + "-base_jit_path", base_jit_path, + "-diff_jit_path", diff_jit_path, + "-spmi_location", spmi_location, + "-error_limit", "100", + "-log_level", "debug", + "-log_file", log_file, + "-retainOnlyTopFiles"]) + + # If there are asm diffs, and jit-analyze ran, we'll get a diff_summary.md file in the spmi_location directory. + # We make sure the file doesn't exist before we run diffs, so we don't need to worry about superpmi.py creating + # a unique, numbered file. If there are no diffs, we still want to create this file and indicate there were no diffs. + + overall_md_summary_file_target = os.path.join(log_directory, "superpmi_diff_summary_{}_{}.md".format(platform_name, arch_name)) + if os.path.isfile(overall_md_summary_file): + try: + print("Copying summary file {} -> {}".format(overall_md_summary_file, overall_md_summary_file_target)) + shutil.copy2(overall_md_summary_file, overall_md_summary_file_target) + except PermissionError as pe_error: + print('Ignoring PermissionError: {0}'.format(pe_error)) + + copy_dasm_files(spmi_location, log_directory, "{}_{}".format(platform_name, arch_name)) + else: + # Write a basic summary file. Ideally, we should not generate a summary.md file. However, currently I'm seeing + # errors where the Helix work item fails to upload this specified file if it doesn't exist. We should change the + # upload to be conditional, or otherwise not error. + with open(overall_md_summary_file_target, "a") as f: + f.write("""\ +No diffs found +""") + + if return_code != 0: + print("Failure in {}".format(log_file)) + return 1 + + return 0 + + +if __name__ == "__main__": + args = parser.parse_args() + sys.exit(main(args)) diff --git a/src/coreclr/scripts/superpmi_asmdiffs_setup.py b/src/coreclr/scripts/superpmi_asmdiffs_setup.py new file mode 100644 index 00000000000000..0342db7b56a0da --- /dev/null +++ b/src/coreclr/scripts/superpmi_asmdiffs_setup.py @@ -0,0 +1,270 @@ +#!/usr/bin/env python3 +# +# Licensed to the .NET Foundation under one or more agreements. +# The .NET Foundation licenses this file to you under the MIT license. +# +# Title : superpmi_asmdiffs_setup.py +# +# Notes: +# +# Script to setup the directory structure required to perform SuperPMI asmdiffs in CI. +# It creates `correlation_payload_directory` with `base` and `diff` directories +# that contain clrjit*.dll. It figures out the baseline commit hash to use for +# a particular GitHub pull request, and downloads the JIT rolling build for that +# commit hash. It downloads the jitutils repo and builds the jit-analyze tool. It +# downloads a version of `git` to be used by jit-analyze. +# +################################################################################ +################################################################################ + +import argparse +import logging +import os + +from coreclr_arguments import * +from jitutil import copy_directory, set_pipeline_variable, run_command, TempDir, download_files + +parser = argparse.ArgumentParser(description="description") + +parser.add_argument("-arch", help="Architecture") +parser.add_argument("-source_directory", help="Path to the root directory of the dotnet/runtime source tree") +parser.add_argument("-product_directory", help="Path to the directory containing built binaries (e.g., /artifacts/bin/coreclr/windows.x64.Checked)") + +is_windows = platform.system() == "Windows" + + +def setup_args(args): + """ Setup the args for SuperPMI to use. + + Args: + args (ArgParse): args parsed by arg parser + + Returns: + args (CoreclrArguments) + + """ + coreclr_args = CoreclrArguments(args, require_built_core_root=False, require_built_product_dir=False, + require_built_test_dir=False, default_build_type="Checked") + + coreclr_args.verify(args, + "arch", + lambda unused: True, + "Unable to set arch") + + coreclr_args.verify(args, + "source_directory", + lambda source_directory: os.path.isdir(source_directory), + "source_directory doesn't exist") + + coreclr_args.verify(args, + "product_directory", + lambda product_directory: os.path.isdir(product_directory), + "product_directory doesn't exist") + + return coreclr_args + + +def match_jit_files(full_path): + """ Match all the JIT files that we want to copy and use. + Note that we currently only match Windows files, and not osx cross-compile files. + We also don't copy the "default" clrjit.dll, since we always use the fully specified + JITs, e.g., clrjit_win_x86_x86.dll. + """ + file_name = os.path.basename(full_path) + + if file_name.startswith("clrjit_") and file_name.endswith(".dll") and file_name.find("osx") == -1: + return True + + return False + + +def match_superpmi_tool_files(full_path): + """ Match all the SuperPMI tool files that we want to copy and use. + Note that we currently only match Windows files. + """ + file_name = os.path.basename(full_path) + + if file_name == "superpmi.exe" or file_name == "mcs.exe": + return True + + return False + + +def main(main_args): + """ Prepare the Helix data for SuperPMI asmdiffs Azure DevOps pipeline. + + The Helix correlation payload directory is created and populated as follows: + + \payload -- the correlation payload directory + -- contains the *.py scripts from \src\coreclr\scripts + -- contains superpmi.exe, mcs.exe from the target-specific build + \payload\base + -- contains the baseline JITs + \payload\diff + -- contains the diff JITs + \payload\jit-analyze + -- contains the self-contained jit-analyze build (from dotnet/jitutils) + \payload\git + -- contains a Portable ("xcopy installable") `git` tool, downloaded from: + https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/git/Git-2.32.0-64-bit.zip + This is needed by jit-analyze to do `git diff` on the generated asm. The `\payload\git\cmd` + directory is added to the PATH. + NOTE: this only runs on Windows. + + Then, AzDO pipeline variables are set. + + Args: + main_args ([type]): Arguments to the script + + Returns: + 0 on success, otherwise a failure code + """ + + # Set up logging. + logger = logging.getLogger() + logger.setLevel(logging.INFO) + stream_handler = logging.StreamHandler(sys.stdout) + stream_handler.setLevel(logging.INFO) + logger.addHandler(stream_handler) + + coreclr_args = setup_args(main_args) + + arch = coreclr_args.arch + source_directory = coreclr_args.source_directory + product_directory = coreclr_args.product_directory + + python_path = sys.executable + + # CorrelationPayload directories + correlation_payload_directory = os.path.join(source_directory, "payload") + superpmi_scripts_directory = os.path.join(source_directory, 'src', 'coreclr', 'scripts') + base_jit_directory = os.path.join(correlation_payload_directory, "base") + diff_jit_directory = os.path.join(correlation_payload_directory, "diff") + jit_analyze_build_directory = os.path.join(correlation_payload_directory, "jit-analyze") + git_directory = os.path.join(correlation_payload_directory, "git") + + ######## Get the portable `git` package + + git_url = "https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/git/Git-2.32.0-64-bit.zip" + + print('Downloading {} -> {}'.format(git_url, git_directory)) + + urls = [ git_url ] + # There are too many files to be verbose in the download and copy. + download_files(urls, git_directory, verbose=False, display_progress=False) + git_exe_tool = os.path.join(git_directory, "cmd", "git.exe") + if not os.path.isfile(git_exe_tool): + print('Error: `git` not found at {}'.format(git_exe_tool)) + return 1 + + ######## Get SuperPMI python scripts + + # Copy *.py to CorrelationPayload + print('Copying {} -> {}'.format(superpmi_scripts_directory, correlation_payload_directory)) + copy_directory(superpmi_scripts_directory, correlation_payload_directory, verbose_copy=True, + match_func=lambda path: any(path.endswith(extension) for extension in [".py"])) + + ######## Get baseline JIT + + # Figure out which baseline JIT to use, and download it. + if not os.path.exists(base_jit_directory): + os.makedirs(base_jit_directory) + + print("Fetching history of `main` branch so we can find the baseline JIT") + run_command(["git", "fetch", "--depth=500", "origin", "main"], source_directory, _exit_on_fail=True) + + # Note: we only support downloading Windows versions of the JIT currently. To support downloading + # non-Windows JITs on a Windows machine, pass `-host_os ` to jitrollingbuild.py. + print("Running jitrollingbuild.py download to get baseline JIT") + jit_rolling_build_script = os.path.join(superpmi_scripts_directory, "jitrollingbuild.py") + _, _, return_code = run_command([ + python_path, + jit_rolling_build_script, + "download", + "-arch", arch, + "-target_dir", base_jit_directory], + source_directory) + if return_code != 0: + print('{} failed with {}'.format(jit_rolling_build_script, return_code)) + return return_code + + ######## Get diff JIT + + print('Copying diff binaries {} -> {}'.format(product_directory, diff_jit_directory)) + copy_directory(product_directory, diff_jit_directory, verbose_copy=True, match_func=match_jit_files) + + ######## Get SuperPMI tools + + # Put the SuperPMI tools directly in the root of the correlation payload directory. + print('Copying SuperPMI tools {} -> {}'.format(product_directory, correlation_payload_directory)) + copy_directory(product_directory, correlation_payload_directory, verbose_copy=True, match_func=match_superpmi_tool_files) + + ######## Clone and build jitutils: we only need jit-analyze + + try: + with TempDir() as jitutils_directory: + run_command( + ["git", "clone", "--quiet", "--depth", "1", "https://github.com/dotnet/jitutils", jitutils_directory]) + + # Make sure ".dotnet" directory exists, by running the script at least once + dotnet_script_name = "dotnet.cmd" if is_windows else "dotnet.sh" + dotnet_script_path = os.path.join(source_directory, dotnet_script_name) + run_command([dotnet_script_path, "--info"], jitutils_directory) + + # Build jit-analyze only, and build it as a self-contained app (not framework-dependent). + # What target RID are we building? It depends on where we're going to run this code. + # The RID catalog is here: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog. + # Windows x64 => win-x64 + # Windows x86 => win-x86 + # Windows arm32 => win-arm + # Windows arm64 => win-arm64 + # Linux x64 => linux-x64 + # Linux arm32 => linux-arm + # Linux arm64 => linux-arm64 + # macOS x64 => osx-x64 + + # NOTE: we currently only support running on Windows x86/x64 (we don't pass the target OS) + RID = None + if arch == "x86": + RID = "win-x86" + if arch == "x64": + RID = "win-x64" + + # Set dotnet path to run build + os.environ["PATH"] = os.path.join(source_directory, ".dotnet") + os.pathsep + os.environ["PATH"] + + run_command([ + "dotnet", + "publish", + "-c", "Release", + "--runtime", RID, + "--self-contained", + "--output", jit_analyze_build_directory, + os.path.join(jitutils_directory, "src", "jit-analyze", "jit-analyze.csproj")], + jitutils_directory) + except PermissionError as pe_error: + # Details: https://bugs.python.org/issue26660 + print('Ignoring PermissionError: {0}'.format(pe_error)) + + jit_analyze_tool = os.path.join(jit_analyze_build_directory, "jit-analyze.exe") + if not os.path.isfile(jit_analyze_tool): + print('Error: {} not found'.format(jit_analyze_tool)) + return 1 + + ######## Set pipeline variables + + helix_source_prefix = "official" + creator = "" + + print('Setting pipeline variables:') + set_pipeline_variable("CorrelationPayloadDirectory", correlation_payload_directory) + set_pipeline_variable("Architecture", arch) + set_pipeline_variable("Creator", creator) + set_pipeline_variable("HelixSourcePrefix", helix_source_prefix) + + return 0 + + +if __name__ == "__main__": + args = parser.parse_args() + sys.exit(main(args)) diff --git a/src/coreclr/scripts/superpmi_asmdiffs_summarize.py b/src/coreclr/scripts/superpmi_asmdiffs_summarize.py new file mode 100644 index 00000000000000..9601d91e56b60b --- /dev/null +++ b/src/coreclr/scripts/superpmi_asmdiffs_summarize.py @@ -0,0 +1,176 @@ +#!/usr/bin/env python3 +# +## Licensed to the .NET Foundation under one or more agreements. +## The .NET Foundation licenses this file to you under the MIT license. +# +## +# Title: superpmi_asmdiffs_summarize.py +# +# Notes: +# +# Script to summarize issues found from all partitions and print them on console. +# +################################################################################ +################################################################################ + +import argparse +import os +import re +from coreclr_arguments import * + +parser = argparse.ArgumentParser(description="description") + +parser.add_argument("-diff_summary_dir", help="Path to diff summary directory") +parser.add_argument("-arch", help="Architecture") + +def setup_args(args): + """ Setup the args. + + Args: + args (ArgParse): args parsed by arg parser + + Returns: + args (CoreclrArguments) + + """ + coreclr_args = CoreclrArguments(args, require_built_core_root=False, require_built_product_dir=False, + require_built_test_dir=False, default_build_type="Checked") + + coreclr_args.verify(args, + "diff_summary_dir", + lambda diff_summary_dir: os.path.isdir(diff_summary_dir), + "diff_summary_dir doesn't exist") + + coreclr_args.verify(args, + "arch", + lambda unused: True, + "Unable to set arch") + + return coreclr_args + + +def append_diff_file(f, arch, file_name, full_file_path): + """ Append a single summary file to the consolidated diff file. + + Args: + f : File we are appending to + arch (string): architecture we ran on + file_name (string): base file name of file to append (not including path components) + full_file_path (string): full path to file to append + + Returns: + True if diffs were found in the file, False otherwise + """ + + diffs_found = False + print("Appending {}".format(full_file_path)) + + # What platform is this file summarizing? We parse the filename itself, which is of the form: + # superpmi_diff_summary__.md + + diff_os = "unknown" + diff_arch = "unknown" + match_obj = re.search(r'^superpmi_diff_summary_(.*)_(.*).md', file_name) + if match_obj is not None: + diff_os = match_obj.group(1) + diff_arch = match_obj.group(2) + + with open(full_file_path, "r") as current_superpmi_md: + contents = current_superpmi_md.read() + + # Were there actually any diffs? We currently look to see if the file contains the text "No diffs found", + # inserted by `superpmi_asmdiffs.py`, instead of just not having a diff summary .md file. + # (A missing file has the same effect.) + match_obj = re.search(r'^No diffs found', contents) + if match_obj is not None: + # There were no diffs in this file; don't add it to the result + pass + else: + diffs_found = True + # Write a header for this summary, and create a
...
disclosure + # section around the file. + f.write("""\ + +## {0} {1} + +
+ +{0} {1} details + +Summary file: `{2}` + +To reproduce these diffs on Windows {3}: +``` +superpmi.py asmdiffs -target_os {0} -target_arch {1} -arch {3} +``` + +""".format(diff_os, diff_arch, file_name, arch)) + + # Now write the contents + f.write(contents) + + # Write the footer (close the
section) + f.write("""\ + +
+ +""") + + return diffs_found + + +def main(main_args): + """Main entrypoint + + Args: + main_args ([type]): Arguments to the script + """ + + coreclr_args = setup_args(main_args) + + diff_summary_dir = coreclr_args.diff_summary_dir + arch = coreclr_args.arch + + # Consolidate all superpmi_diff_summary_*.md in overall_diff_summary__.md + # (Don't name it "superpmi_xxx.md" or we might consolidate it into itself.) + # If there are no summary files found, add a "No diffs found" text to be explicit about that. + # + # Note that we currently do this summarizing in an architecture-specific job. That means that diffs run + # in a Windows x64 job and those run in a Windows x86 job will be summarized in two separate files. + # We should create a job that depends on all the diff jobs, downloads all the .md file artifacts, + # and consolidates everything together in one file. + + any_diffs_found = False + + final_md_path = os.path.join(diff_summary_dir, "overall_diff_summary_windows_{}.md".format(arch)) + print("Consolidating final {}".format(final_md_path)) + with open(final_md_path, "a") as f: + + f.write("""\ +# ASM diffs generated on Windows {} +""".format(arch)) + + for dirpath, _, files in os.walk(diff_summary_dir): + for file_name in files: + if file_name.startswith("superpmi_") and file_name.endswith(".md"): + full_file_path = os.path.join(dirpath, file_name) + if append_diff_file(f, arch, file_name, full_file_path): + any_diffs_found = True + + if not any_diffs_found: + f.write("""\ + +No diffs found +""") + + print("##vso[task.uploadsummary]{}".format(final_md_path)) + + with open(final_md_path, "r") as f: + print(f.read()) + + return 0 + + +if __name__ == "__main__": + args = parser.parse_args() + sys.exit(main(args)) diff --git a/src/coreclr/scripts/superpmi_aspnet.py b/src/coreclr/scripts/superpmi_aspnet.py index 2a0225d1e43bcc..f2e01ad6e2ae5e 100644 --- a/src/coreclr/scripts/superpmi_aspnet.py +++ b/src/coreclr/scripts/superpmi_aspnet.py @@ -20,7 +20,7 @@ from os import path from coreclr_arguments import * from superpmi import TempDir, determine_mcs_tool_path, determine_superpmi_tool_path, is_nonzero_length_file -from azdo_pipelines_util import run_command +from jitutil import run_command # Start of parser object creation. is_windows = platform.system() == "Windows" diff --git a/src/coreclr/scripts/superpmi_benchmarks.py b/src/coreclr/scripts/superpmi_benchmarks.py index 28ebf50c92cd82..1c15b9ae803bf9 100644 --- a/src/coreclr/scripts/superpmi_benchmarks.py +++ b/src/coreclr/scripts/superpmi_benchmarks.py @@ -20,7 +20,7 @@ from os.path import isfile from shutil import copyfile from coreclr_arguments import * -from azdo_pipelines_util import run_command, ChangeDir, TempDir +from jitutil import run_command, ChangeDir, TempDir # Start of parser object creation. is_windows = platform.system() == "Windows" diff --git a/src/coreclr/scripts/superpmi_collect_setup.py b/src/coreclr/scripts/superpmi_collect_setup.py index a6a9b84e7e8ba8..ce102ea0910261 100644 --- a/src/coreclr/scripts/superpmi_collect_setup.py +++ b/src/coreclr/scripts/superpmi_collect_setup.py @@ -37,7 +37,7 @@ import stat from coreclr_arguments import * -from azdo_pipelines_util import run_command, copy_directory, copy_files, set_pipeline_variable, ChangeDir, TempDir +from jitutil import run_command, copy_directory, copy_files, set_pipeline_variable, ChangeDir, TempDir # Start of parser object creation. @@ -398,7 +398,7 @@ def main(main_args): # create superpmi directory print('Copying {} -> {}'.format(superpmi_src_directory, superpmi_dst_directory)) - copy_directory(superpmi_src_directory, superpmi_dst_directory, match_func=lambda path: any(path.endswith(extension) for extension in [".py"])) + copy_directory(superpmi_src_directory, superpmi_dst_directory, verbose_output=True, match_func=lambda path: any(path.endswith(extension) for extension in [".py"])) if is_windows: acceptable_copy = lambda path: any(path.endswith(extension) for extension in [".py", ".dll", ".exe", ".json"]) @@ -407,7 +407,7 @@ def main(main_args): acceptable_copy = lambda path: (os.path.basename(path).find(".") == -1) or any(path.endswith(extension) for extension in [".py", ".dll", ".so", ".json"]) print('Copying {} -> {}'.format(coreclr_args.core_root_directory, superpmi_dst_directory)) - copy_directory(coreclr_args.core_root_directory, superpmi_dst_directory, match_func=acceptable_copy) + copy_directory(coreclr_args.core_root_directory, superpmi_dst_directory, verbose_output=True, match_func=acceptable_copy) # Copy all the test files to CORE_ROOT # The reason is there are lot of dependencies with *.Tests.dll and to ensure we do not get @@ -448,7 +448,7 @@ def make_readable(folder_name): run_command(["ls", "-l", folder_name]) make_readable(coreclr_args.input_directory) - copy_directory(coreclr_args.input_directory, superpmi_dst_directory, match_func=acceptable_copy) + copy_directory(coreclr_args.input_directory, superpmi_dst_directory, verbose_output=True, match_func=acceptable_copy) # Workitem directories workitem_directory = os.path.join(source_directory, "workitem") diff --git a/src/coreclr/scripts/superpmi_replay.py b/src/coreclr/scripts/superpmi_replay.py index a00b80753b2a98..198b0f28ff9403 100644 --- a/src/coreclr/scripts/superpmi_replay.py +++ b/src/coreclr/scripts/superpmi_replay.py @@ -15,7 +15,7 @@ import argparse import os from coreclr_arguments import * -from azdo_pipelines_util import run_command +from jitutil import run_command parser = argparse.ArgumentParser(description="description") diff --git a/src/coreclr/scripts/superpmi_replay_setup.py b/src/coreclr/scripts/superpmi_replay_setup.py index 73c89eb3335568..b7717da8efaf24 100644 --- a/src/coreclr/scripts/superpmi_replay_setup.py +++ b/src/coreclr/scripts/superpmi_replay_setup.py @@ -17,7 +17,7 @@ import os from coreclr_arguments import * -from azdo_pipelines_util import copy_directory, copy_files, set_pipeline_variable +from jitutil import copy_directory, copy_files, set_pipeline_variable parser = argparse.ArgumentParser(description="description") @@ -90,12 +90,12 @@ def main(main_args): # Copy *.py to CorrelationPayload print('Copying {} -> {}'.format(superpmi_src_directory, correlation_payload_directory)) - copy_directory(superpmi_src_directory, correlation_payload_directory, + copy_directory(superpmi_src_directory, correlation_payload_directory, verbose_output=True, match_func=lambda path: any(path.endswith(extension) for extension in [".py"])) # Copy clrjit*_arch.dll binaries to CorrelationPayload print('Copying binaries {} -> {}'.format(product_directory, correlation_payload_directory)) - copy_directory(product_directory, correlation_payload_directory, match_func=match_correlation_files) + copy_directory(product_directory, correlation_payload_directory, verbose_output=True, match_func=match_correlation_files) # Set variables print('Setting pipeline variables:') diff --git a/src/coreclr/tools/Common/Compiler/CompilerTypeSystemContext.cs b/src/coreclr/tools/Common/Compiler/CompilerTypeSystemContext.cs index 1dc0fd8d91d999..fa0828fc034e86 100644 --- a/src/coreclr/tools/Common/Compiler/CompilerTypeSystemContext.cs +++ b/src/coreclr/tools/Common/Compiler/CompilerTypeSystemContext.cs @@ -193,6 +193,12 @@ private EcmaModule AddModule(string filePath, string expectedSimpleName, bool us if (oldModuleData == null) { peReader = OpenPEFile(filePath, out mappedViewAccessor); + +#if !READYTORUN + if (peReader.HasMetadata && (peReader.PEHeaders.CorHeader.Flags & (CorFlags.ILLibrary | CorFlags.ILOnly)) == 0) + throw new NotSupportedException($"Error: C++/CLI is not supported: '{filePath}'"); +#endif + pdbReader = PortablePdbSymbolReader.TryOpenEmbedded(peReader, GetMetadataStringDecoder()) ?? OpenAssociatedSymbolFile(filePath, peReader); } else diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Relocation.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Relocation.cs index 5b50701a2b97eb..eda9378acc36d4 100644 --- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Relocation.cs +++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Relocation.cs @@ -30,7 +30,7 @@ public enum RelocType // Relocations for R2R image production // IMAGE_REL_SYMBOL_SIZE = 0x1000, // The size of data in the image represented by the target symbol node - IMAGE_REL_FILE_ABSOLUTE = 0x1001, // 32 bit offset from begining of image + IMAGE_REL_FILE_ABSOLUTE = 0x1001, // 32 bit offset from beginning of image } public struct Relocation diff --git a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/X64Emitter.cs b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/X64Emitter.cs index 455f6b446795b3..17135f6c4e405a 100644 --- a/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/X64Emitter.cs +++ b/src/coreclr/tools/Common/Compiler/DependencyAnalysis/Target_X64/X64Emitter.cs @@ -174,6 +174,12 @@ public void EmitRETIfEqual() Builder.EmitByte(0xC3); } + public void EmitCompareToZero(Register reg) + { + AddrMode rexAddrMode = new AddrMode(Register.RegDirect | reg, null, 0, 0, AddrModeSize.Int64); + EmitIndirInstructionSize(0x84, reg, ref rexAddrMode); + } + public void EmitZeroReg(Register reg) { // High 32 bits get cleared automatically when using 32bit registers diff --git a/src/coreclr/tools/Common/Compiler/DevirtualizationManager.cs b/src/coreclr/tools/Common/Compiler/DevirtualizationManager.cs index aba41341a27095..f7bd609553fc87 100644 --- a/src/coreclr/tools/Common/Compiler/DevirtualizationManager.cs +++ b/src/coreclr/tools/Common/Compiler/DevirtualizationManager.cs @@ -201,5 +201,16 @@ protected virtual MethodDesc ResolveVirtualMethod(MethodDesc declMethod, DefType return impl; } + +#if !READYTORUN + /// + /// Gets a value indicating whether it might be possible to obtain a constructed type data structure for the given type. + /// + /// + /// This is a bit of a hack, but devirtualization manager has a global view of all allocated types + /// so it can answer this question. + /// + public virtual bool CanConstructType(TypeDesc type) => true; +#endif } } diff --git a/src/coreclr/tools/Common/Compiler/DisplayNameHelpers.cs b/src/coreclr/tools/Common/Compiler/DisplayNameHelpers.cs index 674d54a95e0597..0ee508d160c652 100644 --- a/src/coreclr/tools/Common/Compiler/DisplayNameHelpers.cs +++ b/src/coreclr/tools/Common/Compiler/DisplayNameHelpers.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Text; using Internal.TypeSystem; @@ -11,6 +12,21 @@ namespace ILCompiler { internal static class DisplayNameHelpers { + public static string GetDisplayName(this TypeSystemEntity entity) + { + return entity switch + { + MethodDesc method => method.GetDisplayName(), + FieldDesc field => field.GetDisplayName(), + TypeDesc type => type.GetDisplayName(), +#if !READYTORUN + PropertyPseudoDesc property => property.GetDisplayName(), + EventPseudoDesc @event => @event.GetDisplayName(), +#endif + _ => throw new InvalidOperationException(), + }; + } + public static string GetDisplayName(this MethodDesc method) { var sb = new StringBuilder(); @@ -66,6 +82,13 @@ public static string GetDisplayName(this PropertyPseudoDesc property) .Append('.') .Append(property.Name).ToString(); } + + public static string GetDisplayName(this EventPseudoDesc @event) + { + return new StringBuilder(@event.OwningType.GetDisplayName()) + .Append('.') + .Append(@event.Name).ToString(); + } #endif public static string GetDisplayName(this TypeDesc type) diff --git a/src/coreclr/tools/Common/Compiler/Logger.cs b/src/coreclr/tools/Common/Compiler/Logger.cs index b75435c4df0f84..af84d21ab3b4bb 100644 --- a/src/coreclr/tools/Common/Compiler/Logger.cs +++ b/src/coreclr/tools/Common/Compiler/Logger.cs @@ -94,13 +94,23 @@ public void LogWarning(string text, int code, string origin, string subcategory internal bool IsWarningSuppressed(int code, MessageOrigin origin) { + // This is causing too much noise + // https://github.com/dotnet/runtimelab/issues/1591 + if (code == 2110 || code == 2111 || code == 2113 || code == 2115) + return true; + if (_suppressedWarnings.Contains(code)) return true; IEnumerable> suppressions = null; // TODO: Suppressions with different scopes - + + if (origin.MemberDefinition is TypeDesc type) + { + var ecmaType = type.GetTypeDefinition() as EcmaType; + suppressions = ecmaType?.GetDecodedCustomAttributes("System.Diagnostics.CodeAnalysis", "UnconditionalSuppressMessageAttribute"); + } if (origin.MemberDefinition is MethodDesc method) { diff --git a/src/coreclr/tools/Common/Compiler/Logging/ReferenceSource/MessageContainer.cs b/src/coreclr/tools/Common/Compiler/Logging/ReferenceSource/MessageContainer.cs index 7977343d17d5a3..f0a4afd09b1875 100644 --- a/src/coreclr/tools/Common/Compiler/Logging/ReferenceSource/MessageContainer.cs +++ b/src/coreclr/tools/Common/Compiler/Logging/ReferenceSource/MessageContainer.cs @@ -1,8 +1,9 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Reflection; using System.Text; using Mono.Cecil; @@ -40,7 +41,7 @@ namespace Mono.Linker /// Create an error message. ///
/// Humanly readable message describing the error - /// Unique error ID. Please see https://github.com/mono/linker/blob/main/docs/error-codes.md + /// Unique error ID. Please see https://github.com/dotnet/linker/blob/main/docs/error-codes.md /// for the list of errors and possibly add a new one /// Optionally, further categorize this error /// Filename, line, and column where the error was found @@ -80,7 +81,7 @@ public static MessageContainer CreateCustomErrorMessage (string text, int code, /// /// Context with the relevant warning suppression info. /// Humanly readable message describing the warning - /// Unique warning ID. Please see https://github.com/mono/linker/blob/main/docs/error-codes.md + /// Unique warning ID. Please see https://github.com/dotnet/linker/blob/main/docs/error-codes.md /// for the list of warnings and possibly add a new one /// /// Filename or member where the warning is coming from /// Optionally, further categorize this warning @@ -140,14 +141,31 @@ private static MessageContainer CreateWarningMessageContainer (LinkContext conte return new MessageContainer (MessageCategory.Warning, text, code, subcategory, origin); } + public bool IsWarningMessage ([NotNullWhen (true)] out int? code) + { + code = null; + + if (Category is MessageCategory.Warning or MessageCategory.WarningAsError) { + // Warning messages always have a code. + code = Code!; + return true; + } + + return false; + } + static bool TryLogSingleWarning (LinkContext context, int code, MessageOrigin origin, string subcategory) { if (subcategory != MessageSubCategory.TrimAnalysis) return false; - Debug.Assert (origin.MemberDefinition != null); - var declaringType = origin.MemberDefinition?.DeclaringType ?? (origin.MemberDefinition as TypeDefinition); - var assembly = declaringType.Module.Assembly; + Debug.Assert (origin.Provider != null); + var assembly = origin.Provider switch { + AssemblyDefinition asm => asm, + TypeDefinition type => type.Module.Assembly, + IMemberDefinition member => member.DeclaringType.Module.Assembly, + _ => throw new NotSupportedException () + }; Debug.Assert (assembly != null); if (assembly == null) @@ -228,17 +246,22 @@ public string ToMSBuildString () sb.Append (" ") .Append (cat) .Append (" IL") - .Append (Code.Value.ToString ("D4")) + // Warning and error messages always have a code. + .Append (Code!.Value.ToString ("D4")) .Append (": "); } else { sb.Append (" "); } - if (Origin?.MemberDefinition != null) { - if (Origin?.MemberDefinition is MethodDefinition method) + if (Origin?.Provider != null) { + if (Origin?.Provider is MethodDefinition method) sb.Append (method.GetDisplayName ()); + else if (Origin?.Provider is IMemberDefinition member) + sb.Append (member.FullName); + else if (Origin?.Provider is AssemblyDefinition assembly) + sb.Append (assembly.Name.Name); else - sb.Append (Origin?.MemberDefinition.FullName); + throw new NotSupportedException (); sb.Append (": "); } diff --git a/src/coreclr/tools/Common/Compiler/Logging/ReferenceSource/MessageOrigin.cs b/src/coreclr/tools/Common/Compiler/Logging/ReferenceSource/MessageOrigin.cs index 364216788ba61f..84357b26ae221d 100644 --- a/src/coreclr/tools/Common/Compiler/Logging/ReferenceSource/MessageOrigin.cs +++ b/src/coreclr/tools/Common/Compiler/Logging/ReferenceSource/MessageOrigin.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Diagnostics; using System.Linq; using System.Text; using Mono.Cecil; @@ -13,10 +14,14 @@ namespace Mono.Linker { #nullable enable public string? FileName { get; } - public IMemberDefinition? MemberDefinition { get; } - - readonly IMemberDefinition _suppressionContextMember; - public IMemberDefinition? SuppressionContextMember { get => _suppressionContextMember ?? MemberDefinition; } + public ICustomAttributeProvider? Provider { get; } + readonly ICustomAttributeProvider _suppressionContextMember; + public ICustomAttributeProvider? SuppressionContextMember { + get { + Debug.Assert (_suppressionContextMember == null || _suppressionContextMember is IMemberDefinition || _suppressionContextMember is AssemblyDefinition); + return _suppressionContextMember ?? Provider; + } + } #nullable disable public int SourceLine { get; } public int SourceColumn { get; } @@ -24,8 +29,13 @@ namespace Mono.Linker const int HiddenLineNumber = 0xfeefee; - public MessageOrigin (IMemberDefinition memberDefinition) - : this (memberDefinition, null) + public MessageOrigin (IMemberDefinition memberDefinition, int? ilOffset = null) + : this (memberDefinition as ICustomAttributeProvider, ilOffset) + { + } + + public MessageOrigin (ICustomAttributeProvider provider) + : this (provider, null) { } @@ -34,31 +44,43 @@ public MessageOrigin (string fileName, int sourceLine = 0, int sourceColumn = 0) FileName = fileName; SourceLine = sourceLine; SourceColumn = sourceColumn; - MemberDefinition = null; + Provider = null; _suppressionContextMember = null; ILOffset = null; } - public MessageOrigin (IMemberDefinition memberDefinition, int? ilOffset) - : this (memberDefinition, ilOffset, null) + public MessageOrigin (ICustomAttributeProvider provider, int? ilOffset) + : this (provider, ilOffset, null) { } - public MessageOrigin (IMemberDefinition memberDefinition, int? ilOffset, IMemberDefinition suppressionContextMember) + public MessageOrigin (ICustomAttributeProvider provider, int? ilOffset, ICustomAttributeProvider suppressionContextMember) { + Debug.Assert (provider == null || provider is IMemberDefinition || provider is AssemblyDefinition); + Debug.Assert (suppressionContextMember == null || suppressionContextMember is IMemberDefinition || provider is AssemblyDefinition); FileName = null; - MemberDefinition = memberDefinition; + Provider = provider; _suppressionContextMember = suppressionContextMember; SourceLine = 0; SourceColumn = 0; ILOffset = ilOffset; } + public MessageOrigin (MessageOrigin other, IMemberDefinition suppressionContextMember) + { + FileName = other.FileName; + Provider = other.Provider; + _suppressionContextMember = suppressionContextMember; + SourceLine = other.SourceLine; + SourceColumn = other.SourceColumn; + ILOffset = other.ILOffset; + } + public override string ToString () { int sourceLine = SourceLine, sourceColumn = SourceColumn; string fileName = FileName; - if (MemberDefinition is MethodDefinition method && + if (Provider is MethodDefinition method && method.DebugInformation.HasSequencePoints) { var offset = ILOffset ?? 0; SequencePoint correspondingSequencePoint = method.DebugInformation.SequencePoints @@ -94,20 +116,24 @@ public override string ToString () } public bool Equals (MessageOrigin other) => - (FileName, MemberDefinition, SourceLine, SourceColumn, ILOffset) == (other.FileName, other.MemberDefinition, other.SourceLine, other.SourceColumn, other.ILOffset); + (FileName, Provider, SourceLine, SourceColumn, ILOffset) == (other.FileName, other.Provider, other.SourceLine, other.SourceColumn, other.ILOffset); public override bool Equals (object obj) => obj is MessageOrigin messageOrigin && Equals (messageOrigin); - public override int GetHashCode () => (FileName, MemberDefinition, SourceLine, SourceColumn).GetHashCode (); + public override int GetHashCode () => (FileName, Provider, SourceLine, SourceColumn).GetHashCode (); public static bool operator == (MessageOrigin lhs, MessageOrigin rhs) => lhs.Equals (rhs); public static bool operator != (MessageOrigin lhs, MessageOrigin rhs) => !lhs.Equals (rhs); public int CompareTo (MessageOrigin other) { - if (MemberDefinition != null && other.MemberDefinition != null) { - TypeDefinition thisTypeDef = (MemberDefinition as TypeDefinition) ?? MemberDefinition.DeclaringType; - TypeDefinition otherTypeDef = (other.MemberDefinition as TypeDefinition) ?? other.MemberDefinition.DeclaringType; - int result = (thisTypeDef?.Module?.Assembly?.Name?.Name, thisTypeDef?.Name, MemberDefinition?.Name).CompareTo - ((otherTypeDef?.Module?.Assembly?.Name?.Name, otherTypeDef?.Name, other.MemberDefinition?.Name)); + if (Provider != null && other.Provider != null) { + var thisMember = Provider as IMemberDefinition; + var otherMember = other.Provider as IMemberDefinition; + TypeDefinition thisTypeDef = (Provider as TypeDefinition) ?? (Provider as IMemberDefinition)?.DeclaringType; + TypeDefinition otherTypeDef = (other.Provider as TypeDefinition) ?? (other.Provider as IMemberDefinition)?.DeclaringType; + var thisAssembly = thisTypeDef?.Module.Assembly ?? Provider as AssemblyDefinition; + var otherAssembly = otherTypeDef?.Module.Assembly ?? other.Provider as AssemblyDefinition; + int result = (thisAssembly.Name.Name, thisTypeDef?.Name, thisMember?.Name).CompareTo + ((otherAssembly.Name.Name, otherTypeDef?.Name, otherMember?.Name)); if (result != 0) return result; @@ -115,7 +141,7 @@ public int CompareTo (MessageOrigin other) return ILOffset.Value.CompareTo (other.ILOffset); return ILOffset == null ? (other.ILOffset == null ? 0 : 1) : -1; - } else if (MemberDefinition == null && other.MemberDefinition == null) { + } else if (Provider == null && other.Provider == null) { if (FileName != null && other.FileName != null) { return string.Compare (FileName, other.FileName); } else if (FileName == null && other.FileName == null) { @@ -125,7 +151,7 @@ public int CompareTo (MessageOrigin other) return (FileName == null) ? 1 : -1; } - return (MemberDefinition == null) ? 1 : -1; + return (Provider == null) ? 1 : -1; } } } diff --git a/src/coreclr/tools/Common/Compiler/Logging/ReferenceSource/README.md b/src/coreclr/tools/Common/Compiler/Logging/ReferenceSource/README.md index b894c9dc1f1c81..883332600e88d0 100644 --- a/src/coreclr/tools/Common/Compiler/Logging/ReferenceSource/README.md +++ b/src/coreclr/tools/Common/Compiler/Logging/ReferenceSource/README.md @@ -1 +1 @@ -Sources from the mono/linker repo at commit 012efef292663aa38f9047896942cdcc8765b8e0. \ No newline at end of file +Sources from the dotnet/linker repo at commit c0567db0b9088e2ad4144cd0fe2a985611ec28f0. diff --git a/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs b/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs index eee208cfb2de0f..434f9a9ee1c888 100644 --- a/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs +++ b/src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs @@ -84,6 +84,7 @@ public enum ReadyToRunSectionType ThreadStaticIndex = 210, LoopHijackFlag = 211, ImportAddressTables = 212, + ModuleInitializerList = 213, // Sections 300 - 399 are reserved for RhFindBlob backwards compatibility ReadonlyBlobRegionStart = 300, diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoBase.cs b/src/coreclr/tools/Common/JitInterface/CorInfoBase.cs index 5e5c89774b7ca2..8c552704c7080f 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoBase.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoBase.cs @@ -674,21 +674,6 @@ static uint _getClassAttribs(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLA } } - [UnmanagedCallersOnly] - static byte _isStructRequiringStackAllocRetBuf(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) - { - var _this = GetThis(thisHandle); - try - { - return _this.isStructRequiringStackAllocRetBuf(cls) ? (byte)1 : (byte)0; - } - catch (Exception ex) - { - *ppException = _this.AllocException(ex); - return default; - } - } - [UnmanagedCallersOnly] static CORINFO_MODULE_STRUCT_* _getClassModule(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { @@ -2581,7 +2566,7 @@ static byte _doesFieldBelongToClass(IntPtr thisHandle, IntPtr* ppException, CORI static IntPtr GetUnmanagedCallbacks() { - void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 174); + void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 173); callbacks[0] = (delegate* unmanaged)&_isJitIntrinsic; callbacks[1] = (delegate* unmanaged)&_getMethodAttribs; @@ -2628,135 +2613,134 @@ static IntPtr GetUnmanagedCallbacks() callbacks[42] = (delegate* unmanaged)&_isValueClass; callbacks[43] = (delegate* unmanaged)&_canInlineTypeCheck; callbacks[44] = (delegate* unmanaged)&_getClassAttribs; - callbacks[45] = (delegate* unmanaged)&_isStructRequiringStackAllocRetBuf; - callbacks[46] = (delegate* unmanaged)&_getClassModule; - callbacks[47] = (delegate* unmanaged)&_getModuleAssembly; - callbacks[48] = (delegate* unmanaged)&_getAssemblyName; - callbacks[49] = (delegate* unmanaged)&_LongLifetimeMalloc; - callbacks[50] = (delegate* unmanaged)&_LongLifetimeFree; - callbacks[51] = (delegate* unmanaged)&_getClassModuleIdForStatics; - callbacks[52] = (delegate* unmanaged)&_getClassSize; - callbacks[53] = (delegate* unmanaged)&_getHeapClassSize; - callbacks[54] = (delegate* unmanaged)&_canAllocateOnStack; - callbacks[55] = (delegate* unmanaged)&_getClassAlignmentRequirement; - callbacks[56] = (delegate* unmanaged)&_getClassGClayout; - callbacks[57] = (delegate* unmanaged)&_getClassNumInstanceFields; - callbacks[58] = (delegate* unmanaged)&_getFieldInClass; - callbacks[59] = (delegate* unmanaged)&_checkMethodModifier; - callbacks[60] = (delegate* unmanaged)&_getNewHelper; - callbacks[61] = (delegate* unmanaged)&_getNewArrHelper; - callbacks[62] = (delegate* unmanaged)&_getCastingHelper; - callbacks[63] = (delegate* unmanaged)&_getSharedCCtorHelper; - callbacks[64] = (delegate* unmanaged)&_getTypeForBox; - callbacks[65] = (delegate* unmanaged)&_getBoxHelper; - callbacks[66] = (delegate* unmanaged)&_getUnBoxHelper; - callbacks[67] = (delegate* unmanaged)&_getReadyToRunHelper; - callbacks[68] = (delegate* unmanaged)&_getReadyToRunDelegateCtorHelper; - callbacks[69] = (delegate* unmanaged)&_getHelperName; - callbacks[70] = (delegate* unmanaged)&_initClass; - callbacks[71] = (delegate* unmanaged)&_classMustBeLoadedBeforeCodeIsRun; - callbacks[72] = (delegate* unmanaged)&_getBuiltinClass; - callbacks[73] = (delegate* unmanaged)&_getTypeForPrimitiveValueClass; - callbacks[74] = (delegate* unmanaged)&_getTypeForPrimitiveNumericClass; - callbacks[75] = (delegate* unmanaged)&_canCast; - callbacks[76] = (delegate* unmanaged)&_areTypesEquivalent; - callbacks[77] = (delegate* unmanaged)&_compareTypesForCast; - callbacks[78] = (delegate* unmanaged)&_compareTypesForEquality; - callbacks[79] = (delegate* unmanaged)&_mergeClasses; - callbacks[80] = (delegate* unmanaged)&_isMoreSpecificType; - callbacks[81] = (delegate* unmanaged)&_getParentType; - callbacks[82] = (delegate* unmanaged)&_getChildType; - callbacks[83] = (delegate* unmanaged)&_satisfiesClassConstraints; - callbacks[84] = (delegate* unmanaged)&_isSDArray; - callbacks[85] = (delegate* unmanaged)&_getArrayRank; - callbacks[86] = (delegate* unmanaged)&_getArrayInitializationData; - callbacks[87] = (delegate* unmanaged)&_canAccessClass; - callbacks[88] = (delegate* unmanaged)&_getFieldName; - callbacks[89] = (delegate* unmanaged)&_getFieldClass; - callbacks[90] = (delegate* unmanaged)&_getFieldType; - callbacks[91] = (delegate* unmanaged)&_getFieldOffset; - callbacks[92] = (delegate* unmanaged)&_getFieldInfo; - callbacks[93] = (delegate* unmanaged)&_isFieldStatic; - callbacks[94] = (delegate* unmanaged)&_getBoundaries; - callbacks[95] = (delegate* unmanaged)&_setBoundaries; - callbacks[96] = (delegate* unmanaged)&_getVars; - callbacks[97] = (delegate* unmanaged)&_setVars; - callbacks[98] = (delegate* unmanaged)&_allocateArray; - callbacks[99] = (delegate* unmanaged)&_freeArray; - callbacks[100] = (delegate* unmanaged)&_getArgNext; - callbacks[101] = (delegate* unmanaged)&_getArgType; - callbacks[102] = (delegate* unmanaged)&_getArgClass; - callbacks[103] = (delegate* unmanaged)&_getHFAType; - callbacks[104] = (delegate* unmanaged)&_GetErrorHRESULT; - callbacks[105] = (delegate* unmanaged)&_GetErrorMessage; - callbacks[106] = (delegate* unmanaged)&_FilterException; - callbacks[107] = (delegate* unmanaged)&_ThrowExceptionForJitResult; - callbacks[108] = (delegate* unmanaged)&_ThrowExceptionForHelper; - callbacks[109] = (delegate* unmanaged)&_runWithErrorTrap; - callbacks[110] = (delegate* unmanaged)&_runWithSPMIErrorTrap; - callbacks[111] = (delegate* unmanaged)&_getEEInfo; - callbacks[112] = (delegate* unmanaged)&_getJitTimeLogFilename; - callbacks[113] = (delegate* unmanaged)&_getMethodDefFromMethod; - callbacks[114] = (delegate* unmanaged)&_getMethodName; - callbacks[115] = (delegate* unmanaged)&_getMethodNameFromMetadata; - callbacks[116] = (delegate* unmanaged)&_getMethodHash; - callbacks[117] = (delegate* unmanaged)&_findNameOfToken; - callbacks[118] = (delegate* unmanaged)&_getSystemVAmd64PassStructInRegisterDescriptor; - callbacks[119] = (delegate* unmanaged)&_getThreadTLSIndex; - callbacks[120] = (delegate* unmanaged)&_getInlinedCallFrameVptr; - callbacks[121] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; - callbacks[122] = (delegate* unmanaged)&_getHelperFtn; - callbacks[123] = (delegate* unmanaged)&_getFunctionEntryPoint; - callbacks[124] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; - callbacks[125] = (delegate* unmanaged)&_getMethodSync; - callbacks[126] = (delegate* unmanaged)&_getLazyStringLiteralHelper; - callbacks[127] = (delegate* unmanaged)&_embedModuleHandle; - callbacks[128] = (delegate* unmanaged)&_embedClassHandle; - callbacks[129] = (delegate* unmanaged)&_embedMethodHandle; - callbacks[130] = (delegate* unmanaged)&_embedFieldHandle; - callbacks[131] = (delegate* unmanaged)&_embedGenericHandle; - callbacks[132] = (delegate* unmanaged)&_getLocationOfThisType; - callbacks[133] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; - callbacks[134] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; - callbacks[135] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; - callbacks[136] = (delegate* unmanaged)&_getJustMyCodeHandle; - callbacks[137] = (delegate* unmanaged)&_GetProfilingHandle; - callbacks[138] = (delegate* unmanaged)&_getCallInfo; - callbacks[139] = (delegate* unmanaged)&_canAccessFamily; - callbacks[140] = (delegate* unmanaged)&_isRIDClassDomainID; - callbacks[141] = (delegate* unmanaged)&_getClassDomainID; - callbacks[142] = (delegate* unmanaged)&_getFieldAddress; - callbacks[143] = (delegate* unmanaged)&_getStaticFieldCurrentClass; - callbacks[144] = (delegate* unmanaged)&_getVarArgsHandle; - callbacks[145] = (delegate* unmanaged)&_canGetVarArgsHandle; - callbacks[146] = (delegate* unmanaged)&_constructStringLiteral; - callbacks[147] = (delegate* unmanaged)&_emptyStringLiteral; - callbacks[148] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; - callbacks[149] = (delegate* unmanaged)&_setOverride; - callbacks[150] = (delegate* unmanaged)&_addActiveDependency; - callbacks[151] = (delegate* unmanaged)&_GetDelegateCtor; - callbacks[152] = (delegate* unmanaged)&_MethodCompileComplete; - callbacks[153] = (delegate* unmanaged)&_getTailCallHelpers; - callbacks[154] = (delegate* unmanaged)&_convertPInvokeCalliToCall; - callbacks[155] = (delegate* unmanaged)&_notifyInstructionSetUsage; - callbacks[156] = (delegate* unmanaged)&_updateEntryPointForTailCall; - callbacks[157] = (delegate* unmanaged)&_allocMem; - callbacks[158] = (delegate* unmanaged)&_reserveUnwindInfo; - callbacks[159] = (delegate* unmanaged)&_allocUnwindInfo; - callbacks[160] = (delegate* unmanaged)&_allocGCInfo; - callbacks[161] = (delegate* unmanaged)&_setEHcount; - callbacks[162] = (delegate* unmanaged)&_setEHinfo; - callbacks[163] = (delegate* unmanaged)&_logMsg; - callbacks[164] = (delegate* unmanaged)&_doAssert; - callbacks[165] = (delegate* unmanaged)&_reportFatalError; - callbacks[166] = (delegate* unmanaged)&_getPgoInstrumentationResults; - callbacks[167] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; - callbacks[168] = (delegate* unmanaged)&_recordCallSite; - callbacks[169] = (delegate* unmanaged)&_recordRelocation; - callbacks[170] = (delegate* unmanaged)&_getRelocTypeHint; - callbacks[171] = (delegate* unmanaged)&_getExpectedTargetArchitecture; - callbacks[172] = (delegate* unmanaged)&_getJitFlags; - callbacks[173] = (delegate* unmanaged)&_doesFieldBelongToClass; + callbacks[45] = (delegate* unmanaged)&_getClassModule; + callbacks[46] = (delegate* unmanaged)&_getModuleAssembly; + callbacks[47] = (delegate* unmanaged)&_getAssemblyName; + callbacks[48] = (delegate* unmanaged)&_LongLifetimeMalloc; + callbacks[49] = (delegate* unmanaged)&_LongLifetimeFree; + callbacks[50] = (delegate* unmanaged)&_getClassModuleIdForStatics; + callbacks[51] = (delegate* unmanaged)&_getClassSize; + callbacks[52] = (delegate* unmanaged)&_getHeapClassSize; + callbacks[53] = (delegate* unmanaged)&_canAllocateOnStack; + callbacks[54] = (delegate* unmanaged)&_getClassAlignmentRequirement; + callbacks[55] = (delegate* unmanaged)&_getClassGClayout; + callbacks[56] = (delegate* unmanaged)&_getClassNumInstanceFields; + callbacks[57] = (delegate* unmanaged)&_getFieldInClass; + callbacks[58] = (delegate* unmanaged)&_checkMethodModifier; + callbacks[59] = (delegate* unmanaged)&_getNewHelper; + callbacks[60] = (delegate* unmanaged)&_getNewArrHelper; + callbacks[61] = (delegate* unmanaged)&_getCastingHelper; + callbacks[62] = (delegate* unmanaged)&_getSharedCCtorHelper; + callbacks[63] = (delegate* unmanaged)&_getTypeForBox; + callbacks[64] = (delegate* unmanaged)&_getBoxHelper; + callbacks[65] = (delegate* unmanaged)&_getUnBoxHelper; + callbacks[66] = (delegate* unmanaged)&_getReadyToRunHelper; + callbacks[67] = (delegate* unmanaged)&_getReadyToRunDelegateCtorHelper; + callbacks[68] = (delegate* unmanaged)&_getHelperName; + callbacks[69] = (delegate* unmanaged)&_initClass; + callbacks[70] = (delegate* unmanaged)&_classMustBeLoadedBeforeCodeIsRun; + callbacks[71] = (delegate* unmanaged)&_getBuiltinClass; + callbacks[72] = (delegate* unmanaged)&_getTypeForPrimitiveValueClass; + callbacks[73] = (delegate* unmanaged)&_getTypeForPrimitiveNumericClass; + callbacks[74] = (delegate* unmanaged)&_canCast; + callbacks[75] = (delegate* unmanaged)&_areTypesEquivalent; + callbacks[76] = (delegate* unmanaged)&_compareTypesForCast; + callbacks[77] = (delegate* unmanaged)&_compareTypesForEquality; + callbacks[78] = (delegate* unmanaged)&_mergeClasses; + callbacks[79] = (delegate* unmanaged)&_isMoreSpecificType; + callbacks[80] = (delegate* unmanaged)&_getParentType; + callbacks[81] = (delegate* unmanaged)&_getChildType; + callbacks[82] = (delegate* unmanaged)&_satisfiesClassConstraints; + callbacks[83] = (delegate* unmanaged)&_isSDArray; + callbacks[84] = (delegate* unmanaged)&_getArrayRank; + callbacks[85] = (delegate* unmanaged)&_getArrayInitializationData; + callbacks[86] = (delegate* unmanaged)&_canAccessClass; + callbacks[87] = (delegate* unmanaged)&_getFieldName; + callbacks[88] = (delegate* unmanaged)&_getFieldClass; + callbacks[89] = (delegate* unmanaged)&_getFieldType; + callbacks[90] = (delegate* unmanaged)&_getFieldOffset; + callbacks[91] = (delegate* unmanaged)&_getFieldInfo; + callbacks[92] = (delegate* unmanaged)&_isFieldStatic; + callbacks[93] = (delegate* unmanaged)&_getBoundaries; + callbacks[94] = (delegate* unmanaged)&_setBoundaries; + callbacks[95] = (delegate* unmanaged)&_getVars; + callbacks[96] = (delegate* unmanaged)&_setVars; + callbacks[97] = (delegate* unmanaged)&_allocateArray; + callbacks[98] = (delegate* unmanaged)&_freeArray; + callbacks[99] = (delegate* unmanaged)&_getArgNext; + callbacks[100] = (delegate* unmanaged)&_getArgType; + callbacks[101] = (delegate* unmanaged)&_getArgClass; + callbacks[102] = (delegate* unmanaged)&_getHFAType; + callbacks[103] = (delegate* unmanaged)&_GetErrorHRESULT; + callbacks[104] = (delegate* unmanaged)&_GetErrorMessage; + callbacks[105] = (delegate* unmanaged)&_FilterException; + callbacks[106] = (delegate* unmanaged)&_ThrowExceptionForJitResult; + callbacks[107] = (delegate* unmanaged)&_ThrowExceptionForHelper; + callbacks[108] = (delegate* unmanaged)&_runWithErrorTrap; + callbacks[109] = (delegate* unmanaged)&_runWithSPMIErrorTrap; + callbacks[110] = (delegate* unmanaged)&_getEEInfo; + callbacks[111] = (delegate* unmanaged)&_getJitTimeLogFilename; + callbacks[112] = (delegate* unmanaged)&_getMethodDefFromMethod; + callbacks[113] = (delegate* unmanaged)&_getMethodName; + callbacks[114] = (delegate* unmanaged)&_getMethodNameFromMetadata; + callbacks[115] = (delegate* unmanaged)&_getMethodHash; + callbacks[116] = (delegate* unmanaged)&_findNameOfToken; + callbacks[117] = (delegate* unmanaged)&_getSystemVAmd64PassStructInRegisterDescriptor; + callbacks[118] = (delegate* unmanaged)&_getThreadTLSIndex; + callbacks[119] = (delegate* unmanaged)&_getInlinedCallFrameVptr; + callbacks[120] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; + callbacks[121] = (delegate* unmanaged)&_getHelperFtn; + callbacks[122] = (delegate* unmanaged)&_getFunctionEntryPoint; + callbacks[123] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; + callbacks[124] = (delegate* unmanaged)&_getMethodSync; + callbacks[125] = (delegate* unmanaged)&_getLazyStringLiteralHelper; + callbacks[126] = (delegate* unmanaged)&_embedModuleHandle; + callbacks[127] = (delegate* unmanaged)&_embedClassHandle; + callbacks[128] = (delegate* unmanaged)&_embedMethodHandle; + callbacks[129] = (delegate* unmanaged)&_embedFieldHandle; + callbacks[130] = (delegate* unmanaged)&_embedGenericHandle; + callbacks[131] = (delegate* unmanaged)&_getLocationOfThisType; + callbacks[132] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; + callbacks[133] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; + callbacks[134] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; + callbacks[135] = (delegate* unmanaged)&_getJustMyCodeHandle; + callbacks[136] = (delegate* unmanaged)&_GetProfilingHandle; + callbacks[137] = (delegate* unmanaged)&_getCallInfo; + callbacks[138] = (delegate* unmanaged)&_canAccessFamily; + callbacks[139] = (delegate* unmanaged)&_isRIDClassDomainID; + callbacks[140] = (delegate* unmanaged)&_getClassDomainID; + callbacks[141] = (delegate* unmanaged)&_getFieldAddress; + callbacks[142] = (delegate* unmanaged)&_getStaticFieldCurrentClass; + callbacks[143] = (delegate* unmanaged)&_getVarArgsHandle; + callbacks[144] = (delegate* unmanaged)&_canGetVarArgsHandle; + callbacks[145] = (delegate* unmanaged)&_constructStringLiteral; + callbacks[146] = (delegate* unmanaged)&_emptyStringLiteral; + callbacks[147] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; + callbacks[148] = (delegate* unmanaged)&_setOverride; + callbacks[149] = (delegate* unmanaged)&_addActiveDependency; + callbacks[150] = (delegate* unmanaged)&_GetDelegateCtor; + callbacks[151] = (delegate* unmanaged)&_MethodCompileComplete; + callbacks[152] = (delegate* unmanaged)&_getTailCallHelpers; + callbacks[153] = (delegate* unmanaged)&_convertPInvokeCalliToCall; + callbacks[154] = (delegate* unmanaged)&_notifyInstructionSetUsage; + callbacks[155] = (delegate* unmanaged)&_updateEntryPointForTailCall; + callbacks[156] = (delegate* unmanaged)&_allocMem; + callbacks[157] = (delegate* unmanaged)&_reserveUnwindInfo; + callbacks[158] = (delegate* unmanaged)&_allocUnwindInfo; + callbacks[159] = (delegate* unmanaged)&_allocGCInfo; + callbacks[160] = (delegate* unmanaged)&_setEHcount; + callbacks[161] = (delegate* unmanaged)&_setEHinfo; + callbacks[162] = (delegate* unmanaged)&_logMsg; + callbacks[163] = (delegate* unmanaged)&_doAssert; + callbacks[164] = (delegate* unmanaged)&_reportFatalError; + callbacks[165] = (delegate* unmanaged)&_getPgoInstrumentationResults; + callbacks[166] = (delegate* unmanaged)&_allocPgoInstrumentationBySchema; + callbacks[167] = (delegate* unmanaged)&_recordCallSite; + callbacks[168] = (delegate* unmanaged)&_recordRelocation; + callbacks[169] = (delegate* unmanaged)&_getRelocTypeHint; + callbacks[170] = (delegate* unmanaged)&_getExpectedTargetArchitecture; + callbacks[171] = (delegate* unmanaged)&_getJitFlags; + callbacks[172] = (delegate* unmanaged)&_doesFieldBelongToClass; return (IntPtr)callbacks; } diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoHelpFunc.cs b/src/coreclr/tools/Common/JitInterface/CorInfoHelpFunc.cs index 6bc8a1999877aa..0765a56b21e199 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoHelpFunc.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoHelpFunc.cs @@ -165,7 +165,6 @@ which is the right helper to use to allocate an object of a given type. */ CORINFO_HELP_GETFIELDADDR, - CORINFO_HELP_GETSTATICFIELDADDR_CONTEXT, // Helper for context-static fields CORINFO_HELP_GETSTATICFIELDADDR_TLS, // Helper for PE TLS fields // There are a variety of specialized helpers for accessing static fields. The JIT should use diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.Intrinsics.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.Intrinsics.cs index ac2eb066859103..50f7783be86547 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.Intrinsics.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.Intrinsics.cs @@ -79,7 +79,6 @@ static IntrinsicHashtable InitializeIntrinsicHashtable() table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Array_Get, "Get", null, null); table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Array_Address, "Address", null, null); table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Array_Set, "Set", null, null); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_InitializeArray, "InitializeArray", "System.Runtime.CompilerServices", "RuntimeHelpers"); table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_RTH_GetValueInternal, "GetValueInternal", "System", "RuntimeTypeHandle"); table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Object_GetType, "GetType", "System", "Object"); table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_StubHelpers_GetStubContext, "GetStubContext", "System.StubHelpers", "StubHelpers"); // interop-specific @@ -136,9 +135,6 @@ private CorInfoIntrinsics getIntrinsicID(MethodDesc method, byte* pMustExpand) break; case CorInfoIntrinsics.CORINFO_INTRINSIC_RTH_GetValueInternal: -#if !READYTORUN - case CorInfoIntrinsics.CORINFO_INTRINSIC_InitializeArray: -#endif case CorInfoIntrinsics.CORINFO_INTRINSIC_ByReference_Ctor: case CorInfoIntrinsics.CORINFO_INTRINSIC_ByReference_Value: if (pMustExpand != null) diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs index bbc0c99d4f597f..7cb086495a6108 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs @@ -366,6 +366,24 @@ private void CompileMethodInternal(IMethodNode methodCodeNodeNeedingCode, Method #endif } + if (codeSize < _code.Length) + { + if (_compilation.TypeSystemContext.Target.Architecture != TargetArchitecture.ARM64) + { + // For xarch/arm32, the generated code is sometimes smaller than the memory allocated. + // In that case, trim the codeBlock to the actual value. + // + // For arm64, the allocation request of `hotCodeSize` also includes the roData size + // while the `codeSize` returned just contains the size of the native code. As such, + // there is guarantee that for armarch, (codeSize == _code.Length) is always true. + // + // Currently, hot/cold splitting is not done and hence `codeSize` just includes the size of + // hotCode. Once hot/cold splitting is done, need to trim respective `_code` or `_coldCode` + // accordingly. + Debug.Assert(codeSize != 0); + Array.Resize(ref _code, (int)codeSize); + } + } PublishCode(); PublishROData(); } @@ -558,6 +576,8 @@ private void CompileMethodCleanup() _actualInstructionSetUnsupported = default(InstructionSetFlags); #endif + _instantiationToJitVisibleInstantiation = null; + _pgoResults.Clear(); } @@ -644,6 +664,25 @@ private bool Get_CORINFO_METHOD_INFO(MethodDesc method, MethodIL methodIL, CORIN return true; } + private Dictionary _instantiationToJitVisibleInstantiation = null; + private CORINFO_CLASS_STRUCT_** GetJitInstantiation(Instantiation inst) + { + IntPtr [] jitVisibleInstantiation; + if (_instantiationToJitVisibleInstantiation == null) + { + _instantiationToJitVisibleInstantiation = new Dictionary(); + } + + if (!_instantiationToJitVisibleInstantiation.TryGetValue(inst, out jitVisibleInstantiation)) + { + jitVisibleInstantiation = new IntPtr[inst.Length]; + for (int i = 0; i < inst.Length; i++) + jitVisibleInstantiation[i] = (IntPtr)ObjectToHandle(inst[i]); + _instantiationToJitVisibleInstantiation.Add(inst, jitVisibleInstantiation); + } + return (CORINFO_CLASS_STRUCT_**)GetPin(jitVisibleInstantiation); + } + private void Get_CORINFO_SIG_INFO(MethodDesc method, CORINFO_SIG_INFO* sig, bool suppressHiddenArgument = false) { Get_CORINFO_SIG_INFO(method.Signature, sig); @@ -666,12 +705,15 @@ private void Get_CORINFO_SIG_INFO(MethodDesc method, CORINFO_SIG_INFO* sig, bool // JIT doesn't care what the instantiation is and this is expensive. Instantiation owningTypeInst = method.OwningType.Instantiation; sig->sigInst.classInstCount = (uint)owningTypeInst.Length; - if (owningTypeInst.Length > 0) + if (owningTypeInst.Length != 0) + { + sig->sigInst.classInst = GetJitInstantiation(owningTypeInst); + } + + sig->sigInst.methInstCount = (uint)method.Instantiation.Length; + if (method.Instantiation.Length != 0) { - var classInst = new IntPtr[owningTypeInst.Length]; - for (int i = 0; i < owningTypeInst.Length; i++) - classInst[i] = (IntPtr)ObjectToHandle(owningTypeInst[i]); - sig->sigInst.classInst = (CORINFO_CLASS_STRUCT_**)GetPin(classInst); + sig->sigInst.methInst = GetJitInstantiation(method.Instantiation); } } @@ -1265,25 +1307,38 @@ private bool resolveVirtualMethod(CORINFO_DEVIRTUALIZATION_INFO* info) methodWithTokenDecl = new MethodWithToken(decl, declToken, null, false, null, devirtualizedMethodOwner: decl.OwningType); } MethodWithToken methodWithTokenImpl; +#endif if (decl == originalImpl) { +#if READYTORUN methodWithTokenImpl = methodWithTokenDecl; +#endif if (info->pResolvedTokenVirtualMethod != null) { info->resolvedTokenDevirtualizedMethod = *info->pResolvedTokenVirtualMethod; } else { - info->resolvedTokenDevirtualizedMethod = CreateResolvedTokenFromMethod(this, decl, methodWithTokenDecl); + info->resolvedTokenDevirtualizedMethod = CreateResolvedTokenFromMethod(this, decl +#if READYTORUN + , methodWithTokenDecl +#endif + ); } info->resolvedTokenDevirtualizedUnboxedMethod = default(CORINFO_RESOLVED_TOKEN); } else { +#if READYTORUN methodWithTokenImpl = new MethodWithToken(nonUnboxingImpl, resolver.GetModuleTokenForMethod(nonUnboxingImpl.GetTypicalMethodDefinition()), null, unboxingStub, null, devirtualizedMethodOwner: impl.OwningType); +#endif - info->resolvedTokenDevirtualizedMethod = CreateResolvedTokenFromMethod(this, impl, methodWithTokenImpl); + info->resolvedTokenDevirtualizedMethod = CreateResolvedTokenFromMethod(this, impl +#if READYTORUN + , methodWithTokenImpl +#endif + ); if (unboxingStub) { @@ -1297,6 +1352,7 @@ private bool resolveVirtualMethod(CORINFO_DEVIRTUALIZATION_INFO* info) } } +#if READYTORUN // Testing has not shown that concerns about virtual matching are significant // Only generate verification for builds with the stress mode enabled if (_compilation.SymbolNodeFactory.VerifyTypeAndFieldLayout) @@ -1304,9 +1360,6 @@ private bool resolveVirtualMethod(CORINFO_DEVIRTUALIZATION_INFO* info) ISymbolNode virtualResolutionNode = _compilation.SymbolNodeFactory.CheckVirtualFunctionOverride(methodWithTokenDecl, objType, methodWithTokenImpl); _methodCodeNode.Fixups.Add(virtualResolutionNode); } -#else - info->resolvedTokenDevirtualizedMethod = default(CORINFO_RESOLVED_TOKEN); - info->resolvedTokenDevirtualizedUnboxedMethod = default(CORINFO_RESOLVED_TOKEN); #endif info->detail = CORINFO_DEVIRTUALIZATION_DETAIL.CORINFO_DEVIRTUALIZATION_SUCCESS; info->devirtualizedMethod = ObjectToHandle(impl); @@ -1315,9 +1368,21 @@ private bool resolveVirtualMethod(CORINFO_DEVIRTUALIZATION_INFO* info) return true; + static CORINFO_RESOLVED_TOKEN CreateResolvedTokenFromMethod(CorInfoImpl jitInterface, MethodDesc method #if READYTORUN - static CORINFO_RESOLVED_TOKEN CreateResolvedTokenFromMethod(CorInfoImpl jitInterface, MethodDesc method, MethodWithToken methodWithToken) + , MethodWithToken methodWithToken +#endif + ) { +#if !READYTORUN + MethodDesc unboxedMethodDesc = method.IsUnboxingThunk() ? method.GetUnboxedMethod() : method; + var methodWithToken = new + { + Method = unboxedMethodDesc, + OwningType = unboxedMethodDesc.OwningType, + }; +#endif + CORINFO_RESOLVED_TOKEN result = default(CORINFO_RESOLVED_TOKEN); MethodILScope scope = jitInterface._compilation.GetMethodIL(methodWithToken.Method); if (scope == null) @@ -1326,19 +1391,22 @@ static CORINFO_RESOLVED_TOKEN CreateResolvedTokenFromMethod(CorInfoImpl jitInter } result.tokenScope = jitInterface.ObjectToHandle(scope); result.tokenContext = jitInterface.contextFromMethod(method); +#if READYTORUN result.token = methodWithToken.Token.Token; if (methodWithToken.Token.TokenType != CorTokenType.mdtMethodDef) { Debug.Assert(false); // This should never happen, but we protect against total failure with the throw below. throw new RequiresRuntimeJitException("Attempt to devirtualize and unable to create token for devirtualized method"); } +#else + result.token = (mdToken)0x06BAAAAD; +#endif result.tokenType = CorInfoTokenKind.CORINFO_TOKENKIND_DevirtualizedMethod; result.hClass = jitInterface.ObjectToHandle(methodWithToken.OwningType); result.hMethod = jitInterface.ObjectToHandle(method); return result; } -#endif } private CORINFO_METHOD_STRUCT_* getUnboxedEntry(CORINFO_METHOD_STRUCT_* ftn, ref bool requiresInstMethodTableArg) @@ -1887,7 +1955,7 @@ private uint getClassAttribsInternal(TypeDesc type) result |= CorInfoFlag.CORINFO_FLG_VALUECLASS; if (metadataType.IsByRefLike) - result |= CorInfoFlag.CORINFO_FLG_CONTAINS_STACK_PTR; + result |= CorInfoFlag.CORINFO_FLG_BYREF_LIKE; // The CLR has more complicated rules around CUSTOMLAYOUT, but this will do. if (metadataType.IsExplicitLayout || (metadataType.IsSequentialLayout && metadataType.GetClassLayout().Size != 0) || metadataType.IsWellKnownType(WellKnownType.TypedReference)) @@ -1940,13 +2008,6 @@ private uint getClassAttribsInternal(TypeDesc type) return (uint)result; } - private bool isStructRequiringStackAllocRetBuf(CORINFO_CLASS_STRUCT_* cls) - { - // Disable this optimization. It has limited value (only kicks in on x86, and only for less common structs), - // causes bugs and introduces odd ABI differences not compatible with ReadyToRun. - return false; - } - private CORINFO_MODULE_STRUCT_* getClassModule(CORINFO_CLASS_STRUCT_* cls) { throw new NotImplementedException("getClassModule"); } private CORINFO_ASSEMBLY_STRUCT_* getModuleAssembly(CORINFO_MODULE_STRUCT_* mod) @@ -3773,7 +3834,11 @@ private HRESULT getPgoInstrumentationResults(CORINFO_METHOD_STRUCT_* ftnHnd, ref } else { - ComputeJitPgoInstrumentationSchema(ObjectToHandle, pgoResultsSchemas, out var nativeSchemas, out var instrumentationData); + ComputeJitPgoInstrumentationSchema(ObjectToHandle, pgoResultsSchemas, out var nativeSchemas, out var instrumentationData +#if !READYTORUN + , _compilation.CanConstructType +#endif + ); pgoResults.pInstrumentationData = (byte*)GetPin(instrumentationData); pgoResults.countSchemaItems = (uint)nativeSchemas.Length; diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs b/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs index 4ace5372053a78..bc6d53514df1d8 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs @@ -442,7 +442,6 @@ public enum CorInfoIntrinsics CORINFO_INTRINSIC_Array_Get, // Get the value of an element in an array CORINFO_INTRINSIC_Array_Address, // Get the address of an element in an array CORINFO_INTRINSIC_Array_Set, // Set the value of an element in an array - CORINFO_INTRINSIC_InitializeArray, // initialize an array from static data CORINFO_INTRINSIC_RTH_GetValueInternal, CORINFO_INTRINSIC_Object_GetType, CORINFO_INTRINSIC_StubHelpers_GetStubContext, @@ -618,7 +617,7 @@ public enum CorInfoFlag : uint CORINFO_FLG_CONTAINS_GC_PTR = 0x01000000, // does the class contain a gc ptr ? CORINFO_FLG_DELEGATE = 0x02000000, // is this a subclass of delegate or multicast delegate ? // CORINFO_FLG_UNUSED = 0x04000000, - CORINFO_FLG_CONTAINS_STACK_PTR = 0x08000000, // This class has a stack pointer inside it + CORINFO_FLG_BYREF_LIKE = 0x08000000, // it is byref-like value type CORINFO_FLG_VARIANCE = 0x10000000, // MethodTable::HasVariance (sealed does *not* mean uncast-able) CORINFO_FLG_BEFOREFIELDINIT = 0x20000000, // Additional flexibility for when to run .cctor (see code:#ClassConstructionFlags) CORINFO_FLG_GENERIC_TYPE_VARIABLE = 0x40000000, // This is really a handle for a variable type diff --git a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt index b981056c834ba7..76982cd7aaff93 100644 --- a/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt +++ b/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt @@ -198,7 +198,6 @@ FUNCTIONS bool isValueClass(CORINFO_CLASS_HANDLE cls) CorInfoInlineTypeCheck canInlineTypeCheck(CORINFO_CLASS_HANDLE cls, CorInfoInlineTypeCheckSource source) uint32_t getClassAttribs(CORINFO_CLASS_HANDLE cls) - bool isStructRequiringStackAllocRetBuf(CORINFO_CLASS_HANDLE cls) CORINFO_MODULE_HANDLE getClassModule(CORINFO_CLASS_HANDLE cls) CORINFO_ASSEMBLY_HANDLE getModuleAssembly(CORINFO_MODULE_HANDLE mod) const char* getAssemblyName(CORINFO_ASSEMBLY_HANDLE assem) diff --git a/src/coreclr/tools/Common/Pgo/PgoFormat.cs b/src/coreclr/tools/Common/Pgo/PgoFormat.cs index afc05ae3d8b758..a7de96a03fd0fc 100644 --- a/src/coreclr/tools/Common/Pgo/PgoFormat.cs +++ b/src/coreclr/tools/Common/Pgo/PgoFormat.cs @@ -13,7 +13,7 @@ namespace Internal.Pgo public enum PgoInstrumentationKind { // This must be kept in sync with PgoInstrumentationKind in corjit.h - // New InstrumentationKinds should recieve corresponding merging logic in + // New InstrumentationKinds should receive corresponding merging logic in // PgoSchemeMergeComparer and the MergeInSchemaElem functions below // Schema data types diff --git a/src/coreclr/tools/Common/TypeSystem/Common/Instantiation.cs b/src/coreclr/tools/Common/TypeSystem/Common/Instantiation.cs index 136f7f4e04b104..d3b0fdd5686e99 100644 --- a/src/coreclr/tools/Common/TypeSystem/Common/Instantiation.cs +++ b/src/coreclr/tools/Common/TypeSystem/Common/Instantiation.cs @@ -11,7 +11,7 @@ namespace Internal.TypeSystem /// Represents a generic instantiation - a collection of generic parameters /// or arguments of a generic type or a generic method. /// - public struct Instantiation + public struct Instantiation : IEquatable { private TypeDesc[] _genericParameters; @@ -113,5 +113,25 @@ public bool MoveNext() return true; } } + + public bool Equals(Instantiation other) + { + if (_genericParameters.Length != other._genericParameters.Length) + return false; + + for (int i = 0; i < _genericParameters.Length; i++) + { + if (_genericParameters[i] != other._genericParameters[i]) + return false; + } + return true; + } + public override bool Equals(object o) + { + if (o is Instantiation inst) + return Equals(inst); + return false; + } + public override int GetHashCode() => ComputeGenericInstanceHashCode(1); } } diff --git a/src/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs b/src/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs index f445bb1a1fc70b..362fd1763d230d 100644 --- a/src/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs +++ b/src/coreclr/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs @@ -11,7 +11,7 @@ namespace Internal.TypeSystem /// MetadataFieldLayout algorithm which can be used to compute field layout /// for any MetadataType where all fields are available by calling GetFields. /// - public class MetadataFieldLayoutAlgorithm : FieldLayoutAlgorithm + public abstract class MetadataFieldLayoutAlgorithm : FieldLayoutAlgorithm { public override ComputedInstanceFieldLayout ComputeInstanceLayout(DefType defType, InstanceLayoutKind layoutKind) { @@ -167,21 +167,7 @@ out instanceByteSizeAndAlignment return ComputeInstanceFieldLayout(type, numInstanceFields); } - protected virtual ComputedInstanceFieldLayout ComputeInstanceFieldLayout(MetadataType type, int numInstanceFields) - { - if (type.IsExplicitLayout) - { - return ComputeExplicitFieldLayout(type, numInstanceFields); - } - else if (type.IsSequentialLayout || type.IsEnum || type.Context.Target.Abi == TargetAbi.CppCodegen) - { - return ComputeSequentialFieldLayout(type, numInstanceFields); - } - else - { - return ComputeAutoFieldLayout(type, numInstanceFields); - } - } + protected abstract ComputedInstanceFieldLayout ComputeInstanceFieldLayout(MetadataType type, int numInstanceFields); public override ComputedStaticFieldLayout ComputeStaticFieldLayout(DefType defType, StaticLayoutKind layoutKind) { diff --git a/src/coreclr/tools/Common/TypeSystem/IL/FlowGraph.cs b/src/coreclr/tools/Common/TypeSystem/IL/FlowGraph.cs index 7fd2bb8cba2558..a4791620331f51 100644 --- a/src/coreclr/tools/Common/TypeSystem/IL/FlowGraph.cs +++ b/src/coreclr/tools/Common/TypeSystem/IL/FlowGraph.cs @@ -88,47 +88,6 @@ public IEnumerable LookupRange(int ilOffsetStart, int ilOffsetEnd) yield return BasicBlocks[i]; } - internal string Dump(Func getNodeAnnot, Func<(BasicBlock, BasicBlock), string> getEdgeAnnot) - { - var sb = new StringBuilder(); - sb.AppendLine("digraph G {"); - sb.AppendLine(" forcelabels=true;"); - sb.AppendLine(); - Dictionary bbToIndex = new Dictionary(); - for (int i = 0; i < BasicBlocks.Count; i++) - bbToIndex.Add(BasicBlocks[i].Start, i); - - foreach (BasicBlock bb in BasicBlocks) - { - string label = $"[{bb.Start:x}..{bb.Start + bb.Size:x})\\n{getNodeAnnot(bb)}"; - sb.AppendLine($" BB{bbToIndex[bb.Start]} [label=\"{label}\"];"); - } - - sb.AppendLine(); - - foreach (BasicBlock bb in BasicBlocks) - { - foreach (BasicBlock tar in bb.Targets) - { - string label = getEdgeAnnot((bb, tar)); - string postfix = string.IsNullOrEmpty(label) ? "" : $" [label=\"{label}\"]"; - sb.AppendLine($" BB{bbToIndex[bb.Start]} -> BB{bbToIndex[tar.Start]}{postfix};"); - } - } - - // Write ranks with BFS. - List curRank = new List { BasicBlocks.Single(bb => bb.Start == 0) }; - HashSet seen = new HashSet(curRank); - while (curRank.Count > 0) - { - sb.AppendLine($" {{rank = same; {string.Concat(curRank.Select(bb => $"BB{bbToIndex[bb.Start]}; "))}}}"); - curRank = curRank.SelectMany(bb => bb.Targets).Where(seen.Add).ToList(); - } - - sb.AppendLine("}"); - return sb.ToString(); - } - public static FlowGraph Create(MethodIL il) { HashSet bbStarts = GetBasicBlockStarts(il); diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedFieldLayoutAlgorithm.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedFieldLayoutAlgorithm.cs index 2d26f451dcf0c6..7dd50f06f34415 100644 --- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedFieldLayoutAlgorithm.cs +++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedFieldLayoutAlgorithm.cs @@ -11,7 +11,7 @@ namespace Internal.TypeSystem /// /// RuntimeDeterminedFieldLayoutAlgorithm algorithm which can be used to compute field layout /// for any RuntimeDeterminedType - /// Only useable for accessing the instance field size + /// Only usable for accessing the instance field size /// public class RuntimeDeterminedFieldLayoutAlgorithm : FieldLayoutAlgorithm { diff --git a/src/coreclr/tools/ILVerify/Program.cs b/src/coreclr/tools/ILVerify/Program.cs index a5b380778cfa23..8d25e7331d073d 100644 --- a/src/coreclr/tools/ILVerify/Program.cs +++ b/src/coreclr/tools/ILVerify/Program.cs @@ -96,7 +96,7 @@ private Program(Options options) string[] includePatterns = options.Include; if (options.IncludeFile != null) { - if (options.Include.Length != 0) + if (options.Include != null && options.Include.Length != 0) WriteLine("[Warning] --include-file takes precedence over --include"); includePatterns = File.ReadAllLines(options.IncludeFile.FullName); } @@ -105,7 +105,7 @@ private Program(Options options) string[] excludePatterns = options.Exclude; if (options.ExcludeFile != null) { - if (options.Exclude.Length != 0) + if (options.Exclude != null && options.Exclude.Length != 0) WriteLine("[Warning] --exclude-file takes precedence over --exclude"); excludePatterns = File.ReadAllLines(options.ExcludeFile.FullName); } @@ -114,7 +114,7 @@ private Program(Options options) string[] ignoreErrorPatterns = options.IgnoreError; if (options.IgnoreErrorFile != null) { - if (options.IgnoreError.Length != 0) + if (options.IgnoreError != null && options.IgnoreError.Length != 0) WriteLine("[Warning] --ignore-error-file takes precedence over --ignore-error"); ignoreErrorPatterns = File.ReadAllLines(options.IgnoreErrorFile.FullName); } diff --git a/src/coreclr/tools/StressLogAnalyzer/StressLogAnalyzer.cpp b/src/coreclr/tools/StressLogAnalyzer/StressLogAnalyzer.cpp index 466a536fb17522..42ee883921ed32 100644 --- a/src/coreclr/tools/StressLogAnalyzer/StressLogAnalyzer.cpp +++ b/src/coreclr/tools/StressLogAnalyzer/StressLogAnalyzer.cpp @@ -172,7 +172,7 @@ int wmain(int argc, wchar_t *argv[]) } if (runAgain) { - int largc = ParseCommandLine(&s[1], largv, _countof(largv)); + int largc = ParseCommandLine(&s[1], largv, ARRAY_SIZE(largv)); if (largc > 0) { argc = largc; diff --git a/src/coreclr/tools/StressLogAnalyzer/StressLogPlugin/stressLogDump.cpp b/src/coreclr/tools/StressLogAnalyzer/StressLogPlugin/stressLogDump.cpp index 6d903e622ff0d6..2b3c1f884a3a22 100644 --- a/src/coreclr/tools/StressLogAnalyzer/StressLogPlugin/stressLogDump.cpp +++ b/src/coreclr/tools/StressLogAnalyzer/StressLogPlugin/stressLogDump.cpp @@ -2,15 +2,15 @@ // The .NET Foundation licenses this file to you under the MIT license. // ==++== -// - -// +// + +// // ==--== #include "pch.h" #include "strike.h" #include "util.h" -#include +#include #include #ifndef STRESS_LOG @@ -25,11 +25,11 @@ void GcHistAddLog(LPCSTR msg, StressMsg* stressMsg); /*********************************************************************************/ -static const WCHAR* getTime(const FILETIME* time, __out_ecount (buffLen) WCHAR* buff, int buffLen) +static const WCHAR* getTime(const FILETIME* time, __out_ecount (buffLen) WCHAR* buff, int buffLen) { SYSTEMTIME systemTime; static const WCHAR badTime[] = W("BAD TIME"); - + if (!FileTimeToSystemTime(time, &systemTime)) return badTime; @@ -48,21 +48,21 @@ static const WCHAR* getTime(const FILETIME* time, __out_ecount (buffLen) WCHAR* if (ret == 0) return badTime; #endif // FEATURE_PAL else - + return buff; } /*********************************************************************************/ -static inline __int64& toInt64(FILETIME& t) +static inline __int64& toInt64(FILETIME& t) { return *((__int64 *) &t); } /*********************************************************************************/ -ThreadStressLog* ThreadStressLog::FindLatestThreadLog() const +ThreadStressLog* ThreadStressLog::FindLatestThreadLog() const { const ThreadStressLog* latestLog = 0; - for (const ThreadStressLog* ptr = this; ptr != NULL; ptr = ptr->next) + for (const ThreadStressLog* ptr = this; ptr != NULL; ptr = ptr->next) { if (ptr->readPtr != NULL) if (latestLog == 0 || ptr->readPtr->timeStamp > latestLog->readPtr->timeStamp) @@ -87,18 +87,18 @@ const char *getFacilityName(DWORD_PTR lf) } else if ((((DWORD)lf) & (LF_ALWAYS | 0xfffe | LF_GC)) == (LF_ALWAYS | LF_GC)) { - sprintf_s<_countof(buff)>(buff, "`GC l=%d`", (lf >> 16) & 0x7fff); + sprintf_s(buff, "`GC l=%d`", (lf >> 16) & 0x7fff); return buff; } - else + else { buff[1] = '\0'; for ( int i = 0; i < 32; ++i ) { if ( lf & 0x1 ) { - strcat_s ( buff, _countof(buff), &(facilities[i].lfName[3]) ); - strcat_s ( buff, _countof(buff), "`" ); + strcat_s ( buff, ARRAY_SIZE(buff), &(facilities[i].lfName[3]) ); + strcat_s ( buff, ARRAY_SIZE(buff), "`" ); } lf >>= 1; } @@ -131,10 +131,10 @@ void formatOutput(struct IDebugDataSpaces* memCallBack, ___in FILE* file, __inou const SIZE_T capacity_buff = 2048; LPWSTR buff = (LPWSTR)alloca(capacity_buff * sizeof(WCHAR)); static char formatCopy[256]; - + int iArgCount = 0; - - strcpy_s(formatCopy, _countof(formatCopy), format); + + strcpy_s(formatCopy, ARRAY_SIZE(formatCopy), format); char* ptr = formatCopy; format = formatCopy; for(;;) @@ -146,24 +146,24 @@ void formatOutput(struct IDebugDataSpaces* memCallBack, ___in FILE* file, __inou ptr[-1] = '}'; else if (c == '}') ptr[-1] = '{'; - else if (c == '%') + else if (c == '%') { argsPtr++; // This format will consume one of the args - if (*ptr == '%') + if (*ptr == '%') { ptr++; // skip the whole %% - --argsPtr; // except for a %% + --argsPtr; // except for a %% } - else if (*ptr == 'p') + else if (*ptr == 'p') { // It is a %p ptr++; - if (isalpha(*ptr)) + if (isalpha(*ptr)) { // It is a special %p formatter // Print the string up to that point c = *ptr; *ptr = 0; // Terminate the string temporarily vfprintf(file, format, (va_list)args); - *ptr = c; // Put it back + *ptr = c; // Put it back // move the argument pointers past the part the was printed format = ptr + 1; @@ -171,7 +171,7 @@ void formatOutput(struct IDebugDataSpaces* memCallBack, ___in FILE* file, __inou iArgCount = -1; DWORD_PTR arg = DWORD_PTR(argsPtr[-1]); - switch (c) + switch (c) { case 'M': // format as a method Desc if (g_bDacBroken) @@ -180,12 +180,12 @@ void formatOutput(struct IDebugDataSpaces* memCallBack, ___in FILE* file, __inou } else { - if (!IsMethodDesc(arg)) + if (!IsMethodDesc(arg)) { - if (arg != 0) + if (arg != 0) fprintf(file, " (BAD Method)"); } - else + else { DacpMethodDescData MethodDescData; MethodDescData.Request(g_sos,(CLRDATA_ADDRESS)arg); @@ -193,7 +193,7 @@ void formatOutput(struct IDebugDataSpaces* memCallBack, ___in FILE* file, __inou static WCHAR wszNameBuffer[1024]; // should be large enough if (g_sos->GetMethodDescName(arg, 1024, wszNameBuffer, NULL) != S_OK) { - wcscpy_s(wszNameBuffer, _countof(wszNameBuffer), W("UNKNOWN METHODDESC")); + wcscpy_s(wszNameBuffer, ARRAY_SIZE(wszNameBuffer), W("UNKNOWN METHODDESC")); } wcscpy_s(buff, capacity_buff, wszNameBuffer); @@ -210,16 +210,16 @@ void formatOutput(struct IDebugDataSpaces* memCallBack, ___in FILE* file, __inou } else { - if (arg & 3) + if (arg & 3) { - arg &= ~3; // GC steals the lower bits for its own use during GC. + arg &= ~3; // GC steals the lower bits for its own use during GC. fprintf(file, " Low Bit(s) Set"); } if (!IsMethodTable(arg)) { fprintf(file, " (BAD MethodTable)"); } - else + else { NameForMT_s (arg, g_mdName, mdNameLen); fprintf(file, " (%S)", g_mdName); @@ -227,14 +227,14 @@ void formatOutput(struct IDebugDataSpaces* memCallBack, ___in FILE* file, __inou } break; - case 'V': - { // format as a C vtable pointer + case 'V': + { // format as a C vtable pointer char Symbol[1024]; ULONG64 Displacement; HRESULT hr = g_ExtSymbols->GetNameByOffset(TO_CDADDR(arg), Symbol, 1024, NULL, &Displacement); - if (SUCCEEDED(hr) && Symbol[0] != '\0' && Displacement == 0) + if (SUCCEEDED(hr) && Symbol[0] != '\0' && Displacement == 0) fprintf(file, " (%s)", Symbol); - else + else fprintf(file, " (Unknown VTable)"); } break; @@ -243,7 +243,7 @@ void formatOutput(struct IDebugDataSpaces* memCallBack, ___in FILE* file, __inou char Symbol[1024]; ULONG64 Displacement; HRESULT hr = g_ExtSymbols->GetNameByOffset (TO_CDADDR(arg), Symbol, 1024, NULL, &Displacement); - if (SUCCEEDED (hr) && Symbol[0] != '\0') + if (SUCCEEDED (hr) && Symbol[0] != '\0') { fprintf (file, " (%s", Symbol); if (Displacement) @@ -252,16 +252,16 @@ void formatOutput(struct IDebugDataSpaces* memCallBack, ___in FILE* file, __inou } fprintf (file, ")"); } - else - fprintf (file, " (Unknown function)"); + else + fprintf (file, " (Unknown function)"); } break; default: - format = ptr; // Just print the character. + format = ptr; // Just print the character. } } } - else if (*ptr == 's' || (*ptr == 'h' && *(ptr+1) == 's' && ++ptr)) + else if (*ptr == 's' || (*ptr == 'h' && *(ptr+1) == 's' && ++ptr)) { HRESULT hr; @@ -269,16 +269,16 @@ void formatOutput(struct IDebugDataSpaces* memCallBack, ___in FILE* file, __inou // since we may have more than one %s in the format ULONG cbStrBuf = 256; char* strBuf = (char *)_alloca(cbStrBuf); - + hr = memCallBack->ReadVirtual(TO_CDADDR((char* )args[iArgCount]), strBuf, cbStrBuf, 0); - if (hr != S_OK) + if (hr != S_OK) { - strcpy_s(strBuf, cbStrBuf, "(#Could not read address of string#)"); + strcpy_s(strBuf, cbStrBuf, "(#Could not read address of string#)"); } - args[iArgCount] = strBuf; + args[iArgCount] = strBuf; } - else if (*ptr == 'S' || (*ptr == 'l' && *(ptr+1) == 's' && ++ptr)) + else if (*ptr == 'S' || (*ptr == 'l' && *(ptr+1) == 's' && ++ptr)) { HRESULT hr; @@ -286,7 +286,7 @@ void formatOutput(struct IDebugDataSpaces* memCallBack, ___in FILE* file, __inou // since we may have more than one %s in the format ULONG cbWstrBuf = 256 * sizeof(WCHAR); WCHAR* wstrBuf = (WCHAR *)_alloca(cbWstrBuf); - + hr = memCallBack->ReadVirtual(TO_CDADDR((char* )args[iArgCount]), wstrBuf, cbWstrBuf, 0); if (hr != S_OK) { @@ -307,7 +307,7 @@ void __cdecl vDoOut(BOOL bToConsole, FILE* file, PCSTR Format, ...) { va_list Args; - + va_start(Args, Format); if (bToConsole) @@ -324,20 +324,20 @@ vDoOut(BOOL bToConsole, FILE* file, PCSTR Format, ...) /*********************************************************************************/ -HRESULT StressLog::Dump(ULONG64 outProcLog, const char* fileName, struct IDebugDataSpaces* memCallBack) +HRESULT StressLog::Dump(ULONG64 outProcLog, const char* fileName, struct IDebugDataSpaces* memCallBack) { ULONG64 g_hThisInst; BOOL bDoGcHist = (fileName == NULL); FILE* file = NULL; - // Fetch the circular buffer bookkeeping data + // Fetch the circular buffer bookkeeping data StressLog inProcLog; HRESULT hr = memCallBack->ReadVirtual(UL64_TO_CDA(outProcLog), &inProcLog, sizeof(StressLog), 0); - if (hr != S_OK) + if (hr != S_OK) { return hr; } - if (inProcLog.logs.Load() == NULL || inProcLog.moduleOffset == 0) + if (inProcLog.logs.Load() == NULL || inProcLog.moduleOffset == 0) { ExtOut ( "----- No thread logs in the image: The stress log was probably not initialized correctly. -----\n"); return S_FALSE; @@ -394,7 +394,7 @@ HRESULT StressLog::Dump(ULONG64 outProcLog, const char* fileName, struct IDebugD // if this is the first time through, inProcPtr->chunkListHead may still contain // the out-of-process value for the chunk pointer. NULL it to avoid AVs if (TO_CDADDR(inProcPtr->chunkListHead) == outProcListHead) - inProcPtr->chunkListHead = NULL; + inProcPtr->chunkListHead = NULL; delete inProcPtr; goto FREE_MEM; } @@ -405,7 +405,7 @@ HRESULT StressLog::Dump(ULONG64 outProcLog, const char* fileName, struct IDebugD inProcPtr->curWriteChunk = inProcChunkPtr; curPtrInitialized = TRUE; } - + outProcChunkPtr = TO_CDADDR(inProcChunkPtr->next); *chunksPtr = inProcChunkPtr; chunksPtr = &inProcChunkPtr->next; @@ -417,9 +417,9 @@ HRESULT StressLog::Dump(ULONG64 outProcLog, const char* fileName, struct IDebugD inProcChunkPtr->next = inProcPtr->chunkListHead; inProcPtr->chunkListHead->prev = inProcChunkPtr; inProcPtr->chunkListTail = inProcChunkPtr; - } + } } while (outProcChunkPtr != outProcListHead); - + if (!curPtrInitialized) { delete inProcPtr; @@ -478,28 +478,28 @@ HRESULT StressLog::Dump(ULONG64 outProcLog, const char* fileName, struct IDebugD void** args; unsigned msgCtr; msgCtr = 0; - for (;;) + for (;;) { ThreadStressLog* latestLog = logs->FindLatestThreadLog(); - if (IsInterrupt()) + if (IsInterrupt()) { vDoOut(bDoGcHist, file, "----- Interrupted by user -----\n"); break; } - if (latestLog == 0) + if (latestLog == 0) { break; } StressMsg* latestMsg = latestLog->readPtr; - if (latestMsg->formatOffset != 0 && !latestLog->CompletedDump()) + if (latestMsg->formatOffset != 0 && !latestLog->CompletedDump()) { TADDR taFmt = (latestMsg->formatOffset) + TO_TADDR(g_hThisInst); hr = memCallBack->ReadVirtual(TO_CDADDR(taFmt), format, 256, 0); - if (hr != S_OK) - strcpy_s(format, _countof(format), "Could not read address of format string"); + if (hr != S_OK) + strcpy_s(format, ARRAY_SIZE(format), "Could not read address of format string"); double deltaTime = ((double) (latestMsg->timeStamp - inProcLog.startTimeStamp)) / inProcLog.tickFrequency; if (bDoGcHist) @@ -508,7 +508,7 @@ HRESULT StressLog::Dump(ULONG64 outProcLog, const char* fileName, struct IDebugD { latestLog->threadId = (unsigned)(size_t)latestMsg->args[0]; } - GcHistAddLog(format, latestMsg); + GcHistAddLog(format, latestMsg); } else { @@ -517,7 +517,7 @@ HRESULT StressLog::Dump(ULONG64 outProcLog, const char* fileName, struct IDebugD fprintf (file, "Task was switched from %x\n", (unsigned)(size_t)latestMsg->args[0]); latestLog->threadId = (unsigned)(size_t)latestMsg->args[0]; } - else + else { args = latestMsg->args; formatOutput(memCallBack, file, format, (unsigned)latestLog->threadId, deltaTime, latestMsg->facility, args); @@ -536,11 +536,11 @@ HRESULT StressLog::Dump(ULONG64 outProcLog, const char* fileName, struct IDebugD } } - if (msgCtr % 64 == 0) + if (msgCtr % 64 == 0) { ExtOut("."); // to indicate progress - if (msgCtr % (64*64) == 0) - ExtOut("\n"); + if (msgCtr % (64*64) == 0) + ExtOut("\n"); } } ExtOut("\n"); diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/SectionBuilder.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/SectionBuilder.cs index 1e02a7868d4bdc..02378eebf555d0 100644 --- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/SectionBuilder.cs +++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/SectionBuilder.cs @@ -26,7 +26,7 @@ public struct SymbolTarget /// Index of the section holding the symbol target. /// public readonly int SectionIndex; - + /// /// Offset of the symbol within the section. /// @@ -46,7 +46,7 @@ public SymbolTarget(int sectionIndex, int offset, int size) Size = size; } } - + /// /// After placing an ObjectData within a section, we use this helper structure to record /// its relocation information for the final relocation pass. @@ -118,7 +118,7 @@ public class Section /// the output code section). /// public readonly int Alignment; - + /// /// Blob builder representing the section content. /// @@ -359,7 +359,7 @@ public int GetSymbolRVA(ISymbolNode symbol) /// Look up final file position for a given symbol. This assumes the section have already been placed. /// /// Symbol to look up - /// File position of the symbol, from the begining of the emitted image + /// File position of the symbol, from the beginning of the emitted image public int GetSymbolFilePosition(ISymbolNode symbol) { SymbolTarget symbolTarget = _symbolMap[symbol]; @@ -419,7 +419,7 @@ public void SetWin32Resources(ISymbolNode symbol, int resourcesSize) } private CoreRTNameMangler _nameMangler; - + private NameMangler GetNameMangler() { if (_nameMangler == null) @@ -572,7 +572,7 @@ public BlobBuilder SerializeSection(string name, SectionLocation sectionLocation { return SerializeRelocationSection(sectionLocation); } - + if (name == R2RPEBuilder.ExportDataSectionName) { return SerializeExportSection(sectionLocation); @@ -637,7 +637,7 @@ private BlobBuilder SerializeRelocationSection(SectionLocation sectionLocation) // Even though the format doesn't dictate it, it seems customary // to align the base RVA's on 4K boundaries. const int BaseRVAAlignment = 1 << RelocationTypeShift; - + BlobBuilder builder = new BlobBuilder(); int baseRVA = 0; List offsetsAndTypes = null; @@ -729,7 +729,7 @@ private static void FlushRelocationBlock(BlobBuilder builder, int baseRVA, List< private BlobBuilder SerializeExportSection(SectionLocation sectionLocation) { _exportSymbols.MergeSort((es1, es2) => StringComparer.Ordinal.Compare(es1.Name, es2.Name)); - + BlobBuilder builder = new BlobBuilder(); int minOrdinal = int.MaxValue; @@ -742,7 +742,7 @@ private BlobBuilder SerializeExportSection(SectionLocation sectionLocation) symbol.NameRVAWhenPlaced = sectionLocation.RelativeVirtualAddress + builder.Count; builder.WriteUTF8(symbol.Name); builder.WriteByte(0); - + if (symbol.Ordinal < minOrdinal) { minOrdinal = symbol.Ordinal; @@ -788,7 +788,7 @@ private BlobBuilder SerializeExportSection(SectionLocation sectionLocation) { builder.WriteInt32(addressTableEntry); } - + // Emit the export directory table builder.Align(4); int exportDirectoryTableRVA = sectionLocation.RelativeVirtualAddress + builder.Count; @@ -817,7 +817,7 @@ private BlobBuilder SerializeExportSection(SectionLocation sectionLocation) int exportDirectorySize = sectionLocation.RelativeVirtualAddress + builder.Count - exportDirectoryTableRVA; _exportDirectoryEntry = new DirectoryEntry(relativeVirtualAddress: exportDirectoryTableRVA, size: exportDirectorySize); - + return builder; } @@ -842,7 +842,7 @@ public void UpdateDirectories(PEDirectoriesBuilder directoriesBuilder) Section section = _sections[symbolTarget.SectionIndex]; Debug.Assert(section.RVAWhenPlaced != 0); - // Windows has a bug in its resource processing logic that occurs when + // Windows has a bug in its resource processing logic that occurs when // 1. A PE file is loaded as a data file // 2. The resource data found in the resources has an RVA which has a magnitude greater than the size of the section which holds the resources // 3. The offset of the start of the resource data from the start of the section is not zero. @@ -858,7 +858,7 @@ public void UpdateDirectories(PEDirectoriesBuilder directoriesBuilder) { directoriesBuilder.ExportTable = _exportDirectoryEntry; } - + int relocationTableRVA = directoriesBuilder.BaseRelocationTable.RelativeVirtualAddress; if (relocationTableRVA == 0) { diff --git a/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/PgoInfoKey.cs b/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/PgoInfoKey.cs index 01405217d8d460..e25f3779d9b2d6 100644 --- a/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/PgoInfoKey.cs +++ b/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/PgoInfoKey.cs @@ -111,7 +111,7 @@ public PgoInfoKey(IAssemblyMetadata componentReader, string owningType, EntityHa { sb.Append(", "); } - sb.AppendFormat($"{Signature.ParameterTypes[i]}"); + sb.Append($"{Signature.ParameterTypes[i]}"); } sb.Append(")"); @@ -135,4 +135,4 @@ public static PgoInfoKey FromReadyToRunMethod(ReadyToRunMethod method) return key; } } -} \ No newline at end of file +} diff --git a/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunMethod.cs b/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunMethod.cs index 9032ef27421797..e1a8b87a764c68 100644 --- a/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunMethod.cs +++ b/src/coreclr/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunMethod.cs @@ -465,7 +465,7 @@ public ReadyToRunMethod( { sb.Append(", "); } - sb.AppendFormat($"{Signature.ParameterTypes[i]}"); + sb.Append($"{Signature.ParameterTypes[i]}"); } sb.Append(")"); diff --git a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/TestMetadataFieldLayoutAlgorithm.cs b/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/TestMetadataFieldLayoutAlgorithm.cs index d6a351850cd9de..fdd8382a5bdcfa 100644 --- a/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/TestMetadataFieldLayoutAlgorithm.cs +++ b/src/coreclr/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/TestMetadataFieldLayoutAlgorithm.cs @@ -30,5 +30,21 @@ protected override void FinalizeRuntimeSpecificStaticFieldLayout(TypeSystemConte layout.ThreadGcStatics.Size = LayoutInt.Zero; } } + + protected override ComputedInstanceFieldLayout ComputeInstanceFieldLayout(MetadataType type, int numInstanceFields) + { + if (type.IsExplicitLayout) + { + return ComputeExplicitFieldLayout(type, numInstanceFields); + } + else if (type.IsSequentialLayout || type.IsEnum) + { + return ComputeSequentialFieldLayout(type, numInstanceFields); + } + else + { + return ComputeAutoFieldLayout(type, numInstanceFields); + } + } } } diff --git a/src/coreclr/tools/aot/jitinterface/jitinterface.h b/src/coreclr/tools/aot/jitinterface/jitinterface.h index aa33a3fc583183..ee00bce0a69b2c 100644 --- a/src/coreclr/tools/aot/jitinterface/jitinterface.h +++ b/src/coreclr/tools/aot/jitinterface/jitinterface.h @@ -56,7 +56,6 @@ struct JitInterfaceCallbacks bool (* isValueClass)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE cls); CorInfoInlineTypeCheck (* canInlineTypeCheck)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE cls, CorInfoInlineTypeCheckSource source); uint32_t (* getClassAttribs)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE cls); - bool (* isStructRequiringStackAllocRetBuf)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE cls); CORINFO_MODULE_HANDLE (* getClassModule)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_CLASS_HANDLE cls); CORINFO_ASSEMBLY_HANDLE (* getModuleAssembly)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_MODULE_HANDLE mod); const char* (* getAssemblyName)(void * thisHandle, CorInfoExceptionClass** ppException, CORINFO_ASSEMBLY_HANDLE assem); @@ -643,15 +642,6 @@ class JitInterfaceWrapper : public ICorJitInfo return temp; } - virtual bool isStructRequiringStackAllocRetBuf( - CORINFO_CLASS_HANDLE cls) -{ - CorInfoExceptionClass* pException = nullptr; - bool temp = _callbacks->isStructRequiringStackAllocRetBuf(_thisHandle, &pException, cls); - if (pException != nullptr) throw pException; - return temp; -} - virtual CORINFO_MODULE_HANDLE getClassModule( CORINFO_CLASS_HANDLE cls) { diff --git a/src/coreclr/tools/dotnet-pgo/CommandLineOptions.cs b/src/coreclr/tools/dotnet-pgo/CommandLineOptions.cs index a2e3a82f37fdb6..f460a5f49817f3 100644 --- a/src/coreclr/tools/dotnet-pgo/CommandLineOptions.cs +++ b/src/coreclr/tools/dotnet-pgo/CommandLineOptions.cs @@ -18,6 +18,7 @@ internal class CommandLineOptions public FileInfo TraceFile; public FileInfo OutputFileName; + public FileInfo PreciseDebugInfoFile; public int? Pid; public string ProcessName; public PgoFileType? FileType; @@ -29,8 +30,7 @@ internal class CommandLineOptions public bool ValidateOutputFile; public bool GenerateCallGraph; public bool Spgo; - public bool SpgoIncludeBlockCounts; - public bool SpgoIncludeEdgeCounts; + public bool IncludeFullGraphs; public int SpgoMinSamples = 50; public bool VerboseWarnings; public jittraceoptions JitTraceOptions; @@ -45,6 +45,8 @@ internal class CommandLineOptions public bool DumpMibc = false; public FileInfo InputFileToDump; public List CompareMibc; + public DirectoryInfo DumpWorstOverlapGraphsTo; + public int DumpWorstOverlapGraphs = -1; public bool InheritTimestamp; public string[] HelpArgs = Array.Empty(); @@ -196,13 +198,15 @@ void HelpOption() CommonOptions(); CompressedOption(); + string preciseDebugInfoFile = null; + syntax.DefineOption(name: "precise-debug-info-file", ref preciseDebugInfoFile, "Name of file of newline separated JSON objects containing precise debug info"); + if (preciseDebugInfoFile != null) + PreciseDebugInfoFile = new FileInfo(preciseDebugInfoFile); + syntax.DefineOption(name: "spgo", value: ref Spgo, help: "Base profile on samples in the input. Uses last branch records if available and otherwise raw IP samples.", requireValue: false); - syntax.DefineOption(name: "spgo-with-block-counts", value: ref SpgoIncludeBlockCounts, help: "Include block counts in the written .mibc file. If neither this nor spgo-with-edge-counts are specified, then defaults to true.", requireValue: false); - syntax.DefineOption(name: "spgo-with-edge-counts", value: ref SpgoIncludeEdgeCounts, help: "Include edge counts in the written .mibc file.", requireValue: false); syntax.DefineOption(name: "spgo-min-samples", value: ref SpgoMinSamples, help: $"The minimum number of total samples a function must have before generating profile data for it with SPGO. Default: {SpgoMinSamples}", requireValue: false); - if (!SpgoIncludeBlockCounts && !SpgoIncludeEdgeCounts) - SpgoIncludeBlockCounts = true; + syntax.DefineOption(name: "include-full-graphs", value: ref IncludeFullGraphs, help: "Include all blocks and edges in the written .mibc file, regardless of profile counts", requireValue: false); HelpOption(); } @@ -305,6 +309,12 @@ void HelpOption() CompareMibc = DefineFileOptionList(name: "i|input", help: "The input .mibc files to be compared. Specify as --input file1.mibc --input file2.mibc"); if (CompareMibc.Count != 2) Help = true; + + syntax.DefineOption(name: "dump-worst-overlap-graphs", value: ref DumpWorstOverlapGraphs, help: "Number of graphs to dump to .dot format in dump-worst-overlap-graphs-to directory"); + string dumpWorstOverlapGraphsTo = null; + syntax.DefineOption(name: "dump-worst-overlap-graphs-to", value: ref dumpWorstOverlapGraphsTo, help: "Number of graphs to dump to .dot format in dump-worst-overlap-graphs-to directory"); + if (dumpWorstOverlapGraphsTo != null) + DumpWorstOverlapGraphsTo = new DirectoryInfo(dumpWorstOverlapGraphsTo); } if (syntax.ActiveCommand == null) diff --git a/src/coreclr/tools/dotnet-pgo/MethodMemoryMap.cs b/src/coreclr/tools/dotnet-pgo/MethodMemoryMap.cs index 0a5074d0cf2435..ed80098b9ecfc8 100644 --- a/src/coreclr/tools/dotnet-pgo/MethodMemoryMap.cs +++ b/src/coreclr/tools/dotnet-pgo/MethodMemoryMap.cs @@ -8,7 +8,10 @@ using System.IO; using System.Linq; using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; using System.Threading.Tasks; +using ILCompiler.Reflection.ReadyToRun; using Internal.TypeSystem; using Microsoft.Diagnostics.Tracing.Etlx; using Microsoft.Diagnostics.Tracing.Parsers.Clr; @@ -48,6 +51,7 @@ public MethodMemoryMap( TraceTypeSystemContext tsc, TraceRuntimeDescToTypeSystemDesc idParser, int clrInstanceID, + FileInfo preciseDebugInfoFile, Logger logger) { // Capture the addresses of jitted code @@ -145,7 +149,7 @@ public MethodMemoryMap( StartAddress = module.ImageBase + (ulong)runtimeFunction.StartAddress, EndAddress = module.ImageBase + (ulong)runtimeFunction.StartAddress + (uint)runtimeFunction.Size, Method = methodEntry.Key, - NativeToILMap = runtimeFunction.DebugInfo != null ? NativeToILMap.FromR2RBounds(runtimeFunction.DebugInfo.BoundsList) : null, + NativeToILMap = runtimeFunction.DebugInfo != null ? CreateNativeToILMap(methodEntry.Key, runtimeFunction.DebugInfo.BoundsList) : null, }); } } @@ -156,11 +160,31 @@ public MethodMemoryMap( } } - // Associate NativeToILMap with MethodLoad event found Memory Regions - foreach (MethodILToNativeMapTraceData e in p.EventsInProcess.ByEventType()) + List preciseInfos = null; + if (preciseDebugInfoFile != null) { - if (info.TryGetValue(new JittedID(e.MethodID, e.ReJITID), out MemoryRegionInfo inf)) - inf.NativeToILMap = NativeToILMap.FromEvent(e); + preciseInfos = + File.ReadAllLines(preciseDebugInfoFile.FullName) + .Select(l => JsonSerializer.Deserialize(l)) + .ToList(); + } + + if (preciseInfos != null && preciseInfos.Count > 0) + { + foreach (PreciseDebugInfo preciseDebugInf in preciseInfos) + { + if (info.TryGetValue(new JittedID((long)preciseDebugInf.MethodID, 0), out MemoryRegionInfo inf)) + inf.NativeToILMap = CreateNativeToILMap(idParser, preciseDebugInf); + } + } + else + { + // Associate NativeToILMap with MethodLoad event found Memory Regions + foreach (MethodILToNativeMapTraceData e in p.EventsInProcess.ByEventType()) + { + if (info.TryGetValue(new JittedID(e.MethodID, e.ReJITID), out MemoryRegionInfo inf)) + inf.NativeToILMap = CreateNativeToILMap(inf.Method, e); + } } // Sort the R2R data by StartAddress @@ -221,13 +245,60 @@ private class MemoryRegionInfoStartAddressComparer : IComparer { int IComparer.Compare(MemoryRegionInfo x, MemoryRegionInfo y) => x.StartAddress.CompareTo(y.StartAddress); } + + private static KeyValueMap CreateNativeToILMap(MethodDesc method, List boundsList) + { + List sorted = boundsList.OrderBy(e => e.NativeOffset).ToList(); + + return new(sorted.Select(e => e.NativeOffset).ToArray(), sorted.Select(e => new IPMapping((int)e.ILOffset, null, method)).ToArray()); + } + + private static KeyValueMap CreateNativeToILMap(MethodDesc method, MethodILToNativeMapTraceData ev) + { + List<(uint rva, int ilOffset)> pairs = new List<(uint rva, int ilOffset)>(ev.CountOfMapEntries); + for (int i = 0; i < ev.CountOfMapEntries; i++) + pairs.Add(((uint)ev.NativeOffset(i), ev.ILOffset(i))); + + pairs.RemoveAll(p => p.ilOffset < 0); + pairs.Sort((p1, p2) => p1.rva.CompareTo(p2.rva)); + return new(pairs.Select(p => p.rva).ToArray(), pairs.Select(p => new IPMapping(p.ilOffset, null, method)).ToArray()); + } + + private static KeyValueMap CreateNativeToILMap(TraceRuntimeDescToTypeSystemDesc idParser, PreciseDebugInfo inf) + { + Dictionary byOrdinal = new(); + AddSubTree(inf.InlineTree); + + void AddSubTree(InlineContext ctx) + { + MethodDesc md = idParser.ResolveMethodID((long)ctx.MethodID, false); + byOrdinal.Add(ctx.Ordinal, (ctx, md)); + + foreach (var child in ctx.Inlinees) + AddSubTree(child); + } + + var ordered = inf.Mappings.OrderBy(m => m.NativeOffset).ToList(); + IPMapping CreateMapping(PreciseIPMapping preciseMapping) + { + (InlineContext ctx, MethodDesc md) = byOrdinal[preciseMapping.InlineContext]; + return new IPMapping(checked((int)preciseMapping.ILOffset), ctx, md); + } + + return new(ordered.Select(p => p.NativeOffset).ToArray(), ordered.Select(CreateMapping).ToArray()); + } } - public class MemoryRegionInfo + internal class MemoryRegionInfo { public ulong StartAddress { get; set; } public ulong EndAddress { get; set; } public MethodDesc Method { get; set; } - public NativeToILMap NativeToILMap { get; set; } + public KeyValueMap NativeToILMap { get; set; } } + + internal record struct IPMapping( + int ILOffset, + InlineContext InlineContext, + MethodDesc InlineeMethod); } diff --git a/src/coreclr/tools/dotnet-pgo/PgoCompareMethodFlowGraph.cs b/src/coreclr/tools/dotnet-pgo/PgoCompareMethodFlowGraph.cs new file mode 100644 index 00000000000000..fd7556ecce6a06 --- /dev/null +++ b/src/coreclr/tools/dotnet-pgo/PgoCompareMethodFlowGraph.cs @@ -0,0 +1,292 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ILCompiler; +using Internal.Pgo; + +namespace Microsoft.Diagnostics.Tools.Pgo +{ + internal class PgoCompareMethodFlowGraph + { + public bool ProfilesHadBasicBlocks { get; init; } + public bool ProfilesHadEdges { get; init; } + public PgoCompareMethodBasicBlock EntryBasicBlock { get; init; } + public List BasicBlocks { get; init; } + + public long TotalBlockCount1 => BasicBlocks.Sum(bb => bb.BlockCount1); + public long TotalBlockCount2 => BasicBlocks.Sum(bb => bb.BlockCount2); + public long TotalEdgeCount1 => BasicBlocks.Sum(bb => bb.Edges.Sum(e => e.Value.Count1)); + public long TotalEdgeCount2 => BasicBlocks.Sum(bb => bb.Edges.Sum(e => e.Value.Count2)); + + public double ComputeBlockOverlap() + { + long total1 = TotalBlockCount1; + long total2 = TotalBlockCount2; + + if (total1 == 0 && total2 == 0) + return 1; + + if (total1 == 0 || total2 == 0) + return 0; + + double overlap = + BasicBlocks + .Sum(bb => Math.Min(bb.BlockCount1 / (double)total1, bb.BlockCount2 / (double)total2)); + return overlap; + } + + public double ComputeEdgeOverlap() + { + long total1 = TotalEdgeCount1; + long total2 = TotalEdgeCount2; + + if (total1 == 0 && total2 == 0) + return 1; + + if (total1 == 0 || total2 == 0) + return 0; + + double overlap = + BasicBlocks + .Sum(bb => bb.Edges.Values.Sum(e => Math.Min(e.Count1 / (double)total1, e.Count2 / (double)total2))); + return overlap; + } + + public string Dump(string title) + { + long totalBlockCount1 = TotalBlockCount1; + long totalBlockCount2 = TotalBlockCount2; + + string createWeightLabel(long weight1, long totalWeight1, long weight2, long totalWeight2) + { + string label = ""; + if (totalWeight1 == 0) + { + label += "N/A"; + } + else + { + double pw = weight1 / (double)totalWeight1; + label += $"{pw * 100:F2}%"; + } + + label += " vs "; + if (totalWeight2 == 0) + { + label += "N/A"; + } + else + { + double pw = weight2 / (double)totalWeight2; + label += $"{pw * 100:F2}%"; + } + + return label; + } + + string getLabel(PgoCompareMethodBasicBlock bb) + { + string label = $"@ {bb.ILOffset:x3}"; + if (ProfilesHadBasicBlocks && (totalBlockCount1 != 0 || totalBlockCount2 != 0)) + { + label += $"\\n{createWeightLabel(bb.BlockCount1, totalBlockCount1, bb.BlockCount2, totalBlockCount2)}"; + } + + return label; + } + + long totalEdgeCount1 = TotalEdgeCount1; + long totalEdgeCount2 = TotalEdgeCount2; + + string getEdgeLabel((PgoCompareMethodBasicBlock from, PgoCompareMethodBasicBlock to) edge) + { + if (!ProfilesHadEdges) + return ""; + + (long weight1, long weight2) = edge.from.Edges[edge.to]; + return createWeightLabel(weight1, totalEdgeCount1, weight2, totalEdgeCount2); + } + + string dot = + FlowGraphHelper.DumpGraph( + BasicBlocks, EntryBasicBlock, + bb => new HashSet(bb.Edges.Keys), + title, + getLabel, + getEdgeLabel); + return dot; + } + + public static PgoCompareMethodFlowGraph Create( + MethodProfileData profile1, + string name1, + MethodProfileData profile2, + string name2, + out List errors) + { + errors = new List(); + if (profile1?.SchemaData == null) + { + errors.Add($"Profile data missing from {name1}"); + return null; + } + if (profile2?.SchemaData == null) + { + errors.Add($"Profile data missing from {name2}"); + return null; + } + + var (blocks1, blocks2) = (GroupBlocks(profile1), GroupBlocks(profile2)); + var (edges1, edges2) = (GroupEdges(profile1), GroupEdges(profile2)); + bool hasBlocks1 = blocks1.Count != 0; + bool hasBlocks2 = blocks2.Count != 0; + bool hasEdges1 = edges1.Count != 0; + bool hasEdges2 = edges2.Count != 0; + if (!hasBlocks1 && !hasBlocks2 && !hasEdges1 && !hasEdges2) + { + errors.Add($"No profile data present in either {name1} or {name2}"); + return null; + } + + bool hasComparableProfileData = + (hasBlocks1 && hasBlocks2) || + (hasEdges1 && hasEdges2); + + if (!hasComparableProfileData) + { + errors.Add($"No comparable profile data present"); + return null; + } + + if (hasBlocks1 && hasBlocks2) + { + var in1 = blocks1.Keys.Where(k => !blocks2.ContainsKey(k)).ToList(); + var in2 = blocks2.Keys.Where(k => !blocks1.ContainsKey(k)).ToList(); + + foreach (var m1 in in1) + errors.Add($"{name1} has a block at {m1:x} not present in {name2}"); + foreach (var m2 in in2) + errors.Add($"{name2} has a block at {m2:x} not present in {name1}"); + } + + if (hasEdges1 && hasEdges2) + { + var in1 = edges1.Keys.Where(k => !edges2.ContainsKey(k)).ToList(); + var in2 = edges2.Keys.Where(k => !edges1.ContainsKey(k)).ToList(); + + foreach (var (from, to) in in1) + errors.Add($"{name1} has an edge {from:x}->{to:x} not present in {name2}"); + foreach (var (from, to) in in2) + errors.Add($"{name2} has an edge {from:x}->{to:x} not present in {name1}"); + } + + if (errors.Count > 0) + { + // Do not continue if flow graphs do not match + return null; + } + + // Note: We permit missing data in one of the two profiles (e.g. + // instrumentation will typically not contain edges if we asked for + // BBs, but we can still compare with SPGO with arg + // --include-full-graphs this way). + + Dictionary ilToBB = new(); + foreach ((int ilOffs, _) in hasBlocks1 ? blocks1 : blocks2) + { + ilToBB.Add( + ilOffs, + new PgoCompareMethodBasicBlock + { + ILOffset = ilOffs, + BlockCount1 = blocks1.TryGetValue(ilOffs, out PgoSchemaElem elem) ? elem.DataLong : 0, + BlockCount2 = blocks2.TryGetValue(ilOffs, out elem) ? elem.DataLong : 0, + }); + } + + foreach (((int ilFrom, int ilTo), _) in hasEdges1 ? edges1 : edges2) + { + if (!ilToBB.TryGetValue(ilFrom, out PgoCompareMethodBasicBlock bbFrom)) + { + if (hasBlocks1 || hasBlocks2) + { + errors.Add($"There is an edge from {ilFrom} -> {ilTo}, but no basic block found at {ilFrom}"); + } + else + { + // If we have no BBs at all use the edges to construct BBs. + ilToBB.Add(ilFrom, bbFrom = new PgoCompareMethodBasicBlock + { + ILOffset = ilFrom + }); + } + } + + if (!ilToBB.TryGetValue(ilTo, out PgoCompareMethodBasicBlock bbTo)) + { + if (hasBlocks1 || hasBlocks2) + { + errors.Add($"There is an edge from {ilFrom} -> {ilTo}, but no basic block found at {ilTo}"); + } + else + { + // If we have no BBs at all use the edges to construct BBs. + ilToBB.Add(ilTo, bbTo = new PgoCompareMethodBasicBlock + { + ILOffset = ilTo + }); + } + } + + long edgeCount1 = edges1.TryGetValue((ilFrom, ilTo), out PgoSchemaElem elem) ? elem.DataLong : 0; + long edgeCount2 = edges2.TryGetValue((ilFrom, ilTo), out elem) ? elem.DataLong : 0; + bbFrom.Edges.Add(bbTo, (edgeCount1, edgeCount2)); + } + + if (!ilToBB.TryGetValue(0, out PgoCompareMethodBasicBlock entryBasicBlock)) + { + errors.Add("No entry block found"); + return null; + } + + return new PgoCompareMethodFlowGraph + { + BasicBlocks = ilToBB.Values.ToList(), + EntryBasicBlock = entryBasicBlock, + ProfilesHadBasicBlocks = hasBlocks1 && hasBlocks2, + ProfilesHadEdges = hasEdges1 && hasEdges2, + }; + } + + private static Dictionary GroupBlocks(MethodProfileData data) + { + return data.SchemaData + .Where(e => e.InstrumentationKind == PgoInstrumentationKind.BasicBlockIntCount || e.InstrumentationKind == PgoInstrumentationKind.BasicBlockLongCount) + .ToDictionary(e => e.ILOffset); + } + + private static Dictionary<(int, int), PgoSchemaElem> GroupEdges(MethodProfileData data) + { + return data.SchemaData + .Where(e => e.InstrumentationKind == PgoInstrumentationKind.EdgeIntCount || e.InstrumentationKind == PgoInstrumentationKind.EdgeLongCount) + .ToDictionary(e => (e.ILOffset, e.Other)); + } + } + + internal sealed class PgoCompareMethodBasicBlock + { + public int ILOffset { get; init; } + public long BlockCount1 { get; init; } + public long BlockCount2 { get; init; } + + public Dictionary Edges { get; } = new(); + + public override bool Equals(object obj) => obj is PgoCompareMethodBasicBlock block && ILOffset == block.ILOffset; + public override int GetHashCode() => HashCode.Combine(ILOffset); + } +} diff --git a/src/coreclr/tools/dotnet-pgo/Program.cs b/src/coreclr/tools/dotnet-pgo/Program.cs index 4d21459717d028..c3a13789686abe 100644 --- a/src/coreclr/tools/dotnet-pgo/Program.cs +++ b/src/coreclr/tools/dotnet-pgo/Program.cs @@ -439,7 +439,7 @@ static int InnerCompareMibcMain(CommandLineOptions options) PrintOutput($"# Profiled methods in {name1} not in {name2}: {profiledMethods1.Select(m => m.Method).Except(profiledMethods2.Select(m => m.Method)).Count()}"); PrintOutput($"# Profiled methods in {name2} not in {name1}: {profiledMethods2.Select(m => m.Method).Except(profiledMethods1.Select(m => m.Method)).Count()}"); PrintOutput($"# Methods with profile data in both .mibc files: {profiledMethods1.Select(m => m.Method).Intersect(profiledMethods2.Select(m => m.Method)).Count()}"); - var fgMatches = new List<(MethodProfileData prof1, MethodProfileData prof2)>(); + var fgMatches = new Dictionary(); var fgMismatches = new List<(MethodProfileData prof1, MethodProfileData prof2, List mismatches)>(); foreach (MethodProfileData prof1 in profiledMethods1) @@ -448,36 +448,15 @@ static int InnerCompareMibcMain(CommandLineOptions options) if (prof2?.SchemaData == null) continue; - var (blocks1, blocks2) = (GroupBlocks(prof1), GroupBlocks(prof2)); - var (edges1, edges2) = (GroupEdges(prof1), GroupEdges(prof2)); - - List mismatches = new List(); - if (blocks1.Count > 0 && blocks2.Count > 0) + PgoCompareMethodFlowGraph graph = PgoCompareMethodFlowGraph.Create(prof1, name1, prof2, name2, out var errors); + if (graph != null) { - var in1 = blocks1.Keys.Where(k => !blocks2.ContainsKey(k)).ToList(); - var in2 = blocks2.Keys.Where(k => !blocks1.ContainsKey(k)).ToList(); - - foreach (var m1 in in1) - mismatches.Add($"{name1} has a block at {m1:x} not present in {name2}"); - foreach (var m2 in in2) - mismatches.Add($"{name2} has a block at {m2:x} not present in {name1}"); + fgMatches.Add(prof1.Method, graph); } - - if (edges1.Count > 0 && edges2.Count > 0) + else { - var in1 = edges1.Keys.Where(k => !edges2.ContainsKey(k)).ToList(); - var in2 = edges2.Keys.Where(k => !edges1.ContainsKey(k)).ToList(); - - foreach (var (from, to) in in1) - mismatches.Add($"{name1} has an edge {from:x}->{to:x} not present in {name2}"); - foreach (var (from, to) in in2) - mismatches.Add($"{name2} has an edge {from:x}->{to:x} not present in {name1}"); + fgMismatches.Add((prof1, prof2, errors)); } - - if (mismatches.Count > 0) - fgMismatches.Add((prof1, prof2, mismatches)); - else - fgMatches.Add((prof1, prof2)); } PrintOutput($" Of these, {fgMatches.Count} have matching flow-graphs and the remaining {fgMismatches.Count} do not"); @@ -502,37 +481,13 @@ static int InnerCompareMibcMain(CommandLineOptions options) var blockOverlaps = new List<(MethodDesc Method, double Overlap)>(); var edgeOverlaps = new List<(MethodDesc Method, double Overlap)>(); - foreach ((MethodProfileData prof1, MethodProfileData prof2) in fgMatches) + foreach ((MethodDesc method, PgoCompareMethodFlowGraph fg) in fgMatches) { - var (blocks1, blocks2) = (GroupBlocks(prof1), GroupBlocks(prof2)); - var (edges1, edges2) = (GroupEdges(prof1), GroupEdges(prof2)); - - double Overlap(Dictionary left, Dictionary right) - { - long leftTotal = left.Values.Sum(e => e.DataLong); - long rightTotal = right.Values.Sum(e => e.DataLong); - Debug.Assert(left.Keys.All(k => right.ContainsKey(k))); - Debug.Assert(right.Keys.All(k => left.ContainsKey(k))); - - if (leftTotal == 0 && rightTotal == 0) - return 1; - - if (leftTotal == 0 || rightTotal == 0) - return 0; - - var leftPW = left.ToDictionary(k => k.Key, k => k.Value.DataLong / (double)leftTotal); - var rightPW = right.ToDictionary(k => k.Key, k => k.Value.DataLong / (double)rightTotal); - - double overlap = leftPW.Sum(k => Math.Min(k.Value, rightPW[k.Key])); - return overlap; - } + if (fg.ProfilesHadBasicBlocks) + blockOverlaps.Add((method, fg.ComputeBlockOverlap())); - Debug.Assert(prof1.Method == prof2.Method); - if (blocks1.Count > 0 && blocks2.Count > 0) - blockOverlaps.Add((prof1.Method, Overlap(blocks1, blocks2))); - - if (edges1.Count > 0 && edges2.Count > 0) - edgeOverlaps.Add((prof1.Method, Overlap(edges1, edges2))); + if (fg.ProfilesHadEdges) + edgeOverlaps.Add((method, fg.ComputeEdgeOverlap())); } void PrintHistogram(List<(MethodDesc Method, double Overlap)> overlaps) @@ -614,8 +569,11 @@ void PrintBar(string label, ref int curIndex, Func include, bool f int devirtToSame = 0; int devirtToSameLikelihood100 = 0; int devirtToSameLikelihood70 = 0; - foreach ((MethodProfileData prof1, MethodProfileData prof2) in fgMatches) + foreach ((MethodDesc method, PgoCompareMethodFlowGraph fg) in fgMatches) { + MethodProfileData prof1 = profile1.GetMethodProfileData(method); + MethodProfileData prof2 = profile2.GetMethodProfileData(method); + List typeHandleHistogramCallSites = prof1.SchemaData.Concat(prof2.SchemaData) .Where(e => e.InstrumentationKind == PgoInstrumentationKind.GetLikelyClass || e.InstrumentationKind == PgoInstrumentationKind.TypeHandleHistogramTypeHandle) @@ -662,6 +620,59 @@ string FormatDevirt(GetLikelyClassResult result) PrintOutput($" At +{change.ilOffset:x}: {FormatDevirt(change.result1)} vs {FormatDevirt(change.result2)}"); } } + + if (options.DumpWorstOverlapGraphsTo != null) + { + IEnumerable toDump; + if (options.DumpWorstOverlapGraphs == -1) + { + // Take all with less than 0.5 overlap in order. + toDump = + blockOverlaps + .Concat(edgeOverlaps) + .OrderBy(t => t.Overlap) + .TakeWhile(t => t.Overlap < 0.5) + .Select(t => t.Method) + .Distinct(); + } + else + { + // Take the first N methods ordered by min(blockOverlap, edgeOverlap). + toDump = + blockOverlaps + .Concat(edgeOverlaps) + .GroupBy(t => t.Method) + .Select(g => (Method: g.Key, Overlap: g.Select(t => t.Overlap).Min())) + .OrderBy(t => t.Overlap) + .Select(t => t.Method) + .Take(options.DumpWorstOverlapGraphs); + } + + foreach (MethodDesc method in toDump) + { + PgoCompareMethodFlowGraph fg = fgMatches[method]; + + string title = $"Flowgraph for {method}\\n{name1} vs {name2}"; + if (fg.ProfilesHadBasicBlocks) + { + title += $"\\nBasic block counts: {fg.TotalBlockCount1} vs {fg.TotalEdgeCount2}"; + title += $"\\nBasic block count overlap: {fg.ComputeBlockOverlap() * 100:F2}%"; + } + if (fg.ProfilesHadEdges) + { + title += $"\\nEdge counts: {fg.TotalEdgeCount1} vs {fg.TotalEdgeCount2}"; + title += $"\\nEdge count overlap: {fg.ComputeEdgeOverlap() * 100:F2}%"; + } + + string dot = fg.Dump(title); + + string fileName = DebugNameFormatter.Instance.FormatName(method.OwningType, DebugNameFormatter.FormatOptions.NamespaceQualify) + "." + method.DiagnosticName; + foreach (char c in Path.GetInvalidFileNameChars()) + fileName = fileName.Replace(c, '_'); + + File.WriteAllText(Path.Combine(options.DumpWorstOverlapGraphsTo.FullName, fileName + ".dot"), dot); + } + } } return 0; @@ -808,8 +819,8 @@ static bool CountersSumToZero(MethodProfileData data) List methodsWithZeroCounters = profiledMethods.Where(CountersSumToZero).ToList(); if (methodsWithZeroCounters.Count > 0) { - PrintOutput($"There are {methodsWithZeroCounters.Count} methods whose counters sum to 0:"); - foreach (MethodProfileData mpd in methodsWithZeroCounters) + PrintOutput($"There are {methodsWithZeroCounters.Count} methods whose counters sum to 0{(methodsWithZeroCounters.Count > 10 ? " (10 shown)" : "")}:"); + foreach (MethodProfileData mpd in methodsWithZeroCounters.Take(10)) PrintOutput($" {mpd.Method}"); } @@ -865,7 +876,7 @@ static bool IsUnknownTypeHandle(int handle) for (int i = 0; i < schema.Length; i++) { var elem = schema[i]; - if (elem.ILOffset == ilOffset) + if (elem.ILOffset != ilOffset) continue; if (elem.InstrumentationKind == PgoInstrumentationKind.GetLikelyClass) @@ -915,20 +926,6 @@ static bool IsUnknownTypeHandle(int handle) return new GetLikelyClassResult { IsNull = true }; } - private static Dictionary GroupBlocks(MethodProfileData data) - { - return data.SchemaData - .Where(e => e.InstrumentationKind == PgoInstrumentationKind.BasicBlockIntCount || e.InstrumentationKind == PgoInstrumentationKind.BasicBlockLongCount) - .ToDictionary(e => e.ILOffset); - } - - private static Dictionary<(int, int), PgoSchemaElem> GroupEdges(MethodProfileData data) - { - return data.SchemaData - .Where(e => e.InstrumentationKind == PgoInstrumentationKind.EdgeIntCount || e.InstrumentationKind == PgoInstrumentationKind.EdgeLongCount) - .ToDictionary(e => (e.ILOffset, e.Other)); - } - static int InnerProcessTraceFileMain(CommandLineOptions commandLineOptions) { if (commandLineOptions.TraceFile == null) @@ -1003,9 +1000,9 @@ static int InnerProcessTraceFileMain(CommandLineOptions commandLineOptions) { PrintError("Trace file contains multiple processes to distinguish between"); PrintOutput("Either a pid or process name from the following list must be specified"); - foreach (TraceProcess proc in traceLog.Processes) + foreach (TraceProcess proc in traceLog.Processes.OrderByDescending(proc => proc.CPUMSec)) { - PrintOutput($"Procname = {proc.Name} Pid = {proc.ProcessID}"); + PrintOutput($"Procname = {proc.Name} Pid = {proc.ProcessID} CPUMsec = {proc.CPUMSec:F0}"); } return 1; } @@ -1321,6 +1318,7 @@ MethodMemoryMap GetMethodMemMap() tsc, idParser, clrInstanceId.Value, + commandLineOptions.PreciseDebugInfoFile, s_logger); } @@ -1451,84 +1449,31 @@ void AddToInstrumentationData(int eventClrInstanceId, long methodID, int methodF } } - Dictionary sampleProfiles = new Dictionary(); + SampleCorrelator correlator = null; if (commandLineOptions.Spgo) { - MethodMemoryMap mmap = GetMethodMemMap(); - Dictionary ils = new Dictionary(); - Dictionary flowGraphs = new Dictionary(); - - MethodIL GetMethodIL(MethodDesc desc) - { - if (!ils.TryGetValue(desc, out MethodIL il)) - { - il = desc switch - { - EcmaMethod em => EcmaMethodIL.Create(em), - var m => new InstantiatedMethodIL(m, EcmaMethodIL.Create((EcmaMethod)m.GetTypicalMethodDefinition())), - }; - - ils.Add(desc, il); - } - - return il; - } - - FlowGraph GetFlowGraph(MethodDesc desc) - { - if (!flowGraphs.TryGetValue(desc, out FlowGraph fg)) - { - flowGraphs.Add(desc, fg = FlowGraph.Create(GetMethodIL(desc))); - } - - return fg; - } + correlator = new SampleCorrelator(GetMethodMemMap()); Guid lbrGuid = Guid.Parse("99134383-5248-43fc-834b-529454e75df3"); bool hasLbr = traceLog.Events.Any(e => e.TaskGuid == lbrGuid); if (!hasLbr) { - // No LBR data, use standard IP samples. First convert each sample to a tuple of (Method, raw IP, IL offset). - (MethodDesc Method, ulong IP, int Offset) GetTuple(SampledProfileTraceData e) - { - MemoryRegionInfo info = mmap.GetInfo(e.InstructionPointer); - if (info == null) - return (null, e.InstructionPointer, -1); - - int offset = info.NativeToILMap?.Lookup(checked((uint)(e.InstructionPointer - info.StartAddress))) ?? -1; - return (info.Method, e.InstructionPointer, offset); - } - - var samples = - p.EventsInProcess.ByEventType() - .Select(GetTuple) - .Where(t => t.Method != null && t.Offset >= 0) - .ToList(); - - // Now find all samples in each method. - foreach (var g in samples.GroupBy(t => t.Method)) + foreach (SampledProfileTraceData e in p.EventsInProcess.ByEventType()) { - // SPGO is quite sensitive with low counts, so check if we should not generate SPGO data for this function. - if (g.Count() < commandLineOptions.SpgoMinSamples) - continue; - - MethodIL il = GetMethodIL(g.Key); - SampleProfile sp = SampleProfile.Create(il, GetFlowGraph(g.Key), g.Select(t => t.Offset)); - sampleProfiles.Add(g.Key, sp); + correlator.AttributeSamplesToIP(e.InstructionPointer, 1); } - PrintOutput($"Profile is based on {samples.Count} samples"); + PrintOutput($"Samples outside managed code: {correlator.SamplesOutsideManagedCode}"); + PrintOutput($"Samples in managed code that does not have native<->IL mappings: {correlator.SamplesInManagedCodeWithoutAnyMappings}"); + PrintOutput($"Samples in managed code with mappings that could not be correlated: {correlator.SamplesInManagedCodeOutsideMappings}"); + PrintOutput($"Samples in inlinees that were not present in ETW events: {correlator.SamplesInUnknownInlinees}"); + PrintOutput($"Samples in managed code for which we could not get the IL: {correlator.SamplesInManagedCodeWithoutIL}"); + PrintOutput($"Samples in managed code that could not be attributed to the method's flow graph: {correlator.SamplesInManagedCodeOutsideFlowGraph}"); + PrintOutput($"Samples successfully attributed: {correlator.TotalAttributedSamples}"); } else { - // We have LBR data. We use the LBR data to collect straight-line runs that the CPU did in this process inside managed methods. - // That is, if we first see a branch from A -> B followed by a branch from C -> D, then we can conclude that the CPU executed - // code from B -> C. We call this a 'run' and collect each run and its multiplicity. - // Later, we will find all IL offsets on this path and assign samples to the distinct basic blocks corresponding to those IL offsets. - Dictionary<(ulong startRun, ulong endRun), long> runs = new Dictionary<(ulong startRun, ulong endRun), long>(); - List<(ulong start, ulong end)> lbrRuns = new List<(ulong start, ulong end)>(); - LbrEntry64[] lbr64Arr = null; long numLbrRecords = 0; foreach (var e in traceLog.Events) { @@ -1543,7 +1488,6 @@ FlowGraph GetFlowGraph(MethodDesc desc) unsafe { - Span lbr; if (traceLog.PointerSize == 4) { // For 32-bit machines we convert the data into a 64-bit format first. @@ -1552,18 +1496,7 @@ FlowGraph GetFlowGraph(MethodDesc desc) continue; Span lbr32 = data->Entries(e.EventDataLength); - if (lbr64Arr == null || lbr64Arr.Length < lbr32.Length) - lbr64Arr = new LbrEntry64[lbr32.Length]; - - for (int i = 0; i < lbr32.Length; i++) - { - ref LbrEntry64 entry = ref lbr64Arr[i]; - entry.FromAddress = lbr32[i].FromAddress; - entry.ToAddress = lbr32[i].ToAddress; - entry.Reserved = lbr32[i].Reserved; - } - - lbr = lbr64Arr[0..lbr32.Length]; + correlator.AttributeSampleToLbrRuns(lbr32); } else { @@ -1576,107 +1509,16 @@ FlowGraph GetFlowGraph(MethodDesc desc) if (data->ProcessId != p.ProcessID) continue; - lbr = data->Entries(e.EventDataLength); - } - - // Store runs. LBR is chronological with most recent branches first. - // To avoid double-counting blocks containing calls when the LBR buffer contains - // both the call and the return from the call, we have to do some fancy things - // when seeing cross-function branches, so we use a temporary list of runs - // that we assign into the global dictionary. - lbrRuns.Clear(); - for (int i = lbr.Length - 2; i >= 0; i--) - { - ulong prevFrom = lbr[i + 1].FromAddress; - ulong prevTo = lbr[i + 1].ToAddress; - ulong curFrom = lbr[i].FromAddress; - MemoryRegionInfo prevFromMeth = methodMemMap.GetInfo(prevFrom); - MemoryRegionInfo prevToMeth = methodMemMap.GetInfo(prevTo); - MemoryRegionInfo curFromMeth = methodMemMap.GetInfo(curFrom); - // If this run is not in the same function then ignore it. - if (prevToMeth == null || prevToMeth != curFromMeth) - continue; - - // Otherwise, if this run follows right after jumping back into the function, we might need to extend - // a previous run instead. This happens if we previously did a call out of this function and now returned back. - // TODO: Handle recursion here. The same function could return to itself and we wouldn't realize it from this check. - if (prevFromMeth != prevToMeth) - { - bool extendedPrevRun = false; - // Try to find a previous run. Iterate in reverse to simulate stack behavior of calls. - FlowGraph toFG = null; - for (int j = lbrRuns.Count - 1; j >= 0; j--) - { - MemoryRegionInfo endRunMeth = methodMemMap.GetInfo(lbrRuns[j].end); - if (endRunMeth != prevToMeth) - continue; - - // Same function at least, check for same basic block - toFG ??= GetFlowGraph(endRunMeth.Method); - BasicBlock endRunBB = toFG.Lookup(endRunMeth.NativeToILMap.Lookup((uint)(lbrRuns[j].end - endRunMeth.StartAddress))); - BasicBlock toBB = toFG.Lookup(endRunMeth.NativeToILMap.Lookup((uint)(prevTo - endRunMeth.StartAddress))); - if (endRunBB == toBB && prevTo > lbrRuns[j].end) - { - // Same BB and the jump is to after where the previous run ends. Take that as a return to after that call and extend the previous run. - lbrRuns[j] = (lbrRuns[j].start, curFrom); - extendedPrevRun = true; - break; - } - } - - if (extendedPrevRun) - continue; - } - - lbrRuns.Add((prevTo, curFrom)); - } - - // Now insert runs. - foreach (var pair in lbrRuns) - { - if (runs.TryGetValue(pair, out long count)) - runs[pair] = count + 1; - else - runs.Add(pair, 1); + Span lbr64 = data->Entries(e.EventDataLength); + correlator.AttributeSampleToLbrRuns(lbr64); } } } - // Group runs by memory region info, which corresponds to each .NET method. - var groupedRuns = - runs - .Select(r => (start: r.Key.startRun, end: r.Key.endRun, count: r.Value, info: methodMemMap.GetInfo(r.Key.startRun))) - .GroupBy(t => t.info); - - foreach (var g in groupedRuns) - { - if (g.Key == null || g.Key.NativeToILMap == null) - continue; - - // Collect relative IPs of samples. Note that we cannot translate the end-points of runs from IPs to IL offsets - // as we cannot assume that a straight-line execution between two IPs corresponds to a straight-line execution between - // two IL offsets. SampleProfile.CreateFromLbr will be responsible for assigning samples based on the flow graph relative IPs, - // the IP<->IL mapping and the flow graph. - List<(uint start, uint end, long count)> samples = - g - .Where(t => t.end >= t.start && t.end < g.Key.EndAddress) - .Select(t => ((uint)(t.start - g.Key.StartAddress), (uint)(t.end - g.Key.StartAddress), t.count)) - .ToList(); - - if (samples.Sum(t => t.count) < commandLineOptions.SpgoMinSamples) - continue; - - SampleProfile ep = SampleProfile.CreateFromLbr( - GetMethodIL(g.Key.Method), - GetFlowGraph(g.Key.Method), - g.Key.NativeToILMap, - samples); - - sampleProfiles.Add(g.Key.Method, ep); - } - PrintOutput($"Profile is based on {numLbrRecords} LBR records"); } + + correlator.SmoothAllProfiles(); } if (commandLineOptions.DisplayProcessedEvents) @@ -1732,40 +1574,60 @@ FlowGraph GetFlowGraph(MethodDesc desc) var intDecompressor = new PgoProcessor.PgoEncodedCompressedIntParser(instrumentationData, 0); methodData.InstrumentationData = PgoProcessor.ParsePgoData(pgoDataLoader, intDecompressor, true).ToArray(); } - else if (sampleProfiles.TryGetValue(methodData.Method, out SampleProfile sp)) + else { - IEnumerable schema = Enumerable.Empty(); - - if (commandLineOptions.SpgoIncludeBlockCounts) + SampleProfile sp = correlator?.GetProfile(methodData.Method); + if (sp != null && sp.AttributedSamples >= commandLineOptions.SpgoMinSamples) { - schema = schema.Concat( + IEnumerable schema = sp.SmoothedSamples - .Select(kvp => + .Select( + kvp => new PgoSchemaElem { InstrumentationKind = kvp.Value > uint.MaxValue ? PgoInstrumentationKind.BasicBlockLongCount : PgoInstrumentationKind.BasicBlockIntCount, ILOffset = kvp.Key.Start, Count = 1, DataLong = kvp.Value, - })); - } + }); - if (commandLineOptions.SpgoIncludeEdgeCounts) - { - schema = schema.Concat( - sp.SmoothedEdgeSamples - .Select(kvp => - new PgoSchemaElem - { - InstrumentationKind = kvp.Value > uint.MaxValue ? PgoInstrumentationKind.EdgeLongCount : PgoInstrumentationKind.EdgeIntCount, - ILOffset = kvp.Key.Item1.Start, - Other = kvp.Key.Item2.Start, - Count = 1, - DataLong = kvp.Value - })); - } + if (commandLineOptions.IncludeFullGraphs) + { + schema = schema.Concat( + sp.SmoothedEdgeSamples + .Select(kvp => + new PgoSchemaElem + { + InstrumentationKind = kvp.Value > uint.MaxValue ? PgoInstrumentationKind.EdgeLongCount : PgoInstrumentationKind.EdgeIntCount, + ILOffset = kvp.Key.Item1.Start, + Other = kvp.Key.Item2.Start, + Count = 1, + DataLong = kvp.Value + })); + } + + methodData.InstrumentationData = schema.ToArray(); - methodData.InstrumentationData = schema.ToArray(); +#if DEBUG + if (commandLineOptions.IncludeFullGraphs) + { + var writtenBlocks = + new HashSet( + methodData.InstrumentationData + .Where(elem => elem.InstrumentationKind == PgoInstrumentationKind.BasicBlockIntCount || elem.InstrumentationKind == PgoInstrumentationKind.BasicBlockLongCount) + .Select(elem => elem.ILOffset)); + + var writtenEdges = + new HashSet<(int, int)>( + methodData.InstrumentationData + .Where(elem => elem.InstrumentationKind == PgoInstrumentationKind.EdgeIntCount || elem.InstrumentationKind == PgoInstrumentationKind.EdgeLongCount) + .Select(elem => (elem.ILOffset, elem.Other))); + + Debug.Assert(writtenBlocks.SetEquals(sp.FlowGraph.BasicBlocks.Select(bb => bb.Start))); + Debug.Assert(writtenEdges.SetEquals(sp.FlowGraph.BasicBlocks.SelectMany(bb => bb.Targets.Select(bbTar => (bb.Start, bbTar.Start))))); + } +#endif + } } methodsUsedInProcess.Add(methodData); diff --git a/src/coreclr/tools/dotnet-pgo/SPGO/FlowGraphHelper.cs b/src/coreclr/tools/dotnet-pgo/SPGO/FlowGraphHelper.cs new file mode 100644 index 00000000000000..ac1b24a9365129 --- /dev/null +++ b/src/coreclr/tools/dotnet-pgo/SPGO/FlowGraphHelper.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. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Internal.IL; + +namespace Microsoft.Diagnostics.Tools.Pgo +{ + internal static class FlowGraphHelper + { + public static string DumpGraph( + List nodes, + T startNode, + Func> getSuccessors, + string title, + Func getNodeLabel, + Func<(T, T), string> getEdgeLabel) + { + var sb = new StringBuilder(); + sb.AppendLine("digraph G {"); + sb.AppendLine(" labelloc=\"t\";"); + sb.AppendLine($" label=\"{title}\";"); + sb.AppendLine(" forcelabels=true;"); + sb.AppendLine(); + Dictionary bbToIndex = new Dictionary(); + for (int i = 0; i < nodes.Count; i++) + bbToIndex.Add(nodes[i], i); + + foreach (T bb in nodes) + { + string label = $"{getNodeLabel(bb)}"; + sb.AppendLine($" N{bbToIndex[bb]} [label=\"{label}\"];"); + } + + sb.AppendLine(); + + foreach (T bb in nodes) + { + foreach (T tar in getSuccessors(bb)) + { + string label = getEdgeLabel((bb, tar)); + string postfix = string.IsNullOrEmpty(label) ? "" : $" [label=\"{label}\"]"; + sb.AppendLine($" N{bbToIndex[bb]} -> N{bbToIndex[tar]}{postfix};"); + } + } + + // Write ranks with BFS. + List curRank = new List { startNode }; + HashSet seen = new HashSet(curRank); + while (curRank.Count > 0) + { + sb.AppendLine($" {{rank = same; {string.Concat(curRank.Select(bb => $"N{bbToIndex[bb]}; "))}}}"); + curRank = curRank.SelectMany(getSuccessors).Where(seen.Add).ToList(); + } + + sb.AppendLine("}"); + return sb.ToString(); + } + + public static string Dump( + this FlowGraph fg, + Func getNodeAnnot, + Func<(BasicBlock, BasicBlock), string> getEdgeAnnot) + { + string getBasicBlockLabel(BasicBlock bb) + { + string label = $"[{bb.Start:x}..{bb.Start + bb.Size:x})\\n{getNodeAnnot(bb)}"; + return label; + } + + return DumpGraph( + fg.BasicBlocks, + fg.BasicBlocks.Single(bb => bb.Start == 0), + bb => bb.Targets, + "", + getBasicBlockLabel, + getEdgeAnnot); + + } + } +} diff --git a/src/coreclr/tools/dotnet-pgo/SPGO/KeyValueMap.cs b/src/coreclr/tools/dotnet-pgo/SPGO/KeyValueMap.cs new file mode 100644 index 00000000000000..189559dcc63ccf --- /dev/null +++ b/src/coreclr/tools/dotnet-pgo/SPGO/KeyValueMap.cs @@ -0,0 +1,76 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using ILCompiler.Reflection.ReadyToRun; +using Microsoft.Diagnostics.Tracing.Parsers.Clr; + +namespace Microsoft.Diagnostics.Tools.Pgo +{ + /// + /// A simple key-value map that does not support updates and that supports range queries. + /// + /// The type of values. + public class KeyValueMap where TKey : IComparable + { + // Native offsets in order + private TKey[] _keys; + private TValue[] _values; + + public KeyValueMap(TKey[] keys, TValue[] values) + { + Trace.Assert(keys.Length == values.Length); + + _keys = keys; + _values = values; + } + + // Find last index of a key that is smaller than the specified input key. + private int LookupIndex(TKey key) + { + int index = Array.BinarySearch(_keys, key); + if (index < 0) + index = ~index - 1; + + // If rva is before first binary search will return ~0 so index will be -1. + if (index < 0) + return -1; + + return index; + } + + public bool TryLookup(TKey key, out TValue value) + { + int index = LookupIndex(key); + if (index == -1) + { + value = default; + return false; + } + + value = _values[index]; + return true; + } + + public IEnumerable LookupRange(TKey min, TKey max) + { + Debug.Assert(min.CompareTo(max) <= 0); + + int start = LookupIndex(min); + if (start < 0) + start = 0; + + int end = LookupIndex(max); + if (end < 0) + yield break; + + for (int i = start; i <= end; i++) + yield return _values[i]; + } + } +} diff --git a/src/coreclr/tools/dotnet-pgo/SPGO/NativeToILMap.cs b/src/coreclr/tools/dotnet-pgo/SPGO/NativeToILMap.cs deleted file mode 100644 index a61c2484dac6db..00000000000000 --- a/src/coreclr/tools/dotnet-pgo/SPGO/NativeToILMap.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using ILCompiler.Reflection.ReadyToRun; -using Microsoft.Diagnostics.Tracing.Parsers.Clr; - -namespace Microsoft.Diagnostics.Tools.Pgo -{ - public class NativeToILMap - { - // Native offsets in order - private uint[] _nativeOffsets; - // Map from native offset to IL offset - private int[] _ilOffsets; - - public NativeToILMap(uint[] nativeOffsets, int[] ilOffsets) - { - _nativeOffsets = nativeOffsets; - _ilOffsets = ilOffsets; - } - - private int LookupIndex(uint rva) - { - int index = Array.BinarySearch(_nativeOffsets, rva); - if (index < 0) - index = ~index - 1; - - // If rva is before first binary search will return ~0 so index will be -1. - if (index < 0) - return -1; - - return index; - } - - /// Look up IL offset associated with block that contains RVA. - public int Lookup(uint rva) - => LookupIndex(rva) switch - { - -1 => -1, - int index => _ilOffsets[index] - }; - - public IEnumerable LookupRange(uint rvaStart, uint rvaEnd) - { - int start = LookupIndex(rvaStart); - if (start < 0) - start = 0; - - int end = LookupIndex(rvaEnd); - if (end < 0) - yield break; - - for (int i = start; i <= end; i++) - yield return _ilOffsets[i]; - } - - internal static NativeToILMap FromR2RBounds(List boundsList) - { - List sorted = boundsList.OrderBy(e => e.NativeOffset).ToList(); - - return new NativeToILMap(sorted.Select(e => e.NativeOffset).ToArray(), sorted.Select(e => (int)e.ILOffset).ToArray()); - } - - internal static NativeToILMap FromEvent(MethodILToNativeMapTraceData ev) - { - List<(uint rva, int ilOffset)> pairs = new List<(uint rva, int ilOffset)>(ev.CountOfMapEntries); - for (int i = 0; i < ev.CountOfMapEntries; i++) - pairs.Add(((uint)ev.NativeOffset(i), ev.ILOffset(i))); - - pairs.RemoveAll(p => p.ilOffset < 0); - pairs.Sort((p1, p2) => p1.rva.CompareTo(p2.rva)); - return new NativeToILMap(pairs.Select(p => p.rva).ToArray(), pairs.Select(p => p.ilOffset).ToArray()); - } - } -} diff --git a/src/coreclr/tools/dotnet-pgo/SPGO/PreciseDebugInfo.cs b/src/coreclr/tools/dotnet-pgo/SPGO/PreciseDebugInfo.cs new file mode 100644 index 00000000000000..ac7dbf83e26a89 --- /dev/null +++ b/src/coreclr/tools/dotnet-pgo/SPGO/PreciseDebugInfo.cs @@ -0,0 +1,27 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Microsoft.Diagnostics.Tools.Pgo +{ + internal record class PreciseDebugInfo( + ulong MethodID, + InlineContext InlineTree, + List Mappings); + + internal record class InlineContext( + uint Ordinal, + ulong MethodID, + string MethodName, + List Inlinees); + + internal record class PreciseIPMapping( + uint NativeOffset, + uint InlineContext, + uint ILOffset); +} diff --git a/src/coreclr/tools/dotnet-pgo/SPGO/SampleCorrelator.cs b/src/coreclr/tools/dotnet-pgo/SPGO/SampleCorrelator.cs new file mode 100644 index 00000000000000..4fd1047c6b8b46 --- /dev/null +++ b/src/coreclr/tools/dotnet-pgo/SPGO/SampleCorrelator.cs @@ -0,0 +1,278 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Internal.IL; +using Internal.TypeSystem; +using Internal.TypeSystem.Ecma; +using Microsoft.Diagnostics.Tracing.Parsers.Kernel; + +namespace Microsoft.Diagnostics.Tools.Pgo +{ + /// + /// A class that handles correlating IP samples/LBR samples back to managed methods. + /// + internal class SampleCorrelator + { + private readonly Dictionary _methodInf = new Dictionary(); + + private readonly MethodMemoryMap _memMap; + + public SampleCorrelator(MethodMemoryMap memMap) + { + _memMap = memMap; + } + + public long SamplesOutsideManagedCode { get; private set; } + public long SamplesInManagedCodeWithoutAnyMappings { get; private set; } + public long SamplesInManagedCodeOutsideMappings { get; private set; } + public long SamplesInUnknownInlinees { get; private set; } + public long SamplesInManagedCodeWithoutIL { get; private set; } + public long SamplesInManagedCodeOutsideFlowGraph { get; private set; } + public long TotalAttributedSamples { get; private set; } + + private PerMethodInfo GetOrCreateInfo(MethodDesc md) + { + if (!_methodInf.TryGetValue(md, out PerMethodInfo pmi)) + { + MethodIL il = + md switch + { + EcmaMethod em => EcmaMethodIL.Create(em), + _ => new InstantiatedMethodIL(md, EcmaMethodIL.Create((EcmaMethod)md.GetTypicalMethodDefinition())), + }; + + if (il == null) + { + return null; + } + + _methodInf.Add(md, pmi = new PerMethodInfo()); + pmi.IL = il; + pmi.FlowGraph = FlowGraph.Create(il); + pmi.Profile = new SampleProfile(pmi.IL, pmi.FlowGraph); + } + + return pmi; + } + + public SampleProfile GetProfile(MethodDesc md) + => _methodInf.GetValueOrDefault(md)?.Profile; + + public void SmoothAllProfiles() + { + foreach (PerMethodInfo pmi in _methodInf.Values) + pmi.Profile.SmoothFlow(); + } + + public void AttributeSamplesToIP(ulong ip, long numSamples) + { + MemoryRegionInfo region = _memMap.GetInfo(ip); + if (region == null) + { + SamplesOutsideManagedCode += numSamples; + return; + } + + if (region.NativeToILMap == null) + { + SamplesInManagedCodeWithoutAnyMappings += numSamples; + return; + } + + if (!region.NativeToILMap.TryLookup(checked((uint)(ip - region.StartAddress)), out IPMapping mapping)) + { + SamplesInManagedCodeOutsideMappings += numSamples; + return; + } + + if (mapping.InlineeMethod == null) + { + SamplesInUnknownInlinees += numSamples; + return; + } + + PerMethodInfo pmi = GetOrCreateInfo(mapping.InlineeMethod); + if (pmi == null) + { + SamplesInManagedCodeWithoutIL += numSamples; + return; + } + + if (pmi.Profile.TryAttributeSamples(mapping.ILOffset, 1)) + { + TotalAttributedSamples += numSamples; + } + else + { + SamplesInManagedCodeOutsideFlowGraph += numSamples; + } + } + + private LbrEntry64[] _convertedEntries; + public void AttributeSampleToLbrRuns(Span lbr) + { + if (_convertedEntries == null || _convertedEntries.Length < lbr.Length) + { + Array.Resize(ref _convertedEntries, lbr.Length); + } + + Span convertedEntries = _convertedEntries[..lbr.Length]; + for (int i = 0; i < lbr.Length; i++) + { + ref LbrEntry64 entry = ref convertedEntries[i]; + entry.FromAddress = lbr[i].FromAddress; + entry.ToAddress = lbr[i].ToAddress; + entry.Reserved = lbr[i].Reserved; + } + + AttributeSampleToLbrRuns(convertedEntries); + } + + private readonly List<(BasicBlock, int)> _callStack = new(); + private readonly HashSet<(InlineContext, BasicBlock)> _seenOnRun = new(); + public void AttributeSampleToLbrRuns(Span lbr) + { + // LBR record represents branches taken by the CPU, in + // chronological order with most recent branches first. Using this + // data we can construct the 'runs' of instructions executed by the + // CPU. We attribute a sample to all basic blocks in each run. + // + // As an example, if we see a branch A -> B followed by a branch C -> D, + // we conclude that the CPU executed the instructions from B to C. + // + // Note that we need some special logic to handle calls. If we see + // a call A -> B followed by a return B -> A, a straightforward + // attribution process would attribute multiple samples to the + // block containing A. To deal with this we track in a list the + // basic blocks + offsets that we left, and if we see a return to + // the same basic block at a later offset, we skip that basic + // block. + // Note that this is an approximation of the call stack as we + // cannot differentiate between tailcalls and calls, so there + // may be BBs we left in here that we never return to. + // Therefore we cannot just use a straightforward stack. + List<(BasicBlock, int)> callStack = _callStack; + callStack.Clear(); + + // On each run we translate the endpoint RVAs to all IL offset + // mappings we have for that range. It is possible (and happens + // often) that we see multiple IL offsets corresponding to the same + // basic block. + // + // Therefore, we keep track of the basic blocks we have seen in each + // run to make sure we only attribute once. However, due to inlinees + // we sometimes may want to attribute twice, for example if A is inlined in + // A(); A(); + // Therefore, we also key by the inline context. + HashSet<(InlineContext, BasicBlock)> seenOnRun = _seenOnRun; + + MethodMemoryMap memMap = _memMap; + + for (int i = lbr.Length - 2; i >= 0; i--) + { + ref LbrEntry64 prev = ref lbr[i + 1]; + ref LbrEntry64 cur = ref lbr[i]; + + MemoryRegionInfo prevToInf = memMap.GetInfo(prev.ToAddress); + MemoryRegionInfo curFromInf = memMap.GetInfo(cur.FromAddress); + + // If this run is not in the same function then ignore it. + // This probably means IP was changed out from beneath us while + // recording. + if (prevToInf == null || prevToInf != curFromInf) + continue; + + if (curFromInf.NativeToILMap == null) + continue; + + // Attribute samples to run. + seenOnRun.Clear(); + uint rvaMin = checked((uint)(prev.ToAddress - prevToInf.StartAddress)); + uint rvaMax = checked((uint)(cur.FromAddress - curFromInf.StartAddress)); + int lastILOffs = -1; + BasicBlock lastBB = null; + bool isFirst = true; + foreach (IPMapping mapping in curFromInf.NativeToILMap.LookupRange(rvaMin, rvaMax)) + { + bool isFirstMapping = isFirst; + isFirst = false; + + if (mapping.InlineeMethod == null) + continue; + + PerMethodInfo pmi = GetOrCreateInfo(mapping.InlineeMethod); + if (pmi == null) + continue; + + BasicBlock bb = pmi.FlowGraph.Lookup(mapping.ILOffset); + if (bb == null) + continue; + + lastBB = bb; + lastILOffs = mapping.ILOffset; + + if (seenOnRun.Add((mapping.InlineContext, bb))) + { + if (isFirstMapping) + { + // This is the first mapping in the run. Check to + // see if we returned to this BB in the callstack, + // and if so, skip attributing anything to the + // first BB. + + bool skip = false; + + for (int j = callStack.Count - 1; j >= 0; j++) + { + (BasicBlock callFromBB, int callFromILOffs) = callStack[j]; + if (callFromBB == bb && mapping.ILOffset >= callFromILOffs) + { + // Yep, we previously left 'bb' at + // 'callFromILOffs', and now we are jumping + // back to the same BB at a later offset. + skip = true; + callStack.RemoveRange(j, callStack.Count - j); + break; + } + } + + if (skip) + continue; + } + + pmi.Profile.AttributeSamples(bb, 1); + } + } + + // Now see if this is a cross-function jump. + MemoryRegionInfo curToInf = memMap.GetInfo(cur.ToAddress); + // TODO: This check and above skipping logic does not handle recursion. + if (curFromInf != curToInf) + { + // Yes, either different managed function or not managed function (e.g. prestub). + // Record this. + if (lastBB != null) + { + callStack.Add((lastBB, lastILOffs)); + } + } + } + } + + public override string ToString() => $"{TotalAttributedSamples} samples in {_methodInf.Count} methods"; + + private class PerMethodInfo + { + public MethodIL IL { get; set; } + public FlowGraph FlowGraph { get; set; } + public SampleProfile Profile { get; set; } + + public override string ToString() => IL.OwningMethod.ToString(); + } + } +} diff --git a/src/coreclr/tools/dotnet-pgo/SPGO/SampleProfile.cs b/src/coreclr/tools/dotnet-pgo/SPGO/SampleProfile.cs index f60753b0b571bd..d156cc19c49d7b 100644 --- a/src/coreclr/tools/dotnet-pgo/SPGO/SampleProfile.cs +++ b/src/coreclr/tools/dotnet-pgo/SPGO/SampleProfile.cs @@ -16,69 +16,56 @@ namespace Microsoft.Diagnostics.Tools.Pgo { internal class SampleProfile { + private Dictionary _rawSamples = new Dictionary(); + private Dictionary _smoothedSamples; + private Dictionary<(BasicBlock, BasicBlock), long> _smoothedEdgeSamples; + public SampleProfile( MethodIL methodIL, - FlowGraph fg, - Dictionary samples, - Dictionary smoothedSamples, - Dictionary<(BasicBlock, BasicBlock), long> smoothedEdgeSamples) + FlowGraph fg) { MethodIL = methodIL; FlowGraph = fg; - Samples = samples; - SmoothedSamples = smoothedSamples; - SmoothedEdgeSamples = smoothedEdgeSamples; } public MethodIL MethodIL { get; } public FlowGraph FlowGraph { get; } - public Dictionary Samples { get; } - public Dictionary SmoothedSamples { get; } - public Dictionary<(BasicBlock, BasicBlock), long> SmoothedEdgeSamples { get; } + public IReadOnlyDictionary RawSamples => _rawSamples; + public IReadOnlyDictionary SmoothedSamples => _smoothedSamples; + public IReadOnlyDictionary<(BasicBlock, BasicBlock), long> SmoothedEdgeSamples => _smoothedEdgeSamples; + public long AttributedSamples { get; set; } - /// - /// Given pairs of runs (as relative IPs in this function), create a sample profile. - /// - public static SampleProfile CreateFromLbr(MethodIL il, FlowGraph fg, NativeToILMap map, IEnumerable<(uint fromRva, uint toRva, long count)> runs) + public bool TryAttributeSamples(int ilOffset, long count) { - Dictionary bbSamples = fg.BasicBlocks.ToDictionary(bb => bb, bb => 0L); - foreach ((uint from, uint to, long count) in runs) - { - foreach (BasicBlock bb in map.LookupRange(from, to).Select(fg.Lookup).Distinct()) - { - if (bb != null) - bbSamples[bb] += count; - } - } + BasicBlock bb = FlowGraph.Lookup(ilOffset); + if (bb == null) + return false; - FlowSmoothing flowSmooth = new FlowSmoothing(bbSamples, fg.Lookup(0), bb => bb.Targets, (bb, isForward) => bb.Size * (isForward ? 1 : 50) + 2); - flowSmooth.Perform(); + AttributeSamples(bb, count); + return true; + } - return new SampleProfile(il, fg, bbSamples, flowSmooth.NodeResults, flowSmooth.EdgeResults); + public void AttributeSamples(BasicBlock bb, long count) + { + Debug.Assert(FlowGraph.Lookup(bb.Start) == bb); + CollectionsMarshal.GetValueRefOrAddDefault(_rawSamples, bb, out _) += count; + AttributedSamples += count; } - /// - /// Given some IL offset samples into a method, construct a profile. - /// - public static SampleProfile Create(MethodIL il, FlowGraph fg, IEnumerable ilOffsetSamples) + public void SmoothFlow() { - // Now associate raw IL-offset samples with basic blocks. - Dictionary bbSamples = fg.BasicBlocks.ToDictionary(bb => bb, bb => 0L); - foreach (int ofs in ilOffsetSamples) + foreach (BasicBlock bb in FlowGraph.BasicBlocks) { - if (ofs == -1) - continue; - - BasicBlock bb = fg.Lookup(ofs); - if (bb != null) - bbSamples[bb]++; + if (!_rawSamples.ContainsKey(bb)) + _rawSamples.Add(bb, 0); } - // Smooth the graph to produce something that satisfies flow conservation. - FlowSmoothing flowSmooth = new FlowSmoothing(bbSamples, fg.Lookup(0), bb => bb.Targets, (bb, isForward) => bb.Size * (isForward ? 1 : 50) + 2); + FlowSmoothing flowSmooth = new(_rawSamples, FlowGraph.Lookup(0), bb => bb.Targets, (bb, isForward) => bb.Size * (isForward ? 1 : 50) + 2); flowSmooth.Perform(); - - return new SampleProfile(il, fg, bbSamples, flowSmooth.NodeResults, flowSmooth.EdgeResults); + _smoothedSamples = flowSmooth.NodeResults; + _smoothedEdgeSamples = flowSmooth.EdgeResults; } + + public override string ToString() => $"{AttributedSamples} samples"; } } diff --git a/src/coreclr/tools/dotnet-pgo/dotnet-pgo-experiment.md b/src/coreclr/tools/dotnet-pgo/dotnet-pgo-experiment.md index 14f9c63bbe1c0b..e021a2d794befb 100644 --- a/src/coreclr/tools/dotnet-pgo/dotnet-pgo-experiment.md +++ b/src/coreclr/tools/dotnet-pgo/dotnet-pgo-experiment.md @@ -77,7 +77,7 @@ where it would be useful to describe types in the data section (such as for devi but there are also plausible cases for gathering each kind of data in both section, so the format will be made general to support both. Instrumentation Data shall have a version number independent of the general R2R versioning scheme. The intention is for this form of `InstrumentationData` to become -useable for both out of line instrumentation as described in this document, as well as only tiered +usable for both out of line instrumentation as described in this document, as well as only tiered compilation rejit scenarios with in process profiling. ## Trace data format diff --git a/src/coreclr/tools/metainfo/mdinfo.cpp b/src/coreclr/tools/metainfo/mdinfo.cpp index 6ddf1ea96be33c..24c782b4076d9e 100644 --- a/src/coreclr/tools/metainfo/mdinfo.cpp +++ b/src/coreclr/tools/metainfo/mdinfo.cpp @@ -22,8 +22,6 @@ #define ENUM_BUFFER_SIZE 10 #define TAB_SIZE 8 -#define NumItems(s) (sizeof(s) / sizeof(s[0])) - #define ISFLAG(p,x) if (Is##p##x(flags)) strcat_s(sFlags,STRING_BUFFER_LEN, "["#x "] "); extern HRESULT _FillVariant( @@ -219,8 +217,8 @@ MDInfo::MDInfo(IMetaDataImport2 *pImport, IMetaDataAssemblyImport *pAssemblyImpo { // This constructor is specific to ILDASM/MetaInfo integration _ASSERTE(pImport != NULL); - _ASSERTE(NumItems(g_szMapElementType) == NumItems(g_szMapUndecorateType)); - _ASSERTE(NumItems(g_szMapElementType) == ELEMENT_TYPE_MAX); + _ASSERTE(ARRAY_SIZE(g_szMapElementType) == ARRAY_SIZE(g_szMapUndecorateType)); + _ASSERTE(ARRAY_SIZE(g_szMapElementType) == ELEMENT_TYPE_MAX); Init(inPBFn, (DUMP_FILTER)DumpFilter); @@ -243,8 +241,8 @@ MDInfo::MDInfo(IMetaDataDispenserEx *pDispenser, LPCWSTR szScope, strPassBackFn VARIANT value; _ASSERTE(pDispenser != NULL && inPBFn != NULL); - _ASSERTE(NumItems(g_szMapElementType) == NumItems(g_szMapUndecorateType)); - _ASSERTE(NumItems(g_szMapElementType) == ELEMENT_TYPE_MAX); + _ASSERTE(ARRAY_SIZE(g_szMapElementType) == ARRAY_SIZE(g_szMapUndecorateType)); + _ASSERTE(ARRAY_SIZE(g_szMapElementType) == ELEMENT_TYPE_MAX); Init(inPBFn, (DUMP_FILTER)DumpFilter); @@ -277,8 +275,8 @@ MDInfo::MDInfo(IMetaDataDispenserEx *pDispenser, LPCWSTR szScope, strPassBackFn MDInfo::MDInfo(IMetaDataDispenserEx *pDispenser, PBYTE pbMetaData, DWORD dwSize, strPassBackFn inPBFn, ULONG DumpFilter) { _ASSERTE(pDispenser != NULL && inPBFn != NULL); - _ASSERTE(NumItems(g_szMapElementType) == NumItems(g_szMapUndecorateType)); - _ASSERTE(NumItems(g_szMapElementType) == ELEMENT_TYPE_MAX); + _ASSERTE(ARRAY_SIZE(g_szMapElementType) == ARRAY_SIZE(g_szMapUndecorateType)); + _ASSERTE(ARRAY_SIZE(g_szMapElementType) == ELEMENT_TYPE_MAX); Init(inPBFn, (DUMP_FILTER)DumpFilter); @@ -617,7 +615,7 @@ void MDInfo::DisplayMemberRefs(mdToken tkParent, const char *preFix) while (SUCCEEDED(hr = m_pImport->EnumMemberRefs( &memRefEnum, tkParent, - memRefs, NumItems(memRefs), &count)) && + memRefs, ARRAY_SIZE(memRefs), &count)) && count > 0) { for (ULONG i = 0; i < count; i++, totalCount++) @@ -644,7 +642,7 @@ void MDInfo::DisplayTypeRefs() HRESULT hr; while (SUCCEEDED(hr = m_pImport->EnumTypeRefs( &typeRefEnum, - typeRefs, NumItems(typeRefs), &count)) && + typeRefs, ARRAY_SIZE(typeRefs), &count)) && count > 0) { for (ULONG i = 0; i < count; i++, totalCount++) @@ -667,7 +665,7 @@ void MDInfo::DisplayTypeSpecs() HRESULT hr; while (SUCCEEDED(hr = m_pImport->EnumTypeSpecs( &typespecEnum, - typespecs, NumItems(typespecs), &count)) && + typespecs, ARRAY_SIZE(typespecs), &count)) && count > 0) { for (ULONG i = 0; i < count; i++, totalCount++) @@ -692,7 +690,7 @@ void MDInfo::DisplayMethodSpecs() ///// HACK until I implement EnumMethodSpecs! ///// while (SUCCEEDED(hr = m_pImport->EnumMethodSpecs( &MethodSpecEnum, -///// MethodSpecs, NumItems(MethodSpecs), &count)) && +///// MethodSpecs, ARRAY_SIZE(MethodSpecs), &count)) && ///// count > 0) for (ULONG rid=1; m_pImport->IsValidToken(TokenFromRid(rid, mdtMethodSpec)); ++rid) { @@ -723,7 +721,7 @@ void MDInfo::DisplayTypeDefs() HRESULT hr; while (SUCCEEDED(hr = m_pImport->EnumTypeDefs( &typeDefEnum, - typeDefs, NumItems(typeDefs), &count)) && + typeDefs, ARRAY_SIZE(typeDefs), &count)) && count > 0) { for (ULONG i = 0; i < count; i++, totalCount++) @@ -748,7 +746,7 @@ void MDInfo::DisplayModuleRefs() HRESULT hr; while (SUCCEEDED(hr = m_pImport->EnumModuleRefs( &moduleRefEnum, - moduleRefs, NumItems(moduleRefs), &count)) && + moduleRefs, ARRAY_SIZE(moduleRefs), &count)) && count > 0) { for (ULONG i = 0; i < count; i++, totalCount++) @@ -793,7 +791,7 @@ void MDInfo::DisplaySignatures() HRESULT hr; while (SUCCEEDED(hr = m_pImport->EnumSignatures( &signatureEnum, - signatures, NumItems(signatures), &count)) && + signatures, ARRAY_SIZE(signatures), &count)) && count > 0) { for (ULONG i = 0; i < count; i++, totalCount++) @@ -1051,7 +1049,7 @@ void MDInfo::DisplayMethods(mdTypeDef inTypeDef) while (SUCCEEDED(hr = m_pImport->EnumMethods( &methodEnum, inTypeDef, - methods, NumItems(methods), &count)) && + methods, ARRAY_SIZE(methods), &count)) && count > 0) { for (ULONG i = 0; i < count; i++, totalCount++) @@ -1088,7 +1086,7 @@ void MDInfo::DisplayFields(mdTypeDef inTypeDef, COR_FIELD_OFFSET *rFieldOffset, while (SUCCEEDED(hr = m_pImport->EnumFields( &fieldEnum, inTypeDef, - fields, NumItems(fields), &count)) && + fields, ARRAY_SIZE(fields), &count)) && count > 0) { for (ULONG i = 0; i < count; i++, totalCount++) @@ -1144,7 +1142,7 @@ void MDInfo::DisplayMethodImpls(mdTypeDef inTypeDef) while (SUCCEEDED(hr = m_pImport->EnumMethodImpls( &methodImplEnum, inTypeDef, - rtkMethodBody, rtkMethodDecl, NumItems(rtkMethodBody), &count)) && + rtkMethodBody, rtkMethodDecl, ARRAY_SIZE(rtkMethodBody), &count)) && count > 0) { for (ULONG i = 0; i < count; i++, totalCount++) @@ -1177,7 +1175,7 @@ void MDInfo::DisplayParamInfo(mdParamDef inParamDef) #ifdef FEATURE_COMINTEROP ::VariantInit(&defValue); #endif - HRESULT hr = m_pImport->GetParamProps( inParamDef, &md, &num, paramName, NumItems(paramName), + HRESULT hr = m_pImport->GetParamProps( inParamDef, &md, &num, paramName, ARRAY_SIZE(paramName), &nameLen, &flags, &dwCPlusFlags, &pValue, &cbValue); if (FAILED(hr)) Error("GetParamProps failed.", hr); @@ -1222,7 +1220,7 @@ void MDInfo::DisplayParams(mdMethodDef inMethodDef) while (SUCCEEDED(hr = m_pImport->EnumParams( ¶mEnum, inMethodDef, - params, NumItems(params), &count)) && + params, ARRAY_SIZE(params), &count)) && count > 0) { if (first) @@ -1250,7 +1248,7 @@ void MDInfo::DisplayGenericParams(mdToken tk, const char *prefix) while (SUCCEEDED(hr = m_pImport->EnumGenericParams( ¶mEnum, tk, - params, NumItems(params), &count)) && + params, ARRAY_SIZE(params), &count)) && count > 0) { if (first) @@ -1282,14 +1280,14 @@ void MDInfo::DisplayGenericParamInfo(mdGenericParam tkParam, const char *prefix) mdToken owner; bool first = true; - HRESULT hr = m_pImport->GetGenericParamProps(tkParam, &ulSeq, &flags, &tkOwner, NULL, paramName, NumItems(paramName), &nameLen); + HRESULT hr = m_pImport->GetGenericParamProps(tkParam, &ulSeq, &flags, &tkOwner, NULL, paramName, ARRAY_SIZE(paramName), &nameLen); if (FAILED(hr)) Error("GetGenericParamProps failed.", hr); VWriteLine("%s\t(%ld) GenericParamToken : (%08x) Name : %ls flags: %08x Owner: %08x", prefix, ulSeq, tkParam, paramName, flags, tkOwner); // Any constraints for the GenericParam while (SUCCEEDED(hr = m_pImport->EnumGenericParamConstraints(&constraintEnum, tkParam, - constraints, NumItems(constraints), &count)) && + constraints, ARRAY_SIZE(constraints), &count)) && count > 0) { if (first) @@ -1415,7 +1413,7 @@ void MDInfo::DisplayTypeDefProps(mdTypeDef inTypeDef) VWriteLine("\tTypDefName: %ls (%8.8X)",typeDefName,inTypeDef); VWriteLine("\tFlags : %s (%08x)",ClassFlags(flags, sFlags), flags); VWriteLine("\tExtends : %8.8X [%s] %ls",extends,TokenTypeName(extends), - TypeDeforRefName(extends, szTempBuf, NumItems(szTempBuf))); + TypeDeforRefName(extends, szTempBuf, ARRAY_SIZE(szTempBuf))); hr = m_pImport->GetClassLayout(inTypeDef, &dwPacking, 0,0,0, &dwSize); if (hr == S_OK) @@ -1429,7 +1427,7 @@ void MDInfo::DisplayTypeDefProps(mdTypeDef inTypeDef) if (hr == S_OK) { VWriteLine("\tEnclosingClass : %ls (%8.8X)", TypeDeforRefName(tkEnclosingClass, - szTempBuf, NumItems(szTempBuf)), tkEnclosingClass); + szTempBuf, ARRAY_SIZE(szTempBuf)), tkEnclosingClass); } else if (hr == CLDB_E_RECORD_NOTFOUND) WriteLine("ERROR: EnclosingClass not found for NestedClass"); @@ -1628,7 +1626,7 @@ void MDInfo::DisplayInterfaceImpls(mdTypeDef inTypeDef) HRESULT hr; while(SUCCEEDED(hr = m_pImport->EnumInterfaceImpls( &interfaceImplEnum, - inTypeDef,interfaceImpls,NumItems(interfaceImpls), &count)) && + inTypeDef,interfaceImpls,ARRAY_SIZE(interfaceImpls), &count)) && count > 0) { for (ULONG i = 0; i < count; i++, totalCount++) @@ -1657,8 +1655,8 @@ void MDInfo::DisplayInterfaceImplInfo(mdInterfaceImpl inImpl) hr = m_pImport->GetInterfaceImplProps( inImpl, &typeDef, &token); if (FAILED(hr)) Error("GetInterfaceImplProps failed.", hr); - VWriteLine("\t\tClass : %ls",TypeDeforRefName(typeDef, szTempBuf, NumItems(szTempBuf))); - VWriteLine("\t\tToken : %8.8X [%s] %ls",token,TokenTypeName(token), TypeDeforRefName(token, szTempBuf, NumItems(szTempBuf))); + VWriteLine("\t\tClass : %ls",TypeDeforRefName(typeDef, szTempBuf, ARRAY_SIZE(szTempBuf))); + VWriteLine("\t\tToken : %8.8X [%s] %ls",token,TokenTypeName(token), TypeDeforRefName(token, szTempBuf, ARRAY_SIZE(szTempBuf))); DisplayCustomAttributes(inImpl, "\t\t"); } // void MDInfo::DisplayInterfaceImplInfo() @@ -1738,8 +1736,8 @@ void MDInfo::DisplayPropertyInfo(mdProperty inProp) VWriteLine("\t\tDefltValue: %ls",VariantAsString(&defaultValue)); #endif - VWriteLine("\t\tSetter : (%08x) %ls",setter,MemberDeforRefName(setter, szTempBuf, NumItems(szTempBuf))); - VWriteLine("\t\tGetter : (%08x) %ls",getter,MemberDeforRefName(getter, szTempBuf, NumItems(szTempBuf))); + VWriteLine("\t\tSetter : (%08x) %ls",setter,MemberDeforRefName(setter, szTempBuf, ARRAY_SIZE(szTempBuf))); + VWriteLine("\t\tGetter : (%08x) %ls",getter,MemberDeforRefName(getter, szTempBuf, ARRAY_SIZE(szTempBuf))); // do something with others? VWriteLine("\t\t%ld Others",others); @@ -1762,7 +1760,7 @@ void MDInfo::DisplayProperties(mdTypeDef inTypeDef) while(SUCCEEDED(hr = m_pImport->EnumProperties( &propEnum, - inTypeDef,props,NumItems(props), &count)) && + inTypeDef,props,ARRAY_SIZE(props), &count)) && count > 0) { for (ULONG i = 0; i < count; i++, totalCount++) @@ -1808,7 +1806,7 @@ void MDInfo::DisplayEventInfo(mdEvent inEvent) &fire, // [OUT] Fire method of the event otherMethod, // [OUT] other method of the event - NumItems(otherMethod), // [IN] size of rmdOtherMethod + ARRAY_SIZE(otherMethod), // [IN] size of rmdOtherMethod &totalOther); // [OUT] total number of other method of this event if (FAILED(hr)) Error("GetEventProps failed.", hr); @@ -1827,9 +1825,9 @@ void MDInfo::DisplayEventInfo(mdEvent inEvent) WCHAR szTempBuf[STRING_BUFFER_LEN]; VWriteLine("\t\tEventType : %8.8X [%s]",eventType,TokenTypeName(eventType)); - VWriteLine("\t\tAddOnMethd: (%08x) %ls",addOn,MemberDeforRefName(addOn, szTempBuf, NumItems(szTempBuf))); - VWriteLine("\t\tRmvOnMethd: (%08x) %ls",removeOn,MemberDeforRefName(removeOn, szTempBuf, NumItems(szTempBuf))); - VWriteLine("\t\tFireMethod: (%08x) %ls",fire,MemberDeforRefName(fire, szTempBuf, NumItems(szTempBuf))); + VWriteLine("\t\tAddOnMethd: (%08x) %ls",addOn,MemberDeforRefName(addOn, szTempBuf, ARRAY_SIZE(szTempBuf))); + VWriteLine("\t\tRmvOnMethd: (%08x) %ls",removeOn,MemberDeforRefName(removeOn, szTempBuf, ARRAY_SIZE(szTempBuf))); + VWriteLine("\t\tFireMethod: (%08x) %ls",fire,MemberDeforRefName(fire, szTempBuf, ARRAY_SIZE(szTempBuf))); VWriteLine("\t\t%ld OtherMethods",totalOther); @@ -1847,7 +1845,7 @@ void MDInfo::DisplayEvents(mdTypeDef inTypeDef) while(SUCCEEDED(hr = m_pImport->EnumEvents( &eventEnum, - inTypeDef,events,NumItems(events), &count)) && + inTypeDef,events,ARRAY_SIZE(events), &count)) && count > 0) { for (ULONG i = 0; i < count; i++, totalCount++) @@ -2078,7 +2076,7 @@ void MDInfo::DisplayCustomAttributes(mdToken inToken, const char *preFix) HRESULT hr; while(SUCCEEDED(hr = m_pImport->EnumCustomAttributes( &customAttributeEnum, inToken, 0, - customAttributes, NumItems(customAttributes), &count)) && + customAttributes, ARRAY_SIZE(customAttributes), &count)) && count > 0) { for (ULONG i = 0; i < count; i++, totalCount++) @@ -2104,7 +2102,7 @@ void MDInfo::DisplayPermissions(mdToken tk, const char *preFix) while (SUCCEEDED(hr = m_pImport->EnumPermissionSets( &permissionEnum, - tk, 0, permissions, NumItems(permissions), &count)) && + tk, 0, permissions, ARRAY_SIZE(permissions), &count)) && count > 0) { for (ULONG i = 0; i < count; i++, totalCount++) @@ -2482,7 +2480,7 @@ void MDInfo::DisplayPinvokeInfo(mdToken inToken) char sFlags[STRING_BUFFER_LEN]; hr = m_pImport->GetPinvokeMap(inToken, &flags, rcImport, - NumItems(rcImport), 0, &tkModuleRef); + ARRAY_SIZE(rcImport), 0, &tkModuleRef); if (FAILED(hr)) { if (hr != CLDB_E_RECORD_NOTFOUND) @@ -2742,7 +2740,7 @@ HRESULT MDInfo::GetOneElementType(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, UL // get the name of type ref. Don't care if truncated if (TypeFromToken(tk) == mdtTypeDef || TypeFromToken(tk) == mdtTypeRef) { - sprintf_s(m_tempFormatBuffer, STRING_BUFFER_LEN, " %ls",TypeDeforRefName(tk, m_szTempBuf, NumItems(m_szTempBuf))); + sprintf_s(m_tempFormatBuffer, STRING_BUFFER_LEN, " %ls",TypeDeforRefName(tk, m_szTempBuf, ARRAY_SIZE(m_szTempBuf))); IfFailGo(AddToSigBuffer(m_tempFormatBuffer)); } else @@ -3136,7 +3134,7 @@ void MDInfo::DisplayAssemblyRefs() HRESULT hr; while (SUCCEEDED(hr = m_pAssemblyImport->EnumAssemblyRefs( &assemblyRefEnum, - AssemblyRefs, NumItems(AssemblyRefs), &count)) && + AssemblyRefs, ARRAY_SIZE(AssemblyRefs), &count)) && count > 0) { for (ULONG i = 0; i < count; i++, totalCount++) @@ -3227,7 +3225,7 @@ void MDInfo::DisplayFiles() HRESULT hr; while (SUCCEEDED(hr = m_pAssemblyImport->EnumFiles( &fileEnum, - Files, NumItems(Files), &count)) && + Files, ARRAY_SIZE(Files), &count)) && count > 0) { for (ULONG i = 0; i < count; i++, totalCount++) @@ -3283,7 +3281,7 @@ void MDInfo::DisplayExportedTypes() HRESULT hr; while (SUCCEEDED(hr = m_pAssemblyImport->EnumExportedTypes( &comTypeEnum, - ExportedTypes, NumItems(ExportedTypes), &count)) && + ExportedTypes, ARRAY_SIZE(ExportedTypes), &count)) && count > 0) { for (ULONG i = 0; i < count; i++, totalCount++) @@ -3331,7 +3329,7 @@ void MDInfo::DisplayManifestResources() HRESULT hr; while (SUCCEEDED(hr = m_pAssemblyImport->EnumManifestResources( &manifestResourceEnum, - ManifestResources, NumItems(ManifestResources), &count)) && + ManifestResources, ARRAY_SIZE(ManifestResources), &count)) && count > 0) { for (ULONG i = 0; i < count; i++, totalCount++) @@ -3415,7 +3413,7 @@ void MDInfo::DisplayUserStrings() bool bUnprint = false; // Is an unprintable character found? HRESULT hr; // A result. while (SUCCEEDED(hr = m_pImport->EnumUserStrings( &stringEnum, - Strings, NumItems(Strings), &count)) && + Strings, ARRAY_SIZE(Strings), &count)) && count > 0) { if (totalCount == 1) diff --git a/src/coreclr/utilcode/clrconfig.cpp b/src/coreclr/utilcode/clrconfig.cpp index 98518c4dd8ebc1..d4f6ec2adabafb 100644 --- a/src/coreclr/utilcode/clrconfig.cpp +++ b/src/coreclr/utilcode/clrconfig.cpp @@ -148,7 +148,7 @@ namespace bool noPrefix = CheckLookupOption(options, LookupOptions::DontPrependPrefix); if (noPrefix) { - if (namelen >= _countof(buff)) + if (namelen >= ARRAY_SIZE(buff)) { _ASSERTE(!"Environment variable name too long."); return NULL; @@ -158,8 +158,8 @@ namespace } else { - bool dotnetValid = namelen < (size_t)(_countof(buff) - 1 - LEN_OF_DOTNET_PREFIX); - bool complusValid = namelen < (size_t)(_countof(buff) - 1 - LEN_OF_COMPLUS_PREFIX); + bool dotnetValid = namelen < (size_t)(STRING_LENGTH(buff) - LEN_OF_DOTNET_PREFIX); + bool complusValid = namelen < (size_t)(STRING_LENGTH(buff) - LEN_OF_COMPLUS_PREFIX); if(!dotnetValid || !complusValid) { _ASSERTE(!"Environment variable name too long."); @@ -171,11 +171,11 @@ namespace return NULL; // Priority order is DOTNET_ and then COMPlus_. - wcscpy_s(buff, _countof(buff), DOTNET_PREFIX); + wcscpy_s(buff, ARRAY_SIZE(buff), DOTNET_PREFIX); fallbackPrefix = COMPLUS_PREFIX; } - wcscat_s(buff, _countof(buff), name); + wcscat_s(buff, ARRAY_SIZE(buff), name); FAULT_NOT_FATAL(); // We don't report OOM errors here, we return a default value. @@ -188,8 +188,8 @@ namespace DWORD len = WszGetEnvironmentVariable(buff, temp); if (len == 0 && fallbackPrefix != NULL) { - wcscpy_s(buff, _countof(buff), fallbackPrefix); - wcscat_s(buff, _countof(buff), name); + wcscpy_s(buff, ARRAY_SIZE(buff), fallbackPrefix); + wcscat_s(buff, ARRAY_SIZE(buff), name); len = WszGetEnvironmentVariable(buff, temp); } @@ -428,7 +428,7 @@ BOOL CLRConfig::IsConfigEnabled(const ConfigDWORDInfo & info) // // Arguments: // * info - see file:../inc/CLRConfig.h for details. -// +// * isDefault - the value was not set or had an invalid format so the default was returned. // * result - the result. // // Return value: @@ -449,9 +449,7 @@ DWORD CLRConfig::GetConfigValue(const ConfigDWORDInfo & info, /* [Out] */ bool * DWORD resultMaybe; HRESULT hr = GetConfigDWORD(info.name, info.defaultValue, &resultMaybe, info.options); - - // Ignore the default value even if it's set explicitly. - if (resultMaybe != info.defaultValue) + if (SUCCEEDED(hr)) { *isDefault = false; return resultMaybe; diff --git a/src/coreclr/utilcode/debug.cpp b/src/coreclr/utilcode/debug.cpp index b4f44dc989d6f4..2c330a78510b68 100644 --- a/src/coreclr/utilcode/debug.cpp +++ b/src/coreclr/utilcode/debug.cpp @@ -681,7 +681,7 @@ VOID DbgAssertDialog(const char *szFile, int iLine, const char *szExpr) FAULT_NOT_FATAL(); szExprToDisplay = &g_szExprWithStack2[0]; strcpy(szExprToDisplay, szExpr); - strcat_s(szExprToDisplay, _countof(g_szExprWithStack2), "\n\n"); + strcat_s(szExprToDisplay, ARRAY_SIZE(g_szExprWithStack2), "\n\n"); GetStringFromStackLevels(1, 10, szExprToDisplay + strlen(szExprToDisplay)); fGotStackTrace = TRUE; } diff --git a/src/coreclr/utilcode/namespaceutil.cpp b/src/coreclr/utilcode/namespaceutil.cpp index d930c6f86d2e2c..3731d0399fcdf1 100644 --- a/src/coreclr/utilcode/namespaceutil.cpp +++ b/src/coreclr/utilcode/namespaceutil.cpp @@ -513,7 +513,7 @@ void ns::MakePath( // throws on out of memory } bool ns::MakeAssemblyQualifiedName( // true ok, false truncation - __out_ecount(dwBuffer) WCHAR* pBuffer, // Buffer to recieve the results + __out_ecount(dwBuffer) WCHAR* pBuffer, // Buffer to receive the results int dwBuffer, // Number of characters total in buffer const WCHAR *szTypeName, // Namespace for name. int dwTypeName, // Number of characters (not including null) diff --git a/src/coreclr/utilcode/posterror.cpp b/src/coreclr/utilcode/posterror.cpp index c71d1b82e6c565..13cc9960990334 100644 --- a/src/coreclr/utilcode/posterror.cpp +++ b/src/coreclr/utilcode/posterror.cpp @@ -20,10 +20,6 @@ #include -#if !defined(lengthof) -#define lengthof(x) (sizeof(x)/sizeof(x[0])) -#endif - // Local prototypes. HRESULT FillErrorInfo(LPCWSTR szMsg, DWORD dwHelpContext); @@ -123,7 +119,7 @@ HRESULT __cdecl FormatRuntimeErrorVa( // If this is one of our errors or if it is simply a resource ID, then grab the error from the rc file. if ((HRESULT_FACILITY(hrRpt) == FACILITY_URT) || (HIWORD(hrRpt) == 0)) { - hr = UtilLoadStringRC(LOWORD(hrRpt), rcBuf, NumItems(rcBuf), true); + hr = UtilLoadStringRC(LOWORD(hrRpt), rcBuf, ARRAY_SIZE(rcBuf), true); if (hr == S_OK) { _vsnwprintf_s(rcMsg, cchMsg, _TRUNCATE, rcBuf, marker); diff --git a/src/coreclr/utilcode/prettyprintsig.cpp b/src/coreclr/utilcode/prettyprintsig.cpp index e902a5fc0015f4..f3ee09dd169ff2 100644 --- a/src/coreclr/utilcode/prettyprintsig.cpp +++ b/src/coreclr/utilcode/prettyprintsig.cpp @@ -280,11 +280,11 @@ static PCCOR_SIGNATURE PrettyPrintType( if (TypeFromToken(tk) == mdtTypeRef) { - hr = pIMDI->GetTypeRefProps(tk, 0, rcname, NumItems(rcname), 0); + hr = pIMDI->GetTypeRefProps(tk, 0, rcname, ARRAY_SIZE(rcname), 0); } else if (TypeFromToken(tk) == mdtTypeDef) { - hr = pIMDI->GetTypeDefProps(tk, rcname, NumItems(rcname), 0, 0, 0); + hr = pIMDI->GetTypeDefProps(tk, rcname, ARRAY_SIZE(rcname), 0, 0, 0); } else { diff --git a/src/coreclr/utilcode/stacktrace.cpp b/src/coreclr/utilcode/stacktrace.cpp index 9cab6ee2d1f088..dfa07a6d36b479 100644 --- a/src/coreclr/utilcode/stacktrace.cpp +++ b/src/coreclr/utilcode/stacktrace.cpp @@ -11,6 +11,7 @@ #include "corhlpr.h" #include "utilcode.h" #include "pedecoder.h" // for IMAGE_FILE_MACHINE_NATIVE +#include //This is a workaround. We need to work with the debugger team to figure //out how the module handle of the CLR can be found in a SxS safe way. @@ -103,8 +104,6 @@ PVOID UserContext //--- Macros ------------------------------------------------------------------ // -#define COUNT_OF(x) (sizeof(x) / sizeof(x[0])) - // // Types and Constants -------------------------------------------------------- // @@ -295,9 +294,9 @@ LPSTR FillSymbolSearchPathThrows(CQuickBytes &qb) rcBuff.Append(W(';')); // Copy the defacto NT symbol path as well. - size_t sympathLength = chTotal + NumItems(DEFAULT_SYM_PATH) + 1; + size_t sympathLength = chTotal + ARRAY_SIZE(DEFAULT_SYM_PATH) + 1; // integer overflow occurred - if (sympathLength < (size_t)chTotal || sympathLength < NumItems(DEFAULT_SYM_PATH)) + if (sympathLength < (size_t)chTotal || sympathLength < ARRAY_SIZE(DEFAULT_SYM_PATH)) { return NULL; } @@ -342,7 +341,7 @@ LPSTR FillSymbolSearchPathThrows(CQuickBytes &qb) if (ch != 0 && (pathLocationLength < MAX_SYM_PATH)) { - chTotal = chTotal + ch - NumItems(STR_ENGINE_NAME); + chTotal = chTotal + ch - ARRAY_SIZE(STR_ENGINE_NAME); rcBuff.Append(W(';')); } #endif @@ -432,7 +431,7 @@ void MagicInit() // // Try to get the API entrypoints in imagehlp.dll // - for (int i = 0; i < COUNT_OF(ailFuncList); i++) + for (int i = 0; i < ARRAY_SIZE(ailFuncList); i++) { *(ailFuncList[i].ppvfn) = GetProcAddress( g_hinstImageHlp, @@ -509,12 +508,12 @@ DWORD_PTR dwAddr if (!_SymGetModuleInfo(g_hProcess, dwAddr, &mi)) { - strcpy_s(psi->achModule, _countof(psi->achModule), ""); + strcpy_s(psi->achModule, ARRAY_SIZE(psi->achModule), ""); } else { - strcpy_s(psi->achModule, _countof(psi->achModule), mi.ModuleName); - _strupr_s(psi->achModule, _countof(psi->achModule)); + strcpy_s(psi->achModule, ARRAY_SIZE(psi->achModule), mi.ModuleName); + _strupr_s(psi->achModule, ARRAY_SIZE(psi->achModule)); } CHAR rgchUndec[256]; @@ -538,7 +537,7 @@ DWORD_PTR dwAddr { pszSymbol = sym.Name; - if (_SymUnDName(&sym, rgchUndec, COUNT_OF(rgchUndec)-1)) + if (_SymUnDName(&sym, rgchUndec, STRING_LENGTH(rgchUndec))) { pszSymbol = rgchUndec; } @@ -554,7 +553,7 @@ DWORD_PTR dwAddr psi->dwOffset = dwAddr - mi.BaseOfImage; } - strcpy_s(psi->achSymbol, _countof(psi->achSymbol), pszSymbol); + strcpy_s(psi->achSymbol, ARRAY_SIZE(psi->achSymbol), pszSymbol); } /**************************************************************************** diff --git a/src/coreclr/utilcode/util.cpp b/src/coreclr/utilcode/util.cpp index e7b1755b2b1c49..5d1cdbca61fca6 100644 --- a/src/coreclr/utilcode/util.cpp +++ b/src/coreclr/utilcode/util.cpp @@ -48,10 +48,10 @@ void InitWinRTStatus() WinRTStatusEnum winRTStatus = WINRT_STATUS_UNSUPPORTED; const WCHAR wszComBaseDll[] = W("\\combase.dll"); - const SIZE_T cchComBaseDll = _countof(wszComBaseDll); + const SIZE_T cchComBaseDll = ARRAY_SIZE(wszComBaseDll); WCHAR wszComBasePath[MAX_LONGPATH + 1]; - const SIZE_T cchComBasePath = _countof(wszComBasePath); + const SIZE_T cchComBasePath = ARRAY_SIZE(wszComBasePath); ZeroMemory(wszComBasePath, cchComBasePath * sizeof(wszComBasePath[0])); @@ -3116,7 +3116,7 @@ namespace Com STANDARD_VM_CONTRACT; WCHAR wszClsid[39]; - if (GuidToLPWSTR(rclsid, wszClsid, NumItems(wszClsid)) == 0) + if (GuidToLPWSTR(rclsid, wszClsid, ARRAY_SIZE(wszClsid)) == 0) return E_UNEXPECTED; StackSString ssKeyName; diff --git a/src/coreclr/utilcode/util_nodependencies.cpp b/src/coreclr/utilcode/util_nodependencies.cpp index fb812b21ba6ea4..9dae13a57d3118 100644 --- a/src/coreclr/utilcode/util_nodependencies.cpp +++ b/src/coreclr/utilcode/util_nodependencies.cpp @@ -437,7 +437,7 @@ HRESULT GetDebuggerSettingInfoWorker(__out_ecount_part_opt(*pcchDebuggerString, if ((ret == ERROR_SUCCESS) && (valueType == REG_SZ) && (valueSize / sizeof(WCHAR) < MAX_LONGPATH)) { WCHAR wzAutoKey[MAX_LONGPATH]; - valueSize = NumItems(wzAutoKey) * sizeof(WCHAR); + valueSize = ARRAY_SIZE(wzAutoKey) * sizeof(WCHAR); WszRegQueryValueEx(hKeyHolder, kUnmanagedDebuggerAutoValue, NULL, NULL, reinterpret_cast< LPBYTE >(wzAutoKey), &valueSize); // The OS's behavior is to consider Auto to be FALSE unless the first character is set @@ -708,7 +708,7 @@ void _cdecl DbgWriteEx(LPCTSTR szFmt, ...) va_list marker; va_start(marker, szFmt); - _vsnwprintf_s(rcBuff, _countof(rcBuff), _TRUNCATE, szFmt, marker); + _vsnwprintf_s(rcBuff, ARRAY_SIZE(rcBuff), _TRUNCATE, szFmt, marker); va_end(marker); WszOutputDebugString(rcBuff); } diff --git a/src/coreclr/vm/CMakeLists.txt b/src/coreclr/vm/CMakeLists.txt index a9fcdcb3d112e4..bbc411c324cde4 100644 --- a/src/coreclr/vm/CMakeLists.txt +++ b/src/coreclr/vm/CMakeLists.txt @@ -7,10 +7,8 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../interop/inc) include_directories(${CLR_SRC_NATIVE_DIR}) # needed when zLib compression is used -include_directories(${CLR_SRC_LIBS_NATIVE_DIR}/AnyOS/zlib) -if(NOT CLR_CMAKE_TARGET_WIN32) - include_directories(${CLR_SRC_LIBS_NATIVE_DIR}/Unix/Common) -endif() +include_directories(${CLR_SRC_NATIVE_DIR}/libs/System.IO.Compression.Native) +include_directories(${CLR_SRC_NATIVE_DIR}/libs/Common) add_definitions(-DUNICODE) add_definitions(-D_UNICODE) diff --git a/src/coreclr/vm/appdomain.cpp b/src/coreclr/vm/appdomain.cpp index 61c4c08e249257..0194f960809d92 100644 --- a/src/coreclr/vm/appdomain.cpp +++ b/src/coreclr/vm/appdomain.cpp @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - #include "common.h" #include "appdomain.hpp" @@ -1567,7 +1566,7 @@ bool SystemDomain::IsReflectionInvocationMethod(MethodDesc* pMeth) if (!VolatileLoad(&fInited)) { // Make sure all types are loaded so that we can use faster GetExistingClass() - for (unsigned i = 0; i < NumItems(reflectionInvocationTypes); i++) + for (unsigned i = 0; i < ARRAY_SIZE(reflectionInvocationTypes); i++) { CoreLibBinder::GetClass(reflectionInvocationTypes[i]); } @@ -1577,7 +1576,7 @@ bool SystemDomain::IsReflectionInvocationMethod(MethodDesc* pMeth) if (!pCaller->HasInstantiation()) { - for (unsigned i = 0; i < NumItems(reflectionInvocationTypes); i++) + for (unsigned i = 0; i < ARRAY_SIZE(reflectionInvocationTypes); i++) { if (CoreLibBinder::GetExistingClass(reflectionInvocationTypes[i]) == pCaller) return true; @@ -2039,17 +2038,6 @@ void AppDomain::Init() SetStage( STAGE_CREATING); - - // The lock is taken also during stack walking (GC or profiler) - // - To prevent deadlock with GC thread, we cannot trigger GC while holding the lock - // - To prevent deadlock with profiler thread, we cannot allow thread suspension - m_crstHostAssemblyMap.Init( - CrstHostAssemblyMap, - (CrstFlags)(CRST_GC_NOTRIGGER_WHEN_TAKEN - | CRST_DEBUGGER_THREAD - INDEBUG(| CRST_DEBUG_ONLY_CHECK_FORBID_SUSPEND_THREAD))); - m_crstHostAssemblyMapAdd.Init(CrstHostAssemblyMapAdd); - //Allocate the threadpool entry before the appdomain id list. Otherwise, //the thread pool list will be out of sync if insertion of id in //the appdomain fails. @@ -3196,10 +3184,9 @@ DomainAssembly * AppDomain::FindAssembly(PEAssembly * pPEAssembly, FindAssemblyO { CONTRACTL { - THROWS; - GC_TRIGGERS; + NOTHROW; + GC_NOTRIGGER; MODE_ANY; - INJECT_FAULT(COMPlusThrowOM();); } CONTRACTL_END; @@ -3207,7 +3194,7 @@ DomainAssembly * AppDomain::FindAssembly(PEAssembly * pPEAssembly, FindAssemblyO if (pPEAssembly->HasHostAssembly()) { - DomainAssembly * pDA = FindAssembly(pPEAssembly->GetHostAssembly()); + DomainAssembly * pDA = pPEAssembly->GetHostAssembly()->GetDomainAssembly(); if (pDA != nullptr && (pDA->IsLoaded() || (includeFailedToLoad && pDA->IsError()))) { return pDA; @@ -5337,99 +5324,6 @@ TypeEquivalenceHashTable * AppDomain::GetTypeEquivalenceCache() #endif //FEATURE_TYPEEQUIVALENCE -#if !defined(DACCESS_COMPILE) - -//--------------------------------------------------------------------------------------------------------------------- -void AppDomain::PublishHostedAssembly( - DomainAssembly * pDomainAssembly) -{ - CONTRACTL - { - THROWS; - GC_NOTRIGGER; - MODE_ANY; - } - CONTRACTL_END - - if (pDomainAssembly->GetPEAssembly()->HasHostAssembly()) - { - // We have to serialize all Add operations - CrstHolder lockAdd(&m_crstHostAssemblyMapAdd); - _ASSERTE(m_hostAssemblyMap.Lookup(pDomainAssembly->GetPEAssembly()->GetHostAssembly()) == nullptr); - - // Wrapper for m_hostAssemblyMap.Add that avoids call out into host - HostAssemblyMap::AddPhases addCall; - - // 1. Preallocate one element - addCall.PreallocateForAdd(&m_hostAssemblyMap); - { - // 2. Take the reader lock which can be taken during stack walking - // We cannot call out into host from ForbidSuspend region (i.e. no allocations/deallocations) - ForbidSuspendThreadHolder suspend; - { - CrstHolder lock(&m_crstHostAssemblyMap); - // 3. Add the element to the hash table (no call out into host) - addCall.Add(pDomainAssembly); - } - } - // 4. Cleanup the old memory (if any) - addCall.DeleteOldTable(); - } - else - { - } -} - -//--------------------------------------------------------------------------------------------------------------------- -void AppDomain::UnPublishHostedAssembly( - DomainAssembly * pAssembly) -{ - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - MODE_ANY; - CAN_TAKE_LOCK; - } - CONTRACTL_END - - if (pAssembly->GetPEAssembly()->HasHostAssembly()) - { - ForbidSuspendThreadHolder suspend; - { - CrstHolder lock(&m_crstHostAssemblyMap); - _ASSERTE(m_hostAssemblyMap.Lookup(pAssembly->GetPEAssembly()->GetHostAssembly()) != nullptr); - m_hostAssemblyMap.Remove(pAssembly->GetPEAssembly()->GetHostAssembly()); - } - } -} - -#endif //!DACCESS_COMPILE - -//--------------------------------------------------------------------------------------------------------------------- -PTR_DomainAssembly AppDomain::FindAssembly(PTR_BINDER_SPACE_Assembly pHostAssembly) -{ - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - MODE_ANY; - SUPPORTS_DAC; - } - CONTRACTL_END - - if (pHostAssembly == nullptr) - return NULL; - - { - ForbidSuspendThreadHolder suspend; - { - CrstHolder lock(&m_crstHostAssemblyMap); - return m_hostAssemblyMap.Lookup(pHostAssembly); - } - } -} - #ifndef DACCESS_COMPILE // Return native image for a given composite image file name, NULL when not found. PTR_NativeImage AppDomain::GetNativeImage(LPCUTF8 simpleFileName) diff --git a/src/coreclr/vm/appdomain.hpp b/src/coreclr/vm/appdomain.hpp index 27509c601e4cc2..a369823a53937c 100644 --- a/src/coreclr/vm/appdomain.hpp +++ b/src/coreclr/vm/appdomain.hpp @@ -2359,67 +2359,6 @@ class AppDomain : public BaseDomain TieredCompilationManager m_tieredCompilationManager; #endif - -private: - //----------------------------------------------------------- - // Static BINDER_SPACE::Assembly -> DomainAssembly mapping functions. - // This map does not maintain a reference count to either key or value. - // PEAssembly maintains a reference count on the BINDER_SPACE::Assembly through its code:PEAssembly::m_pHostAssembly field. - // It is removed from this hash table by code:DomainAssembly::~DomainAssembly. - struct HostAssemblyHashTraits : public DefaultSHashTraits - { - public: - typedef PTR_BINDER_SPACE_Assembly key_t; - - static key_t GetKey(element_t const & elem) - { - STATIC_CONTRACT_WRAPPER; - return elem->GetPEAssembly()->GetHostAssembly(); - } - - static BOOL Equals(key_t key1, key_t key2) - { - LIMITED_METHOD_CONTRACT; - return dac_cast(key1) == dac_cast(key2); - } - - static count_t Hash(key_t key) - { - STATIC_CONTRACT_LIMITED_METHOD; - //return reinterpret_cast(dac_cast(key)); - return (count_t)(dac_cast(key)); - } - - static element_t Null() { return NULL; } - static element_t Deleted() { return (element_t)(TADDR)-1; } - static bool IsNull(const element_t & e) { return e == NULL; } - static bool IsDeleted(const element_t & e) { return dac_cast(e) == (TADDR)-1; } - }; - - typedef SHash HostAssemblyMap; - HostAssemblyMap m_hostAssemblyMap; - CrstExplicitInit m_crstHostAssemblyMap; - // Lock to serialize all Add operations (in addition to the "read-lock" above) - CrstExplicitInit m_crstHostAssemblyMapAdd; - -public: - // Returns DomainAssembly. - PTR_DomainAssembly FindAssembly(PTR_BINDER_SPACE_Assembly pHostAssembly); - -#ifndef DACCESS_COMPILE -private: - friend void DomainAssembly::Allocate(); - friend DomainAssembly::~DomainAssembly(); - - // Called from DomainAssembly::Begin. - void PublishHostedAssembly( - DomainAssembly* pAssembly); - - // Called from DomainAssembly::~DomainAssembly - void UnPublishHostedAssembly( - DomainAssembly* pAssembly); -#endif // DACCESS_COMPILE - }; // class AppDomain // Just a ref holder diff --git a/src/coreclr/vm/arm/stubs.cpp b/src/coreclr/vm/arm/stubs.cpp index 844ba0856065bc..57e478633668f6 100644 --- a/src/coreclr/vm/arm/stubs.cpp +++ b/src/coreclr/vm/arm/stubs.cpp @@ -755,7 +755,7 @@ void StubPrecode::Init(StubPrecode* pPrecodeRX, MethodDesc* pMD, LoaderAllocator m_rgCode[n++] = 0xf8df; // ldr pc, [pc, #0] m_rgCode[n++] = 0xf000; - _ASSERTE(n == _countof(m_rgCode)); + _ASSERTE(n == ARRAY_SIZE(m_rgCode)); m_pTarget = GetPreStubEntryPoint(); m_pMethodDesc = (TADDR)pMD; @@ -772,7 +772,7 @@ void NDirectImportPrecode::Init(NDirectImportPrecode* pPrecodeRX, MethodDesc* pM m_rgCode[n++] = 0xf8df; // ldr pc, [pc, #4] m_rgCode[n++] = 0xf004; - _ASSERTE(n == _countof(m_rgCode)); + _ASSERTE(n == ARRAY_SIZE(m_rgCode)); m_pMethodDesc = (TADDR)pMD; m_pTarget = GetEEFuncEntryPoint(NDirectImportThunk); @@ -826,7 +826,7 @@ void ThisPtrRetBufPrecode::Init(MethodDesc* pMD, LoaderAllocator *pLoaderAllocat m_rgCode[n++] = 0xf8df; // ldr pc, [pc, #0] m_rgCode[n++] = 0xf000; - _ASSERTE(n == _countof(m_rgCode)); + _ASSERTE(n == ARRAY_SIZE(m_rgCode)); m_pTarget = GetPreStubEntryPoint(); m_pMethodDesc = (TADDR)pMD; diff --git a/src/coreclr/vm/arm64/cgencpu.h b/src/coreclr/vm/arm64/cgencpu.h index f0111372b785eb..100f2454b949e0 100644 --- a/src/coreclr/vm/arm64/cgencpu.h +++ b/src/coreclr/vm/arm64/cgencpu.h @@ -598,7 +598,7 @@ struct StubPrecode { } CONTRACTL_END; - ExecutableWriterHolder precodeWriterHolder(this, sizeof(StubPrecode)); + ExecutableWriterHolder precodeWriterHolder(this, sizeof(StubPrecode)); InterlockedExchange64((LONGLONG*)&precodeWriterHolder.GetRW()->m_pTarget, (TADDR)GetPreStubEntryPoint()); } @@ -611,7 +611,7 @@ struct StubPrecode { } CONTRACTL_END; - ExecutableWriterHolder precodeWriterHolder(this, sizeof(StubPrecode)); + ExecutableWriterHolder precodeWriterHolder(this, sizeof(StubPrecode)); return (TADDR)InterlockedCompareExchange64( (LONGLONG*)&precodeWriterHolder.GetRW()->m_pTarget, (TADDR)target, (TADDR)expected) == expected; } @@ -691,7 +691,7 @@ struct FixupPrecode { m_rgCode[n++] = 0xD61F0160; // br x11 - _ASSERTE(n == _countof(m_rgCode)); + _ASSERTE(n == ARRAY_SIZE(m_rgCode)); } TADDR GetBase() @@ -796,7 +796,7 @@ struct ThisPtrRetBufPrecode { } CONTRACTL_END; - ExecutableWriterHolder precodeWriterHolder(this, sizeof(ThisPtrRetBufPrecode)); + ExecutableWriterHolder precodeWriterHolder(this, sizeof(ThisPtrRetBufPrecode)); return (TADDR)InterlockedCompareExchange64( (LONGLONG*)&precodeWriterHolder.GetRW()->m_pTarget, (TADDR)target, (TADDR)expected) == expected; } diff --git a/src/coreclr/vm/arm64/stubs.cpp b/src/coreclr/vm/arm64/stubs.cpp index 44b42cd9302102..fbd222a9b2aba5 100644 --- a/src/coreclr/vm/arm64/stubs.cpp +++ b/src/coreclr/vm/arm64/stubs.cpp @@ -575,7 +575,7 @@ void StubPrecode::Init(StubPrecode* pPrecodeRX, MethodDesc* pMD, LoaderAllocator m_rgCode[n++] = 0xA940312A; // ldp x10,x12,[x9] m_rgCode[n++] = 0xD61F0140; // br x10 - _ASSERTE(n+1 == _countof(m_rgCode)); + _ASSERTE(n+1 == ARRAY_SIZE(m_rgCode)); m_pTarget = GetPreStubEntryPoint(); m_pMethodDesc = (TADDR)pMD; @@ -591,7 +591,7 @@ void NDirectImportPrecode::Init(NDirectImportPrecode* pPrecodeRX, MethodDesc* pM m_rgCode[n++] = 0xA940316A; // ldp x10,x12,[x11] m_rgCode[n++] = 0xD61F0140; // br x10 - _ASSERTE(n+1 == _countof(m_rgCode)); + _ASSERTE(n+1 == ARRAY_SIZE(m_rgCode)); m_pTarget = GetEEFuncEntryPoint(NDirectImportThunk); m_pMethodDesc = (TADDR)pMD; @@ -645,7 +645,7 @@ void ThisPtrRetBufPrecode::Init(MethodDesc* pMD, LoaderAllocator *pLoaderAllocat _ASSERTE((UINT32*)&m_pTarget == &m_rgCode[n + 2]); m_rgCode[n++] = 0xd61f0200; // br x16 n++; // empty 4 bytes for data alignment below - _ASSERTE(n == _countof(m_rgCode)); + _ASSERTE(n == ARRAY_SIZE(m_rgCode)); m_pTarget = GetPreStubEntryPoint(); diff --git a/src/coreclr/vm/array.cpp b/src/coreclr/vm/array.cpp index bbe35286a5b3ab..a83c577b72c860 100644 --- a/src/coreclr/vm/array.cpp +++ b/src/coreclr/vm/array.cpp @@ -1297,7 +1297,7 @@ MethodDesc* GetActualImplementationForArrayGenericIListOrIReadOnlyListMethod(Met // Subtract one for the non-generic IEnumerable that the generic enumerable inherits from unsigned int inheritanceDepth = pItfcMeth->GetMethodTable()->GetNumInterfaces() - 1; - PREFIX_ASSUME(0 <= inheritanceDepth && inheritanceDepth < NumItems(startingMethod)); + PREFIX_ASSUME(0 <= inheritanceDepth && inheritanceDepth < ARRAY_SIZE(startingMethod)); MethodDesc *pGenericImplementor = CoreLibBinder::GetMethod((BinderMethodID)(startingMethod[inheritanceDepth] + slot)); diff --git a/src/coreclr/vm/binder.cpp b/src/coreclr/vm/binder.cpp index 4d0ab1c2678fa5..d9cfb45acda1a8 100644 --- a/src/coreclr/vm/binder.cpp +++ b/src/coreclr/vm/binder.cpp @@ -533,7 +533,7 @@ void CoreLibBinder::Check() MethodTable * pMT = NULL; - for (unsigned i = 0; i < NumItems(OffsetsAndSizes); i++) + for (unsigned i = 0; i < ARRAY_SIZE(OffsetsAndSizes); i++) { const OffsetAndSizeCheck * p = OffsetsAndSizes + i; @@ -822,11 +822,11 @@ static void FCallCheckSignature(MethodDesc* pMD, PCODE pImpl) } else if (argType == ELEMENT_TYPE_I4) { - bSigError = !IsStrInArray(pUnmanagedArg, len, aInt32Type, NumItems(aInt32Type)); + bSigError = !IsStrInArray(pUnmanagedArg, len, aInt32Type, ARRAY_SIZE(aInt32Type)); } else if (argType == ELEMENT_TYPE_U4) { - bSigError = !IsStrInArray(pUnmanagedArg, len, aUInt32Type, NumItems(aUInt32Type)); + bSigError = !IsStrInArray(pUnmanagedArg, len, aUInt32Type, ARRAY_SIZE(aUInt32Type)); } else if (argType == ELEMENT_TYPE_VALUETYPE) { @@ -835,7 +835,7 @@ static void FCallCheckSignature(MethodDesc* pMD, PCODE pImpl) } else { - bSigError = IsStrInArray(pUnmanagedArg, len, aType, NumItems(aType)); + bSigError = IsStrInArray(pUnmanagedArg, len, aType, ARRAY_SIZE(aType)); } if (bSigError) { diff --git a/src/coreclr/vm/callconvbuilder.cpp b/src/coreclr/vm/callconvbuilder.cpp index 8216f06feff377..b47a696f59b831 100644 --- a/src/coreclr/vm/callconvbuilder.cpp +++ b/src/coreclr/vm/callconvbuilder.cpp @@ -60,7 +60,7 @@ namespace { #define BASE_CALL_CONV(name, flag) { \ MAKE_FULLY_QUALIFIED_CALLCONV_TYPE_NAME_PREFIX(name), \ - lengthof(MAKE_FULLY_QUALIFIED_CALLCONV_TYPE_NAME_PREFIX(name)) - 1, \ + STRING_LENGTH(MAKE_FULLY_QUALIFIED_CALLCONV_TYPE_NAME_PREFIX(name)), \ CorInfoCallConvExtension::flag, \ BeginsWith }, @@ -73,7 +73,7 @@ namespace { #define BASE_CALL_CONV(name, flag) { \ name, \ - lengthof(name) - 1, \ + STRING_LENGTH(name), \ CorInfoCallConvExtension::flag, \ Equals }, @@ -86,7 +86,7 @@ namespace { #define CALL_CONV_MODIFIER(name, flag) { \ MAKE_FULLY_QUALIFIED_CALLCONV_TYPE_NAME_PREFIX(name), \ - lengthof(MAKE_FULLY_QUALIFIED_CALLCONV_TYPE_NAME_PREFIX(name)) - 1, \ + STRING_LENGTH(MAKE_FULLY_QUALIFIED_CALLCONV_TYPE_NAME_PREFIX(name)), \ CallConvBuilder::flag, \ BeginsWith }, @@ -99,7 +99,7 @@ namespace { #define CALL_CONV_MODIFIER(name, flag) { \ name, \ - lengthof(name) - 1, \ + STRING_LENGTH(name), \ CallConvBuilder::flag, \ Equals }, @@ -523,7 +523,7 @@ bool CallConv::TryGetCallingConventionFromUnmanagedCallersOnly(_In_ MethodDesc* NULL, 0, namedArgs, - lengthof(namedArgs), + ARRAY_SIZE(namedArgs), domainAssembly)); // If the value isn't defined, then return without setting anything. diff --git a/src/coreclr/vm/ceeload.cpp b/src/coreclr/vm/ceeload.cpp index 02374e18df61c8..b8d69bc36669fd 100644 --- a/src/coreclr/vm/ceeload.cpp +++ b/src/coreclr/vm/ceeload.cpp @@ -1762,7 +1762,7 @@ BOOL Module::IsRuntimeWrapExceptions() // Then, find the named argument namedArgs[0].InitBoolField("WrapNonExceptionThrows"); - IfFailGo(ParseKnownCaNamedArgs(ca, namedArgs, lengthof(namedArgs))); + IfFailGo(ParseKnownCaNamedArgs(ca, namedArgs, ARRAY_SIZE(namedArgs))); if (namedArgs[0].val.boolean) fRuntimeWrapExceptions = TRUE; diff --git a/src/coreclr/vm/ceemain.cpp b/src/coreclr/vm/ceemain.cpp index 7ae4605e95adcb..593b8ff3a83d60 100644 --- a/src/coreclr/vm/ceemain.cpp +++ b/src/coreclr/vm/ceemain.cpp @@ -949,7 +949,7 @@ void EEStartupHelper() #ifdef DEBUGGING_SUPPORTED // Make a call to publish the DefaultDomain for the debugger // This should be done before assemblies/modules are loaded into it (i.e. SystemDomain::Init) - // and after its OK to switch GC modes and syncronize for sending events to the debugger. + // and after its OK to switch GC modes and synchronize for sending events to the debugger. // @dbgtodo synchronization: this can probably be simplified in V3 LOG((LF_CORDB | LF_SYNC | LF_STARTUP, LL_INFO1000, "EEStartup: adding default domain 0x%x\n", SystemDomain::System()->DefaultDomain())); diff --git a/src/coreclr/vm/class.cpp b/src/coreclr/vm/class.cpp index d0d9f2b4dd9215..3add832d29a72e 100644 --- a/src/coreclr/vm/class.cpp +++ b/src/coreclr/vm/class.cpp @@ -1877,7 +1877,7 @@ TypeHandle MethodTable::GetDefItfForComClassItf() if (it.Next()) { // Can use GetInterfaceApprox, as there are no generic default interfaces - return TypeHandle(it.GetInterfaceApprox()); + return TypeHandle(it.GetInterfaceApprox()); } else { @@ -2877,7 +2877,7 @@ DeepFieldDescIterator::Init(MethodTable* pMT, int iteratorType, while (pMT) { - if (m_numClasses < (int)NumItems(m_classes)) + if (m_numClasses < (int)ARRAY_SIZE(m_classes)) { m_classes[m_numClasses++] = pMT; } diff --git a/src/coreclr/vm/clrtocomcall.cpp b/src/coreclr/vm/clrtocomcall.cpp index b9660ba76036a1..a7f91f7e13d39e 100644 --- a/src/coreclr/vm/clrtocomcall.cpp +++ b/src/coreclr/vm/clrtocomcall.cpp @@ -616,7 +616,7 @@ UINT32 CLRToCOMLateBoundWorker( hr = pItfMD->GetMDImport()->GetDispIdOfMemberDef(tkMember, (ULONG*)&dispId); if (hr == S_OK) { - WCHAR strTmp[ARRAYSIZE(DISPID_NAME_FORMAT_STRING W("4294967295"))]; + WCHAR strTmp[ARRAY_SIZE(DISPID_NAME_FORMAT_STRING W("4294967295"))]; _snwprintf_s(strTmp, COUNTOF(strTmp), _TRUNCATE, DISPID_NAME_FORMAT_STRING, dispId); gc.MemberName = StringObject::NewString(strTmp); } diff --git a/src/coreclr/vm/clsload.cpp b/src/coreclr/vm/clsload.cpp index 9392f6c11d93ee..0578cc20b54698 100644 --- a/src/coreclr/vm/clsload.cpp +++ b/src/coreclr/vm/clsload.cpp @@ -627,7 +627,6 @@ void ClassLoader::GetClassValue(NameHandleTable nhTable, CONTRACTL_END - mdToken mdEncloser; EEClassHashEntry_t *pBucket = NULL; needsToBuildHashtable = FALSE; @@ -643,8 +642,6 @@ void ClassLoader::GetClassValue(NameHandleTable nhTable, } #endif - BOOL isNested = IsNested(pName, &mdEncloser); - PTR_Assembly assembly = GetAssembly(); PREFIX_ASSUME(assembly != NULL); ModuleIterator i = assembly->IterateModules(); @@ -719,6 +716,9 @@ void ClassLoader::GetClassValue(NameHandleTable nhTable, } _ASSERTE(pTable); + mdToken mdEncloser; + BOOL isNested = IsNested(pName, &mdEncloser); + if (isNested) { Module *pNameModule = pName->GetTypeModule(); @@ -834,6 +834,9 @@ void ClassLoader::LazyPopulateCaseSensitiveHashTables() } CONTRACTL_END; + + _ASSERT(m_cUnhashedModules > 0); + AllocMemTracker amTracker; ModuleIterator i = GetAssembly()->IterateModules(); @@ -909,6 +912,8 @@ void ClassLoader::LazyPopulateCaseInsensitiveHashTables() amTracker.SuppressRelease(); pModule->SetAvailableClassCaseInsHash(pNewClassCaseInsHash); FastInterlockDecrement((LONG*)&m_cUnhashedModules); + + _ASSERT(m_cUnhashedModules >= 0); } } } @@ -1061,27 +1066,8 @@ void ClassLoader::TryEnsureLoaded(TypeHandle typeHnd, ClassLoadLevel level) #endif // DACCESS_COMPILE } -// This is separated out to avoid the overhead of C++ exception handling in the non-locking case. -/* static */ -TypeHandle ClassLoader::LookupTypeKeyUnderLock(TypeKey *pKey, - EETypeHashTable *pTable, - CrstBase *pLock) -{ - WRAPPER_NO_CONTRACT; - SUPPORTS_DAC; - - // m_AvailableTypesLock has to be taken in cooperative mode to avoid deadlocks during GC - GCX_MAYBE_COOP_NO_THREAD_BROKEN(!IsGCThread()); - - CrstHolder ch(pLock); - return pTable->GetValue(pKey); -} - /* static */ -TypeHandle ClassLoader::LookupTypeKey(TypeKey *pKey, - EETypeHashTable *pTable, - CrstBase *pLock, - BOOL fCheckUnderLock) +TypeHandle ClassLoader::LookupTypeKey(TypeKey *pKey, EETypeHashTable *pTable) { CONTRACTL { NOTHROW; @@ -1090,26 +1076,15 @@ TypeHandle ClassLoader::LookupTypeKey(TypeKey *pKey, PRECONDITION(CheckPointer(pKey)); PRECONDITION(pKey->IsConstructed()); PRECONDITION(CheckPointer(pTable)); - PRECONDITION(!fCheckUnderLock || CheckPointer(pLock)); MODE_ANY; SUPPORTS_DAC; } CONTRACTL_END; - TypeHandle th; - - if (fCheckUnderLock) - { - th = LookupTypeKeyUnderLock(pKey, pTable, pLock); - } - else - { - th = pTable->GetValue(pKey); - } - return th; + return pTable->GetValue(pKey); } /* static */ -TypeHandle ClassLoader::LookupInLoaderModule(TypeKey *pKey, BOOL fCheckUnderLock) +TypeHandle ClassLoader::LookupInLoaderModule(TypeKey *pKey) { CONTRACTL { NOTHROW; @@ -1124,39 +1099,12 @@ TypeHandle ClassLoader::LookupInLoaderModule(TypeKey *pKey, BOOL fCheckUnderLock Module *pLoaderModule = ComputeLoaderModule(pKey); PREFIX_ASSUME(pLoaderModule!=NULL); - return LookupTypeKey(pKey, - pLoaderModule->GetAvailableParamTypes(), - &pLoaderModule->GetClassLoader()->m_AvailableTypesLock, - fCheckUnderLock); + return LookupTypeKey(pKey, pLoaderModule->GetAvailableParamTypes()); } /* static */ TypeHandle ClassLoader::LookupTypeHandleForTypeKey(TypeKey *pKey) -{ - WRAPPER_NO_CONTRACT; - SUPPORTS_DAC; - - // Make an initial lookup without taking any locks. - TypeHandle th = LookupTypeHandleForTypeKeyInner(pKey, FALSE); - - // A non-null TypeHandle for the above lookup indicates success - // A null TypeHandle only indicates "well, it might have been there, - // try again with a lock". This kind of negative result will - // only happen while accessing the underlying EETypeHashTable - // during a resize, i.e. very rarely. In such a case, we just - // perform the lookup again, but indicate that appropriate locks - // should be taken. - - if (th.IsNull()) - { - th = LookupTypeHandleForTypeKeyInner(pKey, TRUE); - } - - return th; -} -/* static */ -TypeHandle ClassLoader::LookupTypeHandleForTypeKeyInner(TypeKey *pKey, BOOL fCheckUnderLock) { CONTRACTL { @@ -1184,7 +1132,7 @@ TypeHandle ClassLoader::LookupTypeHandleForTypeKeyInner(TypeKey *pKey, BOOL fChe // If the thing is not NGEN'd then this may // be different to pPreferredZapModule. If they are the same then // we can reuse the results of the lookup above. - TypeHandle thLM = LookupInLoaderModule(pKey, fCheckUnderLock); + TypeHandle thLM = LookupInLoaderModule(pKey); if (!thLM.IsNull()) { return thLM; @@ -1295,18 +1243,18 @@ BOOL ClassLoader::FindClassModuleThrowing( if (pBucket == NULL) { + // Take the lock. To make sure the table is not being built by another thread. AvailableClasses_LockHolder lh(this); - // Try again with the lock. This will protect against another thread reallocating - // the hash table underneath us - GetClassValue(nhTable, pName, &Data, &pTable, pLookInThisModuleOnly, &foundEntry, loadFlag, needsToBuildHashtable); - pBucket = foundEntry.GetClassHashBasedEntryValue(); - + if (!needsToBuildHashtable || (m_cUnhashedModules == 0)) + { + // the table should be finished now, try again + GetClassValue(nhTable, pName, &Data, &pTable, pLookInThisModuleOnly, &foundEntry, loadFlag, needsToBuildHashtable); + pBucket = foundEntry.GetClassHashBasedEntryValue(); + } #ifndef DACCESS_COMPILE - if (needsToBuildHashtable && (pBucket == NULL) && (m_cUnhashedModules > 0)) + else { - _ASSERT(needsToBuildHashtable); - if (nhTable == nhCaseInsensitive) { LazyPopulateCaseInsensitiveHashTables(); @@ -1325,7 +1273,7 @@ BOOL ClassLoader::FindClassModuleThrowing( #endif } - // Same check as above, but this time we've checked with the lock so the table will be populated + // Same check as above, but this time we've ensured that the tables are populated if (pBucket == NULL) { #if defined(_DEBUG_IMPL) && !defined(DACCESS_COMPILE) @@ -1593,19 +1541,19 @@ ClassLoader::LoadTypeHandleThrowing( pClsLdr = pFoundModule->GetClassLoader(); pLookInThisModuleOnly = NULL; } + } #ifndef DACCESS_COMPILE - // Replace AvailableClasses Module entry with found TypeHandle - if (!typeHnd.IsNull() && - typeHnd.IsRestored() && - foundEntry.GetEntryType() == HashedTypeEntry::EntryType::IsHashedClassEntry && - (foundEntry.GetClassHashBasedEntryValue() != NULL) && - (foundEntry.GetClassHashBasedEntryValue()->GetData() != typeHnd.AsPtr())) - { - foundEntry.GetClassHashBasedEntryValue()->SetData(typeHnd.AsPtr()); - } -#endif // !DACCESS_COMPILE + // Replace AvailableClasses Module entry with found TypeHandle + if (!typeHnd.IsNull() && + typeHnd.IsRestored() && + foundEntry.GetEntryType() == HashedTypeEntry::EntryType::IsHashedClassEntry && + (foundEntry.GetClassHashBasedEntryValue() != NULL) && + (foundEntry.GetClassHashBasedEntryValue()->GetData() != typeHnd.AsPtr())) + { + foundEntry.GetClassHashBasedEntryValue()->SetData(typeHnd.AsPtr()); } +#endif // !DACCESS_COMPILE RETURN typeHnd; } // ClassLoader::LoadTypeHandleThrowing @@ -2055,11 +2003,10 @@ VOID ClassLoader::Init(AllocMemTracker *pamTracker) CrstAvailableClass, CRST_REENTRANCY); - // This lock is taken within the classloader whenever we have to insert a new param. type into the table - // This lock also needs to be taken for a read operation in a GC_NOTRIGGER scope, thus the ANYMODE flag. + // This lock is taken within the classloader whenever we have to insert a new param. type into the table. m_AvailableTypesLock.Init( - CrstAvailableParamTypes, - (CrstFlags)(CRST_UNSAFE_ANYMODE | CRST_DEBUGGER_THREAD)); + CrstAvailableParamTypes, + CRST_DEBUGGER_THREAD); #ifdef _DEBUG CorTypeInfo::CheckConsistency(); @@ -3104,9 +3051,6 @@ TypeHandle ClassLoader::PublishType(TypeKey *pTypeKey, TypeHandle typeHnd) Module *pLoaderModule = ComputeLoaderModule(pTypeKey); EETypeHashTable *pTable = pLoaderModule->GetAvailableParamTypes(); - // m_AvailableTypesLock has to be taken in cooperative mode to avoid deadlocks during GC - GCX_COOP(); - CrstHolder ch(&pLoaderModule->GetClassLoader()->m_AvailableTypesLock); // The type could have been loaded by a different thread as side-effect of avoiding deadlocks caused by LoadsTypeViolation @@ -3121,9 +3065,6 @@ TypeHandle ClassLoader::PublishType(TypeKey *pTypeKey, TypeHandle typeHnd) Module *pModule = pTypeKey->GetModule(); mdTypeDef typeDef = pTypeKey->GetTypeToken(); - // m_AvailableTypesLock has to be taken in cooperative mode to avoid deadlocks during GC - GCX_COOP(); - CrstHolder ch(&pModule->GetClassLoader()->m_AvailableTypesLock); // ! We cannot fail after this point. @@ -3634,7 +3575,7 @@ ClassLoader::LoadTypeHandleForTypeKey_Body( } EX_HOOK { - LOG((LF_CLASSLOADER, LL_INFO10, "Caught an exception loading: %x, %0x (Module)\n", pTypeKey->IsConstructed() ? pTypeKey->ComputeHash() : pTypeKey->GetTypeToken(), pTypeKey->GetModule())); + LOG((LF_CLASSLOADER, LL_INFO10, "Caught an exception loading: %x, %0x (Module)\n", pTypeKey->IsConstructed() ? HashTypeKey(pTypeKey) : pTypeKey->GetTypeToken(), pTypeKey->GetModule())); if (!GetThread()->HasThreadStateNC(Thread::TSNC_LoadsTypeViolation)) { diff --git a/src/coreclr/vm/clsload.hpp b/src/coreclr/vm/clsload.hpp index ac5107a6744254..53afd0b38f4cf5 100644 --- a/src/coreclr/vm/clsload.hpp +++ b/src/coreclr/vm/clsload.hpp @@ -899,21 +899,13 @@ class ClassLoader ClassLoadLevel level = CLASS_LOADED, const InstantiationContext *pInstContext = NULL); - static TypeHandle LookupTypeKeyUnderLock(TypeKey *pKey, - EETypeHashTable *pTable, - CrstBase *pLock); + static TypeHandle LookupTypeKey(TypeKey *pKey, EETypeHashTable *pTable); - static TypeHandle LookupTypeKey(TypeKey *pKey, - EETypeHashTable *pTable, - CrstBase *pLock, - BOOL fCheckUnderLock); - - static TypeHandle LookupInLoaderModule(TypeKey* pKey, BOOL fCheckUnderLock); + static TypeHandle LookupInLoaderModule(TypeKey* pKey); // Lookup a handle in the appropriate table // (declaring module for TypeDef or loader-module for constructed types) static TypeHandle LookupTypeHandleForTypeKey(TypeKey *pTypeKey); - static TypeHandle LookupTypeHandleForTypeKeyInner(TypeKey *pTypeKey, BOOL fCheckUnderLock); static void DECLSPEC_NORETURN ThrowTypeLoadException(TypeKey *pKey, UINT resIDWhy); diff --git a/src/coreclr/vm/comcallablewrapper.cpp b/src/coreclr/vm/comcallablewrapper.cpp index a940abf72adaff..d9fc2fe0ac4d5a 100644 --- a/src/coreclr/vm/comcallablewrapper.cpp +++ b/src/coreclr/vm/comcallablewrapper.cpp @@ -3715,7 +3715,7 @@ BOOL ComMethodTable::LayOutInterfaceMethodTable(MethodTable* pClsMT) BEGIN_PROFILER_CALLBACK(CORProfilerTrackCCW()); #if defined(_DEBUG) WCHAR rIID[40]; // {00000000-0000-0000-0000-000000000000} - GuidToLPWSTR(m_IID, rIID, lengthof(rIID)); + GuidToLPWSTR(m_IID, rIID, ARRAY_SIZE(rIID)); LOG((LF_CORPROF, LL_INFO100, "COMClassicVTableCreated Class:%hs, IID:%ls, vTbl:%#08x\n", pItfClass->GetDebugClassName(), rIID, pUnkVtable)); #else @@ -4771,7 +4771,7 @@ ComCallWrapperTemplate* ComCallWrapperTemplate::CreateTemplate(TypeHandle thClas #if defined(_DEBUG) WCHAR rIID[40]; // {00000000-0000-0000-0000-000000000000} - GuidToLPWSTR(IClassXIID, rIID, lengthof(rIID)); + GuidToLPWSTR(IClassXIID, rIID, ARRAY_SIZE(rIID)); SString ssName; thClass.GetName(ssName); LOG((LF_CORPROF, LL_INFO100, "COMClassicVTableCreated Class:%ls, IID:%ls, vTbl:%#08x\n", diff --git a/src/coreclr/vm/comsynchronizable.cpp b/src/coreclr/vm/comsynchronizable.cpp index 5cd165eeeb705d..027627d4851d74 100644 --- a/src/coreclr/vm/comsynchronizable.cpp +++ b/src/coreclr/vm/comsynchronizable.cpp @@ -627,7 +627,7 @@ FCIMPLEND // Deliver the state of the thread as a consistent set of bits. // This copied in VM\EEDbgInterfaceImpl.h's // CorDebugUserState GetUserState( Thread *pThread ) -// , so propogate changes to both functions +// , so propagate changes to both functions FCIMPL1(INT32, ThreadNative::GetThreadState, ThreadBaseObject* pThisUNSAFE) { FCALL_CONTRACT; diff --git a/src/coreclr/vm/corelib.cpp b/src/coreclr/vm/corelib.cpp index f3f00bce3f9924..4189a6371b25c7 100644 --- a/src/coreclr/vm/corelib.cpp +++ b/src/coreclr/vm/corelib.cpp @@ -246,7 +246,7 @@ const CoreLibClassDescription c_rgCoreLibClassDescriptions[] = #define DEFINE_EXCEPTION(ns, reKind, bHRformessage, ...) { ns , # reKind }, #include "rexcep.h" }; -const USHORT c_nCoreLibClassDescriptions = NumItems(c_rgCoreLibClassDescriptions); +const USHORT c_nCoreLibClassDescriptions = ARRAY_SIZE(c_rgCoreLibClassDescriptions); #define gsig_NoSig (*(HardCodedMetaSig *)NULL) @@ -255,14 +255,14 @@ const CoreLibMethodDescription c_rgCoreLibMethodDescriptions[] = #define DEFINE_METHOD(c,i,s,g) { CLASS__ ## c , # s, & gsig_ ## g }, #include "corelib.h" }; -const USHORT c_nCoreLibMethodDescriptions = NumItems(c_rgCoreLibMethodDescriptions) + 1; +const USHORT c_nCoreLibMethodDescriptions = ARRAY_SIZE(c_rgCoreLibMethodDescriptions) + 1; const CoreLibFieldDescription c_rgCoreLibFieldDescriptions[] = { #define DEFINE_FIELD(c,i,s) { CLASS__ ## c , # s }, #include "corelib.h" }; -const USHORT c_nCoreLibFieldDescriptions = NumItems(c_rgCoreLibFieldDescriptions) + 1; +const USHORT c_nCoreLibFieldDescriptions = ARRAY_SIZE(c_rgCoreLibFieldDescriptions) + 1; /////////////////////////////////////////////////////////////////////////////// // @@ -311,4 +311,4 @@ const ECClass c_rgECClasses[] = #include "ecalllist.h" }; // c_rgECClasses[] -const int c_nECClasses = NumItems(c_rgECClasses); +const int c_nECClasses = ARRAY_SIZE(c_rgECClasses); diff --git a/src/coreclr/vm/customattribute.cpp b/src/coreclr/vm/customattribute.cpp index e0fd9287211920..da728dfe827bdc 100644 --- a/src/coreclr/vm/customattribute.cpp +++ b/src/coreclr/vm/customattribute.cpp @@ -808,7 +808,7 @@ FCIMPL5(VOID, COMCustomAttribute::ParseAttributeUsageAttribute, PVOID pData, ULO CaArg args[1]; args[0].InitEnum(SERIALIZATION_TYPE_I4, 0); - if (FAILED(::ParseKnownCaArgs(ca, args, lengthof(args)))) + if (FAILED(::ParseKnownCaArgs(ca, args, ARRAY_SIZE(args)))) { HELPER_METHOD_FRAME_BEGIN_0(); COMPlusThrow(kCustomAttributeFormatException); @@ -823,7 +823,7 @@ FCIMPL5(VOID, COMCustomAttribute::ParseAttributeUsageAttribute, PVOID pData, ULO namedArgTypes[allowMultiple].Init(SERIALIZATION_TYPE_BOOLEAN); namedArgs[inherited].Init("Inherited", SERIALIZATION_TYPE_PROPERTY, namedArgTypes[inherited], TRUE); namedArgs[allowMultiple].Init("AllowMultiple", SERIALIZATION_TYPE_PROPERTY, namedArgTypes[allowMultiple], FALSE); - if (FAILED(::ParseKnownCaNamedArgs(ca, namedArgs, lengthof(namedArgs)))) + if (FAILED(::ParseKnownCaNamedArgs(ca, namedArgs, ARRAY_SIZE(namedArgs)))) { HELPER_METHOD_FRAME_BEGIN_0(); COMPlusThrow(kCustomAttributeFormatException); diff --git a/src/coreclr/vm/dacenumerablehash.h b/src/coreclr/vm/dacenumerablehash.h index 6a07096fccf16b..b371756466aaf5 100644 --- a/src/coreclr/vm/dacenumerablehash.h +++ b/src/coreclr/vm/dacenumerablehash.h @@ -96,6 +96,16 @@ class DacEnumerableHashTable void EnumMemoryRegions(CLRDataEnumMemoryFlags flags); #endif // DACCESS_COMPILE +private: + struct VolatileEntry; + typedef DPTR(struct VolatileEntry) PTR_VolatileEntry; + struct VolatileEntry + { + VALUE m_sValue; // The derived-class format of an entry + PTR_VolatileEntry m_pNextEntry; // Pointer to the next entry in the bucket chain (or NULL) + DacEnumerableHashValue m_iHashValue; // The hash value associated with the entry + }; + protected: // This opaque structure provides enumeration context when walking the set of entries which share a common // hash code. Initialized by BaseFindFirstEntryByHash and read/updated by BaseFindNextEntryByHash. @@ -106,6 +116,7 @@ class DacEnumerableHashTable TADDR m_pEntry; // The entry the caller is currently looking at (or NULL to begin // with). This is a VolatileEntry* and should always be a target address // not a DAC PTR_. + DPTR(PTR_VolatileEntry) m_curBuckets; // The bucket table we are working with. }; // This opaque structure provides enumeration context when walking all entries in the table. Initialized @@ -176,16 +187,9 @@ class DacEnumerableHashTable PTR_Module m_pModule; private: + private: // Internal implementation details. Nothing of interest to sub-classers for here on. - - struct VolatileEntry; - typedef DPTR(struct VolatileEntry) PTR_VolatileEntry; - struct VolatileEntry - { - VALUE m_sValue; // The derived-class format of an entry - PTR_VolatileEntry m_pNextEntry; // Pointer to the next entry in the bucket chain (or NULL) - DacEnumerableHashValue m_iHashValue; // The hash value associated with the entry - }; + DPTR(VALUE) BaseFindFirstEntryByHashCore(DPTR(PTR_VolatileEntry) curBuckets, DacEnumerableHashValue iHash, LookupContext* pContext); #ifndef DACCESS_COMPILE // Determine loader heap to be used for allocation of entries and bucket lists. @@ -206,11 +210,27 @@ class DacEnumerableHashTable return m_pBuckets; } + // our bucket table uses two extra slots - slot [0] contains the length of the table, + // slot [1] will contain the next version of the table if it resizes + static const int SLOT_LENGTH = 0; + static const int SLOT_NEXT = 1; + // normal slots start at slot #2 + static const int SKIP_SPECIAL_SLOTS = 2; + + static DWORD GetLength(DPTR(PTR_VolatileEntry) buckets) + { + return (DWORD)dac_cast(buckets[SLOT_LENGTH]); + } + + static DPTR(PTR_VolatileEntry) GetNext(DPTR(PTR_VolatileEntry) buckets) + { + return dac_cast(buckets[SLOT_NEXT]); + } + // Loader heap provided at construction time. May be NULL (in which case m_pModule must *not* be NULL). LoaderHeap *m_pHeap; DPTR(PTR_VolatileEntry) m_pBuckets; // Pointer to a simple bucket list (array of VolatileEntry pointers) - DWORD m_cBuckets; // Count of buckets in the above array (always non-zero) DWORD m_cEntries; // Count of elements }; diff --git a/src/coreclr/vm/dacenumerablehash.inl b/src/coreclr/vm/dacenumerablehash.inl index a0a37381f8802e..4216ef35033724 100644 --- a/src/coreclr/vm/dacenumerablehash.inl +++ b/src/coreclr/vm/dacenumerablehash.inl @@ -41,11 +41,16 @@ DacEnumerableHashTable::DacEnumerableHashTable(Module *pModu m_pModule = pModule; m_pHeap = pHeap; - S_SIZE_T cbBuckets = S_SIZE_T(sizeof(VolatileEntry*)) * S_SIZE_T(cInitialBuckets); + // two extra slots - slot [0] contains the length of the table, + // slot [1] will contain the next version of the table if it resizes + S_SIZE_T cbBuckets = S_SIZE_T(sizeof(VolatileEntry*)) * (S_SIZE_T(cInitialBuckets) + S_SIZE_T(SKIP_SPECIAL_SLOTS)); m_cEntries = 0; - m_cBuckets = cInitialBuckets; - m_pBuckets = (PTR_VolatileEntry*)(void*)GetHeap()->AllocMem(cbBuckets); + PTR_VolatileEntry* pBuckets = (PTR_VolatileEntry*)(void*)GetHeap()->AllocMem(cbBuckets); + ((size_t*)pBuckets)[SLOT_LENGTH] = cInitialBuckets; + + // publish after setting the length + VolatileStore(&m_pBuckets, pBuckets); // Note: Memory allocated on loader heap is zero filled } @@ -116,10 +121,6 @@ void DacEnumerableHashTable::BaseInsertEntry(DacEnumerableHa } CONTRACTL_END; - // We are always guaranteed at least one bucket (which is important here: some hash table sub-classes - // require entry insertion to be fault free). - _ASSERTE(m_cBuckets > 0); - // Recover the volatile entry pointer from the sub-class entry pointer passed to us. In debug builds // attempt to validate that this transform is really valid and the caller didn't attempt to allocate the // entry via some other means than BaseAllocateEntry(). @@ -129,23 +130,24 @@ void DacEnumerableHashTable::BaseInsertEntry(DacEnumerableHa // Remember the entry hash code. pVolatileEntry->m_iHashValue = iHash; - // Compute which bucket the entry belongs in based on the hash. - DWORD dwBucket = iHash % m_cBuckets; + DPTR(PTR_VolatileEntry) curBuckets = GetBuckets(); + DWORD cBuckets = GetLength(curBuckets); - // Prepare to link the new entry at the head of the bucket chain. - pVolatileEntry->m_pNextEntry = (GetBuckets())[dwBucket]; + // Compute which bucket the entry belongs in based on the hash. (+2 to skip "length" and "next" slots) + DWORD dwBucket = iHash % cBuckets + SKIP_SPECIAL_SLOTS; - // Make sure that all writes to the entry are visible before publishing the entry. - MemoryBarrier(); + // Prepare to link the new entry at the head of the bucket chain. + pVolatileEntry->m_pNextEntry = curBuckets[dwBucket]; // Publish the entry by pointing the bucket at it. - (GetBuckets())[dwBucket] = pVolatileEntry; + // Make sure that all writes to the entry are visible before publishing the entry. + VolatileStore(&curBuckets[dwBucket], pVolatileEntry); m_cEntries++; // If the insertion pushed the table load over our limit then attempt to grow the bucket list. Note that // we ignore any failure (this is a performance operation and is not required for correctness). - if (m_cEntries > (2 * m_cBuckets)) + if (m_cEntries > (2 * cBuckets)) GrowTable(); } @@ -167,55 +169,74 @@ void DacEnumerableHashTable::GrowTable() // error to our caller. FAULT_NOT_FATAL(); + DPTR(PTR_VolatileEntry) curBuckets = GetBuckets(); + DWORD cBuckets = GetLength(curBuckets); + // Make the new bucket table larger by the scale factor requested by the subclass (but also prime). - DWORD cNewBuckets = NextLargestPrime(m_cBuckets * SCALE_FACTOR); - S_SIZE_T cbNewBuckets = S_SIZE_T(cNewBuckets) * S_SIZE_T(sizeof(PTR_VolatileEntry)); + DWORD cNewBuckets = NextLargestPrime(cBuckets * SCALE_FACTOR); + // two extra slots - slot [0] contains the length of the table, + // slot [1] will contain the next version of the table if it resizes + S_SIZE_T cbNewBuckets = (S_SIZE_T(cNewBuckets) + S_SIZE_T(SKIP_SPECIAL_SLOTS)) * S_SIZE_T(sizeof(PTR_VolatileEntry)); + PTR_VolatileEntry *pNewBuckets = (PTR_VolatileEntry*)(void*)GetHeap()->AllocMem_NoThrow(cbNewBuckets); if (!pNewBuckets) return; + // element 0 stores the length of the table + ((size_t*)pNewBuckets)[SLOT_LENGTH] = cNewBuckets; + // element 1 stores the next version of the table (after length is written) + // NOTE: DAC does not call add/grow, so this cast is ok. + VolatileStore(&((PTR_VolatileEntry**)curBuckets)[SLOT_NEXT], pNewBuckets); + // All buckets are initially empty. // Note: Memory allocated on loader heap is zero filled // memset(pNewBuckets, 0, cNewBuckets * sizeof(PTR_VolatileEntry)); // Run through the old table and transfer all the entries. Be sure not to mess with the integrity of the - // old table while we are doing this, as there can be concurrent readers! Note that it is OK if the - // concurrent reader misses out on a match, though - they will have to acquire the lock on a miss & try - // again. - for (DWORD i = 0; i < m_cBuckets; i++) + // old table while we are doing this, as there can be concurrent readers! + // IMPORTANT: every entry must be reachable from the old bucket + // only after an entry appears in the correct bucket in the new table we can remove it from the old. + // it is ok to appear temporarily in a wrong bucket. + for (DWORD i = 0; i < cBuckets; i++) { - PTR_VolatileEntry pEntry = (GetBuckets())[i]; - - // Try to lock out readers from scanning this bucket. This is obviously a race which may fail. - // However, note that it's OK if somebody is already in the list - it's OK if we mess with the bucket - // groups, as long as we don't destroy anything. The lookup function will still do appropriate - // comparison even if it wanders aimlessly amongst entries while we are rearranging things. If a - // lookup finds a match under those circumstances, great. If not, they will have to acquire the lock & - // try again anyway. - (GetBuckets())[i] = NULL; + // +2 to skip "length" and "next" slots + DWORD dwCurBucket = i + SKIP_SPECIAL_SLOTS; + PTR_VolatileEntry pEntry = curBuckets[dwCurBucket]; while (pEntry != NULL) { - DWORD dwNewBucket = pEntry->m_iHashValue % cNewBuckets; + DWORD dwNewBucket = (pEntry->m_iHashValue % cNewBuckets) + SKIP_SPECIAL_SLOTS; PTR_VolatileEntry pNextEntry = pEntry->m_pNextEntry; - pEntry->m_pNextEntry = pNewBuckets[dwNewBucket]; - pNewBuckets[dwNewBucket] = pEntry; + PTR_VolatileEntry pTail = pNewBuckets[dwNewBucket]; + + // make the pEntry reachable in the new bucket, together with all the chain (that is temporary and ok) + if (pTail == NULL) + { + pNewBuckets[dwNewBucket] = pEntry; + } + else + { + while (pTail->m_pNextEntry) + { + pTail = pTail->m_pNextEntry; + } + + pTail->m_pNextEntry = pEntry; + } + + // skip pEntry in the old bucket after it appears in the new. + VolatileStore(&curBuckets[dwCurBucket], pNextEntry); + + // drop the rest of the bucket after old table starts referring to it + VolatileStore(&pEntry->m_pNextEntry, (PTR_VolatileEntry)NULL); pEntry = pNextEntry; } } // Make sure that all writes are visible before publishing the new array. - MemoryBarrier(); - m_pBuckets = pNewBuckets; - - // The new number of buckets has to be published last (prior to this readers may miscalculate a bucket - // index, but the result will always be in range and they'll simply walk the wrong chain and get a miss, - // prompting a retry under the lock). If we let the count become visible unordered wrt to the bucket array - // itself a reader could potentially read buckets from beyond the end of the old bucket list). - MemoryBarrier(); - m_cBuckets = cNewBuckets; + VolatileStore(&m_pBuckets, pNewBuckets); } // Returns the next prime larger (or equal to) than the number given. @@ -263,36 +284,63 @@ DPTR(VALUE) DacEnumerableHashTable::BaseFindFirstEntryByHash if (m_cEntries == 0) return NULL; - // Since there is at least one entry there must be at least one bucket. - _ASSERTE(m_cBuckets > 0); - - // Compute which bucket the entry belongs in based on the hash. - DWORD dwBucket = iHash % VolatileLoad(&m_cBuckets); + DPTR(PTR_VolatileEntry) curBuckets = GetBuckets(); + return BaseFindFirstEntryByHashCore(curBuckets, iHash, pContext); +} - // Point at the first entry in the bucket chain which would contain any entries with the given hash code. - PTR_VolatileEntry pEntry = (GetBuckets())[dwBucket]; +template +DPTR(VALUE) DacEnumerableHashTable::BaseFindFirstEntryByHashCore(DPTR(PTR_VolatileEntry) curBuckets, DacEnumerableHashValue iHash, LookupContext* pContext) +{ + CONTRACTL + { + NOTHROW; + GC_NOTRIGGER; + MODE_ANY; + SUPPORTS_DAC; + PRECONDITION(CheckPointer(pContext)); + } + CONTRACTL_END; - // Walk the bucket chain one entry at a time. - while (pEntry) + do { - if (pEntry->m_iHashValue == iHash) + DWORD cBuckets = GetLength(curBuckets); + + // Compute which bucket the entry belongs in based on the hash. + // +2 to skip "length" and "next" slots + DWORD dwBucket = iHash % cBuckets + SKIP_SPECIAL_SLOTS; + + // Point at the first entry in the bucket chain which would contain any entries with the given hash code. + PTR_VolatileEntry pEntry = curBuckets[dwBucket]; + + // Walk the bucket chain one entry at a time. + while (pEntry) { - // We've found our match. + if (pEntry->m_iHashValue == iHash) + { + // We've found our match. - // Record our current search state into the provided context so that a subsequent call to - // BaseFindNextEntryByHash can pick up the search where it left off. - pContext->m_pEntry = dac_cast(pEntry); + // Record our current search state into the provided context so that a subsequent call to + // BaseFindNextEntryByHash can pick up the search where it left off. + pContext->m_pEntry = dac_cast(pEntry); + pContext->m_curBuckets = curBuckets; - // Return the address of the sub-classes' embedded entry structure. - return VALUE_FROM_VOLATILE_ENTRY(pEntry); + // Return the address of the sub-classes' embedded entry structure. + return VALUE_FROM_VOLATILE_ENTRY(pEntry); + } + + // Move to the next entry in the chain. + pEntry = pEntry->m_pNextEntry; } - // Move to the next entry in the chain. - pEntry = pEntry->m_pNextEntry; - } + // in a rare case if resize is in progress, look in the new table as well. + // if existing entry is not in the old table, it must be in the new + // since we unlink it from old only after linking into the new. + // check for next table must hapen after we looked through the current. + VolatileLoadBarrier(); + curBuckets = GetNext(curBuckets); + } while (curBuckets != nullptr); // If we get here then none of the entries in the target bucket matched the hash code and we have a miss - // (for this section of the table at least). return NULL; } @@ -333,6 +381,16 @@ DPTR(VALUE) DacEnumerableHashTable::BaseFindNextEntryByHash( } } + // check for next table must hapen after we looked through the current. + VolatileLoadBarrier(); + + // in a case if resize is in progress, look in the new table as well. + DPTR(PTR_VolatileEntry) nextBuckets = GetNext(pContext->m_curBuckets); + if (nextBuckets != nullptr) + { + return BaseFindFirstEntryByHashCore(nextBuckets, iHash, pContext); + } + return NULL; } @@ -377,15 +435,19 @@ void DacEnumerableHashTable::EnumMemoryRegions(CLRDataEnumMe // sub-class). DacEnumMemoryRegion(dac_cast(this), sizeof(FINAL_CLASS)); + DPTR(PTR_VolatileEntry) curBuckets = GetBuckets(); + DWORD cBuckets = GetLength(curBuckets); + // Save the bucket list. - DacEnumMemoryRegion(dac_cast(GetBuckets()), m_cBuckets * sizeof(VolatileEntry*)); + DacEnumMemoryRegion(dac_cast(curBuckets), cBuckets * sizeof(VolatileEntry*)); // Save all the entries. if (GetBuckets().IsValid()) { - for (DWORD i = 0; i < m_cBuckets; i++) + for (DWORD i = 0; i < cBuckets; i++) { - PTR_VolatileEntry pEntry = (GetBuckets())[i]; + //+2 to skip "length" and "next" slots + PTR_VolatileEntry pEntry = curBuckets[i + SKIP_SPECIAL_SLOTS]; while (pEntry.IsValid()) { pEntry.EnumMem(); @@ -398,6 +460,9 @@ void DacEnumerableHashTable::EnumMemoryRegions(CLRDataEnumMe } } + // we should not be resizing while enumerating memory regions. + _ASSERTE(GetNext(curBuckets) == NULL); + // Save the module if present. if (GetModule().IsValid()) GetModule()->EnumMemoryRegions(flags, true); @@ -413,7 +478,8 @@ void DacEnumerableHashTable::BaseInitIterator(BaseIterator * pIterator->m_pTable = dac_cast)>(this); pIterator->m_pEntry = NULL; - pIterator->m_dwBucket = 0; + //+2 to skip "length" and "next" slots + pIterator->m_dwBucket = SKIP_SPECIAL_SLOTS; } // Returns a pointer to the next entry in the hash table or NULL once all entries have been enumerated. Once @@ -430,13 +496,16 @@ DPTR(VALUE) DacEnumerableHashTable::BaseIterator::Next() } CONTRACTL_END; - while (m_dwBucket < m_pTable->m_cBuckets) + DPTR(PTR_VolatileEntry) curBuckets = m_pTable->GetBuckets(); + DWORD cBuckets = GetLength(curBuckets); + + while (m_dwBucket < cBuckets) { if (m_pEntry == NULL) { // This is our first lookup for a particular bucket, return the first // entry in that bucket. - m_pEntry = dac_cast((m_pTable->GetBuckets())[m_dwBucket]); + m_pEntry = dac_cast(curBuckets[m_dwBucket]); } else { @@ -453,5 +522,9 @@ DPTR(VALUE) DacEnumerableHashTable::BaseIterator::Next() // buckets left to scan go back around again. m_dwBucket++; } + + // we should not be resizing while iterating. + _ASSERTE(GetNext(curBuckets) == NULL); + return NULL; } diff --git a/src/coreclr/vm/debugdebugger.cpp b/src/coreclr/vm/debugdebugger.cpp index fa55f3ed2c2c78..2ade537044abbe 100644 --- a/src/coreclr/vm/debugdebugger.cpp +++ b/src/coreclr/vm/debugdebugger.cpp @@ -297,7 +297,6 @@ FCIMPL0(FC_BOOL_RET, DebugDebugger::IsLogging) } FCIMPLEND - FCIMPL4(void, DebugStackTrace::GetStackFramesInternal, StackFrameHelper* pStackFrameHelperUNSAFE, INT32 iSkip, @@ -778,6 +777,28 @@ FCIMPL4(void, DebugStackTrace::GetStackFramesInternal, } FCIMPLEND +extern MethodDesc* QCALLTYPE StackFrame_GetMethodDescFromNativeIP(LPVOID ip) +{ + QCALL_CONTRACT; + + MethodDesc* pResult = nullptr; + + BEGIN_QCALL; + + // TODO: There is a race for dynamic and collectible methods here between getting + // the MethodDesc here and when the managed wrapper converts it into a MethodBase + // where the method could be collected. + EECodeInfo codeInfo((PCODE)ip); + if (codeInfo.IsValid()) + { + pResult = codeInfo.GetMethodDesc(); + } + + END_QCALL; + + return pResult; +} + FORCEINLINE void HolderDestroyStrongHandle(OBJECTHANDLE h) { if (h != NULL) DestroyStrongHandle(h); } typedef Wrapper, HolderDestroyStrongHandle, NULL> StrongHandleHolder; diff --git a/src/coreclr/vm/debugdebugger.h b/src/coreclr/vm/debugdebugger.h index 3c9fd17cc43570..b559531524336d 100644 --- a/src/coreclr/vm/debugdebugger.h +++ b/src/coreclr/vm/debugdebugger.h @@ -171,4 +171,6 @@ class DebugStackTrace }; +extern "C" MethodDesc* QCALLTYPE StackFrame_GetMethodDescFromNativeIP(LPVOID ip); + #endif // __DEBUG_DEBUGGER_h__ diff --git a/src/coreclr/vm/dispatchinfo.cpp b/src/coreclr/vm/dispatchinfo.cpp index e3c88987614c68..3b231c3882baa2 100644 --- a/src/coreclr/vm/dispatchinfo.cpp +++ b/src/coreclr/vm/dispatchinfo.cpp @@ -1756,7 +1756,7 @@ void DispatchInfo::InvokeMemberWorker(DispatchMemberInfo* pDispMemberInfo, if (!pDispMemberInfo) { WCHAR strTmp[64]; - _snwprintf_s(strTmp, NumItems(strTmp), _TRUNCATE, DISPID_NAME_FORMAT_STRING, id); + _snwprintf_s(strTmp, ARRAY_SIZE(strTmp), _TRUNCATE, DISPID_NAME_FORMAT_STRING, id); pObjs->MemberName = (OBJECTREF)StringObject::NewString(strTmp); } else @@ -2489,7 +2489,7 @@ void DispatchInfo::SetUpNamedParamArray(DispatchMemberInfo *pMemberInfo, DISPID { WCHAR wszTmp[64]; - _snwprintf_s(wszTmp, NumItems(wszTmp), _TRUNCATE, DISPID_NAME_FORMAT_STRING, pSrcArgNames[iSrcArg]); + _snwprintf_s(wszTmp, ARRAY_SIZE(wszTmp), _TRUNCATE, DISPID_NAME_FORMAT_STRING, pSrcArgNames[iSrcArg]); STRINGREF strTmp = StringObject::NewString(wszTmp); (*pNamedParamArray)->SetAt(iDestArg, (OBJECTREF)strTmp); } diff --git a/src/coreclr/vm/dllimport.cpp b/src/coreclr/vm/dllimport.cpp index 675b1d289d8ae1..7888c8e377f4bc 100644 --- a/src/coreclr/vm/dllimport.cpp +++ b/src/coreclr/vm/dllimport.cpp @@ -2686,7 +2686,7 @@ PInvokeStaticSigInfo::PInvokeStaticSigInfo(_In_ MethodDesc* pMD) namedArgs[MDA_ThrowOnUnmappableChar].InitBoolField("ThrowOnUnmappableChar", (ULONG)GetThrowOnUnmappableChar()); namedArgs[MDA_SetLastError].InitBoolField("SetLastError", 0); - IfFailGo(ParseKnownCaNamedArgs(ca, namedArgs, lengthof(namedArgs))); + IfFailGo(ParseKnownCaNamedArgs(ca, namedArgs, ARRAY_SIZE(namedArgs))); CorNativeLinkType nlt; IfFailGo(RemapLinkType((CorNativeLinkType)namedArgs[MDA_CharSet].val.u4, &nlt)); diff --git a/src/coreclr/vm/domainfile.cpp b/src/coreclr/vm/domainfile.cpp index ca9ea6565d3f7d..6fae1b0e3375f2 100644 --- a/src/coreclr/vm/domainfile.cpp +++ b/src/coreclr/vm/domainfile.cpp @@ -723,7 +723,7 @@ DomainAssembly::~DomainAssembly() if (m_fHostAssemblyPublished) { // Remove association first. - GetAppDomain()->UnPublishHostedAssembly(this); + UnregisterFromHostAssembly(); } ModuleIterator i = IterateModules(kModIterIncludeLoading); @@ -853,10 +853,42 @@ void DomainAssembly::Begin() m_pDomain->AddAssembly(this); } // Make it possible to find this DomainAssembly object from associated BINDER_SPACE::Assembly. - GetAppDomain()->PublishHostedAssembly(this); + RegisterWithHostAssembly(); m_fHostAssemblyPublished = true; } +void DomainAssembly::RegisterWithHostAssembly() +{ + CONTRACTL + { + NOTHROW; + GC_NOTRIGGER; + MODE_ANY; + } + CONTRACTL_END + + if (GetPEAssembly()->HasHostAssembly()) + { + GetPEAssembly()->GetHostAssembly()->SetDomainAssembly(this); + } +} + +void DomainAssembly::UnregisterFromHostAssembly() +{ + CONTRACTL + { + NOTHROW; + GC_NOTRIGGER; + MODE_ANY; + } + CONTRACTL_END + + if (GetPEAssembly()->HasHostAssembly()) + { + GetPEAssembly()->GetHostAssembly()->SetDomainAssembly(nullptr); + } +} + void DomainAssembly::Allocate() { CONTRACTL diff --git a/src/coreclr/vm/domainfile.h b/src/coreclr/vm/domainfile.h index 49a8344b21e846..917af193ceadea 100644 --- a/src/coreclr/vm/domainfile.h +++ b/src/coreclr/vm/domainfile.h @@ -587,6 +587,8 @@ class DomainAssembly : public DomainFile void Allocate(); void DeliverSyncEvents(); void DeliverAsyncEvents(); + void RegisterWithHostAssembly(); + void UnregisterFromHostAssembly(); #endif public: diff --git a/src/coreclr/vm/dwbucketmanager.hpp b/src/coreclr/vm/dwbucketmanager.hpp index 21267b8f360701..9731b2081c92d6 100644 --- a/src/coreclr/vm/dwbucketmanager.hpp +++ b/src/coreclr/vm/dwbucketmanager.hpp @@ -195,11 +195,11 @@ WCHAR BytesToBase32::GetNextChar() unsigned int result = 0; _ASSERTE(pData <= pEnd); - _ASSERTE(nWhich >= 0 && nWhich < lengthof(decoder)); + _ASSERTE(nWhich >= 0 && nWhich < ARRAY_SIZE(decoder)); // If out of data, return signal value, > any valid char. if (pData == pEnd) - return base32[lengthof(base32)-1]; + return base32[STRING_LENGTH(base32)]; #if defined(_DEBUG) if (decoder[nWhich].l1) @@ -243,11 +243,11 @@ WCHAR BytesToBase32::GetNextChar() } // Advance the 'state machine' -- which 5-bits from an 8-byte block. - if (++nWhich == lengthof(decoder)) + if (++nWhich == ARRAY_SIZE(decoder)) nWhich = 0; // Sanity check on value. - _ASSERTE(result < lengthof(base32)); + _ASSERTE(result < ARRAY_SIZE(base32)); return base32[result]; } // WCHAR BytesToBase32::GetNextChar() @@ -490,7 +490,7 @@ void BaseBucketParamsManager::GetAppVersion(__out_ecount(maxLength) WCHAR* targe W("%d.%d.%d.%d"), major, minor, build, revision); } - else if (DwGetAssemblyVersion(appPath, verBuf, NumItems(verBuf)) != 0) + else if (DwGetAssemblyVersion(appPath, verBuf, ARRAY_SIZE(verBuf)) != 0) { wcscpy_s(targetParam, maxLength, verBuf); } diff --git a/src/coreclr/vm/dwreport.cpp b/src/coreclr/vm/dwreport.cpp index e42fbf752d6cf3..228e1d029cd5ea 100644 --- a/src/coreclr/vm/dwreport.cpp +++ b/src/coreclr/vm/dwreport.cpp @@ -297,7 +297,7 @@ int DwGetAppDescription( // Number of characters written. // Build the query key for the language-specific file description resource. WCHAR buf[64]; //----+----1----+----2----+----3----+----4----+ - _snwprintf_s(buf, NumItems(buf), _TRUNCATE, W("\\StringFileInfo\\%04x%04x\\FileDescription"), + _snwprintf_s(buf, ARRAY_SIZE(buf), _TRUNCATE, W("\\StringFileInfo\\%04x%04x\\FileDescription"), translation->language, translation->codePage); // Get the file description. @@ -429,7 +429,7 @@ int DwGetAssemblyVersion( // Number of characters written. // Build the query key for the language-specific assembly version resource. WCHAR buf[64]; //----+----1----+----2----+----3----+----4----+ - _snwprintf_s(buf, NumItems(buf), _TRUNCATE, W("\\StringFileInfo\\%04x%04x\\Assembly Version"), + _snwprintf_s(buf, ARRAY_SIZE(buf), _TRUNCATE, W("\\StringFileInfo\\%04x%04x\\Assembly Version"), translation->language, translation->codePage); // Get the assembly version. diff --git a/src/coreclr/vm/ecalllist.h b/src/coreclr/vm/ecalllist.h index e02bad38f9430f..afdbf678d1183c 100644 --- a/src/coreclr/vm/ecalllist.h +++ b/src/coreclr/vm/ecalllist.h @@ -625,7 +625,8 @@ FCFuncEnd() FCFuncStart(gRuntimeHelpers) FCFuncElement("GetObjectValue", ObjectNative::GetObjectValue) - FCIntrinsic("InitializeArray", ArrayNative::InitializeArray, CORINFO_INTRINSIC_InitializeArray) + FCFuncElement("InitializeArray", ArrayNative::InitializeArray) + FCFuncElement("GetSpanDataFrom", ArrayNative::GetSpanDataFrom) FCFuncElement("PrepareDelegate", ReflectionInvocation::PrepareDelegate) FCFuncElement("GetHashCode", ObjectNative::GetHashCode) FCFuncElement("Equals", ObjectNative::Equals) diff --git a/src/coreclr/vm/eedbginterfaceimpl.cpp b/src/coreclr/vm/eedbginterfaceimpl.cpp index ba48f89faf13b4..5d2edfb2c02929 100644 --- a/src/coreclr/vm/eedbginterfaceimpl.cpp +++ b/src/coreclr/vm/eedbginterfaceimpl.cpp @@ -1442,7 +1442,7 @@ void EEDbgInterfaceImpl::SetAllDebugState(Thread *et, } // This is pretty much copied from VM\COMSynchronizable's -// INT32 __stdcall ThreadNative::GetThreadState, so propogate changes +// INT32 __stdcall ThreadNative::GetThreadState, so propagate changes // to both functions // This just gets the user state from the EE's perspective (hence "partial"). CorDebugUserState EEDbgInterfaceImpl::GetPartialUserState(Thread *pThread) diff --git a/src/coreclr/vm/eedbginterfaceimpl.h b/src/coreclr/vm/eedbginterfaceimpl.h index 72594c336794c9..f97c115ff6a95d 100644 --- a/src/coreclr/vm/eedbginterfaceimpl.h +++ b/src/coreclr/vm/eedbginterfaceimpl.h @@ -301,7 +301,7 @@ class EEDbgInterfaceImpl : public EEDebugInterface CorDebugThreadState state); // This is pretty much copied from VM\COMSynchronizable's - // INT32 __stdcall ThreadNative::GetThreadState, so propogate changes + // INT32 __stdcall ThreadNative::GetThreadState, so propagate changes // to both functions CorDebugUserState GetPartialUserState( Thread *pThread ); diff --git a/src/coreclr/vm/eetwain.cpp b/src/coreclr/vm/eetwain.cpp index 228596e26662bd..c2fef85d92b554 100644 --- a/src/coreclr/vm/eetwain.cpp +++ b/src/coreclr/vm/eetwain.cpp @@ -3501,7 +3501,7 @@ void UnwindEspFrameEpilog( /* Increment "offset" in steps to see which callee-saved registers have already been popped */ - for (unsigned i = NumItems(CALLEE_SAVED_REGISTERS_MASK); i > 0; i--) + for (unsigned i = ARRAY_SIZE(CALLEE_SAVED_REGISTERS_MASK); i > 0; i--) { RegMask regMask = CALLEE_SAVED_REGISTERS_MASK[i - 1]; @@ -3625,7 +3625,7 @@ void UnwindEbpDoubleAlignFrameEpilog( } } - for (unsigned i = NumItems(CALLEE_SAVED_REGISTERS_MASK) - 1; i > 0; i--) + for (unsigned i = STRING_LENGTH(CALLEE_SAVED_REGISTERS_MASK); i > 0; i--) { RegMask regMask = CALLEE_SAVED_REGISTERS_MASK[i - 1]; _ASSERTE(regMask != RM_EBP); @@ -3750,7 +3750,7 @@ void UnwindEspFrameProlog( unsigned regsMask = RM_NONE; PTR_DWORD savedRegPtr = PTR_DWORD((TADDR)ESP); - for (unsigned i = 0; i < NumItems(CALLEE_SAVED_REGISTERS_MASK); i++) + for (unsigned i = 0; i < ARRAY_SIZE(CALLEE_SAVED_REGISTERS_MASK); i++) { RegMask regMask = CALLEE_SAVED_REGISTERS_MASK[i]; @@ -3857,7 +3857,7 @@ void UnwindEspFrame( const RegMask regsMask = info->savedRegMask; - for (unsigned i = NumItems(CALLEE_SAVED_REGISTERS_MASK); i > 0; i--) + for (unsigned i = ARRAY_SIZE(CALLEE_SAVED_REGISTERS_MASK); i > 0; i--) { RegMask regMask = CALLEE_SAVED_REGISTERS_MASK[i - 1]; @@ -3965,7 +3965,7 @@ void UnwindEbpDoubleAlignFrameProlog( /* Increment "offset" in steps to see which callee-saved registers have been pushed already */ - for (unsigned i = 0; i < NumItems(CALLEE_SAVED_REGISTERS_MASK) - 1; i++) + for (unsigned i = 0; i < STRING_LENGTH(CALLEE_SAVED_REGISTERS_MASK); i++) { RegMask regMask = CALLEE_SAVED_REGISTERS_MASK[i]; _ASSERTE(regMask != RM_EBP); @@ -4133,7 +4133,7 @@ bool UnwindEbpDoubleAlignFrame( if (info->doubleAlign && (curEBP & 0x04)) pSavedRegs--; - for (unsigned i = 0; i < NumItems(CALLEE_SAVED_REGISTERS_MASK) - 1; i++) + for (unsigned i = 0; i < STRING_LENGTH(CALLEE_SAVED_REGISTERS_MASK); i++) { RegMask regMask = CALLEE_SAVED_REGISTERS_MASK[i]; if ((info->savedRegMask & regMask) == 0) diff --git a/src/coreclr/vm/eventing/eventpipe/ep-rt-coreclr.h b/src/coreclr/vm/eventing/eventpipe/ep-rt-coreclr.h index 0544f3ce9ccb09..9744e84a89b691 100644 --- a/src/coreclr/vm/eventing/eventpipe/ep-rt-coreclr.h +++ b/src/coreclr/vm/eventing/eventpipe/ep-rt-coreclr.h @@ -14,9 +14,6 @@ #include "win32threadpool.h" #include "clrversion.h" -#undef EP_ARRAY_SIZE -#define EP_ARRAY_SIZE(expr) (sizeof(expr) / sizeof ((expr) [0])) - #undef EP_INFINITE_WAIT #define EP_INFINITE_WAIT INFINITE @@ -2670,7 +2667,7 @@ ep_rt_diagnostics_command_line_get (void) // The host initalizes the runtime in two phases, init and exec assembly. On non-Windows platforms the commandline returned by the runtime // is different during each phase. We suspend during init where the runtime has populated the commandline with a // mock value (the full path of the executing assembly) and the actual value isn't populated till the exec assembly phase. - // On Windows this does not apply as the value is retrieved directly from the OS any time it is requested. + // On Windows this does not apply as the value is retrieved directly from the OS any time it is requested. // As a result, we cannot actually cache this value. We need to return the _current_ value. // This function needs to handle freeing the string in order to make it consistent with Mono's version. // To that end, we'll "cache" it here so we free the previous string when we get it again. diff --git a/src/coreclr/vm/eventtrace.cpp b/src/coreclr/vm/eventtrace.cpp index c549018584d703..a9a33e50efc145 100644 --- a/src/coreclr/vm/eventtrace.cpp +++ b/src/coreclr/vm/eventtrace.cpp @@ -706,7 +706,7 @@ void ETW::GCLog::MovedReference( { // Moved references - _ASSERTE(pContext->cBulkMovedObjectRanges < _countof(pContext->rgGCBulkMovedObjectRanges)); + _ASSERTE(pContext->cBulkMovedObjectRanges < ARRAY_SIZE(pContext->rgGCBulkMovedObjectRanges)); EventStructGCBulkMovedObjectRangesValue * pValue = &pContext->rgGCBulkMovedObjectRanges[pContext->cBulkMovedObjectRanges]; pValue->OldRangeBase = pbMemBlockStart; @@ -715,7 +715,7 @@ void ETW::GCLog::MovedReference( pContext->cBulkMovedObjectRanges++; // If buffer is now full, empty it into ETW - if (pContext->cBulkMovedObjectRanges == _countof(pContext->rgGCBulkMovedObjectRanges)) + if (pContext->cBulkMovedObjectRanges == ARRAY_SIZE(pContext->rgGCBulkMovedObjectRanges)) { FireEtwGCBulkMovedObjectRanges( pContext->iCurBulkMovedObjectRanges, @@ -732,7 +732,7 @@ void ETW::GCLog::MovedReference( { // Surviving references - _ASSERTE(pContext->cBulkSurvivingObjectRanges < _countof(pContext->rgGCBulkSurvivingObjectRanges)); + _ASSERTE(pContext->cBulkSurvivingObjectRanges < ARRAY_SIZE(pContext->rgGCBulkSurvivingObjectRanges)); EventStructGCBulkSurvivingObjectRangesValue * pValue = &pContext->rgGCBulkSurvivingObjectRanges[pContext->cBulkSurvivingObjectRanges]; pValue->RangeBase = pbMemBlockStart; @@ -740,7 +740,7 @@ void ETW::GCLog::MovedReference( pContext->cBulkSurvivingObjectRanges++; // If buffer is now full, empty it into ETW - if (pContext->cBulkSurvivingObjectRanges == _countof(pContext->rgGCBulkSurvivingObjectRanges)) + if (pContext->cBulkSurvivingObjectRanges == ARRAY_SIZE(pContext->rgGCBulkSurvivingObjectRanges)) { FireEtwGCBulkSurvivingObjectRanges( pContext->iCurBulkSurvivingObjectRanges, @@ -1142,7 +1142,7 @@ void BulkComLogger::FlushRcw() EventDataDescCreate(&eventData[1], &instance, sizeof(const unsigned short)); EventDataDescCreate(&eventData[2], m_etwRcwData, sizeof(EventRCWEntry) * m_currRcw); - ULONG result = EventWrite(Microsoft_Windows_DotNETRuntimeHandle, &GCBulkRCW, _countof(eventData), eventData); + ULONG result = EventWrite(Microsoft_Windows_DotNETRuntimeHandle, &GCBulkRCW, ARRAY_SIZE(eventData), eventData); #else ULONG result = FireEtXplatGCBulkRCW(m_currRcw, instance, sizeof(EventRCWEntry) * m_currRcw, m_etwRcwData); #endif // !defined(HOST_UNIX) @@ -1233,7 +1233,7 @@ void BulkComLogger::FlushCcw() EventDataDescCreate(&eventData[1], &instance, sizeof(const unsigned short)); EventDataDescCreate(&eventData[2], m_etwCcwData, sizeof(EventCCWEntry) * m_currCcw); - ULONG result = EventWrite(Microsoft_Windows_DotNETRuntimeHandle, &GCBulkRootCCW, _countof(eventData), eventData); + ULONG result = EventWrite(Microsoft_Windows_DotNETRuntimeHandle, &GCBulkRootCCW, ARRAY_SIZE(eventData), eventData); #else ULONG result = FireEtXplatGCBulkRootCCW(m_currCcw, instance, sizeof(EventCCWEntry) * m_currCcw, m_etwCcwData); #endif //!defined(HOST_UNIX) @@ -1362,7 +1362,7 @@ void BulkComLogger::AddCcwHandle(Object **handle) while (curr->Next) curr = curr->Next; - if (curr->Count == _countof(curr->Handles)) + if (curr->Count == ARRAY_SIZE(curr->Handles)) { curr->Next = new CCWEnumerationEntry; curr = curr->Next; @@ -1438,7 +1438,7 @@ void BulkStaticsLogger::FireBulkStaticsEvent() EventDataDescCreate(&eventData[2], &instance, sizeof(const unsigned short) ); EventDataDescCreate(&eventData[3], m_buffer, m_used); - ULONG result = EventWrite(Microsoft_Windows_DotNETRuntimeHandle, &GCBulkRootStaticVar, _countof(eventData), eventData); + ULONG result = EventWrite(Microsoft_Windows_DotNETRuntimeHandle, &GCBulkRootStaticVar, ARRAY_SIZE(eventData), eventData); #else ULONG result = FireEtXplatGCBulkRootStaticVar(m_count, appDomain, instance, m_used, m_buffer); #endif //!defined(HOST_UNIX) @@ -1741,12 +1741,12 @@ int BulkTypeEventLogger::LogSingleType(TypeHandle th) CONTRACTL_END; // If there's no room for another type, flush what we've got - if (m_nBulkTypeValueCount == _countof(m_rgBulkTypeValues)) + if (m_nBulkTypeValueCount == ARRAY_SIZE(m_rgBulkTypeValues)) { FireBulkTypeEvent(); } - _ASSERTE(m_nBulkTypeValueCount < (int)_countof(m_rgBulkTypeValues)); + _ASSERTE(m_nBulkTypeValueCount < (int)ARRAY_SIZE(m_rgBulkTypeValues)); BulkTypeValue * pVal = &m_rgBulkTypeValues[m_nBulkTypeValueCount]; @@ -2259,7 +2259,7 @@ VOID ETW::GCLog::RootReference( if (fDependentHandle) { _ASSERTE(pContext->cGCBulkRootConditionalWeakTableElementEdges < - _countof(pContext->rgGCBulkRootConditionalWeakTableElementEdges)); + ARRAY_SIZE(pContext->rgGCBulkRootConditionalWeakTableElementEdges)); EventStructGCBulkRootConditionalWeakTableElementEdgeValue * pRCWTEEdgeValue = &pContext->rgGCBulkRootConditionalWeakTableElementEdges[pContext->cGCBulkRootConditionalWeakTableElementEdges]; pRCWTEEdgeValue->GCKeyNodeID = pRootedNode; @@ -2269,7 +2269,7 @@ VOID ETW::GCLog::RootReference( // If RCWTE edge buffer is now full, empty it into ETW if (pContext->cGCBulkRootConditionalWeakTableElementEdges == - _countof(pContext->rgGCBulkRootConditionalWeakTableElementEdges)) + ARRAY_SIZE(pContext->rgGCBulkRootConditionalWeakTableElementEdges)) { FireEtwGCBulkRootConditionalWeakTableElementEdge( pContext->iCurBulkRootConditionalWeakTableElementEdge, @@ -2284,7 +2284,7 @@ VOID ETW::GCLog::RootReference( } else { - _ASSERTE(pContext->cGcBulkRootEdges < _countof(pContext->rgGcBulkRootEdges)); + _ASSERTE(pContext->cGcBulkRootEdges < ARRAY_SIZE(pContext->rgGcBulkRootEdges)); EventStructGCBulkRootEdgeValue * pBulkRootEdgeValue = &pContext->rgGcBulkRootEdges[pContext->cGcBulkRootEdges]; pBulkRootEdgeValue->RootedNodeAddress = pRootedNode; pBulkRootEdgeValue->GCRootKind = nRootKind; @@ -2293,7 +2293,7 @@ VOID ETW::GCLog::RootReference( pContext->cGcBulkRootEdges++; // If root edge buffer is now full, empty it into ETW - if (pContext->cGcBulkRootEdges == _countof(pContext->rgGcBulkRootEdges)) + if (pContext->cGcBulkRootEdges == ARRAY_SIZE(pContext->rgGcBulkRootEdges)) { FireEtwGCBulkRootEdge( pContext->iCurBulkRootEdge, @@ -2351,7 +2351,7 @@ VOID ETW::GCLog::ObjectReference( //--------------------------------------------------------------------------------------- // Add Node (pObjReferenceSource) to buffer - _ASSERTE(pContext->cGcBulkNodeValues < _countof(pContext->rgGcBulkNodeValues)); + _ASSERTE(pContext->cGcBulkNodeValues < ARRAY_SIZE(pContext->rgGcBulkNodeValues)); EventStructGCBulkNodeValue * pBulkNodeValue = &pContext->rgGcBulkNodeValues[pContext->cGcBulkNodeValues]; pBulkNodeValue->Address = pObjReferenceSource; pBulkNodeValue->Size = pObjReferenceSource->GetSize(); @@ -2360,7 +2360,7 @@ VOID ETW::GCLog::ObjectReference( pContext->cGcBulkNodeValues++; // If Node buffer is now full, empty it into ETW - if (pContext->cGcBulkNodeValues == _countof(pContext->rgGcBulkNodeValues)) + if (pContext->cGcBulkNodeValues == ARRAY_SIZE(pContext->rgGcBulkNodeValues)) { FireEtwGCBulkNode( pContext->iCurBulkNodeEvent, @@ -2402,7 +2402,7 @@ VOID ETW::GCLog::ObjectReference( for (ULONGLONG i=0; i < cRefs; i++) { - _ASSERTE(pContext->cGcBulkEdgeValues < _countof(pContext->rgGcBulkEdgeValues)); + _ASSERTE(pContext->cGcBulkEdgeValues < ARRAY_SIZE(pContext->rgGcBulkEdgeValues)); EventStructGCBulkEdgeValue * pBulkEdgeValue = &pContext->rgGcBulkEdgeValues[pContext->cGcBulkEdgeValues]; pBulkEdgeValue->Value = rgObjReferenceTargets[i]; // FUTURE: ReferencingFieldID @@ -2410,7 +2410,7 @@ VOID ETW::GCLog::ObjectReference( pContext->cGcBulkEdgeValues++; // If Edge buffer is now full, empty it into ETW - if (pContext->cGcBulkEdgeValues == _countof(pContext->rgGcBulkEdgeValues)) + if (pContext->cGcBulkEdgeValues == ARRAY_SIZE(pContext->rgGcBulkEdgeValues)) { FireEtwGCBulkEdge( pContext->iCurBulkEdgeEvent, diff --git a/src/coreclr/vm/eventtracepriv.h b/src/coreclr/vm/eventtracepriv.h index 2d3f09580f580a..54fdd43a176c3a 100644 --- a/src/coreclr/vm/eventtracepriv.h +++ b/src/coreclr/vm/eventtracepriv.h @@ -18,10 +18,6 @@ #ifndef __EVENTTRACEPRIV_H__ #define __EVENTTRACEPRIV_H__ -#ifndef _countof -#define _countof(_array) (sizeof(_array)/sizeof(_array[0])) -#endif - // ETW has a limitation of 64K for TOTAL event Size, however there is overhead associated with // the event headers. It is unclear exactly how much that is, but 1K should be sufficiently // far away to avoid problems without sacrificing the perf of bulk processing. diff --git a/src/coreclr/vm/gdbjit.cpp b/src/coreclr/vm/gdbjit.cpp index 1f358eb2d68b41..3f20e5c49a9b0e 100644 --- a/src/coreclr/vm/gdbjit.cpp +++ b/src/coreclr/vm/gdbjit.cpp @@ -1245,7 +1245,7 @@ void FunctionMember::MangleName(char *buf, int &buf_offset, const char *name) int name_length = strlen(name); char tmp[20]; - int tmp_len = sprintf_s(tmp, _countof(tmp), "%i", name_length); + int tmp_len = sprintf_s(tmp, ARRAY_SIZE(tmp), "%i", name_length); if (tmp_len <= 0) return; @@ -2901,7 +2901,7 @@ bool NotifyGdb::EmitDebugInfo(Elf_Builder &elfBuilder, MethodDesc* methodDescPtr { char name[256]; - sprintf_s(name, _countof(name), ".thunk_%i", i); + sprintf_s(name, ARRAY_SIZE(name), ".thunk_%i", i); Elf_SectionTracker *thunk = elfBuilder.OpenSection(name, SHT_PROGBITS, SHF_ALLOC | SHF_EXECINSTR); thunk->DisableHeaderUpdate(); diff --git a/src/coreclr/vm/gdbjit.h b/src/coreclr/vm/gdbjit.h index 355e5ee831c5f0..95f7abe79eeac2 100644 --- a/src/coreclr/vm/gdbjit.h +++ b/src/coreclr/vm/gdbjit.h @@ -387,7 +387,7 @@ class NotifyGdb static count_t Hash(key_t k) { LIMITED_METHOD_CONTRACT; - return k->ComputeHash(); + return HashTypeKey(k); } static const element_t Null() { LIMITED_METHOD_CONTRACT; return element_t(key_t(),VALUE()); } diff --git a/src/coreclr/vm/genmeth.cpp b/src/coreclr/vm/genmeth.cpp index e9f3452439b313..f847fbbd0d5d6c 100644 --- a/src/coreclr/vm/genmeth.cpp +++ b/src/coreclr/vm/genmeth.cpp @@ -1418,9 +1418,6 @@ void InstantiatedMethodDesc::SetupGenericMethodDefinition(IMDInternalImport *pIM { // Protect multi-threaded access to Module.m_GenericParamToDescMap. Other threads may be loading the same type // to break type recursion dead-locks - - // m_AvailableTypesLock has to be taken in cooperative mode to avoid deadlocks during GC - GCX_COOP(); CrstHolder ch(&pModule->GetClassLoader()->m_AvailableTypesLock); for (unsigned int i = 0; i < numTyPars; i++) diff --git a/src/coreclr/vm/hosting.cpp b/src/coreclr/vm/hosting.cpp index 66896fe79268aa..3379d2385bea0d 100644 --- a/src/coreclr/vm/hosting.cpp +++ b/src/coreclr/vm/hosting.cpp @@ -2,17 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. // - #include "common.h" #include "mscoree.h" #include "corhost.h" #include "threads.h" - -#define countof(x) (sizeof(x) / sizeof(x[0])) - - #undef VirtualAlloc LPVOID ClrVirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) { CONTRACTL diff --git a/src/coreclr/vm/i386/stublinkerx86.cpp b/src/coreclr/vm/i386/stublinkerx86.cpp index 8c8695b0245446..685883dd1ae808 100644 --- a/src/coreclr/vm/i386/stublinkerx86.cpp +++ b/src/coreclr/vm/i386/stublinkerx86.cpp @@ -1765,7 +1765,7 @@ VOID StubLinkerCPU::X64EmitMovqWorker(BYTE opcode, X86Reg Xmmreg, X86Reg reg) BYTE modrm = static_cast((Xmmreg << 3) | reg); codeBuffer[nBytes++] = 0xC0|modrm; - _ASSERTE(nBytes <= _countof(codeBuffer)); + _ASSERTE(nBytes <= ARRAY_SIZE(codeBuffer)); // Lastly, emit the encoded bytes EmitBytes(codeBuffer, nBytes); @@ -1836,7 +1836,7 @@ VOID StubLinkerCPU::X64EmitMovXmmWorker(BYTE prefix, BYTE opcode, X86Reg Xmmreg, nBytes += 4; } - _ASSERTE(nBytes <= _countof(codeBuffer)); + _ASSERTE(nBytes <= ARRAY_SIZE(codeBuffer)); // Lastly, emit the encoded bytes EmitBytes(codeBuffer, nBytes); diff --git a/src/coreclr/vm/ilmarshalers.h b/src/coreclr/vm/ilmarshalers.h index ba07cd5b55c175..8d24d07500472d 100644 --- a/src/coreclr/vm/ilmarshalers.h +++ b/src/coreclr/vm/ilmarshalers.h @@ -988,11 +988,19 @@ class ILMarshaler m_nativeHome.InitHome(ILStubMarshalHome::HomeType_ILByrefLocal, pcsSetup->NewLocal(nativeFieldTypeByRef), &nativeType, /* unalignedIndirectStore */ true); + // During the cleanup pass, the managed typed is explicitly passed as null - see DestroyStructure(). This works + // except if the type has nested non-blittable fields. Not checking for null will compute invalid offsets that + // can cause an access violation during the field clean-up. + ILCodeLabel *pSkipComputeOffsetLabel = pcsSetup->NewCodeLabel(); + pcsSetup->EmitNOP("// field setup {"); pcsSetup->EmitNOP("// managed field setup {"); pcsSetup->EmitLDARG(StructMarshalStubs::MANAGED_STRUCT_ARGIDX); + pcsSetup->EmitDUP(); + pcsSetup->EmitBRFALSE(pSkipComputeOffsetLabel); pcsSetup->EmitLDC(managedOffset); pcsSetup->EmitADD(); + pcsSetup->EmitLabel(pSkipComputeOffsetLabel); EmitStoreManagedHomeAddr(pcsSetup); pcsSetup->EmitNOP("// } managed field setup"); pcsSetup->EmitNOP("// native field setup {"); diff --git a/src/coreclr/vm/interoplibinterface.h b/src/coreclr/vm/interoplibinterface.h index ad5c3c05302b53..dd35bde6753603 100644 --- a/src/coreclr/vm/interoplibinterface.h +++ b/src/coreclr/vm/interoplibinterface.h @@ -34,7 +34,7 @@ class ComWrappersNative static void MarkWrapperAsComActivated(_In_ IUnknown* wrapperMaybe); public: // Unwrapping support - static IUnknown* GetIdentityForObject(_In_ OBJECTREF* objectPROTECTED, _In_ REFIID riid, _Out_ INT64* wrapperId); + static IUnknown* GetIdentityForObject(_In_ OBJECTREF* objectPROTECTED, _In_ REFIID riid, _Out_ INT64* wrapperId, _Out_ bool* isAggregated); static bool HasManagedObjectComWrapper(_In_ OBJECTREF object, _Out_ bool* isActive); public: // GC interaction diff --git a/src/coreclr/vm/interoplibinterface_comwrappers.cpp b/src/coreclr/vm/interoplibinterface_comwrappers.cpp index 5e73d97e4a7f83..fd9bdd16659483 100644 --- a/src/coreclr/vm/interoplibinterface_comwrappers.cpp +++ b/src/coreclr/vm/interoplibinterface_comwrappers.cpp @@ -53,6 +53,9 @@ namespace // The EOC is "detached" and no longer used to map between identity and a managed object. // This will only be set if the EOC was inserted into the cache. Flags_Detached = 8, + + // This EOC is an aggregated instance + Flags_Aggregated = 16 }; DWORD Flags; @@ -900,7 +903,11 @@ namespace : ExternalObjectContext::Flags_None) | (uniqueInstance ? ExternalObjectContext::Flags_None - : ExternalObjectContext::Flags_InCache); + : ExternalObjectContext::Flags_InCache) | + ((flags & CreateObjectFlags::CreateObjectFlags_Aggregated) != 0 + ? ExternalObjectContext::Flags_Aggregated + : ExternalObjectContext::Flags_None); + ExternalObjectContext::Construct( resultHolder.GetContext(), identity, @@ -1162,11 +1169,7 @@ namespace InteropLibImports bool isValid = false; ::OBJECTHANDLE objectHandle = static_cast<::OBJECTHANDLE>(handle); - { - // Switch to cooperative mode so the handle can be safely inspected. - GCX_COOP_THREAD_EXISTS(GET_THREAD()); - isValid = ObjectFromHandle(objectHandle) != NULL; - } + isValid = ObjectHandleIsNull(objectHandle) != FALSE; return isValid; } @@ -1774,7 +1777,7 @@ bool GlobalComWrappersForTrackerSupport::TryGetOrCreateObjectForComInstance( objRef); } -IUnknown* ComWrappersNative::GetIdentityForObject(_In_ OBJECTREF* objectPROTECTED, _In_ REFIID riid, _Out_ INT64* wrapperId) +IUnknown* ComWrappersNative::GetIdentityForObject(_In_ OBJECTREF* objectPROTECTED, _In_ REFIID riid, _Out_ INT64* wrapperId, _Out_ bool* isAggregated) { CONTRACTL { @@ -1807,6 +1810,7 @@ IUnknown* ComWrappersNative::GetIdentityForObject(_In_ OBJECTREF* objectPROTECTE { ExternalObjectContext* context = reinterpret_cast(contextMaybe); *wrapperId = context->WrapperId; + *isAggregated = context->IsSet(ExternalObjectContext::Flags_Aggregated); IUnknown* identity = reinterpret_cast(context->Identity); GCX_PREEMP(); diff --git a/src/coreclr/vm/interoplibinterface_objc.cpp b/src/coreclr/vm/interoplibinterface_objc.cpp index 115d8ac66fb2f5..1a28c1689d9c0b 100644 --- a/src/coreclr/vm/interoplibinterface_objc.cpp +++ b/src/coreclr/vm/interoplibinterface_objc.cpp @@ -131,7 +131,7 @@ namespace { // Is the function in libobjc and named appropriately. return ((strcmp(libraryName, ObjectiveCLibrary) == 0) - && (strncmp(entrypointName, OBJC_MSGSEND, _countof(OBJC_MSGSEND) -1) == 0)); + && (strncmp(entrypointName, OBJC_MSGSEND, STRING_LENGTH(OBJC_MSGSEND)) == 0)); } const void* STDMETHODCALLTYPE MessageSendPInvokeOverride(_In_z_ const char* libraryName, _In_z_ const char* entrypointName) @@ -139,7 +139,7 @@ namespace if (!IsObjectiveCMessageSendFunction(libraryName, entrypointName)) return nullptr; - for (int i = 0; i < _countof(MsgSendEntryPoints); ++i) + for (int i = 0; i < ARRAY_SIZE(MsgSendEntryPoints); ++i) { void* funcMaybe = s_msgSendOverrides[i]; if (funcMaybe != nullptr @@ -163,7 +163,7 @@ extern "C" BOOL QCALLTYPE ObjCMarshal_TrySetGlobalMessageSendCallback( BEGIN_QCALL; - _ASSERTE(msgSendFunction >= 0 && msgSendFunction < _countof(s_msgSendOverrides)); + _ASSERTE(msgSendFunction >= 0 && msgSendFunction < ARRAY_SIZE(s_msgSendOverrides)); success = FastInterlockCompareExchangePointer(&s_msgSendOverrides[msgSendFunction], fptr, NULL) == NULL; // Set P/Invoke override callback if we haven't already diff --git a/src/coreclr/vm/interoputil.cpp b/src/coreclr/vm/interoputil.cpp index f42d1627de86ce..610c3418ae530f 100644 --- a/src/coreclr/vm/interoputil.cpp +++ b/src/coreclr/vm/interoputil.cpp @@ -256,7 +256,7 @@ BOOL GetDefaultDllImportSearchPathsAttributeValue(Module *pModule, mdToken token CaArg args[1]; args[0].InitEnum(SERIALIZATION_TYPE_U4, (ULONG)0); - ParseKnownCaArgs(ca, args, lengthof(args)); + ParseKnownCaArgs(ca, args, ARRAY_SIZE(args)); *pDllImportSearchPathFlags = args[0].val.u4; return TRUE; } @@ -287,7 +287,7 @@ int GetLCIDParameterIndex(MethodDesc *pMD) CustomAttributeParser caLCID(pVal, cbVal); CaArg args[1]; args[0].Init(SERIALIZATION_TYPE_I4, 0); - IfFailGo(ParseKnownCaArgs(caLCID, args, lengthof(args))); + IfFailGo(ParseKnownCaArgs(caLCID, args, ARRAY_SIZE(args))); iLCIDParam = args[0].val.i4; } @@ -1711,7 +1711,7 @@ void SafeReleaseStream(IStream *pStream) #ifdef _DEBUG WCHAR logStr[200]; - swprintf_s(logStr, NumItems(logStr), W("Object gone: CoReleaseMarshalData returned %x, file %S, line %d\n"), hr, __FILE__, __LINE__); + swprintf_s(logStr, ARRAY_SIZE(logStr), W("Object gone: CoReleaseMarshalData returned %x, file %S, line %d\n"), hr, __FILE__, __LINE__); LogInterop(logStr); if (hr != S_OK) { @@ -1721,7 +1721,7 @@ void SafeReleaseStream(IStream *pStream) ULARGE_INTEGER li2; pStream->Seek(li, STREAM_SEEK_SET, &li2); hr = CoReleaseMarshalData(pStream); - swprintf_s(logStr, NumItems(logStr), W("Object gone: CoReleaseMarshalData returned %x, file %S, line %d\n"), hr, __FILE__, __LINE__); + swprintf_s(logStr, ARRAY_SIZE(logStr), W("Object gone: CoReleaseMarshalData returned %x, file %S, line %d\n"), hr, __FILE__, __LINE__); LogInterop(logStr); } #endif diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index 43c4fc17a597fe..94d7101094891e 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -3613,29 +3613,6 @@ uint32_t CEEInfo::getClassAttribs (CORINFO_CLASS_HANDLE clsHnd) return ret; } - -/*********************************************************************/ -bool CEEInfo::isStructRequiringStackAllocRetBuf(CORINFO_CLASS_HANDLE clsHnd) -{ - CONTRACTL { - THROWS; - GC_TRIGGERS; - MODE_PREEMPTIVE; - } CONTRACTL_END; - - bool ret = 0; - - JIT_TO_EE_TRANSITION_LEAF(); - - TypeHandle VMClsHnd(clsHnd); - MethodTable * pMT = VMClsHnd.GetMethodTable(); - ret = (pMT != NULL && pMT->IsStructRequiringStackAllocRetBuf()); - - EE_TO_JIT_TRANSITION_LEAF(); - - return ret; -} - /*********************************************************************/ uint32_t CEEInfo::getClassAttribsInternal (CORINFO_CLASS_HANDLE clsHnd) { @@ -3689,7 +3666,7 @@ uint32_t CEEInfo::getClassAttribsInternal (CORINFO_CLASS_HANDLE clsHnd) ret |= CORINFO_FLG_VALUECLASS; if (pMT->IsByRefLike()) - ret |= CORINFO_FLG_CONTAINS_STACK_PTR; + ret |= CORINFO_FLG_BYREF_LIKE; if ((pClass->IsNotTightlyPacked() && (!pClass->IsManagedSequential() || pClass->HasExplicitSize())) || pMT == g_TypedReferenceMT || @@ -6966,7 +6943,7 @@ bool getILIntrinsicImplementationForVolatile(MethodDesc * ftn, }; mdMethodDef md = ftn->GetMemberDef(); - for (unsigned i = 0; i < NumItems(volatileImpls); i++) + for (unsigned i = 0; i < ARRAY_SIZE(volatileImpls); i++) { if (md == CoreLibBinder::GetMethod(volatileImpls[i].methodId)->GetMemberDef()) { @@ -7215,7 +7192,7 @@ bool getILIntrinsicImplementationForRuntimeHelpers(MethodDesc * ftn, int tokCompareTo = pCompareToMD->GetMemberDef(); unsigned int index = (et - ELEMENT_TYPE_I1); - _ASSERTE(index < _countof(ilcode)); + _ASSERTE(index < ARRAY_SIZE(ilcode)); ilcode[index][0] = CEE_LDARGA_S; ilcode[index][1] = 0; @@ -8082,7 +8059,7 @@ void CEEInfo::reportTailCallDecision (CORINFO_METHOD_HANDLE callerHnd, static const char * const tailCallType[] = { "optimized tail call", "recursive loop", "helper assisted tailcall" }; - _ASSERTE(tailCallResult >= 0 && (size_t)tailCallResult < _countof(tailCallType)); + _ASSERTE(tailCallResult >= 0 && (size_t)tailCallResult < ARRAY_SIZE(tailCallType)); LOG((LF_JIT, LL_INFO100000, "While compiling '%S', %Splicit tail call from '%S' to '%S' generated as a %s.\n", currentMethodName.GetUnicode(), fIsTailPrefix ? W("ex") : W("im"), @@ -11415,18 +11392,18 @@ void CEEJitInfo::recordRelocation(void * location, // where the jitted code will end up at. Instead we try to keep executable code // and static fields in a preferred memory region and base the decision on this // region. -// +// // If we guess wrong we will recover in recordRelocation if we notice that we // cannot actually use the kind of reloc: in that case we will rejit the // function and turn off the use of those relocs in the future. This scheme // works based on two assumptions: -// +// // 1) The JIT will ask about relocs only for memory that was allocated by the -// loader heap in the preferred region. +// loader heap in the preferred region. // 2) The loader heap allocates memory in the preferred region in a circular fashion; // the region itself might be larger than 2 GB, but the current compilation should // only be hitting the preferred region within 2 GB. -// +// // Under these assumptions we should only hit the "recovery" case once the // preferred range is actually full. WORD CEEJitInfo::getRelocTypeHint(void * target) @@ -12532,6 +12509,7 @@ CORJIT_FLAGS GetCompileFlags(MethodDesc * ftn, CORJIT_FLAGS flags, CORINFO_METHO // // * We're writing pgo data and we're jitting at Tier0. // * Tiered PGO is enabled and we're jitting at Tier0. + // * Tiered PGO is enabled and we are jitting an OSR method. // if ((CLRConfig::GetConfigValue(CLRConfig::INTERNAL_WritePGOData) > 0) && flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_TIER0)) @@ -12539,7 +12517,7 @@ CORJIT_FLAGS GetCompileFlags(MethodDesc * ftn, CORJIT_FLAGS flags, CORINFO_METHO flags.Set(CORJIT_FLAGS::CORJIT_FLAG_BBINSTR); } else if ((CLRConfig::GetConfigValue(CLRConfig::INTERNAL_TieredPGO) > 0) - && flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_TIER0)) + && (flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_TIER0) || flags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_OSR))) { flags.Set(CORJIT_FLAGS::CORJIT_FLAG_BBINSTR); } diff --git a/src/coreclr/vm/loaderallocator.hpp b/src/coreclr/vm/loaderallocator.hpp index f4e5587e24a316..0907d98e266d5b 100644 --- a/src/coreclr/vm/loaderallocator.hpp +++ b/src/coreclr/vm/loaderallocator.hpp @@ -349,7 +349,7 @@ class LoaderAllocator // 3. Native LoaderAllocator is alive, managed scout is collected. // - The native LoaderAllocator can be kept alive via native reference with code:AddRef call, e.g.: // * Reference from LCG method, - // * Reference recieved from assembly iterator code:AppDomain::AssemblyIterator::Next and/or + // * Reference received from assembly iterator code:AppDomain::AssemblyIterator::Next and/or // held by code:CollectibleAssemblyHolder. // - Other LoaderAllocator can have this LoaderAllocator in its reference list // (code:m_LoaderAllocatorReferences), but without call to code:AddRef. diff --git a/src/coreclr/vm/managedmdimport.cpp b/src/coreclr/vm/managedmdimport.cpp index ec2aef0cc03987..622e74edb994d1 100644 --- a/src/coreclr/vm/managedmdimport.cpp +++ b/src/coreclr/vm/managedmdimport.cpp @@ -155,7 +155,7 @@ static int * EnsureResultSize(MetadataEnumResult * pResult, ULONG length) int * p; - if (length >= NumItems(pResult->smallResult) || DbgRandomOnExe(.01)) + if (length >= ARRAY_SIZE(pResult->smallResult) || DbgRandomOnExe(.01)) { pResult->largeResult = (I4Array *)OBJECTREFToObject(AllocatePrimitiveArray(ELEMENT_TYPE_I4, length)); p = pResult->largeResult->GetDirectPointerToNonObjectElements(); diff --git a/src/coreclr/vm/methodtable.cpp b/src/coreclr/vm/methodtable.cpp index a685151f9838d0..1d63103cb36f1b 100644 --- a/src/coreclr/vm/methodtable.cpp +++ b/src/coreclr/vm/methodtable.cpp @@ -6002,20 +6002,6 @@ BOOL MethodTable::SanityCheck() return (pCanonMT == this) || IsArray(); } -//========================================================================================== - -// Structs containing GC pointers whose size is at most this are always stack-allocated. -const unsigned MaxStructBytesForLocalVarRetBuffBytes = 2 * sizeof(void*); // 4 pointer-widths. - -BOOL MethodTable::IsStructRequiringStackAllocRetBuf() -{ - LIMITED_METHOD_DAC_CONTRACT; - - // Disable this optimization. It has limited value (only kicks in on x86, and only for less common structs), - // causes bugs and introduces odd ABI differences not compatible with ReadyToRun. - return FALSE; -} - //========================================================================================== unsigned MethodTable::GetTypeDefRid() { diff --git a/src/coreclr/vm/methodtable.h b/src/coreclr/vm/methodtable.h index 1fa0d1be434523..a56c575636318d 100644 --- a/src/coreclr/vm/methodtable.h +++ b/src/coreclr/vm/methodtable.h @@ -2137,7 +2137,7 @@ class MethodTable // Resolve virtual static interface method pInterfaceMD on this type. // // Specify allowNullResult to return NULL instead of throwing if the there is no implementation - // Specify verifyImplemented to verify that there is a match, but do not actually return a final useable MethodDesc + // Specify verifyImplemented to verify that there is a match, but do not actually return a final usable MethodDesc // Specify allowVariantMatches to permit generic interface variance MethodDesc *ResolveVirtualStaticMethod(MethodTable* pInterfaceType, MethodDesc* pInterfaceMD, BOOL allowNullResult, BOOL verifyImplemented = FALSE, BOOL allowVariantMatches = TRUE); @@ -2511,14 +2511,6 @@ class MethodTable // Is this value type? Returns false for System.ValueType and System.Enum. inline BOOL IsValueType(); - // Returns "TRUE" iff "this" is a struct type such that return buffers used for returning a value - // of this type must be stack-allocated. This will generally be true only if the struct - // contains GC pointers, and does not exceed some size limit. Maintaining this as an invariant allows - // an optimization: the JIT may assume that return buffer pointers for return types for which this predicate - // returns TRUE are always stack allocated, and thus, that stores to the GC-pointer fields of such return - // buffers do not require GC write barriers. - BOOL IsStructRequiringStackAllocRetBuf(); - // Is this enum? Returns false for System.Enum. inline BOOL IsEnum(); diff --git a/src/coreclr/vm/methodtablebuilder.cpp b/src/coreclr/vm/methodtablebuilder.cpp index 90f451a1dfde14..d5feeae4425e24 100644 --- a/src/coreclr/vm/methodtablebuilder.cpp +++ b/src/coreclr/vm/methodtablebuilder.cpp @@ -1440,7 +1440,7 @@ MethodTableBuilder::BuildMethodTableThrowing( if (bmtGenerics->GetNumGenericArgs() != 0) { // Nested enums can have generic type parameters from their enclosing class. - // CLS rules require type parameters to be propogated to nested types. + // CLS rules require type parameters to be propagated to nested types. // Note that class G { enum E { } } will produce "G`1+E". // We want to disallow class G { enum E { } } // Perhaps the IL equivalent of class G { enum E { } } should be legal. @@ -11771,9 +11771,6 @@ MethodTableBuilder::GatherGenericsInfo( { // Protect multi-threaded access to Module.m_GenericParamToDescMap. Other threads may be loading the same type // to break type recursion dead-locks - - // m_AvailableTypesLock has to be taken in cooperative mode to avoid deadlocks during GC - GCX_COOP(); CrstHolder ch(&pModule->GetClassLoader()->m_AvailableTypesLock); for (unsigned int i = 0; i < numGenericArgs; i++) diff --git a/src/coreclr/vm/mlinfo.cpp b/src/coreclr/vm/mlinfo.cpp index bb3aaf700eae4b..69cba82dcf6f41 100644 --- a/src/coreclr/vm/mlinfo.cpp +++ b/src/coreclr/vm/mlinfo.cpp @@ -6,7 +6,6 @@ // - #include "common.h" #include "mlinfo.h" #include "dllimport.h" @@ -26,18 +25,12 @@ #include "dispparammarshaler.h" #endif // FEATURE_COMINTEROP - -#ifndef lengthof - #define lengthof(rg) (sizeof(rg)/sizeof(rg[0])) -#endif - - #ifdef FEATURE_COMINTEROP DEFINE_ASM_QUAL_TYPE_NAME(ENUMERATOR_TO_ENUM_VARIANT_CM_NAME, g_EnumeratorToEnumClassName, g_CorelibAsmName); - static const int ENUMERATOR_TO_ENUM_VARIANT_CM_NAME_LEN = lengthof(ENUMERATOR_TO_ENUM_VARIANT_CM_NAME); + static const int ENUMERATOR_TO_ENUM_VARIANT_CM_NAME_LEN = ARRAY_SIZE(ENUMERATOR_TO_ENUM_VARIANT_CM_NAME); static const char ENUMERATOR_TO_ENUM_VARIANT_CM_COOKIE[] = {""}; - static const int ENUMERATOR_TO_ENUM_VARIANT_CM_COOKIE_LEN = lengthof(ENUMERATOR_TO_ENUM_VARIANT_CM_COOKIE); + static const int ENUMERATOR_TO_ENUM_VARIANT_CM_COOKIE_LEN = ARRAY_SIZE(ENUMERATOR_TO_ENUM_VARIANT_CM_COOKIE); DEFINE_ASM_QUAL_TYPE_NAME(COLOR_TRANSLATOR_ASM_QUAL_TYPE_NAME, g_ColorTranslatorClassName, g_DrawingAsmName); DEFINE_ASM_QUAL_TYPE_NAME(COLOR_ASM_QUAL_TYPE_NAME, g_ColorClassName, g_DrawingAsmName); diff --git a/src/coreclr/vm/multicorejit.cpp b/src/coreclr/vm/multicorejit.cpp index 656c7744066b02..2ad518bf9f7361 100644 --- a/src/coreclr/vm/multicorejit.cpp +++ b/src/coreclr/vm/multicorejit.cpp @@ -117,9 +117,9 @@ void _MulticoreJitTrace(const char * format, ...) int len; - len = sprintf_s(buffer, _countof(buffer), "Mcj TID %04x: ", GetCurrentThreadId()); - len += _vsnprintf_s(buffer + len, _countof(buffer) - len, format, args); - len += sprintf_s(buffer + len, _countof(buffer) - len, ", (time=%d ms)\r\n", GetTickCount() - s_startTick); + len = sprintf_s(buffer, ARRAY_SIZE(buffer), "Mcj TID %04x: ", GetCurrentThreadId()); + len += _vsnprintf_s(buffer + len, ARRAY_SIZE(buffer) - len, format, args); + len += sprintf_s(buffer + len, ARRAY_SIZE(buffer) - len, ", (time=%d ms)\r\n", GetTickCount() - s_startTick); OutputDebugStringA(buffer); #endif diff --git a/src/coreclr/vm/pendingload.cpp b/src/coreclr/vm/pendingload.cpp index 597a895b3317a4..1bc384befab56c 100644 --- a/src/coreclr/vm/pendingload.cpp +++ b/src/coreclr/vm/pendingload.cpp @@ -114,7 +114,7 @@ BOOL PendingTypeLoadTable::InsertValue(PendingTypeLoadEntry *pData) _ASSERTE(m_dwNumBuckets != 0); - DWORD dwHash = pData->GetTypeKey().ComputeHash(); + DWORD dwHash = HashTypeKey(&pData->GetTypeKey()); DWORD dwBucket = dwHash % m_dwNumBuckets; PendingTypeLoadTable::TableEntry * pNewEntry = AllocNewEntry(); if (pNewEntry == NULL) @@ -130,7 +130,6 @@ BOOL PendingTypeLoadTable::InsertValue(PendingTypeLoadEntry *pData) return TRUE; } - BOOL PendingTypeLoadTable::DeleteValue(TypeKey *pKey) { CONTRACTL @@ -145,7 +144,7 @@ BOOL PendingTypeLoadTable::DeleteValue(TypeKey *pKey) _ASSERTE(m_dwNumBuckets != 0); - DWORD dwHash = pKey->ComputeHash(); + DWORD dwHash = HashTypeKey(pKey); DWORD dwBucket = dwHash % m_dwNumBuckets; PendingTypeLoadTable::TableEntry * pSearch; PendingTypeLoadTable::TableEntry **ppPrev = &m_pBuckets[dwBucket]; @@ -182,7 +181,7 @@ PendingTypeLoadTable::TableEntry *PendingTypeLoadTable::FindItem(TypeKey *pKey) _ASSERTE(m_dwNumBuckets != 0); - DWORD dwHash = pKey->ComputeHash(); + DWORD dwHash = HashTypeKey(pKey); DWORD dwBucket = dwHash % m_dwNumBuckets; PendingTypeLoadTable::TableEntry * pSearch; diff --git a/src/coreclr/vm/pendingload.h b/src/coreclr/vm/pendingload.h index be8cf6c521b06f..2094d76f863309 100644 --- a/src/coreclr/vm/pendingload.h +++ b/src/coreclr/vm/pendingload.h @@ -166,7 +166,7 @@ class PendingTypeLoadEntry } #endif //DACCESS_COMPILE - TypeKey GetTypeKey() + TypeKey& GetTypeKey() { LIMITED_METHOD_CONTRACT; return m_typeKey; diff --git a/src/coreclr/vm/perfmap.cpp b/src/coreclr/vm/perfmap.cpp index 48f178aeb67c34..30708584c3f72e 100644 --- a/src/coreclr/vm/perfmap.cpp +++ b/src/coreclr/vm/perfmap.cpp @@ -247,7 +247,7 @@ void PerfMap::LogImage(PEAssembly * pPEAssembly) EX_TRY { WCHAR wszSignature[39]; - GetNativeImageSignature(pPEAssembly, wszSignature, lengthof(wszSignature)); + GetNativeImageSignature(pPEAssembly, wszSignature, ARRAY_SIZE(wszSignature)); m_PerfInfo->LogImage(pPEAssembly, wszSignature); } @@ -393,7 +393,7 @@ NativeImagePerfMap::NativeImagePerfMap(Assembly * pAssembly, BSTR pDestPath) // Get the native image signature (GUID). // Used to ensure that we match symbols to the correct NGEN image. WCHAR wszSignature[39]; - GetNativeImageSignature(pAssembly->GetManifestFile(), wszSignature, lengthof(wszSignature)); + GetNativeImageSignature(pAssembly->GetManifestFile(), wszSignature, ARRAY_SIZE(wszSignature)); // Build the path to the perfmap file, which consists of .ni..map. // Example: /tmp/System.Private.CoreLib.ni.{GUID}.map diff --git a/src/coreclr/vm/pgo.cpp b/src/coreclr/vm/pgo.cpp index 189487c34750b9..c3f37a3226b981 100644 --- a/src/coreclr/vm/pgo.cpp +++ b/src/coreclr/vm/pgo.cpp @@ -653,7 +653,7 @@ HRESULT PgoManager::allocPgoInstrumentationBySchemaInstance(MethodDesc* pMD, HeaderList *currentHeaderList = m_pgoHeaders; if (currentHeaderList != NULL) { - if (!ComparePgoSchemaEquals(currentHeaderList->header.GetData(), currentHeaderList->header.countsOffset, pSchema, countSchemaItems)) + if (!CheckIfPgoSchemaIsCompatibleAndSetOffsets(currentHeaderList->header.GetData(), currentHeaderList->header.countsOffset, pSchema, countSchemaItems)) { return E_NOTIMPL; } @@ -683,7 +683,7 @@ HRESULT PgoManager::allocPgoInstrumentationBySchemaInstance(MethodDesc* pMD, HeaderList* existingData = laPgoManagerThis->m_pgoDataLookup.Lookup(pMD); if (existingData != NULL) { - if (!ComparePgoSchemaEquals(existingData->header.GetData(), existingData->header.countsOffset, pSchema, countSchemaItems)) + if (!CheckIfPgoSchemaIsCompatibleAndSetOffsets(existingData->header.GetData(), existingData->header.countsOffset, pSchema, countSchemaItems)) { return E_NOTIMPL; } diff --git a/src/coreclr/vm/pinvokeoverride.cpp b/src/coreclr/vm/pinvokeoverride.cpp index a2f32310fb48d8..b24ad53842b86d 100644 --- a/src/coreclr/vm/pinvokeoverride.cpp +++ b/src/coreclr/vm/pinvokeoverride.cpp @@ -46,7 +46,7 @@ const void* PInvokeOverride::GetMethodImpl(const char* libraryName, const char* { if (s_hasOverrides) { - for (size_t i = 0; i < _countof(s_overrideImpls); ++i) + for (size_t i = 0; i < ARRAY_SIZE(s_overrideImpls); ++i) { PInvokeOverrideFn* overrideImpl = s_overrideImpls[i]; if (overrideImpl == nullptr) diff --git a/src/coreclr/vm/profilinghelper.inl b/src/coreclr/vm/profilinghelper.inl index f6426307600980..57544c493f7fa3 100644 --- a/src/coreclr/vm/profilinghelper.inl +++ b/src/coreclr/vm/profilinghelper.inl @@ -111,7 +111,7 @@ inline void ProfilingAPIUtility::LogNoInterfaceError(REFIID iidRequested, LPCWST CONTRACTL_END; WCHAR wszIidRequested[39]; - if (StringFromGUID2(iidRequested, wszIidRequested, lengthof(wszIidRequested)) == 0) + if (StringFromGUID2(iidRequested, wszIidRequested, ARRAY_SIZE(wszIidRequested)) == 0) { // This is a little super-paranoid; but just use an empty string if GUIDs // get bigger than we expect. @@ -183,7 +183,7 @@ inline HRESULT ProfilingAPIUtility::LoadProfilerForAttach( // Need string version of CLSID for event log messages WCHAR wszClsid[40]; - if (StringFromGUID2(*pClsid, wszClsid, _countof(wszClsid)) == 0) + if (StringFromGUID2(*pClsid, wszClsid, ARRAY_SIZE(wszClsid)) == 0) { _ASSERTE(!"StringFromGUID2 failed!"); return E_UNEXPECTED; diff --git a/src/coreclr/vm/proftoeeinterfaceimpl.cpp b/src/coreclr/vm/proftoeeinterfaceimpl.cpp index 5c47a34f70487a..2f742d05638a55 100644 --- a/src/coreclr/vm/proftoeeinterfaceimpl.cpp +++ b/src/coreclr/vm/proftoeeinterfaceimpl.cpp @@ -763,7 +763,7 @@ void GenerationTable::AddRecord(int generation, BYTE* rangeStart, BYTE* rangeEnd // Because the segment/region are added to the heap before they are reported to the profiler, // it is possible that the region is added to the heap, a racing GenerationTable refresh happened, - // that refresh would contain the new region, and then it get reported again here. + // that refresh would contain the new region, and then it get reported again here. // This check will make sure we never add duplicated record to the table. for (ULONG i = 0; i < count; i++) { @@ -889,14 +889,14 @@ void GenerationTable::Refresh() { // fill in the values by calling back into the gc, which will report // the ranges by calling GenWalkFunc for each one - CrstHolder holder(&mutex); + CrstHolder holder(&mutex); IGCHeap *hp = GCHeapUtilities::GetGCHeap(); this->count = 0; hp->DiagDescrGenerations(GenWalkFunc, this); } // This is the table of generation bounds updated by the gc -// and read by the profiler. +// and read by the profiler. static GenerationTable *s_currentGenerationTable; // This is just so we can assert there's a single writer @@ -944,7 +944,7 @@ void __stdcall UpdateGenerationBounds() { RETURN; } - s_currentGenerationTable->Refresh(); + s_currentGenerationTable->Refresh(); } #endif // PROFILING_SUPPORTED RETURN; @@ -2420,7 +2420,7 @@ HRESULT ProfToEEInterfaceImpl::GetCodeInfo(FunctionID functionId, LPCBYTE * pSta HRESULT hr = GetCodeInfoFromCodeStart( pMethodDesc->GetNativeCode(), - _countof(codeInfos), + ARRAY_SIZE(codeInfos), &cCodeInfos, codeInfos); diff --git a/src/coreclr/vm/qcallentrypoints.cpp b/src/coreclr/vm/qcallentrypoints.cpp index 22327cdc79c80b..96971b81801951 100644 --- a/src/coreclr/vm/qcallentrypoints.cpp +++ b/src/coreclr/vm/qcallentrypoints.cpp @@ -74,7 +74,7 @@ #include "tailcallhelp.h" -#include +#include static const Entry s_QCall[] = { @@ -115,6 +115,7 @@ static const Entry s_QCall[] = DllImportEntry(RuntimeModule_GetType) DllImportEntry(RuntimeModule_GetScopeName) DllImportEntry(RuntimeModule_GetFullyQualifiedName) + DllImportEntry(StackFrame_GetMethodDescFromNativeIP) DllImportEntry(ModuleBuilder_GetStringConstant) DllImportEntry(ModuleBuilder_GetTypeRef) DllImportEntry(ModuleBuilder_GetTokenFromTypeSpec) @@ -320,5 +321,5 @@ static const Entry s_QCall[] = const void* QCallResolveDllImport(const char* name) { - return minipal_resolve_dllimport(s_QCall, lengthof(s_QCall), name); + return minipal_resolve_dllimport(s_QCall, ARRAY_SIZE(s_QCall), name); } diff --git a/src/coreclr/vm/reflectioninvocation.cpp b/src/coreclr/vm/reflectioninvocation.cpp index ebf13351d4c06f..68268942e562f5 100644 --- a/src/coreclr/vm/reflectioninvocation.cpp +++ b/src/coreclr/vm/reflectioninvocation.cpp @@ -451,7 +451,7 @@ struct ByRefToNullable { } }; -void CallDescrWorkerReflectionWrapper(CallDescrData * pCallDescrData, Frame * pFrame) +static void CallDescrWorkerReflectionWrapper(CallDescrData * pCallDescrData, Frame * pFrame) { // Use static contracts b/c we have SEH. STATIC_CONTRACT_THROWS; @@ -478,7 +478,7 @@ void CallDescrWorkerReflectionWrapper(CallDescrData * pCallDescrData, Frame * pF PAL_ENDTRY } // CallDescrWorkerReflectionWrapper -OBJECTREF InvokeArrayConstructor(TypeHandle th, MethodDesc* pMeth, Span* objs, int argCnt) +static OBJECTREF InvokeArrayConstructor(TypeHandle th, Span* objs, int argCnt) { CONTRACTL { THROWS; @@ -510,7 +510,9 @@ OBJECTREF InvokeArrayConstructor(TypeHandle th, MethodDesc* pMeth, SpanGetAt(i)->UnBox(),pMT->GetNumInstanceFieldBytes()); + ARG_SLOT value; + InvokeUtil::CreatePrimitiveValue(ELEMENT_TYPE_I4, oType, objs->GetAt(i), &value); + memcpyNoGCRefs(indexes + i, ArgSlotEndianessFixup(&value, sizeof(INT32)), sizeof(INT32)); } return AllocateArrayEx(th, indexes, argCnt); @@ -769,8 +771,6 @@ FCIMPL5(Object*, RuntimeMethodHandle::InvokeMethod, HELPER_METHOD_FRAME_BEGIN_RET_PROTECT(gc); - Assembly *pAssem = pMeth->GetAssembly(); - if (ownerType.IsSharedByGenericInstantiations()) COMPlusThrow(kNotSupportedException, W("NotSupported_Type")); @@ -786,23 +786,20 @@ FCIMPL5(Object*, RuntimeMethodHandle::InvokeMethod, if (fConstructor) { // If we are invoking a constructor on an array then we must - // handle this specially. String objects allocate themselves - // so they are a special case. + // handle this specially. if (ownerType.IsArray()) { gc.retVal = InvokeArrayConstructor(ownerType, - pMeth, objs, gc.pSig->NumFixedArgs()); goto Done; } + // Variable sized objects, like String instances, allocate themselves + // so they are a special case. MethodTable * pMT = ownerType.AsMethodTable(); - - { - fCtorOfVariableSizedObject = pMT->HasComponentSize(); - if (!fCtorOfVariableSizedObject) - gc.retVal = pMT->Allocate(); - } + fCtorOfVariableSizedObject = pMT->HasComponentSize(); + if (!fCtorOfVariableSizedObject) + gc.retVal = pMT->Allocate(); } { @@ -936,8 +933,6 @@ FCIMPL5(Object*, RuntimeMethodHandle::InvokeMethod, // If an exception occurs a gc may happen but we are going to dump the stack anyway and we do // not need to protect anything. - PVOID pRetBufStackCopy = NULL; - { BEGINFORBIDGC(); #ifdef _DEBUG @@ -947,24 +942,8 @@ FCIMPL5(Object*, RuntimeMethodHandle::InvokeMethod, // Take care of any return arguments if (fHasRetBuffArg) { - // We stack-allocate this ret buff, to preserve the invariant that ret-buffs are always in the - // caller's stack frame. We'll copy into gc.retVal later. - TypeHandle retTH = gc.pSig->GetReturnTypeHandle(); - MethodTable* pMT = retTH.GetMethodTable(); - if (pMT->IsStructRequiringStackAllocRetBuf()) - { - SIZE_T sz = pMT->GetNumInstanceFieldBytes(); - pRetBufStackCopy = _alloca(sz); - memset(pRetBufStackCopy, 0, sz); - - pValueClasses = new (_alloca(sizeof(ValueClassInfo))) ValueClassInfo(pRetBufStackCopy, pMT, pValueClasses); - *((LPVOID*) (pTransitionBlock + argit.GetRetBuffArgOffset())) = pRetBufStackCopy; - } - else - { - PVOID pRetBuff = gc.retVal->GetData(); - *((LPVOID*) (pTransitionBlock + argit.GetRetBuffArgOffset())) = pRetBuff; - } + PVOID pRetBuff = gc.retVal->GetData(); + *((LPVOID*) (pTransitionBlock + argit.GetRetBuffArgOffset())) = pRetBuff; } // copy args @@ -1128,10 +1107,6 @@ FCIMPL5(Object*, RuntimeMethodHandle::InvokeMethod, { CopyValueClass(gc.retVal->GetData(), &callDescrData.returnValue, gc.retVal->GetMethodTable()); } - else if (pRetBufStackCopy) - { - CopyValueClass(gc.retVal->GetData(), pRetBufStackCopy, gc.retVal->GetMethodTable()); - } // From here on out, it is OK to have GCs since the return object (which may have had // GC pointers has been put into a GC object and thus protected. diff --git a/src/coreclr/vm/runtimehandles.h b/src/coreclr/vm/runtimehandles.h index 184f27a7a311fe..85b7fa3d8e7f5a 100644 --- a/src/coreclr/vm/runtimehandles.h +++ b/src/coreclr/vm/runtimehandles.h @@ -113,8 +113,8 @@ typedef RuntimeTypeHandle FCALLRuntimeTypeHandle; #define FCALL_RTH_TO_REFLECTCLASS(x) (x).pRuntimeTypeDONOTUSEDIRECTLY class RuntimeTypeHandle { - ReflectClassBaseObject *pRuntimeTypeDONOTUSEDIRECTLY; public: + ReflectClassBaseObject *pRuntimeTypeDONOTUSEDIRECTLY; // Static method on RuntimeTypeHandle static FCDECL1(Object*, AllocateComObject, void* pClassFactory); diff --git a/src/coreclr/vm/siginfo.cpp b/src/coreclr/vm/siginfo.cpp index 4c438360513cb6..f10acff25522e3 100644 --- a/src/coreclr/vm/siginfo.cpp +++ b/src/coreclr/vm/siginfo.cpp @@ -43,7 +43,7 @@ CorTypeInfo::FindPrimitiveType(LPCUTF8 name) _ASSERTE(name != NULL); - for (unsigned int i = 1; i < _countof(CorTypeInfo::info); i++) + for (unsigned int i = 1; i < ARRAY_SIZE(CorTypeInfo::info); i++) { // can skip ELEMENT_TYPE_END (index 0) if ((info[i].className != NULL) && (strcmp(name, info[i].className) == 0)) return (CorElementType)i; @@ -2728,7 +2728,7 @@ HRESULT TypeIdentifierData::Init(Module *pModule, mdToken tk) args[0].Init(SERIALIZATION_TYPE_STRING, 0); args[1].Init(SERIALIZATION_TYPE_STRING, 0); - IfFailRet(ParseKnownCaArgs(caType, args, lengthof(args))); + IfFailRet(ParseKnownCaArgs(caType, args, ARRAY_SIZE(args))); m_cbScope = args[0].val.str.cbStr; m_pchScope = args[0].val.str.pStr; diff --git a/src/coreclr/vm/syncblk.h b/src/coreclr/vm/syncblk.h index 3b79753069976e..ff674963b6db22 100644 --- a/src/coreclr/vm/syncblk.h +++ b/src/coreclr/vm/syncblk.h @@ -920,7 +920,7 @@ class InteropSyncBlockInfo size_t GetTaggedMemorySizeInBytes() { LIMITED_METHOD_CONTRACT; - return _countof(m_taggedAlloc); + return ARRAY_SIZE(m_taggedAlloc); } private: diff --git a/src/coreclr/vm/threads.cpp b/src/coreclr/vm/threads.cpp index be14a7a8b883e0..200d36586ef52a 100644 --- a/src/coreclr/vm/threads.cpp +++ b/src/coreclr/vm/threads.cpp @@ -1927,7 +1927,7 @@ BOOL Thread::HasStarted() { BEGIN_PROFILER_CALLBACK(CORProfilerTrackThreads()); BOOL gcOnTransition = GC_ON_TRANSITIONS(FALSE); // disable GCStress 2 to avoid the profiler receiving a RuntimeThreadSuspended notification even before the ThreadCreated notification - + { GCX_PREEMP(); (&g_profControlBlock)->ThreadCreated((ThreadID) this); @@ -8278,7 +8278,7 @@ void dbgOnly_IdentifySpecialEEThread() LONG ourCount = FastInterlockIncrement(&cnt_SpecialEEThreads); - _ASSERTE(ourCount < (LONG) NumItems(SpecialEEThreads)); + _ASSERTE(ourCount < (LONG) ARRAY_SIZE(SpecialEEThreads)); SpecialEEThreads[ourCount-1] = ::GetCurrentThreadId(); } diff --git a/src/coreclr/vm/threads.h b/src/coreclr/vm/threads.h index 30fe5dcf09c331..f7b7479f586d73 100644 --- a/src/coreclr/vm/threads.h +++ b/src/coreclr/vm/threads.h @@ -280,7 +280,7 @@ struct TailCallArgBuffer #define SWITCHED_OUT_FIBER_OSID 0xbaadf00d; #ifdef _DEBUG -// A thread doesn't recieve its id until fully constructed. +// A thread doesn't receive its id until fully constructed. #define UNINITIALIZED_THREADID 0xbaadf00d #endif //_DEBUG @@ -3606,7 +3606,7 @@ class Thread LIMITED_METHOD_CONTRACT; _ASSERTE(slot >= 0 && slot <= MAX_NOTIFICATION_PROFILERS); #ifdef _DEBUG - DWORD newValue = + DWORD newValue = #endif // _DEBUG ++m_dwProfilerEvacuationCounters[slot]; _ASSERTE(newValue != 0U); @@ -3617,7 +3617,7 @@ class Thread LIMITED_METHOD_CONTRACT; _ASSERTE(slot >= 0 && slot <= MAX_NOTIFICATION_PROFILERS); #ifdef _DEBUG - DWORD newValue = + DWORD newValue = #endif // _DEBUG --m_dwProfilerEvacuationCounters[slot]; _ASSERTE(newValue != (DWORD)-1); diff --git a/src/coreclr/vm/threadsuspend.cpp b/src/coreclr/vm/threadsuspend.cpp index 2b76d47b5e1d17..c4fc869e893ec8 100644 --- a/src/coreclr/vm/threadsuspend.cpp +++ b/src/coreclr/vm/threadsuspend.cpp @@ -1968,7 +1968,7 @@ CONTEXT* AllocateOSContextHelper(BYTE** contextBuffer) pfnInitializeContext2 = (PINITIALIZECONTEXT2)GetProcAddress(hm, "InitializeContext2"); } - // Determine if the processor supports AVX so we could + // Determine if the processor supports AVX so we could // retrieve extended registers DWORD64 FeatureMask = GetEnabledXStateFeatures(); if ((FeatureMask & XSTATE_MASK_AVX) != 0) @@ -2020,7 +2020,7 @@ CONTEXT* AllocateOSContextHelper(BYTE** contextBuffer) *contextBuffer = buffer; -#else +#else pOSContext = new (nothrow) CONTEXT; pOSContext->ContextFlags = CONTEXT_COMPLETE; *contextBuffer = NULL; @@ -2938,7 +2938,7 @@ BOOL Thread::RedirectThreadAtHandledJITCase(PFN_REDIRECTTARGET pTgt) #ifdef _DEBUG // In some rare cases the stack pointer may be outside the stack limits. // SetThreadContext would fail assuming that we are trying to bypass CFG. - // + // // NB: the check here is slightly more strict than what OS requires, // but it is simple and uses only documented parts of TEB auto pTeb = this->GetTEB(); @@ -3336,7 +3336,7 @@ void ThreadSuspend::SuspendRuntime(ThreadSuspend::SUSPEND_REASON reason) // is after the trap flag is visible to the other thread. // // In other words: any threads seen in preemptive mode are no longer interesting to us. - // if they try switch to cooperative, they would see the flag set. + // if they try switch to cooperative, they would see the flag set. #ifdef FEATURE_PERFTRACING // Mark that the thread is currently in managed code. thread->SaveGCModeOnSuspension(); @@ -3403,7 +3403,7 @@ void ThreadSuspend::SuspendRuntime(ThreadSuspend::SUSPEND_REASON reason) if (thread->HasThreadStateOpportunistic(Thread::TS_GCSuspendRedirected)) { // We have seen this thead before and have redirected it. - // No point in suspending it again. It will not run hijackable code until it parks itself. + // No point in suspending it again. It will not run hijackable code until it parks itself. continue; } @@ -4302,7 +4302,7 @@ bool Thread::SysStartSuspendForDebug(AppDomain *pAppDomain) // // This method is called by the debugger helper thread when it times out waiting for a set of threads to -// synchronize. Its used to chase down threads that are not syncronizing quickly. It returns true if all the threads are +// synchronize. Its used to chase down threads that are not synchronizing quickly. It returns true if all the threads are // now synchronized. This also means that we own the thread store lock. // // This can be safely called if we're already suspended. @@ -4699,7 +4699,7 @@ void Thread::HijackThread(ReturnKind returnKind, ExecutionState *esb) pvHijackAddr = returnAddressHijackTarget; } #endif // TARGET_WINDOWS && TARGET_AMD64 - + #ifdef TARGET_X86 if (returnKind == RT_Float) { @@ -5520,11 +5520,11 @@ void ThreadSuspend::RestartEE(BOOL bFinishedGC, BOOL SuspendSucceded) #if defined(TARGET_ARM) || defined(TARGET_ARM64) // Flush the store buffers on all CPUs, to ensure that they all see changes made - // by the GC threads. This only matters on weak memory ordered processors as + // by the GC threads. This only matters on weak memory ordered processors as // the strong memory ordered processors wouldn't have reordered the relevant reads. // This is needed to synchronize threads that were running in preemptive mode while - // the runtime was suspended and that will return to cooperative mode after the runtime - // is restarted. + // the runtime was suspended and that will return to cooperative mode after the runtime + // is restarted. ::FlushProcessWriteBuffers(); #endif //TARGET_ARM || TARGET_ARM64 @@ -5768,7 +5768,7 @@ void ThreadSuspend::SuspendEE(SUSPEND_REASON reason) #if defined(TARGET_ARM) || defined(TARGET_ARM64) // Flush the store buffers on all CPUs, to ensure that all changes made so far are seen - // by the GC threads. This only matters on weak memory ordered processors as + // by the GC threads. This only matters on weak memory ordered processors as // the strong memory ordered processors wouldn't have reordered the relevant writes. // This is needed to synchronize threads that were running in preemptive mode thus were // left alone by suspension to flush their writes that they made before they switched to diff --git a/src/coreclr/vm/typehandle.cpp b/src/coreclr/vm/typehandle.cpp index 48d1c589b44cc4..13e59e5ffeb6f0 100644 --- a/src/coreclr/vm/typehandle.cpp +++ b/src/coreclr/vm/typehandle.cpp @@ -1590,7 +1590,7 @@ CHECK TypeHandle::CheckLoadLevel(ClassLoadLevel requiredLevel) { CHECK(!IsNull()); // CHECK_MSGF(!IsNull(), ("Type is null, required load level is %s", classLoadLevelName[requiredLevel])); - static_assert_no_msg(NumItems(classLoadLevelName) == (1 + CLASS_LOAD_LEVEL_FINAL)); + static_assert_no_msg(ARRAY_SIZE(classLoadLevelName) == (1 + CLASS_LOAD_LEVEL_FINAL)); // Quick check to avoid creating debug string ClassLoadLevel actualLevel = GetLoadLevel(); diff --git a/src/coreclr/vm/typehash.cpp b/src/coreclr/vm/typehash.cpp index e994e797477fc0..4453163ee5236d 100644 --- a/src/coreclr/vm/typehash.cpp +++ b/src/coreclr/vm/typehash.cpp @@ -141,10 +141,10 @@ DWORD EETypeHashTable::GetCount() return BaseGetElementCount(); } -static DWORD HashTypeHandle(DWORD level, TypeHandle t); +static DWORD HashTypeHandle(TypeHandle t); // Calculate hash value for a type def or instantiated type def -static DWORD HashPossiblyInstantiatedType(DWORD level, mdTypeDef token, Instantiation inst) +static DWORD HashPossiblyInstantiatedType(mdTypeDef token, Instantiation inst) { CONTRACTL { @@ -161,17 +161,10 @@ static DWORD HashPossiblyInstantiatedType(DWORD level, mdTypeDef token, Instanti dwHash = ((dwHash << 5) + dwHash) ^ token; if (!inst.IsEmpty()) { - dwHash = ((dwHash << 5) + dwHash) ^ inst.GetNumArgs(); - - // Hash two levels of the hiearchy. A simple nesting of generics instantiations is - // pretty common in generic collections, e.g.: ICollection> - if (level < 2) + // Hash n type parameters + for (DWORD i = 0; i < inst.GetNumArgs(); i++) { - // Hash n type parameters - for (DWORD i = 0; i < inst.GetNumArgs(); i++) - { - dwHash = ((dwHash << 5) + dwHash) ^ HashTypeHandle(level+1, inst[i]); - } + dwHash = ((dwHash << 5) + dwHash) ^ inst[i].AsTAddr(); } } @@ -179,7 +172,7 @@ static DWORD HashPossiblyInstantiatedType(DWORD level, mdTypeDef token, Instanti } // Calculate hash value for a function pointer type -static DWORD HashFnPtrType(DWORD level, BYTE callConv, DWORD numArgs, TypeHandle *retAndArgTypes) +static DWORD HashFnPtrType(BYTE callConv, DWORD numArgs, TypeHandle *retAndArgTypes) { WRAPPER_NO_CONTRACT; SUPPORTS_DAC; @@ -188,31 +181,29 @@ static DWORD HashFnPtrType(DWORD level, BYTE callConv, DWORD numArgs, TypeHandle dwHash = ((dwHash << 5) + dwHash) ^ ELEMENT_TYPE_FNPTR; dwHash = ((dwHash << 5) + dwHash) ^ callConv; dwHash = ((dwHash << 5) + dwHash) ^ numArgs; - if (level < 1) + + for (DWORD i = 0; i <= numArgs; i++) { - for (DWORD i = 0; i <= numArgs; i++) - { - dwHash = ((dwHash << 5) + dwHash) ^ HashTypeHandle(level+1, retAndArgTypes[i]); - } + dwHash = ((dwHash << 5) + dwHash) ^ retAndArgTypes[i].AsTAddr(); } return dwHash; } // Calculate hash value for an array/pointer/byref type -static DWORD HashParamType(DWORD level, CorElementType kind, TypeHandle typeParam) +static DWORD HashParamType(CorElementType kind, TypeHandle typeParam) { WRAPPER_NO_CONTRACT; INT_PTR dwHash = 5381; dwHash = ((dwHash << 5) + dwHash) ^ kind; - dwHash = ((dwHash << 5) + dwHash) ^ HashTypeHandle(level, typeParam); + dwHash = ((dwHash << 5) + dwHash) ^ typeParam.AsTAddr(); return dwHash; } // Calculate hash value from type handle -static DWORD HashTypeHandle(DWORD level, TypeHandle t) +static DWORD HashTypeHandle(TypeHandle t) { CONTRACTL { @@ -229,29 +220,30 @@ static DWORD HashTypeHandle(DWORD level, TypeHandle t) if (t.HasTypeParam()) { - retVal = HashParamType(level, t.GetInternalCorElementType(), t.GetTypeParam()); - } - else if (t.IsGenericVariable()) - { - retVal = (dac_cast(t.AsTypeDesc())->GetToken()); + retVal = HashParamType(t.GetInternalCorElementType(), t.GetTypeParam()); } else if (t.HasInstantiation()) { - retVal = HashPossiblyInstantiatedType(level, t.GetCl(), t.GetInstantiation()); + retVal = HashPossiblyInstantiatedType(t.GetCl(), t.GetInstantiation()); } else if (t.IsFnPtrType()) { FnPtrTypeDesc* pTD = t.AsFnPtrType(); - retVal = HashFnPtrType(level, pTD->GetCallConv(), pTD->GetNumArgs(), pTD->GetRetAndArgTypesPointer()); + retVal = HashFnPtrType(pTD->GetCallConv(), pTD->GetNumArgs(), pTD->GetRetAndArgTypesPointer()); + } + else if (t.IsGenericVariable()) + { + _ASSERTE(!"Generic variables are unexpected here."); + retVal = t.AsTAddr(); } else - retVal = HashPossiblyInstantiatedType(level, t.GetCl(), Instantiation()); + retVal = HashPossiblyInstantiatedType(t.GetCl(), Instantiation()); return retVal; } // Calculate hash value from key -static DWORD HashTypeKey(TypeKey* pKey) +DWORD HashTypeKey(TypeKey* pKey) { CONTRACTL { @@ -265,15 +257,15 @@ static DWORD HashTypeKey(TypeKey* pKey) if (pKey->GetKind() == ELEMENT_TYPE_CLASS) { - return HashPossiblyInstantiatedType(0, pKey->GetTypeToken(), pKey->GetInstantiation()); + return HashPossiblyInstantiatedType(pKey->GetTypeToken(), pKey->GetInstantiation()); } else if (pKey->GetKind() == ELEMENT_TYPE_FNPTR) { - return HashFnPtrType(0, pKey->GetCallConv(), pKey->GetNumArgs(), pKey->GetRetAndArgTypes()); + return HashFnPtrType(pKey->GetCallConv(), pKey->GetNumArgs(), pKey->GetRetAndArgTypes()); } else { - return HashParamType(0, pKey->GetKind(), pKey->GetElementType()); + return HashParamType(pKey->GetKind(), pKey->GetElementType()); } } @@ -552,7 +544,7 @@ VOID EETypeHashTable::InsertValue(TypeHandle data) pNewEntry->SetTypeHandle(data); - BaseInsertEntry(HashTypeHandle(0, data), pNewEntry); + BaseInsertEntry(HashTypeHandle(data), pNewEntry); } #endif // #ifndef DACCESS_COMPILE diff --git a/src/coreclr/vm/typehash.h b/src/coreclr/vm/typehash.h index 5df8dec8682cd6..b705bd2a7801ad 100644 --- a/src/coreclr/vm/typehash.h +++ b/src/coreclr/vm/typehash.h @@ -26,6 +26,8 @@ // //======================================================================================== +DWORD HashTypeKey(TypeKey* pKey); + // One of these is present for each element in the table // It simply chains together (hash,data) pairs typedef DPTR(struct EETypeHashEntry) PTR_EETypeHashEntry; diff --git a/src/coreclr/vm/typehashingalgorithms.h b/src/coreclr/vm/typehashingalgorithms.h index 6e393ed85cb833..76e82bb8f7ede6 100644 --- a/src/coreclr/vm/typehashingalgorithms.h +++ b/src/coreclr/vm/typehashingalgorithms.h @@ -142,7 +142,7 @@ The xxHash32 implementation is based on the code published by Yann Collet: inline static UINT32 HashMDToken(mdToken token) { - // Hash function to generate a value useable for reasonable hashes from a single 32bit value + // Hash function to generate a value usable for reasonable hashes from a single 32bit value // This function was taken from http://burtleburtle.net/bob/hash/integer.html UINT32 a = token; a -= (a<<6); diff --git a/src/coreclr/vm/typekey.h b/src/coreclr/vm/typekey.h index 45b186748f3bce..57044cc5f7aaaf 100644 --- a/src/coreclr/vm/typekey.h +++ b/src/coreclr/vm/typekey.h @@ -213,7 +213,6 @@ class TypeKey return TypeKey::Equals(this, pKey); } - // Comparison and hashing static BOOL Equals(const TypeKey *pKey1, const TypeKey *pKey2) { WRAPPER_NO_CONTRACT; @@ -257,33 +256,6 @@ class TypeKey return TRUE; } } - - DWORD ComputeHash() const - { - LIMITED_METHOD_CONTRACT; - DWORD_PTR hashLarge; - - if (m_kind == ELEMENT_TYPE_CLASS) - { - hashLarge = ((DWORD_PTR)u.asClass.m_pModule ^ (DWORD_PTR)u.asClass.m_numGenericArgs ^ (DWORD_PTR)u.asClass.m_typeDef); - } - else if (CorTypeInfo::IsModifier_NoThrow(m_kind) || m_kind == ELEMENT_TYPE_VALUETYPE) - { - hashLarge = (u.asParamType.m_paramType ^ (DWORD_PTR) u.asParamType.m_rank); - } - else hashLarge = 0; - -#if POINTER_BITS == 32 - return hashLarge; -#else - DWORD hash = *(DWORD *)&hashLarge; - for (unsigned i = 1; i < POINTER_BITS / 32; i++) - { - hash ^= ((DWORD *)&hashLarge)[i]; - } - return hash; -#endif - } }; diff --git a/src/coreclr/vm/weakreferencenative.cpp b/src/coreclr/vm/weakreferencenative.cpp index ab2b6f9887c46e..c61467b8cf111e 100644 --- a/src/coreclr/vm/weakreferencenative.cpp +++ b/src/coreclr/vm/weakreferencenative.cpp @@ -108,6 +108,7 @@ struct WeakHandleSpinLockHolder // // In order to qualify to be used with a HNDTYPE_WEAK_NATIVE_COM, the incoming object must: // * be an RCW +// * not be an aggregated RCW // * respond to a QI for IWeakReferenceSource // * succeed when asked for an IWeakReference* // @@ -149,7 +150,14 @@ NativeComWeakHandleInfo* GetComWeakReferenceInfo(OBJECTREF* pObject) #endif { #ifdef FEATURE_COMWRAPPERS - pWeakReferenceSource = reinterpret_cast(ComWrappersNative::GetIdentityForObject(pObject, IID_IWeakReferenceSource, &wrapperId)); + bool isAggregated = false; + pWeakReferenceSource = reinterpret_cast(ComWrappersNative::GetIdentityForObject(pObject, IID_IWeakReferenceSource, &wrapperId, &isAggregated)); + if (isAggregated) + { + // If the RCW is an aggregated RCW, then the managed object cannot be recreated from the IUnknown as the outer IUnknown wraps the managed object. + // In this case, don't create a weak reference backed by a COM weak reference. + pWeakReferenceSource = nullptr; + } #endif } @@ -448,7 +456,7 @@ FCIMPL3(void, WeakReferenceNative::Create, WeakReferenceObject * pThisUNSAFE, Ob _ASSERTE(gc.pThis->GetMethodTable()->CanCastToClass(pWeakReferenceMT)); // Create the handle. -#if defined(FEATURE_COMINTEROP) || defined(FEATURE_COMWRAPPERS) +#if defined(FEATURE_COMINTEROP) || defined(FEATURE_COMWRAPPERS) NativeComWeakHandleInfo *comWeakHandleInfo = nullptr; if (gc.pTarget != NULL) { @@ -690,7 +698,7 @@ FCIMPL1(Object *, WeakReferenceNative::GetTarget, WeakReferenceObject * pThisUNS OBJECTREF pTarget = GetWeakReferenceTarget(pThis); -#if defined(FEATURE_COMINTEROP) || defined(FEATURE_COMWRAPPERS) +#if defined(FEATURE_COMINTEROP) || defined(FEATURE_COMWRAPPERS) // If we found an object, or we're not a native COM weak reference, then we're done. Othewrise // we can try to create a new RCW to the underlying native COM object if it's still alive. if (pTarget != NULL || !IsNativeComWeakReferenceHandle(pThis->m_Handle)) @@ -718,7 +726,7 @@ FCIMPL1(Object *, WeakReferenceOfTNative::GetTarget, WeakReferenceObject * pThis OBJECTREF pTarget = GetWeakReferenceTarget(pThis); -#if defined(FEATURE_COMINTEROP) || defined(FEATURE_COMWRAPPERS) +#if defined(FEATURE_COMINTEROP) || defined(FEATURE_COMWRAPPERS) // If we found an object, or we're not a native COM weak reference, then we're done. Othewrise // we can try to create a new RCW to the underlying native COM object if it's still alive. if (pTarget != NULL || !IsNativeComWeakReferenceHandle(pThis->m_Handle)) diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props b/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props index 9b479dcbe19c17..61f2942b48c908 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props @@ -173,7 +173,7 @@ - + diff --git a/src/installer/pkg/sfx/installers/dotnet-host.proj b/src/installer/pkg/sfx/installers/dotnet-host.proj index 797d2f5afcc31a..7a7d6a57f21c47 100644 --- a/src/installer/pkg/sfx/installers/dotnet-host.proj +++ b/src/installer/pkg/sfx/installers/dotnet-host.proj @@ -9,6 +9,7 @@ true true sharedhost + Dotnet_CLI_SharedHost HostSrc afterInstallExecute @@ -21,12 +22,16 @@ $(MSBuildThisFileDirectory)rpm_scripts/host $(RpmScriptsDirectory)/after_install.sh $(RpmScriptsDirectory)/after_remove.sh + + dotnet-host $(MajorVersion).$(MinorVersion) $(Platform) + + diff --git a/src/installer/pkg/sfx/installers/osx_scripts/host/postinstall b/src/installer/pkg/sfx/installers/osx_scripts/host/postinstall index 3eba436d925092..6ad80b6c3988c6 100755 --- a/src/installer/pkg/sfx/installers/osx_scripts/host/postinstall +++ b/src/installer/pkg/sfx/installers/osx_scripts/host/postinstall @@ -12,7 +12,7 @@ INSTALL_DESTINATION=$2 chmod 755 $INSTALL_DESTINATION/dotnet mkdir -p /etc/dotnet -# set install_location (legacy location) to x64 location (regardless of wether or not we're installing x64) +# set install_location (legacy location) to x64 location (regardless of whether or not we're installing x64) echo $X64_INSTALL_DESTINATION | tee /etc/dotnet/install_location # set install_location_arch to point to this installed location echo $INSTALL_DESTINATION | tee /etc/dotnet/install_location_${InstallerTargetArchitecture} diff --git a/src/installer/tests/HostActivation.Tests/NativeHosting/Nethost.cs b/src/installer/tests/HostActivation.Tests/NativeHosting/Nethost.cs index 9a90ad8125336c..792bf4faf6f8f6 100644 --- a/src/installer/tests/HostActivation.Tests/NativeHosting/Nethost.cs +++ b/src/installer/tests/HostActivation.Tests/NativeHosting/Nethost.cs @@ -89,6 +89,7 @@ public void GetHostFxrPath_DotNetRootParameter(bool explicitLoad, bool useAssemb } [Theory] + [ActiveIssue("https://github.com/dotnet/runtime/issues/61131", TestPlatforms.OSX)] [InlineData(true, false, true, false)] [InlineData(true, false, true, true)] [InlineData(true, false, false, false)] @@ -180,6 +181,7 @@ public void GetHostFxrPath_HostFxrAlreadyLoaded() } [Theory] + [ActiveIssue("https://github.com/dotnet/runtime/issues/61131", TestPlatforms.OSX)] [SkipOnPlatform(TestPlatforms.Windows, "This test targets the install_location config file which is only used on Linux and macOS.")] [InlineData("{0}", false, true)] [InlineData("{0}\n", false, true)] @@ -245,6 +247,7 @@ public void GetHostFxrPath_InstallLocationFile(string value, bool shouldUseArchS } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/61131", TestPlatforms.OSX)] [SkipOnPlatform(TestPlatforms.Windows, "This test targets the install_location config file which is only used on Linux and macOS.")] public void GetHostFxrPath_GlobalInstallation_HasNoDefaultInstallationPath() { @@ -275,6 +278,7 @@ public void GetHostFxrPath_GlobalInstallation_HasNoDefaultInstallationPath() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/61131", TestPlatforms.OSX)] [SkipOnPlatform(TestPlatforms.Windows, "This test targets the install_location config file which is only used on Linux and macOS.")] public void GetHostFxrPath_GlobalInstallation_ArchitectureSpecificPathIsPickedOverDefaultPath() { diff --git a/src/installer/tests/HostActivation.Tests/StartupHooks.cs b/src/installer/tests/HostActivation.Tests/StartupHooks.cs index a0533a60fd4772..3e1685356167f9 100644 --- a/src/installer/tests/HostActivation.Tests/StartupHooks.cs +++ b/src/installer/tests/HostActivation.Tests/StartupHooks.cs @@ -13,6 +13,7 @@ public class StartupHooks : IClassFixture { private SharedTestState sharedTestState; private string startupHookVarName = "DOTNET_STARTUP_HOOKS"; + private string startupHookRuntimeConfigName = "STARTUP_HOOKS"; private string startupHookSupport = "System.StartupHookProvider.IsSupported"; public StartupHooks(StartupHooks.SharedTestState fixture) @@ -105,6 +106,64 @@ public void Muxer_activation_of_Multiple_StartupHooks_Succeeds() .And.HaveStdOutContaining("Hello World"); } + [Fact] + public void Muxer_activation_of_RuntimeConfig_StartupHook_Succeeds() + { + var fixture = sharedTestState.PortableAppFixture.Copy(); + var dotnet = fixture.BuiltDotnet; + var appDll = fixture.TestProject.AppDll; + + var startupHookFixture = sharedTestState.StartupHookFixture.Copy(); + var startupHookDll = startupHookFixture.TestProject.AppDll; + + RuntimeConfig.FromFile(fixture.TestProject.RuntimeConfigJson) + .WithProperty(startupHookRuntimeConfigName, startupHookDll) + .Save(); + + // RuntimeConfig defined startup hook + dotnet.Exec(appDll) + .CaptureStdOut() + .CaptureStdErr() + .Execute() + .Should().Pass() + .And.HaveStdOutContaining("Hello from startup hook!") + .And.HaveStdOutContaining("Hello World"); + } + + [Fact] + public void Muxer_activation_of_RuntimeConfig_And_Environment_StartupHooks_SucceedsInExpectedOrder() + { + var fixture = sharedTestState.PortableAppFixture.Copy(); + var dotnet = fixture.BuiltDotnet; + var appDll = fixture.TestProject.AppDll; + + var startupHookFixture = sharedTestState.StartupHookFixture.Copy(); + var startupHookDll = startupHookFixture.TestProject.AppDll; + + RuntimeConfig.FromFile(fixture.TestProject.RuntimeConfigJson) + .WithProperty(startupHookRuntimeConfigName, startupHookDll) + .Save(); + + var startupHook2Fixture = sharedTestState.StartupHookWithDependencyFixture.Copy(); + var startupHook2Dll = startupHook2Fixture.TestProject.AppDll; + + // include any char to counter output from other threads such as in #57243 + const string wildcardPattern = @"[\r\n\s.]*"; + + // RuntimeConfig and Environment startup hooks in expected order + dotnet.Exec(appDll) + .EnvironmentVariable(startupHookVarName, startupHook2Dll) + .CaptureStdOut() + .CaptureStdErr() + .Execute() + .Should().Pass() + .And.HaveStdOutMatching("Hello from startup hook with dependency!" + + wildcardPattern + + "Hello from startup hook!" + + wildcardPattern + + "Hello World"); + } + // Empty startup hook variable [Fact] public void Muxer_activation_of_Empty_StartupHook_Variable_Succeeds() diff --git a/src/installer/tests/scripts/linux-test/RuntimeInstallation.sh b/src/installer/tests/scripts/linux-test/RuntimeInstallation.sh index c4ec682f1965e3..df6fec7846ed2a 100644 --- a/src/installer/tests/scripts/linux-test/RuntimeInstallation.sh +++ b/src/installer/tests/scripts/linux-test/RuntimeInstallation.sh @@ -1,7 +1,7 @@ -#!/bin/bash +#!/usr/bin/env bash current_user=$(whoami) -if [ $current_user != "root" ]; then +if [[ "$current_user" != "root" ]]; then echo "script requires superuser privileges to run" exit 1 fi @@ -15,35 +15,34 @@ log_file="/docker/logfile.txt" exec &>> $log_file -if [ $ID == "ol" ] ; then +if [[ "$ID" == "ol" ]]; then distro="oraclelinux" fi -if [ "$distro" == "oraclelinux" ] || [ "$distro" == "rhel" ] || [ "$distro" == "opensuse" ] ; then +if [[ "$distro" == "oraclelinux" || "$distro" == "rhel" || "$distro" == "opensuse" ]]; then version=$(echo $version | cut -d . -f 1) -fi +fi echo $distro:$version runtime_version=$1 -if [ "$runtime_version" == "latest" ] ; -then +if [[ "$runtime_version" == "latest" ]]; then BLOB_RUNTIME_DIR="https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master" else BLOB_RUNTIME_DIR="https://dotnetcli.blob.core.windows.net/dotnet/Runtime/$runtime_version" fi install_curl(){ - apt-get -y install curl - if [ $? -ne 0 ] ; then + apt-get -y install curl + if [ $? -ne 0 ]; then apt-get update apt-get -y install curl fi } download_from_blob_deb(){ BLOB_PATH=$1 - if curl --output /dev/null --head --fail $BLOB_PATH; then + if curl --output /dev/null --head --fail $BLOB_PATH; then curl -O -s $BLOB_PATH - else + else echo "Could not extract file from blob" exit 1 fi @@ -60,14 +59,14 @@ install_runtime_packages_deb(){ dpkg -i *.deb } determine_runtime_version_deb(){ - if [ "$runtime_version" == "latest" ] ; then + if [[ "$runtime_version" == "latest" ]]; then runtime_version=$(dpkg-deb -f dotnet-runtime-latest-$arch.deb Package) runtime_version=${runtime_version#dotnet-runtime-} fi } check_if_runtime_is_installed_deb(){ find_runtime=$(apt list --installed | grep dotnet-runtime-$runtime_version) - if [ "$find_runtime" == "" ] ; then + if [[ -z "$find_runtime" ]]; then echo "Not able to remove runtime $runtime_version because it is not installed" exit 1 fi @@ -84,9 +83,9 @@ install_wget_zypper(){ } download_from_blob_rpm(){ BLOB_PATH=$1 - if wget --spider $BLOB_PATH; then - wget -nv $BLOB_PATH - else + if wget --spider $BLOB_PATH; then + wget -nv $BLOB_PATH + else echo "Could not extract file from blob" exit 1 fi @@ -108,7 +107,7 @@ install_runtime_packages_zypper(){ rpm -Uvh *.rpm } determine_runtime_version_rpm(){ - if [ "$runtime_version" == "latest" ] ; then + if [[ "$runtime_version" == "latest" ]]; then runtime_version=$(rpm -qip dotnet-runtime-latest-$arch.rpm | grep Version) runtime_version=$(echo $runtime_version | cut -d ":" -f 2) runtime_version=$(echo $runtime_version | tr _ -) @@ -116,7 +115,7 @@ determine_runtime_version_rpm(){ } check_if_runtime_is_installed_rpm(){ find_runtime=$(rpm -qa | grep dotnet-runtime-$runtime_version) - if [ "$find_runtime" == "" ] ; then + if [[ -z "$find_runtime" ]]; then echo "Not able to remove runtime $runtime_version because it is not installed" exit 1 fi @@ -130,9 +129,9 @@ uninstall_runtime_zypper(){ runtime_installed_packages=$(rpm -qa | grep -e dotnet) } determine_success_install(){ - if [ -e $result_file ] ; then + if [ -e $result_file ]; then installed_runtime=$(dotnet --list-runtimes | grep $runtime_version) - if [ "$installed_runtime" != "" ] ; then + if [[ -n "$installed_runtime" ]]; then success_install=1 else success_install=0 @@ -140,8 +139,8 @@ determine_success_install(){ fi } test_result_install(){ - if [ -e $result_file ] ; then - if [ $success_install -eq 1 ] ; then + if [ -e $result_file ]; then + if [ $success_install -eq 1 ]; then echo "$distro:$version install -> passed" >> $result_file else echo "$distro:$version install -> failed" >> $result_file @@ -149,19 +148,19 @@ test_result_install(){ fi } uninstall_latest_runtime_warning(){ - if [ "$runtime_version" == "latest" ] ; then + if [[ "$runtime_version" == "latest" ]]; then echo "Specify runtime version to unistall. Type dotnet --list-runtimes to see runtimes versions installed" exit 1 - fi + fi } test_result_uninstall(){ - if [ "$runtime_installed_packages" == "" ] ; then + if [[ -z "$runtime_installed_packages" ]]; then success_uninstall=1 else success_uninstall=0 fi - if [ -e $result_file ] ; then - if [ $success_uninstall -eq 1 ] ; then + if [ -e $result_file ]; then + if [ $success_uninstall -eq 1 ]; then echo "$distro:$version uninstall -> passed" >> $result_file else echo "$distro:$version uninstall -> failed" >> $result_file @@ -169,10 +168,10 @@ test_result_uninstall(){ fi } -if [ "$distro" == "ubuntu" ] || [ "$distro" == "debian" ] ; then - if [ "$2" == "install" ] ; then - install_curl - +if [[ "$distro" == "ubuntu" || "$distro" == "debian" ]]; then + if [[ "$2" == "install" ]]; then + install_curl + download_runtime_packages_deb install_runtime_packages_deb dotnet --list-runtimes @@ -180,19 +179,19 @@ if [ "$distro" == "ubuntu" ] || [ "$distro" == "debian" ] ; then determine_runtime_version_deb determine_success_install test_result_install - - elif [ "$2" == "uninstall" ] ; then + + elif [[ "$2" == "uninstall" ]]; then uninstall_latest_runtime_warning - fi + fi - if [ "$3" == "uninstall" ] || [ "$2" == "uninstall" ] ; then + if [[ "$3" == "uninstall" || "$2" == "uninstall" ]]; then check_if_runtime_is_installed_deb uninstall_runtime_deb test_result_uninstall fi -elif [ "$distro" == "fedora" ] || [ "$distro" == "centos" ] || [ "$distro" == "oraclelinux" ] || [ "$distro" == "rhel" ] ; then - if [ "$2" == "install" ] ; then +elif [[ "$distro" == "fedora" || "$distro" == "centos" || "$distro" == "oraclelinux" || "$distro" == "rhel" ]]; then + if [[ "$2" == "install" ]]; then install_wget_yum download_runtime_packages_rpm @@ -204,39 +203,39 @@ elif [ "$distro" == "fedora" ] || [ "$distro" == "centos" ] || [ "$distro" == "o determine_success_install test_result_install - elif [ "$2" == "uninstall" ] ; then - uninstall_latest_runtime_warning + elif [[ "$2" == "uninstall" ]]; then + uninstall_latest_runtime_warning fi - if [ "$3" == "uninstall" ] || [ "$2" == "uninstall" ] ; then + if [[ "$3" == "uninstall" || "$2" == "uninstall" ]]; then check_if_runtime_is_installed_rpm uninstall_runtime_yum test_result_uninstall fi -elif [ "$distro" == "opensuse" ] || [ "$distro" == "sles" ] ; then - if [ "$2" == "install" ] ; then +elif [[ "$distro" == "opensuse" || "$distro" == "sles" ]]; then + if [[ "$2" == "install" ]]; then install_wget_zypper download_runtime_packages_rpm install_runtime_packages_zypper dotnet --list-runtimes - + determine_runtime_version_rpm determine_success_install test_result_install - - elif [ "$2" == "uninstall" ] ; then - uninstall_latest_runtime_warning + + elif [[ "$2" == "uninstall" ]]; then + uninstall_latest_runtime_warning fi - if [ "$3" == "uninstall" ] || [ "$2" == "uninstall" ] ; then + if [[ "$3" == "uninstall" || "$2" == "uninstall" ]]; then check_if_runtime_is_installed_rpm uninstall_runtime_zypper test_result_uninstall - fi + fi fi -if [ -e $log_file ] ; then +if [ -e $log_file ]; then ch=$(printf "%-160s" "-") echo "${ch// /-} " fi diff --git a/src/installer/tests/scripts/linux-test/SdkInstallation.sh b/src/installer/tests/scripts/linux-test/SdkInstallation.sh index b2e068d4afa19c..2701c79e14c6b6 100644 --- a/src/installer/tests/scripts/linux-test/SdkInstallation.sh +++ b/src/installer/tests/scripts/linux-test/SdkInstallation.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash current_user=$(whoami) if [ $current_user != "root" ]; then @@ -15,12 +15,12 @@ log_file="/docker/logfile.txt" exec &>> $log_file -if [ $ID == "ol" ] ; then +if [[ "$ID" == "ol" ]]; then distro="oraclelinux" fi -if [ "$distro" == "oraclelinux" ] || [ "$distro" == "rhel" ] || [ "$distro" == "opensuse" ] ; then +if [[ "$distro" == "oraclelinux" || "$distro" == "rhel" || "$distro" == "opensuse" ]]; then version=$(echo $version | cut -d . -f 1) -fi +fi echo $distro:$version @@ -31,23 +31,23 @@ BLOB_SDK_DIR="https://dotnetcli.blob.core.windows.net/dotnet/Sdk" BLOB_ASPNET_DIR="https://dotnetcli.blob.core.windows.net/dotnet/aspnetcore/Runtime" install_curl(){ - apt-get -y install curl - if [ $? -ne 0 ] ; then + apt-get -y install curl + if [ $? -ne 0 ]; then apt-get update apt-get -y install curl fi } download_from_blob_deb(){ BLOB_PATH=$1 - if curl --output /dev/null --head --fail $BLOB_PATH; then + if curl --output /dev/null --head --fail $BLOB_PATH; then curl -O -s $BLOB_PATH - else + else echo "Could not extract file from blob" exit 1 fi } download_sdk_package_deb(){ - if [ "$sdk_version" == "latest" ] ; then + if [[ "$sdk_version" == "latest" ]]; then download_from_blob_deb "$BLOB_SDK_DIR/master/dotnet-sdk-latest-$arch.deb" else download_from_blob_deb "$BLOB_SDK_DIR/$sdk_version/dotnet-sdk-$sdk_version-$arch.deb" @@ -59,17 +59,17 @@ download_aspnet_package_deb(){ determine_aspnet_version_install_deb(){ aspnet_version=$(dpkg -I dotnet-sdk-$sdk_version-$arch.deb | grep -o 'aspnetcore-runtime-[^ ]*') aspnet_version=${aspnet_version#aspnetcore-runtime-} - [ "${aspnet_version: -1}" == "," ] && aspnet_version=${aspnet_version%,} + [[ "${aspnet_version: -1}" == "," ]] && aspnet_version=${aspnet_version%,} } determine_runtime_sdk_install_deb(){ runtime_sdk=$(dpkg -I dotnet-sdk-$sdk_version-$arch.deb | grep -o 'dotnet-runtime-[^ ]*') runtime_sdk=${runtime_sdk#dotnet-runtime-} - [ "${runtime_sdk: -1}" == "," ] && runtime_sdk=${runtime_sdk%,} + [[ "${runtime_sdk: -1}" == "," ]] && runtime_sdk=${runtime_sdk%,} } determine_runtime_aspnet_install_deb(){ runtime_aspnet=$(dpkg -I aspnetcore-runtime-$aspnet_version-$arch.deb | grep -o 'dotnet-runtime[^ ]*') runtime_aspnet=${runtime_aspnet#dotnet-runtime-} - [ "${runtime_aspnet: -1}" == "," ] && runtime_sdk=${runtime_aspnet%,} + [[ "${runtime_aspnet: -1}" == "," ]] && runtime_sdk=${runtime_aspnet%,} } download_runtime_packages_deb(){ download_from_blob_deb "$BLOB_RUNTIME_DIR/$runtime_version/dotnet-runtime-deps-$runtime_version-$distro.$version-$arch.deb" @@ -88,7 +88,7 @@ install_aspnet_and_sdk_deb(){ } check_if_sdk_is_installed_deb(){ find_sdk=$(apt list --installed | grep dotnet-sdk-$sdk_version) - if [ "$find_sdk" == "" ] ; then + if [[ -z "$find_sdk" ]]; then echo "Not able to remove sdk $sdk_version because it is not installed" exit 1 fi @@ -117,15 +117,15 @@ install_wget_zypper(){ } download_from_blob_rpm(){ BLOB_PATH=$1 - if wget --spider $BLOB_PATH; then + if wget --spider $BLOB_PATH; then wget -nv $BLOB_PATH - else + else echo "Could not extract file from blob" exit 1 fi } download_sdk_package_rpm(){ - if [ "$sdk_version" == "latest" ] ; then + if [[ "$sdk_version" == "latest" ]]; then download_from_blob_rpm "$BLOB_SDK_DIR/master/dotnet-sdk-latest-$arch.rpm" else download_from_blob_rpm "$BLOB_SDK_DIR/$sdk_version/dotnet-sdk-$sdk_version-$arch.rpm" @@ -170,8 +170,7 @@ install_aspnet_and_sdk_rpm(){ } check_if_sdk_is_installed_rpm(){ find_sdk=$(rpm -qa | grep dotnet-sdk-$sdk_version) - if [ "$find_sdk" == "" ] ; - then + if [[ -z "$find_sdk" ]]; then echo "Not able to remove sdk $sdk_version because it is not installed" exit 1 fi @@ -192,7 +191,7 @@ uninstall_dotnet_yum(){ dotnet_installed_packages=$(rpm -qa | grep -e dotnet -e aspnet) } uninstall_dotnet_zypper(){ - zypper -n rm $(rpm -qa | grep -e dotnet -e aspnet) + zypper -n rm $(rpm -qa | grep -e dotnet -e aspnet) dotnet_installed_packages=$(rpm -qa | grep -e dotnet -e aspnet) } checkout_new_folder(){ @@ -203,12 +202,12 @@ checkout_previous_folder(){ cd .. } run_app(){ - if [ -e $result_file ] ; then + if [ -e $result_file ]; then dotnet new console -o dockerApp cd dockerApp dotnet restore -s https://dotnet.myget.org/F/dotnet-core/api/v3/index.json project_output=$(dotnet run) - if [ "$project_output" == 'Hello World!' ] ; + if [[ "$project_output" == 'Hello World!' ]]; then sucess_install=1; else @@ -217,8 +216,8 @@ run_app(){ fi } test_result_install(){ - if [ -e $result_file ] ; then - if [ $sucess_install -eq 1 ] ; then + if [ -e $result_file ]; then + if [ $sucess_install -eq 1 ]; then echo "$distro:$version install -> passed" >> $result_file else echo "$distro:$version install -> failed" >> $result_file @@ -226,15 +225,15 @@ test_result_install(){ fi } test_result_uninstall(){ - - if [ "$dotnet_installed_packages" == "" ] ; then + + if [[ -z "$dotnet_installed_packages" ]]; then sucess_uninstall=1; else sucess_uninstall=0; fi - if [ -e $result_file ] ; then - if [ $sucess_uninstall -eq 1 ] ; then + if [ -e $result_file ]; then + if [ $sucess_uninstall -eq 1 ]; then echo "$distro:$version uninstall -> passed" >> $result_file else echo "$distro:$version uninstall -> failed" >> $result_file @@ -242,77 +241,77 @@ test_result_uninstall(){ fi } uninstall_latest_sdk_warning(){ - if [ "$sdk_version" == "latest" ] ; then + if [[ "$sdk_version" == "latest" ]]; then echo "Specify sdk version to unistall. Type dotnet --list-sdks to see sdks versions installed" exit 1 - fi + fi } -if [ "$distro" == "ubuntu" ] || [ "$distro" == "debian" ] ; then - if [ "$2" == "install" ] ; then - install_curl - +if [[ "$distro" == "ubuntu" || "$distro" == "debian" ]]; then + if [[ "$2" == "install" ]]; then + install_curl + download_sdk_package_deb - + determine_aspnet_version_install_deb - download_aspnet_package_deb + download_aspnet_package_deb determine_runtime_aspnet_install_deb determine_runtime_sdk_install_deb - + runtime_version="$runtime_aspnet" download_runtime_packages_deb install_runtime_packages_deb - - if [ "$runtime_aspnet" != "$runtime_sdk" ] ; then + + if [ "$runtime_aspnet" != "$runtime_sdk" ]; then runtime_version="$runtime_sdk" checkout_new_folder download_runtime_packages_deb install_runtime_packages_deb checkout_previous_folder - fi + fi install_aspnet_and_sdk_deb - + dotnet --list-runtimes dotnet --list-sdks run_app test_result_install - - elif [ "$2" == "uninstall" ] ; then - uninstall_latest_sdk_warning + + elif [[ "$2" == "uninstall" ]]; then + uninstall_latest_sdk_warning check_if_sdk_is_installed_deb - + determine_runtime_sdk_uninstall_deb determine_aspnet_package_name_uninstall_deb determine_runtime_aspnet_uninstall_deb - - fi - if [ "$3" == "uninstall" ] && [ $sucess_install -eq 1 ] || [ "$2" == "uninstall" ] ; then + fi + + if [[ "$3" == "uninstall" && "$sucess_install" == 1 || "$2" == "uninstall" ]]; then uninstall_dotnet_deb test_result_uninstall fi -elif [ "$distro" == "fedora" ] || [ "$distro" == "centos" ] || [ "$distro" == "oraclelinux" ] || [ "$distro" == "rhel" ] ; then - if [ "$2" == "install" ] ; then +elif [[ "$distro" == "fedora" || "$distro" == "centos" || "$distro" == "oraclelinux" || "$distro" == "rhel" ]]; then + if [[ "$2" == "install" ]]; then install_wget_yum download_sdk_package_rpm - + determine_aspnet_version_install_rpm download_aspnet_package_rpm determine_runtime_aspnet_install_rpm determine_runtime_sdk_install_rpm - + checkout_new_folder runtime_version="$runtime_aspnet" download_runtime_packages_rpm install_runtime_deps_package_yum - - if [ "$runtime_aspnet" != "$runtime_sdk" ] ; then + + if [ "$runtime_aspnet" != "$runtime_sdk" ]; then runtime_version="$runtime_sdk" download_runtime_packages_rpm install_runtime_deps_package_yum @@ -328,42 +327,42 @@ elif [ "$distro" == "fedora" ] || [ "$distro" == "centos" ] || [ "$distro" == "o run_app test_result_install - elif [ "$2" == "uninstall" ] ; then - uninstall_latest_sdk_warning + elif [[ "$2" == "uninstall" ]]; then + uninstall_latest_sdk_warning check_if_sdk_is_installed_rpm - + determine_runtime_sdk_uninstall_rpm determine_aspnet_package_name_uninstall_rpm determine_runtime_aspnet_uninstall_rpm - + echo $runtime_sdk echo $runtime_aspnet fi - if [ "$3" == "uninstall" ] && [ $sucess_install -eq 1 ]|| [ "$2" == "uninstall" ] ; then + if [[ "$3" == "uninstall" && "$sucess_install" == 1 || "$2" == "uninstall" ]]; then uninstall_dotnet_yum test_result_uninstall fi -elif [ "$distro" == "opensuse" ] || [ "$distro" == "sles" ] ; then - if [ "$2" == "install" ] ; then +elif [[ "$distro" == "opensuse" || "$distro" == "sles" ]]; then + if [[ "$2" == "install" ]]; then install_wget_zypper download_sdk_package_rpm - + determine_aspnet_version_install_rpm download_aspnet_package_rpm determine_runtime_aspnet_install_rpm determine_runtime_sdk_install_rpm - + checkout_new_folder runtime_version="$runtime_aspnet" download_runtime_packages_rpm install_runtime_deps_package_zypper - - if [ "$runtime_aspnet" != "$runtime_sdk" ] ; then + + if [ "$runtime_aspnet" != "$runtime_sdk" ]; then runtime_version="$runtime_sdk" download_runtime_packages_rpm install_runtime_deps_package_zypper @@ -376,30 +375,30 @@ elif [ "$distro" == "opensuse" ] || [ "$distro" == "sles" ] ; then dotnet --list-runtimes dotnet --list-sdks - + run_app test_result_install - elif [ "$2" == "uninstall" ] ; then - uninstall_latest_sdk_warning + elif [[ "$2" == "uninstall" ]]; then + uninstall_latest_sdk_warning check_if_sdk_is_installed_rpm - + determine_runtime_sdk_uninstall_rpm determine_aspnet_package_name_uninstall_rpm determine_runtime_aspnet_uninstall_rpm - + echo $runtime_sdk echo $runtime_aspnet fi - if [ "$3" == "uninstall" ] && [ $sucess_install -eq 1 ] || [ "$2" == "uninstall" ] ; then + if [[ "$3" == "uninstall" && "$sucess_install" == 1 || "$2" == "uninstall" ]]; then uninstall_dotnet_zypper test_result_uninstall - fi + fi fi -if [ -e $log_file ] ; then +if [ -e $log_file ]; then ch=$(printf "%-160s" "-") echo "${ch// /-} " fi diff --git a/src/installer/tests/scripts/linux-test/VerificationTestOnDocker.sh b/src/installer/tests/scripts/linux-test/VerificationTestOnDocker.sh index a71d4c93627e25..b62d729a5b7f70 100644 --- a/src/installer/tests/scripts/linux-test/VerificationTestOnDocker.sh +++ b/src/installer/tests/scripts/linux-test/VerificationTestOnDocker.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash InstallationTestResult="result.txt" InstallationTestLogFile="logfile.txt" @@ -10,14 +10,14 @@ if [ $current_user != "root" ]; then exit 1 fi -if [ -e $InstallationTestLogFile ] ; then +if [ -e $InstallationTestLogFile ]; then rm $InstallationTestLogFile -f fi -if [ "$1" == "sdk" ] ; then +if [[ "$1" == "sdk" ]]; then InstallationScript="SdkInstallation.sh" echo -e ".NET SDK verification test result\n" > $InstallationTestResult -elif [ "$1" == "runtime" ] ; then +elif [[ "$1" == "runtime" ]]; then InstallationScript="RuntimeInstallation.sh" echo -e ".NET Runtime verification test result\n" > $InstallationTestResult fi @@ -25,6 +25,6 @@ fi while IFS='' read -r image || [[ -n "$image" ]]; do echo $image docker run --rm -v $(pwd):/docker -t $image /bin/bash /docker/$InstallationScript $2 $3 $4 -done <$ImagesFile +done <$ImagesFile cat $InstallationTestResult >> $InstallationTestLogFile diff --git a/src/libraries/Common/src/Extensions/ProviderAliasUtilities/ProviderAliasUtilities.cs b/src/libraries/Common/src/Extensions/ProviderAliasUtilities/ProviderAliasUtilities.cs index 69e7687e62665f..2afb3a5710209b 100644 --- a/src/libraries/Common/src/Extensions/ProviderAliasUtilities/ProviderAliasUtilities.cs +++ b/src/libraries/Common/src/Extensions/ProviderAliasUtilities/ProviderAliasUtilities.cs @@ -10,7 +10,7 @@ namespace Microsoft.Extensions.Logging { internal static class ProviderAliasUtilities { - private const string AliasAttibuteTypeFullName = "Microsoft.Extensions.Logging.ProviderAliasAttribute"; + private const string AliasAttributeTypeFullName = "Microsoft.Extensions.Logging.ProviderAliasAttribute"; internal static string GetAlias(Type providerType) { @@ -19,7 +19,7 @@ internal static string GetAlias(Type providerType) for (int i = 0; i < attributes.Count; i++) { CustomAttributeData attributeData = attributes[i]; - if (attributeData.AttributeType.FullName == AliasAttibuteTypeFullName && + if (attributeData.AttributeType.FullName == AliasAttributeTypeFullName && attributeData.ConstructorArguments.Count > 0) { CustomAttributeTypedArgument arg = attributeData.ConstructorArguments[0]; diff --git a/src/libraries/Common/src/Internal/Cryptography/HashProvider.cs b/src/libraries/Common/src/Internal/Cryptography/HashProvider.cs index cc47097a9b2992..97814426e84f6d 100644 --- a/src/libraries/Common/src/Internal/Cryptography/HashProvider.cs +++ b/src/libraries/Common/src/Internal/Cryptography/HashProvider.cs @@ -20,7 +20,7 @@ public void AppendHashData(byte[] data, int offset, int count) // an invalid number of bytes read. Since our implementations of AppendHashDataCore // end up using unsafe code, we want to be sure the arguments are valid. if (data == null) - throw new ArgumentNullException(nameof(data), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(data)); if (offset < 0) throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum); if (count < 0) diff --git a/src/libraries/Common/src/Internal/Cryptography/Helpers.cs b/src/libraries/Common/src/Internal/Cryptography/Helpers.cs index 25c826cc8fddc5..cb8733886d27e1 100644 --- a/src/libraries/Common/src/Internal/Cryptography/Helpers.cs +++ b/src/libraries/Common/src/Internal/Cryptography/Helpers.cs @@ -10,6 +10,22 @@ namespace Internal.Cryptography { internal static partial class Helpers { + [UnsupportedOSPlatformGuard("browser")] + internal static bool HasSymmetricEncryption { get; } = +#if NET5_0_OR_GREATER + !OperatingSystem.IsBrowser(); +#else + true; +#endif + + [UnsupportedOSPlatformGuard("browser")] + internal static bool HasHMAC { get; } = +#if NET5_0_OR_GREATER + !OperatingSystem.IsBrowser(); +#else + true; +#endif + #if NET5_0_OR_GREATER [UnsupportedOSPlatformGuard("ios")] [UnsupportedOSPlatformGuard("tvos")] @@ -20,6 +36,7 @@ internal static partial class Helpers #if NET5_0_OR_GREATER [UnsupportedOSPlatformGuard("android")] + [UnsupportedOSPlatformGuard("browser")] public static bool IsRC2Supported => !OperatingSystem.IsAndroid(); #else public static bool IsRC2Supported => true; diff --git a/src/libraries/Common/src/Internal/Cryptography/PemKeyImportHelpers.cs b/src/libraries/Common/src/Internal/Cryptography/PemKeyHelpers.cs similarity index 65% rename from src/libraries/Common/src/Internal/Cryptography/PemKeyImportHelpers.cs rename to src/libraries/Common/src/Internal/Cryptography/PemKeyHelpers.cs index 27e4db1f817a4f..21432c2ae2e620 100644 --- a/src/libraries/Common/src/Internal/Cryptography/PemKeyImportHelpers.cs +++ b/src/libraries/Common/src/Internal/Cryptography/PemKeyHelpers.cs @@ -7,8 +7,106 @@ namespace Internal.Cryptography { - internal static class PemKeyImportHelpers + internal static class PemKeyHelpers { + public delegate bool TryExportKeyAction(T arg, Span destination, out int bytesWritten); + public delegate bool TryExportEncryptedKeyAction( + T arg, + ReadOnlySpan password, + PbeParameters pbeParameters, + Span destination, + out int bytesWritten); + + public static unsafe bool TryExportToEncryptedPem( + T arg, + ReadOnlySpan password, + PbeParameters pbeParameters, + TryExportEncryptedKeyAction exporter, + Span destination, + out int charsWritten) + { + int bufferSize = 4096; + + while (true) + { + byte[] buffer = CryptoPool.Rent(bufferSize); + int bytesWritten = 0; + bufferSize = buffer.Length; + + // Fixed to prevent GC moves. + fixed (byte* bufferPtr = buffer) + { + try + { + if (exporter(arg, password, pbeParameters, buffer, out bytesWritten)) + { + Span writtenSpan = new Span(buffer, 0, bytesWritten); + return PemEncoding.TryWrite(PemLabels.EncryptedPkcs8PrivateKey, writtenSpan, destination, out charsWritten); + } + } + finally + { + CryptoPool.Return(buffer, bytesWritten); + } + + bufferSize = checked(bufferSize * 2); + } + } + } + + public static unsafe bool TryExportToPem( + T arg, + string label, + TryExportKeyAction exporter, + Span destination, + out int charsWritten) + { + int bufferSize = 4096; + + while (true) + { + byte[] buffer = CryptoPool.Rent(bufferSize); + int bytesWritten = 0; + bufferSize = buffer.Length; + + // Fixed to prevent GC moves. + fixed (byte* bufferPtr = buffer) + { + try + { + if (exporter(arg, buffer, out bytesWritten)) + { + Span writtenSpan = new Span(buffer, 0, bytesWritten); + return PemEncoding.TryWrite(label, writtenSpan, destination, out charsWritten); + } + } + finally + { + CryptoPool.Return(buffer, bytesWritten); + } + + bufferSize = checked(bufferSize * 2); + } + } + } + + internal static string CreatePemFromData(string label, ReadOnlyMemory data) + { + int pemSize = PemEncoding.GetEncodedSize(label.Length, data.Length); + + return string.Create(pemSize, (label, data), static (destination, args) => + { + (string label, ReadOnlyMemory data) = args; + + if (!PemEncoding.TryWrite(label, data.Span, destination, out int charsWritten) || + charsWritten != destination.Length) + { + Debug.Fail("Pre-allocated buffer was not the correct size."); + throw new CryptographicException(); + } + }); + } + public delegate void ImportKeyAction(ReadOnlySpan source, out int bytesRead); public delegate ImportKeyAction? FindImportActionFunc(ReadOnlySpan label); public delegate void ImportEncryptedKeyAction( diff --git a/src/libraries/Common/src/Internal/Cryptography/UniversalCryptoTransform.cs b/src/libraries/Common/src/Internal/Cryptography/UniversalCryptoTransform.cs index a3a22165c6cebc..bd12894e5156cd 100644 --- a/src/libraries/Common/src/Internal/Cryptography/UniversalCryptoTransform.cs +++ b/src/libraries/Common/src/Internal/Cryptography/UniversalCryptoTransform.cs @@ -78,13 +78,13 @@ public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, b if (inputCount % InputBlockSize != 0) throw new ArgumentOutOfRangeException(nameof(inputCount), SR.Cryptography_MustTransformWholeBlock); if (inputCount > inputBuffer.Length - inputOffset) - throw new ArgumentOutOfRangeException(nameof(inputCount), SR.Cryptography_TransformBeyondEndOfBuffer); + throw new ArgumentOutOfRangeException(nameof(inputCount), SR.Argument_InvalidOffLen); if (outputBuffer == null) throw new ArgumentNullException(nameof(outputBuffer)); if (outputOffset > outputBuffer.Length) throw new ArgumentOutOfRangeException(nameof(outputOffset)); if (inputCount > outputBuffer.Length - outputOffset) - throw new ArgumentOutOfRangeException(nameof(outputOffset), SR.Cryptography_TransformBeyondEndOfBuffer); + throw new ArgumentOutOfRangeException(nameof(outputOffset), SR.Argument_InvalidOffLen); int numBytesWritten = UncheckedTransformBlock(inputBuffer, inputOffset, inputCount, outputBuffer, outputOffset); Debug.Assert(numBytesWritten >= 0 && numBytesWritten <= inputCount); @@ -102,7 +102,7 @@ public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int input if (inputOffset > inputBuffer.Length) throw new ArgumentOutOfRangeException(nameof(inputOffset)); if (inputCount > inputBuffer.Length - inputOffset) - throw new ArgumentOutOfRangeException(nameof(inputCount), SR.Cryptography_TransformBeyondEndOfBuffer); + throw new ArgumentOutOfRangeException(nameof(inputCount), SR.Argument_InvalidOffLen); byte[] output = UncheckedTransformFinalBlock(inputBuffer, inputOffset, inputCount); return output; diff --git a/src/libraries/Common/src/Interop/Android/Interop.JObjectLifetime.cs b/src/libraries/Common/src/Interop/Android/Interop.JObjectLifetime.cs index 77a8f42da866d1..6dc8dee6c26e90 100644 --- a/src/libraries/Common/src/Interop/Android/Interop.JObjectLifetime.cs +++ b/src/libraries/Common/src/Interop/Android/Interop.JObjectLifetime.cs @@ -10,11 +10,11 @@ internal static partial class Interop { internal static partial class JObjectLifetime { - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_NewGlobalReference")] - internal static extern IntPtr NewGlobalReference(IntPtr obj); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_NewGlobalReference")] + internal static partial IntPtr NewGlobalReference(IntPtr obj); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DeleteGlobalReference")] - internal static extern void DeleteGlobalReference(IntPtr obj); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DeleteGlobalReference")] + internal static partial void DeleteGlobalReference(IntPtr obj); internal class SafeJObjectHandle : SafeHandle { diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Bignum.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Bignum.cs index 42caf771e436df..3bbc00aab0a8b9 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Bignum.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Bignum.cs @@ -10,11 +10,11 @@ internal static partial class Interop // TODO: [AndroidCrypto] Rename class to AndroidCrypto once all consumers are split in Android vs. Unix internal static partial class Crypto { - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_BigNumToBinary")] - private static extern unsafe int BigNumToBinary(SafeBignumHandle a, byte* to); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_BigNumToBinary")] + private static unsafe partial int BigNumToBinary(SafeBignumHandle a, byte* to); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetBigNumBytes")] - private static extern int GetBigNumBytes(SafeBignumHandle a); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetBigNumBytes")] + private static partial int GetBigNumBytes(SafeBignumHandle a); internal static unsafe byte[]? ExtractBignum(SafeBignumHandle? bignum, int targetSize) { diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Cipher.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Cipher.cs index 42020d9217b9a6..39c980bdfab125 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Cipher.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Cipher.cs @@ -10,21 +10,21 @@ internal static partial class Interop { internal static partial class Crypto { - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCreate")] - internal static extern SafeEvpCipherCtxHandle EvpCipherCreate( + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCreate")] + internal static partial SafeEvpCipherCtxHandle EvpCipherCreate( IntPtr cipher, ref byte key, int keyLength, ref byte iv, int enc); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCreatePartial")] - internal static extern SafeEvpCipherCtxHandle EvpCipherCreatePartial( + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCreatePartial")] + internal static partial SafeEvpCipherCtxHandle EvpCipherCreatePartial( IntPtr cipher); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetKeyAndIV")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetKeyAndIV")] [return: MarshalAs(UnmanagedType.Bool)] - private static extern bool EvpCipherSetKeyAndIV( + private static partial bool EvpCipherSetKeyAndIV( SafeEvpCipherCtxHandle ctx, ref byte key, ref byte iv, @@ -46,9 +46,9 @@ ref MemoryMarshal.GetReference(iv), } } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetNonceLength")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetNonceLength")] [return: MarshalAs(UnmanagedType.Bool)] - private static extern bool AndroidCryptoNative_CipherSetNonceLength( + private static partial bool AndroidCryptoNative_CipherSetNonceLength( SafeEvpCipherCtxHandle ctx, int nonceLength); internal static void CipherSetNonceLength(SafeEvpCipherCtxHandle ctx, int nonceLength) @@ -59,20 +59,20 @@ internal static void CipherSetNonceLength(SafeEvpCipherCtxHandle ctx, int nonceL } } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherDestroy")] - internal static extern void EvpCipherDestroy(IntPtr ctx); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherDestroy")] + internal static partial void EvpCipherDestroy(IntPtr ctx); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherReset")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherReset")] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool EvpCipherReset(SafeEvpCipherCtxHandle ctx); + internal static partial bool EvpCipherReset(SafeEvpCipherCtxHandle ctx); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCtxSetPadding")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherCtxSetPadding")] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool EvpCipherCtxSetPadding(SafeEvpCipherCtxHandle x, int padding); + internal static partial bool EvpCipherCtxSetPadding(SafeEvpCipherCtxHandle x, int padding); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherUpdate")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherUpdate")] [return: MarshalAs(UnmanagedType.Bool)] - private static extern bool EvpCipherUpdate( + private static partial bool EvpCipherUpdate( SafeEvpCipherCtxHandle ctx, ref byte @out, out int outl, @@ -93,9 +93,9 @@ ref MemoryMarshal.GetReference(input), input.Length); } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherUpdateAAD")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherUpdateAAD")] [return: MarshalAs(UnmanagedType.Bool)] - private static extern bool CipherUpdateAAD( + private static partial bool CipherUpdateAAD( SafeEvpCipherCtxHandle ctx, ref byte @in, int inl); @@ -113,9 +113,9 @@ ref MemoryMarshal.GetReference(input), } } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherFinalEx")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherFinalEx")] [return: MarshalAs(UnmanagedType.Bool)] - private static extern bool EvpCipherFinalEx( + private static partial bool EvpCipherFinalEx( SafeEvpCipherCtxHandle ctx, ref byte outm, out int outl); @@ -128,99 +128,99 @@ internal static bool EvpCipherFinalEx( return EvpCipherFinalEx(ctx, ref MemoryMarshal.GetReference(output), out bytesWritten); } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetTagLength")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherSetTagLength")] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool CipherSetTagLength( + internal static partial bool CipherSetTagLength( SafeEvpCipherCtxHandle ctx, int tagLength); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherIsSupported")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_CipherIsSupported")] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool CipherIsSupported(IntPtr cipher); + internal static partial bool CipherIsSupported(IntPtr cipher); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Ecb")] - internal static extern IntPtr EvpAes128Ecb(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Ecb")] + internal static partial IntPtr EvpAes128Ecb(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cbc")] - internal static extern IntPtr EvpAes128Cbc(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cbc")] + internal static partial IntPtr EvpAes128Cbc(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Gcm")] - internal static extern IntPtr EvpAes128Gcm(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Gcm")] + internal static partial IntPtr EvpAes128Gcm(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cfb8")] - internal static extern IntPtr EvpAes128Cfb8(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cfb8")] + internal static partial IntPtr EvpAes128Cfb8(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cfb128")] - internal static extern IntPtr EvpAes128Cfb128(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Cfb128")] + internal static partial IntPtr EvpAes128Cfb128(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Ccm")] - internal static extern IntPtr EvpAes128Ccm(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes128Ccm")] + internal static partial IntPtr EvpAes128Ccm(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Ecb")] - internal static extern IntPtr EvpAes192Ecb(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Ecb")] + internal static partial IntPtr EvpAes192Ecb(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cbc")] - internal static extern IntPtr EvpAes192Cbc(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cbc")] + internal static partial IntPtr EvpAes192Cbc(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Gcm")] - internal static extern IntPtr EvpAes192Gcm(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Gcm")] + internal static partial IntPtr EvpAes192Gcm(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cfb8")] - internal static extern IntPtr EvpAes192Cfb8(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cfb8")] + internal static partial IntPtr EvpAes192Cfb8(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cfb128")] - internal static extern IntPtr EvpAes192Cfb128(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Cfb128")] + internal static partial IntPtr EvpAes192Cfb128(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Ccm")] - internal static extern IntPtr EvpAes192Ccm(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes192Ccm")] + internal static partial IntPtr EvpAes192Ccm(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Ecb")] - internal static extern IntPtr EvpAes256Ecb(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Ecb")] + internal static partial IntPtr EvpAes256Ecb(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cbc")] - internal static extern IntPtr EvpAes256Cbc(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cbc")] + internal static partial IntPtr EvpAes256Cbc(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Gcm")] - internal static extern IntPtr EvpAes256Gcm(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Gcm")] + internal static partial IntPtr EvpAes256Gcm(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cfb128")] - internal static extern IntPtr EvpAes256Cfb128(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cfb128")] + internal static partial IntPtr EvpAes256Cfb128(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cfb8")] - internal static extern IntPtr EvpAes256Cfb8(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Cfb8")] + internal static partial IntPtr EvpAes256Cfb8(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Ccm")] - internal static extern IntPtr EvpAes256Ccm(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Aes256Ccm")] + internal static partial IntPtr EvpAes256Ccm(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesCbc")] - internal static extern IntPtr EvpDesCbc(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesCbc")] + internal static partial IntPtr EvpDesCbc(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesEcb")] - internal static extern IntPtr EvpDesEcb(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesEcb")] + internal static partial IntPtr EvpDesEcb(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesCfb8")] - internal static extern IntPtr EvpDesCfb8(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DesCfb8")] + internal static partial IntPtr EvpDesCfb8(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cbc")] - internal static extern IntPtr EvpDes3Cbc(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cbc")] + internal static partial IntPtr EvpDes3Cbc(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Ecb")] - internal static extern IntPtr EvpDes3Ecb(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Ecb")] + internal static partial IntPtr EvpDes3Ecb(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cfb8")] - internal static extern IntPtr EvpDes3Cfb8(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cfb8")] + internal static partial IntPtr EvpDes3Cfb8(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cfb64")] - internal static extern IntPtr EvpDes3Cfb64(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_Des3Cfb64")] + internal static partial IntPtr EvpDes3Cfb64(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RC2Cbc")] - internal static extern IntPtr EvpRC2Cbc(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RC2Cbc")] + internal static partial IntPtr EvpRC2Cbc(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RC2Ecb")] - internal static extern IntPtr EvpRC2Ecb(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RC2Ecb")] + internal static partial IntPtr EvpRC2Ecb(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_ChaCha20Poly1305")] - internal static extern IntPtr EvpChaCha20Poly1305(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_ChaCha20Poly1305")] + internal static partial IntPtr EvpChaCha20Poly1305(); internal enum EvpCipherDirection : int { diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Dsa.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Dsa.cs index 95a90cb092b99b..623b69772d6aa0 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Dsa.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Dsa.cs @@ -11,12 +11,12 @@ internal static partial class Interop { internal static partial class AndroidCrypto { - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaGenerateKey")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaGenerateKey")] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool DsaGenerateKey(out SafeDsaHandle dsa, int bits); + internal static partial bool DsaGenerateKey(out SafeDsaHandle dsa, int bits); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSizeSignature")] - private static extern int DsaSizeSignature(SafeDsaHandle dsa); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSizeSignature")] + private static partial int DsaSizeSignature(SafeDsaHandle dsa); /// /// Return the maximum size of the DER-encoded key in bytes. @@ -27,8 +27,8 @@ internal static int DsaEncodedSignatureSize(SafeDsaHandle dsa) return size; } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSignatureFieldSize")] - private static extern int AndroidCryptoNative_DsaSignatureFieldSize(SafeDsaHandle dsa); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSignatureFieldSize")] + private static partial int AndroidCryptoNative_DsaSignatureFieldSize(SafeDsaHandle dsa); /// /// Return the size of the 'r' or 's' signature fields in bytes. @@ -41,8 +41,8 @@ internal static int DsaSignatureFieldSize(SafeDsaHandle dsa) return size; } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSizeP")] - private static extern int DsaSizeP(SafeDsaHandle dsa); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSizeP")] + private static partial int DsaSizeP(SafeDsaHandle dsa); /// /// Return the size of the key in bytes. @@ -59,9 +59,9 @@ internal static int DsaKeySize(SafeDsaHandle dsa) internal static bool DsaSign(SafeDsaHandle dsa, ReadOnlySpan hash, Span refSignature, out int outSignatureLength) => DsaSign(dsa, ref MemoryMarshal.GetReference(hash), hash.Length, ref MemoryMarshal.GetReference(refSignature), out outSignatureLength); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSign")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaSign")] [return: MarshalAs(UnmanagedType.Bool)] - private static extern bool DsaSign(SafeDsaHandle dsa, ref byte hash, int hashLength, ref byte refSignature, out int outSignatureLength); + private static partial bool DsaSign(SafeDsaHandle dsa, ref byte hash, int hashLength, ref byte refSignature, out int outSignatureLength); internal static bool DsaVerify(SafeDsaHandle dsa, ReadOnlySpan hash, ReadOnlySpan signature) { @@ -80,8 +80,8 @@ ref MemoryMarshal.GetReference(signature), return ret == 1; } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaVerify")] - private static extern int DsaVerify(SafeDsaHandle dsa, ref byte hash, int hashLength, ref byte signature, int signatureLength); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaVerify")] + private static partial int DsaVerify(SafeDsaHandle dsa, ref byte hash, int hashLength, ref byte signature, int signatureLength); internal static DSAParameters ExportDsaParameters(SafeDsaHandle key, bool includePrivateParameters) { @@ -141,9 +141,9 @@ internal static DSAParameters ExportDsaParameters(SafeDsaHandle key, bool includ } } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetDsaParameters")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetDsaParameters")] [return: MarshalAs(UnmanagedType.Bool)] - private static extern bool GetDsaParameters( + private static partial bool GetDsaParameters( SafeDsaHandle key, out SafeBignumHandle p, out int p_cb, out SafeBignumHandle q, out int q_cb, @@ -151,9 +151,9 @@ private static extern bool GetDsaParameters( out SafeBignumHandle y, out int y_cb, out SafeBignumHandle x, out int x_cb); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaKeyCreateByExplicitParameters")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DsaKeyCreateByExplicitParameters")] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool DsaKeyCreateByExplicitParameters( + internal static partial bool DsaKeyCreateByExplicitParameters( out SafeDsaHandle dsa, byte[] p, int pLength, diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcDsa.ImportExport.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcDsa.ImportExport.cs index 0395a10764ed50..0a309400e001b0 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcDsa.ImportExport.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcDsa.ImportExport.cs @@ -10,8 +10,8 @@ internal static partial class Interop { internal static partial class AndroidCrypto { - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByKeyParameters", CharSet = CharSet.Ansi)] - private static extern int EcKeyCreateByKeyParameters( + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByKeyParameters", CharSet = CharSet.Ansi)] + private static partial int EcKeyCreateByKeyParameters( out SafeEcKeyHandle key, string oid, byte[]? qx, int qxLength, @@ -35,8 +35,8 @@ internal static SafeEcKeyHandle EcKeyCreateByKeyParameters( return key; } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByExplicitParameters")] - internal static extern SafeEcKeyHandle EcKeyCreateByExplicitParameters( + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByExplicitParameters")] + internal static partial SafeEcKeyHandle EcKeyCreateByExplicitParameters( ECCurve.ECCurveType curveType, byte[]? qx, int qxLength, byte[]? qy, int qyLength, @@ -91,8 +91,8 @@ internal static SafeEcKeyHandle EcKeyCreateByExplicitCurve(ECCurve curve) } - [DllImport(Libraries.AndroidCryptoNative)] - private static extern int AndroidCryptoNative_GetECKeyParameters( + [GeneratedDllImport(Libraries.AndroidCryptoNative)] + private static partial int AndroidCryptoNative_GetECKeyParameters( SafeEcKeyHandle key, bool includePrivate, out SafeBignumHandle qx_bn, out int x_cb, @@ -149,8 +149,8 @@ internal static ECParameters GetECKeyParameters( return parameters; } - [DllImport(Libraries.AndroidCryptoNative)] - private static extern int AndroidCryptoNative_GetECCurveParameters( + [GeneratedDllImport(Libraries.AndroidCryptoNative)] + private static partial int AndroidCryptoNative_GetECCurveParameters( SafeEcKeyHandle key, bool includePrivate, out ECCurve.ECCurveType curveType, diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcDsa.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcDsa.cs index 53e0dcdddf8202..e81681e958ac84 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcDsa.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcDsa.cs @@ -12,9 +12,9 @@ internal static partial class AndroidCrypto internal static bool EcDsaSign(ReadOnlySpan dgst, Span sig, out int siglen, SafeEcKeyHandle ecKey) => EcDsaSign(ref MemoryMarshal.GetReference(dgst), dgst.Length, ref MemoryMarshal.GetReference(sig), out siglen, ecKey); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaSign")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaSign")] [return: MarshalAs(UnmanagedType.Bool)] - private static extern bool EcDsaSign(ref byte dgst, int dlen, ref byte sig, out int siglen, SafeEcKeyHandle ecKey); + private static partial bool EcDsaSign(ref byte dgst, int dlen, ref byte sig, out int siglen, SafeEcKeyHandle ecKey); internal static int EcDsaVerify(ReadOnlySpan dgst, ReadOnlySpan sigbuf, SafeEcKeyHandle ecKey) { @@ -34,12 +34,12 @@ ref MemoryMarshal.GetReference(sigbuf), * 0: incorrect signature * -1: error */ - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaVerify")] - private static extern int EcDsaVerify(ref byte dgst, int dgst_len, ref byte sigbuf, int sig_len, SafeEcKeyHandle ecKey); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaVerify")] + private static partial int EcDsaVerify(ref byte dgst, int dgst_len, ref byte sigbuf, int sig_len, SafeEcKeyHandle ecKey); // returns the maximum length of a DER encoded ECDSA signature created with this key. - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaSize")] - private static extern int AndroidCryptoNative_EcDsaSize(SafeEcKeyHandle ecKey); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcDsaSize")] + private static partial int AndroidCryptoNative_EcDsaSize(SafeEcKeyHandle ecKey); internal static int EcDsaSize(SafeEcKeyHandle ecKey) { diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcKey.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcKey.cs index a905d489ea2b43..ca8d82680d1b1e 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcKey.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.EcKey.cs @@ -10,8 +10,8 @@ internal static partial class Interop { internal static partial class AndroidCrypto { - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByOid")] - private static extern SafeEcKeyHandle AndroidCryptoNative_EcKeyCreateByOid(string oid); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyCreateByOid", CharSet = CharSet.Ansi)] + private static partial SafeEcKeyHandle AndroidCryptoNative_EcKeyCreateByOid(string oid); internal static SafeEcKeyHandle? EcKeyCreateByOid(string oid) { SafeEcKeyHandle handle = AndroidCryptoNative_EcKeyCreateByOid(oid); @@ -19,15 +19,15 @@ internal static partial class AndroidCrypto return handle; } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyDestroy")] - internal static extern void EcKeyDestroy(IntPtr a); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyDestroy")] + internal static partial void EcKeyDestroy(IntPtr a); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyUpRef")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyUpRef")] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool EcKeyUpRef(IntPtr r); + internal static partial bool EcKeyUpRef(IntPtr r); - [DllImport(Libraries.AndroidCryptoNative)] - private static extern int AndroidCryptoNative_EcKeyGetSize(SafeEcKeyHandle ecKey, out int keySize); + [GeneratedDllImport(Libraries.AndroidCryptoNative)] + private static partial int AndroidCryptoNative_EcKeyGetSize(SafeEcKeyHandle ecKey, out int keySize); internal static int EcKeyGetSize(SafeEcKeyHandle key) { int keySize; @@ -39,8 +39,8 @@ internal static int EcKeyGetSize(SafeEcKeyHandle key) throw new CryptographicException(); } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyGetCurveName")] - private static extern int AndroidCryptoNative_EcKeyGetCurveName(SafeEcKeyHandle ecKey, out IntPtr curveName); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcKeyGetCurveName")] + private static partial int AndroidCryptoNative_EcKeyGetCurveName(SafeEcKeyHandle ecKey, out IntPtr curveName); internal static string? EcKeyGetCurveName(SafeEcKeyHandle key) { diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ecdh.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ecdh.cs index 4ea8ddbc5fabeb..c5bbd4c9abebd3 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ecdh.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ecdh.cs @@ -13,8 +13,8 @@ internal static partial class AndroidCrypto internal static bool EcdhDeriveKey(SafeEcKeyHandle ourKey, SafeEcKeyHandle peerKey, Span buffer, out int usedBuffer) => EcdhDeriveKey(ourKey, peerKey, ref MemoryMarshal.GetReference(buffer), buffer.Length, out usedBuffer); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcdhDeriveKey")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_EcdhDeriveKey")] [return: MarshalAs(UnmanagedType.Bool)] - private static extern bool EcdhDeriveKey(SafeEcKeyHandle ourKey, SafeEcKeyHandle peerKey, ref byte buffer, int bufferLength, out int usedBuffer); + private static partial bool EcdhDeriveKey(SafeEcKeyHandle ourKey, SafeEcKeyHandle peerKey, ref byte buffer, int bufferLength, out int usedBuffer); } } diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Err.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Err.cs index 86259a717ddc01..96d983bf701416 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Err.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Err.cs @@ -10,23 +10,23 @@ internal static partial class Interop { internal static partial class Crypto { - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrClearError")] - internal static extern ulong ErrClearError(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrClearError")] + internal static partial ulong ErrClearError(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrGetErrorAlloc")] - private static extern ulong ErrGetErrorAlloc([MarshalAs(UnmanagedType.Bool)] out bool isAllocFailure); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrGetErrorAlloc")] + private static partial ulong ErrGetErrorAlloc([MarshalAs(UnmanagedType.Bool)] out bool isAllocFailure); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrPeekError")] - internal static extern ulong ErrPeekError(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrPeekError")] + internal static partial ulong ErrPeekError(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrPeekLastError")] - internal static extern ulong ErrPeekLastError(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrPeekLastError")] + internal static partial ulong ErrPeekLastError(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrReasonErrorString")] - internal static extern IntPtr ErrReasonErrorString(ulong error); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrReasonErrorString")] + internal static partial IntPtr ErrReasonErrorString(ulong error); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrErrorStringN")] - private static extern unsafe void ErrErrorStringN(ulong e, byte* buf, int len); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_ErrErrorStringN")] + private static unsafe partial void ErrErrorStringN(ulong e, byte* buf, int len); private static unsafe string ErrErrorStringN(ulong error) { diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Evp.DigestAlgs.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Evp.DigestAlgs.cs index 03906d6378f6dc..b233af7d4dcc44 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Evp.DigestAlgs.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Evp.DigestAlgs.cs @@ -15,32 +15,32 @@ internal static partial class Crypto private static volatile IntPtr s_evpSha384; private static volatile IntPtr s_evpSha512; - [DllImport(Libraries.AndroidCryptoNative)] - private static extern IntPtr CryptoNative_EvpMd5(); + [GeneratedDllImport(Libraries.AndroidCryptoNative)] + private static partial IntPtr CryptoNative_EvpMd5(); internal static IntPtr EvpMd5() => s_evpMd5 != IntPtr.Zero ? s_evpMd5 : (s_evpMd5 = CryptoNative_EvpMd5()); - [DllImport(Libraries.AndroidCryptoNative)] - internal static extern IntPtr CryptoNative_EvpSha1(); + [GeneratedDllImport(Libraries.AndroidCryptoNative)] + internal static partial IntPtr CryptoNative_EvpSha1(); internal static IntPtr EvpSha1() => s_evpSha1 != IntPtr.Zero ? s_evpSha1 : (s_evpSha1 = CryptoNative_EvpSha1()); - [DllImport(Libraries.AndroidCryptoNative)] - internal static extern IntPtr CryptoNative_EvpSha256(); + [GeneratedDllImport(Libraries.AndroidCryptoNative)] + internal static partial IntPtr CryptoNative_EvpSha256(); internal static IntPtr EvpSha256() => s_evpSha256 != IntPtr.Zero ? s_evpSha256 : (s_evpSha256 = CryptoNative_EvpSha256()); - [DllImport(Libraries.AndroidCryptoNative)] - internal static extern IntPtr CryptoNative_EvpSha384(); + [GeneratedDllImport(Libraries.AndroidCryptoNative)] + internal static partial IntPtr CryptoNative_EvpSha384(); internal static IntPtr EvpSha384() => s_evpSha384 != IntPtr.Zero ? s_evpSha384 : (s_evpSha384 = CryptoNative_EvpSha384()); - [DllImport(Libraries.AndroidCryptoNative)] - internal static extern IntPtr CryptoNative_EvpSha512(); + [GeneratedDllImport(Libraries.AndroidCryptoNative)] + internal static partial IntPtr CryptoNative_EvpSha512(); internal static IntPtr EvpSha512() => s_evpSha512 != IntPtr.Zero ? s_evpSha512 : (s_evpSha512 = CryptoNative_EvpSha512()); diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Evp.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Evp.cs index 393f1bd7ba59de..251f5bfc22042b 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Evp.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Evp.cs @@ -10,38 +10,38 @@ internal static partial class Interop { internal static partial class Crypto { - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdCtxCreate")] - internal static extern SafeEvpMdCtxHandle EvpMdCtxCreate(IntPtr type); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdCtxCreate")] + internal static partial SafeEvpMdCtxHandle EvpMdCtxCreate(IntPtr type); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdCtxDestroy")] - internal static extern void EvpMdCtxDestroy(IntPtr ctx); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdCtxDestroy")] + internal static partial void EvpMdCtxDestroy(IntPtr ctx); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestReset")] - internal static extern int EvpDigestReset(SafeEvpMdCtxHandle ctx, IntPtr type); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestReset")] + internal static partial int EvpDigestReset(SafeEvpMdCtxHandle ctx, IntPtr type); internal static int EvpDigestUpdate(SafeEvpMdCtxHandle ctx, ReadOnlySpan d, int cnt) => EvpDigestUpdate(ctx, ref MemoryMarshal.GetReference(d), cnt); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestUpdate")] - private static extern int EvpDigestUpdate(SafeEvpMdCtxHandle ctx, ref byte d, int cnt); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestUpdate")] + private static partial int EvpDigestUpdate(SafeEvpMdCtxHandle ctx, ref byte d, int cnt); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestFinalEx")] - internal static extern int EvpDigestFinalEx(SafeEvpMdCtxHandle ctx, ref byte md, ref uint s); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestFinalEx")] + internal static partial int EvpDigestFinalEx(SafeEvpMdCtxHandle ctx, ref byte md, ref uint s); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestCurrent")] - internal static extern int EvpDigestCurrent(SafeEvpMdCtxHandle ctx, ref byte md, ref uint s); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestCurrent")] + internal static partial int EvpDigestCurrent(SafeEvpMdCtxHandle ctx, ref byte md, ref uint s); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestOneShot")] - internal static unsafe extern int EvpDigestOneShot(IntPtr type, byte* source, int sourceSize, byte* md, uint* mdSize); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestOneShot")] + internal static unsafe partial int EvpDigestOneShot(IntPtr type, byte* source, int sourceSize, byte* md, uint* mdSize); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdSize")] - internal static extern int EvpMdSize(IntPtr md); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdSize")] + internal static partial int EvpMdSize(IntPtr md); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_GetMaxMdSize")] - private static extern int GetMaxMdSize(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_GetMaxMdSize")] + private static partial int GetMaxMdSize(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_Pbkdf2")] - private static unsafe extern int Pbkdf2( + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_Pbkdf2")] + private static unsafe partial int Pbkdf2( byte* pPassword, int passwordLength, byte* pSalt, diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Hmac.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Hmac.cs index 38ed53453b6760..6f9cfefbff4add 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Hmac.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Hmac.cs @@ -10,29 +10,29 @@ internal static partial class Interop { internal static partial class Crypto { - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacCreate")] - internal static extern SafeHmacCtxHandle HmacCreate(ref byte key, int keyLen, IntPtr md); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacCreate")] + internal static partial SafeHmacCtxHandle HmacCreate(ref byte key, int keyLen, IntPtr md); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacDestroy")] - internal static extern void HmacDestroy(IntPtr ctx); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacDestroy")] + internal static partial void HmacDestroy(IntPtr ctx); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacReset")] - internal static extern int HmacReset(SafeHmacCtxHandle ctx); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacReset")] + internal static partial int HmacReset(SafeHmacCtxHandle ctx); internal static int HmacUpdate(SafeHmacCtxHandle ctx, ReadOnlySpan data, int len) => HmacUpdate(ctx, ref MemoryMarshal.GetReference(data), len); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacUpdate")] - private static extern int HmacUpdate(SafeHmacCtxHandle ctx, ref byte data, int len); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacUpdate")] + private static partial int HmacUpdate(SafeHmacCtxHandle ctx, ref byte data, int len); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacFinal")] - internal static extern int HmacFinal(SafeHmacCtxHandle ctx, ref byte data, ref int len); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacFinal")] + internal static partial int HmacFinal(SafeHmacCtxHandle ctx, ref byte data, ref int len); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacCurrent")] - internal static extern int HmacCurrent(SafeHmacCtxHandle ctx, ref byte data, ref int len); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacCurrent")] + internal static partial int HmacCurrent(SafeHmacCtxHandle ctx, ref byte data, ref int len); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacOneShot")] - private static unsafe extern int HmacOneShot(IntPtr type, byte* key, int keySize, byte* source, int sourceSize, byte* md, ref int mdSize); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacOneShot")] + private static unsafe partial int HmacOneShot(IntPtr type, byte* key, int keySize, byte* source, int sourceSize, byte* md, ref int mdSize); internal static unsafe int HmacOneShot(IntPtr type, ReadOnlySpan key, ReadOnlySpan source, Span destination) { diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Initialization.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Initialization.cs index b55f361f6666ab..9585bafbc576c4 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Initialization.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Initialization.cs @@ -27,7 +27,7 @@ static OpenSsl() } } - internal static class CryptoInitializer + internal static partial class CryptoInitializer { static CryptoInitializer() { @@ -48,7 +48,7 @@ internal static void Initialize() // No-op that exists to provide a hook for other static constructors. } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EnsureOpenSslInitialized")] - private static extern int EnsureOpenSslInitialized(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EnsureOpenSslInitialized")] + private static partial int EnsureOpenSslInitialized(); } } diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Random.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Random.cs index 964d844f20fa0c..fa8e5ff3711b16 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Random.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Random.cs @@ -15,8 +15,8 @@ internal static unsafe bool GetRandomBytes(byte* pbBuffer, int count) return CryptoNative_GetRandomBytes(pbBuffer, count); } - [DllImport(Libraries.AndroidCryptoNative)] + [GeneratedDllImport(Libraries.AndroidCryptoNative)] [return: MarshalAs(UnmanagedType.Bool)] - private static extern unsafe bool CryptoNative_GetRandomBytes(byte* buf, int num); + private static unsafe partial bool CryptoNative_GetRandomBytes(byte* buf, int num); } } diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Rsa.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Rsa.cs index 8d501ecbf24932..2623cbcdcee137 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Rsa.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Rsa.cs @@ -11,21 +11,21 @@ internal static partial class Interop { internal static partial class AndroidCrypto { - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaCreate")] - internal static extern SafeRsaHandle RsaCreate(); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaCreate")] + internal static partial SafeRsaHandle RsaCreate(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaUpRef")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaUpRef")] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool RsaUpRef(IntPtr rsa); + internal static partial bool RsaUpRef(IntPtr rsa); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaDestroy")] - internal static extern void RsaDestroy(IntPtr rsa); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaDestroy")] + internal static partial void RsaDestroy(IntPtr rsa); internal static SafeRsaHandle DecodeRsaSubjectPublicKeyInfo(ReadOnlySpan buf) => DecodeRsaSubjectPublicKeyInfo(ref MemoryMarshal.GetReference(buf), buf.Length); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo")] - private static extern SafeRsaHandle DecodeRsaSubjectPublicKeyInfo(ref byte buf, int len); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo")] + private static partial SafeRsaHandle DecodeRsaSubjectPublicKeyInfo(ref byte buf, int len); internal static int RsaPublicEncrypt( int flen, @@ -35,8 +35,8 @@ internal static int RsaPublicEncrypt( RsaPadding padding) => RsaPublicEncrypt(flen, ref MemoryMarshal.GetReference(from), ref MemoryMarshal.GetReference(to), rsa, padding); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaPublicEncrypt")] - private static extern int RsaPublicEncrypt( + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaPublicEncrypt")] + private static partial int RsaPublicEncrypt( int flen, ref byte from, ref byte to, @@ -51,8 +51,8 @@ internal static int RsaPrivateDecrypt( RsaPadding padding) => RsaPrivateDecrypt(flen, ref MemoryMarshal.GetReference(from), ref MemoryMarshal.GetReference(to), rsa, padding); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaPrivateDecrypt")] - private static extern int RsaPrivateDecrypt( + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaPrivateDecrypt")] + private static partial int RsaPrivateDecrypt( int flen, ref byte from, ref byte to, @@ -65,8 +65,8 @@ internal static int RsaSignPrimitive( SafeRsaHandle rsa) => RsaSignPrimitive(from.Length, ref MemoryMarshal.GetReference(from), ref MemoryMarshal.GetReference(to), rsa); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaSignPrimitive")] - private static extern int RsaSignPrimitive( + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaSignPrimitive")] + private static partial int RsaSignPrimitive( int flen, ref byte from, ref byte to, @@ -78,18 +78,18 @@ internal static int RsaVerificationPrimitive( SafeRsaHandle rsa) => RsaVerificationPrimitive(from.Length, ref MemoryMarshal.GetReference(from), ref MemoryMarshal.GetReference(to), rsa); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaVerificationPrimitive")] - private static extern int RsaVerificationPrimitive( + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaVerificationPrimitive")] + private static partial int RsaVerificationPrimitive( int flen, ref byte from, ref byte to, SafeRsaHandle rsa); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaSize")] - internal static extern int RsaSize(SafeRsaHandle rsa); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaSize")] + internal static partial int RsaSize(SafeRsaHandle rsa); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaGenerateKeyEx")] - internal static extern int RsaGenerateKeyEx(SafeRsaHandle rsa, int bits); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_RsaGenerateKeyEx")] + internal static partial int RsaGenerateKeyEx(SafeRsaHandle rsa, int bits); internal static RSAParameters ExportRsaParameters(SafeRsaHandle key, bool includePrivateParameters) { @@ -159,9 +159,9 @@ internal static RSAParameters ExportRsaParameters(SafeRsaHandle key, bool includ } } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetRsaParameters")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_GetRsaParameters")] [return: MarshalAs(UnmanagedType.Bool)] - private static extern bool GetRsaParameters( + private static partial bool GetRsaParameters( SafeRsaHandle key, out SafeBignumHandle n, out SafeBignumHandle e, @@ -172,9 +172,9 @@ private static extern bool GetRsaParameters( out SafeBignumHandle dmq1, out SafeBignumHandle iqmp); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SetRsaParameters")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SetRsaParameters")] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool SetRsaParameters( + internal static partial bool SetRsaParameters( SafeRsaHandle key, byte[]? n, int nLength, diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.ProtocolSupport.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.ProtocolSupport.cs index 29efbe7b040b26..f0f7356bbe9f38 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.ProtocolSupport.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.ProtocolSupport.cs @@ -8,11 +8,11 @@ internal static partial class Interop { internal static partial class AndroidCrypto { - [DllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLGetSupportedProtocols")] - internal static extern SslProtocols SSLGetSupportedProtocols(); + [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLGetSupportedProtocols")] + internal static partial SslProtocols SSLGetSupportedProtocols(); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration")] [return:MarshalAs(UnmanagedType.U1)] - internal static extern bool SSLSupportsApplicationProtocolsConfiguration(); + internal static partial bool SSLSupportsApplicationProtocolsConfiguration(); } } diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.cs index 6f0c53bac516c6..f1200eabdd2a7c 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.cs @@ -31,11 +31,11 @@ internal enum PAL_SSLStreamStatus Closed = 4, }; - [DllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamCreate")] - internal static extern SafeSslHandle SSLStreamCreate(); + [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamCreate")] + internal static partial SafeSslHandle SSLStreamCreate(); - [DllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamCreateWithCertificates")] - private static extern SafeSslHandle SSLStreamCreateWithCertificates( + [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamCreateWithCertificates")] + private static partial SafeSslHandle SSLStreamCreateWithCertificates( ref byte pkcs8PrivateKey, int pkcs8PrivateKeyLen, PAL_KeyAlgorithm algorithm, @@ -51,8 +51,8 @@ ref MemoryMarshal.GetReference(pkcs8PrivateKey), certificates.Length); } - [DllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamInitialize")] - private static extern int SSLStreamInitializeImpl( + [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamInitialize")] + private static partial int SSLStreamInitializeImpl( SafeSslHandle sslHandle, [MarshalAs(UnmanagedType.U1)] bool isServer, SSLReadCallback streamRead, @@ -70,8 +70,8 @@ internal static void SSLStreamInitialize( throw new SslException(); } - [DllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetTargetHost")] - private static extern int SSLStreamSetTargetHostImpl( + [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetTargetHost")] + private static partial int SSLStreamSetTargetHostImpl( SafeSslHandle sslHandle, [MarshalAs(UnmanagedType.LPUTF8Str)] string targetHost); internal static void SSLStreamSetTargetHost( @@ -85,8 +85,8 @@ internal static void SSLStreamSetTargetHost( throw new SslException(); } - [DllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRequestClientAuthentication")] - internal static extern void SSLStreamRequestClientAuthentication(SafeSslHandle sslHandle); + [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRequestClientAuthentication")] + internal static partial void SSLStreamRequestClientAuthentication(SafeSslHandle sslHandle); [StructLayout(LayoutKind.Sequential)] private unsafe struct ApplicationProtocolData @@ -95,8 +95,8 @@ private unsafe struct ApplicationProtocolData public int Length; } - [DllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetApplicationProtocols")] - private static unsafe extern int SSLStreamSetApplicationProtocols(SafeSslHandle sslHandle, ApplicationProtocolData[] protocolData, int count); + [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetApplicationProtocols")] + private static unsafe partial int SSLStreamSetApplicationProtocols(SafeSslHandle sslHandle, ApplicationProtocolData[] protocolData, int count); internal static unsafe void SSLStreamSetApplicationProtocols(SafeSslHandle sslHandle, List protocols) { int count = protocols.Count; @@ -129,8 +129,8 @@ internal static unsafe void SSLStreamSetApplicationProtocols(SafeSslHandle sslHa } } - [DllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetEnabledProtocols")] - private static extern int SSLStreamSetEnabledProtocols(SafeSslHandle sslHandle, ref SslProtocols protocols, int length); + [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamSetEnabledProtocols")] + private static partial int SSLStreamSetEnabledProtocols(SafeSslHandle sslHandle, ref SslProtocols protocols, int length); internal static void SSLStreamSetEnabledProtocols(SafeSslHandle sslHandle, ReadOnlySpan protocols) { int ret = SSLStreamSetEnabledProtocols(sslHandle, ref MemoryMarshal.GetReference(protocols), protocols.Length); @@ -138,11 +138,11 @@ internal static void SSLStreamSetEnabledProtocols(SafeSslHandle sslHandle, ReadO throw new SslException(); } - [DllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamHandshake")] - internal static extern PAL_SSLStreamStatus SSLStreamHandshake(SafeSslHandle sslHandle); + [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamHandshake")] + internal static partial PAL_SSLStreamStatus SSLStreamHandshake(SafeSslHandle sslHandle); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetApplicationProtocol")] - private static extern int SSLStreamGetApplicationProtocol(SafeSslHandle ssl, [Out] byte[]? buf, ref int len); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetApplicationProtocol")] + private static partial int SSLStreamGetApplicationProtocol(SafeSslHandle ssl, byte[]? buf, ref int len); internal static byte[]? SSLStreamGetApplicationProtocol(SafeSslHandle ssl) { int len = 0; @@ -158,8 +158,8 @@ internal static void SSLStreamSetEnabledProtocols(SafeSslHandle sslHandle, ReadO return bytes; } - [DllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRead")] - private static unsafe extern PAL_SSLStreamStatus SSLStreamRead( + [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRead")] + private static unsafe partial PAL_SSLStreamStatus SSLStreamRead( SafeSslHandle sslHandle, byte* buffer, int length, @@ -175,8 +175,8 @@ internal static unsafe PAL_SSLStreamStatus SSLStreamRead( } } - [DllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamWrite")] - private static unsafe extern PAL_SSLStreamStatus SSLStreamWrite( + [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamWrite")] + private static unsafe partial PAL_SSLStreamStatus SSLStreamWrite( SafeSslHandle sslHandle, byte* buffer, int length); @@ -190,8 +190,8 @@ internal static unsafe PAL_SSLStreamStatus SSLStreamWrite( } } - [DllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRelease")] - internal static extern void SSLStreamRelease(IntPtr ptr); + [GeneratedDllImport(Interop.Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRelease")] + internal static partial void SSLStreamRelease(IntPtr ptr); internal sealed class SslException : Exception { @@ -205,8 +205,8 @@ internal SslException(int errorCode) } } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetProtocol")] - private static extern int SSLStreamGetProtocol(SafeSslHandle ssl, out IntPtr protocol); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetProtocol")] + private static partial int SSLStreamGetProtocol(SafeSslHandle ssl, out IntPtr protocol); internal static string SSLStreamGetProtocol(SafeSslHandle ssl) { IntPtr protocolPtr; @@ -222,11 +222,11 @@ internal static string SSLStreamGetProtocol(SafeSslHandle ssl) return protocol; } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetPeerCertificate")] - internal static extern SafeX509Handle SSLStreamGetPeerCertificate(SafeSslHandle ssl); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetPeerCertificate")] + internal static partial SafeX509Handle SSLStreamGetPeerCertificate(SafeSslHandle ssl); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetPeerCertificates")] - private static extern void SSLStreamGetPeerCertificates( + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetPeerCertificates")] + private static partial void SSLStreamGetPeerCertificates( SafeSslHandle ssl, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] out IntPtr[] certs, out int count); @@ -238,8 +238,8 @@ private static extern void SSLStreamGetPeerCertificates( return ptrs; } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetCipherSuite")] - private static extern int SSLStreamGetCipherSuite(SafeSslHandle ssl, out IntPtr cipherSuite); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamGetCipherSuite")] + private static partial int SSLStreamGetCipherSuite(SafeSslHandle ssl, out IntPtr cipherSuite); internal static string SSLStreamGetCipherSuite(SafeSslHandle ssl) { IntPtr cipherSuitePtr; @@ -255,13 +255,13 @@ internal static string SSLStreamGetCipherSuite(SafeSslHandle ssl) return cipherSuite; } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamShutdown")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamShutdown")] [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool SSLStreamShutdown(SafeSslHandle ssl); + internal static partial bool SSLStreamShutdown(SafeSslHandle ssl); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamVerifyHostname")] + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamVerifyHostname")] [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool SSLStreamVerifyHostname( + internal static partial bool SSLStreamVerifyHostname( SafeSslHandle ssl, [MarshalAs(UnmanagedType.LPUTF8Str)] string hostname); } diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.X509.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.X509.cs index 5c3f986eb314d3..ee0bf3c7e552e7 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.X509.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.X509.cs @@ -13,11 +13,11 @@ internal static partial class AndroidCrypto private const int INSUFFICIENT_BUFFER = -1; private const int SUCCESS = 1; - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509Decode")] - internal static extern SafeX509Handle X509Decode(ref byte buf, int len); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509Decode")] + internal static partial SafeX509Handle X509Decode(ref byte buf, int len); - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509Encode")] - private static extern int X509Encode(SafeX509Handle x, [Out] byte[]? buf, ref int len); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509Encode")] + private static partial int X509Encode(SafeX509Handle x, byte[]? buf, ref int len); internal static byte[] X509Encode(SafeX509Handle x) { int len = 0; @@ -33,8 +33,8 @@ internal static byte[] X509Encode(SafeX509Handle x) return encoded; } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509DecodeCollection")] - private static extern int X509DecodeCollection(ref byte buf, int bufLen, IntPtr[]? ptrs, ref int handlesLen); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509DecodeCollection")] + private static partial int X509DecodeCollection(ref byte buf, int bufLen, IntPtr[]? ptrs, ref int handlesLen); internal static SafeX509Handle[] X509DecodeCollection(ReadOnlySpan data) { ref byte buf = ref MemoryMarshal.GetReference(data); @@ -60,8 +60,8 @@ internal static SafeX509Handle[] X509DecodeCollection(ReadOnlySpan data) return handles; } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ExportPkcs7")] - private static extern int X509ExportPkcs7(IntPtr[] certs, int certsLen, [Out] byte[]? buf, ref int len); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509ExportPkcs7")] + private static partial int X509ExportPkcs7(IntPtr[] certs, int certsLen, byte[]? buf, ref int len); internal static byte[] X509ExportPkcs7(IntPtr[] certHandles) { int len = 0; @@ -77,8 +77,8 @@ internal static byte[] X509ExportPkcs7(IntPtr[] certHandles) return encoded; } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509GetContentType")] - private static extern X509ContentType X509GetContentType(ref byte buf, int len); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509GetContentType")] + private static partial X509ContentType X509GetContentType(ref byte buf, int len); internal static X509ContentType X509GetContentType(ReadOnlySpan data) { return X509GetContentType(ref MemoryMarshal.GetReference(data), data.Length); @@ -92,8 +92,8 @@ internal enum PAL_KeyAlgorithm UnknownAlgorithm = -1, } - [DllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509PublicKey")] - internal static extern IntPtr X509GetPublicKey(SafeX509Handle x, PAL_KeyAlgorithm algorithm); + [GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "AndroidCryptoNative_X509PublicKey")] + internal static partial IntPtr X509GetPublicKey(SafeX509Handle x, PAL_KeyAlgorithm algorithm); } } diff --git a/src/libraries/Common/src/Interop/BSD/System.Native/Interop.ProtocolStatistics.cs b/src/libraries/Common/src/Interop/BSD/System.Native/Interop.ProtocolStatistics.cs index 476b7a653edb12..b7548f7138514a 100644 --- a/src/libraries/Common/src/Interop/BSD/System.Native/Interop.ProtocolStatistics.cs +++ b/src/libraries/Common/src/Interop/BSD/System.Native/Interop.ProtocolStatistics.cs @@ -33,8 +33,8 @@ public readonly struct TcpGlobalStatistics private readonly int __padding; } - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTcpGlobalStatistics")] - public static unsafe extern int GetTcpGlobalStatistics(TcpGlobalStatistics* statistics); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTcpGlobalStatistics")] + public static unsafe partial int GetTcpGlobalStatistics(TcpGlobalStatistics* statistics); [StructLayoutAttribute(LayoutKind.Sequential)] public readonly struct IPv4GlobalStatistics @@ -55,8 +55,8 @@ public readonly struct IPv4GlobalStatistics public readonly int Forwarding; } - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4GlobalStatistics")] - public static unsafe extern int GetIPv4GlobalStatistics(IPv4GlobalStatistics* statistics); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4GlobalStatistics")] + public static unsafe partial int GetIPv4GlobalStatistics(IPv4GlobalStatistics* statistics); [StructLayoutAttribute(LayoutKind.Sequential)] public readonly struct UdpGlobalStatistics @@ -68,8 +68,8 @@ public readonly struct UdpGlobalStatistics public readonly ulong UdpListeners; } - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUdpGlobalStatistics")] - public static unsafe extern int GetUdpGlobalStatistics(UdpGlobalStatistics* statistics); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUdpGlobalStatistics")] + public static unsafe partial int GetUdpGlobalStatistics(UdpGlobalStatistics* statistics); [StructLayoutAttribute(LayoutKind.Sequential)] public readonly struct Icmpv4GlobalStatistics @@ -98,8 +98,8 @@ public readonly struct Icmpv4GlobalStatistics public readonly ulong TimestampRequestsSent; } - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIcmpv4GlobalStatistics")] - public static unsafe extern int GetIcmpv4GlobalStatistics(Icmpv4GlobalStatistics* statistics); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIcmpv4GlobalStatistics")] + public static unsafe partial int GetIcmpv4GlobalStatistics(Icmpv4GlobalStatistics* statistics); [StructLayoutAttribute(LayoutKind.Sequential)] public readonly struct Icmpv6GlobalStatistics @@ -134,8 +134,8 @@ public readonly struct Icmpv6GlobalStatistics public readonly ulong TimeExceededMessagesSent; } - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIcmpv6GlobalStatistics")] - public static unsafe extern int GetIcmpv6GlobalStatistics(Icmpv6GlobalStatistics* statistics); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIcmpv6GlobalStatistics")] + public static unsafe partial int GetIcmpv6GlobalStatistics(Icmpv6GlobalStatistics* statistics); public readonly struct NativeIPInterfaceStatistics { @@ -158,7 +158,7 @@ public readonly struct NativeIPInterfaceStatistics [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNativeIPInterfaceStatistics", CharSet = CharSet.Ansi)] public static partial int GetNativeIPInterfaceStatistics(string name, out NativeIPInterfaceStatistics stats); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNumRoutes")] - public static extern int GetNumRoutes(); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNumRoutes")] + public static partial int GetNumRoutes(); } } diff --git a/src/libraries/Common/src/Interop/BSD/System.Native/Interop.TcpConnectionInfo.cs b/src/libraries/Common/src/Interop/BSD/System.Native/Interop.TcpConnectionInfo.cs index 3d48cd67060ae5..35a6b9dd5b5452 100644 --- a/src/libraries/Common/src/Interop/BSD/System.Native/Interop.TcpConnectionInfo.cs +++ b/src/libraries/Common/src/Interop/BSD/System.Native/Interop.TcpConnectionInfo.cs @@ -25,16 +25,16 @@ public struct NativeTcpConnectionInformation public TcpState State; } - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEstimatedTcpConnectionCount")] - public static extern int GetEstimatedTcpConnectionCount(); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEstimatedTcpConnectionCount")] + public static partial int GetEstimatedTcpConnectionCount(); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetActiveTcpConnectionInfos")] - public static extern unsafe int GetActiveTcpConnectionInfos(NativeTcpConnectionInformation* infos, int* infoCount); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetActiveTcpConnectionInfos")] + public static unsafe partial int GetActiveTcpConnectionInfos(NativeTcpConnectionInformation* infos, int* infoCount); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEstimatedUdpListenerCount")] - public static extern int GetEstimatedUdpListenerCount(); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEstimatedUdpListenerCount")] + public static partial int GetEstimatedUdpListenerCount(); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetActiveUdpListeners")] - public static extern unsafe int GetActiveUdpListeners(IPEndPointInfo* infos, int* infoCount); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetActiveUdpListeners")] + public static unsafe partial int GetActiveUdpListeners(IPEndPointInfo* infos, int* infoCount); } } diff --git a/src/libraries/Common/src/Interop/Interop.Brotli.cs b/src/libraries/Common/src/Interop/Interop.Brotli.cs index b84bd9939e3db8..0ebede8c938300 100644 --- a/src/libraries/Common/src/Interop/Interop.Brotli.cs +++ b/src/libraries/Common/src/Interop/Interop.Brotli.cs @@ -18,11 +18,11 @@ internal static unsafe partial int BrotliDecoderDecompressStream( SafeBrotliDecoderHandle state, ref nuint availableIn, byte** nextIn, ref nuint availableOut, byte** nextOut, out nuint totalOut); - [DllImport(Libraries.CompressionNative)] - internal static extern unsafe BOOL BrotliDecoderDecompress(nuint availableInput, byte* inBytes, nuint* availableOutput, byte* outBytes); + [GeneratedDllImport(Libraries.CompressionNative)] + internal static unsafe partial BOOL BrotliDecoderDecompress(nuint availableInput, byte* inBytes, nuint* availableOutput, byte* outBytes); - [DllImport(Libraries.CompressionNative)] - internal static extern void BrotliDecoderDestroyInstance(IntPtr state); + [GeneratedDllImport(Libraries.CompressionNative)] + internal static partial void BrotliDecoderDestroyInstance(IntPtr state); [GeneratedDllImport(Libraries.CompressionNative)] internal static partial BOOL BrotliDecoderIsFinished(SafeBrotliDecoderHandle state); @@ -41,10 +41,10 @@ internal static unsafe partial BOOL BrotliEncoderCompressStream( [GeneratedDllImport(Libraries.CompressionNative)] internal static partial BOOL BrotliEncoderHasMoreOutput(SafeBrotliEncoderHandle state); - [DllImport(Libraries.CompressionNative)] - internal static extern void BrotliEncoderDestroyInstance(IntPtr state); + [GeneratedDllImport(Libraries.CompressionNative)] + internal static partial void BrotliEncoderDestroyInstance(IntPtr state); - [DllImport(Libraries.CompressionNative)] - internal static extern unsafe BOOL BrotliEncoderCompress(int quality, int window, int v, nuint availableInput, byte* inBytes, nuint* availableOutput, byte* outBytes); + [GeneratedDllImport(Libraries.CompressionNative)] + internal static unsafe partial BOOL BrotliEncoderCompress(int quality, int window, int v, nuint availableInput, byte* inBytes, nuint* availableOutput, byte* outBytes); } } diff --git a/src/libraries/Common/src/Interop/Interop.Calendar.cs b/src/libraries/Common/src/Interop/Interop.Calendar.cs index 6befb033d68bc9..4cc06c7702d74b 100644 --- a/src/libraries/Common/src/Interop/Interop.Calendar.cs +++ b/src/libraries/Common/src/Interop/Interop.Calendar.cs @@ -9,19 +9,26 @@ internal static partial class Interop { internal static partial class Globalization { - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetCalendars")] - internal static extern int GetCalendars(string localeName, CalendarId[] calendars, int calendarsCapacity); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetCalendars", CharSet = CharSet.Unicode)] + internal static partial int GetCalendars(string localeName, CalendarId[] calendars, int calendarsCapacity); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetCalendarInfo")] - internal static extern unsafe ResultCode GetCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType calendarDataType, char* result, int resultCapacity); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetCalendarInfo", CharSet = CharSet.Unicode)] + internal static unsafe partial ResultCode GetCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType calendarDataType, char* result, int resultCapacity); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_EnumCalendarInfo")] - internal static extern unsafe bool EnumCalendarInfo(delegate* unmanaged callback, string localeName, CalendarId calendarId, CalendarDataType calendarDataType, IntPtr context); + internal static unsafe bool EnumCalendarInfo(delegate* unmanaged callback, string localeName, CalendarId calendarId, CalendarDataType calendarDataType, IntPtr context) + { + return EnumCalendarInfo((IntPtr)callback, localeName, calendarId, calendarDataType, context); + } - [DllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLatestJapaneseEra")] - internal static extern int GetLatestJapaneseEra(); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EnumCalendarInfo", CharSet = CharSet.Unicode)] + // We skip the following DllImport because of 'Parsing function pointer types in signatures is not supported.' for some targeted + // platforms (for example, WASM build). + private static unsafe partial bool EnumCalendarInfo(IntPtr callback, string localeName, CalendarId calendarId, CalendarDataType calendarDataType, IntPtr context); - [DllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetJapaneseEraStartDate")] - internal static extern bool GetJapaneseEraStartDate(int era, out int startYear, out int startMonth, out int startDay); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLatestJapaneseEra")] + internal static partial int GetLatestJapaneseEra(); + + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetJapaneseEraStartDate")] + internal static partial bool GetJapaneseEraStartDate(int era, out int startYear, out int startMonth, out int startDay); } } diff --git a/src/libraries/Common/src/Interop/Interop.Casing.cs b/src/libraries/Common/src/Interop/Interop.Casing.cs index f02aea3d2374c9..fcb77ec3bd63d6 100644 --- a/src/libraries/Common/src/Interop/Interop.Casing.cs +++ b/src/libraries/Common/src/Interop/Interop.Casing.cs @@ -7,16 +7,16 @@ internal static partial class Interop { internal static partial class Globalization { - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ChangeCase")] - internal static extern unsafe void ChangeCase(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCase", CharSet = CharSet.Unicode)] + internal static unsafe partial void ChangeCase(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ChangeCaseInvariant")] - internal static extern unsafe void ChangeCaseInvariant(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCaseInvariant", CharSet = CharSet.Unicode)] + internal static unsafe partial void ChangeCaseInvariant(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ChangeCaseTurkish")] - internal static extern unsafe void ChangeCaseTurkish(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCaseTurkish", CharSet = CharSet.Unicode)] + internal static unsafe partial void ChangeCaseTurkish(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_InitOrdinalCasingPage")] - internal static extern unsafe void InitOrdinalCasingPage(int pageNumber, char* pTarget); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_InitOrdinalCasingPage", CharSet = CharSet.Unicode)] + internal static unsafe partial void InitOrdinalCasingPage(int pageNumber, char* pTarget); } } diff --git a/src/libraries/Common/src/Interop/Interop.Collation.cs b/src/libraries/Common/src/Interop/Interop.Collation.cs index 89dfb5bcd98ecd..5b210bafb0de50 100644 --- a/src/libraries/Common/src/Interop/Interop.Collation.cs +++ b/src/libraries/Common/src/Interop/Interop.Collation.cs @@ -3,47 +3,50 @@ using System; using System.Globalization; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; internal static partial class Interop { internal static partial class Globalization { - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Ansi, EntryPoint = "GlobalizationNative_GetSortHandle")] - internal static extern unsafe ResultCode GetSortHandle(string localeName, out IntPtr sortHandle); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortHandle", CharSet = CharSet.Ansi)] + internal static unsafe partial ResultCode GetSortHandle(string localeName, out IntPtr sortHandle); - [DllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_CloseSortHandle")] - internal static extern void CloseSortHandle(IntPtr handle); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_CloseSortHandle")] + internal static partial void CloseSortHandle(IntPtr handle); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_CompareString")] - internal static extern unsafe int CompareString(IntPtr sortHandle, char* lpStr1, int cwStr1Len, char* lpStr2, int cwStr2Len, CompareOptions options); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_CompareString", CharSet = CharSet.Unicode)] + internal static unsafe partial int CompareString(IntPtr sortHandle, char* lpStr1, int cwStr1Len, char* lpStr2, int cwStr2Len, CompareOptions options); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_IndexOf")] - internal static extern unsafe int IndexOf(IntPtr sortHandle, char* target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options, int* matchLengthPtr); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IndexOf", CharSet = CharSet.Unicode)] + internal static unsafe partial int IndexOf(IntPtr sortHandle, char* target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options, int* matchLengthPtr); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_LastIndexOf")] - internal static extern unsafe int LastIndexOf(IntPtr sortHandle, char* target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options, int* matchLengthPtr); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LastIndexOf", CharSet = CharSet.Unicode)] + internal static unsafe partial int LastIndexOf(IntPtr sortHandle, char* target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options, int* matchLengthPtr); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_StartsWith")] + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_StartsWith", CharSet = CharSet.Unicode)] + [MethodImpl(MethodImplOptions.NoInlining)] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern unsafe bool StartsWith(IntPtr sortHandle, char* target, int cwTargetLength, char* source, int cwSourceLength, CompareOptions options, int* matchedLength); + internal static unsafe partial bool StartsWith(IntPtr sortHandle, char* target, int cwTargetLength, char* source, int cwSourceLength, CompareOptions options, int* matchedLength); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_EndsWith")] + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EndsWith", CharSet = CharSet.Unicode)] + [MethodImpl(MethodImplOptions.NoInlining)] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern unsafe bool EndsWith(IntPtr sortHandle, char* target, int cwTargetLength, char* source, int cwSourceLength, CompareOptions options, int* matchedLength); + internal static unsafe partial bool EndsWith(IntPtr sortHandle, char* target, int cwTargetLength, char* source, int cwSourceLength, CompareOptions options, int* matchedLength); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_StartsWith")] + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_StartsWith", CharSet = CharSet.Unicode)] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool StartsWith(IntPtr sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options); + internal static partial bool StartsWith(IntPtr sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_EndsWith")] + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EndsWith", CharSet = CharSet.Unicode)] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool EndsWith(IntPtr sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options); + internal static partial bool EndsWith(IntPtr sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetSortKey")] - internal static extern unsafe int GetSortKey(IntPtr sortHandle, char* str, int strLength, byte* sortKey, int sortKeyLength, CompareOptions options); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortKey", CharSet = CharSet.Unicode)] + internal static unsafe partial int GetSortKey(IntPtr sortHandle, char* str, int strLength, byte* sortKey, int sortKeyLength, CompareOptions options); - [DllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortVersion")] - internal static extern int GetSortVersion(IntPtr sortHandle); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortVersion")] + internal static partial int GetSortVersion(IntPtr sortHandle); } } diff --git a/src/libraries/Common/src/Interop/Interop.HostPolicy.cs b/src/libraries/Common/src/Interop/Interop.HostPolicy.cs index c7f62047f5b0cc..b5e3a2109f4ae8 100644 --- a/src/libraries/Common/src/Interop/Interop.HostPolicy.cs +++ b/src/libraries/Common/src/Interop/Interop.HostPolicy.cs @@ -6,7 +6,7 @@ internal static partial class Interop { - internal static class HostPolicy + internal static partial class HostPolicy { [UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Auto)] internal delegate void corehost_resolve_component_dependencies_result_fn(string assemblyPaths, @@ -15,11 +15,15 @@ internal delegate void corehost_resolve_component_dependencies_result_fn(string [UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Auto)] internal delegate void corehost_error_writer_fn(string message); - [DllImport(Libraries.HostPolicy, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)] - internal static extern int corehost_resolve_component_dependencies(string componentMainAssemblyPath, +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + [GeneratedDllImport(Libraries.HostPolicy, CharSet = CharSet.Auto)] + [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] + internal static partial int corehost_resolve_component_dependencies(string componentMainAssemblyPath, corehost_resolve_component_dependencies_result_fn result); - [DllImport(Libraries.HostPolicy, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)] - internal static extern IntPtr corehost_set_error_writer(IntPtr errorWriter); + [GeneratedDllImport(Libraries.HostPolicy, CharSet = CharSet.Auto)] + [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] + internal static partial IntPtr corehost_set_error_writer(IntPtr errorWriter); +#pragma warning restore CS3016 // Arrays as attribute arguments is not CLS-compliant } } diff --git a/src/libraries/Common/src/Interop/Interop.ICU.cs b/src/libraries/Common/src/Interop/Interop.ICU.cs index 957b201aa2222c..7aa5fba7ec2849 100644 --- a/src/libraries/Common/src/Interop/Interop.ICU.cs +++ b/src/libraries/Common/src/Interop/Interop.ICU.cs @@ -9,8 +9,8 @@ internal static partial class Interop { internal static partial class Globalization { - [DllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LoadICU")] - internal static extern int LoadICU(); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LoadICU")] + internal static partial int LoadICU(); internal static void InitICUFunctions(IntPtr icuuc, IntPtr icuin, ReadOnlySpan version, ReadOnlySpan suffix) { @@ -20,10 +20,10 @@ internal static void InitICUFunctions(IntPtr icuuc, IntPtr icuin, ReadOnlySpan 0 ? suffix.ToString() : null); } - [DllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_InitICUFunctions")] - internal static extern void InitICUFunctions(IntPtr icuuc, IntPtr icuin, string version, string? suffix); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_InitICUFunctions", CharSet = CharSet.Ansi)] + internal static partial void InitICUFunctions(IntPtr icuuc, IntPtr icuin, string version, string? suffix); - [DllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetICUVersion")] - internal static extern int GetICUVersion(); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetICUVersion")] + internal static partial int GetICUVersion(); } } diff --git a/src/libraries/Common/src/Interop/Interop.Idna.cs b/src/libraries/Common/src/Interop/Interop.Idna.cs index 0bc9b41dfd8cd6..7bac573f2942a1 100644 --- a/src/libraries/Common/src/Interop/Interop.Idna.cs +++ b/src/libraries/Common/src/Interop/Interop.Idna.cs @@ -10,10 +10,10 @@ internal static partial class Globalization internal const int AllowUnassigned = 0x1; internal const int UseStd3AsciiRules = 0x2; - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ToAscii")] - internal static extern unsafe int ToAscii(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ToAscii", CharSet = CharSet.Unicode)] + internal static unsafe partial int ToAscii(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ToUnicode")] - internal static extern unsafe int ToUnicode(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ToUnicode", CharSet = CharSet.Unicode)] + internal static unsafe partial int ToUnicode(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity); } } diff --git a/src/libraries/Common/src/Interop/Interop.Locale.cs b/src/libraries/Common/src/Interop/Interop.Locale.cs index 3a410c4e769535..a4b05dcc9bf706 100644 --- a/src/libraries/Common/src/Interop/Interop.Locale.cs +++ b/src/libraries/Common/src/Interop/Interop.Locale.cs @@ -7,35 +7,35 @@ internal static partial class Interop { internal static partial class Globalization { - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetLocaleName")] + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleName", CharSet = CharSet.Unicode)] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern unsafe bool GetLocaleName(string localeName, char* value, int valueLength); + internal static unsafe partial bool GetLocaleName(string localeName, char* value, int valueLength); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetLocaleInfoString")] + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoString", CharSet = CharSet.Unicode)] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern unsafe bool GetLocaleInfoString(string localeName, uint localeStringData, char* value, int valueLength, string? uiLocaleName = null); + internal static unsafe partial bool GetLocaleInfoString(string localeName, uint localeStringData, char* value, int valueLength, string? uiLocaleName = null); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetDefaultLocaleName")] + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetDefaultLocaleName", CharSet = CharSet.Unicode)] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern unsafe bool GetDefaultLocaleName(char* value, int valueLength); + internal static unsafe partial bool GetDefaultLocaleName(char* value, int valueLength); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_IsPredefinedLocale")] + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IsPredefinedLocale", CharSet = CharSet.Unicode)] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool IsPredefinedLocale(string localeName); + internal static partial bool IsPredefinedLocale(string localeName); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetLocaleTimeFormat")] + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleTimeFormat", CharSet = CharSet.Unicode)] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern unsafe bool GetLocaleTimeFormat(string localeName, bool shortFormat, char* value, int valueLength); + internal static unsafe partial bool GetLocaleTimeFormat(string localeName, bool shortFormat, char* value, int valueLength); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetLocaleInfoInt")] + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoInt", CharSet = CharSet.Unicode)] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool GetLocaleInfoInt(string localeName, uint localeNumberData, ref int value); + internal static partial bool GetLocaleInfoInt(string localeName, uint localeNumberData, ref int value); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetLocaleInfoGroupingSizes")] + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoGroupingSizes", CharSet = CharSet.Unicode)] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool GetLocaleInfoGroupingSizes(string localeName, uint localeGroupingData, ref int primaryGroupSize, ref int secondaryGroupSize); + internal static partial bool GetLocaleInfoGroupingSizes(string localeName, uint localeGroupingData, ref int primaryGroupSize, ref int secondaryGroupSize); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetLocales")] - internal static extern int GetLocales([Out] char[]? value, int valueLength); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocales", CharSet = CharSet.Unicode)] + internal static partial int GetLocales([Out] char[]? value, int valueLength); } } diff --git a/src/libraries/Common/src/Interop/Interop.Normalization.cs b/src/libraries/Common/src/Interop/Interop.Normalization.cs index 420e68c0e75a5e..0b240884514d96 100644 --- a/src/libraries/Common/src/Interop/Interop.Normalization.cs +++ b/src/libraries/Common/src/Interop/Interop.Normalization.cs @@ -8,10 +8,10 @@ internal static partial class Interop { internal static partial class Globalization { - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_IsNormalized")] - internal static extern unsafe int IsNormalized(NormalizationForm normalizationForm, char* src, int srcLen); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IsNormalized", CharSet = CharSet.Unicode)] + internal static unsafe partial int IsNormalized(NormalizationForm normalizationForm, char* src, int srcLen); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_NormalizeString")] - internal static extern unsafe int NormalizeString(NormalizationForm normalizationForm, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_NormalizeString", CharSet = CharSet.Unicode)] + internal static unsafe partial int NormalizeString(NormalizationForm normalizationForm, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity); } } diff --git a/src/libraries/Common/src/Interop/Interop.Odbc.cs b/src/libraries/Common/src/Interop/Interop.Odbc.cs index 4113c59e4fefb1..0b30095146989e 100644 --- a/src/libraries/Common/src/Interop/Interop.Odbc.cs +++ b/src/libraries/Common/src/Interop/Interop.Odbc.cs @@ -17,20 +17,20 @@ internal static partial class Odbc // // ODBC32 // - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLAllocHandle( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLAllocHandle( /*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType, /*SQLHANDLE*/IntPtr InputHandle, /*SQLHANDLE* */out IntPtr OutputHandle); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLAllocHandle( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLAllocHandle( /*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType, /*SQLHANDLE*/OdbcHandle InputHandle, /*SQLHANDLE* */out IntPtr OutputHandle); [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLBindCol( + internal static extern /*SQLRETURN*/ODBC32.SQLRETURN SQLBindCol( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLUSMALLINT*/ushort ColumnNumber, /*SQLSMALLINT*/ODBC32.SQL_C TargetType, @@ -38,8 +38,8 @@ internal static partial class Odbc /*SQLLEN*/IntPtr BufferLength, /*SQLLEN* */IntPtr StrLen_or_Ind); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLBindCol( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLBindCol( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLUSMALLINT*/ushort ColumnNumber, /*SQLSMALLINT*/ODBC32.SQL_C TargetType, @@ -48,7 +48,7 @@ internal static partial class Odbc /*SQLLEN* */IntPtr StrLen_or_Ind); [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLBindParameter( + internal static extern /*SQLRETURN*/ODBC32.SQLRETURN SQLBindParameter( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLUSMALLINT*/ushort ParameterNumber, /*SQLSMALLINT*/short ParamDirection, @@ -60,16 +60,16 @@ internal static partial class Odbc /*SQLLEN*/IntPtr BufferLength, /*SQLLEN* */HandleRef StrLen_or_Ind); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLCancel( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLCancel( /*SQLHSTMT*/OdbcStatementHandle StatementHandle); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLCloseCursor( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLCloseCursor( /*SQLHSTMT*/OdbcStatementHandle StatementHandle); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLColAttributeW( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLColAttributeW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLUSMALLINT*/short ColumnNumber, /*SQLUSMALLINT*/short FieldIdentifier, @@ -93,8 +93,8 @@ internal static partial class Odbc // SQLSMALLINT *StringLength, SQLPOINTER NumericAttribute); // #endif - [DllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLColumnsW( + [GeneratedDllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] + internal static partial ODBC32.SQLRETURN SQLColumnsW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLCHAR* */string CatalogName, /*SQLSMALLINT*/short NameLen1, @@ -105,12 +105,12 @@ internal static partial class Odbc /*SQLCHAR* */string ColumnName, /*SQLSMALLINT*/short NameLen4); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLDisconnect( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLDisconnect( /*SQLHDBC*/IntPtr ConnectionHandle); - [DllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLDriverConnectW( + [GeneratedDllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] + internal static partial ODBC32.SQLRETURN SQLDriverConnectW( /*SQLHDBC*/OdbcConnectionHandle hdbc, /*SQLHWND*/IntPtr hwnd, /*SQLCHAR* */string connectionstring, @@ -120,46 +120,46 @@ internal static partial class Odbc /*SQLSMALLINT* */out short cbConnectionstringout, /*SQLUSMALLINT*/short fDriverCompletion); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLEndTran( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLEndTran( /*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType, /*SQLHANDLE*/IntPtr Handle, /*SQLSMALLINT*/short CompletionType); - [DllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLExecDirectW( + [GeneratedDllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] + internal static partial ODBC32.SQLRETURN SQLExecDirectW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLCHAR* */string StatementText, /*SQLINTEGER*/int TextLength); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLExecute( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLExecute( /*SQLHSTMT*/OdbcStatementHandle StatementHandle); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLFetch( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLFetch( /*SQLHSTMT*/OdbcStatementHandle StatementHandle); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLFreeHandle( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLFreeHandle( /*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType, /*SQLHSTMT*/IntPtr StatementHandle); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLFreeStmt( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLFreeStmt( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLUSMALLINT*/ODBC32.STMT Option); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLGetConnectAttrW( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLGetConnectAttrW( /*SQLHBDC*/OdbcConnectionHandle ConnectionHandle, /*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, /*SQLPOINTER*/byte[] Value, /*SQLINTEGER*/int BufferLength, /*SQLINTEGER* */out int StringLength); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLGetData( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLGetData( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLUSMALLINT*/ushort ColumnNumber, /*SQLSMALLINT*/ODBC32.SQL_C TargetType, @@ -167,8 +167,8 @@ internal static partial class Odbc /*SQLLEN*/IntPtr BufferLength, // sql.h differs from MSDN /*SQLLEN* */out IntPtr StrLen_or_Ind); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLGetDescFieldW( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLGetDescFieldW( /*SQLHSTMT*/OdbcDescriptorHandle StatementHandle, /*SQLUSMALLINT*/short RecNumber, /*SQLUSMALLINT*/ODBC32.SQL_DESC FieldIdentifier, @@ -177,7 +177,7 @@ internal static partial class Odbc /*SQLINTEGER* */out int StringLength); [DllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLGetDiagRecW( + internal static extern /*SQLRETURN*/ODBC32.SQLRETURN SQLGetDiagRecW( /*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType, /*SQLHANDLE*/OdbcHandle Handle, /*SQLSMALLINT*/short RecNumber, @@ -188,7 +188,7 @@ internal static partial class Odbc /*SQLSMALLINT* */out short TextLength); [DllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLGetDiagFieldW( + internal static extern /*SQLRETURN*/ODBC32.SQLRETURN SQLGetDiagFieldW( /*SQLSMALLINT*/ ODBC32.SQL_HANDLE HandleType, /*SQLHANDLE*/ OdbcHandle Handle, /*SQLSMALLINT*/ short RecNumber, @@ -197,58 +197,58 @@ internal static partial class Odbc /*SQLSMALLINT*/ short BufferLength, /*SQLSMALLINT* */ out short StringLength); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLGetFunctions( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLGetFunctions( /*SQLHBDC*/OdbcConnectionHandle hdbc, /*SQLUSMALLINT*/ODBC32.SQL_API fFunction, /*SQLUSMALLINT* */out short pfExists); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLGetInfoW( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLGetInfoW( /*SQLHBDC*/OdbcConnectionHandle hdbc, /*SQLUSMALLINT*/ODBC32.SQL_INFO fInfoType, /*SQLPOINTER*/byte[] rgbInfoValue, /*SQLSMALLINT*/short cbInfoValueMax, /*SQLSMALLINT* */out short pcbInfoValue); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLGetInfoW( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLGetInfoW( /*SQLHBDC*/OdbcConnectionHandle hdbc, /*SQLUSMALLINT*/ODBC32.SQL_INFO fInfoType, /*SQLPOINTER*/byte[] rgbInfoValue, /*SQLSMALLINT*/short cbInfoValueMax, /*SQLSMALLINT* */IntPtr pcbInfoValue); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLGetStmtAttrW( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLGetStmtAttrW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, /*SQLPOINTER*/out IntPtr Value, /*SQLINTEGER*/int BufferLength, /*SQLINTEGER*/out int StringLength); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLGetTypeInfo( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLGetTypeInfo( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLSMALLINT*/short fSqlType); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLMoreResults( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLMoreResults( /*SQLHSTMT*/OdbcStatementHandle StatementHandle); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLNumResultCols( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLNumResultCols( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLSMALLINT* */out short ColumnCount); - [DllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLPrepareW( + [GeneratedDllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] + internal static partial ODBC32.SQLRETURN SQLPrepareW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLCHAR* */string StatementText, /*SQLINTEGER*/int TextLength); - [DllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLPrimaryKeysW( + [GeneratedDllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] + internal static partial ODBC32.SQLRETURN SQLPrimaryKeysW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLCHAR* */string? CatalogName, /*SQLSMALLINT*/short NameLen1, @@ -257,8 +257,8 @@ internal static partial class Odbc /*SQLCHAR* */string TableName, /*SQLSMALLINT*/short NameLen3); - [DllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLProcedureColumnsW( + [GeneratedDllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] + internal static partial ODBC32.SQLRETURN SQLProcedureColumnsW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLCHAR* */ string? CatalogName, /*SQLSMALLINT*/short NameLen1, @@ -269,8 +269,8 @@ internal static partial class Odbc /*SQLCHAR* */ string? ColumnName, /*SQLSMALLINT*/short NameLen4); - [DllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLProceduresW( + [GeneratedDllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] + internal static partial ODBC32.SQLRETURN SQLProceduresW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLCHAR* */ string CatalogName, /*SQLSMALLINT*/short NameLen1, @@ -279,72 +279,65 @@ internal static partial class Odbc /*SQLCHAR* */ string ProcName, /*SQLSMALLINT*/short NameLen3); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLRowCount( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLRowCount( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLLEN* */out IntPtr RowCount); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLSetConnectAttrW( - /*SQLHBDC*/OdbcConnectionHandle ConnectionHandle, - /*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, - /*SQLPOINTER*/System.Transactions.IDtcTransaction Value, - /*SQLINTEGER*/int StringLength); - - [DllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLSetConnectAttrW( + [GeneratedDllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] + internal static partial ODBC32.SQLRETURN SQLSetConnectAttrW( /*SQLHBDC*/OdbcConnectionHandle ConnectionHandle, /*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, /*SQLPOINTER*/string Value, /*SQLINTEGER*/int StringLength); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLSetConnectAttrW( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLSetConnectAttrW( /*SQLHBDC*/OdbcConnectionHandle ConnectionHandle, /*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, /*SQLPOINTER*/IntPtr Value, /*SQLINTEGER*/int StringLength); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLSetConnectAttrW( // used only for AutoCommitOn + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLSetConnectAttrW( // used only for AutoCommitOn /*SQLHBDC*/IntPtr ConnectionHandle, /*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, /*SQLPOINTER*/IntPtr Value, /*SQLINTEGER*/int StringLength); [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLSetDescFieldW( + internal static extern /*SQLRETURN*/ODBC32.SQLRETURN SQLSetDescFieldW( /*SQLHSTMT*/OdbcDescriptorHandle StatementHandle, /*SQLSMALLINT*/short ColumnNumber, /*SQLSMALLINT*/ODBC32.SQL_DESC FieldIdentifier, /*SQLPOINTER*/HandleRef CharacterAttribute, /*SQLINTEGER*/int BufferLength); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLSetDescFieldW( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLSetDescFieldW( /*SQLHSTMT*/OdbcDescriptorHandle StatementHandle, /*SQLSMALLINT*/short ColumnNumber, /*SQLSMALLINT*/ODBC32.SQL_DESC FieldIdentifier, /*SQLPOINTER*/IntPtr CharacterAttribute, /*SQLINTEGER*/int BufferLength); - [DllImport(Interop.Libraries.Odbc32)] + [GeneratedDllImport(Interop.Libraries.Odbc32)] // user can set SQL_ATTR_CONNECTION_POOLING attribute with envHandle = null, this attribute is process-level attribute - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLSetEnvAttr( + internal static partial ODBC32.SQLRETURN SQLSetEnvAttr( /*SQLHENV*/OdbcEnvironmentHandle EnvironmentHandle, /*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, /*SQLPOINTER*/IntPtr Value, /*SQLINTEGER*/ODBC32.SQL_IS StringLength); - [DllImport(Interop.Libraries.Odbc32)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLSetStmtAttrW( + [GeneratedDllImport(Interop.Libraries.Odbc32)] + internal static partial ODBC32.SQLRETURN SQLSetStmtAttrW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLINTEGER*/int Attribute, /*SQLPOINTER*/IntPtr Value, /*SQLINTEGER*/int StringLength); - [DllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLSpecialColumnsW( + [GeneratedDllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] + internal static partial ODBC32.SQLRETURN SQLSpecialColumnsW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLUSMALLINT*/ODBC32.SQL_SPECIALCOLS IdentifierType, /*SQLCHAR* */string? CatalogName, @@ -356,8 +349,8 @@ internal static partial class Odbc /*SQLUSMALLINT*/ODBC32.SQL_SCOPE Scope, /*SQLUSMALLINT*/ ODBC32.SQL_NULLABILITY Nullable); - [DllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLStatisticsW( + [GeneratedDllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] + internal static partial ODBC32.SQLRETURN SQLStatisticsW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLCHAR* */string? CatalogName, /*SQLSMALLINT*/short NameLen1, @@ -368,8 +361,8 @@ internal static partial class Odbc /*SQLUSMALLINT*/short Unique, /*SQLUSMALLINT*/short Reserved); - [DllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] - internal static extern /*SQLRETURN*/ODBC32.RetCode SQLTablesW( + [GeneratedDllImport(Interop.Libraries.Odbc32, CharSet = CharSet.Unicode)] + internal static partial ODBC32.SQLRETURN SQLTablesW( /*SQLHSTMT*/OdbcStatementHandle StatementHandle, /*SQLCHAR* */string CatalogName, /*SQLSMALLINT*/short NameLen1, diff --git a/src/libraries/Common/src/Interop/Interop.TimeZoneInfo.cs b/src/libraries/Common/src/Interop/Interop.TimeZoneInfo.cs index 72db59c74402c5..6d223046927dea 100644 --- a/src/libraries/Common/src/Interop/Interop.TimeZoneInfo.cs +++ b/src/libraries/Common/src/Interop/Interop.TimeZoneInfo.cs @@ -8,18 +8,18 @@ internal static partial class Interop { internal static partial class Globalization { - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetTimeZoneDisplayName")] - internal static extern unsafe ResultCode GetTimeZoneDisplayName( + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetTimeZoneDisplayName", CharSet = CharSet.Unicode)] + internal static unsafe partial ResultCode GetTimeZoneDisplayName( string localeName, string timeZoneId, TimeZoneDisplayNameType type, char* result, int resultLength); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_WindowsIdToIanaId")] - internal static extern unsafe int WindowsIdToIanaId(string windowsId, IntPtr region, char* ianaId, int ianaIdLength); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_WindowsIdToIanaId", CharSet = CharSet.Unicode)] + internal static unsafe partial int WindowsIdToIanaId(string windowsId, IntPtr region, char* ianaId, int ianaIdLength); - [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_IanaIdToWindowsId")] - internal static extern unsafe int IanaIdToWindowsId(string ianaId, char* windowsId, int windowsIdLength); + [GeneratedDllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IanaIdToWindowsId", CharSet = CharSet.Unicode)] + internal static unsafe partial int IanaIdToWindowsId(string ianaId, char* windowsId, int windowsIdLength); } } diff --git a/src/libraries/Common/src/Interop/Interop.zlib.cs b/src/libraries/Common/src/Interop/Interop.zlib.cs index 55678c46dca151..e0e2785cef4f74 100644 --- a/src/libraries/Common/src/Interop/Interop.zlib.cs +++ b/src/libraries/Common/src/Interop/Interop.zlib.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class zlib { - [DllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateInit2_")] - internal static extern unsafe ZLibNative.ErrorCode DeflateInit2_( + [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateInit2_")] + internal static unsafe partial ZLibNative.ErrorCode DeflateInit2_( ZLibNative.ZStream* stream, ZLibNative.CompressionLevel level, ZLibNative.CompressionMethod method, @@ -17,28 +17,28 @@ internal static extern unsafe ZLibNative.ErrorCode DeflateInit2_( int memLevel, ZLibNative.CompressionStrategy strategy); - [DllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Deflate")] - internal static extern unsafe ZLibNative.ErrorCode Deflate(ZLibNative.ZStream* stream, ZLibNative.FlushCode flush); + [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Deflate")] + internal static unsafe partial ZLibNative.ErrorCode Deflate(ZLibNative.ZStream* stream, ZLibNative.FlushCode flush); - [DllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateReset")] - internal static extern unsafe ZLibNative.ErrorCode DeflateReset(ZLibNative.ZStream* stream); + [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateReset")] + internal static unsafe partial ZLibNative.ErrorCode DeflateReset(ZLibNative.ZStream* stream); - [DllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateEnd")] - internal static extern unsafe ZLibNative.ErrorCode DeflateEnd(ZLibNative.ZStream* stream); + [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_DeflateEnd")] + internal static unsafe partial ZLibNative.ErrorCode DeflateEnd(ZLibNative.ZStream* stream); - [DllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateInit2_")] - internal static extern unsafe ZLibNative.ErrorCode InflateInit2_(ZLibNative.ZStream* stream, int windowBits); + [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateInit2_")] + internal static unsafe partial ZLibNative.ErrorCode InflateInit2_(ZLibNative.ZStream* stream, int windowBits); - [DllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Inflate")] - internal static extern unsafe ZLibNative.ErrorCode Inflate(ZLibNative.ZStream* stream, ZLibNative.FlushCode flush); + [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Inflate")] + internal static unsafe partial ZLibNative.ErrorCode Inflate(ZLibNative.ZStream* stream, ZLibNative.FlushCode flush); - [DllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateReset")] - internal static extern unsafe ZLibNative.ErrorCode InflateReset(ZLibNative.ZStream* stream); + [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateReset")] + internal static unsafe partial ZLibNative.ErrorCode InflateReset(ZLibNative.ZStream* stream); - [DllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateEnd")] - internal static extern unsafe ZLibNative.ErrorCode InflateEnd(ZLibNative.ZStream* stream); + [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_InflateEnd")] + internal static unsafe partial ZLibNative.ErrorCode InflateEnd(ZLibNative.ZStream* stream); - [DllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Crc32")] - internal static extern unsafe uint crc32(uint crc, byte* buffer, int len); + [GeneratedDllImport(Libraries.CompressionNative, EntryPoint = "CompressionNative_Crc32")] + internal static unsafe partial uint crc32(uint crc, byte* buffer, int len); } } diff --git a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFNumber.cs b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFNumber.cs index d01a5499a2ba0b..631aa86ce04c87 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFNumber.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFNumber.cs @@ -16,7 +16,7 @@ internal enum CFNumberType kCFNumberIntType = 9, } - [DllImport(Libraries.CoreFoundationLibrary)] - private static unsafe extern int CFNumberGetValue(IntPtr handle, CFNumberType type, int* value); + [GeneratedDllImport(Libraries.CoreFoundationLibrary)] + private static unsafe partial int CFNumberGetValue(IntPtr handle, CFNumberType type, int* value); } } diff --git a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.cs b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.cs index 11fe4891c4c99e..b5d64a92606edc 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.cs @@ -156,14 +156,14 @@ internal static SafeCreateHandle CFArrayCreate(IntPtr[] values, UIntPtr numValue /// /// The CFType object to retain. This value must not be NULL /// The input value - [DllImport(Interop.Libraries.CoreFoundationLibrary)] - internal static extern IntPtr CFRetain(IntPtr ptr); + [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + internal static partial IntPtr CFRetain(IntPtr ptr); /// /// Decrements the reference count on the specified object and, if the ref count hits 0, cleans up the object. /// /// The pointer on which to decrement the reference count. - [DllImport(Interop.Libraries.CoreFoundationLibrary)] - internal static extern void CFRelease(IntPtr ptr); + [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + internal static partial void CFRelease(IntPtr ptr); } } diff --git a/src/libraries/Common/src/Interop/OSX/Interop.EventStream.cs b/src/libraries/Common/src/Interop/OSX/Interop.EventStream.cs index b0d312ff824f49..db2675f73a58d1 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.EventStream.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.EventStream.cs @@ -140,16 +140,16 @@ internal static partial void FSEventStreamScheduleWithRunLoop( /// Stops receiving events on the specified stream. The stream can be restarted and not miss any events. /// /// The stream to stop receiving events on. - [DllImport(Interop.Libraries.CoreServicesLibrary)] - internal static extern void FSEventStreamStop(IntPtr streamRef); + [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)] + internal static partial void FSEventStreamStop(IntPtr streamRef); /// /// Invalidates an EventStream and removes it from any RunLoops. /// /// The FSEventStream to invalidate /// This can only be called after FSEventStreamScheduleWithRunLoop has be called - [DllImport(Interop.Libraries.CoreServicesLibrary)] - internal static extern void FSEventStreamInvalidate(IntPtr streamRef); + [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)] + internal static partial void FSEventStreamInvalidate(IntPtr streamRef); /// /// Removes the event stream from the RunLoop. @@ -167,7 +167,7 @@ internal static partial void FSEventStreamUnscheduleFromRunLoop( /// Releases a reference count on the specified EventStream and, if necessary, cleans the stream up. /// /// The stream on which to decrement the reference count. - [DllImport(Interop.Libraries.CoreServicesLibrary)] - internal static extern void FSEventStreamRelease(IntPtr streamRef); + [GeneratedDllImport(Interop.Libraries.CoreServicesLibrary)] + internal static partial void FSEventStreamRelease(IntPtr streamRef); } } diff --git a/src/libraries/Common/src/Interop/OSX/Interop.RunLoop.cs b/src/libraries/Common/src/Interop/OSX/Interop.RunLoop.cs index 6c662e6c3e68fb..1331875c145d28 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.RunLoop.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.RunLoop.cs @@ -28,31 +28,32 @@ internal static partial class RunLoop /// #if MONO [MethodImplAttribute(MethodImplOptions.InternalCall)] + internal static extern void CFRunLoopRun(); #else - [DllImport(Interop.Libraries.CoreFoundationLibrary)] + [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + internal static partial void CFRunLoopRun(); #endif - internal static extern void CFRunLoopRun(); /// /// Runs the current thread's CFRunLoop object in a particular mode. /// - [DllImport(Interop.Libraries.CoreFoundationLibrary)] - internal static extern int CFRunLoopRunInMode(CFStringRef mode, double seconds, int returnAfterSourceHandled); + [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + internal static partial int CFRunLoopRunInMode(CFStringRef mode, double seconds, int returnAfterSourceHandled); /// /// Notifies a RunLoop to stop and return control to the execution context that called CFRunLoopRun /// /// The RunLoop to notify to stop - [DllImport(Interop.Libraries.CoreFoundationLibrary)] - internal static extern void CFRunLoopStop(CFRunLoopRef rl); + [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + internal static partial void CFRunLoopStop(CFRunLoopRef rl); /// /// Retrieves the RunLoop associated with the current thread; all threads automatically have a RunLoop. /// Follows the "Get Rule" where you do not own the object unless you CFRetain it; in which case, you must also CFRelease it as well. /// /// Returns a pointer to a CFRunLoop on success; otherwise, returns IntPtr.Zero - [DllImport(Interop.Libraries.CoreFoundationLibrary)] - internal static extern CFRunLoopRef CFRunLoopGetCurrent(); + [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + internal static partial CFRunLoopRef CFRunLoopGetCurrent(); /// /// Adds a CFRunLoopSource object to a run loop mode. @@ -60,8 +61,8 @@ internal static partial class RunLoop /// The run loop to modify. /// The run loop source to add. The source is retained by the run loop. /// The run loop mode to which to add source. - [DllImport(Interop.Libraries.CoreFoundationLibrary)] - internal static extern void CFRunLoopAddSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode); + [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + internal static partial void CFRunLoopAddSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode); /// /// Removes a CFRunLoopSource object from a run loop mode. @@ -69,15 +70,15 @@ internal static partial class RunLoop /// The run loop to modify. /// The run loop source to remove. /// The run loop mode of rl from which to remove source. - [DllImport(Interop.Libraries.CoreFoundationLibrary)] - internal static extern void CFRunLoopRemoveSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode); + [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + internal static partial void CFRunLoopRemoveSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFStringRef mode); /// /// Invalidates a CFRunLoopSource object, stopping it from ever firing again. /// /// The run loop source to invalidate. - [DllImport(Interop.Libraries.CoreFoundationLibrary)] - internal static extern void CFRunLoopSourceInvalidate(CFRunLoopSourceRef source); + [GeneratedDllImport(Interop.Libraries.CoreFoundationLibrary)] + internal static partial void CFRunLoopSourceInvalidate(CFRunLoopSourceRef source); /// /// Returns a bool that indicates whether the run loop is waiting for an event. diff --git a/src/libraries/Common/src/Interop/OSX/Interop.libc.cs b/src/libraries/Common/src/Interop/OSX/Interop.libc.cs index d0b377977a1d6e..973dc0109842bb 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.libc.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.libc.cs @@ -23,7 +23,12 @@ internal struct AttrList public const uint ATTR_CMN_CRTIME = 0x00000200; } +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we annotate blittable types used in interop in CoreLib (like CULong) [DllImport(Libraries.libc, EntryPoint = "setattrlist", SetLastError = true)] internal static unsafe extern int setattrlist(string path, AttrList* attrList, void* attrBuf, nint attrBufSize, CULong options); +#pragma warning restore DLLIMPORTGENANALYZER015 + + internal const uint FSOPT_NOFOLLOW = 0x00000001; } } diff --git a/src/libraries/Common/src/Interop/OSX/Interop.libobjc.cs b/src/libraries/Common/src/Interop/OSX/Interop.libobjc.cs index 66d42a8d0f0268..175b8abd3d790c 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.libobjc.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.libobjc.cs @@ -16,12 +16,12 @@ private struct NSOperatingSystemVersion public nint patchVersion; } - [DllImport(Libraries.libobjc)] - private static extern IntPtr objc_getClass(string className); - [DllImport(Libraries.libobjc)] - private static extern IntPtr sel_getUid(string selector); - [DllImport(Libraries.libobjc, EntryPoint = "objc_msgSend")] - private static extern IntPtr intptr_objc_msgSend(IntPtr basePtr, IntPtr selector); + [GeneratedDllImport(Libraries.libobjc, CharSet = CharSet.Ansi)] + private static partial IntPtr objc_getClass(string className); + [GeneratedDllImport(Libraries.libobjc, CharSet = CharSet.Ansi)] + private static partial IntPtr sel_getUid(string selector); + [GeneratedDllImport(Libraries.libobjc, EntryPoint = "objc_msgSend")] + private static partial IntPtr intptr_objc_msgSend(IntPtr basePtr, IntPtr selector); internal static Version GetOperatingSystemVersion() { @@ -58,10 +58,10 @@ internal static Version GetOperatingSystemVersion() return new Version(major, minor, patch); } - [DllImport(Libraries.libobjc, EntryPoint = "objc_msgSend")] - private static extern NSOperatingSystemVersion NSOperatingSystemVersion_objc_msgSend(IntPtr basePtr, IntPtr selector); + [GeneratedDllImport(Libraries.libobjc, EntryPoint = "objc_msgSend")] + private static partial NSOperatingSystemVersion NSOperatingSystemVersion_objc_msgSend(IntPtr basePtr, IntPtr selector); - [DllImport(Libraries.libobjc, EntryPoint = "objc_msgSend_stret")] - private static extern void NSOperatingSystemVersion_objc_msgSend_stret(out NSOperatingSystemVersion osVersion, IntPtr basePtr, IntPtr selector); + [GeneratedDllImport(Libraries.libobjc, EntryPoint = "objc_msgSend_stret")] + private static partial void NSOperatingSystemVersion_objc_msgSend_stret(out NSOperatingSystemVersion osVersion, IntPtr basePtr, IntPtr selector); } } diff --git a/src/libraries/Common/src/Interop/OSX/System.Native/Interop.AutoreleasePool.cs b/src/libraries/Common/src/Interop/OSX/System.Native/Interop.AutoreleasePool.cs index e1d005a3d42ead..c0e78cb5d152cc 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Native/Interop.AutoreleasePool.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Native/Interop.AutoreleasePool.cs @@ -10,10 +10,10 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateAutoreleasePool")] - internal static extern IntPtr CreateAutoreleasePool(); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateAutoreleasePool")] + internal static partial IntPtr CreateAutoreleasePool(); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_DrainAutoreleasePool")] - internal static extern void DrainAutoreleasePool(IntPtr ptr); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_DrainAutoreleasePool")] + internal static partial void DrainAutoreleasePool(IntPtr ptr); } } diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Digest.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Digest.cs index 5a6939e0fb4b5f..5834de129d765d 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Digest.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Digest.cs @@ -9,8 +9,8 @@ internal static partial class Interop { internal static partial class AppleCrypto { - [DllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestFree")] - internal static extern void DigestFree(IntPtr handle); + [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestFree")] + internal static partial void DigestFree(IntPtr handle); [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestCreate")] internal static partial SafeDigestCtxHandle DigestCreate(PAL_HashAlgorithm algorithm, out int cbDigest); @@ -33,8 +33,8 @@ internal static int DigestCurrent(SafeDigestCtxHandle ctx, Span output) => [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestCurrent")] private static partial int DigestCurrent(SafeDigestCtxHandle ctx, ref byte pbOutput, int cbOutput); - [DllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestOneShot")] - internal static unsafe extern int DigestOneShot(PAL_HashAlgorithm algorithm, byte* pbData, int cbData, byte* pbOutput, int cbOutput, int* cbDigest); + [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestOneShot")] + internal static unsafe partial int DigestOneShot(PAL_HashAlgorithm algorithm, byte* pbData, int cbData, byte* pbOutput, int cbOutput, int* cbDigest); [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestReset")] internal static partial int DigestReset(SafeDigestCtxHandle ctx); diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Hmac.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Hmac.cs index 5b4e18c2e71a29..6cf3766ad8ed53 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Hmac.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Hmac.cs @@ -9,8 +9,8 @@ internal static partial class Interop { internal static partial class AppleCrypto { - [DllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacFree")] - internal static extern void HmacFree(IntPtr handle); + [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacFree")] + internal static partial void HmacFree(IntPtr handle); [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacCreate")] internal static partial SafeHmacHandle HmacCreate(PAL_HashAlgorithm algorithm, ref int cbDigest); @@ -36,8 +36,8 @@ internal static int HmacCurrent(SafeHmacHandle ctx, ReadOnlySpan output) = [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacCurrent")] private static partial int HmacCurrent(SafeHmacHandle ctx, ref byte pbOutput, int cbOutput); - [DllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacOneShot")] - internal static unsafe extern int HmacOneShot( + [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_HmacOneShot")] + internal static unsafe partial int HmacOneShot( PAL_HashAlgorithm algorithm, byte* pKey, int cbKey, diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Keychain.macOS.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Keychain.macOS.cs index 8898f400ada6b9..ebe9e3af8d2eb8 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Keychain.macOS.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Keychain.macOS.cs @@ -34,8 +34,8 @@ private static partial int AppleCryptoNative_SecKeychainCreate( byte[] utf8Passphrase, out SafeKeychainHandle keychain); - [DllImport(Libraries.AppleCryptoNative)] - private static extern int AppleCryptoNative_SecKeychainDelete(IntPtr keychain); + [GeneratedDllImport(Libraries.AppleCryptoNative)] + private static partial int AppleCryptoNative_SecKeychainDelete(IntPtr keychain); [GeneratedDllImport(Libraries.AppleCryptoNative)] private static partial int AppleCryptoNative_SecKeychainCopyDefault(out SafeKeychainHandle keychain); diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Pbkdf2.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Pbkdf2.cs index 04fc12ac935e3d..dac63e66f987e5 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Pbkdf2.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Pbkdf2.cs @@ -48,8 +48,8 @@ internal static unsafe void Pbkdf2( } } - [DllImport(Libraries.AppleCryptoNative)] - private static extern unsafe int AppleCryptoNative_Pbkdf2( + [GeneratedDllImport(Libraries.AppleCryptoNative)] + private static unsafe partial int AppleCryptoNative_Pbkdf2( PAL_HashAlgorithm prfAlgorithm, byte* password, int passwordLen, diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Random.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Random.cs index aceadb978eae55..2832aa3d9c0f13 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Random.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Random.cs @@ -27,7 +27,7 @@ internal static unsafe void GetRandomBytes(byte* pbBuffer, int count) } } - [DllImport(Libraries.AppleCryptoNative)] - private static extern unsafe int AppleCryptoNative_GetRandomBytes(byte* buf, int num, int* errorCode); + [GeneratedDllImport(Libraries.AppleCryptoNative)] + private static unsafe partial int AppleCryptoNative_GetRandomBytes(byte* buf, int num, int* errorCode); } } diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Symmetric.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Symmetric.cs index bdd2a97f35abce..9e6d56e2e7487a 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Symmetric.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Symmetric.cs @@ -42,8 +42,8 @@ internal enum PAL_SymmetricOptions None = 0, } - [DllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorFree")] - internal static extern void CryptorFree(IntPtr handle); + [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorFree")] + internal static partial void CryptorFree(IntPtr handle); [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_CryptorCreate")] internal static unsafe partial int CryptorCreate( diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509Chain.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509Chain.cs index 16525bfd370c82..e82ebf958787a7 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509Chain.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.X509Chain.cs @@ -43,8 +43,8 @@ internal static partial int AppleCryptoNative_X509ChainEvaluate( [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainGetStatusAtIndex")] internal static partial int X509ChainGetStatusAtIndex(SafeCreateHandle trustResults, long index, out int pdwStatus); - [DllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_GetOSStatusForChainStatus")] - internal static extern int GetOSStatusForChainStatus(X509ChainStatusFlags flag); + [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_GetOSStatusForChainStatus")] + internal static partial int GetOSStatusForChainStatus(X509ChainStatusFlags flag); [GeneratedDllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_X509ChainSetTrustAnchorCertificates")] internal static partial int X509ChainSetTrustAnchorCertificates(SafeX509ChainHandle chain, SafeCreateHandle anchorCertificates); diff --git a/src/libraries/Common/src/Interop/SunOS/procfs/Interop.ProcFsStat.TryReadProcessStatusInfo.cs b/src/libraries/Common/src/Interop/SunOS/procfs/Interop.ProcFsStat.TryReadProcessStatusInfo.cs index 032186eb6a7e89..bbfa14b3f7b12b 100644 --- a/src/libraries/Common/src/Interop/SunOS/procfs/Interop.ProcFsStat.TryReadProcessStatusInfo.cs +++ b/src/libraries/Common/src/Interop/SunOS/procfs/Interop.ProcFsStat.TryReadProcessStatusInfo.cs @@ -15,8 +15,8 @@ internal static partial class procfs /// /// true if the process status was read; otherwise, false. /// - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadProcessStatusInfo", SetLastError = true)] - private static extern unsafe bool TryReadProcessStatusInfo(int pid, ProcessStatusInfo* processStatus); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadProcessStatusInfo", SetLastError = true)] + private static unsafe partial bool TryReadProcessStatusInfo(int pid, ProcessStatusInfo* processStatus); internal struct ProcessStatusInfo { diff --git a/src/libraries/Common/src/Interop/Unix/Interop.Errors.cs b/src/libraries/Common/src/Interop/Unix/Interop.Errors.cs index 4e9b16098dcadb..88af774f71912b 100644 --- a/src/libraries/Common/src/Interop/Unix/Interop.Errors.cs +++ b/src/libraries/Common/src/Interop/Unix/Interop.Errors.cs @@ -183,25 +183,25 @@ internal static unsafe string StrError(int platformErrno) } #if SERIAL_PORTS - [DllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_ConvertErrorPlatformToPal")] - internal static extern Error ConvertErrorPlatformToPal(int platformErrno); + [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_ConvertErrorPlatformToPal")] + internal static partial Error ConvertErrorPlatformToPal(int platformErrno); - [DllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_ConvertErrorPalToPlatform")] - internal static extern int ConvertErrorPalToPlatform(Error error); + [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_ConvertErrorPalToPlatform")] + internal static partial int ConvertErrorPalToPlatform(Error error); - [DllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_StrErrorR")] - private static extern unsafe byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize); + [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_StrErrorR")] + private static unsafe partial byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize); #else - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPlatformToPal")] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPlatformToPal")] [SuppressGCTransition] - internal static extern Error ConvertErrorPlatformToPal(int platformErrno); + internal static partial Error ConvertErrorPlatformToPal(int platformErrno); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPalToPlatform")] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPalToPlatform")] [SuppressGCTransition] - internal static extern int ConvertErrorPalToPlatform(Error error); + internal static partial int ConvertErrorPalToPlatform(Error error); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_StrErrorR")] - private static extern unsafe byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_StrErrorR")] + private static unsafe partial byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize); #endif } } diff --git a/src/libraries/Common/src/Interop/Unix/System.IO.Ports.Native/Interop.Serial.cs b/src/libraries/Common/src/Interop/Unix/System.IO.Ports.Native/Interop.Serial.cs index f21e6a623ad18e..0752826b4eaf25 100644 --- a/src/libraries/Common/src/Interop/Unix/System.IO.Ports.Native/Interop.Serial.cs +++ b/src/libraries/Common/src/Interop/Unix/System.IO.Ports.Native/Interop.Serial.cs @@ -10,14 +10,14 @@ internal static partial class Interop { internal static partial class Serial { - [DllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_SerialPortOpen", SetLastError = true)] - internal static extern SafeSerialDeviceHandle SerialPortOpen(string name); + [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_SerialPortOpen", CharSet = CharSet.Ansi, SetLastError = true)] + internal static partial SafeSerialDeviceHandle SerialPortOpen(string name); - [DllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_SerialPortClose", SetLastError = true)] - internal static extern int SerialPortClose(IntPtr handle); + [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_SerialPortClose", SetLastError = true)] + internal static partial int SerialPortClose(IntPtr handle); - [DllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Shutdown")] - internal static extern Error Shutdown(IntPtr socket, SocketShutdown how); + [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Shutdown")] + internal static partial Error Shutdown(IntPtr socket, SocketShutdown how); /// /// Reads a number of bytes from an open file descriptor into a specified buffer. @@ -29,8 +29,8 @@ internal static partial class Serial /// Returns the number of bytes read on success; otherwise, -1 is returned /// Note - on fail. the position of the stream may change depending on the platform; consult man 2 read for more info /// - [DllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Read", SetLastError = true)] - internal static extern unsafe int Read(SafeHandle fd, byte* buffer, int count); + [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Read", SetLastError = true)] + internal static unsafe partial int Read(SafeHandle fd, byte* buffer, int count); /// /// Writes the specified buffer to the provided open file descriptor @@ -41,8 +41,8 @@ internal static partial class Serial /// /// Returns the number of bytes written on success; otherwise, returns -1 and sets errno /// - [DllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Write", SetLastError = true)] - internal static extern unsafe int Write(SafeHandle fd, byte* buffer, int bufferSize); + [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Write", SetLastError = true)] + internal static unsafe partial int Write(SafeHandle fd, byte* buffer, int bufferSize); /// /// Polls a set of file descriptors for signals and returns what signals have been set @@ -52,8 +52,8 @@ internal static partial class Serial /// The amount of time to wait; -1 for infinite, 0 for immediate return, and a positive number is the number of milliseconds /// The number of events triggered (i.e. the number of entries in pollEvents with a non-zero TriggeredEvents). May be zero in the event of a timeout. /// An error or Error.SUCCESS. - [DllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Poll")] - private static extern unsafe Error Poll(PollEvent* pollEvents, uint eventCount, int timeout, uint* triggered); + [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_Poll")] + private static unsafe partial Error Poll(PollEvent* pollEvents, uint eventCount, int timeout, uint* triggered); /// /// Polls a File Descriptor for the passed in flags. diff --git a/src/libraries/Common/src/Interop/Unix/System.IO.Ports.Native/Interop.Termios.cs b/src/libraries/Common/src/Interop/Unix/System.IO.Ports.Native/Interop.Termios.cs index a689c75b598761..ce98ffa9c856d6 100644 --- a/src/libraries/Common/src/Interop/Unix/System.IO.Ports.Native/Interop.Termios.cs +++ b/src/libraries/Common/src/Interop/Unix/System.IO.Ports.Native/Interop.Termios.cs @@ -29,34 +29,34 @@ internal enum Queue SendQueue = 2, } - [DllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosReset", SetLastError = true)] - internal static extern int TermiosReset(SafeSerialDeviceHandle handle, int speed, int data, StopBits stop, Parity parity, Handshake flow); + [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosReset", SetLastError = true)] + internal static partial int TermiosReset(SafeSerialDeviceHandle handle, int speed, int data, StopBits stop, Parity parity, Handshake flow); - [DllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetSignal", SetLastError = true)] - internal static extern int TermiosGetSignal(SafeSerialDeviceHandle handle, Signals signal); + [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetSignal", SetLastError = true)] + internal static partial int TermiosGetSignal(SafeSerialDeviceHandle handle, Signals signal); - [DllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSetSignal", SetLastError = true)] - internal static extern int TermiosGetSignal(SafeSerialDeviceHandle handle, Signals signal, int set); + [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSetSignal", SetLastError = true)] + internal static partial int TermiosGetSignal(SafeSerialDeviceHandle handle, Signals signal, int set); - [DllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetAllSignals")] - internal static extern Signals TermiosGetAllSignals(SafeSerialDeviceHandle handle); + [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetAllSignals")] + internal static partial Signals TermiosGetAllSignals(SafeSerialDeviceHandle handle); - [DllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSetSpeed", SetLastError = true)] - internal static extern int TermiosSetSpeed(SafeSerialDeviceHandle handle, int speed); + [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSetSpeed", SetLastError = true)] + internal static partial int TermiosSetSpeed(SafeSerialDeviceHandle handle, int speed); - [DllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetSpeed", SetLastError = true)] - internal static extern int TermiosGetSpeed(SafeSerialDeviceHandle handle); + [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosGetSpeed", SetLastError = true)] + internal static partial int TermiosGetSpeed(SafeSerialDeviceHandle handle); - [DllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosAvailableBytes", SetLastError = true)] - internal static extern int TermiosGetAvailableBytes(SafeSerialDeviceHandle handle, [MarshalAs(UnmanagedType.Bool)]bool fromReadBuffer); + [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosAvailableBytes", SetLastError = true)] + internal static partial int TermiosGetAvailableBytes(SafeSerialDeviceHandle handle, [MarshalAs(UnmanagedType.Bool)]bool fromReadBuffer); - [DllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosDiscard", SetLastError = true)] - internal static extern int TermiosDiscard(SafeSerialDeviceHandle handle, Queue input); + [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosDiscard", SetLastError = true)] + internal static partial int TermiosDiscard(SafeSerialDeviceHandle handle, Queue input); - [DllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosDrain", SetLastError = true)] - internal static extern int TermiosDrain(SafeSerialDeviceHandle handle); + [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosDrain", SetLastError = true)] + internal static partial int TermiosDrain(SafeSerialDeviceHandle handle); - [DllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSendBreak", SetLastError = true)] - internal static extern int TermiosSendBreak(SafeSerialDeviceHandle handle, int duration); + [GeneratedDllImport(Libraries.IOPortsNative, EntryPoint = "SystemIoPortsNative_TermiosSendBreak", SetLastError = true)] + internal static partial int TermiosSendBreak(SafeSerialDeviceHandle handle, int duration); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ChDir.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ChDir.cs index ca0e4e089b2c78..29e072b856bc47 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ChDir.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ChDir.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ChDir", SetLastError = true)] - internal static extern int ChDir(string path); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ChDir", CharSet = CharSet.Ansi, SetLastError = true)] + internal static partial int ChDir(string path); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.CopyFile.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.CopyFile.cs index 89217982ea51b9..3bdbcf8c4ff80d 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.CopyFile.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.CopyFile.cs @@ -10,6 +10,6 @@ internal static partial class Interop internal static partial class Sys { [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CopyFile", SetLastError = true)] - internal static partial int CopyFile(SafeFileHandle source, SafeFileHandle destination); + internal static partial int CopyFile(SafeFileHandle source, SafeFileHandle destination, long sourceLength); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Disconnect.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Disconnect.cs index 0ecfc3192373d7..55c79888f18b02 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Disconnect.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Disconnect.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Disconnect")] - internal static extern Error Disconnect(IntPtr socket); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Disconnect")] + internal static partial Error Disconnect(IntPtr socket); } } 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 2ad68069e48c05..b4896fc0a744f5 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 @@ -42,18 +42,18 @@ public unsafe struct NetworkInterfaceInfo private fixed byte __padding[3]; } - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnumerateInterfaceAddresses")] - public static extern unsafe int EnumerateInterfaceAddresses( + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnumerateInterfaceAddresses")] + public static unsafe partial int EnumerateInterfaceAddresses( void* context, delegate* unmanaged ipv4Found, delegate* unmanaged ipv6Found, delegate* unmanaged linkLayerFound); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnumerateGatewayAddressesForInterface")] - public static extern unsafe int EnumerateGatewayAddressesForInterface(void* context, uint interfaceIndex, delegate* unmanaged onGatewayFound); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnumerateGatewayAddressesForInterface")] + public static unsafe partial int EnumerateGatewayAddressesForInterface(void* context, uint interfaceIndex, delegate* unmanaged onGatewayFound); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNetworkInterfaces")] - public static unsafe extern int GetNetworkInterfaces(int* count, NetworkInterfaceInfo** addrs, int* addressCount, IpAddressInfo** aa); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNetworkInterfaces")] + public static unsafe partial int GetNetworkInterfaces(int* count, NetworkInterfaceInfo** addrs, int* addressCount, IpAddressInfo** aa); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ErrNo.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ErrNo.cs index 3e321d512635a4..b6c4c21a1689a4 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ErrNo.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ErrNo.cs @@ -8,12 +8,12 @@ internal static partial class Interop { internal unsafe partial class Sys { - [DllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetErrNo")] + [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetErrNo")] [SuppressGCTransition] - internal static extern int GetErrNo(); + internal static partial int GetErrNo(); - [DllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_SetErrNo")] + [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_SetErrNo")] [SuppressGCTransition] - internal static extern void SetErrNo(int errorCode); + internal static partial void SetErrNo(int errorCode); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FAllocate.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FAllocate.cs index 71155e0f35e67e..8c3508ef46c58a 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FAllocate.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FAllocate.cs @@ -11,7 +11,7 @@ internal static partial class Sys /// /// Returns -1 on error, 0 on success. /// - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FAllocate", SetLastError = true)] - internal static extern int FAllocate(SafeFileHandle fd, long offset, long length); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FAllocate", SetLastError = true)] + internal static partial int FAllocate(SafeFileHandle fd, long offset, long length); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FSync.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FSync.cs index 773f867f37fe49..531ceb55de73e5 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FSync.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.FSync.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FSync", SetLastError = true)] - internal static extern int FSync(SafeFileHandle fd); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FSync", SetLastError = true)] + internal static partial int FSync(SafeFileHandle fd); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.Pipe.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.Pipe.cs index 6361f87fc0ee4f..c44493fa28630c 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.Pipe.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.Pipe.cs @@ -19,9 +19,9 @@ internal static partial class Fcntl [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlSetPipeSz", SetLastError=true)] internal static partial int SetPipeSz(SafePipeHandle fd, int size); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlCanGetSetPipeSz")] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlCanGetSetPipeSz")] [SuppressGCTransition] - private static extern int FcntlCanGetSetPipeSz(); + private static partial int FcntlCanGetSetPipeSz(); } } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetCpuUtilization.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetCpuUtilization.cs index 0e5e3b4fb6fd6d..6598dbdf55f2c3 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetCpuUtilization.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetCpuUtilization.cs @@ -15,7 +15,7 @@ internal struct ProcessCpuInformation internal ulong lastRecordedUserTime; } - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetCpuUtilization")] - internal static extern int GetCpuUtilization(ref ProcessCpuInformation previousCpuInfo); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetCpuUtilization")] + internal static partial int GetCpuUtilization(ref ProcessCpuInformation previousCpuInfo); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetCwd.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetCwd.cs index 78da5a667310f1..22fb18f05a9f7b 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetCwd.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetCwd.cs @@ -9,8 +9,8 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetCwd", SetLastError = true)] - private static extern unsafe byte* GetCwd(byte* buffer, int bufferLength); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetCwd", SetLastError = true)] + private static unsafe partial byte* GetCwd(byte* buffer, int bufferLength); internal static unsafe string GetCwd() { diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainName.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainName.cs index 466afb7b0101d7..74946795ca8608 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainName.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainName.cs @@ -10,8 +10,8 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetDomainName")] - private static extern unsafe int GetDomainName(byte* name, int len); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetDomainName")] + private static unsafe partial int GetDomainName(byte* name, int len); internal static unsafe string GetDomainName() { diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainSocketSizes.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainSocketSizes.cs index 7daf1ba2aef34f..35263979dc3186 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainSocketSizes.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainSocketSizes.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetDomainSocketSizes")] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetDomainSocketSizes")] [SuppressGCTransition] - internal static unsafe extern void GetDomainSocketSizes(int* pathOffset, int* pathSize, int* addressSize); + internal static unsafe partial void GetDomainSocketSizes(int* pathOffset, int* pathSize, int* addressSize); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEUid.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEUid.cs index 1b8aa005b15ffa..f11d4efd443e14 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEUid.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEUid.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEUid")] - internal static extern uint GetEUid(); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEUid")] + internal static partial uint GetEUid(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEnv.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEnv.cs index d83d6700b51622..13b578053820c1 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEnv.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEnv.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal unsafe partial class Sys { - [DllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetEnv")] - internal static extern unsafe IntPtr GetEnv(string name); + [GeneratedDllImport(Interop.Libraries.SystemNative, CharSet = CharSet.Ansi, EntryPoint = "SystemNative_GetEnv")] + internal static unsafe partial IntPtr GetEnv(string name); } } \ No newline at end of file diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEnviron.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEnviron.cs index abe8ff0e1916ec..b88c2560838b82 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEnviron.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEnviron.cs @@ -8,10 +8,10 @@ internal static partial class Interop { internal unsafe partial class Sys { - [DllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetEnviron")] - internal static extern unsafe IntPtr GetEnviron(); + [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetEnviron")] + internal static unsafe partial IntPtr GetEnviron(); - [DllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_FreeEnviron")] - internal static extern unsafe void FreeEnviron(IntPtr environ); + [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_FreeEnviron")] + internal static unsafe partial void FreeEnviron(IntPtr environ); } } \ No newline at end of file diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetMaximumAddressSize.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetMaximumAddressSize.cs index 44617551080a04..6ad3e4e3cd669d 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetMaximumAddressSize.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetMaximumAddressSize.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetMaximumAddressSize")] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetMaximumAddressSize")] [SuppressGCTransition] - internal static extern int GetMaximumAddressSize(); + internal static partial int GetMaximumAddressSize(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetNameInfo.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetNameInfo.cs index e22ade3a077604..e962dbddec166c 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetNameInfo.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetNameInfo.cs @@ -15,8 +15,8 @@ internal enum GetNameInfoFlags : int NI_NUMERICHOST = 0x2, } - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNameInfo")] - internal static extern unsafe int GetNameInfo( + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetNameInfo")] + internal static unsafe partial int GetNameInfo( byte* address, uint addressLength, byte isIpv6, diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetOSArchitecture.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetOSArchitecture.cs index de7b9cd37ad2b3..50bf35c2d2cd76 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetOSArchitecture.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetOSArchitecture.cs @@ -9,7 +9,7 @@ internal static partial class Interop internal static partial class Sys { [SuppressGCTransition] - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetOSArchitecture")] - internal static extern int GetOSArchitecture(); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetOSArchitecture")] + internal static partial int GetOSArchitecture(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPid.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPid.cs index 400dc554a366d4..6b26b6064341f1 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPid.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetPid.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPid")] - internal static extern int GetPid(); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPid")] + internal static partial int GetPid(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessArchitecture.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessArchitecture.cs index 2dbb0b1eed13aa..2086b4a015a118 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessArchitecture.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessArchitecture.cs @@ -9,7 +9,7 @@ internal static partial class Interop internal static partial class Sys { [SuppressGCTransition] - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetProcessArchitecture")] - internal static extern int GetProcessArchitecture(); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetProcessArchitecture")] + internal static partial int GetProcessArchitecture(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessPath.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessPath.cs index c64d21e5054b84..ddcd49790aaae3 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessPath.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessPath.cs @@ -10,7 +10,7 @@ internal static partial class Sys /// /// Returns the full path to the executable for the current process, resolving symbolic links. /// - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetProcessPath", SetLastError = true)] - internal static extern string? GetProcessPath(); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetProcessPath", CharSet = CharSet.Ansi, SetLastError = true)] + internal static partial string? GetProcessPath(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetRandomBytes.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetRandomBytes.cs index 15295e5053b627..76c1323761a887 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetRandomBytes.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetRandomBytes.cs @@ -8,11 +8,11 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetNonCryptographicallySecureRandomBytes")] - internal static extern unsafe void GetNonCryptographicallySecureRandomBytes(byte* buffer, int length); + [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetNonCryptographicallySecureRandomBytes")] + internal static unsafe partial void GetNonCryptographicallySecureRandomBytes(byte* buffer, int length); - [DllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetCryptographicallySecureRandomBytes")] - internal static extern unsafe int GetCryptographicallySecureRandomBytes(byte* buffer, int length); + [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetCryptographicallySecureRandomBytes")] + internal static unsafe partial int GetCryptographicallySecureRandomBytes(byte* buffer, int length); } internal static unsafe void GetRandomBytes(byte* buffer, int length) diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSid.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSid.cs index 6137740fc0f1f0..5b20a8660a6475 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSid.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSid.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSid")] - internal static extern int GetSid(int pid); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSid")] + internal static partial int GetSid(int pid); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSockOpt.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSockOpt.cs index 0a0dbae00073f2..49d4b0d703e37e 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSockOpt.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSockOpt.cs @@ -12,8 +12,8 @@ internal static partial class Sys [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockOpt")] internal static unsafe partial Error GetSockOpt(SafeHandle socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int* optionLen); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockOpt")] - internal static extern unsafe Error GetSockOpt(IntPtr socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int* optionLen); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSockOpt")] + internal static unsafe partial Error GetSockOpt(IntPtr socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int* optionLen); [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetRawSockOpt")] internal static unsafe partial Error GetRawSockOpt(SafeHandle socket, int optionLevel, int optionName, byte* optionValue, int* optionLen); diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSystemTimeAsTicks.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSystemTimeAsTicks.cs index 850ff0af9e5679..ca5c01cb61e79f 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSystemTimeAsTicks.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetSystemTimeAsTicks.cs @@ -7,8 +7,8 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetSystemTimeAsTicks")] + [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetSystemTimeAsTicks")] [SuppressGCTransition] - internal static extern long GetSystemTimeAsTicks(); + internal static partial long GetSystemTimeAsTicks(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetTimestamp.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetTimestamp.cs index a374e485f9cce6..fc0964bf98f91a 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetTimestamp.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetTimestamp.cs @@ -7,8 +7,8 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTimestamp", ExactSpelling = true)] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetTimestamp", ExactSpelling = true)] [SuppressGCTransition] - internal static extern ulong GetTimestamp(); + internal static partial ulong GetTimestamp(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixName.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixName.cs index 8d5063ead9bedc..276f1129112c13 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixName.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixName.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixName")] - private static extern IntPtr GetUnixNamePrivate(); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixName")] + private static partial IntPtr GetUnixNamePrivate(); internal static string GetUnixName() { diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixRelease.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixRelease.cs index 22ae8691fcf469..cf47ba34fe14c8 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixRelease.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUnixRelease.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixRelease", CharSet = CharSet.Ansi, SetLastError = true)] - public static extern string GetUnixRelease(); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixRelease", CharSet = CharSet.Ansi, SetLastError = true)] + public static partial string GetUnixRelease(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.HostEntry.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.HostEntry.cs index 98372054ec0462..360ae8a340aa6c 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.HostEntry.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.HostEntry.cs @@ -35,7 +35,7 @@ internal unsafe struct HostEntry [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetHostEntryForName", CharSet = CharSet.Ansi)] internal static unsafe partial int GetHostEntryForName(string address, AddressFamily family, HostEntry* entry); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FreeHostEntry")] - internal static extern unsafe void FreeHostEntry(HostEntry* entry); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FreeHostEntry")] + internal static unsafe partial void FreeHostEntry(HostEntry* entry); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IPPacketInformation.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IPPacketInformation.cs index 37dab53c69365c..7c10ff98bf70c0 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IPPacketInformation.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IPPacketInformation.cs @@ -16,9 +16,9 @@ internal struct IPPacketInformation private int _padding; // Pad out to 8-byte alignment } - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetControlMessageBufferSize")] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetControlMessageBufferSize")] [SuppressGCTransition] - internal static extern int GetControlMessageBufferSize(int isIPv4, int isIPv6); + internal static partial int GetControlMessageBufferSize(int isIPv4, int isIPv6); [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryGetIPPacketInformation")] internal static unsafe partial bool TryGetIPPacketInformation(MessageHeader* messageHeader, bool isIPv4, IPPacketInformation* packetInfo); diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.InterfaceNameToIndex.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.InterfaceNameToIndex.cs index 74fab3ed6d6a28..7d0c0dd64c2a71 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.InterfaceNameToIndex.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.InterfaceNameToIndex.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_InterfaceNameToIndex", SetLastError = true)] - public static extern uint InterfaceNameToIndex(string name); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_InterfaceNameToIndex", CharSet = CharSet.Ansi, SetLastError = true)] + public static partial uint InterfaceNameToIndex(string name); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetGroups.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IsMemberOfGroup.cs similarity index 63% rename from src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetGroups.cs rename to src/libraries/Common/src/Interop/Unix/System.Native/Interop.IsMemberOfGroup.cs index 2fd31563f17450..c302dbe3dafa00 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetGroups.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IsMemberOfGroup.cs @@ -8,8 +8,13 @@ internal static partial class Interop { internal static partial class Sys { - internal static unsafe uint[]? GetGroups() + internal static unsafe bool IsMemberOfGroup(uint gid) { + if (gid == GetEGid()) + { + return true; + } + const int InitialGroupsLength = #if DEBUG 1; @@ -28,7 +33,7 @@ internal static partial class Sys if (rv >= 0) { // success - return groups.Slice(0, rv).ToArray(); + return groups.Slice(0, rv).IndexOf(gid) >= 0; } else if (rv == -1 && Interop.Sys.GetLastError() == Interop.Error.EINVAL) { @@ -37,14 +42,17 @@ internal static partial class Sys } else { - // failure - return null; + // failure (unexpected) + return false; } } while (true); } - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetGroups", SetLastError = true)] - private static extern unsafe int GetGroups(int ngroups, uint* groups); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEGid")] + private static partial uint GetEGid(); + + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetGroups", SetLastError = true)] + private static unsafe partial int GetGroups(int ngroups, uint* groups); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs index 17ba8e32332231..1353fbc3acec63 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs @@ -19,8 +19,8 @@ internal enum UserFlags : uint internal static readonly bool CanSetHiddenFlag = (LChflagsCanSetHiddenFlag() != 0); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LChflagsCanSetHiddenFlag")] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LChflagsCanSetHiddenFlag")] [SuppressGCTransition] - private static extern int LChflagsCanSetHiddenFlag(); + private static partial int LChflagsCanSetHiddenFlag(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LingerOption.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LingerOption.cs index 5092a15151dbb2..ecaae2b40abb9f 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LingerOption.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LingerOption.cs @@ -21,7 +21,7 @@ internal struct LingerOption [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetLingerOption")] internal static unsafe partial Error SetLingerOption(SafeHandle socket, LingerOption* option); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetLingerOption")] - internal static extern unsafe Error SetLingerOption(IntPtr socket, LingerOption* option); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetLingerOption")] + internal static unsafe partial Error SetLingerOption(IntPtr socket, LingerOption* option); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LockFileRegion.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LockFileRegion.cs index 3276275f284c23..0692aa48fff1a1 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LockFileRegion.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LockFileRegion.cs @@ -14,7 +14,7 @@ internal enum LockType : short F_UNLCK = 2 // unlock } - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LockFileRegion", SetLastError=true)] - internal static extern int LockFileRegion(SafeHandle fd, long offset, long length, LockType lockType); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LockFileRegion", SetLastError =true)] + internal static partial int LockFileRegion(SafeHandle fd, long offset, long length, LockType lockType); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Log.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Log.cs index 109bfff2b271cd..474429e1233c43 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Log.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Log.cs @@ -8,10 +8,10 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Log")] - internal static extern unsafe void Log(byte* buffer, int count); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Log")] + internal static unsafe partial void Log(byte* buffer, int count); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LogError")] - internal static extern unsafe void LogError(byte* buffer, int count); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LogError")] + internal static unsafe partial void LogError(byte* buffer, int count); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LowLevelMonitor.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LowLevelMonitor.cs index 8544cbefb7b3bd..5132e827cc7083 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LowLevelMonitor.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LowLevelMonitor.cs @@ -8,25 +8,25 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Create")] - internal static extern IntPtr LowLevelMonitor_Create(); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Create")] + internal static partial IntPtr LowLevelMonitor_Create(); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Destroy")] - internal static extern void LowLevelMonitor_Destroy(IntPtr monitor); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Destroy")] + internal static partial void LowLevelMonitor_Destroy(IntPtr monitor); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Acquire")] - internal static extern void LowLevelMonitor_Acquire(IntPtr monitor); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Acquire")] + internal static partial void LowLevelMonitor_Acquire(IntPtr monitor); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Release")] - internal static extern void LowLevelMonitor_Release(IntPtr monitor); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Release")] + internal static partial void LowLevelMonitor_Release(IntPtr monitor); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Wait")] - internal static extern void LowLevelMonitor_Wait(IntPtr monitor); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Wait")] + internal static partial void LowLevelMonitor_Wait(IntPtr monitor); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_TimedWait")] - internal static extern bool LowLevelMonitor_TimedWait(IntPtr monitor, int timeoutMilliseconds); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_TimedWait")] + internal static partial bool LowLevelMonitor_TimedWait(IntPtr monitor, int timeoutMilliseconds); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Signal_Release")] - internal static extern void LowLevelMonitor_Signal_Release(IntPtr monitor); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LowLevelMonitor_Signal_Release")] + internal static partial void LowLevelMonitor_Signal_Release(IntPtr monitor); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MapTcpState.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MapTcpState.cs index d16be7edf49a5e..3d689c57f387ef 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MapTcpState.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MapTcpState.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MapTcpState")] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MapTcpState")] [SuppressGCTransition] - internal static extern TcpState MapTcpState(int nativeState); + internal static partial TcpState MapTcpState(int nativeState); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MemAlloc.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MemAlloc.cs index cb4a38ff4ea0fb..9a0a90cd8abc03 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MemAlloc.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MemAlloc.cs @@ -8,25 +8,25 @@ internal static partial class Interop { internal static unsafe partial class Sys { - [DllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedAlloc")] - internal static extern void* AlignedAlloc(nuint alignment, nuint size); + [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedAlloc")] + internal static partial void* AlignedAlloc(nuint alignment, nuint size); - [DllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedFree")] - internal static extern void AlignedFree(void* ptr); + [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedFree")] + internal static partial void AlignedFree(void* ptr); - [DllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedRealloc")] - internal static extern void* AlignedRealloc(void* ptr, nuint alignment, nuint new_size); + [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_AlignedRealloc")] + internal static partial void* AlignedRealloc(void* ptr, nuint alignment, nuint new_size); - [DllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Calloc")] - internal static extern void* Calloc(nuint num, nuint size); + [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Calloc")] + internal static partial void* Calloc(nuint num, nuint size); - [DllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Free")] - internal static extern void Free(void* ptr); + [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Free")] + internal static partial void Free(void* ptr); - [DllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Malloc")] - internal static extern void* Malloc(nuint size); + [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Malloc")] + internal static partial void* Malloc(nuint size); - [DllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Realloc")] - internal static extern void* Realloc(void* ptr, nuint new_size); + [GeneratedDllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_Realloc")] + internal static partial void* Realloc(void* ptr, nuint new_size); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MkDir.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MkDir.cs index 499b1e74597e9e..09a4ae1e3e79ae 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MkDir.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MkDir.cs @@ -3,12 +3,20 @@ using System; using System.Runtime.InteropServices; +using System.Text; internal static partial class Interop { internal static partial class Sys { - [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MkDir", CharSet = CharSet.Ansi, SetLastError = true)] - internal static partial int MkDir(string path, int mode); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MkDir", SetLastError = true)] + private static partial int MkDir(ref byte path, int mode); + + internal static int MkDir(ReadOnlySpan path, int mode) + { + using ValueUtf8Converter converter = new(stackalloc byte[DefaultPathBufferSize]); + int result = MkDir(ref MemoryMarshal.GetReference(converter.ConvertAndTerminateString(path)), mode); + return result; + } } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MksTemps.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MksTemps.cs index f40937907b8f31..f697cd93bcdaef 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MksTemps.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MksTemps.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MksTemps", SetLastError = true)] - internal static extern IntPtr MksTemps( + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MksTemps", SetLastError = true)] + internal static partial IntPtr MksTemps( byte[] template, int suffixlen); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.NetworkChange.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.NetworkChange.cs index 152588f5078859..5b5e7ccd8bba32 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.NetworkChange.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.NetworkChange.cs @@ -16,13 +16,13 @@ public enum NetworkChangeKind AvailabilityChanged = 2 } - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateNetworkChangeListenerSocket")] - public static unsafe extern Error CreateNetworkChangeListenerSocket(int* socket); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateNetworkChangeListenerSocket")] + public static unsafe partial Error CreateNetworkChangeListenerSocket(int* socket); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CloseNetworkChangeListenerSocket")] - public static extern Error CloseNetworkChangeListenerSocket(int socket); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CloseNetworkChangeListenerSocket")] + public static partial Error CloseNetworkChangeListenerSocket(int socket); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadEvents")] - public static extern unsafe void ReadEvents(int socket, delegate* unmanaged onNetworkChange); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadEvents")] + public static unsafe partial void ReadEvents(int socket, delegate* unmanaged onNetworkChange); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PRead.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PRead.cs index 664da015febb2e..b48dff07b274be 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PRead.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PRead.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PRead", SetLastError = true)] - internal static extern unsafe int PRead(SafeHandle fd, byte* buffer, int bufferSize, long fileOffset); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PRead", SetLastError = true)] + internal static unsafe partial int PRead(SafeHandle fd, byte* buffer, int bufferSize, long fileOffset); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PReadV.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PReadV.cs index 5d93078161f05d..de0f311e93a9f6 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PReadV.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PReadV.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PReadV", SetLastError = true)] - internal static extern unsafe long PReadV(SafeHandle fd, IOVector* vectors, int vectorCount, long fileOffset); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PReadV", SetLastError = true)] + internal static unsafe partial long PReadV(SafeHandle fd, IOVector* vectors, int vectorCount, long fileOffset); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PWrite.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PWrite.cs index 721a1c8706fd72..d658f4b9be6cf2 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PWrite.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PWrite.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PWrite", SetLastError = true)] - internal static extern unsafe int PWrite(SafeHandle fd, byte* buffer, int bufferSize, long fileOffset); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PWrite", SetLastError = true)] + internal static unsafe partial int PWrite(SafeHandle fd, byte* buffer, int bufferSize, long fileOffset); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PWriteV.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PWriteV.cs index c17e9964d8fe9a..baba793575a3af 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PWriteV.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PWriteV.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PWriteV", SetLastError = true)] - internal static extern unsafe long PWriteV(SafeHandle fd, IOVector* vectors, int vectorCount, long fileOffset); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PWriteV", SetLastError = true)] + internal static unsafe partial long PWriteV(SafeHandle fd, IOVector* vectors, int vectorCount, long fileOffset); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PlatformSocketSupport.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PlatformSocketSupport.cs index 0e406162f9ac5f..550aaff995add6 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PlatformSocketSupport.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PlatformSocketSupport.cs @@ -7,8 +7,8 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PlatformSupportsDualModeIPv4PacketInfo")] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PlatformSupportsDualModeIPv4PacketInfo")] [SuppressGCTransition] - internal static extern int PlatformSupportsDualModeIPv4PacketInfo(); + internal static partial int PlatformSupportsDualModeIPv4PacketInfo(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Poll.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Poll.cs index c20d5f9a7cbf34..65d9b711d272e3 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Poll.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Poll.cs @@ -17,8 +17,8 @@ internal static partial class Sys /// The amount of time to wait; -1 for infinite, 0 for immediate return, and a positive number is the number of milliseconds /// The number of events triggered (i.e. the number of entries in pollEvents with a non-zero TriggeredEvents). May be zero in the event of a timeout. /// An error or Error.SUCCESS. - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Poll")] - internal static extern unsafe Error Poll(PollEvent* pollEvents, uint eventCount, int timeout, uint* triggered); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Poll")] + internal static unsafe partial Error Poll(PollEvent* pollEvents, uint eventCount, int timeout, uint* triggered); /// /// Polls a File Descriptor for the passed in flags. diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixFAdvise.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixFAdvise.cs index ed9ee769ac8b0e..e2e96df6bfa524 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixFAdvise.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixFAdvise.cs @@ -29,7 +29,7 @@ internal enum FileAdvice : int /// /// Returns 0 on success; otherwise, the error code is returned /// - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PosixFAdvise", SetLastError = false /* this is explicitly called out in the man page */)] - internal static extern int PosixFAdvise(SafeFileHandle fd, long offset, long length, FileAdvice advice); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PosixFAdvise", SetLastError = false /* this is explicitly called out in the man page */)] + internal static partial int PosixFAdvise(SafeFileHandle fd, long offset, long length, FileAdvice advice); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixSignal.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixSignal.cs index 65e3ca35f4844c..bde211dcacc0e7 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixSignal.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PosixSignal.cs @@ -7,21 +7,21 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPosixSignalHandler")] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPosixSignalHandler")] [SuppressGCTransition] - internal static extern unsafe void SetPosixSignalHandler(delegate* unmanaged handler); + internal static unsafe partial void SetPosixSignalHandler(delegate* unmanaged handler); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnablePosixSignalHandling", SetLastError = true)] - internal static extern bool EnablePosixSignalHandling(int signal); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_EnablePosixSignalHandling", SetLastError = true)] + internal static partial bool EnablePosixSignalHandling(int signal); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_DisablePosixSignalHandling")] - internal static extern void DisablePosixSignalHandling(int signal); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_DisablePosixSignalHandling")] + internal static partial void DisablePosixSignalHandling(int signal); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_HandleNonCanceledPosixSignal")] - internal static extern void HandleNonCanceledPosixSignal(int signal); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_HandleNonCanceledPosixSignal")] + internal static partial void HandleNonCanceledPosixSignal(int signal); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPlatformSignalNumber")] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPlatformSignalNumber")] [SuppressGCTransition] - internal static extern int GetPlatformSignalNumber(PosixSignal signal); + internal static partial int GetPlatformSignalNumber(PosixSignal signal); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs index 4801498489d615..37a89d871c25e4 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs @@ -56,12 +56,12 @@ internal ReadOnlySpan GetName(Span buffer) [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_OpenDir", CharSet = CharSet.Ansi, SetLastError = true)] internal static partial IntPtr OpenDir(string path); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetReadDirRBufferSize", SetLastError = false)] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetReadDirRBufferSize", SetLastError = false)] [SuppressGCTransition] - internal static extern int GetReadDirRBufferSize(); + internal static partial int GetReadDirRBufferSize(); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadDirR")] - internal static unsafe extern int ReadDirR(IntPtr dir, byte* buffer, int bufferSize, DirectoryEntry* outputEntry); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadDirR")] + internal static unsafe partial int ReadDirR(IntPtr dir, byte* buffer, int bufferSize, DirectoryEntry* outputEntry); [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CloseDir", SetLastError = true)] internal static partial int CloseDir(IntPtr dir); diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadStdinUnbuffered.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadStdinUnbuffered.cs index 03565b1dd17472..c751528354b767 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadStdinUnbuffered.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadStdinUnbuffered.cs @@ -11,10 +11,10 @@ internal static partial class Sys [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadStdin", SetLastError = true)] internal static unsafe partial int ReadStdin(byte* buffer, int bufferSize); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_InitializeConsoleBeforeRead")] - internal static extern void InitializeConsoleBeforeRead(byte minChars = 1, byte decisecondsTimeout = 0); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_InitializeConsoleBeforeRead")] + internal static partial void InitializeConsoleBeforeRead(byte minChars = 1, byte decisecondsTimeout = 0); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_UninitializeConsoleAfterRead")] - internal static extern void UninitializeConsoleAfterRead(); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_UninitializeConsoleAfterRead")] + internal static partial void UninitializeConsoleAfterRead(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RegisterForSigChld.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RegisterForSigChld.cs index e11fcfaf0e65cd..2bbac8ac392551 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RegisterForSigChld.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RegisterForSigChld.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_RegisterForSigChld")] - internal static extern unsafe void RegisterForSigChld(delegate* unmanaged handler); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_RegisterForSigChld")] + internal static unsafe partial void RegisterForSigChld(delegate* unmanaged handler); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetDelayedSigChildConsoleConfigurationHandler.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetDelayedSigChildConsoleConfigurationHandler.cs index bd09aa12abc00d..f9c6b2be289ac3 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetDelayedSigChildConsoleConfigurationHandler.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetDelayedSigChildConsoleConfigurationHandler.cs @@ -7,8 +7,8 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetDelayedSigChildConsoleConfigurationHandler")] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetDelayedSigChildConsoleConfigurationHandler")] [SuppressGCTransition] - internal static extern unsafe void SetDelayedSigChildConsoleConfigurationHandler(delegate* unmanaged callback); + internal static unsafe partial void SetDelayedSigChildConsoleConfigurationHandler(delegate* unmanaged callback); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetEUid.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetEUid.cs index 6a40f17c6deade..2a52122fc51b1e 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetEUid.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetEUid.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetEUid")] - internal static extern int SetEUid(uint euid); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetEUid")] + internal static partial int SetEUid(uint euid); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSignalForBreak.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSignalForBreak.cs index 51603d6d1e4a45..8a504d7a0b8f5d 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSignalForBreak.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSignalForBreak.cs @@ -7,11 +7,11 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSignalForBreak")] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSignalForBreak")] [SuppressGCTransition] - internal static extern int GetSignalForBreak(); + internal static partial int GetSignalForBreak(); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSignalForBreak")] - internal static extern int SetSignalForBreak(int signalForBreak); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSignalForBreak")] + internal static partial int SetSignalForBreak(int signalForBreak); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSockOpt.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSockOpt.cs index 10760287e439eb..66048b39bacf43 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSockOpt.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSockOpt.cs @@ -12,8 +12,8 @@ internal static partial class Sys [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSockOpt")] internal static unsafe partial Error SetSockOpt(SafeHandle socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int optionLen); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSockOpt")] - internal static extern unsafe Error SetSockOpt(IntPtr socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int optionLen); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSockOpt")] + internal static unsafe partial Error SetSockOpt(IntPtr socket, SocketOptionLevel optionLevel, SocketOptionName optionName, byte* optionValue, int optionLen); [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetRawSockOpt")] internal static unsafe partial Error SetRawSockOpt(SafeHandle socket, int optionLevel, int optionName, byte* optionValue, int optionLen); diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetTerminalInvalidationHandler.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetTerminalInvalidationHandler.cs index 3082cb96b71834..7661463b7b9cf8 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetTerminalInvalidationHandler.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetTerminalInvalidationHandler.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetTerminalInvalidationHandler")] - internal static extern unsafe void SetTerminalInvalidationHandler(delegate* unmanaged handler); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetTerminalInvalidationHandler")] + internal static unsafe partial void SetTerminalInvalidationHandler(delegate* unmanaged handler); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Shutdown.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Shutdown.cs index ee516a59c2e86c..6a04ca805a2868 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Shutdown.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Shutdown.cs @@ -12,7 +12,7 @@ internal static partial class Sys [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Shutdown")] internal static partial Error Shutdown(SafeHandle socket, SocketShutdown how); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Shutdown")] - internal static extern Error Shutdown(IntPtr socket, SocketShutdown how); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Shutdown")] + internal static partial Error Shutdown(IntPtr socket, SocketShutdown how); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Socket.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Socket.cs index e5b18a8b069450..bce422402d8b9a 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Socket.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Socket.cs @@ -11,7 +11,7 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Socket")] - internal static extern unsafe Error Socket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType, IntPtr* socket); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Socket")] + internal static unsafe partial Error Socket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType, IntPtr* socket); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketAddress.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketAddress.cs index 5770afbf197ba7..a0c217a8aca2af 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketAddress.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketAddress.cs @@ -9,38 +9,38 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPSocketAddressSizes")] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPSocketAddressSizes")] [SuppressGCTransition] - internal static extern unsafe Error GetIPSocketAddressSizes(int* ipv4SocketAddressSize, int* ipv6SocketAddressSize); + internal static unsafe partial Error GetIPSocketAddressSizes(int* ipv4SocketAddressSize, int* ipv6SocketAddressSize); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAddressFamily")] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAddressFamily")] [SuppressGCTransition] - internal static extern unsafe Error GetAddressFamily(byte* socketAddress, int socketAddressLen, int* addressFamily); + internal static unsafe partial Error GetAddressFamily(byte* socketAddress, int socketAddressLen, int* addressFamily); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetAddressFamily")] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetAddressFamily")] [SuppressGCTransition] - internal static extern unsafe Error SetAddressFamily(byte* socketAddress, int socketAddressLen, int addressFamily); + internal static unsafe partial Error SetAddressFamily(byte* socketAddress, int socketAddressLen, int addressFamily); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPort")] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPort")] [SuppressGCTransition] - internal static extern unsafe Error GetPort(byte* socketAddress, int socketAddressLen, ushort* port); + internal static unsafe partial Error GetPort(byte* socketAddress, int socketAddressLen, ushort* port); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPort")] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPort")] [SuppressGCTransition] - internal static extern unsafe Error SetPort(byte* socketAddress, int socketAddressLen, ushort port); + internal static unsafe partial Error SetPort(byte* socketAddress, int socketAddressLen, ushort port); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4Address")] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4Address")] [SuppressGCTransition] - internal static extern unsafe Error GetIPv4Address(byte* socketAddress, int socketAddressLen, uint* address); + internal static unsafe partial Error GetIPv4Address(byte* socketAddress, int socketAddressLen, uint* address); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv4Address")] + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv4Address")] [SuppressGCTransition] - internal static extern unsafe Error SetIPv4Address(byte* socketAddress, int socketAddressLen, uint address); + internal static unsafe partial Error SetIPv4Address(byte* socketAddress, int socketAddressLen, uint address); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv6Address")] - internal static extern unsafe Error GetIPv6Address(byte* socketAddress, int socketAddressLen, byte* address, int addressLen, uint* scopeId); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv6Address")] + internal static unsafe partial Error GetIPv6Address(byte* socketAddress, int socketAddressLen, byte* address, int addressLen, uint* scopeId); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv6Address")] - internal static extern unsafe Error SetIPv6Address(byte* socketAddress, int socketAddressLen, byte* address, int addressLen, uint scopeId); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv6Address")] + internal static unsafe partial Error SetIPv6Address(byte* socketAddress, int socketAddressLen, byte* address, int addressLen, uint scopeId); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketEvent.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketEvent.cs index c3e6769ac6cdd2..45eb91559c0ab0 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketEvent.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketEvent.cs @@ -27,25 +27,25 @@ internal struct SocketEvent private int _padding; } - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateSocketEventPort")] - internal static unsafe extern Error CreateSocketEventPort(IntPtr* port); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateSocketEventPort")] + internal static unsafe partial Error CreateSocketEventPort(IntPtr* port); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CloseSocketEventPort")] - internal static extern Error CloseSocketEventPort(IntPtr port); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CloseSocketEventPort")] + internal static partial Error CloseSocketEventPort(IntPtr port); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateSocketEventBuffer")] - internal static unsafe extern Error CreateSocketEventBuffer(int count, SocketEvent** buffer); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateSocketEventBuffer")] + internal static unsafe partial Error CreateSocketEventBuffer(int count, SocketEvent** buffer); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FreeSocketEventBuffer")] - internal static extern unsafe Error FreeSocketEventBuffer(SocketEvent* buffer); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FreeSocketEventBuffer")] + internal static unsafe partial Error FreeSocketEventBuffer(SocketEvent* buffer); [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryChangeSocketEventRegistration")] internal static partial Error TryChangeSocketEventRegistration(IntPtr port, SafeHandle socket, SocketEvents currentEvents, SocketEvents newEvents, IntPtr data); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryChangeSocketEventRegistration")] - internal static extern Error TryChangeSocketEventRegistration(IntPtr port, IntPtr socket, SocketEvents currentEvents, SocketEvents newEvents, IntPtr data); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryChangeSocketEventRegistration")] + internal static partial Error TryChangeSocketEventRegistration(IntPtr port, IntPtr socket, SocketEvents currentEvents, SocketEvents newEvents, IntPtr data); - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_WaitForSocketEvents")] - internal static extern unsafe Error WaitForSocketEvents(IntPtr port, SocketEvent* buffer, int* count); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_WaitForSocketEvents")] + internal static unsafe partial Error WaitForSocketEvents(IntPtr port, SocketEvent* buffer, int* count); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SymLink.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SymLink.cs index 922ecd5bc66255..d0721eef785d90 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SymLink.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SymLink.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Sys { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SymLink", SetLastError = true)] - internal static extern int SymLink(string target, string linkPath); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SymLink", CharSet = CharSet.Ansi, SetLastError = true)] + internal static partial int SymLink(string target, string linkPath); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Sync.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Sync.cs index e51680db75089f..3b2246fbe96992 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Sync.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Sync.cs @@ -11,7 +11,7 @@ internal static partial class Sys /// /// Forces a write of all modified I/O buffers to their storage mediums. /// - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Sync")] - internal static extern void Sync(); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Sync")] + internal static partial void Sync(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SysLog.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SysLog.cs index e8809b13696640..11284f10738216 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SysLog.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SysLog.cs @@ -29,7 +29,7 @@ internal enum SysLogPriority : int /// /// The message to put in the log entry /// Like printf, the argument is passed to the variadic part of the C++ function to wildcards in the message - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SysLog")] - internal static extern void SysLog(SysLogPriority priority, string message, string arg1); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SysLog", CharSet = CharSet.Ansi)] + internal static partial void SysLog(SysLogPriority priority, string message, string arg1); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.UnixFileSystemTypes.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.UnixFileSystemTypes.cs index d86dcfbe4e59ae..5e4d7a6aa99dec 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.UnixFileSystemTypes.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.UnixFileSystemTypes.cs @@ -145,8 +145,8 @@ internal enum UnixFileSystemTypes : long zfs = 0x2FC12FC1, } - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetFileSystemType")] - private static extern long GetFileSystemType(SafeFileHandle fd); + [GeneratedDllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetFileSystemType")] + private static partial long GetFileSystemType(SafeFileHandle fd); internal static bool TryGetFileSystemType(SafeFileHandle fd, out UnixFileSystemTypes fileSystemType) { diff --git a/src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.NetSecurityNative.IsNtlmInstalled.cs b/src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.NetSecurityNative.IsNtlmInstalled.cs index cae5d6ad0642c1..1f226afe21286f 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.NetSecurityNative.IsNtlmInstalled.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.NetSecurityNative.IsNtlmInstalled.cs @@ -11,8 +11,8 @@ internal static partial class NetSecurityNative [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_IsNtlmInstalled")] internal static partial bool IsNtlmInstalled(); - [DllImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_EnsureGssInitialized")] - private static extern int EnsureGssInitialized(); + [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint = "NetSecurityNative_EnsureGssInitialized")] + private static partial int EnsureGssInitialized(); static NetSecurityNative() { diff --git a/src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.NetSecurityNative.cs b/src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.NetSecurityNative.cs index fc950025174c0f..c8aece74e58851 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.NetSecurityNative.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.NetSecurityNative.cs @@ -11,8 +11,8 @@ internal static partial class Interop { internal static partial class NetSecurityNative { - [DllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseGssBuffer")] - internal static extern void ReleaseGssBuffer( + [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseGssBuffer")] + internal static partial void ReleaseGssBuffer( IntPtr bufferPtr, ulong length); @@ -42,10 +42,10 @@ internal static partial Status ImportPrincipalName( int inputNameByteCount, out SafeGssNameHandle outputName); - [DllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseName")] - internal static unsafe extern Status ReleaseName( - Status* minorStatus, - IntPtr* inputName); + [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseName")] + internal static partial Status ReleaseName( + out Status minorStatus, + ref IntPtr inputName); [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_AcquireAcceptorCred")] internal static partial Status AcquireAcceptorCred( @@ -67,10 +67,10 @@ internal static partial Status InitiateCredWithPassword( int passwordLen, out SafeGssCredHandle outputCredHandle); - [DllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseCred")] - internal static unsafe extern Status ReleaseCred( - Status* minorStatus, - IntPtr* credHandle); + [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_ReleaseCred")] + internal static partial Status ReleaseCred( + out Status minorStatus, + ref IntPtr credHandle); [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_InitSecContext")] internal static partial Status InitSecContext( @@ -113,10 +113,10 @@ internal static partial Status AcceptSecContext( out uint retFlags, out bool isNtlmUsed); - [DllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DeleteSecContext")] - internal static unsafe extern Status DeleteSecContext( - Status* minorStatus, - IntPtr* contextHandle); + [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_DeleteSecContext")] + internal static partial Status DeleteSecContext( + out Status minorStatus, + ref IntPtr contextHandle); [GeneratedDllImport(Interop.Libraries.NetSecurityNative, EntryPoint="NetSecurityNative_GetUser")] internal static partial Status GetUser( diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.cs index 1f5c911383873d..4a7d513f3a7b2a 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.ASN1.cs @@ -15,8 +15,8 @@ internal static partial class Crypto [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjTxt2Obj", CharSet = CharSet.Ansi)] internal static partial SafeAsn1ObjectHandle ObjTxt2Obj(string s); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjObj2Txt")] - private static extern unsafe int ObjObj2Txt(byte* buf, int buf_len, IntPtr a); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjObj2Txt")] + private static unsafe partial int ObjObj2Txt(byte* buf, int buf_len, IntPtr a); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetObjectDefinitionByName", CharSet = CharSet.Ansi)] private static partial IntPtr CryptoNative_GetObjectDefinitionByName(string friendlyName); @@ -32,17 +32,17 @@ internal static IntPtr GetObjectDefinitionByName(string friendlyName) } // Returns shared pointers, should not be tracked as a SafeHandle. - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjNid2Obj")] - internal static extern IntPtr ObjNid2Obj(int nid); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ObjNid2Obj")] + internal static partial IntPtr ObjNid2Obj(int nid); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1ObjectFree")] - internal static extern void Asn1ObjectFree(IntPtr o); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1ObjectFree")] + internal static partial void Asn1ObjectFree(IntPtr o); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeAsn1BitString")] internal static partial SafeAsn1BitStringHandle DecodeAsn1BitString(byte[] buf, int len); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1BitStringFree")] - internal static extern void Asn1BitStringFree(IntPtr o); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1BitStringFree")] + internal static partial void Asn1BitStringFree(IntPtr o); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringNew")] internal static partial SafeAsn1OctetStringHandle Asn1OctetStringNew(); @@ -51,11 +51,11 @@ internal static IntPtr GetObjectDefinitionByName(string friendlyName) [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool Asn1OctetStringSet(SafeAsn1OctetStringHandle o, byte[] d, int len); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringFree")] - internal static extern void Asn1OctetStringFree(IntPtr o); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1OctetStringFree")] + internal static partial void Asn1OctetStringFree(IntPtr o); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1StringFree")] - internal static extern void Asn1StringFree(IntPtr o); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Asn1StringFree")] + internal static partial void Asn1StringFree(IntPtr o); internal static unsafe string GetOidValue(IntPtr asn1ObjectPtr) { 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 b6eb67c99f0231..a4ab395987281a 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 @@ -10,11 +10,11 @@ internal static partial class Interop { internal static partial class Crypto { - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumDestroy")] - internal static extern void BigNumDestroy(IntPtr a); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumDestroy")] + internal static partial void BigNumDestroy(IntPtr a); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumFromBinary")] - private static extern unsafe IntPtr BigNumFromBinary(byte* s, int len); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumFromBinary")] + private static unsafe partial IntPtr BigNumFromBinary(byte* s, int len); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_BigNumToBinary")] private static unsafe partial int BigNumToBinary(SafeBignumHandle a, byte* to); diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs index 444101fb933c51..633d6b09e8a349 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs @@ -82,11 +82,11 @@ internal static int BioTell(SafeBioHandle bio) return Marshal.PtrToStringAnsi(GetX509RootStoreFile_private(&unused)); } - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509RootStorePath")] - private static unsafe extern IntPtr GetX509RootStorePath_private(byte* defaultPath); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509RootStorePath")] + private static unsafe partial IntPtr GetX509RootStorePath_private(byte* defaultPath); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509RootStoreFile")] - private static unsafe extern IntPtr GetX509RootStoreFile_private(byte* defaultPath); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509RootStoreFile")] + private static unsafe partial IntPtr GetX509RootStoreFile_private(byte* defaultPath); [GeneratedDllImport(Libraries.CryptoNative)] private static partial int CryptoNative_X509StoreSetVerifyTime( 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 54d868ecc185cc..ebce6ab847a038 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 @@ -15,8 +15,8 @@ internal static partial class Crypto [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool DsaUpRef(IntPtr dsa); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaDestroy")] - internal static extern void DsaDestroy(IntPtr dsa); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaDestroy")] + internal static partial void DsaDestroy(IntPtr dsa); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DsaGenerateKey")] [return: MarshalAs(UnmanagedType.Bool)] 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 c61707e71c3d85..5b70ebabacb1ec 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 @@ -10,23 +10,23 @@ internal static partial class Interop { internal static partial class Crypto { - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrClearError")] - internal static extern ulong ErrClearError(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrClearError")] + internal static partial ulong ErrClearError(); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrGetErrorAlloc")] private static partial ulong ErrGetErrorAlloc([MarshalAs(UnmanagedType.Bool)] out bool isAllocFailure); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrPeekError")] - internal static extern ulong ErrPeekError(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrPeekError")] + internal static partial ulong ErrPeekError(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrPeekLastError")] - internal static extern ulong ErrPeekLastError(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrPeekLastError")] + internal static partial ulong ErrPeekLastError(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrReasonErrorString")] - internal static extern IntPtr ErrReasonErrorString(ulong error); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrReasonErrorString")] + internal static partial IntPtr ErrReasonErrorString(ulong error); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrErrorStringN")] - private static extern unsafe void ErrErrorStringN(ulong e, byte* buf, int len); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ErrErrorStringN")] + private static unsafe partial void ErrErrorStringN(ulong e, byte* buf, int len); private static unsafe string ErrErrorStringN(ulong error) { diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.Cipher.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.Cipher.cs index ce776027221263..68d18a56983d41 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.Cipher.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.Cipher.cs @@ -71,8 +71,8 @@ internal static void EvpCipherSetCcmNonceLength(SafeEvpCipherCtxHandle ctx, int } } - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherDestroy")] - internal static extern void EvpCipherDestroy(IntPtr ctx); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherDestroy")] + internal static partial void EvpCipherDestroy(IntPtr ctx); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpCipherReset")] [return: MarshalAs(UnmanagedType.Bool)] @@ -228,89 +228,89 @@ internal static void EvpCipherSetCcmTagLength(SafeEvpCipherCtxHandle ctx, int ta } } - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Ecb")] - internal static extern IntPtr EvpAes128Ecb(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Ecb")] + internal static partial IntPtr EvpAes128Ecb(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cbc")] - internal static extern IntPtr EvpAes128Cbc(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cbc")] + internal static partial IntPtr EvpAes128Cbc(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Gcm")] - internal static extern IntPtr EvpAes128Gcm(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Gcm")] + internal static partial IntPtr EvpAes128Gcm(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cfb8")] - internal static extern IntPtr EvpAes128Cfb8(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cfb8")] + internal static partial IntPtr EvpAes128Cfb8(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cfb128")] - internal static extern IntPtr EvpAes128Cfb128(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Cfb128")] + internal static partial IntPtr EvpAes128Cfb128(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Ccm")] - internal static extern IntPtr EvpAes128Ccm(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes128Ccm")] + internal static partial IntPtr EvpAes128Ccm(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Ecb")] - internal static extern IntPtr EvpAes192Ecb(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Ecb")] + internal static partial IntPtr EvpAes192Ecb(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cbc")] - internal static extern IntPtr EvpAes192Cbc(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cbc")] + internal static partial IntPtr EvpAes192Cbc(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Gcm")] - internal static extern IntPtr EvpAes192Gcm(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Gcm")] + internal static partial IntPtr EvpAes192Gcm(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cfb8")] - internal static extern IntPtr EvpAes192Cfb8(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cfb8")] + internal static partial IntPtr EvpAes192Cfb8(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cfb128")] - internal static extern IntPtr EvpAes192Cfb128(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Cfb128")] + internal static partial IntPtr EvpAes192Cfb128(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Ccm")] - internal static extern IntPtr EvpAes192Ccm(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes192Ccm")] + internal static partial IntPtr EvpAes192Ccm(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Ecb")] - internal static extern IntPtr EvpAes256Ecb(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Ecb")] + internal static partial IntPtr EvpAes256Ecb(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cbc")] - internal static extern IntPtr EvpAes256Cbc(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cbc")] + internal static partial IntPtr EvpAes256Cbc(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Gcm")] - internal static extern IntPtr EvpAes256Gcm(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Gcm")] + internal static partial IntPtr EvpAes256Gcm(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cfb128")] - internal static extern IntPtr EvpAes256Cfb128(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cfb128")] + internal static partial IntPtr EvpAes256Cfb128(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cfb8")] - internal static extern IntPtr EvpAes256Cfb8(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Cfb8")] + internal static partial IntPtr EvpAes256Cfb8(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Ccm")] - internal static extern IntPtr EvpAes256Ccm(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpAes256Ccm")] + internal static partial IntPtr EvpAes256Ccm(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesCbc")] - internal static extern IntPtr EvpDesCbc(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesCbc")] + internal static partial IntPtr EvpDesCbc(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesEcb")] - internal static extern IntPtr EvpDesEcb(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesEcb")] + internal static partial IntPtr EvpDesEcb(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesCfb8")] - internal static extern IntPtr EvpDesCfb8(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDesCfb8")] + internal static partial IntPtr EvpDesCfb8(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cbc")] - internal static extern IntPtr EvpDes3Cbc(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cbc")] + internal static partial IntPtr EvpDes3Cbc(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Ecb")] - internal static extern IntPtr EvpDes3Ecb(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Ecb")] + internal static partial IntPtr EvpDes3Ecb(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cfb8")] - internal static extern IntPtr EvpDes3Cfb8(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cfb8")] + internal static partial IntPtr EvpDes3Cfb8(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cfb64")] - internal static extern IntPtr EvpDes3Cfb64(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDes3Cfb64")] + internal static partial IntPtr EvpDes3Cfb64(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpRC2Cbc")] - internal static extern IntPtr EvpRC2Cbc(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpRC2Cbc")] + internal static partial IntPtr EvpRC2Cbc(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpRC2Ecb")] - internal static extern IntPtr EvpRC2Ecb(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpRC2Ecb")] + internal static partial IntPtr EvpRC2Ecb(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpChaCha20Poly1305")] - internal static extern IntPtr EvpChaCha20Poly1305(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpChaCha20Poly1305")] + internal static partial IntPtr EvpChaCha20Poly1305(); internal enum EvpCipherDirection : int { diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.DigestAlgs.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.DigestAlgs.cs index 53ef644d84b974..465d67c0eccfef 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.DigestAlgs.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.DigestAlgs.cs @@ -15,32 +15,32 @@ internal static partial class Crypto private static volatile IntPtr s_evpSha384; private static volatile IntPtr s_evpSha512; - [DllImport(Libraries.CryptoNative)] - private static extern IntPtr CryptoNative_EvpMd5(); + [GeneratedDllImport(Libraries.CryptoNative)] + private static partial IntPtr CryptoNative_EvpMd5(); internal static IntPtr EvpMd5() => s_evpMd5 != IntPtr.Zero ? s_evpMd5 : (s_evpMd5 = CryptoNative_EvpMd5()); - [DllImport(Libraries.CryptoNative)] - internal static extern IntPtr CryptoNative_EvpSha1(); + [GeneratedDllImport(Libraries.CryptoNative)] + internal static partial IntPtr CryptoNative_EvpSha1(); internal static IntPtr EvpSha1() => s_evpSha1 != IntPtr.Zero ? s_evpSha1 : (s_evpSha1 = CryptoNative_EvpSha1()); - [DllImport(Libraries.CryptoNative)] - internal static extern IntPtr CryptoNative_EvpSha256(); + [GeneratedDllImport(Libraries.CryptoNative)] + internal static partial IntPtr CryptoNative_EvpSha256(); internal static IntPtr EvpSha256() => s_evpSha256 != IntPtr.Zero ? s_evpSha256 : (s_evpSha256 = CryptoNative_EvpSha256()); - [DllImport(Libraries.CryptoNative)] - internal static extern IntPtr CryptoNative_EvpSha384(); + [GeneratedDllImport(Libraries.CryptoNative)] + internal static partial IntPtr CryptoNative_EvpSha384(); internal static IntPtr EvpSha384() => s_evpSha384 != IntPtr.Zero ? s_evpSha384 : (s_evpSha384 = CryptoNative_EvpSha384()); - [DllImport(Libraries.CryptoNative)] - internal static extern IntPtr CryptoNative_EvpSha512(); + [GeneratedDllImport(Libraries.CryptoNative)] + internal static partial IntPtr CryptoNative_EvpSha512(); internal static IntPtr EvpSha512() => s_evpSha512 != IntPtr.Zero ? s_evpSha512 : (s_evpSha512 = CryptoNative_EvpSha512()); diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.cs index 1c853dfb47cc2b..42adb07994d2d3 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.cs @@ -13,8 +13,8 @@ internal static partial class Crypto [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdCtxCreate")] internal static partial SafeEvpMdCtxHandle EvpMdCtxCreate(IntPtr type); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdCtxDestroy")] - internal static extern void EvpMdCtxDestroy(IntPtr ctx); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdCtxDestroy")] + internal static partial void EvpMdCtxDestroy(IntPtr ctx); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestReset")] internal static partial int EvpDigestReset(SafeEvpMdCtxHandle ctx, IntPtr type); @@ -31,17 +31,17 @@ internal static int EvpDigestUpdate(SafeEvpMdCtxHandle ctx, ReadOnlySpan d [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestCurrent")] internal static partial int EvpDigestCurrent(SafeEvpMdCtxHandle ctx, ref byte md, ref uint s); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestOneShot")] - internal static unsafe extern int EvpDigestOneShot(IntPtr type, byte* source, int sourceSize, byte* md, uint* mdSize); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestOneShot")] + internal static unsafe partial int EvpDigestOneShot(IntPtr type, byte* source, int sourceSize, byte* md, uint* mdSize); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdSize")] - internal static extern int EvpMdSize(IntPtr md); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdSize")] + internal static partial int EvpMdSize(IntPtr md); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetMaxMdSize")] - private static extern int GetMaxMdSize(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetMaxMdSize")] + private static partial int GetMaxMdSize(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pbkdf2")] - private static unsafe extern int Pbkdf2( + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pbkdf2")] + private static unsafe partial int Pbkdf2( byte* pPassword, int passwordLength, byte* pSalt, 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 44cc49e07be946..8051dc5bfd3cf0 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 @@ -23,8 +23,8 @@ internal static partial class Crypto return handle; } - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyDestroy")] - internal static extern void EcKeyDestroy(IntPtr a); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyDestroy")] + internal static partial void EcKeyDestroy(IntPtr a); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EcKeyGenerateKey")] [return: MarshalAs(UnmanagedType.Bool)] diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.Ecdh.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.Ecdh.cs index a097a5bf31ad51..01e12ffbb55bf5 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.Ecdh.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.Ecdh.cs @@ -20,8 +20,8 @@ private static partial int EvpPKeyDeriveSecretAgreement( uint secretLength, SafeEvpPKeyCtxHandle ctx); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeyCtxDestroy")] - internal static extern void EvpPKeyCtxDestroy(IntPtr ctx); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeyCtxDestroy")] + internal static partial void EvpPKeyCtxDestroy(IntPtr ctx); internal static void EvpPKeyDeriveSecretAgreement(SafeEvpPKeyCtxHandle ctx, Span destination) { diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.cs index 0cea642fcf90bf..593c6f4e593f6d 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EvpPkey.cs @@ -13,8 +13,8 @@ internal static partial class Crypto [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyCreate")] internal static partial SafeEvpPKeyHandle EvpPkeyCreate(); - [DllImport(Libraries.CryptoNative)] - private static extern SafeEvpPKeyHandle CryptoNative_EvpPKeyDuplicate( + [GeneratedDllImport(Libraries.CryptoNative)] + private static partial SafeEvpPKeyHandle CryptoNative_EvpPKeyDuplicate( SafeEvpPKeyHandle currentKey, EvpAlgorithmId algorithmId); @@ -37,8 +37,8 @@ internal static SafeEvpPKeyHandle EvpPKeyDuplicate( return pkey; } - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyDestroy")] - internal static extern void EvpPkeyDestroy(IntPtr pkey); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPkeyDestroy")] + internal static partial void EvpPkeyDestroy(IntPtr pkey); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpPKeySize")] internal static partial int EvpPKeySize(SafeEvpPKeyHandle pkey); @@ -104,8 +104,8 @@ internal static unsafe SafeEvpPKeyHandle DecodePkcs8PrivateKey( return handle; } - [DllImport(Libraries.CryptoNative)] - private static extern int CryptoNative_GetPkcs8PrivateKeySize(IntPtr pkey); + [GeneratedDllImport(Libraries.CryptoNative)] + private static partial int CryptoNative_GetPkcs8PrivateKeySize(IntPtr pkey); private static int GetPkcs8PrivateKeySize(IntPtr pkey) { @@ -119,8 +119,8 @@ private static int GetPkcs8PrivateKeySize(IntPtr pkey) return ret; } - [DllImport(Libraries.CryptoNative)] - private static extern unsafe int CryptoNative_EncodePkcs8PrivateKey(IntPtr pkey, byte* buf); + [GeneratedDllImport(Libraries.CryptoNative)] + private static unsafe partial int CryptoNative_EncodePkcs8PrivateKey(IntPtr pkey, byte* buf); internal static ArraySegment RentEncodePkcs8PrivateKey(SafeEvpPKeyHandle pkey) { @@ -155,8 +155,8 @@ internal static ArraySegment RentEncodePkcs8PrivateKey(SafeEvpPKeyHandle p } } - [DllImport(Libraries.CryptoNative)] - private static extern int CryptoNative_GetSubjectPublicKeyInfoSize(IntPtr pkey); + [GeneratedDllImport(Libraries.CryptoNative)] + private static partial int CryptoNative_GetSubjectPublicKeyInfoSize(IntPtr pkey); private static int GetSubjectPublicKeyInfoSize(IntPtr pkey) { @@ -170,8 +170,8 @@ private static int GetSubjectPublicKeyInfoSize(IntPtr pkey) return ret; } - [DllImport(Libraries.CryptoNative)] - private static extern unsafe int CryptoNative_EncodeSubjectPublicKeyInfo(IntPtr pkey, byte* buf); + [GeneratedDllImport(Libraries.CryptoNative)] + private static unsafe partial int CryptoNative_EncodeSubjectPublicKeyInfo(IntPtr pkey, byte* buf); internal static ArraySegment RentEncodeSubjectPublicKeyInfo(SafeEvpPKeyHandle pkey) { diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Hmac.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Hmac.cs index e689be5b60bcca..88cae2dad5ac17 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Hmac.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Hmac.cs @@ -13,8 +13,8 @@ internal static partial class Crypto [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacCreate")] internal static partial SafeHmacCtxHandle HmacCreate(ref byte key, int keyLen, IntPtr md); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacDestroy")] - internal static extern void HmacDestroy(IntPtr ctx); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacDestroy")] + internal static partial void HmacDestroy(IntPtr ctx); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacReset")] internal static partial int HmacReset(SafeHmacCtxHandle ctx); @@ -31,8 +31,8 @@ internal static int HmacUpdate(SafeHmacCtxHandle ctx, ReadOnlySpan data, i [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacCurrent")] internal static partial int HmacCurrent(SafeHmacCtxHandle ctx, ref byte data, ref int len); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacOneShot")] - private static unsafe extern int HmacOneShot(IntPtr type, byte* key, int keySize, byte* source, int sourceSize, byte* md, int* mdSize); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_HmacOneShot")] + private static unsafe partial int HmacOneShot(IntPtr type, byte* key, int keySize, byte* source, int sourceSize, byte* md, int* mdSize); internal static unsafe int HmacOneShot(IntPtr type, ReadOnlySpan key, ReadOnlySpan source, Span destination) { diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs index 482741b22ca622..e7afaa13620d13 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs @@ -27,7 +27,7 @@ static OpenSsl() } } - internal static class CryptoInitializer + internal static partial class CryptoInitializer { static CryptoInitializer() { @@ -48,7 +48,7 @@ internal static void Initialize() // No-op that exists to provide a hook for other static constructors. } - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EnsureOpenSslInitialized")] - private static extern int EnsureOpenSslInitialized(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EnsureOpenSslInitialized")] + private static partial int EnsureOpenSslInitialized(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.LegacyAlgorithms.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.LegacyAlgorithms.cs index 5304a67af688af..d3fada1b91498f 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.LegacyAlgorithms.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.LegacyAlgorithms.cs @@ -10,8 +10,8 @@ internal static partial class Crypto private static volatile bool s_loadedLegacy; private static readonly object s_legacyLoadLock = new object(); - [DllImport(Libraries.CryptoNative)] - private static extern void CryptoNative_RegisterLegacyAlgorithms(); + [GeneratedDllImport(Libraries.CryptoNative)] + private static partial void CryptoNative_RegisterLegacyAlgorithms(); internal static void EnsureLegacyAlgorithmsRegistered() { diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OCSP.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OCSP.cs index c052f5a4c5fe55..86ec6c33191e00 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OCSP.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OCSP.cs @@ -12,8 +12,8 @@ internal static partial class Interop { internal static partial class Crypto { - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OcspRequestDestroy")] - internal static extern void OcspRequestDestroy(IntPtr ocspReq); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OcspRequestDestroy")] + internal static partial void OcspRequestDestroy(IntPtr ocspReq); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetOcspRequestDerSize")] internal static partial int GetOcspRequestDerSize(SafeOcspRequestHandle req); @@ -31,8 +31,8 @@ ref MemoryMarshal.GetReference(buf), buf.Length); } - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OcspResponseDestroy")] - internal static extern void OcspResponseDestroy(IntPtr ocspReq); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OcspResponseDestroy")] + internal static partial void OcspResponseDestroy(IntPtr ocspReq); [GeneratedDllImport(Libraries.CryptoNative, CharSet = CharSet.Ansi)] private static partial int CryptoNative_X509ChainGetCachedOcspStatus( diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslAvailable.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslAvailable.cs index 66b3f72ddd02ea..696efb3b209a15 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslAvailable.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslAvailable.cs @@ -6,10 +6,10 @@ internal static partial class Interop { - internal static class OpenSslNoInit + internal static partial class OpenSslNoInit { - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslAvailable")] - private static extern int OpenSslAvailable(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslAvailable")] + private static partial int OpenSslAvailable(); private static readonly Lazy s_openSslAvailable = new Lazy(() => OpenSslAvailable() != 0); diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslVersion.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslVersion.cs index 7b89a34b0e0014..c7b4c22f14aa94 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslVersion.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSslVersion.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class OpenSsl { - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslVersionNumber")] - internal static extern long OpenSslVersionNumber(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_OpenSslVersionNumber")] + internal static partial long OpenSslVersionNumber(); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Pkcs7.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Pkcs7.cs index 657e7cbcda4b9e..a1d5568e42edf5 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Pkcs7.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Pkcs7.cs @@ -24,8 +24,8 @@ internal static SafePkcs7Handle DecodePkcs7(ReadOnlySpan buf) => [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pkcs7CreateCertificateCollection")] internal static partial SafePkcs7Handle Pkcs7CreateCertificateCollection(SafeX509StackHandle certs); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pkcs7Destroy")] - internal static extern void Pkcs7Destroy(IntPtr p7); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_Pkcs7Destroy")] + internal static partial void Pkcs7Destroy(IntPtr p7); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetPkcs7Certificates")] private static partial int GetPkcs7Certificates(SafePkcs7Handle p7, out SafeSharedX509StackHandle certs); diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.RAND.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.RAND.cs index f01afda233ca6e..10e501f7631b04 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.RAND.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.RAND.cs @@ -15,7 +15,7 @@ internal static unsafe bool GetRandomBytes(byte* pbBuffer, int count) return CryptoNative_GetRandomBytes(pbBuffer, count) != 0; } - [DllImport(Libraries.CryptoNative)] - private static extern unsafe int CryptoNative_GetRandomBytes(byte* buf, int num); + [GeneratedDllImport(Libraries.CryptoNative)] + private static unsafe partial int CryptoNative_GetRandomBytes(byte* buf, int num); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SetProtocolOptions.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SetProtocolOptions.cs index a8439617d1d689..66431af192dcac 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SetProtocolOptions.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.SetProtocolOptions.cs @@ -10,10 +10,10 @@ internal static partial class Interop { internal static partial class Ssl { - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetProtocolOptions")] - internal static extern void SslCtxSetProtocolOptions(IntPtr ctx, SslProtocols protocols); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetProtocolOptions")] + internal static partial void SslCtxSetProtocolOptions(IntPtr ctx, SslProtocols protocols); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetProtocolOptions")] - internal static extern void SslCtxSetProtocolOptions(SafeSslContextHandle ctx, SslProtocols protocols); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCtxSetProtocolOptions")] + internal static partial void SslCtxSetProtocolOptions(SafeSslContextHandle ctx, SslProtocols protocols); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs index a2fdddd69979f9..1db80064b2c80c 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs @@ -18,11 +18,11 @@ internal static partial class Ssl internal const int SSL_TLSEXT_ERR_ALERT_FATAL = 2; internal const int SSL_TLSEXT_ERR_NOACK = 3; - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EnsureLibSslInitialized")] - internal static extern void EnsureLibSslInitialized(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EnsureLibSslInitialized")] + internal static partial void EnsureLibSslInitialized(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslV2_3Method")] - internal static extern IntPtr SslV2_3Method(); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslV2_3Method")] + internal static partial IntPtr SslV2_3Method(); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslCreate")] internal static partial SafeSslHandle SslCreate(SafeSslContextHandle ctx); @@ -30,14 +30,14 @@ internal static partial class Ssl [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetError")] internal static partial SslErrorCode SslGetError(SafeSslHandle ssl, int ret); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetError")] - internal static extern SslErrorCode SslGetError(IntPtr ssl, int ret); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetError")] + internal static partial SslErrorCode SslGetError(IntPtr ssl, int ret); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetQuietShutdown")] internal static partial void SslSetQuietShutdown(SafeSslHandle ssl, int mode); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslDestroy")] - internal static extern void SslDestroy(IntPtr ssl); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslDestroy")] + internal static partial void SslDestroy(IntPtr ssl); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetConnectState")] internal static partial void SslSetConnectState(SafeSslHandle ssl); @@ -85,8 +85,8 @@ internal static partial class Ssl [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool IsSslRenegotiatePending(SafeSslHandle ssl); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslShutdown")] - internal static extern int SslShutdown(IntPtr ssl); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslShutdown")] + internal static partial int SslShutdown(IntPtr ssl); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslShutdown")] internal static partial int SslShutdown(SafeSslHandle ssl); @@ -134,20 +134,20 @@ internal static partial class Ssl [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetOpenSslCipherSuiteName")] private static partial IntPtr GetOpenSslCipherSuiteName(SafeSslHandle ssl, int cipherSuite, out int isTls12OrLower); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SetCiphers")] - internal static extern unsafe bool SslSetCiphers(SafeSslHandle ssl, byte* cipherList, byte* cipherSuites); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SetCiphers")] + internal static unsafe partial bool SslSetCiphers(SafeSslHandle ssl, byte* cipherList, byte* cipherSuites); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetVerifyPeer")] - internal static extern void SslSetVerifyPeer(SafeSslHandle ssl); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetVerifyPeer")] + internal static partial void SslSetVerifyPeer(SafeSslHandle ssl); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetData")] - internal static extern IntPtr SslGetData(IntPtr ssl); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslGetData")] + internal static partial IntPtr SslGetData(IntPtr ssl); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetData")] - internal static extern int SslSetData(SafeSslHandle ssl, IntPtr data); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetData")] + internal static partial int SslSetData(SafeSslHandle ssl, IntPtr data); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetData")] - internal static extern int SslSetData(IntPtr ssl, IntPtr data); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SslSetData")] + internal static partial int SslSetData(IntPtr ssl, IntPtr data); internal static unsafe int SslSetAlpnProtos(SafeSslHandle ssl, List protocols) { @@ -190,8 +190,8 @@ internal static byte[] ConvertAlpnProtocolListToByteArray(List callback, IntPtr arg); diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509.cs index 6e3775df4bf6ae..deddc37736c908 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509.cs @@ -47,8 +47,8 @@ internal static partial class Crypto [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EncodeX509")] internal static partial int EncodeX509(SafeX509Handle x, byte[] buf); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Destroy")] - internal static extern void X509Destroy(IntPtr a); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509Destroy")] + internal static partial void X509Destroy(IntPtr a); /// /// Clone the input certificate into a new object. @@ -131,12 +131,12 @@ internal static SafeSharedAsn1OctetStringHandle X509FindExtensionData(SafeX509Ha internal static partial IntPtr X509GetExt(SafeX509Handle x, int loc); // Returns a pointer already being tracked by a SafeX509Handle, shouldn't be SafeHandle tracked/freed. - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetOid")] - internal static extern IntPtr X509ExtensionGetOid(IntPtr ex); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetOid")] + internal static partial IntPtr X509ExtensionGetOid(IntPtr ex); // Returns a pointer already being tracked by a SafeX509Handle, shouldn't be SafeHandle tracked/freed. - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetData")] - internal static extern IntPtr X509ExtensionGetData(IntPtr ex); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetData")] + internal static partial IntPtr X509ExtensionGetData(IntPtr ex); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionGetCritical")] [return: MarshalAs(UnmanagedType.Bool)] @@ -157,8 +157,8 @@ internal static SafeX509StoreHandle X509ChainNew(SafeX509StackHandle systemTrust return store; } - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreDestory")] - internal static extern void X509StoreDestory(IntPtr v); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreDestory")] + internal static partial void X509StoreDestory(IntPtr v); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreAddCrl")] [return: MarshalAs(UnmanagedType.Bool)] @@ -244,11 +244,11 @@ internal static string GetX509VerifyCertErrorString(int n) return Marshal.PtrToStringAnsi(X509VerifyCertErrorString(n))!; } - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509VerifyCertErrorString")] - private static extern IntPtr X509VerifyCertErrorString(int n); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509VerifyCertErrorString")] + private static partial IntPtr X509VerifyCertErrorString(int n); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509CrlDestroy")] - internal static extern void X509CrlDestroy(IntPtr a); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509CrlDestroy")] + internal static partial void X509CrlDestroy(IntPtr a); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_PemWriteBioX509Crl")] internal static partial int PemWriteBioX509Crl(SafeBioHandle bio, SafeX509CrlHandle crl); diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Ext.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Ext.cs index f3d47ec4c293a1..1d3d385ab991b0 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Ext.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Ext.cs @@ -15,8 +15,8 @@ internal static partial SafeX509ExtensionHandle X509ExtensionCreateByObj( [MarshalAs(UnmanagedType.Bool)] bool isCritical, SafeAsn1OctetStringHandle data); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionDestroy")] - internal static extern int X509ExtensionDestroy(IntPtr x); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509ExtensionDestroy")] + internal static partial int X509ExtensionDestroy(IntPtr x); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509V3ExtPrint")] [return: MarshalAs(UnmanagedType.Bool)] @@ -34,7 +34,7 @@ internal static partial bool DecodeX509BasicConstraints2Extension( [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_DecodeExtendedKeyUsage")] internal static partial SafeEkuExtensionHandle DecodeExtendedKeyUsage(byte[] buf, int len); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ExtendedKeyUsageDestory")] - internal static extern void ExtendedKeyUsageDestory(IntPtr a); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_ExtendedKeyUsageDestory")] + internal static partial void ExtendedKeyUsageDestory(IntPtr a); } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Stack.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Stack.cs index 2bf09b7eb9f50e..f3ee9c3e22bb69 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Stack.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509Stack.cs @@ -12,8 +12,8 @@ internal static partial class Crypto [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_NewX509Stack")] internal static partial SafeX509StackHandle NewX509Stack(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_RecursiveFreeX509Stack")] - internal static extern void RecursiveFreeX509Stack(IntPtr stack); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_RecursiveFreeX509Stack")] + internal static partial void RecursiveFreeX509Stack(IntPtr stack); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetX509StackFieldCount")] internal static partial int GetX509StackFieldCount(SafeX509StackHandle stack); diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509StoreCtx.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509StoreCtx.cs index 8325165c5cfa8b..48ecb91554d753 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509StoreCtx.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509StoreCtx.cs @@ -12,8 +12,8 @@ internal static partial class Crypto [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxCreate")] internal static partial SafeX509StoreCtxHandle X509StoreCtxCreate(); - [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxDestroy")] - internal static extern void X509StoreCtxDestroy(IntPtr v); + [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxDestroy")] + internal static partial void X509StoreCtxDestroy(IntPtr v); [GeneratedDllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_X509StoreCtxGetChain")] internal static partial SafeX509StackHandle X509StoreCtxGetChain(SafeX509StoreCtxHandle ctx); diff --git a/src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsOpenObject.cs b/src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsOpenObject.cs new file mode 100644 index 00000000000000..2ed72a63ca58c4 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Activeds/Interop.ADsOpenObject.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Activeds + { + [DllImport(Interop.Libraries.Activeds, CharSet = CharSet.Unicode, ExactSpelling = true)] + internal static extern int ADsOpenObject(string path, string userName, string password, int flags, [In, Out] ref Guid iid, [Out, MarshalAs(UnmanagedType.Interface)] out object ppObject); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.AdjustTokenPrivileges.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.AdjustTokenPrivileges.cs index 5a3faa36313b35..43180a47986768 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.AdjustTokenPrivileges.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.AdjustTokenPrivileges.cs @@ -9,13 +9,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] internal static unsafe partial bool AdjustTokenPrivileges( -#else - [DllImport(Libraries.Advapi32, SetLastError = true)] - internal static extern unsafe bool AdjustTokenPrivileges( -#endif SafeTokenHandle TokenHandle, bool DisableAllPrivileges, TOKEN_PRIVILEGE* NewState, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CheckTokenMembership.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CheckTokenMembership.cs index 44cd0079900900..3a801d8702712b 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CheckTokenMembership.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CheckTokenMembership.cs @@ -9,13 +9,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] internal static partial bool CheckTokenMembership( -#else - [DllImport(Interop.Libraries.Advapi32, SetLastError = true)] - internal static extern bool CheckTokenMembership( -#endif SafeAccessTokenHandle TokenHandle, byte[] SidToCheck, ref bool IsMember); diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ClearEventLog.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ClearEventLog.cs index a432d1d8dba052..0d5be5c792e24d 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ClearEventLog.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ClearEventLog.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] - public static extern bool ClearEventLog(SafeEventLogReadHandle hEventLog, string lpBackupFileName); + [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] + public static partial bool ClearEventLog(SafeEventLogReadHandle hEventLog, string lpBackupFileName); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CloseEventLog.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CloseEventLog.cs index fcede9daf4f921..2084a703f79f97 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CloseEventLog.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CloseEventLog.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, SetLastError = true)] - internal static extern bool CloseEventLog(IntPtr hEventLog); + [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + internal static partial bool CloseEventLog(IntPtr hEventLog); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CloseServiceHandle.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CloseServiceHandle.cs index d1103c58f8526e..0ae607c6d35813 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CloseServiceHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CloseServiceHandle.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CloseServiceHandle(IntPtr handle); + [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + internal static partial bool CloseServiceHandle(IntPtr handle); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ControlService.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ControlService.cs index 4b74a032ad124f..7a69515f2c8f5a 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ControlService.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ControlService.cs @@ -9,8 +9,8 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern unsafe bool ControlService(SafeServiceHandle serviceHandle, int control, SERVICE_STATUS* pStatus); + [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + internal static unsafe partial bool ControlService(SafeServiceHandle serviceHandle, int control, SERVICE_STATUS* pStatus); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertSidToStringSid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertSidToStringSid.cs new file mode 100644 index 00000000000000..998f854acfd997 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertSidToStringSid.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Advapi32 + { + [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "ConvertSidToStringSidW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial BOOL ConvertSidToStringSid(IntPtr sid, ref string stringSid); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSecurityDescriptorToSecurityDescriptor.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSecurityDescriptorToSecurityDescriptor.cs index 1cda9c2b583044..eb87d49e0fdbf6 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSecurityDescriptorToSecurityDescriptor.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSecurityDescriptorToSecurityDescriptor.cs @@ -9,11 +9,11 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Interop.Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true, BestFitMapping = false)] - internal static extern bool ConvertStringSecurityDescriptorToSecurityDescriptor( - string StringSecurityDescriptor, - int StringSDRevision, - out SafeLocalAllocHandle pSecurityDescriptor, - IntPtr SecurityDescriptorSize); + [GeneratedDllImport(Interop.Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial bool ConvertStringSecurityDescriptorToSecurityDescriptor( + string StringSecurityDescriptor, + int StringSDRevision, + out SafeLocalAllocHandle pSecurityDescriptor, + IntPtr SecurityDescriptorSize); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSidToSid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSidToSid.cs index 63f5b0a0d44c59..9b9ef01ffcde18 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSidToSid.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ConvertStringSidToSid.cs @@ -8,13 +8,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSidToSidW", CharSet = CharSet.Unicode, SetLastError = true)] - internal static partial int ConvertStringSidToSid( -#else - [DllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSidToSidW", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern int ConvertStringSidToSid( -#endif + [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "ConvertStringSidToSidW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial BOOL ConvertStringSidToSid( string stringSid, out IntPtr ByteArray); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CopySid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CopySid.cs new file mode 100644 index 00000000000000..ba978bad6aafb6 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CopySid.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Advapi32 + { + [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] + internal static partial bool CopySid(int destinationLength, IntPtr pSidDestination, IntPtr pSidSource); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateWellKnownSid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateWellKnownSid.cs index 69c014a936236e..cc93f468142424 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateWellKnownSid.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateWellKnownSid.cs @@ -8,13 +8,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "CreateWellKnownSid", CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "CreateWellKnownSid", SetLastError = true)] internal static partial int CreateWellKnownSid( -#else - [DllImport(Interop.Libraries.Advapi32, EntryPoint = "CreateWellKnownSid", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern int CreateWellKnownSid( -#endif int sidType, byte[]? domainSid, byte[] resultSid, 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 d45b7e14e9200f..bffdc2007e9120 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptAcquireContext.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptAcquireContext.cs @@ -20,13 +20,8 @@ internal enum CryptAcquireContextFlags : uint CRYPT_VERIFYCONTEXT = 0xF0000000 // CRYPT_VERIFYCONTEXT } -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CryptAcquireContextW", CharSet = CharSet.Unicode, SetLastError = true)] public static partial bool CryptAcquireContext( -#else - [DllImport(Libraries.Advapi32, EntryPoint = "CryptAcquireContextW", CharSet = CharSet.Unicode, SetLastError = true)] - public static extern bool CryptAcquireContext( -#endif out SafeProvHandle phProv, string? szContainer, string? szProvider, diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.cryptoapi.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptAcquireContext_IntPtr.cs similarity index 55% rename from src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.cryptoapi.cs rename to src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptAcquireContext_IntPtr.cs index 8b3c2d043b457f..142b7ec549b85e 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.cryptoapi.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptAcquireContext_IntPtr.cs @@ -2,20 +2,19 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; -using System.Text; -using System.Diagnostics; using System.Runtime.InteropServices; - -using Internal.Cryptography; -using Internal.Cryptography.Pal.Native; - internal static partial class Interop { - public static partial class cryptoapi + internal static partial class Advapi32 { [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "CryptAcquireContextW", CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] - public static unsafe partial bool CryptAcquireContext(out IntPtr psafeProvHandle, char* pszContainer, char* pszProvider, int dwProvType, CryptAcquireContextFlags dwFlags); + internal static unsafe partial bool CryptAcquireContext( + out IntPtr psafeProvHandle, + char* pszContainer, + char* pszProvider, + int dwProvType, + Interop.Crypt32.CryptAcquireContextFlags dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDestroyHash.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDestroyHash.cs index 8635ce377299ce..5c2b78f75edff9 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDestroyHash.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDestroyHash.cs @@ -8,12 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] public static partial bool CryptDestroyHash(IntPtr hHash); -#else - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] - public static extern bool CryptDestroyHash(IntPtr hHash); -#endif } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDestroyKey.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDestroyKey.cs index 5bc36fbfd6c15d..07074948d46b24 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDestroyKey.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptDestroyKey.cs @@ -8,12 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] public static partial bool CryptDestroyKey(IntPtr hKey); -#else - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] - public static extern bool CryptDestroyKey(IntPtr hKey); -#endif } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetProvParam.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetProvParam.cs index d5a6b6dcb5f8c6..bacf09eb89d205 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetProvParam.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetProvParam.cs @@ -22,37 +22,22 @@ internal enum CryptProvParam : int PP_UNIQUE_CONTAINER = 36 } -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] public static partial bool CryptSetProvParam( -#else - [DllImport(Libraries.Advapi32, SetLastError = true)] - public static extern bool CryptSetProvParam( -#endif SafeHandle safeProvHandle, CryptProvParam dwParam, IntPtr pbData, int dwFlags); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] public static partial bool CryptSetProvParam( -#else - [DllImport(Libraries.Advapi32, SetLastError = true)] - public static extern bool CryptSetProvParam( -#endif SafeProvHandle hProv, CryptProvParam dwParam, ref IntPtr pbData, int dwFlags); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] public static partial bool CryptGetProvParam( -#else - [DllImport(Libraries.Advapi32, SetLastError = true)] - public static extern bool CryptGetProvParam( -#endif SafeHandle safeProvHandle, CryptProvParam dwParam, IntPtr pbData, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptReleaseContext.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptReleaseContext.cs index f36800f515057f..30c806a0770a05 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptReleaseContext.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptReleaseContext.cs @@ -8,13 +8,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] public static partial bool CryptReleaseContext( -#else - [DllImport(Libraries.Advapi32, SetLastError = true)] - public static extern bool CryptReleaseContext( -#endif IntPtr hProv, int dwFlags); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DeregisterEventSource.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DeregisterEventSource.cs index b4f712313ed699..b7886faf85843a 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DeregisterEventSource.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DeregisterEventSource.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, SetLastError = true)] - internal static extern bool DeregisterEventSource(IntPtr hEventLog); + [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + internal static partial bool DeregisterEventSource(IntPtr hEventLog); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DuplicateTokenEx.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DuplicateTokenEx.cs index 9f4fd71dc6249b..b404bed080d415 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DuplicateTokenEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DuplicateTokenEx.cs @@ -9,13 +9,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] internal static partial bool DuplicateTokenEx( -#else - [DllImport(Interop.Libraries.Advapi32, SetLastError = true)] - internal static extern bool DuplicateTokenEx( -#endif SafeAccessTokenHandle hExistingToken, uint dwDesiredAccess, IntPtr lpTokenAttributes, // LPSECURITY_ATTRIBUTES diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DuplicateTokenEx_SafeTokenHandle.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DuplicateTokenEx_SafeTokenHandle.cs index 9e45c078e6ad65..2640b5bc9f143e 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DuplicateTokenEx_SafeTokenHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.DuplicateTokenEx_SafeTokenHandle.cs @@ -10,13 +10,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] internal static partial bool DuplicateTokenEx( -#else - [DllImport(Interop.Libraries.Advapi32, SetLastError = true)] - internal static extern bool DuplicateTokenEx( -#endif SafeTokenHandle ExistingTokenHandle, TokenAccessLevels DesiredAccess, IntPtr TokenAttributes, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EncryptDecrypt.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EncryptDecrypt.cs index 659fbe352c6877..2b60007102466c 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EncryptDecrypt.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EncryptDecrypt.cs @@ -11,13 +11,8 @@ internal static partial class Advapi32 /// /// WARNING: This method does not implicitly handle long paths. Use EncryptFile. /// -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "EncryptFileW", CharSet = CharSet.Unicode, SetLastError = true)] private static partial bool EncryptFilePrivate(string lpFileName); -#else - [DllImport(Libraries.Advapi32, EntryPoint = "EncryptFileW", CharSet = CharSet.Unicode, SetLastError = true)] - private static extern bool EncryptFilePrivate(string lpFileName); -#endif internal static bool EncryptFile(string path) { @@ -28,13 +23,8 @@ internal static bool EncryptFile(string path) /// /// WARNING: This method does not implicitly handle long paths. Use DecryptFile. /// -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "DecryptFileW", CharSet = CharSet.Unicode, SetLastError = true)] private static partial bool DecryptFileFilePrivate( -#else - [DllImport(Libraries.Advapi32, EntryPoint = "DecryptFileW", CharSet = CharSet.Unicode, SetLastError = true)] - private static extern bool DecryptFileFilePrivate( -#endif string lpFileName, int dwReserved); diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EnumDependentServices.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EnumDependentServices.cs index e5112e3d525701..bcff544236ba75 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EnumDependentServices.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EnumDependentServices.cs @@ -9,8 +9,8 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, EntryPoint = "EnumDependentServicesW", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool EnumDependentServices( + [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "EnumDependentServicesW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial bool EnumDependentServices( SafeServiceHandle serviceHandle, int serviceState, IntPtr bufferOfENUM_SERVICE_STATUS, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EnumServicesStatusEx.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EnumServicesStatusEx.cs index d8ad4ae03014eb..d51170a25890dc 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EnumServicesStatusEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EnumServicesStatusEx.cs @@ -9,8 +9,8 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, EntryPoint = "EnumServicesStatusExW", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool EnumServicesStatusEx( + [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "EnumServicesStatusExW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial bool EnumServicesStatusEx( SafeServiceHandle databaseHandle, int infolevel, int serviceType, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EqualDomainSid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EqualDomainSid.cs new file mode 100644 index 00000000000000..2f20584c06849d --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EqualDomainSid.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Advapi32 + { + [GeneratedDllImport(Interop.Libraries.Advapi32)] + public static partial bool EqualDomainSid(IntPtr pSid1, IntPtr pSid2, ref bool equal); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventActivityIdControl.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventActivityIdControl.cs index c1c129b6a4dbed..9490c198b02d37 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventActivityIdControl.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventActivityIdControl.cs @@ -8,7 +8,10 @@ internal static partial class Interop { internal static partial class Advapi32 { +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we annotate blittable types used in interop in CoreLib (like Guid) [DllImport(Libraries.Advapi32, ExactSpelling = true)] internal static extern int EventActivityIdControl(ActivityControl ControlCode, ref Guid ActivityId); +#pragma warning restore DLLIMPORTGENANALYZER015 } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventRegister.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventRegister.cs index 8369b5c0f7f561..1cc64001df4719 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventRegister.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventRegister.cs @@ -8,11 +8,14 @@ internal static partial class Interop { internal static partial class Advapi32 { +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we annotate blittable types used in interop in CoreLib (like Guid) [DllImport(Libraries.Advapi32, ExactSpelling = true)] - internal static extern unsafe uint EventRegister( + internal static unsafe extern uint EventRegister( in Guid providerId, EtwEnableCallback enableCallback, void* callbackContext, ref long registrationHandle); +#pragma warning restore DLLIMPORTGENANALYZER015 } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventSetInformation.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventSetInformation.cs index a6230216aee027..b865aa9fedec40 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventSetInformation.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventSetInformation.cs @@ -7,8 +7,8 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, ExactSpelling = true)] - internal static extern unsafe int EventSetInformation( + [GeneratedDllImport(Libraries.Advapi32, ExactSpelling = true)] + internal static unsafe partial int EventSetInformation( long registrationHandle, EVENT_INFO_CLASS informationClass, void* eventInformation, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventTraceGuidsEx.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventTraceGuidsEx.cs index c0fef912e99c50..53b76286ac9ae8 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventTraceGuidsEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventTraceGuidsEx.cs @@ -45,8 +45,8 @@ internal struct TRACE_ENABLE_INFO public long MatchAllKeyword; } - [DllImport(Interop.Libraries.Advapi32, ExactSpelling = true)] - internal static extern unsafe int EnumerateTraceGuidsEx( + [GeneratedDllImport(Interop.Libraries.Advapi32, ExactSpelling = true)] + internal static unsafe partial int EnumerateTraceGuidsEx( TRACE_QUERY_INFO_CLASS TraceQueryInfoClass, void* InBuffer, int InBufferSize, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventUnregister.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventUnregister.cs index e0d0c6b501e99d..d717c7d8173408 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventUnregister.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventUnregister.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, ExactSpelling = true)] - internal static extern uint EventUnregister(long registrationHandle); + [GeneratedDllImport(Libraries.Advapi32, ExactSpelling = true)] + internal static partial uint EventUnregister(long registrationHandle); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteString.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteString.cs index 0513daeacf0085..f39a759ac6f990 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteString.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteString.cs @@ -7,8 +7,8 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, ExactSpelling = true)] - internal static extern int EventWriteString( + [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Ansi, ExactSpelling = true)] + internal static partial int EventWriteString( long registrationHandle, byte level, long keyword, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteTransfer.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteTransfer.cs index 3cb95ffc699b59..3e2b23fc99087f 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteTransfer.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.EventWriteTransfer.cs @@ -36,8 +36,8 @@ internal static unsafe int EventWriteTransfer( return HResult; } - [DllImport(Interop.Libraries.Advapi32, ExactSpelling = true, EntryPoint = "EventWriteTransfer")] - private static extern unsafe int EventWriteTransfer_PInvoke( + [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "EventWriteTransfer", ExactSpelling = true)] + private static unsafe partial int EventWriteTransfer_PInvoke( long registrationHandle, in EventDescriptor eventDescriptor, Guid* activityId, diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEGid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetLengthSid.cs similarity index 59% rename from src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEGid.cs rename to src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetLengthSid.cs index 87aede1e85ec05..0f97e3842fa7a5 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetEGid.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetLengthSid.cs @@ -6,9 +6,9 @@ internal static partial class Interop { - internal static partial class Sys + internal static partial class Advapi32 { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetEGid")] - internal static extern uint GetEGid(); + [GeneratedDllImport(Interop.Libraries.Advapi32)] + internal static partial int GetLengthSid(IntPtr sid); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetNumberOfEventLogRecords.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetNumberOfEventLogRecords.cs index 67807ae41f42cb..102d520b35d8b0 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetNumberOfEventLogRecords.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetNumberOfEventLogRecords.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] - public static extern bool GetNumberOfEventLogRecords(SafeEventLogReadHandle hEventLog, out int NumberOfRecords); + [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] + public static partial bool GetNumberOfEventLogRecords(SafeEventLogReadHandle hEventLog, out int NumberOfRecords); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetOldestEventLogRecord.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetOldestEventLogRecord.cs index a3cf76cb34d78c..1101a63a163605 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetOldestEventLogRecord.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetOldestEventLogRecord.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool GetOldestEventLogRecord(SafeEventLogReadHandle hEventLog, out int OldestRecord); + public static partial bool GetOldestEventLogRecord(SafeEventLogReadHandle hEventLog, out int OldestRecord); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityDescriptorLength.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityDescriptorLength.cs index e94bd4b0f18c25..854c2c6055aed6 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityDescriptorLength.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityDescriptorLength.cs @@ -8,8 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Interop.Libraries.Advapi32, EntryPoint = "GetSecurityDescriptorLength", CallingConvention = CallingConvention.Winapi, - CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern /*DWORD*/ uint GetSecurityDescriptorLength(IntPtr byteArray); + [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "GetSecurityDescriptorLength", CharSet = CharSet.Unicode, ExactSpelling = true)] + internal static partial uint GetSecurityDescriptorLength(IntPtr byteArray); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityInfoByHandle.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityInfoByHandle.cs index b331549c0cf493..b67c7747490a7b 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityInfoByHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityInfoByHandle.cs @@ -8,13 +8,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "GetSecurityInfo", ExactSpelling = true)] internal static unsafe partial uint GetSecurityInfoByHandle( -#else - [DllImport(Interop.Libraries.Advapi32, EntryPoint = "GetSecurityInfo", ExactSpelling = true)] - internal static unsafe extern /*DWORD*/ uint GetSecurityInfoByHandle( -#endif SafeHandle handle, /*DWORD*/ uint objectType, /*DWORD*/ uint securityInformation, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityInfoByName.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityInfoByName.cs index 9b480db68b3fae..1af687e2cd5681 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityInfoByName.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSecurityInfoByName.cs @@ -8,13 +8,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "GetNamedSecurityInfoW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] internal static partial uint GetSecurityInfoByName( -#else - [DllImport(Interop.Libraries.Advapi32, EntryPoint = "GetNamedSecurityInfoW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] - internal static extern /*DWORD*/ uint GetSecurityInfoByName( -#endif string name, /*DWORD*/ uint objectType, /*DWORD*/ uint securityInformation, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetServiceDisplayName.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetServiceDisplayName.cs index c69084f20f83bb..d1444792c20434 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetServiceDisplayName.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetServiceDisplayName.cs @@ -12,7 +12,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, EntryPoint = "GetServiceDisplayNameW", CharSet = System.Runtime.InteropServices.CharSet.Unicode, SetLastError = true)] - internal static extern unsafe bool GetServiceDisplayName(SafeServiceHandle? SCMHandle, string serviceName, char* displayName, ref int displayNameLength); + [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "GetServiceDisplayNameW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static unsafe partial bool GetServiceDisplayName(SafeServiceHandle? SCMHandle, string serviceName, char* displayName, ref int displayNameLength); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetServiceKeyName.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetServiceKeyName.cs index 90169a489766a4..f7f83fea049a80 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetServiceKeyName.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetServiceKeyName.cs @@ -12,7 +12,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, EntryPoint = "GetServiceKeyNameW", CharSet = System.Runtime.InteropServices.CharSet.Unicode, SetLastError = true)] - internal static extern unsafe bool GetServiceKeyName(SafeServiceHandle? SCMHandle, string displayName, char* KeyName, ref int KeyNameLength); + [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "GetServiceKeyNameW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static unsafe partial bool GetServiceKeyName(SafeServiceHandle? SCMHandle, string displayName, char* KeyName, ref int KeyNameLength); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSidIdentifierAuthority.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSidIdentifierAuthority.cs new file mode 100644 index 00000000000000..a2843215f4de32 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetSidIdentifierAuthority.cs @@ -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. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Advapi32 + { + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + internal struct SID_IDENTIFIER_AUTHORITY + { + public byte b1; + public byte b2; + public byte b3; + public byte b4; + public byte b5; + public byte b6; + } + + [GeneratedDllImport(Libraries.Advapi32)] + internal static partial IntPtr GetSidIdentifierAuthority(IntPtr sid); + + [GeneratedDllImport(Interop.Libraries.Advapi32)] + internal static partial IntPtr GetSidSubAuthority(IntPtr sid, int index); + + [GeneratedDllImport(Interop.Libraries.Advapi32)] + internal static partial IntPtr GetSidSubAuthorityCount(IntPtr sid); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation.cs index d881a59ac0551f..df3e8f84c58a0b 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation.cs @@ -9,39 +9,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] internal static partial bool GetTokenInformation( -#else - [DllImport(Interop.Libraries.Advapi32, SetLastError = true)] - internal static extern bool GetTokenInformation( -#endif - SafeAccessTokenHandle TokenHandle, - uint TokenInformationClass, - SafeLocalAllocHandle TokenInformation, - uint TokenInformationLength, - out uint ReturnLength); - -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] - internal static partial bool GetTokenInformation( -#else - [DllImport(Interop.Libraries.Advapi32, SetLastError = true)] - internal static extern bool GetTokenInformation( -#endif - IntPtr TokenHandle, - uint TokenInformationClass, - SafeLocalAllocHandle TokenInformation, - uint TokenInformationLength, - out uint ReturnLength); - -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Interop.Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static partial bool GetTokenInformation( -#else - [DllImport(Interop.Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool GetTokenInformation( -#endif IntPtr TokenHandle, uint TokenInformationClass, IntPtr TokenInformation, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation_SafeLocalAllocHandle.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation_SafeLocalAllocHandle.cs new file mode 100644 index 00000000000000..57f5422e699b35 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetTokenInformation_SafeLocalAllocHandle.cs @@ -0,0 +1,28 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Microsoft.Win32.SafeHandles; +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Advapi32 + { + [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] + internal static partial bool GetTokenInformation( + SafeAccessTokenHandle TokenHandle, + uint TokenInformationClass, + SafeLocalAllocHandle TokenInformation, + uint TokenInformationLength, + out uint ReturnLength); + + [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] + internal static partial bool GetTokenInformation( + IntPtr TokenHandle, + uint TokenInformationClass, + SafeLocalAllocHandle TokenInformation, + uint TokenInformationLength, + out uint ReturnLength); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetWindowsAccountDomainSid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetWindowsAccountDomainSid.cs index 6070b3e70c9e0d..48a23007d569d6 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetWindowsAccountDomainSid.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.GetWindowsAccountDomainSid.cs @@ -8,13 +8,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "GetWindowsAccountDomainSid", CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "GetWindowsAccountDomainSid", SetLastError = true)] internal static partial int GetWindowsAccountDomainSid( -#else - [DllImport(Interop.Libraries.Advapi32, EntryPoint = "GetWindowsAccountDomainSid", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern int GetWindowsAccountDomainSid( -#endif byte[] sid, byte[] resultSid, ref uint resultSidLength); diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateLoggedOnUser.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateLoggedOnUser.cs index 10ab8ec20a5136..5c251d306a2578 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateLoggedOnUser.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateLoggedOnUser.cs @@ -9,12 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Interop.Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] internal static partial bool ImpersonateLoggedOnUser(SafeAccessTokenHandle userToken); -#else - [DllImport(Interop.Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool ImpersonateLoggedOnUser(SafeAccessTokenHandle userToken); -#endif } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateLoggedOnUser_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateLoggedOnUser_IntPtr.cs new file mode 100644 index 00000000000000..808294866c7074 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ImpersonateLoggedOnUser_IntPtr.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Advapi32 + { + [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + internal static partial int ImpersonateLoggedOnUser(IntPtr userToken); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsEqualDomainSid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsEqualDomainSid.cs index 80fa089f74e019..6c7f5d19b256de 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsEqualDomainSid.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsEqualDomainSid.cs @@ -8,13 +8,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "EqualDomainSid", CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "EqualDomainSid", SetLastError = true)] internal static partial int IsEqualDomainSid( -#else - [DllImport(Interop.Libraries.Advapi32, EntryPoint = "EqualDomainSid", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern int IsEqualDomainSid( -#endif byte[] sid1, byte[] sid2, out bool result); diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsValidSid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsValidSid.cs new file mode 100644 index 00000000000000..448b68467316f7 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsValidSid.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Advapi32 + { + [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + internal static partial bool IsValidSid(IntPtr sid); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsWellKnownSid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsWellKnownSid.cs index fa63e7e4064426..74e8cd57da3e9c 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsWellKnownSid.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.IsWellKnownSid.cs @@ -8,13 +8,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "IsWellKnownSid", CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "IsWellKnownSid", SetLastError = true)] internal static partial int IsWellKnownSid( -#else - [DllImport(Interop.Libraries.Advapi32, EntryPoint = "IsWellKnownSid", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern int IsWellKnownSid( -#endif byte[] sid, int type); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LogonUser.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LogonUser.cs new file mode 100644 index 00000000000000..7e1155d45ff3ed --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LogonUser.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. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Advapi32 + { + [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "LogonUserW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial int LogonUser( + string username, + string domain, + string password, + int logonType, + int logonProvider, + ref IntPtr token); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupAccountNameW.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupAccountNameW.cs index 168e80cd614636..ff9fd2dd3d988c 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupAccountNameW.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupAccountNameW.cs @@ -7,8 +7,8 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] - internal static extern bool LookupAccountNameW( + [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial bool LookupAccountNameW( string? lpSystemName, ref char lpAccountName, ref byte Sid, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupAccountSid.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupAccountSid.cs index 742ba2d25df2c7..bf058fb4a774e4 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupAccountSid.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupAccountSid.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Interop.Libraries.Advapi32, CharSet = CharSet.Unicode, EntryPoint = "LookupAccountSidW", SetLastError = true)] - public static extern unsafe int LookupAccountSid( + [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "LookupAccountSidW", CharSet = CharSet.Unicode, SetLastError = true)] + public static unsafe partial int LookupAccountSid( string lpSystemName, byte[] Sid, char* Name, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupPrivilegeValue.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupPrivilegeValue.cs index c4276f4af72ee6..7781cf4b6cf2a6 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupPrivilegeValue.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LookupPrivilegeValue.cs @@ -7,13 +7,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "LookupPrivilegeValueW", CharSet = CharSet.Unicode, SetLastError = true)] internal static partial bool LookupPrivilegeValue( -#else - [DllImport(Libraries.Advapi32, EntryPoint = "LookupPrivilegeValueW", CharSet = CharSet.Unicode, SetLastError = true, BestFitMapping = false)] - internal static extern bool LookupPrivilegeValue( -#endif [MarshalAs(UnmanagedType.LPTStr)] string? lpSystemName, [MarshalAs(UnmanagedType.LPTStr)] string lpName, out LUID lpLuid); internal const string SeDebugPrivilege = "SeDebugPrivilege"; diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaClose.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaClose.cs index e16ad2b7249f80..c703eebb53ec4e 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaClose.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaClose.cs @@ -8,12 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] internal static partial int LsaClose(IntPtr handle); -#else - [DllImport(Interop.Libraries.Advapi32, SetLastError = true)] - internal static extern int LsaClose(IntPtr handle); -#endif } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaFreeMemory.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaFreeMemory.cs index 9d4823cdd6f24b..5ba8f0302b5688 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaFreeMemory.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaFreeMemory.cs @@ -8,12 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] internal static partial int LsaFreeMemory(IntPtr handle); -#else - [DllImport(Interop.Libraries.Advapi32, SetLastError = true)] - internal static extern int LsaFreeMemory(IntPtr handle); -#endif } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaLookupNames2.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaLookupNames2.cs index 5b9092c7f88897..1e4c0309a09d97 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaLookupNames2.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaLookupNames2.cs @@ -9,7 +9,9 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Interop.Libraries.Advapi32, EntryPoint = "LsaLookupNames2", SetLastError = true, CharSet = CharSet.Unicode)] +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time + [DllImport(Interop.Libraries.Advapi32, EntryPoint = "LsaLookupNames2", CharSet = CharSet.Unicode, SetLastError = true)] + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we support non-blittable structs. internal static extern uint LsaLookupNames2( SafeLsaPolicyHandle handle, int flags, @@ -18,6 +20,7 @@ internal static extern uint LsaLookupNames2( out SafeLsaMemoryHandle referencedDomains, out SafeLsaMemoryHandle sids ); +#pragma warning restore DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] internal struct MARSHALLED_UNICODE_STRING diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaLookupSids.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaLookupSids.cs index f49432c0654ab0..2ed2561cffa10d 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaLookupSids.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaLookupSids.cs @@ -9,13 +9,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "LsaLookupSids", CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "LsaLookupSids", SetLastError = true)] internal static partial uint LsaLookupSids( -#else - [DllImport(Interop.Libraries.Advapi32, EntryPoint = "LsaLookupSids", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern uint LsaLookupSids( -#endif SafeLsaPolicyHandle handle, int count, IntPtr[] sids, @@ -24,3 +19,39 @@ out SafeLsaMemoryHandle names ); } } + +internal static partial class SafeLsaMemoryHandleExtensions +{ + public static unsafe void InitializeReferencedDomainsList(this SafeLsaMemoryHandle referencedDomains) + { + // We don't know the real size of the referenced domains yet, so we need to set an initial + // size based on the LSA_REFERENCED_DOMAIN_LIST structure, then resize it to include all of + // the domains. + referencedDomains.Initialize((uint)Marshal.SizeOf()); + Interop.LSA_REFERENCED_DOMAIN_LIST domainList = referencedDomains.Read(0); + + byte* pRdl = null; + try + { + referencedDomains.AcquirePointer(ref pRdl); + + // If there is a trust information list, then the buffer size is the end of that list minus + // the beginning of the domain list. Otherwise, then the buffer is just the size of the + // referenced domain list structure, which is what we defaulted to. + if (domainList.Domains != IntPtr.Zero) + { + Interop.LSA_TRUST_INFORMATION* pTrustInformation = (Interop.LSA_TRUST_INFORMATION*)domainList.Domains; + pTrustInformation = pTrustInformation + domainList.Entries; + + long bufferSize = (byte*)pTrustInformation - pRdl; + System.Diagnostics.Debug.Assert(bufferSize > 0, "bufferSize > 0"); + referencedDomains.Initialize((ulong)bufferSize); + } + } + finally + { + if (pRdl != null) + referencedDomains.ReleasePointer(); + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaNtStatusToWinError.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaNtStatusToWinError.cs index 524600d62ce89c..2da367aababc35 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaNtStatusToWinError.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaNtStatusToWinError.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Interop.Libraries.Advapi32, SetLastError = false)] - internal static extern uint LsaNtStatusToWinError(uint status); + [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = false)] + internal static partial uint LsaNtStatusToWinError(uint status); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaOpenPolicy.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaOpenPolicy.cs index ca2278a70c55b1..861d07ef36e3f5 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaOpenPolicy.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaOpenPolicy.cs @@ -9,13 +9,26 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "LsaOpenPolicy", CharSet = CharSet.Unicode, SetLastError = true)] + [Flags] + internal enum PolicyRights + { + POLICY_VIEW_LOCAL_INFORMATION = 0x00000001, + POLICY_VIEW_AUDIT_INFORMATION = 0x00000002, + POLICY_GET_PRIVATE_INFORMATION = 0x00000004, + POLICY_TRUST_ADMIN = 0x00000008, + POLICY_CREATE_ACCOUNT = 0x00000010, + POLICY_CREATE_SECRET = 0x00000020, + POLICY_CREATE_PRIVILEGE = 0x00000040, + POLICY_SET_DEFAULT_QUOTA_LIMITS = 0x00000080, + POLICY_SET_AUDIT_REQUIREMENTS = 0x00000100, + POLICY_AUDIT_LOG_ADMIN = 0x00000200, + POLICY_SERVER_ADMIN = 0x00000400, + POLICY_LOOKUP_NAMES = 0x00000800, + POLICY_NOTIFICATION = 0x00001000, + } + + [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "LsaOpenPolicy", SetLastError = true)] private static partial uint LsaOpenPolicy( -#else - [DllImport(Interop.Libraries.Advapi32, EntryPoint = "LsaOpenPolicy", CharSet = CharSet.Unicode, SetLastError = true)] - private static extern uint LsaOpenPolicy( -#endif ref UNICODE_STRING SystemName, ref OBJECT_ATTRIBUTES ObjectAttributes, int AccessMask, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaQueryInformationPolicy.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaQueryInformationPolicy.cs new file mode 100644 index 00000000000000..d38ac1c15d363b --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.LsaQueryInformationPolicy.cs @@ -0,0 +1,17 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Advapi32 + { + [GeneratedDllImport(Libraries.Advapi32)] + internal static partial uint LsaQueryInformationPolicy( + IntPtr policyHandle, + int policyInformationClass, + ref IntPtr buffer); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.NotifyChangeEventLog.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.NotifyChangeEventLog.cs index 7a7db2f748f260..667f48515172c8 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.NotifyChangeEventLog.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.NotifyChangeEventLog.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool NotifyChangeEventLog(SafeEventLogReadHandle hEventLog, SafeWaitHandle hEvent); + public static partial bool NotifyChangeEventLog(SafeEventLogReadHandle hEventLog, SafeWaitHandle hEvent); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenEventLog.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenEventLog.cs index 31483c83304ad0..6c32736c8b5008 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenEventLog.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenEventLog.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern SafeEventLogReadHandle OpenEventLog(string lpUNCServerName, string lpSourceName); + [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial SafeEventLogReadHandle OpenEventLog(string lpUNCServerName, string lpSourceName); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken_IntPtr.cs index 480bc64264da53..e94b0331e1a398 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken_IntPtr.cs @@ -10,13 +10,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] internal static partial bool OpenProcessToken( -#else - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool OpenProcessToken( -#endif IntPtr ProcessToken, TokenAccessLevels DesiredAccess, out SafeTokenHandle TokenHandle); diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken_SafeAccessTokenHandle.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken_SafeAccessTokenHandle.cs index bf48ccbd086b55..3d47f27295f6fc 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken_SafeAccessTokenHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenProcessToken_SafeAccessTokenHandle.cs @@ -10,13 +10,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] internal static partial bool OpenProcessToken( -#else - [DllImport(Interop.Libraries.Advapi32, SetLastError = true)] - internal static extern bool OpenProcessToken( -#endif IntPtr ProcessToken, TokenAccessLevels DesiredAccess, out SafeAccessTokenHandle TokenHandle); diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenSCManager.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenSCManager.cs index 4d661e0870ec6e..190aefa961b121 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenSCManager.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenSCManager.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, EntryPoint = "OpenSCManagerW", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern IntPtr OpenSCManager(string? machineName, string? databaseName, int access); + [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "OpenSCManagerW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial IntPtr OpenSCManager(string? machineName, string? databaseName, int access); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenService.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenService.cs index 23a432f12cc0a6..47544bc29ad6ca 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenService.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenService.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, EntryPoint = "OpenServiceW", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern IntPtr OpenService(SafeServiceHandle? databaseHandle, string serviceName, int access); + [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "OpenServiceW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial IntPtr OpenService(SafeServiceHandle? databaseHandle, string serviceName, int access); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenThreadToken.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenThreadToken.cs index 1deda3432150ea..2211ce3ed9000a 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenThreadToken.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenThreadToken.cs @@ -10,13 +10,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] private static partial bool OpenThreadToken( -#else - [DllImport(Interop.Libraries.Advapi32, SetLastError = true)] - private static extern bool OpenThreadToken( -#endif IntPtr ThreadHandle, TokenAccessLevels dwDesiredAccess, bool bOpenAsSelf, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenThreadToken_SafeTokenHandle.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenThreadToken_SafeTokenHandle.cs index d86bebeddf3206..398fdfd0e855f0 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenThreadToken_SafeTokenHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.OpenThreadToken_SafeTokenHandle.cs @@ -10,13 +10,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.Advapi32, SetLastError = true)] internal static partial bool OpenThreadToken( -#else - [DllImport(Interop.Libraries.Advapi32, SetLastError = true)] - internal static extern bool OpenThreadToken( -#endif IntPtr ThreadHandle, TokenAccessLevels dwDesiredAccess, bool bOpenAsSelf, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.QueryServiceConfig.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.QueryServiceConfig.cs index f3e99c1a69c744..cf734863ab8a2a 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.QueryServiceConfig.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.QueryServiceConfig.cs @@ -9,8 +9,8 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, EntryPoint = "QueryServiceConfigW", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool QueryServiceConfig(SafeServiceHandle serviceHandle, IntPtr queryServiceConfigPtr, int bufferSize, out int bytesNeeded); + [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "QueryServiceConfigW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial bool QueryServiceConfig(SafeServiceHandle serviceHandle, IntPtr queryServiceConfigPtr, int bufferSize, out int bytesNeeded); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.QueryServiceStatus.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.QueryServiceStatus.cs index 19003e0e3982c9..e29caaaf966dbc 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.QueryServiceStatus.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.QueryServiceStatus.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern unsafe bool QueryServiceStatus(SafeServiceHandle serviceHandle, SERVICE_STATUS* pStatus); + [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + internal static unsafe partial bool QueryServiceStatus(SafeServiceHandle serviceHandle, SERVICE_STATUS* pStatus); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ReadEventLog.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ReadEventLog.cs index 5cbc26db4d0cad..28369c84eea161 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ReadEventLog.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ReadEventLog.cs @@ -12,9 +12,9 @@ internal static partial class Advapi32 internal const int FORWARDS_READ = 0x4; internal const int BACKWARDS_READ = 0x8; - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool ReadEventLog( + public static partial bool ReadEventLog( SafeEventLogReadHandle hEventLog, int dwReadFlags, int dwRecordOffset, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCloseKey.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCloseKey.cs index 5d27b90afa963c..23bc17bad23ccf 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCloseKey.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCloseKey.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32)] - internal static extern int RegCloseKey(IntPtr hKey); + [GeneratedDllImport(Libraries.Advapi32)] + internal static partial int RegCloseKey(IntPtr hKey); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegConnectRegistry.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegConnectRegistry.cs index 83206d9f75ced3..4d0fbbb415c1de 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegConnectRegistry.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegConnectRegistry.cs @@ -14,13 +14,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegConnectRegistryW", CharSet = CharSet.Unicode)] internal static partial int RegConnectRegistry( -#else - [DllImport(Libraries.Advapi32, EntryPoint = "RegConnectRegistryW", CharSet = CharSet.Unicode, BestFitMapping = false)] - internal static extern int RegConnectRegistry( -#endif string machineName, SafeRegistryHandle key, out SafeRegistryHandle result); diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCreateKeyEx.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCreateKeyEx.cs index 44671dd679c0c7..f376bc9ec5463f 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCreateKeyEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegCreateKeyEx.cs @@ -14,13 +14,8 @@ internal static partial class Advapi32 { // Note: RegCreateKeyEx won't set the last error on failure - it returns // an error code if it fails. -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegCreateKeyExW", CharSet = CharSet.Unicode, ExactSpelling = true)] internal static partial int RegCreateKeyEx( -#else - [DllImport(Libraries.Advapi32, EntryPoint = "RegCreateKeyExW", BestFitMapping = false, CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern int RegCreateKeyEx( -#endif SafeRegistryHandle hKey, string lpSubKey, int Reserved, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegDeleteKeyEx.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegDeleteKeyEx.cs index d7a57521434306..b51199269cfed4 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegDeleteKeyEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegDeleteKeyEx.cs @@ -12,13 +12,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegDeleteKeyExW", CharSet = CharSet.Unicode, ExactSpelling = true)] internal static partial int RegDeleteKeyEx( -#else - [DllImport(Libraries.Advapi32, EntryPoint = "RegDeleteKeyExW", BestFitMapping = false, CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern int RegDeleteKeyEx( -#endif SafeRegistryHandle hKey, string lpSubKey, int samDesired, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegDeleteValue.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegDeleteValue.cs index 50824a4ede142e..f5a8e05cd61a72 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegDeleteValue.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegDeleteValue.cs @@ -12,13 +12,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegDeleteValueW", CharSet = CharSet.Unicode, ExactSpelling = true)] internal static partial int RegDeleteValue( -#else - [DllImport(Libraries.Advapi32, EntryPoint = "RegDeleteValueW", BestFitMapping = false, CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern int RegDeleteValue( -#endif SafeRegistryHandle hKey, string? lpValueName); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegEnumKeyEx.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegEnumKeyEx.cs index cf24e641938356..b5b2742c213e82 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegEnumKeyEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegEnumKeyEx.cs @@ -12,11 +12,11 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegEnumKeyExW", ExactSpelling = true)] - internal static extern int RegEnumKeyEx( + [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegEnumKeyExW", CharSet = CharSet.Unicode, ExactSpelling = true)] + internal static partial int RegEnumKeyEx( SafeRegistryHandle hKey, int dwIndex, - char[] lpName, + [Out] char[] lpName, ref int lpcbName, int[]? lpReserved, [Out] char[]? lpClass, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegEnumValue.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegEnumValue.cs index 39543b22494952..bb74b7b0cf8a1e 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegEnumValue.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegEnumValue.cs @@ -13,11 +13,11 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegEnumValueW", ExactSpelling = true)] - internal static extern int RegEnumValue( + [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegEnumValueW", CharSet = CharSet.Unicode, ExactSpelling = true)] + internal static partial int RegEnumValue( SafeRegistryHandle hKey, int dwIndex, - char[] lpValueName, + [Out] char[] lpValueName, ref int lpcbValueName, IntPtr lpReserved_MustBeZero, int[]? lpType, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegFlushKey.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegFlushKey.cs index 5bb1046bee3383..ce43f1ac64031c 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegFlushKey.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegFlushKey.cs @@ -12,13 +12,7 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32)] - internal static partial int RegFlushKey( -#else - [DllImport(Libraries.Advapi32)] - internal static extern int RegFlushKey( -#endif - SafeRegistryHandle hKey); + internal static partial int RegFlushKey(SafeRegistryHandle hKey); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegOpenKeyEx.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegOpenKeyEx.cs index 4ffba18c4a2c60..9f9af2c268b7e0 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegOpenKeyEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegOpenKeyEx.cs @@ -13,27 +13,16 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegOpenKeyExW", CharSet = CharSet.Unicode, ExactSpelling = true)] internal static partial int RegOpenKeyEx( -#else - [DllImport(Libraries.Advapi32, EntryPoint = "RegOpenKeyExW", CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern int RegOpenKeyEx( -#endif SafeRegistryHandle hKey, string? lpSubKey, int ulOptions, int samDesired, out SafeRegistryHandle hkResult); - -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegOpenKeyExW", CharSet = CharSet.Unicode, ExactSpelling = true)] internal static partial int RegOpenKeyEx( -#else - [DllImport(Libraries.Advapi32, EntryPoint = "RegOpenKeyExW", BestFitMapping = false, CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern int RegOpenKeyEx( -#endif IntPtr hKey, string? lpSubKey, int ulOptions, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegQueryInfoKey.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegQueryInfoKey.cs index 6870d0d45e94f8..1bcc4ef2ddb255 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegQueryInfoKey.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegQueryInfoKey.cs @@ -14,8 +14,8 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegQueryInfoKeyW")] - internal static extern int RegQueryInfoKey( + [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryInfoKeyW", CharSet = CharSet.Unicode, ExactSpelling = true)] + internal static partial int RegQueryInfoKey( SafeRegistryHandle hKey, [Out] char[]? lpClass, int[]? lpcbClass, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegQueryValueEx.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegQueryValueEx.cs index f05122613da04b..3ee7567b873fce 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegQueryValueEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegQueryValueEx.cs @@ -13,17 +13,17 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegQueryValueExW", ExactSpelling = true)] - internal static extern int RegQueryValueEx( + [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", CharSet = CharSet.Unicode, ExactSpelling = true)] + internal static partial int RegQueryValueEx( SafeRegistryHandle hKey, string? lpValueName, int[]? lpReserved, ref int lpType, - [Out] byte[]? lpData, + byte[]? lpData, ref int lpcbData); - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegQueryValueExW", ExactSpelling = true)] - internal static extern int RegQueryValueEx( + [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", CharSet = CharSet.Unicode, ExactSpelling = true)] + internal static partial int RegQueryValueEx( SafeRegistryHandle hKey, string? lpValueName, int[]? lpReserved, @@ -31,8 +31,8 @@ internal static extern int RegQueryValueEx( ref int lpData, ref int lpcbData); - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegQueryValueExW", ExactSpelling = true)] - internal static extern int RegQueryValueEx( + [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", CharSet = CharSet.Unicode, ExactSpelling = true)] + internal static partial int RegQueryValueEx( SafeRegistryHandle hKey, string? lpValueName, int[]? lpReserved, @@ -40,8 +40,8 @@ internal static extern int RegQueryValueEx( ref long lpData, ref int lpcbData); - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, BestFitMapping = false, EntryPoint = "RegQueryValueExW", ExactSpelling = true)] - internal static extern int RegQueryValueEx( + [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegQueryValueExW", CharSet = CharSet.Unicode, ExactSpelling = true)] + internal static partial int RegQueryValueEx( SafeRegistryHandle hKey, string? lpValueName, int[]? lpReserved, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegSetValueEx.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegSetValueEx.cs index 8bb444aa563f3e..5e2e9221f2ead3 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegSetValueEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegSetValueEx.cs @@ -12,13 +12,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", CharSet = CharSet.Unicode, ExactSpelling = true)] internal static partial int RegSetValueEx( -#else - [DllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", BestFitMapping = false, CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern int RegSetValueEx( -#endif SafeRegistryHandle hKey, string? lpValueName, int Reserved, @@ -26,13 +21,8 @@ internal static extern int RegSetValueEx( byte[]? lpData, int cbData); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", CharSet = CharSet.Unicode, ExactSpelling = true)] internal static partial int RegSetValueEx( -#else - [DllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", BestFitMapping = false, CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern int RegSetValueEx( -#endif SafeRegistryHandle hKey, string? lpValueName, int Reserved, @@ -40,13 +30,8 @@ internal static extern int RegSetValueEx( char[]? lpData, int cbData); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", CharSet = CharSet.Unicode, ExactSpelling = true)] internal static partial int RegSetValueEx( -#else - [DllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", BestFitMapping = false, CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern int RegSetValueEx( -#endif SafeRegistryHandle hKey, string? lpValueName, int Reserved, @@ -54,13 +39,8 @@ internal static extern int RegSetValueEx( ref int lpData, int cbData); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", CharSet = CharSet.Unicode, ExactSpelling = true)] internal static partial int RegSetValueEx( -#else - [DllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", BestFitMapping = false, CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern int RegSetValueEx( -#endif SafeRegistryHandle hKey, string? lpValueName, int Reserved, @@ -68,13 +48,8 @@ internal static extern int RegSetValueEx( ref long lpData, int cbData); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", CharSet = CharSet.Unicode, ExactSpelling = true)] internal static partial int RegSetValueEx( -#else - [DllImport(Libraries.Advapi32, EntryPoint = "RegSetValueExW", BestFitMapping = false, CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern int RegSetValueEx( -#endif SafeRegistryHandle hKey, string? lpValueName, int Reserved, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegisterEventSource.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegisterEventSource.cs index eadabdceaca793..0871c0e438eec1 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegisterEventSource.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegisterEventSource.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern SafeEventLogWriteHandle RegisterEventSource(string lpUNCServerName, string lpSourceName); + [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial SafeEventLogWriteHandle RegisterEventSource(string lpUNCServerName, string lpSourceName); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegisterServiceCtrlHandlerEx.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegisterServiceCtrlHandlerEx.cs index ea198bd4d6e748..b7bbaeb5833616 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegisterServiceCtrlHandlerEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RegisterServiceCtrlHandlerEx.cs @@ -10,7 +10,7 @@ internal static partial class Advapi32 { public delegate int ServiceControlCallbackEx(int control, int eventType, IntPtr eventData, IntPtr eventContext); - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] - public static extern IntPtr RegisterServiceCtrlHandlerEx(string? serviceName, ServiceControlCallbackEx? callback, IntPtr userData); + [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "RegisterServiceCtrlHandlerExW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + public static partial IntPtr RegisterServiceCtrlHandlerEx(string? serviceName, ServiceControlCallbackEx? callback, IntPtr userData); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ReportEvent.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ReportEvent.cs index ee3e1943beed06..913ce34cae0cda 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ReportEvent.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ReportEvent.cs @@ -9,8 +9,8 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] - public static extern bool ReportEvent( + [GeneratedDllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] + public static partial bool ReportEvent( SafeEventLogWriteHandle hEventLog, short wType, ushort wcategory, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RevertToSelf.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RevertToSelf.cs index 5b1eb051b00d4b..5759eaae17b3df 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RevertToSelf.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.RevertToSelf.cs @@ -8,12 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Interop.Libraries.Advapi32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + [GeneratedDllImport(Interop.Libraries.Advapi32, ExactSpelling = true, SetLastError = true)] internal static partial bool RevertToSelf(); -#else - [DllImport(Interop.Libraries.Advapi32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] - internal static extern bool RevertToSelf(); -#endif } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetServiceStatus.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetServiceStatus.cs index 78d53da1697ab7..300cedcf611f5e 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetServiceStatus.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetServiceStatus.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] - public static extern unsafe bool SetServiceStatus(IntPtr serviceStatusHandle, SERVICE_STATUS* status); + [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] + public static unsafe partial bool SetServiceStatus(IntPtr serviceStatusHandle, SERVICE_STATUS* status); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetThreadToken.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetThreadToken.cs index a0fb653df2948e..fcd95e09f1a055 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetThreadToken.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.SetThreadToken.cs @@ -9,13 +9,8 @@ internal static partial class Interop { internal static partial class Advapi32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Advapi32, SetLastError = true)] internal static partial bool SetThreadToken( -#else - [DllImport(Libraries.Advapi32, SetLastError = true)] - internal static extern bool SetThreadToken( -#endif IntPtr ThreadHandle, SafeTokenHandle? hToken); } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.StartService.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.StartService.cs index d56a472d92537f..a3ac3631a865da 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.StartService.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.StartService.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, EntryPoint = "StartServiceW", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool StartService(SafeServiceHandle serviceHandle, int argNum, IntPtr argPtrs); + [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "StartServiceW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial bool StartService(SafeServiceHandle serviceHandle, int argNum, IntPtr argPtrs); } } diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.StartServiceCtrlDispatcher.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.StartServiceCtrlDispatcher.cs index 6a9f9f66e0c353..e307b36d8c0815 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.StartServiceCtrlDispatcher.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.StartServiceCtrlDispatcher.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Advapi32 { - [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)] - public static extern bool StartServiceCtrlDispatcher(IntPtr entry); + [GeneratedDllImport(Libraries.Advapi32, EntryPoint = "StartServiceCtrlDispatcherW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + public static partial bool StartServiceCtrlDispatcher(IntPtr entry); } } diff --git a/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzGetInformationFromContext.cs b/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzGetInformationFromContext.cs new file mode 100644 index 00000000000000..9dc0b02d0b057e --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzGetInformationFromContext.cs @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Authz + { + [GeneratedDllImport(Libraries.Authz, SetLastError = true)] + internal static partial bool AuthzGetInformationFromContext( + IntPtr hAuthzClientContext, + int InfoClass, + int BufferSize, + out int pSizeRequired, + IntPtr Buffer); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeContextFromSid.cs b/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeContextFromSid.cs new file mode 100644 index 00000000000000..ae70cba32486a3 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeContextFromSid.cs @@ -0,0 +1,28 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Authz + { + internal const int AUTHZ_RM_FLAG_NO_AUDIT = 0x1; + internal const int AUTHZ_RM_FLAG_INITIALIZE_UNDER_IMPERSONATION = 0x2; + internal const int AUTHZ_VALID_RM_INIT_FLAGS = (AUTHZ_RM_FLAG_NO_AUDIT | AUTHZ_RM_FLAG_INITIALIZE_UNDER_IMPERSONATION); + + [GeneratedDllImport(Interop.Libraries.Authz, SetLastError = true)] + internal static partial bool AuthzInitializeContextFromSid( + int Flags, + IntPtr UserSid, + IntPtr AuthzResourceManager, + IntPtr pExpirationTime, + Interop.LUID Identitifier, + IntPtr DynamicGroupArgs, + out IntPtr pAuthzClientContext); + + [GeneratedDllImport(Interop.Libraries.Authz)] + internal static partial bool AuthzFreeContext(IntPtr AuthzClientContext); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeResourceManager.cs b/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeResourceManager.cs new file mode 100644 index 00000000000000..12a7f808730d26 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Authz/Interop.AuthzInitializeResourceManager.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Authz + { + [GeneratedDllImport(Libraries.Authz, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial bool AuthzInitializeResourceManager( + int flags, + IntPtr pfnAccessCheck, + IntPtr pfnComputeDynamicGroups, + IntPtr pfnFreeDynamicGroups, + string name, + out IntPtr rm); + + [GeneratedDllImport(Libraries.Authz)] + internal static partial bool AuthzFreeResourceManager(IntPtr rm); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Cng.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Cng.cs index eaafec4d7f807b..2ddaade387b703 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Cng.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Cng.cs @@ -137,7 +137,7 @@ public static unsafe NTSTATUS BCryptSetIntProperty(SafeBCryptHandle hObject, str } } - internal sealed class SafeAlgorithmHandle : SafeBCryptHandle + internal sealed partial class SafeAlgorithmHandle : SafeBCryptHandle { protected sealed override bool ReleaseHandle() { @@ -145,11 +145,11 @@ protected sealed override bool ReleaseHandle() return ntStatus == 0; } - [DllImport(Libraries.BCrypt)] - private static extern uint BCryptCloseAlgorithmProvider(IntPtr hAlgorithm, int dwFlags); + [GeneratedDllImport(Libraries.BCrypt)] + private static partial uint BCryptCloseAlgorithmProvider(IntPtr hAlgorithm, int dwFlags); } - internal sealed class SafeKeyHandle : SafeBCryptHandle + internal sealed partial class SafeKeyHandle : SafeBCryptHandle { private SafeAlgorithmHandle? _parentHandle; @@ -177,7 +177,7 @@ protected sealed override bool ReleaseHandle() return ntStatus == 0; } - [DllImport(Libraries.BCrypt)] - private static extern uint BCryptDestroyKey(IntPtr hKey); + [GeneratedDllImport(Libraries.BCrypt)] + private static partial uint BCryptDestroyKey(IntPtr hKey); } } diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptCloseAlgorithmProvider.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptCloseAlgorithmProvider.cs index 1a08654c8b2b21..8856ae73881b8d 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptCloseAlgorithmProvider.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptCloseAlgorithmProvider.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class BCrypt { - [DllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)] - internal static extern NTSTATUS BCryptCloseAlgorithmProvider(IntPtr hAlgorithm, int dwFlags); + [GeneratedDllImport(Libraries.BCrypt)] + internal static partial NTSTATUS BCryptCloseAlgorithmProvider(IntPtr hAlgorithm, int dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyHash.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyHash.cs index 5466f24e6eec38..0ed212f3210302 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyHash.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyHash.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class BCrypt { - [DllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)] - internal static extern NTSTATUS BCryptDestroyHash(IntPtr hHash); + [GeneratedDllImport(Libraries.BCrypt)] + internal static partial NTSTATUS BCryptDestroyHash(IntPtr hHash); } } diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyKey.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyKey.cs index 329d22cd14903a..4cf579126cfb0d 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyKey.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptDestroyKey.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class BCrypt { - [DllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)] - internal static extern NTSTATUS BCryptDestroyKey(IntPtr hKey); + [GeneratedDllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)] + internal static partial NTSTATUS BCryptDestroyKey(IntPtr hKey); } } diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs index 22d7be39e5afb8..e6ce2a9db53063 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs @@ -10,7 +10,7 @@ internal static partial class BCrypt { internal const int BCRYPT_USE_SYSTEM_PREFERRED_RNG = 0x00000002; - [DllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)] - internal static extern unsafe NTSTATUS BCryptGenRandom(IntPtr hAlgorithm, byte* pbBuffer, int cbBuffer, int dwFlags); + [GeneratedDllImport(Libraries.BCrypt)] + internal static unsafe partial NTSTATUS BCryptGenRandom(IntPtr hAlgorithm, byte* pbBuffer, int cbBuffer, int dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHash.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHash.cs index e93128c4650279..e490fe07eaecb3 100644 --- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHash.cs +++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHash.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class BCrypt { - [DllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)] - internal static unsafe extern NTSTATUS BCryptHash(nuint hAlgorithm, byte* pbSecret, int cbSecret, byte* pbInput, int cbInput, byte* pbOutput, int cbOutput); + [GeneratedDllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)] + internal static unsafe partial NTSTATUS BCryptHash(nuint hAlgorithm, byte* pbSecret, int cbSecret, byte* pbInput, int cbInput, byte* pbOutput, int cbOutput); } } diff --git a/src/libraries/Common/src/Interop/Windows/Credui/Interop.CredUIParseUserName.cs b/src/libraries/Common/src/Interop/Windows/Credui/Interop.CredUIParseUserName.cs new file mode 100644 index 00000000000000..53ff59eb99bf29 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Credui/Interop.CredUIParseUserName.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Credui + { + // These contants were taken from the wincred.h file + internal const int CRED_MAX_USERNAME_LENGTH = 514; + internal const int CRED_MAX_DOMAIN_TARGET_LENGTH = 338; + + [GeneratedDllImport(Libraries.Credui, EntryPoint = "CredUIParseUserNameW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static unsafe partial int CredUIParseUserName( + string pszUserName, + char* pszUser, + uint ulUserMaxChars, + char* pszDomain, + uint ulDomainMaxChars); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CERT_CHAIN_ENGINE_CONFIG.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CERT_CHAIN_ENGINE_CONFIG.cs new file mode 100644 index 00000000000000..7597ea150a48bc --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CERT_CHAIN_ENGINE_CONFIG.cs @@ -0,0 +1,28 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [StructLayout(LayoutKind.Sequential)] + internal struct CERT_CHAIN_ENGINE_CONFIG + { + public int cbSize; + public IntPtr hRestrictedRoot; + public IntPtr hRestrictedTrust; + public IntPtr hRestrictedOther; + public int cAdditionalStore; + public IntPtr rghAdditionalStore; + public ChainEngineConfigFlags dwFlags; + public int dwUrlRetrievalTimeout; + public int MaximumCachedCertificates; + public int CycleDetectionModulus; + public IntPtr hExclusiveRoot; + public IntPtr hExclusiveTrustedPeople; + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CRYPT_KEY_PROV_INFO_ANSI.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CRYPT_KEY_PROV_INFO_ANSI.cs new file mode 100644 index 00000000000000..65760af413a7e4 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CRYPT_KEY_PROV_INFO_ANSI.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct CRYPT_KEY_PROV_INFO + { + internal char* pwszContainerName; + internal char* pwszProvName; + internal int dwProvType; + internal CryptAcquireContextFlags dwFlags; + internal int cProvParam; + internal IntPtr rgProvParam; + internal int dwKeySpec; + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateContextToStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateContextToStore.cs new file mode 100644 index 00000000000000..65eb5356fcc0db --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateContextToStore.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial bool CertAddCertificateContextToStore(SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, CertStoreAddDisposition dwAddDisposition, IntPtr ppStoreContext); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateLinkToStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateLinkToStore.cs index 0d440dce6f022d..0c09d360066b9d 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateLinkToStore.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateLinkToStore.cs @@ -10,7 +10,7 @@ internal static partial class Crypt32 { internal const uint CERT_STORE_ADD_ALWAYS = 4; - [DllImport(Interop.Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CertAddCertificateLinkToStore(SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, uint dwAddDisposition, [In, Out] SafeCertContextHandle ppStoreContext); + [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)] + internal static partial bool CertAddCertificateLinkToStore(SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, uint dwAddDisposition, SafeCertContextHandle ppStoreContext); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateLinkToStore_CertStoreAddDisposition.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateLinkToStore_CertStoreAddDisposition.cs new file mode 100644 index 00000000000000..599196cfdf8432 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertAddCertificateLinkToStore_CertStoreAddDisposition.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial bool CertAddCertificateLinkToStore(SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, CertStoreAddDisposition dwAddDisposition, IntPtr ppStoreContext); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertChainFlags.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertChainFlags.cs new file mode 100644 index 00000000000000..748fc10013ebb0 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertChainFlags.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. + +using System; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [Flags] + internal enum CertChainFlags : int + { + None = 0x00000000, + CERT_CHAIN_DISABLE_AUTH_ROOT_AUTO_UPDATE = 0x00000100, + CERT_CHAIN_DISABLE_AIA = 0x00002000, + CERT_CHAIN_REVOCATION_CHECK_END_CERT = 0x10000000, + CERT_CHAIN_REVOCATION_CHECK_CHAIN = 0x20000000, + CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT = 0x40000000, + CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY = unchecked((int)0x80000000), + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCloseStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCloseStore.cs index f26df2d4d8e5c9..abeccccd292b45 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCloseStore.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCloseStore.cs @@ -8,12 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] internal static partial bool CertCloseStore(IntPtr hCertStore, uint dwFlags); -#else - [DllImport(Interop.Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CertCloseStore(IntPtr hCertStore, uint dwFlags); -#endif } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertControlStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertControlStore.cs new file mode 100644 index 00000000000000..5d3a99327a8fc3 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertControlStore.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial bool CertControlStore(SafeCertStoreHandle hCertStore, CertControlStoreFlags dwFlags, CertControlStoreType dwControlType, IntPtr pvCtrlPara); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertControlStoreFlags.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertControlStoreFlags.cs new file mode 100644 index 00000000000000..9f4baff1614f5e --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertControlStoreFlags.cs @@ -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. + +using System; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [Flags] + internal enum CertControlStoreFlags : int + { + None = 0x00000000, + } + } +} \ No newline at end of file diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertControlStoreType.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertControlStoreType.cs new file mode 100644 index 00000000000000..a0f04a14d059a0 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertControlStoreType.cs @@ -0,0 +1,13 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + internal enum CertControlStoreType : int + { + CERT_STORE_CTRL_AUTO_RESYNC = 4, + } + } +} \ No newline at end of file diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCreateCertificateChainEngine.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCreateCertificateChainEngine.cs new file mode 100644 index 00000000000000..65bc29dfc74d9f --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCreateCertificateChainEngine.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial bool CertCreateCertificateChainEngine(ref CERT_CHAIN_ENGINE_CONFIG pConfig, out SafeChainEngineHandle hChainEngineHandle); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCreateCertificateContext.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCreateCertificateContext.cs index ece64b3abd6518..4b96a878897fd9 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCreateCertificateContext.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCreateCertificateContext.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class Crypt32 { - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern unsafe SafeCertContextHandle CertCreateCertificateContext( + [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + internal static unsafe partial SafeCertContextHandle CertCreateCertificateContext( MsgEncodingType dwCertEncodingType, void* pbCertEncoded, int cbCertEncoded); diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDeleteCertificateFromStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDeleteCertificateFromStore.cs new file mode 100644 index 00000000000000..df9e43148bb1eb --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDeleteCertificateFromStore.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + // Note: CertDeleteCertificateFromStore always calls CertFreeCertificateContext on pCertContext, even if an error is encountered. + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial bool CertDeleteCertificateFromStore(CERT_CONTEXT* pCertContext); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateChain.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateChain.cs new file mode 100644 index 00000000000000..07d0ff7be8705f --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateChain.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + internal static partial SafeX509ChainHandle CertDuplicateCertificateChain(IntPtr pChainContext); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext.cs index 3ebbb872aa4a34..e87fbd6f8eb99c 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext.cs @@ -9,12 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] internal static partial SafeCertContextHandle CertDuplicateCertificateContext(IntPtr pCertContext); -#else - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern SafeCertContextHandle CertDuplicateCertificateContext(IntPtr pCertContext); -#endif } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContextWithKeyContainerDeletion.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContextWithKeyContainerDeletion.cs new file mode 100644 index 00000000000000..ff720e14f1df8b --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContextWithKeyContainerDeletion.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertDuplicateCertificateContext", CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial SafeCertContextHandleWithKeyContainerDeletion CertDuplicateCertificateContextWithKeyContainerDeletion(IntPtr pCertContext); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext_IntPtr.cs index 3f952d44133706..804d67115e5985 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext_IntPtr.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern IntPtr CertDuplicateCertificateContext(IntPtr pCertContext); + [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + internal static partial IntPtr CertDuplicateCertificateContext(IntPtr pCertContext); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateStore.cs new file mode 100644 index 00000000000000..847919d10a2de8 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateStore.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + internal static partial SafeCertStoreHandle CertDuplicateStore(IntPtr hCertStore); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore.cs index 50cb6c5997be06..be2172e6e1198f 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore.cs @@ -8,13 +8,8 @@ internal static partial class Interop { internal static partial class Crypt32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] public static unsafe partial CERT_CONTEXT* CertEnumCertificatesInStore( -#else - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe extern CERT_CONTEXT* CertEnumCertificatesInStore( -#endif IntPtr hCertStore, CERT_CONTEXT* pPrevCertContext); } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore_IntPtr.cs index 2302457bf7d3a9..e84ba3f3177544 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore_IntPtr.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [DllImport(Interop.Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern IntPtr CertEnumCertificatesInStore(SafeCertStoreHandle hCertStore, IntPtr pPrevCertContext); + [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)] + internal static partial IntPtr CertEnumCertificatesInStore(SafeCertStoreHandle hCertStore, IntPtr pPrevCertContext); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore_SafeCertStoreHandle.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore_SafeCertStoreHandle.cs new file mode 100644 index 00000000000000..a3cca96838daad --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertEnumCertificatesInStore_SafeCertStoreHandle.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial CERT_CONTEXT* CertEnumCertificatesInStore(SafeCertStoreHandle hCertStore, CERT_CONTEXT* pPrevCertContext); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindCertificateInStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindCertificateInStore.cs new file mode 100644 index 00000000000000..3a5400838ca763 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindCertificateInStore.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. + +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial SafeCertContextHandle CertFindCertificateInStore( + SafeCertStoreHandle hCertStore, + CertEncodingType dwCertEncodingType, + CertFindFlags dwFindFlags, + CertFindType dwFindType, + void* pvFindPara, + CERT_CONTEXT* pPrevCertContext); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindExtension.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindExtension.cs new file mode 100644 index 00000000000000..da00ba41a3814b --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindExtension.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial CERT_EXTENSION* CertFindExtension([MarshalAs(UnmanagedType.LPStr)] string pszObjId, int cExtensions, IntPtr rgExtensions); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindFlags.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindFlags.cs new file mode 100644 index 00000000000000..35d76fedd8d814 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindFlags.cs @@ -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. + +using System; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [Flags] + internal enum CertFindFlags : int + { + None = 0x00000000, + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindType.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindType.cs new file mode 100644 index 00000000000000..ebb7918939559e --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFindType.cs @@ -0,0 +1,18 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + internal enum CertFindType : int + { + CERT_FIND_SUBJECT_CERT = 0x000b0000, + CERT_FIND_HASH = 0x00010000, + CERT_FIND_SUBJECT_STR = 0x00080007, + CERT_FIND_ISSUER_STR = 0x00080004, + CERT_FIND_EXISTING = 0x000d0000, + CERT_FIND_ANY = 0x00000000, + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateChain.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateChain.cs new file mode 100644 index 00000000000000..c92ccaf0b62a09 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateChain.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial void CertFreeCertificateChain(IntPtr pChainContext); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateChainEngine.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateChainEngine.cs new file mode 100644 index 00000000000000..425dbe78c02908 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateChainEngine.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32)] + internal static partial void CertFreeCertificateChainEngine(IntPtr hChainEngine); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateContext.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateContext.cs index 9158b597dbbb7f..11ad3eb329704a 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateContext.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertFreeCertificateContext.cs @@ -9,12 +9,7 @@ internal static partial class Interop internal static partial class Crypt32 { // Note: This api always return TRUE, regardless of success. -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] internal static partial bool CertFreeCertificateContext(IntPtr pCertContext); -#else - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CertFreeCertificateContext(IntPtr pCertContext); -#endif } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateChain.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateChain.cs new file mode 100644 index 00000000000000..ea7f477e0321b0 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateChain.cs @@ -0,0 +1,57 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + internal static unsafe partial bool CertGetCertificateChain( + IntPtr hChainEngine, + SafeCertContextHandle pCertContext, + FILETIME* pTime, + SafeCertStoreHandle hStore, + ref CERT_CHAIN_PARA pChainPara, + CertChainFlags dwFlags, + IntPtr pvReserved, + out SafeX509ChainHandle ppChainContext); + + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct CERT_CHAIN_PARA + { + public int cbSize; + public CERT_USAGE_MATCH RequestedUsage; + public CERT_USAGE_MATCH RequestedIssuancePolicy; + public int dwUrlRetrievalTimeout; + public int fCheckRevocationFreshnessTime; + public int dwRevocationFreshnessTime; + public FILETIME* pftCacheResync; + public int pStrongSignPara; + public int dwStrongSignFlags; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct CERT_USAGE_MATCH + { + public CertUsageMatchType dwType; + public CTL_USAGE Usage; + } + + internal enum CertUsageMatchType : int + { + USAGE_MATCH_TYPE_AND = 0x00000000, + USAGE_MATCH_TYPE_OR = 0x00000001, + } + + [StructLayout(LayoutKind.Sequential)] + internal struct CTL_USAGE + { + public int cUsageIdentifier; + public IntPtr rgpszUsageIdentifier; + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty.cs index fbc2a1561b71b7..a6a2001e289733 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty.cs @@ -9,8 +9,6 @@ internal static partial class Interop { internal static partial class Crypt32 { -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] internal static partial bool CertGetCertificateContextProperty( SafeCertContextHandle pCertContext, @@ -31,30 +29,5 @@ internal static partial bool CertGetCertificateContextProperty( CertContextPropId dwPropId, out DATA_BLOB pvData, ref int pcbData); - -#else - - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CertGetCertificateContextProperty( - SafeCertContextHandle pCertContext, - CertContextPropId dwPropId, - [Out] byte[]? pvData, - [In, Out] ref int pcbData); - - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CertGetCertificateContextProperty( - SafeCertContextHandle pCertContext, - CertContextPropId dwPropId, - out IntPtr pvData, - [In, Out] ref int pcbData); - - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CertGetCertificateContextProperty( - SafeCertContextHandle pCertContext, - CertContextPropId dwPropId, - [Out] out DATA_BLOB pvData, - [In, Out] ref int pcbData); - -#endif } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextPropertyString.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextPropertyString.cs new file mode 100644 index 00000000000000..8f942403261ac6 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextPropertyString.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertGetCertificateContextProperty", CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial bool CertGetCertificateContextPropertyString(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, byte* pvData, ref int pcbData); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty_NO_NULLABLE.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty_NO_NULLABLE.cs index 5f8c59d67c24f3..545cbe60ab87bb 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty_NO_NULLABLE.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty_NO_NULLABLE.cs @@ -8,20 +8,11 @@ internal static partial class Interop { internal static partial class Crypt32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] internal static partial bool CertGetCertificateContextProperty( SafeCertContextHandle pCertContext, CertContextPropId dwPropId, byte[] pvData, ref int pcbData); -#else - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CertGetCertificateContextProperty( - SafeCertContextHandle pCertContext, - CertContextPropId dwPropId, - [Out] byte[] pvData, - [In, Out] ref int pcbData); -#endif } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetIntendedKeyUsage.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetIntendedKeyUsage.cs new file mode 100644 index 00000000000000..ab9cb7a6d3b012 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetIntendedKeyUsage.cs @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + // Note: It's somewhat unusual to use an API enum as a parameter type to a P/Invoke but in this case, X509KeyUsageFlags was intentionally designed as bit-wise + // identical to the wincrypt CERT_*_USAGE values. + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial bool CertGetIntendedKeyUsage( + CertEncodingType dwCertEncodingType, + CERT_INFO* pCertInfo, + out X509KeyUsageFlags pbKeyUsage, + int cbKeyUsage); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetNameString.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetNameString.cs new file mode 100644 index 00000000000000..a9ed56eb09fcb9 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetNameString.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertGetNameStringW", CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial int CertGetNameString(SafeCertContextHandle pCertContext, CertNameType dwType, CertNameFlags dwFlags, in CertNameStringType pvTypePara, char* pszNameString, int cchNameString); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetPublicKeyLength.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetPublicKeyLength.cs index 2bafe99799b3d9..7bf838e548fa49 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetPublicKeyLength.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetPublicKeyLength.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Crypt32 { - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern int CertGetPublicKeyLength(MsgEncodingType dwCertEncodingType, [In] ref CERT_PUBLIC_KEY_INFO pPublicKey); + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial int CertGetPublicKeyLength(MsgEncodingType dwCertEncodingType, ref CERT_PUBLIC_KEY_INFO pPublicKey); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetValidUsages.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetValidUsages.cs new file mode 100644 index 00000000000000..5e4dcf1c668a94 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetValidUsages.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial bool CertGetValidUsages(int cCerts, ref SafeCertContextHandle rghCerts, out int cNumOIDs, void* rghOIDs, ref int pcbOIDs); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameFlags.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameFlags.cs new file mode 100644 index 00000000000000..a8e2fad9957e23 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameFlags.cs @@ -0,0 +1,17 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [Flags] + internal enum CertNameFlags : int + { + None = 0x00000000, + CERT_NAME_ISSUER_FLAG = 0x00000001, + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameStringType.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameStringType.cs new file mode 100644 index 00000000000000..bfbf85c53ed1a8 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameStringType.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + internal enum CertNameStringType : int + { + CERT_X500_NAME_STR = 3, + CERT_NAME_STR_REVERSE_FLAG = 0x02000000, + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameToStr.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameToStr.cs index 534dc6418c9c79..0228f4b78da755 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameToStr.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameToStr.cs @@ -7,13 +7,8 @@ internal static partial class Interop { internal static partial class Crypt32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertNameToStrW", CharSet = CharSet.Unicode, SetLastError = true)] internal static unsafe partial int CertNameToStr( -#else - [DllImport(Libraries.Crypt32, EntryPoint = "CertNameToStrW", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern unsafe int CertNameToStr( -#endif int dwCertEncodingType, void* pName, int dwStrType, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameType.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameType.cs new file mode 100644 index 00000000000000..7f446acff18a41 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameType.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. + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + internal enum CertNameType : int + { + CERT_NAME_EMAIL_TYPE = 1, + CERT_NAME_RDN_TYPE = 2, + CERT_NAME_ATTR_TYPE = 3, + CERT_NAME_SIMPLE_DISPLAY_TYPE = 4, + CERT_NAME_FRIENDLY_DISPLAY_TYPE = 5, + CERT_NAME_DNS_TYPE = 6, + CERT_NAME_URL_TYPE = 7, + CERT_NAME_UPN_TYPE = 8, + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertOpenStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertOpenStore.cs index e67285209065c4..0374c231d3cf95 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertOpenStore.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertOpenStore.cs @@ -13,7 +13,7 @@ internal static partial class Crypt32 internal const uint X509_ASN_ENCODING = 0x00000001; internal const uint CERT_STORE_PROV_MEMORY = 2; - [DllImport(Interop.Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern SafeCertStoreHandle CertOpenStore(IntPtr lpszStoreProvider, uint dwMsgAndCertEncodingType, IntPtr hCryptProv, uint dwFlags, string pvPara); + [GeneratedDllImport(Interop.Libraries.Crypt32, SetLastError = true)] + internal static partial SafeCertStoreHandle CertOpenStore(IntPtr lpszStoreProvider, uint dwMsgAndCertEncodingType, IntPtr hCryptProv, uint dwFlags, IntPtr pvPara); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertOpenStore_ENUM.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertOpenStore_ENUM.cs new file mode 100644 index 00000000000000..9015f6ab034a66 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertOpenStore_ENUM.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial SafeCertStoreHandle CertOpenStore(IntPtr lpszStoreProvider, CertEncodingType dwMsgAndCertEncodingType, IntPtr hCryptProv, CertStoreFlags dwFlags, [MarshalAs(UnmanagedType.LPWStr)] string? pvPara); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSaveStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSaveStore.cs new file mode 100644 index 00000000000000..56d777dd44b5de --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSaveStore.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. + +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + public static partial bool CertSaveStore( + SafeCertStoreHandle hCertStore, + CertEncodingType dwMsgAndCertEncodingType, + CertStoreSaveAs dwSaveAs, + CertStoreSaveTo dwSaveTo, + ref DATA_BLOB pvSaveToPara, + int dwFlags); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSerializeCertificateStoreElement.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSerializeCertificateStoreElement.cs new file mode 100644 index 00000000000000..4eae575f77b3b4 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSerializeCertificateStoreElement.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial bool CertSerializeCertificateStoreElement(SafeCertContextHandle pCertContext, int dwFlags, byte[]? pbElement, ref int pcbElement); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_CRYPT_KEY_PROV_INFO.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_CRYPT_KEY_PROV_INFO.cs new file mode 100644 index 00000000000000..f66229c2bb4446 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_CRYPT_KEY_PROV_INFO.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, CRYPT_KEY_PROV_INFO* pvData); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_DATA_BLOB.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_DATA_BLOB.cs new file mode 100644 index 00000000000000..751070fcd4182d --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_DATA_BLOB.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, DATA_BLOB* pvData); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_SafeNCryptKeyHandle.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_SafeNCryptKeyHandle.cs new file mode 100644 index 00000000000000..a59e8111c27a90 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetCertificateContextProperty_SafeNCryptKeyHandle.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, SafeNCryptKeyHandle keyHandle); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetPropertyFlags.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetPropertyFlags.cs new file mode 100644 index 00000000000000..9077fd78802d83 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertSetPropertyFlags.cs @@ -0,0 +1,17 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [Flags] + internal enum CertSetPropertyFlags : int + { + CERT_SET_PROPERTY_INHIBIT_PERSIST_FLAG = 0x40000000, + None = 0x00000000, + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStoreAddDisposition.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStoreAddDisposition.cs new file mode 100644 index 00000000000000..dcc867af250759 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStoreAddDisposition.cs @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + internal enum CertStoreAddDisposition : int + { + CERT_STORE_ADD_NEW = 1, + CERT_STORE_ADD_USE_EXISTING = 2, + CERT_STORE_ADD_REPLACE_EXISTING = 3, + CERT_STORE_ADD_ALWAYS = 4, + CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES = 5, + CERT_STORE_ADD_NEWER = 6, + CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES = 7, + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStoreFlags.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStoreFlags.cs new file mode 100644 index 00000000000000..cca7c39ac60f4a --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStoreFlags.cs @@ -0,0 +1,33 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [Flags] + internal enum CertStoreFlags : int + { + CERT_STORE_NO_CRYPT_RELEASE_FLAG = 0x00000001, + CERT_STORE_SET_LOCALIZED_NAME_FLAG = 0x00000002, + CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG = 0x00000004, + CERT_STORE_DELETE_FLAG = 0x00000010, + CERT_STORE_UNSAFE_PHYSICAL_FLAG = 0x00000020, + CERT_STORE_SHARE_STORE_FLAG = 0x00000040, + CERT_STORE_SHARE_CONTEXT_FLAG = 0x00000080, + CERT_STORE_MANIFOLD_FLAG = 0x00000100, + CERT_STORE_ENUM_ARCHIVED_FLAG = 0x00000200, + CERT_STORE_UPDATE_KEYID_FLAG = 0x00000400, + CERT_STORE_BACKUP_RESTORE_FLAG = 0x00000800, + CERT_STORE_READONLY_FLAG = 0x00008000, + CERT_STORE_OPEN_EXISTING_FLAG = 0x00004000, + CERT_STORE_CREATE_NEW_FLAG = 0x00002000, + CERT_STORE_MAXIMUM_ALLOWED_FLAG = 0x00001000, + CERT_SYSTEM_STORE_CURRENT_USER = 0x00010000, + CERT_SYSTEM_STORE_LOCAL_MACHINE = 0x00020000, + None = 0x00000000, + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStoreSaveAs.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStoreSaveAs.cs new file mode 100644 index 00000000000000..71656911cb827b --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStoreSaveAs.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + internal enum CertStoreSaveAs : int + { + CERT_STORE_SAVE_AS_STORE = 1, + CERT_STORE_SAVE_AS_PKCS7 = 2, + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStoreSaveTo.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStoreSaveTo.cs new file mode 100644 index 00000000000000..bc517d1cece074 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStoreSaveTo.cs @@ -0,0 +1,13 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + internal enum CertStoreSaveTo : int + { + CERT_STORE_SAVE_TO_MEMORY = 2 + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStrToName.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStrToName.cs new file mode 100644 index 00000000000000..ae82cf52a97f8a --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertStrToName.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertStrToNameW", CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial bool CertStrToName(CertEncodingType dwCertEncodingType, string pszX500, CertNameStrTypeAndFlags dwStrType, IntPtr pvReserved, byte[]? pbEncoded, ref int pcbEncoded, IntPtr ppszError); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertVerifyTimeValidity.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertVerifyTimeValidity.cs new file mode 100644 index 00000000000000..5d7a09d99bbce9 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertVerifyTimeValidity.cs @@ -0,0 +1,13 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial int CertVerifyTimeValidity(ref FILETIME pTimeToVerify, CERT_INFO* pCertInfo); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.ChainEngine.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.ChainEngine.cs new file mode 100644 index 00000000000000..0f5c7db4fcb8e1 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.ChainEngine.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + internal enum ChainEngine : int + { + HCCE_CURRENT_USER = 0x0, + HCCE_LOCAL_MACHINE = 0x1, + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.ChainEngineConfigFlags.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.ChainEngineConfigFlags.cs new file mode 100644 index 00000000000000..688cc717f7e915 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.ChainEngineConfigFlags.cs @@ -0,0 +1,21 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [Flags] + internal enum ChainEngineConfigFlags : int + { + CERT_CHAIN_CACHE_END_CERT = 0x00000001, + CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL = 0x00000004, + CERT_CHAIN_USE_LOCAL_MACHINE_STORE = 0x00000008, + CERT_CHAIN_ENABLE_CACHE_AUTO_UPDATE = 0x00000010, + CERT_CHAIN_ENABLE_SHARE_STORE = 0x00000020, + CERT_CHAIN_DISABLE_AIA = 0x00002000, + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey.cs index 12e8dd949e2220..16989e24a55889 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey.cs @@ -9,8 +9,8 @@ internal static partial class Interop { internal static partial class Crypt32 { - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CryptAcquireCertificatePrivateKey( + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial bool CryptAcquireCertificatePrivateKey( SafeCertContextHandle pCert, CryptAcquireCertificatePrivateKeyFlags dwFlags, IntPtr pvParameters, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey_SafeNCryptKeyHandle.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey_SafeNCryptKeyHandle.cs new file mode 100644 index 00000000000000..24bf1859eb6592 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey_SafeNCryptKeyHandle.cs @@ -0,0 +1,21 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + public static partial bool CryptAcquireCertificatePrivateKey( + SafeCertContextHandle pCert, + CryptAcquireCertificatePrivateKeyFlags dwFlags, + IntPtr pvParameters, + out SafeNCryptKeyHandle phCryptProvOrNCryptKey, + out CryptKeySpec pdwKeySpec, + out bool pfCallerFreeProvOrNCryptKey); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireContextFlags.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireContextFlags.cs new file mode 100644 index 00000000000000..65102f6a7ecf02 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireContextFlags.cs @@ -0,0 +1,18 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [Flags] + internal enum CryptAcquireContextFlags : int + { + CRYPT_DELETEKEYSET = 0x00000010, + CRYPT_MACHINE_KEYSET = 0x00000020, + None = 0x00000000, + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject.cs index a2975e2a82b436..4f77e5a9e6c008 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject.cs @@ -13,8 +13,8 @@ internal static unsafe bool CryptDecodeObject(CryptDecodeObjectStructType lpszSt return CryptDecodeObject(MsgEncodingType.All, (IntPtr)lpszStructType, pbEncoded, cbEncoded, 0, pvStructInfo, ref pcbStructInfo); } - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - private static extern unsafe bool CryptDecodeObject( + [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + private static unsafe partial bool CryptDecodeObject( MsgEncodingType dwCertEncodingType, IntPtr lpszStructType, IntPtr pbEncoded, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectFlags.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectFlags.cs new file mode 100644 index 00000000000000..dc6515b46a8cbd --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectFlags.cs @@ -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. + +using System; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [Flags] + internal enum CryptDecodeObjectFlags : int + { + None = 0x00000000, + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectPointer_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectPointer_IntPtr.cs new file mode 100644 index 00000000000000..2a3535a5fa9142 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectPointer_IntPtr.cs @@ -0,0 +1,21 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CryptDecodeObject", CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial bool CryptDecodeObjectPointer( + CertEncodingType dwCertEncodingType, + IntPtr lpszStructType, + byte[] pbEncoded, + int cbEncoded, + CryptDecodeObjectFlags dwFlags, + void* pvStructInfo, + ref int pcbStructInfo); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectPointer_string.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectPointer_string.cs new file mode 100644 index 00000000000000..bbe47942f3fd7c --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectPointer_string.cs @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CryptDecodeObject", CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial bool CryptDecodeObjectPointer( + CertEncodingType dwCertEncodingType, + [MarshalAs(UnmanagedType.LPStr)] string lpszStructType, + byte[] pbEncoded, int cbEncoded, + CryptDecodeObjectFlags dwFlags, + void* pvStructInfo, + ref int pcbStructInfo); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject_CertEncodingType.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject_CertEncodingType.cs new file mode 100644 index 00000000000000..79dbd2e3b7a4ad --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject_CertEncodingType.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial bool CryptDecodeObject(CertEncodingType dwCertEncodingType, IntPtr lpszStructType, byte[] pbEncoded, int cbEncoded, CryptDecodeObjectFlags dwFlags, byte[]? pvStructInfo, ref int pcbStructInfo); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject.cs index 454355a75a7b88..cf0d7754abb130 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject.cs @@ -10,15 +10,15 @@ internal static partial class Crypt32 { internal static unsafe bool CryptEncodeObject(MsgEncodingType dwCertEncodingType, CryptDecodeObjectStructType lpszStructType, void* pvStructInfo, byte[]? pbEncoded, ref int pcbEncoded) { - return CryptEncodeObject(dwCertEncodingType, (IntPtr)lpszStructType, pvStructInfo, pbEncoded, ref pcbEncoded); + return CryptEncodeObject(dwCertEncodingType, (nint)lpszStructType, pvStructInfo, pbEncoded, ref pcbEncoded); } - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - private static extern unsafe bool CryptEncodeObject( + [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + private static unsafe partial bool CryptEncodeObject( MsgEncodingType dwCertEncodingType, - IntPtr lpszStructType, + nint lpszStructType, void* pvStructInfo, - [Out] byte[]? pbEncoded, - [In, Out] ref int pcbEncoded); + byte[]? pbEncoded, + ref int pcbEncoded); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject_CertEncodingType.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject_CertEncodingType.cs new file mode 100644 index 00000000000000..2884cbe7c49bb2 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject_CertEncodingType.cs @@ -0,0 +1,17 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial bool CryptEncodeObject(CertEncodingType dwCertEncodingType, IntPtr lpszStructType, void* pvStructInfo, byte[]? pbEncoded, ref int pcbEncoded); + + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial bool CryptEncodeObject(CertEncodingType dwCertEncodingType, [MarshalAs(UnmanagedType.LPStr)] string lpszStructType, void* pvStructInfo, byte[]? pbEncoded, ref int pcbEncoded); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptHashPublicKeyInfo.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptHashPublicKeyInfo.cs new file mode 100644 index 00000000000000..0098accc75782f --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptHashPublicKeyInfo.cs @@ -0,0 +1,21 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial bool CryptHashPublicKeyInfo( + IntPtr hCryptProv, + int algId, + int dwFlags, + CertEncodingType dwCertEncodingType, + ref CERT_PUBLIC_KEY_INFO pInfo, + byte[] pbComputedHash, + ref int pcbComputedHash); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptImportPublicKeyInfoEx2.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptImportPublicKeyInfoEx2.cs new file mode 100644 index 00000000000000..0d0d38fd2e6e78 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptImportPublicKeyInfoEx2.cs @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial bool CryptImportPublicKeyInfoEx2( + CertEncodingType dwCertEncodingType, + CERT_PUBLIC_KEY_INFO* pInfo, + CryptImportPublicKeyInfoFlags dwFlags, + void* pvAuxInfo, + out SafeBCryptKeyHandle phKey); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptImportPublicKeyInfoFlags.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptImportPublicKeyInfoFlags.cs new file mode 100644 index 00000000000000..776c2f9c8f0f4c --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptImportPublicKeyInfoFlags.cs @@ -0,0 +1,17 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [Flags] + internal enum CryptImportPublicKeyInfoFlags + { + NONE = 0, + CRYPT_OID_INFO_PUBKEY_ENCRYPT_KEY_FLAG = 0x40000000, + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgClose.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgClose.cs index f4235e3d178bb5..03b528c439552a 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgClose.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgClose.cs @@ -8,12 +8,7 @@ internal static partial class Interop { internal static partial class Crypt32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] internal static partial bool CryptMsgClose(IntPtr hCryptMsg); -#else - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CryptMsgClose(IntPtr hCryptMsg); -#endif } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgControl.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgControl.cs index 6bc536407a9f97..6bd86b24e18e25 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgControl.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgControl.cs @@ -8,18 +8,22 @@ internal static partial class Interop { internal static partial class Crypt32 { +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we add support for non-blittable struct marshalling. [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] internal static extern bool CryptMsgControl( SafeCryptMsgHandle hCryptMsg, int dwFlags, MsgControlType dwCtrlType, - [In] ref CMSG_CTRL_DECRYPT_PARA pvCtrlPara); + ref CMSG_CTRL_DECRYPT_PARA pvCtrlPara); [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] internal static extern bool CryptMsgControl( SafeCryptMsgHandle hCryptMsg, int dwFlags, MsgControlType dwCtrlType, - [In] ref CMSG_CTRL_KEY_AGREE_DECRYPT_PARA pvCtrlPara); + ref CMSG_CTRL_KEY_AGREE_DECRYPT_PARA pvCtrlPara); +#pragma warning restore DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time + } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgGetParam.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgGetParam.cs index e769cadb452a25..a16ef678cd75c5 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgGetParam.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgGetParam.cs @@ -9,36 +9,36 @@ internal static partial class Interop { internal static partial class Crypt32 { - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CryptMsgGetParam( + [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + internal static partial bool CryptMsgGetParam( SafeCryptMsgHandle hCryptMsg, CryptMsgParamType dwParamType, int dwIndex, out int pvData, - [In, Out] ref int pcbData); + ref int pcbData); - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CryptMsgGetParam( + [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + internal static unsafe partial bool CryptMsgGetParam( SafeCryptMsgHandle hCryptMsg, CryptMsgParamType dwParamType, int dwIndex, - out CryptMsgType pvData, - [In, Out] ref int pcbData); + byte* pvData, + ref int pcbData); - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CryptMsgGetParam( + [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + internal static partial bool CryptMsgGetParam( SafeCryptMsgHandle hCryptMsg, CryptMsgParamType dwParamType, int dwIndex, - [Out] byte[]? pvData, - [In, Out] ref int pcbData); + out CryptMsgType pvData, + ref int pcbData); - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CryptMsgGetParam( + [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + internal static partial bool CryptMsgGetParam( SafeCryptMsgHandle hCryptMsg, CryptMsgParamType dwParamType, int dwIndex, IntPtr pvData, - [In, Out] ref int pcbData); + ref int pcbData); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToDecode.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToDecode.cs index eeab2204e15742..35461f94a4c271 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToDecode.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToDecode.cs @@ -9,8 +9,8 @@ internal static partial class Interop { internal static partial class Crypt32 { - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern SafeCryptMsgHandle CryptMsgOpenToDecode( + [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + internal static partial SafeCryptMsgHandle CryptMsgOpenToDecode( MsgEncodingType dwMsgEncodingType, int dwFlags, int dwMsgType, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToEncode.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToEncode.cs index c3ef5757599604..2d0bfdac4bb758 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToEncode.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToEncode.cs @@ -9,8 +9,8 @@ internal static partial class Interop { internal static partial class Crypt32 { - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern unsafe SafeCryptMsgHandle CryptMsgOpenToEncode( + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial SafeCryptMsgHandle CryptMsgOpenToEncode( MsgEncodingType dwMsgEncodingType, int dwFlags, CryptMsgType dwMsgType, diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgUpdate.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgUpdate.cs index cfa26203da764c..a30c2d8b74b86e 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgUpdate.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgUpdate.cs @@ -9,13 +9,13 @@ internal static partial class Interop { internal static partial class Crypt32 { - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CryptMsgUpdate(SafeCryptMsgHandle hCryptMsg, [In] byte[] pbData, int cbData, bool fFinal); + [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + internal static partial bool CryptMsgUpdate(SafeCryptMsgHandle hCryptMsg, byte[] pbData, int cbData, bool fFinal); - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CryptMsgUpdate(SafeCryptMsgHandle hCryptMsg, IntPtr pbData, int cbData, bool fFinal); + [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + internal static partial bool CryptMsgUpdate(SafeCryptMsgHandle hCryptMsg, IntPtr pbData, int cbData, bool fFinal); - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CryptMsgUpdate(SafeCryptMsgHandle hCryptMsg, ref byte pbData, int cbData, bool fFinal); + [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] + internal static partial bool CryptMsgUpdate(SafeCryptMsgHandle hCryptMsg, ref byte pbData, int cbData, bool fFinal); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptProtectData.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptProtectData.cs index 6fab3a93fad5f4..c41e78d82d8e6b 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptProtectData.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptProtectData.cs @@ -9,15 +9,15 @@ internal static partial class Interop { internal static partial class Crypt32 { - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool CryptProtectData( - [In] ref DATA_BLOB pDataIn, - [In] string? szDataDescr, - [In] ref DATA_BLOB pOptionalEntropy, - [In] IntPtr pvReserved, - [In] IntPtr pPromptStruct, - [In] CryptProtectDataFlags dwFlags, - [Out] out DATA_BLOB pDataOut); + internal static partial bool CryptProtectData( + in DATA_BLOB pDataIn, + string? szDataDescr, + ref DATA_BLOB pOptionalEntropy, + IntPtr pvReserved, + IntPtr pPromptStruct, + CryptProtectDataFlags dwFlags, + out DATA_BLOB pDataOut); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptProtectMemory.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptProtectMemory.cs index 644d4e62191bb6..81f1b00ff23109 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptProtectMemory.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptProtectMemory.cs @@ -10,10 +10,10 @@ internal static partial class Crypt32 internal const uint CRYPTPROTECTMEMORY_BLOCK_SIZE = 16; internal const uint CRYPTPROTECTMEMORY_SAME_PROCESS = 0; - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CryptProtectMemory(SafeBuffer pData, uint cbData, uint dwFlags); + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial bool CryptProtectMemory(SafeBuffer pData, uint cbData, uint dwFlags); - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CryptUnprotectMemory(SafeBuffer pData, uint cbData, uint dwFlags); + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial bool CryptUnprotectMemory(SafeBuffer pData, uint cbData, uint dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptUnprotectData.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptUnprotectData.cs index ab32e33d59f02e..e4f2ba8564b8bb 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptUnprotectData.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptUnprotectData.cs @@ -9,15 +9,15 @@ internal static partial class Interop { internal static partial class Crypt32 { - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool CryptUnprotectData( - [In] ref DATA_BLOB pDataIn, - [In] IntPtr ppszDataDescr, - [In] ref DATA_BLOB pOptionalEntropy, - [In] IntPtr pvReserved, - [In] IntPtr pPromptStruct, - [In] CryptProtectDataFlags dwFlags, - [Out] out DATA_BLOB pDataOut); + internal static partial bool CryptUnprotectData( + in DATA_BLOB pDataIn, + IntPtr ppszDataDescr, + ref DATA_BLOB pOptionalEntropy, + IntPtr pvReserved, + IntPtr pPromptStruct, + CryptProtectDataFlags dwFlags, + out DATA_BLOB pDataOut); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.FindOidInfo.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.FindOidInfo.cs index 3df34615836a6a..761a68fbf8fda9 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.FindOidInfo.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.FindOidInfo.cs @@ -124,7 +124,7 @@ private static bool OidGroupWillNotUseActiveDirectory(OidGroup group) group == OidGroup.KeyDerivationFunction; } - [DllImport(Interop.Libraries.Crypt32, CharSet = CharSet.Unicode)] - private static extern IntPtr CryptFindOIDInfo(CryptOidInfoKeyType dwKeyType, IntPtr pvKey, OidGroup group); + [GeneratedDllImport(Interop.Libraries.Crypt32)] + private static partial IntPtr CryptFindOIDInfo(CryptOidInfoKeyType dwKeyType, IntPtr pvKey, OidGroup group); } } diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.HashIdAlg.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.HashIdAlg.cs index 926d8f463024e3..ec136c7c041ce0 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.HashIdAlg.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.HashIdAlg.cs @@ -12,8 +12,8 @@ internal static partial class Crypt32 /// /// Version used for a buffer containing a scalar integer (not an IntPtr) /// - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode)] - private static unsafe extern IntPtr CryptFindOIDInfo(CryptOidInfoKeyType dwKeyType, int* pvKey, OidGroup group); + [GeneratedDllImport(Libraries.Crypt32)] + private static unsafe partial IntPtr CryptFindOIDInfo(CryptOidInfoKeyType dwKeyType, int* pvKey, OidGroup group); public static CRYPT_OID_INFO FindAlgIdOidInfo(Interop.BCrypt.ECC_CURVE_ALG_ID_ENUM algId) { diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PFXExportCertStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PFXExportCertStore.cs new file mode 100644 index 00000000000000..c29f6a077dd38a --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PFXExportCertStore.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial bool PFXExportCertStore(SafeCertStoreHandle hStore, ref DATA_BLOB pPFX, SafePasswordHandle szPassword, PFXExportFlags dwFlags); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PFXExportFlags.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PFXExportFlags.cs new file mode 100644 index 00000000000000..c48c6eb5ee220d --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PFXExportFlags.cs @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [Flags] + internal enum PFXExportFlags : int + { + REPORT_NO_PRIVATE_KEY = 0x00000001, + REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY = 0x00000002, + EXPORT_PRIVATE_KEYS = 0x00000004, + None = 0x00000000, + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PFXImportCertStore.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PFXImportCertStore.cs new file mode 100644 index 00000000000000..5738e95bec28b5 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PFXImportCertStore.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial SafeCertStoreHandle PFXImportCertStore(ref DATA_BLOB pPFX, SafePasswordHandle password, PfxCertStoreFlags dwFlags); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PfxCertStoreFlags.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PfxCertStoreFlags.cs new file mode 100644 index 00000000000000..a345532a4eaf17 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.PfxCertStoreFlags.cs @@ -0,0 +1,25 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [Flags] + internal enum PfxCertStoreFlags : int + { + CRYPT_EXPORTABLE = 0x00000001, + CRYPT_USER_PROTECTED = 0x00000002, + CRYPT_MACHINE_KEYSET = 0x00000020, + CRYPT_USER_KEYSET = 0x00001000, + PKCS12_PREFER_CNG_KSP = 0x00000100, + PKCS12_ALWAYS_CNG_KSP = 0x00000200, + PKCS12_ALLOW_OVERWRITE_KEY = 0x00004000, + PKCS12_NO_PERSIST_KEY = 0x00008000, + PKCS12_INCLUDE_EXTENDED_PROPERTIES = 0x00000010, + None = 0x00000000, + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.X509KeyUsageFlags.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.X509KeyUsageFlags.cs new file mode 100644 index 00000000000000..ff5130a8b93304 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.X509KeyUsageFlags.cs @@ -0,0 +1,25 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; + +internal static partial class Interop +{ + internal static partial class Crypt32 + { + [Flags] + public enum X509KeyUsageFlags + { + None = 0x0000, + EncipherOnly = 0x0001, + CrlSign = 0x0002, + KeyCertSign = 0x0004, + KeyAgreement = 0x0008, + DataEncipherment = 0x0010, + KeyEncipherment = 0x0020, + NonRepudiation = 0x0040, + DigitalSignature = 0x0080, + DecipherOnly = 0x8000, + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.certificates.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.certificates.cs index e61361bfa8ae72..648708689a25c1 100644 --- a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.certificates.cs +++ b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.certificates.cs @@ -10,25 +10,13 @@ internal static partial class Interop { internal static partial class Crypt32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CertFreeCertificateContext(IntPtr pCertContext); -#else - [DllImport(Interop.Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool CertFreeCertificateContext(IntPtr pCertContext); -#endif -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool CertVerifyCertificateChainPolicy( -#else - [DllImport(Interop.Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool CertVerifyCertificateChainPolicy( -#endif IntPtr pszPolicyOID, SafeX509ChainHandle pChainContext, ref CERT_CHAIN_POLICY_PARA pPolicyPara, diff --git a/src/libraries/Common/src/Interop/Windows/CryptUI/Interop.CryptUIDlgCertificate.cs b/src/libraries/Common/src/Interop/Windows/CryptUI/Interop.CryptUIDlgCertificate.cs index d7d06ad62bfa3f..a82ac99918aeba 100644 --- a/src/libraries/Common/src/Interop/Windows/CryptUI/Interop.CryptUIDlgCertificate.cs +++ b/src/libraries/Common/src/Interop/Windows/CryptUI/Interop.CryptUIDlgCertificate.cs @@ -15,7 +15,7 @@ internal sealed class CRYPTUI_VIEWCERTIFICATE_STRUCTW internal uint dwSize; internal IntPtr hwndParent; internal uint dwFlags; - internal string szTitle; + internal string? szTitle; internal IntPtr pCertContext; internal IntPtr rgszPurposes; internal uint cPurposes; @@ -38,9 +38,9 @@ internal sealed class CRYPTUI_SELECTCERTIFICATE_STRUCTW internal uint dwSize; internal IntPtr hwndParent; internal uint dwFlags; - internal string szTitle; + internal string? szTitle; internal uint dwDontUseColumn; - internal string szDisplayString; + internal string? szDisplayString; internal IntPtr pFilterCallback; internal IntPtr pDisplayCallback; internal IntPtr pvCallbackData; @@ -53,10 +53,13 @@ internal sealed class CRYPTUI_SELECTCERTIFICATE_STRUCTW internal IntPtr hSelectedCertStore; } - [DllImport(Interop.Libraries.CryptUI, CharSet = CharSet.Unicode, SetLastError = true)] +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we support non-blittable types. + [DllImport(Interop.Libraries.CryptUI, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] internal static extern bool CryptUIDlgViewCertificateW([MarshalAs(UnmanagedType.LPStruct)] CRYPTUI_VIEWCERTIFICATE_STRUCTW ViewInfo, IntPtr pfPropertiesChanged); - [DllImport(Interop.Libraries.CryptUI, CharSet = CharSet.Unicode, SetLastError = true)] + [DllImport(Interop.Libraries.CryptUI, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] internal static extern SafeCertContextHandle CryptUIDlgSelectCertificateW([In, Out, MarshalAs(UnmanagedType.LPStruct)] CRYPTUI_SELECTCERTIFICATE_STRUCTW csc); +#pragma warning restore DLLIMPORTGENANALYZER015 } } diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUid.cs b/src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleFreeMemory.cs similarity index 57% rename from src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUid.cs rename to src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleFreeMemory.cs index 0d1bec671eaf9e..45c8e537e66af7 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetUid.cs +++ b/src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleFreeMemory.cs @@ -1,13 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Runtime.InteropServices; internal static partial class Interop { - internal static partial class Sys + internal static partial class Dsrole { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUid")] - internal static extern uint GetUid(); + [GeneratedDllImport(Libraries.Dsrole)] + public static partial int DsRoleFreeMemory(IntPtr buffer); } } diff --git a/src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleGetPrimaryDomainInformation.cs b/src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleGetPrimaryDomainInformation.cs new file mode 100644 index 00000000000000..97bff61ca10a2b --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Dsrole/Interop.DsRoleGetPrimaryDomainInformation.cs @@ -0,0 +1,25 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Dsrole + { + internal enum DSROLE_PRIMARY_DOMAIN_INFO_LEVEL + { + DsRolePrimaryDomainInfoBasic = 1, + DsRoleUpgradeStatus = 2, + DsRoleOperationState = 3, + DsRolePrimaryDomainInfoBasicEx = 4 + } + + [GeneratedDllImport(Libraries.Dsrole, CharSet = CharSet.Unicode, ExactSpelling = true)] + internal static partial int DsRoleGetPrimaryDomainInformation( + [MarshalAs(UnmanagedType.LPTStr)] string lpServer, + DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel, + out IntPtr Buffer); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Interop.Errors.cs b/src/libraries/Common/src/Interop/Windows/Interop.Errors.cs index d5f6d1637507fa..5a38c911ebb2a7 100644 --- a/src/libraries/Common/src/Interop/Windows/Interop.Errors.cs +++ b/src/libraries/Common/src/Interop/Windows/Interop.Errors.cs @@ -90,6 +90,7 @@ internal static partial class Errors internal const int ERROR_TIMEOUT = 0x5B4; internal const int ERROR_EVENTLOG_FILE_CHANGED = 0x5DF; internal const int ERROR_TRUSTED_RELATIONSHIP_FAILURE = 0x6FD; + internal const int ERROR_RESOURCE_TYPE_NOT_FOUND = 0x715; internal const int ERROR_RESOURCE_LANG_NOT_FOUND = 0x717; internal const int ERROR_NOT_A_REPARSE_POINT = 0x1126; } diff --git a/src/libraries/Common/src/Interop/Windows/Interop.Libraries.cs b/src/libraries/Common/src/Interop/Windows/Interop.Libraries.cs index 93c2bb72a806c4..81b31db1cff99a 100644 --- a/src/libraries/Common/src/Interop/Windows/Interop.Libraries.cs +++ b/src/libraries/Common/src/Interop/Windows/Interop.Libraries.cs @@ -34,6 +34,7 @@ internal static partial class Libraries internal const string User32 = "user32.dll"; internal const string Version = "version.dll"; internal const string WebSocket = "websocket.dll"; + internal const string Wevtapi = "wevtapi.dll"; internal const string WinHttp = "winhttp.dll"; internal const string WinMM = "winmm.dll"; internal const string Wkscli = "wkscli.dll"; diff --git a/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.GetNetworkParams.cs b/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.GetNetworkParams.cs index f731ce50e7a382..0e88f19ab01138 100644 --- a/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.GetNetworkParams.cs +++ b/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.GetNetworkParams.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class IpHlpApi { - [DllImport(Interop.Libraries.IpHlpApi, ExactSpelling = true)] - internal static unsafe extern uint GetNetworkParams(IntPtr pFixedInfo, uint* pOutBufLen); + [GeneratedDllImport(Interop.Libraries.IpHlpApi, ExactSpelling = true)] + internal static unsafe partial uint GetNetworkParams(IntPtr pFixedInfo, uint* pOutBufLen); } } diff --git a/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.NetworkInformation.cs b/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.NetworkInformation.cs index 40d3df8e16079f..b3c412c4b8cbf0 100644 --- a/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.NetworkInformation.cs +++ b/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.NetworkInformation.cs @@ -508,34 +508,40 @@ internal unsafe struct MibUdp6RowOwnerPid internal ReadOnlySpan localAddrAsSpan => MemoryMarshal.CreateSpan(ref localAddr[0], 16); } - [DllImport(Interop.Libraries.IpHlpApi)] - internal static unsafe extern uint GetAdaptersAddresses( + [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + internal static unsafe partial uint GetAdaptersAddresses( AddressFamily family, uint flags, IntPtr pReserved, IntPtr adapterAddresses, uint* outBufLen); - [DllImport(Interop.Libraries.IpHlpApi)] - internal static unsafe extern uint GetBestInterfaceEx(byte* ipAddress, int* index); + [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + internal static unsafe partial uint GetBestInterfaceEx(byte* ipAddress, int* index); +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time [DllImport(Interop.Libraries.IpHlpApi)] + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we support non-blittable types. internal static extern uint GetIfEntry2(ref MibIfRow2 pIfRow); +#pragma warning restore DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time - [DllImport(Interop.Libraries.IpHlpApi)] - internal static unsafe extern uint GetIpStatisticsEx(MibIpStats* statistics, AddressFamily family); + [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + internal static unsafe partial uint GetIpStatisticsEx(MibIpStats* statistics, AddressFamily family); - [DllImport(Interop.Libraries.IpHlpApi)] - internal static unsafe extern uint GetTcpStatisticsEx(MibTcpStats* statistics, AddressFamily family); + [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + internal static unsafe partial uint GetTcpStatisticsEx(MibTcpStats* statistics, AddressFamily family); - [DllImport(Interop.Libraries.IpHlpApi)] - internal static unsafe extern uint GetUdpStatisticsEx(MibUdpStats* statistics, AddressFamily family); + [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + internal static unsafe partial uint GetUdpStatisticsEx(MibUdpStats* statistics, AddressFamily family); - [DllImport(Interop.Libraries.IpHlpApi)] - internal static unsafe extern uint GetIcmpStatistics(MibIcmpInfo* statistics); + [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + internal static unsafe partial uint GetIcmpStatistics(MibIcmpInfo* statistics); +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time [DllImport(Interop.Libraries.IpHlpApi)] + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we support non-blittable types. internal static extern uint GetIcmpStatisticsEx(out MibIcmpInfoEx statistics, AddressFamily family); +#pragma warning restore DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time [GeneratedDllImport(Interop.Libraries.IpHlpApi)] internal static unsafe partial uint GetTcpTable(IntPtr pTcpTable, uint* dwOutBufLen, bool order); @@ -551,14 +557,14 @@ internal static unsafe partial uint GetExtendedTcpTable(IntPtr pTcpTable, uint* internal static unsafe partial uint GetExtendedUdpTable(IntPtr pUdpTable, uint* dwOutBufLen, bool order, uint IPVersion, UdpTableClass tableClass, uint reserved); - [DllImport(Interop.Libraries.IpHlpApi)] - internal static unsafe extern uint GetPerAdapterInfo(uint IfIndex, IntPtr pPerAdapterInfo, uint* pOutBufLen); + [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + internal static unsafe partial uint GetPerAdapterInfo(uint IfIndex, IntPtr pPerAdapterInfo, uint* pOutBufLen); - [DllImport(Interop.Libraries.IpHlpApi)] - internal static extern void FreeMibTable(IntPtr handle); + [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + internal static partial void FreeMibTable(IntPtr handle); - [DllImport(Interop.Libraries.IpHlpApi)] - internal static extern uint CancelMibChangeNotify2(IntPtr notificationHandle); + [GeneratedDllImport(Interop.Libraries.IpHlpApi)] + internal static partial uint CancelMibChangeNotify2(IntPtr notificationHandle); [GeneratedDllImport(Interop.Libraries.IpHlpApi)] internal static unsafe partial uint NotifyStableUnicastIpAddressTable( diff --git a/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.if_nametoindex.cs b/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.if_nametoindex.cs index d544a94747f515..01235ca5f73407 100644 --- a/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.if_nametoindex.cs +++ b/src/libraries/Common/src/Interop/Windows/IpHlpApi/Interop.if_nametoindex.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class IpHlpApi { - [DllImport(Interop.Libraries.IpHlpApi, SetLastError = true)] - internal static extern uint if_nametoindex(string name); + [GeneratedDllImport(Interop.Libraries.IpHlpApi, CharSet = CharSet.Ansi, SetLastError = true)] + internal static partial uint if_nametoindex(string name); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.COMMPROP.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.COMMPROP.cs index 8084c8a390a995..1b8d20024eaddb 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.COMMPROP.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.COMMPROP.cs @@ -33,7 +33,7 @@ internal struct COMMPROP public int dwCurrentRxQueue; public int dwProvSpec1; public int dwProvSpec2; - public char wcProvChar; + public ushort /*char*/ wcProvChar; } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommBreak.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommBreak.cs index 19602498de13e7..df293dec69cac3 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommBreak.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommBreak.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)] - internal static extern bool ClearCommBreak( + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool ClearCommBreak( SafeFileHandle hFile); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommError.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommError.cs index 8d4c5d1e6c7894..1d9806610ae14f 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommError.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ClearCommError.cs @@ -9,14 +9,14 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)] - internal static extern bool ClearCommError( + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool ClearCommError( SafeFileHandle hFile, ref int lpErrors, ref COMSTAT lpStat); - [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)] - internal static extern bool ClearCommError( + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool ClearCommError( SafeFileHandle hFile, ref int lpErrors, IntPtr lpStat); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CloseHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CloseHandle.cs index 0e4280b39dbf43..1fbd9b7dcbb179 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CloseHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CloseHandle.cs @@ -8,9 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { -#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time - // Disabled since CloseHandle is a QCall in some scenarios and DllImportGenerator doesn't support QCalls. - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool CloseHandle(IntPtr handle); + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool CloseHandle(IntPtr handle); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CompletionPort.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CompletionPort.cs index dc2c6c4193f7df..e33002e4b09144 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CompletionPort.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CompletionPort.cs @@ -8,15 +8,15 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern IntPtr CreateIoCompletionPort(IntPtr FileHandle, IntPtr ExistingCompletionPort, UIntPtr CompletionKey, int NumberOfConcurrentThreads); + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial IntPtr CreateIoCompletionPort(IntPtr FileHandle, IntPtr ExistingCompletionPort, UIntPtr CompletionKey, int NumberOfConcurrentThreads); - [DllImport(Libraries.Kernel32, SetLastError = true)] + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool PostQueuedCompletionStatus(IntPtr CompletionPort, int dwNumberOfBytesTransferred, UIntPtr CompletionKey, IntPtr lpOverlapped); + internal static partial bool PostQueuedCompletionStatus(IntPtr CompletionPort, int dwNumberOfBytesTransferred, UIntPtr CompletionKey, IntPtr lpOverlapped); - [DllImport(Libraries.Kernel32, SetLastError = true)] + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool GetQueuedCompletionStatus(IntPtr CompletionPort, out int lpNumberOfBytes, out UIntPtr CompletionKey, out IntPtr lpOverlapped, int dwMilliseconds); + internal static partial bool GetQueuedCompletionStatus(IntPtr CompletionPort, out int lpNumberOfBytes, out UIntPtr CompletionKey, out IntPtr lpOverlapped, int dwMilliseconds); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ConditionVariable.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ConditionVariable.cs index 6f736eebcb2db5..af96744ce14825 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ConditionVariable.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ConditionVariable.cs @@ -14,13 +14,13 @@ internal struct CONDITION_VARIABLE private IntPtr Ptr; } - [DllImport(Libraries.Kernel32, ExactSpelling = true)] - internal static extern unsafe void InitializeConditionVariable(CONDITION_VARIABLE* ConditionVariable); + [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)] + internal static unsafe partial void InitializeConditionVariable(CONDITION_VARIABLE* ConditionVariable); - [DllImport(Libraries.Kernel32, ExactSpelling = true)] - internal static extern unsafe void WakeConditionVariable(CONDITION_VARIABLE* ConditionVariable); + [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)] + internal static unsafe partial void WakeConditionVariable(CONDITION_VARIABLE* ConditionVariable); - [DllImport(Libraries.Kernel32, ExactSpelling = true)] - internal static extern unsafe bool SleepConditionVariableCS(CONDITION_VARIABLE* ConditionVariable, CRITICAL_SECTION* CriticalSection, int dwMilliseconds); + [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)] + internal static unsafe partial bool SleepConditionVariableCS(CONDITION_VARIABLE* ConditionVariable, CRITICAL_SECTION* CriticalSection, int dwMilliseconds); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CopyFileEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CopyFileEx.cs index 2dd22d45b3ae4d..fa9cfe3c3866e0 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CopyFileEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CopyFileEx.cs @@ -12,13 +12,8 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use CopyFileEx. /// -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CopyFileExW", CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CopyFileExW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] private static partial bool CopyFileExPrivate( -#else - [DllImport(Libraries.Kernel32, EntryPoint = "CopyFileExW", CharSet = CharSet.Unicode, SetLastError = true)] - private static extern bool CopyFileExPrivate( -#endif string src, string dst, IntPtr progressRoutine, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateDirectory.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateDirectory.cs index 60c13362b8edaf..1ce3534934a465 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateDirectory.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateDirectory.cs @@ -12,13 +12,8 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use CreateDirectory. /// -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateDirectoryW", CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateDirectoryW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] private static partial bool CreateDirectoryPrivate( -#else - [DllImport(Libraries.Kernel32, EntryPoint = "CreateDirectoryW", CharSet = CharSet.Unicode, SetLastError = true)] - private static extern bool CreateDirectoryPrivate( -#endif string path, ref SECURITY_ATTRIBUTES lpSecurityAttributes); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFile.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFile.cs index f26661c5e26355..b62016d77b92dd 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFile.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFile.cs @@ -13,13 +13,8 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use CreateFile. /// -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] private static unsafe partial SafeFileHandle CreateFilePrivate( -#else - [DllImport(Libraries.Kernel32, EntryPoint = "CreateFileW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] - private static unsafe extern SafeFileHandle CreateFilePrivate( -#endif string lpFileName, int dwDesiredAccess, FileShare dwShareMode, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFileMapping.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFileMapping.cs index 81ffec311fbc64..ba3f74ac8fd1c9 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFileMapping.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFileMapping.cs @@ -10,13 +10,8 @@ internal static partial class Interop { internal static partial class Kernel32 { -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] internal static partial SafeMemoryMappedFileHandle CreateFileMapping( -#else - [DllImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern SafeMemoryMappedFileHandle CreateFileMapping( -#endif SafeFileHandle hFile, ref SECURITY_ATTRIBUTES lpFileMappingAttributes, int flProtect, @@ -24,13 +19,8 @@ internal static extern SafeMemoryMappedFileHandle CreateFileMapping( int dwMaximumSizeLow, string? lpName); -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] internal static partial SafeMemoryMappedFileHandle CreateFileMapping( -#else - [DllImport(Libraries.Kernel32, EntryPoint = "CreateFileMappingW", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern SafeMemoryMappedFileHandle CreateFileMapping( -#endif IntPtr hFile, ref SECURITY_ATTRIBUTES lpFileMappingAttributes, int flProtect, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFile_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFile_IntPtr.cs index 41b2f88d223435..992d446c14b9ac 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFile_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateFile_IntPtr.cs @@ -12,13 +12,8 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use CreateFile. /// -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateFileW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] private static unsafe partial IntPtr CreateFilePrivate_IntPtr( -#else - [DllImport(Libraries.Kernel32, EntryPoint = "CreateFileW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] - private static unsafe extern IntPtr CreateFilePrivate_IntPtr( -#endif string lpFileName, int dwDesiredAccess, FileShare dwShareMode, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateSymbolicLink.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateSymbolicLink.cs index 9ecd41c46bd6b3..40a96147995acc 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateSymbolicLink.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateSymbolicLink.cs @@ -20,8 +20,8 @@ internal static partial class Kernel32 /// internal const int SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE = 0x2; - [DllImport(Libraries.Kernel32, EntryPoint = "CreateSymbolicLinkW", SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = false, ExactSpelling = true)] - private static extern bool CreateSymbolicLinkPrivate(string lpSymlinkFileName, string lpTargetFileName, int dwFlags); + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateSymbolicLinkW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + private static partial bool CreateSymbolicLinkPrivate(string lpSymlinkFileName, string lpTargetFileName, int dwFlags); /// /// Creates a symbolic link. diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateToolhelp32Snapshot.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateToolhelp32Snapshot.cs new file mode 100644 index 00000000000000..b0dff37964bf08 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateToolhelp32Snapshot.cs @@ -0,0 +1,55 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Kernel32 + { + [Flags] + internal enum SnapshotFlags : uint + { + HeapList = 0x00000001, + Process = 0x00000002, + Thread = 0x00000004, + Module = 0x00000008, + Module32 = 0x00000010, + All = (HeapList | Process | Thread | Module), + Inherit = 0x80000000, + NoHeaps = 0x40000000 + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + internal struct PROCESSENTRY32 + { + internal int dwSize; + internal int cntUsage; + internal int th32ProcessID; + internal IntPtr th32DefaultHeapID; + internal int th32ModuleID; + internal int cntThreads; + internal int th32ParentProcessID; + internal int pcPriClassBase; + internal int dwFlags; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_PATH)] + internal string szExeFile; + } + + // https://docs.microsoft.com/windows/desktop/api/tlhelp32/nf-tlhelp32-createtoolhelp32snapshot + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial IntPtr CreateToolhelp32Snapshot(SnapshotFlags dwFlags, uint th32ProcessID); + +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we support non-blittable types. + // https://docs.microsoft.com/windows/desktop/api/tlhelp32/nf-tlhelp32-process32first + [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = System.Runtime.InteropServices.CharSet.Auto)] + internal static extern bool Process32First(IntPtr hSnapshot, ref PROCESSENTRY32 lppe); + + // https://docs.microsoft.com/windows/desktop/api/tlhelp32/nf-tlhelp32-process32next + [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = System.Runtime.InteropServices.CharSet.Auto)] + internal static extern bool Process32Next(IntPtr hSnapshot, ref PROCESSENTRY32 lppe); +#pragma warning restore DLLIMPORTGENANALYZER015 + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CriticalSection.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CriticalSection.cs index 1d9a6ef5c7aca9..cfc24f7d32b049 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CriticalSection.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CriticalSection.cs @@ -19,16 +19,16 @@ internal struct CRITICAL_SECTION private UIntPtr SpinCount; } - [DllImport(Libraries.Kernel32, ExactSpelling = true)] - internal static extern unsafe void InitializeCriticalSection(CRITICAL_SECTION* lpCriticalSection); + [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)] + internal static unsafe partial void InitializeCriticalSection(CRITICAL_SECTION* lpCriticalSection); - [DllImport(Libraries.Kernel32, ExactSpelling = true)] - internal static extern unsafe void EnterCriticalSection(CRITICAL_SECTION* lpCriticalSection); + [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)] + internal static unsafe partial void EnterCriticalSection(CRITICAL_SECTION* lpCriticalSection); - [DllImport(Libraries.Kernel32, ExactSpelling = true)] - internal static extern unsafe void LeaveCriticalSection(CRITICAL_SECTION* lpCriticalSection); + [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)] + internal static unsafe partial void LeaveCriticalSection(CRITICAL_SECTION* lpCriticalSection); - [DllImport(Libraries.Kernel32, ExactSpelling = true)] - internal static extern unsafe void DeleteCriticalSection(CRITICAL_SECTION* lpCriticalSection); + [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)] + internal static unsafe partial void DeleteCriticalSection(CRITICAL_SECTION* lpCriticalSection); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeleteFile.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeleteFile.cs index a811e31f4f49f6..690a8b4f0025fb 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeleteFile.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeleteFile.cs @@ -12,13 +12,8 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use DeleteFile. /// -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "DeleteFileW", CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "DeleteFileW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] private static partial bool DeleteFilePrivate(string path); -#else - [DllImport(Libraries.Kernel32, EntryPoint = "DeleteFileW", CharSet = CharSet.Unicode, SetLastError = true)] - private static extern bool DeleteFilePrivate(string path); -#endif internal static bool DeleteFile(string path) { diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeleteVolumeMountPoint.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeleteVolumeMountPoint.cs index e898e36613477e..6283bed1b644bf 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeleteVolumeMountPoint.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeleteVolumeMountPoint.cs @@ -12,13 +12,8 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use DeleteVolumeMountPoint. /// -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "DeleteVolumeMountPointW", CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "DeleteVolumeMountPointW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] internal static partial bool DeleteVolumeMountPointPrivate(string mountPoint); -#else - [DllImport(Libraries.Kernel32, EntryPoint = "DeleteVolumeMountPointW", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool DeleteVolumeMountPointPrivate(string mountPoint); -#endif internal static bool DeleteVolumeMountPoint(string mountPoint) { diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeviceIoControl.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeviceIoControl.cs index be8def215178fb..7e6d1da4e73d81 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeviceIoControl.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeviceIoControl.cs @@ -12,8 +12,8 @@ internal static partial class Kernel32 // https://docs.microsoft.com/windows/win32/api/winioctl/ni-winioctl-fsctl_get_reparse_point internal const int FSCTL_GET_REPARSE_POINT = 0x000900a8; - [DllImport(Libraries.Kernel32, EntryPoint = "DeviceIoControl", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern bool DeviceIoControl( + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "DeviceIoControl", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial bool DeviceIoControl( SafeHandle hDevice, uint dwIoControlCode, IntPtr lpInBuffer, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeAccessTokenHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeAccessTokenHandle.cs index ddfd30f11ff6d3..fad810e4d27c84 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeAccessTokenHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeAccessTokenHandle.cs @@ -9,13 +9,8 @@ internal static partial class Interop { internal static partial class Kernel32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] internal static partial bool DuplicateHandle( -#else - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool DuplicateHandle( -#endif IntPtr hSourceProcessHandle, IntPtr hSourceHandle, IntPtr hTargetProcessHandle, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeWaitHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeWaitHandle.cs index f68f28bc1eadc6..69dc66c54ff861 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeWaitHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DuplicateHandle_SafeWaitHandle.cs @@ -9,13 +9,8 @@ internal static partial class Interop { internal static partial class Kernel32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] internal static partial bool DuplicateHandle( -#else - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool DuplicateHandle( -#endif IntPtr hSourceProcessHandle, SafeHandle hSourceHandle, IntPtr hTargetProcess, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EscapeCommFunction.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EscapeCommFunction.cs index ffd536c3691867..7c55043ebb191d 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EscapeCommFunction.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EscapeCommFunction.cs @@ -16,8 +16,8 @@ internal static class CommFunctions internal const int CLRDTR = 6; } - [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)] - internal static extern bool EscapeCommFunction( + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool EscapeCommFunction( SafeFileHandle hFile, int dwFunc); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EventWaitHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EventWaitHandle.cs index 94257ecaf02a36..07f09df664de9d 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EventWaitHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.EventWaitHandle.cs @@ -12,16 +12,16 @@ internal static partial class Kernel32 internal const uint CREATE_EVENT_INITIAL_SET = 0x2; internal const uint CREATE_EVENT_MANUAL_RESET = 0x1; - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool SetEvent(SafeWaitHandle handle); + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool SetEvent(SafeWaitHandle handle); - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool ResetEvent(SafeWaitHandle handle); + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool ResetEvent(SafeWaitHandle handle); - [DllImport(Libraries.Kernel32, EntryPoint = "CreateEventExW", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern SafeWaitHandle CreateEventEx(IntPtr lpSecurityAttributes, string? name, uint flags, uint desiredAccess); + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateEventExW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial SafeWaitHandle CreateEventEx(IntPtr lpSecurityAttributes, string? name, uint flags, uint desiredAccess); - [DllImport(Libraries.Kernel32, EntryPoint = "OpenEventW", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern SafeWaitHandle OpenEvent(uint desiredAccess, bool inheritHandle, string name); + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenEventW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial SafeWaitHandle OpenEvent(uint desiredAccess, bool inheritHandle, string name); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExpandEnvironmentStrings.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExpandEnvironmentStrings.cs index 6d47dbb5c60749..32d81b6e547004 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExpandEnvironmentStrings.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ExpandEnvironmentStrings.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, EntryPoint = "ExpandEnvironmentStringsW", CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] - internal static extern uint ExpandEnvironmentStrings(string lpSrc, ref char lpDst, uint nSize); + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ExpandEnvironmentStringsW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial uint ExpandEnvironmentStrings(string lpSrc, ref char lpDst, uint nSize); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileScatterGather.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileScatterGather.cs index 8e61970c3c2424..42afb969b0ef1a 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileScatterGather.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileScatterGather.cs @@ -9,16 +9,16 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe int ReadFileScatter( + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static unsafe partial int ReadFileScatter( SafeHandle hFile, long* aSegmentArray, int nNumberOfBytesToRead, IntPtr lpReserved, NativeOverlapped* lpOverlapped); - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe int WriteFileGather( + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static unsafe partial int WriteFileGather( SafeHandle hFile, long* aSegmentArray, int nNumberOfBytesToWrite, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileTimeToSystemTime.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileTimeToSystemTime.cs index b22ab21c065b68..adab75ec1081f5 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileTimeToSystemTime.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FileTimeToSystemTime.cs @@ -7,8 +7,8 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32)] + [GeneratedDllImport(Libraries.Kernel32)] [SuppressGCTransition] - internal static extern unsafe Interop.BOOL FileTimeToSystemTime(ulong* lpFileTime, Interop.Kernel32.SYSTEMTIME* lpSystemTime); + internal static unsafe partial Interop.BOOL FileTimeToSystemTime(ulong* lpFileTime, Interop.Kernel32.SYSTEMTIME* lpSystemTime); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindClose.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindClose.cs index c32ccf24f480be..7c04238ea3111c 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindClose.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindClose.cs @@ -8,12 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] internal static partial bool FindClose(IntPtr hFindFile); -#else - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool FindClose(IntPtr hFindFile); -#endif } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindFirstFileEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindFirstFileEx.cs index ab002dc28d6ab6..96f4eb5dbceea0 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindFirstFileEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindFirstFileEx.cs @@ -13,8 +13,8 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use FindFirstFile. /// - [DllImport(Libraries.Kernel32, EntryPoint = "FindFirstFileExW", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true)] - private static extern SafeFindHandle FindFirstFileExPrivate(string lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, ref WIN32_FIND_DATA lpFindFileData, FINDEX_SEARCH_OPS fSearchOp, IntPtr lpSearchFilter, int dwAdditionalFlags); + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "FindFirstFileExW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + private static partial SafeFindHandle FindFirstFileExPrivate(string lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, ref WIN32_FIND_DATA lpFindFileData, FINDEX_SEARCH_OPS fSearchOp, IntPtr lpSearchFilter, int dwAdditionalFlags); internal static SafeFindHandle FindFirstFile(string fileName, ref WIN32_FIND_DATA data) { diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindNextFile.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindNextFile.cs index b947d5d229c09e..dc4f9a4dec172e 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindNextFile.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FindNextFile.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, EntryPoint = "FindNextFileW", SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = false)] - internal static extern bool FindNextFile(SafeFindHandle hndFindFile, ref WIN32_FIND_DATA lpFindFileData); + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "FindNextFileW", CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial bool FindNextFile(SafeFindHandle hndFindFile, ref WIN32_FIND_DATA lpFindFileData); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FlushFileBuffers.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FlushFileBuffers.cs index 9b0e8571854e37..689e44321e72ee 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FlushFileBuffers.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FlushFileBuffers.cs @@ -7,14 +7,8 @@ internal static partial class Interop { internal static partial class Kernel32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool FlushFileBuffers(SafeHandle hHandle); -#else - [DllImport(Libraries.Kernel32, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool FlushFileBuffers(SafeHandle hHandle); -#endif } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FormatMessage_SafeLibraryHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FormatMessage_SafeLibraryHandle.cs index 288730496d6491..7dc7961a295809 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FormatMessage_SafeLibraryHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FormatMessage_SafeLibraryHandle.cs @@ -13,8 +13,8 @@ internal static partial class Kernel32 public const int FORMAT_MESSAGE_FROM_HMODULE = 0x00000800; public const int FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x00002000; - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true, BestFitMapping = true)] - public static extern int FormatMessage( + [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)] + public static partial int FormatMessage( int dwFlags, SafeLibraryHandle lpSource, uint dwMessageId, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeEnvironmentStrings.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeEnvironmentStrings.cs index 5af20c071ca1df..018f15e28aae7e 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeEnvironmentStrings.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeEnvironmentStrings.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, ExactSpelling = true)] - internal static extern unsafe BOOL FreeEnvironmentStringsW(char* lpszEnvironmentBlock); + [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)] + internal static unsafe partial BOOL FreeEnvironmentStringsW(char* lpszEnvironmentBlock); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeLibrary.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeLibrary.cs index 7863e2417e0033..9d8e18219c9d9e 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeLibrary.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FreeLibrary.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)] - internal static extern bool FreeLibrary(IntPtr hModule); + [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)] + internal static partial bool FreeLibrary(IntPtr hModule); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfo.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfo.cs index 990a43c827b6b9..0b5f3cc0703296 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfo.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfo.cs @@ -16,7 +16,7 @@ internal unsafe struct CPINFO internal fixed byte LeadByte[12 /* MAX_LEADBYTES */]; } - [DllImport(Libraries.Kernel32)] - internal static extern unsafe Interop.BOOL GetCPInfo(uint codePage, CPINFO* lpCpInfo); + [GeneratedDllImport(Libraries.Kernel32)] + internal static unsafe partial Interop.BOOL GetCPInfo(uint codePage, CPINFO* lpCpInfo); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfoEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfoEx.cs index b0c64b5c80b4d4..773f7ddb90110e 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfoEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCPInfoEx.cs @@ -7,8 +7,8 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, EntryPoint = "GetCPInfoExW")] - private static extern unsafe Interop.BOOL GetCPInfoExW(uint CodePage, uint dwFlags, CPINFOEXW* lpCPInfoEx); + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetCPInfoExW", CharSet = CharSet.Unicode)] + private static unsafe partial Interop.BOOL GetCPInfoExW(uint CodePage, uint dwFlags, CPINFOEXW* lpCPInfoEx); [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] private unsafe struct CPINFOEXW diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommModemStatus.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommModemStatus.cs index b0fdff93dc07ab..c0d6cf9ffc17d4 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommModemStatus.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommModemStatus.cs @@ -15,8 +15,8 @@ internal static class CommModemState internal const int MS_RLSD_ON = 0x80; } - [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)] - internal static extern bool GetCommModemStatus( + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool GetCommModemStatus( SafeFileHandle hFile, ref int lpModemStat); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommProperties.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommProperties.cs index c06d2a28b2c7ec..6d49331ec5eb3e 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommProperties.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommProperties.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)] - internal static extern bool GetCommProperties( + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool GetCommProperties( SafeFileHandle hFile, ref COMMPROP lpCommProp); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommState.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommState.cs index 09b81af4229d2b..45f54872edb6bc 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommState.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCommState.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)] - internal static extern bool GetCommState( + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool GetCommState( SafeFileHandle hFile, ref DCB lpDCB); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetComputerName.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetComputerName.cs index e186ac2be5725c..d82305b7f992e2 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetComputerName.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetComputerName.cs @@ -9,8 +9,8 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, EntryPoint = "GetComputerNameW", ExactSpelling = true)] - private static unsafe extern int GetComputerName(char* lpBuffer, uint* nSize); + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetComputerNameW", CharSet = CharSet.Unicode, ExactSpelling = true)] + private static unsafe partial int GetComputerName(char* lpBuffer, uint* nSize); // maximum length of the NETBIOS name (not including NULL) private const int MAX_COMPUTERNAME_LENGTH = 15; diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleCP.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleCP.cs index e76c06990b4b92..33e73f8042b77b 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleCP.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleCP.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32)] - internal static extern uint GetConsoleCP(); + [GeneratedDllImport(Libraries.Kernel32)] + internal static partial uint GetConsoleCP(); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs index b03d88f4750947..6eb46b1f4b6d90 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs @@ -8,13 +8,8 @@ internal static partial class Interop { internal static partial class Kernel32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] internal static partial bool GetConsoleMode(IntPtr handle, out int mode); -#else - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool GetConsoleMode(IntPtr handle, out int mode); -#endif internal static bool IsGetConsoleModeCallSuccessful(IntPtr handle) { @@ -22,13 +17,8 @@ internal static bool IsGetConsoleModeCallSuccessful(IntPtr handle) return GetConsoleMode(handle, out mode); } -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] internal static partial bool SetConsoleMode(IntPtr handle, int mode); -#else - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool SetConsoleMode(IntPtr handle, int mode); -#endif internal const int ENABLE_PROCESSED_INPUT = 0x0001; internal const uint ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004; diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleOutputCP.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleOutputCP.cs index fd59f4dddf1ca2..3d8c546dce5c18 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleOutputCP.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleOutputCP.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32)] - internal static extern uint GetConsoleOutputCP(); + [GeneratedDllImport(Libraries.Kernel32)] + internal static partial uint GetConsoleOutputCP(); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentDirectory.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentDirectory.cs index a8b30eb06d7f03..0146786e3cb7e2 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentDirectory.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentDirectory.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, EntryPoint = "GetCurrentDirectoryW", SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = false, ExactSpelling = true)] - internal static extern uint GetCurrentDirectory(uint nBufferLength, ref char lpBuffer); + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetCurrentDirectoryW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial uint GetCurrentDirectory(uint nBufferLength, ref char lpBuffer); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcess.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcess.cs index 3f7482f5385a6b..89f04ad9ff0806 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcess.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcess.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32)] - internal static extern IntPtr GetCurrentProcess(); + [GeneratedDllImport(Libraries.Kernel32)] + internal static partial IntPtr GetCurrentProcess(); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessId.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessId.cs index 70009c6f932359..be0fd40730358e 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessId.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentProcessId.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32)] - internal static extern uint GetCurrentProcessId(); + [GeneratedDllImport(Libraries.Kernel32)] + internal static partial uint GetCurrentProcessId(); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThread.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThread.cs index cefb82cbd3fbbd..73d33398d5a0fb 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThread.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThread.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Interop.Libraries.Kernel32)] - internal static extern IntPtr GetCurrentThread(); + [GeneratedDllImport(Interop.Libraries.Kernel32)] + internal static partial IntPtr GetCurrentThread(); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThreadId.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThreadId.cs index e7a0ce9678a779..651ee4a730ca0f 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThreadId.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetCurrentThreadId.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, ExactSpelling = true)] + [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)] [SuppressGCTransition] - public static extern int GetCurrentThreadId(); + public static partial int GetCurrentThreadId(); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentStrings.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentStrings.cs index 55452013da0273..06b89ceb4b48f7 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentStrings.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentStrings.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, ExactSpelling = true)] - internal static extern unsafe char* GetEnvironmentStringsW(); + [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)] + internal static unsafe partial char* GetEnvironmentStringsW(); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentVariable.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentVariable.cs index 425ea9ef1e2c81..60dbfc5889f7bb 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentVariable.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetEnvironmentVariable.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, EntryPoint = "GetEnvironmentVariableW", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern uint GetEnvironmentVariable(string lpName, ref char lpBuffer, uint nSize); + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetEnvironmentVariableW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial uint GetEnvironmentVariable(string lpName, ref char lpBuffer, uint nSize); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileAttributesEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileAttributesEx.cs index 25ca04d5c2eb87..3939b907942c54 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileAttributesEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileAttributesEx.cs @@ -11,13 +11,8 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use GetFileAttributesEx. /// -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetFileAttributesExW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] private static partial bool GetFileAttributesExPrivate( -#else - [DllImport(Libraries.Kernel32, EntryPoint = "GetFileAttributesExW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] - private static extern bool GetFileAttributesExPrivate( -#endif string? name, GET_FILEEX_INFO_LEVELS fileInfoLevel, ref WIN32_FILE_ATTRIBUTE_DATA lpFileInformation); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileInformationByHandleEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileInformationByHandleEx.cs index f91af06bb7a81e..6eb10526da9eb7 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileInformationByHandleEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileInformationByHandleEx.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, SetLastError = true, ExactSpelling = true)] - internal static extern unsafe bool GetFileInformationByHandleEx(SafeFileHandle hFile, int FileInformationClass, void* lpFileInformation, uint dwBufferSize); + [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)] + internal static unsafe partial bool GetFileInformationByHandleEx(SafeFileHandle hFile, int FileInformationClass, void* lpFileInformation, uint dwBufferSize); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileType_SafeHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileType_SafeHandle.cs index d5d2062f05d13c..76f99ac51b7d77 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileType_SafeHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFileType_SafeHandle.cs @@ -7,12 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] internal static partial int GetFileType(SafeHandle hFile); -#else - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern int GetFileType(SafeHandle hFile); -#endif } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFinalPathNameByHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFinalPathNameByHandle.cs index 756b1bbd72db12..26ded9e92f0767 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFinalPathNameByHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFinalPathNameByHandle.cs @@ -13,8 +13,8 @@ internal static partial class Kernel32 internal const uint FILE_NAME_NORMALIZED = 0x0; // https://docs.microsoft.com/windows/desktop/api/fileapi/nf-fileapi-getfinalpathnamebyhandlew (kernel32) - [DllImport(Libraries.Kernel32, EntryPoint = "GetFinalPathNameByHandleW", CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] - internal static unsafe extern uint GetFinalPathNameByHandle( + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetFinalPathNameByHandleW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static unsafe partial uint GetFinalPathNameByHandle( SafeFileHandle hFile, char* lpszFilePath, uint cchFilePath, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFullPathNameW.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFullPathNameW.cs index 191cfd64591d1a..69b6875d47a3fd 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFullPathNameW.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetFullPathNameW.cs @@ -11,13 +11,8 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use GetFullPathName or PathHelper. /// -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] internal static partial uint GetFullPathNameW( -#else - [DllImport(Libraries.Kernel32, BestFitMapping = false, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] - internal static extern uint GetFullPathNameW( -#endif ref char lpFileName, uint nBufferLength, ref char lpBuffer, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLastError.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLastError.cs index 6dec98d0d75181..55a84179887f5c 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLastError.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLastError.cs @@ -7,8 +7,8 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32)] + [GeneratedDllImport(Libraries.Kernel32)] [SuppressGCTransition] - internal static extern int GetLastError(); + internal static partial int GetLastError(); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLogicalDrives.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLogicalDrives.cs index c756043141c595..f084be9926b40b 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLogicalDrives.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLogicalDrives.cs @@ -7,12 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] internal static partial int GetLogicalDrives(); -#else - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern int GetLogicalDrives(); -#endif } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLongPathNameW.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLongPathNameW.cs index 10d536df0964e7..1556e3f2b29e15 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLongPathNameW.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetLongPathNameW.cs @@ -10,13 +10,8 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use GetFullPath/PathHelper. /// -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] internal static partial uint GetLongPathNameW( -#else - [DllImport(Libraries.Kernel32, BestFitMapping = false, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] - internal static extern uint GetLongPathNameW( -#endif ref char lpszShortPath, ref char lpszLongPath, uint cchBuffer); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleFileName.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleFileName.cs index 3973f9747937f9..1bf4e59b76c1a7 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleFileName.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleFileName.cs @@ -10,7 +10,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, EntryPoint = "GetModuleFileNameW", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern uint GetModuleFileName(IntPtr hModule, ref char lpFilename, uint nSize); + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetModuleFileNameW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial uint GetModuleFileName(IntPtr hModule, ref char lpFilename, uint nSize); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleHandle.cs index 99f35d7b3c547a..ad1bbb9b966b18 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetModuleHandle.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, EntryPoint = "GetModuleHandleW", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern IntPtr GetModuleHandle(string? moduleName); + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetModuleHandleW", CharSet = CharSet.Unicode, SetLastError = true)] + internal static partial IntPtr GetModuleHandle(string? moduleName); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNativeSystemInfo.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNativeSystemInfo.cs index 2322bdd4d7b148..076079e0bb393e 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNativeSystemInfo.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetNativeSystemInfo.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32)] - internal static unsafe extern void GetNativeSystemInfo(SYSTEM_INFO* lpSystemInfo); + [GeneratedDllImport(Libraries.Kernel32)] + internal static unsafe partial void GetNativeSystemInfo(SYSTEM_INFO* lpSystemInfo); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetOverlappedResult.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetOverlappedResult.cs index 6d52bfff0adf55..1375d0edfc57d7 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetOverlappedResult.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetOverlappedResult.cs @@ -9,8 +9,8 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)] - internal static extern unsafe bool GetOverlappedResult( + [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Auto, SetLastError = true)] + internal static unsafe partial bool GetOverlappedResult( SafeFileHandle hFile, NativeOverlapped* lpOverlapped, ref int lpNumberOfBytesTransferred, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcAddress.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcAddress.cs index 214050545ed15b..cce63bf6bee479 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcAddress.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcAddress.cs @@ -10,10 +10,10 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, CharSet = CharSet.Ansi, BestFitMapping = false)] - public static extern IntPtr GetProcAddress(SafeLibraryHandle hModule, string lpProcName); + [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Ansi)] + public static partial IntPtr GetProcAddress(SafeLibraryHandle hModule, string lpProcName); - [DllImport(Libraries.Kernel32, CharSet = CharSet.Ansi, BestFitMapping = false)] - public static extern IntPtr GetProcAddress(IntPtr hModule, string lpProcName); + [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Ansi)] + public static partial IntPtr GetProcAddress(IntPtr hModule, string lpProcName); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessMemoryInfo.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessMemoryInfo.cs index cc15f5d1381875..8bc8826f5e06ca 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessMemoryInfo.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessMemoryInfo.cs @@ -23,7 +23,7 @@ internal struct PROCESS_MEMORY_COUNTERS public UIntPtr PeakPagefileUsage; } - [DllImport(Libraries.Kernel32, EntryPoint="K32GetProcessMemoryInfo")] - internal static extern bool GetProcessMemoryInfo(IntPtr Process, ref PROCESS_MEMORY_COUNTERS ppsmemCounters, uint cb); + [GeneratedDllImport(Libraries.Kernel32, EntryPoint ="K32GetProcessMemoryInfo")] + internal static partial bool GetProcessMemoryInfo(IntPtr Process, ref PROCESS_MEMORY_COUNTERS ppsmemCounters, uint cb); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessTimes.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessTimes.cs index e76f80712ba4ab..dc019f330d8712 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessTimes.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessTimes.cs @@ -8,13 +8,8 @@ internal static partial class Interop { internal static partial class Kernel32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)] internal static partial bool GetProcessTimes( -#else - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool GetProcessTimes( -#endif SafeProcessHandle handle, out long creation, out long exit, out long kernel, out long user); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessTimes_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessTimes_IntPtr.cs index 89489a513a7e0f..8422232385975e 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessTimes_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetProcessTimes_IntPtr.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool GetProcessTimes(IntPtr handleProcess, out long creation, out long exit, out long kernel, out long user); + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool GetProcessTimes(IntPtr handleProcess, out long creation, out long exit, out long kernel, out long user); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.cs index b317b13e5499a4..501c25f54e4d7a 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.cs @@ -8,10 +8,10 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32)] + [GeneratedDllImport(Libraries.Kernel32)] #if !NO_SUPPRESS_GC_TRANSITION [SuppressGCTransition] #endif - internal static extern IntPtr GetStdHandle(int nStdHandle); // param is NOT a handle, but it returns one! + internal static partial IntPtr GetStdHandle(int nStdHandle); // param is NOT a handle, but it returns one! } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemDirectoryW.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemDirectoryW.cs index bf835ab71f8347..625d689c0e6672 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemDirectoryW.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemDirectoryW.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] - internal static extern uint GetSystemDirectoryW(ref char lpBuffer, uint uSize); + [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial uint GetSystemDirectoryW(ref char lpBuffer, uint uSize); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemInfo.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemInfo.cs index f3872f106180ef..383a26f280d43e 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemInfo.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemInfo.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32)] - internal static unsafe extern void GetSystemInfo(SYSTEM_INFO* lpSystemInfo); + [GeneratedDllImport(Libraries.Kernel32)] + internal static unsafe partial void GetSystemInfo(SYSTEM_INFO* lpSystemInfo); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTime.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTime.cs index 8f49121906c027..e97c5658df543a 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTime.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTime.cs @@ -7,8 +7,8 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32)] + [GeneratedDllImport(Libraries.Kernel32)] [SuppressGCTransition] - internal static extern unsafe void GetSystemTime(Interop.Kernel32.SYSTEMTIME* lpSystemTime); + internal static unsafe partial void GetSystemTime(Interop.Kernel32.SYSTEMTIME* lpSystemTime); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTimes.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTimes.cs index 7c1cc6232ed328..29000a94b859b5 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTimes.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetSystemTimes.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool GetSystemTimes(out long idle, out long kernel, out long user); + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool GetSystemTimes(out long idle, out long kernel, out long user); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTempFileNameW.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTempFileNameW.cs index 79807ff32b5111..4d08aac13bd38a 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTempFileNameW.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTempFileNameW.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true, BestFitMapping = false, ExactSpelling = true)] - internal static extern uint GetTempFileNameW(ref char lpPathName, string lpPrefixString, uint uUnique, ref char lpTempFileName); + [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial uint GetTempFileNameW(ref char lpPathName, string lpPrefixString, uint uUnique, ref char lpTempFileName); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTempPathW.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTempPathW.cs index 5d555df58cd23a..f27a00a633b3aa 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTempPathW.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetTempPathW.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, BestFitMapping = false, ExactSpelling = true)] - internal static extern uint GetTempPathW(int bufferLen, ref char buffer); + [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, ExactSpelling = true)] + internal static partial uint GetTempPathW(int bufferLen, ref char buffer); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetUserDefaultLCID.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetUserDefaultLCID.cs new file mode 100644 index 00000000000000..cf41573e2e7922 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetUserDefaultLCID.cs @@ -0,0 +1,13 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Kernel32 + { + [GeneratedDllImport(Interop.Libraries.Kernel32, CharSet = CharSet.Unicode, PreserveSig = true)] + internal static partial int GetUserDefaultLCID(); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetVolumeInformation.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetVolumeInformation.cs index 05a2b6357cc405..da80e83fee0da9 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetVolumeInformation.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetVolumeInformation.cs @@ -8,13 +8,8 @@ internal static partial class Interop { internal static partial class Kernel32 { -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetVolumeInformationW", CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "GetVolumeInformationW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] internal static unsafe partial bool GetVolumeInformation( -#else - [DllImport(Libraries.Kernel32, EntryPoint = "GetVolumeInformationW", CharSet = CharSet.Unicode, SetLastError = true)] - internal static unsafe extern bool GetVolumeInformation( -#endif string drive, char* volumeName, int volumeNameBufLen, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalLock.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalLock.cs index 8971a6326bf841..196db6ce44e205 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalLock.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalLock.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)] - public static extern IntPtr GlobalLock(IntPtr hMem); + [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)] + public static partial IntPtr GlobalLock(IntPtr hMem); public static IntPtr GlobalLock(HandleRef hMem) { @@ -18,8 +18,8 @@ public static IntPtr GlobalLock(HandleRef hMem) return result; } - [DllImport(Libraries.Kernel32, ExactSpelling = true)] - public static extern IntPtr GlobalUnlock(IntPtr hMem); + [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)] + public static partial IntPtr GlobalUnlock(IntPtr hMem); public static IntPtr GlobalUnlock(HandleRef hMem) { diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalMemoryStatusEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalMemoryStatusEx.cs index 662cab8383cc76..9704e1c7379004 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalMemoryStatusEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GlobalMemoryStatusEx.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32)] - internal static unsafe extern BOOL GlobalMemoryStatusEx(MEMORYSTATUSEX* lpBuffer); + [GeneratedDllImport(Libraries.Kernel32)] + internal static unsafe partial BOOL GlobalMemoryStatusEx(MEMORYSTATUSEX* lpBuffer); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Globalization.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Globalization.cs index cda3b0b2009dce..fd08870009a586 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Globalization.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Globalization.cs @@ -47,14 +47,14 @@ internal static partial class Kernel32 internal const string LOCALE_NAME_USER_DEFAULT = null; internal const string LOCALE_NAME_SYSTEM_DEFAULT = "!x-sys-default-locale"; - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern unsafe int LCIDToLocaleName(int locale, char* pLocaleName, int cchName, uint dwFlags); + [GeneratedDllImport("kernel32.dll", CharSet = CharSet.Unicode)] + internal static unsafe partial int LCIDToLocaleName(int locale, char* pLocaleName, int cchName, uint dwFlags); - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern int LocaleNameToLCID(string lpName, uint dwFlags); + [GeneratedDllImport("kernel32.dll", CharSet = CharSet.Unicode)] + internal static partial int LocaleNameToLCID(string lpName, uint dwFlags); - [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern unsafe int LCMapStringEx( + [GeneratedDllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial int LCMapStringEx( string? lpLocaleName, uint dwMapFlags, char* lpSrcStr, @@ -65,8 +65,8 @@ internal static extern unsafe int LCMapStringEx( void* lpReserved, IntPtr sortHandle); - [DllImport("kernel32.dll", EntryPoint = "FindNLSStringEx", SetLastError = SetLastErrorForDebug)] - internal static extern unsafe int FindNLSStringEx( + [GeneratedDllImport("kernel32.dll", EntryPoint = "FindNLSStringEx", SetLastError = SetLastErrorForDebug)] + internal static unsafe partial int FindNLSStringEx( char* lpLocaleName, uint dwFindNLSStringFlags, char* lpStringSource, @@ -78,8 +78,8 @@ internal static extern unsafe int FindNLSStringEx( void* lpReserved, IntPtr sortHandle); - [DllImport("kernel32.dll", EntryPoint = "CompareStringEx")] - internal static extern unsafe int CompareStringEx( + [GeneratedDllImport("kernel32.dll", EntryPoint = "CompareStringEx")] + internal static unsafe partial int CompareStringEx( char* lpLocaleName, uint dwCmpFlags, char* lpString1, @@ -90,16 +90,16 @@ internal static extern unsafe int CompareStringEx( void* lpReserved, IntPtr lParam); - [DllImport("kernel32.dll", EntryPoint = "CompareStringOrdinal")] - internal static extern unsafe int CompareStringOrdinal( + [GeneratedDllImport("kernel32.dll", EntryPoint = "CompareStringOrdinal")] + internal static unsafe partial int CompareStringOrdinal( char* lpString1, int cchCount1, char* lpString2, int cchCount2, bool bIgnoreCase); - [DllImport("kernel32.dll", EntryPoint = "FindStringOrdinal", SetLastError = SetLastErrorForDebug)] - internal static extern unsafe int FindStringOrdinal( + [GeneratedDllImport("kernel32.dll", EntryPoint = "FindStringOrdinal", SetLastError = SetLastErrorForDebug)] + internal static unsafe partial int FindStringOrdinal( uint dwFindStringOrdinalFlags, char* lpStringSource, int cchSource, @@ -107,40 +107,40 @@ internal static extern unsafe int FindStringOrdinal( int cchValue, BOOL bIgnoreCase); - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern unsafe bool IsNLSDefinedString( + [GeneratedDllImport("kernel32.dll", CharSet = CharSet.Unicode)] + internal static unsafe partial bool IsNLSDefinedString( int Function, uint dwFlags, IntPtr lpVersionInformation, char* lpString, int cchStr); - [DllImport("kernel32.dll", CharSet = CharSet.Auto)] - internal static extern unsafe Interop.BOOL GetUserPreferredUILanguages(uint dwFlags, uint* pulNumLanguages, char* pwszLanguagesBuffer, uint* pcchLanguagesBuffer); + [GeneratedDllImport("kernel32.dll", CharSet = CharSet.Auto)] + internal static unsafe partial Interop.BOOL GetUserPreferredUILanguages(uint dwFlags, uint* pulNumLanguages, char* pwszLanguagesBuffer, uint* pcchLanguagesBuffer); - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern unsafe int GetLocaleInfoEx(string lpLocaleName, uint LCType, void* lpLCData, int cchData); + [GeneratedDllImport("kernel32.dll", CharSet = CharSet.Unicode)] + internal static unsafe partial int GetLocaleInfoEx(string lpLocaleName, uint LCType, void* lpLCData, int cchData); - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern unsafe bool EnumSystemLocalesEx(delegate* unmanaged lpLocaleEnumProcEx, uint dwFlags, void* lParam, IntPtr reserved); + [GeneratedDllImport("kernel32.dll", CharSet = CharSet.Unicode)] + internal static unsafe partial bool EnumSystemLocalesEx(delegate* unmanaged lpLocaleEnumProcEx, uint dwFlags, void* lParam, IntPtr reserved); - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern unsafe bool EnumTimeFormatsEx(delegate* unmanaged lpTimeFmtEnumProcEx, string lpLocaleName, uint dwFlags, void* lParam); + [GeneratedDllImport("kernel32.dll", CharSet = CharSet.Unicode)] + internal static unsafe partial bool EnumTimeFormatsEx(delegate* unmanaged lpTimeFmtEnumProcEx, string lpLocaleName, uint dwFlags, void* lParam); - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern int GetCalendarInfoEx(string? lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, out int lpValue); + [GeneratedDllImport("kernel32.dll", CharSet = CharSet.Unicode)] + internal static partial int GetCalendarInfoEx(string? lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, out int lpValue); - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern int GetCalendarInfoEx(string? lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, IntPtr lpValue); + [GeneratedDllImport("kernel32.dll", CharSet = CharSet.Unicode)] + internal static partial int GetCalendarInfoEx(string? lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, IntPtr lpValue); - [DllImport("kernel32.dll")] - internal static extern int GetUserGeoID(int geoClass); + [GeneratedDllImport("kernel32.dll")] + internal static partial int GetUserGeoID(int geoClass); - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern unsafe int GetGeoInfo(int location, int geoType, char* lpGeoData, int cchData, int LangId); + [GeneratedDllImport("kernel32.dll", CharSet = CharSet.Unicode)] + internal static unsafe partial int GetGeoInfo(int location, int geoType, char* lpGeoData, int cchData, int LangId); - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern unsafe bool EnumCalendarInfoExEx(delegate* unmanaged pCalInfoEnumProcExEx, string lpLocaleName, uint Calendar, string? lpReserved, uint CalType, void* lParam); + [GeneratedDllImport("kernel32.dll", CharSet = CharSet.Unicode)] + internal static unsafe partial bool EnumCalendarInfoExEx(delegate* unmanaged pCalInfoEnumProcExEx, string lpLocaleName, uint Calendar, string? lpReserved, uint CalType, void* lParam); [StructLayout(LayoutKind.Sequential)] internal struct NlsVersionInfoEx @@ -152,7 +152,7 @@ internal struct NlsVersionInfoEx internal Guid guidCustomVersion; } - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern unsafe bool GetNLSVersionEx(int function, string localeName, NlsVersionInfoEx* lpVersionInformation); + [GeneratedDllImport("kernel32.dll", CharSet = CharSet.Unicode)] + internal static unsafe partial bool GetNLSVersionEx(int function, string localeName, NlsVersionInfoEx* lpVersionInformation); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Heap.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Heap.cs index a5198b12a36886..3a55d7109be30b 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Heap.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Heap.cs @@ -9,8 +9,8 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode)] - internal static extern IntPtr GetProcessHeap(); + [GeneratedDllImport(Libraries.Kernel32)] + internal static partial IntPtr GetProcessHeap(); [Flags] internal enum HeapAllocFlags : int @@ -21,15 +21,10 @@ internal enum HeapAllocFlags : int HEAP_GENERATE_EXCEPTIONS = 0x00000004, } - internal static SafeHeapAllocHandle HeapAlloc(IntPtr hHeap, HeapAllocFlags dwFlags, int dwBytes) - { - return HeapAlloc(hHeap, dwFlags, new IntPtr(dwBytes)); - } - - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode)] - private static extern SafeHeapAllocHandle HeapAlloc(IntPtr hHeap, HeapAllocFlags dwFlags, IntPtr dwBytes); + [GeneratedDllImport(Libraries.Kernel32)] + internal static partial SafeHeapAllocHandle HeapAlloc(IntPtr hHeap, HeapAllocFlags dwFlags, nint dwBytes); - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode)] - internal static extern bool HeapFree(IntPtr hHeap, HeapAllocFlags dwFlags, IntPtr lpMem); + [GeneratedDllImport(Libraries.Kernel32)] + internal static partial bool HeapFree(IntPtr hHeap, HeapAllocFlags dwFlags, IntPtr lpMem); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibrary.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibrary.cs index a65062ad682b14..93f0bedf5432c0 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibrary.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibrary.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)] - public static extern IntPtr LoadLibrary(string libFilename); + [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)] + public static partial IntPtr LoadLibrary(string libFilename); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibraryEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibraryEx.cs index 95ed8cb18a1cb7..95ef7bb51c9fd5 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibraryEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LoadLibraryEx.cs @@ -13,7 +13,7 @@ internal static partial class Kernel32 public const int LOAD_LIBRARY_AS_DATAFILE = 0x00000002; public const int LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800; - [DllImport(Libraries.Kernel32, ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)] - public static extern SafeLibraryHandle LoadLibraryExW([In] string lpwLibFileName, [In] IntPtr hFile, [In] uint dwFlags); + [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + public static partial SafeLibraryHandle LoadLibraryExW(string lpwLibFileName, IntPtr hFile, uint dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LocalAlloc.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LocalAlloc.cs index 9ef79146141be0..0bcd7e356a9ba9 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LocalAlloc.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LocalAlloc.cs @@ -10,14 +10,15 @@ internal static partial class Kernel32 { internal const uint LMEM_FIXED = 0x0000; internal const uint LMEM_MOVEABLE = 0x0002; + internal const uint LMEM_ZEROINIT = 0x0040; - [DllImport(Libraries.Kernel32)] - internal static extern IntPtr LocalAlloc(uint uFlags, nuint uBytes); + [GeneratedDllImport(Libraries.Kernel32)] + internal static partial IntPtr LocalAlloc(uint uFlags, nuint uBytes); - [DllImport(Libraries.Kernel32)] - internal static extern IntPtr LocalReAlloc(IntPtr hMem, nuint uBytes, uint uFlags); + [GeneratedDllImport(Libraries.Kernel32)] + internal static partial IntPtr LocalReAlloc(IntPtr hMem, nuint uBytes, uint uFlags); - [DllImport(Libraries.Kernel32)] - internal static extern IntPtr LocalFree(IntPtr hMem); + [GeneratedDllImport(Libraries.Kernel32)] + internal static partial IntPtr LocalFree(IntPtr hMem); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LockFile.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LockFile.cs index b00cb73b4128fc..574960ac35be25 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LockFile.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.LockFile.cs @@ -8,10 +8,10 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool LockFile(SafeFileHandle handle, int offsetLow, int offsetHigh, int countLow, int countHigh); + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool LockFile(SafeFileHandle handle, int offsetLow, int offsetHigh, int countLow, int countHigh); - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool UnlockFile(SafeFileHandle handle, int offsetLow, int offsetHigh, int countLow, int countHigh); + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool UnlockFile(SafeFileHandle handle, int offsetLow, int offsetHigh, int countLow, int countHigh); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MapViewOfFile.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MapViewOfFile.cs index 764a6ad8080a9d..ed29c33acca486 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MapViewOfFile.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MapViewOfFile.cs @@ -9,13 +9,8 @@ internal static partial class Interop { internal static partial class Kernel32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "MapViewOfFile", CharSet = CharSet.Unicode, SetLastError = true)] internal static partial SafeMemoryMappedViewHandle MapViewOfFile( -#else - [DllImport(Libraries.Kernel32, EntryPoint = "MapViewOfFile", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern SafeMemoryMappedViewHandle MapViewOfFile( -#endif SafeMemoryMappedFileHandle hFileMappingObject, int dwDesiredAccess, int dwFileOffsetHigh, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MoveFileEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MoveFileEx.cs index b76e051ab114f7..bdd3aa9258ce05 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MoveFileEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MoveFileEx.cs @@ -15,13 +15,8 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use MoveFile. /// -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "MoveFileExW", CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "MoveFileExW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] private static partial bool MoveFileExPrivate( -#else - [DllImport(Libraries.Kernel32, EntryPoint = "MoveFileExW", CharSet = CharSet.Unicode, SetLastError = true)] - private static extern bool MoveFileExPrivate( -#endif string src, string dst, uint flags); /// diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MultiByteToWideChar.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MultiByteToWideChar.cs index 2cd6f2b58d9102..dfb7a73c521318 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MultiByteToWideChar.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.MultiByteToWideChar.cs @@ -7,8 +7,8 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32)] - internal static extern unsafe int MultiByteToWideChar( + [GeneratedDllImport(Libraries.Kernel32)] + internal static unsafe partial int MultiByteToWideChar( uint CodePage, uint dwFlags, byte* lpMultiByteStr, int cbMultiByte, char* lpWideCharStr, int cchWideChar); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Mutex.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Mutex.cs index 3988d7bfe1b01d..4c09f291114d66 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Mutex.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Mutex.cs @@ -11,13 +11,13 @@ internal static partial class Kernel32 { internal const uint CREATE_MUTEX_INITIAL_OWNER = 0x1; - [DllImport(Libraries.Kernel32, EntryPoint = "OpenMutexW", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern SafeWaitHandle OpenMutex(uint desiredAccess, bool inheritHandle, string name); + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenMutexW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial SafeWaitHandle OpenMutex(uint desiredAccess, bool inheritHandle, string name); - [DllImport(Libraries.Kernel32, EntryPoint = "CreateMutexExW", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern SafeWaitHandle CreateMutexEx(IntPtr lpMutexAttributes, string? name, uint flags, uint desiredAccess); + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateMutexExW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial SafeWaitHandle CreateMutexEx(IntPtr lpMutexAttributes, string? name, uint flags, uint desiredAccess); - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool ReleaseMutex(SafeWaitHandle handle); + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool ReleaseMutex(SafeWaitHandle handle); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenFileMapping.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenFileMapping.cs index 6ac60a8fa558fd..08ce6fc8917d5a 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenFileMapping.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenFileMapping.cs @@ -8,13 +8,8 @@ internal static partial class Interop { internal static partial class Kernel32 { -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenFileMappingW", CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenFileMappingW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] internal static partial SafeMemoryMappedFileHandle OpenFileMapping( -#else - [DllImport(Libraries.Kernel32, EntryPoint = "OpenFileMappingW", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern SafeMemoryMappedFileHandle OpenFileMapping( -#endif int dwDesiredAccess, [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle, string lpName); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenProcess.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenProcess.cs index 2eaa7a9e5f5971..2cd405129dbf93 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenProcess.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OpenProcess.cs @@ -8,13 +8,8 @@ internal static partial class Interop { internal static partial class Kernel32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)] internal static partial SafeProcessHandle OpenProcess( -#else - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern SafeProcessHandle OpenProcess( -#endif int access, bool inherit, int processId); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OutputDebugString.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OutputDebugString.cs index 4d1f88983dd396..e7ee12eb0f9d75 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OutputDebugString.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.OutputDebugString.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Interop.Libraries.Kernel32, CharSet = CharSet.Unicode, EntryPoint = "OutputDebugStringW", ExactSpelling = true)] - internal static extern void OutputDebugString(string message); + [GeneratedDllImport(Interop.Libraries.Kernel32, EntryPoint = "OutputDebugStringW", CharSet = CharSet.Unicode, ExactSpelling = true)] + internal static partial void OutputDebugString(string message); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PurgeComm.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PurgeComm.cs index 9a71eececb637b..be4311eb4f9a12 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PurgeComm.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.PurgeComm.cs @@ -16,8 +16,8 @@ internal static class PurgeFlags internal const uint PURGE_RXCLEAR = 0x0008; // Kill the typeahead buffer if there. } - [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)] - internal static extern bool PurgeComm( + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool PurgeComm( SafeFileHandle hFile, uint dwFlags); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceCounter.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceCounter.cs index 9f396d046af8b2..241ab3f99ac8ff 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceCounter.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceCounter.cs @@ -15,8 +15,8 @@ internal static partial class Kernel32 // We take a long* (rather than a out long) to avoid the pinning overhead. // We don't set last error since we don't need the extended error info. - [DllImport(Libraries.Kernel32, ExactSpelling = true)] + [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)] [SuppressGCTransition] - internal static extern unsafe BOOL QueryPerformanceCounter(long* lpPerformanceCount); + internal static unsafe partial BOOL QueryPerformanceCounter(long* lpPerformanceCount); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceFrequency.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceFrequency.cs index cf5f9753bd6418..f6c7e9e656f58d 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceFrequency.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryPerformanceFrequency.cs @@ -15,7 +15,7 @@ internal static partial class Kernel32 // We take a long* (rather than a out long) to avoid the pinning overhead. // We don't set last error since we don't need the extended error info. - [DllImport(Libraries.Kernel32, ExactSpelling = true)] - internal static extern unsafe BOOL QueryPerformanceFrequency(long* lpFrequency); + [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)] + internal static unsafe partial BOOL QueryPerformanceFrequency(long* lpFrequency); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryUnbiasedInterruptTime.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryUnbiasedInterruptTime.cs index a93dcecd1e1e6c..efb57eaa7c2a1c 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryUnbiasedInterruptTime.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.QueryUnbiasedInterruptTime.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32)] - internal static extern bool QueryUnbiasedInterruptTime(out ulong UnbiasedTime); + [GeneratedDllImport(Libraries.Kernel32)] + internal static partial bool QueryUnbiasedInterruptTime(out ulong UnbiasedTime); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_IntPtr.cs index 9651a10fb64bd9..00b66c4ccde30a 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_IntPtr.cs @@ -8,13 +8,8 @@ internal static partial class Interop { internal static partial class Kernel32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] internal static unsafe partial int ReadFile( -#else - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe int ReadFile( -#endif SafeHandle handle, byte* bytes, int numBytesToRead, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_NativeOverlapped.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_NativeOverlapped.cs index ba9b6a91c0eb69..ceebb111aab370 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_NativeOverlapped.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReadFile_SafeHandle_NativeOverlapped.cs @@ -9,26 +9,16 @@ internal static partial class Interop { internal static partial class Kernel32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] internal static unsafe partial int ReadFile( -#else - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe int ReadFile( -#endif SafeHandle handle, byte* bytes, int numBytesToRead, IntPtr numBytesRead_mustBeZero, NativeOverlapped* overlapped); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] internal static unsafe partial int ReadFile( -#else - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe int ReadFile( -#endif SafeHandle handle, byte* bytes, int numBytesToRead, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.RemoveDirectory.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.RemoveDirectory.cs index 96754abc2f5a86..ea5abeebaa4d52 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.RemoveDirectory.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.RemoveDirectory.cs @@ -12,13 +12,8 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use RemoveDirectory. /// -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "RemoveDirectoryW", CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "RemoveDirectoryW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] private static partial bool RemoveDirectoryPrivate(string path); -#else - [DllImport(Libraries.Kernel32, EntryPoint = "RemoveDirectoryW", CharSet = CharSet.Unicode, SetLastError = true)] - private static extern bool RemoveDirectoryPrivate(string path); -#endif internal static bool RemoveDirectory(string path) { diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReplaceFile.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReplaceFile.cs index cb1353628b3afc..4c52342c056513 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReplaceFile.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ReplaceFile.cs @@ -9,13 +9,8 @@ internal static partial class Interop { internal static partial class Kernel32 { -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ReplaceFileW", CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "ReplaceFileW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] private static partial bool ReplaceFilePrivate( -#else - [DllImport(Libraries.Kernel32, EntryPoint = "ReplaceFileW", CharSet = CharSet.Unicode, SetLastError = true)] - private static extern bool ReplaceFilePrivate( -#endif string replacedFileName, string replacementFileName, string? backupFileName, int dwReplaceFlags, IntPtr lpExclude, IntPtr lpReserved); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ResolveLocaleName.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ResolveLocaleName.cs index 5e0d8dfcd45aaa..cf01ba66e8b3bb 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ResolveLocaleName.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.ResolveLocaleName.cs @@ -9,7 +9,7 @@ internal static unsafe partial class Kernel32 { internal const int LOCALE_NAME_MAX_LENGTH = 85; - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal static extern int ResolveLocaleName(string lpNameToResolve, char* lpLocaleName, int cchLocaleName); + [GeneratedDllImport("kernel32.dll", CharSet = CharSet.Unicode)] + internal static partial int ResolveLocaleName(string lpNameToResolve, char* lpLocaleName, int cchLocaleName); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Semaphore.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Semaphore.cs index 435c47ead32150..44034fbb5a2fa2 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Semaphore.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.Semaphore.cs @@ -9,13 +9,13 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, EntryPoint = "OpenSemaphoreW", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern SafeWaitHandle OpenSemaphore(uint desiredAccess, bool inheritHandle, string name); + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "OpenSemaphoreW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial SafeWaitHandle OpenSemaphore(uint desiredAccess, bool inheritHandle, string name); - [DllImport(Libraries.Kernel32, EntryPoint = "CreateSemaphoreExW", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern SafeWaitHandle CreateSemaphoreEx(IntPtr lpSecurityAttributes, int initialCount, int maximumCount, string? name, uint flags, uint desiredAccess); + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "CreateSemaphoreExW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial SafeWaitHandle CreateSemaphoreEx(IntPtr lpSecurityAttributes, int initialCount, int maximumCount, string? name, uint flags, uint desiredAccess); - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool ReleaseSemaphore(SafeWaitHandle handle, int releaseCount, out int previousCount); + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool ReleaseSemaphore(SafeWaitHandle handle, int releaseCount, out int previousCount); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommBreak.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommBreak.cs index 609b8ac46074f0..0d33f40e01d0bc 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommBreak.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommBreak.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)] - internal static extern bool SetCommBreak( + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool SetCommBreak( SafeFileHandle hFile); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommMask.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommMask.cs index dcf7475ed73df0..0fc9bb0d869419 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommMask.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommMask.cs @@ -15,8 +15,8 @@ internal static class CommEvents internal const int ALL_EVENTS = 0x1fb; } - [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)] - internal static extern bool SetCommMask( + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool SetCommMask( SafeFileHandle hFile, int dwEvtMask ); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommState.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommState.cs index 135627e0ecac55..ae985844e888ee 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommState.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommState.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)] - internal static extern bool SetCommState( + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool SetCommState( SafeFileHandle hFile, ref DCB lpDCB); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommTimeouts.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommTimeouts.cs index 2ca02d02d4e429..affa70385442e7 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommTimeouts.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCommTimeouts.cs @@ -10,8 +10,8 @@ internal static partial class Kernel32 { internal const int MAXDWORD = -1; // This is 0xfffffff, or UInt32.MaxValue, here used as an int - [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)] - internal static extern bool SetCommTimeouts( + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool SetCommTimeouts( SafeFileHandle hFile, ref COMMTIMEOUTS lpCommTimeouts); } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCtrlHandler.Delegate.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCtrlHandler.Delegate.cs index 159c26438c2809..64f516a7f7d049 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCtrlHandler.Delegate.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCtrlHandler.Delegate.cs @@ -11,7 +11,7 @@ internal static partial class Kernel32 { internal delegate bool ConsoleCtrlHandlerRoutine(int controlType); - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool SetConsoleCtrlHandler(ConsoleCtrlHandlerRoutine handler, bool addOrRemove); + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool SetConsoleCtrlHandler(ConsoleCtrlHandlerRoutine handler, bool addOrRemove); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCtrlHandler.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCtrlHandler.cs index 8a64d27c196609..27c62e01c465e7 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCtrlHandler.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetConsoleCtrlHandler.cs @@ -13,12 +13,7 @@ internal static partial class Kernel32 internal const int CTRL_LOGOFF_EVENT = 5; internal const int CTRL_SHUTDOWN_EVENT = 6; -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] internal static unsafe partial bool SetConsoleCtrlHandler(delegate* unmanaged handler, bool Add); -#else - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe bool SetConsoleCtrlHandler(delegate* unmanaged HandlerRoutine, bool Add); -#endif } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCurrentDirectory.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCurrentDirectory.cs index 51cc5da3b7b85d..46af9a9ad2b0ae 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCurrentDirectory.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetCurrentDirectory.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, EntryPoint = "SetCurrentDirectoryW", SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = false, ExactSpelling = true)] - internal static extern bool SetCurrentDirectory(string path); + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetCurrentDirectoryW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial bool SetCurrentDirectory(string path); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetEnvironmentVariable.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetEnvironmentVariable.cs index 9c7d2ebd0724e2..63b09719009a47 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetEnvironmentVariable.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetEnvironmentVariable.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, EntryPoint = "SetEnvironmentVariableW", SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = false, ExactSpelling = true)] - internal static extern bool SetEnvironmentVariable(string lpName, string? lpValue); + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetEnvironmentVariableW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial bool SetEnvironmentVariable(string lpName, string? lpValue); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileAttributes.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileAttributes.cs index 4e436e0c49dc0c..c1053c3e508573 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileAttributes.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileAttributes.cs @@ -11,13 +11,8 @@ internal static partial class Kernel32 /// /// WARNING: This method does not implicitly handle long paths. Use SetFileAttributes. /// -#if DLLIMPORTGENERATOR_ENABLED - [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetFileAttributesW", CharSet = CharSet.Unicode, SetLastError = true)] + [GeneratedDllImport(Libraries.Kernel32, EntryPoint = "SetFileAttributesW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] private static partial bool SetFileAttributesPrivate( -#else - [DllImport(Libraries.Kernel32, EntryPoint = "SetFileAttributesW", CharSet = CharSet.Unicode, SetLastError = true)] - private static extern bool SetFileAttributesPrivate( -#endif string name, int attr); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileInformationByHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileInformationByHandle.cs index 28361c06f9134f..044af52788d2ac 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileInformationByHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFileInformationByHandle.cs @@ -9,13 +9,8 @@ internal static partial class Interop { internal static partial class Kernel32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)] internal static unsafe partial bool SetFileInformationByHandle( -#else - [DllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)] - internal static unsafe extern bool SetFileInformationByHandle( -#endif SafeFileHandle hFile, int FileInformationClass, void* lpFileInformation, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFilePointerEx.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFilePointerEx.cs index 7f8b4723599480..028a0ff56114f6 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFilePointerEx.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetFilePointerEx.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool SetFilePointerEx(SafeFileHandle hFile, long liDistanceToMove, out long lpNewFilePointer, uint dwMoveMethod); + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool SetFilePointerEx(SafeFileHandle hFile, long liDistanceToMove, out long lpNewFilePointer, uint dwMoveMethod); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetLastError.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetLastError.cs index 1a4394800ce99b..baf852e6be6a08 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetLastError.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetLastError.cs @@ -7,8 +7,8 @@ internal partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32)] + [GeneratedDllImport(Libraries.Kernel32)] [SuppressGCTransition] - internal static extern void SetLastError(int errorCode); + internal static partial void SetLastError(int errorCode); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadErrorMode.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadErrorMode.cs index 8028a1256e44aa..29cc3e9d43ee57 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadErrorMode.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetThreadErrorMode.cs @@ -8,13 +8,8 @@ internal static partial class Interop internal static partial class Kernel32 { [SuppressGCTransition] -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)] internal static partial bool SetThreadErrorMode( -#else - [DllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)] - internal static extern bool SetThreadErrorMode( -#endif uint dwNewMode, out uint lpOldMode); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetupComm.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetupComm.cs index b36db5959bc5b1..331292c4a6dcda 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetupComm.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetupComm.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)] - internal static extern bool SetupComm( + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static partial bool SetupComm( SafeFileHandle hFile, int dwInQueue, int dwOutQueue); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SystemTimeToFileTime.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SystemTimeToFileTime.cs index 41d4b068a73251..10fe4080a00d98 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SystemTimeToFileTime.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SystemTimeToFileTime.cs @@ -7,8 +7,8 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32)] + [GeneratedDllImport(Libraries.Kernel32)] [SuppressGCTransition] - internal static extern unsafe Interop.BOOL SystemTimeToFileTime(Interop.Kernel32.SYSTEMTIME* lpSystemTime, ulong* lpFileTime); + internal static unsafe partial Interop.BOOL SystemTimeToFileTime(Interop.Kernel32.SYSTEMTIME* lpSystemTime, ulong* lpFileTime); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TimeZone.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TimeZone.cs index 3ed47085af6c00..7ad0dde0891906 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TimeZone.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TimeZone.cs @@ -83,10 +83,10 @@ internal string GetDaylightName() internal const uint TIME_ZONE_ID_INVALID = unchecked((uint)-1); - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] - internal static extern uint GetDynamicTimeZoneInformation(out TIME_DYNAMIC_ZONE_INFORMATION pTimeZoneInformation); + [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial uint GetDynamicTimeZoneInformation(out TIME_DYNAMIC_ZONE_INFORMATION pTimeZoneInformation); - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] - internal static extern uint GetTimeZoneInformation(out TIME_ZONE_INFORMATION lpTimeZoneInformation); + [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial uint GetTimeZoneInformation(out TIME_ZONE_INFORMATION lpTimeZoneInformation); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TzSpecificLocalTimeToSystemTime.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TzSpecificLocalTimeToSystemTime.cs index 2e5e264b0a7152..7fc3013ae687df 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TzSpecificLocalTimeToSystemTime.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.TzSpecificLocalTimeToSystemTime.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32)] - internal static extern unsafe Interop.BOOL TzSpecificLocalTimeToSystemTime( + [GeneratedDllImport(Libraries.Kernel32)] + internal static unsafe partial Interop.BOOL TzSpecificLocalTimeToSystemTime( IntPtr lpTimeZoneInformation, Interop.Kernel32.SYSTEMTIME* lpLocalTime, Interop.Kernel32.SYSTEMTIME* lpUniversalTime); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.UnmapViewOfFile.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.UnmapViewOfFile.cs index dd519a7f1f87f5..4f41d03faba169 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.UnmapViewOfFile.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.UnmapViewOfFile.cs @@ -8,12 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] internal static partial bool UnmapViewOfFile(IntPtr lpBaseAddress); -#else - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool UnmapViewOfFile(IntPtr lpBaseAddress); -#endif } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerLanguageName.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerLanguageName.cs index 6c665a47e4955c..af062f0a4f2d0c 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerLanguageName.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerLanguageName.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, EntryPoint = "VerLanguageNameW")] - internal static extern unsafe int VerLanguageName(uint wLang, char* szLang, uint cchLang); + [GeneratedDllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, EntryPoint = "VerLanguageNameW")] + internal static unsafe partial int VerLanguageName(uint wLang, char* szLang, uint cchLang); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerSetConditionMask.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerSetConditionMask.cs index e2aba5eea77d73..6ca6d7797a5fb6 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerSetConditionMask.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerSetConditionMask.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32)] - internal static extern ulong VerSetConditionMask(ulong ConditionMask, uint TypeMask, byte Condition); + [GeneratedDllImport(Libraries.Kernel32)] + internal static partial ulong VerSetConditionMask(ulong ConditionMask, uint TypeMask, byte Condition); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerifyVersionExW.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerifyVersionExW.cs index 3af8fa7eadbc13..7ca822779e6aed 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerifyVersionExW.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VerifyVersionExW.cs @@ -13,7 +13,7 @@ internal static partial class Kernel32 internal const uint VER_SERVICEPACKMAJOR = 0x0000020; internal const uint VER_SERVICEPACKMINOR = 0x0000010; - [DllImport(Libraries.Kernel32)] - internal static extern bool VerifyVersionInfoW(ref OSVERSIONINFOEX lpVersionInfo, uint dwTypeMask, ulong dwlConditionMask); + [GeneratedDllImport(Libraries.Kernel32)] + internal static partial bool VerifyVersionInfoW(ref OSVERSIONINFOEX lpVersionInfo, uint dwTypeMask, ulong dwlConditionMask); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualAlloc_Ptr.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualAlloc_Ptr.cs index 6f3797218f3e0b..d432f568e40483 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualAlloc_Ptr.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualAlloc_Ptr.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, ExactSpelling = true)] - internal static extern unsafe void* VirtualAlloc(void* lpAddress, UIntPtr dwSize, int flAllocationType, int flProtect); + [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)] + internal static unsafe partial void* VirtualAlloc(void* lpAddress, UIntPtr dwSize, int flAllocationType, int flProtect); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualFree.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualFree.cs index 3ff002e0cd7dfb..6e75b25bafe036 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualFree.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualFree.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, ExactSpelling = true)] - internal static extern unsafe bool VirtualFree(void* lpAddress, UIntPtr dwSize, int dwFreeType); + [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true)] + internal static unsafe partial bool VirtualFree(void* lpAddress, UIntPtr dwSize, int dwFreeType); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery.cs index 9ede606895a455..1dd2029a5f57fa 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery.cs @@ -8,13 +8,8 @@ internal static partial class Interop { internal static partial class Kernel32 { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)] internal static partial UIntPtr VirtualQuery( -#else - [DllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)] - internal static extern UIntPtr VirtualQuery( -#endif SafeHandle lpAddress, ref MEMORY_BASIC_INFORMATION lpBuffer, UIntPtr dwLength); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery_Ptr.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery_Ptr.cs index 59622e85319ac3..f3fdf7883b868a 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery_Ptr.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.VirtualQuery_Ptr.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, SetLastError = true, ExactSpelling = true)] - internal static extern unsafe UIntPtr VirtualQuery(void* lpAddress, ref MEMORY_BASIC_INFORMATION lpBuffer, UIntPtr dwLength); + [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)] + internal static unsafe partial UIntPtr VirtualQuery(void* lpAddress, ref MEMORY_BASIC_INFORMATION lpBuffer, UIntPtr dwLength); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitCommEvent.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitCommEvent.cs index e9328f34beb972..ec4418d5e5000b 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitCommEvent.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitCommEvent.cs @@ -9,8 +9,8 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto)] - internal static extern unsafe bool WaitCommEvent( + [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] + internal static unsafe partial bool WaitCommEvent( SafeFileHandle hFile, int* lpEvtMask, NativeOverlapped* lpOverlapped); diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitForSingleObject.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitForSingleObject.cs index 2a81da9a5a1c86..5f3f964a60a425 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitForSingleObject.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WaitForSingleObject.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)] - internal static extern int WaitForSingleObject(SafeWaitHandle handle, int timeout); + [GeneratedDllImport(Libraries.Kernel32, ExactSpelling = true, SetLastError = true)] + internal static partial int WaitForSingleObject(SafeWaitHandle handle, int timeout); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WideCharToMultiByte.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WideCharToMultiByte.cs index ce255b45a1fcc1..ad2d77e538c921 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WideCharToMultiByte.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WideCharToMultiByte.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class Kernel32 { - [DllImport(Libraries.Kernel32)] - internal static extern unsafe int WideCharToMultiByte( + [GeneratedDllImport(Libraries.Kernel32)] + internal static unsafe partial int WideCharToMultiByte( uint CodePage, uint dwFlags, char* lpWideCharStr, int cchWideChar, byte* lpMultiByteStr, int cbMultiByte, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_IntPtr.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_IntPtr.cs index 6354c1a5926b41..0e7cc88f1b49bb 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_IntPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_IntPtr.cs @@ -15,13 +15,8 @@ internal static partial class Kernel32 // struct in a callback (or an EndWrite method called by that callback), // and pass in an address for the numBytesRead parameter. -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] internal static unsafe partial int WriteFile( -#else - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe int WriteFile( -#endif SafeHandle handle, byte* bytes, int numBytesToWrite, diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_NativeOverlapped.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_NativeOverlapped.cs index 0f66079a24a9ec..3ae10aaab16ed6 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_NativeOverlapped.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.WriteFile_SafeHandle_NativeOverlapped.cs @@ -15,26 +15,16 @@ internal static partial class Kernel32 // simultaneously: overlapped IO, free the memory for the overlapped // struct in a callback (or an EndWrite method called by that callback), // and pass in an address for the numBytesRead parameter. -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] internal static unsafe partial int WriteFile( -#else - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe int WriteFile( -#endif SafeHandle handle, byte* bytes, int numBytesToWrite, IntPtr numBytesWritten_mustBeZero, NativeOverlapped* lpOverlapped); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.Kernel32, SetLastError = true)] internal static unsafe partial int WriteFile( -#else - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe int WriteFile( -#endif SafeHandle handle, byte* bytes, int numBytesToWrite, diff --git a/src/libraries/Common/src/Interop/Windows/Logoncli/Interop.DsGetDcName.cs b/src/libraries/Common/src/Interop/Windows/Logoncli/Interop.DsGetDcName.cs new file mode 100644 index 00000000000000..37f86adecd38b3 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Logoncli/Interop.DsGetDcName.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. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Logoncli + { + [GeneratedDllImport(Libraries.Logoncli, EntryPoint = "DsGetDcNameW", CharSet = CharSet.Unicode, ExactSpelling = true)] + internal static partial int DsGetDcName( + string computerName, + string domainName, + IntPtr domainGuid, + string siteName, + int flags, + out IntPtr domainControllerInfo); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptFreeObject.cs b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptFreeObject.cs index 3e5b6ef367433f..d97f1b1a941350 100644 --- a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptFreeObject.cs +++ b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.NCryptFreeObject.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class NCrypt { - [DllImport(Interop.Libraries.NCrypt, CharSet = CharSet.Unicode)] - internal static extern ErrorCode NCryptFreeObject(IntPtr hObject); + [GeneratedDllImport(Interop.Libraries.NCrypt)] + internal static partial ErrorCode NCryptFreeObject(IntPtr hObject); } } diff --git a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.cs b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.cs index 4304ccf9bbf4ce..d160b1a7d42c9b 100644 --- a/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.cs +++ b/src/libraries/Common/src/Interop/Windows/NCrypt/Interop.Properties.cs @@ -13,13 +13,8 @@ internal static partial class Interop { internal static partial class NCrypt { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.NCrypt, CharSet = CharSet.Unicode)] internal static unsafe partial ErrorCode NCryptGetProperty( -#else - [DllImport(Interop.Libraries.NCrypt, CharSet = CharSet.Unicode)] - internal static extern unsafe ErrorCode NCryptGetProperty( -#endif SafeNCryptHandle hObject, string pszProperty, void* pbOutput, @@ -27,13 +22,8 @@ internal static extern unsafe ErrorCode NCryptGetProperty( out int pcbResult, CngPropertyOptions dwFlags); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.NCrypt, CharSet = CharSet.Unicode)] internal static unsafe partial ErrorCode NCryptSetProperty( -#else - [DllImport(Interop.Libraries.NCrypt, CharSet = CharSet.Unicode)] - internal static extern unsafe ErrorCode NCryptSetProperty( -#endif SafeNCryptHandle hObject, string pszProperty, void* pbInput, diff --git a/src/libraries/Common/src/Interop/Windows/Netutils/Interop.NetApiBufferFree.cs b/src/libraries/Common/src/Interop/Windows/Netutils/Interop.NetApiBufferFree.cs new file mode 100644 index 00000000000000..1f84f9a949b072 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Netutils/Interop.NetApiBufferFree.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Netutils + { + [GeneratedDllImport(Libraries.Netutils)] + internal static partial int NetApiBufferFree(IntPtr buffer); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Idna.cs b/src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Idna.cs index 9bc7631ad81db6..d796f9e2f0c264 100644 --- a/src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Idna.cs +++ b/src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Idna.cs @@ -11,16 +11,16 @@ internal static partial class Normaliz // Idn APIs // - [DllImport("Normaliz.dll", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern unsafe int IdnToAscii( + [GeneratedDllImport("Normaliz.dll", CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial int IdnToAscii( uint dwFlags, char* lpUnicodeCharStr, int cchUnicodeChar, char* lpASCIICharStr, int cchASCIIChar); - [DllImport("Normaliz.dll", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern unsafe int IdnToUnicode( + [GeneratedDllImport("Normaliz.dll", CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial int IdnToUnicode( uint dwFlags, char* lpASCIICharStr, int cchASCIIChar, diff --git a/src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Normalization.cs b/src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Normalization.cs index dee9a178342801..09a5bd0d10922a 100644 --- a/src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Normalization.cs +++ b/src/libraries/Common/src/Interop/Windows/Normaliz/Interop.Normalization.cs @@ -8,11 +8,11 @@ internal static partial class Interop { internal static partial class Normaliz { - [DllImport("Normaliz.dll", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern unsafe BOOL IsNormalizedString(NormalizationForm normForm, char* source, int length); + [GeneratedDllImport("Normaliz.dll", CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial BOOL IsNormalizedString(NormalizationForm normForm, char* source, int length); - [DllImport("Normaliz.dll", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern unsafe int NormalizeString( + [GeneratedDllImport("Normaliz.dll", CharSet = CharSet.Unicode, SetLastError = true)] + internal static unsafe partial int NormalizeString( NormalizationForm normForm, char* source, int sourceLength, diff --git a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.cs b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.cs index 7d6ab13b6633d3..ad3f3c72335fbd 100644 --- a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.cs +++ b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtCreateFile.cs @@ -12,8 +12,8 @@ internal static partial class NtDll { // https://msdn.microsoft.com/en-us/library/bb432380.aspx // https://msdn.microsoft.com/en-us/library/windows/hardware/ff566424.aspx - [DllImport(Libraries.NtDll, CharSet = CharSet.Unicode, ExactSpelling = true)] - private static extern unsafe uint NtCreateFile( + [GeneratedDllImport(Libraries.NtDll, CharSet = CharSet.Unicode, ExactSpelling = true)] + private static unsafe partial uint NtCreateFile( IntPtr* FileHandle, DesiredAccess DesiredAccess, OBJECT_ATTRIBUTES* ObjectAttributes, diff --git a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryDirectoryFile.cs b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryDirectoryFile.cs index 25d5f5f925bc48..11fd068457fd76 100644 --- a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryDirectoryFile.cs +++ b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryDirectoryFile.cs @@ -10,8 +10,8 @@ internal static partial class NtDll { // https://msdn.microsoft.com/en-us/library/windows/hardware/ff556633.aspx // https://msdn.microsoft.com/en-us/library/windows/hardware/ff567047.aspx - [DllImport(Libraries.NtDll, CharSet = CharSet.Unicode, ExactSpelling = true)] - public static unsafe extern int NtQueryDirectoryFile( + [GeneratedDllImport(Libraries.NtDll, CharSet = CharSet.Unicode, ExactSpelling = true)] + public static unsafe partial int NtQueryDirectoryFile( IntPtr FileHandle, IntPtr Event, IntPtr ApcRoutine, diff --git a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationFile.cs b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationFile.cs index 402443b05e944e..bf8517a375730a 100644 --- a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationFile.cs +++ b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQueryInformationFile.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class NtDll { - [DllImport(Libraries.NtDll, ExactSpelling = true)] - internal static extern unsafe int NtQueryInformationFile( + [GeneratedDllImport(Libraries.NtDll, ExactSpelling = true)] + internal static unsafe partial int NtQueryInformationFile( SafeFileHandle FileHandle, out IO_STATUS_BLOCK IoStatusBlock, void* FileInformation, diff --git a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQuerySystemInformation.cs b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQuerySystemInformation.cs index 3c556031418b7d..6e6ef56975dbf7 100644 --- a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQuerySystemInformation.cs +++ b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.NtQuerySystemInformation.cs @@ -7,8 +7,8 @@ internal static partial class Interop { internal static partial class NtDll { - [DllImport(Libraries.NtDll, ExactSpelling = true)] - internal static extern unsafe uint NtQuerySystemInformation(int SystemInformationClass, void* SystemInformation, uint SystemInformationLength, uint* ReturnLength); + [GeneratedDllImport(Libraries.NtDll, ExactSpelling = true)] + internal static unsafe partial uint NtQuerySystemInformation(int SystemInformationClass, void* SystemInformation, uint SystemInformationLength, uint* ReturnLength); internal const uint STATUS_INFO_LENGTH_MISMATCH = 0xC0000004; } diff --git a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlGetVersion.cs b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlGetVersion.cs index ee82a86be12d18..399d0cc553d84a 100644 --- a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlGetVersion.cs +++ b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlGetVersion.cs @@ -7,8 +7,8 @@ internal static partial class Interop { internal static partial class NtDll { - [DllImport(Libraries.NtDll, ExactSpelling = true)] - private static extern int RtlGetVersion(ref RTL_OSVERSIONINFOEX lpVersionInformation); + [GeneratedDllImport(Libraries.NtDll, ExactSpelling = true)] + private static partial int RtlGetVersion(ref RTL_OSVERSIONINFOEX lpVersionInformation); internal static unsafe int RtlGetVersionEx(out RTL_OSVERSIONINFOEX osvi) { diff --git a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlNtStatusToDosError.cs b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlNtStatusToDosError.cs index d41e2eb7f3327d..909aa9d9689865 100644 --- a/src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlNtStatusToDosError.cs +++ b/src/libraries/Common/src/Interop/Windows/NtDll/Interop.RtlNtStatusToDosError.cs @@ -9,7 +9,7 @@ internal static partial class Interop internal static partial class NtDll { // https://msdn.microsoft.com/en-us/library/windows/desktop/ms680600(v=vs.85).aspx - [DllImport(Libraries.NtDll, ExactSpelling = true)] - public static extern uint RtlNtStatusToDosError(int Status); + [GeneratedDllImport(Libraries.NtDll, ExactSpelling = true)] + public static partial uint RtlNtStatusToDosError(int Status); } } diff --git a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CLSIDFromProgID.cs b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CLSIDFromProgID.cs index dfdd12b9eef662..fec2251f01e180 100644 --- a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CLSIDFromProgID.cs +++ b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CLSIDFromProgID.cs @@ -8,7 +8,10 @@ internal static partial class Interop { internal static partial class Ole32 { +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we annotate blittable types used in interop in CoreLib (like Guid) [DllImport(Interop.Libraries.Ole32, CharSet = CharSet.Unicode)] internal static extern int CLSIDFromProgID(string lpszProgID, out Guid lpclsid); +#pragma warning restore DLLIMPORTGENANALYZER015 } } diff --git a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoCreateGuid.cs b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoCreateGuid.cs index 7f3cd37b36bd77..f79f17e3ec6373 100644 --- a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoCreateGuid.cs +++ b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoCreateGuid.cs @@ -8,7 +8,10 @@ internal static partial class Interop { internal static partial class Ole32 { +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we annotate blittable types used in interop in CoreLib (like Guid) [DllImport(Interop.Libraries.Ole32)] internal static extern int CoCreateGuid(out Guid guid); +#pragma warning restore DLLIMPORTGENANALYZER015 } } diff --git a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetObjectContext.cs b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetObjectContext.cs index c73b065ea59537..851878a81554d6 100644 --- a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetObjectContext.cs +++ b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetObjectContext.cs @@ -3,13 +3,15 @@ using System; using System.Runtime.InteropServices; -using System.Runtime.InteropServices.ComTypes; internal static partial class Interop { internal static partial class Ole32 { +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we annotate blittable types used in interop in CoreLib (like Guid) [DllImport(Libraries.Ole32)] internal static extern int CoGetObjectContext([MarshalAs(UnmanagedType.LPStruct)] Guid riid, out IntPtr ppv); +#pragma warning restore DLLIMPORTGENANALYZER015 } } diff --git a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetStandardMarshal.cs b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetStandardMarshal.cs index cc958e694432c0..62bd304aa73f53 100644 --- a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetStandardMarshal.cs +++ b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetStandardMarshal.cs @@ -8,7 +8,10 @@ internal static partial class Interop { internal static partial class Ole32 { +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we annotate blittable types used in interop in CoreLib (like Guid) [DllImport(Interop.Libraries.Ole32)] internal static extern int CoGetStandardMarshal(ref Guid riid, IntPtr pv, int dwDestContext, IntPtr pvDestContext, int mshlflags, out IntPtr ppMarshal); +#pragma warning restore DLLIMPORTGENANALYZER015 } } diff --git a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoTaskMemAlloc.cs b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoTaskMemAlloc.cs index 9bce558be0e109..605360233f1393 100644 --- a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoTaskMemAlloc.cs +++ b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoTaskMemAlloc.cs @@ -8,13 +8,13 @@ internal static partial class Interop { internal static partial class Ole32 { - [DllImport(Libraries.Ole32)] - internal static extern IntPtr CoTaskMemAlloc(nuint cb); + [GeneratedDllImport(Libraries.Ole32)] + internal static partial IntPtr CoTaskMemAlloc(nuint cb); - [DllImport(Libraries.Ole32)] - internal static extern IntPtr CoTaskMemRealloc(IntPtr pv, nuint cb); + [GeneratedDllImport(Libraries.Ole32)] + internal static partial IntPtr CoTaskMemRealloc(IntPtr pv, nuint cb); - [DllImport(Libraries.Ole32)] - internal static extern void CoTaskMemFree(IntPtr ptr); + [GeneratedDllImport(Libraries.Ole32)] + internal static partial void CoTaskMemFree(IntPtr ptr); } } diff --git a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.PropVariantClear.cs b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.PropVariantClear.cs new file mode 100644 index 00000000000000..d93d595ff35f9a --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.PropVariantClear.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Ole32 + { + [GeneratedDllImport(Interop.Libraries.Ole32)] + internal static partial void PropVariantClear(IntPtr pObject); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SetErrorInfo.cs b/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SetErrorInfo.cs new file mode 100644 index 00000000000000..87b81e9906d258 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SetErrorInfo.cs @@ -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. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class OleAut32 + { + // only using this to clear existing error info with null + [GeneratedDllImport(Interop.Libraries.OleAut32)] + // TLS values are preserved between threads, need to check that we use this API to clear the error state only. + internal static partial void SetErrorInfo(int dwReserved, IntPtr pIErrorInfo); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringByteLen.cs b/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringByteLen.cs index 9869497d717290..7da06597f9b4bb 100644 --- a/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringByteLen.cs +++ b/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringByteLen.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class OleAut32 { - [DllImport(Libraries.OleAut32)] - internal static extern IntPtr SysAllocStringByteLen(byte[]? str, uint len); + [GeneratedDllImport(Libraries.OleAut32)] + internal static partial IntPtr SysAllocStringByteLen(byte[]? str, uint len); } } diff --git a/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringLen.cs b/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringLen.cs index 0ace274e645e71..16a08a170e788e 100644 --- a/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringLen.cs +++ b/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysAllocStringLen.cs @@ -8,7 +8,10 @@ internal static partial class Interop { internal static partial class OleAut32 { - [DllImport(Libraries.OleAut32, CharSet = CharSet.Unicode)] - internal static extern IntPtr SysAllocStringLen(IntPtr src, uint len); + [GeneratedDllImport(Libraries.OleAut32, CharSet = CharSet.Unicode)] + internal static partial IntPtr SysAllocStringLen(IntPtr src, uint len); + + [GeneratedDllImport(Libraries.OleAut32, CharSet = CharSet.Unicode)] + internal static partial IntPtr SysAllocStringLen(string src, uint len); } } diff --git a/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysFreeString.cs b/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysFreeString.cs index 8c02bcfa4f8347..09b31d14d44eb2 100644 --- a/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysFreeString.cs +++ b/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.SysFreeString.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class OleAut32 { - [DllImport(Libraries.OleAut32)] - internal static extern void SysFreeString(IntPtr bstr); + [GeneratedDllImport(Libraries.OleAut32)] + internal static partial void SysFreeString(IntPtr bstr); } } diff --git a/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantClear.cs b/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantClear.cs index ce046b72ce1acf..bc327864c6362f 100644 --- a/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantClear.cs +++ b/src/libraries/Common/src/Interop/Windows/OleAut32/Interop.VariantClear.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class OleAut32 { - [DllImport(Libraries.OleAut32)] - internal static extern void VariantClear(IntPtr variant); + [GeneratedDllImport(Libraries.OleAut32)] + internal static partial void VariantClear(IntPtr variant); } } diff --git a/src/libraries/Common/src/Interop/Windows/Pdh/Interop.PdhFormatFromRawValue.cs b/src/libraries/Common/src/Interop/Windows/Pdh/Interop.PdhFormatFromRawValue.cs index 11a1556a5230d3..b9ab8b10d0976f 100644 --- a/src/libraries/Common/src/Interop/Windows/Pdh/Interop.PdhFormatFromRawValue.cs +++ b/src/libraries/Common/src/Interop/Windows/Pdh/Interop.PdhFormatFromRawValue.cs @@ -7,8 +7,8 @@ internal static partial class Interop { internal static partial class Pdh { - [DllImport(Libraries.Pdh, CharSet = CharSet.Unicode)] - public static extern int PdhFormatFromRawValue( + [GeneratedDllImport(Libraries.Pdh, CharSet = CharSet.Unicode)] + public static partial int PdhFormatFromRawValue( uint dwCounterType, uint dwFormat, ref long pTimeBase, diff --git a/src/libraries/Common/src/Interop/Windows/PerfCounter/Interop.PerformanceData.cs b/src/libraries/Common/src/Interop/Windows/PerfCounter/Interop.PerformanceData.cs index 5b95bd08795a6f..1d266d08596ff2 100644 --- a/src/libraries/Common/src/Interop/Windows/PerfCounter/Interop.PerformanceData.cs +++ b/src/libraries/Common/src/Interop/Windows/PerfCounter/Interop.PerformanceData.cs @@ -9,8 +9,8 @@ internal static partial class Interop { internal static partial class PerfCounter { - [DllImport(Libraries.Advapi32, ExactSpelling = true)] - internal static extern uint PerfStopProvider( + [GeneratedDllImport(Libraries.Advapi32, ExactSpelling = true)] + internal static partial uint PerfStopProvider( IntPtr hProvider ); @@ -53,6 +53,8 @@ internal struct PerfCounterSetInstanceStruct internal uint InstanceNameSize; } +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we annotate blittable types used in interop in CoreLib (like Guid) [DllImport(Libraries.Advapi32, ExactSpelling = true)] internal static extern uint PerfStartProvider( ref Guid ProviderGuid, @@ -60,6 +62,7 @@ internal static extern uint PerfStartProvider( out SafePerfProviderHandle phProvider ); + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we annotate blittable types used in interop in CoreLib (like Guid) [DllImport(Libraries.Advapi32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)] internal static extern unsafe PerfCounterSetInstanceStruct* PerfCreateInstance( SafePerfProviderHandle hProvider, @@ -67,22 +70,23 @@ out SafePerfProviderHandle phProvider string szInstanceName, uint dwInstance ); +#pragma warning restore DLLIMPORTGENANALYZER015 - [DllImport(Libraries.Advapi32, ExactSpelling = true)] - internal static extern unsafe uint PerfSetCounterSetInfo( + [GeneratedDllImport(Libraries.Advapi32, ExactSpelling = true)] + internal static unsafe partial uint PerfSetCounterSetInfo( SafePerfProviderHandle hProvider, PerfCounterSetInfoStruct* pTemplate, uint dwTemplateSize ); - [DllImport(Libraries.Advapi32, ExactSpelling = true)] - internal static extern unsafe uint PerfDeleteInstance( + [GeneratedDllImport(Libraries.Advapi32, ExactSpelling = true)] + internal static unsafe partial uint PerfDeleteInstance( SafePerfProviderHandle hProvider, PerfCounterSetInstanceStruct* InstanceBlock ); - [DllImport(Libraries.Advapi32, ExactSpelling = true)] - internal static extern unsafe uint PerfSetCounterRefValue( + [GeneratedDllImport(Libraries.Advapi32, ExactSpelling = true)] + internal static unsafe partial uint PerfSetCounterRefValue( SafePerfProviderHandle hProvider, PerfCounterSetInstanceStruct* pInstance, uint CounterId, diff --git a/src/libraries/Common/src/Interop/Windows/Secur32/Interop.GetUserNameExW.cs b/src/libraries/Common/src/Interop/Windows/Secur32/Interop.GetUserNameExW.cs index c0ac51596ca5f7..5de96072a17614 100644 --- a/src/libraries/Common/src/Interop/Windows/Secur32/Interop.GetUserNameExW.cs +++ b/src/libraries/Common/src/Interop/Windows/Secur32/Interop.GetUserNameExW.cs @@ -7,8 +7,8 @@ internal static partial class Interop { internal static partial class Secur32 { - [DllImport(Libraries.Secur32, CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] - internal static extern BOOLEAN GetUserNameExW(int NameFormat, ref char lpNameBuffer, ref uint lpnSize); + [GeneratedDllImport(Libraries.Secur32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial BOOLEAN GetUserNameExW(int NameFormat, ref char lpNameBuffer, ref uint lpnSize); internal const int NameSamCompatible = 2; } diff --git a/src/libraries/Common/src/Interop/Windows/Shell32/Interop.SHGetKnownFolderPath.cs b/src/libraries/Common/src/Interop/Windows/Shell32/Interop.SHGetKnownFolderPath.cs index d224d2821f2f1e..5b3eaba1d14c4e 100644 --- a/src/libraries/Common/src/Interop/Windows/Shell32/Interop.SHGetKnownFolderPath.cs +++ b/src/libraries/Common/src/Interop/Windows/Shell32/Interop.SHGetKnownFolderPath.cs @@ -10,13 +10,16 @@ internal static partial class Shell32 { internal const int COR_E_PLATFORMNOTSUPPORTED = unchecked((int)0x80131539); +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time // https://msdn.microsoft.com/en-us/library/windows/desktop/bb762188.aspx - [DllImport(Libraries.Shell32, CharSet = CharSet.Unicode, SetLastError = false, BestFitMapping = false, ExactSpelling = true)] + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we annotate blittable types used in interop in CoreLib (like Guid) + [DllImport(Libraries.Shell32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = false)] internal static extern int SHGetKnownFolderPath( [MarshalAs(UnmanagedType.LPStruct)] Guid rfid, uint dwFlags, IntPtr hToken, out string ppszPath); +#pragma warning restore DLLIMPORTGENANALYZER015 // https://msdn.microsoft.com/en-us/library/windows/desktop/dd378457.aspx internal static class KnownFolders diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaConnectUntrusted.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaConnectUntrusted.cs index 1d956fe52a09a6..b537e7855593db 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaConnectUntrusted.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaConnectUntrusted.cs @@ -10,12 +10,7 @@ internal static partial class Interop { internal static partial class SspiCli { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.SspiCli)] internal static partial int LsaConnectUntrusted(out SafeLsaHandle LsaHandle); -#else - [DllImport(Interop.Libraries.SspiCli)] - internal static extern int LsaConnectUntrusted(out SafeLsaHandle LsaHandle); -#endif } } diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaDeregisterLogonProcess.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaDeregisterLogonProcess.cs index 352d7763ea5180..8cc158ef64570d 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaDeregisterLogonProcess.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaDeregisterLogonProcess.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class SspiCli { - [DllImport(Interop.Libraries.SspiCli)] - internal static extern int LsaDeregisterLogonProcess(IntPtr LsaHandle); + [GeneratedDllImport(Interop.Libraries.SspiCli)] + internal static partial int LsaDeregisterLogonProcess(IntPtr LsaHandle); } } diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaFreeReturnBuffer.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaFreeReturnBuffer.cs index bda15a55eba997..1c6705ee2d5791 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaFreeReturnBuffer.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaFreeReturnBuffer.cs @@ -8,12 +8,7 @@ internal static partial class Interop { internal static partial class SspiCli { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)] internal static partial int LsaFreeReturnBuffer(IntPtr handle); -#else - [DllImport(Interop.Libraries.SspiCli, SetLastError = true)] - internal static extern int LsaFreeReturnBuffer(IntPtr handle); -#endif } } diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaGetLogonSessionData.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaGetLogonSessionData.cs index 91e800168197bc..08f1da5b6507ec 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaGetLogonSessionData.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaGetLogonSessionData.cs @@ -9,13 +9,8 @@ internal static partial class Interop { internal static partial class SspiCli { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.SspiCli, SetLastError = true)] internal static partial int LsaGetLogonSessionData( -#else - [DllImport(Interop.Libraries.SspiCli, SetLastError = true)] - internal static extern int LsaGetLogonSessionData( -#endif ref LUID LogonId, out SafeLsaReturnBufferHandle ppLogonSessionData); } diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLogonUser.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLogonUser.cs index 82aaec9af71fe3..6be3ad7e6dd8e8 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLogonUser.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLogonUser.cs @@ -10,7 +10,9 @@ internal static partial class Interop { internal static partial class SspiCli { +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time [DllImport(Libraries.SspiCli)] + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we support non-blittable structs. internal static extern int LsaLogonUser( [In] SafeLsaHandle LsaHandle, [In] ref Advapi32.LSA_STRING OriginName, @@ -27,5 +29,6 @@ internal static extern int LsaLogonUser( [Out] out QUOTA_LIMITS Quotas, [Out] out int SubStatus ); +#pragma warning restore DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time } } diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLookupAuthenticationPackage.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLookupAuthenticationPackage.cs index dbe9a13b52d66e..a6c910ee5ee107 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLookupAuthenticationPackage.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.LsaLookupAuthenticationPackage.cs @@ -9,13 +9,8 @@ internal static partial class Interop { internal static partial class SspiCli { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Libraries.SspiCli)] internal static partial int LsaLookupAuthenticationPackage( -#else - [DllImport(Libraries.SspiCli)] - internal static extern int LsaLookupAuthenticationPackage( -#endif SafeLsaHandle LsaHandle, ref Advapi32.LSA_STRING PackageName, out int AuthenticationPackage diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.cs index cc4ee4b7b59042..84e30b45ef9ae7 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.cs @@ -344,10 +344,13 @@ internal static unsafe partial int DecryptMessage( uint sequenceNumber, uint* qualityOfProtection); +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time [DllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)] + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we support non-blittable structs. internal static extern int QuerySecurityContextToken( ref CredHandle phContext, out SecurityContextTokenHandle handle); +#pragma warning restore DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time [GeneratedDllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)] internal static partial int FreeContextBuffer( @@ -475,12 +478,14 @@ internal static partial SECURITY_STATUS SspiEncodeStringsAsAuthIdentity( string password, out SafeSspiAuthDataHandle authData); - // TODO: Switch to use GeneratedDllImport once we annotate blittable types used in interop in CoreLib (like Guid) +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time [DllImport(Interop.Libraries.SspiCli, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we support non-blittable structs. internal static extern SECURITY_STATUS SetCredentialsAttributesW( in CredHandle handlePtr, long ulAttribute, in SecPkgCred_ClientCertPolicy pBuffer, long cbBuffer); +#pragma warning restore DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time } } diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.TOKENS.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.TOKENS.cs index 00a32bfb5ef03e..344c9a73aa749b 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.TOKENS.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.TOKENS.cs @@ -47,4 +47,10 @@ internal struct TOKEN_STATISTICS internal uint PrivilegeCount; internal LUID ModifiedId; } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + internal struct TOKEN_USER + { + public SID_AND_ATTRIBUTES sidAndAttributes; + } } diff --git a/src/libraries/Common/src/Interop/Windows/Ucrtbase/Interop.MemAlloc.cs b/src/libraries/Common/src/Interop/Windows/Ucrtbase/Interop.MemAlloc.cs index 23fe143abad308..cdff4368744a63 100644 --- a/src/libraries/Common/src/Interop/Windows/Ucrtbase/Interop.MemAlloc.cs +++ b/src/libraries/Common/src/Interop/Windows/Ucrtbase/Interop.MemAlloc.cs @@ -8,25 +8,34 @@ internal static partial class Interop { internal static unsafe partial class Ucrtbase { - [DllImport(Libraries.Ucrtbase, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - internal static extern void* _aligned_malloc(nuint size, nuint alignment); - - [DllImport(Libraries.Ucrtbase, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - internal static extern void _aligned_free(void* ptr); - - [DllImport(Libraries.Ucrtbase, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - internal static extern void* _aligned_realloc(void* ptr, nuint size, nuint alignment); - - [DllImport(Libraries.Ucrtbase, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - internal static extern void* calloc(nuint num, nuint size); - - [DllImport(Libraries.Ucrtbase, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - internal static extern void free(void* ptr); - - [DllImport(Libraries.Ucrtbase, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - internal static extern void* malloc(nuint size); - - [DllImport(Libraries.Ucrtbase, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - internal static extern void* realloc(void* ptr, nuint new_size); +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + [GeneratedDllImport(Libraries.Ucrtbase, ExactSpelling = true)] + [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] + internal static partial void* _aligned_malloc(nuint size, nuint alignment); + + [GeneratedDllImport(Libraries.Ucrtbase, ExactSpelling = true)] + [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] + internal static partial void _aligned_free(void* ptr); + + [GeneratedDllImport(Libraries.Ucrtbase, ExactSpelling = true)] + [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] + internal static partial void* _aligned_realloc(void* ptr, nuint size, nuint alignment); + + [GeneratedDllImport(Libraries.Ucrtbase, ExactSpelling = true)] + [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] + internal static partial void* calloc(nuint num, nuint size); + + [GeneratedDllImport(Libraries.Ucrtbase, ExactSpelling = true)] + [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] + internal static partial void free(void* ptr); + + [GeneratedDllImport(Libraries.Ucrtbase, ExactSpelling = true)] + [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] + internal static partial void* malloc(nuint size); + + [GeneratedDllImport(Libraries.Ucrtbase, ExactSpelling = true)] + [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] + internal static partial void* realloc(void* ptr, nuint new_size); +#pragma warning restore CS3016 // Arrays as attribute arguments is not CLS-compliant } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.CreateWindowEx.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.CreateWindowEx.cs index e68dfd52f5df3a..98897d8ab7042e 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.CreateWindowEx.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.CreateWindowEx.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] - public static extern IntPtr CreateWindowExW( + [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + public static partial IntPtr CreateWindowExW( int exStyle, string lpszClassName, string lpszWindowName, diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.DefWindowProc.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.DefWindowProc.cs index 6b654003533c52..16470a45f104cb 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.DefWindowProc.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.DefWindowProc.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] - public static extern IntPtr DefWindowProcW(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam); + [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] + public static partial IntPtr DefWindowProcW(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.DestroyWindow.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.DestroyWindow.cs index c1f6b0f1fbbb53..e54676b56c4e24 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.DestroyWindow.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.DestroyWindow.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, ExactSpelling = true)] - public static extern bool DestroyWindow(IntPtr hWnd); + [GeneratedDllImport(Libraries.User32, ExactSpelling = true)] + public static partial bool DestroyWindow(IntPtr hWnd); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.DispatchMessage.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.DispatchMessage.cs index 0ebea0ef105983..4b3ed61586ed2b 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.DispatchMessage.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.DispatchMessage.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] - public static extern int DispatchMessageW([In] ref MSG msg); + [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] + public static partial int DispatchMessageW(ref MSG msg); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.EnumWindows.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.EnumWindows.cs index eff18b1b9d4098..c5008429fac732 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.EnumWindows.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.EnumWindows.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32)] - public static extern unsafe Interop.BOOL EnumWindows(delegate* unmanaged callback, IntPtr extraData); + [GeneratedDllImport(Libraries.User32)] + public static unsafe partial Interop.BOOL EnumWindows(delegate* unmanaged callback, IntPtr extraData); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.FindWindow.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.FindWindow.cs index 550fc1fdc0afa8..e41de1e359c795 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.FindWindow.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.FindWindow.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, CharSet=CharSet.Auto, ExactSpelling = true)] - public static extern IntPtr FindWindowW(string lpClassName, string lpWindowName); + [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] + public static partial IntPtr FindWindowW(string lpClassName, string lpWindowName); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetClassInfo.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetClassInfo.cs index 17804dc70f9f2f..680100ddffedd1 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetClassInfo.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetClassInfo.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] - public static extern bool GetClassInfoW(IntPtr hInst, string lpszClass, ref WNDCLASS wc); + [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] + public static partial bool GetClassInfoW(IntPtr hInst, string lpszClass, ref WNDCLASS wc); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetKeyState.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetKeyState.cs index bff237b379ef65..9ee51a05404fca 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetKeyState.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetKeyState.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32)] - internal static extern short GetKeyState(int virtualKeyCode); + [GeneratedDllImport(Libraries.User32)] + internal static partial short GetKeyState(int virtualKeyCode); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetProcessWindowStation.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetProcessWindowStation.cs index d624e2850a5dab..fe83921de3459a 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetProcessWindowStation.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetProcessWindowStation.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, ExactSpelling = true)] - internal static extern IntPtr GetProcessWindowStation(); + [GeneratedDllImport(Libraries.User32, ExactSpelling = true)] + internal static partial IntPtr GetProcessWindowStation(); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetSysColor.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetSysColor.cs index b066e25ec6eb2a..2ab729812f012e 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetSysColor.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetSysColor.cs @@ -15,7 +15,7 @@ internal static partial class User32 // index that doesn't exist. [SuppressGCTransition] - [DllImport(Libraries.User32, ExactSpelling = true)] - internal static extern uint GetSysColor(int nIndex); + [GeneratedDllImport(Libraries.User32, ExactSpelling = true)] + internal static partial uint GetSysColor(int nIndex); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetUserObjectInformation.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetUserObjectInformation.cs index 14d09b968e7091..ad1e903f206262 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetUserObjectInformation.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetUserObjectInformation.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true)] - public static extern unsafe bool GetUserObjectInformationW(IntPtr hObj, int nIndex, void* pvBuffer, uint nLength, ref uint lpnLengthNeeded); + [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + public static unsafe partial bool GetUserObjectInformationW(IntPtr hObj, int nIndex, void* pvBuffer, uint nLength, ref uint lpnLengthNeeded); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindow.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindow.cs index 1ece26d7fdd6a0..3091b5c58e5af8 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindow.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindow.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32)] - public static extern IntPtr GetWindow(IntPtr hWnd, int uCmd); + [GeneratedDllImport(Libraries.User32)] + public static partial IntPtr GetWindow(IntPtr hWnd, int uCmd); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowLong.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowLong.cs index 1a0310987f9904..9cc34ee12fbcb0 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowLong.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowLong.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, EntryPoint = "GetWindowLongW")] - public static extern int GetWindowLong(IntPtr hWnd, int uCmd); + [GeneratedDllImport(Libraries.User32, EntryPoint = "GetWindowLongW")] + public static partial int GetWindowLong(IntPtr hWnd, int uCmd); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowThreadProcessId.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowThreadProcessId.cs index 3b145fea4cc29c..daee2bf32eb177 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowThreadProcessId.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.GetWindowThreadProcessId.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, ExactSpelling = true)] - public static unsafe extern int GetWindowThreadProcessId(IntPtr handle, int* processId); + [GeneratedDllImport(Libraries.User32, ExactSpelling = true)] + public static unsafe partial int GetWindowThreadProcessId(IntPtr handle, int* processId); [DllImport(Libraries.User32, ExactSpelling = true)] public static extern int GetWindowThreadProcessId(HandleRef handle, out int processId); diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindow.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindow.cs index 12e380cc7dcddc..6a179ac1e32454 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindow.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindow.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, ExactSpelling = true)] - public static extern bool IsWindow(IntPtr hWnd); + [GeneratedDllImport(Libraries.User32, ExactSpelling = true)] + public static partial bool IsWindow(IntPtr hWnd); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindowVisible.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindowVisible.cs index 15a829a9cf5578..c09bfb716fada2 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindowVisible.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.IsWindowVisible.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32)] - public static extern BOOL IsWindowVisible(IntPtr hWnd); + [GeneratedDllImport(Libraries.User32)] + public static partial BOOL IsWindowVisible(IntPtr hWnd); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.KillTimer.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.KillTimer.cs index 2de52e0f347383..71fb4d29318cc8 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.KillTimer.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.KillTimer.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, ExactSpelling = true)] - public static extern bool KillTimer(IntPtr hwnd, IntPtr idEvent); + [GeneratedDllImport(Libraries.User32, ExactSpelling = true)] + public static partial bool KillTimer(IntPtr hwnd, IntPtr idEvent); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.LoadString.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.LoadString.cs index de9d9601696f91..7a74a2f43d4f43 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.LoadString.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.LoadString.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, SetLastError = true, EntryPoint = "LoadStringW", CharSet = CharSet.Unicode, ExactSpelling = true)] - internal static extern unsafe int LoadString(IntPtr hInstance, uint uID, char* lpBuffer, int cchBufferMax); + [GeneratedDllImport(Libraries.User32, EntryPoint = "LoadStringW", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static unsafe partial int LoadString(IntPtr hInstance, uint uID, char* lpBuffer, int cchBufferMax); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.MessageBeep.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.MessageBeep.cs index ad7bbbedcc17e1..cc3b1f2a23f060 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.MessageBeep.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.MessageBeep.cs @@ -13,7 +13,7 @@ internal static partial class User32 internal const int MB_ICONEXCLAMATION = 0x30; internal const int MB_ICONASTERISK = 0x40; - [DllImport(Libraries.User32, ExactSpelling = true)] - internal static extern bool MessageBeep(int type); + [GeneratedDllImport(Libraries.User32, ExactSpelling = true)] + internal static partial bool MessageBeep(int type); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.MsgWaitForMultipleObjectsEx.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.MsgWaitForMultipleObjectsEx.cs index 0b47d2be7659f2..8f1bf5dc52f561 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.MsgWaitForMultipleObjectsEx.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.MsgWaitForMultipleObjectsEx.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, ExactSpelling = true)] - public static extern int MsgWaitForMultipleObjectsEx(int nCount, IntPtr pHandles, int dwMilliseconds, int dwWakeMask, int dwFlags); + [GeneratedDllImport(Libraries.User32, ExactSpelling = true)] + public static partial int MsgWaitForMultipleObjectsEx(int nCount, IntPtr pHandles, int dwMilliseconds, int dwWakeMask, int dwFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.PeekMessage.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.PeekMessage.cs index 45710968dba9da..6bcfa1488d6848 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.PeekMessage.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.PeekMessage.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] - public static extern bool PeekMessageW([In, Out] ref MSG msg, IntPtr hwnd, int msgMin, int msgMax, int remove); + [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] + public static partial bool PeekMessageW(ref MSG msg, IntPtr hwnd, int msgMin, int msgMax, int remove); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.PostMessage.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.PostMessage.cs index eeec1ba0b518fb..962ccd2e2be1b8 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.PostMessage.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.PostMessage.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] - public static extern int PostMessageW(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam); + [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] + public static partial int PostMessageW(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam); [DllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] public static extern int PostMessageW(HandleRef hwnd, int msg, IntPtr wparam, IntPtr lparam); diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterClass.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterClass.cs index 270b0de4000618..7067518c4ce7cb 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterClass.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterClass.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] - public static extern short RegisterClassW(ref WNDCLASS wc); + [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + public static partial short RegisterClassW(ref WNDCLASS wc); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterWindowMessage.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterWindowMessage.cs index df46561daab79c..978ccf81107856 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterWindowMessage.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.RegisterWindowMessage.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] - public static extern int RegisterWindowMessageW(string msg); + [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] + public static partial int RegisterWindowMessageW(string msg); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessage.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessage.cs index aafb7c7e6f0a4a..9fa455f0b57bf1 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessage.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessage.cs @@ -8,8 +8,8 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] - public static extern IntPtr SendMessageW(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam); + [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] + public static partial IntPtr SendMessageW(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam); [DllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] public static extern IntPtr SendMessageW(HandleRef hWnd, int msg, IntPtr wParam, IntPtr lParam); diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessageTimeout.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessageTimeout.cs index c84dfdab7378c6..d3ebb4a04a4d9d 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessageTimeout.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.SendMessageTimeout.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, EntryPoint = "SendMessageTimeoutW")] - public static unsafe extern IntPtr SendMessageTimeout(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam, int flags, int timeout, IntPtr* pdwResult); + [GeneratedDllImport(Libraries.User32, EntryPoint = "SendMessageTimeoutW")] + public static unsafe partial IntPtr SendMessageTimeout(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam, int flags, int timeout, IntPtr* pdwResult); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLong.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLong.cs index 1278d8bdb95f80..03228c0f503cd0 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLong.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLong.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] - public static extern IntPtr SetClassLongW(IntPtr hwnd, int nIndex, IntPtr dwNewLong); + [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] + public static partial IntPtr SetClassLongW(IntPtr hwnd, int nIndex, IntPtr dwNewLong); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLongPtr.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLongPtr.cs index 2277ae1f230a4b..5bcd1f36689f30 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLongPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.SetClassLongPtr.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] - public static extern IntPtr SetClassLongPtrW(IntPtr hwnd, int nIndex, IntPtr dwNewLong); + [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] + public static partial IntPtr SetClassLongPtrW(IntPtr hwnd, int nIndex, IntPtr dwNewLong); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.SetTimer.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.SetTimer.cs index 0049286c2cacfd..5c5f1cb5b59bc7 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.SetTimer.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.SetTimer.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, ExactSpelling = true)] - public static extern IntPtr SetTimer(IntPtr hWnd, IntPtr nIDEvent, int uElapse, IntPtr lpTimerProc); + [GeneratedDllImport(Libraries.User32, ExactSpelling = true)] + public static partial IntPtr SetTimer(IntPtr hWnd, IntPtr nIDEvent, int uElapse, IntPtr lpTimerProc); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLong.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLong.cs index 669ff2310a14e8..588270b69dcfc1 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLong.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLong.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] - public static extern IntPtr SetWindowLongW(IntPtr hWnd, int nIndex, IntPtr dwNewLong); + [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] + public static partial IntPtr SetWindowLongW(IntPtr hWnd, int nIndex, IntPtr dwNewLong); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLongPtr.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLongPtr.cs index e9f915ee89ff52..9bc08ca7571a2e 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLongPtr.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.SetWindowLongPtr.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] - public static extern IntPtr SetWindowLongPtrW(IntPtr hWnd, int nIndex, IntPtr dwNewLong); + [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true)] + public static partial IntPtr SetWindowLongPtrW(IntPtr hWnd, int nIndex, IntPtr dwNewLong); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.TranslateMessage.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.TranslateMessage.cs index fe866df167886b..be2a58ca710713 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.TranslateMessage.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.TranslateMessage.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, ExactSpelling = true)] - public static extern bool TranslateMessage([In, Out] ref MSG msg); + [GeneratedDllImport(Libraries.User32, ExactSpelling = true)] + public static partial bool TranslateMessage(ref MSG msg); } } diff --git a/src/libraries/Common/src/Interop/Windows/User32/Interop.UnregisterClass.cs b/src/libraries/Common/src/Interop/Windows/User32/Interop.UnregisterClass.cs index bf321d2a9028f7..06a552c64ab926 100644 --- a/src/libraries/Common/src/Interop/Windows/User32/Interop.UnregisterClass.cs +++ b/src/libraries/Common/src/Interop/Windows/User32/Interop.UnregisterClass.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class User32 { - [DllImport(Libraries.User32, CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] - public static extern short UnregisterClassW(string lpClassName, IntPtr hInstance); + [GeneratedDllImport(Libraries.User32, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + public static partial short UnregisterClassW(string lpClassName, IntPtr hInstance); } } diff --git a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginClientHandshake.cs b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginClientHandshake.cs index 5d49f4d7eab7bf..554d62ab1601aa 100644 --- a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginClientHandshake.cs +++ b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginClientHandshake.cs @@ -3,13 +3,14 @@ using System; using System.Runtime.InteropServices; -using System.Security; internal static partial class Interop { internal static partial class WebSocket { +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time [DllImport(Libraries.WebSocket)] + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we support non-blittable structs. internal static extern int WebSocketBeginClientHandshake( [In] SafeHandle webSocketHandle, [In] IntPtr subProtocols, @@ -20,5 +21,6 @@ internal static extern int WebSocketBeginClientHandshake( [In] uint initialHeaderCount, [Out] out IntPtr additionalHeadersPtr, [Out] out uint additionalHeaderCount); +#pragma warning restore DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time } } diff --git a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginServerHandshake.cs b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginServerHandshake.cs index 019a75a7c671ed..68c10a704cb74a 100644 --- a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginServerHandshake.cs +++ b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketBeginServerHandshake.cs @@ -3,13 +3,14 @@ using System; using System.Runtime.InteropServices; -using System.Security; internal static partial class Interop { internal static partial class WebSocket { +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time [DllImport(Libraries.WebSocket)] + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we support non-blittable structs. internal static extern int WebSocketBeginServerHandshake( [In] SafeHandle webSocketHandle, [In] IntPtr subProtocol, @@ -19,5 +20,6 @@ internal static extern int WebSocketBeginServerHandshake( [In] uint requestHeaderCount, [Out] out IntPtr responseHeadersPtr, [Out] out uint responseHeaderCount); +#pragma warning restore DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time } } diff --git a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketDeleteHandle.cs b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketDeleteHandle.cs index c596dd22505a9f..d7f9b9d0944170 100644 --- a/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketDeleteHandle.cs +++ b/src/libraries/Common/src/Interop/Windows/WebSocket/Interop.WebSocketDeleteHandle.cs @@ -3,14 +3,13 @@ using System; using System.Runtime.InteropServices; -using System.Security; internal static partial class Interop { internal static partial class WebSocket { - [DllImport(Libraries.WebSocket)] - internal static extern void WebSocketDeleteHandle( - [In] IntPtr webSocketHandle); + [GeneratedDllImport(Libraries.WebSocket)] + internal static partial void WebSocketDeleteHandle( + IntPtr webSocketHandle); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp.cs b/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp.cs index c09f70be313994..ccd5084c430185 100644 --- a/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp.cs +++ b/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp.cs @@ -9,48 +9,27 @@ internal static partial class Interop { internal static partial class WinHttp { -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] public static partial SafeWinHttpHandle WinHttpOpen( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - public static extern SafeWinHttpHandle WinHttpOpen( -#endif IntPtr userAgent, uint accessType, string? proxyName, string? proxyBypass, int flags); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpCloseHandle( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool WinHttpCloseHandle( -#endif IntPtr handle); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] public static partial SafeWinHttpHandle WinHttpConnect( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - public static extern SafeWinHttpHandle WinHttpConnect( -#endif SafeWinHttpHandle sessionHandle, string serverName, ushort serverPort, uint reserved); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] public static partial SafeWinHttpHandle WinHttpOpenRequest( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - public static extern SafeWinHttpHandle WinHttpOpenRequest( -#endif SafeWinHttpHandle connectHandle, string verb, string objectName, @@ -69,29 +48,17 @@ public static extern bool WinHttpAddRequestHeaders( uint headersLength, uint modifiers); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpAddRequestHeaders( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool WinHttpAddRequestHeaders( -#endif SafeWinHttpHandle requestHandle, string headers, uint headersLength, uint modifiers); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpSendRequest( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool WinHttpSendRequest( -#endif SafeWinHttpHandle requestHandle, IntPtr headers, uint headersLength, @@ -100,53 +67,29 @@ public static extern bool WinHttpSendRequest( uint totalLength, IntPtr context); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpReceiveResponse( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool WinHttpReceiveResponse( -#endif SafeWinHttpHandle requestHandle, IntPtr reserved); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpQueryDataAvailable( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool WinHttpQueryDataAvailable( -#endif SafeWinHttpHandle requestHandle, IntPtr parameterIgnoredAndShouldBeNullForAsync); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpReadData( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool WinHttpReadData( -#endif SafeWinHttpHandle requestHandle, IntPtr buffer, uint bufferSize, IntPtr parameterIgnoredAndShouldBeNullForAsync); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpQueryHeaders( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool WinHttpQueryHeaders( -#endif SafeWinHttpHandle requestHandle, uint infoLevel, string name, @@ -154,15 +97,9 @@ public static extern bool WinHttpQueryHeaders( ref uint bufferLength, ref uint index); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpQueryHeaders( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool WinHttpQueryHeaders( -#endif SafeWinHttpHandle requestHandle, uint infoLevel, string name, @@ -170,99 +107,57 @@ public static extern bool WinHttpQueryHeaders( ref uint bufferLength, IntPtr index); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpQueryOption( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool WinHttpQueryOption( -#endif SafeWinHttpHandle handle, uint option, ref IntPtr buffer, ref uint bufferSize); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpQueryOption( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool WinHttpQueryOption( -#endif SafeWinHttpHandle handle, uint option, IntPtr buffer, ref uint bufferSize); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpQueryOption( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool WinHttpQueryOption( -#endif SafeWinHttpHandle handle, uint option, ref uint buffer, ref uint bufferSize); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpWriteData( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool WinHttpWriteData( -#endif SafeWinHttpHandle requestHandle, IntPtr buffer, uint bufferSize, IntPtr parameterIgnoredAndShouldBeNullForAsync); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpSetOption( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool WinHttpSetOption( -#endif SafeWinHttpHandle handle, uint option, ref uint optionData, uint optionLength = sizeof(uint)); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpSetOption( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool WinHttpSetOption( -#endif SafeWinHttpHandle handle, uint option, IntPtr optionData, uint optionLength); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpSetCredentials( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool WinHttpSetCredentials( -#endif SafeWinHttpHandle requestHandle, uint authTargets, uint authScheme, @@ -270,60 +165,40 @@ public static extern bool WinHttpSetCredentials( string? password, IntPtr reserved); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpQueryAuthSchemes( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool WinHttpQueryAuthSchemes( -#endif SafeWinHttpHandle requestHandle, out uint supportedSchemes, out uint firstScheme, out uint authTarget); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpSetTimeouts( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool WinHttpSetTimeouts( -#endif SafeWinHttpHandle handle, int resolveTimeout, int connectTimeout, int sendTimeout, int receiveTimeout); -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] public static partial bool WinHttpGetIEProxyConfigForCurrentUser( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool WinHttpGetIEProxyConfigForCurrentUser( -#endif out WINHTTP_CURRENT_USER_IE_PROXY_CONFIG proxyConfig); +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public static extern bool WinHttpGetProxyForUrl( - SafeWinHttpHandle? sessionHandle, string url, + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we support non-blittable structs. + [return: MarshalAs(UnmanagedType.Bool)]public static extern bool WinHttpGetProxyForUrl( + SafeWinHttpHandle? sessionHandle, + string url, ref WINHTTP_AUTOPROXY_OPTIONS autoProxyOptions, out WINHTTP_PROXY_INFO proxyInfo); +#pragma warning restore DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time -#if DLLIMPORTGENERATOR_ENABLED [GeneratedDllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] public static partial IntPtr WinHttpSetStatusCallback( -#else - [DllImport(Interop.Libraries.WinHttp, CharSet = CharSet.Unicode, SetLastError = true)] - public static extern IntPtr WinHttpSetStatusCallback( -#endif SafeWinHttpHandle handle, WINHTTP_STATUS_CALLBACK callback, uint notificationFlags, diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMCKINFO.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMCKINFO.cs index 1bcbc116c8a29a..f619de10d38eb7 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMCKINFO.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMCKINFO.cs @@ -8,7 +8,7 @@ internal static partial class Interop internal static partial class WinMM { [StructLayout(LayoutKind.Sequential)] - internal sealed class MMCKINFO + internal struct MMCKINFO { internal int ckID; internal int cksize; diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMSYSERR.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMSYSERR.cs new file mode 100644 index 00000000000000..6cfb6fba7164e0 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMSYSERR.cs @@ -0,0 +1,37 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class WinMM + { + // Enum equivalent to MMSYSERR_* + internal enum MMSYSERR : int + { + NOERROR = 0, + ERROR = (1), + BADDEVICEID = (2), + NOTENABLED = (3), + ALLOCATED = (4), + INVALHANDLE = (5), + NODRIVER = (6), + NOMEM = (7), + NOTSUPPORTED = (8), + BADERRNUM = (9), + INVALFLAG = (10), + INVALPARAM = (11), + HANDLEBUSY = (12), + INVALIDALIAS = (13), + BADDB = (14), + KEYNOTFOUND = (15), + READERROR = (16), + WRITEERROR = (17), + DELETEERROR = (18), + VALNOTFOUND = (19), + NODRIVERCB = (20), + LASTERROR = (20) + } + } +} diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.PlaySound.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.PlaySound.cs index 771fa9d1b2fd22..c87142948c54f1 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.PlaySound.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.PlaySound.cs @@ -17,10 +17,10 @@ internal static partial class WinMM internal const int SND_FILENAME = 0x20000; internal const int SND_NOSTOP = 0x10; - [DllImport(Libraries.WinMM, ExactSpelling = true, CharSet = CharSet.Unicode, EntryPoint = "PlaySoundW")] - internal static extern bool PlaySound(string soundName, IntPtr hmod, int soundFlags); + [GeneratedDllImport(Libraries.WinMM, EntryPoint = "PlaySoundW", CharSet = CharSet.Unicode, ExactSpelling = true)] + internal static partial bool PlaySound(string soundName, IntPtr hmod, int soundFlags); - [DllImport(Libraries.WinMM, ExactSpelling = true, EntryPoint = "PlaySoundW")] - internal static extern bool PlaySound(byte[] soundName, IntPtr hmod, int soundFlags); + [GeneratedDllImport(Libraries.WinMM, EntryPoint = "PlaySoundW", ExactSpelling = true)] + internal static partial bool PlaySound(byte[]? soundName, IntPtr hmod, int soundFlags); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioAscend.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioAscend.cs index 69c35b762890f8..66ca175b0493d0 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioAscend.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioAscend.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class WinMM { - [DllImport(Libraries.WinMM)] - internal static extern int mmioAscend(IntPtr hMIO, MMCKINFO lpck, int flags); + [GeneratedDllImport(Libraries.WinMM)] + internal static unsafe partial int mmioAscend(IntPtr hMIO, MMCKINFO* lpck, int flags); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioClose.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioClose.cs index 0948ba5b44b6e6..dc3c9af75f5bef 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioClose.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioClose.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class WinMM { - [DllImport(Interop.Libraries.WinMM)] - internal static extern int mmioClose(IntPtr hMIO, int flags); + [GeneratedDllImport(Interop.Libraries.WinMM)] + internal static partial int mmioClose(IntPtr hMIO, int flags); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioDescend.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioDescend.cs index ede50147bd43a0..9b3396350d3b0c 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioDescend.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioDescend.cs @@ -10,10 +10,11 @@ internal static partial class WinMM { internal const int MMIO_FINDRIFF = 0x00000020; - [DllImport(Libraries.WinMM)] - internal static extern int mmioDescend(IntPtr hMIO, - [MarshalAs(UnmanagedType.LPStruct)] MMCKINFO lpck, - [MarshalAs(UnmanagedType.LPStruct)] MMCKINFO lcpkParent, - int flags); + [GeneratedDllImport(Libraries.WinMM)] + internal static unsafe partial int mmioDescend( + IntPtr hMIO, + MMCKINFO* lpck, + MMCKINFO* lcpkParent, + int flags); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioOpen.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioOpen.cs index bdff1f1cd7ffa0..a1282b1209ac68 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioOpen.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioOpen.cs @@ -11,7 +11,7 @@ internal static partial class WinMM internal const int MMIO_READ = 0x00000000; internal const int MMIO_ALLOCBUF = 0x00010000; - [DllImport(Libraries.WinMM, CharSet = CharSet.Auto)] - internal static extern IntPtr mmioOpen(string fileName, IntPtr not_used, int flags); + [GeneratedDllImport(Libraries.WinMM, CharSet = CharSet.Auto)] + internal static partial IntPtr mmioOpen(string fileName, IntPtr not_used, int flags); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioRead.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioRead.cs index 3fb30c873de647..18c4007a5ff88b 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioRead.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioRead.cs @@ -24,7 +24,7 @@ internal sealed class WAVEFORMATEX internal const int WAVE_FORMAT_ADPCM = 0x0002; internal const int WAVE_FORMAT_IEEE_FLOAT = 0x0003; - [DllImport(Libraries.WinMM)] - internal static extern int mmioRead(IntPtr hMIO, [MarshalAs(UnmanagedType.LPArray)] byte[] wf, int cch); + [GeneratedDllImport(Libraries.WinMM)] + internal static partial int mmioRead(IntPtr hMIO, [MarshalAs(UnmanagedType.LPArray)] byte[] wf, int cch); } } diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutClose.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutClose.cs new file mode 100644 index 00000000000000..ffbd5829d91506 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutClose.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. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class WinMM + { + /// + /// This function closes the specified waveform output device. + /// + /// Handle to the waveform-audio output device. If the function + /// succeeds, the handle is no longer valid after this call. + /// MMSYSERR + [GeneratedDllImport(Libraries.WinMM)] + internal static partial MMSYSERR waveOutClose(IntPtr hwo); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetDevCaps.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetDevCaps.cs new file mode 100644 index 00000000000000..31a5a78df9eae7 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetDevCaps.cs @@ -0,0 +1,43 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class WinMM + { +#pragma warning disable CA1823 // unused fields + internal struct WAVEOUTCAPS + { + private ushort wMid; + private ushort wPid; + private uint vDriverVersion; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] + internal string szPname; + private uint dwFormats; + private ushort wChannels; + private ushort wReserved1; + private ushort dwSupport; + } +#pragma warning restore CA1823 + + /// + /// This function queries a specified waveform device to determine its + /// capabilities. + /// + /// Identifier of the waveform-audio output device. + /// It can be either a device identifier or a Handle to an open waveform-audio + /// output device. + /// Pointer to a WAVEOUTCAPS structure to be filled with + /// information about the capabilities of the device. + /// Size, in bytes, of the WAVEOUTCAPS structure. + /// MMSYSERR +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we support non-blittable types. + [DllImport(Libraries.WinMM)] + internal static extern MMSYSERR waveOutGetDevCaps(IntPtr uDeviceID, ref WAVEOUTCAPS caps, int cbwoc); +#pragma warning restore DLLIMPORTGENANALYZER015 + } +} diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetNumDevs.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetNumDevs.cs new file mode 100644 index 00000000000000..0878bc92ddfd17 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutGetNumDevs.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. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class WinMM + { + /// + /// This function retrieves the number of waveform output devices present + /// in the system. + /// + /// The number of devices indicates success. Zero indicates that + /// no devices are present or that an error occurred. + [GeneratedDllImport(Libraries.WinMM)] + internal static partial int waveOutGetNumDevs(); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutOpen.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutOpen.cs new file mode 100644 index 00000000000000..1fbb89c8836dc9 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutOpen.cs @@ -0,0 +1,51 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class WinMM + { + internal enum MM_MSG + { + MM_WOM_OPEN = 0x03BB, + MM_WOM_CLOSE = 0x03BC, + MM_WOM_DONE = 0x03BD + } + + // Flag specifying the use of a callback window for sound messages + internal const uint CALLBACK_WINDOW = 0x10000; + internal const uint CALLBACK_NULL = 0x00000000; + internal const uint CALLBACK_FUNCTION = 0x00030000; + + internal delegate void WaveOutProc(IntPtr hwo, MM_MSG uMsg, IntPtr dwInstance, IntPtr dwParam1, IntPtr dwParam2); + + /// + /// This function opens a specified waveform output device for playback. + /// + /// Address filled with a handle identifying the open + /// waveform-audio output device. Use the handle to identify the device + /// when calling other waveform-audio output functions. This parameter might + /// be NULL if the WAVE_FORMAT_QUERY flag is specified for fdwOpen. + /// Identifier of the waveform-audio output device to + /// open. It can be either a device identifier or a Handle to an open + /// waveform-audio input device. + /// Pointer to a WaveFormat structure that identifies + /// the format of the waveform-audio data to be sent to the device. You can + /// free this structure immediately after passing it to waveOutOpen. + /// Specifies the address of a fixed callback function, + /// an event handle, a handle to a window, or the identifier of a thread to be + /// called during waveform-audio playback to process messages related to the + /// progress of the playback. If no callback function is required, this value + /// can be zero. + /// Specifies user-instance data passed to the + /// callback mechanism. This parameter is not used with the window callback + /// mechanism. + /// Flags for opening the device. + /// MMSYSERR + [GeneratedDllImport(Libraries.WinMM)] + internal static partial MMSYSERR waveOutOpen(ref IntPtr phwo, int uDeviceID, byte[] pwfx, WaveOutProc dwCallback, IntPtr dwInstance, uint fdwOpen); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPause.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPause.cs new file mode 100644 index 00000000000000..02b5d5a13d014d --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPause.cs @@ -0,0 +1,21 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class WinMM + { + /// + /// This function pauses playback on a specified waveform output device. The + /// current playback position is saved. Use waveOutRestart to resume playback + /// from the current playback position. + /// + /// Handle to the waveform-audio output device. + /// MMSYSERR + [GeneratedDllImport(Libraries.WinMM)] + internal static partial MMSYSERR waveOutPause(IntPtr hwo); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPrepareHeader.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPrepareHeader.cs new file mode 100644 index 00000000000000..a8921127996e06 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutPrepareHeader.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. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class WinMM + { + /// + /// MM WAVEHDR structure + /// + [StructLayout(LayoutKind.Sequential)] + internal struct WAVEHDR + { + internal IntPtr lpData; // disposed by the GCHandle + internal uint dwBufferLength; + internal uint dwBytesRecorded; + internal uint dwUser; + internal uint dwFlags; + internal uint dwLoops; + internal IntPtr lpNext; // unused + internal uint reserved; + } + + /// + /// This function prepares a waveform data block for playback. + /// + /// Handle to the waveform-audio output device. + /// Pointer to a WaveHeader structure that identifies the data + /// block to be prepared. The buffer's base address must be aligned with the + /// respect to the sample size. + /// Size, in bytes, of the WaveHeader structure. + /// MMSYSERR + [GeneratedDllImport(Libraries.WinMM)] + internal static partial MMSYSERR waveOutPrepareHeader(IntPtr hwo, IntPtr pwh, int cbwh); + + /// + /// This function cleans up the preparation performed by waveOutPrepareHeader. + /// The function must be called after the device driver is finished with a data + /// block. You must call this function before freeing the data buffer. + /// + /// Handle to the waveform-audio output device. + /// Pointer to a WaveHeader structure identifying the data block + /// to be cleaned up. + /// Size, in bytes, of the WaveHeader structure. + /// MMSYSERR + [GeneratedDllImport(Libraries.WinMM)] + internal static partial MMSYSERR waveOutUnprepareHeader(IntPtr hwo, IntPtr pwh, int cbwh); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutReset.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutReset.cs new file mode 100644 index 00000000000000..6b98aa846b7991 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutReset.cs @@ -0,0 +1,21 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class WinMM + { + /// + /// This function stops playback on a specified waveform output device and + /// resets the current position to 0. All pending playback buffers are marked + /// as done and returned to the application. + /// + /// Handle to the waveform-audio output device. + /// MMSYSERR + [GeneratedDllImport(Libraries.WinMM)] + internal static partial MMSYSERR waveOutReset(IntPtr hwo); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutRestart.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutRestart.cs new file mode 100644 index 00000000000000..c9282fd393f385 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutRestart.cs @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class WinMM + { + /// + /// This function restarts a paused waveform output device. + /// + /// Handle to the waveform-audio output device. + /// MMSYSERR + [GeneratedDllImport(Libraries.WinMM)] + internal static partial MMSYSERR waveOutRestart(IntPtr hwo); + } +} diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutWrite.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutWrite.cs new file mode 100644 index 00000000000000..ff37bc6336e564 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.waveOutWrite.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. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class WinMM + { + /// + /// This function sends a data block to the specified waveform output device. + /// + /// Handle to the waveform-audio output device. + /// Pointer to a WaveHeader structure containing information + /// about the data block. + /// Size, in bytes, of the WaveHeader structure. + /// MMSYSERR + [GeneratedDllImport(Libraries.WinMM)] + internal static partial MMSYSERR waveOutWrite(IntPtr hwo, IntPtr pwh, int cbwh); + } +} 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 2467400c6dc3d1..808303128f4e3c 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetAddrInfoExW.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.GetAddrInfoExW.cs @@ -30,11 +30,11 @@ internal static unsafe partial int GetAddrInfoExW( delegate* unmanaged lpCompletionRoutine, IntPtr* lpNameHandle); - [DllImport(Libraries.Ws2_32, ExactSpelling = true)] - internal static extern unsafe int GetAddrInfoExCancel([In] IntPtr* lpHandle); + [GeneratedDllImport(Libraries.Ws2_32, ExactSpelling = true)] + internal static unsafe partial int GetAddrInfoExCancel(IntPtr* lpHandle); - [DllImport(Libraries.Ws2_32, ExactSpelling = true)] - internal static extern unsafe void FreeAddrInfoExW(AddressInfoEx* pAddrInfo); + [GeneratedDllImport(Libraries.Ws2_32, ExactSpelling = true)] + internal static unsafe partial void FreeAddrInfoExW(AddressInfoEx* pAddrInfo); [StructLayout(LayoutKind.Sequential)] internal unsafe struct AddressInfoEx diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAIoctl.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAIoctl.cs index 37265789dc827a..2508a98bc2f9db 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAIoctl.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAIoctl.cs @@ -9,8 +9,10 @@ internal static partial class Interop { internal static partial class Winsock { +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time // Used with SIOGETEXTENSIONFUNCTIONPOINTER - we're assuming that will never block. [DllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we annotate blittable types used in interop in CoreLib (like Guid) internal static extern SocketError WSAIoctl( SafeSocketHandle socketHandle, [In] int ioControlCode, @@ -21,6 +23,7 @@ internal static extern SocketError WSAIoctl( [Out] out int bytesTransferred, [In] IntPtr shouldBeNull, [In] IntPtr shouldBeNull2); +#pragma warning restore DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time [GeneratedDllImport(Interop.Libraries.Ws2_32, EntryPoint = "WSAIoctl", SetLastError = true)] internal static partial SocketError WSAIoctl_Blocking( diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAStartup.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAStartup.cs index aec9156128381f..4031576c64f46f 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAStartup.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAStartup.cs @@ -39,11 +39,11 @@ static unsafe void Initialize() } } - [DllImport(Libraries.Ws2_32)] - private static extern unsafe SocketError WSAStartup(short wVersionRequested, WSAData* lpWSAData); + [GeneratedDllImport(Libraries.Ws2_32)] + private static unsafe partial SocketError WSAStartup(short wVersionRequested, WSAData* lpWSAData); - [DllImport(Libraries.Ws2_32)] - private static extern SocketError WSACleanup(); + [GeneratedDllImport(Libraries.Ws2_32)] + private static partial SocketError WSACleanup(); [StructLayout(LayoutKind.Sequential, Size = 408)] private struct WSAData diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockopt.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockopt.cs index bdfd0e49be9f00..047d46b484e891 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockopt.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.getsockopt.cs @@ -32,12 +32,15 @@ internal static partial SocketError getsockopt( out IPMulticastRequest optionValue, ref int optionLength); +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time [DllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we support non-blittale structs. internal static extern SocketError getsockopt( [In] SafeSocketHandle socketHandle, [In] SocketOptionLevel optionLevel, [In] SocketOptionName optionName, [Out] out IPv6MulticastRequest optionValue, [In, Out] ref int optionLength); +#pragma warning restore DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time } } diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.setsockopt.cs b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.setsockopt.cs index 98a9a3d4f32954..2aeb51a0c4d21d 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/Interop.setsockopt.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/Interop.setsockopt.cs @@ -57,12 +57,15 @@ internal static partial SocketError setsockopt( ref IPMulticastRequest mreq, int optionLength); +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time [DllImport(Interop.Libraries.Ws2_32, SetLastError = true)] + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we support non-blittale structs. internal static extern SocketError setsockopt( [In] SafeSocketHandle socketHandle, [In] SocketOptionLevel optionLevel, [In] SocketOptionName optionName, [In] ref IPv6MulticastRequest mreq, [In] int optionLength); +#pragma warning restore DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time } } diff --git a/src/libraries/Common/src/Interop/Windows/Wkscli/Interop.NetWkstaGetInfo.cs b/src/libraries/Common/src/Interop/Windows/Wkscli/Interop.NetWkstaGetInfo.cs new file mode 100644 index 00000000000000..bfc103965943e5 --- /dev/null +++ b/src/libraries/Common/src/Interop/Windows/Wkscli/Interop.NetWkstaGetInfo.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Wkscli + { + [GeneratedDllImport(Libraries.Wkscli, CharSet = CharSet.Unicode, ExactSpelling = true)] + internal static partial int NetWkstaGetInfo(string server, int level, ref IntPtr buffer); + } +} diff --git a/src/libraries/Common/src/Microsoft/Win32/SafeHandles/GssSafeHandles.cs b/src/libraries/Common/src/Microsoft/Win32/SafeHandles/GssSafeHandles.cs index 7d1c8874191a93..2ab6998096704e 100644 --- a/src/libraries/Common/src/Microsoft/Win32/SafeHandles/GssSafeHandles.cs +++ b/src/libraries/Common/src/Microsoft/Win32/SafeHandles/GssSafeHandles.cs @@ -52,15 +52,12 @@ public override bool IsInvalid get { return handle == IntPtr.Zero; } } - protected override unsafe bool ReleaseHandle() + protected override bool ReleaseHandle() { Interop.NetSecurityNative.Status minorStatus; - fixed (IntPtr* handleRef = &handle) - { - Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.ReleaseName(&minorStatus, handleRef); - SetHandle(IntPtr.Zero); - return status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE; - } + Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.ReleaseName(out minorStatus, ref handle); + SetHandle(IntPtr.Zero); + return status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE; } public SafeGssNameHandle() @@ -144,15 +141,12 @@ public override bool IsInvalid get { return handle == IntPtr.Zero; } } - protected override unsafe bool ReleaseHandle() + protected override bool ReleaseHandle() { Interop.NetSecurityNative.Status minorStatus; - fixed (IntPtr* handlePtr = &handle) - { - Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.ReleaseCred(&minorStatus, handlePtr); - SetHandle(IntPtr.Zero); - return status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE; - } + Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.ReleaseCred(out minorStatus, ref handle); + SetHandle(IntPtr.Zero); + return status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE; } private static bool InitIsNtlmInstalled() @@ -176,12 +170,9 @@ public override bool IsInvalid protected override unsafe bool ReleaseHandle() { Interop.NetSecurityNative.Status minorStatus; - fixed (IntPtr* handlePtr = &handle) - { - Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.DeleteSecContext(&minorStatus, handlePtr); - SetHandle(IntPtr.Zero); - return status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE; - } + Interop.NetSecurityNative.Status status = Interop.NetSecurityNative.DeleteSecContext(out minorStatus, ref handle); + SetHandle(IntPtr.Zero); + return status == Interop.NetSecurityNative.Status.GSS_S_COMPLETE; } } } diff --git a/src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeCertContextHandleWithKeyContainerDeletion.cs b/src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeCertContextHandleWithKeyContainerDeletion.cs new file mode 100644 index 00000000000000..7488f624b90c47 --- /dev/null +++ b/src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeCertContextHandleWithKeyContainerDeletion.cs @@ -0,0 +1,81 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Security.Cryptography; + +namespace Microsoft.Win32.SafeHandles +{ + /// + /// SafeHandle for the CERT_CONTEXT structure defined by crypt32. Unlike SafeCertContextHandle, disposition already deletes any associated key containers. + /// + internal sealed class SafeCertContextHandleWithKeyContainerDeletion : SafeCertContextHandle + { + protected sealed override bool ReleaseHandle() + { + using (SafeCertContextHandle certContext = Interop.Crypt32.CertDuplicateCertificateContext(handle)) + { + DeleteKeyContainer(certContext); + } + base.ReleaseHandle(); + return true; + } + + internal static void DeleteKeyContainer(SafeCertContextHandle pCertContext) + { + if (pCertContext.IsInvalid) + return; + + int cb = 0; + bool containsPrivateKey = Interop.Crypt32.CertGetCertificateContextProperty(pCertContext, Interop.Crypt32.CertContextPropId.CERT_KEY_PROV_INFO_PROP_ID, null, ref cb); + if (!containsPrivateKey) + return; + + byte[] provInfoAsBytes = new byte[cb]; + if (!Interop.Crypt32.CertGetCertificateContextProperty(pCertContext, Interop.Crypt32.CertContextPropId.CERT_KEY_PROV_INFO_PROP_ID, provInfoAsBytes, ref cb)) + return; + + unsafe + { + fixed (byte* pProvInfoAsBytes = provInfoAsBytes) + { + Interop.Crypt32.CRYPT_KEY_PROV_INFO* pProvInfo = (Interop.Crypt32.CRYPT_KEY_PROV_INFO*)pProvInfoAsBytes; + + if (pProvInfo->dwProvType == 0) + { + // dwProvType being 0 indicates that the key is stored in CNG. + // dwProvType being non-zero indicates that the key is stored in CAPI. + + string providerName = Marshal.PtrToStringUni((IntPtr)(pProvInfo->pwszProvName))!; + string keyContainerName = Marshal.PtrToStringUni((IntPtr)(pProvInfo->pwszContainerName))!; + + try + { + using (CngKey cngKey = CngKey.Open(keyContainerName, new CngProvider(providerName))) + { + cngKey.Delete(); + } + } + catch (CryptographicException) + { + // While leaving the file on disk is undesirable, an inability to perform this cleanup + // should not manifest itself to a user. + } + } + else + { + Interop.Crypt32.CryptAcquireContextFlags flags = (pProvInfo->dwFlags & Interop.Crypt32.CryptAcquireContextFlags.CRYPT_MACHINE_KEYSET) | Interop.Crypt32.CryptAcquireContextFlags.CRYPT_DELETEKEYSET; + IntPtr hProv; + _ = Interop.Advapi32.CryptAcquireContext(out hProv, pProvInfo->pwszContainerName, pProvInfo->pwszProvName, pProvInfo->dwProvType, flags); + + // Called CryptAcquireContext solely for the side effect of deleting the key containers. When called with these flags, no actual + // hProv is returned (so there's nothing to clean up.) + Debug.Assert(hProv == IntPtr.Zero); + } + } + } + } + } +} diff --git a/src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeChainEngineHandle.cs b/src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeChainEngineHandle.cs new file mode 100644 index 00000000000000..516a1594622803 --- /dev/null +++ b/src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeChainEngineHandle.cs @@ -0,0 +1,42 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; + +namespace Microsoft.Win32.SafeHandles +{ + internal sealed class SafeChainEngineHandle : SafeHandleZeroOrMinusOneIsInvalid + { + public SafeChainEngineHandle() + : base(true) + { + } + + private SafeChainEngineHandle(IntPtr handle) + : base(true) + { + SetHandle(handle); + } + + public static readonly SafeChainEngineHandle MachineChainEngine = + new SafeChainEngineHandle((IntPtr)Interop.Crypt32.ChainEngine.HCCE_LOCAL_MACHINE); + + public static readonly SafeChainEngineHandle UserChainEngine = + new SafeChainEngineHandle((IntPtr)Interop.Crypt32.ChainEngine.HCCE_CURRENT_USER); + + protected sealed override bool ReleaseHandle() + { + Interop.Crypt32.CertFreeCertificateChainEngine(handle); + SetHandle(IntPtr.Zero); + return true; + } + + protected override void Dispose(bool disposing) + { + if (this != UserChainEngine && this != MachineChainEngine) + { + base.Dispose(disposing); + } + } + } +} diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Microsoft/Win32/SafeHandles/SafeX509ChainHandle.cs b/src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeX509ChainHandle.cs similarity index 93% rename from src/libraries/System.Security.Cryptography.X509Certificates/src/Microsoft/Win32/SafeHandles/SafeX509ChainHandle.cs rename to src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeX509ChainHandle.cs index 0b6968ad8e2fe5..20f987f6cc0530 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Microsoft/Win32/SafeHandles/SafeX509ChainHandle.cs +++ b/src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeX509ChainHandle.cs @@ -2,9 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using Internal.Cryptography.Pal; -using System; -using System.Diagnostics; -using System.Runtime.InteropServices; namespace Microsoft.Win32.SafeHandles { diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/H2StaticTable.Http2.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/H2StaticTable.Http2.cs index fdb619a3ff7abf..a4db64ab586221 100644 --- a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/H2StaticTable.Http2.cs +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/H2StaticTable.Http2.cs @@ -11,8 +11,9 @@ internal static partial class H2StaticTable public static ref readonly HeaderField Get(int index) => ref s_staticDecoderTable[index]; - public static int GetStatusIndex(int status) => - status switch + public static bool TryGetStatusIndex(int status, out int index) + { + index = status switch { 200 => 8, 204 => 9, @@ -21,9 +22,12 @@ public static int GetStatusIndex(int status) => 400 => 12, 404 => 13, 500 => 14, - _ => throw new ArgumentOutOfRangeException(nameof(status)) + _ => -1 }; + return index != -1; + } + private static readonly HeaderField[] s_staticDecoderTable = new HeaderField[] { CreateHeaderField(":authority", ""), diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackEncoder.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackEncoder.cs index a7f33d2c929841..780e7433c32afb 100644 --- a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackEncoder.cs +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackEncoder.cs @@ -44,36 +44,31 @@ public static bool EncodeIndexedHeaderField(int index, Span destination, o public static bool EncodeStatusHeader(int statusCode, Span destination, out int bytesWritten) { // Bytes written depend on whether the status code value maps directly to an index - switch (statusCode) + if (H2StaticTable.TryGetStatusIndex(statusCode, out var index)) { - case 200: - case 204: - case 206: - case 304: - case 400: - case 404: - case 500: - // Status codes which exist in the HTTP/2 StaticTable. - return EncodeIndexedHeaderField(H2StaticTable.GetStatusIndex(statusCode), destination, out bytesWritten); - default: - // If the status code doesn't have a static index then we need to include the full value. - // Write a status index and then the number bytes as a string literal. - if (!EncodeLiteralHeaderFieldWithoutIndexing(H2StaticTable.Status200, destination, out var nameLength)) - { - bytesWritten = 0; - return false; - } + // Status codes which exist in the HTTP/2 StaticTable. + return EncodeIndexedHeaderField(index, destination, out bytesWritten); + } + else + { + // If the status code doesn't have a static index then we need to include the full value. + // Write a status index and then the number bytes as a string literal. + if (!EncodeLiteralHeaderFieldWithoutIndexing(H2StaticTable.Status200, destination, out var nameLength)) + { + bytesWritten = 0; + return false; + } - var statusBytes = StatusCodes.ToStatusBytes(statusCode); + var statusBytes = StatusCodes.ToStatusBytes(statusCode); - if (!EncodeStringLiteral(statusBytes, destination.Slice(nameLength), out var valueLength)) - { - bytesWritten = 0; - return false; - } + if (!EncodeStringLiteral(statusBytes, destination.Slice(nameLength), out var valueLength)) + { + bytesWritten = 0; + return false; + } - bytesWritten = nameLength + valueLength; - return true; + bytesWritten = nameLength + valueLength; + return true; } } diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/Helpers/VariableLengthIntegerHelper.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/Helpers/VariableLengthIntegerHelper.cs index 33869c9254aeed..fb08f762705c04 100644 --- a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/Helpers/VariableLengthIntegerHelper.cs +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/Helpers/VariableLengthIntegerHelper.cs @@ -149,7 +149,7 @@ public static bool TryWrite(Span buffer, long longToEncode, out int bytesW Debug.Assert(longToEncode >= 0); Debug.Assert(longToEncode <= EightByteLimit); - if (longToEncode < OneByteLimit) + if (longToEncode <= OneByteLimit) { if (buffer.Length != 0) { @@ -158,7 +158,7 @@ public static bool TryWrite(Span buffer, long longToEncode, out int bytesW return true; } } - else if (longToEncode < TwoByteLimit) + else if (longToEncode <= TwoByteLimit) { if (BinaryPrimitives.TryWriteUInt16BigEndian(buffer, (ushort)((uint)longToEncode | TwoByteLengthMask))) { @@ -166,7 +166,7 @@ public static bool TryWrite(Span buffer, long longToEncode, out int bytesW return true; } } - else if (longToEncode < FourByteLimit) + else if (longToEncode <= FourByteLimit) { if (BinaryPrimitives.TryWriteUInt32BigEndian(buffer, (uint)longToEncode | FourByteLengthMask)) { @@ -200,9 +200,9 @@ public static int GetByteCount(long value) Debug.Assert(value <= EightByteLimit); return - value < OneByteLimit ? 1 : - value < TwoByteLimit ? 2 : - value < FourByteLimit ? 4 : + value <= OneByteLimit ? 1 : + value <= TwoByteLimit ? 2 : + value <= FourByteLimit ? 4 : 8; // EightByteLimit } } diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/H3StaticTable.Http3.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/H3StaticTable.Http3.cs index ebb9142752ef48..6e109d6f8c5471 100644 --- a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/H3StaticTable.Http3.cs +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/H3StaticTable.Http3.cs @@ -8,24 +8,6 @@ namespace System.Net.Http.QPack { internal static partial class H3StaticTable { - private static readonly Dictionary s_statusIndex = new Dictionary - { - [103] = 24, - [200] = 25, - [304] = 26, - [404] = 27, - [503] = 28, - [100] = 63, - [204] = 64, - [206] = 65, - [302] = 66, - [400] = 67, - [403] = 68, - [421] = 69, - [425] = 70, - [500] = 71, - }; - private static readonly Dictionary s_methodIndex = new Dictionary { // TODO connect is internal to system.net.http @@ -37,13 +19,36 @@ internal static partial class H3StaticTable [HttpMethod.Put] = 21, }; + public static bool TryGetStatusIndex(int status, out int index) + { + index = status switch + { + 103 => 24, + 200 => 25, + 304 => 26, + 404 => 27, + 503 => 28, + 100 => 63, + 204 => 64, + 206 => 65, + 302 => 66, + 400 => 67, + 403 => 68, + 421 => 69, + 425 => 70, + 500 => 71, + _ => -1 + }; + + return index != -1; + } + public static int Count => s_staticTable.Length; // TODO: just use Dictionary directly to avoid interface dispatch. - public static IReadOnlyDictionary StatusIndex => s_statusIndex; public static IReadOnlyDictionary MethodIndex => s_methodIndex; - public static HeaderField GetHeaderFieldAt(int index) => s_staticTable[index]; + public static ref HeaderField Get(int index) => ref s_staticTable[index]; private static readonly HeaderField[] s_staticTable = new HeaderField[] { diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackDecoder.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackDecoder.cs index 77a3baa8a3de69..edd361871ca01f 100644 --- a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackDecoder.cs +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackDecoder.cs @@ -176,15 +176,22 @@ public void Reset() _state = State.RequiredInsertCount; } - public void Decode(in ReadOnlySequence headerBlock, IHttpHeadersHandler handler) + public void Decode(in ReadOnlySequence headerBlock, bool endHeaders, IHttpHeadersHandler handler) { foreach (ReadOnlyMemory segment in headerBlock) { - Decode(segment.Span, handler); + DecodeCore(segment.Span, handler); } + CheckIncompleteHeaderBlock(endHeaders); } - public void Decode(ReadOnlySpan headerBlock, IHttpHeadersHandler handler) + public void Decode(ReadOnlySpan headerBlock, bool endHeaders, IHttpHeadersHandler handler) + { + DecodeCore(headerBlock, handler); + CheckIncompleteHeaderBlock(endHeaders); + } + + private void DecodeCore(ReadOnlySpan headerBlock, IHttpHeadersHandler handler) { foreach (byte b in headerBlock) { @@ -192,6 +199,17 @@ public void Decode(ReadOnlySpan headerBlock, IHttpHeadersHandler handler) } } + private void CheckIncompleteHeaderBlock(bool endHeaders) + { + if (endHeaders) + { + if (_state != State.CompressedHeaders) + { + throw new QPackDecodingException(SR.net_http_hpack_incomplete_header_block); + } + } + } + private void OnByte(byte b, IHttpHeadersHandler handler) { int intResult; diff --git a/src/libraries/Common/src/System/Net/StreamBuffer.cs b/src/libraries/Common/src/System/Net/StreamBuffer.cs index 6759fcdd8e20b0..32bc0f3f4e45ce 100644 --- a/src/libraries/Common/src/System/Net/StreamBuffer.cs +++ b/src/libraries/Common/src/System/Net/StreamBuffer.cs @@ -192,8 +192,6 @@ public void EndWrite() private (bool wait, int bytesRead) TryReadFromBuffer(Span buffer) { - Debug.Assert(buffer.Length > 0); - Debug.Assert(!Monitor.IsEntered(SyncObject)); lock (SyncObject) { @@ -225,11 +223,6 @@ public void EndWrite() public int Read(Span buffer) { - if (buffer.Length == 0) - { - return 0; - } - (bool wait, int bytesRead) = TryReadFromBuffer(buffer); if (wait) { @@ -246,11 +239,6 @@ public async ValueTask ReadAsync(Memory buffer, CancellationToken can { cancellationToken.ThrowIfCancellationRequested(); - if (buffer.Length == 0) - { - return 0; - } - (bool wait, int bytesRead) = TryReadFromBuffer(buffer.Span); if (wait) { diff --git a/src/libraries/Common/src/System/Obsoletions.cs b/src/libraries/Common/src/System/Obsoletions.cs index 10fab423b8e326..8dfa6a243b4a34 100644 --- a/src/libraries/Common/src/System/Obsoletions.cs +++ b/src/libraries/Common/src/System/Obsoletions.cs @@ -119,5 +119,8 @@ internal static class Obsoletions internal const string RegexCompileToAssemblyMessage = "Regex.CompileToAssembly is obsolete and not supported. Use RegexGeneratorAttribute with the regular expression source generator instead."; internal const string RegexCompileToAssemblyDiagId = "SYSLIB0036"; + + internal const string AssemblyNameMembersMessage = "AssemblyName members HashAlgorithm, ProcessorArchitecture, and VersionCompatibility are obsolete and not supported."; + internal const string AssemblyNameMembersDiagId = "SYSLIB0037"; } } diff --git a/src/libraries/Common/src/System/Runtime/InteropServices/ArrayMarshaller.cs b/src/libraries/Common/src/System/Runtime/InteropServices/ArrayMarshaller.cs index 2293743aa87fe0..91e350038b8011 100644 --- a/src/libraries/Common/src/System/Runtime/InteropServices/ArrayMarshaller.cs +++ b/src/libraries/Common/src/System/Runtime/InteropServices/ArrayMarshaller.cs @@ -32,20 +32,8 @@ public ArrayMarshaller(int sizeOfNativeElement) } public ArrayMarshaller(T[]? managed, int sizeOfNativeElement) + :this(managed, Span.Empty, sizeOfNativeElement) { - _allocatedMemory = default; - _sizeOfNativeElement = sizeOfNativeElement; - if (managed is null) - { - _managedArray = null; - NativeValueStorage = default; - return; - } - _managedArray = managed; - // Always allocate at least one byte when the array is zero-length. - int spaceToAllocate = Math.Max(managed.Length * _sizeOfNativeElement, 1); - _allocatedMemory = Marshal.AllocCoTaskMem(spaceToAllocate); - NativeValueStorage = new Span((void*)_allocatedMemory, spaceToAllocate); } public ArrayMarshaller(T[]? managed, Span stackSpace, int sizeOfNativeElement) @@ -94,8 +82,7 @@ public byte* Value { get { - Debug.Assert(_managedArray is null || _allocatedMemory != IntPtr.Zero); - return (byte*)_allocatedMemory; + return (byte*)Unsafe.AsPointer(ref GetPinnableReference()); } set { @@ -116,10 +103,7 @@ public byte* Value public void FreeNative() { - if (_allocatedMemory != IntPtr.Zero) - { - Marshal.FreeCoTaskMem(_allocatedMemory); - } + Marshal.FreeCoTaskMem(_allocatedMemory); } } @@ -141,20 +125,8 @@ public PtrArrayMarshaller(int sizeOfNativeElement) } public PtrArrayMarshaller(T*[]? managed, int sizeOfNativeElement) + :this(managed, Span.Empty, sizeOfNativeElement) { - _allocatedMemory = default; - _sizeOfNativeElement = sizeOfNativeElement; - if (managed is null) - { - _managedArray = null; - NativeValueStorage = default; - return; - } - _managedArray = managed; - // Always allocate at least one byte when the array is zero-length. - int spaceToAllocate = Math.Max(managed.Length * _sizeOfNativeElement, 1); - _allocatedMemory = Marshal.AllocCoTaskMem(spaceToAllocate); - NativeValueStorage = new Span((void*)_allocatedMemory, spaceToAllocate); } public PtrArrayMarshaller(T*[]? managed, Span stackSpace, int sizeOfNativeElement) @@ -203,8 +175,7 @@ public byte* Value { get { - Debug.Assert(_managedArray is null || _allocatedMemory != IntPtr.Zero); - return (byte*)_allocatedMemory; + return (byte*)Unsafe.AsPointer(ref GetPinnableReference()); } set { @@ -226,10 +197,7 @@ public byte* Value public void FreeNative() { - if (_allocatedMemory != IntPtr.Zero) - { - Marshal.FreeCoTaskMem(_allocatedMemory); - } + Marshal.FreeCoTaskMem(_allocatedMemory); } } } diff --git a/src/libraries/Common/src/System/Runtime/InteropServices/GeneratedDllImportAttribute.cs b/src/libraries/Common/src/System/Runtime/InteropServices/GeneratedDllImportAttribute.cs index e6ae47ac8fbfc5..e64fae1c7ad805 100644 --- a/src/libraries/Common/src/System/Runtime/InteropServices/GeneratedDllImportAttribute.cs +++ b/src/libraries/Common/src/System/Runtime/InteropServices/GeneratedDllImportAttribute.cs @@ -5,7 +5,6 @@ // // Types in this file are used for generated p/invokes (docs/design/features/source-generator-pinvokes.md). -// See the DllImportGenerator experiment in https://github.com/dotnet/runtimelab. // namespace System.Runtime.InteropServices { @@ -20,14 +19,11 @@ namespace System.Runtime.InteropServices #endif sealed class GeneratedDllImportAttribute : Attribute { - public bool BestFitMapping { get; set; } - public CallingConvention CallingConvention { get; set; } public CharSet CharSet { get; set; } public string? EntryPoint { get; set; } public bool ExactSpelling { get; set; } public bool PreserveSig { get; set; } public bool SetLastError { get; set; } - public bool ThrowOnUnmappableChar { get; set; } public GeneratedDllImportAttribute(string dllName) { diff --git a/src/libraries/Common/src/System/Security/Cryptography/ECDsaSecurityTransforms.cs b/src/libraries/Common/src/System/Security/Cryptography/ECDsaSecurityTransforms.cs index 431e6da9657ecd..c1f9852191a4b0 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/ECDsaSecurityTransforms.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/ECDsaSecurityTransforms.cs @@ -8,12 +8,12 @@ namespace System.Security.Cryptography { #if INTERNAL_ASYMMETRIC_IMPLEMENTATIONS - public partial class ECDsa : AsymmetricAlgorithm + public partial class ECDsa : ECAlgorithm { /// /// Creates an instance of the platform specific implementation of the cref="ECDsa" algorithm. /// - public static new ECDsa Create() + public static new partial ECDsa Create() { return new ECDsaImplementation.ECDsaSecurityTransforms(); } @@ -24,7 +24,7 @@ public partial class ECDsa : AsymmetricAlgorithm /// /// The representing the elliptic curve. /// - public static ECDsa Create(ECCurve curve) + public static partial ECDsa Create(ECCurve curve) { ECDsa ecdsa = Create(); ecdsa.GenerateKey(curve); @@ -37,7 +37,7 @@ public static ECDsa Create(ECCurve curve) /// /// The representing the elliptic curve parameters. /// - public static ECDsa Create(ECParameters parameters) + public static partial ECDsa Create(ECParameters parameters) { ECDsa ecdsa = Create(); ecdsa.ImportParameters(parameters); diff --git a/src/libraries/Common/src/System/Security/Cryptography/HashOneShotHelpers.cs b/src/libraries/Common/src/System/Security/Cryptography/HashOneShotHelpers.cs index 95c39e02acb0c8..22fff97677f615 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/HashOneShotHelpers.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/HashOneShotHelpers.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Diagnostics; +using Internal.Cryptography; namespace System.Security.Cryptography { @@ -15,25 +15,28 @@ public static int MacData( ReadOnlySpan source, Span destination) { - if (hashAlgorithm == HashAlgorithmName.SHA256) + if (Helpers.HasHMAC) { - return HMACSHA256.HashData(key, source, destination); - } - else if (hashAlgorithm == HashAlgorithmName.SHA1) - { - return HMACSHA1.HashData(key, source, destination); - } - else if (hashAlgorithm == HashAlgorithmName.SHA512) - { - return HMACSHA512.HashData(key, source, destination); - } - else if (hashAlgorithm == HashAlgorithmName.SHA384) - { - return HMACSHA384.HashData(key, source, destination); - } - else if (hashAlgorithm == HashAlgorithmName.MD5) - { - return HMACMD5.HashData(key, source, destination); + if (hashAlgorithm == HashAlgorithmName.SHA256) + { + return HMACSHA256.HashData(key, source, destination); + } + else if (hashAlgorithm == HashAlgorithmName.SHA1) + { + return HMACSHA1.HashData(key, source, destination); + } + else if (hashAlgorithm == HashAlgorithmName.SHA512) + { + return HMACSHA512.HashData(key, source, destination); + } + else if (hashAlgorithm == HashAlgorithmName.SHA384) + { + return HMACSHA384.HashData(key, source, destination); + } + else if (hashAlgorithm == HashAlgorithmName.MD5) + { + return HMACMD5.HashData(key, source, destination); + } } throw new CryptographicException(SR.Format(SR.Cryptography_UnknownHashAlgorithm, hashAlgorithm.Name)); diff --git a/src/libraries/Common/src/System/Security/Cryptography/PasswordBasedEncryption.cs b/src/libraries/Common/src/System/Security/Cryptography/PasswordBasedEncryption.cs index dc1fd465acfe3b..c391e8323351ac 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/PasswordBasedEncryption.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/PasswordBasedEncryption.cs @@ -74,6 +74,14 @@ internal static unsafe int Decrypt( { Debug.Assert(destination.Length >= encryptedData.Length); + if (!Helpers.HasSymmetricEncryption) + { + throw new CryptographicException( + SR.Format( + SR.Cryptography_UnknownAlgorithmIdentifier, + algorithmIdentifier.Algorithm)); + } + // Don't check that algorithmIdentifier.Parameters is set here. // Maybe some future PBES3 will have one with a default. @@ -229,6 +237,14 @@ internal static void InitiateEncryption( { Debug.Assert(pbeParameters != null); + if (!Helpers.HasSymmetricEncryption) + { + throw new CryptographicException( + SR.Format( + SR.Cryptography_UnknownAlgorithmIdentifier, + pbeParameters.EncryptionAlgorithm)); + } + isPkcs12 = false; switch (pbeParameters.EncryptionAlgorithm) @@ -258,7 +274,7 @@ internal static void InitiateEncryption( throw new CryptographicException( SR.Format( SR.Cryptography_UnknownAlgorithmIdentifier, - pbeParameters.HashAlgorithm.Name)); + pbeParameters.EncryptionAlgorithm)); } HashAlgorithmName prf = pbeParameters.HashAlgorithm; @@ -377,6 +393,12 @@ internal static unsafe int Encrypt( Debug.Assert(pwdTmpBytes!.Length == 0); } + if (!Helpers.HasHMAC) + { + throw new CryptographicException( + SR.Format(SR.Cryptography_AlgorithmNotSupported, "HMAC" + prf.Name)); + } + using (var pbkdf2 = new Rfc2898DeriveBytes(pwdTmpBytes, salt.ToArray(), iterationCount, prf)) { derivedKey = pbkdf2.GetBytes(keySizeBytes); @@ -518,6 +540,8 @@ private static unsafe int Pbes2Decrypt( Rfc2898DeriveBytes pbkdf2 = OpenPbkdf2(password, pbes2Params.KeyDerivationFunc.Parameters, out int? requestedKeyLength); + Debug.Assert(Helpers.HasHMAC); + using (pbkdf2) { // The biggest block size (for IV) we support is AES (128-bit / 16 byte) @@ -556,6 +580,12 @@ private static SymmetricAlgorithm OpenCipher( { string? algId = encryptionScheme.Algorithm; + if (!Helpers.HasSymmetricEncryption) + { + throw new CryptographicException( + SR.Format(SR.Cryptography_AlgorithmNotSupported, algId)); + } + if (algId == Oids.Aes128Cbc || algId == Oids.Aes192Cbc || algId == Oids.Aes256Cbc) @@ -747,6 +777,12 @@ private static unsafe Rfc2898DeriveBytes OpenPbkdf2( throw new CryptographicException(SR.Cryptography_Der_Invalid_Encoding); } + if (!Helpers.HasHMAC) + { + throw new CryptographicException( + SR.Format(SR.Cryptography_AlgorithmNotSupported, "HMAC" + prf.Name)); + } + int iterationCount = NormalizeIterationCount(pbkdf2Params.IterationCount); ReadOnlyMemory saltMemory = pbkdf2Params.Salt.Specified.Value; diff --git a/src/libraries/Common/src/System/Security/Cryptography/RSAOpenSsl.cs b/src/libraries/Common/src/System/Security/Cryptography/RSAOpenSsl.cs index aab2a5a5fb8225..f80a641a98f019 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/RSAOpenSsl.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/RSAOpenSsl.cs @@ -14,7 +14,7 @@ namespace System.Security.Cryptography #if INTERNAL_ASYMMETRIC_IMPLEMENTATIONS public partial class RSA : AsymmetricAlgorithm { - public static new RSA Create() => new RSAImplementation.RSAOpenSsl(); + public static new partial RSA Create() => new RSAImplementation.RSAOpenSsl(); } internal static partial class RSAImplementation diff --git a/src/libraries/Common/src/System/Security/Cryptography/RSASecurityTransforms.cs b/src/libraries/Common/src/System/Security/Cryptography/RSASecurityTransforms.cs index 9c02118e27ed00..29ce858255e768 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/RSASecurityTransforms.cs +++ b/src/libraries/Common/src/System/Security/Cryptography/RSASecurityTransforms.cs @@ -16,7 +16,7 @@ namespace System.Security.Cryptography #if INTERNAL_ASYMMETRIC_IMPLEMENTATIONS public partial class RSA : AsymmetricAlgorithm { - public static new RSA Create() + public static new partial RSA Create() { return new RSAImplementation.RSASecurityTransforms(); } diff --git a/src/libraries/Common/tests/Common.Tests.csproj b/src/libraries/Common/tests/Common.Tests.csproj index 37bd031cc647aa..7273bddf885948 100644 --- a/src/libraries/Common/tests/Common.Tests.csproj +++ b/src/libraries/Common/tests/Common.Tests.csproj @@ -67,6 +67,8 @@ Link="Common\System\Net\Http\aspnetcore\Http2\Hpack\H2StaticTable.Http2.cs" /> + + AllSeekModesAndValue(object value) => from mode in Enum.GetValues() select new object[] { mode, value }; - protected async Task ReadAsync(ReadWriteMode mode, Stream stream, byte[] buffer, int offset, int count, CancellationToken cancellationToken = default) + public static async Task ReadAsync(ReadWriteMode mode, Stream stream, byte[] buffer, int offset, int count, CancellationToken cancellationToken = default) { if (mode == ReadWriteMode.SyncByte) { diff --git a/src/libraries/Common/tests/System/Diagnostics/DebuggerAttributes.cs b/src/libraries/Common/tests/System/Diagnostics/DebuggerAttributes.cs index 3a1d3f8f84e873..1788215902f2e8 100644 --- a/src/libraries/Common/tests/System/Diagnostics/DebuggerAttributes.cs +++ b/src/libraries/Common/tests/System/Diagnostics/DebuggerAttributes.cs @@ -88,7 +88,7 @@ public static IEnumerable GetDebuggerVisibleProperties(Type debugg private static Type GetProxyType(Type type, Type[] genericTypeArguments) { - // Get the DebuggerTypeProxyAttibute for obj + // Get the DebuggerTypeProxyAttribute for obj var attrs = type.GetTypeInfo().CustomAttributes .Where(a => a.AttributeType == typeof(DebuggerTypeProxyAttribute)) diff --git a/src/libraries/Common/tests/System/IO/VirtualDriveHelper.Windows.cs b/src/libraries/Common/tests/System/IO/VirtualDriveHelper.Windows.cs new file mode 100644 index 00000000000000..9a221a2488c7c1 --- /dev/null +++ b/src/libraries/Common/tests/System/IO/VirtualDriveHelper.Windows.cs @@ -0,0 +1,148 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Runtime.Versioning; + +namespace System.IO +{ + // Adds test helper APIs to manipulate Windows virtual drives via SUBST. + [SupportedOSPlatform("windows")] + public class VirtualDriveHelper : IDisposable + { + // Temporary Windows directory that can be mounted to a drive letter using the subst command + private string? _virtualDriveTargetDir = null; + // Windows drive letter that points to a mounted directory using the subst command + private char _virtualDriveLetter = default; + + /// + /// If there is a SUBST'ed drive, Dispose unmounts it to free the drive letter. + /// + public void Dispose() + { + try + { + if (VirtualDriveLetter != default) + { + DeleteVirtualDrive(VirtualDriveLetter); + Directory.Delete(VirtualDriveTargetDir, recursive: true); + } + } + catch { } // avoid exceptions on dispose + } + + /// + /// Returns the path of a folder that is to be mounted using SUBST. + /// + public string VirtualDriveTargetDir + { + get + { + if (_virtualDriveTargetDir == null) + { + // Create a folder inside the temp directory so that it can be mounted to a drive letter with subst + _virtualDriveTargetDir = Path.Join(Path.GetTempPath(), Path.GetRandomFileName()); + Directory.CreateDirectory(_virtualDriveTargetDir); + } + + return _virtualDriveTargetDir; + } + } + + /// + /// Returns the drive letter of a drive letter that represents a mounted folder using SUBST. + /// + public char VirtualDriveLetter + { + get + { + if (_virtualDriveLetter == default) + { + // Mount the folder to a drive letter + _virtualDriveLetter = CreateVirtualDrive(VirtualDriveTargetDir); + } + return _virtualDriveLetter; + } + } + + /// + /// On Windows, mounts a folder to an assigned virtual drive letter using the subst command. + /// subst is not available in Windows Nano. + /// + private static char CreateVirtualDrive(string targetDir) + { + char driveLetter = GetNextAvailableDriveLetter(); + bool success = RunProcess(CreateProcessStartInfo("cmd", "/c", SubstPath, $"{driveLetter}:", targetDir)); + if (!success || !DriveInfo.GetDrives().Any(x => x.Name[0] == driveLetter)) + { + throw new InvalidOperationException($"Could not create virtual drive {driveLetter}: with subst"); + } + return driveLetter; + + // Finds the next unused drive letter and returns it. + char GetNextAvailableDriveLetter() + { + List existingDrives = DriveInfo.GetDrives().Select(x => x.Name[0]).ToList(); + + // A,B are reserved, C is usually reserved + IEnumerable range = Enumerable.Range('D', 'Z' - 'D'); + IEnumerable castRange = range.Select(x => Convert.ToChar(x)); + IEnumerable allDrivesLetters = castRange.Except(existingDrives); + + if (!allDrivesLetters.Any()) + { + throw new ArgumentOutOfRangeException("No drive letters available"); + } + + return allDrivesLetters.First(); + } + } + + /// + /// On Windows, unassigns the specified virtual drive letter from its mounted folder. + /// + private static void DeleteVirtualDrive(char driveLetter) + { + bool success = RunProcess(CreateProcessStartInfo("cmd", "/c", SubstPath, "/d", $"{driveLetter}:")); + if (!success || DriveInfo.GetDrives().Any(x => x.Name[0] == driveLetter)) + { + throw new InvalidOperationException($"Could not delete virtual drive {driveLetter}: with subst"); + } + } + + private static ProcessStartInfo CreateProcessStartInfo(string fileName, params string[] arguments) + { + var info = new ProcessStartInfo + { + FileName = fileName, + UseShellExecute = false, + RedirectStandardOutput = true + }; + + foreach (var argument in arguments) + { + info.ArgumentList.Add(argument); + } + + return info; + } + + private static bool RunProcess(ProcessStartInfo startInfo) + { + using var process = Process.Start(startInfo); + process.WaitForExit(); + return process.ExitCode == 0; + } + + private static string SubstPath + { + get + { + string systemRoot = Environment.GetEnvironmentVariable("SystemRoot") ?? @"C:\Windows"; + return Path.Join(systemRoot, "System32", "subst.exe"); + } + } + } +} \ No newline at end of file diff --git a/src/libraries/Common/tests/System/Net/EnterpriseTests/EnterpriseTestConfiguration.cs b/src/libraries/Common/tests/System/Net/EnterpriseTests/EnterpriseTestConfiguration.cs index f6ea2e8e743f0e..5ceb2c0fe396ef 100644 --- a/src/libraries/Common/tests/System/Net/EnterpriseTests/EnterpriseTestConfiguration.cs +++ b/src/libraries/Common/tests/System/Net/EnterpriseTests/EnterpriseTestConfiguration.cs @@ -13,7 +13,7 @@ public static class EnterpriseTestConfiguration public const string DigestAuthWebServer = "http://apacheweb.linux.contoso.com/auth/digest/"; public static bool Enabled => !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DOTNET_RUNTIME_ENTERPRISETESTS_ENABLED")); - // Folowing credentials are used only in docker scenario, it is not leaking any secrets. + // Following credentials are used only in docker scenario, it is not leaking any secrets. public static NetworkCredential ValidNetworkCredentials => new NetworkCredential("user1", "PLACEHOLDERcorrect20"); public static NetworkCredential ValidDomainNetworkCredentials => new NetworkCredential("user1", "PLACEHOLDERcorrect20", "LINUX" ); public static NetworkCredential InvalidNetworkCredentials => new NetworkCredential("user1", "PLACEHOLDERwong"); diff --git a/src/libraries/Common/tests/System/Net/EnterpriseTests/setup/apacheweb/run.sh b/src/libraries/Common/tests/System/Net/EnterpriseTests/setup/apacheweb/run.sh index 0b4a615157c0b7..8fd72c5f2c7204 100644 --- a/src/libraries/Common/tests/System/Net/EnterpriseTests/setup/apacheweb/run.sh +++ b/src/libraries/Common/tests/System/Net/EnterpriseTests/setup/apacheweb/run.sh @@ -1,16 +1,16 @@ -#!/bin/bash -x +#!/usr/bin/env bash -x echo "$@" > /tmp/args cp /SHARED/apacheweb.keytab /etc/krb5.keytab -if [ "$1" == "-debug" ]; then +if [[ "$1" == "-debug" ]]; then while [ 1 ];do sleep 10000 done fi -if [ "$1" == "-DNTLM" ]; then +if [[ "$1" == "-DNTLM" ]]; then # NTLM/Winbind is aggressive and eats Negotiate so it cannot be combined with Kerberos ./setup-pdc.sh /usr/sbin/apache2 -DALTPORT "$@" diff --git a/src/libraries/Common/tests/System/Net/EnterpriseTests/setup/apacheweb/setup-digest.sh b/src/libraries/Common/tests/System/Net/EnterpriseTests/setup/apacheweb/setup-digest.sh index ef3a9c610ee068..d42341810a1ec5 100644 --- a/src/libraries/Common/tests/System/Net/EnterpriseTests/setup/apacheweb/setup-digest.sh +++ b/src/libraries/Common/tests/System/Net/EnterpriseTests/setup/apacheweb/setup-digest.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash echo -n 'user1:Digest Login:' > /setup/digest_pw echo -n 'user1:Digest Login:PLACEHOLDERcorrect20' | md5sum | cut -d ' ' -f 1 >> /setup/digest_pw diff --git a/src/libraries/Common/tests/System/Net/EnterpriseTests/setup/apacheweb/setup-pdc.sh b/src/libraries/Common/tests/System/Net/EnterpriseTests/setup/apacheweb/setup-pdc.sh index 871e8da79e451b..86aabb90a68eda 100644 --- a/src/libraries/Common/tests/System/Net/EnterpriseTests/setup/apacheweb/setup-pdc.sh +++ b/src/libraries/Common/tests/System/Net/EnterpriseTests/setup/apacheweb/setup-pdc.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash rm -f /etc/samba/smb.conf # Configure domain and start daemons diff --git a/src/libraries/Common/tests/System/Net/Http/GenericLoopbackServer.cs b/src/libraries/Common/tests/System/Net/Http/GenericLoopbackServer.cs index 67166cfeb0cb04..9a523ca701417e 100644 --- a/src/libraries/Common/tests/System/Net/Http/GenericLoopbackServer.cs +++ b/src/libraries/Common/tests/System/Net/Http/GenericLoopbackServer.cs @@ -124,24 +124,24 @@ public abstract class GenericLoopbackConnection : IDisposable /// Sends Response back with provided statusCode, headers and content. /// If isFinal is false, the body is not completed and you can call SendResponseBodyAsync to send more. - public abstract Task SendResponseAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null, string content = "", bool isFinal = true, int requestId = 0); + public abstract Task SendResponseAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null, string content = "", bool isFinal = true); /// Sends response headers. - public abstract Task SendResponseHeadersAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null, int requestId = 0); + public abstract Task SendResponseHeadersAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null); /// Sends valid but incomplete headers. Once called, there is no way to continue the response past this point. - public abstract Task SendPartialResponseHeadersAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null, int requestId = 0); + public abstract Task SendPartialResponseHeadersAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null); /// Sends Response body after SendResponse was called with isFinal: false. - public abstract Task SendResponseBodyAsync(byte[] content, bool isFinal = true, int requestId = 0); + public abstract Task SendResponseBodyAsync(byte[] content, bool isFinal = true); /// Reads Request, sends Response and closes connection. public abstract Task HandleRequestAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null, string content = ""); /// Waits for the client to signal cancellation. - public abstract Task WaitForCancellationAsync(bool ignoreIncomingData = true, int requestId = 0); + public abstract Task WaitForCancellationAsync(bool ignoreIncomingData = true); /// Helper function to make it easier to convert old test with strings. - public async Task SendResponseBodyAsync(string content, bool isFinal = true, int requestId = 0) + public async Task SendResponseBodyAsync(string content, bool isFinal = true) { - await SendResponseBodyAsync(String.IsNullOrEmpty(content) ? new byte[0] : Encoding.ASCII.GetBytes(content), isFinal, requestId); + await SendResponseBodyAsync(String.IsNullOrEmpty(content) ? new byte[0] : Encoding.ASCII.GetBytes(content), isFinal); } } diff --git a/src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs b/src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs index 84bb65b63aac47..b3bb701e540f36 100644 --- a/src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs +++ b/src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs @@ -864,7 +864,7 @@ public override Task ReadRequestBodyAsync() return ReadBodyAsync(); } - public override async Task SendResponseAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null, string content = "", bool isFinal = true, int requestId = 0) + public async Task SendResponseAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null, string content = "", bool isFinal = true, int requestId = 0) { if (headers != null) { @@ -910,25 +910,30 @@ public override async Task SendResponseAsync(HttpStatusCode statusCode = HttpSta else { await SendResponseHeadersAsync(streamId, endStream: false, (HttpStatusCode)statusCode, endHeaders: true, headers: headers); - await SendResponseBodyAsync(content, isFinal: isFinal, requestId: streamId); + await SendResponseBodyAsync(content, isFinal: isFinal); } } - public override Task SendResponseHeadersAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null, int requestId = 0) + public override Task SendResponseAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null, string content = "", bool isFinal = true) { - int streamId = requestId == 0 ? _lastStreamId : requestId; + return SendResponseAsync(statusCode, headers, content, isFinal, requestId: 0); + } + + public override Task SendResponseHeadersAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null) + { + int streamId = _lastStreamId; return SendResponseHeadersAsync(streamId, endStream: false, statusCode, isTrailingHeader: false, endHeaders: true, headers); } - public override Task SendPartialResponseHeadersAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null, int requestId = 0) + public override Task SendPartialResponseHeadersAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null) { - int streamId = requestId == 0 ? _lastStreamId : requestId; + int streamId = _lastStreamId; return SendResponseHeadersAsync(streamId, endStream: false, statusCode, isTrailingHeader: false, endHeaders: false, headers); } - public override Task SendResponseBodyAsync(byte[] content, bool isFinal = true, int requestId = 0) + public override Task SendResponseBodyAsync(byte[] content, bool isFinal = true) { - int streamId = requestId == 0 ? _lastStreamId : requestId; + int streamId = _lastStreamId; return SendResponseBodyAsync(streamId, content, isFinal); } @@ -955,9 +960,9 @@ public override async Task HandleRequestAsync(HttpStatusCode st return requestData; } - public override async Task WaitForCancellationAsync(bool ignoreIncomingData = true, int requestId = 0) + public override async Task WaitForCancellationAsync(bool ignoreIncomingData = true) { - int streamId = requestId == 0 ? _lastStreamId : requestId; + int streamId = _lastStreamId; Frame frame; do diff --git a/src/libraries/Common/tests/System/Net/Http/Http3LoopbackConnection.cs b/src/libraries/Common/tests/System/Net/Http/Http3LoopbackConnection.cs index cb65b22dd02702..ceb36e0bcbfb12 100644 --- a/src/libraries/Common/tests/System/Net/Http/Http3LoopbackConnection.cs +++ b/src/libraries/Common/tests/System/Net/Http/Http3LoopbackConnection.cs @@ -200,24 +200,24 @@ public override async Task ReadRequestDataAsync(bool readBody = return await stream.ReadRequestDataAsync(readBody).ConfigureAwait(false); } - public override Task SendResponseAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null, string content = "", bool isFinal = true, int requestId = 0) + public override Task SendResponseAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null, string content = "", bool isFinal = true) { - return GetOpenRequest(requestId).SendResponseAsync(statusCode, headers, content, isFinal); + return GetOpenRequest().SendResponseAsync(statusCode, headers, content, isFinal); } - public override Task SendResponseBodyAsync(byte[] content, bool isFinal = true, int requestId = 0) + public override Task SendResponseBodyAsync(byte[] content, bool isFinal = true) { - return GetOpenRequest(requestId).SendResponseBodyAsync(content, isFinal); + return GetOpenRequest().SendResponseBodyAsync(content, isFinal); } - public override Task SendResponseHeadersAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null, int requestId = 0) + public override Task SendResponseHeadersAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null) { - return GetOpenRequest(requestId).SendResponseHeadersAsync(statusCode, headers); + return GetOpenRequest().SendResponseHeadersAsync(statusCode, headers); } - public override Task SendPartialResponseHeadersAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null, int requestId = 0) + public override Task SendPartialResponseHeadersAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null) { - return GetOpenRequest(requestId).SendPartialResponseHeadersAsync(statusCode, headers); + return GetOpenRequest().SendPartialResponseHeadersAsync(statusCode, headers); } public override async Task HandleRequestAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null, string content = "") @@ -301,9 +301,9 @@ public async Task WaitForClientDisconnectAsync(bool refuseNewRequests = true) await CloseAsync(H3_NO_ERROR); } - public override async Task WaitForCancellationAsync(bool ignoreIncomingData = true, int requestId = 0) + public override async Task WaitForCancellationAsync(bool ignoreIncomingData = true) { - await GetOpenRequest(requestId).WaitForCancellationAsync(ignoreIncomingData).ConfigureAwait(false); + await GetOpenRequest().WaitForCancellationAsync(ignoreIncomingData).ConfigureAwait(false); } } diff --git a/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs b/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs index ff4b34630525bd..30cb5d4a3f0431 100644 --- a/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs +++ b/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs @@ -872,7 +872,7 @@ public void CompleteRequestProcessing() _bodyRead = false; } - public override async Task SendResponseAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null, string content = "", bool isFinal = true, int requestId = 0) + public override async Task SendResponseAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null, string content = "", bool isFinal = true) { MemoryStream headerBytes = new MemoryStream(); int contentLength = -1; @@ -933,7 +933,7 @@ public override async Task SendResponseAsync(HttpStatusCode statusCode = HttpSta if (content != null) { - await SendResponseBodyAsync(content, isFinal: isFinal, requestId: requestId).ConfigureAwait(false); + await SendResponseBodyAsync(content, isFinal: isFinal).ConfigureAwait(false); } } @@ -955,13 +955,13 @@ private string GetResponseHeaderString(HttpStatusCode statusCode, IList headers = null, int requestId = 0) + public override async Task SendResponseHeadersAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null) { string headerString = GetResponseHeaderString(statusCode, headers); await SendResponseAsync(headerString).ConfigureAwait(false); } - public override async Task SendPartialResponseHeadersAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null, int requestId = 0) + public override async Task SendPartialResponseHeadersAsync(HttpStatusCode statusCode = HttpStatusCode.OK, IList headers = null) { string headerString = GetResponseHeaderString(statusCode, headers); @@ -971,7 +971,7 @@ public override async Task SendPartialResponseHeadersAsync(HttpStatusCode status await SendResponseAsync(headerString).ConfigureAwait(false); } - public override async Task SendResponseBodyAsync(byte[] content, bool isFinal = true, int requestId = 0) + public override async Task SendResponseBodyAsync(byte[] content, bool isFinal = true) { await SendResponseAsync(content).ConfigureAwait(false); } @@ -1047,7 +1047,7 @@ public override async Task HandleRequestAsync(HttpStatusCode st return requestData; } - public override async Task WaitForCancellationAsync(bool ignoreIncomingData = true, int requestId = 0) + public override async Task WaitForCancellationAsync(bool ignoreIncomingData = true) { var buffer = new byte[1024]; while (true) diff --git a/src/libraries/Common/tests/System/Runtime/Serialization/Utils.cs b/src/libraries/Common/tests/System/Runtime/Serialization/Utils.cs index ca01381a6dff10..2e2ac299c2c53b 100644 --- a/src/libraries/Common/tests/System/Runtime/Serialization/Utils.cs +++ b/src/libraries/Common/tests/System/Runtime/Serialization/Utils.cs @@ -9,6 +9,8 @@ using System.Threading.Tasks; using System.Xml.Linq; using System.Linq; +using System.Reflection; +using System.Runtime.Loader; using Xunit; internal static class Utils @@ -351,3 +353,30 @@ private static bool IsPrefixedAttributeValue(string atrValue, out string localPr return false; } } + +internal class TestAssemblyLoadContext : AssemblyLoadContext +{ + private AssemblyDependencyResolver _resolver; + + public TestAssemblyLoadContext(string name, bool isCollectible, string mainAssemblyToLoadPath = null) : base(name, isCollectible) + { + if (!PlatformDetection.IsBrowser) + _resolver = new AssemblyDependencyResolver(mainAssemblyToLoadPath ?? Assembly.GetExecutingAssembly().Location); + } + + protected override Assembly Load(AssemblyName name) + { + if (PlatformDetection.IsBrowser) + { + return base.Load(name); + } + + string assemblyPath = _resolver.ResolveAssemblyToPath(name); + if (assemblyPath != null) + { + return LoadFromAssemblyPath(assemblyPath); + } + + return null; + } +} diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/ECKeyFileTests.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/ECKeyFileTests.cs index 407ad99a41e3d1..dcfe4e81af9694 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/ECKeyFileTests.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/ECKeyFileTests.cs @@ -9,18 +9,13 @@ namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public abstract partial class ECKeyFileTests where T : AsymmetricAlgorithm + public abstract partial class ECKeyFileTests where T : ECAlgorithm { protected abstract T CreateKey(); - protected abstract byte[] ExportECPrivateKey(T key); - protected abstract bool TryExportECPrivateKey(T key, Span destination, out int bytesWritten); - protected abstract void ImportECPrivateKey(T key, ReadOnlySpan source, out int bytesRead); - protected abstract void ImportParameters(T key, ECParameters ecParameters); - protected abstract ECParameters ExportParameters(T key, bool includePrivate); protected abstract void Exercise(T key); protected virtual Func PublicKeyWriteArrayFunc { get; } = null; protected virtual WriteKeyToSpanFunc PublicKeyWriteSpanFunc { get; } = null; - + // This would need to be virtualized if there was ever a platform that // allowed explicit in ECDH or ECDSA but not the other. public static bool SupportsExplicitCurves { get; } = EcDiffieHellman.Tests.ECDiffieHellmanFactory.ExplicitCurvesSupported; @@ -51,7 +46,7 @@ public void UseAfterDispose(bool importKey) if (importKey) { - ImportParameters(key, EccTestData.GetNistP256ReferenceKey()); + key.ImportParameters(EccTestData.GetNistP256ReferenceKey()); } byte[] ecPrivate; @@ -72,20 +67,20 @@ public void UseAfterDispose(bool importKey) // Also ensures all of the inputs are valid for the disposed tests. using (key) { - ecPrivate = ExportECPrivateKey(key); + ecPrivate = key.ExportECPrivateKey(); pkcs8Private = key.ExportPkcs8PrivateKey(); pkcs8EncryptedPrivate = key.ExportEncryptedPkcs8PrivateKey(pwStr, pbeParameters); subjectPublicKeyInfo = key.ExportSubjectPublicKeyInfo(); } - Assert.Throws(() => ImportECPrivateKey(key, ecPrivate, out _)); + Assert.Throws(() => key.ImportECPrivateKey(ecPrivate, out _)); Assert.Throws(() => key.ImportPkcs8PrivateKey(pkcs8Private, out _)); Assert.Throws(() => key.ImportEncryptedPkcs8PrivateKey(pwStr, pkcs8EncryptedPrivate, out _)); Assert.Throws(() => key.ImportEncryptedPkcs8PrivateKey(pwBytes, pkcs8EncryptedPrivate, out _)); Assert.Throws(() => key.ImportSubjectPublicKeyInfo(subjectPublicKeyInfo, out _)); - Assert.Throws(() => ExportECPrivateKey(key)); - Assert.Throws(() => TryExportECPrivateKey(key, ecPrivate, out _)); + Assert.Throws(() => key.ExportECPrivateKey()); + Assert.Throws(() => key.TryExportECPrivateKey(ecPrivate, out _)); Assert.Throws(() => key.ExportPkcs8PrivateKey()); Assert.Throws(() => key.TryExportPkcs8PrivateKey(pkcs8Private, out _)); Assert.Throws(() => key.ExportEncryptedPkcs8PrivateKey(pwStr, pbeParameters)); @@ -654,7 +649,7 @@ public void NoFuzzySubjectPublicKeyInfo() using (T key = CreateKey()) { int bytesRead = -1; - byte[] ecPriv = ExportECPrivateKey(key); + byte[] ecPriv = key.ExportECPrivateKey(); Assert.ThrowsAny( () => key.ImportSubjectPublicKeyInfo(ecPriv, out bytesRead)); @@ -693,14 +688,14 @@ public void NoFuzzyECPrivateKey() byte[] spki = key.ExportSubjectPublicKeyInfo(); Assert.ThrowsAny( - () => ImportECPrivateKey(key, spki, out bytesRead)); + () => key.ImportECPrivateKey(spki, out bytesRead)); Assert.Equal(-1, bytesRead); byte[] pkcs8 = key.ExportPkcs8PrivateKey(); Assert.ThrowsAny( - () => ImportECPrivateKey(key, pkcs8, out bytesRead)); + () => key.ImportECPrivateKey(pkcs8, out bytesRead)); Assert.Equal(-1, bytesRead); @@ -714,7 +709,7 @@ public void NoFuzzyECPrivateKey() 123)); Assert.ThrowsAny( - () => ImportECPrivateKey(key, encryptedPkcs8, out bytesRead)); + () => key.ImportECPrivateKey(encryptedPkcs8, out bytesRead)); Assert.Equal(-1, bytesRead); } @@ -733,7 +728,7 @@ public void NoFuzzyPkcs8() Assert.Equal(-1, bytesRead); - byte[] ecPriv = ExportECPrivateKey(key); + byte[] ecPriv = key.ExportECPrivateKey(); Assert.ThrowsAny( () => key.ImportPkcs8PrivateKey(ecPriv, out bytesRead)); @@ -770,7 +765,7 @@ public void NoFuzzyEncryptedPkcs8() Assert.Equal(-1, bytesRead); - byte[] ecPriv = ExportECPrivateKey(key); + byte[] ecPriv = key.ExportECPrivateKey(); Assert.ThrowsAny( () => key.ImportEncryptedPkcs8PrivateKey(empty, ecPriv, out bytesRead)); @@ -793,13 +788,13 @@ public void NoPrivKeyFromPublicOnly() { ECParameters parameters = EccTestData.GetNistP521Key2(); parameters.D = null; - ImportParameters(key, parameters); + key.ImportParameters(parameters); Assert.ThrowsAny( - () => ExportECPrivateKey(key)); + () => key.ExportECPrivateKey()); Assert.ThrowsAny( - () => TryExportECPrivateKey(key, Span.Empty, out _)); + () => key.TryExportECPrivateKey(Span.Empty, out _)); Assert.ThrowsAny( () => key.ExportPkcs8PrivateKey()); @@ -1100,17 +1095,17 @@ private void ReadWriteBase64ECPrivateKey(string base64Pkcs8, in ECParameters exp base64Pkcs8, expected, (T key, ReadOnlySpan source, out int read) => - ImportECPrivateKey(key, source, out read), - key => ExportECPrivateKey(key), + key.ImportECPrivateKey(source, out read), + key => key.ExportECPrivateKey(), (T key, Span destination, out int bytesWritten) => - TryExportECPrivateKey(key, destination, out bytesWritten)); + key.TryExportECPrivateKey(destination, out bytesWritten)); } else { using (T key = CreateKey()) { Exception e = Assert.ThrowsAny( - () => ImportECPrivateKey(key, Convert.FromBase64String(base64Pkcs8), out _)); + () => key.ImportECPrivateKey(Convert.FromBase64String(base64Pkcs8), out _)); Assert.True( e is PlatformNotSupportedException || e is CryptographicException, @@ -1216,7 +1211,7 @@ private void ReadWriteKey( Assert.Equal(arrayExport, publicArrayExport); } - ECParameters ecParameters = ExportParameters(key, isPrivateKey); + ECParameters ecParameters = key.ExportParameters(isPrivateKey); EccTestBase.AssertEqual(expected, ecParameters); } @@ -1240,7 +1235,7 @@ private void ReadWriteKey( readAction(key, arrayExport, out int bytesRead); Assert.Equal(arrayExport.Length, bytesRead); - ECParameters ecParameters = ExportParameters(key, isPrivateKey); + ECParameters ecParameters = key.ExportParameters(isPrivateKey); EccTestBase.AssertEqual(expected, ecParameters); Assert.False( diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/ECKeyPemTests.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/ECKeyPemTests.cs index be7670c006da64..917a5dc18472ed 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/ECKeyPemTests.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/ECKeyPemTests.cs @@ -8,14 +8,13 @@ namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public abstract class ECKeyPemTests where TAlg : AsymmetricAlgorithm + public abstract class ECKeyPemTests where TAlg : ECAlgorithm { private const string AmbiguousExceptionMarker = "multiple keys"; private const string EncryptedExceptionMarker = "encrypted key"; private const string NoPemExceptionMarker = "No supported key"; protected abstract TAlg CreateKey(); - protected abstract ECParameters ExportParameters(TAlg key, bool includePrivateParameters); [Fact] public void ImportFromPem_NoPem() @@ -38,7 +37,7 @@ public void ImportFromPem_ECPrivateKey_Simple() AwEHoUQDQgAEgQHs5HRkpurXDPaabivT2IaRoyYtIsuk92Ner/JmgKjYoSumHVmS NfZ9nLTVjxeD08pD548KWrqmJAeZNsDDqQ== -----END EC PRIVATE KEY-----"); - ECParameters ecParameters = ExportParameters(key, true); + ECParameters ecParameters = key.ExportParameters(true); ECParameters expected = EccTestData.GetNistP256ReferenceKey(); EccTestBase.AssertEqual(expected, ecParameters); } @@ -64,7 +63,7 @@ public void ImportFromPem_ECPrivateKey_IgnoresUnrelatedAlgorithm() AwEHoUQDQgAEgQHs5HRkpurXDPaabivT2IaRoyYtIsuk92Ner/JmgKjYoSumHVmS NfZ9nLTVjxeD08pD548KWrqmJAeZNsDDqQ== -----END EC PRIVATE KEY-----"); - ECParameters ecParameters = ExportParameters(key, true); + ECParameters ecParameters = key.ExportParameters(true); ECParameters expected = EccTestData.GetNistP256ReferenceKey(); EccTestBase.AssertEqual(expected, ecParameters); } @@ -81,7 +80,7 @@ public void ImportFromPem_Pkcs8_Simple() whpHKz8E19aFG/Y0ny19WzRSs4qhRANCAASBAezkdGSm6tcM9ppuK9PYhpGjJi0i y6T3Y16v8maAqNihK6YdWZI19n2ctNWPF4PTykPnjwpauqYkB5k2wMOp -----END PRIVATE KEY-----"); - ECParameters ecParameters = ExportParameters(key, true); + ECParameters ecParameters = key.ExportParameters(true); ECParameters expected = EccTestData.GetNistP256ReferenceKey(); EccTestBase.AssertEqual(expected, ecParameters); } @@ -107,7 +106,7 @@ public void ImportFromPem_Pkcs8_IgnoresUnrelatedAlgorithm() whpHKz8E19aFG/Y0ny19WzRSs4qhRANCAASBAezkdGSm6tcM9ppuK9PYhpGjJi0i y6T3Y16v8maAqNihK6YdWZI19n2ctNWPF4PTykPnjwpauqYkB5k2wMOp -----END PRIVATE KEY-----"); - ECParameters ecParameters = ExportParameters(key, true); + ECParameters ecParameters = key.ExportParameters(true); ECParameters expected = EccTestData.GetNistP256ReferenceKey(); EccTestBase.AssertEqual(expected, ecParameters); } @@ -123,7 +122,7 @@ public void ImportFromPem_Spki_Simple() MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEgQHs5HRkpurXDPaabivT2IaRoyYt Isuk92Ner/JmgKjYoSumHVmSNfZ9nLTVjxeD08pD548KWrqmJAeZNsDDqQ== -----END PUBLIC KEY-----"); - ECParameters ecParameters = ExportParameters(key, false); + ECParameters ecParameters = key.ExportParameters(false); ECParameters expected = EccTestData.GetNistP256ReferenceKey(); EccTestBase.ComparePublicKey(expected.Q, ecParameters.Q, isEqual: true); } @@ -154,7 +153,7 @@ public void ImportFromPem_Spki_PrecedingUnrelatedPemIsIgnored() MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEgQHs5HRkpurXDPaabivT2IaRoyYt Isuk92Ner/JmgKjYoSumHVmSNfZ9nLTVjxeD08pD548KWrqmJAeZNsDDqQ== -----END PUBLIC KEY-----"); - ECParameters ecParameters = ExportParameters(key, false); + ECParameters ecParameters = key.ExportParameters(false); ECParameters expected = EccTestData.GetNistP256ReferenceKey(); EccTestBase.ComparePublicKey(expected.Q, ecParameters.Q, isEqual: true); } @@ -179,7 +178,7 @@ public void ImportFromPem_Spki_IgnoresUnrelatedAlgorithms() MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEgQHs5HRkpurXDPaabivT2IaRoyYt Isuk92Ner/JmgKjYoSumHVmSNfZ9nLTVjxeD08pD548KWrqmJAeZNsDDqQ== -----END PUBLIC KEY-----"); - ECParameters ecParameters = ExportParameters(key, false); + ECParameters ecParameters = key.ExportParameters(false); ECParameters expected = EccTestData.GetNistP256ReferenceKey(); EccTestBase.ComparePublicKey(expected.Q, ecParameters.Q, isEqual: true); } @@ -198,7 +197,7 @@ public void ImportFromPem_Spki_PrecedingMalformedPem() MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEgQHs5HRkpurXDPaabivT2IaRoyYt Isuk92Ner/JmgKjYoSumHVmSNfZ9nLTVjxeD08pD548KWrqmJAeZNsDDqQ== -----END PUBLIC KEY-----"); - ECParameters ecParameters = ExportParameters(key, false); + ECParameters ecParameters = key.ExportParameters(false); ECParameters expected = EccTestData.GetNistP256ReferenceKey(); EccTestBase.ComparePublicKey(expected.Q, ecParameters.Q, isEqual: true); } @@ -324,7 +323,7 @@ public void ImportFromEncryptedPem_Pkcs8_Char_Simple() Qh0fqdrNovgFLubbJFMQN/MwwIAfIuf0Mn0WFYYeQiBJ3kg= -----END ENCRYPTED PRIVATE KEY-----"; key.ImportFromEncryptedPem(pem, "test"); - ECParameters ecParameters = ExportParameters(key, true); + ECParameters ecParameters = key.ExportParameters(true); ECParameters expected = EccTestData.GetNistP256ReferenceKey(); EccTestBase.AssertEqual(expected, ecParameters); } @@ -345,7 +344,7 @@ public void ImportFromEncryptedPem_Pkcs8_Byte_Simple() -----END ENCRYPTED PRIVATE KEY-----"; byte[] passwordBytes = Encoding.UTF8.GetBytes("test"); key.ImportFromEncryptedPem(pem, passwordBytes); - ECParameters ecParameters = ExportParameters(key, true); + ECParameters ecParameters = key.ExportParameters(true); ECParameters expected = EccTestData.GetNistP256ReferenceKey(); EccTestBase.AssertEqual(expected, ecParameters); } diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDhKeyFileTests.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDhKeyFileTests.cs index 2b814f581f90d5..af64f2fc031eb1 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDhKeyFileTests.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDhKeyFileTests.cs @@ -9,36 +9,7 @@ namespace System.Security.Cryptography.EcDiffieHellman.Tests [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public class ECDhKeyFileTests : ECKeyFileTests { - protected override ECDiffieHellman CreateKey() - { - return ECDiffieHellmanFactory.Create(); - } - - protected override byte[] ExportECPrivateKey(ECDiffieHellman key) - { - return key.ExportECPrivateKey(); - } - - protected override bool TryExportECPrivateKey(ECDiffieHellman key, Span destination, out int bytesWritten) - { - return key.TryExportECPrivateKey(destination, out bytesWritten); - } - - protected override void ImportECPrivateKey(ECDiffieHellman key, ReadOnlySpan source, out int bytesRead) - { - key.ImportECPrivateKey(source, out bytesRead); - } - - protected override void ImportParameters(ECDiffieHellman key, ECParameters ecParameters) - { - key.ImportParameters(ecParameters); - } - - protected override ECParameters ExportParameters(ECDiffieHellman key, bool includePrivate) - { - return key.ExportParameters(includePrivate); - } - + protected override ECDiffieHellman CreateKey() => ECDiffieHellmanFactory.Create(); protected override void Exercise(ECDiffieHellman key) => key.Exercise(); protected override Func PublicKeyWriteArrayFunc { get; } = diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanKeyPemTests.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanKeyPemTests.cs index a03cdb0c766d0e..e2c03c2076d79c 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanKeyPemTests.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanKeyPemTests.cs @@ -10,7 +10,5 @@ namespace System.Security.Cryptography.EcDsa.Tests public sealed class ECDiffieHellmanKeyPemTests : ECKeyPemTests { protected override ECDiffieHellman CreateKey() => ECDiffieHellman.Create(); - protected override ECParameters ExportParameters(ECDiffieHellman key, bool includePrivateParameters) => - key.ExportParameters(includePrivateParameters); } } diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaKeyFileTests.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaKeyFileTests.cs index 46f88abb735a0d..35bed6e7247855 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaKeyFileTests.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaKeyFileTests.cs @@ -9,36 +9,7 @@ namespace System.Security.Cryptography.EcDsa.Tests [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public class ECDsaKeyFileTests : ECKeyFileTests { - protected override ECDsa CreateKey() - { - return ECDsaFactory.Create(); - } - - protected override byte[] ExportECPrivateKey(ECDsa key) - { - return key.ExportECPrivateKey(); - } - - protected override bool TryExportECPrivateKey(ECDsa key, Span destination, out int bytesWritten) - { - return key.TryExportECPrivateKey(destination, out bytesWritten); - } - - protected override void ImportECPrivateKey(ECDsa key, ReadOnlySpan source, out int bytesRead) - { - key.ImportECPrivateKey(source, out bytesRead); - } - - protected override void ImportParameters(ECDsa key, ECParameters ecParameters) - { - key.ImportParameters(ecParameters); - } - - protected override ECParameters ExportParameters(ECDsa key, bool includePrivate) - { - return key.ExportParameters(includePrivate); - } - + protected override ECDsa CreateKey() => ECDsaFactory.Create(); protected override void Exercise(ECDsa key) => key.Exercise(); } } diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaKeyPemTests.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaKeyPemTests.cs index b969afa0fe4550..ae0949397f3b4d 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaKeyPemTests.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaKeyPemTests.cs @@ -10,7 +10,5 @@ namespace System.Security.Cryptography.EcDsa.Tests public sealed class ECDsaKeyPemTests : ECKeyPemTests { protected override ECDsa CreateKey() => ECDsa.Create(); - protected override ECParameters ExportParameters(ECDsa key, bool includePrivateParameters) => - key.ExportParameters(includePrivateParameters); } } diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RC2/RC2CipherOneShotTests.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RC2/RC2CipherOneShotTests.cs index 24d2befc125c4d..1fae853ae27081 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RC2/RC2CipherOneShotTests.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RC2/RC2CipherOneShotTests.cs @@ -10,6 +10,7 @@ namespace System.Security.Cryptography.Encryption.RC2.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + [ConditionalClass(typeof(RC2Factory), nameof(RC2Factory.IsSupported))] public class RC2CipherOneShotTests : SymmetricOneShotBase { protected override byte[] Key => new byte[] diff --git a/src/libraries/Common/tests/System/Security/Cryptography/PlatformSupport.cs b/src/libraries/Common/tests/System/Security/Cryptography/PlatformSupport.cs index 9d1bf1a06a73de..ce6b9e8d831625 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/PlatformSupport.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/PlatformSupport.cs @@ -12,8 +12,8 @@ internal static class PlatformSupport internal const TestPlatforms AppleCrypto = TestPlatforms.OSX | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst; internal const TestPlatforms MobileAppleCrypto = TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst; - // Platforms that support OpenSSL - all Unix except OSX/iOS/tvOS/MacCatalyst and Android - internal const TestPlatforms OpenSSL = TestPlatforms.AnyUnix & ~(AppleCrypto | TestPlatforms.Android); + // Platforms that support OpenSSL - all Unix except OSX/iOS/tvOS/MacCatalyst, Android, and Browser + internal const TestPlatforms OpenSSL = TestPlatforms.AnyUnix & ~(AppleCrypto | TestPlatforms.Android | TestPlatforms.Browser); // Whether or not the current platform supports RC2 internal static readonly bool IsRC2Supported = !PlatformDetection.IsAndroid; diff --git a/src/libraries/Common/tests/TestUtilities/System/DisableParallelization.cs b/src/libraries/Common/tests/TestUtilities/System/DisableParallelization.cs new file mode 100644 index 00000000000000..d82016eb6ee7e5 --- /dev/null +++ b/src/libraries/Common/tests/TestUtilities/System/DisableParallelization.cs @@ -0,0 +1,12 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Xunit; + +namespace System +{ + // The collection definitions must be in the same assembly as the test that uses them. + // So please use "Compile Include" in the project file to include this class. + [CollectionDefinition(nameof(DisableParallelization), DisableParallelization = true)] + public class DisableParallelization { } +} diff --git a/src/libraries/Common/tests/System/Xml/DisableParallelization.cs b/src/libraries/Common/tests/TestUtilities/System/DisableParallelizationPerAssembly.cs similarity index 78% rename from src/libraries/Common/tests/System/Xml/DisableParallelization.cs rename to src/libraries/Common/tests/TestUtilities/System/DisableParallelizationPerAssembly.cs index e6fb8acae3b287..62b4f0e3730da2 100644 --- a/src/libraries/Common/tests/System/Xml/DisableParallelization.cs +++ b/src/libraries/Common/tests/TestUtilities/System/DisableParallelizationPerAssembly.cs @@ -1,5 +1,4 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// Tests are old and depend on the static state -[assembly: Xunit.CollectionBehavior(DisableTestParallelization = true)] +[assembly: Xunit.CollectionBehavior(DisableTestParallelization = true)] \ No newline at end of file diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Windows.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Windows.cs index d5b2c36e961e0e..2eeb8bdd367fe0 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Windows.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Windows.cs @@ -36,6 +36,7 @@ public static partial class PlatformDetection public static bool IsNotWindowsHomeEdition => !IsWindowsHomeEdition; public static bool IsNotInAppContainer => !IsInAppContainer; public static bool IsSoundPlaySupported => IsWindows && IsNotWindowsNanoServer; + public static bool IsBrowserOnWindows => IsBrowser && Path.DirectorySeparatorChar == '\\'; // >= Windows 10 Anniversary Update public static bool IsWindows10Version1607OrGreater => IsWindowsVersionOrLater(10, 0, 14393); diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index b153e3f525e6a0..b38d35ebc3440e 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -82,15 +82,7 @@ public static partial class PlatformDetection private static readonly Lazy s_LinqExpressionsBuiltWithIsInterpretingOnly = new Lazy(GetLinqExpressionsBuiltWithIsInterpretingOnly); private static bool GetLinqExpressionsBuiltWithIsInterpretingOnly() { - Type type = typeof(LambdaExpression); - if (type != null) - { - // The "Accept" method is under FEATURE_COMPILE conditional so it should not exist - MethodInfo methodInfo = type.GetMethod("Accept", BindingFlags.NonPublic | BindingFlags.Static); - return methodInfo == null; - } - - return false; + return !(bool)typeof(LambdaExpression).GetMethod("get_CanCompileToIL").Invoke(null, Array.Empty()); } // Please make sure that you have the libgdiplus dependency installed. diff --git a/src/libraries/Common/tests/TestUtilities/TestUtilities.csproj b/src/libraries/Common/tests/TestUtilities/TestUtilities.csproj index e46ba8375110ed..ecb7f715559ff9 100644 --- a/src/libraries/Common/tests/TestUtilities/TestUtilities.csproj +++ b/src/libraries/Common/tests/TestUtilities/TestUtilities.csproj @@ -8,6 +8,7 @@ and instead use runtime checks. --> $(NetCoreAppMinimum);$(NetFrameworkMinimum) + true StreamBuffer.DefaultMaxBufferSize; protected override bool FlushRequiredToWriteData => false; + protected override bool BlocksOnZeroByteReads => true; protected override Task CreateConnectedStreamsAsync() => Task.FromResult(ConnectedStreams.CreateUnidirectional()); @@ -18,6 +19,7 @@ public class BidirectionalConnectedStreamsTests : ConnectedStreamConformanceTest { protected override int BufferedSize => StreamBuffer.DefaultMaxBufferSize; protected override bool FlushRequiredToWriteData => false; + protected override bool BlocksOnZeroByteReads => true; protected override Task CreateConnectedStreamsAsync() => Task.FromResult(ConnectedStreams.CreateBidirectional()); diff --git a/src/libraries/Common/tests/Tests/System/Net/aspnetcore/Http3/QPackDecoderTest.cs b/src/libraries/Common/tests/Tests/System/Net/aspnetcore/Http3/QPackDecoderTest.cs new file mode 100644 index 00000000000000..57810746c77862 --- /dev/null +++ b/src/libraries/Common/tests/Tests/System/Net/aspnetcore/Http3/QPackDecoderTest.cs @@ -0,0 +1,210 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Buffers; +using System.Linq; +using System.Collections.Generic; +using System.Text; +using Xunit; +using System.Net.Http.QPack; +using System.Net.Http.HPack; +using HeaderField = System.Net.Http.QPack.HeaderField; +#if KESTREL +using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http; +#endif + +namespace System.Net.Http.Unit.Tests.QPack +{ + public class QPackDecoderTests + { + private const int MaxHeaderFieldSize = 8192; + + // 4.5.2 - Indexed Field Line - Static Table - Index 25 (:method: GET) + private static readonly byte[] _indexedFieldLineStatic = new byte[] { 0xd1 }; + + // 4.5.4 - Literal Header Field With Name Reference - Static Table - Index 44 (content-type) + private static readonly byte[] _literalHeaderFieldWithNameReferenceStatic = new byte[] { 0x5f, 0x1d }; + + // 4.5.6 - Literal Field Line With Literal Name - (translate) + private static readonly byte[] _literalFieldLineWithLiteralName = new byte[] { 0x37, 0x02, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65 }; + + private const string _contentTypeString = "content-type"; + private const string _translateString = "translate"; + + // n e w - h e a d e r * + // 10101000 10111110 00010110 10011100 10100011 10010000 10110110 01111111 + private static readonly byte[] _headerNameHuffmanBytes = new byte[] { 0xa8, 0xbe, 0x16, 0x9c, 0xa3, 0x90, 0xb6, 0x7f }; + + private const string _headerNameString = "new-header"; + private const string _headerValueString = "value"; + + private static readonly byte[] _headerValueBytes = Encoding.ASCII.GetBytes(_headerValueString); + + // v a l u e * + // 11101110 00111010 00101101 00101111 + private static readonly byte[] _headerValueHuffmanBytes = new byte[] { 0xee, 0x3a, 0x2d, 0x2f }; + + private static readonly byte[] _headerNameHuffman = new byte[] { 0x3f, 0x01 } + .Concat(_headerNameHuffmanBytes) + .ToArray(); + + private static readonly byte[] _headerValue = new byte[] { (byte)_headerValueBytes.Length } + .Concat(_headerValueBytes) + .ToArray(); + + private static readonly byte[] _headerValueHuffman = new byte[] { (byte)(0x80 | _headerValueHuffmanBytes.Length) } + .Concat(_headerValueHuffmanBytes) + .ToArray(); + + private readonly QPackDecoder _decoder; + private readonly TestHttpHeadersHandler _handler = new TestHttpHeadersHandler(); + + public QPackDecoderTests() + { + _decoder = new QPackDecoder(MaxHeaderFieldSize); + } + + [Fact] + public void DecodesIndexedHeaderField_StaticTableWithValue() + { + _decoder.Decode(new byte[] { 0, 0 }, endHeaders: false, handler: _handler); + _decoder.Decode(_indexedFieldLineStatic, endHeaders: true, handler: _handler); + Assert.Equal("GET", _handler.DecodedHeaders[":method"]); + + Assert.Equal(":method", _handler.DecodedStaticHeaders[H3StaticTable.MethodGet].Key); + Assert.Equal("GET", _handler.DecodedStaticHeaders[H3StaticTable.MethodGet].Value); + } + + [Fact] + public void DecodesIndexedHeaderField_StaticTableLiteralValue() + { + byte[] encoded = _literalHeaderFieldWithNameReferenceStatic + .Concat(_headerValue) + .ToArray(); + + _decoder.Decode(new byte[] { 0, 0 }, endHeaders: false, handler: _handler); + _decoder.Decode(encoded, endHeaders: true, handler: _handler); + Assert.Equal(_headerValueString, _handler.DecodedHeaders[_contentTypeString]); + + Assert.Equal(_contentTypeString, _handler.DecodedStaticHeaders[H3StaticTable.ContentTypeApplicationDnsMessage].Key); + Assert.Equal(_headerValueString, _handler.DecodedStaticHeaders[H3StaticTable.ContentTypeApplicationDnsMessage].Value); + } + + [Fact] + public void DecodesLiteralFieldLineWithLiteralName_Value() + { + byte[] encoded = _literalFieldLineWithLiteralName + .Concat(_headerValue) + .ToArray(); + + TestDecodeWithoutIndexing(encoded, _translateString, _headerValueString); + } + + [Fact] + public void DecodesLiteralFieldLineWithLiteralName_HuffmanEncodedValue() + { + byte[] encoded = _literalFieldLineWithLiteralName + .Concat(_headerValueHuffman) + .ToArray(); + + TestDecodeWithoutIndexing(encoded, _translateString, _headerValueString); + } + + [Fact] + public void DecodesLiteralFieldLineWithLiteralName_HuffmanEncodedName() + { + byte[] encoded = _headerNameHuffman + .Concat(_headerValue) + .ToArray(); + + TestDecodeWithoutIndexing(encoded, _headerNameString, _headerValueString); + } + + public static readonly TheoryData _incompleteHeaderBlockData = new TheoryData + { + // Incomplete header + new byte[] { }, + new byte[] { 0x00 }, + + // 4.5.4 - Literal Header Field With Name Reference - Static Table - Index 44 (content-type) + new byte[] { 0x00, 0x00, 0x5f }, + + // 4.5.6 - Literal Field Line With Literal Name - (translate) + new byte[] { 0x00, 0x00, 0x37 }, + new byte[] { 0x00, 0x00, 0x37, 0x02 }, + new byte[] { 0x00, 0x00, 0x37, 0x02, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74 }, + }; + + [Theory] + [MemberData(nameof(_incompleteHeaderBlockData))] + public void DecodesIncompleteHeaderBlock_Error(byte[] encoded) + { + QPackDecodingException exception = Assert.Throws(() => _decoder.Decode(encoded, endHeaders: true, handler: _handler)); + Assert.Equal(SR.net_http_hpack_incomplete_header_block, exception.Message); + Assert.Empty(_handler.DecodedHeaders); + } + + private static void TestDecodeWithoutIndexing(byte[] encoded, string expectedHeaderName, string expectedHeaderValue) + { + TestDecode(encoded, expectedHeaderName, expectedHeaderValue, expectDynamicTableEntry: false, byteAtATime: false); + TestDecode(encoded, expectedHeaderName, expectedHeaderValue, expectDynamicTableEntry: false, byteAtATime: true); + } + + private static void TestDecode(byte[] encoded, string expectedHeaderName, string expectedHeaderValue, bool expectDynamicTableEntry, bool byteAtATime) + { + var decoder = new QPackDecoder(MaxHeaderFieldSize); + var handler = new TestHttpHeadersHandler(); + + // Read past header + decoder.Decode(new byte[] { 0x00, 0x00 }, endHeaders: false, handler: handler); + + if (!byteAtATime) + { + decoder.Decode(encoded, endHeaders: true, handler: handler); + } + else + { + // Parse data in 1 byte chunks, separated by empty chunks + for (int i = 0; i < encoded.Length; i++) + { + bool end = i + 1 == encoded.Length; + + decoder.Decode(Array.Empty(), endHeaders: false, handler: handler); + decoder.Decode(new byte[] { encoded[i] }, endHeaders: end, handler: handler); + } + } + + Assert.Equal(expectedHeaderValue, handler.DecodedHeaders[expectedHeaderName]); + } + } + + public class TestHttpHeadersHandler : IHttpHeadersHandler + { + public Dictionary DecodedHeaders { get; } = new Dictionary(); + public Dictionary> DecodedStaticHeaders { get; } = new Dictionary>(); + + void IHttpHeadersHandler.OnHeader(ReadOnlySpan name, ReadOnlySpan value) + { + string headerName = Encoding.ASCII.GetString(name); + string headerValue = Encoding.ASCII.GetString(value); + + DecodedHeaders[headerName] = headerValue; + } + + void IHttpHeadersHandler.OnStaticIndexedHeader(int index) + { + ref readonly HeaderField entry = ref H3StaticTable.Get(index); + ((IHttpHeadersHandler)this).OnHeader(entry.Name, entry.Value); + DecodedStaticHeaders[index] = new KeyValuePair(Encoding.ASCII.GetString(entry.Name), Encoding.ASCII.GetString(entry.Value)); + } + + void IHttpHeadersHandler.OnStaticIndexedHeader(int index, ReadOnlySpan value) + { + byte[] name = H3StaticTable.Get(index).Name; + ((IHttpHeadersHandler)this).OnHeader(name, value); + DecodedStaticHeaders[index] = new KeyValuePair(Encoding.ASCII.GetString(name), Encoding.ASCII.GetString(value)); + } + + void IHttpHeadersHandler.OnHeadersComplete(bool endStream) { } + } +} diff --git a/src/libraries/Common/tests/Tests/System/Net/aspnetcore/Http3/VariableLengthIntegerHelperTests.cs b/src/libraries/Common/tests/Tests/System/Net/aspnetcore/Http3/VariableLengthIntegerHelperTests.cs new file mode 100644 index 00000000000000..3fc9a0cc74ec88 --- /dev/null +++ b/src/libraries/Common/tests/Tests/System/Net/aspnetcore/Http3/VariableLengthIntegerHelperTests.cs @@ -0,0 +1,372 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Buffers; +using System.Net.Http; +using Xunit; + +namespace Common.Tests.Tests.System.Net.aspnetcore.Http3 +{ + public class VariableLengthIntegerHelperTests + { + [Fact] + public void TryRead_FromReadOnlySpan_BufferEmpty() + { + ReadOnlySpan readOnlySpan = new ReadOnlySpan(); + bool isSuccess = VariableLengthIntegerHelper.TryRead(readOnlySpan, + out long value, out int bytesRead); + + Assert.False(isSuccess); + Assert.Equal(0, value); + Assert.Equal(0, bytesRead); + } + + [Fact] + public void TryRead_FromReadOnlySpan_BufferNotEmpty_InitialOneByteLengthMask() + { + ReadOnlySpan readOnlySpan = new ReadOnlySpan(new byte[] + { + 1 + }); + bool isSuccess = VariableLengthIntegerHelper.TryRead(readOnlySpan, + out long value, out int bytesRead); + + Assert.True(isSuccess); + Assert.Equal(1, value); + Assert.Equal(1, bytesRead); + } + + [Fact] + public void TryRead_FromReadOnlySpan_BufferNotEmpty_InitialTwoByteLengthMask_Buffer16BigEndian() + { + ReadOnlySpan readOnlySpan = new ReadOnlySpan(new byte[] + { + 64, + 1 + }); + bool isSuccess = VariableLengthIntegerHelper.TryRead(readOnlySpan, + out long value, out int bytesRead); + + Assert.True(isSuccess); + Assert.Equal(1, value); + Assert.Equal(2, bytesRead); + } + + [Fact] + public void TryRead_FromReadOnlySpan_BufferNotEmpty_InitialTwoByteLengthMask_BufferNot16BigEndian() + { + ReadOnlySpan readOnlySpan = new ReadOnlySpan(new byte[] + { + 64 + }); + bool isSuccess = VariableLengthIntegerHelper.TryRead(readOnlySpan, + out long value, out int bytesRead); + + Assert.False(isSuccess); + Assert.Equal(0, value); + Assert.Equal(0, bytesRead); + } + + [Fact] + public void TryRead_FromReadOnlySpan_BufferNotEmpty_InitialFourByteLengthMask_TryReadUInt32BigEndian() + { + ReadOnlySpan readOnlySpan = new ReadOnlySpan(new byte[] + { + 128, + 0, + 0, + 2 + }); + bool isSuccess = VariableLengthIntegerHelper.TryRead(readOnlySpan, + out long value, out int bytesRead); + + Assert.True(isSuccess); + Assert.Equal(2, value); + Assert.Equal(4, bytesRead); + } + + [Fact] + public void TryRead_FromReadOnlySpan_BufferNotEmpty_InitialFourByteLengthMask_TryReadNotUInt32BigEndian() + { + ReadOnlySpan readOnlySpan = new ReadOnlySpan(new byte[] + { + 128 + }); + bool isSuccess = VariableLengthIntegerHelper.TryRead(readOnlySpan, + out long value, out int bytesRead); + + Assert.False(isSuccess); + Assert.Equal(0, value); + Assert.Equal(0, bytesRead); + } + + [Fact] + public void TryRead_FromReadOnlySpan_BufferNotEmpty_InitialEightByteLengthMask_TryReadUInt64BigEndian() + { + ReadOnlySpan readOnlySpan = new ReadOnlySpan( + new byte[] + { + 192, 0, 0, 0, + 0, 0, 0, 4 + }); + bool isSuccess = VariableLengthIntegerHelper.TryRead(readOnlySpan, + out long value, out int bytesRead); + + Assert.True(isSuccess); + Assert.Equal(4, value); + Assert.Equal(8, bytesRead); + } + + [Fact] + public void TryRead_FromReadOnlySpan_BufferNotEmpty_InitialEightByteLengthMask_TryReadNotUInt64BigEndian() + { + ReadOnlySpan readOnlySpan = new ReadOnlySpan(new byte[] + { + 192 + }); + bool isSuccess = VariableLengthIntegerHelper.TryRead(readOnlySpan, + out long value, out int bytesRead); + + Assert.False(isSuccess); + Assert.Equal(0, value); + Assert.Equal(0, bytesRead); + } + + [Fact] + public void TryRead_FromSequenceReader_NotSegmentedSequence() + { + ReadOnlySequence readOnlySequence = new ReadOnlySequence(new byte[] + { + 1 + }); + SequenceReader sequenceReader = new SequenceReader(readOnlySequence); + bool isSuccess = VariableLengthIntegerHelper.TryRead(ref sequenceReader, + out long value); + + Assert.True(isSuccess); + Assert.Equal(1, value); + Assert.Equal(1, sequenceReader.CurrentSpanIndex); + } + + internal class MemorySegment : ReadOnlySequenceSegment + { + internal MemorySegment(ReadOnlyMemory memory) + { + Memory = memory; + } + + internal MemorySegment Append(ReadOnlyMemory memory) + { + var segment = new MemorySegment(memory) + { + RunningIndex = RunningIndex + Memory.Length + }; + + Next = segment; + + return segment; + } + } + + [Fact] + public void TryRead_FromSequenceReader_InitialTwoByteLengthMask_SegmentedSequence() + { + MemorySegment memorySegment1 = new MemorySegment(new byte[] { 64 }); + MemorySegment memorySegment2 = memorySegment1.Append(new byte[] { 1 }); + ReadOnlySequence readOnlySequence = new ReadOnlySequence( + memorySegment1, 0, memorySegment2, memorySegment2.Memory.Length); + SequenceReader sequenceReader = new SequenceReader(readOnlySequence); + bool isSuccess = VariableLengthIntegerHelper.TryRead(ref sequenceReader, + out long value); + + Assert.True(isSuccess); + Assert.Equal(1, value); + Assert.Equal(1, sequenceReader.CurrentSpanIndex); + } + + [Fact] + public void TryRead_FromSequenceReader_InitialFourByteLengthMask_SegmentedSequence() + { + MemorySegment memorySegment1 = new MemorySegment(new byte[] { 192 }); + MemorySegment memorySegment2 = memorySegment1.Append(new byte[] { 0, 0, 0, 0, 0, 0, 2 }); + ReadOnlySequence readOnlySequence = new ReadOnlySequence( + memorySegment1, 0, memorySegment2, memorySegment2.Memory.Length); + SequenceReader sequenceReader = new SequenceReader(readOnlySequence); + bool isSuccess = VariableLengthIntegerHelper.TryRead(ref sequenceReader, + out long value); + + Assert.True(isSuccess); + Assert.Equal(2, value); + Assert.Equal(7, sequenceReader.CurrentSpanIndex); + } + + [Fact] + public void TryRead_FromSequenceReader_NotValidSegmentedSequence() + { + MemorySegment memorySegment1 = new MemorySegment(new byte[] { 192 }); + MemorySegment memorySegment2 = memorySegment1.Append(new byte[] { 0, 0, 0, 0, 0, 2 }); + ReadOnlySequence readOnlySequence = new ReadOnlySequence( + memorySegment1, 0, memorySegment2, memorySegment2.Memory.Length); + SequenceReader sequenceReader = new SequenceReader(readOnlySequence); + bool isSuccess = VariableLengthIntegerHelper.TryRead(ref sequenceReader, + out long value); + + Assert.False(isSuccess); + Assert.Equal(0, value); + } + + [Fact] + public void GetInteger_ValidSegmentedSequence() + { + MemorySegment memorySegment1 = new MemorySegment(new byte[] { 192 }); + MemorySegment memorySegment2 = memorySegment1.Append(new byte[] { 0, 0, 0, 0, 0, 0, 2 }); + ReadOnlySequence readOnlySequence = new ReadOnlySequence( + memorySegment1, 0, memorySegment2, memorySegment2.Memory.Length); + long result = VariableLengthIntegerHelper.GetInteger(readOnlySequence, + out SequencePosition consumed, out SequencePosition examined); + + Assert.Equal(2, result); + Assert.Equal(7, consumed.GetInteger()); + Assert.Equal(7, examined.GetInteger()); + } + + [Fact] + public void GetInteger_NotValidSegmentedSequence() + { + MemorySegment memorySegment1 = new MemorySegment(new byte[] { 192 }); + MemorySegment memorySegment2 = memorySegment1.Append(new byte[] { 0, 0, 0, 0, 0, 2 }); + ReadOnlySequence readOnlySequence = new ReadOnlySequence( + memorySegment1, 0, memorySegment2, memorySegment2.Memory.Length); + long result = VariableLengthIntegerHelper.GetInteger(readOnlySequence, + out SequencePosition consumed, out SequencePosition examined); + + Assert.Equal(-1, result); + Assert.Equal(0, consumed.GetInteger()); + Assert.Equal(6, examined.GetInteger()); + } + + [Fact] + public void TryWrite_BufferEmpty() + { + Span span = new Span(); + long longToEncode = 1; + bool isSuccess = VariableLengthIntegerHelper.TryWrite(span, + longToEncode, out int bytesWritten); + + Assert.False(isSuccess); + Assert.Equal(0, bytesWritten); + } + + [Theory] + [InlineData(0)] + [InlineData(2)] + [InlineData(63)] + public void TryWrite_BufferNotEmpty_OneByteLimit(long longToEncode) + { + Span span = new Span(new byte[1]); + bool isSuccess = VariableLengthIntegerHelper.TryWrite(span, + longToEncode, out int bytesWritten); + + Assert.True(isSuccess); + Assert.Equal(1, bytesWritten); + Assert.Equal(longToEncode, span[0]); + } + + [Theory] + [InlineData(64, new byte[] { 64, 64 })] + [InlineData(66, new byte[] { 64, 66 })] + [InlineData(16383, new byte[] { 127, 255})] + public void TryWrite_BufferNotEmpty_TwoByteLimit(long longToEncode, + byte[] expected) + { + Span span = new Span(new byte[2]); + bool isSuccess = VariableLengthIntegerHelper.TryWrite(span, + longToEncode, out int bytesWritten); + + Assert.True(isSuccess); + Assert.Equal(2, bytesWritten); + Assert.Equal(expected, span.ToArray()); + } + + [Fact] + public void TryWrite_BufferNotSizedCorrectly_TwoByteLimit() + { + long longToEncode = 64; + Span span = new Span(new byte[1]); + bool isSuccess = VariableLengthIntegerHelper.TryWrite(span, + longToEncode, out int bytesWritten); + + Assert.False(isSuccess); + Assert.Equal(0, bytesWritten); + } + + [Theory] + [InlineData(16384, new byte[] {128, 0, 64, 0})] + [InlineData(16386, new byte[] { 128, 0, 64, 2 })] + [InlineData(1073741823, new byte[] { 191, 255, 255, 255 })] + public void TryWrite_BufferNotEmpty_FourByteLimit(long longToEncode, + byte[] expected) + { + Span span = new Span(new byte[4]); + bool isSuccess = VariableLengthIntegerHelper.TryWrite(span, + longToEncode, out int bytesWritten); + + Assert.True(isSuccess); + Assert.Equal(4, bytesWritten); + Assert.Equal(expected, span.ToArray()); + } + + [Fact] + public void TryWrite_BufferNotSizedCorrectly_FourByteLimit() + { + long longToEncode = 16384; + Span span = new Span(new byte[1]); + bool isSuccess = VariableLengthIntegerHelper.TryWrite(span, + longToEncode, out int bytesWritten); + + Assert.False(isSuccess); + Assert.Equal(0, bytesWritten); + } + + [Theory] + [InlineData(1073741824, new byte[] { 192, 0, 0, 0, 64, 0, 0, 0 })] + [InlineData(1073741826, new byte[] { 192, 0, 0, 0, 64, 0, 0, 2 })] + [InlineData(4611686018427387903, new byte[] { 255, 255, 255, 255, 255, 255, 255, 255 })] + public void TryWrite_BufferNotEmpty_EightByteLimit(long longToEncode, + byte[] expected) + { + Span span = new Span(new byte[8]); + bool isSuccess = VariableLengthIntegerHelper.TryWrite(span, + longToEncode, out int bytesWritten); + + Assert.True(isSuccess); + Assert.Equal(8, bytesWritten); + Assert.Equal(expected, span.ToArray()); + } + + [Fact] + public void TryWrite_BufferNotSizedCorrectly_EightByteLimit() + { + long longToEncode = 1073741824; + Span span = new Span(new byte[1]); + bool isSuccess = VariableLengthIntegerHelper.TryWrite(span, + longToEncode, out int bytesWritten); + + Assert.False(isSuccess); + Assert.Equal(0, bytesWritten); + } + + [Theory] + [InlineData(1, 1)] + [InlineData(64, 2)] + [InlineData(16384, 4)] + [InlineData(1073741824, 8)] + public void GetByteCountTest(long longToEncode, int expectedLimit) + { + int result = VariableLengthIntegerHelper.GetByteCount(longToEncode); + + Assert.Equal(expectedLimit, result); + } + } +} diff --git a/src/libraries/Microsoft.CSharp/src/ILLink/ILLink.Descriptors.Windows.xml b/src/libraries/Microsoft.CSharp/src/ILLink/ILLink.Descriptors.Windows.xml index 4bf5dd43f040f8..2bb2ba66d878ca 100644 --- a/src/libraries/Microsoft.CSharp/src/ILLink/ILLink.Descriptors.Windows.xml +++ b/src/libraries/Microsoft.CSharp/src/ILLink/ILLink.Descriptors.Windows.xml @@ -1,5 +1,5 @@ - + diff --git a/src/libraries/Microsoft.Extensions.Caching.Memory/ref/Microsoft.Extensions.Caching.Memory.cs b/src/libraries/Microsoft.Extensions.Caching.Memory/ref/Microsoft.Extensions.Caching.Memory.cs index ee0d00700c54be..9a4eef4661d42c 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Memory/ref/Microsoft.Extensions.Caching.Memory.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Memory/ref/Microsoft.Extensions.Caching.Memory.cs @@ -34,6 +34,7 @@ protected virtual void Dispose(bool disposing) { } ~MemoryCache() { } public void Remove(object key) { } public bool TryGetValue(object key, out object result) { throw null; } + public void Clear() { } } public partial class MemoryCacheOptions : Microsoft.Extensions.Options.IOptions { diff --git a/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCache.cs b/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCache.cs index 7c426014c4f5f3..b0d6c71eb60087 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCache.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCache.cs @@ -23,9 +23,8 @@ public class MemoryCache : IMemoryCache internal readonly ILogger _logger; private readonly MemoryCacheOptions _options; - private readonly ConcurrentDictionary _entries; - private long _cacheSize; + private CoherentState _coherentState; private bool _disposed; private DateTimeOffset _lastExpirationScan; @@ -56,7 +55,7 @@ public MemoryCache(IOptions optionsAccessor, ILoggerFactory _options = optionsAccessor.Value; _logger = loggerFactory.CreateLogger(); - _entries = new ConcurrentDictionary(); + _coherentState = new(); if (_options.Clock == null) { @@ -75,15 +74,13 @@ public MemoryCache(IOptions optionsAccessor, ILoggerFactory /// /// Gets the count of the current entries for diagnostic purposes. /// - public int Count => _entries.Count; + public int Count => _coherentState.Count; // internal for testing - internal long Size { get => Interlocked.Read(ref _cacheSize); } + internal long Size => _coherentState.Size; internal bool TrackLinkedCacheEntries { get; } - private ICollection> EntriesCollection => _entries; - /// public ICacheEntry CreateEntry(object key) { @@ -123,7 +120,8 @@ internal void SetEntry(CacheEntry entry) // Initialize the last access timestamp at the time the entry is added entry.LastAccessed = utcNow; - if (_entries.TryGetValue(entry.Key, out CacheEntry priorEntry)) + CoherentState coherentState = _coherentState; // Clear() can update the reference in the meantime + if (coherentState._entries.TryGetValue(entry.Key, out CacheEntry priorEntry)) { priorEntry.SetExpired(EvictionReason.Replaced); } @@ -133,13 +131,13 @@ internal void SetEntry(CacheEntry entry) entry.InvokeEvictionCallbacks(); if (priorEntry != null) { - RemoveEntry(priorEntry); + coherentState.RemoveEntry(priorEntry, _options); } StartScanForExpiredItemsIfNeeded(utcNow); return; } - bool exceedsCapacity = UpdateCacheSizeExceedsCapacity(entry); + bool exceedsCapacity = UpdateCacheSizeExceedsCapacity(entry, coherentState); if (!exceedsCapacity) { bool entryAdded = false; @@ -147,19 +145,19 @@ internal void SetEntry(CacheEntry entry) if (priorEntry == null) { // Try to add the new entry if no previous entries exist. - entryAdded = _entries.TryAdd(entry.Key, entry); + entryAdded = coherentState._entries.TryAdd(entry.Key, entry); } else { // Try to update with the new entry if a previous entries exist. - entryAdded = _entries.TryUpdate(entry.Key, entry, priorEntry); + entryAdded = coherentState._entries.TryUpdate(entry.Key, entry, priorEntry); if (entryAdded) { if (_options.SizeLimit.HasValue) { // The prior entry was removed, decrease the by the prior entry's size - Interlocked.Add(ref _cacheSize, -priorEntry.Size.Value); + Interlocked.Add(ref coherentState._cacheSize, -priorEntry.Size.Value); } } else @@ -167,7 +165,7 @@ internal void SetEntry(CacheEntry entry) // The update will fail if the previous entry was removed after retrival. // Adding the new entry will succeed only if no entry has been added since. // This guarantees removing an old entry does not prevent adding a new entry. - entryAdded = _entries.TryAdd(entry.Key, entry); + entryAdded = coherentState._entries.TryAdd(entry.Key, entry); } } @@ -180,7 +178,7 @@ internal void SetEntry(CacheEntry entry) if (_options.SizeLimit.HasValue) { // Entry could not be added, reset cache size - Interlocked.Add(ref _cacheSize, -entry.Size.Value); + Interlocked.Add(ref coherentState._cacheSize, -entry.Size.Value); } entry.SetExpired(EvictionReason.Replaced); entry.InvokeEvictionCallbacks(); @@ -198,7 +196,7 @@ internal void SetEntry(CacheEntry entry) entry.InvokeEvictionCallbacks(); if (priorEntry != null) { - RemoveEntry(priorEntry); + coherentState.RemoveEntry(priorEntry, _options); } } @@ -213,7 +211,8 @@ public bool TryGetValue(object key, out object result) DateTimeOffset utcNow = _options.Clock.UtcNow; - if (_entries.TryGetValue(key, out CacheEntry entry)) + CoherentState coherentState = _coherentState; // Clear() can update the reference in the meantime + if (coherentState._entries.TryGetValue(key, out CacheEntry entry)) { // Check if expired due to expiration tokens, timers, etc. and if so, remove it. // Allow a stale Replaced value to be returned due to concurrent calls to SetExpired during SetEntry. @@ -236,7 +235,7 @@ public bool TryGetValue(object key, out object result) else { // TODO: For efficiency queue this up for batch removal - RemoveEntry(entry); + coherentState.RemoveEntry(entry, _options); } } @@ -250,13 +249,14 @@ public bool TryGetValue(object key, out object result) public void Remove(object key) { ValidateCacheKey(key); - CheckDisposed(); - if (_entries.TryRemove(key, out CacheEntry entry)) + + CoherentState coherentState = _coherentState; // Clear() can update the reference in the meantime + if (coherentState._entries.TryRemove(key, out CacheEntry entry)) { if (_options.SizeLimit.HasValue) { - Interlocked.Add(ref _cacheSize, -entry.Size.Value); + Interlocked.Add(ref coherentState._cacheSize, -entry.Size.Value); } entry.SetExpired(EvictionReason.Removed); @@ -266,22 +266,25 @@ public void Remove(object key) StartScanForExpiredItemsIfNeeded(_options.Clock.UtcNow); } - private void RemoveEntry(CacheEntry entry) + /// + /// Removes all keys and values from the cache. + /// + public void Clear() { - if (EntriesCollection.Remove(new KeyValuePair(entry.Key, entry))) + CheckDisposed(); + + CoherentState oldState = Interlocked.Exchange(ref _coherentState, new CoherentState()); + foreach (var entry in oldState._entries) { - if (_options.SizeLimit.HasValue) - { - Interlocked.Add(ref _cacheSize, -entry.Size.Value); - } - entry.InvokeEvictionCallbacks(); + entry.Value.SetExpired(EvictionReason.Removed); + entry.Value.InvokeEvictionCallbacks(); } } internal void EntryExpired(CacheEntry entry) { // TODO: For efficiency consider processing these expirations in batches. - RemoveEntry(entry); + _coherentState.RemoveEntry(entry, _options); StartScanForExpiredItemsIfNeeded(_options.Clock.UtcNow); } @@ -307,18 +310,19 @@ private static void ScanForExpiredItems(MemoryCache cache) { DateTimeOffset now = cache._lastExpirationScan = cache._options.Clock.UtcNow; - foreach (KeyValuePair item in cache._entries) + CoherentState coherentState = cache._coherentState; // Clear() can update the reference in the meantime + foreach (KeyValuePair item in coherentState._entries) { CacheEntry entry = item.Value; if (entry.CheckExpired(now)) { - cache.RemoveEntry(entry); + coherentState.RemoveEntry(entry, cache._options); } } } - private bool UpdateCacheSizeExceedsCapacity(CacheEntry entry) + private bool UpdateCacheSizeExceedsCapacity(CacheEntry entry, CoherentState coherentState) { if (!_options.SizeLimit.HasValue) { @@ -328,7 +332,7 @@ private bool UpdateCacheSizeExceedsCapacity(CacheEntry entry) long newSize = 0L; for (int i = 0; i < 100; i++) { - long sizeRead = Interlocked.Read(ref _cacheSize); + long sizeRead = coherentState.Size; newSize = sizeRead + entry.Size.Value; if (newSize < 0 || newSize > _options.SizeLimit) @@ -337,7 +341,7 @@ private bool UpdateCacheSizeExceedsCapacity(CacheEntry entry) return true; } - if (sizeRead == Interlocked.CompareExchange(ref _cacheSize, newSize, sizeRead)) + if (sizeRead == Interlocked.CompareExchange(ref coherentState._cacheSize, newSize, sizeRead)) { return false; } @@ -356,17 +360,18 @@ private void TriggerOvercapacityCompaction() private static void OvercapacityCompaction(MemoryCache cache) { - long currentSize = Interlocked.Read(ref cache._cacheSize); + CoherentState coherentState = cache._coherentState; // Clear() can update the reference in the meantime + long currentSize = coherentState.Size; cache._logger.LogDebug($"Overcapacity compaction executing. Current size {currentSize}"); double? lowWatermark = cache._options.SizeLimit * (1 - cache._options.CompactionPercentage); if (currentSize > lowWatermark) { - cache.Compact(currentSize - (long)lowWatermark, entry => entry.Size.Value); + cache.Compact(currentSize - (long)lowWatermark, entry => entry.Size.Value, coherentState); } - cache._logger.LogDebug($"Overcapacity compaction executed. New size {Interlocked.Read(ref cache._cacheSize)}"); + cache._logger.LogDebug($"Overcapacity compaction executed. New size {coherentState.Size}"); } /// Remove at least the given percentage (0.10 for 10%) of the total entries (or estimated memory?), according to the following policy: @@ -378,11 +383,12 @@ private static void OvercapacityCompaction(MemoryCache cache) /// ?. Larger objects - estimated by object graph size, inaccurate. public void Compact(double percentage) { - int removalCountTarget = (int)(_entries.Count * percentage); - Compact(removalCountTarget, _ => 1); + CoherentState coherentState = _coherentState; // Clear() can update the reference in the meantime + int removalCountTarget = (int)(coherentState.Count * percentage); + Compact(removalCountTarget, _ => 1, coherentState); } - private void Compact(long removalSizeTarget, Func computeEntrySize) + private void Compact(long removalSizeTarget, Func computeEntrySize, CoherentState coherentState) { var entriesToRemove = new List(); var lowPriEntries = new List(); @@ -392,7 +398,7 @@ private void Compact(long removalSizeTarget, Func computeEntry // Sort items by expired & priority status DateTimeOffset now = _options.Clock.UtcNow; - foreach (KeyValuePair item in _entries) + foreach (KeyValuePair item in coherentState._entries) { CacheEntry entry = item.Value; if (entry.CheckExpired(now)) @@ -427,7 +433,7 @@ private void Compact(long removalSizeTarget, Func computeEntry foreach (CacheEntry entry in entriesToRemove) { - RemoveEntry(entry); + coherentState.RemoveEntry(entry, _options); } // Policy: @@ -500,5 +506,29 @@ private static void ValidateCacheKey(object key) static void Throw() => throw new ArgumentNullException(nameof(key)); } + + private sealed class CoherentState + { + internal ConcurrentDictionary _entries = new ConcurrentDictionary(); + internal long _cacheSize; + + private ICollection> EntriesCollection => _entries; + + internal int Count => _entries.Count; + + internal long Size => Interlocked.Read(ref _cacheSize); + + internal void RemoveEntry(CacheEntry entry, MemoryCacheOptions options) + { + if (EntriesCollection.Remove(new KeyValuePair(entry.Key, entry))) + { + if (options.SizeLimit.HasValue) + { + Interlocked.Add(ref _cacheSize, -entry.Size.Value); + } + entry.InvokeEvictionCallbacks(); + } + } + } } } diff --git a/src/libraries/Microsoft.Extensions.Caching.Memory/tests/CapacityTests.cs b/src/libraries/Microsoft.Extensions.Caching.Memory/tests/CapacityTests.cs index e4d5ef4893568f..79e09aaf54449c 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Memory/tests/CapacityTests.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Memory/tests/CapacityTests.cs @@ -444,5 +444,19 @@ public void NoCompactionWhenNoMaximumEntriesCountSpecified() // There should be 6 items in the cache Assert.Equal(6, cache.Count); } + + [Fact] + public void ClearZeroesTheSize() + { + var cache = new MemoryCache(new MemoryCacheOptions { SizeLimit = 10 }); + Assert.Equal(0, cache.Size); + + cache.Set("key", "value", new MemoryCacheEntryOptions { Size = 5 }); + Assert.Equal(5, cache.Size); + + cache.Clear(); + Assert.Equal(0, cache.Size); + Assert.Equal(0, cache.Count); + } } } diff --git a/src/libraries/Microsoft.Extensions.Caching.Memory/tests/MemoryCacheSetAndRemoveTests.cs b/src/libraries/Microsoft.Extensions.Caching.Memory/tests/MemoryCacheSetAndRemoveTests.cs index 65810e352e9270..28ad9ebebf7957 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Memory/tests/MemoryCacheSetAndRemoveTests.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Memory/tests/MemoryCacheSetAndRemoveTests.cs @@ -380,6 +380,29 @@ public void RemoveRemoves() Assert.Null(result); } + [Fact] + public void ClearClears() + { + var cache = (MemoryCache)CreateCache(); + var obj = new object(); + string[] keys = new string[] { "key1", "key2", "key3", "key4" }; + + foreach (string key in keys) + { + var result = cache.Set(key, obj); + Assert.Same(obj, result); + Assert.Same(obj, cache.Get(key)); + } + + cache.Clear(); + + Assert.Equal(0, cache.Count); + foreach (string key in keys) + { + Assert.Null(cache.Get(key)); + } + } + [Fact] public void RemoveRemovesAndInvokesCallback() { @@ -411,6 +434,38 @@ public void RemoveRemovesAndInvokesCallback() Assert.Null(result); } + [Fact] + public void ClearClearsAndInvokesCallback() + { + var cache = (MemoryCache)CreateCache(); + var value = new object(); + string key = "myKey"; + var callbackInvoked = new ManualResetEvent(false); + + var options = new MemoryCacheEntryOptions(); + options.PostEvictionCallbacks.Add(new PostEvictionCallbackRegistration() + { + EvictionCallback = (subkey, subValue, reason, state) => + { + Assert.Equal(key, subkey); + Assert.Same(value, subValue); + Assert.Equal(EvictionReason.Removed, reason); + var localCallbackInvoked = (ManualResetEvent)state; + localCallbackInvoked.Set(); + }, + State = callbackInvoked + }); + var result = cache.Set(key, value, options); + Assert.Same(value, result); + + cache.Clear(); + Assert.Equal(0, cache.Count); + Assert.True(callbackInvoked.WaitOne(TimeSpan.FromSeconds(30)), "Callback"); + + result = cache.Get(key); + Assert.Null(result); + } + [Fact] public void RemoveAndReAddFromCallbackWorks() { diff --git a/src/libraries/Microsoft.Extensions.Caching.Memory/tests/TokenExpirationTests.cs b/src/libraries/Microsoft.Extensions.Caching.Memory/tests/TokenExpirationTests.cs index 182d53cf2e8b98..d55be43c633640 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Memory/tests/TokenExpirationTests.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Memory/tests/TokenExpirationTests.cs @@ -162,6 +162,29 @@ public void RemoveItemDisposesTokenRegistration() Assert.True(callbackInvoked.WaitOne(TimeSpan.FromSeconds(30)), "Callback"); } + [Fact] + public void ClearingCacheDisposesTokenRegistration() + { + var cache = (MemoryCache)CreateCache(); + string key = "myKey"; + var value = new object(); + var callbackInvoked = new ManualResetEvent(false); + var expirationToken = new TestExpirationToken() { ActiveChangeCallbacks = true }; + cache.Set(key, value, new MemoryCacheEntryOptions() + .AddExpirationToken(expirationToken) + .RegisterPostEvictionCallback((subkey, subValue, reason, state) => + { + var localCallbackInvoked = (ManualResetEvent)state; + localCallbackInvoked.Set(); + }, state: callbackInvoked)); + cache.Clear(); + + Assert.Equal(0, cache.Count); + Assert.NotNull(expirationToken.Registration); + Assert.True(expirationToken.Registration.Disposed); + Assert.True(callbackInvoked.WaitOne(TimeSpan.FromSeconds(30)), "Callback"); + } + [Fact] public void AddExpiredTokenPreventsCaching() { diff --git a/src/libraries/Microsoft.Extensions.Configuration.Abstractions/ref/Microsoft.Extensions.Configuration.Abstractions.csproj b/src/libraries/Microsoft.Extensions.Configuration.Abstractions/ref/Microsoft.Extensions.Configuration.Abstractions.csproj index 3e4c0cc8363b97..3354e287285355 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Abstractions/ref/Microsoft.Extensions.Configuration.Abstractions.csproj +++ b/src/libraries/Microsoft.Extensions.Configuration.Abstractions/ref/Microsoft.Extensions.Configuration.Abstractions.csproj @@ -1,6 +1,6 @@ - $(NetCoreAppCurrent);netstandard2.0;$(NetFrameworkMinimum) + $(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) enable @@ -9,8 +9,12 @@ - - + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Configuration.Abstractions/src/Microsoft.Extensions.Configuration.Abstractions.csproj b/src/libraries/Microsoft.Extensions.Configuration.Abstractions/src/Microsoft.Extensions.Configuration.Abstractions.csproj index 49aabd359e3fce..03f61f772b639d 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Abstractions/src/Microsoft.Extensions.Configuration.Abstractions.csproj +++ b/src/libraries/Microsoft.Extensions.Configuration.Abstractions/src/Microsoft.Extensions.Configuration.Abstractions.csproj @@ -1,7 +1,7 @@ - $(NetCoreAppCurrent);netstandard2.0;$(NetFrameworkMinimum) + $(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) enable true diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/ref/Microsoft.Extensions.Configuration.Binder.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/ref/Microsoft.Extensions.Configuration.Binder.cs index 30cdeda1b712dd..efcb740d6663b8 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Binder/ref/Microsoft.Extensions.Configuration.Binder.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/ref/Microsoft.Extensions.Configuration.Binder.cs @@ -15,26 +15,26 @@ public BinderOptions() { } public static partial class ConfigurationBinder { [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Cannot statically analyze the type of instance so its members may be trimmed")] - public static void Bind(this Microsoft.Extensions.Configuration.IConfiguration configuration, object instance) { } + public static void Bind(this Microsoft.Extensions.Configuration.IConfiguration configuration, object? instance) { } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Cannot statically analyze the type of instance so its members may be trimmed")] - public static void Bind(this Microsoft.Extensions.Configuration.IConfiguration configuration, object instance, System.Action configureOptions) { } + public static void Bind(this Microsoft.Extensions.Configuration.IConfiguration configuration, object? instance, System.Action? configureOptions) { } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Cannot statically analyze the type of instance so its members may be trimmed")] - public static void Bind(this Microsoft.Extensions.Configuration.IConfiguration configuration, string key, object instance) { } + public static void Bind(this Microsoft.Extensions.Configuration.IConfiguration configuration, string key, object? instance) { } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")] - public static object Get(this Microsoft.Extensions.Configuration.IConfiguration configuration, System.Type type) { throw null; } + public static object? Get(this Microsoft.Extensions.Configuration.IConfiguration configuration, System.Type type) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")] - public static object Get(this Microsoft.Extensions.Configuration.IConfiguration configuration, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type type, System.Action configureOptions) { throw null; } + public static object? Get(this Microsoft.Extensions.Configuration.IConfiguration configuration, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type type, System.Action? configureOptions) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")] - public static object GetValue(this Microsoft.Extensions.Configuration.IConfiguration configuration, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type type, string key) { throw null; } + public static object? GetValue(this Microsoft.Extensions.Configuration.IConfiguration configuration, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type type, string key) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")] - public static object GetValue(this Microsoft.Extensions.Configuration.IConfiguration configuration, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type type, string key, object defaultValue) { throw null; } + public static object? GetValue(this Microsoft.Extensions.Configuration.IConfiguration configuration, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type type, string key, object defaultValue) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")] - public static T GetValue<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] T>(this Microsoft.Extensions.Configuration.IConfiguration configuration, string key) { throw null; } + public static T? GetValue<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] T>(this Microsoft.Extensions.Configuration.IConfiguration configuration, string key) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")] - public static T GetValue<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] T>(this Microsoft.Extensions.Configuration.IConfiguration configuration, string key, T defaultValue) { throw null; } + public static T? GetValue<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] T>(this Microsoft.Extensions.Configuration.IConfiguration configuration, string key, T defaultValue) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")] - public static T Get<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] T>(this Microsoft.Extensions.Configuration.IConfiguration configuration) { throw null; } + public static T? Get<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] T>(this Microsoft.Extensions.Configuration.IConfiguration configuration) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("In case the type is non-primitive, the trimmer cannot statically analyze the object's type so its members may be trimmed.")] - public static T Get<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] T>(this Microsoft.Extensions.Configuration.IConfiguration configuration, System.Action configureOptions) { throw null; } + public static T? Get<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] T>(this Microsoft.Extensions.Configuration.IConfiguration configuration, System.Action? configureOptions) { throw null; } } } diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/ref/Microsoft.Extensions.Configuration.Binder.csproj b/src/libraries/Microsoft.Extensions.Configuration.Binder/ref/Microsoft.Extensions.Configuration.Binder.csproj index 154dc3b84a94f7..fefa5f0049cae7 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Binder/ref/Microsoft.Extensions.Configuration.Binder.csproj +++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/ref/Microsoft.Extensions.Configuration.Binder.csproj @@ -1,14 +1,26 @@ - netstandard2.0;$(NetFrameworkMinimum) + $(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) + enable - + + + + + + + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/src/ConfigurationBinder.cs b/src/libraries/Microsoft.Extensions.Configuration.Binder/src/ConfigurationBinder.cs index 2cbcfbb1c089e5..993eb965c73d25 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Binder/src/ConfigurationBinder.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/src/ConfigurationBinder.cs @@ -29,7 +29,7 @@ public static class ConfigurationBinder /// The configuration instance to bind. /// The new instance of T if successful, default(T) otherwise. [RequiresUnreferencedCode(TrimmingWarningMessage)] - public static T Get<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(this IConfiguration configuration) + public static T? Get<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(this IConfiguration configuration) => configuration.Get(_ => { }); /// @@ -42,14 +42,14 @@ public static class ConfigurationBinder /// Configures the binder options. /// The new instance of T if successful, default(T) otherwise. [RequiresUnreferencedCode(TrimmingWarningMessage)] - public static T Get<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(this IConfiguration configuration, Action configureOptions) + public static T? Get<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(this IConfiguration configuration, Action? configureOptions) { if (configuration == null) { throw new ArgumentNullException(nameof(configuration)); } - object result = configuration.Get(typeof(T), configureOptions); + object? result = configuration.Get(typeof(T), configureOptions); if (result == null) { return default(T); @@ -66,7 +66,7 @@ public static class ConfigurationBinder /// The type of the new instance to bind. /// The new instance if successful, null otherwise. [RequiresUnreferencedCode(TrimmingWarningMessage)] - public static object Get(this IConfiguration configuration, Type type) + public static object? Get(this IConfiguration configuration, Type type) => configuration.Get(type, _ => { }); /// @@ -79,11 +79,11 @@ public static object Get(this IConfiguration configuration, Type type) /// Configures the binder options. /// The new instance if successful, null otherwise. [RequiresUnreferencedCode(TrimmingWarningMessage)] - public static object Get( + public static object? Get( this IConfiguration configuration, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, - Action configureOptions) + Action? configureOptions) { if (configuration == null) { @@ -102,7 +102,7 @@ public static object Get( /// The key of the configuration section to bind. /// The object to bind. [RequiresUnreferencedCode(InstanceGetTypeTrimmingWarningMessage)] - public static void Bind(this IConfiguration configuration, string key, object instance) + public static void Bind(this IConfiguration configuration, string key, object? instance) => configuration.GetSection(key).Bind(instance); /// @@ -111,8 +111,8 @@ public static void Bind(this IConfiguration configuration, string key, object in /// The configuration instance to bind. /// The object to bind. [RequiresUnreferencedCode(InstanceGetTypeTrimmingWarningMessage)] - public static void Bind(this IConfiguration configuration, object instance) - => configuration.Bind(instance, o => { }); + public static void Bind(this IConfiguration configuration, object? instance) + => configuration.Bind(instance, _ => { }); /// /// Attempts to bind the given object instance to configuration values by matching property names against configuration keys recursively. @@ -121,7 +121,7 @@ public static void Bind(this IConfiguration configuration, object instance) /// The object to bind. /// Configures the binder options. [RequiresUnreferencedCode(InstanceGetTypeTrimmingWarningMessage)] - public static void Bind(this IConfiguration configuration, object instance, Action configureOptions) + public static void Bind(this IConfiguration configuration, object? instance, Action? configureOptions) { if (configuration == null) { @@ -144,7 +144,7 @@ public static void Bind(this IConfiguration configuration, object instance, Acti /// The key of the configuration section's value to convert. /// The converted value. [RequiresUnreferencedCode(TrimmingWarningMessage)] - public static T GetValue<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(this IConfiguration configuration, string key) + public static T? GetValue<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(this IConfiguration configuration, string key) { return GetValue(configuration, key, default(T)); } @@ -158,9 +158,9 @@ public static void Bind(this IConfiguration configuration, object instance, Acti /// The default value to use if no value is found. /// The converted value. [RequiresUnreferencedCode(TrimmingWarningMessage)] - public static T GetValue<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(this IConfiguration configuration, string key, T defaultValue) + public static T? GetValue<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] T>(this IConfiguration configuration, string key, T defaultValue) { - return (T)GetValue(configuration, typeof(T), key, defaultValue); + return (T?)GetValue(configuration, typeof(T), key, defaultValue); } /// @@ -171,7 +171,7 @@ public static void Bind(this IConfiguration configuration, object instance, Acti /// The key of the configuration section's value to convert. /// The converted value. [RequiresUnreferencedCode(TrimmingWarningMessage)] - public static object GetValue( + public static object? GetValue( this IConfiguration configuration, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, @@ -189,14 +189,14 @@ public static object GetValue( /// The default value to use if no value is found. /// The converted value. [RequiresUnreferencedCode(TrimmingWarningMessage)] - public static object GetValue( + public static object? GetValue( this IConfiguration configuration, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, string key, - object defaultValue) + object? defaultValue) { IConfigurationSection section = configuration.GetSection(key); - string value = section.Value; + string? value = section.Value; if (value != null) { return ConvertValue(type, value, section.Path); @@ -205,7 +205,7 @@ public static object GetValue( } [RequiresUnreferencedCode(PropertyTrimmingWarningMessage)] - private static void BindNonScalar(this IConfiguration configuration, object instance, BinderOptions options) + private static void BindNonScalar(this IConfiguration configuration, object? instance, BinderOptions options) { if (instance != null) { @@ -256,7 +256,7 @@ private static void BindProperty(PropertyInfo property, object instance, IConfig return; } - object propertyValue = GetPropertyValue(property, instance, config, options); + object? propertyValue = GetPropertyValue(property, instance, config, options); if (propertyValue != null) { @@ -265,17 +265,17 @@ private static void BindProperty(PropertyInfo property, object instance, IConfig } [RequiresUnreferencedCode("Cannot statically analyze what the element type is of the object collection in type so its members may be trimmed.")] - private static object BindToCollection(Type type, IConfiguration config, BinderOptions options) + private static object? BindToCollection(Type type, IConfiguration config, BinderOptions options) { Type genericType = typeof(List<>).MakeGenericType(type.GenericTypeArguments[0]); - object instance = Activator.CreateInstance(genericType); + object? instance = Activator.CreateInstance(genericType); BindCollection(instance, genericType, config, options); return instance; } // Try to create an array/dictionary instance to back various collection interfaces [RequiresUnreferencedCode("In case type is a Dictionary, cannot statically analyze what the element type is of the value objects in the dictionary so its members may be trimmed.")] - private static object AttemptBindToCollectionInterfaces( + private static object? AttemptBindToCollectionInterfaces( [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, IConfiguration config, BinderOptions options) @@ -285,7 +285,7 @@ private static object AttemptBindToCollectionInterfaces( return null; } - Type collectionInterface = FindOpenGenericInterface(typeof(IReadOnlyList<>), type); + Type? collectionInterface = FindOpenGenericInterface(typeof(IReadOnlyList<>), type); if (collectionInterface != null) { // IEnumerable is guaranteed to have exactly one parameter @@ -296,7 +296,7 @@ private static object AttemptBindToCollectionInterfaces( if (collectionInterface != null) { Type dictionaryType = typeof(Dictionary<,>).MakeGenericType(type.GenericTypeArguments[0], type.GenericTypeArguments[1]); - object instance = Activator.CreateInstance(dictionaryType); + object? instance = Activator.CreateInstance(dictionaryType); BindDictionary(instance, dictionaryType, config, options); return instance; } @@ -304,7 +304,7 @@ private static object AttemptBindToCollectionInterfaces( collectionInterface = FindOpenGenericInterface(typeof(IDictionary<,>), type); if (collectionInterface != null) { - object instance = Activator.CreateInstance(typeof(Dictionary<,>).MakeGenericType(type.GenericTypeArguments[0], type.GenericTypeArguments[1])); + object? instance = Activator.CreateInstance(typeof(Dictionary<,>).MakeGenericType(type.GenericTypeArguments[0], type.GenericTypeArguments[1])); BindDictionary(instance, collectionInterface, config, options); return instance; } @@ -334,10 +334,10 @@ private static object AttemptBindToCollectionInterfaces( } [RequiresUnreferencedCode(TrimmingWarningMessage)] - private static object BindInstance( + private static object? BindInstance( [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, - object instance, IConfiguration config, BinderOptions options) + object? instance, IConfiguration config, BinderOptions options) { // if binding IConfigurationSection, break early if (type == typeof(IConfigurationSection)) @@ -346,10 +346,8 @@ private static object BindInstance( } var section = config as IConfigurationSection; - string configValue = section?.Value; - object convertedValue; - Exception error; - if (configValue != null && TryConvertValue(type, configValue, section.Path, out convertedValue, out error)) + string? configValue = section?.Value; + if (configValue != null && TryConvertValue(type, configValue, section?.Path, out object? convertedValue, out Exception? error)) { if (error != null) { @@ -376,14 +374,14 @@ private static object BindInstance( } // See if its a Dictionary - Type collectionInterface = FindOpenGenericInterface(typeof(IDictionary<,>), type); + Type? collectionInterface = FindOpenGenericInterface(typeof(IDictionary<,>), type); if (collectionInterface != null) { BindDictionary(instance, collectionInterface, config, options); } else if (type.IsArray) { - instance = BindArray((Array)instance, config, options); + instance = BindArray((Array)instance!, config, options); } else { @@ -404,7 +402,7 @@ private static object BindInstance( return instance; } - private static object CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type type) + private static object? CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type type) { if (type.IsInterface || type.IsAbstract) { @@ -418,7 +416,7 @@ private static object CreateInstance([DynamicallyAccessedMembers(DynamicallyAcce throw new InvalidOperationException(SR.Format(SR.Error_UnsupportedMultidimensionalArray, type)); } - return Array.CreateInstance(type.GetElementType(), 0); + return Array.CreateInstance(type.GetElementType()!, 0); } if (!type.IsValueType) @@ -442,7 +440,7 @@ private static object CreateInstance([DynamicallyAccessedMembers(DynamicallyAcce [RequiresUnreferencedCode("Cannot statically analyze what the element type is of the value objects in the dictionary so its members may be trimmed.")] private static void BindDictionary( - object dictionary, + object? dictionary, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties)] Type dictionaryType, IConfiguration config, BinderOptions options) @@ -458,10 +456,10 @@ private static void BindDictionary( return; } - PropertyInfo setter = dictionaryType.GetProperty("Item", DeclaredOnlyLookup); + PropertyInfo setter = dictionaryType.GetProperty("Item", DeclaredOnlyLookup)!; foreach (IConfigurationSection child in config.GetChildren()) { - object item = BindInstance( + object? item = BindInstance( type: valueType, instance: null, config: child, @@ -484,27 +482,27 @@ private static void BindDictionary( [RequiresUnreferencedCode("Cannot statically analyze what the element type is of the object collection so its members may be trimmed.")] private static void BindCollection( - object collection, + object? collection, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type collectionType, IConfiguration config, BinderOptions options) { // ICollection is guaranteed to have exactly one parameter Type itemType = collectionType.GenericTypeArguments[0]; - MethodInfo addMethod = collectionType.GetMethod("Add", DeclaredOnlyLookup); + MethodInfo? addMethod = collectionType.GetMethod("Add", DeclaredOnlyLookup); foreach (IConfigurationSection section in config.GetChildren()) { try { - object item = BindInstance( + object? item = BindInstance( type: itemType, instance: null, config: section, options: options); if (item != null) { - addMethod.Invoke(collection, new[] { item }); + addMethod?.Invoke(collection, new[] { item }); } } catch @@ -518,7 +516,7 @@ private static Array BindArray(Array source, IConfiguration config, BinderOption { IConfigurationSection[] children = config.GetChildren().ToArray(); int arrayLength = source.Length; - Type elementType = source.GetType().GetElementType(); + Type? elementType = source.GetType().GetElementType()!; var newArray = Array.CreateInstance(elementType, arrayLength + children.Length); // binding to array has to preserve already initialized arrays with values @@ -531,7 +529,7 @@ private static Array BindArray(Array source, IConfiguration config, BinderOption { try { - object item = BindInstance( + object? item = BindInstance( type: elementType, instance: null, config: children[i], @@ -553,7 +551,7 @@ private static Array BindArray(Array source, IConfiguration config, BinderOption private static bool TryConvertValue( [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, - string value, string path, out object result, out Exception error) + string value, string? path, out object? result, out Exception? error) { error = null; result = null; @@ -569,7 +567,7 @@ private static bool TryConvertValue( { return true; } - return TryConvertValue(Nullable.GetUnderlyingType(type), value, path, out result, out error); + return TryConvertValue(Nullable.GetUnderlyingType(type)!, value, path, out result, out error); } TypeConverter converter = TypeDescriptor.GetConverter(type); @@ -603,14 +601,12 @@ private static bool TryConvertValue( } [RequiresUnreferencedCode(TrimmingWarningMessage)] - private static object ConvertValue( + private static object? ConvertValue( [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type type, - string value, string path) + string value, string? path) { - object result; - Exception error; - TryConvertValue(type, value, path, out result, out error); + TryConvertValue(type, value, path, out object? result, out Exception? error); if (error != null) { throw error; @@ -618,7 +614,7 @@ private static object ConvertValue( return result; } - private static Type FindOpenGenericInterface( + private static Type? FindOpenGenericInterface( Type expected, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.Interfaces)] Type actual) @@ -647,18 +643,19 @@ private static List GetAllProperties( { var allProperties = new List(); + Type? baseType = type; do { - allProperties.AddRange(type.GetProperties(DeclaredOnlyLookup)); - type = type.BaseType; + allProperties.AddRange(baseType!.GetProperties(DeclaredOnlyLookup)); + baseType = baseType.BaseType; } - while (type != typeof(object)); + while (baseType != typeof(object)); return allProperties; } [RequiresUnreferencedCode(PropertyTrimmingWarningMessage)] - private static object GetPropertyValue(PropertyInfo property, object instance, IConfiguration config, BinderOptions options) + private static object? GetPropertyValue(PropertyInfo property, object instance, IConfiguration config, BinderOptions options) { string propertyName = GetPropertyName(property); return BindInstance( @@ -690,7 +687,7 @@ private static string GetPropertyName(MemberInfo property) } // Assumes ConfigurationKeyName constructor first arg is the string key name - string name = attributeData + string? name = attributeData .ConstructorArguments[0] .Value? .ToString(); diff --git a/src/libraries/Microsoft.Extensions.Configuration.Binder/src/Microsoft.Extensions.Configuration.Binder.csproj b/src/libraries/Microsoft.Extensions.Configuration.Binder/src/Microsoft.Extensions.Configuration.Binder.csproj index 6f384e43a071bf..a04a112aee18a9 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Binder/src/Microsoft.Extensions.Configuration.Binder.csproj +++ b/src/libraries/Microsoft.Extensions.Configuration.Binder/src/Microsoft.Extensions.Configuration.Binder.csproj @@ -1,13 +1,19 @@ - netstandard2.0;$(NetFrameworkMinimum) + $(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) + enable true + + false Functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration. + + + diff --git a/src/libraries/Microsoft.Extensions.Configuration.CommandLine/ref/Microsoft.Extensions.Configuration.CommandLine.cs b/src/libraries/Microsoft.Extensions.Configuration.CommandLine/ref/Microsoft.Extensions.Configuration.CommandLine.cs index 0e629f4f11569a..b1d4b8e21e3832 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.CommandLine/ref/Microsoft.Extensions.Configuration.CommandLine.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.CommandLine/ref/Microsoft.Extensions.Configuration.CommandLine.cs @@ -8,16 +8,16 @@ namespace Microsoft.Extensions.Configuration { public static partial class CommandLineConfigurationExtensions { - public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddCommandLine(this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, System.Action configureSource) { throw null; } + public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddCommandLine(this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, System.Action? configureSource) { throw null; } public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddCommandLine(this Microsoft.Extensions.Configuration.IConfigurationBuilder configurationBuilder, string[] args) { throw null; } - public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddCommandLine(this Microsoft.Extensions.Configuration.IConfigurationBuilder configurationBuilder, string[] args, System.Collections.Generic.IDictionary switchMappings) { throw null; } + public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddCommandLine(this Microsoft.Extensions.Configuration.IConfigurationBuilder configurationBuilder, string[] args, System.Collections.Generic.IDictionary? switchMappings) { throw null; } } } namespace Microsoft.Extensions.Configuration.CommandLine { public partial class CommandLineConfigurationProvider : Microsoft.Extensions.Configuration.ConfigurationProvider { - public CommandLineConfigurationProvider(System.Collections.Generic.IEnumerable args, System.Collections.Generic.IDictionary switchMappings = null) { } + public CommandLineConfigurationProvider(System.Collections.Generic.IEnumerable args, System.Collections.Generic.IDictionary? switchMappings = null) { } protected System.Collections.Generic.IEnumerable Args { get { throw null; } } public override void Load() { } } @@ -25,7 +25,7 @@ public partial class CommandLineConfigurationSource : Microsoft.Extensions.Confi { public CommandLineConfigurationSource() { } public System.Collections.Generic.IEnumerable Args { get { throw null; } set { } } - public System.Collections.Generic.IDictionary SwitchMappings { get { throw null; } set { } } + public System.Collections.Generic.IDictionary? SwitchMappings { get { throw null; } set { } } public Microsoft.Extensions.Configuration.IConfigurationProvider Build(Microsoft.Extensions.Configuration.IConfigurationBuilder builder) { throw null; } } } diff --git a/src/libraries/Microsoft.Extensions.Configuration.CommandLine/ref/Microsoft.Extensions.Configuration.CommandLine.csproj b/src/libraries/Microsoft.Extensions.Configuration.CommandLine/ref/Microsoft.Extensions.Configuration.CommandLine.csproj index e4886f5e0b6970..5be8641b376137 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.CommandLine/ref/Microsoft.Extensions.Configuration.CommandLine.csproj +++ b/src/libraries/Microsoft.Extensions.Configuration.CommandLine/ref/Microsoft.Extensions.Configuration.CommandLine.csproj @@ -1,10 +1,20 @@ - netstandard2.0;$(NetFrameworkMinimum) + $(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) + enable + + + + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/CommandLineConfigurationExtensions.cs b/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/CommandLineConfigurationExtensions.cs index c5e7ee43326fbf..b39998e4d91d7e 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/CommandLineConfigurationExtensions.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/CommandLineConfigurationExtensions.cs @@ -152,7 +152,7 @@ public static IConfigurationBuilder AddCommandLine(this IConfigurationBuilder co public static IConfigurationBuilder AddCommandLine( this IConfigurationBuilder configurationBuilder, string[] args, - IDictionary switchMappings) + IDictionary? switchMappings) { configurationBuilder.Add(new CommandLineConfigurationSource { Args = args, SwitchMappings = switchMappings }); return configurationBuilder; @@ -164,7 +164,7 @@ public static IConfigurationBuilder AddCommandLine( /// The to add to. /// Configures the source. /// The . - public static IConfigurationBuilder AddCommandLine(this IConfigurationBuilder builder, Action configureSource) + public static IConfigurationBuilder AddCommandLine(this IConfigurationBuilder builder, Action? configureSource) => builder.Add(configureSource); } } diff --git a/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/CommandLineConfigurationProvider.cs b/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/CommandLineConfigurationProvider.cs index fb1b17a5216304..a41d6f541d02fe 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/CommandLineConfigurationProvider.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/CommandLineConfigurationProvider.cs @@ -11,14 +11,14 @@ namespace Microsoft.Extensions.Configuration.CommandLine /// public class CommandLineConfigurationProvider : ConfigurationProvider { - private readonly Dictionary _switchMappings; + private readonly Dictionary? _switchMappings; /// /// Initializes a new instance. /// /// The command line args. /// The switch mappings. - public CommandLineConfigurationProvider(IEnumerable args, IDictionary switchMappings = null) + public CommandLineConfigurationProvider(IEnumerable args, IDictionary? switchMappings = null) { Args = args ?? throw new ArgumentNullException(nameof(args)); @@ -38,7 +38,7 @@ public CommandLineConfigurationProvider(IEnumerable args, IDictionary public override void Load() { - var data = new Dictionary(StringComparer.OrdinalIgnoreCase); + var data = new Dictionary(StringComparer.OrdinalIgnoreCase); string key, value; using (IEnumerator enumerator = Args.GetEnumerator()) @@ -68,7 +68,7 @@ public override void Load() if (separator < 0) { - // If there is neither equal sign nor prefix in current arugment, it is an invalid format + // If there is neither equal sign nor prefix in current argument, it is an invalid format if (keyStartIndex == 0) { // Ignore invalid formats @@ -76,7 +76,7 @@ public override void Load() } // If the switch is a key in given switch mappings, interpret it - if (_switchMappings != null && _switchMappings.TryGetValue(currentArg, out string mappedKey)) + if (_switchMappings != null && _switchMappings.TryGetValue(currentArg, out string? mappedKey)) { key = mappedKey; } @@ -105,7 +105,7 @@ public override void Load() string keySegment = currentArg.Substring(0, separator); // If the switch is a key in given switch mappings, interpret it - if (_switchMappings != null && _switchMappings.TryGetValue(keySegment, out string mappedKeySegment)) + if (_switchMappings != null && _switchMappings.TryGetValue(keySegment, out string? mappedKeySegment)) { key = mappedKeySegment; } diff --git a/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/CommandLineConfigurationSource.cs b/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/CommandLineConfigurationSource.cs index 36a665e360a48e..1dc7ad911811c0 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/CommandLineConfigurationSource.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/CommandLineConfigurationSource.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Collections.Generic; namespace Microsoft.Extensions.Configuration.CommandLine @@ -13,12 +14,12 @@ public class CommandLineConfigurationSource : IConfigurationSource /// /// Gets or sets the switch mappings. /// - public IDictionary SwitchMappings { get; set; } + public IDictionary? SwitchMappings { get; set; } /// /// Gets or sets the command line args. /// - public IEnumerable Args { get; set; } + public IEnumerable Args { get; set; } = Array.Empty(); /// /// Builds the for this source. diff --git a/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/Microsoft.Extensions.Configuration.CommandLine.csproj b/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/Microsoft.Extensions.Configuration.CommandLine.csproj index 8a5598960f20e7..bf8e1cce4abb2f 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/Microsoft.Extensions.Configuration.CommandLine.csproj +++ b/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/Microsoft.Extensions.Configuration.CommandLine.csproj @@ -1,8 +1,11 @@ - netstandard2.0;$(NetFrameworkMinimum) + $(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) + enable true + + false Command line configuration provider implementation for Microsoft.Extensions.Configuration. diff --git a/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/ref/Microsoft.Extensions.Configuration.EnvironmentVariables.cs b/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/ref/Microsoft.Extensions.Configuration.EnvironmentVariables.cs index 5292b3f6d90503..6be0732e7d2f4d 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/ref/Microsoft.Extensions.Configuration.EnvironmentVariables.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/ref/Microsoft.Extensions.Configuration.EnvironmentVariables.cs @@ -9,8 +9,8 @@ namespace Microsoft.Extensions.Configuration public static partial class EnvironmentVariablesExtensions { public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddEnvironmentVariables(this Microsoft.Extensions.Configuration.IConfigurationBuilder configurationBuilder) { throw null; } - public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddEnvironmentVariables(this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, System.Action configureSource) { throw null; } - public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddEnvironmentVariables(this Microsoft.Extensions.Configuration.IConfigurationBuilder configurationBuilder, string prefix) { throw null; } + public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddEnvironmentVariables(this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, System.Action? configureSource) { throw null; } + public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddEnvironmentVariables(this Microsoft.Extensions.Configuration.IConfigurationBuilder configurationBuilder, string? prefix) { throw null; } } } namespace Microsoft.Extensions.Configuration.EnvironmentVariables @@ -18,14 +18,14 @@ namespace Microsoft.Extensions.Configuration.EnvironmentVariables public partial class EnvironmentVariablesConfigurationProvider : Microsoft.Extensions.Configuration.ConfigurationProvider { public EnvironmentVariablesConfigurationProvider() { } - public EnvironmentVariablesConfigurationProvider(string prefix) { } + public EnvironmentVariablesConfigurationProvider(string? prefix) { } public override void Load() { } public override string ToString() { throw null; } } public partial class EnvironmentVariablesConfigurationSource : Microsoft.Extensions.Configuration.IConfigurationSource { public EnvironmentVariablesConfigurationSource() { } - public string Prefix { get { throw null; } set { } } + public string? Prefix { get { throw null; } set { } } public Microsoft.Extensions.Configuration.IConfigurationProvider Build(Microsoft.Extensions.Configuration.IConfigurationBuilder builder) { throw null; } } } diff --git a/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/ref/Microsoft.Extensions.Configuration.EnvironmentVariables.csproj b/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/ref/Microsoft.Extensions.Configuration.EnvironmentVariables.csproj index ac7b4214362cde..dfb3265e9954ad 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/ref/Microsoft.Extensions.Configuration.EnvironmentVariables.csproj +++ b/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/ref/Microsoft.Extensions.Configuration.EnvironmentVariables.csproj @@ -1,10 +1,20 @@ - netstandard2.0;$(NetFrameworkMinimum) + $(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) + enable + + + + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/EnvironmentVariablesConfigurationProvider.cs b/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/EnvironmentVariablesConfigurationProvider.cs index 5ea29116ca2d9b..8b88483620cc50 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/EnvironmentVariablesConfigurationProvider.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/EnvironmentVariablesConfigurationProvider.cs @@ -29,7 +29,7 @@ public EnvironmentVariablesConfigurationProvider() => /// Initializes a new instance with the specified prefix. /// /// A prefix used to filter the environment variables. - public EnvironmentVariablesConfigurationProvider(string prefix) => + public EnvironmentVariablesConfigurationProvider(string? prefix) => _prefix = prefix ?? string.Empty; /// @@ -47,7 +47,7 @@ public override string ToString() internal void Load(IDictionary envVariables) { - var data = new Dictionary(StringComparer.OrdinalIgnoreCase); + var data = new Dictionary(StringComparer.OrdinalIgnoreCase); IDictionaryEnumerator e = envVariables.GetEnumerator(); try @@ -56,7 +56,7 @@ internal void Load(IDictionary envVariables) { DictionaryEntry entry = e.Entry; string key = (string)entry.Key; - string provider = null; + string? provider = null; string prefix; if (key.StartsWith(MySqlServerPrefix, StringComparison.OrdinalIgnoreCase)) @@ -94,7 +94,7 @@ internal void Load(IDictionary envVariables) // Add the key-value pair for connection string, and optionally provider name key = NormalizeKey(key.Substring(prefix.Length)); - AddIfPrefixed(data, $"ConnectionStrings:{key}", (string)entry.Value); + AddIfPrefixed(data, $"ConnectionStrings:{key}", (string?)entry.Value); if (provider != null) { AddIfPrefixed(data, $"ConnectionStrings:{key}_ProviderName", provider); @@ -109,7 +109,7 @@ internal void Load(IDictionary envVariables) Data = data; } - private void AddIfPrefixed(Dictionary data, string key, string value) + private void AddIfPrefixed(Dictionary data, string key, string? value) { if (key.StartsWith(_prefix, StringComparison.OrdinalIgnoreCase)) { diff --git a/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/EnvironmentVariablesConfigurationSource.cs b/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/EnvironmentVariablesConfigurationSource.cs index f5ac7b87a4a465..66e941af7f9bf1 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/EnvironmentVariablesConfigurationSource.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/EnvironmentVariablesConfigurationSource.cs @@ -11,7 +11,7 @@ public class EnvironmentVariablesConfigurationSource : IConfigurationSource /// /// A prefix used to filter environment variables. /// - public string Prefix { get; set; } + public string? Prefix { get; set; } /// /// Builds the for this source. diff --git a/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/EnvironmentVariablesExtensions.cs b/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/EnvironmentVariablesExtensions.cs index b43127513186f6..a5826a82a3a4cd 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/EnvironmentVariablesExtensions.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/EnvironmentVariablesExtensions.cs @@ -31,7 +31,7 @@ public static IConfigurationBuilder AddEnvironmentVariables(this IConfigurationB /// The . public static IConfigurationBuilder AddEnvironmentVariables( this IConfigurationBuilder configurationBuilder, - string prefix) + string? prefix) { configurationBuilder.Add(new EnvironmentVariablesConfigurationSource { Prefix = prefix }); return configurationBuilder; @@ -43,7 +43,7 @@ public static IConfigurationBuilder AddEnvironmentVariables( /// The to add to. /// Configures the source. /// The . - public static IConfigurationBuilder AddEnvironmentVariables(this IConfigurationBuilder builder, Action configureSource) + public static IConfigurationBuilder AddEnvironmentVariables(this IConfigurationBuilder builder, Action? configureSource) => builder.Add(configureSource); } } diff --git a/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/Microsoft.Extensions.Configuration.EnvironmentVariables.csproj b/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/Microsoft.Extensions.Configuration.EnvironmentVariables.csproj index d83ecf51782ca5..a9563d05f3346c 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/Microsoft.Extensions.Configuration.EnvironmentVariables.csproj +++ b/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/Microsoft.Extensions.Configuration.EnvironmentVariables.csproj @@ -1,8 +1,11 @@ - netstandard2.0;$(NetFrameworkMinimum) + $(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) + enable true + + false Environment variables configuration provider implementation for Microsoft.Extensions.Configuration. @@ -10,5 +13,5 @@ - + diff --git a/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/src/FileConfigurationProvider.cs b/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/src/FileConfigurationProvider.cs index d43d1196ed9406..aef7acc13e5e93 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/src/FileConfigurationProvider.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/src/FileConfigurationProvider.cs @@ -113,11 +113,11 @@ static Stream OpenRead(IFileInfo fileInfo) /// /// Loads the contents of the file at . /// - /// If Optional is false on the source and part of a file or - /// or directory cannot be found at the specified Path. - /// If Optional is false on the source and a + /// Optional is false on the source and a + /// directory cannot be found at the specified Path. + /// Optional is false on the source and a /// file does not exist at specified Path. - /// Wrapping any exception thrown by the concrete implementation of the + /// An exception was thrown by the concrete implementation of the /// method. Use the source callback /// if you need more control over the exception. public override void Load() diff --git a/src/libraries/Microsoft.Extensions.Configuration/ref/Microsoft.Extensions.Configuration.csproj b/src/libraries/Microsoft.Extensions.Configuration/ref/Microsoft.Extensions.Configuration.csproj index 0ab0a2842d7181..024ad14e46f7d2 100644 --- a/src/libraries/Microsoft.Extensions.Configuration/ref/Microsoft.Extensions.Configuration.csproj +++ b/src/libraries/Microsoft.Extensions.Configuration/ref/Microsoft.Extensions.Configuration.csproj @@ -1,15 +1,20 @@ - $(NetCoreAppCurrent);netstandard2.0;$(NetFrameworkMinimum) + $(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) enable + - - + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Configuration/src/Microsoft.Extensions.Configuration.csproj b/src/libraries/Microsoft.Extensions.Configuration/src/Microsoft.Extensions.Configuration.csproj index 10fd1c6acdcb60..f114bd7c04c31b 100644 --- a/src/libraries/Microsoft.Extensions.Configuration/src/Microsoft.Extensions.Configuration.csproj +++ b/src/libraries/Microsoft.Extensions.Configuration/src/Microsoft.Extensions.Configuration.csproj @@ -1,7 +1,7 @@ - $(NetCoreAppCurrent);netstandard2.0;$(NetFrameworkMinimum) + $(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) enable true diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.External.Tests/Microsoft.Extensions.DependencyInjection.ExternalContainers.Tests.csproj b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.External.Tests/Microsoft.Extensions.DependencyInjection.ExternalContainers.Tests.csproj index 2eef0a5ed96793..51b2fe2717b00c 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.External.Tests/Microsoft.Extensions.DependencyInjection.ExternalContainers.Tests.csproj +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.External.Tests/Microsoft.Extensions.DependencyInjection.ExternalContainers.Tests.csproj @@ -22,7 +22,7 @@ - + diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.External.Tests/StashBox.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.External.Tests/StashBox.cs index 6d315d7361f7d9..3deffe4767d7e6 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.External.Tests/StashBox.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.External.Tests/StashBox.cs @@ -7,8 +7,6 @@ namespace Microsoft.Extensions.DependencyInjection.Specification { public class StashBoxDependencyInjectionSpecificationTests : DependencyInjectionSpecificationTests { - public override bool SupportsIServiceProviderIsService => false; - protected override IServiceProvider CreateServiceProvider(IServiceCollection serviceCollection) { return serviceCollection.UseStashbox(); diff --git a/src/libraries/Microsoft.Extensions.HostFactoryResolver/src/HostFactoryResolver.cs b/src/libraries/Microsoft.Extensions.HostFactoryResolver/src/HostFactoryResolver.cs index d860312da271cf..ec4335d5f5343b 100644 --- a/src/libraries/Microsoft.Extensions.HostFactoryResolver/src/HostFactoryResolver.cs +++ b/src/libraries/Microsoft.Extensions.HostFactoryResolver/src/HostFactoryResolver.cs @@ -20,9 +20,25 @@ internal sealed class HostFactoryResolver public const string BuildWebHost = nameof(BuildWebHost); public const string CreateWebHostBuilder = nameof(CreateWebHostBuilder); public const string CreateHostBuilder = nameof(CreateHostBuilder); + private const string TimeoutEnvironmentKey = "DOTNET_HOST_FACTORY_RESOLVER_DEFAULT_TIMEOUT_IN_SECONDS"; // The amount of time we wait for the diagnostic source events to fire - private static readonly TimeSpan s_defaultWaitTimeout = Debugger.IsAttached ? Timeout.InfiniteTimeSpan : TimeSpan.FromSeconds(5); + private static readonly TimeSpan s_defaultWaitTimeout = SetupDefaultTimout(); + + private static TimeSpan SetupDefaultTimout() + { + if (Debugger.IsAttached) + { + return Timeout.InfiniteTimeSpan; + } + + if (uint.TryParse(Environment.GetEnvironmentVariable(TimeoutEnvironmentKey), out uint timeoutInSeconds)) + { + return TimeSpan.FromSeconds((int)timeoutInSeconds); + } + + return TimeSpan.FromMinutes(5); + } public static Func? ResolveWebHostFactory(Assembly assembly) { @@ -229,7 +245,7 @@ public object CreateHost() // Try to set an exception if the entry point returns gracefully, this will force // build to throw - _hostTcs.TrySetException(new InvalidOperationException("Unable to build IHost")); + _hostTcs.TrySetException(new InvalidOperationException("The entry point exited without ever building an IHost.")); } catch (TargetInvocationException tie) when (tie.InnerException is StopTheHostException) { @@ -268,7 +284,7 @@ public object CreateHost() // Wait before throwing an exception if (!_hostTcs.Task.Wait(_waitTimeout)) { - throw new InvalidOperationException("Unable to build IHost"); + throw new InvalidOperationException($"Timed out waiting for the entry point to build the IHost after {s_defaultWaitTimeout}. This timeout can be modified using the '{TimeoutEnvironmentKey}' environment variable."); } } catch (AggregateException) when (_hostTcs.Task.IsCompleted) diff --git a/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs b/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs index 0e353f7f8cb708..d6cf530c94e93a 100644 --- a/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs +++ b/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs @@ -253,6 +253,16 @@ public void TopLevelStatements() Assert.IsAssignableFrom(factory(Array.Empty())); } + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + public void TopLevelStatementsTestsTimeout() + { + var assembly = Assembly.Load("TopLevelStatementsTestsTimeout"); + var factory = HostFactoryResolver.ResolveServiceProviderFactory(assembly, s_WaitTimeout); + + Assert.NotNull(factory); + Assert.Throws(() => factory(Array.Empty())); + } + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] public void ApplicationNameSetFromAgrument() { diff --git a/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/Microsoft.Extensions.HostFactoryResolver.Tests.csproj b/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/Microsoft.Extensions.HostFactoryResolver.Tests.csproj index 795e830ee2e605..61edd76da9ceb2 100644 --- a/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/Microsoft.Extensions.HostFactoryResolver.Tests.csproj +++ b/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/Microsoft.Extensions.HostFactoryResolver.Tests.csproj @@ -28,6 +28,7 @@ + diff --git a/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/TopLevelStatementsTestsTimeout/Program.cs b/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/TopLevelStatementsTestsTimeout/Program.cs new file mode 100644 index 00000000000000..f4c01882987e12 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/TopLevelStatementsTestsTimeout/Program.cs @@ -0,0 +1,10 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Threading; +using Microsoft.Extensions.Hosting; + +var hostBuilder = new HostBuilder(); +Thread.Sleep(TimeSpan.FromSeconds(30)); +hostBuilder.Build(); \ No newline at end of file diff --git a/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/TopLevelStatementsTestsTimeout/TopLevelStatementsTestsTimeout.csproj b/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/TopLevelStatementsTestsTimeout/TopLevelStatementsTestsTimeout.csproj new file mode 100644 index 00000000000000..1d8d76f900ada1 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/TopLevelStatementsTestsTimeout/TopLevelStatementsTestsTimeout.csproj @@ -0,0 +1,13 @@ + + + + $(NetCoreAppCurrent);$(NetFrameworkMinimum) + true + Exe + + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/src/Internal/Win32.cs b/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/src/Internal/Win32.cs index b8ebd1dae1f4f4..7e9f8e3371c7bf 100644 --- a/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/src/Internal/Win32.cs +++ b/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/src/Internal/Win32.cs @@ -9,33 +9,17 @@ namespace Microsoft.Extensions.Hosting.WindowsServices.Internal { internal static class Win32 { - // https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/nf-tlhelp32-createtoolhelp32snapshot - [DllImport("kernel32", SetLastError = true)] - private static extern IntPtr CreateToolhelp32Snapshot(SnapshotFlags dwFlags, uint th32ProcessID); - - // https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/nf-tlhelp32-process32first - [DllImport("kernel32", SetLastError = true, CharSet = System.Runtime.InteropServices.CharSet.Auto)] - private static extern bool Process32First([In]IntPtr hSnapshot, ref PROCESSENTRY32 lppe); - - // https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/nf-tlhelp32-process32next - [DllImport("kernel32", SetLastError = true, CharSet = System.Runtime.InteropServices.CharSet.Auto)] - private static extern bool Process32Next([In]IntPtr hSnapshot, ref PROCESSENTRY32 lppe); - - [DllImport("kernel32", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - private static extern bool CloseHandle([In] IntPtr hObject); - internal static Process GetParentProcess() { var snapshotHandle = IntPtr.Zero; try { // Get a list of all processes - snapshotHandle = CreateToolhelp32Snapshot(SnapshotFlags.Process, 0); + snapshotHandle = Interop.Kernel32.CreateToolhelp32Snapshot(Interop.Kernel32.SnapshotFlags.Process, 0); - PROCESSENTRY32 procEntry = default(PROCESSENTRY32); - procEntry.dwSize = Marshal.SizeOf(typeof(PROCESSENTRY32)); - if (Process32First(snapshotHandle, ref procEntry)) + Interop.Kernel32.PROCESSENTRY32 procEntry = default(Interop.Kernel32.PROCESSENTRY32); + procEntry.dwSize = Marshal.SizeOf(typeof(Interop.Kernel32.PROCESSENTRY32)); + if (Interop.Kernel32.Process32First(snapshotHandle, ref procEntry)) { var currentProcessId = Process.GetCurrentProcess().Id; do @@ -45,7 +29,7 @@ internal static Process GetParentProcess() return Process.GetProcessById((int)procEntry.th32ParentProcessID); } } - while (Process32Next(snapshotHandle, ref procEntry)); + while (Interop.Kernel32.Process32Next(snapshotHandle, ref procEntry)); } } catch (Exception) @@ -53,40 +37,10 @@ internal static Process GetParentProcess() } finally { - CloseHandle(snapshotHandle); + Interop.Kernel32.CloseHandle(snapshotHandle); } return null; } - - [Flags] - private enum SnapshotFlags : uint - { - HeapList = 0x00000001, - Process = 0x00000002, - Thread = 0x00000004, - Module = 0x00000008, - Module32 = 0x00000010, - All = (HeapList | Process | Thread | Module), - Inherit = 0x80000000, - NoHeaps = 0x40000000 - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] - private struct PROCESSENTRY32 - { - internal const int MAX_PATH = 260; - internal int dwSize; - internal int cntUsage; - internal int th32ProcessID; - internal IntPtr th32DefaultHeapID; - internal int th32ModuleID; - internal int cntThreads; - internal int th32ParentProcessID; - internal int pcPriClassBase; - internal int dwFlags; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_PATH)] - internal string szExeFile; - } } } diff --git a/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/src/Microsoft.Extensions.Hosting.WindowsServices.csproj b/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/src/Microsoft.Extensions.Hosting.WindowsServices.csproj index 88472dd6b31bc0..260db551d47776 100644 --- a/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/src/Microsoft.Extensions.Hosting.WindowsServices.csproj +++ b/src/libraries/Microsoft.Extensions.Hosting.WindowsServices/src/Microsoft.Extensions.Hosting.WindowsServices.csproj @@ -1,11 +1,23 @@  + true netstandard2.1;netstandard2.0;$(NetFrameworkMinimum) true .NET hosting infrastructure for Windows Services. + + + + + + + diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/Microsoft.Extensions.Logging.Console.csproj b/src/libraries/Microsoft.Extensions.Logging.Console/src/Microsoft.Extensions.Logging.Console.csproj index b8ce8334901c5f..932e729c0b9ada 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/Microsoft.Extensions.Logging.Console.csproj +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/Microsoft.Extensions.Logging.Console.csproj @@ -4,10 +4,12 @@ $(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) true annotations + true $(DefineConstants);NO_SUPPRESS_GC_TRANSITION false true + true Console logger provider implementation for Microsoft.Extensions.Logging. @@ -41,6 +43,10 @@ + + + + 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 2c5fa34fc434db..8fbb8dd78854b1 100644 --- a/src/libraries/Microsoft.Win32.Registry/src/Microsoft.Win32.Registry.csproj +++ b/src/libraries/Microsoft.Win32.Registry/src/Microsoft.Win32.Registry.csproj @@ -81,6 +81,7 @@ + diff --git a/src/libraries/Microsoft.Win32.Registry/tests/Microsoft.Win32.Registry.Tests.csproj b/src/libraries/Microsoft.Win32.Registry/tests/Microsoft.Win32.Registry.Tests.csproj index e88f97d0cb43cc..97452ace1fcdc5 100644 --- a/src/libraries/Microsoft.Win32.Registry/tests/Microsoft.Win32.Registry.Tests.csproj +++ b/src/libraries/Microsoft.Win32.Registry/tests/Microsoft.Win32.Registry.Tests.csproj @@ -2,6 +2,8 @@ $(DefineConstants);REGISTRY_ASSEMBLY $(NetCoreAppCurrent)-windows + true + true + + diff --git a/src/libraries/Microsoft.Win32.SystemEvents/tests/Microsoft.Win32.SystemEvents.Tests.csproj b/src/libraries/Microsoft.Win32.SystemEvents/tests/Microsoft.Win32.SystemEvents.Tests.csproj index 9f54ccc27082a5..b74ffd4352b8bf 100644 --- a/src/libraries/Microsoft.Win32.SystemEvents/tests/Microsoft.Win32.SystemEvents.Tests.csproj +++ b/src/libraries/Microsoft.Win32.SystemEvents/tests/Microsoft.Win32.SystemEvents.Tests.csproj @@ -2,6 +2,8 @@ $(NetCoreAppCurrent)-windows;$(NetFrameworkMinimum) true + true + true 1) { changed.Set(); diff --git a/src/libraries/Native/Unix/.clang-format b/src/libraries/Native/Unix/.clang-format deleted file mode 100644 index bec589a928235c..00000000000000 --- a/src/libraries/Native/Unix/.clang-format +++ /dev/null @@ -1,17 +0,0 @@ ---- -Language: Cpp -# BasedOnStyle: LLVM -AlignEscapedNewlinesLeft: false -AllowShortFunctionsOnASingleLine: false -AlwaysBreakTemplateDeclarations: true -BinPackArguments: false -BinPackParameters: false -BreakBeforeBraces: Allman -ColumnLimit: 120 -ConstructorInitializerAllOnOneLineOrOnePerLine: true -IndentCaseLabels: true -IndentWidth: 4 -PointerAlignment: Left -TabWidth: 4 -... - diff --git a/src/libraries/Native/Unix/CMakeLists.txt b/src/libraries/Native/Unix/CMakeLists.txt deleted file mode 100644 index 100692257acbf5..00000000000000 --- a/src/libraries/Native/Unix/CMakeLists.txt +++ /dev/null @@ -1,159 +0,0 @@ -cmake_minimum_required(VERSION 3.6.2) -include(CheckCCompilerFlag) - -if(CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) - # CMake 3.14.5 contains bug fixes for iOS - cmake_minimum_required(VERSION 3.14.5) -elseif(CLR_CMAKE_TARGET_MACCATALYST) - # CMake 3.18.1 properly generates MacCatalyst C compiler - cmake_minimum_required(VERSION 3.18.1) -endif() -cmake_policy(SET CMP0042 NEW) - -project(CoreFX C) - -include(../../../../eng/native/configurepaths.cmake) -include(${CLR_ENG_NATIVE_DIR}/configurecompiler.cmake) - -include_directories(${CLR_SRC_NATIVE_DIR}) - -set(CMAKE_MACOSX_RPATH ON) -if(CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) - set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) - set(CMAKE_INSTALL_NAME_DIR "@rpath") -endif() -set(CMAKE_INSTALL_PREFIX $ENV{__CMakeBinDir}) -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") - -add_compile_options(-I${CMAKE_CURRENT_SOURCE_DIR}/Common) -add_compile_options(-I${CMAKE_CURRENT_BINARY_DIR}/Common) - -if(STATIC_LIBS_ONLY) - # Suppress exporting of the PAL APIs - add_definitions(-DPALEXPORT=EXTERN_C) - - set(STATIC_LIB_DESTINATION lib) - set(GEN_SHARED_LIB 0) -else() - set(STATIC_LIB_DESTINATION .) - set(GEN_SHARED_LIB 1) -endif() - -if(CLR_CMAKE_TARGET_BROWSER) - set(GEN_SHARED_LIB 0) - set(STATIC_LIB_DESTINATION .) -endif() - -if(CLR_CMAKE_TARGET_TVOS) - # with -fembed-bitcode passing -headerpad_max_install_names is not allowed so remove it from the CMake flags - string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_C_LINK_FLAGS ${CMAKE_C_LINK_FLAGS}) - string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) - add_compile_options(-fembed-bitcode) - add_link_options(-fembed-bitcode) -endif() - -if(CLR_CMAKE_TARGET_ANDROID) - if(CROSS_ROOTFS) - include_directories(SYSTEM "${CROSS_ROOTFS}/usr/include") - endif() -endif() - -string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_CMAKE_BUILD_TYPE) - -if (UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL CHECKED) - if (UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG) - add_compile_options(-O0) - elseif (UPPERCASE_CMAKE_BUILD_TYPE STREQUAL CHECKED) - add_compile_options(-O2) - endif () - - add_definitions(-DDEBUG) - - # obtain settings from running coreclr\enablesanitizers.sh - string(FIND "$ENV{DEBUG_SANITIZERS}" "asan" __ASAN_POS) - string(FIND "$ENV{DEBUG_SANITIZERS}" "ubsan" __UBSAN_POS) - if ((${__ASAN_POS} GREATER -1) OR (${__UBSAN_POS} GREATER -1)) - set(CLR_SANITIZE_LINK_FLAGS "${CLR_SANITIZE_LINK_FLAGS} -fsanitize=") - if (${__ASAN_POS} GREATER -1) - set(CLR_SANITIZE_LINK_FLAGS "${CLR_SANITIZE_LINK_FLAGS}address,") - message("Address Sanitizer (asan) enabled") - endif () - if (${__UBSAN_POS} GREATER -1) - set(CLR_SANITIZE_LINK_FLAGS "${CLR_SANITIZE_LINK_FLAGS}undefined") - message("Undefined Behavior Sanitizer (ubsan) enabled") - endif () - - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CLR_SANITIZE_LINK_FLAGS}") - - # -Wl and --gc-sections: drop unused sections\functions (similar to Windows /Gy function-level-linking) - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CLR_SANITIZE_LINK_FLAGS} -Wl,--gc-sections") - endif () -elseif (UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELEASE) - # Use O1 option when the clang version is smaller than 3.9 - # Otherwise use O3 option in release build - if (CLR_CMAKE_TARGET_ARCH_ARMV7L AND DEFINED ENV{CROSSCOMPILE} AND CMAKE_C_COMPILER_VERSION VERSION_LESS 3.9) - add_compile_options (-O1) - else() - add_compile_options (-O3) - endif() - add_definitions(-DNDEBUG) -else () - message(FATAL_ERROR "Unknown build type. Set CMAKE_BUILD_TYPE to DEBUG or RELEASE.") -endif () - -if (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) - add_definitions(-D__APPLE_USE_RFC_3542) -endif () - -if (CLR_CMAKE_TARGET_LINUX) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE") -endif () - -include(configure.cmake) - -add_subdirectory(System.IO.Compression.Native) - -if (NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID) - add_subdirectory(System.IO.Ports.Native) -endif() - -if(CMAKE_C_COMPILER_ID STREQUAL Clang) - add_compile_options(-Weverything) - add_compile_options(-Wno-format-nonliteral) - add_compile_options(-Wno-disabled-macro-expansion) - add_compile_options(-Wno-padded) - add_compile_options(-Wno-empty-translation-unit) - add_compile_options(-Wno-cast-align) - add_compile_options(-Wno-typedef-redefinition) - add_compile_options(-Wno-c11-extensions) - add_compile_options(-Wno-thread-safety-analysis) -endif() - -add_subdirectory(System.Native) - -if(CLR_CMAKE_TARGET_BROWSER) - # skip for now -elseif(CLR_CMAKE_TARGET_MACCATALYST) - add_subdirectory(System.Net.Security.Native) - # System.Security.Cryptography.Native is intentionally disabled on iOS - # it is only used for interacting with OpenSSL which isn't useful there -elseif(CLR_CMAKE_TARGET_IOS) - add_subdirectory(System.Net.Security.Native) - # System.Security.Cryptography.Native is intentionally disabled on iOS - # it is only used for interacting with OpenSSL which isn't useful there -elseif(CLR_CMAKE_TARGET_TVOS) - #add_subdirectory(System.Net.Security.Native) # no gssapi on tvOS, see https://developer.apple.com/documentation/gss - # System.Security.Cryptography.Native is intentionally disabled on tvOS - # it is only used for interacting with OpenSSL which isn't useful there -elseif(CLR_CMAKE_TARGET_ANDROID) - add_subdirectory(System.Security.Cryptography.Native.Android) -else() - add_subdirectory(System.Globalization.Native) - add_subdirectory(System.Net.Security.Native) - add_subdirectory(System.Security.Cryptography.Native) -endif() - -if(CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) - add_subdirectory(System.Security.Cryptography.Native.Apple) -endif() diff --git a/src/libraries/Native/Unix/System.IO.Compression.Native/CMakeLists.txt b/src/libraries/Native/Unix/System.IO.Compression.Native/CMakeLists.txt deleted file mode 100644 index fd332e3fd8cf1d..00000000000000 --- a/src/libraries/Native/Unix/System.IO.Compression.Native/CMakeLists.txt +++ /dev/null @@ -1,109 +0,0 @@ -project(System.IO.Compression.Native C) - -if (CLR_CMAKE_TARGET_BROWSER) - add_definitions(-s USE_ZLIB) -endif() - -include(${CMAKE_CURRENT_LIST_DIR}/extra_libs.cmake) - -set(NATIVE_LIBS_EXTRA) -append_extra_compression_libs(NATIVE_LIBS_EXTRA) - -set(NATIVECOMPRESSION_SOURCES - ../../AnyOS/zlib/pal_zlib.c -) - -if (NOT CLR_CMAKE_TARGET_BROWSER) - #Include Brotli include files - include_directories("../../AnyOS/brotli/include") - - set (NATIVECOMPRESSION_SOURCES - ${NATIVECOMPRESSION_SOURCES} - ../../AnyOS/brotli/common/constants.c - ../../AnyOS/brotli/common/context.c - ../../AnyOS/brotli/common/dictionary.c - ../../AnyOS/brotli/common/platform.c - ../../AnyOS/brotli/common/transform.c - ../../AnyOS/brotli/dec/bit_reader.c - ../../AnyOS/brotli/dec/decode.c - ../../AnyOS/brotli/dec/huffman.c - ../../AnyOS/brotli/dec/state.c - ../../AnyOS/brotli/enc/backward_references.c - ../../AnyOS/brotli/enc/backward_references_hq.c - ../../AnyOS/brotli/enc/bit_cost.c - ../../AnyOS/brotli/enc/block_splitter.c - ../../AnyOS/brotli/enc/brotli_bit_stream.c - ../../AnyOS/brotli/enc/cluster.c - ../../AnyOS/brotli/enc/command.c - ../../AnyOS/brotli/enc/compress_fragment.c - ../../AnyOS/brotli/enc/compress_fragment_two_pass.c - ../../AnyOS/brotli/enc/dictionary_hash.c - ../../AnyOS/brotli/enc/encode.c - ../../AnyOS/brotli/enc/encoder_dict.c - ../../AnyOS/brotli/enc/entropy_encode.c - ../../AnyOS/brotli/enc/fast_log.c - ../../AnyOS/brotli/enc/histogram.c - ../../AnyOS/brotli/enc/literal_cost.c - ../../AnyOS/brotli/enc/memory.c - ../../AnyOS/brotli/enc/metablock.c - ../../AnyOS/brotli/enc/static_dict.c - ../../AnyOS/brotli/enc/utf8_util.c - ../../AnyOS/System.IO.Compression.Native/entrypoints.c - ) - - # Disable implicit fallthrough warning for Brotli - set(FLAGS -Wno-implicit-fallthrough) - - # Delete this supression once brotli is upgraded to vNext (current latest v1.0.9 - # does not contain upstream fix: https://github.com/google/brotli/commit/0a3944c) - set(FLAGS "${FLAGS} -Wno-vla-parameter") - - set_source_files_properties(${NATIVECOMPRESSION_SOURCES} PROPERTIES COMPILE_FLAGS ${FLAGS}) -endif() - -if (GEN_SHARED_LIB) - add_definitions(-DBROTLI_SHARED_COMPILATION) - - add_library(System.IO.Compression.Native - SHARED - ${NATIVECOMPRESSION_SOURCES} - ${VERSION_FILE_PATH} - ) - - target_link_libraries(System.IO.Compression.Native - ${NATIVE_LIBS_EXTRA} - ) - - if (NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID) - set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/System.IO.Compression.Native_unixexports.src) - set(EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/System.IO.Compression.Native.exports) - generate_exports_file(${DEF_SOURCES} ${EXPORTS_FILE}) - set_exports_linker_option(${EXPORTS_FILE}) - - add_custom_target(System.IO.Compression.Native_exports DEPENDS ${EXPORTS_FILE}) - add_dependencies(System.IO.Compression.Native System.IO.Compression.Native_exports) - - set_property(TARGET System.IO.Compression.Native APPEND_STRING PROPERTY LINK_FLAGS ${EXPORTS_LINKER_OPTION}) - set_property(TARGET System.IO.Compression.Native APPEND_STRING PROPERTY LINK_DEPENDS ${EXPORTS_FILE}) - - add_custom_command(TARGET System.IO.Compression.Native POST_BUILD - COMMENT "Verifying System.IO.Compression.Native entry points against entrypoints.c " - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../verify-entrypoints.sh - $ - ${CMAKE_CURRENT_SOURCE_DIR}/../../AnyOS/System.IO.Compression.Native/entrypoints.c - ${CMAKE_NM} - VERBATIM - ) - endif() - - install_with_stripped_symbols (System.IO.Compression.Native PROGRAMS .) -endif () - -add_library(System.IO.Compression.Native-Static - STATIC - ${NATIVECOMPRESSION_SOURCES} -) - -set_target_properties(System.IO.Compression.Native-Static PROPERTIES OUTPUT_NAME System.IO.Compression.Native CLEAN_DIRECT_OUTPUT 1) - -install (TARGETS System.IO.Compression.Native-Static DESTINATION ${STATIC_LIB_DESTINATION} COMPONENT libs) diff --git a/src/libraries/Native/Windows/CMakeLists.txt b/src/libraries/Native/Windows/CMakeLists.txt deleted file mode 100644 index 229adbddd38be2..00000000000000 --- a/src/libraries/Native/Windows/CMakeLists.txt +++ /dev/null @@ -1,139 +0,0 @@ -cmake_minimum_required(VERSION 3.16) -cmake_policy(SET CMP0091 NEW) - -include(../../../../eng/native/configurepaths.cmake) - -# C Compiler flags -SET (CMAKE_C_FLAGS_INIT "/W3 /FC") -SET (CMAKE_C_FLAGS_DEBUG_INIT "/Od /Zi") -SET (CMAKE_C_FLAGS_RELEASE_INIT "/Ox") -SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/O2 /Zi") -SET (CMAKE_ASM_MASM_FLAGS "${CMAKE_ASM_MASM_FLAGS} /ZH:SHA_256") - -# Configuration of our libray specs and our directories -SET (CMAKE_INCLUDE_CURRENT_DIR ON) -SET (CMAKE_SHARED_LIBRARY_PREFIX "") - -set(__SharedLinkArgs) -set(__LinkArgs) - -# Force an out of source build -if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") - message(FATAL_ERROR "Binary directory isn't being correctly set before calling Cmake. Tree must be built in separate directory from source.") -endif() - -if(STATIC_LIBS_ONLY) - # Suppress exporting of the PAL APIs - add_definitions(-DPALEXPORT=EXTERN_C) - - set(GEN_SHARED_LIB 0) - set(STATIC_LIB_DESTINATION lib) -else() - set(GEN_SHARED_LIB 1) - set(STATIC_LIB_DESTINATION .) -endif() - -project(CoreFX) - -include(../../../../eng/native/configurepaths.cmake) - -# The following options are set by the razzle build -add_compile_options(/d2Zi+) # make optimized builds debugging easier -add_compile_options(/nologo) # Suppress Startup Banner -add_compile_options(/Oi) # enable intrinsics -add_compile_options(/Oy-) # disable suppressing of the creation of frame pointers on the call stack for quicker function calls -add_compile_options(/U_MT) # undefine the predefined _MT macro -add_compile_options(/GF) # enable read-only string pooling -add_compile_options(/Gm-) # disable minimal rebuild -string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") -add_compile_options(/EHa) # enable C++ EH (w/ SEH exceptions) -add_compile_options(/Zp8) # pack structs on 8-byte boundary -add_compile_options(/Gy) # separate functions for linker -add_compile_options(/Zc:forScope) # C++ language conformance: enforce Standard C++ for scoping rules -string(REPLACE "/GR " " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") -add_compile_options(/GR-) # disable C++ RTTI -add_compile_options(/FC) # use full pathnames in diagnostics -add_compile_options(/MP) # Build with Multiple Processes (number of processes equal to the number of processors) -add_compile_options(/GS) # Buffer Security Check -add_compile_options(/Zm200) # Specify Precompiled Header Memory Allocation Limit of 150MB -add_compile_options(/Zi) # enable debugging information -add_compile_options(/Zl) # enable debugging information -add_compile_options(/wd4960 /wd4961 /wd4603 /wd4627 /wd4838 /wd4456 /wd4457 /wd4458 /wd4459 /wd4091 /we4640) -add_compile_options(/ZH:SHA_256) # use SHA256 for generating hashes of compiler processed source files. - -if (${CLR_CMAKE_HOST_ARCH} STREQUAL "x86") - add_compile_options(/Gz) -endif () - -# enable control-flow-guard support for native components -add_compile_options(/guard:cf) -list(APPEND __SharedLinkArgs /guard:cf) - -if (${CLR_CMAKE_HOST_ARCH} STREQUAL "x86_64" OR ${CLR_CMAKE_HOST_ARCH} STREQUAL "amd64" OR ${CLR_CMAKE_HOST_ARCH} STREQUAL "x64") - # Enable EH continuation table and CETCOMPAT for native components - add_compile_options(/guard:ehcont) - list(APPEND __SharedLinkArgs /guard:ehcont) - list(APPEND __SharedLinkArgs /CETCOMPAT) -endif () - -# Statically linked CRT (libcmt[d].lib, libvcruntime[d].lib and libucrt[d].lib) by default. This is done to avoid -# linking in VCRUNTIME140.DLL for a simplified xcopy experience by reducing the dependency on VC REDIST. -# -# For Release builds, we shall dynamically link into uCRT [ucrtbase.dll] (which is pushed down as a Windows Update on downlevel OS) but -# won't do the same for debug/checked builds since ucrtbased.dll is not redistributable and Debug/Checked builds are not -# production-time scenarios. - -set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - -add_compile_options($<$:/GL>) - -list(APPEND __LinkLibraries $<$:libcmtd.lib>) -list(APPEND __LinkLibraries $<$:libcmt.lib>) - -list(APPEND __LinkLibraries $<$:libvcruntimed.lib>) -list(APPEND __LinkLibraries $<$:libvcruntime.lib>) - -# Linker flags -list(APPEND __SharedLinkArgs /INCREMENTAL:NO) -list(APPEND __SharedLinkArgs /MANIFEST:NO) #Do not create Side-by-Side Assembly Manifest -list(APPEND __SharedLinkArgs /LARGEADDRESSAWARE) # can handle addresses larger than 2 gigabytes -list(APPEND __SharedLinkArgs /RELEASE) #sets the checksum in the header -list(APPEND __SharedLinkArgs /NXCOMPAT) #Compatible with Data Execution Prevention -list(APPEND __SharedLinkArgs /DYNAMICBASE) #Use address space layout randomization -list(APPEND __SharedLinkArgs /DEBUGTYPE:cv,fixup) #debugging format -list(APPEND __SharedLinkArgs /PDBCOMPRESS) #shrink pdb size -list(APPEND __SharedLinkArgs /DEBUG) -list(APPEND __SharedLinkArgs /IGNORE:4197,4013,4254,4070,4221) - -# Release build specific flags -list(APPEND __LinkArgs $<$:/LTCG>) -list(APPEND __SharedLinkArgs $<$:/OPT:REF>) -list(APPEND __SharedLinkArgs $<$:/OPT:ICF>) - -# Force uCRT to be dynamically linked for Release build (unless env variable CLR_CMAKE_WIN32_FORCE_STATIC_LINK is set to true) -set(CLR_CMAKE_WIN32_FORCE_STATIC_LINK $ENV{CLR_CMAKE_WIN32_FORCE_STATIC_LINK}) -if(NOT CLR_CMAKE_WIN32_FORCE_STATIC_LINK) - list(APPEND __SharedLinkArgs $<$:/NODEFAULTLIB:libucrt.lib>) - list(APPEND __SharedLinkArgs $<$:/DEFAULTLIB:ucrt.lib>) -endif() - -# Debug build specific flags -list(INSERT __SharedLinkArgs 0 $<$,$>:/NOVCFEATURE>) - -if (${CLR_CMAKE_HOST_ARCH} STREQUAL "x86_64" OR ${CLR_CMAKE_HOST_ARCH} STREQUAL "amd64" OR ${CLR_CMAKE_HOST_ARCH} STREQUAL "x64") - add_definitions(-DTARGET_64BIT=1) -endif () - -# Do not define DEBUG. zlib has asserts under DEBUG for non-catastrophic cases, -# such as on bad user-provided inputs. We leave NDEBUG defined, however, -# as other asserts should still be included. -add_compile_definitions($<$:NDEBUG>) - -include_directories(${CLR_SRC_NATIVE_DIR}) - -# we only need to build System.Globalization.Native when building static libs. -if(STATIC_LIBS_ONLY) - add_subdirectory(../Unix/System.Globalization.Native System.Globalization.Native) -endif() - -add_subdirectory(System.IO.Compression.Native) diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/CMakeLists.txt b/src/libraries/Native/Windows/System.IO.Compression.Native/CMakeLists.txt deleted file mode 100644 index 936c077419f272..00000000000000 --- a/src/libraries/Native/Windows/System.IO.Compression.Native/CMakeLists.txt +++ /dev/null @@ -1,125 +0,0 @@ -project(System.IO.Compression.Native) - -if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") - message(FATAL_ERROR "Binary directory isn't being correctly set before calling Cmake. Tree must be built in separate directory from source.") -endif() - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -if (GEN_SHARED_LIB) - include (GenerateExportHeader) -endif() - -if(${CLR_CMAKE_HOST_ARCH} STREQUAL x86 OR ${CLR_CMAKE_HOST_ARCH} STREQUAL x64) - set(NATIVECOMPRESSION_SOURCES - zlib-intel/adler32.c - zlib-intel/compress.c - zlib-intel/crc_folding.c - zlib-intel/crc32.c - zlib-intel/deflate_medium.c - zlib-intel/deflate_quick.c - zlib-intel/deflate.c - zlib-intel/inffast.c - zlib-intel/inflate.c - zlib-intel/inftrees.c - zlib-intel/match.c - zlib-intel/slide_sse.c - zlib-intel/trees.c - zlib-intel/x86.c - zlib-intel/zutil.c -) -else() - set(NATIVECOMPRESSION_SOURCES - zlib/adler32.c - zlib/compress.c - zlib/crc32.c - zlib/deflate.c - zlib/inffast.c - zlib/inflate.c - zlib/inftrees.c - zlib/trees.c - zlib/zutil.c - ) -endif() - -set (NATIVECOMPRESSION_SOURCES - ${NATIVECOMPRESSION_SOURCES} - ../../AnyOS/zlib/pal_zlib.c - ../../AnyOS/brotli/common/constants.c - ../../AnyOS/brotli/common/context.c - ../../AnyOS/brotli/common/dictionary.c - ../../AnyOS/brotli/common/platform.c - ../../AnyOS/brotli/common/transform.c - ../../AnyOS/brotli/dec/bit_reader.c - ../../AnyOS/brotli/dec/decode.c - ../../AnyOS/brotli/dec/huffman.c - ../../AnyOS/brotli/dec/state.c - ../../AnyOS/brotli/enc/backward_references.c - ../../AnyOS/brotli/enc/backward_references_hq.c - ../../AnyOS/brotli/enc/bit_cost.c - ../../AnyOS/brotli/enc/block_splitter.c - ../../AnyOS/brotli/enc/brotli_bit_stream.c - ../../AnyOS/brotli/enc/cluster.c - ../../AnyOS/brotli/enc/command.c - ../../AnyOS/brotli/enc/compress_fragment.c - ../../AnyOS/brotli/enc/compress_fragment_two_pass.c - ../../AnyOS/brotli/enc/dictionary_hash.c - ../../AnyOS/brotli/enc/encode.c - ../../AnyOS/brotli/enc/encoder_dict.c - ../../AnyOS/brotli/enc/entropy_encode.c - ../../AnyOS/brotli/enc/fast_log.c - ../../AnyOS/brotli/enc/histogram.c - ../../AnyOS/brotli/enc/literal_cost.c - ../../AnyOS/brotli/enc/memory.c - ../../AnyOS/brotli/enc/metablock.c - ../../AnyOS/brotli/enc/static_dict.c - ../../AnyOS/brotli/enc/utf8_util.c -) - -#Include Brotli include files -include_directories("../../AnyOS/brotli/include") - -if (GEN_SHARED_LIB) - add_library(System.IO.Compression.Native - SHARED - ${NATIVECOMPRESSION_SOURCES} - System.IO.Compression.Native.def - # This will add versioning to the library - ${VERSION_FILE_RC_PATH} - ) -endif() - -if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) - set(NATIVECOMPRESSION_SOURCES ${NATIVECOMPRESSION_SOURCES} ../../AnyOS/System.IO.Compression.Native/entrypoints.c) -endif() - -add_library(System.IO.Compression.Native-Static - STATIC - ${NATIVECOMPRESSION_SOURCES} -) - -# Allow specification of arguments that should be passed to the linker -if (GEN_SHARED_LIB) - SET_TARGET_PROPERTIES(System.IO.Compression.Native PROPERTIES LINK_OPTIONS "${__LinkArgs};${__SharedLinkArgs}") -endif() -SET_TARGET_PROPERTIES(System.IO.Compression.Native-Static PROPERTIES STATIC_LIBRARY_OPTIONS "${__LinkArgs}") - -# Allow specification of libraries that should be linked against -if (GEN_SHARED_LIB) - target_link_libraries(System.IO.Compression.Native ${__LinkLibraries}) -endif() -target_link_libraries(System.IO.Compression.Native-Static ${__LinkLibraries}) - -if (GEN_SHARED_LIB) - GENERATE_EXPORT_HEADER( System.IO.Compression.Native - BASE_NAME System.IO.Compression.Native - EXPORT_MACRO_NAME System.IO.Compression.Native_EXPORT - EXPORT_FILE_NAME System.IO.Compression.Native_Export.h - STATIC_DEFINE System.IO.Compression.Native_BUILT_AS_STATIC - ) - - install (TARGETS System.IO.Compression.Native DESTINATION .) - install (FILES $ DESTINATION .) -endif() - -install (TARGETS System.IO.Compression.Native-Static DESTINATION ${STATIC_LIB_DESTINATION} COMPONENT libs) diff --git a/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentStack.cs b/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentStack.cs index 04cb4e244f707c..9a4af6b378c4f5 100644 --- a/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentStack.cs +++ b/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentStack.cs @@ -349,7 +349,6 @@ public void PushRange(T[] items, int startIndex, int count) if (count == 0) return; - Node head, tail; head = tail = new Node(items[startIndex]); for (int i = startIndex + 1; i < startIndex + count; i++) @@ -410,7 +409,7 @@ private static void ValidatePushPopRangeInput(T[] items, int startIndex, int cou throw new ArgumentOutOfRangeException(nameof(count), SR.ConcurrentStack_PushPopRange_CountOutOfRange); } int length = items.Length; - if (startIndex >= length || startIndex < 0) + if (startIndex > length || startIndex < 0) { throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ConcurrentStack_PushPopRange_StartOutOfRange); } diff --git a/src/libraries/System.Collections.Concurrent/tests/ConcurrentStackTests.cs b/src/libraries/System.Collections.Concurrent/tests/ConcurrentStackTests.cs index 51484a559afdde..9756b3ad97b422 100644 --- a/src/libraries/System.Collections.Concurrent/tests/ConcurrentStackTests.cs +++ b/src/libraries/System.Collections.Concurrent/tests/ConcurrentStackTests.cs @@ -63,6 +63,37 @@ public void PushRange_NoItems_NothingAdded() Assert.True(s.IsEmpty); } + [Fact] + public void PushRange_NoItems_NothingAdded_EmptyArrayWithRangeSpecified() + { + var s = new ConcurrentStack(); + Assert.True(s.IsEmpty); + + s.PushRange(new int[0], 0, 0); + Assert.True(s.IsEmpty); + } + + [Fact] + public void PushRange_NoItems_NothingAdded_NonEmptyArrayWithZeroCountSpecified() + { + var s = new ConcurrentStack(); + Assert.True(s.IsEmpty); + + int[] arr = new int[2]; + s.PushRange(arr, arr.Length, 0); + Assert.True(s.IsEmpty); + } + + [Fact] + public void PushRange_NoItems_NothingAdded_EmptyArrayNoRangeSpecified() + { + var s = new ConcurrentStack(); + Assert.True(s.IsEmpty); + + s.PushRange(new int[0]); + Assert.True(s.IsEmpty); + } + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [InlineData(8, 10)] [InlineData(16, 100)] @@ -134,6 +165,7 @@ public void PushRange_InvalidArguments_Throws() Assert.Throws(() => stack.PushRange(new int[1], 0, -1)); Assert.Throws(() => stack.PushRange(new int[1], -1, 1)); Assert.Throws(() => stack.PushRange(new int[1], 2, 1)); + AssertExtensions.Throws(null, () => stack.PushRange(new int[0], 0, 1)); AssertExtensions.Throws(null, () => stack.PushRange(new int[1], 0, 10)); } diff --git a/src/libraries/System.Collections/ref/System.Collections.cs b/src/libraries/System.Collections/ref/System.Collections.cs index ceaadeb8ba6696..7a15ca70fb3e51 100644 --- a/src/libraries/System.Collections/ref/System.Collections.cs +++ b/src/libraries/System.Collections/ref/System.Collections.cs @@ -47,6 +47,8 @@ public static partial class CollectionExtensions public static TValue GetValueOrDefault(this System.Collections.Generic.IReadOnlyDictionary dictionary, TKey key, TValue defaultValue) { throw null; } public static bool Remove(this System.Collections.Generic.IDictionary dictionary, TKey key, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TValue value) { throw null; } public static bool TryAdd(this System.Collections.Generic.IDictionary dictionary, TKey key, TValue value) { throw null; } + public static System.Collections.ObjectModel.ReadOnlyCollection AsReadOnly(this IList list) { throw null; } + public static System.Collections.ObjectModel.ReadOnlyDictionary AsReadOnly(this IDictionary dictionary) where TKey : notnull { throw null; } } public abstract partial class Comparer : System.Collections.Generic.IComparer, System.Collections.IComparer { @@ -606,10 +608,13 @@ public void Clear() { } public bool ContainsKey(TKey key) { throw null; } public bool ContainsValue(TValue value) { throw null; } public System.Collections.Generic.IEnumerator> GetEnumerator() { throw null; } + public TKey GetKeyAtIndex(int index) { throw null; } + public TValue GetValueAtIndex(int index) { throw null; } public int IndexOfKey(TKey key) { throw null; } public int IndexOfValue(TValue value) { throw null; } public bool Remove(TKey key) { throw null; } public void RemoveAt(int index) { } + public void SetValueAtIndex(int index, TValue value) { } void System.Collections.Generic.ICollection>.Add(System.Collections.Generic.KeyValuePair keyValuePair) { } bool System.Collections.Generic.ICollection>.Contains(System.Collections.Generic.KeyValuePair keyValuePair) { throw null; } void System.Collections.Generic.ICollection>.CopyTo(System.Collections.Generic.KeyValuePair[] array, int arrayIndex) { } diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/CollectionExtensions.cs b/src/libraries/System.Collections/src/System/Collections/Generic/CollectionExtensions.cs index 7a5bce9b0a1d4e..4f5c545603dbbe 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/CollectionExtensions.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/CollectionExtensions.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Collections.ObjectModel; using System.Diagnostics.CodeAnalysis; namespace System.Collections.Generic @@ -55,5 +56,32 @@ public static bool Remove(this IDictionary dictionar value = default; return false; } + + /// + /// Returns a read-only wrapper + /// for the specified list. + /// + /// The type of elements in the collection. + /// The list to wrap. + /// An object that acts as a read-only wrapper around the current . + /// is null. + public static ReadOnlyCollection AsReadOnly(this IList list) + { + return new ReadOnlyCollection(list); + } + + /// + /// Returns a read-only wrapper + /// for the current dictionary. + /// + /// The type of keys in the dictionary. + /// The type of values in the dictionary. + /// The dictionary to wrap. + /// An object that acts as a read-only wrapper around the current . + /// is null. + public static ReadOnlyDictionary AsReadOnly(this IDictionary dictionary) where TKey : notnull + { + return new ReadOnlyDictionary(dictionary); + } } } diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/SortedList.cs b/src/libraries/System.Collections/src/System/Collections/Generic/SortedList.cs index a7168b5ae0384c..1a96e7c79d18e3 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/SortedList.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/SortedList.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; @@ -536,13 +536,22 @@ private void EnsureCapacity(int min) } // Returns the value of the entry at the given index. - private TValue GetByIndex(int index) + public TValue GetValueAtIndex(int index) { if (index < 0 || index >= _size) throw new ArgumentOutOfRangeException(nameof(index), index, SR.ArgumentOutOfRange_Index); return values[index]; } + // Sets the value of the entry at the given index. + public void SetValueAtIndex(int index, TValue value) + { + if (index < 0 || index >= _size) + throw new ArgumentOutOfRangeException(nameof(index), index, SR.ArgumentOutOfRange_Index); + values[index] = value; + version++; + } + public IEnumerator> GetEnumerator() { return new Enumerator(this, Enumerator.KeyValuePair); @@ -564,7 +573,7 @@ IEnumerator IEnumerable.GetEnumerator() } // Returns the key of the entry at the given index. - private TKey GetKey(int index) + public TKey GetKeyAtIndex(int index) { if (index < 0 || index >= _size) throw new ArgumentOutOfRangeException(nameof(index), index, SR.ArgumentOutOfRange_Index); @@ -1082,7 +1091,7 @@ public TKey this[int index] { get { - return _dict.GetKey(index); + return _dict.GetKeyAtIndex(index); } set { @@ -1201,7 +1210,7 @@ public TValue this[int index] { get { - return _dict.GetByIndex(index); + return _dict.GetValueAtIndex(index); } set { diff --git a/src/libraries/System.Collections/tests/Generic/CollectionExtensionsTests.cs b/src/libraries/System.Collections/tests/Generic/CollectionExtensionsTests.cs index 153a3111907685..213d9d6faca996 100644 --- a/src/libraries/System.Collections/tests/Generic/CollectionExtensionsTests.cs +++ b/src/libraries/System.Collections/tests/Generic/CollectionExtensionsTests.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; +using System.Collections.ObjectModel; using Xunit; namespace System.Collections.Tests @@ -104,5 +105,39 @@ public void Remove_KeyDoesntExistInIDictionary_ReturnsFalse() Assert.False(dictionary.Remove("key", out var value)); Assert.Equal(default(string), value); } + + [Fact] + public void AsReadOnly_TurnsIListIntoReadOnlyCollection() + { + IList list = new List { "A", "B" }; + ReadOnlyCollection readOnlyCollection = list.AsReadOnly(); + Assert.NotNull(readOnlyCollection); + CollectionAsserts.Equal(list, readOnlyCollection); + } + + [Fact] + public void AsReadOnly_TurnsIDictionaryIntoReadOnlyDictionary() + { + IDictionary dictionary = new Dictionary { ["key1"] = "value1", ["key2"] = "value2" }; + ReadOnlyDictionary readOnlyDictionary = dictionary.AsReadOnly(); + Assert.NotNull(readOnlyDictionary); + Assert.Equal(dictionary["key1"], readOnlyDictionary["key1"]); + Assert.Equal(dictionary["key2"], readOnlyDictionary["key2"]); + Assert.Equal(dictionary.Count, readOnlyDictionary.Count); + } + + [Fact] + public void AsReadOnly_NullIList_ThrowsArgumentNullException() + { + IList list = null; + Assert.Throws("list", () => list.AsReadOnly()); + } + + [Fact] + public void AsReadOnly_NullIDictionary_ThrowsArgumentNullException() + { + IDictionary dictionary = null; + Assert.Throws("dictionary", () => dictionary.AsReadOnly()); + } } } diff --git a/src/libraries/System.Collections/tests/Generic/SortedList/SortedList.Generic.Tests.cs b/src/libraries/System.Collections/tests/Generic/SortedList/SortedList.Generic.Tests.cs index f31ede5b3040f4..8e4790f6d9930f 100644 --- a/src/libraries/System.Collections/tests/Generic/SortedList/SortedList.Generic.Tests.cs +++ b/src/libraries/System.Collections/tests/Generic/SortedList/SortedList.Generic.Tests.cs @@ -259,6 +259,59 @@ public void SortedList_Generic_ContainsValue_DefaultValuePresent(int count) #endregion + #region GetKeyAtIndex + + [Theory] + [MemberData(nameof(ValidCollectionSizes))] + public void SortedList_Generic_GetKeyAtIndex_EveryIndex(int count) + { + SortedList dictionary = (SortedList)GenericIDictionaryFactory(count); + Assert.All(Enumerable.Range(0, count), index => + { + Assert.Equal(index, dictionary.IndexOfKey(dictionary.GetKeyAtIndex(index))); + }); + } + + [Theory] + [MemberData(nameof(ValidCollectionSizes))] + public void SortedList_Generic_GetKeyAtIndex_OutOfRangeIndicies(int count) + { + SortedList dictionary = (SortedList)GenericIDictionaryFactory(count); + Assert.Throws(() => dictionary.GetKeyAtIndex(-1)); + Assert.Throws(() => dictionary.GetKeyAtIndex(int.MinValue)); + Assert.Throws(() => dictionary.GetKeyAtIndex(count)); + Assert.Throws(() => dictionary.GetKeyAtIndex(count + 1)); + } + + #endregion + + #region GetValueAtIndex + + [Theory] + [MemberData(nameof(ValidCollectionSizes))] + public void SortedList_Generic_GetValueAtIndex_EveryIndex(int count) + { + // Assumes no duplicate elements contained in the dictionary returned by GenericIDictionaryFactory + SortedList dictionary = (SortedList)GenericIDictionaryFactory(count); + Assert.All(Enumerable.Range(0, count), index => + { + Assert.Equal(index, dictionary.IndexOfValue(dictionary.GetValueAtIndex(index))); + }); + } + + [Theory] + [MemberData(nameof(ValidCollectionSizes))] + public void SortedList_Generic_GetValueAtIndex_OutOfRangeIndicies(int count) + { + SortedList dictionary = (SortedList)GenericIDictionaryFactory(count); + Assert.Throws(() => dictionary.GetValueAtIndex(-1)); + Assert.Throws(() => dictionary.GetValueAtIndex(int.MinValue)); + Assert.Throws(() => dictionary.GetValueAtIndex(count)); + Assert.Throws(() => dictionary.GetValueAtIndex(count + 1)); + } + + #endregion + #region IndexOfKey [Theory] @@ -377,6 +430,73 @@ public void SortedList_Generic_IndexOfValue_EachValue(int count) #endregion + #region SetValueAtIndex + + [Theory] + [MemberData(nameof(ValidCollectionSizes))] + public void SortedList_Generic_SetValueAtIndex_OnReadOnlySortedList_ThrowsNotSupportedException(int count) + { + if (IsReadOnly) + { + SortedList dictionary = (SortedList)GenericIDictionaryFactory(count); + Assert.Throws(() => dictionary.SetValueAtIndex(0, CreateTValue(34543))); + } + } + + [Theory] + [MemberData(nameof(ValidCollectionSizes))] + public void SortedList_Generic_SetValueAtIndex_NonDefaultValueContainedInCollection(int count) + { + if (!IsReadOnly) + { + int seed = count * 251; + SortedList dictionary = (SortedList)GenericIDictionaryFactory(count); + KeyValuePair pair = CreateT(seed++); + if (!dictionary.ContainsKey(pair.Key)) + { + dictionary.Add(pair.Key, pair.Value); + count++; + } + TValue newValue = CreateTValue(seed++); + dictionary.SetValueAtIndex(dictionary.IndexOfKey(pair.Key), newValue); + Assert.Equal(newValue, dictionary[pair.Key]); + } + } + + [Theory] + [MemberData(nameof(ValidCollectionSizes))] + public void SortedList_Generic_SetValueAtIndex_EveryIndex(int count) + { + if (!IsReadOnly) + { + int seed = count * 193; + SortedList dictionary = (SortedList)GenericIDictionaryFactory(count); + TValue newValue = CreateTValue(seed++); + Assert.All(Enumerable.Range(0, count), index => + { + Assert.NotEqual(newValue, dictionary.GetValueAtIndex(index)); + dictionary.SetValueAtIndex(index, newValue); + Assert.Equal(newValue, dictionary.GetValueAtIndex(index)); + }); + } + } + + [Theory] + [MemberData(nameof(ValidCollectionSizes))] + public void SortedList_Generic_SetValueAtIndex_OutOfRangeIndicies(int count) + { + if (!IsReadOnly) + { + SortedList dictionary = (SortedList)GenericIDictionaryFactory(count); + Assert.Throws(() => dictionary.SetValueAtIndex(-1, default)); + Assert.Throws(() => dictionary.SetValueAtIndex(int.MinValue, default)); + Assert.Throws(() => dictionary.SetValueAtIndex(count, default)); + Assert.Throws(() => dictionary.SetValueAtIndex(count + 1, default)); + } + } + + #endregion + #region RemoveAt private void RemoveAt(SortedList dictionary, KeyValuePair element) diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReflectTypeDescriptionProvider.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReflectTypeDescriptionProvider.cs index ef3cc90c16dbb0..2e7dc3253411b3 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReflectTypeDescriptionProvider.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ReflectTypeDescriptionProvider.cs @@ -69,14 +69,23 @@ internal sealed partial class ReflectTypeDescriptionProvider : TypeDescriptionPr // These are attributes that, when we discover them on interfaces, we do // not merge them into the attribute set for a class. - private static readonly Type[] s_skipInterfaceAttributeList = new Type[] + private static readonly Type[] s_skipInterfaceAttributeList = InitializeSkipInterfaceAttributeList(); + + [UnconditionalSuppressMessage ("ReflectionAnalysis", "IL2045:AttributeRemoval", + Justification = "The ComVisibleAttribute is marked for removal and it's referenced here. Since this array" + + "contains only attributes which are going to be ignored, removing such attribute" + + "will not break the functionality in any way.")] + private static Type[] InitializeSkipInterfaceAttributeList() { + return new Type[] + { #if FEATURE_SKIP_INTERFACE - typeof(System.Runtime.InteropServices.GuidAttribute), - typeof(System.Runtime.InteropServices.InterfaceTypeAttribute) + typeof(System.Runtime.InteropServices.GuidAttribute), + typeof(System.Runtime.InteropServices.InterfaceTypeAttribute) #endif - typeof(System.Runtime.InteropServices.ComVisibleAttribute), - }; + typeof(System.Runtime.InteropServices.ComVisibleAttribute), + }; + } internal static Guid ExtenderProviderKey { get; } = Guid.NewGuid(); diff --git a/src/libraries/System.ComponentModel.TypeConverter/tests/Drawing/PointConverterTests.cs b/src/libraries/System.ComponentModel.TypeConverter/tests/Drawing/PointConverterTests.cs index 8509731bc9d9d3..90b7c95ecce985 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/tests/Drawing/PointConverterTests.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/tests/Drawing/PointConverterTests.cs @@ -195,7 +195,7 @@ public void GetProperties() Assert.Equal(1, props["Y"].GetValue(pt)); Assert.Equal((object)false, props["IsEmpty"].GetValue(pt)); - // Pick an attibute that cannot be applied to properties to make sure everything gets filtered + // Pick an attribute that cannot be applied to properties to make sure everything gets filtered props = Converter.GetProperties(null, new Point(1, 1), new Attribute[] { new System.Reflection.AssemblyCopyrightAttribute("")}); Assert.Equal(0, props.Count); } diff --git a/src/libraries/System.ComponentModel.TypeConverter/tests/Drawing/RectangleConverterTests.cs b/src/libraries/System.ComponentModel.TypeConverter/tests/Drawing/RectangleConverterTests.cs index a2f0f9b5ba62e1..4c939f8a61228f 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/tests/Drawing/RectangleConverterTests.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/tests/Drawing/RectangleConverterTests.cs @@ -205,7 +205,7 @@ public void TestGetProperties() Assert.Equal(rect.Size, propsColl["Size"].GetValue(rect)); Assert.Equal(rect.IsEmpty, propsColl["IsEmpty"].GetValue(rect)); - // Pick an attibute that cannot be applied to properties to make sure everything gets filtered + // Pick an attribute that cannot be applied to properties to make sure everything gets filtered propsColl = Converter.GetProperties(null, new Rectangle(10, 10, 20, 30), new Attribute[] { new System.Reflection.AssemblyCopyrightAttribute("")}); Assert.Equal(0, propsColl.Count); } diff --git a/src/libraries/System.ComponentModel.TypeConverter/tests/Drawing/SizeConverterTests.cs b/src/libraries/System.ComponentModel.TypeConverter/tests/Drawing/SizeConverterTests.cs index 63ada2b2b870af..478e29c86f801e 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/tests/Drawing/SizeConverterTests.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/tests/Drawing/SizeConverterTests.cs @@ -195,7 +195,7 @@ public void GetProperties() Assert.Equal(1, props["Height"].GetValue(pt)); Assert.Equal((object)false, props["IsEmpty"].GetValue(pt)); - // Pick an attibute that cannot be applied to properties to make sure everything gets filtered + // Pick an attribute that cannot be applied to properties to make sure everything gets filtered props = Converter.GetProperties(null, new Size(1, 1), new Attribute[] { new System.Reflection.AssemblyCopyrightAttribute("")}); Assert.Equal(0, props.Count); } diff --git a/src/libraries/System.ComponentModel.TypeConverter/tests/Drawing/SizeFConverterTests.cs b/src/libraries/System.ComponentModel.TypeConverter/tests/Drawing/SizeFConverterTests.cs index b7386313a4a315..6d19fedaf5b1d8 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/tests/Drawing/SizeFConverterTests.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/tests/Drawing/SizeFConverterTests.cs @@ -193,7 +193,7 @@ public void GetProperties() Assert.Equal(1f, props["Height"].GetValue(pt)); Assert.Equal((object)false, props["IsEmpty"].GetValue(pt)); - // Pick an attibute that cannot be applied to properties to make sure everything gets filtered + // Pick an attribute that cannot be applied to properties to make sure everything gets filtered props = Converter.GetProperties(null, new SizeF(1, 1), new Attribute[] { new System.Reflection.AssemblyCopyrightAttribute("")}); Assert.Equal(0, props.Count); } diff --git a/src/libraries/System.ComponentModel.TypeConverter/tests/MemberDescriptorTests.cs b/src/libraries/System.ComponentModel.TypeConverter/tests/MemberDescriptorTests.cs index 03fc458176a10f..651a4858d498ae 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/tests/MemberDescriptorTests.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/tests/MemberDescriptorTests.cs @@ -9,11 +9,8 @@ namespace System.ComponentModel.Tests { - [CollectionDefinition("NoParallelTests", DisableParallelization = true)] - public partial class NoParallelTests { } - // Mutable static comparision in the implementation - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public class MemberDescriptorTests { [Theory] diff --git a/src/libraries/System.ComponentModel.TypeConverter/tests/ReflectionCachesUpdateHandlerTests.cs b/src/libraries/System.ComponentModel.TypeConverter/tests/ReflectionCachesUpdateHandlerTests.cs index 84a7069bed6e35..2bf4e13a643c1e 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/tests/ReflectionCachesUpdateHandlerTests.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/tests/ReflectionCachesUpdateHandlerTests.cs @@ -7,7 +7,7 @@ namespace System.ComponentModel.Tests { [SimpleUpdateTest] - [Collection("NoParallelTests")] // Clears the cache which disrupts concurrent tests + [Collection(nameof(DisableParallelization))] // Clears the cache which disrupts concurrent tests public class ReflectionCachesUpdateHandlerTests { [Fact] diff --git a/src/libraries/System.ComponentModel.TypeConverter/tests/System.ComponentModel.TypeConverter.Tests.csproj b/src/libraries/System.ComponentModel.TypeConverter/tests/System.ComponentModel.TypeConverter.Tests.csproj index c710dd0aa1ae83..61850c94c0414b 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/tests/System.ComponentModel.TypeConverter.Tests.csproj +++ b/src/libraries/System.ComponentModel.TypeConverter/tests/System.ComponentModel.TypeConverter.Tests.csproj @@ -153,6 +153,8 @@ + diff --git a/src/libraries/System.ComponentModel.TypeConverter/tests/TypeDescriptorTests.cs b/src/libraries/System.ComponentModel.TypeConverter/tests/TypeDescriptorTests.cs index d1754653b81c85..c14858258af065 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/tests/TypeDescriptorTests.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/tests/TypeDescriptorTests.cs @@ -10,7 +10,7 @@ namespace System.ComponentModel.Tests { - [Collection("NoParallelTests")] // manipulates cache + [Collection(nameof(DisableParallelization))] // manipulates cache public class TypeDescriptorTests { [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // Mock will try to JIT diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/BaseConfigurationRecord.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/BaseConfigurationRecord.cs index 9adac8c52ded95..d798088fe9d416 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/BaseConfigurationRecord.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/BaseConfigurationRecord.cs @@ -63,7 +63,7 @@ internal abstract class BaseConfigurationRecord : IInternalConfigRecord protected const string LocationInheritInChildApplicationsAttribute = "inheritInChildApplications"; protected const string ConfigSourceAttribute = "configSource"; - internal const string ProtectionProviderAttibute = "configProtectionProvider"; + internal const string ProtectionProviderAttribute = "configProtectionProvider"; protected const string FormatNewConfigFile = "\r\n"; protected const string FormatConfiguration = "\r\n"; @@ -1505,7 +1505,7 @@ private ConfigXmlReader LoadConfigSource(string name, SectionXmlInfo sectionXmlI throw new ConfigurationErrorsException(SR.Config_source_file_format, xmlUtil); // Check for protectionProvider - string protectionProviderAttribute = xmlUtil.Reader.GetAttribute(ProtectionProviderAttibute); + string protectionProviderAttribute = xmlUtil.Reader.GetAttribute(ProtectionProviderAttribute); if (protectionProviderAttribute != null) { if (xmlUtil.Reader.AttributeCount != 1) @@ -2541,7 +2541,7 @@ private void ScanSectionsRecursive( } } - string protectionProviderAttribute = xmlUtil.Reader.GetAttribute(ProtectionProviderAttibute); + string protectionProviderAttribute = xmlUtil.Reader.GetAttribute(ProtectionProviderAttribute); if (protectionProviderAttribute != null) { try 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 d1f82070c295b9..c9203656dea95a 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationElement.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationElement.cs @@ -402,7 +402,7 @@ internal void HandleLockedAttributes(ConfigurationElement source) } else { - // don't error when optional attibute are not defined yet + // don't error when optional attribute are not defined yet if (ElementInformation.Properties[propInfo.Name].ValueOrigin == PropertyValueOrigin.SetHere) { diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ProtectedConfigurationSection.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ProtectedConfigurationSection.cs index 1b2d903c0d8efd..9f70aa41620985 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ProtectedConfigurationSection.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ProtectedConfigurationSection.cs @@ -95,7 +95,7 @@ internal static string FormatEncryptedSection(string encryptedXml, string sectio { return string.Format(CultureInfo.InvariantCulture, EncryptedSectionTemplate, sectionName, // The section to encrypt - BaseConfigurationRecord.ProtectionProviderAttibute, // protectionProvider keyword + BaseConfigurationRecord.ProtectionProviderAttribute, // protectionProvider keyword providerName, // The provider name encryptedXml // the encrypted xml ); diff --git a/src/libraries/System.Console/src/System/IO/StdInReader.cs b/src/libraries/System.Console/src/System/IO/StdInReader.cs index 93c6595f2b10b2..fe0ab79f4fb7b6 100644 --- a/src/libraries/System.Console/src/System/IO/StdInReader.cs +++ b/src/libraries/System.Console/src/System/IO/StdInReader.cs @@ -116,12 +116,14 @@ public int ReadLine(Span buffer) int charsUsedTotal = 0; foreach (ReadOnlyMemory chunk in _readLineSB.GetChunks()) { + Debug.Assert(!buffer.IsEmpty); + encoder.Convert(chunk.Span, buffer, flush: false, out int charsUsed, out int bytesUsed, out bool completed); buffer = buffer.Slice(bytesUsed); bytesUsedTotal += bytesUsed; charsUsedTotal += charsUsed; - if (charsUsed == 0) + if (!completed || buffer.IsEmpty) { break; } diff --git a/src/libraries/System.Console/tests/ManualTests/ManualTests.cs b/src/libraries/System.Console/tests/ManualTests/ManualTests.cs index 70482d365b55f4..322322d0836330 100644 --- a/src/libraries/System.Console/tests/ManualTests/ManualTests.cs +++ b/src/libraries/System.Console/tests/ManualTests/ManualTests.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using System.Threading.Tasks; using System.IO; +using System.Text; using Xunit; namespace System @@ -45,6 +46,23 @@ public static void ReadLineFromOpenStandardInput() AssertUserExpectedResults("the characters you typed properly echoed as you typed"); } + [ConditionalFact(nameof(ManualTestsEnabled))] + public static void ReadFromOpenStandardInput() + { + // The implementation in StdInReader uses a StringBuilder for caching. We want this builder to use + // multiple chunks. So the expectedLine is longer than 16 characters (StringBuilder.DefaultCapacity). + string expectedLine = $"This is a test for ReadFromOpenStandardInput."; + Assert.True(expectedLine.Length > new StringBuilder().Capacity); + Console.WriteLine($"Please type the sentence (without the quotes): \"{expectedLine}\""); + using Stream inputStream = Console.OpenStandardInput(); + for (int i = 0; i < expectedLine.Length; i++) + { + Assert.Equal((byte)expectedLine[i], inputStream.ReadByte()); + } + Assert.Equal((byte)'\n', inputStream.ReadByte()); + AssertUserExpectedResults("the characters you typed properly echoed as you typed"); + } + [ConditionalFact(nameof(ManualTestsEnabled))] public static void ConsoleReadSupportsBackspace() { diff --git a/src/libraries/System.Console/tests/SetOut.cs b/src/libraries/System.Console/tests/SetOut.cs index 83d0f95f6e69e5..c1a893c9e7691a 100644 --- a/src/libraries/System.Console/tests/SetOut.cs +++ b/src/libraries/System.Console/tests/SetOut.cs @@ -5,6 +5,7 @@ using System.IO; using Xunit; +[Collection(nameof(DisableParallelization))] // Console.Out is a static singleton, other tests should not be using it at the same time public class SetOut { [Fact] @@ -28,7 +29,6 @@ public static void SetOutReadLine() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/57935", TestPlatforms.AnyUnix)] public static void SetOutReadToEnd() { Helpers.SetAndReadHelper(tw => Console.SetOut(tw), () => Console.Out, sr => sr.ReadToEnd()); diff --git a/src/libraries/System.Console/tests/System.Console.Tests.csproj b/src/libraries/System.Console/tests/System.Console.Tests.csproj index f92a0cdfc4913b..3c83ac5db2f9ea 100644 --- a/src/libraries/System.Console/tests/System.Console.Tests.csproj +++ b/src/libraries/System.Console/tests/System.Console.Tests.csproj @@ -28,6 +28,8 @@ Link="Common\System\IO\InterceptStreamWriter.cs" /> + 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 08648e6d29c26c..3759b0a04ddd0a 100644 --- a/src/libraries/System.Data.Common/src/System/Data/DataTable.cs +++ b/src/libraries/System.Data.Common/src/System/Data/DataTable.cs @@ -2482,7 +2482,7 @@ private DataTable CloneTo(DataTable clone, DataSet? cloneDS, bool skipExpression if (foreign.Table == foreign.RelatedTable && foreign.Clone(clone) is ForeignKeyConstraint newforeign) { - // we cant make sure that we recieve a cloned FKC,since it depends if table and relatedtable be the same + // we cant make sure that we receive a cloned FKC,since it depends if table and relatedtable be the same clone.Constraints.Add(newforeign); } } 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 ab2fef64dbc51f..f103604b74c9f2 100644 --- a/src/libraries/System.Data.Common/src/System/Data/XMLSchema.cs +++ b/src/libraries/System.Data.Common/src/System/Data/XMLSchema.cs @@ -2095,7 +2095,7 @@ internal void HandleSimpleTypeSimpleContentColumn(XmlSchemaSimpleType typeNode, [RequiresUnreferencedCode(DataSet.RequiresUnreferencedCodeMessage)] internal void HandleSimpleContentColumn(string strType, DataTable table, bool isBase, XmlAttribute[]? attrs, bool isNillable) { - // for Named Simple type support : We should not recieved anything here other than string. + // for Named Simple type support : We should not received anything here other than string. // there can not be typed simple content // disallow multiple simple content columns for the table if (FromInference && table.XmlText != null) // backward compatability for inference 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 738028b8dcd6f2..9cc4d09bf298b6 100644 --- a/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj +++ b/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj @@ -3,6 +3,8 @@ true $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-illumos;$(NetCoreAppCurrent)-Solaris;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum)-FreeBSD;$(NetCoreAppMinimum)-Linux;$(NetCoreAppMinimum)-OSX;$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) $(NoWarn);CA2249;CA1838 + + $(NoWarn);CA1845 enable true Provides a collection of classes used to access an ODBC data source in the managed space @@ -145,6 +147,7 @@ System.Data.Odbc.OdbcTransaction + @@ -158,6 +161,7 @@ System.Data.Odbc.OdbcTransaction + diff --git a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/Odbc32.cs b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/Odbc32.cs index 6c326926ba576e..0eefd1d2cdb859 100644 --- a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/Odbc32.cs +++ b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/Odbc32.cs @@ -90,15 +90,15 @@ internal static Exception CantSetPropertyOnOpenConnection() { return ADP.InvalidOperation(SR.GetString(SR.Odbc_CantSetPropertyOnOpenConnection)); } - internal static Exception CantEnableConnectionpooling(ODBC32.RetCode retcode) + internal static Exception CantEnableConnectionpooling(ODBC32.SQLRETURN retcode) { return ADP.DataAdapter(SR.GetString(SR.Odbc_CantEnableConnectionpooling, ODBC32.RetcodeToString(retcode))); } - internal static Exception CantAllocateEnvironmentHandle(ODBC32.RetCode retcode) + internal static Exception CantAllocateEnvironmentHandle(ODBC32.SQLRETURN retcode) { return ADP.DataAdapter(SR.GetString(SR.Odbc_CantAllocateEnvironmentHandle, ODBC32.RetcodeToString(retcode))); } - internal static Exception FailedToGetDescriptorHandle(ODBC32.RetCode retcode) + internal static Exception FailedToGetDescriptorHandle(ODBC32.SQLRETURN retcode) { return ADP.DataAdapter(SR.GetString(SR.Odbc_FailedToGetDescriptorHandle, ODBC32.RetcodeToString(retcode))); } @@ -112,7 +112,7 @@ internal static Exception UnknownOdbcType(OdbcType odbctype) } internal const string Pwd = "pwd"; - internal static void TraceODBC(int level, string method, ODBC32.RetCode retcode) + internal static void TraceODBC(int level, string method, ODBC32.SQLRETURN retcode) { } @@ -133,7 +133,7 @@ internal enum SQL_HANDLE : short } // must be public because it is serialized by OdbcException - internal enum RetCode : short + internal enum SQLRETURN : short { SUCCESS = 0, SUCCESS_WITH_INFO = 1, @@ -142,18 +142,18 @@ internal enum RetCode : short NO_DATA = 100, } - internal static string RetcodeToString(RetCode retcode) + internal static string RetcodeToString(SQLRETURN retcode) { switch (retcode) { - case RetCode.SUCCESS: return "SUCCESS"; - case RetCode.SUCCESS_WITH_INFO: return "SUCCESS_WITH_INFO"; - case RetCode.ERROR: return "ERROR"; - case RetCode.INVALID_HANDLE: return "INVALID_HANDLE"; - case RetCode.NO_DATA: return "NO_DATA"; + case SQLRETURN.SUCCESS: return "SUCCESS"; + case SQLRETURN.SUCCESS_WITH_INFO: return "SUCCESS_WITH_INFO"; + case SQLRETURN.ERROR: return "ERROR"; + case SQLRETURN.INVALID_HANDLE: return "INVALID_HANDLE"; + case SQLRETURN.NO_DATA: return "NO_DATA"; default: Debug.Fail("Unknown enumerator passed to RetcodeToString method"); - goto case RetCode.ERROR; + goto case SQLRETURN.ERROR; } } @@ -716,17 +716,17 @@ internal enum SQL_SPECIALCOLUMNSET : short internal const short SQL_RESULT_COL = 3; // Helpers - internal static OdbcErrorCollection GetDiagErrors(string? source, OdbcHandle hrHandle, RetCode retcode) + internal static OdbcErrorCollection GetDiagErrors(string? source, OdbcHandle hrHandle, SQLRETURN retcode) { OdbcErrorCollection errors = new OdbcErrorCollection(); GetDiagErrors(errors, source, hrHandle, retcode); return errors; } - internal static void GetDiagErrors(OdbcErrorCollection errors, string? source, OdbcHandle hrHandle, RetCode retcode) + internal static void GetDiagErrors(OdbcErrorCollection errors, string? source, OdbcHandle hrHandle, SQLRETURN retcode) { - Debug.Assert(retcode != ODBC32.RetCode.INVALID_HANDLE, "retcode must never be ODBC32.RetCode.INVALID_HANDLE"); - if (RetCode.SUCCESS != retcode) + Debug.Assert(retcode != ODBC32.SQLRETURN.INVALID_HANDLE, "retcode must never be ODBC32.RetCode.INVALID_HANDLE"); + if (SQLRETURN.SUCCESS != retcode) { int NativeError; short iRec = 0; @@ -740,7 +740,7 @@ internal static void GetDiagErrors(OdbcErrorCollection errors, string? source, O ++iRec; retcode = hrHandle.GetDiagnosticRecord(iRec, out sqlState, message, out NativeError, out cchActual); - if ((RetCode.SUCCESS_WITH_INFO == retcode) && (message.Capacity - 1 < cchActual)) + if ((SQLRETURN.SUCCESS_WITH_INFO == retcode) && (message.Capacity - 1 < cchActual)) { message.Capacity = cchActual + 1; retcode = hrHandle.GetDiagnosticRecord(iRec, out sqlState, message, out NativeError, out cchActual); @@ -748,7 +748,7 @@ internal static void GetDiagErrors(OdbcErrorCollection errors, string? source, O //Note: SUCCESS_WITH_INFO from SQLGetDiagRec would be because //the buffer is not large enough for the error string. - moreerrors = (retcode == RetCode.SUCCESS || retcode == RetCode.SUCCESS_WITH_INFO); + moreerrors = (retcode == SQLRETURN.SUCCESS || retcode == SQLRETURN.SUCCESS_WITH_INFO); if (moreerrors) { //Sets up the InnerException as well... diff --git a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcCommand.cs b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcCommand.cs index eb77a4c8c1951d..749c45d7f50ffb 100644 --- a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcCommand.cs +++ b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcCommand.cs @@ -449,13 +449,13 @@ public override void Cancel() lock (stmt) { // Cancel the statement - ODBC32.RetCode retcode = stmt.Cancel(); + ODBC32.SQLRETURN retcode = stmt.Cancel(); // copy of StatementErrorHandler, because stmt may become null switch (retcode) { - case ODBC32.RetCode.SUCCESS: - case ODBC32.RetCode.SUCCESS_WITH_INFO: + case ODBC32.SQLRETURN.SUCCESS: + case ODBC32.SQLRETURN.SUCCESS_WITH_INFO: // don't fire info message events on cancel break; default: @@ -602,7 +602,7 @@ private OdbcDataReader ExecuteReaderObject(CommandBehavior behavior, behavior |= CommandBehavior.SingleResult; } - ODBC32.RetCode retcode; + ODBC32.SQLRETURN retcode; OdbcStatementHandle stmt = GetStatementHandle().StatementHandle!; _cmdWrapper!.Canceling = false; @@ -674,7 +674,7 @@ private OdbcDataReader ExecuteReaderObject(CommandBehavior behavior, { retcode = stmt.Prepare(CommandText); - if (ODBC32.RetCode.SUCCESS != retcode) + if (ODBC32.SQLRETURN.SUCCESS != retcode) { _connection!.HandleError(stmt, retcode); } @@ -721,14 +721,14 @@ private OdbcDataReader ExecuteReaderObject(CommandBehavior behavior, { short cColsAffected; retcode = stmt.NumberOfResultColumns(out cColsAffected); - if (retcode == ODBC32.RetCode.SUCCESS || retcode == ODBC32.RetCode.SUCCESS_WITH_INFO) + if (retcode == ODBC32.SQLRETURN.SUCCESS || retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO) { if (cColsAffected > 0) { localReader.GetSchemaTable(); } } - else if (retcode == ODBC32.RetCode.NO_DATA) + else if (retcode == ODBC32.SQLRETURN.NO_DATA) { // do nothing } @@ -807,7 +807,7 @@ private OdbcDataReader ExecuteReaderObject(CommandBehavior behavior, } //Note: Execute will return NO_DATA for Update/Delete non-row returning queries - if ((ODBC32.RetCode.SUCCESS != retcode) && (ODBC32.RetCode.NO_DATA != retcode)) + if ((ODBC32.SQLRETURN.SUCCESS != retcode) && (ODBC32.SQLRETURN.NO_DATA != retcode)) { _connection!.HandleError(stmt, retcode); } @@ -890,7 +890,7 @@ private void PropertyChanging() // public override void Prepare() { - ODBC32.RetCode retcode; + ODBC32.SQLRETURN retcode; ValidateOpenConnection(ADP.Prepare); @@ -912,7 +912,7 @@ public override void Prepare() retcode = stmt.Prepare(CommandText); - if (ODBC32.RetCode.SUCCESS != retcode) + if (ODBC32.SQLRETURN.SUCCESS != retcode) { _connection.HandleError(stmt, retcode); } @@ -923,12 +923,12 @@ public override void Prepare() private void TrySetStatementAttribute(OdbcStatementHandle stmt, ODBC32.SQL_ATTR stmtAttribute, IntPtr value) { - ODBC32.RetCode retcode = stmt.SetStatementAttribute( + ODBC32.SQLRETURN retcode = stmt.SetStatementAttribute( stmtAttribute, value, ODBC32.SQL_IS.UINTEGER); - if (retcode == ODBC32.RetCode.ERROR) + if (retcode == ODBC32.SQLRETURN.ERROR) { string sqlState; stmt.GetDiagnosticField(out sqlState); @@ -1112,7 +1112,7 @@ internal void FreeStatementHandle(ODBC32.STMT stmt) { try { - ODBC32.RetCode retcode; + ODBC32.SQLRETURN retcode; retcode = handle.FreeStatement(stmt); StatementErrorHandler(retcode); } @@ -1172,12 +1172,12 @@ internal string GetDiagSqlState() return sqlstate; } - internal void StatementErrorHandler(ODBC32.RetCode retcode) + internal void StatementErrorHandler(ODBC32.SQLRETURN retcode) { switch (retcode) { - case ODBC32.RetCode.SUCCESS: - case ODBC32.RetCode.SUCCESS_WITH_INFO: + case ODBC32.SQLRETURN.SUCCESS: + case ODBC32.SQLRETURN.SUCCESS_WITH_INFO: _connection.HandleErrorNoThrow(_stmt!, retcode); break; default: diff --git a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcCommandBuilder.cs b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcCommandBuilder.cs index 55a1fd1c208ee9..b9227c61026260 100644 --- a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcCommandBuilder.cs +++ b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcCommandBuilder.cs @@ -182,12 +182,12 @@ private static OdbcParameter[] DeriveParametersFromStoredProcedure(OdbcConnectio parts[3] = command.CommandText; } // note: native odbc appears to ignore all but the procedure name - ODBC32.RetCode retcode = hstmt.ProcedureColumns(parts[1], parts[2], parts[3], null); + ODBC32.SQLRETURN retcode = hstmt.ProcedureColumns(parts[1], parts[2], parts[3], null); // Note: the driver does not return an error if the given stored procedure does not exist // therefore we cannot handle that case and just return not parameters. - if (ODBC32.RetCode.SUCCESS != retcode) + if (ODBC32.SQLRETURN.SUCCESS != retcode) { connection.HandleError(hstmt, retcode); } 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 2444a8377503a5..5c5f3e3a2c059a 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 @@ -385,7 +385,7 @@ internal string GetConnectAttrString(ODBC32.SQL_ATTR attribute) OdbcConnectionHandle? connectionHandle = ConnectionHandle; if (null != connectionHandle) { - ODBC32.RetCode retcode = connectionHandle.GetConnectionAttribute(attribute, buffer, out cbActual); + ODBC32.SQLRETURN retcode = connectionHandle.GetConnectionAttribute(attribute, buffer, out cbActual); if (buffer.Length + 2 <= cbActual) { // 2 bytes for unicode null-termination character @@ -393,11 +393,11 @@ internal string GetConnectAttrString(ODBC32.SQL_ATTR attribute) buffer = new byte[cbActual + 2]; retcode = connectionHandle.GetConnectionAttribute(attribute, buffer, out cbActual); } - if ((ODBC32.RetCode.SUCCESS == retcode) || (ODBC32.RetCode.SUCCESS_WITH_INFO == retcode)) + if ((ODBC32.SQLRETURN.SUCCESS == retcode) || (ODBC32.SQLRETURN.SUCCESS_WITH_INFO == retcode)) { value = (BitConverter.IsLittleEndian ? Encoding.Unicode : Encoding.BigEndianUnicode).GetString(buffer, 0, Math.Min(cbActual, buffer.Length)); } - else if (retcode == ODBC32.RetCode.ERROR) + else if (retcode == ODBC32.SQLRETURN.ERROR) { string sqlstate = GetDiagSqlState(); if (("HYC00" == sqlstate) || ("HY092" == sqlstate) || ("IM001" == sqlstate)) @@ -418,15 +418,15 @@ internal int GetConnectAttr(ODBC32.SQL_ATTR attribute, ODBC32.HANDLER handler) OdbcConnectionHandle? connectionHandle = ConnectionHandle; if (null != connectionHandle) { - ODBC32.RetCode retcode = connectionHandle.GetConnectionAttribute(attribute, buffer, out cbActual); + ODBC32.SQLRETURN retcode = connectionHandle.GetConnectionAttribute(attribute, buffer, out cbActual); - if ((ODBC32.RetCode.SUCCESS == retcode) || (ODBC32.RetCode.SUCCESS_WITH_INFO == retcode)) + if ((ODBC32.SQLRETURN.SUCCESS == retcode) || (ODBC32.SQLRETURN.SUCCESS_WITH_INFO == retcode)) { retval = BitConverter.ToInt32(buffer, 0); } else { - if (retcode == ODBC32.RetCode.ERROR) + if (retcode == ODBC32.SQLRETURN.ERROR) { string sqlstate = GetDiagSqlState(); if (("HYC00" == sqlstate) || ("HY092" == sqlstate) || ("IM001" == sqlstate)) @@ -451,18 +451,18 @@ private string GetDiagSqlState() return sqlstate; } - internal ODBC32.RetCode GetInfoInt16Unhandled(ODBC32.SQL_INFO info, out short resultValue) + internal ODBC32.SQLRETURN GetInfoInt16Unhandled(ODBC32.SQL_INFO info, out short resultValue) { byte[] buffer = new byte[2]; - ODBC32.RetCode retcode = ConnectionHandle!.GetInfo1(info, buffer); + ODBC32.SQLRETURN retcode = ConnectionHandle!.GetInfo1(info, buffer); resultValue = BitConverter.ToInt16(buffer, 0); return retcode; } - internal ODBC32.RetCode GetInfoInt32Unhandled(ODBC32.SQL_INFO info, out int resultValue) + internal ODBC32.SQLRETURN GetInfoInt32Unhandled(ODBC32.SQL_INFO info, out int resultValue) { byte[] buffer = new byte[4]; - ODBC32.RetCode retcode = ConnectionHandle!.GetInfo1(info, buffer); + ODBC32.SQLRETURN retcode = ConnectionHandle!.GetInfo1(info, buffer); resultValue = BitConverter.ToInt32(buffer, 0); return retcode; } @@ -488,7 +488,7 @@ private int GetInfoInt32Unhandled(ODBC32.SQL_INFO infotype) OdbcConnectionHandle? connectionHandle = ConnectionHandle; if (null != connectionHandle) { - ODBC32.RetCode retcode = connectionHandle.GetInfo2(info, buffer, out cbActual); + ODBC32.SQLRETURN retcode = connectionHandle.GetInfo2(info, buffer, out cbActual); if (buffer.Length < cbActual - 2) { // 2 bytes for unicode null-termination character @@ -496,7 +496,7 @@ private int GetInfoInt32Unhandled(ODBC32.SQL_INFO infotype) buffer = new byte[cbActual + 2]; retcode = connectionHandle.GetInfo2(info, buffer, out cbActual); } - if (retcode == ODBC32.RetCode.SUCCESS || retcode == ODBC32.RetCode.SUCCESS_WITH_INFO) + if (retcode == ODBC32.SQLRETURN.SUCCESS || retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO) { value = (BitConverter.IsLittleEndian ? Encoding.Unicode : Encoding.BigEndianUnicode).GetString(buffer, 0, Math.Min(cbActual, buffer.Length)); } @@ -513,15 +513,15 @@ private int GetInfoInt32Unhandled(ODBC32.SQL_INFO infotype) } // non-throwing HandleError - internal Exception? HandleErrorNoThrow(OdbcHandle hrHandle, ODBC32.RetCode retcode) + internal Exception? HandleErrorNoThrow(OdbcHandle hrHandle, ODBC32.SQLRETURN retcode) { - Debug.Assert(retcode != ODBC32.RetCode.INVALID_HANDLE, "retcode must never be ODBC32.RetCode.INVALID_HANDLE"); + Debug.Assert(retcode != ODBC32.SQLRETURN.INVALID_HANDLE, "retcode must never be ODBC32.RetCode.INVALID_HANDLE"); switch (retcode) { - case ODBC32.RetCode.SUCCESS: + case ODBC32.SQLRETURN.SUCCESS: break; - case ODBC32.RetCode.SUCCESS_WITH_INFO: + case ODBC32.SQLRETURN.SUCCESS_WITH_INFO: { //Optimize to only create the event objects and obtain error info if //the user is really interested in retriveing the events... @@ -545,13 +545,13 @@ private int GetInfoInt32Unhandled(ODBC32.SQL_INFO infotype) return null; } - internal void HandleError(OdbcHandle hrHandle, ODBC32.RetCode retcode) + internal void HandleError(OdbcHandle hrHandle, ODBC32.SQLRETURN retcode) { Exception? e = HandleErrorNoThrow(hrHandle, retcode); switch (retcode) { - case ODBC32.RetCode.SUCCESS: - case ODBC32.RetCode.SUCCESS_WITH_INFO: + case ODBC32.SQLRETURN.SUCCESS: + case ODBC32.SQLRETURN.SUCCESS_WITH_INFO: Debug.Assert(null == e, "success exception"); break; default: @@ -778,7 +778,7 @@ internal void FlagUnsupportedColAttr(ODBC32.SQL_DESC v3FieldId, ODBC32.SQL_COLUM internal bool SQLGetFunctions(ODBC32.SQL_API odbcFunction) { //SQLGetFunctions - ODBC32.RetCode retcode; + ODBC32.SQLRETURN retcode; short fExists; Debug.Assert((short)odbcFunction != 0, "SQL_API_ALL_FUNCTIONS is not supported"); OdbcConnectionHandle? connectionHandle = ConnectionHandle; @@ -792,7 +792,7 @@ internal bool SQLGetFunctions(ODBC32.SQL_API odbcFunction) throw ODBC.ConnectionClosed(); } - if (retcode != ODBC32.RetCode.SUCCESS) + if (retcode != ODBC32.SQLRETURN.SUCCESS) this.HandleError(connectionHandle, retcode); if (fExists == 0) @@ -925,8 +925,8 @@ internal OdbcTransaction Open_BeginTransaction(IsolationLevel isolevel) //Start the transaction OdbcConnectionHandle connectionHandle = ConnectionHandle!; - ODBC32.RetCode retcode = connectionHandle.BeginTransaction(ref isolevel); - if (retcode == ODBC32.RetCode.ERROR) + ODBC32.SQLRETURN retcode = connectionHandle.BeginTransaction(ref isolevel); + if (retcode == ODBC32.SQLRETURN.ERROR) { HandleError(connectionHandle, retcode); } @@ -952,9 +952,9 @@ internal void Open_ChangeDatabase(string value) //Set the database OdbcConnectionHandle connectionHandle = ConnectionHandle!; - ODBC32.RetCode retcode = connectionHandle.SetConnectionAttribute3(ODBC32.SQL_ATTR.CURRENT_CATALOG, value, checked((int)value.Length * 2)); + ODBC32.SQLRETURN retcode = connectionHandle.SetConnectionAttribute3(ODBC32.SQL_ATTR.CURRENT_CATALOG, value, checked((int)value.Length * 2)); - if (retcode != ODBC32.RetCode.SUCCESS) + if (retcode != ODBC32.SQLRETURN.SUCCESS) { HandleError(connectionHandle, retcode); } diff --git a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcConnectionHandle.cs b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcConnectionHandle.cs index 8339b330196f63..c23159d34b0b7e 100644 --- a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcConnectionHandle.cs +++ b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcConnectionHandle.cs @@ -33,7 +33,7 @@ internal OdbcConnectionHandle(OdbcConnection connection, OdbcConnectionString co throw ADP.ArgumentNull(nameof(constr)); } - ODBC32.RetCode retcode; + ODBC32.SQLRETURN retcode; //Set connection timeout (only before open). //Note: We use login timeout since its odbc 1.0 option, instead of using @@ -53,9 +53,9 @@ internal OdbcConnectionHandle(OdbcConnection connection, OdbcConnectionString co connection.HandleError(this, retcode); } - private ODBC32.RetCode AutoCommitOff() + private ODBC32.SQLRETURN AutoCommitOff() { - ODBC32.RetCode retcode; + ODBC32.SQLRETURN retcode; Debug.Assert(HandleState.Connected <= _handleState, "AutoCommitOff while in wrong state?"); @@ -66,8 +66,8 @@ private ODBC32.RetCode AutoCommitOff() retcode = Interop.Odbc.SQLSetConnectAttrW(this, ODBC32.SQL_ATTR.AUTOCOMMIT, ODBC32.SQL_AUTOCOMMIT_OFF, (int)ODBC32.SQL_IS.UINTEGER); switch (retcode) { - case ODBC32.RetCode.SUCCESS: - case ODBC32.RetCode.SUCCESS_WITH_INFO: + case ODBC32.SQLRETURN.SUCCESS: + case ODBC32.SQLRETURN.SUCCESS_WITH_INFO: _handleState = HandleState.Transacted; break; } @@ -76,9 +76,9 @@ private ODBC32.RetCode AutoCommitOff() return retcode; } - internal ODBC32.RetCode BeginTransaction(ref IsolationLevel isolevel) + internal ODBC32.SQLRETURN BeginTransaction(ref IsolationLevel isolevel) { - ODBC32.RetCode retcode = ODBC32.RetCode.SUCCESS; + ODBC32.SQLRETURN retcode = ODBC32.SQLRETURN.SUCCESS; ODBC32.SQL_ATTR isolationAttribute; if (IsolationLevel.Unspecified != isolevel) { @@ -120,7 +120,7 @@ internal ODBC32.RetCode BeginTransaction(ref IsolationLevel isolevel) //the value if th euser asks for it... //We also still propagate the info, since it could be other info as well... - if (ODBC32.RetCode.SUCCESS_WITH_INFO == retcode) + if (ODBC32.SQLRETURN.SUCCESS_WITH_INFO == retcode) { isolevel = IsolationLevel.Unspecified; } @@ -128,8 +128,8 @@ internal ODBC32.RetCode BeginTransaction(ref IsolationLevel isolevel) switch (retcode) { - case ODBC32.RetCode.SUCCESS: - case ODBC32.RetCode.SUCCESS_WITH_INFO: + case ODBC32.SQLRETURN.SUCCESS: + case ODBC32.SQLRETURN.SUCCESS_WITH_INFO: //Turn off auto-commit (which basically starts the transaction) retcode = AutoCommitOff(); _handleState = HandleState.TransactionInProgress; @@ -138,14 +138,14 @@ internal ODBC32.RetCode BeginTransaction(ref IsolationLevel isolevel) return retcode; } - internal ODBC32.RetCode CompleteTransaction(short transactionOperation) + internal ODBC32.SQLRETURN CompleteTransaction(short transactionOperation) { bool mustRelease = false; try { DangerousAddRef(ref mustRelease); - ODBC32.RetCode retcode = CompleteTransaction(transactionOperation, base.handle); + ODBC32.SQLRETURN retcode = CompleteTransaction(transactionOperation, base.handle); return retcode; } finally @@ -157,11 +157,11 @@ internal ODBC32.RetCode CompleteTransaction(short transactionOperation) } } - private ODBC32.RetCode CompleteTransaction(short transactionOperation, IntPtr handle) + private ODBC32.SQLRETURN CompleteTransaction(short transactionOperation, IntPtr handle) { // must only call this code from ReleaseHandle or DangerousAddRef region - ODBC32.RetCode retcode = ODBC32.RetCode.SUCCESS; + ODBC32.SQLRETURN retcode = ODBC32.SQLRETURN.SUCCESS; try { } finally @@ -169,7 +169,7 @@ private ODBC32.RetCode CompleteTransaction(short transactionOperation, IntPtr ha if (HandleState.TransactionInProgress == _handleState) { retcode = Interop.Odbc.SQLEndTran(HandleType, handle, transactionOperation); - if ((ODBC32.RetCode.SUCCESS == retcode) || (ODBC32.RetCode.SUCCESS_WITH_INFO == retcode)) + if ((ODBC32.SQLRETURN.SUCCESS == retcode) || (ODBC32.SQLRETURN.SUCCESS_WITH_INFO == retcode)) { _handleState = HandleState.Transacted; } @@ -186,11 +186,11 @@ private ODBC32.RetCode CompleteTransaction(short transactionOperation, IntPtr ha //Debug.Assert((HandleState.Connected == _handleState) || (HandleState.TransactionInProgress == _handleState), "not expected HandleState.Connected"); return retcode; } - private ODBC32.RetCode Connect(string connectionString) + private ODBC32.SQLRETURN Connect(string connectionString) { Debug.Assert(HandleState.Allocated == _handleState, "SQLDriverConnect while in wrong state?"); - ODBC32.RetCode retcode; + ODBC32.SQLRETURN retcode; try { } finally @@ -199,8 +199,8 @@ private ODBC32.RetCode Connect(string connectionString) retcode = Interop.Odbc.SQLDriverConnectW(this, ADP.PtrZero, connectionString, ODBC32.SQL_NTS, ADP.PtrZero, 0, out cbActualSize, (short)ODBC32.SQL_DRIVER.NOPROMPT); switch (retcode) { - case ODBC32.RetCode.SUCCESS: - case ODBC32.RetCode.SUCCESS_WITH_INFO: + case ODBC32.SQLRETURN.SUCCESS: + case ODBC32.SQLRETURN.SUCCESS_WITH_INFO: _handleState = HandleState.Connected; break; } @@ -212,7 +212,7 @@ private ODBC32.RetCode Connect(string connectionString) protected override bool ReleaseHandle() { // NOTE: The SafeHandle class guarantees this will be called exactly once and is non-interrutible. - ODBC32.RetCode retcode; + ODBC32.SQLRETURN retcode; // must call complete the transaction rollback, change handle state, and disconnect the connection retcode = CompleteTransaction(ODBC32.SQL_ROLLBACK, handle); @@ -226,41 +226,41 @@ protected override bool ReleaseHandle() return base.ReleaseHandle(); } - internal ODBC32.RetCode GetConnectionAttribute(ODBC32.SQL_ATTR attribute, byte[] buffer, out int cbActual) + internal ODBC32.SQLRETURN GetConnectionAttribute(ODBC32.SQL_ATTR attribute, byte[] buffer, out int cbActual) { - ODBC32.RetCode retcode = Interop.Odbc.SQLGetConnectAttrW(this, attribute, buffer, buffer.Length, out cbActual); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetConnectAttrW(this, attribute, buffer, buffer.Length, out cbActual); return retcode; } - internal ODBC32.RetCode GetFunctions(ODBC32.SQL_API fFunction, out short fExists) + internal ODBC32.SQLRETURN GetFunctions(ODBC32.SQL_API fFunction, out short fExists) { - ODBC32.RetCode retcode = Interop.Odbc.SQLGetFunctions(this, fFunction, out fExists); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetFunctions(this, fFunction, out fExists); ODBC.TraceODBC(3, "SQLGetFunctions", retcode); return retcode; } - internal ODBC32.RetCode GetInfo2(ODBC32.SQL_INFO info, byte[] buffer, out short cbActual) + internal ODBC32.SQLRETURN GetInfo2(ODBC32.SQL_INFO info, byte[] buffer, out short cbActual) { - ODBC32.RetCode retcode = Interop.Odbc.SQLGetInfoW(this, info, buffer, checked((short)buffer.Length), out cbActual); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetInfoW(this, info, buffer, checked((short)buffer.Length), out cbActual); return retcode; } - internal ODBC32.RetCode GetInfo1(ODBC32.SQL_INFO info, byte[] buffer) + internal ODBC32.SQLRETURN GetInfo1(ODBC32.SQL_INFO info, byte[] buffer) { - ODBC32.RetCode retcode = Interop.Odbc.SQLGetInfoW(this, info, buffer, checked((short)buffer.Length), ADP.PtrZero); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetInfoW(this, info, buffer, checked((short)buffer.Length), ADP.PtrZero); return retcode; } - internal ODBC32.RetCode SetConnectionAttribute2(ODBC32.SQL_ATTR attribute, IntPtr value, int length) + internal ODBC32.SQLRETURN SetConnectionAttribute2(ODBC32.SQL_ATTR attribute, IntPtr value, int length) { - ODBC32.RetCode retcode = Interop.Odbc.SQLSetConnectAttrW(this, attribute, value, length); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLSetConnectAttrW(this, attribute, value, length); ODBC.TraceODBC(3, "SQLSetConnectAttrW", retcode); return retcode; } - internal ODBC32.RetCode SetConnectionAttribute3(ODBC32.SQL_ATTR attribute, string buffer, int length) + internal ODBC32.SQLRETURN SetConnectionAttribute3(ODBC32.SQL_ATTR attribute, string buffer, int length) { - ODBC32.RetCode retcode = Interop.Odbc.SQLSetConnectAttrW(this, attribute, buffer, length); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLSetConnectAttrW(this, attribute, buffer, length); return retcode; } } diff --git a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcDataReader.cs b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcDataReader.cs index 496e1543d92ee4..8e57c9e8f4233d 100644 --- a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcDataReader.cs +++ b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcDataReader.cs @@ -175,8 +175,8 @@ public override int FieldCount if (null == _dataCache) { short cColsAffected; - ODBC32.RetCode retcode = this.FieldCountNoThrow(out cColsAffected); - if (retcode != ODBC32.RetCode.SUCCESS) + ODBC32.SQLRETURN retcode = this.FieldCountNoThrow(out cColsAffected); + if (retcode != ODBC32.SQLRETURN.SUCCESS) { Connection!.HandleError(StatementHandle, retcode); } @@ -208,16 +208,16 @@ public override bool HasRows } } - internal ODBC32.RetCode FieldCountNoThrow(out short cColsAffected) + internal ODBC32.SQLRETURN FieldCountNoThrow(out short cColsAffected) { if (IsCancelingCommand) { cColsAffected = 0; - return ODBC32.RetCode.ERROR; + return ODBC32.SQLRETURN.ERROR; } - ODBC32.RetCode retcode = StatementHandle.NumberOfResultColumns(out cColsAffected); - if (retcode == ODBC32.RetCode.SUCCESS) + ODBC32.SQLRETURN retcode = StatementHandle.NumberOfResultColumns(out cColsAffected); + if (retcode == ODBC32.SQLRETURN.SUCCESS) { _hiddenColumns = 0; if (IsCommandBehavior(CommandBehavior.KeyInfo)) @@ -260,8 +260,8 @@ private SQLLEN GetRowCount() if (!IsClosed) { SQLLEN cRowsAffected; - ODBC32.RetCode retcode = StatementHandle.RowCount(out cRowsAffected); - if (ODBC32.RetCode.SUCCESS == retcode || ODBC32.RetCode.SUCCESS_WITH_INFO == retcode) + ODBC32.SQLRETURN retcode = StatementHandle.RowCount(out cRowsAffected); + if (ODBC32.SQLRETURN.SUCCESS == retcode || ODBC32.SQLRETURN.SUCCESS_WITH_INFO == retcode) { return cRowsAffected; } @@ -1552,7 +1552,7 @@ private SQLLEN GetColAttribute(int iColumn, ODBC32.SQL_DESC v3FieldId, ODBC32.SQ { short cchNameLength = 0; SQLLEN numericAttribute; - ODBC32.RetCode retcode; + ODBC32.SQLRETURN retcode; // protect against dead connection, dead or canceling command. if ((Connection == null) || _cmdWrapper!.Canceling) @@ -1574,9 +1574,9 @@ private SQLLEN GetColAttribute(int iColumn, ODBC32.SQL_DESC v3FieldId, ODBC32.SQ { return 0; } - if (retcode != ODBC32.RetCode.SUCCESS) + if (retcode != ODBC32.SQLRETURN.SUCCESS) { - if (retcode == ODBC32.RetCode.ERROR) + if (retcode == ODBC32.SQLRETURN.ERROR) { if ("HY091" == Command!.GetDiagSqlState()) { @@ -1603,7 +1603,7 @@ private SQLLEN GetColAttribute(int iColumn, ODBC32.SQL_DESC v3FieldId, ODBC32.SQ // private string? GetColAttributeStr(int i, ODBC32.SQL_DESC v3FieldId, ODBC32.SQL_COLUMN v2FieldId, ODBC32.HANDLER handler) { - ODBC32.RetCode retcode; + ODBC32.SQLRETURN retcode; short cchNameLength = 0; SQLLEN numericAttribute; CNativeBuffer buffer = Buffer; @@ -1629,9 +1629,9 @@ private SQLLEN GetColAttribute(int iColumn, ODBC32.SQL_DESC v3FieldId, ODBC32.SQ { return null; } - if ((retcode != ODBC32.RetCode.SUCCESS) || (cchNameLength == 0)) + if ((retcode != ODBC32.SQLRETURN.SUCCESS) || (cchNameLength == 0)) { - if (retcode == ODBC32.RetCode.ERROR) + if (retcode == ODBC32.SQLRETURN.ERROR) { if ("HY091" == Command!.GetDiagSqlState()) { @@ -1668,7 +1668,7 @@ private SQLLEN GetColAttribute(int iColumn, ODBC32.SQL_DESC v3FieldId, ODBC32.SQ return null; } - ODBC32.RetCode retcode; + ODBC32.SQLRETURN retcode; CNativeBuffer buffer = Buffer; // Need to set the APP_PARAM_DESC values here @@ -1680,9 +1680,9 @@ private SQLLEN GetColAttribute(int iColumn, ODBC32.SQL_DESC v3FieldId, ODBC32.SQ //Since there are many attributes (column, statement, etc), that may or may not be //supported, we don't want to throw (which obtains all errorinfo, marshals strings, //builds exceptions, etc), in common cases, unless we absolutely need this info... - if ((retcode != ODBC32.RetCode.SUCCESS) || (numericAttribute == 0)) + if ((retcode != ODBC32.SQLRETURN.SUCCESS) || (numericAttribute == 0)) { - if (retcode == ODBC32.RetCode.ERROR) + if (retcode == ODBC32.SQLRETURN.ERROR) { if ("HY091" == Command!.GetDiagSqlState()) { @@ -1757,7 +1757,7 @@ private bool GetData(int i, ODBC32.SQL_C sqlctype, int cb, out int cbLengthOrInd // SQLGetData CNativeBuffer buffer = Buffer; - ODBC32.RetCode retcode = StatementHandle.GetData( + ODBC32.SQLRETURN retcode = StatementHandle.GetData( (i + 1), // Column ordinals start at 1 in odbc sqlctype, buffer, @@ -1766,9 +1766,9 @@ private bool GetData(int i, ODBC32.SQL_C sqlctype, int cb, out int cbLengthOrInd switch (retcode) { - case ODBC32.RetCode.SUCCESS: + case ODBC32.SQLRETURN.SUCCESS: break; - case ODBC32.RetCode.SUCCESS_WITH_INFO: + case ODBC32.SQLRETURN.SUCCESS_WITH_INFO: if ((int)cbActual == ODBC32.SQL_NO_TOTAL) { break; @@ -1776,7 +1776,7 @@ private bool GetData(int i, ODBC32.SQL_C sqlctype, int cb, out int cbLengthOrInd // devnote: don't we want to fire an event? break; - case ODBC32.RetCode.NO_DATA: + case ODBC32.SQLRETURN.NO_DATA: // SQLBU 266054: System.Data.Odbc: Fails with truncated error when we pass BufferLength as 0 // NO_DATA return value is success value - it means that the driver has fully consumed the current column value // but did not move to the next column yet. @@ -1852,7 +1852,7 @@ public override bool Read() return false; } - ODBC32.RetCode retcode; + ODBC32.SQLRETURN retcode; //SQLFetch is only valid to call for row returning queries //We get: [24000]Invalid cursor state. So we could either check the count @@ -1863,16 +1863,16 @@ public override bool Read() switch (retcode) { - case ODBC32.RetCode.SUCCESS_WITH_INFO: + case ODBC32.SQLRETURN.SUCCESS_WITH_INFO: Connection!.HandleErrorNoThrow(StatementHandle, retcode); _hasRows = HasRowsStatus.HasRows; _isRead = true; break; - case ODBC32.RetCode.SUCCESS: + case ODBC32.SQLRETURN.SUCCESS: _hasRows = HasRowsStatus.HasRows; _isRead = true; break; - case ODBC32.RetCode.NO_DATA: + case ODBC32.SQLRETURN.NO_DATA: _isRead = false; if (_hasRows == HasRowsStatus.DontKnow) { @@ -1910,8 +1910,8 @@ internal void FirstResult() cRowsAffected = GetRowCount(); // get rowcount of the current resultset (if any) CalculateRecordsAffected(cRowsAffected); // update recordsaffected - ODBC32.RetCode retcode = FieldCountNoThrow(out cCols); - if ((retcode == ODBC32.RetCode.SUCCESS) && (cCols == 0)) + ODBC32.SQLRETURN retcode = FieldCountNoThrow(out cCols); + if ((retcode == ODBC32.SQLRETURN.SUCCESS) && (cCols == 0)) { NextResult(); } @@ -1936,7 +1936,7 @@ private bool NextResult(bool disposing, bool allresults) SQLLEN cRowsAffected; short cColsAffected; - ODBC32.RetCode retcode, firstRetCode = ODBC32.RetCode.SUCCESS; + ODBC32.SQLRETURN retcode, firstRetCode = ODBC32.SQLRETURN.SUCCESS; bool hasMoreResults; bool hasColumns = false; bool singleResult = IsCommandBehavior(CommandBehavior.SingleResult); @@ -1966,14 +1966,14 @@ private bool NextResult(bool disposing, bool allresults) { _isValidResult = false; retcode = StatementHandle.MoreResults(); - hasMoreResults = ((retcode == ODBC32.RetCode.SUCCESS) - || (retcode == ODBC32.RetCode.SUCCESS_WITH_INFO)); + hasMoreResults = ((retcode == ODBC32.SQLRETURN.SUCCESS) + || (retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO)); - if (retcode == ODBC32.RetCode.SUCCESS_WITH_INFO) + if (retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO) { Connection!.HandleErrorNoThrow(StatementHandle, retcode); } - else if (!disposing && (retcode != ODBC32.RetCode.NO_DATA) && (ODBC32.RetCode.SUCCESS != retcode)) + else if (!disposing && (retcode != ODBC32.SQLRETURN.NO_DATA) && (ODBC32.SQLRETURN.SUCCESS != retcode)) { // allow for building comulative error messages. if (null == errors) @@ -1999,10 +1999,10 @@ private bool NextResult(bool disposing, bool allresults) } } } while ((!singleResult && hasMoreResults && !hasColumns) // repeat for results with no columns - || ((ODBC32.RetCode.NO_DATA != retcode) && allresults && (loop < MaxConsecutiveFailure)) // or process all results until done + || ((ODBC32.SQLRETURN.NO_DATA != retcode) && allresults && (loop < MaxConsecutiveFailure)) // or process all results until done || (singleResult && hasMoreResults)); // or for any result in singelResult mode - if (retcode == ODBC32.RetCode.NO_DATA) + if (retcode == ODBC32.SQLRETURN.NO_DATA) { _dataCache = null; _noMoreResults = true; @@ -2330,7 +2330,7 @@ internal int RetrieveKeyInfo(bool needkeyinfo, QualifiedTableName qualifiedTable { Debug.Assert(_metadata != null); - ODBC32.RetCode retcode; + ODBC32.SQLRETURN retcode; string columnname; int ordinal; int keyColumns = 0; @@ -2360,7 +2360,7 @@ internal int RetrieveKeyInfo(bool needkeyinfo, QualifiedTableName qualifiedTable qualifiedTableName.Schema, qualifiedTableName.GetTable(quoted)!); - if ((retcode == ODBC32.RetCode.SUCCESS) || (retcode == ODBC32.RetCode.SUCCESS_WITH_INFO)) + if ((retcode == ODBC32.SQLRETURN.SUCCESS) || (retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO)) { bool noUniqueKey = false; @@ -2372,7 +2372,7 @@ internal int RetrieveKeyInfo(bool needkeyinfo, QualifiedTableName qualifiedTable buffer.PtrOffset(0, 256), (IntPtr)256, buffer.PtrOffset(256, IntPtr.Size).Handle); - while (ODBC32.RetCode.SUCCESS == (retcode = KeyInfoStatementHandle.Fetch())) + while (ODBC32.SQLRETURN.SUCCESS == (retcode = KeyInfoStatementHandle.Fetch())) { cbActual = buffer.ReadIntPtr(256); columnname = buffer.PtrToStringUni(0, (int)cbActual / 2/*cch*/); @@ -2440,7 +2440,7 @@ internal int RetrieveKeyInfo(bool needkeyinfo, QualifiedTableName qualifiedTable // Get the special columns for version retcode = KeyInfoStatementHandle.SpecialColumns(qualifiedTableName.GetTable(quoted)!); - if ((retcode == ODBC32.RetCode.SUCCESS) || (retcode == ODBC32.RetCode.SUCCESS_WITH_INFO)) + if ((retcode == ODBC32.SQLRETURN.SUCCESS) || (retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO)) { // We are only interested in column name cbActual = IntPtr.Zero; @@ -2452,7 +2452,7 @@ internal int RetrieveKeyInfo(bool needkeyinfo, QualifiedTableName qualifiedTable (IntPtr)256, buffer.PtrOffset(256, IntPtr.Size).Handle); - while (ODBC32.RetCode.SUCCESS == (retcode = KeyInfoStatementHandle.Fetch())) + while (ODBC32.SQLRETURN.SUCCESS == (retcode = KeyInfoStatementHandle.Fetch())) { cbActual = buffer.ReadIntPtr(256); columnname = buffer.PtrToStringUni(0, (int)cbActual / 2/*cch*/); @@ -2500,7 +2500,7 @@ private int RetrieveKeyInfoFromStatistics(QualifiedTableName qualifiedTableName, { Debug.Assert(_metadata != null); - ODBC32.RetCode retcode; + ODBC32.SQLRETURN retcode; string columnname = string.Empty; string indexname = string.Empty; string currentindexname = string.Empty; @@ -2523,7 +2523,7 @@ private int RetrieveKeyInfoFromStatistics(QualifiedTableName qualifiedTableName, // Select only unique indexes retcode = KeyInfoStatementHandle.Statistics(tablename1); - if (retcode != ODBC32.RetCode.SUCCESS) + if (retcode != ODBC32.SQLRETURN.SUCCESS) { // We give up at this point return 0; @@ -2574,7 +2574,7 @@ private int RetrieveKeyInfoFromStatistics(QualifiedTableName qualifiedTableName, colnameActual); // Find the best unique index on the table, use the ones whose columns are // completely covered by the query. - while (ODBC32.RetCode.SUCCESS == (retcode = KeyInfoStatementHandle.Fetch())) + while (ODBC32.SQLRETURN.SUCCESS == (retcode = KeyInfoStatementHandle.Fetch())) { cbColnameLen = buffer.ReadIntPtr(colnameActualOffset); cbIndexLen = buffer.ReadIntPtr(indexActualOffset); diff --git a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcEnvironmentHandle.cs b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcEnvironmentHandle.cs index f816b2aa777179..07fa28c0884a84 100644 --- a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcEnvironmentHandle.cs +++ b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcEnvironmentHandle.cs @@ -10,7 +10,7 @@ internal sealed class OdbcEnvironmentHandle : OdbcHandle { public OdbcEnvironmentHandle() : base(ODBC32.SQL_HANDLE.ENV, null) { - ODBC32.RetCode retcode; + ODBC32.SQLRETURN retcode; //Set the expected driver manager version // @@ -34,8 +34,8 @@ public OdbcEnvironmentHandle() : base(ODBC32.SQL_HANDLE.ENV, null) switch (retcode) { - case ODBC32.RetCode.SUCCESS: - case ODBC32.RetCode.SUCCESS_WITH_INFO: + case ODBC32.SQLRETURN.SUCCESS: + case ODBC32.SQLRETURN.SUCCESS_WITH_INFO: break; default: Dispose(); diff --git a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcException.cs b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcException.cs index 7a2f87ef4e1103..52b70dc15e8150 100644 --- a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcException.cs +++ b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcException.cs @@ -12,7 +12,7 @@ public sealed class OdbcException : System.Data.Common.DbException { private readonly OdbcErrorCollection _odbcErrors = new OdbcErrorCollection(); - internal static OdbcException CreateException(OdbcErrorCollection errors, ODBC32.RetCode retcode) + internal static OdbcException CreateException(OdbcErrorCollection errors, ODBC32.SQLRETURN retcode) { StringBuilder builder = new StringBuilder(); foreach (OdbcError error in errors) diff --git a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcHandle.cs b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcHandle.cs index a5432b82405395..5c4cfbe5823b36 100644 --- a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcHandle.cs +++ b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcHandle.cs @@ -21,7 +21,7 @@ protected OdbcHandle(ODBC32.SQL_HANDLE handleType, OdbcHandle? parentHandle) : b _handleType = handleType; bool mustRelease = false; - ODBC32.RetCode retcode = ODBC32.RetCode.SUCCESS; + ODBC32.SQLRETURN retcode = ODBC32.SQLRETURN.SUCCESS; try { @@ -70,7 +70,7 @@ protected OdbcHandle(ODBC32.SQL_HANDLE handleType, OdbcHandle? parentHandle) : b } } - if ((ADP.PtrZero == base.handle) || (ODBC32.RetCode.SUCCESS != retcode)) + if ((ADP.PtrZero == base.handle) || (ODBC32.SQLRETURN.SUCCESS != retcode)) { // throw ODBC.CantAllocateEnvironmentHandle(retcode); @@ -83,7 +83,7 @@ internal OdbcHandle(OdbcStatementHandle parentHandle, ODBC32.SQL_ATTR attribute) _handleType = ODBC32.SQL_HANDLE.DESC; int cbActual; - ODBC32.RetCode retcode; + ODBC32.SQLRETURN retcode; bool mustRelease = false; try @@ -176,12 +176,12 @@ protected override bool ReleaseHandle() return true; } - internal ODBC32.RetCode GetDiagnosticField(out string sqlState) + internal ODBC32.SQLRETURN GetDiagnosticField(out string sqlState) { short cbActual; // ODBC (MSDN) documents it expects a buffer large enough to hold 5(+L'\0') unicode characters StringBuilder sb = new StringBuilder(6); - ODBC32.RetCode retcode = Interop.Odbc.SQLGetDiagFieldW( + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetDiagFieldW( HandleType, this, (short)1, @@ -190,7 +190,7 @@ internal ODBC32.RetCode GetDiagnosticField(out string sqlState) checked((short)(2 * sb.Capacity)), // expects number of bytes, see \\kbinternal\kb\articles\294\1\69.HTM out cbActual); ODBC.TraceODBC(3, "SQLGetDiagFieldW", retcode); - if ((retcode == ODBC32.RetCode.SUCCESS) || (retcode == ODBC32.RetCode.SUCCESS_WITH_INFO)) + if ((retcode == ODBC32.SQLRETURN.SUCCESS) || (retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO)) { sqlState = sb.ToString(); } @@ -201,14 +201,14 @@ internal ODBC32.RetCode GetDiagnosticField(out string sqlState) return retcode; } - internal ODBC32.RetCode GetDiagnosticRecord(short record, out string sqlState, StringBuilder message, out int nativeError, out short cchActual) + internal ODBC32.SQLRETURN GetDiagnosticRecord(short record, out string sqlState, StringBuilder message, out int nativeError, out short cchActual) { // ODBC (MSDN) documents it expects a buffer large enough to hold 4(+L'\0') unicode characters StringBuilder sb = new StringBuilder(5); - ODBC32.RetCode retcode = Interop.Odbc.SQLGetDiagRecW(HandleType, this, record, sb, out nativeError, message, checked((short)message.Capacity), out cchActual); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetDiagRecW(HandleType, this, record, sb, out nativeError, message, checked((short)message.Capacity), out cchActual); ODBC.TraceODBC(3, "SQLGetDiagRecW", retcode); - if ((retcode == ODBC32.RetCode.SUCCESS) || (retcode == ODBC32.RetCode.SUCCESS_WITH_INFO)) + if ((retcode == ODBC32.SQLRETURN.SUCCESS) || (retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO)) { sqlState = sb.ToString(); } @@ -226,23 +226,23 @@ internal OdbcDescriptorHandle(OdbcStatementHandle statementHandle, ODBC32.SQL_AT { } - internal ODBC32.RetCode GetDescriptionField(int i, ODBC32.SQL_DESC attribute, CNativeBuffer buffer, out int numericAttribute) + internal ODBC32.SQLRETURN GetDescriptionField(int i, ODBC32.SQL_DESC attribute, CNativeBuffer buffer, out int numericAttribute) { - ODBC32.RetCode retcode = Interop.Odbc.SQLGetDescFieldW(this, checked((short)i), attribute, buffer, buffer.ShortLength, out numericAttribute); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetDescFieldW(this, checked((short)i), attribute, buffer, buffer.ShortLength, out numericAttribute); ODBC.TraceODBC(3, "SQLGetDescFieldW", retcode); return retcode; } - internal ODBC32.RetCode SetDescriptionField1(short ordinal, ODBC32.SQL_DESC type, IntPtr value) + internal ODBC32.SQLRETURN SetDescriptionField1(short ordinal, ODBC32.SQL_DESC type, IntPtr value) { - ODBC32.RetCode retcode = Interop.Odbc.SQLSetDescFieldW(this, ordinal, type, value, 0); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLSetDescFieldW(this, ordinal, type, value, 0); ODBC.TraceODBC(3, "SQLSetDescFieldW", retcode); return retcode; } - internal ODBC32.RetCode SetDescriptionField2(short ordinal, ODBC32.SQL_DESC type, HandleRef value) + internal ODBC32.SQLRETURN SetDescriptionField2(short ordinal, ODBC32.SQL_DESC type, HandleRef value) { - ODBC32.RetCode retcode = Interop.Odbc.SQLSetDescFieldW(this, ordinal, type, value, 0); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLSetDescFieldW(this, ordinal, type, value, 0); ODBC.TraceODBC(3, "SQLSetDescFieldW", retcode); return retcode; } diff --git a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcMetaDataFactory.cs b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcMetaDataFactory.cs index 852265e095d878..f92e61e23acf04 100644 --- a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcMetaDataFactory.cs +++ b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcMetaDataFactory.cs @@ -590,7 +590,7 @@ private DataTable GetDataSourceInformationCollection(string?[]? restrictions, string? stringValue; short int16Value; int int32Value; - ODBC32.RetCode retcode; + ODBC32.SQLRETURN retcode; // update the catalog separator stringValue = connection.GetInfoStringUnhandled(ODBC32.SQL_INFO.CATALOG_NAME_SEPARATOR); @@ -631,7 +631,7 @@ private DataTable GetDataSourceInformationCollection(string?[]? restrictions, retcode = connection.GetInfoInt32Unhandled(ODBC32.SQL_INFO.SQL_OJ_CAPABILITIES_20, out int32Value); } - if ((retcode == ODBC32.RetCode.SUCCESS) || (retcode == ODBC32.RetCode.SUCCESS_WITH_INFO)) + if ((retcode == ODBC32.SQLRETURN.SUCCESS) || (retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO)) { Common.SupportedJoinOperators supportedJoinOperators = Common.SupportedJoinOperators.None; if ((int32Value & (int)ODBC32.SQL_OJ_CAPABILITIES.LEFT) != 0) @@ -658,7 +658,7 @@ private DataTable GetDataSourceInformationCollection(string?[]? restrictions, retcode = connection.GetInfoInt16Unhandled(ODBC32.SQL_INFO.GROUP_BY, out int16Value); Common.GroupByBehavior groupByBehavior = Common.GroupByBehavior.Unknown; - if ((retcode == ODBC32.RetCode.SUCCESS) || (retcode == ODBC32.RetCode.SUCCESS_WITH_INFO)) + if ((retcode == ODBC32.SQLRETURN.SUCCESS) || (retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO)) { switch (int16Value) { @@ -691,7 +691,7 @@ private DataTable GetDataSourceInformationCollection(string?[]? restrictions, retcode = connection.GetInfoInt16Unhandled(ODBC32.SQL_INFO.IDENTIFIER_CASE, out int16Value); Common.IdentifierCase identifierCase = Common.IdentifierCase.Unknown; - if ((retcode == ODBC32.RetCode.SUCCESS) || (retcode == ODBC32.RetCode.SUCCESS_WITH_INFO)) + if ((retcode == ODBC32.SQLRETURN.SUCCESS) || (retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO)) { switch (int16Value) { @@ -758,7 +758,7 @@ private DataTable GetDataSourceInformationCollection(string?[]? restrictions, retcode = connection.GetInfoInt16Unhandled(ODBC32.SQL_INFO.QUOTED_IDENTIFIER_CASE, out int16Value); Common.IdentifierCase quotedIdentifierCase = Common.IdentifierCase.Unknown; - if ((retcode == ODBC32.RetCode.SUCCESS) || (retcode == ODBC32.RetCode.SUCCESS_WITH_INFO)) + if ((retcode == ODBC32.SQLRETURN.SUCCESS) || (retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO)) { switch (int16Value) { diff --git a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcParameter.cs b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcParameter.cs index 7bcba69eb243d0..15f00fd2c8b9f5 100644 --- a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcParameter.cs +++ b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcParameter.cs @@ -792,7 +792,7 @@ internal void Bind(OdbcStatementHandle hstmt, OdbcCommand command, short ordinal { Debug.Assert(command.Connection != null); - ODBC32.RetCode retcode; + ODBC32.SQLRETURN retcode; ODBC32.SQL_C sql_c_type = _prepared_Sql_C_Type; ODBC32.SQL_PARAM sqldirection = SqlDirectionFromParameterDirection(); @@ -871,7 +871,7 @@ internal void Bind(OdbcStatementHandle hstmt, OdbcCommand command, short ordinal (IntPtr)_preparedBufferSize, intBuffer); // StrLen_or_IndPtr - if (ODBC32.RetCode.SUCCESS != retcode) + if (ODBC32.SQLRETURN.SUCCESS != retcode) { if ("07006" == command.GetDiagSqlState()) { @@ -902,7 +902,7 @@ internal void Bind(OdbcStatementHandle hstmt, OdbcCommand command, short ordinal //SQLSetDescField(hdesc, i+1, SQL_DESC_TYPE, (void *)SQL_C_NUMERIC, 0); retcode = hdesc.SetDescriptionField1(ordinal, ODBC32.SQL_DESC.TYPE, (IntPtr)ODBC32.SQL_C.NUMERIC); - if (ODBC32.RetCode.SUCCESS != retcode) + if (ODBC32.SQLRETURN.SUCCESS != retcode) { command.Connection.HandleError(hstmt, retcode); } @@ -914,7 +914,7 @@ internal void Bind(OdbcStatementHandle hstmt, OdbcCommand command, short ordinal //SQLSetDescField(hdesc, i+1, SQL_DESC_PRECISION, (void *)precision, 0); retcode = hdesc.SetDescriptionField1(ordinal, ODBC32.SQL_DESC.PRECISION, (IntPtr)cbActual); - if (ODBC32.RetCode.SUCCESS != retcode) + if (ODBC32.SQLRETURN.SUCCESS != retcode) { command.Connection.HandleError(hstmt, retcode); } @@ -926,7 +926,7 @@ internal void Bind(OdbcStatementHandle hstmt, OdbcCommand command, short ordinal cbActual = (int)scale; retcode = hdesc.SetDescriptionField1(ordinal, ODBC32.SQL_DESC.SCALE, (IntPtr)cbActual); - if (ODBC32.RetCode.SUCCESS != retcode) + if (ODBC32.SQLRETURN.SUCCESS != retcode) { command.Connection.HandleError(hstmt, retcode); } @@ -936,7 +936,7 @@ internal void Bind(OdbcStatementHandle hstmt, OdbcCommand command, short ordinal // SQLSetDescField(hdesc, i+1, SQL_DESC_DATA_PTR, (void *)&numeric, 0); retcode = hdesc.SetDescriptionField2(ordinal, ODBC32.SQL_DESC.DATA_PTR, valueBuffer); - if (ODBC32.RetCode.SUCCESS != retcode) + if (ODBC32.SQLRETURN.SUCCESS != retcode) { command.Connection.HandleError(hstmt, retcode); } diff --git a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcStatementHandle.cs b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcStatementHandle.cs index f8384b7a20b473..cdbd81af51fc81 100644 --- a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcStatementHandle.cs +++ b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcStatementHandle.cs @@ -59,23 +59,23 @@ internal OdbcStatementHandle(OdbcConnectionHandle? connectionHandle) : base(ODBC { } - internal ODBC32.RetCode BindColumn2(int columnNumber, ODBC32.SQL_C targetType, HandleRef buffer, IntPtr length, IntPtr srLen_or_Ind) + internal ODBC32.SQLRETURN BindColumn2(int columnNumber, ODBC32.SQL_C targetType, HandleRef buffer, IntPtr length, IntPtr srLen_or_Ind) { - ODBC32.RetCode retcode = Interop.Odbc.SQLBindCol(this, checked((ushort)columnNumber), targetType, buffer, length, srLen_or_Ind); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLBindCol(this, checked((ushort)columnNumber), targetType, buffer, length, srLen_or_Ind); ODBC.TraceODBC(3, "SQLBindCol", retcode); return retcode; } - internal ODBC32.RetCode BindColumn3(int columnNumber, ODBC32.SQL_C targetType, IntPtr srLen_or_Ind) + internal ODBC32.SQLRETURN BindColumn3(int columnNumber, ODBC32.SQL_C targetType, IntPtr srLen_or_Ind) { - ODBC32.RetCode retcode = Interop.Odbc.SQLBindCol(this, checked((ushort)columnNumber), targetType, ADP.PtrZero, ADP.PtrZero, srLen_or_Ind); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLBindCol(this, checked((ushort)columnNumber), targetType, ADP.PtrZero, ADP.PtrZero, srLen_or_Ind); ODBC.TraceODBC(3, "SQLBindCol", retcode); return retcode; } - internal ODBC32.RetCode BindParameter(short ordinal, short parameterDirection, ODBC32.SQL_C sqlctype, ODBC32.SQL_TYPE sqltype, IntPtr cchSize, IntPtr scale, HandleRef buffer, IntPtr bufferLength, HandleRef intbuffer) + internal ODBC32.SQLRETURN BindParameter(short ordinal, short parameterDirection, ODBC32.SQL_C sqlctype, ODBC32.SQL_TYPE sqltype, IntPtr cchSize, IntPtr scale, HandleRef buffer, IntPtr bufferLength, HandleRef intbuffer) { - ODBC32.RetCode retcode = Interop.Odbc.SQLBindParameter(this, + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLBindParameter(this, checked((ushort)ordinal), // Parameter Number parameterDirection, // InputOutputType sqlctype, // ValueType @@ -89,37 +89,37 @@ internal ODBC32.RetCode BindParameter(short ordinal, short parameterDirection, O return retcode; } - internal ODBC32.RetCode Cancel() + internal ODBC32.SQLRETURN Cancel() { // In ODBC3.0 ... a call to SQLCancel when no processing is done has no effect at all // (ODBC Programmer's Reference ...) - ODBC32.RetCode retcode = Interop.Odbc.SQLCancel(this); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLCancel(this); ODBC.TraceODBC(3, "SQLCancel", retcode); return retcode; } - internal ODBC32.RetCode CloseCursor() + internal ODBC32.SQLRETURN CloseCursor() { - ODBC32.RetCode retcode = Interop.Odbc.SQLCloseCursor(this); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLCloseCursor(this); ODBC.TraceODBC(3, "SQLCloseCursor", retcode); return retcode; } - internal ODBC32.RetCode ColumnAttribute(int columnNumber, short fieldIdentifier, CNativeBuffer characterAttribute, out short stringLength, out SQLLEN numericAttribute) + internal ODBC32.SQLRETURN ColumnAttribute(int columnNumber, short fieldIdentifier, CNativeBuffer characterAttribute, out short stringLength, out SQLLEN numericAttribute) { IntPtr result; - ODBC32.RetCode retcode = Interop.Odbc.SQLColAttributeW(this, checked((short)columnNumber), fieldIdentifier, characterAttribute, characterAttribute.ShortLength, out stringLength, out result); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLColAttributeW(this, checked((short)columnNumber), fieldIdentifier, characterAttribute, characterAttribute.ShortLength, out stringLength, out result); numericAttribute = new SQLLEN(result); ODBC.TraceODBC(3, "SQLColAttributeW", retcode); return retcode; } - internal ODBC32.RetCode Columns(string tableCatalog, + internal ODBC32.SQLRETURN Columns(string tableCatalog, string tableSchema, string tableName, string columnName) { - ODBC32.RetCode retcode = Interop.Odbc.SQLColumnsW(this, + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLColumnsW(this, tableCatalog, ODBC.ShortStringLength(tableCatalog), tableSchema, @@ -133,37 +133,37 @@ internal ODBC32.RetCode Columns(string tableCatalog, return retcode; } - internal ODBC32.RetCode Execute() + internal ODBC32.SQLRETURN Execute() { - ODBC32.RetCode retcode = Interop.Odbc.SQLExecute(this); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLExecute(this); ODBC.TraceODBC(3, "SQLExecute", retcode); return retcode; } - internal ODBC32.RetCode ExecuteDirect(string commandText) + internal ODBC32.SQLRETURN ExecuteDirect(string commandText) { - ODBC32.RetCode retcode = Interop.Odbc.SQLExecDirectW(this, commandText, ODBC32.SQL_NTS); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLExecDirectW(this, commandText, ODBC32.SQL_NTS); ODBC.TraceODBC(3, "SQLExecDirectW", retcode); return retcode; } - internal ODBC32.RetCode Fetch() + internal ODBC32.SQLRETURN Fetch() { - ODBC32.RetCode retcode = Interop.Odbc.SQLFetch(this); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLFetch(this); ODBC.TraceODBC(3, "SQLFetch", retcode); return retcode; } - internal ODBC32.RetCode FreeStatement(ODBC32.STMT stmt) + internal ODBC32.SQLRETURN FreeStatement(ODBC32.STMT stmt) { - ODBC32.RetCode retcode = Interop.Odbc.SQLFreeStmt(this, stmt); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLFreeStmt(this, stmt); ODBC.TraceODBC(3, "SQLFreeStmt", retcode); return retcode; } - internal ODBC32.RetCode GetData(int index, ODBC32.SQL_C sqlctype, CNativeBuffer buffer, int cb, out IntPtr cbActual) + internal ODBC32.SQLRETURN GetData(int index, ODBC32.SQL_C sqlctype, CNativeBuffer buffer, int cb, out IntPtr cbActual) { - ODBC32.RetCode retcode = Interop.Odbc.SQLGetData(this, + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetData(this, checked((ushort)index), sqlctype, buffer, @@ -173,44 +173,44 @@ internal ODBC32.RetCode GetData(int index, ODBC32.SQL_C sqlctype, CNativeBuffer return retcode; } - internal ODBC32.RetCode GetStatementAttribute(ODBC32.SQL_ATTR attribute, out IntPtr value, out int stringLength) + internal ODBC32.SQLRETURN GetStatementAttribute(ODBC32.SQL_ATTR attribute, out IntPtr value, out int stringLength) { - ODBC32.RetCode retcode = Interop.Odbc.SQLGetStmtAttrW(this, attribute, out value, ADP.PtrSize, out stringLength); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetStmtAttrW(this, attribute, out value, ADP.PtrSize, out stringLength); ODBC.TraceODBC(3, "SQLGetStmtAttrW", retcode); return retcode; } - internal ODBC32.RetCode GetTypeInfo(short fSqlType) + internal ODBC32.SQLRETURN GetTypeInfo(short fSqlType) { - ODBC32.RetCode retcode = Interop.Odbc.SQLGetTypeInfo(this, fSqlType); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetTypeInfo(this, fSqlType); ODBC.TraceODBC(3, "SQLGetTypeInfo", retcode); return retcode; } - internal ODBC32.RetCode MoreResults() + internal ODBC32.SQLRETURN MoreResults() { - ODBC32.RetCode retcode = Interop.Odbc.SQLMoreResults(this); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLMoreResults(this); ODBC.TraceODBC(3, "SQLMoreResults", retcode); return retcode; } - internal ODBC32.RetCode NumberOfResultColumns(out short columnsAffected) + internal ODBC32.SQLRETURN NumberOfResultColumns(out short columnsAffected) { - ODBC32.RetCode retcode = Interop.Odbc.SQLNumResultCols(this, out columnsAffected); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLNumResultCols(this, out columnsAffected); ODBC.TraceODBC(3, "SQLNumResultCols", retcode); return retcode; } - internal ODBC32.RetCode Prepare(string commandText) + internal ODBC32.SQLRETURN Prepare(string commandText) { - ODBC32.RetCode retcode = Interop.Odbc.SQLPrepareW(this, commandText, ODBC32.SQL_NTS); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLPrepareW(this, commandText, ODBC32.SQL_NTS); ODBC.TraceODBC(3, "SQLPrepareW", retcode); return retcode; } - internal ODBC32.RetCode PrimaryKeys(string? catalogName, string? schemaName, string tableName) + internal ODBC32.SQLRETURN PrimaryKeys(string? catalogName, string? schemaName, string tableName) { - ODBC32.RetCode retcode = Interop.Odbc.SQLPrimaryKeysW(this, + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLPrimaryKeysW(this, catalogName, ODBC.ShortStringLength(catalogName), // CatalogName schemaName, ODBC.ShortStringLength(schemaName), // SchemaName tableName, ODBC.ShortStringLength(tableName) // TableName @@ -219,11 +219,11 @@ internal ODBC32.RetCode PrimaryKeys(string? catalogName, string? schemaName, str return retcode; } - internal ODBC32.RetCode Procedures(string procedureCatalog, + internal ODBC32.SQLRETURN Procedures(string procedureCatalog, string procedureSchema, string procedureName) { - ODBC32.RetCode retcode = Interop.Odbc.SQLProceduresW(this, + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLProceduresW(this, procedureCatalog, ODBC.ShortStringLength(procedureCatalog), procedureSchema, @@ -235,12 +235,12 @@ internal ODBC32.RetCode Procedures(string procedureCatalog, return retcode; } - internal ODBC32.RetCode ProcedureColumns(string? procedureCatalog, + internal ODBC32.SQLRETURN ProcedureColumns(string? procedureCatalog, string? procedureSchema, string? procedureName, string? columnName) { - ODBC32.RetCode retcode = Interop.Odbc.SQLProcedureColumnsW(this, + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLProcedureColumnsW(this, procedureCatalog, ODBC.ShortStringLength(procedureCatalog), procedureSchema, @@ -254,25 +254,25 @@ internal ODBC32.RetCode ProcedureColumns(string? procedureCatalog, return retcode; } - internal ODBC32.RetCode RowCount(out SQLLEN rowCount) + internal ODBC32.SQLRETURN RowCount(out SQLLEN rowCount) { IntPtr result; - ODBC32.RetCode retcode = Interop.Odbc.SQLRowCount(this, out result); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLRowCount(this, out result); rowCount = new SQLLEN(result); ODBC.TraceODBC(3, "SQLRowCount", retcode); return retcode; } - internal ODBC32.RetCode SetStatementAttribute(ODBC32.SQL_ATTR attribute, IntPtr value, ODBC32.SQL_IS stringLength) + internal ODBC32.SQLRETURN SetStatementAttribute(ODBC32.SQL_ATTR attribute, IntPtr value, ODBC32.SQL_IS stringLength) { - ODBC32.RetCode retcode = Interop.Odbc.SQLSetStmtAttrW(this, (int)attribute, value, (int)stringLength); + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLSetStmtAttrW(this, (int)attribute, value, (int)stringLength); ODBC.TraceODBC(3, "SQLSetStmtAttrW", retcode); return retcode; } - internal ODBC32.RetCode SpecialColumns(string quotedTable) + internal ODBC32.SQLRETURN SpecialColumns(string quotedTable) { - ODBC32.RetCode retcode = Interop.Odbc.SQLSpecialColumnsW(this, + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLSpecialColumnsW(this, ODBC32.SQL_SPECIALCOLS.ROWVER, null, 0, null, 0, quotedTable, ODBC.ShortStringLength(quotedTable), ODBC32.SQL_SCOPE.SESSION, ODBC32.SQL_NULLABILITY.NO_NULLS); @@ -280,13 +280,13 @@ internal ODBC32.RetCode SpecialColumns(string quotedTable) return retcode; } - internal ODBC32.RetCode Statistics(string? tableCatalog, + internal ODBC32.SQLRETURN Statistics(string? tableCatalog, string? tableSchema, string tableName, short unique, short accuracy) { - ODBC32.RetCode retcode; + ODBC32.SQLRETURN retcode; // MDAC Bug 75928 - SQLStatisticsW damages the string passed in // To protect the tablename we need to pass in a copy of that string @@ -313,17 +313,17 @@ internal ODBC32.RetCode Statistics(string? tableCatalog, return retcode; } - internal ODBC32.RetCode Statistics(string tableName) + internal ODBC32.SQLRETURN Statistics(string tableName) { return Statistics(null, null, tableName, (short)ODBC32.SQL_INDEX.UNIQUE, (short)ODBC32.SQL_STATISTICS_RESERVED.ENSURE); } - internal ODBC32.RetCode Tables(string tableCatalog, + internal ODBC32.SQLRETURN Tables(string tableCatalog, string tableSchema, string tableName, string tableType) { - ODBC32.RetCode retcode = Interop.Odbc.SQLTablesW(this, + ODBC32.SQLRETURN retcode = Interop.Odbc.SQLTablesW(this, tableCatalog, ODBC.ShortStringLength(tableCatalog), tableSchema, diff --git a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcTransaction.cs b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcTransaction.cs index aceee7efbe499a..7e1856c16f07d7 100644 --- a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcTransaction.cs +++ b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcTransaction.cs @@ -82,8 +82,8 @@ public override void Commit() throw ODBC.NotInTransaction(); } - ODBC32.RetCode retcode = _handle.CompleteTransaction(ODBC32.SQL_COMMIT); - if (retcode == ODBC32.RetCode.ERROR) + ODBC32.SQLRETURN retcode = _handle.CompleteTransaction(ODBC32.SQL_COMMIT); + if (retcode == ODBC32.SQLRETURN.ERROR) { //If an error has occurred, we will throw an exception in HandleError, //and leave the transaction active for the user to retry @@ -106,8 +106,8 @@ protected override void Dispose(bool disposing) { try { - ODBC32.RetCode retcode = handle.CompleteTransaction(ODBC32.SQL_ROLLBACK); - if (retcode == ODBC32.RetCode.ERROR) + ODBC32.SQLRETURN retcode = handle.CompleteTransaction(ODBC32.SQL_ROLLBACK); + if (retcode == ODBC32.SQLRETURN.ERROR) { //don't throw an exception here, but trace it so it can be logged if (_connection != null) @@ -155,8 +155,8 @@ public override void Rollback() throw ODBC.NotInTransaction(); } - ODBC32.RetCode retcode = _handle.CompleteTransaction(ODBC32.SQL_ROLLBACK); - if (retcode == ODBC32.RetCode.ERROR) + ODBC32.SQLRETURN retcode = _handle.CompleteTransaction(ODBC32.SQL_ROLLBACK); + if (retcode == ODBC32.SQLRETURN.ERROR) { //If an error has occurred, we will throw an exception in HandleError, //and leave the transaction active for the user to retry diff --git a/src/libraries/System.Data.OleDb/src/DbPropSet.cs b/src/libraries/System.Data.OleDb/src/DbPropSet.cs index 0adeb559986882..6d462d9970c247 100644 --- a/src/libraries/System.Data.OleDb/src/DbPropSet.cs +++ b/src/libraries/System.Data.OleDb/src/DbPropSet.cs @@ -24,13 +24,13 @@ public DBPropSet() : base(IntPtr.Zero, true) internal DBPropSet(int propertysetCount) : this() { this.propertySetCount = propertysetCount; - IntPtr countOfBytes = (IntPtr)(propertysetCount * ODB.SizeOf_tagDBPROPSET); + nuint countOfBytes = (nuint)(propertysetCount * ODB.SizeOf_tagDBPROPSET); RuntimeHelpers.PrepareConstrainedRegions(); try { } finally { - base.handle = SafeNativeMethods.CoTaskMemAlloc(countOfBytes); + base.handle = Interop.Ole32.CoTaskMemAlloc(countOfBytes); if (ADP.PtrZero != base.handle) { SafeNativeMethods.ZeroMemory(base.handle, (int)countOfBytes); @@ -145,12 +145,12 @@ protected override bool ReleaseHandle() IntPtr vptr = ADP.IntPtrOffset(rgProperties, ODB.OffsetOf_tagDBPROP_Value); for (int k = 0; k < cProperties; ++k, vptr = ADP.IntPtrOffset(vptr, ODB.SizeOf_tagDBPROP)) { - SafeNativeMethods.VariantClear(vptr); + Interop.OleAut32.VariantClear(vptr); } - SafeNativeMethods.CoTaskMemFree(rgProperties); + Interop.Ole32.CoTaskMemFree(rgProperties); } } - SafeNativeMethods.CoTaskMemFree(ptr); + Interop.Ole32.CoTaskMemFree(ptr); } return true; } @@ -227,7 +227,7 @@ internal void SetPropertySet(int index, Guid propertySet, ItagDBPROP[] propertie Debug.Assert(Guid.Empty != propertySet, "invalid propertySet"); Debug.Assert((null != properties) && (0 < properties.Length), "invalid properties"); - IntPtr countOfBytes = (IntPtr)(properties.Length * ODB.SizeOf_tagDBPROP); + nuint countOfBytes = (nuint)(properties.Length * ODB.SizeOf_tagDBPROP); tagDBPROPSET propset = new tagDBPROPSET(properties.Length, propertySet); bool mustRelease = false; @@ -244,7 +244,7 @@ internal void SetPropertySet(int index, Guid propertySet, ItagDBPROP[] propertie finally { // must allocate and clear the memory without interruption - propset.rgProperties = SafeNativeMethods.CoTaskMemAlloc(countOfBytes); + propset.rgProperties = Interop.Ole32.CoTaskMemAlloc(countOfBytes); if (ADP.PtrZero != propset.rgProperties) { // clearing is important so that we don't treat existing diff --git a/src/libraries/System.Data.OleDb/src/NativeMethods.cs b/src/libraries/System.Data.OleDb/src/NativeMethods.cs index c6ecc82dd0a163..51038511a801b6 100644 --- a/src/libraries/System.Data.OleDb/src/NativeMethods.cs +++ b/src/libraries/System.Data.OleDb/src/NativeMethods.cs @@ -5,7 +5,7 @@ namespace System.Data.Common { - internal static class NativeMethods + internal static partial class NativeMethods { [Guid("0c733a1e-2a1c-11ce-ade5-00aa0044773d"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), ComImport] internal interface ISourcesRowset @@ -32,67 +32,5 @@ void JoinTransaction( [In] int isoFlags, [In] IntPtr pOtherOptions); } - - [DllImport(Interop.Libraries.Kernel32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto)] - internal static extern IntPtr MapViewOfFile(IntPtr hFileMappingObject, int dwDesiredAccess, int dwFileOffsetHigh, int dwFileOffsetLow, IntPtr dwNumberOfBytesToMap); - - [DllImport(Interop.Libraries.Kernel32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto)] - internal static extern bool UnmapViewOfFile(IntPtr lpBaseAddress); - - [DllImport(Interop.Libraries.Kernel32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)] - internal static extern bool CloseHandle(IntPtr handle); - - [DllImport(Interop.Libraries.Advapi32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)] - internal static extern bool AllocateAndInitializeSid( - IntPtr pIdentifierAuthority, // authority - byte nSubAuthorityCount, // count of subauthorities - int dwSubAuthority0, // subauthority 0 - int dwSubAuthority1, // subauthority 1 - int dwSubAuthority2, // subauthority 2 - int dwSubAuthority3, // subauthority 3 - int dwSubAuthority4, // subauthority 4 - int dwSubAuthority5, // subauthority 5 - int dwSubAuthority6, // subauthority 6 - int dwSubAuthority7, // subauthority 7 - ref IntPtr pSid); // SID - - [DllImport(Interop.Libraries.Advapi32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)] - internal static extern int GetLengthSid( - IntPtr pSid); // SID to query - - [DllImport(Interop.Libraries.Advapi32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)] - internal static extern bool InitializeAcl( - IntPtr pAcl, // ACL - int nAclLength, // size of ACL - int dwAclRevision); // revision level of ACL - - [DllImport(Interop.Libraries.Advapi32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)] - internal static extern bool AddAccessDeniedAce( - IntPtr pAcl, // access control list - int dwAceRevision, // ACL revision level - int AccessMask, // access mask - IntPtr pSid); // security identifier - - [DllImport(Interop.Libraries.Advapi32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)] - internal static extern bool AddAccessAllowedAce( - IntPtr pAcl, // access control list - int dwAceRevision, // ACL revision level - uint AccessMask, // access mask - IntPtr pSid); // security identifier - - [DllImport(Interop.Libraries.Advapi32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)] - internal static extern bool InitializeSecurityDescriptor( - IntPtr pSecurityDescriptor, // SD - int dwRevision); // revision level - [DllImport(Interop.Libraries.Advapi32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)] - internal static extern bool SetSecurityDescriptorDacl( - IntPtr pSecurityDescriptor, // SD - bool bDaclPresent, // DACL presence - IntPtr pDacl, // DACL - bool bDaclDefaulted); // default DACL - - [DllImport(Interop.Libraries.Advapi32, ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto, SetLastError = true)] - internal static extern IntPtr FreeSid( - IntPtr pSid); // SID to free } } diff --git a/src/libraries/System.Data.OleDb/src/OleDbError.cs b/src/libraries/System.Data.OleDb/src/OleDbError.cs index 333cdb3128a795..9fa39bc0472e1b 100644 --- a/src/libraries/System.Data.OleDb/src/OleDbError.cs +++ b/src/libraries/System.Data.OleDb/src/OleDbError.cs @@ -25,7 +25,7 @@ internal OleDbError(UnsafeNativeMethods.IErrorRecords errorRecords, int index) if (OleDbHResult.DB_E_NOLOCALE == hr) { Marshal.ReleaseComObject(errorInfo); - lcid = SafeNativeMethods.GetUserDefaultLCID(); + lcid = Interop.Kernel32.GetUserDefaultLCID(); errorInfo = errorRecords.GetErrorInfo(index, lcid); if (null != errorInfo) @@ -44,7 +44,7 @@ internal OleDbError(UnsafeNativeMethods.IErrorRecords errorRecords, int index) if (OleDbHResult.DB_E_NOLOCALE == hr) { Marshal.ReleaseComObject(errorInfo); - lcid = SafeNativeMethods.GetUserDefaultLCID(); + lcid = Interop.Kernel32.GetUserDefaultLCID(); errorInfo = errorRecords.GetErrorInfo(index, lcid); if (null != errorInfo) diff --git a/src/libraries/System.Data.OleDb/src/PropertyInfoSet.cs b/src/libraries/System.Data.OleDb/src/PropertyInfoSet.cs index 67f95789eb04a5..c17c30cc7b3dbf 100644 --- a/src/libraries/System.Data.OleDb/src/PropertyInfoSet.cs +++ b/src/libraries/System.Data.OleDb/src/PropertyInfoSet.cs @@ -127,19 +127,19 @@ protected override bool ReleaseHandle() for (int k = 0; k < infoCount; ++k) { IntPtr valuePtr = ADP.IntPtrOffset(infoPtr, (k * ODB.SizeOf_tagDBPROPINFO) + ODB.OffsetOf_tagDBPROPINFO_Value); - SafeNativeMethods.VariantClear(valuePtr); + Interop.OleAut32.VariantClear(valuePtr); } - SafeNativeMethods.CoTaskMemFree(infoPtr); // was allocated by provider + Interop.Ole32.CoTaskMemFree(infoPtr); // was allocated by provider } } - SafeNativeMethods.CoTaskMemFree(ptr); + Interop.Ole32.CoTaskMemFree(ptr); } ptr = this.descBuffer; this.descBuffer = IntPtr.Zero; if (IntPtr.Zero != ptr) { - SafeNativeMethods.CoTaskMemFree(ptr); + Interop.Ole32.CoTaskMemFree(ptr); } return true; } diff --git a/src/libraries/System.Data.OleDb/src/RowBinding.cs b/src/libraries/System.Data.OleDb/src/RowBinding.cs index 75312475fcdd7d..80eb9283490672 100644 --- a/src/libraries/System.Data.OleDb/src/RowBinding.cs +++ b/src/libraries/System.Data.OleDb/src/RowBinding.cs @@ -257,7 +257,7 @@ internal void SetBstrValue(int offset, string value) { } finally { - ptr = SafeNativeMethods.SysAllocStringLen(value, value.Length); + ptr = Interop.OleAut32.SysAllocStringLen(value, (uint)value.Length); // safe to copy ptr, even if SysAllocStringLen failed Marshal.WriteIntPtr(base.handle, offset, ptr); @@ -499,11 +499,11 @@ private static void FreeBstr(IntPtr buffer, int valueOffset) if ((ADP.PtrZero != currentValue) && (currentValue != originalValue)) { - SafeNativeMethods.SysFreeString(currentValue); + Interop.OleAut32.SysFreeString(currentValue); } if (ADP.PtrZero != originalValue) { - SafeNativeMethods.SysFreeString(originalValue); + Interop.OleAut32.SysFreeString(originalValue); } // for debugability - delay clearing memory until after FreeBSTR @@ -529,7 +529,7 @@ private static void FreeCoTaskMem(IntPtr buffer, int valueOffset) // originalValue is pinned managed memory or pointer to emptyStringOffset if ((ADP.PtrZero != currentValue) && (currentValue != originalValue)) { - SafeNativeMethods.CoTaskMemFree(currentValue); + Interop.Ole32.CoTaskMemFree(currentValue); } // for debugability - delay clearing memory until after CoTaskMemFree @@ -556,11 +556,11 @@ private static void FreeVariant(IntPtr buffer, int valueOffset) finally { // always clear the first structure - SafeNativeMethods.VariantClear(currentHandle); + Interop.OleAut32.VariantClear(currentHandle); if (different) { // second structure different from the first - SafeNativeMethods.VariantClear(originalHandle); + Interop.OleAut32.VariantClear(originalHandle); } else { @@ -587,11 +587,11 @@ private static unsafe void FreePropVariant(IntPtr buffer, int valueOffset) finally { // always clear the first structure - SafeNativeMethods.PropVariantClear(currentHandle); + Interop.Ole32.PropVariantClear(currentHandle); if (different) { // second structure different from the first - SafeNativeMethods.PropVariantClear(originalHandle); + Interop.Ole32.PropVariantClear(originalHandle); } else { diff --git a/src/libraries/System.Data.OleDb/src/SafeHandles.cs b/src/libraries/System.Data.OleDb/src/SafeHandles.cs index edd87806063a07..1157f3e3a05808 100644 --- a/src/libraries/System.Data.OleDb/src/SafeHandles.cs +++ b/src/libraries/System.Data.OleDb/src/SafeHandles.cs @@ -66,14 +66,14 @@ protected override bool ReleaseHandle() base.handle = IntPtr.Zero; if (IntPtr.Zero != ptr) { - SafeNativeMethods.CoTaskMemFree(ptr); + Interop.Ole32.CoTaskMemFree(ptr); } ptr = this.handle2; this.handle2 = IntPtr.Zero; if (IntPtr.Zero != ptr) { - SafeNativeMethods.CoTaskMemFree(ptr); + Interop.Ole32.CoTaskMemFree(ptr); } return true; } diff --git a/src/libraries/System.Data.OleDb/src/SafeNativeMethods.cs b/src/libraries/System.Data.OleDb/src/SafeNativeMethods.cs index e2e5766615a8b0..a89a5c30a40c4b 100644 --- a/src/libraries/System.Data.OleDb/src/SafeNativeMethods.cs +++ b/src/libraries/System.Data.OleDb/src/SafeNativeMethods.cs @@ -10,17 +10,8 @@ namespace System.Data.Common { [SuppressUnmanagedCodeSecurity] - internal static class SafeNativeMethods + internal static partial class SafeNativeMethods { - [DllImport(Interop.Libraries.Ole32, SetLastError = false)] - internal static extern IntPtr CoTaskMemAlloc(IntPtr cb); - - [DllImport(Interop.Libraries.Ole32, SetLastError = false)] - internal static extern void CoTaskMemFree(IntPtr handle); - - [DllImport(Interop.Libraries.Kernel32, CharSet = CharSet.Unicode, PreserveSig = true)] - internal static extern int GetUserDefaultLCID(); - internal static void ZeroMemory(IntPtr ptr, int length) { var zeroes = new byte[length]; @@ -44,40 +35,14 @@ internal static unsafe IntPtr InterlockedExchangePointer( return actualPtr; } - [DllImport(Interop.Libraries.Kernel32, CharSet = System.Runtime.InteropServices.CharSet.Auto)] - internal static extern int GetCurrentProcessId(); - - [DllImport(Interop.Libraries.Kernel32, SetLastError = true)] - internal static extern IntPtr LocalAlloc(int flags, IntPtr countOfBytes); - - [DllImport(Interop.Libraries.Kernel32, SetLastError = true)] - internal static extern IntPtr LocalFree(IntPtr handle); - - [DllImport(Interop.Libraries.OleAut32, CharSet = CharSet.Unicode)] - internal static extern IntPtr SysAllocStringLen(string src, int len); // BSTR - - [DllImport(Interop.Libraries.OleAut32)] - internal static extern void SysFreeString(IntPtr bstr); - - // only using this to clear existing error info with null - [DllImport(Interop.Libraries.OleAut32, CharSet = CharSet.Unicode, PreserveSig = false)] - // TLS values are preserved between threads, need to check that we use this API to clear the error state only. - private static extern void SetErrorInfo(int dwReserved, IntPtr pIErrorInfo); - - [DllImport(Interop.Libraries.Kernel32, SetLastError = true)] - internal static extern int ReleaseSemaphore(IntPtr handle, int releaseCount, IntPtr previousCount); - - [DllImport(Interop.Libraries.Kernel32, SetLastError = true)] - internal static extern int WaitForMultipleObjectsEx(uint nCount, IntPtr lpHandles, bool bWaitAll, uint dwMilliseconds, bool bAlertable); - - [DllImport(Interop.Libraries.Kernel32/*, SetLastError=true*/)] - internal static extern int WaitForSingleObjectEx(IntPtr lpHandles, uint dwMilliseconds, bool bAlertable); + [GeneratedDllImport(Interop.Libraries.Kernel32, SetLastError = true)] + internal static partial int ReleaseSemaphore(IntPtr handle, int releaseCount, IntPtr previousCount); - [DllImport(Interop.Libraries.Ole32, PreserveSig = false)] - internal static extern void PropVariantClear(IntPtr pObject); + [GeneratedDllImport(Interop.Libraries.Kernel32, SetLastError = true)] + internal static partial int WaitForMultipleObjectsEx(uint nCount, IntPtr lpHandles, bool bWaitAll, uint dwMilliseconds, bool bAlertable); - [DllImport(Interop.Libraries.OleAut32, PreserveSig = false)] - internal static extern void VariantClear(IntPtr pObject); + [GeneratedDllImport(Interop.Libraries.Kernel32/*, SetLastError=true*/)] + internal static partial int WaitForSingleObjectEx(IntPtr lpHandles, uint dwMilliseconds, bool bAlertable); internal sealed class Wrapper { @@ -86,7 +51,7 @@ private Wrapper() { } // SxS: clearing error information is considered safe internal static void ClearErrorInfo() { - SafeNativeMethods.SetErrorInfo(0, ADP.PtrZero); + Interop.OleAut32.SetErrorInfo(0, ADP.PtrZero); } } } 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 912414debb420e..62b3ffd01287c6 100644 --- a/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj +++ b/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj @@ -34,6 +34,24 @@ System.Data.OleDb.OleDbTransaction + + + + + + + + + @@ -143,6 +161,7 @@ System.Data.OleDb.OleDbTransaction + diff --git a/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbBuffer.cs b/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbBuffer.cs index dc0db72fa5c6cd..7ffbdea2af69ce 100644 --- a/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbBuffer.cs +++ b/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbBuffer.cs @@ -12,17 +12,13 @@ namespace System.Data.ProviderBase // so that when debugging, we can tell the difference between one DbBuffer and another internal abstract class DbBuffer : SafeHandle { - internal const int LMEM_FIXED = 0x0000; - internal const int LMEM_MOVEABLE = 0x0002; - internal const int LMEM_ZEROINIT = 0x0040; - private readonly int _bufferLength; private DbBuffer(int initialSize, bool zeroBuffer) : base(IntPtr.Zero, true) { if (0 < initialSize) { - int flags = ((zeroBuffer) ? LMEM_ZEROINIT : LMEM_FIXED); + uint flags = ((zeroBuffer) ? Interop.Kernel32.LMEM_ZEROINIT : Interop.Kernel32.LMEM_FIXED); _bufferLength = initialSize; RuntimeHelpers.PrepareConstrainedRegions(); @@ -30,7 +26,7 @@ private DbBuffer(int initialSize, bool zeroBuffer) : base(IntPtr.Zero, true) { } finally { - base.handle = SafeNativeMethods.LocalAlloc(flags, (IntPtr)initialSize); + base.handle = Interop.Kernel32.LocalAlloc(flags, (nuint)initialSize); } if (IntPtr.Zero == base.handle) { @@ -358,7 +354,7 @@ protected override bool ReleaseHandle() base.handle = IntPtr.Zero; if (IntPtr.Zero != ptr) { - SafeNativeMethods.LocalFree(ptr); + Interop.Kernel32.LocalFree(ptr); } return true; } diff --git a/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbConnectionPoolCounters.cs b/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbConnectionPoolCounters.cs index 5a96e7d05f837b..245209ce748429 100644 --- a/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbConnectionPoolCounters.cs +++ b/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbConnectionPoolCounters.cs @@ -236,7 +236,6 @@ protected DbConnectionPoolCounters(string? categoryName, string? categoryHelp) } // SxS: this method uses GetCurrentProcessId to construct the instance name. - // TODO: remove the Resource* attributes if you do not use GetCurrentProcessId after the fix private string GetInstanceName() { string? result = null; @@ -252,8 +251,7 @@ private string GetInstanceName() } } - // TODO: If you do not use GetCurrentProcessId after fixing VSDD 534795, please remove Resource* attributes from this method - int pid = SafeNativeMethods.GetCurrentProcessId(); + uint pid = Interop.Kernel32.GetCurrentProcessId(); // there are several characters which have special meaning // to PERFMON. They recommend that we translate them as shown below, to diff --git a/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbConnectionPoolIdentity.cs b/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbConnectionPoolIdentity.cs index 9fe3910b372a24..c0f8270865f520 100644 --- a/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbConnectionPoolIdentity.cs +++ b/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbConnectionPoolIdentity.cs @@ -51,7 +51,7 @@ private static byte[] CreateWellKnownSid(WellKnownSidType sidType) // NOTE - We copied this code from System.Security.Principal.Win32.CreateWellKnownSid... - if (0 == UnsafeNativeMethods.CreateWellKnownSid((int)sidType, null, resultSid, ref length)) + if (0 == UnsafeNativeMethods.CreateWellKnownSid((int)sidType, null, out resultSid, ref length)) { IntegratedSecurityError(Win32_CreateWellKnownSid); } diff --git a/src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.COMWrappers.cs b/src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.COMWrappers.cs index 259b856952d31f..d874526e2d97d4 100644 --- a/src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.COMWrappers.cs +++ b/src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.COMWrappers.cs @@ -12,8 +12,8 @@ internal static partial class UnsafeNativeMethods // Oleaut32 // - [DllImport(Interop.Libraries.OleAut32)] - internal static unsafe extern OleDbHResult GetErrorInfo( + [GeneratedDllImport(Interop.Libraries.OleAut32)] + internal static unsafe partial OleDbHResult GetErrorInfo( int dwReserved, System.IntPtr* ppIErrorInfo); diff --git a/src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.cs b/src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.cs index 2453d6930a1192..55d7aee68d1827 100644 --- a/src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.cs +++ b/src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.cs @@ -832,11 +832,11 @@ internal Trustee(string name) } } - [DllImport(Interop.Libraries.Advapi32, EntryPoint = "CreateWellKnownSid", SetLastError = true, CharSet = CharSet.Unicode)] - internal static extern int CreateWellKnownSid( + [GeneratedDllImport(Interop.Libraries.Advapi32, EntryPoint = "CreateWellKnownSid", SetLastError = true, CharSet = CharSet.Unicode)] + internal static partial int CreateWellKnownSid( int sidType, byte[]? domainSid, - [Out] byte[] resultSid, + [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] out byte[] resultSid, ref uint resultSidLength); } } diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/AggregationManager.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/AggregationManager.cs index d181fbdf9a6666..aaf6cb6a20fe54 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/AggregationManager.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/AggregationManager.cs @@ -302,7 +302,8 @@ private void RemoveInstrumentState(Instrument instrument, InstrumentState state) { lock (this) { - return (!CheckTimeSeriesAllowed() || !CheckHistogramAllowed()) ? + // checking currentHistograms first because avoiding unexpected increment of TimeSeries count. + return (!CheckHistogramAllowed() || !CheckTimeSeriesAllowed()) ? null : new ExponentialHistogramAggregator(s_defaultHistogramConfig); } diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/MetricEventSourceTests.cs b/src/libraries/System.Diagnostics.DiagnosticSource/tests/MetricEventSourceTests.cs index 1f3a8d13271e35..a4fc6695ea3904 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/MetricEventSourceTests.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/MetricEventSourceTests.cs @@ -704,6 +704,47 @@ public void EventSourceWorksWithSequentialListeners() AssertCollectStartStopEventsPresent(events, IntervalSecs, 3); } + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [OuterLoop("Slow and has lots of console spew")] + public void EventSourceEnforcesHistogramLimitAndNotMaxTimeSeries() + { + using Meter meter = new Meter("TestMeter17"); + Histogram h = meter.CreateHistogram("histogram1"); + + + EventWrittenEventArgs[] events; + // MaxTimeSeries = 3, MaxHistograms = 2 + // HistogramLimitReached should be raised when Record(tags: "Color=green"), but TimeSeriesLimitReached should not be raised + using (MetricsEventListener listener = new MetricsEventListener(_output, MetricsEventListener.TimeSeriesValues, IntervalSecs, 3, 2, "TestMeter17")) + { + listener.WaitForCollectionStop(s_waitForEventTimeout, 1); + + h.Record(5, new KeyValuePair("Color", "red")); + h.Record(6, new KeyValuePair("Color", "blue")); + h.Record(7, new KeyValuePair("Color", "green")); + h.Record(8, new KeyValuePair("Color", "yellow")); + listener.WaitForCollectionStop(s_waitForEventTimeout, 2); + + h.Record(12, new KeyValuePair("Color", "red")); + h.Record(13, new KeyValuePair("Color", "blue")); + h.Record(14, new KeyValuePair("Color", "green")); + h.Record(15, new KeyValuePair("Color", "yellow")); + listener.WaitForCollectionStop(s_waitForEventTimeout, 3); + events = listener.Events.ToArray(); + } + + AssertBeginInstrumentReportingEventsPresent(events, h); + AssertInitialEnumerationCompleteEventPresent(events); + AssertHistogramEventsPresent(events, meter.Name, h.Name, "Color=red", "", "0.5=5;0.95=5;0.99=5", "0.5=12;0.95=12;0.99=12"); + AssertHistogramEventsPresent(events, meter.Name, h.Name, "Color=blue", "", "0.5=6;0.95=6;0.99=6", "0.5=13;0.95=13;0.99=13"); + AssertHistogramLimitPresent(events); + AssertTimeSeriesLimitNotPresent(events); + AssertHistogramEventsNotPresent(events, meter.Name, h.Name, "Color=green"); + AssertHistogramEventsNotPresent(events, meter.Name, h.Name, "Color=yellow"); + AssertCollectStartStopEventsPresent(events, IntervalSecs, 3); + } + + private void AssertBeginInstrumentReportingEventsPresent(EventWrittenEventArgs[] events, params Instrument[] expectedInstruments) { var beginReportEvents = events.Where(e => e.EventName == "BeginInstrumentReporting").Select(e => @@ -766,6 +807,11 @@ private void AssertTimeSeriesLimitPresent(EventWrittenEventArgs[] events) Assert.Equal(1, events.Where(e => e.EventName == "TimeSeriesLimitReached").Count()); } + private void AssertTimeSeriesLimitNotPresent(EventWrittenEventArgs[] events) + { + Assert.Equal(0, events.Where(e => e.EventName == "TimeSeriesLimitReached").Count()); + } + private void AssertHistogramLimitPresent(EventWrittenEventArgs[] events) { Assert.Equal(1, events.Where(e => e.EventName == "HistogramLimitReached").Count()); diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/TagListTests.cs b/src/libraries/System.Diagnostics.DiagnosticSource/tests/TagListTests.cs index 46dcb9c4faaffa..9f35cb9d47c027 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/TagListTests.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/TagListTests.cs @@ -105,7 +105,7 @@ public void TestInsert() Assert.Equal(i, list[i].Value); } - // Insert at begining + // Insert at beginning int count = list.Count; for (int i = 1; i < 10; i++) { 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 33c1953ecdcd5a..29a936cb89cc87 100644 --- a/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj +++ b/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj @@ -1,8 +1,13 @@ - + true $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) - $(NoWarn);CA1838;CA1847 + $(NoWarn);CA1847 + + $(NoWarn);CA1845;CA1846 + annotations true Provides the System.Diagnostics.EventLog class, which allows the applications to use the windows event log service. @@ -125,8 +130,10 @@ System.Diagnostics.EventLog + + diff --git a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/EventLogRecord.cs b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/EventLogRecord.cs index b0f8ff9570cb4e..bb54bd0ae3faae 100644 --- a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/EventLogRecord.cs +++ b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/EventLogRecord.cs @@ -398,9 +398,8 @@ public IList GetPropertyValues(EventLogPropertySelector propertySelector public override string ToXml() { - StringBuilder renderBuffer = new StringBuilder(2000); - NativeWrapper.EvtRender(EventLogHandle.Zero, Handle, UnsafeNativeMethods.EvtRenderFlags.EvtRenderEventXml, renderBuffer); - return renderBuffer.ToString(); + char[] renderBuffer = GC.AllocateUninitializedArray(2000); + return NativeWrapper.EvtRenderXml(EventLogHandle.Zero, Handle, renderBuffer); } protected override void Dispose(bool disposing) diff --git a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/NativeWrapper.cs b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/NativeWrapper.cs index ac44ce3773feb0..35ee7fefbc9bd6 100644 --- a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/NativeWrapper.cs +++ b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/NativeWrapper.cs @@ -85,7 +85,7 @@ public static bool EvtNext( { bool status = UnsafeNativeMethods.EvtNext(queryHandle, eventSize, events, timeout, flags, ref returned); int win32Error = Marshal.GetLastWin32Error(); - if (!status && win32Error != UnsafeNativeMethods.ERROR_NO_MORE_ITEMS) + if (!status && win32Error != Interop.Errors.ERROR_NO_MORE_ITEMS) EventLogException.Throw(win32Error); return win32Error == 0; } @@ -153,7 +153,7 @@ public static EventLogHandle EvtNextEventMetadata(EventLogHandle eventMetadataEn if (emHandle.IsInvalid) { - if (win32Error != UnsafeNativeMethods.ERROR_NO_MORE_ITEMS) + if (win32Error != Interop.Errors.ERROR_NO_MORE_ITEMS) EventLogException.Throw(win32Error); return null; } @@ -257,24 +257,22 @@ public static EventLogHandle EvtCreateRenderContext( return renderContextHandleValues; } - public static void EvtRender( + public static string EvtRenderXml( EventLogHandle context, EventLogHandle eventHandle, - UnsafeNativeMethods.EvtRenderFlags flags, - StringBuilder buffer) + char[] buffer) { int buffUsed; - int propCount; - bool status = UnsafeNativeMethods.EvtRender(context, eventHandle, flags, buffer.Capacity, buffer, out buffUsed, out propCount); + UnsafeNativeMethods.EvtRenderFlags flags = UnsafeNativeMethods.EvtRenderFlags.EvtRenderEventXml; + bool status = UnsafeNativeMethods.EvtRender(context, eventHandle, flags, buffer.Length, buffer, out buffUsed, out _); int win32Error = Marshal.GetLastWin32Error(); - if (!status) { - if (win32Error == UnsafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) + if (win32Error == Interop.Errors.ERROR_INSUFFICIENT_BUFFER) { // Reallocate the new RenderBuffer with the right size. - buffer.Capacity = buffUsed; - status = UnsafeNativeMethods.EvtRender(context, eventHandle, flags, buffer.Capacity, buffer, out buffUsed, out propCount); + buffer = GC.AllocateUninitializedArray(buffUsed); + status = UnsafeNativeMethods.EvtRender(context, eventHandle, flags, buffer.Length, buffer, out buffUsed, out _); win32Error = Marshal.GetLastWin32Error(); } if (!status) @@ -282,6 +280,12 @@ public static void EvtRender( EventLogException.Throw(win32Error); } } + + int len = buffUsed / sizeof(char) - 1; // buffer includes null terminator + if (len <= 0) + return string.Empty; + + return new string(buffer, 0, len); } public static EventLogHandle EvtOpenSession(UnsafeNativeMethods.EvtLoginClass loginClass, ref UnsafeNativeMethods.EvtRpcLogin login, int timeout, int flags) @@ -321,11 +325,11 @@ public static object EvtGetEventInfo(EventLogHandle handle, UnsafeNativeMethods. int error = Marshal.GetLastWin32Error(); if (!status) { - if (error == UnsafeNativeMethods.ERROR_SUCCESS) - { } - else - if (error != UnsafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) + if (error != Interop.Errors.ERROR_SUCCESS + && error != Interop.Errors.ERROR_INSUFFICIENT_BUFFER) + { EventLogException.Throw(error); + } } buffer = Marshal.AllocHGlobal((int)bufferNeeded); status = UnsafeNativeMethods.EvtGetEventInfo(handle, enumType, bufferNeeded, buffer, out bufferNeeded); @@ -353,7 +357,7 @@ public static object EvtGetQueryInfo(EventLogHandle handle, UnsafeNativeMethods. int error = Marshal.GetLastWin32Error(); if (!status) { - if (error != UnsafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) + if (error != Interop.Errors.ERROR_INSUFFICIENT_BUFFER) EventLogException.Throw(error); } buffer = Marshal.AllocHGlobal((int)bufferNeeded); @@ -383,7 +387,7 @@ public static object EvtGetPublisherMetadataProperty(EventLogHandle pmHandle, Un int error = Marshal.GetLastWin32Error(); if (!status) { - if (error != UnsafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) + if (error != Interop.Errors.ERROR_INSUFFICIENT_BUFFER) EventLogException.Throw(error); } buffer = Marshal.AllocHGlobal((int)bufferNeeded); @@ -412,7 +416,7 @@ internal static EventLogHandle EvtGetPublisherMetadataPropertyHandle(EventLogHan int error = Marshal.GetLastWin32Error(); if (!status) { - if (error != UnsafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) + if (error != Interop.Errors.ERROR_INSUFFICIENT_BUFFER) EventLogException.Throw(error); } buffer = Marshal.AllocHGlobal((int)bufferNeeded); @@ -442,9 +446,7 @@ internal static EventLogHandle EvtGetPublisherMetadataPropertyHandle(EventLogHan public static string EvtFormatMessage(EventLogHandle handle, uint msgId) { int bufferNeeded; - - StringBuilder sb = new StringBuilder(null); - bool status = UnsafeNativeMethods.EvtFormatMessage(handle, EventLogHandle.Zero, msgId, 0, null, UnsafeNativeMethods.EvtFormatMessageFlags.EvtFormatMessageId, 0, sb, out bufferNeeded); + bool status = UnsafeNativeMethods.EvtFormatMessage(handle, EventLogHandle.Zero, msgId, 0, null, UnsafeNativeMethods.EvtFormatMessageFlags.EvtFormatMessageId, 0, null, out bufferNeeded); int error = Marshal.GetLastWin32Error(); // ERROR_EVT_UNRESOLVED_VALUE_INSERT and its cousins are commonly returned for raw message text. @@ -456,12 +458,12 @@ public static string EvtFormatMessage(EventLogHandle handle, uint msgId) { return null; } - if (error != UnsafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) + if (error != Interop.Errors.ERROR_INSUFFICIENT_BUFFER) EventLogException.Throw(error); } - sb.EnsureCapacity(bufferNeeded); - status = UnsafeNativeMethods.EvtFormatMessage(handle, EventLogHandle.Zero, msgId, 0, null, UnsafeNativeMethods.EvtFormatMessageFlags.EvtFormatMessageId, bufferNeeded, sb, out bufferNeeded); + char[] buffer = new char[bufferNeeded]; + status = UnsafeNativeMethods.EvtFormatMessage(handle, EventLogHandle.Zero, msgId, 0, null, UnsafeNativeMethods.EvtFormatMessageFlags.EvtFormatMessageId, bufferNeeded, buffer, out bufferNeeded); error = Marshal.GetLastWin32Error(); if (!status && error != UnsafeNativeMethods.ERROR_EVT_UNRESOLVED_VALUE_INSERT @@ -474,7 +476,12 @@ public static string EvtFormatMessage(EventLogHandle handle, uint msgId) } EventLogException.Throw(error); } - return sb.ToString(); + + int len = bufferNeeded - 1; // buffer includes null terminator + if (len <= 0) + return string.Empty; + + return new string(buffer, 0, len); } public static object EvtGetObjectArrayProperty(EventLogHandle objArrayHandle, int index, int thePropertyId) @@ -489,7 +496,7 @@ public static object EvtGetObjectArrayProperty(EventLogHandle objArrayHandle, in if (!status) { - if (error != UnsafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) + if (error != Interop.Errors.ERROR_INSUFFICIENT_BUFFER) EventLogException.Throw(error); } buffer = Marshal.AllocHGlobal((int)bufferNeeded); @@ -519,7 +526,7 @@ public static object EvtGetEventMetadataProperty(EventLogHandle handle, UnsafeNa int win32Error = Marshal.GetLastWin32Error(); if (!status) { - if (win32Error != UnsafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) + if (win32Error != Interop.Errors.ERROR_INSUFFICIENT_BUFFER) EventLogException.Throw(win32Error); } buffer = Marshal.AllocHGlobal((int)bufferNeeded); @@ -549,7 +556,7 @@ public static object EvtGetChannelConfigProperty(EventLogHandle handle, UnsafeNa int win32Error = Marshal.GetLastWin32Error(); if (!status) { - if (win32Error != UnsafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) + if (win32Error != Interop.Errors.ERROR_INSUFFICIENT_BUFFER) EventLogException.Throw(win32Error); } buffer = Marshal.AllocHGlobal((int)bufferNeeded); @@ -663,58 +670,63 @@ public static void EvtSetChannelConfigProperty(EventLogHandle handle, UnsafeNati public static string EvtNextChannelPath(EventLogHandle handle, ref bool finish) { - StringBuilder sb = new StringBuilder(null); int channelNameNeeded; - - bool status = UnsafeNativeMethods.EvtNextChannelPath(handle, 0, sb, out channelNameNeeded); + bool status = UnsafeNativeMethods.EvtNextChannelPath(handle, 0, null, out channelNameNeeded); int win32Error = Marshal.GetLastWin32Error(); if (!status) { - if (win32Error == UnsafeNativeMethods.ERROR_NO_MORE_ITEMS) + if (win32Error == Interop.Errors.ERROR_NO_MORE_ITEMS) { finish = true; return null; } - if (win32Error != UnsafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) + if (win32Error != Interop.Errors.ERROR_INSUFFICIENT_BUFFER) EventLogException.Throw(win32Error); } - sb.EnsureCapacity(channelNameNeeded); - status = UnsafeNativeMethods.EvtNextChannelPath(handle, channelNameNeeded, sb, out channelNameNeeded); + char[] buffer = new char[channelNameNeeded]; + status = UnsafeNativeMethods.EvtNextChannelPath(handle, channelNameNeeded, buffer, out channelNameNeeded); win32Error = Marshal.GetLastWin32Error(); if (!status) EventLogException.Throw(win32Error); - return sb.ToString(); + int len = channelNameNeeded - 1; // buffer includes null terminator + if (len <= 0) + return string.Empty; + + return new string(buffer, 0, len); } public static string EvtNextPublisherId(EventLogHandle handle, ref bool finish) { - StringBuilder sb = new StringBuilder(null); int ProviderIdNeeded; - bool status = UnsafeNativeMethods.EvtNextPublisherId(handle, 0, sb, out ProviderIdNeeded); + bool status = UnsafeNativeMethods.EvtNextPublisherId(handle, 0, null, out ProviderIdNeeded); int win32Error = Marshal.GetLastWin32Error(); if (!status) { - if (win32Error == UnsafeNativeMethods.ERROR_NO_MORE_ITEMS) + if (win32Error == Interop.Errors.ERROR_NO_MORE_ITEMS) { finish = true; return null; } - if (win32Error != UnsafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) + if (win32Error != Interop.Errors.ERROR_INSUFFICIENT_BUFFER) EventLogException.Throw(win32Error); } - sb.EnsureCapacity(ProviderIdNeeded); - status = UnsafeNativeMethods.EvtNextPublisherId(handle, ProviderIdNeeded, sb, out ProviderIdNeeded); + char[] buffer = new char[ProviderIdNeeded]; + status = UnsafeNativeMethods.EvtNextPublisherId(handle, ProviderIdNeeded, buffer, out ProviderIdNeeded); win32Error = Marshal.GetLastWin32Error(); if (!status) EventLogException.Throw(win32Error); - return sb.ToString(); + int len = ProviderIdNeeded - 1; // buffer includes null terminator + if (len <= 0) + return string.Empty; + + return new string(buffer, 0, len); } public static object EvtGetLogInfo(EventLogHandle handle, UnsafeNativeMethods.EvtLogPropertyId enumType) @@ -728,7 +740,7 @@ public static object EvtGetLogInfo(EventLogHandle handle, UnsafeNativeMethods.Ev int win32Error = Marshal.GetLastWin32Error(); if (!status) { - if (win32Error != UnsafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) + if (win32Error != Interop.Errors.ERROR_INSUFFICIENT_BUFFER) EventLogException.Throw(win32Error); } buffer = Marshal.AllocHGlobal((int)bufferNeeded); @@ -760,7 +772,7 @@ public static void EvtRenderBufferWithContextSystem(EventLogHandle contextHandle if (!status) { int error = Marshal.GetLastWin32Error(); - if (error != UnsafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) + if (error != Interop.Errors.ERROR_INSUFFICIENT_BUFFER) EventLogException.Throw(error); } @@ -861,7 +873,7 @@ public static IList EvtRenderBufferWithContextUserOrValues(EventLogHandl if (!status) { int error = Marshal.GetLastWin32Error(); - if (error != UnsafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) + if (error != Interop.Errors.ERROR_INSUFFICIENT_BUFFER) EventLogException.Throw(error); } @@ -894,9 +906,7 @@ public static IList EvtRenderBufferWithContextUserOrValues(EventLogHandl public static string EvtFormatMessageRenderName(EventLogHandle pmHandle, EventLogHandle eventHandle, UnsafeNativeMethods.EvtFormatMessageFlags flag) { int bufferNeeded; - StringBuilder sb = new StringBuilder(null); - - bool status = UnsafeNativeMethods.EvtFormatMessage(pmHandle, eventHandle, 0, 0, null, flag, 0, sb, out bufferNeeded); + bool status = UnsafeNativeMethods.EvtFormatMessage(pmHandle, eventHandle, 0, 0, null, flag, 0, null, out bufferNeeded); int error = Marshal.GetLastWin32Error(); if (!status && error != UnsafeNativeMethods.ERROR_EVT_UNRESOLVED_VALUE_INSERT @@ -912,12 +922,12 @@ public static string EvtFormatMessageRenderName(EventLogHandle pmHandle, EventLo { return null; } - if (error != (int)UnsafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) + if (error != (int)Interop.Errors.ERROR_INSUFFICIENT_BUFFER) EventLogException.Throw(error); } - sb.EnsureCapacity(bufferNeeded); - status = UnsafeNativeMethods.EvtFormatMessage(pmHandle, eventHandle, 0, 0, null, flag, bufferNeeded, sb, out bufferNeeded); + char[] buffer = new char[bufferNeeded]; + status = UnsafeNativeMethods.EvtFormatMessage(pmHandle, eventHandle, 0, 0, null, flag, bufferNeeded, buffer, out bufferNeeded); error = Marshal.GetLastWin32Error(); if (!status && error != UnsafeNativeMethods.ERROR_EVT_UNRESOLVED_VALUE_INSERT @@ -929,7 +939,12 @@ public static string EvtFormatMessageRenderName(EventLogHandle pmHandle, EventLo } EventLogException.Throw(error); } - return sb.ToString(); + + int len = bufferNeeded - 1; // buffer includes null terminator + if (len <= 0) + return string.Empty; + + return new string(buffer, 0, len); } // The EvtFormatMessage used for the obtaining of the Keywords names. @@ -950,7 +965,7 @@ public static IEnumerable EvtFormatMessageRenderKeywords(EventLogHandle { return keywordsList.AsReadOnly(); } - if (error != UnsafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) + if (error != Interop.Errors.ERROR_INSUFFICIENT_BUFFER) EventLogException.Throw(error); } @@ -1000,7 +1015,7 @@ public static string EvtRenderBookmark(EventLogHandle eventHandle) int error = Marshal.GetLastWin32Error(); if (!status) { - if (error != UnsafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) + if (error != Interop.Errors.ERROR_INSUFFICIENT_BUFFER) EventLogException.Throw(error); } @@ -1031,8 +1046,7 @@ public static string EvtFormatMessageFormatDescription(EventLogHandle handle, Ev stringVariants[i].StringVal = values[i]; } - StringBuilder sb = new StringBuilder(null); - bool status = UnsafeNativeMethods.EvtFormatMessage(handle, eventHandle, 0xffffffff, values.Length, stringVariants, UnsafeNativeMethods.EvtFormatMessageFlags.EvtFormatMessageEvent, 0, sb, out bufferNeeded); + bool status = UnsafeNativeMethods.EvtFormatMessage(handle, eventHandle, 0xffffffff, values.Length, stringVariants, UnsafeNativeMethods.EvtFormatMessageFlags.EvtFormatMessageEvent, 0, null, out bufferNeeded); int error = Marshal.GetLastWin32Error(); if (!status && error != UnsafeNativeMethods.ERROR_EVT_UNRESOLVED_VALUE_INSERT @@ -1048,12 +1062,12 @@ public static string EvtFormatMessageFormatDescription(EventLogHandle handle, Ev { return null; } - if (error != UnsafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) + if (error != Interop.Errors.ERROR_INSUFFICIENT_BUFFER) EventLogException.Throw(error); } - sb.EnsureCapacity(bufferNeeded); - status = UnsafeNativeMethods.EvtFormatMessage(handle, eventHandle, 0xffffffff, values.Length, stringVariants, UnsafeNativeMethods.EvtFormatMessageFlags.EvtFormatMessageEvent, bufferNeeded, sb, out bufferNeeded); + char[] buffer = new char[bufferNeeded]; + status = UnsafeNativeMethods.EvtFormatMessage(handle, eventHandle, 0xffffffff, values.Length, stringVariants, UnsafeNativeMethods.EvtFormatMessageFlags.EvtFormatMessageEvent, bufferNeeded, buffer, out bufferNeeded); error = Marshal.GetLastWin32Error(); if (!status && error != UnsafeNativeMethods.ERROR_EVT_UNRESOLVED_VALUE_INSERT @@ -1065,7 +1079,12 @@ public static string EvtFormatMessageFormatDescription(EventLogHandle handle, Ev } EventLogException.Throw(error); } - return sb.ToString(); + + int len = bufferNeeded - 1; // buffer includes null terminator + if (len <= 0) + return string.Empty; + + return new string(buffer, 0, len); } private static object ConvertToObject(UnsafeNativeMethods.EvtVariant val) @@ -1327,9 +1346,9 @@ private static bool IsNotFoundCase(int error) case UnsafeNativeMethods.ERROR_EVT_MESSAGE_NOT_FOUND: case UnsafeNativeMethods.ERROR_EVT_MESSAGE_ID_NOT_FOUND: case UnsafeNativeMethods.ERROR_EVT_MESSAGE_LOCALE_NOT_FOUND: - case UnsafeNativeMethods.ERROR_RESOURCE_LANG_NOT_FOUND: + case Interop.Errors.ERROR_RESOURCE_LANG_NOT_FOUND: case UnsafeNativeMethods.ERROR_MUI_FILE_NOT_FOUND: - case UnsafeNativeMethods.ERROR_RESOURCE_TYPE_NOT_FOUND: + case Interop.Errors.ERROR_RESOURCE_TYPE_NOT_FOUND: return true; } return false; diff --git a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/UnsafeNativeMethods.cs b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/UnsafeNativeMethods.cs index 9dff026f9ab6d7..1011901493d917 100644 --- a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/UnsafeNativeMethods.cs +++ b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/UnsafeNativeMethods.cs @@ -3,71 +3,15 @@ using Microsoft.Win32.SafeHandles; using System; -using System.Configuration.Assemblies; -using System.Diagnostics.Eventing; using System.Diagnostics.Eventing.Reader; -using System.Runtime.CompilerServices; -using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; -using System.Runtime.Serialization; -using System.Runtime.Versioning; using System.Security; -using System.Security.Principal; using System.Text; -using System.Threading; namespace Microsoft.Win32 { internal static partial class UnsafeNativeMethods { - internal const string WEVTAPI = "wevtapi.dll"; - - // WinError.h codes: - - internal const int ERROR_SUCCESS = 0x0; - internal const int ERROR_FILE_NOT_FOUND = 0x2; - internal const int ERROR_PATH_NOT_FOUND = 0x3; - internal const int ERROR_ACCESS_DENIED = 0x5; - internal const int ERROR_INVALID_HANDLE = 0x6; - - // Can occurs when filled buffers are trying to flush to disk, but disk IOs are not fast enough. - // This happens when the disk is slow and event traffic is heavy. - // Eventually, there are no more free (empty) buffers and the event is dropped. - internal const int ERROR_NOT_ENOUGH_MEMORY = 0x8; - - internal const int ERROR_INVALID_DRIVE = 0xF; - internal const int ERROR_NO_MORE_FILES = 0x12; - internal const int ERROR_NOT_READY = 0x15; - internal const int ERROR_BAD_LENGTH = 0x18; - internal const int ERROR_SHARING_VIOLATION = 0x20; - internal const int ERROR_LOCK_VIOLATION = 0x21; // 33 - internal const int ERROR_HANDLE_EOF = 0x26; // 38 - internal const int ERROR_FILE_EXISTS = 0x50; - internal const int ERROR_INVALID_PARAMETER = 0x57; // 87 - internal const int ERROR_BROKEN_PIPE = 0x6D; // 109 - internal const int ERROR_INSUFFICIENT_BUFFER = 0x7A; // 122 - internal const int ERROR_INVALID_NAME = 0x7B; - internal const int ERROR_BAD_PATHNAME = 0xA1; - internal const int ERROR_ALREADY_EXISTS = 0xB7; - internal const int ERROR_ENVVAR_NOT_FOUND = 0xCB; - internal const int ERROR_FILENAME_EXCED_RANGE = 0xCE; // filename too long - internal const int ERROR_PIPE_BUSY = 0xE7; // 231 - internal const int ERROR_NO_DATA = 0xE8; // 232 - internal const int ERROR_PIPE_NOT_CONNECTED = 0xE9; // 233 - internal const int ERROR_MORE_DATA = 0xEA; - internal const int ERROR_NO_MORE_ITEMS = 0x103; // 259 - internal const int ERROR_PIPE_CONNECTED = 0x217; // 535 - internal const int ERROR_PIPE_LISTENING = 0x218; // 536 - internal const int ERROR_OPERATION_ABORTED = 0x3E3; // 995; For IO Cancellation - internal const int ERROR_IO_PENDING = 0x3E5; // 997 - internal const int ERROR_NOT_FOUND = 0x490; // 1168 - - // The event size is larger than the allowed maximum (64k - header). - internal const int ERROR_ARITHMETIC_OVERFLOW = 0x216; // 534 - - internal const int ERROR_RESOURCE_TYPE_NOT_FOUND = 0x715; // 1813 - internal const int ERROR_RESOURCE_LANG_NOT_FOUND = 0x717; // 1815 - // Event log specific codes: internal const int ERROR_EVT_MESSAGE_NOT_FOUND = 15027; @@ -419,36 +363,35 @@ internal enum EvtSeekFlags EvtSeekStrict = 0x10000 } - [DllImport(WEVTAPI, CallingConvention = CallingConvention.Winapi, SetLastError = true)] - internal static extern EventLogHandle EvtQuery( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial EventLogHandle EvtQuery( EventLogHandle session, - [MarshalAs(UnmanagedType.LPWStr)]string path, - [MarshalAs(UnmanagedType.LPWStr)]string query, + [MarshalAs(UnmanagedType.LPWStr)] string path, + [MarshalAs(UnmanagedType.LPWStr)] string query, int flags); // SEEK - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern bool EvtSeek( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial bool EvtSeek( EventLogHandle resultSet, long position, EventLogHandle bookmark, int timeout, - [MarshalAs(UnmanagedType.I4)]EvtSeekFlags flags - ); + EvtSeekFlags flags); - [DllImport(WEVTAPI, CallingConvention = CallingConvention.Winapi, SetLastError = true)] - internal static extern EventLogHandle EvtSubscribe( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial EventLogHandle EvtSubscribe( EventLogHandle session, SafeWaitHandle signalEvent, - [MarshalAs(UnmanagedType.LPWStr)]string path, - [MarshalAs(UnmanagedType.LPWStr)]string query, + [MarshalAs(UnmanagedType.LPWStr)] string path, + [MarshalAs(UnmanagedType.LPWStr)] string query, EventLogHandle bookmark, IntPtr context, IntPtr callback, int flags); - [DllImport(WEVTAPI, CallingConvention = CallingConvention.Winapi, SetLastError = true)] - internal static extern bool EvtNext( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial bool EvtNext( EventLogHandle queryHandle, int eventSize, [MarshalAs(UnmanagedType.LPArray)] IntPtr[] events, @@ -456,238 +399,203 @@ internal static extern bool EvtNext( int flags, ref int returned); - [DllImport(WEVTAPI, CallingConvention = CallingConvention.Winapi, SetLastError = true)] - internal static extern bool EvtCancel(EventLogHandle handle); + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial bool EvtCancel(EventLogHandle handle); - [DllImport(WEVTAPI)] - internal static extern bool EvtClose(IntPtr handle); + [GeneratedDllImport(Interop.Libraries.Wevtapi)] + internal static partial bool EvtClose(IntPtr handle); - /* - [DllImport(WEVTAPI, EntryPoint = "EvtClose", SetLastError = true)] - public static extern bool EvtClose( - IntPtr eventHandle - ); - */ - - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern bool EvtGetEventInfo( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial bool EvtGetEventInfo( EventLogHandle eventHandle, - // int propertyId - [MarshalAs(UnmanagedType.I4)]EvtEventPropertyId propertyId, + EvtEventPropertyId propertyId, int bufferSize, IntPtr bufferPtr, - out int bufferUsed - ); + out int bufferUsed); - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern bool EvtGetQueryInfo( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial bool EvtGetQueryInfo( EventLogHandle queryHandle, - [MarshalAs(UnmanagedType.I4)]EvtQueryPropertyId propertyId, + EvtQueryPropertyId propertyId, int bufferSize, IntPtr buffer, - ref int bufferRequired - ); + ref int bufferRequired); // PUBLISHER METADATA - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern EventLogHandle EvtOpenPublisherMetadata( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial EventLogHandle EvtOpenPublisherMetadata( EventLogHandle session, [MarshalAs(UnmanagedType.LPWStr)] string publisherId, [MarshalAs(UnmanagedType.LPWStr)] string logFilePath, int locale, - int flags - ); + int flags); - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern bool EvtGetPublisherMetadataProperty( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial bool EvtGetPublisherMetadataProperty( EventLogHandle publisherMetadataHandle, - [MarshalAs(UnmanagedType.I4)] EvtPublisherMetadataPropertyId propertyId, + EvtPublisherMetadataPropertyId propertyId, int flags, int publisherMetadataPropertyBufferSize, IntPtr publisherMetadataPropertyBuffer, - out int publisherMetadataPropertyBufferUsed - ); + out int publisherMetadataPropertyBufferUsed); // NEW - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern bool EvtGetObjectArraySize( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial bool EvtGetObjectArraySize( EventLogHandle objectArray, - out int objectArraySize - ); + out int objectArraySize); - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern bool EvtGetObjectArrayProperty( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial bool EvtGetObjectArrayProperty( EventLogHandle objectArray, int propertyId, int arrayIndex, int flags, int propertyValueBufferSize, IntPtr propertyValueBuffer, - out int propertyValueBufferUsed - ); + out int propertyValueBufferUsed); // NEW 2 - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern EventLogHandle EvtOpenEventMetadataEnum( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial EventLogHandle EvtOpenEventMetadataEnum( EventLogHandle publisherMetadata, - int flags - ); + int flags); - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - // public static extern IntPtr EvtNextEventMetadata( - internal static extern EventLogHandle EvtNextEventMetadata( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial EventLogHandle EvtNextEventMetadata( EventLogHandle eventMetadataEnum, - int flags - ); + int flags); - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern bool EvtGetEventMetadataProperty( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial bool EvtGetEventMetadataProperty( EventLogHandle eventMetadata, - [MarshalAs(UnmanagedType.I4)] EvtEventMetadataPropertyId propertyId, + EvtEventMetadataPropertyId propertyId, int flags, int eventMetadataPropertyBufferSize, IntPtr eventMetadataPropertyBuffer, - out int eventMetadataPropertyBufferUsed - ); + out int eventMetadataPropertyBufferUsed); // Channel Configuration Native Api - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern EventLogHandle EvtOpenChannelEnum( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial EventLogHandle EvtOpenChannelEnum( EventLogHandle session, - int flags - ); + int flags); - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern bool EvtNextChannelPath( + [GeneratedDllImport(Interop.Libraries.Wevtapi, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial bool EvtNextChannelPath( EventLogHandle channelEnum, int channelPathBufferSize, - // StringBuilder channelPathBuffer, - [Out, MarshalAs(UnmanagedType.LPWStr)]StringBuilder channelPathBuffer, - out int channelPathBufferUsed - ); + [Out] char[]? channelPathBuffer, + out int channelPathBufferUsed); - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern EventLogHandle EvtOpenPublisherEnum( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial EventLogHandle EvtOpenPublisherEnum( EventLogHandle session, - int flags - ); + int flags); - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern bool EvtNextPublisherId( + [GeneratedDllImport(Interop.Libraries.Wevtapi, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial bool EvtNextPublisherId( EventLogHandle publisherEnum, int publisherIdBufferSize, - [Out, MarshalAs(UnmanagedType.LPWStr)]StringBuilder publisherIdBuffer, - out int publisherIdBufferUsed - ); + [Out] char[]? publisherIdBuffer, + out int publisherIdBufferUsed); - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern EventLogHandle EvtOpenChannelConfig( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial EventLogHandle EvtOpenChannelConfig( EventLogHandle session, - [MarshalAs(UnmanagedType.LPWStr)]string channelPath, - int flags - ); + [MarshalAs(UnmanagedType.LPWStr)] string channelPath, + int flags); - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern bool EvtSaveChannelConfig( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial bool EvtSaveChannelConfig( EventLogHandle channelConfig, - int flags - ); + int flags); - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern bool EvtSetChannelConfigProperty( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial bool EvtSetChannelConfigProperty( EventLogHandle channelConfig, - [MarshalAs(UnmanagedType.I4)]EvtChannelConfigPropertyId propertyId, + EvtChannelConfigPropertyId propertyId, int flags, - ref EvtVariant propertyValue - ); + ref EvtVariant propertyValue); - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern bool EvtGetChannelConfigProperty( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial bool EvtGetChannelConfigProperty( EventLogHandle channelConfig, - [MarshalAs(UnmanagedType.I4)]EvtChannelConfigPropertyId propertyId, + EvtChannelConfigPropertyId propertyId, int flags, int propertyValueBufferSize, IntPtr propertyValueBuffer, - out int propertyValueBufferUsed - ); + out int propertyValueBufferUsed); // Log Information Native Api - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern EventLogHandle EvtOpenLog( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial EventLogHandle EvtOpenLog( EventLogHandle session, [MarshalAs(UnmanagedType.LPWStr)] string path, - [MarshalAs(UnmanagedType.I4)]PathType flags - ); + PathType flags); - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern bool EvtGetLogInfo( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial bool EvtGetLogInfo( EventLogHandle log, - [MarshalAs(UnmanagedType.I4)]EvtLogPropertyId propertyId, + EvtLogPropertyId propertyId, int propertyValueBufferSize, IntPtr propertyValueBuffer, - out int propertyValueBufferUsed - ); + out int propertyValueBufferUsed); // LOG MANIPULATION - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern bool EvtExportLog( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial bool EvtExportLog( EventLogHandle session, - [MarshalAs(UnmanagedType.LPWStr)]string channelPath, - [MarshalAs(UnmanagedType.LPWStr)]string query, - [MarshalAs(UnmanagedType.LPWStr)]string targetFilePath, - int flags - ); + [MarshalAs(UnmanagedType.LPWStr)] string channelPath, + [MarshalAs(UnmanagedType.LPWStr)] string query, + [MarshalAs(UnmanagedType.LPWStr)] string targetFilePath, + int flags); - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern bool EvtArchiveExportedLog( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial bool EvtArchiveExportedLog( EventLogHandle session, [MarshalAs(UnmanagedType.LPWStr)]string logFilePath, int locale, - int flags - ); + int flags); - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern bool EvtClearLog( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial bool EvtClearLog( EventLogHandle session, [MarshalAs(UnmanagedType.LPWStr)]string channelPath, [MarshalAs(UnmanagedType.LPWStr)]string targetFilePath, - int flags - ); + int flags); // RENDERING - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern EventLogHandle EvtCreateRenderContext( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial EventLogHandle EvtCreateRenderContext( int valuePathsCount, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)] string[] valuePaths, - [MarshalAs(UnmanagedType.I4)]EvtRenderContextFlags flags - ); + EvtRenderContextFlags flags); - [DllImport(WEVTAPI, CallingConvention = CallingConvention.Winapi, SetLastError = true)] - internal static extern bool EvtRender( + [GeneratedDllImport(Interop.Libraries.Wevtapi, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] + internal static partial bool EvtRender( EventLogHandle context, EventLogHandle eventHandle, EvtRenderFlags flags, int buffSize, - [Out, MarshalAs(UnmanagedType.LPWStr)]StringBuilder buffer, + [Out] char[]? buffer, out int buffUsed, - out int propCount - ); + out int propCount); - [DllImport(WEVTAPI, EntryPoint = "EvtRender", CallingConvention = CallingConvention.Winapi, SetLastError = true)] - internal static extern bool EvtRender( + [GeneratedDllImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtRender", SetLastError = true)] + internal static partial bool EvtRender( EventLogHandle context, EventLogHandle eventHandle, EvtRenderFlags flags, int buffSize, IntPtr buffer, out int buffUsed, - out int propCount - ); + out int propCount); [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Auto)] internal struct EvtStringVariant @@ -700,52 +608,53 @@ internal struct EvtStringVariant public uint Type; }; - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we support non-blittable types. + [DllImport(Interop.Libraries.Wevtapi, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] internal static extern bool EvtFormatMessage( EventLogHandle publisherMetadataHandle, EventLogHandle eventHandle, uint messageId, int valueCount, EvtStringVariant[] values, - [MarshalAs(UnmanagedType.I4)]EvtFormatMessageFlags flags, + EvtFormatMessageFlags flags, int bufferSize, - [Out, MarshalAs(UnmanagedType.LPWStr)]StringBuilder buffer, - out int bufferUsed - ); + [Out] char[]? buffer, + out int bufferUsed); +#pragma warning restore DLLIMPORTGENANALYZER015 - [DllImport(WEVTAPI, EntryPoint = "EvtFormatMessage", CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern bool EvtFormatMessageBuffer( + [GeneratedDllImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtFormatMessage", SetLastError = true)] + internal static partial bool EvtFormatMessageBuffer( EventLogHandle publisherMetadataHandle, EventLogHandle eventHandle, uint messageId, int valueCount, IntPtr values, - [MarshalAs(UnmanagedType.I4)]EvtFormatMessageFlags flags, + EvtFormatMessageFlags flags, int bufferSize, IntPtr buffer, - out int bufferUsed - ); + out int bufferUsed); // SESSION - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] +#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time + // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we support non-blittable types. + [DllImport(Interop.Libraries.Wevtapi, SetLastError = true)] internal static extern EventLogHandle EvtOpenSession( - [MarshalAs(UnmanagedType.I4)]EvtLoginClass loginClass, + EvtLoginClass loginClass, ref EvtRpcLogin login, int timeout, - int flags - ); + int flags); +#pragma warning restore DLLIMPORTGENANALYZER015 // BOOKMARK - [DllImport(WEVTAPI, EntryPoint = "EvtCreateBookmark", CharSet = CharSet.Auto, SetLastError = true)] - internal static extern EventLogHandle EvtCreateBookmark( - [MarshalAs(UnmanagedType.LPWStr)] string bookmarkXml - ); + [GeneratedDllImport(Interop.Libraries.Wevtapi, EntryPoint = "EvtCreateBookmark", SetLastError = true)] + internal static partial EventLogHandle EvtCreateBookmark( + [MarshalAs(UnmanagedType.LPWStr)] string bookmarkXml); - [DllImport(WEVTAPI, CharSet = CharSet.Auto, SetLastError = true)] - internal static extern bool EvtUpdateBookmark( + [GeneratedDllImport(Interop.Libraries.Wevtapi, SetLastError = true)] + internal static partial bool EvtUpdateBookmark( EventLogHandle bookmark, - EventLogHandle eventHandle - ); + EventLogHandle eventHandle); // // EventLog // diff --git a/src/libraries/System.Diagnostics.EventLog/tests/System.Diagnostics.EventLog.Tests.csproj b/src/libraries/System.Diagnostics.EventLog/tests/System.Diagnostics.EventLog.Tests.csproj index a1bc84d9c3958a..a03f4dea580489 100644 --- a/src/libraries/System.Diagnostics.EventLog/tests/System.Diagnostics.EventLog.Tests.csproj +++ b/src/libraries/System.Diagnostics.EventLog/tests/System.Diagnostics.EventLog.Tests.csproj @@ -2,6 +2,7 @@ $(NetCoreAppCurrent)-windows;$(NetFrameworkMinimum) true + true diff --git a/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/System.Diagnostics.FileVersionInfo.Tests.csproj b/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/System.Diagnostics.FileVersionInfo.Tests.csproj index ad027e8be25474..9b99ef0ab81242 100644 --- a/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/System.Diagnostics.FileVersionInfo.Tests.csproj +++ b/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/System.Diagnostics.FileVersionInfo.Tests.csproj @@ -3,6 +3,7 @@ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser true true + true @@ -41,4 +42,4 @@ - \ No newline at end of file + 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 dfb057725b8020..28133feec83ed6 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj +++ b/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj @@ -3,6 +3,7 @@ true $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) $(NoWarn);CA1847 + annotations true Provides the System.Diagnostics.PerformanceCounter class, which allows access to Windows performance counters. @@ -144,6 +145,7 @@ System.Diagnostics.PerformanceCounter + 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 4c98a461f323e7..53a49f897c1a2e 100644 --- a/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs +++ b/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs @@ -84,7 +84,11 @@ public Process() { } public System.DateTime StartTime { get { throw null; } } public System.ComponentModel.ISynchronizeInvoke? SynchronizingObject { get { throw null; } set { } } public System.Diagnostics.ProcessThreadCollection Threads { get { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public System.TimeSpan TotalProcessorTime { get { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public System.TimeSpan UserProcessorTime { get { throw null; } } [System.ObsoleteAttribute("Process.VirtualMemorySize has been deprecated because the type of the property can't represent all valid results. Use System.Diagnostics.Process.VirtualMemorySize64 instead.")] public int VirtualMemorySize { get { throw null; } } @@ -106,9 +110,17 @@ public static void EnterDebugMode() { } public static System.Diagnostics.Process GetCurrentProcess() { throw null; } public static System.Diagnostics.Process GetProcessById(int processId) { throw null; } public static System.Diagnostics.Process GetProcessById(int processId, string machineName) { throw null; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public static System.Diagnostics.Process[] GetProcesses() { throw null; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public static System.Diagnostics.Process[] GetProcesses(string machineName) { throw null; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public static System.Diagnostics.Process[] GetProcessesByName(string? processName) { throw null; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public static System.Diagnostics.Process[] GetProcessesByName(string? processName, string machineName) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] @@ -233,6 +245,8 @@ internal ProcessThread() { } public int IdealProcessor { set { } } public bool PriorityBoostEnabled { get { throw null; } set { } } public System.Diagnostics.ThreadPriorityLevel PriorityLevel { [System.Runtime.Versioning.SupportedOSPlatform("windows")] [System.Runtime.Versioning.SupportedOSPlatform("linux")] [System.Runtime.Versioning.SupportedOSPlatform("freebsd")] get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public System.TimeSpan PrivilegedProcessorTime { get { throw null; } } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public System.IntPtr ProcessorAffinity { set { } } @@ -241,7 +255,11 @@ public System.IntPtr ProcessorAffinity { set { } } [System.Runtime.Versioning.SupportedOSPlatform("linux")] public System.DateTime StartTime { get { throw null; } } public System.Diagnostics.ThreadState ThreadState { get { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public System.TimeSpan TotalProcessorTime { get { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public System.TimeSpan UserProcessorTime { get { throw null; } } public System.Diagnostics.ThreadWaitReason WaitReason { get { throw null; } } public void ResetIdealProcessor() { } 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 b054e6f644913d..41548252d1f5e5 100644 --- a/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj +++ b/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj @@ -5,7 +5,6 @@ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent);$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS enable - $(NoWarn);0649 SR.Process_PlatformNotSupported @@ -251,8 +250,6 @@ Link="Common\Interop\Unix\Interop.GetSetPriority.cs" /> - - - + - + @@ -329,7 +324,7 @@ - + @@ -345,6 +340,11 @@ + + + + + diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.BSD.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.BSD.cs index 02b7cce02263d6..3380481ca5c8e3 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.BSD.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.BSD.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.ComponentModel; +using System.Runtime.Versioning; namespace System.Diagnostics { @@ -12,6 +13,8 @@ public partial class Process /// Creates an array of components that are associated with process resources on a /// remote computer. These process resources share the specified process name. /// + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("tvos")] public static Process[] GetProcessesByName(string? processName, string machineName) { if (processName == null) 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 6942d82d6d1595..016327ad61ab57 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 @@ -7,6 +7,7 @@ using System.ComponentModel; using System.Globalization; using System.IO; +using System.Runtime.Versioning; using System.Text; namespace System.Diagnostics @@ -17,6 +18,8 @@ public partial class Process : IDisposable /// Creates an array of components that are associated with process resources on a /// remote computer. These process resources share the specified process name. /// + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("tvos")] public static Process[] GetProcessesByName(string? processName, string machineName) { ProcessManager.ThrowIfRemoteMachine(machineName); diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs index 69b4481ae2087b..f869eb7aa4b2c0 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs @@ -17,9 +17,6 @@ namespace System.Diagnostics public partial class Process : IDisposable { private static volatile bool s_initialized; - private static uint s_euid; - private static uint s_egid; - private static uint[]? s_groups; private static readonly object s_initializedGate = new object(); private static readonly ReaderWriterLockSlim s_processStartLock = new ReaderWriterLockSlim(); @@ -769,29 +766,48 @@ private static bool IsExecutable(string fullPath) return false; } - Interop.Sys.Permissions permissions = (Interop.Sys.Permissions)fileinfo.Mode; + Interop.Sys.Permissions permissions = ((Interop.Sys.Permissions)fileinfo.Mode) & Interop.Sys.Permissions.S_IXUGO; - if (s_euid == 0) + // Avoid checking user/group when permission. + if (permissions == Interop.Sys.Permissions.S_IXUGO) { - // We're root. - return (permissions & Interop.Sys.Permissions.S_IXUGO) != 0; + return true; } + else if (permissions == 0) + { + return false; + } + + uint euid = Interop.Sys.GetEUid(); - if (s_euid == fileinfo.Uid) + if (euid == 0) + { + return true; // We're root. + } + + if (euid == fileinfo.Uid) { // We own the file. return (permissions & Interop.Sys.Permissions.S_IXUSR) != 0; } - if (s_egid == fileinfo.Gid || - (s_groups != null && Array.BinarySearch(s_groups, fileinfo.Gid) >= 0)) + bool groupCanExecute = (permissions & Interop.Sys.Permissions.S_IXGRP) != 0; + bool otherCanExecute = (permissions & Interop.Sys.Permissions.S_IXOTH) != 0; + + // Avoid group check when group and other have same permissions. + if (groupCanExecute == otherCanExecute) { - // A group we're a member of owns the file. - return (permissions & Interop.Sys.Permissions.S_IXGRP) != 0; + return groupCanExecute; } - // Other. - return (permissions & Interop.Sys.Permissions.S_IXOTH) != 0; + if (Interop.Sys.IsMemberOfGroup(fileinfo.Gid)) + { + return groupCanExecute; + } + else + { + return otherCanExecute; + } } private static long s_ticksPerSecond; @@ -1063,14 +1079,6 @@ private static unsafe void EnsureInitialized() throw new Win32Exception(); } - s_euid = Interop.Sys.GetEUid(); - s_egid = Interop.Sys.GetEGid(); - s_groups = Interop.Sys.GetGroups(); - if (s_groups != null) - { - Array.Sort(s_groups); - } - // Register our callback. Interop.Sys.RegisterForSigChld(&OnSigChild); SetDelayedSigChildConsoleConfigurationHandler(); diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.UnknownUnix.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.UnknownUnix.cs index 46c652a7fb6a69..897fde77e9a75d 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.UnknownUnix.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.UnknownUnix.cs @@ -9,7 +9,7 @@ public partial class Process : IDisposable /// Creates an array of components that are associated with process resources on a /// remote computer. These process resources share the specified process name. /// - public static Process[] GetProcessesByName(string processName, string machineName) + public static Process[] GetProcessesByName(string? processName, string machineName) { throw new PlatformNotSupportedException(); } @@ -82,5 +82,6 @@ private string GetPathToOpenFile() throw new PlatformNotSupportedException(); } + private int ParentProcessId => throw new PlatformNotSupportedException(); } } 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 9c59f54333bf64..ad7209a3f198d2 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 @@ -21,6 +21,8 @@ public partial class Process : IDisposable /// Creates an array of components that are associated with process resources on a /// remote computer. These process resources share the specified process name. /// + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("tvos")] public static Process[] GetProcessesByName(string? processName, string machineName) { if (processName == null) 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 cb08b93c0d3e23..dab24936576a4b 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs @@ -193,6 +193,8 @@ public bool HasExited } /// Gets the time the associated process was started. + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("tvos")] public DateTime StartTime { get @@ -1039,6 +1041,8 @@ public static Process GetProcessById(int processId) /// local computer. These process resources share the specified process name. /// /// + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("tvos")] public static Process[] GetProcessesByName(string? processName) { return GetProcessesByName(processName, "."); @@ -1050,6 +1054,8 @@ public static Process[] GetProcessesByName(string? processName) /// component for each process resource on the local computer. /// /// + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("tvos")] public static Process[] GetProcesses() { return GetProcesses("."); @@ -1062,6 +1068,8 @@ public static Process[] GetProcesses() /// process resource on the specified computer. /// /// + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("tvos")] public static Process[] GetProcesses(string machineName) { bool isRemoteMachine = ProcessManager.IsRemoteMachine(machineName); diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.iOS.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.iOS.cs new file mode 100644 index 00000000000000..e3fa89f34ccd1c --- /dev/null +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.iOS.cs @@ -0,0 +1,122 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using System.ComponentModel; +using System.Runtime.Versioning; + +namespace System.Diagnostics +{ + public partial class Process : IDisposable + { + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("tvos")] + public void Kill(bool entireProcessTree) + { + throw new PlatformNotSupportedException(); + } + + /// + /// Creates an array of components that are associated with process resources on a + /// remote computer. These process resources share the specified process name. + /// + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("tvos")] + public static Process[] GetProcessesByName(string? processName, string machineName) + { + throw new PlatformNotSupportedException(); + } + + /// Gets the amount of time the process has spent running code inside the operating system core. + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("tvos")] + public TimeSpan PrivilegedProcessorTime + { + get { throw new PlatformNotSupportedException(); } + } + + /// Gets the time the associated process was started. + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("tvos")] + internal DateTime StartTimeCore + { + get { throw new PlatformNotSupportedException(); } + } + + /// + /// Gets the amount of time the associated process has spent utilizing the CPU. + /// It is the sum of the and + /// . + /// + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("tvos")] + public TimeSpan TotalProcessorTime + { + get { throw new PlatformNotSupportedException(); } + } + + /// + /// Gets the amount of time the associated process has spent running code + /// inside the application portion of the process (not the operating system core). + /// + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("tvos")] + public TimeSpan UserProcessorTime + { + get { throw new PlatformNotSupportedException(); } + } + + /// + /// Returns all immediate child processes. + /// + private IReadOnlyList GetChildProcesses(Process[]? processes = null) + { + throw new PlatformNotSupportedException(); + } + + /// Gets parent process ID + private int GetParentProcessId => + throw new PlatformNotSupportedException(); + + /// + /// Gets or sets which processors the threads in this process can be scheduled to run on. + /// + private IntPtr ProcessorAffinityCore + { + get { throw new PlatformNotSupportedException(); } + set { throw new PlatformNotSupportedException(); } + } + + /// + /// Make sure we have obtained the min and max working set limits. + /// + private void GetWorkingSetLimits(out IntPtr minWorkingSet, out IntPtr maxWorkingSet) + { + throw new PlatformNotSupportedException(); + } + + /// Sets one or both of the minimum and maximum working set limits. + /// The new minimum working set limit, or null not to change it. + /// The new maximum working set limit, or null not to change it. + /// The resulting minimum working set limit after any changes applied. + /// The resulting maximum working set limit after any changes applied. + private void SetWorkingSetLimitsCore(IntPtr? newMin, IntPtr? newMax, out IntPtr resultingMin, out IntPtr resultingMax) + { + throw new PlatformNotSupportedException(); + } + + /// Gets execution path + private string GetPathToOpenFile() + { + throw new PlatformNotSupportedException(); + } + + private int ParentProcessId => throw new PlatformNotSupportedException(); + + private static bool IsProcessInvalidException(Exception e) => + // InvalidOperationException signifies conditions such as the process already being dead. + // Win32Exception signifies issues such as insufficient permissions to get details on the process. + // In either case, the predicate couldn't be applied so return the fallback result. + e is InvalidOperationException || e is Win32Exception; + } +} diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Unix.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Unix.cs index 5df7ece329e1d3..d9e27a8c542769 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Unix.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Unix.cs @@ -3,6 +3,7 @@ using Microsoft.Win32.SafeHandles; using System.Collections.Generic; +using System.Runtime.Versioning; using System.Text; namespace System.Diagnostics @@ -44,6 +45,8 @@ public static bool IsProcessRunning(int processId) /// Gets the IDs of all processes on the specified machine. /// The machine to examine. /// An array of process IDs from the specified machine. + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("tvos")] public static int[] GetProcessIds(string machineName) { ThrowIfRemoteMachine(machineName); diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.iOS.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.iOS.cs new file mode 100644 index 00000000000000..2fddb3b200e7e3 --- /dev/null +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.iOS.cs @@ -0,0 +1,39 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.Versioning; + +namespace System.Diagnostics +{ + internal static partial class ProcessManager + { + /// Gets the IDs of all processes on the current machine. + public static int[] GetProcessIds() + { + throw new PlatformNotSupportedException(); + } + + /// Gets process infos for each process on the specified machine. + /// The target machine. + /// An array of process infos, one per found process. + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("tvos")] + public static ProcessInfo[] GetProcessInfos(string machineName) + { + throw new PlatformNotSupportedException(); + } + + /// Gets an array of module infos for the specified process. + /// The ID of the process whose modules should be enumerated. + /// The array of modules. + internal static ProcessModuleCollection GetModules(int processId) + { + return new ProcessModuleCollection(0); + } + + private static ProcessInfo CreateProcessInfo(int pid) + { + throw new PlatformNotSupportedException(); + } + } +} diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.iOS.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.iOS.cs new file mode 100644 index 00000000000000..8faa430900aabf --- /dev/null +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessThread.iOS.cs @@ -0,0 +1,56 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.Versioning; + +namespace System.Diagnostics +{ + public partial class ProcessThread + { + /// + /// Returns or sets the priority level of the associated thread. The priority level is + /// not an absolute level, but instead contributes to the actual thread priority by + /// considering the priority class of the process. + /// + private ThreadPriorityLevel PriorityLevelCore + { + get { throw new PlatformNotSupportedException(); } + set { throw new PlatformNotSupportedException(); } + } + + /// + /// Returns the amount of time the thread has spent running code inside the operating + /// system core. + /// + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("tvos")] + public TimeSpan PrivilegedProcessorTime + { + get { throw new PlatformNotSupportedException(); } + } + + private DateTime GetStartTime() => throw new PlatformNotSupportedException(); + /// + /// Returns the amount of time the associated thread has spent utilizing the CPU. + /// It is the sum of the System.Diagnostics.ProcessThread.UserProcessorTime and + /// System.Diagnostics.ProcessThread.PrivilegedProcessorTime. + /// + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("tvos")] + public TimeSpan TotalProcessorTime + { + get { throw new PlatformNotSupportedException(); } + } + + /// + /// Returns the amount of time the associated thread has spent running code + /// inside the application (not the operating system core). + /// + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("tvos")] + public TimeSpan UserProcessorTime + { + get { throw new PlatformNotSupportedException(); } + } + } +} diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ThreadInfo.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ThreadInfo.cs index c12c143e5a53a1..1205e732e67328 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ThreadInfo.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ThreadInfo.cs @@ -12,6 +12,7 @@ namespace System.Diagnostics /// internal sealed class ThreadInfo { +#pragma warning disable CS0649 // The fields are unused on iOS/tvOS as the respective managed logic (mostly around libproc) is excluded. internal ulong _threadId; internal int _processId; internal int _basePriority; @@ -19,5 +20,6 @@ internal sealed class ThreadInfo internal IntPtr _startAddress; internal ThreadState _threadState; internal ThreadWaitReason _threadWaitReason; +#pragma warning restore CS0649 } } diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessModuleTests.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessModuleTests.cs index 33f84717da7198..fd4e9d2751753f 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessModuleTests.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessModuleTests.cs @@ -10,6 +10,7 @@ namespace System.Diagnostics.Tests public partial class ProcessModuleTests : ProcessTestBase { [Fact] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "libproc is not supported on iOS/tvOS")] public void TestModuleProperties() { ProcessModuleCollection modules = Process.GetCurrentProcess().Modules; @@ -29,6 +30,7 @@ public void TestModuleProperties() } [Fact] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "libproc is not supported on iOS/tvOS")] public void Modules_Get_ContainsHostFileName() { ProcessModuleCollection modules = Process.GetCurrentProcess().Modules; diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs index 8845803d080860..b3086da60d7572 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs @@ -414,6 +414,7 @@ public void TestExitTime() } [Fact] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "libproc is not supported on iOS/tvOS")] public void StartTime_GetNotStarted_ThrowsInvalidOperationException() { var process = new Process(); @@ -525,6 +526,7 @@ public void MachineName_GetNotStarted_ThrowsInvalidOperationException() } [Fact] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "libproc is not supported on iOS/tvOS")] public void TestMainModule() { Process p = Process.GetCurrentProcess(); @@ -854,6 +856,7 @@ public void TotalProcessorTime_PerformLoop_TotalProcessorTimeValid() } [Fact] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "libproc is not supported on iOS/tvOS")] public void UserProcessorTime_GetNotStarted_ThrowsInvalidOperationException() { var process = new Process(); @@ -861,6 +864,7 @@ public void UserProcessorTime_GetNotStarted_ThrowsInvalidOperationException() } [Fact] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "libproc is not supported on iOS/tvOS")] public void PriviledgedProcessorTime_GetNotStarted_ThrowsInvalidOperationException() { var process = new Process(); @@ -868,6 +872,7 @@ public void PriviledgedProcessorTime_GetNotStarted_ThrowsInvalidOperationExcepti } [Fact] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "libproc is not supported on iOS/tvOS")] public void TotalProcessorTime_GetNotStarted_ThrowsInvalidOperationException() { var process = new Process(); @@ -1105,7 +1110,7 @@ public void TestGetProcessById() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/60588", TestPlatforms.iOS | TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "libproc is not supported on iOS/tvOS")] public void TestGetProcesses() { Process currentProcess = Process.GetCurrentProcess(); @@ -1171,7 +1176,7 @@ public void GetProcesses_RemoteMachinePath_ReturnsExpected() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/60588", TestPlatforms.iOS | TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "libproc is not supported on iOS/tvOS")] public void GetProcessesByName_ProcessName_ReturnsExpected() { // Get the current process using its name @@ -1231,7 +1236,7 @@ public static IEnumerable MachineName_Remote_TestData() [Theory] [MemberData(nameof(MachineName_TestData))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/60588", TestPlatforms.iOS | TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "libproc is not supported on iOS/tvOS")] public void GetProcessesByName_ProcessNameMachineName_ReturnsExpected(string machineName) { Process currentProcess = Process.GetCurrentProcess(); @@ -1258,7 +1263,7 @@ public void GetProcessesByName_RemoteMachineNameWindows_ReturnsExpected(string m } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/60588", TestPlatforms.iOS | TestPlatforms.tvOS)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "libproc is not supported on iOS/tvOS")] public void GetProcessesByName_NoSuchProcess_ReturnsEmpty() { string processName = Guid.NewGuid().ToString("N"); @@ -1266,6 +1271,7 @@ public void GetProcessesByName_NoSuchProcess_ReturnsEmpty() } [Fact] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "libproc is not supported on iOS/tvOS")] public void GetProcessesByName_NullMachineName_ThrowsArgumentNullException() { Process currentProcess = Process.GetCurrentProcess(); @@ -1273,6 +1279,7 @@ public void GetProcessesByName_NullMachineName_ThrowsArgumentNullException() } [Fact] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "libproc is not supported on iOS/tvOS")] public void GetProcessesByName_EmptyMachineName_ThrowsArgumentException() { Process currentProcess = Process.GetCurrentProcess(); @@ -1335,6 +1342,7 @@ public void StartInfo_SetOnRunningProcess_ThrowsInvalidOperationException() } [Fact] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "libproc is not supported on iOS/tvOS")] public void StartInfo_SetGet_ReturnsExpected() { var process = new Process() { StartInfo = new ProcessStartInfo(RemoteExecutor.HostRunner) }; @@ -1719,6 +1727,7 @@ public void MainWindowTitle_GetWithGui_ShouldRefresh_Windows() } [Fact] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "libproc is not supported on iOS/tvOS")] public void RefreshResetsAllRefreshableFields() { // testing Process.Responding using a real unresponsive process would be very hard to do properly @@ -2287,6 +2296,7 @@ public void BothArgumentSetAndArgumentListSet() } [Fact] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "libproc is not supported on iOS/tvOS")] public void Kill_EntireProcessTree_True_ProcessNotStarted_ThrowsInvalidOperationException() { var process = new Process(); @@ -2316,6 +2326,7 @@ public void Kill_EntireProcessTree_True_CalledByNonLocalProcess_ThrowsInvalidOpe } [Fact] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "libproc is not supported on iOS/tvOS")] public void Kill_EntireProcessTree_True_CalledOnCallingProcess_ThrowsInvalidOperationException() { var process = Process.GetCurrentProcess(); diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.cs index 2266582ac5190f..6db4fd1a2cdeea 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.cs @@ -46,6 +46,7 @@ public void TestCommonPriorityAndTimeProperties() } [Fact] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "libproc is not supported on iOS/tvOS")] public void TestThreadCount() { int numOfThreads = 10; @@ -161,6 +162,7 @@ await Task.Factory.StartNew(() => } [Fact] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "libproc is not supported on iOS/tvOS")] public void TestStartAddressProperty() { using (Process p = Process.GetCurrentProcess()) diff --git a/src/libraries/System.Diagnostics.Process/tests/System.Diagnostics.Process.Tests.csproj b/src/libraries/System.Diagnostics.Process/tests/System.Diagnostics.Process.Tests.csproj index bfcfb2cc3b71ca..783e4ad21e9c70 100644 --- a/src/libraries/System.Diagnostics.Process/tests/System.Diagnostics.Process.Tests.csproj +++ b/src/libraries/System.Diagnostics.Process/tests/System.Diagnostics.Process.Tests.csproj @@ -5,6 +5,7 @@ true $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser true + true + true true $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum);netstandard2.0 $(NoWarn);CA2249 + + $(NoWarn);CA1845;CA1846 + annotations true true true @@ -86,10 +91,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -102,10 +199,12 @@ + + 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 4fdd2e20da9273..a7e18fa436016b 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 @@ -1570,7 +1570,7 @@ private string GetGroupDnFromGroupID(byte[] userSid, int primaryGroupId) sddlSid = sddlSid.Substring(0, index) + "-" + ((uint)primaryGroupId).ToString(CultureInfo.InvariantCulture); // Now, we convert the SDDL back into a SID - if (UnsafeNativeMethods.ConvertStringSidToSid(sddlSid, ref pGroupSid)) + if (Interop.Advapi32.ConvertStringSidToSid(sddlSid, out pGroupSid) != Interop.BOOL.FALSE) { // Now we convert the native SID to a byte[] SID groupSid = Utils.ConvertNativeSidToByteArray(pGroupSid); @@ -1581,7 +1581,7 @@ private string GetGroupDnFromGroupID(byte[] userSid, int primaryGroupId) finally { if (pGroupSid != IntPtr.Zero) - UnsafeNativeMethods.LocalFree(pGroupSid); + Interop.Kernel32.LocalFree(pGroupSid); } if (groupSid != null) 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 371f8857d27fac..709ccb1601f734 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 @@ -528,7 +528,7 @@ private Principal FindPrincipalByIdentRefHelper( { pSid = Utils.ConvertByteArrayToIntPtr(sidb); - if (UnsafeNativeMethods.IsValidSid(pSid) && (Utils.ClassifySID(pSid) == SidType.FakeObject)) + if (Interop.Advapi32.IsValidSid(pSid) && (Utils.ClassifySID(pSid) == SidType.FakeObject)) { GlobalDebug.WriteLineIf(GlobalDebug.Info, "ADStoreCtx", @@ -583,7 +583,7 @@ private Principal FindPrincipalByIdentRefHelper( { pSid = Utils.ConvertByteArrayToIntPtr(sidb); - if (UnsafeNativeMethods.IsValidSid(pSid) && (Utils.ClassifySID(pSid) == SidType.FakeObject)) + if (Interop.Advapi32.IsValidSid(pSid) && (Utils.ClassifySID(pSid) == SidType.FakeObject)) { GlobalDebug.WriteLineIf(GlobalDebug.Info, "ADStoreCtx", 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 66e8d5238f27b8..fd46f4646e54d9 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 @@ -597,7 +597,7 @@ protected static bool SecurityIdentityClaimConverterHelper(string urnValue, bool try { - if (UnsafeNativeMethods.ConvertStringSidToSid(urnValue, ref pBytePtr)) + if (Interop.Advapi32.ConvertStringSidToSid(urnValue, out pBytePtr) != Interop.BOOL.FALSE) { // Now we convert the native SID to a byte[] SID sidB = Utils.ConvertNativeSidToByteArray(pBytePtr); @@ -620,7 +620,7 @@ protected static bool SecurityIdentityClaimConverterHelper(string urnValue, bool finally { if (IntPtr.Zero != pBytePtr) - UnsafeNativeMethods.LocalFree(pBytePtr); + Interop.Kernel32.LocalFree(pBytePtr); } StringBuilder stringizedBinarySid = new StringBuilder(); diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/SidList.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/SidList.cs index a06b3ac12c4896..7ecdd631117247 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/SidList.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/SidList.cs @@ -1,14 +1,11 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Diagnostics; using System.Collections.Generic; -using System.Globalization; using System.Runtime.InteropServices; -using System.DirectoryServices; -using System.Text; -using System.Net; + +using Microsoft.Win32.SafeHandles; namespace System.DirectoryServices.AccountManagement { @@ -50,7 +47,7 @@ internal SidList(List sidListByteFormat, string target, NetCred credenti } } - internal SidList(UnsafeNativeMethods.SID_AND_ATTR[] sidAndAttr) + internal SidList(Interop.SID_AND_ATTRIBUTES[] sidAndAttr) { GlobalDebug.WriteLineIf(GlobalDebug.Info, "SidList", "SidList: processing {0} Sid+Attr SIDs", sidAndAttr.Length); @@ -60,7 +57,7 @@ internal SidList(UnsafeNativeMethods.SID_AND_ATTR[] sidAndAttr) for (int i = 0; i < sidCount; i++) { - pSids[i] = sidAndAttr[i].pSid; + pSids[i] = sidAndAttr[i].Sid; } TranslateSids(null, pSids); @@ -80,141 +77,84 @@ private void TranslateSids(string target, IntPtr[] pSids) int sidCount = pSids.Length; // Translate the SIDs in bulk - IntPtr pOA = IntPtr.Zero; - IntPtr pPolicyHandle = IntPtr.Zero; - - IntPtr pDomains = IntPtr.Zero; - UnsafeNativeMethods.LSA_TRUST_INFORMATION[] domains; - - IntPtr pNames = IntPtr.Zero; - UnsafeNativeMethods.LSA_TRANSLATED_NAME[] names; - + SafeLsaPolicyHandle policyHandle = null; + SafeLsaMemoryHandle domainsHandle = null; + SafeLsaMemoryHandle namesHandle = null; try { // // Get the policy handle // - UnsafeNativeMethods.LSA_OBJECT_ATTRIBUTES oa = new UnsafeNativeMethods.LSA_OBJECT_ATTRIBUTES(); - - pOA = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(UnsafeNativeMethods.LSA_OBJECT_ATTRIBUTES))); - Marshal.StructureToPtr(oa, pOA, false); - - int err = 0; - if (target == null) - { - err = UnsafeNativeMethods.LsaOpenPolicy( - IntPtr.Zero, - pOA, - 0x800, // POLICY_LOOKUP_NAMES - ref pPolicyHandle); - } - else - { - // Build an entry. Note that LSA_UNICODE_STRING.length is in bytes, - // while PtrToStringUni expects a length in characters. - UnsafeNativeMethods.LSA_UNICODE_STRING_Managed lsaTargetString = new UnsafeNativeMethods.LSA_UNICODE_STRING_Managed(); - lsaTargetString.buffer = target; - lsaTargetString.length = (ushort)(target.Length * 2); - lsaTargetString.maximumLength = lsaTargetString.length; - - IntPtr lsaTargetPr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(UnsafeNativeMethods.LSA_UNICODE_STRING))); - - try - { - Marshal.StructureToPtr(lsaTargetString, lsaTargetPr, false); - - err = UnsafeNativeMethods.LsaOpenPolicy( - lsaTargetPr, - pOA, - 0x800, // POLICY_LOOKUP_NAMES - ref pPolicyHandle); - } - finally - { - if (lsaTargetPr != IntPtr.Zero) - { - UnsafeNativeMethods.LSA_UNICODE_STRING lsaTargetUnmanagedPtr = - (UnsafeNativeMethods.LSA_UNICODE_STRING)Marshal.PtrToStructure(lsaTargetPr, typeof(UnsafeNativeMethods.LSA_UNICODE_STRING)); - if (lsaTargetUnmanagedPtr.buffer != IntPtr.Zero) - { - Marshal.FreeHGlobal(lsaTargetUnmanagedPtr.buffer); - lsaTargetUnmanagedPtr.buffer = IntPtr.Zero; - } - Marshal.FreeHGlobal(lsaTargetPr); - } - } - } + Interop.OBJECT_ATTRIBUTES oa = default; + uint err = Interop.Advapi32.LsaOpenPolicy( + target, + ref oa, + (int)Interop.Advapi32.PolicyRights.POLICY_LOOKUP_NAMES, + out policyHandle); if (err != 0) { GlobalDebug.WriteLineIf(GlobalDebug.Warn, "AuthZSet", "SidList: couldn't get policy handle, err={0}", err); throw new PrincipalOperationException(SR.Format( SR.AuthZErrorEnumeratingGroups, - SafeNativeMethods.LsaNtStatusToWinError(err))); + Interop.Advapi32.LsaNtStatusToWinError(err))); } - Debug.Assert(pPolicyHandle != IntPtr.Zero); + Debug.Assert(!policyHandle.IsInvalid); // // Translate the SIDs // - err = UnsafeNativeMethods.LsaLookupSids( - pPolicyHandle, + err = Interop.Advapi32.LsaLookupSids( + policyHandle, sidCount, pSids, - out pDomains, - out pNames); - - // ignore error STATUS_SOME_NOT_MAPPED = 0x00000107 and - // STATUS_NONE_MAPPED = 0xC0000073 - if (err != 0 && - err != 263 && - err != -1073741709) + out domainsHandle, + out namesHandle); + + // Ignore error STATUS_SOME_NOT_MAPPED and STATUS_NONE_MAPPED + if (err != Interop.StatusOptions.STATUS_SUCCESS && + err != Interop.StatusOptions.STATUS_SOME_NOT_MAPPED && + err != Interop.StatusOptions.STATUS_NONE_MAPPED) { GlobalDebug.WriteLineIf(GlobalDebug.Warn, "AuthZSet", "SidList: LsaLookupSids failed, err={0}", err); throw new PrincipalOperationException(SR.Format( SR.AuthZErrorEnumeratingGroups, - SafeNativeMethods.LsaNtStatusToWinError(err))); + Interop.Advapi32.LsaNtStatusToWinError(err))); } // // Get the group names in managed form // - names = new UnsafeNativeMethods.LSA_TRANSLATED_NAME[sidCount]; - IntPtr pCurrentName = pNames; - - for (int i = 0; i < sidCount; i++) - { - names[i] = (UnsafeNativeMethods.LSA_TRANSLATED_NAME) - Marshal.PtrToStructure(pCurrentName, typeof(UnsafeNativeMethods.LSA_TRANSLATED_NAME)); + namesHandle.Initialize((uint)sidCount, (uint)Marshal.SizeOf()); - pCurrentName = new IntPtr(pCurrentName.ToInt64() + Marshal.SizeOf(typeof(UnsafeNativeMethods.LSA_TRANSLATED_NAME))); - } + Interop.LSA_TRANSLATED_NAME[] names = new Interop.LSA_TRANSLATED_NAME[sidCount]; + namesHandle.ReadArray(0, names, 0, names.Length); // // Get the domain names in managed form // + domainsHandle.InitializeReferencedDomainsList(); + Interop.LSA_REFERENCED_DOMAIN_LIST domainList = domainsHandle.Read(0); // Extract LSA_REFERENCED_DOMAIN_LIST.Entries - UnsafeNativeMethods.LSA_REFERENCED_DOMAIN_LIST referencedDomains = (UnsafeNativeMethods.LSA_REFERENCED_DOMAIN_LIST)Marshal.PtrToStructure(pDomains, typeof(UnsafeNativeMethods.LSA_REFERENCED_DOMAIN_LIST)); - - int domainCount = referencedDomains.entries; + int domainCount = domainList.Entries; // Extract LSA_REFERENCED_DOMAIN_LIST.Domains, by iterating over the array and marshalling // each native LSA_TRUST_INFORMATION into a managed LSA_TRUST_INFORMATION. - domains = new UnsafeNativeMethods.LSA_TRUST_INFORMATION[domainCount]; + Interop.LSA_TRUST_INFORMATION[] domains = new Interop.LSA_TRUST_INFORMATION[domainCount]; - IntPtr pCurrentDomain = referencedDomains.domains; + IntPtr pCurrentDomain = domainList.Domains; for (int i = 0; i < domainCount; i++) { - domains[i] = (UnsafeNativeMethods.LSA_TRUST_INFORMATION)Marshal.PtrToStructure(pCurrentDomain, typeof(UnsafeNativeMethods.LSA_TRUST_INFORMATION)); - pCurrentDomain = new IntPtr(pCurrentDomain.ToInt64() + Marshal.SizeOf(typeof(UnsafeNativeMethods.LSA_TRUST_INFORMATION))); + domains[i] = (Interop.LSA_TRUST_INFORMATION)Marshal.PtrToStructure(pCurrentDomain, typeof(Interop.LSA_TRUST_INFORMATION)); + pCurrentDomain = new IntPtr(pCurrentDomain.ToInt64() + Marshal.SizeOf(typeof(Interop.LSA_TRUST_INFORMATION))); } GlobalDebug.WriteLineIf(GlobalDebug.Info, "AuthZSet", "SidList: got {0} groups in {1} domains", sidCount, domainCount); @@ -226,22 +166,22 @@ private void TranslateSids(string target, IntPtr[] pSids) for (int i = 0; i < names.Length; i++) { - UnsafeNativeMethods.LSA_TRANSLATED_NAME name = names[i]; + Interop.LSA_TRANSLATED_NAME name = names[i]; // Build an entry. Note that LSA_UNICODE_STRING.length is in bytes, // while PtrToStringUni expects a length in characters. SidListEntry entry = new SidListEntry(); - Debug.Assert(name.name.length % 2 == 0); - entry.name = Marshal.PtrToStringUni(name.name.buffer, name.name.length / 2); + Debug.Assert(name.Name.Length % 2 == 0); + entry.name = Marshal.PtrToStringUni(name.Name.Buffer, name.Name.Length / 2); // Get the domain associated with this name - Debug.Assert(name.domainIndex < domains.Length); - if (name.domainIndex >= 0) + Debug.Assert(name.DomainIndex < domains.Length); + if (name.DomainIndex >= 0) { - UnsafeNativeMethods.LSA_TRUST_INFORMATION domain = domains[name.domainIndex]; - Debug.Assert(domain.name.length % 2 == 0); - entry.sidIssuerName = Marshal.PtrToStringUni(domain.name.buffer, domain.name.length / 2); + Interop.LSA_TRUST_INFORMATION domain = domains[name.DomainIndex]; + Debug.Assert(domain.Name.Length % 2 == 0); + entry.sidIssuerName = Marshal.PtrToStringUni(domain.Name.Buffer, domain.Name.Length / 2); } entry.pSid = pSids[i]; @@ -254,17 +194,14 @@ private void TranslateSids(string target, IntPtr[] pSids) } finally { - if (pDomains != IntPtr.Zero) - UnsafeNativeMethods.LsaFreeMemory(pDomains); - - if (pNames != IntPtr.Zero) - UnsafeNativeMethods.LsaFreeMemory(pNames); + if (domainsHandle != null) + domainsHandle.Dispose(); - if (pPolicyHandle != IntPtr.Zero) - UnsafeNativeMethods.LsaClose(pPolicyHandle); + if (namesHandle != null) + namesHandle.Dispose(); - if (pOA != IntPtr.Zero) - Marshal.FreeHGlobal(pOA); + if (policyHandle != null) + policyHandle.Dispose(); } } diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AuthZSet.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AuthZSet.cs index 0da4b8b78c5427..b69798ae0b6d7e 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AuthZSet.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AuthZSet.cs @@ -15,7 +15,7 @@ namespace System.DirectoryServices.AccountManagement { internal sealed class AuthZSet : ResultSet { - internal AuthZSet( + internal unsafe AuthZSet( byte[] userSid, NetCred credentials, ContextOptions contextOptions, @@ -52,9 +52,7 @@ internal AuthZSet( try { - UnsafeNativeMethods.LUID luid = default; - luid.low = 0; - luid.high = 0; + Interop.LUID luid = default; _psMachineSid = new SafeMemoryPtr(Utils.GetMachineDomainSid()); _psUserSid = new SafeMemoryPtr(Utils.ConvertByteArrayToIntPtr(userSid)); @@ -65,8 +63,8 @@ internal AuthZSet( GlobalDebug.WriteLineIf(GlobalDebug.Info, "AuthZSet", "Initializing resource manager"); // Create a resource manager - f = UnsafeNativeMethods.AuthzInitializeResourceManager( - UnsafeNativeMethods.AUTHZ_RM_FLAG.AUTHZ_RM_FLAG_NO_AUDIT, + f = Interop.Authz.AuthzInitializeResourceManager( + Interop.Authz.AUTHZ_RM_FLAG_NO_AUDIT, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, @@ -79,7 +77,7 @@ out pResManager GlobalDebug.WriteLineIf(GlobalDebug.Info, "AuthZSet", "Getting ctx from SID"); // Construct a context for the user based on the user's SID - f = UnsafeNativeMethods.AuthzInitializeContextFromSid( + f = Interop.Authz.AuthzInitializeContextFromSid( 0, // default flags _psUserSid.DangerousGetHandle(), pResManager, @@ -96,7 +94,7 @@ out pClientContext GlobalDebug.WriteLineIf(GlobalDebug.Info, "AuthZSet", "Getting info from ctx"); // Extract the group SIDs from the user's context. Determine the size of the buffer we need. - f = UnsafeNativeMethods.AuthzGetInformationFromContext( + f = Interop.Authz.AuthzGetInformationFromContext( pClientContext, 2, // AuthzContextInfoGroupsSids 0, @@ -113,7 +111,7 @@ out pClientContext pBuffer = Marshal.AllocHGlobal(bufferSize); // Extract the group SIDs from the user's context, into our buffer.0 - f = UnsafeNativeMethods.AuthzGetInformationFromContext( + f = Interop.Authz.AuthzGetInformationFromContext( pClientContext, 2, // AuthzContextInfoGroupsSids bufferSize, @@ -134,23 +132,23 @@ out pClientContext // Extract TOKEN_GROUPS.GroupCount - UnsafeNativeMethods.TOKEN_GROUPS tokenGroups = (UnsafeNativeMethods.TOKEN_GROUPS)Marshal.PtrToStructure(pBuffer, typeof(UnsafeNativeMethods.TOKEN_GROUPS)); + Interop.TOKEN_GROUPS tokenGroups = (Interop.TOKEN_GROUPS)Marshal.PtrToStructure(pBuffer, typeof(Interop.TOKEN_GROUPS)); - int groupCount = tokenGroups.groupCount; + uint groupCount = tokenGroups.GroupCount; GlobalDebug.WriteLineIf(GlobalDebug.Info, "AuthZSet", "Found {0} groups", groupCount); // Extract TOKEN_GROUPS.Groups, by iterating over the array and marshalling // each native SID_AND_ATTRIBUTES into a managed SID_AND_ATTR. - UnsafeNativeMethods.SID_AND_ATTR[] groups = new UnsafeNativeMethods.SID_AND_ATTR[groupCount]; + Interop.SID_AND_ATTRIBUTES[] groups = new Interop.SID_AND_ATTRIBUTES[groupCount]; - IntPtr currentItem = new IntPtr(pBuffer.ToInt64() + Marshal.SizeOf(typeof(UnsafeNativeMethods.TOKEN_GROUPS)) - IntPtr.Size); + IntPtr currentItem = new IntPtr(pBuffer.ToInt64() + Marshal.SizeOf(typeof(Interop.TOKEN_GROUPS)) - sizeof(Interop.SID_AND_ATTRIBUTES)); for (int i = 0; i < groupCount; i++) { - groups[i] = (UnsafeNativeMethods.SID_AND_ATTR)Marshal.PtrToStructure(currentItem, typeof(UnsafeNativeMethods.SID_AND_ATTR)); + groups[i] = (Interop.SID_AND_ATTRIBUTES)Marshal.PtrToStructure(currentItem, typeof(Interop.SID_AND_ATTRIBUTES)); - currentItem = new IntPtr(currentItem.ToInt64() + Marshal.SizeOf(typeof(UnsafeNativeMethods.SID_AND_ATTR))); + currentItem = new IntPtr(currentItem.ToInt64() + Marshal.SizeOf(typeof(Interop.SID_AND_ATTRIBUTES))); } _groupSidList = new SidList(groups); @@ -215,10 +213,10 @@ out pClientContext finally { if (pClientContext != IntPtr.Zero) - UnsafeNativeMethods.AuthzFreeContext(pClientContext); + Interop.Authz.AuthzFreeContext(pClientContext); if (pResManager != IntPtr.Zero) - UnsafeNativeMethods.AuthzFreeResourceManager(pResManager); + Interop.Authz.AuthzFreeResourceManager(pResManager); if (pBuffer != IntPtr.Zero) Marshal.FreeHGlobal(pBuffer); @@ -287,7 +285,7 @@ internal override object CurrentAsPrincipal // Is the SID from the same domain as the user? bool sameDomain = false; - bool success = UnsafeNativeMethods.EqualDomainSid(_psUserSid.DangerousGetHandle(), pSid, ref sameDomain); + bool success = Interop.Advapi32.EqualDomainSid(_psUserSid.DangerousGetHandle(), pSid, ref sameDomain); // if failed, psUserSid must not be a domain sid if (!success) @@ -334,7 +332,7 @@ internal override object CurrentAsPrincipal // EqualDomainSid will return false if pSid is a BUILTIN SID, but that's okay, we treat those as domain (not local) // groups for domain users. bool inMachineDomain = false; - if (UnsafeNativeMethods.EqualDomainSid(_psMachineSid.DangerousGetHandle(), pSid, ref inMachineDomain)) + if (Interop.Advapi32.EqualDomainSid(_psMachineSid.DangerousGetHandle(), pSid, ref inMachineDomain)) if (inMachineDomain) { // At this point we know that the group was issued by the local machine. Now determine if this machine is @@ -427,7 +425,7 @@ internal override bool MoveNext() IntPtr pSid = _groupSidList[_currentGroup].pSid; bool sameDomain = false; - if (Utils.ClassifySID(pSid) == SidType.RealObject && UnsafeNativeMethods.EqualDomainSid(_psUserSid.DangerousGetHandle(), pSid, ref sameDomain)) + if (Utils.ClassifySID(pSid) == SidType.RealObject && Interop.Advapi32.EqualDomainSid(_psUserSid.DangerousGetHandle(), pSid, ref sameDomain)) { if (sameDomain) { 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 1947b66f588821..b132723c385ace 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 @@ -885,7 +885,7 @@ private void DoLDAPDirectoryInitNoContainer() // The Users container will also be used as the default for Groups. // The reason there are different contexts for groups, users and computers is so that // when a principal is created it will go into the appropriate default container. This is so users don't - // be default create principals in the root of their directory. When a search happens the base context is used so that + // by default create principals in the root of their directory. When a search happens the base context is used so that // the whole directory will be covered. // deUserGroupOrg = new DirectoryEntry(adsPathUserGroupOrg, _username, _password, authTypes); @@ -1107,7 +1107,7 @@ internal void ReadServerConfig(string serverName, ref ServerProperties propertie ldapConnection.AutoBind = false; // If SSL was enabled on the initial connection then turn it on for the search. - // This is requried bc the appended port number will be SSL and we don't know what port LDAP is running on. + // This is required bc the appended port number will be SSL and we don't know what port LDAP is running on. ldapConnection.SessionOptions.SecureSocketLayer = useSSL; string baseDN = null; // specify base as null for RootDSE search diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/GlobalDebug.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/GlobalDebug.cs index 88715147962ca1..fd56746418491c 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/GlobalDebug.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/GlobalDebug.cs @@ -28,7 +28,7 @@ internal static class GlobalDebug [ConditionalAttribute("DEBUG")] public static void WriteLineIf(bool f, string category, string message, params object[] args) { - message = "[" + SafeNativeMethods.GetCurrentThreadId().ToString("x", CultureInfo.InvariantCulture) + "] " + message; + message = "[" + Interop.Kernel32.GetCurrentThreadId().ToString("x", CultureInfo.InvariantCulture) + "] " + message; Debug.WriteLineIf(f, string.Format(CultureInfo.InvariantCulture, message, args), category); } @@ -36,7 +36,7 @@ public static void WriteLineIf(bool f, string category, string message, params o [ConditionalAttribute("DEBUG")] public static void WriteLineIf(bool f, string category, string message) { - message = "[" + SafeNativeMethods.GetCurrentThreadId().ToString("x", CultureInfo.InvariantCulture) + "] " + message; + message = "[" + Interop.Kernel32.GetCurrentThreadId().ToString("x", CultureInfo.InvariantCulture) + "] " + message; Debug.WriteLineIf(f, message, category); } diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/NetCred.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/NetCred.cs index e208968250bb72..fa94ac132601e4 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/NetCred.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/NetCred.cs @@ -66,15 +66,15 @@ private unsafe void SplitUsername(string username, ref string parsedUserName, re // Logon user expects the username in UPN or to have the username and domain split to the separate parameters. // It does not work properly with NT4 style name formats. This function will put the username in the proper format. - fixed (char* splitUsername = new char[UnsafeNativeMethods.CRED_MAX_USERNAME_LENGTH]) - fixed (char* splitDomain = new char[UnsafeNativeMethods.CRED_MAX_DOMAIN_TARGET_LENGTH]) + fixed (char* splitUsername = new char[Interop.Credui.CRED_MAX_USERNAME_LENGTH]) + fixed (char* splitDomain = new char[Interop.Credui.CRED_MAX_DOMAIN_TARGET_LENGTH]) { - int result = UnsafeNativeMethods.CredUIParseUserName( + int result = Interop.Credui.CredUIParseUserName( username, splitUsername, - UnsafeNativeMethods.CRED_MAX_USERNAME_LENGTH, + Interop.Credui.CRED_MAX_USERNAME_LENGTH, splitDomain, - UnsafeNativeMethods.CRED_MAX_DOMAIN_TARGET_LENGTH); + Interop.Credui.CRED_MAX_DOMAIN_TARGET_LENGTH); // If CredUiParseUsername fails then username format must have been in a format it does not expect. // Just pass then entire username as the user passed it with a null domain string. 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 0b27b57d953c0e..49ebb3f6618050 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 @@ -1052,7 +1052,7 @@ private void LoadComputerInfo() try { // This function takes in a flat or DNS name, and returns the flat name of the computer - int err = UnsafeNativeMethods.NetWkstaGetInfo(_machineUserSuppliedName, 100, ref buffer); + int err = Interop.Wkscli.NetWkstaGetInfo(_machineUserSuppliedName, 100, ref buffer); if (err == 0) { UnsafeNativeMethods.WKSTA_INFO_100 wkstaInfo = @@ -1072,7 +1072,7 @@ private void LoadComputerInfo() finally { if (buffer != IntPtr.Zero) - UnsafeNativeMethods.NetApiBufferFree(buffer); + Interop.Netutils.NetApiBufferFree(buffer); } } 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 8a0b28db9da18a..005f1ccdd374f0 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 @@ -354,7 +354,7 @@ internal override Principal FindPrincipalByIdentRef( { pSid = Utils.ConvertByteArrayToIntPtr(sid); - if (UnsafeNativeMethods.IsValidSid(pSid) && (Utils.ClassifySID(pSid) == SidType.FakeObject)) + if (Interop.Advapi32.IsValidSid(pSid) && (Utils.ClassifySID(pSid) == SidType.FakeObject)) { GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMStoreCtx", @@ -419,7 +419,7 @@ internal override Principal FindPrincipalByIdentRef( { pSid = Utils.ConvertByteArrayToIntPtr(sid); - if (UnsafeNativeMethods.IsValidSid(pSid) && (Utils.ClassifySID(pSid) == SidType.FakeObject)) + if (Interop.Advapi32.IsValidSid(pSid) && (Utils.ClassifySID(pSid) == SidType.FakeObject)) { GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMStoreCtx", diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/Utils.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/Utils.cs index 65d159fd6c5f89..d631c7a5d61989 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/Utils.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/Utils.cs @@ -1,15 +1,13 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Diagnostics; using System.Globalization; using System.Runtime.InteropServices; using System.Text; -using System.Collections.Generic; -using System.Net; using System.Security.Principal; -using System.Security; + +using Microsoft.Win32.SafeHandles; namespace System.DirectoryServices.AccountManagement { @@ -127,7 +125,7 @@ internal static string ConvertSidToSDDL(byte[] sid) { pSid = ConvertByteArrayToIntPtr(sid); - if (UnsafeNativeMethods.ConvertSidToStringSid(pSid, ref sddlSid)) + if (Interop.Advapi32.ConvertSidToStringSid(pSid, ref sddlSid) != Interop.BOOL.FALSE) { return sddlSid; } @@ -178,7 +176,7 @@ internal static IntPtr ConvertByteArrayToIntPtr(byte[] bytes) internal static byte[] ConvertNativeSidToByteArray(IntPtr pSid) { - int sidLength = UnsafeNativeMethods.GetLengthSid(pSid); + int sidLength = Interop.Advapi32.GetLengthSid(pSid); byte[] sid = new byte[sidLength]; Marshal.Copy(pSid, sid, 0, sidLength); @@ -205,15 +203,15 @@ internal static SidType ClassifySID(byte[] sid) internal static SidType ClassifySID(IntPtr pSid) { - Debug.Assert(UnsafeNativeMethods.IsValidSid(pSid)); + Debug.Assert(Interop.Advapi32.IsValidSid(pSid)); // Get the issuing authority and the first RID - IntPtr pIdentAuth = UnsafeNativeMethods.GetSidIdentifierAuthority(pSid); + IntPtr pIdentAuth = Interop.Advapi32.GetSidIdentifierAuthority(pSid); - UnsafeNativeMethods.SID_IDENTIFIER_AUTHORITY identAuth = - (UnsafeNativeMethods.SID_IDENTIFIER_AUTHORITY)Marshal.PtrToStructure(pIdentAuth, typeof(UnsafeNativeMethods.SID_IDENTIFIER_AUTHORITY)); + Interop.Advapi32.SID_IDENTIFIER_AUTHORITY identAuth = + (Interop.Advapi32.SID_IDENTIFIER_AUTHORITY)Marshal.PtrToStructure(pIdentAuth, typeof(Interop.Advapi32.SID_IDENTIFIER_AUTHORITY)); - IntPtr pRid = UnsafeNativeMethods.GetSidSubAuthority(pSid, 0); + IntPtr pRid = Interop.Advapi32.GetSidSubAuthority(pSid, 0); int rid = Marshal.ReadInt32(pRid); // These bit signify that the sid was issued by ADAM. If so then it can't be a fake sid. @@ -244,9 +242,9 @@ internal static SidType ClassifySID(IntPtr pSid) internal static int GetLastRidFromSid(IntPtr pSid) { - IntPtr pRidCount = UnsafeNativeMethods.GetSidSubAuthorityCount(pSid); + IntPtr pRidCount = Interop.Advapi32.GetSidSubAuthorityCount(pSid); int ridCount = Marshal.ReadByte(pRidCount); - IntPtr pLastRid = UnsafeNativeMethods.GetSidSubAuthority(pSid, ridCount - 1); + IntPtr pLastRid = Interop.Advapi32.GetSidSubAuthority(pSid, ridCount - 1); int lastRid = Marshal.ReadInt32(pLastRid); return lastRid; @@ -313,7 +311,7 @@ internal static bool IsSamUser() // Does the user SID have the same domain as the machine SID? bool sameDomain = false; - bool success = UnsafeNativeMethods.EqualDomainSid(pCopyOfUserSid, pMachineDomainSid, ref sameDomain); + bool success = Interop.Advapi32.EqualDomainSid(pCopyOfUserSid, pMachineDomainSid, ref sameDomain); // Since both pCopyOfUserSid and pMachineDomainSid should always be account SIDs Debug.Assert(success == true); @@ -340,7 +338,7 @@ internal static bool IsSamUser() internal static IntPtr GetCurrentUserSid() { - IntPtr pTokenHandle = IntPtr.Zero; + SafeTokenHandle tokenHandle = null; IntPtr pBuffer = IntPtr.Zero; try @@ -351,22 +349,22 @@ internal static IntPtr GetCurrentUserSid() int error = 0; // Get the current thread's token - if (!UnsafeNativeMethods.OpenThreadToken( - UnsafeNativeMethods.GetCurrentThread(), - 0x8, // TOKEN_QUERY + if (!Interop.Advapi32.OpenThreadToken( + Interop.Kernel32.GetCurrentThread(), + TokenAccessLevels.Query, true, - ref pTokenHandle + out tokenHandle )) { if ((error = Marshal.GetLastWin32Error()) == 1008) // ERROR_NO_TOKEN { - Debug.Assert(pTokenHandle == IntPtr.Zero); + Debug.Assert(tokenHandle.IsInvalid); // Current thread doesn't have a token, try the process - if (!UnsafeNativeMethods.OpenProcessToken( - UnsafeNativeMethods.GetCurrentProcess(), - 0x8, // TOKEN_QUERY - ref pTokenHandle + if (!Interop.Advapi32.OpenProcessToken( + Interop.Kernel32.GetCurrentProcess(), + (int)TokenAccessLevels.Query, + out tokenHandle )) { int lastError = Marshal.GetLastWin32Error(); @@ -383,18 +381,18 @@ ref pTokenHandle } } - Debug.Assert(pTokenHandle != IntPtr.Zero); + Debug.Assert(!tokenHandle.IsInvalid); - int neededBufferSize = 0; + uint neededBufferSize = 0; // Retrieve the user info from the current thread's token // First, determine how big a buffer we need. - bool success = UnsafeNativeMethods.GetTokenInformation( - pTokenHandle, - 1, // TokenUser + bool success = Interop.Advapi32.GetTokenInformation( + tokenHandle.DangerousGetHandle(), + (uint)Interop.Advapi32.TOKEN_INFORMATION_CLASS.TokenUser, IntPtr.Zero, 0, - ref neededBufferSize); + out neededBufferSize); int getTokenInfoError = 0; if ((getTokenInfoError = Marshal.GetLastWin32Error()) != 122) // ERROR_INSUFFICIENT_BUFFER @@ -407,15 +405,15 @@ ref pTokenHandle // Allocate the necessary buffer. Debug.Assert(neededBufferSize > 0); - pBuffer = Marshal.AllocHGlobal(neededBufferSize); + pBuffer = Marshal.AllocHGlobal((int)neededBufferSize); // Load the user info into the buffer - success = UnsafeNativeMethods.GetTokenInformation( - pTokenHandle, - 1, // TokenUser + success = Interop.Advapi32.GetTokenInformation( + tokenHandle.DangerousGetHandle(), + (uint)Interop.Advapi32.TOKEN_INFORMATION_CLASS.TokenUser, pBuffer, neededBufferSize, - ref neededBufferSize); + out neededBufferSize); if (!success) { @@ -429,15 +427,15 @@ ref pTokenHandle } // Retrieve the user's SID from the user info - UnsafeNativeMethods.TOKEN_USER tokenUser = (UnsafeNativeMethods.TOKEN_USER)Marshal.PtrToStructure(pBuffer, typeof(UnsafeNativeMethods.TOKEN_USER)); - IntPtr pUserSid = tokenUser.sidAndAttributes.pSid; // this is a reference into the NATIVE memory (into pBuffer) + Interop.TOKEN_USER tokenUser = (Interop.TOKEN_USER)Marshal.PtrToStructure(pBuffer, typeof(Interop.TOKEN_USER)); + IntPtr pUserSid = tokenUser.sidAndAttributes.Sid; // this is a reference into the NATIVE memory (into pBuffer) - Debug.Assert(UnsafeNativeMethods.IsValidSid(pUserSid)); + Debug.Assert(Interop.Advapi32.IsValidSid(pUserSid)); // Now we make a copy of the SID to return - int userSidLength = UnsafeNativeMethods.GetLengthSid(pUserSid); + int userSidLength = Interop.Advapi32.GetLengthSid(pUserSid); IntPtr pCopyOfUserSid = Marshal.AllocHGlobal(userSidLength); - success = UnsafeNativeMethods.CopySid(userSidLength, pCopyOfUserSid, pUserSid); + success = Interop.Advapi32.CopySid(userSidLength, pCopyOfUserSid, pUserSid); if (!success) { int lastError = Marshal.GetLastWin32Error(); @@ -453,8 +451,8 @@ ref pTokenHandle } finally { - if (pTokenHandle != IntPtr.Zero) - UnsafeNativeMethods.CloseHandle(pTokenHandle); + if (tokenHandle != null) + tokenHandle.Dispose(); if (pBuffer != IntPtr.Zero) Marshal.FreeHGlobal(pBuffer); @@ -464,56 +462,52 @@ ref pTokenHandle internal static IntPtr GetMachineDomainSid() { - IntPtr pPolicyHandle = IntPtr.Zero; + SafeLsaPolicyHandle policyHandle = null; IntPtr pBuffer = IntPtr.Zero; - IntPtr pOA = IntPtr.Zero; try { - UnsafeNativeMethods.LSA_OBJECT_ATTRIBUTES oa = new UnsafeNativeMethods.LSA_OBJECT_ATTRIBUTES(); - - pOA = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(UnsafeNativeMethods.LSA_OBJECT_ATTRIBUTES))); - Marshal.StructureToPtr(oa, pOA, false); - int err = UnsafeNativeMethods.LsaOpenPolicy( - IntPtr.Zero, - pOA, - 1, // POLICY_VIEW_LOCAL_INFORMATION - ref pPolicyHandle); + Interop.OBJECT_ATTRIBUTES oa = default; + uint err = Interop.Advapi32.LsaOpenPolicy( + SystemName: null, + ref oa, + (int)Interop.Advapi32.PolicyRights.POLICY_VIEW_LOCAL_INFORMATION, + out policyHandle); if (err != 0) { - GlobalDebug.WriteLineIf(GlobalDebug.Error, "Utils", "GetMachineDomainSid: LsaOpenPolicy failed, gle=" + SafeNativeMethods.LsaNtStatusToWinError(err)); + GlobalDebug.WriteLineIf(GlobalDebug.Error, "Utils", "GetMachineDomainSid: LsaOpenPolicy failed, gle=" + Interop.Advapi32.LsaNtStatusToWinError(err)); throw new PrincipalOperationException(SR.Format( SR.UnableToRetrievePolicy, - SafeNativeMethods.LsaNtStatusToWinError(err))); + Interop.Advapi32.LsaNtStatusToWinError(err))); } - Debug.Assert(pPolicyHandle != IntPtr.Zero); - err = UnsafeNativeMethods.LsaQueryInformationPolicy( - pPolicyHandle, + Debug.Assert(!policyHandle.IsInvalid); + err = Interop.Advapi32.LsaQueryInformationPolicy( + policyHandle.DangerousGetHandle(), 5, // PolicyAccountDomainInformation ref pBuffer); if (err != 0) { - GlobalDebug.WriteLineIf(GlobalDebug.Error, "Utils", "GetMachineDomainSid: LsaQueryInformationPolicy failed, gle=" + SafeNativeMethods.LsaNtStatusToWinError(err)); + GlobalDebug.WriteLineIf(GlobalDebug.Error, "Utils", "GetMachineDomainSid: LsaQueryInformationPolicy failed, gle=" + Interop.Advapi32.LsaNtStatusToWinError(err)); throw new PrincipalOperationException(SR.Format( SR.UnableToRetrievePolicy, - SafeNativeMethods.LsaNtStatusToWinError(err))); + Interop.Advapi32.LsaNtStatusToWinError(err))); } Debug.Assert(pBuffer != IntPtr.Zero); UnsafeNativeMethods.POLICY_ACCOUNT_DOMAIN_INFO info = (UnsafeNativeMethods.POLICY_ACCOUNT_DOMAIN_INFO) Marshal.PtrToStructure(pBuffer, typeof(UnsafeNativeMethods.POLICY_ACCOUNT_DOMAIN_INFO)); - Debug.Assert(UnsafeNativeMethods.IsValidSid(info.domainSid)); + Debug.Assert(Interop.Advapi32.IsValidSid(info.domainSid)); // Now we make a copy of the SID to return - int sidLength = UnsafeNativeMethods.GetLengthSid(info.domainSid); + int sidLength = Interop.Advapi32.GetLengthSid(info.domainSid); IntPtr pCopyOfSid = Marshal.AllocHGlobal(sidLength); - bool success = UnsafeNativeMethods.CopySid(sidLength, pCopyOfSid, info.domainSid); + bool success = Interop.Advapi32.CopySid(sidLength, pCopyOfSid, info.domainSid); if (!success) { int lastError = Marshal.GetLastWin32Error(); @@ -529,14 +523,11 @@ internal static IntPtr GetMachineDomainSid() } finally { - if (pPolicyHandle != IntPtr.Zero) - UnsafeNativeMethods.LsaClose(pPolicyHandle); + if (policyHandle != null) + policyHandle.Dispose(); if (pBuffer != IntPtr.Zero) - UnsafeNativeMethods.LsaFreeMemory(pBuffer); - - if (pOA != IntPtr.Zero) - Marshal.FreeHGlobal(pOA); + Interop.Advapi32.LsaFreeMemory(pBuffer); } } @@ -570,7 +561,7 @@ internal static UnsafeNativeMethods.DomainControllerInfo GetDcName(string comput try { - int err = UnsafeNativeMethods.DsGetDcName(computerName, domainName, IntPtr.Zero, siteName, flags, out domainControllerInfoPtr); + int err = Interop.Logoncli.DsGetDcName(computerName, domainName, IntPtr.Zero, siteName, flags, out domainControllerInfoPtr); if (err != 0) { @@ -590,7 +581,7 @@ internal static UnsafeNativeMethods.DomainControllerInfo GetDcName(string comput finally { if (domainControllerInfoPtr != IntPtr.Zero) - UnsafeNativeMethods.NetApiBufferFree(domainControllerInfoPtr); + Interop.Netutils.NetApiBufferFree(domainControllerInfoPtr); } } @@ -754,7 +745,7 @@ internal static bool BeginImpersonation(NetCred credential, out IntPtr hUserToke GlobalDebug.WriteLineIf(GlobalDebug.Info, "Utils", "BeginImpersonation: trying to impersonate " + userName); - int result = UnsafeNativeMethods.LogonUser( + int result = Interop.Advapi32.LogonUser( userName, domainName, password, @@ -771,14 +762,14 @@ internal static bool BeginImpersonation(NetCred credential, out IntPtr hUserToke SR.Format(SR.UnableToImpersonateCredentials, lastError)); } - result = UnsafeNativeMethods.ImpersonateLoggedOnUser(hToken); + result = Interop.Advapi32.ImpersonateLoggedOnUser(hToken); if (result == 0) { int lastError = Marshal.GetLastWin32Error(); GlobalDebug.WriteLineIf(GlobalDebug.Error, "Utils", "BeginImpersonation: ImpersonateLoggedOnUser failed, gle=" + lastError); // Close the token the was created above.... - UnsafeNativeMethods.CloseHandle(hToken); + Interop.Kernel32.CloseHandle(hToken); throw new PrincipalOperationException( SR.Format(SR.UnableToImpersonateCredentials, lastError)); @@ -792,8 +783,8 @@ internal static void EndImpersonation(IntPtr hUserToken) { GlobalDebug.WriteLineIf(GlobalDebug.Info, "Utils", "Entering EndImpersonation"); - UnsafeNativeMethods.RevertToSelf(); - UnsafeNativeMethods.CloseHandle(hUserToken); + Interop.Advapi32.RevertToSelf(); + Interop.Kernel32.CloseHandle(hUserToken); } internal static bool IsMachineDC(string computerName) @@ -803,10 +794,7 @@ internal static bool IsMachineDC(string computerName) try { - if (null == computerName) - err = UnsafeNativeMethods.DsRoleGetPrimaryDomainInformation(null, UnsafeNativeMethods.DSROLE_PRIMARY_DOMAIN_INFO_LEVEL.DsRolePrimaryDomainInfoBasic, out dsRoleInfoPtr); - else - err = UnsafeNativeMethods.DsRoleGetPrimaryDomainInformation(computerName, UnsafeNativeMethods.DSROLE_PRIMARY_DOMAIN_INFO_LEVEL.DsRolePrimaryDomainInfoBasic, out dsRoleInfoPtr); + err = Interop.Dsrole.DsRoleGetPrimaryDomainInformation(computerName, Interop.Dsrole.DSROLE_PRIMARY_DOMAIN_INFO_LEVEL.DsRolePrimaryDomainInfoBasic, out dsRoleInfoPtr); if (err != 0) { @@ -826,7 +814,7 @@ internal static bool IsMachineDC(string computerName) finally { if (dsRoleInfoPtr != IntPtr.Zero) - UnsafeNativeMethods.DsRoleFreeMemory(dsRoleInfoPtr); + Interop.Dsrole.DsRoleFreeMemory(dsRoleInfoPtr); } } } diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/interopt.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/interopt.cs index e8fbd223fd2432..d87879d8608d83 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/interopt.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/interopt.cs @@ -11,8 +11,6 @@ namespace System.DirectoryServices.AccountManagement { using System.Runtime.InteropServices; using System; - using System.Security; - using System.Text; internal static class Constants { @@ -21,24 +19,13 @@ internal static class Constants internal static byte[] GUID_FOREIGNSECURITYPRINCIPALS_CONTAINER_BYTE = new byte[] { 0x22, 0xb7, 0x0c, 0x67, 0xd5, 0x6e, 0x4e, 0xfb, 0x91, 0xe9, 0x30, 0x0f, 0xca, 0x3d, 0xc1, 0xaa }; } - internal static class SafeNativeMethods - { - [DllImport(Interop.Libraries.Kernel32, CallingConvention = CallingConvention.StdCall, EntryPoint = "GetCurrentThreadId", CharSet = CharSet.Unicode)] - public static extern int GetCurrentThreadId(); - - [DllImport(Interop.Libraries.Advapi32, CallingConvention = CallingConvention.StdCall, EntryPoint = "LsaNtStatusToWinError", CharSet = CharSet.Unicode)] - public static extern int LsaNtStatusToWinError(int ntStatus); - } - internal static class UnsafeNativeMethods { - [DllImport(Interop.Libraries.Activeds, ExactSpelling = true, EntryPoint = "ADsOpenObject", CharSet = System.Runtime.InteropServices.CharSet.Unicode)] - private static extern int IntADsOpenObject(string path, string userName, string password, int flags, [In, Out] ref Guid iid, [Out, MarshalAs(UnmanagedType.Interface)] out object ppObject); public static int ADsOpenObject(string path, string userName, string password, int flags, [In, Out] ref Guid iid, [Out, MarshalAs(UnmanagedType.Interface)] out object ppObject) { try { - return IntADsOpenObject(path, userName, password, flags, ref iid, out ppObject); + return Interop.Activeds.ADsOpenObject(path, userName, password, flags, ref iid, out ppObject); } catch (EntryPointNotFoundException) { @@ -381,24 +368,6 @@ public enum DSROLE_MACHINE_ROLE DsRole_MemberServerWithSharedAccountDomain } - /* - typedef enum - { - DsRolePrimaryDomainInfoBasic, - DsRoleUpgradeStatus, - DsRoleOperationState, - DsRolePrimaryDomainInfoBasicEx - }DSROLE_PRIMARY_DOMAIN_INFO_LEVEL; - */ - - public enum DSROLE_PRIMARY_DOMAIN_INFO_LEVEL - { - DsRolePrimaryDomainInfoBasic = 1, - DsRoleUpgradeStatus = 2, - DsRoleOperationState = 3, - DsRolePrimaryDomainInfoBasicEx = 4 - } - /* typedef struct _DSROLE_PRIMARY_DOMAIN_INFO_BASIC { DSROLE_MACHINE_ROLE MachineRole; @@ -424,19 +393,6 @@ public sealed class DSROLE_PRIMARY_DOMAIN_INFO_BASIC public Guid DomainGuid; } - /* - DWORD DsRoleGetPrimaryDomainInformation( - LPCWSTR lpServer, - DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel, - PBYTE* Buffer - ); */ - - [DllImport(Interop.Libraries.Dsrole, CallingConvention = CallingConvention.StdCall, EntryPoint = "DsRoleGetPrimaryDomainInformation", CharSet = CharSet.Unicode)] - public static extern int DsRoleGetPrimaryDomainInformation( - [MarshalAs(UnmanagedType.LPTStr)] string lpServer, - [In] DSROLE_PRIMARY_DOMAIN_INFO_LEVEL InfoLevel, - out IntPtr Buffer); - /*typedef struct _DOMAIN_CONTROLLER_INFO { LPTSTR DomainControllerName; LPTSTR DomainControllerAddress; @@ -462,32 +418,6 @@ public sealed class DomainControllerInfo public string ClientSiteName; } - /* - void DsRoleFreeMemory( - PVOID Buffer - ); - */ - [DllImport(Interop.Libraries.Dsrole)] - public static extern int DsRoleFreeMemory( - [In] IntPtr buffer); - - /*DWORD DsGetDcName( - LPCTSTR ComputerName, - LPCTSTR DomainName, - GUID* DomainGuid, - LPCTSTR SiteName, - ULONG Flags, - PDOMAIN_CONTROLLER_INFO* DomainControllerInfo - );*/ - [DllImport(Interop.Libraries.Logoncli, CallingConvention = CallingConvention.StdCall, EntryPoint = "DsGetDcNameW", CharSet = CharSet.Unicode)] - public static extern int DsGetDcName( - [In] string computerName, - [In] string domainName, - [In] IntPtr domainGuid, - [In] string siteName, - [In] int flags, - [Out] out IntPtr domainControllerInfo); - /* typedef struct _WKSTA_INFO_100 { DWORD wki100_platform_id; LMSTR wki100_computername; @@ -505,314 +435,11 @@ public sealed class WKSTA_INFO_100 public int wki100_ver_minor; }; - [DllImport(Interop.Libraries.Wkscli, CallingConvention = CallingConvention.StdCall, EntryPoint = "NetWkstaGetInfo", CharSet = CharSet.Unicode)] - public static extern int NetWkstaGetInfo(string server, int level, ref IntPtr buffer); - - [DllImport(Interop.Libraries.Netutils)] - public static extern int NetApiBufferFree( - [In] IntPtr buffer); - - // - // SID - // - - [DllImport(Interop.Libraries.Advapi32, SetLastError = true, CallingConvention = CallingConvention.StdCall, EntryPoint = "ConvertSidToStringSidW", CharSet = CharSet.Unicode)] - public static extern bool ConvertSidToStringSid(IntPtr sid, ref string stringSid); - - [DllImport(Interop.Libraries.Advapi32, CallingConvention = CallingConvention.StdCall, EntryPoint = "ConvertStringSidToSidW", CharSet = CharSet.Unicode)] - public static extern bool ConvertStringSidToSid(string stringSid, ref IntPtr sid); - - [DllImport(Interop.Libraries.Advapi32)] - public static extern int GetLengthSid(IntPtr sid); - - [DllImport(Interop.Libraries.Advapi32, SetLastError = true)] - public static extern bool IsValidSid(IntPtr sid); - - [DllImport(Interop.Libraries.Advapi32)] - public static extern IntPtr GetSidIdentifierAuthority(IntPtr sid); - - [DllImport(Interop.Libraries.Advapi32)] - public static extern IntPtr GetSidSubAuthority(IntPtr sid, int index); - - [DllImport(Interop.Libraries.Advapi32)] - public static extern IntPtr GetSidSubAuthorityCount(IntPtr sid); - - [DllImport(Interop.Libraries.Advapi32)] - public static extern bool EqualDomainSid(IntPtr pSid1, IntPtr pSid2, ref bool equal); - - [DllImport(Interop.Libraries.Advapi32, SetLastError = true)] - public static extern bool CopySid(int destinationLength, IntPtr pSidDestination, IntPtr pSidSource); - - [DllImport(Interop.Libraries.Kernel32)] - public static extern IntPtr LocalFree(IntPtr ptr); - - [DllImport(Interop.Libraries.Credui, SetLastError = true, CallingConvention = CallingConvention.StdCall, EntryPoint = "CredUIParseUserNameW", CharSet = CharSet.Unicode)] - public static extern unsafe int CredUIParseUserName( - string pszUserName, - char* pszUser, - uint ulUserMaxChars, - char* pszDomain, - uint ulDomainMaxChars); - - // These contants were taken from the wincred.h file - public const int CRED_MAX_USERNAME_LENGTH = 514; - public const int CRED_MAX_DOMAIN_TARGET_LENGTH = 338; - - // - // AuthZ functions - // - - internal sealed class AUTHZ_RM_FLAG - { - private AUTHZ_RM_FLAG() { } - public static int AUTHZ_RM_FLAG_NO_AUDIT = 0x1; - public static int AUTHZ_RM_FLAG_INITIALIZE_UNDER_IMPERSONATION = 0x2; - public static int AUTHZ_VALID_RM_INIT_FLAGS = (AUTHZ_RM_FLAG_NO_AUDIT | AUTHZ_RM_FLAG_INITIALIZE_UNDER_IMPERSONATION); - } - - [DllImport(Interop.Libraries.Authz, SetLastError = true, CallingConvention = CallingConvention.StdCall, EntryPoint = "AuthzInitializeResourceManager", CharSet = CharSet.Unicode)] - public static extern bool AuthzInitializeResourceManager( - int flags, - IntPtr pfnAccessCheck, - IntPtr pfnComputeDynamicGroups, - IntPtr pfnFreeDynamicGroups, - string name, - out IntPtr rm - ); - - /* - BOOL WINAPI AuthzInitializeContextFromSid( - DWORD Flags, - PSID UserSid, - AUTHZ_RESOURCE_MANAGER_HANDLE AuthzResourceManager, - PLARGE_INTEGER pExpirationTime, - LUID Identifier, - PVOID DynamicGroupArgs, - PAUTHZ_CLIENT_CONTEXT_HANDLE pAuthzClientContext - ); - */ - [DllImport(Interop.Libraries.Authz, SetLastError = true, CallingConvention = CallingConvention.StdCall, EntryPoint = "AuthzInitializeContextFromSid", CharSet = CharSet.Unicode)] - public static extern bool AuthzInitializeContextFromSid( - int Flags, - IntPtr UserSid, - IntPtr AuthzResourceManager, - IntPtr pExpirationTime, - LUID Identitifier, - IntPtr DynamicGroupArgs, - out IntPtr pAuthzClientContext - ); - - /* - [DllImport(Interop.Libraries.Authz, SetLastError=true, CallingConvention=CallingConvention.StdCall, EntryPoint="AuthzInitializeContextFromToken", CharSet=CharSet.Unicode)] - static extern public bool AuthzInitializeContextFromToken( - int Flags, - IntPtr TokenHandle, - IntPtr AuthzResourceManager, - IntPtr pExpirationTime, - LUID Identitifier, - IntPtr DynamicGroupArgs, - out IntPtr pAuthzClientContext - ); - */ - [DllImport(Interop.Libraries.Authz, SetLastError = true, CallingConvention = CallingConvention.StdCall, EntryPoint = "AuthzGetInformationFromContext", CharSet = CharSet.Unicode)] - public static extern bool AuthzGetInformationFromContext( - IntPtr hAuthzClientContext, - int InfoClass, - int BufferSize, - out int pSizeRequired, - IntPtr Buffer - ); - - [DllImport(Interop.Libraries.Authz, CallingConvention = CallingConvention.StdCall, EntryPoint = "AuthzFreeContext", CharSet = CharSet.Unicode)] - public static extern bool AuthzFreeContext( - IntPtr AuthzClientContext - ); - - [DllImport(Interop.Libraries.Authz, CallingConvention = CallingConvention.StdCall, EntryPoint = "AuthzFreeResourceManager", CharSet = CharSet.Unicode)] - public static extern bool AuthzFreeResourceManager( - IntPtr rm - ); - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public struct LUID - { - public int low; - public int high; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public sealed class TOKEN_GROUPS - { - public int groupCount; - public IntPtr groups = IntPtr.Zero; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public sealed class SID_AND_ATTR - { - public IntPtr pSid = IntPtr.Zero; - public int attrs; - } - - // - // Token - // - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public sealed class TOKEN_USER - { - public SID_AND_ATTR sidAndAttributes = new SID_AND_ATTR(); - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public sealed class SID_IDENTIFIER_AUTHORITY - { - public byte b1; - public byte b2; - public byte b3; - public byte b4; - public byte b5; - public byte b6; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public sealed class LSA_OBJECT_ATTRIBUTES - { - public int length; - public IntPtr rootDirectory = IntPtr.Zero; - public IntPtr objectName = IntPtr.Zero; - public int attributes; - public IntPtr securityDescriptor = IntPtr.Zero; - public IntPtr securityQualityOfService = IntPtr.Zero; - } - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public sealed class POLICY_ACCOUNT_DOMAIN_INFO { - public LSA_UNICODE_STRING domainName = new LSA_UNICODE_STRING(); + public Interop.UNICODE_INTPTR_STRING domainName; public IntPtr domainSid = IntPtr.Zero; } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public sealed class LSA_UNICODE_STRING - { - public ushort length; - public ushort maximumLength; - public IntPtr buffer = IntPtr.Zero; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public sealed class LSA_UNICODE_STRING_Managed - { - public ushort length; - public ushort maximumLength; - public string buffer; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public sealed class LSA_TRANSLATED_NAME - { - public int use; - public LSA_UNICODE_STRING name = new LSA_UNICODE_STRING(); - public int domainIndex; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public sealed class LSA_REFERENCED_DOMAIN_LIST - { - // To stop the compiler from autogenerating a constructor for this class - private LSA_REFERENCED_DOMAIN_LIST() { } - - public int entries; - public IntPtr domains = IntPtr.Zero; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - public sealed class LSA_TRUST_INFORMATION - { - public LSA_UNICODE_STRING name = new LSA_UNICODE_STRING(); - private readonly IntPtr _pSid = IntPtr.Zero; - } - - [DllImport(Interop.Libraries.Advapi32, SetLastError = true, CallingConvention = CallingConvention.StdCall, EntryPoint = "OpenThreadToken", CharSet = CharSet.Unicode)] - public static extern bool OpenThreadToken( - IntPtr threadHandle, - int desiredAccess, - bool openAsSelf, - ref IntPtr tokenHandle - ); - - [DllImport(Interop.Libraries.Advapi32, SetLastError = true, CallingConvention = CallingConvention.StdCall, EntryPoint = "OpenProcessToken", CharSet = CharSet.Unicode)] - public static extern bool OpenProcessToken( - IntPtr processHandle, - int desiredAccess, - ref IntPtr tokenHandle - ); - - [DllImport(Interop.Libraries.Kernel32, CallingConvention = CallingConvention.StdCall, EntryPoint = "CloseHandle", CharSet = CharSet.Unicode)] - public static extern bool CloseHandle(IntPtr handle); - - [DllImport(Interop.Libraries.Kernel32, CallingConvention = CallingConvention.StdCall, EntryPoint = "GetCurrentThread", CharSet = CharSet.Unicode)] - public static extern IntPtr GetCurrentThread(); - - [DllImport(Interop.Libraries.Kernel32, CallingConvention = CallingConvention.StdCall, EntryPoint = "GetCurrentProcess", CharSet = CharSet.Unicode)] - public static extern IntPtr GetCurrentProcess(); - - [DllImport(Interop.Libraries.Advapi32, SetLastError = true, CallingConvention = CallingConvention.StdCall, EntryPoint = "GetTokenInformation", CharSet = CharSet.Unicode)] - public static extern bool GetTokenInformation( - IntPtr tokenHandle, - int tokenInformationClass, - IntPtr buffer, - int bufferSize, - ref int returnLength - ); - - [DllImport(Interop.Libraries.Advapi32, CallingConvention = CallingConvention.StdCall, EntryPoint = "LsaOpenPolicy", CharSet = CharSet.Unicode)] - public static extern int LsaOpenPolicy( - IntPtr lsaUnicodeString, - IntPtr lsaObjectAttributes, - int desiredAccess, - ref IntPtr policyHandle); - - [DllImport(Interop.Libraries.Advapi32, CallingConvention = CallingConvention.StdCall, EntryPoint = "LsaQueryInformationPolicy", CharSet = CharSet.Unicode)] - public static extern int LsaQueryInformationPolicy( - IntPtr policyHandle, - int policyInformationClass, - ref IntPtr buffer - ); - - [DllImport(Interop.Libraries.Advapi32, CallingConvention = CallingConvention.StdCall, EntryPoint = "LsaLookupSids", CharSet = CharSet.Unicode)] - public static extern int LsaLookupSids( - IntPtr policyHandle, - int count, - IntPtr[] sids, - out IntPtr referencedDomains, - out IntPtr names - ); - - [DllImport(Interop.Libraries.Advapi32, CallingConvention = CallingConvention.StdCall, EntryPoint = "LsaFreeMemory", CharSet = CharSet.Unicode)] - public static extern int LsaFreeMemory(IntPtr buffer); - - [DllImport(Interop.Libraries.Advapi32, CallingConvention = CallingConvention.StdCall, EntryPoint = "LsaClose", CharSet = CharSet.Unicode)] - public static extern int LsaClose(IntPtr policyHandle); - - // - // Impersonation - // - - [DllImport(Interop.Libraries.Advapi32, SetLastError = true, CallingConvention = CallingConvention.StdCall, EntryPoint = "LogonUserW", CharSet = CharSet.Unicode)] - public static extern int LogonUser( - string lpszUsername, - string lpszDomain, - string lpszPassword, - int dwLogonType, - int dwLogonProvider, - ref IntPtr phToken); - - [DllImport(Interop.Libraries.Advapi32, SetLastError = true, CallingConvention = CallingConvention.StdCall, EntryPoint = "ImpersonateLoggedOnUser", CharSet = CharSet.Unicode)] - public static extern int ImpersonateLoggedOnUser(IntPtr hToken); - - [DllImport(Interop.Libraries.Advapi32, CallingConvention = CallingConvention.StdCall, EntryPoint = "RevertToSelf", CharSet = CharSet.Unicode)] - public static extern int RevertToSelf(); } } 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 c06c517d0aca64..1b740db20bef22 100644 --- a/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs +++ b/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs @@ -372,7 +372,6 @@ internal LdapSessionOptions() { } public bool RootDseCache { get { throw null; } set { } } public string SaslMethod { get { throw null; } set { } } public bool Sealing { get { throw null; } set { } } - [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public bool SecureSocketLayer { get { throw null; } set { } } public object SecurityContext { get { throw null; } } public System.TimeSpan SendTimeout { get { throw null; } set { } } 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 8ee73ae4c1d284..102c67d81410e3 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj +++ b/src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj @@ -4,6 +4,7 @@ true $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum)-OSX;$(NetCoreAppMinimum)-Linux;$(NetCoreAppMinimum);netstandard2.0 true + annotations true true Provides the methods defined in the Lightweight Directory Access Protocol (LDAP) version 3 (V3) and Directory Services Markup Language (DSML) version 2.0 (V2) standards. diff --git a/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj b/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj index 74b52350cf0f4b..39d6ef2c2db507 100644 --- a/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj +++ b/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj @@ -182,6 +182,9 @@ System.DirectoryServices.ActiveDirectory.DomainController + + + diff --git a/src/libraries/System.Globalization.Extensions/tests/IdnMapping/IdnMappingIdnaConformanceTests.cs b/src/libraries/System.Globalization.Extensions/tests/IdnMapping/IdnMappingIdnaConformanceTests.cs index 26e99ce7686b11..b9324d48f0f244 100644 --- a/src/libraries/System.Globalization.Extensions/tests/IdnMapping/IdnMappingIdnaConformanceTests.cs +++ b/src/libraries/System.Globalization.Extensions/tests/IdnMapping/IdnMappingIdnaConformanceTests.cs @@ -21,6 +21,7 @@ public class IdnMappingIdnaConformanceTests /// There are some others that failed which have been commented out and marked in the dataset as "GETASCII DOES FAILS ON WINDOWS 8.1" /// Same applies to Windows 10 >= 10.0.15063 in the IdnaTest_9.txt file [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/58708", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowserOnWindows), nameof(PlatformDetection.IsMonoAOT))] public void GetAscii_Success() { Assert.All(Factory.GetDataset().Where(e => e.ASCIIResult.Success), entry => @@ -51,6 +52,7 @@ public void GetAscii_Success() /// Same applies to Windows 10 >= 10.0.15063 in the IdnaTest_9.txt file /// [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/58708", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowserOnWindows), nameof(PlatformDetection.IsMonoAOT))] public void GetUnicode_Success() { Assert.All(Factory.GetDataset().Where(e => e.UnicodeResult.Success && e.UnicodeResult.ValidDomainName), entry => @@ -83,6 +85,7 @@ public void GetUnicode_Success() /// Same applies to Windows 10 >= 10.0.15063 in the IdnaTest_9.txt file /// [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // https://github.com/dotnet/runtime/issues/22409 + [ActiveIssue("https://github.com/dotnet/runtime/issues/58708", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowserOnWindows), nameof(PlatformDetection.IsMonoAOT))] public void GetAscii_Invalid() { Assert.All(Factory.GetDataset().Where(entry => !entry.ASCIIResult.Success), entry => @@ -112,6 +115,7 @@ public void GetAscii_Invalid() /// Same applies to Windows 10 >= 10.0.15063 in the IdnaTest_9.txt file /// [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/58708", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowserOnWindows), nameof(PlatformDetection.IsMonoAOT))] public void GetUnicode_Invalid() { Assert.All(Factory.GetDataset().Where(entry => !entry.UnicodeResult.Success), entry => diff --git a/src/libraries/System.Globalization/tests/System/Globalization/TextInfoTests.cs b/src/libraries/System.Globalization/tests/System/Globalization/TextInfoTests.cs index eae275bc0b1a3e..23cf48dfa7ecec 100644 --- a/src/libraries/System.Globalization/tests/System/Globalization/TextInfoTests.cs +++ b/src/libraries/System.Globalization/tests/System/Globalization/TextInfoTests.cs @@ -287,7 +287,7 @@ public static IEnumerable ToLower_TestData() } yield return new object[] { cultureName, "\u0130", "i" }; yield return new object[] { cultureName, "i", "i" }; - + } // ICU has special tailoring for the en-US-POSIX locale which treats "i" and "I" as different letters @@ -478,5 +478,13 @@ public void ToStringTest(string name, string expected) { Assert.Equal(expected, new CultureInfo(name).TextInfo.ToString()); } + + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + [InlineData("es-ES")] + [InlineData("es-ES_tradnl")] + public void TestAsciiCodePageWithCulturesWithAlternativeSortNames(string cultureName) + { + AssemblyTrademarkAttribute.Equals(1252, CultureInfo.GetCultureInfo(cultureName).TextInfo.ANSICodePage); + } } } 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 11c6f45cab9a73..e7723229c0d2df 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 @@ -5,7 +5,7 @@ using System.Linq; using Xunit; -namespace System.IO.FileSystem.DriveInfoTests +namespace System.IO.FileSystem.Tests { public partial class DriveInfoUnixTests { diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Windows.Tests.cs b/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Windows.Tests.cs index c52980953e9e0f..06dee252d848e1 100644 --- a/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Windows.Tests.cs +++ b/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Windows.Tests.cs @@ -1,18 +1,17 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.IO; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Security; -using Xunit; using System.Text; +using Xunit; -namespace System.IO.FileSystem.DriveInfoTests +namespace System.IO.FileSystem.Tests { + [PlatformSpecific(TestPlatforms.Windows)] public class DriveInfoWindowsTests { [Theory] @@ -35,7 +34,6 @@ public void Ctor_InvalidPath_ThrowsArgumentException(string driveName) } [Fact] - [PlatformSpecific(TestPlatforms.Windows)] public void TestConstructor() { string[] variableInput = { "{0}", "{0}", "{0}:", "{0}:", @"{0}:\", @"{0}:\\", "{0}://" }; @@ -54,7 +52,6 @@ public void TestConstructor() } [Fact] - [PlatformSpecific(TestPlatforms.Windows)] public void TestGetDrives() { var validExpectedDrives = GetValidDriveLettersOnMachine(); @@ -97,7 +94,6 @@ public void TestDriveProperties_AppContainer() } [Fact] - [PlatformSpecific(TestPlatforms.Windows)] public void TestDriveFormat() { DriveInfo validDrive = DriveInfo.GetDrives().Where(d => d.DriveType == DriveType.Fixed).First(); @@ -124,7 +120,6 @@ public void TestDriveFormat() } [Fact] - [PlatformSpecific(TestPlatforms.Windows)] public void TestDriveType() { var validDrive = DriveInfo.GetDrives().Where(d => d.DriveType == DriveType.Fixed).First(); @@ -137,7 +132,6 @@ public void TestDriveType() } [Fact] - [PlatformSpecific(TestPlatforms.Windows)] public void TestValidDiskSpaceProperties() { bool win32Result; @@ -169,7 +163,6 @@ public void TestValidDiskSpaceProperties() } [Fact] - [PlatformSpecific(TestPlatforms.Windows)] public void TestInvalidDiskProperties() { string invalidDriveName = GetInvalidDriveLettersOnMachine().First().ToString(); @@ -189,7 +182,6 @@ public void TestInvalidDiskProperties() } [Fact] - [PlatformSpecific(TestPlatforms.Windows)] public void GetVolumeLabel_Returns_CorrectLabel() { void DoDriveCheck() @@ -225,7 +217,6 @@ void DoDriveCheck() } [Fact] - [PlatformSpecific(TestPlatforms.Windows)] public void SetVolumeLabel_Roundtrips() { DriveInfo drive = DriveInfo.GetDrives().Where(d => d.DriveType == DriveType.Fixed).First(); @@ -246,7 +237,6 @@ public void SetVolumeLabel_Roundtrips() } [Fact] - [PlatformSpecific(TestPlatforms.Windows)] public void VolumeLabelOnNetworkOrCdRom_Throws() { // Test setting the volume label on a Network or CD-ROM 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 be64739138482e..fa6aaa94a54c85 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 @@ -5,5 +5,8 @@ + + + \ No newline at end of file diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/tests/VirtualDrives.Windows.Tests.cs b/src/libraries/System.IO.FileSystem.DriveInfo/tests/VirtualDrives.Windows.Tests.cs new file mode 100644 index 00000000000000..57fe6141fc8a9b --- /dev/null +++ b/src/libraries/System.IO.FileSystem.DriveInfo/tests/VirtualDrives.Windows.Tests.cs @@ -0,0 +1,29 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Security; +using System.Text; +using Xunit; + +namespace System.IO.FileSystem.Tests +{ + // Separate class from the rest of the DriveInfo tests to prevent adding an extra virtual drive to GetDrives(). + public class DriveInfoVirtualDriveTests + { + // Cannot set the volume label on a SUBST'ed folder + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsSubstAvailable))] + [PlatformSpecific(TestPlatforms.Windows)] + public void SetVolumeLabel_OnVirtualDrive_Throws() + { + using VirtualDriveHelper virtualDrive = new(); + char letter = virtualDrive.VirtualDriveLetter; // Trigger calling subst + DriveInfo drive = DriveInfo.GetDrives().Where(d => d.RootDirectory.FullName[0] == letter).FirstOrDefault(); + Assert.NotNull(drive); + Assert.Throws(() => drive.VolumeLabel = "impossible"); + } + } +} \ No newline at end of file diff --git a/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs b/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs index 100aa445578b53..1b343e595cc0bd 100644 --- a/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs +++ b/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs @@ -1086,7 +1086,7 @@ public void FileSystemWatcher_ModifyFiltersConcurrentWithEvents() } } - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public partial class DangerousFileSystemWatcherTests : FileSystemWatcherTest { private readonly ITestOutputHelper _output; 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 0fd7e9a74423c3..453021d1f73769 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 @@ -35,6 +35,8 @@ Link="Common\System\IO\TempFile.cs" /> + diff --git a/src/libraries/System.IO.FileSystem.Watcher/tests/Utility/FileSystemWatcherTest.cs b/src/libraries/System.IO.FileSystem.Watcher/tests/Utility/FileSystemWatcherTest.cs index c40dcc5d21bf8c..f1b14874a1c495 100644 --- a/src/libraries/System.IO.FileSystem.Watcher/tests/Utility/FileSystemWatcherTest.cs +++ b/src/libraries/System.IO.FileSystem.Watcher/tests/Utility/FileSystemWatcherTest.cs @@ -11,9 +11,6 @@ namespace System.IO.Tests { - [CollectionDefinition("NoParallelTests", DisableParallelization = true)] - public partial class NoParallelTests { } - public abstract partial class FileSystemWatcherTest : FileCleanupTestBase { // Events are reported asynchronously by the OS, so allow an amount of time for diff --git a/src/libraries/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs b/src/libraries/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs index 8df736132ea3fa..57a63f1c1cca28 100644 --- a/src/libraries/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs +++ b/src/libraries/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs @@ -24,6 +24,15 @@ public abstract class BaseGetSetTimes : FileSystemTest protected abstract T GetExistingItem(); protected abstract T GetMissingItem(); + protected abstract T CreateSymlink(string path, string pathToTarget); + + protected T CreateSymlinkToItem(T item) + { + // Creates a Symlink to 'item' (target may or may not exist) + string itemPath = GetItemPath(item); + return CreateSymlink(path: itemPath + ".link", pathToTarget: itemPath); + } + protected abstract string GetItemPath(T item); public abstract IEnumerable TimeFunctions(bool requiresRoundtripping = false); @@ -43,11 +52,8 @@ public static TimeFunction Create(SetTime setter, GetTime getter, DateTimeKind k public DateTimeKind Kind => Item3; } - [Fact] - public void SettingUpdatesProperties() + private void SettingUpdatesPropertiesCore(T item) { - T item = GetExistingItem(); - Assert.All(TimeFunctions(requiresRoundtripping: true), (function) => { // Checking that milliseconds are not dropped after setter. @@ -71,6 +77,56 @@ public void SettingUpdatesProperties() }); } + [Fact] + public void SettingUpdatesProperties() + { + T item = GetExistingItem(); + SettingUpdatesPropertiesCore(item); + } + + [Theory] + [PlatformSpecific(~TestPlatforms.Browser)] // Browser is excluded as it doesn't support symlinks + [InlineData(false)] + [InlineData(true)] + public void SettingUpdatesPropertiesOnSymlink(bool targetExists) + { + // This test is in this class since it needs all of the time functions. + // This test makes sure that the times are set on the symlink itself. + // It is needed as on OSX for example, the default for most APIs is + // to follow the symlink to completion and set the time on that entry + // instead (eg. the setattrlist will do this without the flag set). + // It is also the same case on unix, with the utimensat function. + // It is a theory since we test both the target existing and missing. + + T target = targetExists ? GetExistingItem() : GetMissingItem(); + + // When the target exists, we want to verify that its times don't change. + + T link = CreateSymlinkToItem(target); + if (!targetExists) + { + SettingUpdatesPropertiesCore(link); + } + else + { + // Get the target's initial times + IEnumerable timeFunctions = TimeFunctions(requiresRoundtripping: true); + DateTime[] initialTimes = timeFunctions.Select((funcs) => funcs.Getter(target)).ToArray(); + + SettingUpdatesPropertiesCore(link); + + // Ensure that we have the latest times. + if (target is FileSystemInfo fsi) + { + fsi.Refresh(); + } + + // Ensure the target's times haven't changed. + DateTime[] updatedTimes = timeFunctions.Select((funcs) => funcs.Getter(target)).ToArray(); + Assert.Equal(initialTimes, updatedTimes); + } + } + [Fact] [PlatformSpecific(~TestPlatforms.Browser)] // Browser is excluded as there is only 1 effective time store. public void SettingUpdatesPropertiesAfterAnother() diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs b/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs index b264ec4c3b60e2..1e12662b971ca0 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/Delete.cs @@ -290,5 +290,34 @@ public void RecursiveDelete_ShouldThrowIOExceptionIfContainedFileInUse() } Assert.True(testDir.Exists); } + + [ConditionalFact(nameof(CanCreateSymbolicLinks))] + public void RecursiveDeletingDoesntFollowLinks() + { + var target = GetTestFilePath(); + Directory.CreateDirectory(target); + + var fileInTarget = Path.Combine(target, GetTestFileName()); + File.WriteAllText(fileInTarget, ""); + + var linkParent = GetTestFilePath(); + Directory.CreateDirectory(linkParent); + + var linkPath = Path.Combine(linkParent, GetTestFileName()); + Assert.NotNull(Directory.CreateSymbolicLink(linkPath, target)); + + // Both the symlink and the target exist + Assert.True(Directory.Exists(target), "target should exist"); + Assert.True(Directory.Exists(linkPath), "linkPath should exist"); + Assert.True(File.Exists(fileInTarget), "fileInTarget should exist"); + + // Delete the parent folder of the symlink. + Delete(linkParent, true); + + // Target should still exist + Assert.True(Directory.Exists(target), "target should still exist"); + Assert.False(Directory.Exists(linkPath), "linkPath should no longer exist"); + Assert.True(File.Exists(fileInTarget), "fileInTarget should exist"); + } } } diff --git a/src/libraries/System.IO.FileSystem/tests/Directory/GetSetTimes.cs b/src/libraries/System.IO.FileSystem/tests/Directory/GetSetTimes.cs index 0a23d638c138af..698fbd1d67ce08 100644 --- a/src/libraries/System.IO.FileSystem/tests/Directory/GetSetTimes.cs +++ b/src/libraries/System.IO.FileSystem/tests/Directory/GetSetTimes.cs @@ -9,6 +9,8 @@ public class Directory_GetSetTimes : StaticGetSetTimes { protected override string GetExistingItem() => Directory.CreateDirectory(GetTestFilePath()).FullName; + protected override string CreateSymlink(string path, string pathToTarget) => Directory.CreateSymbolicLink(path, pathToTarget).FullName; + public override IEnumerable TimeFunctions(bool requiresRoundtripping = false) { if (IOInputs.SupportsGettingCreationTime && (!requiresRoundtripping || IOInputs.SupportsSettingCreationTime)) diff --git a/src/libraries/System.IO.FileSystem/tests/DirectoryInfo/GetSetTimes.cs b/src/libraries/System.IO.FileSystem/tests/DirectoryInfo/GetSetTimes.cs index 2dad268a79a460..795a8750e49bf2 100644 --- a/src/libraries/System.IO.FileSystem/tests/DirectoryInfo/GetSetTimes.cs +++ b/src/libraries/System.IO.FileSystem/tests/DirectoryInfo/GetSetTimes.cs @@ -11,6 +11,8 @@ public class DirectoryInfo_GetSetTimes : InfoGetSetTimes protected override DirectoryInfo GetMissingItem() => new DirectoryInfo(GetTestFilePath()); + protected override DirectoryInfo CreateSymlink(string path, string pathToTarget) => (DirectoryInfo)Directory.CreateSymbolicLink(path, pathToTarget); + protected override string GetItemPath(DirectoryInfo item) => item.FullName; protected override void InvokeCreate(DirectoryInfo item) => item.Create(); diff --git a/src/libraries/System.IO.FileSystem/tests/DisabledFileLockingTests/System.IO.FileSystem.DisabledFileLocking.Tests.csproj b/src/libraries/System.IO.FileSystem/tests/DisabledFileLockingTests/System.IO.FileSystem.DisabledFileLocking.Tests.csproj index b9739cb42fb81b..449a1c3cc2b611 100644 --- a/src/libraries/System.IO.FileSystem/tests/DisabledFileLockingTests/System.IO.FileSystem.DisabledFileLocking.Tests.csproj +++ b/src/libraries/System.IO.FileSystem/tests/DisabledFileLockingTests/System.IO.FileSystem.DisabledFileLocking.Tests.csproj @@ -20,6 +20,7 @@ + diff --git a/src/libraries/System.IO.FileSystem/tests/Enumeration/AttributeTests.cs b/src/libraries/System.IO.FileSystem/tests/Enumeration/AttributeTests.cs index 92f9a829d76d25..ea9d91345ff902 100644 --- a/src/libraries/System.IO.FileSystem/tests/Enumeration/AttributeTests.cs +++ b/src/libraries/System.IO.FileSystem/tests/Enumeration/AttributeTests.cs @@ -9,12 +9,26 @@ namespace System.IO.Tests.Enumeration { public class AttributeTests : FileSystemTest { - private class DefaultFileAttributes : FileSystemEnumerator + private class FileSystemEntryProperties { - public DefaultFileAttributes(string directory, EnumerationOptions options) + public string FileName { get; init; } + public FileAttributes Attributes { get; init; } + public DateTimeOffset CreationTimeUtc { get; init; } + public bool IsDirectory { get; init; } + public bool IsHidden { get; init; } + public DateTimeOffset LastAccessTimeUtc { get; init; } + public DateTimeOffset LastWriteTimeUtc { get; init; } + public long Length { get; init; } + public string Directory { get; init; } + public string FullPath { get; init; } + public string SpecifiedFullPath { get; init; } + } + + private class GetPropertiesEnumerator : FileSystemEnumerator + { + public GetPropertiesEnumerator(string directory, EnumerationOptions options) : base(directory, options) - { - } + { } protected override bool ContinueOnError(int error) { @@ -22,93 +36,148 @@ protected override bool ContinueOnError(int error) return false; } - protected override bool ShouldIncludeEntry(ref FileSystemEntry entry) - => !entry.IsDirectory; - - protected override string TransformEntry(ref FileSystemEntry entry) + protected override FileSystemEntryProperties TransformEntry(ref FileSystemEntry entry) { - string path = entry.ToFullPath(); - File.Delete(path); - - // Attributes require a stat call on Unix- ensure that we have the right attributes - // even if the returned file is deleted. - Assert.Equal(FileAttributes.Normal, entry.Attributes); - Assert.Equal(path, entry.ToFullPath()); - return new string(entry.FileName); + return new FileSystemEntryProperties + { + FileName = new string(entry.FileName), + Attributes = entry.Attributes, + CreationTimeUtc = entry.CreationTimeUtc, + IsDirectory = entry.IsDirectory, + IsHidden = entry.IsHidden, + LastAccessTimeUtc = entry.LastAccessTimeUtc, + LastWriteTimeUtc = entry.LastWriteTimeUtc, + Length = entry.Length, + Directory = new string(entry.Directory), + FullPath = entry.ToFullPath(), + SpecifiedFullPath = entry.ToSpecifiedFullPath() + }; } } - [Fact] - public void FileAttributesAreExpected() + // The test is performed using two items with different properties (file/dir, file length) + // to check cached values from the previous entry don't leak into the non-existing entry. + [InlineData("dir1", "dir2")] + [InlineData("dir1", "file2")] + [InlineData("dir1", "link2")] + [InlineData("file1", "file2")] + [InlineData("file1", "dir2")] + [InlineData("file1", "link2")] + [InlineData("link1", "file2")] + [InlineData("link1", "dir2")] + [InlineData("link1", "link2")] + [Theory] + public void PropertiesWhenItemNoLongerExists(string item1, string item2) { DirectoryInfo testDirectory = Directory.CreateDirectory(GetTestFilePath()); - FileInfo fileOne = new FileInfo(Path.Combine(testDirectory.FullName, GetTestFileName())); - - fileOne.Create().Dispose(); - - if (PlatformDetection.IsWindows) - { - // Archive should always be set on a new file. Clear it and other expected flags to - // see that we get "Normal" as the default when enumerating. - - Assert.True((fileOne.Attributes & FileAttributes.Archive) != 0); - fileOne.Attributes &= ~(FileAttributes.Archive | FileAttributes.NotContentIndexed); - } - - using (var enumerator = new DefaultFileAttributes(testDirectory.FullName, new EnumerationOptions())) - { - Assert.True(enumerator.MoveNext()); - Assert.Equal(fileOne.Name, enumerator.Current); - Assert.False(enumerator.MoveNext()); - } - } - private class DefaultDirectoryAttributes : FileSystemEnumerator - { - public DefaultDirectoryAttributes(string directory, EnumerationOptions options) - : base(directory, options) - { - } + FileSystemInfo item1Info = CreateItem(testDirectory, item1); + FileSystemInfo item2Info = CreateItem(testDirectory, item2); - protected override bool ShouldIncludeEntry(ref FileSystemEntry entry) - => entry.IsDirectory; - - protected override bool ContinueOnError(int error) + using (var enumerator = new GetPropertiesEnumerator(testDirectory.FullName, new EnumerationOptions() { AttributesToSkip = 0 })) { - Assert.False(true, $"Should not have errored {error}"); - return false; + // Move to the first item. + Assert.True(enumerator.MoveNext(), "Move first"); + FileSystemEntryProperties entry = enumerator.Current; + + Assert.True(entry.FileName == item1 || entry.FileName == item2, "Unexpected item"); + + // Delete both items. + DeleteItem(testDirectory, item1); + DeleteItem(testDirectory, item2); + + // Move to the second item. + FileSystemInfo expected = entry.FileName == item1 ? item2Info : item1Info; + Assert.True(enumerator.MoveNext(), "Move second"); + entry = enumerator.Current; + + // Names and paths. + Assert.Equal(expected.Name, entry.FileName); + Assert.Equal(testDirectory.FullName, entry.Directory); + Assert.Equal(expected.FullName, entry.FullPath); + Assert.Equal(expected.FullName, entry.SpecifiedFullPath); + + // Values determined during enumeration. + if (PlatformDetection.IsBrowser) + { + // For Browser, all items are typed as DT_UNKNOWN. + Assert.False(entry.IsDirectory); + Assert.Equal(entry.FileName.StartsWith('.') ? FileAttributes.Hidden : FileAttributes.Normal, entry.Attributes); + } + else + { + Assert.Equal(expected is DirectoryInfo, entry.IsDirectory); + Assert.Equal(expected.Attributes, entry.Attributes); + } + + if (PlatformDetection.IsWindows) + { + Assert.Equal((expected.Attributes & FileAttributes.Hidden) != 0, entry.IsHidden); + Assert.Equal(expected.CreationTimeUtc, entry.CreationTimeUtc); + Assert.Equal(expected.LastAccessTimeUtc, entry.LastAccessTimeUtc); + Assert.Equal(expected.LastWriteTimeUtc, entry.LastWriteTimeUtc); + if (expected is FileInfo fileInfo) + { + Assert.Equal(fileInfo.Length, entry.Length); + } + } + else + { + // On Unix, these values were not determined during enumeration. + // Because the file was deleted, the values can no longer be retrieved and sensible defaults are returned. + Assert.Equal(entry.FileName.StartsWith('.'), entry.IsHidden); + DateTimeOffset defaultTime = new DateTimeOffset(DateTime.FromFileTimeUtc(0)); + Assert.Equal(defaultTime, entry.CreationTimeUtc); + Assert.Equal(defaultTime, entry.LastAccessTimeUtc); + Assert.Equal(defaultTime, entry.LastWriteTimeUtc); + Assert.Equal(0, entry.Length); + } + + Assert.False(enumerator.MoveNext(), "Move final"); } - protected override string TransformEntry(ref FileSystemEntry entry) - { - string path = entry.ToFullPath(); - Directory.Delete(path); - - // Attributes require a stat call on Unix- ensure that we have the right attributes - // even if the returned directory is deleted. - Assert.Equal(FileAttributes.Directory, entry.Attributes); - Assert.Equal(path, entry.ToFullPath()); - return new string(entry.FileName); - } - } - - [Fact] - public void DirectoryAttributesAreExpected() - { - DirectoryInfo testDirectory = Directory.CreateDirectory(GetTestFilePath()); - DirectoryInfo subDirectory = Directory.CreateDirectory(Path.Combine(testDirectory.FullName, GetTestFileName())); - - if (PlatformDetection.IsWindows) + static FileSystemInfo CreateItem(DirectoryInfo testDirectory, string item) { - // Clear possible extra flags to see that we get Directory - subDirectory.Attributes &= ~FileAttributes.NotContentIndexed; + string fullPath = Path.Combine(testDirectory.FullName, item); + + // use the last char to have different lengths for different files. + Assert.True(item.EndsWith('1') || item.EndsWith('2')); + int length = (int)item[item.Length - 1]; + + if (item.StartsWith("dir")) + { + Directory.CreateDirectory(fullPath); + var info = new DirectoryInfo(fullPath); + info.Refresh(); + return info; + } + else if (item.StartsWith("link")) + { + File.CreateSymbolicLink(fullPath, new string('_', length)); + var info = new FileInfo(fullPath); + info.Refresh(); + return info; + } + else + { + File.WriteAllBytes(fullPath, new byte[length]); + var info = new FileInfo(fullPath); + info.Refresh(); + return info; + } } - using (var enumerator = new DefaultDirectoryAttributes(testDirectory.FullName, new EnumerationOptions())) + static void DeleteItem(DirectoryInfo testDirectory, string item) { - Assert.True(enumerator.MoveNext()); - Assert.Equal(subDirectory.Name, enumerator.Current); - Assert.False(enumerator.MoveNext()); + string fullPath = Path.Combine(testDirectory.FullName, item); + if (item.StartsWith("dir")) + { + Directory.Delete(fullPath); + } + else + { + File.Delete(fullPath); + } } } diff --git a/src/libraries/System.IO.FileSystem/tests/File/GetSetTimes.cs b/src/libraries/System.IO.FileSystem/tests/File/GetSetTimes.cs index 63373576e0be13..50dcf0990a0eb6 100644 --- a/src/libraries/System.IO.FileSystem/tests/File/GetSetTimes.cs +++ b/src/libraries/System.IO.FileSystem/tests/File/GetSetTimes.cs @@ -22,6 +22,8 @@ protected override string GetExistingItem() return path; } + protected override string CreateSymlink(string path, string pathToTarget) => File.CreateSymbolicLink(path, pathToTarget).FullName; + [Fact] [PlatformSpecific(TestPlatforms.Linux)] public void BirthTimeIsNotNewerThanLowestOfAccessModifiedTimes() diff --git a/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytes.cs b/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytes.cs index 679ff9b5b79868..39becd6d0d5145 100644 --- a/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytes.cs +++ b/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytes.cs @@ -72,6 +72,21 @@ public void ReadFileOver2GB() Assert.Throws(() => File.ReadAllBytes(path)); } + [Fact] + [OuterLoop] + [ActiveIssue("https://github.com/dotnet/runtime/issues/45954", TestPlatforms.Browser)] + public void ReadFileOverMaxArrayLength() + { + string path = GetTestFilePath(); + using (FileStream fs = File.Create(path)) + { + fs.SetLength(Array.MaxLength + 1L); + } + + // File is too large for ReadAllBytes at once + Assert.Throws(() => File.ReadAllBytes(path)); + } + [Fact] public void Overwrite() { diff --git a/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytesAsync.cs b/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytesAsync.cs index be562f15ca953a..6414ab2ad873c9 100644 --- a/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytesAsync.cs +++ b/src/libraries/System.IO.FileSystem/tests/File/ReadWriteAllBytesAsync.cs @@ -73,7 +73,7 @@ public Task AlreadyCanceledAsync() [Fact] [OuterLoop] [ActiveIssue("https://github.com/dotnet/runtime/issues/45954", TestPlatforms.Browser)] - public Task ReadFileOver2GBAsync() + public async Task ReadFileOver2GBAsync() { string path = GetTestFilePath(); using (FileStream fs = File.Create(path)) @@ -81,8 +81,23 @@ public Task ReadFileOver2GBAsync() fs.SetLength(int.MaxValue + 1L); } - // File is too large for ReadAllBytes at once - return Assert.ThrowsAsync(async () => await File.ReadAllBytesAsync(path)); + // File is too large for ReadAllBytesAsync at once + await Assert.ThrowsAsync(async () => await File.ReadAllBytesAsync(path)); + } + + [Fact] + [OuterLoop] + [ActiveIssue("https://github.com/dotnet/runtime/issues/45954", TestPlatforms.Browser)] + public async Task ReadFileOverMaxArrayLengthAsync() + { + string path = GetTestFilePath(); + using (FileStream fs = File.Create(path)) + { + fs.SetLength(Array.MaxLength + 1L); + } + + // File is too large for ReadAllBytesAsync at once + await Assert.ThrowsAsync(async () => await File.ReadAllBytesAsync(path)); } [Fact] diff --git a/src/libraries/System.IO.FileSystem/tests/FileInfo/CopyTo.cs b/src/libraries/System.IO.FileSystem/tests/FileInfo/CopyTo.cs index 99a0701e7a042f..49625c1f0c1934 100644 --- a/src/libraries/System.IO.FileSystem/tests/FileInfo/CopyTo.cs +++ b/src/libraries/System.IO.FileSystem/tests/FileInfo/CopyTo.cs @@ -5,6 +5,7 @@ namespace System.IO.Tests { + [ActiveIssue("https://github.com/dotnet/runtime/issues/58707", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowserOnWindows), nameof(PlatformDetection.IsMonoAOT))] public class FileInfo_CopyTo_str : File_Copy_str_str { protected override void Copy(string source, string dest) diff --git a/src/libraries/System.IO.FileSystem/tests/FileInfo/GetSetTimes.cs b/src/libraries/System.IO.FileSystem/tests/FileInfo/GetSetTimes.cs index d3b9764951cbfd..0559edc669e5d0 100644 --- a/src/libraries/System.IO.FileSystem/tests/FileInfo/GetSetTimes.cs +++ b/src/libraries/System.IO.FileSystem/tests/FileInfo/GetSetTimes.cs @@ -17,6 +17,8 @@ protected override FileInfo GetExistingItem() return new FileInfo(path); } + protected override FileInfo CreateSymlink(string path, string pathToTarget) => (FileInfo)File.CreateSymbolicLink(path, pathToTarget); + private static bool HasNonZeroNanoseconds(DateTime dt) => dt.Ticks % 10 != 0; public FileInfo GetNonZeroMilliseconds() diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/FileStreamConformanceTests.Windows.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/FileStreamConformanceTests.Windows.cs index 3d3e2d0307a8f3..6e694e43473696 100644 --- a/src/libraries/System.IO.FileSystem/tests/FileStream/FileStreamConformanceTests.Windows.cs +++ b/src/libraries/System.IO.FileSystem/tests/FileStream/FileStreamConformanceTests.Windows.cs @@ -77,7 +77,7 @@ protected override string GetTestFilePath(int? index = null, [CallerMemberName] } [PlatformSpecific(TestPlatforms.Windows)] // the test setup is Windows-specifc - [Collection("NoParallelTests")] // don't run in parallel, as file sharing logic is not thread-safe + [Collection(nameof(DisableParallelization))] // don't run in parallel, as file sharing logic is not thread-safe [OuterLoop("Requires admin privileges to create a file share")] [ConditionalClass(typeof(UncFilePathFileStreamStandaloneConformanceTests), nameof(CanShareFiles))] public class UncFilePathFileStreamStandaloneConformanceTests : UnbufferedAsyncFileStreamStandaloneConformanceTests diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/ctor_options.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/ctor_options.cs index c4344de517449d..bbae2fbb0e240b 100644 --- a/src/libraries/System.IO.FileSystem/tests/FileStream/ctor_options.cs +++ b/src/libraries/System.IO.FileSystem/tests/FileStream/ctor_options.cs @@ -10,7 +10,7 @@ namespace System.IO.Tests // Don't run in parallel as the WhenDiskIsFullTheErrorMessageContainsAllDetails test // consumes entire available free space on the disk (only on Linux, this is how posix_fallocate works) // and if we try to run other disk-writing test in the meantime we are going to get "No space left on device" exception. - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public partial class FileStream_ctor_options : FileStream_ctor_str_fm_fa_fs_buffer_fo { protected override string GetExpectedParamName(string paramName) => "value"; @@ -166,7 +166,4 @@ public void WhenDiskIsFullTheErrorMessageContainsAllDetails(FileMode mode) Assert.False(exists); } } - - [CollectionDefinition("NoParallelTests", DisableParallelization = true)] - public partial class NoParallelTests { } } diff --git a/src/libraries/System.IO.FileSystem/tests/PortedCommon/ReparsePointUtilities.cs b/src/libraries/System.IO.FileSystem/tests/PortedCommon/ReparsePointUtilities.cs index 8c7f3608d35ce2..87c96cfed7916d 100644 --- a/src/libraries/System.IO.FileSystem/tests/PortedCommon/ReparsePointUtilities.cs +++ b/src/libraries/System.IO.FileSystem/tests/PortedCommon/ReparsePointUtilities.cs @@ -61,61 +61,6 @@ public static bool CreateJunction(string junctionPath, string targetPath) return RunProcess(CreateProcessStartInfo("cmd", "/c", "mklink", "/J", junctionPath, targetPath)); } - /// - /// On Windows, mounts a folder to an assigned virtual drive letter using the subst command. - /// subst is not available in Windows Nano. - /// - public static char CreateVirtualDrive(string targetDir) - { - if (!OperatingSystem.IsWindows()) - { - throw new PlatformNotSupportedException(); - } - - char driveLetter = GetNextAvailableDriveLetter(); - bool success = RunProcess(CreateProcessStartInfo("cmd", "/c", SubstPath, $"{driveLetter}:", targetDir)); - if (!success || !DriveInfo.GetDrives().Any(x => x.Name[0] == driveLetter)) - { - throw new InvalidOperationException($"Could not create virtual drive {driveLetter}: with subst"); - } - return driveLetter; - - // Finds the next unused drive letter and returns it. - char GetNextAvailableDriveLetter() - { - List existingDrives = DriveInfo.GetDrives().Select(x => x.Name[0]).ToList(); - - // A,B are reserved, C is usually reserved - IEnumerable range = Enumerable.Range('D', 'Z' - 'D'); - IEnumerable castRange = range.Select(x => Convert.ToChar(x)); - IEnumerable allDrivesLetters = castRange.Except(existingDrives); - - if (!allDrivesLetters.Any()) - { - throw new ArgumentOutOfRangeException("No drive letters available"); - } - - return allDrivesLetters.First(); - } - } - - /// - /// On Windows, unassigns the specified virtual drive letter from its mounted folder. - /// - public static void DeleteVirtualDrive(char driveLetter) - { - if (!OperatingSystem.IsWindows()) - { - throw new PlatformNotSupportedException(); - } - - bool success = RunProcess(CreateProcessStartInfo("cmd", "/c", SubstPath, "/d", $"{driveLetter}:")); - if (!success || DriveInfo.GetDrives().Any(x => x.Name[0] == driveLetter)) - { - throw new InvalidOperationException($"Could not delete virtual drive {driveLetter}: with subst"); - } - } - public static void Mount(string volumeName, string mountPoint) { if (volumeName[volumeName.Length - 1] != Path.DirectorySeparatorChar) @@ -173,21 +118,6 @@ private static bool RunProcess(ProcessStartInfo startInfo) return process.ExitCode == 0; } - private static string SubstPath - { - get - { - if (!OperatingSystem.IsWindows()) - { - throw new PlatformNotSupportedException(); - } - - string systemRoot = Environment.GetEnvironmentVariable("SystemRoot") ?? @"C:\Windows"; - string system32 = Path.Join(systemRoot, "System32"); - return Path.Join(system32, "subst.exe"); - } - } - /// For standalone debugging help. Change Main0 to Main public static void Main0(string[] args) { 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 abf73ff35986c4..476bf05913ffcd 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 @@ -97,6 +97,7 @@ + @@ -216,6 +217,7 @@ + diff --git a/src/libraries/System.IO.FileSystem/tests/VirtualDriveSymbolicLinks.Windows.cs b/src/libraries/System.IO.FileSystem/tests/VirtualDriveSymbolicLinks.Windows.cs index d88425086b7024..fb9997e6ab17ea 100644 --- a/src/libraries/System.IO.FileSystem/tests/VirtualDriveSymbolicLinks.Windows.cs +++ b/src/libraries/System.IO.FileSystem/tests/VirtualDriveSymbolicLinks.Windows.cs @@ -11,17 +11,11 @@ namespace System.IO.Tests [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsSubstAvailable))] public class VirtualDrive_SymbolicLinks : BaseSymbolicLinks { + private VirtualDriveHelper VirtualDrive { get; } = new VirtualDriveHelper(); + protected override void Dispose(bool disposing) { - try - { - if (VirtualDriveLetter != default) - { - MountHelper.DeleteVirtualDrive(VirtualDriveLetter); - Directory.Delete(VirtualDriveTargetDir, recursive: true); - } - } - catch { } // avoid exceptions on dispose + VirtualDrive.Dispose(); base.Dispose(disposing); } @@ -210,38 +204,6 @@ public void VirtualDrive_SymbolicLinks_WithIndirection( Assert.Equal(expectedTargetDirectoryInfoFullName, targetFileInfoFromDirectory.FullName); } - private string GetVirtualOrRealPath(bool condition) => condition ? $"{VirtualDriveLetter}:" : VirtualDriveTargetDir; - - // Temporary Windows directory that can be mounted to a drive letter using the subst command - private string? _virtualDriveTargetDir = null; - private string VirtualDriveTargetDir - { - get - { - if (_virtualDriveTargetDir == null) - { - // Create a folder inside the temp directory so that it can be mounted to a drive letter with subst - _virtualDriveTargetDir = Path.Join(Path.GetTempPath(), GetRandomDirName()); - Directory.CreateDirectory(_virtualDriveTargetDir); - } - - return _virtualDriveTargetDir; - } - } - - // Windows drive letter that points to a mounted directory using the subst command - private char _virtualDriveLetter = default; - private char VirtualDriveLetter - { - get - { - if (_virtualDriveLetter == default) - { - // Mount the folder to a drive letter - _virtualDriveLetter = MountHelper.CreateVirtualDrive(VirtualDriveTargetDir); - } - return _virtualDriveLetter; - } - } + private string GetVirtualOrRealPath(bool condition) => condition ? $"{VirtualDrive.VirtualDriveLetter}:" : VirtualDrive.VirtualDriveTargetDir; } } diff --git a/src/libraries/System.IO.Hashing/src/System/IO/Hashing/XxHash32.cs b/src/libraries/System.IO.Hashing/src/System/IO/Hashing/XxHash32.cs index d6db9bae19b2e3..792a5bbbffb8df 100644 --- a/src/libraries/System.IO.Hashing/src/System/IO/Hashing/XxHash32.cs +++ b/src/libraries/System.IO.Hashing/src/System/IO/Hashing/XxHash32.cs @@ -215,7 +215,7 @@ private static int StaticHash(ReadOnlySpan source, Span destination, int totalLength = source.Length; State state = new State((uint)seed); - while (source.Length > StripeSize) + while (source.Length >= StripeSize) { state.ProcessStripe(source); source = source.Slice(StripeSize); diff --git a/src/libraries/System.IO.Hashing/src/System/IO/Hashing/XxHash64.cs b/src/libraries/System.IO.Hashing/src/System/IO/Hashing/XxHash64.cs index 990ed77d64de27..367c6213c25fe3 100644 --- a/src/libraries/System.IO.Hashing/src/System/IO/Hashing/XxHash64.cs +++ b/src/libraries/System.IO.Hashing/src/System/IO/Hashing/XxHash64.cs @@ -215,7 +215,7 @@ private static int StaticHash(ReadOnlySpan source, Span destination, int totalLength = source.Length; State state = new State((ulong)seed); - while (source.Length > StripeSize) + while (source.Length >= StripeSize) { state.ProcessStripe(source); source = source.Slice(StripeSize); diff --git a/src/libraries/System.IO.Hashing/tests/XxHash32Tests.007.cs b/src/libraries/System.IO.Hashing/tests/XxHash32Tests.007.cs index eed5aec365b3eb..9ec9262dd1c5d8 100644 --- a/src/libraries/System.IO.Hashing/tests/XxHash32Tests.007.cs +++ b/src/libraries/System.IO.Hashing/tests/XxHash32Tests.007.cs @@ -36,6 +36,8 @@ public static IEnumerable TestCases private const string DotNetHashesThis3 = DotNetHashesThis + DotNetHashesThis + DotNetHashesThis; private const string DotNetNCHashing = ".NET now has non-crypto hashing"; private const string DotNetNCHashing3 = DotNetNCHashing + DotNetNCHashing + DotNetNCHashing; + private const string SixteenBytes = ".NET Hashes This"; + private const string SixteenBytes3 = SixteenBytes + SixteenBytes + SixteenBytes; protected static IEnumerable TestCaseDefinitions { get; } = new[] @@ -77,6 +79,11 @@ public static IEnumerable TestCases $"{DotNetNCHashing} (x3)", Encoding.ASCII.GetBytes(DotNetNCHashing3), "CABC8ABD"), + // stripe size + new TestCase( + $"{SixteenBytes} (x3)", + Encoding.ASCII.GetBytes(SixteenBytes3), + "AD98EBD3") }; protected override NonCryptographicHashAlgorithm CreateInstance() => new XxHash32(Seed); diff --git a/src/libraries/System.IO.Hashing/tests/XxHash32Tests.cs b/src/libraries/System.IO.Hashing/tests/XxHash32Tests.cs index f9dccad0294028..abd77d8c22f97d 100644 --- a/src/libraries/System.IO.Hashing/tests/XxHash32Tests.cs +++ b/src/libraries/System.IO.Hashing/tests/XxHash32Tests.cs @@ -34,6 +34,8 @@ public static IEnumerable TestCases private const string DotNetHashesThis3 = DotNetHashesThis + DotNetHashesThis + DotNetHashesThis; private const string DotNetNCHashing = ".NET now has non-crypto hashing"; private const string DotNetNCHashing3 = DotNetNCHashing + DotNetNCHashing + DotNetNCHashing; + private const string SixteenBytes = ".NET Hashes This"; + private const string SixteenBytes3 = SixteenBytes + SixteenBytes + SixteenBytes; protected static IEnumerable TestCaseDefinitions { get; } = new[] @@ -90,6 +92,11 @@ public static IEnumerable TestCases $"{DotNetNCHashing} (x3)", Encoding.ASCII.GetBytes(DotNetNCHashing3), "65242024"), + // stripe size + new TestCase( + $"{SixteenBytes} (x3)", + Encoding.ASCII.GetBytes(SixteenBytes3), + "29DA7472") }; protected override NonCryptographicHashAlgorithm CreateInstance() => new XxHash32(); diff --git a/src/libraries/System.IO.Hashing/tests/XxHash32Tests.f00d.cs b/src/libraries/System.IO.Hashing/tests/XxHash32Tests.f00d.cs index 5171e62f8ca562..4a116bc50354e0 100644 --- a/src/libraries/System.IO.Hashing/tests/XxHash32Tests.f00d.cs +++ b/src/libraries/System.IO.Hashing/tests/XxHash32Tests.f00d.cs @@ -36,6 +36,8 @@ public static IEnumerable TestCases private const string DotNetHashesThis3 = DotNetHashesThis + DotNetHashesThis + DotNetHashesThis; private const string DotNetNCHashing = ".NET now has non-crypto hashing"; private const string DotNetNCHashing3 = DotNetNCHashing + DotNetNCHashing + DotNetNCHashing; + private const string SixteenBytes = ".NET Hashes This"; + private const string SixteenBytes3 = SixteenBytes + SixteenBytes + SixteenBytes; protected static IEnumerable TestCaseDefinitions { get; } = new[] @@ -77,6 +79,11 @@ public static IEnumerable TestCases $"{DotNetNCHashing} (x3)", Encoding.ASCII.GetBytes(DotNetNCHashing3), "5A513E6D"), + // stripe size + new TestCase( + $"{SixteenBytes} (x3)", + Encoding.ASCII.GetBytes(SixteenBytes3), + "B38A9A45") }; protected override NonCryptographicHashAlgorithm CreateInstance() => new XxHash32(Seed); diff --git a/src/libraries/System.IO.Hashing/tests/XxHash64Tests.007.cs b/src/libraries/System.IO.Hashing/tests/XxHash64Tests.007.cs index 5c2e575377870d..836b29230f3e67 100644 --- a/src/libraries/System.IO.Hashing/tests/XxHash64Tests.007.cs +++ b/src/libraries/System.IO.Hashing/tests/XxHash64Tests.007.cs @@ -38,6 +38,8 @@ public static IEnumerable TestCases private const string DotNetNCHashing = ".NET now has non-crypto hashing"; private const string SixtyThreeBytes = "A sixty-three byte test input requires substantial forethought!"; private const string SixtyThreeBytes3 = SixtyThreeBytes + SixtyThreeBytes + SixtyThreeBytes; + private const string ThirtyTwoBytes = "This string has 32 ASCII bytes.."; + private const string ThirtyTwoBytes3 = ThirtyTwoBytes + ThirtyTwoBytes + ThirtyTwoBytes; protected static IEnumerable TestCaseDefinitions { get; } = new[] @@ -87,6 +89,11 @@ public static IEnumerable TestCases $"{SixtyThreeBytes} (x3)", Encoding.ASCII.GetBytes(SixtyThreeBytes3), "D6095B93EB10BEDA"), + // stripe size + new TestCase( + $"{ThirtyTwoBytes} (x3)", + Encoding.ASCII.GetBytes(ThirtyTwoBytes3), + "45116421CF932B1F") }; protected override NonCryptographicHashAlgorithm CreateInstance() => new XxHash64(Seed); diff --git a/src/libraries/System.IO.Hashing/tests/XxHash64Tests.cs b/src/libraries/System.IO.Hashing/tests/XxHash64Tests.cs index 973d108fc93778..213e6f91c252cf 100644 --- a/src/libraries/System.IO.Hashing/tests/XxHash64Tests.cs +++ b/src/libraries/System.IO.Hashing/tests/XxHash64Tests.cs @@ -36,6 +36,8 @@ public static IEnumerable TestCases private const string DotNetNCHashing = ".NET now has non-crypto hashing"; private const string SixtyThreeBytes = "A sixty-three byte test input requires substantial forethought!"; private const string SixtyThreeBytes3 = SixtyThreeBytes + SixtyThreeBytes + SixtyThreeBytes; + private const string ThirtyTwoBytes = "This string has 32 ASCII bytes.."; + private const string ThirtyTwoBytes3 = ThirtyTwoBytes + ThirtyTwoBytes + ThirtyTwoBytes; protected static IEnumerable TestCaseDefinitions { get; } = new[] @@ -103,6 +105,11 @@ public static IEnumerable TestCases $"{SixtyThreeBytes} (x3)", Encoding.ASCII.GetBytes(SixtyThreeBytes3), "239C7B3A85BD22B3"), + // stripe size + new TestCase( + $"{ThirtyTwoBytes} (x3)", + Encoding.ASCII.GetBytes(ThirtyTwoBytes3), + "975E3E6FE7E67FBC") }; protected override NonCryptographicHashAlgorithm CreateInstance() => new XxHash64(); diff --git a/src/libraries/System.IO.Hashing/tests/XxHash64Tests.f00d.cs b/src/libraries/System.IO.Hashing/tests/XxHash64Tests.f00d.cs index 23006a571627b3..75fc4f514aca9a 100644 --- a/src/libraries/System.IO.Hashing/tests/XxHash64Tests.f00d.cs +++ b/src/libraries/System.IO.Hashing/tests/XxHash64Tests.f00d.cs @@ -38,6 +38,8 @@ public static IEnumerable TestCases private const string DotNetNCHashing = ".NET now has non-crypto hashing"; private const string SixtyThreeBytes = "A sixty-three byte test input requires substantial forethought!"; private const string SixtyThreeBytes3 = SixtyThreeBytes + SixtyThreeBytes + SixtyThreeBytes; + private const string ThirtyTwoBytes = "This string has 32 ASCII bytes.."; + private const string ThirtyTwoBytes3 = ThirtyTwoBytes + ThirtyTwoBytes + ThirtyTwoBytes; protected static IEnumerable TestCaseDefinitions { get; } = new[] @@ -87,6 +89,11 @@ public static IEnumerable TestCases $"{SixtyThreeBytes} (x3)", Encoding.ASCII.GetBytes(SixtyThreeBytes3), "6F1C62EB48EA2FEC"), + // stripe size + new TestCase( + $"{ThirtyTwoBytes} (x3)", + Encoding.ASCII.GetBytes(ThirtyTwoBytes3), + "B358EB96B8E3E7AD") }; protected override NonCryptographicHashAlgorithm CreateInstance() => new XxHash64(Seed); 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 81fe94cf1e975a..9d75e10c13bd6c 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 @@ -3,6 +3,7 @@ true true $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser + true 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 ae48db64440d4e..d597398efb25a5 100644 --- a/src/libraries/System.IO.Pipes/src/System.IO.Pipes.csproj +++ b/src/libraries/System.IO.Pipes/src/System.IO.Pipes.csproj @@ -137,8 +137,6 @@ Link="Common\Interop\Unix\Interop.GetHostName.cs" /> - - + 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 2fa979b222a81f..f4f0caca1c562f 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 @@ -434,23 +434,6 @@ private SemaphoreSlim EnsureAsyncActiveSemaphoreInitialized() return LazyInitializer.EnsureInitialized(ref _asyncActiveSemaphore, () => new SemaphoreSlim(1, 1)); } - private static void CreateDirectory(string directoryPath) - { - int result = Interop.Sys.MkDir(directoryPath, (int)Interop.Sys.Permissions.Mask); - - // If successful created, we're done. - if (result >= 0) - return; - - // If the directory already exists, consider it a success. - Interop.ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); - if (errorInfo.Error == Interop.Error.EEXIST) - return; - - // Otherwise, fail. - throw Interop.GetExceptionForIoErrno(errorInfo, directoryPath, isDirectory: true); - } - /// Creates an anonymous pipe. /// The resulting reader end of the pipe. /// The resulting writer end of the pipe. 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 a576730127f684..d9b6355b234af3 100644 --- a/src/libraries/System.IO.Ports/src/System.IO.Ports.csproj +++ b/src/libraries/System.IO.Ports/src/System.IO.Ports.csproj @@ -142,10 +142,11 @@ System.IO.Ports.SerialPort - + + diff --git a/src/libraries/System.IO.Ports/tests/SerialPort/Parity.cs b/src/libraries/System.IO.Ports/tests/SerialPort/Parity.cs index 1cea85042f7765..ae1514fd2bcf30 100644 --- a/src/libraries/System.IO.Ports/tests/SerialPort/Parity.cs +++ b/src/libraries/System.IO.Ports/tests/SerialPort/Parity.cs @@ -348,7 +348,7 @@ private void VerifyParity(SerialPort com1, int numBytesToSend, int dataBits) byte shiftMask = 0xFF; //Create a mask that when logicaly and'd with the transmitted byte will - //will result in the byte recievied due to the leading bits being chopped + //will result in the byte received due to the leading bits being chopped //off due to Parity less then 8 if (8 > dataBits) shiftMask >>= 8 - com1.DataBits; @@ -394,7 +394,7 @@ private void VerifyReadParity(int parity, int dataBits, int numBytesToSend) com2.StopBits = StopBits.One; //Create a mask that when logicaly and'd with the transmitted byte will - //will result in the byte recievied due to the leading bits being chopped + //will result in the byte received due to the leading bits being chopped //off due to Parity less then 8 shiftMask >>= 8 - dataBits; @@ -545,7 +545,7 @@ private void PerformWriteRead(SerialPort com1, SerialPort com2, byte[] xmitBytes Debug.WriteLine("Bytes Sent:"); TCSupport.PrintBytes(xmitBytes); - Debug.WriteLine("Bytes Recieved:"); + Debug.WriteLine("Bytes Received:"); TCSupport.PrintBytes(rcvBytes); Debug.WriteLine("Expected Bytes:"); diff --git a/src/libraries/System.Linq.Expressions/src/ILLink/ILLink.Substitutions.IsInterpreting.LibraryBuild.xml b/src/libraries/System.Linq.Expressions/src/ILLink/ILLink.Substitutions.IsInterpreting.LibraryBuild.xml new file mode 100644 index 00000000000000..67051cc12615dc --- /dev/null +++ b/src/libraries/System.Linq.Expressions/src/ILLink/ILLink.Substitutions.IsInterpreting.LibraryBuild.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/libraries/System.Linq.Expressions/src/ILLink/ILLink.Substitutions.xml b/src/libraries/System.Linq.Expressions/src/ILLink/ILLink.Substitutions.xml new file mode 100644 index 00000000000000..2847ed81708c21 --- /dev/null +++ b/src/libraries/System.Linq.Expressions/src/ILLink/ILLink.Substitutions.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/libraries/System.Linq.Expressions/src/MatchingRefApiCompatBaseline.txt b/src/libraries/System.Linq.Expressions/src/MatchingRefApiCompatBaseline.txt index 23c307afa036c2..855d90ec23c39e 100644 --- a/src/libraries/System.Linq.Expressions/src/MatchingRefApiCompatBaseline.txt +++ b/src/libraries/System.Linq.Expressions/src/MatchingRefApiCompatBaseline.txt @@ -15,4 +15,6 @@ TypesMustExist : Type 'System.Linq.Expressions.Interpreter.LightLambda' does not TypesMustExist : Type 'System.Runtime.CompilerServices.CallSiteOps' does not exist in the reference but it does exist in the implementation. TypesMustExist : Type 'System.Runtime.CompilerServices.Closure' does not exist in the reference but it does exist in the implementation. TypesMustExist : Type 'System.Runtime.CompilerServices.RuntimeOps' does not exist in the reference but it does exist in the implementation. -Total Issues: 16 +MembersMustExist : Member 'public System.Boolean System.Linq.Expressions.LambdaExpression.CanCompileToIL.get()' does not exist in the reference but it does exist in the implementation. +MembersMustExist : Member 'public System.Boolean System.Linq.Expressions.LambdaExpression.CanInterpret.get()' does not exist in the reference but it does exist in the implementation. +Total Issues: 18 diff --git a/src/libraries/System.Linq.Expressions/src/System.Linq.Expressions.csproj b/src/libraries/System.Linq.Expressions/src/System.Linq.Expressions.csproj index 0a9d7eba08b66c..dce8fedbf2ac8c 100644 --- a/src/libraries/System.Linq.Expressions/src/System.Linq.Expressions.csproj +++ b/src/libraries/System.Linq.Expressions/src/System.Linq.Expressions.csproj @@ -1,14 +1,22 @@ - true $(NetCoreAppCurrent);$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-MacCatalyst enable false true - $(DefineConstants);FEATURE_DLG_INVOKE;FEATURE_FAST_CREATE - $(DefineConstants);FEATURE_COMPILE - $(DefineConstants);FEATURE_INTERPRET + ILLink\ILLink.Substitutions.IsInterpreting.LibraryBuild.xml + $(DefineConstants);FEATURE_FAST_CREATE + + + true + + + @@ -125,7 +133,7 @@ - + @@ -157,7 +165,7 @@ - + diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.cs index f54a21adb7a4f3..2969348e143dc2 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.cs @@ -7,7 +7,6 @@ namespace System.Dynamic { internal static partial class UpdateDelegates { -#if FEATURE_COMPILE [Obsolete("pregenerated CallSite.Update delegate", error: true)] internal static TRet UpdateAndExecute1(CallSite site, T0 arg0) { @@ -2895,6 +2894,5 @@ internal static void NoMatchVoid10(CallS site._match = false; return; } -#endif } } diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.tt b/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.tt index 44c6c3fc628023..ae41482f948999 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.tt +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.tt @@ -13,7 +13,6 @@ namespace System.Dynamic { internal static partial class UpdateDelegates { -#if FEATURE_COMPILE <# for (int i = 1; i <= 10; i++) { @@ -330,6 +329,5 @@ for (int i = 1; i <= 10; i++) } } #> -#endif } } diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/DelegateHelpers.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/DelegateHelpers.cs index cd3446767c6336..b46fa676828916 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/DelegateHelpers.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/DelegateHelpers.cs @@ -3,28 +3,43 @@ using System.Diagnostics.CodeAnalysis; using System.Reflection; - -#if !FEATURE_DYNAMIC_DELEGATE using System.Reflection.Emit; using System.Text; using System.Threading; -#endif namespace System.Dynamic.Utils { internal static class DelegateHelpers { - internal static Delegate CreateObjectArrayDelegate(Type delegateType, Func handler) + // This can be flipped to true using feature switches at publishing time + internal static bool CanEmitObjectArrayDelegate => true; + + // Separate class so that the it can be trimmed away and doesn't get conflated + // with the Reflection.Emit statics below. + private static class DynamicDelegateLightup { -#if !FEATURE_DYNAMIC_DELEGATE - return CreateObjectArrayDelegateRefEmit(delegateType, handler); -#else - return Internal.Runtime.Augments.DynamicDelegateAugments.CreateObjectArrayDelegate(delegateType, handler); -#endif + public static Func, Delegate> CreateObjectArrayDelegate { get; } + = CreateObjectArrayDelegateInternal(); + + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2075:UnrecognizedReflectionPattern", + Justification = "Works around https://github.com/dotnet/linker/issues/2392")] + private static Func, Delegate> CreateObjectArrayDelegateInternal() + => Type.GetType("Internal.Runtime.Augments.DynamicDelegateAugments")! + .GetMethod("CreateObjectArrayDelegate")! + .CreateDelegate, Delegate>>(); } - -#if !FEATURE_DYNAMIC_DELEGATE + internal static Delegate CreateObjectArrayDelegate(Type delegateType, Func handler) + { + if (CanEmitObjectArrayDelegate) + { + return CreateObjectArrayDelegateRefEmit(delegateType, handler); + } + else + { + return DynamicDelegateLightup.CreateObjectArrayDelegate(delegateType, handler); + } + } private static readonly CacheDict s_thunks = new CacheDict(256); private static readonly MethodInfo s_FuncInvoke = typeof(Func).GetMethod("Invoke")!; @@ -290,7 +305,5 @@ private static Type ConvertToBoxableType(Type t) { return (t.IsPointer) ? typeof(IntPtr) : t; } - -#endif } } diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeExtensions.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeExtensions.cs index 4b57dba01726aa..71244b2a67d85b 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeExtensions.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeExtensions.cs @@ -80,7 +80,6 @@ internal static ParameterInfo[] GetParametersCached(this MethodBase method) return pis; } -#if FEATURE_COMPILE // Expression trees/compiler just use IsByRef, why do we need this? // (see LambdaCompiler.EmitArguments for usage in the compiler) internal static bool IsByRefParameter(this ParameterInfo pi) @@ -91,6 +90,5 @@ internal static bool IsByRefParameter(this ParameterInfo pi) return (pi.Attributes & ParameterAttributes.Out) == ParameterAttributes.Out; } -#endif } } diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs index f676a13dce7ee3..1d0fca59e30680 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs @@ -911,8 +911,6 @@ public static MethodInfo GetInvokeMethod(this Type delegateType) return delegateType.GetMethod("Invoke", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)!; } -#if FEATURE_COMPILE - internal static bool IsUnsigned(this Type type) => IsUnsigned(GetNonNullableType(type).GetTypeCode()); internal static bool IsUnsigned(this TypeCode typeCode) @@ -946,8 +944,6 @@ internal static bool IsFloatingPoint(this TypeCode typeCode) } } -#endif - [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2070:UnrecognizedReflectionPattern", Justification = "The Array 'Get' method is dynamically constructed and is not included in IL. It is not subject to trimming.")] public static MethodInfo GetArrayGetMethod(Type arrayType) diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Common/CachedReflectionInfo.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Common/CachedReflectionInfo.cs index 752ed754007c11..f26c16b3e448ae 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Common/CachedReflectionInfo.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Common/CachedReflectionInfo.cs @@ -159,7 +159,6 @@ public static FieldInfo DateTime_MinValue (s_Math_Pow_Double_Double = typeof(Math).GetMethod(nameof(Math.Pow), new[] { typeof(double), typeof(double) })!); // Closure and RuntimeOps helpers are used only in the compiler. -#if FEATURE_COMPILE private static ConstructorInfo? s_Closure_ObjectArray_ObjectArray; public static ConstructorInfo Closure_ObjectArray_ObjectArray => s_Closure_ObjectArray_ObjectArray ?? @@ -194,6 +193,5 @@ public static FieldInfo DateTime_MinValue public static MethodInfo RuntimeOps_Quote => s_RuntimeOps_Quote ?? (s_RuntimeOps_Quote = typeof(RuntimeOps).GetMethod(nameof(RuntimeOps.Quote))!); -#endif } } diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.Generated.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.Generated.cs index 6e6a915e76e98e..8884a2774951ae 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.Generated.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.Generated.cs @@ -84,8 +84,6 @@ private static TypeInfo NextTypeInfo(Type initialArg, TypeInfo curTypeInfo) return nextTypeInfo; } -#if !FEATURE_COMPILE - public delegate object VBCallSiteDelegate0(T callSite, object instance); public delegate object VBCallSiteDelegate1(T callSite, object instance, ref object arg1); public delegate object VBCallSiteDelegate2(T callSite, object instance, ref object arg1, ref object arg2); @@ -95,7 +93,6 @@ private static TypeInfo NextTypeInfo(Type initialArg, TypeInfo curTypeInfo) public delegate object VBCallSiteDelegate6(T callSite, object instance, ref object arg1, ref object arg2, ref object arg3, ref object arg4, ref object arg5, ref object arg6); public delegate object VBCallSiteDelegate7(T callSite, object instance, ref object arg1, ref object arg2, ref object arg3, ref object arg4, ref object arg5, ref object arg6, ref object arg7); - private static Type TryMakeVBStyledCallSite(Type[] types) { // Shape of VB CallSiteDelegates is CallSite * (instance : obj) * [arg-n : byref obj] -> obj @@ -128,7 +125,6 @@ private static Type TryMakeVBStyledCallSite(Type[] types) default: return null; } } -#endif /// /// Creates a new delegate, or uses a func/action @@ -163,11 +159,14 @@ internal static Type MakeNewDelegate(Type[] types) if (needCustom) { -#if FEATURE_COMPILE - return MakeNewCustomDelegate(types); -#else - return TryMakeVBStyledCallSite(types) ?? MakeNewCustomDelegate(types); -#endif + if (LambdaExpression.CanCompileToIL) + { + return MakeNewCustomDelegate(types); + } + else + { + return TryMakeVBStyledCallSite(types) ?? MakeNewCustomDelegate(types); + } } Type result; diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.cs index f1cb6e844bb901..35dae2e3a1102c 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.cs @@ -107,26 +107,27 @@ private static bool IsByRef(DynamicMetaObject mo) return mo.Expression is ParameterExpression pe && pe.IsByRef; } -#if FEATURE_COMPILE - private const MethodAttributes CtorAttributes = MethodAttributes.RTSpecialName | MethodAttributes.HideBySig | MethodAttributes.Public; - private const MethodImplAttributes ImplAttributes = MethodImplAttributes.Runtime | MethodImplAttributes.Managed; - private const MethodAttributes InvokeAttributes = MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.NewSlot | MethodAttributes.Virtual; - private static readonly Type[] s_delegateCtorSignature = { typeof(object), typeof(IntPtr) }; -#endif - private static Type MakeNewCustomDelegate(Type[] types) { -#if FEATURE_COMPILE - Type returnType = types[types.Length - 1]; - Type[] parameters = types.RemoveLast(); - - TypeBuilder builder = AssemblyGen.DefineDelegateType("Delegate" + types.Length); - builder.DefineConstructor(CtorAttributes, CallingConventions.Standard, s_delegateCtorSignature).SetImplementationFlags(ImplAttributes); - builder.DefineMethod("Invoke", InvokeAttributes, returnType, parameters).SetImplementationFlags(ImplAttributes); - return builder.CreateTypeInfo()!; -#else - throw new PlatformNotSupportedException(); -#endif + if (LambdaExpression.CanCompileToIL) + { + Type returnType = types[types.Length - 1]; + Type[] parameters = types.RemoveLast(); + Type[] delegateCtorSignature = { typeof(object), typeof(IntPtr) }; + + const MethodAttributes ctorAttributes = MethodAttributes.RTSpecialName | MethodAttributes.HideBySig | MethodAttributes.Public; + const MethodImplAttributes implAttributes = MethodImplAttributes.Runtime | MethodImplAttributes.Managed; + const MethodAttributes invokeAttributes = MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.NewSlot | MethodAttributes.Virtual; + + TypeBuilder builder = AssemblyGen.DefineDelegateType("Delegate" + types.Length); + builder.DefineConstructor(ctorAttributes, CallingConventions.Standard, delegateCtorSignature).SetImplementationFlags(implAttributes); + builder.DefineMethod("Invoke", invokeAttributes, returnType, parameters).SetImplementationFlags(implAttributes); + return builder.CreateTypeInfo()!; + } + else + { + throw new PlatformNotSupportedException(); + } } } } diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.Generated.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.Generated.cs index e9855aebed6348..34203b5512d280 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.Generated.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.Generated.cs @@ -13,9 +13,7 @@ namespace System.Linq.Expressions.Interpreter { internal partial class CallInstruction { -#if FEATURE_DLG_INVOKE private const int MaxHelpers = 5; -#endif #if FEATURE_FAST_CREATE private const int MaxArgs = 3; @@ -158,7 +156,6 @@ private static CallInstruction FastCreate(MethodInfo target, ParameterIn } #endif -#if FEATURE_DLG_INVOKE [return: DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes.PublicConstructors)] private static Type GetHelperType(MethodInfo info, Type[] arrTypes) { @@ -211,10 +208,8 @@ private static Type GetHelperType(MethodInfo info, Type[] arrTypes) } return t; } -#endif } -#if FEATURE_DLG_INVOKE internal sealed class ActionCallInstruction : CallInstruction { private readonly Action _target; @@ -577,6 +572,4 @@ public override int Run(InterpretedFrame frame) public override string ToString() => "Call(" + _target.Method + ")"; } - -#endif } diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.cs index f10233360deb07..42ecb44bb84896 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.cs @@ -16,13 +16,13 @@ internal abstract partial class CallInstruction : Instruction /// public abstract int ArgumentCount { get; } + private static bool CanCreateArbitraryDelegates => true; + #region Construction public override string InstructionName => "Call"; -#if FEATURE_DLG_INVOKE private static readonly CacheDict s_cache = new CacheDict(256); -#endif public static CallInstruction Create(MethodInfo info) { @@ -47,9 +47,9 @@ public static CallInstruction Create(MethodInfo info, ParameterInfo[] parameters return GetArrayAccessor(info, argumentCount); } -#if !FEATURE_DLG_INVOKE - return new MethodInfoCallInstruction(info, argumentCount); -#else + if (!CanCreateArbitraryDelegates) + return new MethodInfoCallInstruction(info, argumentCount); + if (!info.IsStatic && info.DeclaringType!.IsValueType) { return new MethodInfoCallInstruction(info, argumentCount); @@ -119,7 +119,6 @@ public static CallInstruction Create(MethodInfo info, ParameterInfo[] parameters } return res; -#endif } private static CallInstruction GetArrayAccessor(MethodInfo info, int argumentCount) @@ -171,12 +170,11 @@ public static void ArrayItemSetter3(Array array, int index0, int index1, int ind { array.SetValue(value, index0, index1, index2); } -#if FEATURE_DLG_INVOKE + private static bool ShouldCache(MethodInfo info) { return true; } -#endif #if FEATURE_FAST_CREATE /// @@ -215,7 +213,6 @@ private static bool IndexIsNotReturnType(int index, MethodInfo target, Parameter } #endif -#if FEATURE_DLG_INVOKE /// /// Uses reflection to create new instance of the appropriate ReflectedCaller /// @@ -243,7 +240,6 @@ private static CallInstruction SlowCreate(MethodInfo info, ParameterInfo[] pis) throw ContractUtils.Unreachable; } } -#endif #endregion diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/LambdaExpression.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/LambdaExpression.cs index 0c591d6f3ae058..35c0c9cb92874b 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/LambdaExpression.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/LambdaExpression.cs @@ -25,6 +25,12 @@ public abstract class LambdaExpression : Expression, IParameterProvider private readonly Expression _body; + // This can be flipped to false using feature switches at publishing time + public static bool CanCompileToIL => true; + + // This could be flipped to false using feature switches at publishing time + public static bool CanInterpret => true; + internal LambdaExpression(Expression body) { _body = body; @@ -130,11 +136,15 @@ internal static MethodInfo GetCompileMethod(Type lambdaExpressionType) /// A delegate containing the compiled version of the lambda. public Delegate Compile() { -#if FEATURE_COMPILE - return Compiler.LambdaCompiler.Compile(this); -#else - return new Interpreter.LightCompiler().CompileTop(this).CreateDelegate(); -#endif + if (CanCompileToIL) + { + return Compiler.LambdaCompiler.Compile(this); + } + else + { + Debug.Assert(CanInterpret); + return new Interpreter.LightCompiler().CompileTop(this).CreateDelegate(); + } } /// @@ -144,12 +154,11 @@ public Delegate Compile() /// A delegate containing the compiled version of the lambda. public Delegate Compile(bool preferInterpretation) { -#if FEATURE_COMPILE && FEATURE_INTERPRET - if (preferInterpretation) + if (CanCompileToIL && CanInterpret && preferInterpretation) { return new Interpreter.LightCompiler().CompileTop(this).CreateDelegate(); } -#endif + return Compile(); } @@ -169,10 +178,7 @@ public void CompileToMethod(System.Reflection.Emit.MethodBuilder method) } #endif - -#if FEATURE_COMPILE internal abstract LambdaExpression Accept(Compiler.StackSpiller spiller); -#endif /// /// Produces a delegate that represents the lambda expression. @@ -210,11 +216,15 @@ internal Expression(Expression body) /// A delegate containing the compiled version of the lambda. public new TDelegate Compile() { -#if FEATURE_COMPILE - return (TDelegate)(object)Compiler.LambdaCompiler.Compile(this); -#else - return (TDelegate)(object)new Interpreter.LightCompiler().CompileTop(this).CreateDelegate(); -#endif + if (CanCompileToIL) + { + return (TDelegate)(object)Compiler.LambdaCompiler.Compile(this); + } + else + { + Debug.Assert(CanInterpret); + return (TDelegate)(object)new Interpreter.LightCompiler().CompileTop(this).CreateDelegate(); + } } /// @@ -224,12 +234,11 @@ internal Expression(Expression body) /// A delegate containing the compiled version of the lambda. public new TDelegate Compile(bool preferInterpretation) { -#if FEATURE_COMPILE && FEATURE_INTERPRET - if (preferInterpretation) + if (CanCompileToIL && CanInterpret && preferInterpretation) { return (TDelegate)(object)new Interpreter.LightCompiler().CompileTop(this).CreateDelegate(); } -#endif + return Compile(); } @@ -290,7 +299,6 @@ protected internal override Expression Accept(ExpressionVisitor visitor) return visitor.VisitLambda(this); } -#if FEATURE_COMPILE internal override LambdaExpression Accept(Compiler.StackSpiller spiller) { return spiller.Rewrite(this); @@ -312,7 +320,6 @@ internal static Expression Create(Expression body, string? name, bool return new FullExpression(body, name, tailCall, parameters); } -#endif /// /// Produces a delegate that represents the lambda expression. @@ -325,7 +332,6 @@ internal static Expression Create(Expression body, string? name, bool } } -#if !FEATURE_COMPILE // Separate expression creation class to hide the CreateExpressionFunc function from users reflecting on Expression internal static class ExpressionCreator { @@ -346,7 +352,6 @@ public static Expression CreateExpressionFunc(Expression body, string return new FullExpression(body, name, tailCall, parameters); } } -#endif internal sealed class Expression0 : Expression { @@ -616,11 +621,16 @@ internal static LambdaExpression CreateLambda(Type delegateType, Expression body if (!factories.TryGetValue(delegateType, out fastPath)) { -#if FEATURE_COMPILE - MethodInfo create = typeof(Expression<>).MakeGenericType(delegateType).GetMethod("Create", BindingFlags.Static | BindingFlags.NonPublic)!; -#else - MethodInfo create = typeof(ExpressionCreator<>).MakeGenericType(delegateType).GetMethod("CreateExpressionFunc", BindingFlags.Static | BindingFlags.Public)!; -#endif + MethodInfo create; + if (LambdaExpression.CanCompileToIL) + { + create = typeof(Expression<>).MakeGenericType(delegateType).GetMethod("Create", BindingFlags.Static | BindingFlags.NonPublic)!; + } + else + { + create = typeof(ExpressionCreator<>).MakeGenericType(delegateType).GetMethod("CreateExpressionFunc", BindingFlags.Static | BindingFlags.Public)!; + } + if (delegateType.IsCollectible) { return (LambdaExpression)create.Invoke(null, new object?[] { body, name, tailCall, parameters })!; @@ -708,11 +718,14 @@ public static Expression Lambda(Expression body, string? n { ReadOnlyCollection parameterList = parameters.ToReadOnly(); ValidateLambdaArgs(typeof(TDelegate), ref body, parameterList, nameof(TDelegate)); -#if FEATURE_COMPILE - return Expression.Create(body, name, tailCall, parameterList); -#else - return ExpressionCreator.CreateExpressionFunc(body, name, tailCall, parameterList); -#endif + if (LambdaExpression.CanCompileToIL) + { + return Expression.Create(body, name, tailCall, parameterList); + } + else + { + return ExpressionCreator.CreateExpressionFunc(body, name, tailCall, parameterList); + } } /// diff --git a/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/CallSite.cs b/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/CallSite.cs index 13d01aeb3cec20..e89265ab733348 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/CallSite.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/CallSite.cs @@ -279,24 +279,15 @@ internal void MoveRule(int i) } } -#if FEATURE_COMPILE [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2060:MakeGenericMethod", Justification = "UpdateDelegates methods don't have ILLink annotations.")] -#endif internal T MakeUpdateDelegate() { -#if !FEATURE_COMPILE Type target = typeof(T); MethodInfo invoke = target.GetInvokeMethod(); - s_cachedNoMatch = CreateCustomNoMatchDelegate(invoke); - return CreateCustomUpdateDelegate(invoke); -#else - Type target = typeof(T); - Type[] args; - MethodInfo invoke = target.GetInvokeMethod(); - - if (target.IsGenericType && IsSimpleSignature(invoke, out args)) + if (System.Linq.Expressions.LambdaExpression.CanCompileToIL + && target.IsGenericType && IsSimpleSignature(invoke, out Type[] args)) { MethodInfo? method = null; MethodInfo? noMatchMethod = null; @@ -326,10 +317,8 @@ internal T MakeUpdateDelegate() s_cachedNoMatch = CreateCustomNoMatchDelegate(invoke); return CreateCustomUpdateDelegate(invoke); -#endif } -#if FEATURE_COMPILE private static bool IsSimpleSignature(MethodInfo invoke, out Type[] sig) { ParameterInfo[] pis = invoke.GetParametersCached(); @@ -354,7 +343,6 @@ private static bool IsSimpleSignature(MethodInfo invoke, out Type[] sig) sig = args; return supported; } -#endif [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2060:MakeGenericMethod", Justification = "CallSiteOps methods don't have trimming annotations.")] diff --git a/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/DebugInfoGenerator.cs b/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/DebugInfoGenerator.cs index a1bd0c8c45fc5a..7b8127295d5047 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/DebugInfoGenerator.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/DebugInfoGenerator.cs @@ -32,7 +32,6 @@ public static DebugInfoGenerator CreatePdbGenerator() /// Debug information corresponding to the sequence point. public abstract void MarkSequencePoint(LambdaExpression method, int ilOffset, DebugInfoExpression sequencePoint); -#if FEATURE_COMPILE internal virtual void MarkSequencePoint(LambdaExpression method, MethodBase methodBase, ILGenerator ilg, DebugInfoExpression sequencePoint) { MarkSequencePoint(method, ilg.ILOffset, sequencePoint); @@ -42,6 +41,5 @@ internal virtual void SetLocalName(LocalBuilder localBuilder, string name) { // nop } -#endif } } diff --git a/src/libraries/System.Linq.Expressions/tests/BinaryOperators/Coalesce/BinaryCoalesceTests.cs b/src/libraries/System.Linq.Expressions/tests/BinaryOperators/Coalesce/BinaryCoalesceTests.cs index bbe954f78a1d3c..50131d51cbc25b 100644 --- a/src/libraries/System.Linq.Expressions/tests/BinaryOperators/Coalesce/BinaryCoalesceTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/BinaryOperators/Coalesce/BinaryCoalesceTests.cs @@ -494,8 +494,7 @@ public static void CoalesceReferenceToValueType(bool useInterpreter) Assert.Equal(1, func()); } -#if FEATURE_COMPILE - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [ActiveIssue("https://github.com/mono/mono/issues/14919", TestRuntimes.Mono)] public static void VerifyIL_NullableIntCoalesceToNullableInt() { @@ -523,7 +522,6 @@ [0] valuetype [System.Private.CoreLib]System.Nullable`1 IL_0015: ret }"); } -#endif [Theory, ClassData(typeof(CompilationTypes))] public static void CoalesceWideningLeft(bool useInterpreter) diff --git a/src/libraries/System.Linq.Expressions/tests/BinaryOperators/Logical/BinaryLogicalTests.cs b/src/libraries/System.Linq.Expressions/tests/BinaryOperators/Logical/BinaryLogicalTests.cs index ea2ebbb60b8ca9..c1db2afa8e1462 100644 --- a/src/libraries/System.Linq.Expressions/tests/BinaryOperators/Logical/BinaryLogicalTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/BinaryOperators/Logical/BinaryLogicalTests.cs @@ -415,9 +415,7 @@ public static void MethodDeclaringTypeHasNoTrueFalseOperator_ThrowsArgumentExcep AssertExtensions.Throws(null, () => Expression.OrElse(Expression.Constant(5), Expression.Constant(5), method)); } -#if FEATURE_COMPILE - - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void AndAlso_NoMethod_NotStatic_ThrowsInvalidOperationException() { TypeBuilder type = GetTypeBuilder(); @@ -430,7 +428,7 @@ public static void AndAlso_NoMethod_NotStatic_ThrowsInvalidOperationException() Assert.Throws(() => Expression.AndAlso(Expression.Constant(obj), Expression.Constant(obj))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void OrElse_NoMethod_NotStatic_ThrowsInvalidOperationException() { TypeBuilder type = GetTypeBuilder(); @@ -443,7 +441,7 @@ public static void OrElse_NoMethod_NotStatic_ThrowsInvalidOperationException() Assert.Throws(() => Expression.OrElse(Expression.Constant(obj), Expression.Constant(obj))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void AndAlso_NoMethod_VoidReturnType_ThrowsArgumentException() { TypeBuilder type = GetTypeBuilder(); @@ -456,7 +454,7 @@ public static void AndAlso_NoMethod_VoidReturnType_ThrowsArgumentException() AssertExtensions.Throws("method", () => Expression.AndAlso(Expression.Constant(obj), Expression.Constant(obj))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void OrElse_NoMethod_VoidReturnType_ThrowsArgumentException() { TypeBuilder type = GetTypeBuilder(); @@ -469,7 +467,7 @@ public static void OrElse_NoMethod_VoidReturnType_ThrowsArgumentException() AssertExtensions.Throws("method", () => Expression.OrElse(Expression.Constant(obj), Expression.Constant(obj))); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [InlineData(0)] [InlineData(1)] [InlineData(3)] @@ -485,7 +483,7 @@ public static void AndAlso_NoMethod_DoesntHaveTwoParameters_ThrowsInvalidOperati Assert.Throws(() => Expression.AndAlso(Expression.Constant(obj), Expression.Constant(obj))); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [InlineData(0)] [InlineData(1)] [InlineData(3)] @@ -501,7 +499,7 @@ public static void OrElse_NoMethod_DoesntHaveTwoParameters_ThrowsInvalidOperatio Assert.Throws(() => Expression.OrElse(Expression.Constant(obj), Expression.Constant(obj))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void AndAlso_NoMethod_ExpressionDoesntMatchMethodParameters_ThrowsInvalidOperationException() { TypeBuilder type = GetTypeBuilder(); @@ -514,7 +512,7 @@ public static void AndAlso_NoMethod_ExpressionDoesntMatchMethodParameters_Throws Assert.Throws(() => Expression.AndAlso(Expression.Constant(obj), Expression.Constant(obj))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void OrElse_NoMethod_ExpressionDoesntMatchMethodParameters_ThrowsInvalidOperationException() { TypeBuilder type = GetTypeBuilder(); @@ -528,7 +526,7 @@ public static void OrElse_NoMethod_ExpressionDoesntMatchMethodParameters_ThrowsI } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void AndAlso_NoMethod_ReturnTypeNotEqualToParameterTypes_ThrowsArgumentException() { TypeBuilder type = GetTypeBuilder(); @@ -541,7 +539,7 @@ public static void AndAlso_NoMethod_ReturnTypeNotEqualToParameterTypes_ThrowsArg AssertExtensions.Throws(null, () => Expression.AndAlso(Expression.Constant(obj), Expression.Constant(obj))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void OrElse_NoMethod_ReturnTypeNotEqualToParameterTypes_ThrowsArgumentException() { TypeBuilder type = GetTypeBuilder(); @@ -571,7 +569,7 @@ public static IEnumerable Operator_IncorrectMethod_TestData() yield return new object[] { GetTypeBuilder(), typeof(bool), new Type[0] }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [MemberData(nameof(Operator_IncorrectMethod_TestData))] public static void Method_TrueOperatorIncorrectMethod_ThrowsArgumentException(TypeBuilder builder, Type returnType, Type[] parameterTypes) { @@ -592,7 +590,7 @@ public static void Method_TrueOperatorIncorrectMethod_ThrowsArgumentException(Ty AssertExtensions.Throws(null, () => Expression.OrElse(Expression.Constant(obj), Expression.Constant(obj), createdMethod)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [MemberData(nameof(Operator_IncorrectMethod_TestData))] public static void Method_FalseOperatorIncorrectMethod_ThrowsArgumentException(TypeBuilder builder, Type returnType, Type[]parameterTypes) { @@ -613,7 +611,7 @@ public static void Method_FalseOperatorIncorrectMethod_ThrowsArgumentException(T AssertExtensions.Throws(null, () => Expression.OrElse(Expression.Constant(obj), Expression.Constant(obj), createdMethod)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [MemberData(nameof(Operator_IncorrectMethod_TestData))] public static void AndAlso_NoMethod_TrueOperatorIncorrectMethod_ThrowsArgumentException(TypeBuilder builder, Type returnType, Type[] parameterTypes) { @@ -632,7 +630,7 @@ public static void AndAlso_NoMethod_TrueOperatorIncorrectMethod_ThrowsArgumentEx AssertExtensions.Throws(null, () => Expression.AndAlso(Expression.Constant(obj), Expression.Constant(obj))); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [MemberData(nameof(Operator_IncorrectMethod_TestData))] public static void OrElse_NoMethod_TrueOperatorIncorrectMethod_ThrowsArgumentException(TypeBuilder builder, Type returnType, Type[] parameterTypes) { @@ -651,7 +649,7 @@ public static void OrElse_NoMethod_TrueOperatorIncorrectMethod_ThrowsArgumentExc AssertExtensions.Throws(null, () => Expression.OrElse(Expression.Constant(obj), Expression.Constant(obj))); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [InlineData("op_True")] [InlineData("op_False")] public static void Method_NoTrueFalseOperator_ThrowsArgumentException(string name) @@ -674,7 +672,7 @@ public static void Method_NoTrueFalseOperator_ThrowsArgumentException(string nam AssertExtensions.Throws(null, () => Expression.OrElse(Expression.Constant(obj), Expression.Constant(obj), createdMethod)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [InlineData("op_True")] [InlineData("op_False")] public static void AndAlso_NoMethod_NoTrueFalseOperator_ThrowsArgumentException(string name) @@ -694,7 +692,7 @@ public static void AndAlso_NoMethod_NoTrueFalseOperator_ThrowsArgumentException( AssertExtensions.Throws(null, () => Expression.AndAlso(Expression.Constant(obj), Expression.Constant(obj))); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [InlineData("op_True")] [InlineData("op_False")] public static void OrElse_NoMethod_NoTrueFalseOperator_ThrowsArgumentException(string name) @@ -714,7 +712,7 @@ public static void OrElse_NoMethod_NoTrueFalseOperator_ThrowsArgumentException(s AssertExtensions.Throws(null, () => Expression.OrElse(Expression.Constant(obj), Expression.Constant(obj))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void Method_ParamsDontMatchOperator_ThrowsInvalidOperationException() { TypeBuilder builder = GetTypeBuilder(); @@ -735,7 +733,7 @@ public static void Method_ParamsDontMatchOperator_ThrowsInvalidOperationExceptio Assert.Throws(() => Expression.OrElse(Expression.Constant(5), Expression.Constant(5), createdMethod)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void AndAlso_NoMethod_ParamsDontMatchOperator_ThrowsInvalidOperationException() { TypeBuilder builder = GetTypeBuilder(); @@ -753,7 +751,7 @@ public static void AndAlso_NoMethod_ParamsDontMatchOperator_ThrowsInvalidOperati Assert.Throws(() => Expression.OrElse(Expression.Constant(5), Expression.Constant(5))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void OrElse_NoMethod_ParamsDontMatchOperator_ThrowsInvalidOperationException() { TypeBuilder builder = GetTypeBuilder(); @@ -771,8 +769,6 @@ public static void OrElse_NoMethod_ParamsDontMatchOperator_ThrowsInvalidOperatio Assert.Throws(() => Expression.OrElse(Expression.Constant(5), Expression.Constant(5))); } -#endif - [Fact] public static void ImplicitConversionToBool_ThrowsArgumentException() { @@ -821,15 +817,14 @@ public static void ToStringTest() Assert.Equal("(a OrElse b)", e2.ToString()); } -#if FEATURE_COMPILE - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void AndAlsoGlobalMethod() { MethodInfo method = GlobalMethod(typeof(int), new[] { typeof(int), typeof(int) }); AssertExtensions.Throws(null, () => Expression.AndAlso(Expression.Constant(1), Expression.Constant(2), method)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void OrElseGlobalMethod() { MethodInfo method = GlobalMethod(typeof(int), new [] { typeof(int), typeof(int) }); @@ -851,7 +846,6 @@ private static MethodInfo GlobalMethod(Type returnType, Type[] parameterTypes) module.CreateGlobalFunctions(); return module.GetMethod(globalMethod.Name); } -#endif public class NonGenericClass { diff --git a/src/libraries/System.Linq.Expressions/tests/Cast/CastTests.cs b/src/libraries/System.Linq.Expressions/tests/Cast/CastTests.cs index 090878f8fee7ec..64e20adf5cfddc 100644 --- a/src/libraries/System.Linq.Expressions/tests/Cast/CastTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/Cast/CastTests.cs @@ -2372,10 +2372,12 @@ public static IEnumerable EnumerableTypes() yield return typeof(UInt32Enum); yield return typeof(Int64Enum); yield return typeof(UInt64Enum); -#if FEATURE_COMPILE - yield return NonCSharpTypes.CharEnumType; - yield return NonCSharpTypes.BoolEnumType; -#endif + + if (PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly) + { + yield return NonCSharpTypes.CharEnumType; + yield return NonCSharpTypes.BoolEnumType; + } } public static IEnumerable EnumerableTypeArgs() => EnumerableTypes().Select(t => new object[] { t }); diff --git a/src/libraries/System.Linq.Expressions/tests/CompilerTests.cs b/src/libraries/System.Linq.Expressions/tests/CompilerTests.cs index 9f4d1f7f6a53db..18cd5b02400b2b 100644 --- a/src/libraries/System.Linq.Expressions/tests/CompilerTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/CompilerTests.cs @@ -27,8 +27,7 @@ public static void CompileDeepTree_NoStackOverflow(bool useInterpreter) Assert.Equal(n, f()); } -#if FEATURE_COMPILE - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void EmitConstantsToIL_NonNullableValueTypes() { VerifyEmitConstantsToIL((bool)true); @@ -49,7 +48,7 @@ public static void EmitConstantsToIL_NonNullableValueTypes() VerifyEmitConstantsToIL((decimal)49.95m); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void EmitConstantsToIL_NullableValueTypes() { VerifyEmitConstantsToIL((bool?)null); @@ -85,14 +84,14 @@ public static void EmitConstantsToIL_NullableValueTypes() VerifyEmitConstantsToIL((DateTime?)null); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void EmitConstantsToIL_ReferenceTypes() { VerifyEmitConstantsToIL((string)null); VerifyEmitConstantsToIL((string)"bar"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void EmitConstantsToIL_Enums() { VerifyEmitConstantsToIL(ConstantsEnum.A); @@ -100,21 +99,21 @@ public static void EmitConstantsToIL_Enums() VerifyEmitConstantsToIL((ConstantsEnum?)ConstantsEnum.A); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void EmitConstantsToIL_ShareReferences() { var o = new object(); VerifyEmitConstantsToIL(Expression.Equal(Expression.Constant(o), Expression.Constant(o)), 1, true); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void EmitConstantsToIL_LiftedToClosure() { VerifyEmitConstantsToIL(DateTime.Now, 1); VerifyEmitConstantsToIL((DateTime?)DateTime.Now, 1); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void VariableBinder_CatchBlock_Filter1() { // See https://github.com/dotnet/runtime/issues/18676 for reported issue @@ -128,7 +127,7 @@ public static void VariableBinder_CatchBlock_Filter1() ); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void VariableBinder_CatchBlock_Filter2() { // See https://github.com/dotnet/runtime/issues/18676 for reported issue @@ -142,7 +141,7 @@ public static void VariableBinder_CatchBlock_Filter2() ); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [ActiveIssue("https://github.com/mono/mono/issues/14919", TestRuntimes.Mono)] public static void VerifyIL_Simple() { @@ -159,7 +158,7 @@ .maxstack 1 }"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [ActiveIssue("https://github.com/mono/mono/issues/14919", TestRuntimes.Mono)] public static void VerifyIL_Exceptions() { @@ -220,7 +219,7 @@ [0] int32 }"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [ActiveIssue("https://github.com/mono/mono/issues/14919", TestRuntimes.Mono)] public static void VerifyIL_Closure1() { @@ -255,7 +254,7 @@ .maxstack 1 appendInnerLambdas: true); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [ActiveIssue("https://github.com/mono/mono/issues/14919", TestRuntimes.Mono)] public static void VerifyIL_Closure2() { @@ -313,7 +312,7 @@ [0] object[] appendInnerLambdas: true); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [ActiveIssue("https://github.com/mono/mono/issues/14919", TestRuntimes.Mono)] public static void VerifyIL_Closure3() { @@ -431,7 +430,6 @@ private static void Verify_VariableBinder_CatchBlock_Filter(CatchBlock @catch) Assert.Throws(() => e.Compile()); } -#endif } public enum ConstantsEnum diff --git a/src/libraries/System.Linq.Expressions/tests/Constant/ConstantTests.cs b/src/libraries/System.Linq.Expressions/tests/Constant/ConstantTests.cs index b5e15031721368..40ff43d0d5ff0e 100644 --- a/src/libraries/System.Linq.Expressions/tests/Constant/ConstantTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/Constant/ConstantTests.cs @@ -278,14 +278,12 @@ public static void CheckUShortConstantTest(bool useInterpreter) } } -#if FEATURE_COMPILE private static TypeBuilder GetTypeBuilder() { AssemblyBuilder assembly = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("Name"), AssemblyBuilderAccess.RunAndCollect); ModuleBuilder module = assembly.DefineDynamicModule("Name"); return module.DefineType("Type"); } -#endif [Theory, ClassData(typeof(CompilationTypes))] public static void CheckTypeConstantTest(bool useInterpreter) @@ -296,9 +294,6 @@ public static void CheckTypeConstantTest(bool useInterpreter) typeof(int), typeof(Func), typeof(List<>).GetGenericArguments()[0], -#if FEATURE_COMPILE - GetTypeBuilder(), -#endif typeof(PrivateGenericClass<>).GetGenericArguments()[0], typeof(PrivateGenericClass<>), typeof(PrivateGenericClass) @@ -306,9 +301,12 @@ public static void CheckTypeConstantTest(bool useInterpreter) { VerifyTypeConstant(value, useInterpreter); } - } -#if FEATURE_COMPILE + if (PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly) + { + VerifyTypeConstant(GetTypeBuilder(), useInterpreter); + } + } private static MethodInfo GlobalMethod(params Type[] parameterTypes) { @@ -319,7 +317,8 @@ private static MethodInfo GlobalMethod(params Type[] parameterTypes) return module.GetMethod(globalMethod.Name); } - [Theory, ClassData(typeof(CompilationTypes))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ClassData(typeof(CompilationTypes))] public static void CheckMethodInfoConstantTest(bool useInterpreter) { foreach (MethodInfo value in new MethodInfo[] @@ -338,7 +337,6 @@ public static void CheckMethodInfoConstantTest(bool useInterpreter) VerifyMethodInfoConstant(value, useInterpreter); } } -#endif [Theory, ClassData(typeof(CompilationTypes))] public static void CheckConstructorInfoConstantTest(bool useInterpreter) diff --git a/src/libraries/System.Linq.Expressions/tests/DelegateType/GetDelegateTypeTests.cs b/src/libraries/System.Linq.Expressions/tests/DelegateType/GetDelegateTypeTests.cs index 6b790c4911866d..9d0852a8479164 100644 --- a/src/libraries/System.Linq.Expressions/tests/DelegateType/GetDelegateTypeTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/DelegateType/GetDelegateTypeTests.cs @@ -57,17 +57,20 @@ public void GetNullaryAction() [MemberData(nameof(ManagedPointerTypeArgs))] public void CantBeFunc(Type[] typeArgs) { -#if !FEATURE_COMPILE - Assert.Throws(() => Expression.GetDelegateType(typeArgs)); -#else - Type delType = Expression.GetDelegateType(typeArgs); - Assert.True(typeof(MulticastDelegate).IsAssignableFrom(delType)); - Assert.DoesNotMatch(new Regex(@"System\.Action"), delType.FullName); - Assert.DoesNotMatch(new Regex(@"System\.Func"), delType.FullName); - Reflection.MethodInfo method = delType.GetMethod("Invoke"); - Assert.Equal(typeArgs.Last(), method.ReturnType); - Assert.Equal(typeArgs.Take(typeArgs.Length - 1), method.GetParameters().Select(p => p.ParameterType)); -#endif + if (PlatformDetection.IsLinqExpressionsBuiltWithIsInterpretingOnly) + { + Assert.Throws(() => Expression.GetDelegateType(typeArgs)); + } + else + { + Type delType = Expression.GetDelegateType(typeArgs); + Assert.True(typeof(MulticastDelegate).IsAssignableFrom(delType)); + Assert.DoesNotMatch(new Regex(@"System\.Action"), delType.FullName); + Assert.DoesNotMatch(new Regex(@"System\.Func"), delType.FullName); + Reflection.MethodInfo method = delType.GetMethod("Invoke"); + Assert.Equal(typeArgs.Last(), method.ReturnType); + Assert.Equal(typeArgs.Take(typeArgs.Length - 1), method.GetParameters().Select(p => p.ParameterType)); + } } [Theory] @@ -80,17 +83,20 @@ public void CantBeFunc(Type[] typeArgs) public void CantBeAction(Type[] typeArgs) { Type[] delegateArgs = typeArgs.Append(typeof(void)).ToArray(); -#if !FEATURE_COMPILE - Assert.Throws(() => Expression.GetDelegateType(delegateArgs)); -#else - Type delType = Expression.GetDelegateType(delegateArgs); - Assert.True(typeof(MulticastDelegate).IsAssignableFrom(delType)); - Assert.DoesNotMatch(new Regex(@"System\.Action"), delType.FullName); - Assert.DoesNotMatch(new Regex(@"System\.Func"), delType.FullName); - Reflection.MethodInfo method = delType.GetMethod("Invoke"); - Assert.Equal(typeof(void), method.ReturnType); - Assert.Equal(typeArgs, method.GetParameters().Select(p => p.ParameterType)); -#endif + if (PlatformDetection.IsLinqExpressionsBuiltWithIsInterpretingOnly) + { + Assert.Throws(() => Expression.GetDelegateType(delegateArgs)); + } + else + { + Type delType = Expression.GetDelegateType(delegateArgs); + Assert.True(typeof(MulticastDelegate).IsAssignableFrom(delType)); + Assert.DoesNotMatch(new Regex(@"System\.Action"), delType.FullName); + Assert.DoesNotMatch(new Regex(@"System\.Func"), delType.FullName); + Reflection.MethodInfo method = delType.GetMethod("Invoke"); + Assert.Equal(typeof(void), method.ReturnType); + Assert.Equal(typeArgs, method.GetParameters().Select(p => p.ParameterType)); + } } // Open generic type args aren't useful directly with Expressions, but creating them is allowed. diff --git a/src/libraries/System.Linq.Expressions/tests/Dynamic/InvokeMemberBindingTests.cs b/src/libraries/System.Linq.Expressions/tests/Dynamic/InvokeMemberBindingTests.cs index a9a77a61e7f9d5..616f2234524765 100644 --- a/src/libraries/System.Linq.Expressions/tests/Dynamic/InvokeMemberBindingTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/Dynamic/InvokeMemberBindingTests.cs @@ -186,8 +186,6 @@ public void CallInfoStored() Assert.Same(info, new MinimumOverrideInvokeMemberBinding("name", false, info).CallInfo); } -#if FEATURE_COMPILE // We're not testing compilation, but we do need Reflection.Emit for the test - private static dynamic GetObjectWithNonIndexerParameterProperty(bool hasGetter, bool hasSetter) { TypeBuilder typeBuild = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("TestAssembly"), AssemblyBuilderAccess.RunAndCollect) @@ -233,7 +231,8 @@ private static dynamic GetObjectWithNonIndexerParameterProperty(bool hasGetter, return Activator.CreateInstance(typeBuild.CreateType()); } - [Fact] + // We're not testing compilation, but we do need Reflection.Emit for the test + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void NonIndexerParameterizedDirectAccess() { // If a parameterized property isn't the type's indexer, we should be allowed to use the @@ -244,7 +243,8 @@ public void NonIndexerParameterizedDirectAccess() Assert.Equal(19, value); } - [Fact] + // We're not testing compilation, but we do need Reflection.Emit for the test + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void NonIndexerParameterizedGetterAndSetterIndexAccess() { dynamic d = GetObjectWithNonIndexerParameterProperty(true, true); @@ -254,7 +254,8 @@ public void NonIndexerParameterizedGetterAndSetterIndexAccess() Assert.Contains("set_ItemProp", ex.Message); } - [Fact] + // We're not testing compilation, but we do need Reflection.Emit for the test + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void NonIndexerParameterizedGetterOnlyIndexAccess() { dynamic d = GetObjectWithNonIndexerParameterProperty(true, false); @@ -264,7 +265,8 @@ public void NonIndexerParameterizedGetterOnlyIndexAccess() Assert.Contains("get_ItemProp", ex.Message); } - [Fact] + // We're not testing compilation, but we do need Reflection.Emit for the test + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void NonIndexerParameterizedSetterOnlyIndexAccess() { dynamic d = GetObjectWithNonIndexerParameterProperty(false, true); @@ -333,7 +335,8 @@ public int GetValue2( int arg10) => 11; } - [Fact] + // We're not testing compilation, but we do need Reflection.Emit for the test + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void ManyArities() { dynamic d = new ManyOverloads(); @@ -377,7 +380,9 @@ public static IEnumerable SameNameObjectPairs() return testObjects.SelectMany(i => testObjects.Select(j => new[] { i, j })); } - [Theory, MemberData(nameof(SameNameObjectPairs))] + // We're not testing compilation, but we do need Reflection.Emit for the test + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [MemberData(nameof(SameNameObjectPairs))] public void OperationOnTwoObjectsDifferentTypesOfSameName(object x, object y) { dynamic dX = x; @@ -386,8 +391,6 @@ public void OperationOnTwoObjectsDifferentTypesOfSameName(object x, object y) Assert.Equal(x == y, equal); } -#endif - public class FuncWrapper { public delegate void OutAction(out TResult arg); diff --git a/src/libraries/System.Linq.Expressions/tests/ExceptionHandling/ExceptionHandlingExpressions.cs b/src/libraries/System.Linq.Expressions/tests/ExceptionHandling/ExceptionHandlingExpressions.cs index d9d1d951a4418e..26ca0e2ea5119e 100644 --- a/src/libraries/System.Linq.Expressions/tests/ExceptionHandling/ExceptionHandlingExpressions.cs +++ b/src/libraries/System.Linq.Expressions/tests/ExceptionHandling/ExceptionHandlingExpressions.cs @@ -240,9 +240,8 @@ public void ExpressionsUnwrapeExternallyThrownRuntimeWrappedException(bool useIn Assert.Equal(4, func()); } -#if FEATURE_COMPILE - - [Theory, ClassData(typeof(CompilationTypes))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ClassData(typeof(CompilationTypes))] public void CatchFromExternallyThrownString(bool useInterpreter) { foreach (bool assemblyWraps in new []{false, true}) @@ -274,7 +273,6 @@ public void CatchFromExternallyThrownString(bool useInterpreter) Assert.Equal("An Exceptional Exception!", func()); } } -#endif [Theory] [ClassData(typeof(CompilationTypes))] @@ -1006,11 +1004,14 @@ public void TryFinallyWithinFilterCompiledProhibited() ) ); Expression> lambda = Expression.Lambda>(tryExp); -#if FEATURE_COMPILE - Assert.Throws(() => lambda.Compile(false)); -#else - lambda.Compile(true); -#endif + if (PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly) + { + Assert.Throws(() => lambda.Compile(false)); + } + else + { + lambda.Compile(true); + } } [Theory, InlineData(true)] diff --git a/src/libraries/System.Linq.Expressions/tests/HelperTypes.cs b/src/libraries/System.Linq.Expressions/tests/HelperTypes.cs index aca1e6a4a5c50a..ae01067743f9d1 100644 --- a/src/libraries/System.Linq.Expressions/tests/HelperTypes.cs +++ b/src/libraries/System.Linq.Expressions/tests/HelperTypes.cs @@ -246,13 +246,23 @@ public struct PS internal class CompilationTypes : IEnumerable { - private static readonly IEnumerable Booleans = new[] + private static IEnumerable Booleans { -#if FEATURE_COMPILE && FEATURE_INTERPRET - new object[] {false}, -#endif - new object[] {true}, - }; + get + { + return LambdaExpression.CanCompileToIL ? + new[] + { + new object[] {false}, + new object[] {true}, + } + : + new[] + { + new object[] {true}, + }; + } + } public IEnumerator GetEnumerator() => Booleans.GetEnumerator(); @@ -366,7 +376,6 @@ public enum UInt32Enum : uint { A = uint.MaxValue } public enum Int64Enum : long { A = long.MaxValue } public enum UInt64Enum : ulong { A = ulong.MaxValue } -#if FEATURE_COMPILE public static class NonCSharpTypes { private static Type _charEnumType; @@ -412,7 +421,6 @@ public static Type BoolEnumType } } } -#endif public class FakeExpression : Expression { @@ -467,15 +475,17 @@ public static class ExpressionAssert { public static void Verify(this LambdaExpression expression, string il, string instructions) { -#if FEATURE_COMPILE - expression.VerifyIL(il); -#endif + if (LambdaExpression.CanCompileToIL) + { + expression.VerifyIL(il); + } - // FEATURE_COMPILE is not directly required, + // LambdaExpression.CanCompileToIL is not directly required, // but this functionality relies on private reflection and that would not work with AOT -#if FEATURE_INTERPRET && FEATURE_COMPILE - expression.VerifyInstructions(instructions); -#endif + if (LambdaExpression.CanCompileToIL && LambdaExpression.CanInterpret) + { + expression.VerifyInstructions(instructions); + } } } diff --git a/src/libraries/System.Linq.Expressions/tests/IndexExpression/IndexExpressionTests.cs b/src/libraries/System.Linq.Expressions/tests/IndexExpression/IndexExpressionTests.cs index 438bdf04ea701c..98a436c9f4a17f 100644 --- a/src/libraries/System.Linq.Expressions/tests/IndexExpression/IndexExpressionTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/IndexExpression/IndexExpressionTests.cs @@ -92,13 +92,12 @@ public static void ToStringTest() Assert.Equal("xs[i, j]", e3.ToString()); } -#if FEATURE_COMPILE private static TypeBuilder GetTestTypeBuilder() => AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("TestAssembly"), AssemblyBuilderAccess.RunAndCollect) .DefineDynamicModule("TestModule") .DefineType("TestType"); - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [ActiveIssue("https://github.com/mono/mono/issues/14920", TestRuntimes.Mono)] public void NoAccessorIndexedProperty() { @@ -114,7 +113,7 @@ public void NoAccessorIndexedProperty() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void ByRefIndexedProperty() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -145,7 +144,7 @@ public void ByRefIndexedProperty() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void VoidIndexedProperty() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -173,7 +172,7 @@ public void VoidIndexedProperty() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [ActiveIssue("https://github.com/mono/mono/issues/14927", TestRuntimes.Mono)] public void IndexedPropertyGetReturnsWrongType() { @@ -202,7 +201,7 @@ public void IndexedPropertyGetReturnsWrongType() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void IndexedPropertySetterNoParams() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -230,7 +229,7 @@ public void IndexedPropertySetterNoParams() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void IndexedPropertySetterByrefValueType() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -258,7 +257,7 @@ public void IndexedPropertySetterByrefValueType() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void IndexedPropertySetterNotReturnVoid() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -286,7 +285,7 @@ public void IndexedPropertySetterNotReturnVoid() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void IndexedPropertyGetterInstanceSetterStatic() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -326,7 +325,7 @@ public void IndexedPropertyGetterInstanceSetterStatic() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [ActiveIssue("https://github.com/mono/mono/issues/14927", TestRuntimes.Mono)] public void IndexedPropertySetterValueTypeNotMatchPropertyType() { @@ -355,7 +354,7 @@ public void IndexedPropertySetterValueTypeNotMatchPropertyType() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void IndexedPropertyGetterSetterArgCountMismatch() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -395,7 +394,7 @@ public void IndexedPropertyGetterSetterArgCountMismatch() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void IndexedPropertyGetterSetterArgumentTypeMismatch() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -435,7 +434,7 @@ public void IndexedPropertyGetterSetterArgumentTypeMismatch() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0), Expression.Constant(0), Expression.Constant(0))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void IndexedPropertyVarArgs() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -465,7 +464,7 @@ public void IndexedPropertyVarArgs() AssertExtensions.Throws("propertyName", () => Expression.Property(instance, "Item", Expression.Constant(0), Expression.Constant(0), Expression.Constant(0))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void NullInstanceInstanceProperty() { PropertyInfo prop = typeof(Dictionary).GetProperty("Item"); @@ -473,7 +472,7 @@ public void NullInstanceInstanceProperty() AssertExtensions.Throws("instance", () => Expression.Property(null, prop, index)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void InstanceToStaticProperty() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -501,7 +500,7 @@ public void InstanceToStaticProperty() AssertExtensions.Throws("instance", () => Expression.Property(instance, prop, Expression.Constant(0))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void ByRefIndexer() { TypeBuilder typeBuild = GetTestTypeBuilder(); @@ -529,9 +528,6 @@ public void ByRefIndexer() AssertExtensions.Throws("indexes[0]", () => Expression.Property(instance, prop, Expression.Constant(0))); } -// FEATURE_COMPILE -#endif - [Fact] public void CallWithoutIndices() { diff --git a/src/libraries/System.Linq.Expressions/tests/InterpreterTests.cs b/src/libraries/System.Linq.Expressions/tests/InterpreterTests.cs index 146dffb4be4c40..4298013f5f59c5 100644 --- a/src/libraries/System.Linq.Expressions/tests/InterpreterTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/InterpreterTests.cs @@ -1,10 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// FEATURE_COMPILE is not directly required, -// but this functionality relies on private reflection and that would not work with AOT -#if FEATURE_INTERPRET && FEATURE_COMPILE - using System.Linq.Expressions.Interpreter; using System.Reflection; using Xunit; @@ -15,7 +11,9 @@ public static class InterpreterTests { private static readonly PropertyInfo s_debugView = typeof(LightLambda).GetPropertyAssert("DebugView"); - [Fact] + // IsNotLinqExpressionsBuiltWithIsInterpretingOnly is not directly required, + // but this functionality relies on private reflection and that would not work with AOT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void VerifyInstructions_Simple() { // Using an unchecked multiplication to ensure that a mul instruction is emitted (and not mul.ovf) @@ -46,7 +44,9 @@ .maxcontinuation 0 }"); } - [Fact] + // IsNotLinqExpressionsBuiltWithIsInterpretingOnly is not directly required, + // but this functionality relies on private reflection and that would not work with AOT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void VerifyInstructions_Exceptions() { ParameterExpression x = Expression.Parameter(typeof(int), "x"); @@ -101,7 +101,9 @@ .maxcontinuation 1 }"); } - [Fact] + // IsNotLinqExpressionsBuiltWithIsInterpretingOnly is not directly required, + // but this functionality relies on private reflection and that would not work with AOT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [ActiveIssue ("https://github.com/dotnet/runtime/issues/53599", platforms: TestPlatforms.MacCatalyst, runtimes: TestRuntimes.Mono)] public static void ConstructorThrows_StackTrace() { @@ -110,7 +112,9 @@ public static void ConstructorThrows_StackTrace() AssertStackTrace(() => f(), "Thrower..ctor"); } - [Fact] + // IsNotLinqExpressionsBuiltWithIsInterpretingOnly is not directly required, + // but this functionality relies on private reflection and that would not work with AOT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void PropertyGetterThrows_StackTrace() { Expression> e = t => t.Bar; @@ -118,7 +122,9 @@ public static void PropertyGetterThrows_StackTrace() AssertStackTrace(() => f(new Thrower(error: false)), "Thrower.get_Bar"); } - [Fact] + // IsNotLinqExpressionsBuiltWithIsInterpretingOnly is not directly required, + // but this functionality relies on private reflection and that would not work with AOT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void PropertySetterThrows_StackTrace() { ParameterExpression t = Expression.Parameter(typeof(Thrower), "t"); @@ -127,7 +133,9 @@ public static void PropertySetterThrows_StackTrace() AssertStackTrace(() => f(new Thrower(error: false)), "Thrower.set_Bar"); } - [Fact] + // IsNotLinqExpressionsBuiltWithIsInterpretingOnly is not directly required, + // but this functionality relies on private reflection and that would not work with AOT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void IndexerGetterThrows_StackTrace() { ParameterExpression t = Expression.Parameter(typeof(Thrower), "t"); @@ -136,7 +144,9 @@ public static void IndexerGetterThrows_StackTrace() AssertStackTrace(() => f(new Thrower(error: false)), "Thrower.get_Item"); } - [Fact] + // IsNotLinqExpressionsBuiltWithIsInterpretingOnly is not directly required, + // but this functionality relies on private reflection and that would not work with AOT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void IndexerSetterThrows_StackTrace() { ParameterExpression t = Expression.Parameter(typeof(Thrower), "t"); @@ -145,7 +155,9 @@ public static void IndexerSetterThrows_StackTrace() AssertStackTrace(() => f(new Thrower(error: false)), "Thrower.set_Item"); } - [Fact] + // IsNotLinqExpressionsBuiltWithIsInterpretingOnly is not directly required, + // but this functionality relies on private reflection and that would not work with AOT + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void MethodThrows_StackTrace() { Expression> e = t => t.Foo(); @@ -232,5 +244,3 @@ public void Foo() } } } - -#endif diff --git a/src/libraries/System.Linq.Expressions/tests/Invoke/InvocationTests.cs b/src/libraries/System.Linq.Expressions/tests/Invoke/InvocationTests.cs index ea2e7b9b85aa11..829e7e435ba331 100644 --- a/src/libraries/System.Linq.Expressions/tests/Invoke/InvocationTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/Invoke/InvocationTests.cs @@ -244,9 +244,9 @@ public static void LambdaAndArgChangeVisit(InvocationExpression invoke) Assert.NotSame(invoke, new ParameterAndConstantChangingVisitor().Visit(invoke)); } -#if FEATURE_COMPILE // When we don't have FEATURE_COMPILE we don't have the Reflection.Emit used in the tests. - - [Theory, ClassData(typeof(CompilationTypes))] + // When we don't have IsNotLinqExpressionsBuiltWithIsInterpretingOnly we don't have the Reflection.Emit used in the tests. + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ClassData(typeof(CompilationTypes))] public static void InvokePrivateDelegate(bool useInterpreter) { AssemblyBuilder assembly = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("Name"), AssemblyBuilderAccess.RunAndCollect); @@ -263,7 +263,9 @@ public static void InvokePrivateDelegate(bool useInterpreter) Assert.Equal(42, invFunc()); } - [Theory, ClassData(typeof(CompilationTypes))] + // When we don't have IsNotLinqExpressionsBuiltWithIsInterpretingOnly we don't have the Reflection.Emit used in the tests. + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ClassData(typeof(CompilationTypes))] public static void InvokePrivateDelegateTypeLambda(bool useInterpreter) { AssemblyBuilder assembly = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("Name"), AssemblyBuilderAccess.RunAndCollect); @@ -278,7 +280,6 @@ public static void InvokePrivateDelegateTypeLambda(bool useInterpreter) var invFunc = invLambda.Compile(useInterpreter); Assert.Equal(42, invFunc()); } -#endif private delegate void RefIntAction(ref int x); diff --git a/src/libraries/System.Linq.Expressions/tests/Lambda/LambdaTests.cs b/src/libraries/System.Linq.Expressions/tests/Lambda/LambdaTests.cs index 9cd8d5ef12fda2..c62a6ed60273e2 100644 --- a/src/libraries/System.Linq.Expressions/tests/Lambda/LambdaTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/Lambda/LambdaTests.cs @@ -268,9 +268,11 @@ public void ImplicitlyTyped() double, double, double, double, bool>), exp.Type); -#if FEATURE_COMPILE - // From this point on, the tests require FEATURE_COMPILE (RefEmit) support as SLE needs to create delegate types on the fly. + // From this point on, the tests require IsLinqExpressionsBuiltWithIsInterpretingOnly (RefEmit) support as SLE needs to create delegate types on the fly. // You can't instantiate Func<> over 20 arguments or over byrefs. + if (PlatformDetection.IsLinqExpressionsBuiltWithIsInterpretingOnly) + return; + ParameterExpression[] paramList = Enumerable.Range(0, 20).Select(_ => Expression.Variable(typeof(int))).ToArray(); exp = Expression.Lambda( Expression.Constant(0), @@ -302,7 +304,6 @@ public void ImplicitlyTyped() Assert.Equal(1, delMethod.GetParameters().Length); Assert.Equal(typeof(int).MakeByRefType(), delMethod.GetParameters()[0].ParameterType); Assert.Same(delType, Expression.Lambda(Expression.Constant(3L), Expression.Parameter(typeof(int).MakeByRefType())).Type); -#endif //FEATURE_COMPILE } [Fact] @@ -790,8 +791,7 @@ public void AboveByteMaxArityArg(bool useInterpreter) Assert.Equal(23, result); } -#if FEATURE_COMPILE - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void AboveByteMaxArityArgIL() { ParameterExpression[] pars = Enumerable.Range(0, 300) @@ -808,7 +808,6 @@ .maxstack 1 } "); } -#endif private struct Mutable { @@ -882,8 +881,7 @@ public void AboveByteMaxArityArgAddress(bool useInterpreter) Assert.True(result.Mutated); } -#if FEATURE_COMPILE - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void AboveByteMaxArityArgAddressIL() { ParameterExpression parToMutate = Expression.Parameter(typeof(Mutable)); @@ -903,7 +901,6 @@ .maxstack 1 } "); } -#endif [Theory, ClassData(typeof(CompilationTypes))] public void ExcessiveArity(bool useInterpreter) @@ -927,9 +924,9 @@ public void OpenGenericDelegate() AssertExtensions.Throws("delegateType", () => Expression.Lambda(typeof(Action<>), Expression.Empty(), false, Enumerable.Empty())); } -#if FEATURE_COMPILE // When we don't have FEATURE_COMPILE we don't have the Reflection.Emit used in the tests. - - [Theory, ClassData(typeof(CompilationTypes))] + // When we don't have IsLinqExpressionsBuiltWithIsInterpretingOnly we don't have the Reflection.Emit used in the tests. + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] + [ClassData(typeof(CompilationTypes))] public void PrivateDelegate(bool useInterpreter) { AssemblyBuilder assembly = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("Name"), AssemblyBuilderAccess.RunAndCollect); @@ -944,8 +941,6 @@ public void PrivateDelegate(bool useInterpreter) Assert.Equal(42, del.DynamicInvoke()); } -#endif - [Fact] [SkipOnTargetFramework(~TargetFrameworkMonikers.Netcoreapp, "Optimization in .NET Core")] public void ValidateThatInterpreterWithSimpleTypeUsesNonDynamicThunk() diff --git a/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs b/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs index cca9a0e08c85b8..78466bcd842eee 100644 --- a/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs @@ -552,8 +552,7 @@ public static void MakeMemberAccess_MemberNotFieldOrProperty_ThrowsArgumentExcep AssertExtensions.Throws("member", () => Expression.MakeMemberAccess(Expression.Constant(new PC()), member)); } -#if FEATURE_COMPILE - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [ActiveIssue("https://github.com/mono/mono/issues/14920", TestRuntimes.Mono)] public static void Property_NoGetOrSetAccessors_ThrowsArgumentException() { @@ -575,7 +574,6 @@ public static void Property_NoGetOrSetAccessors_ThrowsArgumentException() AssertExtensions.Throws("property", () => Expression.MakeMemberAccess(expression, createdProperty)); } -#endif [Fact] public static void ToStringTest() diff --git a/src/libraries/System.Linq.Expressions/tests/MemberInit/BindTests.cs b/src/libraries/System.Linq.Expressions/tests/MemberInit/BindTests.cs index 006c4d51cdd37e..8777d108110b09 100644 --- a/src/libraries/System.Linq.Expressions/tests/MemberInit/BindTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/MemberInit/BindTests.cs @@ -284,8 +284,7 @@ public void BogusBindingType(MemberBinding binding) AssertExtensions.Throws("bindings[0]", () => Expression.MemberInit(Expression.New(typeof(PropertyAndFields)), binding)); } -#if FEATURE_COMPILE - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void GlobalMethod() { ModuleBuilder module = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("Name"), AssemblyBuilderAccess.RunAndCollect).DefineDynamicModule("Module"); @@ -296,7 +295,7 @@ public void GlobalMethod() AssertExtensions.Throws("propertyAccessor", () => Expression.Bind(globalMethodInfo, Expression.Constant(2))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void GlobalField() { ModuleBuilder module = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("Name"), AssemblyBuilderAccess.RunAndCollect).DefineDynamicModule("Module"); @@ -305,6 +304,5 @@ public void GlobalField() FieldInfo globalField = module.GetField(fieldBuilder.Name); AssertExtensions.Throws("member", () => Expression.Bind(globalField, Expression.Default(globalField.FieldType))); } -#endif } } diff --git a/src/libraries/System.Linq.Expressions/tests/MemberInit/ListBindTests.cs b/src/libraries/System.Linq.Expressions/tests/MemberInit/ListBindTests.cs index c38457740ae5fc..3b25685e8368fe 100644 --- a/src/libraries/System.Linq.Expressions/tests/MemberInit/ListBindTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/MemberInit/ListBindTests.cs @@ -290,8 +290,7 @@ public void OpenGenericTypesMembers() AssertExtensions.Throws(null, () => Expression.ListBind(method)); } -#if FEATURE_COMPILE - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void GlobalMethod() { ModuleBuilder module = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("Name"), AssemblyBuilderAccess.RunAndCollect).DefineDynamicModule("Module"); @@ -301,7 +300,5 @@ public void GlobalMethod() MethodInfo globalMethodInfo = module.GetMethod(globalMethod.Name); AssertExtensions.Throws("propertyAccessor", () => Expression.ListBind(globalMethodInfo)); } -#endif - } } diff --git a/src/libraries/System.Linq.Expressions/tests/MemberInit/MemberBindTests.cs b/src/libraries/System.Linq.Expressions/tests/MemberInit/MemberBindTests.cs index 413ab0d7633a00..8a72d0e39849e2 100644 --- a/src/libraries/System.Linq.Expressions/tests/MemberInit/MemberBindTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/MemberInit/MemberBindTests.cs @@ -253,8 +253,7 @@ public void StaticReadonlyInnerField(bool useInterpreter) Assert.Throws(() => exp.Compile(useInterpreter)); } -#if FEATURE_COMPILE - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void GlobalMethod() { ModuleBuilder module = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("Name"), AssemblyBuilderAccess.RunAndCollect).DefineDynamicModule("Module"); @@ -264,7 +263,6 @@ public void GlobalMethod() MethodInfo globalMethodInfo = module.GetMethod(globalMethod.Name); AssertExtensions.Throws("propertyAccessor", () => Expression.MemberBind(globalMethodInfo)); } -#endif [Fact] public void WriteOnlyInnerProperty() diff --git a/src/libraries/System.Linq.Expressions/tests/New/NewTests.cs b/src/libraries/System.Linq.Expressions/tests/New/NewTests.cs index 6d48041ade2bd7..f056ed3df36c1c 100644 --- a/src/libraries/System.Linq.Expressions/tests/New/NewTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/New/NewTests.cs @@ -555,8 +555,7 @@ public static void OpenGenericConstructorsInvalid(ConstructorInfo ctor, Expressi } } -#if FEATURE_COMPILE - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void GlobalMethodInMembers() { ModuleBuilder module = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("Name"), AssemblyBuilderAccess.RunAndCollect).DefineDynamicModule("Module"); @@ -570,7 +569,7 @@ public static void GlobalMethodInMembers() AssertExtensions.Throws("members[0]", () => Expression.New(constructor, arguments, members)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void GlobalFieldInMembers() { ModuleBuilder module = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("Name"), AssemblyBuilderAccess.RunAndCollect).DefineDynamicModule("Module"); @@ -582,7 +581,6 @@ public static void GlobalFieldInMembers() MemberInfo[] members = { globalField }; AssertExtensions.Throws("members[0]", () => Expression.New(constructor, arguments, members)); } -#endif static class StaticCtor { diff --git a/src/libraries/System.Linq.Expressions/tests/New/NewWithByRefParameterTests.cs b/src/libraries/System.Linq.Expressions/tests/New/NewWithByRefParameterTests.cs index 09fbcfcd7ec982..04804eef82f9b4 100644 --- a/src/libraries/System.Linq.Expressions/tests/New/NewWithByRefParameterTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/New/NewWithByRefParameterTests.cs @@ -70,13 +70,11 @@ public void CreateByRefAliasingInterpreted() CreateByRefAliasing(useInterpreter: true); } -#if FEATURE_COMPILE - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public void CreateByRefAliasingCompiled() { CreateByRefAliasing(useInterpreter: false); } -#endif [Theory, ClassData(typeof(CompilationTypes))] public void CreateByRefReferencingReadonly(bool useInterpreter) diff --git a/src/libraries/System.Linq.Expressions/tests/StackSpillerTests.cs b/src/libraries/System.Linq.Expressions/tests/StackSpillerTests.cs index cff5a1da09999b..480b85028db88d 100644 --- a/src/libraries/System.Linq.Expressions/tests/StackSpillerTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/StackSpillerTests.cs @@ -1676,9 +1676,7 @@ .maxcontinuation 1 }"); } -#if FEATURE_COMPILE - - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void Spill_Optimizations_Constant() { ParameterExpression xs = Expression.Parameter(typeof(int[])); @@ -1736,7 +1734,7 @@ [2] int32 ); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void Spill_Optimizations_Default() { ParameterExpression xs = Expression.Parameter(typeof(int[])); @@ -1794,7 +1792,7 @@ [2] int32 ); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void Spill_Optimizations_LiteralField_NotNetFramework() { Expression> e = @@ -1842,7 +1840,7 @@ [1] float64 ); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void Spill_Optimizations_StaticReadOnlyField() { Expression> e = @@ -1891,7 +1889,7 @@ [1] string ); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void Spill_Optimizations_RuntimeVariables1() { ParameterExpression f = Expression.Parameter(typeof(Action)); @@ -1950,7 +1948,7 @@ [2] int32 ); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void Spill_Optimizations_RuntimeVariables2() { ParameterExpression f = Expression.Parameter(typeof(Action)); @@ -2028,7 +2026,7 @@ [3] int32 ); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void Spill_Optimizations_NoSpillBeyondSpillSite1() { ParameterExpression f = Expression.Parameter(typeof(Func)); @@ -2101,7 +2099,7 @@ [2] int32 }"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] public static void Spill_Optimizations_NoSpillBeyondSpillSite2() { ParameterExpression f = Expression.Parameter(typeof(Func)); @@ -2187,8 +2185,6 @@ [4] int32 }"); } -#endif - private static void Test(Func factory, Expression arg1) { Test(args => factory(args[0]), new[] { arg1 }, false); diff --git a/src/libraries/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj b/src/libraries/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj index c2efe998ee96ab..7744fdd0edbcda 100644 --- a/src/libraries/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj +++ b/src/libraries/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj @@ -1,10 +1,5 @@ - true - false - true - $(DefineConstants);FEATURE_COMPILE - $(DefineConstants);FEATURE_INTERPRET $(NetCoreAppCurrent);$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-MacCatalyst @@ -221,7 +216,7 @@ - + diff --git a/src/libraries/System.Linq.Expressions/tests/TestExtensions/InlinePerCompilationTypeAttribute.cs b/src/libraries/System.Linq.Expressions/tests/TestExtensions/InlinePerCompilationTypeAttribute.cs index f68d74290d7a5f..99256538791131 100644 --- a/src/libraries/System.Linq.Expressions/tests/TestExtensions/InlinePerCompilationTypeAttribute.cs +++ b/src/libraries/System.Linq.Expressions/tests/TestExtensions/InlinePerCompilationTypeAttribute.cs @@ -9,13 +9,8 @@ namespace System.Linq.Expressions.Tests { internal class InlinePerCompilationTypeAttribute : DataAttribute { - private static readonly object[] s_boxedBooleans = - { - false, -#if FEATURE_COMPILE && FEATURE_INTERPRET - true -#endif - }; + private static readonly object[] s_boxedBooleans = PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly ? + new object[] { false, true } : new object[] { false }; private readonly object[] _data; diff --git a/src/libraries/System.Linq.Expressions/tests/TestExtensions/PerCompilationTypeAttribute.cs b/src/libraries/System.Linq.Expressions/tests/TestExtensions/PerCompilationTypeAttribute.cs index 8caa6e90824157..2f399a7078ab7a 100644 --- a/src/libraries/System.Linq.Expressions/tests/TestExtensions/PerCompilationTypeAttribute.cs +++ b/src/libraries/System.Linq.Expressions/tests/TestExtensions/PerCompilationTypeAttribute.cs @@ -32,42 +32,30 @@ public override IEnumerable GetData(MethodInfo testMethod) // we'd therefore end up with multiple copies of the last result. foreach (object[] received in delegatedTo.GetData(testMethod)) { -#if FEATURE_COMPILE - object[] withFalse = new object[received.Length + 1]; -#endif + object[] withFalse = null; + if (PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly) + { + withFalse = new object[received.Length + 1]; + withFalse[received.Length] = s_boxedFalse; + } -#if FEATURE_INTERPRET object[] withTrue = new object[received.Length + 1]; -#endif - -#if FEATURE_COMPILE - withFalse[received.Length] = s_boxedFalse; -#endif - -#if FEATURE_INTERPRET withTrue[received.Length] = s_boxedTrue; -#endif for (int i = 0; i != received.Length; ++i) { object arg = received[i]; -#if FEATURE_COMPILE - withFalse[i] = arg; -#endif + if (withFalse != null) + withFalse[i] = arg; -#if FEATURE_INTERPRET withTrue[i] = arg; -#endif } -#if FEATURE_COMPILE - yield return withFalse; -#endif + if (withFalse != null) + yield return withFalse; -#if FEATURE_INTERPRET yield return withTrue; -#endif } } } diff --git a/src/libraries/System.Linq.Expressions/tests/Unary/UnaryArithmeticNegateCheckedNullableTests.cs b/src/libraries/System.Linq.Expressions/tests/Unary/UnaryArithmeticNegateCheckedNullableTests.cs index ce051238ea2a48..9811cd7b632d3e 100644 --- a/src/libraries/System.Linq.Expressions/tests/Unary/UnaryArithmeticNegateCheckedNullableTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/Unary/UnaryArithmeticNegateCheckedNullableTests.cs @@ -201,8 +201,7 @@ private static void VerifyArithmeticNegateCheckedNullableShort(short? value, boo #endregion -#if FEATURE_COMPILE - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [ActiveIssue("https://github.com/mono/mono/issues/14919", TestRuntimes.Mono)] public static void VerifyIL_NullableShortNegateChecked() { @@ -234,7 +233,5 @@ [0] valuetype [System.Private.CoreLib]System.Nullable`1 IL_001d: ret }"); } -#endif - } } diff --git a/src/libraries/System.Linq.Expressions/tests/Unary/UnaryArithmeticNegateCheckedTests.cs b/src/libraries/System.Linq.Expressions/tests/Unary/UnaryArithmeticNegateCheckedTests.cs index dd44ab27bc03c5..460c2c2cd15f14 100644 --- a/src/libraries/System.Linq.Expressions/tests/Unary/UnaryArithmeticNegateCheckedTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/Unary/UnaryArithmeticNegateCheckedTests.cs @@ -208,8 +208,7 @@ private static void VerifyArithmeticNegateCheckedShort(short value, bool useInte #endregion -#if FEATURE_COMPILE - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotLinqExpressionsBuiltWithIsInterpretingOnly))] [ActiveIssue("https://github.com/mono/mono/issues/14919", TestRuntimes.Mono)] public static void VerifyIL_ShortNegateChecked() { @@ -229,7 +228,5 @@ .maxstack 2 IL_0004: ret }"); } -#endif - } } diff --git a/src/libraries/System.Linq.Parallel/Directory.Build.props b/src/libraries/System.Linq.Parallel/Directory.Build.props index 7c0e0c24870de2..e8d65546d0c807 100644 --- a/src/libraries/System.Linq.Parallel/Directory.Build.props +++ b/src/libraries/System.Linq.Parallel/Directory.Build.props @@ -2,6 +2,5 @@ Microsoft - browser diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Channels/AsynchronousChannel.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Channels/AsynchronousChannel.cs index 105bbea7e45497..d0e60aff91e6d7 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Channels/AsynchronousChannel.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Channels/AsynchronousChannel.cs @@ -17,6 +17,7 @@ namespace System.Linq.Parallel /// This is a bounded channel meant for single-producer/single-consumer scenarios. /// /// Specifies the type of data in the channel. + [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] internal sealed class AsynchronousChannel : IDisposable { // The producer will be blocked once the channel reaches a capacity, and unblocked diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs index 3432a14aef671a..161fb73749130c 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs @@ -26,6 +26,7 @@ namespace System.Linq.Parallel /// /// /// + [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] internal sealed class AsynchronousChannelMergeEnumerator : MergeEnumerator { private readonly AsynchronousChannel[] _channels; // The channels being enumerated. @@ -220,6 +221,7 @@ private bool MoveNextSlowPath() break; } + Debug.Assert(!ParallelEnumerable.SinglePartitionMode); Debug.Assert(_consumerEvent != null); //This Wait() does not require cancellation support as it will wake up when all the producers into the //channel have finished. Hence, if all the producers wake up on cancellation, so will this. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/DefaultMergeHelper.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/DefaultMergeHelper.cs index c318b3b5954e0a..26058969e63c5e 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/DefaultMergeHelper.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/DefaultMergeHelper.cs @@ -64,6 +64,7 @@ internal DefaultMergeHelper(PartitionedStream partitio { if (partitions.PartitionCount > 1) { + Debug.Assert(!ParallelEnumerable.SinglePartitionMode); _asyncChannels = MergeExecutor.MakeAsynchronousChannels(partitions.PartitionCount, options, consumerEvent, cancellationState.MergedCancellationToken); _channelEnumerator = new AsynchronousChannelMergeEnumerator(_taskGroupState, _asyncChannels, consumerEvent); @@ -99,6 +100,7 @@ void IMergeHelper.Execute() { if (_asyncChannels != null) { + Debug.Assert(!ParallelEnumerable.SinglePartitionMode); SpoolingTask.SpoolPipeline(_taskGroupState, _partitions, _asyncChannels, _taskScheduler); } else if (_syncChannels != null) diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/MergeExecutor.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/MergeExecutor.cs index 984ae2f014a285..5a18d6fd93ca63 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/MergeExecutor.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/MergeExecutor.cs @@ -64,6 +64,7 @@ internal static MergeExecutor Execute( if (partitions.PartitionCount > 1) { + Debug.Assert(!ParallelEnumerable.SinglePartitionMode); // We use a pipelining ordered merge mergeExecutor._mergeHelper = new OrderPreservingPipeliningMergeHelper( partitions, taskScheduler, cancellationState, autoBuffered, queryId, partitions.KeyComparer); @@ -140,6 +141,7 @@ public IEnumerator GetEnumerator() // An array of asynchronous channels, one for each partition. // + [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] internal static AsynchronousChannel[] MakeAsynchronousChannels(int partitionCount, ParallelMergeOptions options, IntValueEvent? consumerEvent, CancellationToken cancellationToken) { AsynchronousChannel[] channels = new AsynchronousChannel[partitionCount]; diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs index 4153cf39a875c0..ddf0377cc9397c 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs @@ -36,6 +36,7 @@ namespace System.Linq.Parallel /// Finally, if the producer notices that its buffer has exceeded an even greater threshold, it will /// go to sleep and wait until the consumer takes the entire buffer. /// + [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] internal sealed class OrderPreservingPipeliningMergeHelper : IMergeHelper { private readonly QueryTaskGroupState _taskGroupState; // State shared among tasks. @@ -354,12 +355,14 @@ private void ThrowIfInTearDown() { // Wake up all producers. Since the cancellation token has already been // set, the producers will eventually stop after waking up. - object[] locks = _mergeHelper._bufferLocks; - for (int i = 0; i < locks.Length; i++) - { - lock (locks[i]) + if (!ParallelEnumerable.SinglePartitionMode) { + object[] locks = _mergeHelper._bufferLocks; + for (int i = 0; i < locks.Length; i++) { - Monitor.Pulse(locks[i]); + lock (locks[i]) + { + Monitor.Pulse(locks[i]); + } } } @@ -398,6 +401,9 @@ private bool TryWaitForElement(int producer, ref Pair element) return false; } + if (ParallelEnumerable.SinglePartitionMode) + return false; + _mergeHelper._consumerWaiting[producer] = true; Monitor.Wait(bufferLock); @@ -416,6 +422,7 @@ private bool TryWaitForElement(int producer, ref Pair element) // If the producer is waiting, wake it up if (_mergeHelper._producerWaiting[producer]) { + Debug.Assert(!ParallelEnumerable.SinglePartitionMode); Monitor.Pulse(bufferLock); _mergeHelper._producerWaiting[producer] = false; } @@ -469,15 +476,17 @@ private bool TryGetPrivateElement(int producer, ref Pair element) public override void Dispose() { // Wake up any waiting producers - int partitionCount = _mergeHelper._buffers.Length; - for (int producer = 0; producer < partitionCount; producer++) - { - object bufferLock = _mergeHelper._bufferLocks[producer]; - lock (bufferLock) + if (!ParallelEnumerable.SinglePartitionMode) { + int partitionCount = _mergeHelper._buffers.Length; + for (int producer = 0; producer < partitionCount; producer++) { - if (_mergeHelper._producerWaiting[producer]) + object bufferLock = _mergeHelper._bufferLocks[producer]; + lock (bufferLock) { - Monitor.Pulse(bufferLock); + if (_mergeHelper._producerWaiting[producer]) + { + Monitor.Pulse(bufferLock); + } } } } diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs index 466102746d15aa..5a9ecf5eda2a22 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs @@ -83,6 +83,9 @@ internal HashRepartitionEnumerator( _barrier = barrier; _valueExchangeMatrix = valueExchangeMatrix; _cancellationToken = cancellationToken; + + if (ParallelEnumerable.SinglePartitionMode) + Debug.Assert(partitionCount == 1); } //--------------------------------------------------------------------------------------- @@ -120,6 +123,8 @@ internal override bool MoveNext(ref Pair currentElement, return false; } + Debug.Assert(!ParallelEnumerable.SinglePartitionMode); + Mutables? mutables = _mutables; if (mutables == null) mutables = _mutables = new Mutables(); diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs index b82e73c276f23d..477f0f1838942d 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs @@ -121,6 +121,8 @@ internal override bool MoveNext(ref Pair currentElement, return false; } + Debug.Assert(!ParallelEnumerable.SinglePartitionMode); + Mutables? mutables = _mutables; if (mutables == null) mutables = _mutables = new Mutables(); diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/DefaultIfEmptyQueryOperator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/DefaultIfEmptyQueryOperator.cs index 31f1a24f951923..78d145631e939d 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/DefaultIfEmptyQueryOperator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/DefaultIfEmptyQueryOperator.cs @@ -58,6 +58,8 @@ internal override void WrapPartitionedStream( PartitionedStream inputStream, IPartitionedStreamRecipient recipient, bool preferStriping, QuerySettings settings) { int partitionCount = inputStream.PartitionCount; + if (ParallelEnumerable.SinglePartitionMode) + Debug.Assert(partitionCount == 1); // Generate the shared data. Shared sharedEmptyCount = new Shared(0); @@ -153,7 +155,13 @@ internal override bool MoveNext([MaybeNullWhen(false), AllowNull] ref TSource cu if (!moveNextResult) { - if (_partitionIndex == 0) + if (ParallelEnumerable.SinglePartitionMode) + { + currentElement = _defaultValue; + currentKey = default(TKey)!; + return true; + } + else if (_partitionIndex == 0) { // If this is the 0th partition, we must wait for all others. Note: we could // actually do a wait-any here: if at least one other partition finds an element, diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/FirstQueryOperator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/FirstQueryOperator.cs index e7b1e1c94a0c75..da5f61f35206e0 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/FirstQueryOperator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/FirstQueryOperator.cs @@ -72,6 +72,8 @@ private void WrapHelper( PartitionedStream inputStream, IPartitionedStreamRecipient recipient, QuerySettings settings) { int partitionCount = inputStream.PartitionCount; + if (ParallelEnumerable.SinglePartitionMode) + Debug.Assert(partitionCount == 1); // Generate the shared data. FirstQueryOperatorState operatorState = new FirstQueryOperatorState(); @@ -200,9 +202,11 @@ internal override bool MoveNext([MaybeNullWhen(false), AllowNull] ref TSource cu } finally { - // No matter whether we exit due to an exception or normal completion, we must ensure - // that we signal other partitions that we have completed. Otherwise, we can cause deadlocks. - _sharedBarrier.Signal(); + if (!ParallelEnumerable.SinglePartitionMode) { + // No matter whether we exit due to an exception or normal completion, we must ensure + // that we signal other partitions that we have completed. Otherwise, we can cause deadlocks. + _sharedBarrier.Signal(); + } } _alreadySearched = true; @@ -210,7 +214,8 @@ internal override bool MoveNext([MaybeNullWhen(false), AllowNull] ref TSource cu // Wait only if we may have the result if (_partitionId == _operatorState._partitionId) { - _sharedBarrier.Wait(_cancellationToken); + if (!ParallelEnumerable.SinglePartitionMode) + _sharedBarrier.Wait(_cancellationToken); // Now re-read the shared index. If it's the same as ours, we won and return true. if (_partitionId == _operatorState._partitionId) diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/LastQueryOperator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/LastQueryOperator.cs index e8153f3240e38e..6d3de6b44b96cb 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/LastQueryOperator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/LastQueryOperator.cs @@ -72,6 +72,8 @@ internal override void WrapPartitionedStream( private void WrapHelper(PartitionedStream inputStream, IPartitionedStreamRecipient recipient, QuerySettings settings) { int partitionCount = inputStream.PartitionCount; + if (ParallelEnumerable.SinglePartitionMode) + Debug.Assert(partitionCount == 1); // Generate the shared data. LastQueryOperatorState operatorState = new LastQueryOperatorState(); @@ -212,7 +214,8 @@ internal override bool MoveNext([MaybeNullWhen(false), AllowNull] ref TSource cu // Only if we have a candidate do we wait. if (_partitionId == _operatorState._partitionId) { - _sharedBarrier.Wait(_cancellationToken); + if (!ParallelEnumerable.SinglePartitionMode) + _sharedBarrier.Wait(_cancellationToken); // Now re-read the shared index. If it's the same as ours, we won and return true. if (_operatorState._partitionId == _partitionId) diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipQueryOperator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipQueryOperator.cs index b8c1188ada9f38..586a301cf1059d 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipQueryOperator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipQueryOperator.cs @@ -108,6 +108,9 @@ private void WrapHelper(PartitionedStream inputStream, IPar FixedMaxHeap sharedIndices = new FixedMaxHeap(_count, inputStream.KeyComparer); // an array used to track the sequence of indices leading up to the Nth index CountdownEvent sharedBarrier = new CountdownEvent(partitionCount); // a barrier to synchronize before yielding + if (ParallelEnumerable.SinglePartitionMode) + Debug.Assert(partitionCount == 1); + PartitionedStream outputStream = new PartitionedStream(partitionCount, inputStream.KeyComparer, OrdinalIndexState); for (int i = 0; i < partitionCount; i++) @@ -222,9 +225,11 @@ internal override bool MoveNext([MaybeNullWhen(false), AllowNull] ref TResult cu } } - // Before exiting the search phase, we will synchronize with others. This is a barrier. - _sharedBarrier.Signal(); - _sharedBarrier.Wait(_cancellationToken); + if (!ParallelEnumerable.SinglePartitionMode) { + // Before exiting the search phase, we will synchronize with others. This is a barrier. + _sharedBarrier.Signal(); + _sharedBarrier.Wait(_cancellationToken); + } // Publish the buffer and set the index to just before the 1st element. _buffer = buffer; diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipWhileQueryOperator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipWhileQueryOperator.cs index 1e5f51591dcfe5..3624dfb29fc56d 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipWhileQueryOperator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipWhileQueryOperator.cs @@ -127,6 +127,8 @@ internal override void WrapPartitionedStream( private void WrapHelper(PartitionedStream inputStream, IPartitionedStreamRecipient recipient, QuerySettings settings) { int partitionCount = inputStream.PartitionCount; + if (ParallelEnumerable.SinglePartitionMode) + Debug.Assert(partitionCount == 1); // Create shared data. OperatorState operatorState = new OperatorState(); @@ -321,13 +323,16 @@ internal override bool MoveNext([MaybeNullWhen(false), AllowNull] ref TResult cu } finally { - // No matter whether we exit due to an exception or normal completion, we must ensure - // that we signal other partitions that we have completed. Otherwise, we can cause deadlocks. - _sharedBarrier.Signal(); + if (!ParallelEnumerable.SinglePartitionMode) { + // No matter whether we exit due to an exception or normal completion, we must ensure + // that we signal other partitions that we have completed. Otherwise, we can cause deadlocks. + _sharedBarrier.Signal(); + } } // Before exiting the search phase, we will synchronize with others. This is a barrier. - _sharedBarrier.Wait(_cancellationToken); + if (!ParallelEnumerable.SinglePartitionMode) + _sharedBarrier.Wait(_cancellationToken); // Publish the buffer and set the index to just before the 1st element. _buffer = buffer; diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs index ccac54907c3198..b419c38ce7839c 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs @@ -18,6 +18,7 @@ namespace System.Linq.Parallel { + [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] internal sealed class OrderPreservingPipeliningSpoolingTask : SpoolingTaskBase { private readonly QueryTaskGroupState _taskGroupState; // State shared among tasks. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/SpoolingTask.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/SpoolingTask.cs index 440be3d9f9ce00..55cfdc28c66827 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/SpoolingTask.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/SpoolingTask.cs @@ -82,6 +82,7 @@ internal static void SpoolStopAndGo( // taskScheduler - the task manager on which to execute // + [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] internal static void SpoolPipeline( QueryTaskGroupState groupState, PartitionedStream partitions, AsynchronousChannel[] channels, TaskScheduler taskScheduler) @@ -264,6 +265,7 @@ protected override void SpoolingFinally() /// /// /// + [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] internal sealed class PipelineSpoolingTask : SpoolingTaskBase { // The data source from which to pull data. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Sorting.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Sorting.cs index 6461b11a1bb26d..f2f8f5135a7e42 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Sorting.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Sorting.cs @@ -204,6 +204,7 @@ internal override TInputOutput[] Sort() // Step 3. Enter into the merging phases, each separated by several barriers. if (_partitionCount > 1) { + Debug.Assert(!ParallelEnumerable.SinglePartitionMode); // We only need to merge if there is more than 1 partition. MergeSortCooperatively(); } @@ -357,6 +358,7 @@ private void QuickSortIndicesInPlace(GrowingArray keys, List // negatively impact speedups. // + [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] private void MergeSortCooperatively() { CancellationToken cancelToken = _groupState.CancellationState.MergedCancellationToken; diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs index f4f870c316423a..0bb4d6990a9f5a 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs @@ -62,6 +62,11 @@ public static class ParallelEnumerable + "System.Collections.Generic.IEnumerable. To fix this problem, use the AsParallel() extension method " + "to convert the right data source to System.Linq.ParallelQuery."; + // When running in single partition mode, PLINQ operations will occur on a single partition and will not + // be executed in parallel, but will retain PLINQ semantics (exceptions wrapped as aggregates, etc). + [System.Runtime.Versioning.SupportedOSPlatformGuard("browser")] + internal static bool SinglePartitionMode => OperatingSystem.IsBrowser(); + //----------------------------------------------------------------------------------- // Converts any IEnumerable into something that can be the target of parallel // query execution. diff --git a/src/libraries/System.Linq/src/System/Linq/Max.cs b/src/libraries/System.Linq/src/System/Linq/Max.cs index 6a847068c5fa6d..2c05d2dc29dbbb 100644 --- a/src/libraries/System.Linq/src/System/Linq/Max.cs +++ b/src/libraries/System.Linq/src/System/Linq/Max.cs @@ -583,15 +583,22 @@ public static decimal Max(this IEnumerable source) if (default(TKey) is null) { - while (key == null) + if (key == null) { - if (!e.MoveNext()) + TSource firstValue = value; + + do { - return value; - } + if (!e.MoveNext()) + { + // All keys are null, surface the first element. + return firstValue; + } - value = e.Current; - key = keySelector(value); + value = e.Current; + key = keySelector(value); + } + while (key == null); } while (e.MoveNext()) diff --git a/src/libraries/System.Linq/src/System/Linq/Min.cs b/src/libraries/System.Linq/src/System/Linq/Min.cs index a66b0cfcf88fdf..9f9266ff1bb83b 100644 --- a/src/libraries/System.Linq/src/System/Linq/Min.cs +++ b/src/libraries/System.Linq/src/System/Linq/Min.cs @@ -541,15 +541,22 @@ public static decimal Min(this IEnumerable source) if (default(TKey) is null) { - while (key == null) + if (key == null) { - if (!e.MoveNext()) + TSource firstValue = value; + + do { - return value; - } + if (!e.MoveNext()) + { + // All keys are null, surface the first element. + return firstValue; + } - value = e.Current; - key = keySelector(value); + value = e.Current; + key = keySelector(value); + } + while (key == null); } while (e.MoveNext()) diff --git a/src/libraries/System.Linq/tests/MaxTests.cs b/src/libraries/System.Linq/tests/MaxTests.cs index c69945636c4673..78318b64b1194e 100644 --- a/src/libraries/System.Linq/tests/MaxTests.cs +++ b/src/libraries/System.Linq/tests/MaxTests.cs @@ -890,27 +890,27 @@ public static void MaxBy_Generic_EmptyReferenceSource_ReturnsNull() } [Fact] - public static void MaxBy_Generic_StructSourceAllKeysAreNull_ReturnsLastElement() + public static void MaxBy_Generic_StructSourceAllKeysAreNull_ReturnsFirstElement() { - Assert.Equal(4, Enumerable.Range(0, 5).MaxBy(x => default(string))); - Assert.Equal(4, Enumerable.Range(0, 5).MaxBy(x => default(string), comparer: null)); - Assert.Equal(4, Enumerable.Range(0, 5).MaxBy(x => default(string), Comparer.Create((_, _) => throw new InvalidOperationException("comparer should not be called.")))); + Assert.Equal(0, Enumerable.Range(0, 5).MaxBy(x => default(string))); + Assert.Equal(0, Enumerable.Range(0, 5).MaxBy(x => default(string), comparer: null)); + Assert.Equal(0, Enumerable.Range(0, 5).MaxBy(x => default(string), Comparer.Create((_, _) => throw new InvalidOperationException("comparer should not be called.")))); } [Fact] - public static void MaxBy_Generic_NullableSourceAllKeysAreNull_ReturnsLastElement() + public static void MaxBy_Generic_NullableSourceAllKeysAreNull_ReturnsFirstElement() { - Assert.Equal(4, Enumerable.Range(0, 5).Cast().MaxBy(x => default(int?))); - Assert.Equal(4, Enumerable.Range(0, 5).Cast().MaxBy(x => default(int?), comparer: null)); - Assert.Equal(4, Enumerable.Range(0, 5).Cast().MaxBy(x => default(int?), Comparer.Create((_, _) => throw new InvalidOperationException("comparer should not be called.")))); + Assert.Equal(0, Enumerable.Range(0, 5).Cast().MaxBy(x => default(int?))); + Assert.Equal(0, Enumerable.Range(0, 5).Cast().MaxBy(x => default(int?), comparer: null)); + Assert.Equal(0, Enumerable.Range(0, 5).Cast().MaxBy(x => default(int?), Comparer.Create((_, _) => throw new InvalidOperationException("comparer should not be called.")))); } [Fact] - public static void MaxBy_Generic_ReferenceSourceAllKeysAreNull_ReturnsLastElement() + public static void MaxBy_Generic_ReferenceSourceAllKeysAreNull_ReturnsFirstElement() { - Assert.Equal("4", Enumerable.Range(0, 5).Select(x => x.ToString()).MaxBy(x => default(string))); - Assert.Equal("4", Enumerable.Range(0, 5).Select(x => x.ToString()).MaxBy(x => default(string), comparer: null)); - Assert.Equal("4", Enumerable.Range(0, 5).Select(x => x.ToString()).MaxBy(x => default(string), Comparer.Create((_, _) => throw new InvalidOperationException("comparer should not be called.")))); + Assert.Equal("0", Enumerable.Range(0, 5).Select(x => x.ToString()).MaxBy(x => default(string))); + Assert.Equal("0", Enumerable.Range(0, 5).Select(x => x.ToString()).MaxBy(x => default(string), comparer: null)); + Assert.Equal("0", Enumerable.Range(0, 5).Select(x => x.ToString()).MaxBy(x => default(string), Comparer.Create((_, _) => throw new InvalidOperationException("comparer should not be called.")))); } [Theory] diff --git a/src/libraries/System.Linq/tests/MinTests.cs b/src/libraries/System.Linq/tests/MinTests.cs index ab6af55c36e78c..31296da12c6918 100644 --- a/src/libraries/System.Linq/tests/MinTests.cs +++ b/src/libraries/System.Linq/tests/MinTests.cs @@ -868,27 +868,27 @@ public static void MinBy_Generic_EmptyReferenceSource_ReturnsNull() } [Fact] - public static void MinBy_Generic_StructSourceAllKeysAreNull_ReturnsLastElement() + public static void MinBy_Generic_StructSourceAllKeysAreNull_ReturnsFirstElement() { - Assert.Equal(4, Enumerable.Range(0, 5).MinBy(x => default(string))); - Assert.Equal(4, Enumerable.Range(0, 5).MinBy(x => default(string), comparer: null)); - Assert.Equal(4, Enumerable.Range(0, 5).MinBy(x => default(string), Comparer.Create((_, _) => throw new InvalidOperationException("comparer should not be called.")))); + Assert.Equal(0, Enumerable.Range(0, 5).MinBy(x => default(string))); + Assert.Equal(0, Enumerable.Range(0, 5).MinBy(x => default(string), comparer: null)); + Assert.Equal(0, Enumerable.Range(0, 5).MinBy(x => default(string), Comparer.Create((_, _) => throw new InvalidOperationException("comparer should not be called.")))); } [Fact] - public static void MinBy_Generic_NullableSourceAllKeysAreNull_ReturnsLastElement() + public static void MinBy_Generic_NullableSourceAllKeysAreNull_ReturnsFirstElement() { - Assert.Equal(4, Enumerable.Range(0, 5).Cast().MinBy(x => default(int?))); - Assert.Equal(4, Enumerable.Range(0, 5).Cast().MinBy(x => default(int?), comparer: null)); - Assert.Equal(4, Enumerable.Range(0, 5).Cast().MinBy(x => default(int?), Comparer.Create((_, _) => throw new InvalidOperationException("comparer should not be called.")))); + Assert.Equal(0, Enumerable.Range(0, 5).Cast().MinBy(x => default(int?))); + Assert.Equal(0, Enumerable.Range(0, 5).Cast().MinBy(x => default(int?), comparer: null)); + Assert.Equal(0, Enumerable.Range(0, 5).Cast().MinBy(x => default(int?), Comparer.Create((_, _) => throw new InvalidOperationException("comparer should not be called.")))); } [Fact] - public static void MinBy_Generic_ReferenceSourceAllKeysAreNull_ReturnsLastElement() + public static void MinBy_Generic_ReferenceSourceAllKeysAreNull_ReturnsFirstElement() { - Assert.Equal("4", Enumerable.Range(0, 5).Select(x => x.ToString()).MinBy(x => default(string))); - Assert.Equal("4", Enumerable.Range(0, 5).Select(x => x.ToString()).MinBy(x => default(string), comparer: null)); - Assert.Equal("4", Enumerable.Range(0, 5).Select(x => x.ToString()).MinBy(x => default(string), Comparer.Create((_, _) => throw new InvalidOperationException("comparer should not be called.")))); + Assert.Equal("0", Enumerable.Range(0, 5).Select(x => x.ToString()).MinBy(x => default(string))); + Assert.Equal("0", Enumerable.Range(0, 5).Select(x => x.ToString()).MinBy(x => default(string), comparer: null)); + Assert.Equal("0", Enumerable.Range(0, 5).Select(x => x.ToString()).MinBy(x => default(string), Comparer.Create((_, _) => throw new InvalidOperationException("comparer should not be called.")))); } [Theory] diff --git a/src/libraries/System.Management/src/System.Management.csproj b/src/libraries/System.Management/src/System.Management.csproj index 3078de74ffc793..a90719285f052b 100644 --- a/src/libraries/System.Management/src/System.Management.csproj +++ b/src/libraries/System.Management/src/System.Management.csproj @@ -2,6 +2,10 @@ true $(NoWarn);0618 + + $(NoWarn);CA1845 + annotations true $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum);netstandard2.0 true @@ -70,9 +74,11 @@ System.Management.SelectQuery + + diff --git a/src/libraries/System.Management/src/System/Management/ManagementEventWatcher.cs b/src/libraries/System.Management/src/System/Management/ManagementEventWatcher.cs index 95e5a894a95497..26b33f9529682b 100644 --- a/src/libraries/System.Management/src/System/Management/ManagementEventWatcher.cs +++ b/src/libraries/System.Management/src/System/Management/ManagementEventWatcher.cs @@ -701,7 +701,7 @@ private void Cancel2(object o) // // Try catch the call to cancel. In this case the cancel is being done without the client // knowing about it so catching all exceptions is not a bad thing to do. If a client calls - // Stop (which calls Cancel), they will still recieve any exceptions that may have occured. + // Stop (which calls Cancel), they will still receive any exceptions that may have occured. // try { diff --git a/src/libraries/System.Memory/tests/Span/Contains.T.cs b/src/libraries/System.Memory/tests/Span/Contains.T.cs index a6846e5aa3e586..c1543c098e2547 100644 --- a/src/libraries/System.Memory/tests/Span/Contains.T.cs +++ b/src/libraries/System.Memory/tests/Span/Contains.T.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Collections.Generic; +using System.Linq; using Xunit; namespace System.SpanTests @@ -193,5 +195,114 @@ public static void ContainsNull_String(string[] spanInput, bool expected) Span theStrings = spanInput; Assert.Equal(expected, theStrings.Contains(null)); } + + [Theory] + [InlineData(new int[] { 1, 2, 3, 4 }, 4, true)] + [InlineData(new int[] { 1, 2, 3, 4 }, 5, false)] + public static void Contains_Int32(int[] array, int value, bool expectedResult) + { + // Test with short Span + Span span = new Span(array); + bool result = span.Contains(value); + Assert.Equal(result, expectedResult); + + // Test with long Span + for (int i = 0; i < 10; i++) + array = array.Concat(array).ToArray(); + span = new Span(array); + result = span.Contains(value); + Assert.Equal(result, expectedResult); + } + + [Theory] + [InlineData(new long[] { 1, 2, 3, 4 }, 4, true)] + [InlineData(new long[] { 1, 2, 3, 4 }, 5, false)] + public static void Contains_Int64(long[] array, long value, bool expectedResult) + { + // Test with short Span + Span span = new Span(array); + bool result = span.Contains(value); + Assert.Equal(result, expectedResult); + + // Test with long Span + for (int i = 0; i < 10; i++) + array = array.Concat(array).ToArray(); + span = new Span(array); + result = span.Contains(value); + Assert.Equal(result, expectedResult); + } + + [Theory] + [InlineData(new byte[] { 1, 2, 3, 4 }, 4, true)] + [InlineData(new byte[] { 1, 2, 3, 4 }, 5, false)] + public static void Contains_Byte(byte[] array, byte value, bool expectedResult) + { + // Test with short Span + Span span = new Span(array); + bool result = span.Contains(value); + Assert.Equal(result, expectedResult); + + // Test with long Span + for (int i = 0; i < 10; i++) + array = array.Concat(array).ToArray(); + span = new Span(array); + result = span.Contains(value); + Assert.Equal(result, expectedResult); + } + + [Theory] + [InlineData(new char[] { 'a', 'b', 'c', 'd' }, 'd', true)] + [InlineData(new char[] { 'a', 'b', 'c', 'd' }, 'e', false)] + public static void Contains_Char(char[] array, char value, bool expectedResult) + { + // Test with short Span + Span span = new Span(array); + bool result = span.Contains(value); + Assert.Equal(result, expectedResult); + + // Test with long Span + for (int i = 0; i < 10; i++) + array = array.Concat(array).ToArray(); + span = new Span(array); + result = span.Contains(value); + Assert.Equal(result, expectedResult); + + } + + [Theory] + [InlineData(new float[] { 1, 2, 3, 4 }, 4, true)] + [InlineData(new float[] { 1, 2, 3, 4 }, 5, false)] + public static void Contains_Float(float[] array, float value, bool expectedResult) + { + // Test with short Span + Span span = new Span(array); + bool result = span.Contains(value); + Assert.Equal(result, expectedResult); + + // Test with long Span + for (int i = 0; i < 10; i++) + array = array.Concat(array).ToArray(); + span = new Span(array); + result = span.Contains(value); + Assert.Equal(result, expectedResult); + } + + [Theory] + [InlineData(new double[] { 1, 2, 3, 4 }, 4, true)] + [InlineData(new double[] { 1, 2, 3, 4 }, 5, false)] + public static void Contains_Double(double[] array, double value, bool expectedResult) + { + // Test with short Span + Span span = new Span(array); + bool result = span.Contains(value); + Assert.Equal(result, expectedResult); + + // Test with long Span + for (int i = 0; i < 10; i++) + array = array.Concat(array).ToArray(); + span = new Span(array); + result = span.Contains(value); + Assert.Equal(result, expectedResult); + } } } diff --git a/src/libraries/System.Net.Http.WinHttpHandler/src/System.Net.Http.WinHttpHandler.csproj b/src/libraries/System.Net.Http.WinHttpHandler/src/System.Net.Http.WinHttpHandler.csproj index 7d1b51376a3db6..3ff105557a87bd 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/src/System.Net.Http.WinHttpHandler.csproj +++ b/src/libraries/System.Net.Http.WinHttpHandler/src/System.Net.Http.WinHttpHandler.csproj @@ -119,12 +119,17 @@ System.Net.Http.WinHttpHandler + + + + + diff --git a/src/libraries/System.Net.Http.WinHttpHandler/tests/UnitTests/System.Net.Http.WinHttpHandler.Unit.Tests.csproj b/src/libraries/System.Net.Http.WinHttpHandler/tests/UnitTests/System.Net.Http.WinHttpHandler.Unit.Tests.csproj index 95be65335cc3aa..381230d2a9bc3e 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/tests/UnitTests/System.Net.Http.WinHttpHandler.Unit.Tests.csproj +++ b/src/libraries/System.Net.Http.WinHttpHandler/tests/UnitTests/System.Net.Http.WinHttpHandler.Unit.Tests.csproj @@ -5,6 +5,7 @@ ../../src/Resources/Strings.resx $(NetCoreAppCurrent)-windows UNITTEST + true annotations diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs index c31e628159db0e..ee53b9e626c751 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs @@ -1051,7 +1051,7 @@ private HeaderDescriptor GetHeaderDescriptor(string name) throw new InvalidOperationException(SR.Format(SR.net_http_headers_not_allowed_header_name, name)); } - private bool TryGetHeaderDescriptor(string name, out HeaderDescriptor descriptor) + internal bool TryGetHeaderDescriptor(string name, out HeaderDescriptor descriptor) { if (string.IsNullOrEmpty(name)) { diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeadersNonValidated.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeadersNonValidated.cs index ad1a1850ea83c4..5e67476d116a99 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeadersNonValidated.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeadersNonValidated.cs @@ -32,7 +32,7 @@ namespace System.Net.Http.Headers /// true if the collection contains the header; otherwise, false. public bool Contains(string headerName) => _headers is HttpHeaders headers && - HeaderDescriptor.TryGet(headerName, out HeaderDescriptor descriptor) && + headers.TryGetHeaderDescriptor(headerName, out HeaderDescriptor descriptor) && headers.TryGetHeaderValue(descriptor, out _); /// Gets the values for the specified header name. @@ -62,7 +62,7 @@ public HeaderStringValues this[string headerName] public bool TryGetValues(string headerName, out HeaderStringValues values) { if (_headers is HttpHeaders headers && - HeaderDescriptor.TryGet(headerName, out HeaderDescriptor descriptor) && + headers.TryGetHeaderDescriptor(headerName, out HeaderDescriptor descriptor) && headers.TryGetHeaderValue(descriptor, out object? info)) { HttpHeaders.GetStoreValuesAsStringOrStringArray(descriptor, info, out string? singleValue, out string[]? multiValue); diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.NtAuth.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.NtAuth.cs index 52edbb5a80cbac..09bee9a1952568 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.NtAuth.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.NtAuth.cs @@ -61,7 +61,7 @@ private static bool ProxySupportsConnectionAuth(HttpResponseMessage response) foreach (string v in values) { - if (v == "Session-Based-Authentication") + if (v.Equals("Session-Based-Authentication", StringComparison.OrdinalIgnoreCase)) { return true; } diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ChunkedEncodingReadStream.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ChunkedEncodingReadStream.cs index ff87d5a89f9432..e4ecc124a1e469 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ChunkedEncodingReadStream.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ChunkedEncodingReadStream.cs @@ -37,17 +37,27 @@ public ChunkedEncodingReadStream(HttpConnection connection, HttpResponseMessage public override int Read(Span buffer) { - if (_connection == null || buffer.Length == 0) + if (_connection == null) { - // Response body fully consumed or the caller didn't ask for any data. + // Response body fully consumed return 0; } - // Try to consume from data we already have in the buffer. - int bytesRead = ReadChunksFromConnectionBuffer(buffer, cancellationRegistration: default); - if (bytesRead > 0) + if (buffer.Length == 0) + { + if (PeekChunkFromConnectionBuffer()) + { + return 0; + } + } + else { - return bytesRead; + // Try to consume from data we already have in the buffer. + int bytesRead = ReadChunksFromConnectionBuffer(buffer, cancellationRegistration: default); + if (bytesRead > 0) + { + return bytesRead; + } } // Nothing available to consume. Fall back to I/O. @@ -68,7 +78,8 @@ public override int Read(Span buffer) // as the connection buffer. That avoids an unnecessary copy while still reading // the maximum amount we'd otherwise read at a time. Debug.Assert(_connection.RemainingBuffer.Length == 0); - bytesRead = _connection.Read(buffer.Slice(0, (int)Math.Min((ulong)buffer.Length, _chunkBytesRemaining))); + Debug.Assert(buffer.Length != 0); + int bytesRead = _connection.Read(buffer.Slice(0, (int)Math.Min((ulong)buffer.Length, _chunkBytesRemaining))); if (bytesRead == 0) { throw new IOException(SR.Format(SR.net_http_invalid_response_premature_eof_bytecount, _chunkBytesRemaining)); @@ -81,15 +92,35 @@ public override int Read(Span buffer) return bytesRead; } + if (buffer.Length == 0) + { + // User requested a zero-byte read, and we have no data available in the buffer for processing. + // This zero-byte read indicates their desire to trade off the extra cost of a zero-byte read + // for reduced memory consumption when data is not immediately available. + // So, we will issue our own zero-byte read against the underlying stream to allow it to make use of + // optimizations, such as deferring buffer allocation until data is actually available. + _connection.Read(buffer); + } + // We're only here if we need more data to make forward progress. _connection.Fill(); // Now that we have more, see if we can get any response data, and if // we can we're done. - int bytesCopied = ReadChunksFromConnectionBuffer(buffer, cancellationRegistration: default); - if (bytesCopied > 0) + if (buffer.Length == 0) { - return bytesCopied; + if (PeekChunkFromConnectionBuffer()) + { + return 0; + } + } + else + { + int bytesCopied = ReadChunksFromConnectionBuffer(buffer, cancellationRegistration: default); + if (bytesCopied > 0) + { + return bytesCopied; + } } } } @@ -102,17 +133,27 @@ public override ValueTask ReadAsync(Memory buffer, CancellationToken return ValueTask.FromCanceled(cancellationToken); } - if (_connection == null || buffer.Length == 0) + if (_connection == null) { - // Response body fully consumed or the caller didn't ask for any data. + // Response body fully consumed return new ValueTask(0); } - // Try to consume from data we already have in the buffer. - int bytesRead = ReadChunksFromConnectionBuffer(buffer.Span, cancellationRegistration: default); - if (bytesRead > 0) + if (buffer.Length == 0) { - return new ValueTask(bytesRead); + if (PeekChunkFromConnectionBuffer()) + { + return new ValueTask(0); + } + } + else + { + // Try to consume from data we already have in the buffer. + int bytesRead = ReadChunksFromConnectionBuffer(buffer.Span, cancellationRegistration: default); + if (bytesRead > 0) + { + return new ValueTask(bytesRead); + } } // We may have just consumed the remainder of the response (with no actual data @@ -132,7 +173,6 @@ private async ValueTask ReadAsyncCore(Memory buffer, CancellationToke // Should only be called if ReadChunksFromConnectionBuffer returned 0. Debug.Assert(_connection != null); - Debug.Assert(buffer.Length > 0); CancellationTokenRegistration ctr = _connection.RegisterCancellation(cancellationToken); try @@ -154,6 +194,7 @@ private async ValueTask ReadAsyncCore(Memory buffer, CancellationToke // as the connection buffer. That avoids an unnecessary copy while still reading // the maximum amount we'd otherwise read at a time. Debug.Assert(_connection.RemainingBuffer.Length == 0); + Debug.Assert(buffer.Length != 0); int bytesRead = await _connection.ReadAsync(buffer.Slice(0, (int)Math.Min((ulong)buffer.Length, _chunkBytesRemaining))).ConfigureAwait(false); if (bytesRead == 0) { @@ -167,15 +208,35 @@ private async ValueTask ReadAsyncCore(Memory buffer, CancellationToke return bytesRead; } + if (buffer.Length == 0) + { + // User requested a zero-byte read, and we have no data available in the buffer for processing. + // This zero-byte read indicates their desire to trade off the extra cost of a zero-byte read + // for reduced memory consumption when data is not immediately available. + // So, we will issue our own zero-byte read against the underlying stream to allow it to make use of + // optimizations, such as deferring buffer allocation until data is actually available. + await _connection.ReadAsync(buffer).ConfigureAwait(false); + } + // We're only here if we need more data to make forward progress. await _connection.FillAsync(async: true).ConfigureAwait(false); // Now that we have more, see if we can get any response data, and if // we can we're done. - int bytesCopied = ReadChunksFromConnectionBuffer(buffer.Span, ctr); - if (bytesCopied > 0) + if (buffer.Length == 0) { - return bytesCopied; + if (PeekChunkFromConnectionBuffer()) + { + return 0; + } + } + else + { + int bytesCopied = ReadChunksFromConnectionBuffer(buffer.Span, ctr); + if (bytesCopied > 0) + { + return bytesCopied; + } } } } @@ -208,8 +269,7 @@ private async Task CopyToAsyncCore(Stream destination, CancellationToken cancell { while (true) { - ReadOnlyMemory bytesRead = ReadChunkFromConnectionBuffer(int.MaxValue, ctr); - if (bytesRead.Length == 0) + if (ReadChunkFromConnectionBuffer(int.MaxValue, ctr) is not ReadOnlyMemory bytesRead || bytesRead.Length == 0) { break; } @@ -235,18 +295,23 @@ private async Task CopyToAsyncCore(Stream destination, CancellationToken cancell } } + private bool PeekChunkFromConnectionBuffer() + { + return ReadChunkFromConnectionBuffer(maxBytesToRead: 0, cancellationRegistration: default).HasValue; + } + private int ReadChunksFromConnectionBuffer(Span buffer, CancellationTokenRegistration cancellationRegistration) { + Debug.Assert(buffer.Length > 0); int totalBytesRead = 0; while (buffer.Length > 0) { - ReadOnlyMemory bytesRead = ReadChunkFromConnectionBuffer(buffer.Length, cancellationRegistration); - Debug.Assert(bytesRead.Length <= buffer.Length); - if (bytesRead.Length == 0) + if (ReadChunkFromConnectionBuffer(buffer.Length, cancellationRegistration) is not ReadOnlyMemory bytesRead || bytesRead.Length == 0) { break; } + Debug.Assert(bytesRead.Length <= buffer.Length); totalBytesRead += bytesRead.Length; bytesRead.Span.CopyTo(buffer); buffer = buffer.Slice(bytesRead.Length); @@ -254,9 +319,9 @@ private int ReadChunksFromConnectionBuffer(Span buffer, CancellationTokenR return totalBytesRead; } - private ReadOnlyMemory ReadChunkFromConnectionBuffer(int maxBytesToRead, CancellationTokenRegistration cancellationRegistration) + private ReadOnlyMemory? ReadChunkFromConnectionBuffer(int maxBytesToRead, CancellationTokenRegistration cancellationRegistration) { - Debug.Assert(maxBytesToRead > 0 && _connection != null); + Debug.Assert(_connection != null); try { @@ -310,7 +375,7 @@ private ReadOnlyMemory ReadChunkFromConnectionBuffer(int maxBytesToRead, C } int bytesToConsume = Math.Min(maxBytesToRead, (int)Math.Min((ulong)connectionBuffer.Length, _chunkBytesRemaining)); - Debug.Assert(bytesToConsume > 0); + Debug.Assert(bytesToConsume > 0 || maxBytesToRead == 0); _connection.ConsumeFromRemainingBuffer(bytesToConsume); _chunkBytesRemaining -= (ulong)bytesToConsume; @@ -441,8 +506,7 @@ public override async ValueTask DrainAsync(int maxDrainBytes) drainedBytes += _connection.RemainingBuffer.Length; while (true) { - ReadOnlyMemory bytesRead = ReadChunkFromConnectionBuffer(int.MaxValue, ctr); - if (bytesRead.Length == 0) + if (ReadChunkFromConnectionBuffer(int.MaxValue, ctr) is not ReadOnlyMemory bytesRead || bytesRead.Length == 0) { break; } diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectionCloseReadStream.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectionCloseReadStream.cs index 0fd011037b9310..7bddf399572202 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectionCloseReadStream.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectionCloseReadStream.cs @@ -18,14 +18,14 @@ public ConnectionCloseReadStream(HttpConnection connection) : base(connection) public override int Read(Span buffer) { HttpConnection? connection = _connection; - if (connection == null || buffer.Length == 0) + if (connection == null) { - // Response body fully consumed or the caller didn't ask for any data + // Response body fully consumed return 0; } int bytesRead = connection.Read(buffer); - if (bytesRead == 0) + if (bytesRead == 0 && buffer.Length != 0) { // We cannot reuse this connection, so close it. _connection = null; @@ -40,9 +40,9 @@ public override async ValueTask ReadAsync(Memory buffer, Cancellation CancellationHelper.ThrowIfCancellationRequested(cancellationToken); HttpConnection? connection = _connection; - if (connection == null || buffer.Length == 0) + if (connection == null) { - // Response body fully consumed or the caller didn't ask for any data + // Response body fully consumed return 0; } @@ -69,7 +69,7 @@ public override async ValueTask ReadAsync(Memory buffer, Cancellation } } - if (bytesRead == 0) + if (bytesRead == 0 && buffer.Length != 0) { // If cancellation is requested and tears down the connection, it could cause the read // to return 0, which would otherwise signal the end of the data, but that would lead diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ContentLengthReadStream.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ContentLengthReadStream.cs index 786f285a93c75e..97f9ddf6b2b5ce 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ContentLengthReadStream.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ContentLengthReadStream.cs @@ -22,9 +22,9 @@ public ContentLengthReadStream(HttpConnection connection, ulong contentLength) : public override int Read(Span buffer) { - if (_connection == null || buffer.Length == 0) + if (_connection == null) { - // Response body fully consumed or the caller didn't ask for any data. + // Response body fully consumed return 0; } @@ -35,7 +35,7 @@ public override int Read(Span buffer) } int bytesRead = _connection.Read(buffer); - if (bytesRead <= 0) + if (bytesRead <= 0 && buffer.Length != 0) { // Unexpected end of response stream. throw new IOException(SR.Format(SR.net_http_invalid_response_premature_eof_bytecount, _contentBytesRemaining)); @@ -58,9 +58,9 @@ public override async ValueTask ReadAsync(Memory buffer, Cancellation { CancellationHelper.ThrowIfCancellationRequested(cancellationToken); - if (_connection == null || buffer.Length == 0) + if (_connection == null) { - // Response body fully consumed or the caller didn't ask for any data + // Response body fully consumed return 0; } @@ -94,7 +94,7 @@ public override async ValueTask ReadAsync(Memory buffer, Cancellation } } - if (bytesRead <= 0) + if (bytesRead == 0 && buffer.Length != 0) { // A cancellation request may have caused the EOF. CancellationHelper.ThrowIfCancellationRequested(cancellationToken); diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs index 5c3fde8ea8fc62..b5d5ffa8b84698 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs @@ -1040,8 +1040,6 @@ public async Task ReadResponseHeadersAsync(CancellationToken cancellationToken) private (bool wait, int bytesRead) TryReadFromBuffer(Span buffer, bool partOfSyncRead = false) { - Debug.Assert(buffer.Length > 0); - Debug.Assert(!Monitor.IsEntered(SyncObject)); lock (SyncObject) { @@ -1073,11 +1071,6 @@ public async Task ReadResponseHeadersAsync(CancellationToken cancellationToken) public int ReadData(Span buffer, HttpResponseMessage responseMessage) { - if (buffer.Length == 0) - { - return 0; - } - (bool wait, int bytesRead) = TryReadFromBuffer(buffer, partOfSyncRead: true); if (wait) { @@ -1092,7 +1085,7 @@ public int ReadData(Span buffer, HttpResponseMessage responseMessage) { _windowManager.AdjustWindow(bytesRead, this); } - else + else if (buffer.Length != 0) { // We've hit EOF. Pull in from the Http2Stream any trailers that were temporarily stored there. MoveTrailersToResponseMessage(responseMessage); @@ -1103,11 +1096,6 @@ public int ReadData(Span buffer, HttpResponseMessage responseMessage) public async ValueTask ReadDataAsync(Memory buffer, HttpResponseMessage responseMessage, CancellationToken cancellationToken) { - if (buffer.Length == 0) - { - return 0; - } - (bool wait, int bytesRead) = TryReadFromBuffer(buffer.Span); if (wait) { @@ -1121,7 +1109,7 @@ public async ValueTask ReadDataAsync(Memory buffer, HttpResponseMessa { _windowManager.AdjustWindow(bytesRead, this); } - else + else if (buffer.Length != 0) { // We've hit EOF. Pull in from the Http2Stream any trailers that were temporarily stored there. MoveTrailersToResponseMessage(responseMessage); diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs index 64f9833e0aa237..e14302ef51f216 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs @@ -839,8 +839,9 @@ private async ValueTask ReadHeadersAsync(long headersLength, CancellationToken c } int processLength = (int)Math.Min(headersLength, _recvBuffer.ActiveLength); + bool endHeaders = headersLength == processLength; - _headerDecoder.Decode(_recvBuffer.ActiveSpan.Slice(0, processLength), this); + _headerDecoder.Decode(_recvBuffer.ActiveSpan.Slice(0, processLength), endHeaders, this); _recvBuffer.Discard(processLength); headersLength -= processLength; } @@ -1050,7 +1051,7 @@ private int ReadResponseContent(HttpResponseMessage response, Span buffer) { int totalBytesRead = 0; - while (buffer.Length != 0) + do { // Sync over async here -- QUIC implementation does it per-I/O already; this is at least more coarse-grained. if (_responseDataPayloadRemaining <= 0 && !ReadNextDataFrameAsync(response, CancellationToken.None).AsTask().GetAwaiter().GetResult()) @@ -1086,7 +1087,7 @@ private int ReadResponseContent(HttpResponseMessage response, Span buffer) int copyLen = (int)Math.Min(buffer.Length, _responseDataPayloadRemaining); int bytesRead = _stream.Read(buffer.Slice(0, copyLen)); - if (bytesRead == 0) + if (bytesRead == 0 && buffer.Length != 0) { throw new HttpRequestException(SR.Format(SR.net_http_invalid_response_premature_eof_bytecount, _responseDataPayloadRemaining)); } @@ -1100,6 +1101,7 @@ private int ReadResponseContent(HttpResponseMessage response, Span buffer) break; } } + while (buffer.Length != 0); return totalBytesRead; } @@ -1120,7 +1122,7 @@ private async ValueTask ReadResponseContentAsync(HttpResponseMessage respon { int totalBytesRead = 0; - while (buffer.Length != 0) + do { if (_responseDataPayloadRemaining <= 0 && !await ReadNextDataFrameAsync(response, cancellationToken).ConfigureAwait(false)) { @@ -1155,7 +1157,7 @@ private async ValueTask ReadResponseContentAsync(HttpResponseMessage respon int copyLen = (int)Math.Min(buffer.Length, _responseDataPayloadRemaining); int bytesRead = await _stream.ReadAsync(buffer.Slice(0, copyLen), cancellationToken).ConfigureAwait(false); - if (bytesRead == 0) + if (bytesRead == 0 && buffer.Length != 0) { throw new HttpRequestException(SR.Format(SR.net_http_invalid_response_premature_eof_bytecount, _responseDataPayloadRemaining)); } @@ -1169,6 +1171,7 @@ private async ValueTask ReadResponseContentAsync(HttpResponseMessage respon break; } } + while (buffer.Length != 0); return totalBytesRead; } diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs index c7814464a87f66..d75ed2779f0428 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs @@ -1708,8 +1708,6 @@ private async ValueTask ReadAsync(Memory destination) private int ReadBuffered(Span destination) { // This is called when reading the response body. - Debug.Assert(destination.Length != 0); - int remaining = _readLength - _readOffset; if (remaining > 0) { @@ -1731,7 +1729,7 @@ private int ReadBuffered(Span destination) // Do a buffered read directly against the underlying stream. Debug.Assert(_readAheadTask == null, "Read ahead task should have been consumed as part of the headers."); - int bytesRead = _stream.Read(_readBuffer, 0, _readBuffer.Length); + int bytesRead = _stream.Read(_readBuffer, 0, destination.Length == 0 ? 0 : _readBuffer.Length); if (NetEventSource.Log.IsEnabled()) Trace($"Received {bytesRead} bytes."); _readLength = bytesRead; @@ -1747,7 +1745,9 @@ private ValueTask ReadBufferedAsync(Memory destination) // If the caller provided buffer, and thus the amount of data desired to be read, // is larger than the internal buffer, there's no point going through the internal // buffer, so just do an unbuffered read. - return destination.Length >= _readBuffer.Length ? + // Also avoid avoid using the internal buffer if the user requested a zero-byte read to allow + // underlying streams to efficiently handle such a read (e.g. SslStream defering buffer allocation). + return destination.Length >= _readBuffer.Length || destination.Length == 0 ? ReadAsync(destination) : ReadBufferedAsyncCore(destination); } diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs index 2879d37cb405c0..c51adc80d5c301 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs @@ -1979,7 +1979,12 @@ public bool CleanCacheAndDisposeIfUnused() } // Dispose the stale connections outside the pool lock, to avoid holding the lock too long. - toDispose?.ForEach(c => c.Dispose()); + // Dispose them asynchronously to not to block the caller on closing the SslStream or NetworkStream. + if (toDispose is not null) + { + Task.Factory.StartNew(static s => ((List)s!).ForEach(c => c.Dispose()), toDispose, + CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); + } // Pool is active. Should not be removed. return false; @@ -1999,7 +2004,8 @@ static int ScavengeConnectionList(List list, ref List? if (freeIndex < list.Count) { // We know the connection at freeIndex is unusable, so dispose of it. - toDispose ??= new List { list[freeIndex] }; + toDispose ??= new List(); + toDispose.Add(list[freeIndex]); // Find the first item after the one to be removed that should be kept. int current = freeIndex + 1; diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPoolManager.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPoolManager.cs index e257cb4c3e692f..f118d151c692ae 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPoolManager.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPoolManager.cs @@ -462,7 +462,7 @@ private void SetCleaningTimer(TimeSpan timeout) { try { - _cleaningTimer!.Change(timeout, timeout); + _cleaningTimer!.Change(timeout, Timeout.InfiniteTimeSpan); _timerIsRunning = timeout != Timeout.InfiniteTimeSpan; } catch (ObjectDisposedException) @@ -492,13 +492,10 @@ private void RemoveStalePools() } } - // Stop running the timer if we don't have any pools to clean up. + // Restart the timer if we have any pools to clean up. lock (SyncObj) { - if (_pools.IsEmpty) - { - SetCleaningTimer(Timeout.InfiniteTimeSpan); - } + SetCleaningTimer(!_pools.IsEmpty ? _cleanPoolTimeout : Timeout.InfiniteTimeSpan); } // NOTE: There is a possible race condition with regards to a pool getting cleaned up at the same diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RawConnectionStream.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RawConnectionStream.cs index 44376b01a95b23..7a45db55211c12 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RawConnectionStream.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RawConnectionStream.cs @@ -23,14 +23,14 @@ public RawConnectionStream(HttpConnection connection) : base(connection) public override int Read(Span buffer) { HttpConnection? connection = _connection; - if (connection == null || buffer.Length == 0) + if (connection == null) { // Response body fully consumed or the caller didn't ask for any data return 0; } int bytesRead = connection.ReadBuffered(buffer); - if (bytesRead == 0) + if (bytesRead == 0 && buffer.Length != 0) { // We cannot reuse this connection, so close it. _connection = null; @@ -45,9 +45,9 @@ public override async ValueTask ReadAsync(Memory buffer, Cancellation CancellationHelper.ThrowIfCancellationRequested(cancellationToken); HttpConnection? connection = _connection; - if (connection == null || buffer.Length == 0) + if (connection == null) { - // Response body fully consumed or the caller didn't ask for any data + // Response body fully consumed return 0; } @@ -74,7 +74,7 @@ public override async ValueTask ReadAsync(Memory buffer, Cancellation } } - if (bytesRead == 0) + if (bytesRead == 0 && buffer.Length != 0) { // A cancellation request may have caused the EOF. CancellationHelper.ThrowIfCancellationRequested(cancellationToken); diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/ResponseStreamConformanceTests.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/ResponseStreamConformanceTests.cs index 37b93847ccccbc..f7f28da5d192a3 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/ResponseStreamConformanceTests.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/ResponseStreamConformanceTests.cs @@ -80,6 +80,7 @@ public abstract class ResponseConnectedStreamConformanceTests : ConnectedStreamC { protected override Type UnsupportedConcurrentExceptionType => null; protected override bool UsableAfterCanceledReads => false; + protected override bool BlocksOnZeroByteReads => true; protected abstract string GetResponseHeaders(); diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/ResponseStreamZeroByteReadTests.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/ResponseStreamZeroByteReadTests.cs new file mode 100644 index 00000000000000..77acc77b344eff --- /dev/null +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/ResponseStreamZeroByteReadTests.cs @@ -0,0 +1,317 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using System.IO; +using System.IO.Tests; +using System.Linq; +using System.Net.Quic; +using System.Net.Quic.Implementations; +using System.Net.Security; +using System.Net.Test.Common; +using System.Security.Authentication; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Xunit; +using Xunit.Abstractions; + +namespace System.Net.Http.Functional.Tests +{ + public sealed class Http1CloseResponseStreamZeroByteReadTest : Http1ResponseStreamZeroByteReadTestBase + { + protected override string GetResponseHeaders() => "HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n"; + + protected override async Task WriteAsync(Stream stream, byte[] data) => await stream.WriteAsync(data); + } + + public sealed class Http1RawResponseStreamZeroByteReadTest : Http1ResponseStreamZeroByteReadTestBase + { + protected override string GetResponseHeaders() => "HTTP/1.1 101 Switching Protocols\r\n\r\n"; + + protected override async Task WriteAsync(Stream stream, byte[] data) => await stream.WriteAsync(data); + } + + public sealed class Http1ContentLengthResponseStreamZeroByteReadTest : Http1ResponseStreamZeroByteReadTestBase + { + protected override string GetResponseHeaders() => "HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\n"; + + protected override async Task WriteAsync(Stream stream, byte[] data) => await stream.WriteAsync(data); + } + + public sealed class Http1SingleChunkResponseStreamZeroByteReadTest : Http1ResponseStreamZeroByteReadTestBase + { + protected override string GetResponseHeaders() => "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n"; + + protected override async Task WriteAsync(Stream stream, byte[] data) + { + await stream.WriteAsync(Encoding.ASCII.GetBytes($"{data.Length:X}\r\n")); + await stream.WriteAsync(data); + await stream.WriteAsync(Encoding.ASCII.GetBytes("\r\n")); + } + } + + public sealed class Http1MultiChunkResponseStreamZeroByteReadTest : Http1ResponseStreamZeroByteReadTestBase + { + protected override string GetResponseHeaders() => "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\n\r\n"; + + protected override async Task WriteAsync(Stream stream, byte[] data) + { + for (int i = 0; i < data.Length; i++) + { + await stream.WriteAsync(Encoding.ASCII.GetBytes($"1\r\n")); + await stream.WriteAsync(data.AsMemory(i, 1)); + await stream.WriteAsync(Encoding.ASCII.GetBytes("\r\n")); + } + } + } + + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + public abstract class Http1ResponseStreamZeroByteReadTestBase + { + protected abstract string GetResponseHeaders(); + + protected abstract Task WriteAsync(Stream stream, byte[] data); + + public static IEnumerable ZeroByteRead_IssuesZeroByteReadOnUnderlyingStream_MemberData() => + from readMode in Enum.GetValues() + .Where(mode => mode != StreamConformanceTests.ReadWriteMode.SyncByte) // Can't test zero-byte reads with ReadByte + from useSsl in new[] { true, false } + select new object[] { readMode, useSsl }; + + [Theory] + [MemberData(nameof(ZeroByteRead_IssuesZeroByteReadOnUnderlyingStream_MemberData))] + public async Task ZeroByteRead_IssuesZeroByteReadOnUnderlyingStream(StreamConformanceTests.ReadWriteMode readMode, bool useSsl) + { + (Stream httpConnection, Stream server) = ConnectedStreams.CreateBidirectional(4096, int.MaxValue); + try + { + var sawZeroByteRead = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + + httpConnection = new ReadInterceptStream(httpConnection, read => + { + if (read == 0) + { + sawZeroByteRead.TrySetResult(); + } + }); + + using var handler = new SocketsHttpHandler + { + ConnectCallback = delegate { return ValueTask.FromResult(httpConnection); } + }; + handler.SslOptions.RemoteCertificateValidationCallback = delegate { return true; }; + + using var client = new HttpClient(handler); + + Task clientTask = client.GetAsync($"http{(useSsl ? "s" : "")}://doesntmatter", HttpCompletionOption.ResponseHeadersRead); + + if (useSsl) + { + var sslStream = new SslStream(server, false, delegate { return true; }); + server = sslStream; + + using (X509Certificate2 cert = Test.Common.Configuration.Certificates.GetServerCertificate()) + { + await ((SslStream)server).AuthenticateAsServerAsync( + cert, + clientCertificateRequired: true, + enabledSslProtocols: SslProtocols.Tls12, + checkCertificateRevocation: false).WaitAsync(TimeSpan.FromSeconds(10)); + } + } + + await ResponseConnectedStreamConformanceTests.ReadHeadersAsync(server).WaitAsync(TimeSpan.FromSeconds(10)); + await server.WriteAsync(Encoding.ASCII.GetBytes(GetResponseHeaders())); + + using HttpResponseMessage response = await clientTask.WaitAsync(TimeSpan.FromSeconds(10)); + using Stream clientStream = response.Content.ReadAsStream(); + Assert.False(sawZeroByteRead.Task.IsCompleted); + + Task zeroByteReadTask = Task.Run(() => StreamConformanceTests.ReadAsync(readMode, clientStream, Array.Empty(), 0, 0, CancellationToken.None) ); + Assert.False(zeroByteReadTask.IsCompleted); + + // The zero-byte read should block until data is actually available + await sawZeroByteRead.Task.WaitAsync(TimeSpan.FromSeconds(10)); + Assert.False(zeroByteReadTask.IsCompleted); + + byte[] data = Encoding.UTF8.GetBytes("Hello"); + await WriteAsync(server, data); + await server.FlushAsync(); + + Assert.Equal(0, await zeroByteReadTask.WaitAsync(TimeSpan.FromSeconds(10))); + + // Now that data is available, a zero-byte read should complete synchronously + zeroByteReadTask = StreamConformanceTests.ReadAsync(readMode, clientStream, Array.Empty(), 0, 0, CancellationToken.None); + Assert.True(zeroByteReadTask.IsCompleted); + Assert.Equal(0, await zeroByteReadTask); + + var readBuffer = new byte[10]; + int read = 0; + while (read < data.Length) + { + read += await StreamConformanceTests.ReadAsync(readMode, clientStream, readBuffer, read, readBuffer.Length - read, CancellationToken.None).WaitAsync(TimeSpan.FromSeconds(10)); + } + + Assert.Equal(data.Length, read); + Assert.Equal(data, readBuffer.AsSpan(0, read).ToArray()); + } + finally + { + httpConnection.Dispose(); + server.Dispose(); + } + } + + private sealed class ReadInterceptStream : DelegatingStream + { + private readonly Action _readCallback; + + public ReadInterceptStream(Stream innerStream, Action readCallback) + : base(innerStream) + { + _readCallback = readCallback; + } + + public override int Read(Span buffer) + { + _readCallback(buffer.Length); + return base.Read(buffer); + } + + public override int Read(byte[] buffer, int offset, int count) + { + _readCallback(count); + return base.Read(buffer, offset, count); + } + + public override ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken = default) + { + _readCallback(buffer.Length); + return base.ReadAsync(buffer, cancellationToken); + } + } + } + + public sealed class Http1ResponseStreamZeroByteReadTest : ResponseStreamZeroByteReadTestBase + { + public Http1ResponseStreamZeroByteReadTest(ITestOutputHelper output) : base(output) { } + + protected override Version UseVersion => HttpVersion.Version11; + } + + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.SupportsAlpn))] + public sealed class Http2ResponseStreamZeroByteReadTest : ResponseStreamZeroByteReadTestBase + { + public Http2ResponseStreamZeroByteReadTest(ITestOutputHelper output) : base(output) { } + + protected override Version UseVersion => HttpVersion.Version20; + } + + [ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsMsQuicSupported))] + public sealed class Http3ResponseStreamZeroByteReadTest_MsQuic : ResponseStreamZeroByteReadTestBase + { + public Http3ResponseStreamZeroByteReadTest_MsQuic(ITestOutputHelper output) : base(output) { } + + protected override Version UseVersion => HttpVersion.Version30; + + protected override QuicImplementationProvider UseQuicImplementationProvider => QuicImplementationProviders.MsQuic; + } + + [ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsMockQuicSupported))] + public sealed class Http3ResponseStreamZeroByteReadTest_Mock : ResponseStreamZeroByteReadTestBase + { + public Http3ResponseStreamZeroByteReadTest_Mock(ITestOutputHelper output) : base(output) { } + + protected override Version UseVersion => HttpVersion.Version30; + + protected override QuicImplementationProvider UseQuicImplementationProvider => QuicImplementationProviders.Mock; + } + + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + public abstract class ResponseStreamZeroByteReadTestBase : HttpClientHandlerTestBase + { + public ResponseStreamZeroByteReadTestBase(ITestOutputHelper output) : base(output) { } + + [Theory] + [InlineData(true)] + [InlineData(false)] + public async Task ZeroByteRead_BlocksUntilDataIsAvailable(bool async) + { + var zeroByteReadIssued = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + + await LoopbackServerFactory.CreateClientAndServerAsync(async uri => + { + HttpRequestMessage request = CreateRequest(HttpMethod.Get, uri, UseVersion, exactVersion: true); + + using HttpClient client = CreateHttpClient(); + using HttpResponseMessage response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead); + using Stream responseStream = await response.Content.ReadAsStreamAsync(); + + var responseBuffer = new byte[1]; + Assert.Equal(1, await ReadAsync(async, responseStream, responseBuffer)); + Assert.Equal(42, responseBuffer[0]); + + Task zeroByteReadTask = ReadAsync(async, responseStream, Array.Empty()); + Assert.False(zeroByteReadTask.IsCompleted); + + zeroByteReadIssued.SetResult(); + Assert.Equal(0, await zeroByteReadTask); + Assert.Equal(0, await ReadAsync(async, responseStream, Array.Empty())); + + Assert.Equal(1, await ReadAsync(async, responseStream, responseBuffer)); + Assert.Equal(1, responseBuffer[0]); + + Assert.Equal(0, await ReadAsync(async, responseStream, Array.Empty())); + + Assert.Equal(1, await ReadAsync(async, responseStream, responseBuffer)); + Assert.Equal(2, responseBuffer[0]); + + zeroByteReadTask = ReadAsync(async, responseStream, Array.Empty()); + Assert.False(zeroByteReadTask.IsCompleted); + + zeroByteReadIssued.SetResult(); + Assert.Equal(0, await zeroByteReadTask); + Assert.Equal(0, await ReadAsync(async, responseStream, Array.Empty())); + + Assert.Equal(1, await ReadAsync(async, responseStream, responseBuffer)); + Assert.Equal(3, responseBuffer[0]); + + Assert.Equal(0, await ReadAsync(async, responseStream, responseBuffer)); + }, + async server => + { + await server.AcceptConnectionAsync(async connection => + { + await connection.ReadRequestDataAsync(); + + await connection.SendResponseAsync(headers: new[] { new HttpHeaderData("Content-Length", "4") }, isFinal: false); + + await connection.SendResponseBodyAsync(new byte[] { 42 }, isFinal: false); + + await zeroByteReadIssued.Task; + zeroByteReadIssued = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + + await connection.SendResponseBodyAsync(new byte[] { 1, 2 }, isFinal: false); + + await zeroByteReadIssued.Task; + + await connection.SendResponseBodyAsync(new byte[] { 3 }, isFinal: true); + }); + }); + + static Task ReadAsync(bool async, Stream stream, byte[] buffer) + { + if (async) + { + return stream.ReadAsync(buffer).AsTask(); + } + else + { + return Task.Run(() => stream.Read(buffer)); + } + } + } + } +} diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.Http2FlowControl.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.Http2FlowControl.cs index f28491882ac3db..6b0e8850549368 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.Http2FlowControl.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.Http2FlowControl.cs @@ -11,16 +11,11 @@ namespace System.Net.Http.Functional.Tests { - [CollectionDefinition(nameof(NonParallelTestCollection), DisableParallelization = true)] - public class NonParallelTestCollection - { - } - // This test class contains tests which are strongly timing-dependent. // There are two mitigations avoid flaky behavior on CI: // - Parallel test execution is disabled // - Using extreme parameters, and checks which are very unlikely to fail, if the implementation is correct - [Collection(nameof(NonParallelTestCollection))] + [Collection(nameof(DisableParallelization))] [ConditionalClass(typeof(SocketsHttpHandler_Http2FlowControl_Test), nameof(IsSupported))] public sealed class SocketsHttpHandler_Http2FlowControl_Test : HttpClientHandlerTestBase { diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.Http2KeepAlivePing.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.Http2KeepAlivePing.cs index aad7f5d1a873dd..d760e8e9c53e95 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.Http2KeepAlivePing.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.Http2KeepAlivePing.cs @@ -13,7 +13,7 @@ namespace System.Net.Http.Functional.Tests { - [Collection(nameof(NonParallelTestCollection))] + [Collection(nameof(DisableParallelization))] [ConditionalClass(typeof(SocketsHttpHandler_Http2KeepAlivePing_Test), nameof(IsSupported))] public sealed class SocketsHttpHandler_Http2KeepAlivePing_Test : HttpClientHandlerTestBase { diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs index 14f444b1935a60..e7ce1967052703 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs @@ -3143,7 +3143,7 @@ public SocketsHttpHandler_HttpClientHandler_Cancellation_Test_Http2(ITestOutputH } [ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsMsQuicSupported))] - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public sealed class SocketsHttpHandlerTest_Http3_MsQuic : HttpClientHandlerTest_Http3 { public SocketsHttpHandlerTest_Http3_MsQuic(ITestOutputHelper output) : base(output) { } @@ -3151,7 +3151,7 @@ public SocketsHttpHandlerTest_Http3_MsQuic(ITestOutputHelper output) : base(outp } [ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsMockQuicSupported))] - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public sealed class SocketsHttpHandlerTest_Http3_Mock : HttpClientHandlerTest_Http3 { public SocketsHttpHandlerTest_Http3_Mock(ITestOutputHelper output) : base(output) { } @@ -3159,7 +3159,7 @@ public SocketsHttpHandlerTest_Http3_Mock(ITestOutputHelper output) : base(output } [ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsMsQuicSupported))] - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public sealed class SocketsHttpHandlerTest_HttpClientHandlerTest_Http3_MsQuic : HttpClientHandlerTest { public SocketsHttpHandlerTest_HttpClientHandlerTest_Http3_MsQuic(ITestOutputHelper output) : base(output) { } @@ -3168,7 +3168,7 @@ public SocketsHttpHandlerTest_HttpClientHandlerTest_Http3_MsQuic(ITestOutputHelp } [ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsMockQuicSupported))] - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public sealed class SocketsHttpHandlerTest_HttpClientHandlerTest_Http3_Mock : HttpClientHandlerTest { public SocketsHttpHandlerTest_HttpClientHandlerTest_Http3_Mock(ITestOutputHelper output) : base(output) { } @@ -3177,7 +3177,7 @@ public SocketsHttpHandlerTest_HttpClientHandlerTest_Http3_Mock(ITestOutputHelper } [ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsMsQuicSupported))] - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public sealed class SocketsHttpHandlerTest_Cookies_Http3_MsQuic : HttpClientHandlerTest_Cookies { public SocketsHttpHandlerTest_Cookies_Http3_MsQuic(ITestOutputHelper output) : base(output) { } @@ -3186,7 +3186,7 @@ public SocketsHttpHandlerTest_Cookies_Http3_MsQuic(ITestOutputHelper output) : b } [ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsMockQuicSupported))] - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public sealed class SocketsHttpHandlerTest_Cookies_Http3_Mock : HttpClientHandlerTest_Cookies { public SocketsHttpHandlerTest_Cookies_Http3_Mock(ITestOutputHelper output) : base(output) { } @@ -3195,7 +3195,7 @@ public SocketsHttpHandlerTest_Cookies_Http3_Mock(ITestOutputHelper output) : bas } [ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsMsQuicSupported))] - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public sealed class SocketsHttpHandlerTest_HttpClientHandlerTest_Headers_Http3_MsQuic : HttpClientHandlerTest_Headers { public SocketsHttpHandlerTest_HttpClientHandlerTest_Headers_Http3_MsQuic(ITestOutputHelper output) : base(output) { } @@ -3204,7 +3204,7 @@ public SocketsHttpHandlerTest_HttpClientHandlerTest_Headers_Http3_MsQuic(ITestOu } [ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsMockQuicSupported))] - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public sealed class SocketsHttpHandlerTest_HttpClientHandlerTest_Headers_Http3_Mock : HttpClientHandlerTest_Headers { public SocketsHttpHandlerTest_HttpClientHandlerTest_Headers_Http3_Mock(ITestOutputHelper output) : base(output) { } @@ -3213,7 +3213,7 @@ public SocketsHttpHandlerTest_HttpClientHandlerTest_Headers_Http3_Mock(ITestOutp } [ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsMsQuicSupported))] - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public sealed class SocketsHttpHandler_HttpClientHandler_Cancellation_Test_Http3_MsQuic : SocketsHttpHandler_Cancellation_Test { public SocketsHttpHandler_HttpClientHandler_Cancellation_Test_Http3_MsQuic(ITestOutputHelper output) : base(output) { } @@ -3222,7 +3222,7 @@ public SocketsHttpHandler_HttpClientHandler_Cancellation_Test_Http3_MsQuic(ITest } [ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsMockQuicSupported))] - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public sealed class SocketsHttpHandler_HttpClientHandler_Cancellation_Test_Http3_Mock : SocketsHttpHandler_Cancellation_Test { public SocketsHttpHandler_HttpClientHandler_Cancellation_Test_Http3_Mock(ITestOutputHelper output) : base(output) { } @@ -3231,7 +3231,7 @@ public SocketsHttpHandler_HttpClientHandler_Cancellation_Test_Http3_Mock(ITestOu } [ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsMsQuicSupported))] - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public sealed class SocketsHttpHandler_HttpClientHandler_AltSvc_Test_Http3_MsQuic : HttpClientHandler_AltSvc_Test { public SocketsHttpHandler_HttpClientHandler_AltSvc_Test_Http3_MsQuic(ITestOutputHelper output) : base(output) { } @@ -3240,7 +3240,7 @@ public SocketsHttpHandler_HttpClientHandler_AltSvc_Test_Http3_MsQuic(ITestOutput } [ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsMockQuicSupported))] - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public sealed class SocketsHttpHandler_HttpClientHandler_AltSvc_Test_Http3_Mock : HttpClientHandler_AltSvc_Test { public SocketsHttpHandler_HttpClientHandler_AltSvc_Test_Http3_Mock(ITestOutputHelper output) : base(output) { } @@ -3249,7 +3249,7 @@ public SocketsHttpHandler_HttpClientHandler_AltSvc_Test_Http3_Mock(ITestOutputHe } [ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsMsQuicSupported))] - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public sealed class SocketsHttpHandler_HttpClientHandler_Finalization_Http3_MsQuic : HttpClientHandler_Finalization_Test { public SocketsHttpHandler_HttpClientHandler_Finalization_Http3_MsQuic(ITestOutputHelper output) : base(output) { } @@ -3258,7 +3258,7 @@ public SocketsHttpHandler_HttpClientHandler_Finalization_Http3_MsQuic(ITestOutpu } [ConditionalClass(typeof(HttpClientHandlerTestBase), nameof(IsMockQuicSupported))] - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public sealed class SocketsHttpHandler_HttpClientHandler_Finalization_Http3_Mock : HttpClientHandler_Finalization_Test { public SocketsHttpHandler_HttpClientHandler_Finalization_Http3_Mock(ITestOutputHelper output) : base(output) { } @@ -3266,10 +3266,6 @@ public SocketsHttpHandler_HttpClientHandler_Finalization_Http3_Mock(ITestOutputH protected override QuicImplementationProvider UseQuicImplementationProvider => QuicImplementationProviders.Mock; } - // Define test collection for tests to avoid all other tests. - [CollectionDefinition("NoParallelTests", DisableParallelization = true)] - public partial class NoParallelTests { } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] public abstract class SocketsHttpHandler_RequestValidationTest { diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj b/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj index 29bbd6f8f083e9..d057f21b00ff9a 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj @@ -133,6 +133,8 @@ Link="Common\System\Net\Http\HttpClientHandlerTest.Cookies.cs" /> + @@ -186,6 +188,7 @@ + + + + linux-x64 + win-x64 + + + $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)../, global.json))/ + + $(RepositoryRoot)eng/targetingpacks.targets + 7.0.0 + net7.0 + 7.0 + Microsoft.NETCore.App + $(RepositoryRoot)artifacts/bin/microsoft.netcore.app.ref/ + $(RepositoryRoot)artifacts/bin/microsoft.netcore.app.runtime.$(PackageRid)/$(Configuration)/ + + \ No newline at end of file diff --git a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Directory.Build.targets b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Directory.Build.targets index 8998bf4546770d..85e81c583072ee 100644 --- a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Directory.Build.targets +++ b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Directory.Build.targets @@ -1 +1,11 @@ - + + + + + + 7.0 + + \ No newline at end of file diff --git a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Dockerfile b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Dockerfile index 089047be6964b4..5dabcafefd6ef3 100644 --- a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Dockerfile +++ b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Dockerfile @@ -1,9 +1,6 @@ ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:6.0-bullseye-slim FROM $SDK_BASE_IMAGE -RUN echo "DOTNET_SDK_VERSION="$DOTNET_SDK_VERSION -RUN echo "DOTNET_VERSION="$DOTNET_VERSION - WORKDIR /app COPY . . @@ -19,8 +16,13 @@ RUN unzip $PACKAGES_DIR.zip RUN dpkg -i $PACKAGES_DIR/$MSQUIC_PACKAGE RUN rm -rf $PACKAGES_DIR* +ARG VERSION=7.0 ARG CONFIGURATION=Release -RUN dotnet build -c $CONFIGURATION + +RUN dotnet build -c $CONFIGURATION \ + -p:TargetingPacksTargetsLocation=/live-runtime-artifacts/targetingpacks.targets \ + -p:MicrosoftNetCoreAppRefPackDir=/live-runtime-artifacts/microsoft.netcore.app.ref/ \ + -p:MicrosoftNetCoreAppRuntimePackDir=/live-runtime-artifacts/microsoft.netcore.app.runtime.linux-x64/$CONFIGURATION/ # Enable dump collection ENV COMPlus_DbgEnableMiniDump=1 @@ -29,6 +31,8 @@ ENV COMPlus_DbgMiniDumpName="/share/coredump.%p" EXPOSE 5001 +ENV VERSION=$VERSION ENV CONFIGURATION=$CONFIGURATION ENV HTTPSTRESS_ARGS='' -CMD dotnet run --no-build -c $CONFIGURATION -- $HTTPSTRESS_ARGS +CMD /live-runtime-artifacts/testhost/net$VERSION-Linux-$CONFIGURATION-x64/dotnet exec \ + ./bin/$CONFIGURATION/net$VERSION/HttpStress.dll $HTTPSTRESS_ARGS diff --git a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/HttpStress.csproj b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/HttpStress.csproj index 39774f26b2313a..954019ae5b3a78 100644 --- a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/HttpStress.csproj +++ b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/HttpStress.csproj @@ -1,8 +1,7 @@ - - + Exe - net6.0 + $(NetCoreAppCurrent) preview enable True @@ -22,4 +21,16 @@ - + + + false + false + false + false + false + false + false + false + false + + \ No newline at end of file diff --git a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Readme.md b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Readme.md index ec19d321160553..653b96c4169de5 100644 --- a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Readme.md +++ b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/Readme.md @@ -1,39 +1,47 @@ ## HttpStress -Provides stress testing scenaria for System.Net.Http.HttpClient, with emphasis on the HTTP/2 implementation of SocketsHttpHandler. +Provides stress testing scenaria for System.Net.Http.HttpClient and the underlying SocketsHttpHandler. ### Running the suite locally -Using the command line, +Prerequisite: the runtime and the libraries should be [live-built](https://github.com/dotnet/runtime/tree/main/docs/workflow/building/libraries) with `build.cmd`/`build.sh`. + +Use the script `build-local.sh` / `build-local.ps1` to build the stress project against the live-built runtime. This will acquire the latest daily SDK, which is TFM-compatible with the live-built runtime. + +```bash +$ build-local.sh [StressConfiguration] [LibrariesConfiguration] +``` + +The build script will also generate the runscript that runs the stress suite using the locally built testhost in the form of `run-stress--.sh`. To run the tests with the script, assuming that both the stress project and the libraries have been built against Release configuration: ```bash -$ dotnet run -- +$ run-stress-Release-Release.sh [stress suite args] ``` To get the full list of available parameters: ```bash -$ dotnet run -- -help +$ run-stress-Release-Release.sh -help ``` -### Running with local runtime builds +### Building and running with Docker -Note that the stress suite will test the sdk available in the environment, -that is to say it will not necessarily test the implementation of the local runtime repo. -To achieve this, we will first need to build a new sdk from source. This can be done [using docker](https://github.com/dotnet/runtime/blob/main/eng/docker/Readme.md). +A docker image containing the live-built runtime bits and the latest daily SDK is created with the [`build-docker-sdk.sh/ps1` scripts](https://github.com/dotnet/runtime/blob/main/eng/docker/Readme.md). -### Running using docker-compose +It's possible to manually `docker build` a docker image containing the stress project based on the docker image created with `build-docker-sdk.sh/ps1`, however the preferred way is to use docker-compose, which can be used to target both linux and windows containers. -The preferred way of running the stress suite is using docker-compose, -which can be used to target both linux and windows containers. Docker and compose-compose are required for this step (both included in [docker for windows](https://docs.docker.com/docker-for-windows/)). #### Using Linux containers -From the stress folder on powershell: +From the stress folder: ```powershell -PS> .\run-docker-compose.ps1 -b +PS> .\run-docker-compose.ps1 +``` + +```bash +$ ./run-docker-compose.sh ``` This will build libraries and stress suite to a linux docker image and initialize a stress run using docker-compose. @@ -46,7 +54,7 @@ on how windows containers can be enabled on your machine. Once ready, simply run: ```powershell -PS> .\run-docker-compose.ps1 -b -w +PS> .\run-docker-compose.ps1 -w ``` For more details on how the `run-docker-compose.ps1` script can be used: @@ -54,3 +62,15 @@ For more details on how the `run-docker-compose.ps1` script can be used: ```powershell Get-Help .\run-docker-compose.ps1 ``` + +#### Passing arguments to HttpStress + +The following will run the stress client and server containers passing the argument `-http 2.0` to both: + +```bash +./run-docker-compose.sh -clientstressargs "-http 2.0" -serverstressargs "-http 2.0" +``` + +```powershell +./run-docker-compose.sh -w -clientStressArgs "-http 2.0" -serverStressArgs "-http 2.0" +``` \ No newline at end of file diff --git a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/StressServer.cs b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/StressServer.cs index c55936e051ff16..eb3f5db8b4a51b 100644 --- a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/StressServer.cs +++ b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/StressServer.cs @@ -41,6 +41,8 @@ public class StressServer : IDisposable public StressServer(Configuration configuration) { + WorkaroundAssemblyResolutionIssues(); + ServerUri = configuration.ServerUri; (string scheme, string hostname, int port) = ParseServerUri(configuration.ServerUri); IWebHostBuilder host = WebHost.CreateDefaultBuilder(); @@ -315,6 +317,13 @@ private static void MapRoutes(IEndpointRouteBuilder endpoints) }); } + private static void WorkaroundAssemblyResolutionIssues() + { + // For some reason, System.Security.Cryptography.Encoding.dll fails to resolve when being loaded on-demand by AspNetCore. + // Enforce early-loading to workaround this issue. + _ = new Oid(); + } + private static void AppendChecksumHeader(IHeaderDictionary headers, ulong checksum) { headers.Add("crc32", checksum.ToString()); diff --git a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/build-local.ps1 b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/build-local.ps1 new file mode 100644 index 00000000000000..077dbdb922591b --- /dev/null +++ b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/build-local.ps1 @@ -0,0 +1,63 @@ +## This is a helper script for non-containerized local build and test execution. +## It downloads and uses the daily SDK which contains the compatible AspNetCore bits. +## Usage: +## ./build-local.ps1 [StressConfiguration] [LibrariesConfiguration] + +$Version="7.0" +$RepoRoot="$(git rev-parse --show-toplevel)" +$DailyDotnetRoot= "./.dotnet-daily" + +$StressConfiguration = "Release" +if (-not ([string]::IsNullOrEmpty($args[0]))) { + $StressConfiguration = $args[0] +} + +$LibrariesConfiguration = "Release" +if (-not ([string]::IsNullOrEmpty($args[1]))) { + $LibrariesConfiguration = $args[0] +} + +$TestHostRoot="$RepoRoot/artifacts/bin/testhost/net$Version-windows-$LibrariesConfiguration-x64" + +Write-Host "StressConfiguration: $StressConfiguration, LibrariesConfiguration: $LibrariesConfiguration, testhost: $TestHostRoot" + +if (-not (Test-Path -Path $TestHostRoot)) { + Write-Host "Cannot find testhost in: $TestHostRoot" + Write-Host "Make sure libraries with the requested configuration are built!" + Write-Host "Usage:" + Write-Host "./build-local.sh [StressConfiguration] [LibrariesConfiguration]" + Write-Host "StressConfiguration and LibrariesConfiguration default to Release!" + exit 1 +} + +if (-not (Test-Path -Path $DailyDotnetRoot)) { + Write-Host "Downloading daily SDK to: $DailyDotnetRoot" + New-Item -ItemType Directory -Path $DailyDotnetRoot + Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile "$DailyDotnetRoot\dotnet-install.ps1" + & "$DailyDotnetRoot\dotnet-install.ps1" -NoPath -Channel "$Version.1xx" -Quality daily -InstallDir $DailyDotnetRoot +} else { + Write-Host "Daily SDK found in $DailyDotnetRoot" +} + +$env:DOTNET_ROOT=$DailyDotnetRoot +$env:PATH="$DailyDotnetRoot;$env:PATH" +$env:DOTNET_MULTILEVEL_LOOKUP=0 + +if (-not (Test-Path -Path "$TestHostRoot/shared/Microsoft.AspNetCore.App")) { + Write-Host "Copying Microsoft.AspNetCore.App bits from daily SDK to testhost: $TestHostRoot" + Copy-Item -Recurse -Path "$DailyDotnetRoot/shared/Microsoft.AspNetCore.App" -Destination "$TestHostRoot/shared" +} else { + Write-Host "Microsoft.AspNetCore.App found in testhost: $TestHostRoot" +} + +Write-Host "Building solution." +dotnet build -c $StressConfiguration + +$Runscript=".\run-stress-$LibrariesConfiguration-$StressConfiguration.ps1" +if (-not (Test-Path $Runscript)) { + Write-Host "Generating Runscript." + Add-Content -Path $Runscript -Value "& '$TestHostRoot/dotnet' exec ./bin/$StressConfiguration/net$Version/HttpStress.dll `$args" +} + +Write-Host "To run tests type:" +Write-Host "$Runscript [stress test args]" \ No newline at end of file diff --git a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/build-local.sh b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/build-local.sh new file mode 100755 index 00000000000000..9455c31c1ce6b2 --- /dev/null +++ b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/build-local.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash + +## This is a helper script for non-containerized local build and test execution. +## It downloads and uses the daily SDK which contains the compatible AspNetCore bits. +## Usage: +## ./build-local.sh [StressConfiguration] [LibrariesConfiguration] + +version=7.0 +repo_root=$(git rev-parse --show-toplevel) +daily_dotnet_root=./.dotnet-daily + +stress_configuration="Release" +if [ "$1" != "" ]; then + stress_configuration=${1,,} # Lowercase all characters in $1 + stress_configuration=${stress_configuration^} # Uppercase first character +fi + +libraries_configuration="Release" +if [ "$2" != "" ]; then + libraries_configuration=${2,,} # Lowercase all characters in $1 + libraries_configuration=${libraries_configuration^} # Uppercase first character +fi + +testhost_root=$repo_root/artifacts/bin/testhost/net$version-Linux-$libraries_configuration-x64 +echo "StressConfiguration: $stress_configuration, LibrariesConfiguration: $libraries_configuration, testhost: $testhost_root" + +if [[ ! -d $testhost_root ]]; then + echo "Cannot find testhost in: $testhost_root" + echo "Make sure libraries with the requested configuration are built!" + echo "Usage:" + echo "./build-local.sh [StressConfiguration] [LibrariesConfiguration]" + echo "StressConfiguration and LibrariesConfiguration default to Release!" + exit 1 +fi + +if [[ ! -d $daily_dotnet_root ]]; then + echo "Downloading daily SDK to $daily_dotnet_root" + mkdir $daily_dotnet_root + wget https://dot.net/v1/dotnet-install.sh -O $daily_dotnet_root/dotnet-install.sh + bash $daily_dotnet_root/dotnet-install.sh --no-path --channel $version.1xx --quality daily --install-dir $daily_dotnet_root +else + echo "Daily SDK found in $daily_dotnet_root" +fi + +export DOTNET_ROOT=$daily_dotnet_root +export PATH=$DOTNET_ROOT:$PATH +export DOTNET_MULTILEVEL_LOOKUP=0 + +if [[ ! -d "$testhost_root/shared/Microsoft.AspNetCore.App" ]]; then + echo "Copying Microsoft.AspNetCore.App bits from daily SDK to testhost: $testhost_root" + cp -r $daily_dotnet_root/shared/Microsoft.AspNetCore.App $testhost_root/shared/Microsoft.AspNetCore.App +else + echo "Microsoft.AspNetCore.App found in testhost: $testhost_root" +fi + +echo "Building solution." +dotnet build -c $stress_configuration + +runscript=./run-stress-${stress_configuration,,}-${libraries_configuration,,}.sh +if [[ ! -f $runscript ]]; then + echo "Generating runscript." + echo "$testhost_root/dotnet exec ./bin/$stress_configuration/net$version/HttpStress.dll \$@" > $runscript + chmod +x $runscript +fi + +echo "To run tests type:" +echo "$runscript [stress test args]" \ No newline at end of file diff --git a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/load-corefx-testhost.ps1 b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/load-corefx-testhost.ps1 old mode 100644 new mode 100755 diff --git a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/run-docker-compose.sh b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/run-docker-compose.sh index 5c3ba48758be84..a43ae9759172a5 100755 --- a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/run-docker-compose.sh +++ b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/run-docker-compose.sh @@ -22,7 +22,6 @@ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" imagename="dotnet-sdk-libs-current" configuration="Release" -privateaspnetcore=0 buildcurrentlibraries=0 buildonly=0 clientstressargs="" @@ -39,10 +38,6 @@ while [[ $# > 0 ]]; do configuration=$2 shift 2 ;; - -privateaspnetcore|-pa) - privateaspnetcore=1 - shift 1 - ;; -buildcurrentlibraries|-b) buildcurrentlibraries=1 shift 1 @@ -67,23 +62,16 @@ done repo_root=$(git rev-parse --show-toplevel) -if [[ buildcurrentlibraries -eq 1 ]]; then +if [[ "$buildcurrentlibraries" -eq 1 ]]; then libraries_args=" -t $imagename -c $configuration" - if [[ $privateaspnetcore -eq 1 ]]; then - libraries_args="$libraries_args -pa" - fi - if ! $repo_root/eng/docker/build-docker-sdk.sh $libraries_args; then + if ! "$repo_root"/eng/docker/build-docker-sdk.sh $libraries_args; then exit 1 fi - -elif [[ $privateaspnetcore -eq 1 ]]; then - echo "Using a private Asp.Net Core package (-pa) requires using privately built libraries. Please, enable it with -b switch." - exit 1 fi build_args="" -if [[ "$imagename" != "" ]]; then +if [[ -n "$imagename" ]]; then build_args=" --build-arg SDK_BASE_IMAGE=$imagename" fi @@ -93,7 +81,7 @@ if ! docker-compose --file "$compose_file" build $build_args; then exit $? fi -if [[ $buildonly -eq 0 ]]; then +if [[ "$buildonly" -eq 0 ]]; then export DUMPS_SHARE_MOUNT_ROOT="/dumps-share" export CLIENT_DUMPS_SHARE="${CLIENT_DUMPS_SHARE:-$(mktemp -d)}" export SERVER_DUMPS_SHARE="${SERVER_DUMPS_SHARE:-$(mktemp -d)}" diff --git a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/windows.Dockerfile b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/windows.Dockerfile index 2c16d6c0d7209e..2876854606fda9 100644 --- a/src/libraries/System.Net.Http/tests/StressTests/HttpStress/windows.Dockerfile +++ b/src/libraries/System.Net.Http/tests/StressTests/HttpStress/windows.Dockerfile @@ -5,14 +5,16 @@ FROM $SDK_BASE_IMAGE # Use powershell as the default shell SHELL ["pwsh", "-Command"] -RUN echo "DOTNET_SDK_VERSION="$env:DOTNET_SDK_VERSION -RUN echo "DOTNET_VERSION="$env:DOTNET_VERSION - WORKDIR /app COPY . . +ARG VERSION=7.0 ARG CONFIGURATION=Release -RUN dotnet build -c $env:CONFIGURATION + +RUN dotnet build -c $env:CONFIGURATION ` + -p:TargetingPacksTargetsLocation=C:/live-runtime-artifacts/targetingpacks.targets ` + -p:MicrosoftNetCoreAppRefPackDir=C:/live-runtime-artifacts/microsoft.netcore.app.ref/ ` + -p:MicrosoftNetCoreAppRuntimePackDir=C:/live-runtime-artifacts/microsoft.netcore.app.runtime.win-x64/$env:CONFIGURATION/ # Enable dump collection ENV COMPlus_DbgEnableMiniDump=1 @@ -21,6 +23,9 @@ ENV COMPlus_DbgMiniDumpName="C:/share/coredump.%p" EXPOSE 5001 +ENV VERSION=$VERSION ENV CONFIGURATION=$CONFIGURATION ENV HTTPSTRESS_ARGS="" -CMD dotnet run --no-build -c $env:CONFIGURATION -- $env:HTTPSTRESS_ARGS.Split() + +CMD & C:/live-runtime-artifacts/testhost/net$env:VERSION-windows-$env:CONFIGURATION-x64/dotnet.exe exec ` + ./bin/$env:CONFIGURATION/net$env:VERSION/HttpStress.dll $env:HTTPSTRESS_ARGS.Split() \ No newline at end of file diff --git a/src/libraries/System.Net.Http/tests/UnitTests/Headers/HttpHeadersTest.cs b/src/libraries/System.Net.Http/tests/UnitTests/Headers/HttpHeadersTest.cs index f56f85ac5bd0d4..139422163a95bc 100644 --- a/src/libraries/System.Net.Http/tests/UnitTests/Headers/HttpHeadersTest.cs +++ b/src/libraries/System.Net.Http/tests/UnitTests/Headers/HttpHeadersTest.cs @@ -2112,6 +2112,44 @@ public void AddHeaders_SourceHasInvalidHeaderValues_InvalidHeadersRemovedFromSou Assert.False(destination.Contains("custom"), "destination contains 'custom' header."); } + [Fact] + public void AddHeaders_ResponseHeaderToRequestHeaders_Success() + { + const string Name = "WWW-Authenticate"; + const string Value = "Basic realm=\"Access to the staging site\", charset=\"UTF-8\""; + + var request = new HttpRequestMessage(); + Assert.True(request.Headers.TryAddWithoutValidation(Name, Value)); + + Assert.True(request.Headers.Contains(Name)); + Assert.True(request.Headers.NonValidated.Contains(Name)); + + Assert.True(request.Headers.TryGetValues(Name, out IEnumerable values)); + Assert.Equal(Value, values.Single()); + + Assert.True(request.Headers.NonValidated.TryGetValues(Name, out HeaderStringValues nvValues)); + Assert.Equal(Value, nvValues.Single()); + } + + [Fact] + public void AddHeaders_RequestHeaderToResponseHeaders_Success() + { + const string Name = "Referer"; + const string Value = "https://dot.net"; + + var response = new HttpResponseMessage(); + Assert.True(response.Headers.TryAddWithoutValidation(Name, Value)); + + Assert.True(response.Headers.Contains(Name)); + Assert.True(response.Headers.NonValidated.Contains(Name)); + + Assert.True(response.Headers.TryGetValues(Name, out IEnumerable values)); + Assert.Equal(Value, values.Single()); + + Assert.True(response.Headers.NonValidated.TryGetValues(Name, out HeaderStringValues nvValues)); + Assert.Equal(Value, nvValues.Single()); + } + [Fact] public void HeaderStringValues_Default_Empty() { diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerRequest.Windows.cs b/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerRequest.Windows.cs index 175085f4140c42..0e21c34681fe8c 100644 --- a/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerRequest.Windows.cs +++ b/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerRequest.Windows.cs @@ -350,7 +350,7 @@ private ListenerClientCertAsyncResult BeginGetClientCertificateCore(AsyncCallbac //demand a client cert at a later point // //The fix here is to demand the client cert when the channel is NOT INSECURE - //which means whether the client certs are requried at the beginning or not, + //which means whether the client certs are required at the beginning or not, //if this is an SSL connection, Call HttpReceiveClientCertificate, thus //starting the cert negotiation at that point // @@ -447,7 +447,7 @@ private void GetClientCertificateCore() //demand a client cert at a later point // //The fix here is to demand the client cert when the channel is NOT INSECURE - //which means whether the client certs are requried at the beginning or not, + //which means whether the client certs are required at the beginning or not, //if this is an SSL connection, Call HttpReceiveClientCertificate, thus //starting the cert negotiation at that point // diff --git a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/LoggingTest.cs b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/LoggingTest.cs index 915067acffbbfc..c3333760a4d094 100644 --- a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/LoggingTest.cs +++ b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/LoggingTest.cs @@ -13,7 +13,7 @@ namespace System.Net.NameResolution.Tests { using Configuration = System.Net.Test.Common.Configuration; - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public class LoggingTest { [Fact] diff --git a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/System.Net.NameResolution.Functional.Tests.csproj b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/System.Net.NameResolution.Functional.Tests.csproj index 2f9dea9c37cde4..982ca8491f706c 100644 --- a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/System.Net.NameResolution.Functional.Tests.csproj +++ b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/System.Net.NameResolution.Functional.Tests.csproj @@ -24,5 +24,7 @@ Link="Common\System\Net\Configuration.Sockets.cs" /> + diff --git a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/TestSettings.cs b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/TestSettings.cs index 49c1b0a77304a8..f4b45bf18ac0ad 100644 --- a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/TestSettings.cs +++ b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/TestSettings.cs @@ -8,9 +8,6 @@ namespace System.Net.NameResolution.Tests { - [CollectionDefinition("NoParallelTests", DisableParallelization = true)] - public partial class NoParallelTests { } - internal static class TestSettings { // A hostname that will not exist in any DNS caches, forcing some I/O to lookup. diff --git a/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.RawSocket.cs b/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.RawSocket.cs index 341c328265cbe0..fa5712656fafef 100644 --- a/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.RawSocket.cs +++ b/src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.RawSocket.cs @@ -18,6 +18,7 @@ public partial class Ping private const int IcmpHeaderLengthInBytes = 8; private const int MinIpHeaderLengthInBytes = 20; private const int MaxIpHeaderLengthInBytes = 60; + private const int IpV6HeaderLengthInBytes = 40; private unsafe SocketConfig GetSocketConfig(IPAddress address, byte[] buffer, int timeout, PingOptions? options) { @@ -123,22 +124,98 @@ private bool TryGetPingReply( } int icmpHeaderOffset = ipHeaderLength; + int dataOffset = ipHeaderLength + IcmpHeaderLengthInBytes; // Skip IP header. IcmpHeader receivedHeader = MemoryMarshal.Read(receiveBuffer.AsSpan(icmpHeaderOffset)); + ushort identifier = 0; type = receivedHeader.Type; code = receivedHeader.Code; - if (socketConfig.Identifier != receivedHeader.Identifier - || type == (byte)IcmpV4MessageType.EchoRequest - || type == (byte)IcmpV6MessageType.EchoRequest) // Echo Request, ignore + // Validate the ICMP header and get the identifier + if (socketConfig.IsIpv4) + { + if (type == (byte)IcmpV4MessageType.EchoReply) + { + // Reply packet has the identifier in the ICMP header. + identifier = receivedHeader.Identifier; + } + else if (type == (byte)IcmpV4MessageType.DestinationUnreachable || + type == (byte)IcmpV4MessageType.TimeExceeded || + type == (byte)IcmpV4MessageType.ParameterProblemBadIPHeader || + type == (byte)IcmpV4MessageType.SourceQuench || + type == (byte)IcmpV4MessageType.RedirectMessage) + { + // Original IP+ICMP request is in the payload. Read the ICMP header from + // the payload to get identifier. + + if (dataOffset + MinIpHeaderLengthInBytes + IcmpHeaderLengthInBytes > bytesReceived) + { + return false; + } + + byte ihl = (byte)(receiveBuffer[dataOffset] & 0x0f); // Internet Header Length + int payloadIpHeaderLength = 4 * ihl; + + if (bytesReceived - dataOffset - payloadIpHeaderLength < IcmpHeaderLengthInBytes) + { + return false; // Not enough bytes to reconstruct actual IP header + ICMP header. + } + + IcmpHeader originalRequestHeader = MemoryMarshal.Read(receiveBuffer.AsSpan(dataOffset + payloadIpHeaderLength)); + identifier = originalRequestHeader.Identifier; + + // Update the date offset to point past the payload IP+ICMP headers. While the specification + // doesn't indicate there should be any additional data the reality is that we often get the + // original packet data back. + dataOffset += payloadIpHeaderLength + IcmpHeaderLengthInBytes; + } + else + { + return false; + } + } + else + { + if (type == (byte)IcmpV6MessageType.EchoReply) + { + // Reply packet has the identifier in the ICMP header. + identifier = receivedHeader.Identifier; + } + else if (type == (byte)IcmpV6MessageType.DestinationUnreachable || + type == (byte)IcmpV6MessageType.TimeExceeded || + type == (byte)IcmpV6MessageType.ParameterProblem || + type == (byte)IcmpV6MessageType.PacketTooBig) + { + // Original IP+ICMP request is in the payload. Read the ICMP header from + // the payload to get identifier. + + if (bytesReceived - dataOffset < IpV6HeaderLengthInBytes + IcmpHeaderLengthInBytes) + { + return false; // Not enough bytes to reconstruct actual IP header + ICMP header. + } + + IcmpHeader originalRequestHeader = MemoryMarshal.Read(receiveBuffer.AsSpan(dataOffset + IpV6HeaderLengthInBytes)); + identifier = originalRequestHeader.Identifier; + + // Update the date offset to point past the payload IP+ICMP headers. While the specification + // doesn't indicate there should be any additional data the reality is that we often get the + // original packet data back. + dataOffset += IpV6HeaderLengthInBytes + IcmpHeaderLengthInBytes; + } + else + { + return false; + } + } + + if (socketConfig.Identifier != identifier) { return false; } sw.Stop(); long roundTripTime = sw.ElapsedMilliseconds; - int dataOffset = ipHeaderLength + IcmpHeaderLengthInBytes; // We want to return a buffer with the actual data we sent out, not including the header data. byte[] dataBuffer = new byte[bytesReceived - dataOffset]; Buffer.BlockCopy(receiveBuffer, dataOffset, dataBuffer, 0, dataBuffer.Length); @@ -162,7 +239,7 @@ private PingReply SendIcmpEchoRequestOverRawSocket(IPAddress address, byte[] buf { socket.SendTo(socketConfig.SendBuffer, SocketFlags.None, socketConfig.EndPoint); - byte[] receiveBuffer = new byte[MaxIpHeaderLengthInBytes + IcmpHeaderLengthInBytes + buffer.Length]; + byte[] receiveBuffer = new byte[2 * (MaxIpHeaderLengthInBytes + IcmpHeaderLengthInBytes) + buffer.Length]; long elapsed; Stopwatch sw = Stopwatch.StartNew(); @@ -213,7 +290,7 @@ await socket.SendToAsync( timeoutTokenSource.Token) .ConfigureAwait(false); - byte[] receiveBuffer = new byte[MaxIpHeaderLengthInBytes + IcmpHeaderLengthInBytes + buffer.Length]; + byte[] receiveBuffer = new byte[2 * (MaxIpHeaderLengthInBytes + IcmpHeaderLengthInBytes) + buffer.Length]; Stopwatch sw = Stopwatch.StartNew(); // Read from the socket in a loop. We may receive messages that are not echo replies, or that are not in response diff --git a/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs b/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs index b206e1e0f165d9..8b649c13656ec0 100644 --- a/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs +++ b/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs @@ -124,7 +124,6 @@ public async Task SendPingAsync_InvalidArgs() [Theory] [InlineData(AddressFamily.InterNetwork)] [InlineData(AddressFamily.InterNetworkV6)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void SendPingWithIPAddress(AddressFamily addressFamily) { IPAddress localIpAddress = TestSettings.GetLocalIPAddress(addressFamily); @@ -145,7 +144,6 @@ public void SendPingWithIPAddress(AddressFamily addressFamily) [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [InlineData(AddressFamily.InterNetwork)] [InlineData(AddressFamily.InterNetworkV6)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public async Task SendPingAsyncWithIPAddress(AddressFamily addressFamily) { IPAddress localIpAddress = await TestSettings.GetLocalIPAddressAsync(addressFamily); @@ -166,7 +164,6 @@ await SendBatchPingAsync( [Theory] [InlineData(AddressFamily.InterNetwork)] [InlineData(AddressFamily.InterNetworkV6)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void SendPingWithIPAddress_AddressAsString(AddressFamily addressFamily) { IPAddress localIpAddress = TestSettings.GetLocalIPAddress(addressFamily); @@ -185,7 +182,6 @@ public void SendPingWithIPAddress_AddressAsString(AddressFamily addressFamily) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public async Task SendPingAsyncWithIPAddress_AddressAsString() { IPAddress localIpAddress = await TestSettings.GetLocalIPAddressAsync(); @@ -199,7 +195,6 @@ await SendBatchPingAsync( } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void SendPingWithIPAddressAndTimeout() { IPAddress localIpAddress = TestSettings.GetLocalIPAddress(); @@ -213,7 +208,6 @@ public void SendPingWithIPAddressAndTimeout() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public async Task SendPingAsyncWithIPAddressAndTimeout() { IPAddress localIpAddress = await TestSettings.GetLocalIPAddressAsync(); @@ -260,7 +254,6 @@ await SendBatchPingAsync( [PlatformSpecific(TestPlatforms.AnyUnix)] // On Unix, Non-root pings cannot send arbitrary data in the buffer, and do not receive it back in the PingReply. [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void SendPingWithIPAddressAndTimeoutAndBuffer_Unix() { byte[] buffer = TestSettings.PayloadAsBytes; @@ -286,7 +279,6 @@ public void SendPingWithIPAddressAndTimeoutAndBuffer_Unix() [PlatformSpecific(TestPlatforms.AnyUnix)] // On Unix, Non-root pings cannot send arbitrary data in the buffer, and do not receive it back in the PingReply. [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public async Task SendPingAsyncWithIPAddressAndTimeoutAndBuffer_Unix() { byte[] buffer = TestSettings.PayloadAsBytes; @@ -350,7 +342,6 @@ await SendBatchPingAsync( [Theory] [InlineData(AddressFamily.InterNetwork)] [InlineData(AddressFamily.InterNetworkV6)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void SendPingWithIPAddressAndTimeoutAndBufferAndPingOptions_Unix(AddressFamily addressFamily) { IPAddress localIpAddress = TestSettings.GetLocalIPAddress(addressFamily); @@ -383,7 +374,6 @@ public void SendPingWithIPAddressAndTimeoutAndBufferAndPingOptions_Unix(AddressF [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [InlineData(AddressFamily.InterNetwork)] [InlineData(AddressFamily.InterNetworkV6)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public async Task SendPingAsyncWithIPAddressAndTimeoutAndBufferAndPingOptions_Unix(AddressFamily addressFamily) { IPAddress localIpAddress = await TestSettings.GetLocalIPAddressAsync(addressFamily); @@ -413,7 +403,6 @@ await SendBatchPingAsync( } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void SendPingWithHost() { IPAddress[] localIpAddresses = TestSettings.GetLocalIPAddresses(); @@ -427,7 +416,6 @@ public void SendPingWithHost() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public async Task SendPingAsyncWithHost() { IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync(); @@ -441,7 +429,6 @@ await SendBatchPingAsync( } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void SendPingWithHostAndTimeout() { IPAddress[] localIpAddresses = TestSettings.GetLocalIPAddresses(); @@ -455,7 +442,6 @@ public void SendPingWithHostAndTimeout() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public async Task SendPingAsyncWithHostAndTimeout() { IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync(); @@ -502,7 +488,6 @@ await SendBatchPingAsync( [PlatformSpecific(TestPlatforms.AnyUnix)] // On Unix, Non-root pings cannot send arbitrary data in the buffer, and do not receive it back in the PingReply. [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void SendPingWithHostAndTimeoutAndBuffer_Unix() { IPAddress[] localIpAddresses = TestSettings.GetLocalIPAddresses(); @@ -528,7 +513,6 @@ public void SendPingWithHostAndTimeoutAndBuffer_Unix() [PlatformSpecific(TestPlatforms.AnyUnix)] // On Unix, Non-root pings cannot send arbitrary data in the buffer, and do not receive it back in the PingReply. [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public async Task SendPingAsyncWithHostAndTimeoutAndBuffer_Unix() { IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync(); @@ -588,7 +572,6 @@ await SendBatchPingAsync( [PlatformSpecific(TestPlatforms.AnyUnix)] // On Unix, Non-root pings cannot send arbitrary data in the buffer, and do not receive it back in the PingReply. [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void SendPingWithHostAndTimeoutAndBufferAndPingOptions_Unix() { IPAddress[] localIpAddresses = TestSettings.GetLocalIPAddresses(); @@ -614,7 +597,6 @@ public void SendPingWithHostAndTimeoutAndBufferAndPingOptions_Unix() [PlatformSpecific(TestPlatforms.AnyUnix)] // On Unix, Non-root pings cannot send arbitrary data in the buffer, and do not receive it back in the PingReply. [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public async Task SendPingAsyncWithHostAndTimeoutAndBufferAndPingOptions_Unix() { IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync(); @@ -663,7 +645,6 @@ public async Task SendPingWithIPAddressAndBigSize() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public async Task SendPings_ReuseInstance_Hostname() { IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync(); @@ -679,7 +660,6 @@ public async Task SendPings_ReuseInstance_Hostname() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public async Task Sends_ReuseInstance_Hostname() { IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync(); @@ -695,7 +675,6 @@ public async Task Sends_ReuseInstance_Hostname() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public async Task SendAsyncs_ReuseInstance_Hostname() { IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync(); @@ -746,7 +725,6 @@ public async Task SendAsyncs_ReuseInstance_Hostname() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public static void Ping_DisposeAfterSend_Success() { Ping p = new Ping(); @@ -755,7 +733,6 @@ public static void Ping_DisposeAfterSend_Success() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public static async Task PingAsync_DisposeAfterSend_Success() { Ping p = new Ping(); @@ -832,7 +809,6 @@ public void CanBeFinalized() [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [InlineData(true)] [InlineData(false)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52617", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public async Task SendPingAsyncWithHostAndTtlAndFragmentPingOptions(bool fragment) { IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync(); @@ -878,7 +854,8 @@ public async Task SendPingToExternalHostWithLowTtlTest() options.Ttl = 1; // This should always fail unless host is one IP hop away. pingReply = await ping.SendPingAsync(host, TestSettings.PingTimeout, TestSettings.PayloadAsBytesShort, options); - Assert.NotEqual(IPStatus.Success, pingReply.Status); + Assert.Equal(IPStatus.TimeExceeded, pingReply.Status); + Assert.NotEqual(IPAddress.Any, pingReply.Address); } [Fact] diff --git a/src/libraries/System.Net.Primitives/tests/UnitTests/System.Net.Primitives.UnitTests.Tests.csproj b/src/libraries/System.Net.Primitives/tests/UnitTests/System.Net.Primitives.UnitTests.Tests.csproj index 077938e6ceb34e..4e77239fae9052 100644 --- a/src/libraries/System.Net.Primitives/tests/UnitTests/System.Net.Primitives.UnitTests.Tests.csproj +++ b/src/libraries/System.Net.Primitives/tests/UnitTests/System.Net.Primitives.UnitTests.Tests.csproj @@ -4,9 +4,10 @@ 169,649 ../../src/Resources/Strings.resx $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser + true - $(DefineConstants);SYSTEM_NET_PRIMITIVES_DLL @@ -106,4 +107,4 @@ - \ No newline at end of file + diff --git a/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj b/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj index 83686eb88a2b17..7017d01e08a0af 100644 --- a/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj +++ b/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj @@ -121,7 +121,7 @@ - + diff --git a/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs b/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs index 40ed3bf3b46027..18d8b909af07de 100644 --- a/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs +++ b/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs @@ -20,7 +20,7 @@ namespace System.Net.Quic.Tests { [ConditionalClass(typeof(QuicTestBase), nameof(IsSupported))] - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public class MsQuicTests : QuicTestBase { private static byte[] s_data = Encoding.UTF8.GetBytes("Hello world!"); diff --git a/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamConnectedStreamConformanceTests.cs b/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamConnectedStreamConformanceTests.cs index cb31cfd850c74a..9856f5cd77fcc9 100644 --- a/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamConnectedStreamConformanceTests.cs +++ b/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamConnectedStreamConformanceTests.cs @@ -18,10 +18,11 @@ namespace System.Net.Quic.Tests public sealed class MockQuicStreamConformanceTests : QuicStreamConformanceTests { protected override QuicImplementationProvider Provider => QuicImplementationProviders.Mock; + protected override bool BlocksOnZeroByteReads => true; } [ConditionalClass(typeof(QuicTestBase), nameof(QuicTestBase.IsSupported))] - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public sealed class MsQuicQuicStreamConformanceTests : QuicStreamConformanceTests { protected override QuicImplementationProvider Provider => QuicImplementationProviders.MsQuic; diff --git a/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamTests.cs b/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamTests.cs index ebb1d3baced0e1..d2551ab89ac8ff 100644 --- a/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamTests.cs +++ b/src/libraries/System.Net.Quic/tests/FunctionalTests/QuicStreamTests.cs @@ -406,8 +406,8 @@ await RunClientServer( while (true) // TODO: if you don't read until 0-byte read, ShutdownCompleted sometimes may not trigger - why? { - Memory recieveChunkBuffer = receiveBuffer.AsMemory(totalBytesRead, Math.Min(receiveBuffer.Length - totalBytesRead, readSize)); - int bytesRead = await serverStream.ReadAsync(recieveChunkBuffer); + Memory receiveChunkBuffer = receiveBuffer.AsMemory(totalBytesRead, Math.Min(receiveBuffer.Length - totalBytesRead, readSize)); + int bytesRead = await serverStream.ReadAsync(receiveChunkBuffer); if (bytesRead == 0) { break; @@ -994,13 +994,9 @@ public QuicStreamTests_MockProvider(ITestOutputHelper output) : base(output) { } } [ConditionalClass(typeof(QuicTestBase), nameof(QuicTestBase.IsSupported))] - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public sealed class QuicStreamTests_MsQuicProvider : QuicStreamTests { public QuicStreamTests_MsQuicProvider(ITestOutputHelper output) : base(output) { } } - - // Define test collection for tests to avoid all other tests. - [CollectionDefinition("NoParallelTests", DisableParallelization = true)] - public partial class NoParallelTests { } } diff --git a/src/libraries/System.Net.Quic/tests/FunctionalTests/System.Net.Quic.Functional.Tests.csproj b/src/libraries/System.Net.Quic/tests/FunctionalTests/System.Net.Quic.Functional.Tests.csproj index 2a17894a5555a7..471ca7ee5bf80c 100644 --- a/src/libraries/System.Net.Quic/tests/FunctionalTests/System.Net.Quic.Functional.Tests.csproj +++ b/src/libraries/System.Net.Quic/tests/FunctionalTests/System.Net.Quic.Functional.Tests.csproj @@ -22,6 +22,7 @@ + diff --git a/src/libraries/System.Net.Requests/src/Resources/Strings.resx b/src/libraries/System.Net.Requests/src/Resources/Strings.resx index 5240ec2908eec6..a3b2bb922d3c78 100644 --- a/src/libraries/System.Net.Requests/src/Resources/Strings.resx +++ b/src/libraries/System.Net.Requests/src/Resources/Strings.resx @@ -270,4 +270,7 @@ System.Net.Requests is not supported on this platform. + + The request was aborted: The request cache-only policy does not allow a network request and the response is not found in cache. + diff --git a/src/libraries/System.Net.Requests/src/System/Net/HttpWebRequest.cs b/src/libraries/System.Net.Requests/src/System/Net/HttpWebRequest.cs index 3adae087059e31..c92ea9f28d5d24 100644 --- a/src/libraries/System.Net.Requests/src/System/Net/HttpWebRequest.cs +++ b/src/libraries/System.Net.Requests/src/System/Net/HttpWebRequest.cs @@ -7,6 +7,7 @@ using System.IO; using System.Net.Cache; using System.Net.Http; +using System.Net.Http.Headers; using System.Net.Security; using System.Net.Sockets; using System.Runtime.Serialization; @@ -689,7 +690,21 @@ public static int DefaultMaximumErrorResponseLength get; set; } - public static new RequestCachePolicy? DefaultCachePolicy { get; set; } = new RequestCachePolicy(RequestCacheLevel.BypassCache); + private static RequestCachePolicy? _defaultCachePolicy = new RequestCachePolicy(RequestCacheLevel.BypassCache); + private static bool _isDefaultCachePolicySet; + + public static new RequestCachePolicy? DefaultCachePolicy + { + get + { + return _defaultCachePolicy; + } + set + { + _isDefaultCachePolicySet = true; + _defaultCachePolicy = value; + } + } public DateTime IfModifiedSince { @@ -1137,6 +1152,8 @@ private async Task SendRequest(bool async) request.Headers.Host = Host; } + AddCacheControlHeaders(request); + // Copy the HttpWebRequest request headers from the WebHeaderCollection into HttpRequestMessage.Headers and // HttpRequestMessage.Content.Headers. foreach (string headerName in _webHeaderCollection) @@ -1202,6 +1219,118 @@ private async Task SendRequest(bool async) } } + private void AddCacheControlHeaders(HttpRequestMessage request) + { + RequestCachePolicy? policy = GetApplicableCachePolicy(); + + if (policy != null && policy.Level != RequestCacheLevel.BypassCache) + { + CacheControlHeaderValue? cacheControl = null; + HttpHeaderValueCollection pragmaHeaders = request.Headers.Pragma; + + if (policy is HttpRequestCachePolicy httpRequestCachePolicy) + { + switch (httpRequestCachePolicy.Level) + { + case HttpRequestCacheLevel.NoCacheNoStore: + cacheControl = new CacheControlHeaderValue + { + NoCache = true, + NoStore = true + }; + pragmaHeaders.Add(new NameValueHeaderValue("no-cache")); + break; + case HttpRequestCacheLevel.Reload: + cacheControl = new CacheControlHeaderValue + { + NoCache = true + }; + pragmaHeaders.Add(new NameValueHeaderValue("no-cache")); + break; + case HttpRequestCacheLevel.CacheOnly: + throw new WebException(SR.CacheEntryNotFound, WebExceptionStatus.CacheEntryNotFound); + case HttpRequestCacheLevel.CacheOrNextCacheOnly: + cacheControl = new CacheControlHeaderValue + { + OnlyIfCached = true + }; + break; + case HttpRequestCacheLevel.Default: + cacheControl = new CacheControlHeaderValue(); + + if (httpRequestCachePolicy.MinFresh > TimeSpan.Zero) + { + cacheControl.MinFresh = httpRequestCachePolicy.MinFresh; + } + + if (httpRequestCachePolicy.MaxAge != TimeSpan.MaxValue) + { + cacheControl.MaxAge = httpRequestCachePolicy.MaxAge; + } + + if (httpRequestCachePolicy.MaxStale > TimeSpan.Zero) + { + cacheControl.MaxStale = true; + cacheControl.MaxStaleLimit = httpRequestCachePolicy.MaxStale; + } + + break; + case HttpRequestCacheLevel.Refresh: + cacheControl = new CacheControlHeaderValue + { + MaxAge = TimeSpan.Zero + }; + pragmaHeaders.Add(new NameValueHeaderValue("no-cache")); + break; + } + } + else + { + switch (policy.Level) + { + case RequestCacheLevel.NoCacheNoStore: + cacheControl = new CacheControlHeaderValue + { + NoCache = true, + NoStore = true + }; + pragmaHeaders.Add(new NameValueHeaderValue("no-cache")); + break; + case RequestCacheLevel.Reload: + cacheControl = new CacheControlHeaderValue + { + NoCache = true + }; + pragmaHeaders.Add(new NameValueHeaderValue("no-cache")); + break; + case RequestCacheLevel.CacheOnly: + throw new WebException(SR.CacheEntryNotFound, WebExceptionStatus.CacheEntryNotFound); + } + } + + if (cacheControl != null) + { + request.Headers.CacheControl = cacheControl; + } + } + } + + private RequestCachePolicy? GetApplicableCachePolicy() + { + if (CachePolicy != null) + { + return CachePolicy; + } + else if (_isDefaultCachePolicySet && DefaultCachePolicy != null) + { + return DefaultCachePolicy; + } + else + { + return WebRequest.DefaultCachePolicy; + } + } + public override IAsyncResult BeginGetResponse(AsyncCallback? callback, object? state) { CheckAbort(); diff --git a/src/libraries/System.Net.Requests/tests/HttpWebRequestTest.cs b/src/libraries/System.Net.Requests/tests/HttpWebRequestTest.cs index d5062de525162b..c54fe136cef073 100644 --- a/src/libraries/System.Net.Requests/tests/HttpWebRequestTest.cs +++ b/src/libraries/System.Net.Requests/tests/HttpWebRequestTest.cs @@ -1924,6 +1924,170 @@ public void Abort_CreateRequestThenAbort_Success(Uri remoteServer) request.Abort(); } + [Theory] + [InlineData(HttpRequestCacheLevel.NoCacheNoStore, null, null, new string[] { "Pragma: no-cache", "Cache-Control: no-store, no-cache"})] + [InlineData(HttpRequestCacheLevel.Reload, null, null, new string[] { "Pragma: no-cache", "Cache-Control: no-cache" })] + [InlineData(HttpRequestCacheLevel.CacheOrNextCacheOnly, null, null, new string[] { "Cache-Control: only-if-cached" })] + [InlineData(HttpRequestCacheLevel.Default, HttpCacheAgeControl.MinFresh, 10, new string[] { "Cache-Control: min-fresh=10" })] + [InlineData(HttpRequestCacheLevel.Default, HttpCacheAgeControl.MaxAge, 10, new string[] { "Cache-Control: max-age=10" })] + [InlineData(HttpRequestCacheLevel.Default, HttpCacheAgeControl.MaxStale, 10, new string[] { "Cache-Control: max-stale=10" })] + [InlineData(HttpRequestCacheLevel.Refresh, null, null, new string[] { "Pragma: no-cache", "Cache-Control: max-age=0" })] + public async Task SendHttpGetRequest_WithHttpCachePolicy_AddCacheHeaders( + HttpRequestCacheLevel requestCacheLevel, HttpCacheAgeControl? ageControl, int? age, string[] expectedHeaders) + { + await LoopbackServer.CreateServerAsync(async (server, uri) => + { + HttpWebRequest request = WebRequest.CreateHttp(uri); + request.CachePolicy = ageControl != null ? + new HttpRequestCachePolicy(ageControl.Value, TimeSpan.FromSeconds((double)age)) + : new HttpRequestCachePolicy(requestCacheLevel); + Task getResponse = GetResponseAsync(request); + + await server.AcceptConnectionAsync(async connection => + { + List headers = await connection.ReadRequestHeaderAndSendResponseAsync(); + + foreach (string header in expectedHeaders) + { + Assert.Contains(header, headers); + } + }); + + using (var response = (HttpWebResponse)await getResponse) + { + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + }); + } + + [Theory] + [InlineData(RequestCacheLevel.NoCacheNoStore, new string[] { "Pragma: no-cache", "Cache-Control: no-store, no-cache" })] + [InlineData(RequestCacheLevel.Reload, new string[] { "Pragma: no-cache", "Cache-Control: no-cache" })] + public async Task SendHttpGetRequest_WithCachePolicy_AddCacheHeaders( + RequestCacheLevel requestCacheLevel, string[] expectedHeaders) + { + await LoopbackServer.CreateServerAsync(async (server, uri) => + { + HttpWebRequest request = WebRequest.CreateHttp(uri); + request.CachePolicy = new RequestCachePolicy(requestCacheLevel); + Task getResponse = GetResponseAsync(request); + + await server.AcceptConnectionAsync(async connection => + { + List headers = await connection.ReadRequestHeaderAndSendResponseAsync(); + + foreach (string header in expectedHeaders) + { + Assert.Contains(header, headers); + } + }); + + using (var response = (HttpWebResponse)await getResponse) + { + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + }); + } + + [ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] + [InlineData(RequestCacheLevel.NoCacheNoStore, new string[] { "Pragma: no-cache", "Cache-Control: no-store, no-cache" })] + [InlineData(RequestCacheLevel.Reload, new string[] { "Pragma: no-cache", "Cache-Control: no-cache" })] + public void SendHttpGetRequest_WithGlobalCachePolicy_AddCacheHeaders( + RequestCacheLevel requestCacheLevel, string[] expectedHeaders) + { + RemoteExecutor.Invoke(async (async, reqCacheLevel, eh0, eh1) => + { + await LoopbackServer.CreateServerAsync(async (server, uri) => + { + HttpWebRequest.DefaultCachePolicy = new RequestCachePolicy(Enum.Parse(reqCacheLevel)); + HttpWebRequest request = WebRequest.CreateHttp(uri); + Task getResponse = bool.Parse(async) ? request.GetResponseAsync() : Task.Run(() => request.GetResponse()); + + await server.AcceptConnectionAsync(async connection => + { + List headers = await connection.ReadRequestHeaderAndSendResponseAsync(); + Assert.Contains(eh0, headers); + Assert.Contains(eh1, headers); + }); + + using (var response = (HttpWebResponse)await getResponse) + { + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + }); + }, (this is HttpWebRequestTest_Async).ToString(), requestCacheLevel.ToString(), expectedHeaders[0], expectedHeaders[1]).Dispose(); + } + + [Theory] + [InlineData(true)] + [InlineData(false)] + public async Task SendHttpGetRequest_WithCachePolicyCacheOnly_ThrowException( + bool isHttpCachePolicy) + { + HttpWebRequest request = WebRequest.CreateHttp("http://anything"); + request.CachePolicy = isHttpCachePolicy ? new HttpRequestCachePolicy(HttpRequestCacheLevel.CacheOnly) + : new RequestCachePolicy(RequestCacheLevel.CacheOnly); + WebException exception = await Assert.ThrowsAsync(() => GetResponseAsync(request)); + Assert.Equal(SR.CacheEntryNotFound, exception.Message); + } + + [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] + public void SendHttpGetRequest_WithGlobalCachePolicyBypassCache_DoNotAddCacheHeaders() + { + RemoteExecutor.Invoke(async () => + { + await LoopbackServer.CreateServerAsync(async (server, uri) => + { + HttpWebRequest.DefaultCachePolicy = new RequestCachePolicy(RequestCacheLevel.BypassCache); + HttpWebRequest request = WebRequest.CreateHttp(uri); + Task getResponse = request.GetResponseAsync(); + + await server.AcceptConnectionAsync(async connection => + { + List headers = await connection.ReadRequestHeaderAndSendResponseAsync(); + + foreach (string header in headers) + { + Assert.DoesNotContain("Pragma", header); + Assert.DoesNotContain("Cache-Control", header); + } + }); + + using (var response = (HttpWebResponse)await getResponse) + { + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + }); + }).Dispose(); + } + + [Fact] + public async Task SendHttpGetRequest_WithCachePolicyBypassCache_DoNotAddHeaders() + { + await LoopbackServer.CreateServerAsync(async (server, uri) => + { + HttpWebRequest request = WebRequest.CreateHttp(uri); + request.CachePolicy = new RequestCachePolicy(RequestCacheLevel.BypassCache); + Task getResponse = request.GetResponseAsync(); + + await server.AcceptConnectionAsync(async connection => + { + List headers = await connection.ReadRequestHeaderAndSendResponseAsync(); + + foreach (string header in headers) + { + Assert.DoesNotContain("Pragma", header); + Assert.DoesNotContain("Cache-Control", header); + } + }); + + using (var response = (HttpWebResponse)await getResponse) + { + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + }); + } + private void RequestStreamCallback(IAsyncResult asynchronousResult) { RequestState state = (RequestState)asynchronousResult.AsyncState; diff --git a/src/libraries/System.Net.Requests/tests/WebRequestTest.cs b/src/libraries/System.Net.Requests/tests/WebRequestTest.cs index a6746fc33f219f..5b640e65bdfc9b 100644 --- a/src/libraries/System.Net.Requests/tests/WebRequestTest.cs +++ b/src/libraries/System.Net.Requests/tests/WebRequestTest.cs @@ -1,6 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Collections.Generic; +using System.Net.Cache; +using System.Net.Test.Common; +using System.Threading.Tasks; using Microsoft.DotNet.RemoteExecutor; using Xunit; @@ -186,6 +190,65 @@ public void RegisterPrefix_DuplicateHttpWithFakeFactory_ExpectFalse() Assert.False(success); } + [ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] + [InlineData(RequestCacheLevel.NoCacheNoStore, new string[] { "Pragma: no-cache", "Cache-Control: no-store, no-cache" })] + [InlineData(RequestCacheLevel.Reload, new string[] { "Pragma: no-cache", "Cache-Control: no-cache" })] + public void SendGetRequest_WithGlobalCachePolicy_AddCacheHeaders( + RequestCacheLevel requestCacheLevel, string[] expectedHeaders) + { + RemoteExecutor.Invoke(async (reqCacheLevel, eh0, eh1) => + { + await LoopbackServer.CreateServerAsync(async (server, uri) => + { + WebRequest.DefaultCachePolicy = new RequestCachePolicy(Enum.Parse(reqCacheLevel)); + WebRequest request = WebRequest.Create(uri); + Task getResponse = request.GetResponseAsync(); + + await server.AcceptConnectionAsync(async connection => + { + List headers = await connection.ReadRequestHeaderAndSendResponseAsync(); + Assert.Contains(eh0, headers); + Assert.Contains(eh1, headers); + }); + + using (var response = (HttpWebResponse)await getResponse) + { + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + }); + }, requestCacheLevel.ToString(), expectedHeaders[0], expectedHeaders[1]).Dispose(); + } + + [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] + public void SendGetRequest_WithGlobalCachePolicyBypassCache_DoNotAddCacheHeaders() + { + RemoteExecutor.Invoke(async () => + { + await LoopbackServer.CreateServerAsync(async (server, uri) => + { + WebRequest.DefaultCachePolicy = new RequestCachePolicy(RequestCacheLevel.BypassCache); + WebRequest request = WebRequest.Create(uri); + Task getResponse = request.GetResponseAsync(); + + await server.AcceptConnectionAsync(async connection => + { + List headers = await connection.ReadRequestHeaderAndSendResponseAsync(); + + foreach(string header in headers) + { + Assert.DoesNotContain("Pragma", header); + Assert.DoesNotContain("Cache-Control", header); + } + }); + + using (var response = (HttpWebResponse)await getResponse) + { + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + }); + }).Dispose(); + } + private class FakeRequest : WebRequest { private readonly Uri _uri; diff --git a/src/libraries/System.Net.Security/src/System.Net.Security.csproj b/src/libraries/System.Net.Security/src/System.Net.Security.csproj index 08e3ba068baeee..9f90dbd3951f05 100644 --- a/src/libraries/System.Net.Security/src/System.Net.Security.csproj +++ b/src/libraries/System.Net.Security/src/System.Net.Security.csproj @@ -425,7 +425,7 @@ - + diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs b/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs index add2a3b3bedbce..b75ee2bee74753 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs @@ -158,8 +158,11 @@ protected override void Dispose(bool disposing) SafeSslHandle sslContext = _sslContext; if (null != sslContext) { - _inputBuffer.Dispose(); - _outputBuffer.Dispose(); + lock (_sslContext) + { + _inputBuffer.Dispose(); + _outputBuffer.Dispose(); + } sslContext.Dispose(); } } @@ -178,18 +181,21 @@ private static unsafe int WriteToConnection(IntPtr connection, byte* data, void* // but if we were to pool the buffers we would have a potential use-after-free issue. try { - ulong length = (ulong)*dataLength; - Debug.Assert(length <= int.MaxValue); + lock (context) + { + ulong length = (ulong)*dataLength; + Debug.Assert(length <= int.MaxValue); - int toWrite = (int)length; - var inputBuffer = new ReadOnlySpan(data, toWrite); + int toWrite = (int)length; + var inputBuffer = new ReadOnlySpan(data, toWrite); - context._outputBuffer.EnsureAvailableSpace(toWrite); - inputBuffer.CopyTo(context._outputBuffer.AvailableSpan); - context._outputBuffer.Commit(toWrite); - // Since we can enqueue everything, no need to re-assign *dataLength. + context._outputBuffer.EnsureAvailableSpace(toWrite); + inputBuffer.CopyTo(context._outputBuffer.AvailableSpan); + context._outputBuffer.Commit(toWrite); + // Since we can enqueue everything, no need to re-assign *dataLength. - return OSStatus_noErr; + return OSStatus_noErr; + } } catch (Exception e) { @@ -207,29 +213,32 @@ private static unsafe int ReadFromConnection(IntPtr connection, byte* data, void try { - ulong toRead = (ulong)*dataLength; - - if (toRead == 0) + lock (context) { - return OSStatus_noErr; - } + ulong toRead = (ulong)*dataLength; - uint transferred = 0; + if (toRead == 0) + { + return OSStatus_noErr; + } - if (context._inputBuffer.ActiveLength == 0) - { - *dataLength = (void*)0; - return OSStatus_errSSLWouldBlock; - } + uint transferred = 0; - int limit = Math.Min((int)toRead, context._inputBuffer.ActiveLength); + if (context._inputBuffer.ActiveLength == 0) + { + *dataLength = (void*)0; + return OSStatus_errSSLWouldBlock; + } + + int limit = Math.Min((int)toRead, context._inputBuffer.ActiveLength); - context._inputBuffer.ActiveSpan.Slice(0, limit).CopyTo(new Span(data, limit)); - context._inputBuffer.Discard(limit); - transferred = (uint)limit; + context._inputBuffer.ActiveSpan.Slice(0, limit).CopyTo(new Span(data, limit)); + context._inputBuffer.Discard(limit); + transferred = (uint)limit; - *dataLength = (void*)transferred; - return OSStatus_noErr; + *dataLength = (void*)transferred; + return OSStatus_noErr; + } } catch (Exception e) { @@ -241,24 +250,30 @@ private static unsafe int ReadFromConnection(IntPtr connection, byte* data, void internal void Write(ReadOnlySpan buf) { - _inputBuffer.EnsureAvailableSpace(buf.Length); - buf.CopyTo(_inputBuffer.AvailableSpan); - _inputBuffer.Commit(buf.Length); + lock (_sslContext) + { + _inputBuffer.EnsureAvailableSpace(buf.Length); + buf.CopyTo(_inputBuffer.AvailableSpan); + _inputBuffer.Commit(buf.Length); + } } internal int BytesReadyForConnection => _outputBuffer.ActiveLength; internal byte[]? ReadPendingWrites() { - if (_outputBuffer.ActiveLength == 0) + lock (_sslContext) { - return null; - } + if (_outputBuffer.ActiveLength == 0) + { + return null; + } - byte[] buffer = _outputBuffer.ActiveSpan.ToArray(); - _outputBuffer.Discard(_outputBuffer.ActiveLength); + byte[] buffer = _outputBuffer.ActiveSpan.ToArray(); + _outputBuffer.Discard(_outputBuffer.ActiveLength); - return buffer; + return buffer; + } } internal int ReadPendingWrites(byte[] buf, int offset, int count) @@ -268,12 +283,15 @@ internal int ReadPendingWrites(byte[] buf, int offset, int count) Debug.Assert(count >= 0); Debug.Assert(count <= buf.Length - offset); - int limit = Math.Min(count, _outputBuffer.ActiveLength); + lock (_sslContext) + { + int limit = Math.Min(count, _outputBuffer.ActiveLength); - _outputBuffer.ActiveSpan.Slice(0, limit).CopyTo(new Span(buf, offset, limit)); - _outputBuffer.Discard(limit); + _outputBuffer.ActiveSpan.Slice(0, limit).CopyTo(new Span(buf, offset, limit)); + _outputBuffer.Discard(limit); - return limit; + return limit; + } } private static readonly SslProtocols[] s_orderedSslProtocols = new SslProtocols[5] diff --git a/src/libraries/System.Net.Security/tests/StressTests/SslStress/Build-Local.ps1 b/src/libraries/System.Net.Security/tests/StressTests/SslStress/Build-Local.ps1 new file mode 100644 index 00000000000000..dc8ae9b4494094 --- /dev/null +++ b/src/libraries/System.Net.Security/tests/StressTests/SslStress/Build-Local.ps1 @@ -0,0 +1,47 @@ +## This is a helper script for non-containerized local build and test execution. +## It downloads and uses the daily SDK which contains the compatible AspNetCore bits. +## Usage: +## ./build-local.ps1 [StressConfiguration] [LibrariesConfiguration] + +# Note that this script does much less than it's counterpart in HttpStress. +# In SslStress it's a thin utility to generate a runscript for running the app with the live-built testhost. +# The main reason to use an equivalent solution in SslStress is consistency with HttpStress. + +$Version="7.0" +$RepoRoot="$(git rev-parse --show-toplevel)" +$DailyDotnetRoot= "./.dotnet-daily" + +$StressConfiguration = "Release" +if (-not ([string]::IsNullOrEmpty($args[0]))) { + $StressConfiguration = $args[0] +} + +$LibrariesConfiguration = "Release" +if (-not ([string]::IsNullOrEmpty($args[1]))) { + $LibrariesConfiguration = $args[0] +} + +$TestHostRoot="$RepoRoot/artifacts/bin/testhost/net$Version-windows-$LibrariesConfiguration-x64" + +Write-Host "StressConfiguration: $StressConfiguration, LibrariesConfiguration: $LibrariesConfiguration, testhost: $TestHostRoot" + +if (-not (Test-Path -Path $TestHostRoot)) { + Write-Host "Cannot find testhost in: $TestHostRoot" + Write-Host "Make sure libraries with the requested configuration are built!" + Write-Host "Usage:" + Write-Host "./build-local.sh [StressConfiguration] [LibrariesConfiguration]" + Write-Host "StressConfiguration and LibrariesConfiguration default to Release!" + exit 1 +} + +Write-Host "Building solution." +dotnet build -c $StressConfiguration + +$Runscript=".\run-stress-$LibrariesConfiguration-$StressConfiguration.ps1" +if (-not (Test-Path $Runscript)) { + Write-Host "Generating Runscript." + Add-Content -Path $Runscript -Value "& '$TestHostRoot/dotnet' exec ./bin/$StressConfiguration/net$Version/SslStress.dll `$args" +} + +Write-Host "To run tests type:" +Write-Host "$Runscript [stress test args]" \ No newline at end of file diff --git a/src/libraries/System.Net.Security/tests/StressTests/SslStress/Directory.Build.props b/src/libraries/System.Net.Security/tests/StressTests/SslStress/Directory.Build.props index 8998bf4546770d..74036484c18dd0 100644 --- a/src/libraries/System.Net.Security/tests/StressTests/SslStress/Directory.Build.props +++ b/src/libraries/System.Net.Security/tests/StressTests/SslStress/Directory.Build.props @@ -1 +1,17 @@ - + + + linux-x64 + win-x64 + + + $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)../, global.json))/ + + $(RepositoryRoot)eng/targetingpacks.targets + 7.0.0 + net7.0 + 7.0 + Microsoft.NETCore.App + $(RepositoryRoot)artifacts/bin/microsoft.netcore.app.ref/ + $(RepositoryRoot)artifacts/bin/microsoft.netcore.app.runtime.$(PackageRid)/$(Configuration)/ + + \ No newline at end of file diff --git a/src/libraries/System.Net.Security/tests/StressTests/SslStress/Directory.Build.targets b/src/libraries/System.Net.Security/tests/StressTests/SslStress/Directory.Build.targets index 8998bf4546770d..85e81c583072ee 100644 --- a/src/libraries/System.Net.Security/tests/StressTests/SslStress/Directory.Build.targets +++ b/src/libraries/System.Net.Security/tests/StressTests/SslStress/Directory.Build.targets @@ -1 +1,11 @@ - + + + + + + 7.0 + + \ No newline at end of file diff --git a/src/libraries/System.Net.Security/tests/StressTests/SslStress/Dockerfile b/src/libraries/System.Net.Security/tests/StressTests/SslStress/Dockerfile index 8e97f642a73b4e..d47c4c9be1be2c 100644 --- a/src/libraries/System.Net.Security/tests/StressTests/SslStress/Dockerfile +++ b/src/libraries/System.Net.Security/tests/StressTests/SslStress/Dockerfile @@ -1,18 +1,23 @@ ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:6.0-bullseye-slim FROM $SDK_BASE_IMAGE -RUN echo "DOTNET_SDK_VERSION="$DOTNET_SDK_VERSION -RUN echo "DOTNET_VERSION="$DOTNET_VERSION - WORKDIR /app COPY . . WORKDIR /app/System.Net.Security/tests/StressTests/SslStress +ARG VERSION=7.0 ARG CONFIGURATION=Release -RUN dotnet build -c $CONFIGURATION + +RUN dotnet build -c $CONFIGURATION \ + -p:TargetingPacksTargetsLocation=/live-runtime-artifacts/targetingpacks.targets \ + -p:MicrosoftNetCoreAppRefPackDir=/live-runtime-artifacts/microsoft.netcore.app.ref/ \ + -p:MicrosoftNetCoreAppRuntimePackDir=/live-runtime-artifacts/microsoft.netcore.app.runtime.linux-x64/$CONFIGURATION/ EXPOSE 5001 +ENV VERSION=$VERSION ENV CONFIGURATION=$CONFIGURATION ENV SSLSTRESS_ARGS='' -CMD dotnet run --no-build -c $CONFIGURATION -- $SSLSTRESS_ARGS + +CMD /live-runtime-artifacts/testhost/net$VERSION-Linux-$CONFIGURATION-x64/dotnet exec \ + ./bin/$CONFIGURATION/net$VERSION/SslStress.dll $SSLSTRESS_ARGS \ No newline at end of file diff --git a/src/libraries/System.Net.Security/tests/StressTests/SslStress/Readme.md b/src/libraries/System.Net.Security/tests/StressTests/SslStress/Readme.md index 18ed7562ace345..f58d5089a3c9a3 100644 --- a/src/libraries/System.Net.Security/tests/StressTests/SslStress/Readme.md +++ b/src/libraries/System.Net.Security/tests/StressTests/SslStress/Readme.md @@ -4,39 +4,47 @@ Provides stress testing scenaria for System.Net.Security.SslStream. ### Running the suite locally -Using the command line, +Prerequisite: the runtime and the libraries should be [live-built](https://github.com/dotnet/runtime/tree/main/docs/workflow/building/libraries) with `build.cmd`/`build.sh`. + +Use the script `build-local.sh` / `Build-Local.ps1` to build the stress project against the live-built runtime. + +```bash +$ build-local.sh [StressConfiguration] [LibrariesConfiguration] +``` + +The build script will also generate the runscript that runs the stress suite using the locally built testhost in the form of `run-stress--.sh`. To run the tests with the script, assuming that both the stress project and the libraries have been built against Release configuration: ```bash -$ dotnet run -- +$ run-stress-Release-Release.sh [stress suite args] ``` To get the full list of available parameters: ```bash -$ dotnet run -- -help +$ run-stress-Release-Release.sh.sh -help ``` -### Running with local runtime builds +### Building and running with Docker -Note that the stress suite will test the sdk available in the environment, -that is to say it will not necessarily test the implementation of the local runtime repo. -To achieve this, we will first need to build a new sdk from source. This can be done [using docker](https://github.com/dotnet/runtime/blob/main/eng/docker/Readme.md). +A docker image containing the live-built runtime bits and the latest daily SDK is created with the [`build-docker-sdk.sh/ps1` scripts](https://github.com/dotnet/runtime/blob/main/eng/docker/Readme.md). -### Running using docker-compose +It's possible to manually `docker build` a docker image containing the stress project based on the docker image created with `build-docker-sdk.sh/ps1`, however the preferred way is to use docker-compose, which can be used to target both linux and windows containers. -The preferred way of running the stress suite is using docker-compose, -which can be used to target both linux and windows containers. Docker and compose-compose are required for this step (both included in [docker for windows](https://docs.docker.com/docker-for-windows/)). #### Using Linux containers -From the stress folder on powershell: +From the stress folder: ```powershell PS> .\run-docker-compose.ps1 -b ``` -This will build the libraries and stress suite to a linux docker image and initialize a stress run using docker-compose. +```bash +$ ./run-docker-compose.sh -b +``` + +This will build libraries and stress suite to a linux docker image and initialize a stress run using docker-compose. #### Using Windows containers @@ -53,4 +61,4 @@ For more details on how the `run-docker-compose.ps1` script can be used: ```powershell Get-Help .\run-docker-compose.ps1 -``` +``` \ No newline at end of file diff --git a/src/libraries/System.Net.Security/tests/StressTests/SslStress/SslStress.csproj b/src/libraries/System.Net.Security/tests/StressTests/SslStress/SslStress.csproj index 8b0a7a0aea1882..a2c1d8dffa5691 100644 --- a/src/libraries/System.Net.Security/tests/StressTests/SslStress/SslStress.csproj +++ b/src/libraries/System.Net.Security/tests/StressTests/SslStress/SslStress.csproj @@ -1,7 +1,7 @@ Exe - net6.0 + $(NetCoreAppCurrent) enable @@ -11,4 +11,4 @@ - + \ No newline at end of file diff --git a/src/libraries/System.Net.Security/tests/StressTests/SslStress/build-local.sh b/src/libraries/System.Net.Security/tests/StressTests/SslStress/build-local.sh new file mode 100755 index 00000000000000..80237579a1467a --- /dev/null +++ b/src/libraries/System.Net.Security/tests/StressTests/SslStress/build-local.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +## This is a helper script for non-containerized local build and test execution. +## Usage: +## ./build-local.sh [Configuration] + +# Note that this script does much less than it's counterpart in HttpStress. +# In SslStress it's a thin utility to generate a runscript for running the app with the live-built testhost. +# The main reason to use an equivalent solution in SslStress is consistency with HttpStress. + +version=7.0 +repo_root=$(git rev-parse --show-toplevel) + +stress_configuration="Release" +if [ "$1" != "" ]; then + stress_configuration=${1,,} # Lowercase all characters in $1 + stress_configuration=${stress_configuration^} # Uppercase first character +fi + +libraries_configuration="Release" +if [ "$2" != "" ]; then + libraries_configuration=${2,,} # Lowercase all characters in $1 + libraries_configuration=${libraries_configuration^} # Uppercase first character +fi + +testhost_root=$repo_root/artifacts/bin/testhost/net$version-Linux-$libraries_configuration-x64 +echo "StressConfiguration: $stress_configuration, LibrariesConfiguration: $libraries_configuration, testhost: $testhost_root" + +if [[ ! -d $testhost_root ]]; then + echo "Cannot find testhost in: $testhost_root" + echo "Make sure libraries with the requested configuration are built!" + echo "Usage:" + echo "./build-local.sh [StressConfiguration] [LibrariesConfiguration]" + echo "StressConfiguration and LibrariesConfiguration default to Release!" + exit 1 +fi + +echo "Building solution." +dotnet build -c $stress_configuration + +runscript=./run-stress-${stress_configuration,,}-${libraries_configuration,,}.sh +if [[ ! -f $runscript ]]; then + echo "Generating runscript." + echo "$testhost_root/dotnet exec ./bin/$stress_configuration/net$version/SslStress.dll \$@" > $runscript + chmod +x $runscript +fi + +echo "To run tests type:" +echo "$runscript [stress test args]" \ No newline at end of file diff --git a/src/libraries/System.Net.Security/tests/StressTests/SslStress/run-docker-compose.ps1 b/src/libraries/System.Net.Security/tests/StressTests/SslStress/run-docker-compose.ps1 index 3d3959021d4390..99981196fd3513 100755 --- a/src/libraries/System.Net.Security/tests/StressTests/SslStress/run-docker-compose.ps1 +++ b/src/libraries/System.Net.Security/tests/StressTests/SslStress/run-docker-compose.ps1 @@ -6,7 +6,6 @@ Param( [string][Alias('c')]$configuration = "Release", # Build configuration for libraries and stress suite [switch][Alias('w')]$useWindowsContainers, # Use windows containers, if available [switch][Alias('b')]$buildCurrentLibraries, # Drives the stress test using libraries built from current source - [switch][Alias('pa')]$privateAspNetCore, # Drive the stress test using a private Asp.Net Core package, requires -b to be set [switch][Alias('o')]$buildOnly, # Build, but do not run the stress app [string][Alias('t')]$sdkImageName, # Name of the sdk image name, if built from source. [string]$clientStressArgs = "", @@ -30,20 +29,11 @@ if ($buildCurrentLibraries) { $LIBRARIES_BUILD_ARGS += " -w" } - if($privateAspNetCore) - { - $LIBRARIES_BUILD_ARGS += " -p" - } Invoke-Expression "& $REPO_ROOT_DIR/eng/docker/build-docker-sdk.ps1 $LIBRARIES_BUILD_ARGS" if (!$?) { exit 1 } } -elseif ($privateAspNetCore) { - write-output "Using a private Asp.Net Core package (-pa) requires using privately built libraries. Please, enable it with -b switch." - write-output "USAGE: . $($MyInvocation.InvocationName) -b -pa " - exit 1 -} # Dockerize the stress app using docker-compose diff --git a/src/libraries/System.Net.Security/tests/StressTests/SslStress/run-docker-compose.sh b/src/libraries/System.Net.Security/tests/StressTests/SslStress/run-docker-compose.sh index e18b80fca1dc35..ee1ec60f6c0a08 100755 --- a/src/libraries/System.Net.Security/tests/StressTests/SslStress/run-docker-compose.sh +++ b/src/libraries/System.Net.Security/tests/StressTests/SslStress/run-docker-compose.sh @@ -22,7 +22,6 @@ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" imagename="dotnet-sdk-libs-current" configuration="Release" -privateaspnetcore=0 buildcurrentlibraries=0 buildonly=0 clientstressargs="" @@ -39,10 +38,6 @@ while [[ $# > 0 ]]; do configuration=$2 shift 2 ;; - -privateaspnetcore|-pa) - privateaspnetcore=1 - shift 1 - ;; -buildcurrentlibraries|-b) buildcurrentlibraries=1 shift 1 @@ -67,23 +62,16 @@ done repo_root=$(git rev-parse --show-toplevel) -if [[ buildcurrentlibraries -eq 1 ]]; then +if [[ "$buildcurrentlibraries" -eq 1 ]]; then libraries_args=" -t $imagename -c $configuration" - if [[ $privateaspnetcore -eq 1 ]]; then - libraries_args="$libraries_args -pa" - fi - if ! $repo_root/eng/docker/build-docker-sdk.sh $libraries_args; then + if ! "$repo_root"/eng/docker/build-docker-sdk.sh $libraries_args; then exit 1 fi - -elif [[ $privateaspnetcore -eq 1 ]]; then - echo "Using a private Asp.Net Core package (-pa) requires using privately built libraries. Please, enable it with -b switch." - exit 1 fi build_args="" -if [[ "$imagename" != "" ]]; then +if [[ -z "$imagename" ]]; then build_args=" --build-arg SDK_BASE_IMAGE=$imagename" fi diff --git a/src/libraries/System.Net.Security/tests/StressTests/SslStress/windows.Dockerfile b/src/libraries/System.Net.Security/tests/StressTests/SslStress/windows.Dockerfile index a1449eb4d54157..542a5d7a20a215 100644 --- a/src/libraries/System.Net.Security/tests/StressTests/SslStress/windows.Dockerfile +++ b/src/libraries/System.Net.Security/tests/StressTests/SslStress/windows.Dockerfile @@ -5,18 +5,23 @@ FROM $SDK_BASE_IMAGE # Use powershell as the default shell SHELL ["pwsh", "-Command"] -RUN echo "DOTNET_SDK_VERSION="$env:DOTNET_SDK_VERSION -RUN echo "DOTNET_VERSION="$env:DOTNET_VERSION - WORKDIR /app COPY . . WORKDIR /app/System.Net.Security/tests/StressTests/SslStress +ARG VERSION=7.0 ARG CONFIGURATION=Release -RUN dotnet build -c $env:CONFIGURATION + +RUN dotnet build -c $env:CONFIGURATION ` + -p:TargetingPacksTargetsLocation=C:/live-runtime-artifacts/targetingpacks.targets ` + -p:MicrosoftNetCoreAppRefPackDir=C:/live-runtime-artifacts/microsoft.netcore.app.ref/ ` + -p:MicrosoftNetCoreAppRuntimePackDir=C:/live-runtime-artifacts/microsoft.netcore.app.runtime.win-x64/$env:CONFIGURATION/ EXPOSE 5001 +ENV VERSION=$VERSION ENV CONFIGURATION=$CONFIGURATION ENV SSLSTRESS_ARGS="" -CMD dotnet run --no-build -c $env:CONFIGURATION -- $env:SSLSTRESS_ARGS.Split() + +CMD & C:/live-runtime-artifacts/testhost/net$env:VERSION-windows-$env:CONFIGURATION-x64/dotnet.exe exec ` + ./bin/$env:CONFIGURATION/net$env:VERSION/SslStress.dll $env:SSLSTRESS_ARGS.Split() \ No newline at end of file diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs index ad35f7138117e3..cb04d92d744c23 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs @@ -62,7 +62,8 @@ public ValueTask AcceptAsync(Socket? acceptSocket, CancellationToken can Interlocked.Exchange(ref _singleBufferSendEventArgs, null) ?? new AwaitableSocketAsyncEventArgs(this, isReceiveForCaching: false); - Debug.Assert(saea.BufferList == null); + Debug.Assert(saea.BufferList is null); + Debug.Assert(saea.AcceptSocket is null); saea.SetBuffer(null, 0, 0); saea.AcceptSocket = acceptSocket; saea.WrapExceptionsForNetworkStream = false; @@ -1048,6 +1049,8 @@ public ValueTask AcceptAsync(Socket socket, CancellationToken cancellati Socket acceptSocket = AcceptSocket!; SocketError error = SocketError; + AcceptSocket = null; + Release(); return error == SocketError.Success ? @@ -1405,6 +1408,8 @@ Socket IValueTaskSource.GetResult(short token) Socket acceptSocket = AcceptSocket!; CancellationToken cancellationToken = _cancellationToken; + AcceptSocket = null; + Release(); if (error != SocketError.Success) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/Connect.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/Connect.cs index 5f11eaa824e6e8..39506cee57fdaf 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/Connect.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/Connect.cs @@ -364,7 +364,7 @@ public async Task FailedConnect_ConnectedReturnsFalse() // The test class is declared non-parallel because of possible IPv4/IPv6 port-collision on Unix: // When running these tests in parallel with other tests, there is some chance that the DualMode client // will connect to an IPv4 server of a parallel test case. - [Collection(nameof(NoParallelTests))] + [Collection(nameof(DisableParallelization))] public abstract class Connect_NonParallel : SocketTestHelperBase where T : SocketHelperBase, new() { protected Connect_NonParallel(ITestOutputHelper output) : base(output) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/DisposedSocketTests.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/DisposedSocketTests.cs index c8394930b552a8..06d1ca4eb8c00e 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/DisposedSocketTests.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/DisposedSocketTests.cs @@ -764,7 +764,7 @@ private static void CreateSocketWithDanglingReference() } } - [Collection(nameof(NoParallelTests))] + [Collection(nameof(DisableParallelization))] public class DisposedSocketTestsNonParallel { [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsPreciseGcSupported))] diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/LocalEndPointTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/LocalEndPointTest.cs index 09f198cb500199..9fb542d8335e87 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/LocalEndPointTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/LocalEndPointTest.cs @@ -11,7 +11,7 @@ namespace System.Net.Sockets.Tests // When running in parallel with other tests, there is some chance that Accept() calls in LocalEndPointTest will // accept a connection request from another, DualMode client living in a parallel test // that is intended to connect to a server of opposite AddressFamily in the parallel test. - [Collection(nameof(NoParallelTests))] + [Collection(nameof(DisableParallelization))] public abstract class LocalEndPointTest : SocketTestHelperBase where T : SocketHelperBase, new() { protected abstract bool IPv6 { get; } diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/OSSupport.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/OSSupport.cs index 9ed625aecd0ffc..8dcf51f5911088 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/OSSupport.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/OSSupport.cs @@ -123,7 +123,7 @@ public void IOControl_SIOCATMARK_Unix_Success() server.Send(new byte[] { 42 }, SocketFlags.None); server.Send(new byte[] { 43 }, SocketFlags.OutOfBand); - // OOB data recieved, but read pointer not at mark. + // OOB data received, but read pointer not at mark. Assert.True(SpinWait.SpinUntil(() => { Assert.Equal(4, client.IOControl(IOControlCode.OobDataRead, null, siocatmarkResult)); @@ -135,7 +135,7 @@ public void IOControl_SIOCATMARK_Unix_Success() Assert.Equal(1, client.Receive(received)); Assert.Equal(42, received[0]); - // OOB data recieved, read pointer at mark. + // OOB data received, read pointer at mark. Assert.Equal(4, client.IOControl(IOControlCode.OobDataRead, null, siocatmarkResult)); Assert.Equal(1, BitConverter.ToInt32(siocatmarkResult, 0)); @@ -177,7 +177,7 @@ public void IOControl_SIOCATMARK_Windows_Success() server.Send(new byte[] { 42 }, SocketFlags.None); server.Send(new byte[] { 43 }, SocketFlags.OutOfBand); - // OOB data recieved, but read pointer not at mark + // OOB data received, but read pointer not at mark Assert.True(SpinWait.SpinUntil(() => { Assert.Equal(4, client.IOControl(IOControlCode.OobDataRead, null, siocatmarkResult)); @@ -189,7 +189,7 @@ public void IOControl_SIOCATMARK_Windows_Success() Assert.Equal(1, client.Receive(received)); Assert.Equal(42, received[0]); - // OOB data recieved, read pointer at mark. + // OOB data received, read pointer at mark. Assert.Equal(4, client.IOControl(IOControlCode.OobDataRead, null, siocatmarkResult)); Assert.Equal(0, BitConverter.ToInt32(siocatmarkResult, 0)); diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SelectTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SelectTest.cs index f85a9b0db3dedd..0b49749e09aeec 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SelectTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SelectTest.cs @@ -277,7 +277,7 @@ private static void DisposeSockets(IEnumerable> soc } } - [Collection(nameof(NoParallelTests))] + [Collection(nameof(DisableParallelization))] public class SelectTest_NonParallel { [OuterLoop] diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs index aa0d967e9f783d..35b427eaf32e89 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs @@ -467,7 +467,7 @@ public void EndSendFile_NullAsyncResult_Throws() // Running all cases of GreaterThan2GBFile_SendsAllBytes in parallel may attempt to allocate Min(ProcessorCount, Subclass_Count) * 2GB of disk space // in extreme cases. Some CI machines may run out of disk space if this happens. - [Collection(nameof(NoParallelTests))] + [Collection(nameof(DisableParallelization))] public abstract class SendFile_NonParallel : SocketTestHelperBase where T : SocketHelperBase, new() { protected SendFile_NonParallel(ITestOutputHelper output) : base(output) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceiveNonParallel.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceiveNonParallel.cs index 470472f226d4ec..97cad8577407b2 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceiveNonParallel.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceiveNonParallel.cs @@ -10,7 +10,7 @@ namespace System.Net.Sockets.Tests { - [Collection(nameof(NoParallelTests))] + [Collection(nameof(DisableParallelization))] public abstract class SendReceiveNonParallel : SocketTestHelperBase where T : SocketHelperBase, new() { public SendReceiveNonParallel(ITestOutputHelper output) : base(output) { } diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs index 5073f60c3e6a12..0bf9bdd45688f4 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs @@ -690,9 +690,9 @@ public void SetUnsupportedRawSocketOption_DoesNotDisconnectSocket() private static int SOL_SOCKET = OperatingSystem.IsLinux() ? 1 : (int)SocketOptionLevel.Socket; } - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] // Set of tests to not run together with any other tests. - public partial class NoParallelTests + public class NoParallelTests { [Fact] public void BindDuringTcpWait_Succeeds() @@ -714,7 +714,7 @@ public void BindDuringTcpWait_Succeeds() } // Bind a socket to the same address we just used. - // To avoid conflict with other tests, this is part of the NoParallelTests test collection. + // To avoid conflict with other tests, this is part of the DisableParallelization test collection. using (Socket b = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) { b.Bind(new IPEndPoint(IPAddress.Loopback, port)); diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketTestHelper.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketTestHelper.cs index e3bfff0c187933..1922d37ec5cacb 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketTestHelper.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketTestHelper.cs @@ -11,10 +11,6 @@ namespace System.Net.Sockets.Tests { - // Define test collection for tests to avoid all other tests. - [CollectionDefinition("NoParallelTests", DisableParallelization = true)] - public partial class NoParallelTests { } - // Abstract base class for various different socket "modes" (sync, async, etc) // See SendReceive.cs for usage public abstract class SocketHelperBase diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/System.Net.Sockets.Tests.csproj b/src/libraries/System.Net.Sockets/tests/FunctionalTests/System.Net.Sockets.Tests.csproj index dbb949b29df177..63e0987f7ac1a2 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/System.Net.Sockets.Tests.csproj +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/System.Net.Sockets.Tests.csproj @@ -97,6 +97,8 @@ + diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/TimeoutTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/TimeoutTest.cs index 91e22728148109..a442af692e5a70 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/TimeoutTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/TimeoutTest.cs @@ -6,7 +6,7 @@ namespace System.Net.Sockets.Tests { - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public class TimeoutTest { [Fact] diff --git a/src/libraries/System.Net.WebSockets/src/System.Net.WebSockets.csproj b/src/libraries/System.Net.WebSockets/src/System.Net.WebSockets.csproj index 8a49207c24be5b..d1983aa0c10b9a 100644 --- a/src/libraries/System.Net.WebSockets/src/System.Net.WebSockets.csproj +++ b/src/libraries/System.Net.WebSockets/src/System.Net.WebSockets.csproj @@ -48,9 +48,10 @@ + - + diff --git a/src/libraries/System.ObjectModel/ref/System.ObjectModel.Forwards.cs b/src/libraries/System.ObjectModel/ref/System.ObjectModel.Forwards.cs new file mode 100644 index 00000000000000..df45eb9a68a6ee --- /dev/null +++ b/src/libraries/System.ObjectModel/ref/System.ObjectModel.Forwards.cs @@ -0,0 +1,4 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.ObjectModel.ReadOnlyDictionary<,>))] diff --git a/src/libraries/System.ObjectModel/ref/System.ObjectModel.cs b/src/libraries/System.ObjectModel/ref/System.ObjectModel.cs index 744576e587d067..21cd3dc855f118 100644 --- a/src/libraries/System.ObjectModel/ref/System.ObjectModel.cs +++ b/src/libraries/System.ObjectModel/ref/System.ObjectModel.cs @@ -43,77 +43,6 @@ protected virtual void OnPropertyChanged(System.ComponentModel.PropertyChangedEv protected override void RemoveItem(int index) { } protected override void SetItem(int index, T item) { } } - public partial class ReadOnlyDictionary : 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 ReadOnlyDictionary(System.Collections.Generic.IDictionary dictionary) { } - public int Count { get { throw null; } } - protected System.Collections.Generic.IDictionary Dictionary { get { throw null; } } - public TValue this[TKey key] { get { throw null; } } - public System.Collections.ObjectModel.ReadOnlyDictionary.KeyCollection Keys { get { throw null; } } - bool System.Collections.Generic.ICollection>.IsReadOnly { get { throw null; } } - TValue System.Collections.Generic.IDictionary.this[TKey key] { get { throw null; } set { } } - System.Collections.Generic.ICollection System.Collections.Generic.IDictionary.Keys { get { throw null; } } - System.Collections.Generic.ICollection System.Collections.Generic.IDictionary.Values { get { throw null; } } - System.Collections.Generic.IEnumerable System.Collections.Generic.IReadOnlyDictionary.Keys { get { throw null; } } - System.Collections.Generic.IEnumerable System.Collections.Generic.IReadOnlyDictionary.Values { get { throw null; } } - bool System.Collections.ICollection.IsSynchronized { get { throw null; } } - object System.Collections.ICollection.SyncRoot { get { throw null; } } - bool System.Collections.IDictionary.IsFixedSize { get { throw null; } } - bool System.Collections.IDictionary.IsReadOnly { get { throw null; } } - object? System.Collections.IDictionary.this[object key] { get { throw null; } set { } } - System.Collections.ICollection System.Collections.IDictionary.Keys { get { throw null; } } - System.Collections.ICollection System.Collections.IDictionary.Values { get { throw null; } } - public System.Collections.ObjectModel.ReadOnlyDictionary.ValueCollection Values { get { throw null; } } - public bool ContainsKey(TKey key) { throw null; } - public System.Collections.Generic.IEnumerator> GetEnumerator() { throw null; } - void System.Collections.Generic.ICollection>.Add(System.Collections.Generic.KeyValuePair item) { } - void System.Collections.Generic.ICollection>.Clear() { } - bool System.Collections.Generic.ICollection>.Contains(System.Collections.Generic.KeyValuePair item) { throw null; } - void System.Collections.Generic.ICollection>.CopyTo(System.Collections.Generic.KeyValuePair[] array, int arrayIndex) { } - bool System.Collections.Generic.ICollection>.Remove(System.Collections.Generic.KeyValuePair item) { throw null; } - void System.Collections.Generic.IDictionary.Add(TKey key, TValue value) { } - bool System.Collections.Generic.IDictionary.Remove(TKey key) { throw null; } - void System.Collections.ICollection.CopyTo(System.Array array, int index) { } - void System.Collections.IDictionary.Add(object key, object? value) { } - void System.Collections.IDictionary.Clear() { } - bool System.Collections.IDictionary.Contains(object key) { throw null; } - System.Collections.IDictionaryEnumerator System.Collections.IDictionary.GetEnumerator() { throw null; } - void System.Collections.IDictionary.Remove(object key) { } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - public bool TryGetValue(TKey key, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TValue value) { throw null; } - public sealed partial class KeyCollection : System.Collections.Generic.ICollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IReadOnlyCollection, System.Collections.ICollection, System.Collections.IEnumerable - { - internal KeyCollection() { } - public int Count { get { throw null; } } - bool System.Collections.Generic.ICollection.IsReadOnly { get { throw null; } } - bool System.Collections.ICollection.IsSynchronized { get { throw null; } } - object System.Collections.ICollection.SyncRoot { get { throw null; } } - public void CopyTo(TKey[] array, int arrayIndex) { } - public System.Collections.Generic.IEnumerator GetEnumerator() { throw null; } - void System.Collections.Generic.ICollection.Add(TKey item) { } - void System.Collections.Generic.ICollection.Clear() { } - bool System.Collections.Generic.ICollection.Contains(TKey item) { throw null; } - bool System.Collections.Generic.ICollection.Remove(TKey item) { throw null; } - void System.Collections.ICollection.CopyTo(System.Array array, int index) { } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public sealed partial class ValueCollection : System.Collections.Generic.ICollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IReadOnlyCollection, System.Collections.ICollection, System.Collections.IEnumerable - { - internal ValueCollection() { } - public int Count { get { throw null; } } - bool System.Collections.Generic.ICollection.IsReadOnly { get { throw null; } } - bool System.Collections.ICollection.IsSynchronized { get { throw null; } } - object System.Collections.ICollection.SyncRoot { get { throw null; } } - public void CopyTo(TValue[] array, int arrayIndex) { } - public System.Collections.Generic.IEnumerator GetEnumerator() { throw null; } - void System.Collections.Generic.ICollection.Add(TValue item) { } - void System.Collections.Generic.ICollection.Clear() { } - bool System.Collections.Generic.ICollection.Contains(TValue item) { throw null; } - bool System.Collections.Generic.ICollection.Remove(TValue item) { throw null; } - void System.Collections.ICollection.CopyTo(System.Array array, int index) { } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - } public partial class ReadOnlyObservableCollection : System.Collections.ObjectModel.ReadOnlyCollection, System.Collections.Specialized.INotifyCollectionChanged, System.ComponentModel.INotifyPropertyChanged { public ReadOnlyObservableCollection(System.Collections.ObjectModel.ObservableCollection list) : base (default(System.Collections.Generic.IList)) { } diff --git a/src/libraries/System.ObjectModel/ref/System.ObjectModel.csproj b/src/libraries/System.ObjectModel/ref/System.ObjectModel.csproj index 9b427746cd8afa..623c85ec556705 100644 --- a/src/libraries/System.ObjectModel/ref/System.ObjectModel.csproj +++ b/src/libraries/System.ObjectModel/ref/System.ObjectModel.csproj @@ -5,6 +5,7 @@ + diff --git a/src/libraries/System.ObjectModel/src/System.ObjectModel.Forwards.cs b/src/libraries/System.ObjectModel/src/System.ObjectModel.Forwards.cs new file mode 100644 index 00000000000000..deb07efe4f82cb --- /dev/null +++ b/src/libraries/System.ObjectModel/src/System.ObjectModel.Forwards.cs @@ -0,0 +1,4 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.ObjectModel.ReadOnlyDictionary<,>))] diff --git a/src/libraries/System.ObjectModel/src/System.ObjectModel.csproj b/src/libraries/System.ObjectModel/src/System.ObjectModel.csproj index 66c53d0dfb08b4..ecf4f2a77fe9e2 100644 --- a/src/libraries/System.ObjectModel/src/System.ObjectModel.csproj +++ b/src/libraries/System.ObjectModel/src/System.ObjectModel.csproj @@ -5,6 +5,7 @@ enable + @@ -12,7 +13,6 @@ - diff --git a/src/libraries/System.ObjectModel/src/System/Collections/CollectionHelpers.cs b/src/libraries/System.ObjectModel/src/System/Collections/CollectionHelpers.cs index 86058208873282..bff227728ecff7 100644 --- a/src/libraries/System.ObjectModel/src/System/Collections/CollectionHelpers.cs +++ b/src/libraries/System.ObjectModel/src/System/Collections/CollectionHelpers.cs @@ -34,40 +34,5 @@ internal static void ValidateCopyToArguments(int sourceCount, Array array, int i throw new ArgumentException(SR.Arg_ArrayPlusOffTooSmall); } } - - internal static void CopyTo(ICollection collection, Array array, int index) - { - ValidateCopyToArguments(collection.Count, array, index); - - if (collection is ICollection nonGenericCollection) - { - // Easy out if the ICollection implements the non-generic ICollection - nonGenericCollection.CopyTo(array, index); - } - else if (array is T[] items) - { - collection.CopyTo(items, index); - } - else - { - // We can't cast array of value type to object[], so we don't support widening of primitive types here. - if (array is not object?[] objects) - { - throw new ArgumentException(SR.Argument_InvalidArrayType, nameof(array)); - } - - try - { - foreach (T item in collection) - { - objects[index++] = item; - } - } - catch (ArrayTypeMismatchException) - { - throw new ArgumentException(SR.Argument_InvalidArrayType, nameof(array)); - } - } - } } } diff --git a/src/libraries/System.ObjectModel/src/System/Collections/Generic/DebugView.cs b/src/libraries/System.ObjectModel/src/System/Collections/Generic/DebugView.cs index 2233d2518fe36c..3ab6a770ca772b 100644 --- a/src/libraries/System.ObjectModel/src/System/Collections/Generic/DebugView.cs +++ b/src/libraries/System.ObjectModel/src/System/Collections/Generic/DebugView.cs @@ -25,25 +25,4 @@ public T[] Items } } } - - internal sealed class DictionaryDebugView where K: notnull - { - private readonly IDictionary _dict; - - public DictionaryDebugView(IDictionary dictionary) - { - _dict = dictionary ?? throw new ArgumentNullException(nameof(dictionary)); - } - - [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] - public KeyValuePair[] Items - { - get - { - KeyValuePair[] items = new KeyValuePair[_dict.Count]; - _dict.CopyTo(items, 0); - return items; - } - } - } } diff --git a/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Descriptors.LibraryBuild.xml b/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Descriptors.LibraryBuild.xml index 53a41aff8c935a..ee28b6e38cfe61 100644 --- a/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Descriptors.LibraryBuild.xml +++ b/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Descriptors.LibraryBuild.xml @@ -4,5 +4,9 @@ + + + + diff --git a/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.Shared.xml b/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.Shared.xml index 5cd3d582f6f8f8..3349f853d44f50 100644 --- a/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.Shared.xml +++ b/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.Shared.xml @@ -88,6 +88,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + " + InnerException.ToString() + Environment.NewLine + " " + CreateMessage(SR.Xml_EndOfInnerExceptionStack); + result += $" ---> {InnerException}{Environment.NewLine} {CreateMessage(SR.Xml_EndOfInnerExceptionStack)}"; } if (StackTrace != null) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Compiler.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Compiler.cs index c8ad0097517fbd..7377607cbb0d5b 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Compiler.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Compiler.cs @@ -192,7 +192,7 @@ public static string ConstructQName(string prefix, string localName) } else { - return prefix + ':' + localName; + return $"{prefix}:{localName}"; } } @@ -252,7 +252,7 @@ public void ValidatePiName(string name, IErrorHelper errorHelper) public string CreatePhantomNamespace() { // Prepend invalid XmlChar to ensure this name would not clash with any namespace name in the stylesheet - return "\0namespace" + _phantomNsCounter++; + return $"\0namespace{_phantomNsCounter++}"; } public bool IsPhantomNamespace(string namespaceName) diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/QilGenerator.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/QilGenerator.cs index 2352c31d00c061..1a9097fed7c7db 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/QilGenerator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/QilGenerator.cs @@ -462,7 +462,7 @@ private QilIterator GetNsVar(QilList nsList) } } QilIterator newVar = _f.Let(nsList); - newVar.DebugName = _f.QName("ns" + _nsVars.Count, XmlReservedNs.NsXslDebug).ToString(); + newVar.DebugName = _f.QName($"ns{_nsVars.Count}", XmlReservedNs.NsXslDebug).ToString(); _gloVars.Add(newVar); _nsVars.Add(newVar); return newVar; @@ -568,7 +568,7 @@ private void PrecompileProtoTemplatesHeaders() ChooseBestType(xslPar) ); paramFunc.SourceLine = SourceLineInfo.NoSource; - paramFunc.DebugName = ""; + paramFunc.DebugName = $""; param.DefaultValue = _f.Invoke(paramFunc, paramActual); // store VarPar here to compile it on next pass: if (paramWithCalls == null) @@ -742,7 +742,7 @@ private QilNode CompileInstructions(IList instructions, int from, QilLi case XslNodeType.ValueOfDoe: result = CompileValueOfDoe(node); break; case XslNodeType.Variable: result = CompileVariable(node); break; // case XslNodeType.WithParam: wrapped by CallTemplate or ApplyTemplates, see CompileWithParam() - default: Debug.Fail("Unexpected type of AST node: " + nodeType.ToString()); result = null; break; + default: Debug.Fail($"Unexpected type of AST node: {nodeType}"); result = null; break; } ExitScope(); @@ -1186,7 +1186,7 @@ private QilNode CompileApplyTemplates(XslNodeEx node) if (IsDebug || !(val is QilIterator || val is QilLiteral)) { QilIterator let = _f.Let(val!); - let.DebugName = _f.QName("with-param " + withParam.Name!.QualifiedName, XmlReservedNs.NsXslDebug).ToString(); + let.DebugName = _f.QName($"with-param {withParam.Name!.QualifiedName}", XmlReservedNs.NsXslDebug).ToString(); _varHelper.AddVariable(let); withParam.Value = let; } @@ -1236,7 +1236,7 @@ private QilNode CompileCallTemplate(XslNodeEx node) { QilNode val = withParam.Value!; QilIterator let = _f.Let(val); - let.DebugName = _f.QName("with-param " + withParam.Name!.QualifiedName, XmlReservedNs.NsXslDebug).ToString(); + let.DebugName = _f.QName($"with-param {withParam.Name!.QualifiedName}", XmlReservedNs.NsXslDebug).ToString(); _varHelper.AddVariable(let); withParam.Value = let; } @@ -1872,7 +1872,7 @@ the same expanded-QName as the context node. case XmlNodeKindFlags.PI: return _f.And(_f.IsType(testNode, T.PI), _f.Eq(_f.LocalNameOf(testNode), _f.LocalNameOf(current))); case XmlNodeKindFlags.Namespace: return _f.And(_f.IsType(testNode, T.Namespace), _f.Eq(_f.LocalNameOf(testNode), _f.LocalNameOf(current))); default: - Debug.Fail("Unexpected NodeKind: " + nodeKinds.ToString()); + Debug.Fail($"Unexpected NodeKind: {nodeKinds}"); return _f.False(); } @@ -2685,8 +2685,8 @@ private QilNode InvokeApplyFunction(StylesheetLevel sheet, QilName mode, IList'; + string attMode = (mode.LocalName.Length == 0) ? string.Empty : $" mode=\"{mode.QualifiedName}\""; + applyFunction.DebugName = $"{(sheet is RootLevel ? ""; functionsForMode.Add(applyFunction); _functions.Add(applyFunction); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/QilGeneratorEnv.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/QilGeneratorEnv.cs index a9a2e410c1aa50..a873617549be40 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/QilGeneratorEnv.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/QilGeneratorEnv.cs @@ -132,7 +132,7 @@ QilNode IXPathEnvironment.ResolveFunction(string prefix, string name, IList args) } else { - Debug.Fail("Unexpected XmlQueryType for script function: " + xt.ToString()); + Debug.Fail($"Unexpected XmlQueryType for script function: {xt}"); } } } @@ -1453,7 +1453,7 @@ private void Refactor(XslNode parent, int split) var paramname = AstFactory.QName(variable.Name.LocalName, variable.Name.NamespaceUri, variable.Name.Prefix); // For each variable in scope, add xsl:with-param to the xsl:call-template - var withparam = AstFactory.VarPar(XslNodeType.WithParam, paramname, '$' + paramname.QualifiedName, XslVersion.Current); + var withparam = AstFactory.VarPar(XslNodeType.WithParam, paramname, $"${paramname.QualifiedName}", XslVersion.Current); XsltLoader.SetInfo(withparam, null, fakeCtxInfo); withparam.Namespaces = variable.Namespaces; calltemplate.AddContent(withparam); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltInput.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltInput.cs index f203642824f61d..defdca702a6b00 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltInput.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltInput.cs @@ -1212,7 +1212,7 @@ internal struct Record public Location start; public Location valueStart; public Location end; - public string QualifiedName { get { return prefix.Length == 0 ? localName : string.Concat(prefix, ":", localName); } } + public string QualifiedName { get { return prefix.Length == 0 ? localName : $"{prefix}:{localName}"; } } } } } diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/BuilderInfo.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/BuilderInfo.cs index 5931e93918ed0e..3f531acd48aab2 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/BuilderInfo.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/BuilderInfo.cs @@ -99,7 +99,7 @@ internal string Name { if (localName.Length > 0) { - _name = prefix + ":" + localName; + _name = $"{prefix}:{localName}"; } else { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/Compiler.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/Compiler.cs index 3c86fe279171a4..51bf1db2ac3ddb 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/Compiler.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/Compiler.cs @@ -746,13 +746,13 @@ internal int AddQuery(string xpathQuery, bool allowVar, bool allowKey, bool isPa internal int AddStringQuery(string xpathQuery) { - string modifiedQuery = XmlCharType.IsOnlyWhitespace(xpathQuery) ? xpathQuery : "string(" + xpathQuery + ")"; + string modifiedQuery = XmlCharType.IsOnlyWhitespace(xpathQuery) ? xpathQuery : $"string({xpathQuery})"; return AddQuery(modifiedQuery); } internal int AddBooleanQuery(string xpathQuery) { - string modifiedQuery = XmlCharType.IsOnlyWhitespace(xpathQuery) ? xpathQuery : "boolean(" + xpathQuery + ")"; + string modifiedQuery = XmlCharType.IsOnlyWhitespace(xpathQuery) ? xpathQuery : $"boolean({xpathQuery})"; return AddQuery(modifiedQuery); } diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NavigatorOutput.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NavigatorOutput.cs index c4471b42795735..075a2904bf7ddc 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NavigatorOutput.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NavigatorOutput.cs @@ -83,7 +83,7 @@ public Processor.OutputResult RecordDone(RecordBuilder record) break; default: - Debug.Fail("Invalid NodeType on output: " + mainNode.NodeType); + Debug.Fail($"Invalid NodeType on output: {mainNode.NodeType}"); break; } record.Reset(); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ReaderOutput.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ReaderOutput.cs index 0e27790aa6029c..4bfe6cdf71d298 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ReaderOutput.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ReaderOutput.cs @@ -71,7 +71,7 @@ public override string Name { if (localName.Length > 0) { - return _nameTable.Add(prefix + ":" + localName); + return _nameTable.Add($"{prefix}:{localName}"); } else { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/RootAction.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/RootAction.cs index 718a6be718ca52..df883f5272d6e7 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/RootAction.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/RootAction.cs @@ -173,7 +173,7 @@ private void MirgeAttributeSets(Stylesheet stylesheet) { for (int src = srcAttList.Count - 1; 0 <= src; src--) { - // We can ignore duplicate attibutes here. + // We can ignore duplicate attributes here. dstAttList!.Add(srcAttList[src]); } } diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/VariableAction.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/VariableAction.cs index 3703e24b949998..3c3cfddf1b61ae 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/VariableAction.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/VariableAction.cs @@ -78,7 +78,7 @@ internal override void Compile(Compiler compiler) } if (this.containedActions != null) { - baseUri = baseUri + '#' + compiler.GetUnicRtfId(); + baseUri = $"{baseUri}#{compiler.GetUnicRtfId()}"; } else { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/WriterOutput.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/WriterOutput.cs index ae66561a5e3cdc..3e9d0054ec71dc 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/WriterOutput.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/WriterOutput.cs @@ -75,7 +75,7 @@ public Processor.OutputResult RecordDone(RecordBuilder record) case XmlNodeType.EndEntity: break; default: - Debug.Fail("Invalid NodeType on output: " + mainNode.NodeType); + Debug.Fail($"Invalid NodeType on output: {mainNode.NodeType}"); break; } diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xslt/XsltException.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xslt/XsltException.cs index 3136e02340e08f..f15e00850bbb2d 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xslt/XsltException.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xslt/XsltException.cs @@ -123,13 +123,13 @@ private static string CreateMessage(string res, string?[]? args, string? sourceU string message = FormatMessage(res, args); if (res != SR.Xslt_CompileError && lineNumber != 0) { - message += " " + FormatMessage(SR.Xml_ErrorFilePosition, sourceUri, lineNumber.ToString(CultureInfo.InvariantCulture), linePosition.ToString(CultureInfo.InvariantCulture)); + message += $" {FormatMessage(SR.Xml_ErrorFilePosition, sourceUri, lineNumber.ToString(CultureInfo.InvariantCulture), linePosition.ToString(CultureInfo.InvariantCulture))}"; } return message; } catch (MissingManifestResourceException) { - return "UNKNOWN(" + res + ")"; + return $"UNKNOWN({res})"; } } diff --git a/src/libraries/System.Private.Xml/tests/Readers/CharCheckingReader/System.Xml.RW.CharCheckingReader.Tests.csproj b/src/libraries/System.Private.Xml/tests/Readers/CharCheckingReader/System.Xml.RW.CharCheckingReader.Tests.csproj index 8f07f99a4bfd72..500733518dd79d 100644 --- a/src/libraries/System.Private.Xml/tests/Readers/CharCheckingReader/System.Xml.RW.CharCheckingReader.Tests.csproj +++ b/src/libraries/System.Private.Xml/tests/Readers/CharCheckingReader/System.Xml.RW.CharCheckingReader.Tests.csproj @@ -5,7 +5,7 @@ - + diff --git a/src/libraries/System.Private.Xml/tests/Readers/CustomReader/System.Xml.RW.CustomReader.Tests.csproj b/src/libraries/System.Private.Xml/tests/Readers/CustomReader/System.Xml.RW.CustomReader.Tests.csproj index 0a9332d12904d8..c9f5d55f4dba5e 100644 --- a/src/libraries/System.Private.Xml/tests/Readers/CustomReader/System.Xml.RW.CustomReader.Tests.csproj +++ b/src/libraries/System.Private.Xml/tests/Readers/CustomReader/System.Xml.RW.CustomReader.Tests.csproj @@ -5,7 +5,7 @@ - + diff --git a/src/libraries/System.Private.Xml/tests/Readers/FactoryReader/System.Xml.RW.FactoryReader.Tests.csproj b/src/libraries/System.Private.Xml/tests/Readers/FactoryReader/System.Xml.RW.FactoryReader.Tests.csproj index 8a6101b86831ed..5544c95e815aff 100644 --- a/src/libraries/System.Private.Xml/tests/Readers/FactoryReader/System.Xml.RW.FactoryReader.Tests.csproj +++ b/src/libraries/System.Private.Xml/tests/Readers/FactoryReader/System.Xml.RW.FactoryReader.Tests.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/libraries/System.Private.Xml/tests/Readers/NameTable/System.Xml.RW.NameTable.Tests.csproj b/src/libraries/System.Private.Xml/tests/Readers/NameTable/System.Xml.RW.NameTable.Tests.csproj index b2052d0678d789..22491163aa29b2 100644 --- a/src/libraries/System.Private.Xml/tests/Readers/NameTable/System.Xml.RW.NameTable.Tests.csproj +++ b/src/libraries/System.Private.Xml/tests/Readers/NameTable/System.Xml.RW.NameTable.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/libraries/System.Private.Xml/tests/Readers/ReaderSettings/System.Xml.RW.ReaderSettings.Tests.csproj b/src/libraries/System.Private.Xml/tests/Readers/ReaderSettings/System.Xml.RW.ReaderSettings.Tests.csproj index 644a9f6b4d928e..606537f058d292 100644 --- a/src/libraries/System.Private.Xml/tests/Readers/ReaderSettings/System.Xml.RW.ReaderSettings.Tests.csproj +++ b/src/libraries/System.Private.Xml/tests/Readers/ReaderSettings/System.Xml.RW.ReaderSettings.Tests.csproj @@ -21,7 +21,7 @@ - + diff --git a/src/libraries/System.Private.Xml/tests/Readers/SubtreeReader/System.Xml.RW.SubtreeReader.Tests.csproj b/src/libraries/System.Private.Xml/tests/Readers/SubtreeReader/System.Xml.RW.SubtreeReader.Tests.csproj index 6a642e0ef32850..1a332e08e5c1b7 100644 --- a/src/libraries/System.Private.Xml/tests/Readers/SubtreeReader/System.Xml.RW.SubtreeReader.Tests.csproj +++ b/src/libraries/System.Private.Xml/tests/Readers/SubtreeReader/System.Xml.RW.SubtreeReader.Tests.csproj @@ -5,7 +5,7 @@ - + diff --git a/src/libraries/System.Private.Xml/tests/Readers/WrappedReader/System.Xml.RW.WrappedReader.Tests.csproj b/src/libraries/System.Private.Xml/tests/Readers/WrappedReader/System.Xml.RW.WrappedReader.Tests.csproj index ffcaad0d1e75c3..f93aee359a72b4 100644 --- a/src/libraries/System.Private.Xml/tests/Readers/WrappedReader/System.Xml.RW.WrappedReader.Tests.csproj +++ b/src/libraries/System.Private.Xml/tests/Readers/WrappedReader/System.Xml.RW.WrappedReader.Tests.csproj @@ -5,7 +5,7 @@ - + diff --git a/src/libraries/System.Private.Xml/tests/Writers/RwFactory/System.Xml.RW.RwFactory.Tests.csproj b/src/libraries/System.Private.Xml/tests/Writers/RwFactory/System.Xml.RW.RwFactory.Tests.csproj index 91358a3a30f5e8..7b797907e05fc5 100644 --- a/src/libraries/System.Private.Xml/tests/Writers/RwFactory/System.Xml.RW.RwFactory.Tests.csproj +++ b/src/libraries/System.Private.Xml/tests/Writers/RwFactory/System.Xml.RW.RwFactory.Tests.csproj @@ -14,7 +14,7 @@ - + diff --git a/src/libraries/System.Private.Xml/tests/Writers/XmlWriterApi/DisableParallelization.cs b/src/libraries/System.Private.Xml/tests/Writers/XmlWriterApi/DisableParallelization.cs deleted file mode 100644 index e6fb8acae3b287..00000000000000 --- a/src/libraries/System.Private.Xml/tests/Writers/XmlWriterApi/DisableParallelization.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// Tests are old and depend on the static state -[assembly: Xunit.CollectionBehavior(DisableTestParallelization = true)] diff --git a/src/libraries/System.Private.Xml/tests/Writers/XmlWriterApi/System.Xml.RW.XmlWriterApi.Tests.csproj b/src/libraries/System.Private.Xml/tests/Writers/XmlWriterApi/System.Xml.RW.XmlWriterApi.Tests.csproj index 66a1626bfe18c7..9569073b4185ab 100644 --- a/src/libraries/System.Private.Xml/tests/Writers/XmlWriterApi/System.Xml.RW.XmlWriterApi.Tests.csproj +++ b/src/libraries/System.Private.Xml/tests/Writers/XmlWriterApi/System.Xml.RW.XmlWriterApi.Tests.csproj @@ -25,7 +25,7 @@ - + diff --git a/src/libraries/System.Private.Xml/tests/XmlConvert/System.Xml.RW.XmlConvert.Tests.csproj b/src/libraries/System.Private.Xml/tests/XmlConvert/System.Xml.RW.XmlConvert.Tests.csproj index 2104845a322cb2..69106ffa4dd5af 100644 --- a/src/libraries/System.Private.Xml/tests/XmlConvert/System.Xml.RW.XmlConvert.Tests.csproj +++ b/src/libraries/System.Private.Xml/tests/XmlConvert/System.Xml.RW.XmlConvert.Tests.csproj @@ -37,7 +37,7 @@ - + diff --git a/src/libraries/System.Private.Xml/tests/XmlDocument/XmlAttributeCollectionTests/CollectionInterfaceTests.cs b/src/libraries/System.Private.Xml/tests/XmlDocument/XmlAttributeCollectionTests/CollectionInterfaceTests.cs index 992cf24ca7fb5c..83f41d022c41bf 100644 --- a/src/libraries/System.Private.Xml/tests/XmlDocument/XmlAttributeCollectionTests/CollectionInterfaceTests.cs +++ b/src/libraries/System.Private.Xml/tests/XmlDocument/XmlAttributeCollectionTests/CollectionInterfaceTests.cs @@ -56,7 +56,7 @@ public void CopyToCopiesReferencesAtSpecifiedIndex() } [Fact] - public void IsSyncronizedGetsFalse() + public void IsSynchronizedGetsFalse() { XmlDocument doc = CreateDocumentWithElement(); XmlElement element = doc.DocumentElement; diff --git a/src/libraries/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Misc.cs b/src/libraries/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Misc.cs index 2030cd3cf44afe..3d9b5f8830a503 100644 --- a/src/libraries/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Misc.cs +++ b/src/libraries/System.Private.Xml/tests/XmlSchema/XmlSchemaSet/TC_SchemaSet_Misc.cs @@ -389,7 +389,7 @@ private void Callback1(object sender, ValidationEventArgs args) { if (args.Severity == XmlSeverityType.Warning) { - _output.WriteLine("WARNING Recieved"); + _output.WriteLine("WARNING Received"); bWarningCallback = true; warningCount++; CError.Compare(args.Exception.InnerException == null, false, "Inner Exception not set"); diff --git a/src/libraries/System.Private.Xml/tests/XmlSerializer/ReflectionOnly/System.Xml.XmlSerializer.ReflectionOnly.Tests.csproj b/src/libraries/System.Private.Xml/tests/XmlSerializer/ReflectionOnly/System.Xml.XmlSerializer.ReflectionOnly.Tests.csproj index 53abcbd3957022..d7d1f3af3bb87f 100644 --- a/src/libraries/System.Private.Xml/tests/XmlSerializer/ReflectionOnly/System.Xml.XmlSerializer.ReflectionOnly.Tests.csproj +++ b/src/libraries/System.Private.Xml/tests/XmlSerializer/ReflectionOnly/System.Xml.XmlSerializer.ReflectionOnly.Tests.csproj @@ -3,9 +3,13 @@ $(DefineConstants);ReflectionOnly $(NetCoreAppCurrent) + + + + - + diff --git a/src/libraries/System.Private.Xml/tests/XmlSerializer/System.Xml.XmlSerializer.Tests.csproj b/src/libraries/System.Private.Xml/tests/XmlSerializer/System.Xml.XmlSerializer.Tests.csproj index dbc8447b87c1cb..7818cd132825c4 100644 --- a/src/libraries/System.Private.Xml/tests/XmlSerializer/System.Xml.XmlSerializer.Tests.csproj +++ b/src/libraries/System.Private.Xml/tests/XmlSerializer/System.Xml.XmlSerializer.Tests.csproj @@ -2,10 +2,14 @@ $(NetCoreAppCurrent) + + + + - + diff --git a/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs b/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs index 93b93da69f5eb5..c2acedcc30e1ec 100644 --- a/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs +++ b/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs @@ -8,6 +8,8 @@ using System.IO; using System.Linq; using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.Loader; using System.Text; using System.Threading; using System.Xml; @@ -1960,6 +1962,51 @@ public static void Xml_TypeWithSpecialCharacterInStringMember() Assert.Equal(x.Name, y.Name); } + [Fact] +#if XMLSERIALIZERGENERATORTESTS + // Lack of AssemblyDependencyResolver results in assemblies that are not loaded by path to get + // loaded in the default ALC, which causes problems for this test. + [SkipOnPlatform(TestPlatforms.Browser, "AssemblyDependencyResolver not supported in wasm")] +#endif + [ActiveIssue("34072", TestRuntimes.Mono)] + public static void Xml_TypeInCollectibleALC() + { + ExecuteAndUnload("SerializableAssembly.dll", "SerializationTypes.SimpleType", out var weakRef); + + for (int i = 0; weakRef.IsAlive && i < 10; i++) + { + GC.Collect(); + GC.WaitForPendingFinalizers(); + } + Assert.True(!weakRef.IsAlive); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private static void ExecuteAndUnload(string assemblyfile, string typename, out WeakReference wref) + { + var fullPath = Path.GetFullPath(assemblyfile); + var alc = new TestAssemblyLoadContext("XmlSerializerTests", true, fullPath); + wref = new WeakReference(alc); + + // Load assembly by path. By name, and it gets loaded in the default ALC. + var asm = alc.LoadFromAssemblyPath(fullPath); + + // Ensure the type loaded in the intended non-Default ALC + var type = asm.GetType(typename); + Assert.Equal(AssemblyLoadContext.GetLoadContext(type.Assembly), alc); + Assert.NotEqual(alc, AssemblyLoadContext.Default); + + // Round-Trip the instance + XmlSerializer serializer = new XmlSerializer(type); + var obj = Activator.CreateInstance(type); + var rtobj = SerializeAndDeserialize(obj, null, () => serializer, true); + Assert.NotNull(rtobj); + Assert.True(rtobj.Equals(obj)); + + alc.Unload(); + } + + private static readonly string s_defaultNs = "http://tempuri.org/"; private static T RoundTripWithXmlMembersMapping(object requestBodyValue, string memberName, string baseline, bool skipStringCompare = false, string wrapperName = null) { @@ -2080,11 +2127,7 @@ private static Stream GenerateStreamFromString(string s) private static T SerializeAndDeserialize(T value, string baseline, Func serializerFactory = null, bool skipStringCompare = false, XmlSerializerNamespaces xns = null) { - XmlSerializer serializer = new XmlSerializer(typeof(T)); - if (serializerFactory != null) - { - serializer = serializerFactory(); - } + XmlSerializer serializer = (serializerFactory != null) ? serializerFactory() : new XmlSerializer(typeof(T)); using (MemoryStream ms = new MemoryStream()) { diff --git a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/Ecma335/MetadataBuilder.Tables.cs b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/Ecma335/MetadataBuilder.Tables.cs index 56405caa85270e..98e1ba533303e1 100644 --- a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/Ecma335/MetadataBuilder.Tables.cs +++ b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/Ecma335/MetadataBuilder.Tables.cs @@ -1434,7 +1434,7 @@ internal void ValidateOrder() // GenericParam Owner, Number No** // GenericParamConstraint Owner No** // ImplMap MemberForwarded No* - // InterfaceImpl Class, Interface No** + // InterfaceImpl Class No** // MethodImpl Class No* // MethodSemantics Association Yes // NestedClass NestedClass No* @@ -1551,27 +1551,12 @@ private void ValidateImplMapTable() private void ValidateInterfaceImplTable() { - if (_interfaceImplTable.Count == 0) + for (int i = 1; i < _interfaceImplTable.Count; i++) { - return; - } - - InterfaceImplRow current, previous = _interfaceImplTable[0]; - for (int i = 1; i < _interfaceImplTable.Count; i++, previous = current) - { - current = _interfaceImplTable[i]; - - if (current.Class > previous.Class) + if (_interfaceImplTable[i - 1].Class > _interfaceImplTable[i].Class) { - continue; + Throw.InvalidOperation_TableNotSorted(TableIndex.InterfaceImpl); } - - if (previous.Class == current.Class && current.Interface > previous.Interface) - { - continue; - } - - Throw.InvalidOperation_TableNotSorted(TableIndex.InterfaceImpl); } } diff --git a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/MetadataReader.netstandard.cs b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/MetadataReader.netstandard.cs index d85eb360d07d02..a4e71b93171a62 100644 --- a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/MetadataReader.netstandard.cs +++ b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/MetadataReader.netstandard.cs @@ -16,7 +16,9 @@ internal AssemblyName GetAssemblyName(StringHandle nameHandle, Version version, { Version = version, CultureName = cultureName, +#pragma warning disable SYSLIB0037 // AssemblyName.HashAlgorithm is obsolete HashAlgorithm = hashAlgorithm, +#pragma warning restore Flags = GetAssemblyNameFlags(flags), ContentType = GetContentTypeFromAssemblyFlags(flags) }; diff --git a/src/libraries/System.Reflection.Metadata/tests/Metadata/Ecma335/MetadataBuilderTests.cs b/src/libraries/System.Reflection.Metadata/tests/Metadata/Ecma335/MetadataBuilderTests.cs index 6fcc8fb2a4b06c..924c061c8a7874 100644 --- a/src/libraries/System.Reflection.Metadata/tests/Metadata/Ecma335/MetadataBuilderTests.cs +++ b/src/libraries/System.Reflection.Metadata/tests/Metadata/Ecma335/MetadataBuilderTests.cs @@ -803,40 +803,10 @@ public void ValidateInterfaceImplTable() builder.AddInterfaceImplementation(MetadataTokens.TypeDefinitionHandle(1), MetadataTokens.TypeDefinitionHandle(1)); Assert.Throws(() => builder.ValidateOrder()); - builder = new MetadataBuilder(); - builder.AddInterfaceImplementation(MetadataTokens.TypeDefinitionHandle(1), MetadataTokens.TypeDefinitionHandle(1)); - builder.AddInterfaceImplementation(MetadataTokens.TypeDefinitionHandle(1), MetadataTokens.TypeDefinitionHandle(1)); - Assert.Throws(() => builder.ValidateOrder()); - builder = new MetadataBuilder(); builder.AddInterfaceImplementation(MetadataTokens.TypeDefinitionHandle(1), MetadataTokens.TypeDefinitionHandle(2)); builder.AddInterfaceImplementation(MetadataTokens.TypeDefinitionHandle(1), MetadataTokens.TypeDefinitionHandle(1)); - Assert.Throws(() => builder.ValidateOrder()); - - builder = new MetadataBuilder(); - builder.AddInterfaceImplementation(MetadataTokens.TypeDefinitionHandle(1), MetadataTokens.TypeReferenceHandle(2)); - builder.AddInterfaceImplementation(MetadataTokens.TypeDefinitionHandle(1), MetadataTokens.TypeReferenceHandle(1)); - Assert.Throws(() => builder.ValidateOrder()); - - builder = new MetadataBuilder(); - builder.AddInterfaceImplementation(MetadataTokens.TypeDefinitionHandle(1), MetadataTokens.TypeSpecificationHandle(2)); - builder.AddInterfaceImplementation(MetadataTokens.TypeDefinitionHandle(1), MetadataTokens.TypeSpecificationHandle(1)); - Assert.Throws(() => builder.ValidateOrder()); - - builder = new MetadataBuilder(); - builder.AddInterfaceImplementation(MetadataTokens.TypeDefinitionHandle(1), MetadataTokens.TypeReferenceHandle(1)); - builder.AddInterfaceImplementation(MetadataTokens.TypeDefinitionHandle(1), MetadataTokens.TypeDefinitionHandle(1)); - Assert.Throws(() => builder.ValidateOrder()); - - builder = new MetadataBuilder(); - builder.AddInterfaceImplementation(MetadataTokens.TypeDefinitionHandle(1), MetadataTokens.TypeSpecificationHandle(1)); - builder.AddInterfaceImplementation(MetadataTokens.TypeDefinitionHandle(1), MetadataTokens.TypeReferenceHandle(1)); - Assert.Throws(() => builder.ValidateOrder()); - - builder = new MetadataBuilder(); - builder.AddInterfaceImplementation(MetadataTokens.TypeDefinitionHandle(1), MetadataTokens.TypeSpecificationHandle(1)); - builder.AddInterfaceImplementation(MetadataTokens.TypeDefinitionHandle(1), MetadataTokens.TypeDefinitionHandle(1)); - Assert.Throws(() => builder.ValidateOrder()); + builder.ValidateOrder(); // ok } [Fact] diff --git a/src/libraries/System.Reflection.Metadata/tests/System.Reflection.Metadata.Tests.csproj b/src/libraries/System.Reflection.Metadata/tests/System.Reflection.Metadata.Tests.csproj index 7138184f5bd94e..632eea19a6e213 100644 --- a/src/libraries/System.Reflection.Metadata/tests/System.Reflection.Metadata.Tests.csproj +++ b/src/libraries/System.Reflection.Metadata/tests/System.Reflection.Metadata.Tests.csproj @@ -2,8 +2,11 @@ true false - 436 + + $(NoWarn);436;SYSLIB0037 $(NetCoreAppCurrent);$(NetFrameworkMinimum) + true GetMethodsCore(NameFilter? filt { int rank = _rank; - int uniquifier = 0; RoType systemInt32 = Loader.GetCoreType(CoreType.Int32); RoType elementType = GetRoElementType(); RoType systemVoid = Loader.GetCoreType(CoreType.Void); @@ -163,7 +162,7 @@ internal sealed override IEnumerable GetMethodsCore(NameFilter? filt { getParameters[i] = systemInt32; } - yield return new RoSyntheticMethod(this, uniquifier++, "Get", elementType, getParameters); + yield return new RoSyntheticMethod(this, 0, "Get", elementType, getParameters); } if (filter == null || filter.Matches("Set")) @@ -174,7 +173,7 @@ internal sealed override IEnumerable GetMethodsCore(NameFilter? filt setParameters[i] = systemInt32; } setParameters[rank] = elementType; - yield return new RoSyntheticMethod(this, uniquifier++, "Set", systemVoid, setParameters); + yield return new RoSyntheticMethod(this, 1, "Set", systemVoid, setParameters); } if (filter == null || filter.Matches("Address")) @@ -184,7 +183,7 @@ internal sealed override IEnumerable GetMethodsCore(NameFilter? filt { addressParameters[i] = systemInt32; } - yield return new RoSyntheticMethod(this, uniquifier++, "Address", elementType.GetUniqueByRefType(), addressParameters); + yield return new RoSyntheticMethod(this, 2, "Address", elementType.GetUniqueByRefType(), addressParameters); } } } diff --git a/src/libraries/System.Reflection.MetadataLoadContext/tests/System.Reflection.MetadataLoadContext.Tests.csproj b/src/libraries/System.Reflection.MetadataLoadContext/tests/System.Reflection.MetadataLoadContext.Tests.csproj index 78f831c71d4988..32e2dcef87db85 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/tests/System.Reflection.MetadataLoadContext.Tests.csproj +++ b/src/libraries/System.Reflection.MetadataLoadContext/tests/System.Reflection.MetadataLoadContext.Tests.csproj @@ -2,8 +2,9 @@ true $(NetCoreAppCurrent);$(NetFrameworkMinimum) - - $(NoWarn);SYSLIB0005 + + $(NoWarn);SYSLIB0005;SYSLIB0037 m.Name == "Get")); + Assert.Equal(type.GetMethod("Set"), type.GetMethods().First(m => m.Name == "Set")); + Assert.Equal(type.GetMethod("Address"), type.GetMethods().First(m => m.Name == "Address")); + + Assert.NotEqual(type.GetMethod("Get"), type.GetMethods().First(m => m.Name == "Set")); + Assert.NotEqual(type.GetMethod("Set"), type.GetMethods().First(m => m.Name == "Address")); + Assert.NotEqual(type.GetMethod("Address"), type.GetMethods().First(m => m.Name == "Get")); + } + [Fact] public static void TestArrayAddressMethod() { diff --git a/src/libraries/System.Reflection/tests/Common.cs b/src/libraries/System.Reflection/tests/Common.cs index 2c9e65368ec21f..e70336e7e330c7 100644 --- a/src/libraries/System.Reflection/tests/Common.cs +++ b/src/libraries/System.Reflection/tests/Common.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Globalization; + namespace System.Reflection.Tests { public enum PublicEnum @@ -105,4 +107,25 @@ public class Helpers { public static Assembly ExecutingAssembly => typeof(Helpers).GetTypeInfo().Assembly; } + + public class ConvertStringToIntBinder : Binder + { + public override FieldInfo BindToField(BindingFlags bindingAttr, FieldInfo[] match, object value, CultureInfo? culture) + => throw new NotImplementedException(); + + public override MethodBase BindToMethod(BindingFlags bindingAttr, MethodBase[] match, ref object?[] args, ParameterModifier[]? modifiers, CultureInfo? culture, string[]? names, out object? state) + => throw new NotImplementedException(); + + public override object ChangeType(object value, Type type, CultureInfo? culture) + => int.Parse((string)value); + + public override void ReorderArgumentArray(ref object?[] args, object state) + => throw new NotImplementedException(); + + public override MethodBase? SelectMethod(BindingFlags bindingAttr, MethodBase[] match, Type[] types, ParameterModifier[]? modifiers) + => throw new NotImplementedException(); + + public override PropertyInfo? SelectProperty(BindingFlags bindingAttr, PropertyInfo[] match, Type? returnType, Type[]? indexes, ParameterModifier[]? modifiers) + => throw new NotImplementedException(); + } } diff --git a/src/libraries/System.Reflection/tests/ConstructorInfoTests.cs b/src/libraries/System.Reflection/tests/ConstructorInfoTests.cs index a1042452810748..ea861aa1dcdeb8 100644 --- a/src/libraries/System.Reflection/tests/ConstructorInfoTests.cs +++ b/src/libraries/System.Reflection/tests/ConstructorInfoTests.cs @@ -126,6 +126,17 @@ public void Invoke_OneDimensionalArray_NegativeLengths_ThrowsOverflowException() } } + [Fact] + public void Invoke_TwoDimensionalArray_CustomBinder_IncorrectTypeArguments() + { + var ctor = typeof(int[,]).GetConstructor(new[] { typeof(int), typeof(int) }); + var args = new object[] { "1", "2" }; + var arr = (int[,])ctor.Invoke(BindingFlags.Default, new ConvertStringToIntBinder(), args, null); + Assert.Equal(2, arr.Length); + Assert.True(args[0] is int); + Assert.True(args[1] is int); + } + [Fact] public void Invoke_OneParameter() { @@ -143,6 +154,19 @@ public void Invoke_TwoParameters() Assert.Equal("hello", obj.stringValue); } + [Fact] + public void Invoke_TwoParameters_CustomBinder_IncorrectTypeArgument() + { + ConstructorInfo[] constructors = GetConstructors(typeof(ClassWith3Constructors)); + + var args = new object[] { "101", "hello" }; + ClassWith3Constructors obj = (ClassWith3Constructors)constructors[2].Invoke(BindingFlags.Default, new ConvertStringToIntBinder(), args, null); + Assert.Equal(101, obj.intValue); + Assert.Equal("hello", obj.stringValue); + Assert.True(args[0] is int); + Assert.True(args[1] is string); + } + [Fact] public void Invoke_NoParameters_ThowsTargetParameterCountException() { @@ -248,8 +272,6 @@ public ClassWith3Constructors(int intValue, string stringValue) this.intValue = intValue; this.stringValue = stringValue; } - - public string Method1(DateTime dt) => ""; } public static class ClassWithStaticConstructor diff --git a/src/libraries/System.Reflection/tests/MethodInfoTests.cs b/src/libraries/System.Reflection/tests/MethodInfoTests.cs index b8abc6e9118eb6..a538fc9f3a9c9f 100644 --- a/src/libraries/System.Reflection/tests/MethodInfoTests.cs +++ b/src/libraries/System.Reflection/tests/MethodInfoTests.cs @@ -381,6 +381,16 @@ public static void Invoke_OptionalParameterUnassingableFromMissing_WithMissingVa AssertExtensions.Throws(null, () => GetMethod(typeof(MethodInfoDefaultParameters), "OptionalStringParameter").Invoke(new MethodInfoDefaultParameters(), new object[] { Type.Missing })); } + [Fact] + public void Invoke_TwoParameters_CustomBinder_IncorrectTypeArguments() + { + MethodInfo method = GetMethod(typeof(MI_SubClass), nameof(MI_SubClass.StaticIntIntMethodReturningInt)); + var args = new object[] { "10", "100" }; + Assert.Equal(110, method.Invoke(null, BindingFlags.Default, new ConvertStringToIntBinder(), args, null)); + Assert.True(args[0] is int); + Assert.True(args[1] is int); + } + [Theory] [InlineData(typeof(MI_SubClass), nameof(MI_SubClass.GenericMethod1), new Type[] { typeof(int) })] [InlineData(typeof(MI_SubClass), nameof(MI_SubClass.GenericMethod2), new Type[] { typeof(string), typeof(int) })] diff --git a/src/libraries/System.Reflection/tests/System.Reflection.Tests.csproj b/src/libraries/System.Reflection/tests/System.Reflection.Tests.csproj index 78f02cee29ad0e..7d911f9f127f21 100644 --- a/src/libraries/System.Reflection/tests/System.Reflection.Tests.csproj +++ b/src/libraries/System.Reflection/tests/System.Reflection.Tests.csproj @@ -5,7 +5,9 @@ false true - $(NoWarn),SYSLIB0013 + + $(NoWarn);SYSLIB0013;SYSLIB0037 true diff --git a/src/libraries/System.Runtime.Caching/src/System.Runtime.Caching.csproj b/src/libraries/System.Runtime.Caching/src/System.Runtime.Caching.csproj index 2a764b00526262..8742a91f18a16c 100644 --- a/src/libraries/System.Runtime.Caching/src/System.Runtime.Caching.csproj +++ b/src/libraries/System.Runtime.Caching/src/System.Runtime.Caching.csproj @@ -3,6 +3,7 @@ true $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum);netstandard2.0-windows;netstandard2.0 true + Annotations true true true @@ -91,9 +92,11 @@ System.Runtime.Caching.ObjectCache + + diff --git a/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs b/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs index 2b8160cfa953e2..b6c83de69de1a6 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs @@ -379,7 +379,7 @@ public void ReflectionOnlyGetAssemblies() } [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Throws PNSE")] + [SkipOnPlatform(TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.tvOS, "Throws PNSE")] public void MonitoringIsEnabled() { Assert.True(AppDomain.MonitoringIsEnabled); diff --git a/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs b/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs index 63723f0117a099..415cafb9f02c25 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs @@ -96,6 +96,7 @@ public void ProcessPath_Idempotent() } [Fact] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "Throws PNSE")] public void ProcessPath_MatchesExpectedValue() { string expectedProcessPath = PlatformDetection.IsBrowser ? null : Process.GetCurrentProcess().MainModule.FileName; diff --git a/src/libraries/System.Runtime.InteropServices/System.Runtime.InteropServices.sln b/src/libraries/System.Runtime.InteropServices/System.Runtime.InteropServices.sln index ae6e8fc0cc7abf..54f3e3fb53c735 100644 --- a/src/libraries/System.Runtime.InteropServices/System.Runtime.InteropServices.sln +++ b/src/libraries/System.Runtime.InteropServices/System.Runtime.InteropServices.sln @@ -1,4 +1,8 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31808.319 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Private.CoreLib", "..\..\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj", "{94B59BA0-491F-4B59-ADFF-A057EC3EC835}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtilities", "..\Common\tests\TestUtilities\TestUtilities.csproj", "{1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}" @@ -9,7 +13,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Runtime.CompilerServ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Runtime.CompilerServices.Unsafe", "..\System.Runtime.CompilerServices.Unsafe\src\System.Runtime.CompilerServices.Unsafe.ilproj", "{04BA3E3C-6979-4792-B19E-C797AD607F42}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Interop.DllImportGenerator", "gen\DllImportGenerator\DllImportGenerator.csproj", "{07F19F91-D438-428D-99F0-61DAD87E78BA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DllImportGenerator", "gen\DllImportGenerator\DllImportGenerator.csproj", "{07F19F91-D438-428D-99F0-61DAD87E78BA}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Interop.SourceGeneration", "gen\Microsoft.Interop.SourceGeneration\Microsoft.Interop.SourceGeneration.csproj", "{768B77B0-EA45-469D-B39E-545EB72F5A43}" EndProject @@ -17,7 +21,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Runtime.InteropServi EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Runtime.InteropServices", "src\System.Runtime.InteropServices.csproj", "{4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Interop.Ancillary", "tests\Ancillary.Interop\Ancillary.Interop.csproj", "{79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ancillary.Interop", "tests\Ancillary.Interop\Ancillary.Interop.csproj", "{79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DllImportGenerator.Tests", "tests\DllImportGenerator.Tests\DllImportGenerator.Tests.csproj", "{57A1A6FD-9231-4DFB-8619-F0EDEDA208E3}" EndProject @@ -27,7 +31,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Runtime.InteropServi EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Runtime.InteropServices.Tests", "tests\System.Runtime.InteropServices.UnitTests\System.Runtime.InteropServices.Tests.csproj", "{049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Interop.Tests.NativeExports", "tests\TestAssets\NativeExports\NativeExports.csproj", "{866D295E-424A-4747-9417-CD7746936138}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NativeExports", "tests\TestAssets\NativeExports\NativeExports.csproj", "{866D295E-424A-4747-9417-CD7746936138}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharedTypes", "tests\TestAssets\SharedTypes\SharedTypes.csproj", "{D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}" EndProject @@ -38,18 +42,27 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{D893B9AA-57C5-49E3-97B1-12CC62D84307}" EndProject Global + GlobalSection(SharedMSBuildProjectFiles) = preSolution + ..\System.Private.CoreLib\src\System.Private.CoreLib.Shared.projitems*{94b59ba0-491f-4b59-adff-a057ec3ec835}*SharedItemsImports = 5 + EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution + Checked|Any CPU = Checked|Any CPU + Checked|x64 = Checked|x64 + Checked|x86 = Checked|x86 Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU Release|x64 = Release|x64 Release|x86 = Release|x86 - Checked|Any CPU = Checked|Any CPU - Checked|x64 = Checked|x64 - Checked|x86 = Checked|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|Any CPU.ActiveCfg = Checked|x64 + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|Any CPU.Build.0 = Checked|x64 + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x64.ActiveCfg = Checked|x64 + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x64.Build.0 = Checked|x64 + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x86.ActiveCfg = Checked|x86 + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x86.Build.0 = Checked|x86 {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Debug|Any CPU.ActiveCfg = Debug|x64 {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Debug|Any CPU.Build.0 = Debug|x64 {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Debug|x64.ActiveCfg = Debug|x64 @@ -62,12 +75,12 @@ Global {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Release|x64.Build.0 = Release|x64 {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Release|x86.ActiveCfg = Release|x86 {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Release|x86.Build.0 = Release|x86 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|Any CPU.ActiveCfg = Checked|x64 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|Any CPU.Build.0 = Checked|x64 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x64.ActiveCfg = Checked|x64 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x64.Build.0 = Checked|x64 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x86.ActiveCfg = Checked|x86 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x86.Build.0 = Checked|x86 + {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|Any CPU.Build.0 = Debug|Any CPU + {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|x64.ActiveCfg = Debug|Any CPU + {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|x64.Build.0 = Debug|Any CPU + {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|x86.ActiveCfg = Debug|Any CPU + {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|x86.Build.0 = Debug|Any CPU {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Debug|Any CPU.Build.0 = Debug|Any CPU {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -80,12 +93,12 @@ Global {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Release|x64.Build.0 = Release|Any CPU {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Release|x86.ActiveCfg = Release|Any CPU {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Release|x86.Build.0 = Release|Any CPU - {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|Any CPU.Build.0 = Debug|Any CPU - {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|x64.ActiveCfg = Debug|Any CPU - {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|x64.Build.0 = Debug|Any CPU - {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|x86.ActiveCfg = Debug|Any CPU - {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|x86.Build.0 = Debug|Any CPU + {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|Any CPU.Build.0 = Debug|Any CPU + {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|x64.ActiveCfg = Debug|Any CPU + {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|x64.Build.0 = Debug|Any CPU + {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|x86.ActiveCfg = Debug|Any CPU + {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|x86.Build.0 = Debug|Any CPU {1B248B4C-7584-4C04-850A-A50EB592052C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1B248B4C-7584-4C04-850A-A50EB592052C}.Debug|Any CPU.Build.0 = Debug|Any CPU {1B248B4C-7584-4C04-850A-A50EB592052C}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -98,12 +111,12 @@ Global {1B248B4C-7584-4C04-850A-A50EB592052C}.Release|x64.Build.0 = Release|Any CPU {1B248B4C-7584-4C04-850A-A50EB592052C}.Release|x86.ActiveCfg = Release|Any CPU {1B248B4C-7584-4C04-850A-A50EB592052C}.Release|x86.Build.0 = Release|Any CPU - {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|Any CPU.Build.0 = Debug|Any CPU - {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|x64.ActiveCfg = Debug|Any CPU - {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|x64.Build.0 = Debug|Any CPU - {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|x86.ActiveCfg = Debug|Any CPU - {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|x86.Build.0 = Debug|Any CPU + {5BB5F99F-1052-4EB4-B12E-7863805661F3}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {5BB5F99F-1052-4EB4-B12E-7863805661F3}.Checked|Any CPU.Build.0 = Debug|Any CPU + {5BB5F99F-1052-4EB4-B12E-7863805661F3}.Checked|x64.ActiveCfg = Debug|Any CPU + {5BB5F99F-1052-4EB4-B12E-7863805661F3}.Checked|x64.Build.0 = Debug|Any CPU + {5BB5F99F-1052-4EB4-B12E-7863805661F3}.Checked|x86.ActiveCfg = Debug|Any CPU + {5BB5F99F-1052-4EB4-B12E-7863805661F3}.Checked|x86.Build.0 = Debug|Any CPU {5BB5F99F-1052-4EB4-B12E-7863805661F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5BB5F99F-1052-4EB4-B12E-7863805661F3}.Debug|Any CPU.Build.0 = Debug|Any CPU {5BB5F99F-1052-4EB4-B12E-7863805661F3}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -116,12 +129,12 @@ Global {5BB5F99F-1052-4EB4-B12E-7863805661F3}.Release|x64.Build.0 = Release|Any CPU {5BB5F99F-1052-4EB4-B12E-7863805661F3}.Release|x86.ActiveCfg = Release|Any CPU {5BB5F99F-1052-4EB4-B12E-7863805661F3}.Release|x86.Build.0 = Release|Any CPU - {5BB5F99F-1052-4EB4-B12E-7863805661F3}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {5BB5F99F-1052-4EB4-B12E-7863805661F3}.Checked|Any CPU.Build.0 = Debug|Any CPU - {5BB5F99F-1052-4EB4-B12E-7863805661F3}.Checked|x64.ActiveCfg = Debug|Any CPU - {5BB5F99F-1052-4EB4-B12E-7863805661F3}.Checked|x64.Build.0 = Debug|Any CPU - {5BB5F99F-1052-4EB4-B12E-7863805661F3}.Checked|x86.ActiveCfg = Debug|Any CPU - {5BB5F99F-1052-4EB4-B12E-7863805661F3}.Checked|x86.Build.0 = Debug|Any CPU + {04BA3E3C-6979-4792-B19E-C797AD607F42}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {04BA3E3C-6979-4792-B19E-C797AD607F42}.Checked|Any CPU.Build.0 = Debug|Any CPU + {04BA3E3C-6979-4792-B19E-C797AD607F42}.Checked|x64.ActiveCfg = Debug|Any CPU + {04BA3E3C-6979-4792-B19E-C797AD607F42}.Checked|x64.Build.0 = Debug|Any CPU + {04BA3E3C-6979-4792-B19E-C797AD607F42}.Checked|x86.ActiveCfg = Debug|Any CPU + {04BA3E3C-6979-4792-B19E-C797AD607F42}.Checked|x86.Build.0 = Debug|Any CPU {04BA3E3C-6979-4792-B19E-C797AD607F42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {04BA3E3C-6979-4792-B19E-C797AD607F42}.Debug|Any CPU.Build.0 = Debug|Any CPU {04BA3E3C-6979-4792-B19E-C797AD607F42}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -134,12 +147,12 @@ Global {04BA3E3C-6979-4792-B19E-C797AD607F42}.Release|x64.Build.0 = Release|Any CPU {04BA3E3C-6979-4792-B19E-C797AD607F42}.Release|x86.ActiveCfg = Release|Any CPU {04BA3E3C-6979-4792-B19E-C797AD607F42}.Release|x86.Build.0 = Release|Any CPU - {04BA3E3C-6979-4792-B19E-C797AD607F42}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {04BA3E3C-6979-4792-B19E-C797AD607F42}.Checked|Any CPU.Build.0 = Debug|Any CPU - {04BA3E3C-6979-4792-B19E-C797AD607F42}.Checked|x64.ActiveCfg = Debug|Any CPU - {04BA3E3C-6979-4792-B19E-C797AD607F42}.Checked|x64.Build.0 = Debug|Any CPU - {04BA3E3C-6979-4792-B19E-C797AD607F42}.Checked|x86.ActiveCfg = Debug|Any CPU - {04BA3E3C-6979-4792-B19E-C797AD607F42}.Checked|x86.Build.0 = Debug|Any CPU + {07F19F91-D438-428D-99F0-61DAD87E78BA}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {07F19F91-D438-428D-99F0-61DAD87E78BA}.Checked|Any CPU.Build.0 = Debug|Any CPU + {07F19F91-D438-428D-99F0-61DAD87E78BA}.Checked|x64.ActiveCfg = Debug|Any CPU + {07F19F91-D438-428D-99F0-61DAD87E78BA}.Checked|x64.Build.0 = Debug|Any CPU + {07F19F91-D438-428D-99F0-61DAD87E78BA}.Checked|x86.ActiveCfg = Debug|Any CPU + {07F19F91-D438-428D-99F0-61DAD87E78BA}.Checked|x86.Build.0 = Debug|Any CPU {07F19F91-D438-428D-99F0-61DAD87E78BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {07F19F91-D438-428D-99F0-61DAD87E78BA}.Debug|Any CPU.Build.0 = Debug|Any CPU {07F19F91-D438-428D-99F0-61DAD87E78BA}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -152,12 +165,12 @@ Global {07F19F91-D438-428D-99F0-61DAD87E78BA}.Release|x64.Build.0 = Release|Any CPU {07F19F91-D438-428D-99F0-61DAD87E78BA}.Release|x86.ActiveCfg = Release|Any CPU {07F19F91-D438-428D-99F0-61DAD87E78BA}.Release|x86.Build.0 = Release|Any CPU - {07F19F91-D438-428D-99F0-61DAD87E78BA}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {07F19F91-D438-428D-99F0-61DAD87E78BA}.Checked|Any CPU.Build.0 = Debug|Any CPU - {07F19F91-D438-428D-99F0-61DAD87E78BA}.Checked|x64.ActiveCfg = Debug|Any CPU - {07F19F91-D438-428D-99F0-61DAD87E78BA}.Checked|x64.Build.0 = Debug|Any CPU - {07F19F91-D438-428D-99F0-61DAD87E78BA}.Checked|x86.ActiveCfg = Debug|Any CPU - {07F19F91-D438-428D-99F0-61DAD87E78BA}.Checked|x86.Build.0 = Debug|Any CPU + {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|Any CPU.Build.0 = Debug|Any CPU + {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|x64.ActiveCfg = Debug|Any CPU + {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|x64.Build.0 = Debug|Any CPU + {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|x86.ActiveCfg = Debug|Any CPU + {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|x86.Build.0 = Debug|Any CPU {768B77B0-EA45-469D-B39E-545EB72F5A43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {768B77B0-EA45-469D-B39E-545EB72F5A43}.Debug|Any CPU.Build.0 = Debug|Any CPU {768B77B0-EA45-469D-B39E-545EB72F5A43}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -170,12 +183,12 @@ Global {768B77B0-EA45-469D-B39E-545EB72F5A43}.Release|x64.Build.0 = Release|Any CPU {768B77B0-EA45-469D-B39E-545EB72F5A43}.Release|x86.ActiveCfg = Release|Any CPU {768B77B0-EA45-469D-B39E-545EB72F5A43}.Release|x86.Build.0 = Release|Any CPU - {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|Any CPU.Build.0 = Debug|Any CPU - {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|x64.ActiveCfg = Debug|Any CPU - {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|x64.Build.0 = Debug|Any CPU - {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|x86.ActiveCfg = Debug|Any CPU - {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|x86.Build.0 = Debug|Any CPU + {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|Any CPU.Build.0 = Debug|Any CPU + {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|x64.ActiveCfg = Debug|Any CPU + {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|x64.Build.0 = Debug|Any CPU + {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|x86.ActiveCfg = Debug|Any CPU + {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|x86.Build.0 = Debug|Any CPU {8671F164-F78C-44FA-93B7-A310F67890FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8671F164-F78C-44FA-93B7-A310F67890FE}.Debug|Any CPU.Build.0 = Debug|Any CPU {8671F164-F78C-44FA-93B7-A310F67890FE}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -188,12 +201,12 @@ Global {8671F164-F78C-44FA-93B7-A310F67890FE}.Release|x64.Build.0 = Release|Any CPU {8671F164-F78C-44FA-93B7-A310F67890FE}.Release|x86.ActiveCfg = Release|Any CPU {8671F164-F78C-44FA-93B7-A310F67890FE}.Release|x86.Build.0 = Release|Any CPU - {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|Any CPU.Build.0 = Debug|Any CPU - {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|x64.ActiveCfg = Debug|Any CPU - {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|x64.Build.0 = Debug|Any CPU - {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|x86.ActiveCfg = Debug|Any CPU - {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|x86.Build.0 = Debug|Any CPU + {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|Any CPU.Build.0 = Debug|Any CPU + {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|x64.ActiveCfg = Debug|Any CPU + {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|x64.Build.0 = Debug|Any CPU + {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|x86.ActiveCfg = Debug|Any CPU + {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|x86.Build.0 = Debug|Any CPU {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Debug|Any CPU.Build.0 = Debug|Any CPU {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -206,12 +219,12 @@ Global {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Release|x64.Build.0 = Release|Any CPU {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Release|x86.ActiveCfg = Release|Any CPU {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Release|x86.Build.0 = Release|Any CPU - {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|Any CPU.Build.0 = Debug|Any CPU - {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|x64.ActiveCfg = Debug|Any CPU - {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|x64.Build.0 = Debug|Any CPU - {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|x86.ActiveCfg = Debug|Any CPU - {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|x86.Build.0 = Debug|Any CPU + {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|Any CPU.Build.0 = Debug|Any CPU + {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|x64.ActiveCfg = Debug|Any CPU + {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|x64.Build.0 = Debug|Any CPU + {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|x86.ActiveCfg = Debug|Any CPU + {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|x86.Build.0 = Debug|Any CPU {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Debug|Any CPU.Build.0 = Debug|Any CPU {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -224,12 +237,12 @@ Global {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Release|x64.Build.0 = Release|Any CPU {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Release|x86.ActiveCfg = Release|Any CPU {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Release|x86.Build.0 = Release|Any CPU - {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|Any CPU.Build.0 = Debug|Any CPU - {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|x64.ActiveCfg = Debug|Any CPU - {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|x64.Build.0 = Debug|Any CPU - {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|x86.ActiveCfg = Debug|Any CPU - {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|x86.Build.0 = Debug|Any CPU + {57A1A6FD-9231-4DFB-8619-F0EDEDA208E3}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {57A1A6FD-9231-4DFB-8619-F0EDEDA208E3}.Checked|Any CPU.Build.0 = Debug|Any CPU + {57A1A6FD-9231-4DFB-8619-F0EDEDA208E3}.Checked|x64.ActiveCfg = Debug|Any CPU + {57A1A6FD-9231-4DFB-8619-F0EDEDA208E3}.Checked|x64.Build.0 = Debug|Any CPU + {57A1A6FD-9231-4DFB-8619-F0EDEDA208E3}.Checked|x86.ActiveCfg = Debug|Any CPU + {57A1A6FD-9231-4DFB-8619-F0EDEDA208E3}.Checked|x86.Build.0 = Debug|Any CPU {57A1A6FD-9231-4DFB-8619-F0EDEDA208E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {57A1A6FD-9231-4DFB-8619-F0EDEDA208E3}.Debug|Any CPU.Build.0 = Debug|Any CPU {57A1A6FD-9231-4DFB-8619-F0EDEDA208E3}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -242,12 +255,12 @@ Global {57A1A6FD-9231-4DFB-8619-F0EDEDA208E3}.Release|x64.Build.0 = Release|Any CPU {57A1A6FD-9231-4DFB-8619-F0EDEDA208E3}.Release|x86.ActiveCfg = Release|Any CPU {57A1A6FD-9231-4DFB-8619-F0EDEDA208E3}.Release|x86.Build.0 = Release|Any CPU - {57A1A6FD-9231-4DFB-8619-F0EDEDA208E3}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {57A1A6FD-9231-4DFB-8619-F0EDEDA208E3}.Checked|Any CPU.Build.0 = Debug|Any CPU - {57A1A6FD-9231-4DFB-8619-F0EDEDA208E3}.Checked|x64.ActiveCfg = Debug|Any CPU - {57A1A6FD-9231-4DFB-8619-F0EDEDA208E3}.Checked|x64.Build.0 = Debug|Any CPU - {57A1A6FD-9231-4DFB-8619-F0EDEDA208E3}.Checked|x86.ActiveCfg = Debug|Any CPU - {57A1A6FD-9231-4DFB-8619-F0EDEDA208E3}.Checked|x86.Build.0 = Debug|Any CPU + {4B516949-4AD4-44D6-AF86-C2E6058608D5}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {4B516949-4AD4-44D6-AF86-C2E6058608D5}.Checked|Any CPU.Build.0 = Debug|Any CPU + {4B516949-4AD4-44D6-AF86-C2E6058608D5}.Checked|x64.ActiveCfg = Debug|Any CPU + {4B516949-4AD4-44D6-AF86-C2E6058608D5}.Checked|x64.Build.0 = Debug|Any CPU + {4B516949-4AD4-44D6-AF86-C2E6058608D5}.Checked|x86.ActiveCfg = Debug|Any CPU + {4B516949-4AD4-44D6-AF86-C2E6058608D5}.Checked|x86.Build.0 = Debug|Any CPU {4B516949-4AD4-44D6-AF86-C2E6058608D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4B516949-4AD4-44D6-AF86-C2E6058608D5}.Debug|Any CPU.Build.0 = Debug|Any CPU {4B516949-4AD4-44D6-AF86-C2E6058608D5}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -260,12 +273,12 @@ Global {4B516949-4AD4-44D6-AF86-C2E6058608D5}.Release|x64.Build.0 = Release|Any CPU {4B516949-4AD4-44D6-AF86-C2E6058608D5}.Release|x86.ActiveCfg = Release|Any CPU {4B516949-4AD4-44D6-AF86-C2E6058608D5}.Release|x86.Build.0 = Release|Any CPU - {4B516949-4AD4-44D6-AF86-C2E6058608D5}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {4B516949-4AD4-44D6-AF86-C2E6058608D5}.Checked|Any CPU.Build.0 = Debug|Any CPU - {4B516949-4AD4-44D6-AF86-C2E6058608D5}.Checked|x64.ActiveCfg = Debug|Any CPU - {4B516949-4AD4-44D6-AF86-C2E6058608D5}.Checked|x64.Build.0 = Debug|Any CPU - {4B516949-4AD4-44D6-AF86-C2E6058608D5}.Checked|x86.ActiveCfg = Debug|Any CPU - {4B516949-4AD4-44D6-AF86-C2E6058608D5}.Checked|x86.Build.0 = Debug|Any CPU + {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|Any CPU.Build.0 = Debug|Any CPU + {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|x64.ActiveCfg = Debug|Any CPU + {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|x64.Build.0 = Debug|Any CPU + {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|x86.ActiveCfg = Debug|Any CPU + {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|x86.Build.0 = Debug|Any CPU {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Debug|Any CPU.Build.0 = Debug|Any CPU {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -278,12 +291,12 @@ Global {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Release|x64.Build.0 = Release|Any CPU {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Release|x86.ActiveCfg = Release|Any CPU {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Release|x86.Build.0 = Release|Any CPU - {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|Any CPU.Build.0 = Debug|Any CPU - {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|x64.ActiveCfg = Debug|Any CPU - {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|x64.Build.0 = Debug|Any CPU - {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|x86.ActiveCfg = Debug|Any CPU - {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|x86.Build.0 = Debug|Any CPU + {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|Any CPU.Build.0 = Debug|Any CPU + {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|x64.ActiveCfg = Debug|Any CPU + {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|x64.Build.0 = Debug|Any CPU + {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|x86.ActiveCfg = Debug|Any CPU + {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|x86.Build.0 = Debug|Any CPU {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Debug|Any CPU.Build.0 = Debug|Any CPU {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -296,12 +309,12 @@ Global {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Release|x64.Build.0 = Release|Any CPU {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Release|x86.ActiveCfg = Release|Any CPU {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Release|x86.Build.0 = Release|Any CPU - {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|Any CPU.Build.0 = Debug|Any CPU - {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|x64.ActiveCfg = Debug|Any CPU - {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|x64.Build.0 = Debug|Any CPU - {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|x86.ActiveCfg = Debug|Any CPU - {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|x86.Build.0 = Debug|Any CPU + {866D295E-424A-4747-9417-CD7746936138}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {866D295E-424A-4747-9417-CD7746936138}.Checked|Any CPU.Build.0 = Debug|Any CPU + {866D295E-424A-4747-9417-CD7746936138}.Checked|x64.ActiveCfg = Debug|Any CPU + {866D295E-424A-4747-9417-CD7746936138}.Checked|x64.Build.0 = Debug|Any CPU + {866D295E-424A-4747-9417-CD7746936138}.Checked|x86.ActiveCfg = Debug|Any CPU + {866D295E-424A-4747-9417-CD7746936138}.Checked|x86.Build.0 = Debug|Any CPU {866D295E-424A-4747-9417-CD7746936138}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {866D295E-424A-4747-9417-CD7746936138}.Debug|Any CPU.Build.0 = Debug|Any CPU {866D295E-424A-4747-9417-CD7746936138}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -314,12 +327,12 @@ Global {866D295E-424A-4747-9417-CD7746936138}.Release|x64.Build.0 = Release|Any CPU {866D295E-424A-4747-9417-CD7746936138}.Release|x86.ActiveCfg = Release|Any CPU {866D295E-424A-4747-9417-CD7746936138}.Release|x86.Build.0 = Release|Any CPU - {866D295E-424A-4747-9417-CD7746936138}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {866D295E-424A-4747-9417-CD7746936138}.Checked|Any CPU.Build.0 = Debug|Any CPU - {866D295E-424A-4747-9417-CD7746936138}.Checked|x64.ActiveCfg = Debug|Any CPU - {866D295E-424A-4747-9417-CD7746936138}.Checked|x64.Build.0 = Debug|Any CPU - {866D295E-424A-4747-9417-CD7746936138}.Checked|x86.ActiveCfg = Debug|Any CPU - {866D295E-424A-4747-9417-CD7746936138}.Checked|x86.Build.0 = Debug|Any CPU + {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|Any CPU.Build.0 = Debug|Any CPU + {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|x64.ActiveCfg = Debug|Any CPU + {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|x64.Build.0 = Debug|Any CPU + {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|x86.ActiveCfg = Debug|Any CPU + {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|x86.Build.0 = Debug|Any CPU {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Debug|Any CPU.Build.0 = Debug|Any CPU {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -332,24 +345,20 @@ Global {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Release|x64.Build.0 = Release|Any CPU {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Release|x86.ActiveCfg = Release|Any CPU {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Release|x86.Build.0 = Release|Any CPU - {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|Any CPU.Build.0 = Debug|Any CPU - {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|x64.ActiveCfg = Debug|Any CPU - {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|x64.Build.0 = Debug|Any CPU - {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|x86.ActiveCfg = Debug|Any CPU - {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|x86.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {94B59BA0-491F-4B59-ADFF-A057EC3EC835} = {B1678CCD-95C8-4419-B9F9-14A03061BE4B} + {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} {1B248B4C-7584-4C04-850A-A50EB592052C} = {B1678CCD-95C8-4419-B9F9-14A03061BE4B} + {5BB5F99F-1052-4EB4-B12E-7863805661F3} = {D893B9AA-57C5-49E3-97B1-12CC62D84307} {04BA3E3C-6979-4792-B19E-C797AD607F42} = {B1678CCD-95C8-4419-B9F9-14A03061BE4B} {07F19F91-D438-428D-99F0-61DAD87E78BA} = {B1678CCD-95C8-4419-B9F9-14A03061BE4B} {768B77B0-EA45-469D-B39E-545EB72F5A43} = {B1678CCD-95C8-4419-B9F9-14A03061BE4B} + {8671F164-F78C-44FA-93B7-A310F67890FE} = {D893B9AA-57C5-49E3-97B1-12CC62D84307} {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1} = {B1678CCD-95C8-4419-B9F9-14A03061BE4B} - {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} {57A1A6FD-9231-4DFB-8619-F0EDEDA208E3} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} {4B516949-4AD4-44D6-AF86-C2E6058608D5} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} @@ -357,8 +366,6 @@ Global {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} {866D295E-424A-4747-9417-CD7746936138} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} - {5BB5F99F-1052-4EB4-B12E-7863805661F3} = {D893B9AA-57C5-49E3-97B1-12CC62D84307} - {8671F164-F78C-44FA-93B7-A310F67890FE} = {D893B9AA-57C5-49E3-97B1-12CC62D84307} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {D4031401-FEB5-4CCF-91C1-38F5646B2BFD} diff --git a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/AnalyzerReleases.Unshipped.md b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/AnalyzerReleases.Unshipped.md index 87ac29a463b2f5..05e2158b078b14 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/AnalyzerReleases.Unshipped.md +++ b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/AnalyzerReleases.Unshipped.md @@ -22,3 +22,4 @@ DLLIMPORTGENANALYZER014 | Usage | Error | RefValuePropertyUnsuppor DLLIMPORTGENANALYZER015 | Interoperability | Disabled | ConvertToGeneratedDllImportAnalyzer DLLIMPORTGENANALYZER016 | Usage | Error | GenericTypeMustBeClosed DLLIMPORTGENANALYZER017 | Usage | Warning | GeneratedDllImportContainingTypeMissingModifiers +DLLIMPORTGENANALYZER018 | Usage | Error | MarshallerGetPinnableReferenceRequiresValueProperty diff --git a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Analyzers/AnalyzerDiagnostics.cs b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Analyzers/AnalyzerDiagnostics.cs index 4f4d7690fe05f0..37740545ed1563 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Analyzers/AnalyzerDiagnostics.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Analyzers/AnalyzerDiagnostics.cs @@ -29,6 +29,7 @@ public static class Ids public const string StackallocConstructorMustHaveStackBufferSizeConstant = Prefix + "012"; public const string RefValuePropertyUnsupported = Prefix + "014"; public const string NativeGenericTypeMustBeClosedOrMatchArity = Prefix + "016"; + public const string MarshallerGetPinnableReferenceRequiresValueProperty = Prefix + "018"; // GeneratedDllImport public const string GeneratedDllImportMissingRequiredModifiers = Prefix + "013"; diff --git a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Analyzers/ConvertToGeneratedDllImportAnalyzer.cs b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Analyzers/ConvertToGeneratedDllImportAnalyzer.cs index 57c25707955357..6ed2cc71e2e459 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Analyzers/ConvertToGeneratedDllImportAnalyzer.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Analyzers/ConvertToGeneratedDllImportAnalyzer.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Collections.Immutable; +using System.Runtime.InteropServices; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; @@ -48,6 +49,8 @@ public override void Initialize(AnalysisContext context) if (generatedDllImportAttrType == null) return; + INamedTypeSymbol? marshalAsAttrType = compilationContext.Compilation.GetTypeByMetadataName(TypeNames.System_Runtime_InteropServices_MarshalAsAttribute); + var knownUnsupportedTypes = new List(s_unsupportedTypeNames.Length); foreach (string typeName in s_unsupportedTypeNames) { @@ -58,11 +61,11 @@ public override void Initialize(AnalysisContext context) } } - compilationContext.RegisterSymbolAction(symbolContext => AnalyzeSymbol(symbolContext, knownUnsupportedTypes), SymbolKind.Method); + compilationContext.RegisterSymbolAction(symbolContext => AnalyzeSymbol(symbolContext, knownUnsupportedTypes, marshalAsAttrType), SymbolKind.Method); }); } - private static void AnalyzeSymbol(SymbolAnalysisContext context, List knownUnsupportedTypes) + private static void AnalyzeSymbol(SymbolAnalysisContext context, List knownUnsupportedTypes, INamedTypeSymbol? marshalAsAttrType) { var method = (IMethodSymbol)context.Symbol; @@ -81,24 +84,56 @@ private static void AnalyzeSymbol(SymbolAnalysisContext context, List attributes, INamedTypeSymbol? marshalAsAttrType) + { + if (marshalAsAttrType == null) + return false; + + AttributeData? marshalAsAttr = null; + foreach (AttributeData attr in attributes) + { + if (SymbolEqualityComparer.Default.Equals(attr.AttributeClass, marshalAsAttrType)) + { + marshalAsAttr = attr; + break; + } + } + + if (marshalAsAttr == null || marshalAsAttr.ConstructorArguments.IsEmpty) + return false; + + object unmanagedTypeObj = marshalAsAttr.ConstructorArguments[0].Value!; + UnmanagedType unmanagedType = unmanagedTypeObj is short unmanagedTypeAsShort + ? (UnmanagedType)unmanagedTypeAsShort + : (UnmanagedType)unmanagedTypeObj; + + return !System.Enum.IsDefined(typeof(UnmanagedType), unmanagedType) + || unmanagedType == UnmanagedType.CustomMarshaler + || unmanagedType == UnmanagedType.Interface + || unmanagedType == UnmanagedType.IDispatch + || unmanagedType == UnmanagedType.IInspectable + || unmanagedType == UnmanagedType.IUnknown + || unmanagedType == UnmanagedType.SafeArray; + } } } diff --git a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Analyzers/ManualTypeMarshallingAnalyzer.cs b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Analyzers/ManualTypeMarshallingAnalyzer.cs index f975a68c58f37f..5446b843aeaddb 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Analyzers/ManualTypeMarshallingAnalyzer.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Analyzers/ManualTypeMarshallingAnalyzer.cs @@ -54,7 +54,7 @@ public class ManualTypeMarshallingAnalyzer : DiagnosticAnalyzer Category, DiagnosticSeverity.Error, isEnabledByDefault: true, - description: GetResourceString(nameof(Resources.BlittableTypeMustBeBlittableDescription))); + description: GetResourceString(nameof(Resources.NativeTypeMustBeBlittableDescription))); public static readonly DiagnosticDescriptor GetPinnableReferenceReturnTypeBlittableRule = new DiagnosticDescriptor( @@ -166,6 +166,16 @@ public class ManualTypeMarshallingAnalyzer : DiagnosticAnalyzer isEnabledByDefault: true, description: GetResourceString(nameof(Resources.NativeGenericTypeMustBeClosedOrMatchArityDescription))); + public static readonly DiagnosticDescriptor MarshallerGetPinnableReferenceRequiresValuePropertyRule = + new DiagnosticDescriptor( + Ids.MarshallerGetPinnableReferenceRequiresValueProperty, + "MarshallerGetPinnableReferenceRequiresValueProperty", + GetResourceString(nameof(Resources.MarshallerGetPinnableReferenceRequiresValuePropertyMessage)), + Category, + DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: GetResourceString(nameof(Resources.MarshallerGetPinnableReferenceRequiresValuePropertyDescription))); + public override ImmutableArray SupportedDiagnostics => ImmutableArray.Create( BlittableTypeMustBeBlittableRule, @@ -182,7 +192,8 @@ public class ManualTypeMarshallingAnalyzer : DiagnosticAnalyzer StackallocMarshallingShouldSupportAllocatingMarshallingFallbackRule, StackallocConstructorMustHaveStackBufferSizeConstantRule, RefValuePropertyUnsupportedRule, - NativeGenericTypeMustBeClosedOrMatchArityRule); + NativeGenericTypeMustBeClosedOrMatchArityRule, + MarshallerGetPinnableReferenceRequiresValuePropertyRule); public override void Initialize(AnalysisContext context) { @@ -494,6 +505,17 @@ private void AnalyzeNativeMarshalerType(SymbolAnalysisContext context, ITypeSymb marshalerType.ToDisplayString())); } } + else if (ManualTypeMarshallingHelper.FindGetPinnableReference(marshalerType) is IMethodSymbol marshallerGetPinnableReferenceMethod) + { + // If we don't have a Value property, then we disallow a GetPinnableReference on the marshaler type. + // We do this since there is no valid use case that we can think of for a GetPinnableReference on a blittable type + // being a requirement to calculate the value of the fields of the same blittable instance, + // so we're pre-emptively blocking this until a use case is discovered. + context.ReportDiagnostic( + marshallerGetPinnableReferenceMethod.CreateDiagnostic( + MarshallerGetPinnableReferenceRequiresValuePropertyRule, + nativeType.ToDisplayString())); + } if (!nativeType.IsConsideredBlittable()) { @@ -504,18 +526,11 @@ private void AnalyzeNativeMarshalerType(SymbolAnalysisContext context, ITypeSymb type.ToDisplayString())); } - // Use a tuple here instead of an anonymous type so we can do the reassignment and pattern matching below. - var getPinnableReferenceMethods = new + if (isNativeMarshallingAttribute && ManualTypeMarshallingHelper.FindGetPinnableReference(type) is IMethodSymbol managedGetPinnableReferenceMethod) { - Managed = isNativeMarshallingAttribute ? ManualTypeMarshallingHelper.FindGetPinnableReference(type) : null, - Marshaler = ManualTypeMarshallingHelper.FindGetPinnableReference(marshalerType) - }; - - if (getPinnableReferenceMethods.Managed is not null) - { - if (!getPinnableReferenceMethods.Managed.ReturnType.IsConsideredBlittable()) + if (!managedGetPinnableReferenceMethod.ReturnType.IsConsideredBlittable()) { - context.ReportDiagnostic(getPinnableReferenceMethods.Managed.CreateDiagnostic(GetPinnableReferenceReturnTypeBlittableRule)); + context.ReportDiagnostic(managedGetPinnableReferenceMethod.CreateDiagnostic(GetPinnableReferenceReturnTypeBlittableRule)); } // Validate that our marshaler supports scenarios where GetPinnableReference cannot be used. if (isNativeMarshallingAttribute && (!hasConstructor || valueProperty is { GetMethod: null })) @@ -525,23 +540,23 @@ private void AnalyzeNativeMarshalerType(SymbolAnalysisContext context, ITypeSymb GetPinnableReferenceShouldSupportAllocatingMarshallingFallbackRule, type.ToDisplayString())); } - } - if ((getPinnableReferenceMethods.Managed is not null - || getPinnableReferenceMethods.Marshaler is not null) - && !valuePropertyIsRefReturn // Ref returns are already reported above as invalid, so don't issue another warning here about them - && nativeType is not ( + // If the managed type has a GetPinnableReference method, make sure that the Value getter is also a pointer-sized primitive. + // This ensures that marshalling via pinning the managed value and marshalling via the default marshaller will have the same ABI. + if (!valuePropertyIsRefReturn // Ref returns are already reported above as invalid, so don't issue another warning here about them + && nativeType is not ( IPointerTypeSymbol _ or { SpecialType: SpecialType.System_IntPtr } or { SpecialType: SpecialType.System_UIntPtr })) - { - IMethodSymbol getPinnableReferenceMethodToMention = getPinnableReferenceMethods.Managed ?? getPinnableReferenceMethods.Marshaler!; + { + IMethodSymbol getPinnableReferenceMethodToMention = managedGetPinnableReferenceMethod; - context.ReportDiagnostic( - GetDiagnosticLocations(context, nativeTypeDiagnosticsTargetSymbol, nativeMarshalerAttributeData).CreateDiagnostic( - NativeTypeMustBePointerSizedRule, - nativeType.ToDisplayString(), - getPinnableReferenceMethodToMention.ContainingType.ToDisplayString())); + context.ReportDiagnostic( + GetDiagnosticLocations(context, nativeTypeDiagnosticsTargetSymbol, nativeMarshalerAttributeData).CreateDiagnostic( + NativeTypeMustBePointerSizedRule, + nativeType.ToDisplayString(), + getPinnableReferenceMethodToMention.ContainingType.ToDisplayString())); + } } } diff --git a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/DllImportGenerator.cs b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/DllImportGenerator.cs index f69393e6e15893..7979638743803d 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/DllImportGenerator.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/DllImportGenerator.cs @@ -348,14 +348,11 @@ private static GeneratedDllImportData ProcessGeneratedDllImportAttribute(Attribu // documented semanatics of DllImportAttribute: // - https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.dllimportattribute DllImportMember userDefinedValues = DllImportMember.None; - bool bestFitMapping = false; - CallingConvention callingConvention = CallingConvention.Winapi; CharSet charSet = CharSet.Ansi; string? entryPoint = null; bool exactSpelling = false; // VB has different and unusual default behavior here. bool preserveSig = true; bool setLastError = false; - bool throwOnUnmappableChar = false; // All other data on attribute is defined as NamedArguments. foreach (KeyValuePair namedArg in attrData.NamedArguments) @@ -365,14 +362,6 @@ private static GeneratedDllImportData ProcessGeneratedDllImportAttribute(Attribu default: Debug.Fail($"An unknown member was found on {GeneratedDllImport}"); continue; - case nameof(GeneratedDllImportData.BestFitMapping): - userDefinedValues |= DllImportMember.BestFitMapping; - bestFitMapping = (bool)namedArg.Value.Value!; - break; - case nameof(GeneratedDllImportData.CallingConvention): - userDefinedValues |= DllImportMember.CallingConvention; - callingConvention = (CallingConvention)namedArg.Value.Value!; - break; case nameof(GeneratedDllImportData.CharSet): userDefinedValues |= DllImportMember.CharSet; charSet = (CharSet)namedArg.Value.Value!; @@ -393,24 +382,17 @@ private static GeneratedDllImportData ProcessGeneratedDllImportAttribute(Attribu userDefinedValues |= DllImportMember.SetLastError; setLastError = (bool)namedArg.Value.Value!; break; - case nameof(GeneratedDllImportData.ThrowOnUnmappableChar): - userDefinedValues |= DllImportMember.ThrowOnUnmappableChar; - throwOnUnmappableChar = (bool)namedArg.Value.Value!; - break; } } return new GeneratedDllImportData(attrData.ConstructorArguments[0].Value!.ToString()) { IsUserDefined = userDefinedValues, - BestFitMapping = bestFitMapping, - CallingConvention = callingConvention, CharSet = charSet, EntryPoint = entryPoint, ExactSpelling = exactSpelling, PreserveSig = preserveSig, SetLastError = setLastError, - ThrowOnUnmappableChar = throwOnUnmappableChar }; } @@ -452,31 +434,16 @@ private static IncrementalStubGenerationContext CalculateStubInformation(IMethod // Process the GeneratedDllImport attribute GeneratedDllImportData stubDllImportData = ProcessGeneratedDllImportAttribute(generatedDllImportAttr!); - if (stubDllImportData.IsUserDefined.HasFlag(DllImportMember.BestFitMapping)) - { - generatorDiagnostics.ReportConfigurationNotSupported(generatedDllImportAttr!, nameof(GeneratedDllImportData.BestFitMapping)); - } - - if (stubDllImportData.IsUserDefined.HasFlag(DllImportMember.ThrowOnUnmappableChar)) - { - generatorDiagnostics.ReportConfigurationNotSupported(generatedDllImportAttr!, nameof(GeneratedDllImportData.ThrowOnUnmappableChar)); - } - - if (stubDllImportData.IsUserDefined.HasFlag(DllImportMember.CallingConvention)) - { - generatorDiagnostics.ReportConfigurationNotSupported(generatedDllImportAttr!, nameof(GeneratedDllImportData.CallingConvention)); - } - if (lcidConversionAttr != null) { // Using LCIDConversion with GeneratedDllImport is not supported generatorDiagnostics.ReportConfigurationNotSupported(lcidConversionAttr, nameof(TypeNames.LCIDConversionAttribute)); } - List additionalAttributes = GenerateSyntaxForForwardedAttributes(suppressGCTransitionAttribute, unmanagedCallConvAttribute); // Create the stub. var dllImportStub = DllImportStubContext.Create(symbol, stubDllImportData, environment, generatorDiagnostics, ct); + List additionalAttributes = GenerateSyntaxForForwardedAttributes(suppressGCTransitionAttribute, unmanagedCallConvAttribute); return new IncrementalStubGenerationContext(environment, dllImportStub, additionalAttributes.ToImmutableArray(), stubDllImportData, generatorDiagnostics.Diagnostics.ToImmutableArray()); } @@ -602,18 +569,6 @@ private static AttributeSyntax CreateDllImportAttributeForTarget(GeneratedDllImp CreateStringExpressionSyntax(targetDllImportData.EntryPoint!)) }; - if (targetDllImportData.IsUserDefined.HasFlag(DllImportMember.BestFitMapping)) - { - NameEqualsSyntax name = NameEquals(nameof(DllImportAttribute.BestFitMapping)); - ExpressionSyntax value = CreateBoolExpressionSyntax(targetDllImportData.BestFitMapping); - newAttributeArgs.Add(AttributeArgument(name, null, value)); - } - if (targetDllImportData.IsUserDefined.HasFlag(DllImportMember.CallingConvention)) - { - NameEqualsSyntax name = NameEquals(nameof(DllImportAttribute.CallingConvention)); - ExpressionSyntax value = CreateEnumExpressionSyntax(targetDllImportData.CallingConvention); - newAttributeArgs.Add(AttributeArgument(name, null, value)); - } if (targetDllImportData.IsUserDefined.HasFlag(DllImportMember.CharSet)) { NameEqualsSyntax name = NameEquals(nameof(DllImportAttribute.CharSet)); @@ -638,12 +593,6 @@ private static AttributeSyntax CreateDllImportAttributeForTarget(GeneratedDllImp ExpressionSyntax value = CreateBoolExpressionSyntax(targetDllImportData.SetLastError); newAttributeArgs.Add(AttributeArgument(name, null, value)); } - if (targetDllImportData.IsUserDefined.HasFlag(DllImportMember.ThrowOnUnmappableChar)) - { - NameEqualsSyntax name = NameEquals(nameof(DllImportAttribute.ThrowOnUnmappableChar)); - ExpressionSyntax value = CreateBoolExpressionSyntax(targetDllImportData.ThrowOnUnmappableChar); - newAttributeArgs.Add(AttributeArgument(name, null, value)); - } // Create new attribute return Attribute( @@ -691,13 +640,10 @@ private static GeneratedDllImportData GetTargetDllImportDataFromStubData(Generat var targetDllImportData = new GeneratedDllImportData(dllImportData.ModuleName) { CharSet = dllImportData.CharSet, - BestFitMapping = dllImportData.BestFitMapping, - CallingConvention = dllImportData.CallingConvention, EntryPoint = dllImportData.EntryPoint, ExactSpelling = dllImportData.ExactSpelling, SetLastError = dllImportData.SetLastError, PreserveSig = dllImportData.PreserveSig, - ThrowOnUnmappableChar = dllImportData.ThrowOnUnmappableChar, IsUserDefined = dllImportData.IsUserDefined & membersToForward }; diff --git a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/DllImportGenerator.csproj b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/DllImportGenerator.csproj index 0648253ef2c945..85f7a7c0c00bcc 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/DllImportGenerator.csproj +++ b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/DllImportGenerator.csproj @@ -2,7 +2,7 @@ Microsoft.Interop.DllImportGenerator - netstandard2.0 + netstandard2.0 false true True @@ -41,7 +41,7 @@ - + diff --git a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/DllImportStubContext.cs b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/DllImportStubContext.cs index 420e2b6f887434..28136ba47c7b3e 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/DllImportStubContext.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/DllImportStubContext.cs @@ -200,8 +200,10 @@ private static (ImmutableArray, IMarshallingGeneratorFactory) else { generatorFactory = new DefaultMarshallingGeneratorFactory(options); - AttributedMarshallingModelGeneratorFactory attributedMarshallingFactory = new(generatorFactory, options); - generatorFactory = attributedMarshallingFactory; + IMarshallingGeneratorFactory elementFactory = new AttributedMarshallingModelGeneratorFactory(generatorFactory, options); + // We don't need to include the later generator factories for collection elements + // as the later generator factories only apply to parameters or to the synthetic return value for PreserveSig support. + generatorFactory = new AttributedMarshallingModelGeneratorFactory(generatorFactory, elementFactory, options); if (!dllImportData.PreserveSig) { // Create type info for native out param @@ -231,7 +233,6 @@ private static (ImmutableArray, IMarshallingGeneratorFactory) } generatorFactory = new ByValueContentsMarshalKindValidator(generatorFactory); - attributedMarshallingFactory.ElementMarshallingGeneratorFactory = generatorFactory; } typeInfos.Add(retTypeInfo); diff --git a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/GeneratedDllImportData.cs b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/GeneratedDllImportData.cs index d3157782f488c8..07d0ddeb1ab74b 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/GeneratedDllImportData.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/GeneratedDllImportData.cs @@ -15,14 +15,11 @@ namespace Microsoft.Interop public enum DllImportMember { None = 0, - BestFitMapping = 1 << 0, - CallingConvention = 1 << 1, - CharSet = 1 << 2, - EntryPoint = 1 << 3, - ExactSpelling = 1 << 4, - PreserveSig = 1 << 5, - SetLastError = 1 << 6, - ThrowOnUnmappableChar = 1 << 7, + CharSet = 1 << 0, + EntryPoint = 1 << 1, + ExactSpelling = 1 << 2, + PreserveSig = 1 << 3, + SetLastError = 1 << 4, All = ~None } @@ -39,13 +36,10 @@ public sealed record GeneratedDllImportData(string ModuleName) /// Value set by the user on the original declaration. /// public DllImportMember IsUserDefined { get; init; } - public bool BestFitMapping { get; init; } - public CallingConvention CallingConvention { get; init; } public CharSet CharSet { get; init; } public string? EntryPoint { get; init; } public bool ExactSpelling { get; init; } public bool PreserveSig { get; init; } public bool SetLastError { get; init; } - public bool ThrowOnUnmappableChar { get; init; } } } diff --git a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Microsoft.Interop.DllImportGenerator.props b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Microsoft.Interop.DllImportGenerator.props index 550d474720ea11..5d64f7df4a8326 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Microsoft.Interop.DllImportGenerator.props +++ b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Microsoft.Interop.DllImportGenerator.props @@ -21,7 +21,4 @@ --> - - $(DefineConstants);DLLIMPORTGENERATOR_ENABLED - diff --git a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/PInvokeStubCodeGenerator.cs b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/PInvokeStubCodeGenerator.cs index 4c9bbd0b1e3920..5da6deb9cc8375 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/PInvokeStubCodeGenerator.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/PInvokeStubCodeGenerator.cs @@ -197,6 +197,15 @@ BoundGenerator CreateGenerator(TypePositionInfo p) { try { + // TODO: Remove once helper types (like ArrayMarshaller) are part of the runtime + // This check is to help with enabling the source generator for runtime libraries without making each + // library directly reference System.Memory and System.Runtime.CompilerServices.Unsafe unless it needs to + if (p.MarshallingAttributeInfo is MissingSupportMarshallingInfo + && (environment.TargetFramework == TargetFramework.Net && environment.TargetFrameworkVersion.Major >= 7)) + { + throw new MarshallingNotSupportedException(p, this); + } + return new BoundGenerator(p, generatorFactory.Create(p, this)); } catch (MarshallingNotSupportedException e) @@ -479,10 +488,10 @@ void GenerateStatementsForInvoke(List statementsToUpdate, Invoc if (fixedStatements.Any()) { fixedStatements.Reverse(); - invokeStatement = fixedStatements.First().WithStatement(invokeStatement); + invokeStatement = fixedStatements.First().AddStatementWithoutEmptyStatements(Block(invokeStatement)); foreach (FixedStatementSyntax fixedStatement in fixedStatements.Skip(1)) { - invokeStatement = fixedStatement.WithStatement(Block(invokeStatement)); + invokeStatement = fixedStatement.AddStatementWithoutEmptyStatements(invokeStatement); } } diff --git a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Resources.Designer.cs b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Resources.Designer.cs index 30ad6508d4f170..f44085e2257d9e 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Resources.Designer.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Resources.Designer.cs @@ -348,6 +348,24 @@ internal static string GetPinnableReferenceShouldSupportAllocatingMarshallingFal } } + /// + /// Looks up a localized string similar to The use cases for 'GetPinnableReference' are not applicable in any scenarios where a 'Value' property is not also required.. + /// + internal static string MarshallerGetPinnableReferenceRequiresValuePropertyDescription { + get { + return ResourceManager.GetString("MarshallerGetPinnableReferenceRequiresValuePropertyDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The 'GetPinnableReference' method cannot be provided on the native type '{0}' unless a 'Value' property is also provided. + /// + internal static string MarshallerGetPinnableReferenceRequiresValuePropertyMessage { + get { + return ResourceManager.GetString("MarshallerGetPinnableReferenceRequiresValuePropertyMessage", resourceCulture); + } + } + /// /// Looks up a localized string similar to The native type '{0}' must be a closed generic so the emitted code can use a specific instantiation.. /// diff --git a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Resources.resx b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Resources.resx index e66ea89a005c83..f2acaa98ed1a24 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Resources.resx +++ b/src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/Resources.resx @@ -214,6 +214,12 @@ Type '{0}' has a 'GetPinnableReference' method but its native type does not support marshalling in scenarios where pinning is impossible + + The use cases for 'GetPinnableReference' are not applicable in any scenarios where a 'Value' property is not also required. + + + The 'GetPinnableReference' method cannot be provided on the native type '{0}' unless a 'Value' property is also provided + The native type '{0}' must be a closed generic so the emitted code can use a specific instantiation. diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/ArrayMarshaller.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/ArrayMarshaller.cs index 4e6980a80250fe..ec42fcd838f844 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/ArrayMarshaller.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/ArrayMarshaller.cs @@ -26,7 +26,7 @@ public ArrayMarshaller(IMarshallingGenerator manualMarshallingGenerator, TypeSyn public bool IsSupported(TargetFramework target, Version version) { - return target is TargetFramework.Net && version.Major >= 6; + return target is TargetFramework.Net && version.Major >= 7; } public ArgumentSyntax AsArgument(TypePositionInfo info, StubCodeContext context) diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/AttributedMarshallingModelGeneratorFactory.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/AttributedMarshallingModelGeneratorFactory.cs index 69114bfc341e3d..844899ef7f247f 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/AttributedMarshallingModelGeneratorFactory.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/AttributedMarshallingModelGeneratorFactory.cs @@ -15,21 +15,30 @@ public class AttributedMarshallingModelGeneratorFactory : IMarshallingGeneratorF private static readonly Forwarder s_forwarder = new Forwarder(); private readonly IMarshallingGeneratorFactory _innerMarshallingGenerator; + private readonly IMarshallingGeneratorFactory _elementMarshallingGenerator; - public AttributedMarshallingModelGeneratorFactory(IMarshallingGeneratorFactory innerMarshallingGenerator, InteropGenerationOptions options) + public AttributedMarshallingModelGeneratorFactory( + IMarshallingGeneratorFactory innerMarshallingGenerator, + InteropGenerationOptions options) { Options = options; _innerMarshallingGenerator = innerMarshallingGenerator; - ElementMarshallingGeneratorFactory = this; + // Unless overridden, default to using this generator factory for creating generators for collection elements. + _elementMarshallingGenerator = this; } - public InteropGenerationOptions Options { get; } + public AttributedMarshallingModelGeneratorFactory( + IMarshallingGeneratorFactory innerMarshallingGenerator, + IMarshallingGeneratorFactory elementMarshallingGenerator, + InteropGenerationOptions options) + { + Options = options; + _innerMarshallingGenerator = innerMarshallingGenerator; - /// - /// The to use for collection elements. - /// This property is settable to enable decorating factories to ensure that element marshalling also goes through the decorator support. - /// - public IMarshallingGeneratorFactory ElementMarshallingGeneratorFactory { get; set; } + _elementMarshallingGenerator = elementMarshallingGenerator; + } + + public InteropGenerationOptions Options { get; } public IMarshallingGenerator Create(TypePositionInfo info, StubCodeContext context) { @@ -38,6 +47,7 @@ public IMarshallingGenerator Create(TypePositionInfo info, StubCodeContext conte NativeMarshallingAttributeInfo marshalInfo => CreateCustomNativeTypeMarshaller(info, context, marshalInfo), BlittableTypeAttributeInfo => s_blittable, GeneratedNativeMarshallingAttributeInfo => s_forwarder, + MissingSupportMarshallingInfo => s_forwarder, _ => _innerMarshallingGenerator.Create(info, context) }; } @@ -236,7 +246,7 @@ private IMarshallingGenerator CreateNativeCollectionMarshaller( ICustomNativeTypeMarshallingStrategy marshallingStrategy) { var elementInfo = new TypePositionInfo(collectionInfo.ElementType, collectionInfo.ElementMarshallingInfo) { ManagedIndex = info.ManagedIndex }; - IMarshallingGenerator elementMarshaller = Create( + IMarshallingGenerator elementMarshaller = _elementMarshallingGenerator.Create( elementInfo, new ContiguousCollectionElementMarshallingCodeContext(StubCodeContext.Stage.Setup, string.Empty, context)); TypeSyntax elementType = elementMarshaller.AsNativeType(elementInfo); diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/CharMarshaller.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/CharMarshaller.cs index 4852974aa80537..293b97959d63b1 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/CharMarshaller.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/CharMarshaller.cs @@ -96,7 +96,7 @@ public IEnumerable Generate(TypePositionInfo info, StubCodeCont case StubCodeContext.Stage.Setup: break; case StubCodeContext.Stage.Marshal: - if (info.IsByRef && info.RefKind != RefKind.Out) + if ((info.IsByRef && info.RefKind != RefKind.Out) || !context.SingleFrameSpansNativeContext) { yield return ExpressionStatement( AssignmentExpression( diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/ICustomNativeTypeMarshallingStrategy.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/ICustomNativeTypeMarshallingStrategy.cs index 338c7ee379b0d2..b653006db9cf22 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/ICustomNativeTypeMarshallingStrategy.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/ICustomNativeTypeMarshallingStrategy.cs @@ -235,7 +235,10 @@ public IEnumerable GenerateUnmarshalStatements(TypePositionInfo { var subContext = new CustomNativeTypeWithValuePropertyStubContext(context); - yield return GenerateValuePropertyAssignment(info, context, subContext); + if (info.IsManagedReturnPosition || (info.IsByRef && info.RefKind != RefKind.In)) + { + yield return GenerateValuePropertyAssignment(info, context, subContext); + } foreach (StatementSyntax statement in _innerMarshaller.GenerateUnmarshalStatements(info, subContext)) { @@ -450,7 +453,7 @@ public bool UsesNativeIdentifier(TypePositionInfo info, StubCodeContext context) } /// - /// Marshaller that enables support for a GetPinnableReference method on a native type, with a Value property fallback. + /// Marshaller that calls the GetPinnableReference method on the marshaller value and enables support for the Value property. /// internal sealed class PinnableMarshallerTypeMarshalling : ICustomNativeTypeMarshallingStrategy { @@ -482,7 +485,7 @@ public IEnumerable GenerateCleanupStatements(TypePositionInfo i { var subContext = new CustomNativeTypeWithValuePropertyStubContext(context); - if (!CanPinMarshaller(info, context) && !context.AdditionalTemporaryStateLivesAcrossStages) + if (!context.AdditionalTemporaryStateLivesAcrossStages) { // .Value = ; yield return GenerateValuePropertyAssignment(info, context, subContext); @@ -503,35 +506,34 @@ public IEnumerable GenerateMarshalStatements(TypePositionInfo i } if (!CanPinMarshaller(info, context)) - { - // = .Value; - yield return ExpressionStatement( - AssignmentExpression( - SyntaxKind.SimpleAssignmentExpression, - IdentifierName(context.GetIdentifiers(info).native), - MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, - IdentifierName(subContext.GetIdentifiers(info).native), - IdentifierName(ManualTypeMarshallingHelper.ValuePropertyName)))); - } + yield return GenerateNativeAssignmentFromValueProperty(info, context, subContext); + } + + private static StatementSyntax GenerateNativeAssignmentFromValueProperty(TypePositionInfo info, StubCodeContext context, CustomNativeTypeWithValuePropertyStubContext subContext) + { + // = .Value; + return ExpressionStatement( + AssignmentExpression( + SyntaxKind.SimpleAssignmentExpression, + IdentifierName(context.GetIdentifiers(info).native), + MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, + IdentifierName(subContext.GetIdentifiers(info).native), + IdentifierName(ManualTypeMarshallingHelper.ValuePropertyName)))); } public IEnumerable GeneratePinStatements(TypePositionInfo info, StubCodeContext context) { - // fixed (<_nativeTypeSyntax> = &) + // fixed (<_nativeTypeSyntax> = &) + // var subContext = new CustomNativeTypeWithValuePropertyStubContext(context); yield return FixedStatement( VariableDeclaration( _valuePropertyType, SingletonSeparatedList( - VariableDeclarator(context.GetIdentifiers(info).native) + VariableDeclarator(Identifier(context.GetAdditionalIdentifier(info, "ignored"))) .WithInitializer(EqualsValueClause( - PrefixUnaryExpression(SyntaxKind.AddressOfExpression, - InvocationExpression( - MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, - IdentifierName(subContext.GetIdentifiers(info).native), - IdentifierName(ManualTypeMarshallingHelper.GetPinnableReferenceName)), - ArgumentList())))))), - EmptyStatement()); + IdentifierName(subContext.GetIdentifiers(info).native))))), + GenerateNativeAssignmentFromValueProperty(info, context, subContext)); } public IEnumerable GenerateSetupStatements(TypePositionInfo info, StubCodeContext context) @@ -566,7 +568,7 @@ public IEnumerable GenerateUnmarshalStatements(TypePositionInfo { var subContext = new CustomNativeTypeWithValuePropertyStubContext(context); - if (!CanPinMarshaller(info, context)) + if (info.IsManagedReturnPosition || (info.IsByRef && info.RefKind != RefKind.In)) { // .Value = ; yield return GenerateValuePropertyAssignment(info, context, subContext); @@ -586,10 +588,6 @@ public IEnumerable GetNativeTypeConstructorArguments(TypePositio public bool UsesNativeIdentifier(TypePositionInfo info, StubCodeContext context) { - if (CanPinMarshaller(info, context)) - { - return false; - } return _innerMarshaller.UsesNativeIdentifier(info, context); } } @@ -977,6 +975,18 @@ public IEnumerable GenerateMarshalStatements(TypePositionInfo i if (!info.IsByRef && info.ByValueContentsMarshalKind == ByValueContentsMarshalKind.Out) { // If the parameter is marshalled by-value [Out], then we don't marshal the contents of the collection. + // We do clear the span, so that if the invoke target doesn't fill it, we aren't left with undefined content. + // .NativeValueStorage.Clear(); + string nativeIdentifier = context.GetIdentifiers(info).native; + yield return ExpressionStatement( + InvocationExpression( + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + IdentifierName(nativeIdentifier), + IdentifierName(ManualTypeMarshallingHelper.NativeValueStoragePropertyName)), + IdentifierName("Clear")))); yield break; } diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/MarshallingAttributeInfo.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/MarshallingAttributeInfo.cs index 6924088f311fdf..f5376fda0a85bb 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/MarshallingAttributeInfo.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/MarshallingAttributeInfo.cs @@ -31,6 +31,9 @@ private protected MarshallingInfo() { } } + /// + /// No marshalling information exists for the type. + /// public sealed record NoMarshallingInfo : MarshallingInfo { public static readonly MarshallingInfo Instance = new NoMarshallingInfo(); @@ -38,6 +41,21 @@ public sealed record NoMarshallingInfo : MarshallingInfo private NoMarshallingInfo() { } } + /// + /// Marshalling information is lacking because of support not because it is + /// unknown or non-existent. + /// + /// + /// An indication of "missing support" will trigger the fallback logic, which is + /// the forwarder marshaler. + /// + public sealed record MissingSupportMarshallingInfo : MarshallingInfo + { + public static readonly MarshallingInfo Instance = new MissingSupportMarshallingInfo(); + + private MissingSupportMarshallingInfo() { } + } + /// /// Character encoding enumeration. /// @@ -137,6 +155,7 @@ public sealed record SafeHandleMarshallingInfo(bool AccessibleDefaultConstructor /// /// User-applied System.Runtime.InteropServices.NativeMarshallingAttribute /// with a contiguous collection marshaller + /// public sealed record NativeContiguousCollectionMarshallingInfo( ManagedTypeInfo NativeMarshallingType, ManagedTypeInfo? ValuePropertyType, @@ -543,8 +562,8 @@ private MarshallingInfo CreateInfoFromMarshalAs( if (arrayMarshaller is null) { - // If the array marshaler type is not available, then we cannot marshal arrays. - return NoMarshallingInfo.Instance; + // If the array marshaler type is not available, then we cannot marshal arrays but indicate it is missing. + return MissingSupportMarshallingInfo.Instance; } ITypeSymbol? valuePropertyType = ManualTypeMarshallingHelper.FindValueProperty(arrayMarshaller)?.Type; @@ -741,9 +760,9 @@ private bool TryCreateTypeBasedMarshallingInfo( if (arrayMarshaller is null) { - // If the array marshaler type is not available, then we cannot marshal arrays. - marshallingInfo = NoMarshallingInfo.Instance; - return false; + // If the array marshaler type is not available, then we cannot marshal arrays but indicate it is missing. + marshallingInfo = MissingSupportMarshallingInfo.Instance; + return true; } ITypeSymbol? valuePropertyType = ManualTypeMarshallingHelper.FindValueProperty(arrayMarshaller)?.Type; diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Microsoft.Interop.SourceGeneration.csproj b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Microsoft.Interop.SourceGeneration.csproj index e8f403d2f83294..f5148d44941f1a 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Microsoft.Interop.SourceGeneration.csproj +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Microsoft.Interop.SourceGeneration.csproj @@ -1,7 +1,7 @@  - netstandard2.0 + netstandard2.0 false enable Microsoft.Interop diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/SyntaxExtensions.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/SyntaxExtensions.cs new file mode 100644 index 00000000000000..1b56c2000e7978 --- /dev/null +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/SyntaxExtensions.cs @@ -0,0 +1,33 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; + +namespace Microsoft.Interop +{ + public static class SyntaxExtensions + { + public static FixedStatementSyntax AddStatementWithoutEmptyStatements(this FixedStatementSyntax fixedStatement, StatementSyntax childStatement) + { + if (fixedStatement.Statement.IsKind(SyntaxKind.EmptyStatement)) + { + return fixedStatement.WithStatement(childStatement); + } + if (fixedStatement.Statement.IsKind(SyntaxKind.Block)) + { + var block = (BlockSyntax)fixedStatement.Statement; + if (block.Statements.Count == 0) + { + return fixedStatement.WithStatement(childStatement); + } + return fixedStatement.WithStatement(block.AddStatements(childStatement)); + } + return fixedStatement.WithStatement(SyntaxFactory.Block(fixedStatement.Statement, childStatement)); + } + } +} diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/TypeSymbolExtensions.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/TypeSymbolExtensions.cs index 9768e2d03ce692..4f5aaf0cc7d7fc 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/TypeSymbolExtensions.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/TypeSymbolExtensions.cs @@ -31,7 +31,7 @@ private static bool HasOnlyBlittableFields(this ITypeSymbol type, ImmutableHashS bool fieldBlittable = field switch { { Type: { IsReferenceType: true } } => false, - { Type: IPointerTypeSymbol ptr } => IsConsideredBlittable(ptr.PointedAtType), + { Type: IPointerTypeSymbol ptr } => true, { Type: IFunctionPointerTypeSymbol } => true, not { Type: { SpecialType: SpecialType.None } } => IsSpecialTypeBlittable(field.Type.SpecialType), // Assume that type parameters that can be blittable are blittable. diff --git a/src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/SpanMarshallers.cs b/src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/SpanMarshallers.cs index 453259feeda1b5..d5543df3c88e6c 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/SpanMarshallers.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/Ancillary.Interop/SpanMarshallers.cs @@ -20,20 +20,8 @@ public ReadOnlySpanMarshaller(int sizeOfNativeElement) } public ReadOnlySpanMarshaller(ReadOnlySpan managed, int sizeOfNativeElement) + :this(managed, Span.Empty, sizeOfNativeElement) { - _allocatedMemory = default; - _sizeOfNativeElement = sizeOfNativeElement; - if (managed.Length == 0) - { - _managedSpan = default; - NativeValueStorage = default; - return; - } - _managedSpan = managed; - _sizeOfNativeElement = sizeOfNativeElement; - int spaceToAllocate = managed.Length * sizeOfNativeElement; - _allocatedMemory = Marshal.AllocCoTaskMem(spaceToAllocate); - NativeValueStorage = new Span((void*)_allocatedMemory, spaceToAllocate); } public ReadOnlySpanMarshaller(ReadOnlySpan managed, Span stackSpace, int sizeOfNativeElement) @@ -81,8 +69,7 @@ public byte* Value { get { - Debug.Assert(_managedSpan.IsEmpty || _allocatedMemory != IntPtr.Zero); - return (byte*)_allocatedMemory; + return (byte*)Unsafe.AsPointer(ref GetPinnableReference()); } set { @@ -222,7 +209,7 @@ public byte* Value { if (_inner.ManagedValues.Length == 0) { - return (byte*)0x1; + return (byte*)0xa5a5a5a5; } return _inner.Value; } @@ -293,7 +280,7 @@ public byte* Value { if (_inner.ManagedValues.Length == 0) { - return (byte*)0x1; + return (byte*)0xa5a5a5a5; } return _inner.Value; } @@ -369,8 +356,11 @@ public T* Value { get { - Debug.Assert(_data.IsEmpty || _allocatedMemory != null); - return _allocatedMemory; + if (_allocatedMemory != null) + { + return _allocatedMemory; + } + return (T*)Unsafe.AsPointer(ref GetPinnableReference()); } set { diff --git a/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.Tests/ArrayTests.cs b/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.Tests/ArrayTests.cs index 82039c4fac635c..f4c2dae90a409f 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.Tests/ArrayTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.Tests/ArrayTests.cs @@ -35,6 +35,15 @@ public partial class Arrays [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "create_range_array_out")] public static partial void CreateRange_Out(int start, int end, out int numValues, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] out int[] res); + [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_char_array", CharSet = CharSet.Unicode)] + public static partial int SumChars(char[] chars, int numElements); + + [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "fill_char_array", CharSet = CharSet.Unicode)] + public static partial void FillChars([Out] char[] chars, int length, ushort start); + + [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "reverse_char_array", CharSet = CharSet.Unicode)] + public static partial void ReverseChars([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] ref char[] chars, int numElements); + [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "sum_string_lengths")] public static partial int SumStringLengths([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr)] string[] strArray); @@ -118,6 +127,22 @@ public void IntArrayRefParameter() Assert.Equal((IEnumerable)array, newArray); } + [Fact] + public void CharArrayMarshalledToNativeAsExpected() + { + char[] array = CharacterTests.CharacterMappings().Select(o => (char)o[0]).ToArray(); + Assert.Equal(array.Sum(c => c), NativeExportsNE.Arrays.SumChars(array, array.Length)); + } + + [Fact] + public void CharArrayRefParameter() + { + char[] array = CharacterTests.CharacterMappings().Select(o => (char)o[0]).ToArray(); + var newArray = array; + NativeExportsNE.Arrays.ReverseChars(ref newArray, array.Length); + Assert.Equal(array.Reverse(), newArray); + } + [Fact] public void ArraysReturnedFromNative() { @@ -231,12 +256,34 @@ public void DynamicSizedArrayWithConstantComponent() [Fact] public void ArrayByValueOutParameter() { - var testArray = new IntStructWrapper[10]; - int start = 5; - - NativeExportsNE.Arrays.FillRangeArray(testArray, testArray.Length, start); - - Assert.Equal(Enumerable.Range(start, 10), testArray.Select(wrapper => wrapper.Value)); + { + var testArray = new IntStructWrapper[10]; + int start = 5; + + NativeExportsNE.Arrays.FillRangeArray(testArray, testArray.Length, start); + Assert.Equal(Enumerable.Range(start, testArray.Length), testArray.Select(wrapper => wrapper.Value)); + + // Any items not populated by the invoke target should be initialized to default + testArray = new IntStructWrapper[10]; + int lengthToFill = testArray.Length / 2; + NativeExportsNE.Arrays.FillRangeArray(testArray, lengthToFill, start); + Assert.Equal(Enumerable.Range(start, lengthToFill), testArray[..lengthToFill].Select(wrapper => wrapper.Value)); + Assert.All(testArray[lengthToFill..], wrapper => Assert.Equal(0, wrapper.Value)); + } + { + var testArray = new char[10]; + ushort start = 65; + + NativeExportsNE.Arrays.FillChars(testArray, testArray.Length, start); + Assert.Equal(Enumerable.Range(start, testArray.Length), testArray.Select(c => (int)c)); + + // Any items not populated by the invoke target should be initialized to default + testArray = new char[10]; + int lengthToFill = testArray.Length / 2; + NativeExportsNE.Arrays.FillChars(testArray, lengthToFill, start); + Assert.Equal(Enumerable.Range(start, lengthToFill), testArray[..lengthToFill].Select(c => (int)c)); + Assert.All(testArray[lengthToFill..], c => Assert.Equal(0, c)); + } } [Fact] diff --git a/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.Tests/BlittableStructTests.cs b/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.Tests/BlittableStructTests.cs index 5aa24bf1af91ab..8fcc27093bb798 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.Tests/BlittableStructTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.Tests/BlittableStructTests.cs @@ -29,12 +29,23 @@ public static partial void DoubleIntFieldsRefReturn( public static partial void DoubleIntFieldsOutReturn( IntFields input, out IntFields result); + + [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_byref")] + public static partial void IncrementInvertPointerFieldsByRef(ref PointerFields result); + + [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_byref")] + public static partial void IncrementInvertPointerFieldsByRefIn(in PointerFields result); + + [GeneratedDllImport(NativeExportsNE_Binary, EntryPoint = "blittablestructs_increment_invert_ptrfields_refreturn")] + public static partial void IncrementInvertPointerFieldsRefReturn( + PointerFields input, + ref PointerFields result); } public class BlittableStructTests { [Fact] - public void ValidateBlittableStruct() + public void ValidateIntFields() { const int A = 24, B = 37, C = 59; var initial = new IntFields() @@ -82,5 +93,71 @@ public void ValidateBlittableStruct() Assert.Equal(expected, input); // Updated even when passed with in keyword (matches built-in system) } } + + [Fact] + public unsafe void ValidatePointerFields() + { + int iInitial = 31; + bool bInitial = false; + char cInitial = 'A'; + + int iExpected = iInitial + 1; + bool bExpected = !bInitial; + char cExpected = (char)(cInitial + 1); + + int i = iInitial; + bool b = bInitial; + char c = cInitial; + var initial = new PointerFields() + { + i = &i, + b = &b, + c = &c, + }; + + PointerFields input = initial; + { + int iResult; + bool bResult; + char cResult; + var result = new PointerFields() + { + i = &iResult, + b = &bResult, + c = &cResult + }; + NativeExportsNE.IncrementInvertPointerFieldsRefReturn(input, ref result); + Assert.Equal(initial, input); + ValidateFieldValues(result); + } + + { + ResetFieldValues(input); + NativeExportsNE.IncrementInvertPointerFieldsByRef(ref input); + Assert.Equal(initial, input); + ValidateFieldValues(input); + } + + { + ResetFieldValues(input); + NativeExportsNE.IncrementInvertPointerFieldsByRefIn(in input); + Assert.Equal(initial, input); + ValidateFieldValues(input); + } + + void ResetFieldValues(PointerFields input) + { + *(input.i) = iInitial; + *(input.b) = bInitial; + *(input.c) = cInitial; + } + + void ValidateFieldValues(PointerFields result) + { + Assert.Equal(iExpected, *result.i); + Assert.Equal(bExpected, *result.b); + Assert.Equal(cExpected, *result.c); + } + } } } diff --git a/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.Tests/DllImportGenerator.Tests.csproj b/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.Tests/DllImportGenerator.Tests.csproj index 351241b66278d6..94877b6888cce9 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.Tests/DllImportGenerator.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.Tests/DllImportGenerator.Tests.csproj @@ -18,8 +18,6 @@ - - diff --git a/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/CodeSnippets.cs b/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/CodeSnippets.cs index ce3a00f98292ed..42d3d9c49c8c00 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/CodeSnippets.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/CodeSnippets.cs @@ -184,29 +184,9 @@ partial class Test "; /// - /// Declaration with all DllImport named arguments. + /// Declaration with all GeneratedDllImport named arguments. /// - public static readonly string AllDllImportNamedArguments = @" -using System.Runtime.InteropServices; -partial class Test -{ - [GeneratedDllImport(""DoesNotExist"", - BestFitMapping = false, - CallingConvention = CallingConvention.Cdecl, - CharSet = CharSet.Unicode, - EntryPoint = ""UserDefinedEntryPoint"", - ExactSpelling = true, - PreserveSig = false, - SetLastError = true, - ThrowOnUnmappableChar = true)] - public static partial void Method(); -} -"; - - /// - /// Declaration with all supported DllImport named arguments. - /// - public static readonly string AllSupportedDllImportNamedArguments = @" + public static readonly string AllGeneratedDllImportNamedArguments = @" using System.Runtime.InteropServices; partial class Test { diff --git a/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/CompileFails.cs b/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/CompileFails.cs index 954009db80d67d..a69af4566275bf 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/CompileFails.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/CompileFails.cs @@ -58,10 +58,6 @@ public static IEnumerable CodeSnippetsToCompile() yield return new object[] { CodeSnippets.ByValueParameterWithModifier("Out"), 1, 0 }; yield return new object[] { CodeSnippets.ByValueParameterWithModifier("In, Out"), 1, 0 }; - // Unsupported named arguments - // * BestFitMapping, ThrowOnUnmappableChar, CallingConvention - yield return new object[] { CodeSnippets.AllDllImportNamedArguments, 3, 0 }; - // LCIDConversion yield return new object[] { CodeSnippets.LCIDConversionAttribute, 1, 0 }; diff --git a/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/Compiles.cs b/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/Compiles.cs index aee1904683418f..0572d1dd207619 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/Compiles.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/Compiles.cs @@ -24,7 +24,7 @@ public static IEnumerable CodeSnippetsToCompile() yield return new[] { CodeSnippets.NestedTypes }; yield return new[] { CodeSnippets.UnsafeContext }; yield return new[] { CodeSnippets.UserDefinedEntryPoint }; - yield return new[] { CodeSnippets.AllSupportedDllImportNamedArguments }; + yield return new[] { CodeSnippets.AllGeneratedDllImportNamedArguments }; yield return new[] { CodeSnippets.DefaultParameters }; yield return new[] { CodeSnippets.UseCSharpFeaturesForConstants }; @@ -323,6 +323,15 @@ public static IEnumerable CodeSnippetsToValidateFallbackForwarder() yield return new object[] { code, TestTargetFramework.Framework, false }; } + // Confirm that all unsupported target frameworks fallback to a forwarder. + { + string code = CodeSnippets.BasicParametersAndModifiers(CodeSnippets.GeneratedDllImportAttributeDeclaration); + yield return new object[] { code, TestTargetFramework.Net5, true }; + yield return new object[] { code, TestTargetFramework.Core, true }; + yield return new object[] { code, TestTargetFramework.Standard, true }; + yield return new object[] { code, TestTargetFramework.Framework, true }; + } + // Confirm that all unsupported target frameworks fallback to a forwarder. { string code = CodeSnippets.BasicParametersAndModifiersWithCharSet(CharSet.Unicode, CodeSnippets.GeneratedDllImportAttributeDeclaration); @@ -399,7 +408,7 @@ public async Task ValidateSnippetsWithBlittableAutoForwarding(string source) public static IEnumerable SnippetsWithBlittableTypesButNonBlittableDataToCompile() { - yield return new[] { CodeSnippets.AllSupportedDllImportNamedArguments }; + yield return new[] { CodeSnippets.AllGeneratedDllImportNamedArguments }; yield return new[] { CodeSnippets.BasicParametersAndModifiers() }; yield return new[] { CodeSnippets.PreserveSigFalse() }; } diff --git a/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/ConvertToGeneratedDllImportAnalyzerTests.cs b/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/ConvertToGeneratedDllImportAnalyzerTests.cs index 9abd0bda4b3bbf..30465b08c68921 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/ConvertToGeneratedDllImportAnalyzerTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/ConvertToGeneratedDllImportAnalyzerTests.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Runtime.InteropServices; using System.Threading.Tasks; using Microsoft.CodeAnalysis; @@ -153,6 +154,29 @@ public async Task UnsupportedType_NoDiagnostic(Type type) await VerifyCS.VerifyAnalyzerAsync(source); } + [ConditionalTheory] + [InlineData(UnmanagedType.Interface)] + [InlineData(UnmanagedType.IDispatch)] + [InlineData(UnmanagedType.IInspectable)] + [InlineData(UnmanagedType.IUnknown)] + [InlineData(UnmanagedType.SafeArray)] + public async Task UnsupportedUnmanagedType_NoDiagnostic(UnmanagedType unmanagedType) + { + string source = $@" +using System.Runtime.InteropServices; +unsafe partial class Test +{{ + [DllImport(""DoesNotExist"")] + public static extern void Method_Parameter([MarshalAs(UnmanagedType.{unmanagedType}, MarshalType = ""DNE"")]int p); + + [DllImport(""DoesNotExist"")] + [return: MarshalAs(UnmanagedType.{unmanagedType}, MarshalType = ""DNE"")] + public static extern int Method_Return(); +}} +"; + await VerifyCS.VerifyAnalyzerAsync(source); + } + [ConditionalFact] public async Task GeneratedDllImport_NoDiagnostic() { diff --git a/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/ManualTypeMarshallingAnalyzerTests.cs b/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/ManualTypeMarshallingAnalyzerTests.cs index ba00865d9f3ae2..2a7d42b2d63cb1 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/ManualTypeMarshallingAnalyzerTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/DllImportGenerator.UnitTests/ManualTypeMarshallingAnalyzerTests.cs @@ -448,6 +448,70 @@ public Native(S s) : this() public S ToManaged() => new S(); + public IntPtr Value { get => IntPtr.Zero; set {} } +}"; + + await VerifyCS.VerifyAnalyzerAsync(source); + } + + [ConditionalFact] + public async Task NonBlittableMarshallerGetPinnableReferenceReturnType_DoesNotReportDiagnostic() + { + string source = @" +using System; +using System.Runtime.InteropServices; + +[NativeMarshalling(typeof(Native))] +class S +{ + public char c; +} + +unsafe struct Native +{ + private IntPtr value; + + public Native(S s) + { + value = IntPtr.Zero; + } + + public ref char GetPinnableReference() => ref System.Runtime.CompilerServices.Unsafe.NullRef(); + + public S ToManaged() => new S(); + + public IntPtr Value { get => IntPtr.Zero; set {} } +}"; + + await VerifyCS.VerifyAnalyzerAsync(source); + } + + [ConditionalFact] + public async Task BlittableMarshallerGetPinnableReferenceReturnType_DoesNotReportDiagnostic() + { + string source = @" +using System; +using System.Runtime.InteropServices; + +[NativeMarshalling(typeof(Native))] +class S +{ + public byte c; +} + +unsafe struct Native +{ + private IntPtr value; + + public Native(S s) : this() + { + value = IntPtr.Zero; + } + + public S ToManaged() => new S(); + + public ref byte GetPinnableReference() => ref System.Runtime.CompilerServices.Unsafe.NullRef(); + public IntPtr Value { get => IntPtr.Zero; set {} } }"; @@ -520,7 +584,7 @@ public Native(S s) : this() } [ConditionalFact] - public async Task TypeWithGetPinnableReferenceByRefReturnType_ReportsDiagnostic() + public async Task TypeWithGetPinnableReferenceByRefValuePropertyType_ReportsDiagnostic() { string source = @" using System; @@ -551,7 +615,7 @@ await VerifyCS.VerifyAnalyzerAsync(source, } [ConditionalFact] - public async Task NativeTypeWithGetPinnableReferenceByRefReturnType_ReportsDiagnostic() + public async Task NativeTypeWithGetPinnableReferenceByRefValuePropertyType_ReportsDiagnostic() { string source = @" using System; @@ -581,6 +645,67 @@ await VerifyCS.VerifyAnalyzerAsync(source, VerifyCS.Diagnostic(RefValuePropertyUnsupportedRule).WithLocation(0).WithArguments("Native")); } + [ConditionalFact] + public async Task NativeTypeWithGetPinnableReferenceNoValueProperty_ReportsDiagnostic() + { + string source = @" +using System; +using System.Runtime.InteropServices; + +[NativeMarshalling(typeof(Native))] +class S +{ + public byte c; +} + +[BlittableType] +unsafe struct Native +{ + private byte value; + + public Native(S s) : this() + { + value = s.c; + } + + public ref byte {|#0:GetPinnableReference|}() => ref System.Runtime.CompilerServices.Unsafe.NullRef(); +}"; + + await VerifyCS.VerifyAnalyzerAsync(source, + VerifyCS.Diagnostic(MarshallerGetPinnableReferenceRequiresValuePropertyRule).WithLocation(0).WithArguments("Native")); + } + + [ConditionalFact] + public async Task NativeTypeWithGetPinnableReferenceWithNonPointerValueProperty_DoesNotReportDiagnostic() + { + string source = @" +using System; +using System.Runtime.InteropServices; + +[NativeMarshalling(typeof(Native))] +class S +{ + public byte c; +} + +[BlittableType] +unsafe struct Native +{ + private byte value; + + public Native(S s) : this() + { + value = s.c; + } + + public ref byte GetPinnableReference() => ref System.Runtime.CompilerServices.Unsafe.NullRef(); + + public int Value { get; set; } +}"; + + await VerifyCS.VerifyAnalyzerAsync(source); + } + [ConditionalFact] public async Task BlittableValueTypeWithNoFields_DoesNotReportDiagnostic() { @@ -1280,7 +1405,7 @@ public Native(S s) } [ConditionalFact] - public async Task ValueTypeContainingPointerBlittableType_DoesNotReportDiagnostic() + public async Task ValueTypeContainingPointers_DoesNotReportDiagnostic() { var source = @" using System.Runtime.InteropServices; @@ -1288,26 +1413,12 @@ public async Task ValueTypeContainingPointerBlittableType_DoesNotReportDiagnosti [BlittableType] unsafe struct S { - private int* ptr; + private int* intPtr; + private bool* boolPtr; }"; await VerifyCS.VerifyAnalyzerAsync(source); } - [ConditionalFact] - public async Task ValueTypeContainingPointerToNonBlittableType_ReportsDiagnostic() - { - var source = @" -using System.Runtime.InteropServices; - -[{|#0:BlittableType|}] -unsafe struct S -{ - private bool* ptr; -}"; - await VerifyCS.VerifyAnalyzerAsync(source, - VerifyCS.Diagnostic(BlittableTypeMustBeBlittableRule).WithLocation(0).WithArguments("S")); - } - [ConditionalFact] public async Task BlittableValueTypeContainingPointerToSelf_DoesNotReportDiagnostic() { diff --git a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/StructureToPtrTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/StructureToPtrTests.cs index f174ab1cb03f62..ea55d5c177c54e 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/StructureToPtrTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/Marshal/StructureToPtrTests.cs @@ -256,6 +256,30 @@ public unsafe void StructureToPtr_OpaqueStruct_In_NonBlittableStructure_Success( Assert.Equal(*opaqueData, *marshaledOpaqueData); } + [Fact] + public void StructureToPtr_Flat_And_Nested_NonBlittableStructure_Success() + { + MarshalAndDestroy(new NonBlittableStruct_Flat + { + del = null, + b = 0x55, + }); + + MarshalAndDestroy(new NonBlittableStruct_Nested + { + s = { del = null }, + b = 0x55, + }); + + static unsafe void MarshalAndDestroy(T value) where T : struct + { + int sizeof_T = Marshal.SizeOf(); + void* ptr = stackalloc byte[sizeof_T]; + Marshal.StructureToPtr(value, (IntPtr)ptr, false); + Marshal.DestroyStructure((IntPtr)ptr); + } + } + public struct StructWithIntField { public int value; @@ -318,5 +342,22 @@ public struct NonBlittableWithOpaque public OpaqueStruct opaque; public string str; } + + public struct NonBlittableStruct_Flat + { + public Delegate del; + public byte b; + } + + public struct NonBlittableStruct_Nested + { + public struct InnerStruct + { + public Delegate del; + } + + public InnerStruct s; + public byte b; + } } } diff --git a/src/libraries/System.Runtime.InteropServices/tests/TestAssets/NativeExports/Arrays.cs b/src/libraries/System.Runtime.InteropServices/tests/TestAssets/NativeExports/Arrays.cs index 3e11f6c91298ee..bb17e028c150ca 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/TestAssets/NativeExports/Arrays.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/TestAssets/NativeExports/Arrays.cs @@ -90,6 +90,49 @@ public static void DoubleValues([DNNE.C99Type("struct int_struct_wrapper*")] Int } } + [UnmanagedCallersOnly(EntryPoint = "sum_char_array")] + public static int SumChars(ushort* values, int numValues) + { + if (values == null) + { + return -1; + } + + int sum = 0; + for (int i = 0; i < numValues; i++) + { + sum += values[i]; + } + return sum; + } + + [UnmanagedCallersOnly(EntryPoint = "fill_char_array")] + public static void FillChars(ushort* values, int length, ushort start) + { + if (values == null) + { + return; + } + + ushort val = start; + for (int i = 0; i < length; i++) + { + values[i] = val++; + } + } + + [UnmanagedCallersOnly(EntryPoint = "reverse_char_array")] + public static void ReverseChars(ushort** values, int numValues) + { + if (*values == null) + { + return; + } + + var span = new Span(*values, numValues); + span.Reverse(); + } + [UnmanagedCallersOnly(EntryPoint = "sum_string_lengths")] public static int SumStringLengths(ushort** strArray) { diff --git a/src/libraries/System.Runtime.InteropServices/tests/TestAssets/NativeExports/BlittableStructs.cs b/src/libraries/System.Runtime.InteropServices/tests/TestAssets/NativeExports/BlittableStructs.cs index f9dbaf9b7e015c..71b3ae5d2efbb0 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/TestAssets/NativeExports/BlittableStructs.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/TestAssets/NativeExports/BlittableStructs.cs @@ -40,5 +40,25 @@ public static void DoubleIntFieldsRefReturn( result->b = input.b * 2; result->c = input.c * 2; } + + [UnmanagedCallersOnly(EntryPoint = "blittablestructs_increment_invert_ptrfields_byref")] + [DNNE.C99DeclCode("struct ptr_fields { int* i; int* b; uint16_t* c; };")] + public static void IncrementInvertPointerFieldsByRef( + [DNNE.C99Type("struct ptr_fields*")] PointerFields* result) + { + *(result->i) += 1; + *(result->b) = !*(result->b); + *(result->c) += (char)1; + } + + [UnmanagedCallersOnly(EntryPoint = "blittablestructs_increment_invert_ptrfields_refreturn")] + public static void IncrementInvertPointerFieldsRefReturn( + [DNNE.C99Type("struct ptr_fields")] PointerFields input, + [DNNE.C99Type("struct ptr_fields*")] PointerFields* result) + { + *(result->i) = *(input.i) + 1; + *(result->b) = !(*input.b); + *(result->c) = (char)(*(input.c) + 1); + } } } diff --git a/src/libraries/System.Runtime.InteropServices/tests/TestAssets/SharedTypes/Blittable.cs b/src/libraries/System.Runtime.InteropServices/tests/TestAssets/SharedTypes/Blittable.cs index dec9f74ab49239..fc25816928f6f1 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/TestAssets/SharedTypes/Blittable.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/TestAssets/SharedTypes/Blittable.cs @@ -13,4 +13,12 @@ public struct IntFields public int b; public int c; } + + [BlittableType] + public unsafe struct PointerFields + { + public int* i; + public bool* b; + public char* c; + } } diff --git a/src/libraries/System.Runtime.InteropServices/tests/TestAssets/SharedTypes/NonBlittable.cs b/src/libraries/System.Runtime.InteropServices/tests/TestAssets/SharedTypes/NonBlittable.cs index 5d46f83e845ed1..4969c5465944eb 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/TestAssets/SharedTypes/NonBlittable.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/TestAssets/SharedTypes/NonBlittable.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; namespace SharedTypes @@ -121,44 +122,42 @@ public void FreeNative() public unsafe ref struct Utf16StringMarshaler { - private ushort* ptr; + private ushort* allocated; private Span span; + private bool isNullString; public Utf16StringMarshaler(string str) + : this(str, default(Span)) { - ptr = str is null ? null : (ushort*)Marshal.StringToCoTaskMemUni(str); - span = default; } public Utf16StringMarshaler(string str, Span buffer) { + isNullString = false; if (str is null) { - ptr = null; + allocated = null; span = default; + isNullString = true; } - else if ((str.Length + 1) < StackBufferSize) + else if ((str.Length + 1) < buffer.Length) { span = MemoryMarshal.Cast(buffer); str.AsSpan().CopyTo(MemoryMarshal.Cast(buffer)); // Supplied memory is in an undefined state so ensure // there is a trailing null in the buffer. span[str.Length] = '\0'; - ptr = null; + allocated = null; } else { - span = default; - ptr = (ushort*)Marshal.StringToCoTaskMemUni(str); + allocated = (ushort*)Marshal.StringToCoTaskMemUni(str); + span = new Span(allocated, str.Length + 1); } } public ref ushort GetPinnableReference() { - if (ptr != null) - { - return ref *ptr; - } return ref span.GetPinnableReference(); } @@ -166,46 +165,37 @@ public ushort* Value { get { - if (ptr == null && span != default) - { - throw new InvalidOperationException(); - } - return ptr; + return (ushort*)Unsafe.AsPointer(ref GetPinnableReference()); } set { - ptr = value; - span = default; + allocated = value; + span = new Span(value, value == null ? 0 : FindStringLength(value)); + isNullString = value == null; + + static int FindStringLength(ushort* ptr) + { + // Implemented similarly to string.wcslen as we can't access that outside of CoreLib + var searchSpace = new Span(ptr, int.MaxValue); + return searchSpace.IndexOf((ushort)0); + } } } public string ToManaged() { - if (ptr == null && span == default) - { - return null; - } - else if (ptr != null) - { - return Marshal.PtrToStringUni((IntPtr)ptr); - } - else - { - return MemoryMarshal.Cast(span).ToString(); - } + return isNullString ? null : MemoryMarshal.Cast(span).ToString(); } public void FreeNative() { - if (ptr != null) - { - Marshal.FreeCoTaskMem((IntPtr)ptr); - } + Marshal.FreeCoTaskMem((IntPtr)allocated); } public const int StackBufferSize = 0x100; } + [NativeMarshalling(typeof(IntStructWrapperNative))] public struct IntStructWrapper { @@ -237,21 +227,8 @@ public ListMarshaller(int sizeOfNativeElement) } public ListMarshaller(List managed, int sizeOfNativeElement) + :this(managed, Span.Empty, sizeOfNativeElement) { - allocatedMemory = default; - this.sizeOfNativeElement = sizeOfNativeElement; - if (managed is null) - { - managedList = null; - NativeValueStorage = default; - return; - } - managedList = managed; - this.sizeOfNativeElement = sizeOfNativeElement; - // Always allocate at least one byte when the array is zero-length. - int spaceToAllocate = Math.Max(managed.Count * sizeOfNativeElement, 1); - allocatedMemory = Marshal.AllocCoTaskMem(spaceToAllocate); - NativeValueStorage = new Span((void*)allocatedMemory, spaceToAllocate); } public ListMarshaller(List managed, Span stackSpace, int sizeOfNativeElement) @@ -265,7 +242,7 @@ public ListMarshaller(List managed, Span stackSpace, int sizeOfNativeEl return; } managedList = managed; - // Always allocate at least one byte when the array is zero-length. + // Always allocate at least one byte when the list is zero-length. int spaceToAllocate = Math.Max(managed.Count * sizeOfNativeElement, 1); if (spaceToAllocate <= stackSpace.Length) { @@ -304,8 +281,7 @@ public byte* Value { get { - Debug.Assert(managedList is null || allocatedMemory != IntPtr.Zero); - return (byte*)allocatedMemory; + return (byte*)Unsafe.AsPointer(ref GetPinnableReference()); } set { @@ -326,10 +302,7 @@ public byte* Value public void FreeNative() { - if (allocatedMemory != IntPtr.Zero) - { - Marshal.FreeCoTaskMem(allocatedMemory); - } + Marshal.FreeCoTaskMem(allocatedMemory); } } } diff --git a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs index d4bb25487ad490..c71ed7d1fd624c 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -2840,6 +2840,7 @@ internal ArmBase() { } public static int LeadingZeroCount(uint value) { throw null; } public static int ReverseElementBits(int value) { throw null; } public static uint ReverseElementBits(uint value) { throw null; } + public static void Yield() { throw null; } public abstract partial class Arm64 { internal Arm64() { } @@ -3653,7 +3654,6 @@ internal X64() { } public static new bool IsSupported { get { throw null; } } } } - [System.CLSCompliantAttribute(false)] [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("AvxVnni is in preview.")] public abstract class AvxVnni : System.Runtime.Intrinsics.X86.Avx2 @@ -3674,7 +3674,6 @@ internal X64() { } public static new bool IsSupported { get { throw null; } } } } - [System.CLSCompliantAttribute(false)] public abstract partial class Bmi1 : System.Runtime.Intrinsics.X86.X86Base { @@ -4497,6 +4496,7 @@ public abstract partial class X86Base internal X86Base() { } public static bool IsSupported { get { throw null; } } public static (int Eax, int Ebx, int Ecx, int Edx) CpuId(int functionId, int subFunctionId) { throw null; } + public static void Pause() { throw null; } public abstract partial class X64 { internal X64() { } diff --git a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddLambdaCapturingThis/AddLambdaCapturingThis.cs b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddLambdaCapturingThis/AddLambdaCapturingThis.cs new file mode 100644 index 00000000000000..186144e290e354 --- /dev/null +++ b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddLambdaCapturingThis/AddLambdaCapturingThis.cs @@ -0,0 +1,25 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +using System; + + +namespace System.Reflection.Metadata.ApplyUpdate.Test +{ + public class AddLambdaCapturingThis + { + public AddLambdaCapturingThis () { + field = "abcd"; + } + + public string GetField => field; + + private string field; + + public string TestMethod () { + // capture 'this' but no locals + Func fn = s => field; + return "123"; + } + + } +} diff --git a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddLambdaCapturingThis/AddLambdaCapturingThis_v1.cs b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddLambdaCapturingThis/AddLambdaCapturingThis_v1.cs new file mode 100644 index 00000000000000..22dd869021dc3f --- /dev/null +++ b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddLambdaCapturingThis/AddLambdaCapturingThis_v1.cs @@ -0,0 +1,29 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +using System; + + +namespace System.Reflection.Metadata.ApplyUpdate.Test +{ + public class AddLambdaCapturingThis + { + public AddLambdaCapturingThis () { + field = "abcd"; + } + + public string GetField => field; + + private string field; + + public string TestMethod () { + // capture 'this' but no locals + Func fn = s => NewMethod (s + field, 42); + return fn ("123"); + } + + private string NewMethod (string s, int i) { + return i.ToString() + s; + } + + } +} diff --git a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddLambdaCapturingThis/System.Reflection.Metadata.ApplyUpdate.Test.AddLambdaCapturingThis.csproj b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddLambdaCapturingThis/System.Reflection.Metadata.ApplyUpdate.Test.AddLambdaCapturingThis.csproj new file mode 100644 index 00000000000000..88c636e683cf6d --- /dev/null +++ b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddLambdaCapturingThis/System.Reflection.Metadata.ApplyUpdate.Test.AddLambdaCapturingThis.csproj @@ -0,0 +1,11 @@ + + + System.Runtime.Loader.Tests + $(NetCoreAppCurrent) + true + deltascript.json + + + + + diff --git a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddLambdaCapturingThis/deltascript.json b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddLambdaCapturingThis/deltascript.json new file mode 100644 index 00000000000000..1e618dede36469 --- /dev/null +++ b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddLambdaCapturingThis/deltascript.json @@ -0,0 +1,6 @@ +{ + "changes": [ + {"document": "AddLambdaCapturingThis.cs", "update": "AddLambdaCapturingThis_v1.cs"}, + ] +} + diff --git a/src/libraries/System.Runtime.Loader/tests/ApplyUpdateTest.cs b/src/libraries/System.Runtime.Loader/tests/ApplyUpdateTest.cs index 3e240e65caabf8..dd5c49c3963352 100644 --- a/src/libraries/System.Runtime.Loader/tests/ApplyUpdateTest.cs +++ b/src/libraries/System.Runtime.Loader/tests/ApplyUpdateTest.cs @@ -14,7 +14,7 @@ namespace System.Reflection.Metadata /// script that applies one or more updates to Foo.dll The ApplyUpdateTest /// testsuite runs each test in sequence, loading the corresponding /// assembly, applying an update to it and observing the results. - [Collection(nameof(ApplyUpdateUtil.NoParallelTests))] + [Collection(nameof(DisableParallelization))] public class ApplyUpdateTest { [ConditionalFact(typeof(ApplyUpdateUtil), nameof (ApplyUpdateUtil.IsSupported))] @@ -263,6 +263,26 @@ public void AsyncMethodChanges() }); } + [ActiveIssue ("https://github.com/dotnet/runtime/issues/50249", TestRuntimes.Mono)] + [ConditionalFact(typeof(ApplyUpdateUtil), nameof(ApplyUpdateUtil.IsSupported))] + public static void TestAddLambdaCapturingThis() + { + ApplyUpdateUtil.TestCase(static () => + { + var assm = typeof(System.Reflection.Metadata.ApplyUpdate.Test.AddLambdaCapturingThis).Assembly; + + var x = new System.Reflection.Metadata.ApplyUpdate.Test.AddLambdaCapturingThis(); + + Assert.Equal("123", x.TestMethod()); + + ApplyUpdateUtil.ApplyUpdate(assm); + + string result = x.TestMethod(); + Assert.Equal("42123abcd", result); + }); + } + + class NonRuntimeAssembly : Assembly { } diff --git a/src/libraries/System.Runtime.Loader/tests/ApplyUpdateUtil.cs b/src/libraries/System.Runtime.Loader/tests/ApplyUpdateUtil.cs index 36d04c42604cf8..beaa4a0e7338bb 100644 --- a/src/libraries/System.Runtime.Loader/tests/ApplyUpdateUtil.cs +++ b/src/libraries/System.Runtime.Loader/tests/ApplyUpdateUtil.cs @@ -12,9 +12,6 @@ public class ApplyUpdateUtil { internal const string DotNetModifiableAssembliesSwitch = "DOTNET_MODIFIABLE_ASSEMBLIES"; internal const string DotNetModifiableAssembliesValue = "debug"; - [CollectionDefinition("NoParallelTests", DisableParallelization = true)] - public class NoParallelTests { } - /// Whether ApplyUpdate is supported by the environment, test configuration, and runtime. /// /// We need: diff --git a/src/libraries/System.Runtime.Loader/tests/System.Runtime.Loader.Tests.csproj b/src/libraries/System.Runtime.Loader/tests/System.Runtime.Loader.Tests.csproj index 19e5d6bc5069b0..8c95424f15e577 100644 --- a/src/libraries/System.Runtime.Loader/tests/System.Runtime.Loader.Tests.csproj +++ b/src/libraries/System.Runtime.Loader/tests/System.Runtime.Loader.Tests.csproj @@ -20,6 +20,7 @@ + @@ -43,6 +44,7 @@ + @@ -60,6 +62,7 @@ + diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/SerializationTypes.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/SerializationTypes.cs index bc10a370b033cd..747f661129a94a 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/SerializationTypes.cs +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/SerializationTypes.cs @@ -47,6 +47,16 @@ public static bool AreEqual(SimpleType x, SimpleType y) return (x.P1 == y.P1) && (x.P2 == y.P2); } } + + public override bool Equals(object? obj) + { + if (obj is SimpleType st) + return AreEqual(this, st); + + return base.Equals(obj); + } + + public override int GetHashCode() => base.GetHashCode(); } public class TypeWithGetSetArrayMembers diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index bd2e0d81869b2b..5da725f34f7277 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -285,6 +285,8 @@ public ArgumentNullException(string? paramName) { } public ArgumentNullException(string? message, System.Exception? innerException) { } public ArgumentNullException(string? paramName, string? message) { } public static void ThrowIfNull([System.Diagnostics.CodeAnalysis.NotNullAttribute] object? argument, [System.Runtime.CompilerServices.CallerArgumentExpressionAttribute("argument")] string? paramName = null) { throw null; } + [System.CLSCompliant(false)] + public static unsafe void ThrowIfNull([System.Diagnostics.CodeAnalysis.NotNullAttribute] void* argument, [System.Runtime.CompilerServices.CallerArgumentExpressionAttribute("argument")] string? paramName = null) { throw null; } } public partial class ArgumentOutOfRangeException : System.ArgumentException { @@ -8655,6 +8657,77 @@ void System.Collections.IList.Insert(int index, object? value) { } void System.Collections.IList.Remove(object? value) { } void System.Collections.IList.RemoveAt(int index) { } } + public partial class ReadOnlyDictionary : 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 ReadOnlyDictionary(System.Collections.Generic.IDictionary dictionary) { } + public int Count { get { throw null; } } + protected System.Collections.Generic.IDictionary Dictionary { get { throw null; } } + public TValue this[TKey key] { get { throw null; } } + public System.Collections.ObjectModel.ReadOnlyDictionary.KeyCollection Keys { get { throw null; } } + bool System.Collections.Generic.ICollection>.IsReadOnly { get { throw null; } } + TValue System.Collections.Generic.IDictionary.this[TKey key] { get { throw null; } set { } } + System.Collections.Generic.ICollection System.Collections.Generic.IDictionary.Keys { get { throw null; } } + System.Collections.Generic.ICollection System.Collections.Generic.IDictionary.Values { get { throw null; } } + System.Collections.Generic.IEnumerable System.Collections.Generic.IReadOnlyDictionary.Keys { get { throw null; } } + System.Collections.Generic.IEnumerable System.Collections.Generic.IReadOnlyDictionary.Values { get { throw null; } } + bool System.Collections.ICollection.IsSynchronized { get { throw null; } } + object System.Collections.ICollection.SyncRoot { get { throw null; } } + bool System.Collections.IDictionary.IsFixedSize { get { throw null; } } + bool System.Collections.IDictionary.IsReadOnly { get { throw null; } } + object? System.Collections.IDictionary.this[object key] { get { throw null; } set { } } + System.Collections.ICollection System.Collections.IDictionary.Keys { get { throw null; } } + System.Collections.ICollection System.Collections.IDictionary.Values { get { throw null; } } + public System.Collections.ObjectModel.ReadOnlyDictionary.ValueCollection Values { get { throw null; } } + public bool ContainsKey(TKey key) { throw null; } + public System.Collections.Generic.IEnumerator> GetEnumerator() { throw null; } + void System.Collections.Generic.ICollection>.Add(System.Collections.Generic.KeyValuePair item) { } + void System.Collections.Generic.ICollection>.Clear() { } + bool System.Collections.Generic.ICollection>.Contains(System.Collections.Generic.KeyValuePair item) { throw null; } + void System.Collections.Generic.ICollection>.CopyTo(System.Collections.Generic.KeyValuePair[] array, int arrayIndex) { } + bool System.Collections.Generic.ICollection>.Remove(System.Collections.Generic.KeyValuePair item) { throw null; } + void System.Collections.Generic.IDictionary.Add(TKey key, TValue value) { } + bool System.Collections.Generic.IDictionary.Remove(TKey key) { throw null; } + void System.Collections.ICollection.CopyTo(System.Array array, int index) { } + void System.Collections.IDictionary.Add(object key, object? value) { } + void System.Collections.IDictionary.Clear() { } + bool System.Collections.IDictionary.Contains(object key) { throw null; } + System.Collections.IDictionaryEnumerator System.Collections.IDictionary.GetEnumerator() { throw null; } + void System.Collections.IDictionary.Remove(object key) { } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + public bool TryGetValue(TKey key, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TValue value) { throw null; } + public sealed partial class KeyCollection : System.Collections.Generic.ICollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IReadOnlyCollection, System.Collections.ICollection, System.Collections.IEnumerable + { + internal KeyCollection() { } + public int Count { get { throw null; } } + bool System.Collections.Generic.ICollection.IsReadOnly { get { throw null; } } + bool System.Collections.ICollection.IsSynchronized { get { throw null; } } + object System.Collections.ICollection.SyncRoot { get { throw null; } } + public void CopyTo(TKey[] array, int arrayIndex) { } + public System.Collections.Generic.IEnumerator GetEnumerator() { throw null; } + void System.Collections.Generic.ICollection.Add(TKey item) { } + void System.Collections.Generic.ICollection.Clear() { } + bool System.Collections.Generic.ICollection.Contains(TKey item) { throw null; } + bool System.Collections.Generic.ICollection.Remove(TKey item) { throw null; } + void System.Collections.ICollection.CopyTo(System.Array array, int index) { } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public sealed partial class ValueCollection : System.Collections.Generic.ICollection, System.Collections.Generic.IEnumerable, System.Collections.Generic.IReadOnlyCollection, System.Collections.ICollection, System.Collections.IEnumerable + { + internal ValueCollection() { } + public int Count { get { throw null; } } + bool System.Collections.Generic.ICollection.IsReadOnly { get { throw null; } } + bool System.Collections.ICollection.IsSynchronized { get { throw null; } } + object System.Collections.ICollection.SyncRoot { get { throw null; } } + public void CopyTo(TValue[] array, int arrayIndex) { } + public System.Collections.Generic.IEnumerator GetEnumerator() { throw null; } + void System.Collections.Generic.ICollection.Add(TValue item) { } + void System.Collections.Generic.ICollection.Clear() { } + bool System.Collections.Generic.ICollection.Contains(TValue item) { throw null; } + bool System.Collections.Generic.ICollection.Remove(TValue item) { throw null; } + void System.Collections.ICollection.CopyTo(System.Array array, int index) { } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + } } namespace System.ComponentModel { @@ -9082,6 +9155,13 @@ public RequiresAssemblyFilesAttribute(string message) { } public string? Message { get { throw null; } } public string? Url { get { throw null; } set { } } } + [System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited = false)] + public sealed partial class RequiresDynamicCodeAttribute : System.Attribute + { + public RequiresDynamicCodeAttribute(string message) { } + public string Message { get { throw null; } } + public string? Url { get { throw null; } set { } } + } [System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)] public sealed partial class RequiresUnreferencedCodeAttribute : System.Attribute { @@ -11363,12 +11443,15 @@ public AssemblyName(string assemblyName) { } public string? EscapedCodeBase { get { throw null; } } public System.Reflection.AssemblyNameFlags Flags { get { throw null; } set { } } public string FullName { get { throw null; } } + [System.ObsoleteAttribute("AssemblyName members HashAlgorithm, ProcessorArchitecture, and VersionCompatibility are obsolete and not supported.", DiagnosticId = "SYSLIB0037", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public System.Configuration.Assemblies.AssemblyHashAlgorithm HashAlgorithm { get { throw null; } set { } } [System.ObsoleteAttribute("Strong name signing is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0017", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public System.Reflection.StrongNameKeyPair? KeyPair { get { throw null; } set { } } public string? Name { get { throw null; } set { } } + [System.ObsoleteAttribute("AssemblyName members HashAlgorithm, ProcessorArchitecture, and VersionCompatibility are obsolete and not supported.", DiagnosticId = "SYSLIB0037", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public System.Reflection.ProcessorArchitecture ProcessorArchitecture { get { throw null; } set { } } public System.Version? Version { get { throw null; } set { } } + [System.ObsoleteAttribute("AssemblyName members HashAlgorithm, ProcessorArchitecture, and VersionCompatibility are obsolete and not supported.", DiagnosticId = "SYSLIB0037", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public System.Configuration.Assemblies.AssemblyVersionCompatibility VersionCompatibility { get { throw null; } set { } } public object Clone() { throw null; } public static System.Reflection.AssemblyName GetAssemblyName(string assemblyFile) { throw null; } @@ -13120,6 +13203,7 @@ public static void ExecuteCodeWithGuaranteedCleanup(System.Runtime.CompilerServi public static T[] GetSubArray(T[] array, System.Range range) { throw null; } public static object GetUninitializedObject([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type type) { throw null; } public static void InitializeArray(System.Array array, System.RuntimeFieldHandle fldHandle) { } + public static ReadOnlySpan CreateSpan(System.RuntimeFieldHandle fldHandle) { throw null; } public static bool IsReferenceOrContainsReferences() { throw null; } [System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public static void PrepareConstrainedRegions() { } diff --git a/src/libraries/System.Runtime/tests/Helpers.cs b/src/libraries/System.Runtime/tests/Helpers.cs index b44d82c5f1fb6c..5d44dc649976bf 100644 --- a/src/libraries/System.Runtime/tests/Helpers.cs +++ b/src/libraries/System.Runtime/tests/Helpers.cs @@ -10,9 +10,6 @@ namespace System.Tests { - [CollectionDefinition("NoParallelTests", DisableParallelization = true)] - public partial class NoParallelTests { } - public static class Helpers { private static Type s_refEmitType; diff --git a/src/libraries/System.Runtime/tests/NlsTests/System.Runtime.Nls.Tests.csproj b/src/libraries/System.Runtime/tests/NlsTests/System.Runtime.Nls.Tests.csproj index b7d75d9638b9e0..5c5e951f3a08cd 100644 --- a/src/libraries/System.Runtime/tests/NlsTests/System.Runtime.Nls.Tests.csproj +++ b/src/libraries/System.Runtime/tests/NlsTests/System.Runtime.Nls.Tests.csproj @@ -39,6 +39,8 @@ Link="Common\System\MockType.cs" /> + diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj b/src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj index 913da87c5b2845..45a57bda917c52 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests.csproj @@ -27,6 +27,7 @@ + @@ -58,7 +59,6 @@ - @@ -155,6 +155,9 @@ + + + diff --git a/src/libraries/System.Runtime/tests/System/ArgumentNullExceptionTests.cs b/src/libraries/System.Runtime/tests/System/ArgumentNullExceptionTests.cs index 3a5e3ad675b938..9705f44c55c14a 100644 --- a/src/libraries/System.Runtime/tests/System/ArgumentNullExceptionTests.cs +++ b/src/libraries/System.Runtime/tests/System/ArgumentNullExceptionTests.cs @@ -49,29 +49,37 @@ public static void Ctor_String_String() } [Fact] - public static void ThrowIfNull_NonNull_DoesntThrow() + public static unsafe void ThrowIfNull_NonNull_DoesntThrow() { foreach (object o in new[] { new object(), "", "argument" }) { ArgumentNullException.ThrowIfNull(o); ArgumentNullException.ThrowIfNull(o, "paramName"); } + + int i = 0; + ArgumentNullException.ThrowIfNull(&i); + ArgumentNullException.ThrowIfNull(&i, "paramName"); } [Theory] [InlineData(null)] [InlineData("")] [InlineData("name")] - public static void ThrowIfNull_Null_ThrowsArgumentNullException(string paramName) + public static unsafe void ThrowIfNull_Null_ThrowsArgumentNullException(string paramName) { - AssertExtensions.Throws(paramName, () => ArgumentNullException.ThrowIfNull(null, paramName)); + AssertExtensions.Throws(paramName, () => ArgumentNullException.ThrowIfNull((object)null, paramName)); + AssertExtensions.Throws(paramName, () => ArgumentNullException.ThrowIfNull((void*)null, paramName)); } [Fact] - public static void ThrowIfNull_UsesArgumentExpression() + public static unsafe void ThrowIfNull_UsesArgumentExpression() { - object something = null; - AssertExtensions.Throws(nameof(something), () => ArgumentNullException.ThrowIfNull(something)); + object someObject = null; + AssertExtensions.Throws(nameof(someObject), () => ArgumentNullException.ThrowIfNull(someObject)); + + byte* somePointer = null; + AssertExtensions.Throws(nameof(somePointer), () => ArgumentNullException.ThrowIfNull(somePointer)); } } } diff --git a/src/libraries/System.Runtime/tests/System/ArrayTests.cs b/src/libraries/System.Runtime/tests/System/ArrayTests.cs index b7bdc5fab35834..e0108b81f3e57b 100644 --- a/src/libraries/System.Runtime/tests/System/ArrayTests.cs +++ b/src/libraries/System.Runtime/tests/System/ArrayTests.cs @@ -4736,7 +4736,7 @@ public enum Int32Enum public enum Int64Enum : long { } } - [Collection("NoParallelTests")] + [Collection(nameof(DisableParallelization))] public class DangerousArrayTests { [OuterLoop] // Allocates large array diff --git a/src/libraries/System.Runtime/tests/System/ByteTests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/ByteTests.GenericMath.cs index eb59a4f5df4a81..35a8e4defc2f2a 100644 --- a/src/libraries/System.Runtime/tests/System/ByteTests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/ByteTests.GenericMath.cs @@ -7,7 +7,6 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class ByteTests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/CharTests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/CharTests.GenericMath.cs index 400d389f963b30..f9611f3bdcdb39 100644 --- a/src/libraries/System.Runtime/tests/System/CharTests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/CharTests.GenericMath.cs @@ -6,7 +6,6 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class CharTests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/Diagnostics/CodeAnalysis/RequiresAssemblyFilesAttributeTests.cs b/src/libraries/System.Runtime/tests/System/Diagnostics/CodeAnalysis/RequiresAssemblyFilesAttributeTests.cs index 974de11e89bb9d..6dd40bf5b3de42 100644 --- a/src/libraries/System.Runtime/tests/System/Diagnostics/CodeAnalysis/RequiresAssemblyFilesAttributeTests.cs +++ b/src/libraries/System.Runtime/tests/System/Diagnostics/CodeAnalysis/RequiresAssemblyFilesAttributeTests.cs @@ -34,7 +34,10 @@ public void TestSetMessage(string message) [InlineData(null)] public void TestSetUrl(string url) { - var attr = new RequiresAssemblyFilesAttribute(Url = url); + var attr = new RequiresAssemblyFilesAttribute() + { + Url = url + }; Assert.Null(attr.Message); Assert.Equal(url, attr.Url); @@ -52,10 +55,13 @@ public void TestSetUrl(string url) [InlineData(null, null)] public void TestSetMessageAndUrl(string message, string url) { - var attr = new RequiresAssemblyFilesAttribute(message, Url = url); + var attr = new RequiresAssemblyFilesAttribute(message) + { + Url = url + }; Assert.Equal(message, attr.Message); - Assert.Equal(ur, attr.Url); + Assert.Equal(url, attr.Url); } } } diff --git a/src/libraries/System.Runtime/tests/System/Diagnostics/CodeAnalysis/RequiresDynamicCodeAttributeTests.cs b/src/libraries/System.Runtime/tests/System/Diagnostics/CodeAnalysis/RequiresDynamicCodeAttributeTests.cs new file mode 100644 index 00000000000000..a9cbc6f6942ec0 --- /dev/null +++ b/src/libraries/System.Runtime/tests/System/Diagnostics/CodeAnalysis/RequiresDynamicCodeAttributeTests.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. + +using Xunit; + +namespace System.Diagnostics.CodeAnalysis.Tests +{ + public class RequiresDynamicCodeAttributeTests + { + [Fact] + public void TestConstructor() + { + var attr = new RequiresDynamicCodeAttribute("User Message"); + + Assert.Equal("User Message", attr.Message); + Assert.Null(attr.Url); + } + + [Theory] + [InlineData("https://dot.net")] + [InlineData("")] + [InlineData(null)] + public void TestSetUrl(string url) + { + var attr = new RequiresDynamicCodeAttribute("User Message") + { + Url = url + }; + + Assert.Equal("User Message", attr.Message); + Assert.Equal(url, attr.Url); + } + } +} diff --git a/src/libraries/System.Runtime/tests/System/DoubleTests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/DoubleTests.GenericMath.cs index 3758dc7acbb865..6d9b1b6bc03a11 100644 --- a/src/libraries/System.Runtime/tests/System/DoubleTests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/DoubleTests.GenericMath.cs @@ -7,7 +7,6 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class DoubleTests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/HalfTests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/HalfTests.GenericMath.cs index e9679fb0a21f87..617e22dd84f614 100644 --- a/src/libraries/System.Runtime/tests/System/HalfTests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/HalfTests.GenericMath.cs @@ -7,7 +7,6 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class HalfTests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/Int16Tests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/Int16Tests.GenericMath.cs index 023b2650ed1692..06fe87729fe0a8 100644 --- a/src/libraries/System.Runtime/tests/System/Int16Tests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/Int16Tests.GenericMath.cs @@ -7,7 +7,6 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class Int16Tests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/Int32Tests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/Int32Tests.GenericMath.cs index 269b2cd7795c4a..930538903c5140 100644 --- a/src/libraries/System.Runtime/tests/System/Int32Tests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/Int32Tests.GenericMath.cs @@ -7,7 +7,6 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class Int32Tests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/Int64Tests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/Int64Tests.GenericMath.cs index 4bf4e37391995f..f243969b628f74 100644 --- a/src/libraries/System.Runtime/tests/System/Int64Tests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/Int64Tests.GenericMath.cs @@ -7,7 +7,6 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class Int64Tests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/IntPtrTests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/IntPtrTests.GenericMath.cs index fea36bfffe18b2..4fae5c21733fd3 100644 --- a/src/libraries/System.Runtime/tests/System/IntPtrTests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/IntPtrTests.GenericMath.cs @@ -7,7 +7,6 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class IntPtrTests_GenericMath { @@ -785,6 +784,7 @@ public static void CreateSaturatingFromCharTest() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/61920", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void CreateSaturatingFromInt16Test() { Assert.Equal((nint)0x00000000, NumberHelper.CreateSaturating(0x0000)); @@ -847,6 +847,7 @@ public static void CreateSaturatingFromIntPtrTest() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/61920", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void CreateSaturatingFromSByteTest() { Assert.Equal((nint)0x00000000, NumberHelper.CreateSaturating(0x00)); @@ -950,6 +951,7 @@ public static void CreateTruncatingFromCharTest() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/61920", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void CreateTruncatingFromInt16Test() { if (Environment.Is64BitProcess) @@ -1023,6 +1025,7 @@ public static void CreateTruncatingFromIntPtrTest() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/61920", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void CreateTruncatingFromSByteTest() { if (Environment.Is64BitProcess) @@ -1232,6 +1235,7 @@ public static void TryCreateFromCharTest() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/61920", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void TryCreateFromInt16Test() { nint result; @@ -1356,6 +1360,7 @@ public static void TryCreateFromIntPtrTest() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/61920", TestPlatforms.iOS | TestPlatforms.tvOS)] public static void TryCreateFromSByteTest() { nint result; diff --git a/src/libraries/System.Runtime/tests/System/Reflection/CustomAttribute_Named_Typed_ArgumentTests.cs b/src/libraries/System.Runtime/tests/System/Reflection/CustomAttribute_Named_Typed_ArgumentTests.cs index d016e53c75e299..4460797182c873 100644 --- a/src/libraries/System.Runtime/tests/System/Reflection/CustomAttribute_Named_Typed_ArgumentTests.cs +++ b/src/libraries/System.Runtime/tests/System/Reflection/CustomAttribute_Named_Typed_ArgumentTests.cs @@ -52,6 +52,14 @@ public static void Test_CustomAttributeTypedArgument_Constructor() Assert.True(false, "Expected to find MyAttr Attribute"); } + [Fact] + public static void Test_CustomAttributeTypedArgument_ToString() + { + var argument = new CustomAttributeTypedArgument(new [] { new CustomAttributeTypedArgument(0) }); + + Assert.Equal("new CustomAttributeTypedArgument[1] { 0 }", argument.ToString()); + } + [MyAttr(MyKinds.First, Desc = "This is a description on a method")] private static void MyMethod() { } } diff --git a/src/libraries/System.Runtime/tests/System/Reflection/ReflectionCacheTests.cs b/src/libraries/System.Runtime/tests/System/Reflection/ReflectionCacheTests.cs index e976da0384e7af..a74262a38d36cd 100644 --- a/src/libraries/System.Runtime/tests/System/Reflection/ReflectionCacheTests.cs +++ b/src/libraries/System.Runtime/tests/System/Reflection/ReflectionCacheTests.cs @@ -6,7 +6,7 @@ namespace System.Reflection.Tests { - [Collection(nameof(NoParallelTests))] + [Collection(nameof(DisableParallelization))] public class ReflectionCacheTests { [Fact] diff --git a/src/libraries/System.Runtime/tests/System/SByteTests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/SByteTests.GenericMath.cs index cdeddf1938ca5a..9b59db73c36b8d 100644 --- a/src/libraries/System.Runtime/tests/System/SByteTests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/SByteTests.GenericMath.cs @@ -7,7 +7,6 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class SByteTests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/SingleTests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/SingleTests.GenericMath.cs index 22715a26f53d9a..ced6bf7102afd1 100644 --- a/src/libraries/System.Runtime/tests/System/SingleTests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/SingleTests.GenericMath.cs @@ -7,7 +7,6 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class SingleTests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/UInt16Tests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/UInt16Tests.GenericMath.cs index fd996ac3a18214..9110b56ade608b 100644 --- a/src/libraries/System.Runtime/tests/System/UInt16Tests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/UInt16Tests.GenericMath.cs @@ -7,7 +7,6 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class UInt16Tests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/UInt32Tests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/UInt32Tests.GenericMath.cs index 4d867c8fa6486b..e692e6370b3f3d 100644 --- a/src/libraries/System.Runtime/tests/System/UInt32Tests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/UInt32Tests.GenericMath.cs @@ -7,7 +7,6 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class UInt32Tests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/UInt64Tests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/UInt64Tests.GenericMath.cs index b80585f45cff07..2a2b0859c48e07 100644 --- a/src/libraries/System.Runtime/tests/System/UInt64Tests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/UInt64Tests.GenericMath.cs @@ -7,7 +7,6 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class UInt64Tests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/System/UIntPtrTests.GenericMath.cs b/src/libraries/System.Runtime/tests/System/UIntPtrTests.GenericMath.cs index 1d9a435012ca5f..f67397441d75a2 100644 --- a/src/libraries/System.Runtime/tests/System/UIntPtrTests.GenericMath.cs +++ b/src/libraries/System.Runtime/tests/System/UIntPtrTests.GenericMath.cs @@ -7,7 +7,6 @@ namespace System.Tests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/54910", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAOT))] [RequiresPreviewFeaturesAttribute] public class UIntPtrTests_GenericMath { diff --git a/src/libraries/System.Runtime/tests/TrimmingTests/VerifyResourcesGetTrimmedTest.cs b/src/libraries/System.Runtime/tests/TrimmingTests/VerifyResourcesGetTrimmedTest.cs index 91f1dbdbe02a60..8e770a91b95d91 100644 --- a/src/libraries/System.Runtime/tests/TrimmingTests/VerifyResourcesGetTrimmedTest.cs +++ b/src/libraries/System.Runtime/tests/TrimmingTests/VerifyResourcesGetTrimmedTest.cs @@ -13,7 +13,7 @@ static int Main(string[] args) } catch (Exception e) { - // When the Trimmer recieves the feature switch to use resource keys then exception + // When the Trimmer receives the feature switch to use resource keys then exception // messages shouldn't return the exception message resource, but instead the resource // key. This test is passing in the feature switch so we make sure that the resources // got trimmed correctly. diff --git a/src/libraries/System.Security.Cryptography.Algorithms/ref/System.Security.Cryptography.Algorithms.Forwards.cs b/src/libraries/System.Security.Cryptography.Algorithms/ref/System.Security.Cryptography.Algorithms.Forwards.cs index 5ba332dfd77fd0..5e138286de8e05 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/ref/System.Security.Cryptography.Algorithms.Forwards.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/ref/System.Security.Cryptography.Algorithms.Forwards.cs @@ -4,4 +4,63 @@ // Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.Aes))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.AesCcm))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.AesGcm))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.AesManaged))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.AsymmetricKeyExchangeDeformatter))] [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.AsymmetricKeyExchangeFormatter))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.AsymmetricSignatureDeformatter))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.AsymmetricSignatureFormatter))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.ChaCha20Poly1305))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.CryptoConfig))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.DES))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.DSA))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.DSAParameters))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.DSASignatureDeformatter))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.DSASignatureFormat))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.DSASignatureFormatter))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.DeriveBytes))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.ECCurve))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.ECDiffieHellman))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.ECDiffieHellmanPublicKey))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.ECDsa))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.ECParameters))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.ECPoint))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.HKDF))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.HMACMD5))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.HMACSHA1))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.HMACSHA256))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.HMACSHA384))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.HMACSHA512))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.IncrementalHash))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.MD5))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.MaskGenerationMethod))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.PKCS1MaskGenerationMethod))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RC2))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSA))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSAEncryptionPadding))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSAEncryptionPaddingMode))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSAOAEPKeyExchangeDeformatter))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSAOAEPKeyExchangeFormatter))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSAPKCS1KeyExchangeFormatter))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSAPKCS1SignatureDeformatter))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSAPKCS1SignatureFormatter))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSAParameters))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSASignaturePadding))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RSASignaturePaddingMode))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RandomNumberGenerator))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.Rfc2898DeriveBytes))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.Rijndael))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.RijndaelManaged))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.SHA1))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.SHA1Managed))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.SHA256))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.SHA256Managed))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.SHA384))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.SHA384Managed))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.SHA512))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.SHA512Managed))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.SignatureDescription))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.TripleDES))] diff --git a/src/libraries/System.Security.Cryptography.Algorithms/ref/System.Security.Cryptography.Algorithms.cs b/src/libraries/System.Security.Cryptography.Algorithms/ref/System.Security.Cryptography.Algorithms.cs deleted file mode 100644 index 86b9871075b1fd..00000000000000 --- a/src/libraries/System.Security.Cryptography.Algorithms/ref/System.Security.Cryptography.Algorithms.cs +++ /dev/null @@ -1,964 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// ------------------------------------------------------------------------------ -// Changes to this file must follow the https://aka.ms/api-review process. -// ------------------------------------------------------------------------------ - -namespace System.Security.Cryptography -{ - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public abstract partial class Aes : System.Security.Cryptography.SymmetricAlgorithm - { - protected Aes() { } - public static new System.Security.Cryptography.Aes Create() { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] - public static new System.Security.Cryptography.Aes? Create(string algorithmName) { throw null; } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] - public sealed partial class AesCcm : System.IDisposable - { - public AesCcm(byte[] key) { } - public AesCcm(System.ReadOnlySpan key) { } - public static bool IsSupported { get { throw null; } } - public static System.Security.Cryptography.KeySizes NonceByteSizes { get { throw null; } } - public static System.Security.Cryptography.KeySizes TagByteSizes { get { throw null; } } - public void Decrypt(byte[] nonce, byte[] ciphertext, byte[] tag, byte[] plaintext, byte[]? associatedData = null) { } - public void Decrypt(System.ReadOnlySpan nonce, System.ReadOnlySpan ciphertext, System.ReadOnlySpan tag, System.Span plaintext, System.ReadOnlySpan associatedData = default(System.ReadOnlySpan)) { } - public void Dispose() { } - public void Encrypt(byte[] nonce, byte[] plaintext, byte[] ciphertext, byte[] tag, byte[]? associatedData = null) { } - public void Encrypt(System.ReadOnlySpan nonce, System.ReadOnlySpan plaintext, System.Span ciphertext, System.Span tag, System.ReadOnlySpan associatedData = default(System.ReadOnlySpan)) { } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] - public sealed partial class AesGcm : System.IDisposable - { - public AesGcm(byte[] key) { } - public AesGcm(System.ReadOnlySpan key) { } - public static bool IsSupported { get { throw null; } } - public static System.Security.Cryptography.KeySizes NonceByteSizes { get { throw null; } } - public static System.Security.Cryptography.KeySizes TagByteSizes { get { throw null; } } - public void Decrypt(byte[] nonce, byte[] ciphertext, byte[] tag, byte[] plaintext, byte[]? associatedData = null) { } - public void Decrypt(System.ReadOnlySpan nonce, System.ReadOnlySpan ciphertext, System.ReadOnlySpan tag, System.Span plaintext, System.ReadOnlySpan associatedData = default(System.ReadOnlySpan)) { } - public void Dispose() { } - public void Encrypt(byte[] nonce, byte[] plaintext, byte[] ciphertext, byte[] tag, byte[]? associatedData = null) { } - public void Encrypt(System.ReadOnlySpan nonce, System.ReadOnlySpan plaintext, System.Span ciphertext, System.Span tag, System.ReadOnlySpan associatedData = default(System.ReadOnlySpan)) { } - } - [System.ObsoleteAttribute("Derived cryptographic types are obsolete. Use the Create method on the base type instead.", DiagnosticId = "SYSLIB0021", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public sealed partial class AesManaged : System.Security.Cryptography.Aes - { - public AesManaged() { } - public override int BlockSize { get { throw null; } set { } } - public override int FeedbackSize { get { throw null; } set { } } - public override byte[] IV { get { throw null; } set { } } - public override byte[] Key { get { throw null; } set { } } - public override int KeySize { get { throw null; } set { } } - public override System.Security.Cryptography.KeySizes[] LegalBlockSizes { get { throw null; } } - public override System.Security.Cryptography.KeySizes[] LegalKeySizes { get { throw null; } } - public override System.Security.Cryptography.CipherMode Mode { get { throw null; } set { } } - public override System.Security.Cryptography.PaddingMode Padding { get { throw null; } set { } } - public override System.Security.Cryptography.ICryptoTransform CreateDecryptor() { throw null; } - public override System.Security.Cryptography.ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[]? rgbIV) { throw null; } - public override System.Security.Cryptography.ICryptoTransform CreateEncryptor() { throw null; } - public override System.Security.Cryptography.ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[]? rgbIV) { throw null; } - protected override void Dispose(bool disposing) { } - public override void GenerateIV() { } - public override void GenerateKey() { } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public abstract partial class AsymmetricKeyExchangeDeformatter - { - protected AsymmetricKeyExchangeDeformatter() { } - public abstract string? Parameters { get; set; } - public abstract byte[] DecryptKeyExchange(byte[] rgb); - public abstract void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key); - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public abstract partial class AsymmetricSignatureDeformatter - { - protected AsymmetricSignatureDeformatter() { } - public abstract void SetHashAlgorithm(string strName); - public abstract void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key); - public abstract bool VerifySignature(byte[] rgbHash, byte[] rgbSignature); - public virtual bool VerifySignature(System.Security.Cryptography.HashAlgorithm hash, byte[] rgbSignature) { throw null; } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public abstract partial class AsymmetricSignatureFormatter - { - protected AsymmetricSignatureFormatter() { } - public abstract byte[] CreateSignature(byte[] rgbHash); - public virtual byte[] CreateSignature(System.Security.Cryptography.HashAlgorithm hash) { throw null; } - public abstract void SetHashAlgorithm(string strName); - public abstract void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key); - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] - public sealed partial class ChaCha20Poly1305 : System.IDisposable - { - public ChaCha20Poly1305(byte[] key) { } - public ChaCha20Poly1305(System.ReadOnlySpan key) { } - public static bool IsSupported { get { throw null; } } - public void Decrypt(byte[] nonce, byte[] ciphertext, byte[] tag, byte[] plaintext, byte[]? associatedData = null) { } - public void Decrypt(System.ReadOnlySpan nonce, System.ReadOnlySpan ciphertext, System.ReadOnlySpan tag, System.Span plaintext, System.ReadOnlySpan associatedData = default(System.ReadOnlySpan)) { } - public void Dispose() { } - public void Encrypt(byte[] nonce, byte[] plaintext, byte[] ciphertext, byte[] tag, byte[]? associatedData = null) { } - public void Encrypt(System.ReadOnlySpan nonce, System.ReadOnlySpan plaintext, System.Span ciphertext, System.Span tag, System.ReadOnlySpan associatedData = default(System.ReadOnlySpan)) { } - } - public partial class CryptoConfig - { - public CryptoConfig() { } - public static bool AllowOnlyFipsAlgorithms { get { throw null; } } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public static void AddAlgorithm(System.Type algorithm, params string[] names) { } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public static void AddOID(string oid, params string[] names) { } - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] - public static object? CreateFromName(string name) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] - public static object? CreateFromName(string name, params object?[]? args) { throw null; } - [System.ObsoleteAttribute("EncodeOID is obsolete. Use the ASN.1 functionality provided in System.Formats.Asn1.", DiagnosticId = "SYSLIB0031", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public static byte[] EncodeOID(string str) { throw null; } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public static string? MapNameToOID(string name) { throw null; } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public abstract partial class DeriveBytes : System.IDisposable - { - protected DeriveBytes() { } - public void Dispose() { } - protected virtual void Dispose(bool disposing) { } - public abstract byte[] GetBytes(int cb); - public abstract void Reset(); - } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public abstract partial class DES : System.Security.Cryptography.SymmetricAlgorithm - { - protected DES() { } - public override byte[] Key { get { throw null; } set { } } - public static new System.Security.Cryptography.DES Create() { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] - public static new System.Security.Cryptography.DES? Create(string algName) { throw null; } - public static bool IsSemiWeakKey(byte[] rgbKey) { throw null; } - public static bool IsWeakKey(byte[] rgbKey) { throw null; } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public abstract partial class DSA : System.Security.Cryptography.AsymmetricAlgorithm - { - protected DSA() { } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] - public static new System.Security.Cryptography.DSA Create() { throw null; } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] - public static System.Security.Cryptography.DSA Create(int keySizeInBits) { throw null; } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] - public static System.Security.Cryptography.DSA Create(System.Security.Cryptography.DSAParameters parameters) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] - public static new System.Security.Cryptography.DSA? Create(string algName) { throw null; } - public abstract byte[] CreateSignature(byte[] rgbHash); - public byte[] CreateSignature(byte[] rgbHash, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - protected virtual byte[] CreateSignatureCore(System.ReadOnlySpan hash, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - public abstract System.Security.Cryptography.DSAParameters ExportParameters(bool includePrivateParameters); - public override void FromXmlString(string xmlString) { } - public int GetMaxSignatureSize(System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - protected virtual byte[] HashData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - protected virtual byte[] HashData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - public override void ImportEncryptedPkcs8PrivateKey(System.ReadOnlySpan passwordBytes, System.ReadOnlySpan source, out int bytesRead) { throw null; } - public override void ImportEncryptedPkcs8PrivateKey(System.ReadOnlySpan password, System.ReadOnlySpan source, out int bytesRead) { throw null; } - public override void ImportFromEncryptedPem(System.ReadOnlySpan input, System.ReadOnlySpan passwordBytes) { } - public override void ImportFromEncryptedPem(System.ReadOnlySpan input, System.ReadOnlySpan password) { } - public override void ImportFromPem(System.ReadOnlySpan input) { } - public abstract void ImportParameters(System.Security.Cryptography.DSAParameters parameters); - public override void ImportPkcs8PrivateKey(System.ReadOnlySpan source, out int bytesRead) { throw null; } - public override void ImportSubjectPublicKeyInfo(System.ReadOnlySpan source, out int bytesRead) { throw null; } - public virtual byte[] SignData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - public byte[] SignData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - public byte[] SignData(byte[] data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - public byte[] SignData(byte[] data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - public virtual byte[] SignData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - public byte[] SignData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - protected virtual byte[] SignDataCore(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - protected virtual byte[] SignDataCore(System.ReadOnlySpan data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - public override string ToXmlString(bool includePrivateParameters) { throw null; } - public virtual bool TryCreateSignature(System.ReadOnlySpan hash, System.Span destination, out int bytesWritten) { throw null; } - public bool TryCreateSignature(System.ReadOnlySpan hash, System.Span destination, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw null; } - protected virtual bool TryCreateSignatureCore(System.ReadOnlySpan hash, System.Span destination, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw null; } - public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span destination, out int bytesWritten) { throw null; } - public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span destination, out int bytesWritten) { throw null; } - public override bool TryExportPkcs8PrivateKey(System.Span destination, out int bytesWritten) { throw null; } - public override bool TryExportSubjectPublicKeyInfo(System.Span destination, out int bytesWritten) { throw null; } - protected virtual bool TryHashData(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out int bytesWritten) { throw null; } - public virtual bool TrySignData(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out int bytesWritten) { throw null; } - public bool TrySignData(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw null; } - protected virtual bool TrySignDataCore(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw null; } - public bool VerifyData(byte[] data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - public bool VerifyData(byte[] data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - public virtual bool VerifyData(byte[] data, int offset, int count, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - public bool VerifyData(byte[] data, int offset, int count, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - public virtual bool VerifyData(System.IO.Stream data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - public bool VerifyData(System.IO.Stream data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - public virtual bool VerifyData(System.ReadOnlySpan data, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - public bool VerifyData(System.ReadOnlySpan data, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - protected virtual bool VerifyDataCore(System.IO.Stream data, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - protected virtual bool VerifyDataCore(System.ReadOnlySpan data, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - public abstract bool VerifySignature(byte[] rgbHash, byte[] rgbSignature); - public bool VerifySignature(byte[] rgbHash, byte[] rgbSignature, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - public virtual bool VerifySignature(System.ReadOnlySpan hash, System.ReadOnlySpan signature) { throw null; } - public bool VerifySignature(System.ReadOnlySpan hash, System.ReadOnlySpan signature, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - protected virtual bool VerifySignatureCore(System.ReadOnlySpan hash, System.ReadOnlySpan signature, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - } - public partial struct DSAParameters - { - public int Counter; - public byte[]? G; - public byte[]? J; - public byte[]? P; - public byte[]? Q; - public byte[]? Seed; - public byte[]? X; - public byte[]? Y; - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public partial class DSASignatureDeformatter : System.Security.Cryptography.AsymmetricSignatureDeformatter - { - public DSASignatureDeformatter() { } - public DSASignatureDeformatter(System.Security.Cryptography.AsymmetricAlgorithm key) { } - public override void SetHashAlgorithm(string strName) { } - public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } - public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature) { throw null; } - } - public enum DSASignatureFormat - { - IeeeP1363FixedFieldConcatenation = 0, - Rfc3279DerSequence = 1, - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public partial class DSASignatureFormatter : System.Security.Cryptography.AsymmetricSignatureFormatter - { - public DSASignatureFormatter() { } - public DSASignatureFormatter(System.Security.Cryptography.AsymmetricAlgorithm key) { } - public override byte[] CreateSignature(byte[] rgbHash) { throw null; } - public override void SetHashAlgorithm(string strName) { } - public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public partial struct ECCurve - { - private object _dummy; - private int _dummyPrimitive; - public byte[]? A; - public byte[]? B; - public byte[]? Cofactor; - public System.Security.Cryptography.ECCurve.ECCurveType CurveType; - public System.Security.Cryptography.ECPoint G; - public System.Security.Cryptography.HashAlgorithmName? Hash; - public byte[]? Order; - public byte[]? Polynomial; - public byte[]? Prime; - public byte[]? Seed; - public bool IsCharacteristic2 { get { throw null; } } - public bool IsExplicit { get { throw null; } } - public bool IsNamed { get { throw null; } } - public bool IsPrime { get { throw null; } } - public System.Security.Cryptography.Oid Oid { get { throw null; } } - public static System.Security.Cryptography.ECCurve CreateFromFriendlyName(string oidFriendlyName) { throw null; } - public static System.Security.Cryptography.ECCurve CreateFromOid(System.Security.Cryptography.Oid curveOid) { throw null; } - public static System.Security.Cryptography.ECCurve CreateFromValue(string oidValue) { throw null; } - public void Validate() { } - public enum ECCurveType - { - Implicit = 0, - PrimeShortWeierstrass = 1, - PrimeTwistedEdwards = 2, - PrimeMontgomery = 3, - Characteristic2 = 4, - Named = 5, - } - public static partial class NamedCurves - { - public static System.Security.Cryptography.ECCurve brainpoolP160r1 { get { throw null; } } - public static System.Security.Cryptography.ECCurve brainpoolP160t1 { get { throw null; } } - public static System.Security.Cryptography.ECCurve brainpoolP192r1 { get { throw null; } } - public static System.Security.Cryptography.ECCurve brainpoolP192t1 { get { throw null; } } - public static System.Security.Cryptography.ECCurve brainpoolP224r1 { get { throw null; } } - public static System.Security.Cryptography.ECCurve brainpoolP224t1 { get { throw null; } } - public static System.Security.Cryptography.ECCurve brainpoolP256r1 { get { throw null; } } - public static System.Security.Cryptography.ECCurve brainpoolP256t1 { get { throw null; } } - public static System.Security.Cryptography.ECCurve brainpoolP320r1 { get { throw null; } } - public static System.Security.Cryptography.ECCurve brainpoolP320t1 { get { throw null; } } - public static System.Security.Cryptography.ECCurve brainpoolP384r1 { get { throw null; } } - public static System.Security.Cryptography.ECCurve brainpoolP384t1 { get { throw null; } } - public static System.Security.Cryptography.ECCurve brainpoolP512r1 { get { throw null; } } - public static System.Security.Cryptography.ECCurve brainpoolP512t1 { get { throw null; } } - public static System.Security.Cryptography.ECCurve nistP256 { get { throw null; } } - public static System.Security.Cryptography.ECCurve nistP384 { get { throw null; } } - public static System.Security.Cryptography.ECCurve nistP521 { get { throw null; } } - } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public abstract partial class ECDiffieHellman : System.Security.Cryptography.AsymmetricAlgorithm - { - protected ECDiffieHellman() { } - public override string KeyExchangeAlgorithm { get { throw null; } } - public abstract System.Security.Cryptography.ECDiffieHellmanPublicKey PublicKey { get; } - public override string? SignatureAlgorithm { get { throw null; } } - public static new System.Security.Cryptography.ECDiffieHellman Create() { throw null; } - public static System.Security.Cryptography.ECDiffieHellman Create(System.Security.Cryptography.ECCurve curve) { throw null; } - public static System.Security.Cryptography.ECDiffieHellman Create(System.Security.Cryptography.ECParameters parameters) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] - public static new System.Security.Cryptography.ECDiffieHellman? Create(string algorithm) { throw null; } - public byte[] DeriveKeyFromHash(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - public virtual byte[] DeriveKeyFromHash(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[]? secretPrepend, byte[]? secretAppend) { throw null; } - public byte[] DeriveKeyFromHmac(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[]? hmacKey) { throw null; } - public virtual byte[] DeriveKeyFromHmac(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[]? hmacKey, byte[]? secretPrepend, byte[]? secretAppend) { throw null; } - public virtual byte[] DeriveKeyMaterial(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey) { throw null; } - public virtual byte[] DeriveKeyTls(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, byte[] prfLabel, byte[] prfSeed) { throw null; } - public virtual byte[] ExportECPrivateKey() { throw null; } - public virtual System.Security.Cryptography.ECParameters ExportExplicitParameters(bool includePrivateParameters) { throw null; } - public virtual System.Security.Cryptography.ECParameters ExportParameters(bool includePrivateParameters) { throw null; } - public override void FromXmlString(string xmlString) { } - public virtual void GenerateKey(System.Security.Cryptography.ECCurve curve) { } - public virtual void ImportECPrivateKey(System.ReadOnlySpan source, out int bytesRead) { throw null; } - public override void ImportEncryptedPkcs8PrivateKey(System.ReadOnlySpan passwordBytes, System.ReadOnlySpan source, out int bytesRead) { throw null; } - public override void ImportEncryptedPkcs8PrivateKey(System.ReadOnlySpan password, System.ReadOnlySpan source, out int bytesRead) { throw null; } - public override void ImportFromEncryptedPem(System.ReadOnlySpan input, System.ReadOnlySpan passwordBytes) { } - public override void ImportFromEncryptedPem(System.ReadOnlySpan input, System.ReadOnlySpan password) { } - public override void ImportFromPem(System.ReadOnlySpan input) { } - public virtual void ImportParameters(System.Security.Cryptography.ECParameters parameters) { } - public override void ImportPkcs8PrivateKey(System.ReadOnlySpan source, out int bytesRead) { throw null; } - public override void ImportSubjectPublicKeyInfo(System.ReadOnlySpan source, out int bytesRead) { throw null; } - public override string ToXmlString(bool includePrivateParameters) { throw null; } - public virtual bool TryExportECPrivateKey(System.Span destination, out int bytesWritten) { throw null; } - public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span destination, out int bytesWritten) { throw null; } - public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span destination, out int bytesWritten) { throw null; } - public override bool TryExportPkcs8PrivateKey(System.Span destination, out int bytesWritten) { throw null; } - public override bool TryExportSubjectPublicKeyInfo(System.Span destination, out int bytesWritten) { throw null; } - } - public abstract partial class ECDiffieHellmanPublicKey : System.IDisposable - { - protected ECDiffieHellmanPublicKey() { } - protected ECDiffieHellmanPublicKey(byte[] keyBlob) { } - public void Dispose() { } - protected virtual void Dispose(bool disposing) { } - public virtual System.Security.Cryptography.ECParameters ExportExplicitParameters() { throw null; } - public virtual System.Security.Cryptography.ECParameters ExportParameters() { throw null; } - public virtual byte[] ExportSubjectPublicKeyInfo() { throw null; } - public virtual byte[] ToByteArray() { throw null; } - public virtual string ToXmlString() { throw null; } - public virtual bool TryExportSubjectPublicKeyInfo(System.Span destination, out int bytesWritten) { throw null; } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public abstract partial class ECDsa : System.Security.Cryptography.AsymmetricAlgorithm - { - protected ECDsa() { } - public override string? KeyExchangeAlgorithm { get { throw null; } } - public override string SignatureAlgorithm { get { throw null; } } - public static new System.Security.Cryptography.ECDsa Create() { throw null; } - public static System.Security.Cryptography.ECDsa Create(System.Security.Cryptography.ECCurve curve) { throw null; } - public static System.Security.Cryptography.ECDsa Create(System.Security.Cryptography.ECParameters parameters) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] - public static new System.Security.Cryptography.ECDsa? Create(string algorithm) { throw null; } - public virtual byte[] ExportECPrivateKey() { throw null; } - public virtual System.Security.Cryptography.ECParameters ExportExplicitParameters(bool includePrivateParameters) { throw null; } - public virtual System.Security.Cryptography.ECParameters ExportParameters(bool includePrivateParameters) { throw null; } - public override void FromXmlString(string xmlString) { } - public virtual void GenerateKey(System.Security.Cryptography.ECCurve curve) { } - public int GetMaxSignatureSize(System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - protected virtual byte[] HashData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - protected virtual byte[] HashData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - public virtual void ImportECPrivateKey(System.ReadOnlySpan source, out int bytesRead) { throw null; } - public override void ImportEncryptedPkcs8PrivateKey(System.ReadOnlySpan passwordBytes, System.ReadOnlySpan source, out int bytesRead) { throw null; } - public override void ImportEncryptedPkcs8PrivateKey(System.ReadOnlySpan password, System.ReadOnlySpan source, out int bytesRead) { throw null; } - public override void ImportFromEncryptedPem(System.ReadOnlySpan input, System.ReadOnlySpan passwordBytes) { } - public override void ImportFromEncryptedPem(System.ReadOnlySpan input, System.ReadOnlySpan password) { } - public override void ImportFromPem(System.ReadOnlySpan input) { } - public virtual void ImportParameters(System.Security.Cryptography.ECParameters parameters) { } - public override void ImportPkcs8PrivateKey(System.ReadOnlySpan source, out int bytesRead) { throw null; } - public override void ImportSubjectPublicKeyInfo(System.ReadOnlySpan source, out int bytesRead) { throw null; } - public virtual byte[] SignData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - public byte[] SignData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - public virtual byte[] SignData(byte[] data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - public byte[] SignData(byte[] data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - public virtual byte[] SignData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - public byte[] SignData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - protected virtual byte[] SignDataCore(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - protected virtual byte[] SignDataCore(System.ReadOnlySpan data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - public abstract byte[] SignHash(byte[] hash); - public byte[] SignHash(byte[] hash, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - protected virtual byte[] SignHashCore(System.ReadOnlySpan hash, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - public override string ToXmlString(bool includePrivateParameters) { throw null; } - public virtual bool TryExportECPrivateKey(System.Span destination, out int bytesWritten) { throw null; } - public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span destination, out int bytesWritten) { throw null; } - public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span destination, out int bytesWritten) { throw null; } - public override bool TryExportPkcs8PrivateKey(System.Span destination, out int bytesWritten) { throw null; } - public override bool TryExportSubjectPublicKeyInfo(System.Span destination, out int bytesWritten) { throw null; } - protected virtual bool TryHashData(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out int bytesWritten) { throw null; } - public virtual bool TrySignData(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out int bytesWritten) { throw null; } - public bool TrySignData(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw null; } - protected virtual bool TrySignDataCore(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw null; } - public virtual bool TrySignHash(System.ReadOnlySpan hash, System.Span destination, out int bytesWritten) { throw null; } - public bool TrySignHash(System.ReadOnlySpan hash, System.Span destination, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw null; } - protected virtual bool TrySignHashCore(System.ReadOnlySpan hash, System.Span destination, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw null; } - public bool VerifyData(byte[] data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - public bool VerifyData(byte[] data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - public virtual bool VerifyData(byte[] data, int offset, int count, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - public bool VerifyData(byte[] data, int offset, int count, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - public bool VerifyData(System.IO.Stream data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - public bool VerifyData(System.IO.Stream data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - public virtual bool VerifyData(System.ReadOnlySpan data, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - public bool VerifyData(System.ReadOnlySpan data, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - protected virtual bool VerifyDataCore(System.IO.Stream data, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - protected virtual bool VerifyDataCore(System.ReadOnlySpan data, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - public abstract bool VerifyHash(byte[] hash, byte[] signature); - public bool VerifyHash(byte[] hash, byte[] signature, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - public virtual bool VerifyHash(System.ReadOnlySpan hash, System.ReadOnlySpan signature) { throw null; } - public bool VerifyHash(System.ReadOnlySpan hash, System.ReadOnlySpan signature, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - protected virtual bool VerifyHashCore(System.ReadOnlySpan hash, System.ReadOnlySpan signature, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public partial struct ECParameters - { - public System.Security.Cryptography.ECCurve Curve; - public byte[]? D; - public System.Security.Cryptography.ECPoint Q; - public void Validate() { } - } - public partial struct ECPoint - { - public byte[]? X; - public byte[]? Y; - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public static partial class HKDF - { - public static byte[] DeriveKey(System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, byte[] ikm, int outputLength, byte[]? salt = null, byte[]? info = null) { throw null; } - public static void DeriveKey(System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, System.ReadOnlySpan ikm, System.Span output, System.ReadOnlySpan salt, System.ReadOnlySpan info) { } - public static byte[] Expand(System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, byte[] prk, int outputLength, byte[]? info = null) { throw null; } - public static void Expand(System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, System.ReadOnlySpan prk, System.Span output, System.ReadOnlySpan info) { } - public static byte[] Extract(System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, byte[] ikm, byte[]? salt = null) { throw null; } - public static int Extract(System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, System.ReadOnlySpan ikm, System.ReadOnlySpan salt, System.Span prk) { throw null; } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public partial class HMACMD5 : System.Security.Cryptography.HMAC - { - public HMACMD5() { } - public HMACMD5(byte[] key) { } - public override byte[] Key { get { throw null; } set { } } - protected override void Dispose(bool disposing) { } - protected override void HashCore(byte[] rgb, int ib, int cb) { } - protected override void HashCore(System.ReadOnlySpan source) { } - public static byte[] HashData(byte[] key, byte[] source) { throw null; } - public static byte[] HashData(System.ReadOnlySpan key, System.ReadOnlySpan source) { throw null; } - public static int HashData(System.ReadOnlySpan key, System.ReadOnlySpan source, System.Span destination) { throw null; } - protected override byte[] HashFinal() { throw null; } - public override void Initialize() { } - public static bool TryHashData(System.ReadOnlySpan key, System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } - protected override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public partial class HMACSHA1 : System.Security.Cryptography.HMAC - { - public HMACSHA1() { } - public HMACSHA1(byte[] key) { } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.ObsoleteAttribute("HMACSHA1 always uses the algorithm implementation provided by the platform. Use a constructor without the useManagedSha1 parameter.", DiagnosticId = "SYSLIB0030", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] - public HMACSHA1(byte[] key, bool useManagedSha1) { } - public override byte[] Key { get { throw null; } set { } } - protected override void Dispose(bool disposing) { } - protected override void HashCore(byte[] rgb, int ib, int cb) { } - protected override void HashCore(System.ReadOnlySpan source) { } - public static byte[] HashData(byte[] key, byte[] source) { throw null; } - public static byte[] HashData(System.ReadOnlySpan key, System.ReadOnlySpan source) { throw null; } - public static int HashData(System.ReadOnlySpan key, System.ReadOnlySpan source, System.Span destination) { throw null; } - protected override byte[] HashFinal() { throw null; } - public override void Initialize() { } - public static bool TryHashData(System.ReadOnlySpan key, System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } - protected override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public partial class HMACSHA256 : System.Security.Cryptography.HMAC - { - public HMACSHA256() { } - public HMACSHA256(byte[] key) { } - public override byte[] Key { get { throw null; } set { } } - protected override void Dispose(bool disposing) { } - protected override void HashCore(byte[] rgb, int ib, int cb) { } - protected override void HashCore(System.ReadOnlySpan source) { } - public static byte[] HashData(byte[] key, byte[] source) { throw null; } - public static byte[] HashData(System.ReadOnlySpan key, System.ReadOnlySpan source) { throw null; } - public static int HashData(System.ReadOnlySpan key, System.ReadOnlySpan source, System.Span destination) { throw null; } - protected override byte[] HashFinal() { throw null; } - public override void Initialize() { } - public static bool TryHashData(System.ReadOnlySpan key, System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } - protected override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public partial class HMACSHA384 : System.Security.Cryptography.HMAC - { - public HMACSHA384() { } - public HMACSHA384(byte[] key) { } - public override byte[] Key { get { throw null; } set { } } - [System.ObsoleteAttribute("ProduceLegacyHmacValues is obsolete. Producing legacy HMAC values is not supported.", DiagnosticId = "SYSLIB0029", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] - public bool ProduceLegacyHmacValues { get { throw null; } set { } } - protected override void Dispose(bool disposing) { } - protected override void HashCore(byte[] rgb, int ib, int cb) { } - protected override void HashCore(System.ReadOnlySpan source) { } - public static byte[] HashData(byte[] key, byte[] source) { throw null; } - public static byte[] HashData(System.ReadOnlySpan key, System.ReadOnlySpan source) { throw null; } - public static int HashData(System.ReadOnlySpan key, System.ReadOnlySpan source, System.Span destination) { throw null; } - protected override byte[] HashFinal() { throw null; } - public override void Initialize() { } - public static bool TryHashData(System.ReadOnlySpan key, System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } - protected override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public partial class HMACSHA512 : System.Security.Cryptography.HMAC - { - public HMACSHA512() { } - public HMACSHA512(byte[] key) { } - public override byte[] Key { get { throw null; } set { } } - [System.ObsoleteAttribute("ProduceLegacyHmacValues is obsolete. Producing legacy HMAC values is not supported.", DiagnosticId = "SYSLIB0029", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] - public bool ProduceLegacyHmacValues { get { throw null; } set { } } - protected override void Dispose(bool disposing) { } - protected override void HashCore(byte[] rgb, int ib, int cb) { } - protected override void HashCore(System.ReadOnlySpan source) { } - public static byte[] HashData(byte[] key, byte[] source) { throw null; } - public static byte[] HashData(System.ReadOnlySpan key, System.ReadOnlySpan source) { throw null; } - public static int HashData(System.ReadOnlySpan key, System.ReadOnlySpan source, System.Span destination) { throw null; } - protected override byte[] HashFinal() { throw null; } - public override void Initialize() { } - public static bool TryHashData(System.ReadOnlySpan key, System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } - protected override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } - } - public sealed partial class IncrementalHash : System.IDisposable - { - internal IncrementalHash() { } - public System.Security.Cryptography.HashAlgorithmName AlgorithmName { get { throw null; } } - public int HashLengthInBytes { get { throw null; } } - public void AppendData(byte[] data) { } - public void AppendData(byte[] data, int offset, int count) { } - public void AppendData(System.ReadOnlySpan data) { } - public static System.Security.Cryptography.IncrementalHash CreateHash(System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public static System.Security.Cryptography.IncrementalHash CreateHMAC(System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[] key) { throw null; } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public static System.Security.Cryptography.IncrementalHash CreateHMAC(System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.ReadOnlySpan key) { throw null; } - public void Dispose() { } - public byte[] GetCurrentHash() { throw null; } - public int GetCurrentHash(System.Span destination) { throw null; } - public byte[] GetHashAndReset() { throw null; } - public int GetHashAndReset(System.Span destination) { throw null; } - public bool TryGetCurrentHash(System.Span destination, out int bytesWritten) { throw null; } - public bool TryGetHashAndReset(System.Span destination, out int bytesWritten) { throw null; } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public abstract partial class MaskGenerationMethod - { - protected MaskGenerationMethod() { } - public abstract byte[] GenerateMask(byte[] rgbSeed, int cbReturn); - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public abstract partial class MD5 : System.Security.Cryptography.HashAlgorithm - { - protected MD5() { } - public static new System.Security.Cryptography.MD5 Create() { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] - public static new System.Security.Cryptography.MD5? Create(string algName) { throw null; } - public static byte[] HashData(byte[] source) { throw null; } - public static byte[] HashData(System.ReadOnlySpan source) { throw null; } - public static int HashData(System.ReadOnlySpan source, System.Span destination) { throw null; } - public static bool TryHashData(System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public partial class PKCS1MaskGenerationMethod : System.Security.Cryptography.MaskGenerationMethod - { - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("PKCS1MaskGenerationMethod is not trim compatible because the algorithm implementation referenced by HashName might be removed.")] - public PKCS1MaskGenerationMethod() { } - public string HashName { get { throw null; } set { } } - public override byte[] GenerateMask(byte[] rgbSeed, int cbReturn) { throw null; } - } - public abstract partial class RandomNumberGenerator : System.IDisposable - { - protected RandomNumberGenerator() { } - public static System.Security.Cryptography.RandomNumberGenerator Create() { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public static System.Security.Cryptography.RandomNumberGenerator? Create(string rngName) { throw null; } - public void Dispose() { } - protected virtual void Dispose(bool disposing) { } - public static void Fill(System.Span data) { } - public abstract void GetBytes(byte[] data); - public virtual void GetBytes(byte[] data, int offset, int count) { } - public static byte[] GetBytes(int count) { throw null; } - public virtual void GetBytes(System.Span data) { } - public static int GetInt32(int toExclusive) { throw null; } - public static int GetInt32(int fromInclusive, int toExclusive) { throw null; } - public virtual void GetNonZeroBytes(byte[] data) { } - public virtual void GetNonZeroBytes(System.Span data) { } - } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public abstract partial class RC2 : System.Security.Cryptography.SymmetricAlgorithm - { - protected int EffectiveKeySizeValue; - protected RC2() { } - public virtual int EffectiveKeySize { get { throw null; } set { } } - public override int KeySize { get { throw null; } set { } } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")] - public static new System.Security.Cryptography.RC2 Create() { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] - public static new System.Security.Cryptography.RC2? Create(string AlgName) { throw null; } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public partial class Rfc2898DeriveBytes : System.Security.Cryptography.DeriveBytes - { - public Rfc2898DeriveBytes(byte[] password, byte[] salt, int iterations) { } - public Rfc2898DeriveBytes(byte[] password, byte[] salt, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { } - public Rfc2898DeriveBytes(string password, byte[] salt) { } - public Rfc2898DeriveBytes(string password, byte[] salt, int iterations) { } - public Rfc2898DeriveBytes(string password, byte[] salt, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { } - public Rfc2898DeriveBytes(string password, int saltSize) { } - public Rfc2898DeriveBytes(string password, int saltSize, int iterations) { } - public Rfc2898DeriveBytes(string password, int saltSize, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { } - public System.Security.Cryptography.HashAlgorithmName HashAlgorithm { get { throw null; } } - public int IterationCount { get { throw null; } set { } } - public byte[] Salt { get { throw null; } set { } } - [System.ObsoleteAttribute("Rfc2898DeriveBytes.CryptDeriveKey is obsolete and is not supported. Use PasswordDeriveBytes.CryptDeriveKey instead.", DiagnosticId = "SYSLIB0033", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] - public byte[] CryptDeriveKey(string algname, string alghashname, int keySize, byte[] rgbIV) { throw null; } - protected override void Dispose(bool disposing) { } - public override byte[] GetBytes(int cb) { throw null; } - public static byte[] Pbkdf2(byte[] password, byte[] salt, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, int outputLength) { throw null; } - public static byte[] Pbkdf2(System.ReadOnlySpan password, System.ReadOnlySpan salt, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, int outputLength) { throw null; } - public static void Pbkdf2(System.ReadOnlySpan password, System.ReadOnlySpan salt, System.Span destination, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { } - public static byte[] Pbkdf2(System.ReadOnlySpan password, System.ReadOnlySpan salt, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, int outputLength) { throw null; } - public static void Pbkdf2(System.ReadOnlySpan password, System.ReadOnlySpan salt, System.Span destination, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { } - public static byte[] Pbkdf2(string password, byte[] salt, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, int outputLength) { throw null; } - public override void Reset() { } - } - [System.ObsoleteAttribute("The Rijndael and RijndaelManaged types are obsolete. Use Aes instead.", DiagnosticId = "SYSLIB0022", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public abstract partial class Rijndael : System.Security.Cryptography.SymmetricAlgorithm - { - protected Rijndael() { } - public static new System.Security.Cryptography.Rijndael Create() { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] - public static new System.Security.Cryptography.Rijndael? Create(string algName) { throw null; } - } - [System.ObsoleteAttribute("The Rijndael and RijndaelManaged types are obsolete. Use Aes instead.", DiagnosticId = "SYSLIB0022", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public sealed partial class RijndaelManaged : System.Security.Cryptography.Rijndael - { - public RijndaelManaged() { } - public override int BlockSize { get { throw null; } set { } } - public override int FeedbackSize { get { throw null; } set { } } - public override byte[] IV { get { throw null; } set { } } - public override byte[] Key { get { throw null; } set { } } - public override int KeySize { get { throw null; } set { } } - public override System.Security.Cryptography.KeySizes[] LegalKeySizes { get { throw null; } } - public override System.Security.Cryptography.CipherMode Mode { get { throw null; } set { } } - public override System.Security.Cryptography.PaddingMode Padding { get { throw null; } set { } } - public override System.Security.Cryptography.ICryptoTransform CreateDecryptor() { throw null; } - public override System.Security.Cryptography.ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[]? rgbIV) { throw null; } - public override System.Security.Cryptography.ICryptoTransform CreateEncryptor() { throw null; } - public override System.Security.Cryptography.ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[]? rgbIV) { throw null; } - protected override void Dispose(bool disposing) { } - public override void GenerateIV() { } - public override void GenerateKey() { } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public abstract partial class RSA : System.Security.Cryptography.AsymmetricAlgorithm - { - protected RSA() { } - public override string? KeyExchangeAlgorithm { get { throw null; } } - public override string SignatureAlgorithm { get { throw null; } } - public static new System.Security.Cryptography.RSA Create() { throw null; } - public static System.Security.Cryptography.RSA Create(int keySizeInBits) { throw null; } - public static System.Security.Cryptography.RSA Create(System.Security.Cryptography.RSAParameters parameters) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] - public static new System.Security.Cryptography.RSA? Create(string algName) { throw null; } - public virtual byte[] Decrypt(byte[] data, System.Security.Cryptography.RSAEncryptionPadding padding) { throw null; } - public virtual byte[] DecryptValue(byte[] rgb) { throw null; } - public virtual byte[] Encrypt(byte[] data, System.Security.Cryptography.RSAEncryptionPadding padding) { throw null; } - public virtual byte[] EncryptValue(byte[] rgb) { throw null; } - public abstract System.Security.Cryptography.RSAParameters ExportParameters(bool includePrivateParameters); - public virtual byte[] ExportRSAPrivateKey() { throw null; } - public virtual byte[] ExportRSAPublicKey() { throw null; } - public override void FromXmlString(string xmlString) { } - protected virtual byte[] HashData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - protected virtual byte[] HashData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - public override void ImportEncryptedPkcs8PrivateKey(System.ReadOnlySpan passwordBytes, System.ReadOnlySpan source, out int bytesRead) { throw null; } - public override void ImportEncryptedPkcs8PrivateKey(System.ReadOnlySpan password, System.ReadOnlySpan source, out int bytesRead) { throw null; } - public override void ImportFromEncryptedPem(System.ReadOnlySpan input, System.ReadOnlySpan passwordBytes) { } - public override void ImportFromEncryptedPem(System.ReadOnlySpan input, System.ReadOnlySpan password) { } - public override void ImportFromPem(System.ReadOnlySpan input) { } - public abstract void ImportParameters(System.Security.Cryptography.RSAParameters parameters); - public override void ImportPkcs8PrivateKey(System.ReadOnlySpan source, out int bytesRead) { throw null; } - public virtual void ImportRSAPrivateKey(System.ReadOnlySpan source, out int bytesRead) { throw null; } - public virtual void ImportRSAPublicKey(System.ReadOnlySpan source, out int bytesRead) { throw null; } - public override void ImportSubjectPublicKeyInfo(System.ReadOnlySpan source, out int bytesRead) { throw null; } - public virtual byte[] SignData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } - public byte[] SignData(byte[] data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } - public virtual byte[] SignData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } - public virtual byte[] SignHash(byte[] hash, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } - public override string ToXmlString(bool includePrivateParameters) { throw null; } - public virtual bool TryDecrypt(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.RSAEncryptionPadding padding, out int bytesWritten) { throw null; } - public virtual bool TryEncrypt(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.RSAEncryptionPadding padding, out int bytesWritten) { throw null; } - public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span destination, out int bytesWritten) { throw null; } - public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span destination, out int bytesWritten) { throw null; } - public override bool TryExportPkcs8PrivateKey(System.Span destination, out int bytesWritten) { throw null; } - public virtual bool TryExportRSAPrivateKey(System.Span destination, out int bytesWritten) { throw null; } - public virtual bool TryExportRSAPublicKey(System.Span destination, out int bytesWritten) { throw null; } - public override bool TryExportSubjectPublicKeyInfo(System.Span destination, out int bytesWritten) { throw null; } - protected virtual bool TryHashData(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out int bytesWritten) { throw null; } - public virtual bool TrySignData(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding, out int bytesWritten) { throw null; } - public virtual bool TrySignHash(System.ReadOnlySpan hash, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding, out int bytesWritten) { throw null; } - public bool VerifyData(byte[] data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } - public virtual bool VerifyData(byte[] data, int offset, int count, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } - public bool VerifyData(System.IO.Stream data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } - public virtual bool VerifyData(System.ReadOnlySpan data, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } - public virtual bool VerifyHash(byte[] hash, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } - public virtual bool VerifyHash(System.ReadOnlySpan hash, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public sealed partial class RSAEncryptionPadding : System.IEquatable - { - internal RSAEncryptionPadding() { } - public System.Security.Cryptography.RSAEncryptionPaddingMode Mode { get { throw null; } } - public System.Security.Cryptography.HashAlgorithmName OaepHashAlgorithm { get { throw null; } } - public static System.Security.Cryptography.RSAEncryptionPadding OaepSHA1 { get { throw null; } } - public static System.Security.Cryptography.RSAEncryptionPadding OaepSHA256 { get { throw null; } } - public static System.Security.Cryptography.RSAEncryptionPadding OaepSHA384 { get { throw null; } } - public static System.Security.Cryptography.RSAEncryptionPadding OaepSHA512 { get { throw null; } } - public static System.Security.Cryptography.RSAEncryptionPadding Pkcs1 { get { throw null; } } - public static System.Security.Cryptography.RSAEncryptionPadding CreateOaep(System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } - public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Security.Cryptography.RSAEncryptionPadding? other) { throw null; } - public override int GetHashCode() { throw null; } - public static bool operator ==(System.Security.Cryptography.RSAEncryptionPadding? left, System.Security.Cryptography.RSAEncryptionPadding? right) { throw null; } - public static bool operator !=(System.Security.Cryptography.RSAEncryptionPadding? left, System.Security.Cryptography.RSAEncryptionPadding? right) { throw null; } - public override string ToString() { throw null; } - } - public enum RSAEncryptionPaddingMode - { - Pkcs1 = 0, - Oaep = 1, - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public partial class RSAOAEPKeyExchangeDeformatter : System.Security.Cryptography.AsymmetricKeyExchangeDeformatter - { - public RSAOAEPKeyExchangeDeformatter() { } - public RSAOAEPKeyExchangeDeformatter(System.Security.Cryptography.AsymmetricAlgorithm key) { } - public override string? Parameters { get { throw null; } set { } } - public override byte[] DecryptKeyExchange(byte[] rgbData) { throw null; } - public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public partial class RSAOAEPKeyExchangeFormatter : System.Security.Cryptography.AsymmetricKeyExchangeFormatter - { - public RSAOAEPKeyExchangeFormatter() { } - public RSAOAEPKeyExchangeFormatter(System.Security.Cryptography.AsymmetricAlgorithm key) { } - public byte[]? Parameter { get { throw null; } set { } } - public override string? Parameters { get { throw null; } } - public System.Security.Cryptography.RandomNumberGenerator? Rng { get { throw null; } set { } } - public override byte[] CreateKeyExchange(byte[] rgbData) { throw null; } - public override byte[] CreateKeyExchange(byte[] rgbData, System.Type? symAlgType) { throw null; } - public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } - } - public partial struct RSAParameters - { - public byte[]? D; - public byte[]? DP; - public byte[]? DQ; - public byte[]? Exponent; - public byte[]? InverseQ; - public byte[]? Modulus; - public byte[]? P; - public byte[]? Q; - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public partial class RSAPKCS1KeyExchangeDeformatter : System.Security.Cryptography.AsymmetricKeyExchangeDeformatter - { - public RSAPKCS1KeyExchangeDeformatter() { } - public RSAPKCS1KeyExchangeDeformatter(System.Security.Cryptography.AsymmetricAlgorithm key) { } - public override string? Parameters { get { throw null; } set { } } - public System.Security.Cryptography.RandomNumberGenerator? RNG { get { throw null; } set { } } - public override byte[] DecryptKeyExchange(byte[] rgbIn) { throw null; } - public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public partial class RSAPKCS1KeyExchangeFormatter : System.Security.Cryptography.AsymmetricKeyExchangeFormatter - { - public RSAPKCS1KeyExchangeFormatter() { } - public RSAPKCS1KeyExchangeFormatter(System.Security.Cryptography.AsymmetricAlgorithm key) { } - public override string Parameters { get { throw null; } } - public System.Security.Cryptography.RandomNumberGenerator? Rng { get { throw null; } set { } } - public override byte[] CreateKeyExchange(byte[] rgbData) { throw null; } - public override byte[] CreateKeyExchange(byte[] rgbData, System.Type? symAlgType) { throw null; } - public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public partial class RSAPKCS1SignatureDeformatter : System.Security.Cryptography.AsymmetricSignatureDeformatter - { - public RSAPKCS1SignatureDeformatter() { } - public RSAPKCS1SignatureDeformatter(System.Security.Cryptography.AsymmetricAlgorithm key) { } - public override void SetHashAlgorithm(string strName) { } - public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } - public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature) { throw null; } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public partial class RSAPKCS1SignatureFormatter : System.Security.Cryptography.AsymmetricSignatureFormatter - { - public RSAPKCS1SignatureFormatter() { } - public RSAPKCS1SignatureFormatter(System.Security.Cryptography.AsymmetricAlgorithm key) { } - public override byte[] CreateSignature(byte[] rgbHash) { throw null; } - public override void SetHashAlgorithm(string strName) { } - public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public sealed partial class RSASignaturePadding : System.IEquatable - { - internal RSASignaturePadding() { } - public System.Security.Cryptography.RSASignaturePaddingMode Mode { get { throw null; } } - public static System.Security.Cryptography.RSASignaturePadding Pkcs1 { get { throw null; } } - public static System.Security.Cryptography.RSASignaturePadding Pss { get { throw null; } } - public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } - public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Security.Cryptography.RSASignaturePadding? other) { throw null; } - public override int GetHashCode() { throw null; } - public static bool operator ==(System.Security.Cryptography.RSASignaturePadding? left, System.Security.Cryptography.RSASignaturePadding? right) { throw null; } - public static bool operator !=(System.Security.Cryptography.RSASignaturePadding? left, System.Security.Cryptography.RSASignaturePadding? right) { throw null; } - public override string ToString() { throw null; } - } - public enum RSASignaturePaddingMode - { - Pkcs1 = 0, - Pss = 1, - } - public abstract partial class SHA1 : System.Security.Cryptography.HashAlgorithm - { - protected SHA1() { } - public static new System.Security.Cryptography.SHA1 Create() { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] - public static new System.Security.Cryptography.SHA1? Create(string hashName) { throw null; } - public static byte[] HashData(byte[] source) { throw null; } - public static byte[] HashData(System.ReadOnlySpan source) { throw null; } - public static int HashData(System.ReadOnlySpan source, System.Span destination) { throw null; } - public static bool TryHashData(System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } - } - [System.ObsoleteAttribute("Derived cryptographic types are obsolete. Use the Create method on the base type instead.", DiagnosticId = "SYSLIB0021", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public sealed partial class SHA1Managed : System.Security.Cryptography.SHA1 - { - public SHA1Managed() { } - protected sealed override void Dispose(bool disposing) { } - protected sealed override void HashCore(byte[] array, int ibStart, int cbSize) { } - protected sealed override void HashCore(System.ReadOnlySpan source) { } - protected sealed override byte[] HashFinal() { throw null; } - public sealed override void Initialize() { } - protected sealed override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } - } - public abstract partial class SHA256 : System.Security.Cryptography.HashAlgorithm - { - protected SHA256() { } - public static new System.Security.Cryptography.SHA256 Create() { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] - public static new System.Security.Cryptography.SHA256? Create(string hashName) { throw null; } - public static byte[] HashData(byte[] source) { throw null; } - public static byte[] HashData(System.ReadOnlySpan source) { throw null; } - public static int HashData(System.ReadOnlySpan source, System.Span destination) { throw null; } - public static bool TryHashData(System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } - } - [System.ObsoleteAttribute("Derived cryptographic types are obsolete. Use the Create method on the base type instead.", DiagnosticId = "SYSLIB0021", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public sealed partial class SHA256Managed : System.Security.Cryptography.SHA256 - { - public SHA256Managed() { } - protected sealed override void Dispose(bool disposing) { } - protected sealed override void HashCore(byte[] array, int ibStart, int cbSize) { } - protected sealed override void HashCore(System.ReadOnlySpan source) { } - protected sealed override byte[] HashFinal() { throw null; } - public sealed override void Initialize() { } - protected sealed override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } - } - public abstract partial class SHA384 : System.Security.Cryptography.HashAlgorithm - { - protected SHA384() { } - public static new System.Security.Cryptography.SHA384 Create() { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] - public static new System.Security.Cryptography.SHA384? Create(string hashName) { throw null; } - public static byte[] HashData(byte[] source) { throw null; } - public static byte[] HashData(System.ReadOnlySpan source) { throw null; } - public static int HashData(System.ReadOnlySpan source, System.Span destination) { throw null; } - public static bool TryHashData(System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } - } - [System.ObsoleteAttribute("Derived cryptographic types are obsolete. Use the Create method on the base type instead.", DiagnosticId = "SYSLIB0021", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public sealed partial class SHA384Managed : System.Security.Cryptography.SHA384 - { - public SHA384Managed() { } - protected sealed override void Dispose(bool disposing) { } - protected sealed override void HashCore(byte[] array, int ibStart, int cbSize) { } - protected sealed override void HashCore(System.ReadOnlySpan source) { } - protected sealed override byte[] HashFinal() { throw null; } - public sealed override void Initialize() { } - protected sealed override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } - } - public abstract partial class SHA512 : System.Security.Cryptography.HashAlgorithm - { - protected SHA512() { } - public static new System.Security.Cryptography.SHA512 Create() { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] - public static new System.Security.Cryptography.SHA512? Create(string hashName) { throw null; } - public static byte[] HashData(byte[] source) { throw null; } - public static byte[] HashData(System.ReadOnlySpan source) { throw null; } - public static int HashData(System.ReadOnlySpan source, System.Span destination) { throw null; } - public static bool TryHashData(System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } - } - [System.ObsoleteAttribute("Derived cryptographic types are obsolete. Use the Create method on the base type instead.", DiagnosticId = "SYSLIB0021", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public sealed partial class SHA512Managed : System.Security.Cryptography.SHA512 - { - public SHA512Managed() { } - protected sealed override void Dispose(bool disposing) { } - protected sealed override void HashCore(byte[] array, int ibStart, int cbSize) { } - protected sealed override void HashCore(System.ReadOnlySpan source) { } - protected sealed override byte[] HashFinal() { throw null; } - public sealed override void Initialize() { } - protected sealed override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public partial class SignatureDescription - { - public SignatureDescription() { } - public SignatureDescription(System.Security.SecurityElement el) { } - public string? DeformatterAlgorithm { get { throw null; } set { } } - public string? DigestAlgorithm { get { throw null; } set { } } - public string? FormatterAlgorithm { get { throw null; } set { } } - public string? KeyAlgorithm { get { throw null; } set { } } - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("CreateDeformatter is not trim compatible because the algorithm implementation referenced by DeformatterAlgorithm might be removed.")] - public virtual System.Security.Cryptography.AsymmetricSignatureDeformatter CreateDeformatter(System.Security.Cryptography.AsymmetricAlgorithm key) { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("CreateDigest is not trim compatible because the algorithm implementation referenced by DigestAlgorithm might be removed.")] - public virtual System.Security.Cryptography.HashAlgorithm? CreateDigest() { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("CreateFormatter is not trim compatible because the algorithm implementation referenced by FormatterAlgorithm might be removed.")] - public virtual System.Security.Cryptography.AsymmetricSignatureFormatter CreateFormatter(System.Security.Cryptography.AsymmetricAlgorithm key) { throw null; } - } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] - public abstract partial class TripleDES : System.Security.Cryptography.SymmetricAlgorithm - { - protected TripleDES() { } - public override byte[] Key { get { throw null; } set { } } - public static new System.Security.Cryptography.TripleDES Create() { throw null; } - [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] - public static new System.Security.Cryptography.TripleDES? Create(string str) { throw null; } - public static bool IsWeakKey(byte[] rgbKey) { throw null; } - } -} diff --git a/src/libraries/System.Security.Cryptography.Algorithms/ref/System.Security.Cryptography.Algorithms.csproj b/src/libraries/System.Security.Cryptography.Algorithms/ref/System.Security.Cryptography.Algorithms.csproj index 569311fe0f7323..6f78fdf5bfd120 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/ref/System.Security.Cryptography.Algorithms.csproj +++ b/src/libraries/System.Security.Cryptography.Algorithms/ref/System.Security.Cryptography.Algorithms.csproj @@ -1,16 +1,14 @@ $(NetCoreAppCurrent) + $(NoWarn);SYSLIB0021;SYSLIB0022 enable - - - diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/ExcludeApiList.PNSE.Browser.txt b/src/libraries/System.Security.Cryptography.Algorithms/src/ExcludeApiList.PNSE.Browser.txt deleted file mode 100644 index 39c223fa55ea82..00000000000000 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/ExcludeApiList.PNSE.Browser.txt +++ /dev/null @@ -1,14 +0,0 @@ -M:System.Security.Cryptography.AesCcm.IsSupported -M:System.Security.Cryptography.AesGcm.IsSupported -M:System.Security.Cryptography.ChaCha20Poly1305.IsSupported -T:System.Security.Cryptography.CryptoConfig -T:System.Security.Cryptography.RandomNumberGenerator -T:System.Security.Cryptography.IncrementalHash -T:System.Security.Cryptography.SHA1 -T:System.Security.Cryptography.SHA256 -T:System.Security.Cryptography.SHA384 -T:System.Security.Cryptography.SHA512 -T:System.Security.Cryptography.SHA1Managed -T:System.Security.Cryptography.SHA256Managed -T:System.Security.Cryptography.SHA384Managed -T:System.Security.Cryptography.SHA512Managed \ No newline at end of file diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Resources/Strings.resx b/src/libraries/System.Security.Cryptography.Algorithms/src/Resources/Strings.resx deleted file mode 100644 index 0aafdc0ee2b6a4..00000000000000 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Resources/Strings.resx +++ /dev/null @@ -1,363 +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 - - - Non-negative number required. - - - Positive number required. - - - Destination is too short. - - - Range of random number does not contain at least one possibility. - - - Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection. - - - The OID value was invalid. - - - Value was invalid. - - - Buffer cannot be null. - - - No supported key formats were found. Check that the input represents the contents of a PEM-encoded key file, not the path to such a file. - - - The input contains multiple keys, but only one key can be imported. - - - An encrypted key was found, but no password was provided. Use ImportFromEncryptedPem to import this key. - - - Error occurred during a cryptographic operation. - - - The KDF for algorithm '{0}' requires a char-based password input. - - - Algorithm '{0}' is not supported on this platform. - - - The keys from both parties must be the same size to generate a secret agreement. - - - Keys used with the ECDiffieHellmanCng algorithm must have an algorithm group of ECDiffieHellman. - - - ASN.1 Enumerated values only apply to enum types without the [Flags] attribute. - - - Named bit list operations require an enum with the [Flags] attribute. - - - The encoded named bit list value is larger than the value size of the '{0}' enum. - - - Tags with TagClass Universal must have the appropriate TagValue value for the data type being read or written. - - - Unused bit count must be between 0 and 7, inclusive. - - - Encode cannot be called while a Sequence or SetOf is still open. - - - Cannot pop the requested tag as it is not currently in progress. - - - The computed authentication tag did not match the input authentication tag. - - - The TLS key derivation function requires both the label and seed properties to be set. - - - The TLS key derivation function requires a seed value of exactly 64 bytes. - - - The provided value of {0} bytes does not match the expected size of {1} bytes for the algorithm ({2}). - - - Encoded OID length is too large (greater than 0x7f bytes). - - - Object contains only the public half of a key pair. A private key must also be provided. - - - ASN1 corrupted data. - - - DSA keys can be imported, but new key generation is not supported on this platform. - - - The message exceeds the maximum allowable length for the chosen options ({0}). - - - XML serialization of an elliptic curve key requires using an overload which specifies the XML format to be used. - - - Only named curves are supported on this platform. - - - The provided XML could not be read. - - - The hash algorithm name cannot be null or empty. - - - Object identifier (OID) is unknown. - - - The specified curve '{0}' or its parameters are not valid for this platform. - - - The specified Oid is not valid. The Oid.FriendlyName or Oid.Value property must be set. - - - The specified key parameters are not valid. Q.X and Q.Y, or D, must be specified. Q.X, Q.Y must be the same length. If D is specified it must be the same length as Q.X and Q.Y if also specified for named curves or the same length as Order for explicit curves. - - - The specified DSA parameters are not valid; P, Q, G and Y are all required. - - - The specified DSA parameters are not valid; P, G and Y must be the same length (the key size). - - - The specified DSA parameters are not valid; Q and X (if present) must be the same length. - - - The specified DSA parameters are not valid; J (if present) must be shorter than P. - - - The specified DSA parameters are not valid; Seed, if present, must be 20 bytes long for keys shorter than 1024 bits. - - - The specified DSA parameters are not valid; Q must be 20 bytes long for keys shorter than 1024 bits. - - - The specified DSA parameters are not valid; Q's length must be one of 20, 32 or 64 bytes. - - - Input string does not contain a valid encoding of the '{0}' '{1}' parameter. - - - The specified Characteristic2 curve parameters are not valid. Polynomial, A, B, G.X, G.Y, and Order are required. A, B, G.X, G.Y must be the same length, and the same length as Q.X, Q.Y and D if those are specified. Cofactor is required. Seed and Hash are optional. Other parameters are not allowed. - - - The specified prime curve parameters are not valid. Prime, A, B, G.X, G.Y and Order are required and must be the same length, and the same length as Q.X, Q.Y and D if those are specified. Cofactor is required. Seed and Hash are optional. Other parameters are not allowed. - - - The specified named curve parameters are not valid. Only the Oid parameter must be set. - - - Specified key is not a valid size for this algorithm. - - - Specified key is a known semi-weak key for '{0}' and cannot be used. - - - Specified key is a known weak key for '{0}' and cannot be used. - - - The specified nonce is not a valid size for this algorithm. - - - The specified tag is not a valid size for this algorithm. - - - Specified initialization vector (IV) does not match the block size for this algorithm. - - - This operation is not supported for this class. - - - Padding is invalid and cannot be removed. - - - The specified RSA parameters are not valid. Exponent and Modulus are required. If D is present, it must have the same length as Modulus. If D is present, P, Q, DP, DQ, and InverseQ are required and must have half the length of Modulus, rounded up, otherwise they must be omitted. - - - Specified padding mode is not valid for this algorithm. - - - The string contains a character not in the 7 bit ASCII character set. - - - The key is too small for the requested operation. - - - The cipher mode specified requires that an initialization vector (IV) be used. - - - No asymmetric key object has been associated with this formatter object. - - - Required object identifier (OID) cannot be found. - - - TransformBlock may only process bytes in block sized increments. - - - Key is not a valid private key. - - - Key is not a valid public or private key. - - - Error occurred while decoding OAEP padding. - - - Cannot open an invalid handle. - - - The input data is not a complete block. - - - The EncryptedPrivateKeyInfo structure was decoded but was not successfully interpreted, the password may be incorrect. - - - Plaintext and ciphertext must have the same length. - - - EffectiveKeySize value must be at least 40 bits. - - - KeySize value must be at least as large as the EffectiveKeySize value. - - - EffectiveKeySize must be the same as KeySize in this implementation. - - - BlockSize must be 128 in this implementation. - - - The length of the data to decrypt is not valid for the size of this key. - - - The provided RSAPrivateKey value has version '{0}', but version '{1}' is the maximum supported. - - - The provided hash value is not the expected size for the specified hash algorithm. - - - Attempt to transform beyond end of buffer. - - - The specified feedback size '{0}' for CipherMode '{1}' is not supported. - - - The specified CipherMode '{0}' is not supported. - - - The algorithm identified by '{0}' is unknown, not valid for the requested usage, or was not handled. - - - '{0}' is not a known hash algorithm. - - - Unknown padding mode used. - - - The signature format '{0}' is unknown. - - - CNG provider unexpectedly terminated encryption or decryption prematurely. - - - The system cryptographic library returned error '{0}' of type '{1}' - - - The specified PaddingMode is not supported. - - - Method not supported. - - - Method not supported. Derived class must override. - - - Algorithms added to CryptoConfig must be accessible from outside their assembly. - - - CryptoConfig cannot add a mapping for a null or empty name. - - - The input to WriteEncodedValue must represent a single encoded value with no trailing data. - - - The pseudo-random key length must be {0} bytes. - - - Output keying material length can be at most {0} bytes (255 * hash length). - - - System.Security.Cryptography.Algorithms is not supported on this platform. - - - The total number of bytes extracted cannot exceed UInt32.MaxValue * hash length. - - - The current platform does not support the specified feedback size. - - diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj b/src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj index 2c4c3e75f4644a..ccd9e34fe31e1a 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj @@ -1,756 +1,11 @@  - true - $(DefineConstants);INTERNAL_ASYMMETRIC_IMPLEMENTATIONS - $(NoWarn);CA5350;CA5351;CA5379;CA5384 true - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Android;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-Browser + $(NetCoreAppCurrent) enable - - true - true - SR.SystemSecurityCryptographyAlgorithms_PlatformNotSupported - ExcludeApiList.PNSE.Browser.txt - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Common\System\Security\Cryptography\Asn1\AlgorithmIdentifierAsn.xml - - - Common\System\Security\Cryptography\Asn1\AlgorithmIdentifierAsn.xml.cs - Common\System\Security\Cryptography\Asn1\AlgorithmIdentifierAsn.xml - - - Common\System\Security\Cryptography\Asn1\AlgorithmIdentifierAsn.manual.cs - Common\System\Security\Cryptography\Asn1\AlgorithmIdentifierAsn.xml - - - Common\System\Security\Cryptography\Asn1\AttributeAsn.xml - - - Common\System\Security\Cryptography\Asn1\AttributeAsn.xml.cs - Common\System\Security\Cryptography\Asn1\AttributeAsn.xml - - - Common\System\Security\Cryptography\Asn1\CurveAsn.xml - - - Common\System\Security\Cryptography\Asn1\CurveAsn.xml.cs - Common\System\Security\Cryptography\Asn1\CurveAsn.xml - - - Common\System\Security\Cryptography\Asn1\DssParms.xml - - - Common\System\Security\Cryptography\Asn1\DssParms.xml.cs - Common\System\Security\Cryptography\Asn1\DssParms.xml - - - Common\System\Security\Cryptography\Asn1\ECDomainParameters.xml - - - Common\System\Security\Cryptography\Asn1\ECDomainParameters.xml.cs - Common\System\Security\Cryptography\Asn1\ECDomainParameters.xml - - - Common\System\Security\Cryptography\Asn1\ECPrivateKey.xml - - - Common\System\Security\Cryptography\Asn1\ECPrivateKey.xml.cs - Common\System\Security\Cryptography\Asn1\ECPrivateKey.xml - - - Common\System\Security\Cryptography\Asn1\EncryptedPrivateKeyInfoAsn.xml - - - Common\System\Security\Cryptography\Asn1\EncryptedPrivateKeyInfoAsn.xml.cs - Common\System\Security\Cryptography\Asn1\EncryptedPrivateKeyInfoAsn.xml - - - Common\System\Security\Cryptography\Asn1\FieldID.xml - - - Common\System\Security\Cryptography\Asn1\FieldID.xml.cs - Common\System\Security\Cryptography\Asn1\FieldID.xml - - - Common\System\Security\Cryptography\Asn1\PBEParameter.xml - - - Common\System\Security\Cryptography\Asn1\PBEParameter.xml.cs - Common\System\Security\Cryptography\Asn1\PBEParameter.xml - - - Common\System\Security\Cryptography\Asn1\PBES2Params.xml - - - Common\System\Security\Cryptography\Asn1\PBES2Params.xml.cs - Common\System\Security\Cryptography\Asn1\PBES2Params.xml - - - Common\System\Security\Cryptography\Asn1\Pbkdf2Params.xml - - - Common\System\Security\Cryptography\Asn1\Pbkdf2Params.xml.cs - Common\System\Security\Cryptography\Asn1\Pbkdf2Params.xml - - - Common\System\Security\Cryptography\Asn1\Pbkdf2SaltChoice.xml - - - Common\System\Security\Cryptography\Asn1\Pbkdf2SaltChoice.xml.cs - Common\System\Security\Cryptography\Asn1\Pbkdf2SaltChoice.xml - - - Common\System\Security\Cryptography\Asn1\PrivateKeyInfoAsn.xml - - - Common\System\Security\Cryptography\Asn1\PrivateKeyInfoAsn.xml.cs - Common\System\Security\Cryptography\Asn1\PrivateKeyInfoAsn.xml - - - Common\System\Security\Cryptography\Asn1\Rc2CbcParameters.xml - - - Common\System\Security\Cryptography\Asn1\Rc2CbcParameters.xml.cs - Common\System\Security\Cryptography\Asn1\Rc2CbcParameters.xml - - - Common\System\Security\Cryptography\Asn1\Rc2CbcParameters.manual.cs - Common\System\Security\Cryptography\Asn1\Rc2CbcParameters.xml - - - Common\System\Security\Cryptography\Asn1\RSAPrivateKeyAsn.xml - - - Common\System\Security\Cryptography\Asn1\RSAPrivateKeyAsn.xml.cs - Common\System\Security\Cryptography\Asn1\RSAPrivateKeyAsn.xml - - - Common\System\Security\Cryptography\Asn1\RSAPublicKeyAsn.xml - - - Common\System\Security\Cryptography\Asn1\RSAPublicKeyAsn.xml.cs - Common\System\Security\Cryptography\Asn1\RSAPublicKeyAsn.xml - - - Common\System\Security\Cryptography\Asn1\SpecifiedECDomain.xml - - - Common\System\Security\Cryptography\Asn1\SpecifiedECDomain.xml.cs - Common\System\Security\Cryptography\Asn1\SpecifiedECDomain.xml - - - Common\System\Security\Cryptography\Asn1\SubjectPublicKeyInfoAsn.xml - - - Common\System\Security\Cryptography\Asn1\SubjectPublicKeyInfoAsn.xml.cs - Common\System\Security\Cryptography\Asn1\SubjectPublicKeyInfoAsn.xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CryptoConfig.Browser.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CryptoConfig.Browser.cs deleted file mode 100644 index 6564a0d48ca290..00000000000000 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CryptoConfig.Browser.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Reflection; -using System.Runtime.Versioning; - -namespace System.Security.Cryptography -{ - public partial class CryptoConfig - { - [UnsupportedOSPlatform("browser")] - public static void AddAlgorithm(Type algorithm, params string[] names) => throw new PlatformNotSupportedException(SR.SystemSecurityCryptographyAlgorithms_PlatformNotSupported); - - [UnsupportedOSPlatform("browser")] - public static void AddOID(string oid, params string[] names) => throw new PlatformNotSupportedException(SR.SystemSecurityCryptographyAlgorithms_PlatformNotSupported); - - [UnsupportedOSPlatform("browser")] - public static string? MapNameToOID(string name) => throw new PlatformNotSupportedException(SR.SystemSecurityCryptographyAlgorithms_PlatformNotSupported); - - [UnsupportedOSPlatform("browser")] - [Obsolete(Obsoletions.CryptoConfigEncodeOIDMessage, DiagnosticId = Obsoletions.CryptoConfigEncodeOIDDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] - public static byte[] EncodeOID(string str) => throw new PlatformNotSupportedException(SR.SystemSecurityCryptographyAlgorithms_PlatformNotSupported); - - [RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] - public static object? CreateFromName(string name, params object?[]? args) - { - if (name == null) - throw new ArgumentNullException(nameof(name)); - - switch (name) - { -#pragma warning disable SYSLIB0021 // Obsolete: derived cryptographic types - // hardcode mapping for SHA* algorithm names from https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.cryptoconfig?view=net-5.0#remarks - case "SHA": - case "SHA1": - case "System.Security.Cryptography.SHA1": - return new SHA1Managed(); - case "SHA256": - case "SHA-256": - case "System.Security.Cryptography.SHA256": - return new SHA256Managed(); - case "SHA384": - case "SHA-384": - case "System.Security.Cryptography.SHA384": - return new SHA384Managed(); - case "SHA512": - case "SHA-512": - case "System.Security.Cryptography.SHA512": - return new SHA512Managed(); -#pragma warning restore SYSLIB0021 - } - - return null; - } - - [RequiresUnreferencedCode(CreateFromNameUnreferencedCodeMessage)] - public static object? CreateFromName(string name) - { - return CreateFromName(name, null); - } - } -} diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.cs deleted file mode 100644 index a1661ab9ed701e..00000000000000 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.cs +++ /dev/null @@ -1,631 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Diagnostics.CodeAnalysis; -using System.Formats.Asn1; -using System.Runtime.Versioning; -using System.Security.Cryptography.Asn1; -using Internal.Cryptography; - -namespace System.Security.Cryptography -{ - /// - /// Abstract base class for implementations of elliptic curve Diffie-Hellman to derive from - /// - [UnsupportedOSPlatform("browser")] - public abstract partial class ECDiffieHellman : AsymmetricAlgorithm - { - private static readonly string[] s_validOids = - { - Oids.EcPublicKey, - // Neither Windows nor OpenSSL seem to read id-ecDH Pkcs8/SPKI. - // ECMQV is not valid in this context. - }; - - public override string KeyExchangeAlgorithm - { - get { return "ECDiffieHellman"; } - } - - public override string? SignatureAlgorithm - { - get { return null; } - } - - [RequiresUnreferencedCode(CryptoConfig.CreateFromNameUnreferencedCodeMessage)] - public static new ECDiffieHellman? Create(string algorithm) - { - if (algorithm == null) - { - throw new ArgumentNullException(nameof(algorithm)); - } - - return CryptoConfig.CreateFromName(algorithm) as ECDiffieHellman; - } - - public abstract ECDiffieHellmanPublicKey PublicKey { get; } - - // This method must be implemented by derived classes. In order to conform to the contract, it cannot be abstract. - public virtual byte[] DeriveKeyMaterial(ECDiffieHellmanPublicKey otherPartyPublicKey) - { - throw DerivedClassMustOverride(); - } - - /// - /// Derive key material using the formula HASH(x) where x is the computed result of the EC Diffie-Hellman algorithm. - /// - /// The public key of the party with which to derive a mutual secret. - /// The identifier for the hash algorithm to use. - /// A hashed output suitable for key material - /// is over a different curve than this key - public byte[] DeriveKeyFromHash(ECDiffieHellmanPublicKey otherPartyPublicKey, HashAlgorithmName hashAlgorithm) - { - return DeriveKeyFromHash(otherPartyPublicKey, hashAlgorithm, null, null); - } - - /// - /// Derive key material using the formula HASH(secretPrepend || x || secretAppend) where x is the computed - /// result of the EC Diffie-Hellman algorithm. - /// - /// The public key of the party with which to derive a mutual secret. - /// The identifier for the hash algorithm to use. - /// A value to prepend to the derived secret before hashing. A null value is treated as an empty array. - /// A value to append to the derived secret before hashing. A null value is treated as an empty array. - /// A hashed output suitable for key material - /// is over a different curve than this key - public virtual byte[] DeriveKeyFromHash( - ECDiffieHellmanPublicKey otherPartyPublicKey, - HashAlgorithmName hashAlgorithm, - byte[]? secretPrepend, - byte[]? secretAppend) - { - throw DerivedClassMustOverride(); - } - - /// - /// Derive key material using the formula HMAC(hmacKey, x) where x is the computed - /// result of the EC Diffie-Hellman algorithm. - /// - /// The public key of the party with which to derive a mutual secret. - /// The identifier for the hash algorithm to use. - /// The key to use in the HMAC. A null value indicates that the result of the EC Diffie-Hellman algorithm should be used as the HMAC key. - /// A hashed output suitable for key material - /// is over a different curve than this key - public byte[] DeriveKeyFromHmac( - ECDiffieHellmanPublicKey otherPartyPublicKey, - HashAlgorithmName hashAlgorithm, - byte[]? hmacKey) - { - return DeriveKeyFromHmac(otherPartyPublicKey, hashAlgorithm, hmacKey, null, null); - } - - /// - /// Derive key material using the formula HMAC(hmacKey, secretPrepend || x || secretAppend) where x is the computed - /// result of the EC Diffie-Hellman algorithm. - /// - /// The public key of the party with which to derive a mutual secret. - /// The identifier for the hash algorithm to use. - /// The key to use in the HMAC. A null value indicates that the result of the EC Diffie-Hellman algorithm should be used as the HMAC key. - /// A value to prepend to the derived secret before hashing. A null value is treated as an empty array. - /// A value to append to the derived secret before hashing. A null value is treated as an empty array. - /// A hashed output suitable for key material - /// is over a different curve than this key - public virtual byte[] DeriveKeyFromHmac( - ECDiffieHellmanPublicKey otherPartyPublicKey, - HashAlgorithmName hashAlgorithm, - byte[]? hmacKey, - byte[]? secretPrepend, - byte[]? secretAppend) - { - throw DerivedClassMustOverride(); - } - - /// - /// Derive key material using the TLS pseudo-random function (PRF) derivation algorithm. - /// - /// The public key of the party with which to derive a mutual secret. - /// The ASCII encoded PRF label. - /// The 64-byte PRF seed. - /// A 48-byte output of the TLS pseudo-random function. - /// is over a different curve than this key - /// is null - /// is null - /// is not exactly 64 bytes in length - public virtual byte[] DeriveKeyTls(ECDiffieHellmanPublicKey otherPartyPublicKey, byte[] prfLabel, byte[] prfSeed) - { - throw DerivedClassMustOverride(); - } - - private static Exception DerivedClassMustOverride() - { - return new NotImplementedException(SR.NotSupported_SubclassOverride); - } - - /// - /// When overridden in a derived class, exports the named or explicit ECParameters for an ECCurve. - /// If the curve has a name, the Curve property will contain named curve parameters, otherwise it - /// will contain explicit parameters. - /// - /// true to include private parameters, otherwise, false. - /// The ECParameters representing the point on the curve for this key. - public virtual ECParameters ExportParameters(bool includePrivateParameters) - { - throw DerivedClassMustOverride(); - } - - /// - /// When overridden in a derived class, exports the explicit ECParameters for an ECCurve. - /// - /// true to include private parameters, otherwise, false. - /// The ECParameters representing the point on the curve for this key, using the explicit curve format. - public virtual ECParameters ExportExplicitParameters(bool includePrivateParameters) - { - throw DerivedClassMustOverride(); - } - - /// - /// When overridden in a derived class, imports the specified ECParameters. - /// - /// The curve parameters. - public virtual void ImportParameters(ECParameters parameters) - { - throw DerivedClassMustOverride(); - } - - /// - /// When overridden in a derived class, generates a new public/private keypair for the specified curve. - /// - /// The curve to use. - public virtual void GenerateKey(ECCurve curve) - { - throw new NotSupportedException(SR.NotSupported_SubclassOverride); - } - - public override unsafe bool TryExportEncryptedPkcs8PrivateKey( - ReadOnlySpan passwordBytes, - PbeParameters pbeParameters, - Span destination, - out int bytesWritten) - { - if (pbeParameters == null) - throw new ArgumentNullException(nameof(pbeParameters)); - - PasswordBasedEncryption.ValidatePbeParameters( - pbeParameters, - ReadOnlySpan.Empty, - passwordBytes); - - ECParameters ecParameters = ExportParameters(true); - - fixed (byte* privPtr = ecParameters.D) - { - try - { - AsnWriter pkcs8PrivateKey = EccKeyFormatHelper.WritePkcs8PrivateKey(ecParameters); - - AsnWriter writer = KeyFormatHelper.WriteEncryptedPkcs8( - passwordBytes, - pkcs8PrivateKey, - pbeParameters); - - return writer.TryEncode(destination, out bytesWritten); - } - finally - { - CryptographicOperations.ZeroMemory(ecParameters.D); - } - } - } - - public override unsafe bool TryExportEncryptedPkcs8PrivateKey( - ReadOnlySpan password, - PbeParameters pbeParameters, - Span destination, - out int bytesWritten) - { - if (pbeParameters == null) - throw new ArgumentNullException(nameof(pbeParameters)); - - PasswordBasedEncryption.ValidatePbeParameters( - pbeParameters, - password, - ReadOnlySpan.Empty); - - ECParameters ecParameters = ExportParameters(true); - - fixed (byte* privPtr = ecParameters.D) - { - try - { - AsnWriter pkcs8PrivateKey = EccKeyFormatHelper.WritePkcs8PrivateKey(ecParameters); - - AsnWriter writer = KeyFormatHelper.WriteEncryptedPkcs8( - password, - pkcs8PrivateKey, - pbeParameters); - - return writer.TryEncode(destination, out bytesWritten); - } - finally - { - CryptographicOperations.ZeroMemory(ecParameters.D); - } - } - } - - public override unsafe bool TryExportPkcs8PrivateKey( - Span destination, - out int bytesWritten) - { - ECParameters ecParameters = ExportParameters(true); - - fixed (byte* privPtr = ecParameters.D) - { - try - { - AsnWriter writer = EccKeyFormatHelper.WritePkcs8PrivateKey(ecParameters); - return writer.TryEncode(destination, out bytesWritten); - } - finally - { - CryptographicOperations.ZeroMemory(ecParameters.D); - } - } - } - - public override bool TryExportSubjectPublicKeyInfo( - Span destination, - out int bytesWritten) - { - ECParameters ecParameters = ExportParameters(false); - - AsnWriter writer = EccKeyFormatHelper.WriteSubjectPublicKeyInfo(ecParameters); - return writer.TryEncode(destination, out bytesWritten); - } - - public override unsafe void ImportEncryptedPkcs8PrivateKey( - ReadOnlySpan passwordBytes, - ReadOnlySpan source, - out int bytesRead) - { - KeyFormatHelper.ReadEncryptedPkcs8( - s_validOids, - source, - passwordBytes, - EccKeyFormatHelper.FromECPrivateKey, - out int localRead, - out ECParameters ret); - - fixed (byte* privPin = ret.D) - { - try - { - ImportParameters(ret); - bytesRead = localRead; - } - finally - { - CryptographicOperations.ZeroMemory(ret.D); - } - } - } - - public override unsafe void ImportEncryptedPkcs8PrivateKey( - ReadOnlySpan password, - ReadOnlySpan source, - out int bytesRead) - { - KeyFormatHelper.ReadEncryptedPkcs8( - s_validOids, - source, - password, - EccKeyFormatHelper.FromECPrivateKey, - out int localRead, - out ECParameters ret); - - fixed (byte* privPin = ret.D) - { - try - { - ImportParameters(ret); - bytesRead = localRead; - } - finally - { - CryptographicOperations.ZeroMemory(ret.D); - } - } - } - - public override unsafe void ImportPkcs8PrivateKey( - ReadOnlySpan source, - out int bytesRead) - { - KeyFormatHelper.ReadPkcs8( - s_validOids, - source, - EccKeyFormatHelper.FromECPrivateKey, - out int localRead, - out ECParameters key); - - fixed (byte* privPin = key.D) - { - try - { - ImportParameters(key); - bytesRead = localRead; - } - finally - { - CryptographicOperations.ZeroMemory(key.D); - } - } - } - - public override void ImportSubjectPublicKeyInfo( - ReadOnlySpan source, - out int bytesRead) - { - KeyFormatHelper.ReadSubjectPublicKeyInfo( - s_validOids, - source, - EccKeyFormatHelper.FromECPublicKey, - out int localRead, - out ECParameters key); - - ImportParameters(key); - bytesRead = localRead; - } - - public virtual unsafe void ImportECPrivateKey(ReadOnlySpan source, out int bytesRead) - { - ECParameters ecParameters = EccKeyFormatHelper.FromECPrivateKey(source, out int localRead); - - fixed (byte* privPin = ecParameters.D) - { - try - { - ImportParameters(ecParameters); - bytesRead = localRead; - } - finally - { - CryptographicOperations.ZeroMemory(ecParameters.D); - } - } - } - - public virtual unsafe byte[] ExportECPrivateKey() - { - ECParameters ecParameters = ExportParameters(true); - - fixed (byte* privPin = ecParameters.D) - { - try - { - AsnWriter writer = EccKeyFormatHelper.WriteECPrivateKey(ecParameters); - return writer.Encode(); - } - finally - { - CryptographicOperations.ZeroMemory(ecParameters.D); - } - } - } - - public virtual unsafe bool TryExportECPrivateKey(Span destination, out int bytesWritten) - { - ECParameters ecParameters = ExportParameters(true); - - fixed (byte* privPin = ecParameters.D) - { - try - { - AsnWriter writer = EccKeyFormatHelper.WriteECPrivateKey(ecParameters); - return writer.TryEncode(destination, out bytesWritten); - } - finally - { - CryptographicOperations.ZeroMemory(ecParameters.D); - } - } - } - - /// - /// Imports an RFC 7468 PEM-encoded key, replacing the keys for this object. - /// - /// The PEM text of the key to import. - /// - /// - /// does not contain a PEM-encoded key with a recognized label. - /// - /// - /// -or- - /// - /// - /// contains multiple PEM-encoded keys with a recognized label. - /// - /// - /// -or- - /// - /// - /// contains an encrypted PEM-encoded key. - /// - /// - /// - /// - /// Unsupported or malformed PEM-encoded objects will be ignored. If multiple supported PEM labels - /// are found, an exception is raised to prevent importing a key when - /// the key is ambiguous. - /// - /// - /// This method supports the following PEM labels: - /// - /// PUBLIC KEY - /// PRIVATE KEY - /// EC PRIVATE KEY - /// - /// - /// - public override void ImportFromPem(ReadOnlySpan input) - { - PemKeyImportHelpers.ImportPem(input, label => { - if (label.SequenceEqual(PemLabels.Pkcs8PrivateKey)) - { - return ImportPkcs8PrivateKey; - } - else if (label.SequenceEqual(PemLabels.SpkiPublicKey)) - { - return ImportSubjectPublicKeyInfo; - } - else if (label.SequenceEqual(PemLabels.EcPrivateKey)) - { - return ImportECPrivateKey; - } - else - { - return null; - } - }); - } - - /// - /// Imports an encrypted RFC 7468 PEM-encoded private key, replacing the keys for this object. - /// - /// The PEM text of the encrypted key to import. - /// - /// The password to use for decrypting the key material. - /// - /// - /// - /// does not contain a PEM-encoded key with a recognized label. - /// - /// - /// -or- - /// - /// - /// contains multiple PEM-encoded keys with a recognized label. - /// - /// - /// - /// - /// The password is incorrect. - /// - /// - /// -or- - /// - /// - /// The base-64 decoded contents of the PEM text from - /// do not represent an ASN.1-BER-encoded PKCS#8 EncryptedPrivateKeyInfo structure. - /// - /// - /// -or- - /// - /// - /// The base-64 decoded contents of the PEM text from - /// indicate the key is for an algorithm other than the algorithm - /// represented by this instance. - /// - /// - /// -or- - /// - /// - /// The base-64 decoded contents of the PEM text from - /// represent the key in a format that is not supported. - /// - /// - /// -or- - /// - /// - /// The algorithm-specific key import failed. - /// - /// - /// - /// - /// When the base-64 decoded contents of indicate an algorithm that uses PBKDF1 - /// (Password-Based Key Derivation Function 1) or PBKDF2 (Password-Based Key Derivation Function 2), - /// the password is converted to bytes via the UTF-8 encoding. - /// - /// - /// Unsupported or malformed PEM-encoded objects will be ignored. If multiple supported PEM labels - /// are found, an exception is thrown to prevent importing a key when - /// the key is ambiguous. - /// - /// This method supports the ENCRYPTED PRIVATE KEY PEM label. - /// - public override void ImportFromEncryptedPem(ReadOnlySpan input, ReadOnlySpan password) - { - PemKeyImportHelpers.ImportEncryptedPem(input, password, ImportEncryptedPkcs8PrivateKey); - } - - /// - /// Imports an encrypted RFC 7468 PEM-encoded private key, replacing the keys for this object. - /// - /// The PEM text of the encrypted key to import. - /// - /// The bytes to use as a password when decrypting the key material. - /// - /// - /// - /// does not contain a PEM-encoded key with a recognized label. - /// - /// - /// -or- - /// - /// - /// contains multiple PEM-encoded keys with a recognized label. - /// - /// - /// - /// - /// The password is incorrect. - /// - /// - /// -or- - /// - /// - /// The base-64 decoded contents of the PEM text from - /// do not represent an ASN.1-BER-encoded PKCS#8 EncryptedPrivateKeyInfo structure. - /// - /// - /// -or- - /// - /// - /// The base-64 decoded contents of the PEM text from - /// indicate the key is for an algorithm other than the algorithm - /// represented by this instance. - /// - /// - /// -or- - /// - /// - /// The base-64 decoded contents of the PEM text from - /// represent the key in a format that is not supported. - /// - /// - /// -or- - /// - /// - /// The algorithm-specific key import failed. - /// - /// - /// - /// - /// The password bytes are passed directly into the Key Derivation Function (KDF) - /// used by the algorithm indicated by pbeParameters. This enables compatibility - /// with other systems which use a text encoding other than UTF-8 when processing - /// passwords with PBKDF2 (Password-Based Key Derivation Function 2). - /// - /// - /// Unsupported or malformed PEM-encoded objects will be ignored. If multiple supported PEM labels - /// are found, an exception is thrown to prevent importing a key when - /// the key is ambiguous. - /// - /// This method supports the ENCRYPTED PRIVATE KEY PEM label. - /// - public override void ImportFromEncryptedPem(ReadOnlySpan input, ReadOnlySpan passwordBytes) - { - PemKeyImportHelpers.ImportEncryptedPem(input, passwordBytes, ImportEncryptedPkcs8PrivateKey); - } - } -} diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/CryptoConfigTests.cs b/src/libraries/System.Security.Cryptography.Algorithms/tests/CryptoConfigTests.cs deleted file mode 100644 index b724370944024f..00000000000000 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/CryptoConfigTests.cs +++ /dev/null @@ -1,444 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Collections.Generic; -using System.Reflection; -using System.Text; -using Test.Cryptography; -using Xunit; - -#pragma warning disable SYSLIB0022 // Rijndael types are obsolete - -namespace System.Security.Cryptography.CryptoConfigTests -{ - public static class CryptoConfigTests - { - [Fact] - public static void AllowOnlyFipsAlgorithms() - { - Assert.False(CryptoConfig.AllowOnlyFipsAlgorithms); - } - - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public static void AddOID_MapNameToOID_ReturnsMapped() - { - CryptoConfig.AddOID("1.3.14.3.2.28", "SHAFancy"); - Assert.Equal("1.3.14.3.2.28", CryptoConfig.MapNameToOID("SHAFancy")); - } - - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public static void AddOID_EmptyString_Throws() - { - AssertExtensions.Throws(null, () => CryptoConfig.AddOID(string.Empty, string.Empty)); - } - - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public static void AddOID_EmptyNamesArray() - { - CryptoConfig.AddOID("1.3.14.3.2.28", new string[0]); - // There is no verifiable behavior in this case. We only check that we don't throw. - } - - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public static void AddOID_NullOid_Throws() - { - AssertExtensions.Throws("oid", () => CryptoConfig.AddOID(null, string.Empty)); - } - - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public static void AddOID_NullNames_Throws() - { - AssertExtensions.Throws("names", () => CryptoConfig.AddOID(string.Empty, null)); - } - - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public static void AddAlgorithm_CreateFromName_ReturnsMapped() - { - CryptoConfig.AddAlgorithm(typeof(AesCryptoServiceProvider), "AESFancy"); - Assert.Equal(typeof(AesCryptoServiceProvider).FullName, CryptoConfig.CreateFromName("AESFancy").GetType().FullName); - } - - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public static void AddAlgorithm_NonVisibleType() - { - AssertExtensions.Throws("algorithm", () => CryptoConfig.AddAlgorithm(typeof(AESFancy), "AESFancy")); - } - - private class AESFancy - { - } - - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public static void AddAlgorithm_EmptyString_Throws() - { - AssertExtensions.Throws(null, () => CryptoConfig.AddAlgorithm(typeof(CryptoConfigTests), string.Empty)); - } - - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public static void AddAlgorithm_EmptyNamesArray() - { - CryptoConfig.AddAlgorithm(typeof(AesCryptoServiceProvider), new string[0]); - // There is no verifiable behavior in this case. We only check that we don't throw. - } - - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public static void AddAlgorithm_NullAlgorithm_Throws() - { - AssertExtensions.Throws("algorithm", () => CryptoConfig.AddAlgorithm(null, string.Empty)); - } - - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public static void AddAlgorithm_NullNames_Throws() - { - AssertExtensions.Throws("names", () => CryptoConfig.AddAlgorithm(typeof(CryptoConfigTests), null)); - } - - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public static void StaticCreateMethods() - { - // Ensure static create methods exist and don't throw - - // Some do not have public concrete types (in Algorithms assembly) so in those cases we only check for null\failure. - VerifyStaticCreateResult(Aes.Create(typeof(AesManaged).FullName), typeof(AesManaged)); - Assert.Null(DES.Create(string.Empty)); - Assert.Null(DSA.Create(string.Empty)); - Assert.Null(ECDsa.Create(string.Empty)); - Assert.Null(MD5.Create(string.Empty)); - Assert.Null(RandomNumberGenerator.Create(string.Empty)); - Assert.Null(RC2.Create(string.Empty)); - VerifyStaticCreateResult(Rijndael.Create(typeof(RijndaelManaged).FullName), typeof(RijndaelManaged)); - Assert.Null(RSA.Create(string.Empty)); - Assert.Null(SHA1.Create(string.Empty)); - VerifyStaticCreateResult(SHA256.Create(typeof(SHA256Managed).FullName), typeof(SHA256Managed)); - VerifyStaticCreateResult(SHA384.Create(typeof(SHA384Managed).FullName), typeof(SHA384Managed)); - VerifyStaticCreateResult(SHA512.Create(typeof(SHA512Managed).FullName), typeof(SHA512Managed)); - } - - private static void VerifyStaticCreateResult(object obj, Type expectedType) - { - Assert.NotNull(obj); - Assert.IsType(expectedType, obj); - } - - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public static void MapNameToOID() - { - Assert.Throws(() => CryptoConfig.MapNameToOID(null)); - - // Test some oids unique to CryptoConfig - Assert.Equal("1.3.14.3.2.26", CryptoConfig.MapNameToOID("SHA")); - Assert.Equal("1.3.14.3.2.26", CryptoConfig.MapNameToOID("sha")); - Assert.Equal("1.2.840.113549.3.7", CryptoConfig.MapNameToOID("TripleDES")); - - // Test fallback to Oid class - Assert.Equal("1.3.36.3.3.2.8.1.1.8", CryptoConfig.MapNameToOID("brainpoolP256t1")); - - // Invalid oid - Assert.Null(CryptoConfig.MapNameToOID("NOT_A_VALID_OID")); - } - - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public static void CreateFromName_validation() - { - Assert.Throws(() => CryptoConfig.CreateFromName(null)); - Assert.Throws(() => CryptoConfig.CreateFromName(null, null)); - Assert.Throws(() => CryptoConfig.CreateFromName(null, string.Empty)); - Assert.Null(CryptoConfig.CreateFromName(string.Empty, null)); - Assert.Null(CryptoConfig.CreateFromName("SHA", 1, 2)); - } - - public static IEnumerable AllValidNames - { - get - { - if (PlatformDetection.IsBrowser) - { - // Hash functions - yield return new object[] { "SHA", typeof(SHA1Managed).FullName, true }; - yield return new object[] { "SHA1", typeof(SHA1Managed).FullName, true }; - yield return new object[] { "System.Security.Cryptography.SHA1", typeof(SHA1Managed).FullName, true }; - yield return new object[] { "SHA256", typeof(SHA256Managed).FullName, true }; - yield return new object[] { "SHA-256", typeof(SHA256Managed).FullName, true }; - yield return new object[] { "System.Security.Cryptography.SHA256", typeof(SHA256Managed).FullName, true }; - yield return new object[] { "SHA384", typeof(SHA384Managed).FullName, true }; - yield return new object[] { "SHA-384", typeof(SHA384Managed).FullName, true }; - yield return new object[] { "System.Security.Cryptography.SHA384", typeof(SHA384Managed).FullName, true }; - yield return new object[] { "SHA512", typeof(SHA512Managed).FullName, true }; - yield return new object[] { "SHA-512", typeof(SHA512Managed).FullName, true }; - yield return new object[] { "System.Security.Cryptography.SHA512", typeof(SHA512Managed).FullName, true }; - } - else - { - // Random number generator - yield return new object[] { "RandomNumberGenerator", "System.Security.Cryptography.RNGCryptoServiceProvider", true }; - yield return new object[] { "System.Security.Cryptography.RandomNumberGenerator", "System.Security.Cryptography.RNGCryptoServiceProvider", true }; - - // Hash functions - yield return new object[] { "SHA", "System.Security.Cryptography.SHA1CryptoServiceProvider", true }; - yield return new object[] { "SHA1", "System.Security.Cryptography.SHA1CryptoServiceProvider", true }; - yield return new object[] { "System.Security.Cryptography.SHA1", "System.Security.Cryptography.SHA1CryptoServiceProvider", true }; - yield return new object[] { "System.Security.Cryptography.HashAlgorithm", "System.Security.Cryptography.SHA1CryptoServiceProvider", true }; - yield return new object[] { "MD5", "System.Security.Cryptography.MD5CryptoServiceProvider", true }; - yield return new object[] { "System.Security.Cryptography.MD5", "System.Security.Cryptography.MD5CryptoServiceProvider", true }; - yield return new object[] { "SHA256", typeof(SHA256Managed).FullName, true }; - yield return new object[] { "SHA-256", typeof(SHA256Managed).FullName, true }; - yield return new object[] { "System.Security.Cryptography.SHA256", typeof(SHA256Managed).FullName, true }; - yield return new object[] { "SHA384", typeof(SHA384Managed).FullName, true }; - yield return new object[] { "SHA-384", typeof(SHA384Managed).FullName, true }; - yield return new object[] { "System.Security.Cryptography.SHA384", typeof(SHA384Managed).FullName, true }; - yield return new object[] { "SHA512", typeof(SHA512Managed).FullName, true }; - yield return new object[] { "SHA-512", typeof(SHA512Managed).FullName, true }; - yield return new object[] { "System.Security.Cryptography.SHA512", typeof(SHA512Managed).FullName, true }; - - // Keyed Hash Algorithms - yield return new object[] { "System.Security.Cryptography.HMAC", "System.Security.Cryptography.HMACSHA1", true }; - yield return new object[] { "System.Security.Cryptography.KeyedHashAlgorithm", "System.Security.Cryptography.HMACSHA1", true }; - yield return new object[] { "HMACMD5", "System.Security.Cryptography.HMACMD5", true }; - yield return new object[] { "System.Security.Cryptography.HMACMD5", null, true }; - yield return new object[] { "HMACSHA1", "System.Security.Cryptography.HMACSHA1", true }; - yield return new object[] { "System.Security.Cryptography.HMACSHA1", null, true }; - yield return new object[] { "HMACSHA256", "System.Security.Cryptography.HMACSHA256", true }; - yield return new object[] { "System.Security.Cryptography.HMACSHA256", null, true }; - yield return new object[] { "HMACSHA384", "System.Security.Cryptography.HMACSHA384", true }; - yield return new object[] { "System.Security.Cryptography.HMACSHA384", null, true }; - yield return new object[] { "HMACSHA512", "System.Security.Cryptography.HMACSHA512", true }; - yield return new object[] { "System.Security.Cryptography.HMACSHA512", null, true }; - - // Asymmetric algorithms - yield return new object[] { "RSA", "System.Security.Cryptography.RSACryptoServiceProvider", true }; - yield return new object[] { "System.Security.Cryptography.RSA", "System.Security.Cryptography.RSACryptoServiceProvider", true }; - yield return new object[] { "System.Security.Cryptography.AsymmetricAlgorithm", "System.Security.Cryptography.RSACryptoServiceProvider", true }; - if (!PlatformDetection.UsesMobileAppleCrypto) - { - yield return new object[] { "DSA", "System.Security.Cryptography.DSACryptoServiceProvider", true }; - yield return new object[] { "System.Security.Cryptography.DSA", "System.Security.Cryptography.DSACryptoServiceProvider", true }; - } - yield return new object[] { "ECDsa", "System.Security.Cryptography.ECDsaCng", true }; - yield return new object[] { "ECDsaCng", "System.Security.Cryptography.ECDsaCng", false }; - yield return new object[] { "System.Security.Cryptography.ECDsaCng", null, false }; - yield return new object[] { "DES", "System.Security.Cryptography.DESCryptoServiceProvider", true }; - yield return new object[] { "System.Security.Cryptography.DES", "System.Security.Cryptography.DESCryptoServiceProvider", true }; - yield return new object[] { "3DES", "System.Security.Cryptography.TripleDESCryptoServiceProvider", true }; - yield return new object[] { "TripleDES", "System.Security.Cryptography.TripleDESCryptoServiceProvider", true }; - yield return new object[] { "Triple DES", "System.Security.Cryptography.TripleDESCryptoServiceProvider", true }; - yield return new object[] { "System.Security.Cryptography.TripleDES", "System.Security.Cryptography.TripleDESCryptoServiceProvider", true }; - yield return new object[] { "RC2", "System.Security.Cryptography.RC2CryptoServiceProvider", true }; - yield return new object[] { "System.Security.Cryptography.RC2", "System.Security.Cryptography.RC2CryptoServiceProvider", true }; - yield return new object[] { "Rijndael", typeof(RijndaelManaged).FullName, true }; - yield return new object[] { "System.Security.Cryptography.Rijndael", typeof(RijndaelManaged).FullName, true }; - yield return new object[] { "System.Security.Cryptography.SymmetricAlgorithm", typeof(RijndaelManaged).FullName, true }; - yield return new object[] { "AES", "System.Security.Cryptography.AesCryptoServiceProvider", true }; - yield return new object[] { "AesCryptoServiceProvider", "System.Security.Cryptography.AesCryptoServiceProvider", true }; - yield return new object[] { "System.Security.Cryptography.AesCryptoServiceProvider", "System.Security.Cryptography.AesCryptoServiceProvider", true }; - yield return new object[] { "AesManaged", typeof(AesManaged).FullName, true }; - yield return new object[] { "System.Security.Cryptography.AesManaged", typeof(AesManaged).FullName, true }; - - // Xml Dsig/ Enc Hash algorithms - yield return new object[] { "http://www.w3.org/2000/09/xmldsig#sha1", "System.Security.Cryptography.SHA1CryptoServiceProvider", true }; - yield return new object[] { "http://www.w3.org/2001/04/xmlenc#sha256", typeof(SHA256Managed).FullName, true }; - yield return new object[] { "http://www.w3.org/2001/04/xmlenc#sha512", typeof(SHA512Managed).FullName, true }; - - // Xml Encryption symmetric keys - yield return new object[] { "http://www.w3.org/2001/04/xmlenc#des-cbc", "System.Security.Cryptography.DESCryptoServiceProvider", true }; - yield return new object[] { "http://www.w3.org/2001/04/xmlenc#tripledes-cbc", "System.Security.Cryptography.TripleDESCryptoServiceProvider", true }; - yield return new object[] { "http://www.w3.org/2001/04/xmlenc#kw-tripledes", "System.Security.Cryptography.TripleDESCryptoServiceProvider", true }; - yield return new object[] { "http://www.w3.org/2001/04/xmlenc#aes128-cbc", typeof(RijndaelManaged).FullName, true }; - yield return new object[] { "http://www.w3.org/2001/04/xmlenc#kw-aes128", typeof(RijndaelManaged).FullName, true }; - yield return new object[] { "http://www.w3.org/2001/04/xmlenc#aes192-cbc", typeof(RijndaelManaged).FullName, true }; - yield return new object[] { "http://www.w3.org/2001/04/xmlenc#kw-aes192", typeof(RijndaelManaged).FullName, true }; - yield return new object[] { "http://www.w3.org/2001/04/xmlenc#aes256-cbc", typeof(RijndaelManaged).FullName, true }; - yield return new object[] { "http://www.w3.org/2001/04/xmlenc#kw-aes256", typeof(RijndaelManaged).FullName, true }; - - // Xml Dsig HMAC URIs from http://www.w3.org/TR/xmldsig-core/ - yield return new object[] { "http://www.w3.org/2000/09/xmldsig#hmac-sha1", typeof(HMACSHA1).FullName, true }; - yield return new object[] { "http://www.w3.org/2001/04/xmldsig-more#sha384", typeof(SHA384Managed).FullName, true }; - yield return new object[] { "http://www.w3.org/2001/04/xmldsig-more#hmac-md5", typeof(HMACMD5).FullName, true }; - yield return new object[] { "http://www.w3.org/2001/04/xmldsig-more#hmac-sha256", typeof(HMACSHA256).FullName, true }; - yield return new object[] { "http://www.w3.org/2001/04/xmldsig-more#hmac-sha384", typeof(HMACSHA384).FullName, true }; - yield return new object[] { "http://www.w3.org/2001/04/xmldsig-more#hmac-sha512", typeof(HMACSHA512).FullName, true }; - - // X509 - yield return new object[] { "2.5.29.10", "System.Security.Cryptography.X509Certificates.X509BasicConstraintsExtension", true }; - yield return new object[] { "2.5.29.19", "System.Security.Cryptography.X509Certificates.X509BasicConstraintsExtension", true }; - yield return new object[] { "2.5.29.14", "System.Security.Cryptography.X509Certificates.X509SubjectKeyIdentifierExtension", true }; - yield return new object[] { "2.5.29.15", "System.Security.Cryptography.X509Certificates.X509KeyUsageExtension", true }; - yield return new object[] { "2.5.29.37", "System.Security.Cryptography.X509Certificates.X509EnhancedKeyUsageExtension", true }; - yield return new object[] { "X509Chain", "System.Security.Cryptography.X509Certificates.X509Chain", true }; - - // PKCS9 attributes - yield return new object[] { "1.2.840.113549.1.9.3", "System.Security.Cryptography.Pkcs.Pkcs9ContentType", true }; - yield return new object[] { "1.2.840.113549.1.9.4", "System.Security.Cryptography.Pkcs.Pkcs9MessageDigest", true }; - yield return new object[] { "1.2.840.113549.1.9.5", "System.Security.Cryptography.Pkcs.Pkcs9SigningTime", true }; - yield return new object[] { "1.3.6.1.4.1.311.88.2.1", "System.Security.Cryptography.Pkcs.Pkcs9DocumentName", true }; - yield return new object[] { "1.3.6.1.4.1.311.88.2.2", "System.Security.Cryptography.Pkcs.Pkcs9DocumentDescription", true }; - } - } - } - - [Theory, MemberData(nameof(AllValidNames))] - public static void CreateFromName_AllValidNames(string name, string typeName, bool supportsUnixMac) - { - bool isWindows = OperatingSystem.IsWindows(); - - if (supportsUnixMac || isWindows) - { - object obj = CryptoConfig.CreateFromName(name); - Assert.NotNull(obj); - - if (typeName == null) - { - typeName = name; - } - - // ECDsa is special on non-Windows - if (isWindows || name != "ECDsa") - { - Assert.Equal(typeName, obj.GetType().FullName); - } - else - { - Assert.NotEqual(typeName, obj.GetType().FullName); - } - - if (obj is IDisposable) - { - ((IDisposable)obj).Dispose(); - } - } - else - { - // These will be the Csp types, which currently aren't supported on Mac\Unix - Assert.Throws (() => CryptoConfig.CreateFromName(name)); - } - } - - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public static void CreateFromName_CtorArguments() - { - string className = typeof(ClassWithCtorArguments).FullName + ", System.Security.Cryptography.Algorithms.Tests"; - - // Pass int instead of string - Assert.Throws(() => CryptoConfig.CreateFromName(className, 1)); - - // Valid case - object obj = CryptoConfig.CreateFromName(className, "Hello"); - Assert.NotNull(obj); - Assert.IsType(obj); - - ClassWithCtorArguments ctorObj = (ClassWithCtorArguments)obj; - Assert.Equal("Hello", ctorObj.MyString); - } - - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public static void EncodeOID_Validation() - { -#pragma warning disable SYSLIB0031 // EncodeOID is obsolete - Assert.Throws(() => CryptoConfig.EncodeOID(null)); - Assert.Throws(() => CryptoConfig.EncodeOID(string.Empty)); - Assert.Throws(() => CryptoConfig.EncodeOID("BAD.OID")); - Assert.Throws(() => CryptoConfig.EncodeOID("1.2.BAD.OID")); - Assert.Throws(() => CryptoConfig.EncodeOID("1." + uint.MaxValue)); -#pragma warning restore SYSLIB0031 - } - - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public static void EncodeOID_Compat() - { -#pragma warning disable SYSLIB0031 // EncodeOID is obsolete - string actual = CryptoConfig.EncodeOID("-1.2.-3").ByteArrayToHex(); - Assert.Equal("0602DAFD", actual); // Negative values not checked -#pragma warning restore SYSLIB0031 - } - - [Fact] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public static void EncodeOID_Length_Boundary() - { -#pragma warning disable SYSLIB0031 // EncodeOID is obsolete - string valueToRepeat = "1.1"; - - // Build a string like 1.11.11.11. ... .11.1, which has 0x80 separators. - // The BER/DER encoding of an OID has a minimum number of bytes as the number of separator characters, - // so this would produce an OID with a length segment of more than one byte, which EncodeOID can't handle. - string s = new StringBuilder(valueToRepeat.Length * 0x80).Insert(0, valueToRepeat, 0x80).ToString(); - Assert.Throws(() => CryptoConfig.EncodeOID(s)); - - // Try again with one less separator for the boundary case, but the particular output is really long - // and would just clutter up this test, so only verify it doesn't throw. - s = new StringBuilder(valueToRepeat.Length * 0x7f).Insert(0, valueToRepeat, 0x7f).ToString(); - CryptoConfig.EncodeOID(s); -#pragma warning restore SYSLIB0031 - } - - [Theory] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - [InlineData(0x4000, "0603818028")] - [InlineData(0x200000, "060481808028")] - [InlineData(0x10000000, "06058180808028")] - [InlineData(0x10000001, "06058180808029")] - [InlineData(int.MaxValue, "060127")] - public static void EncodeOID_Value_Boundary_And_Compat(uint elementValue, string expectedEncoding) - { - // Boundary cases in EncodeOID; output may produce the wrong value mathematically due to encoding - // algorithm semantics but included here for compat reasons. -#pragma warning disable SYSLIB0031 // EncodeOID is obsolete - byte[] actual = CryptoConfig.EncodeOID("1." + elementValue.ToString()); - byte[] expected = expectedEncoding.HexToByteArray(); - Assert.Equal(expected, actual); -#pragma warning restore SYSLIB0031 - } - - [Theory] - [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - [InlineData("SHA1", "1.3.14.3.2.26", "06052B0E03021A")] - [InlineData("DES", "1.3.14.3.2.7", "06052B0E030207")] - [InlineData("MD5", "1.2.840.113549.2.5", "06082A864886F70D0205")] - public static void MapAndEncodeOID(string alg, string expectedOid, string expectedEncoding) - { -#pragma warning disable SYSLIB0031 // EncodeOID is obsolete - string oid = CryptoConfig.MapNameToOID(alg); - Assert.Equal(expectedOid, oid); - - byte[] actual = CryptoConfig.EncodeOID(oid); - byte[] expected = expectedEncoding.HexToByteArray(); - Assert.Equal(expected, actual); -#pragma warning restore SYSLIB0031 - } - - private static void VerifyCreateFromName(string name) - { - object obj = CryptoConfig.CreateFromName(name); - Assert.NotNull(obj); - Assert.IsType(obj); - } - - public class ClassWithCtorArguments - { - public ClassWithCtorArguments(string s) - { - MyString = s; - } - - public string MyString; - } - } -} - -#pragma warning restore SYSLIB0022 diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/System.Security.Cryptography.Algorithms.Tests.csproj b/src/libraries/System.Security.Cryptography.Algorithms/tests/System.Security.Cryptography.Algorithms.Tests.csproj deleted file mode 100644 index f4f089bea4cf0f..00000000000000 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/System.Security.Cryptography.Algorithms.Tests.csproj +++ /dev/null @@ -1,262 +0,0 @@ - - - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Android;$(NetCoreAppCurrent)-Browser - true - true - - $(NoWarn);SYSLIB0021 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/libraries/System.Security.Cryptography.Cng/tests/AesCngTests.cs b/src/libraries/System.Security.Cryptography.Cng/tests/AesCngTests.cs index 94d5defd5cb11b..530f66cb1cc1f5 100644 --- a/src/libraries/System.Security.Cryptography.Cng/tests/AesCngTests.cs +++ b/src/libraries/System.Security.Cryptography.Cng/tests/AesCngTests.cs @@ -108,6 +108,15 @@ public static void VerifyUnsupportedFeedbackSizeForPersistedCfb() notSupportedFeedbackSizeInBits: 128); } + [OuterLoop("Creates/Deletes a persisted key, limit exposure to key leaking")] + [ConditionalFact(nameof(SupportsPersistedSymmetricKeys))] + public static void VerifyRequiresAesCngKey() + { + SymmetricCngTestHelpers.VerifyMismatchAlgorithmFails( + s_cngAlgorithm, + keyName => new TripleDESCng(keyName, CngProvider.MicrosoftSoftwareKeyStorageProvider)); + } + public static bool SupportsPersistedSymmetricKeys { get { return SymmetricCngTestHelpers.SupportsPersistedSymmetricKeys; } diff --git a/src/libraries/System.Security.Cryptography.Cng/tests/SymmetricCngTestHelpers.cs b/src/libraries/System.Security.Cryptography.Cng/tests/SymmetricCngTestHelpers.cs index 1923c6b24273fc..fae33a63498508 100644 --- a/src/libraries/System.Security.Cryptography.Cng/tests/SymmetricCngTestHelpers.cs +++ b/src/libraries/System.Security.Cryptography.Cng/tests/SymmetricCngTestHelpers.cs @@ -61,7 +61,7 @@ internal static void VerifyPersistedKey( PaddingMode paddingMode, int feedbackSizeInBits) { - byte[] plainBytes = GenerateRandom(plainBytesCount); + byte[] plainBytes = RandomNumberGenerator.GetBytes(plainBytesCount); using (SymmetricAlgorithm persisted = persistedFunc(keyName)) using (SymmetricAlgorithm ephemeral = ephemeralFunc()) @@ -195,7 +195,7 @@ public static void SetKey_DetachesFromPersistedKey( stable.GenerateIV(); // Generate (4 * 8) = 32 blocks of plaintext - byte[] plainTextBytes = GenerateRandom(4 * stable.BlockSize); + byte[] plainTextBytes = RandomNumberGenerator.GetBytes(4 * stable.BlockSize); byte[] iv = stable.IV; regenKey.IV = replaceKey.IV = iv; @@ -348,44 +348,33 @@ public static void VerifyCfbPersistedUnsupportedFeedbackSize( } } - private static bool? s_supportsPersistedSymmetricKeys; - internal static bool SupportsPersistedSymmetricKeys + internal static void VerifyMismatchAlgorithmFails( + CngAlgorithm algorithm, + Func createFromKey) { - get - { - if (!s_supportsPersistedSymmetricKeys.HasValue) - { - // Windows 7 (Microsoft Windows 6.1) does not support persisted symmetric keys - // in the Microsoft Software KSP - s_supportsPersistedSymmetricKeys = !RuntimeInformation.OSDescription.Contains("Windows 6.1"); - } + string keyName = Guid.NewGuid().ToString(); - return s_supportsPersistedSymmetricKeys.Value; - } - } + // We try to delete the key later which will also dispose of it, so no need + // to put this in a using. + CngKey cngKey = CngKey.Create(algorithm, keyName); - private static readonly Lazy s_isAdministrator = new Lazy( - () => + try { - using (WindowsIdentity identity = WindowsIdentity.GetCurrent()) - { - WindowsPrincipal principal = new WindowsPrincipal(identity); - return principal.IsInRole(WindowsBuiltInRole.Administrator); - } - }); - - internal static bool IsAdministrator => s_isAdministrator.Value; - - internal static byte[] GenerateRandom(int count) - { - byte[] buffer = new byte[count]; - using (RandomNumberGenerator rng = RandomNumberGenerator.Create()) + CryptographicException ce = Assert.Throws(() => createFromKey(keyName)); + Assert.Contains($"'{algorithm.Algorithm}'", ce.Message); + } + finally { - rng.GetBytes(buffer); + cngKey.Delete(); } - return buffer; } + // Windows 7 (Microsoft Windows 6.1) does not support persisted symmetric keys + // in the Microsoft Software KSP + internal static bool SupportsPersistedSymmetricKeys => PlatformDetection.IsWindows8xOrLater; + + internal static bool IsAdministrator => PlatformDetection.IsWindowsAndElevated; + internal static void AssertTransformsEqual(byte[] plainTextBytes, ICryptoTransform decryptor, byte[] encryptedBytes) { byte[] decrypted = decryptor.TransformFinalBlock(encryptedBytes, 0, encryptedBytes.Length); diff --git a/src/libraries/System.Security.Cryptography.Cng/tests/TripleDESCngTests.cs b/src/libraries/System.Security.Cryptography.Cng/tests/TripleDESCngTests.cs index 0e4bc9441a45b0..beeaa0f28bffca 100644 --- a/src/libraries/System.Security.Cryptography.Cng/tests/TripleDESCngTests.cs +++ b/src/libraries/System.Security.Cryptography.Cng/tests/TripleDESCngTests.cs @@ -114,6 +114,15 @@ public static void VerifyUnsupportedFeedbackSizeForPersistedCfb() notSupportedFeedbackSizeInBits: 64); } + [OuterLoop("Creates/Deletes a persisted key, limit exposure to key leaking")] + [ConditionalFact(nameof(SupportsPersistedSymmetricKeys))] + public static void VerifyRequiresTripleDESCngKey() + { + SymmetricCngTestHelpers.VerifyMismatchAlgorithmFails( + s_cngAlgorithm, + keyName => new AesCng(keyName, CngProvider.MicrosoftSoftwareKeyStorageProvider)); + } + public static bool SupportsPersistedSymmetricKeys { get { return SymmetricCngTestHelpers.SupportsPersistedSymmetricKeys; } diff --git a/src/libraries/System.Security.Cryptography.Csp/src/Resources/Strings.resx b/src/libraries/System.Security.Cryptography.Csp/src/Resources/Strings.resx index 79ece78b5d9d8c..0c2d22c90f61a2 100644 --- a/src/libraries/System.Security.Cryptography.Csp/src/Resources/Strings.resx +++ b/src/libraries/System.Security.Cryptography.Csp/src/Resources/Strings.resx @@ -122,6 +122,9 @@ Value was invalid. + + Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection. + Non-negative number required. diff --git a/src/libraries/System.Security.Cryptography.Encoding/System.Security.Cryptography.Encoding.sln b/src/libraries/System.Security.Cryptography.Encoding/System.Security.Cryptography.Encoding.sln index be50d62a1ba809..632b356b286fd7 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/System.Security.Cryptography.Encoding.sln +++ b/src/libraries/System.Security.Cryptography.Encoding/System.Security.Cryptography.Encoding.sln @@ -13,10 +13,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Security.Cryptograph EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Security.Cryptography.Encoding", "src\System.Security.Cryptography.Encoding.csproj", "{4B1D276E-6576-4F42-9F38-C91C95437F20}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Security.Cryptography.Encoding.Tests", "tests\System.Security.Cryptography.Encoding.Tests.csproj", "{8A8D5FD7-557E-42EF-AA8A-5453E82574F2}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{179D2235-ABD5-45D9-8DAB-E24763305362}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{34B969D7-6BED-4597-8C25-502A29CF0518}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{0806AC6F-4837-437A-A32F-EED211934481}" @@ -55,17 +51,11 @@ Global {4B1D276E-6576-4F42-9F38-C91C95437F20}.Debug|Any CPU.Build.0 = Debug|Any CPU {4B1D276E-6576-4F42-9F38-C91C95437F20}.Release|Any CPU.ActiveCfg = Release|Any CPU {4B1D276E-6576-4F42-9F38-C91C95437F20}.Release|Any CPU.Build.0 = Release|Any CPU - {8A8D5FD7-557E-42EF-AA8A-5453E82574F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8A8D5FD7-557E-42EF-AA8A-5453E82574F2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8A8D5FD7-557E-42EF-AA8A-5453E82574F2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8A8D5FD7-557E-42EF-AA8A-5453E82574F2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {201E9083-CCA0-4AA8-A2B2-B37AC13481E3} = {179D2235-ABD5-45D9-8DAB-E24763305362} - {8A8D5FD7-557E-42EF-AA8A-5453E82574F2} = {179D2235-ABD5-45D9-8DAB-E24763305362} {A428E072-E4DD-4F64-AFE3-DC9FC8D5563D} = {34B969D7-6BED-4597-8C25-502A29CF0518} {465CB04B-D2D8-4E64-BA6D-571BE95391B4} = {34B969D7-6BED-4597-8C25-502A29CF0518} {43B33B0D-4009-4838-B9F4-E5308C1827F7} = {0806AC6F-4837-437A-A32F-EED211934481} diff --git a/src/libraries/System.Security.Cryptography.Encoding/ref/System.Security.Cryptography.Encoding.Forwards.cs b/src/libraries/System.Security.Cryptography.Encoding/ref/System.Security.Cryptography.Encoding.Forwards.cs new file mode 100644 index 00000000000000..9320139f904bb3 --- /dev/null +++ b/src/libraries/System.Security.Cryptography.Encoding/ref/System.Security.Cryptography.Encoding.Forwards.cs @@ -0,0 +1,18 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// ------------------------------------------------------------------------------ +// Changes to this file must follow the https://aka.ms/api-review process. +// ------------------------------------------------------------------------------ + +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.AsnEncodedData))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.AsnEncodedDataCollection))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.AsnEncodedDataEnumerator))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.FromBase64Transform))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.FromBase64TransformMode))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.Oid))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.OidCollection))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.OidEnumerator))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.OidGroup))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.PemEncoding))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.PemFields))] +[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.ToBase64Transform))] diff --git a/src/libraries/System.Security.Cryptography.Encoding/ref/System.Security.Cryptography.Encoding.cs b/src/libraries/System.Security.Cryptography.Encoding/ref/System.Security.Cryptography.Encoding.cs deleted file mode 100644 index 05c36833659243..00000000000000 --- a/src/libraries/System.Security.Cryptography.Encoding/ref/System.Security.Cryptography.Encoding.cs +++ /dev/null @@ -1,145 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// ------------------------------------------------------------------------------ -// Changes to this file must follow the https://aka.ms/api-review process. -// ------------------------------------------------------------------------------ - -namespace System.Security.Cryptography -{ - public partial class AsnEncodedData - { - protected AsnEncodedData() { } - public AsnEncodedData(byte[] rawData) { } - public AsnEncodedData(System.ReadOnlySpan rawData) { } - public AsnEncodedData(System.Security.Cryptography.AsnEncodedData asnEncodedData) { } - public AsnEncodedData(System.Security.Cryptography.Oid? oid, byte[] rawData) { } - public AsnEncodedData(System.Security.Cryptography.Oid? oid, System.ReadOnlySpan rawData) { } - public AsnEncodedData(string oid, byte[] rawData) { } - public AsnEncodedData(string oid, System.ReadOnlySpan rawData) { } - public System.Security.Cryptography.Oid? Oid { get { throw null; } set { } } - public byte[] RawData { get { throw null; } set { } } - public virtual void CopyFrom(System.Security.Cryptography.AsnEncodedData asnEncodedData) { } - public virtual string Format(bool multiLine) { throw null; } - } - public sealed partial class AsnEncodedDataCollection : System.Collections.ICollection, System.Collections.IEnumerable - { - public AsnEncodedDataCollection() { } - public AsnEncodedDataCollection(System.Security.Cryptography.AsnEncodedData asnEncodedData) { } - public int Count { get { throw null; } } - public bool IsSynchronized { get { throw null; } } - public System.Security.Cryptography.AsnEncodedData this[int index] { get { throw null; } } - public object SyncRoot { get { throw null; } } - public int Add(System.Security.Cryptography.AsnEncodedData asnEncodedData) { throw null; } - public void CopyTo(System.Security.Cryptography.AsnEncodedData[] array, int index) { } - public System.Security.Cryptography.AsnEncodedDataEnumerator GetEnumerator() { throw null; } - public void Remove(System.Security.Cryptography.AsnEncodedData asnEncodedData) { } - void System.Collections.ICollection.CopyTo(System.Array array, int index) { } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public sealed partial class AsnEncodedDataEnumerator : System.Collections.IEnumerator - { - internal AsnEncodedDataEnumerator() { } - public System.Security.Cryptography.AsnEncodedData Current { get { throw null; } } - object System.Collections.IEnumerator.Current { get { throw null; } } - public bool MoveNext() { throw null; } - public void Reset() { } - } - public partial class FromBase64Transform : System.IDisposable, System.Security.Cryptography.ICryptoTransform - { - public FromBase64Transform() { } - public FromBase64Transform(System.Security.Cryptography.FromBase64TransformMode whitespaces) { } - public virtual bool CanReuseTransform { get { throw null; } } - public bool CanTransformMultipleBlocks { get { throw null; } } - public int InputBlockSize { get { throw null; } } - public int OutputBlockSize { get { throw null; } } - public void Clear() { } - public void Dispose() { } - protected virtual void Dispose(bool disposing) { } - ~FromBase64Transform() { } - public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset) { throw null; } - public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount) { throw null; } - } - public enum FromBase64TransformMode - { - IgnoreWhiteSpaces = 0, - DoNotIgnoreWhiteSpaces = 1, - } - public sealed partial class Oid - { - public Oid() { } - public Oid(System.Security.Cryptography.Oid oid) { } - public Oid(string oid) { } - public Oid(string? value, string? friendlyName) { } - public string? FriendlyName { get { throw null; } set { } } - public string? Value { get { throw null; } set { } } - public static System.Security.Cryptography.Oid FromFriendlyName(string friendlyName, System.Security.Cryptography.OidGroup group) { throw null; } - public static System.Security.Cryptography.Oid FromOidValue(string oidValue, System.Security.Cryptography.OidGroup group) { throw null; } - } - public sealed partial class OidCollection : System.Collections.ICollection, System.Collections.IEnumerable - { - public OidCollection() { } - public int Count { get { throw null; } } - public bool IsSynchronized { get { throw null; } } - public System.Security.Cryptography.Oid this[int index] { get { throw null; } } - public System.Security.Cryptography.Oid? this[string oid] { get { throw null; } } - public object SyncRoot { get { throw null; } } - public int Add(System.Security.Cryptography.Oid oid) { throw null; } - public void CopyTo(System.Security.Cryptography.Oid[] array, int index) { } - public System.Security.Cryptography.OidEnumerator GetEnumerator() { throw null; } - void System.Collections.ICollection.CopyTo(System.Array array, int index) { } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public sealed partial class OidEnumerator : System.Collections.IEnumerator - { - internal OidEnumerator() { } - public System.Security.Cryptography.Oid Current { get { throw null; } } - object System.Collections.IEnumerator.Current { get { throw null; } } - public bool MoveNext() { throw null; } - public void Reset() { } - } - public enum OidGroup - { - All = 0, - HashAlgorithm = 1, - EncryptionAlgorithm = 2, - PublicKeyAlgorithm = 3, - SignatureAlgorithm = 4, - Attribute = 5, - ExtensionOrAttribute = 6, - EnhancedKeyUsage = 7, - Policy = 8, - Template = 9, - KeyDerivationFunction = 10, - } - public static partial class PemEncoding - { - public static System.Security.Cryptography.PemFields Find(System.ReadOnlySpan pemData) { throw null; } - public static int GetEncodedSize(int labelLength, int dataLength) { throw null; } - public static bool TryFind(System.ReadOnlySpan pemData, out System.Security.Cryptography.PemFields fields) { throw null; } - public static bool TryWrite(System.ReadOnlySpan label, System.ReadOnlySpan data, System.Span destination, out int charsWritten) { throw null; } - public static char[] Write(System.ReadOnlySpan label, System.ReadOnlySpan data) { throw null; } - } - public readonly partial struct PemFields - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public System.Range Base64Data { get { throw null; } } - public int DecodedDataLength { get { throw null; } } - public System.Range Label { get { throw null; } } - public System.Range Location { get { throw null; } } - } - public partial class ToBase64Transform : System.IDisposable, System.Security.Cryptography.ICryptoTransform - { - public ToBase64Transform() { } - public virtual bool CanReuseTransform { get { throw null; } } - public bool CanTransformMultipleBlocks { get { throw null; } } - public int InputBlockSize { get { throw null; } } - public int OutputBlockSize { get { throw null; } } - public void Clear() { } - public void Dispose() { } - protected virtual void Dispose(bool disposing) { } - ~ToBase64Transform() { } - public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset) { throw null; } - public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount) { throw null; } - } -} diff --git a/src/libraries/System.Security.Cryptography.Encoding/ref/System.Security.Cryptography.Encoding.csproj b/src/libraries/System.Security.Cryptography.Encoding/ref/System.Security.Cryptography.Encoding.csproj index f747f32d5bbcd4..482a8c25218fd0 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/ref/System.Security.Cryptography.Encoding.csproj +++ b/src/libraries/System.Security.Cryptography.Encoding/ref/System.Security.Cryptography.Encoding.csproj @@ -4,10 +4,10 @@ enable - + - \ No newline at end of file + diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/Resources/Strings.resx b/src/libraries/System.Security.Cryptography.Encoding/src/Resources/Strings.resx deleted file mode 100644 index ed1d3e3d9e5ffa..00000000000000 --- a/src/libraries/System.Security.Cryptography.Encoding/src/Resources/Strings.resx +++ /dev/null @@ -1,144 +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 - - - The OID value is invalid. - - - No OID value matches this name. - - - The OID value cannot be changed from its current value. - - - The OID friendly name cannot be changed from its current value. - - - NoLength of the data to encrypt is invalid. - - - ASN.1 Enumerated values only apply to enum types without the [Flags] attribute. - - - Named bit list operations require an enum with the [Flags] attribute. - - - The encoded named bit list value is larger than the value size of the '{0}' enum. - - - Tags with TagClass Universal must have the appropriate TagValue value for the data type being read or written. - - - Unused bit count must be between 0 and 7, inclusive. - - - Encode cannot be called while a Sequence or SetOf is still open. - - - Cannot pop the requested tag as it is not currently in progress. - - - ASN1 corrupted data. - - - The string contains a character not in the 7 bit ASCII character set. - - - The input to WriteEncodedValue must represent a single encoded value with no trailing data. - - - Only single dimensional arrays are supported for the requested action. - - - Index was out of range. Must be non-negative and less than the size of the collection. - - - Non-negative number required. - - - The destination is too small to hold the encoded value. - - - The OID value was invalid. - - - Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection. - - - Value was invalid. - - - No PEM encoded data found. - - - The specified label is not valid. - - - The encoded PEM size is too large to represent as a signed 32-bit integer. - - - A positive number is required. - - - Cannot access a disposed object. - - - System.Security.Cryptography.Encoding is not supported on this platform. - - diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/System.Security.Cryptography.Encoding.csproj b/src/libraries/System.Security.Cryptography.Encoding/src/System.Security.Cryptography.Encoding.csproj index 267bdb49366f08..da0251ebe3492f 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/src/System.Security.Cryptography.Encoding.csproj +++ b/src/libraries/System.Security.Cryptography.Encoding/src/System.Security.Cryptography.Encoding.csproj @@ -1,138 +1,11 @@ - true - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent);$(NetCoreAppCurrent)-Android;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS + $(NetCoreAppCurrent) + true enable - - SR.SystemSecurityCryptographyEncoding_PlatformNotSupported - - - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Common\System\Security\Cryptography\Asn1\DirectoryStringAsn.xml - - - Common\System\Security\Cryptography\Asn1\DirectoryStringAsn.xml.cs - Common\System\Security\Cryptography\Asn1\DirectoryStringAsn.xml - - - Common\System\Security\Cryptography\Asn1\EdiPartyNameAsn.xml - - - Common\System\Security\Cryptography\Asn1\EdiPartyNameAsn.xml.cs - Common\System\Security\Cryptography\Asn1\EdiPartyNameAsn.xml - - - Common\System\Security\Cryptography\Asn1\GeneralNameAsn.xml - - - Common\System\Security\Cryptography\Asn1\GeneralNameAsn.xml.cs - Common\System\Security\Cryptography\Asn1\GeneralNameAsn.xml - - - Common\System\Security\Cryptography\Asn1\OtherNameAsn.xml - - - Common\System\Security\Cryptography\Asn1\OtherNameAsn.xml.cs - Common\System\Security\Cryptography\Asn1\OtherNameAsn.xml - - - - - - - - - - - - - - - - diff --git a/src/libraries/System.Security.Cryptography.Encoding/tests/System.Security.Cryptography.Encoding.Tests.csproj b/src/libraries/System.Security.Cryptography.Encoding/tests/System.Security.Cryptography.Encoding.Tests.csproj deleted file mode 100644 index 945ed4ec62b68d..00000000000000 --- a/src/libraries/System.Security.Cryptography.Encoding/tests/System.Security.Cryptography.Encoding.Tests.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - true - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser - - - - - - - - - - - - - - diff --git a/src/libraries/System.Security.Cryptography.OpenSsl/tests/System.Security.Cryptography.OpenSsl.Tests.csproj b/src/libraries/System.Security.Cryptography.OpenSsl/tests/System.Security.Cryptography.OpenSsl.Tests.csproj index ffeee555c1d849..e139314a91c378 100644 --- a/src/libraries/System.Security.Cryptography.OpenSsl/tests/System.Security.Cryptography.OpenSsl.Tests.csproj +++ b/src/libraries/System.Security.Cryptography.OpenSsl/tests/System.Security.Cryptography.OpenSsl.Tests.csproj @@ -6,6 +6,8 @@ true true + true + true diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/Windows/HelpersWindows.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/Windows/HelpersWindows.cs index ac5a28e7801323..dd275fb1e6ebb8 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/Windows/HelpersWindows.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/Internal/Cryptography/Pal/Windows/HelpersWindows.cs @@ -32,24 +32,27 @@ public static string ToStringAnsi(this IntPtr psz) } // Used for binary blobs without internal pointers. - public static byte[] GetMsgParamAsByteArray(this SafeCryptMsgHandle hCryptMsg, CryptMsgParamType paramType, int index = 0) + public static unsafe byte[] GetMsgParamAsByteArray(this SafeCryptMsgHandle hCryptMsg, CryptMsgParamType paramType, int index = 0) { int cbData = 0; - if (!Interop.Crypt32.CryptMsgGetParam(hCryptMsg, paramType, index, null, ref cbData)) + if (!Interop.Crypt32.CryptMsgGetParam(hCryptMsg, paramType, index, IntPtr.Zero, ref cbData)) throw Marshal.GetLastWin32Error().ToCryptographicException(); - byte[] pvData = new byte[cbData]; - if (!Interop.Crypt32.CryptMsgGetParam(hCryptMsg, paramType, index, pvData, ref cbData)) - throw Marshal.GetLastWin32Error().ToCryptographicException(); + byte[] data = new byte[cbData]; + fixed (byte* pvData = data) + { + if (!Interop.Crypt32.CryptMsgGetParam(hCryptMsg, paramType, index, pvData, ref cbData)) + throw Marshal.GetLastWin32Error().ToCryptographicException(); + } - return pvData.Resize(cbData); + return data.Resize(cbData); } // Used for binary blobs with internal pointers. public static SafeHandle GetMsgParamAsMemory(this SafeCryptMsgHandle hCryptMsg, CryptMsgParamType paramType, int index = 0) { int cbData = 0; - if (!Interop.Crypt32.CryptMsgGetParam(hCryptMsg, paramType, index, null, ref cbData)) + if (!Interop.Crypt32.CryptMsgGetParam(hCryptMsg, paramType, index, IntPtr.Zero, ref cbData)) throw Marshal.GetLastWin32Error().ToCryptographicException(); SafeHandle pvData = SafeHeapAllocHandle.Alloc(cbData); @@ -330,7 +333,7 @@ public static CryptographicAttributeObjectCollection GetUnprotectedAttributes(th // For some reason, you can't ask how many attributes there are - you have to ask for the attributes and // get a CRYPT_E_ATTRIBUTES_MISSING failure if the count is 0. int cbUnprotectedAttr = 0; - if (!Interop.Crypt32.CryptMsgGetParam(hCryptMsg, CryptMsgParamType.CMSG_UNPROTECTED_ATTR_PARAM, 0, null, ref cbUnprotectedAttr)) + if (!Interop.Crypt32.CryptMsgGetParam(hCryptMsg, CryptMsgParamType.CMSG_UNPROTECTED_ATTR_PARAM, 0, IntPtr.Zero, ref cbUnprotectedAttr)) { int lastError = Marshal.GetLastWin32Error(); if (lastError == (int)ErrorCode.CRYPT_E_ATTRIBUTES_MISSING) diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj b/src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj index 2a3da6228dceb5..9ccb53cebf2077 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj @@ -650,6 +650,7 @@ System.Security.Cryptography.Pkcs.EnvelopedCms + diff --git a/src/libraries/System.Security.Cryptography.ProtectedData/src/System/Security/Cryptography/ProtectedData.cs b/src/libraries/System.Security.Cryptography.ProtectedData/src/System/Security/Cryptography/ProtectedData.cs index 0e6b65bea16644..d67da72075b395 100644 --- a/src/libraries/System.Security.Cryptography.ProtectedData/src/System/Security/Cryptography/ProtectedData.cs +++ b/src/libraries/System.Security.Cryptography.ProtectedData/src/System/Security/Cryptography/ProtectedData.cs @@ -59,8 +59,8 @@ private static byte[] ProtectOrUnprotect(byte[] inputData, byte[]? optionalEntro try { bool success = protect ? - Interop.Crypt32.CryptProtectData(ref userDataBlob, null, ref optionalEntropyBlob, IntPtr.Zero, IntPtr.Zero, flags, out outputBlob) : - Interop.Crypt32.CryptUnprotectData(ref userDataBlob, IntPtr.Zero, ref optionalEntropyBlob, IntPtr.Zero, IntPtr.Zero, flags, out outputBlob); + Interop.Crypt32.CryptProtectData(in userDataBlob, null, ref optionalEntropyBlob, IntPtr.Zero, IntPtr.Zero, flags, out outputBlob) : + Interop.Crypt32.CryptUnprotectData(in userDataBlob, IntPtr.Zero, ref optionalEntropyBlob, IntPtr.Zero, IntPtr.Zero, flags, out outputBlob); if (!success) { int lastWin32Error = Marshal.GetLastWin32Error(); diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.Import.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.Import.cs index 29c203dfb2cf39..d9c2d1364c45c2 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.Import.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.Import.cs @@ -32,7 +32,7 @@ private static ICertificatePal FromBlobOrFile(ReadOnlySpan rawData, string bool loadFromFile = (fileName != null); - PfxCertStoreFlags pfxCertStoreFlags = MapKeyStorageFlags(keyStorageFlags); + Interop.Crypt32.PfxCertStoreFlags pfxCertStoreFlags = MapKeyStorageFlags(keyStorageFlags); bool deleteKeyContainer = false; Interop.Crypt32.CertEncodingType msgAndCertEncodingType; @@ -115,19 +115,19 @@ private static unsafe SafeCertContextHandle GetSignerInPKCS7Store(SafeCertStoreH // make sure that there is at least one signer of the certificate store int dwSigners; int cbSigners = sizeof(int); - if (!Interop.crypt32.CryptMsgGetParam(hCryptMsg, CryptMessageParameterType.CMSG_SIGNER_COUNT_PARAM, 0, out dwSigners, ref cbSigners)) + if (!Interop.Crypt32.CryptMsgGetParam(hCryptMsg, Interop.Crypt32.CryptMsgParamType.CMSG_SIGNER_COUNT_PARAM, 0, out dwSigners, ref cbSigners)) throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); if (dwSigners == 0) throw ErrorCode.CRYPT_E_SIGNER_NOT_FOUND.ToCryptographicException(); // get the first signer from the store, and use that as the loaded certificate int cbData = 0; - if (!Interop.crypt32.CryptMsgGetParam(hCryptMsg, CryptMessageParameterType.CMSG_SIGNER_INFO_PARAM, 0, null, ref cbData)) + if (!Interop.Crypt32.CryptMsgGetParam(hCryptMsg, Interop.Crypt32.CryptMsgParamType.CMSG_SIGNER_INFO_PARAM, 0, default(byte*), ref cbData)) throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); fixed (byte* pCmsgSignerBytes = new byte[cbData]) { - if (!Interop.crypt32.CryptMsgGetParam(hCryptMsg, CryptMessageParameterType.CMSG_SIGNER_INFO_PARAM, 0, pCmsgSignerBytes, ref cbData)) + if (!Interop.Crypt32.CryptMsgGetParam(hCryptMsg, Interop.Crypt32.CryptMsgParamType.CMSG_SIGNER_INFO_PARAM, 0, pCmsgSignerBytes, ref cbData)) throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); CMSG_SIGNER_INFO_Partial* pCmsgSignerInfo = (CMSG_SIGNER_INFO_Partial*)pCmsgSignerBytes; @@ -139,7 +139,7 @@ private static unsafe SafeCertContextHandle GetSignerInPKCS7Store(SafeCertStoreH certInfo.SerialNumber.pbData = pCmsgSignerInfo->SerialNumber.pbData; SafeCertContextHandle? pCertContext = null; - if (!Interop.crypt32.CertFindCertificateInStore(hCertStore, CertFindType.CERT_FIND_SUBJECT_CERT, &certInfo, ref pCertContext)) + if (!Interop.crypt32.CertFindCertificateInStore(hCertStore, Interop.Crypt32.CertFindType.CERT_FIND_SUBJECT_CERT, &certInfo, ref pCertContext)) throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); return pCertContext; } @@ -148,7 +148,7 @@ private static unsafe SafeCertContextHandle GetSignerInPKCS7Store(SafeCertStoreH private static SafeCertContextHandle FilterPFXStore( ReadOnlySpan rawData, SafePasswordHandle password, - PfxCertStoreFlags pfxCertStoreFlags) + Interop.Crypt32.PfxCertStoreFlags pfxCertStoreFlags) { SafeCertStoreHandle hStore; unsafe @@ -156,7 +156,7 @@ private static SafeCertContextHandle FilterPFXStore( fixed (byte* pbRawData = rawData) { Interop.Crypt32.DATA_BLOB certBlob = new Interop.Crypt32.DATA_BLOB(new IntPtr(pbRawData), (uint)rawData.Length); - hStore = Interop.crypt32.PFXImportCertStore(ref certBlob, password, pfxCertStoreFlags); + hStore = Interop.Crypt32.PFXImportCertStore(ref certBlob, password, pfxCertStoreFlags); if (hStore.IsInvalid) { throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); @@ -216,28 +216,28 @@ private static SafeCertContextHandle FilterPFXStore( } } - private static PfxCertStoreFlags MapKeyStorageFlags(X509KeyStorageFlags keyStorageFlags) + private static Interop.Crypt32.PfxCertStoreFlags MapKeyStorageFlags(X509KeyStorageFlags keyStorageFlags) { if ((keyStorageFlags & X509Certificate.KeyStorageFlagsAll) != keyStorageFlags) throw new ArgumentException(SR.Argument_InvalidFlag, nameof(keyStorageFlags)); - PfxCertStoreFlags pfxCertStoreFlags = 0; + Interop.Crypt32.PfxCertStoreFlags pfxCertStoreFlags = 0; if ((keyStorageFlags & X509KeyStorageFlags.UserKeySet) == X509KeyStorageFlags.UserKeySet) - pfxCertStoreFlags |= PfxCertStoreFlags.CRYPT_USER_KEYSET; + pfxCertStoreFlags |= Interop.Crypt32.PfxCertStoreFlags.CRYPT_USER_KEYSET; else if ((keyStorageFlags & X509KeyStorageFlags.MachineKeySet) == X509KeyStorageFlags.MachineKeySet) - pfxCertStoreFlags |= PfxCertStoreFlags.CRYPT_MACHINE_KEYSET; + pfxCertStoreFlags |= Interop.Crypt32.PfxCertStoreFlags.CRYPT_MACHINE_KEYSET; if ((keyStorageFlags & X509KeyStorageFlags.Exportable) == X509KeyStorageFlags.Exportable) - pfxCertStoreFlags |= PfxCertStoreFlags.CRYPT_EXPORTABLE; + pfxCertStoreFlags |= Interop.Crypt32.PfxCertStoreFlags.CRYPT_EXPORTABLE; if ((keyStorageFlags & X509KeyStorageFlags.UserProtected) == X509KeyStorageFlags.UserProtected) - pfxCertStoreFlags |= PfxCertStoreFlags.CRYPT_USER_PROTECTED; + pfxCertStoreFlags |= Interop.Crypt32.PfxCertStoreFlags.CRYPT_USER_PROTECTED; // If a user is asking for an Ephemeral key they should be willing to test their code to find out // that it will no longer import into CAPI. This solves problems of legacy CSPs being // difficult to do SHA-2 RSA signatures with, simplifies the story for UWP, and reduces the // complexity of pointer interpretation. if ((keyStorageFlags & X509KeyStorageFlags.EphemeralKeySet) == X509KeyStorageFlags.EphemeralKeySet) - pfxCertStoreFlags |= PfxCertStoreFlags.PKCS12_NO_PERSIST_KEY | PfxCertStoreFlags.PKCS12_ALWAYS_CNG_KSP; + pfxCertStoreFlags |= Interop.Crypt32.PfxCertStoreFlags.PKCS12_NO_PERSIST_KEY | Interop.Crypt32.PfxCertStoreFlags.PKCS12_ALWAYS_CNG_KSP; // In .NET Framework loading a PFX then adding the key to the Windows Certificate Store would // enable a native application compiled against CAPI to find that private key and interoperate with it. diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.PrivateKey.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.PrivateKey.cs index 633d8edfa1c7fc..95210c8f2ce0ba 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.PrivateKey.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.PrivateKey.cs @@ -3,7 +3,6 @@ using System; using System.Diagnostics; -using System.Runtime.ExceptionServices; using System.Runtime.InteropServices; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; @@ -272,7 +271,7 @@ public ICertificatePal CopyWithPrivateKey(RSA rsa) int keySpec = 0; if (!Interop.crypt32.CryptAcquireCertificatePrivateKey( certificateContext, - CryptAcquireFlags.CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG, + Interop.Crypt32.CryptAcquireCertificatePrivateKeyFlags.CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG, IntPtr.Zero, out privateKey, out keySpec, @@ -343,14 +342,14 @@ public ICertificatePal CopyWithPrivateKey(RSA rsa) { if (!Interop.Crypt32.CertGetCertificateContextProperty(_certContext, Interop.Crypt32.CertContextPropId.CERT_KEY_PROV_INFO_PROP_ID, privateKey, ref cbData)) throw Marshal.GetLastWin32Error().ToCryptographicException(); - CRYPT_KEY_PROV_INFO* pKeyProvInfo = (CRYPT_KEY_PROV_INFO*)pPrivateKey; + Interop.Crypt32.CRYPT_KEY_PROV_INFO* pKeyProvInfo = (Interop.Crypt32.CRYPT_KEY_PROV_INFO*)pPrivateKey; CspParameters cspParameters = new CspParameters(); cspParameters.ProviderName = Marshal.PtrToStringUni((IntPtr)(pKeyProvInfo->pwszProvName)); cspParameters.KeyContainerName = Marshal.PtrToStringUni((IntPtr)(pKeyProvInfo->pwszContainerName)); cspParameters.ProviderType = pKeyProvInfo->dwProvType; cspParameters.KeyNumber = pKeyProvInfo->dwKeySpec; - cspParameters.Flags = (CspProviderFlags)((pKeyProvInfo->dwFlags & CryptAcquireContextFlags.CRYPT_MACHINE_KEYSET) == CryptAcquireContextFlags.CRYPT_MACHINE_KEYSET ? CspProviderFlags.UseMachineKeyStore : 0); + cspParameters.Flags = (CspProviderFlags)((pKeyProvInfo->dwFlags & Interop.Crypt32.CryptAcquireContextFlags.CRYPT_MACHINE_KEYSET) == Interop.Crypt32.CryptAcquireContextFlags.CRYPT_MACHINE_KEYSET ? CspProviderFlags.UseMachineKeyStore : 0); return cspParameters; } } @@ -374,20 +373,20 @@ public ICertificatePal CopyWithPrivateKey(RSA rsa) // check to see if we can figure out what key number it needs to re-open. int keySpec = GuessKeySpec(provider, keyName, machineKey, cngKey.AlgorithmGroup); - CRYPT_KEY_PROV_INFO keyProvInfo = default; + Interop.Crypt32.CRYPT_KEY_PROV_INFO keyProvInfo = default; fixed (char* keyNamePtr = cngKey.KeyName) fixed (char* provNamePtr = cngKey.Provider!.Provider) { keyProvInfo.pwszContainerName = keyNamePtr; keyProvInfo.pwszProvName = provNamePtr; - keyProvInfo.dwFlags = machineKey ? CryptAcquireContextFlags.CRYPT_MACHINE_KEYSET : 0; + keyProvInfo.dwFlags = machineKey ? Interop.Crypt32.CryptAcquireContextFlags.CRYPT_MACHINE_KEYSET : 0; keyProvInfo.dwKeySpec = keySpec; - if (!Interop.crypt32.CertSetCertificateContextProperty( + if (!Interop.Crypt32.CertSetCertificateContextProperty( pal._certContext, Interop.Crypt32.CertContextPropId.CERT_KEY_PROV_INFO_PROP_ID, - CertSetPropertyFlags.None, + Interop.Crypt32.CertSetPropertyFlags.None, &keyProvInfo)) { pal.Dispose(); @@ -561,21 +560,21 @@ private static bool TryGuessDsaKeySpec(CspParameters cspParameters, out int keyS // Make a new pal from bytes. CertificatePal pal = (CertificatePal)FromBlob(RawData, SafePasswordHandle.InvalidHandle, X509KeyStorageFlags.PersistKeySet); - CRYPT_KEY_PROV_INFO keyProvInfo = default; + Interop.Crypt32.CRYPT_KEY_PROV_INFO keyProvInfo = default; fixed (char* keyName = keyContainerInfo.KeyContainerName) fixed (char* provName = keyContainerInfo.ProviderName) { keyProvInfo.pwszContainerName = keyName; keyProvInfo.pwszProvName = provName; - keyProvInfo.dwFlags = keyContainerInfo.MachineKeyStore ? CryptAcquireContextFlags.CRYPT_MACHINE_KEYSET : 0; + keyProvInfo.dwFlags = keyContainerInfo.MachineKeyStore ? Interop.Crypt32.CryptAcquireContextFlags.CRYPT_MACHINE_KEYSET : 0; keyProvInfo.dwProvType = keyContainerInfo.ProviderType; keyProvInfo.dwKeySpec = (int)keyContainerInfo.KeyNumber; - if (!Interop.crypt32.CertSetCertificateContextProperty( + if (!Interop.Crypt32.CertSetCertificateContextProperty( pal._certContext, Interop.Crypt32.CertContextPropId.CERT_KEY_PROV_INFO_PROP_ID, - CertSetPropertyFlags.None, + Interop.Crypt32.CertSetPropertyFlags.None, &keyProvInfo)) { pal.Dispose(); @@ -595,10 +594,10 @@ private ICertificatePal CopyWithEphemeralKey(CngKey cngKey) // Make a new pal from bytes. CertificatePal pal = (CertificatePal)FromBlob(RawData, SafePasswordHandle.InvalidHandle, X509KeyStorageFlags.PersistKeySet); - if (!Interop.crypt32.CertSetCertificateContextProperty( + if (!Interop.Crypt32.CertSetCertificateContextProperty( pal._certContext, Interop.Crypt32.CertContextPropId.CERT_NCRYPT_KEY_HANDLE_PROP_ID, - CertSetPropertyFlags.CERT_SET_PROPERTY_INHIBIT_PERSIST_FLAG, + Interop.Crypt32.CertSetPropertyFlags.CERT_SET_PROPERTY_INHIBIT_PERSIST_FLAG, handle)) { pal.Dispose(); diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.cs index ee224fbbd4c766..65bff14b3eb594 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/CertificatePal.cs @@ -5,11 +5,8 @@ using System; using System.Text; using System.Diagnostics; -using System.Globalization; using System.Collections.Generic; using System.Runtime.InteropServices; - -using Internal.Cryptography; using Internal.Cryptography.Pal.Native; using System.Security.Cryptography; @@ -144,9 +141,9 @@ private byte[] PropagateKeyAlgorithmParametersFromChain() int cbData = 0; if (!Interop.Crypt32.CertGetCertificateContextProperty(_certContext, Interop.Crypt32.CertContextPropId.CERT_PUBKEY_ALG_PARA_PROP_ID, null, ref cbData)) { - CERT_CHAIN_PARA chainPara = default; - chainPara.cbSize = sizeof(CERT_CHAIN_PARA); - if (!Interop.crypt32.CertGetCertificateChain((IntPtr)ChainEngine.HCCE_CURRENT_USER, _certContext, null, SafeCertStoreHandle.InvalidHandle, ref chainPara, CertChainFlags.None, IntPtr.Zero, out certChainContext)) + Interop.Crypt32.CERT_CHAIN_PARA chainPara = default; + chainPara.cbSize = sizeof(Interop.Crypt32.CERT_CHAIN_PARA); + if (!Interop.Crypt32.CertGetCertificateChain((IntPtr)Interop.Crypt32.ChainEngine.HCCE_CURRENT_USER, _certContext, null, SafeCertStoreHandle.InvalidHandle, ref chainPara, Interop.Crypt32.CertChainFlags.None, IntPtr.Zero, out certChainContext)) throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); if (!Interop.Crypt32.CertGetCertificateContextProperty(_certContext, Interop.Crypt32.CertContextPropId.CERT_PUBKEY_ALG_PARA_PROP_ID, null, ref cbData)) throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); @@ -280,7 +277,7 @@ public bool Archived { Interop.Crypt32.DATA_BLOB blob = new Interop.Crypt32.DATA_BLOB(IntPtr.Zero, 0); Interop.Crypt32.DATA_BLOB* pValue = value ? &blob : (Interop.Crypt32.DATA_BLOB*)null; - if (!Interop.crypt32.CertSetCertificateContextProperty(_certContext, Interop.Crypt32.CertContextPropId.CERT_ARCHIVED_PROP_ID, CertSetPropertyFlags.None, pValue)) + if (!Interop.Crypt32.CertSetCertificateContextProperty(_certContext, Interop.Crypt32.CertContextPropId.CERT_ARCHIVED_PROP_ID, Interop.Crypt32.CertSetPropertyFlags.None, pValue)) throw Marshal.GetLastWin32Error().ToCryptographicException(); } } @@ -293,14 +290,14 @@ public string FriendlyName unsafe { int cbData = 0; - if (!Interop.crypt32.CertGetCertificateContextPropertyString(_certContext, Interop.Crypt32.CertContextPropId.CERT_FRIENDLY_NAME_PROP_ID, null, ref cbData)) + if (!Interop.Crypt32.CertGetCertificateContextPropertyString(_certContext, Interop.Crypt32.CertContextPropId.CERT_FRIENDLY_NAME_PROP_ID, null, ref cbData)) return string.Empty; int spanLength = (cbData + 1) / 2; Span buffer = spanLength <= 256 ? stackalloc char[spanLength] : new char[spanLength]; fixed (char* ptr = &MemoryMarshal.GetReference(buffer)) { - if (!Interop.crypt32.CertGetCertificateContextPropertyString(_certContext, Interop.Crypt32.CertContextPropId.CERT_FRIENDLY_NAME_PROP_ID, (byte*)ptr, ref cbData)) + if (!Interop.Crypt32.CertGetCertificateContextPropertyString(_certContext, Interop.Crypt32.CertContextPropId.CERT_FRIENDLY_NAME_PROP_ID, (byte*)ptr, ref cbData)) return string.Empty; } @@ -317,7 +314,7 @@ public string FriendlyName try { Interop.Crypt32.DATA_BLOB blob = new Interop.Crypt32.DATA_BLOB(pFriendlyName, checked(2 * ((uint)friendlyName.Length + 1))); - if (!Interop.crypt32.CertSetCertificateContextProperty(_certContext, Interop.Crypt32.CertContextPropId.CERT_FRIENDLY_NAME_PROP_ID, CertSetPropertyFlags.None, &blob)) + if (!Interop.Crypt32.CertSetCertificateContextProperty(_certContext, Interop.Crypt32.CertContextPropId.CERT_FRIENDLY_NAME_PROP_ID, Interop.Crypt32.CertSetPropertyFlags.None, &blob)) throw Marshal.GetLastWin32Error().ToCryptographicException(); } finally @@ -390,8 +387,8 @@ public unsafe string GetNameInfo(X509NameType nameType, bool forIssuer) => Interop.crypt32.CertGetNameString( _certContext, MapNameType(nameType), - forIssuer ? CertNameFlags.CERT_NAME_ISSUER_FLAG : CertNameFlags.None, - CertNameStringType.CERT_X500_NAME_STR | CertNameStringType.CERT_NAME_STR_REVERSE_FLAG); + forIssuer ? Interop.Crypt32.CertNameFlags.CERT_NAME_ISSUER_FLAG : Interop.Crypt32.CertNameFlags.None, + Interop.Crypt32.CertNameStringType.CERT_X500_NAME_STR | Interop.Crypt32.CertNameStringType.CERT_NAME_STR_REVERSE_FLAG); public void AppendPrivateKeyInfo(StringBuilder sb) { @@ -481,25 +478,25 @@ internal SafeCertContextHandle CertContext } } - private static CertNameType MapNameType(X509NameType nameType) + private static Interop.Crypt32.CertNameType MapNameType(X509NameType nameType) { switch (nameType) { case X509NameType.SimpleName: - return CertNameType.CERT_NAME_SIMPLE_DISPLAY_TYPE; + return Interop.Crypt32.CertNameType.CERT_NAME_SIMPLE_DISPLAY_TYPE; case X509NameType.EmailName: - return CertNameType.CERT_NAME_EMAIL_TYPE; + return Interop.Crypt32.CertNameType.CERT_NAME_EMAIL_TYPE; case X509NameType.UpnName: - return CertNameType.CERT_NAME_UPN_TYPE; + return Interop.Crypt32.CertNameType.CERT_NAME_UPN_TYPE; case X509NameType.DnsName: case X509NameType.DnsFromAlternativeName: - return CertNameType.CERT_NAME_DNS_TYPE; + return Interop.Crypt32.CertNameType.CERT_NAME_DNS_TYPE; case X509NameType.UrlName: - return CertNameType.CERT_NAME_URL_TYPE; + return Interop.Crypt32.CertNameType.CERT_NAME_URL_TYPE; default: throw new ArgumentException(SR.Argument_InvalidNameType); @@ -509,9 +506,9 @@ private static CertNameType MapNameType(X509NameType nameType) private unsafe string GetIssuerOrSubject(bool issuer, bool reverse) => Interop.crypt32.CertGetNameString( _certContext, - CertNameType.CERT_NAME_RDN_TYPE, - issuer ? CertNameFlags.CERT_NAME_ISSUER_FLAG : CertNameFlags.None, - CertNameStringType.CERT_X500_NAME_STR | (reverse ? CertNameStringType.CERT_NAME_STR_REVERSE_FLAG : 0)); + Interop.Crypt32.CertNameType.CERT_NAME_RDN_TYPE, + issuer ? Interop.Crypt32.CertNameFlags.CERT_NAME_ISSUER_FLAG : Interop.Crypt32.CertNameFlags.None, + Interop.Crypt32.CertNameStringType.CERT_X500_NAME_STR | (reverse ? Interop.Crypt32.CertNameStringType.CERT_NAME_STR_REVERSE_FLAG : 0)); private CertificatePal(CertificatePal copyFrom) { @@ -527,7 +524,7 @@ private CertificatePal(SafeCertContextHandle certContext, bool deleteKeyContaine // We need to delete any associated key container upon disposition. Thus, replace the safehandle we got with a safehandle whose // Release() method performs the key container deletion. SafeCertContextHandle oldCertContext = certContext; - certContext = Interop.crypt32.CertDuplicateCertificateContextWithKeyContainerDeletion(oldCertContext.DangerousGetHandle()); + certContext = Interop.Crypt32.CertDuplicateCertificateContextWithKeyContainerDeletion(oldCertContext.DangerousGetHandle()); GC.KeepAlive(oldCertContext); } _certContext = certContext; diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/ChainPal.BuildChain.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/ChainPal.BuildChain.cs index 0c3875dca9ef91..ce38255742da7c 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/ChainPal.BuildChain.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/ChainPal.BuildChain.cs @@ -40,15 +40,15 @@ internal sealed partial class ChainPal : IDisposable, IChainPal using (SafeChainEngineHandle storeHandle = GetChainEngine(trustMode, customTrustStore, useMachineContext)) using (SafeCertStoreHandle extraStoreHandle = ConvertStoreToSafeHandle(extraStore)) { - CERT_CHAIN_PARA chainPara = default; - chainPara.cbSize = Marshal.SizeOf(); + Interop.Crypt32.CERT_CHAIN_PARA chainPara = default; + chainPara.cbSize = Marshal.SizeOf(); int applicationPolicyCount; using (SafeHandle applicationPolicyOids = applicationPolicy!.ToLpstrArray(out applicationPolicyCount)) { if (!applicationPolicyOids.IsInvalid) { - chainPara.RequestedUsage.dwType = CertUsageMatchType.USAGE_MATCH_TYPE_AND; + chainPara.RequestedUsage.dwType = Interop.Crypt32.CertUsageMatchType.USAGE_MATCH_TYPE_AND; chainPara.RequestedUsage.Usage.cUsageIdentifier = applicationPolicyCount; chainPara.RequestedUsage.Usage.rgpszUsageIdentifier = applicationPolicyOids.DangerousGetHandle(); } @@ -58,7 +58,7 @@ internal sealed partial class ChainPal : IDisposable, IChainPal { if (!certificatePolicyOids.IsInvalid) { - chainPara.RequestedIssuancePolicy.dwType = CertUsageMatchType.USAGE_MATCH_TYPE_AND; + chainPara.RequestedIssuancePolicy.dwType = Interop.Crypt32.CertUsageMatchType.USAGE_MATCH_TYPE_AND; chainPara.RequestedIssuancePolicy.Usage.cUsageIdentifier = certificatePolicyCount; chainPara.RequestedIssuancePolicy.Usage.rgpszUsageIdentifier = certificatePolicyOids.DangerousGetHandle(); } @@ -66,9 +66,9 @@ internal sealed partial class ChainPal : IDisposable, IChainPal chainPara.dwUrlRetrievalTimeout = (int)Math.Floor(timeout.TotalMilliseconds); Interop.Crypt32.FILETIME ft = Interop.Crypt32.FILETIME.FromDateTime(verificationTime); - CertChainFlags flags = MapRevocationFlags(revocationMode, revocationFlag, disableAia); + Interop.Crypt32.CertChainFlags flags = MapRevocationFlags(revocationMode, revocationFlag, disableAia); SafeX509ChainHandle chain; - if (!Interop.crypt32.CertGetCertificateChain(storeHandle.DangerousGetHandle(), certificatePal.CertContext, &ft, extraStoreHandle, ref chainPara, flags, IntPtr.Zero, out chain)) + if (!Interop.Crypt32.CertGetCertificateChain(storeHandle.DangerousGetHandle(), certificatePal.CertContext, &ft, extraStoreHandle, ref chainPara, flags, IntPtr.Zero, out chain)) { return null; } @@ -91,8 +91,8 @@ private static SafeChainEngineHandle GetChainEngine( // Need to get a valid SafeCertStoreHandle otherwise the default stores will be trusted using (SafeCertStoreHandle customTrustStoreHandle = ConvertStoreToSafeHandle(customTrustStore, true)) { - CERT_CHAIN_ENGINE_CONFIG customChainEngine = default; - customChainEngine.cbSize = Marshal.SizeOf(); + Interop.Crypt32.CERT_CHAIN_ENGINE_CONFIG customChainEngine = default; + customChainEngine.cbSize = Marshal.SizeOf(); customChainEngine.hExclusiveRoot = customTrustStoreHandle.DangerousGetHandle(); chainEngineHandle = Interop.crypt32.CertCreateCertificateChainEngine(ref customChainEngine); } @@ -113,28 +113,28 @@ private static SafeCertStoreHandle ConvertStoreToSafeHandle(X509Certificate2Coll return ((StorePal)StorePal.LinkFromCertificateCollection(extraStore!)).SafeCertStoreHandle; } - private static CertChainFlags MapRevocationFlags( + private static Interop.Crypt32.CertChainFlags MapRevocationFlags( X509RevocationMode revocationMode, X509RevocationFlag revocationFlag, bool disableAia) { - const CertChainFlags AiaDisabledFlags = - CertChainFlags.CERT_CHAIN_DISABLE_AIA | CertChainFlags.CERT_CHAIN_DISABLE_AUTH_ROOT_AUTO_UPDATE; + const Interop.Crypt32.CertChainFlags AiaDisabledFlags = + Interop.Crypt32.CertChainFlags.CERT_CHAIN_DISABLE_AIA | Interop.Crypt32.CertChainFlags.CERT_CHAIN_DISABLE_AUTH_ROOT_AUTO_UPDATE; - CertChainFlags dwFlags = disableAia ? AiaDisabledFlags : CertChainFlags.None; + Interop.Crypt32.CertChainFlags dwFlags = disableAia ? AiaDisabledFlags : Interop.Crypt32.CertChainFlags.None; if (revocationMode == X509RevocationMode.NoCheck) return dwFlags; if (revocationMode == X509RevocationMode.Offline) - dwFlags |= CertChainFlags.CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY; + dwFlags |= Interop.Crypt32.CertChainFlags.CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY; if (revocationFlag == X509RevocationFlag.EndCertificateOnly) - dwFlags |= CertChainFlags.CERT_CHAIN_REVOCATION_CHECK_END_CERT; + dwFlags |= Interop.Crypt32.CertChainFlags.CERT_CHAIN_REVOCATION_CHECK_END_CERT; else if (revocationFlag == X509RevocationFlag.EntireChain) - dwFlags |= CertChainFlags.CERT_CHAIN_REVOCATION_CHECK_CHAIN; + dwFlags |= Interop.Crypt32.CertChainFlags.CERT_CHAIN_REVOCATION_CHECK_CHAIN; else - dwFlags |= CertChainFlags.CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT; + dwFlags |= Interop.Crypt32.CertChainFlags.CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT; return dwFlags; } diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/ChainPal.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/ChainPal.cs index 37f976cc823a74..5b80a71eb8c487 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/ChainPal.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/ChainPal.cs @@ -19,7 +19,7 @@ public static IChainPal FromHandle(IntPtr chainContext) if (chainContext == IntPtr.Zero) throw new ArgumentNullException(nameof(chainContext)); - SafeX509ChainHandle certChainHandle = Interop.crypt32.CertDuplicateCertificateChain(chainContext); + SafeX509ChainHandle certChainHandle = Interop.Crypt32.CertDuplicateCertificateChain(chainContext); if (certChainHandle == null || certChainHandle.IsInvalid) throw new CryptographicException(SR.Cryptography_InvalidContextHandle, nameof(chainContext)); @@ -36,12 +36,12 @@ public static IChainPal FromHandle(IntPtr chainContext) unsafe { - CERT_CHAIN_POLICY_PARA para = default; - para.cbSize = sizeof(CERT_CHAIN_POLICY_PARA); - para.dwFlags = (int)flags; + Interop.Crypt32.CERT_CHAIN_POLICY_PARA para = default; + para.cbSize = (uint)sizeof(Interop.Crypt32.CERT_CHAIN_POLICY_PARA); + para.dwFlags = (uint)flags; - CERT_CHAIN_POLICY_STATUS status = default; - status.cbSize = sizeof(CERT_CHAIN_POLICY_STATUS); + Interop.Crypt32.CERT_CHAIN_POLICY_STATUS status = default; + status.cbSize = (uint)sizeof(Interop.Crypt32.CERT_CHAIN_POLICY_STATUS); if (!Interop.crypt32.CertVerifyCertificateChainPolicy(ChainPolicy.CERT_CHAIN_POLICY_BASE, _chain, ref para, ref status)) { @@ -105,7 +105,7 @@ public SafeX509ChainHandle SafeHandle public static bool ReleaseSafeX509ChainHandle(IntPtr handle) { - Interop.crypt32.CertFreeCertificateChain(handle); + Interop.Crypt32.CertFreeCertificateChain(handle); return true; } diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/FindPal.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/FindPal.cs index 5f3f3e43a9751b..4cadc49aaf2c67 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/FindPal.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/FindPal.cs @@ -7,10 +7,8 @@ using System.Runtime.InteropServices; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; -using System.Text; using Internal.Cryptography.Pal.Native; using Microsoft.Win32.SafeHandles; -using static Interop.Crypt32; namespace Internal.Cryptography.Pal { @@ -34,7 +32,7 @@ internal static IFindPal OpenPal(X509Certificate2Collection findFrom, X509Certif public string NormalizeOid(string maybeOid, OidGroup expectedGroup) { - string? oidValue = Interop.Crypt32.FindOidInfo(CryptOidInfoKeyType.CRYPT_OID_INFO_NAME_KEY, maybeOid, expectedGroup, fallBackToAllGroups: true).OID; + string? oidValue = Interop.Crypt32.FindOidInfo(Interop.Crypt32.CryptOidInfoKeyType.CRYPT_OID_INFO_NAME_KEY, maybeOid, expectedGroup, fallBackToAllGroups: true).OID; if (oidValue == null) { @@ -49,8 +47,8 @@ public unsafe void FindByThumbprint(byte[] thumbPrint) { fixed (byte* pThumbPrint = thumbPrint) { - DATA_BLOB blob = new DATA_BLOB(new IntPtr(pThumbPrint), (uint)thumbPrint.Length); - FindCore(CertFindType.CERT_FIND_HASH, &blob); + Interop.Crypt32.DATA_BLOB blob = new Interop.Crypt32.DATA_BLOB(new IntPtr(pThumbPrint), (uint)thumbPrint.Length); + FindCore(Interop.Crypt32.CertFindType.CERT_FIND_HASH, &blob); } } @@ -58,7 +56,7 @@ public unsafe void FindBySubjectName(string subjectName) { fixed (char* pSubjectName = subjectName) { - FindCore(CertFindType.CERT_FIND_SUBJECT_STR, pSubjectName); + FindCore(Interop.Crypt32.CertFindType.CERT_FIND_SUBJECT_STR, pSubjectName); } } @@ -68,7 +66,7 @@ public void FindBySubjectDistinguishedName(string subjectDistinguishedName) subjectDistinguishedName, static (subjectDistinguishedName, pCertContext) => { - string actual = GetCertNameInfo(pCertContext, CertNameType.CERT_NAME_RDN_TYPE, CertNameFlags.None); + string actual = GetCertNameInfo(pCertContext, Interop.Crypt32.CertNameType.CERT_NAME_RDN_TYPE, Interop.Crypt32.CertNameFlags.None); return subjectDistinguishedName.Equals(actual, StringComparison.OrdinalIgnoreCase); }); } @@ -77,7 +75,7 @@ public unsafe void FindByIssuerName(string issuerName) { fixed (char* pIssuerName = issuerName) { - FindCore(CertFindType.CERT_FIND_ISSUER_STR, pIssuerName); + FindCore(Interop.Crypt32.CertFindType.CERT_FIND_ISSUER_STR, pIssuerName); } } @@ -87,7 +85,7 @@ public void FindByIssuerDistinguishedName(string issuerDistinguishedName) issuerDistinguishedName, static (issuerDistinguishedName, pCertContext) => { - string actual = GetCertNameInfo(pCertContext, CertNameType.CERT_NAME_RDN_TYPE, CertNameFlags.CERT_NAME_ISSUER_FLAG); + string actual = GetCertNameInfo(pCertContext, Interop.Crypt32.CertNameType.CERT_NAME_RDN_TYPE, Interop.Crypt32.CertNameFlags.CERT_NAME_ISSUER_FLAG); return issuerDistinguishedName.Equals(actual, StringComparison.OrdinalIgnoreCase); }); } @@ -125,13 +123,13 @@ public void FindByTimeExpired(DateTime dateTime) private unsafe void FindByTime(DateTime dateTime, int compareResult) { - FILETIME fileTime = FILETIME.FromDateTime(dateTime); + Interop.Crypt32.FILETIME fileTime = Interop.Crypt32.FILETIME.FromDateTime(dateTime); FindCore( (fileTime, compareResult), static (state, pCertContext) => { - int comparison = Interop.crypt32.CertVerifyTimeValidity(ref state.fileTime, + int comparison = Interop.Crypt32.CertVerifyTimeValidity(ref state.fileTime, pCertContext.CertContext->pCertInfo); GC.KeepAlive(pCertContext); return comparison == state.compareResult; @@ -151,7 +149,7 @@ public unsafe void FindByTemplateName(string templateName) bool foundMatch = false; Interop.Crypt32.CERT_INFO* pCertInfo = pCertContext.CertContext->pCertInfo; { - Interop.Crypt32.CERT_EXTENSION* pV1Template = Interop.crypt32.CertFindExtension(Oids.EnrollCertTypeExtension, + Interop.Crypt32.CERT_EXTENSION* pV1Template = Interop.Crypt32.CertFindExtension(Oids.EnrollCertTypeExtension, pCertInfo->cExtension, pCertInfo->rgExtension); if (pV1Template != null) { @@ -174,7 +172,7 @@ public unsafe void FindByTemplateName(string templateName) if (!foundMatch) { - Interop.Crypt32.CERT_EXTENSION* pV2Template = Interop.crypt32.CertFindExtension(Oids.CertificateTemplate, + Interop.Crypt32.CERT_EXTENSION* pV2Template = Interop.Crypt32.CertFindExtension(Oids.CertificateTemplate, pCertInfo->cExtension, pCertInfo->rgExtension); if (pV2Template != null) { @@ -187,7 +185,7 @@ public unsafe void FindByTemplateName(string templateName) CERT_TEMPLATE_EXT* pTemplateExt = (CERT_TEMPLATE_EXT*)pvDecoded; string? actual = Marshal.PtrToStringAnsi(pTemplateExt->pszObjId); string? expectedOidValue = - Interop.Crypt32.FindOidInfo(CryptOidInfoKeyType.CRYPT_OID_INFO_NAME_KEY, templateName, + Interop.Crypt32.FindOidInfo(Interop.Crypt32.CryptOidInfoKeyType.CRYPT_OID_INFO_NAME_KEY, templateName, OidGroup.Template, fallBackToAllGroups: true).OID; if (expectedOidValue == null) expectedOidValue = templateName; @@ -213,7 +211,7 @@ public unsafe void FindByApplicationPolicy(string oidValue) { int numOids; int cbData = 0; - if (!Interop.crypt32.CertGetValidUsages(1, ref pCertContext, out numOids, null, ref cbData)) + if (!Interop.Crypt32.CertGetValidUsages(1, ref pCertContext, out numOids, null, ref cbData)) return false; // -1 means the certificate is good for all usages. @@ -222,7 +220,7 @@ public unsafe void FindByApplicationPolicy(string oidValue) fixed (byte* pOidsPointer = new byte[cbData]) { - if (!Interop.crypt32.CertGetValidUsages(1, ref pCertContext, out numOids, pOidsPointer, ref cbData)) + if (!Interop.Crypt32.CertGetValidUsages(1, ref pCertContext, out numOids, pOidsPointer, ref cbData)) return false; IntPtr* pOids = (IntPtr*)pOidsPointer; @@ -244,7 +242,7 @@ public unsafe void FindByCertificatePolicy(string oidValue) static (oidValue, pCertContext) => { Interop.Crypt32.CERT_INFO* pCertInfo = pCertContext.CertContext->pCertInfo; - Interop.Crypt32.CERT_EXTENSION* pCertExtension = Interop.crypt32.CertFindExtension(Oids.CertPolicies, + Interop.Crypt32.CERT_EXTENSION* pCertExtension = Interop.Crypt32.CertFindExtension(Oids.CertPolicies, pCertInfo->cExtension, pCertInfo->rgExtension); if (pCertExtension == null) return false; @@ -285,7 +283,7 @@ public unsafe void FindByExtension(string oidValue) static (oidValue, pCertContext) => { Interop.Crypt32.CERT_INFO* pCertInfo = pCertContext.CertContext->pCertInfo; - Interop.Crypt32.CERT_EXTENSION* pCertExtension = Interop.crypt32.CertFindExtension(oidValue, pCertInfo->cExtension, pCertInfo->rgExtension); + Interop.Crypt32.CERT_EXTENSION* pCertExtension = Interop.Crypt32.CertFindExtension(oidValue, pCertInfo->cExtension, pCertInfo->rgExtension); GC.KeepAlive(pCertContext); return pCertExtension != null; }); @@ -313,11 +311,11 @@ public void FindBySubjectKeyIdentifier(byte[] keyIdentifier) static (keyIdentifier, pCertContext) => { int cbData = 0; - if (!CertGetCertificateContextProperty(pCertContext, Interop.Crypt32.CertContextPropId.CERT_KEY_IDENTIFIER_PROP_ID, null, ref cbData)) + if (!Interop.Crypt32.CertGetCertificateContextProperty(pCertContext, Interop.Crypt32.CertContextPropId.CERT_KEY_IDENTIFIER_PROP_ID, null, ref cbData)) return false; byte[] actual = new byte[cbData]; - if (!CertGetCertificateContextProperty(pCertContext, Interop.Crypt32.CertContextPropId.CERT_KEY_IDENTIFIER_PROP_ID, actual, ref cbData)) + if (!Interop.Crypt32.CertGetCertificateContextProperty(pCertContext, Interop.Crypt32.CertContextPropId.CERT_KEY_IDENTIFIER_PROP_ID, actual, ref cbData)) return false; return keyIdentifier.ContentsEqual(actual); @@ -331,16 +329,16 @@ public void Dispose() private unsafe void FindCore(TState state, Func filter) { - FindCore(CertFindType.CERT_FIND_ANY, null, state, filter); + FindCore(Interop.Crypt32.CertFindType.CERT_FIND_ANY, null, state, filter); } - private unsafe void FindCore(CertFindType dwFindType, void* pvFindPara, TState state = default!, Func? filter = null) + private unsafe void FindCore(Interop.Crypt32.CertFindType dwFindType, void* pvFindPara, TState state = default!, Func? filter = null) { SafeCertStoreHandle findResults = Interop.crypt32.CertOpenStore( CertStoreProvider.CERT_STORE_PROV_MEMORY, - CertEncodingType.All, + Interop.Crypt32.CertEncodingType.All, IntPtr.Zero, - CertStoreFlags.CERT_STORE_ENUM_ARCHIVED_FLAG | CertStoreFlags.CERT_STORE_CREATE_NEW_FLAG, + Interop.Crypt32.CertStoreFlags.CERT_STORE_ENUM_ARCHIVED_FLAG | Interop.Crypt32.CertStoreFlags.CERT_STORE_CREATE_NEW_FLAG, null); if (findResults.IsInvalid) throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); @@ -357,7 +355,7 @@ private unsafe void FindCore(CertFindType dwFindType, void* pvFindPara, continue; } - if (!Interop.crypt32.CertAddCertificateLinkToStore(findResults, pCertContext, CertStoreAddDisposition.CERT_STORE_ADD_ALWAYS, IntPtr.Zero)) + if (!Interop.Crypt32.CertAddCertificateLinkToStore(findResults, pCertContext, Interop.Crypt32.CertStoreAddDisposition.CERT_STORE_ADD_ALWAYS, IntPtr.Zero)) throw Marshal.GetLastWin32Error().ToCryptographicException(); } @@ -399,14 +397,14 @@ private static bool VerifyCertificateIgnoringErrors(SafeCertContextHandle pCertC return true; } - private static unsafe string GetCertNameInfo(SafeCertContextHandle pCertContext, CertNameType dwNameType, CertNameFlags dwNameFlags) + private static unsafe string GetCertNameInfo(SafeCertContextHandle pCertContext, Interop.Crypt32.CertNameType dwNameType, Interop.Crypt32.CertNameFlags dwNameFlags) { - Debug.Assert(dwNameType != CertNameType.CERT_NAME_ATTR_TYPE); + Debug.Assert(dwNameType != Interop.Crypt32.CertNameType.CERT_NAME_ATTR_TYPE); return Interop.crypt32.CertGetNameString( pCertContext, dwNameType, dwNameFlags, - CertNameStringType.CERT_X500_NAME_STR | CertNameStringType.CERT_NAME_STR_REVERSE_FLAG); + Interop.Crypt32.CertNameStringType.CERT_X500_NAME_STR | Interop.Crypt32.CertNameStringType.CERT_NAME_STR_REVERSE_FLAG); } } } diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Helpers.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Helpers.cs index 40028fc6f763b9..07dc27d9a39b30 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Helpers.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Helpers.cs @@ -89,7 +89,7 @@ public static TResult DecodeObject( lpszStructType, encoded, encoded.Length, - CryptDecodeObjectFlags.None, + Interop.Crypt32.CryptDecodeObjectFlags.None, null, ref cb)) { @@ -103,7 +103,7 @@ public static TResult DecodeObject( lpszStructType, encoded, encoded.Length, - CryptDecodeObjectFlags.None, + Interop.Crypt32.CryptDecodeObjectFlags.None, decoded, ref cb)) { @@ -123,12 +123,12 @@ public static TResult DecodeObject( { int cb = 0; - if (!Interop.crypt32.CryptDecodeObjectPointer( + if (!Interop.Crypt32.CryptDecodeObjectPointer( Interop.Crypt32.CertEncodingType.All, lpszStructType, encoded, encoded.Length, - CryptDecodeObjectFlags.None, + Interop.Crypt32.CryptDecodeObjectFlags.None, null, ref cb)) { @@ -137,12 +137,12 @@ public static TResult DecodeObject( byte* decoded = stackalloc byte[cb]; - if (!Interop.crypt32.CryptDecodeObjectPointer( + if (!Interop.Crypt32.CryptDecodeObjectPointer( Interop.Crypt32.CertEncodingType.All, lpszStructType, encoded, encoded.Length, - CryptDecodeObjectFlags.None, + Interop.Crypt32.CryptDecodeObjectFlags.None, decoded, ref cb)) { @@ -167,7 +167,7 @@ public static bool DecodeObjectNoThrow( lpszStructType, encoded, encoded.Length, - CryptDecodeObjectFlags.None, + Interop.Crypt32.CryptDecodeObjectFlags.None, null, ref cb)) { @@ -181,7 +181,7 @@ public static bool DecodeObjectNoThrow( lpszStructType, encoded, encoded.Length, - CryptDecodeObjectFlags.None, + Interop.Crypt32.CryptDecodeObjectFlags.None, decoded, ref cb)) { diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.crypt32.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.crypt32.cs index 5296889b4f2ed9..8df13c01e359c6 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.crypt32.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.crypt32.cs @@ -2,12 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; -using System.Text; using System.Diagnostics; using System.Runtime.InteropServices; -using CryptographicException = System.Security.Cryptography.CryptographicException; - using SafeBCryptKeyHandle = Microsoft.Win32.SafeHandles.SafeBCryptKeyHandle; using SafeX509ChainHandle = Microsoft.Win32.SafeHandles.SafeX509ChainHandle; using X509KeyUsageFlags = System.Security.Cryptography.X509Certificates.X509KeyUsageFlags; @@ -17,31 +14,18 @@ using Internal.Cryptography.Pal.Native; using Microsoft.Win32.SafeHandles; using System.Diagnostics.CodeAnalysis; -using static Interop.Crypt32; internal static partial class Interop { public static partial class crypt32 { - [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertGetCertificateContextProperty", CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe partial bool CertGetCertificateContextPropertyString(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, byte* pvData, ref int pcbData); - - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, DATA_BLOB* pvData); - - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, CRYPT_KEY_PROV_INFO* pvData); - - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe partial bool CertSetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, CertSetPropertyFlags dwFlags, SafeNCryptKeyHandle keyHandle); - public static unsafe string CertGetNameString( SafeCertContextHandle certContext, - CertNameType certNameType, - CertNameFlags certNameFlags, - CertNameStringType strType) + Interop.Crypt32.CertNameType certNameType, + Interop.Crypt32.CertNameFlags certNameFlags, + Interop.Crypt32.CertNameStringType strType) { - int cchCount = CertGetNameString(certContext, certNameType, certNameFlags, strType, null, 0); + int cchCount = Crypt32.CertGetNameString(certContext, certNameType, certNameFlags, strType, null, 0); if (cchCount == 0) { throw Marshal.GetLastWin32Error().ToCryptographicException(); @@ -50,7 +34,7 @@ public static unsafe string CertGetNameString( Span buffer = cchCount <= 256 ? stackalloc char[cchCount] : new char[cchCount]; fixed (char* ptr = &MemoryMarshal.GetReference(buffer)) { - if (CertGetNameString(certContext, certNameType, certNameFlags, strType, ptr, cchCount) == 0) + if (Crypt32.CertGetNameString(certContext, certNameType, certNameFlags, strType, ptr, cchCount) == 0) { throw Marshal.GetLastWin32Error().ToCryptographicException(); } @@ -60,32 +44,11 @@ public static unsafe string CertGetNameString( } } - [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertGetNameStringW", CharSet = CharSet.Unicode, SetLastError = true)] - private static unsafe partial int CertGetNameString(SafeCertContextHandle pCertContext, CertNameType dwType, CertNameFlags dwFlags, in CertNameStringType pvTypePara, char* pszNameString, int cchNameString); - - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] - public static partial SafeX509ChainHandle CertDuplicateCertificateChain(IntPtr pChainContext); - - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] - internal static partial SafeCertStoreHandle CertDuplicateStore(IntPtr hCertStore); - - [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertDuplicateCertificateContext", CharSet = CharSet.Unicode, SetLastError = true)] - public static partial SafeCertContextHandleWithKeyContainerDeletion CertDuplicateCertificateContextWithKeyContainerDeletion(IntPtr pCertContext); - - public static SafeCertStoreHandle CertOpenStore(CertStoreProvider lpszStoreProvider, CertEncodingType dwMsgAndCertEncodingType, IntPtr hCryptProv, CertStoreFlags dwFlags, string? pvPara) + public static SafeCertStoreHandle CertOpenStore(CertStoreProvider lpszStoreProvider, Interop.Crypt32.CertEncodingType dwMsgAndCertEncodingType, IntPtr hCryptProv, Interop.Crypt32.CertStoreFlags dwFlags, string? pvPara) { - return CertOpenStore((IntPtr)lpszStoreProvider, dwMsgAndCertEncodingType, hCryptProv, dwFlags, pvPara); + return Crypt32.CertOpenStore((IntPtr)lpszStoreProvider, dwMsgAndCertEncodingType, hCryptProv, dwFlags, pvPara); } - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - private static partial SafeCertStoreHandle CertOpenStore(IntPtr lpszStoreProvider, CertEncodingType dwMsgAndCertEncodingType, IntPtr hCryptProv, CertStoreFlags dwFlags, [MarshalAs(UnmanagedType.LPWStr)] string? pvPara); - - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static partial bool CertAddCertificateContextToStore(SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, CertStoreAddDisposition dwAddDisposition, IntPtr ppStoreContext); - - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static partial bool CertAddCertificateLinkToStore(SafeCertStoreHandle hCertStore, SafeCertContextHandle pCertContext, CertStoreAddDisposition dwAddDisposition, IntPtr ppStoreContext); - /// /// A less error-prone wrapper for CertEnumCertificatesInStore(). /// @@ -95,7 +58,7 @@ public static SafeCertStoreHandle CertOpenStore(CertStoreProvider lpszStoreProvi /// public static unsafe bool CertEnumCertificatesInStore(SafeCertStoreHandle hCertStore, [NotNull] ref SafeCertContextHandle? pCertContext) { - CERT_CONTEXT* pPrevCertContext; + Interop.Crypt32.CERT_CONTEXT* pPrevCertContext; if (pCertContext == null) { pCertContext = new SafeCertContextHandle(); @@ -106,7 +69,7 @@ public static unsafe bool CertEnumCertificatesInStore(SafeCertStoreHandle hCertS pPrevCertContext = pCertContext.Disconnect(); } - pCertContext.SetHandle((IntPtr)CertEnumCertificatesInStore(hCertStore, pPrevCertContext)); + pCertContext.SetHandle((IntPtr)Crypt32.CertEnumCertificatesInStore(hCertStore, pPrevCertContext)); if (!pCertContext.IsInvalid) { @@ -117,65 +80,29 @@ public static unsafe bool CertEnumCertificatesInStore(SafeCertStoreHandle hCertS return false; } - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - private static unsafe partial CERT_CONTEXT* CertEnumCertificatesInStore(SafeCertStoreHandle hCertStore, CERT_CONTEXT* pPrevCertContext); - - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static partial SafeCertStoreHandle PFXImportCertStore(ref DATA_BLOB pPFX, SafePasswordHandle password, PfxCertStoreFlags dwFlags); - - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe partial bool CryptMsgGetParam(SafeCryptMsgHandle hCryptMsg, CryptMessageParameterType dwParamType, int dwIndex, byte* pvData, ref int pcbData); - - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static partial bool CryptMsgGetParam(SafeCryptMsgHandle hCryptMsg, CryptMessageParameterType dwParamType, int dwIndex, out int pvData, ref int pcbData); - - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static partial bool CertSerializeCertificateStoreElement(SafeCertContextHandle pCertContext, int dwFlags, byte[]? pbElement, ref int pcbElement); - - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static partial bool PFXExportCertStore(SafeCertStoreHandle hStore, ref DATA_BLOB pPFX, SafePasswordHandle szPassword, PFXExportFlags dwFlags); - - [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CertStrToNameW", CharSet = CharSet.Unicode, SetLastError = true)] - public static partial bool CertStrToName(CertEncodingType dwCertEncodingType, string pszX500, CertNameStrTypeAndFlags dwStrType, IntPtr pvReserved, byte[]? pbEncoded, ref int pcbEncoded, IntPtr ppszError); - - public static bool CryptDecodeObject(CertEncodingType dwCertEncodingType, CryptDecodeObjectStructType lpszStructType, byte[] pbEncoded, int cbEncoded, CryptDecodeObjectFlags dwFlags, byte[]? pvStructInfo, ref int pcbStructInfo) + public static bool CryptDecodeObject(Interop.Crypt32.CertEncodingType dwCertEncodingType, CryptDecodeObjectStructType lpszStructType, byte[] pbEncoded, int cbEncoded, Interop.Crypt32.CryptDecodeObjectFlags dwFlags, byte[]? pvStructInfo, ref int pcbStructInfo) { - return CryptDecodeObject(dwCertEncodingType, (IntPtr)lpszStructType, pbEncoded, cbEncoded, dwFlags, pvStructInfo, ref pcbStructInfo); + return Interop.Crypt32.CryptDecodeObject(dwCertEncodingType, (IntPtr)lpszStructType, pbEncoded, cbEncoded, dwFlags, pvStructInfo, ref pcbStructInfo); } - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - private static partial bool CryptDecodeObject(CertEncodingType dwCertEncodingType, IntPtr lpszStructType, byte[] pbEncoded, int cbEncoded, CryptDecodeObjectFlags dwFlags, byte[]? pvStructInfo, ref int pcbStructInfo); - - public static unsafe bool CryptDecodeObjectPointer(CertEncodingType dwCertEncodingType, CryptDecodeObjectStructType lpszStructType, byte[] pbEncoded, int cbEncoded, CryptDecodeObjectFlags dwFlags, void* pvStructInfo, ref int pcbStructInfo) + public static unsafe bool CryptDecodeObjectPointer(Interop.Crypt32.CertEncodingType dwCertEncodingType, CryptDecodeObjectStructType lpszStructType, byte[] pbEncoded, int cbEncoded, Interop.Crypt32.CryptDecodeObjectFlags dwFlags, void* pvStructInfo, ref int pcbStructInfo) { - return CryptDecodeObjectPointer(dwCertEncodingType, (IntPtr)lpszStructType, pbEncoded, cbEncoded, dwFlags, pvStructInfo, ref pcbStructInfo); + return Interop.Crypt32.CryptDecodeObjectPointer(dwCertEncodingType, (IntPtr)lpszStructType, pbEncoded, cbEncoded, dwFlags, pvStructInfo, ref pcbStructInfo); } - [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CryptDecodeObject", CharSet = CharSet.Unicode, SetLastError = true)] - private static unsafe partial bool CryptDecodeObjectPointer(CertEncodingType dwCertEncodingType, IntPtr lpszStructType, byte[] pbEncoded, int cbEncoded, CryptDecodeObjectFlags dwFlags, void* pvStructInfo, ref int pcbStructInfo); - - [GeneratedDllImport(Libraries.Crypt32, EntryPoint = "CryptDecodeObject", CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe partial bool CryptDecodeObjectPointer(CertEncodingType dwCertEncodingType, [MarshalAs(UnmanagedType.LPStr)] string lpszStructType, byte[] pbEncoded, int cbEncoded, CryptDecodeObjectFlags dwFlags, void* pvStructInfo, ref int pcbStructInfo); - - public static unsafe bool CryptEncodeObject(CertEncodingType dwCertEncodingType, CryptDecodeObjectStructType lpszStructType, void* pvStructInfo, byte[]? pbEncoded, ref int pcbEncoded) + public static unsafe bool CryptEncodeObject(Interop.Crypt32.CertEncodingType dwCertEncodingType, CryptDecodeObjectStructType lpszStructType, void* pvStructInfo, byte[]? pbEncoded, ref int pcbEncoded) { - return CryptEncodeObject(dwCertEncodingType, (IntPtr)lpszStructType, pvStructInfo, pbEncoded, ref pcbEncoded); + return Interop.Crypt32.CryptEncodeObject(dwCertEncodingType, (IntPtr)lpszStructType, pvStructInfo, pbEncoded, ref pcbEncoded); } - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - private static unsafe partial bool CryptEncodeObject(CertEncodingType dwCertEncodingType, IntPtr lpszStructType, void* pvStructInfo, byte[]? pbEncoded, ref int pcbEncoded); - - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe partial bool CryptEncodeObject(CertEncodingType dwCertEncodingType, [MarshalAs(UnmanagedType.LPStr)] string lpszStructType, void* pvStructInfo, byte[]? pbEncoded, ref int pcbEncoded); - public static unsafe byte[] EncodeObject(CryptDecodeObjectStructType lpszStructType, void* decoded) { int cb = 0; - if (!Interop.crypt32.CryptEncodeObject(CertEncodingType.All, lpszStructType, decoded, null, ref cb)) + if (!Interop.crypt32.CryptEncodeObject(Interop.Crypt32.CertEncodingType.All, lpszStructType, decoded, null, ref cb)) throw Marshal.GetLastWin32Error().ToCryptographicException(); byte[] encoded = new byte[cb]; - if (!Interop.crypt32.CryptEncodeObject(CertEncodingType.All, lpszStructType, decoded, encoded, ref cb)) + if (!Interop.crypt32.CryptEncodeObject(Interop.Crypt32.CertEncodingType.All, lpszStructType, decoded, encoded, ref cb)) throw Marshal.GetLastWin32Error().ToCryptographicException(); return encoded; @@ -184,19 +111,19 @@ public static unsafe byte[] EncodeObject(CryptDecodeObjectStructType lpszStructT public static unsafe byte[] EncodeObject(string lpszStructType, void* decoded) { int cb = 0; - if (!Interop.crypt32.CryptEncodeObject(CertEncodingType.All, lpszStructType, decoded, null, ref cb)) + if (!Interop.Crypt32.CryptEncodeObject(Interop.Crypt32.CertEncodingType.All, lpszStructType, decoded, null, ref cb)) throw Marshal.GetLastWin32Error().ToCryptographicException(); byte[] encoded = new byte[cb]; - if (!Interop.crypt32.CryptEncodeObject(CertEncodingType.All, lpszStructType, decoded, encoded, ref cb)) + if (!Interop.Crypt32.CryptEncodeObject(Interop.Crypt32.CertEncodingType.All, lpszStructType, decoded, encoded, ref cb)) throw Marshal.GetLastWin32Error().ToCryptographicException(); return encoded; } - internal static SafeChainEngineHandle CertCreateCertificateChainEngine(ref CERT_CHAIN_ENGINE_CONFIG config) + internal static SafeChainEngineHandle CertCreateCertificateChainEngine(ref Interop.Crypt32.CERT_CHAIN_ENGINE_CONFIG config) { - if (!CertCreateCertificateChainEngine(ref config, out SafeChainEngineHandle chainEngineHandle)) + if (!Interop.Crypt32.CertCreateCertificateChainEngine(ref config, out SafeChainEngineHandle chainEngineHandle)) { int errorCode = Marshal.GetLastWin32Error(); throw errorCode.ToCryptographicException(); @@ -205,21 +132,6 @@ internal static SafeChainEngineHandle CertCreateCertificateChainEngine(ref CERT_ return chainEngineHandle; } - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - private static partial bool CertCreateCertificateChainEngine(ref CERT_CHAIN_ENGINE_CONFIG pConfig, out SafeChainEngineHandle hChainEngineHandle); - - [DllImport(Libraries.Crypt32)] - public static extern void CertFreeCertificateChainEngine(IntPtr hChainEngine); - - [GeneratedDllImport(Libraries.Crypt32, SetLastError = true)] - public static unsafe partial bool CertGetCertificateChain(IntPtr hChainEngine, SafeCertContextHandle pCertContext, FILETIME* pTime, SafeCertStoreHandle hStore, ref CERT_CHAIN_PARA pChainPara, CertChainFlags dwFlags, IntPtr pvReserved, out SafeX509ChainHandle ppChainContext); - - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static partial bool CryptHashPublicKeyInfo(IntPtr hCryptProv, int algId, int dwFlags, CertEncodingType dwCertEncodingType, ref CERT_PUBLIC_KEY_INFO pInfo, byte[] pbComputedHash, ref int pcbComputedHash); - - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static partial bool CertSaveStore(SafeCertStoreHandle hCertStore, CertEncodingType dwMsgAndCertEncodingType, CertStoreSaveAs dwSaveAs, CertStoreSaveTo dwSaveTo, ref DATA_BLOB pvSaveToPara, int dwFlags); - /// /// A less error-prone wrapper for CertEnumCertificatesInStore(). /// @@ -227,52 +139,30 @@ internal static SafeChainEngineHandle CertCreateCertificateChainEngine(ref CERT_ /// the next certificate in the iteration. The final call sets pCertContext to an invalid SafeCertStoreHandle /// and returns "false" to indicate the end of the store has been reached. /// - public static unsafe bool CertFindCertificateInStore(SafeCertStoreHandle hCertStore, CertFindType dwFindType, void* pvFindPara, [NotNull] ref SafeCertContextHandle? pCertContext) + public static unsafe bool CertFindCertificateInStore(SafeCertStoreHandle hCertStore, Interop.Crypt32.CertFindType dwFindType, void* pvFindPara, [NotNull] ref SafeCertContextHandle? pCertContext) { - CERT_CONTEXT* pPrevCertContext = pCertContext == null ? null : pCertContext.Disconnect(); - pCertContext = CertFindCertificateInStore(hCertStore, CertEncodingType.All, CertFindFlags.None, dwFindType, pvFindPara, pPrevCertContext); + Interop.Crypt32.CERT_CONTEXT* pPrevCertContext = pCertContext == null ? null : pCertContext.Disconnect(); + pCertContext = Interop.Crypt32.CertFindCertificateInStore(hCertStore, Interop.Crypt32.CertEncodingType.All, Interop.Crypt32.CertFindFlags.None, dwFindType, pvFindPara, pPrevCertContext); return !pCertContext.IsInvalid; } - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - private static unsafe partial SafeCertContextHandle CertFindCertificateInStore(SafeCertStoreHandle hCertStore, CertEncodingType dwCertEncodingType, CertFindFlags dwFindFlags, CertFindType dwFindType, void* pvFindPara, CERT_CONTEXT* pPrevCertContext); - - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe partial int CertVerifyTimeValidity(ref FILETIME pTimeToVerify, CERT_INFO* pCertInfo); - - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe partial CERT_EXTENSION* CertFindExtension([MarshalAs(UnmanagedType.LPStr)] string pszObjId, int cExtensions, IntPtr rgExtensions); - - // Note: It's somewhat unusual to use an API enum as a parameter type to a P/Invoke but in this case, X509KeyUsageFlags was intentionally designed as bit-wise - // identical to the wincrypt CERT_*_USAGE values. - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe partial bool CertGetIntendedKeyUsage(CertEncodingType dwCertEncodingType, CERT_INFO* pCertInfo, out X509KeyUsageFlags pbKeyUsage, int cbKeyUsage); - - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe partial bool CertGetValidUsages(int cCerts, ref SafeCertContextHandle rghCerts, out int cNumOIDs, void* rghOIDs, ref int pcbOIDs); - - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static partial bool CertControlStore(SafeCertStoreHandle hCertStore, CertControlStoreFlags dwFlags, CertControlStoreType dwControlType, IntPtr pvCtrlPara); - - // Note: CertDeleteCertificateFromStore always calls CertFreeCertificateContext on pCertContext, even if an error is encountered. - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe partial bool CertDeleteCertificateFromStore(CERT_CONTEXT* pCertContext); - - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static partial void CertFreeCertificateChain(IntPtr pChainContext); - - public static bool CertVerifyCertificateChainPolicy(ChainPolicy pszPolicyOID, SafeX509ChainHandle pChainContext, ref CERT_CHAIN_POLICY_PARA pPolicyPara, ref CERT_CHAIN_POLICY_STATUS pPolicyStatus) + public static unsafe bool CertGetIntendedKeyUsage(Interop.Crypt32.CertEncodingType dwCertEncodingType, Interop.Crypt32.CERT_INFO* pCertInfo, out X509KeyUsageFlags pbKeyUsage, int cbKeyUsage) { - return CertVerifyCertificateChainPolicy((IntPtr)pszPolicyOID, pChainContext, ref pPolicyPara, ref pPolicyStatus); + bool result = Interop.Crypt32.CertGetIntendedKeyUsage(dwCertEncodingType, pCertInfo, out Interop.Crypt32.X509KeyUsageFlags x509KeyUsageFlags, cbKeyUsage); + pbKeyUsage = (X509KeyUsageFlags)(int)x509KeyUsageFlags; + return result; } - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - private static partial bool CertVerifyCertificateChainPolicy(IntPtr pszPolicyOID, SafeX509ChainHandle pChainContext, ref CERT_CHAIN_POLICY_PARA pPolicyPara, ref CERT_CHAIN_POLICY_STATUS pPolicyStatus); - - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static unsafe partial bool CryptImportPublicKeyInfoEx2(CertEncodingType dwCertEncodingType, CERT_PUBLIC_KEY_INFO* pInfo, CryptImportPublicKeyInfoFlags dwFlags, void* pvAuxInfo, out SafeBCryptKeyHandle phKey); + public static bool CertVerifyCertificateChainPolicy(ChainPolicy pszPolicyOID, SafeX509ChainHandle pChainContext, ref Interop.Crypt32.CERT_CHAIN_POLICY_PARA pPolicyPara, ref Interop.Crypt32.CERT_CHAIN_POLICY_STATUS pPolicyStatus) + { + return Interop.Crypt32.CertVerifyCertificateChainPolicy((IntPtr)pszPolicyOID, pChainContext, ref pPolicyPara, ref pPolicyStatus); + } - [GeneratedDllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - public static partial bool CryptAcquireCertificatePrivateKey(SafeCertContextHandle pCert, CryptAcquireFlags dwFlags, IntPtr pvParameters, out SafeNCryptKeyHandle phCryptProvOrNCryptKey, out int pdwKeySpec, out bool pfCallerFreeProvOrNCryptKey); + public static bool CryptAcquireCertificatePrivateKey(SafeCertContextHandle pCert, Interop.Crypt32.CryptAcquireCertificatePrivateKeyFlags dwFlags, IntPtr pvParameters, out SafeNCryptKeyHandle phCryptProvOrNCryptKey, out int pdwKeySpec, out bool pfCallerFreeProvOrNCryptKey) + { + bool result = Interop.Crypt32.CryptAcquireCertificatePrivateKey(pCert, dwFlags, pvParameters, out phCryptProvOrNCryptKey, out Interop.Crypt32.CryptKeySpec pdwKeySpecEnum, out pfCallerFreeProvOrNCryptKey); + pdwKeySpec = (int)pdwKeySpecEnum; + return result; + } } } diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Primitives.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Primitives.cs index fa9ea0bd2dffe6..bec34b98cd60c9 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Primitives.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Primitives.cs @@ -2,107 +2,16 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; -using System.Diagnostics; using System.Runtime.InteropServices; namespace Internal.Cryptography.Pal.Native { - [Flags] - internal enum CertSetPropertyFlags : int - { - CERT_SET_PROPERTY_INHIBIT_PERSIST_FLAG = 0x40000000, - None = 0x00000000, - } - - internal enum CertNameType : int - { - CERT_NAME_EMAIL_TYPE = 1, - CERT_NAME_RDN_TYPE = 2, - CERT_NAME_ATTR_TYPE = 3, - CERT_NAME_SIMPLE_DISPLAY_TYPE = 4, - CERT_NAME_FRIENDLY_DISPLAY_TYPE = 5, - CERT_NAME_DNS_TYPE = 6, - CERT_NAME_URL_TYPE = 7, - CERT_NAME_UPN_TYPE = 8, - } - - [Flags] - internal enum CertNameFlags : int - { - None = 0x00000000, - CERT_NAME_ISSUER_FLAG = 0x00000001, - } - - internal enum CertNameStringType : int - { - CERT_X500_NAME_STR = 3, - - CERT_NAME_STR_REVERSE_FLAG = 0x02000000, - } - internal enum CertStoreProvider : int { CERT_STORE_PROV_MEMORY = 2, CERT_STORE_PROV_SYSTEM_W = 10, } - [Flags] - internal enum CertStoreFlags : int - { - CERT_STORE_NO_CRYPT_RELEASE_FLAG = 0x00000001, - CERT_STORE_SET_LOCALIZED_NAME_FLAG = 0x00000002, - CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG = 0x00000004, - CERT_STORE_DELETE_FLAG = 0x00000010, - CERT_STORE_UNSAFE_PHYSICAL_FLAG = 0x00000020, - CERT_STORE_SHARE_STORE_FLAG = 0x00000040, - CERT_STORE_SHARE_CONTEXT_FLAG = 0x00000080, - CERT_STORE_MANIFOLD_FLAG = 0x00000100, - CERT_STORE_ENUM_ARCHIVED_FLAG = 0x00000200, - CERT_STORE_UPDATE_KEYID_FLAG = 0x00000400, - CERT_STORE_BACKUP_RESTORE_FLAG = 0x00000800, - CERT_STORE_READONLY_FLAG = 0x00008000, - CERT_STORE_OPEN_EXISTING_FLAG = 0x00004000, - CERT_STORE_CREATE_NEW_FLAG = 0x00002000, - CERT_STORE_MAXIMUM_ALLOWED_FLAG = 0x00001000, - - CERT_SYSTEM_STORE_CURRENT_USER = 0x00010000, - CERT_SYSTEM_STORE_LOCAL_MACHINE = 0x00020000, - - None = 0x00000000, - } - - internal enum CertStoreAddDisposition : int - { - CERT_STORE_ADD_NEW = 1, - CERT_STORE_ADD_USE_EXISTING = 2, - CERT_STORE_ADD_REPLACE_EXISTING = 3, - CERT_STORE_ADD_ALWAYS = 4, - CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES = 5, - CERT_STORE_ADD_NEWER = 6, - CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES = 7, - } - - [Flags] - internal enum PfxCertStoreFlags : int - { - CRYPT_EXPORTABLE = 0x00000001, - CRYPT_USER_PROTECTED = 0x00000002, - CRYPT_MACHINE_KEYSET = 0x00000020, - CRYPT_USER_KEYSET = 0x00001000, - PKCS12_PREFER_CNG_KSP = 0x00000100, - PKCS12_ALWAYS_CNG_KSP = 0x00000200, - PKCS12_ALLOW_OVERWRITE_KEY = 0x00004000, - PKCS12_NO_PERSIST_KEY = 0x00008000, - PKCS12_INCLUDE_EXTENDED_PROPERTIES = 0x00000010, - None = 0x00000000, - } - - internal enum CryptMessageParameterType : int - { - CMSG_SIGNER_COUNT_PARAM = 5, - CMSG_SIGNER_INFO_PARAM = 6, - } - [StructLayout(LayoutKind.Sequential)] internal struct CMSG_SIGNER_INFO_Partial // This is not the full definition of CMSG_SIGNER_INFO. Only defining the part we use. { @@ -112,71 +21,6 @@ internal struct CMSG_SIGNER_INFO_Partial // This is not the full definition of //... more fields follow ... } - [Flags] - internal enum CertFindFlags : int - { - None = 0x00000000, - } - - internal enum CertFindType : int - { - CERT_FIND_SUBJECT_CERT = 0x000b0000, - CERT_FIND_HASH = 0x00010000, - CERT_FIND_SUBJECT_STR = 0x00080007, - CERT_FIND_ISSUER_STR = 0x00080004, - CERT_FIND_EXISTING = 0x000d0000, - CERT_FIND_ANY = 0x00000000, - } - - [Flags] - internal enum PFXExportFlags : int - { - REPORT_NO_PRIVATE_KEY = 0x00000001, - REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY = 0x00000002, - EXPORT_PRIVATE_KEYS = 0x00000004, - None = 0x00000000, - } - - [StructLayout(LayoutKind.Sequential)] - internal unsafe struct CRYPT_KEY_PROV_INFO - { - public char* pwszContainerName; - public char* pwszProvName; - public int dwProvType; - public CryptAcquireContextFlags dwFlags; - public int cProvParam; - public IntPtr rgProvParam; - public int dwKeySpec; - } - - [Flags] - internal enum CryptAcquireContextFlags : int - { - CRYPT_DELETEKEYSET = 0x00000010, - CRYPT_MACHINE_KEYSET = 0x00000020, - None = 0x00000000, - } - - [Flags] - internal enum CertNameStrTypeAndFlags : int - { - CERT_SIMPLE_NAME_STR = 1, - CERT_OID_NAME_STR = 2, - CERT_X500_NAME_STR = 3, - - CERT_NAME_STR_SEMICOLON_FLAG = 0x40000000, - CERT_NAME_STR_NO_PLUS_FLAG = 0x20000000, - CERT_NAME_STR_NO_QUOTING_FLAG = 0x10000000, - CERT_NAME_STR_CRLF_FLAG = 0x08000000, - CERT_NAME_STR_COMMA_FLAG = 0x04000000, - CERT_NAME_STR_REVERSE_FLAG = 0x02000000, - - CERT_NAME_STR_DISABLE_IE4_UTF8_FLAG = 0x00010000, - CERT_NAME_STR_ENABLE_T61_UNICODE_FLAG = 0x00020000, - CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG = 0x00040000, - CERT_NAME_STR_FORCE_UTF8_DIR_STR_FLAG = 0x00080000, - } - internal enum FormatObjectType : int { None = 0, @@ -195,12 +39,6 @@ internal static class AlgId public const int CALG_SHA1 = 0x8004; } - [Flags] - internal enum CryptDecodeObjectFlags : int - { - None = 0x00000000, - } - internal enum CryptDecodeObjectStructType : int { CNG_RSA_PUBLIC_KEY_BLOB = 72, @@ -215,58 +53,6 @@ internal enum CryptDecodeObjectStructType : int X509_CERTIFICATE_TEMPLATE = 64, } - [StructLayout(LayoutKind.Sequential)] - internal struct CTL_USAGE - { - public int cUsageIdentifier; - public IntPtr rgpszUsageIdentifier; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CERT_USAGE_MATCH - { - public CertUsageMatchType dwType; - public CTL_USAGE Usage; - } - - internal enum CertUsageMatchType : int - { - USAGE_MATCH_TYPE_AND = 0x00000000, - USAGE_MATCH_TYPE_OR = 0x00000001, - } - - [StructLayout(LayoutKind.Sequential)] - internal unsafe struct CERT_CHAIN_PARA - { - public int cbSize; - public CERT_USAGE_MATCH RequestedUsage; - public CERT_USAGE_MATCH RequestedIssuancePolicy; - public int dwUrlRetrievalTimeout; - public int fCheckRevocationFreshnessTime; - public int dwRevocationFreshnessTime; - public Interop.Crypt32.FILETIME* pftCacheResync; - public int pStrongSignPara; - public int dwStrongSignFlags; - } - - [Flags] - internal enum CertChainFlags : int - { - None = 0x00000000, - CERT_CHAIN_DISABLE_AUTH_ROOT_AUTO_UPDATE = 0x00000100, - CERT_CHAIN_DISABLE_AIA = 0x00002000, - CERT_CHAIN_REVOCATION_CHECK_END_CERT = 0x10000000, - CERT_CHAIN_REVOCATION_CHECK_CHAIN = 0x20000000, - CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT = 0x40000000, - CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY = unchecked((int)0x80000000), - } - - internal enum ChainEngine : int - { - HCCE_CURRENT_USER = 0x0, - HCCE_LOCAL_MACHINE = 0x1, - } - [StructLayout(LayoutKind.Sequential)] internal struct CERT_DSS_PARAMETERS { @@ -308,17 +94,6 @@ internal unsafe struct CERT_ENHKEY_USAGE public IntPtr* rgpszUsageIdentifier; // LPSTR* } - internal enum CertStoreSaveAs : int - { - CERT_STORE_SAVE_AS_STORE = 1, - CERT_STORE_SAVE_AS_PKCS7 = 2, - } - - internal enum CertStoreSaveTo : int - { - CERT_STORE_SAVE_TO_MEMORY = 2, - } - [StructLayout(LayoutKind.Sequential)] internal struct CERT_POLICY_INFO { @@ -350,17 +125,6 @@ internal struct CERT_TEMPLATE_EXT public int dwMinorVersion; } - [Flags] - internal enum CertControlStoreFlags : int - { - None = 0x00000000, - } - - internal enum CertControlStoreType : int - { - CERT_STORE_CTRL_AUTO_RESYNC = 4, - } - [Flags] internal enum CertTrustErrorStatus : int { @@ -481,68 +245,9 @@ internal unsafe struct CERT_CHAIN_CONTEXT public Guid ChainId; } - [StructLayout(LayoutKind.Sequential)] - internal struct CERT_CHAIN_POLICY_PARA - { - public int cbSize; - public int dwFlags; - public IntPtr pvExtraPolicyPara; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CERT_CHAIN_POLICY_STATUS - { - public int cbSize; - public int dwError; - public IntPtr lChainIndex; - public IntPtr lElementIndex; - public IntPtr pvExtraPolicyStatus; - } - internal enum ChainPolicy : int { // Predefined verify chain policies CERT_CHAIN_POLICY_BASE = 1, } - - internal enum CryptAcquireFlags : int - { - CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG = 0x00040000, - } - - [Flags] - internal enum ChainEngineConfigFlags : int - { - CERT_CHAIN_CACHE_END_CERT = 0x00000001, - CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL = 0x00000004, - CERT_CHAIN_USE_LOCAL_MACHINE_STORE = 0x00000008, - CERT_CHAIN_ENABLE_CACHE_AUTO_UPDATE = 0x00000010, - CERT_CHAIN_ENABLE_SHARE_STORE = 0x00000020, - CERT_CHAIN_DISABLE_AIA = 0x00002000, - } - - // Windows 7 definition of the struct - [StructLayout(LayoutKind.Sequential)] - internal struct CERT_CHAIN_ENGINE_CONFIG - { - public int cbSize; - public IntPtr hRestrictedRoot; - public IntPtr hRestrictedTrust; - public IntPtr hRestrictedOther; - public int cAdditionalStore; - public IntPtr rghAdditionalStore; - public ChainEngineConfigFlags dwFlags; - public int dwUrlRetrievalTimeout; - public int MaximumCachedCertificates; - public int CycleDetectionModulus; - public IntPtr hExclusiveRoot; - public IntPtr hExclusiveTrustedPeople; - } - - [Flags] - internal enum CryptImportPublicKeyInfoFlags - { - NONE = 0, - CRYPT_OID_INFO_PUBKEY_ENCRYPT_KEY_FLAG = 0x40000000, - } } diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/SafeHandles.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/SafeHandles.cs index 32db9a41b273b3..c9cf3d62fe0559 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/SafeHandles.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/SafeHandles.cs @@ -2,86 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.Win32.SafeHandles; -using System; -using System.Diagnostics; using System.Runtime.InteropServices; -using System.Security.Cryptography; #pragma warning disable CA1419 // TODO https://github.com/dotnet/roslyn-analyzers/issues/5232: not intended for use with P/Invoke namespace Internal.Cryptography.Pal.Native { - /// - /// SafeHandle for the CERT_CONTEXT structure defined by crypt32. Unlike SafeCertContextHandle, disposition already deletes any associated key containers. - /// - internal sealed class SafeCertContextHandleWithKeyContainerDeletion : SafeCertContextHandle - { - protected sealed override bool ReleaseHandle() - { - using (SafeCertContextHandle certContext = Interop.Crypt32.CertDuplicateCertificateContext(handle)) - { - DeleteKeyContainer(certContext); - } - base.ReleaseHandle(); - return true; - } - - public static void DeleteKeyContainer(SafeCertContextHandle pCertContext) - { - if (pCertContext.IsInvalid) - return; - - int cb = 0; - bool containsPrivateKey = Interop.Crypt32.CertGetCertificateContextProperty(pCertContext, Interop.Crypt32.CertContextPropId.CERT_KEY_PROV_INFO_PROP_ID, null, ref cb); - if (!containsPrivateKey) - return; - - byte[] provInfoAsBytes = new byte[cb]; - if (!Interop.Crypt32.CertGetCertificateContextProperty(pCertContext, Interop.Crypt32.CertContextPropId.CERT_KEY_PROV_INFO_PROP_ID, provInfoAsBytes, ref cb)) - return; - - unsafe - { - fixed (byte* pProvInfoAsBytes = provInfoAsBytes) - { - CRYPT_KEY_PROV_INFO* pProvInfo = (CRYPT_KEY_PROV_INFO*)pProvInfoAsBytes; - - if (pProvInfo->dwProvType == 0) - { - // dwProvType being 0 indicates that the key is stored in CNG. - // dwProvType being non-zero indicates that the key is stored in CAPI. - - string providerName = Marshal.PtrToStringUni((IntPtr)(pProvInfo->pwszProvName))!; - string keyContainerName = Marshal.PtrToStringUni((IntPtr)(pProvInfo->pwszContainerName))!; - - try - { - using (CngKey cngKey = CngKey.Open(keyContainerName, new CngProvider(providerName))) - { - cngKey.Delete(); - } - } - catch (CryptographicException) - { - // While leaving the file on disk is undesirable, an inability to perform this cleanup - // should not manifest itself to a user. - } - } - else - { - CryptAcquireContextFlags flags = (pProvInfo->dwFlags & CryptAcquireContextFlags.CRYPT_MACHINE_KEYSET) | CryptAcquireContextFlags.CRYPT_DELETEKEYSET; - IntPtr hProv; - _ = Interop.cryptoapi.CryptAcquireContext(out hProv, pProvInfo->pwszContainerName, pProvInfo->pwszProvName, pProvInfo->dwProvType, flags); - - // Called CryptAcquireContext solely for the side effect of deleting the key containers. When called with these flags, no actual - // hProv is returned (so there's nothing to clean up.) - Debug.Assert(hProv == IntPtr.Zero); - } - } - } - } - } - /// /// SafeHandle for LocalAlloc'd memory. /// @@ -100,39 +26,4 @@ protected sealed override bool ReleaseHandle() return true; } } - - internal sealed class SafeChainEngineHandle : SafeHandleZeroOrMinusOneIsInvalid - { - public SafeChainEngineHandle() - : base(true) - { - } - - private SafeChainEngineHandle(IntPtr handle) - : base(true) - { - SetHandle(handle); - } - - public static readonly SafeChainEngineHandle MachineChainEngine = - new SafeChainEngineHandle((IntPtr)ChainEngine.HCCE_LOCAL_MACHINE); - - public static readonly SafeChainEngineHandle UserChainEngine = - new SafeChainEngineHandle((IntPtr)ChainEngine.HCCE_CURRENT_USER); - - protected sealed override bool ReleaseHandle() - { - Interop.crypt32.CertFreeCertificateChainEngine(handle); - SetHandle(IntPtr.Zero); - return true; - } - - protected override void Dispose(bool disposing) - { - if (this != UserChainEngine && this != MachineChainEngine) - { - base.Dispose(disposing); - } - } - } } diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/StorePal.Export.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/StorePal.Export.cs index 25c937bb2d0bea..2a44fb6aba75e5 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/StorePal.Export.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/StorePal.Export.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Internal.Cryptography.Pal.Native; using Microsoft.Win32.SafeHandles; using System; using System.Diagnostics; @@ -56,11 +55,11 @@ public void MoveTo(X509Certificate2Collection collection) try { int cbEncoded = 0; - if (!Interop.crypt32.CertSerializeCertificateStoreElement(pCertContext, 0, null, ref cbEncoded)) + if (!Interop.Crypt32.CertSerializeCertificateStoreElement(pCertContext, 0, null, ref cbEncoded)) throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); byte[] pbEncoded = new byte[cbEncoded]; - if (!Interop.crypt32.CertSerializeCertificateStoreElement(pCertContext, 0, pbEncoded, ref cbEncoded)) + if (!Interop.Crypt32.CertSerializeCertificateStoreElement(pCertContext, 0, pbEncoded, ref cbEncoded)) throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); return pbEncoded; @@ -77,14 +76,14 @@ public void MoveTo(X509Certificate2Collection collection) { Interop.Crypt32.DATA_BLOB dataBlob = new Interop.Crypt32.DATA_BLOB(IntPtr.Zero, 0); - if (!Interop.crypt32.PFXExportCertStore(_certStore, ref dataBlob, password, PFXExportFlags.EXPORT_PRIVATE_KEYS | PFXExportFlags.REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY)) + if (!Interop.Crypt32.PFXExportCertStore(_certStore, ref dataBlob, password, Interop.Crypt32.PFXExportFlags.EXPORT_PRIVATE_KEYS | Interop.Crypt32.PFXExportFlags.REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY)) throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); byte[] pbEncoded = new byte[dataBlob.cbData]; fixed (byte* ppbEncoded = pbEncoded) { dataBlob.pbData = new IntPtr(ppbEncoded); - if (!Interop.crypt32.PFXExportCertStore(_certStore, ref dataBlob, password, PFXExportFlags.EXPORT_PRIVATE_KEYS | PFXExportFlags.REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY)) + if (!Interop.Crypt32.PFXExportCertStore(_certStore, ref dataBlob, password, Interop.Crypt32.PFXExportFlags.EXPORT_PRIVATE_KEYS | Interop.Crypt32.PFXExportFlags.REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY)) throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); } @@ -93,29 +92,29 @@ public void MoveTo(X509Certificate2Collection collection) } case X509ContentType.SerializedStore: - return SaveToMemoryStore(CertStoreSaveAs.CERT_STORE_SAVE_AS_STORE); + return SaveToMemoryStore(Interop.Crypt32.CertStoreSaveAs.CERT_STORE_SAVE_AS_STORE); case X509ContentType.Pkcs7: - return SaveToMemoryStore(CertStoreSaveAs.CERT_STORE_SAVE_AS_PKCS7); + return SaveToMemoryStore(Interop.Crypt32.CertStoreSaveAs.CERT_STORE_SAVE_AS_PKCS7); default: throw new CryptographicException(SR.Cryptography_X509_InvalidContentType); } } - private byte[] SaveToMemoryStore(CertStoreSaveAs dwSaveAs) + private byte[] SaveToMemoryStore(Interop.Crypt32.CertStoreSaveAs dwSaveAs) { unsafe { Interop.Crypt32.DATA_BLOB blob = new Interop.Crypt32.DATA_BLOB(IntPtr.Zero, 0); - if (!Interop.crypt32.CertSaveStore(_certStore, Interop.Crypt32.CertEncodingType.All, dwSaveAs, CertStoreSaveTo.CERT_STORE_SAVE_TO_MEMORY, ref blob, 0)) + if (!Interop.Crypt32.CertSaveStore(_certStore, Interop.Crypt32.CertEncodingType.All, dwSaveAs, Interop.Crypt32.CertStoreSaveTo.CERT_STORE_SAVE_TO_MEMORY, ref blob, 0)) throw Marshal.GetLastWin32Error().ToCryptographicException(); byte[] exportedData = new byte[blob.cbData]; fixed (byte* pExportedData = exportedData) { blob.pbData = new IntPtr(pExportedData); - if (!Interop.crypt32.CertSaveStore(_certStore, Interop.Crypt32.CertEncodingType.All, dwSaveAs, CertStoreSaveTo.CERT_STORE_SAVE_TO_MEMORY, ref blob, 0)) + if (!Interop.Crypt32.CertSaveStore(_certStore, Interop.Crypt32.CertEncodingType.All, dwSaveAs, Interop.Crypt32.CertStoreSaveTo.CERT_STORE_SAVE_TO_MEMORY, ref blob, 0)) throw Marshal.GetLastWin32Error().ToCryptographicException(); } diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/StorePal.Import.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/StorePal.Import.cs index 02338229783fe1..ed4c5386e74bf1 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/StorePal.Import.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/StorePal.Import.cs @@ -37,7 +37,7 @@ private static StorePal FromBlobOrFile(ReadOnlySpan rawData, string? fileN { Interop.Crypt32.DATA_BLOB blob = new Interop.Crypt32.DATA_BLOB(new IntPtr(pRawData), (uint)(fromFile ? 0 : rawData!.Length)); bool persistKeySet = (0 != (keyStorageFlags & X509KeyStorageFlags.PersistKeySet)); - PfxCertStoreFlags certStoreFlags = MapKeyStorageFlags(keyStorageFlags); + Interop.Crypt32.PfxCertStoreFlags certStoreFlags = MapKeyStorageFlags(keyStorageFlags); void* pvObject = fromFile ? (void*)pFileName : (void*)&blob; @@ -71,7 +71,7 @@ private static StorePal FromBlobOrFile(ReadOnlySpan rawData, string? fileN fixed (byte* pRawData2 = rawData) { Interop.Crypt32.DATA_BLOB blob2 = new Interop.Crypt32.DATA_BLOB(new IntPtr(pRawData2), (uint)rawData!.Length); - certStore = Interop.crypt32.PFXImportCertStore(ref blob2, password, certStoreFlags); + certStore = Interop.Crypt32.PFXImportCertStore(ref blob2, password, certStoreFlags); if (certStore == null || certStore.IsInvalid) throw Marshal.GetLastWin32Error().ToCryptographicException(); } @@ -87,7 +87,7 @@ private static StorePal FromBlobOrFile(ReadOnlySpan rawData, string? fileN while (Interop.crypt32.CertEnumCertificatesInStore(certStore, ref pCertContext)) { Interop.Crypt32.DATA_BLOB nullBlob = new Interop.Crypt32.DATA_BLOB(IntPtr.Zero, 0); - if (!Interop.crypt32.CertSetCertificateContextProperty(pCertContext, Interop.Crypt32.CertContextPropId.CERT_CLR_DELETE_KEY_PROP_ID, CertSetPropertyFlags.CERT_SET_PROPERTY_INHIBIT_PERSIST_FLAG, &nullBlob)) + if (!Interop.Crypt32.CertSetCertificateContextProperty(pCertContext, Interop.Crypt32.CertContextPropId.CERT_CLR_DELETE_KEY_PROP_ID, Interop.Crypt32.CertSetPropertyFlags.CERT_SET_PROPERTY_INHIBIT_PERSIST_FLAG, &nullBlob)) throw Marshal.GetLastWin32Error().ToCryptographicException(); } } @@ -107,11 +107,11 @@ public static IExportPal FromCertificate(ICertificatePalCore cert) CertStoreProvider.CERT_STORE_PROV_MEMORY, Interop.Crypt32.CertEncodingType.All, IntPtr.Zero, - CertStoreFlags.CERT_STORE_ENUM_ARCHIVED_FLAG | CertStoreFlags.CERT_STORE_CREATE_NEW_FLAG | CertStoreFlags.CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG, + Interop.Crypt32.CertStoreFlags.CERT_STORE_ENUM_ARCHIVED_FLAG | Interop.Crypt32.CertStoreFlags.CERT_STORE_CREATE_NEW_FLAG | Interop.Crypt32.CertStoreFlags.CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG, null); if (certStore.IsInvalid) throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); - if (!Interop.crypt32.CertAddCertificateLinkToStore(certStore, certificatePal.CertContext, CertStoreAddDisposition.CERT_STORE_ADD_ALWAYS, IntPtr.Zero)) + if (!Interop.Crypt32.CertAddCertificateLinkToStore(certStore, certificatePal.CertContext, Interop.Crypt32.CertStoreAddDisposition.CERT_STORE_ADD_ALWAYS, IntPtr.Zero)) throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); return new StorePal(certStore); } @@ -129,7 +129,7 @@ public static IExportPal LinkFromCertificateCollection(X509Certificate2Collectio CertStoreProvider.CERT_STORE_PROV_MEMORY, Interop.Crypt32.CertEncodingType.All, IntPtr.Zero, - CertStoreFlags.CERT_STORE_ENUM_ARCHIVED_FLAG | CertStoreFlags.CERT_STORE_CREATE_NEW_FLAG, + Interop.Crypt32.CertStoreFlags.CERT_STORE_ENUM_ARCHIVED_FLAG | Interop.Crypt32.CertStoreFlags.CERT_STORE_CREATE_NEW_FLAG, null); if (certStore.IsInvalid) throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); @@ -142,7 +142,7 @@ public static IExportPal LinkFromCertificateCollection(X509Certificate2Collectio for (int i = 0; i < certificates.Count; i++) { SafeCertContextHandle certContext = ((CertificatePal)certificates[i].Pal!).CertContext; - if (!Interop.crypt32.CertAddCertificateLinkToStore(certStore, certContext, CertStoreAddDisposition.CERT_STORE_ADD_ALWAYS, IntPtr.Zero)) + if (!Interop.Crypt32.CertAddCertificateLinkToStore(certStore, certContext, Interop.Crypt32.CertStoreAddDisposition.CERT_STORE_ADD_ALWAYS, IntPtr.Zero)) throw Marshal.GetLastWin32Error().ToCryptographicException(); } @@ -151,7 +151,7 @@ public static IExportPal LinkFromCertificateCollection(X509Certificate2Collectio public static IStorePal FromSystemStore(string storeName, StoreLocation storeLocation, OpenFlags openFlags) { - CertStoreFlags certStoreFlags = MapX509StoreFlags(storeLocation, openFlags); + Interop.Crypt32.CertStoreFlags certStoreFlags = MapX509StoreFlags(storeLocation, openFlags); SafeCertStoreHandle certStore = Interop.crypt32.CertOpenStore(CertStoreProvider.CERT_STORE_PROV_SYSTEM_W, Interop.Crypt32.CertEncodingType.All, IntPtr.Zero, certStoreFlags, storeName); if (certStore.IsInvalid) @@ -163,55 +163,55 @@ public static IStorePal FromSystemStore(string storeName, StoreLocation storeLoc // // For compat with desktop, ignoring any failures from this call. (It is pretty unlikely to fail, in any case.) // - _ = Interop.crypt32.CertControlStore(certStore, CertControlStoreFlags.None, CertControlStoreType.CERT_STORE_CTRL_AUTO_RESYNC, IntPtr.Zero); + _ = Interop.Crypt32.CertControlStore(certStore, Interop.Crypt32.CertControlStoreFlags.None, Interop.Crypt32.CertControlStoreType.CERT_STORE_CTRL_AUTO_RESYNC, IntPtr.Zero); return new StorePal(certStore); } // this method maps a X509KeyStorageFlags enum to a combination of crypto API flags - private static PfxCertStoreFlags MapKeyStorageFlags(X509KeyStorageFlags keyStorageFlags) + private static Interop.Crypt32.PfxCertStoreFlags MapKeyStorageFlags(X509KeyStorageFlags keyStorageFlags) { - PfxCertStoreFlags dwFlags = 0; + Interop.Crypt32.PfxCertStoreFlags dwFlags = 0; if ((keyStorageFlags & X509KeyStorageFlags.UserKeySet) == X509KeyStorageFlags.UserKeySet) - dwFlags |= PfxCertStoreFlags.CRYPT_USER_KEYSET; + dwFlags |= Interop.Crypt32.PfxCertStoreFlags.CRYPT_USER_KEYSET; else if ((keyStorageFlags & X509KeyStorageFlags.MachineKeySet) == X509KeyStorageFlags.MachineKeySet) - dwFlags |= PfxCertStoreFlags.CRYPT_MACHINE_KEYSET; + dwFlags |= Interop.Crypt32.PfxCertStoreFlags.CRYPT_MACHINE_KEYSET; if ((keyStorageFlags & X509KeyStorageFlags.Exportable) == X509KeyStorageFlags.Exportable) - dwFlags |= PfxCertStoreFlags.CRYPT_EXPORTABLE; + dwFlags |= Interop.Crypt32.PfxCertStoreFlags.CRYPT_EXPORTABLE; if ((keyStorageFlags & X509KeyStorageFlags.UserProtected) == X509KeyStorageFlags.UserProtected) - dwFlags |= PfxCertStoreFlags.CRYPT_USER_PROTECTED; + dwFlags |= Interop.Crypt32.PfxCertStoreFlags.CRYPT_USER_PROTECTED; if ((keyStorageFlags & X509KeyStorageFlags.EphemeralKeySet) == X509KeyStorageFlags.EphemeralKeySet) - dwFlags |= PfxCertStoreFlags.PKCS12_NO_PERSIST_KEY | PfxCertStoreFlags.PKCS12_ALWAYS_CNG_KSP; + dwFlags |= Interop.Crypt32.PfxCertStoreFlags.PKCS12_NO_PERSIST_KEY | Interop.Crypt32.PfxCertStoreFlags.PKCS12_ALWAYS_CNG_KSP; return dwFlags; } // this method maps X509Store OpenFlags to a combination of crypto API flags - private static CertStoreFlags MapX509StoreFlags(StoreLocation storeLocation, OpenFlags flags) + private static Interop.Crypt32.CertStoreFlags MapX509StoreFlags(StoreLocation storeLocation, OpenFlags flags) { - CertStoreFlags dwFlags = 0; + Interop.Crypt32.CertStoreFlags dwFlags = 0; uint openMode = ((uint)flags) & 0x3; switch (openMode) { case (uint)OpenFlags.ReadOnly: - dwFlags |= CertStoreFlags.CERT_STORE_READONLY_FLAG; + dwFlags |= Interop.Crypt32.CertStoreFlags.CERT_STORE_READONLY_FLAG; break; case (uint)OpenFlags.MaxAllowed: - dwFlags |= CertStoreFlags.CERT_STORE_MAXIMUM_ALLOWED_FLAG; + dwFlags |= Interop.Crypt32.CertStoreFlags.CERT_STORE_MAXIMUM_ALLOWED_FLAG; break; } if ((flags & OpenFlags.OpenExistingOnly) == OpenFlags.OpenExistingOnly) - dwFlags |= CertStoreFlags.CERT_STORE_OPEN_EXISTING_FLAG; + dwFlags |= Interop.Crypt32.CertStoreFlags.CERT_STORE_OPEN_EXISTING_FLAG; if ((flags & OpenFlags.IncludeArchived) == OpenFlags.IncludeArchived) - dwFlags |= CertStoreFlags.CERT_STORE_ENUM_ARCHIVED_FLAG; + dwFlags |= Interop.Crypt32.CertStoreFlags.CERT_STORE_ENUM_ARCHIVED_FLAG; if (storeLocation == StoreLocation.LocalMachine) - dwFlags |= CertStoreFlags.CERT_SYSTEM_STORE_LOCAL_MACHINE; + dwFlags |= Interop.Crypt32.CertStoreFlags.CERT_SYSTEM_STORE_LOCAL_MACHINE; else if (storeLocation == StoreLocation.CurrentUser) - dwFlags |= CertStoreFlags.CERT_SYSTEM_STORE_CURRENT_USER; + dwFlags |= Interop.Crypt32.CertStoreFlags.CERT_SYSTEM_STORE_CURRENT_USER; return dwFlags; } diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/StorePal.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/StorePal.cs index 2d6328d9d00c5d..47bbfe4c7988dd 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/StorePal.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/StorePal.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Internal.Cryptography.Pal.Native; using Microsoft.Win32.SafeHandles; using System; using System.Diagnostics; @@ -20,7 +19,7 @@ public static IStorePal FromHandle(IntPtr storeHandle) if (storeHandle == IntPtr.Zero) throw new ArgumentNullException(nameof(storeHandle)); - SafeCertStoreHandle certStoreHandle = Interop.crypt32.CertDuplicateStore(storeHandle); + SafeCertStoreHandle certStoreHandle = Interop.Crypt32.CertDuplicateStore(storeHandle); if (certStoreHandle == null || certStoreHandle.IsInvalid) throw new CryptographicException(SR.Cryptography_InvalidStoreHandle, nameof(storeHandle)); @@ -47,7 +46,7 @@ public void CopyTo(X509Certificate2Collection collection) public void Add(ICertificatePal certificate) { - if (!Interop.crypt32.CertAddCertificateContextToStore(_certStore, ((CertificatePal)certificate).CertContext, CertStoreAddDisposition.CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES, IntPtr.Zero)) + if (!Interop.Crypt32.CertAddCertificateContextToStore(_certStore, ((CertificatePal)certificate).CertContext, Interop.Crypt32.CertStoreAddDisposition.CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES, IntPtr.Zero)) throw Marshal.GetLastWin32Error().ToCryptographicException(); } @@ -58,11 +57,11 @@ public void Remove(ICertificatePal certificate) SafeCertContextHandle existingCertContext = ((CertificatePal)certificate).CertContext; SafeCertContextHandle? enumCertContext = null; Interop.Crypt32.CERT_CONTEXT* pCertContext = existingCertContext.CertContext; - if (!Interop.crypt32.CertFindCertificateInStore(_certStore, CertFindType.CERT_FIND_EXISTING, pCertContext, ref enumCertContext)) + if (!Interop.crypt32.CertFindCertificateInStore(_certStore, Interop.Crypt32.CertFindType.CERT_FIND_EXISTING, pCertContext, ref enumCertContext)) return; // The certificate is not present in the store, simply return. Interop.Crypt32.CERT_CONTEXT* pCertContextToDelete = enumCertContext.Disconnect(); // CertDeleteCertificateFromContext always frees the context (even on error) - if (!Interop.crypt32.CertDeleteCertificateFromStore(pCertContextToDelete)) + if (!Interop.Crypt32.CertDeleteCertificateFromStore(pCertContextToDelete)) throw Marshal.GetLastWin32Error().ToCryptographicException(); GC.KeepAlive(existingCertContext); diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/X509Pal.CustomExtensions.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/X509Pal.CustomExtensions.cs index 763f127441568c..677fb54ac35b1a 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/X509Pal.CustomExtensions.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/X509Pal.CustomExtensions.cs @@ -224,7 +224,7 @@ public byte[] ComputeCapiSha1OfPublicKey(PublicKey key) int cb = 20; byte[] buffer = new byte[cb]; - if (!Interop.crypt32.CryptHashPublicKeyInfo(IntPtr.Zero, AlgId.CALG_SHA1, 0, Interop.Crypt32.CertEncodingType.All, ref publicKeyInfo, buffer, ref cb)) + if (!Interop.Crypt32.CryptHashPublicKeyInfo(IntPtr.Zero, AlgId.CALG_SHA1, 0, Interop.Crypt32.CertEncodingType.All, ref publicKeyInfo, buffer, ref cb)) throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); if (cb < buffer.Length) { diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/X509Pal.PublicKey.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/X509Pal.PublicKey.cs index 6751c910661b24..bbabcba73603c0 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/X509Pal.PublicKey.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/X509Pal.PublicKey.cs @@ -31,8 +31,7 @@ public ECDsa DecodeECDsaPublicKey(ICertificatePal? certificatePal) { return DecodeECPublicKey( pal, - factory: cngKey => new ECDsaCng(cngKey), - import: (algorithm, ecParams) => algorithm.ImportParameters(ecParams)); + factory: cngKey => new ECDsaCng(cngKey)); } throw new NotSupportedException(SR.NotSupported_KeyAlgorithm); @@ -45,7 +44,6 @@ public ECDiffieHellman DecodeECDiffieHellmanPublicKey(ICertificatePal? certifica return DecodeECPublicKey( pal, factory: cngKey => new ECDiffieHellmanCng(cngKey), - import: (algorithm, ecParams) => algorithm.ImportParameters(ecParams), importFlags: CryptImportPublicKeyInfoFlags.CRYPT_OID_INFO_PUBKEY_ENCRYPT_KEY_FLAG); } @@ -79,9 +77,8 @@ public AsymmetricAlgorithm DecodePublicKey(Oid oid, byte[] encodedKeyValue, byte private static TAlgorithm DecodeECPublicKey( CertificatePal certificatePal, Func factory, - Action import, CryptImportPublicKeyInfoFlags importFlags = CryptImportPublicKeyInfoFlags.NONE) - where TAlgorithm : AsymmetricAlgorithm, new() + where TAlgorithm : ECAlgorithm, new() { TAlgorithm key; @@ -116,7 +113,7 @@ private static TAlgorithm DecodeECPublicKey( ExportNamedCurveParameters(ref ecparams, keyBlob, false); ecparams.Curve = ECCurve.CreateFromFriendlyName(curveName); key = new TAlgorithm(); - import(key, ecparams); + key.ImportParameters(ecparams); } } @@ -134,7 +131,7 @@ private static SafeBCryptKeyHandle ImportPublicKeyInfo(SafeCertContextHandle cer { unsafe { - bool success = Interop.crypt32.CryptImportPublicKeyInfoEx2(Interop.Crypt32.CertEncodingType.X509_ASN_ENCODING, &(certContext.CertContext->pCertInfo->SubjectPublicKeyInfo), importFlags, null, out bCryptKeyHandle); + bool success = Interop.Crypt32.CryptImportPublicKeyInfoEx2(Interop.Crypt32.CertEncodingType.X509_ASN_ENCODING, &(certContext.CertContext->pCertInfo->SubjectPublicKeyInfo), importFlags, null, out bCryptKeyHandle); if (!success) throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); return bCryptKeyHandle; diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/X509Pal.X500DistinguishedName.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/X509Pal.X500DistinguishedName.cs index 0b455138ccf267..09341dca638bbb 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/X509Pal.X500DistinguishedName.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/X509Pal.X500DistinguishedName.cs @@ -2,16 +2,10 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; -using System.Text; using System.Diagnostics; -using System.Globalization; using System.Runtime.InteropServices; - -using Internal.Cryptography; -using Internal.Cryptography.Pal.Native; - -using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; +using Internal.Cryptography.Pal.Native; namespace Internal.Cryptography.Pal { @@ -23,7 +17,7 @@ internal sealed partial class X509Pal : IX509Pal { public string X500DistinguishedNameDecode(byte[] encodedDistinguishedName, X500DistinguishedNameFlags flag) { - int dwStrType = (int)(CertNameStrTypeAndFlags.CERT_X500_NAME_STR | MapNameToStrFlag(flag)); + int dwStrType = (int)(Interop.Crypt32.CertNameStrTypeAndFlags.CERT_X500_NAME_STR | MapNameToStrFlag(flag)); unsafe { fixed (byte* pbEncoded = encodedDistinguishedName) @@ -52,14 +46,14 @@ public byte[] X500DistinguishedNameEncode(string distinguishedName, X500Distingu { Debug.Assert(distinguishedName != null); - CertNameStrTypeAndFlags dwStrType = CertNameStrTypeAndFlags.CERT_X500_NAME_STR | MapNameToStrFlag(flag); + Interop.Crypt32.CertNameStrTypeAndFlags dwStrType = Interop.Crypt32.CertNameStrTypeAndFlags.CERT_X500_NAME_STR | MapNameToStrFlag(flag); int cbEncoded = 0; - if (!Interop.crypt32.CertStrToName(Interop.Crypt32.CertEncodingType.All, distinguishedName, dwStrType, IntPtr.Zero, null, ref cbEncoded, IntPtr.Zero)) + if (!Interop.Crypt32.CertStrToName(Interop.Crypt32.CertEncodingType.All, distinguishedName, dwStrType, IntPtr.Zero, null, ref cbEncoded, IntPtr.Zero)) throw Marshal.GetLastWin32Error().ToCryptographicException(); byte[] encodedName = new byte[cbEncoded]; - if (!Interop.crypt32.CertStrToName(Interop.Crypt32.CertEncodingType.All, distinguishedName, dwStrType, IntPtr.Zero, encodedName, ref cbEncoded, IntPtr.Zero)) + if (!Interop.Crypt32.CertStrToName(Interop.Crypt32.CertEncodingType.All, distinguishedName, dwStrType, IntPtr.Zero, encodedName, ref cbEncoded, IntPtr.Zero)) throw Marshal.GetLastWin32Error().ToCryptographicException(); return encodedName; @@ -109,38 +103,38 @@ public unsafe string X500DistinguishedNameFormat(byte[] encodedDistinguishedName return new string(buffer.Slice(0, (cbFormat / 2) - 1)); } - private static CertNameStrTypeAndFlags MapNameToStrFlag(X500DistinguishedNameFlags flag) + private static Interop.Crypt32.CertNameStrTypeAndFlags MapNameToStrFlag(X500DistinguishedNameFlags flag) { // All values or'ed together. Change this if you add values to the enumeration. uint allFlags = 0x71F1; uint dwFlags = (uint)flag; Debug.Assert((dwFlags & ~allFlags) == 0); - CertNameStrTypeAndFlags dwStrType = 0; + Interop.Crypt32.CertNameStrTypeAndFlags dwStrType = 0; if (dwFlags != 0) { if ((flag & X500DistinguishedNameFlags.Reversed) == X500DistinguishedNameFlags.Reversed) - dwStrType |= CertNameStrTypeAndFlags.CERT_NAME_STR_REVERSE_FLAG; + dwStrType |= Interop.Crypt32.CertNameStrTypeAndFlags.CERT_NAME_STR_REVERSE_FLAG; if ((flag & X500DistinguishedNameFlags.UseSemicolons) == X500DistinguishedNameFlags.UseSemicolons) - dwStrType |= CertNameStrTypeAndFlags.CERT_NAME_STR_SEMICOLON_FLAG; + dwStrType |= Interop.Crypt32.CertNameStrTypeAndFlags.CERT_NAME_STR_SEMICOLON_FLAG; else if ((flag & X500DistinguishedNameFlags.UseCommas) == X500DistinguishedNameFlags.UseCommas) - dwStrType |= CertNameStrTypeAndFlags.CERT_NAME_STR_COMMA_FLAG; + dwStrType |= Interop.Crypt32.CertNameStrTypeAndFlags.CERT_NAME_STR_COMMA_FLAG; else if ((flag & X500DistinguishedNameFlags.UseNewLines) == X500DistinguishedNameFlags.UseNewLines) - dwStrType |= CertNameStrTypeAndFlags.CERT_NAME_STR_CRLF_FLAG; + dwStrType |= Interop.Crypt32.CertNameStrTypeAndFlags.CERT_NAME_STR_CRLF_FLAG; if ((flag & X500DistinguishedNameFlags.DoNotUsePlusSign) == X500DistinguishedNameFlags.DoNotUsePlusSign) - dwStrType |= CertNameStrTypeAndFlags.CERT_NAME_STR_NO_PLUS_FLAG; + dwStrType |= Interop.Crypt32.CertNameStrTypeAndFlags.CERT_NAME_STR_NO_PLUS_FLAG; if ((flag & X500DistinguishedNameFlags.DoNotUseQuotes) == X500DistinguishedNameFlags.DoNotUseQuotes) - dwStrType |= CertNameStrTypeAndFlags.CERT_NAME_STR_NO_QUOTING_FLAG; + dwStrType |= Interop.Crypt32.CertNameStrTypeAndFlags.CERT_NAME_STR_NO_QUOTING_FLAG; if ((flag & X500DistinguishedNameFlags.ForceUTF8Encoding) == X500DistinguishedNameFlags.ForceUTF8Encoding) - dwStrType |= CertNameStrTypeAndFlags.CERT_NAME_STR_FORCE_UTF8_DIR_STR_FLAG; + dwStrType |= Interop.Crypt32.CertNameStrTypeAndFlags.CERT_NAME_STR_FORCE_UTF8_DIR_STR_FLAG; if ((flag & X500DistinguishedNameFlags.UseUTF8Encoding) == X500DistinguishedNameFlags.UseUTF8Encoding) - dwStrType |= CertNameStrTypeAndFlags.CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG; + dwStrType |= Interop.Crypt32.CertNameStrTypeAndFlags.CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG; else if ((flag & X500DistinguishedNameFlags.UseT61Encoding) == X500DistinguishedNameFlags.UseT61Encoding) - dwStrType |= CertNameStrTypeAndFlags.CERT_NAME_STR_ENABLE_T61_UNICODE_FLAG; + dwStrType |= Interop.Crypt32.CertNameStrTypeAndFlags.CERT_NAME_STR_ENABLE_T61_UNICODE_FLAG; } return dwStrType; } diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj b/src/libraries/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj index 7bed65be822123..3ea6525c02b418 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj @@ -1,4 +1,4 @@ - + true $(NoWarn);CA5384 @@ -130,7 +130,8 @@ - + @@ -243,7 +244,6 @@ - @@ -255,12 +255,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + true $(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) true + $(NoWarn);CA1850 Provides classes to support the creation and validation of XML digital signatures. The classes in this namespace implement the World Wide Web Consortium Recommendation, "XML-Signature Syntax and Processing", described at http://www.w3.org/TR/xmldsig-core/. Commonly Used Types: diff --git a/src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs b/src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs index 093e39056bc9e3..649f897e50af5b 100644 --- a/src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs +++ b/src/libraries/System.Security.Cryptography/ref/System.Security.Cryptography.cs @@ -6,6 +6,107 @@ namespace System.Security.Cryptography { + public abstract partial class Aes : System.Security.Cryptography.SymmetricAlgorithm + { + protected Aes() { } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static new System.Security.Cryptography.Aes Create() { throw null; } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] + public static new System.Security.Cryptography.Aes? Create(string algorithmName) { throw null; } + } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] + public sealed partial class AesCcm : System.IDisposable + { + public AesCcm(byte[] key) { } + public AesCcm(System.ReadOnlySpan key) { } + public static bool IsSupported { get { throw null; } } + public static System.Security.Cryptography.KeySizes NonceByteSizes { get { throw null; } } + public static System.Security.Cryptography.KeySizes TagByteSizes { get { throw null; } } + public void Decrypt(byte[] nonce, byte[] ciphertext, byte[] tag, byte[] plaintext, byte[]? associatedData = null) { } + public void Decrypt(System.ReadOnlySpan nonce, System.ReadOnlySpan ciphertext, System.ReadOnlySpan tag, System.Span plaintext, System.ReadOnlySpan associatedData = default(System.ReadOnlySpan)) { } + public void Dispose() { } + public void Encrypt(byte[] nonce, byte[] plaintext, byte[] ciphertext, byte[] tag, byte[]? associatedData = null) { } + public void Encrypt(System.ReadOnlySpan nonce, System.ReadOnlySpan plaintext, System.Span ciphertext, System.Span tag, System.ReadOnlySpan associatedData = default(System.ReadOnlySpan)) { } + } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] + public sealed partial class AesGcm : System.IDisposable + { + public AesGcm(byte[] key) { } + public AesGcm(System.ReadOnlySpan key) { } + public static bool IsSupported { get { throw null; } } + public static System.Security.Cryptography.KeySizes NonceByteSizes { get { throw null; } } + public static System.Security.Cryptography.KeySizes TagByteSizes { get { throw null; } } + public void Decrypt(byte[] nonce, byte[] ciphertext, byte[] tag, byte[] plaintext, byte[]? associatedData = null) { } + public void Decrypt(System.ReadOnlySpan nonce, System.ReadOnlySpan ciphertext, System.ReadOnlySpan tag, System.Span plaintext, System.ReadOnlySpan associatedData = default(System.ReadOnlySpan)) { } + public void Dispose() { } + public void Encrypt(byte[] nonce, byte[] plaintext, byte[] ciphertext, byte[] tag, byte[]? associatedData = null) { } + public void Encrypt(System.ReadOnlySpan nonce, System.ReadOnlySpan plaintext, System.Span ciphertext, System.Span tag, System.ReadOnlySpan associatedData = default(System.ReadOnlySpan)) { } + } + [System.ObsoleteAttribute("Derived cryptographic types are obsolete. Use the Create method on the base type instead.", DiagnosticId = "SYSLIB0021", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public sealed partial class AesManaged : System.Security.Cryptography.Aes + { + public AesManaged() { } + public override int BlockSize { get { throw null; } set { } } + public override int FeedbackSize { get { throw null; } set { } } + public override byte[] IV { get { throw null; } set { } } + public override byte[] Key { get { throw null; } set { } } + public override int KeySize { get { throw null; } set { } } + public override System.Security.Cryptography.KeySizes[] LegalBlockSizes { get { throw null; } } + public override System.Security.Cryptography.KeySizes[] LegalKeySizes { get { throw null; } } + public override System.Security.Cryptography.CipherMode Mode { get { throw null; } set { } } + public override System.Security.Cryptography.PaddingMode Padding { get { throw null; } set { } } + public override System.Security.Cryptography.ICryptoTransform CreateDecryptor() { throw null; } + public override System.Security.Cryptography.ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[]? rgbIV) { throw null; } + public override System.Security.Cryptography.ICryptoTransform CreateEncryptor() { throw null; } + public override System.Security.Cryptography.ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[]? rgbIV) { throw null; } + protected override void Dispose(bool disposing) { } + public override void GenerateIV() { } + public override void GenerateKey() { } + } + public partial class AsnEncodedData + { + protected AsnEncodedData() { } + public AsnEncodedData(byte[] rawData) { } + public AsnEncodedData(System.ReadOnlySpan rawData) { } + public AsnEncodedData(System.Security.Cryptography.AsnEncodedData asnEncodedData) { } + public AsnEncodedData(System.Security.Cryptography.Oid? oid, byte[] rawData) { } + public AsnEncodedData(System.Security.Cryptography.Oid? oid, System.ReadOnlySpan rawData) { } + public AsnEncodedData(string oid, byte[] rawData) { } + public AsnEncodedData(string oid, System.ReadOnlySpan rawData) { } + public System.Security.Cryptography.Oid? Oid { get { throw null; } set { } } + public byte[] RawData { get { throw null; } set { } } + public virtual void CopyFrom(System.Security.Cryptography.AsnEncodedData asnEncodedData) { } + public virtual string Format(bool multiLine) { throw null; } + } + public sealed partial class AsnEncodedDataCollection : System.Collections.ICollection, System.Collections.IEnumerable + { + public AsnEncodedDataCollection() { } + public AsnEncodedDataCollection(System.Security.Cryptography.AsnEncodedData asnEncodedData) { } + public int Count { get { throw null; } } + public bool IsSynchronized { get { throw null; } } + public System.Security.Cryptography.AsnEncodedData this[int index] { get { throw null; } } + public object SyncRoot { get { throw null; } } + public int Add(System.Security.Cryptography.AsnEncodedData asnEncodedData) { throw null; } + public void CopyTo(System.Security.Cryptography.AsnEncodedData[] array, int index) { } + public System.Security.Cryptography.AsnEncodedDataEnumerator GetEnumerator() { throw null; } + public void Remove(System.Security.Cryptography.AsnEncodedData asnEncodedData) { } + void System.Collections.ICollection.CopyTo(System.Array array, int index) { } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public sealed partial class AsnEncodedDataEnumerator : System.Collections.IEnumerator + { + internal AsnEncodedDataEnumerator() { } + public System.Security.Cryptography.AsnEncodedData Current { get { throw null; } } + object System.Collections.IEnumerator.Current { get { throw null; } } + public bool MoveNext() { throw null; } + public void Reset() { } + } public abstract partial class AsymmetricAlgorithm : System.IDisposable { protected int KeySizeValue; @@ -25,8 +126,11 @@ public void Dispose() { } protected virtual void Dispose(bool disposing) { } public virtual byte[] ExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters) { throw null; } public virtual byte[] ExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan password, System.Security.Cryptography.PbeParameters pbeParameters) { throw null; } + public string ExportEncryptedPkcs8PrivateKeyPem(System.ReadOnlySpan password, System.Security.Cryptography.PbeParameters pbeParameters) { throw null; } public virtual byte[] ExportPkcs8PrivateKey() { throw null; } + public string ExportPkcs8PrivateKeyPem() { throw null; } public virtual byte[] ExportSubjectPublicKeyInfo() { throw null; } + public string ExportSubjectPublicKeyInfoPem() { throw null; } public virtual void FromXmlString(string xmlString) { } public virtual void ImportEncryptedPkcs8PrivateKey(System.ReadOnlySpan passwordBytes, System.ReadOnlySpan source, out int bytesRead) { throw null; } public virtual void ImportEncryptedPkcs8PrivateKey(System.ReadOnlySpan password, System.ReadOnlySpan source, out int bytesRead) { throw null; } @@ -38,10 +142,19 @@ public virtual void ImportFromPem(System.ReadOnlySpan input) { } public virtual string ToXmlString(bool includePrivateParameters) { throw null; } public virtual bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span destination, out int bytesWritten) { throw null; } public virtual bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span destination, out int bytesWritten) { throw null; } + public bool TryExportEncryptedPkcs8PrivateKeyPem(System.ReadOnlySpan password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span destination, out int charsWritten) { throw null; } public virtual bool TryExportPkcs8PrivateKey(System.Span destination, out int bytesWritten) { throw null; } + public bool TryExportPkcs8PrivateKeyPem(System.Span destination, out int charsWritten) { throw null; } public virtual bool TryExportSubjectPublicKeyInfo(System.Span destination, out int bytesWritten) { throw null; } + public bool TryExportSubjectPublicKeyInfoPem(System.Span destination, out int charsWritten) { throw null; } + } + public abstract partial class AsymmetricKeyExchangeDeformatter + { + protected AsymmetricKeyExchangeDeformatter() { } + public abstract string? Parameters { get; set; } + public abstract byte[] DecryptKeyExchange(byte[] rgb); + public abstract void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key); } - [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public abstract partial class AsymmetricKeyExchangeFormatter { protected AsymmetricKeyExchangeFormatter() { } @@ -50,6 +163,36 @@ protected AsymmetricKeyExchangeFormatter() { } public abstract byte[] CreateKeyExchange(byte[] data, System.Type? symAlgType); public abstract void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key); } + public abstract partial class AsymmetricSignatureDeformatter + { + protected AsymmetricSignatureDeformatter() { } + public abstract void SetHashAlgorithm(string strName); + public abstract void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key); + public abstract bool VerifySignature(byte[] rgbHash, byte[] rgbSignature); + public virtual bool VerifySignature(System.Security.Cryptography.HashAlgorithm hash, byte[] rgbSignature) { throw null; } + } + public abstract partial class AsymmetricSignatureFormatter + { + protected AsymmetricSignatureFormatter() { } + public abstract byte[] CreateSignature(byte[] rgbHash); + public virtual byte[] CreateSignature(System.Security.Cryptography.HashAlgorithm hash) { throw null; } + public abstract void SetHashAlgorithm(string strName); + public abstract void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key); + } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] + public sealed partial class ChaCha20Poly1305 : System.IDisposable + { + public ChaCha20Poly1305(byte[] key) { } + public ChaCha20Poly1305(System.ReadOnlySpan key) { } + public static bool IsSupported { get { throw null; } } + public void Decrypt(byte[] nonce, byte[] ciphertext, byte[] tag, byte[] plaintext, byte[]? associatedData = null) { } + public void Decrypt(System.ReadOnlySpan nonce, System.ReadOnlySpan ciphertext, System.ReadOnlySpan tag, System.Span plaintext, System.ReadOnlySpan associatedData = default(System.ReadOnlySpan)) { } + public void Dispose() { } + public void Encrypt(byte[] nonce, byte[] plaintext, byte[] ciphertext, byte[] tag, byte[]? associatedData = null) { } + public void Encrypt(System.ReadOnlySpan nonce, System.ReadOnlySpan plaintext, System.Span ciphertext, System.Span tag, System.ReadOnlySpan associatedData = default(System.ReadOnlySpan)) { } + } public enum CipherMode { CBC = 1, @@ -59,6 +202,24 @@ public enum CipherMode CFB = 4, CTS = 5, } + public partial class CryptoConfig + { + public CryptoConfig() { } + public static bool AllowOnlyFipsAlgorithms { get { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static void AddAlgorithm(System.Type algorithm, params string[] names) { } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static void AddOID(string oid, params string[] names) { } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] + public static object? CreateFromName(string name) { throw null; } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] + public static object? CreateFromName(string name, params object?[]? args) { throw null; } + [System.ObsoleteAttribute("EncodeOID is obsolete. Use the ASN.1 functionality provided in System.Formats.Asn1.", DiagnosticId = "SYSLIB0031", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static byte[] EncodeOID(string str) { throw null; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static string? MapNameToOID(string name) { throw null; } + } public static partial class CryptographicOperations { public static bool FixedTimeEquals(System.ReadOnlySpan left, System.ReadOnlySpan right) { throw null; } @@ -111,6 +272,324 @@ public enum CryptoStreamMode Read = 0, Write = 1, } + public abstract partial class DeriveBytes : System.IDisposable + { + protected DeriveBytes() { } + public void Dispose() { } + protected virtual void Dispose(bool disposing) { } + public abstract byte[] GetBytes(int cb); + public abstract void Reset(); + } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public abstract partial class DES : System.Security.Cryptography.SymmetricAlgorithm + { + protected DES() { } + public override byte[] Key { get { throw null; } set { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static new System.Security.Cryptography.DES Create() { throw null; } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] + public static new System.Security.Cryptography.DES? Create(string algName) { throw null; } + public static bool IsSemiWeakKey(byte[] rgbKey) { throw null; } + public static bool IsWeakKey(byte[] rgbKey) { throw null; } + } + public abstract partial class DSA : System.Security.Cryptography.AsymmetricAlgorithm + { + protected DSA() { } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] + public static new System.Security.Cryptography.DSA Create() { throw null; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] + public static System.Security.Cryptography.DSA Create(int keySizeInBits) { throw null; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] + public static System.Security.Cryptography.DSA Create(System.Security.Cryptography.DSAParameters parameters) { throw null; } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] + public static new System.Security.Cryptography.DSA? Create(string algName) { throw null; } + public abstract byte[] CreateSignature(byte[] rgbHash); + public byte[] CreateSignature(byte[] rgbHash, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + protected virtual byte[] CreateSignatureCore(System.ReadOnlySpan hash, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + public abstract System.Security.Cryptography.DSAParameters ExportParameters(bool includePrivateParameters); + public override void FromXmlString(string xmlString) { } + public int GetMaxSignatureSize(System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + protected virtual byte[] HashData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + protected virtual byte[] HashData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + public override void ImportEncryptedPkcs8PrivateKey(System.ReadOnlySpan passwordBytes, System.ReadOnlySpan source, out int bytesRead) { throw null; } + public override void ImportEncryptedPkcs8PrivateKey(System.ReadOnlySpan password, System.ReadOnlySpan source, out int bytesRead) { throw null; } + public override void ImportFromEncryptedPem(System.ReadOnlySpan input, System.ReadOnlySpan passwordBytes) { } + public override void ImportFromEncryptedPem(System.ReadOnlySpan input, System.ReadOnlySpan password) { } + public override void ImportFromPem(System.ReadOnlySpan input) { } + public abstract void ImportParameters(System.Security.Cryptography.DSAParameters parameters); + public override void ImportPkcs8PrivateKey(System.ReadOnlySpan source, out int bytesRead) { throw null; } + public override void ImportSubjectPublicKeyInfo(System.ReadOnlySpan source, out int bytesRead) { throw null; } + public virtual byte[] SignData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + public byte[] SignData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + public byte[] SignData(byte[] data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + public byte[] SignData(byte[] data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + public virtual byte[] SignData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + public byte[] SignData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + protected virtual byte[] SignDataCore(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + protected virtual byte[] SignDataCore(System.ReadOnlySpan data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + public override string ToXmlString(bool includePrivateParameters) { throw null; } + public virtual bool TryCreateSignature(System.ReadOnlySpan hash, System.Span destination, out int bytesWritten) { throw null; } + public bool TryCreateSignature(System.ReadOnlySpan hash, System.Span destination, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw null; } + protected virtual bool TryCreateSignatureCore(System.ReadOnlySpan hash, System.Span destination, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw null; } + public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span destination, out int bytesWritten) { throw null; } + public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span destination, out int bytesWritten) { throw null; } + public override bool TryExportPkcs8PrivateKey(System.Span destination, out int bytesWritten) { throw null; } + public override bool TryExportSubjectPublicKeyInfo(System.Span destination, out int bytesWritten) { throw null; } + protected virtual bool TryHashData(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out int bytesWritten) { throw null; } + public virtual bool TrySignData(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out int bytesWritten) { throw null; } + public bool TrySignData(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw null; } + protected virtual bool TrySignDataCore(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw null; } + public bool VerifyData(byte[] data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + public bool VerifyData(byte[] data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + public virtual bool VerifyData(byte[] data, int offset, int count, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + public bool VerifyData(byte[] data, int offset, int count, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + public virtual bool VerifyData(System.IO.Stream data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + public bool VerifyData(System.IO.Stream data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + public virtual bool VerifyData(System.ReadOnlySpan data, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + public bool VerifyData(System.ReadOnlySpan data, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + protected virtual bool VerifyDataCore(System.IO.Stream data, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + protected virtual bool VerifyDataCore(System.ReadOnlySpan data, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + public abstract bool VerifySignature(byte[] rgbHash, byte[] rgbSignature); + public bool VerifySignature(byte[] rgbHash, byte[] rgbSignature, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + public virtual bool VerifySignature(System.ReadOnlySpan hash, System.ReadOnlySpan signature) { throw null; } + public bool VerifySignature(System.ReadOnlySpan hash, System.ReadOnlySpan signature, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + protected virtual bool VerifySignatureCore(System.ReadOnlySpan hash, System.ReadOnlySpan signature, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + } + public partial struct DSAParameters + { + public int Counter; + public byte[]? G; + public byte[]? J; + public byte[]? P; + public byte[]? Q; + public byte[]? Seed; + public byte[]? X; + public byte[]? Y; + } + public partial class DSASignatureDeformatter : System.Security.Cryptography.AsymmetricSignatureDeformatter + { + public DSASignatureDeformatter() { } + public DSASignatureDeformatter(System.Security.Cryptography.AsymmetricAlgorithm key) { } + public override void SetHashAlgorithm(string strName) { } + public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } + public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature) { throw null; } + } + public enum DSASignatureFormat + { + IeeeP1363FixedFieldConcatenation = 0, + Rfc3279DerSequence = 1, + } + public partial class DSASignatureFormatter : System.Security.Cryptography.AsymmetricSignatureFormatter + { + public DSASignatureFormatter() { } + public DSASignatureFormatter(System.Security.Cryptography.AsymmetricAlgorithm key) { } + public override byte[] CreateSignature(byte[] rgbHash) { throw null; } + public override void SetHashAlgorithm(string strName) { } + public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } + } + public abstract partial class ECAlgorithm : System.Security.Cryptography.AsymmetricAlgorithm + { + protected ECAlgorithm() { } + public virtual byte[] ExportECPrivateKey() { throw null; } + public string ExportECPrivateKeyPem() { throw null; } + public virtual System.Security.Cryptography.ECParameters ExportExplicitParameters(bool includePrivateParameters) { throw null; } + public virtual System.Security.Cryptography.ECParameters ExportParameters(bool includePrivateParameters) { throw null; } + public virtual void GenerateKey(System.Security.Cryptography.ECCurve curve) { } + public virtual void ImportECPrivateKey(System.ReadOnlySpan source, out int bytesRead) { throw null; } + public override void ImportEncryptedPkcs8PrivateKey(System.ReadOnlySpan passwordBytes, System.ReadOnlySpan source, out int bytesRead) { throw null; } + public override void ImportEncryptedPkcs8PrivateKey(System.ReadOnlySpan password, System.ReadOnlySpan source, out int bytesRead) { throw null; } + public override void ImportFromEncryptedPem(System.ReadOnlySpan input, System.ReadOnlySpan passwordBytes) { } + public override void ImportFromEncryptedPem(System.ReadOnlySpan input, System.ReadOnlySpan password) { } + public override void ImportFromPem(System.ReadOnlySpan input) { } + public virtual void ImportParameters(System.Security.Cryptography.ECParameters parameters) { } + public override void ImportPkcs8PrivateKey(System.ReadOnlySpan source, out int bytesRead) { throw null; } + public override void ImportSubjectPublicKeyInfo(System.ReadOnlySpan source, out int bytesRead) { throw null; } + public virtual bool TryExportECPrivateKey(System.Span destination, out int bytesWritten) { throw null; } + public bool TryExportECPrivateKeyPem(System.Span destination, out int charsWritten) { throw null; } + public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span destination, out int bytesWritten) { throw null; } + public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span destination, out int bytesWritten) { throw null; } + public override bool TryExportPkcs8PrivateKey(System.Span destination, out int bytesWritten) { throw null; } + public override bool TryExportSubjectPublicKeyInfo(System.Span destination, out int bytesWritten) { throw null; } + } + public partial struct ECCurve + { + private object _dummy; + private int _dummyPrimitive; + public byte[]? A; + public byte[]? B; + public byte[]? Cofactor; + public System.Security.Cryptography.ECCurve.ECCurveType CurveType; + public System.Security.Cryptography.ECPoint G; + public System.Security.Cryptography.HashAlgorithmName? Hash; + public byte[]? Order; + public byte[]? Polynomial; + public byte[]? Prime; + public byte[]? Seed; + public bool IsCharacteristic2 { get { throw null; } } + public bool IsExplicit { get { throw null; } } + public bool IsNamed { get { throw null; } } + public bool IsPrime { get { throw null; } } + public System.Security.Cryptography.Oid Oid { get { throw null; } } + public static System.Security.Cryptography.ECCurve CreateFromFriendlyName(string oidFriendlyName) { throw null; } + public static System.Security.Cryptography.ECCurve CreateFromOid(System.Security.Cryptography.Oid curveOid) { throw null; } + public static System.Security.Cryptography.ECCurve CreateFromValue(string oidValue) { throw null; } + public void Validate() { } + public enum ECCurveType + { + Implicit = 0, + PrimeShortWeierstrass = 1, + PrimeTwistedEdwards = 2, + PrimeMontgomery = 3, + Characteristic2 = 4, + Named = 5, + } + public static partial class NamedCurves + { + public static System.Security.Cryptography.ECCurve brainpoolP160r1 { get { throw null; } } + public static System.Security.Cryptography.ECCurve brainpoolP160t1 { get { throw null; } } + public static System.Security.Cryptography.ECCurve brainpoolP192r1 { get { throw null; } } + public static System.Security.Cryptography.ECCurve brainpoolP192t1 { get { throw null; } } + public static System.Security.Cryptography.ECCurve brainpoolP224r1 { get { throw null; } } + public static System.Security.Cryptography.ECCurve brainpoolP224t1 { get { throw null; } } + public static System.Security.Cryptography.ECCurve brainpoolP256r1 { get { throw null; } } + public static System.Security.Cryptography.ECCurve brainpoolP256t1 { get { throw null; } } + public static System.Security.Cryptography.ECCurve brainpoolP320r1 { get { throw null; } } + public static System.Security.Cryptography.ECCurve brainpoolP320t1 { get { throw null; } } + public static System.Security.Cryptography.ECCurve brainpoolP384r1 { get { throw null; } } + public static System.Security.Cryptography.ECCurve brainpoolP384t1 { get { throw null; } } + public static System.Security.Cryptography.ECCurve brainpoolP512r1 { get { throw null; } } + public static System.Security.Cryptography.ECCurve brainpoolP512t1 { get { throw null; } } + public static System.Security.Cryptography.ECCurve nistP256 { get { throw null; } } + public static System.Security.Cryptography.ECCurve nistP384 { get { throw null; } } + public static System.Security.Cryptography.ECCurve nistP521 { get { throw null; } } + } + } + public abstract partial class ECDiffieHellman : System.Security.Cryptography.ECAlgorithm + { + protected ECDiffieHellman() { } + public override string KeyExchangeAlgorithm { get { throw null; } } + public abstract System.Security.Cryptography.ECDiffieHellmanPublicKey PublicKey { get; } + public override string? SignatureAlgorithm { get { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static new System.Security.Cryptography.ECDiffieHellman Create() { throw null; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static System.Security.Cryptography.ECDiffieHellman Create(System.Security.Cryptography.ECCurve curve) { throw null; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static System.Security.Cryptography.ECDiffieHellman Create(System.Security.Cryptography.ECParameters parameters) { throw null; } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] + public static new System.Security.Cryptography.ECDiffieHellman? Create(string algorithm) { throw null; } + public byte[] DeriveKeyFromHash(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + public virtual byte[] DeriveKeyFromHash(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[]? secretPrepend, byte[]? secretAppend) { throw null; } + public byte[] DeriveKeyFromHmac(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[]? hmacKey) { throw null; } + public virtual byte[] DeriveKeyFromHmac(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[]? hmacKey, byte[]? secretPrepend, byte[]? secretAppend) { throw null; } + public virtual byte[] DeriveKeyMaterial(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey) { throw null; } + public virtual byte[] DeriveKeyTls(System.Security.Cryptography.ECDiffieHellmanPublicKey otherPartyPublicKey, byte[] prfLabel, byte[] prfSeed) { throw null; } + public override void FromXmlString(string xmlString) { } + public override string ToXmlString(bool includePrivateParameters) { throw null; } + } + public abstract partial class ECDiffieHellmanPublicKey : System.IDisposable + { + protected ECDiffieHellmanPublicKey() { } + protected ECDiffieHellmanPublicKey(byte[] keyBlob) { } + public void Dispose() { } + protected virtual void Dispose(bool disposing) { } + public virtual System.Security.Cryptography.ECParameters ExportExplicitParameters() { throw null; } + public virtual System.Security.Cryptography.ECParameters ExportParameters() { throw null; } + public virtual byte[] ExportSubjectPublicKeyInfo() { throw null; } + public virtual byte[] ToByteArray() { throw null; } + public virtual string ToXmlString() { throw null; } + public virtual bool TryExportSubjectPublicKeyInfo(System.Span destination, out int bytesWritten) { throw null; } + } + public abstract partial class ECDsa : System.Security.Cryptography.ECAlgorithm + { + protected ECDsa() { } + public override string? KeyExchangeAlgorithm { get { throw null; } } + public override string SignatureAlgorithm { get { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static new System.Security.Cryptography.ECDsa Create() { throw null; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static System.Security.Cryptography.ECDsa Create(System.Security.Cryptography.ECCurve curve) { throw null; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static System.Security.Cryptography.ECDsa Create(System.Security.Cryptography.ECParameters parameters) { throw null; } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] + public static new System.Security.Cryptography.ECDsa? Create(string algorithm) { throw null; } + public override void FromXmlString(string xmlString) { } + public int GetMaxSignatureSize(System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + protected virtual byte[] HashData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + protected virtual byte[] HashData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + public virtual byte[] SignData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + public byte[] SignData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + public virtual byte[] SignData(byte[] data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + public byte[] SignData(byte[] data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + public virtual byte[] SignData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + public byte[] SignData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + protected virtual byte[] SignDataCore(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + protected virtual byte[] SignDataCore(System.ReadOnlySpan data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + public abstract byte[] SignHash(byte[] hash); + public byte[] SignHash(byte[] hash, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + protected virtual byte[] SignHashCore(System.ReadOnlySpan hash, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + public override string ToXmlString(bool includePrivateParameters) { throw null; } + protected virtual bool TryHashData(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out int bytesWritten) { throw null; } + public virtual bool TrySignData(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out int bytesWritten) { throw null; } + public bool TrySignData(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw null; } + protected virtual bool TrySignDataCore(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw null; } + public virtual bool TrySignHash(System.ReadOnlySpan hash, System.Span destination, out int bytesWritten) { throw null; } + public bool TrySignHash(System.ReadOnlySpan hash, System.Span destination, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw null; } + protected virtual bool TrySignHashCore(System.ReadOnlySpan hash, System.Span destination, System.Security.Cryptography.DSASignatureFormat signatureFormat, out int bytesWritten) { throw null; } + public bool VerifyData(byte[] data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + public bool VerifyData(byte[] data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + public virtual bool VerifyData(byte[] data, int offset, int count, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + public bool VerifyData(byte[] data, int offset, int count, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + public bool VerifyData(System.IO.Stream data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + public bool VerifyData(System.IO.Stream data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + public virtual bool VerifyData(System.ReadOnlySpan data, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + public bool VerifyData(System.ReadOnlySpan data, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + protected virtual bool VerifyDataCore(System.IO.Stream data, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + protected virtual bool VerifyDataCore(System.ReadOnlySpan data, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + public abstract bool VerifyHash(byte[] hash, byte[] signature); + public bool VerifyHash(byte[] hash, byte[] signature, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + public virtual bool VerifyHash(System.ReadOnlySpan hash, System.ReadOnlySpan signature) { throw null; } + public bool VerifyHash(System.ReadOnlySpan hash, System.ReadOnlySpan signature, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + protected virtual bool VerifyHashCore(System.ReadOnlySpan hash, System.ReadOnlySpan signature, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } + } + public partial struct ECParameters + { + public System.Security.Cryptography.ECCurve Curve; + public byte[]? D; + public System.Security.Cryptography.ECPoint Q; + public void Validate() { } + } + public partial struct ECPoint + { + public byte[]? X; + public byte[]? Y; + } + public partial class FromBase64Transform : System.IDisposable, System.Security.Cryptography.ICryptoTransform + { + public FromBase64Transform() { } + public FromBase64Transform(System.Security.Cryptography.FromBase64TransformMode whitespaces) { } + public virtual bool CanReuseTransform { get { throw null; } } + public bool CanTransformMultipleBlocks { get { throw null; } } + public int InputBlockSize { get { throw null; } } + public int OutputBlockSize { get { throw null; } } + public void Clear() { } + public void Dispose() { } + protected virtual void Dispose(bool disposing) { } + ~FromBase64Transform() { } + public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset) { throw null; } + public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount) { throw null; } + } + public enum FromBase64TransformMode + { + IgnoreWhiteSpaces = 0, + DoNotIgnoreWhiteSpaces = 1, + } public abstract partial class HashAlgorithm : System.IDisposable, System.Security.Cryptography.ICryptoTransform { protected int HashSizeValue; @@ -163,6 +642,16 @@ protected virtual void HashCore(System.ReadOnlySpan source) { } public override string ToString() { throw null; } public static bool TryFromOid(string oidValue, out System.Security.Cryptography.HashAlgorithmName value) { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static partial class HKDF + { + public static byte[] DeriveKey(System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, byte[] ikm, int outputLength, byte[]? salt = null, byte[]? info = null) { throw null; } + public static void DeriveKey(System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, System.ReadOnlySpan ikm, System.Span output, System.ReadOnlySpan salt, System.ReadOnlySpan info) { } + public static byte[] Expand(System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, byte[] prk, int outputLength, byte[]? info = null) { throw null; } + public static void Expand(System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, System.ReadOnlySpan prk, System.Span output, System.ReadOnlySpan info) { } + public static byte[] Extract(System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, byte[] ikm, byte[]? salt = null) { throw null; } + public static int Extract(System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, System.ReadOnlySpan ikm, System.ReadOnlySpan salt, System.Span prk) { throw null; } + } public abstract partial class HMAC : System.Security.Cryptography.KeyedHashAlgorithm { protected HMAC() { } @@ -180,6 +669,98 @@ protected override void HashCore(System.ReadOnlySpan source) { } public override void Initialize() { } protected override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public partial class HMACMD5 : System.Security.Cryptography.HMAC + { + public HMACMD5() { } + public HMACMD5(byte[] key) { } + public override byte[] Key { get { throw null; } set { } } + protected override void Dispose(bool disposing) { } + protected override void HashCore(byte[] rgb, int ib, int cb) { } + protected override void HashCore(System.ReadOnlySpan source) { } + public static byte[] HashData(byte[] key, byte[] source) { throw null; } + public static byte[] HashData(System.ReadOnlySpan key, System.ReadOnlySpan source) { throw null; } + public static int HashData(System.ReadOnlySpan key, System.ReadOnlySpan source, System.Span destination) { throw null; } + protected override byte[] HashFinal() { throw null; } + public override void Initialize() { } + public static bool TryHashData(System.ReadOnlySpan key, System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } + protected override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } + } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public partial class HMACSHA1 : System.Security.Cryptography.HMAC + { + public HMACSHA1() { } + public HMACSHA1(byte[] key) { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("HMACSHA1 always uses the algorithm implementation provided by the platform. Use a constructor without the useManagedSha1 parameter.", DiagnosticId = "SYSLIB0030", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] + public HMACSHA1(byte[] key, bool useManagedSha1) { } + public override byte[] Key { get { throw null; } set { } } + protected override void Dispose(bool disposing) { } + protected override void HashCore(byte[] rgb, int ib, int cb) { } + protected override void HashCore(System.ReadOnlySpan source) { } + public static byte[] HashData(byte[] key, byte[] source) { throw null; } + public static byte[] HashData(System.ReadOnlySpan key, System.ReadOnlySpan source) { throw null; } + public static int HashData(System.ReadOnlySpan key, System.ReadOnlySpan source, System.Span destination) { throw null; } + protected override byte[] HashFinal() { throw null; } + public override void Initialize() { } + public static bool TryHashData(System.ReadOnlySpan key, System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } + protected override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } + } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public partial class HMACSHA256 : System.Security.Cryptography.HMAC + { + public HMACSHA256() { } + public HMACSHA256(byte[] key) { } + public override byte[] Key { get { throw null; } set { } } + protected override void Dispose(bool disposing) { } + protected override void HashCore(byte[] rgb, int ib, int cb) { } + protected override void HashCore(System.ReadOnlySpan source) { } + public static byte[] HashData(byte[] key, byte[] source) { throw null; } + public static byte[] HashData(System.ReadOnlySpan key, System.ReadOnlySpan source) { throw null; } + public static int HashData(System.ReadOnlySpan key, System.ReadOnlySpan source, System.Span destination) { throw null; } + protected override byte[] HashFinal() { throw null; } + public override void Initialize() { } + public static bool TryHashData(System.ReadOnlySpan key, System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } + protected override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } + } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public partial class HMACSHA384 : System.Security.Cryptography.HMAC + { + public HMACSHA384() { } + public HMACSHA384(byte[] key) { } + public override byte[] Key { get { throw null; } set { } } + [System.ObsoleteAttribute("ProduceLegacyHmacValues is obsolete. Producing legacy HMAC values is not supported.", DiagnosticId = "SYSLIB0029", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] + public bool ProduceLegacyHmacValues { get { throw null; } set { } } + protected override void Dispose(bool disposing) { } + protected override void HashCore(byte[] rgb, int ib, int cb) { } + protected override void HashCore(System.ReadOnlySpan source) { } + public static byte[] HashData(byte[] key, byte[] source) { throw null; } + public static byte[] HashData(System.ReadOnlySpan key, System.ReadOnlySpan source) { throw null; } + public static int HashData(System.ReadOnlySpan key, System.ReadOnlySpan source, System.Span destination) { throw null; } + protected override byte[] HashFinal() { throw null; } + public override void Initialize() { } + public static bool TryHashData(System.ReadOnlySpan key, System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } + protected override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } + } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public partial class HMACSHA512 : System.Security.Cryptography.HMAC + { + public HMACSHA512() { } + public HMACSHA512(byte[] key) { } + public override byte[] Key { get { throw null; } set { } } + [System.ObsoleteAttribute("ProduceLegacyHmacValues is obsolete. Producing legacy HMAC values is not supported.", DiagnosticId = "SYSLIB0029", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] + public bool ProduceLegacyHmacValues { get { throw null; } set { } } + protected override void Dispose(bool disposing) { } + protected override void HashCore(byte[] rgb, int ib, int cb) { } + protected override void HashCore(System.ReadOnlySpan source) { } + public static byte[] HashData(byte[] key, byte[] source) { throw null; } + public static byte[] HashData(System.ReadOnlySpan key, System.ReadOnlySpan source) { throw null; } + public static int HashData(System.ReadOnlySpan key, System.ReadOnlySpan source, System.Span destination) { throw null; } + protected override byte[] HashFinal() { throw null; } + public override void Initialize() { } + public static bool TryHashData(System.ReadOnlySpan key, System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } + protected override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } + } public partial interface ICryptoTransform : System.IDisposable { bool CanReuseTransform { get; } @@ -189,6 +770,27 @@ public partial interface ICryptoTransform : System.IDisposable int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset); byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount); } + public sealed partial class IncrementalHash : System.IDisposable + { + internal IncrementalHash() { } + public System.Security.Cryptography.HashAlgorithmName AlgorithmName { get { throw null; } } + public int HashLengthInBytes { get { throw null; } } + public void AppendData(byte[] data) { } + public void AppendData(byte[] data, int offset, int count) { } + public void AppendData(System.ReadOnlySpan data) { } + public static System.Security.Cryptography.IncrementalHash CreateHash(System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static System.Security.Cryptography.IncrementalHash CreateHMAC(System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[] key) { throw null; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static System.Security.Cryptography.IncrementalHash CreateHMAC(System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.ReadOnlySpan key) { throw null; } + public void Dispose() { } + public byte[] GetCurrentHash() { throw null; } + public int GetCurrentHash(System.Span destination) { throw null; } + public byte[] GetHashAndReset() { throw null; } + public int GetHashAndReset(System.Span destination) { throw null; } + public bool TryGetCurrentHash(System.Span destination, out int bytesWritten) { throw null; } + public bool TryGetHashAndReset(System.Span destination, out int bytesWritten) { throw null; } + } public abstract partial class KeyedHashAlgorithm : System.Security.Cryptography.HashAlgorithm { protected byte[] KeyValue; @@ -207,6 +809,70 @@ public KeySizes(int minSize, int maxSize, int skipSize) { } public int MinSize { get { throw null; } } public int SkipSize { get { throw null; } } } + public abstract partial class MaskGenerationMethod + { + protected MaskGenerationMethod() { } + public abstract byte[] GenerateMask(byte[] rgbSeed, int cbReturn); + } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public abstract partial class MD5 : System.Security.Cryptography.HashAlgorithm + { + protected MD5() { } + public static new System.Security.Cryptography.MD5 Create() { throw null; } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] + public static new System.Security.Cryptography.MD5? Create(string algName) { throw null; } + public static byte[] HashData(byte[] source) { throw null; } + public static byte[] HashData(System.ReadOnlySpan source) { throw null; } + public static int HashData(System.ReadOnlySpan source, System.Span destination) { throw null; } + public static bool TryHashData(System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } + } + public sealed partial class Oid + { + public Oid() { } + public Oid(System.Security.Cryptography.Oid oid) { } + public Oid(string oid) { } + public Oid(string? value, string? friendlyName) { } + public string? FriendlyName { get { throw null; } set { } } + public string? Value { get { throw null; } set { } } + public static System.Security.Cryptography.Oid FromFriendlyName(string friendlyName, System.Security.Cryptography.OidGroup group) { throw null; } + public static System.Security.Cryptography.Oid FromOidValue(string oidValue, System.Security.Cryptography.OidGroup group) { throw null; } + } + public sealed partial class OidCollection : System.Collections.ICollection, System.Collections.IEnumerable + { + public OidCollection() { } + public int Count { get { throw null; } } + public bool IsSynchronized { get { throw null; } } + public System.Security.Cryptography.Oid this[int index] { get { throw null; } } + public System.Security.Cryptography.Oid? this[string oid] { get { throw null; } } + public object SyncRoot { get { throw null; } } + public int Add(System.Security.Cryptography.Oid oid) { throw null; } + public void CopyTo(System.Security.Cryptography.Oid[] array, int index) { } + public System.Security.Cryptography.OidEnumerator GetEnumerator() { throw null; } + void System.Collections.ICollection.CopyTo(System.Array array, int index) { } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public sealed partial class OidEnumerator : System.Collections.IEnumerator + { + internal OidEnumerator() { } + public System.Security.Cryptography.Oid Current { get { throw null; } } + object System.Collections.IEnumerator.Current { get { throw null; } } + public bool MoveNext() { throw null; } + public void Reset() { } + } + public enum OidGroup + { + All = 0, + HashAlgorithm = 1, + EncryptionAlgorithm = 2, + PublicKeyAlgorithm = 3, + SignatureAlgorithm = 4, + Attribute = 5, + ExtensionOrAttribute = 6, + EnhancedKeyUsage = 7, + Policy = 8, + Template = 9, + KeyDerivationFunction = 10, + } public enum PaddingMode { None = 1, @@ -230,6 +896,393 @@ public PbeParameters(System.Security.Cryptography.PbeEncryptionAlgorithm encrypt public System.Security.Cryptography.HashAlgorithmName HashAlgorithm { get { throw null; } } public int IterationCount { get { throw null; } } } + public static partial class PemEncoding + { + public static System.Security.Cryptography.PemFields Find(System.ReadOnlySpan pemData) { throw null; } + public static int GetEncodedSize(int labelLength, int dataLength) { throw null; } + public static bool TryFind(System.ReadOnlySpan pemData, out System.Security.Cryptography.PemFields fields) { throw null; } + public static bool TryWrite(System.ReadOnlySpan label, System.ReadOnlySpan data, System.Span destination, out int charsWritten) { throw null; } + public static char[] Write(System.ReadOnlySpan label, System.ReadOnlySpan data) { throw null; } + } + public readonly partial struct PemFields + { + private readonly int _dummyPrimitive; + public System.Range Base64Data { get { throw null; } } + public int DecodedDataLength { get { throw null; } } + public System.Range Label { get { throw null; } } + public System.Range Location { get { throw null; } } + } + public partial class PKCS1MaskGenerationMethod : System.Security.Cryptography.MaskGenerationMethod + { + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("PKCS1MaskGenerationMethod is not trim compatible because the algorithm implementation referenced by HashName might be removed.")] + public PKCS1MaskGenerationMethod() { } + public string HashName { get { throw null; } set { } } + public override byte[] GenerateMask(byte[] rgbSeed, int cbReturn) { throw null; } + } + public abstract partial class RandomNumberGenerator : System.IDisposable + { + protected RandomNumberGenerator() { } + public static System.Security.Cryptography.RandomNumberGenerator Create() { throw null; } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] + public static System.Security.Cryptography.RandomNumberGenerator? Create(string rngName) { throw null; } + public void Dispose() { } + protected virtual void Dispose(bool disposing) { } + public static void Fill(System.Span data) { } + public abstract void GetBytes(byte[] data); + public virtual void GetBytes(byte[] data, int offset, int count) { } + public static byte[] GetBytes(int count) { throw null; } + public virtual void GetBytes(System.Span data) { } + public static int GetInt32(int toExclusive) { throw null; } + public static int GetInt32(int fromInclusive, int toExclusive) { throw null; } + public virtual void GetNonZeroBytes(byte[] data) { } + public virtual void GetNonZeroBytes(System.Span data) { } + } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public abstract partial class RC2 : System.Security.Cryptography.SymmetricAlgorithm + { + protected int EffectiveKeySizeValue; + protected RC2() { } + public virtual int EffectiveKeySize { get { throw null; } set { } } + public override int KeySize { get { throw null; } set { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static new System.Security.Cryptography.RC2 Create() { throw null; } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] + public static new System.Security.Cryptography.RC2? Create(string AlgName) { throw null; } + } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public partial class Rfc2898DeriveBytes : System.Security.Cryptography.DeriveBytes + { + public Rfc2898DeriveBytes(byte[] password, byte[] salt, int iterations) { } + public Rfc2898DeriveBytes(byte[] password, byte[] salt, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { } + public Rfc2898DeriveBytes(string password, byte[] salt) { } + public Rfc2898DeriveBytes(string password, byte[] salt, int iterations) { } + public Rfc2898DeriveBytes(string password, byte[] salt, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { } + public Rfc2898DeriveBytes(string password, int saltSize) { } + public Rfc2898DeriveBytes(string password, int saltSize, int iterations) { } + public Rfc2898DeriveBytes(string password, int saltSize, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { } + public System.Security.Cryptography.HashAlgorithmName HashAlgorithm { get { throw null; } } + public int IterationCount { get { throw null; } set { } } + public byte[] Salt { get { throw null; } set { } } + [System.ObsoleteAttribute("Rfc2898DeriveBytes.CryptDeriveKey is obsolete and is not supported. Use PasswordDeriveBytes.CryptDeriveKey instead.", DiagnosticId = "SYSLIB0033", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] + public byte[] CryptDeriveKey(string algname, string alghashname, int keySize, byte[] rgbIV) { throw null; } + protected override void Dispose(bool disposing) { } + public override byte[] GetBytes(int cb) { throw null; } + public static byte[] Pbkdf2(byte[] password, byte[] salt, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, int outputLength) { throw null; } + public static byte[] Pbkdf2(System.ReadOnlySpan password, System.ReadOnlySpan salt, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, int outputLength) { throw null; } + public static void Pbkdf2(System.ReadOnlySpan password, System.ReadOnlySpan salt, System.Span destination, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { } + public static byte[] Pbkdf2(System.ReadOnlySpan password, System.ReadOnlySpan salt, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, int outputLength) { throw null; } + public static void Pbkdf2(System.ReadOnlySpan password, System.ReadOnlySpan salt, System.Span destination, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { } + public static byte[] Pbkdf2(string password, byte[] salt, int iterations, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, int outputLength) { throw null; } + public override void Reset() { } + } + [System.ObsoleteAttribute("The Rijndael and RijndaelManaged types are obsolete. Use Aes instead.", DiagnosticId = "SYSLIB0022", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public abstract partial class Rijndael : System.Security.Cryptography.SymmetricAlgorithm + { + protected Rijndael() { } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static new System.Security.Cryptography.Rijndael Create() { throw null; } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] + public static new System.Security.Cryptography.Rijndael? Create(string algName) { throw null; } + } + [System.ObsoleteAttribute("The Rijndael and RijndaelManaged types are obsolete. Use Aes instead.", DiagnosticId = "SYSLIB0022", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public sealed partial class RijndaelManaged : System.Security.Cryptography.Rijndael + { + public RijndaelManaged() { } + public override int BlockSize { get { throw null; } set { } } + public override int FeedbackSize { get { throw null; } set { } } + public override byte[] IV { get { throw null; } set { } } + public override byte[] Key { get { throw null; } set { } } + public override int KeySize { get { throw null; } set { } } + public override System.Security.Cryptography.KeySizes[] LegalKeySizes { get { throw null; } } + public override System.Security.Cryptography.CipherMode Mode { get { throw null; } set { } } + public override System.Security.Cryptography.PaddingMode Padding { get { throw null; } set { } } + public override System.Security.Cryptography.ICryptoTransform CreateDecryptor() { throw null; } + public override System.Security.Cryptography.ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[]? rgbIV) { throw null; } + public override System.Security.Cryptography.ICryptoTransform CreateEncryptor() { throw null; } + public override System.Security.Cryptography.ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[]? rgbIV) { throw null; } + protected override void Dispose(bool disposing) { } + public override void GenerateIV() { } + public override void GenerateKey() { } + } + public abstract partial class RSA : System.Security.Cryptography.AsymmetricAlgorithm + { + protected RSA() { } + public override string? KeyExchangeAlgorithm { get { throw null; } } + public override string SignatureAlgorithm { get { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static new System.Security.Cryptography.RSA Create() { throw null; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static System.Security.Cryptography.RSA Create(int keySizeInBits) { throw null; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static System.Security.Cryptography.RSA Create(System.Security.Cryptography.RSAParameters parameters) { throw null; } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] + public static new System.Security.Cryptography.RSA? Create(string algName) { throw null; } + public virtual byte[] Decrypt(byte[] data, System.Security.Cryptography.RSAEncryptionPadding padding) { throw null; } + public virtual byte[] DecryptValue(byte[] rgb) { throw null; } + public virtual byte[] Encrypt(byte[] data, System.Security.Cryptography.RSAEncryptionPadding padding) { throw null; } + public virtual byte[] EncryptValue(byte[] rgb) { throw null; } + public abstract System.Security.Cryptography.RSAParameters ExportParameters(bool includePrivateParameters); + public virtual byte[] ExportRSAPrivateKey() { throw null; } + public string ExportRSAPrivateKeyPem() { throw null; } + public virtual byte[] ExportRSAPublicKey() { throw null; } + public string ExportRSAPublicKeyPem() { throw null; } + public override void FromXmlString(string xmlString) { } + protected virtual byte[] HashData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + protected virtual byte[] HashData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + public override void ImportEncryptedPkcs8PrivateKey(System.ReadOnlySpan passwordBytes, System.ReadOnlySpan source, out int bytesRead) { throw null; } + public override void ImportEncryptedPkcs8PrivateKey(System.ReadOnlySpan password, System.ReadOnlySpan source, out int bytesRead) { throw null; } + public override void ImportFromEncryptedPem(System.ReadOnlySpan input, System.ReadOnlySpan passwordBytes) { } + public override void ImportFromEncryptedPem(System.ReadOnlySpan input, System.ReadOnlySpan password) { } + public override void ImportFromPem(System.ReadOnlySpan input) { } + public abstract void ImportParameters(System.Security.Cryptography.RSAParameters parameters); + public override void ImportPkcs8PrivateKey(System.ReadOnlySpan source, out int bytesRead) { throw null; } + public virtual void ImportRSAPrivateKey(System.ReadOnlySpan source, out int bytesRead) { throw null; } + public virtual void ImportRSAPublicKey(System.ReadOnlySpan source, out int bytesRead) { throw null; } + public override void ImportSubjectPublicKeyInfo(System.ReadOnlySpan source, out int bytesRead) { throw null; } + public virtual byte[] SignData(byte[] data, int offset, int count, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } + public byte[] SignData(byte[] data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } + public virtual byte[] SignData(System.IO.Stream data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } + public virtual byte[] SignHash(byte[] hash, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } + public override string ToXmlString(bool includePrivateParameters) { throw null; } + public virtual bool TryDecrypt(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.RSAEncryptionPadding padding, out int bytesWritten) { throw null; } + public virtual bool TryEncrypt(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.RSAEncryptionPadding padding, out int bytesWritten) { throw null; } + public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters, System.Span destination, out int bytesWritten) { throw null; } + public override bool TryExportEncryptedPkcs8PrivateKey(System.ReadOnlySpan password, System.Security.Cryptography.PbeParameters pbeParameters, System.Span destination, out int bytesWritten) { throw null; } + public override bool TryExportPkcs8PrivateKey(System.Span destination, out int bytesWritten) { throw null; } + public virtual bool TryExportRSAPrivateKey(System.Span destination, out int bytesWritten) { throw null; } + public bool TryExportRSAPrivateKeyPem(System.Span destination, out int charsWritten) { throw null; } + public virtual bool TryExportRSAPublicKey(System.Span destination, out int bytesWritten) { throw null; } + public bool TryExportRSAPublicKeyPem(System.Span destination, out int charsWritten) { throw null; } + public override bool TryExportSubjectPublicKeyInfo(System.Span destination, out int bytesWritten) { throw null; } + protected virtual bool TryHashData(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out int bytesWritten) { throw null; } + public virtual bool TrySignData(System.ReadOnlySpan data, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding, out int bytesWritten) { throw null; } + public virtual bool TrySignHash(System.ReadOnlySpan hash, System.Span destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding, out int bytesWritten) { throw null; } + public bool VerifyData(byte[] data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } + public virtual bool VerifyData(byte[] data, int offset, int count, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } + public bool VerifyData(System.IO.Stream data, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } + public virtual bool VerifyData(System.ReadOnlySpan data, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } + public virtual bool VerifyHash(byte[] hash, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } + public virtual bool VerifyHash(System.ReadOnlySpan hash, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } + } + public sealed partial class RSAEncryptionPadding : System.IEquatable + { + internal RSAEncryptionPadding() { } + public System.Security.Cryptography.RSAEncryptionPaddingMode Mode { get { throw null; } } + public System.Security.Cryptography.HashAlgorithmName OaepHashAlgorithm { get { throw null; } } + public static System.Security.Cryptography.RSAEncryptionPadding OaepSHA1 { get { throw null; } } + public static System.Security.Cryptography.RSAEncryptionPadding OaepSHA256 { get { throw null; } } + public static System.Security.Cryptography.RSAEncryptionPadding OaepSHA384 { get { throw null; } } + public static System.Security.Cryptography.RSAEncryptionPadding OaepSHA512 { get { throw null; } } + public static System.Security.Cryptography.RSAEncryptionPadding Pkcs1 { get { throw null; } } + public static System.Security.Cryptography.RSAEncryptionPadding CreateOaep(System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Security.Cryptography.RSAEncryptionPadding? other) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(System.Security.Cryptography.RSAEncryptionPadding? left, System.Security.Cryptography.RSAEncryptionPadding? right) { throw null; } + public static bool operator !=(System.Security.Cryptography.RSAEncryptionPadding? left, System.Security.Cryptography.RSAEncryptionPadding? right) { throw null; } + public override string ToString() { throw null; } + } + public enum RSAEncryptionPaddingMode + { + Pkcs1 = 0, + Oaep = 1, + } + public partial class RSAOAEPKeyExchangeDeformatter : System.Security.Cryptography.AsymmetricKeyExchangeDeformatter + { + public RSAOAEPKeyExchangeDeformatter() { } + public RSAOAEPKeyExchangeDeformatter(System.Security.Cryptography.AsymmetricAlgorithm key) { } + public override string? Parameters { get { throw null; } set { } } + public override byte[] DecryptKeyExchange(byte[] rgbData) { throw null; } + public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } + } + public partial class RSAOAEPKeyExchangeFormatter : System.Security.Cryptography.AsymmetricKeyExchangeFormatter + { + public RSAOAEPKeyExchangeFormatter() { } + public RSAOAEPKeyExchangeFormatter(System.Security.Cryptography.AsymmetricAlgorithm key) { } + public byte[]? Parameter { get { throw null; } set { } } + public override string? Parameters { get { throw null; } } + public System.Security.Cryptography.RandomNumberGenerator? Rng { get { throw null; } set { } } + public override byte[] CreateKeyExchange(byte[] rgbData) { throw null; } + public override byte[] CreateKeyExchange(byte[] rgbData, System.Type? symAlgType) { throw null; } + public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } + } + public partial struct RSAParameters + { + public byte[]? D; + public byte[]? DP; + public byte[]? DQ; + public byte[]? Exponent; + public byte[]? InverseQ; + public byte[]? Modulus; + public byte[]? P; + public byte[]? Q; + } + public partial class RSAPKCS1KeyExchangeDeformatter : System.Security.Cryptography.AsymmetricKeyExchangeDeformatter + { + public RSAPKCS1KeyExchangeDeformatter() { } + public RSAPKCS1KeyExchangeDeformatter(System.Security.Cryptography.AsymmetricAlgorithm key) { } + public override string? Parameters { get { throw null; } set { } } + public System.Security.Cryptography.RandomNumberGenerator? RNG { get { throw null; } set { } } + public override byte[] DecryptKeyExchange(byte[] rgbIn) { throw null; } + public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } + } + public partial class RSAPKCS1KeyExchangeFormatter : System.Security.Cryptography.AsymmetricKeyExchangeFormatter + { + public RSAPKCS1KeyExchangeFormatter() { } + public RSAPKCS1KeyExchangeFormatter(System.Security.Cryptography.AsymmetricAlgorithm key) { } + public override string Parameters { get { throw null; } } + public System.Security.Cryptography.RandomNumberGenerator? Rng { get { throw null; } set { } } + public override byte[] CreateKeyExchange(byte[] rgbData) { throw null; } + public override byte[] CreateKeyExchange(byte[] rgbData, System.Type? symAlgType) { throw null; } + public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } + } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public partial class RSAPKCS1SignatureDeformatter : System.Security.Cryptography.AsymmetricSignatureDeformatter + { + public RSAPKCS1SignatureDeformatter() { } + public RSAPKCS1SignatureDeformatter(System.Security.Cryptography.AsymmetricAlgorithm key) { } + public override void SetHashAlgorithm(string strName) { } + public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } + public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature) { throw null; } + } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public partial class RSAPKCS1SignatureFormatter : System.Security.Cryptography.AsymmetricSignatureFormatter + { + public RSAPKCS1SignatureFormatter() { } + public RSAPKCS1SignatureFormatter(System.Security.Cryptography.AsymmetricAlgorithm key) { } + public override byte[] CreateSignature(byte[] rgbHash) { throw null; } + public override void SetHashAlgorithm(string strName) { } + public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } + } + public sealed partial class RSASignaturePadding : System.IEquatable + { + internal RSASignaturePadding() { } + public System.Security.Cryptography.RSASignaturePaddingMode Mode { get { throw null; } } + public static System.Security.Cryptography.RSASignaturePadding Pkcs1 { get { throw null; } } + public static System.Security.Cryptography.RSASignaturePadding Pss { get { throw null; } } + public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } + public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Security.Cryptography.RSASignaturePadding? other) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(System.Security.Cryptography.RSASignaturePadding? left, System.Security.Cryptography.RSASignaturePadding? right) { throw null; } + public static bool operator !=(System.Security.Cryptography.RSASignaturePadding? left, System.Security.Cryptography.RSASignaturePadding? right) { throw null; } + public override string ToString() { throw null; } + } + public enum RSASignaturePaddingMode + { + Pkcs1 = 0, + Pss = 1, + } + public abstract partial class SHA1 : System.Security.Cryptography.HashAlgorithm + { + protected SHA1() { } + public static new System.Security.Cryptography.SHA1 Create() { throw null; } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] + public static new System.Security.Cryptography.SHA1? Create(string hashName) { throw null; } + public static byte[] HashData(byte[] source) { throw null; } + public static byte[] HashData(System.ReadOnlySpan source) { throw null; } + public static int HashData(System.ReadOnlySpan source, System.Span destination) { throw null; } + public static bool TryHashData(System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } + } + [System.ObsoleteAttribute("Derived cryptographic types are obsolete. Use the Create method on the base type instead.", DiagnosticId = "SYSLIB0021", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public sealed partial class SHA1Managed : System.Security.Cryptography.SHA1 + { + public SHA1Managed() { } + protected sealed override void Dispose(bool disposing) { } + protected sealed override void HashCore(byte[] array, int ibStart, int cbSize) { } + protected sealed override void HashCore(System.ReadOnlySpan source) { } + protected sealed override byte[] HashFinal() { throw null; } + public sealed override void Initialize() { } + protected sealed override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } + } + public abstract partial class SHA256 : System.Security.Cryptography.HashAlgorithm + { + protected SHA256() { } + public static new System.Security.Cryptography.SHA256 Create() { throw null; } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] + public static new System.Security.Cryptography.SHA256? Create(string hashName) { throw null; } + public static byte[] HashData(byte[] source) { throw null; } + public static byte[] HashData(System.ReadOnlySpan source) { throw null; } + public static int HashData(System.ReadOnlySpan source, System.Span destination) { throw null; } + public static bool TryHashData(System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } + } + [System.ObsoleteAttribute("Derived cryptographic types are obsolete. Use the Create method on the base type instead.", DiagnosticId = "SYSLIB0021", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public sealed partial class SHA256Managed : System.Security.Cryptography.SHA256 + { + public SHA256Managed() { } + protected sealed override void Dispose(bool disposing) { } + protected sealed override void HashCore(byte[] array, int ibStart, int cbSize) { } + protected sealed override void HashCore(System.ReadOnlySpan source) { } + protected sealed override byte[] HashFinal() { throw null; } + public sealed override void Initialize() { } + protected sealed override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } + } + public abstract partial class SHA384 : System.Security.Cryptography.HashAlgorithm + { + protected SHA384() { } + public static new System.Security.Cryptography.SHA384 Create() { throw null; } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] + public static new System.Security.Cryptography.SHA384? Create(string hashName) { throw null; } + public static byte[] HashData(byte[] source) { throw null; } + public static byte[] HashData(System.ReadOnlySpan source) { throw null; } + public static int HashData(System.ReadOnlySpan source, System.Span destination) { throw null; } + public static bool TryHashData(System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } + } + [System.ObsoleteAttribute("Derived cryptographic types are obsolete. Use the Create method on the base type instead.", DiagnosticId = "SYSLIB0021", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public sealed partial class SHA384Managed : System.Security.Cryptography.SHA384 + { + public SHA384Managed() { } + protected sealed override void Dispose(bool disposing) { } + protected sealed override void HashCore(byte[] array, int ibStart, int cbSize) { } + protected sealed override void HashCore(System.ReadOnlySpan source) { } + protected sealed override byte[] HashFinal() { throw null; } + public sealed override void Initialize() { } + protected sealed override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } + } + public abstract partial class SHA512 : System.Security.Cryptography.HashAlgorithm + { + protected SHA512() { } + public static new System.Security.Cryptography.SHA512 Create() { throw null; } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] + public static new System.Security.Cryptography.SHA512? Create(string hashName) { throw null; } + public static byte[] HashData(byte[] source) { throw null; } + public static byte[] HashData(System.ReadOnlySpan source) { throw null; } + public static int HashData(System.ReadOnlySpan source, System.Span destination) { throw null; } + public static bool TryHashData(System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } + } + [System.ObsoleteAttribute("Derived cryptographic types are obsolete. Use the Create method on the base type instead.", DiagnosticId = "SYSLIB0021", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public sealed partial class SHA512Managed : System.Security.Cryptography.SHA512 + { + public SHA512Managed() { } + protected sealed override void Dispose(bool disposing) { } + protected sealed override void HashCore(byte[] array, int ibStart, int cbSize) { } + protected sealed override void HashCore(System.ReadOnlySpan source) { } + protected sealed override byte[] HashFinal() { throw null; } + public sealed override void Initialize() { } + protected sealed override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } + } + public partial class SignatureDescription + { + public SignatureDescription() { } + public SignatureDescription(System.Security.SecurityElement el) { } + public string? DeformatterAlgorithm { get { throw null; } set { } } + public string? DigestAlgorithm { get { throw null; } set { } } + public string? FormatterAlgorithm { get { throw null; } set { } } + public string? KeyAlgorithm { get { throw null; } set { } } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("CreateDeformatter is not trim compatible because the algorithm implementation referenced by DeformatterAlgorithm might be removed.")] + public virtual System.Security.Cryptography.AsymmetricSignatureDeformatter CreateDeformatter(System.Security.Cryptography.AsymmetricAlgorithm key) { throw null; } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("CreateDigest is not trim compatible because the algorithm implementation referenced by DigestAlgorithm might be removed.")] + public virtual System.Security.Cryptography.HashAlgorithm? CreateDigest() { throw null; } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("CreateFormatter is not trim compatible because the algorithm implementation referenced by FormatterAlgorithm might be removed.")] + public virtual System.Security.Cryptography.AsymmetricSignatureFormatter CreateFormatter(System.Security.Cryptography.AsymmetricAlgorithm key) { throw null; } + } public abstract partial class SymmetricAlgorithm : System.IDisposable { protected int BlockSizeValue; @@ -301,4 +1354,28 @@ protected virtual void Dispose(bool disposing) { } protected virtual bool TryEncryptEcbCore(System.ReadOnlySpan plaintext, System.Span destination, System.Security.Cryptography.PaddingMode paddingMode, out int bytesWritten) { throw null; } public bool ValidKeySize(int bitLength) { throw null; } } + public partial class ToBase64Transform : System.IDisposable, System.Security.Cryptography.ICryptoTransform + { + public ToBase64Transform() { } + public virtual bool CanReuseTransform { get { throw null; } } + public bool CanTransformMultipleBlocks { get { throw null; } } + public int InputBlockSize { get { throw null; } } + public int OutputBlockSize { get { throw null; } } + public void Clear() { } + public void Dispose() { } + protected virtual void Dispose(bool disposing) { } + ~ToBase64Transform() { } + public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset) { throw null; } + public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount) { throw null; } + } + public abstract partial class TripleDES : System.Security.Cryptography.SymmetricAlgorithm + { + protected TripleDES() { } + public override byte[] Key { get { throw null; } set { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] + public static new System.Security.Cryptography.TripleDES Create() { throw null; } + [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] + public static new System.Security.Cryptography.TripleDES? Create(string str) { throw null; } + public static bool IsWeakKey(byte[] rgbKey) { throw null; } + } } diff --git a/src/libraries/System.Security.Cryptography/src/Resources/Strings.resx b/src/libraries/System.Security.Cryptography/src/Resources/Strings.resx index 250a6eceed20e9..84a24a8fc9ef46 100644 --- a/src/libraries/System.Security.Cryptography/src/Resources/Strings.resx +++ b/src/libraries/System.Security.Cryptography/src/Resources/Strings.resx @@ -60,12 +60,18 @@ Error occurred during a cryptographic operation. + + Only single dimensional arrays are supported for the requested action. + Destination is too short. Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection. + + Range of random number does not contain at least one possibility. + Value was invalid. @@ -78,41 +84,200 @@ The value specified in bits must be a whole number of bytes. + + No PEM encoded data found. + + + The specified label is not valid. + + + The encoded PEM size is too large to represent as a signed 32-bit integer. + + + No supported key formats were found. Check that the input represents the contents of a PEM-encoded key file, not the path to such a file. + + + The input contains multiple keys, but only one key can be imported. + + + An encrypted key was found, but no password was provided. Use ImportFromEncryptedPem to import this key. + + + Index was out of range. Must be non-negative and less than the size of the collection. + Non-negative number required. Positive number required. + + Accessing a hash algorithm by manipulating the HashName property is not supported on this platform. Instead, you must instantiate one of the supplied subtypes (such as HMACSHA1.) + + + CryptoConfig cannot add a mapping for a null or empty name. + + + The KDF for algorithm '{0}' requires a char-based password input. + + + Algorithm '{0}' is not supported on this platform. + + + Algorithms added to CryptoConfig must be accessible from outside their assembly. + + + The keys from both parties must be the same size to generate a secret agreement. + + + Keys used with the ECDiffieHellmanCng algorithm must have an algorithm group of ECDiffieHellman. + + + The computed authentication tag did not match the input authentication tag. + + + The provided value of {0} bytes does not match the expected size of {1} bytes for the algorithm ({2}). + + + The specified feedback size '{0}' for CipherMode '{1}' is not supported. + + + The specified CipherMode '{0}' is not supported. + + + Encoded OID length is too large (greater than 0x7f bytes). + FlushFinalBlock() method was called twice on a CryptoStream. It can only be called once. + + Object contains only the public half of a key pair. A private key must also be provided. + + + The specified curve '{0}' or its parameters are not valid for this platform. + This platform does not allow the automatic selection of an algorithm. + + ASN1 corrupted data. + + + DSA keys can be imported, but new key generation is not supported on this platform. + + + Only named curves are supported on this platform. + + + XML serialization of an elliptic curve key requires using an overload which specifies the XML format to be used. + + + {0} unexpectedly produced a ciphertext with the incorrect length. + + + The total number of bytes extracted cannot exceed UInt32.MaxValue * hash length. + + + The current platform does not support the specified feedback size. + + + No hash algorithm has been associated with this formatter object, assign one via the SetHashAlgorithm method. + + + No asymmetric key object has been associated with this formatter object, assign one via the SetKey method. + + + The provided XML could not be read. + + + The hash algorithm name cannot be null or empty. + Hash must be finalized before the hash value is retrieved. - - Specified feedback size is not valid for this algorithm. - Specified block size is not valid for this algorithm. Specified cipher mode is not valid for this algorithm. + + The specified key parameters are not valid. Q.X and Q.Y, or D, must be specified. Q.X, Q.Y must be the same length. If D is specified it must be the same length as Q.X and Q.Y if also specified for named curves or the same length as Order for explicit curves. + + + The specified Oid is not valid. The Oid.FriendlyName or Oid.Value property must be set. + + + The specified DSA parameters are not valid; P, G and Y must be the same length (the key size). + + + The specified DSA parameters are not valid; J (if present) must be shorter than P. + + + The specified DSA parameters are not valid; Q and X (if present) must be the same length. + + + The specified DSA parameters are not valid; P, Q, G and Y are all required. + + + The specified DSA parameters are not valid; Q's length must be one of 20, 32 or 64 bytes. + + + The specified DSA parameters are not valid; Q must be 20 bytes long for keys shorter than 1024 bits. + + + The specified DSA parameters are not valid; Seed, if present, must be 20 bytes long for keys shorter than 1024 bits. + + + The specified Characteristic2 curve parameters are not valid. Polynomial, A, B, G.X, G.Y, and Order are required. A, B, G.X, G.Y must be the same length, and the same length as Q.X, Q.Y and D if those are specified. Cofactor is required. Seed and Hash are optional. Other parameters are not allowed. + + + The specified prime curve parameters are not valid. Prime, A, B, G.X, G.Y and Order are required and must be the same length, and the same length as Q.X, Q.Y and D if those are specified. Cofactor is required. Seed and Hash are optional. Other parameters are not allowed. + + + The specified named curve parameters are not valid. Only the Oid parameter must be set. + + + Specified feedback size is not valid for this algorithm. + + + Input string does not contain a valid encoding of the '{0}' '{1}' parameter. + + + The specified OID ({0}) does not represent a known hash algorithm. + Specified initialization vector (IV) does not match the block size for this algorithm. + + Specified key is a known semi-weak key for '{0}' and cannot be used. + + + Specified key is a known weak key for '{0}' and cannot be used. + Specified key is not a valid size for this algorithm. + + The specified nonce is not a valid size for this algorithm. + + + Object identifier (OID) is unknown. + + + Padding is invalid and cannot be removed. + Specified padding mode is not valid for this algorithm. - - The specified OID ({0}) does not represent a known hash algorithm. + + This operation is not supported for this class. + + + The specified tag is not a valid size for this algorithm. + + + The key is too small for the requested operation. The specified plaintext size is not valid for the the padding and block size. @@ -120,34 +285,130 @@ The specified plaintext size is not valid for the the padding and feedback size. + + The message exceeds the maximum allowable length for the chosen options ({0}). + + + The specified RSA parameters are not valid. Exponent and Modulus are required. If D is present, it must have the same length as Modulus. If D is present, P, Q, DP, DQ, and InverseQ are required and must have half the length of Modulus, rounded up, otherwise they must be omitted. + + + The cipher mode specified requires that an initialization vector (IV) be used. + + + TransformBlock may only process bytes in block sized increments. + + + Key is not a valid private key. + + + Key is not a valid public or private key. + + + Error occurred while decoding OAEP padding. + + + No OID value matches this name. + + + The OID value is invalid. + + + The OID friendly name cannot be changed from its current value. + + + The OID value cannot be changed from its current value. + + + Output keying material length can be at most {0} bytes (255 * hash length). + + + Cannot open an invalid handle. + + + The input data is not a complete block. + + + The EncryptedPrivateKeyInfo structure was decoded but was not successfully interpreted, the password may be incorrect. + + + Plaintext and ciphertext must have the same length. + The specified plaintext size is too large. - - {0} unexpectedly produced a ciphertext with the incorrect length. + + The pseudo-random key length must be at least {0} bytes. - - Method not supported. Derived class must override. + + EffectiveKeySize value must be at least 40 bits. - - Stream does not support reading. + + KeySize value must be at least as large as the EffectiveKeySize value. - - Stream does not support seeking. + + EffectiveKeySize must be the same as KeySize in this implementation. - - Stream does not support writing. + + BlockSize must be 128 in this implementation. + + + The length of the data to decrypt is not valid for the size of this key. + + + The provided RSAPrivateKey value has version '{0}', but version '{1}' is the maximum supported. + + + The provided hash value is not the expected size for the specified hash algorithm. + + + The TLS key derivation function requires a seed value of exactly 64 bytes. + + + CNG provider unexpectedly terminated encryption or decryption prematurely. + + + The algorithm identified by '{0}' is unknown, not valid for the requested usage, or was not handled. + + + '{0}' is not a known hash algorithm. + + + Unknown padding mode used. + + + The signature format '{0}' is unknown. + + + The system cryptographic library returned error '{0}' of type '{1}' + + + The specified PaddingMode is not supported. Setting the hashname after it's already been set is not supported on this platform. - - Accessing a hash algorithm by manipulating the HashName property is not supported on this platform. Instead, you must instantiate one of the supplied subtypes (such as HMACSHA1.) - The algorithm's implementation is incorrect. The algorithm's block size is not supported. + + Method not supported. + + + Method not supported. Derived class must override. + + + Stream does not support reading. + + + Stream does not support seeking. + + + Stream does not support writing. + + + System.Security.Cryptography is not supported on this platform. + diff --git a/src/libraries/System.Security.Cryptography/src/System.Security.Cryptography.csproj b/src/libraries/System.Security.Cryptography/src/System.Security.Cryptography.csproj index a467ac9e937eb9..9a268d9a83d9a0 100644 --- a/src/libraries/System.Security.Cryptography/src/System.Security.Cryptography.csproj +++ b/src/libraries/System.Security.Cryptography/src/System.Security.Cryptography.csproj @@ -1,44 +1,861 @@ true - $(NetCoreAppCurrent) + $(DefineConstants);INTERNAL_ASYMMETRIC_IMPLEMENTATIONS + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Android;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent) + $(NoWarn);CA5350;CA5351;CA5379;CA5384 enable - + + SR.SystemSecurityCryptography_PlatformNotSupported + + + true + true + true + true + true + + + + + + + + + + + + + + + + + + + + Common\System\Security\Cryptography\Asn1\AlgorithmIdentifierAsn.xml + + + Common\System\Security\Cryptography\Asn1\AlgorithmIdentifierAsn.xml.cs + Common\System\Security\Cryptography\Asn1\AlgorithmIdentifierAsn.xml + + + Common\System\Security\Cryptography\Asn1\AlgorithmIdentifierAsn.manual.cs + Common\System\Security\Cryptography\Asn1\AlgorithmIdentifierAsn.xml + + + Common\System\Security\Cryptography\Asn1\AttributeAsn.xml + + + Common\System\Security\Cryptography\Asn1\AttributeAsn.xml.cs + Common\System\Security\Cryptography\Asn1\AttributeAsn.xml + + + Common\System\Security\Cryptography\Asn1\CurveAsn.xml + + + Common\System\Security\Cryptography\Asn1\CurveAsn.xml.cs + Common\System\Security\Cryptography\Asn1\CurveAsn.xml + + + Common\System\Security\Cryptography\Asn1\DssParms.xml + + + Common\System\Security\Cryptography\Asn1\DssParms.xml.cs + Common\System\Security\Cryptography\Asn1\DssParms.xml + + + Common\System\Security\Cryptography\Asn1\ECDomainParameters.xml + + + Common\System\Security\Cryptography\Asn1\ECDomainParameters.xml.cs + Common\System\Security\Cryptography\Asn1\ECDomainParameters.xml + + + Common\System\Security\Cryptography\Asn1\ECPrivateKey.xml + + + Common\System\Security\Cryptography\Asn1\ECPrivateKey.xml.cs + Common\System\Security\Cryptography\Asn1\ECPrivateKey.xml + + + Common\System\Security\Cryptography\Asn1\EncryptedPrivateKeyInfoAsn.xml + + + Common\System\Security\Cryptography\Asn1\EncryptedPrivateKeyInfoAsn.xml.cs + Common\System\Security\Cryptography\Asn1\EncryptedPrivateKeyInfoAsn.xml + + + Common\System\Security\Cryptography\Asn1\FieldID.xml + + + Common\System\Security\Cryptography\Asn1\FieldID.xml.cs + Common\System\Security\Cryptography\Asn1\FieldID.xml + + + Common\System\Security\Cryptography\Asn1\PBEParameter.xml + + + Common\System\Security\Cryptography\Asn1\PBEParameter.xml.cs + Common\System\Security\Cryptography\Asn1\PBEParameter.xml + + + Common\System\Security\Cryptography\Asn1\PBES2Params.xml + + + Common\System\Security\Cryptography\Asn1\PBES2Params.xml.cs + Common\System\Security\Cryptography\Asn1\PBES2Params.xml + + + Common\System\Security\Cryptography\Asn1\Pbkdf2Params.xml + + + Common\System\Security\Cryptography\Asn1\Pbkdf2Params.xml.cs + Common\System\Security\Cryptography\Asn1\Pbkdf2Params.xml + + + Common\System\Security\Cryptography\Asn1\Pbkdf2SaltChoice.xml + + + Common\System\Security\Cryptography\Asn1\Pbkdf2SaltChoice.xml.cs + Common\System\Security\Cryptography\Asn1\Pbkdf2SaltChoice.xml + + + Common\System\Security\Cryptography\Asn1\PrivateKeyInfoAsn.xml + + + Common\System\Security\Cryptography\Asn1\PrivateKeyInfoAsn.xml.cs + Common\System\Security\Cryptography\Asn1\PrivateKeyInfoAsn.xml + + + Common\System\Security\Cryptography\Asn1\Rc2CbcParameters.xml + + + Common\System\Security\Cryptography\Asn1\Rc2CbcParameters.xml.cs + Common\System\Security\Cryptography\Asn1\Rc2CbcParameters.xml + + + Common\System\Security\Cryptography\Asn1\Rc2CbcParameters.manual.cs + Common\System\Security\Cryptography\Asn1\Rc2CbcParameters.xml + + + Common\System\Security\Cryptography\Asn1\RSAPrivateKeyAsn.xml + + + Common\System\Security\Cryptography\Asn1\RSAPrivateKeyAsn.xml.cs + Common\System\Security\Cryptography\Asn1\RSAPrivateKeyAsn.xml + + + Common\System\Security\Cryptography\Asn1\RSAPublicKeyAsn.xml + + + Common\System\Security\Cryptography\Asn1\RSAPublicKeyAsn.xml.cs + Common\System\Security\Cryptography\Asn1\RSAPublicKeyAsn.xml + + + Common\System\Security\Cryptography\Asn1\SpecifiedECDomain.xml + + + Common\System\Security\Cryptography\Asn1\SpecifiedECDomain.xml.cs + Common\System\Security\Cryptography\Asn1\SpecifiedECDomain.xml + + + Common\System\Security\Cryptography\Asn1\SubjectPublicKeyInfoAsn.xml + + + Common\System\Security\Cryptography\Asn1\SubjectPublicKeyInfoAsn.xml.cs + Common\System\Security\Cryptography\Asn1\SubjectPublicKeyInfoAsn.xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + Common\System\Security\Cryptography\Asn1\DirectoryStringAsn.xml + + + Common\System\Security\Cryptography\Asn1\DirectoryStringAsn.xml.cs + Common\System\Security\Cryptography\Asn1\DirectoryStringAsn.xml + + + Common\System\Security\Cryptography\Asn1\EdiPartyNameAsn.xml.cs + Common\System\Security\Cryptography\Asn1\EdiPartyNameAsn.xml + + + Common\System\Security\Cryptography\Asn1\GeneralNameAsn.xml + + + Common\System\Security\Cryptography\Asn1\GeneralNameAsn.xml.cs + Common\System\Security\Cryptography\Asn1\GeneralNameAsn.xml + + + Common\System\Security\Cryptography\Asn1\OtherNameAsn.xml + + + Common\System\Security\Cryptography\Asn1\OtherNameAsn.xml.cs + Common\System\Security\Cryptography\Asn1\OtherNameAsn.xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AeadCommon.Windows.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AeadCommon.Windows.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AeadCommon.Windows.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AeadCommon.Windows.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AeadCommon.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AeadCommon.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AeadCommon.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AeadCommon.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Aes.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Aes.cs similarity index 96% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Aes.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Aes.cs index 3fdfd83871fc0e..d58995772b7f81 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Aes.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Aes.cs @@ -7,7 +7,6 @@ namespace System.Security.Cryptography { - [UnsupportedOSPlatform("browser")] public abstract class Aes : SymmetricAlgorithm { protected Aes() @@ -21,6 +20,7 @@ protected Aes() ModeValue = CipherMode.CBC; } + [UnsupportedOSPlatform("browser")] public static new Aes Create() { return new AesImplementation(); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesAEAD.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesAEAD.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesAEAD.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesAEAD.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesCcm.Android.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesCcm.Android.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesCcm.Android.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesCcm.Android.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesCcm.NotSupported.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesCcm.NotSupported.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesCcm.NotSupported.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesCcm.NotSupported.cs index 6cbfe82d10ab73..6469f5a8ad3753 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesCcm.NotSupported.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesCcm.NotSupported.cs @@ -9,7 +9,6 @@ public partial class AesCcm { public static bool IsSupported => false; -#if !BROWSER // allow GenFacades to handle browser target private void ImportKey(ReadOnlySpan key) { Debug.Fail("Instance ctor should fail before we reach this point."); @@ -43,6 +42,5 @@ public void Dispose() Debug.Fail("Instance ctor should fail before we reach this point."); // no-op } -#endif } } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesCcm.Unix.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesCcm.OpenSsl.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesCcm.Unix.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesCcm.OpenSsl.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesCcm.Windows.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesCcm.Windows.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesCcm.Windows.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesCcm.Windows.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesCcm.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesCcm.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesCcm.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesCcm.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesGcm.Android.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesGcm.Android.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesGcm.Android.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesGcm.Android.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesGcm.NotSupported.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesGcm.NotSupported.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesGcm.NotSupported.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesGcm.NotSupported.cs index 0950177836646c..e8a82787e8ee3f 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesGcm.NotSupported.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesGcm.NotSupported.cs @@ -9,7 +9,6 @@ public partial class AesGcm { public static bool IsSupported => false; -#if !BROWSER // allow GenFacades to handle browser target private void ImportKey(ReadOnlySpan key) { Debug.Fail("Instance ctor should fail before we reach this point."); @@ -43,6 +42,5 @@ public void Dispose() Debug.Fail("Instance ctor should fail before we reach this point."); // no-op } -#endif } } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesGcm.Unix.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesGcm.OpenSsl.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesGcm.Unix.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesGcm.OpenSsl.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesGcm.Windows.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesGcm.Windows.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesGcm.Windows.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesGcm.Windows.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesGcm.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesGcm.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesGcm.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesGcm.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.OSX.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesImplementation.Apple.cs similarity index 94% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.OSX.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesImplementation.Apple.cs index 5c2a9c5602fcb5..f4b595ca0839b3 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.OSX.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesImplementation.Apple.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Security.Cryptography; +using Internal.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed partial class AesImplementation { diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesImplementation.NotSupported.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesImplementation.NotSupported.cs new file mode 100644 index 00000000000000..86483ca199806c --- /dev/null +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesImplementation.NotSupported.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. + +using Internal.Cryptography; + +namespace System.Security.Cryptography +{ + internal sealed partial class AesImplementation : Aes + { + private static UniversalCryptoTransform CreateTransformCore( + CipherMode cipherMode, + PaddingMode paddingMode, + byte[] key, + byte[]? iv, + int blockSize, + int paddingSize, + int feedback, + bool encrypting) + { + throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(Aes))); + } + + private static ILiteSymmetricCipher CreateLiteCipher( + CipherMode cipherMode, + ReadOnlySpan key, + ReadOnlySpan iv, + int blockSize, + int paddingSize, + int feedback, + bool encrypting) + { + throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(Aes))); + } + } +} diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.Unix.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesImplementation.OpenSsl.cs similarity index 97% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.Unix.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesImplementation.OpenSsl.cs index 649e22dea891ee..1f4720184dd40c 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.Unix.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesImplementation.OpenSsl.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Security.Cryptography; +using Internal.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed partial class AesImplementation { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.Windows.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesImplementation.Windows.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.Windows.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesImplementation.Windows.cs index c66b9918e67236..9e2f44653026de 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.Windows.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesImplementation.Windows.cs @@ -1,11 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Security.Cryptography; +using Internal.Cryptography; using Internal.NativeCrypto; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed partial class AesImplementation { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesImplementation.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesImplementation.cs index d7b43bd0c7de1c..9b413892203448 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesImplementation.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Security.Cryptography; +using Internal.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed partial class AesImplementation : Aes { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesManaged.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesManaged.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesManaged.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesManaged.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AppleCCCryptor.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AppleCCCryptor.cs similarity index 97% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AppleCCCryptor.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AppleCCCryptor.cs index c99a6bd3514230..a5a0f696ee74c3 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AppleCCCryptor.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AppleCCCryptor.cs @@ -1,13 +1,11 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -using System.Security.Cryptography; using Internal.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed class AppleCCCryptor : BasicSymmetricCipher { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AppleCCCryptorLite.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AppleCCCryptorLite.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AppleCCCryptorLite.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AppleCCCryptorLite.cs index 34c00b04d96422..f4bb6969361f82 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AppleCCCryptorLite.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AppleCCCryptorLite.cs @@ -1,18 +1,17 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Buffers; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; -using System.Security.Cryptography; +using Internal.Cryptography; using Microsoft.Win32.SafeHandles; using PAL_SymmetricAlgorithm = Interop.AppleCrypto.PAL_SymmetricAlgorithm; using PAL_ChainingMode = Interop.AppleCrypto.PAL_ChainingMode; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed class AppleCCCryptorLite : ILiteSymmetricCipher { diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/AsnEncodedData.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsnEncodedData.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/AsnEncodedData.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsnEncodedData.cs diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/AsnEncodedDataCollection.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsnEncodedDataCollection.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/AsnEncodedDataCollection.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsnEncodedDataCollection.cs diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/AsnEncodedDataEnumerator.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsnEncodedDataEnumerator.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/AsnEncodedDataEnumerator.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsnEncodedDataEnumerator.cs diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/AsnFormatter.Managed.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsnFormatter.Managed.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/AsnFormatter.Managed.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsnFormatter.Managed.cs index 0275ab5546bab3..37205d7a73b307 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/AsnFormatter.Managed.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsnFormatter.Managed.cs @@ -1,13 +1,11 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Formats.Asn1; -using System.Security.Cryptography; using System.Security.Cryptography.Asn1; using System.Text; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal abstract partial class AsnFormatter { diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/AsnFormatter.Unix.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsnFormatter.OpenSsl.cs similarity index 88% rename from src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/AsnFormatter.Unix.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsnFormatter.OpenSsl.cs index a3e29a506cec23..bde8b2f7318e29 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/AsnFormatter.Unix.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsnFormatter.OpenSsl.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal abstract partial class AsnFormatter { diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/AsnFormatter.Windows.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsnFormatter.Windows.cs similarity index 87% rename from src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/AsnFormatter.Windows.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsnFormatter.Windows.cs index b508b3fc7b9f27..6f368ddf131654 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/AsnFormatter.Windows.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsnFormatter.Windows.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal abstract partial class AsnFormatter { diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/AsnFormatter.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsnFormatter.cs similarity index 94% rename from src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/AsnFormatter.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsnFormatter.cs index b83af59e0d2979..eaf26c6d9b35cd 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/AsnFormatter.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsnFormatter.cs @@ -1,11 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Diagnostics; -using System.Security.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal abstract partial class AsnFormatter { diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsymmetricAlgorithm.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsymmetricAlgorithm.cs index 48142e31528749..c1e5f0f2515cfe 100644 --- a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsymmetricAlgorithm.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsymmetricAlgorithm.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Internal.Cryptography; using System.Diagnostics.CodeAnalysis; namespace System.Security.Cryptography @@ -139,7 +140,6 @@ public virtual byte[] ExportSubjectPublicKeyInfo() => ExportArray( (Span destination, out int i) => TryExportSubjectPublicKeyInfo(destination, out i)); - public virtual bool TryExportEncryptedPkcs8PrivateKey( ReadOnlySpan passwordBytes, PbeParameters pbeParameters, @@ -165,55 +165,507 @@ public virtual bool TryExportSubjectPublicKeyInfo(Span destination, out in throw new NotImplementedException(SR.NotSupported_SubclassOverride); /// - /// When overridden in a derived class, imports an encrypted RFC 7468 - /// PEM-encoded key, replacing the keys for this object. + /// Imports an encrypted RFC 7468 PEM-encoded key, replacing the keys for this object. /// /// The PEM text of the encrypted key to import. /// /// The password to use for decrypting the key material. /// + /// + /// + /// does not contain a PEM-encoded key with a recognized label. + /// + /// + /// -or- + /// + /// + /// contains multiple PEM-encoded keys with a recognized label. + /// + /// + /// + /// + /// The password is incorrect. + /// + /// + /// -or- + /// + /// + /// The base-64 decoded contents of the PEM text from + /// do not represent an ASN.1-BER-encoded PKCS#8 EncryptedPrivateKeyInfo structure. + /// + /// + /// -or- + /// + /// + /// The base-64 decoded contents of the PEM text from + /// indicate the key is for an algorithm other than the algorithm + /// represented by this instance. + /// + /// + /// -or- + /// + /// + /// The base-64 decoded contents of the PEM text from + /// represent the key in a format that is not supported. + /// + /// + /// -or- + /// + /// + /// The algorithm-specific key import failed. + /// + /// /// - /// A derived type has not overridden this member. + /// A derived type has not provided an implementation for + /// . /// /// - /// Because each algorithm may have algorithm-specific PEM labels, the - /// default behavior will throw . + /// + /// When the base-64 decoded contents of indicate an algorithm that uses PBKDF1 + /// (Password-Based Key Derivation Function 1) or PBKDF2 (Password-Based Key Derivation Function 2), + /// the password is converted to bytes via the UTF-8 encoding. + /// + /// + /// Unsupported or malformed PEM-encoded objects will be ignored. If multiple supported PEM labels + /// are found, an exception is thrown to prevent importing a key when + /// the key is ambiguous. + /// + /// This method supports the ENCRYPTED PRIVATE KEY PEM label. + /// + /// Types that override this method may support additional PEM labels. + /// /// - public virtual void ImportFromEncryptedPem(ReadOnlySpan input, ReadOnlySpan password) => - throw new NotImplementedException(SR.NotSupported_SubclassOverride); + public virtual void ImportFromEncryptedPem(ReadOnlySpan input, ReadOnlySpan password) + { + PemKeyHelpers.ImportEncryptedPem(input, password, ImportEncryptedPkcs8PrivateKey); + } /// - /// When overridden in a derived class, imports an encrypted RFC 7468 - /// PEM-encoded key, replacing the keys for this object. + /// Imports an encrypted RFC 7468 PEM-encoded key, replacing the keys for this object. /// /// The PEM text of the encrypted key to import. /// /// The bytes to use as a password when decrypting the key material. /// + /// + /// + /// does not contain a PEM-encoded key with a recognized label. + /// + /// + /// -or- + /// + /// + /// contains multiple PEM-encoded keys with a recognized label. + /// + /// + /// + /// + /// The password is incorrect. + /// + /// + /// -or- + /// + /// + /// The base-64 decoded contents of the PEM text from + /// do not represent an ASN.1-BER-encoded PKCS#8 EncryptedPrivateKeyInfo structure. + /// + /// + /// -or- + /// + /// + /// The base-64 decoded contents of the PEM text from + /// indicate the key is for an algorithm other than the algorithm + /// represented by this instance. + /// + /// + /// -or- + /// + /// + /// The base-64 decoded contents of the PEM text from + /// represent the key in a format that is not supported. + /// + /// + /// -or- + /// + /// + /// The algorithm-specific key import failed. + /// + /// /// - /// A derived type has not overridden this member. + /// A derived type has not provided an implementation for + /// . /// /// - /// Because each algorithm may have algorithm-specific PEM labels, the - /// default behavior will throw . + /// + /// The password bytes are passed directly into the Key Derivation Function (KDF) + /// used by the algorithm indicated by pbeParameters. This enables compatibility + /// with other systems which use a text encoding other than UTF-8 when processing + /// passwords with PBKDF2 (Password-Based Key Derivation Function 2). + /// + /// + /// Unsupported or malformed PEM-encoded objects will be ignored. If multiple supported PEM labels + /// are found, an exception is thrown to prevent importing a key when + /// the key is ambiguous. + /// + /// This method supports the ENCRYPTED PRIVATE KEY PEM label. + /// + /// Types that override this method may support additional PEM labels. + /// /// - public virtual void ImportFromEncryptedPem(ReadOnlySpan input, ReadOnlySpan passwordBytes) => - throw new NotImplementedException(SR.NotSupported_SubclassOverride); + public virtual void ImportFromEncryptedPem(ReadOnlySpan input, ReadOnlySpan passwordBytes) + { + PemKeyHelpers.ImportEncryptedPem(input, passwordBytes, ImportEncryptedPkcs8PrivateKey); + } /// - /// When overridden in a derived class, imports an RFC 7468 textually - /// encoded key, replacing the keys for this object. + /// Imports an RFC 7468 textually encoded key, replacing the keys for this object. /// /// The text of the PEM key to import. + /// + /// + /// does not contain a PEM-encoded key with a recognized label. + /// + /// + /// -or- + /// + /// + /// contains multiple PEM-encoded keys with a recognized label. + /// + /// + /// -or- + /// + /// + /// contains an encrypted PEM-encoded key. + /// + /// /// - /// A derived type has not overridden this member. + /// A derived type has not provided an implementation for + /// or . /// /// - /// Because each algorithm may have algorithm-specific PEM labels, the - /// default behavior will throw . + /// + /// Unsupported or malformed PEM-encoded objects will be ignored. If multiple supported PEM labels + /// are found, an exception is raised to prevent importing a key when + /// the key is ambiguous. + /// + /// + /// This method supports the following PEM labels: + /// + /// PUBLIC KEY + /// PRIVATE KEY + /// + /// + /// + /// Types that override this method may support additional PEM labels. + /// /// - public virtual void ImportFromPem(ReadOnlySpan input) => - throw new NotImplementedException(SR.NotSupported_SubclassOverride); + public virtual void ImportFromPem(ReadOnlySpan input) + { + PemKeyHelpers.ImportPem(input, label => + { + if (label.SequenceEqual(PemLabels.Pkcs8PrivateKey)) + { + return ImportPkcs8PrivateKey; + } + else if (label.SequenceEqual(PemLabels.SpkiPublicKey)) + { + return ImportSubjectPublicKeyInfo; + } + else + { + return null; + } + }); + } + + /// + /// Exports the current key in the PKCS#8 PrivateKeyInfo format, PEM encoded. + /// + /// A string containing the PEM-encoded PKCS#8 PrivateKeyInfo. + /// + /// An implementation for or + /// has not been provided. + /// + /// + /// The key could not be exported. + /// + /// + ///

+ /// A PEM-encoded PKCS#8 PrivateKeyInfo will begin with -----BEGIN PRIVATE KEY----- + /// and end with -----END PRIVATE KEY-----, with the base64 encoded DER + /// contents of the key between the PEM boundaries. + ///

+ ///

+ /// The PEM is encoded according to the IETF RFC 7468 "strict" + /// encoding rules. + ///

+ ///
+ public unsafe string ExportPkcs8PrivateKeyPem() + { + byte[] exported = ExportPkcs8PrivateKey(); + + // Fixed to prevent GC moves. + fixed (byte* pExported = exported) + { + try + { + return PemKeyHelpers.CreatePemFromData(PemLabels.Pkcs8PrivateKey, exported); + } + finally + { + CryptographicOperations.ZeroMemory(exported); + } + } + } + + /// + /// Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format + /// with a char-based password, PEM encoded. + /// + /// + /// The password to use when encrypting the key material. + /// + /// + /// The password-based encryption (PBE) parameters to use when encrypting the key material. + /// + /// A string containing the PEM-encoded PKCS#8 EncryptedPrivateKeyInfo. + /// + /// An implementation for or + /// has not been provided. + /// + /// + /// The key could not be exported. + /// + /// + ///

+ /// When indicates an algorithm that + /// uses PBKDF2 (Password-Based Key Derivation Function 2), the password + /// is converted to bytes via the UTF-8 encoding. + ///

+ ///

+ /// A PEM-encoded PKCS#8 EncryptedPrivateKeyInfo will begin with + /// -----BEGIN ENCRYPTED PRIVATE KEY----- and end with + /// -----END ENCRYPTED PRIVATE KEY-----, with the base64 encoded DER + /// contents of the key between the PEM boundaries. + ///

+ ///

+ /// The PEM is encoded according to the IETF RFC 7468 "strict" + /// encoding rules. + ///

+ ///
+ public unsafe string ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan password, PbeParameters pbeParameters) + { + byte[] exported = ExportEncryptedPkcs8PrivateKey(password, pbeParameters); + + // Fixed to prevent GC moves. + fixed (byte* pExported = exported) + { + try + { + return PemKeyHelpers.CreatePemFromData(PemLabels.EncryptedPkcs8PrivateKey, exported); + } + finally + { + CryptographicOperations.ZeroMemory(exported); + } + } + } + + /// + /// Exports the public-key portion of the current key in the X.509 + /// SubjectPublicKeyInfo format, PEM encoded. + /// + /// A string containing the PEM-encoded X.509 SubjectPublicKeyInfo. + /// + /// An implementation for or + /// has not been provided. + /// + /// + /// The key could not be exported. + /// + /// + ///

+ /// A PEM-encoded X.509 SubjectPublicKeyInfo will begin with + /// -----BEGIN PUBLIC KEY----- and end with + /// -----END PUBLIC KEY-----, with the base64 encoded DER + /// contents of the key between the PEM boundaries. + ///

+ ///

+ /// The PEM is encoded according to the IETF RFC 7468 "strict" + /// encoding rules. + ///

+ ///
+ public string ExportSubjectPublicKeyInfoPem() + { + byte[] exported = ExportSubjectPublicKeyInfo(); + return PemKeyHelpers.CreatePemFromData(PemLabels.SpkiPublicKey, exported); + } + + /// + /// Attempts to export the current key in the PEM-encoded X.509 + /// SubjectPublicKeyInfo format into a provided buffer. + /// + /// + /// The character span to receive the PEM-encoded X.509 SubjectPublicKeyInfo data. + /// + /// + /// When this method returns, contains a value that indicates the number + /// of characters written to . This + /// parameter is treated as uninitialized. + /// + /// + /// if is big enough + /// to receive the output; otherwise, . + /// + /// + /// An implementation for + /// has not been provided. + /// + /// + /// The key could not be exported. + /// + /// + ///

+ /// A PEM-encoded X.509 SubjectPublicKeyInfo will begin with + /// -----BEGIN PUBLIC KEY----- and end with + /// -----END PUBLIC KEY-----, with the base64 encoded DER + /// contents of the key between the PEM boundaries. + ///

+ ///

+ /// The PEM is encoded according to the IETF RFC 7468 "strict" + /// encoding rules. + ///

+ ///
+ public bool TryExportSubjectPublicKeyInfoPem(Span destination, out int charsWritten) + { + static bool Export(AsymmetricAlgorithm alg, Span destination, out int bytesWritten) + { + return alg.TryExportSubjectPublicKeyInfo(destination, out bytesWritten); + } + + return PemKeyHelpers.TryExportToPem( + this, + PemLabels.SpkiPublicKey, + Export, + destination, + out charsWritten); + } + + /// + /// Attempts to export the current key in the PEM-encoded PKCS#8 + /// PrivateKeyInfo format into a provided buffer. + /// + /// + /// The character span to receive the PEM-encoded PKCS#8 PrivateKeyInfo data. + /// + /// + /// When this method returns, contains a value that indicates the number + /// of characters written to . This + /// parameter is treated as uninitialized. + /// + /// + /// if is big enough + /// to receive the output; otherwise, . + /// + /// + /// An implementation for + /// has not been provided. + /// + /// + /// The key could not be exported. + /// + /// + ///

+ /// A PEM-encoded PKCS#8 PrivateKeyInfo will begin with -----BEGIN PRIVATE KEY----- + /// and end with -----END PRIVATE KEY-----, with the base64 encoded DER + /// contents of the key between the PEM boundaries. + ///

+ ///

+ /// The PEM is encoded according to the IETF RFC 7468 "strict" + /// encoding rules. + ///

+ ///
+ public bool TryExportPkcs8PrivateKeyPem(Span destination, out int charsWritten) + { + static bool Export(AsymmetricAlgorithm alg, Span destination, out int bytesWritten) + { + return alg.TryExportPkcs8PrivateKey(destination, out bytesWritten); + } + + return PemKeyHelpers.TryExportToPem( + this, + PemLabels.Pkcs8PrivateKey, + Export, + destination, + out charsWritten); + } + + /// + /// Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format + /// with a char-based password, PEM encoded. + /// + /// + /// The password to use when encrypting the key material. + /// + /// + /// The password-based encryption (PBE) parameters to use when encrypting the key material. + /// + /// + /// The character span to receive the PEM-encoded PKCS#8 EncryptedPrivateKeyInfo data. + /// + /// + /// When this method returns, contains a value that indicates the number + /// of characters written to . This + /// parameter is treated as uninitialized. + /// + /// + /// if is big enough + /// to receive the output; otherwise, . + /// + /// + /// An implementation for + /// has not been provided. + /// + /// + /// The key could not be exported. + /// + /// + ///

+ /// When indicates an algorithm that + /// uses PBKDF2 (Password-Based Key Derivation Function 2), the password + /// is converted to bytes via the UTF-8 encoding. + ///

+ ///

+ /// A PEM-encoded PKCS#8 EncryptedPrivateKeyInfo will begin with + /// -----BEGIN ENCRYPTED PRIVATE KEY----- and end with + /// -----END ENCRYPTED PRIVATE KEY-----, with the base64 encoded DER + /// contents of the key between the PEM boundaries. + ///

+ ///

+ /// The PEM is encoded according to the IETF RFC 7468 "strict" + /// encoding rules. + ///

+ ///
+ public bool TryExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan password, PbeParameters pbeParameters, Span destination, out int charsWritten) + { + static bool Export( + AsymmetricAlgorithm alg, + ReadOnlySpan password, + PbeParameters pbeParameters, + Span destination, + out int bytesWritten) + { + return alg.TryExportEncryptedPkcs8PrivateKey(password, pbeParameters, destination, out bytesWritten); + } + + return PemKeyHelpers.TryExportToEncryptedPem( + this, + password, + pbeParameters, + Export, + destination, + out charsWritten); + } private delegate bool TryExportPbe( ReadOnlySpan password, diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeDeformatter.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsymmetricKeyExchangeDeformatter.cs similarity index 87% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeDeformatter.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsymmetricKeyExchangeDeformatter.cs index 5065ae0a7c5dff..21836c6d9ce24e 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeDeformatter.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsymmetricKeyExchangeDeformatter.cs @@ -1,11 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Runtime.Versioning; - namespace System.Security.Cryptography { - [UnsupportedOSPlatform("browser")] public abstract class AsymmetricKeyExchangeDeformatter { protected AsymmetricKeyExchangeDeformatter() { } diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsymmetricKeyExchangeFormatter.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsymmetricKeyExchangeFormatter.cs index 8d883bc5aee80d..73750b20bfbcec 100644 --- a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsymmetricKeyExchangeFormatter.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsymmetricKeyExchangeFormatter.cs @@ -1,11 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Runtime.Versioning; - namespace System.Security.Cryptography { - [UnsupportedOSPlatform("browser")] public abstract class AsymmetricKeyExchangeFormatter { protected AsymmetricKeyExchangeFormatter() { } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricSignatureDeformatter.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsymmetricSignatureDeformatter.cs similarity index 89% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricSignatureDeformatter.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsymmetricSignatureDeformatter.cs index 1783303ea8d522..2cd815e66dec61 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricSignatureDeformatter.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsymmetricSignatureDeformatter.cs @@ -2,12 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; -using System.Runtime.Versioning; -using Internal.Cryptography; namespace System.Security.Cryptography { - [UnsupportedOSPlatform("browser")] public abstract class AsymmetricSignatureDeformatter { protected AsymmetricSignatureDeformatter() { } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricSignatureFormatter.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsymmetricSignatureFormatter.cs similarity index 89% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricSignatureFormatter.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsymmetricSignatureFormatter.cs index 95d0a92c763e3e..4fd2bd0869004e 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricSignatureFormatter.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AsymmetricSignatureFormatter.cs @@ -2,12 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; -using System.Runtime.Versioning; -using Internal.Cryptography; namespace System.Security.Cryptography { - [UnsupportedOSPlatform("browser")] public abstract class AsymmetricSignatureFormatter { protected AsymmetricSignatureFormatter() { } diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/Base64Transforms.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Base64Transforms.cs similarity index 96% rename from src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/Base64Transforms.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Base64Transforms.cs index 3dda623337f8b1..6ee832397df63b 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/Base64Transforms.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Base64Transforms.cs @@ -131,9 +131,7 @@ public int TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount, b { // inputCount != InputBlockSize is allowed ThrowHelper.ValidateTransformBlock(inputBuffer, inputOffset, inputCount); - - if (_inputBuffer == null) - ThrowHelper.ThrowObjectDisposed(); + ObjectDisposedException.ThrowIf(_inputBuffer == null, typeof(FromBase64Transform)); if (outputBuffer == null) ThrowHelper.ThrowArgumentNull(ThrowHelper.ExceptionArgument.outputBuffer); @@ -172,11 +170,7 @@ public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int input { // inputCount != InputBlockSize is allowed ThrowHelper.ValidateTransformBlock(inputBuffer, inputOffset, inputCount); - - if (_inputBuffer == null) - { - ThrowHelper.ThrowObjectDisposed(); - } + ObjectDisposedException.ThrowIf(_inputBuffer == null, typeof(FromBase64Transform)); if (inputCount == 0) { @@ -395,10 +389,6 @@ public static void ValidateTransformBlock(byte[] inputBuffer, int inputOffset, i [DoesNotReturn] public static void ThrowInvalidOffLen() => throw new ArgumentException(SR.Argument_InvalidOffLen); [DoesNotReturn] - public static void ThrowObjectDisposed() => throw new ObjectDisposedException(null, SR.ObjectDisposed_Generic); - [DoesNotReturn] - public static void ThrowCryptographicException() => throw new CryptographicException(SR.Cryptography_SSE_InvalidDataSize); - [DoesNotReturn] public static void ThrowBase64FormatException() => throw new FormatException(); public enum ExceptionArgument diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ChaCha20Poly1305.Android.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ChaCha20Poly1305.Android.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ChaCha20Poly1305.Android.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ChaCha20Poly1305.Android.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ChaCha20Poly1305.NotSupported.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ChaCha20Poly1305.NotSupported.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ChaCha20Poly1305.NotSupported.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ChaCha20Poly1305.NotSupported.cs index 05e4d39531f6e0..6e4c1536e66119 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ChaCha20Poly1305.NotSupported.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ChaCha20Poly1305.NotSupported.cs @@ -9,7 +9,6 @@ public partial class ChaCha20Poly1305 { public static bool IsSupported => false; -#if !BROWSER // allow GenFacades to handle browser target private void ImportKey(ReadOnlySpan key) { Debug.Fail("Instance ctor should fail before we reach this point."); @@ -43,6 +42,5 @@ public void Dispose() Debug.Fail("Instance ctor should fail before we reach this point."); // no-op } -#endif } } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ChaCha20Poly1305.Unix.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ChaCha20Poly1305.OpenSsl.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ChaCha20Poly1305.Unix.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ChaCha20Poly1305.OpenSsl.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ChaCha20Poly1305.Windows.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ChaCha20Poly1305.Windows.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ChaCha20Poly1305.Windows.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ChaCha20Poly1305.Windows.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ChaCha20Poly1305.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ChaCha20Poly1305.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ChaCha20Poly1305.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ChaCha20Poly1305.cs diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/CngAsnFormatter.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngAsnFormatter.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/CngAsnFormatter.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngAsnFormatter.cs index 47e30eee50251e..fe87ce89313d65 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/CngAsnFormatter.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngAsnFormatter.cs @@ -1,14 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Buffers; using System.Runtime.InteropServices; -using System.Security.Cryptography; -using Internal.NativeCrypto; - -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed class CngAsnFormatter : AsnFormatter { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CngKeyLite.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKeyLite.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CngKeyLite.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKeyLite.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CngPkcs8.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngPkcs8.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CngPkcs8.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngPkcs8.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CryptoConfig.Common.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CryptoConfig.Common.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CryptoConfig.Common.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CryptoConfig.Common.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CryptoConfig.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CryptoConfig.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CryptoConfig.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CryptoConfig.cs index baa5fa2d3db6a0..886bfb290731ec 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CryptoConfig.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CryptoConfig.cs @@ -13,6 +13,7 @@ namespace System.Security.Cryptography { public partial class CryptoConfig { +#if !BROWSER private const string AssemblyName_Cng = "System.Security.Cryptography.Cng"; private const string AssemblyName_Csp = "System.Security.Cryptography.Csp"; private const string AssemblyName_Pkcs = "System.Security.Cryptography.Pkcs"; @@ -299,10 +300,14 @@ private static Dictionary DefaultNameHT // string DpapiDataProtectorType = "System.Security.Cryptography.DpapiDataProtector, " + AssemblyRef.SystemSecurity; } } +#endif [UnsupportedOSPlatform("browser")] public static void AddAlgorithm(Type algorithm, params string[] names) { +#if BROWSER + throw new PlatformNotSupportedException(SR.SystemSecurityCryptography_PlatformNotSupported); +#else if (algorithm == null) throw new ArgumentNullException(nameof(algorithm)); if (!algorithm.IsVisible) @@ -328,6 +333,7 @@ public static void AddAlgorithm(Type algorithm, params string[] names) { appNameHT[name] = algorithm; } +#endif } [RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")] @@ -336,6 +342,32 @@ public static void AddAlgorithm(Type algorithm, params string[] names) if (name == null) throw new ArgumentNullException(nameof(name)); +#if BROWSER + switch (name) + { +#pragma warning disable SYSLIB0021 // Obsolete: derived cryptographic types + // hardcode mapping for SHA* algorithm names from https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.cryptoconfig?view=net-5.0#remarks + case "SHA": + case "SHA1": + case "System.Security.Cryptography.SHA1": + return new SHA1Managed(); + case "SHA256": + case "SHA-256": + case "System.Security.Cryptography.SHA256": + return new SHA256Managed(); + case "SHA384": + case "SHA-384": + case "System.Security.Cryptography.SHA384": + return new SHA384Managed(); + case "SHA512": + case "SHA-512": + case "System.Security.Cryptography.SHA512": + return new SHA512Managed(); +#pragma warning restore SYSLIB0021 + } + + return null; +#else // Check to see if we have an application defined mapping appNameHT.TryGetValue(name, out Type? retvalType); @@ -449,6 +481,7 @@ public static void AddAlgorithm(Type algorithm, params string[] names) } return retval; +#endif } [RequiresUnreferencedCode(CreateFromNameUnreferencedCodeMessage)] @@ -460,6 +493,9 @@ public static void AddAlgorithm(Type algorithm, params string[] names) [UnsupportedOSPlatform("browser")] public static void AddOID(string oid, params string[] names) { +#if BROWSER + throw new PlatformNotSupportedException(SR.SystemSecurityCryptography_PlatformNotSupported); +#else if (oid == null) throw new ArgumentNullException(nameof(oid)); if (names == null) @@ -483,11 +519,15 @@ public static void AddOID(string oid, params string[] names) { appOidHT[name] = oid; } +#endif } [UnsupportedOSPlatform("browser")] public static string? MapNameToOID(string name) { +#if BROWSER + throw new PlatformNotSupportedException(SR.SystemSecurityCryptography_PlatformNotSupported); +#else if (name == null) throw new ArgumentNullException(nameof(name)); @@ -504,12 +544,16 @@ public static void AddOID(string oid, params string[] names) } return oidName; +#endif } [UnsupportedOSPlatform("browser")] [Obsolete(Obsoletions.CryptoConfigEncodeOIDMessage, DiagnosticId = Obsoletions.CryptoConfigEncodeOIDDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public static byte[] EncodeOID(string str) { +#if BROWSER + throw new PlatformNotSupportedException(SR.SystemSecurityCryptography_PlatformNotSupported); +#else if (str == null) throw new ArgumentNullException(nameof(str)); @@ -555,8 +599,10 @@ public static byte[] EncodeOID(string str) encodedOidNums[1] = (byte)(encodedOidNumsIndex - 2); return encodedOidNums; +#endif } +#if !BROWSER private static void EncodeSingleOidNum(uint value, byte[]? destination, ref int index) { // Write directly to destination starting at index, and update index based on how many bytes written. @@ -636,5 +682,6 @@ private static void EncodeSingleOidNum(uint value, byte[]? destination, ref int } } } +#endif } } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DES.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DES.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DES.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DES.cs index 4f7be0a3944d6e..ebf918c65a4410 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DES.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DES.cs @@ -9,7 +9,6 @@ namespace System.Security.Cryptography { - [UnsupportedOSPlatform("browser")] [EditorBrowsable(EditorBrowsableState.Never)] public abstract class DES : SymmetricAlgorithm { @@ -22,6 +21,7 @@ protected DES() FeedbackSizeValue = BlockSizeValue; } + [UnsupportedOSPlatform("browser")] public static new DES Create() { return new DesImplementation(); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSA.Create.Android.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSA.Create.Android.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSA.Create.Android.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSA.Create.Android.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSA.Create.NotSupported.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSA.Create.NotSupported.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSA.Create.NotSupported.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSA.Create.NotSupported.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSA.Xml.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSA.Xml.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSA.Xml.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSA.Xml.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSA.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSA.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSA.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSA.cs index 1d28e7681b09bf..c19b7103384cc0 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSA.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSA.cs @@ -7,12 +7,10 @@ using System.Formats.Asn1; using System.IO; using System.Runtime.Versioning; -using System.Security.Cryptography.Asn1; using Internal.Cryptography; namespace System.Security.Cryptography { - [UnsupportedOSPlatform("browser")] public abstract partial class DSA : AsymmetricAlgorithm { // As of FIPS 186-4 the maximum Q size is 256 bits (32 bytes). @@ -35,6 +33,7 @@ protected DSA() { } return (DSA?)CryptoConfig.CreateFromName(algName); } + [UnsupportedOSPlatform("browser")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] public static new DSA Create() @@ -42,6 +41,7 @@ protected DSA() { } return CreateCore(); } + [UnsupportedOSPlatform("browser")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] public static DSA Create(int keySizeInBits) @@ -60,6 +60,7 @@ public static DSA Create(int keySizeInBits) } } + [UnsupportedOSPlatform("browser")] [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] public static DSA Create(DSAParameters parameters) @@ -1173,20 +1174,9 @@ public int GetMaxSignatureSize(DSASignatureFormat signatureFormat) /// public override void ImportFromPem(ReadOnlySpan input) { - PemKeyImportHelpers.ImportPem(input, label => { - if (label.SequenceEqual(PemLabels.Pkcs8PrivateKey)) - { - return ImportPkcs8PrivateKey; - } - else if (label.SequenceEqual(PemLabels.SpkiPublicKey)) - { - return ImportSubjectPublicKeyInfo; - } - else - { - return null; - } - }); + // Implementation has been pushed down to AsymmetricAlgorithm. The + // override remains for compatibility. + base.ImportFromPem(input); } /// @@ -1255,7 +1245,9 @@ public override void ImportFromPem(ReadOnlySpan input) /// public override void ImportFromEncryptedPem(ReadOnlySpan input, ReadOnlySpan password) { - PemKeyImportHelpers.ImportEncryptedPem(input, password, ImportEncryptedPkcs8PrivateKey); + // Implementation has been pushed down to AsymmetricAlgorithm. The + // override remains for compatibility. + base.ImportFromEncryptedPem(input, password); } /// @@ -1325,7 +1317,9 @@ public override void ImportFromEncryptedPem(ReadOnlySpan input, ReadOnlySp /// public override void ImportFromEncryptedPem(ReadOnlySpan input, ReadOnlySpan passwordBytes) { - PemKeyImportHelpers.ImportEncryptedPem(input, passwordBytes, ImportEncryptedPkcs8PrivateKey); + // Implementation has been pushed down to AsymmetricAlgorithm. The + // override remains for compatibility. + base.ImportFromEncryptedPem(input, passwordBytes); } } } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSACng.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSACng.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSACng.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSACng.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSAParameters.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSAParameters.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSAParameters.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSAParameters.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSASignatureDeformatter.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSASignatureDeformatter.cs similarity index 92% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSASignatureDeformatter.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSASignatureDeformatter.cs index b2fb1ee1da41b9..8bc3023057a26a 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSASignatureDeformatter.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSASignatureDeformatter.cs @@ -1,12 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Runtime.Versioning; -using Internal.Cryptography; - namespace System.Security.Cryptography { - [UnsupportedOSPlatform("browser")] public class DSASignatureDeformatter : AsymmetricSignatureDeformatter { private DSA? _dsaKey; @@ -45,7 +41,7 @@ public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature) if (rgbSignature == null) throw new ArgumentNullException(nameof(rgbSignature)); if (_dsaKey == null) - throw new CryptographicUnexpectedOperationException(SR.Cryptography_MissingKey); + throw new CryptographicUnexpectedOperationException(SR.Cryptography_FormatterMissingKey); return _dsaKey.VerifySignature(rgbHash, rgbSignature); } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSASignatureFormat.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSASignatureFormat.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSASignatureFormat.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSASignatureFormat.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSASignatureFormatter.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSASignatureFormatter.cs similarity index 91% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSASignatureFormatter.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSASignatureFormatter.cs index f6f5bf3f4283a5..9e2a9ef0aa376a 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSASignatureFormatter.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSASignatureFormatter.cs @@ -1,12 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Runtime.Versioning; -using Internal.Cryptography; - namespace System.Security.Cryptography { - [UnsupportedOSPlatform("browser")] public class DSASignatureFormatter : AsymmetricSignatureFormatter { private DSA? _dsaKey; @@ -43,7 +39,7 @@ public override byte[] CreateSignature(byte[] rgbHash) if (rgbHash == null) throw new ArgumentNullException(nameof(rgbHash)); if (_dsaKey == null) - throw new CryptographicUnexpectedOperationException(SR.Cryptography_MissingKey); + throw new CryptographicUnexpectedOperationException(SR.Cryptography_FormatterMissingKey); return _dsaKey.CreateSignature(rgbHash); } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DeriveBytes.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DeriveBytes.cs similarity index 87% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DeriveBytes.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DeriveBytes.cs index f1036945dc5e86..a75a250f32ecfb 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DeriveBytes.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DeriveBytes.cs @@ -1,11 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Runtime.Versioning; - namespace System.Security.Cryptography { - [UnsupportedOSPlatform("browser")] public abstract class DeriveBytes : IDisposable { public abstract byte[] GetBytes(int cb); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.Android.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DesImplementation.Android.cs similarity index 94% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.Android.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DesImplementation.Android.cs index 2e335992252383..fabe9105200325 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.Android.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DesImplementation.Android.cs @@ -1,11 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Diagnostics; -using System.Security.Cryptography; +using Internal.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed partial class DesImplementation { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.OSX.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DesImplementation.Apple.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.OSX.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DesImplementation.Apple.cs index 2b99a07adc1310..2ee2586941ab61 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.OSX.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DesImplementation.Apple.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Security.Cryptography; +using Internal.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed partial class DesImplementation { diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DesImplementation.NotSupported.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DesImplementation.NotSupported.cs new file mode 100644 index 00000000000000..22964d37cebd86 --- /dev/null +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DesImplementation.NotSupported.cs @@ -0,0 +1,36 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Internal.Cryptography; + +namespace System.Security.Cryptography +{ + internal sealed partial class DesImplementation : DES + { + private static UniversalCryptoTransform CreateTransformCore( + CipherMode cipherMode, + PaddingMode paddingMode, + byte[] key, + byte[]? iv, + int blockSize, + int feedbackSizeInBytes, + int paddingSize, + bool encrypting) + { + throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(DES))); + } + + private static ILiteSymmetricCipher CreateLiteCipher( + CipherMode cipherMode, + PaddingMode paddingMode, + ReadOnlySpan key, + ReadOnlySpan iv, + int blockSize, + int feedbackSizeInBytes, + int paddingSize, + bool encrypting) + { + throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(DES))); + } + } +} diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.Unix.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DesImplementation.OpenSsl.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.Unix.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DesImplementation.OpenSsl.cs index b22a1da6cf18ab..6320601afeab52 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.Unix.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DesImplementation.OpenSsl.cs @@ -1,11 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Diagnostics; -using System.Security.Cryptography; +using Internal.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed partial class DesImplementation { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.Windows.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DesImplementation.Windows.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.Windows.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DesImplementation.Windows.cs index b3bf43ea3440de..39447249767ddb 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.Windows.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DesImplementation.Windows.cs @@ -1,11 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Security.Cryptography; +using Internal.Cryptography; using Internal.NativeCrypto; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed partial class DesImplementation { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DesImplementation.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DesImplementation.cs index 396f451f1b6a88..d22e7d79725f7c 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DesImplementation.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Security.Cryptography; +using Internal.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA5350", Justification = "We are providing the implementation for DES, not consuming it.")] internal sealed partial class DesImplementation : DES diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECAlgorithm.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECAlgorithm.cs new file mode 100644 index 00000000000000..d5c34e18d9fb01 --- /dev/null +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECAlgorithm.cs @@ -0,0 +1,948 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Internal.Cryptography; +using System.Formats.Asn1; +using System.Security.Cryptography.Asn1; + +namespace System.Security.Cryptography +{ + /// + /// Represents the abstract class from which elliptic-curve asymmetric + /// algorithms can inherit from. + /// + public abstract class ECAlgorithm : AsymmetricAlgorithm + { + private static readonly string[] s_validOids = + { + Oids.EcPublicKey, + // ECDH and ECMQV are not valid in this context. + }; + + /// + /// When overridden in a derived class, exports the named or explicit for an ECCurve. + /// If the curve has a name, the Curve property will contain named curve parameters otherwise it will contain explicit parameters. + /// + /// + /// to include private parameters, otherwise, . + /// + /// + /// A derived class has not provided an implementation. + /// + /// The exported parameters. + public virtual ECParameters ExportParameters(bool includePrivateParameters) + { + throw new NotSupportedException(SR.NotSupported_SubclassOverride); + } + + /// + /// When overridden in a derived class, exports the explicit for an ECCurve. + /// + /// + /// to include private parameters, otherwise, . + /// + /// + /// A derived class has not provided an implementation. + /// + /// The exported explicit parameters. + public virtual ECParameters ExportExplicitParameters(bool includePrivateParameters) + { + throw new NotSupportedException(SR.NotSupported_SubclassOverride); + } + + /// + /// When overridden in a derived class, imports the specified . + /// + /// The curve parameters. + /// + /// A derived class has not provided an implementation. + /// + public virtual void ImportParameters(ECParameters parameters) + { + throw new NotSupportedException(SR.NotSupported_SubclassOverride); + } + + /// + /// When overridden in a derived class, generates a new public/private keypair for the specified curve. + /// + /// The curve to use. + /// + /// A derived class has not provided an implementation. + /// + public virtual void GenerateKey(ECCurve curve) + { + throw new NotSupportedException(SR.NotSupported_SubclassOverride); + } + + /// + /// Attempts to export the current key in the PKCS#8 EncryptedPrivateKeyInfo + /// format into a provided buffer, using a byte-based password. + /// + /// + /// The bytes to use as a password when encrypting the key material. + /// + /// + /// The password-based encryption (PBE) parameters to use when encrypting + /// the key material. + /// + /// + /// The byte span to receive the PKCS#8 EncryptedPrivateKeyInfo data. + /// + /// + /// When this method returns, contains a value that indicates the number + /// of bytes written to . This parameter + /// is treated as uninitialized. + /// + /// + /// if is big enough + /// to receive the output; otherwise, . + /// + /// + /// is . + /// + /// + /// A derived class has not provided an implementation for . + /// + /// + ///

+ /// The key could not be exported. + ///

+ ///

-or-

+ ///

+ /// indicates that + /// should be used, which requires -based passwords. + ///

+ ///
+ /// + /// The password bytes are passed directly into the Key Derivation Function (KDF) + /// used by the algorithm indicated by . This + /// enables compatibility with other systems which use a text encoding other than + /// UTF-8 when processing passwords with PBKDF2 (Password-Based Key Derivation Function 2). + /// + public override unsafe bool TryExportEncryptedPkcs8PrivateKey( + ReadOnlySpan passwordBytes, + PbeParameters pbeParameters, + Span destination, + out int bytesWritten) + { + if (pbeParameters is null) + throw new ArgumentNullException(nameof(pbeParameters)); + + PasswordBasedEncryption.ValidatePbeParameters( + pbeParameters, + ReadOnlySpan.Empty, + passwordBytes); + + ECParameters ecParameters = ExportParameters(true); + + fixed (byte* privPtr = ecParameters.D) + { + try + { + AsnWriter pkcs8PrivateKey = EccKeyFormatHelper.WritePkcs8PrivateKey(ecParameters); + + AsnWriter writer = KeyFormatHelper.WriteEncryptedPkcs8( + passwordBytes, + pkcs8PrivateKey, + pbeParameters); + + return writer.TryEncode(destination, out bytesWritten); + } + finally + { + CryptographicOperations.ZeroMemory(ecParameters.D); + } + } + } + + /// + /// Attempts to export the current key in the PKCS#8 EncryptedPrivateKeyInfo + /// format into a provided buffer, using a char-based password. + /// + /// + /// The password to use when encrypting the key material. + /// + /// + /// The password-based encryption (PBE) parameters to use when encrypting + /// the key material. + /// + /// + /// The byte span to receive the PKCS#8 EncryptedPrivateKeyInfo data. + /// + /// + /// When this method returns, contains a value that indicates the number + /// of bytes written to . This parameter + /// is treated as uninitialized. + /// + /// + /// if is big enough + /// to receive the output; otherwise, . + /// + /// + /// is . + /// + /// + /// A derived class has not provided an implementation for . + /// + /// + /// The key could not be exported. + /// + /// + /// When indicates an algorithm that uses PBKDF2 + /// (Password-Based Key Derivation Function 2), the password is converted + /// to bytes via the UTF-8 encoding. + /// + public override unsafe bool TryExportEncryptedPkcs8PrivateKey( + ReadOnlySpan password, + PbeParameters pbeParameters, + Span destination, + out int bytesWritten) + { + if (pbeParameters == null) + throw new ArgumentNullException(nameof(pbeParameters)); + + PasswordBasedEncryption.ValidatePbeParameters( + pbeParameters, + password, + ReadOnlySpan.Empty); + + ECParameters ecParameters = ExportParameters(true); + + fixed (byte* privPtr = ecParameters.D) + { + try + { + AsnWriter pkcs8PrivateKey = EccKeyFormatHelper.WritePkcs8PrivateKey(ecParameters); + + AsnWriter writer = KeyFormatHelper.WriteEncryptedPkcs8( + password, + pkcs8PrivateKey, + pbeParameters); + + return writer.TryEncode(destination, out bytesWritten); + } + finally + { + CryptographicOperations.ZeroMemory(ecParameters.D); + } + } + } + + /// + /// Attempts to export the current key in the PKCS#8 PrivateKeyInfo format + /// into a provided buffer. + /// + /// The byte span to receive the PKCS#8 PrivateKeyInfo data. + /// + /// When this method returns, contains a value that indicates the number + /// of bytes written to . This parameter + /// is treated as uninitialized. + /// + /// + /// if is big enough + /// to receive the output; otherwise, . + /// + /// + /// The key could not be exported. + /// + /// + /// A derived class has not provided an implementation for . + /// + public override unsafe bool TryExportPkcs8PrivateKey( + Span destination, + out int bytesWritten) + { + ECParameters ecParameters = ExportParameters(true); + + fixed (byte* privPtr = ecParameters.D) + { + try + { + AsnWriter writer = EccKeyFormatHelper.WritePkcs8PrivateKey(ecParameters); + return writer.TryEncode(destination, out bytesWritten); + } + finally + { + CryptographicOperations.ZeroMemory(ecParameters.D); + } + } + } + + /// + /// Attempts to export the current key in the X.509 SubjectPublicKeyInfo + /// format into a provided buffer. + /// + /// The byte span to receive the X.509 SubjectPublicKeyInfo data. + /// + /// When this method returns, contains a value + /// that indicates the number of bytes written to . + /// This parameter is treated as uninitialized. + /// + /// + /// if is big enough + /// to receive the output; otherwise, . + /// + /// + /// The key could not be exported. + /// + /// + /// A derived class has not provided an implementation for . + /// + public override bool TryExportSubjectPublicKeyInfo( + Span destination, + out int bytesWritten) + { + ECParameters ecParameters = ExportParameters(false); + + AsnWriter writer = EccKeyFormatHelper.WriteSubjectPublicKeyInfo(ecParameters); + return writer.TryEncode(destination, out bytesWritten); + } + + /// + /// Imports the public/private keypair from a PKCS#8 EncryptedPrivateKeyInfo + /// structure after decrypting with a byte-based password, replacing the + /// keys for this object. + /// + /// The bytes to use as a password when decrypting the key material. + /// + /// The bytes of a PKCS#8 EncryptedPrivateKeyInfo structure in the ASN.1-BER encoding. + /// + /// + /// When this method returns, contains a value that indicates the number + /// of bytes read from . This parameter is treated as uninitialized. + /// + /// + ///

The password is incorrect.

+ ///

-or-

+ ///

+ /// The contents of indicate the Key Derivation Function (KDF) + /// to apply is the legacy PKCS#12 KDF, which requires -based passwords. + ///

+ ///

-or-

+ ///

+ /// The contents of do not represent an + /// ASN.1-BER-encoded PKCS#8 EncryptedPrivateKeyInfo structure. + ///

+ ///

-or-

+ ///

+ /// The contents of indicate the key is for + /// an algorithm other than the algorithm represented by this instance. + ///

+ ///

-or-

+ ///

+ /// The contents of represent the key in a format + /// that is not supported. + ///

+ ///

-or-

+ ///

The algorithm-specific key import failed.

+ ///
+ /// + /// A derived class has not provided an implementation for . + /// + /// + ///

+ /// The password bytes are passed directly into the Key Derivation Function (KDF) + /// used by the algorithm indicated by the EncryptedPrivateKeyInfo contents. + /// This enables compatibility with other systems which use a text encoding + /// other than UTF-8 when processing passwords with PBKDF2 (Password-Based Key Derivation Function 2). + ///

+ ///

+ /// This method only supports the binary (BER/CER/DER) encoding of EncryptedPrivateKeyInfo. + /// If the value is Base64-encoded, the caller must Base64-decode the contents before calling this method. + /// If the contents are PEM-encoded, + /// should be used. + ///

+ ///
+ public override unsafe void ImportEncryptedPkcs8PrivateKey( + ReadOnlySpan passwordBytes, + ReadOnlySpan source, + out int bytesRead) + { + KeyFormatHelper.ReadEncryptedPkcs8( + s_validOids, + source, + passwordBytes, + EccKeyFormatHelper.FromECPrivateKey, + out int localRead, + out ECParameters ret); + + fixed (byte* privPin = ret.D) + { + try + { + ImportParameters(ret); + bytesRead = localRead; + } + finally + { + CryptographicOperations.ZeroMemory(ret.D); + } + } + } + + /// + /// Imports the public/private keypair from a PKCS#8 EncryptedPrivateKeyInfo + /// structure after decrypting with a byte-based password, replacing the + /// keys for this object. + /// + /// The password to use when decrypting the key material. + /// + /// The bytes of a PKCS#8 EncryptedPrivateKeyInfo structure in the ASN.1-BER encoding. + /// + /// + /// When this method returns, contains a value that indicates the number + /// of bytes read from . This parameter is treated as uninitialized. + /// + /// + ///

+ /// The contents of do not represent an + /// ASN.1-BER-encoded PKCS#8 EncryptedPrivateKeyInfo structure. + ///

+ ///

-or-

+ ///

+ /// The contents of indicate the key is for + /// an algorithm other than the algorithm represented by this instance. + ///

+ ///

-or-

+ ///

+ /// The contents of represent the key in a format + /// that is not supported. + ///

+ ///

-or-

+ ///

The algorithm-specific key import failed.

+ ///
+ /// + /// A derived class has not provided an implementation for . + /// + /// + ///

+ /// When the contents of indicate an algorithm that uses PBKDF1 + /// (Password-Based Key Derivation Function 1) or PBKDF2 (Password-Based Key Derivation Function 2), + /// the password is converted to bytes via the UTF-8 encoding. + ///

+ ///

+ /// This method only supports the binary (BER/CER/DER) encoding of EncryptedPrivateKeyInfo. + /// If the value is Base64-encoded, the caller must Base64-decode the contents before calling this method. + /// If the contents are PEM-encoded, + /// should be used. + ///

+ ///
+ public override unsafe void ImportEncryptedPkcs8PrivateKey( + ReadOnlySpan password, + ReadOnlySpan source, + out int bytesRead) + { + KeyFormatHelper.ReadEncryptedPkcs8( + s_validOids, + source, + password, + EccKeyFormatHelper.FromECPrivateKey, + out int localRead, + out ECParameters ret); + + fixed (byte* privPin = ret.D) + { + try + { + ImportParameters(ret); + bytesRead = localRead; + } + finally + { + CryptographicOperations.ZeroMemory(ret.D); + } + } + } + + /// + /// Imports the public/private keypair from a PKCS#8 PrivateKeyInfo structure + /// after decryption, replacing the keys for this object. + /// + /// The bytes of a PKCS#8 PrivateKeyInfo structure in the ASN.1-BER encoding. + /// + /// When this method returns, contains a value that indicates the number + /// of bytes read from . This parameter is treated as uninitialized. + /// + /// + /// A derived class has not provided an implementation for . + /// + /// + ///

+ /// The contents of do not represent an ASN.1-BER-encoded + /// PKCS#8 PrivateKeyInfo structure. + ///

+ ///

-or-

+ ///

+ /// The contents of indicate the key is for an algorithm + /// other than the algorithm represented by this instance. + ///

+ ///

-or-

+ ///

The contents of represent the key in a format that is not supported.

+ ///

-or-

+ ///

+ /// The algorithm-specific key import failed. + ///

+ ///
+ /// + /// This method only supports the binary (BER/CER/DER) encoding of PrivateKeyInfo. + /// If the value is Base64-encoded, the caller must Base64-decode the contents before calling this method. + /// If the value is PEM-encoded, should be used. + /// + public override unsafe void ImportPkcs8PrivateKey( + ReadOnlySpan source, + out int bytesRead) + { + KeyFormatHelper.ReadPkcs8( + s_validOids, + source, + EccKeyFormatHelper.FromECPrivateKey, + out int localRead, + out ECParameters key); + + fixed (byte* privPin = key.D) + { + try + { + ImportParameters(key); + bytesRead = localRead; + } + finally + { + CryptographicOperations.ZeroMemory(key.D); + } + } + } + + /// + /// Imports the public key from an X.509 SubjectPublicKeyInfo structure after decryption, + /// replacing the keys for this object + /// + /// The bytes of an X.509 SubjectPublicKeyInfo structure in the ASN.1-DER encoding. + /// + /// When this method returns, contains a value that indicates the number + /// of bytes read from . This parameter is treated as uninitialized. + /// + /// + /// A derived class has not provided an implementation for . + /// + /// + ///

+ /// The contents of do not represent an + /// ASN.1-DER-encoded X.509 SubjectPublicKeyInfo structure. + ///

+ ///

-or-

+ ///

+ /// The contents of indicate the key is for an algorithm + /// other than the algorithm represented by this instance. + ///

+ ///

-or-

+ ///

+ /// The contents of represent the key in a format that is not supported. + ///

+ ///

-or-

+ ///

The algorithm-specific key import failed.

+ ///
+ /// + /// This method only supports the binary (DER) encoding of SubjectPublicKeyInfo. + /// If the value is Base64-encoded, the caller must Base64-decode the contents before calling this method. + /// If this value is PEM-encoded, should be used. + /// + public override void ImportSubjectPublicKeyInfo( + ReadOnlySpan source, + out int bytesRead) + { + KeyFormatHelper.ReadSubjectPublicKeyInfo( + s_validOids, + source, + EccKeyFormatHelper.FromECPublicKey, + out int localRead, + out ECParameters key); + + ImportParameters(key); + bytesRead = localRead; + } + + /// + /// Imports the public/private keypair from an ECPrivateKey structure, + /// replacing the keys for this object. + /// + /// The bytes of an ECPrivateKey structure in the ASN.1-BER encoding. + /// + /// When this method returns, contains a value that indicates the number + /// of bytes read from . This parameter is treated as uninitialized. + /// + /// + /// A derived class has not provided an implementation for . + /// + /// + ///

+ /// The contents of do not represent an + /// ASN.1-BER-encoded PKCS#8 ECPrivateKey structure. + ///

+ ///

-or-

+ ///

The key import failed.

+ ///
+ /// + /// This method only supports the binary (BER/CER/DER) encoding of ECPrivateKey. + /// If the value is Base64-encoded, the caller must Base64-decode the contents before calling this method. + /// If the value is PEM-encoded, should be used. + /// + public virtual unsafe void ImportECPrivateKey(ReadOnlySpan source, out int bytesRead) + { + ECParameters ecParameters = EccKeyFormatHelper.FromECPrivateKey(source, out int localRead); + + fixed (byte* privPin = ecParameters.D) + { + try + { + ImportParameters(ecParameters); + bytesRead = localRead; + } + finally + { + CryptographicOperations.ZeroMemory(ecParameters.D); + } + } + } + + /// Exports the current key in the ECPrivateKey format. + /// A byte array containing the ECPrivateKey representation of this key. + /// The key could not be exported. + public virtual unsafe byte[] ExportECPrivateKey() + { + ECParameters ecParameters = ExportParameters(true); + + fixed (byte* privPin = ecParameters.D) + { + try + { + AsnWriter writer = EccKeyFormatHelper.WriteECPrivateKey(ecParameters); + return writer.Encode(); + } + finally + { + CryptographicOperations.ZeroMemory(ecParameters.D); + } + } + } + + /// + /// Attempts to export the current key in the ECPrivateKey format into a provided buffer. + /// + /// The byte span to receive the ECPrivateKey data. + /// When this method returns, contains a value + /// that indicates the number of bytes written to . + /// This parameter is treated as uninitialized. + /// + /// + /// if is big enough + /// to receive the output; otherwise, . + /// + /// + /// The key could not be exported. + /// + /// + /// A derived class has not provided an implementation for . + /// + public virtual unsafe bool TryExportECPrivateKey(Span destination, out int bytesWritten) + { + ECParameters ecParameters = ExportParameters(true); + + fixed (byte* privPin = ecParameters.D) + { + try + { + AsnWriter writer = EccKeyFormatHelper.WriteECPrivateKey(ecParameters); + return writer.TryEncode(destination, out bytesWritten); + } + finally + { + CryptographicOperations.ZeroMemory(ecParameters.D); + } + } + } + + /// + /// Imports an RFC 7468 PEM-encoded key, replacing the keys for this object. + /// + /// The PEM text of the key to import. + /// + /// + /// does not contain a PEM-encoded key with a recognized label. + /// + /// + /// -or- + /// + /// + /// contains multiple PEM-encoded keys with a recognized label. + /// + /// + /// -or- + /// + /// + /// contains an encrypted PEM-encoded key. + /// + /// + /// + /// + /// Unsupported or malformed PEM-encoded objects will be ignored. If multiple supported PEM labels + /// are found, an exception is raised to prevent importing a key when + /// the key is ambiguous. + /// + /// + /// This method supports the following PEM labels: + /// + /// PUBLIC KEY + /// PRIVATE KEY + /// EC PRIVATE KEY + /// + /// + /// + public override void ImportFromPem(ReadOnlySpan input) + { + PemKeyHelpers.ImportPem(input, label => { + if (label.SequenceEqual(PemLabels.Pkcs8PrivateKey)) + { + return ImportPkcs8PrivateKey; + } + else if (label.SequenceEqual(PemLabels.SpkiPublicKey)) + { + return ImportSubjectPublicKeyInfo; + } + else if (label.SequenceEqual(PemLabels.EcPrivateKey)) + { + return ImportECPrivateKey; + } + else + { + return null; + } + }); + } + + /// + /// Imports an encrypted RFC 7468 PEM-encoded private key, replacing the keys for this object. + /// + /// The PEM text of the encrypted key to import. + /// + /// The password to use for decrypting the key material. + /// + /// + /// + /// does not contain a PEM-encoded key with a recognized label. + /// + /// + /// -or- + /// + /// + /// contains multiple PEM-encoded keys with a recognized label. + /// + /// + /// + /// + /// The password is incorrect. + /// + /// + /// -or- + /// + /// + /// The base-64 decoded contents of the PEM text from + /// do not represent an ASN.1-BER-encoded PKCS#8 EncryptedPrivateKeyInfo structure. + /// + /// + /// -or- + /// + /// + /// The base-64 decoded contents of the PEM text from + /// indicate the key is for an algorithm other than the algorithm + /// represented by this instance. + /// + /// + /// -or- + /// + /// + /// The base-64 decoded contents of the PEM text from + /// represent the key in a format that is not supported. + /// + /// + /// -or- + /// + /// + /// The algorithm-specific key import failed. + /// + /// + /// + /// + /// When the base-64 decoded contents of indicate an algorithm that uses PBKDF1 + /// (Password-Based Key Derivation Function 1) or PBKDF2 (Password-Based Key Derivation Function 2), + /// the password is converted to bytes via the UTF-8 encoding. + /// + /// + /// Unsupported or malformed PEM-encoded objects will be ignored. If multiple supported PEM labels + /// are found, an exception is thrown to prevent importing a key when + /// the key is ambiguous. + /// + /// This method supports the ENCRYPTED PRIVATE KEY PEM label. + /// + public override void ImportFromEncryptedPem(ReadOnlySpan input, ReadOnlySpan password) + { + // Implementation has been pushed down to AsymmetricAlgorithm. The + // override remains for compatibility. + base.ImportFromEncryptedPem(input, password); + } + + /// + /// Imports an encrypted RFC 7468 PEM-encoded private key, replacing the keys for this object. + /// + /// The PEM text of the encrypted key to import. + /// + /// The bytes to use as a password when decrypting the key material. + /// + /// + /// + /// does not contain a PEM-encoded key with a recognized label. + /// + /// + /// -or- + /// + /// + /// contains multiple PEM-encoded keys with a recognized label. + /// + /// + /// + /// + /// The password is incorrect. + /// + /// + /// -or- + /// + /// + /// The base-64 decoded contents of the PEM text from + /// do not represent an ASN.1-BER-encoded PKCS#8 EncryptedPrivateKeyInfo structure. + /// + /// + /// -or- + /// + /// + /// The base-64 decoded contents of the PEM text from + /// indicate the key is for an algorithm other than the algorithm + /// represented by this instance. + /// + /// + /// -or- + /// + /// + /// The base-64 decoded contents of the PEM text from + /// represent the key in a format that is not supported. + /// + /// + /// -or- + /// + /// + /// The algorithm-specific key import failed. + /// + /// + /// + /// + /// The password bytes are passed directly into the Key Derivation Function (KDF) + /// used by the algorithm indicated by pbeParameters. This enables compatibility + /// with other systems which use a text encoding other than UTF-8 when processing + /// passwords with PBKDF2 (Password-Based Key Derivation Function 2). + /// + /// + /// Unsupported or malformed PEM-encoded objects will be ignored. If multiple supported PEM labels + /// are found, an exception is thrown to prevent importing a key when + /// the key is ambiguous. + /// + /// This method supports the ENCRYPTED PRIVATE KEY PEM label. + /// + public override void ImportFromEncryptedPem(ReadOnlySpan input, ReadOnlySpan passwordBytes) + { + // Implementation has been pushed down to AsymmetricAlgorithm. The + // override remains for compatibility. + base.ImportFromEncryptedPem(input, passwordBytes); + } + + /// + /// Exports the current key in the ECPrivateKey format, PEM encoded. + /// + /// A string containing the PEM-encoded ECPrivateKey. + /// + /// The key could not be exported. + /// + /// + ///

+ /// A PEM-encoded ECPrivateKey will begin with -----BEGIN EC PRIVATE KEY----- + /// and end with -----END EC PRIVATE KEY-----, with the base64 encoded DER + /// contents of the key between the PEM boundaries. + ///

+ ///

+ /// The PEM is encoded according to the IETF RFC 7468 "strict" + /// encoding rules. + ///

+ ///
+ public unsafe string ExportECPrivateKeyPem() + { + byte[] exported = ExportECPrivateKey(); + + // Fixed to prevent GC moves. + fixed (byte* pExported = exported) + { + try + { + return PemKeyHelpers.CreatePemFromData(PemLabels.EcPrivateKey, exported); + } + finally + { + CryptographicOperations.ZeroMemory(exported); + } + } + } + + /// + /// Attempts to export the current key in the PEM-encoded + /// ECPrivateKey format into a provided buffer. + /// + /// + /// The character span to receive the PEM-encoded ECPrivateKey data. + /// + /// + /// When this method returns, contains a value that indicates the number + /// of characters written to . This + /// parameter is treated as uninitialized. + /// + /// + /// if is big enough + /// to receive the output; otherwise, . + /// + /// + /// The key could not be exported. + /// + /// + ///

+ /// A PEM-encoded ECPrivateKey will begin with + /// -----BEGIN EC PRIVATE KEY----- and end with + /// -----END EC PRIVATE KEY-----, with the base64 encoded DER + /// contents of the key between the PEM boundaries. + ///

+ ///

+ /// The PEM is encoded according to the IETF RFC 7468 "strict" + /// encoding rules. + ///

+ ///
+ public bool TryExportECPrivateKeyPem(Span destination, out int charsWritten) + { + static bool Export(ECAlgorithm alg, Span destination, out int bytesWritten) + { + return alg.TryExportECPrivateKey(destination, out bytesWritten); + } + + return PemKeyHelpers.TryExportToPem( + this, + PemLabels.EcPrivateKey, + Export, + destination, + out charsWritten); + } + } +} diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECCngKey.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECCngKey.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECCngKey.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECCngKey.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECCurve.ECCurveType.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECCurve.ECCurveType.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECCurve.ECCurveType.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECCurve.ECCurveType.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECCurve.NamedCurves.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECCurve.NamedCurves.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECCurve.NamedCurves.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECCurve.NamedCurves.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECCurve.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECCurve.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECCurve.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECCurve.cs index 11de2e1cfd62a4..a14e816f799df6 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECCurve.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECCurve.cs @@ -14,7 +14,6 @@ namespace System.Security.Cryptography /// which is either a prime curve or a characteristic-2 curve. /// [DebuggerDisplay("ECCurve: {Oid}")] - [UnsupportedOSPlatform("browser")] public partial struct ECCurve { /// diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.Create.Android.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.Create.Android.cs similarity index 73% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.Create.Android.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.Create.Android.cs index 0ec4bd325a6d96..ffc16ab1e68ea7 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.Create.Android.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.Create.Android.cs @@ -3,19 +3,19 @@ namespace System.Security.Cryptography { - public abstract partial class ECDiffieHellman : AsymmetricAlgorithm + public abstract partial class ECDiffieHellman : ECAlgorithm { - public static new ECDiffieHellman Create() + public static new partial ECDiffieHellman Create() { return new ECDiffieHellmanImplementation.ECDiffieHellmanAndroid(); } - public static ECDiffieHellman Create(ECCurve curve) + public static partial ECDiffieHellman Create(ECCurve curve) { return new ECDiffieHellmanImplementation.ECDiffieHellmanAndroid(curve); } - public static ECDiffieHellman Create(ECParameters parameters) + public static partial ECDiffieHellman Create(ECParameters parameters) { ECDiffieHellman ecdh = new ECDiffieHellmanImplementation.ECDiffieHellmanAndroid(); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.Create.Cng.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.Create.Cng.cs similarity index 72% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.Create.Cng.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.Create.Cng.cs index c0d24574ef64d1..d8d4782ef63fb0 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.Create.Cng.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.Create.Cng.cs @@ -3,19 +3,19 @@ namespace System.Security.Cryptography { - public abstract partial class ECDiffieHellman : AsymmetricAlgorithm + public abstract partial class ECDiffieHellman : ECAlgorithm { - public static new ECDiffieHellman Create() + public static new partial ECDiffieHellman Create() { return new ECDiffieHellmanImplementation.ECDiffieHellmanCng(); } - public static ECDiffieHellman Create(ECCurve curve) + public static partial ECDiffieHellman Create(ECCurve curve) { return new ECDiffieHellmanImplementation.ECDiffieHellmanCng(curve); } - public static ECDiffieHellman Create(ECParameters parameters) + public static partial ECDiffieHellman Create(ECParameters parameters) { ECDiffieHellman ecdh = new ECDiffieHellmanImplementation.ECDiffieHellmanCng(); diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.Create.NotSupported.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.Create.NotSupported.cs new file mode 100644 index 00000000000000..6a8af2a4e336f9 --- /dev/null +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.Create.NotSupported.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Security.Cryptography +{ + public partial class ECDiffieHellman : ECAlgorithm + { + public static new partial ECDiffieHellman Create() + { + throw new PlatformNotSupportedException(); + } + + public static partial ECDiffieHellman Create(ECCurve curve) + { + throw new PlatformNotSupportedException(); + } + + public static partial ECDiffieHellman Create(ECParameters parameters) + { + throw new PlatformNotSupportedException(); + } + } +} diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.Create.OpenSsl.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.Create.OpenSsl.cs similarity index 73% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.Create.OpenSsl.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.Create.OpenSsl.cs index 1f9a60c9764a7b..1fa4161fa7f138 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.Create.OpenSsl.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.Create.OpenSsl.cs @@ -3,19 +3,19 @@ namespace System.Security.Cryptography { - public abstract partial class ECDiffieHellman : AsymmetricAlgorithm + public abstract partial class ECDiffieHellman : ECAlgorithm { - public static new ECDiffieHellman Create() + public static new partial ECDiffieHellman Create() { return new ECDiffieHellmanImplementation.ECDiffieHellmanOpenSsl(); } - public static ECDiffieHellman Create(ECCurve curve) + public static partial ECDiffieHellman Create(ECCurve curve) { return new ECDiffieHellmanImplementation.ECDiffieHellmanOpenSsl(curve); } - public static ECDiffieHellman Create(ECParameters parameters) + public static partial ECDiffieHellman Create(ECParameters parameters) { ECDiffieHellman ecdh = new ECDiffieHellmanImplementation.ECDiffieHellmanOpenSsl(); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.Create.SecurityTransforms.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.Create.SecurityTransforms.cs similarity index 76% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.Create.SecurityTransforms.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.Create.SecurityTransforms.cs index 855f2f46f1bee0..b7e4db2aba097c 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.Create.SecurityTransforms.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.Create.SecurityTransforms.cs @@ -3,14 +3,14 @@ namespace System.Security.Cryptography { - public abstract partial class ECDiffieHellman : AsymmetricAlgorithm + public abstract partial class ECDiffieHellman : ECAlgorithm { - public static new ECDiffieHellman Create() + public static new partial ECDiffieHellman Create() { return new ECDiffieHellmanImplementation.ECDiffieHellmanSecurityTransforms(); } - public static ECDiffieHellman Create(ECCurve curve) + public static partial ECDiffieHellman Create(ECCurve curve) { ECDiffieHellman ecdh = Create(); @@ -26,7 +26,7 @@ public static ECDiffieHellman Create(ECCurve curve) } } - public static ECDiffieHellman Create(ECParameters parameters) + public static partial ECDiffieHellman Create(ECParameters parameters) { ECDiffieHellman ecdh = Create(); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.Xml.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.Xml.cs similarity index 88% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.Xml.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.Xml.cs index 5e06b022d17ba8..351276566f96f2 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.Xml.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.Xml.cs @@ -3,7 +3,7 @@ namespace System.Security.Cryptography { - public abstract partial class ECDiffieHellman : AsymmetricAlgorithm + public abstract partial class ECDiffieHellman : ECAlgorithm { public override void FromXmlString(string xmlString) { diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.cs new file mode 100644 index 00000000000000..c0bfb6f798953d --- /dev/null +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.cs @@ -0,0 +1,143 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Diagnostics.CodeAnalysis; +using System.Runtime.Versioning; +using Internal.Cryptography; + +namespace System.Security.Cryptography +{ + /// + /// Abstract base class for implementations of elliptic curve Diffie-Hellman to derive from + /// + public abstract partial class ECDiffieHellman : ECAlgorithm + { + public override string KeyExchangeAlgorithm + { + get { return "ECDiffieHellman"; } + } + + public override string? SignatureAlgorithm + { + get { return null; } + } + + [UnsupportedOSPlatform("browser")] + public static new partial ECDiffieHellman Create(); + + [UnsupportedOSPlatform("browser")] + public static partial ECDiffieHellman Create(ECCurve curve); + + [UnsupportedOSPlatform("browser")] + public static partial ECDiffieHellman Create(ECParameters parameters); + + [RequiresUnreferencedCode(CryptoConfig.CreateFromNameUnreferencedCodeMessage)] + public static new ECDiffieHellman? Create(string algorithm) + { + if (algorithm == null) + { + throw new ArgumentNullException(nameof(algorithm)); + } + + return CryptoConfig.CreateFromName(algorithm) as ECDiffieHellman; + } + + public abstract ECDiffieHellmanPublicKey PublicKey { get; } + + // This method must be implemented by derived classes. In order to conform to the contract, it cannot be abstract. + public virtual byte[] DeriveKeyMaterial(ECDiffieHellmanPublicKey otherPartyPublicKey) + { + throw DerivedClassMustOverride(); + } + + /// + /// Derive key material using the formula HASH(x) where x is the computed result of the EC Diffie-Hellman algorithm. + /// + /// The public key of the party with which to derive a mutual secret. + /// The identifier for the hash algorithm to use. + /// A hashed output suitable for key material + /// is over a different curve than this key + public byte[] DeriveKeyFromHash(ECDiffieHellmanPublicKey otherPartyPublicKey, HashAlgorithmName hashAlgorithm) + { + return DeriveKeyFromHash(otherPartyPublicKey, hashAlgorithm, null, null); + } + + /// + /// Derive key material using the formula HASH(secretPrepend || x || secretAppend) where x is the computed + /// result of the EC Diffie-Hellman algorithm. + /// + /// The public key of the party with which to derive a mutual secret. + /// The identifier for the hash algorithm to use. + /// A value to prepend to the derived secret before hashing. A null value is treated as an empty array. + /// A value to append to the derived secret before hashing. A null value is treated as an empty array. + /// A hashed output suitable for key material + /// is over a different curve than this key + public virtual byte[] DeriveKeyFromHash( + ECDiffieHellmanPublicKey otherPartyPublicKey, + HashAlgorithmName hashAlgorithm, + byte[]? secretPrepend, + byte[]? secretAppend) + { + throw DerivedClassMustOverride(); + } + + /// + /// Derive key material using the formula HMAC(hmacKey, x) where x is the computed + /// result of the EC Diffie-Hellman algorithm. + /// + /// The public key of the party with which to derive a mutual secret. + /// The identifier for the hash algorithm to use. + /// The key to use in the HMAC. A null value indicates that the result of the EC Diffie-Hellman algorithm should be used as the HMAC key. + /// A hashed output suitable for key material + /// is over a different curve than this key + public byte[] DeriveKeyFromHmac( + ECDiffieHellmanPublicKey otherPartyPublicKey, + HashAlgorithmName hashAlgorithm, + byte[]? hmacKey) + { + return DeriveKeyFromHmac(otherPartyPublicKey, hashAlgorithm, hmacKey, null, null); + } + + /// + /// Derive key material using the formula HMAC(hmacKey, secretPrepend || x || secretAppend) where x is the computed + /// result of the EC Diffie-Hellman algorithm. + /// + /// The public key of the party with which to derive a mutual secret. + /// The identifier for the hash algorithm to use. + /// The key to use in the HMAC. A null value indicates that the result of the EC Diffie-Hellman algorithm should be used as the HMAC key. + /// A value to prepend to the derived secret before hashing. A null value is treated as an empty array. + /// A value to append to the derived secret before hashing. A null value is treated as an empty array. + /// A hashed output suitable for key material + /// is over a different curve than this key + public virtual byte[] DeriveKeyFromHmac( + ECDiffieHellmanPublicKey otherPartyPublicKey, + HashAlgorithmName hashAlgorithm, + byte[]? hmacKey, + byte[]? secretPrepend, + byte[]? secretAppend) + { + throw DerivedClassMustOverride(); + } + + /// + /// Derive key material using the TLS pseudo-random function (PRF) derivation algorithm. + /// + /// The public key of the party with which to derive a mutual secret. + /// The ASCII encoded PRF label. + /// The 64-byte PRF seed. + /// A 48-byte output of the TLS pseudo-random function. + /// is over a different curve than this key + /// is null + /// is null + /// is not exactly 64 bytes in length + public virtual byte[] DeriveKeyTls(ECDiffieHellmanPublicKey otherPartyPublicKey, byte[] prfLabel, byte[] prfSeed) + { + throw DerivedClassMustOverride(); + } + + private static Exception DerivedClassMustOverride() + { + return new NotImplementedException(SR.NotSupported_SubclassOverride); + } + } +} diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellmanCng.Derive.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellmanCng.Derive.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellmanCng.Derive.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellmanCng.Derive.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellmanCng.Key.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellmanCng.Key.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellmanCng.Key.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellmanCng.Key.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellmanCng.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellmanCng.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellmanCng.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellmanCng.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellmanCngPublicKey.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellmanCngPublicKey.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellmanCngPublicKey.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellmanCngPublicKey.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellmanPublicKey.ExportParameters.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellmanPublicKey.ExportParameters.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellmanPublicKey.ExportParameters.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellmanPublicKey.ExportParameters.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellmanPublicKey.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellmanPublicKey.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellmanPublicKey.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellmanPublicKey.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsa.Create.Android.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDsa.Create.Android.cs similarity index 85% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsa.Create.Android.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDsa.Create.Android.cs index d4b8e83bc99832..db65ef6abfa9bc 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsa.Create.Android.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDsa.Create.Android.cs @@ -8,12 +8,12 @@ namespace System.Security.Cryptography { - public partial class ECDsa : AsymmetricAlgorithm + public partial class ECDsa : ECAlgorithm { /// /// Creates an instance of the platform specific implementation of the cref="ECDsa" algorithm. /// - public static new ECDsa Create() + public static new partial ECDsa Create() { return new ECDsaImplementation.ECDsaAndroid(); } @@ -24,7 +24,7 @@ public partial class ECDsa : AsymmetricAlgorithm /// /// The representing the elliptic curve. /// - public static ECDsa Create(ECCurve curve) + public static partial ECDsa Create(ECCurve curve) { return new ECDsaImplementation.ECDsaAndroid(curve); } @@ -35,7 +35,7 @@ public static ECDsa Create(ECCurve curve) /// /// The representing the elliptic curve parameters. /// - public static ECDsa Create(ECParameters parameters) + public static partial ECDsa Create(ECParameters parameters) { ECDsa ec = new ECDsaImplementation.ECDsaAndroid(); ec.ImportParameters(parameters); diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDsa.Create.NotSupported.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDsa.Create.NotSupported.cs new file mode 100644 index 00000000000000..98476a375bc351 --- /dev/null +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDsa.Create.NotSupported.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Security.Cryptography +{ + public partial class ECDsa : ECAlgorithm + { + public static new partial ECDsa Create() + { + throw new PlatformNotSupportedException(); + } + + public static partial ECDsa Create(ECCurve curve) + { + throw new PlatformNotSupportedException(); + } + + public static partial ECDsa Create(ECParameters parameters) + { + throw new PlatformNotSupportedException(); + } + } +} diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsaOpenSsl.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDsa.Create.OpenSsl.cs similarity index 84% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsaOpenSsl.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDsa.Create.OpenSsl.cs index f51eb3e8c5bd2a..dbb00ed010b585 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsaOpenSsl.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDsa.Create.OpenSsl.cs @@ -3,12 +3,12 @@ namespace System.Security.Cryptography { - public partial class ECDsa : AsymmetricAlgorithm + public partial class ECDsa : ECAlgorithm { /// /// Creates an instance of the platform specific implementation of the cref="ECDsa" algorithm. /// - public static new ECDsa Create() + public static new partial ECDsa Create() { return new ECDsaImplementation.ECDsaOpenSsl(); } @@ -19,7 +19,7 @@ public partial class ECDsa : AsymmetricAlgorithm /// /// The representing the elliptic curve. /// - public static ECDsa Create(ECCurve curve) + public static partial ECDsa Create(ECCurve curve) { return new ECDsaImplementation.ECDsaOpenSsl(curve); } @@ -30,7 +30,7 @@ public static ECDsa Create(ECCurve curve) /// /// The representing the elliptic curve parameters. /// - public static ECDsa Create(ECParameters parameters) + public static partial ECDsa Create(ECParameters parameters) { ECDsa ec = new ECDsaImplementation.ECDsaOpenSsl(); ec.ImportParameters(parameters); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsa.Xml.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDsa.Xml.cs similarity index 93% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsa.Xml.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDsa.Xml.cs index b7cefe14a0c784..efec2250f5d753 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsa.Xml.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDsa.Xml.cs @@ -3,7 +3,7 @@ namespace System.Security.Cryptography { - public abstract partial class ECDsa : AsymmetricAlgorithm + public abstract partial class ECDsa : ECAlgorithm { // There is currently not a standard XML format for ECC keys, so we will not implement the default // To/FromXmlString so that we're not tied to one format when a standard one does exist. Instead we'll diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsa.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDsa.cs similarity index 71% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsa.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDsa.cs index 4b46ecc95f697a..310e7e135ea679 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsa.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDsa.cs @@ -5,15 +5,12 @@ using System.Buffers; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -using System.Formats.Asn1; using System.IO; using System.Runtime.Versioning; -using System.Security.Cryptography.Asn1; namespace System.Security.Cryptography { - [UnsupportedOSPlatform("browser")] - public abstract partial class ECDsa : AsymmetricAlgorithm + public abstract partial class ECDsa : ECAlgorithm { // secp521r1 maxes out at 139 bytes in the DER format, so 256 should always be enough private const int SignatureStackBufSize = 256; @@ -21,14 +18,17 @@ public abstract partial class ECDsa : AsymmetricAlgorithm // One power of two bigger should cover most unknown algorithms, too. private const int HashBufferStackSize = 128; - private static readonly string[] s_validOids = - { - Oids.EcPublicKey, - // ECDH and ECMQV are not valid in this context. - }; - protected ECDsa() { } + [UnsupportedOSPlatform("browser")] + public static new partial ECDsa Create(); + + [UnsupportedOSPlatform("browser")] + public static partial ECDsa Create(ECCurve curve); + + [UnsupportedOSPlatform("browser")] + public static partial ECDsa Create(ECParameters parameters); + [RequiresUnreferencedCode(CryptoConfig.CreateFromNameUnreferencedCodeMessage)] public static new ECDsa? Create(string algorithm) { @@ -40,45 +40,6 @@ protected ECDsa() { } return CryptoConfig.CreateFromName(algorithm) as ECDsa; } - /// - /// When overridden in a derived class, exports the named or explicit ECParameters for an ECCurve. - /// If the curve has a name, the Curve property will contain named curve parameters otherwise it will contain explicit parameters. - /// - /// true to include private parameters, otherwise, false. - /// - public virtual ECParameters ExportParameters(bool includePrivateParameters) - { - throw new NotSupportedException(SR.NotSupported_SubclassOverride); - } - - /// - /// When overridden in a derived class, exports the explicit ECParameters for an ECCurve. - /// - /// true to include private parameters, otherwise, false. - /// - public virtual ECParameters ExportExplicitParameters(bool includePrivateParameters) - { - throw new NotSupportedException(SR.NotSupported_SubclassOverride); - } - - /// - /// When overridden in a derived class, imports the specified ECParameters. - /// - /// The curve parameters. - public virtual void ImportParameters(ECParameters parameters) - { - throw new NotSupportedException(SR.NotSupported_SubclassOverride); - } - - /// - /// When overridden in a derived class, generates a new public/private keypair for the specified curve. - /// - /// The curve to use. - public virtual void GenerateKey(ECCurve curve) - { - throw new NotSupportedException(SR.NotSupported_SubclassOverride); - } - public virtual byte[] SignData(byte[] data, HashAlgorithmName hashAlgorithm) { if (data == null) @@ -1006,256 +967,6 @@ private byte[] HashSpanToArray(ReadOnlySpan data, HashAlgorithmName hashAl } } - public override unsafe bool TryExportEncryptedPkcs8PrivateKey( - ReadOnlySpan passwordBytes, - PbeParameters pbeParameters, - Span destination, - out int bytesWritten) - { - if (pbeParameters == null) - throw new ArgumentNullException(nameof(pbeParameters)); - - PasswordBasedEncryption.ValidatePbeParameters( - pbeParameters, - ReadOnlySpan.Empty, - passwordBytes); - - ECParameters ecParameters = ExportParameters(true); - - fixed (byte* privPtr = ecParameters.D) - { - try - { - AsnWriter pkcs8PrivateKey = EccKeyFormatHelper.WritePkcs8PrivateKey(ecParameters); - - AsnWriter writer = KeyFormatHelper.WriteEncryptedPkcs8( - passwordBytes, - pkcs8PrivateKey, - pbeParameters); - - return writer.TryEncode(destination, out bytesWritten); - } - finally - { - CryptographicOperations.ZeroMemory(ecParameters.D); - } - } - } - - public override unsafe bool TryExportEncryptedPkcs8PrivateKey( - ReadOnlySpan password, - PbeParameters pbeParameters, - Span destination, - out int bytesWritten) - { - if (pbeParameters == null) - throw new ArgumentNullException(nameof(pbeParameters)); - - PasswordBasedEncryption.ValidatePbeParameters( - pbeParameters, - password, - ReadOnlySpan.Empty); - - ECParameters ecParameters = ExportParameters(true); - - fixed (byte* privPtr = ecParameters.D) - { - try - { - AsnWriter pkcs8PrivateKey = EccKeyFormatHelper.WritePkcs8PrivateKey(ecParameters); - - AsnWriter writer = KeyFormatHelper.WriteEncryptedPkcs8( - password, - pkcs8PrivateKey, - pbeParameters); - - return writer.TryEncode(destination, out bytesWritten); - } - finally - { - CryptographicOperations.ZeroMemory(ecParameters.D); - } - } - } - - public override unsafe bool TryExportPkcs8PrivateKey( - Span destination, - out int bytesWritten) - { - ECParameters ecParameters = ExportParameters(true); - - fixed (byte* privPtr = ecParameters.D) - { - try - { - AsnWriter writer = EccKeyFormatHelper.WritePkcs8PrivateKey(ecParameters); - return writer.TryEncode(destination, out bytesWritten); - } - finally - { - CryptographicOperations.ZeroMemory(ecParameters.D); - } - } - } - - public override bool TryExportSubjectPublicKeyInfo( - Span destination, - out int bytesWritten) - { - ECParameters ecParameters = ExportParameters(false); - - AsnWriter writer = EccKeyFormatHelper.WriteSubjectPublicKeyInfo(ecParameters); - return writer.TryEncode(destination, out bytesWritten); - } - - public override unsafe void ImportEncryptedPkcs8PrivateKey( - ReadOnlySpan passwordBytes, - ReadOnlySpan source, - out int bytesRead) - { - KeyFormatHelper.ReadEncryptedPkcs8( - s_validOids, - source, - passwordBytes, - EccKeyFormatHelper.FromECPrivateKey, - out int localRead, - out ECParameters ret); - - fixed (byte* privPin = ret.D) - { - try - { - ImportParameters(ret); - bytesRead = localRead; - } - finally - { - CryptographicOperations.ZeroMemory(ret.D); - } - } - } - - public override unsafe void ImportEncryptedPkcs8PrivateKey( - ReadOnlySpan password, - ReadOnlySpan source, - out int bytesRead) - { - KeyFormatHelper.ReadEncryptedPkcs8( - s_validOids, - source, - password, - EccKeyFormatHelper.FromECPrivateKey, - out int localRead, - out ECParameters ret); - - fixed (byte* privPin = ret.D) - { - try - { - ImportParameters(ret); - bytesRead = localRead; - } - finally - { - CryptographicOperations.ZeroMemory(ret.D); - } - } - } - - public override unsafe void ImportPkcs8PrivateKey( - ReadOnlySpan source, - out int bytesRead) - { - KeyFormatHelper.ReadPkcs8( - s_validOids, - source, - EccKeyFormatHelper.FromECPrivateKey, - out int localRead, - out ECParameters key); - - fixed (byte* privPin = key.D) - { - try - { - ImportParameters(key); - bytesRead = localRead; - } - finally - { - CryptographicOperations.ZeroMemory(key.D); - } - } - } - - public override void ImportSubjectPublicKeyInfo( - ReadOnlySpan source, - out int bytesRead) - { - KeyFormatHelper.ReadSubjectPublicKeyInfo( - s_validOids, - source, - EccKeyFormatHelper.FromECPublicKey, - out int localRead, - out ECParameters key); - - ImportParameters(key); - bytesRead = localRead; - } - - public virtual unsafe void ImportECPrivateKey(ReadOnlySpan source, out int bytesRead) - { - ECParameters ecParameters = EccKeyFormatHelper.FromECPrivateKey(source, out int localRead); - - fixed (byte* privPin = ecParameters.D) - { - try - { - ImportParameters(ecParameters); - bytesRead = localRead; - } - finally - { - CryptographicOperations.ZeroMemory(ecParameters.D); - } - } - } - - public virtual unsafe byte[] ExportECPrivateKey() - { - ECParameters ecParameters = ExportParameters(true); - - fixed (byte* privPin = ecParameters.D) - { - try - { - AsnWriter writer = EccKeyFormatHelper.WriteECPrivateKey(ecParameters); - return writer.Encode(); - } - finally - { - CryptographicOperations.ZeroMemory(ecParameters.D); - } - } - } - - public virtual unsafe bool TryExportECPrivateKey(Span destination, out int bytesWritten) - { - ECParameters ecParameters = ExportParameters(true); - - fixed (byte* privPin = ecParameters.D) - { - try - { - AsnWriter writer = EccKeyFormatHelper.WriteECPrivateKey(ecParameters); - return writer.TryEncode(destination, out bytesWritten); - } - finally - { - CryptographicOperations.ZeroMemory(ecParameters.D); - } - } - } - /// /// Gets the largest size, in bytes, for a signature produced by this key in the indicated format. /// @@ -1294,202 +1005,5 @@ public int GetMaxSignatureSize(DSASignatureFormat signatureFormat) throw new ArgumentOutOfRangeException(nameof(signatureFormat)); } } - - /// - /// Imports an RFC 7468 PEM-encoded key, replacing the keys for this object. - /// - /// The PEM text of the key to import. - /// - /// - /// does not contain a PEM-encoded key with a recognized label. - /// - /// - /// -or- - /// - /// - /// contains multiple PEM-encoded keys with a recognized label. - /// - /// - /// -or- - /// - /// - /// contains an encrypted PEM-encoded key. - /// - /// - /// - /// - /// Unsupported or malformed PEM-encoded objects will be ignored. If multiple supported PEM labels - /// are found, an exception is raised to prevent importing a key when - /// the key is ambiguous. - /// - /// - /// This method supports the following PEM labels: - /// - /// PUBLIC KEY - /// PRIVATE KEY - /// EC PRIVATE KEY - /// - /// - /// - public override void ImportFromPem(ReadOnlySpan input) - { - PemKeyImportHelpers.ImportPem(input, label => { - if (label.SequenceEqual(PemLabels.Pkcs8PrivateKey)) - { - return ImportPkcs8PrivateKey; - } - else if (label.SequenceEqual(PemLabels.SpkiPublicKey)) - { - return ImportSubjectPublicKeyInfo; - } - else if (label.SequenceEqual(PemLabels.EcPrivateKey)) - { - return ImportECPrivateKey; - } - else - { - return null; - } - }); - } - - /// - /// Imports an encrypted RFC 7468 PEM-encoded private key, replacing the keys for this object. - /// - /// The PEM text of the encrypted key to import. - /// - /// The password to use for decrypting the key material. - /// - /// - /// - /// does not contain a PEM-encoded key with a recognized label. - /// - /// - /// -or- - /// - /// - /// contains multiple PEM-encoded keys with a recognized label. - /// - /// - /// - /// - /// The password is incorrect. - /// - /// - /// -or- - /// - /// - /// The base-64 decoded contents of the PEM text from - /// do not represent an ASN.1-BER-encoded PKCS#8 EncryptedPrivateKeyInfo structure. - /// - /// - /// -or- - /// - /// - /// The base-64 decoded contents of the PEM text from - /// indicate the key is for an algorithm other than the algorithm - /// represented by this instance. - /// - /// - /// -or- - /// - /// - /// The base-64 decoded contents of the PEM text from - /// represent the key in a format that is not supported. - /// - /// - /// -or- - /// - /// - /// The algorithm-specific key import failed. - /// - /// - /// - /// - /// When the base-64 decoded contents of indicate an algorithm that uses PBKDF1 - /// (Password-Based Key Derivation Function 1) or PBKDF2 (Password-Based Key Derivation Function 2), - /// the password is converted to bytes via the UTF-8 encoding. - /// - /// - /// Unsupported or malformed PEM-encoded objects will be ignored. If multiple supported PEM labels - /// are found, an exception is thrown to prevent importing a key when - /// the key is ambiguous. - /// - /// This method supports the ENCRYPTED PRIVATE KEY PEM label. - /// - public override void ImportFromEncryptedPem(ReadOnlySpan input, ReadOnlySpan password) - { - PemKeyImportHelpers.ImportEncryptedPem(input, password, ImportEncryptedPkcs8PrivateKey); - } - - /// - /// Imports an encrypted RFC 7468 PEM-encoded private key, replacing the keys for this object. - /// - /// The PEM text of the encrypted key to import. - /// - /// The bytes to use as a password when decrypting the key material. - /// - /// - /// - /// does not contain a PEM-encoded key with a recognized label. - /// - /// - /// -or- - /// - /// - /// contains multiple PEM-encoded keys with a recognized label. - /// - /// - /// - /// - /// The password is incorrect. - /// - /// - /// -or- - /// - /// - /// The base-64 decoded contents of the PEM text from - /// do not represent an ASN.1-BER-encoded PKCS#8 EncryptedPrivateKeyInfo structure. - /// - /// - /// -or- - /// - /// - /// The base-64 decoded contents of the PEM text from - /// indicate the key is for an algorithm other than the algorithm - /// represented by this instance. - /// - /// - /// -or- - /// - /// - /// The base-64 decoded contents of the PEM text from - /// represent the key in a format that is not supported. - /// - /// - /// -or- - /// - /// - /// The algorithm-specific key import failed. - /// - /// - /// - /// - /// The password bytes are passed directly into the Key Derivation Function (KDF) - /// used by the algorithm indicated by pbeParameters. This enables compatibility - /// with other systems which use a text encoding other than UTF-8 when processing - /// passwords with PBKDF2 (Password-Based Key Derivation Function 2). - /// - /// - /// Unsupported or malformed PEM-encoded objects will be ignored. If multiple supported PEM labels - /// are found, an exception is thrown to prevent importing a key when - /// the key is ambiguous. - /// - /// This method supports the ENCRYPTED PRIVATE KEY PEM label. - /// - public override void ImportFromEncryptedPem(ReadOnlySpan input, ReadOnlySpan passwordBytes) - { - PemKeyImportHelpers.ImportEncryptedPem(input, passwordBytes, ImportEncryptedPkcs8PrivateKey); - } } } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsaCng.Key.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDsaCng.Key.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsaCng.Key.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDsaCng.Key.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsaCng.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDsaCng.cs similarity index 96% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsaCng.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDsaCng.cs index f4c50e3b3ce336..5e9b4fe7bccba4 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsaCng.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDsaCng.cs @@ -8,12 +8,12 @@ namespace System.Security.Cryptography { - public partial class ECDsa : AsymmetricAlgorithm + public partial class ECDsa : ECAlgorithm { /// /// Creates an instance of the platform specific implementation of the cref="ECDsa" algorithm. /// - public static new ECDsa Create() + public static new partial ECDsa Create() { return new ECDsaImplementation.ECDsaCng(); } @@ -24,7 +24,7 @@ public partial class ECDsa : AsymmetricAlgorithm /// /// The representing the elliptic curve. /// - public static ECDsa Create(ECCurve curve) + public static partial ECDsa Create(ECCurve curve) { return new ECDsaImplementation.ECDsaCng(curve); } @@ -35,7 +35,7 @@ public static ECDsa Create(ECCurve curve) /// /// The representing the elliptic curve parameters. /// - public static ECDsa Create(ECParameters parameters) + public static partial ECDsa Create(ECParameters parameters) { ECDsa ec = new ECDsaImplementation.ECDsaCng(); ec.ImportParameters(parameters); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECParameters.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECParameters.cs similarity index 91% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECParameters.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECParameters.cs index 5aec01dd373ec5..165f9877fcef84 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECParameters.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECParameters.cs @@ -1,17 +1,11 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Buffers; -using System.Runtime.InteropServices; -using System.Runtime.Versioning; -using System.Security.Cryptography.Asn1; - namespace System.Security.Cryptography { /// /// Represents the public and private key of the specified elliptic curve. /// - [UnsupportedOSPlatform("browser")] public struct ECParameters { /// diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECPoint.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECPoint.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECPoint.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECPoint.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HKDF.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HKDF.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HKDF.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HKDF.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/HMACCommon.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HMACCommon.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/HMACCommon.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HMACCommon.cs index 8a9a0491a6c88e..7e64fc27c8da90 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/HMACCommon.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HMACCommon.cs @@ -1,11 +1,11 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; +using Internal.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { // // This class provides the common functionality for HMACSHA1, HMACSHA256, HMACMD5, etc. diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACMD5.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HMACMD5.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACMD5.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HMACMD5.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA1.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HMACSHA1.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA1.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HMACSHA1.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA256.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HMACSHA256.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA256.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HMACSHA256.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA384.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HMACSHA384.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA384.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HMACSHA384.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA512.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HMACSHA512.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA512.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HMACSHA512.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/HashAlgorithmNames.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HashAlgorithmNames.cs similarity index 96% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/HashAlgorithmNames.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HashAlgorithmNames.cs index cd1032317fa024..dc0a42f78ac8d3 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/HashAlgorithmNames.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HashAlgorithmNames.cs @@ -1,11 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Collections.Generic; -using System.Security.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal static class HashAlgorithmNames { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/HashProviderDispenser.OSX.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HashProviderDispenser.Apple.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/HashProviderDispenser.OSX.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HashProviderDispenser.Apple.cs index c562dfff5a907d..fa80816a75abfb 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/HashProviderDispenser.OSX.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HashProviderDispenser.Apple.cs @@ -1,12 +1,11 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Diagnostics; -using System.Security.Cryptography; using System.Security.Cryptography.Apple; +using Internal.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal static partial class HashProviderDispenser { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/HashProviderDispenser.Browser.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HashProviderDispenser.Browser.cs similarity index 94% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/HashProviderDispenser.Browser.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HashProviderDispenser.Browser.cs index cc0dc6f57319f8..893339cad6b417 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/HashProviderDispenser.Browser.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HashProviderDispenser.Browser.cs @@ -32,7 +32,7 @@ public static unsafe int MacData( ReadOnlySpan source, Span destination) { - throw new PlatformNotSupportedException(SR.SystemSecurityCryptographyAlgorithms_PlatformNotSupported); + throw new PlatformNotSupportedException(SR.SystemSecurityCryptography_PlatformNotSupported); } public static int HashData(string hashAlgorithmId, ReadOnlySpan source, Span destination) @@ -45,7 +45,7 @@ public static int HashData(string hashAlgorithmId, ReadOnlySpan source, Sp public static unsafe HashProvider CreateMacProvider(string hashAlgorithmId, ReadOnlySpan key) { - throw new PlatformNotSupportedException(SR.SystemSecurityCryptographyAlgorithms_PlatformNotSupported); + throw new PlatformNotSupportedException(SR.SystemSecurityCryptography_PlatformNotSupported); } } } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/HashProviderDispenser.Unix.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HashProviderDispenser.OpenSsl.cs similarity index 97% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/HashProviderDispenser.Unix.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HashProviderDispenser.OpenSsl.cs index 669faad082928a..ab439c615c9efd 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/HashProviderDispenser.Unix.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HashProviderDispenser.OpenSsl.cs @@ -94,6 +94,11 @@ public EvpHashProvider(IntPtr algorithmEvp) public override void AppendHashData(ReadOnlySpan data) { + if (data.IsEmpty) + { + return; + } + _running = true; Check(Interop.Crypto.EvpDigestUpdate(_ctx, data, data.Length)); } @@ -166,6 +171,11 @@ public HmacHashProvider(IntPtr algorithmEvp, ReadOnlySpan key) public override void AppendHashData(ReadOnlySpan data) { + if (data.IsEmpty) + { + return; + } + _running = true; Check(Interop.Crypto.HmacUpdate(_hmacCtx, data, data.Length)); } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/HashProviderDispenser.Windows.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HashProviderDispenser.Windows.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/HashProviderDispenser.Windows.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HashProviderDispenser.Windows.cs index 88dd4da404679f..19b06adf5b0591 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/HashProviderDispenser.Windows.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/HashProviderDispenser.Windows.cs @@ -1,17 +1,16 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Diagnostics; using System.Runtime.InteropServices; -using System.Security.Cryptography; +using Internal.Cryptography; using Microsoft.Win32.SafeHandles; using NTSTATUS = Interop.BCrypt.NTSTATUS; using BCryptOpenAlgorithmProviderFlags = Interop.BCrypt.BCryptOpenAlgorithmProviderFlags; using BCryptCreateHashFlags = Interop.BCrypt.BCryptCreateHashFlags; using BCryptAlgorithmCache = Interop.BCrypt.BCryptAlgorithmCache; -namespace Internal.Cryptography +namespace System.Security.Cryptography { // // Provides hash services via the native provider (CNG). diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/Helpers.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Helpers.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/Helpers.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Helpers.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/IncrementalHash.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/IncrementalHash.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/IncrementalHash.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/IncrementalHash.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/MD5.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/MD5.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/MD5.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/MD5.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/MaskGenerationMethod.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/MaskGenerationMethod.cs similarity index 81% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/MaskGenerationMethod.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/MaskGenerationMethod.cs index d737a491fc692c..701fb6c06a79d0 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/MaskGenerationMethod.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/MaskGenerationMethod.cs @@ -1,11 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Runtime.Versioning; - namespace System.Security.Cryptography { - [UnsupportedOSPlatform("browser")] public abstract class MaskGenerationMethod { public abstract byte[] GenerateMask(byte[] rgbSeed, int cbReturn); diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/Oid.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Oid.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/Oid.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Oid.cs diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/OidCollection.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OidCollection.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/OidCollection.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OidCollection.cs diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/OidEnumerator.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OidEnumerator.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/OidEnumerator.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OidEnumerator.cs diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/OidGroup.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OidGroup.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/OidGroup.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OidGroup.cs diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/OidLookup.NoFallback.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OidLookup.NoFallback.cs similarity index 97% rename from src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/OidLookup.NoFallback.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OidLookup.NoFallback.cs index 0ddbb3a5873625..8040fef930ee59 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/OidLookup.NoFallback.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OidLookup.NoFallback.cs @@ -1,12 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Collections.Generic; using System.Diagnostics; -using System.Security.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal static partial class OidLookup { diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/OidLookup.Unix.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OidLookup.OpenSsl.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/OidLookup.Unix.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OidLookup.OpenSsl.cs index cfef4e4d09695f..f0d98a6a578351 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/OidLookup.Unix.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OidLookup.OpenSsl.cs @@ -1,12 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Diagnostics; using System.Runtime.InteropServices; -using System.Security.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal static partial class OidLookup { diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/OidLookup.Windows.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OidLookup.Windows.cs similarity index 93% rename from src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/OidLookup.Windows.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OidLookup.Windows.cs index be22aa7f7d9f45..e221bfe9e2bbda 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/OidLookup.Windows.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OidLookup.Windows.cs @@ -1,11 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Security.Cryptography; - using static Interop.Crypt32; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal static partial class OidLookup { diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/OidLookup.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OidLookup.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/OidLookup.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OidLookup.cs index 6f200148ca9358..fd96651c342fbd 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/OidLookup.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OidLookup.cs @@ -1,13 +1,11 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; -using System.Security.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal static partial class OidLookup { diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/OpenSslAsnFormatter.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OpenSslAsnFormatter.cs similarity index 97% rename from src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/OpenSslAsnFormatter.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OpenSslAsnFormatter.cs index e033844c9d9cdc..a63308d624df26 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/OpenSslAsnFormatter.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OpenSslAsnFormatter.cs @@ -1,12 +1,11 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Security.Cryptography; using System.Text; using Microsoft.Win32.SafeHandles; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed class OpenSslAsnFormatter : AsnFormatter { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/OpenSslCipher.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OpenSslCipher.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/OpenSslCipher.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OpenSslCipher.cs index e02f2e670dde46..7c03cf7fd8a34f 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/OpenSslCipher.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OpenSslCipher.cs @@ -1,11 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Diagnostics; -using System.Security.Cryptography; +using Internal.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed class OpenSslCipher : BasicSymmetricCipher { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/OpenSslCipherLite.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OpenSslCipherLite.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/OpenSslCipherLite.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OpenSslCipherLite.cs index 82b4c38d3bb752..c378dc81140476 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/OpenSslCipherLite.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/OpenSslCipherLite.cs @@ -1,15 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Buffers; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; -using System.Security.Cryptography; +using Internal.Cryptography; using Microsoft.Win32.SafeHandles; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed class OpenSslCipherLite : ILiteSymmetricCipher { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/PKCS1MaskGenerationMethod.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/PKCS1MaskGenerationMethod.cs similarity index 97% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/PKCS1MaskGenerationMethod.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/PKCS1MaskGenerationMethod.cs index 3a20624cfae8e6..8ae3747ed3a2da 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/PKCS1MaskGenerationMethod.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/PKCS1MaskGenerationMethod.cs @@ -4,11 +4,9 @@ using System.Buffers.Binary; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -using System.Runtime.Versioning; namespace System.Security.Cryptography { - [UnsupportedOSPlatform("browser")] public class PKCS1MaskGenerationMethod : MaskGenerationMethod { private string _hashNameValue; diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/Pbkdf2Implementation.Managed.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Pbkdf2Implementation.Managed.cs similarity index 77% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/Pbkdf2Implementation.Managed.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Pbkdf2Implementation.Managed.cs index 9bb1a2c2f0247b..462382623c6f7d 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/Pbkdf2Implementation.Managed.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Pbkdf2Implementation.Managed.cs @@ -1,11 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Diagnostics; -using System.Security.Cryptography; +using Internal.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal static partial class Pbkdf2Implementation { @@ -18,8 +17,13 @@ public static unsafe void Fill( { Debug.Assert(!destination.IsEmpty); Debug.Assert(hashAlgorithmName.Name is not null); - // Fall back to managed implementation since Android doesn't support the full Pbkdf2 APIs - // until API level 26. + + if (!Helpers.HasHMAC) + { + throw new CryptographicException( + SR.Format(SR.Cryptography_AlgorithmNotSupported, "HMAC" + hashAlgorithmName.Name)); + } + using (Rfc2898DeriveBytes deriveBytes = new Rfc2898DeriveBytes( password.ToArray(), salt.ToArray(), diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/Pbkdf2Implementation.Unix.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Pbkdf2Implementation.OpenSsl.cs similarity index 92% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/Pbkdf2Implementation.Unix.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Pbkdf2Implementation.OpenSsl.cs index bace89794cafec..767bb87738aa8d 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/Pbkdf2Implementation.Unix.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Pbkdf2Implementation.OpenSsl.cs @@ -1,11 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Diagnostics; -using System.Security.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal static partial class Pbkdf2Implementation { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/Pbkdf2Implementation.Windows.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Pbkdf2Implementation.Windows.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/Pbkdf2Implementation.Windows.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Pbkdf2Implementation.Windows.cs index e9275bc28ae3cc..c8ea77d32a2ffa 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/Pbkdf2Implementation.Windows.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Pbkdf2Implementation.Windows.cs @@ -1,10 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Diagnostics; using System.Threading; -using System.Security.Cryptography; using Microsoft.Win32.SafeHandles; using BCryptAlgPseudoHandle = Interop.BCrypt.BCryptAlgPseudoHandle; using BCryptBuffer = Interop.BCrypt.BCryptBuffer; @@ -12,7 +10,7 @@ using CngBufferDescriptors = Interop.BCrypt.CngBufferDescriptors; using NTSTATUS = Interop.BCrypt.NTSTATUS; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal static partial class Pbkdf2Implementation { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/Pbkdf2Implementation.OSX.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Pbkdf2Implementation.macOS.cs similarity index 94% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/Pbkdf2Implementation.OSX.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Pbkdf2Implementation.macOS.cs index 4450166381e374..be842135d75f73 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/Pbkdf2Implementation.OSX.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Pbkdf2Implementation.macOS.cs @@ -1,12 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Diagnostics; -using System.Security.Cryptography; using PAL_HashAlgorithm = Interop.AppleCrypto.PAL_HashAlgorithm; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal static partial class Pbkdf2Implementation { diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/PemEncoding.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/PemEncoding.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/PemEncoding.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/PemEncoding.cs index 005ef1cec09074..e350d379f07e2b 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/PemEncoding.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/PemEncoding.cs @@ -356,9 +356,9 @@ public static int GetEncodedSize(int labelLength, int dataLength) const int MaxDataLength = 1_585_834_053; if (labelLength < 0) - throw new ArgumentOutOfRangeException(nameof(labelLength), SR.ArgumentOutOfRange_NeedPositiveNumber); + throw new ArgumentOutOfRangeException(nameof(labelLength), SR.ArgumentOutOfRange_NeedPosNum); if (dataLength < 0) - throw new ArgumentOutOfRangeException(nameof(dataLength), SR.ArgumentOutOfRange_NeedPositiveNumber); + throw new ArgumentOutOfRangeException(nameof(dataLength), SR.ArgumentOutOfRange_NeedPosNum); if (labelLength > MaxLabelSize) throw new ArgumentOutOfRangeException(nameof(labelLength), SR.Argument_PemEncoding_EncodedSizeTooLarge); if (dataLength > MaxDataLength) diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/PemFields.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/PemFields.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Encoding/src/System/Security/Cryptography/PemFields.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/PemFields.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RC2.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RC2.cs similarity index 97% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RC2.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RC2.cs index 73df4d554c21c2..c6a71fa5d5e96c 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RC2.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RC2.cs @@ -4,12 +4,10 @@ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Runtime.Versioning; -using Internal.Cryptography; namespace System.Security.Cryptography { [EditorBrowsable(EditorBrowsableState.Never)] - [UnsupportedOSPlatform("browser")] public abstract class RC2 : SymmetricAlgorithm { protected int EffectiveKeySizeValue; @@ -24,6 +22,7 @@ protected RC2() } [UnsupportedOSPlatform("android")] + [UnsupportedOSPlatform("browser")] public static new RC2 Create() { return new RC2Implementation(); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.OSX.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RC2Implementation.Apple.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.OSX.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RC2Implementation.Apple.cs index e8076d8325cc14..a993ecf7099d60 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.OSX.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RC2Implementation.Apple.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Security.Cryptography; +using Internal.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed partial class RC2Implementation { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.Android.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RC2Implementation.NotSupported.cs similarity index 94% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.Android.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RC2Implementation.NotSupported.cs index c1fb5a95f453a9..d1b39f89227802 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.Android.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RC2Implementation.NotSupported.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Security.Cryptography; +using Internal.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA5350", Justification = "We are providing the implementation for RC2, not consuming it.")] internal sealed partial class RC2Implementation : RC2 diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.Unix.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RC2Implementation.OpenSsl.cs similarity index 94% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.Unix.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RC2Implementation.OpenSsl.cs index b479d915330010..acb946a2c601b6 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.Unix.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RC2Implementation.OpenSsl.cs @@ -1,11 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Diagnostics; -using System.Security.Cryptography; +using Internal.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed partial class RC2Implementation { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.Windows.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RC2Implementation.Windows.cs similarity index 94% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.Windows.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RC2Implementation.Windows.cs index 20d0e04e88ac10..1223fbdbcc3e9e 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.Windows.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RC2Implementation.Windows.cs @@ -1,12 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Security.Cryptography; -using System.Diagnostics; +using Internal.Cryptography; using Internal.NativeCrypto; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed partial class RC2Implementation { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RC2Implementation.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RC2Implementation.cs index 5353006e0989c6..5e85bab4a4f3d7 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RC2Implementation.cs @@ -1,11 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Diagnostics; -using System.Security.Cryptography; +using Internal.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA5350", Justification = "We are providing the implementation for RC2, not consuming it.")] internal sealed partial class RC2Implementation : RC2 diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSA.Create.Android.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSA.Create.Android.cs similarity index 82% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSA.Create.Android.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSA.Create.Android.cs index 1b312327545918..0d391d3fef5800 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSA.Create.Android.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSA.Create.Android.cs @@ -12,6 +12,6 @@ namespace System.Security.Cryptography { public partial class RSA : AsymmetricAlgorithm { - public static new RSA Create() => new RSAImplementation.RSAAndroid(); + public static new partial RSA Create() => new RSAImplementation.RSAAndroid(); } } diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSA.Create.NotSupported.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSA.Create.NotSupported.cs new file mode 100644 index 00000000000000..3d06565e660a97 --- /dev/null +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSA.Create.NotSupported.cs @@ -0,0 +1,13 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Security.Cryptography +{ + public partial class RSA : AsymmetricAlgorithm + { + public static new partial RSA Create() + { + throw new PlatformNotSupportedException(); + } + } +} diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSA.Xml.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSA.Xml.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSA.Xml.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSA.Xml.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSA.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSA.cs similarity index 82% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSA.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSA.cs index 2d0919e2f1cd57..e5fa800517f381 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSA.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSA.cs @@ -12,15 +12,18 @@ namespace System.Security.Cryptography { - [UnsupportedOSPlatform("browser")] public abstract partial class RSA : AsymmetricAlgorithm { + [UnsupportedOSPlatform("browser")] + public static new partial RSA Create(); + [RequiresUnreferencedCode(CryptoConfig.CreateFromNameUnreferencedCodeMessage)] public static new RSA? Create(string algName) { return (RSA?)CryptoConfig.CreateFromName(algName); } + [UnsupportedOSPlatform("browser")] public static RSA Create(int keySizeInBits) { RSA rsa = Create(); @@ -37,6 +40,7 @@ public static RSA Create(int keySizeInBits) } } + [UnsupportedOSPlatform("browser")] public static RSA Create(RSAParameters parameters) { RSA rsa = Create(); @@ -679,7 +683,7 @@ public override unsafe void ImportEncryptedPkcs8PrivateKey( /// public override void ImportFromPem(ReadOnlySpan input) { - PemKeyImportHelpers.ImportPem(input, label => { + PemKeyHelpers.ImportPem(input, label => { if (label.SequenceEqual(PemLabels.RsaPrivateKey)) { return ImportRSAPrivateKey; @@ -769,7 +773,9 @@ public override void ImportFromPem(ReadOnlySpan input) /// public override void ImportFromEncryptedPem(ReadOnlySpan input, ReadOnlySpan password) { - PemKeyImportHelpers.ImportEncryptedPem(input, password, ImportEncryptedPkcs8PrivateKey); + // Implementation has been pushed down to AsymmetricAlgorithm. The + // override remains for compatibility. + base.ImportFromEncryptedPem(input, password); } /// @@ -839,7 +845,162 @@ public override void ImportFromEncryptedPem(ReadOnlySpan input, ReadOnlySp /// public override void ImportFromEncryptedPem(ReadOnlySpan input, ReadOnlySpan passwordBytes) { - PemKeyImportHelpers.ImportEncryptedPem(input, passwordBytes, ImportEncryptedPkcs8PrivateKey); + // Implementation has been pushed down to AsymmetricAlgorithm. The + // override remains for compatibility. + base.ImportFromEncryptedPem(input, passwordBytes); + } + + /// + /// Exports the current key in the PKCS#1 RSAPrivateKey format, PEM encoded. + /// + /// A string containing the PEM-encoded PKCS#1 RSAPrivateKey. + /// + /// The key could not be exported. + /// + /// + ///

+ /// A PEM-encoded PKCS#1 RSAPrivateKey will begin with -----BEGIN RSA PRIVATE KEY----- + /// and end with -----END RSA PRIVATE KEY-----, with the base64 encoded DER + /// contents of the key between the PEM boundaries. + ///

+ ///

+ /// The PEM is encoded according to the IETF RFC 7468 "strict" + /// encoding rules. + ///

+ ///
+ public unsafe string ExportRSAPrivateKeyPem() + { + byte[] exported = ExportRSAPrivateKey(); + + // Fixed to prevent GC moves. + fixed (byte* pExported = exported) + { + try + { + return PemKeyHelpers.CreatePemFromData(PemLabels.RsaPrivateKey, exported); + } + finally + { + CryptographicOperations.ZeroMemory(exported); + } + } + } + + /// + /// Exports the public-key portion of the current key in the PKCS#1 + /// RSAPublicKey format, PEM encoded. + /// + /// A string containing the PEM-encoded PKCS#1 RSAPublicKey. + /// + /// The key could not be exported. + /// + /// + ///

+ /// A PEM-encoded PKCS#1 RSAPublicKey will begin with -----BEGIN RSA PUBLIC KEY----- + /// and end with -----END RSA PUBLIC KEY-----, with the base64 encoded DER + /// contents of the key between the PEM boundaries. + ///

+ ///

+ /// The PEM is encoded according to the IETF RFC 7468 "strict" + /// encoding rules. + ///

+ ///
+ public string ExportRSAPublicKeyPem() + { + byte[] exported = ExportRSAPublicKey(); + return PemKeyHelpers.CreatePemFromData(PemLabels.RsaPublicKey, exported); + } + + /// + /// Attempts to export the current key in the PEM-encoded PKCS#1 + /// RSAPrivateKey format into a provided buffer. + /// + /// + /// The character span to receive the PEM-encoded PKCS#1 RSAPrivateKey data. + /// + /// + /// When this method returns, contains a value that indicates the number + /// of characters written to . This + /// parameter is treated as uninitialized. + /// + /// + /// if is big enough + /// to receive the output; otherwise, . + /// + /// + /// The key could not be exported. + /// + /// + ///

+ /// A PEM-encoded PKCS#1 RSAPrivateKey will begin with + /// -----BEGIN RSA PRIVATE KEY----- and end with + /// -----END RSA PRIVATE KEY-----, with the base64 encoded DER + /// contents of the key between the PEM boundaries. + ///

+ ///

+ /// The PEM is encoded according to the IETF RFC 7468 "strict" + /// encoding rules. + ///

+ ///
+ public bool TryExportRSAPrivateKeyPem(Span destination, out int charsWritten) + { + static bool Export(RSA alg, Span destination, out int bytesWritten) + { + return alg.TryExportRSAPrivateKey(destination, out bytesWritten); + } + + return PemKeyHelpers.TryExportToPem( + this, + PemLabels.RsaPrivateKey, + Export, + destination, + out charsWritten); + } + + /// + /// Attempts to export the current key in the PEM-encoded PKCS#1 + /// RSAPublicKey format into a provided buffer. + /// + /// + /// The character span to receive the PEM-encoded PKCS#1 RSAPublicKey data. + /// + /// + /// When this method returns, contains a value that indicates the number + /// of characters written to . This + /// parameter is treated as uninitialized. + /// + /// + /// if is big enough + /// to receive the output; otherwise, . + /// + /// + /// The key could not be exported. + /// + /// + ///

+ /// A PEM-encoded PKCS#1 RSAPublicKey will begin with + /// -----BEGIN RSA PUBLIC KEY----- and end with + /// -----END RSA PUBLIC KEY-----, with the base64 encoded DER + /// contents of the key between the PEM boundaries. + ///

+ ///

+ /// The PEM is encoded according to the IETF RFC 7468 "strict" + /// encoding rules. + ///

+ ///
+ public bool TryExportRSAPublicKeyPem(Span destination, out int charsWritten) + { + static bool Export(RSA alg, Span destination, out int bytesWritten) + { + return alg.TryExportRSAPublicKey(destination, out bytesWritten); + } + + return PemKeyHelpers.TryExportToPem( + this, + PemLabels.RsaPublicKey, + Export, + destination, + out charsWritten); } private static void ClearPrivateParameters(in RSAParameters rsaParameters) diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSACng.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSACng.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSACng.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSACng.cs index fecac4b75dd319..a3297868525192 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSACng.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSACng.cs @@ -9,7 +9,7 @@ namespace System.Security.Cryptography { public partial class RSA : AsymmetricAlgorithm { - public static new RSA Create() + public static new partial RSA Create() { return new RSAImplementation.RSACng(); } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAEncryptionPadding.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAEncryptionPadding.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAEncryptionPadding.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAEncryptionPadding.cs index ae356492bcec0d..cfc36cbbacf554 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAEncryptionPadding.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAEncryptionPadding.cs @@ -2,14 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics.CodeAnalysis; -using System.Runtime.Versioning; namespace System.Security.Cryptography { /// /// Specifies the padding mode and parameters to use with RSA encryption or decryption operations. /// - [UnsupportedOSPlatform("browser")] public sealed class RSAEncryptionPadding : IEquatable { private static readonly RSAEncryptionPadding s_pkcs1 = new RSAEncryptionPadding(RSAEncryptionPaddingMode.Pkcs1, default(HashAlgorithmName)); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAEncryptionPaddingMode.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAEncryptionPaddingMode.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAEncryptionPaddingMode.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAEncryptionPaddingMode.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeDeformatter.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAOAEPKeyExchangeDeformatter.cs similarity index 91% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeDeformatter.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAOAEPKeyExchangeDeformatter.cs index 0c2b3ba17ddaeb..668d0784db8a95 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeDeformatter.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAOAEPKeyExchangeDeformatter.cs @@ -1,11 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Runtime.Versioning; - namespace System.Security.Cryptography { - [UnsupportedOSPlatform("browser")] public class RSAOAEPKeyExchangeDeformatter : AsymmetricKeyExchangeDeformatter { private RSA? _rsaKey; @@ -28,7 +25,7 @@ public override string? Parameters public override byte[] DecryptKeyExchange(byte[] rgbData) { if (_rsaKey == null) - throw new CryptographicUnexpectedOperationException(SR.Cryptography_MissingKey); + throw new CryptographicUnexpectedOperationException(SR.Cryptography_FormatterMissingKey); return _rsaKey.Decrypt(rgbData, RSAEncryptionPadding.OaepSHA1); } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeFormatter.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAOAEPKeyExchangeFormatter.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeFormatter.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAOAEPKeyExchangeFormatter.cs index e6eceeaca70860..dd8568c359453d 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeFormatter.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAOAEPKeyExchangeFormatter.cs @@ -1,11 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Runtime.Versioning; - namespace System.Security.Cryptography { - [UnsupportedOSPlatform("browser")] public class RSAOAEPKeyExchangeFormatter : AsymmetricKeyExchangeFormatter { private byte[]? ParameterValue; @@ -72,7 +69,7 @@ public override byte[] CreateKeyExchange(byte[] rgbData, Type? symAlgType) public override byte[] CreateKeyExchange(byte[] rgbData) { if (_rsaKey == null) - throw new CryptographicUnexpectedOperationException(SR.Cryptography_MissingKey); + throw new CryptographicUnexpectedOperationException(SR.Cryptography_FormatterMissingKey); return _rsaKey.Encrypt(rgbData, RSAEncryptionPadding.OaepSHA1); } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1KeyExchangeDeformatter.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAPKCS1KeyExchangeDeformatter.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1KeyExchangeDeformatter.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAPKCS1KeyExchangeDeformatter.cs index 8270bcb7427dd8..ea54291305abcf 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1KeyExchangeDeformatter.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAPKCS1KeyExchangeDeformatter.cs @@ -5,7 +5,6 @@ namespace System.Security.Cryptography { - [UnsupportedOSPlatform("browser")] public class RSAPKCS1KeyExchangeDeformatter : AsymmetricKeyExchangeDeformatter { private RSA? _rsaKey; @@ -36,7 +35,7 @@ public override string? Parameters public override byte[] DecryptKeyExchange(byte[] rgbIn) { if (_rsaKey == null) - throw new CryptographicUnexpectedOperationException(SR.Cryptography_MissingKey); + throw new CryptographicUnexpectedOperationException(SR.Cryptography_FormatterMissingKey); return _rsaKey.Decrypt(rgbIn, RSAEncryptionPadding.Pkcs1); } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1KeyExchangeFormatter.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAPKCS1KeyExchangeFormatter.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1KeyExchangeFormatter.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAPKCS1KeyExchangeFormatter.cs index 9251511ae15359..b9cd034075a406 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1KeyExchangeFormatter.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAPKCS1KeyExchangeFormatter.cs @@ -5,7 +5,6 @@ namespace System.Security.Cryptography { - [UnsupportedOSPlatform("browser")] public class RSAPKCS1KeyExchangeFormatter : AsymmetricKeyExchangeFormatter { private RSA? _rsaKey; @@ -51,7 +50,7 @@ public override byte[] CreateKeyExchange(byte[] rgbData, Type? symAlgType) public override byte[] CreateKeyExchange(byte[] rgbData) { if (_rsaKey == null) - throw new CryptographicUnexpectedOperationException(SR.Cryptography_MissingKey); + throw new CryptographicUnexpectedOperationException(SR.Cryptography_FormatterMissingKey); return _rsaKey.Encrypt(rgbData, RSAEncryptionPadding.Pkcs1); } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1SignatureDeformatter.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAPKCS1SignatureDeformatter.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1SignatureDeformatter.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAPKCS1SignatureDeformatter.cs index 81feeca7e89775..22eeaae1fc6596 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1SignatureDeformatter.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAPKCS1SignatureDeformatter.cs @@ -51,9 +51,9 @@ public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature) if (rgbSignature == null) throw new ArgumentNullException(nameof(rgbSignature)); if (_algName == null) - throw new CryptographicUnexpectedOperationException(SR.Cryptography_MissingOID); + throw new CryptographicUnexpectedOperationException(SR.Cryptography_FormatterMissingAlgorithm); if (_rsaKey == null) - throw new CryptographicUnexpectedOperationException(SR.Cryptography_MissingKey); + throw new CryptographicUnexpectedOperationException(SR.Cryptography_FormatterMissingKey); return _rsaKey.VerifyHash(rgbHash, rgbSignature, new HashAlgorithmName(_algName), RSASignaturePadding.Pkcs1); } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1SignatureFormatter.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAPKCS1SignatureFormatter.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1SignatureFormatter.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAPKCS1SignatureFormatter.cs index dcd7139c2a5a82..938e2a60c3eb20 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1SignatureFormatter.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAPKCS1SignatureFormatter.cs @@ -50,9 +50,9 @@ public override byte[] CreateSignature(byte[] rgbHash) if (rgbHash == null) throw new ArgumentNullException(nameof(rgbHash)); if (_algName == null) - throw new CryptographicUnexpectedOperationException(SR.Cryptography_MissingOID); + throw new CryptographicUnexpectedOperationException(SR.Cryptography_FormatterMissingAlgorithm); if (_rsaKey == null) - throw new CryptographicUnexpectedOperationException(SR.Cryptography_MissingKey); + throw new CryptographicUnexpectedOperationException(SR.Cryptography_FormatterMissingKey); return _rsaKey.SignHash(rgbHash, new HashAlgorithmName(_algName), RSASignaturePadding.Pkcs1); } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAParameters.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAParameters.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAParameters.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAParameters.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSASignaturePadding.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSASignaturePadding.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSASignaturePadding.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSASignaturePadding.cs index 82b37d63c799d8..60ee325a9fccbc 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSASignaturePadding.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSASignaturePadding.cs @@ -13,7 +13,6 @@ namespace System.Security.Cryptography /// /// Specifies the padding mode and parameters to use with RSA signature creation or verification operations. /// - [UnsupportedOSPlatform("browser")] public sealed class RSASignaturePadding : IEquatable { private static readonly RSASignaturePadding s_pkcs1 = new RSASignaturePadding(RSASignaturePaddingMode.Pkcs1); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSASignaturePaddingMode.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSASignaturePaddingMode.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSASignaturePaddingMode.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSASignaturePaddingMode.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RandomNumberGenerator.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RandomNumberGenerator.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RandomNumberGenerator.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RandomNumberGenerator.cs index baad2d1e5c6a20..b299396c595d9a 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RandomNumberGenerator.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RandomNumberGenerator.cs @@ -4,7 +4,6 @@ using System.Buffers; using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; -using System.Runtime.Versioning; namespace System.Security.Cryptography { @@ -14,7 +13,6 @@ protected RandomNumberGenerator() { } public static RandomNumberGenerator Create() => RandomNumberGeneratorImplementation.s_singleton; - [UnsupportedOSPlatform("browser")] [RequiresUnreferencedCode(CryptoConfig.CreateFromNameUnreferencedCodeMessage)] public static RandomNumberGenerator? Create(string rngName) { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.OSX.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RandomNumberGeneratorImplementation.Apple.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.OSX.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RandomNumberGeneratorImplementation.Apple.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.Browser.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RandomNumberGeneratorImplementation.Browser.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.Browser.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RandomNumberGeneratorImplementation.Browser.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.Unix.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RandomNumberGeneratorImplementation.OpenSsl.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.Unix.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RandomNumberGeneratorImplementation.OpenSsl.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.Windows.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RandomNumberGeneratorImplementation.Windows.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.Windows.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RandomNumberGeneratorImplementation.Windows.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RandomNumberGeneratorImplementation.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RandomNumberGeneratorImplementation.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Rfc2898DeriveBytes.OneShot.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Rfc2898DeriveBytes.OneShot.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Rfc2898DeriveBytes.OneShot.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Rfc2898DeriveBytes.OneShot.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Rfc2898DeriveBytes.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Rfc2898DeriveBytes.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Rfc2898DeriveBytes.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Rfc2898DeriveBytes.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Rijndael.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Rijndael.cs similarity index 97% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Rijndael.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Rijndael.cs index 35e3f117cbeb0d..c01c867cb9a2d4 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Rijndael.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/Rijndael.cs @@ -10,9 +10,9 @@ namespace System.Security.Cryptography { [Obsolete(Obsoletions.RijndaelMessage, DiagnosticId = Obsoletions.RijndaelDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] [EditorBrowsable(EditorBrowsableState.Never)] - [UnsupportedOSPlatform("browser")] public abstract class Rijndael : SymmetricAlgorithm { + [UnsupportedOSPlatform("browser")] public static new Rijndael Create() { return new RijndaelImplementation(); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RijndaelImplementation.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RijndaelImplementation.cs similarity index 96% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RijndaelImplementation.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RijndaelImplementation.cs index 8fa834703033b9..698926032dfdbb 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RijndaelImplementation.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RijndaelImplementation.cs @@ -1,11 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Diagnostics; -using System.Security.Cryptography; +using System.Runtime.Versioning; -namespace Internal.Cryptography +namespace System.Security.Cryptography { /// /// Internal implementation of Rijndael. @@ -18,6 +17,7 @@ internal sealed class RijndaelImplementation : Rijndael { private readonly Aes _impl; + [UnsupportedOSPlatform("browser")] internal RijndaelImplementation() { LegalBlockSizesValue = new KeySizes[] { new KeySizes(minSize: 128, maxSize: 128, skipSize: 0) }; diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RijndaelManaged.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RijndaelManaged.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RijndaelManaged.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RijndaelManaged.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SHA1.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SHA1.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SHA1.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SHA1.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SHA1Managed.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SHA1Managed.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SHA1Managed.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SHA1Managed.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SHA256.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SHA256.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SHA256.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SHA256.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SHA256Managed.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SHA256Managed.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SHA256Managed.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SHA256Managed.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SHA384.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SHA384.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SHA384.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SHA384.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SHA384Managed.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SHA384Managed.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SHA384Managed.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SHA384Managed.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SHA512.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SHA512.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SHA512.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SHA512.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SHA512Managed.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SHA512Managed.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SHA512Managed.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SHA512Managed.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/SHAHashProvider.Browser.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SHAHashProvider.Browser.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/SHAHashProvider.Browser.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SHAHashProvider.Browser.cs index fccdff3feb81a6..5a72d4de54b071 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/SHAHashProvider.Browser.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SHAHashProvider.Browser.cs @@ -1,19 +1,19 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.IO; using System.Diagnostics; -using System.Security.Cryptography; +using Internal.Cryptography; + using static System.Numerics.BitOperations; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed class SHAHashProvider : HashProvider { private int hashSizeInBytes; private SHAManagedImplementationBase impl; - private MemoryStream buffer; + private MemoryStream? buffer; public SHAHashProvider(string hashAlgorithmId) { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SignatureDescription.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SignatureDescription.cs similarity index 96% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SignatureDescription.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SignatureDescription.cs index 6ea774a53b41db..6415c9e5c03ae4 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SignatureDescription.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/SignatureDescription.cs @@ -2,11 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics.CodeAnalysis; -using System.Runtime.Versioning; namespace System.Security.Cryptography { - [UnsupportedOSPlatform("browser")] public class SignatureDescription { public string? KeyAlgorithm { get; set; } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/TripleDES.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/TripleDES.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/TripleDES.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/TripleDES.cs index 78a5dffe32d271..f81aa38669a04f 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/TripleDES.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/TripleDES.cs @@ -9,7 +9,6 @@ namespace System.Security.Cryptography { [SuppressMessage("Microsoft.Security", "CA5350", Justification = "We are providing the implementation for TripleDES, not consuming it.")] - [UnsupportedOSPlatform("browser")] public abstract class TripleDES : SymmetricAlgorithm { protected TripleDES() @@ -21,6 +20,7 @@ protected TripleDES() LegalKeySizesValue = s_legalKeySizes.CloneKeySizesArray(); } + [UnsupportedOSPlatform("browser")] public static new TripleDES Create() { return new TripleDesImplementation(); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.OSX.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/TripleDesImplementation.Apple.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.OSX.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/TripleDesImplementation.Apple.cs index 2f5d4d35594376..a94f8c13453189 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.OSX.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/TripleDesImplementation.Apple.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Security.Cryptography; +using Internal.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed partial class TripleDesImplementation { diff --git a/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/TripleDesImplementation.NotSupported.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/TripleDesImplementation.NotSupported.cs new file mode 100644 index 00000000000000..8bffe0f665219e --- /dev/null +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/TripleDesImplementation.NotSupported.cs @@ -0,0 +1,36 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Internal.Cryptography; + +namespace System.Security.Cryptography +{ + internal sealed partial class TripleDesImplementation : TripleDES + { + private static UniversalCryptoTransform CreateTransformCore( + CipherMode cipherMode, + PaddingMode paddingMode, + byte[] key, + byte[]? iv, + int blockSize, + int paddingSize, + int feedbackSize, + bool encrypting) + { + throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(TripleDES))); + } + + private static ILiteSymmetricCipher CreateLiteCipher( + CipherMode cipherMode, + PaddingMode paddingMode, + ReadOnlySpan key, + ReadOnlySpan iv, + int blockSize, + int paddingSize, + int feedbackSize, + bool encrypting) + { + throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_AlgorithmNotSupported, nameof(TripleDES))); + } + } +} diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.Unix.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/TripleDesImplementation.OpenSsl.cs similarity index 96% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.Unix.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/TripleDesImplementation.OpenSsl.cs index 475ca6d31809c5..98a2262f1bd861 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.Unix.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/TripleDesImplementation.OpenSsl.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Security.Cryptography; +using Internal.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed partial class TripleDesImplementation { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.Windows.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/TripleDesImplementation.Windows.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.Windows.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/TripleDesImplementation.Windows.cs index a62fa61af61137..9543b485ae4fee 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.Windows.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/TripleDesImplementation.Windows.cs @@ -1,11 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Security.Cryptography; +using Internal.Cryptography; using Internal.NativeCrypto; -namespace Internal.Cryptography +namespace System.Security.Cryptography { internal sealed partial class TripleDesImplementation { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/TripleDesImplementation.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/TripleDesImplementation.cs index efc9c9fc6f9b1f..dfb681dc42519b 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.cs +++ b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/TripleDesImplementation.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Security.Cryptography; +using Internal.Cryptography; -namespace Internal.Cryptography +namespace System.Security.Cryptography { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA5350", Justification = "We are providing the implementation for TripleDES, not consuming it.")] internal sealed partial class TripleDesImplementation : TripleDES diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/XmlKeyHelper.cs b/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/XmlKeyHelper.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/XmlKeyHelper.cs rename to src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/XmlKeyHelper.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/AesCcmTests.cs b/src/libraries/System.Security.Cryptography/tests/AesCcmTests.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/AesCcmTests.cs rename to src/libraries/System.Security.Cryptography/tests/AesCcmTests.cs index eeb1f7edac2dcc..1d662f9a085c85 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/AesCcmTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/AesCcmTests.cs @@ -6,7 +6,7 @@ using Test.Cryptography; using Xunit; -namespace System.Security.Cryptography.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [ConditionalClass(typeof(AesCcm), nameof(AesCcm.IsSupported))] public class AesCcmTests : CommonAEADTests diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/AesGcmTests.cs b/src/libraries/System.Security.Cryptography/tests/AesGcmTests.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/AesGcmTests.cs rename to src/libraries/System.Security.Cryptography/tests/AesGcmTests.cs index 0322e37aac23ca..1a41a2beb3f83d 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/AesGcmTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/AesGcmTests.cs @@ -6,7 +6,7 @@ using Test.Cryptography; using Xunit; -namespace System.Security.Cryptography.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [ConditionalClass(typeof(AesGcm), nameof(AesGcm.IsSupported))] public class AesGcmTests : CommonAEADTests diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/AesManagedTests.cs b/src/libraries/System.Security.Cryptography/tests/AesManagedTests.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/AesManagedTests.cs rename to src/libraries/System.Security.Cryptography/tests/AesManagedTests.cs index 343db25c2e6a07..2db62616df8a5b 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/AesManagedTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/AesManagedTests.cs @@ -6,7 +6,7 @@ using Test.Cryptography; using Xunit; -namespace System.Security.Cryptography.Encryption.Aes.Tests +namespace System.Security.Cryptography.Tests { /// /// Since AesManaged wraps Aes, we only test minimally here. diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/AesProvider.cs b/src/libraries/System.Security.Cryptography/tests/AesProvider.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/AesProvider.cs rename to src/libraries/System.Security.Cryptography/tests/AesProvider.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/AesTests.cs b/src/libraries/System.Security.Cryptography/tests/AesTests.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/AesTests.cs rename to src/libraries/System.Security.Cryptography/tests/AesTests.cs index ab562651375901..815014cc908b76 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/AesTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/AesTests.cs @@ -3,7 +3,7 @@ using Xunit; -namespace System.Security.Cryptography.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public partial class AesTests diff --git a/src/libraries/System.Security.Cryptography.Encoding/tests/AsnEncodedDataCollectionTests.cs b/src/libraries/System.Security.Cryptography/tests/AsnEncodedDataCollectionTests.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Encoding/tests/AsnEncodedDataCollectionTests.cs rename to src/libraries/System.Security.Cryptography/tests/AsnEncodedDataCollectionTests.cs index d7a7304d20a244..4ba11b2585ea6f 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/tests/AsnEncodedDataCollectionTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/AsnEncodedDataCollectionTests.cs @@ -1,14 +1,12 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.IO; -using System.Text; using System.Linq; using System.Collections; using System.Collections.Generic; using Xunit; -namespace System.Security.Cryptography.Encoding.Tests +namespace System.Security.Cryptography.Tests { public static class AsnEncodedDataCollectionTests { diff --git a/src/libraries/System.Security.Cryptography.Encoding/tests/AsnEncodedData.cs b/src/libraries/System.Security.Cryptography/tests/AsnEncodedDataTests.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Encoding/tests/AsnEncodedData.cs rename to src/libraries/System.Security.Cryptography/tests/AsnEncodedDataTests.cs index 0f63a74998dd43..a72d6814fea80f 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/tests/AsnEncodedData.cs +++ b/src/libraries/System.Security.Cryptography/tests/AsnEncodedDataTests.cs @@ -4,7 +4,7 @@ using Test.Cryptography; using Xunit; -namespace System.Security.Cryptography.Encoding.Tests +namespace System.Security.Cryptography.Tests { public class AsnEncodedDataTests { diff --git a/src/libraries/System.Security.Cryptography/tests/AsymmetricAlgorithm/Trivial.cs b/src/libraries/System.Security.Cryptography/tests/AsymmetricAlgorithm/Trivial.cs index c9e6caf6f7199d..1fb2f0306aa8ef 100644 --- a/src/libraries/System.Security.Cryptography/tests/AsymmetricAlgorithm/Trivial.cs +++ b/src/libraries/System.Security.Cryptography/tests/AsymmetricAlgorithm/Trivial.cs @@ -4,7 +4,7 @@ using System.Linq; using Xunit; -namespace System.Security.Cryptography.Encryption.Tests.Asymmetric +namespace System.Security.Cryptography.Tests.Asymmetric { public static class TrivialTests { diff --git a/src/libraries/System.Security.Cryptography/tests/AsymmetricAlgorithmTests.cs b/src/libraries/System.Security.Cryptography/tests/AsymmetricAlgorithmTests.cs new file mode 100644 index 00000000000000..ca40479e6c2583 --- /dev/null +++ b/src/libraries/System.Security.Cryptography/tests/AsymmetricAlgorithmTests.cs @@ -0,0 +1,543 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Xunit; + +namespace System.Security.Cryptography.Tests +{ + public static class AsymmetricAlgorithmTests + { + [Fact] + public static void ImportFromPem_AcceptsSubjectPublicKeyInfo() + { + string pemText = @" + Test that this PEM block is skipped since it is not an understood PEM label. + -----BEGIN SLEEPING----- + zzzz + -----END SLEEPING----- + -----BEGIN PUBLIC KEY----- + c2xlZXA= + -----END PUBLIC KEY-----"; + + static void ImportSubjectPublicKeyInfo(ReadOnlySpan source, out int bytesRead) + { + ReadOnlySpan expected = new byte[] { 0x73, 0x6c, 0x65, 0x65, 0x70 }; + AssertExtensions.SequenceEqual(expected, source); + bytesRead = expected.Length; + } + + using (StubAsymmetricAlgorithm alg = new StubAsymmetricAlgorithm()) + { + alg.ImportSubjectPublicKeyInfoImpl = ImportSubjectPublicKeyInfo; + alg.ImportFromPem(pemText); + } + } + + [Fact] + public static void ImportFromPem_AcceptsPkcs8PrivateKey() + { + string pemText = @" + Test that this PEM block is skipped since it is not an understood PEM label. + -----BEGIN SLEEPING----- + zzzz + -----END SLEEPING----- + -----BEGIN PRIVATE KEY----- + c2xlZXA= + -----END PRIVATE KEY-----"; + + static void ImportPkcs8PrivateKey(ReadOnlySpan source, out int bytesRead) + { + ReadOnlySpan expected = new byte[] { 0x73, 0x6c, 0x65, 0x65, 0x70 }; + AssertExtensions.SequenceEqual(expected, source); + bytesRead = expected.Length; + } + + using (StubAsymmetricAlgorithm alg = new StubAsymmetricAlgorithm()) + { + alg.ImportPkcs8PrivateKeyImpl = ImportPkcs8PrivateKey; + alg.ImportFromPem(pemText); + } + } + + [Fact] + public static void ImportFromPem_AcceptsEncryptedPkcs8PrivateKey_PasswordBytes() + { + string pemText = @" + Test that this PEM block is skipped since it is not an understood PEM label. + -----BEGIN SLEEPING----- + zzzz + -----END SLEEPING----- + -----BEGIN ENCRYPTED PRIVATE KEY----- + c2xlZXA= + -----END ENCRYPTED PRIVATE KEY-----"; + byte[] pemPassword = new byte[] { 1, 2, 3, 4, 5 }; + + void ImportEncryptedPkcs8PrivateKey( + ReadOnlySpan passwordBytes, + ReadOnlySpan source, + out int bytesRead) + { + ReadOnlySpan expected = new byte[] { 0x73, 0x6c, 0x65, 0x65, 0x70 }; + AssertExtensions.SequenceEqual(expected, source); + AssertExtensions.SequenceEqual(pemPassword, passwordBytes); + bytesRead = expected.Length; + } + + using (StubAsymmetricAlgorithm alg = new StubAsymmetricAlgorithm()) + { + alg.ImportEncryptedPkcs8PrivateKeyByteFunc = ImportEncryptedPkcs8PrivateKey; + alg.ImportFromEncryptedPem(pemText, pemPassword); + } + } + + [Fact] + public static void ImportFromPem_AcceptsEncryptedPkcs8PrivateKey_PasswordChars() + { + string pemText = @" + Test that this PEM block is skipped since it is not an understood PEM label. + -----BEGIN SLEEPING----- + zzzz + -----END SLEEPING----- + -----BEGIN ENCRYPTED PRIVATE KEY----- + c2xlZXA= + -----END ENCRYPTED PRIVATE KEY-----"; + string pemPassword = "PLACEHOLDER"; + + void ImportEncryptedPkcs8PrivateKey( + ReadOnlySpan password, + ReadOnlySpan source, + out int bytesRead) + { + ReadOnlySpan expected = new byte[] { 0x73, 0x6c, 0x65, 0x65, 0x70 }; + AssertExtensions.SequenceEqual(expected, source); + AssertExtensions.SequenceEqual(pemPassword, password); + bytesRead = expected.Length; + } + + using (StubAsymmetricAlgorithm alg = new StubAsymmetricAlgorithm()) + { + alg.ImportEncryptedPkcs8PrivateKeyCharFunc = ImportEncryptedPkcs8PrivateKey; + alg.ImportFromEncryptedPem(pemText, pemPassword); + } + } + + [Fact] + public static void ImportFromPem_AmbiguousKey() + { + string pemText = @" + -----BEGIN PUBLIC KEY----- + c2xlZXA= + -----END PUBLIC KEY----- + -----BEGIN PUBLIC KEY----- + Y29mZmVl + -----END PUBLIC KEY-----"; + + using (StubAsymmetricAlgorithm alg = new StubAsymmetricAlgorithm()) + { + AssertExtensions.Throws("input", () => alg.ImportFromPem(pemText)); + } + } + + [Fact] + public static void ImportFromPem_Encrypted_AmbiguousKey() + { + string pemText = @" + -----BEGIN ENCRYPTED PRIVATE KEY----- + c2xlZXA= + -----END ENCRYPTED PRIVATE KEY----- + -----BEGIN ENCRYPTED PRIVATE KEY----- + Y29mZmVl + -----END ENCRYPTED PRIVATE KEY-----"; + string pemPassword = "PLACEHOLDER"; + + using (StubAsymmetricAlgorithm alg = new StubAsymmetricAlgorithm()) + { + AssertExtensions.Throws("input", () => alg.ImportFromEncryptedPem(pemText, pemPassword)); + } + } + + [Fact] + public static void ImportFromPem_NoUnderstoodPemLabel() + { + string pemText = @" + -----BEGIN SLEEPING----- + zzzz + -----END SLEEPING-----"; + + using (StubAsymmetricAlgorithm alg = new StubAsymmetricAlgorithm()) + { + AssertExtensions.Throws("input", () => alg.ImportFromPem(pemText)); + } + } + + [Fact] + public static void ImportFromPem_Encrypted_NoUnderstoodPemLabel() + { + string pemText = @" + -----BEGIN SLEEPING----- + zzzz + -----END SLEEPING-----"; + string pemPassword = "PLACEHOLDER"; + + using (StubAsymmetricAlgorithm alg = new StubAsymmetricAlgorithm()) + { + AssertExtensions.Throws("input", () => alg.ImportFromEncryptedPem(pemText, pemPassword)); + } + } + + [Fact] + public static void ImportFromPem_EncryptedPemWithoutPassword() + { + string pemText = @" + -----BEGIN ENCRYPTED PRIVATE KEY----- + c2xlZXA= + -----END ENCRYPTED PRIVATE KEY-----"; + + using (StubAsymmetricAlgorithm alg = new StubAsymmetricAlgorithm()) + { + AssertExtensions.Throws("input", () => alg.ImportFromPem(pemText)); + } + } + + [Fact] + public static void ImportFromPem_NotEncryptedWithPassword() + { + string pemText = @" + -----BEGIN PRIVATE KEY----- + c2xlZXA= + -----END PRIVATE KEY-----"; + string pemPassword = "PLACEHOLDER"; + + using (StubAsymmetricAlgorithm alg = new StubAsymmetricAlgorithm()) + { + AssertExtensions.Throws("input", () => alg.ImportFromEncryptedPem(pemText, pemPassword)); + } + } + + [Fact] + public static void ExportPem_ExportSubjectPublicKeyInfoPem() + { + string expectedPem = + "-----BEGIN PUBLIC KEY-----\n" + + "cGVubnk=\n" + + "-----END PUBLIC KEY-----"; + + using (StubAsymmetricAlgorithm alg = new StubAsymmetricAlgorithm()) + { + alg.ExportSubjectPublicKeyInfoImpl = static () => new byte[] { 0x70, 0x65, 0x6e, 0x6e, 0x79 }; + string pem = alg.ExportSubjectPublicKeyInfoPem(); + Assert.Equal(expectedPem, pem); + } + } + + [Fact] + public static void ExportPem_TryExportSubjectPublicKeyInfoPem() + { + string expectedPem = + "-----BEGIN PUBLIC KEY-----\n" + + "cGVubnk=\n" + + "-----END PUBLIC KEY-----"; + + static bool TryExportSubjectPublicKeyInfo(Span destination, out int bytesWritten) + { + ReadOnlySpan result = new byte[] { 0x70, 0x65, 0x6e, 0x6e, 0x79 }; + bytesWritten = result.Length; + result.CopyTo(destination); + return true; + } + + using (StubAsymmetricAlgorithm alg = new StubAsymmetricAlgorithm()) + { + alg.TryExportSubjectPublicKeyInfoImpl = TryExportSubjectPublicKeyInfo; + int written; + bool result; + char[] buffer; + + // buffer not enough + buffer = new char[expectedPem.Length - 1]; + result = alg.TryExportSubjectPublicKeyInfoPem(buffer, out written); + Assert.False(result, nameof(alg.TryExportSubjectPublicKeyInfoPem)); + Assert.Equal(0, written); + + // buffer just enough + buffer = new char[expectedPem.Length]; + result = alg.TryExportSubjectPublicKeyInfoPem(buffer, out written); + Assert.True(result, nameof(alg.TryExportSubjectPublicKeyInfoPem)); + Assert.Equal(expectedPem.Length, written); + Assert.Equal(expectedPem, new string(buffer)); + + // buffer more than enough + buffer = new char[expectedPem.Length + 20]; + buffer.AsSpan().Fill('!'); + Span bufferSpan = buffer.AsSpan(10); + result = alg.TryExportSubjectPublicKeyInfoPem(bufferSpan, out written); + Assert.True(result, nameof(alg.TryExportSubjectPublicKeyInfoPem)); + Assert.Equal(expectedPem.Length, written); + Assert.Equal(expectedPem, new string(bufferSpan.Slice(0, written))); + + // Ensure padding has not been touched. + AssertExtensions.FilledWith('!', buffer[0..10]); + AssertExtensions.FilledWith('!', buffer[^10..]); + } + } + + [Fact] + public static void ExportPem_TryExportPkcs8PrivateKeyPem() + { + string expectedPem = + "-----BEGIN PRIVATE KEY-----\n" + + "cGVubnk=\n" + + "-----END PRIVATE KEY-----"; + + static bool TryExportPkcs8PrivateKey(Span destination, out int bytesWritten) + { + ReadOnlySpan result = new byte[] { 0x70, 0x65, 0x6e, 0x6e, 0x79 }; + bytesWritten = result.Length; + result.CopyTo(destination); + return true; + } + + using (StubAsymmetricAlgorithm alg = new StubAsymmetricAlgorithm()) + { + alg.TryExportPkcs8PrivateKeyImpl = TryExportPkcs8PrivateKey; + int written; + bool result; + char[] buffer; + + // buffer not enough + buffer = new char[expectedPem.Length - 1]; + result = alg.TryExportPkcs8PrivateKeyPem(buffer, out written); + Assert.False(result, nameof(alg.TryExportPkcs8PrivateKeyPem)); + Assert.Equal(0, written); + + // buffer just enough + buffer = new char[expectedPem.Length]; + result = alg.TryExportPkcs8PrivateKeyPem(buffer, out written); + Assert.True(result, nameof(alg.TryExportPkcs8PrivateKeyPem)); + Assert.Equal(expectedPem.Length, written); + Assert.Equal(expectedPem, new string(buffer)); + + // buffer more than enough + buffer = new char[expectedPem.Length + 20]; + buffer.AsSpan().Fill('!'); + Span bufferSpan = buffer.AsSpan(10); + result = alg.TryExportPkcs8PrivateKeyPem(bufferSpan, out written); + Assert.True(result, nameof(alg.TryExportPkcs8PrivateKeyPem)); + Assert.Equal(expectedPem.Length, written); + Assert.Equal(expectedPem, new string(bufferSpan.Slice(0, written))); + + // Ensure padding has not been touched. + AssertExtensions.FilledWith('!', buffer[0..10]); + AssertExtensions.FilledWith('!', buffer[^10..]); + } + } + + [Fact] + public static void ExportPem_ExportPkcs8PrivateKeyPem() + { + string expectedPem = + "-----BEGIN PRIVATE KEY-----\n" + + "cGVubnk=\n" + + "-----END PRIVATE KEY-----"; + + byte[] exportedBytes = new byte[] { 0x70, 0x65, 0x6e, 0x6e, 0x79 }; + + using (StubAsymmetricAlgorithm alg = new StubAsymmetricAlgorithm()) + { + alg.ExportPkcs8PrivateKeyPemImpl = () => exportedBytes; + string pem = alg.ExportPkcs8PrivateKeyPem(); + Assert.Equal(expectedPem, pem); + + // Test that the PEM export cleared the PKCS8 bytes from memory + // that were returned from ExportPkcs8PrivateKey. + AssertExtensions.FilledWith((byte)0, exportedBytes); + } + } + + [Fact] + public static void ExportPem_ExportEncryptedPkcs8PrivateKeyPem() + { + string expectedPem = + "-----BEGIN ENCRYPTED PRIVATE KEY-----\n" + + "cGVubnk=\n" + + "-----END ENCRYPTED PRIVATE KEY-----"; + + byte[] exportedBytes = new byte[] { 0x70, 0x65, 0x6e, 0x6e, 0x79 }; + string expectedPassword = "PLACEHOLDER"; + PbeParameters expectedPbeParameters = new PbeParameters( + PbeEncryptionAlgorithm.Aes256Cbc, + HashAlgorithmName.SHA384, + RandomNumberGenerator.GetInt32(0, 100_000)); + + byte[] ExportEncryptedPkcs8PrivateKey(ReadOnlySpan password, PbeParameters pbeParameters) + { + Assert.Equal(expectedPbeParameters.EncryptionAlgorithm, pbeParameters.EncryptionAlgorithm); + Assert.Equal(expectedPbeParameters.HashAlgorithm, pbeParameters.HashAlgorithm); + Assert.Equal(expectedPbeParameters.IterationCount, pbeParameters.IterationCount); + Assert.Equal(expectedPassword, new string(password)); + + return exportedBytes; + } + + using (StubAsymmetricAlgorithm alg = new StubAsymmetricAlgorithm()) + { + alg.ExportEncryptedPkcs8PrivateKeyImpl = ExportEncryptedPkcs8PrivateKey; + string pem = alg.ExportEncryptedPkcs8PrivateKeyPem(expectedPassword, expectedPbeParameters); + Assert.Equal(expectedPem, pem); + + // Test that the PEM export cleared the PKCS8 bytes from memory + // that were returned from ExportEncryptedPkcs8PrivateKey. + AssertExtensions.FilledWith((byte)0, exportedBytes); + } + } + + [Fact] + public static void ExportPem_TryExportEncryptedPkcs8PrivateKeyPem() + { + string expectedPem = + "-----BEGIN ENCRYPTED PRIVATE KEY-----\n" + + "cGVubnk=\n" + + "-----END ENCRYPTED PRIVATE KEY-----"; + + byte[] exportedBytes = new byte[] { 0x70, 0x65, 0x6e, 0x6e, 0x79 }; + string expectedPassword = "PLACEHOLDER"; + PbeParameters expectedPbeParameters = new PbeParameters( + PbeEncryptionAlgorithm.Aes256Cbc, + HashAlgorithmName.SHA384, + RandomNumberGenerator.GetInt32(0, 100_000)); + + bool TryExportEncryptedPkcs8PrivateKey( + ReadOnlySpan password, + PbeParameters pbeParameters, + Span destination, + out int bytesWritten) + { + Assert.Equal(expectedPbeParameters.EncryptionAlgorithm, pbeParameters.EncryptionAlgorithm); + Assert.Equal(expectedPbeParameters.HashAlgorithm, pbeParameters.HashAlgorithm); + Assert.Equal(expectedPbeParameters.IterationCount, pbeParameters.IterationCount); + Assert.Equal(expectedPassword, new string(password)); + + exportedBytes.AsSpan().CopyTo(destination); + bytesWritten = exportedBytes.Length; + return true; + } + + using (StubAsymmetricAlgorithm alg = new StubAsymmetricAlgorithm()) + { + alg.TryExportEncryptedPkcs8PrivateKeyImpl = TryExportEncryptedPkcs8PrivateKey; + int written; + bool result; + char[] buffer; + + // buffer not enough + buffer = new char[expectedPem.Length - 1]; + result = alg.TryExportEncryptedPkcs8PrivateKeyPem(expectedPassword, expectedPbeParameters, buffer, out written); + Assert.False(result, nameof(alg.TryExportEncryptedPkcs8PrivateKeyPem)); + Assert.Equal(0, written); + + // buffer just enough + buffer = new char[expectedPem.Length]; + result = alg.TryExportEncryptedPkcs8PrivateKeyPem(expectedPassword, expectedPbeParameters, buffer, out written); + Assert.True(result, nameof(alg.TryExportEncryptedPkcs8PrivateKeyPem)); + Assert.Equal(expectedPem.Length, written); + Assert.Equal(expectedPem, new string(buffer)); + + // buffer more than enough + buffer = new char[expectedPem.Length + 20]; + buffer.AsSpan().Fill('!'); + Span bufferSpan = buffer.AsSpan(10); + result = alg.TryExportEncryptedPkcs8PrivateKeyPem(expectedPassword, expectedPbeParameters, bufferSpan, out written); + Assert.True(result, nameof(alg.TryExportEncryptedPkcs8PrivateKeyPem)); + Assert.Equal(expectedPem.Length, written); + Assert.Equal(expectedPem, new string(bufferSpan.Slice(0, written))); + + // Ensure padding has not been touched. + AssertExtensions.FilledWith('!', buffer[0..10]); + AssertExtensions.FilledWith('!', buffer[^10..]); + } + } + + private class StubAsymmetricAlgorithm : AsymmetricAlgorithm + { + public delegate byte[] ExportSubjectPublicKeyInfoFunc(); + public delegate byte[] ExportPkcs8PrivateKeyPemFunc(); + public delegate byte[] ExportEncryptedPkcs8PrivateKeyFunc(ReadOnlySpan password, PbeParameters pbeParameters); + public delegate bool TryExportSubjectPublicKeyInfoFunc(Span destination, out int bytesWritten); + public delegate bool TryExportPkcs8PrivateKeyFunc(Span destination, out int bytesWritten); + public delegate void ImportSubjectPublicKeyInfoFunc(ReadOnlySpan source, out int bytesRead); + public delegate void ImportPkcs8PrivateKeyFunc(ReadOnlySpan source, out int bytesRead); + public delegate void ImportEncryptedPkcs8PrivateKeyFunc( + ReadOnlySpan password, + ReadOnlySpan source, + out int bytesRead); + public delegate bool TryExportEncryptedPkcs8PrivateKeyFunc( + ReadOnlySpan password, + PbeParameters pbeParameters, + Span destination, + out int bytesWritten); + + public ImportSubjectPublicKeyInfoFunc ImportSubjectPublicKeyInfoImpl { get; set; } + public ImportPkcs8PrivateKeyFunc ImportPkcs8PrivateKeyImpl { get; set; } + public ImportEncryptedPkcs8PrivateKeyFunc ImportEncryptedPkcs8PrivateKeyByteFunc { get; set; } + public ImportEncryptedPkcs8PrivateKeyFunc ImportEncryptedPkcs8PrivateKeyCharFunc { get; set; } + public ExportSubjectPublicKeyInfoFunc ExportSubjectPublicKeyInfoImpl {get; set; } + public TryExportSubjectPublicKeyInfoFunc TryExportSubjectPublicKeyInfoImpl { get; set; } + public ExportPkcs8PrivateKeyPemFunc ExportPkcs8PrivateKeyPemImpl { get; set; } + public TryExportPkcs8PrivateKeyFunc TryExportPkcs8PrivateKeyImpl { get; set; } + public ExportEncryptedPkcs8PrivateKeyFunc ExportEncryptedPkcs8PrivateKeyImpl { get; set; } + public TryExportEncryptedPkcs8PrivateKeyFunc TryExportEncryptedPkcs8PrivateKeyImpl { get; set; } + + public override void ImportSubjectPublicKeyInfo(ReadOnlySpan source, out int bytesRead) => + ImportSubjectPublicKeyInfoImpl(source, out bytesRead); + + public override void ImportPkcs8PrivateKey(ReadOnlySpan source, out int bytesRead) => + ImportPkcs8PrivateKeyImpl(source, out bytesRead); + + public override byte[] ExportSubjectPublicKeyInfo() => ExportSubjectPublicKeyInfoImpl(); + public override byte[] ExportPkcs8PrivateKey() => ExportPkcs8PrivateKeyPemImpl(); + + public override byte[] ExportEncryptedPkcs8PrivateKey(ReadOnlySpan password, PbeParameters pbeParameters) + { + return ExportEncryptedPkcs8PrivateKeyImpl(password, pbeParameters); + } + + public override void ImportEncryptedPkcs8PrivateKey( + ReadOnlySpan passwordBytes, + ReadOnlySpan source, + out int bytesRead) + { + ImportEncryptedPkcs8PrivateKeyByteFunc(passwordBytes, source, out bytesRead); + } + + public override void ImportEncryptedPkcs8PrivateKey( + ReadOnlySpan password, + ReadOnlySpan source, + out int bytesRead) + { + ImportEncryptedPkcs8PrivateKeyCharFunc(password, source, out bytesRead); + } + + public override bool TryExportSubjectPublicKeyInfo(Span destination, out int bytesWritten) + { + return TryExportSubjectPublicKeyInfoImpl(destination, out bytesWritten); + } + + public override bool TryExportPkcs8PrivateKey(Span destination, out int bytesWritten) + { + return TryExportPkcs8PrivateKeyImpl(destination, out bytesWritten); + } + + public override bool TryExportEncryptedPkcs8PrivateKey( + ReadOnlySpan password, + PbeParameters pbeParameters, + Span destination, + out int bytesWritten) + { + return TryExportEncryptedPkcs8PrivateKeyImpl(password, pbeParameters, destination, out bytesWritten); + } + } + } +} diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/AsymmetricSignatureFormatterTests.cs b/src/libraries/System.Security.Cryptography/tests/AsymmetricSignatureFormatterTests.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/AsymmetricSignatureFormatterTests.cs rename to src/libraries/System.Security.Cryptography/tests/AsymmetricSignatureFormatterTests.cs diff --git a/src/libraries/System.Security.Cryptography.Encoding/tests/Base64TransformsTests.cs b/src/libraries/System.Security.Cryptography/tests/Base64TransformsTests.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Encoding/tests/Base64TransformsTests.cs rename to src/libraries/System.Security.Cryptography/tests/Base64TransformsTests.cs index 1a6cc5ed1824e8..72ee58f6031f28 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/tests/Base64TransformsTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/Base64TransformsTests.cs @@ -6,7 +6,7 @@ using System.Linq; using Xunit; -namespace System.Security.Cryptography.Encoding.Tests +namespace System.Security.Cryptography.Tests { public class Base64TransformsTests { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/BlockSizeValueTests.cs b/src/libraries/System.Security.Cryptography/tests/BlockSizeValueTests.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/BlockSizeValueTests.cs rename to src/libraries/System.Security.Cryptography/tests/BlockSizeValueTests.cs index 2f2756ec4c2904..2ea65c6d32951d 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/BlockSizeValueTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/BlockSizeValueTests.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Collections.Generic; using Xunit; -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public class BlockSizeValueTests diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/ChaCha20Poly1305Tests.cs b/src/libraries/System.Security.Cryptography/tests/ChaCha20Poly1305Tests.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/ChaCha20Poly1305Tests.cs rename to src/libraries/System.Security.Cryptography/tests/ChaCha20Poly1305Tests.cs index a6949919686b5a..7d39b45922fb32 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/ChaCha20Poly1305Tests.cs +++ b/src/libraries/System.Security.Cryptography/tests/ChaCha20Poly1305Tests.cs @@ -2,12 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; -using System.Diagnostics; using System.Linq; using Test.Cryptography; using Xunit; -namespace System.Security.Cryptography.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [ConditionalClass(typeof(ChaCha20Poly1305), nameof(ChaCha20Poly1305.IsSupported))] public class ChaCha20Poly1305Tests : CommonAEADTests diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/CngUtility.cs b/src/libraries/System.Security.Cryptography/tests/CngUtility.cs similarity index 97% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/CngUtility.cs rename to src/libraries/System.Security.Cryptography/tests/CngUtility.cs index e22d6ae8e78717..9d23acdf063fa2 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/CngUtility.cs +++ b/src/libraries/System.Security.Cryptography/tests/CngUtility.cs @@ -4,7 +4,7 @@ using System.Runtime.InteropServices; using Xunit; -namespace System.Security.Cryptography.Algorithms.Tests +namespace System.Security.Cryptography.Tests { internal static class CngUtility { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/CommonAEADTests.cs b/src/libraries/System.Security.Cryptography/tests/CommonAEADTests.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/CommonAEADTests.cs rename to src/libraries/System.Security.Cryptography/tests/CommonAEADTests.cs index eb774ecd879b84..758f5f391481c6 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/CommonAEADTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/CommonAEADTests.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -namespace System.Security.Cryptography.Algorithms.Tests +namespace System.Security.Cryptography.Tests { public abstract class CommonAEADTests { diff --git a/src/libraries/System.Security.Cryptography/tests/CryptoConfigTests.cs b/src/libraries/System.Security.Cryptography/tests/CryptoConfigTests.cs index 3dc54ba99c4d40..3ccc914ffb7825 100644 --- a/src/libraries/System.Security.Cryptography/tests/CryptoConfigTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/CryptoConfigTests.cs @@ -1,10 +1,13 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Collections.Generic; +using System.Reflection; +using System.Text; using Test.Cryptography; using Xunit; -namespace System.Security.Cryptography.CryptoConfigTests +namespace System.Security.Cryptography.Tests { public static class CryptoConfigTests { @@ -184,5 +187,437 @@ public static void NamedCreate_Unknown() Assert.Null(HMAC.Create(UnknownAlgorithmName)); Assert.Null(SymmetricAlgorithm.Create(UnknownAlgorithmName)); } + + [Fact] + public static void AllowOnlyFipsAlgorithms() + { + Assert.False(CryptoConfig.AllowOnlyFipsAlgorithms); + } + + [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + public static void AddOID_MapNameToOID_ReturnsMapped() + { + CryptoConfig.AddOID("1.3.14.3.2.28", "SHAFancy"); + Assert.Equal("1.3.14.3.2.28", CryptoConfig.MapNameToOID("SHAFancy")); + } + + [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + public static void AddOID_EmptyString_Throws() + { + AssertExtensions.Throws(null, () => CryptoConfig.AddOID(string.Empty, string.Empty)); + } + + [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + public static void AddOID_EmptyNamesArray() + { + CryptoConfig.AddOID("1.3.14.3.2.28", new string[0]); + // There is no verifiable behavior in this case. We only check that we don't throw. + } + + [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + public static void AddOID_NullOid_Throws() + { + AssertExtensions.Throws("oid", () => CryptoConfig.AddOID(null, string.Empty)); + } + + [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + public static void AddOID_NullNames_Throws() + { + AssertExtensions.Throws("names", () => CryptoConfig.AddOID(string.Empty, null)); + } + + [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + public static void AddAlgorithm_CreateFromName_ReturnsMapped() + { + CryptoConfig.AddAlgorithm(typeof(AesCryptoServiceProvider), "AESFancy"); + Assert.Equal(typeof(AesCryptoServiceProvider).FullName, CryptoConfig.CreateFromName("AESFancy").GetType().FullName); + } + + [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + public static void AddAlgorithm_NonVisibleType() + { + AssertExtensions.Throws("algorithm", () => CryptoConfig.AddAlgorithm(typeof(AESFancy), "AESFancy")); + } + + private class AESFancy + { + } + + [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + public static void AddAlgorithm_EmptyString_Throws() + { + AssertExtensions.Throws(null, () => CryptoConfig.AddAlgorithm(typeof(CryptoConfigTests), string.Empty)); + } + + [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + public static void AddAlgorithm_EmptyNamesArray() + { + CryptoConfig.AddAlgorithm(typeof(AesCryptoServiceProvider), new string[0]); + // There is no verifiable behavior in this case. We only check that we don't throw. + } + + [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + public static void AddAlgorithm_NullAlgorithm_Throws() + { + AssertExtensions.Throws("algorithm", () => CryptoConfig.AddAlgorithm(null, string.Empty)); + } + + [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + public static void AddAlgorithm_NullNames_Throws() + { + AssertExtensions.Throws("names", () => CryptoConfig.AddAlgorithm(typeof(CryptoConfigTests), null)); + } + + [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + public static void StaticCreateMethods() + { + // Ensure static create methods exist and don't throw + + // Some do not have public concrete types (in Algorithms assembly) so in those cases we only check for null\failure. + VerifyStaticCreateResult(Aes.Create(typeof(AesManaged).FullName), typeof(AesManaged)); + Assert.Null(DES.Create(string.Empty)); + Assert.Null(DSA.Create(string.Empty)); + Assert.Null(ECDsa.Create(string.Empty)); + Assert.Null(MD5.Create(string.Empty)); + Assert.Null(RandomNumberGenerator.Create(string.Empty)); + Assert.Null(RC2.Create(string.Empty)); +#pragma warning disable SYSLIB0022 // Rijndael types are obsolete + VerifyStaticCreateResult(Rijndael.Create(typeof(RijndaelManaged).FullName), typeof(RijndaelManaged)); + Assert.Null(RSA.Create(string.Empty)); + Assert.Null(SHA1.Create(string.Empty)); + VerifyStaticCreateResult(SHA256.Create(typeof(SHA256Managed).FullName), typeof(SHA256Managed)); + VerifyStaticCreateResult(SHA384.Create(typeof(SHA384Managed).FullName), typeof(SHA384Managed)); + VerifyStaticCreateResult(SHA512.Create(typeof(SHA512Managed).FullName), typeof(SHA512Managed)); +#pragma warning restore SYSLIB0022 // Rijndael types are obsolete + } + + private static void VerifyStaticCreateResult(object obj, Type expectedType) + { + Assert.NotNull(obj); + Assert.IsType(expectedType, obj); + } + + [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + public static void MapNameToOID() + { + Assert.Throws(() => CryptoConfig.MapNameToOID(null)); + + // Test some oids unique to CryptoConfig + Assert.Equal("1.3.14.3.2.26", CryptoConfig.MapNameToOID("SHA")); + Assert.Equal("1.3.14.3.2.26", CryptoConfig.MapNameToOID("sha")); + Assert.Equal("1.2.840.113549.3.7", CryptoConfig.MapNameToOID("TripleDES")); + + // Test fallback to Oid class + Assert.Equal("1.3.36.3.3.2.8.1.1.8", CryptoConfig.MapNameToOID("brainpoolP256t1")); + + // Invalid oid + Assert.Null(CryptoConfig.MapNameToOID("NOT_A_VALID_OID")); + } + + [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + public static void CreateFromName_validation() + { + Assert.Throws(() => CryptoConfig.CreateFromName(null)); + Assert.Throws(() => CryptoConfig.CreateFromName(null, null)); + Assert.Throws(() => CryptoConfig.CreateFromName(null, string.Empty)); + Assert.Null(CryptoConfig.CreateFromName(string.Empty, null)); + Assert.Null(CryptoConfig.CreateFromName("SHA", 1, 2)); + } + + public static IEnumerable AllValidNames + { + get + { + if (PlatformDetection.IsBrowser) + { + // Hash functions + yield return new object[] { "SHA", typeof(SHA1Managed).FullName, true }; + yield return new object[] { "SHA1", typeof(SHA1Managed).FullName, true }; + yield return new object[] { "System.Security.Cryptography.SHA1", typeof(SHA1Managed).FullName, true }; + yield return new object[] { "SHA256", typeof(SHA256Managed).FullName, true }; + yield return new object[] { "SHA-256", typeof(SHA256Managed).FullName, true }; + yield return new object[] { "System.Security.Cryptography.SHA256", typeof(SHA256Managed).FullName, true }; + yield return new object[] { "SHA384", typeof(SHA384Managed).FullName, true }; + yield return new object[] { "SHA-384", typeof(SHA384Managed).FullName, true }; + yield return new object[] { "System.Security.Cryptography.SHA384", typeof(SHA384Managed).FullName, true }; + yield return new object[] { "SHA512", typeof(SHA512Managed).FullName, true }; + yield return new object[] { "SHA-512", typeof(SHA512Managed).FullName, true }; + yield return new object[] { "System.Security.Cryptography.SHA512", typeof(SHA512Managed).FullName, true }; + } + else + { + // Random number generator + yield return new object[] { "RandomNumberGenerator", "System.Security.Cryptography.RNGCryptoServiceProvider", true }; + yield return new object[] { "System.Security.Cryptography.RandomNumberGenerator", "System.Security.Cryptography.RNGCryptoServiceProvider", true }; + + // Hash functions + yield return new object[] { "SHA", "System.Security.Cryptography.SHA1CryptoServiceProvider", true }; + yield return new object[] { "SHA1", "System.Security.Cryptography.SHA1CryptoServiceProvider", true }; + yield return new object[] { "System.Security.Cryptography.SHA1", "System.Security.Cryptography.SHA1CryptoServiceProvider", true }; + yield return new object[] { "System.Security.Cryptography.HashAlgorithm", "System.Security.Cryptography.SHA1CryptoServiceProvider", true }; + yield return new object[] { "MD5", "System.Security.Cryptography.MD5CryptoServiceProvider", true }; + yield return new object[] { "System.Security.Cryptography.MD5", "System.Security.Cryptography.MD5CryptoServiceProvider", true }; + yield return new object[] { "SHA256", typeof(SHA256Managed).FullName, true }; + yield return new object[] { "SHA-256", typeof(SHA256Managed).FullName, true }; + yield return new object[] { "System.Security.Cryptography.SHA256", typeof(SHA256Managed).FullName, true }; + yield return new object[] { "SHA384", typeof(SHA384Managed).FullName, true }; + yield return new object[] { "SHA-384", typeof(SHA384Managed).FullName, true }; + yield return new object[] { "System.Security.Cryptography.SHA384", typeof(SHA384Managed).FullName, true }; + yield return new object[] { "SHA512", typeof(SHA512Managed).FullName, true }; + yield return new object[] { "SHA-512", typeof(SHA512Managed).FullName, true }; + yield return new object[] { "System.Security.Cryptography.SHA512", typeof(SHA512Managed).FullName, true }; + + // Keyed Hash Algorithms + yield return new object[] { "System.Security.Cryptography.HMAC", "System.Security.Cryptography.HMACSHA1", true }; + yield return new object[] { "System.Security.Cryptography.KeyedHashAlgorithm", "System.Security.Cryptography.HMACSHA1", true }; + yield return new object[] { "HMACMD5", "System.Security.Cryptography.HMACMD5", true }; + yield return new object[] { "System.Security.Cryptography.HMACMD5", null, true }; + yield return new object[] { "HMACSHA1", "System.Security.Cryptography.HMACSHA1", true }; + yield return new object[] { "System.Security.Cryptography.HMACSHA1", null, true }; + yield return new object[] { "HMACSHA256", "System.Security.Cryptography.HMACSHA256", true }; + yield return new object[] { "System.Security.Cryptography.HMACSHA256", null, true }; + yield return new object[] { "HMACSHA384", "System.Security.Cryptography.HMACSHA384", true }; + yield return new object[] { "System.Security.Cryptography.HMACSHA384", null, true }; + yield return new object[] { "HMACSHA512", "System.Security.Cryptography.HMACSHA512", true }; + yield return new object[] { "System.Security.Cryptography.HMACSHA512", null, true }; + + // Asymmetric algorithms + yield return new object[] { "RSA", "System.Security.Cryptography.RSACryptoServiceProvider", true }; + yield return new object[] { "System.Security.Cryptography.RSA", "System.Security.Cryptography.RSACryptoServiceProvider", true }; + yield return new object[] { "System.Security.Cryptography.AsymmetricAlgorithm", "System.Security.Cryptography.RSACryptoServiceProvider", true }; + if (!PlatformDetection.UsesMobileAppleCrypto) + { + yield return new object[] { "DSA", "System.Security.Cryptography.DSACryptoServiceProvider", true }; + yield return new object[] { "System.Security.Cryptography.DSA", "System.Security.Cryptography.DSACryptoServiceProvider", true }; + } + yield return new object[] { "ECDsa", "System.Security.Cryptography.ECDsaCng", true }; + yield return new object[] { "ECDsaCng", "System.Security.Cryptography.ECDsaCng", false }; + yield return new object[] { "System.Security.Cryptography.ECDsaCng", null, false }; + yield return new object[] { "DES", "System.Security.Cryptography.DESCryptoServiceProvider", true }; + yield return new object[] { "System.Security.Cryptography.DES", "System.Security.Cryptography.DESCryptoServiceProvider", true }; + yield return new object[] { "3DES", "System.Security.Cryptography.TripleDESCryptoServiceProvider", true }; + yield return new object[] { "TripleDES", "System.Security.Cryptography.TripleDESCryptoServiceProvider", true }; + yield return new object[] { "Triple DES", "System.Security.Cryptography.TripleDESCryptoServiceProvider", true }; + yield return new object[] { "System.Security.Cryptography.TripleDES", "System.Security.Cryptography.TripleDESCryptoServiceProvider", true }; + yield return new object[] { "RC2", "System.Security.Cryptography.RC2CryptoServiceProvider", true }; + yield return new object[] { "System.Security.Cryptography.RC2", "System.Security.Cryptography.RC2CryptoServiceProvider", true }; +#pragma warning disable SYSLIB0022 // Rijndael types are obsolete + yield return new object[] { "Rijndael", typeof(RijndaelManaged).FullName, true }; + yield return new object[] { "System.Security.Cryptography.Rijndael", typeof(RijndaelManaged).FullName, true }; + yield return new object[] { "System.Security.Cryptography.SymmetricAlgorithm", typeof(RijndaelManaged).FullName, true }; +#pragma warning restore SYSLIB0022 // Rijndael types are obsolete + yield return new object[] { "AES", "System.Security.Cryptography.AesCryptoServiceProvider", true }; + yield return new object[] { "AesCryptoServiceProvider", "System.Security.Cryptography.AesCryptoServiceProvider", true }; + yield return new object[] { "System.Security.Cryptography.AesCryptoServiceProvider", "System.Security.Cryptography.AesCryptoServiceProvider", true }; + yield return new object[] { "AesManaged", typeof(AesManaged).FullName, true }; + yield return new object[] { "System.Security.Cryptography.AesManaged", typeof(AesManaged).FullName, true }; + + // Xml Dsig/ Enc Hash algorithms + yield return new object[] { "http://www.w3.org/2000/09/xmldsig#sha1", "System.Security.Cryptography.SHA1CryptoServiceProvider", true }; + yield return new object[] { "http://www.w3.org/2001/04/xmlenc#sha256", typeof(SHA256Managed).FullName, true }; + yield return new object[] { "http://www.w3.org/2001/04/xmlenc#sha512", typeof(SHA512Managed).FullName, true }; + + // Xml Encryption symmetric keys + yield return new object[] { "http://www.w3.org/2001/04/xmlenc#des-cbc", "System.Security.Cryptography.DESCryptoServiceProvider", true }; + yield return new object[] { "http://www.w3.org/2001/04/xmlenc#tripledes-cbc", "System.Security.Cryptography.TripleDESCryptoServiceProvider", true }; + yield return new object[] { "http://www.w3.org/2001/04/xmlenc#kw-tripledes", "System.Security.Cryptography.TripleDESCryptoServiceProvider", true }; +#pragma warning disable SYSLIB0022 // Rijndael types are obsolete + yield return new object[] { "http://www.w3.org/2001/04/xmlenc#aes128-cbc", typeof(RijndaelManaged).FullName, true }; + yield return new object[] { "http://www.w3.org/2001/04/xmlenc#kw-aes128", typeof(RijndaelManaged).FullName, true }; + yield return new object[] { "http://www.w3.org/2001/04/xmlenc#aes192-cbc", typeof(RijndaelManaged).FullName, true }; + yield return new object[] { "http://www.w3.org/2001/04/xmlenc#kw-aes192", typeof(RijndaelManaged).FullName, true }; + yield return new object[] { "http://www.w3.org/2001/04/xmlenc#aes256-cbc", typeof(RijndaelManaged).FullName, true }; + yield return new object[] { "http://www.w3.org/2001/04/xmlenc#kw-aes256", typeof(RijndaelManaged).FullName, true }; +#pragma warning restore SYSLIB0022 // Rijndael types are obsolete + + // Xml Dsig HMAC URIs from http://www.w3.org/TR/xmldsig-core/ + yield return new object[] { "http://www.w3.org/2000/09/xmldsig#hmac-sha1", typeof(HMACSHA1).FullName, true }; + yield return new object[] { "http://www.w3.org/2001/04/xmldsig-more#sha384", typeof(SHA384Managed).FullName, true }; + yield return new object[] { "http://www.w3.org/2001/04/xmldsig-more#hmac-md5", typeof(HMACMD5).FullName, true }; + yield return new object[] { "http://www.w3.org/2001/04/xmldsig-more#hmac-sha256", typeof(HMACSHA256).FullName, true }; + yield return new object[] { "http://www.w3.org/2001/04/xmldsig-more#hmac-sha384", typeof(HMACSHA384).FullName, true }; + yield return new object[] { "http://www.w3.org/2001/04/xmldsig-more#hmac-sha512", typeof(HMACSHA512).FullName, true }; + + // X509 + yield return new object[] { "2.5.29.10", "System.Security.Cryptography.X509Certificates.X509BasicConstraintsExtension", true }; + yield return new object[] { "2.5.29.19", "System.Security.Cryptography.X509Certificates.X509BasicConstraintsExtension", true }; + yield return new object[] { "2.5.29.14", "System.Security.Cryptography.X509Certificates.X509SubjectKeyIdentifierExtension", true }; + yield return new object[] { "2.5.29.15", "System.Security.Cryptography.X509Certificates.X509KeyUsageExtension", true }; + yield return new object[] { "2.5.29.37", "System.Security.Cryptography.X509Certificates.X509EnhancedKeyUsageExtension", true }; + yield return new object[] { "X509Chain", "System.Security.Cryptography.X509Certificates.X509Chain", true }; + + // PKCS9 attributes + yield return new object[] { "1.2.840.113549.1.9.3", "System.Security.Cryptography.Pkcs.Pkcs9ContentType", true }; + yield return new object[] { "1.2.840.113549.1.9.4", "System.Security.Cryptography.Pkcs.Pkcs9MessageDigest", true }; + yield return new object[] { "1.2.840.113549.1.9.5", "System.Security.Cryptography.Pkcs.Pkcs9SigningTime", true }; + yield return new object[] { "1.3.6.1.4.1.311.88.2.1", "System.Security.Cryptography.Pkcs.Pkcs9DocumentName", true }; + yield return new object[] { "1.3.6.1.4.1.311.88.2.2", "System.Security.Cryptography.Pkcs.Pkcs9DocumentDescription", true }; + } + } + } + + [Theory, MemberData(nameof(AllValidNames))] + public static void CreateFromName_AllValidNames(string name, string typeName, bool supportsUnixMac) + { + bool isWindows = OperatingSystem.IsWindows(); + + if (supportsUnixMac || isWindows) + { + object obj = CryptoConfig.CreateFromName(name); + Assert.NotNull(obj); + + if (typeName == null) + { + typeName = name; + } + + // ECDsa is special on non-Windows + if (isWindows || name != "ECDsa") + { + Assert.Equal(typeName, obj.GetType().FullName); + } + else + { + Assert.NotEqual(typeName, obj.GetType().FullName); + } + + if (obj is IDisposable) + { + ((IDisposable)obj).Dispose(); + } + } + else + { + // These will be the Csp types, which currently aren't supported on Mac\Unix + Assert.Throws (() => CryptoConfig.CreateFromName(name)); + } + } + + [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + public static void CreateFromName_CtorArguments() + { + string className = typeof(ClassWithCtorArguments).FullName + ", System.Security.Cryptography.Tests"; + + // Pass int instead of string + Assert.Throws(() => CryptoConfig.CreateFromName(className, 1)); + + // Valid case + object obj = CryptoConfig.CreateFromName(className, "Hello"); + Assert.NotNull(obj); + Assert.IsType(obj); + + ClassWithCtorArguments ctorObj = (ClassWithCtorArguments)obj; + Assert.Equal("Hello", ctorObj.MyString); + } + + [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + public static void EncodeOID_Validation() + { +#pragma warning disable SYSLIB0031 // EncodeOID is obsolete + Assert.Throws(() => CryptoConfig.EncodeOID(null)); + Assert.Throws(() => CryptoConfig.EncodeOID(string.Empty)); + Assert.Throws(() => CryptoConfig.EncodeOID("BAD.OID")); + Assert.Throws(() => CryptoConfig.EncodeOID("1.2.BAD.OID")); + Assert.Throws(() => CryptoConfig.EncodeOID("1." + uint.MaxValue)); +#pragma warning restore SYSLIB0031 + } + + [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + public static void EncodeOID_Compat() + { +#pragma warning disable SYSLIB0031 // EncodeOID is obsolete + string actual = CryptoConfig.EncodeOID("-1.2.-3").ByteArrayToHex(); + Assert.Equal("0602DAFD", actual); // Negative values not checked +#pragma warning restore SYSLIB0031 + } + + [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + public static void EncodeOID_Length_Boundary() + { +#pragma warning disable SYSLIB0031 // EncodeOID is obsolete + string valueToRepeat = "1.1"; + + // Build a string like 1.11.11.11. ... .11.1, which has 0x80 separators. + // The BER/DER encoding of an OID has a minimum number of bytes as the number of separator characters, + // so this would produce an OID with a length segment of more than one byte, which EncodeOID can't handle. + string s = new StringBuilder(valueToRepeat.Length * 0x80).Insert(0, valueToRepeat, 0x80).ToString(); + Assert.Throws(() => CryptoConfig.EncodeOID(s)); + + // Try again with one less separator for the boundary case, but the particular output is really long + // and would just clutter up this test, so only verify it doesn't throw. + s = new StringBuilder(valueToRepeat.Length * 0x7f).Insert(0, valueToRepeat, 0x7f).ToString(); + CryptoConfig.EncodeOID(s); +#pragma warning restore SYSLIB0031 + } + + [Theory] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + [InlineData(0x4000, "0603818028")] + [InlineData(0x200000, "060481808028")] + [InlineData(0x10000000, "06058180808028")] + [InlineData(0x10000001, "06058180808029")] + [InlineData(int.MaxValue, "060127")] + public static void EncodeOID_Value_Boundary_And_Compat(uint elementValue, string expectedEncoding) + { + // Boundary cases in EncodeOID; output may produce the wrong value mathematically due to encoding + // algorithm semantics but included here for compat reasons. +#pragma warning disable SYSLIB0031 // EncodeOID is obsolete + byte[] actual = CryptoConfig.EncodeOID("1." + elementValue.ToString()); + byte[] expected = expectedEncoding.HexToByteArray(); + Assert.Equal(expected, actual); +#pragma warning restore SYSLIB0031 + } + + [Theory] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + [InlineData("SHA1", "1.3.14.3.2.26", "06052B0E03021A")] + [InlineData("DES", "1.3.14.3.2.7", "06052B0E030207")] + [InlineData("MD5", "1.2.840.113549.2.5", "06082A864886F70D0205")] + public static void MapAndEncodeOID(string alg, string expectedOid, string expectedEncoding) + { +#pragma warning disable SYSLIB0031 // EncodeOID is obsolete + string oid = CryptoConfig.MapNameToOID(alg); + Assert.Equal(expectedOid, oid); + + byte[] actual = CryptoConfig.EncodeOID(oid); + byte[] expected = expectedEncoding.HexToByteArray(); + Assert.Equal(expected, actual); +#pragma warning restore SYSLIB0031 + } + + private static void VerifyCreateFromName(string name) + { + object obj = CryptoConfig.CreateFromName(name); + Assert.NotNull(obj); + Assert.IsType(obj); + } + + public class ClassWithCtorArguments + { + public ClassWithCtorArguments(string s) + { + MyString = s; + } + + public string MyString; + } } } diff --git a/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs b/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs index 4112b139eae4b9..e3e39b22159b35 100644 --- a/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs +++ b/src/libraries/System.Security.Cryptography/tests/CryptoStream.cs @@ -8,7 +8,7 @@ using Microsoft.DotNet.XUnitExtensions; using Xunit; -namespace System.Security.Cryptography.Encryption.Tests.Asymmetric +namespace System.Security.Cryptography.Tests { public class CryptoStreamTests : WrappingConnectedStreamConformanceTests { diff --git a/src/libraries/System.Security.Cryptography/tests/CryptographicException.cs b/src/libraries/System.Security.Cryptography/tests/CryptographicException.cs index 7f86b7476c74cf..5aaeed9fd91f0a 100644 --- a/src/libraries/System.Security.Cryptography/tests/CryptographicException.cs +++ b/src/libraries/System.Security.Cryptography/tests/CryptographicException.cs @@ -3,7 +3,7 @@ using Xunit; -namespace System.Security.Cryptography.Encryption.Tests.Asymmetric +namespace System.Security.Cryptography.Tests { public static class CryptographicExceptionTests { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/DESProvider.cs b/src/libraries/System.Security.Cryptography/tests/DESProvider.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/DESProvider.cs rename to src/libraries/System.Security.Cryptography/tests/DESProvider.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/DESTests.cs b/src/libraries/System.Security.Cryptography/tests/DESTests.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/DESTests.cs rename to src/libraries/System.Security.Cryptography/tests/DESTests.cs index 3c83deeb8d826b..edf123bfe78b0c 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/DESTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/DESTests.cs @@ -3,7 +3,7 @@ using Xunit; -namespace System.Security.Cryptography.Encryption.Des.Tests +namespace System.Security.Cryptography.Tests { public static partial class DesTests { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/DSACreateTests.cs b/src/libraries/System.Security.Cryptography/tests/DSACreateTests.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/DSACreateTests.cs rename to src/libraries/System.Security.Cryptography/tests/DSACreateTests.cs index e84da84a446f8e..b69a62808148c4 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/DSACreateTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/DSACreateTests.cs @@ -4,7 +4,7 @@ using System.Security.Cryptography.Dsa.Tests; using Xunit; -namespace System.Security.Cryptography.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "Not supported on Browser/iOS/tvOS/MacCatalyst")] public static class DSACreateTests diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/DSASignatureFormatterTests.cs b/src/libraries/System.Security.Cryptography/tests/DSASignatureFormatterTests.cs similarity index 86% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/DSASignatureFormatterTests.cs rename to src/libraries/System.Security.Cryptography/tests/DSASignatureFormatterTests.cs index 2af8aaabd7e2f8..666029cef3be89 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/DSASignatureFormatterTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/DSASignatureFormatterTests.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Security.Cryptography.Tests; using Xunit; -namespace System.Security.Cryptography.Dsa.Tests +namespace System.Security.Cryptography.Tests { public partial class DSASignatureFormatterTests : AsymmetricSignatureFormatterTests { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/DSATests.cs b/src/libraries/System.Security.Cryptography/tests/DSATests.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/DSATests.cs rename to src/libraries/System.Security.Cryptography/tests/DSATests.cs index 8b51d34c8b5633..66a25990bc2f86 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/DSATests.cs +++ b/src/libraries/System.Security.Cryptography/tests/DSATests.cs @@ -6,7 +6,7 @@ using System.Security.Cryptography.Dsa.Tests; using Xunit; -namespace System.Security.Cryptography.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "Not supported on Browser/iOS/tvOS/MacCatalyst")] public class DSATests diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultDSAProvider.cs b/src/libraries/System.Security.Cryptography/tests/DefaultDSAProvider.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultDSAProvider.cs rename to src/libraries/System.Security.Cryptography/tests/DefaultDSAProvider.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDiffieHellmanProvider.Android.cs b/src/libraries/System.Security.Cryptography/tests/DefaultECDiffieHellmanProvider.Android.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDiffieHellmanProvider.Android.cs rename to src/libraries/System.Security.Cryptography/tests/DefaultECDiffieHellmanProvider.Android.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDiffieHellmanProvider.Unix.cs b/src/libraries/System.Security.Cryptography/tests/DefaultECDiffieHellmanProvider.Unix.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDiffieHellmanProvider.Unix.cs rename to src/libraries/System.Security.Cryptography/tests/DefaultECDiffieHellmanProvider.Unix.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDiffieHellmanProvider.Windows.cs b/src/libraries/System.Security.Cryptography/tests/DefaultECDiffieHellmanProvider.Windows.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDiffieHellmanProvider.Windows.cs rename to src/libraries/System.Security.Cryptography/tests/DefaultECDiffieHellmanProvider.Windows.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDiffieHellmanProvider.cs b/src/libraries/System.Security.Cryptography/tests/DefaultECDiffieHellmanProvider.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDiffieHellmanProvider.cs rename to src/libraries/System.Security.Cryptography/tests/DefaultECDiffieHellmanProvider.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDsaProvider.Android.cs b/src/libraries/System.Security.Cryptography/tests/DefaultECDsaProvider.Android.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDsaProvider.Android.cs rename to src/libraries/System.Security.Cryptography/tests/DefaultECDsaProvider.Android.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDsaProvider.Unix.cs b/src/libraries/System.Security.Cryptography/tests/DefaultECDsaProvider.Unix.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDsaProvider.Unix.cs rename to src/libraries/System.Security.Cryptography/tests/DefaultECDsaProvider.Unix.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDsaProvider.Windows.cs b/src/libraries/System.Security.Cryptography/tests/DefaultECDsaProvider.Windows.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDsaProvider.Windows.cs rename to src/libraries/System.Security.Cryptography/tests/DefaultECDsaProvider.Windows.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDsaProvider.cs b/src/libraries/System.Security.Cryptography/tests/DefaultECDsaProvider.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDsaProvider.cs rename to src/libraries/System.Security.Cryptography/tests/DefaultECDsaProvider.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultRSAProvider.cs b/src/libraries/System.Security.Cryptography/tests/DefaultRSAProvider.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultRSAProvider.cs rename to src/libraries/System.Security.Cryptography/tests/DefaultRSAProvider.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/ECDiffieHellmanPublicKeyTests.cs b/src/libraries/System.Security.Cryptography/tests/ECDiffieHellmanPublicKeyTests.cs similarity index 94% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/ECDiffieHellmanPublicKeyTests.cs rename to src/libraries/System.Security.Cryptography/tests/ECDiffieHellmanPublicKeyTests.cs index 81c87279f0e3ba..addc21718f57d9 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/ECDiffieHellmanPublicKeyTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/ECDiffieHellmanPublicKeyTests.cs @@ -3,7 +3,7 @@ using Xunit; -namespace System.Security.Cryptography.EcDiffieHellman.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public class ECDiffieHellmanPublicKeyTests diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/ECDiffieHellmanTests.cs b/src/libraries/System.Security.Cryptography/tests/ECDiffieHellmanTests.cs similarity index 91% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/ECDiffieHellmanTests.cs rename to src/libraries/System.Security.Cryptography/tests/ECDiffieHellmanTests.cs index b0c7d4540ede6c..809930bc68d89e 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/ECDiffieHellmanTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/ECDiffieHellmanTests.cs @@ -1,15 +1,12 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Collections.Generic; -using System.Security.Cryptography; -using System.Security.Cryptography.Tests; -using System.Text; -using Test.Cryptography; +using System.Security.Cryptography.EcDiffieHellman.Tests; using Xunit; -namespace System.Security.Cryptography.EcDiffieHellman.Tests +namespace System.Security.Cryptography.Tests { + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public partial class ECDiffieHellmanTests { [Fact] diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/ECDsaTests.cs b/src/libraries/System.Security.Cryptography/tests/ECDsaTests.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/ECDsaTests.cs rename to src/libraries/System.Security.Cryptography/tests/ECDsaTests.cs index 44bed901a6704c..0abd2570bd9548 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/ECDsaTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/ECDsaTests.cs @@ -6,7 +6,7 @@ using System.Security.Cryptography.EcDsa.Tests; using Xunit; -namespace System.Security.Cryptography.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public class ECDsaTests diff --git a/src/libraries/System.Security.Cryptography/tests/ECPemExportTests.cs b/src/libraries/System.Security.Cryptography/tests/ECPemExportTests.cs new file mode 100644 index 00000000000000..6f3456678799a1 --- /dev/null +++ b/src/libraries/System.Security.Cryptography/tests/ECPemExportTests.cs @@ -0,0 +1,102 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.IO; +using Xunit; + +namespace System.Security.Cryptography.Tests +{ + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] + public static class ECPemExportTests + { + [Fact] + public static void ExportPem_ExportECPrivateKey() + { + string expectedPem = + "-----BEGIN EC PRIVATE KEY-----\n" + + "cGVubnk=\n" + + "-----END EC PRIVATE KEY-----"; + + static byte[] ExportECPrivateKey() + { + return new byte[] { 0x70, 0x65, 0x6e, 0x6e, 0x79 }; + } + + using (DelegateECAlgorithm ec = new DelegateECAlgorithm()) + { + ec.ExportECPrivateKeyDelegate = ExportECPrivateKey; + Assert.Equal(expectedPem, ec.ExportECPrivateKeyPem()); + } + } + + [Fact] + public static void ExportPem_TryExportECPrivateKey() + { + string expectedPem = + "-----BEGIN EC PRIVATE KEY-----\n" + + "cGVubnk=\n" + + "-----END EC PRIVATE KEY-----"; + + static bool TryExportECPrivateKey(Span destination, out int bytesWritten) + { + ReadOnlySpan result = new byte[] { 0x70, 0x65, 0x6e, 0x6e, 0x79 }; + bytesWritten = result.Length; + result.CopyTo(destination); + return true; + } + + using (DelegateECAlgorithm ec = new DelegateECAlgorithm()) + { + ec.TryExportECPrivateKeyDelegate = TryExportECPrivateKey; + + int written; + bool result; + char[] buffer; + + // buffer not enough + buffer = new char[expectedPem.Length - 1]; + result = ec.TryExportECPrivateKeyPem(buffer, out written); + Assert.False(result, nameof(ec.TryExportECPrivateKeyPem)); + Assert.Equal(0, written); + + // buffer just enough + buffer = new char[expectedPem.Length]; + result = ec.TryExportECPrivateKeyPem(buffer, out written); + Assert.True(result, nameof(ec.TryExportECPrivateKeyPem)); + Assert.Equal(expectedPem.Length, written); + Assert.Equal(expectedPem, new string(buffer)); + + // buffer more than enough + buffer = new char[expectedPem.Length + 20]; + buffer.AsSpan().Fill('!'); + Span bufferSpan = buffer.AsSpan(10); + result = ec.TryExportECPrivateKeyPem(bufferSpan, out written); + Assert.True(result, nameof(ec.TryExportECPrivateKeyPem)); + Assert.Equal(expectedPem.Length, written); + Assert.Equal(expectedPem, new string(bufferSpan.Slice(0, written))); + + // Ensure padding has not been touched. + AssertExtensions.FilledWith('!', buffer[0..10]); + AssertExtensions.FilledWith('!', buffer[^10..]); + } + } + + private class DelegateECAlgorithm : ECAlgorithm + { + public delegate bool TryExportFunc(Span destination, out int bytesWritten); + + public Func ExportECPrivateKeyDelegate = null; + public TryExportFunc TryExportECPrivateKeyDelegate = null; + + + public DelegateECAlgorithm() + { + } + + public override byte[] ExportECPrivateKey() => ExportECPrivateKeyDelegate(); + + public override bool TryExportECPrivateKey(Span destination, out int bytesWritten) => + TryExportECPrivateKeyDelegate(destination, out bytesWritten); + } + } +} diff --git a/src/libraries/System.Security.Cryptography/tests/FixedTimeEqualsTests.cs b/src/libraries/System.Security.Cryptography/tests/FixedTimeEqualsTests.cs index b5fe04b2d07fc3..6af74897b554f7 100644 --- a/src/libraries/System.Security.Cryptography/tests/FixedTimeEqualsTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/FixedTimeEqualsTests.cs @@ -3,10 +3,9 @@ using System.Buffers; using System.Reflection; -using System.Runtime.CompilerServices; using Xunit; -namespace System.Security.Cryptography.Primitives.Tests +namespace System.Security.Cryptography.Tests { public static class FixedTimeEqualsTests { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/HKDFTests.cs b/src/libraries/System.Security.Cryptography/tests/HKDFTests.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/HKDFTests.cs rename to src/libraries/System.Security.Cryptography/tests/HKDFTests.cs index 49d270f60b1fdb..e1d0d59423a0f2 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/HKDFTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/HKDFTests.cs @@ -3,11 +3,10 @@ using System.Collections.Generic; using System.Linq; -using Microsoft.DotNet.XUnitExtensions; using Test.Cryptography; using Xunit; -namespace System.Security.Cryptography.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public abstract class HKDFTests diff --git a/src/libraries/System.Security.Cryptography/tests/HashAlgorithmNameTests.cs b/src/libraries/System.Security.Cryptography/tests/HashAlgorithmNameTests.cs index 4f41aa9ad3c800..e4d78699bfdd1c 100644 --- a/src/libraries/System.Security.Cryptography/tests/HashAlgorithmNameTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/HashAlgorithmNameTests.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using Xunit; -namespace System.Security.Cryptography.Primitives.Tests +namespace System.Security.Cryptography.Tests { public static class HashAlgorithmNameTests { diff --git a/src/libraries/System.Security.Cryptography/tests/HashAlgorithmTest.cs b/src/libraries/System.Security.Cryptography/tests/HashAlgorithmTest.cs index 3e4337d2a812cc..015f36c8a979f7 100644 --- a/src/libraries/System.Security.Cryptography/tests/HashAlgorithmTest.cs +++ b/src/libraries/System.Security.Cryptography/tests/HashAlgorithmTest.cs @@ -7,7 +7,7 @@ using Test.IO.Streams; using Xunit; -namespace System.Security.Cryptography.Hashing.Tests +namespace System.Security.Cryptography.Tests { public class HashAlgorithmTest { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/HashAlgorithmTest.cs b/src/libraries/System.Security.Cryptography/tests/HashAlgorithmTestDriver.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/HashAlgorithmTest.cs rename to src/libraries/System.Security.Cryptography/tests/HashAlgorithmTestDriver.cs index dc5738441db564..07f72debe15862 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/HashAlgorithmTest.cs +++ b/src/libraries/System.Security.Cryptography/tests/HashAlgorithmTestDriver.cs @@ -6,9 +6,9 @@ using Test.Cryptography; using Xunit; -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { - public abstract class HashAlgorithmTest + public abstract class HashAlgorithmTestDriver { protected abstract HashAlgorithm Create(); protected abstract bool TryHashData(ReadOnlySpan source, Span destination, out int bytesWritten); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/HashDerivedTests.cs b/src/libraries/System.Security.Cryptography/tests/HashDerivedTests.cs similarity index 97% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/HashDerivedTests.cs rename to src/libraries/System.Security.Cryptography/tests/HashDerivedTests.cs index bbd011a7612f13..6734bca6bb5a53 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/HashDerivedTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/HashDerivedTests.cs @@ -3,7 +3,7 @@ using Xunit; -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { public static class HashDerivedTests { diff --git a/src/libraries/System.Security.Cryptography/tests/HmacAlgorithmTest.cs b/src/libraries/System.Security.Cryptography/tests/HmacAlgorithmTest.cs index 2796ee272ea72f..3d53f4f5e47fba 100644 --- a/src/libraries/System.Security.Cryptography/tests/HmacAlgorithmTest.cs +++ b/src/libraries/System.Security.Cryptography/tests/HmacAlgorithmTest.cs @@ -3,7 +3,7 @@ using Xunit; -namespace System.Security.Cryptography.Hashing.Tests +namespace System.Security.Cryptography.Tests { public class HmacAlgorithmTest { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/HmacMD5Tests.cs b/src/libraries/System.Security.Cryptography/tests/HmacMD5Tests.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/HmacMD5Tests.cs rename to src/libraries/System.Security.Cryptography/tests/HmacMD5Tests.cs index 0c6cb580d09da4..5890252e8dfa8a 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/HmacMD5Tests.cs +++ b/src/libraries/System.Security.Cryptography/tests/HmacMD5Tests.cs @@ -4,7 +4,7 @@ using Test.Cryptography; using Xunit; -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public class HmacMD5Tests : Rfc2202HmacTests diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/HmacSha1Tests.cs b/src/libraries/System.Security.Cryptography/tests/HmacSha1Tests.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/HmacSha1Tests.cs rename to src/libraries/System.Security.Cryptography/tests/HmacSha1Tests.cs index 83dbf48b1baa24..dadae08fea1886 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/HmacSha1Tests.cs +++ b/src/libraries/System.Security.Cryptography/tests/HmacSha1Tests.cs @@ -4,7 +4,7 @@ using Test.Cryptography; using Xunit; -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public class HmacSha1Tests : Rfc2202HmacTests diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/HmacSha256Tests.cs b/src/libraries/System.Security.Cryptography/tests/HmacSha256Tests.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/HmacSha256Tests.cs rename to src/libraries/System.Security.Cryptography/tests/HmacSha256Tests.cs index ae9004e12f5aff..303c248d5ee3de 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/HmacSha256Tests.cs +++ b/src/libraries/System.Security.Cryptography/tests/HmacSha256Tests.cs @@ -4,7 +4,7 @@ using Test.Cryptography; using Xunit; -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public class HmacSha256Tests : Rfc4231HmacTests diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/HmacSha384Tests.cs b/src/libraries/System.Security.Cryptography/tests/HmacSha384Tests.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/HmacSha384Tests.cs rename to src/libraries/System.Security.Cryptography/tests/HmacSha384Tests.cs index 53d0dece6d3b98..abaeab4dbc6fe1 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/HmacSha384Tests.cs +++ b/src/libraries/System.Security.Cryptography/tests/HmacSha384Tests.cs @@ -4,7 +4,7 @@ using Test.Cryptography; using Xunit; -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public class HmacSha384Tests : Rfc4231HmacTests diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/HmacSha512Tests.cs b/src/libraries/System.Security.Cryptography/tests/HmacSha512Tests.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/HmacSha512Tests.cs rename to src/libraries/System.Security.Cryptography/tests/HmacSha512Tests.cs index c9f52a982c0ddd..fa83bd45e2183c 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/HmacSha512Tests.cs +++ b/src/libraries/System.Security.Cryptography/tests/HmacSha512Tests.cs @@ -4,7 +4,7 @@ using Test.Cryptography; using Xunit; -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public class HmacSha512Tests : Rfc4231HmacTests diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/HmacTests.cs b/src/libraries/System.Security.Cryptography/tests/HmacTests.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/HmacTests.cs rename to src/libraries/System.Security.Cryptography/tests/HmacTests.cs index 510f58d88ee7d8..ca266b43921fe4 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/HmacTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/HmacTests.cs @@ -5,7 +5,7 @@ using Test.Cryptography; using Xunit; -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public abstract class HmacTests diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/IncrementalHashTests.cs b/src/libraries/System.Security.Cryptography/tests/IncrementalHashTests.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/IncrementalHashTests.cs rename to src/libraries/System.Security.Cryptography/tests/IncrementalHashTests.cs index 2a0f551c279038..d5acc5b27aa435 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/IncrementalHashTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/IncrementalHashTests.cs @@ -5,7 +5,7 @@ using Test.Cryptography; using Xunit; -namespace System.Security.Cryptography.Algorithms.Tests +namespace System.Security.Cryptography.Tests { public class IncrementalHashTests { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/InvalidUsageTests.cs b/src/libraries/System.Security.Cryptography/tests/InvalidUsageTests.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/InvalidUsageTests.cs rename to src/libraries/System.Security.Cryptography/tests/InvalidUsageTests.cs index 0adfe66cef73e7..4114d97167e952 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/InvalidUsageTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/InvalidUsageTests.cs @@ -4,7 +4,7 @@ using System.IO; using Xunit; -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { public class InvalidUsageTests { diff --git a/src/libraries/System.Security.Cryptography/tests/KeyedHashAlgorithmTests.cs b/src/libraries/System.Security.Cryptography/tests/KeyedHashAlgorithmTests.cs index 2b85262b6cbcd2..801a0f3e4460e5 100644 --- a/src/libraries/System.Security.Cryptography/tests/KeyedHashAlgorithmTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/KeyedHashAlgorithmTests.cs @@ -3,7 +3,7 @@ using Xunit; -namespace System.Security.Cryptography.Hashing.Tests +namespace System.Security.Cryptography.Tests { public class KeyedHashAlgorithmTest { diff --git a/src/libraries/System.Security.Cryptography/tests/Length32Hash.cs b/src/libraries/System.Security.Cryptography/tests/Length32Hash.cs index ccac0e18eee5ea..485d9e33b85ef0 100644 --- a/src/libraries/System.Security.Cryptography/tests/Length32Hash.cs +++ b/src/libraries/System.Security.Cryptography/tests/Length32Hash.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace System.Security.Cryptography.Hashing.Tests +namespace System.Security.Cryptography.Tests { internal class Length32Hash : HashAlgorithm { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/MD5Tests.cs b/src/libraries/System.Security.Cryptography/tests/MD5Tests.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/MD5Tests.cs rename to src/libraries/System.Security.Cryptography/tests/MD5Tests.cs index fb84183609dcca..e301eae2fc3001 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/MD5Tests.cs +++ b/src/libraries/System.Security.Cryptography/tests/MD5Tests.cs @@ -3,10 +3,10 @@ using Xunit; -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] - public class MD5Tests : HashAlgorithmTest + public class MD5Tests : HashAlgorithmTestDriver { protected override HashAlgorithm Create() { diff --git a/src/libraries/System.Security.Cryptography.Encoding/tests/OidCollectionTests.cs b/src/libraries/System.Security.Cryptography/tests/OidCollectionTests.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Encoding/tests/OidCollectionTests.cs rename to src/libraries/System.Security.Cryptography/tests/OidCollectionTests.cs index 38320e9cc021de..a3f003fa3047ce 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/tests/OidCollectionTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/OidCollectionTests.cs @@ -5,7 +5,7 @@ using System.Linq; using Xunit; -namespace System.Security.Cryptography.Encoding.Tests +namespace System.Security.Cryptography.Tests { public class OidCollectionTests { diff --git a/src/libraries/System.Security.Cryptography.Encoding/tests/Oid.cs b/src/libraries/System.Security.Cryptography/tests/OidTests.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Encoding/tests/Oid.cs rename to src/libraries/System.Security.Cryptography/tests/OidTests.cs index 74372351d523ac..cff10f91b36182 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/tests/Oid.cs +++ b/src/libraries/System.Security.Cryptography/tests/OidTests.cs @@ -5,7 +5,7 @@ using Test.Cryptography; using Xunit; -namespace System.Security.Cryptography.Encoding.Tests +namespace System.Security.Cryptography.Tests { public static class OidTests { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/PKCS1MaskGenerationMethodTest.cs b/src/libraries/System.Security.Cryptography/tests/PKCS1MaskGenerationMethodTest.cs similarity index 98% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/PKCS1MaskGenerationMethodTest.cs rename to src/libraries/System.Security.Cryptography/tests/PKCS1MaskGenerationMethodTest.cs index bc0d9b9a3669a2..c388dc8c110f3c 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/PKCS1MaskGenerationMethodTest.cs +++ b/src/libraries/System.Security.Cryptography/tests/PKCS1MaskGenerationMethodTest.cs @@ -23,11 +23,9 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -using System; -using System.Security.Cryptography; using Xunit; -namespace System.Security.Cryptography.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public class PKCS1MaskGenerationMethodTest diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/PaddingModeTests.cs b/src/libraries/System.Security.Cryptography/tests/PaddingModeTests.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/PaddingModeTests.cs rename to src/libraries/System.Security.Cryptography/tests/PaddingModeTests.cs diff --git a/src/libraries/System.Security.Cryptography/tests/PbeParametersTests.cs b/src/libraries/System.Security.Cryptography/tests/PbeParametersTests.cs index a463bee3d07b98..e5e74fb3e48600 100644 --- a/src/libraries/System.Security.Cryptography/tests/PbeParametersTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/PbeParametersTests.cs @@ -3,7 +3,7 @@ using Xunit; -namespace System.Security.Cryptography.Primitives.Tests +namespace System.Security.Cryptography.Tests { public static class PbeParametersTests { diff --git a/src/libraries/System.Security.Cryptography.Encoding/tests/PemEncodingFindTests.cs b/src/libraries/System.Security.Cryptography/tests/PemEncodingFindTests.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Encoding/tests/PemEncodingFindTests.cs rename to src/libraries/System.Security.Cryptography/tests/PemEncodingFindTests.cs index 87444edc2ed17a..167d3f25b4f940 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/tests/PemEncodingFindTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/PemEncodingFindTests.cs @@ -1,12 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Collections.Generic; -using System.Security.Cryptography; using System.Text; using Xunit; -namespace System.Security.Cryptography.Encoding.Tests +namespace System.Security.Cryptography.Tests { public abstract class PemEncodingFindTests { diff --git a/src/libraries/System.Security.Cryptography.Encoding/tests/PemEncodingTests.cs b/src/libraries/System.Security.Cryptography/tests/PemEncodingTests.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Encoding/tests/PemEncodingTests.cs rename to src/libraries/System.Security.Cryptography/tests/PemEncodingTests.cs index f86d3840c2c0ea..6ac5197070bce3 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/tests/PemEncodingTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/PemEncodingTests.cs @@ -1,11 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Collections.Generic; -using System.Security.Cryptography; using Xunit; -namespace System.Security.Cryptography.Encoding.Tests +namespace System.Security.Cryptography.Tests { public static class PemEncodingTests { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/RC2Provider.cs b/src/libraries/System.Security.Cryptography/tests/RC2Provider.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/RC2Provider.cs rename to src/libraries/System.Security.Cryptography/tests/RC2Provider.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/RC2Tests.cs b/src/libraries/System.Security.Cryptography/tests/RC2Tests.cs similarity index 97% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/RC2Tests.cs rename to src/libraries/System.Security.Cryptography/tests/RC2Tests.cs index 008b3c9cea53fc..ab6f0ba2dc4114 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/RC2Tests.cs +++ b/src/libraries/System.Security.Cryptography/tests/RC2Tests.cs @@ -3,10 +3,8 @@ using Xunit; -namespace System.Security.Cryptography.Encryption.RC2.Tests +namespace System.Security.Cryptography.Tests { - using RC2 = System.Security.Cryptography.RC2; - public static partial class RC2Tests { [Fact] diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/RSACreateTests.cs b/src/libraries/System.Security.Cryptography/tests/RSACreateTests.cs similarity index 97% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/RSACreateTests.cs rename to src/libraries/System.Security.Cryptography/tests/RSACreateTests.cs index 6ccc7e6489c0c7..8847051e6998d9 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/RSACreateTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/RSACreateTests.cs @@ -4,7 +4,7 @@ using System.Security.Cryptography.Rsa.Tests; using Xunit; -namespace System.Security.Cryptography.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public static class RSACreateTests diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/RSAKeyExchangeFormatterTests.cs b/src/libraries/System.Security.Cryptography/tests/RSAKeyExchangeFormatterTests.cs similarity index 90% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/RSAKeyExchangeFormatterTests.cs rename to src/libraries/System.Security.Cryptography/tests/RSAKeyExchangeFormatterTests.cs index 41f616fae0285a..f0a0bca594b43a 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/RSAKeyExchangeFormatterTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/RSAKeyExchangeFormatterTests.cs @@ -3,7 +3,7 @@ using Xunit; -namespace System.Security.Cryptography.Rsa.Tests +namespace System.Security.Cryptography.Tests { public partial class RSAKeyExchangeFormatterTests { @@ -32,6 +32,7 @@ public static void RSAPKCS1DeformatterArguments() } [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public static void RSAOAEPFormatterRng() { using (RSA key = RSA.Create()) @@ -44,6 +45,7 @@ public static void RSAOAEPFormatterRng() } [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public static void RSAPKCS1FormatterRng() { using (RSA key = RSA.Create()) @@ -56,6 +58,7 @@ public static void RSAPKCS1FormatterRng() } [Fact] + [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public static void RSAPKCS1DeformatterRng() { using (RSA key = RSA.Create()) diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/RSASignatureFormatterTests.cs b/src/libraries/System.Security.Cryptography/tests/RSASignatureFormatterTests.cs similarity index 86% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/RSASignatureFormatterTests.cs rename to src/libraries/System.Security.Cryptography/tests/RSASignatureFormatterTests.cs index d35e0c0fa87661..a6f0d4909344e7 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/RSASignatureFormatterTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/RSASignatureFormatterTests.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Security.Cryptography.Tests; using Xunit; -namespace System.Security.Cryptography.Rsa.Tests +namespace System.Security.Cryptography.Tests { public partial class RSASignatureFormatterTests : AsymmetricSignatureFormatterTests { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/RSATests.cs b/src/libraries/System.Security.Cryptography/tests/RSATests.cs similarity index 69% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/RSATests.cs rename to src/libraries/System.Security.Cryptography/tests/RSATests.cs index 0e63e04b0859ad..9decadbc179f7e 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/RSATests.cs +++ b/src/libraries/System.Security.Cryptography/tests/RSATests.cs @@ -5,7 +5,7 @@ using System.Linq; using Xunit; -namespace System.Security.Cryptography.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public class RSATests @@ -230,6 +230,150 @@ public void RSASignaturePadding_Equality() Assert.True(RSASignaturePadding.Pkcs1 != null); } + [Fact] + public static void ExportPem_ExportRSAPublicKey() + { + string expectedPem = + "-----BEGIN RSA PUBLIC KEY-----\n" + + "cGVubnk=\n" + + "-----END RSA PUBLIC KEY-----"; + + static byte[] ExportRSAPublicKey() + { + return new byte[] { 0x70, 0x65, 0x6e, 0x6e, 0x79 }; + } + + using (DelegateRSA rsa = new DelegateRSA()) + { + rsa.ExportRSAPublicKeyDelegate = ExportRSAPublicKey; + Assert.Equal(expectedPem, rsa.ExportRSAPublicKeyPem()); + } + } + + [Fact] + public static void ExportPem_TryExportRSAPublicKey() + { + string expectedPem = + "-----BEGIN RSA PUBLIC KEY-----\n" + + "cGVubnk=\n" + + "-----END RSA PUBLIC KEY-----"; + + static bool TryExportRSAPublicKey(Span destination, out int bytesWritten) + { + ReadOnlySpan result = new byte[] { 0x70, 0x65, 0x6e, 0x6e, 0x79 }; + bytesWritten = result.Length; + result.CopyTo(destination); + return true; + } + + using (DelegateRSA rsa = new DelegateRSA()) + { + rsa.TryExportRSAPublicKeyDelegate = TryExportRSAPublicKey; + + int written; + bool result; + char[] buffer; + + // buffer not enough + buffer = new char[expectedPem.Length - 1]; + result = rsa.TryExportRSAPublicKeyPem(buffer, out written); + Assert.False(result, nameof(rsa.TryExportRSAPublicKeyPem)); + Assert.Equal(0, written); + + // buffer just enough + buffer = new char[expectedPem.Length]; + result = rsa.TryExportRSAPublicKeyPem(buffer, out written); + Assert.True(result, nameof(rsa.TryExportRSAPublicKeyPem)); + Assert.Equal(expectedPem.Length, written); + Assert.Equal(expectedPem, new string(buffer)); + + // buffer more than enough + buffer = new char[expectedPem.Length + 20]; + buffer.AsSpan().Fill('!'); + Span bufferSpan = buffer.AsSpan(10); + result = rsa.TryExportRSAPublicKeyPem(bufferSpan, out written); + Assert.True(result, nameof(rsa.TryExportRSAPublicKeyPem)); + Assert.Equal(expectedPem.Length, written); + Assert.Equal(expectedPem, new string(bufferSpan.Slice(0, written))); + + // Ensure padding has not been touched. + AssertExtensions.FilledWith('!', buffer[0..10]); + AssertExtensions.FilledWith('!', buffer[^10..]); + } + } + + [Fact] + public static void ExportPem_ExportRSAPrivateKey() + { + string expectedPem = + "-----BEGIN RSA PRIVATE KEY-----\n" + + "cGVubnk=\n" + + "-----END RSA PRIVATE KEY-----"; + + static byte[] ExportRSAPrivateKey() + { + return new byte[] { 0x70, 0x65, 0x6e, 0x6e, 0x79 }; + } + + using (DelegateRSA rsa = new DelegateRSA()) + { + rsa.ExportRSAPrivateKeyDelegate = ExportRSAPrivateKey; + Assert.Equal(expectedPem, rsa.ExportRSAPrivateKeyPem()); + } + } + + [Fact] + public static void ExportPem_TryExportRSAPrivateKey() + { + string expectedPem = + "-----BEGIN RSA PRIVATE KEY-----\n" + + "cGVubnk=\n" + + "-----END RSA PRIVATE KEY-----"; + + static bool TryExportRSAPrivateKey(Span destination, out int bytesWritten) + { + ReadOnlySpan result = new byte[] { 0x70, 0x65, 0x6e, 0x6e, 0x79 }; + bytesWritten = result.Length; + result.CopyTo(destination); + return true; + } + + using (DelegateRSA rsa = new DelegateRSA()) + { + rsa.TryExportRSAPrivateKeyDelegate = TryExportRSAPrivateKey; + + int written; + bool result; + char[] buffer; + + // buffer not enough + buffer = new char[expectedPem.Length - 1]; + result = rsa.TryExportRSAPrivateKeyPem(buffer, out written); + Assert.False(result, nameof(rsa.TryExportRSAPrivateKeyPem)); + Assert.Equal(0, written); + + // buffer just enough + buffer = new char[expectedPem.Length]; + result = rsa.TryExportRSAPrivateKeyPem(buffer, out written); + Assert.True(result, nameof(rsa.TryExportRSAPrivateKeyPem)); + Assert.Equal(expectedPem.Length, written); + Assert.Equal(expectedPem, new string(buffer)); + + // buffer more than enough + buffer = new char[expectedPem.Length + 20]; + buffer.AsSpan().Fill('!'); + Span bufferSpan = buffer.AsSpan(10); + result = rsa.TryExportRSAPrivateKeyPem(bufferSpan, out written); + Assert.True(result, nameof(rsa.TryExportRSAPrivateKeyPem)); + Assert.Equal(expectedPem.Length, written); + Assert.Equal(expectedPem, new string(bufferSpan.Slice(0, written))); + + // Ensure padding has not been touched. + AssertExtensions.FilledWith('!', buffer[0..10]); + AssertExtensions.FilledWith('!', buffer[^10..]); + } + } + private sealed class EmptyRSA : RSA { public override RSAParameters ExportParameters(bool includePrivateParameters) => throw new NotImplementedException(); @@ -240,12 +384,17 @@ private sealed class EmptyRSA : RSA private sealed class DelegateRSA : RSA { + public delegate bool TryExportFunc(Span destination, out int bytesWritten); public Func DecryptDelegate; public Func EncryptDelegate; public Func SignHashDelegate = null; public Func VerifyHashDelegate = null; public Func HashDataArrayDelegate = null; public Func HashDataStreamDelegate = null; + public Func ExportRSAPublicKeyDelegate = null; + public TryExportFunc TryExportRSAPublicKeyDelegate = null; + public Func ExportRSAPrivateKeyDelegate = null; + public TryExportFunc TryExportRSAPrivateKeyDelegate = null; public override byte[] Encrypt(byte[] data, RSAEncryptionPadding padding) => EncryptDelegate(data, padding); @@ -265,6 +414,15 @@ protected override byte[] HashData(byte[] data, int offset, int count, HashAlgor protected override byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm) => HashDataStreamDelegate(data, hashAlgorithm); + public override byte[] ExportRSAPublicKey() => ExportRSAPublicKeyDelegate(); + public override byte[] ExportRSAPrivateKey() => ExportRSAPrivateKeyDelegate(); + + public override bool TryExportRSAPublicKey(Span destination, out int bytesWritten) => + TryExportRSAPublicKeyDelegate(destination, out bytesWritten); + + public override bool TryExportRSAPrivateKey(Span destination, out int bytesWritten) => + TryExportRSAPrivateKeyDelegate(destination, out bytesWritten); + public new bool TryHashData(ReadOnlySpan source, Span destination, HashAlgorithmName hashAlgorithm, out int bytesWritten) => base.TryHashData(source, destination, hashAlgorithm, out bytesWritten); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/RandomNumberGeneratorTests.cs b/src/libraries/System.Security.Cryptography/tests/RandomNumberGeneratorTests.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/RandomNumberGeneratorTests.cs rename to src/libraries/System.Security.Cryptography/tests/RandomNumberGeneratorTests.cs index d0f2ad8e3e9ff5..1fbbe86e471d5b 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/RandomNumberGeneratorTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/RandomNumberGeneratorTests.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; using Xunit; -namespace System.Security.Cryptography.RNG.Tests +namespace System.Security.Cryptography.Tests { public class RandomNumberGeneratorTests { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/ReusabilityTests.cs b/src/libraries/System.Security.Cryptography/tests/ReusabilityTests.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/ReusabilityTests.cs rename to src/libraries/System.Security.Cryptography/tests/ReusabilityTests.cs index a9909edd133fcf..998890765df40a 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/ReusabilityTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/ReusabilityTests.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using Xunit; -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public class ReusabilityTests diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/Rfc2202HmacTests.cs b/src/libraries/System.Security.Cryptography/tests/Rfc2202HmacTests.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/Rfc2202HmacTests.cs rename to src/libraries/System.Security.Cryptography/tests/Rfc2202HmacTests.cs index 84864861c92d9f..892d1d9748d286 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/Rfc2202HmacTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/Rfc2202HmacTests.cs @@ -4,7 +4,7 @@ using Test.Cryptography; using Xunit; -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public abstract class Rfc2202HmacTests : HmacTests diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/Rfc2898OneShotTests.cs b/src/libraries/System.Security.Cryptography/tests/Rfc2898OneShotTests.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/Rfc2898OneShotTests.cs rename to src/libraries/System.Security.Cryptography/tests/Rfc2898OneShotTests.cs index eb634e112f240a..3376d711779bf2 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/Rfc2898OneShotTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/Rfc2898OneShotTests.cs @@ -6,7 +6,7 @@ using Xunit; using Test.Cryptography; -namespace System.Security.Cryptography.DeriveBytesTests +namespace System.Security.Cryptography { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public static class Rfc2898OneShotTests diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/Rfc2898Tests.cs b/src/libraries/System.Security.Cryptography/tests/Rfc2898Tests.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/Rfc2898Tests.cs rename to src/libraries/System.Security.Cryptography/tests/Rfc2898Tests.cs index 85b273ba28e8c3..fa7cfabca93260 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/Rfc2898Tests.cs +++ b/src/libraries/System.Security.Cryptography/tests/Rfc2898Tests.cs @@ -7,7 +7,7 @@ using Test.Cryptography; using Xunit; -namespace System.Security.Cryptography.DeriveBytesTests +namespace System.Security.Cryptography { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public class Rfc2898Tests diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/Rfc4231HmacTests.cs b/src/libraries/System.Security.Cryptography/tests/Rfc4231HmacTests.cs similarity index 96% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/Rfc4231HmacTests.cs rename to src/libraries/System.Security.Cryptography/tests/Rfc4231HmacTests.cs index 771973a029328f..45070c834eed2e 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/Rfc4231HmacTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/Rfc4231HmacTests.cs @@ -4,7 +4,7 @@ using Test.Cryptography; using Xunit; -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public abstract class Rfc4231HmacTests : HmacTests diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/RijndaelTests.cs b/src/libraries/System.Security.Cryptography/tests/RijndaelTests.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/RijndaelTests.cs rename to src/libraries/System.Security.Cryptography/tests/RijndaelTests.cs index 5613b7b7c48d6e..d8e9f975cae498 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/RijndaelTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/RijndaelTests.cs @@ -7,10 +7,8 @@ #pragma warning disable SYSLIB0022 // Rijndael types are obsolete -namespace System.Security.Cryptography.Encryption.Rijndael.Tests +namespace System.Security.Cryptography.Tests { - using Rijndael = System.Security.Cryptography.Rijndael; - /// /// Since RijndaelImplementation (from Rijndael.Create()) and RijndaelManaged classes wrap Aes, /// we only test minimally here. diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/Sha1ManagedTests.cs b/src/libraries/System.Security.Cryptography/tests/Sha1ManagedTests.cs similarity index 86% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/Sha1ManagedTests.cs rename to src/libraries/System.Security.Cryptography/tests/Sha1ManagedTests.cs index 5139841dcf8294..54e7476f544719 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/Sha1ManagedTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/Sha1ManagedTests.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { /// /// Sha1Managed has a copy of the same implementation as SHA1 diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/Sha1Tests.cs b/src/libraries/System.Security.Cryptography/tests/Sha1Tests.cs similarity index 94% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/Sha1Tests.cs rename to src/libraries/System.Security.Cryptography/tests/Sha1Tests.cs index 646d2dbb798018..45d0315852cbe5 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/Sha1Tests.cs +++ b/src/libraries/System.Security.Cryptography/tests/Sha1Tests.cs @@ -3,9 +3,9 @@ using Xunit; -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { - public class Sha1Tests : HashAlgorithmTest + public class Sha1Tests : HashAlgorithmTestDriver { protected override HashAlgorithm Create() { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/Sha256ManagedTests.cs b/src/libraries/System.Security.Cryptography/tests/Sha256ManagedTests.cs similarity index 86% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/Sha256ManagedTests.cs rename to src/libraries/System.Security.Cryptography/tests/Sha256ManagedTests.cs index b1a0422272e86b..2f153da87a60ff 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/Sha256ManagedTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/Sha256ManagedTests.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { /// /// Sha256Managed has a copy of the same implementation as SHA256 diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/Sha256Tests.cs b/src/libraries/System.Security.Cryptography/tests/Sha256Tests.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/Sha256Tests.cs rename to src/libraries/System.Security.Cryptography/tests/Sha256Tests.cs index c53a7e83f299ed..e85dddc08d7971 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/Sha256Tests.cs +++ b/src/libraries/System.Security.Cryptography/tests/Sha256Tests.cs @@ -3,9 +3,9 @@ using Xunit; -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { - public class Sha256Tests : HashAlgorithmTest + public class Sha256Tests : HashAlgorithmTestDriver { protected override HashAlgorithm Create() { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/Sha384ManagedTests.cs b/src/libraries/System.Security.Cryptography/tests/Sha384ManagedTests.cs similarity index 86% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/Sha384ManagedTests.cs rename to src/libraries/System.Security.Cryptography/tests/Sha384ManagedTests.cs index 42b13c63cd122e..88166dbf0496a5 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/Sha384ManagedTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/Sha384ManagedTests.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { /// /// Sha384Managed has a copy of the same implementation as SHA384 diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/Sha384Tests.cs b/src/libraries/System.Security.Cryptography/tests/Sha384Tests.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/Sha384Tests.cs rename to src/libraries/System.Security.Cryptography/tests/Sha384Tests.cs index a0beb5d5faf1bc..5ef3ebcb4e039e 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/Sha384Tests.cs +++ b/src/libraries/System.Security.Cryptography/tests/Sha384Tests.cs @@ -3,9 +3,9 @@ using Xunit; -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { - public class Sha384Tests : HashAlgorithmTest + public class Sha384Tests : HashAlgorithmTestDriver { protected override HashAlgorithm Create() { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/Sha512ManagedTests.cs b/src/libraries/System.Security.Cryptography/tests/Sha512ManagedTests.cs similarity index 86% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/Sha512ManagedTests.cs rename to src/libraries/System.Security.Cryptography/tests/Sha512ManagedTests.cs index b3fae310692c06..e616e4fea13e00 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/Sha512ManagedTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/Sha512ManagedTests.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { /// /// Sha512Managed has a copy of the same implementation as SHA512 diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/Sha512Tests.cs b/src/libraries/System.Security.Cryptography/tests/Sha512Tests.cs similarity index 95% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/Sha512Tests.cs rename to src/libraries/System.Security.Cryptography/tests/Sha512Tests.cs index ef1d02fc818f7e..4586a08d846b07 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/Sha512Tests.cs +++ b/src/libraries/System.Security.Cryptography/tests/Sha512Tests.cs @@ -3,9 +3,9 @@ using Xunit; -namespace System.Security.Cryptography.Hashing.Algorithms.Tests +namespace System.Security.Cryptography.Tests { - public class Sha512Tests : HashAlgorithmTest + public class Sha512Tests : HashAlgorithmTestDriver { protected override HashAlgorithm Create() { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/SignatureDescriptionTests.cs b/src/libraries/System.Security.Cryptography/tests/SignatureDescriptionTests.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/SignatureDescriptionTests.cs rename to src/libraries/System.Security.Cryptography/tests/SignatureDescriptionTests.cs index 257d5abde8f333..2d222ea5f92a69 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/SignatureDescriptionTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/SignatureDescriptionTests.cs @@ -6,7 +6,7 @@ using Xunit; -namespace System.Security.Cryptography.Algorithms.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public class SignatureDescriptionTests diff --git a/src/libraries/System.Security.Cryptography/tests/SimpleHashAlgorithmTest.cs b/src/libraries/System.Security.Cryptography/tests/SimpleHashAlgorithmTest.cs index b0656058c90781..f306dd17e6aa1b 100644 --- a/src/libraries/System.Security.Cryptography/tests/SimpleHashAlgorithmTest.cs +++ b/src/libraries/System.Security.Cryptography/tests/SimpleHashAlgorithmTest.cs @@ -5,7 +5,7 @@ using Test.IO.Streams; using Xunit; -namespace System.Security.Cryptography.Hashing.Tests +namespace System.Security.Cryptography.Tests { public class SimpleHashAlgorithmTest { diff --git a/src/libraries/System.Security.Cryptography/tests/Sum32Hash.cs b/src/libraries/System.Security.Cryptography/tests/Sum32Hash.cs index 53f738833dd7c7..3422070213bb2b 100644 --- a/src/libraries/System.Security.Cryptography/tests/Sum32Hash.cs +++ b/src/libraries/System.Security.Cryptography/tests/Sum32Hash.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -namespace System.Security.Cryptography.Hashing.Tests +namespace System.Security.Cryptography.Tests { internal class Sum32Hash : HashAlgorithm { diff --git a/src/libraries/System.Security.Cryptography/tests/SymmetricAlgorithm/Minimal.cs b/src/libraries/System.Security.Cryptography/tests/SymmetricAlgorithm/Minimal.cs index c6874d425b8242..16d901dac0fb75 100644 --- a/src/libraries/System.Security.Cryptography/tests/SymmetricAlgorithm/Minimal.cs +++ b/src/libraries/System.Security.Cryptography/tests/SymmetricAlgorithm/Minimal.cs @@ -1,10 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Collections.Generic; using Xunit; -namespace System.Security.Cryptography.Encryption.Tests.Symmetric +namespace System.Security.Cryptography.Tests.Symmetric { public class MinimalTests { diff --git a/src/libraries/System.Security.Cryptography/tests/SymmetricAlgorithm/Trivial.cs b/src/libraries/System.Security.Cryptography/tests/SymmetricAlgorithm/Trivial.cs index 6c566263feef11..6cfa2b069a5dc4 100644 --- a/src/libraries/System.Security.Cryptography/tests/SymmetricAlgorithm/Trivial.cs +++ b/src/libraries/System.Security.Cryptography/tests/SymmetricAlgorithm/Trivial.cs @@ -2,10 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Linq; -using System.Reflection; using Xunit; -namespace System.Security.Cryptography.Encryption.Tests.Symmetric +namespace System.Security.Cryptography.Tests.Symmetric { public static class TrivialTests { diff --git a/src/libraries/System.Security.Cryptography/tests/SymmetricAlgorithmTests.cs b/src/libraries/System.Security.Cryptography/tests/SymmetricAlgorithmTests.cs index c03909efd391ae..d2924b73978eef 100644 --- a/src/libraries/System.Security.Cryptography/tests/SymmetricAlgorithmTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/SymmetricAlgorithmTests.cs @@ -1,11 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; using System.Collections.Generic; using Xunit; -namespace System.Security.Cryptography.Primitives.Tests +namespace System.Security.Cryptography.Tests { public static class SymmetricAlgorithmTests { diff --git a/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj b/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj index 3131378207d2d4..8621f98748bd14 100644 --- a/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj +++ b/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj @@ -1,37 +1,300 @@ - $(NetCoreAppCurrent) + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Android;$(NetCoreAppCurrent)-Browser true + $(NoWarn);SYSLIB0021 + true + true + + + true - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/TrimmingTests/RSAXmlTest.cs b/src/libraries/System.Security.Cryptography/tests/TrimmingTests/RSAXmlTest.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/TrimmingTests/RSAXmlTest.cs rename to src/libraries/System.Security.Cryptography/tests/TrimmingTests/RSAXmlTest.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/TrimmingTests/System.Security.Cryptography.Algorithms.TrimmingTests.proj b/src/libraries/System.Security.Cryptography/tests/TrimmingTests/System.Security.Cryptography.TrimmingTests.proj similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/TrimmingTests/System.Security.Cryptography.Algorithms.TrimmingTests.proj rename to src/libraries/System.Security.Cryptography/tests/TrimmingTests/System.Security.Cryptography.TrimmingTests.proj diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/TripleDesProvider.cs b/src/libraries/System.Security.Cryptography/tests/TripleDesProvider.cs similarity index 100% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/TripleDesProvider.cs rename to src/libraries/System.Security.Cryptography/tests/TripleDesProvider.cs diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/TripleDesTests.cs b/src/libraries/System.Security.Cryptography/tests/TripleDesTests.cs similarity index 99% rename from src/libraries/System.Security.Cryptography.Algorithms/tests/TripleDesTests.cs rename to src/libraries/System.Security.Cryptography/tests/TripleDesTests.cs index 0a7b2b8e854e1e..64b9c402a5da85 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/TripleDesTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/TripleDesTests.cs @@ -7,7 +7,7 @@ using Test.Cryptography; using Xunit; -namespace System.Security.Cryptography.Encryption.TripleDes.Tests +namespace System.Security.Cryptography.Tests { [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public static partial class TripleDesTests diff --git a/src/libraries/System.Security.Cryptography/tests/ZeroMemoryTests.cs b/src/libraries/System.Security.Cryptography/tests/ZeroMemoryTests.cs index ab0a0f373f5225..5055743c1548b8 100644 --- a/src/libraries/System.Security.Cryptography/tests/ZeroMemoryTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/ZeroMemoryTests.cs @@ -5,7 +5,7 @@ using System.Reflection; using Xunit; -namespace System.Security.Cryptography.Primitives.Tests +namespace System.Security.Cryptography.Tests { public static class ZeroMemoryTests { diff --git a/src/libraries/System.Security.Principal.Windows/src/System.Security.Principal.Windows.csproj b/src/libraries/System.Security.Principal.Windows/src/System.Security.Principal.Windows.csproj index 7217065c078e52..831490db6c4975 100644 --- a/src/libraries/System.Security.Principal.Windows/src/System.Security.Principal.Windows.csproj +++ b/src/libraries/System.Security.Principal.Windows/src/System.Security.Principal.Windows.csproj @@ -26,6 +26,8 @@ + + ()); - Win32.InitializeReferencedDomainsPointer(ReferencedDomainsPtr); + ReferencedDomainsPtr.InitializeReferencedDomainsList(); Interop.LSA_TRANSLATED_SID2[] translatedSids = new Interop.LSA_TRANSLATED_SID2[sourceAccounts.Count]; SidsPtr.ReadArray(0, translatedSids, 0, translatedSids.Length); diff --git a/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/SID.cs b/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/SID.cs index 025e1c8ef1c7b8..99b71b2df31184 100644 --- a/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/SID.cs +++ b/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/SID.cs @@ -1001,7 +1001,7 @@ private static IdentityReferenceCollection TranslateToNTAccounts(IdentityReferen // Open LSA policy (for lookup requires it) // - LsaHandle = Win32.LsaOpenPolicy(null, PolicyRights.POLICY_LOOKUP_NAMES); + LsaHandle = Win32.LsaOpenPolicy(null, Interop.Advapi32.PolicyRights.POLICY_LOOKUP_NAMES); // // Perform the actual lookup @@ -1040,7 +1040,7 @@ private static IdentityReferenceCollection TranslateToNTAccounts(IdentityReferen NamesPtr.Initialize((uint)sourceSids.Count, (uint)Marshal.SizeOf()); - Win32.InitializeReferencedDomainsPointer(ReferencedDomainsPtr); + ReferencedDomainsPtr.InitializeReferencedDomainsList(); // // Interpret the results and generate NTAccount objects diff --git a/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/Win32.cs b/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/Win32.cs index a4302d97b6a732..af9e86c008036a 100644 --- a/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/Win32.cs +++ b/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/Win32.cs @@ -8,24 +8,6 @@ namespace System.Security.Principal { - [Flags] - internal enum PolicyRights - { - POLICY_VIEW_LOCAL_INFORMATION = 0x00000001, - POLICY_VIEW_AUDIT_INFORMATION = 0x00000002, - POLICY_GET_PRIVATE_INFORMATION = 0x00000004, - POLICY_TRUST_ADMIN = 0x00000008, - POLICY_CREATE_ACCOUNT = 0x00000010, - POLICY_CREATE_SECRET = 0x00000020, - POLICY_CREATE_PRIVILEGE = 0x00000040, - POLICY_SET_DEFAULT_QUOTA_LIMITS = 0x00000080, - POLICY_SET_AUDIT_REQUIREMENTS = 0x00000100, - POLICY_AUDIT_LOG_ADMIN = 0x00000200, - POLICY_SERVER_ADMIN = 0x00000400, - POLICY_LOOKUP_NAMES = 0x00000800, - POLICY_NOTIFICATION = 0x00001000, - } - internal static class Win32 { internal const int FALSE = 0; @@ -37,7 +19,7 @@ internal static class Win32 internal static SafeLsaPolicyHandle LsaOpenPolicy( string? systemName, - PolicyRights rights) + Interop.Advapi32.PolicyRights rights) { Interop.OBJECT_ATTRIBUTES attributes = default; @@ -122,7 +104,7 @@ out byte[]? resultSid try { - if (FALSE == Interop.Advapi32.ConvertStringSidToSid(stringSid, out ByteArray)) + if (Interop.BOOL.FALSE == Interop.Advapi32.ConvertStringSidToSid(stringSid, out ByteArray)) { ErrorCode = Marshal.GetLastWin32Error(); goto Error; @@ -205,48 +187,6 @@ internal static bool IsEqualDomainSid(SecurityIdentifier sid1, SecurityIdentifie } } - /// - /// Setup the size of the buffer Windows provides for an LSA_REFERENCED_DOMAIN_LIST - /// - - internal static void InitializeReferencedDomainsPointer(SafeLsaMemoryHandle referencedDomains) - { - Debug.Assert(referencedDomains != null, "referencedDomains != null"); - - // We don't know the real size of the referenced domains yet, so we need to set an initial - // size based on the LSA_REFERENCED_DOMAIN_LIST structure, then resize it to include all of - // the domains. - referencedDomains!.Initialize((uint)Marshal.SizeOf()); - Interop.LSA_REFERENCED_DOMAIN_LIST domainList = referencedDomains.Read(0); - - unsafe - { - byte* pRdl = null; - try - { - referencedDomains.AcquirePointer(ref pRdl); - - // If there is a trust information list, then the buffer size is the end of that list minus - // the beginning of the domain list. Otherwise, then the buffer is just the size of the - // referenced domain list structure, which is what we defaulted to. - if (domainList.Domains != IntPtr.Zero) - { - Interop.LSA_TRUST_INFORMATION* pTrustInformation = (Interop.LSA_TRUST_INFORMATION*)domainList.Domains; - pTrustInformation = pTrustInformation + domainList.Entries; - - long bufferSize = (byte*)pTrustInformation - pRdl; - Debug.Assert(bufferSize > 0, "bufferSize > 0"); - referencedDomains.Initialize((ulong)bufferSize); - } - } - finally - { - if (pRdl != null) - referencedDomains.ReleasePointer(); - } - } - } - // // Wrapper around avdapi32.GetWindowsAccountDomainSid // diff --git a/src/libraries/System.ServiceProcess.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/System.ServiceProcess.ServiceController.TestService.csproj b/src/libraries/System.ServiceProcess.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/System.ServiceProcess.ServiceController.TestService.csproj index 489f6bbf553f3e..fe1302370b388d 100644 --- a/src/libraries/System.ServiceProcess.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/System.ServiceProcess.ServiceController.TestService.csproj +++ b/src/libraries/System.ServiceProcess.ServiceController/tests/System.ServiceProcess.ServiceController.TestService/System.ServiceProcess.ServiceController.TestService.csproj @@ -4,6 +4,7 @@ Exe $(NetCoreAppCurrent);$(NetFrameworkMinimum) annotations + true diff --git a/src/libraries/System.Speech/src/AudioFormat/AudioFormatConverter.cs b/src/libraries/System.Speech/src/AudioFormat/AudioFormatConverter.cs index 66521fc6fc76ed..9bb69b74878208 100644 --- a/src/libraries/System.Speech/src/AudioFormat/AudioFormatConverter.cs +++ b/src/libraries/System.Speech/src/AudioFormat/AudioFormatConverter.cs @@ -14,10 +14,10 @@ internal static class AudioFormatConverter internal static SpeechAudioFormatInfo ToSpeechAudioFormatInfo(IntPtr waveFormatPtr) { - WaveFormatEx waveFormatEx = (WaveFormatEx)Marshal.PtrToStructure(waveFormatPtr, typeof(WaveFormatEx)); + WaveFormatEx waveFormatEx = Marshal.PtrToStructure(waveFormatPtr); byte[] extraData = new byte[waveFormatEx.cbSize]; - IntPtr extraDataPtr = new(waveFormatPtr.ToInt64() + Marshal.SizeOf(waveFormatEx)); + IntPtr extraDataPtr = new(waveFormatPtr.ToInt64() + Marshal.SizeOf()); for (int i = 0; i < waveFormatEx.cbSize; i++) { extraData[i] = Marshal.ReadByte(extraDataPtr, i); diff --git a/src/libraries/System.Speech/src/Internal/SapiInterop/SapiRecoInterop.cs b/src/libraries/System.Speech/src/Internal/SapiInterop/SapiRecoInterop.cs index 2c91bbd961b307..60999d287403ff 100644 --- a/src/libraries/System.Speech/src/Internal/SapiInterop/SapiRecoInterop.cs +++ b/src/libraries/System.Speech/src/Internal/SapiInterop/SapiRecoInterop.cs @@ -450,7 +450,7 @@ internal static ISpPhrase CreatePhraseFromWordUnits(RecognizedWordUnit[] words, SPPHRASEELEMENT[] elements = new SPPHRASEELEMENT[words.Length]; // build the unmanaged interop layer - int size = Marshal.SizeOf(typeof(SPPHRASEELEMENT)); + int size = Marshal.SizeOf(); List handles = new(); coMem = Marshal.AllocCoTaskMem(size * elements.Length); @@ -496,7 +496,7 @@ internal static ISpPhrase CreatePhraseFromWordUnits(RecognizedWordUnit[] words, elements[i].pszPronunciation = handle.AddrOfPinnedObject(); } - Marshal.StructureToPtr(elements[i], new IntPtr((long)coMem + size * i), false); + Marshal.StructureToPtr(elements[i], new IntPtr((long)coMem + size * i), false); } } finally @@ -505,7 +505,7 @@ internal static ISpPhrase CreatePhraseFromWordUnits(RecognizedWordUnit[] words, } SPPHRASE spPhrase = new(); - spPhrase.cbSize = (uint)Marshal.SizeOf(spPhrase.GetType()); + spPhrase.cbSize = (uint)Marshal.SizeOf(); spPhrase.LangID = (ushort)culture.LCID; spPhrase.Rule = new SPPHRASERULE { diff --git a/src/libraries/System.Speech/src/Internal/SapiInterop/SpeechEvent.cs b/src/libraries/System.Speech/src/Internal/SapiInterop/SpeechEvent.cs index 0758126ec01531..1616b7e105056a 100644 --- a/src/libraries/System.Speech/src/Internal/SapiInterop/SpeechEvent.cs +++ b/src/libraries/System.Speech/src/Internal/SapiInterop/SpeechEvent.cs @@ -26,7 +26,7 @@ private SpeechEvent(SPEVENTENUM eEventId, SPEVENTLPARAMTYPE elParamType, // Let the GC know if we have a unmanaged object with a given size if (_paramType == SPEVENTLPARAMTYPE.SPET_LPARAM_IS_POINTER || _paramType == SPEVENTLPARAMTYPE.SPET_LPARAM_IS_STRING) { - GC.AddMemoryPressure(_sizeMemoryPressure = Marshal.SizeOf(_lParam)); + GC.AddMemoryPressure(_sizeMemoryPressure = sizeof(ulong)); } } diff --git a/src/libraries/System.Speech/src/Internal/SrgsCompiler/BackEnd.cs b/src/libraries/System.Speech/src/Internal/SrgsCompiler/BackEnd.cs index b30d0c38cc6932..0f678c5c0f209c 100644 --- a/src/libraries/System.Speech/src/Internal/SrgsCompiler/BackEnd.cs +++ b/src/libraries/System.Speech/src/Internal/SrgsCompiler/BackEnd.cs @@ -1005,7 +1005,7 @@ private CfgGrammar.CfgSerializedHeader BuildHeader(List sortedStates, int } CfgGrammar.CfgSerializedHeader header = new(); - uint ulOffset = (uint)Marshal.SizeOf(typeof(CfgGrammar.CfgSerializedHeader)); + uint ulOffset = (uint)Marshal.SizeOf(); header.FormatId = CfgGrammar._SPGDF_ContextFree; _guid = Guid.NewGuid(); @@ -1032,16 +1032,16 @@ private CfgGrammar.CfgSerializedHeader BuildHeader(List sortedStates, int ulOffset += (uint)_symbols.SerializeSize() * Helpers._sizeOfChar; header.cRules = _rules.Count; header.pRules = ulOffset; - ulOffset += (uint)(_rules.Count * Marshal.SizeOf(typeof(CfgRule))); + ulOffset += (uint)(_rules.Count * Marshal.SizeOf()); header.cBasePath = cBasePath > 0 ? ulOffset : 0; //If there is no base path offset is set to zero ulOffset += (uint)((cBasePath * Helpers._sizeOfChar + 3) & ~3); header.cArcs = cArcs; header.pArcs = ulOffset; - ulOffset += (uint)(cArcs * Marshal.SizeOf(typeof(CfgArc))); + ulOffset += (uint)(cArcs * Marshal.SizeOf()); if (_fNeedWeightTable) { header.pWeights = ulOffset; - ulOffset += (uint)(cArcs * Marshal.SizeOf(typeof(float))); + ulOffset += (uint)(cArcs * sizeof(float)); pWeights = new float[cArcs]; pWeights[0] = 0.0f; } @@ -1067,16 +1067,16 @@ private CfgGrammar.CfgSerializedHeader BuildHeader(List sortedStates, int header.GrammarMode = (uint)_grammarMode; header.cTags = cSemanticTags; header.tags = ulOffset; - ulOffset += (uint)(cSemanticTags * Marshal.SizeOf(typeof(CfgSemanticTag))); + ulOffset += (uint)(cSemanticTags * Marshal.SizeOf()); header.cScripts = _scriptRefs.Count; header.pScripts = header.cScripts > 0 ? ulOffset : 0; - ulOffset += (uint)(_scriptRefs.Count * Marshal.SizeOf(typeof(CfgScriptRef))); + ulOffset += (uint)(_scriptRefs.Count * Marshal.SizeOf()); header.cIL = 0; header.pIL = 0; - ulOffset += (uint)(header.cIL * Marshal.SizeOf(typeof(byte))); + ulOffset += (uint)(header.cIL * sizeof(byte)); header.cPDB = 0; header.pPDB = 0; - ulOffset += (uint)(header.cPDB * Marshal.SizeOf(typeof(byte))); + ulOffset += (uint)(header.cPDB * sizeof(byte)); header.ulTotalSerializedSize = ulOffset; return header; } diff --git a/src/libraries/System.Speech/src/Internal/SrgsCompiler/CFGGrammar.cs b/src/libraries/System.Speech/src/Internal/SrgsCompiler/CFGGrammar.cs index 67bac9e6029aa9..410739a3be681f 100644 --- a/src/libraries/System.Speech/src/Internal/SrgsCompiler/CFGGrammar.cs +++ b/src/libraries/System.Speech/src/Internal/SrgsCompiler/CFGGrammar.cs @@ -272,7 +272,7 @@ internal static CfgHeader ConvertCfgHeader(StreamMarshaler streamHelper, bool in } //We know that in SAPI 5.0 grammar format pszWords follows header immediately. - if (cfgSerializedHeader.pszWords < Marshal.SizeOf(typeof(CfgSerializedHeader))) + if (cfgSerializedHeader.pszWords < Marshal.SizeOf()) { //This is SAPI 5.0 and SAPI 5.1 grammar format header.ulRootRuleIndex = 0xFFFFFFFF; @@ -294,7 +294,7 @@ internal static CfgHeader ConvertCfgHeader(StreamMarshaler streamHelper, bool in // Get the chars and build the string if (cfgSerializedHeader.cBasePath > 0) { - streamHelper.Stream.Position = (int)cfgSerializedHeader.pRules + (header.rules.Length * Marshal.SizeOf(typeof(CfgRule))); + streamHelper.Stream.Position = (int)cfgSerializedHeader.pRules + (header.rules.Length * Marshal.SizeOf()); header.BasePath = streamHelper.ReadNullTerminatedString(); } } @@ -319,7 +319,7 @@ internal static ScriptRef[] LoadScriptRefs(StreamMarshaler streamHelper, CfgSeri } //We know that in SAPI 5.0 grammar format pszWords follows header immediately. - if (pFH.pszWords < Marshal.SizeOf(typeof(CfgSerializedHeader))) + if (pFH.pszWords < Marshal.SizeOf()) { // Must be SAPI 6.0 or above to hold a .NET script return null; @@ -412,25 +412,25 @@ private static void CheckValidCfgFormat(CfgSerializedHeader pFH, CfgHeader heade //Check the rule offset if (pFH.cRules > 0) { - CheckSetOffsets(pFH.pRules, pFH.cRules * Marshal.SizeOf(typeof(CfgRule)), ref ullStartOffset, pFH.ulTotalSerializedSize); + CheckSetOffsets(pFH.pRules, pFH.cRules * Marshal.SizeOf(), ref ullStartOffset, pFH.ulTotalSerializedSize); } //Check the arc offset if (pFH.cArcs > 0) { - CheckSetOffsets(pFH.pArcs, pFH.cArcs * Marshal.SizeOf(typeof(CfgArc)), ref ullStartOffset, pFH.ulTotalSerializedSize); + CheckSetOffsets(pFH.pArcs, pFH.cArcs * Marshal.SizeOf(), ref ullStartOffset, pFH.ulTotalSerializedSize); } //Check the weight offset if (pFH.pWeights > 0) { - CheckSetOffsets(pFH.pWeights, pFH.cArcs * Marshal.SizeOf(typeof(float)), ref ullStartOffset, pFH.ulTotalSerializedSize); + CheckSetOffsets(pFH.pWeights, pFH.cArcs * sizeof(float), ref ullStartOffset, pFH.ulTotalSerializedSize); } //Check the semantic tag offset if (pFH.cTags > 0) { - CheckSetOffsets(pFH.tags, pFH.cTags * Marshal.SizeOf(typeof(CfgSemanticTag)), ref ullStartOffset, pFH.ulTotalSerializedSize); + CheckSetOffsets(pFH.tags, pFH.cTags * Marshal.SizeOf(), ref ullStartOffset, pFH.ulTotalSerializedSize); if (includeAllGrammarData) { @@ -465,17 +465,17 @@ private static void CheckValidCfgFormat(CfgSerializedHeader pFH, CfgHeader heade //Check the offset for the scripts if (pFH.cScripts > 0) { - CheckSetOffsets(pFH.pScripts, pFH.cScripts * Marshal.SizeOf(typeof(CfgScriptRef)), ref ullStartOffset, pFH.ulTotalSerializedSize); + CheckSetOffsets(pFH.pScripts, pFH.cScripts * Marshal.SizeOf(), ref ullStartOffset, pFH.ulTotalSerializedSize); } if (pFH.cIL > 0) { - CheckSetOffsets(pFH.pIL, pFH.cIL * Marshal.SizeOf(typeof(byte)), ref ullStartOffset, pFH.ulTotalSerializedSize); + CheckSetOffsets(pFH.pIL, pFH.cIL * sizeof(byte), ref ullStartOffset, pFH.ulTotalSerializedSize); } if (pFH.cPDB > 0) { - CheckSetOffsets(pFH.pPDB, pFH.cPDB * Marshal.SizeOf(typeof(byte)), ref ullStartOffset, pFH.ulTotalSerializedSize); + CheckSetOffsets(pFH.pPDB, pFH.cPDB * sizeof(byte), ref ullStartOffset, pFH.ulTotalSerializedSize); } } diff --git a/src/libraries/System.Speech/src/Internal/StreamMarshaler.cs b/src/libraries/System.Speech/src/Internal/StreamMarshaler.cs index 4742ff49787c4f..eba58d96cc8672 100644 --- a/src/libraries/System.Speech/src/Internal/StreamMarshaler.cs +++ b/src/libraries/System.Speech/src/Internal/StreamMarshaler.cs @@ -30,8 +30,7 @@ public void Dispose() #region internal Methods internal void ReadArray(T[] ao, int c) { - Type type = typeof(T); - int sizeOfOne = Marshal.SizeOf(type); + int sizeOfOne = Marshal.SizeOf(); int sizeObject = sizeOfOne * c; byte[] ab = Helpers.ReadStreamToByteArray(_stream, sizeObject); @@ -40,21 +39,20 @@ internal void ReadArray(T[] ao, int c) Marshal.Copy(ab, 0, buffer, sizeObject); for (int i = 0; i < c; i++) { - ao[i] = (T)Marshal.PtrToStructure((IntPtr)((long)buffer + i * sizeOfOne), type); + ao[i] = Marshal.PtrToStructure((IntPtr)((long)buffer + i * sizeOfOne)); } } internal void WriteArray(T[] ao, int c) { - Type type = typeof(T); - int sizeOfOne = Marshal.SizeOf(type); + int sizeOfOne = Marshal.SizeOf(); int sizeObject = sizeOfOne * c; byte[] ab = new byte[sizeObject]; IntPtr buffer = _safeHMem.Buffer(sizeObject); for (int i = 0; i < c; i++) { - Marshal.StructureToPtr(ao[i], (IntPtr)((long)buffer + i * sizeOfOne), false); + Marshal.StructureToPtr(ao[i], (IntPtr)((long)buffer + i * sizeOfOne), false); } Marshal.Copy(buffer, ab, 0, sizeObject); @@ -116,24 +114,24 @@ internal void WriteArrayChar(char[] ach, int c) } } - internal void ReadStream(object o) + internal void ReadStream(T o) { - int sizeObject = Marshal.SizeOf(o.GetType()); + int sizeObject = Marshal.SizeOf(); byte[] ab = Helpers.ReadStreamToByteArray(_stream, sizeObject); IntPtr buffer = _safeHMem.Buffer(sizeObject); Marshal.Copy(ab, 0, buffer, sizeObject); - Marshal.PtrToStructure(buffer, o); + Marshal.PtrToStructure(buffer, o); } - internal void WriteStream(object o) + internal void WriteStream(T o) { - int sizeObject = Marshal.SizeOf(o.GetType()); + int sizeObject = Marshal.SizeOf(); byte[] ab = new byte[sizeObject]; IntPtr buffer = _safeHMem.Buffer(sizeObject); - Marshal.StructureToPtr(o, buffer, false); + Marshal.StructureToPtr(o, buffer, false); Marshal.Copy(buffer, ab, 0, sizeObject); // Read the Header diff --git a/src/libraries/System.Speech/src/Internal/Synthesis/AudioBase.cs b/src/libraries/System.Speech/src/Internal/Synthesis/AudioBase.cs index b5650685fbeacb..ff57d09872075e 100644 --- a/src/libraries/System.Speech/src/Internal/Synthesis/AudioBase.cs +++ b/src/libraries/System.Speech/src/Internal/Synthesis/AudioBase.cs @@ -234,10 +234,10 @@ internal static void WriteWaveHeader(Stream stream, WAVEFORMATEX waveEx, long po BLOCKHDR block = new(0); DATAHDR dataHdr = new(0); - int cRiff = Marshal.SizeOf(riff); - int cBlock = Marshal.SizeOf(block); + int cRiff = Marshal.SizeOf(); + int cBlock = Marshal.SizeOf(); int cWaveEx = waveEx.Length;// Marshal.SizeOf (waveEx); // The CLR automatically pad the waveEx structure to dword boundary. Force 16. - int cDataHdr = Marshal.SizeOf(dataHdr); + int cDataHdr = Marshal.SizeOf(); int total = cRiff + cBlock + cWaveEx + cDataHdr; diff --git a/src/libraries/System.Speech/src/Internal/Synthesis/AudioDeviceOut.cs b/src/libraries/System.Speech/src/Internal/Synthesis/AudioDeviceOut.cs index 9df323e94c7dac..40b1ecfcfa20db 100644 --- a/src/libraries/System.Speech/src/Internal/Synthesis/AudioDeviceOut.cs +++ b/src/libraries/System.Speech/src/Internal/Synthesis/AudioDeviceOut.cs @@ -20,7 +20,7 @@ internal class AudioDeviceOut : AudioBase, IDisposable /// internal AudioDeviceOut(int curDevice, IAsyncDispatch asyncDispatch) { - _delegate = new SafeNativeMethods.WaveOutProc(CallBackProc); + _delegate = new Interop.WinMM.WaveOutProc(CallBackProc); _asyncDispatch = asyncDispatch; _curDevice = curDevice; } @@ -39,7 +39,7 @@ private void Dispose(bool disposing) { if (_deviceOpen && _hwo != IntPtr.Zero) { - SafeNativeMethods.waveOutClose(_hwo); + Interop.WinMM.waveOutClose(_hwo); _deviceOpen = false; } if (disposing) @@ -68,21 +68,21 @@ internal override void Begin(byte[] wfx) // Get the alignments values WAVEFORMATEX.AvgBytesPerSec(wfx, out _nAvgBytesPerSec, out _blockAlign); - MMSYSERR result; + Interop.WinMM.MMSYSERR result; lock (_noWriteOutLock) { - result = SafeNativeMethods.waveOutOpen(ref _hwo, _curDevice, wfx, _delegate, IntPtr.Zero, SafeNativeMethods.CALLBACK_FUNCTION); + result = Interop.WinMM.waveOutOpen(ref _hwo, _curDevice, wfx, _delegate, IntPtr.Zero, Interop.WinMM.CALLBACK_FUNCTION); - if (_fPaused && result == MMSYSERR.NOERROR) + if (_fPaused && result == Interop.WinMM.MMSYSERR.NOERROR) { - result = SafeNativeMethods.waveOutPause(_hwo); + result = Interop.WinMM.waveOutPause(_hwo); } // set the flags _aborted = false; _deviceOpen = true; } - if (result != MMSYSERR.NOERROR) + if (result != Interop.WinMM.MMSYSERR.NOERROR) { throw new AudioException(result); } @@ -108,19 +108,17 @@ internal override void End() { _deviceOpen = false; - MMSYSERR result; - CheckForAbort(); if (_queueIn.Count != 0) { - SafeNativeMethods.waveOutReset(_hwo); + Interop.WinMM.waveOutReset(_hwo); } // Close it; no point in returning errors if this fails - result = SafeNativeMethods.waveOutClose(_hwo); + Interop.WinMM.MMSYSERR result = Interop.WinMM.waveOutClose(_hwo); - if (result != MMSYSERR.NOERROR) + if (result != Interop.WinMM.MMSYSERR.NOERROR) { // This may create a dead lock System.Diagnostics.Debug.Assert(false); @@ -146,9 +144,9 @@ internal override void Play(byte[] buffer) WaveHeader waveHeader = new(buffer); GCHandle waveHdr = waveHeader.WAVEHDR; - MMSYSERR result = SafeNativeMethods.waveOutPrepareHeader(_hwo, waveHdr.AddrOfPinnedObject(), waveHeader.SizeHDR); + Interop.WinMM.MMSYSERR result = Interop.WinMM.waveOutPrepareHeader(_hwo, waveHdr.AddrOfPinnedObject(), waveHeader.SizeHDR); - if (result != MMSYSERR.NOERROR) + if (result != Interop.WinMM.MMSYSERR.NOERROR) { throw new AudioException(result); } @@ -168,8 +166,8 @@ internal override void Play(byte[] buffer) } // Start playback of the first buffer - result = SafeNativeMethods.waveOutWrite(_hwo, waveHdr.AddrOfPinnedObject(), waveHeader.SizeHDR); - if (result != MMSYSERR.NOERROR) + result = Interop.WinMM.waveOutWrite(_hwo, waveHdr.AddrOfPinnedObject(), waveHeader.SizeHDR); + if (result != Interop.WinMM.MMSYSERR.NOERROR) { lock (_queueIn) { @@ -193,8 +191,8 @@ internal override void Pause() { if (_deviceOpen) { - MMSYSERR result = SafeNativeMethods.waveOutPause(_hwo); - if (result != MMSYSERR.NOERROR) + Interop.WinMM.MMSYSERR result = Interop.WinMM.waveOutPause(_hwo); + if (result != Interop.WinMM.MMSYSERR.NOERROR) { System.Diagnostics.Debug.Assert(false, ((int)result).ToString(System.Globalization.CultureInfo.InvariantCulture)); } @@ -215,8 +213,8 @@ internal override void Resume() { if (_deviceOpen) { - MMSYSERR result = SafeNativeMethods.waveOutRestart(_hwo); - if (result != MMSYSERR.NOERROR) + Interop.WinMM.MMSYSERR result = Interop.WinMM.waveOutRestart(_hwo); + if (result != Interop.WinMM.MMSYSERR.NOERROR) { System.Diagnostics.Debug.Assert(false); } @@ -236,7 +234,7 @@ internal override void Abort() _aborted = true; if (_queueIn.Count > 0) { - SafeNativeMethods.waveOutReset(_hwo); + Interop.WinMM.waveOutReset(_hwo); _evt.WaitOne(); } } @@ -286,7 +284,7 @@ internal override void WaitUntilDone() /// Number of output devices internal static int NumDevices() { - return SafeNativeMethods.waveOutGetNumDevs(); + return Interop.WinMM.waveOutGetNumDevs(); } internal static int GetDevicedId(string name) @@ -294,7 +292,7 @@ internal static int GetDevicedId(string name) for (int iDevice = 0; iDevice < NumDevices(); iDevice++) { string device; - if (GetDeviceName(iDevice, out device) == MMSYSERR.NOERROR && string.Equals(device, name, StringComparison.OrdinalIgnoreCase)) + if (GetDeviceName(iDevice, out device) == Interop.WinMM.MMSYSERR.NOERROR && string.Equals(device, name, StringComparison.OrdinalIgnoreCase)) { return iDevice; } @@ -308,20 +306,20 @@ internal static int GetDevicedId(string name) /// ID of the device /// Destination string assigned the name /// MMSYSERR.NOERROR if successful - internal static MMSYSERR GetDeviceName(int deviceId, [MarshalAs(UnmanagedType.LPWStr)] out string prodName) + internal static Interop.WinMM.MMSYSERR GetDeviceName(int deviceId, [MarshalAs(UnmanagedType.LPWStr)] out string prodName) { prodName = string.Empty; - SafeNativeMethods.WAVEOUTCAPS caps = new(); + Interop.WinMM.WAVEOUTCAPS caps = new(); - MMSYSERR result = SafeNativeMethods.waveOutGetDevCaps((IntPtr)deviceId, ref caps, Marshal.SizeOf(caps)); - if (result != MMSYSERR.NOERROR) + Interop.WinMM.MMSYSERR result = Interop.WinMM.waveOutGetDevCaps((IntPtr)deviceId, ref caps, Marshal.SizeOf()); + if (result != Interop.WinMM.MMSYSERR.NOERROR) { return result; } prodName = caps.szPname; - return MMSYSERR.NOERROR; + return Interop.WinMM.MMSYSERR.NOERROR; } #endregion @@ -346,9 +344,9 @@ internal override TimeSpan Duration #region Private Methods - private void CallBackProc(IntPtr hwo, MM_MSG uMsg, IntPtr dwInstance, IntPtr dwParam1, IntPtr dwParam2) + private void CallBackProc(IntPtr hwo, Interop.WinMM.MM_MSG uMsg, IntPtr dwInstance, IntPtr dwParam1, IntPtr dwParam2) { - if (uMsg == MM_MSG.MM_WOM_DONE) + if (uMsg == Interop.WinMM.MM_MSG.MM_WOM_DONE) { InItem inItem; lock (_queueIn) @@ -391,11 +389,9 @@ private void ClearBuffers() foreach (InItem item in _queueOut) { WaveHeader waveHeader = item._waveHeader; - MMSYSERR result; - - result = SafeNativeMethods.waveOutUnprepareHeader( + Interop.WinMM.MMSYSERR result = Interop.WinMM.waveOutUnprepareHeader( _hwo, waveHeader.WAVEHDR.AddrOfPinnedObject(), waveHeader.SizeHDR); - if (result != MMSYSERR.NOERROR) + if (result != Interop.WinMM.MMSYSERR.NOERROR) { //System.Diagnostics.Debug.Assert (false); } @@ -418,7 +414,7 @@ private void CheckForAbort() if (inItem._waveHeader != null) { WaveHeader waveHeader = inItem._waveHeader; - SafeNativeMethods.waveOutUnprepareHeader( + Interop.WinMM.waveOutUnprepareHeader( _hwo, waveHeader.WAVEHDR.AddrOfPinnedObject(), waveHeader.SizeHDR); waveHeader.Dispose(); } @@ -496,7 +492,7 @@ internal void ReleaseData() private ManualResetEvent _evt = new(false); - private SafeNativeMethods.WaveOutProc _delegate; + private Interop.WinMM.WaveOutProc _delegate; private IAsyncDispatch _asyncDispatch; diff --git a/src/libraries/System.Speech/src/Internal/Synthesis/AudioException.cs b/src/libraries/System.Speech/src/Internal/Synthesis/AudioException.cs index c766cd484dc9b8..c23de398cbb00f 100644 --- a/src/libraries/System.Speech/src/Internal/Synthesis/AudioException.cs +++ b/src/libraries/System.Speech/src/Internal/Synthesis/AudioException.cs @@ -12,7 +12,7 @@ internal class AudioException : Exception internal AudioException() { } - internal AudioException(MMSYSERR errorCode) : base(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0} - Error Code: 0x{1:x}", SR.Get(SRID.AudioDeviceError), (int)errorCode)) + internal AudioException(Interop.WinMM.MMSYSERR errorCode) : base(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0} - Error Code: 0x{1:x}", SR.Get(SRID.AudioDeviceError), (int)errorCode)) { } protected AudioException(SerializationInfo info, StreamingContext context) : base(info, context) diff --git a/src/libraries/System.Speech/src/Internal/Synthesis/SafeNativeMethods.cs b/src/libraries/System.Speech/src/Internal/Synthesis/SafeNativeMethods.cs deleted file mode 100644 index f0c380b5e919e5..00000000000000 --- a/src/libraries/System.Speech/src/Internal/Synthesis/SafeNativeMethods.cs +++ /dev/null @@ -1,216 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.InteropServices; - -namespace System.Speech.Internal.Synthesis -{ - // This class *MUST* be internal for security purposes - //CASRemoval:[SuppressUnmanagedCodeSecurity] - internal static class SafeNativeMethods - { - /// - /// This function prepares a waveform data block for playback. - /// - /// Handle to the waveform-audio output device. - /// Pointer to a WaveHeader structure that identifies the data - /// block to be prepared. The buffer's base address must be aligned with the - /// respect to the sample size. - /// Size, in bytes, of the WaveHeader structure. - /// MMSYSERR - [DllImport("winmm.dll")] - internal static extern MMSYSERR waveOutPrepareHeader(IntPtr hwo, IntPtr pwh, int cbwh); - - /// - /// This function sends a data block to the specified waveform output device. - /// - /// Handle to the waveform-audio output device. - /// Pointer to a WaveHeader structure containing information - /// about the data block. - /// Size, in bytes, of the WaveHeader structure. - /// MMSYSERR - [DllImport("winmm.dll")] - internal static extern MMSYSERR waveOutWrite(IntPtr hwo, IntPtr pwh, int cbwh); - - /// - /// This function cleans up the preparation performed by waveOutPrepareHeader. - /// The function must be called after the device driver is finished with a data - /// block. You must call this function before freeing the data buffer. - /// - /// Handle to the waveform-audio output device. - /// Pointer to a WaveHeader structure identifying the data block - /// to be cleaned up. - /// Size, in bytes, of the WaveHeader structure. - /// MMSYSERR - [DllImport("winmm.dll")] - internal static extern MMSYSERR waveOutUnprepareHeader(IntPtr hwo, IntPtr pwh, int cbwh); - - /// - /// This function opens a specified waveform output device for playback. - /// - /// Address filled with a handle identifying the open - /// waveform-audio output device. Use the handle to identify the device - /// when calling other waveform-audio output functions. This parameter might - /// be NULL if the WAVE_FORMAT_QUERY flag is specified for fdwOpen. - /// Identifier of the waveform-audio output device to - /// open. It can be either a device identifier or a Handle to an open - /// waveform-audio input device. - /// Pointer to a WaveFormat structure that identifies - /// the format of the waveform-audio data to be sent to the device. You can - /// free this structure immediately after passing it to waveOutOpen. - /// Specifies the address of a fixed callback function, - /// an event handle, a handle to a window, or the identifier of a thread to be - /// called during waveform-audio playback to process messages related to the - /// progress of the playback. If no callback function is required, this value - /// can be zero. - /// Specifies user-instance data passed to the - /// callback mechanism. This parameter is not used with the window callback - /// mechanism. - /// Flags for opening the device. - /// MMSYSERR - [DllImport("winmm.dll")] - internal static extern MMSYSERR waveOutOpen(ref IntPtr phwo, int uDeviceID, byte[] pwfx, WaveOutProc dwCallback, IntPtr dwInstance, uint fdwOpen); - - /// - /// This function closes the specified waveform output device. - /// - /// Handle to the waveform-audio output device. If the function - /// succeeds, the handle is no longer valid after this call. - /// MMSYSERR - [DllImport("winmm.dll")] - internal static extern MMSYSERR waveOutClose(IntPtr hwo); - - /// - /// This function stops playback on a specified waveform output device and - /// resets the current position to 0. All pending playback buffers are marked - /// as done and returned to the application. - /// - /// Handle to the waveform-audio output device. - /// MMSYSERR - [DllImport("winmm.dll")] - internal static extern MMSYSERR waveOutReset(IntPtr hwo); - - /// - /// This function pauses playback on a specified waveform output device. The - /// current playback position is saved. Use waveOutRestart to resume playback - /// from the current playback position. - /// - /// Handle to the waveform-audio output device. - /// MMSYSERR - [DllImport("winmm.dll")] - internal static extern MMSYSERR waveOutPause(IntPtr hwo); - - /// - /// This function restarts a paused waveform output device. - /// - /// Handle to the waveform-audio output device. - /// MMSYSERR - [DllImport("winmm.dll")] - internal static extern MMSYSERR waveOutRestart(IntPtr hwo); - - internal delegate void WaveOutProc(IntPtr hwo, MM_MSG uMsg, IntPtr dwInstance, IntPtr dwParam1, IntPtr dwParam2); - -#pragma warning disable CA1823 // unused fields - internal struct WAVEOUTCAPS - { - private ushort wMid; - private ushort wPid; - private uint vDriverVersion; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] - internal string szPname; - private uint dwFormats; - private ushort wChannels; - private ushort wReserved1; - private ushort dwSupport; - } -#pragma warning restore CA1823 - - /// - /// This function queries a specified waveform device to determine its - /// capabilities. - /// - /// Identifier of the waveform-audio output device. - /// It can be either a device identifier or a Handle to an open waveform-audio - /// output device. - /// Pointer to a WAVEOUTCAPS structure to be filled with - /// information about the capabilities of the device. - /// Size, in bytes, of the WAVEOUTCAPS structure. - /// MMSYSERR - [DllImport("winmm.dll")] - internal static extern MMSYSERR waveOutGetDevCaps(IntPtr uDeviceID, ref WAVEOUTCAPS caps, int cbwoc); - - /// - /// This function retrieves the number of waveform output devices present - /// in the system. - /// - /// The number of devices indicates success. Zero indicates that - /// no devices are present or that an error occurred. - [DllImport("winmm.dll")] - internal static extern int waveOutGetNumDevs(); - - // Used by MMTIME.wType - internal const uint TIME_MS = 0x0001; - internal const uint TIME_SAMPLES = 0x0002; - internal const uint TIME_BYTES = 0x0004; - internal const uint TIME_TICKS = 0x0020; - - // Flag specifying the use of a callback window for sound messages - internal const uint CALLBACK_WINDOW = 0x10000; - internal const uint CALLBACK_NULL = 0x00000000; - internal const uint CALLBACK_FUNCTION = 0x00030000; - } - - #region Internal Types - - /// - /// MM WAVEHDR structure - /// - [StructLayout(LayoutKind.Sequential)] - internal struct WAVEHDR - { - internal IntPtr lpData; // disposed by the GCHandle - internal uint dwBufferLength; - internal uint dwBytesRecorded; - internal uint dwUser; - internal uint dwFlags; - internal uint dwLoops; - internal IntPtr lpNext; // unused - internal uint reserved; - } - - // Enum equivalent to MMSYSERR_* - internal enum MMSYSERR : int - { - NOERROR = 0, - ERROR = (1), - BADDEVICEID = (2), - NOTENABLED = (3), - ALLOCATED = (4), - INVALHANDLE = (5), - NODRIVER = (6), - NOMEM = (7), - NOTSUPPORTED = (8), - BADERRNUM = (9), - INVALFLAG = (10), - INVALPARAM = (11), - HANDLEBUSY = (12), - INVALIDALIAS = (13), - BADDB = (14), - KEYNOTFOUND = (15), - READERROR = (16), - WRITEERROR = (17), - DELETEERROR = (18), - VALNOTFOUND = (19), - NODRIVERCB = (20), - LASTERROR = (20) - } - - internal enum MM_MSG - { - MM_WOM_OPEN = 0x03BB, - MM_WOM_CLOSE = 0x03BC, - MM_WOM_DONE = 0x03BD - } - - #endregion -} diff --git a/src/libraries/System.Speech/src/Internal/Synthesis/WaveHeader.cs b/src/libraries/System.Speech/src/Internal/Synthesis/WaveHeader.cs index ea569ba86ff350..723f9390b72733 100644 --- a/src/libraries/System.Speech/src/Internal/Synthesis/WaveHeader.cs +++ b/src/libraries/System.Speech/src/Internal/Synthesis/WaveHeader.cs @@ -86,7 +86,7 @@ internal int SizeHDR { get { - return Marshal.SizeOf(_waveHdr); + return Marshal.SizeOf(); } } @@ -142,7 +142,7 @@ internal int SizeHDR private GCHandle _gcHandleWaveHdr; - private WAVEHDR _waveHdr; + private Interop.WinMM.WAVEHDR _waveHdr; /// /// Specifies the length, in bytes, of the buffer. diff --git a/src/libraries/System.Speech/src/Result/RecognitionResult.cs b/src/libraries/System.Speech/src/Result/RecognitionResult.cs index 2df46ff8555d36..b3fca40bce68ea 100644 --- a/src/libraries/System.Speech/src/Result/RecognitionResult.cs +++ b/src/libraries/System.Speech/src/Result/RecognitionResult.cs @@ -151,7 +151,7 @@ public RecognizedAudio Audio { IntPtr audioBuffer = gc.AddrOfPinnedObject(); - SPWAVEFORMATEX audioHeader = (SPWAVEFORMATEX)Marshal.PtrToStructure(audioBuffer, typeof(SPWAVEFORMATEX)); + SPWAVEFORMATEX audioHeader = Marshal.PtrToStructure(audioBuffer); IntPtr rawDataBuffer = new((long)audioBuffer + audioHeader.cbUsed); byte[] rawAudioData = new byte[audioLength - audioHeader.cbUsed]; @@ -296,15 +296,15 @@ private void Initialize(IRecognizerInternal recognizer, ISpRecoResult recoResult int headerSize = Marshal.ReadInt32(buffer, 4); // Read header size directly from buffer - 4 is the offset of cbHeaderSize. - if (headerSize == Marshal.SizeOf(typeof(SPRESULTHEADER_Sapi51))) // SAPI 5.1 size + if (headerSize == Marshal.SizeOf()) // SAPI 5.1 size { - SPRESULTHEADER_Sapi51 legacyHeader = (SPRESULTHEADER_Sapi51)Marshal.PtrToStructure(buffer, typeof(SPRESULTHEADER_Sapi51)); + SPRESULTHEADER_Sapi51 legacyHeader = Marshal.PtrToStructure(buffer); _header = new SPRESULTHEADER(legacyHeader); _isSapi53Header = false; } else { - _header = (SPRESULTHEADER)Marshal.PtrToStructure(buffer, typeof(SPRESULTHEADER)); + _header = Marshal.PtrToStructure(buffer); _isSapi53Header = true; } @@ -355,12 +355,12 @@ private Collection ExtractAlternates(int numberOfAlternates, b { IntPtr buffer = gc.AddrOfPinnedObject(); - int sizeOfSpSerializedPhraseAlt = Marshal.SizeOf(typeof(SPSERIALIZEDPHRASEALT)); + int sizeOfSpSerializedPhraseAlt = Marshal.SizeOf(); int offset = 0; for (int i = 0; i < numberOfAlternates; i++) { IntPtr altBuffer = new((long)buffer + offset); - SPSERIALIZEDPHRASEALT alt = (SPSERIALIZEDPHRASEALT)Marshal.PtrToStructure(altBuffer, typeof(SPSERIALIZEDPHRASEALT)); + SPSERIALIZEDPHRASEALT alt = Marshal.PtrToStructure(altBuffer); offset += sizeOfSpSerializedPhraseAlt; // advance over SPSERIALIZEDPHRASEALT if (isSapi53Header) diff --git a/src/libraries/System.Speech/src/Result/RecognizedPhrase.cs b/src/libraries/System.Speech/src/Result/RecognizedPhrase.cs index ebcde98e50aaf9..ecd91138f297bf 100644 --- a/src/libraries/System.Speech/src/Result/RecognizedPhrase.cs +++ b/src/libraries/System.Speech/src/Result/RecognizedPhrase.cs @@ -159,7 +159,7 @@ public ReadOnlyCollection Words int elementsOffset = (int)_serializedPhrase.ElementsOffset; List wordList = new(countOfElements); - int sizeofPhraseElement = Marshal.SizeOf(typeof(SPSERIALIZEDPHRASEELEMENT)); + int sizeofPhraseElement = Marshal.SizeOf(); GCHandle gc = GCHandle.Alloc(_phraseBuffer, GCHandleType.Pinned); try @@ -168,7 +168,7 @@ public ReadOnlyCollection Words for (int i = 0; i < countOfElements; i++) { IntPtr elementBuffer = new((long)buffer + elementsOffset + i * sizeofPhraseElement); - SPSERIALIZEDPHRASEELEMENT element = (SPSERIALIZEDPHRASEELEMENT)Marshal.PtrToStructure(elementBuffer, typeof(SPSERIALIZEDPHRASEELEMENT)); + SPSERIALIZEDPHRASEELEMENT element = Marshal.PtrToStructure(elementBuffer); string displayForm = null, lexicalForm = null, pronunciation = null; if (element.pszDisplayTextOffset != 0) @@ -292,9 +292,9 @@ public Collection ReplacementWordUnits // Get the ITN and Look for replacement phrase/ IntPtr itnBuffer = new((long)buffer + _serializedPhrase.ReplacementsOffset); - for (int i = 0; i < _serializedPhrase.cReplacements; i++, itnBuffer = (IntPtr)((long)itnBuffer + Marshal.SizeOf(typeof(SPPHRASEREPLACEMENT)))) + for (int i = 0; i < _serializedPhrase.cReplacements; i++, itnBuffer = (IntPtr)((long)itnBuffer + Marshal.SizeOf())) { - SPPHRASEREPLACEMENT replacement = (SPPHRASEREPLACEMENT)Marshal.PtrToStructure(itnBuffer, typeof(SPPHRASEREPLACEMENT)); + SPPHRASEREPLACEMENT replacement = (SPPHRASEREPLACEMENT)Marshal.PtrToStructure(itnBuffer); string text = Marshal.PtrToStringUni(new IntPtr((long)buffer + replacement.pszReplacementText)); DisplayAttributes displayAttributes = RecognizedWordUnit.SapiAttributesToDisplayAttributes(replacement.bDisplayAttributes); _replacementText.Add(new ReplacementText(displayAttributes, text, (int)replacement.ulFirstElement, (int)replacement.ulCountOfElements)); @@ -325,11 +325,11 @@ internal static SPSERIALIZEDPHRASE GetPhraseHeader(IntPtr phraseBuffer, uint exp if (isSapi53Header) { - serializedPhrase = (SPSERIALIZEDPHRASE)Marshal.PtrToStructure(phraseBuffer, typeof(SPSERIALIZEDPHRASE)); + serializedPhrase = Marshal.PtrToStructure(phraseBuffer); } else { - SPSERIALIZEDPHRASE_Sapi51 legacyPhrase = (SPSERIALIZEDPHRASE_Sapi51)Marshal.PtrToStructure(phraseBuffer, typeof(SPSERIALIZEDPHRASE_Sapi51)); + SPSERIALIZEDPHRASE_Sapi51 legacyPhrase = Marshal.PtrToStructure(phraseBuffer); serializedPhrase = new SPSERIALIZEDPHRASE(legacyPhrase); } @@ -539,7 +539,7 @@ private static SemanticValue RecursiveBuildSemanticProperties(IList propertyList, int semanticsOffset, IntPtr phraseBuffer, RuleNode ruleTree, IList words, bool isSapi53Header) { IntPtr propertyBuffer = new((long)phraseBuffer + semanticsOffset); - SPSERIALIZEDPHRASEPROPERTY property = (SPSERIALIZEDPHRASEPROPERTY)Marshal.PtrToStructure(propertyBuffer, typeof(SPSERIALIZEDPHRASEPROPERTY)); + SPSERIALIZEDPHRASEPROPERTY property = Marshal.PtrToStructure(propertyBuffer); string propertyName; SemanticValue thisSemanticValue = ExtractSemanticValueInformation(semanticsOffset, property, phraseBuffer, isSapi53Header, out propertyName); @@ -572,7 +572,7 @@ private void RecursivelyExtractSemanticValue(IntPtr phraseBuffer, int semanticsO { IntPtr propertyBuffer = new((long)phraseBuffer + semanticsOffset); SPSERIALIZEDPHRASEPROPERTY property = - (SPSERIALIZEDPHRASEPROPERTY)Marshal.PtrToStructure(propertyBuffer, typeof(SPSERIALIZEDPHRASEPROPERTY)); + Marshal.PtrToStructure(propertyBuffer); string propertyName; SemanticValue thisSemanticValue = ExtractSemanticValueInformation(semanticsOffset, property, phraseBuffer, isSapi53Header, out propertyName); @@ -695,7 +695,7 @@ private static SemanticValue ExtractSemanticValueInformation(int semanticsOffset break; case VarEnum.VT_UI4: - propertyValue = Marshal.PtrToStructure(valueBuffer, typeof(uint)); + propertyValue = Marshal.PtrToStructure(valueBuffer); break; case VarEnum.VT_I8: @@ -703,15 +703,15 @@ private static SemanticValue ExtractSemanticValueInformation(int semanticsOffset break; case VarEnum.VT_UI8: - propertyValue = Marshal.PtrToStructure(valueBuffer, typeof(ulong)); + propertyValue = Marshal.PtrToStructure(valueBuffer); break; case VarEnum.VT_R4: - propertyValue = Marshal.PtrToStructure(valueBuffer, typeof(float)); + propertyValue = Marshal.PtrToStructure(valueBuffer); break; case VarEnum.VT_R8: - propertyValue = Marshal.PtrToStructure(valueBuffer, typeof(double)); + propertyValue = Marshal.PtrToStructure(valueBuffer); break; case VarEnum.VT_BOOL: @@ -754,7 +754,7 @@ private static RuleNode ExtractRules(Grammar grammar, SPSERIALIZEDPHRASERULE rul if (rule.NextSiblingOffset > 0) { IntPtr elementBuffer = new((long)phraseBuffer + rule.NextSiblingOffset); - SPSERIALIZEDPHRASERULE ruleNext = (SPSERIALIZEDPHRASERULE)Marshal.PtrToStructure(elementBuffer, typeof(SPSERIALIZEDPHRASERULE)); + SPSERIALIZEDPHRASERULE ruleNext = Marshal.PtrToStructure(elementBuffer); node._next = ExtractRules(grammar, ruleNext, phraseBuffer); } @@ -762,7 +762,7 @@ private static RuleNode ExtractRules(Grammar grammar, SPSERIALIZEDPHRASERULE rul if (rule.FirstChildOffset > 0) { IntPtr elementBuffer = new((long)phraseBuffer + rule.FirstChildOffset); - SPSERIALIZEDPHRASERULE ruleFirst = (SPSERIALIZEDPHRASERULE)Marshal.PtrToStructure(elementBuffer, typeof(SPSERIALIZEDPHRASERULE)); + SPSERIALIZEDPHRASERULE ruleFirst = Marshal.PtrToStructure(elementBuffer); node._child = ExtractRules(grammar, ruleFirst, phraseBuffer); } @@ -781,7 +781,7 @@ private void ThrowInvalidSemanticInterpretationError() { IntPtr smlBuffer = gc.AddrOfPinnedObject(); - SPSEMANTICERRORINFO semanticError = (SPSEMANTICERRORINFO)Marshal.PtrToStructure((IntPtr)((long)smlBuffer + (int)_serializedPhrase.SemanticErrorInfoOffset), typeof(SPSEMANTICERRORINFO)); + SPSEMANTICERRORINFO semanticError = Marshal.PtrToStructure((IntPtr)((long)smlBuffer + (int)_serializedPhrase.SemanticErrorInfoOffset)); string source = Marshal.PtrToStringUni(new IntPtr((long)smlBuffer + semanticError.pszSourceOffset)); string description = Marshal.PtrToStringUni(new IntPtr((long)smlBuffer + semanticError.pszDescriptionOffset)); diff --git a/src/libraries/System.Speech/src/System.Speech.csproj b/src/libraries/System.Speech/src/System.Speech.csproj index 0a72d5a24dbf7f..660dae30037667 100644 --- a/src/libraries/System.Speech/src/System.Speech.csproj +++ b/src/libraries/System.Speech/src/System.Speech.csproj @@ -4,7 +4,9 @@ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum);netstandard2.0 - $(NoWarn);CS0649;SA1129;CA1847 + + $(NoWarn);CS0649;SA1129;CA1846;CA1847 + annotations false true true @@ -118,7 +120,6 @@ System.Speech.Recognition.SpeechRecognizer - @@ -197,6 +198,28 @@ System.Speech.Recognition.SpeechRecognizer + + + + + + + + + + + @@ -237,6 +260,7 @@ System.Speech.Recognition.SpeechRecognizer + @@ -244,7 +268,7 @@ System.Speech.Recognition.SpeechRecognizer - + diff --git a/src/libraries/System.Text.Json/System.Text.Json.sln b/src/libraries/System.Text.Json/System.Text.Json.sln index 425af9cef5db57..d26ec6ccd9d5cc 100644 --- a/src/libraries/System.Text.Json/System.Text.Json.sln +++ b/src/libraries/System.Text.Json/System.Text.Json.sln @@ -21,9 +21,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Text.Encodings.Web", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Text.Encodings.Web", "..\System.Text.Encodings.Web\src\System.Text.Encodings.Web.csproj", "{9BCCDA15-8907-4AE3-8871-2F17775DDE4C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Text.Json.SourceGeneration", "gen\System.Text.Json.SourceGeneration.Roslyn3.11.csproj", "{04AEB008-EE4F-44DE-A361-2DBD2D0FD6A4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Text.Json.SourceGeneration.Roslyn3.11", "gen\System.Text.Json.SourceGeneration.Roslyn3.11.csproj", "{04AEB008-EE4F-44DE-A361-2DBD2D0FD6A4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Text.Json.SourceGeneration", "gen\System.Text.Json.SourceGeneration.Roslyn4.0.csproj", "{6485EED4-C313-4551-9865-8ADCED603629}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Text.Json.SourceGeneration.Roslyn4.0", "gen\System.Text.Json.SourceGeneration.Roslyn4.0.csproj", "{6485EED4-C313-4551-9865-8ADCED603629}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Text.Json", "ref\System.Text.Json.csproj", "{7015E94D-D20D-48C8-86D7-6A996BE99E0E}" EndProject diff --git a/src/libraries/System.Text.Json/gen/ContextGenerationSpec.cs b/src/libraries/System.Text.Json/gen/ContextGenerationSpec.cs index 13e9c7437391dd..b88bd918672004 100644 --- a/src/libraries/System.Text.Json/gen/ContextGenerationSpec.cs +++ b/src/libraries/System.Text.Json/gen/ContextGenerationSpec.cs @@ -5,6 +5,7 @@ using System.Text.Json.Serialization; using System.Text.Json.Reflection; using System.Diagnostics; +using Microsoft.CodeAnalysis; namespace System.Text.Json.SourceGeneration { @@ -15,6 +16,8 @@ namespace System.Text.Json.SourceGeneration [DebuggerDisplay("ContextTypeRef={ContextTypeRef}")] internal sealed class ContextGenerationSpec { + public Location Location { get; init; } + public JsonSourceGenerationOptionsAttribute GenerationOptions { get; init; } public Type ContextType { get; init; } diff --git a/src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs b/src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs index ec6124a8222be1..087f3e2dc4095c 100644 --- a/src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs +++ b/src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs @@ -274,8 +274,9 @@ private void GenerateTypeInfo(TypeGenerationSpec typeGenerationSpec) break; case ClassType.TypeUnsupportedBySourceGen: { + Location location = typeGenerationSpec.Type.GetDiagnosticLocation() ?? typeGenerationSpec.AttributeLocation ?? _currentContext.Location; _sourceGenerationContext.ReportDiagnostic( - Diagnostic.Create(TypeNotSupported, Location.None, new string[] { typeGenerationSpec.TypeRef })); + Diagnostic.Create(TypeNotSupported, location, new string[] { typeGenerationSpec.TypeRef })); return; } default: @@ -293,7 +294,8 @@ private void GenerateTypeInfo(TypeGenerationSpec typeGenerationSpec) } else { - _sourceGenerationContext.ReportDiagnostic(Diagnostic.Create(DuplicateTypeName, Location.None, new string[] { typeGenerationSpec.TypeInfoPropertyName })); + Location location = typeGenerationSpec.AttributeLocation ?? _currentContext.Location; + _sourceGenerationContext.ReportDiagnostic(Diagnostic.Create(DuplicateTypeName, location, new string[] { typeGenerationSpec.TypeInfoPropertyName })); } } diff --git a/src/libraries/System.Text.Json/gen/JsonSourceGenerator.Parser.cs b/src/libraries/System.Text.Json/gen/JsonSourceGenerator.Parser.cs index 2785e66c7cd3a3..d1e023b6f4e2b1 100644 --- a/src/libraries/System.Text.Json/gen/JsonSourceGenerator.Parser.cs +++ b/src/libraries/System.Text.Json/gen/JsonSourceGenerator.Parser.cs @@ -80,6 +80,7 @@ private sealed class Parser private readonly Type _objectType; private readonly Type _stringType; + private readonly Type? _timeSpanType; private readonly Type? _dateTimeOffsetType; private readonly Type? _byteArrayType; private readonly Type? _guidType; @@ -116,6 +117,14 @@ private sealed class Parser private readonly HashSet _implicitlyRegisteredTypes = new(); + /// + /// A list of diagnostics emitted at the type level. This is cached and emitted between the processing of context types + /// in order to properly retrieve [JsonSerializable] attribute applications for top-level types (since a type might occur + /// both at top-level and in nested object graphs, with no guarantee of the order that we will see the type). + /// The element tuple types specifies the serializable type, the kind of diagnostic to emit, and the diagnostic message. + /// + private readonly List<(Type, DiagnosticDescriptor, string[])> _typeLevelDiagnostics = new(); + private JsonKnownNamingPolicy _currentContextNamingPolicy; private static DiagnosticDescriptor ContextClassesMustBePartial { get; } = new DiagnosticDescriptor( @@ -194,6 +203,7 @@ public Parser(Compilation compilation, in JsonSourceGenerationContext sourceGene _booleanType = _metadataLoadContext.Resolve(SpecialType.System_Boolean); _charType = _metadataLoadContext.Resolve(SpecialType.System_Char); + _timeSpanType = _metadataLoadContext.Resolve(typeof(TimeSpan)); _dateTimeType = _metadataLoadContext.Resolve(SpecialType.System_DateTime); _nullableOfTType = _metadataLoadContext.Resolve(SpecialType.System_Nullable_T); _objectType = _metadataLoadContext.Resolve(SpecialType.System_Object); @@ -244,6 +254,11 @@ public Parser(Compilation compilation, in JsonSourceGenerationContext sourceGene foreach (ClassDeclarationSyntax classDeclarationSyntax in classDeclarationSyntaxList) { + // Ensure context-scoped metadata caches are empty. + Debug.Assert(_typeGenerationSpecCache.Count == 0); + Debug.Assert(_implicitlyRegisteredTypes.Count == 0); + Debug.Assert(_typeLevelDiagnostics.Count == 0); + CompilationUnitSyntax compilationUnitSyntax = classDeclarationSyntax.FirstAncestorOrSelf(); SemanticModel compilationSemanticModel = compilation.GetSemanticModel(compilationUnitSyntax.SyntaxTree); @@ -285,15 +300,18 @@ public Parser(Compilation compilation, in JsonSourceGenerationContext sourceGene INamedTypeSymbol contextTypeSymbol = (INamedTypeSymbol)compilationSemanticModel.GetDeclaredSymbol(classDeclarationSyntax); Debug.Assert(contextTypeSymbol != null); + Location contextLocation = contextTypeSymbol.Locations.Length > 0 ? contextTypeSymbol.Locations[0] : Location.None; + if (!TryGetClassDeclarationList(contextTypeSymbol, out List classDeclarationList)) { // Class or one of its containing types is not partial so we can't add to it. - _sourceGenerationContext.ReportDiagnostic(Diagnostic.Create(ContextClassesMustBePartial, Location.None, new string[] { contextTypeSymbol.Name })); + _sourceGenerationContext.ReportDiagnostic(Diagnostic.Create(ContextClassesMustBePartial, contextLocation, new string[] { contextTypeSymbol.Name })); continue; } ContextGenerationSpec contextGenSpec = new() { + Location = contextLocation, GenerationOptions = options ?? new JsonSourceGenerationOptionsAttribute(), ContextType = contextTypeSymbol.AsType(_metadataLoadContext), ContextClassDeclarationList = classDeclarationList @@ -316,14 +334,31 @@ public Parser(Compilation compilation, in JsonSourceGenerationContext sourceGene continue; } + // Emit type-level diagnostics + foreach ((Type Type, DiagnosticDescriptor Descriptor, string[] MessageArgs) diagnostic in _typeLevelDiagnostics) + { + Type type = diagnostic.Type; + Location location = type.GetDiagnosticLocation(); + + if (location == null) + { + TypeGenerationSpec spec = _typeGenerationSpecCache[type]; + location = spec.AttributeLocation; + } + + location ??= contextLocation; + _sourceGenerationContext.ReportDiagnostic(Diagnostic.Create(diagnostic.Descriptor, location, diagnostic.MessageArgs)); + } + contextGenSpec.ImplicitlyRegisteredTypes.UnionWith(_implicitlyRegisteredTypes); contextGenSpecList ??= new List(); contextGenSpecList.Add(contextGenSpec); - // Clear the cache of generated metadata between the processing of context classes. + // Clear the caches of generated metadata between the processing of context classes. _typeGenerationSpecCache.Clear(); _implicitlyRegisteredTypes.Clear(); + _typeLevelDiagnostics.Clear(); } if (contextGenSpecList == null) @@ -487,6 +522,8 @@ private static bool TryGetClassDeclarationList(INamedTypeSymbol typeSymbol, [Not typeGenerationSpec.GenerationMode = generationMode; } + typeGenerationSpec.AttributeLocation = attributeSyntax.GetLocation(); + return typeGenerationSpec; } @@ -877,7 +914,7 @@ private TypeGenerationSpec GetOrAddTypeGenerationSpec(Type type, JsonSourceGener if (!type.TryGetDeserializationConstructor(useDefaultCtorInAnnotatedStructs, out ConstructorInfo? constructor)) { classType = ClassType.TypeUnsupportedBySourceGen; - _sourceGenerationContext.ReportDiagnostic(Diagnostic.Create(MultipleJsonConstructorAttribute, Location.None, new string[] { $"{type}" })); + _typeLevelDiagnostics.Add((type, MultipleJsonConstructorAttribute, new string[] { $"{type}" })); } else { @@ -944,7 +981,7 @@ private TypeGenerationSpec GetOrAddTypeGenerationSpec(Type type, JsonSourceGener } spec = GetPropertyGenerationSpec(propertyInfo, isVirtual, generationMode); - CacheMemberHelper(); + CacheMemberHelper(propertyInfo.GetDiagnosticLocation()); } foreach (FieldInfo fieldInfo in currentType.GetFields(bindingFlags)) @@ -955,10 +992,10 @@ private TypeGenerationSpec GetOrAddTypeGenerationSpec(Type type, JsonSourceGener } spec = GetPropertyGenerationSpec(fieldInfo, isVirtual: false, generationMode); - CacheMemberHelper(); + CacheMemberHelper(fieldInfo.GetDiagnosticLocation()); } - void CacheMemberHelper() + void CacheMemberHelper(Location memberLocation) { CacheMember(spec, ref propGenSpecList, ref ignoredMembers); @@ -972,13 +1009,13 @@ void CacheMemberHelper() { if (dataExtensionPropGenSpec != null) { - _sourceGenerationContext.ReportDiagnostic(Diagnostic.Create(MultipleJsonExtensionDataAttribute, Location.None, new string[] { type.Name })); + _typeLevelDiagnostics.Add((type, MultipleJsonExtensionDataAttribute, new string[] { type.Name })); } Type propType = spec.TypeGenerationSpec.Type; if (!IsValidDataExtensionPropertyType(propType)) { - _sourceGenerationContext.ReportDiagnostic(Diagnostic.Create(DataExtensionPropertyInvalid, Location.None, new string[] { type.Name, spec.ClrName })); + _sourceGenerationContext.ReportDiagnostic(Diagnostic.Create(DataExtensionPropertyInvalid, memberLocation, new string[] { type.Name, spec.ClrName })); } dataExtensionPropGenSpec = GetOrAddTypeGenerationSpec(propType, generationMode); @@ -987,13 +1024,13 @@ void CacheMemberHelper() if (!hasInitOnlyProperties && spec.CanUseSetter && spec.IsInitOnlySetter) { - _sourceGenerationContext.ReportDiagnostic(Diagnostic.Create(InitOnlyPropertyDeserializationNotSupported, Location.None, new string[] { type.Name })); + _sourceGenerationContext.ReportDiagnostic(Diagnostic.Create(InitOnlyPropertyDeserializationNotSupported, memberLocation, new string[] { type.Name })); hasInitOnlyProperties = true; } if (spec.HasJsonInclude && (!spec.CanUseGetter || !spec.CanUseSetter || !spec.IsPublic)) { - _sourceGenerationContext.ReportDiagnostic(Diagnostic.Create(InaccessibleJsonIncludePropertiesNotSupported, Location.None, new string[] { type.Name, spec.ClrName })); + _sourceGenerationContext.ReportDiagnostic(Diagnostic.Create(InaccessibleJsonIncludePropertiesNotSupported, memberLocation, new string[] { type.Name, spec.ClrName })); } } } @@ -1471,6 +1508,7 @@ private void PopulateKnownTypes() _knownTypes.Add(_stringType); AddTypeIfNotNull(_knownTypes, _byteArrayType); + AddTypeIfNotNull(_knownTypes, _timeSpanType); AddTypeIfNotNull(_knownTypes, _dateTimeOffsetType); AddTypeIfNotNull(_knownTypes, _guidType); AddTypeIfNotNull(_knownTypes, _uriType); diff --git a/src/libraries/System.Text.Json/gen/Reflection/FieldInfoWrapper.cs b/src/libraries/System.Text.Json/gen/Reflection/FieldInfoWrapper.cs index 66e00c0de20bb7..d06c264ab04563 100644 --- a/src/libraries/System.Text.Json/gen/Reflection/FieldInfoWrapper.cs +++ b/src/libraries/System.Text.Json/gen/Reflection/FieldInfoWrapper.cs @@ -100,5 +100,7 @@ public override void SetValue(object obj, object value, BindingFlags invokeAttr, { throw new NotImplementedException(); } + + public Location? Location => _field.Locations.Length > 0 ? _field.Locations[0] : null; } } diff --git a/src/libraries/System.Text.Json/gen/Reflection/PropertyInfoWrapper.cs b/src/libraries/System.Text.Json/gen/Reflection/PropertyInfoWrapper.cs index bfb593f992fbd0..d7eea3323416ba 100644 --- a/src/libraries/System.Text.Json/gen/Reflection/PropertyInfoWrapper.cs +++ b/src/libraries/System.Text.Json/gen/Reflection/PropertyInfoWrapper.cs @@ -92,5 +92,7 @@ public override void SetValue(object obj, object value, BindingFlags invokeAttr, { throw new NotSupportedException(); } + + public Location? Location => _property.Locations.Length > 0 ? _property.Locations[0] : null; } } diff --git a/src/libraries/System.Text.Json/gen/Reflection/ReflectionExtensions.cs b/src/libraries/System.Text.Json/gen/Reflection/ReflectionExtensions.cs index 101f3e48fbfb7e..d0bc8e59b147c2 100644 --- a/src/libraries/System.Text.Json/gen/Reflection/ReflectionExtensions.cs +++ b/src/libraries/System.Text.Json/gen/Reflection/ReflectionExtensions.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using System.Linq; using System.Reflection; +using Microsoft.CodeAnalysis; namespace System.Text.Json.Reflection { @@ -45,5 +46,23 @@ private static bool HasJsonConstructorAttribute(ConstructorInfo constructorInfo) return false; } + + public static Location? GetDiagnosticLocation(this Type type) + { + Debug.Assert(type is TypeWrapper); + return ((TypeWrapper)type).Location; + } + + public static Location? GetDiagnosticLocation(this PropertyInfo propertyInfo) + { + Debug.Assert(propertyInfo is PropertyInfoWrapper); + return ((PropertyInfoWrapper)propertyInfo).Location; + } + + public static Location? GetDiagnosticLocation(this FieldInfo fieldInfo) + { + Debug.Assert(fieldInfo is FieldInfoWrapper); + return ((FieldInfoWrapper)fieldInfo).Location; + } } } diff --git a/src/libraries/System.Text.Json/gen/Reflection/TypeWrapper.cs b/src/libraries/System.Text.Json/gen/Reflection/TypeWrapper.cs index 5d4d778bc6348d..2d06d9ec50cd96 100644 --- a/src/libraries/System.Text.Json/gen/Reflection/TypeWrapper.cs +++ b/src/libraries/System.Text.Json/gen/Reflection/TypeWrapper.cs @@ -600,5 +600,7 @@ public override bool Equals(Type o) } return base.Equals(o); } + + public Location? Location => _typeSymbol.Locations.Length > 0 ? _typeSymbol.Locations[0] : null; } } diff --git a/src/libraries/System.Text.Json/gen/TypeGenerationSpec.cs b/src/libraries/System.Text.Json/gen/TypeGenerationSpec.cs index a85bdd05b914cb..39fcd9827b38ed 100644 --- a/src/libraries/System.Text.Json/gen/TypeGenerationSpec.cs +++ b/src/libraries/System.Text.Json/gen/TypeGenerationSpec.cs @@ -7,6 +7,7 @@ using System.Reflection; using System.Text.Json.Reflection; using System.Text.Json.Serialization; +using Microsoft.CodeAnalysis; namespace System.Text.Json.SourceGeneration { @@ -18,6 +19,11 @@ internal class TypeGenerationSpec /// public string TypeRef { get; private set; } + /// + /// If specified as a root type via JsonSerializableAttribute, specifies the location of the attribute application. + /// + public Location? AttributeLocation { get; set; } + /// /// The name of the public JsonTypeInfo<T> property for this type on the generated context class. /// For example, if the context class is named MyJsonContext, and the value of this property is JsonMessage; diff --git a/src/libraries/System.Text.Json/ref/System.Text.Json.cs b/src/libraries/System.Text.Json/ref/System.Text.Json.cs index 0080e269aafbe1..f6b25cdcb23d41 100644 --- a/src/libraries/System.Text.Json/ref/System.Text.Json.cs +++ b/src/libraries/System.Text.Json/ref/System.Text.Json.cs @@ -303,6 +303,7 @@ public JsonSerializerOptions(System.Text.Json.JsonSerializerDefaults defaults) { public JsonSerializerOptions(System.Text.Json.JsonSerializerOptions options) { } public bool AllowTrailingCommas { get { throw null; } set { } } public System.Collections.Generic.IList Converters { get { throw null; } } + public static System.Text.Json.JsonSerializerOptions Default { get { throw null; } } public int DefaultBufferSize { get { throw null; } set { } } public System.Text.Json.Serialization.JsonIgnoreCondition DefaultIgnoreCondition { get { throw null; } set { } } public System.Text.Json.JsonNamingPolicy? DictionaryKeyPolicy { get { throw null; } set { } } @@ -357,6 +358,7 @@ public partial struct JsonWriterOptions private int _dummyPrimitive; public System.Text.Encodings.Web.JavaScriptEncoder? Encoder { readonly get { throw null; } set { } } public bool Indented { get { throw null; } set { } } + public int MaxDepth { readonly get { throw null; } set { } } public bool SkipValidation { get { throw null; } set { } } } public ref partial struct Utf8JsonReader diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocument.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocument.cs index 59f944e51534a6..33f4f33b46c510 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocument.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocument.cs @@ -1107,7 +1107,7 @@ private void CheckExpectedType(JsonTokenType expected, JsonTokenType actual) { if (expected != actual) { - throw ThrowHelper.GetJsonElementWrongTypeException(expected, actual); + ThrowHelper.ThrowJsonElementWrongTypeException(expected, actual); } } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocumentOptions.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocumentOptions.cs index b091a30012120c..df1289c295d3b9 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocumentOptions.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocumentOptions.cs @@ -52,7 +52,9 @@ public int MaxDepth set { if (value < 0) - throw ThrowHelper.GetArgumentOutOfRangeException_MaxDepthMustBePositive(nameof(value)); + { + ThrowHelper.ThrowArgumentOutOfRangeException_MaxDepthMustBePositive(nameof(value)); + } _maxDepth = value; } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonElement.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonElement.cs index 5f30dd6d3dd8b1..63963db4b5fd1a 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonElement.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonElement.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; namespace System.Text.Json { @@ -333,7 +334,12 @@ public bool GetBoolean() return type == JsonTokenType.True ? true : type == JsonTokenType.False ? false : - throw ThrowHelper.GetJsonElementWrongTypeException(nameof(Boolean), type); + ThrowJsonElementWrongTypeException(type); + + static bool ThrowJsonElementWrongTypeException(JsonTokenType actualType) + { + throw ThrowHelper.GetJsonElementWrongTypeException(nameof(Boolean), actualType.ToValueKind()); + } } /// @@ -400,12 +406,12 @@ public bool TryGetBytesFromBase64([NotNullWhen(true)] out byte[]? value) /// public byte[] GetBytesFromBase64() { - if (TryGetBytesFromBase64(out byte[]? value)) + if (!TryGetBytesFromBase64(out byte[]? value)) { - return value; + ThrowHelper.ThrowFormatException(); } - throw ThrowHelper.GetFormatException(); + return value; } /// @@ -645,12 +651,12 @@ public bool TryGetInt32(out int value) /// public int GetInt32() { - if (TryGetInt32(out int value)) + if (!TryGetInt32(out int value)) { - return value; + ThrowHelper.ThrowFormatException(); } - throw ThrowHelper.GetFormatException(); + return value; } /// @@ -697,12 +703,12 @@ public bool TryGetUInt32(out uint value) [CLSCompliant(false)] public uint GetUInt32() { - if (TryGetUInt32(out uint value)) + if (!TryGetUInt32(out uint value)) { - return value; + ThrowHelper.ThrowFormatException(); } - throw ThrowHelper.GetFormatException(); + return value; } /// @@ -747,12 +753,12 @@ public bool TryGetInt64(out long value) /// public long GetInt64() { - if (TryGetInt64(out long value)) + if (!TryGetInt64(out long value)) { - return value; + ThrowHelper.ThrowFormatException(); } - throw ThrowHelper.GetFormatException(); + return value; } /// @@ -799,12 +805,12 @@ public bool TryGetUInt64(out ulong value) [CLSCompliant(false)] public ulong GetUInt64() { - if (TryGetUInt64(out ulong value)) + if (!TryGetUInt64(out ulong value)) { - return value; + ThrowHelper.ThrowFormatException(); } - throw ThrowHelper.GetFormatException(); + return value; } /// @@ -866,12 +872,12 @@ public bool TryGetDouble(out double value) /// public double GetDouble() { - if (TryGetDouble(out double value)) + if (!TryGetDouble(out double value)) { - return value; + ThrowHelper.ThrowFormatException(); } - throw ThrowHelper.GetFormatException(); + return value; } /// @@ -933,12 +939,12 @@ public bool TryGetSingle(out float value) /// public float GetSingle() { - if (TryGetSingle(out float value)) + if (!TryGetSingle(out float value)) { - return value; + ThrowHelper.ThrowFormatException(); } - throw ThrowHelper.GetFormatException(); + return value; } /// @@ -985,12 +991,12 @@ public bool TryGetDecimal(out decimal value) /// public decimal GetDecimal() { - if (TryGetDecimal(out decimal value)) + if (!TryGetDecimal(out decimal value)) { - return value; + ThrowHelper.ThrowFormatException(); } - throw ThrowHelper.GetFormatException(); + return value; } /// @@ -1036,12 +1042,12 @@ public bool TryGetDateTime(out DateTime value) /// public DateTime GetDateTime() { - if (TryGetDateTime(out DateTime value)) + if (!TryGetDateTime(out DateTime value)) { - return value; + ThrowHelper.ThrowFormatException(); } - throw ThrowHelper.GetFormatException(); + return value; } /// @@ -1087,12 +1093,12 @@ public bool TryGetDateTimeOffset(out DateTimeOffset value) /// public DateTimeOffset GetDateTimeOffset() { - if (TryGetDateTimeOffset(out DateTimeOffset value)) + if (!TryGetDateTimeOffset(out DateTimeOffset value)) { - return value; + ThrowHelper.ThrowFormatException(); } - throw ThrowHelper.GetFormatException(); + return value; } /// @@ -1138,12 +1144,12 @@ public bool TryGetGuid(out Guid value) /// public Guid GetGuid() { - if (TryGetGuid(out Guid value)) + if (!TryGetGuid(out Guid value)) { - return value; + ThrowHelper.ThrowFormatException(); } - throw ThrowHelper.GetFormatException(); + return value; } internal string GetPropertyName() @@ -1326,7 +1332,7 @@ public ArrayEnumerator EnumerateArray() if (tokenType != JsonTokenType.StartArray) { - throw ThrowHelper.GetJsonElementWrongTypeException(JsonTokenType.StartArray, tokenType); + ThrowHelper.ThrowJsonElementWrongTypeException(JsonTokenType.StartArray, tokenType); } return new ArrayEnumerator(this); @@ -1352,7 +1358,7 @@ public ObjectEnumerator EnumerateObject() if (tokenType != JsonTokenType.StartObject) { - throw ThrowHelper.GetJsonElementWrongTypeException(JsonTokenType.StartObject, tokenType); + ThrowHelper.ThrowJsonElementWrongTypeException(JsonTokenType.StartObject, tokenType); } return new ObjectEnumerator(this); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/JsonConstants.cs b/src/libraries/System.Text.Json/src/System/Text/Json/JsonConstants.cs index f004e8d5d83474..bed577622f5faa 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/JsonConstants.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/JsonConstants.cs @@ -48,7 +48,6 @@ internal static partial class JsonConstants public static ReadOnlySpan EscapableChars => new byte[] { Quote, (byte)'n', (byte)'r', (byte)'t', Slash, (byte)'u', (byte)'b', (byte)'f' }; public const int SpacesPerIndent = 2; - public const int MaxWriterDepth = 1_000; public const int RemoveFlagsBitMask = 0x7FFFFFFF; public const int StackallocByteThreshold = 256; diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/JsonPropertyDictionary.KeyCollection.cs b/src/libraries/System.Text.Json/src/System/Text/Json/JsonPropertyDictionary.KeyCollection.cs index 57c2bf331e8b86..a0e9edb109bfb6 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/JsonPropertyDictionary.KeyCollection.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/JsonPropertyDictionary.KeyCollection.cs @@ -36,9 +36,9 @@ IEnumerator IEnumerable.GetEnumerator() } } - public void Add(string propertyName) => throw ThrowHelper.NotSupportedException_NodeCollectionIsReadOnly(); + public void Add(string propertyName) => ThrowHelper.ThrowNotSupportedException_NodeCollectionIsReadOnly(); - public void Clear() => throw ThrowHelper.NotSupportedException_NodeCollectionIsReadOnly(); + public void Clear() => ThrowHelper.ThrowNotSupportedException_NodeCollectionIsReadOnly(); public bool Contains(string propertyName) => _parent.ContainsProperty(propertyName); @@ -68,7 +68,7 @@ public IEnumerator GetEnumerator() } } - bool ICollection.Remove(string propertyName) => throw ThrowHelper.NotSupportedException_NodeCollectionIsReadOnly(); + bool ICollection.Remove(string propertyName) => throw ThrowHelper.GetNotSupportedException_NodeCollectionIsReadOnly(); } } } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/JsonPropertyDictionary.ValueCollection.cs b/src/libraries/System.Text.Json/src/System/Text/Json/JsonPropertyDictionary.ValueCollection.cs index a441986688c70d..c907454d800e6d 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/JsonPropertyDictionary.ValueCollection.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/JsonPropertyDictionary.ValueCollection.cs @@ -36,9 +36,9 @@ IEnumerator IEnumerable.GetEnumerator() } } - public void Add(T? jsonNode) => throw ThrowHelper.NotSupportedException_NodeCollectionIsReadOnly(); + public void Add(T? jsonNode) => ThrowHelper.ThrowNotSupportedException_NodeCollectionIsReadOnly(); - public void Clear() => throw ThrowHelper.NotSupportedException_NodeCollectionIsReadOnly(); + public void Clear() => ThrowHelper.ThrowNotSupportedException_NodeCollectionIsReadOnly(); public bool Contains(T? jsonNode) => _parent.ContainsValue(jsonNode); @@ -68,7 +68,7 @@ public void CopyTo(T?[] nodeArray, int index) } } - bool ICollection.Remove(T? node) => throw ThrowHelper.NotSupportedException_NodeCollectionIsReadOnly(); + bool ICollection.Remove(T? node) => throw ThrowHelper.GetNotSupportedException_NodeCollectionIsReadOnly(); } } } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonArray.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonArray.cs index 75db08ac87a8db..c420a7eec5f371 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonArray.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonArray.cs @@ -168,7 +168,7 @@ public override void WriteTo(Utf8JsonWriter writer, JsonSerializerOptions? optio CreateNodes(); Debug.Assert(_list != null); - options ??= JsonSerializerOptions.s_defaultOptions; + options ??= JsonSerializerOptions.Default; writer.WriteStartArray(); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonObject.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonObject.cs index 2ef7853910f645..13ea3fcba4436e 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonObject.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonObject.cs @@ -96,7 +96,7 @@ public override void WriteTo(Utf8JsonWriter writer, JsonSerializerOptions? optio } else { - options ??= JsonSerializerOptions.s_defaultOptions; + options ??= JsonSerializerOptions.Default; writer.WriteStartObject(); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonValueTrimmable.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonValueTrimmable.cs index 47652c49cc6d44..35d010afd18bd2 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonValueTrimmable.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonValueTrimmable.cs @@ -34,7 +34,7 @@ public override void WriteTo(Utf8JsonWriter writer, JsonSerializerOptions? optio if (_converter != null) { - options ??= JsonSerializerOptions.s_defaultOptions; + options ??= JsonSerializerOptions.Default; if (_converter.IsInternalConverterForNumberType) { diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Reader/JsonReaderOptions.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Reader/JsonReaderOptions.cs index 2d29fc328af839..5cc83c995b18cc 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Reader/JsonReaderOptions.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Reader/JsonReaderOptions.cs @@ -31,7 +31,9 @@ public JsonCommentHandling CommentHandling { Debug.Assert(value >= 0); if (value > JsonCommentHandling.Allow) - throw ThrowHelper.GetArgumentOutOfRangeException_CommentEnumMustBeInRange(nameof(value)); + { + ThrowHelper.ThrowArgumentOutOfRangeException_CommentEnumMustBeInRange(nameof(value)); + } _commentHandling = value; } @@ -52,7 +54,9 @@ public int MaxDepth set { if (value < 0) - throw ThrowHelper.GetArgumentOutOfRangeException_MaxDepthMustBePositive(nameof(value)); + { + ThrowHelper.ThrowArgumentOutOfRangeException_MaxDepthMustBePositive(nameof(value)); + } _maxDepth = value; } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.TryGet.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.TryGet.cs index b65653ee715279..cee0eee7398598 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.TryGet.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.TryGet.cs @@ -33,7 +33,7 @@ public ref partial struct Utf8JsonReader if (TokenType != JsonTokenType.String && TokenType != JsonTokenType.PropertyName) { - throw ThrowHelper.GetInvalidOperationException_ExpectedString(TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedString(TokenType); } ReadOnlySpan span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; @@ -60,7 +60,7 @@ public string GetComment() { if (TokenType != JsonTokenType.Comment) { - throw ThrowHelper.GetInvalidOperationException_ExpectedComment(TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedComment(TokenType); } ReadOnlySpan span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; return JsonReaderHelper.TranscodeHelper(span); @@ -76,22 +76,20 @@ public string GetComment() /// public bool GetBoolean() { - ReadOnlySpan span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; - - if (TokenType == JsonTokenType.True) + JsonTokenType type = TokenType; + if (type == JsonTokenType.True) { - Debug.Assert(span.Length == 4); + Debug.Assert((HasValueSequence ? ValueSequence.ToArray() : ValueSpan).Length == 4); return true; } - else if (TokenType == JsonTokenType.False) - { - Debug.Assert(span.Length == 5); - return false; - } - else + else if (type != JsonTokenType.False) { - throw ThrowHelper.GetInvalidOperationException_ExpectedBoolean(TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedBoolean(TokenType); + Debug.Fail("Throw helper should have thrown an exception."); } + + Debug.Assert((HasValueSequence ? ValueSequence.ToArray() : ValueSpan).Length == 5); + return false; } /// @@ -109,7 +107,7 @@ public byte[] GetBytesFromBase64() { if (!TryGetBytesFromBase64(out byte[]? value)) { - throw ThrowHelper.GetFormatException(DataType.Base64String); + ThrowHelper.ThrowFormatException(DataType.Base64String); } return value; } @@ -133,7 +131,7 @@ public byte GetByte() { if (!TryGetByte(out byte value)) { - throw ThrowHelper.GetFormatException(NumericType.Byte); + ThrowHelper.ThrowFormatException(NumericType.Byte); } return value; } @@ -143,7 +141,7 @@ internal byte GetByteWithQuotes() ReadOnlySpan span = GetUnescapedSpan(); if (!TryGetByteCore(out byte value, span)) { - throw ThrowHelper.GetFormatException(NumericType.Byte); + ThrowHelper.ThrowFormatException(NumericType.Byte); } return value; } @@ -168,7 +166,7 @@ public sbyte GetSByte() { if (!TryGetSByte(out sbyte value)) { - throw ThrowHelper.GetFormatException(NumericType.SByte); + ThrowHelper.ThrowFormatException(NumericType.SByte); } return value; } @@ -178,7 +176,7 @@ internal sbyte GetSByteWithQuotes() ReadOnlySpan span = GetUnescapedSpan(); if (!TryGetSByteCore(out sbyte value, span)) { - throw ThrowHelper.GetFormatException(NumericType.SByte); + ThrowHelper.ThrowFormatException(NumericType.SByte); } return value; } @@ -202,7 +200,7 @@ public short GetInt16() { if (!TryGetInt16(out short value)) { - throw ThrowHelper.GetFormatException(NumericType.Int16); + ThrowHelper.ThrowFormatException(NumericType.Int16); } return value; } @@ -212,7 +210,7 @@ internal short GetInt16WithQuotes() ReadOnlySpan span = GetUnescapedSpan(); if (!TryGetInt16Core(out short value, span)) { - throw ThrowHelper.GetFormatException(NumericType.Int16); + ThrowHelper.ThrowFormatException(NumericType.Int16); } return value; } @@ -236,7 +234,7 @@ public int GetInt32() { if (!TryGetInt32(out int value)) { - throw ThrowHelper.GetFormatException(NumericType.Int32); + ThrowHelper.ThrowFormatException(NumericType.Int32); } return value; } @@ -246,7 +244,7 @@ internal int GetInt32WithQuotes() ReadOnlySpan span = GetUnescapedSpan(); if (!TryGetInt32Core(out int value, span)) { - throw ThrowHelper.GetFormatException(NumericType.Int32); + ThrowHelper.ThrowFormatException(NumericType.Int32); } return value; } @@ -270,7 +268,7 @@ public long GetInt64() { if (!TryGetInt64(out long value)) { - throw ThrowHelper.GetFormatException(NumericType.Int64); + ThrowHelper.ThrowFormatException(NumericType.Int64); } return value; } @@ -280,7 +278,7 @@ internal long GetInt64WithQuotes() ReadOnlySpan span = GetUnescapedSpan(); if (!TryGetInt64Core(out long value, span)) { - throw ThrowHelper.GetFormatException(NumericType.Int64); + ThrowHelper.ThrowFormatException(NumericType.Int64); } return value; } @@ -305,7 +303,7 @@ public ushort GetUInt16() { if (!TryGetUInt16(out ushort value)) { - throw ThrowHelper.GetFormatException(NumericType.UInt16); + ThrowHelper.ThrowFormatException(NumericType.UInt16); } return value; } @@ -315,7 +313,7 @@ internal ushort GetUInt16WithQuotes() ReadOnlySpan span = GetUnescapedSpan(); if (!TryGetUInt16Core(out ushort value, span)) { - throw ThrowHelper.GetFormatException(NumericType.UInt16); + ThrowHelper.ThrowFormatException(NumericType.UInt16); } return value; } @@ -340,7 +338,7 @@ public uint GetUInt32() { if (!TryGetUInt32(out uint value)) { - throw ThrowHelper.GetFormatException(NumericType.UInt32); + ThrowHelper.ThrowFormatException(NumericType.UInt32); } return value; } @@ -350,7 +348,7 @@ internal uint GetUInt32WithQuotes() ReadOnlySpan span = GetUnescapedSpan(); if (!TryGetUInt32Core(out uint value, span)) { - throw ThrowHelper.GetFormatException(NumericType.UInt32); + ThrowHelper.ThrowFormatException(NumericType.UInt32); } return value; } @@ -375,7 +373,7 @@ public ulong GetUInt64() { if (!TryGetUInt64(out ulong value)) { - throw ThrowHelper.GetFormatException(NumericType.UInt64); + ThrowHelper.ThrowFormatException(NumericType.UInt64); } return value; } @@ -385,7 +383,7 @@ internal ulong GetUInt64WithQuotes() ReadOnlySpan span = GetUnescapedSpan(); if (!TryGetUInt64Core(out ulong value, span)) { - throw ThrowHelper.GetFormatException(NumericType.UInt64); + ThrowHelper.ThrowFormatException(NumericType.UInt64); } return value; } @@ -408,7 +406,7 @@ public float GetSingle() { if (!TryGetSingle(out float value)) { - throw ThrowHelper.GetFormatException(NumericType.Single); + ThrowHelper.ThrowFormatException(NumericType.Single); } return value; } @@ -422,31 +420,29 @@ internal float GetSingleWithQuotes() return value; } - if (Utf8Parser.TryParse(span, out value, out int bytesConsumed) - && span.Length == bytesConsumed) + // NETCOREAPP implementation of the TryParse method above permits case-insensitive variants of the + // float constants "NaN", "Infinity", "-Infinity". This differs from the NETFRAMEWORK implementation. + // The following logic reconciles the two implementations to enforce consistent behavior. + if (!(Utf8Parser.TryParse(span, out value, out int bytesConsumed) + && span.Length == bytesConsumed + && JsonHelpers.IsFinite(value))) { - // NETCOREAPP implementation of the TryParse method above permits case-insenstive variants of the - // float constants "NaN", "Infinity", "-Infinity". This differs from the NETFRAMEWORK implementation. - // The following logic reconciles the two implementations to enforce consistent behavior. - if (JsonHelpers.IsFinite(value)) - { - return value; - } + ThrowHelper.ThrowFormatException(NumericType.Single); } - throw ThrowHelper.GetFormatException(NumericType.Single); + return value; } internal float GetSingleFloatingPointConstant() { ReadOnlySpan span = GetUnescapedSpan(); - if (JsonReaderHelper.TryGetFloatingPointConstant(span, out float value)) + if (!JsonReaderHelper.TryGetFloatingPointConstant(span, out float value)) { - return value; + ThrowHelper.ThrowFormatException(NumericType.Single); } - throw ThrowHelper.GetFormatException(NumericType.Single); + return value; } /// @@ -467,7 +463,7 @@ public double GetDouble() { if (!TryGetDouble(out double value)) { - throw ThrowHelper.GetFormatException(NumericType.Double); + ThrowHelper.ThrowFormatException(NumericType.Double); } return value; } @@ -481,31 +477,29 @@ internal double GetDoubleWithQuotes() return value; } - if (Utf8Parser.TryParse(span, out value, out int bytesConsumed) - && span.Length == bytesConsumed) + // NETCOREAPP implementation of the TryParse method above permits case-insensitive variants of the + // float constants "NaN", "Infinity", "-Infinity". This differs from the NETFRAMEWORK implementation. + // The following logic reconciles the two implementations to enforce consistent behavior. + if (!(Utf8Parser.TryParse(span, out value, out int bytesConsumed) + && span.Length == bytesConsumed + && JsonHelpers.IsFinite(value))) { - // NETCOREAPP implementation of the TryParse method above permits case-insenstive variants of the - // float constants "NaN", "Infinity", "-Infinity". This differs from the NETFRAMEWORK implementation. - // The following logic reconciles the two implementations to enforce consistent behavior. - if (JsonHelpers.IsFinite(value)) - { - return value; - } + ThrowHelper.ThrowFormatException(NumericType.Double); } - throw ThrowHelper.GetFormatException(NumericType.Double); + return value; } internal double GetDoubleFloatingPointConstant() { ReadOnlySpan span = GetUnescapedSpan(); - if (JsonReaderHelper.TryGetFloatingPointConstant(span, out double value)) + if (!JsonReaderHelper.TryGetFloatingPointConstant(span, out double value)) { - return value; + ThrowHelper.ThrowFormatException(NumericType.Double); } - throw ThrowHelper.GetFormatException(NumericType.Double); + return value; } /// @@ -526,7 +520,7 @@ public decimal GetDecimal() { if (!TryGetDecimal(out decimal value)) { - throw ThrowHelper.GetFormatException(NumericType.Decimal); + ThrowHelper.ThrowFormatException(NumericType.Decimal); } return value; } @@ -536,7 +530,7 @@ internal decimal GetDecimalWithQuotes() ReadOnlySpan span = GetUnescapedSpan(); if (!TryGetDecimalCore(out decimal value, span)) { - throw ThrowHelper.GetFormatException(NumericType.Decimal); + ThrowHelper.ThrowFormatException(NumericType.Decimal); } return value; } @@ -558,7 +552,7 @@ public DateTime GetDateTime() { if (!TryGetDateTime(out DateTime value)) { - throw ThrowHelper.GetFormatException(DataType.DateTime); + ThrowHelper.ThrowFormatException(DataType.DateTime); } return value; @@ -568,7 +562,7 @@ internal DateTime GetDateTimeNoValidation() { if (!TryGetDateTimeCore(out DateTime value)) { - throw ThrowHelper.GetFormatException(DataType.DateTime); + ThrowHelper.ThrowFormatException(DataType.DateTime); } return value; @@ -591,7 +585,7 @@ public DateTimeOffset GetDateTimeOffset() { if (!TryGetDateTimeOffset(out DateTimeOffset value)) { - throw ThrowHelper.GetFormatException(DataType.DateTimeOffset); + ThrowHelper.ThrowFormatException(DataType.DateTimeOffset); } return value; @@ -601,7 +595,7 @@ internal DateTimeOffset GetDateTimeOffsetNoValidation() { if (!TryGetDateTimeOffsetCore(out DateTimeOffset value)) { - throw ThrowHelper.GetFormatException(DataType.DateTimeOffset); + ThrowHelper.ThrowFormatException(DataType.DateTimeOffset); } return value; @@ -624,7 +618,7 @@ public Guid GetGuid() { if (!TryGetGuid(out Guid value)) { - throw ThrowHelper.GetFormatException(DataType.Guid); + ThrowHelper.ThrowFormatException(DataType.Guid); } return value; @@ -634,7 +628,7 @@ internal Guid GetGuidNoValidation() { if (!TryGetGuidCore(out Guid value)) { - throw ThrowHelper.GetFormatException(DataType.Guid); + ThrowHelper.ThrowFormatException(DataType.Guid); } return value; @@ -654,7 +648,7 @@ public bool TryGetBytesFromBase64([NotNullWhen(true)] out byte[]? value) { if (TokenType != JsonTokenType.String) { - throw ThrowHelper.GetInvalidOperationException_ExpectedString(TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedString(TokenType); } ReadOnlySpan span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; @@ -684,7 +678,7 @@ public bool TryGetByte(out byte value) { if (TokenType != JsonTokenType.Number) { - throw ThrowHelper.GetInvalidOperationException_ExpectedNumber(TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); } ReadOnlySpan span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; @@ -720,7 +714,7 @@ public bool TryGetSByte(out sbyte value) { if (TokenType != JsonTokenType.Number) { - throw ThrowHelper.GetInvalidOperationException_ExpectedNumber(TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); } ReadOnlySpan span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; @@ -755,7 +749,7 @@ public bool TryGetInt16(out short value) { if (TokenType != JsonTokenType.Number) { - throw ThrowHelper.GetInvalidOperationException_ExpectedNumber(TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); } ReadOnlySpan span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; @@ -790,7 +784,7 @@ public bool TryGetInt32(out int value) { if (TokenType != JsonTokenType.Number) { - throw ThrowHelper.GetInvalidOperationException_ExpectedNumber(TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); } ReadOnlySpan span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; @@ -825,7 +819,7 @@ public bool TryGetInt64(out long value) { if (TokenType != JsonTokenType.Number) { - throw ThrowHelper.GetInvalidOperationException_ExpectedNumber(TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); } ReadOnlySpan span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; @@ -861,7 +855,7 @@ public bool TryGetUInt16(out ushort value) { if (TokenType != JsonTokenType.Number) { - throw ThrowHelper.GetInvalidOperationException_ExpectedNumber(TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); } ReadOnlySpan span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; @@ -897,7 +891,7 @@ public bool TryGetUInt32(out uint value) { if (TokenType != JsonTokenType.Number) { - throw ThrowHelper.GetInvalidOperationException_ExpectedNumber(TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); } ReadOnlySpan span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; @@ -933,7 +927,7 @@ public bool TryGetUInt64(out ulong value) { if (TokenType != JsonTokenType.Number) { - throw ThrowHelper.GetInvalidOperationException_ExpectedNumber(TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); } ReadOnlySpan span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; @@ -968,7 +962,7 @@ public bool TryGetSingle(out float value) { if (TokenType != JsonTokenType.Number) { - throw ThrowHelper.GetInvalidOperationException_ExpectedNumber(TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); } ReadOnlySpan span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; @@ -998,7 +992,7 @@ public bool TryGetDouble(out double value) { if (TokenType != JsonTokenType.Number) { - throw ThrowHelper.GetInvalidOperationException_ExpectedNumber(TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); } ReadOnlySpan span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; @@ -1028,7 +1022,7 @@ public bool TryGetDecimal(out decimal value) { if (TokenType != JsonTokenType.Number) { - throw ThrowHelper.GetInvalidOperationException_ExpectedNumber(TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedNumber(TokenType); } ReadOnlySpan span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; @@ -1063,7 +1057,7 @@ public bool TryGetDateTime(out DateTime value) { if (TokenType != JsonTokenType.String) { - throw ThrowHelper.GetInvalidOperationException_ExpectedString(TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedString(TokenType); } return TryGetDateTimeCore(out value); @@ -1131,7 +1125,7 @@ public bool TryGetDateTimeOffset(out DateTimeOffset value) { if (TokenType != JsonTokenType.String) { - throw ThrowHelper.GetInvalidOperationException_ExpectedString(TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedString(TokenType); } return TryGetDateTimeOffsetCore(out value); @@ -1200,7 +1194,7 @@ public bool TryGetGuid(out Guid value) { if (TokenType != JsonTokenType.String) { - throw ThrowHelper.GetInvalidOperationException_ExpectedString(TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedString(TokenType); } return TryGetGuidCore(out value); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.cs index efafcf92b4ed2b..42e561d89b0f44 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.cs @@ -304,7 +304,7 @@ public void Skip() { if (!_isFinalBlock) { - throw ThrowHelper.GetInvalidOperationException_CannotSkipOnPartial(); + ThrowHelper.ThrowInvalidOperationException_CannotSkipOnPartial(); } SkipHelper(); @@ -429,8 +429,9 @@ public bool ValueTextEquals(ReadOnlySpan utf8Text) { if (!IsTokenTypeString(TokenType)) { - throw ThrowHelper.GetInvalidOperationException_ExpectedStringComparison(TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedStringComparison(TokenType); } + return TextEqualsHelper(utf8Text); } @@ -499,7 +500,7 @@ public bool ValueTextEquals(ReadOnlySpan text) { if (!IsTokenTypeString(TokenType)) { - throw ThrowHelper.GetInvalidOperationException_ExpectedStringComparison(TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedStringComparison(TokenType); } if (MatchNotPossible(text.Length)) diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/BooleanConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/BooleanConverter.cs index 488769d49f10fb..1345659c0f64fc 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/BooleanConverter.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/BooleanConverter.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Buffers.Text; +using System.Diagnostics; namespace System.Text.Json.Serialization.Converters { @@ -20,13 +21,13 @@ public override void Write(Utf8JsonWriter writer, bool value, JsonSerializerOpti internal override bool ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { ReadOnlySpan propertyName = reader.GetSpan(); - if (Utf8Parser.TryParse(propertyName, out bool value, out int bytesConsumed) - && propertyName.Length == bytesConsumed) + if (!(Utf8Parser.TryParse(propertyName, out bool value, out int bytesConsumed) + && propertyName.Length == bytesConsumed)) { - return value; + ThrowHelper.ThrowFormatException(DataType.Boolean); } - throw ThrowHelper.GetFormatException(DataType.Boolean); + return value; } internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, bool value, JsonSerializerOptions options, bool isWritingExtensionDataProperty) diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/CharConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/CharConverter.cs index e4242836fe0918..5a33044f99dc45 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/CharConverter.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/CharConverter.cs @@ -12,7 +12,7 @@ public override char Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSer string? str = reader.GetString(); if (string.IsNullOrEmpty(str) || str.Length > 1) { - throw ThrowHelper.GetInvalidOperationException_ExpectedChar(reader.TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedChar(reader.TokenType); } return str[0]; } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/ObjectConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/ObjectConverter.cs index ddb2a899947b64..7ce4a2cb706b55 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/ObjectConverter.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/ObjectConverter.cs @@ -7,11 +7,6 @@ namespace System.Text.Json.Serialization.Converters { internal sealed class ObjectConverter : JsonConverter { - public ObjectConverter() - { - IsInternalConverterForNumberType = true; - } - public override object? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { if (options.UnknownTypeHandling == JsonUnknownTypeHandling.JsonElement) @@ -50,15 +45,5 @@ internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, object? va runtimeConverter.WriteAsPropertyNameCoreAsObject(writer, value, options, isWritingExtensionDataProperty); } - - internal override object? ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options) - { - if (options.UnknownTypeHandling == JsonUnknownTypeHandling.JsonElement) - { - return JsonElement.ParseValue(ref reader); - } - - return JsonNodeConverter.Instance.Read(ref reader, typeof(object), options); - } } } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/TimeSpanConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/TimeSpanConverter.cs index ddb3252c9be43e..168c439ecfc90e 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/TimeSpanConverter.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/TimeSpanConverter.cs @@ -17,7 +17,7 @@ public override TimeSpan Read(ref Utf8JsonReader reader, Type typeToConvert, Jso { if (reader.TokenType != JsonTokenType.String) { - throw ThrowHelper.GetInvalidOperationException_ExpectedString(reader.TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.TokenType); } bool isEscaped = reader._stringHasEscaping; @@ -32,7 +32,7 @@ public override TimeSpan Read(ref Utf8JsonReader reader, Type typeToConvert, Jso if (!JsonHelpers.IsInRangeInclusive(sequenceLength, MinimumTimeSpanFormatLength, maximumLength)) { - throw ThrowHelper.GetFormatException(DataType.TimeSpan); + ThrowHelper.ThrowFormatException(DataType.TimeSpan); } Span stackSpan = stackalloc byte[isEscaped ? MaximumEscapedTimeSpanFormatLength : MaximumTimeSpanFormatLength]; @@ -45,7 +45,7 @@ public override TimeSpan Read(ref Utf8JsonReader reader, Type typeToConvert, Jso if (!JsonHelpers.IsInRangeInclusive(source.Length, MinimumTimeSpanFormatLength, maximumLength)) { - throw ThrowHelper.GetFormatException(DataType.TimeSpan); + ThrowHelper.ThrowFormatException(DataType.TimeSpan); } } @@ -68,7 +68,7 @@ public override TimeSpan Read(ref Utf8JsonReader reader, Type typeToConvert, Jso { // Note: Utf8Parser.TryParse allows for leading whitespace so we // need to exclude that case here. - throw ThrowHelper.GetFormatException(DataType.TimeSpan); + ThrowHelper.ThrowFormatException(DataType.TimeSpan); } bool result = Utf8Parser.TryParse(source, out TimeSpan tmpValue, out int bytesConsumed, 'c'); @@ -78,12 +78,12 @@ public override TimeSpan Read(ref Utf8JsonReader reader, Type typeToConvert, Jso // "1$$$$$$$$$$". We need to check bytesConsumed to know if the // entire source was actually valid. - if (result && source.Length == bytesConsumed) + if (!result || source.Length != bytesConsumed) { - return tmpValue; + ThrowHelper.ThrowFormatException(DataType.TimeSpan); } - throw ThrowHelper.GetFormatException(DataType.TimeSpan); + return tmpValue; } public override void Write(Utf8JsonWriter writer, TimeSpan value, JsonSerializerOptions options) diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/VersionConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/VersionConverter.cs index f4bd6dff6d9ecf..b1c15a6d913eb1 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/VersionConverter.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/VersionConverter.cs @@ -21,7 +21,7 @@ public override Version Read(ref Utf8JsonReader reader, Type typeToConvert, Json { if (reader.TokenType != JsonTokenType.String) { - throw ThrowHelper.GetInvalidOperationException_ExpectedString(reader.TokenType); + ThrowHelper.ThrowInvalidOperationException_ExpectedString(reader.TokenType); } #if BUILDING_INBOX_LIBRARY @@ -33,7 +33,7 @@ public override Version Read(ref Utf8JsonReader reader, Type typeToConvert, Json { if (!JsonHelpers.IsInRangeInclusive(reader.ValueSequence.Length, MinimumVersionLength, maxLength)) { - throw ThrowHelper.GetFormatException(DataType.Version); + ThrowHelper.ThrowFormatException(DataType.Version); } Span stackSpan = stackalloc byte[isEscaped ? MaximumEscapedVersionLength : MaximumVersionLength]; @@ -46,7 +46,7 @@ public override Version Read(ref Utf8JsonReader reader, Type typeToConvert, Json if (!JsonHelpers.IsInRangeInclusive(source.Length, MinimumVersionLength, maxLength)) { - throw ThrowHelper.GetFormatException(DataType.Version); + ThrowHelper.ThrowFormatException(DataType.Version); } } @@ -72,7 +72,7 @@ public override Version Read(ref Utf8JsonReader reader, Type typeToConvert, Json // we need to make sure that our input doesn't have them, // and if it has - we need to throw, to match behaviour of other converters // since Version.TryParse allows them and silently parses input to Version - throw ThrowHelper.GetFormatException(DataType.Version); + ThrowHelper.ThrowFormatException(DataType.Version); } Span charBuffer = stackalloc char[MaximumVersionLength]; @@ -89,7 +89,7 @@ public override Version Read(ref Utf8JsonReader reader, Type typeToConvert, Json // we need to make sure that our input doesn't have them, // and if it has - we need to throw, to match behaviour of other converters // since Version.TryParse allows them and silently parses input to Version - throw ThrowHelper.GetFormatException(DataType.Version); + ThrowHelper.ThrowFormatException(DataType.Version); } if (Version.TryParse(versionString, out Version? result)) { diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Helpers.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Helpers.cs index 02ad7870814207..40649ec846660a 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Helpers.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Helpers.cs @@ -17,7 +17,7 @@ private static JsonTypeInfo GetTypeInfo(JsonSerializerOptions? options, Type run { Debug.Assert(runtimeType != null); - options ??= JsonSerializerOptions.s_defaultOptions; + options ??= JsonSerializerOptions.Default; if (!options.IsInitializedForReflectionSerializer) { options.InitializeForReflectionSerializer(); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Stream.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Stream.cs index 6a6f20c1f4d23a..0fd54b59100513 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Stream.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Stream.cs @@ -371,7 +371,7 @@ public static partial class JsonSerializer throw new ArgumentNullException(nameof(utf8Json)); } - options ??= JsonSerializerOptions.s_defaultOptions; + options ??= JsonSerializerOptions.Default; if (!options.IsInitializedForReflectionSerializer) { options.InitializeForReflectionSerializer(); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs index f81025bbc460e5..9b280c2904a81f 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs @@ -20,7 +20,19 @@ public sealed partial class JsonSerializerOptions { internal const int BufferSizeDefault = 16 * 1024; - internal static readonly JsonSerializerOptions s_defaultOptions = new JsonSerializerOptions(); + // For backward compatibility the default max depth for JsonSerializer is 64, + // the minimum of JsonReaderOptions.DefaultMaxDepth and JsonWriterOptions.DefaultMaxDepth. + internal const int DefaultMaxDepth = JsonReaderOptions.DefaultMaxDepth; + + /// + /// Gets a read-only, singleton instance of that uses the default configuration. + /// + /// + /// Each instance encapsulates its own serialization metadata caches, + /// so using fresh default instances every time one is needed can result in redundant recomputation of converters. + /// This property provides a shared instance that can be consumed by any number of components without necessitating any converter recomputation. + /// + public static JsonSerializerOptions Default { get; } = new JsonSerializerOptions { _haveTypesBeenCreated = true }; private readonly ConcurrentDictionary _classes = new ConcurrentDictionary(); @@ -421,16 +433,15 @@ public int MaxDepth if (value < 0) { - throw ThrowHelper.GetArgumentOutOfRangeException_MaxDepthMustBePositive(nameof(value)); + ThrowHelper.ThrowArgumentOutOfRangeException_MaxDepthMustBePositive(nameof(value)); } _maxDepth = value; - EffectiveMaxDepth = (value == 0 ? JsonReaderOptions.DefaultMaxDepth : value); + EffectiveMaxDepth = (value == 0 ? DefaultMaxDepth : value); } } - // The default is 64 because that is what the reader uses, so re-use the same JsonReaderOptions.DefaultMaxDepth constant. - internal int EffectiveMaxDepth { get; private set; } = JsonReaderOptions.DefaultMaxDepth; + internal int EffectiveMaxDepth { get; private set; } = DefaultMaxDepth; /// /// Specifies the policy used to convert a property's name on an object to another format, such as camel-casing. @@ -691,7 +702,7 @@ internal JsonReaderOptions GetReaderOptions() { AllowTrailingCommas = AllowTrailingCommas, CommentHandling = ReadCommentHandling, - MaxDepth = MaxDepth + MaxDepth = EffectiveMaxDepth }; } @@ -701,6 +712,7 @@ internal JsonWriterOptions GetWriterOptions() { Encoder = Encoder, Indented = WriteIndented, + MaxDepth = EffectiveMaxDepth, #if !DEBUG SkipValidation = true #endif @@ -709,9 +721,6 @@ internal JsonWriterOptions GetWriterOptions() internal void VerifyMutable() { - // The default options are hidden and thus should be immutable. - Debug.Assert(this != s_defaultOptions); - if (_haveTypesBeenCreated || _context != null) { ThrowHelper.ThrowInvalidOperationException_SerializerOptionsImmutable(_context); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.Node.cs b/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.Node.cs index aac78c005c3f93..364c1002824128 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.Node.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.Node.cs @@ -9,62 +9,54 @@ namespace System.Text.Json internal static partial class ThrowHelper { [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowArgumentException_NodeValueNotAllowed(string paramName) { throw new ArgumentException(SR.NodeValueNotAllowed, paramName); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowArgumentException_NodeArrayTooSmall(string paramName) { throw new ArgumentException(SR.NodeArrayTooSmall, paramName); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowArgumentOutOfRangeException_NodeArrayIndexNegative(string paramName) { throw new ArgumentOutOfRangeException(paramName, SR.NodeArrayIndexNegative); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowArgumentException_DuplicateKey(string propertyName) { throw new ArgumentException(SR.NodeDuplicateKey, propertyName); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_NodeAlreadyHasParent() { throw new InvalidOperationException(SR.NodeAlreadyHasParent); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_NodeCycleDetected() { throw new InvalidOperationException(SR.NodeCycleDetected); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_NodeElementCannotBeObjectOrArray() { throw new InvalidOperationException(SR.NodeElementCannotBeObjectOrArray); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowNotSupportedException_NodeCollectionIsReadOnly() { - throw NotSupportedException_NodeCollectionIsReadOnly(); + throw GetNotSupportedException_NodeCollectionIsReadOnly(); } - public static NotSupportedException NotSupportedException_NodeCollectionIsReadOnly() + public static NotSupportedException GetNotSupportedException_NodeCollectionIsReadOnly() { return new NotSupportedException(SR.NodeCollectionIsReadOnly); } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.Serialization.cs b/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.Serialization.cs index a75f5eaa484067..7036df5eb122e8 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.Serialization.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.Serialization.cs @@ -14,91 +14,78 @@ namespace System.Text.Json internal static partial class ThrowHelper { [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowArgumentException_DeserializeWrongType(Type type, object value) { throw new ArgumentException(SR.Format(SR.DeserializeWrongType, type, value.GetType())); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowNotSupportedException_SerializationNotSupported(Type propertyType) { throw new NotSupportedException(SR.Format(SR.SerializationNotSupportedType, propertyType)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowNotSupportedException_TypeRequiresAsyncSerialization(Type propertyType) { throw new NotSupportedException(SR.Format(SR.TypeRequiresAsyncSerialization, propertyType)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowNotSupportedException_ConstructorMaxOf64Parameters(Type type) { throw new NotSupportedException(SR.Format(SR.ConstructorMaxOf64Parameters, type)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowNotSupportedException_DictionaryKeyTypeNotSupported(Type keyType, JsonConverter converter) { throw new NotSupportedException(SR.Format(SR.DictionaryKeyTypeNotSupported, keyType, converter.GetType())); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowJsonException_DeserializeUnableToConvertValue(Type propertyType) { throw new JsonException(SR.Format(SR.DeserializeUnableToConvertValue, propertyType)) { AppendPathInformation = true }; } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidCastException_DeserializeUnableToAssignValue(Type typeOfValue, Type declaredType) { throw new InvalidCastException(SR.Format(SR.DeserializeUnableToAssignValue, typeOfValue, declaredType)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_DeserializeUnableToAssignNull(Type declaredType) { throw new InvalidOperationException(SR.Format(SR.DeserializeUnableToAssignNull, declaredType)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowJsonException_SerializationConverterRead(JsonConverter? converter) { throw new JsonException(SR.Format(SR.SerializationConverterRead, converter)) { AppendPathInformation = true }; } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowJsonException_SerializationConverterWrite(JsonConverter? converter) { throw new JsonException(SR.Format(SR.SerializationConverterWrite, converter)) { AppendPathInformation = true }; } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowJsonException_SerializerCycleDetected(int maxDepth) { throw new JsonException(SR.Format(SR.SerializerCycleDetected, maxDepth)) { AppendPathInformation = true }; } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowJsonException(string? message = null) { throw new JsonException(message) { AppendPathInformation = true }; } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_CannotSerializeInvalidType(Type type, Type? parentClassType, MemberInfo? memberInfo) { if (parentClassType == null) @@ -112,14 +99,12 @@ public static void ThrowInvalidOperationException_CannotSerializeInvalidType(Typ } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_SerializationConverterNotCompatible(Type converterType, Type type) { throw new InvalidOperationException(SR.Format(SR.SerializationConverterNotCompatible, converterType, type)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_SerializationConverterOnAttributeInvalid(Type classType, MemberInfo? memberInfo) { string location = classType.ToString(); @@ -132,7 +117,6 @@ public static void ThrowInvalidOperationException_SerializationConverterOnAttrib } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_SerializationConverterOnAttributeNotCompatible(Type classTypeAttributeIsOn, MemberInfo? memberInfo, Type typeToConvert) { string location = classTypeAttributeIsOn.ToString(); @@ -146,7 +130,6 @@ public static void ThrowInvalidOperationException_SerializationConverterOnAttrib } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_SerializerOptionsImmutable(JsonSerializerContext? context) { string message = context == null @@ -157,21 +140,18 @@ public static void ThrowInvalidOperationException_SerializerOptionsImmutable(Jso } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_SerializerPropertyNameConflict(Type type, JsonPropertyInfo jsonPropertyInfo) { throw new InvalidOperationException(SR.Format(SR.SerializerPropertyNameConflict, type, jsonPropertyInfo.ClrName)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_SerializerPropertyNameNull(Type parentType, JsonPropertyInfo jsonPropertyInfo) { throw new InvalidOperationException(SR.Format(SR.SerializerPropertyNameNull, parentType, jsonPropertyInfo.MemberInfo?.Name)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_NamingPolicyReturnNull(JsonNamingPolicy namingPolicy) { throw new InvalidOperationException(SR.Format(SR.NamingPolicyReturnNull, namingPolicy)); @@ -190,7 +170,6 @@ public static void ThrowInvalidOperationException_SerializerConverterFactoryRetu } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_MultiplePropertiesBindToConstructorParameters( Type parentType, string parameterName, @@ -207,35 +186,30 @@ public static void ThrowInvalidOperationException_MultiplePropertiesBindToConstr } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_ConstructorParameterIncompleteBinding(Type parentType) { throw new InvalidOperationException(SR.Format(SR.ConstructorParamIncompleteBinding, parentType)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_ExtensionDataCannotBindToCtorParam(JsonPropertyInfo jsonPropertyInfo) { throw new InvalidOperationException(SR.Format(SR.ExtensionDataCannotBindToCtorParam, jsonPropertyInfo.ClrName, jsonPropertyInfo.DeclaringType)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_JsonIncludeOnNonPublicInvalid(string memberName, Type declaringType) { throw new InvalidOperationException(SR.Format(SR.JsonIncludeOnNonPublicInvalid, memberName, declaringType)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_IgnoreConditionOnValueTypeInvalid(string clrPropertyName, Type propertyDeclaringType) { throw new InvalidOperationException(SR.Format(SR.IgnoreConditionOnValueTypeInvalid, clrPropertyName, propertyDeclaringType)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_NumberHandlingOnPropertyInvalid(JsonPropertyInfo jsonPropertyInfo) { MemberInfo? memberInfo = jsonPropertyInfo.MemberInfo; @@ -246,14 +220,12 @@ public static void ThrowInvalidOperationException_NumberHandlingOnPropertyInvali } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_ConverterCanConvertMultipleTypes(Type runtimePropertyType, JsonConverter jsonConverter) { throw new InvalidOperationException(SR.Format(SR.ConverterCanConvertMultipleTypes, jsonConverter.GetType(), jsonConverter.TypeToConvert, runtimePropertyType)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowNotSupportedException_ObjectWithParameterizedCtorRefMetadataNotHonored( ReadOnlySpan propertyName, ref Utf8JsonReader reader, @@ -267,7 +239,6 @@ public static void ThrowNotSupportedException_ObjectWithParameterizedCtorRefMeta } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ReThrowWithPath(ref ReadStack state, JsonReaderException ex) { Debug.Assert(ex.Path == null); @@ -294,7 +265,6 @@ public static void ReThrowWithPath(ref ReadStack state, JsonReaderException ex) } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ReThrowWithPath(ref ReadStack state, in Utf8JsonReader reader, Exception ex) { JsonException jsonException = new JsonException(null, ex); @@ -338,7 +308,6 @@ public static void AddJsonExceptionInformation(ref ReadStack state, in Utf8JsonR } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ReThrowWithPath(ref WriteStack state, Exception ex) { JsonException jsonException = new JsonException(null, ex); @@ -369,7 +338,6 @@ public static void AddJsonExceptionInformation(ref WriteStack state, JsonExcepti } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_SerializationDuplicateAttribute(Type attribute, Type classType, MemberInfo? memberInfo) { string location = classType.ToString(); @@ -382,21 +350,18 @@ public static void ThrowInvalidOperationException_SerializationDuplicateAttribut } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_SerializationDuplicateTypeAttribute(Type classType, Type attribute) { throw new InvalidOperationException(SR.Format(SR.SerializationDuplicateTypeAttribute, classType, attribute)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_SerializationDuplicateTypeAttribute(Type classType) { throw new InvalidOperationException(SR.Format(SR.SerializationDuplicateTypeAttribute, classType, typeof(TAttribute))); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_SerializationDataExtensionPropertyInvalid(Type type, JsonPropertyInfo jsonPropertyInfo) { throw new InvalidOperationException(SR.Format(SR.SerializationDataExtensionPropertyInvalid, type, jsonPropertyInfo.MemberInfo?.Name)); @@ -465,7 +430,6 @@ public static void ThrowNotSupportedException(ref WriteStack state, NotSupported } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowNotSupportedException_DeserializeNoConstructor(Type type, ref Utf8JsonReader reader, ref ReadStack state) { string message; @@ -483,42 +447,36 @@ public static void ThrowNotSupportedException_DeserializeNoConstructor(Type type } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowNotSupportedException_CannotPopulateCollection(Type type, ref Utf8JsonReader reader, ref ReadStack state) { ThrowNotSupportedException(ref state, reader, new NotSupportedException(SR.Format(SR.CannotPopulateCollection, type))); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowJsonException_MetadataValuesInvalidToken(JsonTokenType tokenType) { ThrowJsonException(SR.Format(SR.MetadataInvalidTokenAfterValues, tokenType)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowJsonException_MetadataReferenceNotFound(string id) { ThrowJsonException(SR.Format(SR.MetadataReferenceNotFound, id)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowJsonException_MetadataValueWasNotString(JsonTokenType tokenType) { ThrowJsonException(SR.Format(SR.MetadataValueWasNotString, tokenType)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowJsonException_MetadataValueWasNotString(JsonValueKind valueKind) { ThrowJsonException(SR.Format(SR.MetadataValueWasNotString, valueKind)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowJsonException_MetadataReferenceObjectCannotContainOtherProperties(ReadOnlySpan propertyName, ref ReadStack state) { state.Current.JsonPropertyName = propertyName.ToArray(); @@ -526,14 +484,12 @@ public static void ThrowJsonException_MetadataReferenceObjectCannotContainOtherP } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowJsonException_MetadataReferenceObjectCannotContainOtherProperties() { ThrowJsonException(SR.MetadataReferenceCannotContainOtherProperties); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowJsonException_MetadataIdIsNotFirstProperty(ReadOnlySpan propertyName, ref ReadStack state) { state.Current.JsonPropertyName = propertyName.ToArray(); @@ -541,7 +497,6 @@ public static void ThrowJsonException_MetadataIdIsNotFirstProperty(ReadOnlySpan< } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowJsonException_MetadataMissingIdBeforeValues(ref ReadStack state, ReadOnlySpan propertyName) { state.Current.JsonPropertyName = propertyName.ToArray(); @@ -549,7 +504,6 @@ public static void ThrowJsonException_MetadataMissingIdBeforeValues(ref ReadStac } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowJsonException_MetadataInvalidPropertyWithLeadingDollarSign(ReadOnlySpan propertyName, ref ReadStack state, in Utf8JsonReader reader) { // Set PropertyInfo or KeyName to write down the conflicting property name in JsonException.Path @@ -566,21 +520,18 @@ public static void ThrowJsonException_MetadataInvalidPropertyWithLeadingDollarSi } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowJsonException_MetadataDuplicateIdFound(string id) { ThrowJsonException(SR.Format(SR.MetadataDuplicateIdFound, id)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowJsonException_MetadataInvalidReferenceToValueType(Type propertyType) { ThrowJsonException(SR.Format(SR.MetadataInvalidReferenceToValueType, propertyType)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowJsonException_MetadataPreservedArrayInvalidProperty(ref ReadStack state, Type propertyType, in Utf8JsonReader reader) { state.Current.JsonPropertyName = reader.HasValueSequence ? reader.ValueSequence.ToArray() : reader.ValueSpan.ToArray(); @@ -592,7 +543,6 @@ public static void ThrowJsonException_MetadataPreservedArrayInvalidProperty(ref } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowJsonException_MetadataPreservedArrayValuesNotFound(ref ReadStack state, Type propertyType) { // Missing $values, JSON path should point to the property's object. @@ -604,14 +554,12 @@ public static void ThrowJsonException_MetadataPreservedArrayValuesNotFound(ref R } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowJsonException_MetadataCannotParsePreservedObjectIntoImmutable(Type propertyType) { ThrowJsonException(SR.Format(SR.MetadataCannotParsePreservedObjectToImmutable, propertyType)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_MetadataReferenceOfTypeCannotBeAssignedToType(string referenceId, Type currentType, Type typeToConvert) { throw new InvalidOperationException(SR.Format(SR.MetadataReferenceOfTypeCannotBeAssignedToType, referenceId, currentType, typeToConvert)); @@ -644,35 +592,30 @@ internal static void ThrowUnexpectedMetadataException( } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_JsonSerializerOptionsAlreadyBoundToContext() { throw new InvalidOperationException(SR.Format(SR.OptionsAlreadyBoundToContext)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowNotSupportedException_BuiltInConvertersNotRooted(Type type) { throw new NotSupportedException(SR.Format(SR.BuiltInConvertersNotRooted, type)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowNotSupportedException_NoMetadataForType(Type type) { throw new NotSupportedException(SR.Format(SR.NoMetadataForType, type)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_NoMetadataForType(Type type) { throw new InvalidOperationException(SR.Format(SR.NoMetadataForType, type)); } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowInvalidOperationException_MetadatInitFuncsNull() { throw new InvalidOperationException(SR.Format(SR.MetadataInitFuncsNull)); @@ -694,7 +637,6 @@ public static void ThrowInvalidOperationException_NoDefaultOptionsForContext(Jso } [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] public static void ThrowMissingMemberException_MissingFSharpCoreMember(string missingFsharpCoreMember) { throw new MissingMemberException(SR.Format(SR.MissingFSharpCoreMember, missingFsharpCoreMember)); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.cs b/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.cs index 092588cee842a9..e5cd6d024ee1aa 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.cs @@ -12,23 +12,23 @@ internal static partial class ThrowHelper // If the exception source is this value, the serializer will re-throw as JsonException. public const string ExceptionSourceValueToRethrowAsJsonException = "System.Text.Json.Rethrowable"; - public static ArgumentOutOfRangeException GetArgumentOutOfRangeException_MaxDepthMustBePositive(string parameterName) + [DoesNotReturn] + public static void ThrowArgumentOutOfRangeException_MaxDepthMustBePositive(string parameterName) { - return GetArgumentOutOfRangeException(parameterName, SR.MaxDepthMustBePositive); + throw GetArgumentOutOfRangeException(parameterName, SR.MaxDepthMustBePositive); } - [MethodImpl(MethodImplOptions.NoInlining)] private static ArgumentOutOfRangeException GetArgumentOutOfRangeException(string parameterName, string message) { return new ArgumentOutOfRangeException(parameterName, message); } - public static ArgumentOutOfRangeException GetArgumentOutOfRangeException_CommentEnumMustBeInRange(string parameterName) + [DoesNotReturn] + public static void ThrowArgumentOutOfRangeException_CommentEnumMustBeInRange(string parameterName) { - return GetArgumentOutOfRangeException(parameterName, SR.CommentHandlingMustBeValid); + throw GetArgumentOutOfRangeException(parameterName, SR.CommentHandlingMustBeValid); } - [MethodImpl(MethodImplOptions.NoInlining)] private static ArgumentException GetArgumentException(string message) { return new ArgumentException(message); @@ -126,12 +126,12 @@ public static void ThrowArgumentException(ReadOnlySpan propertyName, ReadO } [DoesNotReturn] - public static void ThrowInvalidOperationOrArgumentException(ReadOnlySpan propertyName, int currentDepth) + public static void ThrowInvalidOperationOrArgumentException(ReadOnlySpan propertyName, int currentDepth, int maxDepth) { currentDepth &= JsonConstants.RemoveFlagsBitMask; - if (currentDepth >= JsonConstants.MaxWriterDepth) + if (currentDepth >= maxDepth) { - ThrowInvalidOperationException(SR.Format(SR.DepthTooLarge, currentDepth, JsonConstants.MaxWriterDepth)); + ThrowInvalidOperationException(SR.Format(SR.DepthTooLarge, currentDepth, maxDepth)); } else { @@ -141,11 +141,11 @@ public static void ThrowInvalidOperationOrArgumentException(ReadOnlySpan p } [DoesNotReturn] - public static void ThrowInvalidOperationException(int currentDepth) + public static void ThrowInvalidOperationException(int currentDepth, int maxDepth) { currentDepth &= JsonConstants.RemoveFlagsBitMask; - Debug.Assert(currentDepth >= JsonConstants.MaxWriterDepth); - ThrowInvalidOperationException(SR.Format(SR.DepthTooLarge, currentDepth, JsonConstants.MaxWriterDepth)); + Debug.Assert(currentDepth >= maxDepth); + ThrowInvalidOperationException(SR.Format(SR.DepthTooLarge, currentDepth, maxDepth)); } [DoesNotReturn] @@ -154,12 +154,9 @@ public static void ThrowInvalidOperationException(string message) throw GetInvalidOperationException(message); } - [MethodImpl(MethodImplOptions.NoInlining)] private static InvalidOperationException GetInvalidOperationException(string message) { - var ex = new InvalidOperationException(message); - ex.Source = ExceptionSourceValueToRethrowAsJsonException; - return ex; + return new InvalidOperationException(message) { Source = ExceptionSourceValueToRethrowAsJsonException }; } [DoesNotReturn] @@ -168,7 +165,6 @@ public static void ThrowInvalidOperationException_DepthNonZeroOrEmptyJson(int cu throw GetInvalidOperationException(currentDepth); } - [MethodImpl(MethodImplOptions.NoInlining)] private static InvalidOperationException GetInvalidOperationException(int currentDepth) { currentDepth &= JsonConstants.RemoveFlagsBitMask; @@ -183,12 +179,12 @@ private static InvalidOperationException GetInvalidOperationException(int curren } [DoesNotReturn] - public static void ThrowInvalidOperationOrArgumentException(ReadOnlySpan propertyName, int currentDepth) + public static void ThrowInvalidOperationOrArgumentException(ReadOnlySpan propertyName, int currentDepth, int maxDepth) { currentDepth &= JsonConstants.RemoveFlagsBitMask; - if (currentDepth >= JsonConstants.MaxWriterDepth) + if (currentDepth >= maxDepth) { - ThrowInvalidOperationException(SR.Format(SR.DepthTooLarge, currentDepth, JsonConstants.MaxWriterDepth)); + ThrowInvalidOperationException(SR.Format(SR.DepthTooLarge, currentDepth, maxDepth)); } else { @@ -207,66 +203,60 @@ public static InvalidOperationException GetInvalidOperationException_ExpectedObj return GetInvalidOperationException("object", tokenType); } - public static InvalidOperationException GetInvalidOperationException_ExpectedNumber(JsonTokenType tokenType) + [DoesNotReturn] + public static void ThrowInvalidOperationException_ExpectedNumber(JsonTokenType tokenType) { - return GetInvalidOperationException("number", tokenType); + throw GetInvalidOperationException("number", tokenType); } - public static InvalidOperationException GetInvalidOperationException_ExpectedBoolean(JsonTokenType tokenType) + [DoesNotReturn] + public static void ThrowInvalidOperationException_ExpectedBoolean(JsonTokenType tokenType) { - return GetInvalidOperationException("boolean", tokenType); + throw GetInvalidOperationException("boolean", tokenType); } - public static InvalidOperationException GetInvalidOperationException_ExpectedString(JsonTokenType tokenType) + [DoesNotReturn] + public static void ThrowInvalidOperationException_ExpectedString(JsonTokenType tokenType) { - return GetInvalidOperationException("string", tokenType); + throw GetInvalidOperationException("string", tokenType); } - public static InvalidOperationException GetInvalidOperationException_ExpectedStringComparison(JsonTokenType tokenType) + [DoesNotReturn] + public static void ThrowInvalidOperationException_ExpectedStringComparison(JsonTokenType tokenType) { - return GetInvalidOperationException(tokenType); + throw GetInvalidOperationException(tokenType); } - public static InvalidOperationException GetInvalidOperationException_ExpectedComment(JsonTokenType tokenType) + [DoesNotReturn] + public static void ThrowInvalidOperationException_ExpectedComment(JsonTokenType tokenType) { - return GetInvalidOperationException("comment", tokenType); + throw GetInvalidOperationException("comment", tokenType); } - [MethodImpl(MethodImplOptions.NoInlining)] - public static InvalidOperationException GetInvalidOperationException_CannotSkipOnPartial() + [DoesNotReturn] + public static void ThrowInvalidOperationException_CannotSkipOnPartial() { - return GetInvalidOperationException(SR.CannotSkip); + throw GetInvalidOperationException(SR.CannotSkip); } - [MethodImpl(MethodImplOptions.NoInlining)] private static InvalidOperationException GetInvalidOperationException(string message, JsonTokenType tokenType) { return GetInvalidOperationException(SR.Format(SR.InvalidCast, tokenType, message)); } - [MethodImpl(MethodImplOptions.NoInlining)] private static InvalidOperationException GetInvalidOperationException(JsonTokenType tokenType) { return GetInvalidOperationException(SR.Format(SR.InvalidComparison, tokenType)); } - [MethodImpl(MethodImplOptions.NoInlining)] - internal static InvalidOperationException GetJsonElementWrongTypeException( + [DoesNotReturn] + internal static void ThrowJsonElementWrongTypeException( JsonTokenType expectedType, JsonTokenType actualType) { - return GetJsonElementWrongTypeException(expectedType.ToValueKind(), actualType.ToValueKind()); + throw GetJsonElementWrongTypeException(expectedType.ToValueKind(), actualType.ToValueKind()); } - [MethodImpl(MethodImplOptions.NoInlining)] - internal static InvalidOperationException GetJsonElementWrongTypeException( - string expectedTypeName, - JsonTokenType actualType) - { - return GetJsonElementWrongTypeException(expectedTypeName, actualType.ToValueKind()); - } - - [MethodImpl(MethodImplOptions.NoInlining)] internal static InvalidOperationException GetJsonElementWrongTypeException( JsonValueKind expectedType, JsonValueKind actualType) @@ -275,7 +265,6 @@ internal static InvalidOperationException GetJsonElementWrongTypeException( SR.Format(SR.JsonElementHasWrongType, expectedType, actualType)); } - [MethodImpl(MethodImplOptions.NoInlining)] internal static InvalidOperationException GetJsonElementWrongTypeException( string expectedTypeName, JsonValueKind actualType) @@ -433,9 +422,9 @@ private static string GetResourceString(ref Utf8JsonReader json, ExceptionResour } [DoesNotReturn] - public static void ThrowInvalidOperationException(ExceptionResource resource, int currentDepth, byte token, JsonTokenType tokenType) + public static void ThrowInvalidOperationException(ExceptionResource resource, int currentDepth, int maxDepth, byte token, JsonTokenType tokenType) { - throw GetInvalidOperationException(resource, currentDepth, token, tokenType); + throw GetInvalidOperationException(resource, currentDepth, maxDepth, token, tokenType); } [DoesNotReturn] @@ -508,9 +497,9 @@ public static InvalidOperationException GetInvalidOperationException(string mess } [MethodImpl(MethodImplOptions.NoInlining)] - public static InvalidOperationException GetInvalidOperationException(ExceptionResource resource, int currentDepth, byte token, JsonTokenType tokenType) + public static InvalidOperationException GetInvalidOperationException(ExceptionResource resource, int currentDepth, int maxDepth, byte token, JsonTokenType tokenType) { - string message = GetResourceString(resource, currentDepth, token, tokenType); + string message = GetResourceString(resource, currentDepth, maxDepth, token, tokenType); InvalidOperationException ex = GetInvalidOperationException(message); ex.Source = ExceptionSourceValueToRethrowAsJsonException; return ex; @@ -524,7 +513,7 @@ public static void ThrowOutOfMemoryException(uint capacity) // This function will convert an ExceptionResource enum value to the resource string. [MethodImpl(MethodImplOptions.NoInlining)] - private static string GetResourceString(ExceptionResource resource, int currentDepth, byte token, JsonTokenType tokenType) + private static string GetResourceString(ExceptionResource resource, int currentDepth, int maxDepth, byte token, JsonTokenType tokenType) { string message = ""; switch (resource) @@ -536,7 +525,7 @@ private static string GetResourceString(ExceptionResource resource, int currentD SR.Format(SR.MismatchedObjectArray, (char)token); break; case ExceptionResource.DepthTooLarge: - message = SR.Format(SR.DepthTooLarge, currentDepth & JsonConstants.RemoveFlagsBitMask, JsonConstants.MaxWriterDepth); + message = SR.Format(SR.DepthTooLarge, currentDepth & JsonConstants.RemoveFlagsBitMask, maxDepth); break; case ExceptionResource.CannotStartObjectArrayWithoutProperty: message = SR.Format(SR.CannotStartObjectArrayWithoutProperty, tokenType); @@ -563,15 +552,13 @@ private static string GetResourceString(ExceptionResource resource, int currentD return message; } - public static FormatException GetFormatException() + [DoesNotReturn] + public static void ThrowFormatException() { - var ex = new FormatException(); - ex.Source = ExceptionSourceValueToRethrowAsJsonException; - return ex; + throw new FormatException { Source = ExceptionSourceValueToRethrowAsJsonException }; } - [MethodImpl(MethodImplOptions.NoInlining)] - public static FormatException GetFormatException(NumericType numericType) + public static void ThrowFormatException(NumericType numericType) { string message = ""; @@ -615,13 +602,11 @@ public static FormatException GetFormatException(NumericType numericType) break; } - var ex = new FormatException(message); - ex.Source = ExceptionSourceValueToRethrowAsJsonException; - return ex; + throw new FormatException(message) { Source = ExceptionSourceValueToRethrowAsJsonException }; } - [MethodImpl(MethodImplOptions.NoInlining)] - public static FormatException GetFormatException(DataType dateType) + [DoesNotReturn] + public static void ThrowFormatException(DataType dateType) { string message = ""; @@ -653,14 +638,13 @@ public static FormatException GetFormatException(DataType dateType) break; } - var ex = new FormatException(message); - ex.Source = ExceptionSourceValueToRethrowAsJsonException; - return ex; + throw new FormatException(message) { Source = ExceptionSourceValueToRethrowAsJsonException }; } - public static InvalidOperationException GetInvalidOperationException_ExpectedChar(JsonTokenType tokenType) + [DoesNotReturn] + public static void ThrowInvalidOperationException_ExpectedChar(JsonTokenType tokenType) { - return GetInvalidOperationException("char", tokenType); + throw GetInvalidOperationException("char", tokenType); } } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/JsonWriterOptions.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/JsonWriterOptions.cs index 1c60e5939fa469..2d89a261e33535 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/JsonWriterOptions.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/JsonWriterOptions.cs @@ -13,6 +13,9 @@ namespace System.Text.Json /// public struct JsonWriterOptions { + internal const int DefaultMaxDepth = 1000; + + private int _maxDepth; private int _optionsMask; /// @@ -40,6 +43,29 @@ public bool Indented } } + /// + /// Gets or sets the maximum depth allowed when writing JSON, with the default (i.e. 0) indicating a max depth of 1000. + /// + /// + /// Thrown when the max depth is set to a negative value. + /// + /// + /// Reading past this depth will throw a . + /// + public int MaxDepth + { + readonly get => _maxDepth; + set + { + if (value < 0) + { + ThrowHelper.ThrowArgumentOutOfRangeException_MaxDepthMustBePositive(nameof(value)); + } + + _maxDepth = value; + } + } + /// /// Defines whether the should skip structural validation and allow /// the user to write invalid JSON, when set to true. If set to false, any attempts to write invalid JSON will result in diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Bytes.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Bytes.cs index 55d8aaa515deec..7ea9b37514cbaf 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Bytes.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Bytes.cs @@ -276,7 +276,7 @@ private void WriteBase64Minimized(ReadOnlySpan escapedPropertyName, ReadOn private void WriteBase64Indented(ReadOnlySpan escapedPropertyName, ReadOnlySpan bytes) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); int encodedLength = Base64.GetMaxEncodedToUtf8Length(bytes.Length); @@ -326,7 +326,7 @@ private void WriteBase64Indented(ReadOnlySpan escapedPropertyName, ReadOnl private void WriteBase64Indented(ReadOnlySpan escapedPropertyName, ReadOnlySpan bytes) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); int encodedLength = Base64.GetMaxEncodedToUtf8Length(bytes.Length); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.DateTime.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.DateTime.cs index e41427cdcdd8cf..77b8975332cd96 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.DateTime.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.DateTime.cs @@ -278,7 +278,7 @@ private void WriteStringMinimized(ReadOnlySpan escapedPropertyName, DateTi private void WriteStringIndented(ReadOnlySpan escapedPropertyName, DateTime value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - s_newLineLength); @@ -327,7 +327,7 @@ private void WriteStringIndented(ReadOnlySpan escapedPropertyName, DateTim private void WriteStringIndented(ReadOnlySpan escapedPropertyName, DateTime value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - s_newLineLength); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.DateTimeOffset.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.DateTimeOffset.cs index 313496df38c9b9..6b1013d9868ccf 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.DateTimeOffset.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.DateTimeOffset.cs @@ -277,7 +277,7 @@ private void WriteStringMinimized(ReadOnlySpan escapedPropertyName, DateTi private void WriteStringIndented(ReadOnlySpan escapedPropertyName, DateTimeOffset value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - s_newLineLength); @@ -326,7 +326,7 @@ private void WriteStringIndented(ReadOnlySpan escapedPropertyName, DateTim private void WriteStringIndented(ReadOnlySpan escapedPropertyName, DateTimeOffset value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - s_newLineLength); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Decimal.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Decimal.cs index ab98e246fab684..ef2e614549e783 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Decimal.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Decimal.cs @@ -271,7 +271,7 @@ private void WriteNumberMinimized(ReadOnlySpan escapedPropertyName, decima private void WriteNumberIndented(ReadOnlySpan escapedPropertyName, decimal value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatDecimalLength - 5 - s_newLineLength); @@ -317,7 +317,7 @@ private void WriteNumberIndented(ReadOnlySpan escapedPropertyName, decimal private void WriteNumberIndented(ReadOnlySpan escapedPropertyName, decimal value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatDecimalLength - 5 - s_newLineLength); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Double.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Double.cs index 1fb6832ce6ad3f..658267052137a0 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Double.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Double.cs @@ -275,7 +275,7 @@ private void WriteNumberMinimized(ReadOnlySpan escapedPropertyName, double private void WriteNumberIndented(ReadOnlySpan escapedPropertyName, double value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatDoubleLength - 5 - s_newLineLength); @@ -321,7 +321,7 @@ private void WriteNumberIndented(ReadOnlySpan escapedPropertyName, double private void WriteNumberIndented(ReadOnlySpan escapedPropertyName, double value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatDoubleLength - 5 - s_newLineLength); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Float.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Float.cs index 3832dd4c0cebe5..7f85eedf18acb1 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Float.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Float.cs @@ -275,7 +275,7 @@ private void WriteNumberMinimized(ReadOnlySpan escapedPropertyName, float private void WriteNumberIndented(ReadOnlySpan escapedPropertyName, float value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatSingleLength - 5 - s_newLineLength); @@ -321,7 +321,7 @@ private void WriteNumberIndented(ReadOnlySpan escapedPropertyName, float v private void WriteNumberIndented(ReadOnlySpan escapedPropertyName, float value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatSingleLength - 5 - s_newLineLength); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Guid.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Guid.cs index 07ffde8f49278e..5d918437b1cd3e 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Guid.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Guid.cs @@ -279,7 +279,7 @@ private void WriteStringMinimized(ReadOnlySpan escapedPropertyName, Guid v private void WriteStringIndented(ReadOnlySpan escapedPropertyName, Guid value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatGuidLength - 7 - s_newLineLength); @@ -329,7 +329,7 @@ private void WriteStringIndented(ReadOnlySpan escapedPropertyName, Guid va private void WriteStringIndented(ReadOnlySpan escapedPropertyName, Guid value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatGuidLength - 7 - s_newLineLength); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Helpers.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Helpers.cs index 3bcddfd82a2d3e..3ea7aeaa1aaed4 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Helpers.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Helpers.cs @@ -13,22 +13,22 @@ public sealed partial class Utf8JsonWriter [MethodImpl(MethodImplOptions.AggressiveInlining)] private void ValidatePropertyNameAndDepth(ReadOnlySpan propertyName) { - if (propertyName.Length > JsonConstants.MaxCharacterTokenSize || CurrentDepth >= JsonConstants.MaxWriterDepth) - ThrowHelper.ThrowInvalidOperationOrArgumentException(propertyName, _currentDepth); + if (propertyName.Length > JsonConstants.MaxCharacterTokenSize || CurrentDepth >= _options.MaxDepth) + ThrowHelper.ThrowInvalidOperationOrArgumentException(propertyName, _currentDepth, _options.MaxDepth); } [MethodImpl(MethodImplOptions.AggressiveInlining)] private void ValidatePropertyNameAndDepth(ReadOnlySpan utf8PropertyName) { - if (utf8PropertyName.Length > JsonConstants.MaxUnescapedTokenSize || CurrentDepth >= JsonConstants.MaxWriterDepth) - ThrowHelper.ThrowInvalidOperationOrArgumentException(utf8PropertyName, _currentDepth); + if (utf8PropertyName.Length > JsonConstants.MaxUnescapedTokenSize || CurrentDepth >= _options.MaxDepth) + ThrowHelper.ThrowInvalidOperationOrArgumentException(utf8PropertyName, _currentDepth, _options.MaxDepth); } [MethodImpl(MethodImplOptions.AggressiveInlining)] private void ValidateDepth() { - if (CurrentDepth >= JsonConstants.MaxWriterDepth) - ThrowHelper.ThrowInvalidOperationException(_currentDepth); + if (CurrentDepth >= _options.MaxDepth) + ThrowHelper.ThrowInvalidOperationException(_currentDepth, _options.MaxDepth); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -39,7 +39,7 @@ private void ValidateWritingProperty() if (!_inObject || _tokenType == JsonTokenType.PropertyName) { Debug.Assert(_tokenType != JsonTokenType.StartObject); - ThrowHelper.ThrowInvalidOperationException(ExceptionResource.CannotWritePropertyWithinArray, currentDepth: default, token: default, _tokenType); + ThrowHelper.ThrowInvalidOperationException(ExceptionResource.CannotWritePropertyWithinArray, currentDepth: default, maxDepth: _options.MaxDepth, token: default, _tokenType); } } } @@ -52,7 +52,7 @@ private void ValidateWritingProperty(byte token) if (!_inObject || _tokenType == JsonTokenType.PropertyName) { Debug.Assert(_tokenType != JsonTokenType.StartObject); - ThrowHelper.ThrowInvalidOperationException(ExceptionResource.CannotWritePropertyWithinArray, currentDepth: default, token: default, _tokenType); + ThrowHelper.ThrowInvalidOperationException(ExceptionResource.CannotWritePropertyWithinArray, currentDepth: default, maxDepth: _options.MaxDepth, token: default, _tokenType); } UpdateBitStackOnStart(token); } @@ -89,7 +89,7 @@ private void WritePropertyNameMinimized(ReadOnlySpan escapedPropertyName, private void WritePropertyNameIndented(ReadOnlySpan escapedPropertyName, byte token) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - 6 - s_newLineLength); @@ -161,7 +161,7 @@ private void WritePropertyNameMinimized(ReadOnlySpan escapedPropertyName, private void WritePropertyNameIndented(ReadOnlySpan escapedPropertyName, byte token) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - 6 - s_newLineLength); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Literal.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Literal.cs index 9ab0b654cf97da..5525f6fd80c541 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Literal.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.Literal.cs @@ -415,7 +415,7 @@ private void WriteLiteralSection(ReadOnlySpan escapedPropertyNameSection, private void WriteLiteralIndented(ReadOnlySpan escapedPropertyName, ReadOnlySpan value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - value.Length - 5 - s_newLineLength); @@ -461,7 +461,7 @@ private void WriteLiteralIndented(ReadOnlySpan escapedPropertyName, ReadOn private void WriteLiteralIndented(ReadOnlySpan escapedPropertyName, ReadOnlySpan value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - value.Length - 5 - s_newLineLength); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.SignedNumber.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.SignedNumber.cs index 05d45181da0358..e2da3682635cd1 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.SignedNumber.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.SignedNumber.cs @@ -341,7 +341,7 @@ private void WriteNumberMinimized(ReadOnlySpan escapedPropertyName, long v private void WriteNumberIndented(ReadOnlySpan escapedPropertyName, long value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatInt64Length - 5 - s_newLineLength); @@ -387,7 +387,7 @@ private void WriteNumberIndented(ReadOnlySpan escapedPropertyName, long va private void WriteNumberIndented(ReadOnlySpan escapedPropertyName, long value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatInt64Length - 5 - s_newLineLength); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.String.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.String.cs index 38c64b4a400f3b..543afe1c89df71 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.String.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.String.cs @@ -183,7 +183,7 @@ private void WriteStringMinimizedPropertyName(ReadOnlySpan escapedProperty private void WriteStringIndentedPropertyName(ReadOnlySpan escapedPropertyName) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize); Debug.Assert(escapedPropertyName.Length < (int.MaxValue - 5 - indent - s_newLineLength) / JsonConstants.MaxExpansionFactorWhileTranscoding); @@ -374,7 +374,7 @@ private void WriteStringPropertyNameSection(ReadOnlySpan escapedPropertyNa private void WriteStringIndentedPropertyName(ReadOnlySpan escapedPropertyName) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize); Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - 5 - s_newLineLength); @@ -1530,7 +1530,7 @@ private void WriteStringMinimized(ReadOnlySpan escapedPropertyName, ReadOn private void WriteStringIndented(ReadOnlySpan escapedPropertyName, ReadOnlySpan escapedValue) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); Debug.Assert(escapedPropertyName.Length < ((int.MaxValue - 7 - indent - s_newLineLength) / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length); @@ -1580,7 +1580,7 @@ private void WriteStringIndented(ReadOnlySpan escapedPropertyName, ReadOnl private void WriteStringIndented(ReadOnlySpan escapedPropertyName, ReadOnlySpan escapedValue) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - escapedValue.Length - 7 - s_newLineLength); @@ -1631,7 +1631,7 @@ private void WriteStringIndented(ReadOnlySpan escapedPropertyName, ReadOnl private void WriteStringIndented(ReadOnlySpan escapedPropertyName, ReadOnlySpan escapedValue) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 7 - indent - s_newLineLength); @@ -1682,7 +1682,7 @@ private void WriteStringIndented(ReadOnlySpan escapedPropertyName, ReadOnl private void WriteStringIndented(ReadOnlySpan escapedPropertyName, ReadOnlySpan escapedValue) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 7 - indent - s_newLineLength); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.UnsignedNumber.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.UnsignedNumber.cs index b7602d4f481c05..0ca71b89c37d5e 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.UnsignedNumber.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteProperties.UnsignedNumber.cs @@ -350,7 +350,7 @@ private void WriteNumberMinimized(ReadOnlySpan escapedPropertyName, ulong private void WriteNumberIndented(ReadOnlySpan escapedPropertyName, ulong value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatUInt64Length - 5 - s_newLineLength); @@ -396,7 +396,7 @@ private void WriteNumberIndented(ReadOnlySpan escapedPropertyName, ulong v private void WriteNumberIndented(ReadOnlySpan escapedPropertyName, ulong value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatUInt64Length - 5 - s_newLineLength); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Bytes.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Bytes.cs index 07d8077c16c193..fb6376fe4d9691 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Bytes.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Bytes.cs @@ -81,7 +81,7 @@ private void WriteBase64Minimized(ReadOnlySpan bytes) private void WriteBase64Indented(ReadOnlySpan bytes) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); int encodingLength = Base64.GetMaxEncodedToUtf8Length(bytes.Length); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Comment.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Comment.cs index a1ff7d659d7a58..d7696e1fbb09a9 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Comment.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Comment.cs @@ -92,7 +92,7 @@ private void WriteCommentMinimized(ReadOnlySpan value) private void WriteCommentIndented(ReadOnlySpan value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(value.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - 4 - s_newLineLength); @@ -187,7 +187,7 @@ private void WriteCommentMinimized(ReadOnlySpan utf8Value) private void WriteCommentIndented(ReadOnlySpan utf8Value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(utf8Value.Length < int.MaxValue - indent - 4 - s_newLineLength); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.DateTime.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.DateTime.cs index 0d5687c2be4a00..f87753be0ae37d 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.DateTime.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.DateTime.cs @@ -66,7 +66,7 @@ private void WriteStringValueMinimized(DateTime value) private void WriteStringValueIndented(DateTime value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); // 2 quotes, and optionally, 1 list separator and 1-2 bytes for new line int maxRequired = indent + JsonConstants.MaximumFormatDateTimeOffsetLength + 3 + s_newLineLength; diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.DateTimeOffset.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.DateTimeOffset.cs index b92b799217954b..2608606375b396 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.DateTimeOffset.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.DateTimeOffset.cs @@ -67,7 +67,7 @@ private void WriteStringValueMinimized(DateTimeOffset value) private void WriteStringValueIndented(DateTimeOffset value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); // 2 quotes, and optionally, 1 list separator and 1-2 bytes for new line int maxRequired = indent + JsonConstants.MaximumFormatDateTimeOffsetLength + 3 + s_newLineLength; diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Decimal.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Decimal.cs index a30af2e6546ad1..2462b667fe8ba1 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Decimal.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Decimal.cs @@ -63,7 +63,7 @@ private void WriteNumberValueMinimized(decimal value) private void WriteNumberValueIndented(decimal value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); int maxRequired = indent + JsonConstants.MaximumFormatDecimalLength + 1 + s_newLineLength; // Optionally, 1 list separator and 1-2 bytes for new line diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Double.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Double.cs index f8a46a31468ca9..a0989d1c323b98 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Double.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Double.cs @@ -67,7 +67,7 @@ private void WriteNumberValueMinimized(double value) private void WriteNumberValueIndented(double value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); int maxRequired = indent + JsonConstants.MaximumFormatDoubleLength + 1 + s_newLineLength; // Optionally, 1 list separator and 1-2 bytes for new line diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Float.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Float.cs index 2f046d872f6972..e12bab4ac01859 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Float.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Float.cs @@ -67,7 +67,7 @@ private void WriteNumberValueMinimized(float value) private void WriteNumberValueIndented(float value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); int maxRequired = indent + JsonConstants.MaximumFormatSingleLength + 1 + s_newLineLength; // Optionally, 1 list separator and 1-2 bytes for new line diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.FormattedNumber.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.FormattedNumber.cs index 5dfb4e9e8ff484..f9005243fac4c6 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.FormattedNumber.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.FormattedNumber.cs @@ -67,7 +67,7 @@ private void WriteNumberValueMinimized(ReadOnlySpan utf8Value) private void WriteNumberValueIndented(ReadOnlySpan utf8Value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(utf8Value.Length < int.MaxValue - indent - 1 - s_newLineLength); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Guid.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Guid.cs index e9884f744a5812..227af26a3d2c00 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Guid.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Guid.cs @@ -67,7 +67,7 @@ private void WriteStringValueMinimized(Guid value) private void WriteStringValueIndented(Guid value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); // 2 quotes, and optionally, 1 list separator and 1-2 bytes for new line int maxRequired = indent + JsonConstants.MaximumFormatGuidLength + 3 + s_newLineLength; diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Helpers.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Helpers.cs index d95817a638e85f..731e62867f2cbe 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Helpers.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Helpers.cs @@ -19,7 +19,7 @@ private void ValidateWritingValue() if (_tokenType != JsonTokenType.PropertyName) { Debug.Assert(_tokenType != JsonTokenType.None && _tokenType != JsonTokenType.StartArray); - ThrowHelper.ThrowInvalidOperationException(ExceptionResource.CannotWriteValueWithinObject, currentDepth: default, token: default, _tokenType); + ThrowHelper.ThrowInvalidOperationException(ExceptionResource.CannotWriteValueWithinObject, currentDepth: default, maxDepth: _options.MaxDepth, token: default, _tokenType); } } else @@ -29,7 +29,7 @@ private void ValidateWritingValue() // It is more likely for CurrentDepth to not equal 0 when writing valid JSON, so check that first to rely on short-circuiting and return quickly. if (CurrentDepth == 0 && _tokenType != JsonTokenType.None) { - ThrowHelper.ThrowInvalidOperationException(ExceptionResource.CannotWriteValueAfterPrimitiveOrClose, currentDepth: default, token: default, _tokenType); + ThrowHelper.ThrowInvalidOperationException(ExceptionResource.CannotWriteValueAfterPrimitiveOrClose, currentDepth: default, maxDepth: _options.MaxDepth, token: default, _tokenType); } } } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Literal.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Literal.cs index c5beb15ae3f1db..b4bcc5b480246c 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Literal.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Literal.cs @@ -86,7 +86,7 @@ private void WriteLiteralMinimized(ReadOnlySpan utf8Value) private void WriteLiteralIndented(ReadOnlySpan utf8Value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(utf8Value.Length <= 5); int maxRequired = indent + utf8Value.Length + 1 + s_newLineLength; // Optionally, 1 list separator and 1-2 bytes for new line diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.SignedNumber.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.SignedNumber.cs index 2d6120a6a87680..dd47dfe230550f 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.SignedNumber.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.SignedNumber.cs @@ -76,7 +76,7 @@ private void WriteNumberValueMinimized(long value) private void WriteNumberValueIndented(long value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); int maxRequired = indent + JsonConstants.MaximumFormatInt64Length + 1 + s_newLineLength; // Optionally, 1 list separator and 1-2 bytes for new line diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.String.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.String.cs index b4be2dfe8b3bb3..6513d001930b77 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.String.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.String.cs @@ -143,7 +143,7 @@ private void WriteStringMinimized(ReadOnlySpan escapedValue) private void WriteStringIndented(ReadOnlySpan escapedValue) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedValue.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - 3 - s_newLineLength); @@ -290,7 +290,7 @@ private void WriteStringMinimized(ReadOnlySpan escapedValue) private void WriteStringIndented(ReadOnlySpan escapedValue) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(escapedValue.Length < int.MaxValue - indent - 3 - s_newLineLength); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.UnsignedNumber.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.UnsignedNumber.cs index d3cf96947db468..a348c125c8172c 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.UnsignedNumber.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.UnsignedNumber.cs @@ -78,7 +78,7 @@ private void WriteNumberValueMinimized(ulong value) private void WriteNumberValueIndented(ulong value) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); int maxRequired = indent + JsonConstants.MaximumFormatUInt64Length + 1 + s_newLineLength; // Optionally, 1 list separator and 1-2 bytes for new line diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.cs index 17e08065a39f91..084b7c65c6350c 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.cs @@ -103,6 +103,11 @@ public Utf8JsonWriter(IBufferWriter bufferWriter, JsonWriterOptions option { _output = bufferWriter ?? throw new ArgumentNullException(nameof(bufferWriter)); _options = options; + + if (_options.MaxDepth == 0) + { + _options.MaxDepth = JsonWriterOptions.DefaultMaxDepth; // If max depth is not set, revert to the default depth. + } } /// @@ -124,6 +129,12 @@ public Utf8JsonWriter(Stream utf8Json, JsonWriterOptions options = default) _stream = utf8Json; _options = options; + + if (_options.MaxDepth == 0) + { + _options.MaxDepth = JsonWriterOptions.DefaultMaxDepth; // If max depth is not set, revert to the default depth. + } + _arrayBufferWriter = new ArrayBufferWriter(); } @@ -426,8 +437,8 @@ public void WriteStartObject() private void WriteStart(byte token) { - if (CurrentDepth >= JsonConstants.MaxWriterDepth) - ThrowHelper.ThrowInvalidOperationException(ExceptionResource.DepthTooLarge, _currentDepth, token: default, tokenType: default); + if (CurrentDepth >= _options.MaxDepth) + ThrowHelper.ThrowInvalidOperationException(ExceptionResource.DepthTooLarge, _currentDepth, _options.MaxDepth, token: default, tokenType: default); if (_options.IndentedOrNotSkipValidation) { @@ -486,7 +497,7 @@ private void ValidateStart() if (_tokenType != JsonTokenType.PropertyName) { Debug.Assert(_tokenType != JsonTokenType.None && _tokenType != JsonTokenType.StartArray); - ThrowHelper.ThrowInvalidOperationException(ExceptionResource.CannotStartObjectArrayWithoutProperty, currentDepth: default, token: default, _tokenType); + ThrowHelper.ThrowInvalidOperationException(ExceptionResource.CannotStartObjectArrayWithoutProperty, currentDepth: default, maxDepth: _options.MaxDepth, token: default, _tokenType); } } else @@ -497,7 +508,7 @@ private void ValidateStart() // It is more likely for CurrentDepth to not equal 0 when writing valid JSON, so check that first to rely on short-circuiting and return quickly. if (CurrentDepth == 0 && _tokenType != JsonTokenType.None) { - ThrowHelper.ThrowInvalidOperationException(ExceptionResource.CannotStartObjectArrayAfterPrimitiveOrClose, currentDepth: default, token: default, _tokenType); + ThrowHelper.ThrowInvalidOperationException(ExceptionResource.CannotStartObjectArrayAfterPrimitiveOrClose, currentDepth: default, maxDepth: _options.MaxDepth, token: default, _tokenType); } } } @@ -505,7 +516,7 @@ private void ValidateStart() private void WriteStartIndented(byte token) { int indent = Indentation; - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); int minRequired = indent + 1; // 1 start token int maxRequired = minRequired + 3; // Optionally, 1 list separator and 1-2 bytes for new line @@ -898,14 +909,14 @@ private void WriteEndSlow(byte token) private void ValidateEnd(byte token) { if (_bitStack.CurrentDepth <= 0 || _tokenType == JsonTokenType.PropertyName) - ThrowHelper.ThrowInvalidOperationException(ExceptionResource.MismatchedObjectArray, currentDepth: default, token, _tokenType); + ThrowHelper.ThrowInvalidOperationException(ExceptionResource.MismatchedObjectArray, currentDepth: default, maxDepth: _options.MaxDepth, token, _tokenType); if (token == JsonConstants.CloseBracket) { if (_inObject) { Debug.Assert(_tokenType != JsonTokenType.None); - ThrowHelper.ThrowInvalidOperationException(ExceptionResource.MismatchedObjectArray, currentDepth: default, token, _tokenType); + ThrowHelper.ThrowInvalidOperationException(ExceptionResource.MismatchedObjectArray, currentDepth: default, maxDepth: _options.MaxDepth, token, _tokenType); } } else @@ -914,7 +925,7 @@ private void ValidateEnd(byte token) if (!_inObject) { - ThrowHelper.ThrowInvalidOperationException(ExceptionResource.MismatchedObjectArray, currentDepth: default, token, _tokenType); + ThrowHelper.ThrowInvalidOperationException(ExceptionResource.MismatchedObjectArray, currentDepth: default, maxDepth: _options.MaxDepth, token, _tokenType); } } @@ -940,7 +951,7 @@ private void WriteEndIndented(byte token) indent -= JsonConstants.SpacesPerIndent; } - Debug.Assert(indent <= 2 * JsonConstants.MaxWriterDepth); + Debug.Assert(indent <= 2 * _options.MaxDepth); Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.None); int maxRequired = indent + 3; // 1 end token, 1-2 bytes for new line diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/ContextClasses.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/ContextClasses.cs index 24559eb6c86a54..fcb3dc91a886c3 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/ContextClasses.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/ContextClasses.cs @@ -46,6 +46,7 @@ public interface ITestContext public JsonTypeInfo StructWithCustomConverterPropertyFactory { get; } public JsonTypeInfo ClassWithBadCustomConverter { get; } public JsonTypeInfo StructWithBadCustomConverter { get; } + public JsonTypeInfo NullablePersonStruct { get; } } internal partial class JsonContext : JsonSerializerContext diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MetadataAndSerializationContextTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MetadataAndSerializationContextTests.cs index 81513b46499a70..99eecd14cd7ee1 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MetadataAndSerializationContextTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MetadataAndSerializationContextTests.cs @@ -40,6 +40,7 @@ namespace System.Text.Json.SourceGeneration.Tests [JsonSerializable(typeof(StructWithCustomConverterPropertyFactory))] [JsonSerializable(typeof(ClassWithBadCustomConverter))] [JsonSerializable(typeof(StructWithBadCustomConverter))] + [JsonSerializable(typeof(PersonStruct?))] internal partial class MetadataAndSerializationContext : JsonSerializerContext, ITestContext { public JsonSourceGenerationMode JsonSourceGenerationMode => JsonSourceGenerationMode.Default; @@ -85,6 +86,8 @@ public override void EnsureFastPathGeneratedAsExpected() Assert.NotNull(MetadataAndSerializationContext.Default.StructWithCustomConverterPropertyFactory); Assert.Throws(() => MetadataAndSerializationContext.Default.ClassWithBadCustomConverter); Assert.Throws(() => MetadataAndSerializationContext.Default.StructWithBadCustomConverter); + Assert.Null(MetadataAndSerializationContext.Default.NullablePersonStruct.SerializeHandler); + Assert.NotNull(MetadataAndSerializationContext.Default.PersonStruct.SerializeHandler); } } } diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MetadataContextTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MetadataContextTests.cs index f83a2fc923421b..6aaaf82d48ef6d 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MetadataContextTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MetadataContextTests.cs @@ -39,6 +39,7 @@ namespace System.Text.Json.SourceGeneration.Tests [JsonSerializable(typeof(StructWithCustomConverterPropertyFactory), GenerationMode = JsonSourceGenerationMode.Metadata)] [JsonSerializable(typeof(ClassWithBadCustomConverter), GenerationMode = JsonSourceGenerationMode.Metadata)] [JsonSerializable(typeof(StructWithBadCustomConverter), GenerationMode = JsonSourceGenerationMode.Metadata)] + [JsonSerializable(typeof(PersonStruct?), GenerationMode = JsonSourceGenerationMode.Metadata)] internal partial class MetadataWithPerTypeAttributeContext : JsonSerializerContext, ITestContext { public JsonSourceGenerationMode JsonSourceGenerationMode => JsonSourceGenerationMode.Metadata; @@ -83,6 +84,8 @@ public override void EnsureFastPathGeneratedAsExpected() Assert.Null(MetadataWithPerTypeAttributeContext.Default.StructWithCustomConverterPropertyFactory.SerializeHandler); Assert.Throws(() => MetadataWithPerTypeAttributeContext.Default.ClassWithBadCustomConverter.SerializeHandler); Assert.Throws(() => MetadataWithPerTypeAttributeContext.Default.StructWithBadCustomConverter.SerializeHandler); + Assert.Null(MetadataWithPerTypeAttributeContext.Default.NullablePersonStruct.SerializeHandler); + Assert.Null(MetadataWithPerTypeAttributeContext.Default.PersonStruct.SerializeHandler); } } @@ -120,6 +123,7 @@ public override void EnsureFastPathGeneratedAsExpected() [JsonSerializable(typeof(StructWithCustomConverterPropertyFactory))] [JsonSerializable(typeof(ClassWithBadCustomConverter))] [JsonSerializable(typeof(StructWithBadCustomConverter))] + [JsonSerializable(typeof(PersonStruct?))] internal partial class MetadataContext : JsonSerializerContext, ITestContext { public JsonSourceGenerationMode JsonSourceGenerationMode => JsonSourceGenerationMode.Metadata; @@ -187,6 +191,8 @@ public override void EnsureFastPathGeneratedAsExpected() Assert.Null(MetadataContext.Default.StructWithCustomConverterPropertyFactory.SerializeHandler); Assert.Throws(() => MetadataContext.Default.ClassWithBadCustomConverter.SerializeHandler); Assert.Throws(() => MetadataContext.Default.StructWithBadCustomConverter.SerializeHandler); + Assert.Null(MetadataContext.Default.NullablePersonStruct.SerializeHandler); + Assert.Null(MetadataContext.Default.PersonStruct.SerializeHandler); } [Fact] diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MixedModeContextTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MixedModeContextTests.cs index 060db030bcadab..988ab86027b576 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MixedModeContextTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MixedModeContextTests.cs @@ -40,6 +40,7 @@ namespace System.Text.Json.SourceGeneration.Tests [JsonSerializable(typeof(StructWithCustomConverterPropertyFactory), GenerationMode = JsonSourceGenerationMode.Metadata | JsonSourceGenerationMode.Serialization)] [JsonSerializable(typeof(ClassWithBadCustomConverter), GenerationMode = JsonSourceGenerationMode.Metadata | JsonSourceGenerationMode.Serialization)] [JsonSerializable(typeof(StructWithBadCustomConverter), GenerationMode = JsonSourceGenerationMode.Metadata | JsonSourceGenerationMode.Serialization)] + [JsonSerializable(typeof(PersonStruct?), GenerationMode = JsonSourceGenerationMode.Metadata | JsonSourceGenerationMode.Serialization)] internal partial class MixedModeContext : JsonSerializerContext, ITestContext { public JsonSourceGenerationMode JsonSourceGenerationMode => JsonSourceGenerationMode.Metadata | JsonSourceGenerationMode.Serialization; @@ -85,6 +86,8 @@ public override void EnsureFastPathGeneratedAsExpected() Assert.Null(MixedModeContext.Default.StructWithCustomConverterPropertyFactory.SerializeHandler); Assert.Throws(() => MixedModeContext.Default.ClassWithBadCustomConverter.SerializeHandler); Assert.Throws(() => MixedModeContext.Default.StructWithBadCustomConverter.SerializeHandler); + Assert.Null(MixedModeContext.Default.NullablePersonStruct.SerializeHandler); + Assert.NotNull(MixedModeContext.Default.PersonStruct.SerializeHandler); } [Fact] diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/RealWorldContextTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/RealWorldContextTests.cs index ee891562fffee7..9df6dd24533336 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/RealWorldContextTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/RealWorldContextTests.cs @@ -399,7 +399,8 @@ protected static ActiveOrUpcomingEvent CreateActiveOrUpcomingEvent() EndDate = DateTime.UtcNow.AddYears(1), Name = "Just a name", ImageUrl = "https://www.dotnetfoundation.org/theme/img/carousel/foundation-diagram-content.png", - StartDate = DateTime.UtcNow + StartDate = DateTime.UtcNow, + Offset = TimeSpan.FromHours(2) }; } @@ -864,5 +865,22 @@ public void PropertyOrdering() string json = JsonSerializer.Serialize(obj, DefaultContext.MyTypeWithPropertyOrdering); Assert.Equal("{\"C\":0,\"B\":0,\"A\":0}", json); } + + [Fact] + public virtual void NullableStruct() + { + PersonStruct? person = new() + { + FirstName = "Jane", + LastName = "Doe" + }; + + string json = JsonSerializer.Serialize(person, DefaultContext.NullablePersonStruct); + JsonTestHelper.AssertJsonEqual(@"{""FirstName"":""Jane"",""LastName"":""Doe""}", json); + + person = JsonSerializer.Deserialize(json, DefaultContext.NullablePersonStruct); + Assert.Equal("Jane", person.Value.FirstName); + Assert.Equal("Doe", person.Value.LastName); + } } } diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/SerializationContextTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/SerializationContextTests.cs index 57f663e8b36339..147cae5e46dc7d 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/SerializationContextTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/SerializationContextTests.cs @@ -40,6 +40,7 @@ namespace System.Text.Json.SourceGeneration.Tests [JsonSerializable(typeof(StructWithCustomConverterPropertyFactory))] [JsonSerializable(typeof(ClassWithBadCustomConverter))] [JsonSerializable(typeof(StructWithBadCustomConverter))] + [JsonSerializable(typeof(PersonStruct?))] internal partial class SerializationContext : JsonSerializerContext, ITestContext { public JsonSourceGenerationMode JsonSourceGenerationMode => JsonSourceGenerationMode.Serialization; @@ -78,6 +79,7 @@ internal partial class SerializationContext : JsonSerializerContext, ITestContex [JsonSerializable(typeof(StructWithCustomConverterPropertyFactory), GenerationMode = JsonSourceGenerationMode.Serialization)] [JsonSerializable(typeof(ClassWithBadCustomConverter), GenerationMode = JsonSourceGenerationMode.Serialization)] [JsonSerializable(typeof(StructWithBadCustomConverter), GenerationMode = JsonSourceGenerationMode.Serialization)] + [JsonSerializable(typeof(PersonStruct?), GenerationMode = JsonSourceGenerationMode.Serialization)] internal partial class SerializationWithPerTypeAttributeContext : JsonSerializerContext, ITestContext { public JsonSourceGenerationMode JsonSourceGenerationMode => JsonSourceGenerationMode.Serialization; @@ -117,6 +119,7 @@ internal partial class SerializationWithPerTypeAttributeContext : JsonSerializer [JsonSerializable(typeof(StructWithCustomConverterPropertyFactory), GenerationMode = JsonSourceGenerationMode.Serialization)] [JsonSerializable(typeof(ClassWithBadCustomConverter), GenerationMode = JsonSourceGenerationMode.Serialization)] [JsonSerializable(typeof(StructWithBadCustomConverter), GenerationMode = JsonSourceGenerationMode.Serialization)] + [JsonSerializable(typeof(PersonStruct?), GenerationMode = JsonSourceGenerationMode.Serialization)] internal partial class SerializationContextWithCamelCase : JsonSerializerContext, ITestContext { public JsonSourceGenerationMode JsonSourceGenerationMode => JsonSourceGenerationMode.Serialization; @@ -164,6 +167,8 @@ public override void EnsureFastPathGeneratedAsExpected() Assert.Null(SerializationContext.Default.StructWithCustomConverterProperty.SerializeHandler); Assert.Throws(() => SerializationContext.Default.ClassWithBadCustomConverter.SerializeHandler); Assert.Throws(() => SerializationContext.Default.StructWithBadCustomConverter.SerializeHandler); + Assert.Null(SerializationContext.Default.NullablePersonStruct.SerializeHandler); + Assert.NotNull(SerializationContext.Default.PersonStruct.SerializeHandler); } [Fact] @@ -431,6 +436,21 @@ public void OnSerializeCallbacks() Assert.Equal("{\"MyProperty\":\"Before\"}", json); Assert.Equal("After", obj.MyProperty); } + + [Fact] + public override void NullableStruct() + { + PersonStruct? person = new() + { + FirstName = "Jane", + LastName = "Doe" + }; + + string json = JsonSerializer.Serialize(person, DefaultContext.NullablePersonStruct); + JsonTestHelper.AssertJsonEqual(@"{""FirstName"":""Jane"",""LastName"":""Doe""}", json); + + Assert.Throws(() => JsonSerializer.Deserialize(json, DefaultContext.NullablePersonStruct)); + } } public sealed class SerializationWithPerTypeAttributeContextTests : SerializationContextTests @@ -470,6 +490,8 @@ public override void EnsureFastPathGeneratedAsExpected() Assert.Null(SerializationWithPerTypeAttributeContext.Default.StructWithCustomConverterPropertyFactory.SerializeHandler); Assert.Throws(() => SerializationWithPerTypeAttributeContext.Default.ClassWithBadCustomConverter.SerializeHandler); Assert.Throws(() => SerializationWithPerTypeAttributeContext.Default.StructWithBadCustomConverter.SerializeHandler); + Assert.Null(SerializationWithPerTypeAttributeContext.Default.NullablePersonStruct.SerializeHandler); + Assert.NotNull(SerializationWithPerTypeAttributeContext.Default.PersonStruct.SerializeHandler); } } } diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/SerializationLogicTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/SerializationLogicTests.cs index 2bfb07086eecd9..99b1282d1e9482 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/SerializationLogicTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/SerializationLogicTests.cs @@ -5,6 +5,7 @@ using System.IO; using System.Text.Encodings.Web; using System.Text.Json.Serialization; +using System.Text.Json.Serialization.Metadata; using Xunit; namespace System.Text.Json.SourceGeneration.Tests @@ -123,5 +124,70 @@ public static void WriterIsFlushedAtRootCall() Assert.Equal(18, writer.BytesCommitted); Assert.Equal(0, writer.BytesPending); } + + [Fact] + public static void FastPathInvokedForNullableUnderlyingType() + { + PersonStruct? person = new() + { + FirstName = "Jane", + LastName = "Doe" + }; + + NullablePersonContext context = new(); + Assert.False(context.FastPathCalled); + string json = JsonSerializer.Serialize(person, context.NullablePersonStruct); + Assert.True(context.FastPathCalled); + JsonTestHelper.AssertJsonEqual(@"{""FirstName"":""Jane"",""LastName"":""Doe""}", json); + } + + internal partial class NullablePersonContext : JsonSerializerContext + { + private static JsonSerializerOptions s_options = new JsonSerializerOptions(); + + public bool FastPathCalled { get; private set; } + + public NullablePersonContext() : base(s_options) + { + } + + protected override JsonSerializerOptions? GeneratedSerializerOptions => s_options; + + public JsonTypeInfo NullablePersonStruct => + JsonMetadataServices.CreateValueInfo(s_options, JsonMetadataServices.GetNullableConverter(underlyingTypeInfo: PersonStruct)); + + public JsonTypeInfo PersonStruct + { + get + { + var objectInfo = new JsonObjectInfoValues() + { + ObjectCreator = static () => new PersonStruct(), + SerializeHandler = PersonStructSerializeHandler + }; + + return JsonMetadataServices.CreateObjectInfo(s_options, objectInfo); + } + } + + private void PersonStructSerializeHandler(Utf8JsonWriter writer, PersonStruct value) + { + FastPathCalled = true; + writer.WriteStartObject(); + writer.WriteString("FirstName", value.FirstName); + writer.WriteString("LastName", value.LastName); + writer.WriteEndObject(); + } + + public override JsonTypeInfo? GetTypeInfo(Type type) + { + if (type == typeof(PersonStruct)) + { + return PersonStruct; + } + + return null; + } + } } } diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/TestClasses.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/TestClasses.cs index 887f65b80da83b..29e76ec6e15605 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/TestClasses.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/TestClasses.cs @@ -60,6 +60,7 @@ public class ActiveOrUpcomingEvent public string Description { get; set; } public DateTimeOffset StartDate { get; set; } public DateTimeOffset EndDate { get; set; } + public TimeSpan Offset { get; set; } } public class CampaignSummaryViewModel @@ -151,4 +152,10 @@ public class JsonMessage } internal struct MyStruct { } + + public struct PersonStruct + { + public string FirstName { get; set; } + public string LastName { get; set; } + } } diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs index b84c518275ffc5..8e3105e119238e 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs @@ -336,22 +336,32 @@ public partial class MyJsonContext : JsonSerializerContext return CreateCompilation(source); } - internal static void CheckDiagnosticMessages(ImmutableArray diagnostics, DiagnosticSeverity level, string[] expectedMessages) + internal static void CheckDiagnosticMessages( + DiagnosticSeverity level, + ImmutableArray diagnostics, + (Location Location, string Message)[] expectedDiags, + bool sort = true) { - string[] actualMessages = diagnostics.Where(diagnostic => diagnostic.Severity == level).Select(diagnostic => diagnostic.GetMessage()).ToArray(); + (Location Location, string Message)[] actualDiags = diagnostics + .Where(diagnostic => diagnostic.Severity == level) + .Select(diagnostic => (diagnostic.Location, diagnostic.GetMessage())) + .ToArray(); - // Can't depend on reflection order when generating type metadata. - Array.Sort(actualMessages); - Array.Sort(expectedMessages); + if (sort) + { + // Can't depend on reflection order when generating type metadata. + Array.Sort(actualDiags); + Array.Sort(expectedDiags); + } if (CultureInfo.CurrentUICulture.Name.StartsWith("en", StringComparison.OrdinalIgnoreCase)) { - Assert.Equal(expectedMessages, actualMessages); + Assert.Equal(expectedDiags, actualDiags); } else { // for non-English runs, just compare the number of messages are the same - Assert.Equal(expectedMessages.Length, actualMessages.Length); + Assert.Equal(expectedDiags.Length, actualDiags.Length); } } } diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorDiagnosticsTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorDiagnosticsTests.cs index a25196a34fe074..d3378b84f2f83a 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorDiagnosticsTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorDiagnosticsTests.cs @@ -1,7 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Collections.Generic; +using System.Linq; using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.Text; using Xunit; namespace System.Text.Json.SourceGeneration.UnitTests @@ -9,7 +12,7 @@ namespace System.Text.Json.SourceGeneration.UnitTests public class JsonSourceGeneratorDiagnosticsTests { [Fact] - [ActiveIssue("Figure out issue with CampaignSummaryViewModel namespace.")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/58226", TestPlatforms.Browser)] public void SuccessfulSourceGeneration() { // Compile the referenced assembly first. @@ -26,10 +29,13 @@ public void SuccessfulSourceGeneration() using System.Text.Json.Serialization; using ReferencedAssembly; - [assembly: JsonSerializable(typeof(JsonSourceGenerator.IndexViewModel)] - namespace JsonSourceGenerator { + [JsonSerializable(typeof(JsonSourceGenerator.IndexViewModel)] + public partial class JsonContext : JsonSerializerContext + { + } + public class IndexViewModel { public List ActiveOrUpcomingEvents { get; set; } @@ -50,78 +56,88 @@ public class IndexViewModel CompilationHelper.RunGenerators(compilation, out var generatorDiags, generator); - // Expected info logs. - string[] expectedInfoDiagnostics = new string[] { - "Generated serialization metadata for type System.Collections.Generic.List", - "Generated serialization metadata for type System.Int32", - "Generated serialization metadata for type System.String", - "Generated serialization metadata for type System.DateTimeOffset", - "Generated serialization metadata for type System.Boolean", - "Generated serialization metadata for type ReferencedAssembly.ActiveOrUpcomingEvent", - "Generated serialization metadata for type ReferencedAssembly.CampaignSummaryViewModel", - "Generated serialization metadata for type JsonSourceGenerator.IndexViewModel", - }; - - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Info, expectedInfoDiagnostics); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Warning, new string[] { }); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Error, new string[] { }); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Info, generatorDiags, Array.Empty<(Location, string)>()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Warning, generatorDiags, Array.Empty<(Location, string)>()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Error, generatorDiags, Array.Empty<(Location, string)>()); } [Fact] - [ActiveIssue("Figure out issue with CampaignSummaryViewModel namespace.")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/58226", TestPlatforms.Browser)] public void UnsuccessfulSourceGeneration() { - // Compile the referenced assembly first. - Compilation campaignCompilation = CompilationHelper.CreateCampaignSummaryViewModelCompilation(); - Compilation eventCompilation = CompilationHelper.CreateActiveOrUpcomingEventCompilation(); + static void RunTest(bool explicitRef) + { + // Compile the referenced assembly first. + Compilation campaignCompilation = CompilationHelper.CreateCampaignSummaryViewModelCompilation(); + Compilation eventCompilation = CompilationHelper.CreateActiveOrUpcomingEventCompilation(); - // Emit the image of the referenced assembly. - byte[] campaignImage = CompilationHelper.CreateAssemblyImage(campaignCompilation); - byte[] eventImage = CompilationHelper.CreateAssemblyImage(eventCompilation); + // Emit the image of the referenced assembly. + byte[] campaignImage = CompilationHelper.CreateAssemblyImage(campaignCompilation); + byte[] eventImage = CompilationHelper.CreateAssemblyImage(eventCompilation); - // Main source for current compilation. - string source = @" + string optionalAttribute = explicitRef ? "[JsonSerializable(typeof(ActiveOrUpcomingEvent[,])]" : null; + + // Main source for current compilation. + string source = @$" using System.Collections.Generic; using System.Text.Json.Serialization; using ReferencedAssembly; - [assembly: JsonSerializable(typeof(JsonSourceGenerator.IndexViewModel)] - namespace JsonSourceGenerator - { + {{ + {optionalAttribute} + [JsonSerializable(typeof(JsonSourceGenerator.IndexViewModel)] + public partial class JsonContext : JsonSerializerContext + {{ + }} + public class IndexViewModel - { - public ISet ActiveOrUpcomingEvents { get; set; } - public CampaignSummaryViewModel FeaturedCampaign { get; set; } - public bool IsNewAccount { get; set; } + {{ + public ActiveOrUpcomingEvent[,] ActiveOrUpcomingEvents {{ get; set; }} + public CampaignSummaryViewModel FeaturedCampaign {{ get; set; }} + public bool IsNewAccount {{ get; set; }} public bool HasFeaturedCampaign => FeaturedCampaign != null; - } - }"; + }} + }}"; - MetadataReference[] additionalReferences = { + MetadataReference[] additionalReferences = { MetadataReference.CreateFromImage(campaignImage), MetadataReference.CreateFromImage(eventImage), }; - Compilation compilation = CompilationHelper.CreateCompilation(source, additionalReferences); + Compilation compilation = CompilationHelper.CreateCompilation(source, additionalReferences); - JsonSourceGenerator generator = new JsonSourceGenerator(); + JsonSourceGenerator generator = new JsonSourceGenerator(); + CompilationHelper.RunGenerators(compilation, out var generatorDiags, generator); - CompilationHelper.RunGenerators(compilation, out var generatorDiags, generator); + Location location; + if (explicitRef) + { + // Unsupported type is not in compiling assembly, but is indicated directly with [JsonSerializable], so location points to attribute application. + INamedTypeSymbol symbol = (INamedTypeSymbol)compilation.GetSymbolsWithName("JsonContext").FirstOrDefault(); + SyntaxReference syntaxReference = symbol.GetAttributes().First().ApplicationSyntaxReference; + TextSpan textSpan = syntaxReference.Span; + location = syntaxReference.SyntaxTree.GetLocation(textSpan)!; + } + else + { + // Unsupported type is not in compiling assembly, and isn't indicated directly with [JsonSerializable], so location points to context type. + location = compilation.GetSymbolsWithName("JsonContext").First().Locations[0]; + } - // Expected success info logs. - string[] expectedInfoDiagnostics = new string[] { - "Generated serialization metadata for type JsonSourceGeneration.IndexViewModel", - "Generated serialization metadata for type System.Boolean", - "Generated serialization metadata for type ReferencedAssembly.CampaignSummaryViewModel" - }; + // Expected warning logs. + (Location, string)[] expectedWarningDiagnostics = new (Location, string)[] + { + (location, "Did not generate serialization metadata for type 'global::ReferencedAssembly.ActiveOrUpcomingEvent[]'.") + }; - // Expected warning logs. - string[] expectedWarningDiagnostics = new string[] { "Did not generate serialization metadata for type System.Collections.Generic.ISet" }; + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Info, generatorDiags, Array.Empty<(Location, string)>()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Warning, generatorDiags, expectedWarningDiagnostics); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Error, generatorDiags, Array.Empty<(Location, string)>()); + } - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Info, expectedInfoDiagnostics); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Warning, expectedWarningDiagnostics); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Error, new string[] { }); + RunTest(explicitRef: true); + RunTest(false); } [Fact] @@ -133,20 +149,28 @@ public void NameClashSourceGeneration() JsonSourceGenerator generator = new JsonSourceGenerator(); CompilationHelper.RunGenerators(compilation, out var generatorDiags, generator); - string[] expectedWarningDiagnostics = new string[] { "There are multiple types named Location. Source was generated for the first one detected. Use 'JsonSerializableAttribute.TypeInfoPropertyName' to resolve this collision." }; + INamedTypeSymbol symbol = (INamedTypeSymbol)compilation.GetSymbolsWithName("JsonContext").FirstOrDefault(); + SyntaxReference syntaxReference = new List(symbol.GetAttributes())[1].ApplicationSyntaxReference; + TextSpan textSpan = syntaxReference.Span; + Location location = syntaxReference.SyntaxTree.GetLocation(textSpan)!; + + (Location, string)[] expectedWarningDiagnostics = new (Location, string)[] + { + (location, "There are multiple types named Location. Source was generated for the first one detected. Use 'JsonSerializableAttribute.TypeInfoPropertyName' to resolve this collision.") + }; - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Info, Array.Empty()); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Warning, expectedWarningDiagnostics); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Error, Array.Empty()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Info, generatorDiags, Array.Empty<(Location, string)>()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Warning, generatorDiags, expectedWarningDiagnostics); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Error, generatorDiags, Array.Empty<(Location, string)>()); // With resolution. compilation = CompilationHelper.CreateRepeatedLocationsWithResolutionCompilation(); generator = new JsonSourceGenerator(); CompilationHelper.RunGenerators(compilation, out generatorDiags, generator); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Info, Array.Empty()); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Warning, Array.Empty()); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Error, Array.Empty()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Info, generatorDiags, Array.Empty<(Location, string)>()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Warning, generatorDiags, Array.Empty<(Location, string)>()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Error, generatorDiags, Array.Empty<(Location, string)>()); } [Fact] @@ -156,41 +180,40 @@ public void ProgramsThatDontUseGeneratorCompile() // No STJ usage. string source = @"using System; -public class Program -{ - public static void Main() - { - Console.WriteLine(""Hello World""); - - } -} -"; + public class Program + { + public static void Main() + { + Console.WriteLine(""Hello World""); + } + } + "; Compilation compilation = CompilationHelper.CreateCompilation(source); JsonSourceGenerator generator = new JsonSourceGenerator(); CompilationHelper.RunGenerators(compilation, out var generatorDiags, generator); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Info, Array.Empty()); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Warning, Array.Empty()); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Error, Array.Empty()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Info, generatorDiags, Array.Empty<(Location, string)>()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Warning, generatorDiags, Array.Empty<(Location, string)>()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Error, generatorDiags, Array.Empty<(Location, string)>()); // With STJ usage. source = @"using System.Text.Json; -public class Program -{ - public static void Main() - { - JsonSerializer.Serialize(""Hello World""); - } -} -"; + public class Program + { + public static void Main() + { + JsonSerializer.Serialize(""Hello World""); + } + } + "; compilation = CompilationHelper.CreateCompilation(source); generator = new JsonSourceGenerator(); CompilationHelper.RunGenerators(compilation, out generatorDiags, generator); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Info, Array.Empty()); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Warning, Array.Empty()); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Error, Array.Empty()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Info, generatorDiags, Array.Empty<(Location, string)>()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Warning, generatorDiags, Array.Empty<(Location, string)>()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Error, generatorDiags, Array.Empty<(Location, string)>()); } [Fact] @@ -201,11 +224,16 @@ public void WarnOnClassesWithInitOnlyProperties() JsonSourceGenerator generator = new JsonSourceGenerator(); CompilationHelper.RunGenerators(compilation, out var generatorDiags, generator); - string[] expectedWarningDiagnostics = new string[] { "The type 'Location' defines init-only properties, deserialization of which is currently not supported in source generation mode." }; + Location location = compilation.GetSymbolsWithName("Id").First().Locations[0]; - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Info, Array.Empty()); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Warning, expectedWarningDiagnostics); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Error, Array.Empty()); + (Location, string)[] expectedWarningDiagnostics = new (Location, string)[] + { + (location, "The type 'Location' defines init-only properties, deserialization of which is currently not supported in source generation mode.") + }; + + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Info, generatorDiags, Array.Empty<(Location, string)>()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Warning, generatorDiags, expectedWarningDiagnostics); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Error, generatorDiags, Array.Empty<(Location, string)>()); } [Fact] @@ -216,16 +244,20 @@ public void WarnOnClassesWithInaccessibleJsonIncludeProperties() JsonSourceGenerator generator = new JsonSourceGenerator(); CompilationHelper.RunGenerators(compilation, out var generatorDiags, generator); - string[] expectedWarningDiagnostics = new string[] + Location idLocation = compilation.GetSymbolsWithName("Id").First().Locations[0]; + Location address2Location = compilation.GetSymbolsWithName("Address2").First().Locations[0]; + Location countryLocation = compilation.GetSymbolsWithName("Country").First().Locations[0]; + + (Location, string)[] expectedWarningDiagnostics = new (Location, string)[] { - "The member 'Location.Id' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.", - "The member 'Location.Address2' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.", - "The member 'Location.Country' has been annotated with the JsonIncludeAttribute but is not visible to the source generator." + (idLocation, "The member 'Location.Id' has been annotated with the JsonIncludeAttribute but is not visible to the source generator."), + (address2Location, "The member 'Location.Address2' has been annotated with the JsonIncludeAttribute but is not visible to the source generator."), + (countryLocation, "The member 'Location.Country' has been annotated with the JsonIncludeAttribute but is not visible to the source generator.") }; - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Info, Array.Empty()); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Warning, expectedWarningDiagnostics); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Error, Array.Empty()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Info, generatorDiags, Array.Empty<(Location, string)>()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Warning, generatorDiags, expectedWarningDiagnostics, sort: false); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Error, generatorDiags, Array.Empty<(Location, string)>()); } } } diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs index 08519e16fde39b..2cb749bb40bc69 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Collections.Immutable; -using System.IO; using System.Linq; using System.Reflection; using Microsoft.CodeAnalysis; @@ -70,7 +69,7 @@ public void UsePrivates() Assert.Equal("HelloWorld.MyType", myType.FullName); // Check for received fields, properties and methods in created type. - string[] expectedPropertyNames = { "PublicPropertyInt", "PublicPropertyString",}; + string[] expectedPropertyNames = { "PublicPropertyInt", "PublicPropertyString", }; string[] expectedFieldNames = { "PublicChar", "PublicDouble" }; string[] expectedMethodNames = { "get_PrivatePropertyInt", "get_PrivatePropertyString", "get_PublicPropertyInt", "get_PublicPropertyString", "MyMethod", "MySecondMethod", "set_PrivatePropertyInt", "set_PrivatePropertyString", "set_PublicPropertyInt", "set_PublicPropertyString", "UsePrivates" }; CheckFieldsPropertiesMethods(myType, expectedFieldNames, expectedPropertyNames, expectedMethodNames); @@ -245,7 +244,7 @@ public void UsePrivates() string[] expectedPropertyNamesNotMyType = { "Address1", "Address2", "City", "Country", "Id", "Name", "PhoneNumber", "PostalCode", "State" }; string[] expectedMethodNamesNotMyType = { "get_Address1", "get_Address2", "get_City", "get_Country", "get_Id", "get_Name", "get_PhoneNumber", "get_PostalCode", "get_State", "set_Address1", "set_Address2", "set_City", "set_Country", "set_Id", "set_Name", "set_PhoneNumber", "set_PostalCode", "set_State" }; - CheckFieldsPropertiesMethods(notMyType, expectedFieldNamesNotMyType, expectedPropertyNamesNotMyType, expectedMethodNamesNotMyType ); + CheckFieldsPropertiesMethods(notMyType, expectedFieldNamesNotMyType, expectedPropertyNamesNotMyType, expectedMethodNamesNotMyType); } [Theory] @@ -291,9 +290,9 @@ public JsonSerializableAttribute(Type type) { } Assert.Null(types); } - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Info, Array.Empty()); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Warning, Array.Empty()); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Error, Array.Empty()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Info, generatorDiags, Array.Empty<(Location, string)>()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Warning, generatorDiags, Array.Empty<(Location, string)>()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Error, generatorDiags, Array.Empty<(Location, string)>()); } [Theory] @@ -323,9 +322,9 @@ public JsonSerializableAttribute(string typeInfoPropertyName, Type type) { } CompilationHelper.RunGenerators(compilation, out ImmutableArray generatorDiags, generator); Assert.Null(generator.GetSerializableTypes()); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Info, Array.Empty()); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Warning, Array.Empty()); - CompilationHelper.CheckDiagnosticMessages(generatorDiags, DiagnosticSeverity.Error, Array.Empty()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Info, generatorDiags, Array.Empty<(Location, string)>()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Warning, generatorDiags, Array.Empty<(Location, string)>()); + CompilationHelper.CheckDiagnosticMessages(DiagnosticSeverity.Error, generatorDiags, Array.Empty<(Location, string)>()); } [Fact] diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonNode/JsonArrayTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonNode/JsonArrayTests.cs index 3464791348acf1..68abbe1fd16572 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonNode/JsonArrayTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonNode/JsonArrayTests.cs @@ -377,7 +377,7 @@ public static void NullHandling() } [Fact] - public static void AccesingNestedJsonArray() + public static void AccessingNestedJsonArray() { var issues = new JsonObject { diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonWriterOptionsTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonWriterOptionsTests.cs index 2674a2e992c871..41a6c5c203a917 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonWriterOptionsTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonWriterOptionsTests.cs @@ -15,7 +15,8 @@ public static void JsonWriterOptionsDefaultCtor() var expectedOption = new JsonWriterOptions { Indented = false, - SkipValidation = false + SkipValidation = false, + MaxDepth = 0, }; Assert.Equal(expectedOption, options); } @@ -28,28 +29,40 @@ public static void JsonWriterOptionsCtor() var expectedOption = new JsonWriterOptions { Indented = false, - SkipValidation = false + SkipValidation = false, + MaxDepth = 0, }; Assert.Equal(expectedOption, options); } [Theory] - [InlineData(true, true)] - [InlineData(true, false)] - [InlineData(false, true)] - [InlineData(false, false)] - public static void JsonWriterOptions(bool indented, bool skipValidation) + [InlineData(true, true, 0)] + [InlineData(true, false, 1)] + [InlineData(false, true, 1024)] + [InlineData(false, false, 1024 * 1024)] + public static void JsonWriterOptions(bool indented, bool skipValidation, int maxDepth) { var options = new JsonWriterOptions(); options.Indented = indented; options.SkipValidation = skipValidation; + options.MaxDepth = maxDepth; var expectedOption = new JsonWriterOptions { Indented = indented, - SkipValidation = skipValidation + SkipValidation = skipValidation, + MaxDepth = maxDepth, }; Assert.Equal(expectedOption, options); } + + [Theory] + [InlineData(-1)] + [InlineData(-100)] + public static void JsonWriterOptions_MaxDepth_InvalidParameters(int maxDepth) + { + var options = new JsonWriterOptions(); + Assert.Throws(() => options.MaxDepth = maxDepth); + } } } diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/Object.ReadTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/Object.ReadTests.cs index 6a36e96d3818b9..090e91f49f37d2 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/Object.ReadTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/Object.ReadTests.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Text.Json.Nodes; using Xunit; namespace System.Text.Json.Serialization.Tests @@ -655,5 +656,21 @@ public static void TooLittleJsonFails(string json) Assert.Equal(0, reader.BytesConsumed); } + + // Regression test for https://github.com/dotnet/runtime/issues/61995 + [Theory] + [InlineData(JsonUnknownTypeHandling.JsonElement, typeof(JsonElement))] + [InlineData(JsonUnknownTypeHandling.JsonNode, typeof(JsonNode))] + public static void ReadObjectWithNumberHandling(JsonUnknownTypeHandling unknownTypeHandling, Type expectedType) + { + var options = new JsonSerializerOptions + { + NumberHandling = JsonNumberHandling.AllowReadingFromString, + UnknownTypeHandling = unknownTypeHandling + }; + + object result = JsonSerializer.Deserialize(@"{ ""key"" : ""42"" }", options); + Assert.IsAssignableFrom(expectedType, result); + } } } diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/Object.WriteTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/Object.WriteTests.cs index d4e551d6d01b25..d2000d649acc0b 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/Object.WriteTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/Object.WriteTests.cs @@ -138,5 +138,13 @@ public static void EscapingShouldntStackOverflow() Assert.Equal("{\"name\":\"\u6D4B\u8A6611\"}", result); } + + // Regression test for https://github.com/dotnet/runtime/issues/61995 + [Fact] + public static void WriteObjectWithNumberHandling() + { + var options = new JsonSerializerOptions { NumberHandling = JsonNumberHandling.AllowReadingFromString }; + JsonSerializer.Serialize(new object(), options); + } } } diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/OptionsTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/OptionsTests.cs index f7d80c2a01e63c..b034f232f35c67 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/OptionsTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/OptionsTests.cs @@ -512,6 +512,28 @@ public static void CopyConstructor_NullInput() Assert.Contains("options", ex.ToString()); } + [Fact] + public static void JsonSerializerOptions_Default_MatchesDefaultConstructor() + { + var options = new JsonSerializerOptions(); + JsonSerializerOptions optionsSingleton = JsonSerializerOptions.Default; + VerifyOptionsEqual(options, optionsSingleton); + } + + [Fact] + public static void JsonSerializerOptions_Default_ReturnsSameInstance() + { + Assert.Same(JsonSerializerOptions.Default, JsonSerializerOptions.Default); + } + + [Fact] + public static void JsonSerializerOptions_Default_IsReadOnly() + { + var optionsSingleton = JsonSerializerOptions.Default; + Assert.Throws(() => optionsSingleton.IncludeFields = true); + Assert.Throws(() => optionsSingleton.Converters.Add(new JsonStringEnumConverter())); + } + [Fact] public static void DefaultSerializerOptions_General() { @@ -542,7 +564,7 @@ private static JsonSerializerOptions GetFullyPopulatedOptionsInstance() { var options = new JsonSerializerOptions(); - foreach (PropertyInfo property in typeof(JsonSerializerOptions).GetProperties()) + foreach (PropertyInfo property in typeof(JsonSerializerOptions).GetProperties(BindingFlags.Public | BindingFlags.Instance)) { Type propertyType = property.PropertyType; @@ -596,7 +618,7 @@ private static JsonSerializerOptions GetFullyPopulatedOptionsInstance() private static void VerifyOptionsEqual(JsonSerializerOptions options, JsonSerializerOptions newOptions) { - foreach (PropertyInfo property in typeof(JsonSerializerOptions).GetProperties()) + foreach (PropertyInfo property in typeof(JsonSerializerOptions).GetProperties(BindingFlags.Public | BindingFlags.Instance)) { Type propertyType = property.PropertyType; diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ReadValueTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ReadValueTests.cs index c29c4010391614..e7eb6f5b314a4d 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ReadValueTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ReadValueTests.cs @@ -673,7 +673,7 @@ public static void TooLittleJsonForIntArray(string json) // From https://github.com/dotnet/runtime/issues/882 [Fact] - public static void OptionsFollowToConverter() + public static void OptionsFlowToConverter() { var builder = new StringBuilder(); builder.Append("{\"type\": \"array\", \"array\": "); diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/WriteValueTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/WriteValueTests.cs index ceb0e33fe8e1be..66b89f1c151f80 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/WriteValueTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/WriteValueTests.cs @@ -393,5 +393,71 @@ public static void SerializeExceedMaximumBufferSize() Assert.Throws(() => JsonSerializer.Serialize(temp, typeof(CustomClassToExceedMaxBufferSize))); } + + [Theory] + [InlineData(0)] + [InlineData(10)] + [InlineData(500)] + public static void MaxDepthFlowsToConverter(int maxDepth) + { + var converter = new InstrumentedConverter(); + var options = new JsonSerializerOptions { Converters = { converter }, MaxDepth = maxDepth }; + int effectiveMaxDepth = maxDepth == 0 ? 64 : maxDepth; + + JsonSerializer.Serialize(value: 42, options); + + Assert.Equal(effectiveMaxDepth, converter.WriterOptions.MaxDepth); + } + + private class InstrumentedConverter : JsonConverter + { + public JsonWriterOptions WriterOptions { get; private set; } + + public override int Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => throw new NotImplementedException(); + public override void Write(Utf8JsonWriter writer, int value, JsonSerializerOptions options) + { + WriterOptions = writer.Options; + writer.WriteNumberValue(value); + } + } + + [Theory] + [InlineData(0)] + [InlineData(1)] + [InlineData(10)] + [InlineData(100)] + public static void CustomMaxDepth_DepthWithinLimit_Succeeds(int maxDepth) + { + var options = new JsonSerializerOptions { MaxDepth = maxDepth }; + int effectiveMaxDepth = maxDepth == 0 ? 64 : maxDepth; + + Peano? value = Peano.CreateFromNumber(effectiveMaxDepth); + JsonSerializer.Serialize(value, options); + } + + [Theory] + [InlineData(0)] + [InlineData(1)] + [InlineData(10)] + [InlineData(100)] + public static void CustomMaxDepth_DepthExceedsLimit_Fails(int maxDepth) + { + var options = new JsonSerializerOptions { MaxDepth = maxDepth }; + int effectiveMaxDepth = maxDepth == 0 ? 64 : maxDepth; + + Peano value = Peano.CreateFromNumber(effectiveMaxDepth + 1); + JsonException exn = Assert.Throws(() => JsonSerializer.Serialize(value, options)); + Assert.Contains("A possible object cycle was detected", exn.Message); + } + + public class Peano + { + public Peano? Successor { get; init; } + + public static Peano? CreateFromNumber(int value) + { + return value == 0 ? null : new Peano { Successor = CreateFromNumber(value - 1) }; + } + } } } diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonWriterTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonWriterTests.cs index f18f23a64f3c6e..01701471c0f14e 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonWriterTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonWriterTests.cs @@ -2911,6 +2911,59 @@ public void WritingTooDeepProperty(bool formatted, bool skipValidation) } } + [Theory] + [InlineData(0)] + [InlineData(1)] + [InlineData(10)] + [InlineData(2048)] + [InlineData(1024 * 1024)] + public static void CustomMaxDepth_DepthWithinLimit_ShouldSucceed(int maxDepth) + { + var options = new JsonWriterOptions { MaxDepth = maxDepth }; + int effectiveMaxDepth = maxDepth == 0 ? 1000 : maxDepth; + + var output = new ArrayBufferWriter(); + using var writer = new Utf8JsonWriter(output, options); + + for (int i = 0; i < effectiveMaxDepth; i++) + { + writer.WriteStartArray(); + } + + Assert.Equal(effectiveMaxDepth, writer.CurrentDepth); + + for (int i = 0; i < effectiveMaxDepth; i++) + { + writer.WriteEndArray(); + } + + Assert.Equal(0, writer.CurrentDepth); + } + + [Theory] + [InlineData(0)] + [InlineData(1)] + [InlineData(10)] + [InlineData(2048)] + [InlineData(1024 * 1024)] + public static void CustomMaxDepth_DepthExceedingLimit_ShouldFail(int maxDepth) + { + var options = new JsonWriterOptions { MaxDepth = maxDepth }; + int effectiveMaxDepth = maxDepth == 0 ? 1000 : maxDepth; + + var output = new ArrayBufferWriter(); + using var writer = new Utf8JsonWriter(output, options); + + for (int i = 0; i < effectiveMaxDepth; i++) + { + writer.WriteStartArray(); + } + + Assert.Equal(effectiveMaxDepth, writer.CurrentDepth); + + Assert.Throws(() => writer.WriteStartArray()); + } + // NOTE: WritingTooLargeProperty test is constrained to run on Windows and MacOSX because it causes // problems on Linux due to the way deferred memory allocation works. On Linux, the allocation can // succeed even if there is not enough memory but then the test may get killed by the OOM killer at the diff --git a/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Emitter.cs b/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Emitter.cs index 41fed7b6907134..44493b4b591085 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Emitter.cs +++ b/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Emitter.cs @@ -139,11 +139,6 @@ private static void EmitRegexMethod(IndentedTextWriter writer, RegexMethod rm, s writer.WriteLine(); writer.WriteLine($" private {id}()"); writer.WriteLine($" {{"); -#if DEBUG - writer.WriteLine(" /*"); - writer.WriteLine($"{rm.Code.Tree.ToString().Replace("*/", @"* /")}"); - writer.WriteLine(" */"); -#endif writer.WriteLine($" base.pattern = {patternExpression};"); writer.WriteLine($" base.roptions = {optionsExpression};"); writer.WriteLine($" base.internalMatchTimeout = {timeoutExpression};"); @@ -186,6 +181,16 @@ private static void EmitRegexMethod(IndentedTextWriter writer, RegexMethod rm, s // Main implementation methods writer.WriteLine($" protected override void InitTrackCount() => base.runtrackcount = {rm.Code.TrackCount};"); writer.WriteLine(); +#if DEBUG + writer.WriteLine(" // Node tree:"); + var treeLineReader = new StringReader(rm.Code.Tree.ToString()); + string? treeLine = null; + while ((treeLine = treeLineReader.ReadLine()) != null) + { + writer.WriteLine($" // {treeLine}"); + } + writer.WriteLine(); +#endif writer.WriteLine($" protected override bool FindFirstChar()"); writer.WriteLine($" {{"); writer.Indent += 4; @@ -231,10 +236,8 @@ private static void EmitFindFirstChar(IndentedTextWriter writer, RegexMethod rm, { RegexOptions options = (RegexOptions)rm.Options; RegexCode code = rm.Code; - (string CharClass, bool CaseInsensitive)[]? lcc = code.LeadingCharClasses; bool rtl = code.RightToLeft; bool hasTextInfo = false; - bool textInfoEmitted = false; // Emit locals initialization writer.WriteLine("string runtext = base.runtext!;"); @@ -267,34 +270,52 @@ private static void EmitFindFirstChar(IndentedTextWriter writer, RegexMethod rm, }; using (EmitBlock(writer, clause)) { - EmitAnchors(); - - if (code.BoyerMoorePrefix is RegexBoyerMoore { NegativeUnicode: null } rbm) + // Emit any anchors. + if (!EmitAnchors()) { - if (rbm.PatternSupportsIndexOf) - { - EmitIndexOf(rbm.Pattern); - } - else - { - EmitBoyerMoore(rbm); - } - } - else if (lcc is not null) - { - if (rtl) - { - EmitLeadingCharacter_RightToLeft(); - } - else + // Either anchors weren't specified, or they don't completely root all matches to a specific location. + + // If whatever search operation we need to perform entails case-insensitive operations + // that weren't already handled via creation of sets, we need to get an store the + // TextInfo object to use (unless RegexOptions.CultureInvariant was specified). + EmitTextInfo(writer, ref hasTextInfo, rm); + + // Emit the code for whatever find mode has been determined. + switch (code.FindOptimizations.FindMode) { - EmitLeadingCharacter_LeftToRight(); + case FindNextStartingPositionMode.LeadingPrefix_LeftToRight_CaseSensitive: + Debug.Assert(!string.IsNullOrEmpty(code.FindOptimizations.LeadingCaseSensitivePrefix)); + EmitIndexOf_LeftToRight(code.FindOptimizations.LeadingCaseSensitivePrefix); + break; + + case FindNextStartingPositionMode.LeadingPrefix_RightToLeft_CaseSensitive: + Debug.Assert(!string.IsNullOrEmpty(code.FindOptimizations.LeadingCaseSensitivePrefix)); + EmitIndexOf_RightToLeft(code.FindOptimizations.LeadingCaseSensitivePrefix); + break; + + case FindNextStartingPositionMode.FixedSets_LeftToRight_CaseSensitive: + case FindNextStartingPositionMode.FixedSets_LeftToRight_CaseInsensitive: + case FindNextStartingPositionMode.LeadingSet_LeftToRight_CaseSensitive: + case FindNextStartingPositionMode.LeadingSet_LeftToRight_CaseInsensitive: + Debug.Assert(code.FindOptimizations.FixedDistanceSets is { Count: > 0 }); + EmitFixedSet_LeftToRight(); + break; + + case FindNextStartingPositionMode.LeadingSet_RightToLeft_CaseSensitive: + case FindNextStartingPositionMode.LeadingSet_RightToLeft_CaseInsensitive: + Debug.Assert(code.FindOptimizations.FixedDistanceSets is { Count: > 0 }); + EmitFixedSet_RightToLeft(); + break; + + default: + Debug.Fail($"Unexpected mode: {code.FindOptimizations.FindMode}"); + goto case FindNextStartingPositionMode.NoSearch; + + case FindNextStartingPositionMode.NoSearch: + writer.WriteLine("return true;"); + break; } } - else - { - writer.WriteLine("return true;"); - } } writer.WriteLine(); @@ -303,15 +324,15 @@ private static void EmitFindFirstChar(IndentedTextWriter writer, RegexMethod rm, writer.WriteLine(!rm.Code.RightToLeft ? "base.runtextpos = runtextend;" : "base.runtextpos = runtextbeg;"); writer.WriteLine("return false;"); - void EmitAnchors() + // Emits any anchors. Returns true if the anchor roots any match to a specific location and thus no further + // searching is required; otherwise, false. + bool EmitAnchors() { // Generate anchor checks. - if ((code.LeadingAnchor & (RegexPrefixAnalyzer.Beginning | RegexPrefixAnalyzer.Start | RegexPrefixAnalyzer.EndZ | RegexPrefixAnalyzer.End | RegexPrefixAnalyzer.Bol)) != 0) + if ((code.FindOptimizations.LeadingAnchor & (RegexPrefixAnalyzer.Beginning | RegexPrefixAnalyzer.Start | RegexPrefixAnalyzer.EndZ | RegexPrefixAnalyzer.End | RegexPrefixAnalyzer.Bol)) != 0) { - // TODO: RegexInterpreter also factors in a Boyer-Moore prefix check in places Compiled just returns true. - // Determine if we should do so here and in Compiled as well, and potentially update RegexInterpreter. - // Interpreted and Compiled also differ in various places as to whether they update positions, as do LTR vs RTL. Determine why. - switch (code.LeadingAnchor) + // TODO: Interpreted and Compiled differ in various places as to whether they update positions, as do LTR vs RTL. Determine why. + switch (code.FindOptimizations.LeadingAnchor) { case RegexPrefixAnalyzer.Beginning: writer.WriteLine("// Beginning \\A anchor"); @@ -331,7 +352,7 @@ void EmitAnchors() } } writer.WriteLine("return true;"); - return; + return true; case RegexPrefixAnalyzer.Start: writer.WriteLine("// Start \\G anchor"); @@ -351,7 +372,7 @@ void EmitAnchors() } } writer.WriteLine("return true;"); - return; + return true; case RegexPrefixAnalyzer.EndZ: // TODO: Why are the LTR and RTL cases inconsistent here with RegexOptions.Compiled? @@ -372,9 +393,9 @@ void EmitAnchors() } } writer.WriteLine("return true;"); - return; + return true; - case RegexPrefixAnalyzer.End when minRequiredLength == 0: // if it's > 0, we already output a more stringent check + case RegexPrefixAnalyzer.End: writer.WriteLine("// End \\z anchor"); if (!rtl) { @@ -391,14 +412,14 @@ void EmitAnchors() } } writer.WriteLine("return true;"); - return; + return true; - case RegexPrefixAnalyzer.Bol when !rtl: // Don't bother optimizing for the niche case of RegexOptions.RightToLeft | RegexOptions.Multiline + case RegexPrefixAnalyzer.Bol: // Optimize the handling of a Beginning-Of-Line (BOL) anchor. BOL is special, in that unlike // other anchors like Beginning, there are potentially multiple places a BOL can match. So unlike // the other anchors, which all skip all subsequent processing if found, with BOL we just use it - // to boost our position to the next line, and then continue normally with any Boyer-Moore or - // leading char class searches. + // to boost our position to the next line, and then continue normally with any searches. + Debug.Assert(!rtl, "RightToLeft isn't implemented and should have been filtered out previously"); writer.WriteLine("// Beginning-of-line anchor"); using (EmitBlock(writer, "if (runtextpos > runtextbeg && runtext[runtextpos - 1] != '\\n')")) { @@ -413,131 +434,12 @@ void EmitAnchors() break; } } - } - - void EmitBoyerMoore(RegexBoyerMoore rbm) - { - EmitTextInfoIfRequired(writer, ref textInfoEmitted, ref hasTextInfo, rm); - - int beforefirst; - int last; - if (!rtl) - { - //limitLocal = "runtextend"; - beforefirst = -1; - last = rbm.Pattern.Length - 1; - } - else - { - //limitLocal = "runtextbeg"; - beforefirst = rbm.Pattern.Length; - last = 0; - } - - int chLast = rbm.Pattern[last]; - - EmitAdd(writer, "runtextpos", !rtl ? rbm.Pattern.Length - 1 : -rbm.Pattern.Length); - - using (EmitBlock(writer, $"while ({(!rtl ? "runtextpos < runtextend" : "runtextpos >= runtextbeg")})")) - { - writer.WriteLine($"ch = {ToLowerIfNeeded(hasTextInfo, options, "runtext[runtextpos]", rbm.CaseInsensitive)};"); - - using (EmitBlock(writer, $"if (ch != {Literal((char)chLast)})")) - { - writer.WriteLine($"ch -= {Literal((char)rbm.LowASCII)};"); - using (EmitBlock(writer, $"if ((uint)ch > ({Literal((char)rbm.HighASCII)} - {Literal((char)rbm.LowASCII)}))")) - { - EmitAdd(writer, "runtextpos", (!rtl ? rbm.Pattern.Length : -rbm.Pattern.Length)); - writer.WriteLine("continue;"); - } - - int negativeRange = rbm.HighASCII - rbm.LowASCII + 1; - if (negativeRange > 1) // High > Low - { - // Create a string to store the lookup table we use to find the offset. - // Store the offsets into the string. RightToLeft has negative offsets, so to support it with chars (unsigned), we negate - // the values to be stored in the string, and then at run time after looking up the offset in the string, negate it again. - Debug.Assert(rbm.Pattern.Length <= char.MaxValue, "RegexBoyerMoore should have limited the size allowed."); - Span span = new char[negativeRange]; - for (int i = 0; i < span.Length; i++) - { - int offset = rbm.NegativeASCII[i + rbm.LowASCII]; - if (offset == beforefirst) - { - offset = rbm.Pattern.Length; - } - else if (rtl) - { - offset = -offset; - } - Debug.Assert(offset >= 0 && offset <= char.MaxValue); - span[i] = (char)offset; - } - - writer.WriteLine($"runtextpos {(rtl ? "-=" : "+=")} {Literal(span.ToString())}[ch];"); - } - else - { - Debug.Assert(negativeRange == 1); // High == Low - int offset = rbm.NegativeASCII[rbm.LowASCII]; - if (offset == beforefirst) - { - offset = rtl ? -rbm.Pattern.Length : rbm.Pattern.Length; - } - EmitAdd(writer, "runtextpos", offset); - } - writer.WriteLine("continue;"); - } - writer.WriteLine(); - writer.WriteLine("int test = runtextpos;"); - writer.WriteLine(); - for (int i = rbm.Pattern.Length - 2; i >= 0; i--) - { - int charIndex = !rtl ? i : rbm.Pattern.Length - 1 - i; - bool sameAsPrev = i < rbm.Pattern.Length - 2 && rbm.Positive[charIndex] == rbm.Positive[!rtl ? i + 1 : rbm.Pattern.Length - 1 - (i + 1)]; - bool sameAsNext = i > 0 && rbm.Positive[charIndex] == rbm.Positive[!rtl ? i - 1 : rbm.Pattern.Length - 1 - (i - 1)]; - - string condition = $"{ToLowerIfNeeded(hasTextInfo, options, (!rtl ? "runtext[--test]" : "runtext[++test]"), rbm.CaseInsensitive && RegexCharClass.ParticipatesInCaseConversion(rbm.Pattern[charIndex]))} != {Literal(rbm.Pattern[charIndex])}"; - switch ((sameAsPrev, sameAsNext)) - { - case (true, true): - writer.WriteLine($" {condition} ||"); - break; - - case (false, true): - writer.WriteLine($"if ({condition} ||"); - break; - - case (true, false): - writer.WriteLine($" {condition})"); - using (EmitBlock(writer, null)) - { - EmitAdd(writer, "runtextpos", rbm.Positive[charIndex]); - writer.WriteLine("continue;"); - } - writer.WriteLine(); - break; - - case (false, false): - using (EmitBlock(writer, $"if ({condition})")) - { - EmitAdd(writer, "runtextpos", rbm.Positive[charIndex]); - writer.WriteLine("continue;"); - } - writer.WriteLine(); - break; - } - } - - writer.WriteLine(!rtl ? - "base.runtextpos = test;" : - "base.runtextpos = test + 1;"); - writer.WriteLine("return true;"); - } + return false; } - void EmitIndexOf(string prefix) + // Emits a case-sensitive left-to-right prefix search for a string at the beginning of the pattern. + void EmitIndexOf_LeftToRight(string prefix) { writer.WriteLine($"int i = global::System.MemoryExtensions.IndexOf(global::System.MemoryExtensions.AsSpan(runtext, runtextpos, runtextend - runtextpos), {Literal(prefix)});"); writer.WriteLine("if (i >= 0)"); @@ -547,87 +449,89 @@ void EmitIndexOf(string prefix) writer.WriteLine("}"); } - void EmitLeadingCharacter_RightToLeft() + // Emits a case-sensitive right-to-left prefix search for a string at the beginning of the pattern. + void EmitIndexOf_RightToLeft(string prefix) { - EmitTextInfoIfRequired(writer, ref textInfoEmitted, ref hasTextInfo, rm); + writer.WriteLine($"int i = global::System.MemoryExtensions.LastIndexOf(global::System.MemoryExtensions.AsSpan(runtext, runtextbeg, runtextpos - runtextbeg), {Literal(prefix)});"); + writer.WriteLine("if (i >= 0)"); + writer.WriteLine("{"); + writer.WriteLine($" base.runtextpos = runtextbeg + i + {prefix.Length};"); + writer.WriteLine(" return true;"); + writer.WriteLine("}"); + } - Debug.Assert(lcc.Length == 1, "Only the FirstChars and not MultiFirstChars computation is supported for RightToLeft"); - string set = lcc[0].CharClass; - if (RegexCharClass.IsSingleton(set)) + // Emits a right-to-left search for a set at a fixed position from the start of the pattern. + // (Currently that position will always be a distance of 0, meaning the start of the pattern itself.) + void EmitFixedSet_RightToLeft() + { + (char[]? Chars, string Set, int Distance, bool CaseInsensitive) set = code.FindOptimizations.FixedDistanceSets![0]; + Debug.Assert(set.Distance == 0); + + if (set.Chars is { Length: 1 } && !set.CaseInsensitive) { - char ch = RegexCharClass.SingletonChar(set); - using (EmitBlock(writer, "for (int i = runtextpos - 1; i >= runtextbeg; i--)")) - { - using (EmitBlock(writer, $"if (runtext[i] == {ToLowerIfNeeded(hasTextInfo, options, Literal(ch), lcc[0].CaseInsensitive)})")) - { - writer.WriteLine("base.runtextpos = i + 1;"); - writer.WriteLine("return true;"); - } - } + writer.WriteLine($"int i = global::System.MemoryExtensions.LastIndexOf(global::System.MemoryExtensions.AsSpan(runtext, runtextbeg, runtextpos - runtextbeg), {Literal(set.Chars[0])});"); + writer.WriteLine("if (i >= 0)"); + writer.WriteLine("{"); + writer.WriteLine(" base.runtextpos = runtextbeg + i + 1;"); + writer.WriteLine(" return true;"); + writer.WriteLine("}"); } else { using (EmitBlock(writer, "for (int i = runtextpos - 1; i >= runtextbeg; i--)")) { - using (EmitBlock(writer, $"if ({MatchCharacterClass(hasTextInfo, options, "runtext[i]", set, lcc[0].CaseInsensitive)})")) + using (EmitBlock(writer, $"if ({MatchCharacterClass(hasTextInfo, options, "runtext[i]", set.Set, set.CaseInsensitive)})")) { - writer.WriteLine("runtextpos = i + 1;"); + writer.WriteLine("base.runtextpos = i + 1;"); writer.WriteLine("return true;"); } } } } - void EmitLeadingCharacter_LeftToRight() + // Emits a left-to-right search for a set at a fixed position from the start of the pattern, + // and potentially other sets at other fixed positions in the pattern. + void EmitFixedSet_LeftToRight() { - Debug.Assert(lcc is not null && lcc.Length > 0); - - // If minRequiredLength > 0, we already output a more stringent check. In the rare case - // where we were unable to get an accurate enough min required length to ensure it's larger - // than the prefixes we calculated, we also need to ensure we have enough space for those, - // as they also represent a min required length. - if (minRequiredLength < lcc.Length) - { - writer.WriteLine($"// Validate at least {lcc.Length} characters are available to match"); - string endExpr = lcc.Length > 1 ? $"runtextend - {lcc.Length - 1}" : "runtextend"; - using (EmitBlock(writer, $"if (runtextpos >= {endExpr})")) - { - writer.WriteLine("goto ReturnFalse;"); - } - writer.WriteLine(); - } - - writer.WriteLine("global::System.ReadOnlySpan span = global::System.MemoryExtensions.AsSpan(runtext, runtextpos, runtextend - runtextpos);"); + List<(char[]? Chars, string Set, int Distance, bool CaseInsensitive)>? sets = code.FindOptimizations.FixedDistanceSets; + (char[]? Chars, string Set, int Distance, bool CaseInsensitive) primarySet = sets![0]; + const int MaxSets = 4; + int setsToUse = Math.Min(sets.Count, MaxSets); // If we can use IndexOf{Any}, try to accelerate the skip loop via vectorization to match the first prefix. // We can use it if this is a case-sensitive class with a small number of characters in the class. - Span setChars = stackalloc char[3]; // up to 3 characters handled by IndexOf{Any} below - int setCharsCount = 0, charClassIndex = 0; - bool canUseIndexOf = - !lcc[0].CaseInsensitive && - (setCharsCount = RegexCharClass.GetSetChars(lcc[0].CharClass, setChars)) > 0 && - !RegexCharClass.IsNegated(lcc[0].CharClass); - bool needLoop = !canUseIndexOf || lcc.Length > 1; + int setIndex = 0; + bool canUseIndexOf = !primarySet.CaseInsensitive && primarySet.Chars is not null; + bool needLoop = !canUseIndexOf || setsToUse > 1; FinishEmitScope loopBlock = default; if (needLoop) { - EmitTextInfoIfRequired(writer, ref textInfoEmitted, ref hasTextInfo, rm); - writer.WriteLine(); - string upperBound = lcc.Length > 1 ? $"span.Length - {lcc.Length - 1}" : "span.Length"; + writer.WriteLine("global::System.ReadOnlySpan span = global::System.MemoryExtensions.AsSpan(runtext, runtextpos, runtextend - runtextpos);"); + string upperBound = "span.Length" + (setsToUse > 1 || primarySet.Distance != 0 ? $" - {minRequiredLength - 1}" : ""); loopBlock = EmitBlock(writer, $"for (int i = 0; i < {upperBound}; i++)"); } if (canUseIndexOf) { - charClassIndex = 1; + string span = needLoop ? + "span" : + "global::System.MemoryExtensions.AsSpan(runtext, runtextpos, runtextend - runtextpos)"; + + span = (needLoop, primarySet.Distance) switch + { + (false, 0) => span, + (true, 0) => $"{span}.Slice(i)", + (false, _) => $"{span}.Slice({primarySet.Distance})", + (true, _) => $"{span}.Slice(i + {primarySet.Distance})", + }; - string span = needLoop ? "span.Slice(i)" : "span"; - string indexOf = setCharsCount switch + string indexOf = primarySet.Chars!.Length switch { - 1 => $"global::System.MemoryExtensions.IndexOf({span}, {Literal(setChars[0])})", - 2 => $"global::System.MemoryExtensions.IndexOfAny({span}, {Literal(setChars[0])}, {Literal(setChars[1])})", - _ => $"global::System.MemoryExtensions.IndexOfAny({span}, {Literal(setChars[0])}, {Literal(setChars[1])}, {Literal(setChars[2])})", + 1 => $"global::System.MemoryExtensions.IndexOf({span}, {Literal(primarySet.Chars[0])})", + 2 => $"global::System.MemoryExtensions.IndexOfAny({span}, {Literal(primarySet.Chars[0])}, {Literal(primarySet.Chars[1])})", + 3 => $"global::System.MemoryExtensions.IndexOfAny({span}, {Literal(primarySet.Chars[0])}, {Literal(primarySet.Chars[1])}, {Literal(primarySet.Chars[2])})", + _ => $"global::System.MemoryExtensions.IndexOfAny({span}, {Literal(new string(primarySet.Chars))})", }; if (needLoop) @@ -640,60 +544,93 @@ void EmitLeadingCharacter_LeftToRight() writer.WriteLine("i += indexOfPos;"); writer.WriteLine(); - if (lcc.Length > 1) + if (setsToUse > 1) { - using (EmitBlock(writer, $"if (i >= span.Length - {lcc.Length - 1})")) + using (EmitBlock(writer, $"if (i >= span.Length - {minRequiredLength - 1})")) { writer.WriteLine("goto ReturnFalse;"); } + writer.WriteLine(); } } else { writer.WriteLine($"int i = {indexOf};"); - using (EmitBlock(writer, "if (i < 0)")) + using (EmitBlock(writer, "if (i >= 0)")) { - writer.WriteLine("goto ReturnFalse;"); + writer.WriteLine("base.runtextpos = runtextpos + i;"); + writer.WriteLine("return true;"); } } - writer.WriteLine(); + + setIndex = 1; } - Debug.Assert(charClassIndex == 0 || charClassIndex == 1); - bool hasCharClassConditions = false; - if (charClassIndex < lcc.Length) + if (needLoop) { - // if (CharInClass(textSpan[i + charClassIndex], prefix[0], "...") && - // ...) - Debug.Assert(needLoop); - int start = charClassIndex; - for (; charClassIndex < lcc.Length; charClassIndex++) + Debug.Assert(setIndex == 0 || setIndex == 1); + bool hasCharClassConditions = false; + if (setIndex < setsToUse) { - string spanIndex = charClassIndex > 0 ? $"span[i + {charClassIndex}]" : "span[i]"; - string charInClassExpr = MatchCharacterClass(hasTextInfo, options, spanIndex, lcc[charClassIndex].CharClass, lcc[charClassIndex].CaseInsensitive); - - if (charClassIndex == start) + // if (CharInClass(textSpan[i + charClassIndex], prefix[0], "...") && + // ...) + Debug.Assert(needLoop); + int start = setIndex; + for (; setIndex < setsToUse; setIndex++) { - writer.Write($"if ({charInClassExpr}"); - } - else - { - writer.WriteLine(" &&"); - writer.Write($" {charInClassExpr}"); + string spanIndex = $"span[i{(sets[setIndex].Distance > 0 ? $" + {sets[setIndex].Distance}" : "")}]"; + string charInClassExpr = MatchCharacterClass(hasTextInfo, options, spanIndex, sets[setIndex].Set, sets[setIndex].CaseInsensitive); + + if (setIndex == start) + { + writer.Write($"if ({charInClassExpr}"); + } + else + { + writer.WriteLine(" &&"); + writer.Write($" {charInClassExpr}"); + } } + writer.WriteLine(")"); + hasCharClassConditions = true; } - writer.WriteLine(")"); - hasCharClassConditions = true; - } - using (hasCharClassConditions ? EmitBlock(writer, null) : default) - { - writer.WriteLine("base.runtextpos = runtextpos + i;"); - writer.WriteLine("return true;"); + using (hasCharClassConditions ? EmitBlock(writer, null) : default) + { + writer.WriteLine("base.runtextpos = runtextpos + i;"); + writer.WriteLine("return true;"); + } } loopBlock.Dispose(); } + + // If a TextInfo is needed to perform ToLower operations, emits a local initialized to the TextInfo to use. + static void EmitTextInfo(IndentedTextWriter writer, ref bool hasTextInfo, RegexMethod rm) + { + // Emit local to store current culture if needed + if ((rm.Options & RegexOptions.CultureInvariant) == 0) + { + bool needsCulture = rm.Code.FindOptimizations.FindMode switch + { + FindNextStartingPositionMode.FixedLiteral_LeftToRight_CaseInsensitive or + FindNextStartingPositionMode.LeadingLiteral_RightToLeft_CaseInsensitive or + FindNextStartingPositionMode.FixedSets_LeftToRight_CaseInsensitive or + FindNextStartingPositionMode.LeadingSet_LeftToRight_CaseInsensitive or + FindNextStartingPositionMode.LeadingSet_RightToLeft_CaseInsensitive => true, + + _ when rm.Code.FindOptimizations.FixedDistanceSets is List<(char[]? Chars, string Set, int Distance, bool CaseInsensitive)> sets => sets.Exists(set => set.CaseInsensitive), + + _ => false, + }; + + if (needsCulture) + { + hasTextInfo = true; + writer.WriteLine("global::System.Globalization.TextInfo textInfo = global::System.Globalization.CultureInfo.CurrentCulture.TextInfo;"); + } + } + } } /// Emits the body of the Go override. @@ -750,14 +687,26 @@ private static void EmitNonBacktrackingGo(IndentedTextWriter writer, RegexMethod /// Emits the body of a simplified Go implementation that's possible when there's minimal backtracking required by the expression. private static void EmitSimplifiedGo(IndentedTextWriter writer, RegexMethod rm, string id) { + // Arbitrary limit for unrolling vs creating a loop. We want to balance size in the generated + // code with other costs, like the (small) overhead of slicing to create the temp span to iterate. + const int MaxUnrollSize = 16; + RegexOptions options = (RegexOptions)rm.Options; RegexCode code = rm.Code; - (string CharClass, bool CaseInsensitive)[]? lcc = code.LeadingCharClasses; bool rtl = code.RightToLeft; bool hasTimeout = false; - int localCounter = 0; - string NextLocalName(string prefix) => $"{prefix}{localCounter++}"; + // Helper to define names. Names start unadorned, but as soon as there's repetition, + // they begin to have a numbered suffix. + var usedNames = new Dictionary(); + string ReserveName(string prefix) + { + usedNames.TryGetValue(prefix, out int count); + usedNames[prefix] = count + 1; + return count == 0 ? prefix : $"{prefix}{count}"; + } + + void MarkLabel(string label, bool emitSemicolon = true) => writer.WriteLine($"{label}:{(emitSemicolon ? ";" : "")}"); RegexNode node = rm.Code.Tree.Root; Debug.Assert(node.Type == RegexNode.Capture, "Every generated tree should begin with a capture node"); @@ -796,6 +745,7 @@ private static void EmitSimplifiedGo(IndentedTextWriter writer, RegexMethod rm, writer.WriteLine("int runtextpos = base.runtextpos;"); writer.WriteLine("int runtextend = base.runtextend;"); writer.WriteLine("int originalruntextpos = runtextpos;"); + writer.WriteLine("int runstackpos = 0;"); writer.WriteLine("global::System.ReadOnlySpan byteSpan;"); writer.WriteLine("char ch;"); hasTimeout = EmitLoopTimeoutCounterIfNeeded(writer, rm); @@ -813,11 +763,7 @@ private static void EmitSimplifiedGo(IndentedTextWriter writer, RegexMethod rm, LoadTextSpanLocal(writer, defineLocal: true); writer.WriteLine(); - int labelCounter = 0; - string DefineLabel(string prefix = "L") => $"{prefix}{labelCounter++}"; - void MarkLabel(string label) => writer.WriteLine($"{label}:"); - void Goto(string label) => writer.WriteLine($"goto {label};"); - string doneLabel = "NoMatch"; + string doneLabel = ReserveName("NoMatch"); string originalDoneLabel = doneLabel; // Emit the code for all nodes in the tree. @@ -837,17 +783,11 @@ private static void EmitSimplifiedGo(IndentedTextWriter writer, RegexMethod rm, // Emit failure writer.WriteLine("// No match"); - MarkLabel(originalDoneLabel); + MarkLabel(originalDoneLabel, emitSemicolon: !expressionHasCaptures); if (expressionHasCaptures) { EmitUncaptureUntil("0"); } - else - { - // We can't have a label at the end of the method, so explicitly - // add a "return;" if the End label would otherwise be an issue. - writer.WriteLine("return;"); - } return; static bool IsCaseInsensitive(RegexNode node) => (node.Options & RegexOptions.IgnoreCase) != 0; @@ -1007,10 +947,10 @@ static RegexNode CloneMultiWithoutFirstChar(RegexNode node) void EmitAllBranches() { // Label to jump to when any branch completes successfully. - string doneAlternateLabel = DefineLabel("Match"); + string doneAlternateLabel = ReserveName("Match"); // Save off runtextpos. We'll need to reset this each time a branch fails. - string startingRunTextPosName = NextLocalName("startingRunTextPos"); + string startingRunTextPosName = ReserveName("startingRunTextPos"); writer.WriteLine($"int {startingRunTextPosName} = runtextpos;"); int startingTextSpanPos = textSpanPos; @@ -1019,7 +959,7 @@ void EmitAllBranches() // as the alternation is atomic, so we're not concerned about captures after // the alternation. bool hasStartingCrawlpos = (node.Options & RegexNode.HasCapturesFlag) != 0; - string startingCrawlPos = NextLocalName("startingCrawlPos"); + string startingCrawlPos = ReserveName("startingCrawlPos"); if (hasStartingCrawlpos) { writer.WriteLine($"int {startingCrawlPos} = base.Crawlpos();"); @@ -1034,7 +974,7 @@ void EmitAllBranches() { using var __ = EmitScope(writer, $"Branch {i}"); - string nextBranch = DefineLabel("NoMatch"); + string nextBranch = ReserveName("NoMatch"); doneLabel = nextBranch; // Emit the code for each branch. @@ -1051,7 +991,7 @@ void EmitAllBranches() // setting runtextpos back to what it was at the beginning of the alternation, // updating textSpan to be the full length it was, and if there's a capture that // needs to be reset, uncapturing it. - MarkLabel(nextBranch); + MarkLabel(nextBranch, emitSemicolon: false); writer.WriteLine($"runtextpos = {startingRunTextPosName};"); LoadTextSpanLocal(writer); textSpanPos = startingTextSpanPos; @@ -1068,13 +1008,13 @@ void EmitAllBranches() { if (hasStartingCrawlpos) { - string uncapture = DefineLabel("Uncapture"); + string uncapture = ReserveName("Uncapture"); doneLabel = uncapture; EmitNode(node.Child(childCount - 1)); doneLabel = postAlternateDoneLabel; TransferTextSpanPosToRunTextPos(); writer.WriteLine($"goto {doneAlternateLabel};"); - MarkLabel(uncapture); + MarkLabel(uncapture, emitSemicolon: false); EmitUncaptureUntil(startingCrawlPos); writer.WriteLine($"goto {doneLabel};"); } @@ -1088,34 +1028,180 @@ void EmitAllBranches() // Successfully completed the alternate. MarkLabel(doneAlternateLabel); - writer.WriteLine(";"); Debug.Assert(textSpanPos == 0); } } + // Emits the code to handle a backreference. + void EmitBackreference(RegexNode node) + { + int capnum = RegexParser.MapCaptureNumber(node.M, rm.Code.Caps); + + TransferTextSpanPosToRunTextPos(); + + using (EmitBlock(writer, $"if (base.IsMatched({capnum}))")) + { + string matchLength = ReserveName("matchLength"); + writer.WriteLine($"int {matchLength} = base.MatchLength({capnum});"); + using (EmitBlock(writer, $"if ({textSpanLocal}.Length < {matchLength})")) + { + writer.WriteLine($"goto {doneLabel};"); + } + writer.WriteLine(); + + string matchIndex = ReserveName("matchIndex"); + writer.WriteLine($"int {matchIndex} = base.MatchIndex({capnum});"); + + string i = ReserveName("i"); + using (EmitBlock(writer, $"for (int {i} = 0; {i} < {matchLength}; {i}++)")) + { + using (EmitBlock(writer, $"if ({ToLowerIfNeeded(hasTextInfo, options, $"runtext[{matchIndex} + {i}]", IsCaseInsensitive(node))} != {ToLowerIfNeeded(hasTextInfo, options, $"{textSpanLocal}[{i}]", IsCaseInsensitive(node))})")) + { + writer.WriteLine($"goto {doneLabel};"); + } + } + writer.WriteLine(); + + writer.WriteLine($"runtextpos += {matchLength};"); + LoadTextSpanLocal(writer); + } + + if ((node.Options & RegexOptions.ECMAScript) == 0) + { + using (EmitBlock(writer, "else")) + { + writer.WriteLine($"goto {doneLabel};"); + } + } + } + + // Emits the code for an if(backreference)-then-else conditional. + void EmitBackreferenceConditional(RegexNode node) + { + int capnum = RegexParser.MapCaptureNumber(node.M, rm.Code.Caps); + int startingTextSpanPos = textSpanPos; + + using (EmitBlock(writer, $"if (base.IsMatched({capnum}))")) + { + EmitNode(node.Child(0)); + TransferTextSpanPosToRunTextPos(); + } + + if (node.ChildCount() > 1) + { + textSpanPos = startingTextSpanPos; + using (EmitBlock(writer, "else")) + { + EmitNode(node.Child(1)); + TransferTextSpanPosToRunTextPos(); + } + } + } + + // Emits the code for an if(expression)-then-else conditional. + void EmitExpressionConditional(RegexNode node) + { + // The first child node is the conditional expression. If this matches, then we branch to the "yes" branch. + // If it doesn't match, then we branch to the optional "no" branch if it exists, or simply skip the "yes" + // branch, otherwise. The conditional is treated as a positive lookahead. If it's not already + // such a node, wrap it in one. + RegexNode conditional = node.Child(0); + if (conditional is not { Type: RegexNode.Require }) + { + var newConditional = new RegexNode(RegexNode.Require, conditional.Options); + newConditional.AddChild(conditional); + conditional = newConditional; + } + + // Get the "yes" branch and the optional "no" branch, if it exists. + RegexNode yesBranch = node.Child(1); + RegexNode? noBranch = node.ChildCount() > 2 ? node.Child(2) : null; + + string end = ReserveName("end"); + string? no = noBranch is not null ? ReserveName("NoMatch") : null; + + // If the conditional expression has captures, we'll need to uncapture them in the case of no match. + string? startingCrawlPos = null; + if ((conditional.Options & RegexNode.HasCapturesFlag) != 0) + { + startingCrawlPos = ReserveName("startingCrawlPos"); + writer.WriteLine($"int {startingCrawlPos} = base.Crawlpos();"); + writer.WriteLine(); + } + + // Emit the conditional expression. We need to reroute any match failures to either the "no" branch + // if it exists, or to the end of the node (skipping the "yes" branch) if it doesn't. + string originalDoneLabel = doneLabel; + string tmpDoneLabel = no ?? end; + doneLabel = tmpDoneLabel; + EmitPositiveLookaheadAssertion(conditional); + if (doneLabel == tmpDoneLabel) + { + doneLabel = originalDoneLabel; + } + + // If we get to this point of the code, the conditional successfully matched, so run the "yes" branch. + // Since the "yes" branch may have a different execution path than the "no" branch or the lack of + // any branch, we need to store the current textSpanPosition and reset it prior to emitting the code + // for what comes after the "yes" branch, so that everyone is on equal footing. + int startingTextSpanPos = textSpanPos; + EmitNode(yesBranch); + TransferTextSpanPosToRunTextPos(); // ensure all subsequent code sees the same textSpanPos value by setting it to 0 + + // If there's a no branch, we need to emit it, but skipping it from a successful "yes" branch match. + if (no is not null) + { + writer.WriteLine($"goto {end};"); + writer.WriteLine(); + + // Emit the no branch, first uncapturing any captures from the expression condition that failed + // to match and emit the branch. + MarkLabel(no, emitSemicolon: startingCrawlPos is null); + if (startingCrawlPos is not null) + { + EmitUncaptureUntil(startingCrawlPos); + } + textSpanPos = startingTextSpanPos; + EmitNode(noBranch); + TransferTextSpanPosToRunTextPos(); // ensure all subsequent code sees the same textSpanPos value by setting it to 0 + } + + MarkLabel(end); + } + // Emits the code for a Capture node. void EmitCapture(RegexNode node, RegexNode? subsequent = null) { - Debug.Assert(node.N == -1); - - // Get the capture number. This needs to be kept in sync with MapCapNum in RegexWriter. Debug.Assert(node.Type == RegexNode.Capture); - Debug.Assert(node.N == -1, "Currently only support capnum, not uncapnum"); - int capnum = node.M; - if (capnum != -1 && rm.Code.Caps != null) + int capnum = RegexParser.MapCaptureNumber(node.M, rm.Code.Caps); + int uncapnum = RegexParser.MapCaptureNumber(node.N, rm.Code.Caps); + + if (uncapnum != -1) { - capnum = (int)rm.Code.Caps[capnum]!; + using (EmitBlock(writer, $"if (!base.IsMatched({uncapnum}))")) + { + writer.WriteLine($"goto {doneLabel};"); + } + writer.WriteLine(); } TransferTextSpanPosToRunTextPos(); - string startingRunTextPosName = NextLocalName("startingRunTextPos"); + string startingRunTextPosName = ReserveName("startingRunTextPos"); writer.WriteLine($"int {startingRunTextPosName} = runtextpos;"); + writer.WriteLine(); // Emit child node. EmitNode(node.Child(0), subsequent); TransferTextSpanPosToRunTextPos(); - writer.WriteLine($"base.Capture({capnum}, {startingRunTextPosName}, runtextpos);"); + if (uncapnum == -1) + { + writer.WriteLine($"base.Capture({capnum}, {startingRunTextPosName}, runtextpos);"); + } + else + { + writer.WriteLine($"base.TransferCapture({capnum}, {uncapnum}, {startingRunTextPosName}, runtextpos);"); + } } // Emits code to unwind the capture stack until the crawl position specified in the provided local. @@ -1131,8 +1217,9 @@ void EmitUncaptureUntil(string crawlpos) void EmitPositiveLookaheadAssertion(RegexNode node) { // Save off runtextpos. We'll need to reset this upon successful completion of the lookahead. - string startingRunTextPosName = NextLocalName("startingRunTextPos"); + string startingRunTextPosName = ReserveName("startingRunTextPos"); writer.WriteLine($"int {startingRunTextPosName} = runtextpos;"); + writer.WriteLine(); int startingTextSpanPos = textSpanPos; // Emit the child. @@ -1149,12 +1236,12 @@ void EmitPositiveLookaheadAssertion(RegexNode node) void EmitNegativeLookaheadAssertion(RegexNode node) { // Save off runtextpos. We'll need to reset this upon successful completion of the lookahead. - string startingRunTextPosName = NextLocalName("startingRunTextPos"); + string startingRunTextPosName = ReserveName("startingRunTextPos"); writer.WriteLine($"int {startingRunTextPosName} = runtextpos;"); int startingTextSpanPos = textSpanPos; string originalDoneLabel = doneLabel; - string negativeLookaheadDoneLabel = DefineLabel("Match"); + string negativeLookaheadDoneLabel = ReserveName("Match"); doneLabel = negativeLookaheadDoneLabel; // Emit the child. @@ -1162,10 +1249,10 @@ void EmitNegativeLookaheadAssertion(RegexNode node) // If the generated code ends up here, it matched the lookahead, which actually // means failure for a _negative_ lookahead, so we need to jump to the original done. - Goto(originalDoneLabel); + writer.WriteLine($"goto {originalDoneLabel};"); // Failures (success for a negative lookahead) jump here. - MarkLabel(negativeLookaheadDoneLabel); + MarkLabel(negativeLookaheadDoneLabel, emitSemicolon: false); Debug.Assert(doneLabel == negativeLookaheadDoneLabel); doneLabel = originalDoneLabel; @@ -1193,7 +1280,7 @@ void EmitNode(RegexNode node, RegexNode? subsequent = null, bool emitLengthCheck return; case RegexNode.Atomic: - EmitNode(node.Child(0), subsequent); + EmitAtomic(node, subsequent); return; } @@ -1236,18 +1323,14 @@ void EmitNode(RegexNode node, RegexNode? subsequent = null, bool emitLengthCheck break; case RegexNode.Loop: - EmitAtomicNodeLoop(node); + EmitLoop(node); break; + case RegexNode.Onelazy: + case RegexNode.Notonelazy: + case RegexNode.Setlazy: case RegexNode.Lazyloop: - // An atomic lazy loop amounts to doing the minimum amount of work possible. - // That means iterating as little as is required, which means a repeater - // for the min, and if min is 0, doing nothing. - Debug.Assert(node.M == node.N || (node.Next != null && node.Next.Type == RegexNode.Atomic)); - if (node.M > 0) - { - EmitNodeRepeater(node); - } + EmitLazy(node, emitLengthChecksIfRequired); break; case RegexNode.Alternate: @@ -1260,33 +1343,20 @@ void EmitNode(RegexNode node, RegexNode? subsequent = null, bool emitLengthCheck EmitSingleCharLoop(node, subsequent, emitLengthChecksIfRequired); break; - case RegexNode.Onelazy: - case RegexNode.Notonelazy: - case RegexNode.Setlazy: - EmitSingleCharFixedRepeater(node, emitLengthChecksIfRequired); + case RegexNode.Concatenate: + EmitConcatenation(node, subsequent, emitLengthChecksIfRequired); break; - case RegexNode.Concatenate: - int childCount = node.ChildCount(); - for (int i = 0; i < childCount; i++) - { - if (emitLengthChecksIfRequired && node.TryGetJoinableLengthCheckChildRange(i, out int requiredLength, out int exclusiveEnd)) - { - EmitSpanLengthCheck(requiredLength); - writer.WriteLine(); + case RegexNode.Ref: + EmitBackreference(node); + break; - for (; i < exclusiveEnd; i++) - { - EmitNode(node.Child(i), i + 1 < childCount ? node.Child(i + 1) : subsequent, emitLengthChecksIfRequired: false); - } + case RegexNode.Testref: + EmitBackreferenceConditional(node); + break; - i--; - } - else - { - EmitNode(node.Child(i), i + 1 < childCount ? node.Child(i + 1) : subsequent, emitLengthChecksIfRequired: emitLengthChecksIfRequired); - } - } + case RegexNode.Testgroup: + EmitExpressionConditional(node); break; case RegexNode.Capture: @@ -1351,6 +1421,17 @@ static bool NodesWithCrossScopeLabels(RegexNode node, HashSet results } } + // Emits the node for an atomic. + void EmitAtomic(RegexNode node, RegexNode? subsequent) + { + // Atomic simply outputs the code for the child, but it ensures that any done label left + // set by the child is reset to what it was prior to the node's processing. That way, + // anything later that tries to jump back won't see labels set inside the atomic. + string originalDoneLabel = doneLabel; + EmitNode(node.Child(0), subsequent); + doneLabel = originalDoneLabel; + } + // Emits the code to handle updating base.runtextpos to runtextpos in response to // an UpdateBumpalong node. This is used when we want to inform the scan loop that // it should bump from this location rather than from the original location. @@ -1360,8 +1441,91 @@ void EmitUpdateBumpalong() writer.WriteLine("base.runtextpos = runtextpos;"); } + void EmitConcatenation(RegexNode node, RegexNode? subsequent, bool emitLengthChecksIfRequired) + { + int childCount = node.ChildCount(); + for (int i = 0; i < childCount; i++) + { + if (emitLengthChecksIfRequired && node.TryGetJoinableLengthCheckChildRange(i, out int requiredLength, out int exclusiveEnd)) + { + bool wroteClauses = true; + writer.Write($"if ({SpanLengthCheck(requiredLength)}"); + + while (i < exclusiveEnd) + { + for (; i < exclusiveEnd; i++) + { + void WriteSingleCharChild(RegexNode child) + { + if (wroteClauses) + { + writer.WriteLine(" ||"); + writer.Write(" "); + } + else + { + writer.Write("if ("); + } + EmitSingleChar(child, emitLengthCheck: false, clauseOnly: true); + wroteClauses = true; + } + + RegexNode child = node.Child(i); + if (child.Type is RegexNode.One or RegexNode.Notone or RegexNode.Set) + { + WriteSingleCharChild(child); + writer.Write($" /* {DescribeNode(child)} */"); + } + else if (child.Type is RegexNode.Oneloop or RegexNode.Onelazy or RegexNode.Oneloopatomic or + RegexNode.Setloop or RegexNode.Setlazy or RegexNode.Setloopatomic or + RegexNode.Notoneloop or RegexNode.Notonelazy or RegexNode.Notoneloopatomic && + child.M == child.N && + child.M <= MaxUnrollSize) + { + for (int c = 0; c < child.M; c++) + { + WriteSingleCharChild(child); + if (c == 0) + { + writer.Write($" /* {DescribeNode(child)} */"); + } + } + } + else + { + break; + } + } + + if (wroteClauses) + { + writer.WriteLine(")"); + using (EmitBlock(writer, null)) + { + writer.WriteLine($"goto {doneLabel};"); + } + wroteClauses = false; + } + + if (i < exclusiveEnd) + { + writer.WriteLine(); + EmitNode(node.Child(i), i + 1 < childCount ? node.Child(i + 1) : subsequent, emitLengthChecksIfRequired: false); + i++; + } + } + + i--; + } + else + { + EmitNode(node.Child(i), i + 1 < childCount ? node.Child(i + 1) : subsequent, emitLengthChecksIfRequired: emitLengthChecksIfRequired); + } + } + } + // Emits the code to handle a single-character match. - void EmitSingleChar(RegexNode node, bool emitLengthCheck = true, string? offset = null) + void EmitSingleChar(RegexNode node, bool emitLengthCheck = true, string? offset = null, bool clauseOnly = false) { // This only emits a single check, but it's called from the looping constructs in a loop // to generate the code for a single check, so we map those looping constructs to the @@ -1375,13 +1539,20 @@ void EmitSingleChar(RegexNode node, bool emitLengthCheck = true, string? offset } else { - expr = ToLowerIfNeeded(hasTextInfo, options, expr, IsCaseInsensitive(node) && RegexCharClass.ParticipatesInCaseConversion(node.Ch)); + expr = ToLowerIfNeeded(hasTextInfo, options, expr, IsCaseInsensitive(node)); expr = $"{expr} {(node.IsOneFamily ? "!=" : "==")} {Literal(node.Ch)}"; } - using (EmitBlock(writer, emitLengthCheck ? $"if ({SpanLengthCheck(1, offset)} || {expr})" : $"if ({expr})")) + if (clauseOnly) { - writer.WriteLine($"goto {doneLabel};"); + writer.Write(expr); + } + else + { + using (EmitBlock(writer, emitLengthCheck ? $"if ({SpanLengthCheck(1, offset)} || {expr})" : $"if ({expr})")) + { + writer.WriteLine($"goto {doneLabel};"); + } } textSpanPos++; @@ -1429,7 +1600,7 @@ void EmitAnchors(RegexNode node) { // If we statically know we've already matched part of the regex, there's no way we're at the // beginning or start, as we've already progressed past it. - Goto(doneLabel); + writer.WriteLine($"goto {doneLabel};"); } else { @@ -1529,7 +1700,8 @@ void EmitOr() while (byteStr.Length >= sizeof(ulong)) { EmitOr(); - writer.Write($"global::System.Buffers.Binary.BinaryPrimitives.ReadUInt64LittleEndian(byteSpan.Slice({textSpanPos * sizeof(char)})) != 0x{BinaryPrimitives.ReadUInt64LittleEndian(byteStr):X}ul"); + string byteSpan = textSpanPos > 0 ? $"byteSpan.Slice({textSpanPos * sizeof(char)})" : "byteSpan"; + writer.Write($"global::System.Buffers.Binary.BinaryPrimitives.ReadUInt64LittleEndian({byteSpan}) != 0x{BinaryPrimitives.ReadUInt64LittleEndian(byteStr):X}ul"); textSpanPos += sizeof(ulong) / sizeof(char); byteStr = byteStr.Slice(sizeof(ulong)); } @@ -1537,7 +1709,8 @@ void EmitOr() while (byteStr.Length >= sizeof(uint)) { EmitOr(); - writer.Write($"global::System.Buffers.Binary.BinaryPrimitives.ReadUInt32LittleEndian(byteSpan.Slice({textSpanPos * sizeof(char)})) != 0x{BinaryPrimitives.ReadUInt32LittleEndian(byteStr):X}u"); + string byteSpan = textSpanPos > 0 ? $"byteSpan.Slice({textSpanPos * sizeof(char)})" : "byteSpan"; + writer.Write($"global::System.Buffers.Binary.BinaryPrimitives.ReadUInt32LittleEndian({byteSpan}) != 0x{BinaryPrimitives.ReadUInt32LittleEndian(byteStr):X}u"); textSpanPos += sizeof(uint) / sizeof(char); byteStr = byteStr.Slice(sizeof(uint)); } @@ -1565,7 +1738,8 @@ void EmitOr() // character-by-character while respecting the culture. if (!caseInsensitive) { - using (EmitBlock(writer, $"if (!global::System.MemoryExtensions.StartsWith({textSpanLocal}.Slice({textSpanPos}), {Literal(node.Str)}))")) + string sourceSpan = textSpanPos > 0 ? $"{textSpanLocal}.Slice({textSpanPos})" : textSpanLocal; + using (EmitBlock(writer, $"if (!global::System.MemoryExtensions.StartsWith({sourceSpan}, {Literal(node.Str)}))")) { writer.WriteLine($"goto {doneLabel};"); } @@ -1574,10 +1748,11 @@ void EmitOr() else { EmitSpanLengthCheck(str.Length); - string i = NextLocalName("i"); + string i = ReserveName("i"); using (EmitBlock(writer, $"for (int {i} = 0; {i} < {Literal(node.Str)}.Length; {i}++)")) { - using (EmitBlock(writer, $"if ({ToLower(hasTextInfo, options, $"{textSpanLocal}[{textSpanPos} + {i}]")} != {Literal(str)}[{i}])")) + string textSpanIndex = textSpanPos > 0 ? $"{i} + {textSpanPos}" : i; + using (EmitBlock(writer, $"if ({ToLower(hasTextInfo, options, $"{textSpanLocal}[{textSpanIndex}]")} != {Literal(str)}[{i}])")) { writer.WriteLine($"goto {doneLabel};"); } @@ -1601,11 +1776,10 @@ void EmitSingleCharLoop(RegexNode node, RegexNode? subsequent = null, bool emitL // of the wrapped loop (1). Debug.Assert(node.M < node.N); - string backtrackingLabel = DefineLabel("Backtrack"); - string endLoop = DefineLabel("EndLoop"); - string startingPos = NextLocalName("startingRunTextPos"); - string endingPos = NextLocalName("endingRunTextPos"); - string crawlPos = NextLocalName("crawlPos"); + string backtrackingLabel = ReserveName("Backtrack"); + string endLoop = ReserveName("EndLoop"); + string startingPos = ReserveName("startingRunTextPos"); + string endingPos = ReserveName("endingRunTextPos"); // We're about to enter a loop, so ensure our text position is 0. TransferTextSpanPosToRunTextPos(); @@ -1619,7 +1793,12 @@ void EmitSingleCharLoop(RegexNode node, RegexNode? subsequent = null, bool emitL EmitSingleCharAtomicLoop(node); TransferTextSpanPosToRunTextPos(); writer.WriteLine($"int {endingPos} = runtextpos;"); - writer.WriteLine($"int {crawlPos} = base.Crawlpos();"); + string? crawlPos = null; + if (expressionHasCaptures) + { + crawlPos = ReserveName("crawlPos"); + writer.WriteLine($"int {crawlPos} = base.Crawlpos();"); + } if (node.M > 0) { writer.WriteLine($"{startingPos} += {node.M};"); @@ -1630,7 +1809,7 @@ void EmitSingleCharLoop(RegexNode node, RegexNode? subsequent = null, bool emitL // Backtracking section. Subsequent failures will jump to here, at which // point we decrement the matched count as long as it's above the minimum // required, and try again by flowing to everything that comes after this. - MarkLabel(backtrackingLabel); + MarkLabel(backtrackingLabel, emitSemicolon: false); string originalDoneLabel = doneLabel; using (EmitBlock(writer, $"if ({startingPos} >= {endingPos})")) { @@ -1668,6 +1847,120 @@ void EmitSingleCharLoop(RegexNode node, RegexNode? subsequent = null, bool emitL // It's left pointing to the backtracking label for everything subsequent in the expression. } + void EmitLazy(RegexNode node, bool emitLengthChecksIfRequired = true) + { + bool isSingleChar = node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily; + + // Emit the min iterations as a repeater. Any failures here don't necessitate backtracking, + // as the lazy itself failed to match. + if (node.M > 0) + { + if (isSingleChar) + { + EmitSingleCharFixedRepeater(node, emitLengthChecksIfRequired); + } + else + { + EmitNodeRepeater(node); + } + } + + // If the whole thing was actually that repeater, we're done. Similarly, if this is actually an atomic + // lazy loop, nothing will ever backtrack into this node, so we never need to iterate more than the minimum. + if (node.M == node.N || node.Next is { Type: RegexNode.Atomic }) + { + return; + } + + Debug.Assert(node.M < node.N); + + // We now need to match one character at a time, each time allowing the remainder of the expression + // to try to match, and only matching another character if the subsequent expression fails to match. + + // We're about to enter a loop, so ensure our text position is 0. + TransferTextSpanPosToRunTextPos(); + + // If the loop isn't unbounded, track the number of iterations and the max number to allow. + string? iterationCount = null; + string? maxIterations = null; + if (node.N != int.MaxValue) + { + iterationCount = ReserveName("i"); + maxIterations = ReserveName("maxIterations"); + writer.WriteLine($"int {iterationCount} = 0;"); + writer.WriteLine($"int {maxIterations} = {node.N - node.M};"); + } + + // Track the current crawl position. Upon backtracking, we'll unwind any captures beyond this point. + string? crawlPos = null; + if (expressionHasCaptures) + { + crawlPos = ReserveName("crawlPos"); + writer.WriteLine($"int {crawlPos} = base.Crawlpos();"); + } + + // Track the current runtextpos. Each time we backtrack, we'll reset to the stored position, which + // is also incremented each time we match another character in the loop. + string nextPos = ReserveName("nextPos"); + writer.WriteLine($"int {nextPos} = runtextpos;"); + + // Skip the backtracking section for the initial subsequent matching. We've already matched the + // minimum number of iterations, which means we can successfully match with zero additional iterations. + string endLoopLabel = ReserveName("endLoop"); + writer.WriteLine($"goto {endLoopLabel};"); + writer.WriteLine(); + + // Backtracking section. Subsequent failures will jump to here. + string backtrackingLabel = ReserveName("Backtrack"); + MarkLabel(backtrackingLabel, emitSemicolon: false); + + // Uncapture any captures if the expression has any. It's possible the captures it has + // are before this node, in which case this is wasted effort, but still functionally correct. + if (expressionHasCaptures) + { + EmitUncaptureUntil(crawlPos); + } + + // If there's a max number of iterations, see if we've exceeded the maximum number of characters + // to match. If we haven't, increment the iteration count. + if (maxIterations is not null) + { + using (EmitBlock(writer, $"if ({iterationCount} >= {maxIterations})")) + { + writer.WriteLine($"goto {doneLabel};"); + } + writer.WriteLine($"{iterationCount}++;"); + } + + // Now match the next character in the lazy loop. We need to reset the runtextpos to the position + // just after the last character in this loop was matched, and we need to store the resulting position + // for the next time we backtrack. + writer.WriteLine($"runtextpos = {nextPos};"); + LoadTextSpanLocal(writer); + if (isSingleChar) + { + EmitSingleChar(node); + } + else + { + writer.WriteLine(); + EmitNode(node.Child(0)); + } + TransferTextSpanPosToRunTextPos(); + writer.WriteLine($"{nextPos} = runtextpos;"); + + // Update the done label for everything that comes after this node. This is done after we emit the single char + // matching, as that failing indicates the loop itself has failed to match. + string originalDoneLabel = doneLabel; + doneLabel = backtrackingLabel; // leave set to the backtracking label for all subsequent nodes + + writer.WriteLine(); + MarkLabel(endLoopLabel); + + // We explicitly do not reset doneLabel back to originalDoneLabel. + // It's left pointing to the backtracking label for everything subsequent in the expression. + } + // Emits the code to handle a loop (repeater) with a fixed number of iterations. // RegexNode.M is used for the number of iterations; RegexNode.N is ignored. void EmitSingleCharFixedRepeater(RegexNode node, bool emitLengthCheck = true) @@ -1685,10 +1978,6 @@ void EmitSingleCharFixedRepeater(RegexNode node, bool emitLengthCheck = true) EmitSpanLengthCheck(iterations); } - // Arbitrary limit for unrolling vs creating a loop. We want to balance size in the generated - // code with other costs, like the (small) overhead of slicing to create the temp span to iterate. - const int MaxUnrollSize = 16; - if (iterations <= MaxUnrollSize) { // if (textSpan[textSpanPos] != c1 || @@ -1704,7 +1993,7 @@ void EmitSingleCharFixedRepeater(RegexNode node, bool emitLengthCheck = true) { string spanLocal = "slice"; // As this repeater doesn't wrap arbitrary node emits, this shouldn't conflict with anything writer.WriteLine($"global::System.ReadOnlySpan {spanLocal} = {textSpanLocal}.Slice({textSpanPos}, {iterations});"); - string i = NextLocalName("i"); + string i = ReserveName("i"); using (EmitBlock(writer, $"for (int {i} = 0; {i} < {spanLocal}.Length; {i}++)")) { EmitTimeoutCheck(writer, hasTimeout); @@ -1740,7 +2029,7 @@ void EmitNodeRepeater(RegexNode node) // Ensure textSpanPos is 0 prior to emitting the child. TransferTextSpanPosToRunTextPos(); - string i = NextLocalName("i"); + string i = ReserveName("i"); using (EmitBlock(writer, $"for (int {i} = 0; {i} < {iterations}; {i}++)")) { EmitTimeoutCheck(writer, hasTimeout); @@ -1771,13 +2060,13 @@ void EmitSingleCharAtomicLoop(RegexNode node, bool emitLengthChecksIfRequired = int minIterations = node.M; int maxIterations = node.N; - Span setChars = stackalloc char[3]; // 3 is max we can use with IndexOfAny + Span setChars = stackalloc char[5]; // 5 is max optimized by IndexOfAny today int numSetChars = 0; - string iterationLocal = NextLocalName("i"); + string iterationLocal = ReserveName("i"); if (node.IsNotoneFamily && maxIterations == int.MaxValue && - (!IsCaseInsensitive(node) || !RegexCharClass.ParticipatesInCaseConversion(node.Ch))) + (!IsCaseInsensitive(node))) { // For Notone, we're looking for a specific character, as everything until we find // it is consumed by the loop. If we're unbounded, such as with ".*" and if we're case-sensitive, @@ -1802,21 +2091,25 @@ void EmitSingleCharAtomicLoop(RegexNode node, bool emitLengthChecksIfRequired = else if (node.IsSetFamily && maxIterations == int.MaxValue && !IsCaseInsensitive(node) && - (numSetChars = RegexCharClass.GetSetChars(node.Str!, setChars)) > 1 && + (numSetChars = RegexCharClass.GetSetChars(node.Str!, setChars)) != 0 && RegexCharClass.IsNegated(node.Str!)) { - // If the set is negated and contains only 2 or 3 characters (if it contained 1 and was negated, it would + // If the set is negated and contains only a few characters (if it contained 1 and was negated, it should // have been reduced to a Notone), we can use an IndexOfAny to find any of the target characters. // As with the notoneloopatomic above, the unbounded constraint is purely for simplicity. + Debug.Assert(numSetChars > 1); writer.Write($"int {iterationLocal} = global::System.MemoryExtensions.IndexOfAny({textSpanLocal}"); if (textSpanPos != 0) { writer.Write($".Slice({textSpanPos})"); } - writer.WriteLine(numSetChars == 2 ? - $", {Literal(setChars[0])}, {Literal(setChars[1])});" : - $", {Literal(setChars[0])}, {Literal(setChars[1])}, {Literal(setChars[2])});"); + writer.WriteLine(numSetChars switch + { + 2 => $", {Literal(setChars[0])}, {Literal(setChars[1])});", + 3 => $", {Literal(setChars[0])}, {Literal(setChars[1])}, {Literal(setChars[2])});", + _ => $", {Literal(setChars.Slice(0, numSetChars).ToString())});", + }); using (EmitBlock(writer, $"if ({iterationLocal} == -1)")) { writer.WriteLine(textSpanPos > 0 ? @@ -1844,7 +2137,7 @@ void EmitSingleCharAtomicLoop(RegexNode node, bool emitLengthChecksIfRequired = } else { - expr = ToLowerIfNeeded(hasTextInfo, options, expr, IsCaseInsensitive(node) && RegexCharClass.ParticipatesInCaseConversion(node.Ch)); + expr = ToLowerIfNeeded(hasTextInfo, options, expr, IsCaseInsensitive(node)); expr = $"{expr} {(node.IsOneFamily ? "==" : "!=")} {Literal(node.Ch)}"; } @@ -1895,7 +2188,7 @@ void EmitAtomicSingleCharZeroOrOne(RegexNode node) } else { - expr = ToLowerIfNeeded(hasTextInfo, options, expr, IsCaseInsensitive(node) && RegexCharClass.ParticipatesInCaseConversion(node.Ch)); + expr = ToLowerIfNeeded(hasTextInfo, options, expr, IsCaseInsensitive(node)); expr = $"{expr} {(node.IsOneFamily ? "==" : "!=")} {Literal(node.Ch)}"; } @@ -1906,8 +2199,86 @@ void EmitAtomicSingleCharZeroOrOne(RegexNode node) } } + void EmitLoop(RegexNode node) + { + // If the loop is atomic, emit it as such and avoid all backtracking. + if (node.Next is { Type: RegexNode.Atomic }) + { + EmitAtomicNodeLoop(node); + return; + } + + // If the loop is actually a repeater, similarly emit it as such and avoid all backtracking. + if (node.M == node.N) + { + EmitNodeRepeater(node); + return; + } + + // Emit backtracking around an atomic loop, but tracking the starting position of each iteration + // along the way so that we can backtrack through each position. + + Debug.Assert(node.M < node.N); + string backtrackingLabel = ReserveName("Backtrack"); + string endLoop = ReserveName("EndLoop"); + string startingTrackPos = ReserveName("startingTrackPos"); + string endingTrackPos = ReserveName("endingTrackPos"); + + // We're about to enter a loop, so ensure our text position is 0. + TransferTextSpanPosToRunTextPos(); + + // Grab the current position, then emit the loop as atomic, except keeping track of the position + // before each iteration match, which enables us to then apply the backtracking. + writer.WriteLine($"int {startingTrackPos} = runstackpos;"); + EmitAtomicNodeLoop(node, trackStartingPositions: true); + TransferTextSpanPosToRunTextPos(); + writer.WriteLine($"int {endingTrackPos} = runstackpos;"); + string? crawlPos = null; + if (expressionHasCaptures) + { + crawlPos = ReserveName("crawlPos"); + writer.WriteLine($"int {crawlPos} = base.Crawlpos();"); + } + if (node.M > 0) + { + writer.WriteLine($"{startingTrackPos} += {node.M};"); + } + writer.WriteLine($"goto {endLoop};"); + writer.WriteLine(); + + // Backtracking section. Subsequent failures will jump to here, at which + // point we decrement the matched count as long as it's above the minimum + // required, and try again by flowing to everything that comes after this. + MarkLabel(backtrackingLabel, emitSemicolon: false); + string originalDoneLabel = doneLabel; + using (EmitBlock(writer, $"if ({startingTrackPos} >= {endingTrackPos})")) + { + writer.WriteLine($"goto {originalDoneLabel};"); + } + doneLabel = backtrackingLabel; // leave set to the backtracking label for all subsequent nodes + + if (expressionHasCaptures) + { + // Uncapture any captures if the expression has any. It's possible the captures it has + // are before this node, in which case this is wasted effort, but still functionally correct. + EmitUncaptureUntil(crawlPos); + } + + writer.WriteLine($"runtextpos = base.runstack![--{endingTrackPos}];"); + + LoadTextSpanLocal(writer); + writer.WriteLine(); + + MarkLabel(endLoop); + + // We explicitly do not reset doneLabel back to originalDoneLabel. + // It's left pointing to the backtracking label for everything subsequent in the expression. + } + // Emits the code to handle a non-backtracking, variable-length loop around another node. - void EmitAtomicNodeLoop(RegexNode node) + // If trackStartingPositions is true, it will also handle emitting code to use runstack[runstackpos] + // to store the starting positions of each iteration. + void EmitAtomicNodeLoop(RegexNode node, bool trackStartingPositions = false) { Debug.Assert(node.Type == RegexNode.Loop, $"Unexpected type: {node.Type}"); Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); @@ -1923,7 +2294,7 @@ void EmitAtomicNodeLoop(RegexNode node) } string originalDoneLabel = doneLabel; - string atomicNodeLabel = DefineLabel("NoMatch"); + string atomicNodeLabel = ReserveName("NoMatch"); doneLabel = atomicNodeLabel; // We might loop any number of times. In order to ensure this loop @@ -1934,39 +2305,51 @@ void EmitAtomicNodeLoop(RegexNode node) TransferTextSpanPosToRunTextPos(); // int i = 0; - string iterationLocal = NextLocalName("iter"); + string iterationLocal = ReserveName("iter"); writer.WriteLine($"int {iterationLocal} = 0;"); using (EmitBlock(writer, maxIterations == int.MaxValue ? "while (true)" : $"while ({iterationLocal} < {maxIterations})")) { EmitTimeoutCheck(writer, hasTimeout); - string successfulIterationLabel = DefineLabel("Match"); + string successfulIterationLabel = ReserveName("Match"); // Iteration body string prevDone = doneLabel; - string iterationLabel = DefineLabel("NoMatch"); + string iterationLabel = ReserveName("NoMatch"); doneLabel = iterationLabel; // Save off runtextpos. - string startingRunTextPosLocal = NextLocalName("startingRunTextPos"); + string startingRunTextPosLocal = ReserveName("startingRunTextPos"); writer.WriteLine($"int {startingRunTextPosLocal} = runtextpos;"); + if (trackStartingPositions) + { + // Track the starting position of each loop iteration to enable backtracking. + writer.WriteLine(); + using (EmitBlock(writer, "if (runstackpos == base.runstack!.Length)")) + { + writer.WriteLine("global::System.Array.Resize(ref base.runstack, base.runstack.Length * 2);"); + } + writer.WriteLine("base.runstack[runstackpos++] = runtextpos;"); + writer.WriteLine(); + } + // Emit the child. Debug.Assert(textSpanPos == 0); EmitNode(node.Child(0)); TransferTextSpanPosToRunTextPos(); // ensure textSpanPos remains 0 - Goto(successfulIterationLabel); // iteration succeeded + writer.WriteLine($"goto {successfulIterationLabel};"); // iteration succeeded // If the generated code gets here, the iteration failed. // Reset state, branch to done. - MarkLabel(iterationLabel); + MarkLabel(iterationLabel, emitSemicolon: false); Debug.Assert(doneLabel == iterationLabel); doneLabel = prevDone; // reset done label writer.WriteLine($"runtextpos = {startingRunTextPosLocal};"); - Goto(doneLabel); + writer.WriteLine($"goto {doneLabel};"); // Successful iteration. - MarkLabel(successfulIterationLabel); + MarkLabel(successfulIterationLabel, emitSemicolon: false); writer.WriteLine($"{iterationLocal}++;"); } @@ -1983,11 +2366,6 @@ void EmitAtomicNodeLoop(RegexNode node) writer.WriteLine($"goto {originalDoneLabel};"); } } - else - { - // Labels require a statement after them. - writer.WriteLine(";"); - } } } @@ -2538,7 +2916,7 @@ void EmitOneCode(string? label) clause += Code() == RegexCode.Set ? $"!{MatchCharacterClass(hasTextInfo, options, expr, rm.Code.Strings[Operand(0)], IsCaseInsensitive())}" : - $"{ToLowerIfNeeded(hasTextInfo, options, expr, IsCaseInsensitive() && RegexCharClass.ParticipatesInCaseConversion(Operand(0)))} {(Code() == RegexCode.One ? "!=" : "==")} {Operand(0)}"; + $"{ToLowerIfNeeded(hasTextInfo, options, expr, IsCaseInsensitive())} {(Code() == RegexCode.One ? "!=" : "==")} {Operand(0)}"; using (EmitBlock(writer, $"if ({clause})")) { @@ -2555,7 +2933,7 @@ void EmitOneCode(string? label) writer.WriteLine($"if (runtextend - runtextpos < {str.Length} ||"); for (int i = 0; i < str.Length; i++) { - writer.Write($" {ToLowerIfNeeded(hasTextInfo, options, $"runtext[runtextpos{(i == 0 ? "" : $" + {i}")}]", IsCaseInsensitive() && RegexCharClass.ParticipatesInCaseConversion(str[i]))} != {Literal(str[i])}"); + writer.Write($" {ToLowerIfNeeded(hasTextInfo, options, $"runtext[runtextpos{(i == 0 ? "" : $" + {i}")}]", IsCaseInsensitive())} != {Literal(str[i])}"); writer.WriteLine(i < str.Length - 1 ? " ||" : ")"); } using (EmitBlock(writer, null)) @@ -2575,7 +2953,7 @@ void EmitOneCode(string? label) for (int i = str.Length; i > 0;) { i--; - writer.Write($" {ToLowerIfNeeded(hasTextInfo, options, $"runtext[runtextpos - {str.Length - i}]", IsCaseInsensitive() && RegexCharClass.ParticipatesInCaseConversion(str[i]))} != {Literal(str[i])}"); + writer.Write($" {ToLowerIfNeeded(hasTextInfo, options, $"runtext[runtextpos - {str.Length - i}]", IsCaseInsensitive())} != {Literal(str[i])}"); writer.WriteLine(i == 0 ? ")" : " ||"); } using (EmitBlock(writer, null)) @@ -2661,7 +3039,7 @@ void EmitOneCode(string? label) } else { - expr = ToLowerIfNeeded(hasTextInfo, options, expr, IsCaseInsensitive() && RegexCharClass.ParticipatesInCaseConversion(Operand(0))); + expr = ToLowerIfNeeded(hasTextInfo, options, expr, IsCaseInsensitive()); expr = $"{expr} {(Code() == RegexCode.Onerep ? "!=" : "==")} {Literal((char)Operand(0))}"; } @@ -2708,7 +3086,7 @@ void EmitOneCode(string? label) } else { - expr = ToLowerIfNeeded(hasTextInfo, options, expr, IsCaseInsensitive() && RegexCharClass.ParticipatesInCaseConversion(Operand(0))); + expr = ToLowerIfNeeded(hasTextInfo, options, expr, IsCaseInsensitive()); string op = Code() == RegexCode.Onerep ? "!=" : "=="; using (EmitBlock(writer, $"if ({expr} {op} {Literal((char)Operand(0))})")) { @@ -2769,14 +3147,14 @@ void EmitOneCode(string? label) } string? set = Code() == RegexCode.Setloop || Code() == RegexCode.Setloopatomic ? rm.Code.Strings[Operand(0)] : null; - Span setChars = stackalloc char[3]; + Span setChars = stackalloc char[5]; // max optimized by IndexOfAny today int numSetChars; // If this is a notoneloop{atomic} and we're left-to-right and case-sensitive, // we can use the vectorized IndexOf to search for the target character. if ((Code() == RegexCode.Notoneloop || Code() == RegexCode.Notoneloopatomic) && !IsRightToLeft() && - (!IsCaseInsensitive() || !RegexCharClass.ParticipatesInCaseConversion(Operand(0)))) + !IsCaseInsensitive()) { writer.WriteLine($"{I} = global::System.MemoryExtensions.IndexOf(global::System.MemoryExtensions.AsSpan(runtext, runtextpos, {Len}), {Literal((char)Operand(0))}); // i"); using (EmitBlock(writer, $"if ({I} == -1)")) @@ -2793,20 +3171,19 @@ void EmitOneCode(string? label) else if ((Code() == RegexCode.Setloop || Code() == RegexCode.Setloopatomic) && !IsRightToLeft() && !IsCaseInsensitive() && - (numSetChars = RegexCharClass.GetSetChars(set!, setChars)) > 1 && + (numSetChars = RegexCharClass.GetSetChars(set!, setChars)) != 0 && RegexCharClass.IsNegated(set!)) { // Similarly, if this is a setloop{atomic} and we're left-to-right and case-sensitive, - // and if the set contains only 2 or 3 negated chars, we can use the vectorized IndexOfAny + // and if the set contains only a few negated chars, we can use the vectorized IndexOfAny // to search for those chars. - - Debug.Assert(numSetChars is 2 or 3); - writer.Write($"{I} = global::System.MemoryExtensions.IndexOfAny(global::System.MemoryExtensions.AsSpan(runtext, runtextpos, {Len}), {Literal(setChars[0])}, {Literal(setChars[1])}"); - if (numSetChars == 3) + Debug.Assert(numSetChars > 1); + writer.WriteLine(numSetChars switch { - writer.Write($", {Literal(setChars[2])}"); - } - writer.WriteLine("); // i"); + 2 => $"{I} = global::System.MemoryExtensions.IndexOfAny(global::System.MemoryExtensions.AsSpan(runtext, runtextpos, {Len}), {Literal(setChars[0])}, {Literal(setChars[1])}); // i", + 3 => $"{I} = global::System.MemoryExtensions.IndexOfAny(global::System.MemoryExtensions.AsSpan(runtext, runtextpos, {Len}), {Literal(setChars[0])}, {Literal(setChars[1])}, {Literal(setChars[2])}); // i", + _ => $"{I} = global::System.MemoryExtensions.IndexOfAny(global::System.MemoryExtensions.AsSpan(runtext, runtextpos, {Len}), {Literal(setChars.Slice(0, numSetChars).ToString())}); // i", + }); using (EmitBlock(writer, $"if ({I} == -1)")) { writer.WriteLine($"runtextpos += {Len};"); @@ -2846,7 +3223,7 @@ void EmitOneCode(string? label) else { string op = Code() == RegexCode.Oneloop || Code() == RegexCode.Oneloopatomic ? "!=" : "=="; - expr = ToLowerIfNeeded(hasTextInfo, options, expr, IsCaseInsensitive() && RegexCharClass.ParticipatesInCaseConversion(Operand(0))); + expr = ToLowerIfNeeded(hasTextInfo, options, expr, IsCaseInsensitive()); expr = $"{expr} {op} {Literal((char)Operand(0))}"; } @@ -2975,7 +3352,7 @@ void EmitOneCode(string? label) } else { - expr = ToLowerIfNeeded(hasTextInfo, options, expr, IsCaseInsensitive() && RegexCharClass.ParticipatesInCaseConversion(Operand(0))); + expr = ToLowerIfNeeded(hasTextInfo, options, expr, IsCaseInsensitive()); expr = $"{expr} {(Code() == RegexCode.Onelazy ? "!=" : "==")} {Literal((char)Operand(0))}"; } @@ -3223,40 +3600,6 @@ private static bool EmitInitializeCultureForGoIfNecessary(IndentedTextWriter wri private static string ToLowerIfNeeded(bool hasTextInfo, RegexOptions options, string expression, bool toLower) => toLower ? ToLower(hasTextInfo, options, expression) : expression; - private static void EmitTextInfoIfRequired(IndentedTextWriter writer, ref bool textInfoEmitted, ref bool hasTextInfo, RegexMethod rm) - { - if (textInfoEmitted) - { - return; - } - textInfoEmitted = true; - - // Emit local to store current culture if needed - if ((((RegexOptions)rm.Options) & RegexOptions.CultureInvariant) == 0) - { - bool needsCulture = (((RegexOptions)rm.Options) & RegexOptions.IgnoreCase) != 0 || rm.Code.BoyerMoorePrefix?.CaseInsensitive == true; - if (!needsCulture && rm.Code.LeadingCharClasses is not null) - { - for (int i = 0; i < rm.Code.LeadingCharClasses.Length; i++) - { - if (rm.Code.LeadingCharClasses[i].CaseInsensitive) - { - needsCulture = true; - break; - } - } - } - - if (needsCulture) - { - hasTextInfo = true; - writer.WriteLine("// IgnoreCase with CultureInfo.CurrentCulture"); - writer.WriteLine("global::System.Globalization.TextInfo textInfo = global::System.Globalization.CultureInfo.CurrentCulture.TextInfo;"); - writer.WriteLine(); - } - } - } - private static string MatchCharacterClass(bool hasTextInfo, RegexOptions options, string chExpr, string charClass, bool caseInsensitive) { // We need to perform the equivalent of calling RegexRunner.CharInClass(ch, charClass), @@ -3319,22 +3662,32 @@ private static string MatchCharacterClass(bool hasTextInfo, RegexOptions options return $"(char.GetUnicodeCategory({chExpr}) {(negated ? "!=" : "==")} global::System.Globalization.UnicodeCategory.{category})"; } - // Next, if there's only 2 or 3 chars in the set (fairly common due to the sets we create for prefixes), - // it's cheaper and smaller to compare against each than it is to use a lookup table. - if (!invariant) + // Next, if there's only 2, 3, or 4 chars in the set (fairly common due to the sets we create for prefixes), + // it may be cheaper and smaller to compare against each than it is to use a lookup table. We can also special-case + // the very common case with case insensitivity of two characters next to each other being the upper and lowercase + // ASCII variants of each other, in which case we can use bit manipulation to avoid a comparison. + if (!invariant && !RegexCharClass.IsNegated(charClass)) { - Span setChars = stackalloc char[3]; - int numChars = RegexCharClass.GetSetChars(charClass, setChars); - if (!RegexCharClass.IsNegated(charClass)) + Span setChars = stackalloc char[4]; + switch (RegexCharClass.GetSetChars(charClass, setChars)) { - switch (numChars) - { - case 2: - return $"(((ch = {chExpr}) == {Literal(setChars[0])}) | (ch == {Literal(setChars[1])}))"; + case 2: + return (setChars[0] | 0x20) == setChars[1] ? + $"(({chExpr} | 0x20) == {Literal(setChars[1])})" : + $"(((ch = {chExpr}) == {Literal(setChars[0])}) | (ch == {Literal(setChars[1])}))"; - case 3: - return $"(((ch = {chExpr}) == {Literal(setChars[0])}) | (ch == {Literal(setChars[1])}) | (ch == {Literal(setChars[2])}))"; - } + case 3: + return (setChars[0] | 0x20) == setChars[1] ? + $"((((ch = {chExpr}) | 0x20) == {Literal(setChars[1])}) | (ch == {Literal(setChars[2])}))" : + $"(((ch = {chExpr}) == {Literal(setChars[0])}) | (ch == {Literal(setChars[1])}) | (ch == {Literal(setChars[2])}))"; + + case 4: + if (((setChars[0] | 0x20) == setChars[1]) && + ((setChars[2] | 0x20) == setChars[3])) + { + return $"(((ch = ({chExpr} | 0x20)) == {Literal(setChars[1])}) | (ch == {Literal(setChars[3])}))"; + } + break; } } @@ -3419,8 +3772,8 @@ private static string MatchCharacterClass(bool hasTextInfo, RegexOptions options // characters other than that some might be included, for example if the character class // were [\w\d], so since ch >= 128, we need to fall back to calling CharInClass. return invariant ? - $"((ch = {chExpr}) < 128 ? ({Literal(bitVectorString)}[ch >> 4] & (1 << (ch & 0xF))) != 0 : CharInClass(char.ToLowerInvariant((char)ch), {Literal(charClass)}))" : - $"((ch = {chExpr}) < 128 ? ({Literal(bitVectorString)}[ch >> 4] & (1 << (ch & 0xF))) != 0 : CharInClass((char)ch, {Literal(charClass)}))"; + $"((ch = {chExpr}) < 128 ? ({Literal(bitVectorString)}[ch >> 4] & (1 << (ch & 0xF))) != 0 : global::System.Text.RegularExpressions.RegexRunner.CharInClass(char.ToLowerInvariant((char)ch), {Literal(charClass)}))" : + $"((ch = {chExpr}) < 128 ? ({Literal(bitVectorString)}[ch >> 4] & (1 << (ch & 0xF))) != 0 : global::System.Text.RegularExpressions.RegexRunner.CharInClass((char)ch, {Literal(charClass)}))"; } private static string Literal(char c) => SymbolDisplay.FormatLiteral(c, quote: true); diff --git a/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Parser.cs b/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Parser.cs index 045dbd54679689..cb3bed4d27fa29 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Parser.cs +++ b/src/libraries/System.Text.RegularExpressions/gen/RegexGenerator.Parser.cs @@ -178,7 +178,7 @@ private static bool IsSyntaxTargetForGeneration(SyntaxNode node) => RegexCode code; try { - code = RegexWriter.Write(RegexParser.Parse(pattern, regexOptions, culture)); + code = RegexWriter.Write(RegexParser.Parse(pattern, regexOptions, culture), culture); } catch (Exception e) { diff --git a/src/libraries/System.Text.RegularExpressions/gen/Resources/Strings.resx b/src/libraries/System.Text.RegularExpressions/gen/Resources/Strings.resx index 4edd9a7dc7dbb7..4f6ea8594572b2 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/Resources/Strings.resx +++ b/src/libraries/System.Text.RegularExpressions/gen/Resources/Strings.resx @@ -119,9 +119,11 @@ Invalid RegexGenerator usage + {Locked="RegexGenerator"} The RegexGeneratorAttribute is malformed + {Locked="RegexGeneratorAttribute"} Multiple RegexGeneratorAttributes were applied to the same method, but only one is allowed @@ -161,6 +163,7 @@ Capture group numbers must be less than or equal to Int32.MaxValue. + {Locked="Int32.MaxValue"} Capture number cannot be zero. @@ -188,6 +191,7 @@ Internal error in ScanRegex. + {Locked="ScanRegex"} Invalid group name: Group names must begin with a word character. @@ -305,5 +309,6 @@ Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. + {Locked="RegexOptions.NonBacktracking"} diff --git a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.cs.xlf b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.cs.xlf index 5c933786208a19..311813a6cf146f 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.cs.xlf +++ b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.cs.xlf @@ -110,7 +110,7 @@ Internal error in ScanRegex. Vnitřní chyba v modulu ScanRegex. - + {Locked="ScanRegex"} Argument {0} cannot be zero-length. @@ -135,12 +135,12 @@ The RegexGeneratorAttribute is malformed Atribut RegexGeneratorAttribute je nesprávný. - + {Locked="RegexGeneratorAttribute"} Invalid RegexGenerator usage Neplatné použití RegexGenerator - + {Locked="RegexGenerator"} Incomplete \\p{X} character escape. @@ -194,8 +194,8 @@ Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - + Nahrazení regulárních výrazů pomocí substitucí skupin se u RegexOptions.NonBacktracking nepodporuje. + {Locked="RegexOptions.NonBacktracking"} Collection is read-only. @@ -220,7 +220,7 @@ Capture group numbers must be less than or equal to Int32.MaxValue. Počty skupin digitalizace musí být menší nebo rovny hodnotě Int32.MaxValue. - + {Locked="Int32.MaxValue"} The RegEx engine has timed out while trying to match a pattern to an input string. This can occur for many reasons, including very large inputs or excessive backtracking caused by nested quantifiers, back-references and other factors. diff --git a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.de.xlf b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.de.xlf index 821165f07545cd..532c4b4bee22f4 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.de.xlf +++ b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.de.xlf @@ -110,7 +110,7 @@ Internal error in ScanRegex. Interner Fehler in ScanRegex. - + {Locked="ScanRegex"} Argument {0} cannot be zero-length. @@ -135,12 +135,12 @@ The RegexGeneratorAttribute is malformed Das RegexGeneratorAttribute ist falsch formatiert. - + {Locked="RegexGeneratorAttribute"} Invalid RegexGenerator usage Ungültige RegexGenerator-Verwendung - + {Locked="RegexGenerator"} Incomplete \\p{X} character escape. @@ -194,8 +194,8 @@ Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - + RegEx-Ersätze durch Austausch von Gruppen werden bei RegexOptions.NonBacktracking nicht unterstützt. + {Locked="RegexOptions.NonBacktracking"} Collection is read-only. @@ -220,7 +220,7 @@ Capture group numbers must be less than or equal to Int32.MaxValue. Erfassungsgruppennummern müssen kleiner oder gleich Int32.MaxValue sein. - + {Locked="Int32.MaxValue"} The RegEx engine has timed out while trying to match a pattern to an input string. This can occur for many reasons, including very large inputs or excessive backtracking caused by nested quantifiers, back-references and other factors. diff --git a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.es.xlf b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.es.xlf index f0f919acc6e5bd..14bedaae5801c3 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.es.xlf +++ b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.es.xlf @@ -110,7 +110,7 @@ Internal error in ScanRegex. Error interno en ScanRegex. - + {Locked="ScanRegex"} Argument {0} cannot be zero-length. @@ -135,12 +135,12 @@ The RegexGeneratorAttribute is malformed RegexGeneratorAttribute tiene un formato incorrecto - + {Locked="RegexGeneratorAttribute"} Invalid RegexGenerator usage Uso de RegexGenerator no válido - + {Locked="RegexGenerator"} Incomplete \\p{X} character escape. @@ -194,8 +194,8 @@ Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - + Los reemplazos de regex con sustituciones de grupos no se admiten con RegexOptions.NonBacktracking. + {Locked="RegexOptions.NonBacktracking"} Collection is read-only. @@ -220,7 +220,7 @@ Capture group numbers must be less than or equal to Int32.MaxValue. Los números del grupo de capturas deben ser menores o iguales que Int32.MaxValue. - + {Locked="Int32.MaxValue"} The RegEx engine has timed out while trying to match a pattern to an input string. This can occur for many reasons, including very large inputs or excessive backtracking caused by nested quantifiers, back-references and other factors. diff --git a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.fr.xlf b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.fr.xlf index 0a9bb527192bd5..e1c7019d5872b4 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.fr.xlf +++ b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.fr.xlf @@ -110,7 +110,7 @@ Internal error in ScanRegex. Erreur interne dans ScanRegex. - + {Locked="ScanRegex"} Argument {0} cannot be zero-length. @@ -135,12 +135,12 @@ The RegexGeneratorAttribute is malformed RegexGeneratorAttribute est malformé - + {Locked="RegexGeneratorAttribute"} Invalid RegexGenerator usage Utilisation de RegexGenerator non valide - + {Locked="RegexGenerator"} Incomplete \\p{X} character escape. @@ -194,8 +194,8 @@ Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - + Les remplacements d'expressions régulières avec des substitutions de groupes ne sont pas pris en charge avec RegexOptions.NonBacktracking. + {Locked="RegexOptions.NonBacktracking"} Collection is read-only. @@ -220,7 +220,7 @@ Capture group numbers must be less than or equal to Int32.MaxValue. Les nombres de groupes de capture doivent être inférieurs ou égaux à Int32.MaxValue. - + {Locked="Int32.MaxValue"} The RegEx engine has timed out while trying to match a pattern to an input string. This can occur for many reasons, including very large inputs or excessive backtracking caused by nested quantifiers, back-references and other factors. diff --git a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.it.xlf b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.it.xlf index 30d0b81bd4b420..52becd96f3fa7a 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.it.xlf +++ b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.it.xlf @@ -110,7 +110,7 @@ Internal error in ScanRegex. Errore interno in ScanRegex. - + {Locked="ScanRegex"} Argument {0} cannot be zero-length. @@ -135,12 +135,12 @@ The RegexGeneratorAttribute is malformed RegexGeneratorAttribute non è valido - + {Locked="RegexGeneratorAttribute"} Invalid RegexGenerator usage Utilizzo di RegexGenerator non valido - + {Locked="RegexGenerator"} Incomplete \\p{X} character escape. @@ -194,8 +194,8 @@ Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - + Le sostituzioni regex con sostituzioni di gruppi non sono supportate con RegexOptions.NonBacktracking. + {Locked="RegexOptions.NonBacktracking"} Collection is read-only. @@ -220,7 +220,7 @@ Capture group numbers must be less than or equal to Int32.MaxValue. I numeri del gruppo Capture devono essere minori o uguali a Int32.MaxValue. - + {Locked="Int32.MaxValue"} The RegEx engine has timed out while trying to match a pattern to an input string. This can occur for many reasons, including very large inputs or excessive backtracking caused by nested quantifiers, back-references and other factors. diff --git a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.ja.xlf b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.ja.xlf index fe5540dc87d23a..b27fec1ee2afdd 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.ja.xlf +++ b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.ja.xlf @@ -110,7 +110,7 @@ Internal error in ScanRegex. ScanRegex に内部エラーが発生しました。 - + {Locked="ScanRegex"} Argument {0} cannot be zero-length. @@ -135,12 +135,12 @@ The RegexGeneratorAttribute is malformed RegexGeneratorAttribute の形式に誤りがあります - + {Locked="RegexGeneratorAttribute"} Invalid RegexGenerator usage RegexGenerator の使用法が無効です - + {Locked="RegexGenerator"} Incomplete \\p{X} character escape. @@ -194,8 +194,8 @@ Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - + RegexOptions.NonBacktracking では、グループの置換による正規表現の置換はサポートされていません。 + {Locked="RegexOptions.NonBacktracking"} Collection is read-only. @@ -220,7 +220,7 @@ Capture group numbers must be less than or equal to Int32.MaxValue. キャプチャ グループ数は、Int32.MaxValue 以下でなければなりません。 - + {Locked="Int32.MaxValue"} The RegEx engine has timed out while trying to match a pattern to an input string. This can occur for many reasons, including very large inputs or excessive backtracking caused by nested quantifiers, back-references and other factors. diff --git a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.ko.xlf b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.ko.xlf index 6654610f3f303c..8ec1a365f3f9f0 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.ko.xlf +++ b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.ko.xlf @@ -110,7 +110,7 @@ Internal error in ScanRegex. ScanRegex에 내부 오류가 있습니다. - + {Locked="ScanRegex"} Argument {0} cannot be zero-length. @@ -135,12 +135,12 @@ The RegexGeneratorAttribute is malformed RegexGeneratorAttribute의 형식이 잘못되었습니다. - + {Locked="RegexGeneratorAttribute"} Invalid RegexGenerator usage 잘못된 RegexGenerator 사용 - + {Locked="RegexGenerator"} Incomplete \\p{X} character escape. @@ -194,8 +194,8 @@ Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - + RegexOptions.NonBacktracking에서는 그룹을 대체하는 Regex 대체가 지원되지 않습니다. + {Locked="RegexOptions.NonBacktracking"} Collection is read-only. @@ -220,7 +220,7 @@ Capture group numbers must be less than or equal to Int32.MaxValue. 캡처 그룹 번호는 Int32.MaxValue보다 작거나 같아야 합니다. - + {Locked="Int32.MaxValue"} The RegEx engine has timed out while trying to match a pattern to an input string. This can occur for many reasons, including very large inputs or excessive backtracking caused by nested quantifiers, back-references and other factors. diff --git a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.pl.xlf b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.pl.xlf index f84553cffe9b58..3879856ae00738 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.pl.xlf +++ b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.pl.xlf @@ -110,7 +110,7 @@ Internal error in ScanRegex. Błąd wewnętrzny w elemencie ScanRegex. - + {Locked="ScanRegex"} Argument {0} cannot be zero-length. @@ -135,12 +135,12 @@ The RegexGeneratorAttribute is malformed Atrybut RegexGeneratorAttribute jest źle sformułowany - + {Locked="RegexGeneratorAttribute"} Invalid RegexGenerator usage Nieprawidłowe użycie atrybutu RegexGenerator - + {Locked="RegexGenerator"} Incomplete \\p{X} character escape. @@ -194,8 +194,8 @@ Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - + Zamiany wyrażeń regularnych z podstawieniami grup nie są obsługiwane w przypadku metody RegexOptions.NonBacktracking. + {Locked="RegexOptions.NonBacktracking"} Collection is read-only. @@ -220,7 +220,7 @@ Capture group numbers must be less than or equal to Int32.MaxValue. Numery grup przechwytywania muszą być mniejsze lub równe wartości Int32.MaxValue. - + {Locked="Int32.MaxValue"} The RegEx engine has timed out while trying to match a pattern to an input string. This can occur for many reasons, including very large inputs or excessive backtracking caused by nested quantifiers, back-references and other factors. diff --git a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.pt-BR.xlf b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.pt-BR.xlf index ee284582bf53e2..be090a6d3611bd 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.pt-BR.xlf +++ b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.pt-BR.xlf @@ -110,7 +110,7 @@ Internal error in ScanRegex. Erro interno em ScanRegex. - + {Locked="ScanRegex"} Argument {0} cannot be zero-length. @@ -135,12 +135,12 @@ The RegexGeneratorAttribute is malformed O RegexGeneratorAttribute está malformado - + {Locked="RegexGeneratorAttribute"} Invalid RegexGenerator usage Uso Inválido do RegexGenerator - + {Locked="RegexGenerator"} Incomplete \\p{X} character escape. @@ -194,8 +194,8 @@ Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - + Substituições de regex com substituições de grupos não são suportadas com RegexOptions.NonBacktracking. + {Locked="RegexOptions.NonBacktracking"} Collection is read-only. @@ -220,7 +220,7 @@ Capture group numbers must be less than or equal to Int32.MaxValue. Os números de grupo de captura devem ser menores que ou iguais a Int32.MaxValue. - + {Locked="Int32.MaxValue"} The RegEx engine has timed out while trying to match a pattern to an input string. This can occur for many reasons, including very large inputs or excessive backtracking caused by nested quantifiers, back-references and other factors. diff --git a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.ru.xlf b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.ru.xlf index 99b880cc7b40ad..08b344ec0d923b 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.ru.xlf +++ b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.ru.xlf @@ -110,7 +110,7 @@ Internal error in ScanRegex. Внутренняя ошибка в ScanRegex. - + {Locked="ScanRegex"} Argument {0} cannot be zero-length. @@ -135,12 +135,12 @@ The RegexGeneratorAttribute is malformed Ошибка в регулярном выражении RegexGeneratorAttribute - + {Locked="RegexGeneratorAttribute"} Invalid RegexGenerator usage Недопустимое использование RegexGenerator - + {Locked="RegexGenerator"} Incomplete \\p{X} character escape. @@ -194,8 +194,8 @@ Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - + Замена регулярных выражений на группы не поддерживается в RegexOptions.NonBacktracking. + {Locked="RegexOptions.NonBacktracking"} Collection is read-only. @@ -220,7 +220,7 @@ Capture group numbers must be less than or equal to Int32.MaxValue. Номера групп захвата должны быть меньше или равны Int32.MaxValue. - + {Locked="Int32.MaxValue"} The RegEx engine has timed out while trying to match a pattern to an input string. This can occur for many reasons, including very large inputs or excessive backtracking caused by nested quantifiers, back-references and other factors. diff --git a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.tr.xlf b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.tr.xlf index bb6c8e1863a10c..70d5c0b730b72e 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.tr.xlf +++ b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.tr.xlf @@ -110,7 +110,7 @@ Internal error in ScanRegex. ScanRegex iç hatası. - + {Locked="ScanRegex"} Argument {0} cannot be zero-length. @@ -135,12 +135,12 @@ The RegexGeneratorAttribute is malformed RegexGeneratorAttribute hatalı biçimlendirilmiş - + {Locked="RegexGeneratorAttribute"} Invalid RegexGenerator usage Geçersiz RegexGenerator kullanımı - + {Locked="RegexGenerator"} Incomplete \\p{X} character escape. @@ -194,8 +194,8 @@ Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - + Grup değiştirmeleri içeren normal ifade değiştirmeleri RegexOptions.NonBacktracking ile desteklenmez. + {Locked="RegexOptions.NonBacktracking"} Collection is read-only. @@ -220,7 +220,7 @@ Capture group numbers must be less than or equal to Int32.MaxValue. Yakalama grubu numaraları Int32.MaxValue değerine eşit veya bundan küçük olmalıdır. - + {Locked="Int32.MaxValue"} The RegEx engine has timed out while trying to match a pattern to an input string. This can occur for many reasons, including very large inputs or excessive backtracking caused by nested quantifiers, back-references and other factors. diff --git a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.zh-Hans.xlf b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.zh-Hans.xlf index a17a2102fd7d33..047c5b18c02937 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.zh-Hans.xlf @@ -110,7 +110,7 @@ Internal error in ScanRegex. ScanRegex 中的内部错误。 - + {Locked="ScanRegex"} Argument {0} cannot be zero-length. @@ -135,12 +135,12 @@ The RegexGeneratorAttribute is malformed RegexGeneratorAttribute 格式不正确 - + {Locked="RegexGeneratorAttribute"} Invalid RegexGenerator usage 无效的 RegexGenerator 用法 - + {Locked="RegexGenerator"} Incomplete \\p{X} character escape. @@ -194,8 +194,8 @@ Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - + RegexOptions.NonBacktracking 不支持使用组替换的正则表达式替换。 + {Locked="RegexOptions.NonBacktracking"} Collection is read-only. @@ -220,7 +220,7 @@ Capture group numbers must be less than or equal to Int32.MaxValue. 捕获组的数量必须小于或等于 Int32.MaxValue。 - + {Locked="Int32.MaxValue"} The RegEx engine has timed out while trying to match a pattern to an input string. This can occur for many reasons, including very large inputs or excessive backtracking caused by nested quantifiers, back-references and other factors. diff --git a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.zh-Hant.xlf b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.zh-Hant.xlf index 6c552441ce0e9f..0d2b1fff76ba1c 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/libraries/System.Text.RegularExpressions/gen/Resources/xlf/Strings.zh-Hant.xlf @@ -110,7 +110,7 @@ Internal error in ScanRegex. ScanRegex 發生內部錯誤。 - + {Locked="ScanRegex"} Argument {0} cannot be zero-length. @@ -135,12 +135,12 @@ The RegexGeneratorAttribute is malformed RegexGeneratorAttribute 格式錯誤 - + {Locked="RegexGeneratorAttribute"} Invalid RegexGenerator usage 無效的 RegexGenerator 使用方式 - + {Locked="RegexGenerator"} Incomplete \\p{X} character escape. @@ -194,8 +194,8 @@ Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. - + RegexOptions.NonBacktracking 不支援以替代群組取代 Regex。 + {Locked="RegexOptions.NonBacktracking"} Collection is read-only. @@ -220,7 +220,7 @@ Capture group numbers must be less than or equal to Int32.MaxValue. 擷取的群組數目必須小於或等於 Int32.MaxValue。 - + {Locked="Int32.MaxValue"} The RegEx engine has timed out while trying to match a pattern to an input string. This can occur for many reasons, including very large inputs or excessive backtracking caused by nested quantifiers, back-references and other factors. diff --git a/src/libraries/System.Text.RegularExpressions/gen/Stubs.cs b/src/libraries/System.Text.RegularExpressions/gen/Stubs.cs index aefab1dc1b0576..13626a4be5a3bc 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/Stubs.cs +++ b/src/libraries/System.Text.RegularExpressions/gen/Stubs.cs @@ -54,13 +54,13 @@ namespace System.Threading { internal static class InterlockedExtensions { - public static int Or(ref int location1, int value) + public static uint Or(ref uint location1, uint value) { - int current = location1; + uint current = location1; while (true) { - int newValue = current | value; - int oldValue = Interlocked.CompareExchange(ref location1, newValue, current); + uint newValue = current | value; + uint oldValue = (uint)Interlocked.CompareExchange(ref Unsafe.As(ref location1), (int)newValue, (int)current); if (oldValue == current) { return oldValue; diff --git a/src/libraries/System.Text.RegularExpressions/gen/System.Text.RegularExpressions.Generator.csproj b/src/libraries/System.Text.RegularExpressions/gen/System.Text.RegularExpressions.Generator.csproj index 7f59e37493cd85..8e1ec70d99d6cc 100644 --- a/src/libraries/System.Text.RegularExpressions/gen/System.Text.RegularExpressions.Generator.csproj +++ b/src/libraries/System.Text.RegularExpressions/gen/System.Text.RegularExpressions.Generator.csproj @@ -30,10 +30,10 @@ - + diff --git a/src/libraries/System.Text.RegularExpressions/src/Resources/Strings.resx b/src/libraries/System.Text.RegularExpressions/src/Resources/Strings.resx index 4f4fef7a861e7e..ba430db54c5a3b 100644 --- a/src/libraries/System.Text.RegularExpressions/src/Resources/Strings.resx +++ b/src/libraries/System.Text.RegularExpressions/src/Resources/Strings.resx @@ -111,6 +111,7 @@ Internal error in ScanRegex. + {Locked="ScanRegex"} Invalid group name: Group names must begin with a word character. @@ -225,12 +226,15 @@ Regex replacements with substitutions of groups are not supported with RegexOptions.NonBacktracking. + {Locked="RegexOptions.NonBacktracking"} RegexOptions.NonBacktracking is not supported in conjunction with RegexOptions.{0}. + {Locked="RegexOptions.NonBacktracking"} RegexOptions.NonBacktracking is not supported in conjunction with expressions containing: '{0}'. + {Locked="RegexOptions.NonBacktracking"} backreference (\\ number) diff --git a/src/libraries/System.Text.RegularExpressions/src/System.Text.RegularExpressions.csproj b/src/libraries/System.Text.RegularExpressions/src/System.Text.RegularExpressions.csproj index 17f1d0fc877e64..8537fd70de5276 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System.Text.RegularExpressions.csproj +++ b/src/libraries/System.Text.RegularExpressions/src/System.Text.RegularExpressions.csproj @@ -23,11 +23,11 @@ - + @@ -100,11 +100,15 @@ + + + + diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.Cache.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.Cache.cs index edcb23b1cdba95..66b1a8108c4ab3 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.Cache.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.Cache.cs @@ -128,7 +128,7 @@ public static Regex GetOrAdd(string pattern, RegexOptions options, TimeSpan matc Regex.ValidateOptions(options); Regex.ValidateMatchTimeout(matchTimeout); - CultureInfo culture = (options & RegexOptions.CultureInvariant) != 0 ? CultureInfo.InvariantCulture : CultureInfo.CurrentCulture; + CultureInfo culture = RegexParser.GetTargetCulture(options); Key key = new Key(pattern, culture.ToString(), options, matchTimeout); Regex? regex = Get(key); diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.cs index 85d575ccaf1938..ee276b33deb756 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.cs @@ -65,12 +65,12 @@ internal Regex(string pattern, CultureInfo? culture) // Call Init directly rather than delegating to a Regex ctor that takes // options to enable linking / tree shaking to remove the Regex compiler // and NonBacktracking implementation if it's not used. - Init(pattern, RegexOptions.None, s_defaultMatchTimeout, culture); + Init(pattern, RegexOptions.None, s_defaultMatchTimeout, culture ?? CultureInfo.CurrentCulture); } internal Regex(string pattern, RegexOptions options, TimeSpan matchTimeout, CultureInfo? culture) { - culture ??= GetTargetCulture(options); + culture ??= RegexParser.GetTargetCulture(options); Init(pattern, options, matchTimeout, culture); if ((options & RegexOptions.NonBacktracking) != 0) @@ -87,10 +87,6 @@ internal Regex(string pattern, RegexOptions options, TimeSpan matchTimeout, Cult } } - /// Gets the culture to use based on the specified options. - private static CultureInfo GetTargetCulture(RegexOptions options) => - (options & RegexOptions.CultureInvariant) != 0 ? CultureInfo.InvariantCulture : CultureInfo.CurrentCulture; - /// Initializes the instance. /// /// This is separated out of the constructor so that an app only using 'new Regex(pattern)' @@ -98,7 +94,7 @@ private static CultureInfo GetTargetCulture(RegexOptions options) => /// compiler, such that a tree shaker / linker can trim it away if it's not otherwise used. /// [MemberNotNull(nameof(_code))] - private void Init(string pattern, RegexOptions options, TimeSpan matchTimeout, CultureInfo? culture) + private void Init(string pattern, RegexOptions options, TimeSpan matchTimeout, CultureInfo culture) { ValidatePattern(pattern); ValidateOptions(options); @@ -107,7 +103,6 @@ private void Init(string pattern, RegexOptions options, TimeSpan matchTimeout, C this.pattern = pattern; internalMatchTimeout = matchTimeout; roptions = options; - culture ??= GetTargetCulture(options); #if DEBUG if (IsDebug) @@ -121,7 +116,7 @@ private void Init(string pattern, RegexOptions options, TimeSpan matchTimeout, C // Generate the RegexCode from the node tree. This is required for interpreting, // and is used as input into RegexOptions.Compiled and RegexOptions.NonBacktracking. - _code = RegexWriter.Write(tree); + _code = RegexWriter.Write(tree, culture); if ((options & RegexOptions.NonBacktracking) != 0) { @@ -434,7 +429,7 @@ internal void Run(string input, int startat, ref TState state, MatchCall /// Creates a new runner instance. private RegexRunner CreateRunner() => factory?.CreateInstance() ?? - new RegexInterpreter(_code!, GetTargetCulture(roptions)); + new RegexInterpreter(_code!, RegexParser.GetTargetCulture(roptions)); /// True if the option was set. protected bool UseOptionC() => (roptions & RegexOptions.Compiled) != 0; diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexBoyerMoore.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexBoyerMoore.cs deleted file mode 100644 index 7fc3fb1edf3bae..00000000000000 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexBoyerMoore.cs +++ /dev/null @@ -1,404 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// The RegexBoyerMoore object precomputes the Boyer-Moore -// tables for fast string scanning. These tables allow -// you to scan for the first occurrence of a string within -// a large body of text without examining every character. -// The performance of the heuristic depends on the actual -// string and the text being searched, but usually, the longer -// the string that is being searched for, the fewer characters -// need to be examined. - -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; - -namespace System.Text.RegularExpressions -{ - internal sealed class RegexBoyerMoore - { - public readonly int[] Positive; - public readonly int[] NegativeASCII; - public readonly int[][]? NegativeUnicode; - public readonly string Pattern; - public readonly int LowASCII; - public readonly int HighASCII; - public readonly bool RightToLeft; - public readonly bool CaseInsensitive; - private readonly CultureInfo _culture; - - /// The maximum prefix string length for which we'll attempt to create a Boyer-Moore table. - /// This is limited in order to minimize the overhead of constructing a Regex. - public const int MaxLimit = 50_000; // must be <= char.MaxValue for RegexCompiler to compile Boyer-Moore correctly - - /// - /// Constructs a Boyer-Moore state machine for searching for the string - /// pattern. The string must not be zero-length. - /// - public RegexBoyerMoore(string pattern, bool caseInsensitive, bool rightToLeft, CultureInfo culture) - { - // Sorry, you just can't use Boyer-Moore to find an empty pattern. - // We're doing this for your own protection. (Really, for speed.) - Debug.Assert(pattern.Length != 0, "RegexBoyerMoore called with an empty string. This is bad for perf"); - Debug.Assert(pattern.Length <= MaxLimit, "RegexBoyerMoore can take a long time for large patterns"); -#if DEBUG - if (caseInsensitive) - { - foreach (char c in pattern) - { - // We expect each individual character to have been lower-cased. We don't validate the whole - // string at once because the rest of the library doesn't currently recognize/support surrogate pairs. - Debug.Assert(c == culture.TextInfo.ToLower(c), "Pattern wasn't lowercased with provided culture"); - } - } -#endif - - Pattern = pattern; - RightToLeft = rightToLeft; - CaseInsensitive = caseInsensitive; - _culture = culture; - - int beforefirst; - int last; - int bump; - - if (!rightToLeft) - { - beforefirst = -1; - last = pattern.Length - 1; - bump = 1; - } - else - { - beforefirst = pattern.Length; - last = 0; - bump = -1; - } - - // PART I - the good-suffix shift table - // - // compute the positive requirement: - // if char "i" is the first one from the right that doesn't match, - // then we know the matcher can advance by _positive[i]. - // - // This algorithm is a simplified variant of the standard - // Boyer-Moore good suffix calculation. - - Positive = new int[pattern.Length]; - - int examine = last; - char ch = pattern[examine]; - Positive[examine] = bump; - examine -= bump; - int scan; - int match; - - while (true) - { - // find an internal char (examine) that matches the tail - - while (true) - { - if (examine == beforefirst) - goto OuterloopBreak; - if (pattern[examine] == ch) - break; - examine -= bump; - } - - match = last; - scan = examine; - - // find the length of the match - - while (true) - { - if (scan == beforefirst || pattern[match] != pattern[scan]) - { - // at the end of the match, note the difference in _positive - // this is not the length of the match, but the distance from the internal match - // to the tail suffix. - if (Positive[match] == 0) - Positive[match] = match - scan; - - break; - } - - scan -= bump; - match -= bump; - } - - examine -= bump; - } - - OuterloopBreak: - - match = last - bump; - - // scan for the chars for which there are no shifts that yield a different candidate - - - // The inside of the if statement used to say - // "_positive[match] = last - beforefirst;" - // This is slightly less aggressive in how much we skip, but at worst it - // should mean a little more work rather than skipping a potential match. - while (match != beforefirst) - { - if (Positive[match] == 0) - Positive[match] = bump; - - match -= bump; - } - - // PART II - the bad-character shift table - // - // compute the negative requirement: - // if char "ch" is the reject character when testing position "i", - // we can slide up by _negative[ch]; - // (_negative[ch] = str.Length - 1 - str.LastIndexOf(ch)) - // - // the lookup table is divided into ASCII and Unicode portions; - // only those parts of the Unicode 16-bit code set that actually - // appear in the string are in the table. (Maximum size with - // Unicode is 65K; ASCII only case is 512 bytes.) - - NegativeASCII = new int[128]; - - for (int i = 0; i < 128; i++) - NegativeASCII[i] = last - beforefirst; - - LowASCII = 127; - HighASCII = 0; - - for (examine = last; examine != beforefirst; examine -= bump) - { - ch = pattern[examine]; - - if (ch < 128) - { - if (LowASCII > ch) - LowASCII = ch; - - if (HighASCII < ch) - HighASCII = ch; - - if (NegativeASCII[ch] == last - beforefirst) - NegativeASCII[ch] = last - examine; - } - else - { - int i = ch >> 8; - int j = ch & 0xFF; - - if (NegativeUnicode == null) - { - NegativeUnicode = new int[256][]; - } - - if (NegativeUnicode[i] == null) - { - int[] newarray = new int[256]; - - for (int k = 0; k < newarray.Length; k++) - newarray[k] = last - beforefirst; - - if (i == 0) - { - Array.Copy(NegativeASCII, newarray, 128); - NegativeASCII = newarray; - } - - NegativeUnicode[i] = newarray; - } - - if (NegativeUnicode[i][j] == last - beforefirst) - NegativeUnicode[i][j] = last - examine; - } - } - } - - // TODO: We should be able to avoid producing the RegexBoyerMoore instance - // entirely if we're going to go down the code path of using IndexOf. That will - // require some refactoring, though. - - /// Gets whether IndexOf could be used to perform the match. - public bool PatternSupportsIndexOf => - !RightToLeft && (!CaseInsensitive || !RegexCharClass.ParticipatesInCaseConversion(Pattern)); - - /// - /// When a regex is anchored, we can do a quick IsMatch test instead of a Scan - /// - public bool IsMatch(string text, int index, int beglimit, int endlimit) - { - if (!RightToLeft) - { - if (index < beglimit || endlimit - index < Pattern.Length) - return false; - } - else - { - if (index > endlimit || index - beglimit < Pattern.Length) - return false; - - index -= Pattern.Length; - } - - if (CaseInsensitive) - { - TextInfo textinfo = _culture.TextInfo; - - for (int i = 0; i < Pattern.Length; i++) - { - if (Pattern[i] != textinfo.ToLower(text[index + i])) - { - return false; - } - } - - return true; - } - - return Pattern.AsSpan().SequenceEqual(text.AsSpan(index, Pattern.Length)); - } - - /// - /// Scan uses the Boyer-Moore algorithm to find the first occurrence - /// of the specified string within text, beginning at index, and - /// constrained within beglimit and endlimit. - /// - /// The direction and case-sensitivity of the match is determined - /// by the arguments to the RegexBoyerMoore constructor. - /// - public int Scan(string text, int index, int beglimit, int endlimit) - { - int defadv; - int test; - int startmatch; - int endmatch; - int bump; - - if (!RightToLeft) - { - defadv = Pattern.Length; - startmatch = Pattern.Length - 1; - endmatch = 0; - test = index + defadv - 1; - bump = 1; - } - else - { - defadv = -Pattern.Length; - startmatch = 0; - endmatch = -defadv - 1; - test = index + defadv; - bump = -1; - } - - char chMatch = Pattern[startmatch]; - char chTest; - int test2; - int match; - int advance; - int[] unicodeLookup; - - while (true) - { - if (test >= endlimit || test < beglimit) - return -1; - - chTest = text[test]; - - if (CaseInsensitive) - chTest = _culture.TextInfo.ToLower(chTest); - - if (chTest != chMatch) - { - if (chTest < 128) - advance = NegativeASCII[chTest]; - else if (null != NegativeUnicode && (null != (unicodeLookup = NegativeUnicode[chTest >> 8]))) - advance = unicodeLookup[chTest & 0xFF]; - else - advance = defadv; - - test += advance; - } - else - { // if (chTest == chMatch) - test2 = test; - match = startmatch; - - while (true) - { - if (match == endmatch) - return (RightToLeft ? test2 + 1 : test2); - - match -= bump; - test2 -= bump; - - chTest = text[test2]; - - if (CaseInsensitive) - chTest = _culture.TextInfo.ToLower(chTest); - - if (chTest != Pattern[match]) - { - advance = Positive[match]; - if ((chTest & 0xFF80) == 0) - test2 = (match - startmatch) + NegativeASCII[chTest]; - else if (null != NegativeUnicode && (null != (unicodeLookup = NegativeUnicode[chTest >> 8]))) - test2 = (match - startmatch) + unicodeLookup[chTest & 0xFF]; - else - { - test += advance; - break; - } - - if (RightToLeft ? test2 < advance : test2 > advance) - advance = test2; - - test += advance; - break; - } - } - } - } - } - -#if DEBUG - /// Used when dumping for debugging. - [ExcludeFromCodeCoverage] - public override string ToString() => Dump(string.Empty); - - [ExcludeFromCodeCoverage] - public string Dump(string indent) - { - var sb = new StringBuilder(); - - sb.AppendLine($"{indent}BM Pattern: {Pattern}"); - - sb.Append($"{indent}Positive: "); - foreach (int i in Positive) - { - sb.Append($"{i} "); - } - sb.AppendLine(); - - if (NegativeASCII != null) - { - sb.Append($"{indent}Negative table: "); - for (int i = 0; i < NegativeASCII.Length; i++) - { - if (NegativeASCII[i] != Pattern.Length) - { - sb.Append($" {{{Regex.Escape(((char)i).ToString())} {NegativeASCII[i]}}}"); - } - } - } - sb.AppendLine(); - - return sb.ToString(); - } -#endif - } -} diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCharClass.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCharClass.cs index 1c2cf0ff658178..e78f23c1c5032f 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCharClass.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCharClass.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; +using System.Runtime.CompilerServices; using System.Threading; namespace System.Text.RegularExpressions @@ -71,6 +72,7 @@ internal sealed partial class RegexCharClass internal const string NotECMADigitClass = "\x01\x02\x00" + ECMADigitSet; internal const string AnyClass = "\x00\x01\x00\x00"; + private const string EmptyClass = "\x00\x00\x00"; // UnicodeCategory is zero based, so we add one to each value and subtract it off later private const int DefinedCategoriesCapacity = 38; @@ -874,9 +876,9 @@ public static bool ParticipatesInCaseConversion(int comparison) } } - /// Gets whether the specified string participates in case conversion. - /// The string participates in case conversion if any of its characters do. - public static bool ParticipatesInCaseConversion(string s) + /// Gets whether the specified span participates in case conversion. + /// The span participates in case conversion if any of its characters do. + public static bool ParticipatesInCaseConversion(ReadOnlySpan s) { foreach (char c in s) { @@ -890,6 +892,7 @@ public static bool ParticipatesInCaseConversion(string s) } /// Gets whether we can iterate through the set list pairs in order to completely enumerate the set's contents. + /// This may enumerate negated characters if the set is negated. private static bool CanEasilyEnumerateSetContents(string set) => set.Length > SetStartIndex && set[SetLengthIndex] > 0 && @@ -1013,61 +1016,69 @@ public static bool IsWordChar(char ch) } } - public static bool CharInClass(char ch, string set, ref int[]? asciiResultCache) + /// Determines a character's membership in a character class (via the string representation of the class). + /// The character. + /// The string representation of the character class. + /// A lazily-populated cache for ASCII results stored in a 256-bit array. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool CharInClass(char ch, string set, ref uint[]? asciiLazyCache) { - // The int[] contains 8 ints, or 256 bits. These are laid out as pairs, where the first bit ("known") in the pair - // says whether the second bit ("value") in the pair has already been computed. Once a value is computed, it's never + // The uint[] contains 8 ints, or 256 bits. These are laid out as pairs, where the first bit in the pair + // says whether the second bit in the pair has already been computed. Once a value is computed, it's never // changed, so since Int32s are written/read atomically, we can trust the value bit if we see that the known bit // has been set. If the known bit hasn't been set, then we proceed to look it up, and then swap in the result. const int CacheArrayLength = 8; - Debug.Assert(asciiResultCache is null || asciiResultCache.Length == CacheArrayLength, "set lookup should be able to store two bits for each of the first 128 characters"); + Debug.Assert(asciiLazyCache is null || asciiLazyCache.Length == CacheArrayLength, "set lookup should be able to store two bits for each of the first 128 characters"); - if (ch < 128) + // If the value is ASCII and already has an answer for this value, use it. + if (asciiLazyCache is uint[] cache) { - // Lazily-initialize the cache for this set. - if (asciiResultCache is null) + int index = ch >> 4; + if ((uint)index < (uint)cache.Length) { - Interlocked.CompareExchange(ref asciiResultCache, new int[CacheArrayLength], null); + Debug.Assert(ch < 128); + uint current = cache[index]; + uint bit = 1u << ((ch & 0xF) << 1); + if ((current & bit) != 0) + { + return (current & (bit << 1)) != 0; + } } + } - // Determine which int in the lookup array contains the known and value bits for this character, - // and compute their bit numbers. - ref int slot = ref asciiResultCache[ch >> 4]; - int knownBit = 1 << ((ch & 0xF) << 1); - int valueBit = knownBit << 1; - - // If the value for this bit has already been computed, use it. - int current = slot; - if ((current & knownBit) != 0) - { - return (current & valueBit) != 0; - } + // For ASCII, lazily initialize. For non-ASCII, just compute the value. + return ch < 128 ? + InitializeValue(ch, set, ref asciiLazyCache) : + CharInClassRecursive(ch, set, 0); + static bool InitializeValue(char ch, string set, ref uint[]? asciiLazyCache) + { // (After warm-up, we should find ourselves rarely getting here.) + Debug.Assert(ch < 128); - // Otherwise, compute it normally. + // Compute the result and determine which bits to write back to the array and "or" the bits back in a thread-safe manner. bool isInClass = CharInClass(ch, set); - - // Determine which bits to write back to the array and "or" the bits back in a thread-safe manner. - int bitsToSet = knownBit; + uint bitsToSet = 1u << ((ch & 0xF) << 1); if (isInClass) { - bitsToSet |= valueBit; + bitsToSet |= bitsToSet << 1; } + + uint[]? cache = asciiLazyCache ?? Interlocked.CompareExchange(ref asciiLazyCache, new uint[CacheArrayLength], null) ?? asciiLazyCache; #if REGEXGENERATOR - InterlockedExtensions.Or(ref slot, bitsToSet); + InterlockedExtensions.Or(ref cache[ch >> 4], bitsToSet); #else - Interlocked.Or(ref slot, bitsToSet); + Interlocked.Or(ref cache[ch >> 4], bitsToSet); #endif // Return the computed value. return isInClass; } - - // Non-ASCII. Fall back to computing the answer. - return CharInClassRecursive(ch, set, 0); } + /// + /// Determines a character's membership in a character class (via the string representation of the class). + /// public static bool CharInClass(char ch, string set) => CharInClassRecursive(ch, set, 0); @@ -1279,6 +1290,283 @@ private static RegexCharClass ParseRecursive(string charClass, int start) return new RegexCharClass(IsNegated(charClass, start), ranges, categoriesBuilder, sub); } + #region Perf workaround until https://github.com/dotnet/runtime/issues/61048 and https://github.com/dotnet/runtime/issues/59492 are addressed + // TODO: https://github.com/dotnet/runtime/issues/61048 + // The below functionality needs to be removed/replaced/generalized. The goal is to avoid relying on + // ToLower and culture-based operation at match time, and instead be able to compute at construction + // time case folding equivalence classes that let us determine up-front the set of characters considered + // valid for a match. For now, we do this just for ASCII, and for anything else fall back to the + // pre-existing mechanism whereby a culture is used at construction time to ToLower and then one is + // used at match time to ToLower. We also skip 'i' and 'I', as the casing of those varies across culture + // whereas every other ASCII value's casing is stable across culture. We could hardcode the values for + // when an invariant vs tr/az culture vs any other culture is used, and we likely will, but for now doing + // so would be a breaking change, as in doing so we'd be relying only on the culture present at the time + // of construction rather than the one at the time of match. That will be resolved with + // https://github.com/dotnet/runtime/issues/59492. + + /// Creates a set string for a single character, optionally factoring in case-insensitivity. + /// The character for which to create the set. + /// null if case-sensitive; non-null if case-insensitive, in which case it's the culture to use. + /// false if the caller should strip out RegexOptions.IgnoreCase because it's now fully represented by the set; otherwise, true. + /// The create set string. + public static string OneToStringClass(char c, CultureInfo? caseInsensitive, out bool resultIsCaseInsensitive) + { + var vsb = new ValueStringBuilder(stackalloc char[4]); + + if (caseInsensitive is null) + { + resultIsCaseInsensitive = false; + vsb.Append(c); + } + else if (c < 128 && (c | 0x20) != 'i') + { + resultIsCaseInsensitive = false; + switch (c) + { + // These are the same in all cultures. As with the rest of this support, we can generalize this + // once we fix the aforementioned casing issues, e.g. by lazily populating an interning cache + // rather than hardcoding the strings for these values, once almost all values will be the same + // regardless of culture. + case 'A': case 'a': return "\0\x0004\0ABab"; + case 'B': case 'b': return "\0\x0004\0BCbc"; + case 'C': case 'c': return "\0\x0004\0CDcd"; + case 'D': case 'd': return "\0\x0004\0DEde"; + case 'E': case 'e': return "\0\x0004\0EFef"; + case 'F': case 'f': return "\0\x0004\0FGfg"; + case 'G': case 'g': return "\0\x0004\0GHgh"; + case 'H': case 'h': return "\0\x0004\0HIhi"; + // allow 'i' to fall through + case 'J': case 'j': return "\0\x0004\0JKjk"; + case 'K': case 'k': return "\0\x0006\0KLkl\u212A\u212B"; + case 'L': case 'l': return "\0\x0004\0LMlm"; + case 'M': case 'm': return "\0\x0004\0MNmn"; + case 'N': case 'n': return "\0\x0004\0NOno"; + case 'O': case 'o': return "\0\x0004\0OPop"; + case 'P': case 'p': return "\0\x0004\0PQpq"; + case 'Q': case 'q': return "\0\x0004\0QRqr"; + case 'R': case 'r': return "\0\x0004\0RSrs"; + case 'S': case 's': return "\0\x0004\0STst"; + case 'T': case 't': return "\0\x0004\0TUtu"; + case 'U': case 'u': return "\0\x0004\0UVuv"; + case 'V': case 'v': return "\0\x0004\0VWvw"; + case 'W': case 'w': return "\0\x0004\0WXwx"; + case 'X': case 'x': return "\0\x0004\0XYxy"; + case 'Y': case 'y': return "\0\x0004\0YZyz"; + case 'Z': case 'z': return "\0\x0004\0Z[z{"; + + // All the ASCII !ParticipatesInCaseConversion + case '\u0000': return "\0\u0002\0\u0000\u0001"; + case '\u0001': return "\0\u0002\0\u0001\u0002"; + case '\u0002': return "\0\u0002\0\u0002\u0003"; + case '\u0003': return "\0\u0002\0\u0003\u0004"; + case '\u0004': return "\0\u0002\0\u0004\u0005"; + case '\u0005': return "\0\u0002\0\u0005\u0006"; + case '\u0006': return "\0\u0002\0\u0006\u0007"; + case '\u0007': return "\0\u0002\0\u0007\u0008"; + case '\u0008': return "\0\u0002\0\u0008\u0009"; + case '\u0009': return "\0\u0002\0\u0009\u000A"; + case '\u000A': return "\0\u0002\0\u000A\u000B"; + case '\u000B': return "\0\u0002\0\u000B\u000C"; + case '\u000C': return "\0\u0002\0\u000C\u000D"; + case '\u000D': return "\0\u0002\0\u000D\u000E"; + case '\u000E': return "\0\u0002\0\u000E\u000F"; + case '\u000F': return "\0\u0002\0\u000F\u0010"; + case '\u0010': return "\0\u0002\0\u0010\u0011"; + case '\u0011': return "\0\u0002\0\u0011\u0012"; + case '\u0012': return "\0\u0002\0\u0012\u0013"; + case '\u0013': return "\0\u0002\0\u0013\u0014"; + case '\u0014': return "\0\u0002\0\u0014\u0015"; + case '\u0015': return "\0\u0002\0\u0015\u0016"; + case '\u0016': return "\0\u0002\0\u0016\u0017"; + case '\u0017': return "\0\u0002\0\u0017\u0018"; + case '\u0018': return "\0\u0002\0\u0018\u0019"; + case '\u0019': return "\0\u0002\0\u0019\u001A"; + case '\u001A': return "\0\u0002\0\u001A\u001B"; + case '\u001B': return "\0\u0002\0\u001B\u001C"; + case '\u001C': return "\0\u0002\0\u001C\u001D"; + case '\u001D': return "\0\u0002\0\u001D\u001E"; + case '\u001E': return "\0\u0002\0\u001E\u001F"; + case '\u001F': return "\0\u0002\0\u001F\u0020"; + case '\u0020': return "\0\u0002\0\u0020\u0021"; + case '\u0021': return "\0\u0002\0\u0021\u0022"; + case '\u0022': return "\0\u0002\0\u0022\u0023"; + case '\u0023': return "\0\u0002\0\u0023\u0024"; + case '\u0025': return "\0\u0002\0\u0025\u0026"; + case '\u0026': return "\0\u0002\0\u0026\u0027"; + case '\u0027': return "\0\u0002\0\u0027\u0028"; + case '\u0028': return "\0\u0002\0\u0028\u0029"; + case '\u0029': return "\0\u0002\0\u0029\u002A"; + case '\u002A': return "\0\u0002\0\u002A\u002B"; + case '\u002C': return "\0\u0002\0\u002C\u002D"; + case '\u002D': return "\0\u0002\0\u002D\u002E"; + case '\u002E': return "\0\u0002\0\u002E\u002F"; + case '\u002F': return "\0\u0002\0\u002F\u0030"; + case '\u0030': return "\0\u0002\0\u0030\u0031"; + case '\u0031': return "\0\u0002\0\u0031\u0032"; + case '\u0032': return "\0\u0002\0\u0032\u0033"; + case '\u0033': return "\0\u0002\0\u0033\u0034"; + case '\u0034': return "\0\u0002\0\u0034\u0035"; + case '\u0035': return "\0\u0002\0\u0035\u0036"; + case '\u0036': return "\0\u0002\0\u0036\u0037"; + case '\u0037': return "\0\u0002\0\u0037\u0038"; + case '\u0038': return "\0\u0002\0\u0038\u0039"; + case '\u0039': return "\0\u0002\0\u0039\u003A"; + case '\u003A': return "\0\u0002\0\u003A\u003B"; + case '\u003B': return "\0\u0002\0\u003B\u003C"; + case '\u003F': return "\0\u0002\0\u003F\u0040"; + case '\u0040': return "\0\u0002\0\u0040\u0041"; + case '\u005B': return "\0\u0002\0\u005B\u005C"; + case '\u005C': return "\0\u0002\0\u005C\u005D"; + case '\u005D': return "\0\u0002\0\u005D\u005E"; + case '\u005F': return "\0\u0002\0\u005F\u0060"; + case '\u007B': return "\0\u0002\0\u007B\u007C"; + case '\u007D': return "\0\u0002\0\u007D\u007E"; + case '\u007F': return "\0\u0002\0\u007F\u0080"; + } + AddAsciiCharIgnoreCaseEquivalence(c, ref vsb, caseInsensitive); + } + else if (!ParticipatesInCaseConversion(c)) + { + resultIsCaseInsensitive = false; + vsb.Append(c); + } + else + { + resultIsCaseInsensitive = true; + vsb.Append(char.ToLower(c, caseInsensitive)); + } + + string result = CharsToStringClass(vsb.AsSpan()); + vsb.Dispose(); + return result; + } + + private static unsafe string CharsToStringClass(ReadOnlySpan chars) + { +#if DEBUG + // Make sure they're all sorted with no duplicates + for (int index = 0; index < chars.Length - 1; index++) + { + Debug.Assert(chars[index] < chars[index + 1]); + } +#endif + + // If there aren't any chars, just return an empty class. + if (chars.Length == 0) + { + return EmptyClass; + } + + // Count how many characters there actually are. All but the very last possible + // char value will have two characters, one for the inclusive beginning of range + // and one for the exclusive end of range. + int count = chars.Length * 2; + if (chars[chars.Length - 1] == LastChar) + { + count--; + } + + // Get the pointer/length of the span to be able to pass it into string.Create. + fixed (char* charsPtr = chars) + { +#if REGEXGENERATOR + return StringExtensions.Create( +#else + return string.Create( +#endif + SetStartIndex + count, ((IntPtr)charsPtr, chars.Length), static (span, state) => + { + // Reconstruct the span now that we're inside of the lambda. + ReadOnlySpan chars = new ReadOnlySpan((char*)state.Item1, state.Length); + + // Fill in the set string + span[FlagsIndex] = (char)0; + span[CategoryLengthIndex] = (char)0; + span[SetLengthIndex] = (char)(span.Length - SetStartIndex); + int i = SetStartIndex; + foreach (char c in chars) + { + span[i++] = c; + if (c != LastChar) + { + span[i++] = (char)(c + 1); + } + } + Debug.Assert(i == span.Length); + }); + } + } + + /// Tries to create from a RegexOptions.IgnoreCase set string a new set string that can be used without RegexOptions.IgnoreCase. + /// The original set string from a RegexOptions.IgnoreCase node. + /// The culture in use. + /// A new set string if one could be created. + public static string? MakeCaseSensitiveIfPossible(string set, CultureInfo culture) + { + if (IsNegated(set)) + { + return null; + } + + // We'll eventually need a more robust way to do this for any set. For now, we iterate through each character + // in the set, and to avoid spending lots of time doing so, we limit the number of characters. This approach also + // limits the structure of the sets allowed, e.g. they can't be negated, can't use subtraction, etc. + Span setChars = stackalloc char[64]; // arbitary limit chosen to include common groupings like all ASCII letters and digits + + // Try to get the set's characters. + int setCharsCount = GetSetChars(set, setChars); + if (setCharsCount == 0) + { + return null; + } + + // Enumerate all the characters and add all characters that form their case folding equivalence class. + var rcc = new RegexCharClass(); + var vsb = new ValueStringBuilder(stackalloc char[4]); + foreach (char c in setChars.Slice(0, setCharsCount)) + { + if (c >= 128 || c == 'i' || c == 'I') + { + return null; + } + + vsb.Length = 0; + AddAsciiCharIgnoreCaseEquivalence(c, ref vsb, culture); + foreach (char v in vsb.AsSpan()) + { + rcc.AddChar(v); + } + } + + // Return the constructed class. + return rcc.ToStringClass(); + } + + private static void AddAsciiCharIgnoreCaseEquivalence(char c, ref ValueStringBuilder vsb, CultureInfo culture) + { + Debug.Assert(c < 128, $"Expected ASCII, got {(int)c}"); + Debug.Assert(c != 'i' && c != 'I', "'i' currently doesn't work correctly in all cultures"); + + char upper = char.ToUpper(c, culture); + char lower = char.ToLower(c, culture); + + if (upper < lower) + { + vsb.Append(upper); + } + vsb.Append(lower); + if (upper > lower) + { + vsb.Append(upper); + } + + if (c == 'k' || c == 'K') + { + vsb.Append((char)0x212A); // kelvin sign + } + } + #endregion + /// /// Constructs the string representation of the class. /// @@ -1390,23 +1678,29 @@ private void Canonicalize(bool isNonBacktracking) rangelist.RemoveRange(j, rangelist.Count - j); } - // If the class now represents a single negated character, but does so by including every - // other character, invert it to produce a normalized form recognized by IsSingletonInverse. - if (!isNonBacktracking && // do not produce the IsSingletonInverse transformation in NonBacktracking mode + // If the class now represents a single negated range, but does so by including every + // other character, invert it to produce a normalized form with a single range. This + // is valuable for subsequent optimizations in most of the engines. + // TODO: https://github.com/dotnet/runtime/issues/61048. The special-casing for NonBacktracking + // can be deleted once this issue is addressed. The special-casing exists because NonBacktracking + // is on a different casing plan than the other engines and doesn't use ToLower on each input + // character at match time; this in turn can highlight differences between sets and their inverted + // versions of themselves, e.g. a difference between [0-AC-\uFFFF] and [^B]. + if (!isNonBacktracking && !_negate && _subtractor is null && (_categories is null || _categories.Length == 0)) { if (rangelist.Count == 2) { - // There are two ranges in the list. See if there's one missing element between them. + // There are two ranges in the list. See if there's one missing range between them. + // Such a range might be as small as a single character. if (rangelist[0].First == 0 && - rangelist[0].Last == (char)(rangelist[1].First - 2) && - rangelist[1].Last == LastChar) + rangelist[1].Last == LastChar && + rangelist[0].Last < rangelist[1].First - 1) { - char ch = (char)(rangelist[0].Last + 1); + rangelist[0] = new SingleRange((char)(rangelist[0].Last + 1), (char)(rangelist[1].First - 1)); rangelist.RemoveAt(1); - rangelist[0] = new SingleRange(ch, ch); _negate = true; } } diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCode.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCode.cs index d8700ebb9bd287..6f6c8cd8f8852f 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCode.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCode.cs @@ -16,6 +16,7 @@ using System.Collections; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; +using System.Globalization; namespace System.Text.RegularExpressions { @@ -96,35 +97,25 @@ internal sealed class RegexCode public readonly RegexTree Tree; // the optimized parse tree public readonly int[] Codes; // the code public readonly string[] Strings; // the string/set table - public readonly int[]?[] StringsAsciiLookup; // the ASCII lookup table optimization for the sets in Strings + public readonly uint[]?[] StringsAsciiLookup; // the ASCII lookup table optimization for the sets in Strings public readonly int TrackCount; // how many instructions use backtracking public readonly Hashtable? Caps; // mapping of user group numbers -> impl group slots public readonly int CapSize; // number of impl group slots - public readonly (string CharClass, bool CaseInsensitive)[]? LeadingCharClasses; // the set of candidate first characters, if available. Each entry corresponds to the next char in the input. - public int[]? LeadingCharClassAsciiLookup; // the ASCII lookup table optimization for LeadingCharClasses[0], if it exists; only used by the interpreter - public readonly RegexBoyerMoore? BoyerMoorePrefix; // the fixed prefix string as a Boyer-Moore machine, if available - public readonly int LeadingAnchor; // the leading anchor, if one exists (RegexPrefixAnalyzer.Bol, etc) public readonly bool RightToLeft; // true if right to left + public readonly RegexFindOptimizations FindOptimizations; - public RegexCode(RegexTree tree, int[] codes, string[] strings, int trackcount, - Hashtable? caps, int capsize, - RegexBoyerMoore? boyerMoorePrefix, - (string CharClass, bool CaseInsensitive)[]? leadingCharClasses, - int leadingAnchor, bool rightToLeft) + public RegexCode(RegexTree tree, CultureInfo culture, int[] codes, string[] strings, int trackcount, + Hashtable? caps, int capsize) { - Debug.Assert(boyerMoorePrefix is null || leadingCharClasses is null); - Tree = tree; Codes = codes; Strings = strings; - StringsAsciiLookup = new int[strings.Length][]; + StringsAsciiLookup = new uint[strings.Length][]; TrackCount = trackcount; Caps = caps; CapSize = capsize; - BoyerMoorePrefix = boyerMoorePrefix; - LeadingCharClasses = leadingCharClasses; - LeadingAnchor = leadingAnchor; - RightToLeft = rightToLeft; + RightToLeft = (tree.Options & RegexOptions.RightToLeft) != 0; + FindOptimizations = new RegexFindOptimizations(tree, culture); } public static bool OpcodeBacktracks(int Op) @@ -409,26 +400,8 @@ public override string ToString() var sb = new StringBuilder(); sb.AppendLine($"Direction: {(RightToLeft ? "right-to-left" : "left-to-right")}"); - sb.AppendLine($"Anchor: {RegexPrefixAnalyzer.AnchorDescription(LeadingAnchor)}"); + sb.AppendLine($"Anchor: {RegexPrefixAnalyzer.AnchorDescription(FindOptimizations.LeadingAnchor)}"); sb.AppendLine(); - - if (BoyerMoorePrefix != null) - { - sb.AppendLine("Boyer-Moore:"); - sb.AppendLine(BoyerMoorePrefix.Dump(" ")); - sb.AppendLine(); - } - - if (LeadingCharClasses != null) - { - sb.AppendLine("First Chars:"); - for (int i = 0; i < LeadingCharClasses.Length; i++) - { - sb.AppendLine($"{i}: {RegexCharClass.SetDescription(LeadingCharClasses[i].CharClass)}"); - } - sb.AppendLine(); - } - for (int i = 0; i < Codes.Length; i += OpcodeSize(Codes[i])) { sb.AppendLine(OpcodeDescription(i)); diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs index e288567bf14a73..58d5f5f1717abd 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs @@ -62,6 +62,9 @@ internal abstract class RegexCompiler private static readonly MethodInfo s_spanIndexOfSpan = typeof(MemoryExtensions).GetMethod("IndexOf", new Type[] { typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) })!.MakeGenericMethod(typeof(char)); private static readonly MethodInfo s_spanIndexOfAnyCharChar = typeof(MemoryExtensions).GetMethod("IndexOfAny", new Type[] { typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), Type.MakeGenericMethodParameter(0), Type.MakeGenericMethodParameter(0) })!.MakeGenericMethod(typeof(char)); private static readonly MethodInfo s_spanIndexOfAnyCharCharChar = typeof(MemoryExtensions).GetMethod("IndexOfAny", new Type[] { typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), Type.MakeGenericMethodParameter(0), Type.MakeGenericMethodParameter(0), Type.MakeGenericMethodParameter(0) })!.MakeGenericMethod(typeof(char)); + private static readonly MethodInfo s_spanIndexOfAnySpan = typeof(MemoryExtensions).GetMethod("IndexOfAny", new Type[] { typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) })!.MakeGenericMethod(typeof(char)); + private static readonly MethodInfo s_spanLastIndexOfChar = typeof(MemoryExtensions).GetMethod("LastIndexOf", new Type[] { typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), Type.MakeGenericMethodParameter(0) })!.MakeGenericMethod(typeof(char)); + private static readonly MethodInfo s_spanLastIndexOfSpan = typeof(MemoryExtensions).GetMethod("LastIndexOf", new Type[] { typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) })!.MakeGenericMethod(typeof(char)); private static readonly MethodInfo s_spanSliceIntMethod = typeof(ReadOnlySpan).GetMethod("Slice", new Type[] { typeof(int) })!; private static readonly MethodInfo s_spanSliceIntIntMethod = typeof(ReadOnlySpan).GetMethod("Slice", new Type[] { typeof(int), typeof(int) })!; private static readonly MethodInfo s_spanStartsWith = typeof(MemoryExtensions).GetMethod("StartsWith", new Type[] { typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), typeof(ReadOnlySpan<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) })!.MakeGenericMethod(typeof(char)); @@ -71,6 +74,7 @@ internal abstract class RegexCompiler private static readonly MethodInfo s_stringIndexOfCharInt = typeof(string).GetMethod("IndexOf", new Type[] { typeof(char), typeof(int) })!; private static readonly MethodInfo s_stringLastIndexOfCharIntInt = typeof(string).GetMethod("LastIndexOf", new Type[] { typeof(char), typeof(int), typeof(int) })!; private static readonly MethodInfo s_textInfoToLowerMethod = typeof(TextInfo).GetMethod("ToLower", new Type[] { typeof(char) })!; + private static readonly MethodInfo s_arrayResize = typeof(Array).GetMethod("Resize")!.MakeGenericMethod(typeof(int)); protected ILGenerator? _ilg; @@ -90,9 +94,6 @@ internal abstract class RegexCompiler protected RegexCode? _code; // the RegexCode object protected int[]? _codes; // the RegexCodes being translated protected string[]? _strings; // the stringtable associated with the RegexCodes - protected (string CharClass, bool CaseInsensitive)[]? _leadingCharClasses; // the possible first chars computed by RegexPrefixAnalyzer - protected RegexBoyerMoore? _boyerMoorePrefix; // a prefix as a boyer-moore machine - protected int _leadingAnchor; // the set of anchors protected bool _hasTimeout; // whether the regex has a non-infinite timeout private Label[]? _labels; // a label for every operation in _codes @@ -928,20 +929,20 @@ protected void GenerateFindFirstChar() } _runtextLocal = DeclareString(); _textInfoLocal = null; - if (!_options.HasFlag(RegexOptions.CultureInvariant)) + if ((_options & RegexOptions.CultureInvariant) == 0) { - bool needsCulture = _options.HasFlag(RegexOptions.IgnoreCase) || _boyerMoorePrefix?.CaseInsensitive == true; - if (!needsCulture && _leadingCharClasses != null) + bool needsCulture = _code.FindOptimizations.FindMode switch { - for (int i = 0; i < _leadingCharClasses.Length; i++) - { - if (_leadingCharClasses[i].CaseInsensitive) - { - needsCulture = true; - break; - } - } - } + FindNextStartingPositionMode.FixedLiteral_LeftToRight_CaseInsensitive or + FindNextStartingPositionMode.LeadingLiteral_RightToLeft_CaseInsensitive or + FindNextStartingPositionMode.FixedSets_LeftToRight_CaseInsensitive or + FindNextStartingPositionMode.LeadingSet_LeftToRight_CaseInsensitive or + FindNextStartingPositionMode.LeadingSet_RightToLeft_CaseInsensitive => true, + + _ when _code.FindOptimizations.FixedDistanceSets is List<(char[]? Chars, string Set, int Distance, bool CaseInsensitive)> sets => sets.Exists(set => set.CaseInsensitive), + + _ => false, + }; if (needsCulture) { @@ -1012,43 +1013,59 @@ protected void GenerateFindFirstChar() Ret(); MarkLabel(finishedLengthCheck); - GenerateAnchorChecks(); - - if (_boyerMoorePrefix is RegexBoyerMoore { NegativeUnicode: null } rbm) + // Emit any anchors. + if (GenerateAnchors()) { - if (rbm.PatternSupportsIndexOf) - { - GenerateIndexOf(rbm.Pattern); - } - else - { - GenerateBoyerMoore(rbm); - } - } - else if (_leadingCharClasses is not null) - { - if (_code.RightToLeft) - { - GenerateLeadingCharacter_RightToLeft(); - } - else - { - GenerateLeadingCharacter_LeftToRight(); - } + return; } - else + + // Either anchors weren't specified, or they don't completely root all matches to a specific location. + + switch (_code.FindOptimizations.FindMode) { - // return true; - Ldc(1); - Ret(); + case FindNextStartingPositionMode.LeadingPrefix_LeftToRight_CaseSensitive: + Debug.Assert(!string.IsNullOrEmpty(_code.FindOptimizations.LeadingCaseSensitivePrefix)); + GenerateIndexOf_LeftToRight(_code.FindOptimizations.LeadingCaseSensitivePrefix); + break; + + case FindNextStartingPositionMode.LeadingPrefix_RightToLeft_CaseSensitive: + Debug.Assert(!string.IsNullOrEmpty(_code.FindOptimizations.LeadingCaseSensitivePrefix)); + GenerateIndexOf_RightToLeft(_code.FindOptimizations.LeadingCaseSensitivePrefix); + break; + + case FindNextStartingPositionMode.LeadingSet_LeftToRight_CaseSensitive: + case FindNextStartingPositionMode.LeadingSet_LeftToRight_CaseInsensitive: + case FindNextStartingPositionMode.FixedSets_LeftToRight_CaseSensitive: + case FindNextStartingPositionMode.FixedSets_LeftToRight_CaseInsensitive: + Debug.Assert(_code.FindOptimizations.FixedDistanceSets is { Count: > 0 }); + GenerateFixedSet_LeftToRight(); + break; + + case FindNextStartingPositionMode.LeadingSet_RightToLeft_CaseSensitive: + case FindNextStartingPositionMode.LeadingSet_RightToLeft_CaseInsensitive: + Debug.Assert(_code.FindOptimizations.FixedDistanceSets is { Count: > 0 }); + GenerateFixedSet_RightToLeft(); + break; + + default: + Debug.Fail($"Unexpected mode: {_code.FindOptimizations.FindMode}"); + goto case FindNextStartingPositionMode.NoSearch; + + case FindNextStartingPositionMode.NoSearch: + // return true; + Ldc(1); + Ret(); + break; } - void GenerateAnchorChecks() + // Emits any anchors. Returns true if the anchor roots any match to a specific location and thus no further + // searching is required; otherwise, false. + bool GenerateAnchors() { // Generate anchor checks. - if ((_leadingAnchor & (RegexPrefixAnalyzer.Beginning | RegexPrefixAnalyzer.Start | RegexPrefixAnalyzer.EndZ | RegexPrefixAnalyzer.End | RegexPrefixAnalyzer.Bol)) != 0) + if ((_code.FindOptimizations.LeadingAnchor & (RegexPrefixAnalyzer.Beginning | RegexPrefixAnalyzer.Start | RegexPrefixAnalyzer.EndZ | RegexPrefixAnalyzer.End | RegexPrefixAnalyzer.Bol)) != 0) { - switch (_leadingAnchor) + switch (_code.FindOptimizations.LeadingAnchor) { case RegexPrefixAnalyzer.Beginning: { @@ -1072,7 +1089,7 @@ void GenerateAnchorChecks() } Ldc(1); Ret(); - return; + return true; case RegexPrefixAnalyzer.Start: { @@ -1092,7 +1109,7 @@ void GenerateAnchorChecks() } Ldc(1); Ret(); - return; + return true; case RegexPrefixAnalyzer.EndZ: { @@ -1134,9 +1151,9 @@ void GenerateAnchorChecks() } Ldc(1); Ret(); - return; + return true; - case RegexPrefixAnalyzer.End when minRequiredLength == 0: // if it's > 0, we already output a more stringent check + case RegexPrefixAnalyzer.End: { Label l1 = DefineLabel(); Ldloc(_runtextposLocal); @@ -1157,16 +1174,16 @@ void GenerateAnchorChecks() } Ldc(1); Ret(); - return; + return true; - case RegexPrefixAnalyzer.Bol when !_code.RightToLeft: // don't bother optimizing for the niche case of RegexOptions.RightToLeft | RegexOptions.Multiline + case RegexPrefixAnalyzer.Bol: { // Optimize the handling of a Beginning-Of-Line (BOL) anchor. BOL is special, in that unlike // other anchors like Beginning, there are potentially multiple places a BOL can match. So unlike // the other anchors, which all skip all subsequent processing if found, with BOL we just use it - // to boost our position to the next line, and then continue normally with any Boyer-Moore or - // leading char class searches. + // to boost our position to the next line, and then continue normally with any prefix or char class searches. + Debug.Assert(!_code.RightToLeft, "RightToLeft isn't implemented and should have been filtered out previously"); Label atBeginningOfLine = DefineLabel(); // if (runtextpos > runtextbeg... @@ -1218,218 +1235,11 @@ void GenerateAnchorChecks() break; } } - } - - void GenerateBoyerMoore(RegexBoyerMoore rbm) - { - LocalBuilder limitLocal; - int beforefirst; - int last; - if (!_code.RightToLeft) - { - limitLocal = _runtextendLocal; - beforefirst = -1; - last = rbm.Pattern.Length - 1; - } - else - { - limitLocal = _runtextbegLocal!; - beforefirst = rbm.Pattern.Length; - last = 0; - } - - int chLast = rbm.Pattern[last]; - - // string runtext = this.runtext; - Mvfldloc(s_runtextField, _runtextLocal); - - // runtextpos += pattern.Length - 1; // advance to match last character - Ldloc(_runtextposLocal); - if (!_code.RightToLeft) - { - Ldc(rbm.Pattern.Length - 1); - Add(); - } - else - { - Ldc(rbm.Pattern.Length); - Sub(); - } - Stloc(_runtextposLocal); - - Label lStart = DefineLabel(); - Br(lStart); - - // DefaultAdvance: - // offset = pattern.Length; - Label lDefaultAdvance = DefineLabel(); - MarkLabel(lDefaultAdvance); - Ldc(_code.RightToLeft ? -rbm.Pattern.Length : rbm.Pattern.Length); - - // Advance: - // runtextpos += offset; - Label lAdvance = DefineLabel(); - MarkLabel(lAdvance); - Ldloc(_runtextposLocal); - Add(); - Stloc(_runtextposLocal); - - // Start: - // if (runtextpos >= runtextend) goto returnFalse; - MarkLabel(lStart); - Ldloc(_runtextposLocal); - Ldloc(limitLocal); - if (!_code.RightToLeft) - { - BgeFar(returnFalse); - } - else - { - BltFar(returnFalse); - } - - // ch = runtext[runtextpos]; - Rightchar(); - if (rbm.CaseInsensitive) - { - CallToLower(); - } - - Label lPartialMatch = DefineLabel(); - using (RentedLocalBuilder chLocal = RentInt32Local()) - { - Stloc(chLocal); - Ldloc(chLocal); - Ldc(chLast); - - // if (ch == lastChar) goto partialMatch; - BeqFar(lPartialMatch); - - // ch -= lowAscii; - // if (ch > (highAscii - lowAscii)) goto defaultAdvance; - Ldloc(chLocal); - Ldc(rbm.LowASCII); - Sub(); - Stloc(chLocal); - Ldloc(chLocal); - Ldc(rbm.HighASCII - rbm.LowASCII); - BgtUn(lDefaultAdvance); - - // int offset = "lookupstring"[num]; - // goto advance; - int negativeRange = rbm.HighASCII - rbm.LowASCII + 1; - if (negativeRange > 1) - { - // Create a string to store the lookup table we use to find the offset. - Debug.Assert(rbm.Pattern.Length <= char.MaxValue, "RegexBoyerMoore should have limited the size allowed."); - string negativeLookup = string.Create(negativeRange, (rbm, beforefirst), static (span, state) => - { - // Store the offsets into the string. RightToLeft has negative offsets, so to support it with chars (unsigned), we negate - // the values to be stored in the string, and then at run time after looking up the offset in the string, negate it again. - for (int i = 0; i < span.Length; i++) - { - int offset = state.rbm.NegativeASCII[i + state.rbm.LowASCII]; - if (offset == state.beforefirst) - { - offset = state.rbm.Pattern.Length; - } - else if (state.rbm.RightToLeft) - { - offset = -offset; - } - Debug.Assert(offset >= 0 && offset <= char.MaxValue); - span[i] = (char)offset; - } - }); - - // offset = lookupString[ch]; - // goto Advance; - Ldstr(negativeLookup); - Ldloc(chLocal); - Call(s_stringGetCharsMethod); - if (_code.RightToLeft) - { - Neg(); - } - } - else - { - // offset = value; - Debug.Assert(negativeRange == 1); - int offset = rbm.NegativeASCII[rbm.LowASCII]; - if (offset == beforefirst) - { - offset = _code.RightToLeft ? -rbm.Pattern.Length : rbm.Pattern.Length; - } - Ldc(offset); - } - BrFar(lAdvance); - } - // Emit a check for each character from the next to last down to the first. - MarkLabel(lPartialMatch); - Ldloc(_runtextposLocal); - using (RentedLocalBuilder testLocal = RentInt32Local()) - { - Stloc(testLocal); - - int prevLabelOffset = int.MaxValue; - Label prevLabel = default; - for (int i = rbm.Pattern.Length - 2; i >= 0; i--) - { - int charindex = _code.RightToLeft ? rbm.Pattern.Length - 1 - i : i; - - // if (runtext[--test] == pattern[index]) goto lNext; - Ldloc(_runtextLocal); - Ldloc(testLocal); - Ldc(1); - Sub(_code.RightToLeft); - Stloc(testLocal); - Ldloc(testLocal); - Call(s_stringGetCharsMethod); - if (rbm.CaseInsensitive && RegexCharClass.ParticipatesInCaseConversion(rbm.Pattern[charindex])) - { - CallToLower(); - } - Ldc(rbm.Pattern[charindex]); - - if (prevLabelOffset == rbm.Positive[charindex]) - { - BneFar(prevLabel); - } - else - { - Label lNext = DefineLabel(); - Beq(lNext); - - // offset = positive[ch]; - // goto advance; - prevLabel = DefineLabel(); - prevLabelOffset = rbm.Positive[charindex]; - MarkLabel(prevLabel); - Ldc(prevLabelOffset); - BrFar(lAdvance); - - MarkLabel(lNext); - } - } - - // this.runtextpos = test; - // return true; - Ldthis(); - Ldloc(testLocal); - if (_code.RightToLeft) - { - Ldc(1); - Add(); - } - Stfld(s_runtextposField); - Ldc(1); - Ret(); - } + return false; } - void GenerateIndexOf(string prefix) + void GenerateIndexOf_LeftToRight(string prefix) { using RentedLocalBuilder i = RentInt32Local(); @@ -1446,11 +1256,7 @@ void GenerateIndexOf(string prefix) Call(s_spanIndexOfSpan); Stloc(i); - // if (i < 0) - // { - // base.runtextpos = runtextend; - // return false; - // } + // if (i < 0) goto ReturnFalse; Ldloc(i); Ldc(0); BltFar(returnFalse); @@ -1466,105 +1272,135 @@ void GenerateIndexOf(string prefix) Ret(); } - void GenerateLeadingCharacter_RightToLeft() + void GenerateIndexOf_RightToLeft(string prefix) { - Debug.Assert(_leadingCharClasses.Length == 1, "Only the FirstChars and not MultiFirstChars computation is supported for RightToLeft"); - - using RentedLocalBuilder cLocal = RentInt32Local(); - - Label l1 = DefineLabel(); - Label l2 = DefineLabel(); - Label l3 = DefineLabel(); - Label l4 = DefineLabel(); - Label l5 = DefineLabel(); - - Mvfldloc(s_runtextField, _runtextLocal); + using RentedLocalBuilder i = RentInt32Local(); + // int i = runtext.AsSpan(runtextpos, runtextbeg, runtextpos - runtextbeg).LastIndexOf(prefix); + Ldthis(); + Ldfld(s_runtextField); + Ldloc(_runtextbegLocal!); Ldloc(_runtextposLocal); Ldloc(_runtextbegLocal!); Sub(); - Stloc(cLocal); + Call(s_stringAsSpanIntIntMethod); + Ldstr(prefix); + Call(s_stringAsSpanMethod); + Call(s_spanLastIndexOfSpan); + Stloc(i); - if (minRequiredLength == 0) // if minRequiredLength > 0, we already output a more stringent check - { - Ldloc(cLocal); - Ldc(0); - BleFar(l4); - } + // if (i < 0) goto ReturnFalse; + Ldloc(i); + Ldc(0); + BltFar(returnFalse); - MarkLabel(l1); - Ldloc(cLocal); + // base.runtextpos = runtextbeg + i + LeadingCaseSensitivePrefix.Length; + // return true; + Ldthis(); + Ldloc(_runtextbegLocal!); + Ldloc(i); + Add(); + Ldc(prefix.Length); + Add(); + Stfld(s_runtextposField); Ldc(1); - Sub(); - Stloc(cLocal); + Ret(); + } - Leftcharnext(); + void GenerateFixedSet_RightToLeft() + { + (char[]? Chars, string Set, int Distance, bool CaseInsensitive) set = _code.FindOptimizations.FixedDistanceSets![0]; + Debug.Assert(set.Distance == 0); - if (!RegexCharClass.IsSingleton(_leadingCharClasses[0].CharClass)) - { - EmitMatchCharacterClass(_leadingCharClasses[0].CharClass, _leadingCharClasses[0].CaseInsensitive); - Brtrue(l2); - } - else + using RentedLocalBuilder i = RentInt32Local(); + + if (set.Chars is { Length: 1 } && !set.CaseInsensitive) { - Ldc(RegexCharClass.SingletonChar(_leadingCharClasses[0].CharClass)); - Beq(l2); - } + // int i = runtext.AsSpan(runtextpos, runtextbeg, runtextpos - runtextbeg).LastIndexOf(set.Chars[0]); + Ldthis(); + Ldfld(s_runtextField); + Ldloc(_runtextbegLocal!); + Ldloc(_runtextposLocal); + Ldloc(_runtextbegLocal!); + Sub(); + Call(s_stringAsSpanIntIntMethod); + Ldc(set.Chars[0]); + Call(s_spanLastIndexOfChar); + Stloc(i); - MarkLabel(l5); + // if (i < 0) goto ReturnFalse; + Ldloc(i); + Ldc(0); + BltFar(returnFalse); - Ldloc(cLocal); - Ldc(0); - if (!RegexCharClass.IsSingleton(_leadingCharClasses[0].CharClass)) - { - BgtFar(l1); + // base.runtextpos = runtextbeg + i + 1; + // return true; + Ldthis(); + Ldloc(_runtextbegLocal!); + Ldloc(i); + Add(); + Ldc(1); + Add(); + Stfld(s_runtextposField); + Ldc(1); + Ret(); } else { - Bgt(l1); - } + Label condition = DefineLabel(); + Label increment = DefineLabel(); + Label body = DefineLabel(); - Ldc(0); - Br(l3); + Mvfldloc(s_runtextField, _runtextLocal); - MarkLabel(l2); - - Ldloc(_runtextposLocal); - Ldc(1); - Sub(_code.RightToLeft); - Stloc(_runtextposLocal); - Ldc(1); + // for (int i = runtextpos - 1; ... + Ldloc(_runtextposLocal); + Ldc(1); + Sub(); + Stloc(i); + BrFar(condition); + + // if (MatchCharClass(runtext[i], set)) + MarkLabel(body); + Ldloc(_runtextLocal); + Ldloc(i); + Call(s_stringGetCharsMethod); + EmitMatchCharacterClass(set.Set, set.CaseInsensitive); + Brfalse(increment); + + // base.runtextpos = i + 1; + // return true; + Ldthis(); + Ldloc(i); + Ldc(1); + Add(); + Stfld(s_runtextposField); + Ldc(1); + Ret(); - MarkLabel(l3); + // for (...; ...; i--) + MarkLabel(increment); + Ldloc(i); + Ldc(1); + Sub(); + Stloc(i); - Mvlocfld(_runtextposLocal, s_runtextposField); - Ret(); + // for (...; i >= runtextbeg; ...) + MarkLabel(condition); + Ldloc(i); + Ldloc(_runtextbegLocal!); + BgeFar(body); - MarkLabel(l4); - Ldc(0); - Ret(); + BrFar(returnFalse); + } } - void GenerateLeadingCharacter_LeftToRight() + void GenerateFixedSet_LeftToRight() { - Debug.Assert(_leadingCharClasses != null && _leadingCharClasses.Length > 0); - - // If minRequiredLength > 0, we already output a more stringent check. In the rare case - // where we were unable to get an accurate enough min required length to ensure it's larger - // than the prefixes we calculated, we also need to ensure we have enough spaces for those, - // as they also represent a min required length. - if (minRequiredLength < _leadingCharClasses.Length) - { - // if (runtextpos >= runtextend - (_leadingCharClasses.Length - 1)) goto returnFalse; - Ldloc(_runtextendLocal); - if (_leadingCharClasses.Length > 1) - { - Ldc(_leadingCharClasses.Length - 1); - Sub(); - } - Ldloc(_runtextposLocal); - BleFar(returnFalse); - } + List<(char[]? Chars, string Set, int Distance, bool CaseInsensitive)>? sets = _code.FindOptimizations.FixedDistanceSets; + (char[]? Chars, string Set, int Distance, bool CaseInsensitive) primarySet = sets![0]; + const int MaxSets = 4; + int setsToUse = Math.Min(sets.Count, MaxSets); using RentedLocalBuilder iLocal = RentInt32Local(); using RentedLocalBuilder textSpanLocal = RentReadOnlySpanCharLocal(); @@ -1580,13 +1416,9 @@ void GenerateLeadingCharacter_LeftToRight() // If we can use IndexOf{Any}, try to accelerate the skip loop via vectorization to match the first prefix. // We can use it if this is a case-sensitive class with a small number of characters in the class. - Span setChars = stackalloc char[3]; // up to 3 characters handled by IndexOf{Any} below - int setCharsCount = 0, charClassIndex = 0; - bool canUseIndexOf = - !_leadingCharClasses[0].CaseInsensitive && - (setCharsCount = RegexCharClass.GetSetChars(_leadingCharClasses[0].CharClass, setChars)) > 0 && - !RegexCharClass.IsNegated(_leadingCharClasses[0].CharClass); - bool needLoop = !canUseIndexOf || _leadingCharClasses.Length > 1; + int setIndex = 0; + bool canUseIndexOf = !primarySet.CaseInsensitive && primarySet.Chars is not null; + bool needLoop = !canUseIndexOf || setsToUse > 1; Label checkSpanLengthLabel = default; Label charNotInClassLabel = default; @@ -1606,13 +1438,25 @@ void GenerateLeadingCharacter_LeftToRight() if (canUseIndexOf) { - charClassIndex = 1; + setIndex = 1; if (needLoop) { - // textSpan.Slice(iLocal) + // textSpan.Slice(iLocal + primarySet.Distance); Ldloca(textSpanLocal); Ldloc(iLocal); + if (primarySet.Distance != 0) + { + Ldc(primarySet.Distance); + Add(); + } + Call(s_spanSliceIntMethod); + } + else if (primarySet.Distance != 0) + { + // textSpan.Slice(primarySet.Distance) + Ldloca(textSpanLocal); + Ldc(primarySet.Distance); Call(s_spanSliceIntMethod); } else @@ -1621,29 +1465,34 @@ void GenerateLeadingCharacter_LeftToRight() Ldloc(textSpanLocal); } - switch (setCharsCount) + switch (primarySet.Chars!.Length) { case 1: // tmp = ...IndexOf(setChars[0]); - Ldc(setChars[0]); + Ldc(primarySet.Chars[0]); Call(s_spanIndexOfChar); break; case 2: // tmp = ...IndexOfAny(setChars[0], setChars[1]); - Ldc(setChars[0]); - Ldc(setChars[1]); + Ldc(primarySet.Chars[0]); + Ldc(primarySet.Chars[1]); Call(s_spanIndexOfAnyCharChar); break; - default: // 3 + case 3: // tmp = ...IndexOfAny(setChars[0], setChars[1], setChars[2]}); - Debug.Assert(setCharsCount == 3); - Ldc(setChars[0]); - Ldc(setChars[1]); - Ldc(setChars[2]); + Ldc(primarySet.Chars[0]); + Ldc(primarySet.Chars[1]); + Ldc(primarySet.Chars[2]); Call(s_spanIndexOfAnyCharCharChar); break; + + default: + Ldstr(new string(primarySet.Chars)); + Call(s_stringAsSpanMethod); + Call(s_spanIndexOfAnySpan); + break; } if (needLoop) @@ -1672,13 +1521,13 @@ void GenerateLeadingCharacter_LeftToRight() BltFar(returnFalse); } - // if (i >= textSpan.Length - (_leadingCharClasses.Length - 1)) goto returnFalse; - if (_leadingCharClasses.Length > 1) + // if (i >= textSpan.Length - (minRequiredLength - 1)) goto returnFalse; + if (sets.Count > 1) { Debug.Assert(needLoop); Ldloca(textSpanLocal); Call(s_spanGetLengthMethod); - Ldc(_leadingCharClasses.Length - 1); + Ldc(minRequiredLength - 1); Sub(); Ldloc(iLocal); BleFar(returnFalse); @@ -1689,20 +1538,20 @@ void GenerateLeadingCharacter_LeftToRight() // if (!CharInClass(textSpan[i + 1], prefix[1], "...")) continue; // if (!CharInClass(textSpan[i + 2], prefix[2], "...")) continue; // ... - Debug.Assert(charClassIndex == 0 || charClassIndex == 1); - for ( ; charClassIndex < _leadingCharClasses.Length; charClassIndex++) + Debug.Assert(setIndex == 0 || setIndex == 1); + for ( ; setIndex < sets.Count; setIndex++) { Debug.Assert(needLoop); Ldloca(textSpanLocal); Ldloc(iLocal); - if (charClassIndex > 0) + if (sets[setIndex].Distance != 0) { - Ldc(charClassIndex); + Ldc(sets[setIndex].Distance); Add(); } Call(s_spanGetItemMethod); LdindU2(); - EmitMatchCharacterClass(_leadingCharClasses[charClassIndex].CharClass, _leadingCharClasses[charClassIndex].CaseInsensitive); + EmitMatchCharacterClass(sets[setIndex].Set, sets[setIndex].CaseInsensitive); BrfalseFar(charNotInClassLabel); } @@ -1726,14 +1575,14 @@ void GenerateLeadingCharacter_LeftToRight() Add(); Stloc(iLocal); - // for (...; i < span.Length - (_leadingCharClasses.Length - 1); ...); + // for (...; i < span.Length - (minRequiredLength - 1); ...); MarkLabel(checkSpanLengthLabel); Ldloc(iLocal); Ldloca(textSpanLocal); Call(s_spanGetLengthMethod); - if (_leadingCharClasses.Length > 1) + if (setsToUse > 1 || primarySet.Distance != 0) { - Ldc(_leadingCharClasses.Length - 1); + Ldc(minRequiredLength - 1); Sub(); } BltFar(loopBody); @@ -1831,6 +1680,11 @@ private bool TryGenerateSimplifiedGo(RegexNode node) Ldloc(runtextposLocal); Stloc(originalruntextposLocal); + // int runstackpos = 0; + LocalBuilder runstackpos = DeclareInt32(); + Ldc(0); + Stloc(runstackpos); + // The implementation tries to use const indexes into the span wherever possible, which we can do // in all places except for variable-length loops. For everything else, we know at any point in // the regex exactly how far into it we are, and we can use that to index into the span created @@ -2086,25 +1940,222 @@ void EmitAtomicAlternate(RegexNode node) TransferTextSpanPosToRunTextPos(); } - // Successfully completed the alternate. - MarkLabel(doneAlternate); - Debug.Assert(textSpanPos == 0); + // Successfully completed the alternate. + MarkLabel(doneAlternate); + Debug.Assert(textSpanPos == 0); + } + + // Emits the code to handle a backreference. + void EmitBackreference(RegexNode node) + { + int capnum = RegexParser.MapCaptureNumber(node.M, _code!.Caps); + + TransferTextSpanPosToRunTextPos(); + + Label end = DefineLabel(); + + // if (!base.IsMatched(capnum)) goto (!ecmascript ? doneLabel : end); + Ldthis(); + Ldc(capnum); + Call(s_isMatchedMethod); + BrfalseFar((node.Options & RegexOptions.ECMAScript) == 0 ? doneLabel : end); + + using RentedLocalBuilder matchLength = RentInt32Local(); + using RentedLocalBuilder matchIndex = RentInt32Local(); + using RentedLocalBuilder i = RentInt32Local(); + + // int matchLength = base.MatchLength(capnum); + Ldthis(); + Ldc(capnum); + Call(s_matchLengthMethod); + Stloc(matchLength); + + // if (textSpan.Length < matchLength) goto doneLabel; + Ldloca(textSpanLocal); + Call(s_spanGetLengthMethod); + Ldloc(matchLength); + BltFar(doneLabel); + + // int matchIndex = base.MatchIndex(capnum); + Ldthis(); + Ldc(capnum); + Call(s_matchIndexMethod); + Stloc(matchIndex); + + Label condition = DefineLabel(); + Label body = DefineLabel(); + + // for (int i = 0; ...) + Ldc(0); + Stloc(i); + Br(condition); + + MarkLabel(body); + + // if (runtext[matchIndex + i] != textSpan[i]) goto doneLabel; + Ldloc(runtextLocal); + Ldloc(matchIndex); + Ldloc(i); + Add(); + Call(s_stringGetCharsMethod); + if (IsCaseInsensitive(node)) + { + CallToLower(); + } + Ldloca(textSpanLocal); + Ldloc(i); + Call(s_spanGetItemMethod); + LdindU2(); + if (IsCaseInsensitive(node)) + { + CallToLower(); + } + BneFar(doneLabel); + + // for (...; ...; i++) + Ldloc(i); + Ldc(1); + Add(); + Stloc(i); + + // for (...; i < matchLength; ...) + MarkLabel(condition); + Ldloc(i); + Ldloc(matchLength); + Blt(body); + + // runtextpos += matchLength; + Ldloc(runtextposLocal); + Ldloc(matchLength); + Add(); + Stloc(runtextposLocal); + LoadTextSpanLocal(); + + MarkLabel(end); + } + + // Emits the code for an if(backreference)-then-else conditional. + void EmitBackreferenceConditional(RegexNode node) + { + int capnum = RegexParser.MapCaptureNumber(node.M, _code!.Caps); + int startingTextSpanPos = textSpanPos; + bool hasNo = node.ChildCount() > 1; + + Label no = DefineLabel(); + Label end = DefineLabel(); + + // if (!base.IsMatched(capnum)) goto end/no; + Ldthis(); + Ldc(capnum); + Call(s_isMatchedMethod); + BrfalseFar(hasNo ? no : end); + + // yes branch + EmitNode(node.Child(0)); + TransferTextSpanPosToRunTextPos(); + + if (hasNo) + { + BrFar(end); + + // no branch + MarkLabel(no); + textSpanPos = startingTextSpanPos; + EmitNode(node.Child(1)); + TransferTextSpanPosToRunTextPos(); + } + + MarkLabel(end); + } + + // Emits the code for an if(expression)-then-else conditional. + void EmitExpressionConditional(RegexNode node) + { + // The first child node is the conditional expression. If this matches, then we branch to the "yes" branch. + // If it doesn't match, then we branch to the optional "no" branch if it exists, or simply skip the "yes" + // branch, otherwise. The conditional is treated as a positive lookahead. If it's not already + // such a node, wrap it in one. + RegexNode conditional = node.Child(0); + if (conditional is not { Type: RegexNode.Require }) + { + var newConditional = new RegexNode(RegexNode.Require, conditional.Options); + newConditional.AddChild(conditional); + conditional = newConditional; + } + + // Get the "yes" branch and the optional "no" branch, if it exists. + RegexNode yesBranch = node.Child(1); + RegexNode? noBranch = node.ChildCount() > 2 ? node.Child(2) : null; + + Label end = DefineLabel(); + Label no = DefineLabel(); + + // If the conditional expression has captures, we'll need to uncapture them in the case of no match. + LocalBuilder? startingCrawlPos = null; + if ((conditional.Options & RegexNode.HasCapturesFlag) != 0) + { + // int startingCrawlPos = base.Crawlpos(); + startingCrawlPos = DeclareInt32(); + Ldthis(); + Call(s_crawlposMethod); + Stloc(startingCrawlPos); + } + + // Emit the conditional expression. We need to reroute any match failures to either the "no" branch + // if it exists, or to the end of the node (skipping the "yes" branch) if it doesn't. + Label originalDoneLabel = doneLabel; + Label tmpDoneLabel = noBranch is not null ? no : end; + doneLabel = tmpDoneLabel; + EmitPositiveLookaheadAssertion(conditional); + if (doneLabel == tmpDoneLabel) + { + doneLabel = originalDoneLabel; + } + + // If we get to this point of the code, the conditional successfully matched, so run the "yes" branch. + // Since the "yes" branch may have a different execution path than the "no" branch or the lack of + // any branch, we need to store the current textSpanPosition and reset it prior to emitting the code + // for what comes after the "yes" branch, so that everyone is on equal footing. + int startingTextSpanPos = textSpanPos; + EmitNode(yesBranch); + TransferTextSpanPosToRunTextPos(); // ensure all subsequent code sees the same textSpanPos value by setting it to 0 + + // If there's a no branch, we need to emit it, but skipping it from a successful "yes" branch match. + if (noBranch is not null) + { + BrFar(end); + + // Emit the no branch, first uncapturing any captures from the expression condition that failed + // to match and emit the branch. + MarkLabel(no); + if (startingCrawlPos is not null) + { + EmitUncaptureUntil(startingCrawlPos); + } + textSpanPos = startingTextSpanPos; + EmitNode(noBranch); + TransferTextSpanPosToRunTextPos(); // ensure all subsequent code sees the same textSpanPos value by setting it to 0 + } + + MarkLabel(end); } // Emits the code for a Capture node. void EmitCapture(RegexNode node, RegexNode? subsequent = null) { - Debug.Assert(node.N == -1); LocalBuilder startingRunTextPos = DeclareInt32(); - // Get the capture number. This needs to be kept - // in sync with MapCapNum in RegexWriter. Debug.Assert(node.Type == RegexNode.Capture); - Debug.Assert(node.N == -1, "Currently only support capnum, not uncapnum"); - int capnum = node.M; - if (capnum != -1 && _code!.Caps != null) + int capnum = RegexParser.MapCaptureNumber(node.M, _code!.Caps); + int uncapnum = RegexParser.MapCaptureNumber(node.N, _code.Caps); + + if (uncapnum != -1) { - capnum = (int)_code.Caps[capnum]!; + // if (!IsMatched(uncapnum)) goto doneLabel; + Ldthis(); + Ldc(uncapnum); + Call(s_isMatchedMethod); + BrfalseFar(doneLabel); } // runtextpos += textSpanPos; @@ -2119,13 +2170,27 @@ void EmitCapture(RegexNode node, RegexNode? subsequent = null) // runtextpos += textSpanPos; // textSpan = textSpan.Slice(textSpanPos); - // Capture(capnum, startingRunTextPos, runtextpos); TransferTextSpanPosToRunTextPos(); - Ldthis(); - Ldc(capnum); - Ldloc(startingRunTextPos); - Ldloc(runtextposLocal); - Call(s_captureMethod); + + if (uncapnum == -1) + { + // Capture(capnum, startingRunTextPos, runtextpos); + Ldthis(); + Ldc(capnum); + Ldloc(startingRunTextPos); + Ldloc(runtextposLocal); + Call(s_captureMethod); + } + else + { + // TransferCapture(capnum, uncapnum, startingRunTextPos, runtextpos); + Ldthis(); + Ldc(capnum); + Ldc(uncapnum); + Ldloc(startingRunTextPos); + Ldloc(runtextposLocal); + Call(s_transferCaptureMethod); + } } // Emits code to unwind the capture stack until the crawl position specified in the provided local. @@ -2243,22 +2308,18 @@ void EmitNode(RegexNode node, RegexNode? subsequent = null, bool emitLengthCheck break; case RegexNode.Loop: - EmitAtomicNodeLoop(node); + EmitLoop(node); break; + case RegexNode.Onelazy: + case RegexNode.Notonelazy: + case RegexNode.Setlazy: case RegexNode.Lazyloop: - // An atomic lazy loop amounts to doing the minimum amount of work possible. - // That means iterating as little as is required, which means a repeater - // for the min, and if min is 0, doing nothing. - Debug.Assert(node.M == node.N || (node.Next != null && node.Next.Type == RegexNode.Atomic)); - if (node.M > 0) - { - EmitNodeRepeater(node); - } + EmitLazy(node, emitLengthChecksIfRequired); break; case RegexNode.Atomic: - EmitNode(node.Child(0), subsequent); + EmitAtomic(node, subsequent); break; case RegexNode.Alternate: @@ -2271,30 +2332,20 @@ void EmitNode(RegexNode node, RegexNode? subsequent = null, bool emitLengthCheck EmitSingleCharLoop(node, subsequent, emitLengthChecksIfRequired); break; - case RegexNode.Onelazy: - case RegexNode.Notonelazy: - case RegexNode.Setlazy: - EmitSingleCharFixedRepeater(node, emitLengthChecksIfRequired); + case RegexNode.Concatenate: + EmitConcatenation(node, subsequent, emitLengthChecksIfRequired); break; - case RegexNode.Concatenate: - int childCount = node.ChildCount(); - for (int i = 0; i < childCount; i++) - { - if (emitLengthChecksIfRequired && node.TryGetJoinableLengthCheckChildRange(i, out int requiredLength, out int exclusiveEnd)) - { - EmitSpanLengthCheck(requiredLength); - for (; i < exclusiveEnd; i++) - { - EmitNode(node.Child(i), i + 1 < childCount ? node.Child(i + 1) : subsequent, emitLengthChecksIfRequired: false); - } + case RegexNode.Ref: + EmitBackreference(node); + break; - i--; - continue; - } + case RegexNode.Testref: + EmitBackreferenceConditional(node); + break; - EmitNode(node.Child(i), i + 1 < childCount ? node.Child(i + 1) : subsequent); - } + case RegexNode.Testgroup: + EmitExpressionConditional(node); break; case RegexNode.Capture: @@ -2327,6 +2378,17 @@ void EmitNode(RegexNode node, RegexNode? subsequent = null, bool emitLengthCheck } } + // Emits the node for an atomic. + void EmitAtomic(RegexNode node, RegexNode? subsequent) + { + // Atomic simply outputs the code for the child, but it ensures that any done label left + // set by the child is reset to what it was prior to the node's processing. That way, + // anything later that tries to jump back won't see labels set inside the atomic. + Label originalDoneLabel = doneLabel; + EmitNode(node.Child(0), subsequent); + doneLabel = originalDoneLabel; + } + // Emits the code to handle updating base.runtextpos to runtextpos in response to // an UpdateBumpalong node. This is used when we want to inform the scan loop that // it should bump from this location rather than from the original location. @@ -2339,6 +2401,28 @@ void EmitUpdateBumpalong() Stfld(s_runtextposField); } + // Emits code for a concatenation + void EmitConcatenation(RegexNode node, RegexNode? subsequent, bool emitLengthChecksIfRequired) + { + int childCount = node.ChildCount(); + for (int i = 0; i < childCount; i++) + { + if (emitLengthChecksIfRequired && node.TryGetJoinableLengthCheckChildRange(i, out int requiredLength, out int exclusiveEnd)) + { + EmitSpanLengthCheck(requiredLength); + for (; i < exclusiveEnd; i++) + { + EmitNode(node.Child(i), i + 1 < childCount ? node.Child(i + 1) : subsequent, emitLengthChecksIfRequired: false); + } + + i--; + continue; + } + + EmitNode(node.Child(i), i + 1 < childCount ? node.Child(i + 1) : subsequent); + } + } + // Emits the code to handle a single-character match. void EmitSingleChar(RegexNode node, bool emitLengthCheck = true, LocalBuilder? offset = null) { @@ -2362,7 +2446,7 @@ void EmitSingleChar(RegexNode node, bool emitLengthCheck = true, LocalBuilder? o } else { - if (IsCaseInsensitive(node) && RegexCharClass.ParticipatesInCaseConversion(node.Ch)) + if (IsCaseInsensitive(node)) { CallToLower(); } @@ -2595,7 +2679,7 @@ void EmitMultiChar(RegexNode node, bool emitLengthCheck = true) EmitTextSpanOffset(); textSpanPos++; LdindU2(); - if (caseInsensitive && RegexCharClass.ParticipatesInCaseConversion(s[i])) + if (caseInsensitive) { CallToLower(); } @@ -2704,6 +2788,138 @@ void EmitSingleCharLoop(RegexNode node, RegexNode? subsequent = null, bool emitL MarkLabel(endLoop); } + void EmitLazy(RegexNode node, bool emitLengthChecksIfRequired = true) + { + bool isSingleChar = node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily; + + // Emit the min iterations as a repeater. Any failures here don't necessitate backtracking, + // as the lazy itself failed to match. + if (node.M > 0) + { + if (isSingleChar) + { + EmitSingleCharFixedRepeater(node, emitLengthChecksIfRequired); + } + else + { + EmitNodeRepeater(node); + } + } + + // If the whole thing was actually that repeater, we're done. Similarly, if this is actually an atomic + // lazy loop, nothing will ever backtrack into this node, so we never need to iterate more than the minimum. + if (node.M == node.N || node.Next is { Type: RegexNode.Atomic }) + { + return; + } + + Debug.Assert(node.M < node.N); + + // We now need to match one character at a time, each time allowing the remainder of the expression + // to try to match, and only matching another character if the subsequent expression fails to match. + + // We're about to enter a loop, so ensure our text position is 0. + TransferTextSpanPosToRunTextPos(); + + // If the loop isn't unbounded, track the number of iterations and the max number to allow. + LocalBuilder? iterationCount = null; + LocalBuilder? maxIterations = null; + if (node.N != int.MaxValue) + { + // int iterationCount = 0; + // int maxIterations = node.N - node.M; + iterationCount = DeclareInt32(); + maxIterations = DeclareInt32(); + Ldc(0); + Stloc(iterationCount); + Ldc(node.N - node.M); + Stloc(maxIterations); + } + + // Track the current crawl position. Upon backtracking, we'll unwind any captures beyond this point. + LocalBuilder? crawlPos = null; + if (expressionHasCaptures) + { + // int crawlPos = base.Crawlpos(); + crawlPos = DeclareInt32(); + Ldthis(); + Call(s_crawlposMethod); + Stloc(crawlPos); + } + + // Track the current runtextpos. Each time we backtrack, we'll reset to the stored position, which + // is also incremented each time we match another character in the loop. + // int nextPos = runtextpos; + LocalBuilder nextPos = DeclareInt32(); + Ldloc(runtextposLocal); + Stloc(nextPos); + + // Skip the backtracking section for the initial subsequent matching. We've already matched the + // minimum number of iterations, which means we can successfully match with zero additional iterations. + // goto endLoopLabel; + Label endLoopLabel = DefineLabel(); + BrFar(endLoopLabel); + + // Backtracking section. Subsequent failures will jump to here. + Label backtrackingLabel = DefineLabel(); + MarkLabel(backtrackingLabel); + + // Uncapture any captures if the expression has any. It's possible the captures it has + // are before this node, in which case this is wasted effort, but still functionally correct. + if (expressionHasCaptures) + { + EmitUncaptureUntil(crawlPos!); + } + + // If there's a max number of iterations, see if we've exceeded the maximum number of characters + // to match. If we haven't, increment the iteration count. + if (maxIterations is not null) + { + // if (iterationCount >= maxIterations) goto doneLabel; + Ldloc(iterationCount!); + Ldloc(maxIterations); + BgeFar(doneLabel); + + // iterationCount++; + Ldloc(iterationCount!); + Ldc(1); + Add(); + Stloc(iterationCount!); + } + + // Now match the next character in the lazy loop. We need to reset the runtextpos to the position + // just after the last character in this loop was matched, and we need to store the resulting position + // for the next time we backtrack. + + // runtextpos = nextPos; + // MatchSingleChar(); + // nextpos = runtextpos; + Ldloc(nextPos); + Stloc(runtextposLocal); + LoadTextSpanLocal(); + if (isSingleChar) + { + EmitSingleChar(node); + } + else + { + EmitNode(node.Child(0)); + } + TransferTextSpanPosToRunTextPos(); + Ldloc(runtextposLocal); + Stloc(nextPos); + + // Update the done label for everything that comes after this node. This is done after we emit the single char + // matching, as that failing indicates the loop itself has failed to match. + Label originalDoneLabel = doneLabel; + doneLabel = backtrackingLabel; // leave set to the backtracking label for all subsequent nodes + + MarkLabel(endLoopLabel); + + // We explicitly do not reset doneLabel back to originalDoneLabel. + // It's left pointing to the backtracking label for everything subsequent in the expression. + } + // Emits the code to handle a loop (repeater) with a fixed number of iterations. // RegexNode.M is used for the number of iterations; RegexNode.N is ignored. void EmitSingleCharFixedRepeater(RegexNode node, bool emitLengthChecksIfRequired = true) @@ -2865,12 +3081,12 @@ void EmitSingleCharAtomicLoop(RegexNode node) Label atomicLoopDoneLabel = DefineLabel(); - Span setChars = stackalloc char[3]; // 3 is max we can use with IndexOfAny + Span setChars = stackalloc char[5]; // max optimized by IndexOfAny today int numSetChars = 0; if (node.IsNotoneFamily && maxIterations == int.MaxValue && - (!IsCaseInsensitive(node) || !RegexCharClass.ParticipatesInCaseConversion(node.Ch))) + (!IsCaseInsensitive(node))) { // For Notone, we're looking for a specific character, as everything until we find // it is consumed by the loop. If we're unbounded, such as with ".*" and if we're case-sensitive, @@ -2911,14 +3127,15 @@ void EmitSingleCharAtomicLoop(RegexNode node) else if (node.IsSetFamily && maxIterations == int.MaxValue && !IsCaseInsensitive(node) && - (numSetChars = RegexCharClass.GetSetChars(node.Str!, setChars)) > 1 && + (numSetChars = RegexCharClass.GetSetChars(node.Str!, setChars)) != 0 && RegexCharClass.IsNegated(node.Str!)) { - // If the set is negated and contains only 2 or 3 characters (if it contained 1 and was negated, it would + // If the set is negated and contains only a few characters (if it contained 1 and was negated, it would // have been reduced to a Notone), we can use an IndexOfAny to find any of the target characters. // As with the notoneloopatomic above, the unbounded constraint is purely for simplicity. + Debug.Assert(numSetChars > 1); - // int i = textSpan.Slice(textSpanPos).IndexOfAny(ch1, ch2{, ch3}); + // int i = textSpan.Slice(textSpanPos).IndexOfAny(ch1, ch2, ...); if (textSpanPos > 0) { Ldloca(textSpanLocal); @@ -2929,17 +3146,26 @@ void EmitSingleCharAtomicLoop(RegexNode node) { Ldloc(textSpanLocal); } - Ldc(setChars[0]); - Ldc(setChars[1]); - if (numSetChars == 2) - { - Call(s_spanIndexOfAnyCharChar); - } - else + switch (numSetChars) { - Debug.Assert(numSetChars == 3); - Ldc(setChars[2]); - Call(s_spanIndexOfAnyCharCharChar); + case 2: + Ldc(setChars[0]); + Ldc(setChars[1]); + Call(s_spanIndexOfAnyCharChar); + break; + + case 3: + Ldc(setChars[0]); + Ldc(setChars[1]); + Ldc(setChars[2]); + Call(s_spanIndexOfAnyCharCharChar); + break; + + default: + Ldstr(setChars.Slice(0, numSetChars).ToString()); + Call(s_stringAsSpanMethod); + Call(s_spanIndexOfSpan); + break; } Stloc(iterationLocal); @@ -3008,7 +3234,7 @@ void EmitSingleCharAtomicLoop(RegexNode node) } else { - if (IsCaseInsensitive(node) && RegexCharClass.ParticipatesInCaseConversion(node.Ch)) + if (IsCaseInsensitive(node)) { CallToLower(); } @@ -3095,7 +3321,7 @@ void EmitAtomicSingleCharZeroOrOne(RegexNode node) } else { - if (IsCaseInsensitive(node) && RegexCharClass.ParticipatesInCaseConversion(node.Ch)) + if (IsCaseInsensitive(node)) { CallToLower(); } @@ -3125,12 +3351,116 @@ void EmitAtomicSingleCharZeroOrOne(RegexNode node) MarkLabel(skipUpdatesLabel); } + // Emits the code to handle a backtracking loop + void EmitLoop(RegexNode node) + { + // If the loop is atomic, emit it as such and avoid all backtracking. + if (node.Next is { Type: RegexNode.Atomic }) + { + EmitAtomicNodeLoop(node); + return; + } + + // If the loop is actually a repeater, similarly emit it as such and avoid all backtracking. + if (node.M == node.N) + { + EmitNodeRepeater(node); + return; + } + + // Emit backtracking around an atomic loop, but tracking the starting position of each iteration + // along the way so that we can backtrack through each position. + + Debug.Assert(node.M < node.N); + Label backtrackingLabel = DefineLabel(); + Label endLoop = DefineLabel(); + LocalBuilder startingStackPos = DeclareInt32(); + LocalBuilder endingStackPos = DeclareInt32(); + + // We're about to enter a loop, so ensure our text position is 0. + TransferTextSpanPosToRunTextPos(); + + // Grab the current position, then emit the loop as atomic, except keeping track of the position + // before each iteration match, which enables us to then apply the backtracking. + + // int startingStackPos = runstackpos; + Ldloc(runstackpos); + Stloc(startingStackPos); + + EmitAtomicNodeLoop(node, trackStartingPositions: true); + TransferTextSpanPosToRunTextPos(); + + // int endingStackPos = runstackpos; + Ldloc(runstackpos); + Stloc(endingStackPos); + + LocalBuilder? crawlPos = null; + if (expressionHasCaptures) + { + // int crawlPos = base.Crawlpos(); + crawlPos = DeclareInt32(); + Ldthis(); + Call(s_crawlposMethod); + Stloc(crawlPos); + } + if (node.M > 0) + { + // startingStackPos += node.M; + Ldloc(startingStackPos); + Ldc(node.M); + Add(); + Stloc(startingStackPos); + } + + // goto endLoop; + BrFar(endLoop); + + // Backtracking section. Subsequent failures will jump to here, at which + // point we decrement the matched count as long as it's above the minimum + // required, and try again by flowing to everything that comes after this. + + // Backtrack: + // if (startingStackPos >= endingStackPos) goto endLoop; + MarkLabel(backtrackingLabel); + Label originalDoneLabel = doneLabel; + Ldloc(startingStackPos); + Ldloc(endingStackPos); + BgeFar(originalDoneLabel); + doneLabel = backtrackingLabel; // leave set to the backtracking label for all subsequent nodes + + if (expressionHasCaptures) + { + // Uncapture any captures if the expression has any. It's possible the captures it has + // are before this node, in which case this is wasted effort, but still functionally correct. + EmitUncaptureUntil(crawlPos!); + } + + // runtextpos = base.runstack[--endingStackPos]; + Ldthisfld(s_runstackField); + Ldloc(endingStackPos); + Ldc(1); + Sub(); + Stloc(endingStackPos); + Ldloc(endingStackPos); + LdelemI4(); + Stloc(runtextposLocal); + + LoadTextSpanLocal(); + + MarkLabel(endLoop); + + // We explicitly do not reset doneLabel back to originalDoneLabel. + // It's left pointing to the backtracking label for everything subsequent in the expression. + } + // Emits the code to handle a non-backtracking, variable-length loop around another node. - void EmitAtomicNodeLoop(RegexNode node) + // If trackStartingPositions is true, it will also handle emitting code to use runstack[runstackpos] + // to store the starting positions of each iteration. + void EmitAtomicNodeLoop(RegexNode node, bool trackStartingPositions = false) { - Debug.Assert(node.Type == RegexNode.Loop); - Debug.Assert(node.M == node.N || (node.Next != null && (node.Next.Type is RegexNode.Atomic or RegexNode.Capture))); - Debug.Assert(node.M < int.MaxValue); + Debug.Assert(node.Type == RegexNode.Loop, $"Unexpected type: {node.Type}"); + Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); + Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}"); // If this is actually a repeater, emit that instead. if (node.M == node.N) @@ -3182,6 +3512,43 @@ void EmitAtomicNodeLoop(RegexNode node) Ldloc(runtextposLocal); Stloc(startingRunTextPosLocal); + if (trackStartingPositions) + { + // Track the starting position of each loop iteration to enable backtracking. + + // if (runstackpos != base.runstack.Length) goto storeLabel; + Ldloc(runstackpos); + Ldthisfld(s_runstackField); + Ldlen(); + Label storeLabel = DefineLabel(); + Bne(storeLabel); + + // Array.Resize(ref base.runstack, base.runstack.Length * 2); + Ldthis(); + _ilg!.Emit(OpCodes.Ldflda, s_runstackField); + Ldthisfld(s_runstackField); + Ldlen(); + _ilg!.Emit(OpCodes.Conv_I4); + Ldc(2); + Mul(); + Call(s_arrayResize); + + // storeLabel: + MarkLabel(storeLabel); + + // base.runstack[runstackpos] = runtextpos; + Ldthisfld(s_runstackField); + Ldloc(runstackpos); + Ldloc(runtextposLocal); + StelemI4(); + + // runstackpos++; + Ldloc(runstackpos); + Ldc(1); + Add(); + Stloc(runstackpos); + } + // Emit the child. Debug.Assert(textSpanPos == 0); EmitNode(node.Child(0)); @@ -4185,7 +4552,7 @@ private void GenerateOneCode() } else { - if (IsCaseInsensitive() && RegexCharClass.ParticipatesInCaseConversion(Operand(0))) + if (IsCaseInsensitive()) { CallToLower(); } @@ -4231,7 +4598,7 @@ private void GenerateOneCode() Add(); } Call(s_stringGetCharsMethod); - if (IsCaseInsensitive() && RegexCharClass.ParticipatesInCaseConversion(str[i])) + if (IsCaseInsensitive()) { CallToLower(); } @@ -4274,7 +4641,7 @@ private void GenerateOneCode() Ldc(str.Length - i); Sub(); Call(s_stringGetCharsMethod); - if (IsCaseInsensitive() && RegexCharClass.ParticipatesInCaseConversion(str[i])) + if (IsCaseInsensitive()) { CallToLower(); } @@ -4477,7 +4844,7 @@ private void GenerateOneCode() } else { - if (IsCaseInsensitive() && RegexCharClass.ParticipatesInCaseConversion(Operand(0))) + if (IsCaseInsensitive()) { CallToLower(); } @@ -4579,14 +4946,14 @@ private void GenerateOneCode() Label loopEnd = DefineLabel(); string? set = Code() == RegexCode.Setloop || Code() == RegexCode.Setloopatomic ? _strings![Operand(0)] : null; - Span setChars = stackalloc char[3]; + Span setChars = stackalloc char[5]; // max optimized by IndexOfAny today int numSetChars; // If this is a notoneloop{atomic} and we're left-to-right and case-sensitive, // we can use the vectorized IndexOf to search for the target character. if ((Code() == RegexCode.Notoneloop || Code() == RegexCode.Notoneloopatomic) && !IsRightToLeft() && - (!IsCaseInsensitive() || !RegexCharClass.ParticipatesInCaseConversion(Operand(0)))) + (!IsCaseInsensitive())) { // i = runtext.AsSpan(runtextpos, len).IndexOf(ch); Ldloc(_runtextLocal!); @@ -4633,29 +5000,39 @@ private void GenerateOneCode() else if ((Code() == RegexCode.Setloop || Code() == RegexCode.Setloopatomic) && !IsRightToLeft() && !IsCaseInsensitive() && - (numSetChars = RegexCharClass.GetSetChars(set!, setChars)) > 1 && + (numSetChars = RegexCharClass.GetSetChars(set!, setChars)) != 0 && RegexCharClass.IsNegated(set!)) { // Similarly, if this is a setloop{atomic} and we're left-to-right and case-sensitive, - // and if the set contains only 2 or 3 negated chars, we can use the vectorized IndexOfAny + // and if the set contains only a few negated chars, we can use the vectorized IndexOfAny // to search for those chars. + Debug.Assert(numSetChars > 1); // i = runtext.AsSpan(runtextpos, len).IndexOfAny(ch1, ch2{, ch3}); Ldloc(_runtextLocal!); Ldloc(_runtextposLocal!); Ldloc(lenLocal); Call(s_stringAsSpanIntIntMethod); - Ldc(setChars[0]); - Ldc(setChars[1]); - if (numSetChars == 2) + switch (numSetChars) { - Call(s_spanIndexOfAnyCharChar); - } - else - { - Debug.Assert(numSetChars == 3); - Ldc(setChars[2]); - Call(s_spanIndexOfAnyCharCharChar); + case 2: + Ldc(setChars[0]); + Ldc(setChars[1]); + Call(s_spanIndexOfAnyCharChar); + break; + + case 3: + Ldc(setChars[0]); + Ldc(setChars[1]); + Ldc(setChars[2]); + Call(s_spanIndexOfAnyCharCharChar); + break; + + default: + Ldstr(setChars.Slice(0, numSetChars).ToString()); + Call(s_stringAsSpanMethod); + Call(s_spanIndexOfSpan); + break; } Stloc(iLocal); @@ -4754,7 +5131,7 @@ private void GenerateOneCode() } else { - if (IsCaseInsensitive() && RegexCharClass.ParticipatesInCaseConversion(Operand(0))) + if (IsCaseInsensitive()) { CallToLower(); } @@ -4955,7 +5332,7 @@ private void GenerateOneCode() } else { - if (IsCaseInsensitive() && RegexCharClass.ParticipatesInCaseConversion(Operand(0))) + if (IsCaseInsensitive()) { CallToLower(); } @@ -5105,21 +5482,34 @@ private void EmitMatchCharacterClass(string charClass, bool caseInsensitive) // Next, if there's only 2 or 3 chars in the set (fairly common due to the sets we create for prefixes), // it's cheaper and smaller to compare against each than it is to use a lookup table. - if (!invariant) + if (!invariant && !RegexCharClass.IsNegated(charClass)) { - Span setChars = stackalloc char[3]; + Span setChars = stackalloc char[4]; int numChars = RegexCharClass.GetSetChars(charClass, setChars); - if (numChars > 0 && !RegexCharClass.IsNegated(charClass)) + if (numChars is 2 or 3) { - // (ch == setChars[0]) | (ch == setChars[1]) { | (ch == setChars[2]) } - Debug.Assert(numChars == 2 || numChars == 3); - Ldloc(tempLocal); - Ldc(setChars[0]); - Ceq(); - Ldloc(tempLocal); - Ldc(setChars[1]); - Ceq(); - Or(); + if ((setChars[0] | 0x20) == setChars[1]) // special-case common case of an upper and lowercase ASCII letter combination + { + // ((ch | 0x20) == setChars[1]) + Ldloc(tempLocal); + Ldc(0x20); + Or(); + Ldc(setChars[1]); + Ceq(); + } + else + { + // (ch == setChars[0]) | (ch == setChars[1]) + Ldloc(tempLocal); + Ldc(setChars[0]); + Ceq(); + Ldloc(tempLocal); + Ldc(setChars[1]); + Ceq(); + Or(); + } + + // | (ch == setChars[2]) if (numChars == 3) { Ldloc(tempLocal); @@ -5130,6 +5520,27 @@ private void EmitMatchCharacterClass(string charClass, bool caseInsensitive) return; } + else if (numChars == 4 && + (setChars[0] | 0x20) == setChars[1] && + (setChars[2] | 0x20) == setChars[3]) + { + // ((ch | 0x20) == setChars[1]) + Ldloc(tempLocal); + Ldc(0x20); + Or(); + Ldc(setChars[1]); + Ceq(); + + // ((ch | 0x20) == setChars[3]) + Ldloc(tempLocal); + Ldc(0x20); + Or(); + Ldc(setChars[3]); + Ceq(); + + Or(); + return; + } } using RentedLocalBuilder resultLocal = RentInt32Local(); diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexFindOptimizations.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexFindOptimizations.cs new file mode 100644 index 00000000000000..de2fb1619e0cb0 --- /dev/null +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexFindOptimizations.cs @@ -0,0 +1,666 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; + +namespace System.Text.RegularExpressions +{ + /// Contains state and provides operations related to finding the next location a match could possibly begin. + internal sealed class RegexFindOptimizations + { + /// The minimum required length an input need be to match the pattern. May be 0. + private readonly int _minRequiredLength; + /// True if the input should be processed right-to-left rather than left-to-right. + private readonly bool _rightToLeft; + /// Provides the ToLower routine for lowercasing characters. + private readonly TextInfo _textInfo; + /// Lookup table used for optimizing ASCII when doing set queries. + private readonly uint[]?[]? _asciiLookups; + + public RegexFindOptimizations(RegexTree tree, CultureInfo culture) + { + _rightToLeft = (tree.Options & RegexOptions.RightToLeft) != 0; + _minRequiredLength = tree.MinRequiredLength; + _textInfo = culture.TextInfo; + + // Compute any anchor starting the expression. If there is one, we won't need to search for anything, + // as we can just match at that single location. + LeadingAnchor = RegexPrefixAnalyzer.FindLeadingAnchor(tree); + if (_rightToLeft) + { + // Filter out Bol for RightToLeft, as we don't currently optimize for it. + LeadingAnchor &= ~RegexPrefixAnalyzer.Bol; + } + if ((LeadingAnchor & (RegexPrefixAnalyzer.Beginning | RegexPrefixAnalyzer.Start | RegexPrefixAnalyzer.EndZ | RegexPrefixAnalyzer.End)) != 0) + { + FindMode = (LeadingAnchor, _rightToLeft) switch + { + (RegexPrefixAnalyzer.Beginning, false) => FindNextStartingPositionMode.LeadingAnchor_LeftToRight_Beginning, + (RegexPrefixAnalyzer.Beginning, true) => FindNextStartingPositionMode.LeadingAnchor_RightToLeft_Beginning, + (RegexPrefixAnalyzer.Start, false) => FindNextStartingPositionMode.LeadingAnchor_LeftToRight_Start, + (RegexPrefixAnalyzer.Start, true) => FindNextStartingPositionMode.LeadingAnchor_RightToLeft_Start, + (RegexPrefixAnalyzer.End, false) => FindNextStartingPositionMode.LeadingAnchor_LeftToRight_End, + (RegexPrefixAnalyzer.End, true) => FindNextStartingPositionMode.LeadingAnchor_RightToLeft_End, + (_, false) => FindNextStartingPositionMode.LeadingAnchor_LeftToRight_EndZ, + (_, true) => FindNextStartingPositionMode.LeadingAnchor_RightToLeft_EndZ, + }; + return; + } + + // If there's a leading case-sensitive substring, just use IndexOf and inherit all of its optimizations. + string caseSensitivePrefix = RegexPrefixAnalyzer.FindCaseSensitivePrefix(tree); + if (caseSensitivePrefix.Length > 1) + { + LeadingCaseSensitivePrefix = caseSensitivePrefix; + FindMode = _rightToLeft ? + FindNextStartingPositionMode.LeadingPrefix_RightToLeft_CaseSensitive : + FindNextStartingPositionMode.LeadingPrefix_LeftToRight_CaseSensitive; + return; + } + + // At this point there are no fast-searchable anchors or case-sensitive prefixes. We can now analyze the + // pattern for sets and then use any found sets to determine what kind of search to perform. + + // If we're compiling, then the compilation process already handles sets that reduce to a single literal, + // so we can simplify and just always go for the sets. + bool dfa = (tree.Options & RegexOptions.NonBacktracking) != 0; + bool compiled = (tree.Options & RegexOptions.Compiled) != 0 && !dfa; // for now, we never generate code for NonBacktracking, so treat it as non-compiled + bool interpreter = !compiled && !dfa; + + // For interpreter, we want to employ optimizations, but we don't want to make construction significantly + // more expensive; someone who wants to pay to do more work can specify Compiled. So for the interpreter + // we focus only on creating a set for the first character. Same for right-to-left, which is used very + // rarely and thus we don't need to invest in special-casing it. + if (_rightToLeft) + { + // Determine a set for anything that can possibly start the expression. + if (RegexPrefixAnalyzer.FindFirstCharClass(tree, culture) is (string CharClass, bool CaseInsensitive) set) + { + // See if the set is limited to holding only a few characters. + Span scratch = stackalloc char[5]; // max optimized by IndexOfAny today + int scratchCount; + char[]? chars = null; + if (!RegexCharClass.IsNegated(set.CharClass) && + (scratchCount = RegexCharClass.GetSetChars(set.CharClass, scratch)) > 0) + { + chars = scratch.Slice(0, scratchCount).ToArray(); + } + + if (!compiled && + chars is { Length: 1 }) + { + // The set contains one and only one character, meaning every match starts + // with the same literal value (potentially case-insensitive). Search for that. + FixedDistanceLiteral = (chars[0], 0); + FindMode = (_rightToLeft, set.CaseInsensitive) switch + { + (false, false) => FindNextStartingPositionMode.FixedLiteral_LeftToRight_CaseSensitive, + (false, true) => FindNextStartingPositionMode.FixedLiteral_LeftToRight_CaseInsensitive, + (true, false) => FindNextStartingPositionMode.LeadingLiteral_RightToLeft_CaseSensitive, + (true, true) => FindNextStartingPositionMode.LeadingLiteral_RightToLeft_CaseInsensitive, + }; + } + else + { + // The set may match multiple characters. Search for that. + FixedDistanceSets = new() { (chars, set.CharClass, 0, set.CaseInsensitive) }; + FindMode = (_rightToLeft, set.CaseInsensitive) switch + { + (false, false) => FindNextStartingPositionMode.LeadingSet_LeftToRight_CaseSensitive, + (false, true) => FindNextStartingPositionMode.LeadingSet_LeftToRight_CaseInsensitive, + (true, false) => FindNextStartingPositionMode.LeadingSet_RightToLeft_CaseSensitive, + (true, true) => FindNextStartingPositionMode.LeadingSet_RightToLeft_CaseInsensitive, + }; + _asciiLookups = new uint[1][]; + } + } + return; + } + + // We're now left-to-right only and looking for sets. + + // Build up a list of all of the sets that are a fixed distance from the start of the expression. + List<(char[]? Chars, string Set, int Distance, bool CaseInsensitive)>? fixedDistanceSets = RegexPrefixAnalyzer.FindFixedDistanceSets(tree, culture, thorough: !interpreter); + if (fixedDistanceSets is not null) + { + Debug.Assert(fixedDistanceSets.Count != 0); + + // Determine whether to do searching based on one or more sets or on a single literal. Compiled engines + // don't need to special-case literals as they already do codegen to create the optimal lookup based on + // the set's characteristics. + if (!compiled && + fixedDistanceSets.Count == 1 && + fixedDistanceSets[0].Chars is { Length: 1 }) + { + FixedDistanceLiteral = (fixedDistanceSets[0].Chars![0], fixedDistanceSets[0].Distance); + FindMode = fixedDistanceSets[0].CaseInsensitive ? + FindNextStartingPositionMode.FixedLiteral_LeftToRight_CaseInsensitive : + FindNextStartingPositionMode.FixedLiteral_LeftToRight_CaseSensitive; + } + else + { + // Limit how many sets we use to avoid doing lots of unnecessary work. The list was already + // sorted from best to worst, so just keep the first ones up to our limit. + const int MaxSetsToUse = 3; // arbitrary tuned limit + if (fixedDistanceSets.Count > MaxSetsToUse) + { + fixedDistanceSets.RemoveRange(MaxSetsToUse, fixedDistanceSets.Count - MaxSetsToUse); + } + + // Store the sets, and compute which mode to use. + FixedDistanceSets = fixedDistanceSets; + FindMode = (fixedDistanceSets.Count == 1 && fixedDistanceSets[0].Distance == 0, fixedDistanceSets[0].CaseInsensitive) switch + { + (true, true) => FindNextStartingPositionMode.LeadingSet_LeftToRight_CaseInsensitive, + (true, false) => FindNextStartingPositionMode.LeadingSet_LeftToRight_CaseSensitive, + (false, true) => FindNextStartingPositionMode.FixedSets_LeftToRight_CaseInsensitive, + (false, false) => FindNextStartingPositionMode.FixedSets_LeftToRight_CaseSensitive, + }; + _asciiLookups = new uint[fixedDistanceSets.Count][]; + } + return; + } + } + + /// Gets the selected mode for performing the next operation + public FindNextStartingPositionMode FindMode { get; } = FindNextStartingPositionMode.NoSearch; + + /// Gets the leading anchor, if one exists (RegexPrefixAnalyzer.Bol, etc). + public int LeadingAnchor { get; } + + /// Gets the leading prefix. May be an empty string. + public string LeadingCaseSensitivePrefix { get; } = string.Empty; + + /// When in fixed distance literal mode, gets the literal and how far it is from the start of the pattern. + public (char Literal, int Distance) FixedDistanceLiteral { get; } + + /// When in fixed distance set mode, gets the set and how far it is from the start of the pattern. + /// The case-insensitivity of the 0th entry will always match the mode selected, but subsequent entries may not. + public List<(char[]? Chars, string Set, int Distance, bool CaseInsensitive)>? FixedDistanceSets { get; } + + /// Try to advance to the next starting position that might be a location for a match. + /// The text to search. + /// The position in . This is updated with the found position. + /// The index in to consider the beginning for beginning anchor purposes. + /// The index in to consider the start for start anchor purposes. + /// The index in to consider the non-inclusive end of the string. + /// true if a position to attempt a match was found; false if none was found. + public bool TryFindNextStartingPosition(ReadOnlySpan textSpan, ref int pos, int beginning, int start, int end) + { + // Return early if we know there's not enough input left to match. + if (!_rightToLeft) + { + if (pos > end - _minRequiredLength) + { + pos = end; + return false; + } + } + else + { + if (pos - _minRequiredLength < beginning) + { + pos = beginning; + return false; + } + } + + // Optimize the handling of a Beginning-Of-Line (BOL) anchor (only for left-to-right). BOL is special, in that unlike + // other anchors like Beginning, there are potentially multiple places a BOL can match. So unlike + // the other anchors, which all skip all subsequent processing if found, with BOL we just use it + // to boost our position to the next line, and then continue normally with any searches. + if (LeadingAnchor == RegexPrefixAnalyzer.Bol) + { + // If we're not currently positioned at the beginning of a line (either + // the beginning of the string or just after a line feed), find the next + // newline and position just after it. + Debug.Assert(!_rightToLeft); + if (pos > beginning && textSpan[pos - 1] != '\n') + { + int newline = textSpan.Slice(pos).IndexOf('\n'); + if (newline == -1 || newline + 1 + pos > end) + { + pos = end; + return false; + } + + pos = newline + 1 + pos; + } + } + + switch (FindMode) + { + // There's an anchor. For some, we can simply compare against the current position. + // For others, we can jump to the relevant location. + + case FindNextStartingPositionMode.LeadingAnchor_LeftToRight_Beginning: + if (pos > beginning) + { + pos = end; + return false; + } + return true; + + case FindNextStartingPositionMode.LeadingAnchor_LeftToRight_Start: + if (pos > start) + { + pos = end; + return false; + } + return true; + + case FindNextStartingPositionMode.LeadingAnchor_LeftToRight_EndZ: + if (pos < end - 1) + { + pos = end - 1; + } + return true; + + case FindNextStartingPositionMode.LeadingAnchor_LeftToRight_End: + if (pos < end) + { + pos = end; + } + return true; + + case FindNextStartingPositionMode.LeadingAnchor_RightToLeft_Beginning: + if (pos > beginning) + { + pos = beginning; + } + return true; + + case FindNextStartingPositionMode.LeadingAnchor_RightToLeft_Start: + if (pos < start) + { + pos = beginning; + return false; + } + return true; + + case FindNextStartingPositionMode.LeadingAnchor_RightToLeft_EndZ: + if (pos < end - 1 || (pos == end - 1 && textSpan[pos] != '\n')) + { + pos = beginning; + return false; + } + return true; + + case FindNextStartingPositionMode.LeadingAnchor_RightToLeft_End: + if (pos < end) + { + pos = beginning; + return false; + } + return true; + + // There's a case-sensitive prefix. Search for it with ordinal IndexOf. + + case FindNextStartingPositionMode.LeadingPrefix_LeftToRight_CaseSensitive: + { + int i = textSpan.Slice(pos, end - pos).IndexOf(LeadingCaseSensitivePrefix.AsSpan()); + if (i >= 0) + { + pos += i; + return true; + } + + pos = end; + return false; + } + + case FindNextStartingPositionMode.LeadingPrefix_RightToLeft_CaseSensitive: + { + int i = textSpan.Slice(beginning, pos - beginning).LastIndexOf(LeadingCaseSensitivePrefix.AsSpan()); + if (i >= 0) + { + pos = beginning + i + LeadingCaseSensitivePrefix.Length; + return true; + } + + pos = beginning; + return false; + } + + // There's a literal at the beginning of the pattern. Search for it. + + case FindNextStartingPositionMode.LeadingLiteral_RightToLeft_CaseSensitive: + { + int i = textSpan.Slice(beginning, pos - beginning).LastIndexOf(FixedDistanceLiteral.Literal); + if (i >= 0) + { + pos = beginning + i + 1; + return true; + } + + pos = beginning; + return false; + } + + case FindNextStartingPositionMode.LeadingLiteral_RightToLeft_CaseInsensitive: + { + char ch = FixedDistanceLiteral.Literal; + TextInfo ti = _textInfo; + + ReadOnlySpan span = textSpan.Slice(beginning, pos - beginning); + for (int i = span.Length - 1; i >= 0; i--) + { + if (ti.ToLower(span[i]) == ch) + { + pos = beginning + i + 1; + return true; + } + } + + pos = beginning; + return false; + } + + // There's a set at the beginning of the pattern. Search for it. + + case FindNextStartingPositionMode.LeadingSet_LeftToRight_CaseSensitive: + { + (char[]? chars, string set, _, _) = FixedDistanceSets![0]; + + ReadOnlySpan span = textSpan.Slice(pos, end - pos); + if (chars is not null) + { + int i = span.IndexOfAny(chars); + if (i >= 0) + { + pos += i; + return true; + } + } + else + { + ref uint[]? startingAsciiLookup = ref _asciiLookups![0]; + for (int i = 0; i < span.Length; i++) + { + if (RegexCharClass.CharInClass(span[i], set, ref startingAsciiLookup)) + { + pos += i; + return true; + } + } + } + + pos = end; + return false; + } + + case FindNextStartingPositionMode.LeadingSet_LeftToRight_CaseInsensitive: + { + ref uint[]? startingAsciiLookup = ref _asciiLookups![0]; + string set = FixedDistanceSets![0].Set; + TextInfo ti = _textInfo; + + ReadOnlySpan span = textSpan.Slice(pos, end - pos); + for (int i = 0; i < span.Length; i++) + { + if (RegexCharClass.CharInClass(ti.ToLower(span[i]), set, ref startingAsciiLookup)) + { + pos += i; + return true; + } + } + + pos = end; + return false; + } + + case FindNextStartingPositionMode.LeadingSet_RightToLeft_CaseSensitive: + { + ref uint[]? startingAsciiLookup = ref _asciiLookups![0]; + string set = FixedDistanceSets![0].Set; + + ReadOnlySpan span = textSpan.Slice(beginning, pos - beginning); + for (int i = span.Length - 1; i >= 0; i--) + { + if (RegexCharClass.CharInClass(span[i], set, ref startingAsciiLookup)) + { + pos = beginning + i + 1; + return true; + } + } + + pos = beginning; + return false; + } + + case FindNextStartingPositionMode.LeadingSet_RightToLeft_CaseInsensitive: + { + ref uint[]? startingAsciiLookup = ref _asciiLookups![0]; + string set = FixedDistanceSets![0].Set; + TextInfo ti = _textInfo; + + ReadOnlySpan span = textSpan.Slice(beginning, pos - beginning); + for (int i = span.Length - 1; i >= 0; i--) + { + if (RegexCharClass.CharInClass(ti.ToLower(span[i]), set, ref startingAsciiLookup)) + { + pos = beginning + i + 1; + return true; + } + } + + pos = beginning; + return false; + } + + // There's a literal at a fixed offset from the beginning of the pattern. Search for it. + + case FindNextStartingPositionMode.FixedLiteral_LeftToRight_CaseSensitive: + { + Debug.Assert(FixedDistanceLiteral.Distance <= _minRequiredLength); + + int i = textSpan.Slice(pos + FixedDistanceLiteral.Distance, end - pos - FixedDistanceLiteral.Distance).IndexOf(FixedDistanceLiteral.Literal); + if (i >= 0) + { + pos += i; + return true; + } + + pos = end; + return false; + } + + case FindNextStartingPositionMode.FixedLiteral_LeftToRight_CaseInsensitive: + { + Debug.Assert(FixedDistanceLiteral.Distance <= _minRequiredLength); + + char ch = FixedDistanceLiteral.Literal; + TextInfo ti = _textInfo; + + ReadOnlySpan span = textSpan.Slice(pos + FixedDistanceLiteral.Distance, end - pos - FixedDistanceLiteral.Distance); + for (int i = 0; i < span.Length; i++) + { + if (ti.ToLower(span[i]) == ch) + { + pos += i; + return true; + } + } + + pos = end; + return false; + } + + // There are one or more sets at fixed offsets from the start of the pattern. + + case FindNextStartingPositionMode.FixedSets_LeftToRight_CaseSensitive: + { + List<(char[]? Chars, string Set, int Distance, bool CaseInsensitive)> sets = FixedDistanceSets!; + (char[]? primaryChars, string primarySet, int primaryDistance, _) = sets[0]; + int endMinusRequiredLength = end - Math.Max(1, _minRequiredLength); + + if (primaryChars is not null) + { + for (int inputPosition = pos; inputPosition <= endMinusRequiredLength; inputPosition++) + { + int offset = inputPosition + primaryDistance; + int index = textSpan.Slice(offset, end - offset).IndexOfAny(primaryChars); + if (index < 0) + { + break; + } + + index += offset; // The index here will be offset indexed due to the use of span, so we add offset to get + // real position on the string. + inputPosition = index - primaryDistance; + if (inputPosition > endMinusRequiredLength) + { + break; + } + + for (int i = 1; i < sets.Count; i++) + { + (_, string nextSet, int nextDistance, bool nextCaseInsensitive) = sets[i]; + char c = textSpan[inputPosition + nextDistance]; + if (!RegexCharClass.CharInClass(nextCaseInsensitive ? _textInfo.ToLower(c) : c, nextSet, ref _asciiLookups![i])) + { + goto Bumpalong; + } + } + + pos = inputPosition; + return true; + + Bumpalong:; + } + } + else + { + ref uint[]? startingAsciiLookup = ref _asciiLookups![0]; + + for (int inputPosition = pos; inputPosition <= endMinusRequiredLength; inputPosition++) + { + char c = textSpan[inputPosition + primaryDistance]; + if (!RegexCharClass.CharInClass(c, primarySet, ref startingAsciiLookup)) + { + goto Bumpalong; + } + + for (int i = 1; i < sets.Count; i++) + { + (_, string nextSet, int nextDistance, bool nextCaseInsensitive) = sets[i]; + c = textSpan[inputPosition + nextDistance]; + if (!RegexCharClass.CharInClass(nextCaseInsensitive ? _textInfo.ToLower(c) : c, nextSet, ref _asciiLookups![i])) + { + goto Bumpalong; + } + } + + pos = inputPosition; + return true; + + Bumpalong:; + } + } + + pos = end; + return false; + } + + case FindNextStartingPositionMode.FixedSets_LeftToRight_CaseInsensitive: + { + List<(char[]? Chars, string Set, int Distance, bool CaseInsensitive)> sets = FixedDistanceSets!; + (_, string primarySet, int primaryDistance, _) = sets[0]; + + int endMinusRequiredLength = end - Math.Max(1, _minRequiredLength); + TextInfo ti = _textInfo; + ref uint[]? startingAsciiLookup = ref _asciiLookups![0]; + + for (int inputPosition = pos; inputPosition <= endMinusRequiredLength; inputPosition++) + { + char c = textSpan[inputPosition + primaryDistance]; + if (!RegexCharClass.CharInClass(ti.ToLower(c), primarySet, ref startingAsciiLookup)) + { + goto Bumpalong; + } + + for (int i = 1; i < sets.Count; i++) + { + (_, string nextSet, int nextDistance, bool nextCaseInsensitive) = sets[i]; + c = textSpan[inputPosition + nextDistance]; + if (!RegexCharClass.CharInClass(nextCaseInsensitive ? _textInfo.ToLower(c) : c, nextSet, ref _asciiLookups![i])) + { + goto Bumpalong; + } + } + + pos = inputPosition; + return true; + + Bumpalong:; + } + + pos = end; + return false; + } + + // Nothing special to look for. Just return true indicating this is a valid position to try to match. + + default: + Debug.Assert(FindMode == FindNextStartingPositionMode.NoSearch); + return true; + } + } + } + + /// Mode to use for searching for the next location of a possible match. + internal enum FindNextStartingPositionMode + { + /// A "beginning" anchor at the beginning of the pattern. + LeadingAnchor_LeftToRight_Beginning, + /// A "start" anchor at the beginning of the pattern. + LeadingAnchor_LeftToRight_Start, + /// An "endz" anchor at the beginning of the pattern. This is rare. + LeadingAnchor_LeftToRight_EndZ, + /// An "end" anchor at the beginning of the pattern. This is rare. + LeadingAnchor_LeftToRight_End, + + /// A "beginning" anchor at the beginning of the right-to-left pattern. + LeadingAnchor_RightToLeft_Beginning, + /// A "start" anchor at the beginning of the right-to-left pattern. + LeadingAnchor_RightToLeft_Start, + /// An "endz" anchor at the beginning of the right-to-left pattern. This is rare. + LeadingAnchor_RightToLeft_EndZ, + /// An "end" anchor at the beginning of the right-to-left pattern. This is rare. + LeadingAnchor_RightToLeft_End, + + /// A case-sensitive multi-character substring at the beginning of the pattern. + LeadingPrefix_LeftToRight_CaseSensitive, + /// A case-sensitive multi-character substring at the beginning of the right-to-left pattern. + LeadingPrefix_RightToLeft_CaseSensitive, + + /// A case-sensitive set starting the pattern. + LeadingSet_LeftToRight_CaseSensitive, + /// A case-insensitive set starting the pattern. + LeadingSet_LeftToRight_CaseInsensitive, + /// A case-sensitive set starting the right-to-left pattern. + LeadingSet_RightToLeft_CaseSensitive, + /// A case-insensitive set starting the right-to-left pattern. + LeadingSet_RightToLeft_CaseInsensitive, + + /// A case-sensitive single character at a fixed distance from the start of the right-to-left pattern. + LeadingLiteral_RightToLeft_CaseSensitive, + /// A case-insensitive single character at a fixed distance from the start of the right-to-left pattern. + LeadingLiteral_RightToLeft_CaseInsensitive, + + /// A case-sensitive single character at a fixed distance from the start of the pattern. + FixedLiteral_LeftToRight_CaseSensitive, + /// A case-insensitive single character at a fixed distance from the start of the pattern. + FixedLiteral_LeftToRight_CaseInsensitive, + + /// One or more sets at a fixed distance from the start of the pattern. At least the first set is case-sensitive. + FixedSets_LeftToRight_CaseSensitive, + /// One or more sets at a fixed distance from the start of the pattern. At least the first set is case-insensitive. + FixedSets_LeftToRight_CaseInsensitive, + + /// Nothing to search for. Nop. + NoSearch, + } +} diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexInterpreter.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexInterpreter.cs index c679c0101d6f24..5c28f58a168a25 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexInterpreter.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexInterpreter.cs @@ -15,7 +15,6 @@ internal sealed class RegexInterpreter : RegexRunner private readonly RegexCode _code; private readonly TextInfo _textInfo; - private readonly FindFirstCharMode _findFirstCharMode; private int _operator; private int _codepos; @@ -29,48 +28,6 @@ public RegexInterpreter(RegexCode code, CultureInfo culture) _code = code; _textInfo = culture.TextInfo; - - // Determine what searching mode FindFirstChar will employ. - if ((_code.LeadingAnchor & (RegexPrefixAnalyzer.Beginning | RegexPrefixAnalyzer.Start | RegexPrefixAnalyzer.EndZ | RegexPrefixAnalyzer.End)) != 0) - { - _findFirstCharMode = (_code.LeadingAnchor, code.RightToLeft) switch - { - (RegexPrefixAnalyzer.Beginning, false) => FindFirstCharMode.LeadingAnchor_LeftToRight_Beginning, - (RegexPrefixAnalyzer.Beginning, true) => FindFirstCharMode.LeadingAnchor_RightToLeft_Beginning, - (RegexPrefixAnalyzer.Start, false) => FindFirstCharMode.LeadingAnchor_LeftToRight_Start, - (RegexPrefixAnalyzer.Start, true) => FindFirstCharMode.LeadingAnchor_RightToLeft_Start, - (RegexPrefixAnalyzer.End, false) => FindFirstCharMode.LeadingAnchor_LeftToRight_End, - (RegexPrefixAnalyzer.End, true) => FindFirstCharMode.LeadingAnchor_RightToLeft_End, - (_, false) => FindFirstCharMode.LeadingAnchor_LeftToRight_EndZ, - (_, true) => FindFirstCharMode.LeadingAnchor_RightToLeft_EndZ, - }; - } - else if (code.BoyerMoorePrefix is RegexBoyerMoore rbm) - { - _findFirstCharMode = rbm.PatternSupportsIndexOf ? - FindFirstCharMode.IndexOf : - FindFirstCharMode.BoyerMoore; - } - else if (code.LeadingCharClasses is not null) - { - (string charClass, bool caseInsensitive) = code.LeadingCharClasses[0]; - bool isSet = !RegexCharClass.IsSingleton(charClass); - _findFirstCharMode = (code.RightToLeft, caseInsensitive, isSet) switch - { - (false, false, false) => FindFirstCharMode.LeadingCharClass_LeftToRight_CaseSensitive_Singleton, - (false, false, true) => FindFirstCharMode.LeadingCharClass_LeftToRight_CaseSensitive_Set, - (false, true, false) => FindFirstCharMode.LeadingCharClass_LeftToRight_CaseInsensitive_Singleton, - (false, true, true) => FindFirstCharMode.LeadingCharClass_LeftToRight_CaseInsensitive_Set, - (true, false, false) => FindFirstCharMode.LeadingCharClass_RightToLeft_CaseSensitive_Singleton, - (true, false, true) => FindFirstCharMode.LeadingCharClass_RightToLeft_CaseSensitive_Set, - (true, true, false) => FindFirstCharMode.LeadingCharClass_RightToLeft_CaseInsensitive_Singleton, - (true, true, true) => FindFirstCharMode.LeadingCharClass_RightToLeft_CaseInsensitive_Set, - }; - } - else - { - _findFirstCharMode = FindFirstCharMode.NoSearch; - } } protected override void InitTrackCount() => runtrackcount = _code.TrackCount; @@ -250,14 +207,14 @@ private void StackPush(int i1, int i2) private int Forwardchars() => _rightToLeft ? runtextpos - runtextbeg : runtextend - runtextpos; - private char Forwardcharnext() + private char Forwardcharnext(ReadOnlySpan runtextSpan) { - char ch = _rightToLeft ? runtext![--runtextpos] : runtext![runtextpos++]; - + int i = _rightToLeft ? --runtextpos : runtextpos++; + char ch = runtextSpan[i]; return _caseInsensitive ? _textInfo.ToLower(ch) : ch; } - private bool MatchString(string str) + private bool MatchString(string str, ReadOnlySpan runtextSpan) { int c = str.Length; int pos; @@ -285,7 +242,7 @@ private bool MatchString(string str) { while (c != 0) { - if (str[--c] != runtext![--pos]) + if (str[--c] != runtextSpan[--pos]) { return false; } @@ -296,7 +253,7 @@ private bool MatchString(string str) TextInfo ti = _textInfo; while (c != 0) { - if (str[--c] != ti.ToLower(runtext![--pos])) + if (str[--c] != ti.ToLower(runtextSpan[--pos])) { return false; } @@ -313,7 +270,7 @@ private bool MatchString(string str) return true; } - private bool MatchRef(int index, int length) + private bool MatchRef(int index, int length, ReadOnlySpan runtextSpan) { int pos; if (!_rightToLeft) @@ -342,7 +299,7 @@ private bool MatchRef(int index, int length) { while (c-- != 0) { - if (runtext![--cmpos] != runtext[--pos]) + if (runtextSpan[--cmpos] != runtextSpan[--pos]) { return false; } @@ -353,7 +310,7 @@ private bool MatchRef(int index, int length) TextInfo ti = _textInfo; while (c-- != 0) { - if (ti.ToLower(runtext![--cmpos]) != ti.ToLower(runtext[--pos])) + if (ti.ToLower(runtextSpan[--cmpos]) != ti.ToLower(runtextSpan[--pos])) { return false; } @@ -372,312 +329,15 @@ private bool MatchRef(int index, int length) private void Backwardnext() => runtextpos += _rightToLeft ? 1 : -1; - private enum FindFirstCharMode - { - LeadingAnchor_LeftToRight_Beginning, - LeadingAnchor_LeftToRight_Start, - LeadingAnchor_LeftToRight_EndZ, - LeadingAnchor_LeftToRight_End, - - LeadingAnchor_RightToLeft_Beginning, - LeadingAnchor_RightToLeft_Start, - LeadingAnchor_RightToLeft_EndZ, - LeadingAnchor_RightToLeft_End, - - IndexOf, - BoyerMoore, - - LeadingCharClass_LeftToRight_CaseSensitive_Singleton, - LeadingCharClass_LeftToRight_CaseSensitive_Set, - LeadingCharClass_LeftToRight_CaseInsensitive_Singleton, - LeadingCharClass_LeftToRight_CaseInsensitive_Set, - - LeadingCharClass_RightToLeft_CaseSensitive_Singleton, - LeadingCharClass_RightToLeft_CaseSensitive_Set, - LeadingCharClass_RightToLeft_CaseInsensitive_Singleton, - LeadingCharClass_RightToLeft_CaseInsensitive_Set, - - NoSearch, - } - - protected override bool FindFirstChar() - { - // Return early if we know there's not enough input left to match. - if (!_code.RightToLeft) - { - if (runtextpos > runtextend - _code.Tree.MinRequiredLength) - { - runtextpos = runtextend; - return false; - } - } - else - { - if (runtextpos - _code.Tree.MinRequiredLength < runtextbeg) - { - runtextpos = runtextbeg; - return false; - } - } - - // Optimize the handling of a Beginning-Of-Line (BOL) anchor. BOL is special, in that unlike - // other anchors like Beginning, there are potentially multiple places a BOL can match. So unlike - // the other anchors, which all skip all subsequent processing if found, with BOL we just use it - // to boost our position to the next line, and then continue normally with any Boyer-Moore or - // leading char class searches. - if (_code.LeadingAnchor == RegexPrefixAnalyzer.Bol && - !_code.RightToLeft) // don't bother customizing this optimization for the very niche RTL + Multiline case - { - // If we're not currently positioned at the beginning of a line (either - // the beginning of the string or just after a line feed), find the next - // newline and position just after it. - if (runtextpos > runtextbeg && runtext![runtextpos - 1] != '\n') - { - int newline = runtext.IndexOf('\n', runtextpos); - if (newline == -1 || newline + 1 > runtextend) - { - runtextpos = runtextend; - return false; - } - - runtextpos = newline + 1; - } - } - - switch (_findFirstCharMode) - { - // If the pattern is anchored, we can update our position appropriately and return immediately. - // If there's a Boyer-Moore prefix, we can also validate it. - - case FindFirstCharMode.LeadingAnchor_LeftToRight_Beginning: - if (runtextpos > runtextbeg) - { - runtextpos = runtextend; - return false; - } - return NoPrefixOrPrefixMatches(); - - case FindFirstCharMode.LeadingAnchor_LeftToRight_Start: - if (runtextpos > runtextstart) - { - runtextpos = runtextend; - return false; - } - return NoPrefixOrPrefixMatches(); - - case FindFirstCharMode.LeadingAnchor_LeftToRight_EndZ: - if (runtextpos < runtextend - 1) - { - runtextpos = runtextend - 1; - } - return NoPrefixOrPrefixMatches(); - - case FindFirstCharMode.LeadingAnchor_LeftToRight_End: - if (runtextpos < runtextend) - { - runtextpos = runtextend; - } - return NoPrefixOrPrefixMatches(); - - case FindFirstCharMode.LeadingAnchor_RightToLeft_Beginning: - if (runtextpos > runtextbeg) - { - runtextpos = runtextbeg; - } - return NoPrefixOrPrefixMatches(); - - case FindFirstCharMode.LeadingAnchor_RightToLeft_Start: - if (runtextpos < runtextstart) - { - runtextpos = runtextbeg; - return false; - } - return NoPrefixOrPrefixMatches(); - - case FindFirstCharMode.LeadingAnchor_RightToLeft_EndZ: - if (runtextpos < runtextend - 1 || (runtextpos == runtextend - 1 && runtext![runtextpos] != '\n')) - { - runtextpos = runtextbeg; - return false; - } - return NoPrefixOrPrefixMatches(); - - case FindFirstCharMode.LeadingAnchor_RightToLeft_End: - if (runtextpos < runtextend) - { - runtextpos = runtextbeg; - return false; - } - return NoPrefixOrPrefixMatches(); - - // There was a prefix. Scan for it. - - case FindFirstCharMode.IndexOf: - { - int i = runtext.AsSpan(runtextpos, runtextend - runtextpos).IndexOf(_code.BoyerMoorePrefix!.Pattern); - if (i >= 0) - { - runtextpos += i; - return true; - } - runtextpos = runtextend; - return false; - } - - case FindFirstCharMode.BoyerMoore: - runtextpos = _code.BoyerMoorePrefix!.Scan(runtext!, runtextpos, runtextbeg, runtextend); - if (runtextpos >= 0) - { - return true; - } - runtextpos = _code.RightToLeft ? runtextbeg : runtextend; - return false; - - // There's a leading character class. Search for it. - - case FindFirstCharMode.LeadingCharClass_LeftToRight_CaseSensitive_Singleton: - { - ReadOnlySpan span = runtext.AsSpan(runtextpos, runtextend - runtextpos); - int i = span.IndexOf(RegexCharClass.SingletonChar(_code.LeadingCharClasses![0].CharClass)); - if (i >= 0) - { - runtextpos += i; - return true; - } - runtextpos = runtextend; - return false; - } - - case FindFirstCharMode.LeadingCharClass_LeftToRight_CaseSensitive_Set: - { - string set = _code.LeadingCharClasses![0].CharClass; - ReadOnlySpan span = runtext.AsSpan(runtextpos, runtextend - runtextpos); - for (int i = 0; i < span.Length; i++) - { - if (RegexCharClass.CharInClass(span[i], set, ref _code.LeadingCharClassAsciiLookup)) - { - runtextpos += i; - return true; - } - } - runtextpos = runtextend; - return false; - } - - case FindFirstCharMode.LeadingCharClass_LeftToRight_CaseInsensitive_Singleton: - { - char ch = RegexCharClass.SingletonChar(_code.LeadingCharClasses![0].CharClass); - TextInfo ti = _textInfo; - ReadOnlySpan span = runtext.AsSpan(runtextpos, runtextend - runtextpos); - for (int i = 0; i < span.Length; i++) - { - if (ch == ti.ToLower(span[i])) - { - runtextpos += i; - return true; - } - } - runtextpos = runtextend; - return false; - } - - case FindFirstCharMode.LeadingCharClass_LeftToRight_CaseInsensitive_Set: - { - string set = _code.LeadingCharClasses![0].CharClass; - ReadOnlySpan span = runtext.AsSpan(runtextpos, runtextend - runtextpos); - TextInfo ti = _textInfo; - for (int i = 0; i < span.Length; i++) - { - if (RegexCharClass.CharInClass(ti.ToLower(span[i]), set, ref _code.LeadingCharClassAsciiLookup)) - { - runtextpos += i; - return true; - } - } - runtextpos = runtextend; - return false; - } - - case FindFirstCharMode.LeadingCharClass_RightToLeft_CaseSensitive_Singleton: - { - ReadOnlySpan span = runtext.AsSpan(runtextbeg, runtextpos - runtextbeg); - int i = span.LastIndexOf(RegexCharClass.SingletonChar(_code.LeadingCharClasses![0].CharClass)); - if (i >= 0) - { - runtextpos = runtextbeg + i + 1; - return true; - } - runtextpos = runtextbeg; - return false; - } - - case FindFirstCharMode.LeadingCharClass_RightToLeft_CaseSensitive_Set: - { - string set = _code.LeadingCharClasses![0].CharClass; - ReadOnlySpan span = runtext.AsSpan(runtextbeg, runtextpos - runtextbeg); - for (int i = span.Length - 1; i >= 0; i--) - { - if (RegexCharClass.CharInClass(span[i], set, ref _code.LeadingCharClassAsciiLookup)) - { - runtextpos = runtextbeg + i + 1; - return true; - } - } - runtextpos = runtextbeg; - return false; - } - - case FindFirstCharMode.LeadingCharClass_RightToLeft_CaseInsensitive_Singleton: - { - char ch = RegexCharClass.SingletonChar(_code.LeadingCharClasses![0].CharClass); - TextInfo ti = _textInfo; - ReadOnlySpan span = runtext.AsSpan(runtextbeg, runtextpos - runtextbeg); - for (int i = span.Length - 1; i >= 0; i--) - { - if (ch == ti.ToLower(span[i])) - { - runtextpos = runtextbeg + i + 1; - return true; - } - } - runtextpos = runtextbeg; - return false; - } - - case FindFirstCharMode.LeadingCharClass_RightToLeft_CaseInsensitive_Set: - { - string set = _code.LeadingCharClasses![0].CharClass; - ReadOnlySpan span = runtext.AsSpan(runtextbeg, runtextpos - runtextbeg); - TextInfo ti = _textInfo; - for (int i = span.Length - 1; i >= 0; i--) - { - if (RegexCharClass.CharInClass(ti.ToLower(span[i]), set, ref _code.LeadingCharClassAsciiLookup)) - { - runtextpos = runtextbeg + i + 1; - return true; - } - } - runtextpos = runtextbeg; - return false; - } - - // Nothing special to look for. Just return true indicating this is a valid position to try to match. - - default: - Debug.Assert(_findFirstCharMode == FindFirstCharMode.NoSearch); - return true; - } - - bool NoPrefixOrPrefixMatches() => - _code.BoyerMoorePrefix is not RegexBoyerMoore rbm || - rbm.IsMatch(runtext!, runtextpos, runtextbeg, runtextend); - } + protected override bool FindFirstChar() => + _code.FindOptimizations.TryFindNextStartingPosition(runtext!, ref runtextpos, runtextbeg, runtextstart, runtextend); protected override void Go() { SetOperator(_code.Codes[0]); _codepos = 0; int advance = -1; + ReadOnlySpan runtextSpan = runtext; while (true) { @@ -1040,7 +700,7 @@ protected override void Go() break; case RegexCode.Bol: - if (Leftchars() > 0 && runtext![runtextpos - 1] != '\n') + if (Leftchars() > 0 && runtextSpan[runtextpos - 1] != '\n') { break; } @@ -1048,7 +708,7 @@ protected override void Go() continue; case RegexCode.Eol: - if (Rightchars() > 0 && runtext![runtextpos] != '\n') + if (Rightchars() > 0 && runtextSpan[runtextpos] != '\n') { break; } @@ -1104,7 +764,7 @@ protected override void Go() continue; case RegexCode.EndZ: - if (Rightchars() > 1 || Rightchars() == 1 && runtext![runtextpos] != '\n') + if (Rightchars() > 1 || Rightchars() == 1 && runtextSpan[runtextpos] != '\n') { break; } @@ -1120,7 +780,7 @@ protected override void Go() continue; case RegexCode.One: - if (Forwardchars() < 1 || Forwardcharnext() != (char)Operand(0)) + if (Forwardchars() < 1 || Forwardcharnext(runtextSpan) != (char)Operand(0)) { break; } @@ -1128,7 +788,7 @@ protected override void Go() continue; case RegexCode.Notone: - if (Forwardchars() < 1 || Forwardcharnext() == (char)Operand(0)) + if (Forwardchars() < 1 || Forwardcharnext(runtextSpan) == (char)Operand(0)) { break; } @@ -1143,7 +803,7 @@ protected override void Go() else { int operand = Operand(0); - if (!RegexCharClass.CharInClass(Forwardcharnext(), _code.Strings[operand], ref _code.StringsAsciiLookup[operand])) + if (!RegexCharClass.CharInClass(Forwardcharnext(runtextSpan), _code.Strings[operand], ref _code.StringsAsciiLookup[operand])) { break; } @@ -1152,7 +812,7 @@ protected override void Go() continue; case RegexCode.Multi: - if (!MatchString(_code.Strings[Operand(0)])) + if (!MatchString(_code.Strings[Operand(0)], runtextSpan)) { break; } @@ -1164,7 +824,7 @@ protected override void Go() int capnum = Operand(0); if (IsMatched(capnum)) { - if (!MatchRef(MatchIndex(capnum), MatchLength(capnum))) + if (!MatchRef(MatchIndex(capnum), MatchLength(capnum), runtextSpan)) { break; } @@ -1191,7 +851,7 @@ protected override void Go() char ch = (char)Operand(0); while (c-- > 0) { - if (Forwardcharnext() != ch) + if (Forwardcharnext(runtextSpan) != ch) { goto BreakBackward; } @@ -1211,7 +871,7 @@ protected override void Go() char ch = (char)Operand(0); while (c-- > 0) { - if (Forwardcharnext() == ch) + if (Forwardcharnext(runtextSpan) == ch) { goto BreakBackward; } @@ -1230,7 +890,7 @@ protected override void Go() int operand0 = Operand(0); string set = _code.Strings[operand0]; - ref int[]? setLookup = ref _code.StringsAsciiLookup[operand0]; + ref uint[]? setLookup = ref _code.StringsAsciiLookup[operand0]; while (c-- > 0) { @@ -1240,7 +900,7 @@ protected override void Go() CheckTimeout(); } - if (!RegexCharClass.CharInClass(Forwardcharnext(), set, ref setLookup)) + if (!RegexCharClass.CharInClass(Forwardcharnext(runtextSpan), set, ref setLookup)) { goto BreakBackward; } @@ -1258,7 +918,7 @@ protected override void Go() for (i = len; i > 0; i--) { - if (Forwardcharnext() != ch) + if (Forwardcharnext(runtextSpan) != ch) { Backwardnext(); break; @@ -1284,7 +944,7 @@ protected override void Go() { // We're left-to-right and case-sensitive, so we can employ the vectorized IndexOf // to search for the character. - i = runtext!.AsSpan(runtextpos, len).IndexOf(ch); + i = runtextSpan.Slice(runtextpos, len).IndexOf(ch); if (i == -1) { runtextpos += len; @@ -1300,7 +960,7 @@ protected override void Go() { for (i = len; i > 0; i--) { - if (Forwardcharnext() == ch) + if (Forwardcharnext(runtextSpan) == ch) { Backwardnext(); break; @@ -1322,7 +982,7 @@ protected override void Go() int len = Math.Min(Operand(1), Forwardchars()); int operand0 = Operand(0); string set = _code.Strings[operand0]; - ref int[]? setLookup = ref _code.StringsAsciiLookup[operand0]; + ref uint[]? setLookup = ref _code.StringsAsciiLookup[operand0]; int i; for (i = len; i > 0; i--) @@ -1333,7 +993,7 @@ protected override void Go() CheckTimeout(); } - if (!RegexCharClass.CharInClass(Forwardcharnext(), set, ref setLookup)) + if (!RegexCharClass.CharInClass(Forwardcharnext(runtextSpan), set, ref setLookup)) { Backwardnext(); break; @@ -1383,7 +1043,7 @@ protected override void Go() int pos = TrackPeek(1); runtextpos = pos; - if (Forwardcharnext() != (char)Operand(0)) + if (Forwardcharnext(runtextSpan) != (char)Operand(0)) { break; } @@ -1403,7 +1063,7 @@ protected override void Go() int pos = TrackPeek(1); runtextpos = pos; - if (Forwardcharnext() == (char)Operand(0)) + if (Forwardcharnext(runtextSpan) == (char)Operand(0)) { break; } @@ -1424,7 +1084,7 @@ protected override void Go() runtextpos = pos; int operand0 = Operand(0); - if (!RegexCharClass.CharInClass(Forwardcharnext(), _code.Strings[operand0], ref _code.StringsAsciiLookup[operand0])) + if (!RegexCharClass.CharInClass(Forwardcharnext(runtextSpan), _code.Strings[operand0], ref _code.StringsAsciiLookup[operand0])) { break; } diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexLWCGCompiler.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexLWCGCompiler.cs index 8ed30bbcb266bc..53b78c5d324796 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexLWCGCompiler.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexLWCGCompiler.cs @@ -39,9 +39,6 @@ public RegexRunnerFactory FactoryInstanceFromCode(string pattern, RegexCode code _code = code; _codes = code.Codes; _strings = code.Strings; - _leadingCharClasses = code.LeadingCharClasses; - _boyerMoorePrefix = code.BoyerMoorePrefix; - _leadingAnchor = code.LeadingAnchor; _trackcount = code.TrackCount; _options = options; _hasTimeout = hasTimeout; diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexNode.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexNode.cs index c23bb50720a05c..d936322c024384 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexNode.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexNode.cs @@ -41,6 +41,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; +using System.Globalization; using System.Threading; namespace System.Text.RegularExpressions @@ -151,11 +152,49 @@ public RegexNode(int type, RegexOptions options, int m, int n) N = n; } - public bool UseOptionR() => (Options & RegexOptions.RightToLeft) != 0; + /// Creates a RegexNode representing a single character. + /// The character. + /// The node's options. + /// The culture to use to perform any required transformations. + /// The created RegexNode. This might be a RegexNode.One or a RegexNode.Set. + public static RegexNode CreateOneWithCaseConversion(char ch, RegexOptions options, CultureInfo? culture) + { + // If the options specify case-insensitivity, we try to create a node that fully encapsulates that. + if ((options & RegexOptions.IgnoreCase) != 0) + { + Debug.Assert(culture is not null); + + // If the character is part of a Unicode category that doesn't participate in case conversion, + // we can simply strip out the IgnoreCase option and make the node case-sensitive. + if (!RegexCharClass.ParticipatesInCaseConversion(ch)) + { + return new RegexNode(One, options & ~RegexOptions.IgnoreCase, ch); + } + + // Create a set for the character, trying to include all case-insensitive equivalent characters. + // If it's successful in doing so, resultIsCaseInsensitive will be false and we can strip + // out RegexOptions.IgnoreCase as part of creating the set. + string stringSet = RegexCharClass.OneToStringClass(ch, culture, out bool resultIsCaseInsensitive); + if (!resultIsCaseInsensitive) + { + return new RegexNode(Set, options & ~RegexOptions.IgnoreCase, stringSet); + } + + // Otherwise, until we can get rid of ToLower usage at match time entirely (https://github.com/dotnet/runtime/issues/61048), + // lowercase the character and proceed to create an IgnoreCase One node. + ch = culture.TextInfo.ToLower(ch); + } - public RegexNode ReverseLeft() + // Create a One node for the character. + return new RegexNode(One, options, ch); + } + + /// Reverses all children of a concatenation when in RightToLeft mode. + public RegexNode ReverseConcatenationIfRightToLeft() { - if (UseOptionR() && Type == Concatenate && ChildCount() > 1) + if ((Options & RegexOptions.RightToLeft) != 0 && + Type == Concatenate && + ChildCount() > 1) { ((List)Children!).Reverse(); } @@ -177,17 +216,21 @@ private void MakeLoopAtomic() { switch (Type) { - case Oneloop: - Type = Oneloopatomic; + case Oneloop or Notoneloop or Setloop: + // For loops, we simply change the Type to the atomic variant. + // Atomic greedy loops should consume as many values as they can. + Type += Oneloopatomic - Oneloop; break; - case Notoneloop: - Type = Notoneloopatomic; + + case Onelazy or Notonelazy or Setlazy: + // For lazy, we not only change the Type, we also lower the max number of iterations + // to the minimum number of iterations, as they should end up matching as little as possible. + Type += Oneloopatomic - Onelazy; + N = M; break; + default: -#if DEBUG - Debug.Assert(Type == Setloop, $"Unexpected type: {TypeName}"); -#endif - Type = Setloopatomic; + Debug.Fail($"Unexpected type: {Type}"); break; } } @@ -197,19 +240,34 @@ private void MakeLoopAtomic() [Conditional("DEBUG")] private void ValidateFinalTreeInvariants() { + Debug.Assert(Type == Capture, "Every generated tree should begin with a capture node"); + var toExamine = new Stack(); toExamine.Push(this); while (toExamine.Count > 0) { RegexNode node = toExamine.Pop(); + // Add all children to be examined + int childCount = node.ChildCount(); + for (int i = 0; i < childCount; i++) + { + RegexNode child = node.Child(i); + Debug.Assert(child.Next == node, $"{child.Description()} missing reference to parent {node.Description()}"); + + toExamine.Push(child); + } + // Validate that we never see certain node types. Debug.Assert(Type != Group, "All Group nodes should have been removed."); - // Validate expected child counts. - int childCount = node.ChildCount(); + // Validate node types and expected child counts. switch (node.Type) { + case Group: + Debug.Fail("All Group nodes should have been removed."); + break; + case Beginning: case Bol: case Boundary: @@ -247,25 +305,23 @@ private void ValidateFinalTreeInvariants() case Prevent: case Require: Debug.Assert(childCount == 1, $"Expected one and only one child for {node.TypeName}, got {childCount}."); - toExamine.Push(node.Child(0)); break; case Testref: + Debug.Assert(childCount is 1 or 2, $"Expected one or two children for {node.TypeName}, got {childCount}"); + break; + case Testgroup: - Debug.Assert(childCount >= 1, $"Expected at least one child for {node.TypeName}, got {childCount}."); - for (int i = 0; i < childCount; i++) - { - toExamine.Push(node.Child(i)); - } + Debug.Assert(childCount is 2 or 3, $"Expected two or three children for {node.TypeName}, got {childCount}"); break; case Concatenate: case Alternate: Debug.Assert(childCount >= 2, $"Expected at least two children for {node.TypeName}, got {childCount}."); - for (int i = 0; i < childCount; i++) - { - toExamine.Push(node.Child(i)); - } + break; + + default: + Debug.Fail($"Unexpected node type: {node.Type}"); break; } @@ -273,6 +329,10 @@ private void ValidateFinalTreeInvariants() switch (node.Type) { case Multi: + Debug.Assert(node.Str is not null, "Expect non-null multi string"); + Debug.Assert(node.Str.Length >= 2, $"Expected {node.Str} to be at least two characters"); + break; + case Set: case Setloop: case Setloopatomic: @@ -352,14 +412,6 @@ internal RegexNode FinalOptimize() } } - // Optimization: Unnecessary root atomic. - // If the root node under the implicit Capture is an Atomic, the Atomic is useless as there's nothing - // to backtrack into it, so we can remove it. - while (rootNode.Child(0).Type == Atomic) - { - rootNode.ReplaceChild(0, rootNode.Child(0).Child(0)); - } - // Done optimizing. Return the final tree. #if DEBUG rootNode.ValidateFinalTreeInvariants(); @@ -394,11 +446,15 @@ private void EliminateEndingBacktracking() { switch (node.Type) { - // {One/Notone/Set}loops can be upgraded to {One/Notone/Set}loopatomic nodes, - // e.g. [abc]* => (?>[abc]*) + // {One/Notone/Set}loops can be upgraded to {One/Notone/Set}loopatomic nodes, e.g. [abc]* => (?>[abc]*). + // And {One/Notone/Set}lazys can similarly be upgraded to be atomic, which really makes them into repeaters + // or even empty nodes. case Oneloop: case Notoneloop: case Setloop: + case Onelazy: + case Notonelazy: + case Setlazy: node.MakeLoopAtomic(); break; @@ -591,11 +647,14 @@ private RegexNode ReduceAtomic() case Setloopatomic: return child; - // If an atomic subexpression contains only a {one/notone/set}loop, + // If an atomic subexpression contains only a {one/notone/set}{loop/lazy}, // change it to be an {one/notone/set}loopatomic and remove the atomic node. case Oneloop: case Notoneloop: case Setloop: + case Onelazy: + case Notonelazy: + case Setlazy: child.MakeLoopAtomic(); return child; @@ -881,8 +940,10 @@ private RegexNode ReduceAlternation() default: ReduceSingleLetterAndNestedAlternations(); - RegexNode newThis = ReplaceNodeIfUnnecessary(Nothing); - return newThis != this ? newThis : ExtractCommonPrefixes(); + RegexNode node = ReplaceNodeIfUnnecessary(Nothing); + node = ExtractCommonPrefixText(node); + node = ExtractCommonPrefixOneNotoneSet(node); + return node; } // This function performs two optimizations: @@ -952,7 +1013,6 @@ void ReduceSingleLetterAndNestedAlternations() break; } - // The last node was a Set or a One, we're a Set or One and our options are the same. // Merge the two nodes. j--; @@ -981,6 +1041,12 @@ void ReduceSingleLetterAndNestedAlternations() prev.Type = Set; prev.Str = prevCharClass.ToStringClass(Options); + if ((prev.Options & RegexOptions.IgnoreCase) != 0 && + RegexCharClass.MakeCaseSensitiveIfPossible(prev.Str, RegexParser.GetTargetCulture(prev.Options)) is string newSetString) + { + prev.Str = newSetString; + prev.Options &= ~RegexOptions.IgnoreCase; + } } else if (at.Type == Nothing) { @@ -1001,6 +1067,106 @@ void ReduceSingleLetterAndNestedAlternations() } } + // This function optimizes out prefix nodes from alternation branches that are + // the same across multiple contiguous branches. + // e.g. \w12|\d34|\d56|\w78|\w90 => \w12|\d(?:34|56)|\w(?:78|90) + static RegexNode ExtractCommonPrefixOneNotoneSet(RegexNode alternation) + { + if (alternation.Type != Alternate) + { + return alternation; + } + + Debug.Assert(alternation.Children is List { Count: >= 2 }); + var children = (List)alternation.Children; + + // Only process left-to-right prefixes. + if ((alternation.Options & RegexOptions.RightToLeft) != 0) + { + return alternation; + } + + // Only handle the case where each branch is a concatenation + foreach (RegexNode child in children) + { + if (child.Type != Concatenate || child.ChildCount() < 2) + { + return alternation; + } + } + + for (int startingIndex = 0; startingIndex < children.Count - 1; startingIndex++) + { + Debug.Assert(children[startingIndex].Children is List { Count: >= 2 }); + + // Only handle the case where each branch begins with the same One, Notone, or Set (individual or loop). + // Note that while we can do this for individual characters, fixed length loops, and atomic loops, doing + // it for non-atomic variable length loops could change behavior as each branch could otherwise have a + // different number of characters consumed by the loop based on what's after it. + RegexNode required = children[startingIndex].Child(0); + switch (required.Type) + { + case One or Notone or Set: + case Oneloopatomic or Notoneloopatomic or Setloopatomic: + case Oneloop or Notoneloop or Setloop or Onelazy or Notonelazy or Setlazy when required.M == required.N: + break; + + default: + continue; + } + + // Only handle the case where each branch begins with the exact same node value + int endingIndex = startingIndex + 1; + for (; endingIndex < children.Count; endingIndex++) + { + RegexNode other = children[endingIndex].Child(0); + if (required.Type != other.Type || + required.Options != other.Options || + required.M != other.M || + required.N != other.N || + required.Ch != other.Ch || + required.Str != other.Str) + { + break; + } + } + + if (endingIndex - startingIndex <= 1) + { + // Nothing to extract from this starting index. + continue; + } + + // Remove the prefix node from every branch, adding it to a new alternation + var newAlternate = new RegexNode(Alternate, alternation.Options); + for (int i = startingIndex; i < endingIndex; i++) + { + ((List)children[i].Children!).RemoveAt(0); + newAlternate.AddChild(children[i]); + } + + // If this alternation is wrapped as atomic, we need to do the same for the new alternation. + if (alternation.Next is RegexNode parent && parent.Type == Atomic) + { + var atomic = new RegexNode(Atomic, alternation.Options); + atomic.AddChild(newAlternate); + newAlternate = atomic; + } + + // Now create a concatenation of the prefix node with the new alternation for the combined + // branches, and replace all of the branches in this alternation with that new concatenation. + var newConcat = new RegexNode(Concatenate, alternation.Options); + newConcat.AddChild(required); + newConcat.AddChild(newAlternate); + alternation.ReplaceChild(startingIndex, newConcat); + children.RemoveRange(startingIndex + 1, endingIndex - startingIndex - 1); + } + + // If we've reduced this alternation to just a single branch, return it. + // Otherwise, return the alternation. + return alternation.ChildCount() == 1 ? alternation.Child(0) : alternation; + } + // Analyzes all the branches of the alternation for text that's identical at the beginning // of every branch. That text is then pulled out into its own one or multi node in a // concatenation with the alternation (whose branches are updated to remove that prefix). @@ -1010,22 +1176,25 @@ void ReduceSingleLetterAndNestedAlternations() // by sets that can be merged. Third, it reduces the amount of duplicated comparisons required // if we end up backtracking into subsequent branches. // e.g. abc|ade => a(?bc|de) - RegexNode ExtractCommonPrefixes() + static RegexNode ExtractCommonPrefixText(RegexNode alternation) { + if (alternation.Type != Alternate) + { + return alternation; + } + + Debug.Assert(alternation.Children is List { Count: >= 2 }); + var children = (List)alternation.Children; + // To keep things relatively simple, we currently only handle: // - Left to right (e.g. we don't process alternations in lookbehinds) // - Branches that are one or multi nodes, or that are concatenations beginning with one or multi nodes. // - All branches having the same options. - // - Text, rather than also trying to combine identical sets that start each branch. - - Debug.Assert(Children is List); - var children = (List)Children; - Debug.Assert(children.Count >= 2); // Only extract left-to-right prefixes. - if ((Options & RegexOptions.RightToLeft) != 0) + if ((alternation.Options & RegexOptions.RightToLeft) != 0) { - return this; + return alternation; } Span scratchChar = stackalloc char[1]; @@ -1036,7 +1205,7 @@ RegexNode ExtractCommonPrefixes() RegexNode? startingNode = children[startingIndex].FindBranchOneOrMultiStart(); if (startingNode is null) { - return this; + return alternation; } RegexOptions startingNodeOptions = startingNode.Options; @@ -1159,7 +1328,7 @@ static void ProcessOneOrMulti(RegexNode node, ReadOnlySpan startingSpan) } } - if (Next is RegexNode parent && parent.Type == Atomic) + if (alternation.Next is RegexNode parent && parent.Type == Atomic) { var atomic = new RegexNode(Atomic, startingNodeOptions); atomic.AddChild(newAlternate); @@ -1169,11 +1338,11 @@ static void ProcessOneOrMulti(RegexNode node, ReadOnlySpan startingSpan) var newConcat = new RegexNode(Concatenate, startingNodeOptions); newConcat.AddChild(prefix); newConcat.AddChild(newAlternate); - ReplaceChild(startingIndex, newConcat); + alternation.ReplaceChild(startingIndex, newConcat); children.RemoveRange(startingIndex + 1, endingIndex - startingIndex - 1); } - return ChildCount() == 1 ? Child(0) : this; + return alternation.ChildCount() == 1 ? alternation.Child(0) : alternation; } } @@ -2065,58 +2234,45 @@ internal bool SupportsSimplifiedCodeGenerationImplementation() case Empty: case Nothing: case UpdateBumpalong: + // Backreferences are supported + case Ref: supported = true; break; - // Single character greedy loops are supported if they're either they're actually a repeater + // Conditional backreference tests are also supported, so long as both their yes/no branches are supported. + case Testref: + supported = + Child(0).SupportsSimplifiedCodeGenerationImplementation() && + (childCount == 1 || Child(1).SupportsSimplifiedCodeGenerationImplementation()); + break; + + // Single character greedy/lazy loops are supported if either they're actually a repeater // or they're not contained in any construct other than simple nesting (e.g. concat, capture). case Oneloop: case Notoneloop: case Setloop: - Debug.Assert(Next == null || Next.Type != Atomic, "Loop should have been transformed into an atomic type."); - supported = M == N || AncestorsAllowBacktracking(Next); - static bool AncestorsAllowBacktracking(RegexNode? node) - { - while (node is not null) - { - switch (node.Type) - { - case Concatenate: - case Capture: - case Atomic: - node = node.Next; - break; - - default: - return false; - } - } - - return true; - } - break; - case Onelazy: case Notonelazy: case Setlazy: - supported = M == N || (Next != null && Next.Type == Atomic); + Debug.Assert(Next == null || Next.Type != Atomic, "Loop should have been transformed into an atomic type."); + supported = M == N || AncestorsAllowBacktracking(Next); break; - // {Lazy}Loop repeaters are the same, except their child also needs to be supported. - // We also support such loops being atomic. + // For greedy and lazy loops, they're supported if the node they wrap is supported + // and either the node is actually a repeater, is atomic, or is in the tree in a + // location where backtracking is allowed. case Loop: case Lazyloop: supported = - (M == N || (Next != null && Next.Type == Atomic)) && + (M == N || (Next != null && Next.Type == Atomic) || AncestorsAllowBacktracking(Next)) && Child(0).SupportsSimplifiedCodeGenerationImplementation(); break; - // We can handle atomic as long as we can handle making its child atomic, or - // its child doesn't have that concept. - case Atomic: + // We can handle atomic as long as its child is supported. // Lookahead assertions also only require that the child node be supported. // The RightToLeft check earlier is important to differentiate lookbehind, // which is not supported. + case Atomic: case Require: case Prevent: supported = Child(0).SupportsSimplifiedCodeGenerationImplementation(); @@ -2148,11 +2304,10 @@ static bool AncestorsAllowBacktracking(RegexNode? node) break; case Capture: - // Currently we only support capnums without uncapnums (for balancing groups) - supported = N == -1; + supported = Child(0).SupportsSimplifiedCodeGenerationImplementation(); if (supported) { - // And we only support them in certain places in the tree. + // Captures are currently only supported in certain places in the tree. RegexNode? parent = Next; while (parent != null) { @@ -2173,25 +2328,31 @@ static bool AncestorsAllowBacktracking(RegexNode? node) } } + // If we've found a supported capture, mark all of the nodes in its parent + // hierarchy as containing a capture. if (supported) { - // And we only support them if their children are supported. - supported = Child(0).SupportsSimplifiedCodeGenerationImplementation(); - - // If we've found a supported capture, mark all of the nodes in its parent - // hierarchy as containing a capture. - if (supported) + parent = this; + while (parent != null && ((parent.Options & HasCapturesFlag) == 0)) { - parent = this; - while (parent != null && ((parent.Options & HasCapturesFlag) == 0)) - { - parent.Options |= HasCapturesFlag; - parent = parent.Next; - } + parent.Options |= HasCapturesFlag; + parent = parent.Next; } } } break; + + case Testgroup: + supported = + Child(0).SupportsSimplifiedCodeGenerationImplementation() && + Child(1).SupportsSimplifiedCodeGenerationImplementation() && + (childCount == 2 || Child(2).SupportsSimplifiedCodeGenerationImplementation()); + break; + + default: + Debug.Fail($"Unknown type: {Type}"); + supported = false; + break; } } #if DEBUG @@ -2201,6 +2362,26 @@ static bool AncestorsAllowBacktracking(RegexNode? node) } #endif return supported; + + static bool AncestorsAllowBacktracking(RegexNode? node) + { + while (node is not null) + { + switch (node.Type) + { + case Concatenate: + case Capture: + case Atomic: + node = node.Next; + break; + + default: + return false; + } + } + + return true; + } } /// Gets whether the node is a Set/Setloop/Setloopatomic/Setlazy node. diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexParser.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexParser.cs index 1f4a05afa47c12..e327952a2560ec 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexParser.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexParser.cs @@ -81,6 +81,10 @@ private RegexParser(string pattern, RegexOptions options, CultureInfo culture, S { } + /// Gets the culture to use based on the specified options. + internal static CultureInfo GetTargetCulture(RegexOptions options) => + (options & RegexOptions.CultureInvariant) != 0 ? CultureInfo.InvariantCulture : CultureInfo.CurrentCulture; + public static RegexTree Parse(string pattern, RegexOptions options, CultureInfo culture) { var parser = new RegexParser(pattern, options, culture, stackalloc int[OptionStackDefaultSize]); @@ -319,7 +323,12 @@ private RegexNode ScanRegex() goto ContinueOuterScan; case '[': - AddUnitSet(ScanCharClass(UseOptionI(), scanOnly: false)!.ToStringClass(_options)); + { + string setString = ScanCharClass(UseOptionI(), scanOnly: false)!.ToStringClass(_options); + _unit = UseOptionI() && RegexCharClass.MakeCaseSensitiveIfPossible(setString, _culture) is string newSetString ? + new RegexNode(RegexNode.Set, _options & ~RegexOptions.IgnoreCase, newSetString) : + new RegexNode(RegexNode.Set, _options, setString); + } break; case '(': @@ -378,14 +387,9 @@ private RegexNode ScanRegex() break; case '.': - if (UseOptionS()) - { - AddUnitSet(RegexCharClass.AnyClass); - } - else - { - AddUnitNotone('\n'); - } + _unit = UseOptionS() ? + new RegexNode(RegexNode.Set, _options & ~RegexOptions.IgnoreCase, RegexCharClass.AnyClass) : + new RegexNode(RegexNode.Notone, _options & ~RegexOptions.IgnoreCase, '\n'); break; case '{': @@ -734,21 +738,17 @@ node.M is not (0 or RegexReplacement.LeftPortion or RegexReplacement.RightPortio { // we aren't in a range, and now there is a subtraction. Usually this happens // only when a subtraction follows a range, like [a-z-[b]] + MoveRight(); + RegexCharClass? rcc = ScanCharClass(caseInsensitive, scanOnly); if (!scanOnly) { - MoveRight(1); - charClass!.AddSubtraction(ScanCharClass(caseInsensitive, scanOnly)!); + charClass!.AddSubtraction(rcc!); if (CharsRight() > 0 && RightChar() != ']') { throw MakeException(RegexParseError.ExclusionGroupNotLast, SR.ExclusionGroupNotLast); } } - else - { - MoveRight(1); - ScanCharClass(caseInsensitive, scanOnly); - } } else { @@ -1173,32 +1173,32 @@ private void ScanBlank() case 'w': MoveRight(); return scanOnly ? null : - new RegexNode(RegexNode.Set, _options, UseOptionE() ? RegexCharClass.ECMAWordClass : RegexCharClass.WordClass); + new RegexNode(RegexNode.Set, RemoveIgnoreCaseIfNotEcma(_options), UseOptionE() ? RegexCharClass.ECMAWordClass : RegexCharClass.WordClass); case 'W': MoveRight(); return scanOnly ? null : - new RegexNode(RegexNode.Set, _options, UseOptionE() ? RegexCharClass.NotECMAWordClass : RegexCharClass.NotWordClass); + new RegexNode(RegexNode.Set, RemoveIgnoreCaseIfNotEcma(_options), UseOptionE() ? RegexCharClass.NotECMAWordClass : RegexCharClass.NotWordClass); case 's': MoveRight(); return scanOnly ? null : - new RegexNode(RegexNode.Set, _options, UseOptionE() ? RegexCharClass.ECMASpaceClass : RegexCharClass.SpaceClass); + new RegexNode(RegexNode.Set, RemoveIgnoreCaseIfNotEcma(_options), UseOptionE() ? RegexCharClass.ECMASpaceClass : RegexCharClass.SpaceClass); case 'S': MoveRight(); return scanOnly ? null : - new RegexNode(RegexNode.Set, _options, UseOptionE() ? RegexCharClass.NotECMASpaceClass : RegexCharClass.NotSpaceClass); + new RegexNode(RegexNode.Set, RemoveIgnoreCaseIfNotEcma(_options), UseOptionE() ? RegexCharClass.NotECMASpaceClass : RegexCharClass.NotSpaceClass); case 'd': MoveRight(); return scanOnly ? null : - new RegexNode(RegexNode.Set, _options, UseOptionE() ? RegexCharClass.ECMADigitClass : RegexCharClass.DigitClass); + new RegexNode(RegexNode.Set, RemoveIgnoreCaseIfNotEcma(_options), UseOptionE() ? RegexCharClass.ECMADigitClass : RegexCharClass.DigitClass); case 'D': MoveRight(); return scanOnly ? null : - new RegexNode(RegexNode.Set, _options, UseOptionE() ? RegexCharClass.NotECMADigitClass : RegexCharClass.NotDigitClass); + new RegexNode(RegexNode.Set, RemoveIgnoreCaseIfNotEcma(_options), UseOptionE() ? RegexCharClass.NotECMADigitClass : RegexCharClass.NotDigitClass); case 'p': case 'P': @@ -1220,6 +1220,22 @@ private void ScanBlank() default: return ScanBasicBackslash(scanOnly); } + + static RegexOptions RemoveIgnoreCaseIfNotEcma(RegexOptions options) + { + // This function is used for \w, \W, \d, \D, \s, and \S to remove IgnoreCase, + // since they already include the notion of casing in their definitions. + // However, for compatibility, if ECMAScript is specified, we avoid stripping + // out the IgnoreCase. We should revisit this as part of https://github.com/dotnet/runtime/issues/61048, + // as it seems wrong that specifying ECMAScript (which implies non-Unicode) would + // then still involve lowercasing potentially Unicode character inputs to match + // against these sets. + if ((options & RegexOptions.ECMAScript) == 0) + { + options &= ~RegexOptions.IgnoreCase; + } + return options; + } } /// Scans \-style backreferences and character escapes @@ -1354,12 +1370,9 @@ private void ScanBlank() Textto(backpos); ch = ScanCharEscape(); - if (UseOptionI()) - { - ch = _culture.TextInfo.ToLower(ch); - } - - return scanOnly ? null : new RegexNode(RegexNode.One, _options, ch); + return !scanOnly ? + RegexNode.CreateOneWithCaseConversion(ch, _options, _culture) : + null; } /* @@ -1369,7 +1382,7 @@ private RegexNode ScanDollar() { if (CharsRight() == 0) { - return new RegexNode(RegexNode.One, _options, '$'); + return RegexNode.CreateOneWithCaseConversion('$', _options, _culture); } char ch = RightChar(); @@ -1469,7 +1482,7 @@ private RegexNode ScanDollar() { case '$': MoveRight(); - return new RegexNode(RegexNode.One, _options, '$'); + return RegexNode.CreateOneWithCaseConversion('$', _options, _culture); case '&': capnum = 0; @@ -1502,7 +1515,7 @@ private RegexNode ScanDollar() // unrecognized $: literalize Textto(backpos); - return new RegexNode(RegexNode.One, _options, '$'); + return RegexNode.CreateOneWithCaseConversion('$', _options, _culture); } /// Throws on unsupported capture references for NonBacktracking in replacement patterns. @@ -2058,6 +2071,17 @@ private bool IsCaptureSlot(int i) return i >= 0 && i < _capsize; } + /// + /// When generating code on a regex that uses a sparse set + /// of capture slots, we hash them to a dense set of indices + /// for an array of capture slots. Instead of doing the hash + /// at match time, it's done at compile time, here. + /// + internal static int MapCaptureNumber(int capnum, Hashtable? caps) => + capnum == -1 ? -1 : + caps != null ? (int)caps[capnum]! : + capnum; + /// Looks up the slot number for a given name private bool IsCaptureName(string capname) => _capnames != null && _capnames.ContainsKey(capname); @@ -2149,50 +2173,26 @@ private bool IsTrueQuantifier() /// Add a string to the last concatenate. private void AddConcatenate(int pos, int cch, bool isReplacement) { - if (cch == 0) - { - return; - } - - RegexNode node; - if (cch > 1) + switch (cch) { - string str = UseOptionI() && !isReplacement ? -#if REGEXGENERATOR - StringExtensions.Create -#else - string.Create -#endif - (cch, (_pattern, _culture, pos, cch), static (dest, state) => - { - // We do the ToLower character-by character for consistency with the rest of the implementation. - // With surrogate pairs, doing a ToLower on the entire string is more correct linguistically, but - // Regex doesn't support surrogates, and not doing this character-by-character then causes differences - // from matching where characters are lowercased individually. - ReadOnlySpan src = state._pattern.AsSpan(state.pos, state.cch); - TextInfo ti = state._culture.TextInfo; - for (int i = 0; i < dest.Length; i++) - { - dest[i] = ti.ToLower(src[i]); - } - }) : - _pattern.Substring(pos, cch); + case 0: + return; - node = new RegexNode(RegexNode.Multi, _options, str); - } - else - { - char ch = _pattern[pos]; + case 1: + _concatenation!.AddChild(RegexNode.CreateOneWithCaseConversion(_pattern[pos], isReplacement ? _options & ~RegexOptions.IgnoreCase : _options, _culture)); + break; - if (UseOptionI() && !isReplacement) - { - ch = _culture.TextInfo.ToLower(ch); - } + case > 1 when !UseOptionI() || isReplacement || !RegexCharClass.ParticipatesInCaseConversion(_pattern.AsSpan(pos, cch)): + _concatenation!.AddChild(new RegexNode(RegexNode.Multi, _options & ~RegexOptions.IgnoreCase, _pattern.Substring(pos, cch))); + break; - node = new RegexNode(RegexNode.One, _options, ch); + default: + foreach (char c in _pattern.AsSpan(pos, cch)) + { + _concatenation!.AddChild(RegexNode.CreateOneWithCaseConversion(c, _options, _culture)); + } + break; } - - _concatenation!.AddChild(node); } /// Push the parser state (in response to an open paren) @@ -2243,11 +2243,11 @@ private void AddAlternate() if (_group!.Type == RegexNode.Testgroup || _group.Type == RegexNode.Testref) { - _group.AddChild(_concatenation!.ReverseLeft()); + _group.AddChild(_concatenation!.ReverseConcatenationIfRightToLeft()); } else { - _alternation!.AddChild(_concatenation!.ReverseLeft()); + _alternation!.AddChild(_concatenation!.ReverseConcatenationIfRightToLeft()); } _concatenation = new RegexNode(RegexNode.Concatenate, _options); @@ -2273,29 +2273,7 @@ private void AddConcatenate(bool lazy, int min, int max) private RegexNode? Unit() => _unit; /// Sets the current unit to a single char node - private void AddUnitOne(char ch) - { - if (UseOptionI()) - { - ch = _culture.TextInfo.ToLower(ch); - } - - _unit = new RegexNode(RegexNode.One, _options, ch); - } - - /// Sets the current unit to a single inverse-char node - private void AddUnitNotone(char ch) - { - if (UseOptionI()) - { - ch = _culture.TextInfo.ToLower(ch); - } - - _unit = new RegexNode(RegexNode.Notone, _options, ch); - } - - /// Sets the current unit to a single set node - private void AddUnitSet(string cc) => _unit = new RegexNode(RegexNode.Set, _options, cc); + private void AddUnitOne(char ch) => _unit = RegexNode.CreateOneWithCaseConversion(ch, _options, _culture); /// Sets the current unit to a subtree private void AddUnitNode(RegexNode node) => _unit = node; @@ -2308,7 +2286,7 @@ private void AddGroup() { if (_group!.Type == RegexNode.Testgroup || _group.Type == RegexNode.Testref) { - _group.AddChild(_concatenation!.ReverseLeft()); + _group.AddChild(_concatenation!.ReverseConcatenationIfRightToLeft()); if (_group.Type == RegexNode.Testref && _group.ChildCount() > 2 || _group.ChildCount() > 3) { @@ -2317,7 +2295,7 @@ private void AddGroup() } else { - _alternation!.AddChild(_concatenation!.ReverseLeft()); + _alternation!.AddChild(_concatenation!.ReverseConcatenationIfRightToLeft()); _group.AddChild(_alternation); } diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexPrefixAnalyzer.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexPrefixAnalyzer.cs index 96a709b2338d43..22a2abba1946ad 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexPrefixAnalyzer.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexPrefixAnalyzer.cs @@ -5,6 +5,8 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; +using System.Runtime.CompilerServices; +using System.Threading; namespace System.Text.RegularExpressions { @@ -40,256 +42,518 @@ private RegexPrefixAnalyzer(Span intStack) _skipAllChildren = false; } - /// Computes the leading substring in . - /// It's quite trivial and gives up easily, in which case an empty string is returned. - public static (string Prefix, bool CaseInsensitive) ComputeLeadingSubstring(RegexTree tree) + /// Computes the leading substring in ; may be empty. + public static string FindCaseSensitivePrefix(RegexTree tree) { - RegexNode curNode = tree.Root; - RegexNode? concatNode = null; - int nextChild = 0; + var vsb = new ValueStringBuilder(stackalloc char[64]); + Process(tree.Root, ref vsb); + return vsb.ToString(); - while (true) + // Processes the node, adding any prefix text to the builder. + // Returns whether processing should continue with subsequent nodes. + static bool Process(RegexNode node, ref ValueStringBuilder vsb) { - switch (curNode.Type) + if (!StackHelper.TryEnsureSufficientExecutionStack()) { + // If we're too deep on the stack, just give up finding any more prefix. + return false; + } + + // We don't bother to handle reversed input, so process at most one node + // when handling RightToLeft. + bool rtl = (node.Options & RegexOptions.RightToLeft) != 0; + + switch (node.Type) + { + // Concatenation case RegexNode.Concatenate: - if (curNode.ChildCount() > 0) { - concatNode = curNode; - nextChild = 0; + int childCount = node.ChildCount(); + for (int i = 0; i < childCount; i++) + { + if (!Process(node.Child(i), ref vsb)) + { + return false; + } + } + return !rtl; } - break; - case RegexNode.Atomic: - case RegexNode.Capture: - curNode = curNode.Child(0); - concatNode = null; - continue; + // Alternation: find a string that's a shared prefix of all branches + case RegexNode.Alternate: + { + int childCount = node.ChildCount(); - case RegexNode.Oneloop: - case RegexNode.Oneloopatomic: - case RegexNode.Onelazy: + // Store the initial branch into the target builder + int initialLength = vsb.Length; + bool keepExploring = Process(node.Child(0), ref vsb); + int addedLength = vsb.Length - initialLength; - // In release, cutoff at a length to which we can still reasonably construct a string and Boyer-Moore search. - // In debug, use a smaller cutoff to exercise the cutoff path in tests - const int Cutoff = -#if DEBUG - 50; -#else - RegexBoyerMoore.MaxLimit; -#endif + // Then explore the rest of the branches, finding the length + // a prefix they all share in common with the initial branch. + if (addedLength != 0) + { + var alternateSb = new ValueStringBuilder(64); - if (curNode.M > 0 && curNode.M < Cutoff) - { - return (new string(curNode.Ch, curNode.M), (curNode.Options & RegexOptions.IgnoreCase) != 0); - } + // Process each branch. If we reach a point where we've proven there's + // no overlap, we can bail early. + for (int i = 1; i < childCount && addedLength != 0; i++) + { + alternateSb.Length = 0; + + // Process the branch. We want to keep exploring after this alternation, + // but we can't if either this branch doesn't allow for it or if the prefix + // supplied by this branch doesn't entirely match all the previous ones. + keepExploring &= Process(node.Child(i), ref alternateSb); + keepExploring &= alternateSb.Length == addedLength; + + addedLength = Math.Min(addedLength, alternateSb.Length); + for (int j = 0; j < addedLength; j++) + { + if (vsb[initialLength + j] != alternateSb[j]) + { + addedLength = j; + keepExploring = false; + break; + } + } + } - return (string.Empty, false); + alternateSb.Dispose(); - case RegexNode.One: - return (curNode.Ch.ToString(), (curNode.Options & RegexOptions.IgnoreCase) != 0); + // Then cull back on what was added based on the other branches. + vsb.Length = initialLength + addedLength; + } - case RegexNode.Multi: - return (curNode.Str!, (curNode.Options & RegexOptions.IgnoreCase) != 0); + return !rtl && keepExploring; + } + // One character + case RegexNode.One when (node.Options & RegexOptions.IgnoreCase) == 0: + vsb.Append(node.Ch); + return !rtl; + + // Multiple characters + case RegexNode.Multi when (node.Options & RegexOptions.IgnoreCase) == 0: + vsb.Append(node.Str); + return !rtl; + + // Loop of one character + case RegexNode.Oneloop or RegexNode.Oneloopatomic or RegexNode.Onelazy when node.M > 0 && (node.Options & RegexOptions.IgnoreCase) == 0: + const int SingleCharIterationLimit = 32; // arbitrary cut-off to avoid creating super long strings unnecessarily + int count = Math.Min(node.M, SingleCharIterationLimit); + vsb.Append(node.Ch, count); + return count == node.N && !rtl; + + // Loop of a node + case RegexNode.Loop or RegexNode.Lazyloop when node.M > 0: + { + const int NodeIterationLimit = 4; // arbitrary cut-off to avoid creating super long strings unnecessarily + int limit = Math.Min(node.M, NodeIterationLimit); + for (int i = 0; i < limit; i++) + { + if (!Process(node.Child(0), ref vsb)) + { + return false; + } + } + return limit == node.N && !rtl; + } + + // Grouping nodes for which we only care about their single child + case RegexNode.Atomic: + case RegexNode.Capture: + return Process(node.Child(0), ref vsb); + + // Zero-width anchors and assertions case RegexNode.Bol: case RegexNode.Eol: case RegexNode.Boundary: case RegexNode.ECMABoundary: + case RegexNode.NonBoundary: + case RegexNode.NonECMABoundary: case RegexNode.Beginning: case RegexNode.Start: case RegexNode.EndZ: case RegexNode.End: case RegexNode.Empty: + case RegexNode.UpdateBumpalong: case RegexNode.Require: case RegexNode.Prevent: - break; + return true; + // Give up for anything else default: - return (string.Empty, false); + return false; } - - if (concatNode == null || nextChild >= concatNode.ChildCount()) - { - return (string.Empty, false); - } - - curNode = concatNode.Child(nextChild++); } } - /// Computes a character class for the first character in . - /// true if a character class could be computed; otherwise, false. - public static (string CharClass, bool CaseInsensitive)[]? ComputeFirstCharClass(RegexTree tree) + /// Finds sets at fixed-offsets from the beginning of the pattern/ + /// The RegexNode tree. + /// The culture to use for any case conversions. + /// true to spend more time finding sets (e.g. through alternations); false to do a faster analysis that's potentially more incomplete. + /// The array of found sets, or null if there aren't any. + public static List<(char[]? Chars, string Set, int Distance, bool CaseInsensitive)>? FindFixedDistanceSets( + RegexTree tree, CultureInfo culture, bool thorough) { - var s = new RegexPrefixAnalyzer(stackalloc int[StackBufferSize]); - RegexFC? fc = s.RegexFCFromRegexTree(tree); - s.Dispose(); + const int MaxLoopExpansion = 20; // arbitrary cut-off to avoid loops adding significant overhead to processing + const int MaxFixedResults = 50; // arbitrary cut-off to avoid generating lots of sets unnecessarily - if (fc == null || fc._nullable) + // Find all fixed-distance sets. + var results = new List<(char[]? Chars, string Set, int Distance, bool CaseInsensitive)>(); + int distance = 0; + TryFindFixedSets(tree.Root, results, ref distance, culture, thorough); +#if DEBUG + foreach ((char[]? Chars, string Set, int Distance, bool CaseInsensitive) result in results) { - return null; + Debug.Assert(result.Distance <= tree.MinRequiredLength, $"Min: {tree.MinRequiredLength}, Distance: {result.Distance}, Tree: {tree}"); } +#endif - if (fc.CaseInsensitive) + // Remove any sets that match everything; they're not helpful. (This check exists primarily to weed + // out use of . in Singleline mode.) + bool hasAny = false; + for (int i = 0; i < results.Count; i++) { - fc.AddLowercase(((tree.Options & RegexOptions.CultureInvariant) != 0) ? CultureInfo.InvariantCulture : CultureInfo.CurrentCulture); + if (results[i].Set == RegexCharClass.AnyClass) + { + hasAny = true; + break; + } } - - return new[] { (fc.GetFirstChars(), fc.CaseInsensitive) }; - } - - /// Computes character classes for the first characters in . - /// - /// For example, given "hello|world" and a of 3, this will compute the sets [hw], [eo], and [lr]. - /// As with some of the other computations, it's quite trivial and gives up easily; for example, we could in - /// theory handle nodes in a concatenation after an alternation, but we look only at the branches of the - /// alternation itself. As this computation is intended primarily to handle global alternations, it's currently - /// a reasonable tradeoff between simplicity, performance, and the fullness of potential optimizations. - /// - public static (string CharClass, bool CaseInsensitive)[]? ComputeMultipleCharClasses(RegexTree tree, int maxChars) - { - Debug.Assert(maxChars > 1); - - if ((tree.Options & RegexOptions.RightToLeft) != 0) + if (hasAny) { - // We don't bother for RightToLeft. It's rare and adds non-trivial complication. - return null; + results.RemoveAll(s => s.Set == RegexCharClass.AnyClass); } - // The known minimum required length will have already factored in knowledge about alternations. - // If the known min length is less than the maximum number of chars requested, we can - // cut this short. If it's zero, there's nothing to be found. If it's one, we won't do - // any better than ComputeFirstCharClass (and likely worse). Otherwise, don't bother looking for more - // the min of the min length and the max requested chars. - maxChars = Math.Min(tree.MinRequiredLength, maxChars); - if (maxChars <= 1) + // If we don't have any results, try harder to compute one for the starting character. + // This is a more involved computation that can find things the fixed-distance investigation + // doesn't. + if (results.Count == 0) { - return null; + (string CharClass, bool CaseInsensitive)? first = FindFirstCharClass(tree, culture); + if (first is not null) + { + results.Add((null, first.Value.CharClass, 0, first.Value.CaseInsensitive)); + } + + if (results.Count == 0) + { + return null; + } } - // Find an alternation on the path to the first node. If we can't, bail. - RegexNode node = tree.Root; - while (node.Type != RegexNode.Alternate) + // For every entry, see if we can mark any that are case-insensitive as actually being case-sensitive + // based on not participating in case conversion. And then for ones that are case-sensitive, try to + // get the chars that make up the set, if there are few enough. + Span scratch = stackalloc char[5]; // max optimized by IndexOfAny today + for (int i = 0; i < results.Count; i++) { - switch (node.Type) + (char[]? Chars, string Set, int Distance, bool CaseInsensitive) result = results[i]; + if (!RegexCharClass.IsNegated(result.Set)) { - case RegexNode.Atomic: - case RegexNode.Capture: - case RegexNode.Concatenate: - node = node.Child(0); - break; + int count = RegexCharClass.GetSetChars(result.Set, scratch); + if (count != 0) + { + if (result.CaseInsensitive && !RegexCharClass.ParticipatesInCaseConversion(scratch.Slice(0, count))) + { + result.CaseInsensitive = false; + } - default: - return null; + if (!result.CaseInsensitive) + { + result.Chars = scratch.Slice(0, count).ToArray(); + } + + results[i] = result; + } } } - Debug.Assert(node.Type == RegexNode.Alternate); - // Create RegexCharClasses to store the built-up sets. We may end up returning fewer - // than this if we find we can't easily fill this number of sets with 100% confidence. - var classes = new RegexCharClass?[maxChars]; - bool caseInsensitive = false; + // Finally, try to move the "best" results to be earlier. "best" here are ones we're able to search + // for the fastest and that have the best chance of matching as few false positives as possible. + results.Sort((s1, s2) => + { + if (s1.CaseInsensitive != s2.CaseInsensitive) + { + // If their case-sensitivities don't match, whichever is case-sensitive comes first / is considered lower. + return s1.CaseInsensitive ? 1 : -1; + } + + if (s1.Chars is not null && s2.Chars is not null) + { + // Then of the ones that are the same length, prefer those with less frequent values. The frequency is + // only an approximation, used as a tie-breaker when we'd otherwise effectively be picking randomly. True + // frequencies will vary widely based on the actual data being searched, the language of the data, etc. + int c = SumFrequencies(s1.Chars).CompareTo(SumFrequencies(s2.Chars)); + if (c != 0) + { + return c; + } - int branches = node.ChildCount(); - Debug.Assert(branches >= 2); - for (int branchNum = 0; branchNum < branches; branchNum++) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static float SumFrequencies(char[] chars) + { + float sum = 0; + foreach (char c in chars) + { + // Lookup each character in the table. For values > 255, this will end up truncating + // and thus we'll get skew in the data. It's already a gross approximation, though, + // and it is primarily meant for disambiguation of ASCII letters. + sum += s_frequency[(byte)c]; + } + return sum; + } + } + else if (s1.Chars is not null) + { + // If s1 has chars and s2 doesn't, then s1 has fewer chars. + return -1; + } + else if (s2.Chars is not null) + { + // If s2 has chars and s1 doesn't, then s2 has fewer chars. + return 1; + } + + return s1.Distance.CompareTo(s2.Distance); + }); + + return results; + + // Starting from the specified root node, populates results with any characters at a fixed distance + // from the node's starting position. The function returns true if the entire contents of the node + // is at a fixed distance, in which case distance will have been updated to include the full length + // of the node. If it returns false, the node isn't entirely fixed, in which case subsequent nodes + // shouldn't be examined and distance should no longer be trusted. However, regardless of whether it + // returns true or false, it may have populated results, and all populated results are valid. + static bool TryFindFixedSets(RegexNode node, List<(char[]? Chars, string Set, int Distance, bool CaseInsensitive)> results, ref int distance, CultureInfo culture, bool thorough) { - RegexNode alternateBranch = node.Child(branchNum); - caseInsensitive |= (alternateBranch.Options & RegexOptions.IgnoreCase) != 0; + if (!StackHelper.TryEnsureSufficientExecutionStack()) + { + return false; + } - switch (alternateBranch.Type) + if ((node.Options & RegexOptions.RightToLeft) != 0) { + return false; + } + + bool caseInsensitive = (node.Options & RegexOptions.IgnoreCase) != 0; + + switch (node.Type) + { + case RegexNode.One: + if (results.Count < MaxFixedResults) + { + string setString = RegexCharClass.OneToStringClass(node.Ch, caseInsensitive ? culture : null, out bool resultIsCaseInsensitive); + results.Add((null, setString, distance++, resultIsCaseInsensitive)); + return true; + } + return false; + + case RegexNode.Onelazy or RegexNode.Oneloop or RegexNode.Oneloopatomic when node.M > 0: + { + string setString = RegexCharClass.OneToStringClass(node.Ch, caseInsensitive ? culture : null, out bool resultIsCaseInsensitive); + int minIterations = Math.Min(node.M, MaxLoopExpansion); + int i = 0; + for (; i < minIterations && results.Count < MaxFixedResults; i++) + { + results.Add((null, setString, distance++, resultIsCaseInsensitive)); + } + return i == node.M && i == node.N; + } + case RegexNode.Multi: - maxChars = Math.Min(maxChars, alternateBranch.Str!.Length); - for (int i = 0; i < maxChars; i++) { - (classes[i] ??= new RegexCharClass()).AddChar(alternateBranch.Str[i]); + string s = node.Str!; + int i = 0; + for (; i < s.Length && results.Count < MaxFixedResults; i++) + { + string setString = RegexCharClass.OneToStringClass(s[i], caseInsensitive ? culture : null, out bool resultIsCaseInsensitive); + results.Add((null, setString, distance++, resultIsCaseInsensitive)); + } + return i == s.Length; } - continue; + + case RegexNode.Set: + if (results.Count < MaxFixedResults) + { + results.Add((null, node.Str!, distance++, caseInsensitive)); + return true; + } + return false; + + case RegexNode.Setlazy or RegexNode.Setloop or RegexNode.Setloopatomic when node.M > 0: + { + int minIterations = Math.Min(node.M, MaxLoopExpansion); + int i = 0; + for (; i < minIterations && results.Count < MaxFixedResults; i++) + { + results.Add((null, node.Str!, distance++, caseInsensitive)); + } + return i == node.M && i == node.N; + } + + case RegexNode.Notone: + // We could create a set out of Notone, but it will be of little value in helping to improve + // the speed of finding the first place to match, as almost every character will match it. + distance++; + return true; + + case RegexNode.Notonelazy or RegexNode.Notoneloop or RegexNode.Notoneloopatomic when node.M == node.N: + distance += node.M; + return true; + + case RegexNode.Beginning: + case RegexNode.Bol: + case RegexNode.Boundary: + case RegexNode.ECMABoundary: + case RegexNode.Empty: + case RegexNode.End: + case RegexNode.EndZ: + case RegexNode.Eol: + case RegexNode.NonBoundary: + case RegexNode.NonECMABoundary: + case RegexNode.UpdateBumpalong: + case RegexNode.Start: + case RegexNode.Prevent: + case RegexNode.Require: + // Zero-width anchors and assertions. In theory for Prevent and Require we could also investigate + // them and use the learned knowledge to impact the generated sets, at least for lookaheads. + // For now, we don't bother. + return true; + + case RegexNode.Atomic: + case RegexNode.Group: + case RegexNode.Capture: + return TryFindFixedSets(node.Child(0), results, ref distance, culture, thorough); + + case RegexNode.Lazyloop or RegexNode.Loop when node.M > 0: + // This effectively only iterates the loop once. If deemed valuable, + // it could be updated in the future to duplicate the found results + // (updated to incorporate distance from previous iterations) and + // summed distance for all node.M iterations. If node.M == node.N, + // this would then also allow continued evaluation of the rest of the + // expression after the loop. + TryFindFixedSets(node.Child(0), results, ref distance, culture, thorough); + return false; case RegexNode.Concatenate: { - int classPos = 0; - int concatChildren = alternateBranch.ChildCount(); - for (int i = 0; i < concatChildren && classPos < classes.Length; i++) + int childCount = node.ChildCount(); + for (int i = 0; i < childCount; i++) { - RegexNode concatChild = alternateBranch.Child(i); - caseInsensitive |= (concatChild.Options & RegexOptions.IgnoreCase) != 0; + if (!TryFindFixedSets(node.Child(i), results, ref distance, culture, thorough)) + { + return false; + } + } + return true; + } - switch (concatChild.Type) + case RegexNode.Alternate when thorough: + { + int childCount = node.ChildCount(); + bool allSameSize = true; + int? sameDistance = null; + var combined = new Dictionary(); + + var localResults = new List<(char[]? Chars, string Set, int Distance, bool CaseInsensitive)>(); + for (int i = 0; i < childCount; i++) + { + localResults.Clear(); + int localDistance = 0; + allSameSize &= TryFindFixedSets(node.Child(i), localResults, ref localDistance, culture, thorough); + + if (localResults.Count == 0) { - case RegexNode.One: - (classes[classPos++] ??= new RegexCharClass()).AddChar(concatChild.Ch); - break; - case RegexNode.Set: - if (!(classes[classPos++] ??= new RegexCharClass()).TryAddCharClass(RegexCharClass.Parse(concatChild.Str!))) - { - // If the classes can't be merged, give up. - return null; - } - break; - case RegexNode.Multi: - for (int c = 0; c < concatChild.Str!.Length && classPos < classes.Length; c++) + return false; + } + + if (allSameSize) + { + if (sameDistance is null) + { + sameDistance = localDistance; + } + else if (sameDistance.Value != localDistance) + { + allSameSize = false; + } + } + + foreach ((char[]? Chars, string Set, int Distance, bool CaseInsensitive) fixedSet in localResults) + { + if (combined.TryGetValue(fixedSet.Distance, out (RegexCharClass Set, bool CaseInsensitive, int Count) value)) + { + if (fixedSet.CaseInsensitive == value.CaseInsensitive && + value.Set.TryAddCharClass(RegexCharClass.Parse(fixedSet.Set))) { - (classes[classPos++] ??= new RegexCharClass()).AddChar(concatChild.Str[c]); + value.Count++; + combined[fixedSet.Distance] = value; } - break; + } + else + { + combined[fixedSet.Distance] = (RegexCharClass.Parse(fixedSet.Set), fixedSet.CaseInsensitive, 1); + } + } + } + + foreach (KeyValuePair pair in combined) + { + if (results.Count >= MaxFixedResults) + { + allSameSize = false; + break; + } - default: // nothing else supported - i = concatChildren; // stop looking at additional nodes - break; + if (pair.Value.Count == childCount) + { + results.Add((null, pair.Value.Set.ToStringClass(), pair.Key + distance, pair.Value.CaseInsensitive)); } } - maxChars = Math.Min(maxChars, classPos); + if (allSameSize) + { + Debug.Assert(sameDistance.HasValue); + distance += sameDistance.Value; + return true; + } + + return false; } - continue; default: - // Any other node type as a branch in the alternation and we give up. Note that we don't special-case One/Notone/Set - // because that would mean the whole branch was a single char, in which case this computation provides - // zero benefit over the ComputeFirstCharClass computation. - return null; + return false; } } + } - // We've now examined all of the alternate branches and were able to successfully process them. - // Determine how many we can actually return. - for (int i = 0; i < maxChars; i++) - { - if (classes[i] is null) - { - maxChars = i; - break; - } - } + // Computes a character class for the first character in tree. This uses a more robust algorithm + // than is used by TryFindFixedLiterals and thus can find starting sets it couldn't. For example, + // fixed literals won't find the starting set for a*b, as the a isn't guaranteed and the b is at a + // variable position, but this will find [ab] as it's instead looking for anything that under any + // circumstance could possibly start a match. + public static (string CharClass, bool CaseInsensitive)? FindFirstCharClass(RegexTree tree, CultureInfo culture) + { + var s = new RegexPrefixAnalyzer(stackalloc int[StackBufferSize]); + RegexFC? fc = s.RegexFCFromRegexTree(tree); + s.Dispose(); - // Make sure we got something. - if (maxChars == 0) + if (fc == null || fc._nullable) { return null; } - // Create and return the RegexPrefix objects. - var prefixes = new (string CharClass, bool CaseInsensitive)[maxChars]; - - CultureInfo? ci = null; - if (caseInsensitive) - { - ci = (tree.Options & RegexOptions.CultureInvariant) != 0 ? CultureInfo.InvariantCulture : CultureInfo.CurrentCulture; - } - - for (int i = 0; i < prefixes.Length; i++) + if (fc.CaseInsensitive) { - if (caseInsensitive) - { - classes[i]!.AddLowercase(ci!); - } - prefixes[i] = (classes[i]!.ToStringClass(), caseInsensitive); + fc.AddLowercase(culture); } - return prefixes; + return (fc.GetFirstChars(), fc.CaseInsensitive); } /// Takes a RegexTree and computes the leading anchor that it encounters. @@ -619,6 +883,84 @@ private void CalculateFC(int NodeType, RegexNode node, int CurIndex) throw new ArgumentException(SR.Format(SR.UnexpectedOpcode, NodeType.ToString(CultureInfo.CurrentCulture))); } } + + /// Percent occurrences in source text (100 * char count / total count). + private static readonly float[] s_frequency = new float[] + { + 0.000f /* '\x00' */, 0.000f /* '\x01' */, 0.000f /* '\x02' */, 0.000f /* '\x03' */, 0.000f /* '\x04' */, 0.000f /* '\x05' */, 0.000f /* '\x06' */, 0.000f /* '\x07' */, + 0.000f /* '\x08' */, 0.001f /* '\x09' */, 0.000f /* '\x0A' */, 0.000f /* '\x0B' */, 0.000f /* '\x0C' */, 0.000f /* '\x0D' */, 0.000f /* '\x0E' */, 0.000f /* '\x0F' */, + 0.000f /* '\x10' */, 0.000f /* '\x11' */, 0.000f /* '\x12' */, 0.000f /* '\x13' */, 0.003f /* '\x14' */, 0.000f /* '\x15' */, 0.000f /* '\x16' */, 0.000f /* '\x17' */, + 0.000f /* '\x18' */, 0.004f /* '\x19' */, 0.000f /* '\x1A' */, 0.000f /* '\x1B' */, 0.006f /* '\x1C' */, 0.006f /* '\x1D' */, 0.000f /* '\x1E' */, 0.000f /* '\x1F' */, + 8.952f /* ' ' */, 0.065f /* ' !' */, 0.420f /* ' "' */, 0.010f /* ' #' */, 0.011f /* ' $' */, 0.005f /* ' %' */, 0.070f /* ' &' */, 0.050f /* ' '' */, + 3.911f /* ' (' */, 3.910f /* ' )' */, 0.356f /* ' *' */, 2.775f /* ' +' */, 1.411f /* ' ,' */, 0.173f /* ' -' */, 2.054f /* ' .' */, 0.677f /* ' /' */, + 1.199f /* ' 0' */, 0.870f /* ' 1' */, 0.729f /* ' 2' */, 0.491f /* ' 3' */, 0.335f /* ' 4' */, 0.269f /* ' 5' */, 0.435f /* ' 6' */, 0.240f /* ' 7' */, + 0.234f /* ' 8' */, 0.196f /* ' 9' */, 0.144f /* ' :' */, 0.983f /* ' ;' */, 0.357f /* ' <' */, 0.661f /* ' =' */, 0.371f /* ' >' */, 0.088f /* ' ?' */, + 0.007f /* ' @' */, 0.763f /* ' A' */, 0.229f /* ' B' */, 0.551f /* ' C' */, 0.306f /* ' D' */, 0.449f /* ' E' */, 0.337f /* ' F' */, 0.162f /* ' G' */, + 0.131f /* ' H' */, 0.489f /* ' I' */, 0.031f /* ' J' */, 0.035f /* ' K' */, 0.301f /* ' L' */, 0.205f /* ' M' */, 0.253f /* ' N' */, 0.228f /* ' O' */, + 0.288f /* ' P' */, 0.034f /* ' Q' */, 0.380f /* ' R' */, 0.730f /* ' S' */, 0.675f /* ' T' */, 0.265f /* ' U' */, 0.309f /* ' V' */, 0.137f /* ' W' */, + 0.084f /* ' X' */, 0.023f /* ' Y' */, 0.023f /* ' Z' */, 0.591f /* ' [' */, 0.085f /* ' \' */, 0.590f /* ' ]' */, 0.013f /* ' ^' */, 0.797f /* ' _' */, + 0.001f /* ' `' */, 4.596f /* ' a' */, 1.296f /* ' b' */, 2.081f /* ' c' */, 2.005f /* ' d' */, 6.903f /* ' e' */, 1.494f /* ' f' */, 1.019f /* ' g' */, + 1.024f /* ' h' */, 3.750f /* ' i' */, 0.286f /* ' j' */, 0.439f /* ' k' */, 2.913f /* ' l' */, 1.459f /* ' m' */, 3.908f /* ' n' */, 3.230f /* ' o' */, + 1.444f /* ' p' */, 0.231f /* ' q' */, 4.220f /* ' r' */, 3.924f /* ' s' */, 5.312f /* ' t' */, 2.112f /* ' u' */, 0.737f /* ' v' */, 0.573f /* ' w' */, + 0.992f /* ' x' */, 1.067f /* ' y' */, 0.181f /* ' z' */, 0.391f /* ' {' */, 0.056f /* ' |' */, 0.391f /* ' }' */, 0.002f /* ' ~' */, 0.000f /* '\x7F' */, + 0.000f /* '\x80' */, 0.000f /* '\x81' */, 0.000f /* '\x82' */, 0.000f /* '\x83' */, 0.000f /* '\x84' */, 0.000f /* '\x85' */, 0.000f /* '\x86' */, 0.000f /* '\x87' */, + 0.000f /* '\x88' */, 0.000f /* '\x89' */, 0.000f /* '\x8A' */, 0.000f /* '\x8B' */, 0.000f /* '\x8C' */, 0.000f /* '\x8D' */, 0.000f /* '\x8E' */, 0.000f /* '\x8F' */, + 0.000f /* '\x90' */, 0.000f /* '\x91' */, 0.000f /* '\x92' */, 0.000f /* '\x93' */, 0.000f /* '\x94' */, 0.000f /* '\x95' */, 0.000f /* '\x96' */, 0.000f /* '\x97' */, + 0.000f /* '\x98' */, 0.000f /* '\x99' */, 0.000f /* '\x9A' */, 0.000f /* '\x9B' */, 0.000f /* '\x9C' */, 0.000f /* '\x9D' */, 0.000f /* '\x9E' */, 0.000f /* '\x9F' */, + 0.000f /* '\xA0' */, 0.000f /* '\xA1' */, 0.000f /* '\xA2' */, 0.000f /* '\xA3' */, 0.000f /* '\xA4' */, 0.000f /* '\xA5' */, 0.000f /* '\xA6' */, 0.000f /* '\xA7' */, + 0.000f /* '\xA8' */, 0.000f /* '\xA9' */, 0.000f /* '\xAA' */, 0.000f /* '\xAB' */, 0.000f /* '\xAC' */, 0.000f /* '\xAD' */, 0.000f /* '\xAE' */, 0.000f /* '\xAF' */, + 0.000f /* '\xB0' */, 0.000f /* '\xB1' */, 0.000f /* '\xB2' */, 0.000f /* '\xB3' */, 0.000f /* '\xB4' */, 0.000f /* '\xB5' */, 0.000f /* '\xB6' */, 0.000f /* '\xB7' */, + 0.000f /* '\xB8' */, 0.000f /* '\xB9' */, 0.000f /* '\xBA' */, 0.000f /* '\xBB' */, 0.000f /* '\xBC' */, 0.000f /* '\xBD' */, 0.000f /* '\xBE' */, 0.000f /* '\xBF' */, + 0.000f /* '\xC0' */, 0.000f /* '\xC1' */, 0.000f /* '\xC2' */, 0.000f /* '\xC3' */, 0.000f /* '\xC4' */, 0.000f /* '\xC5' */, 0.000f /* '\xC6' */, 0.000f /* '\xC7' */, + 0.000f /* '\xC8' */, 0.000f /* '\xC9' */, 0.000f /* '\xCA' */, 0.000f /* '\xCB' */, 0.000f /* '\xCC' */, 0.000f /* '\xCD' */, 0.000f /* '\xCE' */, 0.000f /* '\xCF' */, + 0.000f /* '\xD0' */, 0.000f /* '\xD1' */, 0.000f /* '\xD2' */, 0.000f /* '\xD3' */, 0.000f /* '\xD4' */, 0.000f /* '\xD5' */, 0.000f /* '\xD6' */, 0.000f /* '\xD7' */, + 0.000f /* '\xD8' */, 0.000f /* '\xD9' */, 0.000f /* '\xDA' */, 0.000f /* '\xDB' */, 0.000f /* '\xDC' */, 0.000f /* '\xDD' */, 0.000f /* '\xDE' */, 0.000f /* '\xDF' */, + 0.000f /* '\xE0' */, 0.000f /* '\xE1' */, 0.000f /* '\xE2' */, 0.000f /* '\xE3' */, 0.000f /* '\xE4' */, 0.000f /* '\xE5' */, 0.000f /* '\xE6' */, 0.000f /* '\xE7' */, + 0.000f /* '\xE8' */, 0.000f /* '\xE9' */, 0.000f /* '\xEA' */, 0.000f /* '\xEB' */, 0.000f /* '\xEC' */, 0.000f /* '\xED' */, 0.000f /* '\xEE' */, 0.000f /* '\xEF' */, + 0.000f /* '\xF0' */, 0.000f /* '\xF1' */, 0.000f /* '\xF2' */, 0.000f /* '\xF3' */, 0.000f /* '\xF4' */, 0.000f /* '\xF5' */, 0.000f /* '\xF6' */, 0.000f /* '\xF7' */, + 0.000f /* '\xF8' */, 0.000f /* '\xF9' */, 0.000f /* '\xFA' */, 0.000f /* '\xFB' */, 0.000f /* '\xFC' */, 0.000f /* '\xFD' */, 0.000f /* '\xFE' */, 0.000f /* '\xFF' */, + }; + + // The above table was generated programmatically with the following. This can be augmented to incorporate additional data sources, + // though it is only intended to be a rough approximation use when tie-breaking and we'd otherwise be picking randomly, so, it's something. + // The frequencies may be wildly inaccurate when used with data sources different in nature than the training set, in which case we shouldn't + // be much worse off than just picking randomly: + // + // using System.Runtime.InteropServices; + // + // var counts = new Dictionary(); + // + // (string, string)[] rootsAndExtensions = new[] + // { + // (@"d:\repos\runtime\src\", "*.cs"), // C# files in dotnet/runtime + // (@"d:\Top25GutenbergBooks", "*.txt"), // Top 25 most popular books on Project Gutenberg + // }; + // + // foreach ((string root, string ext) in rootsAndExtensions) + // foreach (string path in Directory.EnumerateFiles(root, ext, SearchOption.AllDirectories)) + // foreach (string line in File.ReadLines(path)) + // foreach (char c in line.AsSpan().Trim()) + // CollectionsMarshal.GetValueRefOrAddDefault(counts, (byte)c, out _)++; + // + // long total = counts.Sum(i => i.Value); + // + // Console.WriteLine("/// Percent occurrences in source text (100 * char count / total count)."); + // Console.WriteLine("private static readonly float[] s_frequency = new float[]"); + // Console.WriteLine("{"); + // int i = 0; + // for (int row = 0; row < 32; row++) + // { + // Console.Write(" "); + // for (int col = 0; col < 8; col++) + // { + // counts.TryGetValue((byte)i, out long charCount); + // float frequency = (float)(charCount / (double)total) * 100; + // Console.Write($" {frequency:N3}f /* '{(i >= 32 && i < 127 ? $" {(char)i}" : $"\\x{i:X2}")}' */,"); + // i++; + // } + // Console.WriteLine(); + // } + // Console.WriteLine("};"); } internal sealed class RegexFC diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexWriter.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexWriter.cs index 2154947cfaa8d5..5ef7281b5884da 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexWriter.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexWriter.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; using System.Globalization; +using System.Runtime.InteropServices; namespace System.Text.RegularExpressions { @@ -38,10 +39,10 @@ private RegexWriter(Span emittedSpan, Span intStackSpan) /// This is the only function that should be called from outside. /// It takes a RegexTree and creates a corresponding RegexCode. /// - public static RegexCode Write(RegexTree tree) + public static RegexCode Write(RegexTree tree, CultureInfo culture) { var writer = new RegexWriter(stackalloc int[EmittedSize], stackalloc int[IntStackSize]); - RegexCode code = writer.RegexCodeFromRegexTree(tree); + RegexCode code = writer.RegexCodeFromRegexTree(tree, culture); writer.Dispose(); #if DEBUG @@ -71,7 +72,7 @@ public void Dispose() /// It also computes various information about the tree, such as /// prefix data to help with optimizations. /// - public RegexCode RegexCodeFromRegexTree(RegexTree tree) + public RegexCode RegexCodeFromRegexTree(RegexTree tree, CultureInfo culture) { // Construct sparse capnum mapping if some numbers are unused. int capsize; @@ -131,46 +132,6 @@ public RegexCode RegexCodeFromRegexTree(RegexTree tree) Emit(RegexCode.Stop); int[] emitted = _emitted.AsSpan().ToArray(); - bool rtl = (tree.Options & RegexOptions.RightToLeft) != 0; - bool compiled = (tree.Options & RegexOptions.Compiled) != 0; - - // Compute prefixes to help optimize FindFirstChar. - RegexBoyerMoore? boyerMoorePrefix = null; - (string CharClass, bool CaseInsensitive)[]? leadingCharClasses = null; - (string leadingSubstring, bool leadingSubstringCI) = RegexPrefixAnalyzer.ComputeLeadingSubstring(tree); - if (leadingSubstring.Length > 1 && // if it's <= 1, perf is better using leadingCharClasses - leadingSubstring.Length <= RegexBoyerMoore.MaxLimit) - { - // Compute a Boyer-Moore prefix if we find a single string of sufficient length that always begins the expression. - CultureInfo culture = (tree.Options & RegexOptions.CultureInvariant) != 0 ? CultureInfo.InvariantCulture : CultureInfo.CurrentCulture; - boyerMoorePrefix = new RegexBoyerMoore(leadingSubstring, leadingSubstringCI, rtl, culture); - } - - // If we didn't find a single leading substring, or if we found one but we won't be able to use it for a Boyer-Moore - // search, try to compute the characters set that might begin the string. - if (boyerMoorePrefix is null || - (boyerMoorePrefix.NegativeUnicode != null && compiled)) // compilation won't use Boyer-Moore if it has a negative Unicode table - { - boyerMoorePrefix = null; - - // First we employ a less aggressive but more valuable computation to see if we can find sets for each of the first N - // characters in the string. If that's unsuccessful, we employ a more aggressive check to compute a set for just - // the first character in the string. - - if ((tree.Options & RegexOptions.Compiled) != 0) // currently not utilized by the interpreter - { - leadingCharClasses = RegexPrefixAnalyzer.ComputeMultipleCharClasses(tree, maxChars: 5); // limit of 5 is based on experimentation and can be tweaked as needed - } - - if (leadingCharClasses is null) - { - leadingCharClasses = RegexPrefixAnalyzer.ComputeFirstCharClass(tree); - } - } - - // Compute any anchors starting the expression. - int leadingAnchor = RegexPrefixAnalyzer.FindLeadingAnchor(tree); - // Convert the string table into an ordered string array. var strings = new string[_stringTable.Count]; foreach (KeyValuePair stringEntry in _stringTable) @@ -179,7 +140,7 @@ public RegexCode RegexCodeFromRegexTree(RegexTree tree) } // Return all that in a RegexCode object. - return new RegexCode(tree, emitted, strings, _trackCount, _caps, capsize, boyerMoorePrefix, leadingCharClasses, leadingAnchor, rtl); + return new RegexCode(tree, culture, emitted, strings, _trackCount, _caps, capsize); } /// @@ -233,30 +194,26 @@ private void Emit(int op, int opd1, int opd2) /// /// Returns an index in the string table for a string; - /// uses a hashtable to eliminate duplicates. + /// uses a dictionary to eliminate duplicates. /// private int StringCode(string str) { +#if REGEXGENERATOR if (!_stringTable.TryGetValue(str, out int i)) { i = _stringTable.Count; _stringTable.Add(str, i); } - +#else + ref int i = ref CollectionsMarshal.GetValueRefOrAddDefault(_stringTable, str, out bool exists); + if (!exists) + { + i = _stringTable.Count - 1; + } +#endif return i; } - /// - /// When generating code on a regex that uses a sparse set - /// of capture slots, we hash them to a dense set of indices - /// for an array of capture slots. Instead of doing the hash - /// at match time, it's done at compile time, here. - /// - private int MapCapnum(int capnum) => - capnum == -1 ? -1 : - _caps != null ? (int)_caps[capnum]! : - capnum; - /// /// The main RegexCode generator. It does a depth-first walk /// through the tree and calls EmitFragment to emits code before @@ -265,7 +222,7 @@ private int MapCapnum(int capnum) => private void EmitFragment(int nodetype, RegexNode node, int curIndex) { int bits = 0; - if (node.UseOptionR()) + if ((node.Options & RegexOptions.RightToLeft) != 0) { bits |= RegexCode.Rtl; } @@ -315,7 +272,7 @@ private void EmitFragment(int nodetype, RegexNode node, int curIndex) Emit(RegexCode.Setjump); _intStack.Append(_emitted.Length); Emit(RegexCode.Lazybranch, 0); - Emit(RegexCode.Testref, MapCapnum(node.M)); + Emit(RegexCode.Testref, RegexParser.MapCaptureNumber(node.M, _caps)); Emit(RegexCode.Forejump); break; } @@ -423,7 +380,7 @@ private void EmitFragment(int nodetype, RegexNode node, int curIndex) break; case RegexNode.Capture | AfterChild: - Emit(RegexCode.Capturemark, MapCapnum(node.M), MapCapnum(node.N)); + Emit(RegexCode.Capturemark, RegexParser.MapCaptureNumber(node.M, _caps), RegexParser.MapCaptureNumber(node.N, _caps)); break; case RegexNode.Require | BeforeChild: @@ -503,7 +460,7 @@ private void EmitFragment(int nodetype, RegexNode node, int curIndex) break; case RegexNode.Ref: - Emit(node.Type | bits, MapCapnum(node.M)); + Emit(node.Type | bits, RegexParser.MapCaptureNumber(node.M, _caps)); break; case RegexNode.Nothing: diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/BDD.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/BDD.cs index 60640e1741e8f5..5ffe1da8ce1636 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/BDD.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/BDD.cs @@ -69,6 +69,16 @@ internal sealed class BDD : IComparable /// private static readonly long[] s_trueRepresentation = new long[] { 1 }; + /// + /// Representation of False for compact serialization of BDDs. + /// + private static readonly byte[] s_falseRepresentationCompact = new byte[] { 0 }; + + /// + /// Representation of True for compact serialization of BDDs. + /// + private static readonly byte[] s_trueRepresentationCompact = new byte[] { 1 }; + internal BDD(int ordinal, BDD? one, BDD? zero) { One = one; @@ -230,6 +240,7 @@ public BDD[] TopologicalSort() /// Serializer uses more compacted representations when fewer bits are needed, which is reflected in the first /// two numbers of the return value. MTBDD terminals are represented by negated numbers as -id. /// + [ExcludeFromCodeCoverage] public long[] Serialize() { if (IsEmpty) @@ -300,6 +311,49 @@ public long[] Serialize() return res; } + /// + /// Serialize this BDD into a byte array. + /// This method is not valid for MTBDDs where some elements may be negative. + /// + public byte[] SerializeToBytes() + { + if (IsEmpty) + return s_falseRepresentationCompact; + + if (IsFull) + return s_trueRepresentationCompact; + + // in other cases make use of the general serializer to long[] + long[] serialized = Serialize(); + + // get the maximal element from the array + long m = 0; + for (int i = 0; i < serialized.Length; i++) + { + // make sure this serialization is not applied to MTBDDs + Debug.Assert(serialized[i] > 0); + m = Math.Max(serialized[i], m); + } + + // k is the number of bytes needed to represent the maximal element + int k = m <= 0xFFFF ? 2 : (m <= 0xFF_FFFF ? 3 : (m <= 0xFFFF_FFFF ? 4 : (m <= 0xFF_FFFF_FFFF ? 5 : (m <= 0xFFFF_FFFF_FFFF ? 6 : (m <= 0xFF_FFFF_FFFF_FFFF ? 7 : 8))))); + + // the result will contain k as the first element and the number of serialized elements times k + byte[] result = new byte[(k * serialized.Length) + 1]; + result[0] = (byte)k; + for (int i=0; i < serialized.Length; i += 1) + { + long serialized_i = serialized[i]; + // add the serialized longs as k-byte subsequences + for (int j = 1; j <= k; j++) + { + result[(i * k) + j] = (byte)serialized_i; + serialized_i = serialized_i >> 8; + } + } + return result; + } + /// /// Recreates a BDD from a ulong array that has been created using Serialize. /// Is executed using a lock on algebra (if algebra != null) in a single thread mode. @@ -353,6 +407,70 @@ public static BDD Deserialize(long[] arcs, BDDAlgebra algebra) return nodes[k - 1]; } + /// + /// Recreates a BDD from a byte array that has been created using SerializeToBytes. + /// + public static BDD Deserialize(byte[] bytes, BDDAlgebra algebra) + { + if (bytes.Length == 1) + { + return bytes[0] == 0 ? False : True; + } + + // here bytes represents an array of longs with k = the number of bytes used per long + int k = (int)bytes[0]; + + // gets the i'th element from the underlying array of longs represented by bytes + long Get(int i) + { + long l = 0; + for (int j = k; j > 0; j--) + { + l = (l << 8) | bytes[(k * i) + j]; + } + return l; + } + + // n is the total nr of longs that corresponds also to the total number of BDD nodes needed + int n = (bytes.Length - 1) / k; + + // make sure the represented nr of longs divides precisely without remainder + Debug.Assert((bytes.Length - 1) % k == 0); + + // the number of bits used for ordinals and node identifiers are stored in the first two longs + int ordinal_bits = (int)Get(0); + int node_bits = (int)Get(1); + + // create bit masks for the sizes of ordinals and node identifiers + long ordinal_mask = (1 << ordinal_bits) - 1; + long node_mask = (1 << node_bits) - 1; + BitLayout(ordinal_bits, node_bits, out int zero_node_shift, out int one_node_shift, out int ordinal_shift); + + // store BDD nodes by their id when they are created + BDD[] nodes = new BDD[n]; + nodes[0] = False; + nodes[1] = True; + + for (int i = 2; i < n; i++) + { + // represents the triple (ordinal, one, zero) + long arc = Get(i); + + // reconstruct the ordinal and child identifiers for a non-terminal + int ord = (int)((arc >> ordinal_shift) & ordinal_mask); + int oneId = (int)((arc >> one_node_shift) & node_mask); + int zeroId = (int)((arc >> zero_node_shift) & node_mask); + + // the BDD nodes for the children are guaranteed to exist already + // because of the topological order they were serialized by + Debug.Assert(oneId < i && zeroId < i); + nodes[i] = algebra.GetOrCreateBDD(ord, nodes[oneId], nodes[zeroId]); + } + + //the result is the last BDD in the nodes array + return nodes[n - 1]; + } + /// /// Use this bit layout in the serialization /// diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/BDDAlgebra.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/BDDAlgebra.cs index 5096efe35ce6df..41e6b889382e16 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/BDDAlgebra.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/BDDAlgebra.cs @@ -288,7 +288,7 @@ private BDD ShiftLeftImpl(Dictionary<(BDD set, int k), BDD> shiftCache, BDD set, /// /// the BDDs to create the minterms for /// BDDs for the minterm - public List GenerateMinterms(params BDD[] sets) => _mintermGen.GenerateMinterms(sets); + public List GenerateMinterms(IEnumerable sets) => _mintermGen.GenerateMinterms(sets); /// /// Make a set containing all integers whose bits up to maxBit equal n. diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/BV64Algebra.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/BV64Algebra.cs index 1022ebd015bcd7..adc535694eff81 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/BV64Algebra.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/BV64Algebra.cs @@ -55,7 +55,7 @@ public BV64Algebra(CharSetSolver solver, BDD[] minterms) : public bool AreEquivalent(ulong predicate1, ulong predicate2) => predicate1 == predicate2; - public List GenerateMinterms(params ulong[] constraints) => _mintermGenerator.GenerateMinterms(constraints); + public List GenerateMinterms(IEnumerable constraints) => _mintermGenerator.GenerateMinterms(constraints); [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool IsSatisfiable(ulong predicate) => predicate != _false; diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/BVAlgebra.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/BVAlgebra.cs index 6402af52b3d743..08ad0face5de05 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/BVAlgebra.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/BVAlgebra.cs @@ -78,7 +78,7 @@ public BVAlgebra(CharSetSolver solver, BDD[] minterms) : public bool HashCodesRespectEquivalence => true; public CharSetSolver CharSetProvider => throw new NotSupportedException(); public bool AreEquivalent(BV predicate1, BV predicate2) => predicate1.Equals(predicate2); - public List GenerateMinterms(params BV[] constraints) => _mintermGenerator.GenerateMinterms(constraints); + public List GenerateMinterms(IEnumerable constraints) => _mintermGenerator.GenerateMinterms(constraints); [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool IsSatisfiable(BV predicate) => !predicate.Equals(False); diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/CharSetSolver.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/CharSetSolver.cs index ae846f5e714b30..374aca296f5182 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/CharSetSolver.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/CharSetSolver.cs @@ -12,8 +12,8 @@ namespace System.Text.RegularExpressions.Symbolic /// internal sealed class CharSetSolver : BDDAlgebra, ICharAlgebra { - /// BDDs for all characters for fast lookup. - private readonly BDD[] _charPredTable = new BDD[char.MaxValue + 1]; + /// BDDs for all ASCII characters for fast lookup. + private readonly BDD[] _charPredTable = new BDD[128]; private readonly Unicode.IgnoreCaseTransformer _ignoreCase; internal readonly BDD _nonAscii; @@ -40,10 +40,23 @@ public BDD CharConstraint(char c, bool ignoreCase = false, string? culture = nul else { //individual character BDDs are always fixed - return _charPredTable[c] ??= CreateSetFrom(c, 15); + BDD[] charPredTable = _charPredTable; + return c < charPredTable.Length ? + charPredTable[c] ??= CreateBDDFromChar(c) : + CreateBDDFromChar(c); } } + private BDD CreateBDDFromChar(ushort c) + { + BDD bdd = BDD.True; + for (int k = 0; k < 16; k++) + { + bdd = (c & (1 << k)) == 0 ? GetOrCreateBDD(k, BDD.False, bdd) : GetOrCreateBDD(k, bdd, BDD.False); + } + return bdd; + } + /// /// Make a CharSet from all the characters in the range from m to n. /// Returns the empty set if n is less than m diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/IBooleanAlgebra.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/IBooleanAlgebra.cs index 336871a5aa2ec3..1747b69ad1c32d 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/IBooleanAlgebra.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/IBooleanAlgebra.cs @@ -78,8 +78,8 @@ internal interface IBooleanAlgebra /// where c'_i = c_i if b_i = true and c'_i is Not(c_i) otherwise. /// If n=0 return Tuple({},True) /// - /// array of constraints + /// constraints /// constraints that are satisfiable - List GenerateMinterms(params T[] constraints); + List GenerateMinterms(IEnumerable constraints); } } diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/MintermGenerator.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/MintermGenerator.cs index 364282fc32a9c0..42ad4a139f4236 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/MintermGenerator.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Algebras/MintermGenerator.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -using System.Runtime.CompilerServices; using System.Threading; namespace System.Text.RegularExpressions.Symbolic @@ -39,199 +38,64 @@ public MintermGenerator(IBooleanAlgebra algebra) /// /// array of predicates /// all minterms of the given predicate sequence - public List GenerateMinterms(params TPredicate[] preds) + public List GenerateMinterms(IEnumerable preds) { - if (preds.Length == 0) + var tree = new PartitionTree(_algebra.True); + foreach (TPredicate pred in preds) { - return new List { _algebra.True }; + // Push each predicate into the partition tree + tree.Refine(_algebra, pred); } - - // The minterms will be solved using non-equivalent predicates, i.e., the equivalence classes of preds. The - // following code maps each predicate to an equivalence class and also stores for each equivalence class the - // predicates belonging to it, so that a valuation for the original predicates may be reconstructed. - - var tree = new PartitionTree(_algebra); - - var seen = new HashSet(); - for (int i = 0; i < preds.Length; i++) - { - // Use a wrapper that overloads Equals to be logical equivalence as the key - if (seen.Add(new EquivalenceClass(_algebra, preds[i]))) - { - // Push each equivalence class into the partition tree - tree.Refine(preds[i]); - } - } - // Return all minterms as the leaves of the partition tree return tree.GetLeafPredicates(); } - /// Wraps a predicate as an equivalence class object whose Equals method is equivalence checking. - private readonly struct EquivalenceClass - { - private readonly TPredicate _set; - private readonly IBooleanAlgebra _algebra; - - internal EquivalenceClass(IBooleanAlgebra algebra, TPredicate set) - { - _set = set; - _algebra = algebra; - } - - public override int GetHashCode() => _set.GetHashCode(); - - public override bool Equals([NotNullWhen(true)] object? obj) => obj is EquivalenceClass ec && _algebra.AreEquivalent(_set, ec._set); - } - /// A partition tree for efficiently solving minterms. /// /// Predicates are pushed into the tree with Refine(), which creates leaves in the tree for all satisfiable /// and non-overlapping combinations with any previously pushed predicates. At the end of the process the - /// minterms can be read from the paths to the leaves of the tree. - /// - /// The valuations of the predicates are represented as follows. Given a path a^-1, a^0, a^1, ..., a^n, predicate - /// p^i is true in the corresponding minterm if and only if a^i is the left child of a^i-1. - /// - /// This class assumes that all predicates passed to Refine() are non-equivalent. + /// minterms can be read from the leaves of the tree. /// private sealed class PartitionTree { internal readonly TPredicate _pred; - private readonly IBooleanAlgebra _solver; private PartitionTree? _left; - private PartitionTree? _right; // complement + private PartitionTree? _right; - /// Create the root of the partition tree. - /// Nodes below this will be indexed starting from 0. The initial predicate is true. - internal PartitionTree(IBooleanAlgebra solver) : this(solver, solver.True, null, null) { } - - private PartitionTree(IBooleanAlgebra solver, TPredicate pred, PartitionTree? left, PartitionTree? right) + internal PartitionTree(TPredicate pred) { - _solver = solver; _pred = pred; - _left = left; - _right = right; } - internal void Refine(TPredicate other) + internal void Refine(IBooleanAlgebra solver, TPredicate other) { if (!StackHelper.TryEnsureSufficientExecutionStack()) { - StackHelper.CallOnEmptyStack(Refine, other); + StackHelper.CallOnEmptyStack(Refine, solver, other); return; } - if (_left is null && _right is null) + TPredicate thisAndOther = solver.And(_pred, other); + if (solver.IsSatisfiable(thisAndOther)) { - // If this is a leaf node create left and/or right children for the new predicate - TPredicate thisAndOther = _solver.And(_pred, other); - if (_solver.IsSatisfiable(thisAndOther)) + // The predicates overlap, now check if this is contained in other + TPredicate thisMinusOther = solver.And(_pred, solver.Not(other)); + if (solver.IsSatisfiable(thisMinusOther)) { - // The predicates overlap, now check if this is contained in other - TPredicate thisMinusOther = _solver.And(_pred, _solver.Not(other)); - if (_solver.IsSatisfiable(thisMinusOther)) + // This is not contained in other, minterms may need to be split + if (_left is null) { - // This is not contained in other, both children are needed - _left = new PartitionTree(_solver, thisAndOther, null, null); - - // The right child corresponds to a conjunction with a negation, which matches thisMinusOther - _right = new PartitionTree(_solver, thisMinusOther, null, null); + Debug.Assert(_right is null); + _left = new PartitionTree(thisAndOther); + _right = new PartitionTree(thisMinusOther); } - else // [[this]] subset of [[other]] + else { - // Other implies this, so populate the left child with this - _left = new PartitionTree(_solver, _pred, null, null); + Debug.Assert(_right is not null); + _left.Refine(solver, other); + _right.Refine(solver, other); } } - else // [[this]] subset of [[not(other)]] - { - // negation of other implies this, so populate the right child with this - _right = new PartitionTree(_solver, _pred, null, null); //other must be false - } - } - else if (_left is null) - { - // No choice has to be made here, refine the single child that exists - _right!.Refine(other); - } - else if (_right is null) - { - // No choice has to be made here, refine the single child that exists - _left!.Refine(other); - } - else - { - TPredicate thisAndOther = _solver.And(_pred, other); - if (_solver.IsSatisfiable(thisAndOther)) - { - // Other is satisfiable in this subtree - TPredicate thisMinusOther = _solver.And(_pred, _solver.Not(other)); - if (_solver.IsSatisfiable(thisMinusOther)) - { - // But other does not imply this whole subtree, refine both children - _left.Refine(other); - _right.Refine(other); - } - else // [[this]] subset of [[other]] - { - // And other implies the whole subtree, include it in all minterms under here - _left.ExtendLeft(); - _right.ExtendLeft(); - } - } - else // [[this]] subset of [[not(other)]] - { - // Other is not satisfiable in this subtree, include its negation in all minterms under here - _left.ExtendRight(); - _right.ExtendRight(); - } - } - } - - /// - /// Include the next predicate in all minterms under this node. Assumes the next predicate implies the predicate - /// of this node. - /// - private void ExtendLeft() - { - if (!StackHelper.TryEnsureSufficientExecutionStack()) - { - StackHelper.CallOnEmptyStack(ExtendLeft); - return; - } - - if (_left is null && _right is null) - { - _left = new PartitionTree(_solver, _pred, null, null); - } - else - { - _left?.ExtendLeft(); - _right?.ExtendLeft(); - } - } - - /// - /// Include the negation of next predicate in all minterms under this node. Assumes the negation of the next - /// predicate implies the predicate of this node. - /// - private void ExtendRight() - { - if (!StackHelper.TryEnsureSufficientExecutionStack()) - { - StackHelper.CallOnEmptyStack(ExtendRight); - return; - } - - if (_left is null && _right is null) - { - _right = new PartitionTree(_solver, _pred, null, null); - } - else - { - _left?.ExtendRight(); - _right?.ExtendRight(); } } @@ -250,15 +114,9 @@ internal List GetLeafPredicates() } else { - if (node._left is not null) - { - stack.Push(node._left); - } - - if (node._right is not null) - { - stack.Push(node._right); - } + Debug.Assert(node._left is not null && node._right is not null); + stack.Push(node._left); + stack.Push(node._right); } } diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/CharKind.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/CharKind.cs index 39f95920da31b3..1952a7dcd1e006 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/CharKind.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/CharKind.cs @@ -29,9 +29,12 @@ internal static class CharKind /// Gets the next character kind from a context internal static uint Next(uint context) => context >> 3; - /// Creates the context of the previous and the next character kinds. + /// Encodes the pair (prevKind, nextKind) using 6 bits internal static uint Context(uint prevKind, uint nextKind) => (nextKind << 3) | prevKind; + /// Exclusive maximum context (limit) is 64 because a context uses bit-shifting where each kind needs 3 bits. + internal const int ContextLimit = 64; + internal static string DescribePrev(uint i) => i switch { StartStop => @"\A", diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexBuilder.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexBuilder.cs index bf75d21a05fcff..1fec095c54b105 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexBuilder.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexBuilder.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Diagnostics; -using System.Runtime.CompilerServices; using System.Threading; namespace System.Text.RegularExpressions.Symbolic @@ -406,7 +405,6 @@ private DfaMatchingState MakeNewState(DfaMatchingState state lock (this) { state.Id = _stateCache.Count; - int k = state.GetHashCode(); _stateCache.Add(state); Debug.Assert(_statearray is not null); diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexInfo.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexInfo.cs index 3bd803e47f3388..ba522d513392c7 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexInfo.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexInfo.cs @@ -19,28 +19,6 @@ internal readonly struct SymbolicRegexInfo private SymbolicRegexInfo(uint i) => _info = i; - /// Optimized lookup array for most common combinations. - /// Most common cases will be 0 (no anchors and not nullable) and 1 (no anchors and nullable) - private static readonly SymbolicRegexInfo[] s_infos = CreateSymbolicRegexInfos(); - - private static SymbolicRegexInfo[] CreateSymbolicRegexInfos() - { - var infos = new SymbolicRegexInfo[128]; - for (uint i = 0; i < infos.Length; i++) - { - infos[i] = new SymbolicRegexInfo(i); - } - return infos; - } - - private static SymbolicRegexInfo Mk(uint i) - { - SymbolicRegexInfo[] infos = s_infos; - return i < infos.Length ? - infos[i] : - new SymbolicRegexInfo(i); - } - internal static SymbolicRegexInfo Mk(bool isAlwaysNullable = false, bool canBeNullable = false, bool startsWithLineAnchor = false, bool startsWithBoundaryAnchor = false, bool containsSomeAnchor = false, bool containsLineAnchor = false, bool containsSomeCharacter = false, bool isLazy = true) @@ -87,7 +65,7 @@ internal static SymbolicRegexInfo Mk(bool isAlwaysNullable = false, bool canBeNu i |= IsLazyMask; } - return Mk(i); + return new SymbolicRegexInfo(i); } public bool IsNullable => (_info & IsAlwaysNullableMask) != 0; @@ -121,7 +99,7 @@ public static SymbolicRegexInfo Or(SymbolicRegexInfo[] infos) } i = (i & ~IsLazyMask) | isLazy; - return Mk(i); + return new SymbolicRegexInfo(i); } public static SymbolicRegexInfo And(params SymbolicRegexInfo[] infos) @@ -140,7 +118,7 @@ public static SymbolicRegexInfo And(params SymbolicRegexInfo[] infos) i = (i & ~IsLazyMask) | isLazy; i = (i & ~(IsAlwaysNullableMask | CanBeNullableMask)) | isNullable; - return Mk(i); + return new SymbolicRegexInfo(i); } public static SymbolicRegexInfo Concat(SymbolicRegexInfo left_info, SymbolicRegexInfo right_info) @@ -164,7 +142,10 @@ public static SymbolicRegexInfo Loop(SymbolicRegexInfo body_info, int lowerBound uint i = body_info._info; // The loop is nullable if either the body is nullable or if the lower boud is 0 - i |= lowerBound == 0 ? (IsAlwaysNullableMask | CanBeNullableMask) : 0; + if (lowerBound == 0) + { + i |= IsAlwaysNullableMask | CanBeNullableMask; + } // The loop is lazy iff it is marked lazy if (isLazy) @@ -176,7 +157,7 @@ public static SymbolicRegexInfo Loop(SymbolicRegexInfo body_info, int lowerBound i &= ~IsLazyMask; } - return Mk(i); + return new SymbolicRegexInfo(i); } public static SymbolicRegexInfo Not(SymbolicRegexInfo info) => diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexMatcher.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexMatcher.cs index ac56fd972d0cf1..21c023345c7315 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexMatcher.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexMatcher.cs @@ -11,15 +11,8 @@ namespace System.Text.RegularExpressions.Symbolic { /// Represents a regex matching engine that performs regex matching using symbolic derivatives. - internal abstract class SymbolicRegexMatcher + internal interface ISymbolicRegexMatcher { - /// Returns the next match index and length in the input string. - /// Whether to return once we know there's a match without determining where exactly it matched. - /// The input string. - /// The start position in the input. - /// The end position in the input. - public abstract SymbolicMatch FindMatch(bool isMatch, string input, int startat, int endat); - #if DEBUG /// Unwind the regex of the matcher and save the resulting state graph in DGML /// roughly the maximum number of states, 0 means no bound @@ -30,8 +23,7 @@ internal abstract class SymbolicRegexMatcher /// dgml output is written here /// maximum length of labels in nodes anything over that length is indicated with .. /// if true creates NFA instead of DFA - public abstract void SaveDGML(TextWriter writer, int bound, bool hideStateInfo, bool addDotStar, bool inReverse, bool onlyDFAinfo, int maxLabelLength, bool asNFA); - + void SaveDGML(TextWriter writer, int bound, bool hideStateInfo, bool addDotStar, bool inReverse, bool onlyDFAinfo, int maxLabelLength, bool asNFA); /// /// Generates up to k random strings matched by the regex @@ -40,13 +32,13 @@ internal abstract class SymbolicRegexMatcher /// random seed for the generator, 0 means no random seed /// if true then generate inputs that do not match /// - public abstract IEnumerable GenerateRandomMembers(int k, int randomseed, bool negative); + IEnumerable GenerateRandomMembers(int k, int randomseed, bool negative); #endif } /// Represents a regex matching engine that performs regex matching using symbolic derivatives. /// Character set type. - internal sealed class SymbolicRegexMatcher : SymbolicRegexMatcher where TSetType : notnull + internal sealed class SymbolicRegexMatcher : ISymbolicRegexMatcher where TSetType : notnull { /// Maximum number of states before switching over to Antimirov mode. /// @@ -127,54 +119,24 @@ internal sealed class SymbolicRegexMatcher : SymbolicRegexMatcher wher /// Timeout in milliseconds. This is only used if is true. private readonly int _timeout; - /// Classifier used to say whether a particular character can start a match for . - internal readonly BooleanClassifier _startSetClassifier; - - /// Predicate over characters that make some progress - private readonly TSetType _startSet; - - /// Maximum allowed size of . - private const int StartSetArrayMaxSize = 5; - - /// String of at most many characters - private readonly char[] _startSetArray; - - /// Number of elements in - private readonly int _startSetSize; - - /// If nonempty then has that fixed prefix - private readonly string _prefix; + /// Data and routines for skipping ahead to the next place a match could potentially start. + private readonly RegexFindOptimizations? _findOpts; - /// Non-null when is nonempty - private readonly RegexBoyerMoore? _prefixBoyerMoore; + /// The initial states for the original pattern, keyed off of the previous character kind. + /// If the pattern doesn't contain any anchors, there will only be a single initial state. + private readonly DfaMatchingState[] _initialStates; - /// If true then the fixed prefix of is idependent of case - private readonly bool _isPrefixCaseInsensitive; + /// The initial states for the dot-star pattern, keyed off of the previous character kind. + /// If the pattern doesn't contain any anchors, there will only be a single initial state. + private readonly DfaMatchingState[] _dotstarredInitialStates; - /// Cached skip states from the initial state of for the 5 possible previous character kinds. - private readonly DfaMatchingState?[] _prefixSkipStates = new DfaMatchingState[CharKind.CharKindCount]; - /// Cached skip states from the initial state of Ar for the 5 possible previous character kinds. - private readonly DfaMatchingState?[] _reversePrefixSkipStates = new DfaMatchingState[CharKind.CharKindCount]; + /// The initial states for the reverse pattern, keyed off of the previous character kind. + /// If the pattern doesn't contain any anchors, there will only be a single initial state. + private readonly DfaMatchingState[] _reverseInitialStates; - private readonly string _reversePrefix; - - private readonly DfaMatchingState[] _initialStates = new DfaMatchingState[CharKind.CharKindCount]; - private readonly DfaMatchingState[] _dotstarredInitialStates = new DfaMatchingState[CharKind.CharKindCount]; - private readonly DfaMatchingState[] _reverseInitialStates = new DfaMatchingState[CharKind.CharKindCount]; - - private readonly uint[] _asciiCharKinds = new uint[128]; - - internal readonly CultureInfo _culture; - - private DfaMatchingState GetSkipState(uint prevCharKind) => - Volatile.Read(ref _prefixSkipStates[prevCharKind]) ?? - Interlocked.CompareExchange(ref _prefixSkipStates[prevCharKind], DeltaPlus(_prefix, _dotstarredInitialStates[prevCharKind]), null) ?? - _prefixSkipStates[prevCharKind]!; - - private DfaMatchingState GetReverseSkipState(uint prevCharKind) => - Volatile.Read(ref _reversePrefixSkipStates[prevCharKind]) ?? - Interlocked.CompareExchange(ref _reversePrefixSkipStates[prevCharKind], DeltaPlus(_reversePrefix, _reverseInitialStates[prevCharKind]), null) ?? - _reversePrefixSkipStates[prevCharKind]!; + /// Lookup table to quickly determine the character kind for ASCII characters. + /// Non-null iff the pattern contains anchors; otherwise, it's unused. + private readonly uint[]? _asciiCharKinds; /// Get the minterm of . /// character code @@ -186,16 +148,14 @@ private TSetType GetMinterm(int c) } /// Constructs matcher for given symbolic regex. - internal SymbolicRegexMatcher(SymbolicRegexNode sr, CharSetSolver css, BDD[] minterms, TimeSpan matchTimeout, CultureInfo culture) + internal SymbolicRegexMatcher(SymbolicRegexNode sr, RegexCode code, CharSetSolver css, BDD[] minterms, TimeSpan matchTimeout, CultureInfo culture) { + Debug.Assert(sr._builder._solver is BV64Algebra or BVAlgebra or CharSetSolver, $"Unsupported algebra: {sr._builder._solver}"); + _pattern = sr; _builder = sr._builder; - _checkTimeout = Regex.InfiniteMatchTimeout != matchTimeout; _timeout = (int)(matchTimeout.TotalMilliseconds + 0.5); // Round up, so it will be at least 1ms - _culture = culture; - - Debug.Assert(_builder._solver is BV64Algebra or BVAlgebra or CharSetSolver, $"Unsupported algebra: {_builder._solver}"); _partitions = _builder._solver switch { BV64Algebra bv64 => bv64._classifier, @@ -203,44 +163,57 @@ internal SymbolicRegexMatcher(SymbolicRegexNode sr, CharSetSolver css, _ => new MintermClassifier((CharSetSolver)(object)_builder._solver, minterms), }; - _dotStarredPattern = _builder.MkConcat(_builder._anyStar, _pattern); - _reversePattern = _pattern.Reverse(); - ConfigureRegexes(); - - _startSet = _pattern.GetStartSet(); - if (!_builder._solver.IsSatisfiable(_startSet) || _pattern.CanBeNullable) + if (code.FindOptimizations.FindMode != FindNextStartingPositionMode.NoSearch && + code.FindOptimizations.LeadingAnchor == 0) // If there are any anchors, we're better off letting the DFA quickly do its job of determining whether there's a match. { - // If the startset is empty make it full instead by including all characters - // this is to ensure that startset is nonempty -- as an invariant assumed by operations using it - // - // Also, if A can be nullable then effectively disable use of startset by making it true - // because it may force search of next character in startset and fail to recognize an empty match - // because (by definition) an empty match has no start character. - // - // For example (this is also a unit test): - // for pattern "\B\W*?" or "\B\W*" or "\B\W?" and input "e.g:abc" there is an empty match in position 5 - // but startset \W will force search beyond position 5 and fails to find that match - _startSet = _builder._solver.True; + _findOpts = code.FindOptimizations; } - _startSetSize = (int)_builder._solver.ComputeDomainSize(_startSet); + // Determine the number of initial states. If there's no anchor, only the default previous + // character kind 0 is ever going to be used for all initial states. + int statesCount = _pattern._info.ContainsSomeAnchor ? CharKind.CharKindCount : 1; - BDD startbdd = _builder._solver.ConvertToCharSet(css, _startSet); - _startSetClassifier = new BooleanClassifier(css, startbdd); - - //store the start characters in the A_startset_array if there are not too many characters - _startSetArray = _startSetSize <= StartSetArrayMaxSize ? - new List(css.GenerateAllCharacters(startbdd)).ToArray() : - Array.Empty(); + // Create the initial states for the original pattern. + var initialStates = new DfaMatchingState[statesCount]; + for (uint i = 0; i < initialStates.Length; i++) + { + initialStates[i] = _builder.MkState(_pattern, i); + } + _initialStates = initialStates; - _prefix = _pattern.GetFixedPrefix(css, culture.Name, out _isPrefixCaseInsensitive); - _reversePrefix = _reversePattern.GetFixedPrefix(css, culture.Name, out _); + // Create the dot-star pattern (a concatenation of any* with the original pattern) + // and all of its initial states. + _dotStarredPattern = _builder.MkConcat(_builder._anyStar, _pattern); + var dotstarredInitialStates = new DfaMatchingState[statesCount]; + for (uint i = 0; i < dotstarredInitialStates.Length; i++) + { + // Used to detect if initial state was reentered, + // but observe that the behavior from the state may ultimately depend on the previous + // input char e.g. possibly causing nullability of \b or \B or of a start-of-line anchor, + // in that sense there can be several "versions" (not more than StateCount) of the initial state. + DfaMatchingState state = _builder.MkState(_dotStarredPattern, i); + state.IsInitialState = true; + dotstarredInitialStates[i] = state; + } + _dotstarredInitialStates = dotstarredInitialStates; - _prefixBoyerMoore = InitializePrefixBoyerMoore(); + // Create the reverse pattern (the original pattern in reverse order) and all of its + // initial states. + _reversePattern = _pattern.Reverse(); + var reverseInitialStates = new DfaMatchingState[statesCount]; + for (uint i = 0; i < reverseInitialStates.Length; i++) + { + reverseInitialStates[i] = _builder.MkState(_reversePattern, i); + } + _reverseInitialStates = reverseInitialStates; + // Initialize our fast-lookup for determining the character kind of ASCII characters. + // This is only required when the pattern contains anchors, as otherwise there's only + // ever a single kind used. if (_pattern._info.ContainsSomeAnchor) { - for (int i = 0; i < 128; i++) + var asciiCharKinds = new uint[128]; + for (int i = 0; i < asciiCharKinds.Length; i++) { TSetType predicate2; uint charKind; @@ -256,68 +229,12 @@ internal SymbolicRegexMatcher(SymbolicRegexNode sr, CharSetSolver css, charKind = CharKind.WordLetter; } - _asciiCharKinds[i] = _builder._solver.And(GetMinterm(i), predicate2).Equals(_builder._solver.False) ? 0 : charKind; + asciiCharKinds[i] = _builder._solver.And(GetMinterm(i), predicate2).Equals(_builder._solver.False) ? 0 : charKind; } + _asciiCharKinds = asciiCharKinds; } } - private RegexBoyerMoore? InitializePrefixBoyerMoore() - { - if (_prefix != string.Empty && _prefix.Length <= RegexBoyerMoore.MaxLimit && _prefix.Length > 1) - { - // RegexBoyerMoore expects the prefix to be lower case when case is ignored. - // Use the culture of the matcher. - string prefix = _isPrefixCaseInsensitive ? _prefix.ToLower(_culture) : _prefix; - return new RegexBoyerMoore(prefix, _isPrefixCaseInsensitive, rightToLeft: false, _culture); - } - - return null; - } - - private void ConfigureRegexes() - { - void Configure(uint i) - { - _initialStates[i] = _builder.MkState(_pattern, i); - - // Used to detect if initial state was reentered, then startset can be triggered - // but observe that the behavior from the state may ultimately depend on the previous - // input char e.g. possibly causing nullability of \b or \B or of a start-of-line anchor, - // in that sense there can be several "versions" (not more than StateCount) of the initial state. - _dotstarredInitialStates[i] = _builder.MkState(_dotStarredPattern, i); - _dotstarredInitialStates[i].IsInitialState = true; - - _reverseInitialStates[i] = _builder.MkState(_reversePattern, i); - } - - // Create initial states for A, A1 and Ar. - if (!_pattern._info.ContainsSomeAnchor) - { - // Only the default previous character kind 0 is ever going to be used for all initial states. - // _A1q0[0] is recognized as special initial state. - // This information is used for search optimization based on start set and prefix of A. - Configure(0); - } - else - { - for (uint i = 0; i < CharKind.CharKindCount; i++) - { - Configure(i); - } - } - } - - /// Return the state after the given string from the given state . - private DfaMatchingState DeltaPlus(string pattern, DfaMatchingState state) where TTransition : struct, ITransition - { - for (int i = 0; i < pattern.Length; i++) - { - state = Delta(pattern, i, state); - } - - return state; - } - /// Interface for transitions used by the method. private interface ITransition { @@ -341,7 +258,7 @@ private DfaMatchingState Delta(string input, int i, DfaMa minterms.Length : // mintermId = minterms.Length represents \Z (last \n) _partitions.GetMintermID(c); - TSetType minterm = (uint)mintermId < minterms.Length ? + TSetType minterm = (uint)mintermId < (uint)minterms.Length ? minterms[mintermId] : _builder._solver.False; // minterm=False represents \Z @@ -359,9 +276,7 @@ public DfaMatchingState TakeTransition( Debug.Assert(builder._delta is not null); int offset = (currentState.Id << builder._mintermsCount) | mintermId; - return - builder._delta[offset] ?? - matcher.CreateNewTransition(currentState, minterm, offset); + return Volatile.Read(ref builder._delta[offset]) ?? matcher.CreateNewTransition(currentState, minterm, offset); } } @@ -391,7 +306,7 @@ public DfaMatchingState TakeTransition( DfaMatchingState nextStates = builder.MkState(oneState, currentStates.PrevCharKind); int offset = (nextStates.Id << builder._mintermsCount) | mintermId; - DfaMatchingState p = builder._delta[offset] ?? matcher.CreateNewTransition(nextStates, minterm, offset); + DfaMatchingState p = Volatile.Read(ref builder._delta[offset]) ?? matcher.CreateNewTransition(nextStates, minterm, offset); // Observe that if p.Node is an Or it will be flattened. union = builder.MkOr2(union, p.Node); @@ -430,30 +345,21 @@ private DfaMatchingState CreateNewTransition(DfaMatchingState timeoutOccursAt && 0 < currentMillis) - return; - - //regex pattern is in general not available in srm and - //the input is not available here but could be passed as argument to DoCheckTimeout - throw new RegexMatchTimeoutException(string.Empty, string.Empty, TimeSpan.FromMilliseconds(_timeout)); + if (currentMillis >= timeoutOccursAt && (0 <= timeoutOccursAt || 0 >= currentMillis)) + { + throw new RegexMatchTimeoutException(string.Empty, string.Empty, TimeSpan.FromMilliseconds(_timeout)); + } } /// Find a match. /// Whether to return once we know there's a match without determining where exactly it matched. - /// input string - /// the position to start search in the input string - /// the next position after the end position in the input - public override SymbolicMatch FindMatch(bool isMatch, string input, int startat, int k) + /// The input string + /// The position to start search in the input string. + /// The non-inclusive position to end the search in the input string. + public SymbolicMatch FindMatch(bool isMatch, string input, int startat, int end) { int timeoutOccursAt = 0; if (_checkTimeout) @@ -462,18 +368,16 @@ public override SymbolicMatch FindMatch(bool isMatch, string input, int startat, timeoutOccursAt = Environment.TickCount + (int)(_timeout + 0.5); } - if (startat == k) + if (startat == end) { - //covers the special case when the remaining input suffix - //where a match is sought is empty (for example when the input is empty) - //in this case the only possible match is an empty match + // Covers the special-case of an empty match at the end of the input. uint prevKind = GetCharKind(input, startat - 1); uint nextKind = GetCharKind(input, startat); bool emptyMatchExists = _pattern.IsNullableFor(CharKind.Context(prevKind, nextKind)); - return - !emptyMatchExists ? SymbolicMatch.NoMatch : - new SymbolicMatch(startat, 0); + return emptyMatchExists ? + new SymbolicMatch(startat, 0) : + SymbolicMatch.NoMatch; } // Find the first accepting state. Initial start position in the input is i == 0. @@ -481,7 +385,7 @@ public override SymbolicMatch FindMatch(bool isMatch, string input, int startat, // May return -1 as a legitimate value when the initial state is nullable and startat == 0. // Returns NoMatchExists when there is no match. - i = FindFinalStatePosition(input, k, i, timeoutOccursAt, out int i_q0_A1, out int watchdog); + i = FindFinalStatePosition(input, end, i, timeoutOccursAt, out int i_q0_A1, out int watchdog); if (i == NoMatchExists) { @@ -504,24 +408,17 @@ public override SymbolicMatch FindMatch(bool isMatch, string input, int startat, } else { - if (i < startat) - { - Debug.Assert(i == startat - 1); - i_start = startat; - } - else - { - // Walk in reverse to locate the start position of the match - i_start = FindStartPosition(input, i, i_q0_A1); - } - - i_end = FindEndPosition(input, k, i_start); + Debug.Assert(i >= startat - 1); + i_start = i < startat ? + startat : + FindStartPosition(input, i, i_q0_A1); // Walk in reverse to locate the start position of the match + i_end = FindEndPosition(input, end, i_start); } return new SymbolicMatch(i_start, i_end + 1 - i_start); } - /// Find match end position using A, end position is known to exist. + /// Find match end position using the original pattern, end position is known to exist. /// input array /// inclusive start position /// exclusive end position @@ -563,7 +460,7 @@ private int FindEndPosition(string input, int exclusiveEnd, int i) return i_end; } - // Inner loop for FindEndPosition parameterized by an ITransition type. + /// Inner loop for FindEndPosition parameterized by an ITransition type. [MethodImpl(MethodImplOptions.AggressiveInlining)] private bool FindEndPositionDeltas(string input, ref int i, int j, ref DfaMatchingState q, ref int i_end) where TTransition : struct, ITransition { @@ -584,7 +481,7 @@ private bool FindEndPositionDeltas(string input, ref int i, int j, } else if (q.IsDeadend) { - // Nonaccepting sink state (deadend) has been reached in A. + // Non-accepting sink state (deadend) has been reached in the original pattern. // So the match ended when the last i_end was updated. return true; } @@ -596,26 +493,18 @@ private bool FindEndPositionDeltas(string input, ref int i, int j, return false; } - /// Walk back in reverse using Ar to find the start position of match, start position is known to exist. + /// Walk back in reverse using the reverse pattern to find the start position of match, start position is known to exist. /// the input string /// position to start walking back from, i points at the last character of the match /// do not pass this boundary when walking back /// private int FindStartPosition(string input, int i, int match_start_boundary) { - // Fetch the correct start state for Ar. + // Fetch the correct start state for the reverse pattern. // This depends on previous character --- which, because going backwards, is character number i+1. uint prevKind = GetCharKind(input, i + 1); DfaMatchingState q = _reverseInitialStates[prevKind]; - // Ar may have a fixed prefix sequence - if (_reversePrefix.Length > 0) - { - //skip past the prefix portion of Ar - q = GetReverseSkipState(prevKind); - i -= _reversePrefix.Length; - } - if (i == -1) { Debug.Assert(q.IsNullable(GetCharKind(input, i)), "we reached the beginning of the input, thus the state q must be accepting"); @@ -625,12 +514,12 @@ private int FindStartPosition(string input, int i, int match_start_boundary) int last_start = -1; if (q.IsNullable(GetCharKind(input, i))) { - // The whole prefix of Ar was in reverse a prefix of A, - // for example when the pattern of A is concrete word such as "abc" + // The whole prefix of the reverse pattern was in reverse a prefix of the original pattern, + // for example when the original pattern is concrete word such as "abc" last_start = i + 1; } - //walk back to the accepting state of Ar + // Walk back to the accepting state of the reverse pattern while (i >= match_start_boundary) { int j = Math.Max(match_start_boundary, i - AntimirovThresholdLeeway); @@ -665,7 +554,7 @@ private bool FindStartPositionDeltas(string input, ref int i, int j if (q.IsNullable(GetCharKind(input, i - 1))) { // Earliest start point so far. This must happen at some point - // or else A1 would not have reached a final state after match_start_boundary. + // or else the dot-star pattern would not have reached a final state after match_start_boundary. last_start = i; } @@ -685,7 +574,7 @@ private bool FindStartPositionDeltas(string input, ref int i, int j /// length of match when positive private int FindFinalStatePosition(string input, int k, int i, int timeoutOccursAt, out int initialStateIndex, out int watchdog) { - // Get the correct start state of A1, which in general depends on the previous character kind in the input. + // Get the correct start state of the dot-star pattern, which in general depends on the previous character kind in the input. uint prevCharKindId = GetCharKind(input, i - 1); DfaMatchingState q = _dotstarredInitialStates[prevCharKindId]; initialStateIndex = i; @@ -714,53 +603,13 @@ private int FindFinalStatePosition(string input, int k, int i, int timeoutOccurs { if (q.IsInitialState) { - // i_q0_A1 is the most recent position in the input when A1 is in the initial state + // i_q0_A1 is the most recent position in the input when the dot-star pattern is in the initial state initialStateIndex = i; - if (_prefixBoyerMoore != null) - { - // Stay in the initial state if the prefix does not match. - // Thus advance the current position to the first position where the prefix does match. - i = _prefixBoyerMoore.Scan(input, i, 0, input.Length); - - if (i == -1) // Scan returns -1 when a matching position does not exist - { - watchdog = -1; - return -2; - } - - // Compute the end state for the A prefix. - // Skip directly to the resulting state - // --- i.e. do the loop --- - // for (int j = 0; j < prefix.Length; j++) - // q = Delta(prefix[j], q, out regex); - // --- - q = GetSkipState(q.PrevCharKind); - - // skip the prefix - i += _prefix.Length; - - // here i points at the next character (the character immediately following the prefix) - if (q.IsNullable(GetCharKind(input, i))) - { - // Return the last position of the match - watchdog = q.WatchDog; - return i - 1; - } - - if (i == k) - { - // no match was found - return -2; - } - } - else + if (_findOpts is RegexFindOptimizations findOpts) { - // we are still in the initial state, when the prefix is empty - // find the first position i that matches with some character in the start set - i = IndexOfStartSet(input, i); - - if (i == -1) + // Find the first position i that matches with some likely character. + if (!findOpts.TryFindNextStartingPosition(input, ref i, 0, 0, k)) { // no match was found return NoMatchExists; @@ -835,68 +684,45 @@ private bool FindFinalStatePositionDeltas(string input, int j, ref [MethodImpl(MethodImplOptions.AggressiveInlining)] private uint GetCharKind(string input, int i) { - if (!_pattern._info.ContainsSomeAnchor) - { - // The previous character kind is irrelevant when anchors are not used. - return CharKind.General; - } + return !_pattern._info.ContainsSomeAnchor ? + CharKind.General : // The previous character kind is irrelevant when anchors are not used. + GetCharKindWithAnchor(input, i); - if (i == -1 || i == input.Length) + uint GetCharKindWithAnchor(string input, int i) { - return CharKind.StartStop; - } + Debug.Assert(_asciiCharKinds is not null); - char nextChar = input[i]; - if (nextChar == '\n') - { - return - _builder._newLinePredicate.Equals(_builder._solver.False) ? 0 : // ignore \n - i == 0 || i == input.Length - 1 ? CharKind.NewLineS : // very first or very last \n. Detection of very first \n is needed for rev(\Z). - CharKind.Newline; - } - - uint[] asciiCharKinds = _asciiCharKinds; - return - nextChar < asciiCharKinds.Length ? asciiCharKinds[nextChar] : - _builder._solver.And(GetMinterm(nextChar), _builder._wordLetterPredicateForAnchors).Equals(_builder._solver.False) ? 0 : //apply the wordletter predicate to compute the kind of the next character - CharKind.WordLetter; - } - - /// - /// Find first occurrence of startset element in input starting from index i. - /// Startset here is assumed to consist of a few characters. - /// - /// input string to search in - /// the start index in input to search from - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private int IndexOfStartSet(string input, int i) - { - if (_startSetSize <= StartSetArrayMaxSize) - { - return input.IndexOfAny(_startSetArray, i); - } + if ((uint)i >= (uint)input.Length) + { + return CharKind.StartStop; + } - for (int j = i; j < input.Length; j++) - { - if (_startSetClassifier.IsTrue(input[j])) + char nextChar = input[i]; + if (nextChar == '\n') { - return j; + return + _builder._newLinePredicate.Equals(_builder._solver.False) ? 0 : // ignore \n + i == 0 || i == input.Length - 1 ? CharKind.NewLineS : // very first or very last \n. Detection of very first \n is needed for rev(\Z). + CharKind.Newline; } - } - return -1; + uint[] asciiCharKinds = _asciiCharKinds; + return + nextChar < (uint)asciiCharKinds.Length ? asciiCharKinds[nextChar] : + _builder._solver.And(GetMinterm(nextChar), _builder._wordLetterPredicateForAnchors).Equals(_builder._solver.False) ? 0 : //apply the wordletter predicate to compute the kind of the next character + CharKind.WordLetter; + } } #if DEBUG - public override void SaveDGML(TextWriter writer, int bound, bool hideStateInfo, bool addDotStar, bool inReverse, bool onlyDFAinfo, int maxLabelLength, bool asNFA) + public void SaveDGML(TextWriter writer, int bound, bool hideStateInfo, bool addDotStar, bool inReverse, bool onlyDFAinfo, int maxLabelLength, bool asNFA) { var graph = new DGML.RegexAutomaton(this, bound, addDotStar, inReverse, asNFA); var dgml = new DGML.DgmlWriter(writer, hideStateInfo, maxLabelLength, onlyDFAinfo); dgml.Write(graph); } - public override IEnumerable GenerateRandomMembers(int k, int randomseed, bool negative) => + public IEnumerable GenerateRandomMembers(int k, int randomseed, bool negative) => new SymbolicRegexSampler(_pattern, randomseed, negative).GenerateRandomMembers(k); #endif } diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexNode.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexNode.cs index 41dfdf3898bf58..f7992bf43950d3 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexNode.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexNode.cs @@ -13,6 +13,12 @@ namespace System.Text.RegularExpressions.Symbolic internal sealed class SymbolicRegexNode where S : notnull { internal const string EmptyCharClass = "[]"; + /// Some byte other than 0 to represent true + internal const byte TrueByte = 1; + /// Some byte other than 0 to represent false + internal const byte FalseByte = 2; + /// The undefined value is the default value 0 + internal const byte UndefinedByte = 0; internal readonly SymbolicRegexBuilder _builder; internal readonly SymbolicRegexKind _kind; @@ -23,7 +29,11 @@ internal sealed class SymbolicRegexNode where S : notnull internal readonly SymbolicRegexNode? _right; internal readonly SymbolicRegexSet? _alts; - private Dictionary? _nullabilityCache; + /// + /// Caches nullability of this node for any given context (0 <= context < ContextLimit) + /// when _info.StartsWithSomeAnchor and _info.CanBeNullable are true. Otherwise the cache is null. + /// + private byte[]? _nullabilityCache; private S _startSet; @@ -50,6 +60,7 @@ private SymbolicRegexNode(SymbolicRegexBuilder builder, SymbolicRegexKind kin _info = info; _hashcode = ComputeHashCode(); _startSet = ComputeStartSet(); + _nullabilityCache = info.StartsWithSomeAnchor && info.CanBeNullable ? new byte[CharKind.ContextLimit] : null; } private bool _isInternalizedUnion; @@ -162,22 +173,35 @@ static void AppendToList(SymbolicRegexNode concat, List> /// kind info for previous and next characters internal bool IsNullableFor(uint context) { - if (!_info.StartsWithSomeAnchor) - return IsNullable; - - if (!_info.CanBeNullable) - return false; - - if (!StackHelper.TryEnsureSufficientExecutionStack()) + // if _nullabilityCache is null then IsNullable==CanBeNullable + // Observe that if IsNullable==true then CanBeNullable==true. + // but when the node does not start with an anchor + // and IsNullable==false then CanBeNullable==false. + + return _nullabilityCache is null ? + _info.IsNullable : + WithCache(context); + + // Separated out to enable the common case (no nullability cache) to be inlined + // and to avoid zero-init costs for generally unused state. + bool WithCache(uint context) { - return StackHelper.CallOnEmptyStack(IsNullableFor, context); - } + if (!StackHelper.TryEnsureSufficientExecutionStack()) + { + return StackHelper.CallOnEmptyStack(IsNullableFor, context); + } - // Initialize the nullability cache for this node. - _nullabilityCache ??= new Dictionary(); + Debug.Assert(context < CharKind.ContextLimit); - if (!_nullabilityCache.TryGetValue(context, out bool is_nullable)) - { + // If nullablity has been computed for the given context then return it + byte b = Volatile.Read(ref _nullabilityCache[context]); + if (b != UndefinedByte) + { + return b == TrueByte; + } + + // Otherwise compute the nullability recursively for the given context + bool is_nullable; switch (_kind) { case SymbolicRegexKind.Loop: @@ -237,18 +261,18 @@ internal bool IsNullableFor(uint context) is_nullable = (CharKind.Next(context) & CharKind.StartStop) != 0; break; - default: //SymbolicRegexKind.EndAnchorZRev: - // EndAnchorZRev (rev(\Z)) anchor is nullable when the prev character is either the first Newline or Start - // note: CharKind.NewLineS == CharKind.Newline|CharKind.StartStop + default: // SymbolicRegexKind.EndAnchorZRev: + // EndAnchorZRev (rev(\Z)) anchor is nullable when the prev character is either the first Newline or Start + // note: CharKind.NewLineS == CharKind.Newline|CharKind.StartStop Debug.Assert(_kind == SymbolicRegexKind.EndAnchorZRev); is_nullable = (CharKind.Prev(context) & CharKind.StartStop) != 0; break; } - _nullabilityCache[context] = is_nullable; - } + Volatile.Write(ref _nullabilityCache[context], is_nullable ? TrueByte : FalseByte); - return is_nullable; + return is_nullable; + } } /// Returns true if this is equivalent to .* (the node must be eager also) @@ -1203,10 +1227,6 @@ public HashSet GetPredicates() { var predicates = new HashSet(); CollectPredicates_helper(predicates); - if (predicates.Count == 0) - { - predicates.Add(_builder._solver.True); - } return predicates; } @@ -1292,17 +1312,7 @@ public S[] ComputeMinterms() Debug.Assert(typeof(S).IsAssignableTo(typeof(IComparable))); HashSet predicates = GetPredicates(); - Debug.Assert(predicates.Count != 0); - - S[] predicatesArray = new S[predicates.Count]; - int i = 0; - foreach (S s in predicates) - { - predicatesArray[i++] = s; - } - Debug.Assert(i == predicatesArray.Length); - - List mt = _builder._solver.GenerateMinterms(predicatesArray); + List mt = _builder._solver.GenerateMinterms(predicates); mt.Sort(); return mt.ToArray(); } @@ -1414,152 +1424,6 @@ internal bool StartsWithLoop(int upperBoundLowestValue = 1) }; } - /// - /// Gets the string prefix that the regex must match or the empty string if such a prefix does not exist. - /// Sets ignoreCase = true when the prefix works under case-insensitivity. - /// For example if the input prefix is "---" it sets ignoreCase=false, - /// if the prefix is "---[aA][bB]" it returns "---AB" and sets ignoreCase=true - /// - internal string GetFixedPrefix(CharSetSolver css, string culture, out bool ignoreCase) - { - ignoreCase = false; - StringBuilder prefix = new(); - bool doneWithoutIgnoreCase = false; - bool doneWithIgnoreCase = false; - foreach (S x in GetPrefixSequence()) - { - BDD bdd = _builder._solver.ConvertToCharSet(css, x); - char character = (char)bdd.GetMin(); - // Check if the prefix extends without ignore case: the set is a single character - if (!doneWithoutIgnoreCase && !css.IsSingleton(bdd)) - { - doneWithoutIgnoreCase = true; - } - if (!doneWithIgnoreCase) - { - // Check if the prefix extends with ignore case: ignoring case doesn't change the set - if (css.ApplyIgnoreCase(css.CharConstraint(character), culture).Equals(bdd)) - { - // Turn ignoreCase on when the prefix extends only under ignore case - if (doneWithoutIgnoreCase) - { - ignoreCase = true; - } - } - else - { - doneWithIgnoreCase = true; - } - } - // Append the character when the prefix extends in either of the ways - if (!doneWithoutIgnoreCase || !doneWithIgnoreCase) - prefix.Append(character); - else - break; - } - return prefix.ToString(); - } - - private IEnumerable GetPrefixSequence() - { - List> paths = new(); - HashSet> nextPaths = new(); - - paths.Add(this); - while (true) - { - bool done = false; - Debug.Assert(paths.Count > 0, "The generator should have ended when any path fails to extend."); - // Generate the next set from one path - S next; - if (!GetNextPrefixSet(ref paths, ref nextPaths, ref done, out next)) - { - // A path didn't have a next set as supported by this algorithm - yield break; - } - if (!_builder._solver.IsSatisfiable(next)) - { - yield break; - } - while (paths.Count > 0) - { - // For all other paths check that they produce the same set - S newSet; - if (!GetNextPrefixSet(ref paths, ref nextPaths, ref done, out newSet) || !newSet.Equals(next)) - { - // Either a path didn't have a next set as supported by this algorithm, or the next set was not equal - yield break; - } - } - // At this point all paths generated equal next sets - yield return next; - if (done) - { - // Some path had no continuation, end the prefix - yield break; - } - else - { - Debug.Assert(paths.Count == 0, "Not all paths were considered for next set."); - paths.AddRange(nextPaths); - nextPaths.Clear(); - } - } - } - - private bool GetNextPrefixSet(ref List> paths, ref HashSet> nextPaths, ref bool done, out S set) - { - while (paths.Count > 0) - { - SymbolicRegexNode node = paths[paths.Count - 1]; - paths.RemoveAt(paths.Count - 1); - switch (node._kind) - { - case SymbolicRegexKind.Singleton: - Debug.Assert(node._set is not null); - set = node._set; - done = true; // No continuation, done after the next set - return true; - case SymbolicRegexKind.Concat: - Debug.Assert(node._left is not null && node._right is not null); - if (!node._left.CanBeNullable) - { - if (node._left.GetFixedLength() == 1) - { - set = node._left.GetStartSet(); - // Left side had just one character, can use just right side as path - nextPaths.Add(node._right); - return true; - } - else - { - // Left side may need multiple steps to get through. However, it is safe - // (though not complete) to forget the right side and just expand the path - // for the left side. - paths.Add(node._left); - break; - } - } - else - { - // Left side may be nullable, can't extend the prefix - set = _builder._solver.False; // Not going to be used - return false; - } - case SymbolicRegexKind.Or: - case SymbolicRegexKind.And: - Debug.Assert(node._alts is not null); - // Handle alternatives as separate paths - paths.AddRange(node._alts); - break; - default: - set = _builder._solver.False; // Not going to be used - return false; // Cut prefix immediately for unhandled node - } - } - set = _builder._solver.False; // Not going to be used - return false; - } /// Get the predicate that covers all elements that make some progress. internal S GetStartSet() => _startSet; diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexRunnerFactory.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexRunnerFactory.cs index 83906ff029c1ab..b0d9de74668a02 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexRunnerFactory.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexRunnerFactory.cs @@ -12,10 +12,8 @@ internal sealed class SymbolicRegexRunnerFactory : RegexRunnerFactory /// The unicode component, including the BDD algebra. internal static readonly UnicodeCategoryTheory s_unicode = new UnicodeCategoryTheory(new CharSetSolver()); - /// The matching engine. - internal readonly SymbolicRegexMatcher _matcher; - /// Minimum length computed - private readonly int _minRequiredLength; + /// The matching engine, for 64 or fewer minterms. A SymbolicRegexMatcher of ulong or VB + internal readonly ISymbolicRegexMatcher _matcher; /// Initializes the factory. public SymbolicRegexRunnerFactory(RegexCode code, RegexOptions options, TimeSpan matchTimeout, CultureInfo culture) @@ -32,23 +30,22 @@ public SymbolicRegexRunnerFactory(RegexCode code, RegexOptions options, TimeSpan var solver = (CharSetSolver)s_unicode._solver; SymbolicRegexNode root = converter.Convert(code.Tree.Root, topLevel: true); - _minRequiredLength = code.Tree.MinRequiredLength; - BDD[] minterms = root.ComputeMinterms(); if (minterms.Length > 64) { // Use BV to represent a predicate var algBV = new BVAlgebra(solver, minterms); - var builderBV = new SymbolicRegexBuilder(algBV); - - // The default constructor sets the following predicates to False; this update happens after the fact. - // It depends on whether anchors where used in the regex whether the predicates are actually different from False. - builderBV._wordLetterPredicateForAnchors = algBV.ConvertFromCharSet(solver, converter._builder._wordLetterPredicateForAnchors); - builderBV._newLinePredicate = algBV.ConvertFromCharSet(solver, converter._builder._newLinePredicate); + var builderBV = new SymbolicRegexBuilder(algBV) + { + // The default constructor sets the following predicates to False; this update happens after the fact. + // It depends on whether anchors where used in the regex whether the predicates are actually different from False. + _wordLetterPredicateForAnchors = algBV.ConvertFromCharSet(solver, converter._builder._wordLetterPredicateForAnchors), + _newLinePredicate = algBV.ConvertFromCharSet(solver, converter._builder._newLinePredicate) + }; - //Convert the BDD based AST to BV based AST + // Convert the BDD-based AST to BV-based AST SymbolicRegexNode rootBV = converter._builder.Transform(root, builderBV, bdd => builderBV._solver.ConvertFromCharSet(solver, bdd)); - _matcher = new SymbolicRegexMatcher(rootBV, solver, minterms, matchTimeout, culture); + _matcher = new SymbolicRegexMatcher(rootBV, code, solver, minterms, matchTimeout, culture); } else { @@ -64,37 +61,31 @@ public SymbolicRegexRunnerFactory(RegexCode code, RegexOptions options, TimeSpan // Convert the BDD-based AST to ulong-based AST SymbolicRegexNode root64 = converter._builder.Transform(root, builder64, bdd => builder64._solver.ConvertFromCharSet(solver, bdd)); - _matcher = new SymbolicRegexMatcher(root64, solver, minterms, matchTimeout, culture); + _matcher = new SymbolicRegexMatcher(root64, code, solver, minterms, matchTimeout, culture); } } /// Creates a object. - protected internal override RegexRunner CreateInstance() => new Runner(_matcher, _minRequiredLength); + protected internal override RegexRunner CreateInstance() => _matcher is SymbolicRegexMatcher srmUInt64 ? + new Runner(srmUInt64) : + new Runner((SymbolicRegexMatcher)_matcher); /// Runner type produced by this factory. /// - /// The wrapped is itself thread-safe and can be shared across + /// The wrapped is itself thread-safe and can be shared across /// all runner instances, but the runner itself has state (e.g. for captures, positions, etc.) /// and must not be shared between concurrent uses. /// - private sealed class Runner : RegexRunner + private sealed class Runner : RegexRunner where TSetType : notnull { /// The matching engine. - private readonly SymbolicRegexMatcher _matcher; - /// Minimum length computed. - private readonly int _minRequiredLength; + private readonly SymbolicRegexMatcher _matcher; - internal Runner(SymbolicRegexMatcher matcher, int minRequiredLength) - { - _matcher = matcher; - _minRequiredLength = minRequiredLength; - } + internal Runner(SymbolicRegexMatcher matcher) => _matcher = matcher; protected override void InitTrackCount() { } // nop, no backtracking - protected override bool FindFirstChar() => - // The real logic is all in Go. Here we simply validate if there's enough text remaining to possibly match. - runtextpos <= runtextend - _minRequiredLength; + protected override bool FindFirstChar() => true; // The logic is all in Go. protected override void Go() { diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexSampler.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexSampler.cs index 3f965cec7cd935..8269e123a6f120 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexSampler.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexSampler.cs @@ -178,13 +178,11 @@ private IEnumerable> Step(List> states } private BDD ToBDD(S pred) => _solver.ConvertToCharSet(SymbolicRegexRunnerFactory.s_unicode._solver, pred); + private T Choose(IList elems) => elems[_random.Next(elems.Count)]; - private T Choose(IEnumerable elems) - { - List list = new List(elems); - return list[_random.Next(list.Count)]; - } + private char ChooseChar((uint, uint) pair) => (char)_random.Next((int)pair.Item1, (int)pair.Item2 + 1); + private char ChooseChar(BDD bdd) { Debug.Assert(!bdd.IsEmpty); @@ -192,8 +190,10 @@ private char ChooseChar(BDD bdd) BDD bdd1 = SymbolicRegexRunnerFactory.s_unicode._solver.And(bdd, _ascii); return ChooseChar(Choose(((CharSetSolver)SymbolicRegexRunnerFactory.s_unicode._solver).ToRanges(bdd1.IsEmpty ? bdd : bdd1))); } + private bool ChooseRandomlyTrueOrFalse() => _random.Next(100) < 50; /// Returns true if some state is unconditionally final + private bool IsFinal(IEnumerable> states) { foreach (SymbolicRegexNode state in states) @@ -205,6 +205,7 @@ private bool IsFinal(IEnumerable> states) } return false; } + /// Returns true if some state can be final private bool CanBeFinal(IEnumerable> states) { @@ -217,6 +218,7 @@ private bool CanBeFinal(IEnumerable> states) } return false; } + /// Returns true if some state is final in the given context private bool IsFinal(IEnumerable> states, uint context) { @@ -229,7 +231,9 @@ private bool IsFinal(IEnumerable> states, uint context) } return false; } + private bool IsWordchar(S pred) => _solver.IsSatisfiable(_solver.And(pred, _root._builder._wordLetterPredicateForAnchors)); + private bool IsNewline(S pred) => _solver.IsSatisfiable(_solver.And(pred, _root._builder._newLinePredicate)); } } diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/GeneratorHelper.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/GeneratorHelper.cs index 871eb15e2dc16b..5900e44a297384 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/GeneratorHelper.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/GeneratorHelper.cs @@ -1,11 +1,13 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.IO; namespace System.Text.RegularExpressions.Symbolic.Unicode { #if DEBUG + [ExcludeFromCodeCoverage] internal static class GeneratorHelper { public static void WriteInt64ArrayInitSyntax(StreamWriter sw, long[] values) @@ -17,6 +19,16 @@ public static void WriteInt64ArrayInitSyntax(StreamWriter sw, long[] values) } sw.Write("}"); } + + public static void WriteByteArrayInitSyntax(StreamWriter sw, byte[] values) + { + sw.Write("new byte[] {"); + for (int i = 0; i < values.Length; i++) + { + sw.Write($" 0x{values[i]:X}, "); + } + sw.Write("}"); + } } #endif } diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/IgnoreCaseRelation.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/IgnoreCaseRelation.cs index 458aabd55c6524..2e91f55bd49202 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/IgnoreCaseRelation.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/IgnoreCaseRelation.cs @@ -9,6 +9,6 @@ namespace System.Text.RegularExpressions.Symbolic.Unicode internal static class IgnoreCaseRelation { /// Serialized BDD for mapping characters to their case-ignoring equivalence classes in the default (en-US) culture. - public static readonly long[] IgnoreCaseEnUsSerializedBDD = new long[] { 0x5, 0xE, 0x80000, 0x20, 0x41, 0x180001, 0x100001, 0x61, 0x21, 0x80001, 0x180041, 0x180021, 0x80041, 0x200002, 0x280002, 0x300002, 0xE2, 0x82, 0xA2, 0xC2, 0x380002, 0x400002, 0x102, 0x122, 0x480002, 0x3800C2, 0x500002, 0x142, 0x580002, 0x4000C2, 0x182, 0x1A3, 0x1C3, 0x1E3, 0x800003, 0x880003, 0x900003, 0x980003, 0xA00003, 0x680003, 0x700003, 0x780003, 0x203, 0x223, 0x243, 0x263, 0x283, 0xA80003, 0x2C3, 0x2E3, 0x2A3, 0x303, 0xB00003, 0xB80003, 0xC00003, 0x323, 0x343, 0x363, 0xD80003, 0x8001E3, 0xC80003, 0xA00263, 0x900263, 0x780203, 0xD00003, 0x6801C3, 0xE00003, 0x3A3, 0x800303, 0xF00003, 0x3E4, 0x404, 0x424, 0x444, 0x464, 0x484, 0x4A4, 0x4C4, 0x4E4, 0x504, 0x524, 0x1500004, 0x1580004, 0x1600004, 0x1680004, 0x1700004, 0xF80004, 0x1000004, 0x1080004, 0x1100004, 0x1180004, 0x1200004, 0x1280004, 0x1300004, 0x1380004, 0x1400004, 0x544, 0x564, 0x584, 0x5A4, 0x5C4, 0x1480004, 0x1780004, 0x604, 0x624, 0x644, 0x664, 0x684, 0x6A4, 0x1980004, 0x1A00004, 0x1A80004, 0x1B00004, 0x5E4, 0x6C4, 0x1B80004, 0x6E4, 0x704, 0x1800004, 0x1880004, 0x1900004, 0x1C80004, 0x744, 0x1C00004, 0x1D80004, 0x1200544, 0x1280564, 0x1300584, 0x13805A4, 0x14005C4, 0x14803E4, 0x1E00004, 0x7A4, 0x1F00004, 0x700004, 0x780004, 0x1C4, 0x1E4, 0x1E80004, 0x800004, 0x880004, 0x900004, 0x980004, 0xA00004, 0x680004, 0x204, 0x224, 0x244, 0x264, 0x284, 0x1A4, 0x1F80004, 0x1D00004, 0x2000004, 0x824, 0x764, 0x1500444, 0x844, 0x784, 0x804, 0x1500524, 0x2180004, 0x2200004, 0x2280004, 0x724, 0x2300005, 0x8C5, 0x2380005, 0x8E5, 0x2400005, 0x905, 0x2480005, 0x925, 0x2500005, 0x945, 0x2580005, 0x965, 0x2600005, 0x985, 0x2680005, 0x9A5, 0x2700005, 0x9C5, 0x2780005, 0x9E5, 0x2800005, 0xA05, 0x2880005, 0xA25, 0x2900005, 0xA45, 0x2980005, 0xA65, 0x2A00005, 0xA85, 0x2A80005, 0xAA5, 0x2B00005, 0xAC5, 0x2B80005, 0xAE5, 0x2C00005, 0xB05, 0x2C80005, 0xB25, 0x2D00005, 0xB45, 0x2D80005, 0xB65, 0x2E00005, 0xB85, 0x2E80005, 0xBA5, 0x2F00005, 0xBC5, 0x2F80005, 0xBE5, 0xC05, 0xC25, 0xC45, 0xC65, 0xC85, 0xCA5, 0x3000005, 0x3080005, 0x3100005, 0x3180005, 0x3200005, 0x3280005, 0x3300005, 0xCE5, 0xD05, 0xD25, 0xD45, 0xD65, 0xD85, 0xDA5, 0xDC5, 0xDE5, 0xCC5, 0xE05, 0x3380005, 0x3400005, 0x3480005, 0x3500005, 0x3580005, 0x3880005, 0x3900005, 0x3980005, 0x3700005, 0x3780005, 0x3800005, 0xE85, 0xEA5, 0xEC5, 0xEE5, 0xF05, 0x3600005, 0x3B00005, 0x3B80005, 0x3C00005, 0x3680005, 0xE25, 0xF25, 0xE65, 0xE45, 0xF45, 0xF65, 0xF85, 0x2880C05, 0x2900C25, 0x2980C45, 0x2A00C65, 0x2A80C85, 0x2B008C5, 0x2B808E5, 0x2C00905, 0x2C80925, 0x2D00945, 0x2D80965, 0x2E00985, 0x2E809A5, 0x2F009C5, 0x2F809E5, 0x3280A05, 0x2880AE5, 0x2900B05, 0x2980B25, 0x2A00B45, 0x2A80B65, 0x2B00B85, 0x2B80BA5, 0x2C00BC5, 0x2C80BE5, 0x2D00CA5, 0x3E80005, 0x3F00005, 0x3F80005, 0x4000005, 0x4080005, 0x4100005, 0x4180005, 0x545, 0x565, 0x585, 0x5A5, 0x5C5, 0x3E5, 0x405, 0x425, 0x445, 0x465, 0x485, 0x4A5, 0x4C5, 0x4E5, 0x505, 0x525, 0x1085, 0x10A5, 0x10C5, 0x10E5, 0x4400005, 0x4480005, 0x4500005, 0x1105, 0x1125, 0x1165, 0x1185, 0x11A5, 0x11C5, 0x11E5, 0x1205, 0x4880005, 0x4900005, 0x4980005, 0x4A00005, 0x4A80005, 0x4B00005, 0x4580005, 0x4600005, 0x4680005, 0x4700005, 0x4780005, 0x4800005, 0x4300005, 0x4380005, 0x1225, 0x1245, 0x1265, 0x1285, 0x12A5, 0x12C5, 0x4B80005, 0x3C80005, 0x3D80005, 0x3E00005, 0x4C00005, 0x4C80005, 0x1345, 0x1365, 0x4E00005, 0x2B00A25, 0x2B80A45, 0x2C00A65, 0x2D00A85, 0x13A5, 0x3A00005, 0x3A80005, 0x4D80005, 0x3D00005, 0x4F00005, 0x4F80005, 0x5000005, 0x5080005, 0x5100005, 0x5180005, 0x13C5, 0x1405, 0x1485, 0x53014A6, 0x54014E6, 0x5501526, 0x5601566, 0x57015A6, 0x58015E6, 0x5901626, 0x5A01666, 0x5B016A6, 0x5C016E6, 0x5D01726, 0x5E01766, 0x5F017A6, 0x60017E6, 0x6101826, 0x6201866, 0x63018A6, 0x64018E6, 0x6501926, 0x6601966, 0x67019A6, 0x68019E6, 0x6901A26, 0x6A01A66, 0x6B01AA6, 0x6C01AE6, 0x6C80006, 0x1786, 0x6D00006, 0x17C6, 0x6D80006, 0x1806, 0x6E00006, 0x1846, 0x6E80006, 0x1886, 0x5300006, 0x18C6, 0x5400006, 0x1906, 0x5500006, 0x1946, 0x5600006, 0x1986, 0x5700006, 0x19C6, 0x5800006, 0x1A06, 0x5900006, 0x1A46, 0x5A00006, 0x1A86, 0x5B00006, 0x1AC6, 0x5C00006, 0x1B06, 0x5D00006, 0x1BC6, 0x5E00006, 0x1BE6, 0x5F00006, 0x1C06, 0x6000006, 0x1C26, 0x6100006, 0x1C46, 0x6200006, 0x1C66, 0x6300006, 0x14A6, 0x6400006, 0x14E6, 0x6500006, 0x1526, 0x6600006, 0x1566, 0x6700006, 0x15A6, 0x6800006, 0x15E6, 0x6900006, 0x1626, 0x6A00006, 0x1666, 0x6B00006, 0x16A6, 0x6C00006, 0x16E6, 0x6F00006, 0x1726, 0x6F80006, 0x1766, 0x7000006, 0x17A6, 0x7080006, 0x17E6, 0x7100006, 0x1826, 0x7180006, 0x1866, 0x5280006, 0x18A6, 0x5380006, 0x18E6, 0x5480006, 0x1926, 0x5580006, 0x1966, 0x5680006, 0x19A6, 0x5780006, 0x19E6, 0x5880006, 0x1A26, 0x5980006, 0x1A66, 0x5A80006, 0x1AA6, 0x5B80006, 0x1AE6, 0x5C80006, 0x1C86, 0x5D80006, 0x5E80006, 0x5F80006, 0x6080006, 0x6180006, 0x6280006, 0x6380006, 0x6480006, 0x6580006, 0x6680006, 0x6780006, 0x6880006, 0x6980006, 0x6A80006, 0x6B80006, 0x7200006, 0x1B26, 0x1B46, 0x1B66, 0x1B86, 0x1BA6, 0x14C6, 0x1506, 0x1546, 0x1586, 0x15C6, 0x1606, 0x1646, 0x1686, 0x16C6, 0x1706, 0x1746, 0x5881A26, 0x1CA6, 0x7300006, 0x7380006, 0x7400006, 0x7480006, 0x7500006, 0x7580006, 0x7600006, 0x7680006, 0x7700006, 0x7780006, 0x7800006, 0x7880006, 0x7900006, 0x7980006, 0x7A00006, 0x7A80006, 0x7B00006, 0x7B80006, 0x7C00006, 0x7C80006, 0x7D00006, 0x7280006, 0x7D80006, 0x1CC6, 0x1F86, 0x1FA6, 0x1FC6, 0x1FE6, 0x2006, 0x1D86, 0x1DA6, 0x1DC6, 0x1DE6, 0x1E06, 0x1E26, 0x1E46, 0x1E66, 0x1E86, 0x1EA6, 0x2026, 0x1EC6, 0x1EE6, 0x2046, 0x2066, 0x2086, 0x20A6, 0x1F26, 0x1F46, 0x1F66, 0x8300006, 0x7F00006, 0x7F80006, 0x8000006, 0x8080006, 0x8100006, 0x8180006, 0x8200006, 0x8280006, 0x20C6, 0x20E6, 0x2106, 0x8480006, 0x2146, 0x2166, 0x2186, 0x5F01C06, 0x6001C26, 0x6101C46, 0x6201C66, 0x63014A6, 0x64014E6, 0x6501526, 0x6601566, 0x67015A6, 0x68015E6, 0x6901626, 0x6A01666, 0x6B016A6, 0x6C016E6, 0x6F01726, 0x6F81766, 0x70017A6, 0x70817E6, 0x7101826, 0x7181866, 0x52818A6, 0x53818E6, 0x5481926, 0x5581966, 0x56819A6, 0x57819E6, 0x5981A66, 0x5A81AA6, 0x5B81AE6, 0x5C81C86, 0x8680006, 0x8700006, 0x8780006, 0x8800006, 0x8880006, 0x8900006, 0x8980006, 0x8A00006, 0x8A80006, 0x8B00006, 0x8B80006, 0x8C00006, 0x8C80006, 0x8D00006, 0x8D80006, 0x8E00006, 0x23A6, 0x23C6, 0x23E6, 0x2406, 0x2426, 0x2446, 0x2466, 0x2486, 0x24A6, 0x24C6, 0x24E6, 0x2506, 0x2526, 0x2546, 0x2566, 0x2586, 0x6C814E6, 0x6D01526, 0x6D81566, 0x6E015A6, 0x6E815E6, 0x5301626, 0x5401666, 0x55016A6, 0x56016E6, 0x5701726, 0x9680006, 0x25C6, 0x25E6, 0x2606, 0x2626, 0x2646, 0x2666, 0x2686, 0x26A6, 0x26C6, 0x26E6, 0x2706, 0x2726, 0x2746, 0x2766, 0x2786, 0x27A6, 0x5B017A6, 0xB66, 0xAA6, 0x27C6, 0x27E6, 0x2806, 0x2826, 0x2846, 0x2866, 0x2886, 0x9F00006, 0xA280006, 0xA300006, 0xA380006, 0xA400006, 0xA480006, 0xA500006, 0xA580006, 0xA600006, 0xA000006, 0xA080006, 0xA680006, 0xA700006, 0xA780006, 0xA800006, 0xA880006, 0xA900006, 0xA100006, 0xA180006, 0xA980006, 0xAA00006, 0xAA80006, 0xAB00006, 0xAB80006, 0xAC00006, 0xAC80006, 0xAD00006, 0x28E6, 0x2906, 0x2926, 0x2946, 0x2966, 0x2986, 0x29A6, 0x29E6, 0x2A26, 0x2AA6, 0x2AC6, 0x2AE6, 0x2B06, 0x2B26, 0x2B46, 0xAD80006, 0xAE00006, 0xAE80006, 0xAF00006, 0xAF80006, 0xB000006, 0x1CE6, 0x1D06, 0x1D26, 0x1D46, 0x1D66, 0x2126, 0x2BA6, 0x2BC6, 0x2BE6, 0x2C06, 0x28A6, 0x28C6, 0x21A6, 0x21C6, 0x21E6, 0x2206, 0x2226, 0x2246, 0x2266, 0x2286, 0x22A6, 0x22C6, 0x22E6, 0x2306, 0x2326, 0x2346, 0x2366, 0x2386, 0x6C81786, 0x6D017C6, 0x6D81806, 0x6E01846, 0x6E81886, 0x53018C6, 0x5401906, 0x5501946, 0x5601986, 0x57019C6, 0x5801A06, 0x5901A46, 0x5A01A86, 0x5B01AC6, 0x5C01B06, 0x2C26, 0x2C46, 0x1F06, 0x2C66, 0x2C86, 0x2CA6, 0x25A6, 0x2CC6, 0x5D81BE6, 0x5E81C06, 0x5F81C26, 0x6081C46, 0x6181C66, 0x62814A6, 0x63814E6, 0x6481526, 0x6581566, 0x66815A6, 0x67815E6, 0x6881626, 0x6981666, 0x6A816A6, 0x6B816E6, 0x7201726, 0x6F01C86, 0x3000006, 0x3080006, 0x3100006, 0x3180006, 0x3200006, 0x2300006, 0x2380006, 0x2400006, 0x2480006, 0x2500006, 0x2580006, 0x2600006, 0x2680006, 0x2700006, 0x2780006, 0x2800006, 0x2CE6, 0x2D06, 0x2401646, 0x2D26, 0x5D817A6, 0x5E817E6, 0xB500006, 0xB580006, 0xB600006, 0xB680006, 0x7E00006, 0x6C81586, 0x57815C6, 0x2DC6, 0x5E81C26, 0x2DE6, 0x2E06, 0x2E26, 0x2E46, 0x2E66, 0x2E86, 0x2EA6, 0x2EC6, 0x2EE6, 0x2F06, 0x8500006, 0xBC80006, 0xBD00006, 0x8600006, 0xBA00006, 0xB200006, 0x2F66, 0x6C81C86, 0xBD80006, 0x7E80006, 0xAE6, 0xC26, 0xC46, 0xC66, 0xC86, 0x8C6, 0x8E6, 0x906, 0x946, 0x966, 0x986, 0x9A6, 0x9C6, 0x9E6, 0xA06, 0xA26, 0xA46, 0xA66, 0xA86, 0xAC6, 0xB06, 0xB26, 0xB46, 0xB86, 0xBA6, 0xBC6, 0xBE6, 0xCA6, 0x926, 0xBE00007, 0xBE80007, 0xBF00007, 0xBF80007, 0xC000007, 0xC080007, 0xC100007, 0xC180007, 0xC200007, 0xC280007, 0xC300007, 0xC380007, 0xC400007, 0xC480007, 0xC500007, 0xC580007, 0xC600007, 0xC680007, 0xC700007, 0xC780007, 0xC800007, 0xC880007, 0xC900007, 0xC980007, 0xCA00007, 0xCA80007, 0x32C7, 0x32E7, 0x3307, 0x3327, 0x3347, 0x3367, 0x3387, 0x33A7, 0x33C7, 0x33E7, 0x3407, 0x3427, 0x3447, 0x3467, 0x3487, 0x34A7, 0x34C7, 0x34E7, 0x3507, 0x3527, 0x3547, 0x3567, 0x3587, 0x35A7, 0x35C7, 0x35E7, 0x3607, 0x3627, 0x3647, 0x3667, 0x3687, 0x36A7, 0x36C7, 0x36E7, 0x3707, 0x3727, 0x3747, 0x3767, 0x3787, 0x37A7, 0x37C7, 0x37E7, 0x3807, 0x3827, 0x3847, 0x3867, 0x3887, 0x38A7, 0x38C7, 0x38E7, 0x3907, 0x3927, 0x3947, 0x3967, 0x3987, 0x39A7, 0x39C7, 0x39E7, 0x3A07, 0x3A27, 0x3A47, 0x3A67, 0x3A87, 0x3AA7, 0x3AC7, 0x3AE7, 0x3B07, 0x3B27, 0x3B47, 0x3B67, 0x3B87, 0x3BA7, 0x3BC7, 0x3BE7, 0x3C07, 0x3C27, 0x3C47, 0x3C67, 0x3C87, 0x3CA7, 0x3CC7, 0x3CE7, 0x3D07, 0x3D27, 0x3D47, 0x3D67, 0x3D87, 0x3DA7, 0x3DC7, 0x3DE7, 0x3E07, 0x3E27, 0x3E47, 0x3E67, 0x3E87, 0x3EA7, 0x3EC7, 0x3EE7, 0x3F07, 0x3F27, 0x3F47, 0x3F67, 0x3F87, 0x3FA7, 0x3FC7, 0x3FE7, 0x4007, 0x4027, 0x4047, 0x4067, 0x4087, 0x40A7, 0x10300007, 0x10380007, 0x10400007, 0x10480007, 0x10500007, 0x10580007, 0x10600007, 0x10680007, 0x10700007, 0x10780007, 0x10800007, 0x10880007, 0x10900007, 0x10980007, 0x10A00007, 0x10A80007, 0xE780007, 0x42C7, 0x42E7, 0x4307, 0x4327, 0x4347, 0x4367, 0x4387, 0x43A7, 0xD080007, 0xCE80007, 0xD980007, 0xDE80007, 0xD480007, 0x43C7, 0x43E7, 0x4407, 0x4427, 0x4447, 0x4467, 0x4487, 0x44A7, 0x44C7, 0x44E7, 0x4507, 0x4527, 0xD580007, 0x4547, 0x4567, 0x4587, 0x45A7, 0x45C7, 0x11780007, 0x11800007, 0x11880007, 0x11900007, 0x11980007, 0x11A00007, 0x11A80007, 0x11B00007, 0x11B80007, 0x11C00007, 0x11C80007, 0x11D00007, 0x11D80007, 0x11E00007, 0x11E80007, 0x11F00007, 0x11F80007, 0x12000007, 0x12080007, 0x12100007, 0x12180007, 0x12200007, 0x12280007, 0x12300007, 0x12380007, 0x10B80007, 0x12400007, 0x10C00007, 0x10C80007, 0x10D00007, 0x10D80007, 0x10E00007, 0x10E80007, 0x12480007, 0x12500007, 0x12580007, 0x12600007, 0x10F00007, 0x10F80007, 0x11000007, 0x11080007, 0x49A7, 0x49C7, 0x49E7, 0x4A07, 0x4A27, 0xDD00007, 0xE300007, 0xE500007, 0xE600007, 0xE700007, 0xE800007, 0xE900007, 0xEA00007, 0xEB00007, 0xEC00007, 0xED00007, 0xEE00007, 0xEF00007, 0xF000007, 0xF100007, 0xF200007, 0xF300007, 0xF400007, 0xF500007, 0xF600007, 0xF700007, 0xF800007, 0xF900007, 0xFA00007, 0xFB00007, 0xFB80007, 0xFC00007, 0xFC80007, 0xFD00007, 0xFD80007, 0xFE00007, 0xFE80007, 0xFF00007, 0xFF80007, 0x10000007, 0x10080007, 0x10100007, 0x10180007, 0x10200007, 0x10280007, 0x4A47, 0x4A67, 0x4A87, 0x4707, 0x4727, 0x4747, 0x4767, 0x4787, 0x47A7, 0x47C7, 0x47E7, 0x4807, 0x4827, 0x4847, 0x4867, 0x4887, 0x48A7, 0x48C7, 0x48E7, 0x4907, 0x4927, 0x4AA7, 0x4947, 0x4967, 0x4987, 0xFA80007, 0xCB00007, 0x12B00007, 0x12900007, 0xE880007, 0xCB80007, 0xEA80007, 0xCC80007, 0xCD80007, 0xE980007, 0x12A00007, 0x12B80007, 0x12C00007, 0xCC00007, 0xD000007, 0xD680007, 0xD780007, 0xD880007, 0xCF80007, 0x12C80007, 0x12D00007, 0x12D80007, 0x12E00007, 0x12E80007, 0x12F00007, 0x12F80007, 0x13000007, 0x13080007, 0x13100007, 0x13180007, 0x13200007, 0x13280007, 0x13300007, 0x13380007, 0x13400007, 0x13480007, 0x13500007, 0x13580007, 0x13600007, 0x13680007, 0x13700007, 0x13780007, 0x13800007, 0x13880007, 0x13900007, 0x10B00007, 0x13980007, 0x13A00007, 0x13A80007, 0x13B00007, 0x13B80007, 0x13C00007, 0x13C80007, 0x13D00007, 0x13D80007, 0x13E00007, 0x13E80007, 0x13F00007, 0x13F80007, 0x14000007, 0x14080007, 0x14100007, 0x14180007, 0x14200007, 0x14280007, 0x14300007, 0x50E7, 0x5107, 0x5127, 0x5147, 0x5167, 0x5187, 0x51A7, 0x51C7, 0x51E7, 0x5207, 0x5227, 0x5247, 0x5267, 0x5287, 0x52A7, 0x52C7, 0x52E7, 0x5307, 0x5327, 0x5347, 0x5367, 0x5387, 0x53A7, 0x53C7, 0x53E7, 0x5407, 0x5427, 0x15100007, 0x15180007, 0x15200007, 0x15280007, 0x15300007, 0x15380007, 0x15400007, 0x15480007, 0x15500007, 0x15580007, 0x15600007, 0x15680007, 0x15700007, 0x15780007, 0x15800007, 0x15880007, 0x15900007, 0xDF00007, 0x5667, 0xE000007, 0x15A00007, 0xE400007, 0x31A7, 0x56A7, 0x10404147, 0x10484167, 0x56C7, 0x105033E7, 0x10583427, 0x56E7, 0x5707, 0x107037E7, 0x10783827, 0x5727, 0x5747, 0x5767, 0x10803BE7, 0x10883C27, 0x10903C67, 0x10983CA7, 0x5787, 0x10A033C7, 0x10A83407, 0x57A7, 0x57C7, 0x57E7, 0x5807, 0x5827, 0x5847, 0x5867, 0x5887, 0x58A7, 0x58C7, 0x58E7, 0x5907, 0x5927, 0x5947, 0x5967, 0x5987, 0x59A7, 0x59C7, 0x59E7, 0x5A07, 0x5A27, 0x5A47, 0x5A67, 0x5A87, 0x5AA7, 0x5AC7, 0x16B80007, 0x16C00007, 0x16C80007, 0x16D00007, 0x16D80007, 0x16E00007, 0x15B80007, 0x15C00007, 0x16E80007, 0x16F00007, 0x16F80007, 0x15C80007, 0x17000007, 0x17080007, 0x17100007, 0x17180007, 0x17200007, 0x17280007, 0x17300007, 0x17380007, 0x17400007, 0x17480007, 0x17500007, 0x17580007, 0x15E80007, 0x15F00007, 0x15F80007, 0x16000007, 0x16080007, 0x16100007, 0x16180007, 0x16200007, 0x16280007, 0x16300007, 0x16480007, 0x16500007, 0x16580007, 0x16600007, 0x16680007, 0x16700007, 0x16780007, 0x16800007, 0x16880007, 0x16900007, 0x16980007, 0x16A00007, 0x16A80007, 0x16B00007, 0x45E7, 0x5D87, 0x5DA7, 0x5DC7, 0x5DE7, 0x5E07, 0x5E27, 0x4647, 0x4667, 0x4687, 0x46A7, 0x46C7, 0x46E7, 0x17600007, 0x17680007, 0x17700007, 0x17780007, 0x17800007, 0x17880007, 0x12A80007, 0x11100007, 0x11180007, 0x11200007, 0x11280007, 0x11300007, 0x11380007, 0x12680007, 0x11400007, 0x11480007, 0x12700007, 0x12780007, 0x12800007, 0x12880007, 0x11580007, 0x11600007, 0x11680007, 0x11700007, 0x40C7, 0x40E7, 0x4107, 0x4167, 0x4187, 0x41A7, 0x41C7, 0x41E7, 0x4207, 0x4227, 0x4247, 0x4267, 0x4287, 0x42A7, 0x5E47, 0x5E67, 0x5E87, 0x5EA7, 0x5EC7, 0x5EE7, 0xE483FE7, 0xE584007, 0xE684027, 0xE784047, 0xE884067, 0xE984087, 0xEA840A7, 0x17C00007, 0x17C80007, 0x17D00007, 0x17D80007, 0x17E00007, 0x17E80007, 0x17F00007, 0x17F80007, 0x18000007, 0x18080007, 0x18100007, 0x18180007, 0x18200007, 0x18280007, 0x18300007, 0x18380007, 0x18400007, 0x18480007, 0x18500007, 0x18580007, 0x18600007, 0x18680007, 0x18700007, 0x18780007, 0x18800007, 0x18880007, 0x18900007, 0x18980007, 0x18A00007, 0x18A80007, 0x18B00007, 0x62E7, 0x6307, 0x6327, 0x6347, 0x6367, 0x6387, 0x63A7, 0x63C7, 0x18F80007, 0x19000007, 0x19080007, 0x19100007, 0x19180007, 0x19200007, 0x19280007, 0x19300007, 0x19380007, 0x19400007, 0x19480007, 0x19500007, 0x19580007, 0x19600007, 0x19680007, 0x19700007, 0x19780007, 0x19800007, 0x19880007, 0x19900007, 0x19980007, 0x19A00007, 0x19A80007, 0x19B00007, 0x19B80007, 0x19C00007, 0x19C80007, 0x19D00007, 0x19D80007, 0x19E00007, 0x19E80007, 0x19F00007, 0x19F80007, 0x104040C7, 0x104840E7, 0x10504107, 0x6807, 0x6827, 0x6847, 0x10304247, 0x6867, 0x6887, 0x68A7, 0x1827, 0x3167, 0x3187, 0x31C7, 0x31E7, 0x3207, 0x3227, 0x3247, 0x3267, 0x32A7, 0x65E7, 0x6607, 0x6627, 0x6647, 0x6667, 0x6687, 0x66A7, 0x66C7, 0x6707, 0x6727, 0x6747, 0x6767, 0x6787, 0x67A7, 0x67C7, 0x68C7, 0x68E7, 0x6907, 0x6927, 0xF583F27, 0xF683F87, 0xD180007, 0xD280007, 0xDA80007, 0xDF80007, 0xE180007, 0xE380007, 0xE480007, 0xE680007, 0xF780007, 0x18F00007, 0xCD00007, 0x1A500007, 0x6967, 0x6987, 0x69A7, 0x69C7, 0x69E7, 0x6A07, 0x6A27, 0x6A47, 0x6A67, 0x6A87, 0x6AA7, 0x6AC7, 0x6AE7, 0x6B07, 0x6B27, 0x6B47, 0x6B67, 0x6B87, 0x6BA7, 0x6BC7, 0x1AF80007, 0x18D80007, 0x18E00007, 0x18E80007, 0x1B000007, 0x1B080007, 0x1B100007, 0xDA00007, 0x1B180007, 0x6C87, 0x6CA7, 0x6CC7, 0x6CE7, 0x6D07, 0x6D27, 0x6D47, 0x6D67, 0x6D87, 0x6DA7, 0x6DC7, 0x6DE7, 0x6E07, 0x6E27, 0x6E47, 0x6E67, 0x6E87, 0x6EA7, 0x5687, 0x6EC7, 0x6C67, 0x6EE7, 0x6F07, 0x6F27, 0x6F47, 0x6F67, 0x6F87, 0x6FA7, 0x6FC7, 0x1B400007, 0x1B480007, 0x1B500007, 0x1BF80007, 0x1B580007, 0x1B600007, 0x1B680007, 0x1B700007, 0x1B780007, 0x1B800007, 0x1B880007, 0x1B900007, 0x1B980007, 0x1BA00007, 0x1BA80007, 0x1BB00007, 0x1BB80007, 0x1BC00007, 0x1BC80007, 0x15980007, 0x1BD00007, 0x1BD80007, 0x1BE00007, 0x1BE80007, 0x7008, 0x7028, 0x7048, 0x7068, 0x7088, 0x70A8, 0x70C8, 0x70E8, 0x7108, 0x7128, 0x7148, 0x7168, 0x7188, 0x71A8, 0x71C8, 0x71E8, 0x7208, 0x7228, 0x7248, 0x7268, 0x7288, 0x72A8, 0x72C8, 0x72E8, 0x7308, 0x7328, 0x7348, 0x7368, 0x7388, 0x73A8, 0x73C8, 0x73E8, 0x7408, 0x7428, 0x7448, 0x7468, 0x7488, 0x74A8, 0x74C8, 0x74E8, 0x7508, 0x7528, 0x7548, 0x7568, 0x7588, 0x75A8, 0x75C8, 0x75E8, 0x7608, 0x7628, 0x7648, 0x7668, 0x7688, 0x76A8, 0x76C8, 0x76E8, 0x7708, 0x7728, 0x7748, 0x7768, 0x7788, 0x77A8, 0x77C8, 0x77E8, 0x7808, 0x7828, 0x7848, 0x7868, 0x7888, 0x78A8, 0x78C8, 0x78E8, 0x7908, 0x7928, 0x7948, 0x7968, 0x7988, 0x79A8, 0x79C8, 0x79E8, 0x7A08, 0x7A28, 0x7A48, 0x7A68, 0x7A88, 0x7AA8, 0x7AC8, 0x7AE8, 0x7B08, 0x7B28, 0x7B48, 0x7B68, 0x7B88, 0x7BA8, 0x7BC8, 0x7BE8, 0x7C08, 0x7C28, 0x7C48, 0x7C68, 0x7C88, 0x7CA8, 0x7CC8, 0x7CE8, 0x7D08, 0x7D28, 0x7D48, 0x7D68, 0x7D88, 0x7DA8, 0x7DC8, 0x7DE8, 0x7E08, 0x7E28, 0x7E48, 0x7E68, 0x7E88, 0x7EA8, 0x7EC8, 0x7EE8, 0x7F08, 0x7F28, 0x7F48, 0x7F68, 0x7F88, 0x7FA8, 0x7FC8, 0x7FE8, 0x8008, 0x8028, 0x8048, 0x8068, 0x8088, 0x80A8, 0x80C8, 0x80E8, 0x8108, 0x8128, 0x8148, 0x8168, 0x8188, 0x81A8, 0x81C8, 0x81E8, 0x8208, 0x8228, 0x8248, 0x8268, 0x8288, 0x82A8, 0x82C8, 0x82E8, 0x8308, 0x8328, 0x8348, 0x20380008, 0x8368, 0x8388, 0x83A8, 0x83C8, 0x83E8, 0x8408, 0x8428, 0x8448, 0x1EF00008, 0x20100008, 0x1EE00008, 0x21180008, 0x21200008, 0x21280008, 0x21300008, 0x21380008, 0x8508, 0x8528, 0x8548, 0x8568, 0x8588, 0x85A8, 0x85C8, 0x85E8, 0x8608, 0x8628, 0x8648, 0x8668, 0x21A00008, 0x86A8, 0x86C8, 0x86E8, 0x8708, 0x8728, 0x8748, 0x8768, 0x8788, 0x87A8, 0x87C8, 0x87E8, 0x8808, 0x8828, 0x8848, 0x8868, 0x8888, 0x88A8, 0x88C8, 0x88E8, 0x8908, 0x8928, 0x8948, 0x8968, 0x8988, 0x89A8, 0x89C8, 0x89E8, 0x8A08, 0x8A28, 0x8A48, 0x8A68, 0x8A88, 0x8AA8, 0x8AC8, 0x8AE8, 0x8B08, 0x8B28, 0x8B48, 0x8B68, 0x8B88, 0x8BA8, 0x8BC8, 0x8BE8, 0x8C08, 0x8C28, 0x8C48, 0x21780008, 0x21800008, 0x21880008, 0x23180008, 0x21900008, 0x21980008, 0x23200008, 0x23280008, 0x23300008, 0x23380008, 0x21B00008, 0x21B80008, 0x21C00008, 0x21C80008, 0x21F00008, 0x21F80008, 0x22000008, 0x22080008, 0x22100008, 0x22180008, 0x22200008, 0x22280008, 0x22300008, 0x22380008, 0x22400008, 0x22480008, 0x22500008, 0x22580008, 0x22600008, 0x22680008, 0x22700008, 0x22780008, 0x22800008, 0x22880008, 0x22900008, 0x22980008, 0x22A00008, 0x8D08, 0x1EF80008, 0x8D28, 0x1F580008, 0x8D48, 0x1F780008, 0x8D68, 0x1F880008, 0x8D88, 0x1F980008, 0x8DA8, 0x1FA80008, 0x8DC8, 0x1FB80008, 0x8DE8, 0x1FC80008, 0x8E08, 0x1CD00008, 0x8E28, 0x1CE00008, 0x8E48, 0x1CF00008, 0x8E68, 0x1D000008, 0x8E88, 0x1D100008, 0x8EA8, 0x1D200008, 0x8EC8, 0x1D300008, 0x8EE8, 0x1D400008, 0x8F08, 0x1D500008, 0x8F28, 0x1D600008, 0x8F48, 0x1D700008, 0x8F68, 0x1D800008, 0x8F88, 0x1D900008, 0x8FA8, 0x1DA00008, 0x8FC8, 0x1DB00008, 0x8FE8, 0x1DC00008, 0x9008, 0x1DD00008, 0x9028, 0x1DE00008, 0x9048, 0x1DF00008, 0x9068, 0x1E000008, 0x9088, 0x1E100008, 0x90A8, 0x1E200008, 0x90C8, 0x1E300008, 0x90E8, 0x1E400008, 0x9108, 0x1E500008, 0x9128, 0x1E600008, 0x9148, 0x1E700008, 0x9168, 0x1E800008, 0x9188, 0x1E900008, 0x91A8, 0x1EA00008, 0x91C8, 0x1EB00008, 0x91E8, 0x1EC00008, 0x24800008, 0x24880008, 0x24900008, 0x24980008, 0x24A00008, 0x24A80008, 0x24B00008, 0x24B80008, 0x24C00008, 0x24C80008, 0x24D00008, 0x24D80008, 0x24E00008, 0x24E80008, 0x24F00008, 0x24F80008, 0x25000008, 0x25080008, 0x25100008, 0x20E00008, 0x25180008, 0x20E80008, 0x20F00008, 0x20F80008, 0x21000008, 0x21080008, 0x21100008, 0x25200008, 0x25280008, 0x25300008, 0x25380008, 0x25400008, 0x21400008, 0x21480008, 0x21500008, 0x21580008, 0x21600008, 0x21680008, 0x21700008, 0x20500008, 0x25480008, 0x20580008, 0x25500008, 0x25580008, 0x25600008, 0x20C80008, 0x25680008, 0x25700008, 0x25780008, 0x25800008, 0x20C00008, 0x25880008, 0x25900008, 0x25980008, 0x25A00008, 0x25A80008, 0x25B00008, 0x25B80008, 0x25C00008, 0x20600008, 0x25C80008, 0x25D00008, 0x25D80008, 0x25E00008, 0x25E80008, 0x25F00008, 0x25F80008, 0x26000008, 0x26080008, 0x26100008, 0x26180008, 0x26200008, 0x26280008, 0x26300008, 0x26380008, 0x26400008, 0x26480008, 0x26500008, 0x26580008, 0x26600008, 0x26680008, 0x26700008, 0x26780008, 0x26800008, 0x26880008, 0x26900008, 0x26980008, 0x26A00008, 0x26A80008, 0x26B00008, 0x26B80008, 0x26C00008, 0x26C80008, 0x26D00008, 0x26D80008, 0x26E00008, 0x26E80008, 0x26F00008, 0x26F80008, 0x27000008, 0x27080008, 0x27100008, 0x27180008, 0x27200008, 0x27280008, 0x27300008, 0x27380008, 0x27400008, 0x27480008, 0x27500008, 0x27580008, 0x27600008, 0x27680008, 0x27700008, 0x27780008, 0x27800008, 0x27880008, 0x27900008, 0x27980008, 0x27A00008, 0x27A80008, 0x27B00008, 0x27B80008, 0x27C00008, 0x27C80008, 0x27D00008, 0x27D80008, 0x27E00008, 0x27E80008, 0x27F00008, 0x27F80008, 0x28000008, 0x28080008, 0x28100008, 0x28180008, 0x28200008, 0xA0A8, 0xA0C8, 0xA0E8, 0xA108, 0xA128, 0xA148, 0xA168, 0xA188, 0xA1A8, 0xA1C8, 0xA1E8, 0xA208, 0xA228, 0xA248, 0xA268, 0xA288, 0xA2A8, 0xA2C8, 0xA2E8, 0x28C00008, 0xA328, 0x28D00008, 0xA368, 0xA388, 0xA3A8, 0xA3C8, 0xA3E8, 0x4188, 0x41A8, 0xA408, 0xA428, 0xA448, 0xA468, 0xA488, 0xA4A8, 0xA4C8, 0xA4E8, 0xA508, 0xA528, 0xA548, 0xA568, 0xA588, 0xA5A8, 0xA5C8, 0xA5E8, 0xA608, 0xA628, 0xA648, 0xA668, 0xA688, 0xA6A8, 0xA6C8, 0xA6E8, 0xA708, 0xA728, 0xA748, 0xA768, 0xA788, 0xA7A8, 0xA7C8, 0xA7E8, 0xA808, 0xA828, 0xA848, 0xA868, 0xA888, 0xA8A8, 0xA8C8, 0xA8E8, 0xA908, 0xA928, 0xA948, 0xA968, 0xA988, 0xA9A8, 0xA9C8, 0xA9E8, 0xAA08, 0xAA28, 0xAA48, 0xAA68, 0xAA88, 0xAAA8, 0xAAC8, 0xAAE8, 0xAB08, 0xAB28, 0xAB48, 0xAB68, 0xAB88, 0xABA8, 0xABC8, 0xABE8, 0xAC08, 0xAC28, 0xAC48, 0xAC68, 0xAC88, 0xACA8, 0xACC8, 0xACE8, 0xAD08, 0xAD28, 0xAD48, 0xAD68, 0xAD88, 0xADA8, 0xADC8, 0xADE8, 0xAE08, 0xAE28, 0xAE48, 0xAE68, 0xAE88, 0xAEA8, 0xAEC8, 0xAEE8, 0xAF08, 0xAF28, 0xAF48, 0x2BD80008, 0x2BE00008, 0x2BE80008, 0x2BF00008, 0x2BF80008, 0x2C000008, 0x2C080008, 0x2C100008, 0x2C180008, 0x2C200008, 0x2C280008, 0x2C300008, 0x2C380008, 0x1DD80008, 0x21D00008, 0x2C400008, 0x2C480008, 0x2C500008, 0x2C580008, 0x2C600008, 0x2C680008, 0x21E80008, 0x22A80008, 0x22B00008, 0x22B80008, 0x22C00008, 0x22C80008, 0x22D00008, 0x22D80008, 0x2C700008, 0x22E00008, 0x22E80008, 0x22F00008, 0x22F80008, 0x23000008, 0x23080008, 0x23100008, 0x2C780008, 0x2C800008, 0x2C880008, 0x2C900008, 0x2C980008, 0x2CA00008, 0x2CA80008, 0x2CB00008, 0x2CB80008, 0x2CC00008, 0x2CC80008, 0x2CD00008, 0x2CD80008, 0x2CE00008, 0x2CE80008, 0x2CF00008, 0x2CF80008, 0x2D000008, 0x2D080008, 0x2D100008, 0x2D180008, 0x2D200008, 0x2D280008, 0x2D300008, 0x2D380008, 0x2D400008, 0x2D480008, 0x2D500008, 0x2D580008, 0x2D600008, 0x2D680008, 0x1CD80008, 0x1CE80008, 0x1CF80008, 0x1D080008, 0x1D180008, 0x1D280008, 0x1D380008, 0x1D480008, 0x1D580008, 0x1D680008, 0x1D780008, 0x1D880008, 0x1D980008, 0x1DA80008, 0x1DB80008, 0x1DC80008, 0x1ED00008, 0x1DE80008, 0x1DF80008, 0x1F000008, 0x1E080008, 0x1F100008, 0x1E180008, 0x1F200008, 0x1E280008, 0x1F300008, 0x1E380008, 0x1F400008, 0x1E480008, 0x1F500008, 0x1E580008, 0x1F600008, 0x1E680008, 0x1F700008, 0x1E780008, 0x1F800008, 0x1E880008, 0x1F900008, 0x1E980008, 0x1FA00008, 0x1EA80008, 0x1FB00008, 0x1EB80008, 0x1FC00008, 0x1EC80008, 0xB5C8, 0xB5E8, 0xB608, 0xB628, 0xB648, 0xB668, 0xB688, 0xB6A8, 0xB6C8, 0xB6E8, 0xB708, 0xB728, 0xB748, 0xB768, 0xB788, 0xB7A8, 0xB7C8, 0xB7E8, 0xB808, 0xB828, 0xB848, 0xB868, 0xB888, 0xB8A8, 0xB8C8, 0xB8E8, 0xB908, 0xB928, 0xB948, 0xB968, 0xB988, 0xB9A8, 0xB9C8, 0xB9E8, 0xBA08, 0xBA28, 0xBA48, 0xBA68, 0xBA88, 0xBAA8, 0xBAC8, 0xBAE8, 0xBB08, 0xBB28, 0xB1E8, 0xB208, 0xB228, 0xB248, 0xB268, 0xB288, 0xB2A8, 0xB2C8, 0xB2E8, 0xB308, 0xB328, 0xB348, 0xB368, 0xB388, 0xB3A8, 0xB3C8, 0xB3E8, 0x2ED00008, 0x2ED80008, 0x2EE00008, 0x2EE80008, 0x2EF00008, 0x2EF80008, 0x2F000008, 0x2F080008, 0x2F100008, 0x2F180008, 0x2F200008, 0x2F280008, 0x2F300008, 0x2F380008, 0x2F400008, 0x2F480008, 0x2F500008, 0x2F580008, 0x2F600008, 0x2F680008, 0x2F700008, 0x2F780008, 0x2F800008, 0x2F880008, 0x1C580008, 0x1C600008, 0x1C680008, 0x1C700008, 0x1C780008, 0x1C800008, 0x1C880008, 0x1C900008, 0x1C980008, 0x1CA00008, 0x1CA80008, 0x1CB00008, 0x1CB80008, 0x1CC00008, 0x1CC80008, 0x2F900008, 0x2F980008, 0x2FA00008, 0x2FA80008, 0x2FB00008, 0x2FB80008, 0x2FC00008, 0x2FC80008, 0x2FD00008, 0x2FD80008, 0x2FE00008, 0x2FE80008, 0x2FF00008, 0x2FF80008, 0x30000008, 0x30080008, 0x30100008, 0xC068, 0xC088, 0xC0A8, 0xAFA8, 0xC0C8, 0xC0E8, 0xC108, 0xC128, 0xB048, 0xB068, 0xB088, 0xB0A8, 0xB0C8, 0xB0E8, 0x9268, 0x9288, 0x92A8, 0x92C8, 0x92E8, 0x9308, 0xC148, 0xC168, 0xC188, 0xC1A8, 0xC1C8, 0xC1E8, 0xC208, 0xC228, 0xC248, 0xC268, 0xC288, 0xC2A8, 0xC2C8, 0xC2E8, 0xC308, 0xC328, 0xC348, 0xC368, 0xC388, 0xC3A8, 0xC3C8, 0xC3E8, 0xC408, 0xC428, 0xC448, 0xC468, 0xC488, 0xC4A8, 0xC4C8, 0xC4E8, 0xC508, 0xC528, 0xB168, 0x9588, 0xB1A8, 0x31500008, 0x1FF00008, 0x1FF80008, 0x31580008, 0x20080008, 0x20300008, 0x20480008, 0x20A00008, 0x20B80008, 0x31600008, 0x31680008, 0x31700008, 0x31780008, 0x31800008, 0x31880008, 0x31900008, 0x31980008, 0x20D00008, 0x31A00008, 0x31A80008, 0x31B00008, 0x31B80008, 0x23780008, 0xAF68, 0xAF88, 0xAFC8, 0xC708, 0xC728, 0xB008, 0xC748, 0xC768, 0xC788, 0xC7A8, 0xC7C8, 0xC7E8, 0xC808, 0xC828, 0xC848, 0xBB68, 0xC868, 0xC888, 0xC8A8, 0xC8C8, 0xC8E8, 0xC908, 0x94E8, 0xC928, 0xC948, 0xC968, 0xC988, 0x2D008228, 0xB188, 0xC9A8, 0xC9C8, 0xC9E8, 0xC6A8, 0xCA08, 0xCA28, 0xC6E8, 0xCA48, 0x32A0CA68, 0x32A80008, 0x32B00008, 0x32B80008, 0x32C00008, 0x32C80008, 0x32D00008, 0x32D80008, 0x32E00008, 0x32E80008, 0x32F00008, 0x32F80008, 0x33000008, 0x33080008, 0x33100008, 0x33180008, 0x33200008, 0x33280008, 0x33300008, 0x33380008, 0x33400008, 0x33480008, 0x33500008, 0x33580008, 0x33600008, 0x33680008, 0x33700008, 0x33780008, 0x33800008, 0x33880008, 0x33900008, 0x33980008, 0x33A00008, 0x33A80008, 0x33B00008, 0x33B80008, 0x33C00008, 0x33C80008, 0x33D00008, 0x33D80008, 0x33E00008, 0x33E80008, 0x33F00008, 0x33F80008, 0x34000008, 0x34080008, 0x34100008, 0x34180008, 0x34200008, 0x34280008, 0x34300008, 0x34380008, 0x34400008, 0x34480008, 0xD149, 0xD169, 0xD189, 0xD1A9, 0xD1C9, 0xD1E9, 0xD209, 0xD229, 0xD249, 0xD269, 0xD289, 0xD2A9, 0xD2C9, 0xD2E9, 0xD309, 0xD329, 0xD349, 0xD369, 0xD389, 0xD3A9, 0xD3C9, 0xD3E9, 0xD409, 0xD429, 0xD449, 0xD469, 0xD489, 0xD4A9, 0xD4C9, 0xD4E9, 0xD509, 0xD529, 0xD549, 0xD569, 0xD589, 0xD5A9, 0xD5C9, 0xD5E9, 0xD609, 0xD629, 0xD649, 0xD669, 0xD689, 0xD6A9, 0xD6C9, 0xD6E9, 0xD709, 0xD729, 0xD749, 0xD769, 0xD789, 0xD7A9, 0xD7C9, 0xD7E9, 0xD809, 0xD829, 0xD849, 0xD869, 0xD889, 0xD8A9, 0xD8C9, 0xD8E9, 0xD909, 0xD929, 0xD949, 0xD969, 0xD989, 0xD9A9, 0xD9C9, 0xD9E9, 0xDA09, 0xDA29, 0xDA49, 0xDA69, 0xDA89, 0xDAA9, 0xDAC9, 0xDAE9, 0xDB09, 0xDB29, 0xDB49, 0xDB69, 0xDB89, 0xDBA9, 0xDBC9, 0xDBE9, 0xDC09, 0xDC29, 0xDC49, 0xDC69, 0xDC89, 0xDCA9, 0xDCC9, 0xDCE9, 0xDD09, 0xDD29, 0xDD49, 0xDD69, 0xDD89, 0xDDA9, 0xDDC9, 0xDDE9, 0xDE09, 0xDE29, 0xDE49, 0xDE69, 0xDE89, 0xDEA9, 0xDEC9, 0xDEE9, 0xDF09, 0xDF29, 0xDF49, 0xDF69, 0xDF89, 0xDFA9, 0xDFC9, 0xDFE9, 0xE009, 0xE029, 0xE049, 0xE069, 0xE089, 0xE0A9, 0xE0C9, 0xE0E9, 0xE109, 0xE129, 0xE149, 0xE169, 0xE189, 0xE1A9, 0xE1C9, 0xE1E9, 0xE209, 0xE229, 0xE249, 0xE269, 0xE289, 0xE2A9, 0xE2C9, 0xE2E9, 0xE309, 0xE329, 0xE349, 0xE369, 0xE389, 0xE3A9, 0xE3C9, 0xE3E9, 0xE409, 0xE429, 0xE449, 0xE469, 0xE489, 0x38280009, 0xE4A9, 0xE4C9, 0xE4E9, 0xE509, 0xE529, 0xE549, 0xE569, 0xE589, 0xE5A9, 0xE5C9, 0xE5E9, 0xE609, 0xE629, 0xE649, 0xE669, 0xE689, 0xE6A9, 0xE6C9, 0xE6E9, 0xE709, 0xE729, 0xE749, 0xE769, 0xE789, 0xE7A9, 0xE7C9, 0xE7E9, 0xE809, 0xE829, 0xE849, 0xE869, 0xE889, 0xE8A9, 0xE8C9, 0xE8E9, 0xE909, 0x38D00009, 0xE929, 0xE949, 0xE969, 0xE989, 0xE9A9, 0xE9C9, 0xE9E9, 0xEA09, 0xEA29, 0xEA49, 0xEA69, 0xEA89, 0xEAA9, 0xEAC9, 0xEAE9, 0xEB09, 0xEB29, 0xEB49, 0xEB69, 0xEB89, 0xEBA9, 0xEBC9, 0xEBE9, 0xEC09, 0xEC29, 0xEC49, 0xEC69, 0xEC89, 0xECA9, 0xECC9, 0xECE9, 0xED09, 0xED29, 0xED49, 0xED69, 0xED89, 0xEDA9, 0xEDC9, 0xEDE9, 0xEE09, 0xEE29, 0xEE49, 0xEE69, 0xEE89, 0xEEA9, 0xEEC9, 0xEEE9, 0xEF09, 0xEF29, 0xEF49, 0xEF69, 0xEF89, 0xEFA9, 0xEFC9, 0xEFE9, 0xF009, 0xF029, 0xF049, 0xF069, 0xF089, 0xF0A9, 0xF0C9, 0xF0E9, 0xF109, 0xF129, 0xF149, 0xF169, 0xF189, 0xF1A9, 0xF1C9, 0xF1E9, 0xF209, 0xF229, 0xF249, 0xF269, 0xF289, 0xF2A9, 0x3CB00009, 0x3CB80009, 0x3CC00009, 0x3CC80009, 0x3CD00009, 0x3CD80009, 0x3CE00009, 0x3CE80009, 0x3CF00009, 0x3CF80009, 0x3D000009, 0x3D080009, 0x3D100009, 0x3D180009, 0x3D200009, 0x3D280009, 0x3D300009, 0x3D380009, 0x3D400009, 0x3D480009, 0x3D500009, 0x3D580009, 0x3D600009, 0x3D680009, 0x3D700009, 0x3D780009, 0x3D800009, 0x3D880009, 0x3D900009, 0x3D980009, 0x3DA00009, 0x3DA80009, 0x3DB00009, 0x3DB80009, 0x3DC00009, 0x3DC80009, 0x3DD00009, 0x3DD80009, 0x3DE00009, 0x3DE80009, 0x3DF00009, 0x3DF80009, 0x3E000009, 0x3E080009, 0x3E100009, 0x3E180009, 0x3E200009, 0x3E280009, 0x3E300009, 0x3E380009, 0x3E400009, 0x3E480009, 0x3E500009, 0x3E580009, 0x3E600009, 0x3E680009, 0x3E700009, 0x3E780009, 0x3E800009, 0x3E880009, 0x3E900009, 0x3E980009, 0x3EA00009, 0x3EA80009, 0x3EB00009, 0x3EB80009, 0x3EC00009, 0x3EC80009, 0x3ED00009, 0x3ED80009, 0x3EE00009, 0x3EE80009, 0x3EF00009, 0x3EF80009, 0x3F000009, 0x3F080009, 0x3F100009, 0x3F180009, 0x3F200009, 0x3F280009, 0x3F300009, 0x3F380009, 0x3F400009, 0x3F480009, 0x3F500009, 0x3F580009, 0x3F600009, 0x3F680009, 0x3F700009, 0x3F780009, 0x3F800009, 0x3F880009, 0x3F900009, 0x3F980009, 0x3FA00009, 0x3FA80009, 0x3FB00009, 0x3FB80009, 0x3FC00009, 0x3FC80009, 0x3FD00009, 0x3FD80009, 0x3FE00009, 0x3FE80009, 0x3FF00009, 0x3FF80009, 0x40000009, 0x40080009, 0x40100009, 0x40180009, 0x40200009, 0x40280009, 0x40300009, 0x40380009, 0x40400009, 0x40480009, 0x40500009, 0x40580009, 0x40600009, 0x3B880009, 0x3B900009, 0x3B980009, 0x3BA00009, 0x3BA80009, 0x3BB00009, 0x3BB80009, 0x3BC00009, 0x3BC80009, 0x3BD00009, 0x3BD80009, 0x3BE00009, 0x3BE80009, 0x3BF00009, 0x40680009, 0x101C9, 0x40780009, 0x10209, 0x40880009, 0x40900009, 0x40980009, 0x10289, 0x40A80009, 0x102C9, 0x40B80009, 0x10309, 0x40C80009, 0x10349, 0x40D80009, 0x40E00009, 0x40E80009, 0x39A80009, 0x103C9, 0x3A100009, 0x103E9, 0x41000009, 0x10429, 0x41100009, 0x38B00009, 0x41180009, 0x10489, 0x3C280009, 0x41280009, 0x41300009, 0x41380009, 0x41400009, 0x41480009, 0x41500009, 0x41580009, 0x41600009, 0x41680009, 0x41700009, 0x41780009, 0x41800009, 0x41880009, 0x41900009, 0x41980009, 0x41A00009, 0x41A80009, 0x41B00009, 0x41B80009, 0x41C00009, 0x41C80009, 0x41D00009, 0x41D80009, 0x41E00009, 0x41E80009, 0x41F00009, 0x41F80009, 0x42000009, 0x42080009, 0x42100009, 0x42180009, 0x42200009, 0x42280009, 0x42300009, 0x42380009, 0x42400009, 0x42480009, 0x42500009, 0x42580009, 0x42600009, 0x42680009, 0x42700009, 0x42780009, 0x42800009, 0x42880009, 0x42900009, 0x42980009, 0x42A00009, 0x42A80009, 0x42B00009, 0x42B80009, 0x42C00009, 0x42C80009, 0x42D00009, 0x42D80009, 0x42E00009, 0x42E80009, 0x42F00009, 0x42F80009, 0x43000009, 0x43080009, 0x43100009, 0x43180009, 0x43200009, 0x43280009, 0x43300009, 0x43380009, 0x43400009, 0x43480009, 0x43500009, 0x43580009, 0x43600009, 0x43680009, 0x43700009, 0x43780009, 0x43800009, 0x43880009, 0x43900009, 0x43980009, 0x43A00009, 0x43A80009, 0x43B00009, 0x43B80009, 0x43C00009, 0x43C80009, 0x43D00009, 0x43D80009, 0x43E00009, 0x43E80009, 0x43F00009, 0x43F80009, 0x44000009, 0x44080009, 0x44100009, 0x44180009, 0x44200009, 0x110A9, 0x110C9, 0x110E9, 0x11109, 0x11129, 0x11149, 0x11169, 0x11189, 0x111A9, 0x111C9, 0x111E9, 0x11209, 0x11229, 0x11249, 0x11269, 0x11289, 0x112A9, 0x112C9, 0x112E9, 0x11309, 0x11329, 0x11349, 0x11369, 0x11389, 0x113A9, 0x113C9, 0x113E9, 0x11409, 0x11429, 0x11449, 0x11469, 0x11489, 0x114A9, 0x114C9, 0x114E9, 0x11509, 0x11529, 0x11549, 0x11569, 0x11589, 0x115A9, 0x115C9, 0x115E9, 0x11609, 0x11629, 0x11649, 0x11669, 0x11689, 0x116A9, 0x116C9, 0x116E9, 0x11709, 0x11729, 0x11749, 0x11769, 0x11789, 0x117A9, 0x117C9, 0x117E9, 0x11809, 0x11829, 0x11849, 0x11869, 0x11889, 0x118A9, 0x118C9, 0x118E9, 0x11909, 0x11929, 0x11949, 0x11969, 0x11989, 0x119A9, 0x119C9, 0x119E9, 0x11A09, 0x11A29, 0x11A49, 0x11A69, 0x11A89, 0x11AA9, 0x11AC9, 0x11AE9, 0x11B09, 0x11B29, 0x11B49, 0x11B69, 0x11B89, 0x11BA9, 0x11BC9, 0x11BE9, 0x11C09, 0x11C29, 0x11C49, 0x11C69, 0x11C89, 0x11CA9, 0x11CC9, 0x11CE9, 0x11D09, 0x11D29, 0x11D49, 0x11D69, 0xFCC9, 0x11D89, 0x11DA9, 0x11DC9, 0x11DE9, 0x11E09, 0x11E29, 0x11E49, 0xFD29, 0xFD49, 0xFD69, 0xFD89, 0xFDA9, 0xFDC9, 0xFDE9, 0xFE09, 0xFE29, 0xFE49, 0xFE69, 0xFE89, 0xFEA9, 0xFEC9, 0xFEE9, 0xFF09, 0xFF29, 0xFF49, 0xFF69, 0xFF89, 0xFFA9, 0xFFC9, 0xFFE9, 0x10009, 0x10029, 0x10049, 0x10069, 0x10089, 0x100A9, 0x100C9, 0x100E9, 0x10109, 0x10129, 0x10149, 0x47980009, 0x11E89, 0x11EA9, 0x11EC9, 0x11EE9, 0x11F09, 0x11F29, 0x10249, 0x11F49, 0x11F69, 0x11F89, 0x11FA9, 0x11FC9, 0x11FE9, 0x12009, 0x12029, 0x12049, 0x12069, 0x12089, 0x120A9, 0x120C9, 0x120E9, 0x12109, 0x12129, 0x12149, 0x12169, 0x12189, 0x121A9, 0x121C9, 0x121E9, 0x12209, 0x12229, 0x12249, 0x12269, 0x12289, 0x122A9, 0x122C9, 0x122E9, 0x12309, 0x12329, 0x12349, 0x12369, 0x48E00009, 0x48E80009, 0x48F00009, 0x48F80009, 0x49000009, 0x49080009, 0x49100009, 0x49180009, 0x49200009, 0x49280009, 0x49300009, 0x49380009, 0x49400009, 0x49480009, 0x49500009, 0x49580009, 0x49600009, 0x49680009, 0x49700009, 0x49780009, 0x49800009, 0x49880009, 0x49900009, 0x49980009, 0x49A00009, 0x49A80009, 0x49B00009, 0x49B80009, 0x49C00009, 0x49C80009, 0x49D00009, 0x39800009, 0x49D80009, 0x39700009, 0x49E00009, 0x49E80009, 0x49F00009, 0x49F80009, 0x4A000009, 0x4A080009, 0x4A100009, 0x4A180009, 0x4A200009, 0x4A280009, 0x4A300009, 0x4A380009, 0x4A400009, 0x4A480009, 0x4A500009, 0x4A580009, 0x4A600009, 0x4A680009, 0x4A700009, 0x4A780009, 0x4A800009, 0x4A880009, 0x4A900009, 0x4A980009, 0x4AA00009, 0x4AA80009, 0x4AB00009, 0x12AE9, 0x12B09, 0x12B29, 0x12B49, 0x12B69, 0x12B89, 0x4AE80009, 0x4AF00009, 0x4AF80009, 0x4B000009, 0x4B080009, 0x4B100009, 0x4B180009, 0x4B200009, 0x4B280009, 0x4B300009, 0x4B380009, 0x4B400009, 0x4B480009, 0x4B500009, 0x4B580009, 0x4B600009, 0x4B680009, 0x4B700009, 0x4B780009, 0x4B800009, 0x4B880009, 0x4B900009, 0x4B980009, 0x4BA00009, 0x4BA80009, 0x4BB00009, 0x4BB80009, 0x4BC00009, 0x4BC80009, 0x4BD00009, 0x4BD80009, 0x4BE00009, 0x4BE80009, 0x4BF00009, 0x4BF80009, 0x4C000009, 0x4C080009, 0x4C100009, 0x3B500009, 0x3B580009, 0x3B600009, 0x3B680009, 0x3B700009, 0x3B780009, 0x3B800009, 0x4C180009, 0x4C200009, 0x4C280009, 0x4C300009, 0x4C380009, 0x4C400009, 0x4C480009, 0x4C500009, 0x4C580009, 0x4C600009, 0x4C680009, 0x4C700009, 0x4C780009, 0x4C800009, 0x4C880009, 0x4C900009, 0x4C980009, 0x47300009, 0x47380009, 0x47400009, 0x47480009, 0x47500009, 0x47580009, 0x47600009, 0x47680009, 0x47700009, 0x47780009, 0x47800009, 0x47880009, 0x47900009, 0x4CA00009, 0x4CA80009, 0x4CB00009, 0x4CB80009, 0x4CC00009, 0x4CC80009, 0x4CD00009, 0x4CD80009, 0x47A00009, 0x47A80009, 0x47B00009, 0x47B80009, 0x47C00009, 0x47C80009, 0x47D00009, 0x47D80009, 0x3BF80009, 0x3C000009, 0x3C080009, 0x3C100009, 0x3C180009, 0x3C200009, 0x4CE00009, 0x4CE80009, 0x4CF00009, 0x4CF80009, 0x4D000009, 0x4D080009, 0x4D100009, 0x4D180009, 0x4D200009, 0x4D280009, 0x4D300009, 0x4D380009, 0x4D400009, 0x4D480009, 0x4D500009, 0x4D580009, 0x4D600009, 0x4D680009, 0x4D700009, 0x4D780009, 0x4D800009, 0x4D880009, 0x4D900009, 0x4D980009, 0x4DA00009, 0x4DA80009, 0x4DB00009, 0x4DB80009, 0x4DC00009, 0x4DC80009, 0x4DD00009, 0x4DD80009, 0x4DE00009, 0x4DE80009, 0x4DF00009, 0x4DF80009, 0x4E000009, 0x4E080009, 0x4E100009, 0x4E180009, 0x4E200009, 0x4E280009, 0x4E300009, 0x4E380009, 0x4E400009, 0x4E480009, 0x4E500009, 0x4E580009, 0x13989, 0x139A9, 0x139C9, 0x139E9, 0x13A09, 0x13A29, 0x13A49, 0x13A69, 0x13A89, 0x13AA9, 0x13AC9, 0x13AE9, 0x13B09, 0x13B29, 0x13B49, 0x13B69, 0x13B89, 0x13BA9, 0x13BC9, 0x13BE9, 0x13C09, 0x13C29, 0x13C49, 0x13C69, 0x13C89, 0x13CA9, 0x13CC9, 0x13CE9, 0x13D09, 0x13D29, 0x13D49, 0x13D69, 0x13D89, 0x13DA9, 0x13DC9, 0x13DE9, 0x13E09, 0x13E29, 0x13E49, 0x13E69, 0x13E89, 0x13EA9, 0x13EC9, 0x13EE9, 0x13F09, 0x13F29, 0x13F49, 0x13F69, 0x13F89, 0x13FA9, 0x13FC9, 0x13FE9, 0x14009, 0x14029, 0x14049, 0x35A12A29, 0x14069, 0x35F14089, 0x360140A9, 0x140C9, 0x363140E9, 0x36814109, 0x36B14129, 0x37214149, 0x37414169, 0x375102A9, 0x37B14189, 0x37A141A9, 0x37D10449, 0x37E141C9, 0x381141E9, 0x38214209, 0x38494229, 0x38514249, 0x38694269, 0x38914289, 0x389942A9, 0x142C9, 0x377142E9, 0x14309, 0x37314329, 0x50D00009, 0x50D80009, 0x4E780009, 0x50E00009, 0x50E80009, 0x50F00009, 0x50F80009, 0x51000009, 0x4EA00009, 0x4EA80009, 0x4EB00009, 0x4EB80009, 0x4EC00009, 0x4EC80009, 0x4ED00009, 0x4ED80009, 0x4EE00009, 0x51080009, 0x51100009, 0x51180009, 0x51200009, 0x51280009, 0x51300009, 0x51380009, 0x51400009, 0x51480009, 0x51500009, 0x51580009, 0x51600009, 0x39480009, 0x39580009, 0x51680009, 0x51700009, 0x51780009, 0x51800009, 0x51880009, 0x39C00009, 0x39C80009, 0x39D00009, 0x39F00009, 0x51900009, 0x3A180009, 0x51980009, 0x3A280009, 0x3A300009, 0x51A00009, 0x3A480009, 0x3A500009, 0x51A80009, 0x50000009, 0x51B00009, 0x50080009, 0x50100009, 0x3A580009, 0x3A600009, 0x3A680009, 0x3A700009, 0x3A780009, 0x3A800009, 0x3A880009, 0x3A900009, 0x3A980009, 0x3AA00009, 0x3AA80009, 0x3AB00009, 0x3AB80009, 0x3AC00009, 0x3AC80009, 0x3AD00009, 0x3AD80009, 0x3AE00009, 0x3AE80009, 0x51B80009, 0x51C00009, 0x51C80009, 0x51D00009, 0x51D80009, 0x51E00009, 0x51E80009, 0x51F00009, 0x3B380009, 0x3B400009, 0x3B480009, 0x51F80009, 0x52000009, 0x52080009, 0x52100009, 0x52180009, 0x52200009, 0x52280009, 0x52300009, 0x52380009, 0x52400009, 0x52480009, 0x52500009, 0x52580009, 0x52600009, 0x52680009, 0x52700009, 0x52780009, 0x52800009, 0x52880009, 0x52900009, 0x52980009, 0x52A00009, 0x52A80009, 0x52B00009, 0x52B80009, 0x52C00009, 0x52C80009, 0x52D00009, 0x52D80009, 0x52E00009, 0x52E80009, 0x52F00009, 0x52F80009, 0x53000009, 0x53080009, 0x53100009, 0x53180009, 0x53200009, 0x53280009, 0x53300009, 0x53380009, 0x53400009, 0x53480009, 0x53500009, 0x53580009, 0x53600009, 0x53680009, 0x53700009, 0x53780009, 0x53800009, 0x53880009, 0x53900009, 0x53980009, 0x53A00009, 0x14EAA, 0x14ECA, 0x14EEA, 0x14F0A, 0x14F2A, 0x14F4A, 0x14F6A, 0x14F8A, 0x14FAA, 0x14FCA, 0x14FEA, 0x1500A, 0x1502A, 0x1504A, 0x1506A, 0x1508A, 0x150AA, 0x150CA, 0x150EA, 0x1510A, 0x1512A, 0x1514A, 0x1516A, 0x1518A, 0x151AA, 0x151CA, 0x5478000A, 0x5480000A, 0x5488000A, 0x5490000A, 0x5498000A, 0x54A0000A, 0x54A8000A, 0x54B0000A, 0x54B8000A, 0x54C0000A, 0x54C8000A, 0x54D0000A, 0x54D8000A, 0x54E0000A, 0x54E8000A, 0x54F0000A, 0x54F8000A, 0x5500000A, 0x5508000A, 0x5510000A, 0x5518000A, 0x5520000A, 0x5528000A, 0x5530000A, 0x5538000A, 0x5540000A, 0x5548000A, 0x5550000A, 0x5558000A, 0x5560000A, 0x5568000A, 0x5570000A, 0x5578000A, 0x5580000A, 0x5588000A, 0x5590000A, 0x5598000A, 0x55A0000A, 0x55A8000A, 0x55B0000A, 0x55B8000A, 0x55C0000A, 0x55C8000A, 0x55D0000A, 0x55D8000A, 0x55E0000A, 0x55E8000A, 0x55F0000A, 0x55F8000A, 0x5600000A, 0x5608000A, 0x5610000A, 0x5618000A, 0x5620000A, 0x5628000A, 0x5630000A, 0x5638000A, 0x5640000A, 0x5648000A, 0x5650000A, 0x5658000A, 0x5660000A, 0x5668000A, 0x5670000A, 0x5678000A, 0x5680000A, 0x5688000A, 0x5690000A, 0x5698000A, 0x56A0000A, 0x56A8000A, 0x56B0000A, 0x56B8000A, 0x56C0000A, 0x56C8000A, 0x56D0000A, 0x56D8000A, 0x56E0000A, 0x56E8000A, 0x56F0000A, 0x56F8000A, 0x5700000A, 0x5708000A, 0x5710000A, 0x5718000A, 0x5720000A, 0x5728000A, 0x5730000A, 0x5738000A, 0x5740000A, 0x5748000A, 0x5750000A, 0x5758000A, 0x5760000A, 0x5768000A, 0x5770000A, 0x5778000A, 0x5780000A, 0x5788000A, 0x5790000A, 0x5798000A, 0x57A0000A, 0x57A8000A, 0x57B0000A, 0x57B8000A, 0x57C0000A, 0x57C8000A, 0x57D0000A, 0x57D8000A, 0x57E0000A, 0x57E8000A, 0x57F0000A, 0x57F8000A, 0x5800000A, 0x5808000A, 0x5810000A, 0x5818000A, 0x5820000A, 0x5828000A, 0x5830000A, 0x5838000A, 0x5840000A, 0x5848000A, 0x5850000A, 0x5858000A, 0x5860000A, 0x5868000A, 0x5870000A, 0x5878000A, 0x154EA, 0x15C4A, 0x1620A, 0x15C8A, 0x5888000A, 0x1624A, 0x1626A, 0x1628A, 0x162AA, 0x162CA, 0x162EA, 0x1630A, 0x1632A, 0x1552A, 0x58D0000A, 0x1556A, 0x58D8000A, 0x155AA, 0x58E0000A, 0x1562A, 0x58E8000A, 0x1566A, 0x58F0000A, 0x156AA, 0x58F8000A, 0x156EA, 0x5900000A, 0x1572A, 0x5908000A, 0x1644A, 0x1646A, 0x1648A, 0x164AA, 0x164CA, 0x164EA, 0x1650A, 0x1652A, 0x1654A, 0x1656A, 0x1658A, 0x165AA, 0x15E2A, 0x5970000A, 0x165EA, 0x1660A, 0x1662A, 0x1664A, 0x1666A, 0x1668A, 0x1602A, 0x166AA, 0x166CA, 0x166EA, 0x1670A, 0x1672A, 0x1674A, 0x1676A, 0x1678A, 0x167AA, 0x167CA, 0x167EA, 0x1680A, 0x1682A, 0x1684A, 0x1686A, 0x1688A, 0x168AA, 0x168CA, 0x168EA, 0x1690A, 0x1692A, 0x1694A, 0x1696A, 0x1698A, 0x169AA, 0x169CA, 0x169EA, 0x16A0A, 0x16A2A, 0x16A4A, 0x16A6A, 0x16A8A, 0x16AAA, 0x16ACA, 0x16AEA, 0x16B0A, 0x16B2A, 0x16B4A, 0x16B6A, 0x16B8A, 0x16BAA, 0x16BCA, 0x16BEA, 0x16C0A, 0x16C2A, 0x16C4A, 0x16C6A, 0x16C8A, 0x16CAA, 0x16CCA, 0x16CEA, 0x16D0A, 0x16D2A, 0x16D4A, 0x16D6A, 0x16D8A, 0x16DAA, 0x16DCA, 0x16DEA, 0x16E0A, 0x16E2A, 0x16E4A, 0x16E6A, 0x16E8A, 0x16EAA, 0x16ECA, 0x16EEA, 0x16F0A, 0x16F2A, 0x16F4A, 0x16F6A, 0x16F8A, 0x16FAA, 0x16FCA, 0x16FEA, 0x1700A, 0x1702A, 0x1704A, 0x1706A, 0x5C20000A, 0x170AA, 0x5C30000A, 0x170EA, 0x5C40000A, 0x1712A, 0x5C50000A, 0x1716A, 0x5C60000A, 0x171AA, 0x5C70000A, 0x171EA, 0x5C80000A, 0x1722A, 0x5C90000A, 0x1726A, 0x5CA0000A, 0x172AA, 0x5CB0000A, 0x172EA, 0x5CC0000A, 0x1732A, 0x5CD0000A, 0x1736A, 0x5CE0000A, 0x173AA, 0x5CF0000A, 0x173EA, 0x5D00000A, 0x1742A, 0x5D10000A, 0x1746A, 0x5D20000A, 0x174AA, 0x5D30000A, 0x174EA, 0x5D40000A, 0x1752A, 0x5D50000A, 0x1756A, 0x5D60000A, 0x175AA, 0x5D70000A, 0x175EA, 0x5D80000A, 0x1762A, 0x5D90000A, 0x1766A, 0x5DA0000A, 0x176AA, 0x5DB0000A, 0x176EA, 0x5DC0000A, 0x1772A, 0x5DD0000A, 0x1776A, 0x5DE0000A, 0x177AA, 0x5DF0000A, 0x177EA, 0x5E00000A, 0x1782A, 0x5E10000A, 0x1786A, 0x5E20000A, 0x178AA, 0x5E30000A, 0x178EA, 0x5E40000A, 0x1792A, 0x5E50000A, 0x1796A, 0x5E60000A, 0x179AA, 0x5E70000A, 0x179EA, 0x5E80000A, 0x17A2A, 0x5E90000A, 0x17A6A, 0x17A8A, 0x17AAA, 0x17ACA, 0x17AEA, 0x17B0A, 0x17B2A, 0x17B4A, 0x17B6A, 0x17B8A, 0x17BAA, 0x17BCA, 0x17BEA, 0x17C0A, 0x17C2A, 0x17C4A, 0x17C6A, 0x17C8A, 0x17CAA, 0x17CCA, 0x17CEA, 0x17D0A, 0x17D2A, 0x17D4A, 0x17D6A, 0x17D8A, 0x17DAA, 0x17DCA, 0x17DEA, 0x17E0A, 0x17E2A, 0x17E4A, 0x17E6A, 0x17E8A, 0x17EAA, 0x17ECA, 0x17EEA, 0x17F0A, 0x17F2A, 0x17F4A, 0x17F6A, 0x17F8A, 0x17FAA, 0x17FCA, 0x17FEA, 0x1800A, 0x1802A, 0x1804A, 0x1806A, 0x1808A, 0x180AA, 0x180CA, 0x180EA, 0x1810A, 0x6048000A, 0x1814A, 0x6058000A, 0x1818A, 0x181AA, 0x181CA, 0x6078000A, 0x1820A, 0x6088000A, 0x1824A, 0x6098000A, 0x1828A, 0x60A8000A, 0x182CA, 0x182EA, 0x1830A, 0x1832A, 0x60D0000A, 0x1836A, 0x60E0000A, 0x183AA, 0x60F0000A, 0x183EA, 0x1840A, 0x1842A, 0x6110000A, 0x1846A, 0x1848A, 0x184AA, 0x184CA, 0x184EA, 0x1850A, 0x1852A, 0x1854A, 0x1856A, 0x1858A, 0x185AA, 0x185CA, 0x185EA, 0x1860A, 0x1862A, 0x1864A, 0x1866A, 0x1868A, 0x186AA, 0x186CA, 0x186EA, 0x1870A, 0x1872A, 0x1874A, 0x1876A, 0x1878A, 0x187AA, 0x187CA, 0x187EA, 0x1880A, 0x1882A, 0x1884A, 0x1886A, 0x1888A, 0x188AA, 0x188CA, 0x188EA, 0x1890A, 0x1892A, 0x1894A, 0x1896A, 0x1898A, 0x189AA, 0x189CA, 0x189EA, 0x18A0A, 0x18A2A, 0x18A4A, 0x18A6A, 0x18A8A, 0x18AAA, 0x18ACA, 0x18AEA, 0x18B0A, 0x18B2A, 0x18B4A, 0x18B6A, 0x18B8A, 0x18BAA, 0x18BCA, 0x18BEA, 0x18C0A, 0x18C2A, 0x18C4A, 0x18C6A, 0x18C8A, 0x18CAA, 0x18CCA, 0x18CEA, 0x18D0A, 0x18D2A, 0x18D4A, 0x18D6A, 0x18D8A, 0x6368000A, 0x6370000A, 0x6378000A, 0x6380000A, 0x6388000A, 0x6390000A, 0x6398000A, 0x63A0000A, 0x63A8000A, 0x63B0000A, 0x63B8000A, 0x63C0000A, 0x63C8000A, 0x63D0000A, 0x63D8000A, 0x63E0000A, 0x63E8000A, 0x63F0000A, 0x63F8000A, 0x6400000A, 0x6408000A, 0x6410000A, 0x6418000A, 0x6420000A, 0x190AA, 0x190CA, 0x190EA, 0x1910A, 0x1912A, 0x1914A, 0x1916A, 0x1918A, 0x191AA, 0x191CA, 0x191EA, 0x1920A, 0x1922A, 0x1924A, 0x1926A, 0x1928A, 0x192AA, 0x192CA, 0x192EA, 0x1930A, 0x1932A, 0x1934A, 0x1936A, 0x1938A, 0x193AA, 0x193CA, 0x193EA, 0x1940A, 0x1942A, 0x1944A, 0x1946A, 0x1948A, 0x194AA, 0x194CA, 0x194EA, 0x1950A, 0x1952A, 0x1954A, 0x1956A, 0x1958A, 0x195AA, 0x195CA, 0x195EA, 0x1960A, 0x1962A, 0x1964A, 0x1966A, 0x1968A, 0x196AA, 0x196CA, 0x196EA, 0x1970A, 0x1972A, 0x1974A, 0x1976A, 0x1978A, 0x197AA, 0x197CA, 0x197EA, 0x1980A, 0x1982A, 0x1984A, 0x1986A, 0x1988A, 0x198AA, 0x198CA, 0x198EA, 0x1990A, 0x1992A, 0x1994A, 0x1996A, 0x1998A, 0x199AA, 0x199CA, 0x199EA, 0x19A0A, 0x19A2A, 0x19A4A, 0x19A6A, 0x19A8A, 0x19AAA, 0x19ACA, 0x19AEA, 0x19B0A, 0x19B2A, 0x19B4A, 0x19B6A, 0x19B8A, 0x19BAA, 0x19BCA, 0x19BEA, 0x19C0A, 0x19C2A, 0x19C4A, 0x19C6A, 0x19C8A, 0x19CAA, 0x19CCA, 0x19CEA, 0x19D0A, 0x19D2A, 0x19D4A, 0x19D6A, 0x19D8A, 0x19DAA, 0x19DCA, 0x19DEA, 0x19E0A, 0x19E2A, 0x19E4A, 0x19E6A, 0x19E8A, 0x19EAA, 0x19ECA, 0x19EEA, 0x19F0A, 0x19F2A, 0x19F4A, 0x19F6A, 0x19F8A, 0x19FAA, 0x19FCA, 0x19FEA, 0x1A00A, 0x1A02A, 0x1A04A, 0x1A06A, 0x1A08A, 0x1A0AA, 0x1A0CA, 0x1A0EA, 0x1A10A, 0x1A12A, 0x1A14A, 0x1A16A, 0x1A18A, 0x1A1AA, 0x1A1CA, 0x1A1EA, 0x1A20A, 0x1A22A, 0x1A24A, 0x1A26A, 0x1A28A, 0x1638A, 0x68A8000A, 0x1A2CA, 0x1A2EA, 0x1A30A, 0x1A32A, 0x1A34A, 0x1A36A, 0x1A38A, 0x1A3AA, 0x1A3CA, 0x1A3EA, 0x1A40A, 0x1A42A, 0x1A44A, 0x1A46A, 0x1A48A, 0x1A4AA, 0x1A4CA, 0x1A4EA, 0x1A50A, 0x1A52A, 0x1A54A, 0x1A56A, 0x1A58A, 0x1A5AA, 0x1A5CA, 0x1A5EA, 0x1A60A, 0x1A62A, 0x1A64A, 0x1A66A, 0x1A68A, 0x1A6AA, 0x1A6CA, 0x1A6EA, 0x1A70A, 0x1A72A, 0x1A74A, 0x1A76A, 0x1A78A, 0x1A7AA, 0x1A7CA, 0x1728A, 0x69F8000A, 0x172CA, 0x6A00000A, 0x1730A, 0x6A08000A, 0x173CA, 0x6A10000A, 0x1740A, 0x6A18000A, 0x1744A, 0x6A20000A, 0x1748A, 0x6A28000A, 0x174CA, 0x6A30000A, 0x1750A, 0x6A38000A, 0x1754A, 0x6A40000A, 0x1758A, 0x6A48000A, 0x175CA, 0x6A50000A, 0x1760A, 0x6A58000A, 0x1764A, 0x6A60000A, 0x1768A, 0x6A68000A, 0x176CA, 0x6A70000A, 0x1770A, 0x6A78000A, 0x1774A, 0x6A80000A, 0x1778A, 0x6A88000A, 0x177CA, 0x6A90000A, 0x1780A, 0x6A98000A, 0x1784A, 0x6AA0000A, 0x1788A, 0x6AA8000A, 0x178CA, 0x6AB0000A, 0x1790A, 0x6AB8000A, 0x1794A, 0x6AC0000A, 0x1798A, 0x6AC8000A, 0x179CA, 0x6AD0000A, 0x17A0A, 0x6AD8000A, 0x17A4A, 0x6AE0000A, 0x1ABAA, 0x1ABCA, 0x6AF8000A, 0x1AC0A, 0x6B08000A, 0x1AC4A, 0x6B18000A, 0x1AC8A, 0x6B28000A, 0x1ACCA, 0x6B38000A, 0x1AD0A, 0x6B48000A, 0x1AD4A, 0x6B58000A, 0x1AD8A, 0x6B68000A, 0x1ADCA, 0x6B78000A, 0x1AE0A, 0x6B88000A, 0x1AE4A, 0x6B98000A, 0x1AE8A, 0x6BA8000A, 0x1AECA, 0x6BB8000A, 0x1AF0A, 0x6BC8000A, 0x1AF4A, 0x6BD8000A, 0x6BE0000A, 0x6BE8000A, 0x6BF0000A, 0x6BF8000A, 0x6C00000A, 0x6C08000A, 0x1B04A, 0x1B06A, 0x1B08A, 0x1B0AA, 0x1B0CA, 0x1B0EA, 0x1B10A, 0x1B12A, 0x1B14A, 0x1B16A, 0x1B18A, 0x1B1AA, 0x1B1CA, 0x1B1EA, 0x1B20A, 0x1B22A, 0x1B24A, 0x1B26A, 0x1B28A, 0x1B2AA, 0x1B2CA, 0x1B2EA, 0x1B30A, 0x1B32A, 0x1B34A, 0x1B36A, 0x1B38A, 0x1B3AA, 0x1B3CA, 0x1B3EA, 0x1B40A, 0x1B42A, 0x1B44A, 0x1B46A, 0x1B48A, 0x1B4AA, 0x1B4CA, 0x1B4EA, 0x1B50A, 0x1B52A, 0x1B54A, 0x1B56A, 0x1B58A, 0x1B5AA, 0x1B5CA, 0x1B5EA, 0x1B60A, 0x1B62A, 0x1B64A, 0x1B66A, 0x1B68A, 0x1B6AA, 0x1B6CA, 0x1B6EA, 0x1B70A, 0x1B72A, 0x1B74A, 0x1B76A, 0x1B78A, 0x1B7AA, 0x1B7CA, 0x1B7EA, 0x1B80A, 0x1B82A, 0x1B84A, 0x1B86A, 0x1B88A, 0x1B8AA, 0x1B8CA, 0x1B8EA, 0x1B90A, 0x1B92A, 0x1B94A, 0x1B96A, 0x1B98A, 0x1B9AA, 0x1B9CA, 0x1B9EA, 0x1BA0A, 0x1BA2A, 0x1BA4A, 0x1BA6A, 0x1BA8A, 0x1BAAA, 0x1BACA, 0x1BAEA, 0x1BB0A, 0x1BB2A, 0x1BB4A, 0x1BB6A, 0x1BB8A, 0x1BBAA, 0x1BBCA, 0x1BBEA, 0x1BC0A, 0x1BC2A, 0x1BC4A, 0x1BC6A, 0x1BC8A, 0x1BCAA, 0x1BCCA, 0x1BCEA, 0x1BD0A, 0x1BD2A, 0x1BD4A, 0x1BD6A, 0x1BD8A, 0x1BDAA, 0x1BDCA, 0x1BDEA, 0x1BE0A, 0x1BE2A, 0x1BE4A, 0x1BE6A, 0x1BE8A, 0x1BEAA, 0x1BECA, 0x1BEEA, 0x1BF0A, 0x1BF2A, 0x1BF4A, 0x1BF6A, 0x1BF8A, 0x1BFAA, 0x1BFCA, 0x1BFEA, 0x1C00A, 0x1C02A, 0x1C04A, 0x1C06A, 0x1C08A, 0x1C0AA, 0x1C0CA, 0x1C0EA, 0x1C10A, 0x1C12A, 0x1C14A, 0x1C16A, 0x1C18A, 0x1C1AA, 0x1C1CA, 0x1C1EA, 0x1C20A, 0x1C22A, 0x1C24A, 0x7098000A, 0x70A0000A, 0x70A8000A, 0x70B0000A, 0x70B8000A, 0x70C0000A, 0x70C8000A, 0x70D0000A, 0x70D8000A, 0x70E0000A, 0x70E8000A, 0x70F0000A, 0x70F8000A, 0x7100000A, 0x7108000A, 0x7110000A, 0x7118000A, 0x7120000A, 0x7128000A, 0x7130000A, 0x7138000A, 0x7140000A, 0x7148000A, 0x7150000A, 0x7158000A, 0x7160000A, 0x7168000A, 0x7170000A, 0x7178000A, 0x7180000A, 0x7188000A, 0x7190000A, 0x7198000A, 0x71A0000A, 0x71A8000A, 0x71B0000A, 0x71B8000A, 0x71C0000A, 0x71C8000A, 0x71D0000A, 0x71D8000A, 0x71E0000A, 0x71E8000A, 0x71F0000A, 0x71F8000A, 0x7200000A, 0x7208000A, 0x7210000A, 0x7218000A, 0x7220000A, 0x7228000A, 0x7230000A, 0x7238000A, 0x7240000A, 0x7248000A, 0x7250000A, 0x7258000A, 0x7260000A, 0x7268000A, 0x7270000A, 0x7278000A, 0x7280000A, 0x7288000A, 0x7290000A, 0x7298000A, 0x72A0000A, 0x72A8000A, 0x72B0000A, 0x72B8000A, 0x72C0000A, 0x72C8000A, 0x72D0000A, 0x72D8000A, 0x72E0000A, 0x72E8000A, 0x72F0000A, 0x5BD8000A, 0x5BE0000A, 0x5BE8000A, 0x5BF0000A, 0x5BF8000A, 0x72F8000A, 0x7300000A, 0x7308000A, 0x7310000A, 0x6928000A, 0x6930000A, 0x6938000A, 0x6940000A, 0x6948000A, 0x6950000A, 0x6958000A, 0x6960000A, 0x6968000A, 0x7318000A, 0x6978000A, 0x6980000A, 0x6988000A, 0x6990000A, 0x6998000A, 0x69A0000A, 0x69A8000A, 0x69B0000A, 0x69B8000A, 0x69C0000A, 0x69C8000A, 0x69D0000A, 0x69D8000A, 0x69E0000A, 0x69E8000A, 0x69F0000A, 0x7320000A, 0x7328000A, 0x7330000A, 0x7338000A, 0x7340000A, 0x7348000A, 0x7350000A, 0x7358000A, 0x7360000A, 0x7368000A, 0x7370000A, 0x7378000A, 0x7380000A, 0x7388000A, 0x7390000A, 0x7398000A, 0x73A0000A, 0x73A8000A, 0x73B0000A, 0x73B8000A, 0x73C0000A, 0x73C8000A, 0x73D0000A, 0x73D8000A, 0x73E0000A, 0x73E8000A, 0x73F0000A, 0x73F8000A, 0x7400000A, 0x7408000A, 0x7410000A, 0x7418000A, 0x7420000A, 0x7428000A, 0x7430000A, 0x7438000A, 0x7440000A, 0x7448000A, 0x7450000A, 0x7458000A, 0x7460000A, 0x7468000A, 0x7470000A, 0x7478000A, 0x7480000A, 0x7488000A, 0x7490000A, 0x7498000A, 0x74A0000A, 0x74A8000A, 0x74B0000A, 0x74B8000A, 0x74C0000A, 0x74C8000A, 0x74D0000A, 0x74D8000A, 0x74E0000A, 0x74E8000A, 0x74F0000A, 0x74F8000A, 0x7500000A, 0x7508000A, 0x7510000A, 0x7518000A, 0x7520000A, 0x7528000A, 0x7530000A, 0x7538000A, 0x7540000A, 0x7548000A, 0x7550000A, 0x7558000A, 0x7560000A, 0x7568000A, 0x7570000A, 0x7578000A, 0x7580000A, 0x7588000A, 0x7590000A, 0x7598000A, 0x75A0000A, 0x75A8000A, 0x75B0000A, 0x75B8000A, 0x6D40000A, 0x6D48000A, 0x6D50000A, 0x6D58000A, 0x6D60000A, 0x6D68000A, 0x6D70000A, 0x6D78000A, 0x6D80000A, 0x6D88000A, 0x6D90000A, 0x6D98000A, 0x6DA0000A, 0x6DA8000A, 0x6DB0000A, 0x6DB8000A, 0x6DC0000A, 0x6DC8000A, 0x6DD0000A, 0x6DD8000A, 0x6DE0000A, 0x6DE8000A, 0x6DF0000A, 0x6DF8000A, 0x75C0000A, 0x75C8000A, 0x75D0000A, 0x75D8000A, 0x75E0000A, 0x75E8000A, 0x75F0000A, 0x75F8000A, 0x7600000A, 0x7608000A, 0x7610000A, 0x7618000A, 0x7620000A, 0x7628000A, 0x7630000A, 0x7638000A, 0x7640000A, 0x7648000A, 0x7650000A, 0x7658000A, 0x7660000A, 0x7668000A, 0x7670000A, 0x7678000A, 0x7680000A, 0x7688000A, 0x7690000A, 0x7698000A, 0x76A0000A, 0x76A8000A, 0x76B0000A, 0x76B8000A, 0x76C0000A, 0x76C8000A, 0x76D0000A, 0x76D8000A, 0x76E0000A, 0x76E8000A, 0x76F0000A, 0x76F8000A, 0x7700000A, 0x7708000A, 0x7710000A, 0x7718000A, 0x7720000A, 0x7728000A, 0x7730000A, 0x7738000A, 0x7740000A, 0x7748000A, 0x7750000A, 0x7758000A, 0x7760000A, 0x1DDAB, 0x1DDCB, 0x1DDEB, 0x1DE0B, 0x1DE2B, 0x1DE4B, 0x1DE6B, 0x1DE8B, 0x1DEAB, 0x1DECB, 0x1DEEB, 0x1DF0B, 0x1DF2B, 0x1DF4B, 0x1DF6B, 0x1DF8B, 0x1DFAB, 0x1DFCB, 0x1DFEB, 0x1E00B, 0x1E02B, 0x1E04B, 0x1E06B, 0x1E08B, 0x1E0AB, 0x1E0CB, 0x1E0EB, 0x7840000B, 0x1E12B, 0x7850000B, 0x1E16B, 0x7860000B, 0x1E1AB, 0x7870000B, 0x1E1EB, 0x7880000B, 0x1E22B, 0x7890000B, 0x1E26B, 0x78A0000B, 0x1E2AB, 0x78B0000B, 0x1E2EB, 0x78C0000B, 0x1E32B, 0x78D0000B, 0x1E36B, 0x78E0000B, 0x1E3AB, 0x78F0000B, 0x1E3EB, 0x7900000B, 0x1E42B, 0x7910000B, 0x1E46B, 0x7920000B, 0x1E4AB, 0x7930000B, 0x1E4EB, 0x7940000B, 0x1E52B, 0x7950000B, 0x1E56B, 0x7960000B, 0x1E5AB, 0x7970000B, 0x1E5EB, 0x7980000B, 0x1E62B, 0x7990000B, 0x1E66B, 0x79A0000B, 0x1E6AB, 0x79B0000B, 0x1E6EB, 0x79C0000B, 0x1E72B, 0x79D0000B, 0x1E76B, 0x79E0000B, 0x1E7AB, 0x79F0000B, 0x1E7EB, 0x7A00000B, 0x1E82B, 0x7A10000B, 0x1E86B, 0x7A20000B, 0x1E8AB, 0x7A30000B, 0x1E8EB, 0x7A40000B, 0x1E92B, 0x7A50000B, 0x1E96B, 0x7A60000B, 0x1E9AB, 0x7A70000B, 0x1E9EB, 0x7A80000B, 0x1EA2B, 0x7A90000B, 0x1EA6B, 0x7AA0000B, 0x1EAAB, 0x7AB0000B, 0x1EAEB, 0x7AC0000B, 0x1EB2B, 0x7AD0000B, 0x1EB6B, 0x7AE0000B, 0x1EBAB, 0x7AF0000B, 0x1EBEB, 0x7B00000B, 0x1EC2B, 0x7B10000B, 0x1EC6B, 0x7B20000B, 0x1ECAB, 0x7B30000B, 0x1ECEB, 0x7838000B, 0x1ED0B, 0x7848000B, 0x1ED2B, 0x7858000B, 0x1ED4B, 0x7868000B, 0x1ED6B, 0x7878000B, 0x1ED8B, 0x7888000B, 0x1EDAB, 0x7898000B, 0x1EDCB, 0x78A8000B, 0x1EDEB, 0x78B8000B, 0x1EE0B, 0x78C8000B, 0x1EE2B, 0x78D8000B, 0x1EE4B, 0x78E8000B, 0x1EE6B, 0x78F8000B, 0x1EE8B, 0x7908000B, 0x1EEAB, 0x7918000B, 0x1EECB, 0x7928000B, 0x1EEEB, 0x7938000B, 0x1EF0B, 0x7948000B, 0x1EF2B, 0x7958000B, 0x1EF4B, 0x7968000B, 0x1EF6B, 0x7978000B, 0x1EF8B, 0x7988000B, 0x1EFAB, 0x7998000B, 0x1EFCB, 0x79A8000B, 0x1EFEB, 0x79B8000B, 0x1F00B, 0x79C8000B, 0x1F02B, 0x79D8000B, 0x1F04B, 0x79E8000B, 0x1F06B, 0x79F8000B, 0x1F08B, 0x7A08000B, 0x1F0AB, 0x7A18000B, 0x1F0CB, 0x7A28000B, 0x7C41F0EB, 0x7C48000B, 0x1F14B, 0x7C58000B, 0x7C60000B, 0x7C68000B, 0x7C70000B, 0x7C78000B, 0x7C80000B, 0x7C88000B, 0x7C90000B, 0x7C98000B, 0x7CA0000B, 0x7CA8000B, 0x7CB0000B, 0x7CB8000B, 0x7CC0000B, 0x7CC8000B, 0x7CD0000B, 0x7CD8000B, 0x7CE0000B, 0x7CE8000B, 0x7CF0000B, 0x7CF8000B, 0x7D00000B, 0x7D08000B, 0x7D10000B, 0x7D18000B, 0x7D20000B, 0x7D28000B, 0x7D30000B, 0x7D38000B, 0x7D40000B, 0x7D48000B, 0x7D50000B, 0x7D58000B, 0x7D60000B, 0x7D68000B, 0x7D70000B, 0x7D78000B, 0x7D80000B, 0x7D88000B, 0x7D90000B, 0x7D98000B, 0x7DA0000B, 0x7DA8000B, 0x7DB0000B, 0x7DB8000B, 0x7DC0000B, 0x7DC8000B, 0x1F74B, 0x7DD8000B, 0x7DE0000B, 0x7DE8000B, 0x7DF0000B, 0x7DF8000B, 0x7E00000B, 0x7E08000B, 0x7E10000B, 0x7E18000B, 0x7E20000B, 0x7E28000B, 0x7E30000B, 0x7E38000B, 0x7E40000B, 0x7E48000B, 0x7E50000B, 0x7E58000B, 0x7E60000B, 0x7E68000B, 0x7E70000B, 0x7E78000B, 0x7E80000B, 0x7E88000B, 0x7E90000B, 0x7E98000B, 0x7EA0000B, 0x7EA8000B, 0x7EB0000B, 0x7EB8000B, 0x7EC0000B, 0x7EC8000B, 0x7ED0000B, 0x7ED8000B, 0x7EE0000B, 0x7EE8000B, 0x7EF0000B, 0x7EF8000B, 0x7F00000B, 0x7F08000B, 0x7F10000B, 0x7F18000B, 0x7F20000B, 0x7F28000B, 0x7F30000B, 0x7F38000B, 0x7F40000B, 0x7F48000B, 0x7F50000B, 0x7F58000B, 0x7F60000B, 0x7F68000B, 0x7F70000B, 0x7F78000B, 0x7F80000B, 0x7F88000B, 0x7F90000B, 0x7F98000B, 0x7FA0000B, 0x7FA8000B, 0x7FB0000B, 0x7FB8000B, 0x7FC0000B, 0x7FC8000B, 0x7FD0000B, 0x7FD8000B, 0x7FE0000B, 0x7FE8000B, 0x7FF0000B, 0x7FF8000B, 0x8000000B, 0x8008000B, 0x8010000B, 0x8018000B, 0x8020000B, 0x8028000B, 0x8030000B, 0x8038000B, 0x2010B, 0x8048000B, 0x2014B, 0x8058000B, 0x2018B, 0x8068000B, 0x201CB, 0x8078000B, 0x2020B, 0x8088000B, 0x2024B, 0x8098000B, 0x2028B, 0x80A8000B, 0x202CB, 0x80B8000B, 0x2030B, 0x80C8000B, 0x2034B, 0x80D8000B, 0x2038B, 0x80E8000B, 0x203CB, 0x80F8000B, 0x2040B, 0x8108000B, 0x2044B, 0x8118000B, 0x2048B, 0x8128000B, 0x204CB, 0x8138000B, 0x2050B, 0x8148000B, 0x2054B, 0x8158000B, 0x2058B, 0x8168000B, 0x205CB, 0x8178000B, 0x2060B, 0x8188000B, 0x2064B, 0x8198000B, 0x2068B, 0x81A8000B, 0x206CB, 0x81B8000B, 0x2070B, 0x81C8000B, 0x2074B, 0x81D8000B, 0x2078B, 0x81E8000B, 0x207CB, 0x81F8000B, 0x2080B, 0x8208000B, 0x2084B, 0x8218000B, 0x2088B, 0x8228000B, 0x208CB, 0x8238000B, 0x2090B, 0x8248000B, 0x2094B, 0x8258000B, 0x2098B, 0x8268000B, 0x209CB, 0x8278000B, 0x20A0B, 0x8288000B, 0x20A4B, 0x8298000B, 0x20A8B, 0x82A8000B, 0x20ACB, 0x82B8000B, 0x20B0B, 0x20B2B, 0x20B4B, 0x20B6B, 0x20B8B, 0x20BAB, 0x20BCB, 0x20BEB, 0x20C0B, 0x20C2B, 0x20C4B, 0x20C6B, 0x20C8B, 0x20CAB, 0x20CCB, 0x20CEB, 0x20D0B, 0x20D2B, 0x20D4B, 0x20D6B, 0x20D8B, 0x20DAB, 0x20DCB, 0x20DEB, 0x20E0B, 0x20E2B, 0x20E4B, 0x20E6B, 0x20E8B, 0x20EAB, 0x20ECB, 0x20EEB, 0x20F0B, 0x20F2B, 0x20F4B, 0x20F6B, 0x20F8B, 0x20FAB, 0x20FCB, 0x20FEB, 0x2100B, 0x2102B, 0x2104B, 0x2106B, 0x2108B, 0x210AB, 0x210CB, 0x210EB, 0x2110B, 0x2112B, 0x2114B, 0x2116B, 0x2118B, 0x211AB, 0x8470000B, 0x211EB, 0x8480000B, 0x2122B, 0x2124B, 0x2126B, 0x84A0000B, 0x212AB, 0x84B0000B, 0x212EB, 0x84C0000B, 0x2132B, 0x84D0000B, 0x2136B, 0x2138B, 0x213AB, 0x213CB, 0x84F8000B, 0x2140B, 0x8508000B, 0x2144B, 0x8518000B, 0x2148B, 0x214AB, 0x214CB, 0x8538000B, 0x2150B, 0x2152B, 0x2154B, 0x2156B, 0x2158B, 0x215AB, 0x215CB, 0x215EB, 0x2160B, 0x2162B, 0x2164B, 0x2166B, 0x2168B, 0x216AB, 0x216CB, 0x216EB, 0x2170B, 0x2172B, 0x2174B, 0x2176B, 0x2178B, 0x217AB, 0x217CB, 0x217EB, 0x2180B, 0x2182B, 0x2184B, 0x2186B, 0x2188B, 0x218AB, 0x218CB, 0x218EB, 0x2190B, 0x2192B, 0x2194B, 0x2196B, 0x2198B, 0x219AB, 0x219CB, 0x219EB, 0x21A0B, 0x21A2B, 0x21A4B, 0x21A6B, 0x21A8B, 0x21AAB, 0x21ACB, 0x21AEB, 0x86C0000B, 0x86C8000B, 0x86D0000B, 0x86D8000B, 0x86E0000B, 0x86E8000B, 0x86F0000B, 0x86F8000B, 0x8700000B, 0x8708000B, 0x8710000B, 0x8718000B, 0x8720000B, 0x8728000B, 0x8730000B, 0x8738000B, 0x8740000B, 0x8748000B, 0x8750000B, 0x8758000B, 0x8760000B, 0x8768000B, 0x8770000B, 0x8778000B, 0x8780000B, 0x8788000B, 0x8790000B, 0x8798000B, 0x87A0000B, 0x87A8000B, 0x87B0000B, 0x87B8000B, 0x87C0000B, 0x87C8000B, 0x87D0000B, 0x87D8000B, 0x87E0000B, 0x87E8000B, 0x87F0000B, 0x87F8000B, 0x8800000B, 0x8808000B, 0x8810000B, 0x8818000B, 0x8820000B, 0x8828000B, 0x8830000B, 0x8838000B, 0x8840000B, 0x8848000B, 0x2214B, 0x2216B, 0x2218B, 0x221AB, 0x221CB, 0x221EB, 0x2220B, 0x2222B, 0x2224B, 0x2226B, 0x2228B, 0x222AB, 0x222CB, 0x222EB, 0x2230B, 0x2232B, 0x2234B, 0x2236B, 0x2238B, 0x223AB, 0x223CB, 0x223EB, 0x2240B, 0x2242B, 0x2244B, 0x2246B, 0x2248B, 0x224AB, 0x224CB, 0x224EB, 0x2250B, 0x2252B, 0x2254B, 0x2256B, 0x2258B, 0x225AB, 0x225CB, 0x225EB, 0x2260B, 0x2262B, 0x2264B, 0x2266B, 0x2268B, 0x226AB, 0x226CB, 0x226EB, 0x2270B, 0x2272B, 0x2274B, 0x2276B, 0x2278B, 0x227AB, 0x227CB, 0x227EB, 0x2280B, 0x2282B, 0x2284B, 0x2286B, 0x2288B, 0x228AB, 0x228CB, 0x228EB, 0x2290B, 0x2292B, 0x2294B, 0x2296B, 0x2298B, 0x229AB, 0x229CB, 0x229EB, 0x22A0B, 0x22A2B, 0x22A4B, 0x22A6B, 0x22A8B, 0x22AAB, 0x22ACB, 0x22AEB, 0x22B0B, 0x22B2B, 0x22B4B, 0x22B6B, 0x22B8B, 0x22BAB, 0x22BCB, 0x22BEB, 0x22C0B, 0x22C2B, 0x22C4B, 0x22C6B, 0x22C8B, 0x22CAB, 0x22CCB, 0x22CEB, 0x22D0B, 0x22D2B, 0x22D4B, 0x22D6B, 0x22D8B, 0x22DAB, 0x22DCB, 0x22DEB, 0x22E0B, 0x22E2B, 0x22E4B, 0x22E6B, 0x22E8B, 0x22EAB, 0x22ECB, 0x22EEB, 0x22F0B, 0x22F2B, 0x22F4B, 0x22F6B, 0x22F8B, 0x22FAB, 0x22FCB, 0x22FEB, 0x2300B, 0x2302B, 0x2304B, 0x2306B, 0x2308B, 0x230AB, 0x230CB, 0x230EB, 0x2310B, 0x2312B, 0x2314B, 0x2316B, 0x2318B, 0x231AB, 0x231CB, 0x231EB, 0x2320B, 0x2322B, 0x2324B, 0x2326B, 0x2328B, 0x232AB, 0x232CB, 0x232EB, 0x2330B, 0x2332B, 0x2334B, 0x8CD8000B, 0x1FCCB, 0x1FCEB, 0x1FD0B, 0x1FD2B, 0x1FD4B, 0x1FD6B, 0x1FD8B, 0x1FDAB, 0x1FDCB, 0x1FDEB, 0x1FE0B, 0x2338B, 0x233AB, 0x233CB, 0x233EB, 0x2340B, 0x2342B, 0x2344B, 0x2346B, 0x2348B, 0x1FE2B, 0x1FE4B, 0x1FE6B, 0x1FE8B, 0x1FEAB, 0x1FECB, 0x1FEEB, 0x1FF0B, 0x1FF2B, 0x1FF4B, 0x1FF6B, 0x1FF8B, 0x1FFAB, 0x1FFCB, 0x1FFEB, 0x2000B, 0x2002B, 0x2004B, 0x2006B, 0x2008B, 0x200AB, 0x200CB, 0x200EB, 0x234AB, 0x234CB, 0x234EB, 0x2350B, 0x2352B, 0x2354B, 0x2356B, 0x2358B, 0x235AB, 0x235CB, 0x235EB, 0x2360B, 0x2362B, 0x2364B, 0x2366B, 0x2368B, 0x236AB, 0x236CB, 0x236EB, 0x2370B, 0x2372B, 0x2374B, 0x2376B, 0x2378B, 0x237AB, 0x237CB, 0x237EB, 0x2380B, 0x2382B, 0x2384B, 0x2386B, 0x2388B, 0x8E3238AB, 0x8E4238EB, 0x8E52392B, 0x8E62396B, 0x8E7239AB, 0x8E8239EB, 0x8E923A2B, 0x8EA23A6B, 0x8EB23AAB, 0x8EC23AEB, 0x8ED23B2B, 0x8EE23B6B, 0x8EF23BAB, 0x8F023BEB, 0x8F123C2B, 0x8F223C6B, 0x8F323CAB, 0x8F423CEB, 0x8F523D2B, 0x8F623D6B, 0x8F723DAB, 0x8F823DEB, 0x8F923E2B, 0x8FA23E6B, 0x8FB23EAB, 0x8FC23EEB, 0x8FD23F2B, 0x8FE23F6B, 0x8FF23FAB, 0x90023FEB, 0x8CDA402B, 0x901A404B, 0x902A408B, 0x903A40CB, 0x904A410B, 0x905A414B, 0x906A418B, 0x907A41CB, 0x908A420B, 0x909A424B, 0x90AA428B, 0x90BA42CB, 0x90CA430B, 0x90DA434B, 0x90EA438B, 0x90FA43CB, 0x9100000B, 0x9108000B, 0x9110000B, 0x9118000B, 0x9120000B, 0x9128000B, 0x9130000B, 0x9138000B, 0x9140000B, 0x9148000B, 0x9150000B, 0x9158000B, 0x9160000B, 0x9168000B, 0x9170000B, 0x9178000B, 0x9180000B, 0x9188000B, 0x9190000B, 0x9198000B, 0x91A0000B, 0x91A8000B, 0x91B0000B, 0x91B8000B, 0x91C0000B, 0x91C8000B, 0x91D0000B, 0x91D8000B, 0x91E0000B, 0x91E8000B, 0x91F0000B, 0x91F8000B, 0x9200000B, 0x9208000B, 0x9210000B, 0x9218000B, 0x9220000B, 0x9228000B, 0x9230000B, 0x9238000B, 0x9240000B, 0x9248000B, 0x9250000B, 0x9258000B, 0x9260000B, 0x9268000B, 0x9270000B, 0x9278000B, 0x9280000B, 0x9288000B, 0x9290000B, 0x9298000B, 0x92A0000B, 0x92A8000B, 0x92B0000B, 0x92B8000B, 0x92C0000B, 0x92C8000B, 0x92D0000B, 0x92D8000B, 0x92E0000B, 0x92E8000B, 0x92F0000B, 0x92F8000B, 0x9300000B, 0x9308000B, 0x9310000B, 0x9318000B, 0x9320000B, 0x9328000B, 0x9330000B, 0x9338000B, 0x9340000B, 0x9348000B, 0x82C0000B, 0x9350000B, 0x9358000B, 0x9360000B, 0x9368000B, 0x9370000B, 0x9378000B, 0x9380000B, 0x82D8000B, 0x82E0000B, 0x82E8000B, 0x82F0000B, 0x82F8000B, 0x8300000B, 0x8308000B, 0x8310000B, 0x8318000B, 0x8320000B, 0x9388000B, 0x9390000B, 0x9398000B, 0x93A0000B, 0x93A8000B, 0x93B0000B, 0x93B8000B, 0x93C0000B, 0x8368000B, 0x8370000B, 0x8378000B, 0x8380000B, 0x8388000B, 0x8390000B, 0x8398000B, 0x83A0000B, 0x83A8000B, 0x83B0000B, 0x83B8000B, 0x83C0000B, 0x83C8000B, 0x83D0000B, 0x83D8000B, 0x83E0000B, 0x83E8000B, 0x83F0000B, 0x83F8000B, 0x8400000B, 0x8408000B, 0x8410000B, 0x8418000B, 0x8420000B, 0x8428000B, 0x8430000B, 0x8438000B, 0x8460000B, 0x93C8000B, 0x93D0000B, 0x93D8000B, 0x93E0000B, 0x93E8000B, 0x93F0000B, 0x8490000B, 0x93F8000B, 0x9400000B, 0x9408000B, 0x9410000B, 0x9418000B, 0x9420000B, 0x9428000B, 0x9430000B, 0x8540000B, 0x9438000B, 0x9440000B, 0x9448000B, 0x9450000B, 0x9458000B, 0x9460000B, 0x9468000B, 0x9470000B, 0x9478000B, 0x9480000B, 0x9488000B, 0x9490000B, 0x9498000B, 0x94A0000B, 0x94A8000B, 0x94B0000B, 0x94B8000B, 0x94C0000B, 0x94C8000B, 0x94D0000B, 0x94D8000B, 0x94E0000B, 0x94E8000B, 0x94F0000B, 0x94F8000B, 0x9500000B, 0x9508000B, 0x9510000B, 0x9518000B, 0x9520000B, 0x9528000B, 0x9530000B, 0x9538000B, 0x9540000B, 0x9548000B, 0x9550000B, 0x9558000B, 0x9560000B, 0x9568000B, 0x9570000B, 0x9578000B, 0x9580000B, 0x9588000B, 0x9590000B, 0x9598000B, 0x95A0000B, 0x95A8000B, 0x95B0000B, 0x95B8000B, 0x95C0000B, 0x95C8000B, 0x95D0000B, 0x95D8000B, 0x95E0000B, 0x95E8000B, 0x95F0000B, 0x95F8000B, 0x9600000B, 0x9608000B, 0x9610000B, 0x9618000B, 0x9620000B, 0x9628000B, 0x9630000B, 0x9638000B, 0x9640000B, 0x9648000B, 0x9650000B, 0x9658000B, 0x9660000B, 0x9668000B, 0x9670000B, 0x9678000B, 0x9680000B, 0x9688000B, 0x9690000B, 0x9698000B, 0x96A0000B, 0x96A8000B, 0x96B0000B, 0x96B8000B, 0x96C0000B, 0x96C8000B, 0x96D0000B, 0x96D8000B, 0x96E0000B, 0x96E8000B, 0x96F0000B, 0x96F8000B, 0x9700000B, 0x9708000B, 0x9710000B, 0x9718000B, 0x9720000B, 0x9728000B, 0x9730000B, 0x9738000B, 0x9740000B, 0x9748000B, 0x9750000B, 0x9758000B, 0x9760000B, 0x9768000B, 0x9770000B, 0x9778000B, 0x9780000B, 0x9788000B, 0x9790000B, 0x9798000B, 0x97A0000B, 0x97A8000B, 0x97B0000B, 0x97B8000B, 0x97C0000B, 0x97C8000B, 0x97D0000B, 0x97D8000B, 0x97E0000B, 0x97E8000B, 0x97F0000B, 0x97F8000B, 0x9800000B, 0x9808000B, 0x9810000B, 0x9818000B, 0x9820000B, 0x9828000B, 0x9830000B, 0x9838000B, 0x9840000B, 0x9848000B, 0x9850000B, 0x9858000B, 0x9860000B, 0x9868000B, 0x9870000B, 0x9878000B, 0x9880000B, 0x9888000B, 0x9890000B, 0x9898000B, 0x98A0000B, 0x98A8000B, 0x98B0000B, 0x98B8000B, 0x98C0000B, 0x98C8000B, 0x98D0000B, 0x98D8000B, 0x98E0000B, 0x98E8000B, 0x98F0000B, 0x98F8000B, 0x9900000B, 0x9908000B, 0x9910000B, 0x9918000B, 0x9920000B, 0x9928000B, 0x9930000B, 0x9938000B, 0x9940000B, 0x9948000B, 0x9950000B, 0x9958000B, 0x9960000B, 0x9968000B, 0x9970000B, 0x9978000B, 0x9980000B, 0x9988000B, 0x9990000B, 0x9998000B, 0x99A0000B, 0x99A8000B, 0x99B0000B, 0x99B8000B, 0x99C0000B, 0x99C8000B, 0x99D0000B, 0x99D8000B, 0x99E0000B, 0x99E8000B, 0x99F0000B, 0x99F8000B, 0x9A00000B, 0x9A08000B, 0x9A10000B, 0x9A18000B, 0x9A20000B, 0x9A28000B, 0x9A30000B, 0x9A38000B, 0x9A40000B, 0x9A48000B, 0x9A50000B, 0x9A58000B, 0x9A60000B, 0x9A68000B, 0x9A70000B, 0x9A78000B, 0x9A80000B, 0x9A88000B, 0x9A90000B, 0x9A98000B, 0x9AA0000B, 0x9AA8000B, 0x9AB0000B, 0x9AB8000B, 0x9AC0000B, 0x9AC8000B, 0x9AD0000B, 0x9AD8000B, 0x9AE0000B, 0x9AE8000B, 0x9AF0000B, 0x9AF8000B, 0x9B00000B, 0x9B08000B, 0x9B10000B, 0x9B18000B, 0x9B20000B, 0x9B28000B, 0x9B30000B, 0x9B38000B, 0x9B40000B, 0x9B48000B, 0x9B50000B, 0x9B58000B, 0x9B60000B, 0x9B68000B, 0x9B70000B, 0x9B78000B, 0x9B80000B, 0x9B88000B, 0x9B90000B, 0x9B98000B, 0x9BA0000B, 0x9BA8000B, 0x9BB0000B, 0x9BB8000B, 0x9BC0000B, 0x9BC8000B, 0x9BD0000B, 0x9BD8000B, 0x9BE0000B, 0x9BE8000B, 0x9BF0000B, 0x9BF8000B, 0x9C00000B, 0x9C08000B, 0x9C10000B, 0x9C18000B, 0x9C20000B, 0x9C28000B, 0x9C30000B, 0x9C38000B, 0x9C40000B, 0x9C48000B, 0x9C50000B, 0x9C58000B, 0x9C60000B, 0x9C68000B, 0x9C70000B, 0x9C78000B, 0x9C80000B, 0x9C88000B, 0x9C90000B, 0x9C98000B, 0x9CA0000B, 0x9CA8000B, 0x9CB0000B, 0x9CB8000B, 0x9CC0000B, 0x9CC8000B, 0x9CD0000B, 0x9CD8000B, 0x9CE0000B, 0x9CE8000B, 0x9CF0000B, 0x9CF8000B, 0x9D00000B, 0x9D08000B, 0x9D10000B, 0x9D18000B, 0x9D20000B, 0x9D28000B, 0x9D30000B, 0x9D38000B, 0x9D40000B, 0x9D48000B, 0x9D50000B, 0x9D58000B, 0x9D60000B, 0x9D68000B, 0x9D70000B, 0x9D78000B, 0x9D80000B, 0x9D88000B, 0x9D90000B, 0x9D98000B, 0x9DA0000B, 0x9DA8000B, 0x9DB0000B, 0x9DB8000B, 0x9DC0000B, 0x9DC8000B, 0x9DD0000B, 0x9DD8000B, 0x9DE0000B, 0x9DE8000B, 0x9DF0000B, 0x9DF8000B, 0x9E00000B, 0x9E08000B, 0x9E10000B, 0x9E18000B, 0x9E20000B, 0x9E28000B, 0x9E30000B, 0x278EC, 0x2790C, 0x2792C, 0x2794C, 0x2796C, 0x2798C, 0x279AC, 0x279CC, 0x279EC, 0x27A0C, 0x27A2C, 0x27A4C, 0x27A6C, 0x27A8C, 0x27AAC, 0x27ACC, 0x27AEC, 0x27B0C, 0x27B2C, 0x27B4C, 0x27B6C, 0x27B8C, 0x27BAC, 0x27BCC, 0x27BEC, 0x27C0C, 0x9F08000C, 0x27C4C, 0x9F18000C, 0x27C8C, 0x9F28000C, 0x27CCC, 0x9F38000C, 0x27D0C, 0x9F48000C, 0x27D4C, 0x9F58000C, 0x27D8C, 0x9F68000C, 0x27DCC, 0x9F78000C, 0x27E0C, 0x9F88000C, 0x27E4C, 0x9F98000C, 0x27E8C, 0x9FA8000C, 0x27ECC, 0x9FB8000C, 0x27F0C, 0x9FC8000C, 0x27F4C, 0x9FD8000C, 0x27F8C, 0x9FE8000C, 0x27FCC, 0x9FF8000C, 0x2800C, 0xA008000C, 0x2804C, 0xA018000C, 0x2808C, 0xA028000C, 0x280CC, 0xA038000C, 0x2810C, 0xA048000C, 0x2814C, 0xA058000C, 0x2818C, 0xA068000C, 0x281CC, 0xA078000C, 0x2820C, 0xA088000C, 0x2824C, 0xA098000C, 0x2828C, 0xA0A8000C, 0x282CC, 0xA0B8000C, 0x2830C, 0xA0C8000C, 0x2834C, 0xA0D8000C, 0x2838C, 0xA0E8000C, 0x283CC, 0xA0F8000C, 0x2840C, 0xA108000C, 0x2844C, 0xA118000C, 0x2848C, 0xA128000C, 0x284CC, 0xA138000C, 0x2850C, 0xA148000C, 0x2854C, 0xA158000C, 0x2858C, 0xA168000C, 0x285CC, 0xA178000C, 0x2860C, 0xA188000C, 0x2864C, 0xA198000C, 0x2868C, 0xA1A8000C, 0x286CC, 0xA1B8000C, 0x2870C, 0xA1C8000C, 0x2874C, 0xA1D8000C, 0x2878C, 0xA1E8000C, 0x287CC, 0xA1F8000C, 0x2880C, 0xA208000C, 0x2884C, 0xA218000C, 0x2888C, 0xA228000C, 0x288CC, 0xA238000C, 0x2890C, 0xA248000C, 0x2894C, 0xA258000C, 0x2898C, 0xA268000C, 0x289CC, 0xA278000C, 0x28A0C, 0xA288000C, 0x28A4C, 0xA298000C, 0x28A8C, 0xA2A8000C, 0x28ACC, 0xA2B8000C, 0x28B0C, 0xA2C8000C, 0x28B4C, 0xA2D8000C, 0x28B8C, 0xA2E8000C, 0x28BCC, 0xA2F8000C, 0x28C0C, 0xA308000C, 0x28C4C, 0xA318000C, 0x28C8C, 0xA328000C, 0x28CCC, 0xA338000C, 0x28D0C, 0xA348000C, 0x28D4C, 0xA358000C, 0x28D8C, 0xA368000C, 0x28DCC, 0xA378000C, 0x28E0C, 0xA388000C, 0x28E4C, 0xA398000C, 0x28E8C, 0xA3A8000C, 0x28ECC, 0xA3B8000C, 0x28F0C, 0xA3C8000C, 0x28F4C, 0xA3D8000C, 0x28F8C, 0xA3E8000C, 0x28FCC, 0xA3F8000C, 0x2900C, 0xA408000C, 0xA410000C, 0x2906C, 0xA420000C, 0xA428000C, 0xA430000C, 0xA438000C, 0xA440000C, 0xA448000C, 0xA450000C, 0xA458000C, 0xA460000C, 0xA468000C, 0xA470000C, 0xA478000C, 0xA480000C, 0xA488000C, 0xA490000C, 0xA498000C, 0xA4A0000C, 0xA4A8000C, 0xA4B0000C, 0xA4B8000C, 0xA4C0000C, 0xA4C8000C, 0xA4D0000C, 0xA4D8000C, 0xA4E0000C, 0xA4E8000C, 0xA4F0000C, 0xA4F8000C, 0xA500000C, 0xA508000C, 0xA510000C, 0xA518000C, 0xA520000C, 0xA528000C, 0xA530000C, 0xA538000C, 0xA540000C, 0xA548000C, 0xA550000C, 0xA558000C, 0xA560000C, 0xA568000C, 0xA570000C, 0xA578000C, 0xA580000C, 0xA588000C, 0xA590000C, 0x2966C, 0xA5A0000C, 0xA5A8000C, 0xA5B0000C, 0xA5B8000C, 0xA5C0000C, 0xA5C8000C, 0xA5D0000C, 0xA5D8000C, 0xA5E0000C, 0xA5E8000C, 0xA5F0000C, 0xA5F8000C, 0xA600000C, 0xA608000C, 0xA610000C, 0xA618000C, 0xA620000C, 0xA628000C, 0xA630000C, 0xA638000C, 0xA640000C, 0xA648000C, 0xA650000C, 0xA658000C, 0xA660000C, 0xA668000C, 0xA670000C, 0xA678000C, 0xA680000C, 0xA688000C, 0xA690000C, 0xA698000C, 0xA6A0000C, 0xA6A8000C, 0xA6B0000C, 0xA6B8000C, 0xA6C0000C, 0xA6C8000C, 0xA6D0000C, 0xA6D8000C, 0xA6E0000C, 0xA6E8000C, 0xA6F0000C, 0xA6F8000C, 0xA700000C, 0xA708000C, 0xA710000C, 0xA718000C, 0xA720000C, 0xA728000C, 0xA730000C, 0xA738000C, 0xA740000C, 0xA748000C, 0xA750000C, 0xA758000C, 0xA760000C, 0xA768000C, 0xA770000C, 0xA778000C, 0xA780000C, 0xA788000C, 0xA790000C, 0xA798000C, 0xA7A0000C, 0xA7A8000C, 0xA7B0000C, 0xA7B8000C, 0xA7C0000C, 0xA7C8000C, 0xA7D0000C, 0xA7D8000C, 0xA7E0000C, 0xA7E8000C, 0xA7F0000C, 0xA7F8000C, 0xA800000C, 0xA808000C, 0x2A04C, 0xA818000C, 0x2A08C, 0xA828000C, 0x2A0CC, 0xA838000C, 0x2A10C, 0xA848000C, 0x2A14C, 0xA858000C, 0x2A18C, 0xA868000C, 0x2A1CC, 0xA878000C, 0x2A20C, 0xA888000C, 0x2A24C, 0xA898000C, 0x2A28C, 0xA8A8000C, 0x2A2CC, 0xA8B8000C, 0x2A30C, 0xA8C8000C, 0x2A34C, 0xA8D8000C, 0x2A38C, 0xA8E8000C, 0x2A3CC, 0xA8F8000C, 0x2A40C, 0xA908000C, 0x2A44C, 0xA918000C, 0x2A48C, 0xA928000C, 0x2A4CC, 0xA938000C, 0x2A50C, 0xA948000C, 0x2A54C, 0xA958000C, 0x2A58C, 0xA968000C, 0x2A5CC, 0xA978000C, 0x2A60C, 0xA988000C, 0x2A64C, 0xA998000C, 0x2A68C, 0xA9A8000C, 0x2A6CC, 0xA9B8000C, 0x2A70C, 0xA9C8000C, 0x2A74C, 0xA9D8000C, 0x2A78C, 0xA9E8000C, 0x2A7CC, 0xA9F8000C, 0x2A80C, 0xAA08000C, 0x2A84C, 0xAA18000C, 0x2A88C, 0xAA28000C, 0x2A8CC, 0xAA38000C, 0x2A90C, 0xAA48000C, 0x2A94C, 0xAA58000C, 0x2A98C, 0xAA68000C, 0x2A9CC, 0xAA78000C, 0x2AA0C, 0xAA88000C, 0xAA90000C, 0xAA98000C, 0xAAA0000C, 0xAAA8000C, 0xAAB0000C, 0xAAB8000C, 0xAAC0000C, 0xAAC8000C, 0xAAD0000C, 0xAAD8000C, 0xAAE0000C, 0xAAE8000C, 0xAAF0000C, 0xAAF8000C, 0xAB00000C, 0xAB08000C, 0xAB10000C, 0xAB18000C, 0xAB20000C, 0xAB28000C, 0xAB30000C, 0xAB38000C, 0xAB40000C, 0xAB48000C, 0xAB50000C, 0xAB58000C, 0xAB60000C, 0xAB68000C, 0xAB70000C, 0xAB78000C, 0xAB80000C, 0xAB88000C, 0xAB90000C, 0xAB98000C, 0xABA0000C, 0xABA8000C, 0xABB0000C, 0xABB8000C, 0xABC0000C, 0xABC8000C, 0xABD0000C, 0xABD8000C, 0xABE0000C, 0xABE8000C, 0xABF0000C, 0xABF8000C, 0xAC00000C, 0xAC08000C, 0xAC10000C, 0xAC18000C, 0xAC20000C, 0xAC28000C, 0xAC30000C, 0xAC38000C, 0xAC40000C, 0xAC48000C, 0xAC50000C, 0xAC58000C, 0xAC60000C, 0xAC68000C, 0xAC70000C, 0xAC78000C, 0xAC80000C, 0xAC88000C, 0xAC90000C, 0xAC98000C, 0xACA0000C, 0xACA8000C, 0xACB0000C, 0xACB8000C, 0xACC0000C, 0xACC8000C, 0xACD0000C, 0xACD8000C, 0xACE0000C, 0xACE8000C, 0x2B3CC, 0xACF8000C, 0xAD00000C, 0xAD08000C, 0xAD10000C, 0xAD18000C, 0xAD20000C, 0xAD28000C, 0xAD30000C, 0xAD38000C, 0xAD40000C, 0xAD48000C, 0xAD50000C, 0xAD58000C, 0xAD60000C, 0xAD68000C, 0xAD70000C, 0xAD78000C, 0xAD80000C, 0xAD88000C, 0xAD90000C, 0xAD98000C, 0xADA0000C, 0xADA8000C, 0xADB0000C, 0xADB8000C, 0xADC0000C, 0xADC8000C, 0xADD0000C, 0xADD8000C, 0xADE0000C, 0xADE8000C, 0xADF0000C, 0xADF8000C, 0xAE00000C, 0xAE08000C, 0xAE10000C, 0xAE18000C, 0xAE20000C, 0xAE28000C, 0xAE30000C, 0xAE38000C, 0xAE40000C, 0xAE48000C, 0xAE50000C, 0xAE58000C, 0xAE60000C, 0xAE68000C, 0xAE70000C, 0xAE78000C, 0xAE80000C, 0xAE88000C, 0xAE90000C, 0xAE98000C, 0xAEA0000C, 0xAEA8000C, 0xAEB0000C, 0xAEB8000C, 0xAEC0000C, 0xAEC8000C, 0xAED0000C, 0xAED8000C, 0xAEE0000C, 0xAEE8000C, 0xAEF0000C, 0xAEF8000C, 0xAF00000C, 0xAF08000C, 0xAF10000C, 0xAF18000C, 0xAF20000C, 0xAF28000C, 0xAF30000C, 0xAF38000C, 0xAF40000C, 0xAF48000C, 0xAF50000C, 0xAF58000C, 0xAF60000C, 0xAF68000C, 0xAF70000C, 0xAF78000C, 0xAF80000C, 0xAF88000C, 0xAF90000C, 0xAF98000C, 0xAFA0000C, 0xAFA8000C, 0xAFB0000C, 0xAFB8000C, 0xAFC0000C, 0xAFC8000C, 0xAFD0000C, 0xAFD8000C, 0xAFE0000C, 0xAFE8000C, 0xAFF0000C, 0xAFF8000C, 0xB000000C, 0xB008000C, 0xB010000C, 0x2C06C, 0x2C08C, 0x2C0AC, 0x2C0CC, 0x2C0EC, 0x2C10C, 0x2C12C, 0x2C14C, 0x2C16C, 0x2C18C, 0x2C1AC, 0x2C1CC, 0x2C1EC, 0x2C20C, 0x2C22C, 0x2C24C, 0x2C26C, 0x2C28C, 0x2C2AC, 0x2C2CC, 0x2C2EC, 0x2C30C, 0x2C32C, 0x2C34C, 0x2C36C, 0x2C38C, 0x2C3AC, 0x2C3CC, 0x2C3EC, 0x2C40C, 0x2C42C, 0x2C44C, 0x2C46C, 0x2C48C, 0x2C4AC, 0x2C4CC, 0x2C4EC, 0x2C50C, 0x2C52C, 0x2C54C, 0x2C56C, 0x2C58C, 0x2C5AC, 0x2C5CC, 0x2C5EC, 0x2C60C, 0x2C62C, 0x2C64C, 0x2C66C, 0x2C68C, 0x2C6AC, 0x2C6CC, 0x2C6EC, 0x2C70C, 0x2C72C, 0x2C74C, 0x2C76C, 0x2C78C, 0x2C7AC, 0x2C7CC, 0x2C7EC, 0x2C80C, 0x2C82C, 0x2C84C, 0x2C86C, 0x2C88C, 0x2C8AC, 0x2C8CC, 0x2C8EC, 0x2C90C, 0x2C92C, 0x2C94C, 0x2C96C, 0x2C98C, 0x2C9AC, 0x2C9CC, 0x2C9EC, 0x2CA0C, 0x2CA2C, 0x2CA4C, 0x2CA6C, 0x2CA8C, 0x2CAAC, 0x2CACC, 0x2CAEC, 0x2CB0C, 0x2CB2C, 0x2CB4C, 0x2CB6C, 0x2CB8C, 0x2CBAC, 0x2CBCC, 0x2CBEC, 0x2CC0C, 0x2CC2C, 0x2CC4C, 0x2CC6C, 0x2CC8C, 0x2CCAC, 0x2CCCC, 0x2CCEC, 0x2CD0C, 0x2CD2C, 0x2CD4C, 0x2CD6C, 0x2CD8C, 0x2CDAC, 0x2CDCC, 0x2CDEC, 0x2CE0C, 0x2CE2C, 0x2CE4C, 0x2CE6C, 0x2CE8C, 0x2CEAC, 0x2CECC, 0x2CEEC, 0x2CF0C, 0x2CF2C, 0x2CF4C, 0x2CF6C, 0x2CF8C, 0x2CFAC, 0x2CFCC, 0x2CFEC, 0x2D00C, 0x2D02C, 0x2D04C, 0x2D06C, 0x2D08C, 0x2D0AC, 0x2D0CC, 0x2D0EC, 0x2D10C, 0x2D12C, 0x2D14C, 0x2D16C, 0x2D18C, 0x2D1AC, 0x2D1CC, 0x2D1EC, 0x2D20C, 0x2D22C, 0x2D24C, 0xB4A2D26C, 0x2D2AC, 0x2D2CC, 0x2D2EC, 0x2D30C, 0x2D32C, 0x2D34C, 0x2D36C, 0x2D38C, 0x2D3AC, 0x2D3CC, 0x2D3EC, 0x2D40C, 0x2D42C, 0x2D44C, 0x2D46C, 0x2D48C, 0x2D4AC, 0x2D4CC, 0x2D4EC, 0x2D50C, 0x2D52C, 0x2D54C, 0x2D56C, 0x2D58C, 0x2D5AC, 0x2D5CC, 0x2D5EC, 0x2D60C, 0x2D62C, 0x2D64C, 0x2D66C, 0x2D68C, 0x2D6AC, 0x2D6CC, 0x2D6EC, 0x2D70C, 0x2D72C, 0x2D74C, 0x2D76C, 0x2D78C, 0x2D7AC, 0x2D7CC, 0x2D7EC, 0x2D80C, 0x2D82C, 0x2D84C, 0x2D86C, 0x2D88C, 0x2D8AC, 0x2D8CC, 0x2D8EC, 0x2D90C, 0x2D92C, 0x2D94C, 0x2D96C, 0x2D98C, 0x2D9AC, 0x2D9CC, 0x2D9EC, 0x2DA0C, 0x2DA2C, 0x2DA4C, 0x2DA6C, 0x2DA8C, 0x2DAAC, 0x2DACC, 0x2DAEC, 0x2DB0C, 0x2DB2C, 0x2DB4C, 0x2DB6C, 0x2DB8C, 0x2DBAC, 0x2DBCC, 0x2DBEC, 0x2DC0C, 0x2DC2C, 0x2DC4C, 0x2DC6C, 0x2DC8C, 0x2DCAC, 0x2DCCC, 0x2DCEC, 0x2DD0C, 0x2DD2C, 0x2DD4C, 0x2DD6C, 0x2DD8C, 0x2DDAC, 0x2DDCC, 0x2DDEC, 0x2DE0C, 0x2DE2C, 0x2DE4C, 0x2DE6C, 0x2DE8C, 0x2DEAC, 0x2DECC, 0x2DEEC, 0x2DF0C, 0x2DF2C, 0x2DF4C, 0x2DF6C, 0x2DF8C, 0x2DFAC, 0x2DFCC, 0x2DFEC, 0x2E00C, 0x2E02C, 0x2E04C, 0x2E06C, 0x2E08C, 0x2E0AC, 0x2E0CC, 0x2E0EC, 0x2E10C, 0x2E12C, 0x2E14C, 0x2E16C, 0x2E18C, 0x2E1AC, 0x2E1CC, 0x2E1EC, 0x2E20C, 0x2E22C, 0x2E24C, 0x2E26C, 0xB8A0000C, 0xB8A8000C, 0xB8B0000C, 0xB8B8000C, 0xB8C0000C, 0xB8C8000C, 0xB8D0000C, 0xB8D8000C, 0xB8E0000C, 0xB8E8000C, 0xB8F0000C, 0xB8F8000C, 0xB900000C, 0xB908000C, 0xB910000C, 0xB918000C, 0xB920000C, 0xB928000C, 0xB930000C, 0xB938000C, 0xB940000C, 0xB948000C, 0xB950000C, 0xB958000C, 0xB960000C, 0xB968000C, 0xB970000C, 0xB978000C, 0xB980000C, 0xB988000C, 0xB990000C, 0xB998000C, 0xB9A0000C, 0xB9A8000C, 0xB9B0000C, 0xB9B8000C, 0xB9C0000C, 0xB9C8000C, 0xB9D0000C, 0xB9D8000C, 0xB9E0000C, 0xB9E8000C, 0xB9F0000C, 0xB9F8000C, 0xBA00000C, 0xBA08000C, 0xBA10000C, 0xBA18000C, 0xBA20000C, 0xBA28000C, 0xBA30000C, 0xBA38000C, 0xBA40000C, 0xBA48000C, 0xBA50000C, 0xBA58000C, 0xBA60000C, 0xBA68000C, 0xBA70000C, 0xBA78000C, 0xBA80000C, 0xBA88000C, 0xBA90000C, 0xBA98000C, 0xBAA0000C, 0xBAA8000C, 0xBAB0000C, 0xBAB8000C, 0xBAC0000C, 0xBAC8000C, 0xBAD0000C, 0xBAD8000C, 0xBAE0000C, 0xBAE8000C, 0xBAF0000C, 0xBAF8000C, 0xBB00000C, 0xBB08000C, 0xBB10000C, 0xBB18000C, 0xBB20000C, 0xBB28000C, 0xBB30000C, 0xBB38000C, 0xBB40000C, 0xBB48000C, 0xBB50000C, 0xBB58000C, 0xBB60000C, 0xBB68000C, 0xBB70000C, 0xBB78000C, 0xBB80000C, 0xBB88000C, 0xBB90000C, 0xBB98000C, 0xBBA0000C, 0xBBA8000C, 0xBBB0000C, 0xBBB8000C, 0xBBC0000C, 0xBBC8000C, 0xBBD0000C, 0xBBD8000C, 0xBBE0000C, 0xBBE8000C, 0xBBF0000C, 0xBBF8000C, 0xBC00000C, 0xBC08000C, 0xBC10000C, 0xBC18000C, 0xBC20000C, 0xBC28000C, 0xBC30000C, 0xBC38000C, 0xBC40000C, 0xBC48000C, 0xBC50000C, 0xBC58000C, 0xBC60000C, 0xBC68000C, 0xBC70000C, 0xBC78000C, 0xBC80000C, 0xBC88000C, 0xBC90000C, 0xBC98000C, 0xBCA0000C, 0xBCA8000C, 0xBCB0000C, 0xBCB8000C, 0xBCC0000C, 0xBCC8000C, 0xBCD0000C, 0xBCD8000C, 0xBCE0000C, 0xBCE8000C, 0xBCF0000C, 0xBCF8000C, 0xBD00000C, 0xBD08000C, 0xBD10000C, 0xBD18000C, 0xBD20000C, 0xBD28000C, 0xBD30000C, 0xBD38000C, 0xBD40000C, 0xBD48000C, 0xBD50000C, 0xBD58000C, 0xBD60000C, 0xBD68000C, 0xBD70000C, 0xBD78000C, 0xBD80000C, 0xBD88000C, 0xBD90000C, 0xBD98000C, 0xBDA0000C, 0xBDA8000C, 0xBDB0000C, 0xBDB8000C, 0xBDC0000C, 0xBDC8000C, 0xBDD0000C, 0xBDD8000C, 0xBDE0000C, 0xBDE8000C, 0xBDF0000C, 0xBDF8000C, 0xBE00000C, 0xBE08000C, 0xBE10000C, 0xBE18000C, 0xBE20000C, 0xBE28000C, 0xBE30000C, 0xBE38000C, 0xBE40000C, 0xBE48000C, 0xBE50000C, 0xBE58000C, 0xBE60000C, 0xBE68000C, 0xBE70000C, 0xBE78000C, 0xBE80000C, 0xBE88000C, 0xBE90000C, 0xBE98000C, 0xBEA0000C, 0xBEA8000C, 0xBEB0000C, 0xBEB8000C, 0xBEC0000C, 0xBEC8000C, 0xBED0000C, 0xBED8000C, 0xBEE0000C, 0xBEE8000C, 0xBEF0000C, 0xBEF8000C, 0xBF00000C, 0xBF08000C, 0xBF10000C, 0xBF18000C, 0xBF20000C, 0xBF28000C, 0xBF30000C, 0xBF38000C, 0xBF40000C, 0xBF48000C, 0xBF50000C, 0xBF58000C, 0xBF60000C, 0xBF68000C, 0xBF70000C, 0xBF78000C, 0xBF80000C, 0xBF88000C, 0xBF90000C, 0xBF98000C, 0xBFA0000C, 0xBFA8000C, 0xBFB0000C, 0xBFB8000C, 0xBFC0000C, 0xBFC8000C, 0xBFD0000C, 0xBFD8000C, 0xBFE0000C, 0xBFE8000C, 0xBFF0000C, 0xBFF8000C, 0xC000000C, 0xC008000C, 0xC010000C, 0xC018000C, 0xC020000C, 0xC028000C, 0xC030000C, 0xC038000C, 0xC040000C, 0xC048000C, 0xC050000C, 0xC058000C, 0xC060000C, 0xC068000C, 0xC070000C, 0xC078000C, 0xC080000C, 0xC088000C, 0xC090000C, 0xC098000C, 0xC0A0000C, 0xC0A8000C, 0xC0B0000C, 0xC0B8000C, 0xC0C0000C, 0xC0C8000C, 0xC0D0000C, 0xC0D8000C, 0xC0E0000C, 0xC0E8000C, 0xC0F0000C, 0xC0F8000C, 0xC100000C, 0xC108000C, 0xC110000C, 0xC118000C, 0xC120000C, 0xC128000C, 0xC130000C, 0xC138000C, 0xC140000C, 0xC148000C, 0xC150000C, 0xC158000C, 0xC160000C, 0xC168000C, 0xC170000C, 0xC178000C, 0xC180000C, 0xC188000C, 0xC190000C, 0xC198000C, 0xC1A0000C, 0xC1A8000C, 0xC1B0000C, 0xC1B8000C, 0xC1C0000C, 0xC1C8000C, 0xC1D0000C, 0xC1D8000C, 0xC1E0000C, 0xC1E8000C, 0xC1F0000C, 0xC1F8000C, 0xC200000C, 0xC208000C, 0xC210000C, 0xC218000C, 0xC220000C, 0xC228000C, 0xC230000C, 0xC238000C, 0xC240000C, 0xC248000C, 0xC250000C, 0xC258000C, 0xC260000C, 0xC268000C, 0xC270000C, 0xC278000C, 0xC280000C, 0xC288000C, 0xC290000C, 0xC298000C, 0xC2A0000C, 0xC2A8000C, 0xC2B0000C, 0xC2B8000C, 0xC2C0000C, 0xC2C8000C, 0xC2D0000C, 0xC2D8000C, 0xC2E0000C, 0xC2E8000C, 0xC2F0000C, 0xC2F8000C, 0xC300000C, 0xC308000C, 0xC310000C, 0xC318000C, 0xC320000C, 0xC328000C, 0xC330000C, 0xC338000C, 0xC340000C, 0xC348000C, 0xC350000C, 0xC358000C, 0xC360000C, 0xC368000C, 0xC370000C, 0xC378000C, 0xC380000C, 0xC388000C, 0xC390000C, 0xC398000C, 0xC3A0000C, 0xC3A8000C, 0xC3B0000C, 0xC3B8000C, 0xC3C0000C, 0xC3C8000C, 0xC3D0000C, 0xC3D8000C, 0xC3E0000C, 0xC3E8000C, 0xC3F0000C, 0xC3F8000C, 0xC400000C, 0xC408000C, 0xC410000C, 0xC418000C, 0xC420000C, 0xC428000C, 0xC430000C, 0xC438000C, 0xC440000C, 0xC448000C, 0xC450000C, 0xC458000C, 0xC460000C, 0xC468000C, 0xC470000C, 0xC478000C, 0xC480000C, 0xC488000C, 0xC490000C, 0xC498000C, 0xC4A0000C, 0xC4A8000C, 0xC4B0000C, 0xC4B8000C, 0xC4C0000C, 0xC4C8000C, 0xC4D0000C, 0xC4D8000C, 0xC4E0000C, 0xC4E8000C, 0xC4F0000C, 0xC4F8000C, 0xC500000C, 0xC508000C, 0xC510000C, 0xC518000C, 0xC520000C, 0xC528000C, 0xC530000C, 0xC538000C, 0xC540000C, 0xC548000C, 0xC550000C, 0xC558000C, 0xC560000C, 0xC568000C, 0xC570000C, 0xC578000C, 0xC580000C, 0xC588000C, 0xC590000C, 0xC598000C, 0xC5A0000C, 0xC5A8000C, 0xC5B0000C, 0xC5B8000C, 0xC5C0000C, 0xC5C8000C, 0xC5D0000C, 0xC5D8000C, 0xC5E0000C, 0xC5E8000C, 0xC5F0000C, 0xC5F8000C, 0xC600000C, 0xC608000C, 0xC610000C, 0xC618000C, 0xC620000C, 0xC628000C, 0xC630000C, 0xC638000C, 0xC640000C, 0xC648000C, 0xC650000C, 0xC658000C, 0xC660000C, 0xC668000C, 0xC670000C, 0xC678000C, 0xC680000C, 0xC688000C, 0xC690000C, 0xC698000C, 0xC6A0000C, 0xC6A8000C, 0xC6B0000C, 0xC6B8000C, 0xC6C0000C, 0xC6C8000C, 0xC6D0000C, 0xC6D8000C, 0xC6E0000C, 0xC6E8000C, 0x31BCD, 0x31BED, 0x31C0D, 0x31C2D, 0x31C4D, 0x31C6D, 0x31C8D, 0x31CAD, 0x31CCD, 0x31CED, 0x31D0D, 0x31D2D, 0x31D4D, 0x31D6D, 0x31D8D, 0x31DAD, 0x31DCD, 0x31DED, 0x31E0D, 0x31E2D, 0x31E4D, 0x31E6D, 0x31E8D, 0x31EAD, 0x31ECD, 0x31EED, 0x31F0D, 0xC7C8000D, 0x31F4D, 0xC7D8000D, 0x31F8D, 0xC7E8000D, 0x31FCD, 0xC7F8000D, 0x3200D, 0xC808000D, 0x3204D, 0xC818000D, 0x3208D, 0xC828000D, 0x320CD, 0xC838000D, 0x3210D, 0xC848000D, 0x3214D, 0xC858000D, 0x3218D, 0xC868000D, 0x321CD, 0xC878000D, 0x3220D, 0xC888000D, 0x3224D, 0xC898000D, 0x3228D, 0xC8A8000D, 0x322CD, 0xC8B8000D, 0x3230D, 0xC8C8000D, 0x3234D, 0xC8D8000D, 0x3238D, 0xC8E8000D, 0x323CD, 0xC8F8000D, 0x3240D, 0xC908000D, 0x3244D, 0xC918000D, 0x3248D, 0xC928000D, 0x324CD, 0xC938000D, 0x3250D, 0xC948000D, 0x3254D, 0xC958000D, 0x3258D, 0xC968000D, 0x325CD, 0xC978000D, 0x3260D, 0xC988000D, 0x3264D, 0xC998000D, 0x3268D, 0xC9A8000D, 0x326CD, 0xC9B8000D, 0x3270D, 0xC9C8000D, 0x3274D, 0xC9D8000D, 0x3278D, 0xC9E8000D, 0x327CD, 0xC9F8000D, 0x3280D, 0xCA08000D, 0x3284D, 0xCA18000D, 0x3288D, 0xCA28000D, 0x328CD, 0xCA38000D, 0x3290D, 0xCA48000D, 0x3294D, 0xCA58000D, 0x3298D, 0xCA68000D, 0x329CD, 0xCA78000D, 0x32A0D, 0xCA88000D, 0x32A4D, 0xCA98000D, 0x32A8D, 0xCAA8000D, 0x32ACD, 0xCAB8000D, 0x32B0D, 0xCAC8000D, 0x32B4D, 0xCAD8000D, 0x32B8D, 0xCAE8000D, 0x32BCD, 0xCAF8000D, 0x32C0D, 0xCB08000D, 0x32C4D, 0xCB18000D, 0x32C8D, 0xCB28000D, 0x32CCD, 0xCB38000D, 0x32D0D, 0xCB48000D, 0x32D4D, 0xCB58000D, 0x32D8D, 0xCB68000D, 0x32DCD, 0xCB78000D, 0x32E0D, 0xCB88000D, 0x32E4D, 0xCB98000D, 0x32E8D, 0xCBA8000D, 0x32ECD, 0xCBB8000D, 0x32F0D, 0xCBC8000D, 0x32F4D, 0xCBD8000D, 0x32F8D, 0xCBE8000D, 0x32FCD, 0xCBF8000D, 0x3300D, 0xCC08000D, 0x3304D, 0xCC18000D, 0x3308D, 0xCC28000D, 0x330CD, 0xCC38000D, 0x3310D, 0xCC48000D, 0x3314D, 0xCC58000D, 0x3318D, 0xCC68000D, 0x331CD, 0xCC78000D, 0x3320D, 0xCC88000D, 0x3324D, 0xCC98000D, 0x3328D, 0xCCA8000D, 0x332CD, 0xCCB8000D, 0x3330D, 0x3332D, 0xCCD0000D, 0x3336D, 0xCCE0000D, 0x333AD, 0x333CD, 0x333ED, 0x3340D, 0x3342D, 0x3344D, 0x3346D, 0x3348D, 0x334AD, 0xCD30000D, 0x334ED, 0xCD40000D, 0x3352D, 0xCD50000D, 0x3356D, 0xCD60000D, 0x335AD, 0xCD70000D, 0x335ED, 0xCD80000D, 0x3362D, 0xCD90000D, 0x3366D, 0xCDA0000D, 0x336AD, 0x336CD, 0x336ED, 0x3370D, 0x3372D, 0x3374D, 0x3376D, 0x3378D, 0x337AD, 0x337CD, 0x337ED, 0x3380D, 0x3382D, 0xCE10000D, 0x3386D, 0x3388D, 0x338AD, 0x338CD, 0x338ED, 0x3390D, 0x3392D, 0xCE50000D, 0x3396D, 0x3398D, 0x339AD, 0x339CD, 0x339ED, 0x33A0D, 0x33A2D, 0x33A4D, 0x33A6D, 0x33A8D, 0x33AAD, 0x33ACD, 0x33AED, 0x33B0D, 0x33B2D, 0x33B4D, 0x33B6D, 0x33B8D, 0x33BAD, 0x33BCD, 0x33BED, 0x33C0D, 0x33C2D, 0x33C4D, 0x33C6D, 0x33C8D, 0x33CAD, 0x33CCD, 0x33CED, 0x33D0D, 0x33D2D, 0x33D4D, 0x33D6D, 0x33D8D, 0x33DAD, 0x33DCD, 0x33DED, 0x33E0D, 0x33E2D, 0x33E4D, 0x33E6D, 0x33E8D, 0x33EAD, 0x33ECD, 0x33EED, 0x33F0D, 0x33F2D, 0x33F4D, 0x33F6D, 0x33F8D, 0x33FAD, 0x33FCD, 0x33FED, 0x3400D, 0x3402D, 0x3404D, 0x3406D, 0x3408D, 0x340AD, 0x340CD, 0x340ED, 0x3410D, 0x3412D, 0x3414D, 0x3416D, 0x3418D, 0x341AD, 0x341CD, 0x341ED, 0x3420D, 0x3422D, 0x3424D, 0x3426D, 0x3428D, 0x342AD, 0x342CD, 0x342ED, 0xD0CB430D, 0xD0DB434D, 0xD0EB438D, 0xD0FB43CD, 0xD10B440D, 0xD11B444D, 0xD12B448D, 0xD13B44CD, 0xD14B450D, 0xD15B454D, 0xD16B458D, 0xD17B45CD, 0xD18B460D, 0xD19B464D, 0xD1AB468D, 0xD1BB46CD, 0xD1CB470D, 0xD1DB474D, 0xD1EB478D, 0xD1FB47CD, 0xD20B480D, 0xD21B484D, 0xD22B488D, 0xD23B48CD, 0xD24B490D, 0xD25B494D, 0xD26B498D, 0xD27B49CD, 0xD28B4A0D, 0xD29B4A4D, 0xD2AB4A8D, 0xD2BB4ACD, 0xD2CB4B0D, 0xD2DB4B4D, 0xD2EB4B8D, 0xD2FB4BCD, 0xD30B4C0D, 0xD31B4C4D, 0xD32B4C8D, 0xD33B4CCD, 0x34D0D, 0x34D2D, 0x34D4D, 0x34D6D, 0x34D8D, 0x34DAD, 0x34DCD, 0x34DED, 0x34E0D, 0x34E2D, 0x34E4D, 0x34E6D, 0x34E8D, 0x34EAD, 0x34ECD, 0x34EED, 0x34F0D, 0x34F2D, 0x34F4D, 0x34F6D, 0x34F8D, 0x34FAD, 0x34FCD, 0x34FED, 0x3500D, 0x3502D, 0x3504D, 0x3506D, 0x3508D, 0x350AD, 0x350CD, 0x350ED, 0x3510D, 0x3512D, 0x3514D, 0x3516D, 0x3518D, 0x351AD, 0x351CD, 0x351ED, 0x3520D, 0x3522D, 0x3524D, 0x3526D, 0x3528D, 0x352AD, 0x352CD, 0x352ED, 0x3530D, 0x3532D, 0x3534D, 0x3536D, 0x3538D, 0xD4F353AD, 0xD50353ED, 0x3542D, 0x3544D, 0xD523546D, 0xD53354AD, 0xD54354ED, 0xD553552D, 0x3556D, 0x3558D, 0x355AD, 0xD57B55CD, 0xD58B560D, 0xD59B564D, 0xD5AB568D, 0xD5BB56CD, 0x3570D, 0x3572D, 0x3574D, 0x3576D, 0x3578D, 0x357AD, 0x357CD, 0x357ED, 0x3580D, 0x3582D, 0x3584D, 0x3586D, 0x3588D, 0x358AD, 0x358CD, 0x358ED, 0x3590D, 0x3592D, 0x3594D, 0x3596D, 0x3598D, 0x359AD, 0x359CD, 0x359ED, 0x35A0D, 0x35A2D, 0x35A4D, 0x35A6D, 0x35A8D, 0x35AAD, 0x35ACD, 0x35AED, 0x35B0D, 0x35B2D, 0x35B4D, 0x35B6D, 0x35B8D, 0x35BAD, 0x35BCD, 0x35BED, 0x35C0D, 0x35C2D, 0x35C4D, 0x35C6D, 0x35C8D, 0x35CAD, 0x35CCD, 0x35CED, 0x35D0D, 0x35D2D, 0x35D4D, 0x35D6D, 0x35D8D, 0x35DAD, 0x35DCD, 0x35DED, 0x35E0D, 0x35E2D, 0x35E4D, 0x35E6D, 0x35E8D, 0x35EAD, 0x35ECD, 0x35EED, 0x35F0D, 0x35F2D, 0x35F4D, 0x35F6D, 0x35F8D, 0x35FAD, 0x35FCD, 0x35FED, 0x3600D, 0x3602D, 0x3604D, 0x3606D, 0x3608D, 0x360AD, 0x360CD, 0x360ED, 0x3610D, 0x3612D, 0x3614D, 0x3616D, 0x3618D, 0x361AD, 0x361CD, 0x361ED, 0x3620D, 0x3622D, 0x3624D, 0x3626D, 0xD8AB628D, 0xD8BB62CD, 0xD8CB630D, 0xD8D0000D, 0xD8D8000D, 0xD8E0000D, 0xD8E8000D, 0xD8F0000D, 0xD8F8000D, 0xD900000D, 0xD908000D, 0xD910000D, 0xD918000D, 0xD920000D, 0xD928000D, 0xD930000D, 0xD938000D, 0xD940000D, 0xD948000D, 0xD950000D, 0xD958000D, 0xD960000D, 0xD968000D, 0xD970000D, 0xD978000D, 0xD980000D, 0xD988000D, 0xD990000D, 0xD998000D, 0xD9A0000D, 0xD9A8000D, 0xD9B0000D, 0xD9B8000D, 0xD9C0000D, 0xD9C8000D, 0xD9D0000D, 0xD9D8000D, 0xD9E0000D, 0xD9E8000D, 0xD9F0000D, 0xD9F8000D, 0xDA00000D, 0xDA08000D, 0xDA10000D, 0xDA18000D, 0xDA20000D, 0xDA28000D, 0xDA30000D, 0xDA38000D, 0xDA40000D, 0xDA48000D, 0xDA50000D, 0xDA58000D, 0xDA60000D, 0xDA68000D, 0xDA70000D, 0xDA78000D, 0xDA80000D, 0xDA88000D, 0xDA90000D, 0xDA98000D, 0xDAA0000D, 0xDAA8000D, 0xDAB0000D, 0xDAB8000D, 0xDAC0000D, 0xDAC8000D, 0xDAD0000D, 0xDAD8000D, 0xDAE0000D, 0xDAE8000D, 0xDAF0000D, 0xDAF8000D, 0xDB00000D, 0xDB08000D, 0xDB10000D, 0xDB18000D, 0xDB20000D, 0xDB28000D, 0xDB30000D, 0xDB38000D, 0xDB40000D, 0xDB48000D, 0xDB50000D, 0xDB58000D, 0xDB60000D, 0xDB68000D, 0xDB70000D, 0xDB78000D, 0xDB80000D, 0xDB88000D, 0xDB90000D, 0xDB98000D, 0xDBA0000D, 0xDBA8000D, 0xDBB0000D, 0xDBB8000D, 0xDBC0000D, 0xDBC8000D, 0xDBD0000D, 0xDBD8000D, 0xDBE0000D, 0xDBE8000D, 0xDBF0000D, 0xDBF8000D, 0xDC00000D, 0xDC08000D, 0xDC10000D, 0xDC18000D, 0xDC20000D, 0xDC28000D, 0xDC30000D, 0xDC38000D, 0xDC40000D, 0xDC48000D, 0xDC50000D, 0xDC58000D, 0xDC60000D, 0xDC68000D, 0xDC70000D, 0xDC78000D, 0xDC80000D, 0xDC88000D, 0xDC90000D, 0xDC98000D, 0xDCA0000D, 0xDCA8000D, 0xDCB0000D, 0xDCB8000D, 0xDCC0000D, 0xDCC8000D, 0xDCD0000D, 0xDCD8000D, 0xDCE0000D, 0xDCE8000D, 0xDCF0000D, 0xDCF8000D, 0xDD00000D, 0xDD08000D, 0xDD10000D, 0xDD18000D, 0xDD20000D, 0xDD28000D, 0xDD30000D, 0xDD38000D, 0xDD40000D, 0xDD48000D, 0xDD50000D, 0xDD58000D, 0xDD60000D, 0xDD68000D, 0xDD70000D, 0xDD78000D, 0xDD80000D, 0xDD88000D, 0xDD90000D, 0xDD98000D, 0xDDA0000D, 0xDDA8000D, 0xDDB0000D, 0xDDB8000D, 0xDDC0000D, 0xDDC8000D, 0xDDD0000D, 0xDDD8000D, 0xDDE0000D, 0xDDE8000D, 0xDDF0000D, 0xDDF8000D, 0xDE00000D, 0xDE08000D, 0xDE10000D, 0xDE18000D, 0xDE20000D, 0xDE28000D, 0xDE30000D, 0xDE38000D, 0xDE40000D, 0xDE48000D, 0xDE50000D, 0xDE58000D, 0xDE60000D, 0xDE68000D, 0xDE70000D, 0xDE78000D, 0xDE80000D, 0xDE88000D, 0xDE90000D, 0xDE98000D, 0xDEA0000D, 0xDEA8000D, 0xDEB0000D, 0xDEB8000D, 0xDEC0000D, 0xDEC8000D, 0xDED0000D, 0xDED8000D, 0xDEE0000D, 0xDEE8000D, 0xDEF0000D, 0xDEF8000D, 0xDF00000D, 0xDF08000D, 0xDF10000D, 0xDF18000D, 0xDF20000D, 0xDF28000D, 0xDF30000D, 0xDF38000D, 0xDF40000D, 0xDF48000D, 0xDF50000D, 0xDF58000D, 0xDF60000D, 0xDF68000D, 0xDF70000D, 0xDF78000D, 0xDF80000D, 0xDF88000D, 0xDF90000D, 0xDF98000D, 0xDFA0000D, 0xDFA8000D, 0xDFB0000D, 0xDFB8000D, 0xDFC0000D, 0xDFC8000D, 0xDFD0000D, 0xDFD8000D, 0xDFE0000D, 0xDFE8000D, 0xDFF0000D, 0xDFF8000D, 0xE000000D, 0xE008000D, 0xE010000D, 0xE018000D, 0xE020000D, 0xE028000D, 0xE030000D, 0xE038000D, 0xE040000D, 0xE048000D, 0xE050000D, 0xE058000D, 0xE060000D, 0xE068000D, 0xE070000D, 0xE078000D, 0xE080000D, 0xE088000D, 0xE090000D, 0xE098000D, 0xE0A0000D, 0xE0A8000D, 0xE0B0000D, 0xE0B8000D, 0xE0C0000D, 0xE0C8000D, 0xE0D0000D, 0xE0D8000D, 0xE0E0000D, 0xE0E8000D, 0xE0F0000D, 0xE0F8000D, 0xE100000D, 0xE108000D, 0xE110000D, 0xE118000D, 0xE120000D, 0xE128000D, 0xE130000D, 0xE138000D, 0xE140000D, 0xE148000D, 0xE150000D, 0xE158000D, 0xE160000D, 0xE168000D, 0xE170000D, 0xE178000D, 0xE180000D, 0xE188000D, 0xE190000D, 0xE198000D, 0xE1A0000D, 0xE1A8000D, 0xE1B0000D, 0xE1B8000D, 0xE1C0000D, 0xE1C8000D, 0xE1D0000D, 0xE1D8000D, 0xE1E0000D, 0xE1E8000D, 0xE1F0000D, 0xE1F8000D, 0xE200000D, 0xE208000D, 0xE210000D, 0xE218000D, 0xE220000D, 0xE228000D, 0xE230000D, 0xE238000D, 0xE240000D, 0xE248000D, 0xE250000D, 0xE258000D, 0xE260000D, 0xE268000D, 0xE270000D, 0xE278000D, 0xE280000D, 0xE288000D, 0xE290000D, 0xE298000D, 0xE2A0000D, 0xE2A8000D, 0xE2B0000D, 0xE2B8000D, 0xE2C0000D, 0xE2C8000D, 0xE2D0000D, 0xE2D8000D, 0xE2E0000D, 0xE2E8000D, 0xE2F0000D, 0xE2F8000D, 0xE300000D, 0xE308000D, 0xE310000D, 0xE318000D, 0xE320000D, 0xE328000D, 0xE330000D, 0xE338000D, 0xE340000D, 0xE348000D, 0xE350000D, 0xE358000D, 0xE360000D, 0xE368000D, 0xE370000D, 0xE378000D, 0xE380000D, 0xE388000D, 0xE390000D, 0xE398000D, 0xE3A0000D, 0xE3A8000D, 0xE3B0000D, 0xE3B8000D, 0xE3C0000D, 0xE3C8000D, 0xE3D0000D, 0xE3D8000D, 0xE3E0000D, 0xE3E8000D, 0xE3F0000D, 0xE3F8000D, 0xE400000D, 0xE408000D, 0xE410000D, 0xE418000D, 0xE420000D, 0xE428000D, 0xE430000D, 0xE438000D, 0xE440000D, 0xE448000D, 0xE450000D, 0xE458000D, 0xE460000D, 0xE468000D, 0xE470000D, 0xE478000D, 0xE480000D, 0xE488000D, 0xE490000D, 0xE498000D, 0xE4A0000D, 0xE4A8000D, 0xE4B0000D, 0xE4B8000D, 0xE4C0000D, 0xE4C8000D, 0xE4D0000D, 0xE4D8000D, 0xE4E0000D, 0xE4E8000D, 0xE4F0000D, 0xE4F8000D, 0xE500000D, 0xE508000D, 0xE510000D, 0xE518000D, 0xE520000D, 0xE528000D, 0xE530000D, 0xE538000D, 0xE540000D, 0xE548000D, 0xE550000D, 0xE558000D, 0xE560000D, 0xE568000D, 0xE570000D, 0xE578000D, 0xE580000D, 0xE588000D, 0xE590000D, 0xE598000D, 0xE5A0000D, 0xE5A8000D, 0xE5B0000D, 0xE5B8000D, 0xE5C0000D, 0xE5C8000D, 0xE5D0000D, 0xE5D8000D, 0xE5E0000D, 0xE5E8000D, 0xE5F0000D, 0xE5F8000D, 0xE600000D, 0xE608000D, 0xE610000D, 0xE618000D, 0xE620000D, 0xE628000D, 0xE630000D, 0xE638000D, 0xE640000D, 0xE648000D, 0xE650000D, 0xE658000D, 0xE660000D, 0xE668000D, 0xE670000D, 0xE678000D, 0xE680000D, 0xE688000D, 0xE690000D, 0xE698000D, 0xE6A0000D, 0xE6A8000D, 0xE6B0000D, 0xE6B8000D, 0xE6C0000D, 0xE6C8000D, 0xE6D0000D, 0xE6D8000D, 0xE6E0000D, 0xE6E8000D, 0xE6F0000D, 0xE6F8000D, 0xE700000D, 0xE708000D, 0xE710000D, 0xE718000D, 0xE720000D, 0xE728000D, 0xE730000D, 0xE738000D, 0xE740000D, 0xE748000D, 0xE750000D, 0xE758000D, 0xE760000D, 0xE768000D, 0xE770000D, 0xE778000D, 0xE780000D, 0xE788000D, 0xE790000D, 0xE798000D, 0xE7A0000D, 0xE7A8000D, 0xE7B0000D, 0xE7B8000D, 0xE7C0000D, 0xE7C8000D, 0xE7D0000D, 0xE7D8000D, 0xE7E0000D, 0xE7E8000D, 0xE7F0000D, 0xE7F8000D, 0xE800000D, 0xE808000D, 0xE810000D, 0xE818000D, 0xE820000D, 0xE828000D, 0xE830000D, 0xE838000D, 0xE840000D, 0xE848000D, 0xE850000D, 0xE858000D, 0xE860000D, 0xE868000D, 0xE870000D, 0xE878000D, 0xE880000D, 0xE888000D, 0xE890000D, 0xE898000D, 0xE8A0000D, 0xE8A8000D, 0xE8B0000D, 0xE8B8000D, 0xE8C0000D, 0xE8C8000D, 0xE8D0000D, 0xE8D8000D, 0xE8E0000D, 0xE8E8000D, 0xE8F0000D, 0xE8F8000D, 0xE900000D, 0xE908000D, 0xE910000D, 0xE918000D, 0xE920000D, 0xE928000D, 0xE930000D, 0xE938000D, 0xE940000D, 0xE948000D, 0xE950000D, 0xE958000D, 0xE960000D, 0xE968000D, 0xE970000D, 0xE978000D, 0xE980000D, 0xE988000D, 0xE990000D, 0xE998000D, 0xE9A0000D, 0xE9A8000D, 0xE9B0000D, 0xE9B8000D, 0xE9C0000D, 0xE9C8000D, 0xE9D0000D, 0xE9D8000D, 0xE9E0000D, 0xE9E8000D, 0xE9F0000D, 0xE9F8000D, 0xEA00000D, 0xEA08000D, 0xEA10000D, 0xEA18000D, 0xEA20000D, 0xEA28000D, 0xEA30000D, 0xEA38000D, 0xEA40000D, 0xEA48000D, 0xEA50000D, 0xEA58000D, 0xEA60000D, 0xEA68000D, 0xEA70000D, 0xEA78000D, 0xEA80000D, 0xEA88000D, 0xEA90000D, 0xEA98000D, 0xEAA0000D, 0xEAA8000D, 0xEAB0000D, 0xEAB8000D, 0xEAC0000D, 0xEAC8000D, 0xEAD0000D, 0xEAD8000D, 0xEAE0000D, 0xEAE8000D, 0xEAF0000D, 0xEAF8000D, 0xEB00000D, 0xEB08000D, 0xEB10000D, 0xEB18000D, 0xEB20000D, 0xEB28000D, 0xEB30000D, 0xEB38000D, 0xEB40000D, 0xEB48000D, 0xEB50000D, 0xEB58000D, 0xEB60000D, 0xEB68000D, 0xEB70000D, 0xEB78000D, 0xEB80000D, 0xEB88000D, 0xEB90000D, 0xEB98000D, 0xEBA0000D, 0xEBA8000D, 0xEBB0000D, 0xEBB8000D, 0xEBC0000D, 0xEBC8000D, 0xEBD0000D, 0xEBD8000D, 0xEBE0000D, 0xEBE8000D, 0xEBF0000D, 0xEBF8000D, 0xEC00000D, 0xEC08000D, 0xEC10000D, 0xEC18000D, 0xEC20000D, 0xEC28000D, 0xEC30000D, 0xEC38000D, 0xEC40000D, 0xEC48000D, 0xEC50000D, 0xEC58000D, 0xEC60000D, 0xEC68000D, 0xEC70000D, 0xEC78000D, 0xEC80000D, 0xEC88000D, 0xEC90000D, 0xEC98000D, 0xECA0000D, 0xECA8000D, 0xECB0000D, 0xECB8000D, 0xECC0000D, 0xECC8000D, 0xECD0000D, 0xECD8000D, 0xECE0000D, 0xECE8000D, 0xECF0000D, 0xECF8000D, 0xED00000D, 0xED08000D, 0xED10000D, 0xED18000D, 0xED20000D, 0xED28000D, 0xED30000D, 0xED38000D, 0xED40000D, 0xED48000D, 0xED50000D, 0xED58000D, 0xED60000D, 0xED68000D, 0xED70000D, 0xED78000D, 0xED80000D, 0xED88000D, 0xED90000D, 0xED98000D, 0xEDA0000D, 0xEDA8000D, 0xEDB0000D, 0xEDB8000D, 0xEDC0000D, 0xEDC8000D, 0xEDD0000D, 0xEDD8000D, 0xEDE0000D, 0xEDE8000D, 0xEDF0000D, 0xEDF8000D, 0xEE00000D, 0xEE08000D, 0xEE10000D, 0xEE18000D, 0xEE20000D, 0xEE28000D, 0xEE30000D, 0xEE38000D, 0xEE40000D, 0xEE48000D, 0xEE50000D, 0xEE58000D, 0xEE60000D, 0xEE68000D, 0xEE70000D, 0xEE78000D, 0xEE80000D, 0xEE88000D, 0xEE90000D, 0xEE98000D, 0xEEA0000D, 0xEEA8000D, 0xEEB0000D, 0xEEB8000D, 0xEEC0000D, 0xEEC8000D, 0xEED0000D, 0xEED8000D, 0xEEE0000D, 0xEEE8000D, 0xEEF0000D, 0xEEF8000D, 0xEF00000D, 0xEF08000D, 0xEF10000D, 0xEF18000D, 0xEF20000D, 0xEF28000D, 0xEF30000D, 0xEF38000D, 0xEF40000D, 0xEF48000D, 0xEF50000D, 0xEF58000D, 0xEF60000D, 0xEF68000D, 0xEF70000D, 0xEF78000D, 0xEF80000D, 0xEF88000D, 0xEF90000D, 0xEF98000D, 0x3BE8E, 0x3BEAE, 0x3BECE, 0x3BEEE, 0x3BF0E, 0x3BF2E, 0x3BF4E, 0x3BF6E, 0x3BF8E, 0x3BFAE, 0x3BFCE, 0x3BFEE, 0x3C00E, 0x3C02E, 0x3C04E, 0x3C06E, 0x3C08E, 0x3C0AE, 0x3C0CE, 0x3C0EE, 0x3C10E, 0x3C12E, 0x3C14E, 0x3C16E, 0x3C18E, 0x3C1AE, 0xF070000E, 0xF078000E, 0xF080000E, 0xF088000E, 0xF090000E, 0xF098000E, 0xF0A0000E, 0xF0A8000E, 0xF0B0000E, 0xF0B8000E, 0xF0C0000E, 0xF0C8000E, 0xF0D0000E, 0xF0D8000E, 0xF0E0000E, 0xF0E8000E, 0xF0F0000E, 0xF0F8000E, 0xF100000E, 0xF108000E, 0xF110000E, 0xF118000E, 0xF120000E, 0xF128000E, 0xF130000E, 0xF138000E, 0xF140000E, 0xF148000E, 0xF150000E, 0xF158000E, 0xF160000E, 0xF168000E, 0xF170000E, 0xF178000E, 0xF180000E, 0xF188000E, 0xF190000E, 0xF198000E, 0xF1A0000E, 0xF1A8000E, 0xF1B0000E, 0xF1B8000E, 0xF1C0000E, 0xF1C8000E, 0xF1D0000E, 0xF1D8000E, 0xF1E0000E, 0xF1E8000E, 0xF1F0000E, 0xF1F8000E, 0xF200000E, 0xF208000E, 0xF210000E, 0xF218000E, 0xF220000E, 0xF228000E, 0xF230000E, 0xF238000E, 0xF240000E, 0xF248000E, 0xF250000E, 0xF258000E, 0xF260000E, 0xF268000E, 0xF270000E, 0xF278000E, 0xF280000E, 0xF288000E, 0xF290000E, 0xF298000E, 0xF2A0000E, 0xF2A8000E, 0xF2B0000E, 0xF2B8000E, 0xF2C0000E, 0xF2C8000E, 0xF2D0000E, 0xF2D8000E, 0xF2E0000E, 0xF2E8000E, 0xF2F0000E, 0xF2F8000E, 0xF300000E, 0xF308000E, 0xF310000E, 0xF318000E, 0xF320000E, 0xF328000E, 0xF330000E, 0xF338000E, 0xF340000E, 0xF348000E, 0xF350000E, 0xF358000E, 0xF360000E, 0xF368000E, 0xF370000E, 0xF378000E, 0xF380000E, 0xF388000E, 0xF390000E, 0xF398000E, 0xF3A0000E, 0xF3A8000E, 0xF3B0000E, 0xF3B8000E, 0xF3C0000E, 0xF3C8000E, 0xF3D0000E, 0xF3D8000E, 0xF3E0000E, 0xF3E8000E, 0xF3F0000E, 0xF3F8000E, 0xF400000E, 0xF408000E, 0xF410000E, 0xF418000E, 0xF420000E, 0xF428000E, 0xF430000E, 0xF438000E, 0xF440000E, 0xF448000E, 0xF450000E, 0xF458000E, 0xF460000E, 0xF468000E, 0xF470000E, 0xF478000E, 0xF480000E, 0xF488000E, 0xF490000E, 0xF498000E, 0xF4A0000E, 0xF4A8000E, 0xF4B0000E, 0xF4B8000E, 0xF4C0000E, 0xF4C8000E, 0xF4D0000E, 0xF4D8000E, 0xF4E0000E, 0xF4E8000E, 0xF4F0000E, 0xF4F8000E, 0xF500000E, 0xF508000E, 0xF510000E, 0xF518000E, 0xF520000E, 0xF528000E, 0xF530000E, 0xF538000E, 0xF540000E, 0xF548000E, 0xF550000E, 0xF558000E, 0xF560000E, 0xF568000E, 0xF570000E, 0xF578000E, 0xF580000E, 0xF588000E, 0xF590000E, 0xF598000E, 0xF5A0000E, 0xF5A8000E, 0xF5B0000E, 0xF5B8000E, 0xF5C0000E, 0xF5C8000E, 0xF5D0000E, 0xF5D8000E, 0xF5E0000E, 0xF5E8000E, 0xF5F0000E, 0xF5F8000E, 0xF600000E, 0xF608000E, 0xF610000E, 0xF618000E, 0xF620000E, 0xF628000E, 0xF630000E, 0xF638000E, 0xF640000E, 0xF648000E, 0xF650000E, 0xF658000E, 0xF660000E, 0xF668000E, 0xF670000E, 0xF678000E, 0xF680000E, 0xF688000E, 0xF690000E, 0xF698000E, 0xF6A0000E, 0xF6A8000E, 0xF6B0000E, 0xF6B8000E, 0xF6C0000E, 0xF6C8000E, 0xF6D0000E, 0xF6D8000E, 0xF6E0000E, 0xF6E8000E, 0xF6F0000E, 0xF6F8000E, 0xF700000E, 0xF708000E, 0xF710000E, 0xF718000E, 0xF720000E, 0xF728000E, 0xF730000E, 0xF738000E, 0xF740000E, 0xF748000E, 0xF750000E, 0xF758000E, 0xF760000E, 0xF768000E, 0xF770000E, 0xF778000E, 0xF780000E, 0xF788000E, 0xF790000E, 0xF798000E, 0xF7A0000E, 0xF7A8000E, 0xF7B0000E, 0xF7B8000E, 0xF7C0000E, 0xF7C8000E, 0xF7D0000E, 0xF7D8000E, 0xF7E0000E, 0xF7E8000E, 0xF7F0000E, 0xF7F8000E, 0xF800000E, 0xF808000E, 0xF810000E, 0xF818000E, 0xF820000E, 0xF828000E, 0xF830000E, 0xF838000E, 0xF840000E, 0xF848000E, 0xF850000E, 0xF858000E, 0xF860000E, 0xF868000E, 0xF870000E, 0xF878000E, 0xF880000E, 0xF888000E, 0xF890000E, 0xF898000E, 0xF8A0000E, 0xF8A8000E, 0xF8B0000E, 0xF8B8000E, 0xF8C0000E, 0xF8C8000E, 0xF8D0000E, 0xF8D8000E, 0xF8E0000E, 0xF8E8000E, 0xF8F0000E, 0xF8F8000E, 0xF900000E, 0xF908000E, 0xF910000E, 0xF918000E, 0xF920000E, 0xF928000E, 0xF930000E, 0xF938000E, 0xF940000E, 0xF948000E, 0xF950000E, 0xF958000E, 0xF960000E, 0xF968000E, 0xF970000E, 0xF978000E, 0xF980000E, 0xF988000E, 0xF990000E, 0xF998000E, 0xF9A0000E, 0xF9A8000E, 0xF9B0000E, 0xF9B8000E, 0xF9C0000E, 0xF9C8000E, 0xF9D0000E, 0xF9D8000E, 0xF9E0000E, 0xF9E8000E, 0xF9F0000E, 0xF9F8000E, 0xFA00000E, 0xFA08000E, 0xFA10000E, 0xFA18000E, 0xFA20000E, 0xFA28000E, 0xFA30000E, 0xFA38000E, 0xFA40000E, 0xFA48000E, 0xFA50000E, 0xFA58000E, 0xFA60000E, 0xFA68000E, 0xFA70000E, 0xFA78000E, 0xFA80000E, 0xFA88000E, 0xFA90000E, 0xFA98000E, 0xFAA0000E, 0xFAA8000E, 0xFAB0000E, 0xFAB8000E, 0xFAC0000E, 0xFAC8000E, 0xFAD0000E, 0xFAD8000E, 0xFAE0000E, 0xFAE8000E, 0xFAF0000E, 0xFAF8000E, 0xFB00000E, 0xFB08000E, 0xFB10000E, 0xFB18000E, 0xFB20000E, 0xFB28000E, 0xFB30000E, 0xFB38000E, 0xFB40000E, 0xFB48000E, 0xFB50000E, 0xFB58000E, 0xFB60000E, 0xFB68000E, 0xFB70000E, 0xFB78000E, 0xFB80000E, 0xFB88000E, 0xFB90000E, 0xFB98000E, 0xFBA0000E, 0xFBA8000E, 0xFBB0000E, 0xFBB8000E, 0xFBC0000E, 0xFBC8000E, 0xFBD0000E, 0xFBD8000E, 0xFBE0000E, 0xFBE8000E, 0xFBF0000E, 0xFBF8000E, 0xFC00000E, 0xFC08000E, 0xFC10000E, 0xFC18000E, 0xFC20000E, 0xFC28000E, 0xFC30000E, 0xFC38000E, 0xFC40000E, 0xFC48000E, 0xFC50000E, 0xFC58000E, 0xFC60000E, 0xFC68000E, 0xFC70000E, 0xFC78000E, 0xFC80000E, 0xFC88000E, 0xFC90000E, 0xFC98000E, 0xFCA0000E, 0xFCA8000E, 0xFCB0000E, 0xFCB8000E, 0xFCC0000E, 0xFCC8000E, 0xFCD0000E, 0xFCD8000E, 0xFCE0000E, 0xFCE8000E, 0xFCF0000E, 0xFCF8000E, 0xFD00000E, 0xFD08000E, 0xFD10000E, 0xFD18000E, 0xFD20000E, 0xFD28000E, 0xFD30000E, 0xFD38000E, 0xFD40000E, 0xFD48000E, 0xFD50000E, 0xFD58000E, 0xFD60000E, 0xFD68000E, 0xFD70000E, 0xFD78000E, 0xFD80000E, 0xFD88000E, 0xFD90000E, 0xFD98000E, 0xFDA0000E, 0xFDA8000E, 0xFDB0000E, 0xFDB8000E, 0xFDC0000E, 0xFDC8000E, 0xFDD0000E, 0xFDD8000E, 0xFDE0000E, 0xFDE8000E, 0xFDF0000E, 0xFDF8000E, 0xFE00000E, 0xFE08000E, 0xFE10000E, 0xFE18000E, 0xFE20000E, 0xFE28000E, 0xFE30000E, 0xFE38000E, 0xFE40000E, 0xFE48000E, 0xFE50000E, 0xFE58000E, 0xFE60000E, 0xFE68000E, 0xFE70000E, 0xFE78000E, 0xFE80000E, 0xFE88000E, 0xFE90000E, 0xFE98000E, 0xFEA0000E, 0xFEA8000E, 0xFEB0000E, 0xFEB8000E, 0xFEC0000E, 0xFEC8000E, 0xFED0000E, 0xFED8000E, 0xFEE0000E, 0xFEE8000E, 0xFEF0000E, 0xFEF8000E, 0xFF00000E, 0xFF08000E, 0xFF10000E, 0xFF18000E, 0xFF20000E, 0xFF28000E, 0xFF30000E, 0xFF38000E, 0xFF40000E, 0xFF48000E, 0xFF50000E, 0xFF58000E, 0xFF60000E, 0xFF68000E, 0xFF70000E, 0xFF78000E, 0xFF80000E, 0xFF88000E, 0xFF90000E, 0xFF98000E, 0xFFA0000E, 0xFFA8000E, 0xFFB0000E, 0xFFB8000E, 0xFFC0000E, 0xFFC8000E, 0xFFD0000E, 0xFFD8000E, 0xFFE0000E, 0xFFE8000E, 0xFFF0000E, 0xFFF8000E, 0x10000000E, 0x10008000E, 0x10010000E, 0x10018000E, 0x10020000E, 0x10028000E, 0x10030000E, 0x10038000E, 0x10040000E, 0x10048000E, 0x10050000E, 0x10058000E, 0x10060000E, 0x10068000E, 0x10070000E, 0x10078000E, 0x10080000E, 0x10088000E, 0x10090000E, 0x10098000E, 0x100A0000E, 0x100A8000E, 0x100B0000E, 0x100B8000E, 0x100C0000E, 0x100C8000E, 0x100D0000E, 0x100D8000E, 0x100E0000E, 0x100E8000E, 0x100F0000E, 0x100F8000E, 0x10100000E, 0x10108000E, 0x10110000E, 0x10118000E, 0x10120000E, 0x10128000E, 0x10130000E, 0x10138000E, 0x10140000E, 0x10148000E, 0x10150000E, 0x10158000E, 0x10160000E, 0x10168000E, 0x10170000E, 0x10178000E, 0x10180000E, 0x10188000E, 0x10190000E, 0x10198000E, 0x101A0000E, 0x101A8000E, 0x101B0000E, 0x101B8000E, 0x101C0000E, 0x101C8000E, 0x101D0000E, 0x101D8000E, 0x101E0000E, 0x101E8000E, 0x101F0000E, 0x101F8000E, 0x10200000E, 0x10208000E, 0x10210000E, 0x10218000E, 0x10220000E, 0x10228000E, 0x10230000E, 0x10238000E, 0x10240000E, 0x10248000E, 0x10250000E, 0x10258000E, 0x10260000E, 0x10268000E, 0x10270000E, 0x10278000E, 0x10280000E, 0x10288000E, 0x10290000E, 0x10298000E, 0x102A0000E, 0x102A8000E, 0x102B0000E, 0x102B8000E, 0x102C0000E, 0x102C8000E, 0x102D0000E, 0x102D8000E, 0x102E0000E, 0x102E8000E, 0x102F0000E, 0x102F8000E, 0x10300000E, 0x10308000E, 0x10310000E, 0x10318000E, 0x10320000E, 0x10328000E, 0x10330000E, 0x10338000E, 0x10340000E, 0x10348000E, 0x10350000E, 0x10358000E, 0x10360000E, 0x10368000E, 0x10370000E, 0x10378000E, 0x10380000E, 0x10388000E, 0x10390000E, 0x10398000E, 0x103A0000E, 0x103A8000E, 0x103B0000E, 0x103B8000E, 0x103C0000E, 0x103C8000E, 0x103D0000E, 0x103D8000E, 0x103E0000E, 0x103E8000E, 0x103F0000E, 0x103F8000E, 0x10400000E, 0x10408000E, 0x10410000E, 0x10418000E, 0x10420000E, 0x10428000E, 0x10430000E, 0x10438000E, 0x10440000E, 0x10448000E, 0x10450000E, 0x10458000E, 0x10460000E, 0x10468000E, 0x10470000E, 0x10478000E, 0x10480000E, 0x10488000E, 0x10490000E, 0x10498000E, 0x104A0000E, 0x104A8000E, 0x104B0000E, 0x104B8000E, 0x104C0000E, 0x104C8000E, 0x104D0000E, 0x104D8000E, 0x104E0000E, 0x104E8000E, 0x104F0000E, 0x104F8000E, 0x10500000E, 0x10508000E, 0x10510000E, 0x10518000E, 0x10520000E, 0x10528000E, 0x10530000E, 0x10538000E, 0x10540000E, 0x10548000E, 0x10550000E, 0x10558000E, 0x10560000E, 0x10568000E, 0x10570000E, 0x10578000E, 0x10580000E, 0x10588000E, 0x10590000E, 0x10598000E, 0x105A0000E, 0x105A8000E, 0x105B0000E, 0x105B8000E, 0x105C0000E, 0x105C8000E, 0x105D0000E, 0x105D8000E, 0x105E0000E, 0x105E8000E, 0x105F0000E, 0x105F8000E, 0x10600000E, 0x10608000E, 0x10610000E, 0x10618000E, 0x10620000E, 0x10628000E, 0x10630000E, 0x10638000E, 0x10640000E, 0x10648000E, 0x10650000E, 0x10658000E, 0x10660000E, 0x10668000E, 0x10670000E, 0x10678000E, 0x10680000E, 0x10688000E, 0x10690000E, 0x10698000E, 0x106A0000E, 0x106A8000E, 0x106B0000E, 0x106B8000E, 0x106C0000E, 0x106C8000E, 0x106D0000E, 0x106D8000E, 0x106E0000E, 0x106E8000E, 0x106F0000E, 0x106F8000E, 0x10700000E, 0x10708000E, 0x10710000E, 0x10718000E, 0x10720000E, 0x10728000E, 0x10730000E, 0x10738000E, 0x10740000E, 0x10748000E, 0x10750000E, 0x10758000E, 0x10760000E, 0x10768000E, 0x10770000E, 0x10778000E, 0x10780000E, 0x10788000E, 0x10790000E, 0x10798000E, 0x107A0000E, 0x107A8000E, 0x107B0000E, 0x107B8000E, 0x107C0000E, 0x107C8000E, 0x107D0000E, 0x107D8000E, 0x107E0000E, 0x107E8000E, 0x107F0000E, 0x107F8000E, 0x10800000E, 0x10808000E, 0x10810000E, 0x10818000E, 0x10820000E, 0x10828000E, 0x10830000E, 0x10838000E, 0x10840000E, 0x10848000E, 0x10850000E, 0x10858000E, 0x10860000E, 0x10868000E, 0x10870000E, 0x10878000E, 0x10880000E, 0x10888000E, 0x10890000E, 0x10898000E, 0x108A0000E, 0x108A8000E, 0x108B0000E, 0x108B8000E, 0x108C0000E, 0x108C8000E, 0x108D0000E, 0x108D8000E, 0x108E0000E, 0x108E8000E, 0x108F0000E, 0x108F8000E, 0x10900000E, 0x10908000E, 0x10910000E, 0x10918000E, 0x10920000E, 0x10928000E, 0x10930000E, 0x10938000E, 0x10940000E, 0x10948000E, 0x10950000E, 0x10958000E, 0x10960000E, 0x10968000E, 0x10970000E, 0x10978000E, 0x10980000E, 0x10988000E, 0x10990000E, 0x10998000E, 0x109A0000E, 0x109A8000E, 0x109B0000E, 0x109B8000E, 0x109C0000E, 0x109C8000E, 0x109D0000E, 0x109D8000E, 0x109E0000E, 0x109E8000E, 0x109F0000E, 0x109F8000E, 0x10A00000E, 0x10A08000E, 0x10A10000E, 0x10A18000E, 0x10A20000E, 0x10A28000E, 0x10A30000E, 0x10A38000E, 0x10A40000E, 0x10A48000E, 0x10A50000E, 0x10A58000E, 0x10A60000E, 0x10A68000E, 0x10A70000E, 0x10A78000E, 0x10A80000E, 0x10A88000E, 0x10A90000E, 0x10A98000E, 0x10AA0000E, 0x10AA8000E, 0x10AB0000E, 0x10AB8000E, 0x10AC0000E, 0x10AC8000E, 0x10AD0000E, 0x10AD8000E, 0x10AE0000E, 0x10AE8000E, 0x10AF0000E, 0x10AF8000E, 0x10B00000E, 0x10B08000E, 0x10B10000E, 0x10B18000E, 0x10B20000E, 0x10B28000E, 0x10B30000E, 0x10B38000E, 0x10B40000E, 0x10B48000E, 0x10B50000E, 0x10B58000E, 0x10B60000E, 0x10B68000E, 0x10B70000E, 0x10B78000E, 0x10B80000E, 0x10B88000E, 0x10B90000E, 0x10B98000E, 0x10BA0000E, 0x10BA8000E, 0x10BB0000E, 0x10BB8000E, 0x10BC0000E, 0x10BC8000E, 0x10BD0000E, 0x10BD8000E, 0x10BE0000E, 0x10BE8000E, 0x10BF0000E, 0x10BF8000E, 0x10C00000E, 0x10C08000E, 0x10C10000E, 0x10C18000E, 0x10C20000E, 0x10C28000E, 0x10C30000E, 0x10C38000E, 0x10C40000E, 0x10C48000E, 0x10C50000E, 0x10C58000E, 0x10C60000E, 0x10C68000E, 0x10C70000E, 0x10C78000E, 0x10C80000E, 0x10C88000E, 0x10C90000E, 0x10C98000E, 0x10CA0000E, 0x10CA8000E, 0x10CB0000E, 0x10CB8000E, 0x10CC0000E, 0x10CC8000E, 0x10CD0000E, 0x10CD8000E, 0x10CE0000E, 0x10CE8000E, 0x10CF0000E, 0x10CF8000E, 0x10D00000E, 0x10D08000E, 0x10D10000E, 0x10D18000E, 0x10D20000E, 0x10D28000E, 0x10D30000E, 0x10D38000E, 0x10D40000E, 0x10D48000E, 0x10D50000E, 0x10D58000E, 0x10D60000E, 0x10D68000E, 0x10D70000E, 0x10D78000E, 0x10D80000E, 0x10D88000E, 0x10D90000E, 0x10D98000E, 0x10DA0000E, 0x10DA8000E, 0x10DB0000E, 0x10DB8000E, 0x10DC0000E, 0x10DC8000E, 0x10DD0000E, 0x10DD8000E, 0x10DE0000E, 0x10DE8000E, 0x10DF0000E, 0x10DF8000E, 0x10E00000E, 0x10E08000E, 0x10E10000E, 0x10E18000E, 0x10E20000E, 0x10E28000E, 0x10E30000E, 0x10E38000E, 0x10E40000E, 0x10E48000E, 0x10E50000E, 0x10E58000E, 0x10E60000E, 0x10E68000E, 0x10E70000E, 0x10E78000E, 0x10E80000E, 0x10E88000E, 0x10E90000E, 0x10E98000E, 0x10EA0000E, 0x10EA8000E, 0x10EB0000E, 0x10EB8000E, 0x10EC0000E, 0x10EC8000E, 0x10ED0000E, 0x10ED8000E, 0x10EE0000E, 0x10EE8000E, 0x10EF0000E, 0x10EF8000E, 0x10F00000E, 0x10F08000E, 0x10F10000E, 0x10F18000E, 0x10F20000E, 0x10F28000E, 0x10F30000E, 0x10F38000E, 0x10F40000E, 0x10F48000E, 0x10F50000E, 0x10F58000E, 0x10F60000E, 0x10F68000E, 0x10F70000E, 0x10F78000E, 0x10F80000E, 0x10F88000E, 0x10F90000E, 0x10F98000E, 0x10FA0000E, 0x10FA8000E, 0x10FB0000E, 0x10FB8000E, 0x10FC0000E, 0x10FC8000E, 0x10FD0000E, 0x10FD8000E, 0x10FE0000E, 0x10FE8000E, 0x10FF0000E, 0x10FF8000E, 0x11000000E, 0x11008000E, 0x11010000E, 0x11018000E, 0x11020000E, 0x11028000E, 0x11030000E, 0x11038000E, 0x11040000E, 0x11048000E, 0x11050000E, 0x11058000E, 0x11060000E, 0x11068000E, 0x11070000E, 0x11078000E, 0x11080000E, 0x11088000E, 0x11090000E, 0x11098000E, 0x110A0000E, 0x110A8000E, 0x110B0000E, 0x110B8000E, 0x110C0000E, 0x110C8000E, 0x110D0000E, 0x110D8000E, 0x110E0000E, 0x110E8000E, 0x110F0000E, 0x110F8000E, 0x11100000E, 0x11108000E, 0x11110000E, 0x11118000E, 0x11120000E, 0x11128000E, 0x11130000E, 0x11138000E, 0x11140000E, 0x11148000E, 0x11150000E, 0x11158000E, 0x11160000E, 0x11168000E, 0x11170000E, 0x11178000E, 0x11180000E, 0x11188000E, 0x11190000E, 0x11198000E, 0x111A0000E, 0x111A8000E, 0x111B0000E, 0x111B8000E, 0x111C0000E, 0x111C8000E, 0x111D0000E, 0x111D8000E, 0x111E0000E, 0x111E8000E, 0x111F0000E, 0x111F8000E, 0x11200000E, 0x11208000E, 0x11210000E, 0x11218000E, 0x11220000E, 0x11228000E, 0x11230000E, 0x11238000E, 0x11240000E, 0x11248000E, 0x11250000E, 0x11258000E, 0x11260000E, 0x11268000E, 0x11270000E, 0x11278000E, 0x11280000E, 0x11288000E, 0x11290000E, 0x11298000E, 0x112A0000E, 0x112A8000E, 0x112B0000E, 0x112B8000E, 0x112C0000E, 0x112C8000E, 0x112D0000E, 0x112D8000E, 0x112E0000E, 0x112E8000E, 0x112F0000E, 0x112F8000E, 0x11300000E, 0x11308000E, 0x11310000E, 0x11318000E, 0x11320000E, 0x11328000E, 0x11330000E, 0x11338000E, 0x11340000E, 0x11348000E, 0x11350000E, 0x11358000E, 0x11360000E, 0x11368000E, 0x11370000E, 0x11378000E, 0x11380000E, 0x11388000E, 0x11390000E, 0x11398000E, 0x113A0000E, 0x113A8000E, 0x113B0000E, 0x113B8000E, 0x113C0000E, 0x113C8000E, 0x113D0000E, 0x113D8000E, 0x113E0000E, 0x113E8000E, 0x113F0000E, 0x113F8000E, 0x11400000E, 0x11408000E, 0x11410000E, 0x11418000E, 0x11420000E, 0x11428000E, 0x11430000E, 0x11438000E, 0x11440000E, 0x11448000E, 0x11450000E, 0x11458000E, 0x11460000E, 0x11468000E, 0x11470000E, 0x11478000E, 0x11480000E, 0x11488000E, 0x11490000E, 0x11498000E, 0x114A0000E, 0x114A8000E, 0x114B0000E, 0x114B8000E, 0x114C0000E, 0x114C8000E, 0x114D0000E, 0x114D8000E, 0x114E0000E, 0x114E8000E, 0x114F0000E, 0x114F8000E, 0x11500000E, 0x11508000E, 0x11510000E, 0x11518000E, 0x11520000E, 0x11528000E, 0x11530000E, 0x11538000E, 0x11540000E, 0x11548000E, 0x11550000E, 0x11558000E, 0x11560000E, 0x11568000E, 0x11570000E, 0x11578000E, 0x11580000E, 0x11588000E, 0x11590000E, 0x11598000E, 0x115A0000E, 0x115A8000E, 0x115B0000E, 0x115B8000E, 0x115C0000E, 0x115C8000E, 0x115D0000E, 0x115D8000E, 0x115E0000E, 0x115E8000E, 0x115F0000E, 0x115F8000E, 0x11600000E, 0x11608000E, 0x11610000E, 0x11618000E, 0x11620000E, 0x11628000E, 0x11630000E, 0x11638000E, 0x11640000E, 0x11648000E, 0x11650000E, 0x11658000E, 0x11660000E, 0x11668000E, 0x11670000E, 0x11678000E, 0x11680000E, 0x11688000E, 0x11690000E, 0x11698000E, 0x45A8F, 0x45AAF, 0x45ACF, 0x45AEF, 0x45B0F, 0x45B2F, 0x45B4F, 0x45B6F, 0x45B8F, 0x45BAF, 0x45BCF, 0x45BEF, 0x45C0F, 0x45C2F, 0x45C4F, 0x45C6F, 0x45C8F, 0x45CAF, 0x45CCF, 0x45CEF, 0x45D0F, 0x45D2F, 0x45D4F, 0x45D6F, 0x45D8F, 0x45DAF, 0x1177C5DCF, 0x1178C5E0F, 0x1179C5E4F, 0x117AC5E8F, 0x117BC5ECF, 0x117CC5F0F, 0x117DC5F4F, 0x117EC5F8F, 0x117FC5FCF, 0x1180C600F, 0x1181C604F, 0x1182C608F, 0x1183C60CF, 0x1184C610F, 0x1185C614F, 0x1186C618F, 0x1187C61CF, 0x1188C620F, 0x1189C624F, 0x118AC628F, 0x118BC62CF, 0x118CC630F, 0x118DC634F, 0x118EC638F, 0x118FC63CF, 0x1190C640F, 0x1191C644F, 0x1192C648F, 0x1193C64CF, 0x1194C650F, 0x1195C654F, 0x1196C658F, 0x1197C65CF, 0x1198C660F, 0x1199C664F, 0x119AC668F, 0x119BC66CF, 0x119CC670F, 0x119DC674F, 0x119EC678F, 0x119FC67CF, 0x11A0C680F, 0x11A1C684F, 0x11A2C688F, 0x11A3C68CF, 0x11A4C690F, 0x11A5C694F, 0x11A6C698F, 0x11A7C69CF, 0x11A8C6A0F, 0x11A9C6A4F, 0x11AAC6A8F, 0x11ABC6ACF, 0x11ACC6B0F, 0x11ADC6B4F, 0x11AEC6B8F, 0x11AFC6BCF, 0x11B0C6C0F, 0x11B1C6C4F, 0x11B2C6C8F, 0x11B3C6CCF, 0x11B4C6D0F, 0x11B5C6D4F, 0x11B6C6D8F, 0x11B7C6DCF, 0x11B8C6E0F, 0x11B9C6E4F, 0x11BAC6E8F, 0x11BBC6ECF, 0x11BCC6F0F, 0x11BDC6F4F, 0x11BEC6F8F, 0x11BFC6FCF, 0x11C0C700F, 0x11C1C704F, 0x11C2C708F, 0x11C3C70CF, 0x11C4C710F, 0x11C5C714F, 0x11C6C718F, 0x471CF, 0x11C8471EF, 0x11C94722F, 0x4726F, 0x4728F, 0x472AF, 0x472CF, 0x472EF, 0x4730F, 0x4732F, 0x4734F, 0x11CE4736F, 0x11CF473AF, 0x11D0473EF, 0x11D14742F, 0x11D24746F, 0x11D3474AF, 0x11D4474EF, 0x11D54752F, 0x4756F, 0x4758F, 0x475AF, 0x475CF, 0x475EF, 0x4760F, 0x4762F, 0x4764F, 0x4766F, 0x4768F, 0x476AF, 0x476CF, 0x11DC476EF, 0x4772F, 0x4774F, 0x4776F, 0x4778F, 0x477AF, 0x477CF, 0x11E0477EF, 0x4782F, 0x4784F, 0x4786F, 0x4788F, 0x478AF, 0x478CF, 0x478EF, 0x4790F, 0x4792F, 0x4794F, 0x4796F, 0x4798F, 0x479AF, 0x479CF, 0x479EF, 0x47A0F, 0x47A2F, 0x47A4F, 0x47A6F, 0x47A8F, 0x47AAF, 0x47ACF, 0x47AEF, 0x47B0F, 0x47B2F, 0x47B4F, 0x47B6F, 0x47B8F, 0x47BAF, 0x47BCF, 0x47BEF, 0x47C0F, 0x47C2F, 0x47C4F, 0x47C6F, 0x47C8F, 0x47CAF, 0x47CCF, 0x47CEF, 0x47D0F, 0x47D2F, 0x47D4F, 0x47D6F, 0x47D8F, 0x47DAF, 0x47DCF, 0x47DEF, 0x47E0F, 0x47E2F, 0x47E4F, 0x47E6F, 0x47E8F, 0x47EAF, 0x47ECF, 0x47EEF, 0x47F0F, 0x47F2F, 0x47F4F, 0x47F6F, 0x47F8F, 0x47FAF, 0x47FCF, 0x47FEF, 0x4800F, 0x4802F, 0x4804F, 0x4806F, 0x4808F, 0x480AF, 0x480CF, 0x480EF, 0x4810F, 0x4812F, 0x4814F, 0x4816F, 0x4818F, 0x481AF, 0x12070000F, 0x12078000F, 0x12080000F, 0x12088000F, 0x12090000F, 0x12098000F, 0x120A0000F, 0x120A8000F, 0x120B0000F, 0x120B8000F, 0x120C0000F, 0x120C8000F, 0x120D0000F, 0x120D8000F, 0x120E0000F, 0x120E8000F, 0x120F0000F, 0x120F8000F, 0x12100000F, 0x12108000F, 0x12110000F, 0x12118000F, 0x12120000F, 0x12128000F, 0x12130000F, 0x12138000F, 0x12140000F, 0x12148000F, 0x12150000F, 0x12158000F, 0x12160000F, 0x12168000F, 0x12170000F, 0x12178000F, 0x12180000F, 0x12188000F, 0x12190000F, 0x12198000F, 0x121A0000F, 0x121A8000F, 0x121B0000F, 0x121B8000F, 0x121C0000F, 0x121C8000F, 0x121D0000F, 0x121D8000F, 0x121E0000F, 0x121E8000F, 0x121F0000F, 0x121F8000F, 0x12200000F, 0x12208000F, 0x12210000F, 0x12218000F, 0x12220000F, 0x12228000F, 0x12230000F, 0x12238000F, 0x12240000F, 0x12248000F, 0x12250000F, 0x12258000F, 0x12260000F, 0x12268000F, 0x12270000F, 0x12278000F, 0x12280000F, 0x12288000F, 0x12290000F, 0x12298000F, 0x122A0000F, 0x122A8000F, 0x122B0000F, 0x122B8000F, 0x122C0000F, 0x122C8000F, 0x122D0000F, 0x122D8000F, 0x122E0000F, 0x122E8000F, 0x122F0000F, 0x122F8000F, 0x12300000F, 0x12308000F, 0x12310000F, 0x12318000F, 0x12320000F, 0x12328000F, 0x12330000F, 0x12338000F, 0x12340000F, 0x12348000F, 0x12350000F, 0x12358000F, 0x12360000F, 0x12368000F, 0x12370000F, 0x12378000F, 0x12380000F, 0x12388000F, 0x12390000F, 0x12398000F, 0x123A0000F, 0x123A8000F, 0x123B0000F, 0x123B8000F, 0x123C0000F, 0x123C8000F, 0x123D0000F, 0x123D8000F, 0x123E0000F, 0x123E8000F, 0x123F0000F, 0x123F8000F, 0x12400000F, 0x12408000F, 0x12410000F, 0x12418000F, 0x12420000F, 0x12428000F, 0x12430000F, 0x12438000F, 0x12440000F, 0x12448000F, 0x12450000F, 0x12458000F, 0x12460000F, 0x12468000F, 0x12470000F, 0x12478000F, 0x12480000F, 0x12488000F, 0x12490000F, 0x12498000F, 0x124A0000F, 0x124A8000F, 0x124B0000F, 0x124B8000F, 0x124C0000F, 0x124C8000F, 0x124D0000F, 0x124D8000F, 0x124E0000F, 0x124E8000F, 0x124F0000F, 0x124F8000F, 0x12500000F, 0x12508000F, 0x12510000F, 0x12518000F, 0x12520000F, 0x12528000F, 0x12530000F, 0x12538000F, 0x12540000F, 0x12548000F, 0x12550000F, 0x12558000F, 0x12560000F, 0x12568000F, 0x12570000F, 0x12578000F, 0x12580000F, 0x12588000F, 0x12590000F, 0x12598000F, 0x125A0000F, 0x125A8000F, 0x125B0000F, 0x125B8000F, 0x125C0000F, 0x125C8000F, 0x125D0000F, 0x125D8000F, 0x125E0000F, 0x125E8000F, 0x125F0000F, 0x125F8000F, 0x12600000F, 0x12608000F, 0x12610000F, 0x12618000F, 0x12620000F, 0x12628000F, 0x12630000F, 0x12638000F, 0x12640000F, 0x12648000F, 0x12650000F, 0x12658000F, 0x12660000F, 0x12668000F, 0x12670000F, 0x12678000F, 0x12680000F, 0x12688000F, 0x12690000F, 0x12698000F, 0x126A0000F, 0x126A8000F, 0x126B0000F, 0x126B8000F, 0x126C0000F, 0x126C8000F, 0x126D0000F, 0x126D8000F, 0x126E0000F, 0x126E8000F, 0x126F0000F, 0x126F8000F, 0x12700000F, 0x12708000F, 0x12710000F, 0x12718000F, 0x12720000F, 0x12728000F, 0x12730000F, 0x12738000F, 0x12740000F, 0x12748000F, 0x12750000F, 0x12758000F, 0x12760000F, 0x12768000F, 0x12770000F, 0x12778000F, 0x12780000F, 0x12788000F, 0x12790000F, 0x12798000F, 0x127A0000F, 0x127A8000F, 0x127B0000F, 0x127B8000F, 0x127C0000F, 0x127C8000F, 0x127D0000F, 0x127D8000F, 0x127E0000F, 0x127E8000F, 0x127F0000F, 0x127F8000F, 0x12800000F, 0x12808000F, 0x12810000F, 0x12818000F, 0x12820000F, 0x12828000F, 0x12830000F, 0x12838000F, 0x12840000F, 0x12848000F, 0x12850000F, 0x12858000F, 0x12860000F, 0x12868000F, 0x12870000F, 0x12878000F, 0x12880000F, 0x12888000F, 0x12890000F, 0x12898000F, 0x128A0000F, 0x128A8000F, 0x128B0000F, 0x128B8000F, 0x128C0000F, 0x128C8000F, 0x128D0000F, 0x128D8000F, 0x128E0000F, 0x128E8000F, 0x128F0000F, 0x128F8000F, 0x12900000F, 0x12908000F, 0x12910000F, 0x12918000F, 0x12920000F, 0x12928000F, 0x12930000F, 0x12938000F, 0x12940000F, 0x12948000F, 0x12950000F, 0x12958000F, 0x12960000F, 0x12968000F, 0x12970000F, 0x12978000F, 0x12980000F, 0x12988000F, 0x12990000F, 0x12998000F, 0x129A0000F, 0x129A8000F, 0x129B0000F, 0x129B8000F, 0x129C0000F, 0x129C8000F, 0x129D0000F, 0x129D8000F, 0x129E0000F, 0x129E8000F, 0x129F0000F, 0x129F8000F, 0x12A00000F, 0x12A08000F, 0x12A10000F, 0x12A18000F, 0x12A20000F, 0x12A28000F, 0x12A30000F, 0x12A38000F, 0x12A40000F, 0x12A48000F, 0x12A50000F, 0x12A58000F, 0x12A60000F, 0x12A68000F, 0x12A70000F, 0x12A78000F, 0x12A80000F, 0x12A88000F, 0x12A90000F, 0x12A98000F, 0x12AA0000F, 0x12AA8000F, 0x12AB0000F, 0x12AB8000F, 0x12AC0000F, 0x12AC8000F, 0x12AD0000F, 0x12AD8000F, 0x12AE0000F, 0x12AE8000F, 0x12AF0000F, 0x12AF8000F, 0x12B00000F, 0x12B08000F, 0x12B10000F, 0x12B18000F, 0x12B20000F, 0x12B28000F, 0x12B30000F, 0x12B38000F, 0x12B40000F, 0x12B48000F, 0x12B50000F, 0x12B58000F, 0x12B60000F, 0x12B68000F, 0x12B70000F, 0x12B78000F, 0x12B80000F, 0x12B88000F, 0x12B90000F, 0x12B98000F, 0x12BA0000F, 0x12BA8000F, 0x12BB0000F, 0x12BB8000F, 0x12BC0000F, 0x12BC8000F, 0x12BD0000F, 0x12BD8000F, 0x12BE0000F, 0x12BE8000F, 0x12BF0000F, 0x12BF8000F, 0x12C00000F, 0x12C08000F, 0x12C10000F, 0x12C18000F, 0x12C20000F, 0x12C28000F, 0x12C30000F, 0x12C38000F, 0x12C40000F, 0x12C48000F, 0x12C50000F, 0x12C58000F, 0x12C60000F, 0x12C68000F, 0x12C70000F, 0x12C78000F, 0x12C80000F, 0x12C88000F, 0x12C90000F, 0x12C98000F, 0x12CA0000F, 0x12CA8000F, 0x12CB0000F, 0x12CB8000F, 0x12CC0000F, 0x12CC8000F, 0x12CD0000F, 0x12CD8000F, 0x12CE0000F, 0x12CE8000F, 0x12CF0000F, 0x12CF8000F, 0x12D00000F, 0x12D08000F, 0x12D10000F, 0x12D18000F, 0x12D20000F, 0x12D28000F, 0x12D30000F, 0x12D38000F, 0x12D40000F, 0x12D48000F, 0x12D50000F, 0x12D58000F, 0x12D60000F, 0x12D68000F, 0x12D70000F, 0x12D78000F, 0x12D80000F, 0x12D88000F, 0x12D90000F, 0x12D98000F, 0x12DA0000F, 0x12DA8000F, 0x12DB0000F, 0x12DB8000F, 0x12DC0000F, 0x12DC8000F, 0x12DD0000F, 0x12DD8000F, 0x12DE0000F, 0x12DE8000F, 0x12DF0000F, 0x12DF8000F, 0x12E00000F, 0x12E08000F, 0x12E10000F, 0x12E18000F, 0x12E20000F, 0x12E28000F, 0x12E30000F, 0x12E38000F, 0x12E40000F, 0x12E48000F, 0x12E50000F, 0x12E58000F, 0x12E60000F, 0x12E68000F, 0x12E70000F, 0x12E78000F, 0x12E80000F, 0x12E88000F, 0x12E90000F, 0x12E98000F, 0x12EA0000F, 0x12EA8000F, 0x12EB0000F, 0x12EB8000F, 0x12EC0000F, 0x12EC8000F, 0x12ED0000F, 0x12ED8000F, 0x12EE0000F, 0x12EE8000F, 0x12EF0000F, 0x12EF8000F, 0x12F00000F, 0x12F08000F, 0x12F10000F, 0x12F18000F, 0x12F20000F, 0x12F28000F, 0x12F30000F, 0x12F38000F, 0x12F40000F, 0x12F48000F, 0x12F50000F, 0x12F58000F, 0x12F60000F, 0x12F68000F, 0x12F70000F, 0x12F78000F, 0x12F80000F, 0x12F88000F, 0x12F90000F, 0x12F98000F, 0x12FA0000F, 0x12FA8000F, 0x12FB0000F, 0x12FB8000F, 0x12FC0000F, 0x12FC8000F, 0x12FD0000F, 0x12FD8000F, 0x12FE0000F, 0x12FE8000F, 0x12FF0000F, 0x12FF8000F, 0x13000000F, 0x13008000F, 0x13010000F, 0x13018000F, 0x13020000F, 0x13028000F, 0x13030000F, 0x13038000F, 0x13040000F, 0x13048000F, 0x13050000F, 0x13058000F, 0x13060000F, 0x13068000F, 0x13070000F, 0x13078000F, 0x13080000F, 0x13088000F, 0x13090000F, 0x13098000F, 0x130A0000F, 0x130A8000F, 0x130B0000F, 0x130B8000F, 0x130C0000F, 0x130C8000F, 0x130D0000F, 0x130D8000F, 0x130E0000F, 0x130E8000F, 0x130F0000F, 0x130F8000F, 0x13100000F, 0x13108000F, 0x13110000F, 0x13118000F, 0x13120000F, 0x13128000F, 0x13130000F, 0x13138000F, 0x13140000F, 0x13148000F, 0x13150000F, 0x13158000F, 0x13160000F, 0x13168000F, 0x13170000F, 0x13178000F, 0x13180000F, 0x13188000F, 0x13190000F, 0x13198000F, 0x131A0000F, 0x131A8000F, 0x131B0000F, 0x131B8000F, 0x131C0000F, 0x131C8000F, 0x131D0000F, 0x131D8000F, 0x131E0000F, 0x131E8000F, 0x131F0000F, 0x131F8000F, 0x13200000F, 0x13208000F, 0x13210000F, 0x13218000F, 0x13220000F, 0x13228000F, 0x13230000F, 0x13238000F, 0x13240000F, 0x13248000F, 0x13250000F, 0x13258000F, 0x13260000F, 0x13268000F, 0x13270000F, 0x13278000F, 0x13280000F, 0x13288000F, 0x13290000F, 0x13298000F, 0x132A0000F, 0x132A8000F, 0x132B0000F, 0x132B8000F, 0x132C0000F, 0x132C8000F, 0x132D0000F, 0x132D8000F, 0x132E0000F, 0x132E8000F, 0x132F0000F, 0x132F8000F, 0x13300000F, 0x13308000F, 0x13310000F, 0x13318000F, 0x13320000F, 0x13328000F, 0x13330000F, 0x13338000F, 0x13340000F, 0x13348000F, 0x13350000F, 0x13358000F, 0x13360000F, 0x13368000F, 0x13370000F, 0x13378000F, 0x13380000F, 0x13388000F, 0x13390000F, 0x13398000F, 0x133A0000F, 0x133A8000F, 0x133B0000F, 0x133B8000F, 0x133C0000F, 0x133C8000F, 0x133D0000F, 0x133D8000F, 0x133E0000F, 0x133E8000F, 0x133F0000F, 0x133F8000F, 0x13400000F, 0x13408000F, 0x13410000F, 0x13418000F, 0x13420000F, 0x13428000F, 0x13430000F, 0x13438000F, 0x13440000F, 0x13448000F, 0x13450000F, 0x13458000F, 0x13460000F, 0x13468000F, 0x13470000F, 0x13478000F, 0x13480000F, 0x13488000F, 0x13490000F, 0x13498000F, 0x134A0000F, 0x134A8000F, 0x134B0000F, 0x134B8000F, 0x134C0000F, 0x134C8000F, 0x134D0000F, 0x134D8000F, 0x134E0000F, 0x134E8000F, 0x134F0000F, 0x134F8000F, 0x13500000F, 0x13508000F, 0x13510000F, 0x13518000F, 0x13520000F, 0x13528000F, 0x13530000F, 0x13538000F, 0x13540000F, 0x13548000F, 0x13550000F, 0x13558000F, 0x13560000F, 0x13568000F, 0x13570000F, 0x13578000F, 0x13580000F, 0x13588000F, 0x13590000F, 0x13598000F, 0x135A0000F, 0x135A8000F, 0x135B0000F, 0x135B8000F, 0x135C0000F, 0x135C8000F, 0x135D0000F, 0x135D8000F, 0x135E0000F, 0x135E8000F, 0x135F0000F, 0x135F8000F, 0x13600000F, 0x13608000F, 0x13610000F, 0x13618000F, 0x13620000F, 0x13628000F, 0x13630000F, 0x13638000F, 0x13640000F, 0x13648000F, 0x13650000F, 0x13658000F, 0x13660000F, 0x13668000F, 0x13670000F, 0x13678000F, 0x13680000F, 0x13688000F, 0x13690000F, 0x13698000F, 0x136A0000F, 0x136A8000F, 0x136B0000F, 0x136B8000F, 0x136C0000F, 0x136C8000F, 0x136D0000F, 0x136D8000F, 0x136E0000F, 0x136E8000F, 0x136F0000F, 0x136F8000F, 0x13700000F, 0x13708000F, 0x13710000F, 0x13718000F, 0x13720000F, 0x13728000F, 0x13730000F, 0x13738000F, 0x13740000F, 0x13748000F, 0x13750000F, 0x13758000F, 0x13760000F, 0x13768000F, 0x13770000F, 0x13778000F, 0x13780000F, 0x13788000F, 0x13790000F, 0x13798000F, 0x137A0000F, 0x137A8000F, 0x137B0000F, 0x137B8000F, 0x137C0000F, 0x137C8000F, 0x137D0000F, 0x137D8000F, 0x137E0000F, 0x137E8000F, 0x137F0000F, 0x137F8000F, 0x13800000F, 0x13808000F, 0x13810000F, 0x13818000F, 0x13820000F, 0x13828000F, 0x13830000F, 0x13838000F, 0x13840000F, 0x13848000F, 0x13850000F, 0x13858000F, 0x13860000F, 0x13868000F, 0x13870000F, 0x13878000F, 0x13880000F, 0x13888000F, 0x13890000F, 0x13898000F, 0x138A0000F, 0x138A8000F, 0x138B0000F, 0x138B8000F, 0x138C0000F, 0x138C8000F, 0x138D0000F, 0x138D8000F, 0x138E0000F, 0x138E8000F, 0x138F0000F, 0x138F8000F, 0x13900000F, 0x13908000F, 0x13910000F, 0x13918000F, 0x13920000F, 0x13928000F, 0x13930000F, 0x13938000F, 0x13940000F, 0x13948000F, 0x13950000F, 0x13958000F, 0x13960000F, 0x13968000F, 0x13970000F, 0x13978000F, 0x13980000F, 0x13988000F, 0x13990000F, 0x13998000F, 0x139A0000F, 0x139A8000F, 0x139B0000F, 0x139B8000F, 0x139C0000F, 0x139C8000F, 0x139D0000F, 0x139D8000F, 0x139E0000F, 0x139E8000F, 0x139F0000F, 0x139F8000F, 0x13A00000F, 0x13A08000F, 0x13A10000F, 0x13A18000F, 0x13A20000F, 0x13A28000F, 0x13A30000F, 0x13A38000F, 0x13A40000F, 0x13A48000F, 0x13A50000F, 0x13A58000F, 0x13A60000F, 0x13A68000F, 0x13A70000F, 0x13A78000F, 0x13A80000F, 0x13A88000F, 0x13A90000F, 0x13A98000F, 0x13AA0000F, 0x13AA8000F, 0x13AB0000F, 0x13AB8000F, 0x13AC0000F, 0x13AC8000F, 0x13AD0000F, 0x13AD8000F, 0x13AE0000F, 0x13AE8000F, 0x13AF0000F, 0x13AF8000F, 0x13B00000F, 0x13B08000F, 0x13B10000F, 0x13B18000F, 0x13B20000F, 0x13B28000F, 0x13B30000F, 0x13B38000F, 0x13B40000F, 0x13B48000F, 0x13B50000F, 0x13B58000F, 0x13B60000F, 0x13B68000F, 0x13B70000F, 0x13B78000F, 0x13B80000F, 0x13B88000F, 0x13B90000F, 0x13B98000F, 0x13BA0000F, 0x13BA8000F, 0x13BB0000F, 0x13BB8000F, 0x13BC0000F, 0x13BC8000F, 0x13BD0000F, 0x13BD8000F, 0x13BE0000F, 0x13BE8000F, 0x13BF0000F, 0x13BF8000F, 0x13C00000F, 0x13C08000F, 0x13C10000F, 0x13C18000F, 0x13C20000F, 0x13C28000F, 0x13C30000F, 0x13C38000F, 0x13C40000F, 0x13C48000F, 0x13C50000F, 0x13C58000F, 0x13C60000F, 0x13C68000F, 0x13C70000F, 0x13C78000F, 0x13C80000F, 0x13C88000F, 0x13C90000F, 0x13C98000F, 0x13CA0000F, 0x13CA8000F, 0x13CB0000F, 0x13CB8000F, 0x13CC0000F, 0x13CC8000F, 0x13CD0000F, 0x13CD8000F, 0x13CE0000F, 0x13CE8000F, 0x13CF0000F, 0x13CF8000F, 0x13D00000F, 0x13D08000F, 0x13D10000F, 0x13D18000F, 0x13D20000F, 0x13D28000F, 0x13D30000F, 0x13D38000F, 0x13D40000F, 0x13D48000F, 0x13D50000F, 0x13D58000F, 0x13D60000F, 0x13D68000F, 0x13D70000F, 0x13D78000F, 0x13D80000F, 0x13D88000F, 0x13D90000F, 0x13D98000F, 0x13DA00010, 0x13DB4F6B0, 0x13DC4F6F0, 0x13DD4F730, 0x13DE4F770, 0x13DF4F7B0, 0x13E04F7F0, 0x13E14F830, 0x13E24F870, 0x13E34F8B0, 0x13E44F8F0, 0x13E54F930, 0x13E64F970, 0x4F9B0, 0x13E7CF9D0, 0x13E8CFA10, 0x13E9CFA50, 0x13EACFA90, 0x13EBCFAD0, 0x13ECCFB10, 0x13EDCFB50, 0x13EECFB90, 0x13EFCFBD0, 0x13F0CFC10, 0x13F1CFC50, 0x13F2CFC90, 0x13F3CFCD0, 0x13F4CFD10, 0x13F5CFD50, 0x13F6CFD90, 0x13F7CFDD0, 0x13F8CFE10, 0x13F9CFE50, 0x13FACFE90, 0x13FBCFED0, 0x13FCCFF10, 0x13FDCFF50, 0x13FECFF90, 0x13FFCFFD0, 0x1400D0010, 0x1401D0050, 0x1402D0090, 0x1403D00D0, 0x1404D0110, 0x1405D0150, 0x1406D0190, 0x1407D01D0, 0x1408D0210, 0x1409D0250, 0x140AD0290, 0x140BD02D0, 0x140CD0310, 0x140DD0350, 0x140ED0390, 0x503D0, 0x140F80010, 0x1410D0410, 0x1414D03D0, 0x1415D0550, 0x141600010, 0x1417505B0, 0x1418505F0, 0x141080010, 0x141F507B0, 0x507D0, 0x1422D0890, 0x1423508B0, 0x508D0, 0x51250, 0x51270, 0x144AD1290, 0x144BD12D0, 0x144CD1310, 0x144DD1350, 0x144ED1390, 0x144FD13D0, 0x1450D1410, 0x1451D1450, 0x1452D1490, 0x1453D14D0, 0x1454D1510, 0x1455D1550, 0x1456D1590, 0x1457D15D0, 0x1458D1610, 0x1459D1650, 0x145AD1690, 0x145BD16D0, 0x145CD1710, 0x145D80010, 0x145E51770, 0x51790, 0x147851DF0, 0x147880010, 0x51E30, 0x147980010, 0x147AD1E90, 0x147BD1ED0, 0x147C51EF0, 0x147CD1F10, 0x147D51F30, 0x147E51F70, 0x147F51FB0, 0x148000010, 0x148152030, 0x148252070, 0x1483520B0, 0x1484520F0, 0x148552130, 0x148652170, 0x1487521B0, 0x1488521F0, 0x148952230, 0x148A52270, 0x148B522B0, 0x148C522F0, 0x148D52330, 0x148E52370, 0x148F523B0, 0x1490523F0, 0x149152430, 0x149252470, 0x1493524B0, 0x1494524F0, 0x149552530, 0x149652570, 0x1497525B0, 0x1498525F0, 0x149952630, 0x149A52670, 0x149B526B0, 0x149C526F0, 0x149D52730, 0x149E52770, 0x149F527B0, 0x14A0527F0, 0x14A152830, 0x14A252870, 0x14A3528B0, 0x14A4528F0, 0x14A480010, 0x52930, 0x14A5D2950, 0x14A6D2990, 0x14A7D29D0, 0x14A8D2A10, 0x14A9D2A50, 0x14AAD2A90, 0x14ABD2AD0, 0x14ACD2B10, 0x14AD00010, 0x14AE52B70, 0x14AE80010, 0x14AF00010, 0x14B052BF0, 0x14B152C30, 0x52BD0, 0x14B180010, 0x14B2D2C90, 0x14B3D2CD0, 0x52C70, 0x14B4D2D10, 0x14B5D2D50, 0x14B600010, 0x14B752DB0, 0x14B852DF0, 0x52D90, 0x14B880010, 0x14B9D2E50, 0x14BAD2E90, 0x52E30, 0x14BBD2ED0, 0x14BCD2F10, 0x14BDD2F50, 0x14BED2F90, 0x14BFD2FD0, 0x14C0D3010, 0x14C1D3050, 0x14C2D3090, 0x14C3D30D0, 0x14C4D3110, 0x14C5D3150, 0x14C6D3190, 0x14C7D31D0, 0x14C8D3210, 0x14C9D3250, 0x14CAD3290, 0x532D0, 0x532F0, 0x53310, 0x53330, 0x14CDD3350, 0x14CED3390, 0x14CFD33D0, 0x14D0D3410, 0x14D1D3450, 0x14D2D3490, 0x14D3D34D0, 0x14D4D3510, 0x14D5D3550, 0x14D6D3590, 0x14D7D35D0, 0x14D8D3610, 0x14D9D3650, 0x14DAD3690, 0x14DBD36D0, 0x14DCD3710, 0x14DDD3750, 0x14DED3790, 0x14F700010, 0x51FB0, 0x50890, 0x151DD4750, 0x54790, 0x151E80010, 0x151FD47D0, 0x1520D4810, 0x1521D4850, 0x1522D4890, 0x1523D48D0, 0x1524D4910, 0x1525D4950, 0x1526D4990, 0x1527D49D0, 0x1528D4A10, 0x1529D4A50, 0x152AD4A90, 0x152BD4AD0, 0x152CD4B10, 0x152DD4B50, 0x152ED4B90, 0x152FD4BD0, 0x1530D4C10, 0x1531D4C50, 0x1532D4C90, 0x1533D4CD0, 0x1534D4D10, 0x1535D4D50, 0x1536D4D90, 0x153700010, 0x153854DF0, 0x153954E30, 0x153A54E70, 0x153B54EB0, 0x153C54EF0, 0x153D54F30, 0x153E54F70, 0x153F54FB0, 0x154054FF0, 0x154155030, 0x154255070, 0x1543550B0, 0x1544550F0, 0x154555130, 0x154655170, 0x1547551B0, 0x1548551F0, 0x154955230, 0x55270, 0x1562D5890, 0x1563558B0, 0x1563D58D0, 0x1564558F0, 0x1564D5910, 0x156555930, 0x1565D5950, 0x156255970, 0x157CD5F10, 0x157DD5F50, 0x157ED5F90, 0x157FD5FD0, 0x1580D6010, 0x1581D6050, 0x1582D6090, 0x1583D60D0, 0x1584D6110, 0x1585D6150, 0x1586D6190, 0x1587D61D0, 0x1588D6210, 0x1589D6250, 0x158AD6290, 0x158BD62D0, 0x158CD6310, 0x158DD6350, 0x158ED6390, 0x158FD63D0, 0x1590D6410, 0x1591D6450, 0x1592D6490, 0x1593D64D0, 0x1594D6510, 0x56550, 0x1596D6590, 0x565B0, 0x159700010, 0x1596565F0, 0x56790, 0x159ED6790, 0x159FD67D0, 0x15A0D6810, 0x15A152BB0, 0x15A256870, 0x15A3568B0, 0x568F0, 0x15A4D6910, 0x15A5D6950, 0x15A6D6990, 0x15A7D69D0, 0x159756A10, 0x15A956A30, 0x15AA56A70, 0x15AB56AB0, 0x56AF0, 0x15ACD6B10, 0x15ADD6B50, 0x159F567B0, 0x159F80010, 0x15AC00010, 0x15AD56B30, 0x15AD80010, 0x565F0, 0x141580010, 0x50530, 0x15AF80010, 0x15B000010, 0x15B156C30, 0x15B256C70, 0x50550, 0x141056CB0, 0x15B300010, 0x51F90, 0x56CF0, 0x15B400010, 0x51EB0, 0x56D30, 0x141680010, 0x141651FD0, 0x15B5D6D50, 0x141800010, 0x507B0, 0x56D90, 0x15B6D05D0, 0x141780010, 0x56DD0, 0x56DF0, 0x15B8D6E10, 0x15B900010, 0x1479D6E70, 0x147A51ED0, 0x15B1D6C10, 0x15BD56F30, 0x1477D6F50, 0x147D51E10, 0x15BE56F70, 0x147DD6F90, 0x15C300010, 0x15CE57370, 0x573D0, 0x15D4D7510, 0x15D557530, 0x15D5D7550, 0x15D657570, 0x15D6D7590, 0x15D7575B0, 0x15D7D75D0, 0x15D8575F0, 0x15D8D7610, 0x15D9D7650, 0x57370, 0x15DB56BF0, 0x15DBD76D0, 0x15B0D76F0, 0x15DC56C50, 0x15B257710, 0x15DD56CB0, 0x15B357750, 0x15C356CF0, 0x15B4D6D10, 0x15BD80010, 0x15B556D70, 0x15B657390, 0x15DFD6DB0, 0x15B7577F0, 0x15D456DF0, 0x15E000010, 0x15B857810, 0x15E0D6E30, 0x15B957830, 0x15BCD6E70, 0x15E200010, 0x15E2D7890, 0x15E3578B0, 0x15E3D78D0, 0x15EF80010, 0x15F057BF0, 0x15F0D7C10, 0x15F157C30, 0x15F1D7C50, 0x15F257C70, 0x15F2D7C90, 0x15F357CB0, 0x57CD0, 0x15F500010, 0x1601D78F0, 0x1602D8090, 0x1603D80D0, 0x1604D8110, 0x160500010, 0x160658170, 0x1607581B0, 0x1608581F0, 0x160958230, 0x160A58270, 0x160B582B0, 0x160C582F0, 0x160D58330, 0x160DD2B70, 0x160ED8390, 0x160FD83D0, 0x1601D3DD0, 0x161000010, 0x161158430, 0x161258470, 0x1613584B0, 0x1614584F0, 0x161558530, 0x161658570, 0x1617585B0, 0x1617D2B90, 0x161857D50, 0x161958630, 0x161A58670, 0x161B586B0, 0x586F0, 0x161CD8711, 0x161DD8751, 0x161ED8791, 0x161FD87D1, 0x1620D8811, 0x1621D8851, 0x1622D8891, 0x1623D88D1, 0x1624D8911, 0x1625D8951, 0x1626D8991, 0x1627D89D1, 0x1628D8A11, 0x1629D8A51, 0x162AD8A91, 0x162BD8AD1, 0x162CD8B11, 0x162DD8B51, 0x162ED8B91, 0x162FD8BD1, 0x1630D8C11, 0x1631D8C51, 0x1632D8C91, 0x1633D8CD1, 0x1634D8D11, 0x1635D8D51, 0x1636D8D91, 0x58DD1, 0x163858DF1, 0x50451, 0x141250471, 0x1413504B1, 0x1414504F1, 0x163958E31, 0x163A58E71, 0x1418D8EB1, 0x1419D0651, 0x141AD0691, 0x141BD06D1, 0x141CD0711, 0x163B50751, 0x141E50771, 0x163B80011, 0x58F11, 0x1420507F1, 0x142150831, 0x163CD0871, 0x163DD8F51, 0x1424508F1, 0x142550931, 0x142650971, 0x1427509B1, 0x1428509F1, 0x142950A31, 0x142A50A71, 0x142B50AB1, 0x142C50AF1, 0x142D50B31, 0x142E50B71, 0x142F50BB1, 0x143050BF1, 0x143150C31, 0x143250C71, 0x50CB1, 0x1433D0CD1, 0x1434D0D11, 0x1435D0D51, 0x50D91, 0x143750DB1, 0x143850DF1, 0x143950E31, 0x143A50E71, 0x143B50EB1, 0x143C50EF1, 0x143D50F31, 0x143D80011, 0x143ED0F91, 0x143FD0FD1, 0x1440D1011, 0x1441D1051, 0x1442D1091, 0x1443D10D1, 0x1444D1111, 0x1445D1151, 0x1446D1191, 0x1447D11D1, 0x1448D1211, 0x163E00011, 0x163F58FB1, 0x164058FF1, 0x164159031, 0x164259071, 0x1643590B1, 0x1644590F1, 0x164559131, 0x164659171, 0x1647591B1, 0x1648591F1, 0x51751, 0x164959231, 0x59271, 0x145F517B1, 0x1460517F1, 0x146151831, 0x146251871, 0x1463518B1, 0x1464518F1, 0x146551931, 0x146651971, 0x1467519B1, 0x1468519F1, 0x146951A31, 0x146A51A71, 0x146B51AB1, 0x146C51AF1, 0x146D51B31, 0x146E51B71, 0x146F51BB1, 0x147051BF1, 0x147151C31, 0x147251C71, 0x147351CB1, 0x147451CF1, 0x147551D31, 0x147651D71, 0x147751DB1, 0x59291, 0x164B592B1, 0x164BD1E51, 0x164CD9311, 0x164DD9351, 0x164ED9391, 0x147FD93D1, 0x1650593F1, 0x165159431, 0x165259471, 0x1653594B1, 0x1654594F1, 0x165559531, 0x165659571, 0x1657595B1, 0x1658595F1, 0x165959631, 0x165A59671, 0x165B596B1, 0x165B80011, 0x165CD9711, 0x165DD9751, 0x165ED9791, 0x165FD97D1, 0x1660D9811, 0x1661D9851, 0x165C596F1, 0x165D59731, 0x165E59771, 0x165F597B1, 0x1660597F1, 0x166159831, 0x59871, 0x166200011, 0x598B1, 0x1663D98D1, 0x1664D9911, 0x1665D9951, 0x1666D9991, 0x599D1, 0x599F1, 0x59A11, 0x166880011, 0x1669D9A51, 0x59A91, 0x166A80011, 0x166BD9AD1, 0x166C00011, 0x166B80011, 0x166D59B31, 0x166D00011, 0x166D80011, 0x166ED9B91, 0x59BD1, 0x166F80011, 0x1670D9C11, 0x1670D9C51, 0x167259C71, 0x167359CB1, 0x167459CF1, 0x167559D31, 0x167659D71, 0x167759DB1, 0x166900011, 0x1669D9AD1, 0x166E59B31, 0x167059BB1, 0x167859DF1, 0x167959E31, 0x167A59E71, 0x167B59EB1, 0x167B80011, 0x167CD9F11, 0x167DD9F51, 0x167ED9F91, 0x167FD9FD1, 0x1680DA011, 0x168100011, 0x16825A071, 0x16835A0B1, 0x16845A0F1, 0x14DFD37D1, 0x14E0D3811, 0x14E1D3851, 0x14E2D3891, 0x14E3D38D1, 0x14E4D3911, 0x14E5D3951, 0x14E6D3991, 0x14E7D39D1, 0x14E8D3A11, 0x14E9D3A51, 0x14EAD3A91, 0x14EBD3AD1, 0x14ECD3B11, 0x14EDD3B51, 0x14EED3B91, 0x14EFD3BD1, 0x14F0D3C11, 0x14F1D3C51, 0x14F2D3C91, 0x14F3D3CD1, 0x14F4D3D11, 0x14F5D3D51, 0x14F6D3D91, 0x5A131, 0x14F780011, 0x14F8D3E11, 0x14F9D3E51, 0x14FAD3E91, 0x14FBD3ED1, 0x14FCD3F11, 0x14FDD3F51, 0x14FED3F91, 0x14FFD3FD1, 0x1500D4011, 0x1501D4051, 0x1502D4091, 0x1503D40D1, 0x1504D4111, 0x1505D4151, 0x1506D4191, 0x1507D41D1, 0x1508D4211, 0x1509D4251, 0x150AD4291, 0x150BD42D1, 0x150CD4311, 0x150DD4351, 0x150ED4391, 0x150FD43D1, 0x1510D4411, 0x1511D4451, 0x1512D4491, 0x1513D44D1, 0x1514D4511, 0x1515D4551, 0x1516D4591, 0x1517D45D1, 0x1518D4611, 0x1519D4651, 0x151AD4691, 0x151BD46D1, 0x151CD4711, 0x58DF1, 0x168500011, 0x168580011, 0x1686DA191, 0x1687DA1D1, 0x1688DA211, 0x1689DA251, 0x168ADA291, 0x168BDA2D1, 0x168CDA311, 0x168DDA351, 0x168EDA391, 0x168FDA3D1, 0x1690DA411, 0x1691DA451, 0x169200011, 0x16935A4B1, 0x16945A4F1, 0x16955A531, 0x16965A571, 0x16975A5B1, 0x16985A5F1, 0x16995A631, 0x169A5A671, 0x169B5A6B1, 0x169C5A6F1, 0x169D5A731, 0x154AD5291, 0x154BD52D1, 0x154CD5311, 0x154DD5351, 0x154ED5391, 0x154FD53D1, 0x1550D5411, 0x1551D5451, 0x1552D5491, 0x1553D54D1, 0x1554D5511, 0x1555D5551, 0x1556D5591, 0x1557D55D1, 0x1558D5611, 0x1559D5651, 0x155AD5691, 0x155BD56D1, 0x155CD5711, 0x155DD5751, 0x155ED5791, 0x155FD57D1, 0x1560D5811, 0x1561D5851, 0x169E5A771, 0x169F5A7B1, 0x16A05A7F1, 0x16A15A831, 0x1566D5991, 0x1567D59D1, 0x1568D5A11, 0x1569D5A51, 0x156AD5A91, 0x156BD5AD1, 0x156CD5B11, 0x156DD5B51, 0x156ED5B91, 0x156FD5BD1, 0x1570D5C11, 0x1571D5C51, 0x1572D5C91, 0x55CD1, 0x157380011, 0x1574D5D11, 0x1575D5D51, 0x1576D5D91, 0x1577D5DD1, 0x1578D5E11, 0x1579D5E51, 0x157AD5E91, 0x157BD5ED1, 0x16A25A871, 0x16A35A8B1, 0x16A45A8F1, 0x16A55A931, 0x16A65A971, 0x16A75A9B1, 0x16A85A9F1, 0x16A95AA31, 0x16AA5AA71, 0x16AB5AAB1, 0x16AC5AAF1, 0x16AD5AB31, 0x16AE5AB71, 0x16AED6571, 0x16AFDABD1, 0x5AC11, 0x1598D6611, 0x1599D6651, 0x159AD6691, 0x159BD66D1, 0x159CD6711, 0x159DD6751, 0x5AC31, 0x16B1DAC51, 0x16B2DAC91, 0x16B3DACD1, 0x16B4DAD11, 0x16B5DAD51, 0x16B6DAD91, 0x16B7DADD1, 0x16B8DAE11, 0x16B9DAE51, 0x16BADAE91, 0x16BBDAED1, 0x5AF11, 0x16ADDAF31, 0x5AB91, 0x56B91, 0x15AF56BB1, 0x16BDDAF51, 0x5AF91, 0x16BE80011, 0x16BFDAFD1, 0x5B011, 0x16C15B031, 0x16C180011, 0x16C200011, 0x16C35B0B1, 0x16C45B0F1, 0x16C55B131, 0x16C65B171, 0x16C75B1B1, 0x16C780011, 0x16C8DB211, 0x16C9DB251, 0x16CADB291, 0x15BAD6E91, 0x15BBD6ED1, 0x16CB56F11, 0x16CC5B2F1, 0x16CD5B331, 0x5B371, 0x15BF56FB1, 0x15C056FF1, 0x15C157031, 0x15C257071, 0x16CE570B1, 0x15C4570F1, 0x15C557131, 0x15C657171, 0x15C7571B1, 0x15C8571F1, 0x15C957231, 0x15CA57271, 0x15CB572B1, 0x15CC572F1, 0x15CD57331, 0x15CEDB3B1, 0x16CF573D1, 0x15D0573F1, 0x15D157431, 0x15D257471, 0x15D3574B1, 0x16CFD74F1, 0x16D0DB411, 0x16D1DB451, 0x16D2DB491, 0x16D3DB4D1, 0x15D957631, 0x15D9DB511, 0x15DA5B531, 0x15DA80011, 0x16D5DB551, 0x16D6DB591, 0x15DCDB5D1, 0x16D780011, 0x15DDDB611, 0x15DED7791, 0x16D95B631, 0x15DF5B671, 0x16DADB691, 0x16DBDB6D1, 0x16DCDB711, 0x16DDDB751, 0x15E15B791, 0x16DED7871, 0x16DFDB7D1, 0x16E0DB811, 0x15E4D7911, 0x15E5D7951, 0x15E6D7991, 0x15E7D79D1, 0x15E8D7A11, 0x15E9D7A51, 0x15EAD7A91, 0x15EBD7AD1, 0x15ECD7B11, 0x15EDD7B51, 0x15EED7B91, 0x16E157BD1, 0x16E25B871, 0x16E35B8B1, 0x16E45B8F1, 0x16E55B931, 0x15F457CF1, 0x16E5D7D31, 0x15F657D71, 0x15F757DB1, 0x15F857DF1, 0x15F957E31, 0x15FA57E71, 0x15FB57EB1, 0x15FC57EF1, 0x15FD57F31, 0x15FE57F71, 0x15FF57FB1, 0x160057FF1, 0x160158031, 0x16E6DB991, 0x16E7DB9D1, 0x16E8DBA11, 0x16E9DBA51, 0x16EADBA91, 0x16EBDBAD1, 0x16ECDBB11, 0x16EDDBB51, 0x16E6DBB91, 0x16EF5BBB1, 0x16F05BBF1, 0x16F15BC31, 0x16F25BC71, 0x16F35BCB1, 0x16F45BCF1, 0x16F55BD31, 0x16F580012, 0x16F6DBD92, 0x16F7DBDD2, 0x16F8DBE12, 0x16F9DBE52, 0x16FADBE92, 0x16FBDBED2, 0x16FCDBF12, 0x16FDDBF52, 0x16FEDBF92, 0x16FFDBFD2, 0x1700DC012, 0x1701DC052, 0x1702DC092, 0x170300012, 0x17045C0F2, 0x17055C132, 0x17065C172, 0x17075C1B2, 0x17085C1F2, 0x17095C232, 0x170A5C272, 0x170B5C2B2, 0x170C5C2F2, 0x170D5C332, 0x170E5C372, 0x170F5C3B2, 0x17105C3F2, 0x17115C432, 0x17125C472, 0x17135C4B2, 0x17145C4F2, 0x17155C532, 0x17165C572, 0x17175C5B2, 0x171780012, 0x1718DC612, 0x1719DC652, 0x171ADC692, 0x171BDC6D2, 0x171CDC712, 0x171DDC752, 0x171EDC792, 0x171FDC7D2, 0x1720DC812, 0x5C852, 0x17225C872, 0x17235C8B2, 0x17245C8F2, 0x17255C932, 0x17265C972, 0x172680012, 0x1727DC9D2, 0x172800012, 0x17295CA32, 0x172A5CA72, 0x172B5CAB2, 0x172C5CAF2, 0x172D5CB32, 0x172E5CB72, 0x172F5CBB2, 0x17305CBF2, 0x17315CC32, 0x17325CC72, 0x17335CCB2, 0x17345CCF2, 0x5CD32, 0x1735DCD52, 0x1736DCD92, 0x1737DCDD2, 0x1738DCE12, 0x1739DCE52, 0x173ADCE92, 0x173BDCED2, 0x173CDCF12, 0x173DDCF52, 0x173E00012, 0x173F5CFB2, 0x17405CFF2, 0x17415D032, 0x17425D072, 0x17435D0B2, 0x17445D0F2, 0x5D132, 0x1745DD152, 0x1746DD192, 0x1747DD1D2, 0x5D212, 0x174800012, 0x174880012, 0x5D252, 0x174A5D272, 0x174A80012, 0x174BDD2D2, 0x174CDD312, 0x174D00012, 0x174D80012, 0x174EDD392, 0x174F00012, 0x17505D3F2, 0x175080012, 0x1751DD452, 0x1752DD492, 0x1753DD4D2, 0x1754DD512, 0x1755DD552, 0x1756DD592, 0x1757DD5D2, 0x1758DD612, 0x1759DD652, 0x175ADD692, 0x175BDD6D2, 0x175CDD712, 0x175DDD752, 0x175EDD792, 0x175FDD7D2, 0x1760DD812, 0x1761DD852, 0x1762DD892, 0x1763DD8D2, 0x1764DD912, 0x1765DD952, 0x1766DD992, 0x1767DD9D2, 0x1768DDA12, 0x5DA52, 0x176A5DA72, 0x176B5DAB2, 0x176C5DAF2, 0x176D5DB32, 0x176E5DB72, 0x176F5DBB2, 0x17705DBF2, 0x17715DC32, 0x17725DC72, 0x17735DCB2, 0x17745DCF2, 0x17755DD32, 0x17765DD72, 0x17775DDB2, 0x17785DDF2, 0x17795DE32, 0x177A5DE72, 0x177B5DEB2, 0x177C5DEF2, 0x5DF32, 0x177DDDF52, 0x177EDDF92, 0x177FDDFD2, 0x1780DE012, 0x1781DE052, 0x1782DE092, 0x1783DE0D2, 0x1784DE112, 0x1785DE152, 0x1786DE192, 0x1787DE1D2, 0x1788DE212, 0x1789DE252, 0x178ADE292, 0x178BDE2D2, 0x178CDE312, 0x178DDE352, 0x178EDE392, 0x178FDE3D2, 0x1790DE412, 0x1791DE452, 0x1792DE492, 0x1793DE4D2, 0x1794DE512, 0x1795DE552, 0x1796DE592, 0x1797DE5D2, 0x1798DE612, 0x1799DE652, 0x179ADE692, 0x179BDE6D2, 0x179CDE712, 0x179DDE752, 0x179EDE792, 0x179F00012, 0x17A05E7F2, 0x17A15E832, 0x17A25E872, 0x17A35E8B2, 0x17A45E8F2, 0x17A55E932, 0x17A65E972, 0x17A75E9B2, 0x17A85E9F2, 0x17A95EA32, 0x17AA5EA72, 0x17AB5EAB2, 0x17AC5EAF2, 0x17AD5EB32, 0x17AE5EB72, 0x5EBB2, 0x17AFDEBD2, 0x17B0DEC12, 0x17B1DEC52, 0x17B2DEC92, 0x17AFDECD2, 0x17B45ECF2, 0x5ED32, 0x17B5DED52, 0x17B6DED92, 0x5EDD2, 0x17B780012, 0x17B8DEE12, 0x17B9DEE52, 0x5EE92, 0x17BB5EEB2, 0x17BC5EEF2, 0x17BD5EF32, 0x17BE5EF72, 0x17BF5EFB2, 0x17C05EFF2, 0x17C15F032, 0x17C25F072, 0x17C280012, 0x17C3DF0D2, 0x17C4DF112, 0x17C5DF152, 0x17C6DF192, 0x17C7DF1D2, 0x17C8DF212, 0x17C9DF252, 0x17CADF292, 0x17CBDF2D2, 0x17CCDF312, 0x17CDDF352, 0x17CEDF392, 0x17CFDF3D2, 0x5F412, 0x17D15F432, 0x17D25F472, 0x17D35F4B2, 0x17D45F4F2, 0x17D55F532, 0x17D65F572, 0x17D75F5B2, 0x17D85F5F2, 0x17D95F632, 0x17DA5F672, 0x17DB5F6B2, 0x17DC5F6F2, 0x17DD5F732, 0x17DE5F772, 0x17DF5F7B2, 0x17E05F7F2, 0x17E15F832, 0x17E25F872, 0x17E35F8B2, 0x17E45F8F2, 0x17E55F932, 0x17E65F972, 0x17E75F9B2, 0x17E85F9F2, 0x17E95FA32, 0x17EA5FA72, 0x17EB5FAB2, 0x17EC5FAF2, 0x17E95FB32, 0x17ED00012, 0x17EE5FB72, 0x17EF5FBB2, 0x17F05FBF2, 0x17F15FC33, 0x17F25FC73, 0x17F35FCB3, 0x17F45FCF3, 0x17F55FD33, 0x17F65FD73, 0x17F75FDB3, 0x17F780013, 0x17F800013, 0x17F95FE33, 0x17FA5FE73, 0x17FB5FEB3, 0x17FC5FEF3, 0x5FF33, 0x17FDDFF53, 0x17FEDFF93, 0x17FFDFFD3, 0x1800E0013, 0x1801E0053, 0x1802E0093, 0x1803E00D3, 0x1804E0113, 0x1805E0153, 0x1806E0193, 0x1807E01D3, 0x1808E0213, 0x1809E0253, 0x180A00013, 0x180B602B3, 0x180C602F3, 0x180D60333, 0x180E60373, 0x180F603B3, 0x1810603F3, 0x181160433, 0x181260473, 0x1813604B3, 0x1814604F3, 0x181560533, 0x181660573, 0x1817605B3, 0x1818605F3, 0x181960633, 0x181A60673, 0x181A80013, 0x181BE06D3, 0x60713, 0x181C80013, 0x181DE0753, 0x181EE0793, 0x181FE07D3, 0x1820E0813, 0x1821E0853, 0x1822E0893, 0x182560933, 0x1829E0A53, 0x182AE0A93, 0x182BE0AD3, 0x182CE0B13, 0x182DE0B53, 0x182EE0B93, 0x182FE0BD3, 0x1830E0C13, 0x1831E0C53, 0x1832E0C93, 0x1833E0CD3, 0x1834E0D13, 0x1835E0D53, 0x1836E0D93, 0x1837E0DD3, 0x1838E0E13, 0x60E53, 0x60E73, 0x183AE0E93, 0x183BE0ED3, 0x183CE0F13, 0x183D80013, 0x183EE0F93, 0x183FE0FD3, 0x1840E1013, 0x1841E1053, 0x1842E1093, 0x1843E10D3, 0x1844E1113, 0x1845E1153, 0x1846E1193, 0x1847E11D3, 0x1848E1213, 0x1849E1253, 0x184AE1293, 0x184BE12D3, 0x184CE1313, 0x184DE1353, 0x184EE1393, 0x184FE13D3, 0x1850E1413, 0x1851E1453, 0x1852E1493, 0x1853E14D3, 0x1854E1513, 0x1853E1553, 0x185661573, 0x1857615B3, 0x1858615F3, 0x185961633, 0x185A61673, 0x185B616B3, 0x185C616F3, 0x185D61733, 0x185E61773, 0x185F617B3, 0x1860617F3, 0x186161833, 0x186261873, 0x1863618B3, 0x1864618F3, 0x186561933, 0x186661973, 0x1867619B3, 0x1868619F3, 0x186961A33, 0x186A61A73, 0x186B61AB3, 0x186C61AF3, 0x186D61B33, 0x186E61B73, 0x186F61BB3, 0x187061BF3, 0x187161C33, 0x187261C73, 0x187361CB3, 0x187261CF3, 0x1874E1D13, 0x1875E1D53, 0x1876E1D94, 0x1877E1DD4, 0x1878E1E14, 0x61E54, 0x61E74, 0x187A00014, 0x187B61EB4, 0x187C61EF4, 0x187D61F34, 0x187E61F74, 0x187F61FB4, 0x188061FF4, 0x188080014, 0x1881E2054, 0x188200014, 0x1883620B4, 0x1884620F4, 0x188562134, 0x188662174, 0x1887621B4, 0x1888621F4, 0x188962234, 0x1888E2274, 0x1889E2254, 0x188A00014, 0x188B622B4, 0x622F4, 0x188C00014, 0x188D00014, 0x188E62374, 0x188F623B4, 0x1890623F4, 0x182362434, 0x1824608F4, 0x1825E2454, 0x1826E0994, 0x1827E09D4, 0x1828E0A14, 0x189262474, 0x1893624B4, 0x1894624F4, 0x189562534, 0x189662574, 0x1897625B4, 0x1898625F4, 0x189962634, 0x189980014, 0x62694, 0x189B626B4, 0x626F4, 0x187760F54, 0x187861DF4, 0x187961E34, 0x1882626F4, 0x189C00014, 0x189D62734, 0x189CE2714, 0x189DE2754, 0x189EE2794, 0x189FE27D4, 0x18A0E2814, 0x18A1E2854, 0x18A2E2894, 0x18A3E28D4, 0x18A4E2914, 0x18A4E2954, 0x18A462954, 0x18A662974, 0x18A7629B4, 0x18A8629F4, 0x18A8E29F4, 0x62A54, 0x18AA62A74, 0x18AB62AB4, 0x18AC62AF4, 0x18AD62B34, 0x18AE62B74, 0x18AF62BB4, 0x18B062BF4, 0x18B162C34, 0x18B262C74, 0x18B362CB4, 0x18B462CF4, 0x18B562D34, 0x18B662D74, 0x18B762DB4, 0x18B762DF4, 0x18B8E2E14, 0x18B900015, 0x62E55, 0x18BA62E75, 0x18BB62EB5, 0x18BB80015, 0x18BCE2F15, 0x18BDE2F55, 0x62F95, 0x18BE80015, 0x18BFE2FD5, 0x18C0E3015, 0x18C1E3055, 0x18C2E3095, 0x18C3E30D5, 0x18C4E3115, 0x18C5E3155, 0x63195, 0x18C680015, 0x18C762335, 0x631F5, 0x18C8E3215, 0x18C9E3255, 0x18CAE3295, 0x18CBE32D5, 0x18CCE3315, 0x18CDE3355, 0x18CEE3395, 0x18CFE33D5, 0x18D000015, 0x63435, 0x18D1E3455, 0x18D2E3495, 0x634D5, 0x18D3E3455, 0x63035, 0x18D400015, 0x18D563535, 0x18D663575, 0x18D7635B5, 0x18D8635F5, 0x18D963635, 0x18DA63675, 0x18DB636B5, 0x18DC636F5, 0x63735, 0x18DD00015, 0x18DE63775, 0x18DF637B5, 0x18E0637F5, 0x18E163835, 0x18E263875, 0x18E3638B5, 0x18E4638F5, 0x18E5E3956, 0x18E600016, 0x639B6, 0x18E7E39D6, 0x18E8E3A16, 0x18E900016, 0x63A76, 0x18EA00016, 0x18EB63AB6, 0x18EC63AF6, 0x18ED63B36, 0x18ED80016, 0x18EEE3B96, 0x18EFE3BD6, 0x18F0E3C16, 0x18F1E3C56, 0x18F2E3C96, 0x18F300016, 0x63CF6, 0x18F400016, 0x18F563D36, 0x18F663D76, 0x18F680016, 0x18F7E3DD6, 0x18F8E3E16, 0x18F9E3E56, 0x18FAE3E96, 0x63ED6, 0x18FB80016, 0x18FCE3F16, 0x18FDE3F56, 0x18FEE3F96, 0x63FD6, 0x63936, 0x18FF80017, 0x1900E4017, 0x1901E4057, 0x1902E4097, 0x190300017, 0x1904640F7, 0x64137, 0x1905E4157, 0x1906E4197, 0x1907E41D7, 0x1908E4217, 0x64257, 0x64277, 0x64297, 0x190B642B7, 0x190C642F7, 0x190D64337, 0x190E64377, 0x190F643B7, 0x1910643F7, 0x64438, 0x64458, 0x191264478, 0x1913644B8, 0x191380018, 0x64518, 0x191564538, 0x191664578, 0x645B8, 0x191700018, 0x1918645F8, 0x191964638, 0x191A64678, 0x646B9, 0x646D9, 0x646F9, 0x191C00019, 0x191C80019, 0x191D00019, 0x191E64779, 0x191F647B9, 0x191F80019, 0x1920E4819, 0x6485A, 0x19218001A, 0x6489A, 0x648BA, 0x1923E48DA, 0x6491A, 0x19248001A, 0x1925E495A, 0x6499B, 0x1927649BB, 0x1928649FB, 0x192964A3B, 0x19298001B, 0x64A9C, 0x192A8001C, 0x192B0001C, 0x192C64AFC, 0x64B3D, 0x64B5D, 0x192E64B7D, 0x192F64BBE, 0x192F8001E, 0x1930E4C1F, }; + public static readonly byte[] IgnoreCaseEnUsSerializedBDD = new byte[] { 0x5, 0x5, 0x0, 0x0, 0x0, 0x0, 0xE, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x41, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x18, 0x0, 0x0, 0x1, 0x0, 0x10, 0x0, 0x0, 0x61, 0x0, 0x0, 0x0, 0x0, 0x21, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x8, 0x0, 0x0, 0x41, 0x0, 0x18, 0x0, 0x0, 0x21, 0x0, 0x18, 0x0, 0x0, 0x41, 0x0, 0x8, 0x0, 0x0, 0x2, 0x0, 0x20, 0x0, 0x0, 0x2, 0x0, 0x28, 0x0, 0x0, 0x2, 0x0, 0x30, 0x0, 0x0, 0xE2, 0x0, 0x0, 0x0, 0x0, 0x82, 0x0, 0x0, 0x0, 0x0, 0xA2, 0x0, 0x0, 0x0, 0x0, 0xC2, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x38, 0x0, 0x0, 0x2, 0x0, 0x40, 0x0, 0x0, 0x2, 0x1, 0x0, 0x0, 0x0, 0x22, 0x1, 0x0, 0x0, 0x0, 0x2, 0x0, 0x48, 0x0, 0x0, 0xC2, 0x0, 0x38, 0x0, 0x0, 0x2, 0x0, 0x50, 0x0, 0x0, 0x42, 0x1, 0x0, 0x0, 0x0, 0x2, 0x0, 0x58, 0x0, 0x0, 0xC2, 0x0, 0x40, 0x0, 0x0, 0x82, 0x1, 0x0, 0x0, 0x0, 0xA3, 0x1, 0x0, 0x0, 0x0, 0xC3, 0x1, 0x0, 0x0, 0x0, 0xE3, 0x1, 0x0, 0x0, 0x0, 0x3, 0x0, 0x80, 0x0, 0x0, 0x3, 0x0, 0x88, 0x0, 0x0, 0x3, 0x0, 0x90, 0x0, 0x0, 0x3, 0x0, 0x98, 0x0, 0x0, 0x3, 0x0, 0xA0, 0x0, 0x0, 0x3, 0x0, 0x68, 0x0, 0x0, 0x3, 0x0, 0x70, 0x0, 0x0, 0x3, 0x0, 0x78, 0x0, 0x0, 0x3, 0x2, 0x0, 0x0, 0x0, 0x23, 0x2, 0x0, 0x0, 0x0, 0x43, 0x2, 0x0, 0x0, 0x0, 0x63, 0x2, 0x0, 0x0, 0x0, 0x83, 0x2, 0x0, 0x0, 0x0, 0x3, 0x0, 0xA8, 0x0, 0x0, 0xC3, 0x2, 0x0, 0x0, 0x0, 0xE3, 0x2, 0x0, 0x0, 0x0, 0xA3, 0x2, 0x0, 0x0, 0x0, 0x3, 0x3, 0x0, 0x0, 0x0, 0x3, 0x0, 0xB0, 0x0, 0x0, 0x3, 0x0, 0xB8, 0x0, 0x0, 0x3, 0x0, 0xC0, 0x0, 0x0, 0x23, 0x3, 0x0, 0x0, 0x0, 0x43, 0x3, 0x0, 0x0, 0x0, 0x63, 0x3, 0x0, 0x0, 0x0, 0x3, 0x0, 0xD8, 0x0, 0x0, 0xE3, 0x1, 0x80, 0x0, 0x0, 0x3, 0x0, 0xC8, 0x0, 0x0, 0x63, 0x2, 0xA0, 0x0, 0x0, 0x63, 0x2, 0x90, 0x0, 0x0, 0x3, 0x2, 0x78, 0x0, 0x0, 0x3, 0x0, 0xD0, 0x0, 0x0, 0xC3, 0x1, 0x68, 0x0, 0x0, 0x3, 0x0, 0xE0, 0x0, 0x0, 0xA3, 0x3, 0x0, 0x0, 0x0, 0x3, 0x3, 0x80, 0x0, 0x0, 0x3, 0x0, 0xF0, 0x0, 0x0, 0xE4, 0x3, 0x0, 0x0, 0x0, 0x4, 0x4, 0x0, 0x0, 0x0, 0x24, 0x4, 0x0, 0x0, 0x0, 0x44, 0x4, 0x0, 0x0, 0x0, 0x64, 0x4, 0x0, 0x0, 0x0, 0x84, 0x4, 0x0, 0x0, 0x0, 0xA4, 0x4, 0x0, 0x0, 0x0, 0xC4, 0x4, 0x0, 0x0, 0x0, 0xE4, 0x4, 0x0, 0x0, 0x0, 0x4, 0x5, 0x0, 0x0, 0x0, 0x24, 0x5, 0x0, 0x0, 0x0, 0x4, 0x0, 0x50, 0x1, 0x0, 0x4, 0x0, 0x58, 0x1, 0x0, 0x4, 0x0, 0x60, 0x1, 0x0, 0x4, 0x0, 0x68, 0x1, 0x0, 0x4, 0x0, 0x70, 0x1, 0x0, 0x4, 0x0, 0xF8, 0x0, 0x0, 0x4, 0x0, 0x0, 0x1, 0x0, 0x4, 0x0, 0x8, 0x1, 0x0, 0x4, 0x0, 0x10, 0x1, 0x0, 0x4, 0x0, 0x18, 0x1, 0x0, 0x4, 0x0, 0x20, 0x1, 0x0, 0x4, 0x0, 0x28, 0x1, 0x0, 0x4, 0x0, 0x30, 0x1, 0x0, 0x4, 0x0, 0x38, 0x1, 0x0, 0x4, 0x0, 0x40, 0x1, 0x0, 0x44, 0x5, 0x0, 0x0, 0x0, 0x64, 0x5, 0x0, 0x0, 0x0, 0x84, 0x5, 0x0, 0x0, 0x0, 0xA4, 0x5, 0x0, 0x0, 0x0, 0xC4, 0x5, 0x0, 0x0, 0x0, 0x4, 0x0, 0x48, 0x1, 0x0, 0x4, 0x0, 0x78, 0x1, 0x0, 0x4, 0x6, 0x0, 0x0, 0x0, 0x24, 0x6, 0x0, 0x0, 0x0, 0x44, 0x6, 0x0, 0x0, 0x0, 0x64, 0x6, 0x0, 0x0, 0x0, 0x84, 0x6, 0x0, 0x0, 0x0, 0xA4, 0x6, 0x0, 0x0, 0x0, 0x4, 0x0, 0x98, 0x1, 0x0, 0x4, 0x0, 0xA0, 0x1, 0x0, 0x4, 0x0, 0xA8, 0x1, 0x0, 0x4, 0x0, 0xB0, 0x1, 0x0, 0xE4, 0x5, 0x0, 0x0, 0x0, 0xC4, 0x6, 0x0, 0x0, 0x0, 0x4, 0x0, 0xB8, 0x1, 0x0, 0xE4, 0x6, 0x0, 0x0, 0x0, 0x4, 0x7, 0x0, 0x0, 0x0, 0x4, 0x0, 0x80, 0x1, 0x0, 0x4, 0x0, 0x88, 0x1, 0x0, 0x4, 0x0, 0x90, 0x1, 0x0, 0x4, 0x0, 0xC8, 0x1, 0x0, 0x44, 0x7, 0x0, 0x0, 0x0, 0x4, 0x0, 0xC0, 0x1, 0x0, 0x4, 0x0, 0xD8, 0x1, 0x0, 0x44, 0x5, 0x20, 0x1, 0x0, 0x64, 0x5, 0x28, 0x1, 0x0, 0x84, 0x5, 0x30, 0x1, 0x0, 0xA4, 0x5, 0x38, 0x1, 0x0, 0xC4, 0x5, 0x40, 0x1, 0x0, 0xE4, 0x3, 0x48, 0x1, 0x0, 0x4, 0x0, 0xE0, 0x1, 0x0, 0xA4, 0x7, 0x0, 0x0, 0x0, 0x4, 0x0, 0xF0, 0x1, 0x0, 0x4, 0x0, 0x70, 0x0, 0x0, 0x4, 0x0, 0x78, 0x0, 0x0, 0xC4, 0x1, 0x0, 0x0, 0x0, 0xE4, 0x1, 0x0, 0x0, 0x0, 0x4, 0x0, 0xE8, 0x1, 0x0, 0x4, 0x0, 0x80, 0x0, 0x0, 0x4, 0x0, 0x88, 0x0, 0x0, 0x4, 0x0, 0x90, 0x0, 0x0, 0x4, 0x0, 0x98, 0x0, 0x0, 0x4, 0x0, 0xA0, 0x0, 0x0, 0x4, 0x0, 0x68, 0x0, 0x0, 0x4, 0x2, 0x0, 0x0, 0x0, 0x24, 0x2, 0x0, 0x0, 0x0, 0x44, 0x2, 0x0, 0x0, 0x0, 0x64, 0x2, 0x0, 0x0, 0x0, 0x84, 0x2, 0x0, 0x0, 0x0, 0xA4, 0x1, 0x0, 0x0, 0x0, 0x4, 0x0, 0xF8, 0x1, 0x0, 0x4, 0x0, 0xD0, 0x1, 0x0, 0x4, 0x0, 0x0, 0x2, 0x0, 0x24, 0x8, 0x0, 0x0, 0x0, 0x64, 0x7, 0x0, 0x0, 0x0, 0x44, 0x4, 0x50, 0x1, 0x0, 0x44, 0x8, 0x0, 0x0, 0x0, 0x84, 0x7, 0x0, 0x0, 0x0, 0x4, 0x8, 0x0, 0x0, 0x0, 0x24, 0x5, 0x50, 0x1, 0x0, 0x4, 0x0, 0x18, 0x2, 0x0, 0x4, 0x0, 0x20, 0x2, 0x0, 0x4, 0x0, 0x28, 0x2, 0x0, 0x24, 0x7, 0x0, 0x0, 0x0, 0x5, 0x0, 0x30, 0x2, 0x0, 0xC5, 0x8, 0x0, 0x0, 0x0, 0x5, 0x0, 0x38, 0x2, 0x0, 0xE5, 0x8, 0x0, 0x0, 0x0, 0x5, 0x0, 0x40, 0x2, 0x0, 0x5, 0x9, 0x0, 0x0, 0x0, 0x5, 0x0, 0x48, 0x2, 0x0, 0x25, 0x9, 0x0, 0x0, 0x0, 0x5, 0x0, 0x50, 0x2, 0x0, 0x45, 0x9, 0x0, 0x0, 0x0, 0x5, 0x0, 0x58, 0x2, 0x0, 0x65, 0x9, 0x0, 0x0, 0x0, 0x5, 0x0, 0x60, 0x2, 0x0, 0x85, 0x9, 0x0, 0x0, 0x0, 0x5, 0x0, 0x68, 0x2, 0x0, 0xA5, 0x9, 0x0, 0x0, 0x0, 0x5, 0x0, 0x70, 0x2, 0x0, 0xC5, 0x9, 0x0, 0x0, 0x0, 0x5, 0x0, 0x78, 0x2, 0x0, 0xE5, 0x9, 0x0, 0x0, 0x0, 0x5, 0x0, 0x80, 0x2, 0x0, 0x5, 0xA, 0x0, 0x0, 0x0, 0x5, 0x0, 0x88, 0x2, 0x0, 0x25, 0xA, 0x0, 0x0, 0x0, 0x5, 0x0, 0x90, 0x2, 0x0, 0x45, 0xA, 0x0, 0x0, 0x0, 0x5, 0x0, 0x98, 0x2, 0x0, 0x65, 0xA, 0x0, 0x0, 0x0, 0x5, 0x0, 0xA0, 0x2, 0x0, 0x85, 0xA, 0x0, 0x0, 0x0, 0x5, 0x0, 0xA8, 0x2, 0x0, 0xA5, 0xA, 0x0, 0x0, 0x0, 0x5, 0x0, 0xB0, 0x2, 0x0, 0xC5, 0xA, 0x0, 0x0, 0x0, 0x5, 0x0, 0xB8, 0x2, 0x0, 0xE5, 0xA, 0x0, 0x0, 0x0, 0x5, 0x0, 0xC0, 0x2, 0x0, 0x5, 0xB, 0x0, 0x0, 0x0, 0x5, 0x0, 0xC8, 0x2, 0x0, 0x25, 0xB, 0x0, 0x0, 0x0, 0x5, 0x0, 0xD0, 0x2, 0x0, 0x45, 0xB, 0x0, 0x0, 0x0, 0x5, 0x0, 0xD8, 0x2, 0x0, 0x65, 0xB, 0x0, 0x0, 0x0, 0x5, 0x0, 0xE0, 0x2, 0x0, 0x85, 0xB, 0x0, 0x0, 0x0, 0x5, 0x0, 0xE8, 0x2, 0x0, 0xA5, 0xB, 0x0, 0x0, 0x0, 0x5, 0x0, 0xF0, 0x2, 0x0, 0xC5, 0xB, 0x0, 0x0, 0x0, 0x5, 0x0, 0xF8, 0x2, 0x0, 0xE5, 0xB, 0x0, 0x0, 0x0, 0x5, 0xC, 0x0, 0x0, 0x0, 0x25, 0xC, 0x0, 0x0, 0x0, 0x45, 0xC, 0x0, 0x0, 0x0, 0x65, 0xC, 0x0, 0x0, 0x0, 0x85, 0xC, 0x0, 0x0, 0x0, 0xA5, 0xC, 0x0, 0x0, 0x0, 0x5, 0x0, 0x0, 0x3, 0x0, 0x5, 0x0, 0x8, 0x3, 0x0, 0x5, 0x0, 0x10, 0x3, 0x0, 0x5, 0x0, 0x18, 0x3, 0x0, 0x5, 0x0, 0x20, 0x3, 0x0, 0x5, 0x0, 0x28, 0x3, 0x0, 0x5, 0x0, 0x30, 0x3, 0x0, 0xE5, 0xC, 0x0, 0x0, 0x0, 0x5, 0xD, 0x0, 0x0, 0x0, 0x25, 0xD, 0x0, 0x0, 0x0, 0x45, 0xD, 0x0, 0x0, 0x0, 0x65, 0xD, 0x0, 0x0, 0x0, 0x85, 0xD, 0x0, 0x0, 0x0, 0xA5, 0xD, 0x0, 0x0, 0x0, 0xC5, 0xD, 0x0, 0x0, 0x0, 0xE5, 0xD, 0x0, 0x0, 0x0, 0xC5, 0xC, 0x0, 0x0, 0x0, 0x5, 0xE, 0x0, 0x0, 0x0, 0x5, 0x0, 0x38, 0x3, 0x0, 0x5, 0x0, 0x40, 0x3, 0x0, 0x5, 0x0, 0x48, 0x3, 0x0, 0x5, 0x0, 0x50, 0x3, 0x0, 0x5, 0x0, 0x58, 0x3, 0x0, 0x5, 0x0, 0x88, 0x3, 0x0, 0x5, 0x0, 0x90, 0x3, 0x0, 0x5, 0x0, 0x98, 0x3, 0x0, 0x5, 0x0, 0x70, 0x3, 0x0, 0x5, 0x0, 0x78, 0x3, 0x0, 0x5, 0x0, 0x80, 0x3, 0x0, 0x85, 0xE, 0x0, 0x0, 0x0, 0xA5, 0xE, 0x0, 0x0, 0x0, 0xC5, 0xE, 0x0, 0x0, 0x0, 0xE5, 0xE, 0x0, 0x0, 0x0, 0x5, 0xF, 0x0, 0x0, 0x0, 0x5, 0x0, 0x60, 0x3, 0x0, 0x5, 0x0, 0xB0, 0x3, 0x0, 0x5, 0x0, 0xB8, 0x3, 0x0, 0x5, 0x0, 0xC0, 0x3, 0x0, 0x5, 0x0, 0x68, 0x3, 0x0, 0x25, 0xE, 0x0, 0x0, 0x0, 0x25, 0xF, 0x0, 0x0, 0x0, 0x65, 0xE, 0x0, 0x0, 0x0, 0x45, 0xE, 0x0, 0x0, 0x0, 0x45, 0xF, 0x0, 0x0, 0x0, 0x65, 0xF, 0x0, 0x0, 0x0, 0x85, 0xF, 0x0, 0x0, 0x0, 0x5, 0xC, 0x88, 0x2, 0x0, 0x25, 0xC, 0x90, 0x2, 0x0, 0x45, 0xC, 0x98, 0x2, 0x0, 0x65, 0xC, 0xA0, 0x2, 0x0, 0x85, 0xC, 0xA8, 0x2, 0x0, 0xC5, 0x8, 0xB0, 0x2, 0x0, 0xE5, 0x8, 0xB8, 0x2, 0x0, 0x5, 0x9, 0xC0, 0x2, 0x0, 0x25, 0x9, 0xC8, 0x2, 0x0, 0x45, 0x9, 0xD0, 0x2, 0x0, 0x65, 0x9, 0xD8, 0x2, 0x0, 0x85, 0x9, 0xE0, 0x2, 0x0, 0xA5, 0x9, 0xE8, 0x2, 0x0, 0xC5, 0x9, 0xF0, 0x2, 0x0, 0xE5, 0x9, 0xF8, 0x2, 0x0, 0x5, 0xA, 0x28, 0x3, 0x0, 0xE5, 0xA, 0x88, 0x2, 0x0, 0x5, 0xB, 0x90, 0x2, 0x0, 0x25, 0xB, 0x98, 0x2, 0x0, 0x45, 0xB, 0xA0, 0x2, 0x0, 0x65, 0xB, 0xA8, 0x2, 0x0, 0x85, 0xB, 0xB0, 0x2, 0x0, 0xA5, 0xB, 0xB8, 0x2, 0x0, 0xC5, 0xB, 0xC0, 0x2, 0x0, 0xE5, 0xB, 0xC8, 0x2, 0x0, 0xA5, 0xC, 0xD0, 0x2, 0x0, 0x5, 0x0, 0xE8, 0x3, 0x0, 0x5, 0x0, 0xF0, 0x3, 0x0, 0x5, 0x0, 0xF8, 0x3, 0x0, 0x5, 0x0, 0x0, 0x4, 0x0, 0x5, 0x0, 0x8, 0x4, 0x0, 0x5, 0x0, 0x10, 0x4, 0x0, 0x5, 0x0, 0x18, 0x4, 0x0, 0x45, 0x5, 0x0, 0x0, 0x0, 0x65, 0x5, 0x0, 0x0, 0x0, 0x85, 0x5, 0x0, 0x0, 0x0, 0xA5, 0x5, 0x0, 0x0, 0x0, 0xC5, 0x5, 0x0, 0x0, 0x0, 0xE5, 0x3, 0x0, 0x0, 0x0, 0x5, 0x4, 0x0, 0x0, 0x0, 0x25, 0x4, 0x0, 0x0, 0x0, 0x45, 0x4, 0x0, 0x0, 0x0, 0x65, 0x4, 0x0, 0x0, 0x0, 0x85, 0x4, 0x0, 0x0, 0x0, 0xA5, 0x4, 0x0, 0x0, 0x0, 0xC5, 0x4, 0x0, 0x0, 0x0, 0xE5, 0x4, 0x0, 0x0, 0x0, 0x5, 0x5, 0x0, 0x0, 0x0, 0x25, 0x5, 0x0, 0x0, 0x0, 0x85, 0x10, 0x0, 0x0, 0x0, 0xA5, 0x10, 0x0, 0x0, 0x0, 0xC5, 0x10, 0x0, 0x0, 0x0, 0xE5, 0x10, 0x0, 0x0, 0x0, 0x5, 0x0, 0x40, 0x4, 0x0, 0x5, 0x0, 0x48, 0x4, 0x0, 0x5, 0x0, 0x50, 0x4, 0x0, 0x5, 0x11, 0x0, 0x0, 0x0, 0x25, 0x11, 0x0, 0x0, 0x0, 0x65, 0x11, 0x0, 0x0, 0x0, 0x85, 0x11, 0x0, 0x0, 0x0, 0xA5, 0x11, 0x0, 0x0, 0x0, 0xC5, 0x11, 0x0, 0x0, 0x0, 0xE5, 0x11, 0x0, 0x0, 0x0, 0x5, 0x12, 0x0, 0x0, 0x0, 0x5, 0x0, 0x88, 0x4, 0x0, 0x5, 0x0, 0x90, 0x4, 0x0, 0x5, 0x0, 0x98, 0x4, 0x0, 0x5, 0x0, 0xA0, 0x4, 0x0, 0x5, 0x0, 0xA8, 0x4, 0x0, 0x5, 0x0, 0xB0, 0x4, 0x0, 0x5, 0x0, 0x58, 0x4, 0x0, 0x5, 0x0, 0x60, 0x4, 0x0, 0x5, 0x0, 0x68, 0x4, 0x0, 0x5, 0x0, 0x70, 0x4, 0x0, 0x5, 0x0, 0x78, 0x4, 0x0, 0x5, 0x0, 0x80, 0x4, 0x0, 0x5, 0x0, 0x30, 0x4, 0x0, 0x5, 0x0, 0x38, 0x4, 0x0, 0x25, 0x12, 0x0, 0x0, 0x0, 0x45, 0x12, 0x0, 0x0, 0x0, 0x65, 0x12, 0x0, 0x0, 0x0, 0x85, 0x12, 0x0, 0x0, 0x0, 0xA5, 0x12, 0x0, 0x0, 0x0, 0xC5, 0x12, 0x0, 0x0, 0x0, 0x5, 0x0, 0xB8, 0x4, 0x0, 0x5, 0x0, 0xC8, 0x3, 0x0, 0x5, 0x0, 0xD8, 0x3, 0x0, 0x5, 0x0, 0xE0, 0x3, 0x0, 0x5, 0x0, 0xC0, 0x4, 0x0, 0x5, 0x0, 0xC8, 0x4, 0x0, 0x45, 0x13, 0x0, 0x0, 0x0, 0x65, 0x13, 0x0, 0x0, 0x0, 0x5, 0x0, 0xE0, 0x4, 0x0, 0x25, 0xA, 0xB0, 0x2, 0x0, 0x45, 0xA, 0xB8, 0x2, 0x0, 0x65, 0xA, 0xC0, 0x2, 0x0, 0x85, 0xA, 0xD0, 0x2, 0x0, 0xA5, 0x13, 0x0, 0x0, 0x0, 0x5, 0x0, 0xA0, 0x3, 0x0, 0x5, 0x0, 0xA8, 0x3, 0x0, 0x5, 0x0, 0xD8, 0x4, 0x0, 0x5, 0x0, 0xD0, 0x3, 0x0, 0x5, 0x0, 0xF0, 0x4, 0x0, 0x5, 0x0, 0xF8, 0x4, 0x0, 0x5, 0x0, 0x0, 0x5, 0x0, 0x5, 0x0, 0x8, 0x5, 0x0, 0x5, 0x0, 0x10, 0x5, 0x0, 0x5, 0x0, 0x18, 0x5, 0x0, 0xC5, 0x13, 0x0, 0x0, 0x0, 0x5, 0x14, 0x0, 0x0, 0x0, 0x85, 0x14, 0x0, 0x0, 0x0, 0xA6, 0x14, 0x30, 0x5, 0x0, 0xE6, 0x14, 0x40, 0x5, 0x0, 0x26, 0x15, 0x50, 0x5, 0x0, 0x66, 0x15, 0x60, 0x5, 0x0, 0xA6, 0x15, 0x70, 0x5, 0x0, 0xE6, 0x15, 0x80, 0x5, 0x0, 0x26, 0x16, 0x90, 0x5, 0x0, 0x66, 0x16, 0xA0, 0x5, 0x0, 0xA6, 0x16, 0xB0, 0x5, 0x0, 0xE6, 0x16, 0xC0, 0x5, 0x0, 0x26, 0x17, 0xD0, 0x5, 0x0, 0x66, 0x17, 0xE0, 0x5, 0x0, 0xA6, 0x17, 0xF0, 0x5, 0x0, 0xE6, 0x17, 0x0, 0x6, 0x0, 0x26, 0x18, 0x10, 0x6, 0x0, 0x66, 0x18, 0x20, 0x6, 0x0, 0xA6, 0x18, 0x30, 0x6, 0x0, 0xE6, 0x18, 0x40, 0x6, 0x0, 0x26, 0x19, 0x50, 0x6, 0x0, 0x66, 0x19, 0x60, 0x6, 0x0, 0xA6, 0x19, 0x70, 0x6, 0x0, 0xE6, 0x19, 0x80, 0x6, 0x0, 0x26, 0x1A, 0x90, 0x6, 0x0, 0x66, 0x1A, 0xA0, 0x6, 0x0, 0xA6, 0x1A, 0xB0, 0x6, 0x0, 0xE6, 0x1A, 0xC0, 0x6, 0x0, 0x6, 0x0, 0xC8, 0x6, 0x0, 0x86, 0x17, 0x0, 0x0, 0x0, 0x6, 0x0, 0xD0, 0x6, 0x0, 0xC6, 0x17, 0x0, 0x0, 0x0, 0x6, 0x0, 0xD8, 0x6, 0x0, 0x6, 0x18, 0x0, 0x0, 0x0, 0x6, 0x0, 0xE0, 0x6, 0x0, 0x46, 0x18, 0x0, 0x0, 0x0, 0x6, 0x0, 0xE8, 0x6, 0x0, 0x86, 0x18, 0x0, 0x0, 0x0, 0x6, 0x0, 0x30, 0x5, 0x0, 0xC6, 0x18, 0x0, 0x0, 0x0, 0x6, 0x0, 0x40, 0x5, 0x0, 0x6, 0x19, 0x0, 0x0, 0x0, 0x6, 0x0, 0x50, 0x5, 0x0, 0x46, 0x19, 0x0, 0x0, 0x0, 0x6, 0x0, 0x60, 0x5, 0x0, 0x86, 0x19, 0x0, 0x0, 0x0, 0x6, 0x0, 0x70, 0x5, 0x0, 0xC6, 0x19, 0x0, 0x0, 0x0, 0x6, 0x0, 0x80, 0x5, 0x0, 0x6, 0x1A, 0x0, 0x0, 0x0, 0x6, 0x0, 0x90, 0x5, 0x0, 0x46, 0x1A, 0x0, 0x0, 0x0, 0x6, 0x0, 0xA0, 0x5, 0x0, 0x86, 0x1A, 0x0, 0x0, 0x0, 0x6, 0x0, 0xB0, 0x5, 0x0, 0xC6, 0x1A, 0x0, 0x0, 0x0, 0x6, 0x0, 0xC0, 0x5, 0x0, 0x6, 0x1B, 0x0, 0x0, 0x0, 0x6, 0x0, 0xD0, 0x5, 0x0, 0xC6, 0x1B, 0x0, 0x0, 0x0, 0x6, 0x0, 0xE0, 0x5, 0x0, 0xE6, 0x1B, 0x0, 0x0, 0x0, 0x6, 0x0, 0xF0, 0x5, 0x0, 0x6, 0x1C, 0x0, 0x0, 0x0, 0x6, 0x0, 0x0, 0x6, 0x0, 0x26, 0x1C, 0x0, 0x0, 0x0, 0x6, 0x0, 0x10, 0x6, 0x0, 0x46, 0x1C, 0x0, 0x0, 0x0, 0x6, 0x0, 0x20, 0x6, 0x0, 0x66, 0x1C, 0x0, 0x0, 0x0, 0x6, 0x0, 0x30, 0x6, 0x0, 0xA6, 0x14, 0x0, 0x0, 0x0, 0x6, 0x0, 0x40, 0x6, 0x0, 0xE6, 0x14, 0x0, 0x0, 0x0, 0x6, 0x0, 0x50, 0x6, 0x0, 0x26, 0x15, 0x0, 0x0, 0x0, 0x6, 0x0, 0x60, 0x6, 0x0, 0x66, 0x15, 0x0, 0x0, 0x0, 0x6, 0x0, 0x70, 0x6, 0x0, 0xA6, 0x15, 0x0, 0x0, 0x0, 0x6, 0x0, 0x80, 0x6, 0x0, 0xE6, 0x15, 0x0, 0x0, 0x0, 0x6, 0x0, 0x90, 0x6, 0x0, 0x26, 0x16, 0x0, 0x0, 0x0, 0x6, 0x0, 0xA0, 0x6, 0x0, 0x66, 0x16, 0x0, 0x0, 0x0, 0x6, 0x0, 0xB0, 0x6, 0x0, 0xA6, 0x16, 0x0, 0x0, 0x0, 0x6, 0x0, 0xC0, 0x6, 0x0, 0xE6, 0x16, 0x0, 0x0, 0x0, 0x6, 0x0, 0xF0, 0x6, 0x0, 0x26, 0x17, 0x0, 0x0, 0x0, 0x6, 0x0, 0xF8, 0x6, 0x0, 0x66, 0x17, 0x0, 0x0, 0x0, 0x6, 0x0, 0x0, 0x7, 0x0, 0xA6, 0x17, 0x0, 0x0, 0x0, 0x6, 0x0, 0x8, 0x7, 0x0, 0xE6, 0x17, 0x0, 0x0, 0x0, 0x6, 0x0, 0x10, 0x7, 0x0, 0x26, 0x18, 0x0, 0x0, 0x0, 0x6, 0x0, 0x18, 0x7, 0x0, 0x66, 0x18, 0x0, 0x0, 0x0, 0x6, 0x0, 0x28, 0x5, 0x0, 0xA6, 0x18, 0x0, 0x0, 0x0, 0x6, 0x0, 0x38, 0x5, 0x0, 0xE6, 0x18, 0x0, 0x0, 0x0, 0x6, 0x0, 0x48, 0x5, 0x0, 0x26, 0x19, 0x0, 0x0, 0x0, 0x6, 0x0, 0x58, 0x5, 0x0, 0x66, 0x19, 0x0, 0x0, 0x0, 0x6, 0x0, 0x68, 0x5, 0x0, 0xA6, 0x19, 0x0, 0x0, 0x0, 0x6, 0x0, 0x78, 0x5, 0x0, 0xE6, 0x19, 0x0, 0x0, 0x0, 0x6, 0x0, 0x88, 0x5, 0x0, 0x26, 0x1A, 0x0, 0x0, 0x0, 0x6, 0x0, 0x98, 0x5, 0x0, 0x66, 0x1A, 0x0, 0x0, 0x0, 0x6, 0x0, 0xA8, 0x5, 0x0, 0xA6, 0x1A, 0x0, 0x0, 0x0, 0x6, 0x0, 0xB8, 0x5, 0x0, 0xE6, 0x1A, 0x0, 0x0, 0x0, 0x6, 0x0, 0xC8, 0x5, 0x0, 0x86, 0x1C, 0x0, 0x0, 0x0, 0x6, 0x0, 0xD8, 0x5, 0x0, 0x6, 0x0, 0xE8, 0x5, 0x0, 0x6, 0x0, 0xF8, 0x5, 0x0, 0x6, 0x0, 0x8, 0x6, 0x0, 0x6, 0x0, 0x18, 0x6, 0x0, 0x6, 0x0, 0x28, 0x6, 0x0, 0x6, 0x0, 0x38, 0x6, 0x0, 0x6, 0x0, 0x48, 0x6, 0x0, 0x6, 0x0, 0x58, 0x6, 0x0, 0x6, 0x0, 0x68, 0x6, 0x0, 0x6, 0x0, 0x78, 0x6, 0x0, 0x6, 0x0, 0x88, 0x6, 0x0, 0x6, 0x0, 0x98, 0x6, 0x0, 0x6, 0x0, 0xA8, 0x6, 0x0, 0x6, 0x0, 0xB8, 0x6, 0x0, 0x6, 0x0, 0x20, 0x7, 0x0, 0x26, 0x1B, 0x0, 0x0, 0x0, 0x46, 0x1B, 0x0, 0x0, 0x0, 0x66, 0x1B, 0x0, 0x0, 0x0, 0x86, 0x1B, 0x0, 0x0, 0x0, 0xA6, 0x1B, 0x0, 0x0, 0x0, 0xC6, 0x14, 0x0, 0x0, 0x0, 0x6, 0x15, 0x0, 0x0, 0x0, 0x46, 0x15, 0x0, 0x0, 0x0, 0x86, 0x15, 0x0, 0x0, 0x0, 0xC6, 0x15, 0x0, 0x0, 0x0, 0x6, 0x16, 0x0, 0x0, 0x0, 0x46, 0x16, 0x0, 0x0, 0x0, 0x86, 0x16, 0x0, 0x0, 0x0, 0xC6, 0x16, 0x0, 0x0, 0x0, 0x6, 0x17, 0x0, 0x0, 0x0, 0x46, 0x17, 0x0, 0x0, 0x0, 0x26, 0x1A, 0x88, 0x5, 0x0, 0xA6, 0x1C, 0x0, 0x0, 0x0, 0x6, 0x0, 0x30, 0x7, 0x0, 0x6, 0x0, 0x38, 0x7, 0x0, 0x6, 0x0, 0x40, 0x7, 0x0, 0x6, 0x0, 0x48, 0x7, 0x0, 0x6, 0x0, 0x50, 0x7, 0x0, 0x6, 0x0, 0x58, 0x7, 0x0, 0x6, 0x0, 0x60, 0x7, 0x0, 0x6, 0x0, 0x68, 0x7, 0x0, 0x6, 0x0, 0x70, 0x7, 0x0, 0x6, 0x0, 0x78, 0x7, 0x0, 0x6, 0x0, 0x80, 0x7, 0x0, 0x6, 0x0, 0x88, 0x7, 0x0, 0x6, 0x0, 0x90, 0x7, 0x0, 0x6, 0x0, 0x98, 0x7, 0x0, 0x6, 0x0, 0xA0, 0x7, 0x0, 0x6, 0x0, 0xA8, 0x7, 0x0, 0x6, 0x0, 0xB0, 0x7, 0x0, 0x6, 0x0, 0xB8, 0x7, 0x0, 0x6, 0x0, 0xC0, 0x7, 0x0, 0x6, 0x0, 0xC8, 0x7, 0x0, 0x6, 0x0, 0xD0, 0x7, 0x0, 0x6, 0x0, 0x28, 0x7, 0x0, 0x6, 0x0, 0xD8, 0x7, 0x0, 0xC6, 0x1C, 0x0, 0x0, 0x0, 0x86, 0x1F, 0x0, 0x0, 0x0, 0xA6, 0x1F, 0x0, 0x0, 0x0, 0xC6, 0x1F, 0x0, 0x0, 0x0, 0xE6, 0x1F, 0x0, 0x0, 0x0, 0x6, 0x20, 0x0, 0x0, 0x0, 0x86, 0x1D, 0x0, 0x0, 0x0, 0xA6, 0x1D, 0x0, 0x0, 0x0, 0xC6, 0x1D, 0x0, 0x0, 0x0, 0xE6, 0x1D, 0x0, 0x0, 0x0, 0x6, 0x1E, 0x0, 0x0, 0x0, 0x26, 0x1E, 0x0, 0x0, 0x0, 0x46, 0x1E, 0x0, 0x0, 0x0, 0x66, 0x1E, 0x0, 0x0, 0x0, 0x86, 0x1E, 0x0, 0x0, 0x0, 0xA6, 0x1E, 0x0, 0x0, 0x0, 0x26, 0x20, 0x0, 0x0, 0x0, 0xC6, 0x1E, 0x0, 0x0, 0x0, 0xE6, 0x1E, 0x0, 0x0, 0x0, 0x46, 0x20, 0x0, 0x0, 0x0, 0x66, 0x20, 0x0, 0x0, 0x0, 0x86, 0x20, 0x0, 0x0, 0x0, 0xA6, 0x20, 0x0, 0x0, 0x0, 0x26, 0x1F, 0x0, 0x0, 0x0, 0x46, 0x1F, 0x0, 0x0, 0x0, 0x66, 0x1F, 0x0, 0x0, 0x0, 0x6, 0x0, 0x30, 0x8, 0x0, 0x6, 0x0, 0xF0, 0x7, 0x0, 0x6, 0x0, 0xF8, 0x7, 0x0, 0x6, 0x0, 0x0, 0x8, 0x0, 0x6, 0x0, 0x8, 0x8, 0x0, 0x6, 0x0, 0x10, 0x8, 0x0, 0x6, 0x0, 0x18, 0x8, 0x0, 0x6, 0x0, 0x20, 0x8, 0x0, 0x6, 0x0, 0x28, 0x8, 0x0, 0xC6, 0x20, 0x0, 0x0, 0x0, 0xE6, 0x20, 0x0, 0x0, 0x0, 0x6, 0x21, 0x0, 0x0, 0x0, 0x6, 0x0, 0x48, 0x8, 0x0, 0x46, 0x21, 0x0, 0x0, 0x0, 0x66, 0x21, 0x0, 0x0, 0x0, 0x86, 0x21, 0x0, 0x0, 0x0, 0x6, 0x1C, 0xF0, 0x5, 0x0, 0x26, 0x1C, 0x0, 0x6, 0x0, 0x46, 0x1C, 0x10, 0x6, 0x0, 0x66, 0x1C, 0x20, 0x6, 0x0, 0xA6, 0x14, 0x30, 0x6, 0x0, 0xE6, 0x14, 0x40, 0x6, 0x0, 0x26, 0x15, 0x50, 0x6, 0x0, 0x66, 0x15, 0x60, 0x6, 0x0, 0xA6, 0x15, 0x70, 0x6, 0x0, 0xE6, 0x15, 0x80, 0x6, 0x0, 0x26, 0x16, 0x90, 0x6, 0x0, 0x66, 0x16, 0xA0, 0x6, 0x0, 0xA6, 0x16, 0xB0, 0x6, 0x0, 0xE6, 0x16, 0xC0, 0x6, 0x0, 0x26, 0x17, 0xF0, 0x6, 0x0, 0x66, 0x17, 0xF8, 0x6, 0x0, 0xA6, 0x17, 0x0, 0x7, 0x0, 0xE6, 0x17, 0x8, 0x7, 0x0, 0x26, 0x18, 0x10, 0x7, 0x0, 0x66, 0x18, 0x18, 0x7, 0x0, 0xA6, 0x18, 0x28, 0x5, 0x0, 0xE6, 0x18, 0x38, 0x5, 0x0, 0x26, 0x19, 0x48, 0x5, 0x0, 0x66, 0x19, 0x58, 0x5, 0x0, 0xA6, 0x19, 0x68, 0x5, 0x0, 0xE6, 0x19, 0x78, 0x5, 0x0, 0x66, 0x1A, 0x98, 0x5, 0x0, 0xA6, 0x1A, 0xA8, 0x5, 0x0, 0xE6, 0x1A, 0xB8, 0x5, 0x0, 0x86, 0x1C, 0xC8, 0x5, 0x0, 0x6, 0x0, 0x68, 0x8, 0x0, 0x6, 0x0, 0x70, 0x8, 0x0, 0x6, 0x0, 0x78, 0x8, 0x0, 0x6, 0x0, 0x80, 0x8, 0x0, 0x6, 0x0, 0x88, 0x8, 0x0, 0x6, 0x0, 0x90, 0x8, 0x0, 0x6, 0x0, 0x98, 0x8, 0x0, 0x6, 0x0, 0xA0, 0x8, 0x0, 0x6, 0x0, 0xA8, 0x8, 0x0, 0x6, 0x0, 0xB0, 0x8, 0x0, 0x6, 0x0, 0xB8, 0x8, 0x0, 0x6, 0x0, 0xC0, 0x8, 0x0, 0x6, 0x0, 0xC8, 0x8, 0x0, 0x6, 0x0, 0xD0, 0x8, 0x0, 0x6, 0x0, 0xD8, 0x8, 0x0, 0x6, 0x0, 0xE0, 0x8, 0x0, 0xA6, 0x23, 0x0, 0x0, 0x0, 0xC6, 0x23, 0x0, 0x0, 0x0, 0xE6, 0x23, 0x0, 0x0, 0x0, 0x6, 0x24, 0x0, 0x0, 0x0, 0x26, 0x24, 0x0, 0x0, 0x0, 0x46, 0x24, 0x0, 0x0, 0x0, 0x66, 0x24, 0x0, 0x0, 0x0, 0x86, 0x24, 0x0, 0x0, 0x0, 0xA6, 0x24, 0x0, 0x0, 0x0, 0xC6, 0x24, 0x0, 0x0, 0x0, 0xE6, 0x24, 0x0, 0x0, 0x0, 0x6, 0x25, 0x0, 0x0, 0x0, 0x26, 0x25, 0x0, 0x0, 0x0, 0x46, 0x25, 0x0, 0x0, 0x0, 0x66, 0x25, 0x0, 0x0, 0x0, 0x86, 0x25, 0x0, 0x0, 0x0, 0xE6, 0x14, 0xC8, 0x6, 0x0, 0x26, 0x15, 0xD0, 0x6, 0x0, 0x66, 0x15, 0xD8, 0x6, 0x0, 0xA6, 0x15, 0xE0, 0x6, 0x0, 0xE6, 0x15, 0xE8, 0x6, 0x0, 0x26, 0x16, 0x30, 0x5, 0x0, 0x66, 0x16, 0x40, 0x5, 0x0, 0xA6, 0x16, 0x50, 0x5, 0x0, 0xE6, 0x16, 0x60, 0x5, 0x0, 0x26, 0x17, 0x70, 0x5, 0x0, 0x6, 0x0, 0x68, 0x9, 0x0, 0xC6, 0x25, 0x0, 0x0, 0x0, 0xE6, 0x25, 0x0, 0x0, 0x0, 0x6, 0x26, 0x0, 0x0, 0x0, 0x26, 0x26, 0x0, 0x0, 0x0, 0x46, 0x26, 0x0, 0x0, 0x0, 0x66, 0x26, 0x0, 0x0, 0x0, 0x86, 0x26, 0x0, 0x0, 0x0, 0xA6, 0x26, 0x0, 0x0, 0x0, 0xC6, 0x26, 0x0, 0x0, 0x0, 0xE6, 0x26, 0x0, 0x0, 0x0, 0x6, 0x27, 0x0, 0x0, 0x0, 0x26, 0x27, 0x0, 0x0, 0x0, 0x46, 0x27, 0x0, 0x0, 0x0, 0x66, 0x27, 0x0, 0x0, 0x0, 0x86, 0x27, 0x0, 0x0, 0x0, 0xA6, 0x27, 0x0, 0x0, 0x0, 0xA6, 0x17, 0xB0, 0x5, 0x0, 0x66, 0xB, 0x0, 0x0, 0x0, 0xA6, 0xA, 0x0, 0x0, 0x0, 0xC6, 0x27, 0x0, 0x0, 0x0, 0xE6, 0x27, 0x0, 0x0, 0x0, 0x6, 0x28, 0x0, 0x0, 0x0, 0x26, 0x28, 0x0, 0x0, 0x0, 0x46, 0x28, 0x0, 0x0, 0x0, 0x66, 0x28, 0x0, 0x0, 0x0, 0x86, 0x28, 0x0, 0x0, 0x0, 0x6, 0x0, 0xF0, 0x9, 0x0, 0x6, 0x0, 0x28, 0xA, 0x0, 0x6, 0x0, 0x30, 0xA, 0x0, 0x6, 0x0, 0x38, 0xA, 0x0, 0x6, 0x0, 0x40, 0xA, 0x0, 0x6, 0x0, 0x48, 0xA, 0x0, 0x6, 0x0, 0x50, 0xA, 0x0, 0x6, 0x0, 0x58, 0xA, 0x0, 0x6, 0x0, 0x60, 0xA, 0x0, 0x6, 0x0, 0x0, 0xA, 0x0, 0x6, 0x0, 0x8, 0xA, 0x0, 0x6, 0x0, 0x68, 0xA, 0x0, 0x6, 0x0, 0x70, 0xA, 0x0, 0x6, 0x0, 0x78, 0xA, 0x0, 0x6, 0x0, 0x80, 0xA, 0x0, 0x6, 0x0, 0x88, 0xA, 0x0, 0x6, 0x0, 0x90, 0xA, 0x0, 0x6, 0x0, 0x10, 0xA, 0x0, 0x6, 0x0, 0x18, 0xA, 0x0, 0x6, 0x0, 0x98, 0xA, 0x0, 0x6, 0x0, 0xA0, 0xA, 0x0, 0x6, 0x0, 0xA8, 0xA, 0x0, 0x6, 0x0, 0xB0, 0xA, 0x0, 0x6, 0x0, 0xB8, 0xA, 0x0, 0x6, 0x0, 0xC0, 0xA, 0x0, 0x6, 0x0, 0xC8, 0xA, 0x0, 0x6, 0x0, 0xD0, 0xA, 0x0, 0xE6, 0x28, 0x0, 0x0, 0x0, 0x6, 0x29, 0x0, 0x0, 0x0, 0x26, 0x29, 0x0, 0x0, 0x0, 0x46, 0x29, 0x0, 0x0, 0x0, 0x66, 0x29, 0x0, 0x0, 0x0, 0x86, 0x29, 0x0, 0x0, 0x0, 0xA6, 0x29, 0x0, 0x0, 0x0, 0xE6, 0x29, 0x0, 0x0, 0x0, 0x26, 0x2A, 0x0, 0x0, 0x0, 0xA6, 0x2A, 0x0, 0x0, 0x0, 0xC6, 0x2A, 0x0, 0x0, 0x0, 0xE6, 0x2A, 0x0, 0x0, 0x0, 0x6, 0x2B, 0x0, 0x0, 0x0, 0x26, 0x2B, 0x0, 0x0, 0x0, 0x46, 0x2B, 0x0, 0x0, 0x0, 0x6, 0x0, 0xD8, 0xA, 0x0, 0x6, 0x0, 0xE0, 0xA, 0x0, 0x6, 0x0, 0xE8, 0xA, 0x0, 0x6, 0x0, 0xF0, 0xA, 0x0, 0x6, 0x0, 0xF8, 0xA, 0x0, 0x6, 0x0, 0x0, 0xB, 0x0, 0xE6, 0x1C, 0x0, 0x0, 0x0, 0x6, 0x1D, 0x0, 0x0, 0x0, 0x26, 0x1D, 0x0, 0x0, 0x0, 0x46, 0x1D, 0x0, 0x0, 0x0, 0x66, 0x1D, 0x0, 0x0, 0x0, 0x26, 0x21, 0x0, 0x0, 0x0, 0xA6, 0x2B, 0x0, 0x0, 0x0, 0xC6, 0x2B, 0x0, 0x0, 0x0, 0xE6, 0x2B, 0x0, 0x0, 0x0, 0x6, 0x2C, 0x0, 0x0, 0x0, 0xA6, 0x28, 0x0, 0x0, 0x0, 0xC6, 0x28, 0x0, 0x0, 0x0, 0xA6, 0x21, 0x0, 0x0, 0x0, 0xC6, 0x21, 0x0, 0x0, 0x0, 0xE6, 0x21, 0x0, 0x0, 0x0, 0x6, 0x22, 0x0, 0x0, 0x0, 0x26, 0x22, 0x0, 0x0, 0x0, 0x46, 0x22, 0x0, 0x0, 0x0, 0x66, 0x22, 0x0, 0x0, 0x0, 0x86, 0x22, 0x0, 0x0, 0x0, 0xA6, 0x22, 0x0, 0x0, 0x0, 0xC6, 0x22, 0x0, 0x0, 0x0, 0xE6, 0x22, 0x0, 0x0, 0x0, 0x6, 0x23, 0x0, 0x0, 0x0, 0x26, 0x23, 0x0, 0x0, 0x0, 0x46, 0x23, 0x0, 0x0, 0x0, 0x66, 0x23, 0x0, 0x0, 0x0, 0x86, 0x23, 0x0, 0x0, 0x0, 0x86, 0x17, 0xC8, 0x6, 0x0, 0xC6, 0x17, 0xD0, 0x6, 0x0, 0x6, 0x18, 0xD8, 0x6, 0x0, 0x46, 0x18, 0xE0, 0x6, 0x0, 0x86, 0x18, 0xE8, 0x6, 0x0, 0xC6, 0x18, 0x30, 0x5, 0x0, 0x6, 0x19, 0x40, 0x5, 0x0, 0x46, 0x19, 0x50, 0x5, 0x0, 0x86, 0x19, 0x60, 0x5, 0x0, 0xC6, 0x19, 0x70, 0x5, 0x0, 0x6, 0x1A, 0x80, 0x5, 0x0, 0x46, 0x1A, 0x90, 0x5, 0x0, 0x86, 0x1A, 0xA0, 0x5, 0x0, 0xC6, 0x1A, 0xB0, 0x5, 0x0, 0x6, 0x1B, 0xC0, 0x5, 0x0, 0x26, 0x2C, 0x0, 0x0, 0x0, 0x46, 0x2C, 0x0, 0x0, 0x0, 0x6, 0x1F, 0x0, 0x0, 0x0, 0x66, 0x2C, 0x0, 0x0, 0x0, 0x86, 0x2C, 0x0, 0x0, 0x0, 0xA6, 0x2C, 0x0, 0x0, 0x0, 0xA6, 0x25, 0x0, 0x0, 0x0, 0xC6, 0x2C, 0x0, 0x0, 0x0, 0xE6, 0x1B, 0xD8, 0x5, 0x0, 0x6, 0x1C, 0xE8, 0x5, 0x0, 0x26, 0x1C, 0xF8, 0x5, 0x0, 0x46, 0x1C, 0x8, 0x6, 0x0, 0x66, 0x1C, 0x18, 0x6, 0x0, 0xA6, 0x14, 0x28, 0x6, 0x0, 0xE6, 0x14, 0x38, 0x6, 0x0, 0x26, 0x15, 0x48, 0x6, 0x0, 0x66, 0x15, 0x58, 0x6, 0x0, 0xA6, 0x15, 0x68, 0x6, 0x0, 0xE6, 0x15, 0x78, 0x6, 0x0, 0x26, 0x16, 0x88, 0x6, 0x0, 0x66, 0x16, 0x98, 0x6, 0x0, 0xA6, 0x16, 0xA8, 0x6, 0x0, 0xE6, 0x16, 0xB8, 0x6, 0x0, 0x26, 0x17, 0x20, 0x7, 0x0, 0x86, 0x1C, 0xF0, 0x6, 0x0, 0x6, 0x0, 0x0, 0x3, 0x0, 0x6, 0x0, 0x8, 0x3, 0x0, 0x6, 0x0, 0x10, 0x3, 0x0, 0x6, 0x0, 0x18, 0x3, 0x0, 0x6, 0x0, 0x20, 0x3, 0x0, 0x6, 0x0, 0x30, 0x2, 0x0, 0x6, 0x0, 0x38, 0x2, 0x0, 0x6, 0x0, 0x40, 0x2, 0x0, 0x6, 0x0, 0x48, 0x2, 0x0, 0x6, 0x0, 0x50, 0x2, 0x0, 0x6, 0x0, 0x58, 0x2, 0x0, 0x6, 0x0, 0x60, 0x2, 0x0, 0x6, 0x0, 0x68, 0x2, 0x0, 0x6, 0x0, 0x70, 0x2, 0x0, 0x6, 0x0, 0x78, 0x2, 0x0, 0x6, 0x0, 0x80, 0x2, 0x0, 0xE6, 0x2C, 0x0, 0x0, 0x0, 0x6, 0x2D, 0x0, 0x0, 0x0, 0x46, 0x16, 0x40, 0x2, 0x0, 0x26, 0x2D, 0x0, 0x0, 0x0, 0xA6, 0x17, 0xD8, 0x5, 0x0, 0xE6, 0x17, 0xE8, 0x5, 0x0, 0x6, 0x0, 0x50, 0xB, 0x0, 0x6, 0x0, 0x58, 0xB, 0x0, 0x6, 0x0, 0x60, 0xB, 0x0, 0x6, 0x0, 0x68, 0xB, 0x0, 0x6, 0x0, 0xE0, 0x7, 0x0, 0x86, 0x15, 0xC8, 0x6, 0x0, 0xC6, 0x15, 0x78, 0x5, 0x0, 0xC6, 0x2D, 0x0, 0x0, 0x0, 0x26, 0x1C, 0xE8, 0x5, 0x0, 0xE6, 0x2D, 0x0, 0x0, 0x0, 0x6, 0x2E, 0x0, 0x0, 0x0, 0x26, 0x2E, 0x0, 0x0, 0x0, 0x46, 0x2E, 0x0, 0x0, 0x0, 0x66, 0x2E, 0x0, 0x0, 0x0, 0x86, 0x2E, 0x0, 0x0, 0x0, 0xA6, 0x2E, 0x0, 0x0, 0x0, 0xC6, 0x2E, 0x0, 0x0, 0x0, 0xE6, 0x2E, 0x0, 0x0, 0x0, 0x6, 0x2F, 0x0, 0x0, 0x0, 0x6, 0x0, 0x50, 0x8, 0x0, 0x6, 0x0, 0xC8, 0xB, 0x0, 0x6, 0x0, 0xD0, 0xB, 0x0, 0x6, 0x0, 0x60, 0x8, 0x0, 0x6, 0x0, 0xA0, 0xB, 0x0, 0x6, 0x0, 0x20, 0xB, 0x0, 0x66, 0x2F, 0x0, 0x0, 0x0, 0x86, 0x1C, 0xC8, 0x6, 0x0, 0x6, 0x0, 0xD8, 0xB, 0x0, 0x6, 0x0, 0xE8, 0x7, 0x0, 0xE6, 0xA, 0x0, 0x0, 0x0, 0x26, 0xC, 0x0, 0x0, 0x0, 0x46, 0xC, 0x0, 0x0, 0x0, 0x66, 0xC, 0x0, 0x0, 0x0, 0x86, 0xC, 0x0, 0x0, 0x0, 0xC6, 0x8, 0x0, 0x0, 0x0, 0xE6, 0x8, 0x0, 0x0, 0x0, 0x6, 0x9, 0x0, 0x0, 0x0, 0x46, 0x9, 0x0, 0x0, 0x0, 0x66, 0x9, 0x0, 0x0, 0x0, 0x86, 0x9, 0x0, 0x0, 0x0, 0xA6, 0x9, 0x0, 0x0, 0x0, 0xC6, 0x9, 0x0, 0x0, 0x0, 0xE6, 0x9, 0x0, 0x0, 0x0, 0x6, 0xA, 0x0, 0x0, 0x0, 0x26, 0xA, 0x0, 0x0, 0x0, 0x46, 0xA, 0x0, 0x0, 0x0, 0x66, 0xA, 0x0, 0x0, 0x0, 0x86, 0xA, 0x0, 0x0, 0x0, 0xC6, 0xA, 0x0, 0x0, 0x0, 0x6, 0xB, 0x0, 0x0, 0x0, 0x26, 0xB, 0x0, 0x0, 0x0, 0x46, 0xB, 0x0, 0x0, 0x0, 0x86, 0xB, 0x0, 0x0, 0x0, 0xA6, 0xB, 0x0, 0x0, 0x0, 0xC6, 0xB, 0x0, 0x0, 0x0, 0xE6, 0xB, 0x0, 0x0, 0x0, 0xA6, 0xC, 0x0, 0x0, 0x0, 0x26, 0x9, 0x0, 0x0, 0x0, 0x7, 0x0, 0xE0, 0xB, 0x0, 0x7, 0x0, 0xE8, 0xB, 0x0, 0x7, 0x0, 0xF0, 0xB, 0x0, 0x7, 0x0, 0xF8, 0xB, 0x0, 0x7, 0x0, 0x0, 0xC, 0x0, 0x7, 0x0, 0x8, 0xC, 0x0, 0x7, 0x0, 0x10, 0xC, 0x0, 0x7, 0x0, 0x18, 0xC, 0x0, 0x7, 0x0, 0x20, 0xC, 0x0, 0x7, 0x0, 0x28, 0xC, 0x0, 0x7, 0x0, 0x30, 0xC, 0x0, 0x7, 0x0, 0x38, 0xC, 0x0, 0x7, 0x0, 0x40, 0xC, 0x0, 0x7, 0x0, 0x48, 0xC, 0x0, 0x7, 0x0, 0x50, 0xC, 0x0, 0x7, 0x0, 0x58, 0xC, 0x0, 0x7, 0x0, 0x60, 0xC, 0x0, 0x7, 0x0, 0x68, 0xC, 0x0, 0x7, 0x0, 0x70, 0xC, 0x0, 0x7, 0x0, 0x78, 0xC, 0x0, 0x7, 0x0, 0x80, 0xC, 0x0, 0x7, 0x0, 0x88, 0xC, 0x0, 0x7, 0x0, 0x90, 0xC, 0x0, 0x7, 0x0, 0x98, 0xC, 0x0, 0x7, 0x0, 0xA0, 0xC, 0x0, 0x7, 0x0, 0xA8, 0xC, 0x0, 0xC7, 0x32, 0x0, 0x0, 0x0, 0xE7, 0x32, 0x0, 0x0, 0x0, 0x7, 0x33, 0x0, 0x0, 0x0, 0x27, 0x33, 0x0, 0x0, 0x0, 0x47, 0x33, 0x0, 0x0, 0x0, 0x67, 0x33, 0x0, 0x0, 0x0, 0x87, 0x33, 0x0, 0x0, 0x0, 0xA7, 0x33, 0x0, 0x0, 0x0, 0xC7, 0x33, 0x0, 0x0, 0x0, 0xE7, 0x33, 0x0, 0x0, 0x0, 0x7, 0x34, 0x0, 0x0, 0x0, 0x27, 0x34, 0x0, 0x0, 0x0, 0x47, 0x34, 0x0, 0x0, 0x0, 0x67, 0x34, 0x0, 0x0, 0x0, 0x87, 0x34, 0x0, 0x0, 0x0, 0xA7, 0x34, 0x0, 0x0, 0x0, 0xC7, 0x34, 0x0, 0x0, 0x0, 0xE7, 0x34, 0x0, 0x0, 0x0, 0x7, 0x35, 0x0, 0x0, 0x0, 0x27, 0x35, 0x0, 0x0, 0x0, 0x47, 0x35, 0x0, 0x0, 0x0, 0x67, 0x35, 0x0, 0x0, 0x0, 0x87, 0x35, 0x0, 0x0, 0x0, 0xA7, 0x35, 0x0, 0x0, 0x0, 0xC7, 0x35, 0x0, 0x0, 0x0, 0xE7, 0x35, 0x0, 0x0, 0x0, 0x7, 0x36, 0x0, 0x0, 0x0, 0x27, 0x36, 0x0, 0x0, 0x0, 0x47, 0x36, 0x0, 0x0, 0x0, 0x67, 0x36, 0x0, 0x0, 0x0, 0x87, 0x36, 0x0, 0x0, 0x0, 0xA7, 0x36, 0x0, 0x0, 0x0, 0xC7, 0x36, 0x0, 0x0, 0x0, 0xE7, 0x36, 0x0, 0x0, 0x0, 0x7, 0x37, 0x0, 0x0, 0x0, 0x27, 0x37, 0x0, 0x0, 0x0, 0x47, 0x37, 0x0, 0x0, 0x0, 0x67, 0x37, 0x0, 0x0, 0x0, 0x87, 0x37, 0x0, 0x0, 0x0, 0xA7, 0x37, 0x0, 0x0, 0x0, 0xC7, 0x37, 0x0, 0x0, 0x0, 0xE7, 0x37, 0x0, 0x0, 0x0, 0x7, 0x38, 0x0, 0x0, 0x0, 0x27, 0x38, 0x0, 0x0, 0x0, 0x47, 0x38, 0x0, 0x0, 0x0, 0x67, 0x38, 0x0, 0x0, 0x0, 0x87, 0x38, 0x0, 0x0, 0x0, 0xA7, 0x38, 0x0, 0x0, 0x0, 0xC7, 0x38, 0x0, 0x0, 0x0, 0xE7, 0x38, 0x0, 0x0, 0x0, 0x7, 0x39, 0x0, 0x0, 0x0, 0x27, 0x39, 0x0, 0x0, 0x0, 0x47, 0x39, 0x0, 0x0, 0x0, 0x67, 0x39, 0x0, 0x0, 0x0, 0x87, 0x39, 0x0, 0x0, 0x0, 0xA7, 0x39, 0x0, 0x0, 0x0, 0xC7, 0x39, 0x0, 0x0, 0x0, 0xE7, 0x39, 0x0, 0x0, 0x0, 0x7, 0x3A, 0x0, 0x0, 0x0, 0x27, 0x3A, 0x0, 0x0, 0x0, 0x47, 0x3A, 0x0, 0x0, 0x0, 0x67, 0x3A, 0x0, 0x0, 0x0, 0x87, 0x3A, 0x0, 0x0, 0x0, 0xA7, 0x3A, 0x0, 0x0, 0x0, 0xC7, 0x3A, 0x0, 0x0, 0x0, 0xE7, 0x3A, 0x0, 0x0, 0x0, 0x7, 0x3B, 0x0, 0x0, 0x0, 0x27, 0x3B, 0x0, 0x0, 0x0, 0x47, 0x3B, 0x0, 0x0, 0x0, 0x67, 0x3B, 0x0, 0x0, 0x0, 0x87, 0x3B, 0x0, 0x0, 0x0, 0xA7, 0x3B, 0x0, 0x0, 0x0, 0xC7, 0x3B, 0x0, 0x0, 0x0, 0xE7, 0x3B, 0x0, 0x0, 0x0, 0x7, 0x3C, 0x0, 0x0, 0x0, 0x27, 0x3C, 0x0, 0x0, 0x0, 0x47, 0x3C, 0x0, 0x0, 0x0, 0x67, 0x3C, 0x0, 0x0, 0x0, 0x87, 0x3C, 0x0, 0x0, 0x0, 0xA7, 0x3C, 0x0, 0x0, 0x0, 0xC7, 0x3C, 0x0, 0x0, 0x0, 0xE7, 0x3C, 0x0, 0x0, 0x0, 0x7, 0x3D, 0x0, 0x0, 0x0, 0x27, 0x3D, 0x0, 0x0, 0x0, 0x47, 0x3D, 0x0, 0x0, 0x0, 0x67, 0x3D, 0x0, 0x0, 0x0, 0x87, 0x3D, 0x0, 0x0, 0x0, 0xA7, 0x3D, 0x0, 0x0, 0x0, 0xC7, 0x3D, 0x0, 0x0, 0x0, 0xE7, 0x3D, 0x0, 0x0, 0x0, 0x7, 0x3E, 0x0, 0x0, 0x0, 0x27, 0x3E, 0x0, 0x0, 0x0, 0x47, 0x3E, 0x0, 0x0, 0x0, 0x67, 0x3E, 0x0, 0x0, 0x0, 0x87, 0x3E, 0x0, 0x0, 0x0, 0xA7, 0x3E, 0x0, 0x0, 0x0, 0xC7, 0x3E, 0x0, 0x0, 0x0, 0xE7, 0x3E, 0x0, 0x0, 0x0, 0x7, 0x3F, 0x0, 0x0, 0x0, 0x27, 0x3F, 0x0, 0x0, 0x0, 0x47, 0x3F, 0x0, 0x0, 0x0, 0x67, 0x3F, 0x0, 0x0, 0x0, 0x87, 0x3F, 0x0, 0x0, 0x0, 0xA7, 0x3F, 0x0, 0x0, 0x0, 0xC7, 0x3F, 0x0, 0x0, 0x0, 0xE7, 0x3F, 0x0, 0x0, 0x0, 0x7, 0x40, 0x0, 0x0, 0x0, 0x27, 0x40, 0x0, 0x0, 0x0, 0x47, 0x40, 0x0, 0x0, 0x0, 0x67, 0x40, 0x0, 0x0, 0x0, 0x87, 0x40, 0x0, 0x0, 0x0, 0xA7, 0x40, 0x0, 0x0, 0x0, 0x7, 0x0, 0x30, 0x10, 0x0, 0x7, 0x0, 0x38, 0x10, 0x0, 0x7, 0x0, 0x40, 0x10, 0x0, 0x7, 0x0, 0x48, 0x10, 0x0, 0x7, 0x0, 0x50, 0x10, 0x0, 0x7, 0x0, 0x58, 0x10, 0x0, 0x7, 0x0, 0x60, 0x10, 0x0, 0x7, 0x0, 0x68, 0x10, 0x0, 0x7, 0x0, 0x70, 0x10, 0x0, 0x7, 0x0, 0x78, 0x10, 0x0, 0x7, 0x0, 0x80, 0x10, 0x0, 0x7, 0x0, 0x88, 0x10, 0x0, 0x7, 0x0, 0x90, 0x10, 0x0, 0x7, 0x0, 0x98, 0x10, 0x0, 0x7, 0x0, 0xA0, 0x10, 0x0, 0x7, 0x0, 0xA8, 0x10, 0x0, 0x7, 0x0, 0x78, 0xE, 0x0, 0xC7, 0x42, 0x0, 0x0, 0x0, 0xE7, 0x42, 0x0, 0x0, 0x0, 0x7, 0x43, 0x0, 0x0, 0x0, 0x27, 0x43, 0x0, 0x0, 0x0, 0x47, 0x43, 0x0, 0x0, 0x0, 0x67, 0x43, 0x0, 0x0, 0x0, 0x87, 0x43, 0x0, 0x0, 0x0, 0xA7, 0x43, 0x0, 0x0, 0x0, 0x7, 0x0, 0x8, 0xD, 0x0, 0x7, 0x0, 0xE8, 0xC, 0x0, 0x7, 0x0, 0x98, 0xD, 0x0, 0x7, 0x0, 0xE8, 0xD, 0x0, 0x7, 0x0, 0x48, 0xD, 0x0, 0xC7, 0x43, 0x0, 0x0, 0x0, 0xE7, 0x43, 0x0, 0x0, 0x0, 0x7, 0x44, 0x0, 0x0, 0x0, 0x27, 0x44, 0x0, 0x0, 0x0, 0x47, 0x44, 0x0, 0x0, 0x0, 0x67, 0x44, 0x0, 0x0, 0x0, 0x87, 0x44, 0x0, 0x0, 0x0, 0xA7, 0x44, 0x0, 0x0, 0x0, 0xC7, 0x44, 0x0, 0x0, 0x0, 0xE7, 0x44, 0x0, 0x0, 0x0, 0x7, 0x45, 0x0, 0x0, 0x0, 0x27, 0x45, 0x0, 0x0, 0x0, 0x7, 0x0, 0x58, 0xD, 0x0, 0x47, 0x45, 0x0, 0x0, 0x0, 0x67, 0x45, 0x0, 0x0, 0x0, 0x87, 0x45, 0x0, 0x0, 0x0, 0xA7, 0x45, 0x0, 0x0, 0x0, 0xC7, 0x45, 0x0, 0x0, 0x0, 0x7, 0x0, 0x78, 0x11, 0x0, 0x7, 0x0, 0x80, 0x11, 0x0, 0x7, 0x0, 0x88, 0x11, 0x0, 0x7, 0x0, 0x90, 0x11, 0x0, 0x7, 0x0, 0x98, 0x11, 0x0, 0x7, 0x0, 0xA0, 0x11, 0x0, 0x7, 0x0, 0xA8, 0x11, 0x0, 0x7, 0x0, 0xB0, 0x11, 0x0, 0x7, 0x0, 0xB8, 0x11, 0x0, 0x7, 0x0, 0xC0, 0x11, 0x0, 0x7, 0x0, 0xC8, 0x11, 0x0, 0x7, 0x0, 0xD0, 0x11, 0x0, 0x7, 0x0, 0xD8, 0x11, 0x0, 0x7, 0x0, 0xE0, 0x11, 0x0, 0x7, 0x0, 0xE8, 0x11, 0x0, 0x7, 0x0, 0xF0, 0x11, 0x0, 0x7, 0x0, 0xF8, 0x11, 0x0, 0x7, 0x0, 0x0, 0x12, 0x0, 0x7, 0x0, 0x8, 0x12, 0x0, 0x7, 0x0, 0x10, 0x12, 0x0, 0x7, 0x0, 0x18, 0x12, 0x0, 0x7, 0x0, 0x20, 0x12, 0x0, 0x7, 0x0, 0x28, 0x12, 0x0, 0x7, 0x0, 0x30, 0x12, 0x0, 0x7, 0x0, 0x38, 0x12, 0x0, 0x7, 0x0, 0xB8, 0x10, 0x0, 0x7, 0x0, 0x40, 0x12, 0x0, 0x7, 0x0, 0xC0, 0x10, 0x0, 0x7, 0x0, 0xC8, 0x10, 0x0, 0x7, 0x0, 0xD0, 0x10, 0x0, 0x7, 0x0, 0xD8, 0x10, 0x0, 0x7, 0x0, 0xE0, 0x10, 0x0, 0x7, 0x0, 0xE8, 0x10, 0x0, 0x7, 0x0, 0x48, 0x12, 0x0, 0x7, 0x0, 0x50, 0x12, 0x0, 0x7, 0x0, 0x58, 0x12, 0x0, 0x7, 0x0, 0x60, 0x12, 0x0, 0x7, 0x0, 0xF0, 0x10, 0x0, 0x7, 0x0, 0xF8, 0x10, 0x0, 0x7, 0x0, 0x0, 0x11, 0x0, 0x7, 0x0, 0x8, 0x11, 0x0, 0xA7, 0x49, 0x0, 0x0, 0x0, 0xC7, 0x49, 0x0, 0x0, 0x0, 0xE7, 0x49, 0x0, 0x0, 0x0, 0x7, 0x4A, 0x0, 0x0, 0x0, 0x27, 0x4A, 0x0, 0x0, 0x0, 0x7, 0x0, 0xD0, 0xD, 0x0, 0x7, 0x0, 0x30, 0xE, 0x0, 0x7, 0x0, 0x50, 0xE, 0x0, 0x7, 0x0, 0x60, 0xE, 0x0, 0x7, 0x0, 0x70, 0xE, 0x0, 0x7, 0x0, 0x80, 0xE, 0x0, 0x7, 0x0, 0x90, 0xE, 0x0, 0x7, 0x0, 0xA0, 0xE, 0x0, 0x7, 0x0, 0xB0, 0xE, 0x0, 0x7, 0x0, 0xC0, 0xE, 0x0, 0x7, 0x0, 0xD0, 0xE, 0x0, 0x7, 0x0, 0xE0, 0xE, 0x0, 0x7, 0x0, 0xF0, 0xE, 0x0, 0x7, 0x0, 0x0, 0xF, 0x0, 0x7, 0x0, 0x10, 0xF, 0x0, 0x7, 0x0, 0x20, 0xF, 0x0, 0x7, 0x0, 0x30, 0xF, 0x0, 0x7, 0x0, 0x40, 0xF, 0x0, 0x7, 0x0, 0x50, 0xF, 0x0, 0x7, 0x0, 0x60, 0xF, 0x0, 0x7, 0x0, 0x70, 0xF, 0x0, 0x7, 0x0, 0x80, 0xF, 0x0, 0x7, 0x0, 0x90, 0xF, 0x0, 0x7, 0x0, 0xA0, 0xF, 0x0, 0x7, 0x0, 0xB0, 0xF, 0x0, 0x7, 0x0, 0xB8, 0xF, 0x0, 0x7, 0x0, 0xC0, 0xF, 0x0, 0x7, 0x0, 0xC8, 0xF, 0x0, 0x7, 0x0, 0xD0, 0xF, 0x0, 0x7, 0x0, 0xD8, 0xF, 0x0, 0x7, 0x0, 0xE0, 0xF, 0x0, 0x7, 0x0, 0xE8, 0xF, 0x0, 0x7, 0x0, 0xF0, 0xF, 0x0, 0x7, 0x0, 0xF8, 0xF, 0x0, 0x7, 0x0, 0x0, 0x10, 0x0, 0x7, 0x0, 0x8, 0x10, 0x0, 0x7, 0x0, 0x10, 0x10, 0x0, 0x7, 0x0, 0x18, 0x10, 0x0, 0x7, 0x0, 0x20, 0x10, 0x0, 0x7, 0x0, 0x28, 0x10, 0x0, 0x47, 0x4A, 0x0, 0x0, 0x0, 0x67, 0x4A, 0x0, 0x0, 0x0, 0x87, 0x4A, 0x0, 0x0, 0x0, 0x7, 0x47, 0x0, 0x0, 0x0, 0x27, 0x47, 0x0, 0x0, 0x0, 0x47, 0x47, 0x0, 0x0, 0x0, 0x67, 0x47, 0x0, 0x0, 0x0, 0x87, 0x47, 0x0, 0x0, 0x0, 0xA7, 0x47, 0x0, 0x0, 0x0, 0xC7, 0x47, 0x0, 0x0, 0x0, 0xE7, 0x47, 0x0, 0x0, 0x0, 0x7, 0x48, 0x0, 0x0, 0x0, 0x27, 0x48, 0x0, 0x0, 0x0, 0x47, 0x48, 0x0, 0x0, 0x0, 0x67, 0x48, 0x0, 0x0, 0x0, 0x87, 0x48, 0x0, 0x0, 0x0, 0xA7, 0x48, 0x0, 0x0, 0x0, 0xC7, 0x48, 0x0, 0x0, 0x0, 0xE7, 0x48, 0x0, 0x0, 0x0, 0x7, 0x49, 0x0, 0x0, 0x0, 0x27, 0x49, 0x0, 0x0, 0x0, 0xA7, 0x4A, 0x0, 0x0, 0x0, 0x47, 0x49, 0x0, 0x0, 0x0, 0x67, 0x49, 0x0, 0x0, 0x0, 0x87, 0x49, 0x0, 0x0, 0x0, 0x7, 0x0, 0xA8, 0xF, 0x0, 0x7, 0x0, 0xB0, 0xC, 0x0, 0x7, 0x0, 0xB0, 0x12, 0x0, 0x7, 0x0, 0x90, 0x12, 0x0, 0x7, 0x0, 0x88, 0xE, 0x0, 0x7, 0x0, 0xB8, 0xC, 0x0, 0x7, 0x0, 0xA8, 0xE, 0x0, 0x7, 0x0, 0xC8, 0xC, 0x0, 0x7, 0x0, 0xD8, 0xC, 0x0, 0x7, 0x0, 0x98, 0xE, 0x0, 0x7, 0x0, 0xA0, 0x12, 0x0, 0x7, 0x0, 0xB8, 0x12, 0x0, 0x7, 0x0, 0xC0, 0x12, 0x0, 0x7, 0x0, 0xC0, 0xC, 0x0, 0x7, 0x0, 0x0, 0xD, 0x0, 0x7, 0x0, 0x68, 0xD, 0x0, 0x7, 0x0, 0x78, 0xD, 0x0, 0x7, 0x0, 0x88, 0xD, 0x0, 0x7, 0x0, 0xF8, 0xC, 0x0, 0x7, 0x0, 0xC8, 0x12, 0x0, 0x7, 0x0, 0xD0, 0x12, 0x0, 0x7, 0x0, 0xD8, 0x12, 0x0, 0x7, 0x0, 0xE0, 0x12, 0x0, 0x7, 0x0, 0xE8, 0x12, 0x0, 0x7, 0x0, 0xF0, 0x12, 0x0, 0x7, 0x0, 0xF8, 0x12, 0x0, 0x7, 0x0, 0x0, 0x13, 0x0, 0x7, 0x0, 0x8, 0x13, 0x0, 0x7, 0x0, 0x10, 0x13, 0x0, 0x7, 0x0, 0x18, 0x13, 0x0, 0x7, 0x0, 0x20, 0x13, 0x0, 0x7, 0x0, 0x28, 0x13, 0x0, 0x7, 0x0, 0x30, 0x13, 0x0, 0x7, 0x0, 0x38, 0x13, 0x0, 0x7, 0x0, 0x40, 0x13, 0x0, 0x7, 0x0, 0x48, 0x13, 0x0, 0x7, 0x0, 0x50, 0x13, 0x0, 0x7, 0x0, 0x58, 0x13, 0x0, 0x7, 0x0, 0x60, 0x13, 0x0, 0x7, 0x0, 0x68, 0x13, 0x0, 0x7, 0x0, 0x70, 0x13, 0x0, 0x7, 0x0, 0x78, 0x13, 0x0, 0x7, 0x0, 0x80, 0x13, 0x0, 0x7, 0x0, 0x88, 0x13, 0x0, 0x7, 0x0, 0x90, 0x13, 0x0, 0x7, 0x0, 0xB0, 0x10, 0x0, 0x7, 0x0, 0x98, 0x13, 0x0, 0x7, 0x0, 0xA0, 0x13, 0x0, 0x7, 0x0, 0xA8, 0x13, 0x0, 0x7, 0x0, 0xB0, 0x13, 0x0, 0x7, 0x0, 0xB8, 0x13, 0x0, 0x7, 0x0, 0xC0, 0x13, 0x0, 0x7, 0x0, 0xC8, 0x13, 0x0, 0x7, 0x0, 0xD0, 0x13, 0x0, 0x7, 0x0, 0xD8, 0x13, 0x0, 0x7, 0x0, 0xE0, 0x13, 0x0, 0x7, 0x0, 0xE8, 0x13, 0x0, 0x7, 0x0, 0xF0, 0x13, 0x0, 0x7, 0x0, 0xF8, 0x13, 0x0, 0x7, 0x0, 0x0, 0x14, 0x0, 0x7, 0x0, 0x8, 0x14, 0x0, 0x7, 0x0, 0x10, 0x14, 0x0, 0x7, 0x0, 0x18, 0x14, 0x0, 0x7, 0x0, 0x20, 0x14, 0x0, 0x7, 0x0, 0x28, 0x14, 0x0, 0x7, 0x0, 0x30, 0x14, 0x0, 0xE7, 0x50, 0x0, 0x0, 0x0, 0x7, 0x51, 0x0, 0x0, 0x0, 0x27, 0x51, 0x0, 0x0, 0x0, 0x47, 0x51, 0x0, 0x0, 0x0, 0x67, 0x51, 0x0, 0x0, 0x0, 0x87, 0x51, 0x0, 0x0, 0x0, 0xA7, 0x51, 0x0, 0x0, 0x0, 0xC7, 0x51, 0x0, 0x0, 0x0, 0xE7, 0x51, 0x0, 0x0, 0x0, 0x7, 0x52, 0x0, 0x0, 0x0, 0x27, 0x52, 0x0, 0x0, 0x0, 0x47, 0x52, 0x0, 0x0, 0x0, 0x67, 0x52, 0x0, 0x0, 0x0, 0x87, 0x52, 0x0, 0x0, 0x0, 0xA7, 0x52, 0x0, 0x0, 0x0, 0xC7, 0x52, 0x0, 0x0, 0x0, 0xE7, 0x52, 0x0, 0x0, 0x0, 0x7, 0x53, 0x0, 0x0, 0x0, 0x27, 0x53, 0x0, 0x0, 0x0, 0x47, 0x53, 0x0, 0x0, 0x0, 0x67, 0x53, 0x0, 0x0, 0x0, 0x87, 0x53, 0x0, 0x0, 0x0, 0xA7, 0x53, 0x0, 0x0, 0x0, 0xC7, 0x53, 0x0, 0x0, 0x0, 0xE7, 0x53, 0x0, 0x0, 0x0, 0x7, 0x54, 0x0, 0x0, 0x0, 0x27, 0x54, 0x0, 0x0, 0x0, 0x7, 0x0, 0x10, 0x15, 0x0, 0x7, 0x0, 0x18, 0x15, 0x0, 0x7, 0x0, 0x20, 0x15, 0x0, 0x7, 0x0, 0x28, 0x15, 0x0, 0x7, 0x0, 0x30, 0x15, 0x0, 0x7, 0x0, 0x38, 0x15, 0x0, 0x7, 0x0, 0x40, 0x15, 0x0, 0x7, 0x0, 0x48, 0x15, 0x0, 0x7, 0x0, 0x50, 0x15, 0x0, 0x7, 0x0, 0x58, 0x15, 0x0, 0x7, 0x0, 0x60, 0x15, 0x0, 0x7, 0x0, 0x68, 0x15, 0x0, 0x7, 0x0, 0x70, 0x15, 0x0, 0x7, 0x0, 0x78, 0x15, 0x0, 0x7, 0x0, 0x80, 0x15, 0x0, 0x7, 0x0, 0x88, 0x15, 0x0, 0x7, 0x0, 0x90, 0x15, 0x0, 0x7, 0x0, 0xF0, 0xD, 0x0, 0x67, 0x56, 0x0, 0x0, 0x0, 0x7, 0x0, 0x0, 0xE, 0x0, 0x7, 0x0, 0xA0, 0x15, 0x0, 0x7, 0x0, 0x40, 0xE, 0x0, 0xA7, 0x31, 0x0, 0x0, 0x0, 0xA7, 0x56, 0x0, 0x0, 0x0, 0x47, 0x41, 0x40, 0x10, 0x0, 0x67, 0x41, 0x48, 0x10, 0x0, 0xC7, 0x56, 0x0, 0x0, 0x0, 0xE7, 0x33, 0x50, 0x10, 0x0, 0x27, 0x34, 0x58, 0x10, 0x0, 0xE7, 0x56, 0x0, 0x0, 0x0, 0x7, 0x57, 0x0, 0x0, 0x0, 0xE7, 0x37, 0x70, 0x10, 0x0, 0x27, 0x38, 0x78, 0x10, 0x0, 0x27, 0x57, 0x0, 0x0, 0x0, 0x47, 0x57, 0x0, 0x0, 0x0, 0x67, 0x57, 0x0, 0x0, 0x0, 0xE7, 0x3B, 0x80, 0x10, 0x0, 0x27, 0x3C, 0x88, 0x10, 0x0, 0x67, 0x3C, 0x90, 0x10, 0x0, 0xA7, 0x3C, 0x98, 0x10, 0x0, 0x87, 0x57, 0x0, 0x0, 0x0, 0xC7, 0x33, 0xA0, 0x10, 0x0, 0x7, 0x34, 0xA8, 0x10, 0x0, 0xA7, 0x57, 0x0, 0x0, 0x0, 0xC7, 0x57, 0x0, 0x0, 0x0, 0xE7, 0x57, 0x0, 0x0, 0x0, 0x7, 0x58, 0x0, 0x0, 0x0, 0x27, 0x58, 0x0, 0x0, 0x0, 0x47, 0x58, 0x0, 0x0, 0x0, 0x67, 0x58, 0x0, 0x0, 0x0, 0x87, 0x58, 0x0, 0x0, 0x0, 0xA7, 0x58, 0x0, 0x0, 0x0, 0xC7, 0x58, 0x0, 0x0, 0x0, 0xE7, 0x58, 0x0, 0x0, 0x0, 0x7, 0x59, 0x0, 0x0, 0x0, 0x27, 0x59, 0x0, 0x0, 0x0, 0x47, 0x59, 0x0, 0x0, 0x0, 0x67, 0x59, 0x0, 0x0, 0x0, 0x87, 0x59, 0x0, 0x0, 0x0, 0xA7, 0x59, 0x0, 0x0, 0x0, 0xC7, 0x59, 0x0, 0x0, 0x0, 0xE7, 0x59, 0x0, 0x0, 0x0, 0x7, 0x5A, 0x0, 0x0, 0x0, 0x27, 0x5A, 0x0, 0x0, 0x0, 0x47, 0x5A, 0x0, 0x0, 0x0, 0x67, 0x5A, 0x0, 0x0, 0x0, 0x87, 0x5A, 0x0, 0x0, 0x0, 0xA7, 0x5A, 0x0, 0x0, 0x0, 0xC7, 0x5A, 0x0, 0x0, 0x0, 0x7, 0x0, 0xB8, 0x16, 0x0, 0x7, 0x0, 0xC0, 0x16, 0x0, 0x7, 0x0, 0xC8, 0x16, 0x0, 0x7, 0x0, 0xD0, 0x16, 0x0, 0x7, 0x0, 0xD8, 0x16, 0x0, 0x7, 0x0, 0xE0, 0x16, 0x0, 0x7, 0x0, 0xB8, 0x15, 0x0, 0x7, 0x0, 0xC0, 0x15, 0x0, 0x7, 0x0, 0xE8, 0x16, 0x0, 0x7, 0x0, 0xF0, 0x16, 0x0, 0x7, 0x0, 0xF8, 0x16, 0x0, 0x7, 0x0, 0xC8, 0x15, 0x0, 0x7, 0x0, 0x0, 0x17, 0x0, 0x7, 0x0, 0x8, 0x17, 0x0, 0x7, 0x0, 0x10, 0x17, 0x0, 0x7, 0x0, 0x18, 0x17, 0x0, 0x7, 0x0, 0x20, 0x17, 0x0, 0x7, 0x0, 0x28, 0x17, 0x0, 0x7, 0x0, 0x30, 0x17, 0x0, 0x7, 0x0, 0x38, 0x17, 0x0, 0x7, 0x0, 0x40, 0x17, 0x0, 0x7, 0x0, 0x48, 0x17, 0x0, 0x7, 0x0, 0x50, 0x17, 0x0, 0x7, 0x0, 0x58, 0x17, 0x0, 0x7, 0x0, 0xE8, 0x15, 0x0, 0x7, 0x0, 0xF0, 0x15, 0x0, 0x7, 0x0, 0xF8, 0x15, 0x0, 0x7, 0x0, 0x0, 0x16, 0x0, 0x7, 0x0, 0x8, 0x16, 0x0, 0x7, 0x0, 0x10, 0x16, 0x0, 0x7, 0x0, 0x18, 0x16, 0x0, 0x7, 0x0, 0x20, 0x16, 0x0, 0x7, 0x0, 0x28, 0x16, 0x0, 0x7, 0x0, 0x30, 0x16, 0x0, 0x7, 0x0, 0x48, 0x16, 0x0, 0x7, 0x0, 0x50, 0x16, 0x0, 0x7, 0x0, 0x58, 0x16, 0x0, 0x7, 0x0, 0x60, 0x16, 0x0, 0x7, 0x0, 0x68, 0x16, 0x0, 0x7, 0x0, 0x70, 0x16, 0x0, 0x7, 0x0, 0x78, 0x16, 0x0, 0x7, 0x0, 0x80, 0x16, 0x0, 0x7, 0x0, 0x88, 0x16, 0x0, 0x7, 0x0, 0x90, 0x16, 0x0, 0x7, 0x0, 0x98, 0x16, 0x0, 0x7, 0x0, 0xA0, 0x16, 0x0, 0x7, 0x0, 0xA8, 0x16, 0x0, 0x7, 0x0, 0xB0, 0x16, 0x0, 0xE7, 0x45, 0x0, 0x0, 0x0, 0x87, 0x5D, 0x0, 0x0, 0x0, 0xA7, 0x5D, 0x0, 0x0, 0x0, 0xC7, 0x5D, 0x0, 0x0, 0x0, 0xE7, 0x5D, 0x0, 0x0, 0x0, 0x7, 0x5E, 0x0, 0x0, 0x0, 0x27, 0x5E, 0x0, 0x0, 0x0, 0x47, 0x46, 0x0, 0x0, 0x0, 0x67, 0x46, 0x0, 0x0, 0x0, 0x87, 0x46, 0x0, 0x0, 0x0, 0xA7, 0x46, 0x0, 0x0, 0x0, 0xC7, 0x46, 0x0, 0x0, 0x0, 0xE7, 0x46, 0x0, 0x0, 0x0, 0x7, 0x0, 0x60, 0x17, 0x0, 0x7, 0x0, 0x68, 0x17, 0x0, 0x7, 0x0, 0x70, 0x17, 0x0, 0x7, 0x0, 0x78, 0x17, 0x0, 0x7, 0x0, 0x80, 0x17, 0x0, 0x7, 0x0, 0x88, 0x17, 0x0, 0x7, 0x0, 0xA8, 0x12, 0x0, 0x7, 0x0, 0x10, 0x11, 0x0, 0x7, 0x0, 0x18, 0x11, 0x0, 0x7, 0x0, 0x20, 0x11, 0x0, 0x7, 0x0, 0x28, 0x11, 0x0, 0x7, 0x0, 0x30, 0x11, 0x0, 0x7, 0x0, 0x38, 0x11, 0x0, 0x7, 0x0, 0x68, 0x12, 0x0, 0x7, 0x0, 0x40, 0x11, 0x0, 0x7, 0x0, 0x48, 0x11, 0x0, 0x7, 0x0, 0x70, 0x12, 0x0, 0x7, 0x0, 0x78, 0x12, 0x0, 0x7, 0x0, 0x80, 0x12, 0x0, 0x7, 0x0, 0x88, 0x12, 0x0, 0x7, 0x0, 0x58, 0x11, 0x0, 0x7, 0x0, 0x60, 0x11, 0x0, 0x7, 0x0, 0x68, 0x11, 0x0, 0x7, 0x0, 0x70, 0x11, 0x0, 0xC7, 0x40, 0x0, 0x0, 0x0, 0xE7, 0x40, 0x0, 0x0, 0x0, 0x7, 0x41, 0x0, 0x0, 0x0, 0x67, 0x41, 0x0, 0x0, 0x0, 0x87, 0x41, 0x0, 0x0, 0x0, 0xA7, 0x41, 0x0, 0x0, 0x0, 0xC7, 0x41, 0x0, 0x0, 0x0, 0xE7, 0x41, 0x0, 0x0, 0x0, 0x7, 0x42, 0x0, 0x0, 0x0, 0x27, 0x42, 0x0, 0x0, 0x0, 0x47, 0x42, 0x0, 0x0, 0x0, 0x67, 0x42, 0x0, 0x0, 0x0, 0x87, 0x42, 0x0, 0x0, 0x0, 0xA7, 0x42, 0x0, 0x0, 0x0, 0x47, 0x5E, 0x0, 0x0, 0x0, 0x67, 0x5E, 0x0, 0x0, 0x0, 0x87, 0x5E, 0x0, 0x0, 0x0, 0xA7, 0x5E, 0x0, 0x0, 0x0, 0xC7, 0x5E, 0x0, 0x0, 0x0, 0xE7, 0x5E, 0x0, 0x0, 0x0, 0xE7, 0x3F, 0x48, 0xE, 0x0, 0x7, 0x40, 0x58, 0xE, 0x0, 0x27, 0x40, 0x68, 0xE, 0x0, 0x47, 0x40, 0x78, 0xE, 0x0, 0x67, 0x40, 0x88, 0xE, 0x0, 0x87, 0x40, 0x98, 0xE, 0x0, 0xA7, 0x40, 0xA8, 0xE, 0x0, 0x7, 0x0, 0xC0, 0x17, 0x0, 0x7, 0x0, 0xC8, 0x17, 0x0, 0x7, 0x0, 0xD0, 0x17, 0x0, 0x7, 0x0, 0xD8, 0x17, 0x0, 0x7, 0x0, 0xE0, 0x17, 0x0, 0x7, 0x0, 0xE8, 0x17, 0x0, 0x7, 0x0, 0xF0, 0x17, 0x0, 0x7, 0x0, 0xF8, 0x17, 0x0, 0x7, 0x0, 0x0, 0x18, 0x0, 0x7, 0x0, 0x8, 0x18, 0x0, 0x7, 0x0, 0x10, 0x18, 0x0, 0x7, 0x0, 0x18, 0x18, 0x0, 0x7, 0x0, 0x20, 0x18, 0x0, 0x7, 0x0, 0x28, 0x18, 0x0, 0x7, 0x0, 0x30, 0x18, 0x0, 0x7, 0x0, 0x38, 0x18, 0x0, 0x7, 0x0, 0x40, 0x18, 0x0, 0x7, 0x0, 0x48, 0x18, 0x0, 0x7, 0x0, 0x50, 0x18, 0x0, 0x7, 0x0, 0x58, 0x18, 0x0, 0x7, 0x0, 0x60, 0x18, 0x0, 0x7, 0x0, 0x68, 0x18, 0x0, 0x7, 0x0, 0x70, 0x18, 0x0, 0x7, 0x0, 0x78, 0x18, 0x0, 0x7, 0x0, 0x80, 0x18, 0x0, 0x7, 0x0, 0x88, 0x18, 0x0, 0x7, 0x0, 0x90, 0x18, 0x0, 0x7, 0x0, 0x98, 0x18, 0x0, 0x7, 0x0, 0xA0, 0x18, 0x0, 0x7, 0x0, 0xA8, 0x18, 0x0, 0x7, 0x0, 0xB0, 0x18, 0x0, 0xE7, 0x62, 0x0, 0x0, 0x0, 0x7, 0x63, 0x0, 0x0, 0x0, 0x27, 0x63, 0x0, 0x0, 0x0, 0x47, 0x63, 0x0, 0x0, 0x0, 0x67, 0x63, 0x0, 0x0, 0x0, 0x87, 0x63, 0x0, 0x0, 0x0, 0xA7, 0x63, 0x0, 0x0, 0x0, 0xC7, 0x63, 0x0, 0x0, 0x0, 0x7, 0x0, 0xF8, 0x18, 0x0, 0x7, 0x0, 0x0, 0x19, 0x0, 0x7, 0x0, 0x8, 0x19, 0x0, 0x7, 0x0, 0x10, 0x19, 0x0, 0x7, 0x0, 0x18, 0x19, 0x0, 0x7, 0x0, 0x20, 0x19, 0x0, 0x7, 0x0, 0x28, 0x19, 0x0, 0x7, 0x0, 0x30, 0x19, 0x0, 0x7, 0x0, 0x38, 0x19, 0x0, 0x7, 0x0, 0x40, 0x19, 0x0, 0x7, 0x0, 0x48, 0x19, 0x0, 0x7, 0x0, 0x50, 0x19, 0x0, 0x7, 0x0, 0x58, 0x19, 0x0, 0x7, 0x0, 0x60, 0x19, 0x0, 0x7, 0x0, 0x68, 0x19, 0x0, 0x7, 0x0, 0x70, 0x19, 0x0, 0x7, 0x0, 0x78, 0x19, 0x0, 0x7, 0x0, 0x80, 0x19, 0x0, 0x7, 0x0, 0x88, 0x19, 0x0, 0x7, 0x0, 0x90, 0x19, 0x0, 0x7, 0x0, 0x98, 0x19, 0x0, 0x7, 0x0, 0xA0, 0x19, 0x0, 0x7, 0x0, 0xA8, 0x19, 0x0, 0x7, 0x0, 0xB0, 0x19, 0x0, 0x7, 0x0, 0xB8, 0x19, 0x0, 0x7, 0x0, 0xC0, 0x19, 0x0, 0x7, 0x0, 0xC8, 0x19, 0x0, 0x7, 0x0, 0xD0, 0x19, 0x0, 0x7, 0x0, 0xD8, 0x19, 0x0, 0x7, 0x0, 0xE0, 0x19, 0x0, 0x7, 0x0, 0xE8, 0x19, 0x0, 0x7, 0x0, 0xF0, 0x19, 0x0, 0x7, 0x0, 0xF8, 0x19, 0x0, 0xC7, 0x40, 0x40, 0x10, 0x0, 0xE7, 0x40, 0x48, 0x10, 0x0, 0x7, 0x41, 0x50, 0x10, 0x0, 0x7, 0x68, 0x0, 0x0, 0x0, 0x27, 0x68, 0x0, 0x0, 0x0, 0x47, 0x68, 0x0, 0x0, 0x0, 0x47, 0x42, 0x30, 0x10, 0x0, 0x67, 0x68, 0x0, 0x0, 0x0, 0x87, 0x68, 0x0, 0x0, 0x0, 0xA7, 0x68, 0x0, 0x0, 0x0, 0x27, 0x18, 0x0, 0x0, 0x0, 0x67, 0x31, 0x0, 0x0, 0x0, 0x87, 0x31, 0x0, 0x0, 0x0, 0xC7, 0x31, 0x0, 0x0, 0x0, 0xE7, 0x31, 0x0, 0x0, 0x0, 0x7, 0x32, 0x0, 0x0, 0x0, 0x27, 0x32, 0x0, 0x0, 0x0, 0x47, 0x32, 0x0, 0x0, 0x0, 0x67, 0x32, 0x0, 0x0, 0x0, 0xA7, 0x32, 0x0, 0x0, 0x0, 0xE7, 0x65, 0x0, 0x0, 0x0, 0x7, 0x66, 0x0, 0x0, 0x0, 0x27, 0x66, 0x0, 0x0, 0x0, 0x47, 0x66, 0x0, 0x0, 0x0, 0x67, 0x66, 0x0, 0x0, 0x0, 0x87, 0x66, 0x0, 0x0, 0x0, 0xA7, 0x66, 0x0, 0x0, 0x0, 0xC7, 0x66, 0x0, 0x0, 0x0, 0x7, 0x67, 0x0, 0x0, 0x0, 0x27, 0x67, 0x0, 0x0, 0x0, 0x47, 0x67, 0x0, 0x0, 0x0, 0x67, 0x67, 0x0, 0x0, 0x0, 0x87, 0x67, 0x0, 0x0, 0x0, 0xA7, 0x67, 0x0, 0x0, 0x0, 0xC7, 0x67, 0x0, 0x0, 0x0, 0xC7, 0x68, 0x0, 0x0, 0x0, 0xE7, 0x68, 0x0, 0x0, 0x0, 0x7, 0x69, 0x0, 0x0, 0x0, 0x27, 0x69, 0x0, 0x0, 0x0, 0x27, 0x3F, 0x58, 0xF, 0x0, 0x87, 0x3F, 0x68, 0xF, 0x0, 0x7, 0x0, 0x18, 0xD, 0x0, 0x7, 0x0, 0x28, 0xD, 0x0, 0x7, 0x0, 0xA8, 0xD, 0x0, 0x7, 0x0, 0xF8, 0xD, 0x0, 0x7, 0x0, 0x18, 0xE, 0x0, 0x7, 0x0, 0x38, 0xE, 0x0, 0x7, 0x0, 0x48, 0xE, 0x0, 0x7, 0x0, 0x68, 0xE, 0x0, 0x7, 0x0, 0x78, 0xF, 0x0, 0x7, 0x0, 0xF0, 0x18, 0x0, 0x7, 0x0, 0xD0, 0xC, 0x0, 0x7, 0x0, 0x50, 0x1A, 0x0, 0x67, 0x69, 0x0, 0x0, 0x0, 0x87, 0x69, 0x0, 0x0, 0x0, 0xA7, 0x69, 0x0, 0x0, 0x0, 0xC7, 0x69, 0x0, 0x0, 0x0, 0xE7, 0x69, 0x0, 0x0, 0x0, 0x7, 0x6A, 0x0, 0x0, 0x0, 0x27, 0x6A, 0x0, 0x0, 0x0, 0x47, 0x6A, 0x0, 0x0, 0x0, 0x67, 0x6A, 0x0, 0x0, 0x0, 0x87, 0x6A, 0x0, 0x0, 0x0, 0xA7, 0x6A, 0x0, 0x0, 0x0, 0xC7, 0x6A, 0x0, 0x0, 0x0, 0xE7, 0x6A, 0x0, 0x0, 0x0, 0x7, 0x6B, 0x0, 0x0, 0x0, 0x27, 0x6B, 0x0, 0x0, 0x0, 0x47, 0x6B, 0x0, 0x0, 0x0, 0x67, 0x6B, 0x0, 0x0, 0x0, 0x87, 0x6B, 0x0, 0x0, 0x0, 0xA7, 0x6B, 0x0, 0x0, 0x0, 0xC7, 0x6B, 0x0, 0x0, 0x0, 0x7, 0x0, 0xF8, 0x1A, 0x0, 0x7, 0x0, 0xD8, 0x18, 0x0, 0x7, 0x0, 0xE0, 0x18, 0x0, 0x7, 0x0, 0xE8, 0x18, 0x0, 0x7, 0x0, 0x0, 0x1B, 0x0, 0x7, 0x0, 0x8, 0x1B, 0x0, 0x7, 0x0, 0x10, 0x1B, 0x0, 0x7, 0x0, 0xA0, 0xD, 0x0, 0x7, 0x0, 0x18, 0x1B, 0x0, 0x87, 0x6C, 0x0, 0x0, 0x0, 0xA7, 0x6C, 0x0, 0x0, 0x0, 0xC7, 0x6C, 0x0, 0x0, 0x0, 0xE7, 0x6C, 0x0, 0x0, 0x0, 0x7, 0x6D, 0x0, 0x0, 0x0, 0x27, 0x6D, 0x0, 0x0, 0x0, 0x47, 0x6D, 0x0, 0x0, 0x0, 0x67, 0x6D, 0x0, 0x0, 0x0, 0x87, 0x6D, 0x0, 0x0, 0x0, 0xA7, 0x6D, 0x0, 0x0, 0x0, 0xC7, 0x6D, 0x0, 0x0, 0x0, 0xE7, 0x6D, 0x0, 0x0, 0x0, 0x7, 0x6E, 0x0, 0x0, 0x0, 0x27, 0x6E, 0x0, 0x0, 0x0, 0x47, 0x6E, 0x0, 0x0, 0x0, 0x67, 0x6E, 0x0, 0x0, 0x0, 0x87, 0x6E, 0x0, 0x0, 0x0, 0xA7, 0x6E, 0x0, 0x0, 0x0, 0x87, 0x56, 0x0, 0x0, 0x0, 0xC7, 0x6E, 0x0, 0x0, 0x0, 0x67, 0x6C, 0x0, 0x0, 0x0, 0xE7, 0x6E, 0x0, 0x0, 0x0, 0x7, 0x6F, 0x0, 0x0, 0x0, 0x27, 0x6F, 0x0, 0x0, 0x0, 0x47, 0x6F, 0x0, 0x0, 0x0, 0x67, 0x6F, 0x0, 0x0, 0x0, 0x87, 0x6F, 0x0, 0x0, 0x0, 0xA7, 0x6F, 0x0, 0x0, 0x0, 0xC7, 0x6F, 0x0, 0x0, 0x0, 0x7, 0x0, 0x40, 0x1B, 0x0, 0x7, 0x0, 0x48, 0x1B, 0x0, 0x7, 0x0, 0x50, 0x1B, 0x0, 0x7, 0x0, 0xF8, 0x1B, 0x0, 0x7, 0x0, 0x58, 0x1B, 0x0, 0x7, 0x0, 0x60, 0x1B, 0x0, 0x7, 0x0, 0x68, 0x1B, 0x0, 0x7, 0x0, 0x70, 0x1B, 0x0, 0x7, 0x0, 0x78, 0x1B, 0x0, 0x7, 0x0, 0x80, 0x1B, 0x0, 0x7, 0x0, 0x88, 0x1B, 0x0, 0x7, 0x0, 0x90, 0x1B, 0x0, 0x7, 0x0, 0x98, 0x1B, 0x0, 0x7, 0x0, 0xA0, 0x1B, 0x0, 0x7, 0x0, 0xA8, 0x1B, 0x0, 0x7, 0x0, 0xB0, 0x1B, 0x0, 0x7, 0x0, 0xB8, 0x1B, 0x0, 0x7, 0x0, 0xC0, 0x1B, 0x0, 0x7, 0x0, 0xC8, 0x1B, 0x0, 0x7, 0x0, 0x98, 0x15, 0x0, 0x7, 0x0, 0xD0, 0x1B, 0x0, 0x7, 0x0, 0xD8, 0x1B, 0x0, 0x7, 0x0, 0xE0, 0x1B, 0x0, 0x7, 0x0, 0xE8, 0x1B, 0x0, 0x8, 0x70, 0x0, 0x0, 0x0, 0x28, 0x70, 0x0, 0x0, 0x0, 0x48, 0x70, 0x0, 0x0, 0x0, 0x68, 0x70, 0x0, 0x0, 0x0, 0x88, 0x70, 0x0, 0x0, 0x0, 0xA8, 0x70, 0x0, 0x0, 0x0, 0xC8, 0x70, 0x0, 0x0, 0x0, 0xE8, 0x70, 0x0, 0x0, 0x0, 0x8, 0x71, 0x0, 0x0, 0x0, 0x28, 0x71, 0x0, 0x0, 0x0, 0x48, 0x71, 0x0, 0x0, 0x0, 0x68, 0x71, 0x0, 0x0, 0x0, 0x88, 0x71, 0x0, 0x0, 0x0, 0xA8, 0x71, 0x0, 0x0, 0x0, 0xC8, 0x71, 0x0, 0x0, 0x0, 0xE8, 0x71, 0x0, 0x0, 0x0, 0x8, 0x72, 0x0, 0x0, 0x0, 0x28, 0x72, 0x0, 0x0, 0x0, 0x48, 0x72, 0x0, 0x0, 0x0, 0x68, 0x72, 0x0, 0x0, 0x0, 0x88, 0x72, 0x0, 0x0, 0x0, 0xA8, 0x72, 0x0, 0x0, 0x0, 0xC8, 0x72, 0x0, 0x0, 0x0, 0xE8, 0x72, 0x0, 0x0, 0x0, 0x8, 0x73, 0x0, 0x0, 0x0, 0x28, 0x73, 0x0, 0x0, 0x0, 0x48, 0x73, 0x0, 0x0, 0x0, 0x68, 0x73, 0x0, 0x0, 0x0, 0x88, 0x73, 0x0, 0x0, 0x0, 0xA8, 0x73, 0x0, 0x0, 0x0, 0xC8, 0x73, 0x0, 0x0, 0x0, 0xE8, 0x73, 0x0, 0x0, 0x0, 0x8, 0x74, 0x0, 0x0, 0x0, 0x28, 0x74, 0x0, 0x0, 0x0, 0x48, 0x74, 0x0, 0x0, 0x0, 0x68, 0x74, 0x0, 0x0, 0x0, 0x88, 0x74, 0x0, 0x0, 0x0, 0xA8, 0x74, 0x0, 0x0, 0x0, 0xC8, 0x74, 0x0, 0x0, 0x0, 0xE8, 0x74, 0x0, 0x0, 0x0, 0x8, 0x75, 0x0, 0x0, 0x0, 0x28, 0x75, 0x0, 0x0, 0x0, 0x48, 0x75, 0x0, 0x0, 0x0, 0x68, 0x75, 0x0, 0x0, 0x0, 0x88, 0x75, 0x0, 0x0, 0x0, 0xA8, 0x75, 0x0, 0x0, 0x0, 0xC8, 0x75, 0x0, 0x0, 0x0, 0xE8, 0x75, 0x0, 0x0, 0x0, 0x8, 0x76, 0x0, 0x0, 0x0, 0x28, 0x76, 0x0, 0x0, 0x0, 0x48, 0x76, 0x0, 0x0, 0x0, 0x68, 0x76, 0x0, 0x0, 0x0, 0x88, 0x76, 0x0, 0x0, 0x0, 0xA8, 0x76, 0x0, 0x0, 0x0, 0xC8, 0x76, 0x0, 0x0, 0x0, 0xE8, 0x76, 0x0, 0x0, 0x0, 0x8, 0x77, 0x0, 0x0, 0x0, 0x28, 0x77, 0x0, 0x0, 0x0, 0x48, 0x77, 0x0, 0x0, 0x0, 0x68, 0x77, 0x0, 0x0, 0x0, 0x88, 0x77, 0x0, 0x0, 0x0, 0xA8, 0x77, 0x0, 0x0, 0x0, 0xC8, 0x77, 0x0, 0x0, 0x0, 0xE8, 0x77, 0x0, 0x0, 0x0, 0x8, 0x78, 0x0, 0x0, 0x0, 0x28, 0x78, 0x0, 0x0, 0x0, 0x48, 0x78, 0x0, 0x0, 0x0, 0x68, 0x78, 0x0, 0x0, 0x0, 0x88, 0x78, 0x0, 0x0, 0x0, 0xA8, 0x78, 0x0, 0x0, 0x0, 0xC8, 0x78, 0x0, 0x0, 0x0, 0xE8, 0x78, 0x0, 0x0, 0x0, 0x8, 0x79, 0x0, 0x0, 0x0, 0x28, 0x79, 0x0, 0x0, 0x0, 0x48, 0x79, 0x0, 0x0, 0x0, 0x68, 0x79, 0x0, 0x0, 0x0, 0x88, 0x79, 0x0, 0x0, 0x0, 0xA8, 0x79, 0x0, 0x0, 0x0, 0xC8, 0x79, 0x0, 0x0, 0x0, 0xE8, 0x79, 0x0, 0x0, 0x0, 0x8, 0x7A, 0x0, 0x0, 0x0, 0x28, 0x7A, 0x0, 0x0, 0x0, 0x48, 0x7A, 0x0, 0x0, 0x0, 0x68, 0x7A, 0x0, 0x0, 0x0, 0x88, 0x7A, 0x0, 0x0, 0x0, 0xA8, 0x7A, 0x0, 0x0, 0x0, 0xC8, 0x7A, 0x0, 0x0, 0x0, 0xE8, 0x7A, 0x0, 0x0, 0x0, 0x8, 0x7B, 0x0, 0x0, 0x0, 0x28, 0x7B, 0x0, 0x0, 0x0, 0x48, 0x7B, 0x0, 0x0, 0x0, 0x68, 0x7B, 0x0, 0x0, 0x0, 0x88, 0x7B, 0x0, 0x0, 0x0, 0xA8, 0x7B, 0x0, 0x0, 0x0, 0xC8, 0x7B, 0x0, 0x0, 0x0, 0xE8, 0x7B, 0x0, 0x0, 0x0, 0x8, 0x7C, 0x0, 0x0, 0x0, 0x28, 0x7C, 0x0, 0x0, 0x0, 0x48, 0x7C, 0x0, 0x0, 0x0, 0x68, 0x7C, 0x0, 0x0, 0x0, 0x88, 0x7C, 0x0, 0x0, 0x0, 0xA8, 0x7C, 0x0, 0x0, 0x0, 0xC8, 0x7C, 0x0, 0x0, 0x0, 0xE8, 0x7C, 0x0, 0x0, 0x0, 0x8, 0x7D, 0x0, 0x0, 0x0, 0x28, 0x7D, 0x0, 0x0, 0x0, 0x48, 0x7D, 0x0, 0x0, 0x0, 0x68, 0x7D, 0x0, 0x0, 0x0, 0x88, 0x7D, 0x0, 0x0, 0x0, 0xA8, 0x7D, 0x0, 0x0, 0x0, 0xC8, 0x7D, 0x0, 0x0, 0x0, 0xE8, 0x7D, 0x0, 0x0, 0x0, 0x8, 0x7E, 0x0, 0x0, 0x0, 0x28, 0x7E, 0x0, 0x0, 0x0, 0x48, 0x7E, 0x0, 0x0, 0x0, 0x68, 0x7E, 0x0, 0x0, 0x0, 0x88, 0x7E, 0x0, 0x0, 0x0, 0xA8, 0x7E, 0x0, 0x0, 0x0, 0xC8, 0x7E, 0x0, 0x0, 0x0, 0xE8, 0x7E, 0x0, 0x0, 0x0, 0x8, 0x7F, 0x0, 0x0, 0x0, 0x28, 0x7F, 0x0, 0x0, 0x0, 0x48, 0x7F, 0x0, 0x0, 0x0, 0x68, 0x7F, 0x0, 0x0, 0x0, 0x88, 0x7F, 0x0, 0x0, 0x0, 0xA8, 0x7F, 0x0, 0x0, 0x0, 0xC8, 0x7F, 0x0, 0x0, 0x0, 0xE8, 0x7F, 0x0, 0x0, 0x0, 0x8, 0x80, 0x0, 0x0, 0x0, 0x28, 0x80, 0x0, 0x0, 0x0, 0x48, 0x80, 0x0, 0x0, 0x0, 0x68, 0x80, 0x0, 0x0, 0x0, 0x88, 0x80, 0x0, 0x0, 0x0, 0xA8, 0x80, 0x0, 0x0, 0x0, 0xC8, 0x80, 0x0, 0x0, 0x0, 0xE8, 0x80, 0x0, 0x0, 0x0, 0x8, 0x81, 0x0, 0x0, 0x0, 0x28, 0x81, 0x0, 0x0, 0x0, 0x48, 0x81, 0x0, 0x0, 0x0, 0x68, 0x81, 0x0, 0x0, 0x0, 0x88, 0x81, 0x0, 0x0, 0x0, 0xA8, 0x81, 0x0, 0x0, 0x0, 0xC8, 0x81, 0x0, 0x0, 0x0, 0xE8, 0x81, 0x0, 0x0, 0x0, 0x8, 0x82, 0x0, 0x0, 0x0, 0x28, 0x82, 0x0, 0x0, 0x0, 0x48, 0x82, 0x0, 0x0, 0x0, 0x68, 0x82, 0x0, 0x0, 0x0, 0x88, 0x82, 0x0, 0x0, 0x0, 0xA8, 0x82, 0x0, 0x0, 0x0, 0xC8, 0x82, 0x0, 0x0, 0x0, 0xE8, 0x82, 0x0, 0x0, 0x0, 0x8, 0x83, 0x0, 0x0, 0x0, 0x28, 0x83, 0x0, 0x0, 0x0, 0x48, 0x83, 0x0, 0x0, 0x0, 0x8, 0x0, 0x38, 0x20, 0x0, 0x68, 0x83, 0x0, 0x0, 0x0, 0x88, 0x83, 0x0, 0x0, 0x0, 0xA8, 0x83, 0x0, 0x0, 0x0, 0xC8, 0x83, 0x0, 0x0, 0x0, 0xE8, 0x83, 0x0, 0x0, 0x0, 0x8, 0x84, 0x0, 0x0, 0x0, 0x28, 0x84, 0x0, 0x0, 0x0, 0x48, 0x84, 0x0, 0x0, 0x0, 0x8, 0x0, 0xF0, 0x1E, 0x0, 0x8, 0x0, 0x10, 0x20, 0x0, 0x8, 0x0, 0xE0, 0x1E, 0x0, 0x8, 0x0, 0x18, 0x21, 0x0, 0x8, 0x0, 0x20, 0x21, 0x0, 0x8, 0x0, 0x28, 0x21, 0x0, 0x8, 0x0, 0x30, 0x21, 0x0, 0x8, 0x0, 0x38, 0x21, 0x0, 0x8, 0x85, 0x0, 0x0, 0x0, 0x28, 0x85, 0x0, 0x0, 0x0, 0x48, 0x85, 0x0, 0x0, 0x0, 0x68, 0x85, 0x0, 0x0, 0x0, 0x88, 0x85, 0x0, 0x0, 0x0, 0xA8, 0x85, 0x0, 0x0, 0x0, 0xC8, 0x85, 0x0, 0x0, 0x0, 0xE8, 0x85, 0x0, 0x0, 0x0, 0x8, 0x86, 0x0, 0x0, 0x0, 0x28, 0x86, 0x0, 0x0, 0x0, 0x48, 0x86, 0x0, 0x0, 0x0, 0x68, 0x86, 0x0, 0x0, 0x0, 0x8, 0x0, 0xA0, 0x21, 0x0, 0xA8, 0x86, 0x0, 0x0, 0x0, 0xC8, 0x86, 0x0, 0x0, 0x0, 0xE8, 0x86, 0x0, 0x0, 0x0, 0x8, 0x87, 0x0, 0x0, 0x0, 0x28, 0x87, 0x0, 0x0, 0x0, 0x48, 0x87, 0x0, 0x0, 0x0, 0x68, 0x87, 0x0, 0x0, 0x0, 0x88, 0x87, 0x0, 0x0, 0x0, 0xA8, 0x87, 0x0, 0x0, 0x0, 0xC8, 0x87, 0x0, 0x0, 0x0, 0xE8, 0x87, 0x0, 0x0, 0x0, 0x8, 0x88, 0x0, 0x0, 0x0, 0x28, 0x88, 0x0, 0x0, 0x0, 0x48, 0x88, 0x0, 0x0, 0x0, 0x68, 0x88, 0x0, 0x0, 0x0, 0x88, 0x88, 0x0, 0x0, 0x0, 0xA8, 0x88, 0x0, 0x0, 0x0, 0xC8, 0x88, 0x0, 0x0, 0x0, 0xE8, 0x88, 0x0, 0x0, 0x0, 0x8, 0x89, 0x0, 0x0, 0x0, 0x28, 0x89, 0x0, 0x0, 0x0, 0x48, 0x89, 0x0, 0x0, 0x0, 0x68, 0x89, 0x0, 0x0, 0x0, 0x88, 0x89, 0x0, 0x0, 0x0, 0xA8, 0x89, 0x0, 0x0, 0x0, 0xC8, 0x89, 0x0, 0x0, 0x0, 0xE8, 0x89, 0x0, 0x0, 0x0, 0x8, 0x8A, 0x0, 0x0, 0x0, 0x28, 0x8A, 0x0, 0x0, 0x0, 0x48, 0x8A, 0x0, 0x0, 0x0, 0x68, 0x8A, 0x0, 0x0, 0x0, 0x88, 0x8A, 0x0, 0x0, 0x0, 0xA8, 0x8A, 0x0, 0x0, 0x0, 0xC8, 0x8A, 0x0, 0x0, 0x0, 0xE8, 0x8A, 0x0, 0x0, 0x0, 0x8, 0x8B, 0x0, 0x0, 0x0, 0x28, 0x8B, 0x0, 0x0, 0x0, 0x48, 0x8B, 0x0, 0x0, 0x0, 0x68, 0x8B, 0x0, 0x0, 0x0, 0x88, 0x8B, 0x0, 0x0, 0x0, 0xA8, 0x8B, 0x0, 0x0, 0x0, 0xC8, 0x8B, 0x0, 0x0, 0x0, 0xE8, 0x8B, 0x0, 0x0, 0x0, 0x8, 0x8C, 0x0, 0x0, 0x0, 0x28, 0x8C, 0x0, 0x0, 0x0, 0x48, 0x8C, 0x0, 0x0, 0x0, 0x8, 0x0, 0x78, 0x21, 0x0, 0x8, 0x0, 0x80, 0x21, 0x0, 0x8, 0x0, 0x88, 0x21, 0x0, 0x8, 0x0, 0x18, 0x23, 0x0, 0x8, 0x0, 0x90, 0x21, 0x0, 0x8, 0x0, 0x98, 0x21, 0x0, 0x8, 0x0, 0x20, 0x23, 0x0, 0x8, 0x0, 0x28, 0x23, 0x0, 0x8, 0x0, 0x30, 0x23, 0x0, 0x8, 0x0, 0x38, 0x23, 0x0, 0x8, 0x0, 0xB0, 0x21, 0x0, 0x8, 0x0, 0xB8, 0x21, 0x0, 0x8, 0x0, 0xC0, 0x21, 0x0, 0x8, 0x0, 0xC8, 0x21, 0x0, 0x8, 0x0, 0xF0, 0x21, 0x0, 0x8, 0x0, 0xF8, 0x21, 0x0, 0x8, 0x0, 0x0, 0x22, 0x0, 0x8, 0x0, 0x8, 0x22, 0x0, 0x8, 0x0, 0x10, 0x22, 0x0, 0x8, 0x0, 0x18, 0x22, 0x0, 0x8, 0x0, 0x20, 0x22, 0x0, 0x8, 0x0, 0x28, 0x22, 0x0, 0x8, 0x0, 0x30, 0x22, 0x0, 0x8, 0x0, 0x38, 0x22, 0x0, 0x8, 0x0, 0x40, 0x22, 0x0, 0x8, 0x0, 0x48, 0x22, 0x0, 0x8, 0x0, 0x50, 0x22, 0x0, 0x8, 0x0, 0x58, 0x22, 0x0, 0x8, 0x0, 0x60, 0x22, 0x0, 0x8, 0x0, 0x68, 0x22, 0x0, 0x8, 0x0, 0x70, 0x22, 0x0, 0x8, 0x0, 0x78, 0x22, 0x0, 0x8, 0x0, 0x80, 0x22, 0x0, 0x8, 0x0, 0x88, 0x22, 0x0, 0x8, 0x0, 0x90, 0x22, 0x0, 0x8, 0x0, 0x98, 0x22, 0x0, 0x8, 0x0, 0xA0, 0x22, 0x0, 0x8, 0x8D, 0x0, 0x0, 0x0, 0x8, 0x0, 0xF8, 0x1E, 0x0, 0x28, 0x8D, 0x0, 0x0, 0x0, 0x8, 0x0, 0x58, 0x1F, 0x0, 0x48, 0x8D, 0x0, 0x0, 0x0, 0x8, 0x0, 0x78, 0x1F, 0x0, 0x68, 0x8D, 0x0, 0x0, 0x0, 0x8, 0x0, 0x88, 0x1F, 0x0, 0x88, 0x8D, 0x0, 0x0, 0x0, 0x8, 0x0, 0x98, 0x1F, 0x0, 0xA8, 0x8D, 0x0, 0x0, 0x0, 0x8, 0x0, 0xA8, 0x1F, 0x0, 0xC8, 0x8D, 0x0, 0x0, 0x0, 0x8, 0x0, 0xB8, 0x1F, 0x0, 0xE8, 0x8D, 0x0, 0x0, 0x0, 0x8, 0x0, 0xC8, 0x1F, 0x0, 0x8, 0x8E, 0x0, 0x0, 0x0, 0x8, 0x0, 0xD0, 0x1C, 0x0, 0x28, 0x8E, 0x0, 0x0, 0x0, 0x8, 0x0, 0xE0, 0x1C, 0x0, 0x48, 0x8E, 0x0, 0x0, 0x0, 0x8, 0x0, 0xF0, 0x1C, 0x0, 0x68, 0x8E, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x1D, 0x0, 0x88, 0x8E, 0x0, 0x0, 0x0, 0x8, 0x0, 0x10, 0x1D, 0x0, 0xA8, 0x8E, 0x0, 0x0, 0x0, 0x8, 0x0, 0x20, 0x1D, 0x0, 0xC8, 0x8E, 0x0, 0x0, 0x0, 0x8, 0x0, 0x30, 0x1D, 0x0, 0xE8, 0x8E, 0x0, 0x0, 0x0, 0x8, 0x0, 0x40, 0x1D, 0x0, 0x8, 0x8F, 0x0, 0x0, 0x0, 0x8, 0x0, 0x50, 0x1D, 0x0, 0x28, 0x8F, 0x0, 0x0, 0x0, 0x8, 0x0, 0x60, 0x1D, 0x0, 0x48, 0x8F, 0x0, 0x0, 0x0, 0x8, 0x0, 0x70, 0x1D, 0x0, 0x68, 0x8F, 0x0, 0x0, 0x0, 0x8, 0x0, 0x80, 0x1D, 0x0, 0x88, 0x8F, 0x0, 0x0, 0x0, 0x8, 0x0, 0x90, 0x1D, 0x0, 0xA8, 0x8F, 0x0, 0x0, 0x0, 0x8, 0x0, 0xA0, 0x1D, 0x0, 0xC8, 0x8F, 0x0, 0x0, 0x0, 0x8, 0x0, 0xB0, 0x1D, 0x0, 0xE8, 0x8F, 0x0, 0x0, 0x0, 0x8, 0x0, 0xC0, 0x1D, 0x0, 0x8, 0x90, 0x0, 0x0, 0x0, 0x8, 0x0, 0xD0, 0x1D, 0x0, 0x28, 0x90, 0x0, 0x0, 0x0, 0x8, 0x0, 0xE0, 0x1D, 0x0, 0x48, 0x90, 0x0, 0x0, 0x0, 0x8, 0x0, 0xF0, 0x1D, 0x0, 0x68, 0x90, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x1E, 0x0, 0x88, 0x90, 0x0, 0x0, 0x0, 0x8, 0x0, 0x10, 0x1E, 0x0, 0xA8, 0x90, 0x0, 0x0, 0x0, 0x8, 0x0, 0x20, 0x1E, 0x0, 0xC8, 0x90, 0x0, 0x0, 0x0, 0x8, 0x0, 0x30, 0x1E, 0x0, 0xE8, 0x90, 0x0, 0x0, 0x0, 0x8, 0x0, 0x40, 0x1E, 0x0, 0x8, 0x91, 0x0, 0x0, 0x0, 0x8, 0x0, 0x50, 0x1E, 0x0, 0x28, 0x91, 0x0, 0x0, 0x0, 0x8, 0x0, 0x60, 0x1E, 0x0, 0x48, 0x91, 0x0, 0x0, 0x0, 0x8, 0x0, 0x70, 0x1E, 0x0, 0x68, 0x91, 0x0, 0x0, 0x0, 0x8, 0x0, 0x80, 0x1E, 0x0, 0x88, 0x91, 0x0, 0x0, 0x0, 0x8, 0x0, 0x90, 0x1E, 0x0, 0xA8, 0x91, 0x0, 0x0, 0x0, 0x8, 0x0, 0xA0, 0x1E, 0x0, 0xC8, 0x91, 0x0, 0x0, 0x0, 0x8, 0x0, 0xB0, 0x1E, 0x0, 0xE8, 0x91, 0x0, 0x0, 0x0, 0x8, 0x0, 0xC0, 0x1E, 0x0, 0x8, 0x0, 0x80, 0x24, 0x0, 0x8, 0x0, 0x88, 0x24, 0x0, 0x8, 0x0, 0x90, 0x24, 0x0, 0x8, 0x0, 0x98, 0x24, 0x0, 0x8, 0x0, 0xA0, 0x24, 0x0, 0x8, 0x0, 0xA8, 0x24, 0x0, 0x8, 0x0, 0xB0, 0x24, 0x0, 0x8, 0x0, 0xB8, 0x24, 0x0, 0x8, 0x0, 0xC0, 0x24, 0x0, 0x8, 0x0, 0xC8, 0x24, 0x0, 0x8, 0x0, 0xD0, 0x24, 0x0, 0x8, 0x0, 0xD8, 0x24, 0x0, 0x8, 0x0, 0xE0, 0x24, 0x0, 0x8, 0x0, 0xE8, 0x24, 0x0, 0x8, 0x0, 0xF0, 0x24, 0x0, 0x8, 0x0, 0xF8, 0x24, 0x0, 0x8, 0x0, 0x0, 0x25, 0x0, 0x8, 0x0, 0x8, 0x25, 0x0, 0x8, 0x0, 0x10, 0x25, 0x0, 0x8, 0x0, 0xE0, 0x20, 0x0, 0x8, 0x0, 0x18, 0x25, 0x0, 0x8, 0x0, 0xE8, 0x20, 0x0, 0x8, 0x0, 0xF0, 0x20, 0x0, 0x8, 0x0, 0xF8, 0x20, 0x0, 0x8, 0x0, 0x0, 0x21, 0x0, 0x8, 0x0, 0x8, 0x21, 0x0, 0x8, 0x0, 0x10, 0x21, 0x0, 0x8, 0x0, 0x20, 0x25, 0x0, 0x8, 0x0, 0x28, 0x25, 0x0, 0x8, 0x0, 0x30, 0x25, 0x0, 0x8, 0x0, 0x38, 0x25, 0x0, 0x8, 0x0, 0x40, 0x25, 0x0, 0x8, 0x0, 0x40, 0x21, 0x0, 0x8, 0x0, 0x48, 0x21, 0x0, 0x8, 0x0, 0x50, 0x21, 0x0, 0x8, 0x0, 0x58, 0x21, 0x0, 0x8, 0x0, 0x60, 0x21, 0x0, 0x8, 0x0, 0x68, 0x21, 0x0, 0x8, 0x0, 0x70, 0x21, 0x0, 0x8, 0x0, 0x50, 0x20, 0x0, 0x8, 0x0, 0x48, 0x25, 0x0, 0x8, 0x0, 0x58, 0x20, 0x0, 0x8, 0x0, 0x50, 0x25, 0x0, 0x8, 0x0, 0x58, 0x25, 0x0, 0x8, 0x0, 0x60, 0x25, 0x0, 0x8, 0x0, 0xC8, 0x20, 0x0, 0x8, 0x0, 0x68, 0x25, 0x0, 0x8, 0x0, 0x70, 0x25, 0x0, 0x8, 0x0, 0x78, 0x25, 0x0, 0x8, 0x0, 0x80, 0x25, 0x0, 0x8, 0x0, 0xC0, 0x20, 0x0, 0x8, 0x0, 0x88, 0x25, 0x0, 0x8, 0x0, 0x90, 0x25, 0x0, 0x8, 0x0, 0x98, 0x25, 0x0, 0x8, 0x0, 0xA0, 0x25, 0x0, 0x8, 0x0, 0xA8, 0x25, 0x0, 0x8, 0x0, 0xB0, 0x25, 0x0, 0x8, 0x0, 0xB8, 0x25, 0x0, 0x8, 0x0, 0xC0, 0x25, 0x0, 0x8, 0x0, 0x60, 0x20, 0x0, 0x8, 0x0, 0xC8, 0x25, 0x0, 0x8, 0x0, 0xD0, 0x25, 0x0, 0x8, 0x0, 0xD8, 0x25, 0x0, 0x8, 0x0, 0xE0, 0x25, 0x0, 0x8, 0x0, 0xE8, 0x25, 0x0, 0x8, 0x0, 0xF0, 0x25, 0x0, 0x8, 0x0, 0xF8, 0x25, 0x0, 0x8, 0x0, 0x0, 0x26, 0x0, 0x8, 0x0, 0x8, 0x26, 0x0, 0x8, 0x0, 0x10, 0x26, 0x0, 0x8, 0x0, 0x18, 0x26, 0x0, 0x8, 0x0, 0x20, 0x26, 0x0, 0x8, 0x0, 0x28, 0x26, 0x0, 0x8, 0x0, 0x30, 0x26, 0x0, 0x8, 0x0, 0x38, 0x26, 0x0, 0x8, 0x0, 0x40, 0x26, 0x0, 0x8, 0x0, 0x48, 0x26, 0x0, 0x8, 0x0, 0x50, 0x26, 0x0, 0x8, 0x0, 0x58, 0x26, 0x0, 0x8, 0x0, 0x60, 0x26, 0x0, 0x8, 0x0, 0x68, 0x26, 0x0, 0x8, 0x0, 0x70, 0x26, 0x0, 0x8, 0x0, 0x78, 0x26, 0x0, 0x8, 0x0, 0x80, 0x26, 0x0, 0x8, 0x0, 0x88, 0x26, 0x0, 0x8, 0x0, 0x90, 0x26, 0x0, 0x8, 0x0, 0x98, 0x26, 0x0, 0x8, 0x0, 0xA0, 0x26, 0x0, 0x8, 0x0, 0xA8, 0x26, 0x0, 0x8, 0x0, 0xB0, 0x26, 0x0, 0x8, 0x0, 0xB8, 0x26, 0x0, 0x8, 0x0, 0xC0, 0x26, 0x0, 0x8, 0x0, 0xC8, 0x26, 0x0, 0x8, 0x0, 0xD0, 0x26, 0x0, 0x8, 0x0, 0xD8, 0x26, 0x0, 0x8, 0x0, 0xE0, 0x26, 0x0, 0x8, 0x0, 0xE8, 0x26, 0x0, 0x8, 0x0, 0xF0, 0x26, 0x0, 0x8, 0x0, 0xF8, 0x26, 0x0, 0x8, 0x0, 0x0, 0x27, 0x0, 0x8, 0x0, 0x8, 0x27, 0x0, 0x8, 0x0, 0x10, 0x27, 0x0, 0x8, 0x0, 0x18, 0x27, 0x0, 0x8, 0x0, 0x20, 0x27, 0x0, 0x8, 0x0, 0x28, 0x27, 0x0, 0x8, 0x0, 0x30, 0x27, 0x0, 0x8, 0x0, 0x38, 0x27, 0x0, 0x8, 0x0, 0x40, 0x27, 0x0, 0x8, 0x0, 0x48, 0x27, 0x0, 0x8, 0x0, 0x50, 0x27, 0x0, 0x8, 0x0, 0x58, 0x27, 0x0, 0x8, 0x0, 0x60, 0x27, 0x0, 0x8, 0x0, 0x68, 0x27, 0x0, 0x8, 0x0, 0x70, 0x27, 0x0, 0x8, 0x0, 0x78, 0x27, 0x0, 0x8, 0x0, 0x80, 0x27, 0x0, 0x8, 0x0, 0x88, 0x27, 0x0, 0x8, 0x0, 0x90, 0x27, 0x0, 0x8, 0x0, 0x98, 0x27, 0x0, 0x8, 0x0, 0xA0, 0x27, 0x0, 0x8, 0x0, 0xA8, 0x27, 0x0, 0x8, 0x0, 0xB0, 0x27, 0x0, 0x8, 0x0, 0xB8, 0x27, 0x0, 0x8, 0x0, 0xC0, 0x27, 0x0, 0x8, 0x0, 0xC8, 0x27, 0x0, 0x8, 0x0, 0xD0, 0x27, 0x0, 0x8, 0x0, 0xD8, 0x27, 0x0, 0x8, 0x0, 0xE0, 0x27, 0x0, 0x8, 0x0, 0xE8, 0x27, 0x0, 0x8, 0x0, 0xF0, 0x27, 0x0, 0x8, 0x0, 0xF8, 0x27, 0x0, 0x8, 0x0, 0x0, 0x28, 0x0, 0x8, 0x0, 0x8, 0x28, 0x0, 0x8, 0x0, 0x10, 0x28, 0x0, 0x8, 0x0, 0x18, 0x28, 0x0, 0x8, 0x0, 0x20, 0x28, 0x0, 0xA8, 0xA0, 0x0, 0x0, 0x0, 0xC8, 0xA0, 0x0, 0x0, 0x0, 0xE8, 0xA0, 0x0, 0x0, 0x0, 0x8, 0xA1, 0x0, 0x0, 0x0, 0x28, 0xA1, 0x0, 0x0, 0x0, 0x48, 0xA1, 0x0, 0x0, 0x0, 0x68, 0xA1, 0x0, 0x0, 0x0, 0x88, 0xA1, 0x0, 0x0, 0x0, 0xA8, 0xA1, 0x0, 0x0, 0x0, 0xC8, 0xA1, 0x0, 0x0, 0x0, 0xE8, 0xA1, 0x0, 0x0, 0x0, 0x8, 0xA2, 0x0, 0x0, 0x0, 0x28, 0xA2, 0x0, 0x0, 0x0, 0x48, 0xA2, 0x0, 0x0, 0x0, 0x68, 0xA2, 0x0, 0x0, 0x0, 0x88, 0xA2, 0x0, 0x0, 0x0, 0xA8, 0xA2, 0x0, 0x0, 0x0, 0xC8, 0xA2, 0x0, 0x0, 0x0, 0xE8, 0xA2, 0x0, 0x0, 0x0, 0x8, 0x0, 0xC0, 0x28, 0x0, 0x28, 0xA3, 0x0, 0x0, 0x0, 0x8, 0x0, 0xD0, 0x28, 0x0, 0x68, 0xA3, 0x0, 0x0, 0x0, 0x88, 0xA3, 0x0, 0x0, 0x0, 0xA8, 0xA3, 0x0, 0x0, 0x0, 0xC8, 0xA3, 0x0, 0x0, 0x0, 0xE8, 0xA3, 0x0, 0x0, 0x0, 0x88, 0x41, 0x0, 0x0, 0x0, 0xA8, 0x41, 0x0, 0x0, 0x0, 0x8, 0xA4, 0x0, 0x0, 0x0, 0x28, 0xA4, 0x0, 0x0, 0x0, 0x48, 0xA4, 0x0, 0x0, 0x0, 0x68, 0xA4, 0x0, 0x0, 0x0, 0x88, 0xA4, 0x0, 0x0, 0x0, 0xA8, 0xA4, 0x0, 0x0, 0x0, 0xC8, 0xA4, 0x0, 0x0, 0x0, 0xE8, 0xA4, 0x0, 0x0, 0x0, 0x8, 0xA5, 0x0, 0x0, 0x0, 0x28, 0xA5, 0x0, 0x0, 0x0, 0x48, 0xA5, 0x0, 0x0, 0x0, 0x68, 0xA5, 0x0, 0x0, 0x0, 0x88, 0xA5, 0x0, 0x0, 0x0, 0xA8, 0xA5, 0x0, 0x0, 0x0, 0xC8, 0xA5, 0x0, 0x0, 0x0, 0xE8, 0xA5, 0x0, 0x0, 0x0, 0x8, 0xA6, 0x0, 0x0, 0x0, 0x28, 0xA6, 0x0, 0x0, 0x0, 0x48, 0xA6, 0x0, 0x0, 0x0, 0x68, 0xA6, 0x0, 0x0, 0x0, 0x88, 0xA6, 0x0, 0x0, 0x0, 0xA8, 0xA6, 0x0, 0x0, 0x0, 0xC8, 0xA6, 0x0, 0x0, 0x0, 0xE8, 0xA6, 0x0, 0x0, 0x0, 0x8, 0xA7, 0x0, 0x0, 0x0, 0x28, 0xA7, 0x0, 0x0, 0x0, 0x48, 0xA7, 0x0, 0x0, 0x0, 0x68, 0xA7, 0x0, 0x0, 0x0, 0x88, 0xA7, 0x0, 0x0, 0x0, 0xA8, 0xA7, 0x0, 0x0, 0x0, 0xC8, 0xA7, 0x0, 0x0, 0x0, 0xE8, 0xA7, 0x0, 0x0, 0x0, 0x8, 0xA8, 0x0, 0x0, 0x0, 0x28, 0xA8, 0x0, 0x0, 0x0, 0x48, 0xA8, 0x0, 0x0, 0x0, 0x68, 0xA8, 0x0, 0x0, 0x0, 0x88, 0xA8, 0x0, 0x0, 0x0, 0xA8, 0xA8, 0x0, 0x0, 0x0, 0xC8, 0xA8, 0x0, 0x0, 0x0, 0xE8, 0xA8, 0x0, 0x0, 0x0, 0x8, 0xA9, 0x0, 0x0, 0x0, 0x28, 0xA9, 0x0, 0x0, 0x0, 0x48, 0xA9, 0x0, 0x0, 0x0, 0x68, 0xA9, 0x0, 0x0, 0x0, 0x88, 0xA9, 0x0, 0x0, 0x0, 0xA8, 0xA9, 0x0, 0x0, 0x0, 0xC8, 0xA9, 0x0, 0x0, 0x0, 0xE8, 0xA9, 0x0, 0x0, 0x0, 0x8, 0xAA, 0x0, 0x0, 0x0, 0x28, 0xAA, 0x0, 0x0, 0x0, 0x48, 0xAA, 0x0, 0x0, 0x0, 0x68, 0xAA, 0x0, 0x0, 0x0, 0x88, 0xAA, 0x0, 0x0, 0x0, 0xA8, 0xAA, 0x0, 0x0, 0x0, 0xC8, 0xAA, 0x0, 0x0, 0x0, 0xE8, 0xAA, 0x0, 0x0, 0x0, 0x8, 0xAB, 0x0, 0x0, 0x0, 0x28, 0xAB, 0x0, 0x0, 0x0, 0x48, 0xAB, 0x0, 0x0, 0x0, 0x68, 0xAB, 0x0, 0x0, 0x0, 0x88, 0xAB, 0x0, 0x0, 0x0, 0xA8, 0xAB, 0x0, 0x0, 0x0, 0xC8, 0xAB, 0x0, 0x0, 0x0, 0xE8, 0xAB, 0x0, 0x0, 0x0, 0x8, 0xAC, 0x0, 0x0, 0x0, 0x28, 0xAC, 0x0, 0x0, 0x0, 0x48, 0xAC, 0x0, 0x0, 0x0, 0x68, 0xAC, 0x0, 0x0, 0x0, 0x88, 0xAC, 0x0, 0x0, 0x0, 0xA8, 0xAC, 0x0, 0x0, 0x0, 0xC8, 0xAC, 0x0, 0x0, 0x0, 0xE8, 0xAC, 0x0, 0x0, 0x0, 0x8, 0xAD, 0x0, 0x0, 0x0, 0x28, 0xAD, 0x0, 0x0, 0x0, 0x48, 0xAD, 0x0, 0x0, 0x0, 0x68, 0xAD, 0x0, 0x0, 0x0, 0x88, 0xAD, 0x0, 0x0, 0x0, 0xA8, 0xAD, 0x0, 0x0, 0x0, 0xC8, 0xAD, 0x0, 0x0, 0x0, 0xE8, 0xAD, 0x0, 0x0, 0x0, 0x8, 0xAE, 0x0, 0x0, 0x0, 0x28, 0xAE, 0x0, 0x0, 0x0, 0x48, 0xAE, 0x0, 0x0, 0x0, 0x68, 0xAE, 0x0, 0x0, 0x0, 0x88, 0xAE, 0x0, 0x0, 0x0, 0xA8, 0xAE, 0x0, 0x0, 0x0, 0xC8, 0xAE, 0x0, 0x0, 0x0, 0xE8, 0xAE, 0x0, 0x0, 0x0, 0x8, 0xAF, 0x0, 0x0, 0x0, 0x28, 0xAF, 0x0, 0x0, 0x0, 0x48, 0xAF, 0x0, 0x0, 0x0, 0x8, 0x0, 0xD8, 0x2B, 0x0, 0x8, 0x0, 0xE0, 0x2B, 0x0, 0x8, 0x0, 0xE8, 0x2B, 0x0, 0x8, 0x0, 0xF0, 0x2B, 0x0, 0x8, 0x0, 0xF8, 0x2B, 0x0, 0x8, 0x0, 0x0, 0x2C, 0x0, 0x8, 0x0, 0x8, 0x2C, 0x0, 0x8, 0x0, 0x10, 0x2C, 0x0, 0x8, 0x0, 0x18, 0x2C, 0x0, 0x8, 0x0, 0x20, 0x2C, 0x0, 0x8, 0x0, 0x28, 0x2C, 0x0, 0x8, 0x0, 0x30, 0x2C, 0x0, 0x8, 0x0, 0x38, 0x2C, 0x0, 0x8, 0x0, 0xD8, 0x1D, 0x0, 0x8, 0x0, 0xD0, 0x21, 0x0, 0x8, 0x0, 0x40, 0x2C, 0x0, 0x8, 0x0, 0x48, 0x2C, 0x0, 0x8, 0x0, 0x50, 0x2C, 0x0, 0x8, 0x0, 0x58, 0x2C, 0x0, 0x8, 0x0, 0x60, 0x2C, 0x0, 0x8, 0x0, 0x68, 0x2C, 0x0, 0x8, 0x0, 0xE8, 0x21, 0x0, 0x8, 0x0, 0xA8, 0x22, 0x0, 0x8, 0x0, 0xB0, 0x22, 0x0, 0x8, 0x0, 0xB8, 0x22, 0x0, 0x8, 0x0, 0xC0, 0x22, 0x0, 0x8, 0x0, 0xC8, 0x22, 0x0, 0x8, 0x0, 0xD0, 0x22, 0x0, 0x8, 0x0, 0xD8, 0x22, 0x0, 0x8, 0x0, 0x70, 0x2C, 0x0, 0x8, 0x0, 0xE0, 0x22, 0x0, 0x8, 0x0, 0xE8, 0x22, 0x0, 0x8, 0x0, 0xF0, 0x22, 0x0, 0x8, 0x0, 0xF8, 0x22, 0x0, 0x8, 0x0, 0x0, 0x23, 0x0, 0x8, 0x0, 0x8, 0x23, 0x0, 0x8, 0x0, 0x10, 0x23, 0x0, 0x8, 0x0, 0x78, 0x2C, 0x0, 0x8, 0x0, 0x80, 0x2C, 0x0, 0x8, 0x0, 0x88, 0x2C, 0x0, 0x8, 0x0, 0x90, 0x2C, 0x0, 0x8, 0x0, 0x98, 0x2C, 0x0, 0x8, 0x0, 0xA0, 0x2C, 0x0, 0x8, 0x0, 0xA8, 0x2C, 0x0, 0x8, 0x0, 0xB0, 0x2C, 0x0, 0x8, 0x0, 0xB8, 0x2C, 0x0, 0x8, 0x0, 0xC0, 0x2C, 0x0, 0x8, 0x0, 0xC8, 0x2C, 0x0, 0x8, 0x0, 0xD0, 0x2C, 0x0, 0x8, 0x0, 0xD8, 0x2C, 0x0, 0x8, 0x0, 0xE0, 0x2C, 0x0, 0x8, 0x0, 0xE8, 0x2C, 0x0, 0x8, 0x0, 0xF0, 0x2C, 0x0, 0x8, 0x0, 0xF8, 0x2C, 0x0, 0x8, 0x0, 0x0, 0x2D, 0x0, 0x8, 0x0, 0x8, 0x2D, 0x0, 0x8, 0x0, 0x10, 0x2D, 0x0, 0x8, 0x0, 0x18, 0x2D, 0x0, 0x8, 0x0, 0x20, 0x2D, 0x0, 0x8, 0x0, 0x28, 0x2D, 0x0, 0x8, 0x0, 0x30, 0x2D, 0x0, 0x8, 0x0, 0x38, 0x2D, 0x0, 0x8, 0x0, 0x40, 0x2D, 0x0, 0x8, 0x0, 0x48, 0x2D, 0x0, 0x8, 0x0, 0x50, 0x2D, 0x0, 0x8, 0x0, 0x58, 0x2D, 0x0, 0x8, 0x0, 0x60, 0x2D, 0x0, 0x8, 0x0, 0x68, 0x2D, 0x0, 0x8, 0x0, 0xD8, 0x1C, 0x0, 0x8, 0x0, 0xE8, 0x1C, 0x0, 0x8, 0x0, 0xF8, 0x1C, 0x0, 0x8, 0x0, 0x8, 0x1D, 0x0, 0x8, 0x0, 0x18, 0x1D, 0x0, 0x8, 0x0, 0x28, 0x1D, 0x0, 0x8, 0x0, 0x38, 0x1D, 0x0, 0x8, 0x0, 0x48, 0x1D, 0x0, 0x8, 0x0, 0x58, 0x1D, 0x0, 0x8, 0x0, 0x68, 0x1D, 0x0, 0x8, 0x0, 0x78, 0x1D, 0x0, 0x8, 0x0, 0x88, 0x1D, 0x0, 0x8, 0x0, 0x98, 0x1D, 0x0, 0x8, 0x0, 0xA8, 0x1D, 0x0, 0x8, 0x0, 0xB8, 0x1D, 0x0, 0x8, 0x0, 0xC8, 0x1D, 0x0, 0x8, 0x0, 0xD0, 0x1E, 0x0, 0x8, 0x0, 0xE8, 0x1D, 0x0, 0x8, 0x0, 0xF8, 0x1D, 0x0, 0x8, 0x0, 0x0, 0x1F, 0x0, 0x8, 0x0, 0x8, 0x1E, 0x0, 0x8, 0x0, 0x10, 0x1F, 0x0, 0x8, 0x0, 0x18, 0x1E, 0x0, 0x8, 0x0, 0x20, 0x1F, 0x0, 0x8, 0x0, 0x28, 0x1E, 0x0, 0x8, 0x0, 0x30, 0x1F, 0x0, 0x8, 0x0, 0x38, 0x1E, 0x0, 0x8, 0x0, 0x40, 0x1F, 0x0, 0x8, 0x0, 0x48, 0x1E, 0x0, 0x8, 0x0, 0x50, 0x1F, 0x0, 0x8, 0x0, 0x58, 0x1E, 0x0, 0x8, 0x0, 0x60, 0x1F, 0x0, 0x8, 0x0, 0x68, 0x1E, 0x0, 0x8, 0x0, 0x70, 0x1F, 0x0, 0x8, 0x0, 0x78, 0x1E, 0x0, 0x8, 0x0, 0x80, 0x1F, 0x0, 0x8, 0x0, 0x88, 0x1E, 0x0, 0x8, 0x0, 0x90, 0x1F, 0x0, 0x8, 0x0, 0x98, 0x1E, 0x0, 0x8, 0x0, 0xA0, 0x1F, 0x0, 0x8, 0x0, 0xA8, 0x1E, 0x0, 0x8, 0x0, 0xB0, 0x1F, 0x0, 0x8, 0x0, 0xB8, 0x1E, 0x0, 0x8, 0x0, 0xC0, 0x1F, 0x0, 0x8, 0x0, 0xC8, 0x1E, 0x0, 0xC8, 0xB5, 0x0, 0x0, 0x0, 0xE8, 0xB5, 0x0, 0x0, 0x0, 0x8, 0xB6, 0x0, 0x0, 0x0, 0x28, 0xB6, 0x0, 0x0, 0x0, 0x48, 0xB6, 0x0, 0x0, 0x0, 0x68, 0xB6, 0x0, 0x0, 0x0, 0x88, 0xB6, 0x0, 0x0, 0x0, 0xA8, 0xB6, 0x0, 0x0, 0x0, 0xC8, 0xB6, 0x0, 0x0, 0x0, 0xE8, 0xB6, 0x0, 0x0, 0x0, 0x8, 0xB7, 0x0, 0x0, 0x0, 0x28, 0xB7, 0x0, 0x0, 0x0, 0x48, 0xB7, 0x0, 0x0, 0x0, 0x68, 0xB7, 0x0, 0x0, 0x0, 0x88, 0xB7, 0x0, 0x0, 0x0, 0xA8, 0xB7, 0x0, 0x0, 0x0, 0xC8, 0xB7, 0x0, 0x0, 0x0, 0xE8, 0xB7, 0x0, 0x0, 0x0, 0x8, 0xB8, 0x0, 0x0, 0x0, 0x28, 0xB8, 0x0, 0x0, 0x0, 0x48, 0xB8, 0x0, 0x0, 0x0, 0x68, 0xB8, 0x0, 0x0, 0x0, 0x88, 0xB8, 0x0, 0x0, 0x0, 0xA8, 0xB8, 0x0, 0x0, 0x0, 0xC8, 0xB8, 0x0, 0x0, 0x0, 0xE8, 0xB8, 0x0, 0x0, 0x0, 0x8, 0xB9, 0x0, 0x0, 0x0, 0x28, 0xB9, 0x0, 0x0, 0x0, 0x48, 0xB9, 0x0, 0x0, 0x0, 0x68, 0xB9, 0x0, 0x0, 0x0, 0x88, 0xB9, 0x0, 0x0, 0x0, 0xA8, 0xB9, 0x0, 0x0, 0x0, 0xC8, 0xB9, 0x0, 0x0, 0x0, 0xE8, 0xB9, 0x0, 0x0, 0x0, 0x8, 0xBA, 0x0, 0x0, 0x0, 0x28, 0xBA, 0x0, 0x0, 0x0, 0x48, 0xBA, 0x0, 0x0, 0x0, 0x68, 0xBA, 0x0, 0x0, 0x0, 0x88, 0xBA, 0x0, 0x0, 0x0, 0xA8, 0xBA, 0x0, 0x0, 0x0, 0xC8, 0xBA, 0x0, 0x0, 0x0, 0xE8, 0xBA, 0x0, 0x0, 0x0, 0x8, 0xBB, 0x0, 0x0, 0x0, 0x28, 0xBB, 0x0, 0x0, 0x0, 0xE8, 0xB1, 0x0, 0x0, 0x0, 0x8, 0xB2, 0x0, 0x0, 0x0, 0x28, 0xB2, 0x0, 0x0, 0x0, 0x48, 0xB2, 0x0, 0x0, 0x0, 0x68, 0xB2, 0x0, 0x0, 0x0, 0x88, 0xB2, 0x0, 0x0, 0x0, 0xA8, 0xB2, 0x0, 0x0, 0x0, 0xC8, 0xB2, 0x0, 0x0, 0x0, 0xE8, 0xB2, 0x0, 0x0, 0x0, 0x8, 0xB3, 0x0, 0x0, 0x0, 0x28, 0xB3, 0x0, 0x0, 0x0, 0x48, 0xB3, 0x0, 0x0, 0x0, 0x68, 0xB3, 0x0, 0x0, 0x0, 0x88, 0xB3, 0x0, 0x0, 0x0, 0xA8, 0xB3, 0x0, 0x0, 0x0, 0xC8, 0xB3, 0x0, 0x0, 0x0, 0xE8, 0xB3, 0x0, 0x0, 0x0, 0x8, 0x0, 0xD0, 0x2E, 0x0, 0x8, 0x0, 0xD8, 0x2E, 0x0, 0x8, 0x0, 0xE0, 0x2E, 0x0, 0x8, 0x0, 0xE8, 0x2E, 0x0, 0x8, 0x0, 0xF0, 0x2E, 0x0, 0x8, 0x0, 0xF8, 0x2E, 0x0, 0x8, 0x0, 0x0, 0x2F, 0x0, 0x8, 0x0, 0x8, 0x2F, 0x0, 0x8, 0x0, 0x10, 0x2F, 0x0, 0x8, 0x0, 0x18, 0x2F, 0x0, 0x8, 0x0, 0x20, 0x2F, 0x0, 0x8, 0x0, 0x28, 0x2F, 0x0, 0x8, 0x0, 0x30, 0x2F, 0x0, 0x8, 0x0, 0x38, 0x2F, 0x0, 0x8, 0x0, 0x40, 0x2F, 0x0, 0x8, 0x0, 0x48, 0x2F, 0x0, 0x8, 0x0, 0x50, 0x2F, 0x0, 0x8, 0x0, 0x58, 0x2F, 0x0, 0x8, 0x0, 0x60, 0x2F, 0x0, 0x8, 0x0, 0x68, 0x2F, 0x0, 0x8, 0x0, 0x70, 0x2F, 0x0, 0x8, 0x0, 0x78, 0x2F, 0x0, 0x8, 0x0, 0x80, 0x2F, 0x0, 0x8, 0x0, 0x88, 0x2F, 0x0, 0x8, 0x0, 0x58, 0x1C, 0x0, 0x8, 0x0, 0x60, 0x1C, 0x0, 0x8, 0x0, 0x68, 0x1C, 0x0, 0x8, 0x0, 0x70, 0x1C, 0x0, 0x8, 0x0, 0x78, 0x1C, 0x0, 0x8, 0x0, 0x80, 0x1C, 0x0, 0x8, 0x0, 0x88, 0x1C, 0x0, 0x8, 0x0, 0x90, 0x1C, 0x0, 0x8, 0x0, 0x98, 0x1C, 0x0, 0x8, 0x0, 0xA0, 0x1C, 0x0, 0x8, 0x0, 0xA8, 0x1C, 0x0, 0x8, 0x0, 0xB0, 0x1C, 0x0, 0x8, 0x0, 0xB8, 0x1C, 0x0, 0x8, 0x0, 0xC0, 0x1C, 0x0, 0x8, 0x0, 0xC8, 0x1C, 0x0, 0x8, 0x0, 0x90, 0x2F, 0x0, 0x8, 0x0, 0x98, 0x2F, 0x0, 0x8, 0x0, 0xA0, 0x2F, 0x0, 0x8, 0x0, 0xA8, 0x2F, 0x0, 0x8, 0x0, 0xB0, 0x2F, 0x0, 0x8, 0x0, 0xB8, 0x2F, 0x0, 0x8, 0x0, 0xC0, 0x2F, 0x0, 0x8, 0x0, 0xC8, 0x2F, 0x0, 0x8, 0x0, 0xD0, 0x2F, 0x0, 0x8, 0x0, 0xD8, 0x2F, 0x0, 0x8, 0x0, 0xE0, 0x2F, 0x0, 0x8, 0x0, 0xE8, 0x2F, 0x0, 0x8, 0x0, 0xF0, 0x2F, 0x0, 0x8, 0x0, 0xF8, 0x2F, 0x0, 0x8, 0x0, 0x0, 0x30, 0x0, 0x8, 0x0, 0x8, 0x30, 0x0, 0x8, 0x0, 0x10, 0x30, 0x0, 0x68, 0xC0, 0x0, 0x0, 0x0, 0x88, 0xC0, 0x0, 0x0, 0x0, 0xA8, 0xC0, 0x0, 0x0, 0x0, 0xA8, 0xAF, 0x0, 0x0, 0x0, 0xC8, 0xC0, 0x0, 0x0, 0x0, 0xE8, 0xC0, 0x0, 0x0, 0x0, 0x8, 0xC1, 0x0, 0x0, 0x0, 0x28, 0xC1, 0x0, 0x0, 0x0, 0x48, 0xB0, 0x0, 0x0, 0x0, 0x68, 0xB0, 0x0, 0x0, 0x0, 0x88, 0xB0, 0x0, 0x0, 0x0, 0xA8, 0xB0, 0x0, 0x0, 0x0, 0xC8, 0xB0, 0x0, 0x0, 0x0, 0xE8, 0xB0, 0x0, 0x0, 0x0, 0x68, 0x92, 0x0, 0x0, 0x0, 0x88, 0x92, 0x0, 0x0, 0x0, 0xA8, 0x92, 0x0, 0x0, 0x0, 0xC8, 0x92, 0x0, 0x0, 0x0, 0xE8, 0x92, 0x0, 0x0, 0x0, 0x8, 0x93, 0x0, 0x0, 0x0, 0x48, 0xC1, 0x0, 0x0, 0x0, 0x68, 0xC1, 0x0, 0x0, 0x0, 0x88, 0xC1, 0x0, 0x0, 0x0, 0xA8, 0xC1, 0x0, 0x0, 0x0, 0xC8, 0xC1, 0x0, 0x0, 0x0, 0xE8, 0xC1, 0x0, 0x0, 0x0, 0x8, 0xC2, 0x0, 0x0, 0x0, 0x28, 0xC2, 0x0, 0x0, 0x0, 0x48, 0xC2, 0x0, 0x0, 0x0, 0x68, 0xC2, 0x0, 0x0, 0x0, 0x88, 0xC2, 0x0, 0x0, 0x0, 0xA8, 0xC2, 0x0, 0x0, 0x0, 0xC8, 0xC2, 0x0, 0x0, 0x0, 0xE8, 0xC2, 0x0, 0x0, 0x0, 0x8, 0xC3, 0x0, 0x0, 0x0, 0x28, 0xC3, 0x0, 0x0, 0x0, 0x48, 0xC3, 0x0, 0x0, 0x0, 0x68, 0xC3, 0x0, 0x0, 0x0, 0x88, 0xC3, 0x0, 0x0, 0x0, 0xA8, 0xC3, 0x0, 0x0, 0x0, 0xC8, 0xC3, 0x0, 0x0, 0x0, 0xE8, 0xC3, 0x0, 0x0, 0x0, 0x8, 0xC4, 0x0, 0x0, 0x0, 0x28, 0xC4, 0x0, 0x0, 0x0, 0x48, 0xC4, 0x0, 0x0, 0x0, 0x68, 0xC4, 0x0, 0x0, 0x0, 0x88, 0xC4, 0x0, 0x0, 0x0, 0xA8, 0xC4, 0x0, 0x0, 0x0, 0xC8, 0xC4, 0x0, 0x0, 0x0, 0xE8, 0xC4, 0x0, 0x0, 0x0, 0x8, 0xC5, 0x0, 0x0, 0x0, 0x28, 0xC5, 0x0, 0x0, 0x0, 0x68, 0xB1, 0x0, 0x0, 0x0, 0x88, 0x95, 0x0, 0x0, 0x0, 0xA8, 0xB1, 0x0, 0x0, 0x0, 0x8, 0x0, 0x50, 0x31, 0x0, 0x8, 0x0, 0xF0, 0x1F, 0x0, 0x8, 0x0, 0xF8, 0x1F, 0x0, 0x8, 0x0, 0x58, 0x31, 0x0, 0x8, 0x0, 0x8, 0x20, 0x0, 0x8, 0x0, 0x30, 0x20, 0x0, 0x8, 0x0, 0x48, 0x20, 0x0, 0x8, 0x0, 0xA0, 0x20, 0x0, 0x8, 0x0, 0xB8, 0x20, 0x0, 0x8, 0x0, 0x60, 0x31, 0x0, 0x8, 0x0, 0x68, 0x31, 0x0, 0x8, 0x0, 0x70, 0x31, 0x0, 0x8, 0x0, 0x78, 0x31, 0x0, 0x8, 0x0, 0x80, 0x31, 0x0, 0x8, 0x0, 0x88, 0x31, 0x0, 0x8, 0x0, 0x90, 0x31, 0x0, 0x8, 0x0, 0x98, 0x31, 0x0, 0x8, 0x0, 0xD0, 0x20, 0x0, 0x8, 0x0, 0xA0, 0x31, 0x0, 0x8, 0x0, 0xA8, 0x31, 0x0, 0x8, 0x0, 0xB0, 0x31, 0x0, 0x8, 0x0, 0xB8, 0x31, 0x0, 0x8, 0x0, 0x78, 0x23, 0x0, 0x68, 0xAF, 0x0, 0x0, 0x0, 0x88, 0xAF, 0x0, 0x0, 0x0, 0xC8, 0xAF, 0x0, 0x0, 0x0, 0x8, 0xC7, 0x0, 0x0, 0x0, 0x28, 0xC7, 0x0, 0x0, 0x0, 0x8, 0xB0, 0x0, 0x0, 0x0, 0x48, 0xC7, 0x0, 0x0, 0x0, 0x68, 0xC7, 0x0, 0x0, 0x0, 0x88, 0xC7, 0x0, 0x0, 0x0, 0xA8, 0xC7, 0x0, 0x0, 0x0, 0xC8, 0xC7, 0x0, 0x0, 0x0, 0xE8, 0xC7, 0x0, 0x0, 0x0, 0x8, 0xC8, 0x0, 0x0, 0x0, 0x28, 0xC8, 0x0, 0x0, 0x0, 0x48, 0xC8, 0x0, 0x0, 0x0, 0x68, 0xBB, 0x0, 0x0, 0x0, 0x68, 0xC8, 0x0, 0x0, 0x0, 0x88, 0xC8, 0x0, 0x0, 0x0, 0xA8, 0xC8, 0x0, 0x0, 0x0, 0xC8, 0xC8, 0x0, 0x0, 0x0, 0xE8, 0xC8, 0x0, 0x0, 0x0, 0x8, 0xC9, 0x0, 0x0, 0x0, 0xE8, 0x94, 0x0, 0x0, 0x0, 0x28, 0xC9, 0x0, 0x0, 0x0, 0x48, 0xC9, 0x0, 0x0, 0x0, 0x68, 0xC9, 0x0, 0x0, 0x0, 0x88, 0xC9, 0x0, 0x0, 0x0, 0x28, 0x82, 0x0, 0x2D, 0x0, 0x88, 0xB1, 0x0, 0x0, 0x0, 0xA8, 0xC9, 0x0, 0x0, 0x0, 0xC8, 0xC9, 0x0, 0x0, 0x0, 0xE8, 0xC9, 0x0, 0x0, 0x0, 0xA8, 0xC6, 0x0, 0x0, 0x0, 0x8, 0xCA, 0x0, 0x0, 0x0, 0x28, 0xCA, 0x0, 0x0, 0x0, 0xE8, 0xC6, 0x0, 0x0, 0x0, 0x48, 0xCA, 0x0, 0x0, 0x0, 0x68, 0xCA, 0xA0, 0x32, 0x0, 0x8, 0x0, 0xA8, 0x32, 0x0, 0x8, 0x0, 0xB0, 0x32, 0x0, 0x8, 0x0, 0xB8, 0x32, 0x0, 0x8, 0x0, 0xC0, 0x32, 0x0, 0x8, 0x0, 0xC8, 0x32, 0x0, 0x8, 0x0, 0xD0, 0x32, 0x0, 0x8, 0x0, 0xD8, 0x32, 0x0, 0x8, 0x0, 0xE0, 0x32, 0x0, 0x8, 0x0, 0xE8, 0x32, 0x0, 0x8, 0x0, 0xF0, 0x32, 0x0, 0x8, 0x0, 0xF8, 0x32, 0x0, 0x8, 0x0, 0x0, 0x33, 0x0, 0x8, 0x0, 0x8, 0x33, 0x0, 0x8, 0x0, 0x10, 0x33, 0x0, 0x8, 0x0, 0x18, 0x33, 0x0, 0x8, 0x0, 0x20, 0x33, 0x0, 0x8, 0x0, 0x28, 0x33, 0x0, 0x8, 0x0, 0x30, 0x33, 0x0, 0x8, 0x0, 0x38, 0x33, 0x0, 0x8, 0x0, 0x40, 0x33, 0x0, 0x8, 0x0, 0x48, 0x33, 0x0, 0x8, 0x0, 0x50, 0x33, 0x0, 0x8, 0x0, 0x58, 0x33, 0x0, 0x8, 0x0, 0x60, 0x33, 0x0, 0x8, 0x0, 0x68, 0x33, 0x0, 0x8, 0x0, 0x70, 0x33, 0x0, 0x8, 0x0, 0x78, 0x33, 0x0, 0x8, 0x0, 0x80, 0x33, 0x0, 0x8, 0x0, 0x88, 0x33, 0x0, 0x8, 0x0, 0x90, 0x33, 0x0, 0x8, 0x0, 0x98, 0x33, 0x0, 0x8, 0x0, 0xA0, 0x33, 0x0, 0x8, 0x0, 0xA8, 0x33, 0x0, 0x8, 0x0, 0xB0, 0x33, 0x0, 0x8, 0x0, 0xB8, 0x33, 0x0, 0x8, 0x0, 0xC0, 0x33, 0x0, 0x8, 0x0, 0xC8, 0x33, 0x0, 0x8, 0x0, 0xD0, 0x33, 0x0, 0x8, 0x0, 0xD8, 0x33, 0x0, 0x8, 0x0, 0xE0, 0x33, 0x0, 0x8, 0x0, 0xE8, 0x33, 0x0, 0x8, 0x0, 0xF0, 0x33, 0x0, 0x8, 0x0, 0xF8, 0x33, 0x0, 0x8, 0x0, 0x0, 0x34, 0x0, 0x8, 0x0, 0x8, 0x34, 0x0, 0x8, 0x0, 0x10, 0x34, 0x0, 0x8, 0x0, 0x18, 0x34, 0x0, 0x8, 0x0, 0x20, 0x34, 0x0, 0x8, 0x0, 0x28, 0x34, 0x0, 0x8, 0x0, 0x30, 0x34, 0x0, 0x8, 0x0, 0x38, 0x34, 0x0, 0x8, 0x0, 0x40, 0x34, 0x0, 0x8, 0x0, 0x48, 0x34, 0x0, 0x49, 0xD1, 0x0, 0x0, 0x0, 0x69, 0xD1, 0x0, 0x0, 0x0, 0x89, 0xD1, 0x0, 0x0, 0x0, 0xA9, 0xD1, 0x0, 0x0, 0x0, 0xC9, 0xD1, 0x0, 0x0, 0x0, 0xE9, 0xD1, 0x0, 0x0, 0x0, 0x9, 0xD2, 0x0, 0x0, 0x0, 0x29, 0xD2, 0x0, 0x0, 0x0, 0x49, 0xD2, 0x0, 0x0, 0x0, 0x69, 0xD2, 0x0, 0x0, 0x0, 0x89, 0xD2, 0x0, 0x0, 0x0, 0xA9, 0xD2, 0x0, 0x0, 0x0, 0xC9, 0xD2, 0x0, 0x0, 0x0, 0xE9, 0xD2, 0x0, 0x0, 0x0, 0x9, 0xD3, 0x0, 0x0, 0x0, 0x29, 0xD3, 0x0, 0x0, 0x0, 0x49, 0xD3, 0x0, 0x0, 0x0, 0x69, 0xD3, 0x0, 0x0, 0x0, 0x89, 0xD3, 0x0, 0x0, 0x0, 0xA9, 0xD3, 0x0, 0x0, 0x0, 0xC9, 0xD3, 0x0, 0x0, 0x0, 0xE9, 0xD3, 0x0, 0x0, 0x0, 0x9, 0xD4, 0x0, 0x0, 0x0, 0x29, 0xD4, 0x0, 0x0, 0x0, 0x49, 0xD4, 0x0, 0x0, 0x0, 0x69, 0xD4, 0x0, 0x0, 0x0, 0x89, 0xD4, 0x0, 0x0, 0x0, 0xA9, 0xD4, 0x0, 0x0, 0x0, 0xC9, 0xD4, 0x0, 0x0, 0x0, 0xE9, 0xD4, 0x0, 0x0, 0x0, 0x9, 0xD5, 0x0, 0x0, 0x0, 0x29, 0xD5, 0x0, 0x0, 0x0, 0x49, 0xD5, 0x0, 0x0, 0x0, 0x69, 0xD5, 0x0, 0x0, 0x0, 0x89, 0xD5, 0x0, 0x0, 0x0, 0xA9, 0xD5, 0x0, 0x0, 0x0, 0xC9, 0xD5, 0x0, 0x0, 0x0, 0xE9, 0xD5, 0x0, 0x0, 0x0, 0x9, 0xD6, 0x0, 0x0, 0x0, 0x29, 0xD6, 0x0, 0x0, 0x0, 0x49, 0xD6, 0x0, 0x0, 0x0, 0x69, 0xD6, 0x0, 0x0, 0x0, 0x89, 0xD6, 0x0, 0x0, 0x0, 0xA9, 0xD6, 0x0, 0x0, 0x0, 0xC9, 0xD6, 0x0, 0x0, 0x0, 0xE9, 0xD6, 0x0, 0x0, 0x0, 0x9, 0xD7, 0x0, 0x0, 0x0, 0x29, 0xD7, 0x0, 0x0, 0x0, 0x49, 0xD7, 0x0, 0x0, 0x0, 0x69, 0xD7, 0x0, 0x0, 0x0, 0x89, 0xD7, 0x0, 0x0, 0x0, 0xA9, 0xD7, 0x0, 0x0, 0x0, 0xC9, 0xD7, 0x0, 0x0, 0x0, 0xE9, 0xD7, 0x0, 0x0, 0x0, 0x9, 0xD8, 0x0, 0x0, 0x0, 0x29, 0xD8, 0x0, 0x0, 0x0, 0x49, 0xD8, 0x0, 0x0, 0x0, 0x69, 0xD8, 0x0, 0x0, 0x0, 0x89, 0xD8, 0x0, 0x0, 0x0, 0xA9, 0xD8, 0x0, 0x0, 0x0, 0xC9, 0xD8, 0x0, 0x0, 0x0, 0xE9, 0xD8, 0x0, 0x0, 0x0, 0x9, 0xD9, 0x0, 0x0, 0x0, 0x29, 0xD9, 0x0, 0x0, 0x0, 0x49, 0xD9, 0x0, 0x0, 0x0, 0x69, 0xD9, 0x0, 0x0, 0x0, 0x89, 0xD9, 0x0, 0x0, 0x0, 0xA9, 0xD9, 0x0, 0x0, 0x0, 0xC9, 0xD9, 0x0, 0x0, 0x0, 0xE9, 0xD9, 0x0, 0x0, 0x0, 0x9, 0xDA, 0x0, 0x0, 0x0, 0x29, 0xDA, 0x0, 0x0, 0x0, 0x49, 0xDA, 0x0, 0x0, 0x0, 0x69, 0xDA, 0x0, 0x0, 0x0, 0x89, 0xDA, 0x0, 0x0, 0x0, 0xA9, 0xDA, 0x0, 0x0, 0x0, 0xC9, 0xDA, 0x0, 0x0, 0x0, 0xE9, 0xDA, 0x0, 0x0, 0x0, 0x9, 0xDB, 0x0, 0x0, 0x0, 0x29, 0xDB, 0x0, 0x0, 0x0, 0x49, 0xDB, 0x0, 0x0, 0x0, 0x69, 0xDB, 0x0, 0x0, 0x0, 0x89, 0xDB, 0x0, 0x0, 0x0, 0xA9, 0xDB, 0x0, 0x0, 0x0, 0xC9, 0xDB, 0x0, 0x0, 0x0, 0xE9, 0xDB, 0x0, 0x0, 0x0, 0x9, 0xDC, 0x0, 0x0, 0x0, 0x29, 0xDC, 0x0, 0x0, 0x0, 0x49, 0xDC, 0x0, 0x0, 0x0, 0x69, 0xDC, 0x0, 0x0, 0x0, 0x89, 0xDC, 0x0, 0x0, 0x0, 0xA9, 0xDC, 0x0, 0x0, 0x0, 0xC9, 0xDC, 0x0, 0x0, 0x0, 0xE9, 0xDC, 0x0, 0x0, 0x0, 0x9, 0xDD, 0x0, 0x0, 0x0, 0x29, 0xDD, 0x0, 0x0, 0x0, 0x49, 0xDD, 0x0, 0x0, 0x0, 0x69, 0xDD, 0x0, 0x0, 0x0, 0x89, 0xDD, 0x0, 0x0, 0x0, 0xA9, 0xDD, 0x0, 0x0, 0x0, 0xC9, 0xDD, 0x0, 0x0, 0x0, 0xE9, 0xDD, 0x0, 0x0, 0x0, 0x9, 0xDE, 0x0, 0x0, 0x0, 0x29, 0xDE, 0x0, 0x0, 0x0, 0x49, 0xDE, 0x0, 0x0, 0x0, 0x69, 0xDE, 0x0, 0x0, 0x0, 0x89, 0xDE, 0x0, 0x0, 0x0, 0xA9, 0xDE, 0x0, 0x0, 0x0, 0xC9, 0xDE, 0x0, 0x0, 0x0, 0xE9, 0xDE, 0x0, 0x0, 0x0, 0x9, 0xDF, 0x0, 0x0, 0x0, 0x29, 0xDF, 0x0, 0x0, 0x0, 0x49, 0xDF, 0x0, 0x0, 0x0, 0x69, 0xDF, 0x0, 0x0, 0x0, 0x89, 0xDF, 0x0, 0x0, 0x0, 0xA9, 0xDF, 0x0, 0x0, 0x0, 0xC9, 0xDF, 0x0, 0x0, 0x0, 0xE9, 0xDF, 0x0, 0x0, 0x0, 0x9, 0xE0, 0x0, 0x0, 0x0, 0x29, 0xE0, 0x0, 0x0, 0x0, 0x49, 0xE0, 0x0, 0x0, 0x0, 0x69, 0xE0, 0x0, 0x0, 0x0, 0x89, 0xE0, 0x0, 0x0, 0x0, 0xA9, 0xE0, 0x0, 0x0, 0x0, 0xC9, 0xE0, 0x0, 0x0, 0x0, 0xE9, 0xE0, 0x0, 0x0, 0x0, 0x9, 0xE1, 0x0, 0x0, 0x0, 0x29, 0xE1, 0x0, 0x0, 0x0, 0x49, 0xE1, 0x0, 0x0, 0x0, 0x69, 0xE1, 0x0, 0x0, 0x0, 0x89, 0xE1, 0x0, 0x0, 0x0, 0xA9, 0xE1, 0x0, 0x0, 0x0, 0xC9, 0xE1, 0x0, 0x0, 0x0, 0xE9, 0xE1, 0x0, 0x0, 0x0, 0x9, 0xE2, 0x0, 0x0, 0x0, 0x29, 0xE2, 0x0, 0x0, 0x0, 0x49, 0xE2, 0x0, 0x0, 0x0, 0x69, 0xE2, 0x0, 0x0, 0x0, 0x89, 0xE2, 0x0, 0x0, 0x0, 0xA9, 0xE2, 0x0, 0x0, 0x0, 0xC9, 0xE2, 0x0, 0x0, 0x0, 0xE9, 0xE2, 0x0, 0x0, 0x0, 0x9, 0xE3, 0x0, 0x0, 0x0, 0x29, 0xE3, 0x0, 0x0, 0x0, 0x49, 0xE3, 0x0, 0x0, 0x0, 0x69, 0xE3, 0x0, 0x0, 0x0, 0x89, 0xE3, 0x0, 0x0, 0x0, 0xA9, 0xE3, 0x0, 0x0, 0x0, 0xC9, 0xE3, 0x0, 0x0, 0x0, 0xE9, 0xE3, 0x0, 0x0, 0x0, 0x9, 0xE4, 0x0, 0x0, 0x0, 0x29, 0xE4, 0x0, 0x0, 0x0, 0x49, 0xE4, 0x0, 0x0, 0x0, 0x69, 0xE4, 0x0, 0x0, 0x0, 0x89, 0xE4, 0x0, 0x0, 0x0, 0x9, 0x0, 0x28, 0x38, 0x0, 0xA9, 0xE4, 0x0, 0x0, 0x0, 0xC9, 0xE4, 0x0, 0x0, 0x0, 0xE9, 0xE4, 0x0, 0x0, 0x0, 0x9, 0xE5, 0x0, 0x0, 0x0, 0x29, 0xE5, 0x0, 0x0, 0x0, 0x49, 0xE5, 0x0, 0x0, 0x0, 0x69, 0xE5, 0x0, 0x0, 0x0, 0x89, 0xE5, 0x0, 0x0, 0x0, 0xA9, 0xE5, 0x0, 0x0, 0x0, 0xC9, 0xE5, 0x0, 0x0, 0x0, 0xE9, 0xE5, 0x0, 0x0, 0x0, 0x9, 0xE6, 0x0, 0x0, 0x0, 0x29, 0xE6, 0x0, 0x0, 0x0, 0x49, 0xE6, 0x0, 0x0, 0x0, 0x69, 0xE6, 0x0, 0x0, 0x0, 0x89, 0xE6, 0x0, 0x0, 0x0, 0xA9, 0xE6, 0x0, 0x0, 0x0, 0xC9, 0xE6, 0x0, 0x0, 0x0, 0xE9, 0xE6, 0x0, 0x0, 0x0, 0x9, 0xE7, 0x0, 0x0, 0x0, 0x29, 0xE7, 0x0, 0x0, 0x0, 0x49, 0xE7, 0x0, 0x0, 0x0, 0x69, 0xE7, 0x0, 0x0, 0x0, 0x89, 0xE7, 0x0, 0x0, 0x0, 0xA9, 0xE7, 0x0, 0x0, 0x0, 0xC9, 0xE7, 0x0, 0x0, 0x0, 0xE9, 0xE7, 0x0, 0x0, 0x0, 0x9, 0xE8, 0x0, 0x0, 0x0, 0x29, 0xE8, 0x0, 0x0, 0x0, 0x49, 0xE8, 0x0, 0x0, 0x0, 0x69, 0xE8, 0x0, 0x0, 0x0, 0x89, 0xE8, 0x0, 0x0, 0x0, 0xA9, 0xE8, 0x0, 0x0, 0x0, 0xC9, 0xE8, 0x0, 0x0, 0x0, 0xE9, 0xE8, 0x0, 0x0, 0x0, 0x9, 0xE9, 0x0, 0x0, 0x0, 0x9, 0x0, 0xD0, 0x38, 0x0, 0x29, 0xE9, 0x0, 0x0, 0x0, 0x49, 0xE9, 0x0, 0x0, 0x0, 0x69, 0xE9, 0x0, 0x0, 0x0, 0x89, 0xE9, 0x0, 0x0, 0x0, 0xA9, 0xE9, 0x0, 0x0, 0x0, 0xC9, 0xE9, 0x0, 0x0, 0x0, 0xE9, 0xE9, 0x0, 0x0, 0x0, 0x9, 0xEA, 0x0, 0x0, 0x0, 0x29, 0xEA, 0x0, 0x0, 0x0, 0x49, 0xEA, 0x0, 0x0, 0x0, 0x69, 0xEA, 0x0, 0x0, 0x0, 0x89, 0xEA, 0x0, 0x0, 0x0, 0xA9, 0xEA, 0x0, 0x0, 0x0, 0xC9, 0xEA, 0x0, 0x0, 0x0, 0xE9, 0xEA, 0x0, 0x0, 0x0, 0x9, 0xEB, 0x0, 0x0, 0x0, 0x29, 0xEB, 0x0, 0x0, 0x0, 0x49, 0xEB, 0x0, 0x0, 0x0, 0x69, 0xEB, 0x0, 0x0, 0x0, 0x89, 0xEB, 0x0, 0x0, 0x0, 0xA9, 0xEB, 0x0, 0x0, 0x0, 0xC9, 0xEB, 0x0, 0x0, 0x0, 0xE9, 0xEB, 0x0, 0x0, 0x0, 0x9, 0xEC, 0x0, 0x0, 0x0, 0x29, 0xEC, 0x0, 0x0, 0x0, 0x49, 0xEC, 0x0, 0x0, 0x0, 0x69, 0xEC, 0x0, 0x0, 0x0, 0x89, 0xEC, 0x0, 0x0, 0x0, 0xA9, 0xEC, 0x0, 0x0, 0x0, 0xC9, 0xEC, 0x0, 0x0, 0x0, 0xE9, 0xEC, 0x0, 0x0, 0x0, 0x9, 0xED, 0x0, 0x0, 0x0, 0x29, 0xED, 0x0, 0x0, 0x0, 0x49, 0xED, 0x0, 0x0, 0x0, 0x69, 0xED, 0x0, 0x0, 0x0, 0x89, 0xED, 0x0, 0x0, 0x0, 0xA9, 0xED, 0x0, 0x0, 0x0, 0xC9, 0xED, 0x0, 0x0, 0x0, 0xE9, 0xED, 0x0, 0x0, 0x0, 0x9, 0xEE, 0x0, 0x0, 0x0, 0x29, 0xEE, 0x0, 0x0, 0x0, 0x49, 0xEE, 0x0, 0x0, 0x0, 0x69, 0xEE, 0x0, 0x0, 0x0, 0x89, 0xEE, 0x0, 0x0, 0x0, 0xA9, 0xEE, 0x0, 0x0, 0x0, 0xC9, 0xEE, 0x0, 0x0, 0x0, 0xE9, 0xEE, 0x0, 0x0, 0x0, 0x9, 0xEF, 0x0, 0x0, 0x0, 0x29, 0xEF, 0x0, 0x0, 0x0, 0x49, 0xEF, 0x0, 0x0, 0x0, 0x69, 0xEF, 0x0, 0x0, 0x0, 0x89, 0xEF, 0x0, 0x0, 0x0, 0xA9, 0xEF, 0x0, 0x0, 0x0, 0xC9, 0xEF, 0x0, 0x0, 0x0, 0xE9, 0xEF, 0x0, 0x0, 0x0, 0x9, 0xF0, 0x0, 0x0, 0x0, 0x29, 0xF0, 0x0, 0x0, 0x0, 0x49, 0xF0, 0x0, 0x0, 0x0, 0x69, 0xF0, 0x0, 0x0, 0x0, 0x89, 0xF0, 0x0, 0x0, 0x0, 0xA9, 0xF0, 0x0, 0x0, 0x0, 0xC9, 0xF0, 0x0, 0x0, 0x0, 0xE9, 0xF0, 0x0, 0x0, 0x0, 0x9, 0xF1, 0x0, 0x0, 0x0, 0x29, 0xF1, 0x0, 0x0, 0x0, 0x49, 0xF1, 0x0, 0x0, 0x0, 0x69, 0xF1, 0x0, 0x0, 0x0, 0x89, 0xF1, 0x0, 0x0, 0x0, 0xA9, 0xF1, 0x0, 0x0, 0x0, 0xC9, 0xF1, 0x0, 0x0, 0x0, 0xE9, 0xF1, 0x0, 0x0, 0x0, 0x9, 0xF2, 0x0, 0x0, 0x0, 0x29, 0xF2, 0x0, 0x0, 0x0, 0x49, 0xF2, 0x0, 0x0, 0x0, 0x69, 0xF2, 0x0, 0x0, 0x0, 0x89, 0xF2, 0x0, 0x0, 0x0, 0xA9, 0xF2, 0x0, 0x0, 0x0, 0x9, 0x0, 0xB0, 0x3C, 0x0, 0x9, 0x0, 0xB8, 0x3C, 0x0, 0x9, 0x0, 0xC0, 0x3C, 0x0, 0x9, 0x0, 0xC8, 0x3C, 0x0, 0x9, 0x0, 0xD0, 0x3C, 0x0, 0x9, 0x0, 0xD8, 0x3C, 0x0, 0x9, 0x0, 0xE0, 0x3C, 0x0, 0x9, 0x0, 0xE8, 0x3C, 0x0, 0x9, 0x0, 0xF0, 0x3C, 0x0, 0x9, 0x0, 0xF8, 0x3C, 0x0, 0x9, 0x0, 0x0, 0x3D, 0x0, 0x9, 0x0, 0x8, 0x3D, 0x0, 0x9, 0x0, 0x10, 0x3D, 0x0, 0x9, 0x0, 0x18, 0x3D, 0x0, 0x9, 0x0, 0x20, 0x3D, 0x0, 0x9, 0x0, 0x28, 0x3D, 0x0, 0x9, 0x0, 0x30, 0x3D, 0x0, 0x9, 0x0, 0x38, 0x3D, 0x0, 0x9, 0x0, 0x40, 0x3D, 0x0, 0x9, 0x0, 0x48, 0x3D, 0x0, 0x9, 0x0, 0x50, 0x3D, 0x0, 0x9, 0x0, 0x58, 0x3D, 0x0, 0x9, 0x0, 0x60, 0x3D, 0x0, 0x9, 0x0, 0x68, 0x3D, 0x0, 0x9, 0x0, 0x70, 0x3D, 0x0, 0x9, 0x0, 0x78, 0x3D, 0x0, 0x9, 0x0, 0x80, 0x3D, 0x0, 0x9, 0x0, 0x88, 0x3D, 0x0, 0x9, 0x0, 0x90, 0x3D, 0x0, 0x9, 0x0, 0x98, 0x3D, 0x0, 0x9, 0x0, 0xA0, 0x3D, 0x0, 0x9, 0x0, 0xA8, 0x3D, 0x0, 0x9, 0x0, 0xB0, 0x3D, 0x0, 0x9, 0x0, 0xB8, 0x3D, 0x0, 0x9, 0x0, 0xC0, 0x3D, 0x0, 0x9, 0x0, 0xC8, 0x3D, 0x0, 0x9, 0x0, 0xD0, 0x3D, 0x0, 0x9, 0x0, 0xD8, 0x3D, 0x0, 0x9, 0x0, 0xE0, 0x3D, 0x0, 0x9, 0x0, 0xE8, 0x3D, 0x0, 0x9, 0x0, 0xF0, 0x3D, 0x0, 0x9, 0x0, 0xF8, 0x3D, 0x0, 0x9, 0x0, 0x0, 0x3E, 0x0, 0x9, 0x0, 0x8, 0x3E, 0x0, 0x9, 0x0, 0x10, 0x3E, 0x0, 0x9, 0x0, 0x18, 0x3E, 0x0, 0x9, 0x0, 0x20, 0x3E, 0x0, 0x9, 0x0, 0x28, 0x3E, 0x0, 0x9, 0x0, 0x30, 0x3E, 0x0, 0x9, 0x0, 0x38, 0x3E, 0x0, 0x9, 0x0, 0x40, 0x3E, 0x0, 0x9, 0x0, 0x48, 0x3E, 0x0, 0x9, 0x0, 0x50, 0x3E, 0x0, 0x9, 0x0, 0x58, 0x3E, 0x0, 0x9, 0x0, 0x60, 0x3E, 0x0, 0x9, 0x0, 0x68, 0x3E, 0x0, 0x9, 0x0, 0x70, 0x3E, 0x0, 0x9, 0x0, 0x78, 0x3E, 0x0, 0x9, 0x0, 0x80, 0x3E, 0x0, 0x9, 0x0, 0x88, 0x3E, 0x0, 0x9, 0x0, 0x90, 0x3E, 0x0, 0x9, 0x0, 0x98, 0x3E, 0x0, 0x9, 0x0, 0xA0, 0x3E, 0x0, 0x9, 0x0, 0xA8, 0x3E, 0x0, 0x9, 0x0, 0xB0, 0x3E, 0x0, 0x9, 0x0, 0xB8, 0x3E, 0x0, 0x9, 0x0, 0xC0, 0x3E, 0x0, 0x9, 0x0, 0xC8, 0x3E, 0x0, 0x9, 0x0, 0xD0, 0x3E, 0x0, 0x9, 0x0, 0xD8, 0x3E, 0x0, 0x9, 0x0, 0xE0, 0x3E, 0x0, 0x9, 0x0, 0xE8, 0x3E, 0x0, 0x9, 0x0, 0xF0, 0x3E, 0x0, 0x9, 0x0, 0xF8, 0x3E, 0x0, 0x9, 0x0, 0x0, 0x3F, 0x0, 0x9, 0x0, 0x8, 0x3F, 0x0, 0x9, 0x0, 0x10, 0x3F, 0x0, 0x9, 0x0, 0x18, 0x3F, 0x0, 0x9, 0x0, 0x20, 0x3F, 0x0, 0x9, 0x0, 0x28, 0x3F, 0x0, 0x9, 0x0, 0x30, 0x3F, 0x0, 0x9, 0x0, 0x38, 0x3F, 0x0, 0x9, 0x0, 0x40, 0x3F, 0x0, 0x9, 0x0, 0x48, 0x3F, 0x0, 0x9, 0x0, 0x50, 0x3F, 0x0, 0x9, 0x0, 0x58, 0x3F, 0x0, 0x9, 0x0, 0x60, 0x3F, 0x0, 0x9, 0x0, 0x68, 0x3F, 0x0, 0x9, 0x0, 0x70, 0x3F, 0x0, 0x9, 0x0, 0x78, 0x3F, 0x0, 0x9, 0x0, 0x80, 0x3F, 0x0, 0x9, 0x0, 0x88, 0x3F, 0x0, 0x9, 0x0, 0x90, 0x3F, 0x0, 0x9, 0x0, 0x98, 0x3F, 0x0, 0x9, 0x0, 0xA0, 0x3F, 0x0, 0x9, 0x0, 0xA8, 0x3F, 0x0, 0x9, 0x0, 0xB0, 0x3F, 0x0, 0x9, 0x0, 0xB8, 0x3F, 0x0, 0x9, 0x0, 0xC0, 0x3F, 0x0, 0x9, 0x0, 0xC8, 0x3F, 0x0, 0x9, 0x0, 0xD0, 0x3F, 0x0, 0x9, 0x0, 0xD8, 0x3F, 0x0, 0x9, 0x0, 0xE0, 0x3F, 0x0, 0x9, 0x0, 0xE8, 0x3F, 0x0, 0x9, 0x0, 0xF0, 0x3F, 0x0, 0x9, 0x0, 0xF8, 0x3F, 0x0, 0x9, 0x0, 0x0, 0x40, 0x0, 0x9, 0x0, 0x8, 0x40, 0x0, 0x9, 0x0, 0x10, 0x40, 0x0, 0x9, 0x0, 0x18, 0x40, 0x0, 0x9, 0x0, 0x20, 0x40, 0x0, 0x9, 0x0, 0x28, 0x40, 0x0, 0x9, 0x0, 0x30, 0x40, 0x0, 0x9, 0x0, 0x38, 0x40, 0x0, 0x9, 0x0, 0x40, 0x40, 0x0, 0x9, 0x0, 0x48, 0x40, 0x0, 0x9, 0x0, 0x50, 0x40, 0x0, 0x9, 0x0, 0x58, 0x40, 0x0, 0x9, 0x0, 0x60, 0x40, 0x0, 0x9, 0x0, 0x88, 0x3B, 0x0, 0x9, 0x0, 0x90, 0x3B, 0x0, 0x9, 0x0, 0x98, 0x3B, 0x0, 0x9, 0x0, 0xA0, 0x3B, 0x0, 0x9, 0x0, 0xA8, 0x3B, 0x0, 0x9, 0x0, 0xB0, 0x3B, 0x0, 0x9, 0x0, 0xB8, 0x3B, 0x0, 0x9, 0x0, 0xC0, 0x3B, 0x0, 0x9, 0x0, 0xC8, 0x3B, 0x0, 0x9, 0x0, 0xD0, 0x3B, 0x0, 0x9, 0x0, 0xD8, 0x3B, 0x0, 0x9, 0x0, 0xE0, 0x3B, 0x0, 0x9, 0x0, 0xE8, 0x3B, 0x0, 0x9, 0x0, 0xF0, 0x3B, 0x0, 0x9, 0x0, 0x68, 0x40, 0x0, 0xC9, 0x1, 0x1, 0x0, 0x0, 0x9, 0x0, 0x78, 0x40, 0x0, 0x9, 0x2, 0x1, 0x0, 0x0, 0x9, 0x0, 0x88, 0x40, 0x0, 0x9, 0x0, 0x90, 0x40, 0x0, 0x9, 0x0, 0x98, 0x40, 0x0, 0x89, 0x2, 0x1, 0x0, 0x0, 0x9, 0x0, 0xA8, 0x40, 0x0, 0xC9, 0x2, 0x1, 0x0, 0x0, 0x9, 0x0, 0xB8, 0x40, 0x0, 0x9, 0x3, 0x1, 0x0, 0x0, 0x9, 0x0, 0xC8, 0x40, 0x0, 0x49, 0x3, 0x1, 0x0, 0x0, 0x9, 0x0, 0xD8, 0x40, 0x0, 0x9, 0x0, 0xE0, 0x40, 0x0, 0x9, 0x0, 0xE8, 0x40, 0x0, 0x9, 0x0, 0xA8, 0x39, 0x0, 0xC9, 0x3, 0x1, 0x0, 0x0, 0x9, 0x0, 0x10, 0x3A, 0x0, 0xE9, 0x3, 0x1, 0x0, 0x0, 0x9, 0x0, 0x0, 0x41, 0x0, 0x29, 0x4, 0x1, 0x0, 0x0, 0x9, 0x0, 0x10, 0x41, 0x0, 0x9, 0x0, 0xB0, 0x38, 0x0, 0x9, 0x0, 0x18, 0x41, 0x0, 0x89, 0x4, 0x1, 0x0, 0x0, 0x9, 0x0, 0x28, 0x3C, 0x0, 0x9, 0x0, 0x28, 0x41, 0x0, 0x9, 0x0, 0x30, 0x41, 0x0, 0x9, 0x0, 0x38, 0x41, 0x0, 0x9, 0x0, 0x40, 0x41, 0x0, 0x9, 0x0, 0x48, 0x41, 0x0, 0x9, 0x0, 0x50, 0x41, 0x0, 0x9, 0x0, 0x58, 0x41, 0x0, 0x9, 0x0, 0x60, 0x41, 0x0, 0x9, 0x0, 0x68, 0x41, 0x0, 0x9, 0x0, 0x70, 0x41, 0x0, 0x9, 0x0, 0x78, 0x41, 0x0, 0x9, 0x0, 0x80, 0x41, 0x0, 0x9, 0x0, 0x88, 0x41, 0x0, 0x9, 0x0, 0x90, 0x41, 0x0, 0x9, 0x0, 0x98, 0x41, 0x0, 0x9, 0x0, 0xA0, 0x41, 0x0, 0x9, 0x0, 0xA8, 0x41, 0x0, 0x9, 0x0, 0xB0, 0x41, 0x0, 0x9, 0x0, 0xB8, 0x41, 0x0, 0x9, 0x0, 0xC0, 0x41, 0x0, 0x9, 0x0, 0xC8, 0x41, 0x0, 0x9, 0x0, 0xD0, 0x41, 0x0, 0x9, 0x0, 0xD8, 0x41, 0x0, 0x9, 0x0, 0xE0, 0x41, 0x0, 0x9, 0x0, 0xE8, 0x41, 0x0, 0x9, 0x0, 0xF0, 0x41, 0x0, 0x9, 0x0, 0xF8, 0x41, 0x0, 0x9, 0x0, 0x0, 0x42, 0x0, 0x9, 0x0, 0x8, 0x42, 0x0, 0x9, 0x0, 0x10, 0x42, 0x0, 0x9, 0x0, 0x18, 0x42, 0x0, 0x9, 0x0, 0x20, 0x42, 0x0, 0x9, 0x0, 0x28, 0x42, 0x0, 0x9, 0x0, 0x30, 0x42, 0x0, 0x9, 0x0, 0x38, 0x42, 0x0, 0x9, 0x0, 0x40, 0x42, 0x0, 0x9, 0x0, 0x48, 0x42, 0x0, 0x9, 0x0, 0x50, 0x42, 0x0, 0x9, 0x0, 0x58, 0x42, 0x0, 0x9, 0x0, 0x60, 0x42, 0x0, 0x9, 0x0, 0x68, 0x42, 0x0, 0x9, 0x0, 0x70, 0x42, 0x0, 0x9, 0x0, 0x78, 0x42, 0x0, 0x9, 0x0, 0x80, 0x42, 0x0, 0x9, 0x0, 0x88, 0x42, 0x0, 0x9, 0x0, 0x90, 0x42, 0x0, 0x9, 0x0, 0x98, 0x42, 0x0, 0x9, 0x0, 0xA0, 0x42, 0x0, 0x9, 0x0, 0xA8, 0x42, 0x0, 0x9, 0x0, 0xB0, 0x42, 0x0, 0x9, 0x0, 0xB8, 0x42, 0x0, 0x9, 0x0, 0xC0, 0x42, 0x0, 0x9, 0x0, 0xC8, 0x42, 0x0, 0x9, 0x0, 0xD0, 0x42, 0x0, 0x9, 0x0, 0xD8, 0x42, 0x0, 0x9, 0x0, 0xE0, 0x42, 0x0, 0x9, 0x0, 0xE8, 0x42, 0x0, 0x9, 0x0, 0xF0, 0x42, 0x0, 0x9, 0x0, 0xF8, 0x42, 0x0, 0x9, 0x0, 0x0, 0x43, 0x0, 0x9, 0x0, 0x8, 0x43, 0x0, 0x9, 0x0, 0x10, 0x43, 0x0, 0x9, 0x0, 0x18, 0x43, 0x0, 0x9, 0x0, 0x20, 0x43, 0x0, 0x9, 0x0, 0x28, 0x43, 0x0, 0x9, 0x0, 0x30, 0x43, 0x0, 0x9, 0x0, 0x38, 0x43, 0x0, 0x9, 0x0, 0x40, 0x43, 0x0, 0x9, 0x0, 0x48, 0x43, 0x0, 0x9, 0x0, 0x50, 0x43, 0x0, 0x9, 0x0, 0x58, 0x43, 0x0, 0x9, 0x0, 0x60, 0x43, 0x0, 0x9, 0x0, 0x68, 0x43, 0x0, 0x9, 0x0, 0x70, 0x43, 0x0, 0x9, 0x0, 0x78, 0x43, 0x0, 0x9, 0x0, 0x80, 0x43, 0x0, 0x9, 0x0, 0x88, 0x43, 0x0, 0x9, 0x0, 0x90, 0x43, 0x0, 0x9, 0x0, 0x98, 0x43, 0x0, 0x9, 0x0, 0xA0, 0x43, 0x0, 0x9, 0x0, 0xA8, 0x43, 0x0, 0x9, 0x0, 0xB0, 0x43, 0x0, 0x9, 0x0, 0xB8, 0x43, 0x0, 0x9, 0x0, 0xC0, 0x43, 0x0, 0x9, 0x0, 0xC8, 0x43, 0x0, 0x9, 0x0, 0xD0, 0x43, 0x0, 0x9, 0x0, 0xD8, 0x43, 0x0, 0x9, 0x0, 0xE0, 0x43, 0x0, 0x9, 0x0, 0xE8, 0x43, 0x0, 0x9, 0x0, 0xF0, 0x43, 0x0, 0x9, 0x0, 0xF8, 0x43, 0x0, 0x9, 0x0, 0x0, 0x44, 0x0, 0x9, 0x0, 0x8, 0x44, 0x0, 0x9, 0x0, 0x10, 0x44, 0x0, 0x9, 0x0, 0x18, 0x44, 0x0, 0x9, 0x0, 0x20, 0x44, 0x0, 0xA9, 0x10, 0x1, 0x0, 0x0, 0xC9, 0x10, 0x1, 0x0, 0x0, 0xE9, 0x10, 0x1, 0x0, 0x0, 0x9, 0x11, 0x1, 0x0, 0x0, 0x29, 0x11, 0x1, 0x0, 0x0, 0x49, 0x11, 0x1, 0x0, 0x0, 0x69, 0x11, 0x1, 0x0, 0x0, 0x89, 0x11, 0x1, 0x0, 0x0, 0xA9, 0x11, 0x1, 0x0, 0x0, 0xC9, 0x11, 0x1, 0x0, 0x0, 0xE9, 0x11, 0x1, 0x0, 0x0, 0x9, 0x12, 0x1, 0x0, 0x0, 0x29, 0x12, 0x1, 0x0, 0x0, 0x49, 0x12, 0x1, 0x0, 0x0, 0x69, 0x12, 0x1, 0x0, 0x0, 0x89, 0x12, 0x1, 0x0, 0x0, 0xA9, 0x12, 0x1, 0x0, 0x0, 0xC9, 0x12, 0x1, 0x0, 0x0, 0xE9, 0x12, 0x1, 0x0, 0x0, 0x9, 0x13, 0x1, 0x0, 0x0, 0x29, 0x13, 0x1, 0x0, 0x0, 0x49, 0x13, 0x1, 0x0, 0x0, 0x69, 0x13, 0x1, 0x0, 0x0, 0x89, 0x13, 0x1, 0x0, 0x0, 0xA9, 0x13, 0x1, 0x0, 0x0, 0xC9, 0x13, 0x1, 0x0, 0x0, 0xE9, 0x13, 0x1, 0x0, 0x0, 0x9, 0x14, 0x1, 0x0, 0x0, 0x29, 0x14, 0x1, 0x0, 0x0, 0x49, 0x14, 0x1, 0x0, 0x0, 0x69, 0x14, 0x1, 0x0, 0x0, 0x89, 0x14, 0x1, 0x0, 0x0, 0xA9, 0x14, 0x1, 0x0, 0x0, 0xC9, 0x14, 0x1, 0x0, 0x0, 0xE9, 0x14, 0x1, 0x0, 0x0, 0x9, 0x15, 0x1, 0x0, 0x0, 0x29, 0x15, 0x1, 0x0, 0x0, 0x49, 0x15, 0x1, 0x0, 0x0, 0x69, 0x15, 0x1, 0x0, 0x0, 0x89, 0x15, 0x1, 0x0, 0x0, 0xA9, 0x15, 0x1, 0x0, 0x0, 0xC9, 0x15, 0x1, 0x0, 0x0, 0xE9, 0x15, 0x1, 0x0, 0x0, 0x9, 0x16, 0x1, 0x0, 0x0, 0x29, 0x16, 0x1, 0x0, 0x0, 0x49, 0x16, 0x1, 0x0, 0x0, 0x69, 0x16, 0x1, 0x0, 0x0, 0x89, 0x16, 0x1, 0x0, 0x0, 0xA9, 0x16, 0x1, 0x0, 0x0, 0xC9, 0x16, 0x1, 0x0, 0x0, 0xE9, 0x16, 0x1, 0x0, 0x0, 0x9, 0x17, 0x1, 0x0, 0x0, 0x29, 0x17, 0x1, 0x0, 0x0, 0x49, 0x17, 0x1, 0x0, 0x0, 0x69, 0x17, 0x1, 0x0, 0x0, 0x89, 0x17, 0x1, 0x0, 0x0, 0xA9, 0x17, 0x1, 0x0, 0x0, 0xC9, 0x17, 0x1, 0x0, 0x0, 0xE9, 0x17, 0x1, 0x0, 0x0, 0x9, 0x18, 0x1, 0x0, 0x0, 0x29, 0x18, 0x1, 0x0, 0x0, 0x49, 0x18, 0x1, 0x0, 0x0, 0x69, 0x18, 0x1, 0x0, 0x0, 0x89, 0x18, 0x1, 0x0, 0x0, 0xA9, 0x18, 0x1, 0x0, 0x0, 0xC9, 0x18, 0x1, 0x0, 0x0, 0xE9, 0x18, 0x1, 0x0, 0x0, 0x9, 0x19, 0x1, 0x0, 0x0, 0x29, 0x19, 0x1, 0x0, 0x0, 0x49, 0x19, 0x1, 0x0, 0x0, 0x69, 0x19, 0x1, 0x0, 0x0, 0x89, 0x19, 0x1, 0x0, 0x0, 0xA9, 0x19, 0x1, 0x0, 0x0, 0xC9, 0x19, 0x1, 0x0, 0x0, 0xE9, 0x19, 0x1, 0x0, 0x0, 0x9, 0x1A, 0x1, 0x0, 0x0, 0x29, 0x1A, 0x1, 0x0, 0x0, 0x49, 0x1A, 0x1, 0x0, 0x0, 0x69, 0x1A, 0x1, 0x0, 0x0, 0x89, 0x1A, 0x1, 0x0, 0x0, 0xA9, 0x1A, 0x1, 0x0, 0x0, 0xC9, 0x1A, 0x1, 0x0, 0x0, 0xE9, 0x1A, 0x1, 0x0, 0x0, 0x9, 0x1B, 0x1, 0x0, 0x0, 0x29, 0x1B, 0x1, 0x0, 0x0, 0x49, 0x1B, 0x1, 0x0, 0x0, 0x69, 0x1B, 0x1, 0x0, 0x0, 0x89, 0x1B, 0x1, 0x0, 0x0, 0xA9, 0x1B, 0x1, 0x0, 0x0, 0xC9, 0x1B, 0x1, 0x0, 0x0, 0xE9, 0x1B, 0x1, 0x0, 0x0, 0x9, 0x1C, 0x1, 0x0, 0x0, 0x29, 0x1C, 0x1, 0x0, 0x0, 0x49, 0x1C, 0x1, 0x0, 0x0, 0x69, 0x1C, 0x1, 0x0, 0x0, 0x89, 0x1C, 0x1, 0x0, 0x0, 0xA9, 0x1C, 0x1, 0x0, 0x0, 0xC9, 0x1C, 0x1, 0x0, 0x0, 0xE9, 0x1C, 0x1, 0x0, 0x0, 0x9, 0x1D, 0x1, 0x0, 0x0, 0x29, 0x1D, 0x1, 0x0, 0x0, 0x49, 0x1D, 0x1, 0x0, 0x0, 0x69, 0x1D, 0x1, 0x0, 0x0, 0xC9, 0xFC, 0x0, 0x0, 0x0, 0x89, 0x1D, 0x1, 0x0, 0x0, 0xA9, 0x1D, 0x1, 0x0, 0x0, 0xC9, 0x1D, 0x1, 0x0, 0x0, 0xE9, 0x1D, 0x1, 0x0, 0x0, 0x9, 0x1E, 0x1, 0x0, 0x0, 0x29, 0x1E, 0x1, 0x0, 0x0, 0x49, 0x1E, 0x1, 0x0, 0x0, 0x29, 0xFD, 0x0, 0x0, 0x0, 0x49, 0xFD, 0x0, 0x0, 0x0, 0x69, 0xFD, 0x0, 0x0, 0x0, 0x89, 0xFD, 0x0, 0x0, 0x0, 0xA9, 0xFD, 0x0, 0x0, 0x0, 0xC9, 0xFD, 0x0, 0x0, 0x0, 0xE9, 0xFD, 0x0, 0x0, 0x0, 0x9, 0xFE, 0x0, 0x0, 0x0, 0x29, 0xFE, 0x0, 0x0, 0x0, 0x49, 0xFE, 0x0, 0x0, 0x0, 0x69, 0xFE, 0x0, 0x0, 0x0, 0x89, 0xFE, 0x0, 0x0, 0x0, 0xA9, 0xFE, 0x0, 0x0, 0x0, 0xC9, 0xFE, 0x0, 0x0, 0x0, 0xE9, 0xFE, 0x0, 0x0, 0x0, 0x9, 0xFF, 0x0, 0x0, 0x0, 0x29, 0xFF, 0x0, 0x0, 0x0, 0x49, 0xFF, 0x0, 0x0, 0x0, 0x69, 0xFF, 0x0, 0x0, 0x0, 0x89, 0xFF, 0x0, 0x0, 0x0, 0xA9, 0xFF, 0x0, 0x0, 0x0, 0xC9, 0xFF, 0x0, 0x0, 0x0, 0xE9, 0xFF, 0x0, 0x0, 0x0, 0x9, 0x0, 0x1, 0x0, 0x0, 0x29, 0x0, 0x1, 0x0, 0x0, 0x49, 0x0, 0x1, 0x0, 0x0, 0x69, 0x0, 0x1, 0x0, 0x0, 0x89, 0x0, 0x1, 0x0, 0x0, 0xA9, 0x0, 0x1, 0x0, 0x0, 0xC9, 0x0, 0x1, 0x0, 0x0, 0xE9, 0x0, 0x1, 0x0, 0x0, 0x9, 0x1, 0x1, 0x0, 0x0, 0x29, 0x1, 0x1, 0x0, 0x0, 0x49, 0x1, 0x1, 0x0, 0x0, 0x9, 0x0, 0x98, 0x47, 0x0, 0x89, 0x1E, 0x1, 0x0, 0x0, 0xA9, 0x1E, 0x1, 0x0, 0x0, 0xC9, 0x1E, 0x1, 0x0, 0x0, 0xE9, 0x1E, 0x1, 0x0, 0x0, 0x9, 0x1F, 0x1, 0x0, 0x0, 0x29, 0x1F, 0x1, 0x0, 0x0, 0x49, 0x2, 0x1, 0x0, 0x0, 0x49, 0x1F, 0x1, 0x0, 0x0, 0x69, 0x1F, 0x1, 0x0, 0x0, 0x89, 0x1F, 0x1, 0x0, 0x0, 0xA9, 0x1F, 0x1, 0x0, 0x0, 0xC9, 0x1F, 0x1, 0x0, 0x0, 0xE9, 0x1F, 0x1, 0x0, 0x0, 0x9, 0x20, 0x1, 0x0, 0x0, 0x29, 0x20, 0x1, 0x0, 0x0, 0x49, 0x20, 0x1, 0x0, 0x0, 0x69, 0x20, 0x1, 0x0, 0x0, 0x89, 0x20, 0x1, 0x0, 0x0, 0xA9, 0x20, 0x1, 0x0, 0x0, 0xC9, 0x20, 0x1, 0x0, 0x0, 0xE9, 0x20, 0x1, 0x0, 0x0, 0x9, 0x21, 0x1, 0x0, 0x0, 0x29, 0x21, 0x1, 0x0, 0x0, 0x49, 0x21, 0x1, 0x0, 0x0, 0x69, 0x21, 0x1, 0x0, 0x0, 0x89, 0x21, 0x1, 0x0, 0x0, 0xA9, 0x21, 0x1, 0x0, 0x0, 0xC9, 0x21, 0x1, 0x0, 0x0, 0xE9, 0x21, 0x1, 0x0, 0x0, 0x9, 0x22, 0x1, 0x0, 0x0, 0x29, 0x22, 0x1, 0x0, 0x0, 0x49, 0x22, 0x1, 0x0, 0x0, 0x69, 0x22, 0x1, 0x0, 0x0, 0x89, 0x22, 0x1, 0x0, 0x0, 0xA9, 0x22, 0x1, 0x0, 0x0, 0xC9, 0x22, 0x1, 0x0, 0x0, 0xE9, 0x22, 0x1, 0x0, 0x0, 0x9, 0x23, 0x1, 0x0, 0x0, 0x29, 0x23, 0x1, 0x0, 0x0, 0x49, 0x23, 0x1, 0x0, 0x0, 0x69, 0x23, 0x1, 0x0, 0x0, 0x9, 0x0, 0xE0, 0x48, 0x0, 0x9, 0x0, 0xE8, 0x48, 0x0, 0x9, 0x0, 0xF0, 0x48, 0x0, 0x9, 0x0, 0xF8, 0x48, 0x0, 0x9, 0x0, 0x0, 0x49, 0x0, 0x9, 0x0, 0x8, 0x49, 0x0, 0x9, 0x0, 0x10, 0x49, 0x0, 0x9, 0x0, 0x18, 0x49, 0x0, 0x9, 0x0, 0x20, 0x49, 0x0, 0x9, 0x0, 0x28, 0x49, 0x0, 0x9, 0x0, 0x30, 0x49, 0x0, 0x9, 0x0, 0x38, 0x49, 0x0, 0x9, 0x0, 0x40, 0x49, 0x0, 0x9, 0x0, 0x48, 0x49, 0x0, 0x9, 0x0, 0x50, 0x49, 0x0, 0x9, 0x0, 0x58, 0x49, 0x0, 0x9, 0x0, 0x60, 0x49, 0x0, 0x9, 0x0, 0x68, 0x49, 0x0, 0x9, 0x0, 0x70, 0x49, 0x0, 0x9, 0x0, 0x78, 0x49, 0x0, 0x9, 0x0, 0x80, 0x49, 0x0, 0x9, 0x0, 0x88, 0x49, 0x0, 0x9, 0x0, 0x90, 0x49, 0x0, 0x9, 0x0, 0x98, 0x49, 0x0, 0x9, 0x0, 0xA0, 0x49, 0x0, 0x9, 0x0, 0xA8, 0x49, 0x0, 0x9, 0x0, 0xB0, 0x49, 0x0, 0x9, 0x0, 0xB8, 0x49, 0x0, 0x9, 0x0, 0xC0, 0x49, 0x0, 0x9, 0x0, 0xC8, 0x49, 0x0, 0x9, 0x0, 0xD0, 0x49, 0x0, 0x9, 0x0, 0x80, 0x39, 0x0, 0x9, 0x0, 0xD8, 0x49, 0x0, 0x9, 0x0, 0x70, 0x39, 0x0, 0x9, 0x0, 0xE0, 0x49, 0x0, 0x9, 0x0, 0xE8, 0x49, 0x0, 0x9, 0x0, 0xF0, 0x49, 0x0, 0x9, 0x0, 0xF8, 0x49, 0x0, 0x9, 0x0, 0x0, 0x4A, 0x0, 0x9, 0x0, 0x8, 0x4A, 0x0, 0x9, 0x0, 0x10, 0x4A, 0x0, 0x9, 0x0, 0x18, 0x4A, 0x0, 0x9, 0x0, 0x20, 0x4A, 0x0, 0x9, 0x0, 0x28, 0x4A, 0x0, 0x9, 0x0, 0x30, 0x4A, 0x0, 0x9, 0x0, 0x38, 0x4A, 0x0, 0x9, 0x0, 0x40, 0x4A, 0x0, 0x9, 0x0, 0x48, 0x4A, 0x0, 0x9, 0x0, 0x50, 0x4A, 0x0, 0x9, 0x0, 0x58, 0x4A, 0x0, 0x9, 0x0, 0x60, 0x4A, 0x0, 0x9, 0x0, 0x68, 0x4A, 0x0, 0x9, 0x0, 0x70, 0x4A, 0x0, 0x9, 0x0, 0x78, 0x4A, 0x0, 0x9, 0x0, 0x80, 0x4A, 0x0, 0x9, 0x0, 0x88, 0x4A, 0x0, 0x9, 0x0, 0x90, 0x4A, 0x0, 0x9, 0x0, 0x98, 0x4A, 0x0, 0x9, 0x0, 0xA0, 0x4A, 0x0, 0x9, 0x0, 0xA8, 0x4A, 0x0, 0x9, 0x0, 0xB0, 0x4A, 0x0, 0xE9, 0x2A, 0x1, 0x0, 0x0, 0x9, 0x2B, 0x1, 0x0, 0x0, 0x29, 0x2B, 0x1, 0x0, 0x0, 0x49, 0x2B, 0x1, 0x0, 0x0, 0x69, 0x2B, 0x1, 0x0, 0x0, 0x89, 0x2B, 0x1, 0x0, 0x0, 0x9, 0x0, 0xE8, 0x4A, 0x0, 0x9, 0x0, 0xF0, 0x4A, 0x0, 0x9, 0x0, 0xF8, 0x4A, 0x0, 0x9, 0x0, 0x0, 0x4B, 0x0, 0x9, 0x0, 0x8, 0x4B, 0x0, 0x9, 0x0, 0x10, 0x4B, 0x0, 0x9, 0x0, 0x18, 0x4B, 0x0, 0x9, 0x0, 0x20, 0x4B, 0x0, 0x9, 0x0, 0x28, 0x4B, 0x0, 0x9, 0x0, 0x30, 0x4B, 0x0, 0x9, 0x0, 0x38, 0x4B, 0x0, 0x9, 0x0, 0x40, 0x4B, 0x0, 0x9, 0x0, 0x48, 0x4B, 0x0, 0x9, 0x0, 0x50, 0x4B, 0x0, 0x9, 0x0, 0x58, 0x4B, 0x0, 0x9, 0x0, 0x60, 0x4B, 0x0, 0x9, 0x0, 0x68, 0x4B, 0x0, 0x9, 0x0, 0x70, 0x4B, 0x0, 0x9, 0x0, 0x78, 0x4B, 0x0, 0x9, 0x0, 0x80, 0x4B, 0x0, 0x9, 0x0, 0x88, 0x4B, 0x0, 0x9, 0x0, 0x90, 0x4B, 0x0, 0x9, 0x0, 0x98, 0x4B, 0x0, 0x9, 0x0, 0xA0, 0x4B, 0x0, 0x9, 0x0, 0xA8, 0x4B, 0x0, 0x9, 0x0, 0xB0, 0x4B, 0x0, 0x9, 0x0, 0xB8, 0x4B, 0x0, 0x9, 0x0, 0xC0, 0x4B, 0x0, 0x9, 0x0, 0xC8, 0x4B, 0x0, 0x9, 0x0, 0xD0, 0x4B, 0x0, 0x9, 0x0, 0xD8, 0x4B, 0x0, 0x9, 0x0, 0xE0, 0x4B, 0x0, 0x9, 0x0, 0xE8, 0x4B, 0x0, 0x9, 0x0, 0xF0, 0x4B, 0x0, 0x9, 0x0, 0xF8, 0x4B, 0x0, 0x9, 0x0, 0x0, 0x4C, 0x0, 0x9, 0x0, 0x8, 0x4C, 0x0, 0x9, 0x0, 0x10, 0x4C, 0x0, 0x9, 0x0, 0x50, 0x3B, 0x0, 0x9, 0x0, 0x58, 0x3B, 0x0, 0x9, 0x0, 0x60, 0x3B, 0x0, 0x9, 0x0, 0x68, 0x3B, 0x0, 0x9, 0x0, 0x70, 0x3B, 0x0, 0x9, 0x0, 0x78, 0x3B, 0x0, 0x9, 0x0, 0x80, 0x3B, 0x0, 0x9, 0x0, 0x18, 0x4C, 0x0, 0x9, 0x0, 0x20, 0x4C, 0x0, 0x9, 0x0, 0x28, 0x4C, 0x0, 0x9, 0x0, 0x30, 0x4C, 0x0, 0x9, 0x0, 0x38, 0x4C, 0x0, 0x9, 0x0, 0x40, 0x4C, 0x0, 0x9, 0x0, 0x48, 0x4C, 0x0, 0x9, 0x0, 0x50, 0x4C, 0x0, 0x9, 0x0, 0x58, 0x4C, 0x0, 0x9, 0x0, 0x60, 0x4C, 0x0, 0x9, 0x0, 0x68, 0x4C, 0x0, 0x9, 0x0, 0x70, 0x4C, 0x0, 0x9, 0x0, 0x78, 0x4C, 0x0, 0x9, 0x0, 0x80, 0x4C, 0x0, 0x9, 0x0, 0x88, 0x4C, 0x0, 0x9, 0x0, 0x90, 0x4C, 0x0, 0x9, 0x0, 0x98, 0x4C, 0x0, 0x9, 0x0, 0x30, 0x47, 0x0, 0x9, 0x0, 0x38, 0x47, 0x0, 0x9, 0x0, 0x40, 0x47, 0x0, 0x9, 0x0, 0x48, 0x47, 0x0, 0x9, 0x0, 0x50, 0x47, 0x0, 0x9, 0x0, 0x58, 0x47, 0x0, 0x9, 0x0, 0x60, 0x47, 0x0, 0x9, 0x0, 0x68, 0x47, 0x0, 0x9, 0x0, 0x70, 0x47, 0x0, 0x9, 0x0, 0x78, 0x47, 0x0, 0x9, 0x0, 0x80, 0x47, 0x0, 0x9, 0x0, 0x88, 0x47, 0x0, 0x9, 0x0, 0x90, 0x47, 0x0, 0x9, 0x0, 0xA0, 0x4C, 0x0, 0x9, 0x0, 0xA8, 0x4C, 0x0, 0x9, 0x0, 0xB0, 0x4C, 0x0, 0x9, 0x0, 0xB8, 0x4C, 0x0, 0x9, 0x0, 0xC0, 0x4C, 0x0, 0x9, 0x0, 0xC8, 0x4C, 0x0, 0x9, 0x0, 0xD0, 0x4C, 0x0, 0x9, 0x0, 0xD8, 0x4C, 0x0, 0x9, 0x0, 0xA0, 0x47, 0x0, 0x9, 0x0, 0xA8, 0x47, 0x0, 0x9, 0x0, 0xB0, 0x47, 0x0, 0x9, 0x0, 0xB8, 0x47, 0x0, 0x9, 0x0, 0xC0, 0x47, 0x0, 0x9, 0x0, 0xC8, 0x47, 0x0, 0x9, 0x0, 0xD0, 0x47, 0x0, 0x9, 0x0, 0xD8, 0x47, 0x0, 0x9, 0x0, 0xF8, 0x3B, 0x0, 0x9, 0x0, 0x0, 0x3C, 0x0, 0x9, 0x0, 0x8, 0x3C, 0x0, 0x9, 0x0, 0x10, 0x3C, 0x0, 0x9, 0x0, 0x18, 0x3C, 0x0, 0x9, 0x0, 0x20, 0x3C, 0x0, 0x9, 0x0, 0xE0, 0x4C, 0x0, 0x9, 0x0, 0xE8, 0x4C, 0x0, 0x9, 0x0, 0xF0, 0x4C, 0x0, 0x9, 0x0, 0xF8, 0x4C, 0x0, 0x9, 0x0, 0x0, 0x4D, 0x0, 0x9, 0x0, 0x8, 0x4D, 0x0, 0x9, 0x0, 0x10, 0x4D, 0x0, 0x9, 0x0, 0x18, 0x4D, 0x0, 0x9, 0x0, 0x20, 0x4D, 0x0, 0x9, 0x0, 0x28, 0x4D, 0x0, 0x9, 0x0, 0x30, 0x4D, 0x0, 0x9, 0x0, 0x38, 0x4D, 0x0, 0x9, 0x0, 0x40, 0x4D, 0x0, 0x9, 0x0, 0x48, 0x4D, 0x0, 0x9, 0x0, 0x50, 0x4D, 0x0, 0x9, 0x0, 0x58, 0x4D, 0x0, 0x9, 0x0, 0x60, 0x4D, 0x0, 0x9, 0x0, 0x68, 0x4D, 0x0, 0x9, 0x0, 0x70, 0x4D, 0x0, 0x9, 0x0, 0x78, 0x4D, 0x0, 0x9, 0x0, 0x80, 0x4D, 0x0, 0x9, 0x0, 0x88, 0x4D, 0x0, 0x9, 0x0, 0x90, 0x4D, 0x0, 0x9, 0x0, 0x98, 0x4D, 0x0, 0x9, 0x0, 0xA0, 0x4D, 0x0, 0x9, 0x0, 0xA8, 0x4D, 0x0, 0x9, 0x0, 0xB0, 0x4D, 0x0, 0x9, 0x0, 0xB8, 0x4D, 0x0, 0x9, 0x0, 0xC0, 0x4D, 0x0, 0x9, 0x0, 0xC8, 0x4D, 0x0, 0x9, 0x0, 0xD0, 0x4D, 0x0, 0x9, 0x0, 0xD8, 0x4D, 0x0, 0x9, 0x0, 0xE0, 0x4D, 0x0, 0x9, 0x0, 0xE8, 0x4D, 0x0, 0x9, 0x0, 0xF0, 0x4D, 0x0, 0x9, 0x0, 0xF8, 0x4D, 0x0, 0x9, 0x0, 0x0, 0x4E, 0x0, 0x9, 0x0, 0x8, 0x4E, 0x0, 0x9, 0x0, 0x10, 0x4E, 0x0, 0x9, 0x0, 0x18, 0x4E, 0x0, 0x9, 0x0, 0x20, 0x4E, 0x0, 0x9, 0x0, 0x28, 0x4E, 0x0, 0x9, 0x0, 0x30, 0x4E, 0x0, 0x9, 0x0, 0x38, 0x4E, 0x0, 0x9, 0x0, 0x40, 0x4E, 0x0, 0x9, 0x0, 0x48, 0x4E, 0x0, 0x9, 0x0, 0x50, 0x4E, 0x0, 0x9, 0x0, 0x58, 0x4E, 0x0, 0x89, 0x39, 0x1, 0x0, 0x0, 0xA9, 0x39, 0x1, 0x0, 0x0, 0xC9, 0x39, 0x1, 0x0, 0x0, 0xE9, 0x39, 0x1, 0x0, 0x0, 0x9, 0x3A, 0x1, 0x0, 0x0, 0x29, 0x3A, 0x1, 0x0, 0x0, 0x49, 0x3A, 0x1, 0x0, 0x0, 0x69, 0x3A, 0x1, 0x0, 0x0, 0x89, 0x3A, 0x1, 0x0, 0x0, 0xA9, 0x3A, 0x1, 0x0, 0x0, 0xC9, 0x3A, 0x1, 0x0, 0x0, 0xE9, 0x3A, 0x1, 0x0, 0x0, 0x9, 0x3B, 0x1, 0x0, 0x0, 0x29, 0x3B, 0x1, 0x0, 0x0, 0x49, 0x3B, 0x1, 0x0, 0x0, 0x69, 0x3B, 0x1, 0x0, 0x0, 0x89, 0x3B, 0x1, 0x0, 0x0, 0xA9, 0x3B, 0x1, 0x0, 0x0, 0xC9, 0x3B, 0x1, 0x0, 0x0, 0xE9, 0x3B, 0x1, 0x0, 0x0, 0x9, 0x3C, 0x1, 0x0, 0x0, 0x29, 0x3C, 0x1, 0x0, 0x0, 0x49, 0x3C, 0x1, 0x0, 0x0, 0x69, 0x3C, 0x1, 0x0, 0x0, 0x89, 0x3C, 0x1, 0x0, 0x0, 0xA9, 0x3C, 0x1, 0x0, 0x0, 0xC9, 0x3C, 0x1, 0x0, 0x0, 0xE9, 0x3C, 0x1, 0x0, 0x0, 0x9, 0x3D, 0x1, 0x0, 0x0, 0x29, 0x3D, 0x1, 0x0, 0x0, 0x49, 0x3D, 0x1, 0x0, 0x0, 0x69, 0x3D, 0x1, 0x0, 0x0, 0x89, 0x3D, 0x1, 0x0, 0x0, 0xA9, 0x3D, 0x1, 0x0, 0x0, 0xC9, 0x3D, 0x1, 0x0, 0x0, 0xE9, 0x3D, 0x1, 0x0, 0x0, 0x9, 0x3E, 0x1, 0x0, 0x0, 0x29, 0x3E, 0x1, 0x0, 0x0, 0x49, 0x3E, 0x1, 0x0, 0x0, 0x69, 0x3E, 0x1, 0x0, 0x0, 0x89, 0x3E, 0x1, 0x0, 0x0, 0xA9, 0x3E, 0x1, 0x0, 0x0, 0xC9, 0x3E, 0x1, 0x0, 0x0, 0xE9, 0x3E, 0x1, 0x0, 0x0, 0x9, 0x3F, 0x1, 0x0, 0x0, 0x29, 0x3F, 0x1, 0x0, 0x0, 0x49, 0x3F, 0x1, 0x0, 0x0, 0x69, 0x3F, 0x1, 0x0, 0x0, 0x89, 0x3F, 0x1, 0x0, 0x0, 0xA9, 0x3F, 0x1, 0x0, 0x0, 0xC9, 0x3F, 0x1, 0x0, 0x0, 0xE9, 0x3F, 0x1, 0x0, 0x0, 0x9, 0x40, 0x1, 0x0, 0x0, 0x29, 0x40, 0x1, 0x0, 0x0, 0x49, 0x40, 0x1, 0x0, 0x0, 0x29, 0x2A, 0xA1, 0x35, 0x0, 0x69, 0x40, 0x1, 0x0, 0x0, 0x89, 0x40, 0xF1, 0x35, 0x0, 0xA9, 0x40, 0x1, 0x36, 0x0, 0xC9, 0x40, 0x1, 0x0, 0x0, 0xE9, 0x40, 0x31, 0x36, 0x0, 0x9, 0x41, 0x81, 0x36, 0x0, 0x29, 0x41, 0xB1, 0x36, 0x0, 0x49, 0x41, 0x21, 0x37, 0x0, 0x69, 0x41, 0x41, 0x37, 0x0, 0xA9, 0x2, 0x51, 0x37, 0x0, 0x89, 0x41, 0xB1, 0x37, 0x0, 0xA9, 0x41, 0xA1, 0x37, 0x0, 0x49, 0x4, 0xD1, 0x37, 0x0, 0xC9, 0x41, 0xE1, 0x37, 0x0, 0xE9, 0x41, 0x11, 0x38, 0x0, 0x9, 0x42, 0x21, 0x38, 0x0, 0x29, 0x42, 0x49, 0x38, 0x0, 0x49, 0x42, 0x51, 0x38, 0x0, 0x69, 0x42, 0x69, 0x38, 0x0, 0x89, 0x42, 0x91, 0x38, 0x0, 0xA9, 0x42, 0x99, 0x38, 0x0, 0xC9, 0x42, 0x1, 0x0, 0x0, 0xE9, 0x42, 0x71, 0x37, 0x0, 0x9, 0x43, 0x1, 0x0, 0x0, 0x29, 0x43, 0x31, 0x37, 0x0, 0x9, 0x0, 0xD0, 0x50, 0x0, 0x9, 0x0, 0xD8, 0x50, 0x0, 0x9, 0x0, 0x78, 0x4E, 0x0, 0x9, 0x0, 0xE0, 0x50, 0x0, 0x9, 0x0, 0xE8, 0x50, 0x0, 0x9, 0x0, 0xF0, 0x50, 0x0, 0x9, 0x0, 0xF8, 0x50, 0x0, 0x9, 0x0, 0x0, 0x51, 0x0, 0x9, 0x0, 0xA0, 0x4E, 0x0, 0x9, 0x0, 0xA8, 0x4E, 0x0, 0x9, 0x0, 0xB0, 0x4E, 0x0, 0x9, 0x0, 0xB8, 0x4E, 0x0, 0x9, 0x0, 0xC0, 0x4E, 0x0, 0x9, 0x0, 0xC8, 0x4E, 0x0, 0x9, 0x0, 0xD0, 0x4E, 0x0, 0x9, 0x0, 0xD8, 0x4E, 0x0, 0x9, 0x0, 0xE0, 0x4E, 0x0, 0x9, 0x0, 0x8, 0x51, 0x0, 0x9, 0x0, 0x10, 0x51, 0x0, 0x9, 0x0, 0x18, 0x51, 0x0, 0x9, 0x0, 0x20, 0x51, 0x0, 0x9, 0x0, 0x28, 0x51, 0x0, 0x9, 0x0, 0x30, 0x51, 0x0, 0x9, 0x0, 0x38, 0x51, 0x0, 0x9, 0x0, 0x40, 0x51, 0x0, 0x9, 0x0, 0x48, 0x51, 0x0, 0x9, 0x0, 0x50, 0x51, 0x0, 0x9, 0x0, 0x58, 0x51, 0x0, 0x9, 0x0, 0x60, 0x51, 0x0, 0x9, 0x0, 0x48, 0x39, 0x0, 0x9, 0x0, 0x58, 0x39, 0x0, 0x9, 0x0, 0x68, 0x51, 0x0, 0x9, 0x0, 0x70, 0x51, 0x0, 0x9, 0x0, 0x78, 0x51, 0x0, 0x9, 0x0, 0x80, 0x51, 0x0, 0x9, 0x0, 0x88, 0x51, 0x0, 0x9, 0x0, 0xC0, 0x39, 0x0, 0x9, 0x0, 0xC8, 0x39, 0x0, 0x9, 0x0, 0xD0, 0x39, 0x0, 0x9, 0x0, 0xF0, 0x39, 0x0, 0x9, 0x0, 0x90, 0x51, 0x0, 0x9, 0x0, 0x18, 0x3A, 0x0, 0x9, 0x0, 0x98, 0x51, 0x0, 0x9, 0x0, 0x28, 0x3A, 0x0, 0x9, 0x0, 0x30, 0x3A, 0x0, 0x9, 0x0, 0xA0, 0x51, 0x0, 0x9, 0x0, 0x48, 0x3A, 0x0, 0x9, 0x0, 0x50, 0x3A, 0x0, 0x9, 0x0, 0xA8, 0x51, 0x0, 0x9, 0x0, 0x0, 0x50, 0x0, 0x9, 0x0, 0xB0, 0x51, 0x0, 0x9, 0x0, 0x8, 0x50, 0x0, 0x9, 0x0, 0x10, 0x50, 0x0, 0x9, 0x0, 0x58, 0x3A, 0x0, 0x9, 0x0, 0x60, 0x3A, 0x0, 0x9, 0x0, 0x68, 0x3A, 0x0, 0x9, 0x0, 0x70, 0x3A, 0x0, 0x9, 0x0, 0x78, 0x3A, 0x0, 0x9, 0x0, 0x80, 0x3A, 0x0, 0x9, 0x0, 0x88, 0x3A, 0x0, 0x9, 0x0, 0x90, 0x3A, 0x0, 0x9, 0x0, 0x98, 0x3A, 0x0, 0x9, 0x0, 0xA0, 0x3A, 0x0, 0x9, 0x0, 0xA8, 0x3A, 0x0, 0x9, 0x0, 0xB0, 0x3A, 0x0, 0x9, 0x0, 0xB8, 0x3A, 0x0, 0x9, 0x0, 0xC0, 0x3A, 0x0, 0x9, 0x0, 0xC8, 0x3A, 0x0, 0x9, 0x0, 0xD0, 0x3A, 0x0, 0x9, 0x0, 0xD8, 0x3A, 0x0, 0x9, 0x0, 0xE0, 0x3A, 0x0, 0x9, 0x0, 0xE8, 0x3A, 0x0, 0x9, 0x0, 0xB8, 0x51, 0x0, 0x9, 0x0, 0xC0, 0x51, 0x0, 0x9, 0x0, 0xC8, 0x51, 0x0, 0x9, 0x0, 0xD0, 0x51, 0x0, 0x9, 0x0, 0xD8, 0x51, 0x0, 0x9, 0x0, 0xE0, 0x51, 0x0, 0x9, 0x0, 0xE8, 0x51, 0x0, 0x9, 0x0, 0xF0, 0x51, 0x0, 0x9, 0x0, 0x38, 0x3B, 0x0, 0x9, 0x0, 0x40, 0x3B, 0x0, 0x9, 0x0, 0x48, 0x3B, 0x0, 0x9, 0x0, 0xF8, 0x51, 0x0, 0x9, 0x0, 0x0, 0x52, 0x0, 0x9, 0x0, 0x8, 0x52, 0x0, 0x9, 0x0, 0x10, 0x52, 0x0, 0x9, 0x0, 0x18, 0x52, 0x0, 0x9, 0x0, 0x20, 0x52, 0x0, 0x9, 0x0, 0x28, 0x52, 0x0, 0x9, 0x0, 0x30, 0x52, 0x0, 0x9, 0x0, 0x38, 0x52, 0x0, 0x9, 0x0, 0x40, 0x52, 0x0, 0x9, 0x0, 0x48, 0x52, 0x0, 0x9, 0x0, 0x50, 0x52, 0x0, 0x9, 0x0, 0x58, 0x52, 0x0, 0x9, 0x0, 0x60, 0x52, 0x0, 0x9, 0x0, 0x68, 0x52, 0x0, 0x9, 0x0, 0x70, 0x52, 0x0, 0x9, 0x0, 0x78, 0x52, 0x0, 0x9, 0x0, 0x80, 0x52, 0x0, 0x9, 0x0, 0x88, 0x52, 0x0, 0x9, 0x0, 0x90, 0x52, 0x0, 0x9, 0x0, 0x98, 0x52, 0x0, 0x9, 0x0, 0xA0, 0x52, 0x0, 0x9, 0x0, 0xA8, 0x52, 0x0, 0x9, 0x0, 0xB0, 0x52, 0x0, 0x9, 0x0, 0xB8, 0x52, 0x0, 0x9, 0x0, 0xC0, 0x52, 0x0, 0x9, 0x0, 0xC8, 0x52, 0x0, 0x9, 0x0, 0xD0, 0x52, 0x0, 0x9, 0x0, 0xD8, 0x52, 0x0, 0x9, 0x0, 0xE0, 0x52, 0x0, 0x9, 0x0, 0xE8, 0x52, 0x0, 0x9, 0x0, 0xF0, 0x52, 0x0, 0x9, 0x0, 0xF8, 0x52, 0x0, 0x9, 0x0, 0x0, 0x53, 0x0, 0x9, 0x0, 0x8, 0x53, 0x0, 0x9, 0x0, 0x10, 0x53, 0x0, 0x9, 0x0, 0x18, 0x53, 0x0, 0x9, 0x0, 0x20, 0x53, 0x0, 0x9, 0x0, 0x28, 0x53, 0x0, 0x9, 0x0, 0x30, 0x53, 0x0, 0x9, 0x0, 0x38, 0x53, 0x0, 0x9, 0x0, 0x40, 0x53, 0x0, 0x9, 0x0, 0x48, 0x53, 0x0, 0x9, 0x0, 0x50, 0x53, 0x0, 0x9, 0x0, 0x58, 0x53, 0x0, 0x9, 0x0, 0x60, 0x53, 0x0, 0x9, 0x0, 0x68, 0x53, 0x0, 0x9, 0x0, 0x70, 0x53, 0x0, 0x9, 0x0, 0x78, 0x53, 0x0, 0x9, 0x0, 0x80, 0x53, 0x0, 0x9, 0x0, 0x88, 0x53, 0x0, 0x9, 0x0, 0x90, 0x53, 0x0, 0x9, 0x0, 0x98, 0x53, 0x0, 0x9, 0x0, 0xA0, 0x53, 0x0, 0xAA, 0x4E, 0x1, 0x0, 0x0, 0xCA, 0x4E, 0x1, 0x0, 0x0, 0xEA, 0x4E, 0x1, 0x0, 0x0, 0xA, 0x4F, 0x1, 0x0, 0x0, 0x2A, 0x4F, 0x1, 0x0, 0x0, 0x4A, 0x4F, 0x1, 0x0, 0x0, 0x6A, 0x4F, 0x1, 0x0, 0x0, 0x8A, 0x4F, 0x1, 0x0, 0x0, 0xAA, 0x4F, 0x1, 0x0, 0x0, 0xCA, 0x4F, 0x1, 0x0, 0x0, 0xEA, 0x4F, 0x1, 0x0, 0x0, 0xA, 0x50, 0x1, 0x0, 0x0, 0x2A, 0x50, 0x1, 0x0, 0x0, 0x4A, 0x50, 0x1, 0x0, 0x0, 0x6A, 0x50, 0x1, 0x0, 0x0, 0x8A, 0x50, 0x1, 0x0, 0x0, 0xAA, 0x50, 0x1, 0x0, 0x0, 0xCA, 0x50, 0x1, 0x0, 0x0, 0xEA, 0x50, 0x1, 0x0, 0x0, 0xA, 0x51, 0x1, 0x0, 0x0, 0x2A, 0x51, 0x1, 0x0, 0x0, 0x4A, 0x51, 0x1, 0x0, 0x0, 0x6A, 0x51, 0x1, 0x0, 0x0, 0x8A, 0x51, 0x1, 0x0, 0x0, 0xAA, 0x51, 0x1, 0x0, 0x0, 0xCA, 0x51, 0x1, 0x0, 0x0, 0xA, 0x0, 0x78, 0x54, 0x0, 0xA, 0x0, 0x80, 0x54, 0x0, 0xA, 0x0, 0x88, 0x54, 0x0, 0xA, 0x0, 0x90, 0x54, 0x0, 0xA, 0x0, 0x98, 0x54, 0x0, 0xA, 0x0, 0xA0, 0x54, 0x0, 0xA, 0x0, 0xA8, 0x54, 0x0, 0xA, 0x0, 0xB0, 0x54, 0x0, 0xA, 0x0, 0xB8, 0x54, 0x0, 0xA, 0x0, 0xC0, 0x54, 0x0, 0xA, 0x0, 0xC8, 0x54, 0x0, 0xA, 0x0, 0xD0, 0x54, 0x0, 0xA, 0x0, 0xD8, 0x54, 0x0, 0xA, 0x0, 0xE0, 0x54, 0x0, 0xA, 0x0, 0xE8, 0x54, 0x0, 0xA, 0x0, 0xF0, 0x54, 0x0, 0xA, 0x0, 0xF8, 0x54, 0x0, 0xA, 0x0, 0x0, 0x55, 0x0, 0xA, 0x0, 0x8, 0x55, 0x0, 0xA, 0x0, 0x10, 0x55, 0x0, 0xA, 0x0, 0x18, 0x55, 0x0, 0xA, 0x0, 0x20, 0x55, 0x0, 0xA, 0x0, 0x28, 0x55, 0x0, 0xA, 0x0, 0x30, 0x55, 0x0, 0xA, 0x0, 0x38, 0x55, 0x0, 0xA, 0x0, 0x40, 0x55, 0x0, 0xA, 0x0, 0x48, 0x55, 0x0, 0xA, 0x0, 0x50, 0x55, 0x0, 0xA, 0x0, 0x58, 0x55, 0x0, 0xA, 0x0, 0x60, 0x55, 0x0, 0xA, 0x0, 0x68, 0x55, 0x0, 0xA, 0x0, 0x70, 0x55, 0x0, 0xA, 0x0, 0x78, 0x55, 0x0, 0xA, 0x0, 0x80, 0x55, 0x0, 0xA, 0x0, 0x88, 0x55, 0x0, 0xA, 0x0, 0x90, 0x55, 0x0, 0xA, 0x0, 0x98, 0x55, 0x0, 0xA, 0x0, 0xA0, 0x55, 0x0, 0xA, 0x0, 0xA8, 0x55, 0x0, 0xA, 0x0, 0xB0, 0x55, 0x0, 0xA, 0x0, 0xB8, 0x55, 0x0, 0xA, 0x0, 0xC0, 0x55, 0x0, 0xA, 0x0, 0xC8, 0x55, 0x0, 0xA, 0x0, 0xD0, 0x55, 0x0, 0xA, 0x0, 0xD8, 0x55, 0x0, 0xA, 0x0, 0xE0, 0x55, 0x0, 0xA, 0x0, 0xE8, 0x55, 0x0, 0xA, 0x0, 0xF0, 0x55, 0x0, 0xA, 0x0, 0xF8, 0x55, 0x0, 0xA, 0x0, 0x0, 0x56, 0x0, 0xA, 0x0, 0x8, 0x56, 0x0, 0xA, 0x0, 0x10, 0x56, 0x0, 0xA, 0x0, 0x18, 0x56, 0x0, 0xA, 0x0, 0x20, 0x56, 0x0, 0xA, 0x0, 0x28, 0x56, 0x0, 0xA, 0x0, 0x30, 0x56, 0x0, 0xA, 0x0, 0x38, 0x56, 0x0, 0xA, 0x0, 0x40, 0x56, 0x0, 0xA, 0x0, 0x48, 0x56, 0x0, 0xA, 0x0, 0x50, 0x56, 0x0, 0xA, 0x0, 0x58, 0x56, 0x0, 0xA, 0x0, 0x60, 0x56, 0x0, 0xA, 0x0, 0x68, 0x56, 0x0, 0xA, 0x0, 0x70, 0x56, 0x0, 0xA, 0x0, 0x78, 0x56, 0x0, 0xA, 0x0, 0x80, 0x56, 0x0, 0xA, 0x0, 0x88, 0x56, 0x0, 0xA, 0x0, 0x90, 0x56, 0x0, 0xA, 0x0, 0x98, 0x56, 0x0, 0xA, 0x0, 0xA0, 0x56, 0x0, 0xA, 0x0, 0xA8, 0x56, 0x0, 0xA, 0x0, 0xB0, 0x56, 0x0, 0xA, 0x0, 0xB8, 0x56, 0x0, 0xA, 0x0, 0xC0, 0x56, 0x0, 0xA, 0x0, 0xC8, 0x56, 0x0, 0xA, 0x0, 0xD0, 0x56, 0x0, 0xA, 0x0, 0xD8, 0x56, 0x0, 0xA, 0x0, 0xE0, 0x56, 0x0, 0xA, 0x0, 0xE8, 0x56, 0x0, 0xA, 0x0, 0xF0, 0x56, 0x0, 0xA, 0x0, 0xF8, 0x56, 0x0, 0xA, 0x0, 0x0, 0x57, 0x0, 0xA, 0x0, 0x8, 0x57, 0x0, 0xA, 0x0, 0x10, 0x57, 0x0, 0xA, 0x0, 0x18, 0x57, 0x0, 0xA, 0x0, 0x20, 0x57, 0x0, 0xA, 0x0, 0x28, 0x57, 0x0, 0xA, 0x0, 0x30, 0x57, 0x0, 0xA, 0x0, 0x38, 0x57, 0x0, 0xA, 0x0, 0x40, 0x57, 0x0, 0xA, 0x0, 0x48, 0x57, 0x0, 0xA, 0x0, 0x50, 0x57, 0x0, 0xA, 0x0, 0x58, 0x57, 0x0, 0xA, 0x0, 0x60, 0x57, 0x0, 0xA, 0x0, 0x68, 0x57, 0x0, 0xA, 0x0, 0x70, 0x57, 0x0, 0xA, 0x0, 0x78, 0x57, 0x0, 0xA, 0x0, 0x80, 0x57, 0x0, 0xA, 0x0, 0x88, 0x57, 0x0, 0xA, 0x0, 0x90, 0x57, 0x0, 0xA, 0x0, 0x98, 0x57, 0x0, 0xA, 0x0, 0xA0, 0x57, 0x0, 0xA, 0x0, 0xA8, 0x57, 0x0, 0xA, 0x0, 0xB0, 0x57, 0x0, 0xA, 0x0, 0xB8, 0x57, 0x0, 0xA, 0x0, 0xC0, 0x57, 0x0, 0xA, 0x0, 0xC8, 0x57, 0x0, 0xA, 0x0, 0xD0, 0x57, 0x0, 0xA, 0x0, 0xD8, 0x57, 0x0, 0xA, 0x0, 0xE0, 0x57, 0x0, 0xA, 0x0, 0xE8, 0x57, 0x0, 0xA, 0x0, 0xF0, 0x57, 0x0, 0xA, 0x0, 0xF8, 0x57, 0x0, 0xA, 0x0, 0x0, 0x58, 0x0, 0xA, 0x0, 0x8, 0x58, 0x0, 0xA, 0x0, 0x10, 0x58, 0x0, 0xA, 0x0, 0x18, 0x58, 0x0, 0xA, 0x0, 0x20, 0x58, 0x0, 0xA, 0x0, 0x28, 0x58, 0x0, 0xA, 0x0, 0x30, 0x58, 0x0, 0xA, 0x0, 0x38, 0x58, 0x0, 0xA, 0x0, 0x40, 0x58, 0x0, 0xA, 0x0, 0x48, 0x58, 0x0, 0xA, 0x0, 0x50, 0x58, 0x0, 0xA, 0x0, 0x58, 0x58, 0x0, 0xA, 0x0, 0x60, 0x58, 0x0, 0xA, 0x0, 0x68, 0x58, 0x0, 0xA, 0x0, 0x70, 0x58, 0x0, 0xA, 0x0, 0x78, 0x58, 0x0, 0xEA, 0x54, 0x1, 0x0, 0x0, 0x4A, 0x5C, 0x1, 0x0, 0x0, 0xA, 0x62, 0x1, 0x0, 0x0, 0x8A, 0x5C, 0x1, 0x0, 0x0, 0xA, 0x0, 0x88, 0x58, 0x0, 0x4A, 0x62, 0x1, 0x0, 0x0, 0x6A, 0x62, 0x1, 0x0, 0x0, 0x8A, 0x62, 0x1, 0x0, 0x0, 0xAA, 0x62, 0x1, 0x0, 0x0, 0xCA, 0x62, 0x1, 0x0, 0x0, 0xEA, 0x62, 0x1, 0x0, 0x0, 0xA, 0x63, 0x1, 0x0, 0x0, 0x2A, 0x63, 0x1, 0x0, 0x0, 0x2A, 0x55, 0x1, 0x0, 0x0, 0xA, 0x0, 0xD0, 0x58, 0x0, 0x6A, 0x55, 0x1, 0x0, 0x0, 0xA, 0x0, 0xD8, 0x58, 0x0, 0xAA, 0x55, 0x1, 0x0, 0x0, 0xA, 0x0, 0xE0, 0x58, 0x0, 0x2A, 0x56, 0x1, 0x0, 0x0, 0xA, 0x0, 0xE8, 0x58, 0x0, 0x6A, 0x56, 0x1, 0x0, 0x0, 0xA, 0x0, 0xF0, 0x58, 0x0, 0xAA, 0x56, 0x1, 0x0, 0x0, 0xA, 0x0, 0xF8, 0x58, 0x0, 0xEA, 0x56, 0x1, 0x0, 0x0, 0xA, 0x0, 0x0, 0x59, 0x0, 0x2A, 0x57, 0x1, 0x0, 0x0, 0xA, 0x0, 0x8, 0x59, 0x0, 0x4A, 0x64, 0x1, 0x0, 0x0, 0x6A, 0x64, 0x1, 0x0, 0x0, 0x8A, 0x64, 0x1, 0x0, 0x0, 0xAA, 0x64, 0x1, 0x0, 0x0, 0xCA, 0x64, 0x1, 0x0, 0x0, 0xEA, 0x64, 0x1, 0x0, 0x0, 0xA, 0x65, 0x1, 0x0, 0x0, 0x2A, 0x65, 0x1, 0x0, 0x0, 0x4A, 0x65, 0x1, 0x0, 0x0, 0x6A, 0x65, 0x1, 0x0, 0x0, 0x8A, 0x65, 0x1, 0x0, 0x0, 0xAA, 0x65, 0x1, 0x0, 0x0, 0x2A, 0x5E, 0x1, 0x0, 0x0, 0xA, 0x0, 0x70, 0x59, 0x0, 0xEA, 0x65, 0x1, 0x0, 0x0, 0xA, 0x66, 0x1, 0x0, 0x0, 0x2A, 0x66, 0x1, 0x0, 0x0, 0x4A, 0x66, 0x1, 0x0, 0x0, 0x6A, 0x66, 0x1, 0x0, 0x0, 0x8A, 0x66, 0x1, 0x0, 0x0, 0x2A, 0x60, 0x1, 0x0, 0x0, 0xAA, 0x66, 0x1, 0x0, 0x0, 0xCA, 0x66, 0x1, 0x0, 0x0, 0xEA, 0x66, 0x1, 0x0, 0x0, 0xA, 0x67, 0x1, 0x0, 0x0, 0x2A, 0x67, 0x1, 0x0, 0x0, 0x4A, 0x67, 0x1, 0x0, 0x0, 0x6A, 0x67, 0x1, 0x0, 0x0, 0x8A, 0x67, 0x1, 0x0, 0x0, 0xAA, 0x67, 0x1, 0x0, 0x0, 0xCA, 0x67, 0x1, 0x0, 0x0, 0xEA, 0x67, 0x1, 0x0, 0x0, 0xA, 0x68, 0x1, 0x0, 0x0, 0x2A, 0x68, 0x1, 0x0, 0x0, 0x4A, 0x68, 0x1, 0x0, 0x0, 0x6A, 0x68, 0x1, 0x0, 0x0, 0x8A, 0x68, 0x1, 0x0, 0x0, 0xAA, 0x68, 0x1, 0x0, 0x0, 0xCA, 0x68, 0x1, 0x0, 0x0, 0xEA, 0x68, 0x1, 0x0, 0x0, 0xA, 0x69, 0x1, 0x0, 0x0, 0x2A, 0x69, 0x1, 0x0, 0x0, 0x4A, 0x69, 0x1, 0x0, 0x0, 0x6A, 0x69, 0x1, 0x0, 0x0, 0x8A, 0x69, 0x1, 0x0, 0x0, 0xAA, 0x69, 0x1, 0x0, 0x0, 0xCA, 0x69, 0x1, 0x0, 0x0, 0xEA, 0x69, 0x1, 0x0, 0x0, 0xA, 0x6A, 0x1, 0x0, 0x0, 0x2A, 0x6A, 0x1, 0x0, 0x0, 0x4A, 0x6A, 0x1, 0x0, 0x0, 0x6A, 0x6A, 0x1, 0x0, 0x0, 0x8A, 0x6A, 0x1, 0x0, 0x0, 0xAA, 0x6A, 0x1, 0x0, 0x0, 0xCA, 0x6A, 0x1, 0x0, 0x0, 0xEA, 0x6A, 0x1, 0x0, 0x0, 0xA, 0x6B, 0x1, 0x0, 0x0, 0x2A, 0x6B, 0x1, 0x0, 0x0, 0x4A, 0x6B, 0x1, 0x0, 0x0, 0x6A, 0x6B, 0x1, 0x0, 0x0, 0x8A, 0x6B, 0x1, 0x0, 0x0, 0xAA, 0x6B, 0x1, 0x0, 0x0, 0xCA, 0x6B, 0x1, 0x0, 0x0, 0xEA, 0x6B, 0x1, 0x0, 0x0, 0xA, 0x6C, 0x1, 0x0, 0x0, 0x2A, 0x6C, 0x1, 0x0, 0x0, 0x4A, 0x6C, 0x1, 0x0, 0x0, 0x6A, 0x6C, 0x1, 0x0, 0x0, 0x8A, 0x6C, 0x1, 0x0, 0x0, 0xAA, 0x6C, 0x1, 0x0, 0x0, 0xCA, 0x6C, 0x1, 0x0, 0x0, 0xEA, 0x6C, 0x1, 0x0, 0x0, 0xA, 0x6D, 0x1, 0x0, 0x0, 0x2A, 0x6D, 0x1, 0x0, 0x0, 0x4A, 0x6D, 0x1, 0x0, 0x0, 0x6A, 0x6D, 0x1, 0x0, 0x0, 0x8A, 0x6D, 0x1, 0x0, 0x0, 0xAA, 0x6D, 0x1, 0x0, 0x0, 0xCA, 0x6D, 0x1, 0x0, 0x0, 0xEA, 0x6D, 0x1, 0x0, 0x0, 0xA, 0x6E, 0x1, 0x0, 0x0, 0x2A, 0x6E, 0x1, 0x0, 0x0, 0x4A, 0x6E, 0x1, 0x0, 0x0, 0x6A, 0x6E, 0x1, 0x0, 0x0, 0x8A, 0x6E, 0x1, 0x0, 0x0, 0xAA, 0x6E, 0x1, 0x0, 0x0, 0xCA, 0x6E, 0x1, 0x0, 0x0, 0xEA, 0x6E, 0x1, 0x0, 0x0, 0xA, 0x6F, 0x1, 0x0, 0x0, 0x2A, 0x6F, 0x1, 0x0, 0x0, 0x4A, 0x6F, 0x1, 0x0, 0x0, 0x6A, 0x6F, 0x1, 0x0, 0x0, 0x8A, 0x6F, 0x1, 0x0, 0x0, 0xAA, 0x6F, 0x1, 0x0, 0x0, 0xCA, 0x6F, 0x1, 0x0, 0x0, 0xEA, 0x6F, 0x1, 0x0, 0x0, 0xA, 0x70, 0x1, 0x0, 0x0, 0x2A, 0x70, 0x1, 0x0, 0x0, 0x4A, 0x70, 0x1, 0x0, 0x0, 0x6A, 0x70, 0x1, 0x0, 0x0, 0xA, 0x0, 0x20, 0x5C, 0x0, 0xAA, 0x70, 0x1, 0x0, 0x0, 0xA, 0x0, 0x30, 0x5C, 0x0, 0xEA, 0x70, 0x1, 0x0, 0x0, 0xA, 0x0, 0x40, 0x5C, 0x0, 0x2A, 0x71, 0x1, 0x0, 0x0, 0xA, 0x0, 0x50, 0x5C, 0x0, 0x6A, 0x71, 0x1, 0x0, 0x0, 0xA, 0x0, 0x60, 0x5C, 0x0, 0xAA, 0x71, 0x1, 0x0, 0x0, 0xA, 0x0, 0x70, 0x5C, 0x0, 0xEA, 0x71, 0x1, 0x0, 0x0, 0xA, 0x0, 0x80, 0x5C, 0x0, 0x2A, 0x72, 0x1, 0x0, 0x0, 0xA, 0x0, 0x90, 0x5C, 0x0, 0x6A, 0x72, 0x1, 0x0, 0x0, 0xA, 0x0, 0xA0, 0x5C, 0x0, 0xAA, 0x72, 0x1, 0x0, 0x0, 0xA, 0x0, 0xB0, 0x5C, 0x0, 0xEA, 0x72, 0x1, 0x0, 0x0, 0xA, 0x0, 0xC0, 0x5C, 0x0, 0x2A, 0x73, 0x1, 0x0, 0x0, 0xA, 0x0, 0xD0, 0x5C, 0x0, 0x6A, 0x73, 0x1, 0x0, 0x0, 0xA, 0x0, 0xE0, 0x5C, 0x0, 0xAA, 0x73, 0x1, 0x0, 0x0, 0xA, 0x0, 0xF0, 0x5C, 0x0, 0xEA, 0x73, 0x1, 0x0, 0x0, 0xA, 0x0, 0x0, 0x5D, 0x0, 0x2A, 0x74, 0x1, 0x0, 0x0, 0xA, 0x0, 0x10, 0x5D, 0x0, 0x6A, 0x74, 0x1, 0x0, 0x0, 0xA, 0x0, 0x20, 0x5D, 0x0, 0xAA, 0x74, 0x1, 0x0, 0x0, 0xA, 0x0, 0x30, 0x5D, 0x0, 0xEA, 0x74, 0x1, 0x0, 0x0, 0xA, 0x0, 0x40, 0x5D, 0x0, 0x2A, 0x75, 0x1, 0x0, 0x0, 0xA, 0x0, 0x50, 0x5D, 0x0, 0x6A, 0x75, 0x1, 0x0, 0x0, 0xA, 0x0, 0x60, 0x5D, 0x0, 0xAA, 0x75, 0x1, 0x0, 0x0, 0xA, 0x0, 0x70, 0x5D, 0x0, 0xEA, 0x75, 0x1, 0x0, 0x0, 0xA, 0x0, 0x80, 0x5D, 0x0, 0x2A, 0x76, 0x1, 0x0, 0x0, 0xA, 0x0, 0x90, 0x5D, 0x0, 0x6A, 0x76, 0x1, 0x0, 0x0, 0xA, 0x0, 0xA0, 0x5D, 0x0, 0xAA, 0x76, 0x1, 0x0, 0x0, 0xA, 0x0, 0xB0, 0x5D, 0x0, 0xEA, 0x76, 0x1, 0x0, 0x0, 0xA, 0x0, 0xC0, 0x5D, 0x0, 0x2A, 0x77, 0x1, 0x0, 0x0, 0xA, 0x0, 0xD0, 0x5D, 0x0, 0x6A, 0x77, 0x1, 0x0, 0x0, 0xA, 0x0, 0xE0, 0x5D, 0x0, 0xAA, 0x77, 0x1, 0x0, 0x0, 0xA, 0x0, 0xF0, 0x5D, 0x0, 0xEA, 0x77, 0x1, 0x0, 0x0, 0xA, 0x0, 0x0, 0x5E, 0x0, 0x2A, 0x78, 0x1, 0x0, 0x0, 0xA, 0x0, 0x10, 0x5E, 0x0, 0x6A, 0x78, 0x1, 0x0, 0x0, 0xA, 0x0, 0x20, 0x5E, 0x0, 0xAA, 0x78, 0x1, 0x0, 0x0, 0xA, 0x0, 0x30, 0x5E, 0x0, 0xEA, 0x78, 0x1, 0x0, 0x0, 0xA, 0x0, 0x40, 0x5E, 0x0, 0x2A, 0x79, 0x1, 0x0, 0x0, 0xA, 0x0, 0x50, 0x5E, 0x0, 0x6A, 0x79, 0x1, 0x0, 0x0, 0xA, 0x0, 0x60, 0x5E, 0x0, 0xAA, 0x79, 0x1, 0x0, 0x0, 0xA, 0x0, 0x70, 0x5E, 0x0, 0xEA, 0x79, 0x1, 0x0, 0x0, 0xA, 0x0, 0x80, 0x5E, 0x0, 0x2A, 0x7A, 0x1, 0x0, 0x0, 0xA, 0x0, 0x90, 0x5E, 0x0, 0x6A, 0x7A, 0x1, 0x0, 0x0, 0x8A, 0x7A, 0x1, 0x0, 0x0, 0xAA, 0x7A, 0x1, 0x0, 0x0, 0xCA, 0x7A, 0x1, 0x0, 0x0, 0xEA, 0x7A, 0x1, 0x0, 0x0, 0xA, 0x7B, 0x1, 0x0, 0x0, 0x2A, 0x7B, 0x1, 0x0, 0x0, 0x4A, 0x7B, 0x1, 0x0, 0x0, 0x6A, 0x7B, 0x1, 0x0, 0x0, 0x8A, 0x7B, 0x1, 0x0, 0x0, 0xAA, 0x7B, 0x1, 0x0, 0x0, 0xCA, 0x7B, 0x1, 0x0, 0x0, 0xEA, 0x7B, 0x1, 0x0, 0x0, 0xA, 0x7C, 0x1, 0x0, 0x0, 0x2A, 0x7C, 0x1, 0x0, 0x0, 0x4A, 0x7C, 0x1, 0x0, 0x0, 0x6A, 0x7C, 0x1, 0x0, 0x0, 0x8A, 0x7C, 0x1, 0x0, 0x0, 0xAA, 0x7C, 0x1, 0x0, 0x0, 0xCA, 0x7C, 0x1, 0x0, 0x0, 0xEA, 0x7C, 0x1, 0x0, 0x0, 0xA, 0x7D, 0x1, 0x0, 0x0, 0x2A, 0x7D, 0x1, 0x0, 0x0, 0x4A, 0x7D, 0x1, 0x0, 0x0, 0x6A, 0x7D, 0x1, 0x0, 0x0, 0x8A, 0x7D, 0x1, 0x0, 0x0, 0xAA, 0x7D, 0x1, 0x0, 0x0, 0xCA, 0x7D, 0x1, 0x0, 0x0, 0xEA, 0x7D, 0x1, 0x0, 0x0, 0xA, 0x7E, 0x1, 0x0, 0x0, 0x2A, 0x7E, 0x1, 0x0, 0x0, 0x4A, 0x7E, 0x1, 0x0, 0x0, 0x6A, 0x7E, 0x1, 0x0, 0x0, 0x8A, 0x7E, 0x1, 0x0, 0x0, 0xAA, 0x7E, 0x1, 0x0, 0x0, 0xCA, 0x7E, 0x1, 0x0, 0x0, 0xEA, 0x7E, 0x1, 0x0, 0x0, 0xA, 0x7F, 0x1, 0x0, 0x0, 0x2A, 0x7F, 0x1, 0x0, 0x0, 0x4A, 0x7F, 0x1, 0x0, 0x0, 0x6A, 0x7F, 0x1, 0x0, 0x0, 0x8A, 0x7F, 0x1, 0x0, 0x0, 0xAA, 0x7F, 0x1, 0x0, 0x0, 0xCA, 0x7F, 0x1, 0x0, 0x0, 0xEA, 0x7F, 0x1, 0x0, 0x0, 0xA, 0x80, 0x1, 0x0, 0x0, 0x2A, 0x80, 0x1, 0x0, 0x0, 0x4A, 0x80, 0x1, 0x0, 0x0, 0x6A, 0x80, 0x1, 0x0, 0x0, 0x8A, 0x80, 0x1, 0x0, 0x0, 0xAA, 0x80, 0x1, 0x0, 0x0, 0xCA, 0x80, 0x1, 0x0, 0x0, 0xEA, 0x80, 0x1, 0x0, 0x0, 0xA, 0x81, 0x1, 0x0, 0x0, 0xA, 0x0, 0x48, 0x60, 0x0, 0x4A, 0x81, 0x1, 0x0, 0x0, 0xA, 0x0, 0x58, 0x60, 0x0, 0x8A, 0x81, 0x1, 0x0, 0x0, 0xAA, 0x81, 0x1, 0x0, 0x0, 0xCA, 0x81, 0x1, 0x0, 0x0, 0xA, 0x0, 0x78, 0x60, 0x0, 0xA, 0x82, 0x1, 0x0, 0x0, 0xA, 0x0, 0x88, 0x60, 0x0, 0x4A, 0x82, 0x1, 0x0, 0x0, 0xA, 0x0, 0x98, 0x60, 0x0, 0x8A, 0x82, 0x1, 0x0, 0x0, 0xA, 0x0, 0xA8, 0x60, 0x0, 0xCA, 0x82, 0x1, 0x0, 0x0, 0xEA, 0x82, 0x1, 0x0, 0x0, 0xA, 0x83, 0x1, 0x0, 0x0, 0x2A, 0x83, 0x1, 0x0, 0x0, 0xA, 0x0, 0xD0, 0x60, 0x0, 0x6A, 0x83, 0x1, 0x0, 0x0, 0xA, 0x0, 0xE0, 0x60, 0x0, 0xAA, 0x83, 0x1, 0x0, 0x0, 0xA, 0x0, 0xF0, 0x60, 0x0, 0xEA, 0x83, 0x1, 0x0, 0x0, 0xA, 0x84, 0x1, 0x0, 0x0, 0x2A, 0x84, 0x1, 0x0, 0x0, 0xA, 0x0, 0x10, 0x61, 0x0, 0x6A, 0x84, 0x1, 0x0, 0x0, 0x8A, 0x84, 0x1, 0x0, 0x0, 0xAA, 0x84, 0x1, 0x0, 0x0, 0xCA, 0x84, 0x1, 0x0, 0x0, 0xEA, 0x84, 0x1, 0x0, 0x0, 0xA, 0x85, 0x1, 0x0, 0x0, 0x2A, 0x85, 0x1, 0x0, 0x0, 0x4A, 0x85, 0x1, 0x0, 0x0, 0x6A, 0x85, 0x1, 0x0, 0x0, 0x8A, 0x85, 0x1, 0x0, 0x0, 0xAA, 0x85, 0x1, 0x0, 0x0, 0xCA, 0x85, 0x1, 0x0, 0x0, 0xEA, 0x85, 0x1, 0x0, 0x0, 0xA, 0x86, 0x1, 0x0, 0x0, 0x2A, 0x86, 0x1, 0x0, 0x0, 0x4A, 0x86, 0x1, 0x0, 0x0, 0x6A, 0x86, 0x1, 0x0, 0x0, 0x8A, 0x86, 0x1, 0x0, 0x0, 0xAA, 0x86, 0x1, 0x0, 0x0, 0xCA, 0x86, 0x1, 0x0, 0x0, 0xEA, 0x86, 0x1, 0x0, 0x0, 0xA, 0x87, 0x1, 0x0, 0x0, 0x2A, 0x87, 0x1, 0x0, 0x0, 0x4A, 0x87, 0x1, 0x0, 0x0, 0x6A, 0x87, 0x1, 0x0, 0x0, 0x8A, 0x87, 0x1, 0x0, 0x0, 0xAA, 0x87, 0x1, 0x0, 0x0, 0xCA, 0x87, 0x1, 0x0, 0x0, 0xEA, 0x87, 0x1, 0x0, 0x0, 0xA, 0x88, 0x1, 0x0, 0x0, 0x2A, 0x88, 0x1, 0x0, 0x0, 0x4A, 0x88, 0x1, 0x0, 0x0, 0x6A, 0x88, 0x1, 0x0, 0x0, 0x8A, 0x88, 0x1, 0x0, 0x0, 0xAA, 0x88, 0x1, 0x0, 0x0, 0xCA, 0x88, 0x1, 0x0, 0x0, 0xEA, 0x88, 0x1, 0x0, 0x0, 0xA, 0x89, 0x1, 0x0, 0x0, 0x2A, 0x89, 0x1, 0x0, 0x0, 0x4A, 0x89, 0x1, 0x0, 0x0, 0x6A, 0x89, 0x1, 0x0, 0x0, 0x8A, 0x89, 0x1, 0x0, 0x0, 0xAA, 0x89, 0x1, 0x0, 0x0, 0xCA, 0x89, 0x1, 0x0, 0x0, 0xEA, 0x89, 0x1, 0x0, 0x0, 0xA, 0x8A, 0x1, 0x0, 0x0, 0x2A, 0x8A, 0x1, 0x0, 0x0, 0x4A, 0x8A, 0x1, 0x0, 0x0, 0x6A, 0x8A, 0x1, 0x0, 0x0, 0x8A, 0x8A, 0x1, 0x0, 0x0, 0xAA, 0x8A, 0x1, 0x0, 0x0, 0xCA, 0x8A, 0x1, 0x0, 0x0, 0xEA, 0x8A, 0x1, 0x0, 0x0, 0xA, 0x8B, 0x1, 0x0, 0x0, 0x2A, 0x8B, 0x1, 0x0, 0x0, 0x4A, 0x8B, 0x1, 0x0, 0x0, 0x6A, 0x8B, 0x1, 0x0, 0x0, 0x8A, 0x8B, 0x1, 0x0, 0x0, 0xAA, 0x8B, 0x1, 0x0, 0x0, 0xCA, 0x8B, 0x1, 0x0, 0x0, 0xEA, 0x8B, 0x1, 0x0, 0x0, 0xA, 0x8C, 0x1, 0x0, 0x0, 0x2A, 0x8C, 0x1, 0x0, 0x0, 0x4A, 0x8C, 0x1, 0x0, 0x0, 0x6A, 0x8C, 0x1, 0x0, 0x0, 0x8A, 0x8C, 0x1, 0x0, 0x0, 0xAA, 0x8C, 0x1, 0x0, 0x0, 0xCA, 0x8C, 0x1, 0x0, 0x0, 0xEA, 0x8C, 0x1, 0x0, 0x0, 0xA, 0x8D, 0x1, 0x0, 0x0, 0x2A, 0x8D, 0x1, 0x0, 0x0, 0x4A, 0x8D, 0x1, 0x0, 0x0, 0x6A, 0x8D, 0x1, 0x0, 0x0, 0x8A, 0x8D, 0x1, 0x0, 0x0, 0xA, 0x0, 0x68, 0x63, 0x0, 0xA, 0x0, 0x70, 0x63, 0x0, 0xA, 0x0, 0x78, 0x63, 0x0, 0xA, 0x0, 0x80, 0x63, 0x0, 0xA, 0x0, 0x88, 0x63, 0x0, 0xA, 0x0, 0x90, 0x63, 0x0, 0xA, 0x0, 0x98, 0x63, 0x0, 0xA, 0x0, 0xA0, 0x63, 0x0, 0xA, 0x0, 0xA8, 0x63, 0x0, 0xA, 0x0, 0xB0, 0x63, 0x0, 0xA, 0x0, 0xB8, 0x63, 0x0, 0xA, 0x0, 0xC0, 0x63, 0x0, 0xA, 0x0, 0xC8, 0x63, 0x0, 0xA, 0x0, 0xD0, 0x63, 0x0, 0xA, 0x0, 0xD8, 0x63, 0x0, 0xA, 0x0, 0xE0, 0x63, 0x0, 0xA, 0x0, 0xE8, 0x63, 0x0, 0xA, 0x0, 0xF0, 0x63, 0x0, 0xA, 0x0, 0xF8, 0x63, 0x0, 0xA, 0x0, 0x0, 0x64, 0x0, 0xA, 0x0, 0x8, 0x64, 0x0, 0xA, 0x0, 0x10, 0x64, 0x0, 0xA, 0x0, 0x18, 0x64, 0x0, 0xA, 0x0, 0x20, 0x64, 0x0, 0xAA, 0x90, 0x1, 0x0, 0x0, 0xCA, 0x90, 0x1, 0x0, 0x0, 0xEA, 0x90, 0x1, 0x0, 0x0, 0xA, 0x91, 0x1, 0x0, 0x0, 0x2A, 0x91, 0x1, 0x0, 0x0, 0x4A, 0x91, 0x1, 0x0, 0x0, 0x6A, 0x91, 0x1, 0x0, 0x0, 0x8A, 0x91, 0x1, 0x0, 0x0, 0xAA, 0x91, 0x1, 0x0, 0x0, 0xCA, 0x91, 0x1, 0x0, 0x0, 0xEA, 0x91, 0x1, 0x0, 0x0, 0xA, 0x92, 0x1, 0x0, 0x0, 0x2A, 0x92, 0x1, 0x0, 0x0, 0x4A, 0x92, 0x1, 0x0, 0x0, 0x6A, 0x92, 0x1, 0x0, 0x0, 0x8A, 0x92, 0x1, 0x0, 0x0, 0xAA, 0x92, 0x1, 0x0, 0x0, 0xCA, 0x92, 0x1, 0x0, 0x0, 0xEA, 0x92, 0x1, 0x0, 0x0, 0xA, 0x93, 0x1, 0x0, 0x0, 0x2A, 0x93, 0x1, 0x0, 0x0, 0x4A, 0x93, 0x1, 0x0, 0x0, 0x6A, 0x93, 0x1, 0x0, 0x0, 0x8A, 0x93, 0x1, 0x0, 0x0, 0xAA, 0x93, 0x1, 0x0, 0x0, 0xCA, 0x93, 0x1, 0x0, 0x0, 0xEA, 0x93, 0x1, 0x0, 0x0, 0xA, 0x94, 0x1, 0x0, 0x0, 0x2A, 0x94, 0x1, 0x0, 0x0, 0x4A, 0x94, 0x1, 0x0, 0x0, 0x6A, 0x94, 0x1, 0x0, 0x0, 0x8A, 0x94, 0x1, 0x0, 0x0, 0xAA, 0x94, 0x1, 0x0, 0x0, 0xCA, 0x94, 0x1, 0x0, 0x0, 0xEA, 0x94, 0x1, 0x0, 0x0, 0xA, 0x95, 0x1, 0x0, 0x0, 0x2A, 0x95, 0x1, 0x0, 0x0, 0x4A, 0x95, 0x1, 0x0, 0x0, 0x6A, 0x95, 0x1, 0x0, 0x0, 0x8A, 0x95, 0x1, 0x0, 0x0, 0xAA, 0x95, 0x1, 0x0, 0x0, 0xCA, 0x95, 0x1, 0x0, 0x0, 0xEA, 0x95, 0x1, 0x0, 0x0, 0xA, 0x96, 0x1, 0x0, 0x0, 0x2A, 0x96, 0x1, 0x0, 0x0, 0x4A, 0x96, 0x1, 0x0, 0x0, 0x6A, 0x96, 0x1, 0x0, 0x0, 0x8A, 0x96, 0x1, 0x0, 0x0, 0xAA, 0x96, 0x1, 0x0, 0x0, 0xCA, 0x96, 0x1, 0x0, 0x0, 0xEA, 0x96, 0x1, 0x0, 0x0, 0xA, 0x97, 0x1, 0x0, 0x0, 0x2A, 0x97, 0x1, 0x0, 0x0, 0x4A, 0x97, 0x1, 0x0, 0x0, 0x6A, 0x97, 0x1, 0x0, 0x0, 0x8A, 0x97, 0x1, 0x0, 0x0, 0xAA, 0x97, 0x1, 0x0, 0x0, 0xCA, 0x97, 0x1, 0x0, 0x0, 0xEA, 0x97, 0x1, 0x0, 0x0, 0xA, 0x98, 0x1, 0x0, 0x0, 0x2A, 0x98, 0x1, 0x0, 0x0, 0x4A, 0x98, 0x1, 0x0, 0x0, 0x6A, 0x98, 0x1, 0x0, 0x0, 0x8A, 0x98, 0x1, 0x0, 0x0, 0xAA, 0x98, 0x1, 0x0, 0x0, 0xCA, 0x98, 0x1, 0x0, 0x0, 0xEA, 0x98, 0x1, 0x0, 0x0, 0xA, 0x99, 0x1, 0x0, 0x0, 0x2A, 0x99, 0x1, 0x0, 0x0, 0x4A, 0x99, 0x1, 0x0, 0x0, 0x6A, 0x99, 0x1, 0x0, 0x0, 0x8A, 0x99, 0x1, 0x0, 0x0, 0xAA, 0x99, 0x1, 0x0, 0x0, 0xCA, 0x99, 0x1, 0x0, 0x0, 0xEA, 0x99, 0x1, 0x0, 0x0, 0xA, 0x9A, 0x1, 0x0, 0x0, 0x2A, 0x9A, 0x1, 0x0, 0x0, 0x4A, 0x9A, 0x1, 0x0, 0x0, 0x6A, 0x9A, 0x1, 0x0, 0x0, 0x8A, 0x9A, 0x1, 0x0, 0x0, 0xAA, 0x9A, 0x1, 0x0, 0x0, 0xCA, 0x9A, 0x1, 0x0, 0x0, 0xEA, 0x9A, 0x1, 0x0, 0x0, 0xA, 0x9B, 0x1, 0x0, 0x0, 0x2A, 0x9B, 0x1, 0x0, 0x0, 0x4A, 0x9B, 0x1, 0x0, 0x0, 0x6A, 0x9B, 0x1, 0x0, 0x0, 0x8A, 0x9B, 0x1, 0x0, 0x0, 0xAA, 0x9B, 0x1, 0x0, 0x0, 0xCA, 0x9B, 0x1, 0x0, 0x0, 0xEA, 0x9B, 0x1, 0x0, 0x0, 0xA, 0x9C, 0x1, 0x0, 0x0, 0x2A, 0x9C, 0x1, 0x0, 0x0, 0x4A, 0x9C, 0x1, 0x0, 0x0, 0x6A, 0x9C, 0x1, 0x0, 0x0, 0x8A, 0x9C, 0x1, 0x0, 0x0, 0xAA, 0x9C, 0x1, 0x0, 0x0, 0xCA, 0x9C, 0x1, 0x0, 0x0, 0xEA, 0x9C, 0x1, 0x0, 0x0, 0xA, 0x9D, 0x1, 0x0, 0x0, 0x2A, 0x9D, 0x1, 0x0, 0x0, 0x4A, 0x9D, 0x1, 0x0, 0x0, 0x6A, 0x9D, 0x1, 0x0, 0x0, 0x8A, 0x9D, 0x1, 0x0, 0x0, 0xAA, 0x9D, 0x1, 0x0, 0x0, 0xCA, 0x9D, 0x1, 0x0, 0x0, 0xEA, 0x9D, 0x1, 0x0, 0x0, 0xA, 0x9E, 0x1, 0x0, 0x0, 0x2A, 0x9E, 0x1, 0x0, 0x0, 0x4A, 0x9E, 0x1, 0x0, 0x0, 0x6A, 0x9E, 0x1, 0x0, 0x0, 0x8A, 0x9E, 0x1, 0x0, 0x0, 0xAA, 0x9E, 0x1, 0x0, 0x0, 0xCA, 0x9E, 0x1, 0x0, 0x0, 0xEA, 0x9E, 0x1, 0x0, 0x0, 0xA, 0x9F, 0x1, 0x0, 0x0, 0x2A, 0x9F, 0x1, 0x0, 0x0, 0x4A, 0x9F, 0x1, 0x0, 0x0, 0x6A, 0x9F, 0x1, 0x0, 0x0, 0x8A, 0x9F, 0x1, 0x0, 0x0, 0xAA, 0x9F, 0x1, 0x0, 0x0, 0xCA, 0x9F, 0x1, 0x0, 0x0, 0xEA, 0x9F, 0x1, 0x0, 0x0, 0xA, 0xA0, 0x1, 0x0, 0x0, 0x2A, 0xA0, 0x1, 0x0, 0x0, 0x4A, 0xA0, 0x1, 0x0, 0x0, 0x6A, 0xA0, 0x1, 0x0, 0x0, 0x8A, 0xA0, 0x1, 0x0, 0x0, 0xAA, 0xA0, 0x1, 0x0, 0x0, 0xCA, 0xA0, 0x1, 0x0, 0x0, 0xEA, 0xA0, 0x1, 0x0, 0x0, 0xA, 0xA1, 0x1, 0x0, 0x0, 0x2A, 0xA1, 0x1, 0x0, 0x0, 0x4A, 0xA1, 0x1, 0x0, 0x0, 0x6A, 0xA1, 0x1, 0x0, 0x0, 0x8A, 0xA1, 0x1, 0x0, 0x0, 0xAA, 0xA1, 0x1, 0x0, 0x0, 0xCA, 0xA1, 0x1, 0x0, 0x0, 0xEA, 0xA1, 0x1, 0x0, 0x0, 0xA, 0xA2, 0x1, 0x0, 0x0, 0x2A, 0xA2, 0x1, 0x0, 0x0, 0x4A, 0xA2, 0x1, 0x0, 0x0, 0x6A, 0xA2, 0x1, 0x0, 0x0, 0x8A, 0xA2, 0x1, 0x0, 0x0, 0x8A, 0x63, 0x1, 0x0, 0x0, 0xA, 0x0, 0xA8, 0x68, 0x0, 0xCA, 0xA2, 0x1, 0x0, 0x0, 0xEA, 0xA2, 0x1, 0x0, 0x0, 0xA, 0xA3, 0x1, 0x0, 0x0, 0x2A, 0xA3, 0x1, 0x0, 0x0, 0x4A, 0xA3, 0x1, 0x0, 0x0, 0x6A, 0xA3, 0x1, 0x0, 0x0, 0x8A, 0xA3, 0x1, 0x0, 0x0, 0xAA, 0xA3, 0x1, 0x0, 0x0, 0xCA, 0xA3, 0x1, 0x0, 0x0, 0xEA, 0xA3, 0x1, 0x0, 0x0, 0xA, 0xA4, 0x1, 0x0, 0x0, 0x2A, 0xA4, 0x1, 0x0, 0x0, 0x4A, 0xA4, 0x1, 0x0, 0x0, 0x6A, 0xA4, 0x1, 0x0, 0x0, 0x8A, 0xA4, 0x1, 0x0, 0x0, 0xAA, 0xA4, 0x1, 0x0, 0x0, 0xCA, 0xA4, 0x1, 0x0, 0x0, 0xEA, 0xA4, 0x1, 0x0, 0x0, 0xA, 0xA5, 0x1, 0x0, 0x0, 0x2A, 0xA5, 0x1, 0x0, 0x0, 0x4A, 0xA5, 0x1, 0x0, 0x0, 0x6A, 0xA5, 0x1, 0x0, 0x0, 0x8A, 0xA5, 0x1, 0x0, 0x0, 0xAA, 0xA5, 0x1, 0x0, 0x0, 0xCA, 0xA5, 0x1, 0x0, 0x0, 0xEA, 0xA5, 0x1, 0x0, 0x0, 0xA, 0xA6, 0x1, 0x0, 0x0, 0x2A, 0xA6, 0x1, 0x0, 0x0, 0x4A, 0xA6, 0x1, 0x0, 0x0, 0x6A, 0xA6, 0x1, 0x0, 0x0, 0x8A, 0xA6, 0x1, 0x0, 0x0, 0xAA, 0xA6, 0x1, 0x0, 0x0, 0xCA, 0xA6, 0x1, 0x0, 0x0, 0xEA, 0xA6, 0x1, 0x0, 0x0, 0xA, 0xA7, 0x1, 0x0, 0x0, 0x2A, 0xA7, 0x1, 0x0, 0x0, 0x4A, 0xA7, 0x1, 0x0, 0x0, 0x6A, 0xA7, 0x1, 0x0, 0x0, 0x8A, 0xA7, 0x1, 0x0, 0x0, 0xAA, 0xA7, 0x1, 0x0, 0x0, 0xCA, 0xA7, 0x1, 0x0, 0x0, 0x8A, 0x72, 0x1, 0x0, 0x0, 0xA, 0x0, 0xF8, 0x69, 0x0, 0xCA, 0x72, 0x1, 0x0, 0x0, 0xA, 0x0, 0x0, 0x6A, 0x0, 0xA, 0x73, 0x1, 0x0, 0x0, 0xA, 0x0, 0x8, 0x6A, 0x0, 0xCA, 0x73, 0x1, 0x0, 0x0, 0xA, 0x0, 0x10, 0x6A, 0x0, 0xA, 0x74, 0x1, 0x0, 0x0, 0xA, 0x0, 0x18, 0x6A, 0x0, 0x4A, 0x74, 0x1, 0x0, 0x0, 0xA, 0x0, 0x20, 0x6A, 0x0, 0x8A, 0x74, 0x1, 0x0, 0x0, 0xA, 0x0, 0x28, 0x6A, 0x0, 0xCA, 0x74, 0x1, 0x0, 0x0, 0xA, 0x0, 0x30, 0x6A, 0x0, 0xA, 0x75, 0x1, 0x0, 0x0, 0xA, 0x0, 0x38, 0x6A, 0x0, 0x4A, 0x75, 0x1, 0x0, 0x0, 0xA, 0x0, 0x40, 0x6A, 0x0, 0x8A, 0x75, 0x1, 0x0, 0x0, 0xA, 0x0, 0x48, 0x6A, 0x0, 0xCA, 0x75, 0x1, 0x0, 0x0, 0xA, 0x0, 0x50, 0x6A, 0x0, 0xA, 0x76, 0x1, 0x0, 0x0, 0xA, 0x0, 0x58, 0x6A, 0x0, 0x4A, 0x76, 0x1, 0x0, 0x0, 0xA, 0x0, 0x60, 0x6A, 0x0, 0x8A, 0x76, 0x1, 0x0, 0x0, 0xA, 0x0, 0x68, 0x6A, 0x0, 0xCA, 0x76, 0x1, 0x0, 0x0, 0xA, 0x0, 0x70, 0x6A, 0x0, 0xA, 0x77, 0x1, 0x0, 0x0, 0xA, 0x0, 0x78, 0x6A, 0x0, 0x4A, 0x77, 0x1, 0x0, 0x0, 0xA, 0x0, 0x80, 0x6A, 0x0, 0x8A, 0x77, 0x1, 0x0, 0x0, 0xA, 0x0, 0x88, 0x6A, 0x0, 0xCA, 0x77, 0x1, 0x0, 0x0, 0xA, 0x0, 0x90, 0x6A, 0x0, 0xA, 0x78, 0x1, 0x0, 0x0, 0xA, 0x0, 0x98, 0x6A, 0x0, 0x4A, 0x78, 0x1, 0x0, 0x0, 0xA, 0x0, 0xA0, 0x6A, 0x0, 0x8A, 0x78, 0x1, 0x0, 0x0, 0xA, 0x0, 0xA8, 0x6A, 0x0, 0xCA, 0x78, 0x1, 0x0, 0x0, 0xA, 0x0, 0xB0, 0x6A, 0x0, 0xA, 0x79, 0x1, 0x0, 0x0, 0xA, 0x0, 0xB8, 0x6A, 0x0, 0x4A, 0x79, 0x1, 0x0, 0x0, 0xA, 0x0, 0xC0, 0x6A, 0x0, 0x8A, 0x79, 0x1, 0x0, 0x0, 0xA, 0x0, 0xC8, 0x6A, 0x0, 0xCA, 0x79, 0x1, 0x0, 0x0, 0xA, 0x0, 0xD0, 0x6A, 0x0, 0xA, 0x7A, 0x1, 0x0, 0x0, 0xA, 0x0, 0xD8, 0x6A, 0x0, 0x4A, 0x7A, 0x1, 0x0, 0x0, 0xA, 0x0, 0xE0, 0x6A, 0x0, 0xAA, 0xAB, 0x1, 0x0, 0x0, 0xCA, 0xAB, 0x1, 0x0, 0x0, 0xA, 0x0, 0xF8, 0x6A, 0x0, 0xA, 0xAC, 0x1, 0x0, 0x0, 0xA, 0x0, 0x8, 0x6B, 0x0, 0x4A, 0xAC, 0x1, 0x0, 0x0, 0xA, 0x0, 0x18, 0x6B, 0x0, 0x8A, 0xAC, 0x1, 0x0, 0x0, 0xA, 0x0, 0x28, 0x6B, 0x0, 0xCA, 0xAC, 0x1, 0x0, 0x0, 0xA, 0x0, 0x38, 0x6B, 0x0, 0xA, 0xAD, 0x1, 0x0, 0x0, 0xA, 0x0, 0x48, 0x6B, 0x0, 0x4A, 0xAD, 0x1, 0x0, 0x0, 0xA, 0x0, 0x58, 0x6B, 0x0, 0x8A, 0xAD, 0x1, 0x0, 0x0, 0xA, 0x0, 0x68, 0x6B, 0x0, 0xCA, 0xAD, 0x1, 0x0, 0x0, 0xA, 0x0, 0x78, 0x6B, 0x0, 0xA, 0xAE, 0x1, 0x0, 0x0, 0xA, 0x0, 0x88, 0x6B, 0x0, 0x4A, 0xAE, 0x1, 0x0, 0x0, 0xA, 0x0, 0x98, 0x6B, 0x0, 0x8A, 0xAE, 0x1, 0x0, 0x0, 0xA, 0x0, 0xA8, 0x6B, 0x0, 0xCA, 0xAE, 0x1, 0x0, 0x0, 0xA, 0x0, 0xB8, 0x6B, 0x0, 0xA, 0xAF, 0x1, 0x0, 0x0, 0xA, 0x0, 0xC8, 0x6B, 0x0, 0x4A, 0xAF, 0x1, 0x0, 0x0, 0xA, 0x0, 0xD8, 0x6B, 0x0, 0xA, 0x0, 0xE0, 0x6B, 0x0, 0xA, 0x0, 0xE8, 0x6B, 0x0, 0xA, 0x0, 0xF0, 0x6B, 0x0, 0xA, 0x0, 0xF8, 0x6B, 0x0, 0xA, 0x0, 0x0, 0x6C, 0x0, 0xA, 0x0, 0x8, 0x6C, 0x0, 0x4A, 0xB0, 0x1, 0x0, 0x0, 0x6A, 0xB0, 0x1, 0x0, 0x0, 0x8A, 0xB0, 0x1, 0x0, 0x0, 0xAA, 0xB0, 0x1, 0x0, 0x0, 0xCA, 0xB0, 0x1, 0x0, 0x0, 0xEA, 0xB0, 0x1, 0x0, 0x0, 0xA, 0xB1, 0x1, 0x0, 0x0, 0x2A, 0xB1, 0x1, 0x0, 0x0, 0x4A, 0xB1, 0x1, 0x0, 0x0, 0x6A, 0xB1, 0x1, 0x0, 0x0, 0x8A, 0xB1, 0x1, 0x0, 0x0, 0xAA, 0xB1, 0x1, 0x0, 0x0, 0xCA, 0xB1, 0x1, 0x0, 0x0, 0xEA, 0xB1, 0x1, 0x0, 0x0, 0xA, 0xB2, 0x1, 0x0, 0x0, 0x2A, 0xB2, 0x1, 0x0, 0x0, 0x4A, 0xB2, 0x1, 0x0, 0x0, 0x6A, 0xB2, 0x1, 0x0, 0x0, 0x8A, 0xB2, 0x1, 0x0, 0x0, 0xAA, 0xB2, 0x1, 0x0, 0x0, 0xCA, 0xB2, 0x1, 0x0, 0x0, 0xEA, 0xB2, 0x1, 0x0, 0x0, 0xA, 0xB3, 0x1, 0x0, 0x0, 0x2A, 0xB3, 0x1, 0x0, 0x0, 0x4A, 0xB3, 0x1, 0x0, 0x0, 0x6A, 0xB3, 0x1, 0x0, 0x0, 0x8A, 0xB3, 0x1, 0x0, 0x0, 0xAA, 0xB3, 0x1, 0x0, 0x0, 0xCA, 0xB3, 0x1, 0x0, 0x0, 0xEA, 0xB3, 0x1, 0x0, 0x0, 0xA, 0xB4, 0x1, 0x0, 0x0, 0x2A, 0xB4, 0x1, 0x0, 0x0, 0x4A, 0xB4, 0x1, 0x0, 0x0, 0x6A, 0xB4, 0x1, 0x0, 0x0, 0x8A, 0xB4, 0x1, 0x0, 0x0, 0xAA, 0xB4, 0x1, 0x0, 0x0, 0xCA, 0xB4, 0x1, 0x0, 0x0, 0xEA, 0xB4, 0x1, 0x0, 0x0, 0xA, 0xB5, 0x1, 0x0, 0x0, 0x2A, 0xB5, 0x1, 0x0, 0x0, 0x4A, 0xB5, 0x1, 0x0, 0x0, 0x6A, 0xB5, 0x1, 0x0, 0x0, 0x8A, 0xB5, 0x1, 0x0, 0x0, 0xAA, 0xB5, 0x1, 0x0, 0x0, 0xCA, 0xB5, 0x1, 0x0, 0x0, 0xEA, 0xB5, 0x1, 0x0, 0x0, 0xA, 0xB6, 0x1, 0x0, 0x0, 0x2A, 0xB6, 0x1, 0x0, 0x0, 0x4A, 0xB6, 0x1, 0x0, 0x0, 0x6A, 0xB6, 0x1, 0x0, 0x0, 0x8A, 0xB6, 0x1, 0x0, 0x0, 0xAA, 0xB6, 0x1, 0x0, 0x0, 0xCA, 0xB6, 0x1, 0x0, 0x0, 0xEA, 0xB6, 0x1, 0x0, 0x0, 0xA, 0xB7, 0x1, 0x0, 0x0, 0x2A, 0xB7, 0x1, 0x0, 0x0, 0x4A, 0xB7, 0x1, 0x0, 0x0, 0x6A, 0xB7, 0x1, 0x0, 0x0, 0x8A, 0xB7, 0x1, 0x0, 0x0, 0xAA, 0xB7, 0x1, 0x0, 0x0, 0xCA, 0xB7, 0x1, 0x0, 0x0, 0xEA, 0xB7, 0x1, 0x0, 0x0, 0xA, 0xB8, 0x1, 0x0, 0x0, 0x2A, 0xB8, 0x1, 0x0, 0x0, 0x4A, 0xB8, 0x1, 0x0, 0x0, 0x6A, 0xB8, 0x1, 0x0, 0x0, 0x8A, 0xB8, 0x1, 0x0, 0x0, 0xAA, 0xB8, 0x1, 0x0, 0x0, 0xCA, 0xB8, 0x1, 0x0, 0x0, 0xEA, 0xB8, 0x1, 0x0, 0x0, 0xA, 0xB9, 0x1, 0x0, 0x0, 0x2A, 0xB9, 0x1, 0x0, 0x0, 0x4A, 0xB9, 0x1, 0x0, 0x0, 0x6A, 0xB9, 0x1, 0x0, 0x0, 0x8A, 0xB9, 0x1, 0x0, 0x0, 0xAA, 0xB9, 0x1, 0x0, 0x0, 0xCA, 0xB9, 0x1, 0x0, 0x0, 0xEA, 0xB9, 0x1, 0x0, 0x0, 0xA, 0xBA, 0x1, 0x0, 0x0, 0x2A, 0xBA, 0x1, 0x0, 0x0, 0x4A, 0xBA, 0x1, 0x0, 0x0, 0x6A, 0xBA, 0x1, 0x0, 0x0, 0x8A, 0xBA, 0x1, 0x0, 0x0, 0xAA, 0xBA, 0x1, 0x0, 0x0, 0xCA, 0xBA, 0x1, 0x0, 0x0, 0xEA, 0xBA, 0x1, 0x0, 0x0, 0xA, 0xBB, 0x1, 0x0, 0x0, 0x2A, 0xBB, 0x1, 0x0, 0x0, 0x4A, 0xBB, 0x1, 0x0, 0x0, 0x6A, 0xBB, 0x1, 0x0, 0x0, 0x8A, 0xBB, 0x1, 0x0, 0x0, 0xAA, 0xBB, 0x1, 0x0, 0x0, 0xCA, 0xBB, 0x1, 0x0, 0x0, 0xEA, 0xBB, 0x1, 0x0, 0x0, 0xA, 0xBC, 0x1, 0x0, 0x0, 0x2A, 0xBC, 0x1, 0x0, 0x0, 0x4A, 0xBC, 0x1, 0x0, 0x0, 0x6A, 0xBC, 0x1, 0x0, 0x0, 0x8A, 0xBC, 0x1, 0x0, 0x0, 0xAA, 0xBC, 0x1, 0x0, 0x0, 0xCA, 0xBC, 0x1, 0x0, 0x0, 0xEA, 0xBC, 0x1, 0x0, 0x0, 0xA, 0xBD, 0x1, 0x0, 0x0, 0x2A, 0xBD, 0x1, 0x0, 0x0, 0x4A, 0xBD, 0x1, 0x0, 0x0, 0x6A, 0xBD, 0x1, 0x0, 0x0, 0x8A, 0xBD, 0x1, 0x0, 0x0, 0xAA, 0xBD, 0x1, 0x0, 0x0, 0xCA, 0xBD, 0x1, 0x0, 0x0, 0xEA, 0xBD, 0x1, 0x0, 0x0, 0xA, 0xBE, 0x1, 0x0, 0x0, 0x2A, 0xBE, 0x1, 0x0, 0x0, 0x4A, 0xBE, 0x1, 0x0, 0x0, 0x6A, 0xBE, 0x1, 0x0, 0x0, 0x8A, 0xBE, 0x1, 0x0, 0x0, 0xAA, 0xBE, 0x1, 0x0, 0x0, 0xCA, 0xBE, 0x1, 0x0, 0x0, 0xEA, 0xBE, 0x1, 0x0, 0x0, 0xA, 0xBF, 0x1, 0x0, 0x0, 0x2A, 0xBF, 0x1, 0x0, 0x0, 0x4A, 0xBF, 0x1, 0x0, 0x0, 0x6A, 0xBF, 0x1, 0x0, 0x0, 0x8A, 0xBF, 0x1, 0x0, 0x0, 0xAA, 0xBF, 0x1, 0x0, 0x0, 0xCA, 0xBF, 0x1, 0x0, 0x0, 0xEA, 0xBF, 0x1, 0x0, 0x0, 0xA, 0xC0, 0x1, 0x0, 0x0, 0x2A, 0xC0, 0x1, 0x0, 0x0, 0x4A, 0xC0, 0x1, 0x0, 0x0, 0x6A, 0xC0, 0x1, 0x0, 0x0, 0x8A, 0xC0, 0x1, 0x0, 0x0, 0xAA, 0xC0, 0x1, 0x0, 0x0, 0xCA, 0xC0, 0x1, 0x0, 0x0, 0xEA, 0xC0, 0x1, 0x0, 0x0, 0xA, 0xC1, 0x1, 0x0, 0x0, 0x2A, 0xC1, 0x1, 0x0, 0x0, 0x4A, 0xC1, 0x1, 0x0, 0x0, 0x6A, 0xC1, 0x1, 0x0, 0x0, 0x8A, 0xC1, 0x1, 0x0, 0x0, 0xAA, 0xC1, 0x1, 0x0, 0x0, 0xCA, 0xC1, 0x1, 0x0, 0x0, 0xEA, 0xC1, 0x1, 0x0, 0x0, 0xA, 0xC2, 0x1, 0x0, 0x0, 0x2A, 0xC2, 0x1, 0x0, 0x0, 0x4A, 0xC2, 0x1, 0x0, 0x0, 0xA, 0x0, 0x98, 0x70, 0x0, 0xA, 0x0, 0xA0, 0x70, 0x0, 0xA, 0x0, 0xA8, 0x70, 0x0, 0xA, 0x0, 0xB0, 0x70, 0x0, 0xA, 0x0, 0xB8, 0x70, 0x0, 0xA, 0x0, 0xC0, 0x70, 0x0, 0xA, 0x0, 0xC8, 0x70, 0x0, 0xA, 0x0, 0xD0, 0x70, 0x0, 0xA, 0x0, 0xD8, 0x70, 0x0, 0xA, 0x0, 0xE0, 0x70, 0x0, 0xA, 0x0, 0xE8, 0x70, 0x0, 0xA, 0x0, 0xF0, 0x70, 0x0, 0xA, 0x0, 0xF8, 0x70, 0x0, 0xA, 0x0, 0x0, 0x71, 0x0, 0xA, 0x0, 0x8, 0x71, 0x0, 0xA, 0x0, 0x10, 0x71, 0x0, 0xA, 0x0, 0x18, 0x71, 0x0, 0xA, 0x0, 0x20, 0x71, 0x0, 0xA, 0x0, 0x28, 0x71, 0x0, 0xA, 0x0, 0x30, 0x71, 0x0, 0xA, 0x0, 0x38, 0x71, 0x0, 0xA, 0x0, 0x40, 0x71, 0x0, 0xA, 0x0, 0x48, 0x71, 0x0, 0xA, 0x0, 0x50, 0x71, 0x0, 0xA, 0x0, 0x58, 0x71, 0x0, 0xA, 0x0, 0x60, 0x71, 0x0, 0xA, 0x0, 0x68, 0x71, 0x0, 0xA, 0x0, 0x70, 0x71, 0x0, 0xA, 0x0, 0x78, 0x71, 0x0, 0xA, 0x0, 0x80, 0x71, 0x0, 0xA, 0x0, 0x88, 0x71, 0x0, 0xA, 0x0, 0x90, 0x71, 0x0, 0xA, 0x0, 0x98, 0x71, 0x0, 0xA, 0x0, 0xA0, 0x71, 0x0, 0xA, 0x0, 0xA8, 0x71, 0x0, 0xA, 0x0, 0xB0, 0x71, 0x0, 0xA, 0x0, 0xB8, 0x71, 0x0, 0xA, 0x0, 0xC0, 0x71, 0x0, 0xA, 0x0, 0xC8, 0x71, 0x0, 0xA, 0x0, 0xD0, 0x71, 0x0, 0xA, 0x0, 0xD8, 0x71, 0x0, 0xA, 0x0, 0xE0, 0x71, 0x0, 0xA, 0x0, 0xE8, 0x71, 0x0, 0xA, 0x0, 0xF0, 0x71, 0x0, 0xA, 0x0, 0xF8, 0x71, 0x0, 0xA, 0x0, 0x0, 0x72, 0x0, 0xA, 0x0, 0x8, 0x72, 0x0, 0xA, 0x0, 0x10, 0x72, 0x0, 0xA, 0x0, 0x18, 0x72, 0x0, 0xA, 0x0, 0x20, 0x72, 0x0, 0xA, 0x0, 0x28, 0x72, 0x0, 0xA, 0x0, 0x30, 0x72, 0x0, 0xA, 0x0, 0x38, 0x72, 0x0, 0xA, 0x0, 0x40, 0x72, 0x0, 0xA, 0x0, 0x48, 0x72, 0x0, 0xA, 0x0, 0x50, 0x72, 0x0, 0xA, 0x0, 0x58, 0x72, 0x0, 0xA, 0x0, 0x60, 0x72, 0x0, 0xA, 0x0, 0x68, 0x72, 0x0, 0xA, 0x0, 0x70, 0x72, 0x0, 0xA, 0x0, 0x78, 0x72, 0x0, 0xA, 0x0, 0x80, 0x72, 0x0, 0xA, 0x0, 0x88, 0x72, 0x0, 0xA, 0x0, 0x90, 0x72, 0x0, 0xA, 0x0, 0x98, 0x72, 0x0, 0xA, 0x0, 0xA0, 0x72, 0x0, 0xA, 0x0, 0xA8, 0x72, 0x0, 0xA, 0x0, 0xB0, 0x72, 0x0, 0xA, 0x0, 0xB8, 0x72, 0x0, 0xA, 0x0, 0xC0, 0x72, 0x0, 0xA, 0x0, 0xC8, 0x72, 0x0, 0xA, 0x0, 0xD0, 0x72, 0x0, 0xA, 0x0, 0xD8, 0x72, 0x0, 0xA, 0x0, 0xE0, 0x72, 0x0, 0xA, 0x0, 0xE8, 0x72, 0x0, 0xA, 0x0, 0xF0, 0x72, 0x0, 0xA, 0x0, 0xD8, 0x5B, 0x0, 0xA, 0x0, 0xE0, 0x5B, 0x0, 0xA, 0x0, 0xE8, 0x5B, 0x0, 0xA, 0x0, 0xF0, 0x5B, 0x0, 0xA, 0x0, 0xF8, 0x5B, 0x0, 0xA, 0x0, 0xF8, 0x72, 0x0, 0xA, 0x0, 0x0, 0x73, 0x0, 0xA, 0x0, 0x8, 0x73, 0x0, 0xA, 0x0, 0x10, 0x73, 0x0, 0xA, 0x0, 0x28, 0x69, 0x0, 0xA, 0x0, 0x30, 0x69, 0x0, 0xA, 0x0, 0x38, 0x69, 0x0, 0xA, 0x0, 0x40, 0x69, 0x0, 0xA, 0x0, 0x48, 0x69, 0x0, 0xA, 0x0, 0x50, 0x69, 0x0, 0xA, 0x0, 0x58, 0x69, 0x0, 0xA, 0x0, 0x60, 0x69, 0x0, 0xA, 0x0, 0x68, 0x69, 0x0, 0xA, 0x0, 0x18, 0x73, 0x0, 0xA, 0x0, 0x78, 0x69, 0x0, 0xA, 0x0, 0x80, 0x69, 0x0, 0xA, 0x0, 0x88, 0x69, 0x0, 0xA, 0x0, 0x90, 0x69, 0x0, 0xA, 0x0, 0x98, 0x69, 0x0, 0xA, 0x0, 0xA0, 0x69, 0x0, 0xA, 0x0, 0xA8, 0x69, 0x0, 0xA, 0x0, 0xB0, 0x69, 0x0, 0xA, 0x0, 0xB8, 0x69, 0x0, 0xA, 0x0, 0xC0, 0x69, 0x0, 0xA, 0x0, 0xC8, 0x69, 0x0, 0xA, 0x0, 0xD0, 0x69, 0x0, 0xA, 0x0, 0xD8, 0x69, 0x0, 0xA, 0x0, 0xE0, 0x69, 0x0, 0xA, 0x0, 0xE8, 0x69, 0x0, 0xA, 0x0, 0xF0, 0x69, 0x0, 0xA, 0x0, 0x20, 0x73, 0x0, 0xA, 0x0, 0x28, 0x73, 0x0, 0xA, 0x0, 0x30, 0x73, 0x0, 0xA, 0x0, 0x38, 0x73, 0x0, 0xA, 0x0, 0x40, 0x73, 0x0, 0xA, 0x0, 0x48, 0x73, 0x0, 0xA, 0x0, 0x50, 0x73, 0x0, 0xA, 0x0, 0x58, 0x73, 0x0, 0xA, 0x0, 0x60, 0x73, 0x0, 0xA, 0x0, 0x68, 0x73, 0x0, 0xA, 0x0, 0x70, 0x73, 0x0, 0xA, 0x0, 0x78, 0x73, 0x0, 0xA, 0x0, 0x80, 0x73, 0x0, 0xA, 0x0, 0x88, 0x73, 0x0, 0xA, 0x0, 0x90, 0x73, 0x0, 0xA, 0x0, 0x98, 0x73, 0x0, 0xA, 0x0, 0xA0, 0x73, 0x0, 0xA, 0x0, 0xA8, 0x73, 0x0, 0xA, 0x0, 0xB0, 0x73, 0x0, 0xA, 0x0, 0xB8, 0x73, 0x0, 0xA, 0x0, 0xC0, 0x73, 0x0, 0xA, 0x0, 0xC8, 0x73, 0x0, 0xA, 0x0, 0xD0, 0x73, 0x0, 0xA, 0x0, 0xD8, 0x73, 0x0, 0xA, 0x0, 0xE0, 0x73, 0x0, 0xA, 0x0, 0xE8, 0x73, 0x0, 0xA, 0x0, 0xF0, 0x73, 0x0, 0xA, 0x0, 0xF8, 0x73, 0x0, 0xA, 0x0, 0x0, 0x74, 0x0, 0xA, 0x0, 0x8, 0x74, 0x0, 0xA, 0x0, 0x10, 0x74, 0x0, 0xA, 0x0, 0x18, 0x74, 0x0, 0xA, 0x0, 0x20, 0x74, 0x0, 0xA, 0x0, 0x28, 0x74, 0x0, 0xA, 0x0, 0x30, 0x74, 0x0, 0xA, 0x0, 0x38, 0x74, 0x0, 0xA, 0x0, 0x40, 0x74, 0x0, 0xA, 0x0, 0x48, 0x74, 0x0, 0xA, 0x0, 0x50, 0x74, 0x0, 0xA, 0x0, 0x58, 0x74, 0x0, 0xA, 0x0, 0x60, 0x74, 0x0, 0xA, 0x0, 0x68, 0x74, 0x0, 0xA, 0x0, 0x70, 0x74, 0x0, 0xA, 0x0, 0x78, 0x74, 0x0, 0xA, 0x0, 0x80, 0x74, 0x0, 0xA, 0x0, 0x88, 0x74, 0x0, 0xA, 0x0, 0x90, 0x74, 0x0, 0xA, 0x0, 0x98, 0x74, 0x0, 0xA, 0x0, 0xA0, 0x74, 0x0, 0xA, 0x0, 0xA8, 0x74, 0x0, 0xA, 0x0, 0xB0, 0x74, 0x0, 0xA, 0x0, 0xB8, 0x74, 0x0, 0xA, 0x0, 0xC0, 0x74, 0x0, 0xA, 0x0, 0xC8, 0x74, 0x0, 0xA, 0x0, 0xD0, 0x74, 0x0, 0xA, 0x0, 0xD8, 0x74, 0x0, 0xA, 0x0, 0xE0, 0x74, 0x0, 0xA, 0x0, 0xE8, 0x74, 0x0, 0xA, 0x0, 0xF0, 0x74, 0x0, 0xA, 0x0, 0xF8, 0x74, 0x0, 0xA, 0x0, 0x0, 0x75, 0x0, 0xA, 0x0, 0x8, 0x75, 0x0, 0xA, 0x0, 0x10, 0x75, 0x0, 0xA, 0x0, 0x18, 0x75, 0x0, 0xA, 0x0, 0x20, 0x75, 0x0, 0xA, 0x0, 0x28, 0x75, 0x0, 0xA, 0x0, 0x30, 0x75, 0x0, 0xA, 0x0, 0x38, 0x75, 0x0, 0xA, 0x0, 0x40, 0x75, 0x0, 0xA, 0x0, 0x48, 0x75, 0x0, 0xA, 0x0, 0x50, 0x75, 0x0, 0xA, 0x0, 0x58, 0x75, 0x0, 0xA, 0x0, 0x60, 0x75, 0x0, 0xA, 0x0, 0x68, 0x75, 0x0, 0xA, 0x0, 0x70, 0x75, 0x0, 0xA, 0x0, 0x78, 0x75, 0x0, 0xA, 0x0, 0x80, 0x75, 0x0, 0xA, 0x0, 0x88, 0x75, 0x0, 0xA, 0x0, 0x90, 0x75, 0x0, 0xA, 0x0, 0x98, 0x75, 0x0, 0xA, 0x0, 0xA0, 0x75, 0x0, 0xA, 0x0, 0xA8, 0x75, 0x0, 0xA, 0x0, 0xB0, 0x75, 0x0, 0xA, 0x0, 0xB8, 0x75, 0x0, 0xA, 0x0, 0x40, 0x6D, 0x0, 0xA, 0x0, 0x48, 0x6D, 0x0, 0xA, 0x0, 0x50, 0x6D, 0x0, 0xA, 0x0, 0x58, 0x6D, 0x0, 0xA, 0x0, 0x60, 0x6D, 0x0, 0xA, 0x0, 0x68, 0x6D, 0x0, 0xA, 0x0, 0x70, 0x6D, 0x0, 0xA, 0x0, 0x78, 0x6D, 0x0, 0xA, 0x0, 0x80, 0x6D, 0x0, 0xA, 0x0, 0x88, 0x6D, 0x0, 0xA, 0x0, 0x90, 0x6D, 0x0, 0xA, 0x0, 0x98, 0x6D, 0x0, 0xA, 0x0, 0xA0, 0x6D, 0x0, 0xA, 0x0, 0xA8, 0x6D, 0x0, 0xA, 0x0, 0xB0, 0x6D, 0x0, 0xA, 0x0, 0xB8, 0x6D, 0x0, 0xA, 0x0, 0xC0, 0x6D, 0x0, 0xA, 0x0, 0xC8, 0x6D, 0x0, 0xA, 0x0, 0xD0, 0x6D, 0x0, 0xA, 0x0, 0xD8, 0x6D, 0x0, 0xA, 0x0, 0xE0, 0x6D, 0x0, 0xA, 0x0, 0xE8, 0x6D, 0x0, 0xA, 0x0, 0xF0, 0x6D, 0x0, 0xA, 0x0, 0xF8, 0x6D, 0x0, 0xA, 0x0, 0xC0, 0x75, 0x0, 0xA, 0x0, 0xC8, 0x75, 0x0, 0xA, 0x0, 0xD0, 0x75, 0x0, 0xA, 0x0, 0xD8, 0x75, 0x0, 0xA, 0x0, 0xE0, 0x75, 0x0, 0xA, 0x0, 0xE8, 0x75, 0x0, 0xA, 0x0, 0xF0, 0x75, 0x0, 0xA, 0x0, 0xF8, 0x75, 0x0, 0xA, 0x0, 0x0, 0x76, 0x0, 0xA, 0x0, 0x8, 0x76, 0x0, 0xA, 0x0, 0x10, 0x76, 0x0, 0xA, 0x0, 0x18, 0x76, 0x0, 0xA, 0x0, 0x20, 0x76, 0x0, 0xA, 0x0, 0x28, 0x76, 0x0, 0xA, 0x0, 0x30, 0x76, 0x0, 0xA, 0x0, 0x38, 0x76, 0x0, 0xA, 0x0, 0x40, 0x76, 0x0, 0xA, 0x0, 0x48, 0x76, 0x0, 0xA, 0x0, 0x50, 0x76, 0x0, 0xA, 0x0, 0x58, 0x76, 0x0, 0xA, 0x0, 0x60, 0x76, 0x0, 0xA, 0x0, 0x68, 0x76, 0x0, 0xA, 0x0, 0x70, 0x76, 0x0, 0xA, 0x0, 0x78, 0x76, 0x0, 0xA, 0x0, 0x80, 0x76, 0x0, 0xA, 0x0, 0x88, 0x76, 0x0, 0xA, 0x0, 0x90, 0x76, 0x0, 0xA, 0x0, 0x98, 0x76, 0x0, 0xA, 0x0, 0xA0, 0x76, 0x0, 0xA, 0x0, 0xA8, 0x76, 0x0, 0xA, 0x0, 0xB0, 0x76, 0x0, 0xA, 0x0, 0xB8, 0x76, 0x0, 0xA, 0x0, 0xC0, 0x76, 0x0, 0xA, 0x0, 0xC8, 0x76, 0x0, 0xA, 0x0, 0xD0, 0x76, 0x0, 0xA, 0x0, 0xD8, 0x76, 0x0, 0xA, 0x0, 0xE0, 0x76, 0x0, 0xA, 0x0, 0xE8, 0x76, 0x0, 0xA, 0x0, 0xF0, 0x76, 0x0, 0xA, 0x0, 0xF8, 0x76, 0x0, 0xA, 0x0, 0x0, 0x77, 0x0, 0xA, 0x0, 0x8, 0x77, 0x0, 0xA, 0x0, 0x10, 0x77, 0x0, 0xA, 0x0, 0x18, 0x77, 0x0, 0xA, 0x0, 0x20, 0x77, 0x0, 0xA, 0x0, 0x28, 0x77, 0x0, 0xA, 0x0, 0x30, 0x77, 0x0, 0xA, 0x0, 0x38, 0x77, 0x0, 0xA, 0x0, 0x40, 0x77, 0x0, 0xA, 0x0, 0x48, 0x77, 0x0, 0xA, 0x0, 0x50, 0x77, 0x0, 0xA, 0x0, 0x58, 0x77, 0x0, 0xA, 0x0, 0x60, 0x77, 0x0, 0xAB, 0xDD, 0x1, 0x0, 0x0, 0xCB, 0xDD, 0x1, 0x0, 0x0, 0xEB, 0xDD, 0x1, 0x0, 0x0, 0xB, 0xDE, 0x1, 0x0, 0x0, 0x2B, 0xDE, 0x1, 0x0, 0x0, 0x4B, 0xDE, 0x1, 0x0, 0x0, 0x6B, 0xDE, 0x1, 0x0, 0x0, 0x8B, 0xDE, 0x1, 0x0, 0x0, 0xAB, 0xDE, 0x1, 0x0, 0x0, 0xCB, 0xDE, 0x1, 0x0, 0x0, 0xEB, 0xDE, 0x1, 0x0, 0x0, 0xB, 0xDF, 0x1, 0x0, 0x0, 0x2B, 0xDF, 0x1, 0x0, 0x0, 0x4B, 0xDF, 0x1, 0x0, 0x0, 0x6B, 0xDF, 0x1, 0x0, 0x0, 0x8B, 0xDF, 0x1, 0x0, 0x0, 0xAB, 0xDF, 0x1, 0x0, 0x0, 0xCB, 0xDF, 0x1, 0x0, 0x0, 0xEB, 0xDF, 0x1, 0x0, 0x0, 0xB, 0xE0, 0x1, 0x0, 0x0, 0x2B, 0xE0, 0x1, 0x0, 0x0, 0x4B, 0xE0, 0x1, 0x0, 0x0, 0x6B, 0xE0, 0x1, 0x0, 0x0, 0x8B, 0xE0, 0x1, 0x0, 0x0, 0xAB, 0xE0, 0x1, 0x0, 0x0, 0xCB, 0xE0, 0x1, 0x0, 0x0, 0xEB, 0xE0, 0x1, 0x0, 0x0, 0xB, 0x0, 0x40, 0x78, 0x0, 0x2B, 0xE1, 0x1, 0x0, 0x0, 0xB, 0x0, 0x50, 0x78, 0x0, 0x6B, 0xE1, 0x1, 0x0, 0x0, 0xB, 0x0, 0x60, 0x78, 0x0, 0xAB, 0xE1, 0x1, 0x0, 0x0, 0xB, 0x0, 0x70, 0x78, 0x0, 0xEB, 0xE1, 0x1, 0x0, 0x0, 0xB, 0x0, 0x80, 0x78, 0x0, 0x2B, 0xE2, 0x1, 0x0, 0x0, 0xB, 0x0, 0x90, 0x78, 0x0, 0x6B, 0xE2, 0x1, 0x0, 0x0, 0xB, 0x0, 0xA0, 0x78, 0x0, 0xAB, 0xE2, 0x1, 0x0, 0x0, 0xB, 0x0, 0xB0, 0x78, 0x0, 0xEB, 0xE2, 0x1, 0x0, 0x0, 0xB, 0x0, 0xC0, 0x78, 0x0, 0x2B, 0xE3, 0x1, 0x0, 0x0, 0xB, 0x0, 0xD0, 0x78, 0x0, 0x6B, 0xE3, 0x1, 0x0, 0x0, 0xB, 0x0, 0xE0, 0x78, 0x0, 0xAB, 0xE3, 0x1, 0x0, 0x0, 0xB, 0x0, 0xF0, 0x78, 0x0, 0xEB, 0xE3, 0x1, 0x0, 0x0, 0xB, 0x0, 0x0, 0x79, 0x0, 0x2B, 0xE4, 0x1, 0x0, 0x0, 0xB, 0x0, 0x10, 0x79, 0x0, 0x6B, 0xE4, 0x1, 0x0, 0x0, 0xB, 0x0, 0x20, 0x79, 0x0, 0xAB, 0xE4, 0x1, 0x0, 0x0, 0xB, 0x0, 0x30, 0x79, 0x0, 0xEB, 0xE4, 0x1, 0x0, 0x0, 0xB, 0x0, 0x40, 0x79, 0x0, 0x2B, 0xE5, 0x1, 0x0, 0x0, 0xB, 0x0, 0x50, 0x79, 0x0, 0x6B, 0xE5, 0x1, 0x0, 0x0, 0xB, 0x0, 0x60, 0x79, 0x0, 0xAB, 0xE5, 0x1, 0x0, 0x0, 0xB, 0x0, 0x70, 0x79, 0x0, 0xEB, 0xE5, 0x1, 0x0, 0x0, 0xB, 0x0, 0x80, 0x79, 0x0, 0x2B, 0xE6, 0x1, 0x0, 0x0, 0xB, 0x0, 0x90, 0x79, 0x0, 0x6B, 0xE6, 0x1, 0x0, 0x0, 0xB, 0x0, 0xA0, 0x79, 0x0, 0xAB, 0xE6, 0x1, 0x0, 0x0, 0xB, 0x0, 0xB0, 0x79, 0x0, 0xEB, 0xE6, 0x1, 0x0, 0x0, 0xB, 0x0, 0xC0, 0x79, 0x0, 0x2B, 0xE7, 0x1, 0x0, 0x0, 0xB, 0x0, 0xD0, 0x79, 0x0, 0x6B, 0xE7, 0x1, 0x0, 0x0, 0xB, 0x0, 0xE0, 0x79, 0x0, 0xAB, 0xE7, 0x1, 0x0, 0x0, 0xB, 0x0, 0xF0, 0x79, 0x0, 0xEB, 0xE7, 0x1, 0x0, 0x0, 0xB, 0x0, 0x0, 0x7A, 0x0, 0x2B, 0xE8, 0x1, 0x0, 0x0, 0xB, 0x0, 0x10, 0x7A, 0x0, 0x6B, 0xE8, 0x1, 0x0, 0x0, 0xB, 0x0, 0x20, 0x7A, 0x0, 0xAB, 0xE8, 0x1, 0x0, 0x0, 0xB, 0x0, 0x30, 0x7A, 0x0, 0xEB, 0xE8, 0x1, 0x0, 0x0, 0xB, 0x0, 0x40, 0x7A, 0x0, 0x2B, 0xE9, 0x1, 0x0, 0x0, 0xB, 0x0, 0x50, 0x7A, 0x0, 0x6B, 0xE9, 0x1, 0x0, 0x0, 0xB, 0x0, 0x60, 0x7A, 0x0, 0xAB, 0xE9, 0x1, 0x0, 0x0, 0xB, 0x0, 0x70, 0x7A, 0x0, 0xEB, 0xE9, 0x1, 0x0, 0x0, 0xB, 0x0, 0x80, 0x7A, 0x0, 0x2B, 0xEA, 0x1, 0x0, 0x0, 0xB, 0x0, 0x90, 0x7A, 0x0, 0x6B, 0xEA, 0x1, 0x0, 0x0, 0xB, 0x0, 0xA0, 0x7A, 0x0, 0xAB, 0xEA, 0x1, 0x0, 0x0, 0xB, 0x0, 0xB0, 0x7A, 0x0, 0xEB, 0xEA, 0x1, 0x0, 0x0, 0xB, 0x0, 0xC0, 0x7A, 0x0, 0x2B, 0xEB, 0x1, 0x0, 0x0, 0xB, 0x0, 0xD0, 0x7A, 0x0, 0x6B, 0xEB, 0x1, 0x0, 0x0, 0xB, 0x0, 0xE0, 0x7A, 0x0, 0xAB, 0xEB, 0x1, 0x0, 0x0, 0xB, 0x0, 0xF0, 0x7A, 0x0, 0xEB, 0xEB, 0x1, 0x0, 0x0, 0xB, 0x0, 0x0, 0x7B, 0x0, 0x2B, 0xEC, 0x1, 0x0, 0x0, 0xB, 0x0, 0x10, 0x7B, 0x0, 0x6B, 0xEC, 0x1, 0x0, 0x0, 0xB, 0x0, 0x20, 0x7B, 0x0, 0xAB, 0xEC, 0x1, 0x0, 0x0, 0xB, 0x0, 0x30, 0x7B, 0x0, 0xEB, 0xEC, 0x1, 0x0, 0x0, 0xB, 0x0, 0x38, 0x78, 0x0, 0xB, 0xED, 0x1, 0x0, 0x0, 0xB, 0x0, 0x48, 0x78, 0x0, 0x2B, 0xED, 0x1, 0x0, 0x0, 0xB, 0x0, 0x58, 0x78, 0x0, 0x4B, 0xED, 0x1, 0x0, 0x0, 0xB, 0x0, 0x68, 0x78, 0x0, 0x6B, 0xED, 0x1, 0x0, 0x0, 0xB, 0x0, 0x78, 0x78, 0x0, 0x8B, 0xED, 0x1, 0x0, 0x0, 0xB, 0x0, 0x88, 0x78, 0x0, 0xAB, 0xED, 0x1, 0x0, 0x0, 0xB, 0x0, 0x98, 0x78, 0x0, 0xCB, 0xED, 0x1, 0x0, 0x0, 0xB, 0x0, 0xA8, 0x78, 0x0, 0xEB, 0xED, 0x1, 0x0, 0x0, 0xB, 0x0, 0xB8, 0x78, 0x0, 0xB, 0xEE, 0x1, 0x0, 0x0, 0xB, 0x0, 0xC8, 0x78, 0x0, 0x2B, 0xEE, 0x1, 0x0, 0x0, 0xB, 0x0, 0xD8, 0x78, 0x0, 0x4B, 0xEE, 0x1, 0x0, 0x0, 0xB, 0x0, 0xE8, 0x78, 0x0, 0x6B, 0xEE, 0x1, 0x0, 0x0, 0xB, 0x0, 0xF8, 0x78, 0x0, 0x8B, 0xEE, 0x1, 0x0, 0x0, 0xB, 0x0, 0x8, 0x79, 0x0, 0xAB, 0xEE, 0x1, 0x0, 0x0, 0xB, 0x0, 0x18, 0x79, 0x0, 0xCB, 0xEE, 0x1, 0x0, 0x0, 0xB, 0x0, 0x28, 0x79, 0x0, 0xEB, 0xEE, 0x1, 0x0, 0x0, 0xB, 0x0, 0x38, 0x79, 0x0, 0xB, 0xEF, 0x1, 0x0, 0x0, 0xB, 0x0, 0x48, 0x79, 0x0, 0x2B, 0xEF, 0x1, 0x0, 0x0, 0xB, 0x0, 0x58, 0x79, 0x0, 0x4B, 0xEF, 0x1, 0x0, 0x0, 0xB, 0x0, 0x68, 0x79, 0x0, 0x6B, 0xEF, 0x1, 0x0, 0x0, 0xB, 0x0, 0x78, 0x79, 0x0, 0x8B, 0xEF, 0x1, 0x0, 0x0, 0xB, 0x0, 0x88, 0x79, 0x0, 0xAB, 0xEF, 0x1, 0x0, 0x0, 0xB, 0x0, 0x98, 0x79, 0x0, 0xCB, 0xEF, 0x1, 0x0, 0x0, 0xB, 0x0, 0xA8, 0x79, 0x0, 0xEB, 0xEF, 0x1, 0x0, 0x0, 0xB, 0x0, 0xB8, 0x79, 0x0, 0xB, 0xF0, 0x1, 0x0, 0x0, 0xB, 0x0, 0xC8, 0x79, 0x0, 0x2B, 0xF0, 0x1, 0x0, 0x0, 0xB, 0x0, 0xD8, 0x79, 0x0, 0x4B, 0xF0, 0x1, 0x0, 0x0, 0xB, 0x0, 0xE8, 0x79, 0x0, 0x6B, 0xF0, 0x1, 0x0, 0x0, 0xB, 0x0, 0xF8, 0x79, 0x0, 0x8B, 0xF0, 0x1, 0x0, 0x0, 0xB, 0x0, 0x8, 0x7A, 0x0, 0xAB, 0xF0, 0x1, 0x0, 0x0, 0xB, 0x0, 0x18, 0x7A, 0x0, 0xCB, 0xF0, 0x1, 0x0, 0x0, 0xB, 0x0, 0x28, 0x7A, 0x0, 0xEB, 0xF0, 0x41, 0x7C, 0x0, 0xB, 0x0, 0x48, 0x7C, 0x0, 0x4B, 0xF1, 0x1, 0x0, 0x0, 0xB, 0x0, 0x58, 0x7C, 0x0, 0xB, 0x0, 0x60, 0x7C, 0x0, 0xB, 0x0, 0x68, 0x7C, 0x0, 0xB, 0x0, 0x70, 0x7C, 0x0, 0xB, 0x0, 0x78, 0x7C, 0x0, 0xB, 0x0, 0x80, 0x7C, 0x0, 0xB, 0x0, 0x88, 0x7C, 0x0, 0xB, 0x0, 0x90, 0x7C, 0x0, 0xB, 0x0, 0x98, 0x7C, 0x0, 0xB, 0x0, 0xA0, 0x7C, 0x0, 0xB, 0x0, 0xA8, 0x7C, 0x0, 0xB, 0x0, 0xB0, 0x7C, 0x0, 0xB, 0x0, 0xB8, 0x7C, 0x0, 0xB, 0x0, 0xC0, 0x7C, 0x0, 0xB, 0x0, 0xC8, 0x7C, 0x0, 0xB, 0x0, 0xD0, 0x7C, 0x0, 0xB, 0x0, 0xD8, 0x7C, 0x0, 0xB, 0x0, 0xE0, 0x7C, 0x0, 0xB, 0x0, 0xE8, 0x7C, 0x0, 0xB, 0x0, 0xF0, 0x7C, 0x0, 0xB, 0x0, 0xF8, 0x7C, 0x0, 0xB, 0x0, 0x0, 0x7D, 0x0, 0xB, 0x0, 0x8, 0x7D, 0x0, 0xB, 0x0, 0x10, 0x7D, 0x0, 0xB, 0x0, 0x18, 0x7D, 0x0, 0xB, 0x0, 0x20, 0x7D, 0x0, 0xB, 0x0, 0x28, 0x7D, 0x0, 0xB, 0x0, 0x30, 0x7D, 0x0, 0xB, 0x0, 0x38, 0x7D, 0x0, 0xB, 0x0, 0x40, 0x7D, 0x0, 0xB, 0x0, 0x48, 0x7D, 0x0, 0xB, 0x0, 0x50, 0x7D, 0x0, 0xB, 0x0, 0x58, 0x7D, 0x0, 0xB, 0x0, 0x60, 0x7D, 0x0, 0xB, 0x0, 0x68, 0x7D, 0x0, 0xB, 0x0, 0x70, 0x7D, 0x0, 0xB, 0x0, 0x78, 0x7D, 0x0, 0xB, 0x0, 0x80, 0x7D, 0x0, 0xB, 0x0, 0x88, 0x7D, 0x0, 0xB, 0x0, 0x90, 0x7D, 0x0, 0xB, 0x0, 0x98, 0x7D, 0x0, 0xB, 0x0, 0xA0, 0x7D, 0x0, 0xB, 0x0, 0xA8, 0x7D, 0x0, 0xB, 0x0, 0xB0, 0x7D, 0x0, 0xB, 0x0, 0xB8, 0x7D, 0x0, 0xB, 0x0, 0xC0, 0x7D, 0x0, 0xB, 0x0, 0xC8, 0x7D, 0x0, 0x4B, 0xF7, 0x1, 0x0, 0x0, 0xB, 0x0, 0xD8, 0x7D, 0x0, 0xB, 0x0, 0xE0, 0x7D, 0x0, 0xB, 0x0, 0xE8, 0x7D, 0x0, 0xB, 0x0, 0xF0, 0x7D, 0x0, 0xB, 0x0, 0xF8, 0x7D, 0x0, 0xB, 0x0, 0x0, 0x7E, 0x0, 0xB, 0x0, 0x8, 0x7E, 0x0, 0xB, 0x0, 0x10, 0x7E, 0x0, 0xB, 0x0, 0x18, 0x7E, 0x0, 0xB, 0x0, 0x20, 0x7E, 0x0, 0xB, 0x0, 0x28, 0x7E, 0x0, 0xB, 0x0, 0x30, 0x7E, 0x0, 0xB, 0x0, 0x38, 0x7E, 0x0, 0xB, 0x0, 0x40, 0x7E, 0x0, 0xB, 0x0, 0x48, 0x7E, 0x0, 0xB, 0x0, 0x50, 0x7E, 0x0, 0xB, 0x0, 0x58, 0x7E, 0x0, 0xB, 0x0, 0x60, 0x7E, 0x0, 0xB, 0x0, 0x68, 0x7E, 0x0, 0xB, 0x0, 0x70, 0x7E, 0x0, 0xB, 0x0, 0x78, 0x7E, 0x0, 0xB, 0x0, 0x80, 0x7E, 0x0, 0xB, 0x0, 0x88, 0x7E, 0x0, 0xB, 0x0, 0x90, 0x7E, 0x0, 0xB, 0x0, 0x98, 0x7E, 0x0, 0xB, 0x0, 0xA0, 0x7E, 0x0, 0xB, 0x0, 0xA8, 0x7E, 0x0, 0xB, 0x0, 0xB0, 0x7E, 0x0, 0xB, 0x0, 0xB8, 0x7E, 0x0, 0xB, 0x0, 0xC0, 0x7E, 0x0, 0xB, 0x0, 0xC8, 0x7E, 0x0, 0xB, 0x0, 0xD0, 0x7E, 0x0, 0xB, 0x0, 0xD8, 0x7E, 0x0, 0xB, 0x0, 0xE0, 0x7E, 0x0, 0xB, 0x0, 0xE8, 0x7E, 0x0, 0xB, 0x0, 0xF0, 0x7E, 0x0, 0xB, 0x0, 0xF8, 0x7E, 0x0, 0xB, 0x0, 0x0, 0x7F, 0x0, 0xB, 0x0, 0x8, 0x7F, 0x0, 0xB, 0x0, 0x10, 0x7F, 0x0, 0xB, 0x0, 0x18, 0x7F, 0x0, 0xB, 0x0, 0x20, 0x7F, 0x0, 0xB, 0x0, 0x28, 0x7F, 0x0, 0xB, 0x0, 0x30, 0x7F, 0x0, 0xB, 0x0, 0x38, 0x7F, 0x0, 0xB, 0x0, 0x40, 0x7F, 0x0, 0xB, 0x0, 0x48, 0x7F, 0x0, 0xB, 0x0, 0x50, 0x7F, 0x0, 0xB, 0x0, 0x58, 0x7F, 0x0, 0xB, 0x0, 0x60, 0x7F, 0x0, 0xB, 0x0, 0x68, 0x7F, 0x0, 0xB, 0x0, 0x70, 0x7F, 0x0, 0xB, 0x0, 0x78, 0x7F, 0x0, 0xB, 0x0, 0x80, 0x7F, 0x0, 0xB, 0x0, 0x88, 0x7F, 0x0, 0xB, 0x0, 0x90, 0x7F, 0x0, 0xB, 0x0, 0x98, 0x7F, 0x0, 0xB, 0x0, 0xA0, 0x7F, 0x0, 0xB, 0x0, 0xA8, 0x7F, 0x0, 0xB, 0x0, 0xB0, 0x7F, 0x0, 0xB, 0x0, 0xB8, 0x7F, 0x0, 0xB, 0x0, 0xC0, 0x7F, 0x0, 0xB, 0x0, 0xC8, 0x7F, 0x0, 0xB, 0x0, 0xD0, 0x7F, 0x0, 0xB, 0x0, 0xD8, 0x7F, 0x0, 0xB, 0x0, 0xE0, 0x7F, 0x0, 0xB, 0x0, 0xE8, 0x7F, 0x0, 0xB, 0x0, 0xF0, 0x7F, 0x0, 0xB, 0x0, 0xF8, 0x7F, 0x0, 0xB, 0x0, 0x0, 0x80, 0x0, 0xB, 0x0, 0x8, 0x80, 0x0, 0xB, 0x0, 0x10, 0x80, 0x0, 0xB, 0x0, 0x18, 0x80, 0x0, 0xB, 0x0, 0x20, 0x80, 0x0, 0xB, 0x0, 0x28, 0x80, 0x0, 0xB, 0x0, 0x30, 0x80, 0x0, 0xB, 0x0, 0x38, 0x80, 0x0, 0xB, 0x1, 0x2, 0x0, 0x0, 0xB, 0x0, 0x48, 0x80, 0x0, 0x4B, 0x1, 0x2, 0x0, 0x0, 0xB, 0x0, 0x58, 0x80, 0x0, 0x8B, 0x1, 0x2, 0x0, 0x0, 0xB, 0x0, 0x68, 0x80, 0x0, 0xCB, 0x1, 0x2, 0x0, 0x0, 0xB, 0x0, 0x78, 0x80, 0x0, 0xB, 0x2, 0x2, 0x0, 0x0, 0xB, 0x0, 0x88, 0x80, 0x0, 0x4B, 0x2, 0x2, 0x0, 0x0, 0xB, 0x0, 0x98, 0x80, 0x0, 0x8B, 0x2, 0x2, 0x0, 0x0, 0xB, 0x0, 0xA8, 0x80, 0x0, 0xCB, 0x2, 0x2, 0x0, 0x0, 0xB, 0x0, 0xB8, 0x80, 0x0, 0xB, 0x3, 0x2, 0x0, 0x0, 0xB, 0x0, 0xC8, 0x80, 0x0, 0x4B, 0x3, 0x2, 0x0, 0x0, 0xB, 0x0, 0xD8, 0x80, 0x0, 0x8B, 0x3, 0x2, 0x0, 0x0, 0xB, 0x0, 0xE8, 0x80, 0x0, 0xCB, 0x3, 0x2, 0x0, 0x0, 0xB, 0x0, 0xF8, 0x80, 0x0, 0xB, 0x4, 0x2, 0x0, 0x0, 0xB, 0x0, 0x8, 0x81, 0x0, 0x4B, 0x4, 0x2, 0x0, 0x0, 0xB, 0x0, 0x18, 0x81, 0x0, 0x8B, 0x4, 0x2, 0x0, 0x0, 0xB, 0x0, 0x28, 0x81, 0x0, 0xCB, 0x4, 0x2, 0x0, 0x0, 0xB, 0x0, 0x38, 0x81, 0x0, 0xB, 0x5, 0x2, 0x0, 0x0, 0xB, 0x0, 0x48, 0x81, 0x0, 0x4B, 0x5, 0x2, 0x0, 0x0, 0xB, 0x0, 0x58, 0x81, 0x0, 0x8B, 0x5, 0x2, 0x0, 0x0, 0xB, 0x0, 0x68, 0x81, 0x0, 0xCB, 0x5, 0x2, 0x0, 0x0, 0xB, 0x0, 0x78, 0x81, 0x0, 0xB, 0x6, 0x2, 0x0, 0x0, 0xB, 0x0, 0x88, 0x81, 0x0, 0x4B, 0x6, 0x2, 0x0, 0x0, 0xB, 0x0, 0x98, 0x81, 0x0, 0x8B, 0x6, 0x2, 0x0, 0x0, 0xB, 0x0, 0xA8, 0x81, 0x0, 0xCB, 0x6, 0x2, 0x0, 0x0, 0xB, 0x0, 0xB8, 0x81, 0x0, 0xB, 0x7, 0x2, 0x0, 0x0, 0xB, 0x0, 0xC8, 0x81, 0x0, 0x4B, 0x7, 0x2, 0x0, 0x0, 0xB, 0x0, 0xD8, 0x81, 0x0, 0x8B, 0x7, 0x2, 0x0, 0x0, 0xB, 0x0, 0xE8, 0x81, 0x0, 0xCB, 0x7, 0x2, 0x0, 0x0, 0xB, 0x0, 0xF8, 0x81, 0x0, 0xB, 0x8, 0x2, 0x0, 0x0, 0xB, 0x0, 0x8, 0x82, 0x0, 0x4B, 0x8, 0x2, 0x0, 0x0, 0xB, 0x0, 0x18, 0x82, 0x0, 0x8B, 0x8, 0x2, 0x0, 0x0, 0xB, 0x0, 0x28, 0x82, 0x0, 0xCB, 0x8, 0x2, 0x0, 0x0, 0xB, 0x0, 0x38, 0x82, 0x0, 0xB, 0x9, 0x2, 0x0, 0x0, 0xB, 0x0, 0x48, 0x82, 0x0, 0x4B, 0x9, 0x2, 0x0, 0x0, 0xB, 0x0, 0x58, 0x82, 0x0, 0x8B, 0x9, 0x2, 0x0, 0x0, 0xB, 0x0, 0x68, 0x82, 0x0, 0xCB, 0x9, 0x2, 0x0, 0x0, 0xB, 0x0, 0x78, 0x82, 0x0, 0xB, 0xA, 0x2, 0x0, 0x0, 0xB, 0x0, 0x88, 0x82, 0x0, 0x4B, 0xA, 0x2, 0x0, 0x0, 0xB, 0x0, 0x98, 0x82, 0x0, 0x8B, 0xA, 0x2, 0x0, 0x0, 0xB, 0x0, 0xA8, 0x82, 0x0, 0xCB, 0xA, 0x2, 0x0, 0x0, 0xB, 0x0, 0xB8, 0x82, 0x0, 0xB, 0xB, 0x2, 0x0, 0x0, 0x2B, 0xB, 0x2, 0x0, 0x0, 0x4B, 0xB, 0x2, 0x0, 0x0, 0x6B, 0xB, 0x2, 0x0, 0x0, 0x8B, 0xB, 0x2, 0x0, 0x0, 0xAB, 0xB, 0x2, 0x0, 0x0, 0xCB, 0xB, 0x2, 0x0, 0x0, 0xEB, 0xB, 0x2, 0x0, 0x0, 0xB, 0xC, 0x2, 0x0, 0x0, 0x2B, 0xC, 0x2, 0x0, 0x0, 0x4B, 0xC, 0x2, 0x0, 0x0, 0x6B, 0xC, 0x2, 0x0, 0x0, 0x8B, 0xC, 0x2, 0x0, 0x0, 0xAB, 0xC, 0x2, 0x0, 0x0, 0xCB, 0xC, 0x2, 0x0, 0x0, 0xEB, 0xC, 0x2, 0x0, 0x0, 0xB, 0xD, 0x2, 0x0, 0x0, 0x2B, 0xD, 0x2, 0x0, 0x0, 0x4B, 0xD, 0x2, 0x0, 0x0, 0x6B, 0xD, 0x2, 0x0, 0x0, 0x8B, 0xD, 0x2, 0x0, 0x0, 0xAB, 0xD, 0x2, 0x0, 0x0, 0xCB, 0xD, 0x2, 0x0, 0x0, 0xEB, 0xD, 0x2, 0x0, 0x0, 0xB, 0xE, 0x2, 0x0, 0x0, 0x2B, 0xE, 0x2, 0x0, 0x0, 0x4B, 0xE, 0x2, 0x0, 0x0, 0x6B, 0xE, 0x2, 0x0, 0x0, 0x8B, 0xE, 0x2, 0x0, 0x0, 0xAB, 0xE, 0x2, 0x0, 0x0, 0xCB, 0xE, 0x2, 0x0, 0x0, 0xEB, 0xE, 0x2, 0x0, 0x0, 0xB, 0xF, 0x2, 0x0, 0x0, 0x2B, 0xF, 0x2, 0x0, 0x0, 0x4B, 0xF, 0x2, 0x0, 0x0, 0x6B, 0xF, 0x2, 0x0, 0x0, 0x8B, 0xF, 0x2, 0x0, 0x0, 0xAB, 0xF, 0x2, 0x0, 0x0, 0xCB, 0xF, 0x2, 0x0, 0x0, 0xEB, 0xF, 0x2, 0x0, 0x0, 0xB, 0x10, 0x2, 0x0, 0x0, 0x2B, 0x10, 0x2, 0x0, 0x0, 0x4B, 0x10, 0x2, 0x0, 0x0, 0x6B, 0x10, 0x2, 0x0, 0x0, 0x8B, 0x10, 0x2, 0x0, 0x0, 0xAB, 0x10, 0x2, 0x0, 0x0, 0xCB, 0x10, 0x2, 0x0, 0x0, 0xEB, 0x10, 0x2, 0x0, 0x0, 0xB, 0x11, 0x2, 0x0, 0x0, 0x2B, 0x11, 0x2, 0x0, 0x0, 0x4B, 0x11, 0x2, 0x0, 0x0, 0x6B, 0x11, 0x2, 0x0, 0x0, 0x8B, 0x11, 0x2, 0x0, 0x0, 0xAB, 0x11, 0x2, 0x0, 0x0, 0xB, 0x0, 0x70, 0x84, 0x0, 0xEB, 0x11, 0x2, 0x0, 0x0, 0xB, 0x0, 0x80, 0x84, 0x0, 0x2B, 0x12, 0x2, 0x0, 0x0, 0x4B, 0x12, 0x2, 0x0, 0x0, 0x6B, 0x12, 0x2, 0x0, 0x0, 0xB, 0x0, 0xA0, 0x84, 0x0, 0xAB, 0x12, 0x2, 0x0, 0x0, 0xB, 0x0, 0xB0, 0x84, 0x0, 0xEB, 0x12, 0x2, 0x0, 0x0, 0xB, 0x0, 0xC0, 0x84, 0x0, 0x2B, 0x13, 0x2, 0x0, 0x0, 0xB, 0x0, 0xD0, 0x84, 0x0, 0x6B, 0x13, 0x2, 0x0, 0x0, 0x8B, 0x13, 0x2, 0x0, 0x0, 0xAB, 0x13, 0x2, 0x0, 0x0, 0xCB, 0x13, 0x2, 0x0, 0x0, 0xB, 0x0, 0xF8, 0x84, 0x0, 0xB, 0x14, 0x2, 0x0, 0x0, 0xB, 0x0, 0x8, 0x85, 0x0, 0x4B, 0x14, 0x2, 0x0, 0x0, 0xB, 0x0, 0x18, 0x85, 0x0, 0x8B, 0x14, 0x2, 0x0, 0x0, 0xAB, 0x14, 0x2, 0x0, 0x0, 0xCB, 0x14, 0x2, 0x0, 0x0, 0xB, 0x0, 0x38, 0x85, 0x0, 0xB, 0x15, 0x2, 0x0, 0x0, 0x2B, 0x15, 0x2, 0x0, 0x0, 0x4B, 0x15, 0x2, 0x0, 0x0, 0x6B, 0x15, 0x2, 0x0, 0x0, 0x8B, 0x15, 0x2, 0x0, 0x0, 0xAB, 0x15, 0x2, 0x0, 0x0, 0xCB, 0x15, 0x2, 0x0, 0x0, 0xEB, 0x15, 0x2, 0x0, 0x0, 0xB, 0x16, 0x2, 0x0, 0x0, 0x2B, 0x16, 0x2, 0x0, 0x0, 0x4B, 0x16, 0x2, 0x0, 0x0, 0x6B, 0x16, 0x2, 0x0, 0x0, 0x8B, 0x16, 0x2, 0x0, 0x0, 0xAB, 0x16, 0x2, 0x0, 0x0, 0xCB, 0x16, 0x2, 0x0, 0x0, 0xEB, 0x16, 0x2, 0x0, 0x0, 0xB, 0x17, 0x2, 0x0, 0x0, 0x2B, 0x17, 0x2, 0x0, 0x0, 0x4B, 0x17, 0x2, 0x0, 0x0, 0x6B, 0x17, 0x2, 0x0, 0x0, 0x8B, 0x17, 0x2, 0x0, 0x0, 0xAB, 0x17, 0x2, 0x0, 0x0, 0xCB, 0x17, 0x2, 0x0, 0x0, 0xEB, 0x17, 0x2, 0x0, 0x0, 0xB, 0x18, 0x2, 0x0, 0x0, 0x2B, 0x18, 0x2, 0x0, 0x0, 0x4B, 0x18, 0x2, 0x0, 0x0, 0x6B, 0x18, 0x2, 0x0, 0x0, 0x8B, 0x18, 0x2, 0x0, 0x0, 0xAB, 0x18, 0x2, 0x0, 0x0, 0xCB, 0x18, 0x2, 0x0, 0x0, 0xEB, 0x18, 0x2, 0x0, 0x0, 0xB, 0x19, 0x2, 0x0, 0x0, 0x2B, 0x19, 0x2, 0x0, 0x0, 0x4B, 0x19, 0x2, 0x0, 0x0, 0x6B, 0x19, 0x2, 0x0, 0x0, 0x8B, 0x19, 0x2, 0x0, 0x0, 0xAB, 0x19, 0x2, 0x0, 0x0, 0xCB, 0x19, 0x2, 0x0, 0x0, 0xEB, 0x19, 0x2, 0x0, 0x0, 0xB, 0x1A, 0x2, 0x0, 0x0, 0x2B, 0x1A, 0x2, 0x0, 0x0, 0x4B, 0x1A, 0x2, 0x0, 0x0, 0x6B, 0x1A, 0x2, 0x0, 0x0, 0x8B, 0x1A, 0x2, 0x0, 0x0, 0xAB, 0x1A, 0x2, 0x0, 0x0, 0xCB, 0x1A, 0x2, 0x0, 0x0, 0xEB, 0x1A, 0x2, 0x0, 0x0, 0xB, 0x0, 0xC0, 0x86, 0x0, 0xB, 0x0, 0xC8, 0x86, 0x0, 0xB, 0x0, 0xD0, 0x86, 0x0, 0xB, 0x0, 0xD8, 0x86, 0x0, 0xB, 0x0, 0xE0, 0x86, 0x0, 0xB, 0x0, 0xE8, 0x86, 0x0, 0xB, 0x0, 0xF0, 0x86, 0x0, 0xB, 0x0, 0xF8, 0x86, 0x0, 0xB, 0x0, 0x0, 0x87, 0x0, 0xB, 0x0, 0x8, 0x87, 0x0, 0xB, 0x0, 0x10, 0x87, 0x0, 0xB, 0x0, 0x18, 0x87, 0x0, 0xB, 0x0, 0x20, 0x87, 0x0, 0xB, 0x0, 0x28, 0x87, 0x0, 0xB, 0x0, 0x30, 0x87, 0x0, 0xB, 0x0, 0x38, 0x87, 0x0, 0xB, 0x0, 0x40, 0x87, 0x0, 0xB, 0x0, 0x48, 0x87, 0x0, 0xB, 0x0, 0x50, 0x87, 0x0, 0xB, 0x0, 0x58, 0x87, 0x0, 0xB, 0x0, 0x60, 0x87, 0x0, 0xB, 0x0, 0x68, 0x87, 0x0, 0xB, 0x0, 0x70, 0x87, 0x0, 0xB, 0x0, 0x78, 0x87, 0x0, 0xB, 0x0, 0x80, 0x87, 0x0, 0xB, 0x0, 0x88, 0x87, 0x0, 0xB, 0x0, 0x90, 0x87, 0x0, 0xB, 0x0, 0x98, 0x87, 0x0, 0xB, 0x0, 0xA0, 0x87, 0x0, 0xB, 0x0, 0xA8, 0x87, 0x0, 0xB, 0x0, 0xB0, 0x87, 0x0, 0xB, 0x0, 0xB8, 0x87, 0x0, 0xB, 0x0, 0xC0, 0x87, 0x0, 0xB, 0x0, 0xC8, 0x87, 0x0, 0xB, 0x0, 0xD0, 0x87, 0x0, 0xB, 0x0, 0xD8, 0x87, 0x0, 0xB, 0x0, 0xE0, 0x87, 0x0, 0xB, 0x0, 0xE8, 0x87, 0x0, 0xB, 0x0, 0xF0, 0x87, 0x0, 0xB, 0x0, 0xF8, 0x87, 0x0, 0xB, 0x0, 0x0, 0x88, 0x0, 0xB, 0x0, 0x8, 0x88, 0x0, 0xB, 0x0, 0x10, 0x88, 0x0, 0xB, 0x0, 0x18, 0x88, 0x0, 0xB, 0x0, 0x20, 0x88, 0x0, 0xB, 0x0, 0x28, 0x88, 0x0, 0xB, 0x0, 0x30, 0x88, 0x0, 0xB, 0x0, 0x38, 0x88, 0x0, 0xB, 0x0, 0x40, 0x88, 0x0, 0xB, 0x0, 0x48, 0x88, 0x0, 0x4B, 0x21, 0x2, 0x0, 0x0, 0x6B, 0x21, 0x2, 0x0, 0x0, 0x8B, 0x21, 0x2, 0x0, 0x0, 0xAB, 0x21, 0x2, 0x0, 0x0, 0xCB, 0x21, 0x2, 0x0, 0x0, 0xEB, 0x21, 0x2, 0x0, 0x0, 0xB, 0x22, 0x2, 0x0, 0x0, 0x2B, 0x22, 0x2, 0x0, 0x0, 0x4B, 0x22, 0x2, 0x0, 0x0, 0x6B, 0x22, 0x2, 0x0, 0x0, 0x8B, 0x22, 0x2, 0x0, 0x0, 0xAB, 0x22, 0x2, 0x0, 0x0, 0xCB, 0x22, 0x2, 0x0, 0x0, 0xEB, 0x22, 0x2, 0x0, 0x0, 0xB, 0x23, 0x2, 0x0, 0x0, 0x2B, 0x23, 0x2, 0x0, 0x0, 0x4B, 0x23, 0x2, 0x0, 0x0, 0x6B, 0x23, 0x2, 0x0, 0x0, 0x8B, 0x23, 0x2, 0x0, 0x0, 0xAB, 0x23, 0x2, 0x0, 0x0, 0xCB, 0x23, 0x2, 0x0, 0x0, 0xEB, 0x23, 0x2, 0x0, 0x0, 0xB, 0x24, 0x2, 0x0, 0x0, 0x2B, 0x24, 0x2, 0x0, 0x0, 0x4B, 0x24, 0x2, 0x0, 0x0, 0x6B, 0x24, 0x2, 0x0, 0x0, 0x8B, 0x24, 0x2, 0x0, 0x0, 0xAB, 0x24, 0x2, 0x0, 0x0, 0xCB, 0x24, 0x2, 0x0, 0x0, 0xEB, 0x24, 0x2, 0x0, 0x0, 0xB, 0x25, 0x2, 0x0, 0x0, 0x2B, 0x25, 0x2, 0x0, 0x0, 0x4B, 0x25, 0x2, 0x0, 0x0, 0x6B, 0x25, 0x2, 0x0, 0x0, 0x8B, 0x25, 0x2, 0x0, 0x0, 0xAB, 0x25, 0x2, 0x0, 0x0, 0xCB, 0x25, 0x2, 0x0, 0x0, 0xEB, 0x25, 0x2, 0x0, 0x0, 0xB, 0x26, 0x2, 0x0, 0x0, 0x2B, 0x26, 0x2, 0x0, 0x0, 0x4B, 0x26, 0x2, 0x0, 0x0, 0x6B, 0x26, 0x2, 0x0, 0x0, 0x8B, 0x26, 0x2, 0x0, 0x0, 0xAB, 0x26, 0x2, 0x0, 0x0, 0xCB, 0x26, 0x2, 0x0, 0x0, 0xEB, 0x26, 0x2, 0x0, 0x0, 0xB, 0x27, 0x2, 0x0, 0x0, 0x2B, 0x27, 0x2, 0x0, 0x0, 0x4B, 0x27, 0x2, 0x0, 0x0, 0x6B, 0x27, 0x2, 0x0, 0x0, 0x8B, 0x27, 0x2, 0x0, 0x0, 0xAB, 0x27, 0x2, 0x0, 0x0, 0xCB, 0x27, 0x2, 0x0, 0x0, 0xEB, 0x27, 0x2, 0x0, 0x0, 0xB, 0x28, 0x2, 0x0, 0x0, 0x2B, 0x28, 0x2, 0x0, 0x0, 0x4B, 0x28, 0x2, 0x0, 0x0, 0x6B, 0x28, 0x2, 0x0, 0x0, 0x8B, 0x28, 0x2, 0x0, 0x0, 0xAB, 0x28, 0x2, 0x0, 0x0, 0xCB, 0x28, 0x2, 0x0, 0x0, 0xEB, 0x28, 0x2, 0x0, 0x0, 0xB, 0x29, 0x2, 0x0, 0x0, 0x2B, 0x29, 0x2, 0x0, 0x0, 0x4B, 0x29, 0x2, 0x0, 0x0, 0x6B, 0x29, 0x2, 0x0, 0x0, 0x8B, 0x29, 0x2, 0x0, 0x0, 0xAB, 0x29, 0x2, 0x0, 0x0, 0xCB, 0x29, 0x2, 0x0, 0x0, 0xEB, 0x29, 0x2, 0x0, 0x0, 0xB, 0x2A, 0x2, 0x0, 0x0, 0x2B, 0x2A, 0x2, 0x0, 0x0, 0x4B, 0x2A, 0x2, 0x0, 0x0, 0x6B, 0x2A, 0x2, 0x0, 0x0, 0x8B, 0x2A, 0x2, 0x0, 0x0, 0xAB, 0x2A, 0x2, 0x0, 0x0, 0xCB, 0x2A, 0x2, 0x0, 0x0, 0xEB, 0x2A, 0x2, 0x0, 0x0, 0xB, 0x2B, 0x2, 0x0, 0x0, 0x2B, 0x2B, 0x2, 0x0, 0x0, 0x4B, 0x2B, 0x2, 0x0, 0x0, 0x6B, 0x2B, 0x2, 0x0, 0x0, 0x8B, 0x2B, 0x2, 0x0, 0x0, 0xAB, 0x2B, 0x2, 0x0, 0x0, 0xCB, 0x2B, 0x2, 0x0, 0x0, 0xEB, 0x2B, 0x2, 0x0, 0x0, 0xB, 0x2C, 0x2, 0x0, 0x0, 0x2B, 0x2C, 0x2, 0x0, 0x0, 0x4B, 0x2C, 0x2, 0x0, 0x0, 0x6B, 0x2C, 0x2, 0x0, 0x0, 0x8B, 0x2C, 0x2, 0x0, 0x0, 0xAB, 0x2C, 0x2, 0x0, 0x0, 0xCB, 0x2C, 0x2, 0x0, 0x0, 0xEB, 0x2C, 0x2, 0x0, 0x0, 0xB, 0x2D, 0x2, 0x0, 0x0, 0x2B, 0x2D, 0x2, 0x0, 0x0, 0x4B, 0x2D, 0x2, 0x0, 0x0, 0x6B, 0x2D, 0x2, 0x0, 0x0, 0x8B, 0x2D, 0x2, 0x0, 0x0, 0xAB, 0x2D, 0x2, 0x0, 0x0, 0xCB, 0x2D, 0x2, 0x0, 0x0, 0xEB, 0x2D, 0x2, 0x0, 0x0, 0xB, 0x2E, 0x2, 0x0, 0x0, 0x2B, 0x2E, 0x2, 0x0, 0x0, 0x4B, 0x2E, 0x2, 0x0, 0x0, 0x6B, 0x2E, 0x2, 0x0, 0x0, 0x8B, 0x2E, 0x2, 0x0, 0x0, 0xAB, 0x2E, 0x2, 0x0, 0x0, 0xCB, 0x2E, 0x2, 0x0, 0x0, 0xEB, 0x2E, 0x2, 0x0, 0x0, 0xB, 0x2F, 0x2, 0x0, 0x0, 0x2B, 0x2F, 0x2, 0x0, 0x0, 0x4B, 0x2F, 0x2, 0x0, 0x0, 0x6B, 0x2F, 0x2, 0x0, 0x0, 0x8B, 0x2F, 0x2, 0x0, 0x0, 0xAB, 0x2F, 0x2, 0x0, 0x0, 0xCB, 0x2F, 0x2, 0x0, 0x0, 0xEB, 0x2F, 0x2, 0x0, 0x0, 0xB, 0x30, 0x2, 0x0, 0x0, 0x2B, 0x30, 0x2, 0x0, 0x0, 0x4B, 0x30, 0x2, 0x0, 0x0, 0x6B, 0x30, 0x2, 0x0, 0x0, 0x8B, 0x30, 0x2, 0x0, 0x0, 0xAB, 0x30, 0x2, 0x0, 0x0, 0xCB, 0x30, 0x2, 0x0, 0x0, 0xEB, 0x30, 0x2, 0x0, 0x0, 0xB, 0x31, 0x2, 0x0, 0x0, 0x2B, 0x31, 0x2, 0x0, 0x0, 0x4B, 0x31, 0x2, 0x0, 0x0, 0x6B, 0x31, 0x2, 0x0, 0x0, 0x8B, 0x31, 0x2, 0x0, 0x0, 0xAB, 0x31, 0x2, 0x0, 0x0, 0xCB, 0x31, 0x2, 0x0, 0x0, 0xEB, 0x31, 0x2, 0x0, 0x0, 0xB, 0x32, 0x2, 0x0, 0x0, 0x2B, 0x32, 0x2, 0x0, 0x0, 0x4B, 0x32, 0x2, 0x0, 0x0, 0x6B, 0x32, 0x2, 0x0, 0x0, 0x8B, 0x32, 0x2, 0x0, 0x0, 0xAB, 0x32, 0x2, 0x0, 0x0, 0xCB, 0x32, 0x2, 0x0, 0x0, 0xEB, 0x32, 0x2, 0x0, 0x0, 0xB, 0x33, 0x2, 0x0, 0x0, 0x2B, 0x33, 0x2, 0x0, 0x0, 0x4B, 0x33, 0x2, 0x0, 0x0, 0xB, 0x0, 0xD8, 0x8C, 0x0, 0xCB, 0xFC, 0x1, 0x0, 0x0, 0xEB, 0xFC, 0x1, 0x0, 0x0, 0xB, 0xFD, 0x1, 0x0, 0x0, 0x2B, 0xFD, 0x1, 0x0, 0x0, 0x4B, 0xFD, 0x1, 0x0, 0x0, 0x6B, 0xFD, 0x1, 0x0, 0x0, 0x8B, 0xFD, 0x1, 0x0, 0x0, 0xAB, 0xFD, 0x1, 0x0, 0x0, 0xCB, 0xFD, 0x1, 0x0, 0x0, 0xEB, 0xFD, 0x1, 0x0, 0x0, 0xB, 0xFE, 0x1, 0x0, 0x0, 0x8B, 0x33, 0x2, 0x0, 0x0, 0xAB, 0x33, 0x2, 0x0, 0x0, 0xCB, 0x33, 0x2, 0x0, 0x0, 0xEB, 0x33, 0x2, 0x0, 0x0, 0xB, 0x34, 0x2, 0x0, 0x0, 0x2B, 0x34, 0x2, 0x0, 0x0, 0x4B, 0x34, 0x2, 0x0, 0x0, 0x6B, 0x34, 0x2, 0x0, 0x0, 0x8B, 0x34, 0x2, 0x0, 0x0, 0x2B, 0xFE, 0x1, 0x0, 0x0, 0x4B, 0xFE, 0x1, 0x0, 0x0, 0x6B, 0xFE, 0x1, 0x0, 0x0, 0x8B, 0xFE, 0x1, 0x0, 0x0, 0xAB, 0xFE, 0x1, 0x0, 0x0, 0xCB, 0xFE, 0x1, 0x0, 0x0, 0xEB, 0xFE, 0x1, 0x0, 0x0, 0xB, 0xFF, 0x1, 0x0, 0x0, 0x2B, 0xFF, 0x1, 0x0, 0x0, 0x4B, 0xFF, 0x1, 0x0, 0x0, 0x6B, 0xFF, 0x1, 0x0, 0x0, 0x8B, 0xFF, 0x1, 0x0, 0x0, 0xAB, 0xFF, 0x1, 0x0, 0x0, 0xCB, 0xFF, 0x1, 0x0, 0x0, 0xEB, 0xFF, 0x1, 0x0, 0x0, 0xB, 0x0, 0x2, 0x0, 0x0, 0x2B, 0x0, 0x2, 0x0, 0x0, 0x4B, 0x0, 0x2, 0x0, 0x0, 0x6B, 0x0, 0x2, 0x0, 0x0, 0x8B, 0x0, 0x2, 0x0, 0x0, 0xAB, 0x0, 0x2, 0x0, 0x0, 0xCB, 0x0, 0x2, 0x0, 0x0, 0xEB, 0x0, 0x2, 0x0, 0x0, 0xAB, 0x34, 0x2, 0x0, 0x0, 0xCB, 0x34, 0x2, 0x0, 0x0, 0xEB, 0x34, 0x2, 0x0, 0x0, 0xB, 0x35, 0x2, 0x0, 0x0, 0x2B, 0x35, 0x2, 0x0, 0x0, 0x4B, 0x35, 0x2, 0x0, 0x0, 0x6B, 0x35, 0x2, 0x0, 0x0, 0x8B, 0x35, 0x2, 0x0, 0x0, 0xAB, 0x35, 0x2, 0x0, 0x0, 0xCB, 0x35, 0x2, 0x0, 0x0, 0xEB, 0x35, 0x2, 0x0, 0x0, 0xB, 0x36, 0x2, 0x0, 0x0, 0x2B, 0x36, 0x2, 0x0, 0x0, 0x4B, 0x36, 0x2, 0x0, 0x0, 0x6B, 0x36, 0x2, 0x0, 0x0, 0x8B, 0x36, 0x2, 0x0, 0x0, 0xAB, 0x36, 0x2, 0x0, 0x0, 0xCB, 0x36, 0x2, 0x0, 0x0, 0xEB, 0x36, 0x2, 0x0, 0x0, 0xB, 0x37, 0x2, 0x0, 0x0, 0x2B, 0x37, 0x2, 0x0, 0x0, 0x4B, 0x37, 0x2, 0x0, 0x0, 0x6B, 0x37, 0x2, 0x0, 0x0, 0x8B, 0x37, 0x2, 0x0, 0x0, 0xAB, 0x37, 0x2, 0x0, 0x0, 0xCB, 0x37, 0x2, 0x0, 0x0, 0xEB, 0x37, 0x2, 0x0, 0x0, 0xB, 0x38, 0x2, 0x0, 0x0, 0x2B, 0x38, 0x2, 0x0, 0x0, 0x4B, 0x38, 0x2, 0x0, 0x0, 0x6B, 0x38, 0x2, 0x0, 0x0, 0x8B, 0x38, 0x2, 0x0, 0x0, 0xAB, 0x38, 0x32, 0x8E, 0x0, 0xEB, 0x38, 0x42, 0x8E, 0x0, 0x2B, 0x39, 0x52, 0x8E, 0x0, 0x6B, 0x39, 0x62, 0x8E, 0x0, 0xAB, 0x39, 0x72, 0x8E, 0x0, 0xEB, 0x39, 0x82, 0x8E, 0x0, 0x2B, 0x3A, 0x92, 0x8E, 0x0, 0x6B, 0x3A, 0xA2, 0x8E, 0x0, 0xAB, 0x3A, 0xB2, 0x8E, 0x0, 0xEB, 0x3A, 0xC2, 0x8E, 0x0, 0x2B, 0x3B, 0xD2, 0x8E, 0x0, 0x6B, 0x3B, 0xE2, 0x8E, 0x0, 0xAB, 0x3B, 0xF2, 0x8E, 0x0, 0xEB, 0x3B, 0x2, 0x8F, 0x0, 0x2B, 0x3C, 0x12, 0x8F, 0x0, 0x6B, 0x3C, 0x22, 0x8F, 0x0, 0xAB, 0x3C, 0x32, 0x8F, 0x0, 0xEB, 0x3C, 0x42, 0x8F, 0x0, 0x2B, 0x3D, 0x52, 0x8F, 0x0, 0x6B, 0x3D, 0x62, 0x8F, 0x0, 0xAB, 0x3D, 0x72, 0x8F, 0x0, 0xEB, 0x3D, 0x82, 0x8F, 0x0, 0x2B, 0x3E, 0x92, 0x8F, 0x0, 0x6B, 0x3E, 0xA2, 0x8F, 0x0, 0xAB, 0x3E, 0xB2, 0x8F, 0x0, 0xEB, 0x3E, 0xC2, 0x8F, 0x0, 0x2B, 0x3F, 0xD2, 0x8F, 0x0, 0x6B, 0x3F, 0xE2, 0x8F, 0x0, 0xAB, 0x3F, 0xF2, 0x8F, 0x0, 0xEB, 0x3F, 0x2, 0x90, 0x0, 0x2B, 0x40, 0xDA, 0x8C, 0x0, 0x4B, 0x40, 0x1A, 0x90, 0x0, 0x8B, 0x40, 0x2A, 0x90, 0x0, 0xCB, 0x40, 0x3A, 0x90, 0x0, 0xB, 0x41, 0x4A, 0x90, 0x0, 0x4B, 0x41, 0x5A, 0x90, 0x0, 0x8B, 0x41, 0x6A, 0x90, 0x0, 0xCB, 0x41, 0x7A, 0x90, 0x0, 0xB, 0x42, 0x8A, 0x90, 0x0, 0x4B, 0x42, 0x9A, 0x90, 0x0, 0x8B, 0x42, 0xAA, 0x90, 0x0, 0xCB, 0x42, 0xBA, 0x90, 0x0, 0xB, 0x43, 0xCA, 0x90, 0x0, 0x4B, 0x43, 0xDA, 0x90, 0x0, 0x8B, 0x43, 0xEA, 0x90, 0x0, 0xCB, 0x43, 0xFA, 0x90, 0x0, 0xB, 0x0, 0x0, 0x91, 0x0, 0xB, 0x0, 0x8, 0x91, 0x0, 0xB, 0x0, 0x10, 0x91, 0x0, 0xB, 0x0, 0x18, 0x91, 0x0, 0xB, 0x0, 0x20, 0x91, 0x0, 0xB, 0x0, 0x28, 0x91, 0x0, 0xB, 0x0, 0x30, 0x91, 0x0, 0xB, 0x0, 0x38, 0x91, 0x0, 0xB, 0x0, 0x40, 0x91, 0x0, 0xB, 0x0, 0x48, 0x91, 0x0, 0xB, 0x0, 0x50, 0x91, 0x0, 0xB, 0x0, 0x58, 0x91, 0x0, 0xB, 0x0, 0x60, 0x91, 0x0, 0xB, 0x0, 0x68, 0x91, 0x0, 0xB, 0x0, 0x70, 0x91, 0x0, 0xB, 0x0, 0x78, 0x91, 0x0, 0xB, 0x0, 0x80, 0x91, 0x0, 0xB, 0x0, 0x88, 0x91, 0x0, 0xB, 0x0, 0x90, 0x91, 0x0, 0xB, 0x0, 0x98, 0x91, 0x0, 0xB, 0x0, 0xA0, 0x91, 0x0, 0xB, 0x0, 0xA8, 0x91, 0x0, 0xB, 0x0, 0xB0, 0x91, 0x0, 0xB, 0x0, 0xB8, 0x91, 0x0, 0xB, 0x0, 0xC0, 0x91, 0x0, 0xB, 0x0, 0xC8, 0x91, 0x0, 0xB, 0x0, 0xD0, 0x91, 0x0, 0xB, 0x0, 0xD8, 0x91, 0x0, 0xB, 0x0, 0xE0, 0x91, 0x0, 0xB, 0x0, 0xE8, 0x91, 0x0, 0xB, 0x0, 0xF0, 0x91, 0x0, 0xB, 0x0, 0xF8, 0x91, 0x0, 0xB, 0x0, 0x0, 0x92, 0x0, 0xB, 0x0, 0x8, 0x92, 0x0, 0xB, 0x0, 0x10, 0x92, 0x0, 0xB, 0x0, 0x18, 0x92, 0x0, 0xB, 0x0, 0x20, 0x92, 0x0, 0xB, 0x0, 0x28, 0x92, 0x0, 0xB, 0x0, 0x30, 0x92, 0x0, 0xB, 0x0, 0x38, 0x92, 0x0, 0xB, 0x0, 0x40, 0x92, 0x0, 0xB, 0x0, 0x48, 0x92, 0x0, 0xB, 0x0, 0x50, 0x92, 0x0, 0xB, 0x0, 0x58, 0x92, 0x0, 0xB, 0x0, 0x60, 0x92, 0x0, 0xB, 0x0, 0x68, 0x92, 0x0, 0xB, 0x0, 0x70, 0x92, 0x0, 0xB, 0x0, 0x78, 0x92, 0x0, 0xB, 0x0, 0x80, 0x92, 0x0, 0xB, 0x0, 0x88, 0x92, 0x0, 0xB, 0x0, 0x90, 0x92, 0x0, 0xB, 0x0, 0x98, 0x92, 0x0, 0xB, 0x0, 0xA0, 0x92, 0x0, 0xB, 0x0, 0xA8, 0x92, 0x0, 0xB, 0x0, 0xB0, 0x92, 0x0, 0xB, 0x0, 0xB8, 0x92, 0x0, 0xB, 0x0, 0xC0, 0x92, 0x0, 0xB, 0x0, 0xC8, 0x92, 0x0, 0xB, 0x0, 0xD0, 0x92, 0x0, 0xB, 0x0, 0xD8, 0x92, 0x0, 0xB, 0x0, 0xE0, 0x92, 0x0, 0xB, 0x0, 0xE8, 0x92, 0x0, 0xB, 0x0, 0xF0, 0x92, 0x0, 0xB, 0x0, 0xF8, 0x92, 0x0, 0xB, 0x0, 0x0, 0x93, 0x0, 0xB, 0x0, 0x8, 0x93, 0x0, 0xB, 0x0, 0x10, 0x93, 0x0, 0xB, 0x0, 0x18, 0x93, 0x0, 0xB, 0x0, 0x20, 0x93, 0x0, 0xB, 0x0, 0x28, 0x93, 0x0, 0xB, 0x0, 0x30, 0x93, 0x0, 0xB, 0x0, 0x38, 0x93, 0x0, 0xB, 0x0, 0x40, 0x93, 0x0, 0xB, 0x0, 0x48, 0x93, 0x0, 0xB, 0x0, 0xC0, 0x82, 0x0, 0xB, 0x0, 0x50, 0x93, 0x0, 0xB, 0x0, 0x58, 0x93, 0x0, 0xB, 0x0, 0x60, 0x93, 0x0, 0xB, 0x0, 0x68, 0x93, 0x0, 0xB, 0x0, 0x70, 0x93, 0x0, 0xB, 0x0, 0x78, 0x93, 0x0, 0xB, 0x0, 0x80, 0x93, 0x0, 0xB, 0x0, 0xD8, 0x82, 0x0, 0xB, 0x0, 0xE0, 0x82, 0x0, 0xB, 0x0, 0xE8, 0x82, 0x0, 0xB, 0x0, 0xF0, 0x82, 0x0, 0xB, 0x0, 0xF8, 0x82, 0x0, 0xB, 0x0, 0x0, 0x83, 0x0, 0xB, 0x0, 0x8, 0x83, 0x0, 0xB, 0x0, 0x10, 0x83, 0x0, 0xB, 0x0, 0x18, 0x83, 0x0, 0xB, 0x0, 0x20, 0x83, 0x0, 0xB, 0x0, 0x88, 0x93, 0x0, 0xB, 0x0, 0x90, 0x93, 0x0, 0xB, 0x0, 0x98, 0x93, 0x0, 0xB, 0x0, 0xA0, 0x93, 0x0, 0xB, 0x0, 0xA8, 0x93, 0x0, 0xB, 0x0, 0xB0, 0x93, 0x0, 0xB, 0x0, 0xB8, 0x93, 0x0, 0xB, 0x0, 0xC0, 0x93, 0x0, 0xB, 0x0, 0x68, 0x83, 0x0, 0xB, 0x0, 0x70, 0x83, 0x0, 0xB, 0x0, 0x78, 0x83, 0x0, 0xB, 0x0, 0x80, 0x83, 0x0, 0xB, 0x0, 0x88, 0x83, 0x0, 0xB, 0x0, 0x90, 0x83, 0x0, 0xB, 0x0, 0x98, 0x83, 0x0, 0xB, 0x0, 0xA0, 0x83, 0x0, 0xB, 0x0, 0xA8, 0x83, 0x0, 0xB, 0x0, 0xB0, 0x83, 0x0, 0xB, 0x0, 0xB8, 0x83, 0x0, 0xB, 0x0, 0xC0, 0x83, 0x0, 0xB, 0x0, 0xC8, 0x83, 0x0, 0xB, 0x0, 0xD0, 0x83, 0x0, 0xB, 0x0, 0xD8, 0x83, 0x0, 0xB, 0x0, 0xE0, 0x83, 0x0, 0xB, 0x0, 0xE8, 0x83, 0x0, 0xB, 0x0, 0xF0, 0x83, 0x0, 0xB, 0x0, 0xF8, 0x83, 0x0, 0xB, 0x0, 0x0, 0x84, 0x0, 0xB, 0x0, 0x8, 0x84, 0x0, 0xB, 0x0, 0x10, 0x84, 0x0, 0xB, 0x0, 0x18, 0x84, 0x0, 0xB, 0x0, 0x20, 0x84, 0x0, 0xB, 0x0, 0x28, 0x84, 0x0, 0xB, 0x0, 0x30, 0x84, 0x0, 0xB, 0x0, 0x38, 0x84, 0x0, 0xB, 0x0, 0x60, 0x84, 0x0, 0xB, 0x0, 0xC8, 0x93, 0x0, 0xB, 0x0, 0xD0, 0x93, 0x0, 0xB, 0x0, 0xD8, 0x93, 0x0, 0xB, 0x0, 0xE0, 0x93, 0x0, 0xB, 0x0, 0xE8, 0x93, 0x0, 0xB, 0x0, 0xF0, 0x93, 0x0, 0xB, 0x0, 0x90, 0x84, 0x0, 0xB, 0x0, 0xF8, 0x93, 0x0, 0xB, 0x0, 0x0, 0x94, 0x0, 0xB, 0x0, 0x8, 0x94, 0x0, 0xB, 0x0, 0x10, 0x94, 0x0, 0xB, 0x0, 0x18, 0x94, 0x0, 0xB, 0x0, 0x20, 0x94, 0x0, 0xB, 0x0, 0x28, 0x94, 0x0, 0xB, 0x0, 0x30, 0x94, 0x0, 0xB, 0x0, 0x40, 0x85, 0x0, 0xB, 0x0, 0x38, 0x94, 0x0, 0xB, 0x0, 0x40, 0x94, 0x0, 0xB, 0x0, 0x48, 0x94, 0x0, 0xB, 0x0, 0x50, 0x94, 0x0, 0xB, 0x0, 0x58, 0x94, 0x0, 0xB, 0x0, 0x60, 0x94, 0x0, 0xB, 0x0, 0x68, 0x94, 0x0, 0xB, 0x0, 0x70, 0x94, 0x0, 0xB, 0x0, 0x78, 0x94, 0x0, 0xB, 0x0, 0x80, 0x94, 0x0, 0xB, 0x0, 0x88, 0x94, 0x0, 0xB, 0x0, 0x90, 0x94, 0x0, 0xB, 0x0, 0x98, 0x94, 0x0, 0xB, 0x0, 0xA0, 0x94, 0x0, 0xB, 0x0, 0xA8, 0x94, 0x0, 0xB, 0x0, 0xB0, 0x94, 0x0, 0xB, 0x0, 0xB8, 0x94, 0x0, 0xB, 0x0, 0xC0, 0x94, 0x0, 0xB, 0x0, 0xC8, 0x94, 0x0, 0xB, 0x0, 0xD0, 0x94, 0x0, 0xB, 0x0, 0xD8, 0x94, 0x0, 0xB, 0x0, 0xE0, 0x94, 0x0, 0xB, 0x0, 0xE8, 0x94, 0x0, 0xB, 0x0, 0xF0, 0x94, 0x0, 0xB, 0x0, 0xF8, 0x94, 0x0, 0xB, 0x0, 0x0, 0x95, 0x0, 0xB, 0x0, 0x8, 0x95, 0x0, 0xB, 0x0, 0x10, 0x95, 0x0, 0xB, 0x0, 0x18, 0x95, 0x0, 0xB, 0x0, 0x20, 0x95, 0x0, 0xB, 0x0, 0x28, 0x95, 0x0, 0xB, 0x0, 0x30, 0x95, 0x0, 0xB, 0x0, 0x38, 0x95, 0x0, 0xB, 0x0, 0x40, 0x95, 0x0, 0xB, 0x0, 0x48, 0x95, 0x0, 0xB, 0x0, 0x50, 0x95, 0x0, 0xB, 0x0, 0x58, 0x95, 0x0, 0xB, 0x0, 0x60, 0x95, 0x0, 0xB, 0x0, 0x68, 0x95, 0x0, 0xB, 0x0, 0x70, 0x95, 0x0, 0xB, 0x0, 0x78, 0x95, 0x0, 0xB, 0x0, 0x80, 0x95, 0x0, 0xB, 0x0, 0x88, 0x95, 0x0, 0xB, 0x0, 0x90, 0x95, 0x0, 0xB, 0x0, 0x98, 0x95, 0x0, 0xB, 0x0, 0xA0, 0x95, 0x0, 0xB, 0x0, 0xA8, 0x95, 0x0, 0xB, 0x0, 0xB0, 0x95, 0x0, 0xB, 0x0, 0xB8, 0x95, 0x0, 0xB, 0x0, 0xC0, 0x95, 0x0, 0xB, 0x0, 0xC8, 0x95, 0x0, 0xB, 0x0, 0xD0, 0x95, 0x0, 0xB, 0x0, 0xD8, 0x95, 0x0, 0xB, 0x0, 0xE0, 0x95, 0x0, 0xB, 0x0, 0xE8, 0x95, 0x0, 0xB, 0x0, 0xF0, 0x95, 0x0, 0xB, 0x0, 0xF8, 0x95, 0x0, 0xB, 0x0, 0x0, 0x96, 0x0, 0xB, 0x0, 0x8, 0x96, 0x0, 0xB, 0x0, 0x10, 0x96, 0x0, 0xB, 0x0, 0x18, 0x96, 0x0, 0xB, 0x0, 0x20, 0x96, 0x0, 0xB, 0x0, 0x28, 0x96, 0x0, 0xB, 0x0, 0x30, 0x96, 0x0, 0xB, 0x0, 0x38, 0x96, 0x0, 0xB, 0x0, 0x40, 0x96, 0x0, 0xB, 0x0, 0x48, 0x96, 0x0, 0xB, 0x0, 0x50, 0x96, 0x0, 0xB, 0x0, 0x58, 0x96, 0x0, 0xB, 0x0, 0x60, 0x96, 0x0, 0xB, 0x0, 0x68, 0x96, 0x0, 0xB, 0x0, 0x70, 0x96, 0x0, 0xB, 0x0, 0x78, 0x96, 0x0, 0xB, 0x0, 0x80, 0x96, 0x0, 0xB, 0x0, 0x88, 0x96, 0x0, 0xB, 0x0, 0x90, 0x96, 0x0, 0xB, 0x0, 0x98, 0x96, 0x0, 0xB, 0x0, 0xA0, 0x96, 0x0, 0xB, 0x0, 0xA8, 0x96, 0x0, 0xB, 0x0, 0xB0, 0x96, 0x0, 0xB, 0x0, 0xB8, 0x96, 0x0, 0xB, 0x0, 0xC0, 0x96, 0x0, 0xB, 0x0, 0xC8, 0x96, 0x0, 0xB, 0x0, 0xD0, 0x96, 0x0, 0xB, 0x0, 0xD8, 0x96, 0x0, 0xB, 0x0, 0xE0, 0x96, 0x0, 0xB, 0x0, 0xE8, 0x96, 0x0, 0xB, 0x0, 0xF0, 0x96, 0x0, 0xB, 0x0, 0xF8, 0x96, 0x0, 0xB, 0x0, 0x0, 0x97, 0x0, 0xB, 0x0, 0x8, 0x97, 0x0, 0xB, 0x0, 0x10, 0x97, 0x0, 0xB, 0x0, 0x18, 0x97, 0x0, 0xB, 0x0, 0x20, 0x97, 0x0, 0xB, 0x0, 0x28, 0x97, 0x0, 0xB, 0x0, 0x30, 0x97, 0x0, 0xB, 0x0, 0x38, 0x97, 0x0, 0xB, 0x0, 0x40, 0x97, 0x0, 0xB, 0x0, 0x48, 0x97, 0x0, 0xB, 0x0, 0x50, 0x97, 0x0, 0xB, 0x0, 0x58, 0x97, 0x0, 0xB, 0x0, 0x60, 0x97, 0x0, 0xB, 0x0, 0x68, 0x97, 0x0, 0xB, 0x0, 0x70, 0x97, 0x0, 0xB, 0x0, 0x78, 0x97, 0x0, 0xB, 0x0, 0x80, 0x97, 0x0, 0xB, 0x0, 0x88, 0x97, 0x0, 0xB, 0x0, 0x90, 0x97, 0x0, 0xB, 0x0, 0x98, 0x97, 0x0, 0xB, 0x0, 0xA0, 0x97, 0x0, 0xB, 0x0, 0xA8, 0x97, 0x0, 0xB, 0x0, 0xB0, 0x97, 0x0, 0xB, 0x0, 0xB8, 0x97, 0x0, 0xB, 0x0, 0xC0, 0x97, 0x0, 0xB, 0x0, 0xC8, 0x97, 0x0, 0xB, 0x0, 0xD0, 0x97, 0x0, 0xB, 0x0, 0xD8, 0x97, 0x0, 0xB, 0x0, 0xE0, 0x97, 0x0, 0xB, 0x0, 0xE8, 0x97, 0x0, 0xB, 0x0, 0xF0, 0x97, 0x0, 0xB, 0x0, 0xF8, 0x97, 0x0, 0xB, 0x0, 0x0, 0x98, 0x0, 0xB, 0x0, 0x8, 0x98, 0x0, 0xB, 0x0, 0x10, 0x98, 0x0, 0xB, 0x0, 0x18, 0x98, 0x0, 0xB, 0x0, 0x20, 0x98, 0x0, 0xB, 0x0, 0x28, 0x98, 0x0, 0xB, 0x0, 0x30, 0x98, 0x0, 0xB, 0x0, 0x38, 0x98, 0x0, 0xB, 0x0, 0x40, 0x98, 0x0, 0xB, 0x0, 0x48, 0x98, 0x0, 0xB, 0x0, 0x50, 0x98, 0x0, 0xB, 0x0, 0x58, 0x98, 0x0, 0xB, 0x0, 0x60, 0x98, 0x0, 0xB, 0x0, 0x68, 0x98, 0x0, 0xB, 0x0, 0x70, 0x98, 0x0, 0xB, 0x0, 0x78, 0x98, 0x0, 0xB, 0x0, 0x80, 0x98, 0x0, 0xB, 0x0, 0x88, 0x98, 0x0, 0xB, 0x0, 0x90, 0x98, 0x0, 0xB, 0x0, 0x98, 0x98, 0x0, 0xB, 0x0, 0xA0, 0x98, 0x0, 0xB, 0x0, 0xA8, 0x98, 0x0, 0xB, 0x0, 0xB0, 0x98, 0x0, 0xB, 0x0, 0xB8, 0x98, 0x0, 0xB, 0x0, 0xC0, 0x98, 0x0, 0xB, 0x0, 0xC8, 0x98, 0x0, 0xB, 0x0, 0xD0, 0x98, 0x0, 0xB, 0x0, 0xD8, 0x98, 0x0, 0xB, 0x0, 0xE0, 0x98, 0x0, 0xB, 0x0, 0xE8, 0x98, 0x0, 0xB, 0x0, 0xF0, 0x98, 0x0, 0xB, 0x0, 0xF8, 0x98, 0x0, 0xB, 0x0, 0x0, 0x99, 0x0, 0xB, 0x0, 0x8, 0x99, 0x0, 0xB, 0x0, 0x10, 0x99, 0x0, 0xB, 0x0, 0x18, 0x99, 0x0, 0xB, 0x0, 0x20, 0x99, 0x0, 0xB, 0x0, 0x28, 0x99, 0x0, 0xB, 0x0, 0x30, 0x99, 0x0, 0xB, 0x0, 0x38, 0x99, 0x0, 0xB, 0x0, 0x40, 0x99, 0x0, 0xB, 0x0, 0x48, 0x99, 0x0, 0xB, 0x0, 0x50, 0x99, 0x0, 0xB, 0x0, 0x58, 0x99, 0x0, 0xB, 0x0, 0x60, 0x99, 0x0, 0xB, 0x0, 0x68, 0x99, 0x0, 0xB, 0x0, 0x70, 0x99, 0x0, 0xB, 0x0, 0x78, 0x99, 0x0, 0xB, 0x0, 0x80, 0x99, 0x0, 0xB, 0x0, 0x88, 0x99, 0x0, 0xB, 0x0, 0x90, 0x99, 0x0, 0xB, 0x0, 0x98, 0x99, 0x0, 0xB, 0x0, 0xA0, 0x99, 0x0, 0xB, 0x0, 0xA8, 0x99, 0x0, 0xB, 0x0, 0xB0, 0x99, 0x0, 0xB, 0x0, 0xB8, 0x99, 0x0, 0xB, 0x0, 0xC0, 0x99, 0x0, 0xB, 0x0, 0xC8, 0x99, 0x0, 0xB, 0x0, 0xD0, 0x99, 0x0, 0xB, 0x0, 0xD8, 0x99, 0x0, 0xB, 0x0, 0xE0, 0x99, 0x0, 0xB, 0x0, 0xE8, 0x99, 0x0, 0xB, 0x0, 0xF0, 0x99, 0x0, 0xB, 0x0, 0xF8, 0x99, 0x0, 0xB, 0x0, 0x0, 0x9A, 0x0, 0xB, 0x0, 0x8, 0x9A, 0x0, 0xB, 0x0, 0x10, 0x9A, 0x0, 0xB, 0x0, 0x18, 0x9A, 0x0, 0xB, 0x0, 0x20, 0x9A, 0x0, 0xB, 0x0, 0x28, 0x9A, 0x0, 0xB, 0x0, 0x30, 0x9A, 0x0, 0xB, 0x0, 0x38, 0x9A, 0x0, 0xB, 0x0, 0x40, 0x9A, 0x0, 0xB, 0x0, 0x48, 0x9A, 0x0, 0xB, 0x0, 0x50, 0x9A, 0x0, 0xB, 0x0, 0x58, 0x9A, 0x0, 0xB, 0x0, 0x60, 0x9A, 0x0, 0xB, 0x0, 0x68, 0x9A, 0x0, 0xB, 0x0, 0x70, 0x9A, 0x0, 0xB, 0x0, 0x78, 0x9A, 0x0, 0xB, 0x0, 0x80, 0x9A, 0x0, 0xB, 0x0, 0x88, 0x9A, 0x0, 0xB, 0x0, 0x90, 0x9A, 0x0, 0xB, 0x0, 0x98, 0x9A, 0x0, 0xB, 0x0, 0xA0, 0x9A, 0x0, 0xB, 0x0, 0xA8, 0x9A, 0x0, 0xB, 0x0, 0xB0, 0x9A, 0x0, 0xB, 0x0, 0xB8, 0x9A, 0x0, 0xB, 0x0, 0xC0, 0x9A, 0x0, 0xB, 0x0, 0xC8, 0x9A, 0x0, 0xB, 0x0, 0xD0, 0x9A, 0x0, 0xB, 0x0, 0xD8, 0x9A, 0x0, 0xB, 0x0, 0xE0, 0x9A, 0x0, 0xB, 0x0, 0xE8, 0x9A, 0x0, 0xB, 0x0, 0xF0, 0x9A, 0x0, 0xB, 0x0, 0xF8, 0x9A, 0x0, 0xB, 0x0, 0x0, 0x9B, 0x0, 0xB, 0x0, 0x8, 0x9B, 0x0, 0xB, 0x0, 0x10, 0x9B, 0x0, 0xB, 0x0, 0x18, 0x9B, 0x0, 0xB, 0x0, 0x20, 0x9B, 0x0, 0xB, 0x0, 0x28, 0x9B, 0x0, 0xB, 0x0, 0x30, 0x9B, 0x0, 0xB, 0x0, 0x38, 0x9B, 0x0, 0xB, 0x0, 0x40, 0x9B, 0x0, 0xB, 0x0, 0x48, 0x9B, 0x0, 0xB, 0x0, 0x50, 0x9B, 0x0, 0xB, 0x0, 0x58, 0x9B, 0x0, 0xB, 0x0, 0x60, 0x9B, 0x0, 0xB, 0x0, 0x68, 0x9B, 0x0, 0xB, 0x0, 0x70, 0x9B, 0x0, 0xB, 0x0, 0x78, 0x9B, 0x0, 0xB, 0x0, 0x80, 0x9B, 0x0, 0xB, 0x0, 0x88, 0x9B, 0x0, 0xB, 0x0, 0x90, 0x9B, 0x0, 0xB, 0x0, 0x98, 0x9B, 0x0, 0xB, 0x0, 0xA0, 0x9B, 0x0, 0xB, 0x0, 0xA8, 0x9B, 0x0, 0xB, 0x0, 0xB0, 0x9B, 0x0, 0xB, 0x0, 0xB8, 0x9B, 0x0, 0xB, 0x0, 0xC0, 0x9B, 0x0, 0xB, 0x0, 0xC8, 0x9B, 0x0, 0xB, 0x0, 0xD0, 0x9B, 0x0, 0xB, 0x0, 0xD8, 0x9B, 0x0, 0xB, 0x0, 0xE0, 0x9B, 0x0, 0xB, 0x0, 0xE8, 0x9B, 0x0, 0xB, 0x0, 0xF0, 0x9B, 0x0, 0xB, 0x0, 0xF8, 0x9B, 0x0, 0xB, 0x0, 0x0, 0x9C, 0x0, 0xB, 0x0, 0x8, 0x9C, 0x0, 0xB, 0x0, 0x10, 0x9C, 0x0, 0xB, 0x0, 0x18, 0x9C, 0x0, 0xB, 0x0, 0x20, 0x9C, 0x0, 0xB, 0x0, 0x28, 0x9C, 0x0, 0xB, 0x0, 0x30, 0x9C, 0x0, 0xB, 0x0, 0x38, 0x9C, 0x0, 0xB, 0x0, 0x40, 0x9C, 0x0, 0xB, 0x0, 0x48, 0x9C, 0x0, 0xB, 0x0, 0x50, 0x9C, 0x0, 0xB, 0x0, 0x58, 0x9C, 0x0, 0xB, 0x0, 0x60, 0x9C, 0x0, 0xB, 0x0, 0x68, 0x9C, 0x0, 0xB, 0x0, 0x70, 0x9C, 0x0, 0xB, 0x0, 0x78, 0x9C, 0x0, 0xB, 0x0, 0x80, 0x9C, 0x0, 0xB, 0x0, 0x88, 0x9C, 0x0, 0xB, 0x0, 0x90, 0x9C, 0x0, 0xB, 0x0, 0x98, 0x9C, 0x0, 0xB, 0x0, 0xA0, 0x9C, 0x0, 0xB, 0x0, 0xA8, 0x9C, 0x0, 0xB, 0x0, 0xB0, 0x9C, 0x0, 0xB, 0x0, 0xB8, 0x9C, 0x0, 0xB, 0x0, 0xC0, 0x9C, 0x0, 0xB, 0x0, 0xC8, 0x9C, 0x0, 0xB, 0x0, 0xD0, 0x9C, 0x0, 0xB, 0x0, 0xD8, 0x9C, 0x0, 0xB, 0x0, 0xE0, 0x9C, 0x0, 0xB, 0x0, 0xE8, 0x9C, 0x0, 0xB, 0x0, 0xF0, 0x9C, 0x0, 0xB, 0x0, 0xF8, 0x9C, 0x0, 0xB, 0x0, 0x0, 0x9D, 0x0, 0xB, 0x0, 0x8, 0x9D, 0x0, 0xB, 0x0, 0x10, 0x9D, 0x0, 0xB, 0x0, 0x18, 0x9D, 0x0, 0xB, 0x0, 0x20, 0x9D, 0x0, 0xB, 0x0, 0x28, 0x9D, 0x0, 0xB, 0x0, 0x30, 0x9D, 0x0, 0xB, 0x0, 0x38, 0x9D, 0x0, 0xB, 0x0, 0x40, 0x9D, 0x0, 0xB, 0x0, 0x48, 0x9D, 0x0, 0xB, 0x0, 0x50, 0x9D, 0x0, 0xB, 0x0, 0x58, 0x9D, 0x0, 0xB, 0x0, 0x60, 0x9D, 0x0, 0xB, 0x0, 0x68, 0x9D, 0x0, 0xB, 0x0, 0x70, 0x9D, 0x0, 0xB, 0x0, 0x78, 0x9D, 0x0, 0xB, 0x0, 0x80, 0x9D, 0x0, 0xB, 0x0, 0x88, 0x9D, 0x0, 0xB, 0x0, 0x90, 0x9D, 0x0, 0xB, 0x0, 0x98, 0x9D, 0x0, 0xB, 0x0, 0xA0, 0x9D, 0x0, 0xB, 0x0, 0xA8, 0x9D, 0x0, 0xB, 0x0, 0xB0, 0x9D, 0x0, 0xB, 0x0, 0xB8, 0x9D, 0x0, 0xB, 0x0, 0xC0, 0x9D, 0x0, 0xB, 0x0, 0xC8, 0x9D, 0x0, 0xB, 0x0, 0xD0, 0x9D, 0x0, 0xB, 0x0, 0xD8, 0x9D, 0x0, 0xB, 0x0, 0xE0, 0x9D, 0x0, 0xB, 0x0, 0xE8, 0x9D, 0x0, 0xB, 0x0, 0xF0, 0x9D, 0x0, 0xB, 0x0, 0xF8, 0x9D, 0x0, 0xB, 0x0, 0x0, 0x9E, 0x0, 0xB, 0x0, 0x8, 0x9E, 0x0, 0xB, 0x0, 0x10, 0x9E, 0x0, 0xB, 0x0, 0x18, 0x9E, 0x0, 0xB, 0x0, 0x20, 0x9E, 0x0, 0xB, 0x0, 0x28, 0x9E, 0x0, 0xB, 0x0, 0x30, 0x9E, 0x0, 0xEC, 0x78, 0x2, 0x0, 0x0, 0xC, 0x79, 0x2, 0x0, 0x0, 0x2C, 0x79, 0x2, 0x0, 0x0, 0x4C, 0x79, 0x2, 0x0, 0x0, 0x6C, 0x79, 0x2, 0x0, 0x0, 0x8C, 0x79, 0x2, 0x0, 0x0, 0xAC, 0x79, 0x2, 0x0, 0x0, 0xCC, 0x79, 0x2, 0x0, 0x0, 0xEC, 0x79, 0x2, 0x0, 0x0, 0xC, 0x7A, 0x2, 0x0, 0x0, 0x2C, 0x7A, 0x2, 0x0, 0x0, 0x4C, 0x7A, 0x2, 0x0, 0x0, 0x6C, 0x7A, 0x2, 0x0, 0x0, 0x8C, 0x7A, 0x2, 0x0, 0x0, 0xAC, 0x7A, 0x2, 0x0, 0x0, 0xCC, 0x7A, 0x2, 0x0, 0x0, 0xEC, 0x7A, 0x2, 0x0, 0x0, 0xC, 0x7B, 0x2, 0x0, 0x0, 0x2C, 0x7B, 0x2, 0x0, 0x0, 0x4C, 0x7B, 0x2, 0x0, 0x0, 0x6C, 0x7B, 0x2, 0x0, 0x0, 0x8C, 0x7B, 0x2, 0x0, 0x0, 0xAC, 0x7B, 0x2, 0x0, 0x0, 0xCC, 0x7B, 0x2, 0x0, 0x0, 0xEC, 0x7B, 0x2, 0x0, 0x0, 0xC, 0x7C, 0x2, 0x0, 0x0, 0xC, 0x0, 0x8, 0x9F, 0x0, 0x4C, 0x7C, 0x2, 0x0, 0x0, 0xC, 0x0, 0x18, 0x9F, 0x0, 0x8C, 0x7C, 0x2, 0x0, 0x0, 0xC, 0x0, 0x28, 0x9F, 0x0, 0xCC, 0x7C, 0x2, 0x0, 0x0, 0xC, 0x0, 0x38, 0x9F, 0x0, 0xC, 0x7D, 0x2, 0x0, 0x0, 0xC, 0x0, 0x48, 0x9F, 0x0, 0x4C, 0x7D, 0x2, 0x0, 0x0, 0xC, 0x0, 0x58, 0x9F, 0x0, 0x8C, 0x7D, 0x2, 0x0, 0x0, 0xC, 0x0, 0x68, 0x9F, 0x0, 0xCC, 0x7D, 0x2, 0x0, 0x0, 0xC, 0x0, 0x78, 0x9F, 0x0, 0xC, 0x7E, 0x2, 0x0, 0x0, 0xC, 0x0, 0x88, 0x9F, 0x0, 0x4C, 0x7E, 0x2, 0x0, 0x0, 0xC, 0x0, 0x98, 0x9F, 0x0, 0x8C, 0x7E, 0x2, 0x0, 0x0, 0xC, 0x0, 0xA8, 0x9F, 0x0, 0xCC, 0x7E, 0x2, 0x0, 0x0, 0xC, 0x0, 0xB8, 0x9F, 0x0, 0xC, 0x7F, 0x2, 0x0, 0x0, 0xC, 0x0, 0xC8, 0x9F, 0x0, 0x4C, 0x7F, 0x2, 0x0, 0x0, 0xC, 0x0, 0xD8, 0x9F, 0x0, 0x8C, 0x7F, 0x2, 0x0, 0x0, 0xC, 0x0, 0xE8, 0x9F, 0x0, 0xCC, 0x7F, 0x2, 0x0, 0x0, 0xC, 0x0, 0xF8, 0x9F, 0x0, 0xC, 0x80, 0x2, 0x0, 0x0, 0xC, 0x0, 0x8, 0xA0, 0x0, 0x4C, 0x80, 0x2, 0x0, 0x0, 0xC, 0x0, 0x18, 0xA0, 0x0, 0x8C, 0x80, 0x2, 0x0, 0x0, 0xC, 0x0, 0x28, 0xA0, 0x0, 0xCC, 0x80, 0x2, 0x0, 0x0, 0xC, 0x0, 0x38, 0xA0, 0x0, 0xC, 0x81, 0x2, 0x0, 0x0, 0xC, 0x0, 0x48, 0xA0, 0x0, 0x4C, 0x81, 0x2, 0x0, 0x0, 0xC, 0x0, 0x58, 0xA0, 0x0, 0x8C, 0x81, 0x2, 0x0, 0x0, 0xC, 0x0, 0x68, 0xA0, 0x0, 0xCC, 0x81, 0x2, 0x0, 0x0, 0xC, 0x0, 0x78, 0xA0, 0x0, 0xC, 0x82, 0x2, 0x0, 0x0, 0xC, 0x0, 0x88, 0xA0, 0x0, 0x4C, 0x82, 0x2, 0x0, 0x0, 0xC, 0x0, 0x98, 0xA0, 0x0, 0x8C, 0x82, 0x2, 0x0, 0x0, 0xC, 0x0, 0xA8, 0xA0, 0x0, 0xCC, 0x82, 0x2, 0x0, 0x0, 0xC, 0x0, 0xB8, 0xA0, 0x0, 0xC, 0x83, 0x2, 0x0, 0x0, 0xC, 0x0, 0xC8, 0xA0, 0x0, 0x4C, 0x83, 0x2, 0x0, 0x0, 0xC, 0x0, 0xD8, 0xA0, 0x0, 0x8C, 0x83, 0x2, 0x0, 0x0, 0xC, 0x0, 0xE8, 0xA0, 0x0, 0xCC, 0x83, 0x2, 0x0, 0x0, 0xC, 0x0, 0xF8, 0xA0, 0x0, 0xC, 0x84, 0x2, 0x0, 0x0, 0xC, 0x0, 0x8, 0xA1, 0x0, 0x4C, 0x84, 0x2, 0x0, 0x0, 0xC, 0x0, 0x18, 0xA1, 0x0, 0x8C, 0x84, 0x2, 0x0, 0x0, 0xC, 0x0, 0x28, 0xA1, 0x0, 0xCC, 0x84, 0x2, 0x0, 0x0, 0xC, 0x0, 0x38, 0xA1, 0x0, 0xC, 0x85, 0x2, 0x0, 0x0, 0xC, 0x0, 0x48, 0xA1, 0x0, 0x4C, 0x85, 0x2, 0x0, 0x0, 0xC, 0x0, 0x58, 0xA1, 0x0, 0x8C, 0x85, 0x2, 0x0, 0x0, 0xC, 0x0, 0x68, 0xA1, 0x0, 0xCC, 0x85, 0x2, 0x0, 0x0, 0xC, 0x0, 0x78, 0xA1, 0x0, 0xC, 0x86, 0x2, 0x0, 0x0, 0xC, 0x0, 0x88, 0xA1, 0x0, 0x4C, 0x86, 0x2, 0x0, 0x0, 0xC, 0x0, 0x98, 0xA1, 0x0, 0x8C, 0x86, 0x2, 0x0, 0x0, 0xC, 0x0, 0xA8, 0xA1, 0x0, 0xCC, 0x86, 0x2, 0x0, 0x0, 0xC, 0x0, 0xB8, 0xA1, 0x0, 0xC, 0x87, 0x2, 0x0, 0x0, 0xC, 0x0, 0xC8, 0xA1, 0x0, 0x4C, 0x87, 0x2, 0x0, 0x0, 0xC, 0x0, 0xD8, 0xA1, 0x0, 0x8C, 0x87, 0x2, 0x0, 0x0, 0xC, 0x0, 0xE8, 0xA1, 0x0, 0xCC, 0x87, 0x2, 0x0, 0x0, 0xC, 0x0, 0xF8, 0xA1, 0x0, 0xC, 0x88, 0x2, 0x0, 0x0, 0xC, 0x0, 0x8, 0xA2, 0x0, 0x4C, 0x88, 0x2, 0x0, 0x0, 0xC, 0x0, 0x18, 0xA2, 0x0, 0x8C, 0x88, 0x2, 0x0, 0x0, 0xC, 0x0, 0x28, 0xA2, 0x0, 0xCC, 0x88, 0x2, 0x0, 0x0, 0xC, 0x0, 0x38, 0xA2, 0x0, 0xC, 0x89, 0x2, 0x0, 0x0, 0xC, 0x0, 0x48, 0xA2, 0x0, 0x4C, 0x89, 0x2, 0x0, 0x0, 0xC, 0x0, 0x58, 0xA2, 0x0, 0x8C, 0x89, 0x2, 0x0, 0x0, 0xC, 0x0, 0x68, 0xA2, 0x0, 0xCC, 0x89, 0x2, 0x0, 0x0, 0xC, 0x0, 0x78, 0xA2, 0x0, 0xC, 0x8A, 0x2, 0x0, 0x0, 0xC, 0x0, 0x88, 0xA2, 0x0, 0x4C, 0x8A, 0x2, 0x0, 0x0, 0xC, 0x0, 0x98, 0xA2, 0x0, 0x8C, 0x8A, 0x2, 0x0, 0x0, 0xC, 0x0, 0xA8, 0xA2, 0x0, 0xCC, 0x8A, 0x2, 0x0, 0x0, 0xC, 0x0, 0xB8, 0xA2, 0x0, 0xC, 0x8B, 0x2, 0x0, 0x0, 0xC, 0x0, 0xC8, 0xA2, 0x0, 0x4C, 0x8B, 0x2, 0x0, 0x0, 0xC, 0x0, 0xD8, 0xA2, 0x0, 0x8C, 0x8B, 0x2, 0x0, 0x0, 0xC, 0x0, 0xE8, 0xA2, 0x0, 0xCC, 0x8B, 0x2, 0x0, 0x0, 0xC, 0x0, 0xF8, 0xA2, 0x0, 0xC, 0x8C, 0x2, 0x0, 0x0, 0xC, 0x0, 0x8, 0xA3, 0x0, 0x4C, 0x8C, 0x2, 0x0, 0x0, 0xC, 0x0, 0x18, 0xA3, 0x0, 0x8C, 0x8C, 0x2, 0x0, 0x0, 0xC, 0x0, 0x28, 0xA3, 0x0, 0xCC, 0x8C, 0x2, 0x0, 0x0, 0xC, 0x0, 0x38, 0xA3, 0x0, 0xC, 0x8D, 0x2, 0x0, 0x0, 0xC, 0x0, 0x48, 0xA3, 0x0, 0x4C, 0x8D, 0x2, 0x0, 0x0, 0xC, 0x0, 0x58, 0xA3, 0x0, 0x8C, 0x8D, 0x2, 0x0, 0x0, 0xC, 0x0, 0x68, 0xA3, 0x0, 0xCC, 0x8D, 0x2, 0x0, 0x0, 0xC, 0x0, 0x78, 0xA3, 0x0, 0xC, 0x8E, 0x2, 0x0, 0x0, 0xC, 0x0, 0x88, 0xA3, 0x0, 0x4C, 0x8E, 0x2, 0x0, 0x0, 0xC, 0x0, 0x98, 0xA3, 0x0, 0x8C, 0x8E, 0x2, 0x0, 0x0, 0xC, 0x0, 0xA8, 0xA3, 0x0, 0xCC, 0x8E, 0x2, 0x0, 0x0, 0xC, 0x0, 0xB8, 0xA3, 0x0, 0xC, 0x8F, 0x2, 0x0, 0x0, 0xC, 0x0, 0xC8, 0xA3, 0x0, 0x4C, 0x8F, 0x2, 0x0, 0x0, 0xC, 0x0, 0xD8, 0xA3, 0x0, 0x8C, 0x8F, 0x2, 0x0, 0x0, 0xC, 0x0, 0xE8, 0xA3, 0x0, 0xCC, 0x8F, 0x2, 0x0, 0x0, 0xC, 0x0, 0xF8, 0xA3, 0x0, 0xC, 0x90, 0x2, 0x0, 0x0, 0xC, 0x0, 0x8, 0xA4, 0x0, 0xC, 0x0, 0x10, 0xA4, 0x0, 0x6C, 0x90, 0x2, 0x0, 0x0, 0xC, 0x0, 0x20, 0xA4, 0x0, 0xC, 0x0, 0x28, 0xA4, 0x0, 0xC, 0x0, 0x30, 0xA4, 0x0, 0xC, 0x0, 0x38, 0xA4, 0x0, 0xC, 0x0, 0x40, 0xA4, 0x0, 0xC, 0x0, 0x48, 0xA4, 0x0, 0xC, 0x0, 0x50, 0xA4, 0x0, 0xC, 0x0, 0x58, 0xA4, 0x0, 0xC, 0x0, 0x60, 0xA4, 0x0, 0xC, 0x0, 0x68, 0xA4, 0x0, 0xC, 0x0, 0x70, 0xA4, 0x0, 0xC, 0x0, 0x78, 0xA4, 0x0, 0xC, 0x0, 0x80, 0xA4, 0x0, 0xC, 0x0, 0x88, 0xA4, 0x0, 0xC, 0x0, 0x90, 0xA4, 0x0, 0xC, 0x0, 0x98, 0xA4, 0x0, 0xC, 0x0, 0xA0, 0xA4, 0x0, 0xC, 0x0, 0xA8, 0xA4, 0x0, 0xC, 0x0, 0xB0, 0xA4, 0x0, 0xC, 0x0, 0xB8, 0xA4, 0x0, 0xC, 0x0, 0xC0, 0xA4, 0x0, 0xC, 0x0, 0xC8, 0xA4, 0x0, 0xC, 0x0, 0xD0, 0xA4, 0x0, 0xC, 0x0, 0xD8, 0xA4, 0x0, 0xC, 0x0, 0xE0, 0xA4, 0x0, 0xC, 0x0, 0xE8, 0xA4, 0x0, 0xC, 0x0, 0xF0, 0xA4, 0x0, 0xC, 0x0, 0xF8, 0xA4, 0x0, 0xC, 0x0, 0x0, 0xA5, 0x0, 0xC, 0x0, 0x8, 0xA5, 0x0, 0xC, 0x0, 0x10, 0xA5, 0x0, 0xC, 0x0, 0x18, 0xA5, 0x0, 0xC, 0x0, 0x20, 0xA5, 0x0, 0xC, 0x0, 0x28, 0xA5, 0x0, 0xC, 0x0, 0x30, 0xA5, 0x0, 0xC, 0x0, 0x38, 0xA5, 0x0, 0xC, 0x0, 0x40, 0xA5, 0x0, 0xC, 0x0, 0x48, 0xA5, 0x0, 0xC, 0x0, 0x50, 0xA5, 0x0, 0xC, 0x0, 0x58, 0xA5, 0x0, 0xC, 0x0, 0x60, 0xA5, 0x0, 0xC, 0x0, 0x68, 0xA5, 0x0, 0xC, 0x0, 0x70, 0xA5, 0x0, 0xC, 0x0, 0x78, 0xA5, 0x0, 0xC, 0x0, 0x80, 0xA5, 0x0, 0xC, 0x0, 0x88, 0xA5, 0x0, 0xC, 0x0, 0x90, 0xA5, 0x0, 0x6C, 0x96, 0x2, 0x0, 0x0, 0xC, 0x0, 0xA0, 0xA5, 0x0, 0xC, 0x0, 0xA8, 0xA5, 0x0, 0xC, 0x0, 0xB0, 0xA5, 0x0, 0xC, 0x0, 0xB8, 0xA5, 0x0, 0xC, 0x0, 0xC0, 0xA5, 0x0, 0xC, 0x0, 0xC8, 0xA5, 0x0, 0xC, 0x0, 0xD0, 0xA5, 0x0, 0xC, 0x0, 0xD8, 0xA5, 0x0, 0xC, 0x0, 0xE0, 0xA5, 0x0, 0xC, 0x0, 0xE8, 0xA5, 0x0, 0xC, 0x0, 0xF0, 0xA5, 0x0, 0xC, 0x0, 0xF8, 0xA5, 0x0, 0xC, 0x0, 0x0, 0xA6, 0x0, 0xC, 0x0, 0x8, 0xA6, 0x0, 0xC, 0x0, 0x10, 0xA6, 0x0, 0xC, 0x0, 0x18, 0xA6, 0x0, 0xC, 0x0, 0x20, 0xA6, 0x0, 0xC, 0x0, 0x28, 0xA6, 0x0, 0xC, 0x0, 0x30, 0xA6, 0x0, 0xC, 0x0, 0x38, 0xA6, 0x0, 0xC, 0x0, 0x40, 0xA6, 0x0, 0xC, 0x0, 0x48, 0xA6, 0x0, 0xC, 0x0, 0x50, 0xA6, 0x0, 0xC, 0x0, 0x58, 0xA6, 0x0, 0xC, 0x0, 0x60, 0xA6, 0x0, 0xC, 0x0, 0x68, 0xA6, 0x0, 0xC, 0x0, 0x70, 0xA6, 0x0, 0xC, 0x0, 0x78, 0xA6, 0x0, 0xC, 0x0, 0x80, 0xA6, 0x0, 0xC, 0x0, 0x88, 0xA6, 0x0, 0xC, 0x0, 0x90, 0xA6, 0x0, 0xC, 0x0, 0x98, 0xA6, 0x0, 0xC, 0x0, 0xA0, 0xA6, 0x0, 0xC, 0x0, 0xA8, 0xA6, 0x0, 0xC, 0x0, 0xB0, 0xA6, 0x0, 0xC, 0x0, 0xB8, 0xA6, 0x0, 0xC, 0x0, 0xC0, 0xA6, 0x0, 0xC, 0x0, 0xC8, 0xA6, 0x0, 0xC, 0x0, 0xD0, 0xA6, 0x0, 0xC, 0x0, 0xD8, 0xA6, 0x0, 0xC, 0x0, 0xE0, 0xA6, 0x0, 0xC, 0x0, 0xE8, 0xA6, 0x0, 0xC, 0x0, 0xF0, 0xA6, 0x0, 0xC, 0x0, 0xF8, 0xA6, 0x0, 0xC, 0x0, 0x0, 0xA7, 0x0, 0xC, 0x0, 0x8, 0xA7, 0x0, 0xC, 0x0, 0x10, 0xA7, 0x0, 0xC, 0x0, 0x18, 0xA7, 0x0, 0xC, 0x0, 0x20, 0xA7, 0x0, 0xC, 0x0, 0x28, 0xA7, 0x0, 0xC, 0x0, 0x30, 0xA7, 0x0, 0xC, 0x0, 0x38, 0xA7, 0x0, 0xC, 0x0, 0x40, 0xA7, 0x0, 0xC, 0x0, 0x48, 0xA7, 0x0, 0xC, 0x0, 0x50, 0xA7, 0x0, 0xC, 0x0, 0x58, 0xA7, 0x0, 0xC, 0x0, 0x60, 0xA7, 0x0, 0xC, 0x0, 0x68, 0xA7, 0x0, 0xC, 0x0, 0x70, 0xA7, 0x0, 0xC, 0x0, 0x78, 0xA7, 0x0, 0xC, 0x0, 0x80, 0xA7, 0x0, 0xC, 0x0, 0x88, 0xA7, 0x0, 0xC, 0x0, 0x90, 0xA7, 0x0, 0xC, 0x0, 0x98, 0xA7, 0x0, 0xC, 0x0, 0xA0, 0xA7, 0x0, 0xC, 0x0, 0xA8, 0xA7, 0x0, 0xC, 0x0, 0xB0, 0xA7, 0x0, 0xC, 0x0, 0xB8, 0xA7, 0x0, 0xC, 0x0, 0xC0, 0xA7, 0x0, 0xC, 0x0, 0xC8, 0xA7, 0x0, 0xC, 0x0, 0xD0, 0xA7, 0x0, 0xC, 0x0, 0xD8, 0xA7, 0x0, 0xC, 0x0, 0xE0, 0xA7, 0x0, 0xC, 0x0, 0xE8, 0xA7, 0x0, 0xC, 0x0, 0xF0, 0xA7, 0x0, 0xC, 0x0, 0xF8, 0xA7, 0x0, 0xC, 0x0, 0x0, 0xA8, 0x0, 0xC, 0x0, 0x8, 0xA8, 0x0, 0x4C, 0xA0, 0x2, 0x0, 0x0, 0xC, 0x0, 0x18, 0xA8, 0x0, 0x8C, 0xA0, 0x2, 0x0, 0x0, 0xC, 0x0, 0x28, 0xA8, 0x0, 0xCC, 0xA0, 0x2, 0x0, 0x0, 0xC, 0x0, 0x38, 0xA8, 0x0, 0xC, 0xA1, 0x2, 0x0, 0x0, 0xC, 0x0, 0x48, 0xA8, 0x0, 0x4C, 0xA1, 0x2, 0x0, 0x0, 0xC, 0x0, 0x58, 0xA8, 0x0, 0x8C, 0xA1, 0x2, 0x0, 0x0, 0xC, 0x0, 0x68, 0xA8, 0x0, 0xCC, 0xA1, 0x2, 0x0, 0x0, 0xC, 0x0, 0x78, 0xA8, 0x0, 0xC, 0xA2, 0x2, 0x0, 0x0, 0xC, 0x0, 0x88, 0xA8, 0x0, 0x4C, 0xA2, 0x2, 0x0, 0x0, 0xC, 0x0, 0x98, 0xA8, 0x0, 0x8C, 0xA2, 0x2, 0x0, 0x0, 0xC, 0x0, 0xA8, 0xA8, 0x0, 0xCC, 0xA2, 0x2, 0x0, 0x0, 0xC, 0x0, 0xB8, 0xA8, 0x0, 0xC, 0xA3, 0x2, 0x0, 0x0, 0xC, 0x0, 0xC8, 0xA8, 0x0, 0x4C, 0xA3, 0x2, 0x0, 0x0, 0xC, 0x0, 0xD8, 0xA8, 0x0, 0x8C, 0xA3, 0x2, 0x0, 0x0, 0xC, 0x0, 0xE8, 0xA8, 0x0, 0xCC, 0xA3, 0x2, 0x0, 0x0, 0xC, 0x0, 0xF8, 0xA8, 0x0, 0xC, 0xA4, 0x2, 0x0, 0x0, 0xC, 0x0, 0x8, 0xA9, 0x0, 0x4C, 0xA4, 0x2, 0x0, 0x0, 0xC, 0x0, 0x18, 0xA9, 0x0, 0x8C, 0xA4, 0x2, 0x0, 0x0, 0xC, 0x0, 0x28, 0xA9, 0x0, 0xCC, 0xA4, 0x2, 0x0, 0x0, 0xC, 0x0, 0x38, 0xA9, 0x0, 0xC, 0xA5, 0x2, 0x0, 0x0, 0xC, 0x0, 0x48, 0xA9, 0x0, 0x4C, 0xA5, 0x2, 0x0, 0x0, 0xC, 0x0, 0x58, 0xA9, 0x0, 0x8C, 0xA5, 0x2, 0x0, 0x0, 0xC, 0x0, 0x68, 0xA9, 0x0, 0xCC, 0xA5, 0x2, 0x0, 0x0, 0xC, 0x0, 0x78, 0xA9, 0x0, 0xC, 0xA6, 0x2, 0x0, 0x0, 0xC, 0x0, 0x88, 0xA9, 0x0, 0x4C, 0xA6, 0x2, 0x0, 0x0, 0xC, 0x0, 0x98, 0xA9, 0x0, 0x8C, 0xA6, 0x2, 0x0, 0x0, 0xC, 0x0, 0xA8, 0xA9, 0x0, 0xCC, 0xA6, 0x2, 0x0, 0x0, 0xC, 0x0, 0xB8, 0xA9, 0x0, 0xC, 0xA7, 0x2, 0x0, 0x0, 0xC, 0x0, 0xC8, 0xA9, 0x0, 0x4C, 0xA7, 0x2, 0x0, 0x0, 0xC, 0x0, 0xD8, 0xA9, 0x0, 0x8C, 0xA7, 0x2, 0x0, 0x0, 0xC, 0x0, 0xE8, 0xA9, 0x0, 0xCC, 0xA7, 0x2, 0x0, 0x0, 0xC, 0x0, 0xF8, 0xA9, 0x0, 0xC, 0xA8, 0x2, 0x0, 0x0, 0xC, 0x0, 0x8, 0xAA, 0x0, 0x4C, 0xA8, 0x2, 0x0, 0x0, 0xC, 0x0, 0x18, 0xAA, 0x0, 0x8C, 0xA8, 0x2, 0x0, 0x0, 0xC, 0x0, 0x28, 0xAA, 0x0, 0xCC, 0xA8, 0x2, 0x0, 0x0, 0xC, 0x0, 0x38, 0xAA, 0x0, 0xC, 0xA9, 0x2, 0x0, 0x0, 0xC, 0x0, 0x48, 0xAA, 0x0, 0x4C, 0xA9, 0x2, 0x0, 0x0, 0xC, 0x0, 0x58, 0xAA, 0x0, 0x8C, 0xA9, 0x2, 0x0, 0x0, 0xC, 0x0, 0x68, 0xAA, 0x0, 0xCC, 0xA9, 0x2, 0x0, 0x0, 0xC, 0x0, 0x78, 0xAA, 0x0, 0xC, 0xAA, 0x2, 0x0, 0x0, 0xC, 0x0, 0x88, 0xAA, 0x0, 0xC, 0x0, 0x90, 0xAA, 0x0, 0xC, 0x0, 0x98, 0xAA, 0x0, 0xC, 0x0, 0xA0, 0xAA, 0x0, 0xC, 0x0, 0xA8, 0xAA, 0x0, 0xC, 0x0, 0xB0, 0xAA, 0x0, 0xC, 0x0, 0xB8, 0xAA, 0x0, 0xC, 0x0, 0xC0, 0xAA, 0x0, 0xC, 0x0, 0xC8, 0xAA, 0x0, 0xC, 0x0, 0xD0, 0xAA, 0x0, 0xC, 0x0, 0xD8, 0xAA, 0x0, 0xC, 0x0, 0xE0, 0xAA, 0x0, 0xC, 0x0, 0xE8, 0xAA, 0x0, 0xC, 0x0, 0xF0, 0xAA, 0x0, 0xC, 0x0, 0xF8, 0xAA, 0x0, 0xC, 0x0, 0x0, 0xAB, 0x0, 0xC, 0x0, 0x8, 0xAB, 0x0, 0xC, 0x0, 0x10, 0xAB, 0x0, 0xC, 0x0, 0x18, 0xAB, 0x0, 0xC, 0x0, 0x20, 0xAB, 0x0, 0xC, 0x0, 0x28, 0xAB, 0x0, 0xC, 0x0, 0x30, 0xAB, 0x0, 0xC, 0x0, 0x38, 0xAB, 0x0, 0xC, 0x0, 0x40, 0xAB, 0x0, 0xC, 0x0, 0x48, 0xAB, 0x0, 0xC, 0x0, 0x50, 0xAB, 0x0, 0xC, 0x0, 0x58, 0xAB, 0x0, 0xC, 0x0, 0x60, 0xAB, 0x0, 0xC, 0x0, 0x68, 0xAB, 0x0, 0xC, 0x0, 0x70, 0xAB, 0x0, 0xC, 0x0, 0x78, 0xAB, 0x0, 0xC, 0x0, 0x80, 0xAB, 0x0, 0xC, 0x0, 0x88, 0xAB, 0x0, 0xC, 0x0, 0x90, 0xAB, 0x0, 0xC, 0x0, 0x98, 0xAB, 0x0, 0xC, 0x0, 0xA0, 0xAB, 0x0, 0xC, 0x0, 0xA8, 0xAB, 0x0, 0xC, 0x0, 0xB0, 0xAB, 0x0, 0xC, 0x0, 0xB8, 0xAB, 0x0, 0xC, 0x0, 0xC0, 0xAB, 0x0, 0xC, 0x0, 0xC8, 0xAB, 0x0, 0xC, 0x0, 0xD0, 0xAB, 0x0, 0xC, 0x0, 0xD8, 0xAB, 0x0, 0xC, 0x0, 0xE0, 0xAB, 0x0, 0xC, 0x0, 0xE8, 0xAB, 0x0, 0xC, 0x0, 0xF0, 0xAB, 0x0, 0xC, 0x0, 0xF8, 0xAB, 0x0, 0xC, 0x0, 0x0, 0xAC, 0x0, 0xC, 0x0, 0x8, 0xAC, 0x0, 0xC, 0x0, 0x10, 0xAC, 0x0, 0xC, 0x0, 0x18, 0xAC, 0x0, 0xC, 0x0, 0x20, 0xAC, 0x0, 0xC, 0x0, 0x28, 0xAC, 0x0, 0xC, 0x0, 0x30, 0xAC, 0x0, 0xC, 0x0, 0x38, 0xAC, 0x0, 0xC, 0x0, 0x40, 0xAC, 0x0, 0xC, 0x0, 0x48, 0xAC, 0x0, 0xC, 0x0, 0x50, 0xAC, 0x0, 0xC, 0x0, 0x58, 0xAC, 0x0, 0xC, 0x0, 0x60, 0xAC, 0x0, 0xC, 0x0, 0x68, 0xAC, 0x0, 0xC, 0x0, 0x70, 0xAC, 0x0, 0xC, 0x0, 0x78, 0xAC, 0x0, 0xC, 0x0, 0x80, 0xAC, 0x0, 0xC, 0x0, 0x88, 0xAC, 0x0, 0xC, 0x0, 0x90, 0xAC, 0x0, 0xC, 0x0, 0x98, 0xAC, 0x0, 0xC, 0x0, 0xA0, 0xAC, 0x0, 0xC, 0x0, 0xA8, 0xAC, 0x0, 0xC, 0x0, 0xB0, 0xAC, 0x0, 0xC, 0x0, 0xB8, 0xAC, 0x0, 0xC, 0x0, 0xC0, 0xAC, 0x0, 0xC, 0x0, 0xC8, 0xAC, 0x0, 0xC, 0x0, 0xD0, 0xAC, 0x0, 0xC, 0x0, 0xD8, 0xAC, 0x0, 0xC, 0x0, 0xE0, 0xAC, 0x0, 0xC, 0x0, 0xE8, 0xAC, 0x0, 0xCC, 0xB3, 0x2, 0x0, 0x0, 0xC, 0x0, 0xF8, 0xAC, 0x0, 0xC, 0x0, 0x0, 0xAD, 0x0, 0xC, 0x0, 0x8, 0xAD, 0x0, 0xC, 0x0, 0x10, 0xAD, 0x0, 0xC, 0x0, 0x18, 0xAD, 0x0, 0xC, 0x0, 0x20, 0xAD, 0x0, 0xC, 0x0, 0x28, 0xAD, 0x0, 0xC, 0x0, 0x30, 0xAD, 0x0, 0xC, 0x0, 0x38, 0xAD, 0x0, 0xC, 0x0, 0x40, 0xAD, 0x0, 0xC, 0x0, 0x48, 0xAD, 0x0, 0xC, 0x0, 0x50, 0xAD, 0x0, 0xC, 0x0, 0x58, 0xAD, 0x0, 0xC, 0x0, 0x60, 0xAD, 0x0, 0xC, 0x0, 0x68, 0xAD, 0x0, 0xC, 0x0, 0x70, 0xAD, 0x0, 0xC, 0x0, 0x78, 0xAD, 0x0, 0xC, 0x0, 0x80, 0xAD, 0x0, 0xC, 0x0, 0x88, 0xAD, 0x0, 0xC, 0x0, 0x90, 0xAD, 0x0, 0xC, 0x0, 0x98, 0xAD, 0x0, 0xC, 0x0, 0xA0, 0xAD, 0x0, 0xC, 0x0, 0xA8, 0xAD, 0x0, 0xC, 0x0, 0xB0, 0xAD, 0x0, 0xC, 0x0, 0xB8, 0xAD, 0x0, 0xC, 0x0, 0xC0, 0xAD, 0x0, 0xC, 0x0, 0xC8, 0xAD, 0x0, 0xC, 0x0, 0xD0, 0xAD, 0x0, 0xC, 0x0, 0xD8, 0xAD, 0x0, 0xC, 0x0, 0xE0, 0xAD, 0x0, 0xC, 0x0, 0xE8, 0xAD, 0x0, 0xC, 0x0, 0xF0, 0xAD, 0x0, 0xC, 0x0, 0xF8, 0xAD, 0x0, 0xC, 0x0, 0x0, 0xAE, 0x0, 0xC, 0x0, 0x8, 0xAE, 0x0, 0xC, 0x0, 0x10, 0xAE, 0x0, 0xC, 0x0, 0x18, 0xAE, 0x0, 0xC, 0x0, 0x20, 0xAE, 0x0, 0xC, 0x0, 0x28, 0xAE, 0x0, 0xC, 0x0, 0x30, 0xAE, 0x0, 0xC, 0x0, 0x38, 0xAE, 0x0, 0xC, 0x0, 0x40, 0xAE, 0x0, 0xC, 0x0, 0x48, 0xAE, 0x0, 0xC, 0x0, 0x50, 0xAE, 0x0, 0xC, 0x0, 0x58, 0xAE, 0x0, 0xC, 0x0, 0x60, 0xAE, 0x0, 0xC, 0x0, 0x68, 0xAE, 0x0, 0xC, 0x0, 0x70, 0xAE, 0x0, 0xC, 0x0, 0x78, 0xAE, 0x0, 0xC, 0x0, 0x80, 0xAE, 0x0, 0xC, 0x0, 0x88, 0xAE, 0x0, 0xC, 0x0, 0x90, 0xAE, 0x0, 0xC, 0x0, 0x98, 0xAE, 0x0, 0xC, 0x0, 0xA0, 0xAE, 0x0, 0xC, 0x0, 0xA8, 0xAE, 0x0, 0xC, 0x0, 0xB0, 0xAE, 0x0, 0xC, 0x0, 0xB8, 0xAE, 0x0, 0xC, 0x0, 0xC0, 0xAE, 0x0, 0xC, 0x0, 0xC8, 0xAE, 0x0, 0xC, 0x0, 0xD0, 0xAE, 0x0, 0xC, 0x0, 0xD8, 0xAE, 0x0, 0xC, 0x0, 0xE0, 0xAE, 0x0, 0xC, 0x0, 0xE8, 0xAE, 0x0, 0xC, 0x0, 0xF0, 0xAE, 0x0, 0xC, 0x0, 0xF8, 0xAE, 0x0, 0xC, 0x0, 0x0, 0xAF, 0x0, 0xC, 0x0, 0x8, 0xAF, 0x0, 0xC, 0x0, 0x10, 0xAF, 0x0, 0xC, 0x0, 0x18, 0xAF, 0x0, 0xC, 0x0, 0x20, 0xAF, 0x0, 0xC, 0x0, 0x28, 0xAF, 0x0, 0xC, 0x0, 0x30, 0xAF, 0x0, 0xC, 0x0, 0x38, 0xAF, 0x0, 0xC, 0x0, 0x40, 0xAF, 0x0, 0xC, 0x0, 0x48, 0xAF, 0x0, 0xC, 0x0, 0x50, 0xAF, 0x0, 0xC, 0x0, 0x58, 0xAF, 0x0, 0xC, 0x0, 0x60, 0xAF, 0x0, 0xC, 0x0, 0x68, 0xAF, 0x0, 0xC, 0x0, 0x70, 0xAF, 0x0, 0xC, 0x0, 0x78, 0xAF, 0x0, 0xC, 0x0, 0x80, 0xAF, 0x0, 0xC, 0x0, 0x88, 0xAF, 0x0, 0xC, 0x0, 0x90, 0xAF, 0x0, 0xC, 0x0, 0x98, 0xAF, 0x0, 0xC, 0x0, 0xA0, 0xAF, 0x0, 0xC, 0x0, 0xA8, 0xAF, 0x0, 0xC, 0x0, 0xB0, 0xAF, 0x0, 0xC, 0x0, 0xB8, 0xAF, 0x0, 0xC, 0x0, 0xC0, 0xAF, 0x0, 0xC, 0x0, 0xC8, 0xAF, 0x0, 0xC, 0x0, 0xD0, 0xAF, 0x0, 0xC, 0x0, 0xD8, 0xAF, 0x0, 0xC, 0x0, 0xE0, 0xAF, 0x0, 0xC, 0x0, 0xE8, 0xAF, 0x0, 0xC, 0x0, 0xF0, 0xAF, 0x0, 0xC, 0x0, 0xF8, 0xAF, 0x0, 0xC, 0x0, 0x0, 0xB0, 0x0, 0xC, 0x0, 0x8, 0xB0, 0x0, 0xC, 0x0, 0x10, 0xB0, 0x0, 0x6C, 0xC0, 0x2, 0x0, 0x0, 0x8C, 0xC0, 0x2, 0x0, 0x0, 0xAC, 0xC0, 0x2, 0x0, 0x0, 0xCC, 0xC0, 0x2, 0x0, 0x0, 0xEC, 0xC0, 0x2, 0x0, 0x0, 0xC, 0xC1, 0x2, 0x0, 0x0, 0x2C, 0xC1, 0x2, 0x0, 0x0, 0x4C, 0xC1, 0x2, 0x0, 0x0, 0x6C, 0xC1, 0x2, 0x0, 0x0, 0x8C, 0xC1, 0x2, 0x0, 0x0, 0xAC, 0xC1, 0x2, 0x0, 0x0, 0xCC, 0xC1, 0x2, 0x0, 0x0, 0xEC, 0xC1, 0x2, 0x0, 0x0, 0xC, 0xC2, 0x2, 0x0, 0x0, 0x2C, 0xC2, 0x2, 0x0, 0x0, 0x4C, 0xC2, 0x2, 0x0, 0x0, 0x6C, 0xC2, 0x2, 0x0, 0x0, 0x8C, 0xC2, 0x2, 0x0, 0x0, 0xAC, 0xC2, 0x2, 0x0, 0x0, 0xCC, 0xC2, 0x2, 0x0, 0x0, 0xEC, 0xC2, 0x2, 0x0, 0x0, 0xC, 0xC3, 0x2, 0x0, 0x0, 0x2C, 0xC3, 0x2, 0x0, 0x0, 0x4C, 0xC3, 0x2, 0x0, 0x0, 0x6C, 0xC3, 0x2, 0x0, 0x0, 0x8C, 0xC3, 0x2, 0x0, 0x0, 0xAC, 0xC3, 0x2, 0x0, 0x0, 0xCC, 0xC3, 0x2, 0x0, 0x0, 0xEC, 0xC3, 0x2, 0x0, 0x0, 0xC, 0xC4, 0x2, 0x0, 0x0, 0x2C, 0xC4, 0x2, 0x0, 0x0, 0x4C, 0xC4, 0x2, 0x0, 0x0, 0x6C, 0xC4, 0x2, 0x0, 0x0, 0x8C, 0xC4, 0x2, 0x0, 0x0, 0xAC, 0xC4, 0x2, 0x0, 0x0, 0xCC, 0xC4, 0x2, 0x0, 0x0, 0xEC, 0xC4, 0x2, 0x0, 0x0, 0xC, 0xC5, 0x2, 0x0, 0x0, 0x2C, 0xC5, 0x2, 0x0, 0x0, 0x4C, 0xC5, 0x2, 0x0, 0x0, 0x6C, 0xC5, 0x2, 0x0, 0x0, 0x8C, 0xC5, 0x2, 0x0, 0x0, 0xAC, 0xC5, 0x2, 0x0, 0x0, 0xCC, 0xC5, 0x2, 0x0, 0x0, 0xEC, 0xC5, 0x2, 0x0, 0x0, 0xC, 0xC6, 0x2, 0x0, 0x0, 0x2C, 0xC6, 0x2, 0x0, 0x0, 0x4C, 0xC6, 0x2, 0x0, 0x0, 0x6C, 0xC6, 0x2, 0x0, 0x0, 0x8C, 0xC6, 0x2, 0x0, 0x0, 0xAC, 0xC6, 0x2, 0x0, 0x0, 0xCC, 0xC6, 0x2, 0x0, 0x0, 0xEC, 0xC6, 0x2, 0x0, 0x0, 0xC, 0xC7, 0x2, 0x0, 0x0, 0x2C, 0xC7, 0x2, 0x0, 0x0, 0x4C, 0xC7, 0x2, 0x0, 0x0, 0x6C, 0xC7, 0x2, 0x0, 0x0, 0x8C, 0xC7, 0x2, 0x0, 0x0, 0xAC, 0xC7, 0x2, 0x0, 0x0, 0xCC, 0xC7, 0x2, 0x0, 0x0, 0xEC, 0xC7, 0x2, 0x0, 0x0, 0xC, 0xC8, 0x2, 0x0, 0x0, 0x2C, 0xC8, 0x2, 0x0, 0x0, 0x4C, 0xC8, 0x2, 0x0, 0x0, 0x6C, 0xC8, 0x2, 0x0, 0x0, 0x8C, 0xC8, 0x2, 0x0, 0x0, 0xAC, 0xC8, 0x2, 0x0, 0x0, 0xCC, 0xC8, 0x2, 0x0, 0x0, 0xEC, 0xC8, 0x2, 0x0, 0x0, 0xC, 0xC9, 0x2, 0x0, 0x0, 0x2C, 0xC9, 0x2, 0x0, 0x0, 0x4C, 0xC9, 0x2, 0x0, 0x0, 0x6C, 0xC9, 0x2, 0x0, 0x0, 0x8C, 0xC9, 0x2, 0x0, 0x0, 0xAC, 0xC9, 0x2, 0x0, 0x0, 0xCC, 0xC9, 0x2, 0x0, 0x0, 0xEC, 0xC9, 0x2, 0x0, 0x0, 0xC, 0xCA, 0x2, 0x0, 0x0, 0x2C, 0xCA, 0x2, 0x0, 0x0, 0x4C, 0xCA, 0x2, 0x0, 0x0, 0x6C, 0xCA, 0x2, 0x0, 0x0, 0x8C, 0xCA, 0x2, 0x0, 0x0, 0xAC, 0xCA, 0x2, 0x0, 0x0, 0xCC, 0xCA, 0x2, 0x0, 0x0, 0xEC, 0xCA, 0x2, 0x0, 0x0, 0xC, 0xCB, 0x2, 0x0, 0x0, 0x2C, 0xCB, 0x2, 0x0, 0x0, 0x4C, 0xCB, 0x2, 0x0, 0x0, 0x6C, 0xCB, 0x2, 0x0, 0x0, 0x8C, 0xCB, 0x2, 0x0, 0x0, 0xAC, 0xCB, 0x2, 0x0, 0x0, 0xCC, 0xCB, 0x2, 0x0, 0x0, 0xEC, 0xCB, 0x2, 0x0, 0x0, 0xC, 0xCC, 0x2, 0x0, 0x0, 0x2C, 0xCC, 0x2, 0x0, 0x0, 0x4C, 0xCC, 0x2, 0x0, 0x0, 0x6C, 0xCC, 0x2, 0x0, 0x0, 0x8C, 0xCC, 0x2, 0x0, 0x0, 0xAC, 0xCC, 0x2, 0x0, 0x0, 0xCC, 0xCC, 0x2, 0x0, 0x0, 0xEC, 0xCC, 0x2, 0x0, 0x0, 0xC, 0xCD, 0x2, 0x0, 0x0, 0x2C, 0xCD, 0x2, 0x0, 0x0, 0x4C, 0xCD, 0x2, 0x0, 0x0, 0x6C, 0xCD, 0x2, 0x0, 0x0, 0x8C, 0xCD, 0x2, 0x0, 0x0, 0xAC, 0xCD, 0x2, 0x0, 0x0, 0xCC, 0xCD, 0x2, 0x0, 0x0, 0xEC, 0xCD, 0x2, 0x0, 0x0, 0xC, 0xCE, 0x2, 0x0, 0x0, 0x2C, 0xCE, 0x2, 0x0, 0x0, 0x4C, 0xCE, 0x2, 0x0, 0x0, 0x6C, 0xCE, 0x2, 0x0, 0x0, 0x8C, 0xCE, 0x2, 0x0, 0x0, 0xAC, 0xCE, 0x2, 0x0, 0x0, 0xCC, 0xCE, 0x2, 0x0, 0x0, 0xEC, 0xCE, 0x2, 0x0, 0x0, 0xC, 0xCF, 0x2, 0x0, 0x0, 0x2C, 0xCF, 0x2, 0x0, 0x0, 0x4C, 0xCF, 0x2, 0x0, 0x0, 0x6C, 0xCF, 0x2, 0x0, 0x0, 0x8C, 0xCF, 0x2, 0x0, 0x0, 0xAC, 0xCF, 0x2, 0x0, 0x0, 0xCC, 0xCF, 0x2, 0x0, 0x0, 0xEC, 0xCF, 0x2, 0x0, 0x0, 0xC, 0xD0, 0x2, 0x0, 0x0, 0x2C, 0xD0, 0x2, 0x0, 0x0, 0x4C, 0xD0, 0x2, 0x0, 0x0, 0x6C, 0xD0, 0x2, 0x0, 0x0, 0x8C, 0xD0, 0x2, 0x0, 0x0, 0xAC, 0xD0, 0x2, 0x0, 0x0, 0xCC, 0xD0, 0x2, 0x0, 0x0, 0xEC, 0xD0, 0x2, 0x0, 0x0, 0xC, 0xD1, 0x2, 0x0, 0x0, 0x2C, 0xD1, 0x2, 0x0, 0x0, 0x4C, 0xD1, 0x2, 0x0, 0x0, 0x6C, 0xD1, 0x2, 0x0, 0x0, 0x8C, 0xD1, 0x2, 0x0, 0x0, 0xAC, 0xD1, 0x2, 0x0, 0x0, 0xCC, 0xD1, 0x2, 0x0, 0x0, 0xEC, 0xD1, 0x2, 0x0, 0x0, 0xC, 0xD2, 0x2, 0x0, 0x0, 0x2C, 0xD2, 0x2, 0x0, 0x0, 0x4C, 0xD2, 0x2, 0x0, 0x0, 0x6C, 0xD2, 0xA2, 0xB4, 0x0, 0xAC, 0xD2, 0x2, 0x0, 0x0, 0xCC, 0xD2, 0x2, 0x0, 0x0, 0xEC, 0xD2, 0x2, 0x0, 0x0, 0xC, 0xD3, 0x2, 0x0, 0x0, 0x2C, 0xD3, 0x2, 0x0, 0x0, 0x4C, 0xD3, 0x2, 0x0, 0x0, 0x6C, 0xD3, 0x2, 0x0, 0x0, 0x8C, 0xD3, 0x2, 0x0, 0x0, 0xAC, 0xD3, 0x2, 0x0, 0x0, 0xCC, 0xD3, 0x2, 0x0, 0x0, 0xEC, 0xD3, 0x2, 0x0, 0x0, 0xC, 0xD4, 0x2, 0x0, 0x0, 0x2C, 0xD4, 0x2, 0x0, 0x0, 0x4C, 0xD4, 0x2, 0x0, 0x0, 0x6C, 0xD4, 0x2, 0x0, 0x0, 0x8C, 0xD4, 0x2, 0x0, 0x0, 0xAC, 0xD4, 0x2, 0x0, 0x0, 0xCC, 0xD4, 0x2, 0x0, 0x0, 0xEC, 0xD4, 0x2, 0x0, 0x0, 0xC, 0xD5, 0x2, 0x0, 0x0, 0x2C, 0xD5, 0x2, 0x0, 0x0, 0x4C, 0xD5, 0x2, 0x0, 0x0, 0x6C, 0xD5, 0x2, 0x0, 0x0, 0x8C, 0xD5, 0x2, 0x0, 0x0, 0xAC, 0xD5, 0x2, 0x0, 0x0, 0xCC, 0xD5, 0x2, 0x0, 0x0, 0xEC, 0xD5, 0x2, 0x0, 0x0, 0xC, 0xD6, 0x2, 0x0, 0x0, 0x2C, 0xD6, 0x2, 0x0, 0x0, 0x4C, 0xD6, 0x2, 0x0, 0x0, 0x6C, 0xD6, 0x2, 0x0, 0x0, 0x8C, 0xD6, 0x2, 0x0, 0x0, 0xAC, 0xD6, 0x2, 0x0, 0x0, 0xCC, 0xD6, 0x2, 0x0, 0x0, 0xEC, 0xD6, 0x2, 0x0, 0x0, 0xC, 0xD7, 0x2, 0x0, 0x0, 0x2C, 0xD7, 0x2, 0x0, 0x0, 0x4C, 0xD7, 0x2, 0x0, 0x0, 0x6C, 0xD7, 0x2, 0x0, 0x0, 0x8C, 0xD7, 0x2, 0x0, 0x0, 0xAC, 0xD7, 0x2, 0x0, 0x0, 0xCC, 0xD7, 0x2, 0x0, 0x0, 0xEC, 0xD7, 0x2, 0x0, 0x0, 0xC, 0xD8, 0x2, 0x0, 0x0, 0x2C, 0xD8, 0x2, 0x0, 0x0, 0x4C, 0xD8, 0x2, 0x0, 0x0, 0x6C, 0xD8, 0x2, 0x0, 0x0, 0x8C, 0xD8, 0x2, 0x0, 0x0, 0xAC, 0xD8, 0x2, 0x0, 0x0, 0xCC, 0xD8, 0x2, 0x0, 0x0, 0xEC, 0xD8, 0x2, 0x0, 0x0, 0xC, 0xD9, 0x2, 0x0, 0x0, 0x2C, 0xD9, 0x2, 0x0, 0x0, 0x4C, 0xD9, 0x2, 0x0, 0x0, 0x6C, 0xD9, 0x2, 0x0, 0x0, 0x8C, 0xD9, 0x2, 0x0, 0x0, 0xAC, 0xD9, 0x2, 0x0, 0x0, 0xCC, 0xD9, 0x2, 0x0, 0x0, 0xEC, 0xD9, 0x2, 0x0, 0x0, 0xC, 0xDA, 0x2, 0x0, 0x0, 0x2C, 0xDA, 0x2, 0x0, 0x0, 0x4C, 0xDA, 0x2, 0x0, 0x0, 0x6C, 0xDA, 0x2, 0x0, 0x0, 0x8C, 0xDA, 0x2, 0x0, 0x0, 0xAC, 0xDA, 0x2, 0x0, 0x0, 0xCC, 0xDA, 0x2, 0x0, 0x0, 0xEC, 0xDA, 0x2, 0x0, 0x0, 0xC, 0xDB, 0x2, 0x0, 0x0, 0x2C, 0xDB, 0x2, 0x0, 0x0, 0x4C, 0xDB, 0x2, 0x0, 0x0, 0x6C, 0xDB, 0x2, 0x0, 0x0, 0x8C, 0xDB, 0x2, 0x0, 0x0, 0xAC, 0xDB, 0x2, 0x0, 0x0, 0xCC, 0xDB, 0x2, 0x0, 0x0, 0xEC, 0xDB, 0x2, 0x0, 0x0, 0xC, 0xDC, 0x2, 0x0, 0x0, 0x2C, 0xDC, 0x2, 0x0, 0x0, 0x4C, 0xDC, 0x2, 0x0, 0x0, 0x6C, 0xDC, 0x2, 0x0, 0x0, 0x8C, 0xDC, 0x2, 0x0, 0x0, 0xAC, 0xDC, 0x2, 0x0, 0x0, 0xCC, 0xDC, 0x2, 0x0, 0x0, 0xEC, 0xDC, 0x2, 0x0, 0x0, 0xC, 0xDD, 0x2, 0x0, 0x0, 0x2C, 0xDD, 0x2, 0x0, 0x0, 0x4C, 0xDD, 0x2, 0x0, 0x0, 0x6C, 0xDD, 0x2, 0x0, 0x0, 0x8C, 0xDD, 0x2, 0x0, 0x0, 0xAC, 0xDD, 0x2, 0x0, 0x0, 0xCC, 0xDD, 0x2, 0x0, 0x0, 0xEC, 0xDD, 0x2, 0x0, 0x0, 0xC, 0xDE, 0x2, 0x0, 0x0, 0x2C, 0xDE, 0x2, 0x0, 0x0, 0x4C, 0xDE, 0x2, 0x0, 0x0, 0x6C, 0xDE, 0x2, 0x0, 0x0, 0x8C, 0xDE, 0x2, 0x0, 0x0, 0xAC, 0xDE, 0x2, 0x0, 0x0, 0xCC, 0xDE, 0x2, 0x0, 0x0, 0xEC, 0xDE, 0x2, 0x0, 0x0, 0xC, 0xDF, 0x2, 0x0, 0x0, 0x2C, 0xDF, 0x2, 0x0, 0x0, 0x4C, 0xDF, 0x2, 0x0, 0x0, 0x6C, 0xDF, 0x2, 0x0, 0x0, 0x8C, 0xDF, 0x2, 0x0, 0x0, 0xAC, 0xDF, 0x2, 0x0, 0x0, 0xCC, 0xDF, 0x2, 0x0, 0x0, 0xEC, 0xDF, 0x2, 0x0, 0x0, 0xC, 0xE0, 0x2, 0x0, 0x0, 0x2C, 0xE0, 0x2, 0x0, 0x0, 0x4C, 0xE0, 0x2, 0x0, 0x0, 0x6C, 0xE0, 0x2, 0x0, 0x0, 0x8C, 0xE0, 0x2, 0x0, 0x0, 0xAC, 0xE0, 0x2, 0x0, 0x0, 0xCC, 0xE0, 0x2, 0x0, 0x0, 0xEC, 0xE0, 0x2, 0x0, 0x0, 0xC, 0xE1, 0x2, 0x0, 0x0, 0x2C, 0xE1, 0x2, 0x0, 0x0, 0x4C, 0xE1, 0x2, 0x0, 0x0, 0x6C, 0xE1, 0x2, 0x0, 0x0, 0x8C, 0xE1, 0x2, 0x0, 0x0, 0xAC, 0xE1, 0x2, 0x0, 0x0, 0xCC, 0xE1, 0x2, 0x0, 0x0, 0xEC, 0xE1, 0x2, 0x0, 0x0, 0xC, 0xE2, 0x2, 0x0, 0x0, 0x2C, 0xE2, 0x2, 0x0, 0x0, 0x4C, 0xE2, 0x2, 0x0, 0x0, 0x6C, 0xE2, 0x2, 0x0, 0x0, 0xC, 0x0, 0xA0, 0xB8, 0x0, 0xC, 0x0, 0xA8, 0xB8, 0x0, 0xC, 0x0, 0xB0, 0xB8, 0x0, 0xC, 0x0, 0xB8, 0xB8, 0x0, 0xC, 0x0, 0xC0, 0xB8, 0x0, 0xC, 0x0, 0xC8, 0xB8, 0x0, 0xC, 0x0, 0xD0, 0xB8, 0x0, 0xC, 0x0, 0xD8, 0xB8, 0x0, 0xC, 0x0, 0xE0, 0xB8, 0x0, 0xC, 0x0, 0xE8, 0xB8, 0x0, 0xC, 0x0, 0xF0, 0xB8, 0x0, 0xC, 0x0, 0xF8, 0xB8, 0x0, 0xC, 0x0, 0x0, 0xB9, 0x0, 0xC, 0x0, 0x8, 0xB9, 0x0, 0xC, 0x0, 0x10, 0xB9, 0x0, 0xC, 0x0, 0x18, 0xB9, 0x0, 0xC, 0x0, 0x20, 0xB9, 0x0, 0xC, 0x0, 0x28, 0xB9, 0x0, 0xC, 0x0, 0x30, 0xB9, 0x0, 0xC, 0x0, 0x38, 0xB9, 0x0, 0xC, 0x0, 0x40, 0xB9, 0x0, 0xC, 0x0, 0x48, 0xB9, 0x0, 0xC, 0x0, 0x50, 0xB9, 0x0, 0xC, 0x0, 0x58, 0xB9, 0x0, 0xC, 0x0, 0x60, 0xB9, 0x0, 0xC, 0x0, 0x68, 0xB9, 0x0, 0xC, 0x0, 0x70, 0xB9, 0x0, 0xC, 0x0, 0x78, 0xB9, 0x0, 0xC, 0x0, 0x80, 0xB9, 0x0, 0xC, 0x0, 0x88, 0xB9, 0x0, 0xC, 0x0, 0x90, 0xB9, 0x0, 0xC, 0x0, 0x98, 0xB9, 0x0, 0xC, 0x0, 0xA0, 0xB9, 0x0, 0xC, 0x0, 0xA8, 0xB9, 0x0, 0xC, 0x0, 0xB0, 0xB9, 0x0, 0xC, 0x0, 0xB8, 0xB9, 0x0, 0xC, 0x0, 0xC0, 0xB9, 0x0, 0xC, 0x0, 0xC8, 0xB9, 0x0, 0xC, 0x0, 0xD0, 0xB9, 0x0, 0xC, 0x0, 0xD8, 0xB9, 0x0, 0xC, 0x0, 0xE0, 0xB9, 0x0, 0xC, 0x0, 0xE8, 0xB9, 0x0, 0xC, 0x0, 0xF0, 0xB9, 0x0, 0xC, 0x0, 0xF8, 0xB9, 0x0, 0xC, 0x0, 0x0, 0xBA, 0x0, 0xC, 0x0, 0x8, 0xBA, 0x0, 0xC, 0x0, 0x10, 0xBA, 0x0, 0xC, 0x0, 0x18, 0xBA, 0x0, 0xC, 0x0, 0x20, 0xBA, 0x0, 0xC, 0x0, 0x28, 0xBA, 0x0, 0xC, 0x0, 0x30, 0xBA, 0x0, 0xC, 0x0, 0x38, 0xBA, 0x0, 0xC, 0x0, 0x40, 0xBA, 0x0, 0xC, 0x0, 0x48, 0xBA, 0x0, 0xC, 0x0, 0x50, 0xBA, 0x0, 0xC, 0x0, 0x58, 0xBA, 0x0, 0xC, 0x0, 0x60, 0xBA, 0x0, 0xC, 0x0, 0x68, 0xBA, 0x0, 0xC, 0x0, 0x70, 0xBA, 0x0, 0xC, 0x0, 0x78, 0xBA, 0x0, 0xC, 0x0, 0x80, 0xBA, 0x0, 0xC, 0x0, 0x88, 0xBA, 0x0, 0xC, 0x0, 0x90, 0xBA, 0x0, 0xC, 0x0, 0x98, 0xBA, 0x0, 0xC, 0x0, 0xA0, 0xBA, 0x0, 0xC, 0x0, 0xA8, 0xBA, 0x0, 0xC, 0x0, 0xB0, 0xBA, 0x0, 0xC, 0x0, 0xB8, 0xBA, 0x0, 0xC, 0x0, 0xC0, 0xBA, 0x0, 0xC, 0x0, 0xC8, 0xBA, 0x0, 0xC, 0x0, 0xD0, 0xBA, 0x0, 0xC, 0x0, 0xD8, 0xBA, 0x0, 0xC, 0x0, 0xE0, 0xBA, 0x0, 0xC, 0x0, 0xE8, 0xBA, 0x0, 0xC, 0x0, 0xF0, 0xBA, 0x0, 0xC, 0x0, 0xF8, 0xBA, 0x0, 0xC, 0x0, 0x0, 0xBB, 0x0, 0xC, 0x0, 0x8, 0xBB, 0x0, 0xC, 0x0, 0x10, 0xBB, 0x0, 0xC, 0x0, 0x18, 0xBB, 0x0, 0xC, 0x0, 0x20, 0xBB, 0x0, 0xC, 0x0, 0x28, 0xBB, 0x0, 0xC, 0x0, 0x30, 0xBB, 0x0, 0xC, 0x0, 0x38, 0xBB, 0x0, 0xC, 0x0, 0x40, 0xBB, 0x0, 0xC, 0x0, 0x48, 0xBB, 0x0, 0xC, 0x0, 0x50, 0xBB, 0x0, 0xC, 0x0, 0x58, 0xBB, 0x0, 0xC, 0x0, 0x60, 0xBB, 0x0, 0xC, 0x0, 0x68, 0xBB, 0x0, 0xC, 0x0, 0x70, 0xBB, 0x0, 0xC, 0x0, 0x78, 0xBB, 0x0, 0xC, 0x0, 0x80, 0xBB, 0x0, 0xC, 0x0, 0x88, 0xBB, 0x0, 0xC, 0x0, 0x90, 0xBB, 0x0, 0xC, 0x0, 0x98, 0xBB, 0x0, 0xC, 0x0, 0xA0, 0xBB, 0x0, 0xC, 0x0, 0xA8, 0xBB, 0x0, 0xC, 0x0, 0xB0, 0xBB, 0x0, 0xC, 0x0, 0xB8, 0xBB, 0x0, 0xC, 0x0, 0xC0, 0xBB, 0x0, 0xC, 0x0, 0xC8, 0xBB, 0x0, 0xC, 0x0, 0xD0, 0xBB, 0x0, 0xC, 0x0, 0xD8, 0xBB, 0x0, 0xC, 0x0, 0xE0, 0xBB, 0x0, 0xC, 0x0, 0xE8, 0xBB, 0x0, 0xC, 0x0, 0xF0, 0xBB, 0x0, 0xC, 0x0, 0xF8, 0xBB, 0x0, 0xC, 0x0, 0x0, 0xBC, 0x0, 0xC, 0x0, 0x8, 0xBC, 0x0, 0xC, 0x0, 0x10, 0xBC, 0x0, 0xC, 0x0, 0x18, 0xBC, 0x0, 0xC, 0x0, 0x20, 0xBC, 0x0, 0xC, 0x0, 0x28, 0xBC, 0x0, 0xC, 0x0, 0x30, 0xBC, 0x0, 0xC, 0x0, 0x38, 0xBC, 0x0, 0xC, 0x0, 0x40, 0xBC, 0x0, 0xC, 0x0, 0x48, 0xBC, 0x0, 0xC, 0x0, 0x50, 0xBC, 0x0, 0xC, 0x0, 0x58, 0xBC, 0x0, 0xC, 0x0, 0x60, 0xBC, 0x0, 0xC, 0x0, 0x68, 0xBC, 0x0, 0xC, 0x0, 0x70, 0xBC, 0x0, 0xC, 0x0, 0x78, 0xBC, 0x0, 0xC, 0x0, 0x80, 0xBC, 0x0, 0xC, 0x0, 0x88, 0xBC, 0x0, 0xC, 0x0, 0x90, 0xBC, 0x0, 0xC, 0x0, 0x98, 0xBC, 0x0, 0xC, 0x0, 0xA0, 0xBC, 0x0, 0xC, 0x0, 0xA8, 0xBC, 0x0, 0xC, 0x0, 0xB0, 0xBC, 0x0, 0xC, 0x0, 0xB8, 0xBC, 0x0, 0xC, 0x0, 0xC0, 0xBC, 0x0, 0xC, 0x0, 0xC8, 0xBC, 0x0, 0xC, 0x0, 0xD0, 0xBC, 0x0, 0xC, 0x0, 0xD8, 0xBC, 0x0, 0xC, 0x0, 0xE0, 0xBC, 0x0, 0xC, 0x0, 0xE8, 0xBC, 0x0, 0xC, 0x0, 0xF0, 0xBC, 0x0, 0xC, 0x0, 0xF8, 0xBC, 0x0, 0xC, 0x0, 0x0, 0xBD, 0x0, 0xC, 0x0, 0x8, 0xBD, 0x0, 0xC, 0x0, 0x10, 0xBD, 0x0, 0xC, 0x0, 0x18, 0xBD, 0x0, 0xC, 0x0, 0x20, 0xBD, 0x0, 0xC, 0x0, 0x28, 0xBD, 0x0, 0xC, 0x0, 0x30, 0xBD, 0x0, 0xC, 0x0, 0x38, 0xBD, 0x0, 0xC, 0x0, 0x40, 0xBD, 0x0, 0xC, 0x0, 0x48, 0xBD, 0x0, 0xC, 0x0, 0x50, 0xBD, 0x0, 0xC, 0x0, 0x58, 0xBD, 0x0, 0xC, 0x0, 0x60, 0xBD, 0x0, 0xC, 0x0, 0x68, 0xBD, 0x0, 0xC, 0x0, 0x70, 0xBD, 0x0, 0xC, 0x0, 0x78, 0xBD, 0x0, 0xC, 0x0, 0x80, 0xBD, 0x0, 0xC, 0x0, 0x88, 0xBD, 0x0, 0xC, 0x0, 0x90, 0xBD, 0x0, 0xC, 0x0, 0x98, 0xBD, 0x0, 0xC, 0x0, 0xA0, 0xBD, 0x0, 0xC, 0x0, 0xA8, 0xBD, 0x0, 0xC, 0x0, 0xB0, 0xBD, 0x0, 0xC, 0x0, 0xB8, 0xBD, 0x0, 0xC, 0x0, 0xC0, 0xBD, 0x0, 0xC, 0x0, 0xC8, 0xBD, 0x0, 0xC, 0x0, 0xD0, 0xBD, 0x0, 0xC, 0x0, 0xD8, 0xBD, 0x0, 0xC, 0x0, 0xE0, 0xBD, 0x0, 0xC, 0x0, 0xE8, 0xBD, 0x0, 0xC, 0x0, 0xF0, 0xBD, 0x0, 0xC, 0x0, 0xF8, 0xBD, 0x0, 0xC, 0x0, 0x0, 0xBE, 0x0, 0xC, 0x0, 0x8, 0xBE, 0x0, 0xC, 0x0, 0x10, 0xBE, 0x0, 0xC, 0x0, 0x18, 0xBE, 0x0, 0xC, 0x0, 0x20, 0xBE, 0x0, 0xC, 0x0, 0x28, 0xBE, 0x0, 0xC, 0x0, 0x30, 0xBE, 0x0, 0xC, 0x0, 0x38, 0xBE, 0x0, 0xC, 0x0, 0x40, 0xBE, 0x0, 0xC, 0x0, 0x48, 0xBE, 0x0, 0xC, 0x0, 0x50, 0xBE, 0x0, 0xC, 0x0, 0x58, 0xBE, 0x0, 0xC, 0x0, 0x60, 0xBE, 0x0, 0xC, 0x0, 0x68, 0xBE, 0x0, 0xC, 0x0, 0x70, 0xBE, 0x0, 0xC, 0x0, 0x78, 0xBE, 0x0, 0xC, 0x0, 0x80, 0xBE, 0x0, 0xC, 0x0, 0x88, 0xBE, 0x0, 0xC, 0x0, 0x90, 0xBE, 0x0, 0xC, 0x0, 0x98, 0xBE, 0x0, 0xC, 0x0, 0xA0, 0xBE, 0x0, 0xC, 0x0, 0xA8, 0xBE, 0x0, 0xC, 0x0, 0xB0, 0xBE, 0x0, 0xC, 0x0, 0xB8, 0xBE, 0x0, 0xC, 0x0, 0xC0, 0xBE, 0x0, 0xC, 0x0, 0xC8, 0xBE, 0x0, 0xC, 0x0, 0xD0, 0xBE, 0x0, 0xC, 0x0, 0xD8, 0xBE, 0x0, 0xC, 0x0, 0xE0, 0xBE, 0x0, 0xC, 0x0, 0xE8, 0xBE, 0x0, 0xC, 0x0, 0xF0, 0xBE, 0x0, 0xC, 0x0, 0xF8, 0xBE, 0x0, 0xC, 0x0, 0x0, 0xBF, 0x0, 0xC, 0x0, 0x8, 0xBF, 0x0, 0xC, 0x0, 0x10, 0xBF, 0x0, 0xC, 0x0, 0x18, 0xBF, 0x0, 0xC, 0x0, 0x20, 0xBF, 0x0, 0xC, 0x0, 0x28, 0xBF, 0x0, 0xC, 0x0, 0x30, 0xBF, 0x0, 0xC, 0x0, 0x38, 0xBF, 0x0, 0xC, 0x0, 0x40, 0xBF, 0x0, 0xC, 0x0, 0x48, 0xBF, 0x0, 0xC, 0x0, 0x50, 0xBF, 0x0, 0xC, 0x0, 0x58, 0xBF, 0x0, 0xC, 0x0, 0x60, 0xBF, 0x0, 0xC, 0x0, 0x68, 0xBF, 0x0, 0xC, 0x0, 0x70, 0xBF, 0x0, 0xC, 0x0, 0x78, 0xBF, 0x0, 0xC, 0x0, 0x80, 0xBF, 0x0, 0xC, 0x0, 0x88, 0xBF, 0x0, 0xC, 0x0, 0x90, 0xBF, 0x0, 0xC, 0x0, 0x98, 0xBF, 0x0, 0xC, 0x0, 0xA0, 0xBF, 0x0, 0xC, 0x0, 0xA8, 0xBF, 0x0, 0xC, 0x0, 0xB0, 0xBF, 0x0, 0xC, 0x0, 0xB8, 0xBF, 0x0, 0xC, 0x0, 0xC0, 0xBF, 0x0, 0xC, 0x0, 0xC8, 0xBF, 0x0, 0xC, 0x0, 0xD0, 0xBF, 0x0, 0xC, 0x0, 0xD8, 0xBF, 0x0, 0xC, 0x0, 0xE0, 0xBF, 0x0, 0xC, 0x0, 0xE8, 0xBF, 0x0, 0xC, 0x0, 0xF0, 0xBF, 0x0, 0xC, 0x0, 0xF8, 0xBF, 0x0, 0xC, 0x0, 0x0, 0xC0, 0x0, 0xC, 0x0, 0x8, 0xC0, 0x0, 0xC, 0x0, 0x10, 0xC0, 0x0, 0xC, 0x0, 0x18, 0xC0, 0x0, 0xC, 0x0, 0x20, 0xC0, 0x0, 0xC, 0x0, 0x28, 0xC0, 0x0, 0xC, 0x0, 0x30, 0xC0, 0x0, 0xC, 0x0, 0x38, 0xC0, 0x0, 0xC, 0x0, 0x40, 0xC0, 0x0, 0xC, 0x0, 0x48, 0xC0, 0x0, 0xC, 0x0, 0x50, 0xC0, 0x0, 0xC, 0x0, 0x58, 0xC0, 0x0, 0xC, 0x0, 0x60, 0xC0, 0x0, 0xC, 0x0, 0x68, 0xC0, 0x0, 0xC, 0x0, 0x70, 0xC0, 0x0, 0xC, 0x0, 0x78, 0xC0, 0x0, 0xC, 0x0, 0x80, 0xC0, 0x0, 0xC, 0x0, 0x88, 0xC0, 0x0, 0xC, 0x0, 0x90, 0xC0, 0x0, 0xC, 0x0, 0x98, 0xC0, 0x0, 0xC, 0x0, 0xA0, 0xC0, 0x0, 0xC, 0x0, 0xA8, 0xC0, 0x0, 0xC, 0x0, 0xB0, 0xC0, 0x0, 0xC, 0x0, 0xB8, 0xC0, 0x0, 0xC, 0x0, 0xC0, 0xC0, 0x0, 0xC, 0x0, 0xC8, 0xC0, 0x0, 0xC, 0x0, 0xD0, 0xC0, 0x0, 0xC, 0x0, 0xD8, 0xC0, 0x0, 0xC, 0x0, 0xE0, 0xC0, 0x0, 0xC, 0x0, 0xE8, 0xC0, 0x0, 0xC, 0x0, 0xF0, 0xC0, 0x0, 0xC, 0x0, 0xF8, 0xC0, 0x0, 0xC, 0x0, 0x0, 0xC1, 0x0, 0xC, 0x0, 0x8, 0xC1, 0x0, 0xC, 0x0, 0x10, 0xC1, 0x0, 0xC, 0x0, 0x18, 0xC1, 0x0, 0xC, 0x0, 0x20, 0xC1, 0x0, 0xC, 0x0, 0x28, 0xC1, 0x0, 0xC, 0x0, 0x30, 0xC1, 0x0, 0xC, 0x0, 0x38, 0xC1, 0x0, 0xC, 0x0, 0x40, 0xC1, 0x0, 0xC, 0x0, 0x48, 0xC1, 0x0, 0xC, 0x0, 0x50, 0xC1, 0x0, 0xC, 0x0, 0x58, 0xC1, 0x0, 0xC, 0x0, 0x60, 0xC1, 0x0, 0xC, 0x0, 0x68, 0xC1, 0x0, 0xC, 0x0, 0x70, 0xC1, 0x0, 0xC, 0x0, 0x78, 0xC1, 0x0, 0xC, 0x0, 0x80, 0xC1, 0x0, 0xC, 0x0, 0x88, 0xC1, 0x0, 0xC, 0x0, 0x90, 0xC1, 0x0, 0xC, 0x0, 0x98, 0xC1, 0x0, 0xC, 0x0, 0xA0, 0xC1, 0x0, 0xC, 0x0, 0xA8, 0xC1, 0x0, 0xC, 0x0, 0xB0, 0xC1, 0x0, 0xC, 0x0, 0xB8, 0xC1, 0x0, 0xC, 0x0, 0xC0, 0xC1, 0x0, 0xC, 0x0, 0xC8, 0xC1, 0x0, 0xC, 0x0, 0xD0, 0xC1, 0x0, 0xC, 0x0, 0xD8, 0xC1, 0x0, 0xC, 0x0, 0xE0, 0xC1, 0x0, 0xC, 0x0, 0xE8, 0xC1, 0x0, 0xC, 0x0, 0xF0, 0xC1, 0x0, 0xC, 0x0, 0xF8, 0xC1, 0x0, 0xC, 0x0, 0x0, 0xC2, 0x0, 0xC, 0x0, 0x8, 0xC2, 0x0, 0xC, 0x0, 0x10, 0xC2, 0x0, 0xC, 0x0, 0x18, 0xC2, 0x0, 0xC, 0x0, 0x20, 0xC2, 0x0, 0xC, 0x0, 0x28, 0xC2, 0x0, 0xC, 0x0, 0x30, 0xC2, 0x0, 0xC, 0x0, 0x38, 0xC2, 0x0, 0xC, 0x0, 0x40, 0xC2, 0x0, 0xC, 0x0, 0x48, 0xC2, 0x0, 0xC, 0x0, 0x50, 0xC2, 0x0, 0xC, 0x0, 0x58, 0xC2, 0x0, 0xC, 0x0, 0x60, 0xC2, 0x0, 0xC, 0x0, 0x68, 0xC2, 0x0, 0xC, 0x0, 0x70, 0xC2, 0x0, 0xC, 0x0, 0x78, 0xC2, 0x0, 0xC, 0x0, 0x80, 0xC2, 0x0, 0xC, 0x0, 0x88, 0xC2, 0x0, 0xC, 0x0, 0x90, 0xC2, 0x0, 0xC, 0x0, 0x98, 0xC2, 0x0, 0xC, 0x0, 0xA0, 0xC2, 0x0, 0xC, 0x0, 0xA8, 0xC2, 0x0, 0xC, 0x0, 0xB0, 0xC2, 0x0, 0xC, 0x0, 0xB8, 0xC2, 0x0, 0xC, 0x0, 0xC0, 0xC2, 0x0, 0xC, 0x0, 0xC8, 0xC2, 0x0, 0xC, 0x0, 0xD0, 0xC2, 0x0, 0xC, 0x0, 0xD8, 0xC2, 0x0, 0xC, 0x0, 0xE0, 0xC2, 0x0, 0xC, 0x0, 0xE8, 0xC2, 0x0, 0xC, 0x0, 0xF0, 0xC2, 0x0, 0xC, 0x0, 0xF8, 0xC2, 0x0, 0xC, 0x0, 0x0, 0xC3, 0x0, 0xC, 0x0, 0x8, 0xC3, 0x0, 0xC, 0x0, 0x10, 0xC3, 0x0, 0xC, 0x0, 0x18, 0xC3, 0x0, 0xC, 0x0, 0x20, 0xC3, 0x0, 0xC, 0x0, 0x28, 0xC3, 0x0, 0xC, 0x0, 0x30, 0xC3, 0x0, 0xC, 0x0, 0x38, 0xC3, 0x0, 0xC, 0x0, 0x40, 0xC3, 0x0, 0xC, 0x0, 0x48, 0xC3, 0x0, 0xC, 0x0, 0x50, 0xC3, 0x0, 0xC, 0x0, 0x58, 0xC3, 0x0, 0xC, 0x0, 0x60, 0xC3, 0x0, 0xC, 0x0, 0x68, 0xC3, 0x0, 0xC, 0x0, 0x70, 0xC3, 0x0, 0xC, 0x0, 0x78, 0xC3, 0x0, 0xC, 0x0, 0x80, 0xC3, 0x0, 0xC, 0x0, 0x88, 0xC3, 0x0, 0xC, 0x0, 0x90, 0xC3, 0x0, 0xC, 0x0, 0x98, 0xC3, 0x0, 0xC, 0x0, 0xA0, 0xC3, 0x0, 0xC, 0x0, 0xA8, 0xC3, 0x0, 0xC, 0x0, 0xB0, 0xC3, 0x0, 0xC, 0x0, 0xB8, 0xC3, 0x0, 0xC, 0x0, 0xC0, 0xC3, 0x0, 0xC, 0x0, 0xC8, 0xC3, 0x0, 0xC, 0x0, 0xD0, 0xC3, 0x0, 0xC, 0x0, 0xD8, 0xC3, 0x0, 0xC, 0x0, 0xE0, 0xC3, 0x0, 0xC, 0x0, 0xE8, 0xC3, 0x0, 0xC, 0x0, 0xF0, 0xC3, 0x0, 0xC, 0x0, 0xF8, 0xC3, 0x0, 0xC, 0x0, 0x0, 0xC4, 0x0, 0xC, 0x0, 0x8, 0xC4, 0x0, 0xC, 0x0, 0x10, 0xC4, 0x0, 0xC, 0x0, 0x18, 0xC4, 0x0, 0xC, 0x0, 0x20, 0xC4, 0x0, 0xC, 0x0, 0x28, 0xC4, 0x0, 0xC, 0x0, 0x30, 0xC4, 0x0, 0xC, 0x0, 0x38, 0xC4, 0x0, 0xC, 0x0, 0x40, 0xC4, 0x0, 0xC, 0x0, 0x48, 0xC4, 0x0, 0xC, 0x0, 0x50, 0xC4, 0x0, 0xC, 0x0, 0x58, 0xC4, 0x0, 0xC, 0x0, 0x60, 0xC4, 0x0, 0xC, 0x0, 0x68, 0xC4, 0x0, 0xC, 0x0, 0x70, 0xC4, 0x0, 0xC, 0x0, 0x78, 0xC4, 0x0, 0xC, 0x0, 0x80, 0xC4, 0x0, 0xC, 0x0, 0x88, 0xC4, 0x0, 0xC, 0x0, 0x90, 0xC4, 0x0, 0xC, 0x0, 0x98, 0xC4, 0x0, 0xC, 0x0, 0xA0, 0xC4, 0x0, 0xC, 0x0, 0xA8, 0xC4, 0x0, 0xC, 0x0, 0xB0, 0xC4, 0x0, 0xC, 0x0, 0xB8, 0xC4, 0x0, 0xC, 0x0, 0xC0, 0xC4, 0x0, 0xC, 0x0, 0xC8, 0xC4, 0x0, 0xC, 0x0, 0xD0, 0xC4, 0x0, 0xC, 0x0, 0xD8, 0xC4, 0x0, 0xC, 0x0, 0xE0, 0xC4, 0x0, 0xC, 0x0, 0xE8, 0xC4, 0x0, 0xC, 0x0, 0xF0, 0xC4, 0x0, 0xC, 0x0, 0xF8, 0xC4, 0x0, 0xC, 0x0, 0x0, 0xC5, 0x0, 0xC, 0x0, 0x8, 0xC5, 0x0, 0xC, 0x0, 0x10, 0xC5, 0x0, 0xC, 0x0, 0x18, 0xC5, 0x0, 0xC, 0x0, 0x20, 0xC5, 0x0, 0xC, 0x0, 0x28, 0xC5, 0x0, 0xC, 0x0, 0x30, 0xC5, 0x0, 0xC, 0x0, 0x38, 0xC5, 0x0, 0xC, 0x0, 0x40, 0xC5, 0x0, 0xC, 0x0, 0x48, 0xC5, 0x0, 0xC, 0x0, 0x50, 0xC5, 0x0, 0xC, 0x0, 0x58, 0xC5, 0x0, 0xC, 0x0, 0x60, 0xC5, 0x0, 0xC, 0x0, 0x68, 0xC5, 0x0, 0xC, 0x0, 0x70, 0xC5, 0x0, 0xC, 0x0, 0x78, 0xC5, 0x0, 0xC, 0x0, 0x80, 0xC5, 0x0, 0xC, 0x0, 0x88, 0xC5, 0x0, 0xC, 0x0, 0x90, 0xC5, 0x0, 0xC, 0x0, 0x98, 0xC5, 0x0, 0xC, 0x0, 0xA0, 0xC5, 0x0, 0xC, 0x0, 0xA8, 0xC5, 0x0, 0xC, 0x0, 0xB0, 0xC5, 0x0, 0xC, 0x0, 0xB8, 0xC5, 0x0, 0xC, 0x0, 0xC0, 0xC5, 0x0, 0xC, 0x0, 0xC8, 0xC5, 0x0, 0xC, 0x0, 0xD0, 0xC5, 0x0, 0xC, 0x0, 0xD8, 0xC5, 0x0, 0xC, 0x0, 0xE0, 0xC5, 0x0, 0xC, 0x0, 0xE8, 0xC5, 0x0, 0xC, 0x0, 0xF0, 0xC5, 0x0, 0xC, 0x0, 0xF8, 0xC5, 0x0, 0xC, 0x0, 0x0, 0xC6, 0x0, 0xC, 0x0, 0x8, 0xC6, 0x0, 0xC, 0x0, 0x10, 0xC6, 0x0, 0xC, 0x0, 0x18, 0xC6, 0x0, 0xC, 0x0, 0x20, 0xC6, 0x0, 0xC, 0x0, 0x28, 0xC6, 0x0, 0xC, 0x0, 0x30, 0xC6, 0x0, 0xC, 0x0, 0x38, 0xC6, 0x0, 0xC, 0x0, 0x40, 0xC6, 0x0, 0xC, 0x0, 0x48, 0xC6, 0x0, 0xC, 0x0, 0x50, 0xC6, 0x0, 0xC, 0x0, 0x58, 0xC6, 0x0, 0xC, 0x0, 0x60, 0xC6, 0x0, 0xC, 0x0, 0x68, 0xC6, 0x0, 0xC, 0x0, 0x70, 0xC6, 0x0, 0xC, 0x0, 0x78, 0xC6, 0x0, 0xC, 0x0, 0x80, 0xC6, 0x0, 0xC, 0x0, 0x88, 0xC6, 0x0, 0xC, 0x0, 0x90, 0xC6, 0x0, 0xC, 0x0, 0x98, 0xC6, 0x0, 0xC, 0x0, 0xA0, 0xC6, 0x0, 0xC, 0x0, 0xA8, 0xC6, 0x0, 0xC, 0x0, 0xB0, 0xC6, 0x0, 0xC, 0x0, 0xB8, 0xC6, 0x0, 0xC, 0x0, 0xC0, 0xC6, 0x0, 0xC, 0x0, 0xC8, 0xC6, 0x0, 0xC, 0x0, 0xD0, 0xC6, 0x0, 0xC, 0x0, 0xD8, 0xC6, 0x0, 0xC, 0x0, 0xE0, 0xC6, 0x0, 0xC, 0x0, 0xE8, 0xC6, 0x0, 0xCD, 0x1B, 0x3, 0x0, 0x0, 0xED, 0x1B, 0x3, 0x0, 0x0, 0xD, 0x1C, 0x3, 0x0, 0x0, 0x2D, 0x1C, 0x3, 0x0, 0x0, 0x4D, 0x1C, 0x3, 0x0, 0x0, 0x6D, 0x1C, 0x3, 0x0, 0x0, 0x8D, 0x1C, 0x3, 0x0, 0x0, 0xAD, 0x1C, 0x3, 0x0, 0x0, 0xCD, 0x1C, 0x3, 0x0, 0x0, 0xED, 0x1C, 0x3, 0x0, 0x0, 0xD, 0x1D, 0x3, 0x0, 0x0, 0x2D, 0x1D, 0x3, 0x0, 0x0, 0x4D, 0x1D, 0x3, 0x0, 0x0, 0x6D, 0x1D, 0x3, 0x0, 0x0, 0x8D, 0x1D, 0x3, 0x0, 0x0, 0xAD, 0x1D, 0x3, 0x0, 0x0, 0xCD, 0x1D, 0x3, 0x0, 0x0, 0xED, 0x1D, 0x3, 0x0, 0x0, 0xD, 0x1E, 0x3, 0x0, 0x0, 0x2D, 0x1E, 0x3, 0x0, 0x0, 0x4D, 0x1E, 0x3, 0x0, 0x0, 0x6D, 0x1E, 0x3, 0x0, 0x0, 0x8D, 0x1E, 0x3, 0x0, 0x0, 0xAD, 0x1E, 0x3, 0x0, 0x0, 0xCD, 0x1E, 0x3, 0x0, 0x0, 0xED, 0x1E, 0x3, 0x0, 0x0, 0xD, 0x1F, 0x3, 0x0, 0x0, 0xD, 0x0, 0xC8, 0xC7, 0x0, 0x4D, 0x1F, 0x3, 0x0, 0x0, 0xD, 0x0, 0xD8, 0xC7, 0x0, 0x8D, 0x1F, 0x3, 0x0, 0x0, 0xD, 0x0, 0xE8, 0xC7, 0x0, 0xCD, 0x1F, 0x3, 0x0, 0x0, 0xD, 0x0, 0xF8, 0xC7, 0x0, 0xD, 0x20, 0x3, 0x0, 0x0, 0xD, 0x0, 0x8, 0xC8, 0x0, 0x4D, 0x20, 0x3, 0x0, 0x0, 0xD, 0x0, 0x18, 0xC8, 0x0, 0x8D, 0x20, 0x3, 0x0, 0x0, 0xD, 0x0, 0x28, 0xC8, 0x0, 0xCD, 0x20, 0x3, 0x0, 0x0, 0xD, 0x0, 0x38, 0xC8, 0x0, 0xD, 0x21, 0x3, 0x0, 0x0, 0xD, 0x0, 0x48, 0xC8, 0x0, 0x4D, 0x21, 0x3, 0x0, 0x0, 0xD, 0x0, 0x58, 0xC8, 0x0, 0x8D, 0x21, 0x3, 0x0, 0x0, 0xD, 0x0, 0x68, 0xC8, 0x0, 0xCD, 0x21, 0x3, 0x0, 0x0, 0xD, 0x0, 0x78, 0xC8, 0x0, 0xD, 0x22, 0x3, 0x0, 0x0, 0xD, 0x0, 0x88, 0xC8, 0x0, 0x4D, 0x22, 0x3, 0x0, 0x0, 0xD, 0x0, 0x98, 0xC8, 0x0, 0x8D, 0x22, 0x3, 0x0, 0x0, 0xD, 0x0, 0xA8, 0xC8, 0x0, 0xCD, 0x22, 0x3, 0x0, 0x0, 0xD, 0x0, 0xB8, 0xC8, 0x0, 0xD, 0x23, 0x3, 0x0, 0x0, 0xD, 0x0, 0xC8, 0xC8, 0x0, 0x4D, 0x23, 0x3, 0x0, 0x0, 0xD, 0x0, 0xD8, 0xC8, 0x0, 0x8D, 0x23, 0x3, 0x0, 0x0, 0xD, 0x0, 0xE8, 0xC8, 0x0, 0xCD, 0x23, 0x3, 0x0, 0x0, 0xD, 0x0, 0xF8, 0xC8, 0x0, 0xD, 0x24, 0x3, 0x0, 0x0, 0xD, 0x0, 0x8, 0xC9, 0x0, 0x4D, 0x24, 0x3, 0x0, 0x0, 0xD, 0x0, 0x18, 0xC9, 0x0, 0x8D, 0x24, 0x3, 0x0, 0x0, 0xD, 0x0, 0x28, 0xC9, 0x0, 0xCD, 0x24, 0x3, 0x0, 0x0, 0xD, 0x0, 0x38, 0xC9, 0x0, 0xD, 0x25, 0x3, 0x0, 0x0, 0xD, 0x0, 0x48, 0xC9, 0x0, 0x4D, 0x25, 0x3, 0x0, 0x0, 0xD, 0x0, 0x58, 0xC9, 0x0, 0x8D, 0x25, 0x3, 0x0, 0x0, 0xD, 0x0, 0x68, 0xC9, 0x0, 0xCD, 0x25, 0x3, 0x0, 0x0, 0xD, 0x0, 0x78, 0xC9, 0x0, 0xD, 0x26, 0x3, 0x0, 0x0, 0xD, 0x0, 0x88, 0xC9, 0x0, 0x4D, 0x26, 0x3, 0x0, 0x0, 0xD, 0x0, 0x98, 0xC9, 0x0, 0x8D, 0x26, 0x3, 0x0, 0x0, 0xD, 0x0, 0xA8, 0xC9, 0x0, 0xCD, 0x26, 0x3, 0x0, 0x0, 0xD, 0x0, 0xB8, 0xC9, 0x0, 0xD, 0x27, 0x3, 0x0, 0x0, 0xD, 0x0, 0xC8, 0xC9, 0x0, 0x4D, 0x27, 0x3, 0x0, 0x0, 0xD, 0x0, 0xD8, 0xC9, 0x0, 0x8D, 0x27, 0x3, 0x0, 0x0, 0xD, 0x0, 0xE8, 0xC9, 0x0, 0xCD, 0x27, 0x3, 0x0, 0x0, 0xD, 0x0, 0xF8, 0xC9, 0x0, 0xD, 0x28, 0x3, 0x0, 0x0, 0xD, 0x0, 0x8, 0xCA, 0x0, 0x4D, 0x28, 0x3, 0x0, 0x0, 0xD, 0x0, 0x18, 0xCA, 0x0, 0x8D, 0x28, 0x3, 0x0, 0x0, 0xD, 0x0, 0x28, 0xCA, 0x0, 0xCD, 0x28, 0x3, 0x0, 0x0, 0xD, 0x0, 0x38, 0xCA, 0x0, 0xD, 0x29, 0x3, 0x0, 0x0, 0xD, 0x0, 0x48, 0xCA, 0x0, 0x4D, 0x29, 0x3, 0x0, 0x0, 0xD, 0x0, 0x58, 0xCA, 0x0, 0x8D, 0x29, 0x3, 0x0, 0x0, 0xD, 0x0, 0x68, 0xCA, 0x0, 0xCD, 0x29, 0x3, 0x0, 0x0, 0xD, 0x0, 0x78, 0xCA, 0x0, 0xD, 0x2A, 0x3, 0x0, 0x0, 0xD, 0x0, 0x88, 0xCA, 0x0, 0x4D, 0x2A, 0x3, 0x0, 0x0, 0xD, 0x0, 0x98, 0xCA, 0x0, 0x8D, 0x2A, 0x3, 0x0, 0x0, 0xD, 0x0, 0xA8, 0xCA, 0x0, 0xCD, 0x2A, 0x3, 0x0, 0x0, 0xD, 0x0, 0xB8, 0xCA, 0x0, 0xD, 0x2B, 0x3, 0x0, 0x0, 0xD, 0x0, 0xC8, 0xCA, 0x0, 0x4D, 0x2B, 0x3, 0x0, 0x0, 0xD, 0x0, 0xD8, 0xCA, 0x0, 0x8D, 0x2B, 0x3, 0x0, 0x0, 0xD, 0x0, 0xE8, 0xCA, 0x0, 0xCD, 0x2B, 0x3, 0x0, 0x0, 0xD, 0x0, 0xF8, 0xCA, 0x0, 0xD, 0x2C, 0x3, 0x0, 0x0, 0xD, 0x0, 0x8, 0xCB, 0x0, 0x4D, 0x2C, 0x3, 0x0, 0x0, 0xD, 0x0, 0x18, 0xCB, 0x0, 0x8D, 0x2C, 0x3, 0x0, 0x0, 0xD, 0x0, 0x28, 0xCB, 0x0, 0xCD, 0x2C, 0x3, 0x0, 0x0, 0xD, 0x0, 0x38, 0xCB, 0x0, 0xD, 0x2D, 0x3, 0x0, 0x0, 0xD, 0x0, 0x48, 0xCB, 0x0, 0x4D, 0x2D, 0x3, 0x0, 0x0, 0xD, 0x0, 0x58, 0xCB, 0x0, 0x8D, 0x2D, 0x3, 0x0, 0x0, 0xD, 0x0, 0x68, 0xCB, 0x0, 0xCD, 0x2D, 0x3, 0x0, 0x0, 0xD, 0x0, 0x78, 0xCB, 0x0, 0xD, 0x2E, 0x3, 0x0, 0x0, 0xD, 0x0, 0x88, 0xCB, 0x0, 0x4D, 0x2E, 0x3, 0x0, 0x0, 0xD, 0x0, 0x98, 0xCB, 0x0, 0x8D, 0x2E, 0x3, 0x0, 0x0, 0xD, 0x0, 0xA8, 0xCB, 0x0, 0xCD, 0x2E, 0x3, 0x0, 0x0, 0xD, 0x0, 0xB8, 0xCB, 0x0, 0xD, 0x2F, 0x3, 0x0, 0x0, 0xD, 0x0, 0xC8, 0xCB, 0x0, 0x4D, 0x2F, 0x3, 0x0, 0x0, 0xD, 0x0, 0xD8, 0xCB, 0x0, 0x8D, 0x2F, 0x3, 0x0, 0x0, 0xD, 0x0, 0xE8, 0xCB, 0x0, 0xCD, 0x2F, 0x3, 0x0, 0x0, 0xD, 0x0, 0xF8, 0xCB, 0x0, 0xD, 0x30, 0x3, 0x0, 0x0, 0xD, 0x0, 0x8, 0xCC, 0x0, 0x4D, 0x30, 0x3, 0x0, 0x0, 0xD, 0x0, 0x18, 0xCC, 0x0, 0x8D, 0x30, 0x3, 0x0, 0x0, 0xD, 0x0, 0x28, 0xCC, 0x0, 0xCD, 0x30, 0x3, 0x0, 0x0, 0xD, 0x0, 0x38, 0xCC, 0x0, 0xD, 0x31, 0x3, 0x0, 0x0, 0xD, 0x0, 0x48, 0xCC, 0x0, 0x4D, 0x31, 0x3, 0x0, 0x0, 0xD, 0x0, 0x58, 0xCC, 0x0, 0x8D, 0x31, 0x3, 0x0, 0x0, 0xD, 0x0, 0x68, 0xCC, 0x0, 0xCD, 0x31, 0x3, 0x0, 0x0, 0xD, 0x0, 0x78, 0xCC, 0x0, 0xD, 0x32, 0x3, 0x0, 0x0, 0xD, 0x0, 0x88, 0xCC, 0x0, 0x4D, 0x32, 0x3, 0x0, 0x0, 0xD, 0x0, 0x98, 0xCC, 0x0, 0x8D, 0x32, 0x3, 0x0, 0x0, 0xD, 0x0, 0xA8, 0xCC, 0x0, 0xCD, 0x32, 0x3, 0x0, 0x0, 0xD, 0x0, 0xB8, 0xCC, 0x0, 0xD, 0x33, 0x3, 0x0, 0x0, 0x2D, 0x33, 0x3, 0x0, 0x0, 0xD, 0x0, 0xD0, 0xCC, 0x0, 0x6D, 0x33, 0x3, 0x0, 0x0, 0xD, 0x0, 0xE0, 0xCC, 0x0, 0xAD, 0x33, 0x3, 0x0, 0x0, 0xCD, 0x33, 0x3, 0x0, 0x0, 0xED, 0x33, 0x3, 0x0, 0x0, 0xD, 0x34, 0x3, 0x0, 0x0, 0x2D, 0x34, 0x3, 0x0, 0x0, 0x4D, 0x34, 0x3, 0x0, 0x0, 0x6D, 0x34, 0x3, 0x0, 0x0, 0x8D, 0x34, 0x3, 0x0, 0x0, 0xAD, 0x34, 0x3, 0x0, 0x0, 0xD, 0x0, 0x30, 0xCD, 0x0, 0xED, 0x34, 0x3, 0x0, 0x0, 0xD, 0x0, 0x40, 0xCD, 0x0, 0x2D, 0x35, 0x3, 0x0, 0x0, 0xD, 0x0, 0x50, 0xCD, 0x0, 0x6D, 0x35, 0x3, 0x0, 0x0, 0xD, 0x0, 0x60, 0xCD, 0x0, 0xAD, 0x35, 0x3, 0x0, 0x0, 0xD, 0x0, 0x70, 0xCD, 0x0, 0xED, 0x35, 0x3, 0x0, 0x0, 0xD, 0x0, 0x80, 0xCD, 0x0, 0x2D, 0x36, 0x3, 0x0, 0x0, 0xD, 0x0, 0x90, 0xCD, 0x0, 0x6D, 0x36, 0x3, 0x0, 0x0, 0xD, 0x0, 0xA0, 0xCD, 0x0, 0xAD, 0x36, 0x3, 0x0, 0x0, 0xCD, 0x36, 0x3, 0x0, 0x0, 0xED, 0x36, 0x3, 0x0, 0x0, 0xD, 0x37, 0x3, 0x0, 0x0, 0x2D, 0x37, 0x3, 0x0, 0x0, 0x4D, 0x37, 0x3, 0x0, 0x0, 0x6D, 0x37, 0x3, 0x0, 0x0, 0x8D, 0x37, 0x3, 0x0, 0x0, 0xAD, 0x37, 0x3, 0x0, 0x0, 0xCD, 0x37, 0x3, 0x0, 0x0, 0xED, 0x37, 0x3, 0x0, 0x0, 0xD, 0x38, 0x3, 0x0, 0x0, 0x2D, 0x38, 0x3, 0x0, 0x0, 0xD, 0x0, 0x10, 0xCE, 0x0, 0x6D, 0x38, 0x3, 0x0, 0x0, 0x8D, 0x38, 0x3, 0x0, 0x0, 0xAD, 0x38, 0x3, 0x0, 0x0, 0xCD, 0x38, 0x3, 0x0, 0x0, 0xED, 0x38, 0x3, 0x0, 0x0, 0xD, 0x39, 0x3, 0x0, 0x0, 0x2D, 0x39, 0x3, 0x0, 0x0, 0xD, 0x0, 0x50, 0xCE, 0x0, 0x6D, 0x39, 0x3, 0x0, 0x0, 0x8D, 0x39, 0x3, 0x0, 0x0, 0xAD, 0x39, 0x3, 0x0, 0x0, 0xCD, 0x39, 0x3, 0x0, 0x0, 0xED, 0x39, 0x3, 0x0, 0x0, 0xD, 0x3A, 0x3, 0x0, 0x0, 0x2D, 0x3A, 0x3, 0x0, 0x0, 0x4D, 0x3A, 0x3, 0x0, 0x0, 0x6D, 0x3A, 0x3, 0x0, 0x0, 0x8D, 0x3A, 0x3, 0x0, 0x0, 0xAD, 0x3A, 0x3, 0x0, 0x0, 0xCD, 0x3A, 0x3, 0x0, 0x0, 0xED, 0x3A, 0x3, 0x0, 0x0, 0xD, 0x3B, 0x3, 0x0, 0x0, 0x2D, 0x3B, 0x3, 0x0, 0x0, 0x4D, 0x3B, 0x3, 0x0, 0x0, 0x6D, 0x3B, 0x3, 0x0, 0x0, 0x8D, 0x3B, 0x3, 0x0, 0x0, 0xAD, 0x3B, 0x3, 0x0, 0x0, 0xCD, 0x3B, 0x3, 0x0, 0x0, 0xED, 0x3B, 0x3, 0x0, 0x0, 0xD, 0x3C, 0x3, 0x0, 0x0, 0x2D, 0x3C, 0x3, 0x0, 0x0, 0x4D, 0x3C, 0x3, 0x0, 0x0, 0x6D, 0x3C, 0x3, 0x0, 0x0, 0x8D, 0x3C, 0x3, 0x0, 0x0, 0xAD, 0x3C, 0x3, 0x0, 0x0, 0xCD, 0x3C, 0x3, 0x0, 0x0, 0xED, 0x3C, 0x3, 0x0, 0x0, 0xD, 0x3D, 0x3, 0x0, 0x0, 0x2D, 0x3D, 0x3, 0x0, 0x0, 0x4D, 0x3D, 0x3, 0x0, 0x0, 0x6D, 0x3D, 0x3, 0x0, 0x0, 0x8D, 0x3D, 0x3, 0x0, 0x0, 0xAD, 0x3D, 0x3, 0x0, 0x0, 0xCD, 0x3D, 0x3, 0x0, 0x0, 0xED, 0x3D, 0x3, 0x0, 0x0, 0xD, 0x3E, 0x3, 0x0, 0x0, 0x2D, 0x3E, 0x3, 0x0, 0x0, 0x4D, 0x3E, 0x3, 0x0, 0x0, 0x6D, 0x3E, 0x3, 0x0, 0x0, 0x8D, 0x3E, 0x3, 0x0, 0x0, 0xAD, 0x3E, 0x3, 0x0, 0x0, 0xCD, 0x3E, 0x3, 0x0, 0x0, 0xED, 0x3E, 0x3, 0x0, 0x0, 0xD, 0x3F, 0x3, 0x0, 0x0, 0x2D, 0x3F, 0x3, 0x0, 0x0, 0x4D, 0x3F, 0x3, 0x0, 0x0, 0x6D, 0x3F, 0x3, 0x0, 0x0, 0x8D, 0x3F, 0x3, 0x0, 0x0, 0xAD, 0x3F, 0x3, 0x0, 0x0, 0xCD, 0x3F, 0x3, 0x0, 0x0, 0xED, 0x3F, 0x3, 0x0, 0x0, 0xD, 0x40, 0x3, 0x0, 0x0, 0x2D, 0x40, 0x3, 0x0, 0x0, 0x4D, 0x40, 0x3, 0x0, 0x0, 0x6D, 0x40, 0x3, 0x0, 0x0, 0x8D, 0x40, 0x3, 0x0, 0x0, 0xAD, 0x40, 0x3, 0x0, 0x0, 0xCD, 0x40, 0x3, 0x0, 0x0, 0xED, 0x40, 0x3, 0x0, 0x0, 0xD, 0x41, 0x3, 0x0, 0x0, 0x2D, 0x41, 0x3, 0x0, 0x0, 0x4D, 0x41, 0x3, 0x0, 0x0, 0x6D, 0x41, 0x3, 0x0, 0x0, 0x8D, 0x41, 0x3, 0x0, 0x0, 0xAD, 0x41, 0x3, 0x0, 0x0, 0xCD, 0x41, 0x3, 0x0, 0x0, 0xED, 0x41, 0x3, 0x0, 0x0, 0xD, 0x42, 0x3, 0x0, 0x0, 0x2D, 0x42, 0x3, 0x0, 0x0, 0x4D, 0x42, 0x3, 0x0, 0x0, 0x6D, 0x42, 0x3, 0x0, 0x0, 0x8D, 0x42, 0x3, 0x0, 0x0, 0xAD, 0x42, 0x3, 0x0, 0x0, 0xCD, 0x42, 0x3, 0x0, 0x0, 0xED, 0x42, 0x3, 0x0, 0x0, 0xD, 0x43, 0xCB, 0xD0, 0x0, 0x4D, 0x43, 0xDB, 0xD0, 0x0, 0x8D, 0x43, 0xEB, 0xD0, 0x0, 0xCD, 0x43, 0xFB, 0xD0, 0x0, 0xD, 0x44, 0xB, 0xD1, 0x0, 0x4D, 0x44, 0x1B, 0xD1, 0x0, 0x8D, 0x44, 0x2B, 0xD1, 0x0, 0xCD, 0x44, 0x3B, 0xD1, 0x0, 0xD, 0x45, 0x4B, 0xD1, 0x0, 0x4D, 0x45, 0x5B, 0xD1, 0x0, 0x8D, 0x45, 0x6B, 0xD1, 0x0, 0xCD, 0x45, 0x7B, 0xD1, 0x0, 0xD, 0x46, 0x8B, 0xD1, 0x0, 0x4D, 0x46, 0x9B, 0xD1, 0x0, 0x8D, 0x46, 0xAB, 0xD1, 0x0, 0xCD, 0x46, 0xBB, 0xD1, 0x0, 0xD, 0x47, 0xCB, 0xD1, 0x0, 0x4D, 0x47, 0xDB, 0xD1, 0x0, 0x8D, 0x47, 0xEB, 0xD1, 0x0, 0xCD, 0x47, 0xFB, 0xD1, 0x0, 0xD, 0x48, 0xB, 0xD2, 0x0, 0x4D, 0x48, 0x1B, 0xD2, 0x0, 0x8D, 0x48, 0x2B, 0xD2, 0x0, 0xCD, 0x48, 0x3B, 0xD2, 0x0, 0xD, 0x49, 0x4B, 0xD2, 0x0, 0x4D, 0x49, 0x5B, 0xD2, 0x0, 0x8D, 0x49, 0x6B, 0xD2, 0x0, 0xCD, 0x49, 0x7B, 0xD2, 0x0, 0xD, 0x4A, 0x8B, 0xD2, 0x0, 0x4D, 0x4A, 0x9B, 0xD2, 0x0, 0x8D, 0x4A, 0xAB, 0xD2, 0x0, 0xCD, 0x4A, 0xBB, 0xD2, 0x0, 0xD, 0x4B, 0xCB, 0xD2, 0x0, 0x4D, 0x4B, 0xDB, 0xD2, 0x0, 0x8D, 0x4B, 0xEB, 0xD2, 0x0, 0xCD, 0x4B, 0xFB, 0xD2, 0x0, 0xD, 0x4C, 0xB, 0xD3, 0x0, 0x4D, 0x4C, 0x1B, 0xD3, 0x0, 0x8D, 0x4C, 0x2B, 0xD3, 0x0, 0xCD, 0x4C, 0x3B, 0xD3, 0x0, 0xD, 0x4D, 0x3, 0x0, 0x0, 0x2D, 0x4D, 0x3, 0x0, 0x0, 0x4D, 0x4D, 0x3, 0x0, 0x0, 0x6D, 0x4D, 0x3, 0x0, 0x0, 0x8D, 0x4D, 0x3, 0x0, 0x0, 0xAD, 0x4D, 0x3, 0x0, 0x0, 0xCD, 0x4D, 0x3, 0x0, 0x0, 0xED, 0x4D, 0x3, 0x0, 0x0, 0xD, 0x4E, 0x3, 0x0, 0x0, 0x2D, 0x4E, 0x3, 0x0, 0x0, 0x4D, 0x4E, 0x3, 0x0, 0x0, 0x6D, 0x4E, 0x3, 0x0, 0x0, 0x8D, 0x4E, 0x3, 0x0, 0x0, 0xAD, 0x4E, 0x3, 0x0, 0x0, 0xCD, 0x4E, 0x3, 0x0, 0x0, 0xED, 0x4E, 0x3, 0x0, 0x0, 0xD, 0x4F, 0x3, 0x0, 0x0, 0x2D, 0x4F, 0x3, 0x0, 0x0, 0x4D, 0x4F, 0x3, 0x0, 0x0, 0x6D, 0x4F, 0x3, 0x0, 0x0, 0x8D, 0x4F, 0x3, 0x0, 0x0, 0xAD, 0x4F, 0x3, 0x0, 0x0, 0xCD, 0x4F, 0x3, 0x0, 0x0, 0xED, 0x4F, 0x3, 0x0, 0x0, 0xD, 0x50, 0x3, 0x0, 0x0, 0x2D, 0x50, 0x3, 0x0, 0x0, 0x4D, 0x50, 0x3, 0x0, 0x0, 0x6D, 0x50, 0x3, 0x0, 0x0, 0x8D, 0x50, 0x3, 0x0, 0x0, 0xAD, 0x50, 0x3, 0x0, 0x0, 0xCD, 0x50, 0x3, 0x0, 0x0, 0xED, 0x50, 0x3, 0x0, 0x0, 0xD, 0x51, 0x3, 0x0, 0x0, 0x2D, 0x51, 0x3, 0x0, 0x0, 0x4D, 0x51, 0x3, 0x0, 0x0, 0x6D, 0x51, 0x3, 0x0, 0x0, 0x8D, 0x51, 0x3, 0x0, 0x0, 0xAD, 0x51, 0x3, 0x0, 0x0, 0xCD, 0x51, 0x3, 0x0, 0x0, 0xED, 0x51, 0x3, 0x0, 0x0, 0xD, 0x52, 0x3, 0x0, 0x0, 0x2D, 0x52, 0x3, 0x0, 0x0, 0x4D, 0x52, 0x3, 0x0, 0x0, 0x6D, 0x52, 0x3, 0x0, 0x0, 0x8D, 0x52, 0x3, 0x0, 0x0, 0xAD, 0x52, 0x3, 0x0, 0x0, 0xCD, 0x52, 0x3, 0x0, 0x0, 0xED, 0x52, 0x3, 0x0, 0x0, 0xD, 0x53, 0x3, 0x0, 0x0, 0x2D, 0x53, 0x3, 0x0, 0x0, 0x4D, 0x53, 0x3, 0x0, 0x0, 0x6D, 0x53, 0x3, 0x0, 0x0, 0x8D, 0x53, 0x3, 0x0, 0x0, 0xAD, 0x53, 0xF3, 0xD4, 0x0, 0xED, 0x53, 0x3, 0xD5, 0x0, 0x2D, 0x54, 0x3, 0x0, 0x0, 0x4D, 0x54, 0x3, 0x0, 0x0, 0x6D, 0x54, 0x23, 0xD5, 0x0, 0xAD, 0x54, 0x33, 0xD5, 0x0, 0xED, 0x54, 0x43, 0xD5, 0x0, 0x2D, 0x55, 0x53, 0xD5, 0x0, 0x6D, 0x55, 0x3, 0x0, 0x0, 0x8D, 0x55, 0x3, 0x0, 0x0, 0xAD, 0x55, 0x3, 0x0, 0x0, 0xCD, 0x55, 0x7B, 0xD5, 0x0, 0xD, 0x56, 0x8B, 0xD5, 0x0, 0x4D, 0x56, 0x9B, 0xD5, 0x0, 0x8D, 0x56, 0xAB, 0xD5, 0x0, 0xCD, 0x56, 0xBB, 0xD5, 0x0, 0xD, 0x57, 0x3, 0x0, 0x0, 0x2D, 0x57, 0x3, 0x0, 0x0, 0x4D, 0x57, 0x3, 0x0, 0x0, 0x6D, 0x57, 0x3, 0x0, 0x0, 0x8D, 0x57, 0x3, 0x0, 0x0, 0xAD, 0x57, 0x3, 0x0, 0x0, 0xCD, 0x57, 0x3, 0x0, 0x0, 0xED, 0x57, 0x3, 0x0, 0x0, 0xD, 0x58, 0x3, 0x0, 0x0, 0x2D, 0x58, 0x3, 0x0, 0x0, 0x4D, 0x58, 0x3, 0x0, 0x0, 0x6D, 0x58, 0x3, 0x0, 0x0, 0x8D, 0x58, 0x3, 0x0, 0x0, 0xAD, 0x58, 0x3, 0x0, 0x0, 0xCD, 0x58, 0x3, 0x0, 0x0, 0xED, 0x58, 0x3, 0x0, 0x0, 0xD, 0x59, 0x3, 0x0, 0x0, 0x2D, 0x59, 0x3, 0x0, 0x0, 0x4D, 0x59, 0x3, 0x0, 0x0, 0x6D, 0x59, 0x3, 0x0, 0x0, 0x8D, 0x59, 0x3, 0x0, 0x0, 0xAD, 0x59, 0x3, 0x0, 0x0, 0xCD, 0x59, 0x3, 0x0, 0x0, 0xED, 0x59, 0x3, 0x0, 0x0, 0xD, 0x5A, 0x3, 0x0, 0x0, 0x2D, 0x5A, 0x3, 0x0, 0x0, 0x4D, 0x5A, 0x3, 0x0, 0x0, 0x6D, 0x5A, 0x3, 0x0, 0x0, 0x8D, 0x5A, 0x3, 0x0, 0x0, 0xAD, 0x5A, 0x3, 0x0, 0x0, 0xCD, 0x5A, 0x3, 0x0, 0x0, 0xED, 0x5A, 0x3, 0x0, 0x0, 0xD, 0x5B, 0x3, 0x0, 0x0, 0x2D, 0x5B, 0x3, 0x0, 0x0, 0x4D, 0x5B, 0x3, 0x0, 0x0, 0x6D, 0x5B, 0x3, 0x0, 0x0, 0x8D, 0x5B, 0x3, 0x0, 0x0, 0xAD, 0x5B, 0x3, 0x0, 0x0, 0xCD, 0x5B, 0x3, 0x0, 0x0, 0xED, 0x5B, 0x3, 0x0, 0x0, 0xD, 0x5C, 0x3, 0x0, 0x0, 0x2D, 0x5C, 0x3, 0x0, 0x0, 0x4D, 0x5C, 0x3, 0x0, 0x0, 0x6D, 0x5C, 0x3, 0x0, 0x0, 0x8D, 0x5C, 0x3, 0x0, 0x0, 0xAD, 0x5C, 0x3, 0x0, 0x0, 0xCD, 0x5C, 0x3, 0x0, 0x0, 0xED, 0x5C, 0x3, 0x0, 0x0, 0xD, 0x5D, 0x3, 0x0, 0x0, 0x2D, 0x5D, 0x3, 0x0, 0x0, 0x4D, 0x5D, 0x3, 0x0, 0x0, 0x6D, 0x5D, 0x3, 0x0, 0x0, 0x8D, 0x5D, 0x3, 0x0, 0x0, 0xAD, 0x5D, 0x3, 0x0, 0x0, 0xCD, 0x5D, 0x3, 0x0, 0x0, 0xED, 0x5D, 0x3, 0x0, 0x0, 0xD, 0x5E, 0x3, 0x0, 0x0, 0x2D, 0x5E, 0x3, 0x0, 0x0, 0x4D, 0x5E, 0x3, 0x0, 0x0, 0x6D, 0x5E, 0x3, 0x0, 0x0, 0x8D, 0x5E, 0x3, 0x0, 0x0, 0xAD, 0x5E, 0x3, 0x0, 0x0, 0xCD, 0x5E, 0x3, 0x0, 0x0, 0xED, 0x5E, 0x3, 0x0, 0x0, 0xD, 0x5F, 0x3, 0x0, 0x0, 0x2D, 0x5F, 0x3, 0x0, 0x0, 0x4D, 0x5F, 0x3, 0x0, 0x0, 0x6D, 0x5F, 0x3, 0x0, 0x0, 0x8D, 0x5F, 0x3, 0x0, 0x0, 0xAD, 0x5F, 0x3, 0x0, 0x0, 0xCD, 0x5F, 0x3, 0x0, 0x0, 0xED, 0x5F, 0x3, 0x0, 0x0, 0xD, 0x60, 0x3, 0x0, 0x0, 0x2D, 0x60, 0x3, 0x0, 0x0, 0x4D, 0x60, 0x3, 0x0, 0x0, 0x6D, 0x60, 0x3, 0x0, 0x0, 0x8D, 0x60, 0x3, 0x0, 0x0, 0xAD, 0x60, 0x3, 0x0, 0x0, 0xCD, 0x60, 0x3, 0x0, 0x0, 0xED, 0x60, 0x3, 0x0, 0x0, 0xD, 0x61, 0x3, 0x0, 0x0, 0x2D, 0x61, 0x3, 0x0, 0x0, 0x4D, 0x61, 0x3, 0x0, 0x0, 0x6D, 0x61, 0x3, 0x0, 0x0, 0x8D, 0x61, 0x3, 0x0, 0x0, 0xAD, 0x61, 0x3, 0x0, 0x0, 0xCD, 0x61, 0x3, 0x0, 0x0, 0xED, 0x61, 0x3, 0x0, 0x0, 0xD, 0x62, 0x3, 0x0, 0x0, 0x2D, 0x62, 0x3, 0x0, 0x0, 0x4D, 0x62, 0x3, 0x0, 0x0, 0x6D, 0x62, 0x3, 0x0, 0x0, 0x8D, 0x62, 0xAB, 0xD8, 0x0, 0xCD, 0x62, 0xBB, 0xD8, 0x0, 0xD, 0x63, 0xCB, 0xD8, 0x0, 0xD, 0x0, 0xD0, 0xD8, 0x0, 0xD, 0x0, 0xD8, 0xD8, 0x0, 0xD, 0x0, 0xE0, 0xD8, 0x0, 0xD, 0x0, 0xE8, 0xD8, 0x0, 0xD, 0x0, 0xF0, 0xD8, 0x0, 0xD, 0x0, 0xF8, 0xD8, 0x0, 0xD, 0x0, 0x0, 0xD9, 0x0, 0xD, 0x0, 0x8, 0xD9, 0x0, 0xD, 0x0, 0x10, 0xD9, 0x0, 0xD, 0x0, 0x18, 0xD9, 0x0, 0xD, 0x0, 0x20, 0xD9, 0x0, 0xD, 0x0, 0x28, 0xD9, 0x0, 0xD, 0x0, 0x30, 0xD9, 0x0, 0xD, 0x0, 0x38, 0xD9, 0x0, 0xD, 0x0, 0x40, 0xD9, 0x0, 0xD, 0x0, 0x48, 0xD9, 0x0, 0xD, 0x0, 0x50, 0xD9, 0x0, 0xD, 0x0, 0x58, 0xD9, 0x0, 0xD, 0x0, 0x60, 0xD9, 0x0, 0xD, 0x0, 0x68, 0xD9, 0x0, 0xD, 0x0, 0x70, 0xD9, 0x0, 0xD, 0x0, 0x78, 0xD9, 0x0, 0xD, 0x0, 0x80, 0xD9, 0x0, 0xD, 0x0, 0x88, 0xD9, 0x0, 0xD, 0x0, 0x90, 0xD9, 0x0, 0xD, 0x0, 0x98, 0xD9, 0x0, 0xD, 0x0, 0xA0, 0xD9, 0x0, 0xD, 0x0, 0xA8, 0xD9, 0x0, 0xD, 0x0, 0xB0, 0xD9, 0x0, 0xD, 0x0, 0xB8, 0xD9, 0x0, 0xD, 0x0, 0xC0, 0xD9, 0x0, 0xD, 0x0, 0xC8, 0xD9, 0x0, 0xD, 0x0, 0xD0, 0xD9, 0x0, 0xD, 0x0, 0xD8, 0xD9, 0x0, 0xD, 0x0, 0xE0, 0xD9, 0x0, 0xD, 0x0, 0xE8, 0xD9, 0x0, 0xD, 0x0, 0xF0, 0xD9, 0x0, 0xD, 0x0, 0xF8, 0xD9, 0x0, 0xD, 0x0, 0x0, 0xDA, 0x0, 0xD, 0x0, 0x8, 0xDA, 0x0, 0xD, 0x0, 0x10, 0xDA, 0x0, 0xD, 0x0, 0x18, 0xDA, 0x0, 0xD, 0x0, 0x20, 0xDA, 0x0, 0xD, 0x0, 0x28, 0xDA, 0x0, 0xD, 0x0, 0x30, 0xDA, 0x0, 0xD, 0x0, 0x38, 0xDA, 0x0, 0xD, 0x0, 0x40, 0xDA, 0x0, 0xD, 0x0, 0x48, 0xDA, 0x0, 0xD, 0x0, 0x50, 0xDA, 0x0, 0xD, 0x0, 0x58, 0xDA, 0x0, 0xD, 0x0, 0x60, 0xDA, 0x0, 0xD, 0x0, 0x68, 0xDA, 0x0, 0xD, 0x0, 0x70, 0xDA, 0x0, 0xD, 0x0, 0x78, 0xDA, 0x0, 0xD, 0x0, 0x80, 0xDA, 0x0, 0xD, 0x0, 0x88, 0xDA, 0x0, 0xD, 0x0, 0x90, 0xDA, 0x0, 0xD, 0x0, 0x98, 0xDA, 0x0, 0xD, 0x0, 0xA0, 0xDA, 0x0, 0xD, 0x0, 0xA8, 0xDA, 0x0, 0xD, 0x0, 0xB0, 0xDA, 0x0, 0xD, 0x0, 0xB8, 0xDA, 0x0, 0xD, 0x0, 0xC0, 0xDA, 0x0, 0xD, 0x0, 0xC8, 0xDA, 0x0, 0xD, 0x0, 0xD0, 0xDA, 0x0, 0xD, 0x0, 0xD8, 0xDA, 0x0, 0xD, 0x0, 0xE0, 0xDA, 0x0, 0xD, 0x0, 0xE8, 0xDA, 0x0, 0xD, 0x0, 0xF0, 0xDA, 0x0, 0xD, 0x0, 0xF8, 0xDA, 0x0, 0xD, 0x0, 0x0, 0xDB, 0x0, 0xD, 0x0, 0x8, 0xDB, 0x0, 0xD, 0x0, 0x10, 0xDB, 0x0, 0xD, 0x0, 0x18, 0xDB, 0x0, 0xD, 0x0, 0x20, 0xDB, 0x0, 0xD, 0x0, 0x28, 0xDB, 0x0, 0xD, 0x0, 0x30, 0xDB, 0x0, 0xD, 0x0, 0x38, 0xDB, 0x0, 0xD, 0x0, 0x40, 0xDB, 0x0, 0xD, 0x0, 0x48, 0xDB, 0x0, 0xD, 0x0, 0x50, 0xDB, 0x0, 0xD, 0x0, 0x58, 0xDB, 0x0, 0xD, 0x0, 0x60, 0xDB, 0x0, 0xD, 0x0, 0x68, 0xDB, 0x0, 0xD, 0x0, 0x70, 0xDB, 0x0, 0xD, 0x0, 0x78, 0xDB, 0x0, 0xD, 0x0, 0x80, 0xDB, 0x0, 0xD, 0x0, 0x88, 0xDB, 0x0, 0xD, 0x0, 0x90, 0xDB, 0x0, 0xD, 0x0, 0x98, 0xDB, 0x0, 0xD, 0x0, 0xA0, 0xDB, 0x0, 0xD, 0x0, 0xA8, 0xDB, 0x0, 0xD, 0x0, 0xB0, 0xDB, 0x0, 0xD, 0x0, 0xB8, 0xDB, 0x0, 0xD, 0x0, 0xC0, 0xDB, 0x0, 0xD, 0x0, 0xC8, 0xDB, 0x0, 0xD, 0x0, 0xD0, 0xDB, 0x0, 0xD, 0x0, 0xD8, 0xDB, 0x0, 0xD, 0x0, 0xE0, 0xDB, 0x0, 0xD, 0x0, 0xE8, 0xDB, 0x0, 0xD, 0x0, 0xF0, 0xDB, 0x0, 0xD, 0x0, 0xF8, 0xDB, 0x0, 0xD, 0x0, 0x0, 0xDC, 0x0, 0xD, 0x0, 0x8, 0xDC, 0x0, 0xD, 0x0, 0x10, 0xDC, 0x0, 0xD, 0x0, 0x18, 0xDC, 0x0, 0xD, 0x0, 0x20, 0xDC, 0x0, 0xD, 0x0, 0x28, 0xDC, 0x0, 0xD, 0x0, 0x30, 0xDC, 0x0, 0xD, 0x0, 0x38, 0xDC, 0x0, 0xD, 0x0, 0x40, 0xDC, 0x0, 0xD, 0x0, 0x48, 0xDC, 0x0, 0xD, 0x0, 0x50, 0xDC, 0x0, 0xD, 0x0, 0x58, 0xDC, 0x0, 0xD, 0x0, 0x60, 0xDC, 0x0, 0xD, 0x0, 0x68, 0xDC, 0x0, 0xD, 0x0, 0x70, 0xDC, 0x0, 0xD, 0x0, 0x78, 0xDC, 0x0, 0xD, 0x0, 0x80, 0xDC, 0x0, 0xD, 0x0, 0x88, 0xDC, 0x0, 0xD, 0x0, 0x90, 0xDC, 0x0, 0xD, 0x0, 0x98, 0xDC, 0x0, 0xD, 0x0, 0xA0, 0xDC, 0x0, 0xD, 0x0, 0xA8, 0xDC, 0x0, 0xD, 0x0, 0xB0, 0xDC, 0x0, 0xD, 0x0, 0xB8, 0xDC, 0x0, 0xD, 0x0, 0xC0, 0xDC, 0x0, 0xD, 0x0, 0xC8, 0xDC, 0x0, 0xD, 0x0, 0xD0, 0xDC, 0x0, 0xD, 0x0, 0xD8, 0xDC, 0x0, 0xD, 0x0, 0xE0, 0xDC, 0x0, 0xD, 0x0, 0xE8, 0xDC, 0x0, 0xD, 0x0, 0xF0, 0xDC, 0x0, 0xD, 0x0, 0xF8, 0xDC, 0x0, 0xD, 0x0, 0x0, 0xDD, 0x0, 0xD, 0x0, 0x8, 0xDD, 0x0, 0xD, 0x0, 0x10, 0xDD, 0x0, 0xD, 0x0, 0x18, 0xDD, 0x0, 0xD, 0x0, 0x20, 0xDD, 0x0, 0xD, 0x0, 0x28, 0xDD, 0x0, 0xD, 0x0, 0x30, 0xDD, 0x0, 0xD, 0x0, 0x38, 0xDD, 0x0, 0xD, 0x0, 0x40, 0xDD, 0x0, 0xD, 0x0, 0x48, 0xDD, 0x0, 0xD, 0x0, 0x50, 0xDD, 0x0, 0xD, 0x0, 0x58, 0xDD, 0x0, 0xD, 0x0, 0x60, 0xDD, 0x0, 0xD, 0x0, 0x68, 0xDD, 0x0, 0xD, 0x0, 0x70, 0xDD, 0x0, 0xD, 0x0, 0x78, 0xDD, 0x0, 0xD, 0x0, 0x80, 0xDD, 0x0, 0xD, 0x0, 0x88, 0xDD, 0x0, 0xD, 0x0, 0x90, 0xDD, 0x0, 0xD, 0x0, 0x98, 0xDD, 0x0, 0xD, 0x0, 0xA0, 0xDD, 0x0, 0xD, 0x0, 0xA8, 0xDD, 0x0, 0xD, 0x0, 0xB0, 0xDD, 0x0, 0xD, 0x0, 0xB8, 0xDD, 0x0, 0xD, 0x0, 0xC0, 0xDD, 0x0, 0xD, 0x0, 0xC8, 0xDD, 0x0, 0xD, 0x0, 0xD0, 0xDD, 0x0, 0xD, 0x0, 0xD8, 0xDD, 0x0, 0xD, 0x0, 0xE0, 0xDD, 0x0, 0xD, 0x0, 0xE8, 0xDD, 0x0, 0xD, 0x0, 0xF0, 0xDD, 0x0, 0xD, 0x0, 0xF8, 0xDD, 0x0, 0xD, 0x0, 0x0, 0xDE, 0x0, 0xD, 0x0, 0x8, 0xDE, 0x0, 0xD, 0x0, 0x10, 0xDE, 0x0, 0xD, 0x0, 0x18, 0xDE, 0x0, 0xD, 0x0, 0x20, 0xDE, 0x0, 0xD, 0x0, 0x28, 0xDE, 0x0, 0xD, 0x0, 0x30, 0xDE, 0x0, 0xD, 0x0, 0x38, 0xDE, 0x0, 0xD, 0x0, 0x40, 0xDE, 0x0, 0xD, 0x0, 0x48, 0xDE, 0x0, 0xD, 0x0, 0x50, 0xDE, 0x0, 0xD, 0x0, 0x58, 0xDE, 0x0, 0xD, 0x0, 0x60, 0xDE, 0x0, 0xD, 0x0, 0x68, 0xDE, 0x0, 0xD, 0x0, 0x70, 0xDE, 0x0, 0xD, 0x0, 0x78, 0xDE, 0x0, 0xD, 0x0, 0x80, 0xDE, 0x0, 0xD, 0x0, 0x88, 0xDE, 0x0, 0xD, 0x0, 0x90, 0xDE, 0x0, 0xD, 0x0, 0x98, 0xDE, 0x0, 0xD, 0x0, 0xA0, 0xDE, 0x0, 0xD, 0x0, 0xA8, 0xDE, 0x0, 0xD, 0x0, 0xB0, 0xDE, 0x0, 0xD, 0x0, 0xB8, 0xDE, 0x0, 0xD, 0x0, 0xC0, 0xDE, 0x0, 0xD, 0x0, 0xC8, 0xDE, 0x0, 0xD, 0x0, 0xD0, 0xDE, 0x0, 0xD, 0x0, 0xD8, 0xDE, 0x0, 0xD, 0x0, 0xE0, 0xDE, 0x0, 0xD, 0x0, 0xE8, 0xDE, 0x0, 0xD, 0x0, 0xF0, 0xDE, 0x0, 0xD, 0x0, 0xF8, 0xDE, 0x0, 0xD, 0x0, 0x0, 0xDF, 0x0, 0xD, 0x0, 0x8, 0xDF, 0x0, 0xD, 0x0, 0x10, 0xDF, 0x0, 0xD, 0x0, 0x18, 0xDF, 0x0, 0xD, 0x0, 0x20, 0xDF, 0x0, 0xD, 0x0, 0x28, 0xDF, 0x0, 0xD, 0x0, 0x30, 0xDF, 0x0, 0xD, 0x0, 0x38, 0xDF, 0x0, 0xD, 0x0, 0x40, 0xDF, 0x0, 0xD, 0x0, 0x48, 0xDF, 0x0, 0xD, 0x0, 0x50, 0xDF, 0x0, 0xD, 0x0, 0x58, 0xDF, 0x0, 0xD, 0x0, 0x60, 0xDF, 0x0, 0xD, 0x0, 0x68, 0xDF, 0x0, 0xD, 0x0, 0x70, 0xDF, 0x0, 0xD, 0x0, 0x78, 0xDF, 0x0, 0xD, 0x0, 0x80, 0xDF, 0x0, 0xD, 0x0, 0x88, 0xDF, 0x0, 0xD, 0x0, 0x90, 0xDF, 0x0, 0xD, 0x0, 0x98, 0xDF, 0x0, 0xD, 0x0, 0xA0, 0xDF, 0x0, 0xD, 0x0, 0xA8, 0xDF, 0x0, 0xD, 0x0, 0xB0, 0xDF, 0x0, 0xD, 0x0, 0xB8, 0xDF, 0x0, 0xD, 0x0, 0xC0, 0xDF, 0x0, 0xD, 0x0, 0xC8, 0xDF, 0x0, 0xD, 0x0, 0xD0, 0xDF, 0x0, 0xD, 0x0, 0xD8, 0xDF, 0x0, 0xD, 0x0, 0xE0, 0xDF, 0x0, 0xD, 0x0, 0xE8, 0xDF, 0x0, 0xD, 0x0, 0xF0, 0xDF, 0x0, 0xD, 0x0, 0xF8, 0xDF, 0x0, 0xD, 0x0, 0x0, 0xE0, 0x0, 0xD, 0x0, 0x8, 0xE0, 0x0, 0xD, 0x0, 0x10, 0xE0, 0x0, 0xD, 0x0, 0x18, 0xE0, 0x0, 0xD, 0x0, 0x20, 0xE0, 0x0, 0xD, 0x0, 0x28, 0xE0, 0x0, 0xD, 0x0, 0x30, 0xE0, 0x0, 0xD, 0x0, 0x38, 0xE0, 0x0, 0xD, 0x0, 0x40, 0xE0, 0x0, 0xD, 0x0, 0x48, 0xE0, 0x0, 0xD, 0x0, 0x50, 0xE0, 0x0, 0xD, 0x0, 0x58, 0xE0, 0x0, 0xD, 0x0, 0x60, 0xE0, 0x0, 0xD, 0x0, 0x68, 0xE0, 0x0, 0xD, 0x0, 0x70, 0xE0, 0x0, 0xD, 0x0, 0x78, 0xE0, 0x0, 0xD, 0x0, 0x80, 0xE0, 0x0, 0xD, 0x0, 0x88, 0xE0, 0x0, 0xD, 0x0, 0x90, 0xE0, 0x0, 0xD, 0x0, 0x98, 0xE0, 0x0, 0xD, 0x0, 0xA0, 0xE0, 0x0, 0xD, 0x0, 0xA8, 0xE0, 0x0, 0xD, 0x0, 0xB0, 0xE0, 0x0, 0xD, 0x0, 0xB8, 0xE0, 0x0, 0xD, 0x0, 0xC0, 0xE0, 0x0, 0xD, 0x0, 0xC8, 0xE0, 0x0, 0xD, 0x0, 0xD0, 0xE0, 0x0, 0xD, 0x0, 0xD8, 0xE0, 0x0, 0xD, 0x0, 0xE0, 0xE0, 0x0, 0xD, 0x0, 0xE8, 0xE0, 0x0, 0xD, 0x0, 0xF0, 0xE0, 0x0, 0xD, 0x0, 0xF8, 0xE0, 0x0, 0xD, 0x0, 0x0, 0xE1, 0x0, 0xD, 0x0, 0x8, 0xE1, 0x0, 0xD, 0x0, 0x10, 0xE1, 0x0, 0xD, 0x0, 0x18, 0xE1, 0x0, 0xD, 0x0, 0x20, 0xE1, 0x0, 0xD, 0x0, 0x28, 0xE1, 0x0, 0xD, 0x0, 0x30, 0xE1, 0x0, 0xD, 0x0, 0x38, 0xE1, 0x0, 0xD, 0x0, 0x40, 0xE1, 0x0, 0xD, 0x0, 0x48, 0xE1, 0x0, 0xD, 0x0, 0x50, 0xE1, 0x0, 0xD, 0x0, 0x58, 0xE1, 0x0, 0xD, 0x0, 0x60, 0xE1, 0x0, 0xD, 0x0, 0x68, 0xE1, 0x0, 0xD, 0x0, 0x70, 0xE1, 0x0, 0xD, 0x0, 0x78, 0xE1, 0x0, 0xD, 0x0, 0x80, 0xE1, 0x0, 0xD, 0x0, 0x88, 0xE1, 0x0, 0xD, 0x0, 0x90, 0xE1, 0x0, 0xD, 0x0, 0x98, 0xE1, 0x0, 0xD, 0x0, 0xA0, 0xE1, 0x0, 0xD, 0x0, 0xA8, 0xE1, 0x0, 0xD, 0x0, 0xB0, 0xE1, 0x0, 0xD, 0x0, 0xB8, 0xE1, 0x0, 0xD, 0x0, 0xC0, 0xE1, 0x0, 0xD, 0x0, 0xC8, 0xE1, 0x0, 0xD, 0x0, 0xD0, 0xE1, 0x0, 0xD, 0x0, 0xD8, 0xE1, 0x0, 0xD, 0x0, 0xE0, 0xE1, 0x0, 0xD, 0x0, 0xE8, 0xE1, 0x0, 0xD, 0x0, 0xF0, 0xE1, 0x0, 0xD, 0x0, 0xF8, 0xE1, 0x0, 0xD, 0x0, 0x0, 0xE2, 0x0, 0xD, 0x0, 0x8, 0xE2, 0x0, 0xD, 0x0, 0x10, 0xE2, 0x0, 0xD, 0x0, 0x18, 0xE2, 0x0, 0xD, 0x0, 0x20, 0xE2, 0x0, 0xD, 0x0, 0x28, 0xE2, 0x0, 0xD, 0x0, 0x30, 0xE2, 0x0, 0xD, 0x0, 0x38, 0xE2, 0x0, 0xD, 0x0, 0x40, 0xE2, 0x0, 0xD, 0x0, 0x48, 0xE2, 0x0, 0xD, 0x0, 0x50, 0xE2, 0x0, 0xD, 0x0, 0x58, 0xE2, 0x0, 0xD, 0x0, 0x60, 0xE2, 0x0, 0xD, 0x0, 0x68, 0xE2, 0x0, 0xD, 0x0, 0x70, 0xE2, 0x0, 0xD, 0x0, 0x78, 0xE2, 0x0, 0xD, 0x0, 0x80, 0xE2, 0x0, 0xD, 0x0, 0x88, 0xE2, 0x0, 0xD, 0x0, 0x90, 0xE2, 0x0, 0xD, 0x0, 0x98, 0xE2, 0x0, 0xD, 0x0, 0xA0, 0xE2, 0x0, 0xD, 0x0, 0xA8, 0xE2, 0x0, 0xD, 0x0, 0xB0, 0xE2, 0x0, 0xD, 0x0, 0xB8, 0xE2, 0x0, 0xD, 0x0, 0xC0, 0xE2, 0x0, 0xD, 0x0, 0xC8, 0xE2, 0x0, 0xD, 0x0, 0xD0, 0xE2, 0x0, 0xD, 0x0, 0xD8, 0xE2, 0x0, 0xD, 0x0, 0xE0, 0xE2, 0x0, 0xD, 0x0, 0xE8, 0xE2, 0x0, 0xD, 0x0, 0xF0, 0xE2, 0x0, 0xD, 0x0, 0xF8, 0xE2, 0x0, 0xD, 0x0, 0x0, 0xE3, 0x0, 0xD, 0x0, 0x8, 0xE3, 0x0, 0xD, 0x0, 0x10, 0xE3, 0x0, 0xD, 0x0, 0x18, 0xE3, 0x0, 0xD, 0x0, 0x20, 0xE3, 0x0, 0xD, 0x0, 0x28, 0xE3, 0x0, 0xD, 0x0, 0x30, 0xE3, 0x0, 0xD, 0x0, 0x38, 0xE3, 0x0, 0xD, 0x0, 0x40, 0xE3, 0x0, 0xD, 0x0, 0x48, 0xE3, 0x0, 0xD, 0x0, 0x50, 0xE3, 0x0, 0xD, 0x0, 0x58, 0xE3, 0x0, 0xD, 0x0, 0x60, 0xE3, 0x0, 0xD, 0x0, 0x68, 0xE3, 0x0, 0xD, 0x0, 0x70, 0xE3, 0x0, 0xD, 0x0, 0x78, 0xE3, 0x0, 0xD, 0x0, 0x80, 0xE3, 0x0, 0xD, 0x0, 0x88, 0xE3, 0x0, 0xD, 0x0, 0x90, 0xE3, 0x0, 0xD, 0x0, 0x98, 0xE3, 0x0, 0xD, 0x0, 0xA0, 0xE3, 0x0, 0xD, 0x0, 0xA8, 0xE3, 0x0, 0xD, 0x0, 0xB0, 0xE3, 0x0, 0xD, 0x0, 0xB8, 0xE3, 0x0, 0xD, 0x0, 0xC0, 0xE3, 0x0, 0xD, 0x0, 0xC8, 0xE3, 0x0, 0xD, 0x0, 0xD0, 0xE3, 0x0, 0xD, 0x0, 0xD8, 0xE3, 0x0, 0xD, 0x0, 0xE0, 0xE3, 0x0, 0xD, 0x0, 0xE8, 0xE3, 0x0, 0xD, 0x0, 0xF0, 0xE3, 0x0, 0xD, 0x0, 0xF8, 0xE3, 0x0, 0xD, 0x0, 0x0, 0xE4, 0x0, 0xD, 0x0, 0x8, 0xE4, 0x0, 0xD, 0x0, 0x10, 0xE4, 0x0, 0xD, 0x0, 0x18, 0xE4, 0x0, 0xD, 0x0, 0x20, 0xE4, 0x0, 0xD, 0x0, 0x28, 0xE4, 0x0, 0xD, 0x0, 0x30, 0xE4, 0x0, 0xD, 0x0, 0x38, 0xE4, 0x0, 0xD, 0x0, 0x40, 0xE4, 0x0, 0xD, 0x0, 0x48, 0xE4, 0x0, 0xD, 0x0, 0x50, 0xE4, 0x0, 0xD, 0x0, 0x58, 0xE4, 0x0, 0xD, 0x0, 0x60, 0xE4, 0x0, 0xD, 0x0, 0x68, 0xE4, 0x0, 0xD, 0x0, 0x70, 0xE4, 0x0, 0xD, 0x0, 0x78, 0xE4, 0x0, 0xD, 0x0, 0x80, 0xE4, 0x0, 0xD, 0x0, 0x88, 0xE4, 0x0, 0xD, 0x0, 0x90, 0xE4, 0x0, 0xD, 0x0, 0x98, 0xE4, 0x0, 0xD, 0x0, 0xA0, 0xE4, 0x0, 0xD, 0x0, 0xA8, 0xE4, 0x0, 0xD, 0x0, 0xB0, 0xE4, 0x0, 0xD, 0x0, 0xB8, 0xE4, 0x0, 0xD, 0x0, 0xC0, 0xE4, 0x0, 0xD, 0x0, 0xC8, 0xE4, 0x0, 0xD, 0x0, 0xD0, 0xE4, 0x0, 0xD, 0x0, 0xD8, 0xE4, 0x0, 0xD, 0x0, 0xE0, 0xE4, 0x0, 0xD, 0x0, 0xE8, 0xE4, 0x0, 0xD, 0x0, 0xF0, 0xE4, 0x0, 0xD, 0x0, 0xF8, 0xE4, 0x0, 0xD, 0x0, 0x0, 0xE5, 0x0, 0xD, 0x0, 0x8, 0xE5, 0x0, 0xD, 0x0, 0x10, 0xE5, 0x0, 0xD, 0x0, 0x18, 0xE5, 0x0, 0xD, 0x0, 0x20, 0xE5, 0x0, 0xD, 0x0, 0x28, 0xE5, 0x0, 0xD, 0x0, 0x30, 0xE5, 0x0, 0xD, 0x0, 0x38, 0xE5, 0x0, 0xD, 0x0, 0x40, 0xE5, 0x0, 0xD, 0x0, 0x48, 0xE5, 0x0, 0xD, 0x0, 0x50, 0xE5, 0x0, 0xD, 0x0, 0x58, 0xE5, 0x0, 0xD, 0x0, 0x60, 0xE5, 0x0, 0xD, 0x0, 0x68, 0xE5, 0x0, 0xD, 0x0, 0x70, 0xE5, 0x0, 0xD, 0x0, 0x78, 0xE5, 0x0, 0xD, 0x0, 0x80, 0xE5, 0x0, 0xD, 0x0, 0x88, 0xE5, 0x0, 0xD, 0x0, 0x90, 0xE5, 0x0, 0xD, 0x0, 0x98, 0xE5, 0x0, 0xD, 0x0, 0xA0, 0xE5, 0x0, 0xD, 0x0, 0xA8, 0xE5, 0x0, 0xD, 0x0, 0xB0, 0xE5, 0x0, 0xD, 0x0, 0xB8, 0xE5, 0x0, 0xD, 0x0, 0xC0, 0xE5, 0x0, 0xD, 0x0, 0xC8, 0xE5, 0x0, 0xD, 0x0, 0xD0, 0xE5, 0x0, 0xD, 0x0, 0xD8, 0xE5, 0x0, 0xD, 0x0, 0xE0, 0xE5, 0x0, 0xD, 0x0, 0xE8, 0xE5, 0x0, 0xD, 0x0, 0xF0, 0xE5, 0x0, 0xD, 0x0, 0xF8, 0xE5, 0x0, 0xD, 0x0, 0x0, 0xE6, 0x0, 0xD, 0x0, 0x8, 0xE6, 0x0, 0xD, 0x0, 0x10, 0xE6, 0x0, 0xD, 0x0, 0x18, 0xE6, 0x0, 0xD, 0x0, 0x20, 0xE6, 0x0, 0xD, 0x0, 0x28, 0xE6, 0x0, 0xD, 0x0, 0x30, 0xE6, 0x0, 0xD, 0x0, 0x38, 0xE6, 0x0, 0xD, 0x0, 0x40, 0xE6, 0x0, 0xD, 0x0, 0x48, 0xE6, 0x0, 0xD, 0x0, 0x50, 0xE6, 0x0, 0xD, 0x0, 0x58, 0xE6, 0x0, 0xD, 0x0, 0x60, 0xE6, 0x0, 0xD, 0x0, 0x68, 0xE6, 0x0, 0xD, 0x0, 0x70, 0xE6, 0x0, 0xD, 0x0, 0x78, 0xE6, 0x0, 0xD, 0x0, 0x80, 0xE6, 0x0, 0xD, 0x0, 0x88, 0xE6, 0x0, 0xD, 0x0, 0x90, 0xE6, 0x0, 0xD, 0x0, 0x98, 0xE6, 0x0, 0xD, 0x0, 0xA0, 0xE6, 0x0, 0xD, 0x0, 0xA8, 0xE6, 0x0, 0xD, 0x0, 0xB0, 0xE6, 0x0, 0xD, 0x0, 0xB8, 0xE6, 0x0, 0xD, 0x0, 0xC0, 0xE6, 0x0, 0xD, 0x0, 0xC8, 0xE6, 0x0, 0xD, 0x0, 0xD0, 0xE6, 0x0, 0xD, 0x0, 0xD8, 0xE6, 0x0, 0xD, 0x0, 0xE0, 0xE6, 0x0, 0xD, 0x0, 0xE8, 0xE6, 0x0, 0xD, 0x0, 0xF0, 0xE6, 0x0, 0xD, 0x0, 0xF8, 0xE6, 0x0, 0xD, 0x0, 0x0, 0xE7, 0x0, 0xD, 0x0, 0x8, 0xE7, 0x0, 0xD, 0x0, 0x10, 0xE7, 0x0, 0xD, 0x0, 0x18, 0xE7, 0x0, 0xD, 0x0, 0x20, 0xE7, 0x0, 0xD, 0x0, 0x28, 0xE7, 0x0, 0xD, 0x0, 0x30, 0xE7, 0x0, 0xD, 0x0, 0x38, 0xE7, 0x0, 0xD, 0x0, 0x40, 0xE7, 0x0, 0xD, 0x0, 0x48, 0xE7, 0x0, 0xD, 0x0, 0x50, 0xE7, 0x0, 0xD, 0x0, 0x58, 0xE7, 0x0, 0xD, 0x0, 0x60, 0xE7, 0x0, 0xD, 0x0, 0x68, 0xE7, 0x0, 0xD, 0x0, 0x70, 0xE7, 0x0, 0xD, 0x0, 0x78, 0xE7, 0x0, 0xD, 0x0, 0x80, 0xE7, 0x0, 0xD, 0x0, 0x88, 0xE7, 0x0, 0xD, 0x0, 0x90, 0xE7, 0x0, 0xD, 0x0, 0x98, 0xE7, 0x0, 0xD, 0x0, 0xA0, 0xE7, 0x0, 0xD, 0x0, 0xA8, 0xE7, 0x0, 0xD, 0x0, 0xB0, 0xE7, 0x0, 0xD, 0x0, 0xB8, 0xE7, 0x0, 0xD, 0x0, 0xC0, 0xE7, 0x0, 0xD, 0x0, 0xC8, 0xE7, 0x0, 0xD, 0x0, 0xD0, 0xE7, 0x0, 0xD, 0x0, 0xD8, 0xE7, 0x0, 0xD, 0x0, 0xE0, 0xE7, 0x0, 0xD, 0x0, 0xE8, 0xE7, 0x0, 0xD, 0x0, 0xF0, 0xE7, 0x0, 0xD, 0x0, 0xF8, 0xE7, 0x0, 0xD, 0x0, 0x0, 0xE8, 0x0, 0xD, 0x0, 0x8, 0xE8, 0x0, 0xD, 0x0, 0x10, 0xE8, 0x0, 0xD, 0x0, 0x18, 0xE8, 0x0, 0xD, 0x0, 0x20, 0xE8, 0x0, 0xD, 0x0, 0x28, 0xE8, 0x0, 0xD, 0x0, 0x30, 0xE8, 0x0, 0xD, 0x0, 0x38, 0xE8, 0x0, 0xD, 0x0, 0x40, 0xE8, 0x0, 0xD, 0x0, 0x48, 0xE8, 0x0, 0xD, 0x0, 0x50, 0xE8, 0x0, 0xD, 0x0, 0x58, 0xE8, 0x0, 0xD, 0x0, 0x60, 0xE8, 0x0, 0xD, 0x0, 0x68, 0xE8, 0x0, 0xD, 0x0, 0x70, 0xE8, 0x0, 0xD, 0x0, 0x78, 0xE8, 0x0, 0xD, 0x0, 0x80, 0xE8, 0x0, 0xD, 0x0, 0x88, 0xE8, 0x0, 0xD, 0x0, 0x90, 0xE8, 0x0, 0xD, 0x0, 0x98, 0xE8, 0x0, 0xD, 0x0, 0xA0, 0xE8, 0x0, 0xD, 0x0, 0xA8, 0xE8, 0x0, 0xD, 0x0, 0xB0, 0xE8, 0x0, 0xD, 0x0, 0xB8, 0xE8, 0x0, 0xD, 0x0, 0xC0, 0xE8, 0x0, 0xD, 0x0, 0xC8, 0xE8, 0x0, 0xD, 0x0, 0xD0, 0xE8, 0x0, 0xD, 0x0, 0xD8, 0xE8, 0x0, 0xD, 0x0, 0xE0, 0xE8, 0x0, 0xD, 0x0, 0xE8, 0xE8, 0x0, 0xD, 0x0, 0xF0, 0xE8, 0x0, 0xD, 0x0, 0xF8, 0xE8, 0x0, 0xD, 0x0, 0x0, 0xE9, 0x0, 0xD, 0x0, 0x8, 0xE9, 0x0, 0xD, 0x0, 0x10, 0xE9, 0x0, 0xD, 0x0, 0x18, 0xE9, 0x0, 0xD, 0x0, 0x20, 0xE9, 0x0, 0xD, 0x0, 0x28, 0xE9, 0x0, 0xD, 0x0, 0x30, 0xE9, 0x0, 0xD, 0x0, 0x38, 0xE9, 0x0, 0xD, 0x0, 0x40, 0xE9, 0x0, 0xD, 0x0, 0x48, 0xE9, 0x0, 0xD, 0x0, 0x50, 0xE9, 0x0, 0xD, 0x0, 0x58, 0xE9, 0x0, 0xD, 0x0, 0x60, 0xE9, 0x0, 0xD, 0x0, 0x68, 0xE9, 0x0, 0xD, 0x0, 0x70, 0xE9, 0x0, 0xD, 0x0, 0x78, 0xE9, 0x0, 0xD, 0x0, 0x80, 0xE9, 0x0, 0xD, 0x0, 0x88, 0xE9, 0x0, 0xD, 0x0, 0x90, 0xE9, 0x0, 0xD, 0x0, 0x98, 0xE9, 0x0, 0xD, 0x0, 0xA0, 0xE9, 0x0, 0xD, 0x0, 0xA8, 0xE9, 0x0, 0xD, 0x0, 0xB0, 0xE9, 0x0, 0xD, 0x0, 0xB8, 0xE9, 0x0, 0xD, 0x0, 0xC0, 0xE9, 0x0, 0xD, 0x0, 0xC8, 0xE9, 0x0, 0xD, 0x0, 0xD0, 0xE9, 0x0, 0xD, 0x0, 0xD8, 0xE9, 0x0, 0xD, 0x0, 0xE0, 0xE9, 0x0, 0xD, 0x0, 0xE8, 0xE9, 0x0, 0xD, 0x0, 0xF0, 0xE9, 0x0, 0xD, 0x0, 0xF8, 0xE9, 0x0, 0xD, 0x0, 0x0, 0xEA, 0x0, 0xD, 0x0, 0x8, 0xEA, 0x0, 0xD, 0x0, 0x10, 0xEA, 0x0, 0xD, 0x0, 0x18, 0xEA, 0x0, 0xD, 0x0, 0x20, 0xEA, 0x0, 0xD, 0x0, 0x28, 0xEA, 0x0, 0xD, 0x0, 0x30, 0xEA, 0x0, 0xD, 0x0, 0x38, 0xEA, 0x0, 0xD, 0x0, 0x40, 0xEA, 0x0, 0xD, 0x0, 0x48, 0xEA, 0x0, 0xD, 0x0, 0x50, 0xEA, 0x0, 0xD, 0x0, 0x58, 0xEA, 0x0, 0xD, 0x0, 0x60, 0xEA, 0x0, 0xD, 0x0, 0x68, 0xEA, 0x0, 0xD, 0x0, 0x70, 0xEA, 0x0, 0xD, 0x0, 0x78, 0xEA, 0x0, 0xD, 0x0, 0x80, 0xEA, 0x0, 0xD, 0x0, 0x88, 0xEA, 0x0, 0xD, 0x0, 0x90, 0xEA, 0x0, 0xD, 0x0, 0x98, 0xEA, 0x0, 0xD, 0x0, 0xA0, 0xEA, 0x0, 0xD, 0x0, 0xA8, 0xEA, 0x0, 0xD, 0x0, 0xB0, 0xEA, 0x0, 0xD, 0x0, 0xB8, 0xEA, 0x0, 0xD, 0x0, 0xC0, 0xEA, 0x0, 0xD, 0x0, 0xC8, 0xEA, 0x0, 0xD, 0x0, 0xD0, 0xEA, 0x0, 0xD, 0x0, 0xD8, 0xEA, 0x0, 0xD, 0x0, 0xE0, 0xEA, 0x0, 0xD, 0x0, 0xE8, 0xEA, 0x0, 0xD, 0x0, 0xF0, 0xEA, 0x0, 0xD, 0x0, 0xF8, 0xEA, 0x0, 0xD, 0x0, 0x0, 0xEB, 0x0, 0xD, 0x0, 0x8, 0xEB, 0x0, 0xD, 0x0, 0x10, 0xEB, 0x0, 0xD, 0x0, 0x18, 0xEB, 0x0, 0xD, 0x0, 0x20, 0xEB, 0x0, 0xD, 0x0, 0x28, 0xEB, 0x0, 0xD, 0x0, 0x30, 0xEB, 0x0, 0xD, 0x0, 0x38, 0xEB, 0x0, 0xD, 0x0, 0x40, 0xEB, 0x0, 0xD, 0x0, 0x48, 0xEB, 0x0, 0xD, 0x0, 0x50, 0xEB, 0x0, 0xD, 0x0, 0x58, 0xEB, 0x0, 0xD, 0x0, 0x60, 0xEB, 0x0, 0xD, 0x0, 0x68, 0xEB, 0x0, 0xD, 0x0, 0x70, 0xEB, 0x0, 0xD, 0x0, 0x78, 0xEB, 0x0, 0xD, 0x0, 0x80, 0xEB, 0x0, 0xD, 0x0, 0x88, 0xEB, 0x0, 0xD, 0x0, 0x90, 0xEB, 0x0, 0xD, 0x0, 0x98, 0xEB, 0x0, 0xD, 0x0, 0xA0, 0xEB, 0x0, 0xD, 0x0, 0xA8, 0xEB, 0x0, 0xD, 0x0, 0xB0, 0xEB, 0x0, 0xD, 0x0, 0xB8, 0xEB, 0x0, 0xD, 0x0, 0xC0, 0xEB, 0x0, 0xD, 0x0, 0xC8, 0xEB, 0x0, 0xD, 0x0, 0xD0, 0xEB, 0x0, 0xD, 0x0, 0xD8, 0xEB, 0x0, 0xD, 0x0, 0xE0, 0xEB, 0x0, 0xD, 0x0, 0xE8, 0xEB, 0x0, 0xD, 0x0, 0xF0, 0xEB, 0x0, 0xD, 0x0, 0xF8, 0xEB, 0x0, 0xD, 0x0, 0x0, 0xEC, 0x0, 0xD, 0x0, 0x8, 0xEC, 0x0, 0xD, 0x0, 0x10, 0xEC, 0x0, 0xD, 0x0, 0x18, 0xEC, 0x0, 0xD, 0x0, 0x20, 0xEC, 0x0, 0xD, 0x0, 0x28, 0xEC, 0x0, 0xD, 0x0, 0x30, 0xEC, 0x0, 0xD, 0x0, 0x38, 0xEC, 0x0, 0xD, 0x0, 0x40, 0xEC, 0x0, 0xD, 0x0, 0x48, 0xEC, 0x0, 0xD, 0x0, 0x50, 0xEC, 0x0, 0xD, 0x0, 0x58, 0xEC, 0x0, 0xD, 0x0, 0x60, 0xEC, 0x0, 0xD, 0x0, 0x68, 0xEC, 0x0, 0xD, 0x0, 0x70, 0xEC, 0x0, 0xD, 0x0, 0x78, 0xEC, 0x0, 0xD, 0x0, 0x80, 0xEC, 0x0, 0xD, 0x0, 0x88, 0xEC, 0x0, 0xD, 0x0, 0x90, 0xEC, 0x0, 0xD, 0x0, 0x98, 0xEC, 0x0, 0xD, 0x0, 0xA0, 0xEC, 0x0, 0xD, 0x0, 0xA8, 0xEC, 0x0, 0xD, 0x0, 0xB0, 0xEC, 0x0, 0xD, 0x0, 0xB8, 0xEC, 0x0, 0xD, 0x0, 0xC0, 0xEC, 0x0, 0xD, 0x0, 0xC8, 0xEC, 0x0, 0xD, 0x0, 0xD0, 0xEC, 0x0, 0xD, 0x0, 0xD8, 0xEC, 0x0, 0xD, 0x0, 0xE0, 0xEC, 0x0, 0xD, 0x0, 0xE8, 0xEC, 0x0, 0xD, 0x0, 0xF0, 0xEC, 0x0, 0xD, 0x0, 0xF8, 0xEC, 0x0, 0xD, 0x0, 0x0, 0xED, 0x0, 0xD, 0x0, 0x8, 0xED, 0x0, 0xD, 0x0, 0x10, 0xED, 0x0, 0xD, 0x0, 0x18, 0xED, 0x0, 0xD, 0x0, 0x20, 0xED, 0x0, 0xD, 0x0, 0x28, 0xED, 0x0, 0xD, 0x0, 0x30, 0xED, 0x0, 0xD, 0x0, 0x38, 0xED, 0x0, 0xD, 0x0, 0x40, 0xED, 0x0, 0xD, 0x0, 0x48, 0xED, 0x0, 0xD, 0x0, 0x50, 0xED, 0x0, 0xD, 0x0, 0x58, 0xED, 0x0, 0xD, 0x0, 0x60, 0xED, 0x0, 0xD, 0x0, 0x68, 0xED, 0x0, 0xD, 0x0, 0x70, 0xED, 0x0, 0xD, 0x0, 0x78, 0xED, 0x0, 0xD, 0x0, 0x80, 0xED, 0x0, 0xD, 0x0, 0x88, 0xED, 0x0, 0xD, 0x0, 0x90, 0xED, 0x0, 0xD, 0x0, 0x98, 0xED, 0x0, 0xD, 0x0, 0xA0, 0xED, 0x0, 0xD, 0x0, 0xA8, 0xED, 0x0, 0xD, 0x0, 0xB0, 0xED, 0x0, 0xD, 0x0, 0xB8, 0xED, 0x0, 0xD, 0x0, 0xC0, 0xED, 0x0, 0xD, 0x0, 0xC8, 0xED, 0x0, 0xD, 0x0, 0xD0, 0xED, 0x0, 0xD, 0x0, 0xD8, 0xED, 0x0, 0xD, 0x0, 0xE0, 0xED, 0x0, 0xD, 0x0, 0xE8, 0xED, 0x0, 0xD, 0x0, 0xF0, 0xED, 0x0, 0xD, 0x0, 0xF8, 0xED, 0x0, 0xD, 0x0, 0x0, 0xEE, 0x0, 0xD, 0x0, 0x8, 0xEE, 0x0, 0xD, 0x0, 0x10, 0xEE, 0x0, 0xD, 0x0, 0x18, 0xEE, 0x0, 0xD, 0x0, 0x20, 0xEE, 0x0, 0xD, 0x0, 0x28, 0xEE, 0x0, 0xD, 0x0, 0x30, 0xEE, 0x0, 0xD, 0x0, 0x38, 0xEE, 0x0, 0xD, 0x0, 0x40, 0xEE, 0x0, 0xD, 0x0, 0x48, 0xEE, 0x0, 0xD, 0x0, 0x50, 0xEE, 0x0, 0xD, 0x0, 0x58, 0xEE, 0x0, 0xD, 0x0, 0x60, 0xEE, 0x0, 0xD, 0x0, 0x68, 0xEE, 0x0, 0xD, 0x0, 0x70, 0xEE, 0x0, 0xD, 0x0, 0x78, 0xEE, 0x0, 0xD, 0x0, 0x80, 0xEE, 0x0, 0xD, 0x0, 0x88, 0xEE, 0x0, 0xD, 0x0, 0x90, 0xEE, 0x0, 0xD, 0x0, 0x98, 0xEE, 0x0, 0xD, 0x0, 0xA0, 0xEE, 0x0, 0xD, 0x0, 0xA8, 0xEE, 0x0, 0xD, 0x0, 0xB0, 0xEE, 0x0, 0xD, 0x0, 0xB8, 0xEE, 0x0, 0xD, 0x0, 0xC0, 0xEE, 0x0, 0xD, 0x0, 0xC8, 0xEE, 0x0, 0xD, 0x0, 0xD0, 0xEE, 0x0, 0xD, 0x0, 0xD8, 0xEE, 0x0, 0xD, 0x0, 0xE0, 0xEE, 0x0, 0xD, 0x0, 0xE8, 0xEE, 0x0, 0xD, 0x0, 0xF0, 0xEE, 0x0, 0xD, 0x0, 0xF8, 0xEE, 0x0, 0xD, 0x0, 0x0, 0xEF, 0x0, 0xD, 0x0, 0x8, 0xEF, 0x0, 0xD, 0x0, 0x10, 0xEF, 0x0, 0xD, 0x0, 0x18, 0xEF, 0x0, 0xD, 0x0, 0x20, 0xEF, 0x0, 0xD, 0x0, 0x28, 0xEF, 0x0, 0xD, 0x0, 0x30, 0xEF, 0x0, 0xD, 0x0, 0x38, 0xEF, 0x0, 0xD, 0x0, 0x40, 0xEF, 0x0, 0xD, 0x0, 0x48, 0xEF, 0x0, 0xD, 0x0, 0x50, 0xEF, 0x0, 0xD, 0x0, 0x58, 0xEF, 0x0, 0xD, 0x0, 0x60, 0xEF, 0x0, 0xD, 0x0, 0x68, 0xEF, 0x0, 0xD, 0x0, 0x70, 0xEF, 0x0, 0xD, 0x0, 0x78, 0xEF, 0x0, 0xD, 0x0, 0x80, 0xEF, 0x0, 0xD, 0x0, 0x88, 0xEF, 0x0, 0xD, 0x0, 0x90, 0xEF, 0x0, 0xD, 0x0, 0x98, 0xEF, 0x0, 0x8E, 0xBE, 0x3, 0x0, 0x0, 0xAE, 0xBE, 0x3, 0x0, 0x0, 0xCE, 0xBE, 0x3, 0x0, 0x0, 0xEE, 0xBE, 0x3, 0x0, 0x0, 0xE, 0xBF, 0x3, 0x0, 0x0, 0x2E, 0xBF, 0x3, 0x0, 0x0, 0x4E, 0xBF, 0x3, 0x0, 0x0, 0x6E, 0xBF, 0x3, 0x0, 0x0, 0x8E, 0xBF, 0x3, 0x0, 0x0, 0xAE, 0xBF, 0x3, 0x0, 0x0, 0xCE, 0xBF, 0x3, 0x0, 0x0, 0xEE, 0xBF, 0x3, 0x0, 0x0, 0xE, 0xC0, 0x3, 0x0, 0x0, 0x2E, 0xC0, 0x3, 0x0, 0x0, 0x4E, 0xC0, 0x3, 0x0, 0x0, 0x6E, 0xC0, 0x3, 0x0, 0x0, 0x8E, 0xC0, 0x3, 0x0, 0x0, 0xAE, 0xC0, 0x3, 0x0, 0x0, 0xCE, 0xC0, 0x3, 0x0, 0x0, 0xEE, 0xC0, 0x3, 0x0, 0x0, 0xE, 0xC1, 0x3, 0x0, 0x0, 0x2E, 0xC1, 0x3, 0x0, 0x0, 0x4E, 0xC1, 0x3, 0x0, 0x0, 0x6E, 0xC1, 0x3, 0x0, 0x0, 0x8E, 0xC1, 0x3, 0x0, 0x0, 0xAE, 0xC1, 0x3, 0x0, 0x0, 0xE, 0x0, 0x70, 0xF0, 0x0, 0xE, 0x0, 0x78, 0xF0, 0x0, 0xE, 0x0, 0x80, 0xF0, 0x0, 0xE, 0x0, 0x88, 0xF0, 0x0, 0xE, 0x0, 0x90, 0xF0, 0x0, 0xE, 0x0, 0x98, 0xF0, 0x0, 0xE, 0x0, 0xA0, 0xF0, 0x0, 0xE, 0x0, 0xA8, 0xF0, 0x0, 0xE, 0x0, 0xB0, 0xF0, 0x0, 0xE, 0x0, 0xB8, 0xF0, 0x0, 0xE, 0x0, 0xC0, 0xF0, 0x0, 0xE, 0x0, 0xC8, 0xF0, 0x0, 0xE, 0x0, 0xD0, 0xF0, 0x0, 0xE, 0x0, 0xD8, 0xF0, 0x0, 0xE, 0x0, 0xE0, 0xF0, 0x0, 0xE, 0x0, 0xE8, 0xF0, 0x0, 0xE, 0x0, 0xF0, 0xF0, 0x0, 0xE, 0x0, 0xF8, 0xF0, 0x0, 0xE, 0x0, 0x0, 0xF1, 0x0, 0xE, 0x0, 0x8, 0xF1, 0x0, 0xE, 0x0, 0x10, 0xF1, 0x0, 0xE, 0x0, 0x18, 0xF1, 0x0, 0xE, 0x0, 0x20, 0xF1, 0x0, 0xE, 0x0, 0x28, 0xF1, 0x0, 0xE, 0x0, 0x30, 0xF1, 0x0, 0xE, 0x0, 0x38, 0xF1, 0x0, 0xE, 0x0, 0x40, 0xF1, 0x0, 0xE, 0x0, 0x48, 0xF1, 0x0, 0xE, 0x0, 0x50, 0xF1, 0x0, 0xE, 0x0, 0x58, 0xF1, 0x0, 0xE, 0x0, 0x60, 0xF1, 0x0, 0xE, 0x0, 0x68, 0xF1, 0x0, 0xE, 0x0, 0x70, 0xF1, 0x0, 0xE, 0x0, 0x78, 0xF1, 0x0, 0xE, 0x0, 0x80, 0xF1, 0x0, 0xE, 0x0, 0x88, 0xF1, 0x0, 0xE, 0x0, 0x90, 0xF1, 0x0, 0xE, 0x0, 0x98, 0xF1, 0x0, 0xE, 0x0, 0xA0, 0xF1, 0x0, 0xE, 0x0, 0xA8, 0xF1, 0x0, 0xE, 0x0, 0xB0, 0xF1, 0x0, 0xE, 0x0, 0xB8, 0xF1, 0x0, 0xE, 0x0, 0xC0, 0xF1, 0x0, 0xE, 0x0, 0xC8, 0xF1, 0x0, 0xE, 0x0, 0xD0, 0xF1, 0x0, 0xE, 0x0, 0xD8, 0xF1, 0x0, 0xE, 0x0, 0xE0, 0xF1, 0x0, 0xE, 0x0, 0xE8, 0xF1, 0x0, 0xE, 0x0, 0xF0, 0xF1, 0x0, 0xE, 0x0, 0xF8, 0xF1, 0x0, 0xE, 0x0, 0x0, 0xF2, 0x0, 0xE, 0x0, 0x8, 0xF2, 0x0, 0xE, 0x0, 0x10, 0xF2, 0x0, 0xE, 0x0, 0x18, 0xF2, 0x0, 0xE, 0x0, 0x20, 0xF2, 0x0, 0xE, 0x0, 0x28, 0xF2, 0x0, 0xE, 0x0, 0x30, 0xF2, 0x0, 0xE, 0x0, 0x38, 0xF2, 0x0, 0xE, 0x0, 0x40, 0xF2, 0x0, 0xE, 0x0, 0x48, 0xF2, 0x0, 0xE, 0x0, 0x50, 0xF2, 0x0, 0xE, 0x0, 0x58, 0xF2, 0x0, 0xE, 0x0, 0x60, 0xF2, 0x0, 0xE, 0x0, 0x68, 0xF2, 0x0, 0xE, 0x0, 0x70, 0xF2, 0x0, 0xE, 0x0, 0x78, 0xF2, 0x0, 0xE, 0x0, 0x80, 0xF2, 0x0, 0xE, 0x0, 0x88, 0xF2, 0x0, 0xE, 0x0, 0x90, 0xF2, 0x0, 0xE, 0x0, 0x98, 0xF2, 0x0, 0xE, 0x0, 0xA0, 0xF2, 0x0, 0xE, 0x0, 0xA8, 0xF2, 0x0, 0xE, 0x0, 0xB0, 0xF2, 0x0, 0xE, 0x0, 0xB8, 0xF2, 0x0, 0xE, 0x0, 0xC0, 0xF2, 0x0, 0xE, 0x0, 0xC8, 0xF2, 0x0, 0xE, 0x0, 0xD0, 0xF2, 0x0, 0xE, 0x0, 0xD8, 0xF2, 0x0, 0xE, 0x0, 0xE0, 0xF2, 0x0, 0xE, 0x0, 0xE8, 0xF2, 0x0, 0xE, 0x0, 0xF0, 0xF2, 0x0, 0xE, 0x0, 0xF8, 0xF2, 0x0, 0xE, 0x0, 0x0, 0xF3, 0x0, 0xE, 0x0, 0x8, 0xF3, 0x0, 0xE, 0x0, 0x10, 0xF3, 0x0, 0xE, 0x0, 0x18, 0xF3, 0x0, 0xE, 0x0, 0x20, 0xF3, 0x0, 0xE, 0x0, 0x28, 0xF3, 0x0, 0xE, 0x0, 0x30, 0xF3, 0x0, 0xE, 0x0, 0x38, 0xF3, 0x0, 0xE, 0x0, 0x40, 0xF3, 0x0, 0xE, 0x0, 0x48, 0xF3, 0x0, 0xE, 0x0, 0x50, 0xF3, 0x0, 0xE, 0x0, 0x58, 0xF3, 0x0, 0xE, 0x0, 0x60, 0xF3, 0x0, 0xE, 0x0, 0x68, 0xF3, 0x0, 0xE, 0x0, 0x70, 0xF3, 0x0, 0xE, 0x0, 0x78, 0xF3, 0x0, 0xE, 0x0, 0x80, 0xF3, 0x0, 0xE, 0x0, 0x88, 0xF3, 0x0, 0xE, 0x0, 0x90, 0xF3, 0x0, 0xE, 0x0, 0x98, 0xF3, 0x0, 0xE, 0x0, 0xA0, 0xF3, 0x0, 0xE, 0x0, 0xA8, 0xF3, 0x0, 0xE, 0x0, 0xB0, 0xF3, 0x0, 0xE, 0x0, 0xB8, 0xF3, 0x0, 0xE, 0x0, 0xC0, 0xF3, 0x0, 0xE, 0x0, 0xC8, 0xF3, 0x0, 0xE, 0x0, 0xD0, 0xF3, 0x0, 0xE, 0x0, 0xD8, 0xF3, 0x0, 0xE, 0x0, 0xE0, 0xF3, 0x0, 0xE, 0x0, 0xE8, 0xF3, 0x0, 0xE, 0x0, 0xF0, 0xF3, 0x0, 0xE, 0x0, 0xF8, 0xF3, 0x0, 0xE, 0x0, 0x0, 0xF4, 0x0, 0xE, 0x0, 0x8, 0xF4, 0x0, 0xE, 0x0, 0x10, 0xF4, 0x0, 0xE, 0x0, 0x18, 0xF4, 0x0, 0xE, 0x0, 0x20, 0xF4, 0x0, 0xE, 0x0, 0x28, 0xF4, 0x0, 0xE, 0x0, 0x30, 0xF4, 0x0, 0xE, 0x0, 0x38, 0xF4, 0x0, 0xE, 0x0, 0x40, 0xF4, 0x0, 0xE, 0x0, 0x48, 0xF4, 0x0, 0xE, 0x0, 0x50, 0xF4, 0x0, 0xE, 0x0, 0x58, 0xF4, 0x0, 0xE, 0x0, 0x60, 0xF4, 0x0, 0xE, 0x0, 0x68, 0xF4, 0x0, 0xE, 0x0, 0x70, 0xF4, 0x0, 0xE, 0x0, 0x78, 0xF4, 0x0, 0xE, 0x0, 0x80, 0xF4, 0x0, 0xE, 0x0, 0x88, 0xF4, 0x0, 0xE, 0x0, 0x90, 0xF4, 0x0, 0xE, 0x0, 0x98, 0xF4, 0x0, 0xE, 0x0, 0xA0, 0xF4, 0x0, 0xE, 0x0, 0xA8, 0xF4, 0x0, 0xE, 0x0, 0xB0, 0xF4, 0x0, 0xE, 0x0, 0xB8, 0xF4, 0x0, 0xE, 0x0, 0xC0, 0xF4, 0x0, 0xE, 0x0, 0xC8, 0xF4, 0x0, 0xE, 0x0, 0xD0, 0xF4, 0x0, 0xE, 0x0, 0xD8, 0xF4, 0x0, 0xE, 0x0, 0xE0, 0xF4, 0x0, 0xE, 0x0, 0xE8, 0xF4, 0x0, 0xE, 0x0, 0xF0, 0xF4, 0x0, 0xE, 0x0, 0xF8, 0xF4, 0x0, 0xE, 0x0, 0x0, 0xF5, 0x0, 0xE, 0x0, 0x8, 0xF5, 0x0, 0xE, 0x0, 0x10, 0xF5, 0x0, 0xE, 0x0, 0x18, 0xF5, 0x0, 0xE, 0x0, 0x20, 0xF5, 0x0, 0xE, 0x0, 0x28, 0xF5, 0x0, 0xE, 0x0, 0x30, 0xF5, 0x0, 0xE, 0x0, 0x38, 0xF5, 0x0, 0xE, 0x0, 0x40, 0xF5, 0x0, 0xE, 0x0, 0x48, 0xF5, 0x0, 0xE, 0x0, 0x50, 0xF5, 0x0, 0xE, 0x0, 0x58, 0xF5, 0x0, 0xE, 0x0, 0x60, 0xF5, 0x0, 0xE, 0x0, 0x68, 0xF5, 0x0, 0xE, 0x0, 0x70, 0xF5, 0x0, 0xE, 0x0, 0x78, 0xF5, 0x0, 0xE, 0x0, 0x80, 0xF5, 0x0, 0xE, 0x0, 0x88, 0xF5, 0x0, 0xE, 0x0, 0x90, 0xF5, 0x0, 0xE, 0x0, 0x98, 0xF5, 0x0, 0xE, 0x0, 0xA0, 0xF5, 0x0, 0xE, 0x0, 0xA8, 0xF5, 0x0, 0xE, 0x0, 0xB0, 0xF5, 0x0, 0xE, 0x0, 0xB8, 0xF5, 0x0, 0xE, 0x0, 0xC0, 0xF5, 0x0, 0xE, 0x0, 0xC8, 0xF5, 0x0, 0xE, 0x0, 0xD0, 0xF5, 0x0, 0xE, 0x0, 0xD8, 0xF5, 0x0, 0xE, 0x0, 0xE0, 0xF5, 0x0, 0xE, 0x0, 0xE8, 0xF5, 0x0, 0xE, 0x0, 0xF0, 0xF5, 0x0, 0xE, 0x0, 0xF8, 0xF5, 0x0, 0xE, 0x0, 0x0, 0xF6, 0x0, 0xE, 0x0, 0x8, 0xF6, 0x0, 0xE, 0x0, 0x10, 0xF6, 0x0, 0xE, 0x0, 0x18, 0xF6, 0x0, 0xE, 0x0, 0x20, 0xF6, 0x0, 0xE, 0x0, 0x28, 0xF6, 0x0, 0xE, 0x0, 0x30, 0xF6, 0x0, 0xE, 0x0, 0x38, 0xF6, 0x0, 0xE, 0x0, 0x40, 0xF6, 0x0, 0xE, 0x0, 0x48, 0xF6, 0x0, 0xE, 0x0, 0x50, 0xF6, 0x0, 0xE, 0x0, 0x58, 0xF6, 0x0, 0xE, 0x0, 0x60, 0xF6, 0x0, 0xE, 0x0, 0x68, 0xF6, 0x0, 0xE, 0x0, 0x70, 0xF6, 0x0, 0xE, 0x0, 0x78, 0xF6, 0x0, 0xE, 0x0, 0x80, 0xF6, 0x0, 0xE, 0x0, 0x88, 0xF6, 0x0, 0xE, 0x0, 0x90, 0xF6, 0x0, 0xE, 0x0, 0x98, 0xF6, 0x0, 0xE, 0x0, 0xA0, 0xF6, 0x0, 0xE, 0x0, 0xA8, 0xF6, 0x0, 0xE, 0x0, 0xB0, 0xF6, 0x0, 0xE, 0x0, 0xB8, 0xF6, 0x0, 0xE, 0x0, 0xC0, 0xF6, 0x0, 0xE, 0x0, 0xC8, 0xF6, 0x0, 0xE, 0x0, 0xD0, 0xF6, 0x0, 0xE, 0x0, 0xD8, 0xF6, 0x0, 0xE, 0x0, 0xE0, 0xF6, 0x0, 0xE, 0x0, 0xE8, 0xF6, 0x0, 0xE, 0x0, 0xF0, 0xF6, 0x0, 0xE, 0x0, 0xF8, 0xF6, 0x0, 0xE, 0x0, 0x0, 0xF7, 0x0, 0xE, 0x0, 0x8, 0xF7, 0x0, 0xE, 0x0, 0x10, 0xF7, 0x0, 0xE, 0x0, 0x18, 0xF7, 0x0, 0xE, 0x0, 0x20, 0xF7, 0x0, 0xE, 0x0, 0x28, 0xF7, 0x0, 0xE, 0x0, 0x30, 0xF7, 0x0, 0xE, 0x0, 0x38, 0xF7, 0x0, 0xE, 0x0, 0x40, 0xF7, 0x0, 0xE, 0x0, 0x48, 0xF7, 0x0, 0xE, 0x0, 0x50, 0xF7, 0x0, 0xE, 0x0, 0x58, 0xF7, 0x0, 0xE, 0x0, 0x60, 0xF7, 0x0, 0xE, 0x0, 0x68, 0xF7, 0x0, 0xE, 0x0, 0x70, 0xF7, 0x0, 0xE, 0x0, 0x78, 0xF7, 0x0, 0xE, 0x0, 0x80, 0xF7, 0x0, 0xE, 0x0, 0x88, 0xF7, 0x0, 0xE, 0x0, 0x90, 0xF7, 0x0, 0xE, 0x0, 0x98, 0xF7, 0x0, 0xE, 0x0, 0xA0, 0xF7, 0x0, 0xE, 0x0, 0xA8, 0xF7, 0x0, 0xE, 0x0, 0xB0, 0xF7, 0x0, 0xE, 0x0, 0xB8, 0xF7, 0x0, 0xE, 0x0, 0xC0, 0xF7, 0x0, 0xE, 0x0, 0xC8, 0xF7, 0x0, 0xE, 0x0, 0xD0, 0xF7, 0x0, 0xE, 0x0, 0xD8, 0xF7, 0x0, 0xE, 0x0, 0xE0, 0xF7, 0x0, 0xE, 0x0, 0xE8, 0xF7, 0x0, 0xE, 0x0, 0xF0, 0xF7, 0x0, 0xE, 0x0, 0xF8, 0xF7, 0x0, 0xE, 0x0, 0x0, 0xF8, 0x0, 0xE, 0x0, 0x8, 0xF8, 0x0, 0xE, 0x0, 0x10, 0xF8, 0x0, 0xE, 0x0, 0x18, 0xF8, 0x0, 0xE, 0x0, 0x20, 0xF8, 0x0, 0xE, 0x0, 0x28, 0xF8, 0x0, 0xE, 0x0, 0x30, 0xF8, 0x0, 0xE, 0x0, 0x38, 0xF8, 0x0, 0xE, 0x0, 0x40, 0xF8, 0x0, 0xE, 0x0, 0x48, 0xF8, 0x0, 0xE, 0x0, 0x50, 0xF8, 0x0, 0xE, 0x0, 0x58, 0xF8, 0x0, 0xE, 0x0, 0x60, 0xF8, 0x0, 0xE, 0x0, 0x68, 0xF8, 0x0, 0xE, 0x0, 0x70, 0xF8, 0x0, 0xE, 0x0, 0x78, 0xF8, 0x0, 0xE, 0x0, 0x80, 0xF8, 0x0, 0xE, 0x0, 0x88, 0xF8, 0x0, 0xE, 0x0, 0x90, 0xF8, 0x0, 0xE, 0x0, 0x98, 0xF8, 0x0, 0xE, 0x0, 0xA0, 0xF8, 0x0, 0xE, 0x0, 0xA8, 0xF8, 0x0, 0xE, 0x0, 0xB0, 0xF8, 0x0, 0xE, 0x0, 0xB8, 0xF8, 0x0, 0xE, 0x0, 0xC0, 0xF8, 0x0, 0xE, 0x0, 0xC8, 0xF8, 0x0, 0xE, 0x0, 0xD0, 0xF8, 0x0, 0xE, 0x0, 0xD8, 0xF8, 0x0, 0xE, 0x0, 0xE0, 0xF8, 0x0, 0xE, 0x0, 0xE8, 0xF8, 0x0, 0xE, 0x0, 0xF0, 0xF8, 0x0, 0xE, 0x0, 0xF8, 0xF8, 0x0, 0xE, 0x0, 0x0, 0xF9, 0x0, 0xE, 0x0, 0x8, 0xF9, 0x0, 0xE, 0x0, 0x10, 0xF9, 0x0, 0xE, 0x0, 0x18, 0xF9, 0x0, 0xE, 0x0, 0x20, 0xF9, 0x0, 0xE, 0x0, 0x28, 0xF9, 0x0, 0xE, 0x0, 0x30, 0xF9, 0x0, 0xE, 0x0, 0x38, 0xF9, 0x0, 0xE, 0x0, 0x40, 0xF9, 0x0, 0xE, 0x0, 0x48, 0xF9, 0x0, 0xE, 0x0, 0x50, 0xF9, 0x0, 0xE, 0x0, 0x58, 0xF9, 0x0, 0xE, 0x0, 0x60, 0xF9, 0x0, 0xE, 0x0, 0x68, 0xF9, 0x0, 0xE, 0x0, 0x70, 0xF9, 0x0, 0xE, 0x0, 0x78, 0xF9, 0x0, 0xE, 0x0, 0x80, 0xF9, 0x0, 0xE, 0x0, 0x88, 0xF9, 0x0, 0xE, 0x0, 0x90, 0xF9, 0x0, 0xE, 0x0, 0x98, 0xF9, 0x0, 0xE, 0x0, 0xA0, 0xF9, 0x0, 0xE, 0x0, 0xA8, 0xF9, 0x0, 0xE, 0x0, 0xB0, 0xF9, 0x0, 0xE, 0x0, 0xB8, 0xF9, 0x0, 0xE, 0x0, 0xC0, 0xF9, 0x0, 0xE, 0x0, 0xC8, 0xF9, 0x0, 0xE, 0x0, 0xD0, 0xF9, 0x0, 0xE, 0x0, 0xD8, 0xF9, 0x0, 0xE, 0x0, 0xE0, 0xF9, 0x0, 0xE, 0x0, 0xE8, 0xF9, 0x0, 0xE, 0x0, 0xF0, 0xF9, 0x0, 0xE, 0x0, 0xF8, 0xF9, 0x0, 0xE, 0x0, 0x0, 0xFA, 0x0, 0xE, 0x0, 0x8, 0xFA, 0x0, 0xE, 0x0, 0x10, 0xFA, 0x0, 0xE, 0x0, 0x18, 0xFA, 0x0, 0xE, 0x0, 0x20, 0xFA, 0x0, 0xE, 0x0, 0x28, 0xFA, 0x0, 0xE, 0x0, 0x30, 0xFA, 0x0, 0xE, 0x0, 0x38, 0xFA, 0x0, 0xE, 0x0, 0x40, 0xFA, 0x0, 0xE, 0x0, 0x48, 0xFA, 0x0, 0xE, 0x0, 0x50, 0xFA, 0x0, 0xE, 0x0, 0x58, 0xFA, 0x0, 0xE, 0x0, 0x60, 0xFA, 0x0, 0xE, 0x0, 0x68, 0xFA, 0x0, 0xE, 0x0, 0x70, 0xFA, 0x0, 0xE, 0x0, 0x78, 0xFA, 0x0, 0xE, 0x0, 0x80, 0xFA, 0x0, 0xE, 0x0, 0x88, 0xFA, 0x0, 0xE, 0x0, 0x90, 0xFA, 0x0, 0xE, 0x0, 0x98, 0xFA, 0x0, 0xE, 0x0, 0xA0, 0xFA, 0x0, 0xE, 0x0, 0xA8, 0xFA, 0x0, 0xE, 0x0, 0xB0, 0xFA, 0x0, 0xE, 0x0, 0xB8, 0xFA, 0x0, 0xE, 0x0, 0xC0, 0xFA, 0x0, 0xE, 0x0, 0xC8, 0xFA, 0x0, 0xE, 0x0, 0xD0, 0xFA, 0x0, 0xE, 0x0, 0xD8, 0xFA, 0x0, 0xE, 0x0, 0xE0, 0xFA, 0x0, 0xE, 0x0, 0xE8, 0xFA, 0x0, 0xE, 0x0, 0xF0, 0xFA, 0x0, 0xE, 0x0, 0xF8, 0xFA, 0x0, 0xE, 0x0, 0x0, 0xFB, 0x0, 0xE, 0x0, 0x8, 0xFB, 0x0, 0xE, 0x0, 0x10, 0xFB, 0x0, 0xE, 0x0, 0x18, 0xFB, 0x0, 0xE, 0x0, 0x20, 0xFB, 0x0, 0xE, 0x0, 0x28, 0xFB, 0x0, 0xE, 0x0, 0x30, 0xFB, 0x0, 0xE, 0x0, 0x38, 0xFB, 0x0, 0xE, 0x0, 0x40, 0xFB, 0x0, 0xE, 0x0, 0x48, 0xFB, 0x0, 0xE, 0x0, 0x50, 0xFB, 0x0, 0xE, 0x0, 0x58, 0xFB, 0x0, 0xE, 0x0, 0x60, 0xFB, 0x0, 0xE, 0x0, 0x68, 0xFB, 0x0, 0xE, 0x0, 0x70, 0xFB, 0x0, 0xE, 0x0, 0x78, 0xFB, 0x0, 0xE, 0x0, 0x80, 0xFB, 0x0, 0xE, 0x0, 0x88, 0xFB, 0x0, 0xE, 0x0, 0x90, 0xFB, 0x0, 0xE, 0x0, 0x98, 0xFB, 0x0, 0xE, 0x0, 0xA0, 0xFB, 0x0, 0xE, 0x0, 0xA8, 0xFB, 0x0, 0xE, 0x0, 0xB0, 0xFB, 0x0, 0xE, 0x0, 0xB8, 0xFB, 0x0, 0xE, 0x0, 0xC0, 0xFB, 0x0, 0xE, 0x0, 0xC8, 0xFB, 0x0, 0xE, 0x0, 0xD0, 0xFB, 0x0, 0xE, 0x0, 0xD8, 0xFB, 0x0, 0xE, 0x0, 0xE0, 0xFB, 0x0, 0xE, 0x0, 0xE8, 0xFB, 0x0, 0xE, 0x0, 0xF0, 0xFB, 0x0, 0xE, 0x0, 0xF8, 0xFB, 0x0, 0xE, 0x0, 0x0, 0xFC, 0x0, 0xE, 0x0, 0x8, 0xFC, 0x0, 0xE, 0x0, 0x10, 0xFC, 0x0, 0xE, 0x0, 0x18, 0xFC, 0x0, 0xE, 0x0, 0x20, 0xFC, 0x0, 0xE, 0x0, 0x28, 0xFC, 0x0, 0xE, 0x0, 0x30, 0xFC, 0x0, 0xE, 0x0, 0x38, 0xFC, 0x0, 0xE, 0x0, 0x40, 0xFC, 0x0, 0xE, 0x0, 0x48, 0xFC, 0x0, 0xE, 0x0, 0x50, 0xFC, 0x0, 0xE, 0x0, 0x58, 0xFC, 0x0, 0xE, 0x0, 0x60, 0xFC, 0x0, 0xE, 0x0, 0x68, 0xFC, 0x0, 0xE, 0x0, 0x70, 0xFC, 0x0, 0xE, 0x0, 0x78, 0xFC, 0x0, 0xE, 0x0, 0x80, 0xFC, 0x0, 0xE, 0x0, 0x88, 0xFC, 0x0, 0xE, 0x0, 0x90, 0xFC, 0x0, 0xE, 0x0, 0x98, 0xFC, 0x0, 0xE, 0x0, 0xA0, 0xFC, 0x0, 0xE, 0x0, 0xA8, 0xFC, 0x0, 0xE, 0x0, 0xB0, 0xFC, 0x0, 0xE, 0x0, 0xB8, 0xFC, 0x0, 0xE, 0x0, 0xC0, 0xFC, 0x0, 0xE, 0x0, 0xC8, 0xFC, 0x0, 0xE, 0x0, 0xD0, 0xFC, 0x0, 0xE, 0x0, 0xD8, 0xFC, 0x0, 0xE, 0x0, 0xE0, 0xFC, 0x0, 0xE, 0x0, 0xE8, 0xFC, 0x0, 0xE, 0x0, 0xF0, 0xFC, 0x0, 0xE, 0x0, 0xF8, 0xFC, 0x0, 0xE, 0x0, 0x0, 0xFD, 0x0, 0xE, 0x0, 0x8, 0xFD, 0x0, 0xE, 0x0, 0x10, 0xFD, 0x0, 0xE, 0x0, 0x18, 0xFD, 0x0, 0xE, 0x0, 0x20, 0xFD, 0x0, 0xE, 0x0, 0x28, 0xFD, 0x0, 0xE, 0x0, 0x30, 0xFD, 0x0, 0xE, 0x0, 0x38, 0xFD, 0x0, 0xE, 0x0, 0x40, 0xFD, 0x0, 0xE, 0x0, 0x48, 0xFD, 0x0, 0xE, 0x0, 0x50, 0xFD, 0x0, 0xE, 0x0, 0x58, 0xFD, 0x0, 0xE, 0x0, 0x60, 0xFD, 0x0, 0xE, 0x0, 0x68, 0xFD, 0x0, 0xE, 0x0, 0x70, 0xFD, 0x0, 0xE, 0x0, 0x78, 0xFD, 0x0, 0xE, 0x0, 0x80, 0xFD, 0x0, 0xE, 0x0, 0x88, 0xFD, 0x0, 0xE, 0x0, 0x90, 0xFD, 0x0, 0xE, 0x0, 0x98, 0xFD, 0x0, 0xE, 0x0, 0xA0, 0xFD, 0x0, 0xE, 0x0, 0xA8, 0xFD, 0x0, 0xE, 0x0, 0xB0, 0xFD, 0x0, 0xE, 0x0, 0xB8, 0xFD, 0x0, 0xE, 0x0, 0xC0, 0xFD, 0x0, 0xE, 0x0, 0xC8, 0xFD, 0x0, 0xE, 0x0, 0xD0, 0xFD, 0x0, 0xE, 0x0, 0xD8, 0xFD, 0x0, 0xE, 0x0, 0xE0, 0xFD, 0x0, 0xE, 0x0, 0xE8, 0xFD, 0x0, 0xE, 0x0, 0xF0, 0xFD, 0x0, 0xE, 0x0, 0xF8, 0xFD, 0x0, 0xE, 0x0, 0x0, 0xFE, 0x0, 0xE, 0x0, 0x8, 0xFE, 0x0, 0xE, 0x0, 0x10, 0xFE, 0x0, 0xE, 0x0, 0x18, 0xFE, 0x0, 0xE, 0x0, 0x20, 0xFE, 0x0, 0xE, 0x0, 0x28, 0xFE, 0x0, 0xE, 0x0, 0x30, 0xFE, 0x0, 0xE, 0x0, 0x38, 0xFE, 0x0, 0xE, 0x0, 0x40, 0xFE, 0x0, 0xE, 0x0, 0x48, 0xFE, 0x0, 0xE, 0x0, 0x50, 0xFE, 0x0, 0xE, 0x0, 0x58, 0xFE, 0x0, 0xE, 0x0, 0x60, 0xFE, 0x0, 0xE, 0x0, 0x68, 0xFE, 0x0, 0xE, 0x0, 0x70, 0xFE, 0x0, 0xE, 0x0, 0x78, 0xFE, 0x0, 0xE, 0x0, 0x80, 0xFE, 0x0, 0xE, 0x0, 0x88, 0xFE, 0x0, 0xE, 0x0, 0x90, 0xFE, 0x0, 0xE, 0x0, 0x98, 0xFE, 0x0, 0xE, 0x0, 0xA0, 0xFE, 0x0, 0xE, 0x0, 0xA8, 0xFE, 0x0, 0xE, 0x0, 0xB0, 0xFE, 0x0, 0xE, 0x0, 0xB8, 0xFE, 0x0, 0xE, 0x0, 0xC0, 0xFE, 0x0, 0xE, 0x0, 0xC8, 0xFE, 0x0, 0xE, 0x0, 0xD0, 0xFE, 0x0, 0xE, 0x0, 0xD8, 0xFE, 0x0, 0xE, 0x0, 0xE0, 0xFE, 0x0, 0xE, 0x0, 0xE8, 0xFE, 0x0, 0xE, 0x0, 0xF0, 0xFE, 0x0, 0xE, 0x0, 0xF8, 0xFE, 0x0, 0xE, 0x0, 0x0, 0xFF, 0x0, 0xE, 0x0, 0x8, 0xFF, 0x0, 0xE, 0x0, 0x10, 0xFF, 0x0, 0xE, 0x0, 0x18, 0xFF, 0x0, 0xE, 0x0, 0x20, 0xFF, 0x0, 0xE, 0x0, 0x28, 0xFF, 0x0, 0xE, 0x0, 0x30, 0xFF, 0x0, 0xE, 0x0, 0x38, 0xFF, 0x0, 0xE, 0x0, 0x40, 0xFF, 0x0, 0xE, 0x0, 0x48, 0xFF, 0x0, 0xE, 0x0, 0x50, 0xFF, 0x0, 0xE, 0x0, 0x58, 0xFF, 0x0, 0xE, 0x0, 0x60, 0xFF, 0x0, 0xE, 0x0, 0x68, 0xFF, 0x0, 0xE, 0x0, 0x70, 0xFF, 0x0, 0xE, 0x0, 0x78, 0xFF, 0x0, 0xE, 0x0, 0x80, 0xFF, 0x0, 0xE, 0x0, 0x88, 0xFF, 0x0, 0xE, 0x0, 0x90, 0xFF, 0x0, 0xE, 0x0, 0x98, 0xFF, 0x0, 0xE, 0x0, 0xA0, 0xFF, 0x0, 0xE, 0x0, 0xA8, 0xFF, 0x0, 0xE, 0x0, 0xB0, 0xFF, 0x0, 0xE, 0x0, 0xB8, 0xFF, 0x0, 0xE, 0x0, 0xC0, 0xFF, 0x0, 0xE, 0x0, 0xC8, 0xFF, 0x0, 0xE, 0x0, 0xD0, 0xFF, 0x0, 0xE, 0x0, 0xD8, 0xFF, 0x0, 0xE, 0x0, 0xE0, 0xFF, 0x0, 0xE, 0x0, 0xE8, 0xFF, 0x0, 0xE, 0x0, 0xF0, 0xFF, 0x0, 0xE, 0x0, 0xF8, 0xFF, 0x0, 0xE, 0x0, 0x0, 0x0, 0x1, 0xE, 0x0, 0x8, 0x0, 0x1, 0xE, 0x0, 0x10, 0x0, 0x1, 0xE, 0x0, 0x18, 0x0, 0x1, 0xE, 0x0, 0x20, 0x0, 0x1, 0xE, 0x0, 0x28, 0x0, 0x1, 0xE, 0x0, 0x30, 0x0, 0x1, 0xE, 0x0, 0x38, 0x0, 0x1, 0xE, 0x0, 0x40, 0x0, 0x1, 0xE, 0x0, 0x48, 0x0, 0x1, 0xE, 0x0, 0x50, 0x0, 0x1, 0xE, 0x0, 0x58, 0x0, 0x1, 0xE, 0x0, 0x60, 0x0, 0x1, 0xE, 0x0, 0x68, 0x0, 0x1, 0xE, 0x0, 0x70, 0x0, 0x1, 0xE, 0x0, 0x78, 0x0, 0x1, 0xE, 0x0, 0x80, 0x0, 0x1, 0xE, 0x0, 0x88, 0x0, 0x1, 0xE, 0x0, 0x90, 0x0, 0x1, 0xE, 0x0, 0x98, 0x0, 0x1, 0xE, 0x0, 0xA0, 0x0, 0x1, 0xE, 0x0, 0xA8, 0x0, 0x1, 0xE, 0x0, 0xB0, 0x0, 0x1, 0xE, 0x0, 0xB8, 0x0, 0x1, 0xE, 0x0, 0xC0, 0x0, 0x1, 0xE, 0x0, 0xC8, 0x0, 0x1, 0xE, 0x0, 0xD0, 0x0, 0x1, 0xE, 0x0, 0xD8, 0x0, 0x1, 0xE, 0x0, 0xE0, 0x0, 0x1, 0xE, 0x0, 0xE8, 0x0, 0x1, 0xE, 0x0, 0xF0, 0x0, 0x1, 0xE, 0x0, 0xF8, 0x0, 0x1, 0xE, 0x0, 0x0, 0x1, 0x1, 0xE, 0x0, 0x8, 0x1, 0x1, 0xE, 0x0, 0x10, 0x1, 0x1, 0xE, 0x0, 0x18, 0x1, 0x1, 0xE, 0x0, 0x20, 0x1, 0x1, 0xE, 0x0, 0x28, 0x1, 0x1, 0xE, 0x0, 0x30, 0x1, 0x1, 0xE, 0x0, 0x38, 0x1, 0x1, 0xE, 0x0, 0x40, 0x1, 0x1, 0xE, 0x0, 0x48, 0x1, 0x1, 0xE, 0x0, 0x50, 0x1, 0x1, 0xE, 0x0, 0x58, 0x1, 0x1, 0xE, 0x0, 0x60, 0x1, 0x1, 0xE, 0x0, 0x68, 0x1, 0x1, 0xE, 0x0, 0x70, 0x1, 0x1, 0xE, 0x0, 0x78, 0x1, 0x1, 0xE, 0x0, 0x80, 0x1, 0x1, 0xE, 0x0, 0x88, 0x1, 0x1, 0xE, 0x0, 0x90, 0x1, 0x1, 0xE, 0x0, 0x98, 0x1, 0x1, 0xE, 0x0, 0xA0, 0x1, 0x1, 0xE, 0x0, 0xA8, 0x1, 0x1, 0xE, 0x0, 0xB0, 0x1, 0x1, 0xE, 0x0, 0xB8, 0x1, 0x1, 0xE, 0x0, 0xC0, 0x1, 0x1, 0xE, 0x0, 0xC8, 0x1, 0x1, 0xE, 0x0, 0xD0, 0x1, 0x1, 0xE, 0x0, 0xD8, 0x1, 0x1, 0xE, 0x0, 0xE0, 0x1, 0x1, 0xE, 0x0, 0xE8, 0x1, 0x1, 0xE, 0x0, 0xF0, 0x1, 0x1, 0xE, 0x0, 0xF8, 0x1, 0x1, 0xE, 0x0, 0x0, 0x2, 0x1, 0xE, 0x0, 0x8, 0x2, 0x1, 0xE, 0x0, 0x10, 0x2, 0x1, 0xE, 0x0, 0x18, 0x2, 0x1, 0xE, 0x0, 0x20, 0x2, 0x1, 0xE, 0x0, 0x28, 0x2, 0x1, 0xE, 0x0, 0x30, 0x2, 0x1, 0xE, 0x0, 0x38, 0x2, 0x1, 0xE, 0x0, 0x40, 0x2, 0x1, 0xE, 0x0, 0x48, 0x2, 0x1, 0xE, 0x0, 0x50, 0x2, 0x1, 0xE, 0x0, 0x58, 0x2, 0x1, 0xE, 0x0, 0x60, 0x2, 0x1, 0xE, 0x0, 0x68, 0x2, 0x1, 0xE, 0x0, 0x70, 0x2, 0x1, 0xE, 0x0, 0x78, 0x2, 0x1, 0xE, 0x0, 0x80, 0x2, 0x1, 0xE, 0x0, 0x88, 0x2, 0x1, 0xE, 0x0, 0x90, 0x2, 0x1, 0xE, 0x0, 0x98, 0x2, 0x1, 0xE, 0x0, 0xA0, 0x2, 0x1, 0xE, 0x0, 0xA8, 0x2, 0x1, 0xE, 0x0, 0xB0, 0x2, 0x1, 0xE, 0x0, 0xB8, 0x2, 0x1, 0xE, 0x0, 0xC0, 0x2, 0x1, 0xE, 0x0, 0xC8, 0x2, 0x1, 0xE, 0x0, 0xD0, 0x2, 0x1, 0xE, 0x0, 0xD8, 0x2, 0x1, 0xE, 0x0, 0xE0, 0x2, 0x1, 0xE, 0x0, 0xE8, 0x2, 0x1, 0xE, 0x0, 0xF0, 0x2, 0x1, 0xE, 0x0, 0xF8, 0x2, 0x1, 0xE, 0x0, 0x0, 0x3, 0x1, 0xE, 0x0, 0x8, 0x3, 0x1, 0xE, 0x0, 0x10, 0x3, 0x1, 0xE, 0x0, 0x18, 0x3, 0x1, 0xE, 0x0, 0x20, 0x3, 0x1, 0xE, 0x0, 0x28, 0x3, 0x1, 0xE, 0x0, 0x30, 0x3, 0x1, 0xE, 0x0, 0x38, 0x3, 0x1, 0xE, 0x0, 0x40, 0x3, 0x1, 0xE, 0x0, 0x48, 0x3, 0x1, 0xE, 0x0, 0x50, 0x3, 0x1, 0xE, 0x0, 0x58, 0x3, 0x1, 0xE, 0x0, 0x60, 0x3, 0x1, 0xE, 0x0, 0x68, 0x3, 0x1, 0xE, 0x0, 0x70, 0x3, 0x1, 0xE, 0x0, 0x78, 0x3, 0x1, 0xE, 0x0, 0x80, 0x3, 0x1, 0xE, 0x0, 0x88, 0x3, 0x1, 0xE, 0x0, 0x90, 0x3, 0x1, 0xE, 0x0, 0x98, 0x3, 0x1, 0xE, 0x0, 0xA0, 0x3, 0x1, 0xE, 0x0, 0xA8, 0x3, 0x1, 0xE, 0x0, 0xB0, 0x3, 0x1, 0xE, 0x0, 0xB8, 0x3, 0x1, 0xE, 0x0, 0xC0, 0x3, 0x1, 0xE, 0x0, 0xC8, 0x3, 0x1, 0xE, 0x0, 0xD0, 0x3, 0x1, 0xE, 0x0, 0xD8, 0x3, 0x1, 0xE, 0x0, 0xE0, 0x3, 0x1, 0xE, 0x0, 0xE8, 0x3, 0x1, 0xE, 0x0, 0xF0, 0x3, 0x1, 0xE, 0x0, 0xF8, 0x3, 0x1, 0xE, 0x0, 0x0, 0x4, 0x1, 0xE, 0x0, 0x8, 0x4, 0x1, 0xE, 0x0, 0x10, 0x4, 0x1, 0xE, 0x0, 0x18, 0x4, 0x1, 0xE, 0x0, 0x20, 0x4, 0x1, 0xE, 0x0, 0x28, 0x4, 0x1, 0xE, 0x0, 0x30, 0x4, 0x1, 0xE, 0x0, 0x38, 0x4, 0x1, 0xE, 0x0, 0x40, 0x4, 0x1, 0xE, 0x0, 0x48, 0x4, 0x1, 0xE, 0x0, 0x50, 0x4, 0x1, 0xE, 0x0, 0x58, 0x4, 0x1, 0xE, 0x0, 0x60, 0x4, 0x1, 0xE, 0x0, 0x68, 0x4, 0x1, 0xE, 0x0, 0x70, 0x4, 0x1, 0xE, 0x0, 0x78, 0x4, 0x1, 0xE, 0x0, 0x80, 0x4, 0x1, 0xE, 0x0, 0x88, 0x4, 0x1, 0xE, 0x0, 0x90, 0x4, 0x1, 0xE, 0x0, 0x98, 0x4, 0x1, 0xE, 0x0, 0xA0, 0x4, 0x1, 0xE, 0x0, 0xA8, 0x4, 0x1, 0xE, 0x0, 0xB0, 0x4, 0x1, 0xE, 0x0, 0xB8, 0x4, 0x1, 0xE, 0x0, 0xC0, 0x4, 0x1, 0xE, 0x0, 0xC8, 0x4, 0x1, 0xE, 0x0, 0xD0, 0x4, 0x1, 0xE, 0x0, 0xD8, 0x4, 0x1, 0xE, 0x0, 0xE0, 0x4, 0x1, 0xE, 0x0, 0xE8, 0x4, 0x1, 0xE, 0x0, 0xF0, 0x4, 0x1, 0xE, 0x0, 0xF8, 0x4, 0x1, 0xE, 0x0, 0x0, 0x5, 0x1, 0xE, 0x0, 0x8, 0x5, 0x1, 0xE, 0x0, 0x10, 0x5, 0x1, 0xE, 0x0, 0x18, 0x5, 0x1, 0xE, 0x0, 0x20, 0x5, 0x1, 0xE, 0x0, 0x28, 0x5, 0x1, 0xE, 0x0, 0x30, 0x5, 0x1, 0xE, 0x0, 0x38, 0x5, 0x1, 0xE, 0x0, 0x40, 0x5, 0x1, 0xE, 0x0, 0x48, 0x5, 0x1, 0xE, 0x0, 0x50, 0x5, 0x1, 0xE, 0x0, 0x58, 0x5, 0x1, 0xE, 0x0, 0x60, 0x5, 0x1, 0xE, 0x0, 0x68, 0x5, 0x1, 0xE, 0x0, 0x70, 0x5, 0x1, 0xE, 0x0, 0x78, 0x5, 0x1, 0xE, 0x0, 0x80, 0x5, 0x1, 0xE, 0x0, 0x88, 0x5, 0x1, 0xE, 0x0, 0x90, 0x5, 0x1, 0xE, 0x0, 0x98, 0x5, 0x1, 0xE, 0x0, 0xA0, 0x5, 0x1, 0xE, 0x0, 0xA8, 0x5, 0x1, 0xE, 0x0, 0xB0, 0x5, 0x1, 0xE, 0x0, 0xB8, 0x5, 0x1, 0xE, 0x0, 0xC0, 0x5, 0x1, 0xE, 0x0, 0xC8, 0x5, 0x1, 0xE, 0x0, 0xD0, 0x5, 0x1, 0xE, 0x0, 0xD8, 0x5, 0x1, 0xE, 0x0, 0xE0, 0x5, 0x1, 0xE, 0x0, 0xE8, 0x5, 0x1, 0xE, 0x0, 0xF0, 0x5, 0x1, 0xE, 0x0, 0xF8, 0x5, 0x1, 0xE, 0x0, 0x0, 0x6, 0x1, 0xE, 0x0, 0x8, 0x6, 0x1, 0xE, 0x0, 0x10, 0x6, 0x1, 0xE, 0x0, 0x18, 0x6, 0x1, 0xE, 0x0, 0x20, 0x6, 0x1, 0xE, 0x0, 0x28, 0x6, 0x1, 0xE, 0x0, 0x30, 0x6, 0x1, 0xE, 0x0, 0x38, 0x6, 0x1, 0xE, 0x0, 0x40, 0x6, 0x1, 0xE, 0x0, 0x48, 0x6, 0x1, 0xE, 0x0, 0x50, 0x6, 0x1, 0xE, 0x0, 0x58, 0x6, 0x1, 0xE, 0x0, 0x60, 0x6, 0x1, 0xE, 0x0, 0x68, 0x6, 0x1, 0xE, 0x0, 0x70, 0x6, 0x1, 0xE, 0x0, 0x78, 0x6, 0x1, 0xE, 0x0, 0x80, 0x6, 0x1, 0xE, 0x0, 0x88, 0x6, 0x1, 0xE, 0x0, 0x90, 0x6, 0x1, 0xE, 0x0, 0x98, 0x6, 0x1, 0xE, 0x0, 0xA0, 0x6, 0x1, 0xE, 0x0, 0xA8, 0x6, 0x1, 0xE, 0x0, 0xB0, 0x6, 0x1, 0xE, 0x0, 0xB8, 0x6, 0x1, 0xE, 0x0, 0xC0, 0x6, 0x1, 0xE, 0x0, 0xC8, 0x6, 0x1, 0xE, 0x0, 0xD0, 0x6, 0x1, 0xE, 0x0, 0xD8, 0x6, 0x1, 0xE, 0x0, 0xE0, 0x6, 0x1, 0xE, 0x0, 0xE8, 0x6, 0x1, 0xE, 0x0, 0xF0, 0x6, 0x1, 0xE, 0x0, 0xF8, 0x6, 0x1, 0xE, 0x0, 0x0, 0x7, 0x1, 0xE, 0x0, 0x8, 0x7, 0x1, 0xE, 0x0, 0x10, 0x7, 0x1, 0xE, 0x0, 0x18, 0x7, 0x1, 0xE, 0x0, 0x20, 0x7, 0x1, 0xE, 0x0, 0x28, 0x7, 0x1, 0xE, 0x0, 0x30, 0x7, 0x1, 0xE, 0x0, 0x38, 0x7, 0x1, 0xE, 0x0, 0x40, 0x7, 0x1, 0xE, 0x0, 0x48, 0x7, 0x1, 0xE, 0x0, 0x50, 0x7, 0x1, 0xE, 0x0, 0x58, 0x7, 0x1, 0xE, 0x0, 0x60, 0x7, 0x1, 0xE, 0x0, 0x68, 0x7, 0x1, 0xE, 0x0, 0x70, 0x7, 0x1, 0xE, 0x0, 0x78, 0x7, 0x1, 0xE, 0x0, 0x80, 0x7, 0x1, 0xE, 0x0, 0x88, 0x7, 0x1, 0xE, 0x0, 0x90, 0x7, 0x1, 0xE, 0x0, 0x98, 0x7, 0x1, 0xE, 0x0, 0xA0, 0x7, 0x1, 0xE, 0x0, 0xA8, 0x7, 0x1, 0xE, 0x0, 0xB0, 0x7, 0x1, 0xE, 0x0, 0xB8, 0x7, 0x1, 0xE, 0x0, 0xC0, 0x7, 0x1, 0xE, 0x0, 0xC8, 0x7, 0x1, 0xE, 0x0, 0xD0, 0x7, 0x1, 0xE, 0x0, 0xD8, 0x7, 0x1, 0xE, 0x0, 0xE0, 0x7, 0x1, 0xE, 0x0, 0xE8, 0x7, 0x1, 0xE, 0x0, 0xF0, 0x7, 0x1, 0xE, 0x0, 0xF8, 0x7, 0x1, 0xE, 0x0, 0x0, 0x8, 0x1, 0xE, 0x0, 0x8, 0x8, 0x1, 0xE, 0x0, 0x10, 0x8, 0x1, 0xE, 0x0, 0x18, 0x8, 0x1, 0xE, 0x0, 0x20, 0x8, 0x1, 0xE, 0x0, 0x28, 0x8, 0x1, 0xE, 0x0, 0x30, 0x8, 0x1, 0xE, 0x0, 0x38, 0x8, 0x1, 0xE, 0x0, 0x40, 0x8, 0x1, 0xE, 0x0, 0x48, 0x8, 0x1, 0xE, 0x0, 0x50, 0x8, 0x1, 0xE, 0x0, 0x58, 0x8, 0x1, 0xE, 0x0, 0x60, 0x8, 0x1, 0xE, 0x0, 0x68, 0x8, 0x1, 0xE, 0x0, 0x70, 0x8, 0x1, 0xE, 0x0, 0x78, 0x8, 0x1, 0xE, 0x0, 0x80, 0x8, 0x1, 0xE, 0x0, 0x88, 0x8, 0x1, 0xE, 0x0, 0x90, 0x8, 0x1, 0xE, 0x0, 0x98, 0x8, 0x1, 0xE, 0x0, 0xA0, 0x8, 0x1, 0xE, 0x0, 0xA8, 0x8, 0x1, 0xE, 0x0, 0xB0, 0x8, 0x1, 0xE, 0x0, 0xB8, 0x8, 0x1, 0xE, 0x0, 0xC0, 0x8, 0x1, 0xE, 0x0, 0xC8, 0x8, 0x1, 0xE, 0x0, 0xD0, 0x8, 0x1, 0xE, 0x0, 0xD8, 0x8, 0x1, 0xE, 0x0, 0xE0, 0x8, 0x1, 0xE, 0x0, 0xE8, 0x8, 0x1, 0xE, 0x0, 0xF0, 0x8, 0x1, 0xE, 0x0, 0xF8, 0x8, 0x1, 0xE, 0x0, 0x0, 0x9, 0x1, 0xE, 0x0, 0x8, 0x9, 0x1, 0xE, 0x0, 0x10, 0x9, 0x1, 0xE, 0x0, 0x18, 0x9, 0x1, 0xE, 0x0, 0x20, 0x9, 0x1, 0xE, 0x0, 0x28, 0x9, 0x1, 0xE, 0x0, 0x30, 0x9, 0x1, 0xE, 0x0, 0x38, 0x9, 0x1, 0xE, 0x0, 0x40, 0x9, 0x1, 0xE, 0x0, 0x48, 0x9, 0x1, 0xE, 0x0, 0x50, 0x9, 0x1, 0xE, 0x0, 0x58, 0x9, 0x1, 0xE, 0x0, 0x60, 0x9, 0x1, 0xE, 0x0, 0x68, 0x9, 0x1, 0xE, 0x0, 0x70, 0x9, 0x1, 0xE, 0x0, 0x78, 0x9, 0x1, 0xE, 0x0, 0x80, 0x9, 0x1, 0xE, 0x0, 0x88, 0x9, 0x1, 0xE, 0x0, 0x90, 0x9, 0x1, 0xE, 0x0, 0x98, 0x9, 0x1, 0xE, 0x0, 0xA0, 0x9, 0x1, 0xE, 0x0, 0xA8, 0x9, 0x1, 0xE, 0x0, 0xB0, 0x9, 0x1, 0xE, 0x0, 0xB8, 0x9, 0x1, 0xE, 0x0, 0xC0, 0x9, 0x1, 0xE, 0x0, 0xC8, 0x9, 0x1, 0xE, 0x0, 0xD0, 0x9, 0x1, 0xE, 0x0, 0xD8, 0x9, 0x1, 0xE, 0x0, 0xE0, 0x9, 0x1, 0xE, 0x0, 0xE8, 0x9, 0x1, 0xE, 0x0, 0xF0, 0x9, 0x1, 0xE, 0x0, 0xF8, 0x9, 0x1, 0xE, 0x0, 0x0, 0xA, 0x1, 0xE, 0x0, 0x8, 0xA, 0x1, 0xE, 0x0, 0x10, 0xA, 0x1, 0xE, 0x0, 0x18, 0xA, 0x1, 0xE, 0x0, 0x20, 0xA, 0x1, 0xE, 0x0, 0x28, 0xA, 0x1, 0xE, 0x0, 0x30, 0xA, 0x1, 0xE, 0x0, 0x38, 0xA, 0x1, 0xE, 0x0, 0x40, 0xA, 0x1, 0xE, 0x0, 0x48, 0xA, 0x1, 0xE, 0x0, 0x50, 0xA, 0x1, 0xE, 0x0, 0x58, 0xA, 0x1, 0xE, 0x0, 0x60, 0xA, 0x1, 0xE, 0x0, 0x68, 0xA, 0x1, 0xE, 0x0, 0x70, 0xA, 0x1, 0xE, 0x0, 0x78, 0xA, 0x1, 0xE, 0x0, 0x80, 0xA, 0x1, 0xE, 0x0, 0x88, 0xA, 0x1, 0xE, 0x0, 0x90, 0xA, 0x1, 0xE, 0x0, 0x98, 0xA, 0x1, 0xE, 0x0, 0xA0, 0xA, 0x1, 0xE, 0x0, 0xA8, 0xA, 0x1, 0xE, 0x0, 0xB0, 0xA, 0x1, 0xE, 0x0, 0xB8, 0xA, 0x1, 0xE, 0x0, 0xC0, 0xA, 0x1, 0xE, 0x0, 0xC8, 0xA, 0x1, 0xE, 0x0, 0xD0, 0xA, 0x1, 0xE, 0x0, 0xD8, 0xA, 0x1, 0xE, 0x0, 0xE0, 0xA, 0x1, 0xE, 0x0, 0xE8, 0xA, 0x1, 0xE, 0x0, 0xF0, 0xA, 0x1, 0xE, 0x0, 0xF8, 0xA, 0x1, 0xE, 0x0, 0x0, 0xB, 0x1, 0xE, 0x0, 0x8, 0xB, 0x1, 0xE, 0x0, 0x10, 0xB, 0x1, 0xE, 0x0, 0x18, 0xB, 0x1, 0xE, 0x0, 0x20, 0xB, 0x1, 0xE, 0x0, 0x28, 0xB, 0x1, 0xE, 0x0, 0x30, 0xB, 0x1, 0xE, 0x0, 0x38, 0xB, 0x1, 0xE, 0x0, 0x40, 0xB, 0x1, 0xE, 0x0, 0x48, 0xB, 0x1, 0xE, 0x0, 0x50, 0xB, 0x1, 0xE, 0x0, 0x58, 0xB, 0x1, 0xE, 0x0, 0x60, 0xB, 0x1, 0xE, 0x0, 0x68, 0xB, 0x1, 0xE, 0x0, 0x70, 0xB, 0x1, 0xE, 0x0, 0x78, 0xB, 0x1, 0xE, 0x0, 0x80, 0xB, 0x1, 0xE, 0x0, 0x88, 0xB, 0x1, 0xE, 0x0, 0x90, 0xB, 0x1, 0xE, 0x0, 0x98, 0xB, 0x1, 0xE, 0x0, 0xA0, 0xB, 0x1, 0xE, 0x0, 0xA8, 0xB, 0x1, 0xE, 0x0, 0xB0, 0xB, 0x1, 0xE, 0x0, 0xB8, 0xB, 0x1, 0xE, 0x0, 0xC0, 0xB, 0x1, 0xE, 0x0, 0xC8, 0xB, 0x1, 0xE, 0x0, 0xD0, 0xB, 0x1, 0xE, 0x0, 0xD8, 0xB, 0x1, 0xE, 0x0, 0xE0, 0xB, 0x1, 0xE, 0x0, 0xE8, 0xB, 0x1, 0xE, 0x0, 0xF0, 0xB, 0x1, 0xE, 0x0, 0xF8, 0xB, 0x1, 0xE, 0x0, 0x0, 0xC, 0x1, 0xE, 0x0, 0x8, 0xC, 0x1, 0xE, 0x0, 0x10, 0xC, 0x1, 0xE, 0x0, 0x18, 0xC, 0x1, 0xE, 0x0, 0x20, 0xC, 0x1, 0xE, 0x0, 0x28, 0xC, 0x1, 0xE, 0x0, 0x30, 0xC, 0x1, 0xE, 0x0, 0x38, 0xC, 0x1, 0xE, 0x0, 0x40, 0xC, 0x1, 0xE, 0x0, 0x48, 0xC, 0x1, 0xE, 0x0, 0x50, 0xC, 0x1, 0xE, 0x0, 0x58, 0xC, 0x1, 0xE, 0x0, 0x60, 0xC, 0x1, 0xE, 0x0, 0x68, 0xC, 0x1, 0xE, 0x0, 0x70, 0xC, 0x1, 0xE, 0x0, 0x78, 0xC, 0x1, 0xE, 0x0, 0x80, 0xC, 0x1, 0xE, 0x0, 0x88, 0xC, 0x1, 0xE, 0x0, 0x90, 0xC, 0x1, 0xE, 0x0, 0x98, 0xC, 0x1, 0xE, 0x0, 0xA0, 0xC, 0x1, 0xE, 0x0, 0xA8, 0xC, 0x1, 0xE, 0x0, 0xB0, 0xC, 0x1, 0xE, 0x0, 0xB8, 0xC, 0x1, 0xE, 0x0, 0xC0, 0xC, 0x1, 0xE, 0x0, 0xC8, 0xC, 0x1, 0xE, 0x0, 0xD0, 0xC, 0x1, 0xE, 0x0, 0xD8, 0xC, 0x1, 0xE, 0x0, 0xE0, 0xC, 0x1, 0xE, 0x0, 0xE8, 0xC, 0x1, 0xE, 0x0, 0xF0, 0xC, 0x1, 0xE, 0x0, 0xF8, 0xC, 0x1, 0xE, 0x0, 0x0, 0xD, 0x1, 0xE, 0x0, 0x8, 0xD, 0x1, 0xE, 0x0, 0x10, 0xD, 0x1, 0xE, 0x0, 0x18, 0xD, 0x1, 0xE, 0x0, 0x20, 0xD, 0x1, 0xE, 0x0, 0x28, 0xD, 0x1, 0xE, 0x0, 0x30, 0xD, 0x1, 0xE, 0x0, 0x38, 0xD, 0x1, 0xE, 0x0, 0x40, 0xD, 0x1, 0xE, 0x0, 0x48, 0xD, 0x1, 0xE, 0x0, 0x50, 0xD, 0x1, 0xE, 0x0, 0x58, 0xD, 0x1, 0xE, 0x0, 0x60, 0xD, 0x1, 0xE, 0x0, 0x68, 0xD, 0x1, 0xE, 0x0, 0x70, 0xD, 0x1, 0xE, 0x0, 0x78, 0xD, 0x1, 0xE, 0x0, 0x80, 0xD, 0x1, 0xE, 0x0, 0x88, 0xD, 0x1, 0xE, 0x0, 0x90, 0xD, 0x1, 0xE, 0x0, 0x98, 0xD, 0x1, 0xE, 0x0, 0xA0, 0xD, 0x1, 0xE, 0x0, 0xA8, 0xD, 0x1, 0xE, 0x0, 0xB0, 0xD, 0x1, 0xE, 0x0, 0xB8, 0xD, 0x1, 0xE, 0x0, 0xC0, 0xD, 0x1, 0xE, 0x0, 0xC8, 0xD, 0x1, 0xE, 0x0, 0xD0, 0xD, 0x1, 0xE, 0x0, 0xD8, 0xD, 0x1, 0xE, 0x0, 0xE0, 0xD, 0x1, 0xE, 0x0, 0xE8, 0xD, 0x1, 0xE, 0x0, 0xF0, 0xD, 0x1, 0xE, 0x0, 0xF8, 0xD, 0x1, 0xE, 0x0, 0x0, 0xE, 0x1, 0xE, 0x0, 0x8, 0xE, 0x1, 0xE, 0x0, 0x10, 0xE, 0x1, 0xE, 0x0, 0x18, 0xE, 0x1, 0xE, 0x0, 0x20, 0xE, 0x1, 0xE, 0x0, 0x28, 0xE, 0x1, 0xE, 0x0, 0x30, 0xE, 0x1, 0xE, 0x0, 0x38, 0xE, 0x1, 0xE, 0x0, 0x40, 0xE, 0x1, 0xE, 0x0, 0x48, 0xE, 0x1, 0xE, 0x0, 0x50, 0xE, 0x1, 0xE, 0x0, 0x58, 0xE, 0x1, 0xE, 0x0, 0x60, 0xE, 0x1, 0xE, 0x0, 0x68, 0xE, 0x1, 0xE, 0x0, 0x70, 0xE, 0x1, 0xE, 0x0, 0x78, 0xE, 0x1, 0xE, 0x0, 0x80, 0xE, 0x1, 0xE, 0x0, 0x88, 0xE, 0x1, 0xE, 0x0, 0x90, 0xE, 0x1, 0xE, 0x0, 0x98, 0xE, 0x1, 0xE, 0x0, 0xA0, 0xE, 0x1, 0xE, 0x0, 0xA8, 0xE, 0x1, 0xE, 0x0, 0xB0, 0xE, 0x1, 0xE, 0x0, 0xB8, 0xE, 0x1, 0xE, 0x0, 0xC0, 0xE, 0x1, 0xE, 0x0, 0xC8, 0xE, 0x1, 0xE, 0x0, 0xD0, 0xE, 0x1, 0xE, 0x0, 0xD8, 0xE, 0x1, 0xE, 0x0, 0xE0, 0xE, 0x1, 0xE, 0x0, 0xE8, 0xE, 0x1, 0xE, 0x0, 0xF0, 0xE, 0x1, 0xE, 0x0, 0xF8, 0xE, 0x1, 0xE, 0x0, 0x0, 0xF, 0x1, 0xE, 0x0, 0x8, 0xF, 0x1, 0xE, 0x0, 0x10, 0xF, 0x1, 0xE, 0x0, 0x18, 0xF, 0x1, 0xE, 0x0, 0x20, 0xF, 0x1, 0xE, 0x0, 0x28, 0xF, 0x1, 0xE, 0x0, 0x30, 0xF, 0x1, 0xE, 0x0, 0x38, 0xF, 0x1, 0xE, 0x0, 0x40, 0xF, 0x1, 0xE, 0x0, 0x48, 0xF, 0x1, 0xE, 0x0, 0x50, 0xF, 0x1, 0xE, 0x0, 0x58, 0xF, 0x1, 0xE, 0x0, 0x60, 0xF, 0x1, 0xE, 0x0, 0x68, 0xF, 0x1, 0xE, 0x0, 0x70, 0xF, 0x1, 0xE, 0x0, 0x78, 0xF, 0x1, 0xE, 0x0, 0x80, 0xF, 0x1, 0xE, 0x0, 0x88, 0xF, 0x1, 0xE, 0x0, 0x90, 0xF, 0x1, 0xE, 0x0, 0x98, 0xF, 0x1, 0xE, 0x0, 0xA0, 0xF, 0x1, 0xE, 0x0, 0xA8, 0xF, 0x1, 0xE, 0x0, 0xB0, 0xF, 0x1, 0xE, 0x0, 0xB8, 0xF, 0x1, 0xE, 0x0, 0xC0, 0xF, 0x1, 0xE, 0x0, 0xC8, 0xF, 0x1, 0xE, 0x0, 0xD0, 0xF, 0x1, 0xE, 0x0, 0xD8, 0xF, 0x1, 0xE, 0x0, 0xE0, 0xF, 0x1, 0xE, 0x0, 0xE8, 0xF, 0x1, 0xE, 0x0, 0xF0, 0xF, 0x1, 0xE, 0x0, 0xF8, 0xF, 0x1, 0xE, 0x0, 0x0, 0x10, 0x1, 0xE, 0x0, 0x8, 0x10, 0x1, 0xE, 0x0, 0x10, 0x10, 0x1, 0xE, 0x0, 0x18, 0x10, 0x1, 0xE, 0x0, 0x20, 0x10, 0x1, 0xE, 0x0, 0x28, 0x10, 0x1, 0xE, 0x0, 0x30, 0x10, 0x1, 0xE, 0x0, 0x38, 0x10, 0x1, 0xE, 0x0, 0x40, 0x10, 0x1, 0xE, 0x0, 0x48, 0x10, 0x1, 0xE, 0x0, 0x50, 0x10, 0x1, 0xE, 0x0, 0x58, 0x10, 0x1, 0xE, 0x0, 0x60, 0x10, 0x1, 0xE, 0x0, 0x68, 0x10, 0x1, 0xE, 0x0, 0x70, 0x10, 0x1, 0xE, 0x0, 0x78, 0x10, 0x1, 0xE, 0x0, 0x80, 0x10, 0x1, 0xE, 0x0, 0x88, 0x10, 0x1, 0xE, 0x0, 0x90, 0x10, 0x1, 0xE, 0x0, 0x98, 0x10, 0x1, 0xE, 0x0, 0xA0, 0x10, 0x1, 0xE, 0x0, 0xA8, 0x10, 0x1, 0xE, 0x0, 0xB0, 0x10, 0x1, 0xE, 0x0, 0xB8, 0x10, 0x1, 0xE, 0x0, 0xC0, 0x10, 0x1, 0xE, 0x0, 0xC8, 0x10, 0x1, 0xE, 0x0, 0xD0, 0x10, 0x1, 0xE, 0x0, 0xD8, 0x10, 0x1, 0xE, 0x0, 0xE0, 0x10, 0x1, 0xE, 0x0, 0xE8, 0x10, 0x1, 0xE, 0x0, 0xF0, 0x10, 0x1, 0xE, 0x0, 0xF8, 0x10, 0x1, 0xE, 0x0, 0x0, 0x11, 0x1, 0xE, 0x0, 0x8, 0x11, 0x1, 0xE, 0x0, 0x10, 0x11, 0x1, 0xE, 0x0, 0x18, 0x11, 0x1, 0xE, 0x0, 0x20, 0x11, 0x1, 0xE, 0x0, 0x28, 0x11, 0x1, 0xE, 0x0, 0x30, 0x11, 0x1, 0xE, 0x0, 0x38, 0x11, 0x1, 0xE, 0x0, 0x40, 0x11, 0x1, 0xE, 0x0, 0x48, 0x11, 0x1, 0xE, 0x0, 0x50, 0x11, 0x1, 0xE, 0x0, 0x58, 0x11, 0x1, 0xE, 0x0, 0x60, 0x11, 0x1, 0xE, 0x0, 0x68, 0x11, 0x1, 0xE, 0x0, 0x70, 0x11, 0x1, 0xE, 0x0, 0x78, 0x11, 0x1, 0xE, 0x0, 0x80, 0x11, 0x1, 0xE, 0x0, 0x88, 0x11, 0x1, 0xE, 0x0, 0x90, 0x11, 0x1, 0xE, 0x0, 0x98, 0x11, 0x1, 0xE, 0x0, 0xA0, 0x11, 0x1, 0xE, 0x0, 0xA8, 0x11, 0x1, 0xE, 0x0, 0xB0, 0x11, 0x1, 0xE, 0x0, 0xB8, 0x11, 0x1, 0xE, 0x0, 0xC0, 0x11, 0x1, 0xE, 0x0, 0xC8, 0x11, 0x1, 0xE, 0x0, 0xD0, 0x11, 0x1, 0xE, 0x0, 0xD8, 0x11, 0x1, 0xE, 0x0, 0xE0, 0x11, 0x1, 0xE, 0x0, 0xE8, 0x11, 0x1, 0xE, 0x0, 0xF0, 0x11, 0x1, 0xE, 0x0, 0xF8, 0x11, 0x1, 0xE, 0x0, 0x0, 0x12, 0x1, 0xE, 0x0, 0x8, 0x12, 0x1, 0xE, 0x0, 0x10, 0x12, 0x1, 0xE, 0x0, 0x18, 0x12, 0x1, 0xE, 0x0, 0x20, 0x12, 0x1, 0xE, 0x0, 0x28, 0x12, 0x1, 0xE, 0x0, 0x30, 0x12, 0x1, 0xE, 0x0, 0x38, 0x12, 0x1, 0xE, 0x0, 0x40, 0x12, 0x1, 0xE, 0x0, 0x48, 0x12, 0x1, 0xE, 0x0, 0x50, 0x12, 0x1, 0xE, 0x0, 0x58, 0x12, 0x1, 0xE, 0x0, 0x60, 0x12, 0x1, 0xE, 0x0, 0x68, 0x12, 0x1, 0xE, 0x0, 0x70, 0x12, 0x1, 0xE, 0x0, 0x78, 0x12, 0x1, 0xE, 0x0, 0x80, 0x12, 0x1, 0xE, 0x0, 0x88, 0x12, 0x1, 0xE, 0x0, 0x90, 0x12, 0x1, 0xE, 0x0, 0x98, 0x12, 0x1, 0xE, 0x0, 0xA0, 0x12, 0x1, 0xE, 0x0, 0xA8, 0x12, 0x1, 0xE, 0x0, 0xB0, 0x12, 0x1, 0xE, 0x0, 0xB8, 0x12, 0x1, 0xE, 0x0, 0xC0, 0x12, 0x1, 0xE, 0x0, 0xC8, 0x12, 0x1, 0xE, 0x0, 0xD0, 0x12, 0x1, 0xE, 0x0, 0xD8, 0x12, 0x1, 0xE, 0x0, 0xE0, 0x12, 0x1, 0xE, 0x0, 0xE8, 0x12, 0x1, 0xE, 0x0, 0xF0, 0x12, 0x1, 0xE, 0x0, 0xF8, 0x12, 0x1, 0xE, 0x0, 0x0, 0x13, 0x1, 0xE, 0x0, 0x8, 0x13, 0x1, 0xE, 0x0, 0x10, 0x13, 0x1, 0xE, 0x0, 0x18, 0x13, 0x1, 0xE, 0x0, 0x20, 0x13, 0x1, 0xE, 0x0, 0x28, 0x13, 0x1, 0xE, 0x0, 0x30, 0x13, 0x1, 0xE, 0x0, 0x38, 0x13, 0x1, 0xE, 0x0, 0x40, 0x13, 0x1, 0xE, 0x0, 0x48, 0x13, 0x1, 0xE, 0x0, 0x50, 0x13, 0x1, 0xE, 0x0, 0x58, 0x13, 0x1, 0xE, 0x0, 0x60, 0x13, 0x1, 0xE, 0x0, 0x68, 0x13, 0x1, 0xE, 0x0, 0x70, 0x13, 0x1, 0xE, 0x0, 0x78, 0x13, 0x1, 0xE, 0x0, 0x80, 0x13, 0x1, 0xE, 0x0, 0x88, 0x13, 0x1, 0xE, 0x0, 0x90, 0x13, 0x1, 0xE, 0x0, 0x98, 0x13, 0x1, 0xE, 0x0, 0xA0, 0x13, 0x1, 0xE, 0x0, 0xA8, 0x13, 0x1, 0xE, 0x0, 0xB0, 0x13, 0x1, 0xE, 0x0, 0xB8, 0x13, 0x1, 0xE, 0x0, 0xC0, 0x13, 0x1, 0xE, 0x0, 0xC8, 0x13, 0x1, 0xE, 0x0, 0xD0, 0x13, 0x1, 0xE, 0x0, 0xD8, 0x13, 0x1, 0xE, 0x0, 0xE0, 0x13, 0x1, 0xE, 0x0, 0xE8, 0x13, 0x1, 0xE, 0x0, 0xF0, 0x13, 0x1, 0xE, 0x0, 0xF8, 0x13, 0x1, 0xE, 0x0, 0x0, 0x14, 0x1, 0xE, 0x0, 0x8, 0x14, 0x1, 0xE, 0x0, 0x10, 0x14, 0x1, 0xE, 0x0, 0x18, 0x14, 0x1, 0xE, 0x0, 0x20, 0x14, 0x1, 0xE, 0x0, 0x28, 0x14, 0x1, 0xE, 0x0, 0x30, 0x14, 0x1, 0xE, 0x0, 0x38, 0x14, 0x1, 0xE, 0x0, 0x40, 0x14, 0x1, 0xE, 0x0, 0x48, 0x14, 0x1, 0xE, 0x0, 0x50, 0x14, 0x1, 0xE, 0x0, 0x58, 0x14, 0x1, 0xE, 0x0, 0x60, 0x14, 0x1, 0xE, 0x0, 0x68, 0x14, 0x1, 0xE, 0x0, 0x70, 0x14, 0x1, 0xE, 0x0, 0x78, 0x14, 0x1, 0xE, 0x0, 0x80, 0x14, 0x1, 0xE, 0x0, 0x88, 0x14, 0x1, 0xE, 0x0, 0x90, 0x14, 0x1, 0xE, 0x0, 0x98, 0x14, 0x1, 0xE, 0x0, 0xA0, 0x14, 0x1, 0xE, 0x0, 0xA8, 0x14, 0x1, 0xE, 0x0, 0xB0, 0x14, 0x1, 0xE, 0x0, 0xB8, 0x14, 0x1, 0xE, 0x0, 0xC0, 0x14, 0x1, 0xE, 0x0, 0xC8, 0x14, 0x1, 0xE, 0x0, 0xD0, 0x14, 0x1, 0xE, 0x0, 0xD8, 0x14, 0x1, 0xE, 0x0, 0xE0, 0x14, 0x1, 0xE, 0x0, 0xE8, 0x14, 0x1, 0xE, 0x0, 0xF0, 0x14, 0x1, 0xE, 0x0, 0xF8, 0x14, 0x1, 0xE, 0x0, 0x0, 0x15, 0x1, 0xE, 0x0, 0x8, 0x15, 0x1, 0xE, 0x0, 0x10, 0x15, 0x1, 0xE, 0x0, 0x18, 0x15, 0x1, 0xE, 0x0, 0x20, 0x15, 0x1, 0xE, 0x0, 0x28, 0x15, 0x1, 0xE, 0x0, 0x30, 0x15, 0x1, 0xE, 0x0, 0x38, 0x15, 0x1, 0xE, 0x0, 0x40, 0x15, 0x1, 0xE, 0x0, 0x48, 0x15, 0x1, 0xE, 0x0, 0x50, 0x15, 0x1, 0xE, 0x0, 0x58, 0x15, 0x1, 0xE, 0x0, 0x60, 0x15, 0x1, 0xE, 0x0, 0x68, 0x15, 0x1, 0xE, 0x0, 0x70, 0x15, 0x1, 0xE, 0x0, 0x78, 0x15, 0x1, 0xE, 0x0, 0x80, 0x15, 0x1, 0xE, 0x0, 0x88, 0x15, 0x1, 0xE, 0x0, 0x90, 0x15, 0x1, 0xE, 0x0, 0x98, 0x15, 0x1, 0xE, 0x0, 0xA0, 0x15, 0x1, 0xE, 0x0, 0xA8, 0x15, 0x1, 0xE, 0x0, 0xB0, 0x15, 0x1, 0xE, 0x0, 0xB8, 0x15, 0x1, 0xE, 0x0, 0xC0, 0x15, 0x1, 0xE, 0x0, 0xC8, 0x15, 0x1, 0xE, 0x0, 0xD0, 0x15, 0x1, 0xE, 0x0, 0xD8, 0x15, 0x1, 0xE, 0x0, 0xE0, 0x15, 0x1, 0xE, 0x0, 0xE8, 0x15, 0x1, 0xE, 0x0, 0xF0, 0x15, 0x1, 0xE, 0x0, 0xF8, 0x15, 0x1, 0xE, 0x0, 0x0, 0x16, 0x1, 0xE, 0x0, 0x8, 0x16, 0x1, 0xE, 0x0, 0x10, 0x16, 0x1, 0xE, 0x0, 0x18, 0x16, 0x1, 0xE, 0x0, 0x20, 0x16, 0x1, 0xE, 0x0, 0x28, 0x16, 0x1, 0xE, 0x0, 0x30, 0x16, 0x1, 0xE, 0x0, 0x38, 0x16, 0x1, 0xE, 0x0, 0x40, 0x16, 0x1, 0xE, 0x0, 0x48, 0x16, 0x1, 0xE, 0x0, 0x50, 0x16, 0x1, 0xE, 0x0, 0x58, 0x16, 0x1, 0xE, 0x0, 0x60, 0x16, 0x1, 0xE, 0x0, 0x68, 0x16, 0x1, 0xE, 0x0, 0x70, 0x16, 0x1, 0xE, 0x0, 0x78, 0x16, 0x1, 0xE, 0x0, 0x80, 0x16, 0x1, 0xE, 0x0, 0x88, 0x16, 0x1, 0xE, 0x0, 0x90, 0x16, 0x1, 0xE, 0x0, 0x98, 0x16, 0x1, 0x8F, 0x5A, 0x4, 0x0, 0x0, 0xAF, 0x5A, 0x4, 0x0, 0x0, 0xCF, 0x5A, 0x4, 0x0, 0x0, 0xEF, 0x5A, 0x4, 0x0, 0x0, 0xF, 0x5B, 0x4, 0x0, 0x0, 0x2F, 0x5B, 0x4, 0x0, 0x0, 0x4F, 0x5B, 0x4, 0x0, 0x0, 0x6F, 0x5B, 0x4, 0x0, 0x0, 0x8F, 0x5B, 0x4, 0x0, 0x0, 0xAF, 0x5B, 0x4, 0x0, 0x0, 0xCF, 0x5B, 0x4, 0x0, 0x0, 0xEF, 0x5B, 0x4, 0x0, 0x0, 0xF, 0x5C, 0x4, 0x0, 0x0, 0x2F, 0x5C, 0x4, 0x0, 0x0, 0x4F, 0x5C, 0x4, 0x0, 0x0, 0x6F, 0x5C, 0x4, 0x0, 0x0, 0x8F, 0x5C, 0x4, 0x0, 0x0, 0xAF, 0x5C, 0x4, 0x0, 0x0, 0xCF, 0x5C, 0x4, 0x0, 0x0, 0xEF, 0x5C, 0x4, 0x0, 0x0, 0xF, 0x5D, 0x4, 0x0, 0x0, 0x2F, 0x5D, 0x4, 0x0, 0x0, 0x4F, 0x5D, 0x4, 0x0, 0x0, 0x6F, 0x5D, 0x4, 0x0, 0x0, 0x8F, 0x5D, 0x4, 0x0, 0x0, 0xAF, 0x5D, 0x4, 0x0, 0x0, 0xCF, 0x5D, 0x7C, 0x17, 0x1, 0xF, 0x5E, 0x8C, 0x17, 0x1, 0x4F, 0x5E, 0x9C, 0x17, 0x1, 0x8F, 0x5E, 0xAC, 0x17, 0x1, 0xCF, 0x5E, 0xBC, 0x17, 0x1, 0xF, 0x5F, 0xCC, 0x17, 0x1, 0x4F, 0x5F, 0xDC, 0x17, 0x1, 0x8F, 0x5F, 0xEC, 0x17, 0x1, 0xCF, 0x5F, 0xFC, 0x17, 0x1, 0xF, 0x60, 0xC, 0x18, 0x1, 0x4F, 0x60, 0x1C, 0x18, 0x1, 0x8F, 0x60, 0x2C, 0x18, 0x1, 0xCF, 0x60, 0x3C, 0x18, 0x1, 0xF, 0x61, 0x4C, 0x18, 0x1, 0x4F, 0x61, 0x5C, 0x18, 0x1, 0x8F, 0x61, 0x6C, 0x18, 0x1, 0xCF, 0x61, 0x7C, 0x18, 0x1, 0xF, 0x62, 0x8C, 0x18, 0x1, 0x4F, 0x62, 0x9C, 0x18, 0x1, 0x8F, 0x62, 0xAC, 0x18, 0x1, 0xCF, 0x62, 0xBC, 0x18, 0x1, 0xF, 0x63, 0xCC, 0x18, 0x1, 0x4F, 0x63, 0xDC, 0x18, 0x1, 0x8F, 0x63, 0xEC, 0x18, 0x1, 0xCF, 0x63, 0xFC, 0x18, 0x1, 0xF, 0x64, 0xC, 0x19, 0x1, 0x4F, 0x64, 0x1C, 0x19, 0x1, 0x8F, 0x64, 0x2C, 0x19, 0x1, 0xCF, 0x64, 0x3C, 0x19, 0x1, 0xF, 0x65, 0x4C, 0x19, 0x1, 0x4F, 0x65, 0x5C, 0x19, 0x1, 0x8F, 0x65, 0x6C, 0x19, 0x1, 0xCF, 0x65, 0x7C, 0x19, 0x1, 0xF, 0x66, 0x8C, 0x19, 0x1, 0x4F, 0x66, 0x9C, 0x19, 0x1, 0x8F, 0x66, 0xAC, 0x19, 0x1, 0xCF, 0x66, 0xBC, 0x19, 0x1, 0xF, 0x67, 0xCC, 0x19, 0x1, 0x4F, 0x67, 0xDC, 0x19, 0x1, 0x8F, 0x67, 0xEC, 0x19, 0x1, 0xCF, 0x67, 0xFC, 0x19, 0x1, 0xF, 0x68, 0xC, 0x1A, 0x1, 0x4F, 0x68, 0x1C, 0x1A, 0x1, 0x8F, 0x68, 0x2C, 0x1A, 0x1, 0xCF, 0x68, 0x3C, 0x1A, 0x1, 0xF, 0x69, 0x4C, 0x1A, 0x1, 0x4F, 0x69, 0x5C, 0x1A, 0x1, 0x8F, 0x69, 0x6C, 0x1A, 0x1, 0xCF, 0x69, 0x7C, 0x1A, 0x1, 0xF, 0x6A, 0x8C, 0x1A, 0x1, 0x4F, 0x6A, 0x9C, 0x1A, 0x1, 0x8F, 0x6A, 0xAC, 0x1A, 0x1, 0xCF, 0x6A, 0xBC, 0x1A, 0x1, 0xF, 0x6B, 0xCC, 0x1A, 0x1, 0x4F, 0x6B, 0xDC, 0x1A, 0x1, 0x8F, 0x6B, 0xEC, 0x1A, 0x1, 0xCF, 0x6B, 0xFC, 0x1A, 0x1, 0xF, 0x6C, 0xC, 0x1B, 0x1, 0x4F, 0x6C, 0x1C, 0x1B, 0x1, 0x8F, 0x6C, 0x2C, 0x1B, 0x1, 0xCF, 0x6C, 0x3C, 0x1B, 0x1, 0xF, 0x6D, 0x4C, 0x1B, 0x1, 0x4F, 0x6D, 0x5C, 0x1B, 0x1, 0x8F, 0x6D, 0x6C, 0x1B, 0x1, 0xCF, 0x6D, 0x7C, 0x1B, 0x1, 0xF, 0x6E, 0x8C, 0x1B, 0x1, 0x4F, 0x6E, 0x9C, 0x1B, 0x1, 0x8F, 0x6E, 0xAC, 0x1B, 0x1, 0xCF, 0x6E, 0xBC, 0x1B, 0x1, 0xF, 0x6F, 0xCC, 0x1B, 0x1, 0x4F, 0x6F, 0xDC, 0x1B, 0x1, 0x8F, 0x6F, 0xEC, 0x1B, 0x1, 0xCF, 0x6F, 0xFC, 0x1B, 0x1, 0xF, 0x70, 0xC, 0x1C, 0x1, 0x4F, 0x70, 0x1C, 0x1C, 0x1, 0x8F, 0x70, 0x2C, 0x1C, 0x1, 0xCF, 0x70, 0x3C, 0x1C, 0x1, 0xF, 0x71, 0x4C, 0x1C, 0x1, 0x4F, 0x71, 0x5C, 0x1C, 0x1, 0x8F, 0x71, 0x6C, 0x1C, 0x1, 0xCF, 0x71, 0x4, 0x0, 0x0, 0xEF, 0x71, 0x84, 0x1C, 0x1, 0x2F, 0x72, 0x94, 0x1C, 0x1, 0x6F, 0x72, 0x4, 0x0, 0x0, 0x8F, 0x72, 0x4, 0x0, 0x0, 0xAF, 0x72, 0x4, 0x0, 0x0, 0xCF, 0x72, 0x4, 0x0, 0x0, 0xEF, 0x72, 0x4, 0x0, 0x0, 0xF, 0x73, 0x4, 0x0, 0x0, 0x2F, 0x73, 0x4, 0x0, 0x0, 0x4F, 0x73, 0x4, 0x0, 0x0, 0x6F, 0x73, 0xE4, 0x1C, 0x1, 0xAF, 0x73, 0xF4, 0x1C, 0x1, 0xEF, 0x73, 0x4, 0x1D, 0x1, 0x2F, 0x74, 0x14, 0x1D, 0x1, 0x6F, 0x74, 0x24, 0x1D, 0x1, 0xAF, 0x74, 0x34, 0x1D, 0x1, 0xEF, 0x74, 0x44, 0x1D, 0x1, 0x2F, 0x75, 0x54, 0x1D, 0x1, 0x6F, 0x75, 0x4, 0x0, 0x0, 0x8F, 0x75, 0x4, 0x0, 0x0, 0xAF, 0x75, 0x4, 0x0, 0x0, 0xCF, 0x75, 0x4, 0x0, 0x0, 0xEF, 0x75, 0x4, 0x0, 0x0, 0xF, 0x76, 0x4, 0x0, 0x0, 0x2F, 0x76, 0x4, 0x0, 0x0, 0x4F, 0x76, 0x4, 0x0, 0x0, 0x6F, 0x76, 0x4, 0x0, 0x0, 0x8F, 0x76, 0x4, 0x0, 0x0, 0xAF, 0x76, 0x4, 0x0, 0x0, 0xCF, 0x76, 0x4, 0x0, 0x0, 0xEF, 0x76, 0xC4, 0x1D, 0x1, 0x2F, 0x77, 0x4, 0x0, 0x0, 0x4F, 0x77, 0x4, 0x0, 0x0, 0x6F, 0x77, 0x4, 0x0, 0x0, 0x8F, 0x77, 0x4, 0x0, 0x0, 0xAF, 0x77, 0x4, 0x0, 0x0, 0xCF, 0x77, 0x4, 0x0, 0x0, 0xEF, 0x77, 0x4, 0x1E, 0x1, 0x2F, 0x78, 0x4, 0x0, 0x0, 0x4F, 0x78, 0x4, 0x0, 0x0, 0x6F, 0x78, 0x4, 0x0, 0x0, 0x8F, 0x78, 0x4, 0x0, 0x0, 0xAF, 0x78, 0x4, 0x0, 0x0, 0xCF, 0x78, 0x4, 0x0, 0x0, 0xEF, 0x78, 0x4, 0x0, 0x0, 0xF, 0x79, 0x4, 0x0, 0x0, 0x2F, 0x79, 0x4, 0x0, 0x0, 0x4F, 0x79, 0x4, 0x0, 0x0, 0x6F, 0x79, 0x4, 0x0, 0x0, 0x8F, 0x79, 0x4, 0x0, 0x0, 0xAF, 0x79, 0x4, 0x0, 0x0, 0xCF, 0x79, 0x4, 0x0, 0x0, 0xEF, 0x79, 0x4, 0x0, 0x0, 0xF, 0x7A, 0x4, 0x0, 0x0, 0x2F, 0x7A, 0x4, 0x0, 0x0, 0x4F, 0x7A, 0x4, 0x0, 0x0, 0x6F, 0x7A, 0x4, 0x0, 0x0, 0x8F, 0x7A, 0x4, 0x0, 0x0, 0xAF, 0x7A, 0x4, 0x0, 0x0, 0xCF, 0x7A, 0x4, 0x0, 0x0, 0xEF, 0x7A, 0x4, 0x0, 0x0, 0xF, 0x7B, 0x4, 0x0, 0x0, 0x2F, 0x7B, 0x4, 0x0, 0x0, 0x4F, 0x7B, 0x4, 0x0, 0x0, 0x6F, 0x7B, 0x4, 0x0, 0x0, 0x8F, 0x7B, 0x4, 0x0, 0x0, 0xAF, 0x7B, 0x4, 0x0, 0x0, 0xCF, 0x7B, 0x4, 0x0, 0x0, 0xEF, 0x7B, 0x4, 0x0, 0x0, 0xF, 0x7C, 0x4, 0x0, 0x0, 0x2F, 0x7C, 0x4, 0x0, 0x0, 0x4F, 0x7C, 0x4, 0x0, 0x0, 0x6F, 0x7C, 0x4, 0x0, 0x0, 0x8F, 0x7C, 0x4, 0x0, 0x0, 0xAF, 0x7C, 0x4, 0x0, 0x0, 0xCF, 0x7C, 0x4, 0x0, 0x0, 0xEF, 0x7C, 0x4, 0x0, 0x0, 0xF, 0x7D, 0x4, 0x0, 0x0, 0x2F, 0x7D, 0x4, 0x0, 0x0, 0x4F, 0x7D, 0x4, 0x0, 0x0, 0x6F, 0x7D, 0x4, 0x0, 0x0, 0x8F, 0x7D, 0x4, 0x0, 0x0, 0xAF, 0x7D, 0x4, 0x0, 0x0, 0xCF, 0x7D, 0x4, 0x0, 0x0, 0xEF, 0x7D, 0x4, 0x0, 0x0, 0xF, 0x7E, 0x4, 0x0, 0x0, 0x2F, 0x7E, 0x4, 0x0, 0x0, 0x4F, 0x7E, 0x4, 0x0, 0x0, 0x6F, 0x7E, 0x4, 0x0, 0x0, 0x8F, 0x7E, 0x4, 0x0, 0x0, 0xAF, 0x7E, 0x4, 0x0, 0x0, 0xCF, 0x7E, 0x4, 0x0, 0x0, 0xEF, 0x7E, 0x4, 0x0, 0x0, 0xF, 0x7F, 0x4, 0x0, 0x0, 0x2F, 0x7F, 0x4, 0x0, 0x0, 0x4F, 0x7F, 0x4, 0x0, 0x0, 0x6F, 0x7F, 0x4, 0x0, 0x0, 0x8F, 0x7F, 0x4, 0x0, 0x0, 0xAF, 0x7F, 0x4, 0x0, 0x0, 0xCF, 0x7F, 0x4, 0x0, 0x0, 0xEF, 0x7F, 0x4, 0x0, 0x0, 0xF, 0x80, 0x4, 0x0, 0x0, 0x2F, 0x80, 0x4, 0x0, 0x0, 0x4F, 0x80, 0x4, 0x0, 0x0, 0x6F, 0x80, 0x4, 0x0, 0x0, 0x8F, 0x80, 0x4, 0x0, 0x0, 0xAF, 0x80, 0x4, 0x0, 0x0, 0xCF, 0x80, 0x4, 0x0, 0x0, 0xEF, 0x80, 0x4, 0x0, 0x0, 0xF, 0x81, 0x4, 0x0, 0x0, 0x2F, 0x81, 0x4, 0x0, 0x0, 0x4F, 0x81, 0x4, 0x0, 0x0, 0x6F, 0x81, 0x4, 0x0, 0x0, 0x8F, 0x81, 0x4, 0x0, 0x0, 0xAF, 0x81, 0x4, 0x0, 0x0, 0xF, 0x0, 0x70, 0x20, 0x1, 0xF, 0x0, 0x78, 0x20, 0x1, 0xF, 0x0, 0x80, 0x20, 0x1, 0xF, 0x0, 0x88, 0x20, 0x1, 0xF, 0x0, 0x90, 0x20, 0x1, 0xF, 0x0, 0x98, 0x20, 0x1, 0xF, 0x0, 0xA0, 0x20, 0x1, 0xF, 0x0, 0xA8, 0x20, 0x1, 0xF, 0x0, 0xB0, 0x20, 0x1, 0xF, 0x0, 0xB8, 0x20, 0x1, 0xF, 0x0, 0xC0, 0x20, 0x1, 0xF, 0x0, 0xC8, 0x20, 0x1, 0xF, 0x0, 0xD0, 0x20, 0x1, 0xF, 0x0, 0xD8, 0x20, 0x1, 0xF, 0x0, 0xE0, 0x20, 0x1, 0xF, 0x0, 0xE8, 0x20, 0x1, 0xF, 0x0, 0xF0, 0x20, 0x1, 0xF, 0x0, 0xF8, 0x20, 0x1, 0xF, 0x0, 0x0, 0x21, 0x1, 0xF, 0x0, 0x8, 0x21, 0x1, 0xF, 0x0, 0x10, 0x21, 0x1, 0xF, 0x0, 0x18, 0x21, 0x1, 0xF, 0x0, 0x20, 0x21, 0x1, 0xF, 0x0, 0x28, 0x21, 0x1, 0xF, 0x0, 0x30, 0x21, 0x1, 0xF, 0x0, 0x38, 0x21, 0x1, 0xF, 0x0, 0x40, 0x21, 0x1, 0xF, 0x0, 0x48, 0x21, 0x1, 0xF, 0x0, 0x50, 0x21, 0x1, 0xF, 0x0, 0x58, 0x21, 0x1, 0xF, 0x0, 0x60, 0x21, 0x1, 0xF, 0x0, 0x68, 0x21, 0x1, 0xF, 0x0, 0x70, 0x21, 0x1, 0xF, 0x0, 0x78, 0x21, 0x1, 0xF, 0x0, 0x80, 0x21, 0x1, 0xF, 0x0, 0x88, 0x21, 0x1, 0xF, 0x0, 0x90, 0x21, 0x1, 0xF, 0x0, 0x98, 0x21, 0x1, 0xF, 0x0, 0xA0, 0x21, 0x1, 0xF, 0x0, 0xA8, 0x21, 0x1, 0xF, 0x0, 0xB0, 0x21, 0x1, 0xF, 0x0, 0xB8, 0x21, 0x1, 0xF, 0x0, 0xC0, 0x21, 0x1, 0xF, 0x0, 0xC8, 0x21, 0x1, 0xF, 0x0, 0xD0, 0x21, 0x1, 0xF, 0x0, 0xD8, 0x21, 0x1, 0xF, 0x0, 0xE0, 0x21, 0x1, 0xF, 0x0, 0xE8, 0x21, 0x1, 0xF, 0x0, 0xF0, 0x21, 0x1, 0xF, 0x0, 0xF8, 0x21, 0x1, 0xF, 0x0, 0x0, 0x22, 0x1, 0xF, 0x0, 0x8, 0x22, 0x1, 0xF, 0x0, 0x10, 0x22, 0x1, 0xF, 0x0, 0x18, 0x22, 0x1, 0xF, 0x0, 0x20, 0x22, 0x1, 0xF, 0x0, 0x28, 0x22, 0x1, 0xF, 0x0, 0x30, 0x22, 0x1, 0xF, 0x0, 0x38, 0x22, 0x1, 0xF, 0x0, 0x40, 0x22, 0x1, 0xF, 0x0, 0x48, 0x22, 0x1, 0xF, 0x0, 0x50, 0x22, 0x1, 0xF, 0x0, 0x58, 0x22, 0x1, 0xF, 0x0, 0x60, 0x22, 0x1, 0xF, 0x0, 0x68, 0x22, 0x1, 0xF, 0x0, 0x70, 0x22, 0x1, 0xF, 0x0, 0x78, 0x22, 0x1, 0xF, 0x0, 0x80, 0x22, 0x1, 0xF, 0x0, 0x88, 0x22, 0x1, 0xF, 0x0, 0x90, 0x22, 0x1, 0xF, 0x0, 0x98, 0x22, 0x1, 0xF, 0x0, 0xA0, 0x22, 0x1, 0xF, 0x0, 0xA8, 0x22, 0x1, 0xF, 0x0, 0xB0, 0x22, 0x1, 0xF, 0x0, 0xB8, 0x22, 0x1, 0xF, 0x0, 0xC0, 0x22, 0x1, 0xF, 0x0, 0xC8, 0x22, 0x1, 0xF, 0x0, 0xD0, 0x22, 0x1, 0xF, 0x0, 0xD8, 0x22, 0x1, 0xF, 0x0, 0xE0, 0x22, 0x1, 0xF, 0x0, 0xE8, 0x22, 0x1, 0xF, 0x0, 0xF0, 0x22, 0x1, 0xF, 0x0, 0xF8, 0x22, 0x1, 0xF, 0x0, 0x0, 0x23, 0x1, 0xF, 0x0, 0x8, 0x23, 0x1, 0xF, 0x0, 0x10, 0x23, 0x1, 0xF, 0x0, 0x18, 0x23, 0x1, 0xF, 0x0, 0x20, 0x23, 0x1, 0xF, 0x0, 0x28, 0x23, 0x1, 0xF, 0x0, 0x30, 0x23, 0x1, 0xF, 0x0, 0x38, 0x23, 0x1, 0xF, 0x0, 0x40, 0x23, 0x1, 0xF, 0x0, 0x48, 0x23, 0x1, 0xF, 0x0, 0x50, 0x23, 0x1, 0xF, 0x0, 0x58, 0x23, 0x1, 0xF, 0x0, 0x60, 0x23, 0x1, 0xF, 0x0, 0x68, 0x23, 0x1, 0xF, 0x0, 0x70, 0x23, 0x1, 0xF, 0x0, 0x78, 0x23, 0x1, 0xF, 0x0, 0x80, 0x23, 0x1, 0xF, 0x0, 0x88, 0x23, 0x1, 0xF, 0x0, 0x90, 0x23, 0x1, 0xF, 0x0, 0x98, 0x23, 0x1, 0xF, 0x0, 0xA0, 0x23, 0x1, 0xF, 0x0, 0xA8, 0x23, 0x1, 0xF, 0x0, 0xB0, 0x23, 0x1, 0xF, 0x0, 0xB8, 0x23, 0x1, 0xF, 0x0, 0xC0, 0x23, 0x1, 0xF, 0x0, 0xC8, 0x23, 0x1, 0xF, 0x0, 0xD0, 0x23, 0x1, 0xF, 0x0, 0xD8, 0x23, 0x1, 0xF, 0x0, 0xE0, 0x23, 0x1, 0xF, 0x0, 0xE8, 0x23, 0x1, 0xF, 0x0, 0xF0, 0x23, 0x1, 0xF, 0x0, 0xF8, 0x23, 0x1, 0xF, 0x0, 0x0, 0x24, 0x1, 0xF, 0x0, 0x8, 0x24, 0x1, 0xF, 0x0, 0x10, 0x24, 0x1, 0xF, 0x0, 0x18, 0x24, 0x1, 0xF, 0x0, 0x20, 0x24, 0x1, 0xF, 0x0, 0x28, 0x24, 0x1, 0xF, 0x0, 0x30, 0x24, 0x1, 0xF, 0x0, 0x38, 0x24, 0x1, 0xF, 0x0, 0x40, 0x24, 0x1, 0xF, 0x0, 0x48, 0x24, 0x1, 0xF, 0x0, 0x50, 0x24, 0x1, 0xF, 0x0, 0x58, 0x24, 0x1, 0xF, 0x0, 0x60, 0x24, 0x1, 0xF, 0x0, 0x68, 0x24, 0x1, 0xF, 0x0, 0x70, 0x24, 0x1, 0xF, 0x0, 0x78, 0x24, 0x1, 0xF, 0x0, 0x80, 0x24, 0x1, 0xF, 0x0, 0x88, 0x24, 0x1, 0xF, 0x0, 0x90, 0x24, 0x1, 0xF, 0x0, 0x98, 0x24, 0x1, 0xF, 0x0, 0xA0, 0x24, 0x1, 0xF, 0x0, 0xA8, 0x24, 0x1, 0xF, 0x0, 0xB0, 0x24, 0x1, 0xF, 0x0, 0xB8, 0x24, 0x1, 0xF, 0x0, 0xC0, 0x24, 0x1, 0xF, 0x0, 0xC8, 0x24, 0x1, 0xF, 0x0, 0xD0, 0x24, 0x1, 0xF, 0x0, 0xD8, 0x24, 0x1, 0xF, 0x0, 0xE0, 0x24, 0x1, 0xF, 0x0, 0xE8, 0x24, 0x1, 0xF, 0x0, 0xF0, 0x24, 0x1, 0xF, 0x0, 0xF8, 0x24, 0x1, 0xF, 0x0, 0x0, 0x25, 0x1, 0xF, 0x0, 0x8, 0x25, 0x1, 0xF, 0x0, 0x10, 0x25, 0x1, 0xF, 0x0, 0x18, 0x25, 0x1, 0xF, 0x0, 0x20, 0x25, 0x1, 0xF, 0x0, 0x28, 0x25, 0x1, 0xF, 0x0, 0x30, 0x25, 0x1, 0xF, 0x0, 0x38, 0x25, 0x1, 0xF, 0x0, 0x40, 0x25, 0x1, 0xF, 0x0, 0x48, 0x25, 0x1, 0xF, 0x0, 0x50, 0x25, 0x1, 0xF, 0x0, 0x58, 0x25, 0x1, 0xF, 0x0, 0x60, 0x25, 0x1, 0xF, 0x0, 0x68, 0x25, 0x1, 0xF, 0x0, 0x70, 0x25, 0x1, 0xF, 0x0, 0x78, 0x25, 0x1, 0xF, 0x0, 0x80, 0x25, 0x1, 0xF, 0x0, 0x88, 0x25, 0x1, 0xF, 0x0, 0x90, 0x25, 0x1, 0xF, 0x0, 0x98, 0x25, 0x1, 0xF, 0x0, 0xA0, 0x25, 0x1, 0xF, 0x0, 0xA8, 0x25, 0x1, 0xF, 0x0, 0xB0, 0x25, 0x1, 0xF, 0x0, 0xB8, 0x25, 0x1, 0xF, 0x0, 0xC0, 0x25, 0x1, 0xF, 0x0, 0xC8, 0x25, 0x1, 0xF, 0x0, 0xD0, 0x25, 0x1, 0xF, 0x0, 0xD8, 0x25, 0x1, 0xF, 0x0, 0xE0, 0x25, 0x1, 0xF, 0x0, 0xE8, 0x25, 0x1, 0xF, 0x0, 0xF0, 0x25, 0x1, 0xF, 0x0, 0xF8, 0x25, 0x1, 0xF, 0x0, 0x0, 0x26, 0x1, 0xF, 0x0, 0x8, 0x26, 0x1, 0xF, 0x0, 0x10, 0x26, 0x1, 0xF, 0x0, 0x18, 0x26, 0x1, 0xF, 0x0, 0x20, 0x26, 0x1, 0xF, 0x0, 0x28, 0x26, 0x1, 0xF, 0x0, 0x30, 0x26, 0x1, 0xF, 0x0, 0x38, 0x26, 0x1, 0xF, 0x0, 0x40, 0x26, 0x1, 0xF, 0x0, 0x48, 0x26, 0x1, 0xF, 0x0, 0x50, 0x26, 0x1, 0xF, 0x0, 0x58, 0x26, 0x1, 0xF, 0x0, 0x60, 0x26, 0x1, 0xF, 0x0, 0x68, 0x26, 0x1, 0xF, 0x0, 0x70, 0x26, 0x1, 0xF, 0x0, 0x78, 0x26, 0x1, 0xF, 0x0, 0x80, 0x26, 0x1, 0xF, 0x0, 0x88, 0x26, 0x1, 0xF, 0x0, 0x90, 0x26, 0x1, 0xF, 0x0, 0x98, 0x26, 0x1, 0xF, 0x0, 0xA0, 0x26, 0x1, 0xF, 0x0, 0xA8, 0x26, 0x1, 0xF, 0x0, 0xB0, 0x26, 0x1, 0xF, 0x0, 0xB8, 0x26, 0x1, 0xF, 0x0, 0xC0, 0x26, 0x1, 0xF, 0x0, 0xC8, 0x26, 0x1, 0xF, 0x0, 0xD0, 0x26, 0x1, 0xF, 0x0, 0xD8, 0x26, 0x1, 0xF, 0x0, 0xE0, 0x26, 0x1, 0xF, 0x0, 0xE8, 0x26, 0x1, 0xF, 0x0, 0xF0, 0x26, 0x1, 0xF, 0x0, 0xF8, 0x26, 0x1, 0xF, 0x0, 0x0, 0x27, 0x1, 0xF, 0x0, 0x8, 0x27, 0x1, 0xF, 0x0, 0x10, 0x27, 0x1, 0xF, 0x0, 0x18, 0x27, 0x1, 0xF, 0x0, 0x20, 0x27, 0x1, 0xF, 0x0, 0x28, 0x27, 0x1, 0xF, 0x0, 0x30, 0x27, 0x1, 0xF, 0x0, 0x38, 0x27, 0x1, 0xF, 0x0, 0x40, 0x27, 0x1, 0xF, 0x0, 0x48, 0x27, 0x1, 0xF, 0x0, 0x50, 0x27, 0x1, 0xF, 0x0, 0x58, 0x27, 0x1, 0xF, 0x0, 0x60, 0x27, 0x1, 0xF, 0x0, 0x68, 0x27, 0x1, 0xF, 0x0, 0x70, 0x27, 0x1, 0xF, 0x0, 0x78, 0x27, 0x1, 0xF, 0x0, 0x80, 0x27, 0x1, 0xF, 0x0, 0x88, 0x27, 0x1, 0xF, 0x0, 0x90, 0x27, 0x1, 0xF, 0x0, 0x98, 0x27, 0x1, 0xF, 0x0, 0xA0, 0x27, 0x1, 0xF, 0x0, 0xA8, 0x27, 0x1, 0xF, 0x0, 0xB0, 0x27, 0x1, 0xF, 0x0, 0xB8, 0x27, 0x1, 0xF, 0x0, 0xC0, 0x27, 0x1, 0xF, 0x0, 0xC8, 0x27, 0x1, 0xF, 0x0, 0xD0, 0x27, 0x1, 0xF, 0x0, 0xD8, 0x27, 0x1, 0xF, 0x0, 0xE0, 0x27, 0x1, 0xF, 0x0, 0xE8, 0x27, 0x1, 0xF, 0x0, 0xF0, 0x27, 0x1, 0xF, 0x0, 0xF8, 0x27, 0x1, 0xF, 0x0, 0x0, 0x28, 0x1, 0xF, 0x0, 0x8, 0x28, 0x1, 0xF, 0x0, 0x10, 0x28, 0x1, 0xF, 0x0, 0x18, 0x28, 0x1, 0xF, 0x0, 0x20, 0x28, 0x1, 0xF, 0x0, 0x28, 0x28, 0x1, 0xF, 0x0, 0x30, 0x28, 0x1, 0xF, 0x0, 0x38, 0x28, 0x1, 0xF, 0x0, 0x40, 0x28, 0x1, 0xF, 0x0, 0x48, 0x28, 0x1, 0xF, 0x0, 0x50, 0x28, 0x1, 0xF, 0x0, 0x58, 0x28, 0x1, 0xF, 0x0, 0x60, 0x28, 0x1, 0xF, 0x0, 0x68, 0x28, 0x1, 0xF, 0x0, 0x70, 0x28, 0x1, 0xF, 0x0, 0x78, 0x28, 0x1, 0xF, 0x0, 0x80, 0x28, 0x1, 0xF, 0x0, 0x88, 0x28, 0x1, 0xF, 0x0, 0x90, 0x28, 0x1, 0xF, 0x0, 0x98, 0x28, 0x1, 0xF, 0x0, 0xA0, 0x28, 0x1, 0xF, 0x0, 0xA8, 0x28, 0x1, 0xF, 0x0, 0xB0, 0x28, 0x1, 0xF, 0x0, 0xB8, 0x28, 0x1, 0xF, 0x0, 0xC0, 0x28, 0x1, 0xF, 0x0, 0xC8, 0x28, 0x1, 0xF, 0x0, 0xD0, 0x28, 0x1, 0xF, 0x0, 0xD8, 0x28, 0x1, 0xF, 0x0, 0xE0, 0x28, 0x1, 0xF, 0x0, 0xE8, 0x28, 0x1, 0xF, 0x0, 0xF0, 0x28, 0x1, 0xF, 0x0, 0xF8, 0x28, 0x1, 0xF, 0x0, 0x0, 0x29, 0x1, 0xF, 0x0, 0x8, 0x29, 0x1, 0xF, 0x0, 0x10, 0x29, 0x1, 0xF, 0x0, 0x18, 0x29, 0x1, 0xF, 0x0, 0x20, 0x29, 0x1, 0xF, 0x0, 0x28, 0x29, 0x1, 0xF, 0x0, 0x30, 0x29, 0x1, 0xF, 0x0, 0x38, 0x29, 0x1, 0xF, 0x0, 0x40, 0x29, 0x1, 0xF, 0x0, 0x48, 0x29, 0x1, 0xF, 0x0, 0x50, 0x29, 0x1, 0xF, 0x0, 0x58, 0x29, 0x1, 0xF, 0x0, 0x60, 0x29, 0x1, 0xF, 0x0, 0x68, 0x29, 0x1, 0xF, 0x0, 0x70, 0x29, 0x1, 0xF, 0x0, 0x78, 0x29, 0x1, 0xF, 0x0, 0x80, 0x29, 0x1, 0xF, 0x0, 0x88, 0x29, 0x1, 0xF, 0x0, 0x90, 0x29, 0x1, 0xF, 0x0, 0x98, 0x29, 0x1, 0xF, 0x0, 0xA0, 0x29, 0x1, 0xF, 0x0, 0xA8, 0x29, 0x1, 0xF, 0x0, 0xB0, 0x29, 0x1, 0xF, 0x0, 0xB8, 0x29, 0x1, 0xF, 0x0, 0xC0, 0x29, 0x1, 0xF, 0x0, 0xC8, 0x29, 0x1, 0xF, 0x0, 0xD0, 0x29, 0x1, 0xF, 0x0, 0xD8, 0x29, 0x1, 0xF, 0x0, 0xE0, 0x29, 0x1, 0xF, 0x0, 0xE8, 0x29, 0x1, 0xF, 0x0, 0xF0, 0x29, 0x1, 0xF, 0x0, 0xF8, 0x29, 0x1, 0xF, 0x0, 0x0, 0x2A, 0x1, 0xF, 0x0, 0x8, 0x2A, 0x1, 0xF, 0x0, 0x10, 0x2A, 0x1, 0xF, 0x0, 0x18, 0x2A, 0x1, 0xF, 0x0, 0x20, 0x2A, 0x1, 0xF, 0x0, 0x28, 0x2A, 0x1, 0xF, 0x0, 0x30, 0x2A, 0x1, 0xF, 0x0, 0x38, 0x2A, 0x1, 0xF, 0x0, 0x40, 0x2A, 0x1, 0xF, 0x0, 0x48, 0x2A, 0x1, 0xF, 0x0, 0x50, 0x2A, 0x1, 0xF, 0x0, 0x58, 0x2A, 0x1, 0xF, 0x0, 0x60, 0x2A, 0x1, 0xF, 0x0, 0x68, 0x2A, 0x1, 0xF, 0x0, 0x70, 0x2A, 0x1, 0xF, 0x0, 0x78, 0x2A, 0x1, 0xF, 0x0, 0x80, 0x2A, 0x1, 0xF, 0x0, 0x88, 0x2A, 0x1, 0xF, 0x0, 0x90, 0x2A, 0x1, 0xF, 0x0, 0x98, 0x2A, 0x1, 0xF, 0x0, 0xA0, 0x2A, 0x1, 0xF, 0x0, 0xA8, 0x2A, 0x1, 0xF, 0x0, 0xB0, 0x2A, 0x1, 0xF, 0x0, 0xB8, 0x2A, 0x1, 0xF, 0x0, 0xC0, 0x2A, 0x1, 0xF, 0x0, 0xC8, 0x2A, 0x1, 0xF, 0x0, 0xD0, 0x2A, 0x1, 0xF, 0x0, 0xD8, 0x2A, 0x1, 0xF, 0x0, 0xE0, 0x2A, 0x1, 0xF, 0x0, 0xE8, 0x2A, 0x1, 0xF, 0x0, 0xF0, 0x2A, 0x1, 0xF, 0x0, 0xF8, 0x2A, 0x1, 0xF, 0x0, 0x0, 0x2B, 0x1, 0xF, 0x0, 0x8, 0x2B, 0x1, 0xF, 0x0, 0x10, 0x2B, 0x1, 0xF, 0x0, 0x18, 0x2B, 0x1, 0xF, 0x0, 0x20, 0x2B, 0x1, 0xF, 0x0, 0x28, 0x2B, 0x1, 0xF, 0x0, 0x30, 0x2B, 0x1, 0xF, 0x0, 0x38, 0x2B, 0x1, 0xF, 0x0, 0x40, 0x2B, 0x1, 0xF, 0x0, 0x48, 0x2B, 0x1, 0xF, 0x0, 0x50, 0x2B, 0x1, 0xF, 0x0, 0x58, 0x2B, 0x1, 0xF, 0x0, 0x60, 0x2B, 0x1, 0xF, 0x0, 0x68, 0x2B, 0x1, 0xF, 0x0, 0x70, 0x2B, 0x1, 0xF, 0x0, 0x78, 0x2B, 0x1, 0xF, 0x0, 0x80, 0x2B, 0x1, 0xF, 0x0, 0x88, 0x2B, 0x1, 0xF, 0x0, 0x90, 0x2B, 0x1, 0xF, 0x0, 0x98, 0x2B, 0x1, 0xF, 0x0, 0xA0, 0x2B, 0x1, 0xF, 0x0, 0xA8, 0x2B, 0x1, 0xF, 0x0, 0xB0, 0x2B, 0x1, 0xF, 0x0, 0xB8, 0x2B, 0x1, 0xF, 0x0, 0xC0, 0x2B, 0x1, 0xF, 0x0, 0xC8, 0x2B, 0x1, 0xF, 0x0, 0xD0, 0x2B, 0x1, 0xF, 0x0, 0xD8, 0x2B, 0x1, 0xF, 0x0, 0xE0, 0x2B, 0x1, 0xF, 0x0, 0xE8, 0x2B, 0x1, 0xF, 0x0, 0xF0, 0x2B, 0x1, 0xF, 0x0, 0xF8, 0x2B, 0x1, 0xF, 0x0, 0x0, 0x2C, 0x1, 0xF, 0x0, 0x8, 0x2C, 0x1, 0xF, 0x0, 0x10, 0x2C, 0x1, 0xF, 0x0, 0x18, 0x2C, 0x1, 0xF, 0x0, 0x20, 0x2C, 0x1, 0xF, 0x0, 0x28, 0x2C, 0x1, 0xF, 0x0, 0x30, 0x2C, 0x1, 0xF, 0x0, 0x38, 0x2C, 0x1, 0xF, 0x0, 0x40, 0x2C, 0x1, 0xF, 0x0, 0x48, 0x2C, 0x1, 0xF, 0x0, 0x50, 0x2C, 0x1, 0xF, 0x0, 0x58, 0x2C, 0x1, 0xF, 0x0, 0x60, 0x2C, 0x1, 0xF, 0x0, 0x68, 0x2C, 0x1, 0xF, 0x0, 0x70, 0x2C, 0x1, 0xF, 0x0, 0x78, 0x2C, 0x1, 0xF, 0x0, 0x80, 0x2C, 0x1, 0xF, 0x0, 0x88, 0x2C, 0x1, 0xF, 0x0, 0x90, 0x2C, 0x1, 0xF, 0x0, 0x98, 0x2C, 0x1, 0xF, 0x0, 0xA0, 0x2C, 0x1, 0xF, 0x0, 0xA8, 0x2C, 0x1, 0xF, 0x0, 0xB0, 0x2C, 0x1, 0xF, 0x0, 0xB8, 0x2C, 0x1, 0xF, 0x0, 0xC0, 0x2C, 0x1, 0xF, 0x0, 0xC8, 0x2C, 0x1, 0xF, 0x0, 0xD0, 0x2C, 0x1, 0xF, 0x0, 0xD8, 0x2C, 0x1, 0xF, 0x0, 0xE0, 0x2C, 0x1, 0xF, 0x0, 0xE8, 0x2C, 0x1, 0xF, 0x0, 0xF0, 0x2C, 0x1, 0xF, 0x0, 0xF8, 0x2C, 0x1, 0xF, 0x0, 0x0, 0x2D, 0x1, 0xF, 0x0, 0x8, 0x2D, 0x1, 0xF, 0x0, 0x10, 0x2D, 0x1, 0xF, 0x0, 0x18, 0x2D, 0x1, 0xF, 0x0, 0x20, 0x2D, 0x1, 0xF, 0x0, 0x28, 0x2D, 0x1, 0xF, 0x0, 0x30, 0x2D, 0x1, 0xF, 0x0, 0x38, 0x2D, 0x1, 0xF, 0x0, 0x40, 0x2D, 0x1, 0xF, 0x0, 0x48, 0x2D, 0x1, 0xF, 0x0, 0x50, 0x2D, 0x1, 0xF, 0x0, 0x58, 0x2D, 0x1, 0xF, 0x0, 0x60, 0x2D, 0x1, 0xF, 0x0, 0x68, 0x2D, 0x1, 0xF, 0x0, 0x70, 0x2D, 0x1, 0xF, 0x0, 0x78, 0x2D, 0x1, 0xF, 0x0, 0x80, 0x2D, 0x1, 0xF, 0x0, 0x88, 0x2D, 0x1, 0xF, 0x0, 0x90, 0x2D, 0x1, 0xF, 0x0, 0x98, 0x2D, 0x1, 0xF, 0x0, 0xA0, 0x2D, 0x1, 0xF, 0x0, 0xA8, 0x2D, 0x1, 0xF, 0x0, 0xB0, 0x2D, 0x1, 0xF, 0x0, 0xB8, 0x2D, 0x1, 0xF, 0x0, 0xC0, 0x2D, 0x1, 0xF, 0x0, 0xC8, 0x2D, 0x1, 0xF, 0x0, 0xD0, 0x2D, 0x1, 0xF, 0x0, 0xD8, 0x2D, 0x1, 0xF, 0x0, 0xE0, 0x2D, 0x1, 0xF, 0x0, 0xE8, 0x2D, 0x1, 0xF, 0x0, 0xF0, 0x2D, 0x1, 0xF, 0x0, 0xF8, 0x2D, 0x1, 0xF, 0x0, 0x0, 0x2E, 0x1, 0xF, 0x0, 0x8, 0x2E, 0x1, 0xF, 0x0, 0x10, 0x2E, 0x1, 0xF, 0x0, 0x18, 0x2E, 0x1, 0xF, 0x0, 0x20, 0x2E, 0x1, 0xF, 0x0, 0x28, 0x2E, 0x1, 0xF, 0x0, 0x30, 0x2E, 0x1, 0xF, 0x0, 0x38, 0x2E, 0x1, 0xF, 0x0, 0x40, 0x2E, 0x1, 0xF, 0x0, 0x48, 0x2E, 0x1, 0xF, 0x0, 0x50, 0x2E, 0x1, 0xF, 0x0, 0x58, 0x2E, 0x1, 0xF, 0x0, 0x60, 0x2E, 0x1, 0xF, 0x0, 0x68, 0x2E, 0x1, 0xF, 0x0, 0x70, 0x2E, 0x1, 0xF, 0x0, 0x78, 0x2E, 0x1, 0xF, 0x0, 0x80, 0x2E, 0x1, 0xF, 0x0, 0x88, 0x2E, 0x1, 0xF, 0x0, 0x90, 0x2E, 0x1, 0xF, 0x0, 0x98, 0x2E, 0x1, 0xF, 0x0, 0xA0, 0x2E, 0x1, 0xF, 0x0, 0xA8, 0x2E, 0x1, 0xF, 0x0, 0xB0, 0x2E, 0x1, 0xF, 0x0, 0xB8, 0x2E, 0x1, 0xF, 0x0, 0xC0, 0x2E, 0x1, 0xF, 0x0, 0xC8, 0x2E, 0x1, 0xF, 0x0, 0xD0, 0x2E, 0x1, 0xF, 0x0, 0xD8, 0x2E, 0x1, 0xF, 0x0, 0xE0, 0x2E, 0x1, 0xF, 0x0, 0xE8, 0x2E, 0x1, 0xF, 0x0, 0xF0, 0x2E, 0x1, 0xF, 0x0, 0xF8, 0x2E, 0x1, 0xF, 0x0, 0x0, 0x2F, 0x1, 0xF, 0x0, 0x8, 0x2F, 0x1, 0xF, 0x0, 0x10, 0x2F, 0x1, 0xF, 0x0, 0x18, 0x2F, 0x1, 0xF, 0x0, 0x20, 0x2F, 0x1, 0xF, 0x0, 0x28, 0x2F, 0x1, 0xF, 0x0, 0x30, 0x2F, 0x1, 0xF, 0x0, 0x38, 0x2F, 0x1, 0xF, 0x0, 0x40, 0x2F, 0x1, 0xF, 0x0, 0x48, 0x2F, 0x1, 0xF, 0x0, 0x50, 0x2F, 0x1, 0xF, 0x0, 0x58, 0x2F, 0x1, 0xF, 0x0, 0x60, 0x2F, 0x1, 0xF, 0x0, 0x68, 0x2F, 0x1, 0xF, 0x0, 0x70, 0x2F, 0x1, 0xF, 0x0, 0x78, 0x2F, 0x1, 0xF, 0x0, 0x80, 0x2F, 0x1, 0xF, 0x0, 0x88, 0x2F, 0x1, 0xF, 0x0, 0x90, 0x2F, 0x1, 0xF, 0x0, 0x98, 0x2F, 0x1, 0xF, 0x0, 0xA0, 0x2F, 0x1, 0xF, 0x0, 0xA8, 0x2F, 0x1, 0xF, 0x0, 0xB0, 0x2F, 0x1, 0xF, 0x0, 0xB8, 0x2F, 0x1, 0xF, 0x0, 0xC0, 0x2F, 0x1, 0xF, 0x0, 0xC8, 0x2F, 0x1, 0xF, 0x0, 0xD0, 0x2F, 0x1, 0xF, 0x0, 0xD8, 0x2F, 0x1, 0xF, 0x0, 0xE0, 0x2F, 0x1, 0xF, 0x0, 0xE8, 0x2F, 0x1, 0xF, 0x0, 0xF0, 0x2F, 0x1, 0xF, 0x0, 0xF8, 0x2F, 0x1, 0xF, 0x0, 0x0, 0x30, 0x1, 0xF, 0x0, 0x8, 0x30, 0x1, 0xF, 0x0, 0x10, 0x30, 0x1, 0xF, 0x0, 0x18, 0x30, 0x1, 0xF, 0x0, 0x20, 0x30, 0x1, 0xF, 0x0, 0x28, 0x30, 0x1, 0xF, 0x0, 0x30, 0x30, 0x1, 0xF, 0x0, 0x38, 0x30, 0x1, 0xF, 0x0, 0x40, 0x30, 0x1, 0xF, 0x0, 0x48, 0x30, 0x1, 0xF, 0x0, 0x50, 0x30, 0x1, 0xF, 0x0, 0x58, 0x30, 0x1, 0xF, 0x0, 0x60, 0x30, 0x1, 0xF, 0x0, 0x68, 0x30, 0x1, 0xF, 0x0, 0x70, 0x30, 0x1, 0xF, 0x0, 0x78, 0x30, 0x1, 0xF, 0x0, 0x80, 0x30, 0x1, 0xF, 0x0, 0x88, 0x30, 0x1, 0xF, 0x0, 0x90, 0x30, 0x1, 0xF, 0x0, 0x98, 0x30, 0x1, 0xF, 0x0, 0xA0, 0x30, 0x1, 0xF, 0x0, 0xA8, 0x30, 0x1, 0xF, 0x0, 0xB0, 0x30, 0x1, 0xF, 0x0, 0xB8, 0x30, 0x1, 0xF, 0x0, 0xC0, 0x30, 0x1, 0xF, 0x0, 0xC8, 0x30, 0x1, 0xF, 0x0, 0xD0, 0x30, 0x1, 0xF, 0x0, 0xD8, 0x30, 0x1, 0xF, 0x0, 0xE0, 0x30, 0x1, 0xF, 0x0, 0xE8, 0x30, 0x1, 0xF, 0x0, 0xF0, 0x30, 0x1, 0xF, 0x0, 0xF8, 0x30, 0x1, 0xF, 0x0, 0x0, 0x31, 0x1, 0xF, 0x0, 0x8, 0x31, 0x1, 0xF, 0x0, 0x10, 0x31, 0x1, 0xF, 0x0, 0x18, 0x31, 0x1, 0xF, 0x0, 0x20, 0x31, 0x1, 0xF, 0x0, 0x28, 0x31, 0x1, 0xF, 0x0, 0x30, 0x31, 0x1, 0xF, 0x0, 0x38, 0x31, 0x1, 0xF, 0x0, 0x40, 0x31, 0x1, 0xF, 0x0, 0x48, 0x31, 0x1, 0xF, 0x0, 0x50, 0x31, 0x1, 0xF, 0x0, 0x58, 0x31, 0x1, 0xF, 0x0, 0x60, 0x31, 0x1, 0xF, 0x0, 0x68, 0x31, 0x1, 0xF, 0x0, 0x70, 0x31, 0x1, 0xF, 0x0, 0x78, 0x31, 0x1, 0xF, 0x0, 0x80, 0x31, 0x1, 0xF, 0x0, 0x88, 0x31, 0x1, 0xF, 0x0, 0x90, 0x31, 0x1, 0xF, 0x0, 0x98, 0x31, 0x1, 0xF, 0x0, 0xA0, 0x31, 0x1, 0xF, 0x0, 0xA8, 0x31, 0x1, 0xF, 0x0, 0xB0, 0x31, 0x1, 0xF, 0x0, 0xB8, 0x31, 0x1, 0xF, 0x0, 0xC0, 0x31, 0x1, 0xF, 0x0, 0xC8, 0x31, 0x1, 0xF, 0x0, 0xD0, 0x31, 0x1, 0xF, 0x0, 0xD8, 0x31, 0x1, 0xF, 0x0, 0xE0, 0x31, 0x1, 0xF, 0x0, 0xE8, 0x31, 0x1, 0xF, 0x0, 0xF0, 0x31, 0x1, 0xF, 0x0, 0xF8, 0x31, 0x1, 0xF, 0x0, 0x0, 0x32, 0x1, 0xF, 0x0, 0x8, 0x32, 0x1, 0xF, 0x0, 0x10, 0x32, 0x1, 0xF, 0x0, 0x18, 0x32, 0x1, 0xF, 0x0, 0x20, 0x32, 0x1, 0xF, 0x0, 0x28, 0x32, 0x1, 0xF, 0x0, 0x30, 0x32, 0x1, 0xF, 0x0, 0x38, 0x32, 0x1, 0xF, 0x0, 0x40, 0x32, 0x1, 0xF, 0x0, 0x48, 0x32, 0x1, 0xF, 0x0, 0x50, 0x32, 0x1, 0xF, 0x0, 0x58, 0x32, 0x1, 0xF, 0x0, 0x60, 0x32, 0x1, 0xF, 0x0, 0x68, 0x32, 0x1, 0xF, 0x0, 0x70, 0x32, 0x1, 0xF, 0x0, 0x78, 0x32, 0x1, 0xF, 0x0, 0x80, 0x32, 0x1, 0xF, 0x0, 0x88, 0x32, 0x1, 0xF, 0x0, 0x90, 0x32, 0x1, 0xF, 0x0, 0x98, 0x32, 0x1, 0xF, 0x0, 0xA0, 0x32, 0x1, 0xF, 0x0, 0xA8, 0x32, 0x1, 0xF, 0x0, 0xB0, 0x32, 0x1, 0xF, 0x0, 0xB8, 0x32, 0x1, 0xF, 0x0, 0xC0, 0x32, 0x1, 0xF, 0x0, 0xC8, 0x32, 0x1, 0xF, 0x0, 0xD0, 0x32, 0x1, 0xF, 0x0, 0xD8, 0x32, 0x1, 0xF, 0x0, 0xE0, 0x32, 0x1, 0xF, 0x0, 0xE8, 0x32, 0x1, 0xF, 0x0, 0xF0, 0x32, 0x1, 0xF, 0x0, 0xF8, 0x32, 0x1, 0xF, 0x0, 0x0, 0x33, 0x1, 0xF, 0x0, 0x8, 0x33, 0x1, 0xF, 0x0, 0x10, 0x33, 0x1, 0xF, 0x0, 0x18, 0x33, 0x1, 0xF, 0x0, 0x20, 0x33, 0x1, 0xF, 0x0, 0x28, 0x33, 0x1, 0xF, 0x0, 0x30, 0x33, 0x1, 0xF, 0x0, 0x38, 0x33, 0x1, 0xF, 0x0, 0x40, 0x33, 0x1, 0xF, 0x0, 0x48, 0x33, 0x1, 0xF, 0x0, 0x50, 0x33, 0x1, 0xF, 0x0, 0x58, 0x33, 0x1, 0xF, 0x0, 0x60, 0x33, 0x1, 0xF, 0x0, 0x68, 0x33, 0x1, 0xF, 0x0, 0x70, 0x33, 0x1, 0xF, 0x0, 0x78, 0x33, 0x1, 0xF, 0x0, 0x80, 0x33, 0x1, 0xF, 0x0, 0x88, 0x33, 0x1, 0xF, 0x0, 0x90, 0x33, 0x1, 0xF, 0x0, 0x98, 0x33, 0x1, 0xF, 0x0, 0xA0, 0x33, 0x1, 0xF, 0x0, 0xA8, 0x33, 0x1, 0xF, 0x0, 0xB0, 0x33, 0x1, 0xF, 0x0, 0xB8, 0x33, 0x1, 0xF, 0x0, 0xC0, 0x33, 0x1, 0xF, 0x0, 0xC8, 0x33, 0x1, 0xF, 0x0, 0xD0, 0x33, 0x1, 0xF, 0x0, 0xD8, 0x33, 0x1, 0xF, 0x0, 0xE0, 0x33, 0x1, 0xF, 0x0, 0xE8, 0x33, 0x1, 0xF, 0x0, 0xF0, 0x33, 0x1, 0xF, 0x0, 0xF8, 0x33, 0x1, 0xF, 0x0, 0x0, 0x34, 0x1, 0xF, 0x0, 0x8, 0x34, 0x1, 0xF, 0x0, 0x10, 0x34, 0x1, 0xF, 0x0, 0x18, 0x34, 0x1, 0xF, 0x0, 0x20, 0x34, 0x1, 0xF, 0x0, 0x28, 0x34, 0x1, 0xF, 0x0, 0x30, 0x34, 0x1, 0xF, 0x0, 0x38, 0x34, 0x1, 0xF, 0x0, 0x40, 0x34, 0x1, 0xF, 0x0, 0x48, 0x34, 0x1, 0xF, 0x0, 0x50, 0x34, 0x1, 0xF, 0x0, 0x58, 0x34, 0x1, 0xF, 0x0, 0x60, 0x34, 0x1, 0xF, 0x0, 0x68, 0x34, 0x1, 0xF, 0x0, 0x70, 0x34, 0x1, 0xF, 0x0, 0x78, 0x34, 0x1, 0xF, 0x0, 0x80, 0x34, 0x1, 0xF, 0x0, 0x88, 0x34, 0x1, 0xF, 0x0, 0x90, 0x34, 0x1, 0xF, 0x0, 0x98, 0x34, 0x1, 0xF, 0x0, 0xA0, 0x34, 0x1, 0xF, 0x0, 0xA8, 0x34, 0x1, 0xF, 0x0, 0xB0, 0x34, 0x1, 0xF, 0x0, 0xB8, 0x34, 0x1, 0xF, 0x0, 0xC0, 0x34, 0x1, 0xF, 0x0, 0xC8, 0x34, 0x1, 0xF, 0x0, 0xD0, 0x34, 0x1, 0xF, 0x0, 0xD8, 0x34, 0x1, 0xF, 0x0, 0xE0, 0x34, 0x1, 0xF, 0x0, 0xE8, 0x34, 0x1, 0xF, 0x0, 0xF0, 0x34, 0x1, 0xF, 0x0, 0xF8, 0x34, 0x1, 0xF, 0x0, 0x0, 0x35, 0x1, 0xF, 0x0, 0x8, 0x35, 0x1, 0xF, 0x0, 0x10, 0x35, 0x1, 0xF, 0x0, 0x18, 0x35, 0x1, 0xF, 0x0, 0x20, 0x35, 0x1, 0xF, 0x0, 0x28, 0x35, 0x1, 0xF, 0x0, 0x30, 0x35, 0x1, 0xF, 0x0, 0x38, 0x35, 0x1, 0xF, 0x0, 0x40, 0x35, 0x1, 0xF, 0x0, 0x48, 0x35, 0x1, 0xF, 0x0, 0x50, 0x35, 0x1, 0xF, 0x0, 0x58, 0x35, 0x1, 0xF, 0x0, 0x60, 0x35, 0x1, 0xF, 0x0, 0x68, 0x35, 0x1, 0xF, 0x0, 0x70, 0x35, 0x1, 0xF, 0x0, 0x78, 0x35, 0x1, 0xF, 0x0, 0x80, 0x35, 0x1, 0xF, 0x0, 0x88, 0x35, 0x1, 0xF, 0x0, 0x90, 0x35, 0x1, 0xF, 0x0, 0x98, 0x35, 0x1, 0xF, 0x0, 0xA0, 0x35, 0x1, 0xF, 0x0, 0xA8, 0x35, 0x1, 0xF, 0x0, 0xB0, 0x35, 0x1, 0xF, 0x0, 0xB8, 0x35, 0x1, 0xF, 0x0, 0xC0, 0x35, 0x1, 0xF, 0x0, 0xC8, 0x35, 0x1, 0xF, 0x0, 0xD0, 0x35, 0x1, 0xF, 0x0, 0xD8, 0x35, 0x1, 0xF, 0x0, 0xE0, 0x35, 0x1, 0xF, 0x0, 0xE8, 0x35, 0x1, 0xF, 0x0, 0xF0, 0x35, 0x1, 0xF, 0x0, 0xF8, 0x35, 0x1, 0xF, 0x0, 0x0, 0x36, 0x1, 0xF, 0x0, 0x8, 0x36, 0x1, 0xF, 0x0, 0x10, 0x36, 0x1, 0xF, 0x0, 0x18, 0x36, 0x1, 0xF, 0x0, 0x20, 0x36, 0x1, 0xF, 0x0, 0x28, 0x36, 0x1, 0xF, 0x0, 0x30, 0x36, 0x1, 0xF, 0x0, 0x38, 0x36, 0x1, 0xF, 0x0, 0x40, 0x36, 0x1, 0xF, 0x0, 0x48, 0x36, 0x1, 0xF, 0x0, 0x50, 0x36, 0x1, 0xF, 0x0, 0x58, 0x36, 0x1, 0xF, 0x0, 0x60, 0x36, 0x1, 0xF, 0x0, 0x68, 0x36, 0x1, 0xF, 0x0, 0x70, 0x36, 0x1, 0xF, 0x0, 0x78, 0x36, 0x1, 0xF, 0x0, 0x80, 0x36, 0x1, 0xF, 0x0, 0x88, 0x36, 0x1, 0xF, 0x0, 0x90, 0x36, 0x1, 0xF, 0x0, 0x98, 0x36, 0x1, 0xF, 0x0, 0xA0, 0x36, 0x1, 0xF, 0x0, 0xA8, 0x36, 0x1, 0xF, 0x0, 0xB0, 0x36, 0x1, 0xF, 0x0, 0xB8, 0x36, 0x1, 0xF, 0x0, 0xC0, 0x36, 0x1, 0xF, 0x0, 0xC8, 0x36, 0x1, 0xF, 0x0, 0xD0, 0x36, 0x1, 0xF, 0x0, 0xD8, 0x36, 0x1, 0xF, 0x0, 0xE0, 0x36, 0x1, 0xF, 0x0, 0xE8, 0x36, 0x1, 0xF, 0x0, 0xF0, 0x36, 0x1, 0xF, 0x0, 0xF8, 0x36, 0x1, 0xF, 0x0, 0x0, 0x37, 0x1, 0xF, 0x0, 0x8, 0x37, 0x1, 0xF, 0x0, 0x10, 0x37, 0x1, 0xF, 0x0, 0x18, 0x37, 0x1, 0xF, 0x0, 0x20, 0x37, 0x1, 0xF, 0x0, 0x28, 0x37, 0x1, 0xF, 0x0, 0x30, 0x37, 0x1, 0xF, 0x0, 0x38, 0x37, 0x1, 0xF, 0x0, 0x40, 0x37, 0x1, 0xF, 0x0, 0x48, 0x37, 0x1, 0xF, 0x0, 0x50, 0x37, 0x1, 0xF, 0x0, 0x58, 0x37, 0x1, 0xF, 0x0, 0x60, 0x37, 0x1, 0xF, 0x0, 0x68, 0x37, 0x1, 0xF, 0x0, 0x70, 0x37, 0x1, 0xF, 0x0, 0x78, 0x37, 0x1, 0xF, 0x0, 0x80, 0x37, 0x1, 0xF, 0x0, 0x88, 0x37, 0x1, 0xF, 0x0, 0x90, 0x37, 0x1, 0xF, 0x0, 0x98, 0x37, 0x1, 0xF, 0x0, 0xA0, 0x37, 0x1, 0xF, 0x0, 0xA8, 0x37, 0x1, 0xF, 0x0, 0xB0, 0x37, 0x1, 0xF, 0x0, 0xB8, 0x37, 0x1, 0xF, 0x0, 0xC0, 0x37, 0x1, 0xF, 0x0, 0xC8, 0x37, 0x1, 0xF, 0x0, 0xD0, 0x37, 0x1, 0xF, 0x0, 0xD8, 0x37, 0x1, 0xF, 0x0, 0xE0, 0x37, 0x1, 0xF, 0x0, 0xE8, 0x37, 0x1, 0xF, 0x0, 0xF0, 0x37, 0x1, 0xF, 0x0, 0xF8, 0x37, 0x1, 0xF, 0x0, 0x0, 0x38, 0x1, 0xF, 0x0, 0x8, 0x38, 0x1, 0xF, 0x0, 0x10, 0x38, 0x1, 0xF, 0x0, 0x18, 0x38, 0x1, 0xF, 0x0, 0x20, 0x38, 0x1, 0xF, 0x0, 0x28, 0x38, 0x1, 0xF, 0x0, 0x30, 0x38, 0x1, 0xF, 0x0, 0x38, 0x38, 0x1, 0xF, 0x0, 0x40, 0x38, 0x1, 0xF, 0x0, 0x48, 0x38, 0x1, 0xF, 0x0, 0x50, 0x38, 0x1, 0xF, 0x0, 0x58, 0x38, 0x1, 0xF, 0x0, 0x60, 0x38, 0x1, 0xF, 0x0, 0x68, 0x38, 0x1, 0xF, 0x0, 0x70, 0x38, 0x1, 0xF, 0x0, 0x78, 0x38, 0x1, 0xF, 0x0, 0x80, 0x38, 0x1, 0xF, 0x0, 0x88, 0x38, 0x1, 0xF, 0x0, 0x90, 0x38, 0x1, 0xF, 0x0, 0x98, 0x38, 0x1, 0xF, 0x0, 0xA0, 0x38, 0x1, 0xF, 0x0, 0xA8, 0x38, 0x1, 0xF, 0x0, 0xB0, 0x38, 0x1, 0xF, 0x0, 0xB8, 0x38, 0x1, 0xF, 0x0, 0xC0, 0x38, 0x1, 0xF, 0x0, 0xC8, 0x38, 0x1, 0xF, 0x0, 0xD0, 0x38, 0x1, 0xF, 0x0, 0xD8, 0x38, 0x1, 0xF, 0x0, 0xE0, 0x38, 0x1, 0xF, 0x0, 0xE8, 0x38, 0x1, 0xF, 0x0, 0xF0, 0x38, 0x1, 0xF, 0x0, 0xF8, 0x38, 0x1, 0xF, 0x0, 0x0, 0x39, 0x1, 0xF, 0x0, 0x8, 0x39, 0x1, 0xF, 0x0, 0x10, 0x39, 0x1, 0xF, 0x0, 0x18, 0x39, 0x1, 0xF, 0x0, 0x20, 0x39, 0x1, 0xF, 0x0, 0x28, 0x39, 0x1, 0xF, 0x0, 0x30, 0x39, 0x1, 0xF, 0x0, 0x38, 0x39, 0x1, 0xF, 0x0, 0x40, 0x39, 0x1, 0xF, 0x0, 0x48, 0x39, 0x1, 0xF, 0x0, 0x50, 0x39, 0x1, 0xF, 0x0, 0x58, 0x39, 0x1, 0xF, 0x0, 0x60, 0x39, 0x1, 0xF, 0x0, 0x68, 0x39, 0x1, 0xF, 0x0, 0x70, 0x39, 0x1, 0xF, 0x0, 0x78, 0x39, 0x1, 0xF, 0x0, 0x80, 0x39, 0x1, 0xF, 0x0, 0x88, 0x39, 0x1, 0xF, 0x0, 0x90, 0x39, 0x1, 0xF, 0x0, 0x98, 0x39, 0x1, 0xF, 0x0, 0xA0, 0x39, 0x1, 0xF, 0x0, 0xA8, 0x39, 0x1, 0xF, 0x0, 0xB0, 0x39, 0x1, 0xF, 0x0, 0xB8, 0x39, 0x1, 0xF, 0x0, 0xC0, 0x39, 0x1, 0xF, 0x0, 0xC8, 0x39, 0x1, 0xF, 0x0, 0xD0, 0x39, 0x1, 0xF, 0x0, 0xD8, 0x39, 0x1, 0xF, 0x0, 0xE0, 0x39, 0x1, 0xF, 0x0, 0xE8, 0x39, 0x1, 0xF, 0x0, 0xF0, 0x39, 0x1, 0xF, 0x0, 0xF8, 0x39, 0x1, 0xF, 0x0, 0x0, 0x3A, 0x1, 0xF, 0x0, 0x8, 0x3A, 0x1, 0xF, 0x0, 0x10, 0x3A, 0x1, 0xF, 0x0, 0x18, 0x3A, 0x1, 0xF, 0x0, 0x20, 0x3A, 0x1, 0xF, 0x0, 0x28, 0x3A, 0x1, 0xF, 0x0, 0x30, 0x3A, 0x1, 0xF, 0x0, 0x38, 0x3A, 0x1, 0xF, 0x0, 0x40, 0x3A, 0x1, 0xF, 0x0, 0x48, 0x3A, 0x1, 0xF, 0x0, 0x50, 0x3A, 0x1, 0xF, 0x0, 0x58, 0x3A, 0x1, 0xF, 0x0, 0x60, 0x3A, 0x1, 0xF, 0x0, 0x68, 0x3A, 0x1, 0xF, 0x0, 0x70, 0x3A, 0x1, 0xF, 0x0, 0x78, 0x3A, 0x1, 0xF, 0x0, 0x80, 0x3A, 0x1, 0xF, 0x0, 0x88, 0x3A, 0x1, 0xF, 0x0, 0x90, 0x3A, 0x1, 0xF, 0x0, 0x98, 0x3A, 0x1, 0xF, 0x0, 0xA0, 0x3A, 0x1, 0xF, 0x0, 0xA8, 0x3A, 0x1, 0xF, 0x0, 0xB0, 0x3A, 0x1, 0xF, 0x0, 0xB8, 0x3A, 0x1, 0xF, 0x0, 0xC0, 0x3A, 0x1, 0xF, 0x0, 0xC8, 0x3A, 0x1, 0xF, 0x0, 0xD0, 0x3A, 0x1, 0xF, 0x0, 0xD8, 0x3A, 0x1, 0xF, 0x0, 0xE0, 0x3A, 0x1, 0xF, 0x0, 0xE8, 0x3A, 0x1, 0xF, 0x0, 0xF0, 0x3A, 0x1, 0xF, 0x0, 0xF8, 0x3A, 0x1, 0xF, 0x0, 0x0, 0x3B, 0x1, 0xF, 0x0, 0x8, 0x3B, 0x1, 0xF, 0x0, 0x10, 0x3B, 0x1, 0xF, 0x0, 0x18, 0x3B, 0x1, 0xF, 0x0, 0x20, 0x3B, 0x1, 0xF, 0x0, 0x28, 0x3B, 0x1, 0xF, 0x0, 0x30, 0x3B, 0x1, 0xF, 0x0, 0x38, 0x3B, 0x1, 0xF, 0x0, 0x40, 0x3B, 0x1, 0xF, 0x0, 0x48, 0x3B, 0x1, 0xF, 0x0, 0x50, 0x3B, 0x1, 0xF, 0x0, 0x58, 0x3B, 0x1, 0xF, 0x0, 0x60, 0x3B, 0x1, 0xF, 0x0, 0x68, 0x3B, 0x1, 0xF, 0x0, 0x70, 0x3B, 0x1, 0xF, 0x0, 0x78, 0x3B, 0x1, 0xF, 0x0, 0x80, 0x3B, 0x1, 0xF, 0x0, 0x88, 0x3B, 0x1, 0xF, 0x0, 0x90, 0x3B, 0x1, 0xF, 0x0, 0x98, 0x3B, 0x1, 0xF, 0x0, 0xA0, 0x3B, 0x1, 0xF, 0x0, 0xA8, 0x3B, 0x1, 0xF, 0x0, 0xB0, 0x3B, 0x1, 0xF, 0x0, 0xB8, 0x3B, 0x1, 0xF, 0x0, 0xC0, 0x3B, 0x1, 0xF, 0x0, 0xC8, 0x3B, 0x1, 0xF, 0x0, 0xD0, 0x3B, 0x1, 0xF, 0x0, 0xD8, 0x3B, 0x1, 0xF, 0x0, 0xE0, 0x3B, 0x1, 0xF, 0x0, 0xE8, 0x3B, 0x1, 0xF, 0x0, 0xF0, 0x3B, 0x1, 0xF, 0x0, 0xF8, 0x3B, 0x1, 0xF, 0x0, 0x0, 0x3C, 0x1, 0xF, 0x0, 0x8, 0x3C, 0x1, 0xF, 0x0, 0x10, 0x3C, 0x1, 0xF, 0x0, 0x18, 0x3C, 0x1, 0xF, 0x0, 0x20, 0x3C, 0x1, 0xF, 0x0, 0x28, 0x3C, 0x1, 0xF, 0x0, 0x30, 0x3C, 0x1, 0xF, 0x0, 0x38, 0x3C, 0x1, 0xF, 0x0, 0x40, 0x3C, 0x1, 0xF, 0x0, 0x48, 0x3C, 0x1, 0xF, 0x0, 0x50, 0x3C, 0x1, 0xF, 0x0, 0x58, 0x3C, 0x1, 0xF, 0x0, 0x60, 0x3C, 0x1, 0xF, 0x0, 0x68, 0x3C, 0x1, 0xF, 0x0, 0x70, 0x3C, 0x1, 0xF, 0x0, 0x78, 0x3C, 0x1, 0xF, 0x0, 0x80, 0x3C, 0x1, 0xF, 0x0, 0x88, 0x3C, 0x1, 0xF, 0x0, 0x90, 0x3C, 0x1, 0xF, 0x0, 0x98, 0x3C, 0x1, 0xF, 0x0, 0xA0, 0x3C, 0x1, 0xF, 0x0, 0xA8, 0x3C, 0x1, 0xF, 0x0, 0xB0, 0x3C, 0x1, 0xF, 0x0, 0xB8, 0x3C, 0x1, 0xF, 0x0, 0xC0, 0x3C, 0x1, 0xF, 0x0, 0xC8, 0x3C, 0x1, 0xF, 0x0, 0xD0, 0x3C, 0x1, 0xF, 0x0, 0xD8, 0x3C, 0x1, 0xF, 0x0, 0xE0, 0x3C, 0x1, 0xF, 0x0, 0xE8, 0x3C, 0x1, 0xF, 0x0, 0xF0, 0x3C, 0x1, 0xF, 0x0, 0xF8, 0x3C, 0x1, 0xF, 0x0, 0x0, 0x3D, 0x1, 0xF, 0x0, 0x8, 0x3D, 0x1, 0xF, 0x0, 0x10, 0x3D, 0x1, 0xF, 0x0, 0x18, 0x3D, 0x1, 0xF, 0x0, 0x20, 0x3D, 0x1, 0xF, 0x0, 0x28, 0x3D, 0x1, 0xF, 0x0, 0x30, 0x3D, 0x1, 0xF, 0x0, 0x38, 0x3D, 0x1, 0xF, 0x0, 0x40, 0x3D, 0x1, 0xF, 0x0, 0x48, 0x3D, 0x1, 0xF, 0x0, 0x50, 0x3D, 0x1, 0xF, 0x0, 0x58, 0x3D, 0x1, 0xF, 0x0, 0x60, 0x3D, 0x1, 0xF, 0x0, 0x68, 0x3D, 0x1, 0xF, 0x0, 0x70, 0x3D, 0x1, 0xF, 0x0, 0x78, 0x3D, 0x1, 0xF, 0x0, 0x80, 0x3D, 0x1, 0xF, 0x0, 0x88, 0x3D, 0x1, 0xF, 0x0, 0x90, 0x3D, 0x1, 0xF, 0x0, 0x98, 0x3D, 0x1, 0x10, 0x0, 0xA0, 0x3D, 0x1, 0xB0, 0xF6, 0xB4, 0x3D, 0x1, 0xF0, 0xF6, 0xC4, 0x3D, 0x1, 0x30, 0xF7, 0xD4, 0x3D, 0x1, 0x70, 0xF7, 0xE4, 0x3D, 0x1, 0xB0, 0xF7, 0xF4, 0x3D, 0x1, 0xF0, 0xF7, 0x4, 0x3E, 0x1, 0x30, 0xF8, 0x14, 0x3E, 0x1, 0x70, 0xF8, 0x24, 0x3E, 0x1, 0xB0, 0xF8, 0x34, 0x3E, 0x1, 0xF0, 0xF8, 0x44, 0x3E, 0x1, 0x30, 0xF9, 0x54, 0x3E, 0x1, 0x70, 0xF9, 0x64, 0x3E, 0x1, 0xB0, 0xF9, 0x4, 0x0, 0x0, 0xD0, 0xF9, 0x7C, 0x3E, 0x1, 0x10, 0xFA, 0x8C, 0x3E, 0x1, 0x50, 0xFA, 0x9C, 0x3E, 0x1, 0x90, 0xFA, 0xAC, 0x3E, 0x1, 0xD0, 0xFA, 0xBC, 0x3E, 0x1, 0x10, 0xFB, 0xCC, 0x3E, 0x1, 0x50, 0xFB, 0xDC, 0x3E, 0x1, 0x90, 0xFB, 0xEC, 0x3E, 0x1, 0xD0, 0xFB, 0xFC, 0x3E, 0x1, 0x10, 0xFC, 0xC, 0x3F, 0x1, 0x50, 0xFC, 0x1C, 0x3F, 0x1, 0x90, 0xFC, 0x2C, 0x3F, 0x1, 0xD0, 0xFC, 0x3C, 0x3F, 0x1, 0x10, 0xFD, 0x4C, 0x3F, 0x1, 0x50, 0xFD, 0x5C, 0x3F, 0x1, 0x90, 0xFD, 0x6C, 0x3F, 0x1, 0xD0, 0xFD, 0x7C, 0x3F, 0x1, 0x10, 0xFE, 0x8C, 0x3F, 0x1, 0x50, 0xFE, 0x9C, 0x3F, 0x1, 0x90, 0xFE, 0xAC, 0x3F, 0x1, 0xD0, 0xFE, 0xBC, 0x3F, 0x1, 0x10, 0xFF, 0xCC, 0x3F, 0x1, 0x50, 0xFF, 0xDC, 0x3F, 0x1, 0x90, 0xFF, 0xEC, 0x3F, 0x1, 0xD0, 0xFF, 0xFC, 0x3F, 0x1, 0x10, 0x0, 0xD, 0x40, 0x1, 0x50, 0x0, 0x1D, 0x40, 0x1, 0x90, 0x0, 0x2D, 0x40, 0x1, 0xD0, 0x0, 0x3D, 0x40, 0x1, 0x10, 0x1, 0x4D, 0x40, 0x1, 0x50, 0x1, 0x5D, 0x40, 0x1, 0x90, 0x1, 0x6D, 0x40, 0x1, 0xD0, 0x1, 0x7D, 0x40, 0x1, 0x10, 0x2, 0x8D, 0x40, 0x1, 0x50, 0x2, 0x9D, 0x40, 0x1, 0x90, 0x2, 0xAD, 0x40, 0x1, 0xD0, 0x2, 0xBD, 0x40, 0x1, 0x10, 0x3, 0xCD, 0x40, 0x1, 0x50, 0x3, 0xDD, 0x40, 0x1, 0x90, 0x3, 0xED, 0x40, 0x1, 0xD0, 0x3, 0x5, 0x0, 0x0, 0x10, 0x0, 0xF8, 0x40, 0x1, 0x10, 0x4, 0xD, 0x41, 0x1, 0xD0, 0x3, 0x4D, 0x41, 0x1, 0x50, 0x5, 0x5D, 0x41, 0x1, 0x10, 0x0, 0x60, 0x41, 0x1, 0xB0, 0x5, 0x75, 0x41, 0x1, 0xF0, 0x5, 0x85, 0x41, 0x1, 0x10, 0x0, 0x8, 0x41, 0x1, 0xB0, 0x7, 0xF5, 0x41, 0x1, 0xD0, 0x7, 0x5, 0x0, 0x0, 0x90, 0x8, 0x2D, 0x42, 0x1, 0xB0, 0x8, 0x35, 0x42, 0x1, 0xD0, 0x8, 0x5, 0x0, 0x0, 0x50, 0x12, 0x5, 0x0, 0x0, 0x70, 0x12, 0x5, 0x0, 0x0, 0x90, 0x12, 0xAD, 0x44, 0x1, 0xD0, 0x12, 0xBD, 0x44, 0x1, 0x10, 0x13, 0xCD, 0x44, 0x1, 0x50, 0x13, 0xDD, 0x44, 0x1, 0x90, 0x13, 0xED, 0x44, 0x1, 0xD0, 0x13, 0xFD, 0x44, 0x1, 0x10, 0x14, 0xD, 0x45, 0x1, 0x50, 0x14, 0x1D, 0x45, 0x1, 0x90, 0x14, 0x2D, 0x45, 0x1, 0xD0, 0x14, 0x3D, 0x45, 0x1, 0x10, 0x15, 0x4D, 0x45, 0x1, 0x50, 0x15, 0x5D, 0x45, 0x1, 0x90, 0x15, 0x6D, 0x45, 0x1, 0xD0, 0x15, 0x7D, 0x45, 0x1, 0x10, 0x16, 0x8D, 0x45, 0x1, 0x50, 0x16, 0x9D, 0x45, 0x1, 0x90, 0x16, 0xAD, 0x45, 0x1, 0xD0, 0x16, 0xBD, 0x45, 0x1, 0x10, 0x17, 0xCD, 0x45, 0x1, 0x10, 0x0, 0xD8, 0x45, 0x1, 0x70, 0x17, 0xE5, 0x45, 0x1, 0x90, 0x17, 0x5, 0x0, 0x0, 0xF0, 0x1D, 0x85, 0x47, 0x1, 0x10, 0x0, 0x88, 0x47, 0x1, 0x30, 0x1E, 0x5, 0x0, 0x0, 0x10, 0x0, 0x98, 0x47, 0x1, 0x90, 0x1E, 0xAD, 0x47, 0x1, 0xD0, 0x1E, 0xBD, 0x47, 0x1, 0xF0, 0x1E, 0xC5, 0x47, 0x1, 0x10, 0x1F, 0xCD, 0x47, 0x1, 0x30, 0x1F, 0xD5, 0x47, 0x1, 0x70, 0x1F, 0xE5, 0x47, 0x1, 0xB0, 0x1F, 0xF5, 0x47, 0x1, 0x10, 0x0, 0x0, 0x48, 0x1, 0x30, 0x20, 0x15, 0x48, 0x1, 0x70, 0x20, 0x25, 0x48, 0x1, 0xB0, 0x20, 0x35, 0x48, 0x1, 0xF0, 0x20, 0x45, 0x48, 0x1, 0x30, 0x21, 0x55, 0x48, 0x1, 0x70, 0x21, 0x65, 0x48, 0x1, 0xB0, 0x21, 0x75, 0x48, 0x1, 0xF0, 0x21, 0x85, 0x48, 0x1, 0x30, 0x22, 0x95, 0x48, 0x1, 0x70, 0x22, 0xA5, 0x48, 0x1, 0xB0, 0x22, 0xB5, 0x48, 0x1, 0xF0, 0x22, 0xC5, 0x48, 0x1, 0x30, 0x23, 0xD5, 0x48, 0x1, 0x70, 0x23, 0xE5, 0x48, 0x1, 0xB0, 0x23, 0xF5, 0x48, 0x1, 0xF0, 0x23, 0x5, 0x49, 0x1, 0x30, 0x24, 0x15, 0x49, 0x1, 0x70, 0x24, 0x25, 0x49, 0x1, 0xB0, 0x24, 0x35, 0x49, 0x1, 0xF0, 0x24, 0x45, 0x49, 0x1, 0x30, 0x25, 0x55, 0x49, 0x1, 0x70, 0x25, 0x65, 0x49, 0x1, 0xB0, 0x25, 0x75, 0x49, 0x1, 0xF0, 0x25, 0x85, 0x49, 0x1, 0x30, 0x26, 0x95, 0x49, 0x1, 0x70, 0x26, 0xA5, 0x49, 0x1, 0xB0, 0x26, 0xB5, 0x49, 0x1, 0xF0, 0x26, 0xC5, 0x49, 0x1, 0x30, 0x27, 0xD5, 0x49, 0x1, 0x70, 0x27, 0xE5, 0x49, 0x1, 0xB0, 0x27, 0xF5, 0x49, 0x1, 0xF0, 0x27, 0x5, 0x4A, 0x1, 0x30, 0x28, 0x15, 0x4A, 0x1, 0x70, 0x28, 0x25, 0x4A, 0x1, 0xB0, 0x28, 0x35, 0x4A, 0x1, 0xF0, 0x28, 0x45, 0x4A, 0x1, 0x10, 0x0, 0x48, 0x4A, 0x1, 0x30, 0x29, 0x5, 0x0, 0x0, 0x50, 0x29, 0x5D, 0x4A, 0x1, 0x90, 0x29, 0x6D, 0x4A, 0x1, 0xD0, 0x29, 0x7D, 0x4A, 0x1, 0x10, 0x2A, 0x8D, 0x4A, 0x1, 0x50, 0x2A, 0x9D, 0x4A, 0x1, 0x90, 0x2A, 0xAD, 0x4A, 0x1, 0xD0, 0x2A, 0xBD, 0x4A, 0x1, 0x10, 0x2B, 0xCD, 0x4A, 0x1, 0x10, 0x0, 0xD0, 0x4A, 0x1, 0x70, 0x2B, 0xE5, 0x4A, 0x1, 0x10, 0x0, 0xE8, 0x4A, 0x1, 0x10, 0x0, 0xF0, 0x4A, 0x1, 0xF0, 0x2B, 0x5, 0x4B, 0x1, 0x30, 0x2C, 0x15, 0x4B, 0x1, 0xD0, 0x2B, 0x5, 0x0, 0x0, 0x10, 0x0, 0x18, 0x4B, 0x1, 0x90, 0x2C, 0x2D, 0x4B, 0x1, 0xD0, 0x2C, 0x3D, 0x4B, 0x1, 0x70, 0x2C, 0x5, 0x0, 0x0, 0x10, 0x2D, 0x4D, 0x4B, 0x1, 0x50, 0x2D, 0x5D, 0x4B, 0x1, 0x10, 0x0, 0x60, 0x4B, 0x1, 0xB0, 0x2D, 0x75, 0x4B, 0x1, 0xF0, 0x2D, 0x85, 0x4B, 0x1, 0x90, 0x2D, 0x5, 0x0, 0x0, 0x10, 0x0, 0x88, 0x4B, 0x1, 0x50, 0x2E, 0x9D, 0x4B, 0x1, 0x90, 0x2E, 0xAD, 0x4B, 0x1, 0x30, 0x2E, 0x5, 0x0, 0x0, 0xD0, 0x2E, 0xBD, 0x4B, 0x1, 0x10, 0x2F, 0xCD, 0x4B, 0x1, 0x50, 0x2F, 0xDD, 0x4B, 0x1, 0x90, 0x2F, 0xED, 0x4B, 0x1, 0xD0, 0x2F, 0xFD, 0x4B, 0x1, 0x10, 0x30, 0xD, 0x4C, 0x1, 0x50, 0x30, 0x1D, 0x4C, 0x1, 0x90, 0x30, 0x2D, 0x4C, 0x1, 0xD0, 0x30, 0x3D, 0x4C, 0x1, 0x10, 0x31, 0x4D, 0x4C, 0x1, 0x50, 0x31, 0x5D, 0x4C, 0x1, 0x90, 0x31, 0x6D, 0x4C, 0x1, 0xD0, 0x31, 0x7D, 0x4C, 0x1, 0x10, 0x32, 0x8D, 0x4C, 0x1, 0x50, 0x32, 0x9D, 0x4C, 0x1, 0x90, 0x32, 0xAD, 0x4C, 0x1, 0xD0, 0x32, 0x5, 0x0, 0x0, 0xF0, 0x32, 0x5, 0x0, 0x0, 0x10, 0x33, 0x5, 0x0, 0x0, 0x30, 0x33, 0x5, 0x0, 0x0, 0x50, 0x33, 0xDD, 0x4C, 0x1, 0x90, 0x33, 0xED, 0x4C, 0x1, 0xD0, 0x33, 0xFD, 0x4C, 0x1, 0x10, 0x34, 0xD, 0x4D, 0x1, 0x50, 0x34, 0x1D, 0x4D, 0x1, 0x90, 0x34, 0x2D, 0x4D, 0x1, 0xD0, 0x34, 0x3D, 0x4D, 0x1, 0x10, 0x35, 0x4D, 0x4D, 0x1, 0x50, 0x35, 0x5D, 0x4D, 0x1, 0x90, 0x35, 0x6D, 0x4D, 0x1, 0xD0, 0x35, 0x7D, 0x4D, 0x1, 0x10, 0x36, 0x8D, 0x4D, 0x1, 0x50, 0x36, 0x9D, 0x4D, 0x1, 0x90, 0x36, 0xAD, 0x4D, 0x1, 0xD0, 0x36, 0xBD, 0x4D, 0x1, 0x10, 0x37, 0xCD, 0x4D, 0x1, 0x50, 0x37, 0xDD, 0x4D, 0x1, 0x90, 0x37, 0xED, 0x4D, 0x1, 0x10, 0x0, 0x70, 0x4F, 0x1, 0xB0, 0x1F, 0x5, 0x0, 0x0, 0x90, 0x8, 0x5, 0x0, 0x0, 0x50, 0x47, 0xDD, 0x51, 0x1, 0x90, 0x47, 0x5, 0x0, 0x0, 0x10, 0x0, 0xE8, 0x51, 0x1, 0xD0, 0x47, 0xFD, 0x51, 0x1, 0x10, 0x48, 0xD, 0x52, 0x1, 0x50, 0x48, 0x1D, 0x52, 0x1, 0x90, 0x48, 0x2D, 0x52, 0x1, 0xD0, 0x48, 0x3D, 0x52, 0x1, 0x10, 0x49, 0x4D, 0x52, 0x1, 0x50, 0x49, 0x5D, 0x52, 0x1, 0x90, 0x49, 0x6D, 0x52, 0x1, 0xD0, 0x49, 0x7D, 0x52, 0x1, 0x10, 0x4A, 0x8D, 0x52, 0x1, 0x50, 0x4A, 0x9D, 0x52, 0x1, 0x90, 0x4A, 0xAD, 0x52, 0x1, 0xD0, 0x4A, 0xBD, 0x52, 0x1, 0x10, 0x4B, 0xCD, 0x52, 0x1, 0x50, 0x4B, 0xDD, 0x52, 0x1, 0x90, 0x4B, 0xED, 0x52, 0x1, 0xD0, 0x4B, 0xFD, 0x52, 0x1, 0x10, 0x4C, 0xD, 0x53, 0x1, 0x50, 0x4C, 0x1D, 0x53, 0x1, 0x90, 0x4C, 0x2D, 0x53, 0x1, 0xD0, 0x4C, 0x3D, 0x53, 0x1, 0x10, 0x4D, 0x4D, 0x53, 0x1, 0x50, 0x4D, 0x5D, 0x53, 0x1, 0x90, 0x4D, 0x6D, 0x53, 0x1, 0x10, 0x0, 0x70, 0x53, 0x1, 0xF0, 0x4D, 0x85, 0x53, 0x1, 0x30, 0x4E, 0x95, 0x53, 0x1, 0x70, 0x4E, 0xA5, 0x53, 0x1, 0xB0, 0x4E, 0xB5, 0x53, 0x1, 0xF0, 0x4E, 0xC5, 0x53, 0x1, 0x30, 0x4F, 0xD5, 0x53, 0x1, 0x70, 0x4F, 0xE5, 0x53, 0x1, 0xB0, 0x4F, 0xF5, 0x53, 0x1, 0xF0, 0x4F, 0x5, 0x54, 0x1, 0x30, 0x50, 0x15, 0x54, 0x1, 0x70, 0x50, 0x25, 0x54, 0x1, 0xB0, 0x50, 0x35, 0x54, 0x1, 0xF0, 0x50, 0x45, 0x54, 0x1, 0x30, 0x51, 0x55, 0x54, 0x1, 0x70, 0x51, 0x65, 0x54, 0x1, 0xB0, 0x51, 0x75, 0x54, 0x1, 0xF0, 0x51, 0x85, 0x54, 0x1, 0x30, 0x52, 0x95, 0x54, 0x1, 0x70, 0x52, 0x5, 0x0, 0x0, 0x90, 0x58, 0x2D, 0x56, 0x1, 0xB0, 0x58, 0x35, 0x56, 0x1, 0xD0, 0x58, 0x3D, 0x56, 0x1, 0xF0, 0x58, 0x45, 0x56, 0x1, 0x10, 0x59, 0x4D, 0x56, 0x1, 0x30, 0x59, 0x55, 0x56, 0x1, 0x50, 0x59, 0x5D, 0x56, 0x1, 0x70, 0x59, 0x25, 0x56, 0x1, 0x10, 0x5F, 0xCD, 0x57, 0x1, 0x50, 0x5F, 0xDD, 0x57, 0x1, 0x90, 0x5F, 0xED, 0x57, 0x1, 0xD0, 0x5F, 0xFD, 0x57, 0x1, 0x10, 0x60, 0xD, 0x58, 0x1, 0x50, 0x60, 0x1D, 0x58, 0x1, 0x90, 0x60, 0x2D, 0x58, 0x1, 0xD0, 0x60, 0x3D, 0x58, 0x1, 0x10, 0x61, 0x4D, 0x58, 0x1, 0x50, 0x61, 0x5D, 0x58, 0x1, 0x90, 0x61, 0x6D, 0x58, 0x1, 0xD0, 0x61, 0x7D, 0x58, 0x1, 0x10, 0x62, 0x8D, 0x58, 0x1, 0x50, 0x62, 0x9D, 0x58, 0x1, 0x90, 0x62, 0xAD, 0x58, 0x1, 0xD0, 0x62, 0xBD, 0x58, 0x1, 0x10, 0x63, 0xCD, 0x58, 0x1, 0x50, 0x63, 0xDD, 0x58, 0x1, 0x90, 0x63, 0xED, 0x58, 0x1, 0xD0, 0x63, 0xFD, 0x58, 0x1, 0x10, 0x64, 0xD, 0x59, 0x1, 0x50, 0x64, 0x1D, 0x59, 0x1, 0x90, 0x64, 0x2D, 0x59, 0x1, 0xD0, 0x64, 0x3D, 0x59, 0x1, 0x10, 0x65, 0x4D, 0x59, 0x1, 0x50, 0x65, 0x5, 0x0, 0x0, 0x90, 0x65, 0x6D, 0x59, 0x1, 0xB0, 0x65, 0x5, 0x0, 0x0, 0x10, 0x0, 0x70, 0x59, 0x1, 0xF0, 0x65, 0x65, 0x59, 0x1, 0x90, 0x67, 0x5, 0x0, 0x0, 0x90, 0x67, 0xED, 0x59, 0x1, 0xD0, 0x67, 0xFD, 0x59, 0x1, 0x10, 0x68, 0xD, 0x5A, 0x1, 0xB0, 0x2B, 0x15, 0x5A, 0x1, 0x70, 0x68, 0x25, 0x5A, 0x1, 0xB0, 0x68, 0x35, 0x5A, 0x1, 0xF0, 0x68, 0x5, 0x0, 0x0, 0x10, 0x69, 0x4D, 0x5A, 0x1, 0x50, 0x69, 0x5D, 0x5A, 0x1, 0x90, 0x69, 0x6D, 0x5A, 0x1, 0xD0, 0x69, 0x7D, 0x5A, 0x1, 0x10, 0x6A, 0x75, 0x59, 0x1, 0x30, 0x6A, 0x95, 0x5A, 0x1, 0x70, 0x6A, 0xA5, 0x5A, 0x1, 0xB0, 0x6A, 0xB5, 0x5A, 0x1, 0xF0, 0x6A, 0x5, 0x0, 0x0, 0x10, 0x6B, 0xCD, 0x5A, 0x1, 0x50, 0x6B, 0xDD, 0x5A, 0x1, 0xB0, 0x67, 0xF5, 0x59, 0x1, 0x10, 0x0, 0xF8, 0x59, 0x1, 0x10, 0x0, 0xC0, 0x5A, 0x1, 0x30, 0x6B, 0xD5, 0x5A, 0x1, 0x10, 0x0, 0xD8, 0x5A, 0x1, 0xF0, 0x65, 0x5, 0x0, 0x0, 0x10, 0x0, 0x58, 0x41, 0x1, 0x30, 0x5, 0x5, 0x0, 0x0, 0x10, 0x0, 0xF8, 0x5A, 0x1, 0x10, 0x0, 0x0, 0x5B, 0x1, 0x30, 0x6C, 0x15, 0x5B, 0x1, 0x70, 0x6C, 0x25, 0x5B, 0x1, 0x50, 0x5, 0x5, 0x0, 0x0, 0xB0, 0x6C, 0x5, 0x41, 0x1, 0x10, 0x0, 0x30, 0x5B, 0x1, 0x90, 0x1F, 0x5, 0x0, 0x0, 0xF0, 0x6C, 0x5, 0x0, 0x0, 0x10, 0x0, 0x40, 0x5B, 0x1, 0xB0, 0x1E, 0x5, 0x0, 0x0, 0x30, 0x6D, 0x5, 0x0, 0x0, 0x10, 0x0, 0x68, 0x41, 0x1, 0xD0, 0x1F, 0x65, 0x41, 0x1, 0x50, 0x6D, 0x5D, 0x5B, 0x1, 0x10, 0x0, 0x80, 0x41, 0x1, 0xB0, 0x7, 0x5, 0x0, 0x0, 0x90, 0x6D, 0x5, 0x0, 0x0, 0xD0, 0x5, 0x6D, 0x5B, 0x1, 0x10, 0x0, 0x78, 0x41, 0x1, 0xD0, 0x6D, 0x5, 0x0, 0x0, 0xF0, 0x6D, 0x5, 0x0, 0x0, 0x10, 0x6E, 0x8D, 0x5B, 0x1, 0x10, 0x0, 0x90, 0x5B, 0x1, 0x70, 0x6E, 0x9D, 0x47, 0x1, 0xD0, 0x1E, 0xA5, 0x47, 0x1, 0x10, 0x6C, 0x1D, 0x5B, 0x1, 0x30, 0x6F, 0xD5, 0x5B, 0x1, 0x50, 0x6F, 0x7D, 0x47, 0x1, 0x10, 0x1E, 0xD5, 0x47, 0x1, 0x70, 0x6F, 0xE5, 0x5B, 0x1, 0x90, 0x6F, 0xDD, 0x47, 0x1, 0x10, 0x0, 0x30, 0x5C, 0x1, 0x70, 0x73, 0xE5, 0x5C, 0x1, 0xD0, 0x73, 0x5, 0x0, 0x0, 0x10, 0x75, 0x4D, 0x5D, 0x1, 0x30, 0x75, 0x55, 0x5D, 0x1, 0x50, 0x75, 0x5D, 0x5D, 0x1, 0x70, 0x75, 0x65, 0x5D, 0x1, 0x90, 0x75, 0x6D, 0x5D, 0x1, 0xB0, 0x75, 0x75, 0x5D, 0x1, 0xD0, 0x75, 0x7D, 0x5D, 0x1, 0xF0, 0x75, 0x85, 0x5D, 0x1, 0x10, 0x76, 0x8D, 0x5D, 0x1, 0x50, 0x76, 0x9D, 0x5D, 0x1, 0x70, 0x73, 0x5, 0x0, 0x0, 0xF0, 0x6B, 0xB5, 0x5D, 0x1, 0xD0, 0x76, 0xBD, 0x5D, 0x1, 0xF0, 0x76, 0xD, 0x5B, 0x1, 0x50, 0x6C, 0xC5, 0x5D, 0x1, 0x10, 0x77, 0x25, 0x5B, 0x1, 0xB0, 0x6C, 0xD5, 0x5D, 0x1, 0x50, 0x77, 0x35, 0x5B, 0x1, 0xF0, 0x6C, 0x35, 0x5C, 0x1, 0x10, 0x6D, 0x4D, 0x5B, 0x1, 0x10, 0x0, 0xD8, 0x5B, 0x1, 0x70, 0x6D, 0x55, 0x5B, 0x1, 0x90, 0x73, 0x65, 0x5B, 0x1, 0xB0, 0x6D, 0xFD, 0x5D, 0x1, 0xF0, 0x77, 0x75, 0x5B, 0x1, 0xF0, 0x6D, 0x45, 0x5D, 0x1, 0x10, 0x0, 0x0, 0x5E, 0x1, 0x10, 0x78, 0x85, 0x5B, 0x1, 0x30, 0x6E, 0xD, 0x5E, 0x1, 0x30, 0x78, 0x95, 0x5B, 0x1, 0x70, 0x6E, 0xCD, 0x5B, 0x1, 0x10, 0x0, 0x20, 0x5E, 0x1, 0x90, 0x78, 0x2D, 0x5E, 0x1, 0xB0, 0x78, 0x35, 0x5E, 0x1, 0xD0, 0x78, 0x3D, 0x5E, 0x1, 0x10, 0x0, 0xF8, 0x5E, 0x1, 0xF0, 0x7B, 0x5, 0x5F, 0x1, 0x10, 0x7C, 0xD, 0x5F, 0x1, 0x30, 0x7C, 0x15, 0x5F, 0x1, 0x50, 0x7C, 0x1D, 0x5F, 0x1, 0x70, 0x7C, 0x25, 0x5F, 0x1, 0x90, 0x7C, 0x2D, 0x5F, 0x1, 0xB0, 0x7C, 0x35, 0x5F, 0x1, 0xD0, 0x7C, 0x5, 0x0, 0x0, 0x10, 0x0, 0x50, 0x5F, 0x1, 0xF0, 0x78, 0x1D, 0x60, 0x1, 0x90, 0x80, 0x2D, 0x60, 0x1, 0xD0, 0x80, 0x3D, 0x60, 0x1, 0x10, 0x81, 0x4D, 0x60, 0x1, 0x10, 0x0, 0x50, 0x60, 0x1, 0x70, 0x81, 0x65, 0x60, 0x1, 0xB0, 0x81, 0x75, 0x60, 0x1, 0xF0, 0x81, 0x85, 0x60, 0x1, 0x30, 0x82, 0x95, 0x60, 0x1, 0x70, 0x82, 0xA5, 0x60, 0x1, 0xB0, 0x82, 0xB5, 0x60, 0x1, 0xF0, 0x82, 0xC5, 0x60, 0x1, 0x30, 0x83, 0xD5, 0x60, 0x1, 0x70, 0x2B, 0xDD, 0x60, 0x1, 0x90, 0x83, 0xED, 0x60, 0x1, 0xD0, 0x83, 0xFD, 0x60, 0x1, 0xD0, 0x3D, 0x1D, 0x60, 0x1, 0x10, 0x0, 0x0, 0x61, 0x1, 0x30, 0x84, 0x15, 0x61, 0x1, 0x70, 0x84, 0x25, 0x61, 0x1, 0xB0, 0x84, 0x35, 0x61, 0x1, 0xF0, 0x84, 0x45, 0x61, 0x1, 0x30, 0x85, 0x55, 0x61, 0x1, 0x70, 0x85, 0x65, 0x61, 0x1, 0xB0, 0x85, 0x75, 0x61, 0x1, 0x90, 0x2B, 0x7D, 0x61, 0x1, 0x50, 0x7D, 0x85, 0x61, 0x1, 0x30, 0x86, 0x95, 0x61, 0x1, 0x70, 0x86, 0xA5, 0x61, 0x1, 0xB0, 0x86, 0xB5, 0x61, 0x1, 0xF0, 0x86, 0x5, 0x0, 0x0, 0x11, 0x87, 0xCD, 0x61, 0x1, 0x51, 0x87, 0xDD, 0x61, 0x1, 0x91, 0x87, 0xED, 0x61, 0x1, 0xD1, 0x87, 0xFD, 0x61, 0x1, 0x11, 0x88, 0xD, 0x62, 0x1, 0x51, 0x88, 0x1D, 0x62, 0x1, 0x91, 0x88, 0x2D, 0x62, 0x1, 0xD1, 0x88, 0x3D, 0x62, 0x1, 0x11, 0x89, 0x4D, 0x62, 0x1, 0x51, 0x89, 0x5D, 0x62, 0x1, 0x91, 0x89, 0x6D, 0x62, 0x1, 0xD1, 0x89, 0x7D, 0x62, 0x1, 0x11, 0x8A, 0x8D, 0x62, 0x1, 0x51, 0x8A, 0x9D, 0x62, 0x1, 0x91, 0x8A, 0xAD, 0x62, 0x1, 0xD1, 0x8A, 0xBD, 0x62, 0x1, 0x11, 0x8B, 0xCD, 0x62, 0x1, 0x51, 0x8B, 0xDD, 0x62, 0x1, 0x91, 0x8B, 0xED, 0x62, 0x1, 0xD1, 0x8B, 0xFD, 0x62, 0x1, 0x11, 0x8C, 0xD, 0x63, 0x1, 0x51, 0x8C, 0x1D, 0x63, 0x1, 0x91, 0x8C, 0x2D, 0x63, 0x1, 0xD1, 0x8C, 0x3D, 0x63, 0x1, 0x11, 0x8D, 0x4D, 0x63, 0x1, 0x51, 0x8D, 0x5D, 0x63, 0x1, 0x91, 0x8D, 0x6D, 0x63, 0x1, 0xD1, 0x8D, 0x5, 0x0, 0x0, 0xF1, 0x8D, 0x85, 0x63, 0x1, 0x51, 0x4, 0x5, 0x0, 0x0, 0x71, 0x4, 0x25, 0x41, 0x1, 0xB1, 0x4, 0x35, 0x41, 0x1, 0xF1, 0x4, 0x45, 0x41, 0x1, 0x31, 0x8E, 0x95, 0x63, 0x1, 0x71, 0x8E, 0xA5, 0x63, 0x1, 0xB1, 0x8E, 0x8D, 0x41, 0x1, 0x51, 0x6, 0x9D, 0x41, 0x1, 0x91, 0x6, 0xAD, 0x41, 0x1, 0xD1, 0x6, 0xBD, 0x41, 0x1, 0x11, 0x7, 0xCD, 0x41, 0x1, 0x51, 0x7, 0xB5, 0x63, 0x1, 0x71, 0x7, 0xE5, 0x41, 0x1, 0x11, 0x0, 0xB8, 0x63, 0x1, 0x11, 0x8F, 0x5, 0x0, 0x0, 0xF1, 0x7, 0x5, 0x42, 0x1, 0x31, 0x8, 0x15, 0x42, 0x1, 0x71, 0x8, 0xCD, 0x63, 0x1, 0x51, 0x8F, 0xDD, 0x63, 0x1, 0xF1, 0x8, 0x45, 0x42, 0x1, 0x31, 0x9, 0x55, 0x42, 0x1, 0x71, 0x9, 0x65, 0x42, 0x1, 0xB1, 0x9, 0x75, 0x42, 0x1, 0xF1, 0x9, 0x85, 0x42, 0x1, 0x31, 0xA, 0x95, 0x42, 0x1, 0x71, 0xA, 0xA5, 0x42, 0x1, 0xB1, 0xA, 0xB5, 0x42, 0x1, 0xF1, 0xA, 0xC5, 0x42, 0x1, 0x31, 0xB, 0xD5, 0x42, 0x1, 0x71, 0xB, 0xE5, 0x42, 0x1, 0xB1, 0xB, 0xF5, 0x42, 0x1, 0xF1, 0xB, 0x5, 0x43, 0x1, 0x31, 0xC, 0x15, 0x43, 0x1, 0x71, 0xC, 0x25, 0x43, 0x1, 0xB1, 0xC, 0x5, 0x0, 0x0, 0xD1, 0xC, 0x3D, 0x43, 0x1, 0x11, 0xD, 0x4D, 0x43, 0x1, 0x51, 0xD, 0x5D, 0x43, 0x1, 0x91, 0xD, 0x5, 0x0, 0x0, 0xB1, 0xD, 0x75, 0x43, 0x1, 0xF1, 0xD, 0x85, 0x43, 0x1, 0x31, 0xE, 0x95, 0x43, 0x1, 0x71, 0xE, 0xA5, 0x43, 0x1, 0xB1, 0xE, 0xB5, 0x43, 0x1, 0xF1, 0xE, 0xC5, 0x43, 0x1, 0x31, 0xF, 0xD5, 0x43, 0x1, 0x11, 0x0, 0xD8, 0x43, 0x1, 0x91, 0xF, 0xED, 0x43, 0x1, 0xD1, 0xF, 0xFD, 0x43, 0x1, 0x11, 0x10, 0xD, 0x44, 0x1, 0x51, 0x10, 0x1D, 0x44, 0x1, 0x91, 0x10, 0x2D, 0x44, 0x1, 0xD1, 0x10, 0x3D, 0x44, 0x1, 0x11, 0x11, 0x4D, 0x44, 0x1, 0x51, 0x11, 0x5D, 0x44, 0x1, 0x91, 0x11, 0x6D, 0x44, 0x1, 0xD1, 0x11, 0x7D, 0x44, 0x1, 0x11, 0x12, 0x8D, 0x44, 0x1, 0x11, 0x0, 0xE0, 0x63, 0x1, 0xB1, 0x8F, 0xF5, 0x63, 0x1, 0xF1, 0x8F, 0x5, 0x64, 0x1, 0x31, 0x90, 0x15, 0x64, 0x1, 0x71, 0x90, 0x25, 0x64, 0x1, 0xB1, 0x90, 0x35, 0x64, 0x1, 0xF1, 0x90, 0x45, 0x64, 0x1, 0x31, 0x91, 0x55, 0x64, 0x1, 0x71, 0x91, 0x65, 0x64, 0x1, 0xB1, 0x91, 0x75, 0x64, 0x1, 0xF1, 0x91, 0x85, 0x64, 0x1, 0x51, 0x17, 0x5, 0x0, 0x0, 0x31, 0x92, 0x95, 0x64, 0x1, 0x71, 0x92, 0x5, 0x0, 0x0, 0xB1, 0x17, 0xF5, 0x45, 0x1, 0xF1, 0x17, 0x5, 0x46, 0x1, 0x31, 0x18, 0x15, 0x46, 0x1, 0x71, 0x18, 0x25, 0x46, 0x1, 0xB1, 0x18, 0x35, 0x46, 0x1, 0xF1, 0x18, 0x45, 0x46, 0x1, 0x31, 0x19, 0x55, 0x46, 0x1, 0x71, 0x19, 0x65, 0x46, 0x1, 0xB1, 0x19, 0x75, 0x46, 0x1, 0xF1, 0x19, 0x85, 0x46, 0x1, 0x31, 0x1A, 0x95, 0x46, 0x1, 0x71, 0x1A, 0xA5, 0x46, 0x1, 0xB1, 0x1A, 0xB5, 0x46, 0x1, 0xF1, 0x1A, 0xC5, 0x46, 0x1, 0x31, 0x1B, 0xD5, 0x46, 0x1, 0x71, 0x1B, 0xE5, 0x46, 0x1, 0xB1, 0x1B, 0xF5, 0x46, 0x1, 0xF1, 0x1B, 0x5, 0x47, 0x1, 0x31, 0x1C, 0x15, 0x47, 0x1, 0x71, 0x1C, 0x25, 0x47, 0x1, 0xB1, 0x1C, 0x35, 0x47, 0x1, 0xF1, 0x1C, 0x45, 0x47, 0x1, 0x31, 0x1D, 0x55, 0x47, 0x1, 0x71, 0x1D, 0x65, 0x47, 0x1, 0xB1, 0x1D, 0x75, 0x47, 0x1, 0x91, 0x92, 0x5, 0x0, 0x0, 0xB1, 0x92, 0xB5, 0x64, 0x1, 0x51, 0x1E, 0xBD, 0x64, 0x1, 0x11, 0x93, 0xCD, 0x64, 0x1, 0x51, 0x93, 0xDD, 0x64, 0x1, 0x91, 0x93, 0xED, 0x64, 0x1, 0xD1, 0x93, 0xFD, 0x47, 0x1, 0xF1, 0x93, 0x5, 0x65, 0x1, 0x31, 0x94, 0x15, 0x65, 0x1, 0x71, 0x94, 0x25, 0x65, 0x1, 0xB1, 0x94, 0x35, 0x65, 0x1, 0xF1, 0x94, 0x45, 0x65, 0x1, 0x31, 0x95, 0x55, 0x65, 0x1, 0x71, 0x95, 0x65, 0x65, 0x1, 0xB1, 0x95, 0x75, 0x65, 0x1, 0xF1, 0x95, 0x85, 0x65, 0x1, 0x31, 0x96, 0x95, 0x65, 0x1, 0x71, 0x96, 0xA5, 0x65, 0x1, 0xB1, 0x96, 0xB5, 0x65, 0x1, 0x11, 0x0, 0xB8, 0x65, 0x1, 0x11, 0x97, 0xCD, 0x65, 0x1, 0x51, 0x97, 0xDD, 0x65, 0x1, 0x91, 0x97, 0xED, 0x65, 0x1, 0xD1, 0x97, 0xFD, 0x65, 0x1, 0x11, 0x98, 0xD, 0x66, 0x1, 0x51, 0x98, 0x1D, 0x66, 0x1, 0xF1, 0x96, 0xC5, 0x65, 0x1, 0x31, 0x97, 0xD5, 0x65, 0x1, 0x71, 0x97, 0xE5, 0x65, 0x1, 0xB1, 0x97, 0xF5, 0x65, 0x1, 0xF1, 0x97, 0x5, 0x66, 0x1, 0x31, 0x98, 0x15, 0x66, 0x1, 0x71, 0x98, 0x5, 0x0, 0x0, 0x11, 0x0, 0x20, 0x66, 0x1, 0xB1, 0x98, 0x5, 0x0, 0x0, 0xD1, 0x98, 0x3D, 0x66, 0x1, 0x11, 0x99, 0x4D, 0x66, 0x1, 0x51, 0x99, 0x5D, 0x66, 0x1, 0x91, 0x99, 0x6D, 0x66, 0x1, 0xD1, 0x99, 0x5, 0x0, 0x0, 0xF1, 0x99, 0x5, 0x0, 0x0, 0x11, 0x9A, 0x5, 0x0, 0x0, 0x11, 0x0, 0x88, 0x66, 0x1, 0x51, 0x9A, 0x9D, 0x66, 0x1, 0x91, 0x9A, 0x5, 0x0, 0x0, 0x11, 0x0, 0xA8, 0x66, 0x1, 0xD1, 0x9A, 0xBD, 0x66, 0x1, 0x11, 0x0, 0xC0, 0x66, 0x1, 0x11, 0x0, 0xB8, 0x66, 0x1, 0x31, 0x9B, 0xD5, 0x66, 0x1, 0x11, 0x0, 0xD0, 0x66, 0x1, 0x11, 0x0, 0xD8, 0x66, 0x1, 0x91, 0x9B, 0xED, 0x66, 0x1, 0xD1, 0x9B, 0x5, 0x0, 0x0, 0x11, 0x0, 0xF8, 0x66, 0x1, 0x11, 0x9C, 0xD, 0x67, 0x1, 0x51, 0x9C, 0xD, 0x67, 0x1, 0x71, 0x9C, 0x25, 0x67, 0x1, 0xB1, 0x9C, 0x35, 0x67, 0x1, 0xF1, 0x9C, 0x45, 0x67, 0x1, 0x31, 0x9D, 0x55, 0x67, 0x1, 0x71, 0x9D, 0x65, 0x67, 0x1, 0xB1, 0x9D, 0x75, 0x67, 0x1, 0x11, 0x0, 0x90, 0x66, 0x1, 0xD1, 0x9A, 0x9D, 0x66, 0x1, 0x31, 0x9B, 0xE5, 0x66, 0x1, 0xB1, 0x9B, 0x5, 0x67, 0x1, 0xF1, 0x9D, 0x85, 0x67, 0x1, 0x31, 0x9E, 0x95, 0x67, 0x1, 0x71, 0x9E, 0xA5, 0x67, 0x1, 0xB1, 0x9E, 0xB5, 0x67, 0x1, 0x11, 0x0, 0xB8, 0x67, 0x1, 0x11, 0x9F, 0xCD, 0x67, 0x1, 0x51, 0x9F, 0xDD, 0x67, 0x1, 0x91, 0x9F, 0xED, 0x67, 0x1, 0xD1, 0x9F, 0xFD, 0x67, 0x1, 0x11, 0xA0, 0xD, 0x68, 0x1, 0x11, 0x0, 0x10, 0x68, 0x1, 0x71, 0xA0, 0x25, 0x68, 0x1, 0xB1, 0xA0, 0x35, 0x68, 0x1, 0xF1, 0xA0, 0x45, 0x68, 0x1, 0xD1, 0x37, 0xFD, 0x4D, 0x1, 0x11, 0x38, 0xD, 0x4E, 0x1, 0x51, 0x38, 0x1D, 0x4E, 0x1, 0x91, 0x38, 0x2D, 0x4E, 0x1, 0xD1, 0x38, 0x3D, 0x4E, 0x1, 0x11, 0x39, 0x4D, 0x4E, 0x1, 0x51, 0x39, 0x5D, 0x4E, 0x1, 0x91, 0x39, 0x6D, 0x4E, 0x1, 0xD1, 0x39, 0x7D, 0x4E, 0x1, 0x11, 0x3A, 0x8D, 0x4E, 0x1, 0x51, 0x3A, 0x9D, 0x4E, 0x1, 0x91, 0x3A, 0xAD, 0x4E, 0x1, 0xD1, 0x3A, 0xBD, 0x4E, 0x1, 0x11, 0x3B, 0xCD, 0x4E, 0x1, 0x51, 0x3B, 0xDD, 0x4E, 0x1, 0x91, 0x3B, 0xED, 0x4E, 0x1, 0xD1, 0x3B, 0xFD, 0x4E, 0x1, 0x11, 0x3C, 0xD, 0x4F, 0x1, 0x51, 0x3C, 0x1D, 0x4F, 0x1, 0x91, 0x3C, 0x2D, 0x4F, 0x1, 0xD1, 0x3C, 0x3D, 0x4F, 0x1, 0x11, 0x3D, 0x4D, 0x4F, 0x1, 0x51, 0x3D, 0x5D, 0x4F, 0x1, 0x91, 0x3D, 0x6D, 0x4F, 0x1, 0x31, 0xA1, 0x5, 0x0, 0x0, 0x11, 0x0, 0x78, 0x4F, 0x1, 0x11, 0x3E, 0x8D, 0x4F, 0x1, 0x51, 0x3E, 0x9D, 0x4F, 0x1, 0x91, 0x3E, 0xAD, 0x4F, 0x1, 0xD1, 0x3E, 0xBD, 0x4F, 0x1, 0x11, 0x3F, 0xCD, 0x4F, 0x1, 0x51, 0x3F, 0xDD, 0x4F, 0x1, 0x91, 0x3F, 0xED, 0x4F, 0x1, 0xD1, 0x3F, 0xFD, 0x4F, 0x1, 0x11, 0x40, 0xD, 0x50, 0x1, 0x51, 0x40, 0x1D, 0x50, 0x1, 0x91, 0x40, 0x2D, 0x50, 0x1, 0xD1, 0x40, 0x3D, 0x50, 0x1, 0x11, 0x41, 0x4D, 0x50, 0x1, 0x51, 0x41, 0x5D, 0x50, 0x1, 0x91, 0x41, 0x6D, 0x50, 0x1, 0xD1, 0x41, 0x7D, 0x50, 0x1, 0x11, 0x42, 0x8D, 0x50, 0x1, 0x51, 0x42, 0x9D, 0x50, 0x1, 0x91, 0x42, 0xAD, 0x50, 0x1, 0xD1, 0x42, 0xBD, 0x50, 0x1, 0x11, 0x43, 0xCD, 0x50, 0x1, 0x51, 0x43, 0xDD, 0x50, 0x1, 0x91, 0x43, 0xED, 0x50, 0x1, 0xD1, 0x43, 0xFD, 0x50, 0x1, 0x11, 0x44, 0xD, 0x51, 0x1, 0x51, 0x44, 0x1D, 0x51, 0x1, 0x91, 0x44, 0x2D, 0x51, 0x1, 0xD1, 0x44, 0x3D, 0x51, 0x1, 0x11, 0x45, 0x4D, 0x51, 0x1, 0x51, 0x45, 0x5D, 0x51, 0x1, 0x91, 0x45, 0x6D, 0x51, 0x1, 0xD1, 0x45, 0x7D, 0x51, 0x1, 0x11, 0x46, 0x8D, 0x51, 0x1, 0x51, 0x46, 0x9D, 0x51, 0x1, 0x91, 0x46, 0xAD, 0x51, 0x1, 0xD1, 0x46, 0xBD, 0x51, 0x1, 0x11, 0x47, 0xCD, 0x51, 0x1, 0xF1, 0x8D, 0x5, 0x0, 0x0, 0x11, 0x0, 0x50, 0x68, 0x1, 0x11, 0x0, 0x58, 0x68, 0x1, 0x91, 0xA1, 0x6D, 0x68, 0x1, 0xD1, 0xA1, 0x7D, 0x68, 0x1, 0x11, 0xA2, 0x8D, 0x68, 0x1, 0x51, 0xA2, 0x9D, 0x68, 0x1, 0x91, 0xA2, 0xAD, 0x68, 0x1, 0xD1, 0xA2, 0xBD, 0x68, 0x1, 0x11, 0xA3, 0xCD, 0x68, 0x1, 0x51, 0xA3, 0xDD, 0x68, 0x1, 0x91, 0xA3, 0xED, 0x68, 0x1, 0xD1, 0xA3, 0xFD, 0x68, 0x1, 0x11, 0xA4, 0xD, 0x69, 0x1, 0x51, 0xA4, 0x1D, 0x69, 0x1, 0x11, 0x0, 0x20, 0x69, 0x1, 0xB1, 0xA4, 0x35, 0x69, 0x1, 0xF1, 0xA4, 0x45, 0x69, 0x1, 0x31, 0xA5, 0x55, 0x69, 0x1, 0x71, 0xA5, 0x65, 0x69, 0x1, 0xB1, 0xA5, 0x75, 0x69, 0x1, 0xF1, 0xA5, 0x85, 0x69, 0x1, 0x31, 0xA6, 0x95, 0x69, 0x1, 0x71, 0xA6, 0xA5, 0x69, 0x1, 0xB1, 0xA6, 0xB5, 0x69, 0x1, 0xF1, 0xA6, 0xC5, 0x69, 0x1, 0x31, 0xA7, 0xD5, 0x69, 0x1, 0x91, 0x52, 0xAD, 0x54, 0x1, 0xD1, 0x52, 0xBD, 0x54, 0x1, 0x11, 0x53, 0xCD, 0x54, 0x1, 0x51, 0x53, 0xDD, 0x54, 0x1, 0x91, 0x53, 0xED, 0x54, 0x1, 0xD1, 0x53, 0xFD, 0x54, 0x1, 0x11, 0x54, 0xD, 0x55, 0x1, 0x51, 0x54, 0x1D, 0x55, 0x1, 0x91, 0x54, 0x2D, 0x55, 0x1, 0xD1, 0x54, 0x3D, 0x55, 0x1, 0x11, 0x55, 0x4D, 0x55, 0x1, 0x51, 0x55, 0x5D, 0x55, 0x1, 0x91, 0x55, 0x6D, 0x55, 0x1, 0xD1, 0x55, 0x7D, 0x55, 0x1, 0x11, 0x56, 0x8D, 0x55, 0x1, 0x51, 0x56, 0x9D, 0x55, 0x1, 0x91, 0x56, 0xAD, 0x55, 0x1, 0xD1, 0x56, 0xBD, 0x55, 0x1, 0x11, 0x57, 0xCD, 0x55, 0x1, 0x51, 0x57, 0xDD, 0x55, 0x1, 0x91, 0x57, 0xED, 0x55, 0x1, 0xD1, 0x57, 0xFD, 0x55, 0x1, 0x11, 0x58, 0xD, 0x56, 0x1, 0x51, 0x58, 0x1D, 0x56, 0x1, 0x71, 0xA7, 0xE5, 0x69, 0x1, 0xB1, 0xA7, 0xF5, 0x69, 0x1, 0xF1, 0xA7, 0x5, 0x6A, 0x1, 0x31, 0xA8, 0x15, 0x6A, 0x1, 0x91, 0x59, 0x6D, 0x56, 0x1, 0xD1, 0x59, 0x7D, 0x56, 0x1, 0x11, 0x5A, 0x8D, 0x56, 0x1, 0x51, 0x5A, 0x9D, 0x56, 0x1, 0x91, 0x5A, 0xAD, 0x56, 0x1, 0xD1, 0x5A, 0xBD, 0x56, 0x1, 0x11, 0x5B, 0xCD, 0x56, 0x1, 0x51, 0x5B, 0xDD, 0x56, 0x1, 0x91, 0x5B, 0xED, 0x56, 0x1, 0xD1, 0x5B, 0xFD, 0x56, 0x1, 0x11, 0x5C, 0xD, 0x57, 0x1, 0x51, 0x5C, 0x1D, 0x57, 0x1, 0x91, 0x5C, 0x2D, 0x57, 0x1, 0xD1, 0x5C, 0x5, 0x0, 0x0, 0x11, 0x0, 0x38, 0x57, 0x1, 0x11, 0x5D, 0x4D, 0x57, 0x1, 0x51, 0x5D, 0x5D, 0x57, 0x1, 0x91, 0x5D, 0x6D, 0x57, 0x1, 0xD1, 0x5D, 0x7D, 0x57, 0x1, 0x11, 0x5E, 0x8D, 0x57, 0x1, 0x51, 0x5E, 0x9D, 0x57, 0x1, 0x91, 0x5E, 0xAD, 0x57, 0x1, 0xD1, 0x5E, 0xBD, 0x57, 0x1, 0x71, 0xA8, 0x25, 0x6A, 0x1, 0xB1, 0xA8, 0x35, 0x6A, 0x1, 0xF1, 0xA8, 0x45, 0x6A, 0x1, 0x31, 0xA9, 0x55, 0x6A, 0x1, 0x71, 0xA9, 0x65, 0x6A, 0x1, 0xB1, 0xA9, 0x75, 0x6A, 0x1, 0xF1, 0xA9, 0x85, 0x6A, 0x1, 0x31, 0xAA, 0x95, 0x6A, 0x1, 0x71, 0xAA, 0xA5, 0x6A, 0x1, 0xB1, 0xAA, 0xB5, 0x6A, 0x1, 0xF1, 0xAA, 0xC5, 0x6A, 0x1, 0x31, 0xAB, 0xD5, 0x6A, 0x1, 0x71, 0xAB, 0xE5, 0x6A, 0x1, 0x71, 0x65, 0xED, 0x6A, 0x1, 0xD1, 0xAB, 0xFD, 0x6A, 0x1, 0x11, 0xAC, 0x5, 0x0, 0x0, 0x11, 0x66, 0x8D, 0x59, 0x1, 0x51, 0x66, 0x9D, 0x59, 0x1, 0x91, 0x66, 0xAD, 0x59, 0x1, 0xD1, 0x66, 0xBD, 0x59, 0x1, 0x11, 0x67, 0xCD, 0x59, 0x1, 0x51, 0x67, 0xDD, 0x59, 0x1, 0x31, 0xAC, 0x5, 0x0, 0x0, 0x51, 0xAC, 0x1D, 0x6B, 0x1, 0x91, 0xAC, 0x2D, 0x6B, 0x1, 0xD1, 0xAC, 0x3D, 0x6B, 0x1, 0x11, 0xAD, 0x4D, 0x6B, 0x1, 0x51, 0xAD, 0x5D, 0x6B, 0x1, 0x91, 0xAD, 0x6D, 0x6B, 0x1, 0xD1, 0xAD, 0x7D, 0x6B, 0x1, 0x11, 0xAE, 0x8D, 0x6B, 0x1, 0x51, 0xAE, 0x9D, 0x6B, 0x1, 0x91, 0xAE, 0xAD, 0x6B, 0x1, 0xD1, 0xAE, 0xBD, 0x6B, 0x1, 0x11, 0xAF, 0x5, 0x0, 0x0, 0x31, 0xAF, 0xDD, 0x6A, 0x1, 0x91, 0xAB, 0x5, 0x0, 0x0, 0x91, 0x6B, 0x5, 0x0, 0x0, 0xB1, 0x6B, 0xF5, 0x5A, 0x1, 0x51, 0xAF, 0xDD, 0x6B, 0x1, 0x91, 0xAF, 0x5, 0x0, 0x0, 0x11, 0x0, 0xE8, 0x6B, 0x1, 0xD1, 0xAF, 0xFD, 0x6B, 0x1, 0x11, 0xB0, 0x5, 0x0, 0x0, 0x31, 0xB0, 0x15, 0x6C, 0x1, 0x11, 0x0, 0x18, 0x6C, 0x1, 0x11, 0x0, 0x20, 0x6C, 0x1, 0xB1, 0xB0, 0x35, 0x6C, 0x1, 0xF1, 0xB0, 0x45, 0x6C, 0x1, 0x31, 0xB1, 0x55, 0x6C, 0x1, 0x71, 0xB1, 0x65, 0x6C, 0x1, 0xB1, 0xB1, 0x75, 0x6C, 0x1, 0x11, 0x0, 0x78, 0x6C, 0x1, 0x11, 0xB2, 0x8D, 0x6C, 0x1, 0x51, 0xB2, 0x9D, 0x6C, 0x1, 0x91, 0xB2, 0xAD, 0x6C, 0x1, 0x91, 0x6E, 0xAD, 0x5B, 0x1, 0xD1, 0x6E, 0xBD, 0x5B, 0x1, 0x11, 0x6F, 0xB5, 0x6C, 0x1, 0xF1, 0xB2, 0xC5, 0x6C, 0x1, 0x31, 0xB3, 0xD5, 0x6C, 0x1, 0x71, 0xB3, 0x5, 0x0, 0x0, 0xB1, 0x6F, 0xF5, 0x5B, 0x1, 0xF1, 0x6F, 0x5, 0x5C, 0x1, 0x31, 0x70, 0x15, 0x5C, 0x1, 0x71, 0x70, 0x25, 0x5C, 0x1, 0xB1, 0x70, 0xE5, 0x6C, 0x1, 0xF1, 0x70, 0x45, 0x5C, 0x1, 0x31, 0x71, 0x55, 0x5C, 0x1, 0x71, 0x71, 0x65, 0x5C, 0x1, 0xB1, 0x71, 0x75, 0x5C, 0x1, 0xF1, 0x71, 0x85, 0x5C, 0x1, 0x31, 0x72, 0x95, 0x5C, 0x1, 0x71, 0x72, 0xA5, 0x5C, 0x1, 0xB1, 0x72, 0xB5, 0x5C, 0x1, 0xF1, 0x72, 0xC5, 0x5C, 0x1, 0x31, 0x73, 0xD5, 0x5C, 0x1, 0xB1, 0xB3, 0xED, 0x5C, 0x1, 0xD1, 0x73, 0xF5, 0x6C, 0x1, 0xF1, 0x73, 0x5, 0x5D, 0x1, 0x31, 0x74, 0x15, 0x5D, 0x1, 0x71, 0x74, 0x25, 0x5D, 0x1, 0xB1, 0x74, 0x35, 0x5D, 0x1, 0xF1, 0x74, 0xFD, 0x6C, 0x1, 0x11, 0xB4, 0xD, 0x6D, 0x1, 0x51, 0xB4, 0x1D, 0x6D, 0x1, 0x91, 0xB4, 0x2D, 0x6D, 0x1, 0xD1, 0xB4, 0x3D, 0x6D, 0x1, 0x31, 0x76, 0x95, 0x5D, 0x1, 0x11, 0xB5, 0x9D, 0x5D, 0x1, 0x31, 0xB5, 0xA5, 0x5D, 0x1, 0x11, 0x0, 0xA8, 0x5D, 0x1, 0x51, 0xB5, 0x5D, 0x6D, 0x1, 0x91, 0xB5, 0x6D, 0x6D, 0x1, 0xD1, 0xB5, 0xCD, 0x5D, 0x1, 0x11, 0x0, 0x78, 0x6D, 0x1, 0x11, 0xB6, 0xDD, 0x5D, 0x1, 0x91, 0x77, 0xED, 0x5D, 0x1, 0x31, 0xB6, 0x95, 0x6D, 0x1, 0x71, 0xB6, 0xF5, 0x5D, 0x1, 0x91, 0xB6, 0xAD, 0x6D, 0x1, 0xD1, 0xB6, 0xBD, 0x6D, 0x1, 0x11, 0xB7, 0xCD, 0x6D, 0x1, 0x51, 0xB7, 0xDD, 0x6D, 0x1, 0x91, 0xB7, 0x15, 0x5E, 0x1, 0x71, 0x78, 0xED, 0x6D, 0x1, 0xD1, 0xB7, 0xFD, 0x6D, 0x1, 0x11, 0xB8, 0xD, 0x6E, 0x1, 0x11, 0x79, 0x4D, 0x5E, 0x1, 0x51, 0x79, 0x5D, 0x5E, 0x1, 0x91, 0x79, 0x6D, 0x5E, 0x1, 0xD1, 0x79, 0x7D, 0x5E, 0x1, 0x11, 0x7A, 0x8D, 0x5E, 0x1, 0x51, 0x7A, 0x9D, 0x5E, 0x1, 0x91, 0x7A, 0xAD, 0x5E, 0x1, 0xD1, 0x7A, 0xBD, 0x5E, 0x1, 0x11, 0x7B, 0xCD, 0x5E, 0x1, 0x51, 0x7B, 0xDD, 0x5E, 0x1, 0x91, 0x7B, 0xED, 0x5E, 0x1, 0xD1, 0x7B, 0x15, 0x6E, 0x1, 0x71, 0xB8, 0x25, 0x6E, 0x1, 0xB1, 0xB8, 0x35, 0x6E, 0x1, 0xF1, 0xB8, 0x45, 0x6E, 0x1, 0x31, 0xB9, 0x55, 0x6E, 0x1, 0xF1, 0x7C, 0x45, 0x5F, 0x1, 0x31, 0x7D, 0x5D, 0x6E, 0x1, 0x71, 0x7D, 0x65, 0x5F, 0x1, 0xB1, 0x7D, 0x75, 0x5F, 0x1, 0xF1, 0x7D, 0x85, 0x5F, 0x1, 0x31, 0x7E, 0x95, 0x5F, 0x1, 0x71, 0x7E, 0xA5, 0x5F, 0x1, 0xB1, 0x7E, 0xB5, 0x5F, 0x1, 0xF1, 0x7E, 0xC5, 0x5F, 0x1, 0x31, 0x7F, 0xD5, 0x5F, 0x1, 0x71, 0x7F, 0xE5, 0x5F, 0x1, 0xB1, 0x7F, 0xF5, 0x5F, 0x1, 0xF1, 0x7F, 0x5, 0x60, 0x1, 0x31, 0x80, 0x15, 0x60, 0x1, 0x91, 0xB9, 0x6D, 0x6E, 0x1, 0xD1, 0xB9, 0x7D, 0x6E, 0x1, 0x11, 0xBA, 0x8D, 0x6E, 0x1, 0x51, 0xBA, 0x9D, 0x6E, 0x1, 0x91, 0xBA, 0xAD, 0x6E, 0x1, 0xD1, 0xBA, 0xBD, 0x6E, 0x1, 0x11, 0xBB, 0xCD, 0x6E, 0x1, 0x51, 0xBB, 0xDD, 0x6E, 0x1, 0x91, 0xBB, 0x6D, 0x6E, 0x1, 0xB1, 0xBB, 0xF5, 0x6E, 0x1, 0xF1, 0xBB, 0x5, 0x6F, 0x1, 0x31, 0xBC, 0x15, 0x6F, 0x1, 0x71, 0xBC, 0x25, 0x6F, 0x1, 0xB1, 0xBC, 0x35, 0x6F, 0x1, 0xF1, 0xBC, 0x45, 0x6F, 0x1, 0x31, 0xBD, 0x55, 0x6F, 0x1, 0x12, 0x0, 0x58, 0x6F, 0x1, 0x92, 0xBD, 0x6D, 0x6F, 0x1, 0xD2, 0xBD, 0x7D, 0x6F, 0x1, 0x12, 0xBE, 0x8D, 0x6F, 0x1, 0x52, 0xBE, 0x9D, 0x6F, 0x1, 0x92, 0xBE, 0xAD, 0x6F, 0x1, 0xD2, 0xBE, 0xBD, 0x6F, 0x1, 0x12, 0xBF, 0xCD, 0x6F, 0x1, 0x52, 0xBF, 0xDD, 0x6F, 0x1, 0x92, 0xBF, 0xED, 0x6F, 0x1, 0xD2, 0xBF, 0xFD, 0x6F, 0x1, 0x12, 0xC0, 0xD, 0x70, 0x1, 0x52, 0xC0, 0x1D, 0x70, 0x1, 0x92, 0xC0, 0x2D, 0x70, 0x1, 0x12, 0x0, 0x30, 0x70, 0x1, 0xF2, 0xC0, 0x45, 0x70, 0x1, 0x32, 0xC1, 0x55, 0x70, 0x1, 0x72, 0xC1, 0x65, 0x70, 0x1, 0xB2, 0xC1, 0x75, 0x70, 0x1, 0xF2, 0xC1, 0x85, 0x70, 0x1, 0x32, 0xC2, 0x95, 0x70, 0x1, 0x72, 0xC2, 0xA5, 0x70, 0x1, 0xB2, 0xC2, 0xB5, 0x70, 0x1, 0xF2, 0xC2, 0xC5, 0x70, 0x1, 0x32, 0xC3, 0xD5, 0x70, 0x1, 0x72, 0xC3, 0xE5, 0x70, 0x1, 0xB2, 0xC3, 0xF5, 0x70, 0x1, 0xF2, 0xC3, 0x5, 0x71, 0x1, 0x32, 0xC4, 0x15, 0x71, 0x1, 0x72, 0xC4, 0x25, 0x71, 0x1, 0xB2, 0xC4, 0x35, 0x71, 0x1, 0xF2, 0xC4, 0x45, 0x71, 0x1, 0x32, 0xC5, 0x55, 0x71, 0x1, 0x72, 0xC5, 0x65, 0x71, 0x1, 0xB2, 0xC5, 0x75, 0x71, 0x1, 0x12, 0x0, 0x78, 0x71, 0x1, 0x12, 0xC6, 0x8D, 0x71, 0x1, 0x52, 0xC6, 0x9D, 0x71, 0x1, 0x92, 0xC6, 0xAD, 0x71, 0x1, 0xD2, 0xC6, 0xBD, 0x71, 0x1, 0x12, 0xC7, 0xCD, 0x71, 0x1, 0x52, 0xC7, 0xDD, 0x71, 0x1, 0x92, 0xC7, 0xED, 0x71, 0x1, 0xD2, 0xC7, 0xFD, 0x71, 0x1, 0x12, 0xC8, 0xD, 0x72, 0x1, 0x52, 0xC8, 0x5, 0x0, 0x0, 0x72, 0xC8, 0x25, 0x72, 0x1, 0xB2, 0xC8, 0x35, 0x72, 0x1, 0xF2, 0xC8, 0x45, 0x72, 0x1, 0x32, 0xC9, 0x55, 0x72, 0x1, 0x72, 0xC9, 0x65, 0x72, 0x1, 0x12, 0x0, 0x68, 0x72, 0x1, 0xD2, 0xC9, 0x7D, 0x72, 0x1, 0x12, 0x0, 0x80, 0x72, 0x1, 0x32, 0xCA, 0x95, 0x72, 0x1, 0x72, 0xCA, 0xA5, 0x72, 0x1, 0xB2, 0xCA, 0xB5, 0x72, 0x1, 0xF2, 0xCA, 0xC5, 0x72, 0x1, 0x32, 0xCB, 0xD5, 0x72, 0x1, 0x72, 0xCB, 0xE5, 0x72, 0x1, 0xB2, 0xCB, 0xF5, 0x72, 0x1, 0xF2, 0xCB, 0x5, 0x73, 0x1, 0x32, 0xCC, 0x15, 0x73, 0x1, 0x72, 0xCC, 0x25, 0x73, 0x1, 0xB2, 0xCC, 0x35, 0x73, 0x1, 0xF2, 0xCC, 0x45, 0x73, 0x1, 0x32, 0xCD, 0x5, 0x0, 0x0, 0x52, 0xCD, 0x5D, 0x73, 0x1, 0x92, 0xCD, 0x6D, 0x73, 0x1, 0xD2, 0xCD, 0x7D, 0x73, 0x1, 0x12, 0xCE, 0x8D, 0x73, 0x1, 0x52, 0xCE, 0x9D, 0x73, 0x1, 0x92, 0xCE, 0xAD, 0x73, 0x1, 0xD2, 0xCE, 0xBD, 0x73, 0x1, 0x12, 0xCF, 0xCD, 0x73, 0x1, 0x52, 0xCF, 0xDD, 0x73, 0x1, 0x12, 0x0, 0xE0, 0x73, 0x1, 0xB2, 0xCF, 0xF5, 0x73, 0x1, 0xF2, 0xCF, 0x5, 0x74, 0x1, 0x32, 0xD0, 0x15, 0x74, 0x1, 0x72, 0xD0, 0x25, 0x74, 0x1, 0xB2, 0xD0, 0x35, 0x74, 0x1, 0xF2, 0xD0, 0x45, 0x74, 0x1, 0x32, 0xD1, 0x5, 0x0, 0x0, 0x52, 0xD1, 0x5D, 0x74, 0x1, 0x92, 0xD1, 0x6D, 0x74, 0x1, 0xD2, 0xD1, 0x7D, 0x74, 0x1, 0x12, 0xD2, 0x5, 0x0, 0x0, 0x12, 0x0, 0x80, 0x74, 0x1, 0x12, 0x0, 0x88, 0x74, 0x1, 0x52, 0xD2, 0x5, 0x0, 0x0, 0x72, 0xD2, 0xA5, 0x74, 0x1, 0x12, 0x0, 0xA8, 0x74, 0x1, 0xD2, 0xD2, 0xBD, 0x74, 0x1, 0x12, 0xD3, 0xCD, 0x74, 0x1, 0x12, 0x0, 0xD0, 0x74, 0x1, 0x12, 0x0, 0xD8, 0x74, 0x1, 0x92, 0xD3, 0xED, 0x74, 0x1, 0x12, 0x0, 0xF0, 0x74, 0x1, 0xF2, 0xD3, 0x5, 0x75, 0x1, 0x12, 0x0, 0x8, 0x75, 0x1, 0x52, 0xD4, 0x1D, 0x75, 0x1, 0x92, 0xD4, 0x2D, 0x75, 0x1, 0xD2, 0xD4, 0x3D, 0x75, 0x1, 0x12, 0xD5, 0x4D, 0x75, 0x1, 0x52, 0xD5, 0x5D, 0x75, 0x1, 0x92, 0xD5, 0x6D, 0x75, 0x1, 0xD2, 0xD5, 0x7D, 0x75, 0x1, 0x12, 0xD6, 0x8D, 0x75, 0x1, 0x52, 0xD6, 0x9D, 0x75, 0x1, 0x92, 0xD6, 0xAD, 0x75, 0x1, 0xD2, 0xD6, 0xBD, 0x75, 0x1, 0x12, 0xD7, 0xCD, 0x75, 0x1, 0x52, 0xD7, 0xDD, 0x75, 0x1, 0x92, 0xD7, 0xED, 0x75, 0x1, 0xD2, 0xD7, 0xFD, 0x75, 0x1, 0x12, 0xD8, 0xD, 0x76, 0x1, 0x52, 0xD8, 0x1D, 0x76, 0x1, 0x92, 0xD8, 0x2D, 0x76, 0x1, 0xD2, 0xD8, 0x3D, 0x76, 0x1, 0x12, 0xD9, 0x4D, 0x76, 0x1, 0x52, 0xD9, 0x5D, 0x76, 0x1, 0x92, 0xD9, 0x6D, 0x76, 0x1, 0xD2, 0xD9, 0x7D, 0x76, 0x1, 0x12, 0xDA, 0x8D, 0x76, 0x1, 0x52, 0xDA, 0x5, 0x0, 0x0, 0x72, 0xDA, 0xA5, 0x76, 0x1, 0xB2, 0xDA, 0xB5, 0x76, 0x1, 0xF2, 0xDA, 0xC5, 0x76, 0x1, 0x32, 0xDB, 0xD5, 0x76, 0x1, 0x72, 0xDB, 0xE5, 0x76, 0x1, 0xB2, 0xDB, 0xF5, 0x76, 0x1, 0xF2, 0xDB, 0x5, 0x77, 0x1, 0x32, 0xDC, 0x15, 0x77, 0x1, 0x72, 0xDC, 0x25, 0x77, 0x1, 0xB2, 0xDC, 0x35, 0x77, 0x1, 0xF2, 0xDC, 0x45, 0x77, 0x1, 0x32, 0xDD, 0x55, 0x77, 0x1, 0x72, 0xDD, 0x65, 0x77, 0x1, 0xB2, 0xDD, 0x75, 0x77, 0x1, 0xF2, 0xDD, 0x85, 0x77, 0x1, 0x32, 0xDE, 0x95, 0x77, 0x1, 0x72, 0xDE, 0xA5, 0x77, 0x1, 0xB2, 0xDE, 0xB5, 0x77, 0x1, 0xF2, 0xDE, 0xC5, 0x77, 0x1, 0x32, 0xDF, 0x5, 0x0, 0x0, 0x52, 0xDF, 0xDD, 0x77, 0x1, 0x92, 0xDF, 0xED, 0x77, 0x1, 0xD2, 0xDF, 0xFD, 0x77, 0x1, 0x12, 0xE0, 0xD, 0x78, 0x1, 0x52, 0xE0, 0x1D, 0x78, 0x1, 0x92, 0xE0, 0x2D, 0x78, 0x1, 0xD2, 0xE0, 0x3D, 0x78, 0x1, 0x12, 0xE1, 0x4D, 0x78, 0x1, 0x52, 0xE1, 0x5D, 0x78, 0x1, 0x92, 0xE1, 0x6D, 0x78, 0x1, 0xD2, 0xE1, 0x7D, 0x78, 0x1, 0x12, 0xE2, 0x8D, 0x78, 0x1, 0x52, 0xE2, 0x9D, 0x78, 0x1, 0x92, 0xE2, 0xAD, 0x78, 0x1, 0xD2, 0xE2, 0xBD, 0x78, 0x1, 0x12, 0xE3, 0xCD, 0x78, 0x1, 0x52, 0xE3, 0xDD, 0x78, 0x1, 0x92, 0xE3, 0xED, 0x78, 0x1, 0xD2, 0xE3, 0xFD, 0x78, 0x1, 0x12, 0xE4, 0xD, 0x79, 0x1, 0x52, 0xE4, 0x1D, 0x79, 0x1, 0x92, 0xE4, 0x2D, 0x79, 0x1, 0xD2, 0xE4, 0x3D, 0x79, 0x1, 0x12, 0xE5, 0x4D, 0x79, 0x1, 0x52, 0xE5, 0x5D, 0x79, 0x1, 0x92, 0xE5, 0x6D, 0x79, 0x1, 0xD2, 0xE5, 0x7D, 0x79, 0x1, 0x12, 0xE6, 0x8D, 0x79, 0x1, 0x52, 0xE6, 0x9D, 0x79, 0x1, 0x92, 0xE6, 0xAD, 0x79, 0x1, 0xD2, 0xE6, 0xBD, 0x79, 0x1, 0x12, 0xE7, 0xCD, 0x79, 0x1, 0x52, 0xE7, 0xDD, 0x79, 0x1, 0x92, 0xE7, 0xED, 0x79, 0x1, 0x12, 0x0, 0xF0, 0x79, 0x1, 0xF2, 0xE7, 0x5, 0x7A, 0x1, 0x32, 0xE8, 0x15, 0x7A, 0x1, 0x72, 0xE8, 0x25, 0x7A, 0x1, 0xB2, 0xE8, 0x35, 0x7A, 0x1, 0xF2, 0xE8, 0x45, 0x7A, 0x1, 0x32, 0xE9, 0x55, 0x7A, 0x1, 0x72, 0xE9, 0x65, 0x7A, 0x1, 0xB2, 0xE9, 0x75, 0x7A, 0x1, 0xF2, 0xE9, 0x85, 0x7A, 0x1, 0x32, 0xEA, 0x95, 0x7A, 0x1, 0x72, 0xEA, 0xA5, 0x7A, 0x1, 0xB2, 0xEA, 0xB5, 0x7A, 0x1, 0xF2, 0xEA, 0xC5, 0x7A, 0x1, 0x32, 0xEB, 0xD5, 0x7A, 0x1, 0x72, 0xEB, 0xE5, 0x7A, 0x1, 0xB2, 0xEB, 0x5, 0x0, 0x0, 0xD2, 0xEB, 0xFD, 0x7A, 0x1, 0x12, 0xEC, 0xD, 0x7B, 0x1, 0x52, 0xEC, 0x1D, 0x7B, 0x1, 0x92, 0xEC, 0x2D, 0x7B, 0x1, 0xD2, 0xEC, 0xFD, 0x7A, 0x1, 0xF2, 0xEC, 0x45, 0x7B, 0x1, 0x32, 0xED, 0x5, 0x0, 0x0, 0x52, 0xED, 0x5D, 0x7B, 0x1, 0x92, 0xED, 0x6D, 0x7B, 0x1, 0xD2, 0xED, 0x5, 0x0, 0x0, 0x12, 0x0, 0x78, 0x7B, 0x1, 0x12, 0xEE, 0x8D, 0x7B, 0x1, 0x52, 0xEE, 0x9D, 0x7B, 0x1, 0x92, 0xEE, 0x5, 0x0, 0x0, 0xB2, 0xEE, 0xB5, 0x7B, 0x1, 0xF2, 0xEE, 0xC5, 0x7B, 0x1, 0x32, 0xEF, 0xD5, 0x7B, 0x1, 0x72, 0xEF, 0xE5, 0x7B, 0x1, 0xB2, 0xEF, 0xF5, 0x7B, 0x1, 0xF2, 0xEF, 0x5, 0x7C, 0x1, 0x32, 0xF0, 0x15, 0x7C, 0x1, 0x72, 0xF0, 0x25, 0x7C, 0x1, 0x12, 0x0, 0x28, 0x7C, 0x1, 0xD2, 0xF0, 0x3D, 0x7C, 0x1, 0x12, 0xF1, 0x4D, 0x7C, 0x1, 0x52, 0xF1, 0x5D, 0x7C, 0x1, 0x92, 0xF1, 0x6D, 0x7C, 0x1, 0xD2, 0xF1, 0x7D, 0x7C, 0x1, 0x12, 0xF2, 0x8D, 0x7C, 0x1, 0x52, 0xF2, 0x9D, 0x7C, 0x1, 0x92, 0xF2, 0xAD, 0x7C, 0x1, 0xD2, 0xF2, 0xBD, 0x7C, 0x1, 0x12, 0xF3, 0xCD, 0x7C, 0x1, 0x52, 0xF3, 0xDD, 0x7C, 0x1, 0x92, 0xF3, 0xED, 0x7C, 0x1, 0xD2, 0xF3, 0xFD, 0x7C, 0x1, 0x12, 0xF4, 0x5, 0x0, 0x0, 0x32, 0xF4, 0x15, 0x7D, 0x1, 0x72, 0xF4, 0x25, 0x7D, 0x1, 0xB2, 0xF4, 0x35, 0x7D, 0x1, 0xF2, 0xF4, 0x45, 0x7D, 0x1, 0x32, 0xF5, 0x55, 0x7D, 0x1, 0x72, 0xF5, 0x65, 0x7D, 0x1, 0xB2, 0xF5, 0x75, 0x7D, 0x1, 0xF2, 0xF5, 0x85, 0x7D, 0x1, 0x32, 0xF6, 0x95, 0x7D, 0x1, 0x72, 0xF6, 0xA5, 0x7D, 0x1, 0xB2, 0xF6, 0xB5, 0x7D, 0x1, 0xF2, 0xF6, 0xC5, 0x7D, 0x1, 0x32, 0xF7, 0xD5, 0x7D, 0x1, 0x72, 0xF7, 0xE5, 0x7D, 0x1, 0xB2, 0xF7, 0xF5, 0x7D, 0x1, 0xF2, 0xF7, 0x5, 0x7E, 0x1, 0x32, 0xF8, 0x15, 0x7E, 0x1, 0x72, 0xF8, 0x25, 0x7E, 0x1, 0xB2, 0xF8, 0x35, 0x7E, 0x1, 0xF2, 0xF8, 0x45, 0x7E, 0x1, 0x32, 0xF9, 0x55, 0x7E, 0x1, 0x72, 0xF9, 0x65, 0x7E, 0x1, 0xB2, 0xF9, 0x75, 0x7E, 0x1, 0xF2, 0xF9, 0x85, 0x7E, 0x1, 0x32, 0xFA, 0x95, 0x7E, 0x1, 0x72, 0xFA, 0xA5, 0x7E, 0x1, 0xB2, 0xFA, 0xB5, 0x7E, 0x1, 0xF2, 0xFA, 0xC5, 0x7E, 0x1, 0x32, 0xFB, 0x95, 0x7E, 0x1, 0x12, 0x0, 0xD0, 0x7E, 0x1, 0x72, 0xFB, 0xE5, 0x7E, 0x1, 0xB2, 0xFB, 0xF5, 0x7E, 0x1, 0xF2, 0xFB, 0x5, 0x7F, 0x1, 0x33, 0xFC, 0x15, 0x7F, 0x1, 0x73, 0xFC, 0x25, 0x7F, 0x1, 0xB3, 0xFC, 0x35, 0x7F, 0x1, 0xF3, 0xFC, 0x45, 0x7F, 0x1, 0x33, 0xFD, 0x55, 0x7F, 0x1, 0x73, 0xFD, 0x65, 0x7F, 0x1, 0xB3, 0xFD, 0x75, 0x7F, 0x1, 0x13, 0x0, 0x78, 0x7F, 0x1, 0x13, 0x0, 0x80, 0x7F, 0x1, 0x33, 0xFE, 0x95, 0x7F, 0x1, 0x73, 0xFE, 0xA5, 0x7F, 0x1, 0xB3, 0xFE, 0xB5, 0x7F, 0x1, 0xF3, 0xFE, 0xC5, 0x7F, 0x1, 0x33, 0xFF, 0x5, 0x0, 0x0, 0x53, 0xFF, 0xDD, 0x7F, 0x1, 0x93, 0xFF, 0xED, 0x7F, 0x1, 0xD3, 0xFF, 0xFD, 0x7F, 0x1, 0x13, 0x0, 0xE, 0x80, 0x1, 0x53, 0x0, 0x1E, 0x80, 0x1, 0x93, 0x0, 0x2E, 0x80, 0x1, 0xD3, 0x0, 0x3E, 0x80, 0x1, 0x13, 0x1, 0x4E, 0x80, 0x1, 0x53, 0x1, 0x5E, 0x80, 0x1, 0x93, 0x1, 0x6E, 0x80, 0x1, 0xD3, 0x1, 0x7E, 0x80, 0x1, 0x13, 0x2, 0x8E, 0x80, 0x1, 0x53, 0x2, 0x9E, 0x80, 0x1, 0x13, 0x0, 0xA0, 0x80, 0x1, 0xB3, 0x2, 0xB6, 0x80, 0x1, 0xF3, 0x2, 0xC6, 0x80, 0x1, 0x33, 0x3, 0xD6, 0x80, 0x1, 0x73, 0x3, 0xE6, 0x80, 0x1, 0xB3, 0x3, 0xF6, 0x80, 0x1, 0xF3, 0x3, 0x6, 0x81, 0x1, 0x33, 0x4, 0x16, 0x81, 0x1, 0x73, 0x4, 0x26, 0x81, 0x1, 0xB3, 0x4, 0x36, 0x81, 0x1, 0xF3, 0x4, 0x46, 0x81, 0x1, 0x33, 0x5, 0x56, 0x81, 0x1, 0x73, 0x5, 0x66, 0x81, 0x1, 0xB3, 0x5, 0x76, 0x81, 0x1, 0xF3, 0x5, 0x86, 0x81, 0x1, 0x33, 0x6, 0x96, 0x81, 0x1, 0x73, 0x6, 0xA6, 0x81, 0x1, 0x13, 0x0, 0xA8, 0x81, 0x1, 0xD3, 0x6, 0xBE, 0x81, 0x1, 0x13, 0x7, 0x6, 0x0, 0x0, 0x13, 0x0, 0xC8, 0x81, 0x1, 0x53, 0x7, 0xDE, 0x81, 0x1, 0x93, 0x7, 0xEE, 0x81, 0x1, 0xD3, 0x7, 0xFE, 0x81, 0x1, 0x13, 0x8, 0xE, 0x82, 0x1, 0x53, 0x8, 0x1E, 0x82, 0x1, 0x93, 0x8, 0x2E, 0x82, 0x1, 0x33, 0x9, 0x56, 0x82, 0x1, 0x53, 0xA, 0x9E, 0x82, 0x1, 0x93, 0xA, 0xAE, 0x82, 0x1, 0xD3, 0xA, 0xBE, 0x82, 0x1, 0x13, 0xB, 0xCE, 0x82, 0x1, 0x53, 0xB, 0xDE, 0x82, 0x1, 0x93, 0xB, 0xEE, 0x82, 0x1, 0xD3, 0xB, 0xFE, 0x82, 0x1, 0x13, 0xC, 0xE, 0x83, 0x1, 0x53, 0xC, 0x1E, 0x83, 0x1, 0x93, 0xC, 0x2E, 0x83, 0x1, 0xD3, 0xC, 0x3E, 0x83, 0x1, 0x13, 0xD, 0x4E, 0x83, 0x1, 0x53, 0xD, 0x5E, 0x83, 0x1, 0x93, 0xD, 0x6E, 0x83, 0x1, 0xD3, 0xD, 0x7E, 0x83, 0x1, 0x13, 0xE, 0x8E, 0x83, 0x1, 0x53, 0xE, 0x6, 0x0, 0x0, 0x73, 0xE, 0x6, 0x0, 0x0, 0x93, 0xE, 0xAE, 0x83, 0x1, 0xD3, 0xE, 0xBE, 0x83, 0x1, 0x13, 0xF, 0xCE, 0x83, 0x1, 0x13, 0x0, 0xD8, 0x83, 0x1, 0x93, 0xF, 0xEE, 0x83, 0x1, 0xD3, 0xF, 0xFE, 0x83, 0x1, 0x13, 0x10, 0xE, 0x84, 0x1, 0x53, 0x10, 0x1E, 0x84, 0x1, 0x93, 0x10, 0x2E, 0x84, 0x1, 0xD3, 0x10, 0x3E, 0x84, 0x1, 0x13, 0x11, 0x4E, 0x84, 0x1, 0x53, 0x11, 0x5E, 0x84, 0x1, 0x93, 0x11, 0x6E, 0x84, 0x1, 0xD3, 0x11, 0x7E, 0x84, 0x1, 0x13, 0x12, 0x8E, 0x84, 0x1, 0x53, 0x12, 0x9E, 0x84, 0x1, 0x93, 0x12, 0xAE, 0x84, 0x1, 0xD3, 0x12, 0xBE, 0x84, 0x1, 0x13, 0x13, 0xCE, 0x84, 0x1, 0x53, 0x13, 0xDE, 0x84, 0x1, 0x93, 0x13, 0xEE, 0x84, 0x1, 0xD3, 0x13, 0xFE, 0x84, 0x1, 0x13, 0x14, 0xE, 0x85, 0x1, 0x53, 0x14, 0x1E, 0x85, 0x1, 0x93, 0x14, 0x2E, 0x85, 0x1, 0xD3, 0x14, 0x3E, 0x85, 0x1, 0x13, 0x15, 0x4E, 0x85, 0x1, 0x53, 0x15, 0x3E, 0x85, 0x1, 0x73, 0x15, 0x66, 0x85, 0x1, 0xB3, 0x15, 0x76, 0x85, 0x1, 0xF3, 0x15, 0x86, 0x85, 0x1, 0x33, 0x16, 0x96, 0x85, 0x1, 0x73, 0x16, 0xA6, 0x85, 0x1, 0xB3, 0x16, 0xB6, 0x85, 0x1, 0xF3, 0x16, 0xC6, 0x85, 0x1, 0x33, 0x17, 0xD6, 0x85, 0x1, 0x73, 0x17, 0xE6, 0x85, 0x1, 0xB3, 0x17, 0xF6, 0x85, 0x1, 0xF3, 0x17, 0x6, 0x86, 0x1, 0x33, 0x18, 0x16, 0x86, 0x1, 0x73, 0x18, 0x26, 0x86, 0x1, 0xB3, 0x18, 0x36, 0x86, 0x1, 0xF3, 0x18, 0x46, 0x86, 0x1, 0x33, 0x19, 0x56, 0x86, 0x1, 0x73, 0x19, 0x66, 0x86, 0x1, 0xB3, 0x19, 0x76, 0x86, 0x1, 0xF3, 0x19, 0x86, 0x86, 0x1, 0x33, 0x1A, 0x96, 0x86, 0x1, 0x73, 0x1A, 0xA6, 0x86, 0x1, 0xB3, 0x1A, 0xB6, 0x86, 0x1, 0xF3, 0x1A, 0xC6, 0x86, 0x1, 0x33, 0x1B, 0xD6, 0x86, 0x1, 0x73, 0x1B, 0xE6, 0x86, 0x1, 0xB3, 0x1B, 0xF6, 0x86, 0x1, 0xF3, 0x1B, 0x6, 0x87, 0x1, 0x33, 0x1C, 0x16, 0x87, 0x1, 0x73, 0x1C, 0x26, 0x87, 0x1, 0xB3, 0x1C, 0x36, 0x87, 0x1, 0xF3, 0x1C, 0x26, 0x87, 0x1, 0x13, 0x1D, 0x4E, 0x87, 0x1, 0x53, 0x1D, 0x5E, 0x87, 0x1, 0x94, 0x1D, 0x6E, 0x87, 0x1, 0xD4, 0x1D, 0x7E, 0x87, 0x1, 0x14, 0x1E, 0x8E, 0x87, 0x1, 0x54, 0x1E, 0x6, 0x0, 0x0, 0x74, 0x1E, 0x6, 0x0, 0x0, 0x14, 0x0, 0xA0, 0x87, 0x1, 0xB4, 0x1E, 0xB6, 0x87, 0x1, 0xF4, 0x1E, 0xC6, 0x87, 0x1, 0x34, 0x1F, 0xD6, 0x87, 0x1, 0x74, 0x1F, 0xE6, 0x87, 0x1, 0xB4, 0x1F, 0xF6, 0x87, 0x1, 0xF4, 0x1F, 0x6, 0x88, 0x1, 0x14, 0x0, 0x8, 0x88, 0x1, 0x54, 0x20, 0x1E, 0x88, 0x1, 0x14, 0x0, 0x20, 0x88, 0x1, 0xB4, 0x20, 0x36, 0x88, 0x1, 0xF4, 0x20, 0x46, 0x88, 0x1, 0x34, 0x21, 0x56, 0x88, 0x1, 0x74, 0x21, 0x66, 0x88, 0x1, 0xB4, 0x21, 0x76, 0x88, 0x1, 0xF4, 0x21, 0x86, 0x88, 0x1, 0x34, 0x22, 0x96, 0x88, 0x1, 0x74, 0x22, 0x8E, 0x88, 0x1, 0x54, 0x22, 0x9E, 0x88, 0x1, 0x14, 0x0, 0xA0, 0x88, 0x1, 0xB4, 0x22, 0xB6, 0x88, 0x1, 0xF4, 0x22, 0x6, 0x0, 0x0, 0x14, 0x0, 0xC0, 0x88, 0x1, 0x14, 0x0, 0xD0, 0x88, 0x1, 0x74, 0x23, 0xE6, 0x88, 0x1, 0xB4, 0x23, 0xF6, 0x88, 0x1, 0xF4, 0x23, 0x6, 0x89, 0x1, 0x34, 0x24, 0x36, 0x82, 0x1, 0xF4, 0x8, 0x46, 0x82, 0x1, 0x54, 0x24, 0x5E, 0x82, 0x1, 0x94, 0x9, 0x6E, 0x82, 0x1, 0xD4, 0x9, 0x7E, 0x82, 0x1, 0x14, 0xA, 0x8E, 0x82, 0x1, 0x74, 0x24, 0x26, 0x89, 0x1, 0xB4, 0x24, 0x36, 0x89, 0x1, 0xF4, 0x24, 0x46, 0x89, 0x1, 0x34, 0x25, 0x56, 0x89, 0x1, 0x74, 0x25, 0x66, 0x89, 0x1, 0xB4, 0x25, 0x76, 0x89, 0x1, 0xF4, 0x25, 0x86, 0x89, 0x1, 0x34, 0x26, 0x96, 0x89, 0x1, 0x14, 0x0, 0x98, 0x89, 0x1, 0x94, 0x26, 0x6, 0x0, 0x0, 0xB4, 0x26, 0xB6, 0x89, 0x1, 0xF4, 0x26, 0x6, 0x0, 0x0, 0x54, 0xF, 0x76, 0x87, 0x1, 0xF4, 0x1D, 0x86, 0x87, 0x1, 0x34, 0x1E, 0x96, 0x87, 0x1, 0xF4, 0x26, 0x26, 0x88, 0x1, 0x14, 0x0, 0xC0, 0x89, 0x1, 0x34, 0x27, 0xD6, 0x89, 0x1, 0x14, 0x27, 0xCE, 0x89, 0x1, 0x54, 0x27, 0xDE, 0x89, 0x1, 0x94, 0x27, 0xEE, 0x89, 0x1, 0xD4, 0x27, 0xFE, 0x89, 0x1, 0x14, 0x28, 0xE, 0x8A, 0x1, 0x54, 0x28, 0x1E, 0x8A, 0x1, 0x94, 0x28, 0x2E, 0x8A, 0x1, 0xD4, 0x28, 0x3E, 0x8A, 0x1, 0x14, 0x29, 0x4E, 0x8A, 0x1, 0x54, 0x29, 0x4E, 0x8A, 0x1, 0x54, 0x29, 0x46, 0x8A, 0x1, 0x74, 0x29, 0x66, 0x8A, 0x1, 0xB4, 0x29, 0x76, 0x8A, 0x1, 0xF4, 0x29, 0x86, 0x8A, 0x1, 0xF4, 0x29, 0x8E, 0x8A, 0x1, 0x54, 0x2A, 0x6, 0x0, 0x0, 0x74, 0x2A, 0xA6, 0x8A, 0x1, 0xB4, 0x2A, 0xB6, 0x8A, 0x1, 0xF4, 0x2A, 0xC6, 0x8A, 0x1, 0x34, 0x2B, 0xD6, 0x8A, 0x1, 0x74, 0x2B, 0xE6, 0x8A, 0x1, 0xB4, 0x2B, 0xF6, 0x8A, 0x1, 0xF4, 0x2B, 0x6, 0x8B, 0x1, 0x34, 0x2C, 0x16, 0x8B, 0x1, 0x74, 0x2C, 0x26, 0x8B, 0x1, 0xB4, 0x2C, 0x36, 0x8B, 0x1, 0xF4, 0x2C, 0x46, 0x8B, 0x1, 0x34, 0x2D, 0x56, 0x8B, 0x1, 0x74, 0x2D, 0x66, 0x8B, 0x1, 0xB4, 0x2D, 0x76, 0x8B, 0x1, 0xF4, 0x2D, 0x76, 0x8B, 0x1, 0x14, 0x2E, 0x8E, 0x8B, 0x1, 0x15, 0x0, 0x90, 0x8B, 0x1, 0x55, 0x2E, 0x6, 0x0, 0x0, 0x75, 0x2E, 0xA6, 0x8B, 0x1, 0xB5, 0x2E, 0xB6, 0x8B, 0x1, 0x15, 0x0, 0xB8, 0x8B, 0x1, 0x15, 0x2F, 0xCE, 0x8B, 0x1, 0x55, 0x2F, 0xDE, 0x8B, 0x1, 0x95, 0x2F, 0x6, 0x0, 0x0, 0x15, 0x0, 0xE8, 0x8B, 0x1, 0xD5, 0x2F, 0xFE, 0x8B, 0x1, 0x15, 0x30, 0xE, 0x8C, 0x1, 0x55, 0x30, 0x1E, 0x8C, 0x1, 0x95, 0x30, 0x2E, 0x8C, 0x1, 0xD5, 0x30, 0x3E, 0x8C, 0x1, 0x15, 0x31, 0x4E, 0x8C, 0x1, 0x55, 0x31, 0x5E, 0x8C, 0x1, 0x95, 0x31, 0x6, 0x0, 0x0, 0x15, 0x0, 0x68, 0x8C, 0x1, 0x35, 0x23, 0x76, 0x8C, 0x1, 0xF5, 0x31, 0x6, 0x0, 0x0, 0x15, 0x32, 0x8E, 0x8C, 0x1, 0x55, 0x32, 0x9E, 0x8C, 0x1, 0x95, 0x32, 0xAE, 0x8C, 0x1, 0xD5, 0x32, 0xBE, 0x8C, 0x1, 0x15, 0x33, 0xCE, 0x8C, 0x1, 0x55, 0x33, 0xDE, 0x8C, 0x1, 0x95, 0x33, 0xEE, 0x8C, 0x1, 0xD5, 0x33, 0xFE, 0x8C, 0x1, 0x15, 0x0, 0x0, 0x8D, 0x1, 0x35, 0x34, 0x6, 0x0, 0x0, 0x55, 0x34, 0x1E, 0x8D, 0x1, 0x95, 0x34, 0x2E, 0x8D, 0x1, 0xD5, 0x34, 0x6, 0x0, 0x0, 0x55, 0x34, 0x3E, 0x8D, 0x1, 0x35, 0x30, 0x6, 0x0, 0x0, 0x15, 0x0, 0x40, 0x8D, 0x1, 0x35, 0x35, 0x56, 0x8D, 0x1, 0x75, 0x35, 0x66, 0x8D, 0x1, 0xB5, 0x35, 0x76, 0x8D, 0x1, 0xF5, 0x35, 0x86, 0x8D, 0x1, 0x35, 0x36, 0x96, 0x8D, 0x1, 0x75, 0x36, 0xA6, 0x8D, 0x1, 0xB5, 0x36, 0xB6, 0x8D, 0x1, 0xF5, 0x36, 0xC6, 0x8D, 0x1, 0x35, 0x37, 0x6, 0x0, 0x0, 0x15, 0x0, 0xD0, 0x8D, 0x1, 0x75, 0x37, 0xE6, 0x8D, 0x1, 0xB5, 0x37, 0xF6, 0x8D, 0x1, 0xF5, 0x37, 0x6, 0x8E, 0x1, 0x35, 0x38, 0x16, 0x8E, 0x1, 0x75, 0x38, 0x26, 0x8E, 0x1, 0xB5, 0x38, 0x36, 0x8E, 0x1, 0xF5, 0x38, 0x46, 0x8E, 0x1, 0x56, 0x39, 0x5E, 0x8E, 0x1, 0x16, 0x0, 0x60, 0x8E, 0x1, 0xB6, 0x39, 0x6, 0x0, 0x0, 0xD6, 0x39, 0x7E, 0x8E, 0x1, 0x16, 0x3A, 0x8E, 0x8E, 0x1, 0x16, 0x0, 0x90, 0x8E, 0x1, 0x76, 0x3A, 0x6, 0x0, 0x0, 0x16, 0x0, 0xA0, 0x8E, 0x1, 0xB6, 0x3A, 0xB6, 0x8E, 0x1, 0xF6, 0x3A, 0xC6, 0x8E, 0x1, 0x36, 0x3B, 0xD6, 0x8E, 0x1, 0x16, 0x0, 0xD8, 0x8E, 0x1, 0x96, 0x3B, 0xEE, 0x8E, 0x1, 0xD6, 0x3B, 0xFE, 0x8E, 0x1, 0x16, 0x3C, 0xE, 0x8F, 0x1, 0x56, 0x3C, 0x1E, 0x8F, 0x1, 0x96, 0x3C, 0x2E, 0x8F, 0x1, 0x16, 0x0, 0x30, 0x8F, 0x1, 0xF6, 0x3C, 0x6, 0x0, 0x0, 0x16, 0x0, 0x40, 0x8F, 0x1, 0x36, 0x3D, 0x56, 0x8F, 0x1, 0x76, 0x3D, 0x66, 0x8F, 0x1, 0x16, 0x0, 0x68, 0x8F, 0x1, 0xD6, 0x3D, 0x7E, 0x8F, 0x1, 0x16, 0x3E, 0x8E, 0x8F, 0x1, 0x56, 0x3E, 0x9E, 0x8F, 0x1, 0x96, 0x3E, 0xAE, 0x8F, 0x1, 0xD6, 0x3E, 0x6, 0x0, 0x0, 0x16, 0x0, 0xB8, 0x8F, 0x1, 0x16, 0x3F, 0xCE, 0x8F, 0x1, 0x56, 0x3F, 0xDE, 0x8F, 0x1, 0x96, 0x3F, 0xEE, 0x8F, 0x1, 0xD6, 0x3F, 0x6, 0x0, 0x0, 0x36, 0x39, 0x6, 0x0, 0x0, 0x17, 0x0, 0xF8, 0x8F, 0x1, 0x17, 0x40, 0xE, 0x90, 0x1, 0x57, 0x40, 0x1E, 0x90, 0x1, 0x97, 0x40, 0x2E, 0x90, 0x1, 0x17, 0x0, 0x30, 0x90, 0x1, 0xF7, 0x40, 0x46, 0x90, 0x1, 0x37, 0x41, 0x6, 0x0, 0x0, 0x57, 0x41, 0x5E, 0x90, 0x1, 0x97, 0x41, 0x6E, 0x90, 0x1, 0xD7, 0x41, 0x7E, 0x90, 0x1, 0x17, 0x42, 0x8E, 0x90, 0x1, 0x57, 0x42, 0x6, 0x0, 0x0, 0x77, 0x42, 0x6, 0x0, 0x0, 0x97, 0x42, 0x6, 0x0, 0x0, 0xB7, 0x42, 0xB6, 0x90, 0x1, 0xF7, 0x42, 0xC6, 0x90, 0x1, 0x37, 0x43, 0xD6, 0x90, 0x1, 0x77, 0x43, 0xE6, 0x90, 0x1, 0xB7, 0x43, 0xF6, 0x90, 0x1, 0xF7, 0x43, 0x6, 0x91, 0x1, 0x38, 0x44, 0x6, 0x0, 0x0, 0x58, 0x44, 0x6, 0x0, 0x0, 0x78, 0x44, 0x26, 0x91, 0x1, 0xB8, 0x44, 0x36, 0x91, 0x1, 0x18, 0x0, 0x38, 0x91, 0x1, 0x18, 0x45, 0x6, 0x0, 0x0, 0x38, 0x45, 0x56, 0x91, 0x1, 0x78, 0x45, 0x66, 0x91, 0x1, 0xB8, 0x45, 0x6, 0x0, 0x0, 0x18, 0x0, 0x70, 0x91, 0x1, 0xF8, 0x45, 0x86, 0x91, 0x1, 0x38, 0x46, 0x96, 0x91, 0x1, 0x78, 0x46, 0xA6, 0x91, 0x1, 0xB9, 0x46, 0x6, 0x0, 0x0, 0xD9, 0x46, 0x6, 0x0, 0x0, 0xF9, 0x46, 0x6, 0x0, 0x0, 0x19, 0x0, 0xC0, 0x91, 0x1, 0x19, 0x0, 0xC8, 0x91, 0x1, 0x19, 0x0, 0xD0, 0x91, 0x1, 0x79, 0x47, 0xE6, 0x91, 0x1, 0xB9, 0x47, 0xF6, 0x91, 0x1, 0x19, 0x0, 0xF8, 0x91, 0x1, 0x19, 0x48, 0xE, 0x92, 0x1, 0x5A, 0x48, 0x6, 0x0, 0x0, 0x1A, 0x0, 0x18, 0x92, 0x1, 0x9A, 0x48, 0x6, 0x0, 0x0, 0xBA, 0x48, 0x6, 0x0, 0x0, 0xDA, 0x48, 0x3E, 0x92, 0x1, 0x1A, 0x49, 0x6, 0x0, 0x0, 0x1A, 0x0, 0x48, 0x92, 0x1, 0x5A, 0x49, 0x5E, 0x92, 0x1, 0x9B, 0x49, 0x6, 0x0, 0x0, 0xBB, 0x49, 0x76, 0x92, 0x1, 0xFB, 0x49, 0x86, 0x92, 0x1, 0x3B, 0x4A, 0x96, 0x92, 0x1, 0x1B, 0x0, 0x98, 0x92, 0x1, 0x9C, 0x4A, 0x6, 0x0, 0x0, 0x1C, 0x0, 0xA8, 0x92, 0x1, 0x1C, 0x0, 0xB0, 0x92, 0x1, 0xFC, 0x4A, 0xC6, 0x92, 0x1, 0x3D, 0x4B, 0x6, 0x0, 0x0, 0x5D, 0x4B, 0x6, 0x0, 0x0, 0x7D, 0x4B, 0xE6, 0x92, 0x1, 0xBE, 0x4B, 0xF6, 0x92, 0x1, 0x1E, 0x0, 0xF8, 0x92, 0x1, 0x1F, 0x4C, 0xE, 0x93, 0x1, }; } } diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/IgnoreCaseRelationGenerator.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/IgnoreCaseRelationGenerator.cs index 22375801f442b6..24d4ae45413720 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/IgnoreCaseRelationGenerator.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/IgnoreCaseRelationGenerator.cs @@ -3,12 +3,14 @@ using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; namespace System.Text.RegularExpressions.Symbolic.Unicode { #if DEBUG + [ExcludeFromCodeCoverage] internal static class IgnoreCaseRelationGenerator { private const string DefaultCultureName = "en-US"; @@ -41,70 +43,54 @@ private static void WriteIgnoreCaseBDD(StreamWriter sw) sw.WriteLine(" /// Serialized BDD for mapping characters to their case-ignoring equivalence classes in the default (en-US) culture."); var solver = new CharSetSolver(); - Dictionary ignoreCase = ComputeIgnoreCaseDictionary(solver, new CultureInfo(DefaultCultureName)); + List ignoreCaseEquivalenceClasses = ComputeIgnoreCaseEquivalenceClasses(solver, new CultureInfo(DefaultCultureName)); BDD ignorecase = solver.False; - foreach (KeyValuePair kv in ignoreCase) + foreach (EquivalenceClass ec in ignoreCaseEquivalenceClasses) { - BDD a = solver.CreateCharSetFromRange(kv.Key, kv.Key); - BDD b = kv.Value; - ignorecase = solver.Or(ignorecase, solver.And(solver.ShiftLeft(a, 16), b)); + // Create the Cartesian product of ec._set with itself + BDD crossproduct = solver.And(solver.ShiftLeft(ec._set, 16), ec._set); + // Add the product into the overall lookup table + ignorecase = solver.Or(ignorecase, crossproduct); } - sw.Write(" public static readonly long[] IgnoreCaseEnUsSerializedBDD = "); - GeneratorHelper.WriteInt64ArrayInitSyntax(sw, ignorecase.Serialize()); + sw.Write(" public static readonly byte[] IgnoreCaseEnUsSerializedBDD = "); + GeneratorHelper.WriteByteArrayInitSyntax(sw, ignorecase.SerializeToBytes()); sw.WriteLine(";"); } - private static Dictionary ComputeIgnoreCaseDictionary(CharSetSolver solver, CultureInfo culture) + private static List ComputeIgnoreCaseEquivalenceClasses(CharSetSolver solver, CultureInfo culture) { - CultureInfo originalCulture = CultureInfo.CurrentCulture; - try - { - CultureInfo.CurrentCulture = culture; + var ignoreCase = new Dictionary(); + var sets = new List(); - var ignoreCase = new Dictionary(); + for (uint i = 65; i <= 0xFFFF; i++) + { + char C = (char)i; + char c = char.ToLower(C, culture); - for (uint i = 0; i <= 0xFFFF; i++) + if (c == C) { - char c = (char)i; - char cUpper = char.ToUpper(c); - char cLower = char.ToLower(c); - - if (cUpper == cLower) - { - continue; - } - - // c may be different from both cUpper as well as cLower. - // Make sure that the regex engine considers c as being equivalent to cUpper and cLower, else ignore c. - // In some cases c != cU but the regex engine does not consider the chacarters equivalent wrt the ignore-case option. - if (Regex.IsMatch($"{cUpper}{cLower}", $"^(?i:\\u{i:X4}\\u{i:X4})$")) - { - BDD equiv = solver.False; - - if (ignoreCase.ContainsKey(c)) - equiv = solver.Or(equiv, ignoreCase[c]); - - if (ignoreCase.ContainsKey(cUpper)) - equiv = solver.Or(equiv, ignoreCase[cUpper]); - - if (ignoreCase.ContainsKey(cLower)) - equiv = solver.Or(equiv, ignoreCase[cLower]); - - // Make sure all characters are included initially or when some is still missing - equiv = solver.Or(equiv, solver.Or(solver.CreateCharSetFromRange(c, c), solver.Or(solver.CreateCharSetFromRange(cUpper, cUpper), solver.CreateCharSetFromRange(cLower, cLower)))); - - // Update all the members with their case-invariance equivalence classes - foreach (char d in solver.GenerateAllCharacters(equiv)) - ignoreCase[d] = equiv; - } + continue; } - return ignoreCase; + EquivalenceClass? ec; + if (!ignoreCase.TryGetValue(c, out ec)) + { + ec = new EquivalenceClass(solver.CharConstraint(c)); + ignoreCase[c] = ec; + sets.Add(ec); + } + ec._set = solver.Or(ec._set, solver.CharConstraint(C)); } - finally + return sets; + } + + private class EquivalenceClass + { + public BDD _set; + public EquivalenceClass(BDD set) { - CultureInfo.CurrentCulture = originalCulture; + _set = set; } } }; diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/IgnoreCaseTransformer.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/IgnoreCaseTransformer.cs index 945fdeae5cffa5..f7a70f1ba7e96e 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/IgnoreCaseTransformer.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/IgnoreCaseTransformer.cs @@ -166,6 +166,10 @@ private IgnoreCaseRelation EnsureDefault() if (_relationDefault is null) { BDD instance = BDD.Deserialize(Unicode.IgnoreCaseRelation.IgnoreCaseEnUsSerializedBDD, _solver); + byte[] tmp = instance.SerializeToBytes(); + BDD instance2 = BDD.Deserialize(tmp, _solver); + if (instance != instance2) + throw new Exception(); BDD instanceDomain = _solver.ShiftRight(instance, 16); // represents the set of all case-sensitive characters in the default culture. _relationDefault = new IgnoreCaseRelation(instance, instanceDomain); } diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/UnicodeCategoryRanges.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/UnicodeCategoryRanges.cs index caf22c757fd22b..55dcf8ecc26e1f 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/UnicodeCategoryRanges.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/UnicodeCategoryRanges.cs @@ -9,74 +9,71 @@ namespace System.Text.RegularExpressions.Symbolic.Unicode internal static class UnicodeCategoryRanges { /// Serialized BDD representations of all the Unicode categories. - public static readonly long[][] AllCategoriesSerializedBDD = new long[][] + public static readonly byte[][] AllCategoriesSerializedBDD = new byte[][] { // UppercaseLetter(0): - new long[] { 0x4, 0x9, 0x2000, 0x10, 0x2021, 0x6011, 0x6001, 0x21, 0x4011, 0x31, 0x6021, 0x4001, 0x11, 0x4031, 0x2001, 0x2031, 0x8002, 0xA012, 0x62, 0xC002, 0xE012, 0x2022, 0x10042, 0x4072, 0x12062, 0x60A2, 0xE022, 0x4002, 0x40B2, 0xE002, 0xC2, 0x4062, 0x6052, 0x100D2, 0x2042, 0x12002, 0x2002, 0x100E2, 0x22, 0xA0E2, 0x8062, 0x120E2, 0xE092, 0x20B2, 0x20E2, 0x72, 0x8052, 0x20F2, 0x6062, 0x1E032, 0x16002, 0x14052, 0xD2, 0x180B2, 0x92, 0x1E012, 0x8082, 0x6042, 0x180A2, 0xC082, 0x6072, 0xE032, 0xA032, 0x4082, 0x160F2, 0x1E082, 0xA0C2, 0x14082, 0x1E062, 0x2103, 0x22013, 0x24003, 0x28133, 0x2A023, 0x4163, 0x2E023, 0x4183, 0x193, 0x34023, 0x41B3, 0x41C3, 0x3A003, 0x36183, 0x3E1E3, 0x42203, 0x2223, 0x46003, 0x481E3, 0x4C253, 0x50273, 0x54293, 0x2B3, 0x243, 0x13, 0x33, 0x2C3, 0x382D3, 0x22E3, 0x58003, 0x5E123, 0x44003, 0x62303, 0x641A3, 0x68333, 0x6A023, 0x363, 0x6E243, 0x5A383, 0x2E363, 0x72023, 0x363A3, 0x76023, 0x63C3, 0x683D3, 0x7C0B3, 0x7E3B3, 0x82403, 0x86423, 0x4443, 0x61A3, 0x4033, 0x8C454, 0x474, 0x90004, 0x94494, 0x984B4, 0x44D4, 0x44F4, 0xA0004, 0xA4514, 0xA8534, 0xAA004, 0xAC004, 0x8E004, 0xB0574, 0xB4594, 0xB65C4, 0x5C4, 0xBA004, 0xBE5E4, 0xBA5F4, 0x4604, 0x2614, 0x14, 0x2624, 0xC6004, 0x2644, 0x4464, 0xCA024, 0xCC024, 0x2004, 0x4674, 0xD2684, 0xD4004, 0xD6464, 0x6C4, 0xDA004, 0x46E4, 0x46F4, 0xE2704, 0xE6724, 0xEA744, 0x4764, 0xEE024, 0x4784, 0x2224, 0x795, 0xF67A5, 0xFA7C5, 0x47E5, 0x4E5, 0xFE005, 0x4805, 0x4815, 0x825, 0x2835, 0x108005, 0x10A005, 0x10E865, 0xB8885, 0x895, 0x1168A5, 0x1185D5, 0x11A025, 0x11E8E5, 0x2905, 0x15, 0x122005, 0x124005, 0x4935, 0x128025, 0x12A025, 0x25, 0x2965, 0x130975, 0x134995, 0x9B5, 0x138005, 0x49D5, 0x13E9E5, 0x142A05, 0x146A25, 0x4A45, 0x14A005, 0xF2005, 0x14C006, 0x150A76, 0x154A96, 0x156006, 0xAC6, 0x4AD6, 0x15EAE6, 0x160006, 0x164B16, 0x168B36, 0x16CB56, 0x16E026, 0x170006, 0x174B96, 0x174BB6, 0x17ABC6, 0x17EBE6, 0x182C06, 0x186C26, 0xC46, 0x18CC56, 0x190C76, 0x194C96, 0xCB6, 0xCC6, 0x19A007, 0x19ECE7, 0x1A2D07, 0x1A6D27, 0x1AAD47, 0x1AED67, 0x4D87, 0xD97, 0xDA7, 0xDB7, 0x1B8007, 0x1BCDD7, 0x1C0DF7, 0x1C2007, 0x1C6E27, 0x1CAE47, 0xE68, 0x1D0E78, 0x1D2008, 0xEA8, 0x1D8EB8, 0x1DA008, 0xEE8, 0x1DE008, 0x1E2F08, 0x1E6F28, 0x1EAF48, 0xF69, 0xF79, 0x1F0009, 0x1F2009, 0x1F6FA9, 0x1FAFC9, 0x1FC009, 0x200FF9, 0x101A, 0x102A, 0x103A, 0x20800A, 0x105A, 0x20C00A, 0x21107A, 0x109B, 0x21400B, 0x2190BB, 0x21D0DB, 0x21E00B, 0x110C, 0x22200C, 0x22400C, 0x22913C, 0x115D, 0x116D, 0x23117D, 0x23519E, 0x23600E, 0x23B1CF, }, + new byte[] { 0x3, 0x4, 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0x20, 0x0, 0x10, 0x0, 0x0, 0x21, 0x20, 0x0, 0x11, 0x60, 0x0, 0x1, 0x60, 0x0, 0x21, 0x0, 0x0, 0x11, 0x40, 0x0, 0x31, 0x0, 0x0, 0x21, 0x60, 0x0, 0x1, 0x40, 0x0, 0x11, 0x0, 0x0, 0x31, 0x40, 0x0, 0x1, 0x20, 0x0, 0x31, 0x20, 0x0, 0x2, 0x80, 0x0, 0x12, 0xA0, 0x0, 0x62, 0x0, 0x0, 0x2, 0xC0, 0x0, 0x12, 0xE0, 0x0, 0x22, 0x20, 0x0, 0x42, 0x0, 0x1, 0x72, 0x40, 0x0, 0x62, 0x20, 0x1, 0xA2, 0x60, 0x0, 0x22, 0xE0, 0x0, 0x2, 0x40, 0x0, 0xB2, 0x40, 0x0, 0x2, 0xE0, 0x0, 0xC2, 0x0, 0x0, 0x62, 0x40, 0x0, 0x52, 0x60, 0x0, 0xD2, 0x0, 0x1, 0x42, 0x20, 0x0, 0x2, 0x20, 0x1, 0x2, 0x20, 0x0, 0xE2, 0x0, 0x1, 0x22, 0x0, 0x0, 0xE2, 0xA0, 0x0, 0x62, 0x80, 0x0, 0xE2, 0x20, 0x1, 0x92, 0xE0, 0x0, 0xB2, 0x20, 0x0, 0xE2, 0x20, 0x0, 0x72, 0x0, 0x0, 0x52, 0x80, 0x0, 0xF2, 0x20, 0x0, 0x62, 0x60, 0x0, 0x32, 0xE0, 0x1, 0x2, 0x60, 0x1, 0x52, 0x40, 0x1, 0xD2, 0x0, 0x0, 0xB2, 0x80, 0x1, 0x92, 0x0, 0x0, 0x12, 0xE0, 0x1, 0x82, 0x80, 0x0, 0x42, 0x60, 0x0, 0xA2, 0x80, 0x1, 0x82, 0xC0, 0x0, 0x72, 0x60, 0x0, 0x32, 0xE0, 0x0, 0x32, 0xA0, 0x0, 0x82, 0x40, 0x0, 0xF2, 0x60, 0x1, 0x82, 0xE0, 0x1, 0xC2, 0xA0, 0x0, 0x82, 0x40, 0x1, 0x62, 0xE0, 0x1, 0x3, 0x21, 0x0, 0x13, 0x20, 0x2, 0x3, 0x40, 0x2, 0x33, 0x81, 0x2, 0x23, 0xA0, 0x2, 0x63, 0x41, 0x0, 0x23, 0xE0, 0x2, 0x83, 0x41, 0x0, 0x93, 0x1, 0x0, 0x23, 0x40, 0x3, 0xB3, 0x41, 0x0, 0xC3, 0x41, 0x0, 0x3, 0xA0, 0x3, 0x83, 0x61, 0x3, 0xE3, 0xE1, 0x3, 0x3, 0x22, 0x4, 0x23, 0x22, 0x0, 0x3, 0x60, 0x4, 0xE3, 0x81, 0x4, 0x53, 0xC2, 0x4, 0x73, 0x2, 0x5, 0x93, 0x42, 0x5, 0xB3, 0x2, 0x0, 0x43, 0x2, 0x0, 0x13, 0x0, 0x0, 0x33, 0x0, 0x0, 0xC3, 0x2, 0x0, 0xD3, 0x82, 0x3, 0xE3, 0x22, 0x0, 0x3, 0x80, 0x5, 0x23, 0xE1, 0x5, 0x3, 0x40, 0x4, 0x3, 0x23, 0x6, 0xA3, 0x41, 0x6, 0x33, 0x83, 0x6, 0x23, 0xA0, 0x6, 0x63, 0x3, 0x0, 0x43, 0xE2, 0x6, 0x83, 0xA3, 0x5, 0x63, 0xE3, 0x2, 0x23, 0x20, 0x7, 0xA3, 0x63, 0x3, 0x23, 0x60, 0x7, 0xC3, 0x63, 0x0, 0xD3, 0x83, 0x6, 0xB3, 0xC0, 0x7, 0xB3, 0xE3, 0x7, 0x3, 0x24, 0x8, 0x23, 0x64, 0x8, 0x43, 0x44, 0x0, 0xA3, 0x61, 0x0, 0x33, 0x40, 0x0, 0x54, 0xC4, 0x8, 0x74, 0x4, 0x0, 0x4, 0x0, 0x9, 0x94, 0x44, 0x9, 0xB4, 0x84, 0x9, 0xD4, 0x44, 0x0, 0xF4, 0x44, 0x0, 0x4, 0x0, 0xA, 0x14, 0x45, 0xA, 0x34, 0x85, 0xA, 0x4, 0xA0, 0xA, 0x4, 0xC0, 0xA, 0x4, 0xE0, 0x8, 0x74, 0x5, 0xB, 0x94, 0x45, 0xB, 0xC4, 0x65, 0xB, 0xC4, 0x5, 0x0, 0x4, 0xA0, 0xB, 0xE4, 0xE5, 0xB, 0xF4, 0xA5, 0xB, 0x4, 0x46, 0x0, 0x14, 0x26, 0x0, 0x14, 0x0, 0x0, 0x24, 0x26, 0x0, 0x4, 0x60, 0xC, 0x44, 0x26, 0x0, 0x64, 0x44, 0x0, 0x24, 0xA0, 0xC, 0x24, 0xC0, 0xC, 0x4, 0x20, 0x0, 0x74, 0x46, 0x0, 0x84, 0x26, 0xD, 0x4, 0x40, 0xD, 0x64, 0x64, 0xD, 0xC4, 0x6, 0x0, 0x4, 0xA0, 0xD, 0xE4, 0x46, 0x0, 0xF4, 0x46, 0x0, 0x4, 0x27, 0xE, 0x24, 0x67, 0xE, 0x44, 0xA7, 0xE, 0x64, 0x47, 0x0, 0x24, 0xE0, 0xE, 0x84, 0x47, 0x0, 0x24, 0x22, 0x0, 0x95, 0x7, 0x0, 0xA5, 0x67, 0xF, 0xC5, 0xA7, 0xF, 0xE5, 0x47, 0x0, 0xE5, 0x4, 0x0, 0x5, 0xE0, 0xF, 0x5, 0x48, 0x0, 0x15, 0x48, 0x0, 0x25, 0x8, 0x0, 0x35, 0x28, 0x0, 0x5, 0x80, 0x10, 0x5, 0xA0, 0x10, 0x65, 0xE8, 0x10, 0x85, 0x88, 0xB, 0x95, 0x8, 0x0, 0xA5, 0x68, 0x11, 0xD5, 0x85, 0x11, 0x25, 0xA0, 0x11, 0xE5, 0xE8, 0x11, 0x5, 0x29, 0x0, 0x15, 0x0, 0x0, 0x5, 0x20, 0x12, 0x5, 0x40, 0x12, 0x35, 0x49, 0x0, 0x25, 0x80, 0x12, 0x25, 0xA0, 0x12, 0x25, 0x0, 0x0, 0x65, 0x29, 0x0, 0x75, 0x9, 0x13, 0x95, 0x49, 0x13, 0xB5, 0x9, 0x0, 0x5, 0x80, 0x13, 0xD5, 0x49, 0x0, 0xE5, 0xE9, 0x13, 0x5, 0x2A, 0x14, 0x25, 0x6A, 0x14, 0x45, 0x4A, 0x0, 0x5, 0xA0, 0x14, 0x5, 0x20, 0xF, 0x6, 0xC0, 0x14, 0x76, 0xA, 0x15, 0x96, 0x4A, 0x15, 0x6, 0x60, 0x15, 0xC6, 0xA, 0x0, 0xD6, 0x4A, 0x0, 0xE6, 0xEA, 0x15, 0x6, 0x0, 0x16, 0x16, 0x4B, 0x16, 0x36, 0x8B, 0x16, 0x56, 0xCB, 0x16, 0x26, 0xE0, 0x16, 0x6, 0x0, 0x17, 0x96, 0x4B, 0x17, 0xB6, 0x4B, 0x17, 0xC6, 0xAB, 0x17, 0xE6, 0xEB, 0x17, 0x6, 0x2C, 0x18, 0x26, 0x6C, 0x18, 0x46, 0xC, 0x0, 0x56, 0xCC, 0x18, 0x76, 0xC, 0x19, 0x96, 0x4C, 0x19, 0xB6, 0xC, 0x0, 0xC6, 0xC, 0x0, 0x7, 0xA0, 0x19, 0xE7, 0xEC, 0x19, 0x7, 0x2D, 0x1A, 0x27, 0x6D, 0x1A, 0x47, 0xAD, 0x1A, 0x67, 0xED, 0x1A, 0x87, 0x4D, 0x0, 0x97, 0xD, 0x0, 0xA7, 0xD, 0x0, 0xB7, 0xD, 0x0, 0x7, 0x80, 0x1B, 0xD7, 0xCD, 0x1B, 0xF7, 0xD, 0x1C, 0x7, 0x20, 0x1C, 0x27, 0x6E, 0x1C, 0x47, 0xAE, 0x1C, 0x68, 0xE, 0x0, 0x78, 0xE, 0x1D, 0x8, 0x20, 0x1D, 0xA8, 0xE, 0x0, 0xB8, 0x8E, 0x1D, 0x8, 0xA0, 0x1D, 0xE8, 0xE, 0x0, 0x8, 0xE0, 0x1D, 0x8, 0x2F, 0x1E, 0x28, 0x6F, 0x1E, 0x48, 0xAF, 0x1E, 0x69, 0xF, 0x0, 0x79, 0xF, 0x0, 0x9, 0x0, 0x1F, 0x9, 0x20, 0x1F, 0xA9, 0x6F, 0x1F, 0xC9, 0xAF, 0x1F, 0x9, 0xC0, 0x1F, 0xF9, 0xF, 0x20, 0x1A, 0x10, 0x0, 0x2A, 0x10, 0x0, 0x3A, 0x10, 0x0, 0xA, 0x80, 0x20, 0x5A, 0x10, 0x0, 0xA, 0xC0, 0x20, 0x7A, 0x10, 0x21, 0x9B, 0x10, 0x0, 0xB, 0x40, 0x21, 0xBB, 0x90, 0x21, 0xDB, 0xD0, 0x21, 0xB, 0xE0, 0x21, 0xC, 0x11, 0x0, 0xC, 0x20, 0x22, 0xC, 0x40, 0x22, 0x3C, 0x91, 0x22, 0x5D, 0x11, 0x0, 0x6D, 0x11, 0x0, 0x7D, 0x11, 0x23, 0x9E, 0x51, 0x23, 0xE, 0x60, 0x23, 0xCF, 0xB1, 0x23, }, // LowercaseLetter(1): - new long[] { 0x4, 0x9, 0x2000, 0x10, 0x2021, 0x6011, 0x31, 0x4001, 0x21, 0x6001, 0x2031, 0x4031, 0x4011, 0x6021, 0x2001, 0x11, 0x8002, 0xA012, 0xC012, 0x2042, 0xE002, 0x10002, 0x82, 0x4002, 0xC002, 0x32, 0x12062, 0x60A2, 0x22, 0x40B2, 0x14032, 0xC032, 0x6002, 0x6092, 0x92, 0x20A2, 0x6072, 0x2002, 0x60C2, 0x4072, 0x120D2, 0x72, 0x1C082, 0xF2, 0x120E2, 0x62, 0x100F2, 0x1E0C2, 0x20F2, 0x20C2, 0x20E2, 0x6052, 0x8052, 0x40C2, 0x10022, 0x12002, 0x16072, 0x2092, 0x1C052, 0x12, 0xC0E2, 0x6062, 0x2052, 0x4062, 0x1C0B2, 0x6012, 0x16092, 0x40A2, 0x12022, 0x1A052, 0xE022, 0x18092, 0xA082, 0x10092, 0xE0E2, 0x100C2, 0x2103, 0x22013, 0x24003, 0x26003, 0x2143, 0x2C153, 0x30173, 0x32033, 0x61A3, 0x36033, 0x61C3, 0x221D3, 0x3C033, 0x3E033, 0x6203, 0x6213, 0x46223, 0x30003, 0x481C3, 0x4C253, 0x50273, 0x2133, 0x52003, 0x562A3, 0x522C3, 0x2D3, 0x2E3, 0x5E003, 0x2003, 0x60003, 0x62163, 0x2323, 0x64003, 0x66233, 0x2113, 0x123, 0x2253, 0x323, 0x2343, 0x6C353, 0x6E1F3, 0x72383, 0x74033, 0x3B3, 0x28003, 0x7A3C3, 0x7C013, 0x7E033, 0x82403, 0x84033, 0x4433, 0x2C443, 0x8C453, 0x42473, 0x92483, 0x844A3, 0x64B3, 0x41E3, 0x6023, 0x26013, 0x44003, 0x9A4C4, 0x9E4E4, 0xA0014, 0x24C4, 0x14, 0x514, 0xA4004, 0xA8534, 0xAC554, 0x6574, 0xB2584, 0x65A4, 0xB6004, 0xB8004, 0xBC5D4, 0xC05F4, 0x2614, 0xC4004, 0xC6004, 0xCA644, 0xCC5D4, 0xD0674, 0xCE694, 0xD06A4, 0xD06B4, 0xD8684, 0xD06C4, 0x66D4, 0xDE6E4, 0xE0004, 0xA0004, 0x714, 0x2724, 0x6004, 0xE6034, 0xE8034, 0x6754, 0xC2764, 0xEE014, 0x784, 0x794, 0x2004, 0x27A4, 0xF6014, 0x67C4, 0x67D4, 0xFE7E4, 0x102804, 0x106824, 0x6844, 0x10A034, 0x6864, 0x2874, 0x654, 0x884, 0x112005, 0x114005, 0x1188B5, 0x8D5, 0x11E8E5, 0x122905, 0x6925, 0x935, 0x128005, 0x6955, 0x2965, 0x6975, 0x132985, 0x134005, 0x136005, 0x13A9C5, 0x13E9E5, 0xD0A05, 0x144A15, 0x146685, 0x148035, 0x118005, 0xA55, 0x2A65, 0x14E005, 0xA85, 0x11AA95, 0x15, 0x6AA5, 0x156035, 0x158035, 0x2035, 0x15CAD5, 0x160AF5, 0xB15, 0x166B25, 0x168015, 0x6B55, 0x16EB65, 0x172B85, 0x176BA5, 0x6BC5, 0x17CBD5, 0xBF5, 0x895, 0xC06, 0x182006, 0x2006, 0x186C26, 0x18AC46, 0x18EC66, 0x190006, 0xC96, 0x194006, 0x6CB6, 0x186CC6, 0x19A006, 0x19ECE6, 0x1A2D06, 0x1A6D26, 0x1A8036, 0x1AA006, 0x1AED66, 0x1B0006, 0xD96, 0xDA6, 0x1B8DB6, 0x1BCDD6, 0x186DF6, 0x1C2E06, 0xE26, 0x1C6006, 0x1CAE46, 0x1CEE66, 0x1D2E86, 0x1D6EA6, 0xEC6, 0x1DA007, 0x1DC007, 0x1E0EF7, 0x1E4F17, 0x1E8F37, 0x1EA007, 0x1EEF67, 0x1F2F87, 0x1F6FA7, 0x6FC7, 0x1FCFD7, 0xFF7, 0x1007, 0x1017, 0x204FF7, 0x209037, 0x20D057, 0x211077, 0x215097, 0x2190B7, 0x10D8, 0x10E8, 0x10F8, 0x223108, 0x227128, 0x1148, 0x22D158, 0x231178, 0x1198, 0x234008, 0x2391B8, 0x23D1D8, 0x2411F8, 0x1219, 0x1229, 0x1239, 0x1249, 0x24A009, 0x24C009, 0x251279, 0x255299, 0x256009, 0x25B2C9, 0x25F2EA, 0x26000A, 0x131A, 0x132A, 0x26600A, 0x134A, 0x26A00A, 0x26F36A, 0x138B, 0x27539B, 0x2793BB, 0x27D3DB, 0x27E00B, 0x140C, 0x28200C, 0x28400C, 0x28943C, 0x145D, 0x146D, 0x29147D, 0x29549E, 0x29600E, 0x29B4CF, }, + new byte[] { 0x3, 0x4, 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0x20, 0x0, 0x10, 0x0, 0x0, 0x21, 0x20, 0x0, 0x11, 0x60, 0x0, 0x31, 0x0, 0x0, 0x1, 0x40, 0x0, 0x21, 0x0, 0x0, 0x1, 0x60, 0x0, 0x31, 0x20, 0x0, 0x31, 0x40, 0x0, 0x11, 0x40, 0x0, 0x21, 0x60, 0x0, 0x1, 0x20, 0x0, 0x11, 0x0, 0x0, 0x2, 0x80, 0x0, 0x12, 0xA0, 0x0, 0x12, 0xC0, 0x0, 0x42, 0x20, 0x0, 0x2, 0xE0, 0x0, 0x2, 0x0, 0x1, 0x82, 0x0, 0x0, 0x2, 0x40, 0x0, 0x2, 0xC0, 0x0, 0x32, 0x0, 0x0, 0x62, 0x20, 0x1, 0xA2, 0x60, 0x0, 0x22, 0x0, 0x0, 0xB2, 0x40, 0x0, 0x32, 0x40, 0x1, 0x32, 0xC0, 0x0, 0x2, 0x60, 0x0, 0x92, 0x60, 0x0, 0x92, 0x0, 0x0, 0xA2, 0x20, 0x0, 0x72, 0x60, 0x0, 0x2, 0x20, 0x0, 0xC2, 0x60, 0x0, 0x72, 0x40, 0x0, 0xD2, 0x20, 0x1, 0x72, 0x0, 0x0, 0x82, 0xC0, 0x1, 0xF2, 0x0, 0x0, 0xE2, 0x20, 0x1, 0x62, 0x0, 0x0, 0xF2, 0x0, 0x1, 0xC2, 0xE0, 0x1, 0xF2, 0x20, 0x0, 0xC2, 0x20, 0x0, 0xE2, 0x20, 0x0, 0x52, 0x60, 0x0, 0x52, 0x80, 0x0, 0xC2, 0x40, 0x0, 0x22, 0x0, 0x1, 0x2, 0x20, 0x1, 0x72, 0x60, 0x1, 0x92, 0x20, 0x0, 0x52, 0xC0, 0x1, 0x12, 0x0, 0x0, 0xE2, 0xC0, 0x0, 0x62, 0x60, 0x0, 0x52, 0x20, 0x0, 0x62, 0x40, 0x0, 0xB2, 0xC0, 0x1, 0x12, 0x60, 0x0, 0x92, 0x60, 0x1, 0xA2, 0x40, 0x0, 0x22, 0x20, 0x1, 0x52, 0xA0, 0x1, 0x22, 0xE0, 0x0, 0x92, 0x80, 0x1, 0x82, 0xA0, 0x0, 0x92, 0x0, 0x1, 0xE2, 0xE0, 0x0, 0xC2, 0x0, 0x1, 0x3, 0x21, 0x0, 0x13, 0x20, 0x2, 0x3, 0x40, 0x2, 0x3, 0x60, 0x2, 0x43, 0x21, 0x0, 0x53, 0xC1, 0x2, 0x73, 0x1, 0x3, 0x33, 0x20, 0x3, 0xA3, 0x61, 0x0, 0x33, 0x60, 0x3, 0xC3, 0x61, 0x0, 0xD3, 0x21, 0x2, 0x33, 0xC0, 0x3, 0x33, 0xE0, 0x3, 0x3, 0x62, 0x0, 0x13, 0x62, 0x0, 0x23, 0x62, 0x4, 0x3, 0x0, 0x3, 0xC3, 0x81, 0x4, 0x53, 0xC2, 0x4, 0x73, 0x2, 0x5, 0x33, 0x21, 0x0, 0x3, 0x20, 0x5, 0xA3, 0x62, 0x5, 0xC3, 0x22, 0x5, 0xD3, 0x2, 0x0, 0xE3, 0x2, 0x0, 0x3, 0xE0, 0x5, 0x3, 0x20, 0x0, 0x3, 0x0, 0x6, 0x63, 0x21, 0x6, 0x23, 0x23, 0x0, 0x3, 0x40, 0x6, 0x33, 0x62, 0x6, 0x13, 0x21, 0x0, 0x23, 0x1, 0x0, 0x53, 0x22, 0x0, 0x23, 0x3, 0x0, 0x43, 0x23, 0x0, 0x53, 0xC3, 0x6, 0xF3, 0xE1, 0x6, 0x83, 0x23, 0x7, 0x33, 0x40, 0x7, 0xB3, 0x3, 0x0, 0x3, 0x80, 0x2, 0xC3, 0xA3, 0x7, 0x13, 0xC0, 0x7, 0x33, 0xE0, 0x7, 0x3, 0x24, 0x8, 0x33, 0x40, 0x8, 0x33, 0x44, 0x0, 0x43, 0xC4, 0x2, 0x53, 0xC4, 0x8, 0x73, 0x24, 0x4, 0x83, 0x24, 0x9, 0xA3, 0x44, 0x8, 0xB3, 0x64, 0x0, 0xE3, 0x41, 0x0, 0x23, 0x60, 0x0, 0x13, 0x60, 0x2, 0x3, 0x40, 0x4, 0xC4, 0xA4, 0x9, 0xE4, 0xE4, 0x9, 0x14, 0x0, 0xA, 0xC4, 0x24, 0x0, 0x14, 0x0, 0x0, 0x14, 0x5, 0x0, 0x4, 0x40, 0xA, 0x34, 0x85, 0xA, 0x54, 0xC5, 0xA, 0x74, 0x65, 0x0, 0x84, 0x25, 0xB, 0xA4, 0x65, 0x0, 0x4, 0x60, 0xB, 0x4, 0x80, 0xB, 0xD4, 0xC5, 0xB, 0xF4, 0x5, 0xC, 0x14, 0x26, 0x0, 0x4, 0x40, 0xC, 0x4, 0x60, 0xC, 0x44, 0xA6, 0xC, 0xD4, 0xC5, 0xC, 0x74, 0x6, 0xD, 0x94, 0xE6, 0xC, 0xA4, 0x6, 0xD, 0xB4, 0x6, 0xD, 0x84, 0x86, 0xD, 0xC4, 0x6, 0xD, 0xD4, 0x66, 0x0, 0xE4, 0xE6, 0xD, 0x4, 0x0, 0xE, 0x4, 0x0, 0xA, 0x14, 0x7, 0x0, 0x24, 0x27, 0x0, 0x4, 0x60, 0x0, 0x34, 0x60, 0xE, 0x34, 0x80, 0xE, 0x54, 0x67, 0x0, 0x64, 0x27, 0xC, 0x14, 0xE0, 0xE, 0x84, 0x7, 0x0, 0x94, 0x7, 0x0, 0x4, 0x20, 0x0, 0xA4, 0x27, 0x0, 0x14, 0x60, 0xF, 0xC4, 0x67, 0x0, 0xD4, 0x67, 0x0, 0xE4, 0xE7, 0xF, 0x4, 0x28, 0x10, 0x24, 0x68, 0x10, 0x44, 0x68, 0x0, 0x34, 0xA0, 0x10, 0x64, 0x68, 0x0, 0x74, 0x28, 0x0, 0x54, 0x6, 0x0, 0x84, 0x8, 0x0, 0x5, 0x20, 0x11, 0x5, 0x40, 0x11, 0xB5, 0x88, 0x11, 0xD5, 0x8, 0x0, 0xE5, 0xE8, 0x11, 0x5, 0x29, 0x12, 0x25, 0x69, 0x0, 0x35, 0x9, 0x0, 0x5, 0x80, 0x12, 0x55, 0x69, 0x0, 0x65, 0x29, 0x0, 0x75, 0x69, 0x0, 0x85, 0x29, 0x13, 0x5, 0x40, 0x13, 0x5, 0x60, 0x13, 0xC5, 0xA9, 0x13, 0xE5, 0xE9, 0x13, 0x5, 0xA, 0xD, 0x15, 0x4A, 0x14, 0x85, 0x66, 0x14, 0x35, 0x80, 0x14, 0x5, 0x80, 0x11, 0x55, 0xA, 0x0, 0x65, 0x2A, 0x0, 0x5, 0xE0, 0x14, 0x85, 0xA, 0x0, 0x95, 0xAA, 0x11, 0x15, 0x0, 0x0, 0xA5, 0x6A, 0x0, 0x35, 0x60, 0x15, 0x35, 0x80, 0x15, 0x35, 0x20, 0x0, 0xD5, 0xCA, 0x15, 0xF5, 0xA, 0x16, 0x15, 0xB, 0x0, 0x25, 0x6B, 0x16, 0x15, 0x80, 0x16, 0x55, 0x6B, 0x0, 0x65, 0xEB, 0x16, 0x85, 0x2B, 0x17, 0xA5, 0x6B, 0x17, 0xC5, 0x6B, 0x0, 0xD5, 0xCB, 0x17, 0xF5, 0xB, 0x0, 0x95, 0x8, 0x0, 0x6, 0xC, 0x0, 0x6, 0x20, 0x18, 0x6, 0x20, 0x0, 0x26, 0x6C, 0x18, 0x46, 0xAC, 0x18, 0x66, 0xEC, 0x18, 0x6, 0x0, 0x19, 0x96, 0xC, 0x0, 0x6, 0x40, 0x19, 0xB6, 0x6C, 0x0, 0xC6, 0x6C, 0x18, 0x6, 0xA0, 0x19, 0xE6, 0xEC, 0x19, 0x6, 0x2D, 0x1A, 0x26, 0x6D, 0x1A, 0x36, 0x80, 0x1A, 0x6, 0xA0, 0x1A, 0x66, 0xED, 0x1A, 0x6, 0x0, 0x1B, 0x96, 0xD, 0x0, 0xA6, 0xD, 0x0, 0xB6, 0x8D, 0x1B, 0xD6, 0xCD, 0x1B, 0xF6, 0x6D, 0x18, 0x6, 0x2E, 0x1C, 0x26, 0xE, 0x0, 0x6, 0x60, 0x1C, 0x46, 0xAE, 0x1C, 0x66, 0xEE, 0x1C, 0x86, 0x2E, 0x1D, 0xA6, 0x6E, 0x1D, 0xC6, 0xE, 0x0, 0x7, 0xA0, 0x1D, 0x7, 0xC0, 0x1D, 0xF7, 0xE, 0x1E, 0x17, 0x4F, 0x1E, 0x37, 0x8F, 0x1E, 0x7, 0xA0, 0x1E, 0x67, 0xEF, 0x1E, 0x87, 0x2F, 0x1F, 0xA7, 0x6F, 0x1F, 0xC7, 0x6F, 0x0, 0xD7, 0xCF, 0x1F, 0xF7, 0xF, 0x0, 0x7, 0x10, 0x0, 0x17, 0x10, 0x0, 0xF7, 0x4F, 0x20, 0x37, 0x90, 0x20, 0x57, 0xD0, 0x20, 0x77, 0x10, 0x21, 0x97, 0x50, 0x21, 0xB7, 0x90, 0x21, 0xD8, 0x10, 0x0, 0xE8, 0x10, 0x0, 0xF8, 0x10, 0x0, 0x8, 0x31, 0x22, 0x28, 0x71, 0x22, 0x48, 0x11, 0x0, 0x58, 0xD1, 0x22, 0x78, 0x11, 0x23, 0x98, 0x11, 0x0, 0x8, 0x40, 0x23, 0xB8, 0x91, 0x23, 0xD8, 0xD1, 0x23, 0xF8, 0x11, 0x24, 0x19, 0x12, 0x0, 0x29, 0x12, 0x0, 0x39, 0x12, 0x0, 0x49, 0x12, 0x0, 0x9, 0xA0, 0x24, 0x9, 0xC0, 0x24, 0x79, 0x12, 0x25, 0x99, 0x52, 0x25, 0x9, 0x60, 0x25, 0xC9, 0xB2, 0x25, 0xEA, 0xF2, 0x25, 0xA, 0x0, 0x26, 0x1A, 0x13, 0x0, 0x2A, 0x13, 0x0, 0xA, 0x60, 0x26, 0x4A, 0x13, 0x0, 0xA, 0xA0, 0x26, 0x6A, 0xF3, 0x26, 0x8B, 0x13, 0x0, 0x9B, 0x53, 0x27, 0xBB, 0x93, 0x27, 0xDB, 0xD3, 0x27, 0xB, 0xE0, 0x27, 0xC, 0x14, 0x0, 0xC, 0x20, 0x28, 0xC, 0x40, 0x28, 0x3C, 0x94, 0x28, 0x5D, 0x14, 0x0, 0x6D, 0x14, 0x0, 0x7D, 0x14, 0x29, 0x9E, 0x54, 0x29, 0xE, 0x60, 0x29, 0xCF, 0xB4, 0x29, }, // TitlecaseLetter(2): - new long[] { 0x4, 0x6, 0x400, 0x10, 0x801, 0x21, 0x831, 0xC01, 0x42, 0x1402, 0x1802, 0x72, 0x83, 0x13, 0x2403, 0x2CA3, 0xC4, 0x3004, 0x34C4, 0xE4, 0x3C04, 0x4505, 0x3525, 0x5135, 0x5956, 0x176, 0x187, 0x197, 0x1A8, 0x1B8, 0x1C9, 0x7409, 0x1EA, 0x7C0A, 0x20B, 0x840B, 0x8E2C, 0x900D, 0x940E, 0x980F, }, + new byte[] { 0x2, 0x4, 0x0, 0x6, 0x0, 0x0, 0x4, 0x10, 0x0, 0x1, 0x8, 0x21, 0x0, 0x31, 0x8, 0x1, 0xC, 0x42, 0x0, 0x2, 0x14, 0x2, 0x18, 0x72, 0x0, 0x83, 0x0, 0x13, 0x0, 0x3, 0x24, 0xA3, 0x2C, 0xC4, 0x0, 0x4, 0x30, 0xC4, 0x34, 0xE4, 0x0, 0x4, 0x3C, 0x5, 0x45, 0x25, 0x35, 0x35, 0x51, 0x56, 0x59, 0x76, 0x1, 0x87, 0x1, 0x97, 0x1, 0xA8, 0x1, 0xB8, 0x1, 0xC9, 0x1, 0x9, 0x74, 0xEA, 0x1, 0xA, 0x7C, 0xB, 0x2, 0xB, 0x84, 0x2C, 0x8E, 0xD, 0x90, 0xE, 0x94, 0xF, 0x98, }, // ModifierLetter(3): - new long[] { 0x4, 0x9, 0x2000, 0x10, 0x11, 0x4001, 0x6001, 0x31, 0x21, 0x2001, 0x2021, 0x6021, 0x6011, 0x42, 0xA002, 0xC002, 0x12, 0xE052, 0x62, 0x82, 0x72, 0x12002, 0x92, 0x52, 0x2092, 0xA2, 0xB2, 0xE002, 0x18092, 0x2052, 0xE012, 0x14002, 0x10002, 0x22, 0x12042, 0xD3, 0x1C003, 0xF3, 0x103, 0x22003, 0x123, 0x26003, 0x143, 0x153, 0xE3, 0x28013, 0x163, 0x173, 0x183, 0x24003, 0x193, 0x1A3, 0x381B3, 0x21D3, 0x1E143, 0x1E3, 0x21F3, 0x28003, 0x36003, 0x1E003, 0x2E0E3, 0x203, 0x2C203, 0x34003, 0x2E203, 0x3A213, 0x2A003, 0x44013, 0x234, 0x244, 0x4A004, 0x264, 0x274, 0x284, 0x52004, 0x54004, 0x2B4, 0x58004, 0x2D4, 0x2E4, 0x2A4, 0x5E004, 0x304, 0x314, 0x324, 0x334, 0x344, 0x62004, 0x354, 0x364, 0x374, 0x702C4, 0x4C014, 0x72004, 0x74004, 0x394, 0x2F4, 0x3B4, 0x78004, 0x3D4, 0x3E4, 0x7E004, 0x48004, 0x254, 0x404, 0x82004, 0x86424, 0x14, 0x88005, 0x455, 0x8E465, 0x92485, 0x964A5, 0x4C5, 0x9A005, 0x9C005, 0x9E005, 0x505, 0xA2005, 0x525, 0xA6005, 0x545, 0xAA005, 0xAE565, 0x4B5, 0x4F5, 0xB0005, 0x595, 0xB4015, 0x25B5, 0x5C5, 0x5D5, 0xBC005, 0xBE005, 0x605, 0x94005, 0x615, 0xC6625, 0x645, 0x655, 0xCC005, 0xCE005, 0x685, 0xD4695, 0x6B5, 0xD8006, 0x6D6, 0x6E6, 0x6F6, 0x706, 0xE4716, 0xE66D6, 0xE8006, 0xEC756, 0x776, 0xF0006, 0xF4796, 0xF6006, 0xF8006, 0x7C6, 0x7D6, 0xFC006, 0x7F6, 0x100006, 0x104816, 0x106006, 0x846, 0x856, 0x866, 0x876, 0x886, 0x112006, 0x8A6, 0x8B6, 0x8C6, 0x8D6, 0x8E6, 0x1208F6, 0x124917, 0x126007, 0x124947, 0x957, 0x12E967, 0x132987, 0x9A7, 0x136007, 0x13A9C7, 0x13C007, 0x13E007, 0x140007, 0x144A17, 0x148A37, 0x134007, 0xA57, 0x14C007, 0xA77, 0xA87, 0x154007, 0x156007, 0xAC7, 0x15CAD7, 0x15E007, 0x160007, 0xB17, 0xB28, 0x168B38, 0xB58, 0x16EB68, 0x170008, 0x172008, 0x174008, 0x176008, 0x17ABC8, 0x17C008, 0x180BF8, 0x182008, 0x184008, 0xC38, 0x188008, 0x152008, 0x18CC58, 0x190C78, 0xC98, 0x196CA8, 0xCC9, 0x19CCD9, 0x1A0CF9, 0x1A2009, 0x1A4009, 0x1A8D39, 0x1AA009, 0x1AC009, 0x1B0D79, 0xD99, 0x1B4009, 0xDB9, 0x1B8009, 0x1BCDD9, 0xDF9, 0xE0A, 0x1C200A, 0x1C6E2A, 0x1C800A, 0xE5A, 0x1CC00A, 0x1D0E7A, 0x1D4E9A, 0x1D8EBA, 0x1DCEDA, 0xEFB, 0x1E2F0B, 0x1E400B, 0x1E8F3B, 0x1ECF5B, 0x1F0F7B, 0xF9C, 0x1F400C, 0x1F8FBC, 0x1FCFDC, 0xFFD, 0x100D, 0x20501D, 0x20903E, 0x20A00E, 0x20F06F, }, + new byte[] { 0x3, 0x4, 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0x20, 0x0, 0x10, 0x0, 0x0, 0x11, 0x0, 0x0, 0x1, 0x40, 0x0, 0x1, 0x60, 0x0, 0x31, 0x0, 0x0, 0x21, 0x0, 0x0, 0x1, 0x20, 0x0, 0x21, 0x20, 0x0, 0x21, 0x60, 0x0, 0x11, 0x60, 0x0, 0x42, 0x0, 0x0, 0x2, 0xA0, 0x0, 0x2, 0xC0, 0x0, 0x12, 0x0, 0x0, 0x52, 0xE0, 0x0, 0x62, 0x0, 0x0, 0x82, 0x0, 0x0, 0x72, 0x0, 0x0, 0x2, 0x20, 0x1, 0x92, 0x0, 0x0, 0x52, 0x0, 0x0, 0x92, 0x20, 0x0, 0xA2, 0x0, 0x0, 0xB2, 0x0, 0x0, 0x2, 0xE0, 0x0, 0x92, 0x80, 0x1, 0x52, 0x20, 0x0, 0x12, 0xE0, 0x0, 0x2, 0x40, 0x1, 0x2, 0x0, 0x1, 0x22, 0x0, 0x0, 0x42, 0x20, 0x1, 0xD3, 0x0, 0x0, 0x3, 0xC0, 0x1, 0xF3, 0x0, 0x0, 0x3, 0x1, 0x0, 0x3, 0x20, 0x2, 0x23, 0x1, 0x0, 0x3, 0x60, 0x2, 0x43, 0x1, 0x0, 0x53, 0x1, 0x0, 0xE3, 0x0, 0x0, 0x13, 0x80, 0x2, 0x63, 0x1, 0x0, 0x73, 0x1, 0x0, 0x83, 0x1, 0x0, 0x3, 0x40, 0x2, 0x93, 0x1, 0x0, 0xA3, 0x1, 0x0, 0xB3, 0x81, 0x3, 0xD3, 0x21, 0x0, 0x43, 0xE1, 0x1, 0xE3, 0x1, 0x0, 0xF3, 0x21, 0x0, 0x3, 0x80, 0x2, 0x3, 0x60, 0x3, 0x3, 0xE0, 0x1, 0xE3, 0xE0, 0x2, 0x3, 0x2, 0x0, 0x3, 0xC2, 0x2, 0x3, 0x40, 0x3, 0x3, 0xE2, 0x2, 0x13, 0xA2, 0x3, 0x3, 0xA0, 0x2, 0x13, 0x40, 0x4, 0x34, 0x2, 0x0, 0x44, 0x2, 0x0, 0x4, 0xA0, 0x4, 0x64, 0x2, 0x0, 0x74, 0x2, 0x0, 0x84, 0x2, 0x0, 0x4, 0x20, 0x5, 0x4, 0x40, 0x5, 0xB4, 0x2, 0x0, 0x4, 0x80, 0x5, 0xD4, 0x2, 0x0, 0xE4, 0x2, 0x0, 0xA4, 0x2, 0x0, 0x4, 0xE0, 0x5, 0x4, 0x3, 0x0, 0x14, 0x3, 0x0, 0x24, 0x3, 0x0, 0x34, 0x3, 0x0, 0x44, 0x3, 0x0, 0x4, 0x20, 0x6, 0x54, 0x3, 0x0, 0x64, 0x3, 0x0, 0x74, 0x3, 0x0, 0xC4, 0x2, 0x7, 0x14, 0xC0, 0x4, 0x4, 0x20, 0x7, 0x4, 0x40, 0x7, 0x94, 0x3, 0x0, 0xF4, 0x2, 0x0, 0xB4, 0x3, 0x0, 0x4, 0x80, 0x7, 0xD4, 0x3, 0x0, 0xE4, 0x3, 0x0, 0x4, 0xE0, 0x7, 0x4, 0x80, 0x4, 0x54, 0x2, 0x0, 0x4, 0x4, 0x0, 0x4, 0x20, 0x8, 0x24, 0x64, 0x8, 0x14, 0x0, 0x0, 0x5, 0x80, 0x8, 0x55, 0x4, 0x0, 0x65, 0xE4, 0x8, 0x85, 0x24, 0x9, 0xA5, 0x64, 0x9, 0xC5, 0x4, 0x0, 0x5, 0xA0, 0x9, 0x5, 0xC0, 0x9, 0x5, 0xE0, 0x9, 0x5, 0x5, 0x0, 0x5, 0x20, 0xA, 0x25, 0x5, 0x0, 0x5, 0x60, 0xA, 0x45, 0x5, 0x0, 0x5, 0xA0, 0xA, 0x65, 0xE5, 0xA, 0xB5, 0x4, 0x0, 0xF5, 0x4, 0x0, 0x5, 0x0, 0xB, 0x95, 0x5, 0x0, 0x15, 0x40, 0xB, 0xB5, 0x25, 0x0, 0xC5, 0x5, 0x0, 0xD5, 0x5, 0x0, 0x5, 0xC0, 0xB, 0x5, 0xE0, 0xB, 0x5, 0x6, 0x0, 0x5, 0x40, 0x9, 0x15, 0x6, 0x0, 0x25, 0x66, 0xC, 0x45, 0x6, 0x0, 0x55, 0x6, 0x0, 0x5, 0xC0, 0xC, 0x5, 0xE0, 0xC, 0x85, 0x6, 0x0, 0x95, 0x46, 0xD, 0xB5, 0x6, 0x0, 0x6, 0x80, 0xD, 0xD6, 0x6, 0x0, 0xE6, 0x6, 0x0, 0xF6, 0x6, 0x0, 0x6, 0x7, 0x0, 0x16, 0x47, 0xE, 0xD6, 0x66, 0xE, 0x6, 0x80, 0xE, 0x56, 0xC7, 0xE, 0x76, 0x7, 0x0, 0x6, 0x0, 0xF, 0x96, 0x47, 0xF, 0x6, 0x60, 0xF, 0x6, 0x80, 0xF, 0xC6, 0x7, 0x0, 0xD6, 0x7, 0x0, 0x6, 0xC0, 0xF, 0xF6, 0x7, 0x0, 0x6, 0x0, 0x10, 0x16, 0x48, 0x10, 0x6, 0x60, 0x10, 0x46, 0x8, 0x0, 0x56, 0x8, 0x0, 0x66, 0x8, 0x0, 0x76, 0x8, 0x0, 0x86, 0x8, 0x0, 0x6, 0x20, 0x11, 0xA6, 0x8, 0x0, 0xB6, 0x8, 0x0, 0xC6, 0x8, 0x0, 0xD6, 0x8, 0x0, 0xE6, 0x8, 0x0, 0xF6, 0x8, 0x12, 0x17, 0x49, 0x12, 0x7, 0x60, 0x12, 0x47, 0x49, 0x12, 0x57, 0x9, 0x0, 0x67, 0xE9, 0x12, 0x87, 0x29, 0x13, 0xA7, 0x9, 0x0, 0x7, 0x60, 0x13, 0xC7, 0xA9, 0x13, 0x7, 0xC0, 0x13, 0x7, 0xE0, 0x13, 0x7, 0x0, 0x14, 0x17, 0x4A, 0x14, 0x37, 0x8A, 0x14, 0x7, 0x40, 0x13, 0x57, 0xA, 0x0, 0x7, 0xC0, 0x14, 0x77, 0xA, 0x0, 0x87, 0xA, 0x0, 0x7, 0x40, 0x15, 0x7, 0x60, 0x15, 0xC7, 0xA, 0x0, 0xD7, 0xCA, 0x15, 0x7, 0xE0, 0x15, 0x7, 0x0, 0x16, 0x17, 0xB, 0x0, 0x28, 0xB, 0x0, 0x38, 0x8B, 0x16, 0x58, 0xB, 0x0, 0x68, 0xEB, 0x16, 0x8, 0x0, 0x17, 0x8, 0x20, 0x17, 0x8, 0x40, 0x17, 0x8, 0x60, 0x17, 0xC8, 0xAB, 0x17, 0x8, 0xC0, 0x17, 0xF8, 0xB, 0x18, 0x8, 0x20, 0x18, 0x8, 0x40, 0x18, 0x38, 0xC, 0x0, 0x8, 0x80, 0x18, 0x8, 0x20, 0x15, 0x58, 0xCC, 0x18, 0x78, 0xC, 0x19, 0x98, 0xC, 0x0, 0xA8, 0x6C, 0x19, 0xC9, 0xC, 0x0, 0xD9, 0xCC, 0x19, 0xF9, 0xC, 0x1A, 0x9, 0x20, 0x1A, 0x9, 0x40, 0x1A, 0x39, 0x8D, 0x1A, 0x9, 0xA0, 0x1A, 0x9, 0xC0, 0x1A, 0x79, 0xD, 0x1B, 0x99, 0xD, 0x0, 0x9, 0x40, 0x1B, 0xB9, 0xD, 0x0, 0x9, 0x80, 0x1B, 0xD9, 0xCD, 0x1B, 0xF9, 0xD, 0x0, 0xA, 0xE, 0x0, 0xA, 0x20, 0x1C, 0x2A, 0x6E, 0x1C, 0xA, 0x80, 0x1C, 0x5A, 0xE, 0x0, 0xA, 0xC0, 0x1C, 0x7A, 0xE, 0x1D, 0x9A, 0x4E, 0x1D, 0xBA, 0x8E, 0x1D, 0xDA, 0xCE, 0x1D, 0xFB, 0xE, 0x0, 0xB, 0x2F, 0x1E, 0xB, 0x40, 0x1E, 0x3B, 0x8F, 0x1E, 0x5B, 0xCF, 0x1E, 0x7B, 0xF, 0x1F, 0x9C, 0xF, 0x0, 0xC, 0x40, 0x1F, 0xBC, 0x8F, 0x1F, 0xDC, 0xCF, 0x1F, 0xFD, 0xF, 0x0, 0xD, 0x10, 0x0, 0x1D, 0x50, 0x20, 0x3E, 0x90, 0x20, 0xE, 0xA0, 0x20, 0x6F, 0xF0, 0x20, }, // OtherLetter(4): - new long[] { 0x4, 0xA, 0x4000, 0x10, 0x8001, 0x11, 0x4021, 0x4001, 0xC011, 0x8011, 0x31, 0x4031, 0x21, 0xC021, 0xC001, 0x8031, 0x14042, 0x14012, 0x4062, 0x4072, 0x20012, 0x52, 0x4042, 0x4092, 0x4002, 0x28012, 0x1C002, 0x2C092, 0x4022, 0x24012, 0x32, 0x18002, 0x20062, 0x30002, 0x28042, 0x8002, 0x20072, 0x380D2, 0x30052, 0x18012, 0x10002, 0x14062, 0x40F2, 0x12, 0x280D2, 0xA2, 0xC2, 0x14002, 0x82, 0x180A2, 0x42, 0x40D2, 0x20092, 0x24072, 0x10082, 0x14072, 0xE2, 0x24002, 0x4032, 0x34092, 0x40E2, 0x2C012, 0x62, 0x180E2, 0x34002, 0x1C0E2, 0x4082, 0x18052, 0x28082, 0x38002, 0xB2, 0x24082, 0x3C012, 0x40B2, 0x20022, 0x240D2, 0x8052, 0x140F2, 0x28002, 0x44103, 0x4123, 0x4133, 0x50013, 0x54013, 0x4163, 0x5C013, 0x4183, 0x4003, 0x44013, 0x64013, 0x68003, 0x6C013, 0x481C3, 0x41D3, 0x1E3, 0x41A3, 0x48193, 0x60003, 0x7C003, 0x80003, 0x84003, 0x41F3, 0x223, 0x8C003, 0x94243, 0x80263, 0x9C183, 0x4283, 0x293, 0xA8013, 0xAC013, 0x48003, 0x4C003, 0x113, 0x442C3, 0x2C273, 0xB4193, 0x2D3, 0x2E3, 0x2F3, 0xC0013, 0x4313, 0x482D3, 0x323, 0xB8003, 0xC0283, 0xCC213, 0x343, 0x303, 0xA0153, 0xC0183, 0x58003, 0x4233, 0x9C013, 0xA0003, 0x4173, 0x50283, 0x42A3, 0xD4013, 0x48013, 0xD4123, 0x4353, 0x48353, 0x682E3, 0xD8013, 0x94153, 0x4C373, 0x163, 0x4143, 0x2B3, 0xE4383, 0xE8013, 0xEC273, 0xE4003, 0xF43C3, 0x48113, 0xF82D3, 0x43F3, 0x74013, 0xAC173, 0x100003, 0x108413, 0xD8173, 0x1F3, 0x4413, 0xC0173, 0x88433, 0xD43B3, 0x110433, 0x114003, 0x463, 0x11C413, 0x120013, 0xC02A3, 0x453, 0xF4013, 0xC0493, 0x40003, 0x4A3, 0x12C1A3, 0xC0313, 0x68323, 0x130413, 0xD82A3, 0xA0013, 0x4D3, 0x153, 0xF0003, 0x501F3, 0xC8003, 0x4E3, 0x213, 0x444F4, 0x4504, 0x4514, 0x14C524, 0x4544, 0x554, 0x564, 0x15C004, 0x4584, 0x14, 0x594, 0x45A4, 0x16C014, 0x1745C4, 0x5E4, 0x45F4, 0x144014, 0x4564, 0x180014, 0x184014, 0x188004, 0x48004, 0x80634, 0x194644, 0x19C664, 0x4684, 0x4694, 0x1A8004, 0x1AC004, 0x1B46C4, 0x4624, 0x1B8014, 0x1BC004, 0x1C0014, 0x1C4014, 0x724, 0x4614, 0x160014, 0x1CC014, 0x744, 0x1D4004, 0x1C0004, 0x1D8004, 0x1DC004, 0x158014, 0x4574, 0x150004, 0x4554, 0x140004, 0x4524, 0x1E0014, 0x4794, 0x148014, 0x47A4, 0x7B4, 0x1F0004, 0x46F4, 0x7D4, 0x1FC7E4, 0x200714, 0x184004, 0x204714, 0x164014, 0x208004, 0x4834, 0x17C004, 0x144834, 0x4704, 0x210014, 0x1B4014, 0x46B4, 0x214014, 0x21C864, 0x21C5A4, 0x194884, 0x148654, 0x224014, 0x4004, 0x4654, 0x48A4, 0x2288B4, 0x48C4, 0x234014, 0x2348E4, 0x23C004, 0x244904, 0x924, 0x194754, 0x24C004, 0x250014, 0x218004, 0x20C954, 0x25C964, 0x260014, 0x4994, 0x49A4, 0x1E09B4, 0x168714, 0x1D89C4, 0x49D4, 0x27C9E4, 0x168A04, 0x764, 0x174A14, 0x2889E4, 0x168004, 0xA34, 0x174A44, 0x2949E4, 0x864, 0x2985F4, 0x2A0A74, 0x168A94, 0xAA4, 0x174AB4, 0x2B4AC4, 0x168AE4, 0x2C0AF4, 0xB14, 0xB24, 0x174B34, 0x2D0AC4, 0x168B54, 0x1D8AA4, 0x174B64, 0x2DCAC4, 0x168584, 0xB84, 0x4A44, 0x194004, 0x1C0A94, 0x200014, 0x9E4, 0x2E8B94, 0x4BB4, 0x2E8524, 0x2F0004, 0x1E4624, 0xBD4, 0xBE4, 0x300005, 0x308C15, 0xC35, 0x4C45, 0xC55, 0x31CC65, 0x320015, 0x324015, 0x4C25, 0x328015, 0x4CB5, 0x330015, 0x338CD5, 0x33C005, 0x4D05, 0x348D15, 0x4D35, 0x4D45, 0x358D55, 0x360D75, 0x4D95, 0x36CDA5, 0x4DC5, 0xDD5, 0x37CDE5, 0x380C45, 0x388E15, 0xE35, 0x394E45, 0x4E45, 0x398D45, 0xE75, 0x3A0005, 0x4E95, 0x15, 0xEA5, 0x3B0EB5, 0x324ED5, 0x3B8005, 0x3BC015, 0xC95, 0x3C0015, 0x3C8F15, 0x4F35, 0x3D4F45, 0x3D0015, 0x3DCF65, 0x48005, 0x3E0125, 0x4C75, 0xF95, 0xFA5, 0x3ECED5, 0x4FC5, 0x3F8FD5, 0x3FC005, 0x3C8E45, 0x400005, 0x3E0015, 0x404005, 0x4EC5, 0x325025, 0x304005, 0x5035, 0x415045, 0x41D065, 0x3D8005, 0x32D085, 0x424CB5, 0x50A5, 0x42C015, 0x50C5, 0x434005, 0x438005, 0x43C015, 0x440015, 0x449115, 0x44C015, 0x450005, 0x459155, 0x5175, 0x460005, 0x464EE5, 0x468005, 0x46C005, 0x4751C5, 0x3A4005, 0x3D11E5, 0x380005, 0x4811F5, 0x489215, 0x491235, 0x499255, 0x4A1275, 0x4A9295, 0x4B12B5, 0x4B4005, 0x4BD2E5, 0x4C5305, 0x4CD325, 0x4B5345, 0x4D5325, 0x4DD365, 0x4E5385, 0x4ED3A5, 0x4F53C5, 0x4FD3E5, 0x37D405, 0x31C005, 0xEF5, 0x419415, 0x40C005, 0x389415, 0x5425, 0x50C015, 0x5110D5, 0x519455, 0x521475, 0x325495, 0x528005, 0x3F0005, 0x14B5, 0xBF5, 0x5354C6, 0x14E6, 0x54F6, 0x1506, 0x549516, 0x551536, 0x559556, 0x561576, 0x5596, 0x55A6, 0x5715B6, 0x15D6, 0x578006, 0x5815F6, 0x589616, 0x591636, 0x599656, 0x5A1676, 0x5A9696, 0x5B16B6, 0x5B96D6, 0x5C16F6, 0x5C9716, 0x5CC016, 0x4006, 0x5D5746, 0x5D8016, 0x5E1776, 0x5E9796, 0x5F17B6, 0x5D17D6, 0x5F8006, 0x17F6, 0x605806, 0x6096D6, 0x611836, 0x619856, 0x621876, 0x629896, 0x6318B6, 0x5B98D6, 0x5A58E6, 0x6418F6, 0x649916, 0x5936, 0x5E4016, 0x650006, 0x659956, 0x661976, 0x5996, 0x668006, 0x6719B6, 0x674006, 0x67D9E6, 0x685A06, 0x68DA26, 0x695A46, 0x69DA66, 0x6A5A86, 0x6ADAA6, 0x6B5AC6, 0x6BDAE6, 0x6C5B06, 0x6CDB26, 0x6D5B46, 0x6DDB66, 0x6E5B86, 0x6EDBA6, 0x6F5BC6, 0x6FDBE6, 0x5C06, 0x5B9C16, 0x1C26, 0x70C006, 0x715C46, 0x718006, 0x721C77, 0x729C97, 0x731CB7, 0x739CD7, 0x741CF7, 0x5D17, 0x74DD27, 0x755D47, 0x75DD67, 0x765D87, 0x1DA7, 0x771DB7, 0x5DD7, 0x778017, 0x5C97, 0x5DF7, 0x785E07, 0x78DE27, 0x795E47, 0x798007, 0x7A1E77, 0x7A9E97, 0x7AC007, 0x7B5EC7, 0x7BDEE7, 0x7C5F07, 0x7CDF27, 0x7D0017, 0x7D9F57, 0x7E1F77, 0x7E9F97, 0x7F1FB7, 0x7F9FD7, 0x801FF7, 0x80A017, 0x812037, 0x81A057, 0x822077, 0x82A097, 0x8320B7, 0x83A0D7, 0x20F7, 0x2107, 0x2117, 0x2127, 0x852138, 0x6158, 0x85E168, 0x18, 0x6188, 0x86A198, 0x8721B8, 0x87A1D8, 0x87C018, 0x880018, 0x6218, 0x6228, 0x892238, 0x2258, 0x2268, 0x89C008, 0x8A6288, 0x8AE2A8, 0x8B62C8, 0x8B8018, 0x8C22F8, 0x8C4018, 0x8CE328, 0x8D6348, 0x8DE368, 0x8E6388, 0x8EE3A8, 0x23C8, 0x8F4008, 0x8FE3E8, 0x906409, 0x90E429, 0x6449, 0x91A459, 0x922479, 0x924019, 0x64A9, 0x92C019, 0x930009, 0x934009, 0x938009, 0x93C009, 0x946509, 0x94E529, 0x956549, 0x95E569, 0x966589, 0x96E5A9, 0x9765C9, 0x97E5EA, 0x660A, 0x98401A, 0x98E62A, 0x664A, 0x665A, 0x99801A, 0x267A, 0x9A000A, 0x9AA69A, 0x9B26BA, 0x9BA6DA, 0x9C26FA, 0x271B, 0x9C800B, 0x9D273B, 0x675B, 0x676B, 0x9DC01B, 0x9E678B, 0x9EE7AB, 0x9F67CB, 0x27EC, 0x67FC, 0xA0001C, 0x681C, 0xA0801C, 0xA1283C, 0xA1A85C, 0xA2287D, 0xA2A89D, 0xA2C01D, 0xA368CD, 0xA3E8EE, 0xA4690E, 0xA4E92F, }, + new byte[] { 0x3, 0x4, 0x0, 0x0, 0xA, 0x0, 0x0, 0x0, 0x40, 0x0, 0x10, 0x0, 0x0, 0x1, 0x80, 0x0, 0x11, 0x0, 0x0, 0x21, 0x40, 0x0, 0x1, 0x40, 0x0, 0x11, 0xC0, 0x0, 0x11, 0x80, 0x0, 0x31, 0x0, 0x0, 0x31, 0x40, 0x0, 0x21, 0x0, 0x0, 0x21, 0xC0, 0x0, 0x1, 0xC0, 0x0, 0x31, 0x80, 0x0, 0x42, 0x40, 0x1, 0x12, 0x40, 0x1, 0x62, 0x40, 0x0, 0x72, 0x40, 0x0, 0x12, 0x0, 0x2, 0x52, 0x0, 0x0, 0x42, 0x40, 0x0, 0x92, 0x40, 0x0, 0x2, 0x40, 0x0, 0x12, 0x80, 0x2, 0x2, 0xC0, 0x1, 0x92, 0xC0, 0x2, 0x22, 0x40, 0x0, 0x12, 0x40, 0x2, 0x32, 0x0, 0x0, 0x2, 0x80, 0x1, 0x62, 0x0, 0x2, 0x2, 0x0, 0x3, 0x42, 0x80, 0x2, 0x2, 0x80, 0x0, 0x72, 0x0, 0x2, 0xD2, 0x80, 0x3, 0x52, 0x0, 0x3, 0x12, 0x80, 0x1, 0x2, 0x0, 0x1, 0x62, 0x40, 0x1, 0xF2, 0x40, 0x0, 0x12, 0x0, 0x0, 0xD2, 0x80, 0x2, 0xA2, 0x0, 0x0, 0xC2, 0x0, 0x0, 0x2, 0x40, 0x1, 0x82, 0x0, 0x0, 0xA2, 0x80, 0x1, 0x42, 0x0, 0x0, 0xD2, 0x40, 0x0, 0x92, 0x0, 0x2, 0x72, 0x40, 0x2, 0x82, 0x0, 0x1, 0x72, 0x40, 0x1, 0xE2, 0x0, 0x0, 0x2, 0x40, 0x2, 0x32, 0x40, 0x0, 0x92, 0x40, 0x3, 0xE2, 0x40, 0x0, 0x12, 0xC0, 0x2, 0x62, 0x0, 0x0, 0xE2, 0x80, 0x1, 0x2, 0x40, 0x3, 0xE2, 0xC0, 0x1, 0x82, 0x40, 0x0, 0x52, 0x80, 0x1, 0x82, 0x80, 0x2, 0x2, 0x80, 0x3, 0xB2, 0x0, 0x0, 0x82, 0x40, 0x2, 0x12, 0xC0, 0x3, 0xB2, 0x40, 0x0, 0x22, 0x0, 0x2, 0xD2, 0x40, 0x2, 0x52, 0x80, 0x0, 0xF2, 0x40, 0x1, 0x2, 0x80, 0x2, 0x3, 0x41, 0x4, 0x23, 0x41, 0x0, 0x33, 0x41, 0x0, 0x13, 0x0, 0x5, 0x13, 0x40, 0x5, 0x63, 0x41, 0x0, 0x13, 0xC0, 0x5, 0x83, 0x41, 0x0, 0x3, 0x40, 0x0, 0x13, 0x40, 0x4, 0x13, 0x40, 0x6, 0x3, 0x80, 0x6, 0x13, 0xC0, 0x6, 0xC3, 0x81, 0x4, 0xD3, 0x41, 0x0, 0xE3, 0x1, 0x0, 0xA3, 0x41, 0x0, 0x93, 0x81, 0x4, 0x3, 0x0, 0x6, 0x3, 0xC0, 0x7, 0x3, 0x0, 0x8, 0x3, 0x40, 0x8, 0xF3, 0x41, 0x0, 0x23, 0x2, 0x0, 0x3, 0xC0, 0x8, 0x43, 0x42, 0x9, 0x63, 0x2, 0x8, 0x83, 0xC1, 0x9, 0x83, 0x42, 0x0, 0x93, 0x2, 0x0, 0x13, 0x80, 0xA, 0x13, 0xC0, 0xA, 0x3, 0x80, 0x4, 0x3, 0xC0, 0x4, 0x13, 0x1, 0x0, 0xC3, 0x42, 0x4, 0x73, 0xC2, 0x2, 0x93, 0x41, 0xB, 0xD3, 0x2, 0x0, 0xE3, 0x2, 0x0, 0xF3, 0x2, 0x0, 0x13, 0x0, 0xC, 0x13, 0x43, 0x0, 0xD3, 0x82, 0x4, 0x23, 0x3, 0x0, 0x3, 0x80, 0xB, 0x83, 0x2, 0xC, 0x13, 0xC2, 0xC, 0x43, 0x3, 0x0, 0x3, 0x3, 0x0, 0x53, 0x1, 0xA, 0x83, 0x1, 0xC, 0x3, 0x80, 0x5, 0x33, 0x42, 0x0, 0x13, 0xC0, 0x9, 0x3, 0x0, 0xA, 0x73, 0x41, 0x0, 0x83, 0x2, 0x5, 0xA3, 0x42, 0x0, 0x13, 0x40, 0xD, 0x13, 0x80, 0x4, 0x23, 0x41, 0xD, 0x53, 0x43, 0x0, 0x53, 0x83, 0x4, 0xE3, 0x82, 0x6, 0x13, 0x80, 0xD, 0x53, 0x41, 0x9, 0x73, 0xC3, 0x4, 0x63, 0x1, 0x0, 0x43, 0x41, 0x0, 0xB3, 0x2, 0x0, 0x83, 0x43, 0xE, 0x13, 0x80, 0xE, 0x73, 0xC2, 0xE, 0x3, 0x40, 0xE, 0xC3, 0x43, 0xF, 0x13, 0x81, 0x4, 0xD3, 0x82, 0xF, 0xF3, 0x43, 0x0, 0x13, 0x40, 0x7, 0x73, 0xC1, 0xA, 0x3, 0x0, 0x10, 0x13, 0x84, 0x10, 0x73, 0x81, 0xD, 0xF3, 0x1, 0x0, 0x13, 0x44, 0x0, 0x73, 0x1, 0xC, 0x33, 0x84, 0x8, 0xB3, 0x43, 0xD, 0x33, 0x4, 0x11, 0x3, 0x40, 0x11, 0x63, 0x4, 0x0, 0x13, 0xC4, 0x11, 0x13, 0x0, 0x12, 0xA3, 0x2, 0xC, 0x53, 0x4, 0x0, 0x13, 0x40, 0xF, 0x93, 0x4, 0xC, 0x3, 0x0, 0x4, 0xA3, 0x4, 0x0, 0xA3, 0xC1, 0x12, 0x13, 0x3, 0xC, 0x23, 0x83, 0x6, 0x13, 0x4, 0x13, 0xA3, 0x82, 0xD, 0x13, 0x0, 0xA, 0xD3, 0x4, 0x0, 0x53, 0x1, 0x0, 0x3, 0x0, 0xF, 0xF3, 0x1, 0x5, 0x3, 0x80, 0xC, 0xE3, 0x4, 0x0, 0x13, 0x2, 0x0, 0xF4, 0x44, 0x4, 0x4, 0x45, 0x0, 0x14, 0x45, 0x0, 0x24, 0xC5, 0x14, 0x44, 0x45, 0x0, 0x54, 0x5, 0x0, 0x64, 0x5, 0x0, 0x4, 0xC0, 0x15, 0x84, 0x45, 0x0, 0x14, 0x0, 0x0, 0x94, 0x5, 0x0, 0xA4, 0x45, 0x0, 0x14, 0xC0, 0x16, 0xC4, 0x45, 0x17, 0xE4, 0x5, 0x0, 0xF4, 0x45, 0x0, 0x14, 0x40, 0x14, 0x64, 0x45, 0x0, 0x14, 0x0, 0x18, 0x14, 0x40, 0x18, 0x4, 0x80, 0x18, 0x4, 0x80, 0x4, 0x34, 0x6, 0x8, 0x44, 0x46, 0x19, 0x64, 0xC6, 0x19, 0x84, 0x46, 0x0, 0x94, 0x46, 0x0, 0x4, 0x80, 0x1A, 0x4, 0xC0, 0x1A, 0xC4, 0x46, 0x1B, 0x24, 0x46, 0x0, 0x14, 0x80, 0x1B, 0x4, 0xC0, 0x1B, 0x14, 0x0, 0x1C, 0x14, 0x40, 0x1C, 0x24, 0x7, 0x0, 0x14, 0x46, 0x0, 0x14, 0x0, 0x16, 0x14, 0xC0, 0x1C, 0x44, 0x7, 0x0, 0x4, 0x40, 0x1D, 0x4, 0x0, 0x1C, 0x4, 0x80, 0x1D, 0x4, 0xC0, 0x1D, 0x14, 0x80, 0x15, 0x74, 0x45, 0x0, 0x4, 0x0, 0x15, 0x54, 0x45, 0x0, 0x4, 0x0, 0x14, 0x24, 0x45, 0x0, 0x14, 0x0, 0x1E, 0x94, 0x47, 0x0, 0x14, 0x80, 0x14, 0xA4, 0x47, 0x0, 0xB4, 0x7, 0x0, 0x4, 0x0, 0x1F, 0xF4, 0x46, 0x0, 0xD4, 0x7, 0x0, 0xE4, 0xC7, 0x1F, 0x14, 0x7, 0x20, 0x4, 0x40, 0x18, 0x14, 0x47, 0x20, 0x14, 0x40, 0x16, 0x4, 0x80, 0x20, 0x34, 0x48, 0x0, 0x4, 0xC0, 0x17, 0x34, 0x48, 0x14, 0x4, 0x47, 0x0, 0x14, 0x0, 0x21, 0x14, 0x40, 0x1B, 0xB4, 0x46, 0x0, 0x14, 0x40, 0x21, 0x64, 0xC8, 0x21, 0xA4, 0xC5, 0x21, 0x84, 0x48, 0x19, 0x54, 0x86, 0x14, 0x14, 0x40, 0x22, 0x4, 0x40, 0x0, 0x54, 0x46, 0x0, 0xA4, 0x48, 0x0, 0xB4, 0x88, 0x22, 0xC4, 0x48, 0x0, 0x14, 0x40, 0x23, 0xE4, 0x48, 0x23, 0x4, 0xC0, 0x23, 0x4, 0x49, 0x24, 0x24, 0x9, 0x0, 0x54, 0x47, 0x19, 0x4, 0xC0, 0x24, 0x14, 0x0, 0x25, 0x4, 0x80, 0x21, 0x54, 0xC9, 0x20, 0x64, 0xC9, 0x25, 0x14, 0x0, 0x26, 0x94, 0x49, 0x0, 0xA4, 0x49, 0x0, 0xB4, 0x9, 0x1E, 0x14, 0x87, 0x16, 0xC4, 0x89, 0x1D, 0xD4, 0x49, 0x0, 0xE4, 0xC9, 0x27, 0x4, 0x8A, 0x16, 0x64, 0x7, 0x0, 0x14, 0x4A, 0x17, 0xE4, 0x89, 0x28, 0x4, 0x80, 0x16, 0x34, 0xA, 0x0, 0x44, 0x4A, 0x17, 0xE4, 0x49, 0x29, 0x64, 0x8, 0x0, 0xF4, 0x85, 0x29, 0x74, 0xA, 0x2A, 0x94, 0x8A, 0x16, 0xA4, 0xA, 0x0, 0xB4, 0x4A, 0x17, 0xC4, 0x4A, 0x2B, 0xE4, 0x8A, 0x16, 0xF4, 0xA, 0x2C, 0x14, 0xB, 0x0, 0x24, 0xB, 0x0, 0x34, 0x4B, 0x17, 0xC4, 0xA, 0x2D, 0x54, 0x8B, 0x16, 0xA4, 0x8A, 0x1D, 0x64, 0x4B, 0x17, 0xC4, 0xCA, 0x2D, 0x84, 0x85, 0x16, 0x84, 0xB, 0x0, 0x44, 0x4A, 0x0, 0x4, 0x40, 0x19, 0x94, 0xA, 0x1C, 0x14, 0x0, 0x20, 0xE4, 0x9, 0x0, 0x94, 0x8B, 0x2E, 0xB4, 0x4B, 0x0, 0x24, 0x85, 0x2E, 0x4, 0x0, 0x2F, 0x24, 0x46, 0x1E, 0xD4, 0xB, 0x0, 0xE4, 0xB, 0x0, 0x5, 0x0, 0x30, 0x15, 0x8C, 0x30, 0x35, 0xC, 0x0, 0x45, 0x4C, 0x0, 0x55, 0xC, 0x0, 0x65, 0xCC, 0x31, 0x15, 0x0, 0x32, 0x15, 0x40, 0x32, 0x25, 0x4C, 0x0, 0x15, 0x80, 0x32, 0xB5, 0x4C, 0x0, 0x15, 0x0, 0x33, 0xD5, 0x8C, 0x33, 0x5, 0xC0, 0x33, 0x5, 0x4D, 0x0, 0x15, 0x8D, 0x34, 0x35, 0x4D, 0x0, 0x45, 0x4D, 0x0, 0x55, 0x8D, 0x35, 0x75, 0xD, 0x36, 0x95, 0x4D, 0x0, 0xA5, 0xCD, 0x36, 0xC5, 0x4D, 0x0, 0xD5, 0xD, 0x0, 0xE5, 0xCD, 0x37, 0x45, 0xC, 0x38, 0x15, 0x8E, 0x38, 0x35, 0xE, 0x0, 0x45, 0x4E, 0x39, 0x45, 0x4E, 0x0, 0x45, 0x8D, 0x39, 0x75, 0xE, 0x0, 0x5, 0x0, 0x3A, 0x95, 0x4E, 0x0, 0x15, 0x0, 0x0, 0xA5, 0xE, 0x0, 0xB5, 0xE, 0x3B, 0xD5, 0x4E, 0x32, 0x5, 0x80, 0x3B, 0x15, 0xC0, 0x3B, 0x95, 0xC, 0x0, 0x15, 0x0, 0x3C, 0x15, 0x8F, 0x3C, 0x35, 0x4F, 0x0, 0x45, 0x4F, 0x3D, 0x15, 0x0, 0x3D, 0x65, 0xCF, 0x3D, 0x5, 0x80, 0x4, 0x25, 0x1, 0x3E, 0x75, 0x4C, 0x0, 0x95, 0xF, 0x0, 0xA5, 0xF, 0x0, 0xD5, 0xCE, 0x3E, 0xC5, 0x4F, 0x0, 0xD5, 0x8F, 0x3F, 0x5, 0xC0, 0x3F, 0x45, 0x8E, 0x3C, 0x5, 0x0, 0x40, 0x15, 0x0, 0x3E, 0x5, 0x40, 0x40, 0xC5, 0x4E, 0x0, 0x25, 0x50, 0x32, 0x5, 0x40, 0x30, 0x35, 0x50, 0x0, 0x45, 0x50, 0x41, 0x65, 0xD0, 0x41, 0x5, 0x80, 0x3D, 0x85, 0xD0, 0x32, 0xB5, 0x4C, 0x42, 0xA5, 0x50, 0x0, 0x15, 0xC0, 0x42, 0xC5, 0x50, 0x0, 0x5, 0x40, 0x43, 0x5, 0x80, 0x43, 0x15, 0xC0, 0x43, 0x15, 0x0, 0x44, 0x15, 0x91, 0x44, 0x15, 0xC0, 0x44, 0x5, 0x0, 0x45, 0x55, 0x91, 0x45, 0x75, 0x51, 0x0, 0x5, 0x0, 0x46, 0xE5, 0x4E, 0x46, 0x5, 0x80, 0x46, 0x5, 0xC0, 0x46, 0xC5, 0x51, 0x47, 0x5, 0x40, 0x3A, 0xE5, 0x11, 0x3D, 0x5, 0x0, 0x38, 0xF5, 0x11, 0x48, 0x15, 0x92, 0x48, 0x35, 0x12, 0x49, 0x55, 0x92, 0x49, 0x75, 0x12, 0x4A, 0x95, 0x92, 0x4A, 0xB5, 0x12, 0x4B, 0x5, 0x40, 0x4B, 0xE5, 0xD2, 0x4B, 0x5, 0x53, 0x4C, 0x25, 0xD3, 0x4C, 0x45, 0x53, 0x4B, 0x25, 0x53, 0x4D, 0x65, 0xD3, 0x4D, 0x85, 0x53, 0x4E, 0xA5, 0xD3, 0x4E, 0xC5, 0x53, 0x4F, 0xE5, 0xD3, 0x4F, 0x5, 0xD4, 0x37, 0x5, 0xC0, 0x31, 0xF5, 0xE, 0x0, 0x15, 0x94, 0x41, 0x5, 0xC0, 0x40, 0x15, 0x94, 0x38, 0x25, 0x54, 0x0, 0x15, 0xC0, 0x50, 0xD5, 0x10, 0x51, 0x55, 0x94, 0x51, 0x75, 0x14, 0x52, 0x95, 0x54, 0x32, 0x5, 0x80, 0x52, 0x5, 0x0, 0x3F, 0xB5, 0x14, 0x0, 0xF5, 0xB, 0x0, 0xC6, 0x54, 0x53, 0xE6, 0x14, 0x0, 0xF6, 0x54, 0x0, 0x6, 0x15, 0x0, 0x16, 0x95, 0x54, 0x36, 0x15, 0x55, 0x56, 0x95, 0x55, 0x76, 0x15, 0x56, 0x96, 0x55, 0x0, 0xA6, 0x55, 0x0, 0xB6, 0x15, 0x57, 0xD6, 0x15, 0x0, 0x6, 0x80, 0x57, 0xF6, 0x15, 0x58, 0x16, 0x96, 0x58, 0x36, 0x16, 0x59, 0x56, 0x96, 0x59, 0x76, 0x16, 0x5A, 0x96, 0x96, 0x5A, 0xB6, 0x16, 0x5B, 0xD6, 0x96, 0x5B, 0xF6, 0x16, 0x5C, 0x16, 0x97, 0x5C, 0x16, 0xC0, 0x5C, 0x6, 0x40, 0x0, 0x46, 0x57, 0x5D, 0x16, 0x80, 0x5D, 0x76, 0x17, 0x5E, 0x96, 0x97, 0x5E, 0xB6, 0x17, 0x5F, 0xD6, 0x17, 0x5D, 0x6, 0x80, 0x5F, 0xF6, 0x17, 0x0, 0x6, 0x58, 0x60, 0xD6, 0x96, 0x60, 0x36, 0x18, 0x61, 0x56, 0x98, 0x61, 0x76, 0x18, 0x62, 0x96, 0x98, 0x62, 0xB6, 0x18, 0x63, 0xD6, 0x98, 0x5B, 0xE6, 0x58, 0x5A, 0xF6, 0x18, 0x64, 0x16, 0x99, 0x64, 0x36, 0x59, 0x0, 0x16, 0x40, 0x5E, 0x6, 0x0, 0x65, 0x56, 0x99, 0x65, 0x76, 0x19, 0x66, 0x96, 0x59, 0x0, 0x6, 0x80, 0x66, 0xB6, 0x19, 0x67, 0x6, 0x40, 0x67, 0xE6, 0xD9, 0x67, 0x6, 0x5A, 0x68, 0x26, 0xDA, 0x68, 0x46, 0x5A, 0x69, 0x66, 0xDA, 0x69, 0x86, 0x5A, 0x6A, 0xA6, 0xDA, 0x6A, 0xC6, 0x5A, 0x6B, 0xE6, 0xDA, 0x6B, 0x6, 0x5B, 0x6C, 0x26, 0xDB, 0x6C, 0x46, 0x5B, 0x6D, 0x66, 0xDB, 0x6D, 0x86, 0x5B, 0x6E, 0xA6, 0xDB, 0x6E, 0xC6, 0x5B, 0x6F, 0xE6, 0xDB, 0x6F, 0x6, 0x5C, 0x0, 0x16, 0x9C, 0x5B, 0x26, 0x1C, 0x0, 0x6, 0xC0, 0x70, 0x46, 0x5C, 0x71, 0x6, 0x80, 0x71, 0x77, 0x1C, 0x72, 0x97, 0x9C, 0x72, 0xB7, 0x1C, 0x73, 0xD7, 0x9C, 0x73, 0xF7, 0x1C, 0x74, 0x17, 0x5D, 0x0, 0x27, 0xDD, 0x74, 0x47, 0x5D, 0x75, 0x67, 0xDD, 0x75, 0x87, 0x5D, 0x76, 0xA7, 0x1D, 0x0, 0xB7, 0x1D, 0x77, 0xD7, 0x5D, 0x0, 0x17, 0x80, 0x77, 0x97, 0x5C, 0x0, 0xF7, 0x5D, 0x0, 0x7, 0x5E, 0x78, 0x27, 0xDE, 0x78, 0x47, 0x5E, 0x79, 0x7, 0x80, 0x79, 0x77, 0x1E, 0x7A, 0x97, 0x9E, 0x7A, 0x7, 0xC0, 0x7A, 0xC7, 0x5E, 0x7B, 0xE7, 0xDE, 0x7B, 0x7, 0x5F, 0x7C, 0x27, 0xDF, 0x7C, 0x17, 0x0, 0x7D, 0x57, 0x9F, 0x7D, 0x77, 0x1F, 0x7E, 0x97, 0x9F, 0x7E, 0xB7, 0x1F, 0x7F, 0xD7, 0x9F, 0x7F, 0xF7, 0x1F, 0x80, 0x17, 0xA0, 0x80, 0x37, 0x20, 0x81, 0x57, 0xA0, 0x81, 0x77, 0x20, 0x82, 0x97, 0xA0, 0x82, 0xB7, 0x20, 0x83, 0xD7, 0xA0, 0x83, 0xF7, 0x20, 0x0, 0x7, 0x21, 0x0, 0x17, 0x21, 0x0, 0x27, 0x21, 0x0, 0x38, 0x21, 0x85, 0x58, 0x61, 0x0, 0x68, 0xE1, 0x85, 0x18, 0x0, 0x0, 0x88, 0x61, 0x0, 0x98, 0xA1, 0x86, 0xB8, 0x21, 0x87, 0xD8, 0xA1, 0x87, 0x18, 0xC0, 0x87, 0x18, 0x0, 0x88, 0x18, 0x62, 0x0, 0x28, 0x62, 0x0, 0x38, 0x22, 0x89, 0x58, 0x22, 0x0, 0x68, 0x22, 0x0, 0x8, 0xC0, 0x89, 0x88, 0x62, 0x8A, 0xA8, 0xE2, 0x8A, 0xC8, 0x62, 0x8B, 0x18, 0x80, 0x8B, 0xF8, 0x22, 0x8C, 0x18, 0x40, 0x8C, 0x28, 0xE3, 0x8C, 0x48, 0x63, 0x8D, 0x68, 0xE3, 0x8D, 0x88, 0x63, 0x8E, 0xA8, 0xE3, 0x8E, 0xC8, 0x23, 0x0, 0x8, 0x40, 0x8F, 0xE8, 0xE3, 0x8F, 0x9, 0x64, 0x90, 0x29, 0xE4, 0x90, 0x49, 0x64, 0x0, 0x59, 0xA4, 0x91, 0x79, 0x24, 0x92, 0x19, 0x40, 0x92, 0xA9, 0x64, 0x0, 0x19, 0xC0, 0x92, 0x9, 0x0, 0x93, 0x9, 0x40, 0x93, 0x9, 0x80, 0x93, 0x9, 0xC0, 0x93, 0x9, 0x65, 0x94, 0x29, 0xE5, 0x94, 0x49, 0x65, 0x95, 0x69, 0xE5, 0x95, 0x89, 0x65, 0x96, 0xA9, 0xE5, 0x96, 0xC9, 0x65, 0x97, 0xEA, 0xE5, 0x97, 0xA, 0x66, 0x0, 0x1A, 0x40, 0x98, 0x2A, 0xE6, 0x98, 0x4A, 0x66, 0x0, 0x5A, 0x66, 0x0, 0x1A, 0x80, 0x99, 0x7A, 0x26, 0x0, 0xA, 0x0, 0x9A, 0x9A, 0xA6, 0x9A, 0xBA, 0x26, 0x9B, 0xDA, 0xA6, 0x9B, 0xFA, 0x26, 0x9C, 0x1B, 0x27, 0x0, 0xB, 0x80, 0x9C, 0x3B, 0x27, 0x9D, 0x5B, 0x67, 0x0, 0x6B, 0x67, 0x0, 0x1B, 0xC0, 0x9D, 0x8B, 0x67, 0x9E, 0xAB, 0xE7, 0x9E, 0xCB, 0x67, 0x9F, 0xEC, 0x27, 0x0, 0xFC, 0x67, 0x0, 0x1C, 0x0, 0xA0, 0x1C, 0x68, 0x0, 0x1C, 0x80, 0xA0, 0x3C, 0x28, 0xA1, 0x5C, 0xA8, 0xA1, 0x7D, 0x28, 0xA2, 0x9D, 0xA8, 0xA2, 0x1D, 0xC0, 0xA2, 0xCD, 0x68, 0xA3, 0xEE, 0xE8, 0xA3, 0xE, 0x69, 0xA4, 0x2F, 0xE9, 0xA4, }, // NonSpacingMark(5): - new long[] { 0x4, 0xA, 0x4000, 0x10, 0x21, 0xC001, 0x8001, 0x4001, 0x11, 0x8031, 0x8011, 0x31, 0xC021, 0x4021, 0xC011, 0x4031, 0x42, 0x18052, 0x52, 0x72, 0x14002, 0x18082, 0x28092, 0x62, 0x2C002, 0x380D2, 0x2C082, 0x34002, 0x1C002, 0xB2, 0x4072, 0x82, 0xC2, 0x12, 0x30002, 0x20072, 0x18002, 0x140E2, 0x4062, 0x3C012, 0x28012, 0x34012, 0x4082, 0x1C032, 0x3C072, 0x4002, 0x2C012, 0x10002, 0x34062, 0xA2, 0x40F2, 0x4092, 0x80E2, 0x40D2, 0x24002, 0x38002, 0x340B2, 0x2C072, 0x38012, 0xF2, 0x20002, 0x20062, 0xE2, 0x100C2, 0x38062, 0x1C082, 0x40A2, 0x32, 0x14012, 0x20022, 0x2C062, 0x92, 0x28072, 0x20012, 0x380F2, 0x1C052, 0x24072, 0x300B2, 0x10062, 0x38072, 0x40E2, 0x300F2, 0x103, 0x48113, 0x40003, 0x133, 0x50003, 0x58153, 0x173, 0x60173, 0x30003, 0x193, 0x48003, 0x68073, 0x6C003, 0x70003, 0x74013, 0x7C1E3, 0x701D3, 0x4C003, 0x80173, 0x10183, 0x1F3, 0x841E3, 0x1D3, 0x223, 0x233, 0x90003, 0x94013, 0x4263, 0x4273, 0x5C1C3, 0xA0113, 0xA4013, 0xA8003, 0x213, 0x402B3, 0x8C2C3, 0xB4003, 0x2E3, 0xBC003, 0xC4303, 0x4323, 0xB8333, 0xD0263, 0x40353, 0x74363, 0xBC373, 0xE0243, 0x143, 0x80003, 0x393, 0xB4123, 0x403A3, 0xEC1E3, 0xF0003, 0xF4003, 0x3E3, 0x123, 0xFC123, 0x100003, 0x413, 0xA00C3, 0x43A3, 0x1083E3, 0xE8353, 0x10C143, 0x1C3, 0x1E3, 0x110263, 0x74353, 0x1101B3, 0x114003, 0x2F3, 0x100123, 0x463, 0x40133, 0x473, 0x54483, 0x18003, 0x90123, 0x493, 0x128113, 0x88003, 0x12C003, 0x1344C3, 0xE8003, 0xE8113, 0x4E3, 0x9C013, 0xB8013, 0x373, 0x1404F3, 0x7C273, 0x7C013, 0x41B3, 0xCC483, 0x7C333, 0x144003, 0xE8013, 0xB8003, 0x4004, 0x524, 0x14C004, 0x154544, 0x158004, 0x574, 0x584, 0x164004, 0x16C5A4, 0x170004, 0x5D4, 0x178004, 0x1805F4, 0x184004, 0x4624, 0x18C004, 0x190004, 0x194004, 0x5F4, 0x664, 0x1A0674, 0x694, 0x1A8004, 0x684, 0x1A05F4, 0x1B06B4, 0x6D4, 0x46E4, 0x1C06F4, 0x714, 0x1CC724, 0x1D05F4, 0x1D4004, 0x17C004, 0x1DC764, 0x1E0004, 0x794, 0x1D8004, 0x1AC004, 0x7A4, 0x1F07B4, 0x7D4, 0x7E4, 0x2007F4, 0x204004, 0x208004, 0x20C004, 0x214844, 0x864, 0x874, 0x884, 0x894, 0x22C8A4, 0x1AC8C4, 0x8D4, 0x2248E4, 0x150004, 0x46D4, 0x2408F4, 0x914, 0x924, 0x934, 0x250004, 0x954, 0x258004, 0x974, 0x264984, 0x21C004, 0x268004, 0x9B4, 0x270004, 0x9D4, 0x278824, 0x27C004, 0x280004, 0x268824, 0x21CA14, 0x288004, 0x28C004, 0xA44, 0x294564, 0x21C524, 0x29CA64, 0xA84, 0x2A4014, 0xAA4, 0xAB4, 0x2B0004, 0xAD4, 0x1DC844, 0x2B86B4, 0x2BC004, 0x14, 0x564, 0x2C0004, 0xB14, 0x6B4, 0x1DC014, 0xAF4, 0x2C8004, 0x47A4, 0xB34, 0x2D0004, 0x2D8005, 0xB75, 0x2E4B85, 0xBA5, 0x2F0BB5, 0xBD5, 0xBE5, 0x300BF5, 0x304005, 0xC25, 0x310C35, 0x318C55, 0xC75, 0x320005, 0xC95, 0x328005, 0xCB5, 0x15, 0xCC5, 0xCD5, 0x33CCE5, 0x4D05, 0x348D15, 0xD35, 0xD45, 0x358D55, 0x360D75, 0x368D95, 0x36C005, 0xDC5, 0x378DD5, 0x37C005, 0xE05, 0x388E15, 0x38C005, 0x390005, 0xE55, 0x3A0005, 0x3A4005, 0x3ACEA5, 0xEC5, 0x3B4005, 0x3BCEE5, 0xF05, 0x3C8F15, 0x3CC005, 0xF45, 0x3D4005, 0xF65, 0x3DC005, 0x2E4005, 0x3E4F85, 0x358FA5, 0x3ECF85, 0x2E4FC5, 0x3F4F85, 0x3F8C85, 0x3FC005, 0x360005, 0x400F85, 0x409015, 0x40CBB5, 0x415045, 0x3E5065, 0x2E4BB5, 0x41CF85, 0x301085, 0x429095, 0x42C005, 0x4350C5, 0x10E5, 0x10F5, 0x440005, 0x449115, 0x451135, 0x459155, 0x45C005, 0x460005, 0x469195, 0x46C005, 0x4B55, 0x2D4006, 0x470006, 0x11D6, 0x47D1E6, 0x485206, 0x48D226, 0x495246, 0x1266, 0x49C006, 0x4A5286, 0x12A6, 0x4AC006, 0x4B0006, 0x12D6, 0x12E6, 0x12F6, 0x1306, 0x1316, 0x1326, 0x4CC006, 0x4D5346, 0x4DD366, 0x4E5386, 0x4ED3A6, 0x4F0006, 0x4F4006, 0x4F8006, 0x5013F6, 0x39CE66, 0x1416, 0x508006, 0x511436, 0x519456, 0x521476, 0x529496, 0x5314B6, 0x5394D6, 0x5414F6, 0x549516, 0x551536, 0x559556, 0x549576, 0x565586, 0x5655A6, 0x5715B6, 0x5795D6, 0x15F6, 0x585606, 0x58D626, 0x595646, 0x1666, 0x5A1676, 0x5A9696, 0x5AC006, 0x56C6, 0x5B4007, 0x5B8007, 0x16F7, 0x5C5707, 0x5CD727, 0x5D5747, 0x5DD767, 0x5E5787, 0x5ED7A7, 0x17C7, 0x17D7, 0x17E7, 0x6017F7, 0x609817, 0x611837, 0x614007, 0x61D867, 0x625887, 0x628007, 0x6318B7, 0x6398D7, 0x6418F7, 0x649917, 0x651937, 0x659957, 0x661977, 0x669997, 0x6719B7, 0x6799D7, 0x6819F7, 0x1A17, 0x1A27, 0x68C007, 0x690008, 0x1A58, 0x69DA68, 0x6A5A88, 0x6A8008, 0x6AC008, 0x6B5AC8, 0x6B8008, 0x6C1AF8, 0x6C9B18, 0x6D1B38, 0x1B58, 0x1B68, 0x6DC008, 0x6E5B88, 0x6EDBA8, 0x6F5BC8, 0x6FDBE8, 0x705C08, 0x70DC28, 0x1C48, 0x1C59, 0x1C69, 0x721C79, 0x1C99, 0x728009, 0x72C009, 0x730009, 0x734009, 0x73DCE9, 0x1D09, 0x749D19, 0x751D39, 0x759D59, 0x761D79, 0x1D99, 0x76DDAA, 0x77000A, 0x1DDA, 0x77800A, 0x1DFA, 0x78000A, 0x789E1A, 0x791E3A, 0x799E5A, 0x7A1E7A, 0x1E9B, 0x7ADEAB, 0x7B000B, 0x7B9EDB, 0x7C1EFB, 0x7C9F1B, 0x1F3C, 0x7D000C, 0x7D9F5C, 0x7E1F7C, 0x1F9D, 0x1FAD, 0x7F1FBD, 0x7F9FDE, 0x7FC00E, 0x80600F, }, + new byte[] { 0x3, 0x4, 0x0, 0x0, 0xA, 0x0, 0x0, 0x0, 0x40, 0x0, 0x10, 0x0, 0x0, 0x21, 0x0, 0x0, 0x1, 0xC0, 0x0, 0x1, 0x80, 0x0, 0x1, 0x40, 0x0, 0x11, 0x0, 0x0, 0x31, 0x80, 0x0, 0x11, 0x80, 0x0, 0x31, 0x0, 0x0, 0x21, 0xC0, 0x0, 0x21, 0x40, 0x0, 0x11, 0xC0, 0x0, 0x31, 0x40, 0x0, 0x42, 0x0, 0x0, 0x52, 0x80, 0x1, 0x52, 0x0, 0x0, 0x72, 0x0, 0x0, 0x2, 0x40, 0x1, 0x82, 0x80, 0x1, 0x92, 0x80, 0x2, 0x62, 0x0, 0x0, 0x2, 0xC0, 0x2, 0xD2, 0x80, 0x3, 0x82, 0xC0, 0x2, 0x2, 0x40, 0x3, 0x2, 0xC0, 0x1, 0xB2, 0x0, 0x0, 0x72, 0x40, 0x0, 0x82, 0x0, 0x0, 0xC2, 0x0, 0x0, 0x12, 0x0, 0x0, 0x2, 0x0, 0x3, 0x72, 0x0, 0x2, 0x2, 0x80, 0x1, 0xE2, 0x40, 0x1, 0x62, 0x40, 0x0, 0x12, 0xC0, 0x3, 0x12, 0x80, 0x2, 0x12, 0x40, 0x3, 0x82, 0x40, 0x0, 0x32, 0xC0, 0x1, 0x72, 0xC0, 0x3, 0x2, 0x40, 0x0, 0x12, 0xC0, 0x2, 0x2, 0x0, 0x1, 0x62, 0x40, 0x3, 0xA2, 0x0, 0x0, 0xF2, 0x40, 0x0, 0x92, 0x40, 0x0, 0xE2, 0x80, 0x0, 0xD2, 0x40, 0x0, 0x2, 0x40, 0x2, 0x2, 0x80, 0x3, 0xB2, 0x40, 0x3, 0x72, 0xC0, 0x2, 0x12, 0x80, 0x3, 0xF2, 0x0, 0x0, 0x2, 0x0, 0x2, 0x62, 0x0, 0x2, 0xE2, 0x0, 0x0, 0xC2, 0x0, 0x1, 0x62, 0x80, 0x3, 0x82, 0xC0, 0x1, 0xA2, 0x40, 0x0, 0x32, 0x0, 0x0, 0x12, 0x40, 0x1, 0x22, 0x0, 0x2, 0x62, 0xC0, 0x2, 0x92, 0x0, 0x0, 0x72, 0x80, 0x2, 0x12, 0x0, 0x2, 0xF2, 0x80, 0x3, 0x52, 0xC0, 0x1, 0x72, 0x40, 0x2, 0xB2, 0x0, 0x3, 0x62, 0x0, 0x1, 0x72, 0x80, 0x3, 0xE2, 0x40, 0x0, 0xF2, 0x0, 0x3, 0x3, 0x1, 0x0, 0x13, 0x81, 0x4, 0x3, 0x0, 0x4, 0x33, 0x1, 0x0, 0x3, 0x0, 0x5, 0x53, 0x81, 0x5, 0x73, 0x1, 0x0, 0x73, 0x1, 0x6, 0x3, 0x0, 0x3, 0x93, 0x1, 0x0, 0x3, 0x80, 0x4, 0x73, 0x80, 0x6, 0x3, 0xC0, 0x6, 0x3, 0x0, 0x7, 0x13, 0x40, 0x7, 0xE3, 0xC1, 0x7, 0xD3, 0x1, 0x7, 0x3, 0xC0, 0x4, 0x73, 0x1, 0x8, 0x83, 0x1, 0x1, 0xF3, 0x1, 0x0, 0xE3, 0x41, 0x8, 0xD3, 0x1, 0x0, 0x23, 0x2, 0x0, 0x33, 0x2, 0x0, 0x3, 0x0, 0x9, 0x13, 0x40, 0x9, 0x63, 0x42, 0x0, 0x73, 0x42, 0x0, 0xC3, 0xC1, 0x5, 0x13, 0x1, 0xA, 0x13, 0x40, 0xA, 0x3, 0x80, 0xA, 0x13, 0x2, 0x0, 0xB3, 0x2, 0x4, 0xC3, 0xC2, 0x8, 0x3, 0x40, 0xB, 0xE3, 0x2, 0x0, 0x3, 0xC0, 0xB, 0x3, 0x43, 0xC, 0x23, 0x43, 0x0, 0x33, 0x83, 0xB, 0x63, 0x2, 0xD, 0x53, 0x3, 0x4, 0x63, 0x43, 0x7, 0x73, 0xC3, 0xB, 0x43, 0x2, 0xE, 0x43, 0x1, 0x0, 0x3, 0x0, 0x8, 0x93, 0x3, 0x0, 0x23, 0x41, 0xB, 0xA3, 0x3, 0x4, 0xE3, 0xC1, 0xE, 0x3, 0x0, 0xF, 0x3, 0x40, 0xF, 0xE3, 0x3, 0x0, 0x23, 0x1, 0x0, 0x23, 0xC1, 0xF, 0x3, 0x0, 0x10, 0x13, 0x4, 0x0, 0xC3, 0x0, 0xA, 0xA3, 0x43, 0x0, 0xE3, 0x83, 0x10, 0x53, 0x83, 0xE, 0x43, 0xC1, 0x10, 0xC3, 0x1, 0x0, 0xE3, 0x1, 0x0, 0x63, 0x2, 0x11, 0x53, 0x43, 0x7, 0xB3, 0x1, 0x11, 0x3, 0x40, 0x11, 0xF3, 0x2, 0x0, 0x23, 0x1, 0x10, 0x63, 0x4, 0x0, 0x33, 0x1, 0x4, 0x73, 0x4, 0x0, 0x83, 0x44, 0x5, 0x3, 0x80, 0x1, 0x23, 0x1, 0x9, 0x93, 0x4, 0x0, 0x13, 0x81, 0x12, 0x3, 0x80, 0x8, 0x3, 0xC0, 0x12, 0xC3, 0x44, 0x13, 0x3, 0x80, 0xE, 0x13, 0x81, 0xE, 0xE3, 0x4, 0x0, 0x13, 0xC0, 0x9, 0x13, 0x80, 0xB, 0x73, 0x3, 0x0, 0xF3, 0x4, 0x14, 0x73, 0xC2, 0x7, 0x13, 0xC0, 0x7, 0xB3, 0x41, 0x0, 0x83, 0xC4, 0xC, 0x33, 0xC3, 0x7, 0x3, 0x40, 0x14, 0x13, 0x80, 0xE, 0x3, 0x80, 0xB, 0x4, 0x40, 0x0, 0x24, 0x5, 0x0, 0x4, 0xC0, 0x14, 0x44, 0x45, 0x15, 0x4, 0x80, 0x15, 0x74, 0x5, 0x0, 0x84, 0x5, 0x0, 0x4, 0x40, 0x16, 0xA4, 0xC5, 0x16, 0x4, 0x0, 0x17, 0xD4, 0x5, 0x0, 0x4, 0x80, 0x17, 0xF4, 0x5, 0x18, 0x4, 0x40, 0x18, 0x24, 0x46, 0x0, 0x4, 0xC0, 0x18, 0x4, 0x0, 0x19, 0x4, 0x40, 0x19, 0xF4, 0x5, 0x0, 0x64, 0x6, 0x0, 0x74, 0x6, 0x1A, 0x94, 0x6, 0x0, 0x4, 0x80, 0x1A, 0x84, 0x6, 0x0, 0xF4, 0x5, 0x1A, 0xB4, 0x6, 0x1B, 0xD4, 0x6, 0x0, 0xE4, 0x46, 0x0, 0xF4, 0x6, 0x1C, 0x14, 0x7, 0x0, 0x24, 0xC7, 0x1C, 0xF4, 0x5, 0x1D, 0x4, 0x40, 0x1D, 0x4, 0xC0, 0x17, 0x64, 0xC7, 0x1D, 0x4, 0x0, 0x1E, 0x94, 0x7, 0x0, 0x4, 0x80, 0x1D, 0x4, 0xC0, 0x1A, 0xA4, 0x7, 0x0, 0xB4, 0x7, 0x1F, 0xD4, 0x7, 0x0, 0xE4, 0x7, 0x0, 0xF4, 0x7, 0x20, 0x4, 0x40, 0x20, 0x4, 0x80, 0x20, 0x4, 0xC0, 0x20, 0x44, 0x48, 0x21, 0x64, 0x8, 0x0, 0x74, 0x8, 0x0, 0x84, 0x8, 0x0, 0x94, 0x8, 0x0, 0xA4, 0xC8, 0x22, 0xC4, 0xC8, 0x1A, 0xD4, 0x8, 0x0, 0xE4, 0x48, 0x22, 0x4, 0x0, 0x15, 0xD4, 0x46, 0x0, 0xF4, 0x8, 0x24, 0x14, 0x9, 0x0, 0x24, 0x9, 0x0, 0x34, 0x9, 0x0, 0x4, 0x0, 0x25, 0x54, 0x9, 0x0, 0x4, 0x80, 0x25, 0x74, 0x9, 0x0, 0x84, 0x49, 0x26, 0x4, 0xC0, 0x21, 0x4, 0x80, 0x26, 0xB4, 0x9, 0x0, 0x4, 0x0, 0x27, 0xD4, 0x9, 0x0, 0x24, 0x88, 0x27, 0x4, 0xC0, 0x27, 0x4, 0x0, 0x28, 0x24, 0x88, 0x26, 0x14, 0xCA, 0x21, 0x4, 0x80, 0x28, 0x4, 0xC0, 0x28, 0x44, 0xA, 0x0, 0x64, 0x45, 0x29, 0x24, 0xC5, 0x21, 0x64, 0xCA, 0x29, 0x84, 0xA, 0x0, 0x14, 0x40, 0x2A, 0xA4, 0xA, 0x0, 0xB4, 0xA, 0x0, 0x4, 0x0, 0x2B, 0xD4, 0xA, 0x0, 0x44, 0xC8, 0x1D, 0xB4, 0x86, 0x2B, 0x4, 0xC0, 0x2B, 0x14, 0x0, 0x0, 0x64, 0x5, 0x0, 0x4, 0x0, 0x2C, 0x14, 0xB, 0x0, 0xB4, 0x6, 0x0, 0x14, 0xC0, 0x1D, 0xF4, 0xA, 0x0, 0x4, 0x80, 0x2C, 0xA4, 0x47, 0x0, 0x34, 0xB, 0x0, 0x4, 0x0, 0x2D, 0x5, 0x80, 0x2D, 0x75, 0xB, 0x0, 0x85, 0x4B, 0x2E, 0xA5, 0xB, 0x0, 0xB5, 0xB, 0x2F, 0xD5, 0xB, 0x0, 0xE5, 0xB, 0x0, 0xF5, 0xB, 0x30, 0x5, 0x40, 0x30, 0x25, 0xC, 0x0, 0x35, 0xC, 0x31, 0x55, 0x8C, 0x31, 0x75, 0xC, 0x0, 0x5, 0x0, 0x32, 0x95, 0xC, 0x0, 0x5, 0x80, 0x32, 0xB5, 0xC, 0x0, 0x15, 0x0, 0x0, 0xC5, 0xC, 0x0, 0xD5, 0xC, 0x0, 0xE5, 0xCC, 0x33, 0x5, 0x4D, 0x0, 0x15, 0x8D, 0x34, 0x35, 0xD, 0x0, 0x45, 0xD, 0x0, 0x55, 0x8D, 0x35, 0x75, 0xD, 0x36, 0x95, 0x8D, 0x36, 0x5, 0xC0, 0x36, 0xC5, 0xD, 0x0, 0xD5, 0x8D, 0x37, 0x5, 0xC0, 0x37, 0x5, 0xE, 0x0, 0x15, 0x8E, 0x38, 0x5, 0xC0, 0x38, 0x5, 0x0, 0x39, 0x55, 0xE, 0x0, 0x5, 0x0, 0x3A, 0x5, 0x40, 0x3A, 0xA5, 0xCE, 0x3A, 0xC5, 0xE, 0x0, 0x5, 0x40, 0x3B, 0xE5, 0xCE, 0x3B, 0x5, 0xF, 0x0, 0x15, 0x8F, 0x3C, 0x5, 0xC0, 0x3C, 0x45, 0xF, 0x0, 0x5, 0x40, 0x3D, 0x65, 0xF, 0x0, 0x5, 0xC0, 0x3D, 0x5, 0x40, 0x2E, 0x85, 0x4F, 0x3E, 0xA5, 0x8F, 0x35, 0x85, 0xCF, 0x3E, 0xC5, 0x4F, 0x2E, 0x85, 0x4F, 0x3F, 0x85, 0x8C, 0x3F, 0x5, 0xC0, 0x3F, 0x5, 0x0, 0x36, 0x85, 0xF, 0x40, 0x15, 0x90, 0x40, 0xB5, 0xCB, 0x40, 0x45, 0x50, 0x41, 0x65, 0x50, 0x3E, 0xB5, 0x4B, 0x2E, 0x85, 0xCF, 0x41, 0x85, 0x10, 0x30, 0x95, 0x90, 0x42, 0x5, 0xC0, 0x42, 0xC5, 0x50, 0x43, 0xE5, 0x10, 0x0, 0xF5, 0x10, 0x0, 0x5, 0x0, 0x44, 0x15, 0x91, 0x44, 0x35, 0x11, 0x45, 0x55, 0x91, 0x45, 0x5, 0xC0, 0x45, 0x5, 0x0, 0x46, 0x95, 0x91, 0x46, 0x5, 0xC0, 0x46, 0x55, 0x4B, 0x0, 0x6, 0x40, 0x2D, 0x6, 0x0, 0x47, 0xD6, 0x11, 0x0, 0xE6, 0xD1, 0x47, 0x6, 0x52, 0x48, 0x26, 0xD2, 0x48, 0x46, 0x52, 0x49, 0x66, 0x12, 0x0, 0x6, 0xC0, 0x49, 0x86, 0x52, 0x4A, 0xA6, 0x12, 0x0, 0x6, 0xC0, 0x4A, 0x6, 0x0, 0x4B, 0xD6, 0x12, 0x0, 0xE6, 0x12, 0x0, 0xF6, 0x12, 0x0, 0x6, 0x13, 0x0, 0x16, 0x13, 0x0, 0x26, 0x13, 0x0, 0x6, 0xC0, 0x4C, 0x46, 0x53, 0x4D, 0x66, 0xD3, 0x4D, 0x86, 0x53, 0x4E, 0xA6, 0xD3, 0x4E, 0x6, 0x0, 0x4F, 0x6, 0x40, 0x4F, 0x6, 0x80, 0x4F, 0xF6, 0x13, 0x50, 0x66, 0xCE, 0x39, 0x16, 0x14, 0x0, 0x6, 0x80, 0x50, 0x36, 0x14, 0x51, 0x56, 0x94, 0x51, 0x76, 0x14, 0x52, 0x96, 0x94, 0x52, 0xB6, 0x14, 0x53, 0xD6, 0x94, 0x53, 0xF6, 0x14, 0x54, 0x16, 0x95, 0x54, 0x36, 0x15, 0x55, 0x56, 0x95, 0x55, 0x76, 0x95, 0x54, 0x86, 0x55, 0x56, 0xA6, 0x55, 0x56, 0xB6, 0x15, 0x57, 0xD6, 0x95, 0x57, 0xF6, 0x15, 0x0, 0x6, 0x56, 0x58, 0x26, 0xD6, 0x58, 0x46, 0x56, 0x59, 0x66, 0x16, 0x0, 0x76, 0x16, 0x5A, 0x96, 0x96, 0x5A, 0x6, 0xC0, 0x5A, 0xC6, 0x56, 0x0, 0x7, 0x40, 0x5B, 0x7, 0x80, 0x5B, 0xF7, 0x16, 0x0, 0x7, 0x57, 0x5C, 0x27, 0xD7, 0x5C, 0x47, 0x57, 0x5D, 0x67, 0xD7, 0x5D, 0x87, 0x57, 0x5E, 0xA7, 0xD7, 0x5E, 0xC7, 0x17, 0x0, 0xD7, 0x17, 0x0, 0xE7, 0x17, 0x0, 0xF7, 0x17, 0x60, 0x17, 0x98, 0x60, 0x37, 0x18, 0x61, 0x7, 0x40, 0x61, 0x67, 0xD8, 0x61, 0x87, 0x58, 0x62, 0x7, 0x80, 0x62, 0xB7, 0x18, 0x63, 0xD7, 0x98, 0x63, 0xF7, 0x18, 0x64, 0x17, 0x99, 0x64, 0x37, 0x19, 0x65, 0x57, 0x99, 0x65, 0x77, 0x19, 0x66, 0x97, 0x99, 0x66, 0xB7, 0x19, 0x67, 0xD7, 0x99, 0x67, 0xF7, 0x19, 0x68, 0x17, 0x1A, 0x0, 0x27, 0x1A, 0x0, 0x7, 0xC0, 0x68, 0x8, 0x0, 0x69, 0x58, 0x1A, 0x0, 0x68, 0xDA, 0x69, 0x88, 0x5A, 0x6A, 0x8, 0x80, 0x6A, 0x8, 0xC0, 0x6A, 0xC8, 0x5A, 0x6B, 0x8, 0x80, 0x6B, 0xF8, 0x1A, 0x6C, 0x18, 0x9B, 0x6C, 0x38, 0x1B, 0x6D, 0x58, 0x1B, 0x0, 0x68, 0x1B, 0x0, 0x8, 0xC0, 0x6D, 0x88, 0x5B, 0x6E, 0xA8, 0xDB, 0x6E, 0xC8, 0x5B, 0x6F, 0xE8, 0xDB, 0x6F, 0x8, 0x5C, 0x70, 0x28, 0xDC, 0x70, 0x48, 0x1C, 0x0, 0x59, 0x1C, 0x0, 0x69, 0x1C, 0x0, 0x79, 0x1C, 0x72, 0x99, 0x1C, 0x0, 0x9, 0x80, 0x72, 0x9, 0xC0, 0x72, 0x9, 0x0, 0x73, 0x9, 0x40, 0x73, 0xE9, 0xDC, 0x73, 0x9, 0x1D, 0x0, 0x19, 0x9D, 0x74, 0x39, 0x1D, 0x75, 0x59, 0x9D, 0x75, 0x79, 0x1D, 0x76, 0x99, 0x1D, 0x0, 0xAA, 0xDD, 0x76, 0xA, 0x0, 0x77, 0xDA, 0x1D, 0x0, 0xA, 0x80, 0x77, 0xFA, 0x1D, 0x0, 0xA, 0x0, 0x78, 0x1A, 0x9E, 0x78, 0x3A, 0x1E, 0x79, 0x5A, 0x9E, 0x79, 0x7A, 0x1E, 0x7A, 0x9B, 0x1E, 0x0, 0xAB, 0xDE, 0x7A, 0xB, 0x0, 0x7B, 0xDB, 0x9E, 0x7B, 0xFB, 0x1E, 0x7C, 0x1B, 0x9F, 0x7C, 0x3C, 0x1F, 0x0, 0xC, 0x0, 0x7D, 0x5C, 0x9F, 0x7D, 0x7C, 0x1F, 0x7E, 0x9D, 0x1F, 0x0, 0xAD, 0x1F, 0x0, 0xBD, 0x1F, 0x7F, 0xDE, 0x9F, 0x7F, 0xE, 0xC0, 0x7F, 0xF, 0x60, 0x80, }, // SpacingCombiningMark(6): - new long[] { 0x4, 0x9, 0x2000, 0x10, 0x4001, 0x6021, 0x4011, 0x31, 0x6001, 0x11, 0x4031, 0x2001, 0x21, 0x2031, 0x6011, 0x2021, 0xA042, 0xE062, 0x82, 0xE092, 0xE082, 0x14042, 0x72, 0x8002, 0xB2, 0xE002, 0x12002, 0x2002, 0x12, 0x16002, 0xE0A2, 0x92, 0x10002, 0x12022, 0x18002, 0x10092, 0x1A042, 0xE0E2, 0x42, 0x1E002, 0xE2, 0x6042, 0x32, 0xA002, 0x1A012, 0x1C002, 0xE0F2, 0x20D2, 0xC2, 0x12042, 0x20A2, 0x20B2, 0x120A2, 0xE042, 0xC042, 0x8092, 0x52, 0xC002, 0x1C042, 0xA092, 0x8072, 0x1C062, 0x22103, 0x24003, 0x133, 0x143, 0x123, 0x2A003, 0x163, 0x2E003, 0x30093, 0x32003, 0x34003, 0x36003, 0x38013, 0x3A003, 0x3C003, 0x1F3, 0x2C003, 0x40003, 0x30003, 0x381B3, 0x2C213, 0x46223, 0x44003, 0x48003, 0x24253, 0x4C003, 0x4E003, 0x52283, 0x54003, 0x2B3, 0x58173, 0x5C2D3, 0x5E173, 0x601F3, 0x313, 0x3C323, 0x68333, 0x3E003, 0x40153, 0x353, 0x3A013, 0x6E363, 0x70003, 0x64393, 0x303, 0x74003, 0x5A003, 0x76363, 0x78153, 0x2E293, 0x2E3D3, 0x7C004, 0x803F4, 0x414, 0x84004, 0x88434, 0x8A004, 0x464, 0x8E004, 0x484, 0x92004, 0x4A4, 0x96004, 0x98004, 0x9A004, 0x9E4E4, 0xA2504, 0xA4484, 0xA6004, 0xA8004, 0xAA004, 0x564, 0xAE004, 0xB2584, 0x5A4, 0x5B4, 0xBA5C4, 0xBC004, 0x5F4, 0xC2604, 0xC4004, 0x634, 0xCA644, 0x444, 0x4D4, 0x88664, 0x90004, 0xCE4E4, 0xD2684, 0x6A4, 0xD6004, 0xD8004, 0xDA4E4, 0xDC4E4, 0xDE004, 0xE0004, 0x404, 0x715, 0x725, 0xE8735, 0x755, 0xEC005, 0xF0775, 0xF2005, 0xF4005, 0xF87B5, 0x7D5, 0x7E5, 0x7F5, 0x805, 0x815, 0x106825, 0x108005, 0x10C855, 0x110875, 0x112005, 0x8A5, 0x116005, 0x8C5, 0x11A005, 0x11E8E5, 0x905, 0x915, 0x925, 0x126795, 0x128005, 0x12A005, 0x128925, 0x12C005, 0x128975, 0x130005, 0x132005, 0x134005, 0x136005, 0x138005, 0xF0925, 0x13A005, 0xF09E5, 0x9F6, 0xA06, 0x144A16, 0x148A36, 0xA56, 0x14EA66, 0x150006, 0x152006, 0xAA6, 0x156006, 0x15AAC6, 0x15EAE6, 0x162B06, 0x164006, 0x168B36, 0x16A006, 0x16EB66, 0x172B86, 0x176BA6, 0x17ABC6, 0x17EBE6, 0x182C06, 0x172C26, 0x17EC36, 0x18AC46, 0x18AA36, 0x17AC36, 0x18EC66, 0xC87, 0x194C97, 0x198CB7, 0x19CCD7, 0x19E007, 0x1A2D07, 0x1A6D27, 0x1A8007, 0x1AA007, 0xD67, 0x1B0D77, 0x1B2007, 0x1B6DA7, 0x1BADC7, 0x1BEDE7, 0x1C2E07, 0x1C6E27, 0x1CAE48, 0x1CEE68, 0x1D0008, 0x1D2008, 0x1D6EA8, 0xEC8, 0xED8, 0x1DC008, 0xEF8, 0x1E2F08, 0x1E6F28, 0xF48, 0x1ECF59, 0x1EE009, 0x1F0009, 0x1F4F99, 0xFB9, 0x1F8009, 0x1FCFD9, 0x200FF9, 0x20200A, 0x20400A, 0x20903A, 0x20D05A, 0x21107A, 0x109B, 0x21400B, 0x2190BB, 0x10DB, 0x21C00C, 0x10FC, 0x22310C, 0x112D, 0x22913D, 0x22A00E, 0x22C00E, 0x23117F, }, + new byte[] { 0x3, 0x4, 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0x20, 0x0, 0x10, 0x0, 0x0, 0x1, 0x40, 0x0, 0x21, 0x60, 0x0, 0x11, 0x40, 0x0, 0x31, 0x0, 0x0, 0x1, 0x60, 0x0, 0x11, 0x0, 0x0, 0x31, 0x40, 0x0, 0x1, 0x20, 0x0, 0x21, 0x0, 0x0, 0x31, 0x20, 0x0, 0x11, 0x60, 0x0, 0x21, 0x20, 0x0, 0x42, 0xA0, 0x0, 0x62, 0xE0, 0x0, 0x82, 0x0, 0x0, 0x92, 0xE0, 0x0, 0x82, 0xE0, 0x0, 0x42, 0x40, 0x1, 0x72, 0x0, 0x0, 0x2, 0x80, 0x0, 0xB2, 0x0, 0x0, 0x2, 0xE0, 0x0, 0x2, 0x20, 0x1, 0x2, 0x20, 0x0, 0x12, 0x0, 0x0, 0x2, 0x60, 0x1, 0xA2, 0xE0, 0x0, 0x92, 0x0, 0x0, 0x2, 0x0, 0x1, 0x22, 0x20, 0x1, 0x2, 0x80, 0x1, 0x92, 0x0, 0x1, 0x42, 0xA0, 0x1, 0xE2, 0xE0, 0x0, 0x42, 0x0, 0x0, 0x2, 0xE0, 0x1, 0xE2, 0x0, 0x0, 0x42, 0x60, 0x0, 0x32, 0x0, 0x0, 0x2, 0xA0, 0x0, 0x12, 0xA0, 0x1, 0x2, 0xC0, 0x1, 0xF2, 0xE0, 0x0, 0xD2, 0x20, 0x0, 0xC2, 0x0, 0x0, 0x42, 0x20, 0x1, 0xA2, 0x20, 0x0, 0xB2, 0x20, 0x0, 0xA2, 0x20, 0x1, 0x42, 0xE0, 0x0, 0x42, 0xC0, 0x0, 0x92, 0x80, 0x0, 0x52, 0x0, 0x0, 0x2, 0xC0, 0x0, 0x42, 0xC0, 0x1, 0x92, 0xA0, 0x0, 0x72, 0x80, 0x0, 0x62, 0xC0, 0x1, 0x3, 0x21, 0x2, 0x3, 0x40, 0x2, 0x33, 0x1, 0x0, 0x43, 0x1, 0x0, 0x23, 0x1, 0x0, 0x3, 0xA0, 0x2, 0x63, 0x1, 0x0, 0x3, 0xE0, 0x2, 0x93, 0x0, 0x3, 0x3, 0x20, 0x3, 0x3, 0x40, 0x3, 0x3, 0x60, 0x3, 0x13, 0x80, 0x3, 0x3, 0xA0, 0x3, 0x3, 0xC0, 0x3, 0xF3, 0x1, 0x0, 0x3, 0xC0, 0x2, 0x3, 0x0, 0x4, 0x3, 0x0, 0x3, 0xB3, 0x81, 0x3, 0x13, 0xC2, 0x2, 0x23, 0x62, 0x4, 0x3, 0x40, 0x4, 0x3, 0x80, 0x4, 0x53, 0x42, 0x2, 0x3, 0xC0, 0x4, 0x3, 0xE0, 0x4, 0x83, 0x22, 0x5, 0x3, 0x40, 0x5, 0xB3, 0x2, 0x0, 0x73, 0x81, 0x5, 0xD3, 0xC2, 0x5, 0x73, 0xE1, 0x5, 0xF3, 0x1, 0x6, 0x13, 0x3, 0x0, 0x23, 0xC3, 0x3, 0x33, 0x83, 0x6, 0x3, 0xE0, 0x3, 0x53, 0x1, 0x4, 0x53, 0x3, 0x0, 0x13, 0xA0, 0x3, 0x63, 0xE3, 0x6, 0x3, 0x0, 0x7, 0x93, 0x43, 0x6, 0x3, 0x3, 0x0, 0x3, 0x40, 0x7, 0x3, 0xA0, 0x5, 0x63, 0x63, 0x7, 0x53, 0x81, 0x7, 0x93, 0xE2, 0x2, 0xD3, 0xE3, 0x2, 0x4, 0xC0, 0x7, 0xF4, 0x3, 0x8, 0x14, 0x4, 0x0, 0x4, 0x40, 0x8, 0x34, 0x84, 0x8, 0x4, 0xA0, 0x8, 0x64, 0x4, 0x0, 0x4, 0xE0, 0x8, 0x84, 0x4, 0x0, 0x4, 0x20, 0x9, 0xA4, 0x4, 0x0, 0x4, 0x60, 0x9, 0x4, 0x80, 0x9, 0x4, 0xA0, 0x9, 0xE4, 0xE4, 0x9, 0x4, 0x25, 0xA, 0x84, 0x44, 0xA, 0x4, 0x60, 0xA, 0x4, 0x80, 0xA, 0x4, 0xA0, 0xA, 0x64, 0x5, 0x0, 0x4, 0xE0, 0xA, 0x84, 0x25, 0xB, 0xA4, 0x5, 0x0, 0xB4, 0x5, 0x0, 0xC4, 0xA5, 0xB, 0x4, 0xC0, 0xB, 0xF4, 0x5, 0x0, 0x4, 0x26, 0xC, 0x4, 0x40, 0xC, 0x34, 0x6, 0x0, 0x44, 0xA6, 0xC, 0x44, 0x4, 0x0, 0xD4, 0x4, 0x0, 0x64, 0x86, 0x8, 0x4, 0x0, 0x9, 0xE4, 0xE4, 0xC, 0x84, 0x26, 0xD, 0xA4, 0x6, 0x0, 0x4, 0x60, 0xD, 0x4, 0x80, 0xD, 0xE4, 0xA4, 0xD, 0xE4, 0xC4, 0xD, 0x4, 0xE0, 0xD, 0x4, 0x0, 0xE, 0x4, 0x4, 0x0, 0x15, 0x7, 0x0, 0x25, 0x7, 0x0, 0x35, 0x87, 0xE, 0x55, 0x7, 0x0, 0x5, 0xC0, 0xE, 0x75, 0x7, 0xF, 0x5, 0x20, 0xF, 0x5, 0x40, 0xF, 0xB5, 0x87, 0xF, 0xD5, 0x7, 0x0, 0xE5, 0x7, 0x0, 0xF5, 0x7, 0x0, 0x5, 0x8, 0x0, 0x15, 0x8, 0x0, 0x25, 0x68, 0x10, 0x5, 0x80, 0x10, 0x55, 0xC8, 0x10, 0x75, 0x8, 0x11, 0x5, 0x20, 0x11, 0xA5, 0x8, 0x0, 0x5, 0x60, 0x11, 0xC5, 0x8, 0x0, 0x5, 0xA0, 0x11, 0xE5, 0xE8, 0x11, 0x5, 0x9, 0x0, 0x15, 0x9, 0x0, 0x25, 0x9, 0x0, 0x95, 0x67, 0x12, 0x5, 0x80, 0x12, 0x5, 0xA0, 0x12, 0x25, 0x89, 0x12, 0x5, 0xC0, 0x12, 0x75, 0x89, 0x12, 0x5, 0x0, 0x13, 0x5, 0x20, 0x13, 0x5, 0x40, 0x13, 0x5, 0x60, 0x13, 0x5, 0x80, 0x13, 0x25, 0x9, 0xF, 0x5, 0xA0, 0x13, 0xE5, 0x9, 0xF, 0xF6, 0x9, 0x0, 0x6, 0xA, 0x0, 0x16, 0x4A, 0x14, 0x36, 0x8A, 0x14, 0x56, 0xA, 0x0, 0x66, 0xEA, 0x14, 0x6, 0x0, 0x15, 0x6, 0x20, 0x15, 0xA6, 0xA, 0x0, 0x6, 0x60, 0x15, 0xC6, 0xAA, 0x15, 0xE6, 0xEA, 0x15, 0x6, 0x2B, 0x16, 0x6, 0x40, 0x16, 0x36, 0x8B, 0x16, 0x6, 0xA0, 0x16, 0x66, 0xEB, 0x16, 0x86, 0x2B, 0x17, 0xA6, 0x6B, 0x17, 0xC6, 0xAB, 0x17, 0xE6, 0xEB, 0x17, 0x6, 0x2C, 0x18, 0x26, 0x2C, 0x17, 0x36, 0xEC, 0x17, 0x46, 0xAC, 0x18, 0x36, 0xAA, 0x18, 0x36, 0xAC, 0x17, 0x66, 0xEC, 0x18, 0x87, 0xC, 0x0, 0x97, 0x4C, 0x19, 0xB7, 0x8C, 0x19, 0xD7, 0xCC, 0x19, 0x7, 0xE0, 0x19, 0x7, 0x2D, 0x1A, 0x27, 0x6D, 0x1A, 0x7, 0x80, 0x1A, 0x7, 0xA0, 0x1A, 0x67, 0xD, 0x0, 0x77, 0xD, 0x1B, 0x7, 0x20, 0x1B, 0xA7, 0x6D, 0x1B, 0xC7, 0xAD, 0x1B, 0xE7, 0xED, 0x1B, 0x7, 0x2E, 0x1C, 0x27, 0x6E, 0x1C, 0x48, 0xAE, 0x1C, 0x68, 0xEE, 0x1C, 0x8, 0x0, 0x1D, 0x8, 0x20, 0x1D, 0xA8, 0x6E, 0x1D, 0xC8, 0xE, 0x0, 0xD8, 0xE, 0x0, 0x8, 0xC0, 0x1D, 0xF8, 0xE, 0x0, 0x8, 0x2F, 0x1E, 0x28, 0x6F, 0x1E, 0x48, 0xF, 0x0, 0x59, 0xCF, 0x1E, 0x9, 0xE0, 0x1E, 0x9, 0x0, 0x1F, 0x99, 0x4F, 0x1F, 0xB9, 0xF, 0x0, 0x9, 0x80, 0x1F, 0xD9, 0xCF, 0x1F, 0xF9, 0xF, 0x20, 0xA, 0x20, 0x20, 0xA, 0x40, 0x20, 0x3A, 0x90, 0x20, 0x5A, 0xD0, 0x20, 0x7A, 0x10, 0x21, 0x9B, 0x10, 0x0, 0xB, 0x40, 0x21, 0xBB, 0x90, 0x21, 0xDB, 0x10, 0x0, 0xC, 0xC0, 0x21, 0xFC, 0x10, 0x0, 0xC, 0x31, 0x22, 0x2D, 0x11, 0x0, 0x3D, 0x91, 0x22, 0xE, 0xA0, 0x22, 0xE, 0xC0, 0x22, 0x7F, 0x11, 0x23, }, // EnclosingMark(7): - new long[] { 0x4, 0x6, 0x400, 0x10, 0x421, 0x801, 0x811, 0xC11, 0x21, 0x401, 0x1002, 0x1852, 0x72, 0x82, 0x2402, 0x2803, 0x2C03, 0xC3, 0xD3, 0xE3, 0xF4, 0x4004, 0x114, 0x124, 0x4C04, 0x145, 0x5955, 0x175, 0x6005, 0x196, 0x1A6, 0x6C06, 0x7006, 0x7407, 0x1E7, 0x1F7, 0x207, 0x8408, 0x8808, 0x8C08, 0x9008, 0x259, 0x9809, 0x279, 0xA009, 0x29A, 0xA80A, 0xAC0A, 0x2CA, 0xB40B, 0xB80B, 0x2FB, 0xC00B, 0xC40C, 0xC80C, 0xD33C, 0x35D, 0xDF6D, 0xE00E, 0xE40E, 0xEFAF, }, + new byte[] { 0x2, 0x4, 0x0, 0x6, 0x0, 0x0, 0x4, 0x10, 0x0, 0x21, 0x4, 0x1, 0x8, 0x11, 0x8, 0x11, 0xC, 0x21, 0x0, 0x1, 0x4, 0x2, 0x10, 0x52, 0x18, 0x72, 0x0, 0x82, 0x0, 0x2, 0x24, 0x3, 0x28, 0x3, 0x2C, 0xC3, 0x0, 0xD3, 0x0, 0xE3, 0x0, 0xF4, 0x0, 0x4, 0x40, 0x14, 0x1, 0x24, 0x1, 0x4, 0x4C, 0x45, 0x1, 0x55, 0x59, 0x75, 0x1, 0x5, 0x60, 0x96, 0x1, 0xA6, 0x1, 0x6, 0x6C, 0x6, 0x70, 0x7, 0x74, 0xE7, 0x1, 0xF7, 0x1, 0x7, 0x2, 0x8, 0x84, 0x8, 0x88, 0x8, 0x8C, 0x8, 0x90, 0x59, 0x2, 0x9, 0x98, 0x79, 0x2, 0x9, 0xA0, 0x9A, 0x2, 0xA, 0xA8, 0xA, 0xAC, 0xCA, 0x2, 0xB, 0xB4, 0xB, 0xB8, 0xFB, 0x2, 0xB, 0xC0, 0xC, 0xC4, 0xC, 0xC8, 0x3C, 0xD3, 0x5D, 0x3, 0x6D, 0xDF, 0xE, 0xE0, 0xE, 0xE4, 0xAF, 0xEF, }, // DecimalDigitNumber(8): - new long[] { 0x4, 0x7, 0x801, 0x11, 0x1002, 0x32, 0x843, 0x2813, 0x64, 0x3004, 0x3804, 0x4005, 0x85, 0x4805, 0x95, 0x3005, 0x5005, 0xA5, 0x5806, 0xC6, 0xB6, 0x86, 0x6806, 0x7006, 0xF6, 0x6006, 0x7806, 0x106, 0xE6, 0xD6, 0x116, 0x9007, 0x137, 0xA007, 0xB157, 0x147, 0xB807, 0xC007, 0xA197, 0x1A7, 0xD947, 0x1C7, 0xE927, 0x1D7, 0xE137, 0xC807, 0x1F8, 0x10A08, 0x11A28, 0x12008, 0x12808, 0x13A68, 0xFA88, 0x298, 0x15008, 0xA248, 0x1E8, 0x162B8, 0x16808, 0x2E9, 0x182F9, 0x319, 0x19009, 0x1A339, 0x359, 0x1B009, 0xF379, 0x1C1E9, 0x399, 0x1D009, 0x3BA, 0x1E00A, 0x3DA, 0x1FBEA, 0x20C0A, 0x21C2A, 0x22C4A, 0x46B, 0x2447B, 0x2549B, 0x264BB, 0x4DC, 0x2700C, 0x284FC, 0x51D, 0x52D, 0x2980D, 0x2AD4E, 0x2B00E, 0x2C57F, }, + new byte[] { 0x3, 0x4, 0x0, 0x0, 0x7, 0x0, 0x0, 0x1, 0x8, 0x0, 0x11, 0x0, 0x0, 0x2, 0x10, 0x0, 0x32, 0x0, 0x0, 0x43, 0x8, 0x0, 0x13, 0x28, 0x0, 0x64, 0x0, 0x0, 0x4, 0x30, 0x0, 0x4, 0x38, 0x0, 0x5, 0x40, 0x0, 0x85, 0x0, 0x0, 0x5, 0x48, 0x0, 0x95, 0x0, 0x0, 0x5, 0x30, 0x0, 0x5, 0x50, 0x0, 0xA5, 0x0, 0x0, 0x6, 0x58, 0x0, 0xC6, 0x0, 0x0, 0xB6, 0x0, 0x0, 0x86, 0x0, 0x0, 0x6, 0x68, 0x0, 0x6, 0x70, 0x0, 0xF6, 0x0, 0x0, 0x6, 0x60, 0x0, 0x6, 0x78, 0x0, 0x6, 0x1, 0x0, 0xE6, 0x0, 0x0, 0xD6, 0x0, 0x0, 0x16, 0x1, 0x0, 0x7, 0x90, 0x0, 0x37, 0x1, 0x0, 0x7, 0xA0, 0x0, 0x57, 0xB1, 0x0, 0x47, 0x1, 0x0, 0x7, 0xB8, 0x0, 0x7, 0xC0, 0x0, 0x97, 0xA1, 0x0, 0xA7, 0x1, 0x0, 0x47, 0xD9, 0x0, 0xC7, 0x1, 0x0, 0x27, 0xE9, 0x0, 0xD7, 0x1, 0x0, 0x37, 0xE1, 0x0, 0x7, 0xC8, 0x0, 0xF8, 0x1, 0x0, 0x8, 0xA, 0x1, 0x28, 0x1A, 0x1, 0x8, 0x20, 0x1, 0x8, 0x28, 0x1, 0x68, 0x3A, 0x1, 0x88, 0xFA, 0x0, 0x98, 0x2, 0x0, 0x8, 0x50, 0x1, 0x48, 0xA2, 0x0, 0xE8, 0x1, 0x0, 0xB8, 0x62, 0x1, 0x8, 0x68, 0x1, 0xE9, 0x2, 0x0, 0xF9, 0x82, 0x1, 0x19, 0x3, 0x0, 0x9, 0x90, 0x1, 0x39, 0xA3, 0x1, 0x59, 0x3, 0x0, 0x9, 0xB0, 0x1, 0x79, 0xF3, 0x0, 0xE9, 0xC1, 0x1, 0x99, 0x3, 0x0, 0x9, 0xD0, 0x1, 0xBA, 0x3, 0x0, 0xA, 0xE0, 0x1, 0xDA, 0x3, 0x0, 0xEA, 0xFB, 0x1, 0xA, 0xC, 0x2, 0x2A, 0x1C, 0x2, 0x4A, 0x2C, 0x2, 0x6B, 0x4, 0x0, 0x7B, 0x44, 0x2, 0x9B, 0x54, 0x2, 0xBB, 0x64, 0x2, 0xDC, 0x4, 0x0, 0xC, 0x70, 0x2, 0xFC, 0x84, 0x2, 0x1D, 0x5, 0x0, 0x2D, 0x5, 0x0, 0xD, 0x98, 0x2, 0x4E, 0xAD, 0x2, 0xE, 0xB0, 0x2, 0x7F, 0xC5, 0x2, }, // LetterNumber(9): - new long[] { 0x4, 0x7, 0x800, 0x10, 0x11, 0x821, 0x801, 0x1811, 0x31, 0x1001, 0x42, 0x2802, 0x3002, 0x3812, 0x82, 0x4802, 0x2872, 0x5013, 0xB3, 0x68C3, 0x7003, 0x80F3, 0x7803, 0xA3, 0x8804, 0x9924, 0xA004, 0xA804, 0xB964, 0x185, 0xD195, 0xD805, 0x15, 0x1C5, 0x1D6, 0xF006, 0xF806, 0x206, 0x216, 0x227, 0x11807, 0x12A47, 0x267, 0x13808, 0x14008, 0x298, 0x15008, 0x2B9, 0x16009, 0x16809, 0x2E9, 0x2FA, 0x1800A, 0x1880A, 0x32A, 0x1980B, 0x1A00B, 0x1A80B, 0x1B00B, 0x1B80C, 0x1CB8C, 0x3AC, 0x3BD, 0x1EBCD, 0x1F00E, 0x1F80E, 0x20C0F, }, + new byte[] { 0x3, 0x4, 0x0, 0x0, 0x7, 0x0, 0x0, 0x0, 0x8, 0x0, 0x10, 0x0, 0x0, 0x11, 0x0, 0x0, 0x21, 0x8, 0x0, 0x1, 0x8, 0x0, 0x11, 0x18, 0x0, 0x31, 0x0, 0x0, 0x1, 0x10, 0x0, 0x42, 0x0, 0x0, 0x2, 0x28, 0x0, 0x2, 0x30, 0x0, 0x12, 0x38, 0x0, 0x82, 0x0, 0x0, 0x2, 0x48, 0x0, 0x72, 0x28, 0x0, 0x13, 0x50, 0x0, 0xB3, 0x0, 0x0, 0xC3, 0x68, 0x0, 0x3, 0x70, 0x0, 0xF3, 0x80, 0x0, 0x3, 0x78, 0x0, 0xA3, 0x0, 0x0, 0x4, 0x88, 0x0, 0x24, 0x99, 0x0, 0x4, 0xA0, 0x0, 0x4, 0xA8, 0x0, 0x64, 0xB9, 0x0, 0x85, 0x1, 0x0, 0x95, 0xD1, 0x0, 0x5, 0xD8, 0x0, 0x15, 0x0, 0x0, 0xC5, 0x1, 0x0, 0xD6, 0x1, 0x0, 0x6, 0xF0, 0x0, 0x6, 0xF8, 0x0, 0x6, 0x2, 0x0, 0x16, 0x2, 0x0, 0x27, 0x2, 0x0, 0x7, 0x18, 0x1, 0x47, 0x2A, 0x1, 0x67, 0x2, 0x0, 0x8, 0x38, 0x1, 0x8, 0x40, 0x1, 0x98, 0x2, 0x0, 0x8, 0x50, 0x1, 0xB9, 0x2, 0x0, 0x9, 0x60, 0x1, 0x9, 0x68, 0x1, 0xE9, 0x2, 0x0, 0xFA, 0x2, 0x0, 0xA, 0x80, 0x1, 0xA, 0x88, 0x1, 0x2A, 0x3, 0x0, 0xB, 0x98, 0x1, 0xB, 0xA0, 0x1, 0xB, 0xA8, 0x1, 0xB, 0xB0, 0x1, 0xC, 0xB8, 0x1, 0x8C, 0xCB, 0x1, 0xAC, 0x3, 0x0, 0xBD, 0x3, 0x0, 0xCD, 0xEB, 0x1, 0xE, 0xF0, 0x1, 0xE, 0xF8, 0x1, 0xF, 0xC, 0x2, }, // OtherNumber(10): - new long[] { 0x4, 0x8, 0x10, 0x1000, 0x1001, 0x2011, 0x11, 0x2001, 0x3001, 0x31, 0x1031, 0x1042, 0x5012, 0x4002, 0x6042, 0x72, 0x1002, 0x62, 0x6012, 0x7002, 0x8012, 0x9002, 0x1082, 0x8002, 0x10A2, 0xA002, 0x12, 0x70A2, 0x6002, 0xB003, 0xC013, 0x10D3, 0x13, 0xE003, 0xF3, 0x10003, 0x11013, 0x123, 0x1103, 0x133, 0x140D3, 0x153, 0x1163, 0xC3, 0x1173, 0x183, 0x19003, 0x12003, 0x1A0D3, 0x1C1B3, 0x1D4, 0x1E4, 0x1F004, 0x201E4, 0x214, 0x224, 0x1234, 0x244, 0x25014, 0x1264, 0x27004, 0x14, 0x284, 0x294, 0x1F4, 0x2B2A4, 0x25234, 0x2C4, 0x2D4, 0x2E4, 0x2F4, 0x304, 0x314, 0x325, 0x34335, 0x35005, 0x345, 0x36005, 0x375, 0x38005, 0x395, 0x3A5, 0x3B005, 0x15, 0x3C005, 0x3D005, 0x34005, 0x3E5, 0x3F005, 0x405, 0x415, 0x425, 0x44435, 0x445, 0x455, 0x465, 0x475, 0x485, 0x49006, 0x4A006, 0x4C4B6, 0x4D006, 0x4E6, 0x4F006, 0x506, 0x52516, 0x536, 0x54006, 0x556, 0x56006, 0x576, 0x586, 0x596, 0x5A6, 0x5B006, 0x5C6, 0x5D6, 0x5E6, 0x5F6, 0x606, 0x61006, 0x62007, 0x64637, 0x657, 0x667, 0x68677, 0x6A697, 0x6C6B7, 0x6E6D7, 0x6F7, 0x707, 0x71007, 0x72007, 0x73007, 0x74007, 0x76757, 0x777, 0x787, 0x79008, 0x7A008, 0x7B8, 0x7C008, 0x7D8, 0x7E008, 0x807F8, 0x818, 0x828, 0x838, 0x848, 0x86858, 0x878, 0x888, 0x89008, 0x8A009, 0x8C8B9, 0x8D009, 0x8F8E9, 0x90009, 0x91009, 0x929, 0x939, 0x95949, 0x97969, 0x98009, 0x9900A, 0x9A00A, 0x9BA, 0x9D9CA, 0x9E00A, 0xA09FA, 0xA2A1A, 0xA300A, 0xA4B, 0xA500B, 0xA7A6B, 0xA9A8B, 0xABAAB, 0xAC00C, 0xAEADC, 0xB0AFC, 0xB1D, 0xB3B2D, 0xB400E, 0xB500E, 0xB7B6F, }, + new byte[] { 0x3, 0x4, 0x0, 0x0, 0x8, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x0, 0x1, 0x10, 0x0, 0x11, 0x20, 0x0, 0x11, 0x0, 0x0, 0x1, 0x20, 0x0, 0x1, 0x30, 0x0, 0x31, 0x0, 0x0, 0x31, 0x10, 0x0, 0x42, 0x10, 0x0, 0x12, 0x50, 0x0, 0x2, 0x40, 0x0, 0x42, 0x60, 0x0, 0x72, 0x0, 0x0, 0x2, 0x10, 0x0, 0x62, 0x0, 0x0, 0x12, 0x60, 0x0, 0x2, 0x70, 0x0, 0x12, 0x80, 0x0, 0x2, 0x90, 0x0, 0x82, 0x10, 0x0, 0x2, 0x80, 0x0, 0xA2, 0x10, 0x0, 0x2, 0xA0, 0x0, 0x12, 0x0, 0x0, 0xA2, 0x70, 0x0, 0x2, 0x60, 0x0, 0x3, 0xB0, 0x0, 0x13, 0xC0, 0x0, 0xD3, 0x10, 0x0, 0x13, 0x0, 0x0, 0x3, 0xE0, 0x0, 0xF3, 0x0, 0x0, 0x3, 0x0, 0x1, 0x13, 0x10, 0x1, 0x23, 0x1, 0x0, 0x3, 0x11, 0x0, 0x33, 0x1, 0x0, 0xD3, 0x40, 0x1, 0x53, 0x1, 0x0, 0x63, 0x11, 0x0, 0xC3, 0x0, 0x0, 0x73, 0x11, 0x0, 0x83, 0x1, 0x0, 0x3, 0x90, 0x1, 0x3, 0x20, 0x1, 0xD3, 0xA0, 0x1, 0xB3, 0xC1, 0x1, 0xD4, 0x1, 0x0, 0xE4, 0x1, 0x0, 0x4, 0xF0, 0x1, 0xE4, 0x1, 0x2, 0x14, 0x2, 0x0, 0x24, 0x2, 0x0, 0x34, 0x12, 0x0, 0x44, 0x2, 0x0, 0x14, 0x50, 0x2, 0x64, 0x12, 0x0, 0x4, 0x70, 0x2, 0x14, 0x0, 0x0, 0x84, 0x2, 0x0, 0x94, 0x2, 0x0, 0xF4, 0x1, 0x0, 0xA4, 0xB2, 0x2, 0x34, 0x52, 0x2, 0xC4, 0x2, 0x0, 0xD4, 0x2, 0x0, 0xE4, 0x2, 0x0, 0xF4, 0x2, 0x0, 0x4, 0x3, 0x0, 0x14, 0x3, 0x0, 0x25, 0x3, 0x0, 0x35, 0x43, 0x3, 0x5, 0x50, 0x3, 0x45, 0x3, 0x0, 0x5, 0x60, 0x3, 0x75, 0x3, 0x0, 0x5, 0x80, 0x3, 0x95, 0x3, 0x0, 0xA5, 0x3, 0x0, 0x5, 0xB0, 0x3, 0x15, 0x0, 0x0, 0x5, 0xC0, 0x3, 0x5, 0xD0, 0x3, 0x5, 0x40, 0x3, 0xE5, 0x3, 0x0, 0x5, 0xF0, 0x3, 0x5, 0x4, 0x0, 0x15, 0x4, 0x0, 0x25, 0x4, 0x0, 0x35, 0x44, 0x4, 0x45, 0x4, 0x0, 0x55, 0x4, 0x0, 0x65, 0x4, 0x0, 0x75, 0x4, 0x0, 0x85, 0x4, 0x0, 0x6, 0x90, 0x4, 0x6, 0xA0, 0x4, 0xB6, 0xC4, 0x4, 0x6, 0xD0, 0x4, 0xE6, 0x4, 0x0, 0x6, 0xF0, 0x4, 0x6, 0x5, 0x0, 0x16, 0x25, 0x5, 0x36, 0x5, 0x0, 0x6, 0x40, 0x5, 0x56, 0x5, 0x0, 0x6, 0x60, 0x5, 0x76, 0x5, 0x0, 0x86, 0x5, 0x0, 0x96, 0x5, 0x0, 0xA6, 0x5, 0x0, 0x6, 0xB0, 0x5, 0xC6, 0x5, 0x0, 0xD6, 0x5, 0x0, 0xE6, 0x5, 0x0, 0xF6, 0x5, 0x0, 0x6, 0x6, 0x0, 0x6, 0x10, 0x6, 0x7, 0x20, 0x6, 0x37, 0x46, 0x6, 0x57, 0x6, 0x0, 0x67, 0x6, 0x0, 0x77, 0x86, 0x6, 0x97, 0xA6, 0x6, 0xB7, 0xC6, 0x6, 0xD7, 0xE6, 0x6, 0xF7, 0x6, 0x0, 0x7, 0x7, 0x0, 0x7, 0x10, 0x7, 0x7, 0x20, 0x7, 0x7, 0x30, 0x7, 0x7, 0x40, 0x7, 0x57, 0x67, 0x7, 0x77, 0x7, 0x0, 0x87, 0x7, 0x0, 0x8, 0x90, 0x7, 0x8, 0xA0, 0x7, 0xB8, 0x7, 0x0, 0x8, 0xC0, 0x7, 0xD8, 0x7, 0x0, 0x8, 0xE0, 0x7, 0xF8, 0x7, 0x8, 0x18, 0x8, 0x0, 0x28, 0x8, 0x0, 0x38, 0x8, 0x0, 0x48, 0x8, 0x0, 0x58, 0x68, 0x8, 0x78, 0x8, 0x0, 0x88, 0x8, 0x0, 0x8, 0x90, 0x8, 0x9, 0xA0, 0x8, 0xB9, 0xC8, 0x8, 0x9, 0xD0, 0x8, 0xE9, 0xF8, 0x8, 0x9, 0x0, 0x9, 0x9, 0x10, 0x9, 0x29, 0x9, 0x0, 0x39, 0x9, 0x0, 0x49, 0x59, 0x9, 0x69, 0x79, 0x9, 0x9, 0x80, 0x9, 0xA, 0x90, 0x9, 0xA, 0xA0, 0x9, 0xBA, 0x9, 0x0, 0xCA, 0xD9, 0x9, 0xA, 0xE0, 0x9, 0xFA, 0x9, 0xA, 0x1A, 0x2A, 0xA, 0xA, 0x30, 0xA, 0x4B, 0xA, 0x0, 0xB, 0x50, 0xA, 0x6B, 0x7A, 0xA, 0x8B, 0x9A, 0xA, 0xAB, 0xBA, 0xA, 0xC, 0xC0, 0xA, 0xDC, 0xEA, 0xA, 0xFC, 0xA, 0xB, 0x1D, 0xB, 0x0, 0x2D, 0x3B, 0xB, 0xE, 0x40, 0xB, 0xE, 0x50, 0xB, 0x6F, 0x7B, 0xB, }, // SpaceSeparator(11): - new long[] { 0x4, 0x6, 0x400, 0x10, 0x801, 0x31, 0x421, 0x1002, 0x52, 0x1802, 0x1C03, 0x83, 0x493, 0x2804, 0xB4, 0x2C04, 0x3004, 0x3405, 0x3805, 0x40F5, 0xD5, 0x4406, 0x4D26, 0x5006, 0x5407, 0x5807, 0x157, 0x6008, 0x6408, 0x6808, 0x5C08, 0x6C09, 0x7009, 0x1D9, 0x7809, 0x7C0A, 0x800A, 0x21A, 0x880A, 0x8C0B, 0x900B, 0x940B, 0x980B, 0xA27C, 0xAA9C, 0xB2BD, 0xB40E, 0xB80F, }, + new byte[] { 0x2, 0x4, 0x0, 0x6, 0x0, 0x0, 0x4, 0x10, 0x0, 0x1, 0x8, 0x31, 0x0, 0x21, 0x4, 0x2, 0x10, 0x52, 0x0, 0x2, 0x18, 0x3, 0x1C, 0x83, 0x0, 0x93, 0x4, 0x4, 0x28, 0xB4, 0x0, 0x4, 0x2C, 0x4, 0x30, 0x5, 0x34, 0x5, 0x38, 0xF5, 0x40, 0xD5, 0x0, 0x6, 0x44, 0x26, 0x4D, 0x6, 0x50, 0x7, 0x54, 0x7, 0x58, 0x57, 0x1, 0x8, 0x60, 0x8, 0x64, 0x8, 0x68, 0x8, 0x5C, 0x9, 0x6C, 0x9, 0x70, 0xD9, 0x1, 0x9, 0x78, 0xA, 0x7C, 0xA, 0x80, 0x1A, 0x2, 0xA, 0x88, 0xB, 0x8C, 0xB, 0x90, 0xB, 0x94, 0xB, 0x98, 0x7C, 0xA2, 0x9C, 0xAA, 0xBD, 0xB2, 0xE, 0xB4, 0xF, 0xB8, }, // LineSeparator(12): - new long[] { 0x4, 0x5, 0x200, 0x401, 0x602, 0x43, 0xA04, 0x65, 0xE06, 0x1007, 0x1208, 0x1409, 0x160A, 0x180B, 0x1A0C, 0xED, 0x1E0E, 0x200F, }, + new byte[] { 0x2, 0x4, 0x0, 0x5, 0x0, 0x0, 0x2, 0x1, 0x4, 0x2, 0x6, 0x43, 0x0, 0x4, 0xA, 0x65, 0x0, 0x6, 0xE, 0x7, 0x10, 0x8, 0x12, 0x9, 0x14, 0xA, 0x16, 0xB, 0x18, 0xC, 0x1A, 0xED, 0x0, 0xE, 0x1E, 0xF, 0x20, }, // ParagraphSeparator(13): - new long[] { 0x4, 0x5, 0x10, 0x401, 0x602, 0x43, 0xA04, 0x65, 0xE06, 0x1007, 0x1208, 0x1409, 0x160A, 0x180B, 0x1A0C, 0xED, 0x1E0E, 0x200F, }, + new byte[] { 0x2, 0x4, 0x0, 0x5, 0x0, 0x10, 0x0, 0x1, 0x4, 0x2, 0x6, 0x43, 0x0, 0x4, 0xA, 0x65, 0x0, 0x6, 0xE, 0x7, 0x10, 0x8, 0x12, 0x9, 0x14, 0xA, 0x16, 0xB, 0x18, 0xC, 0x1A, 0xED, 0x0, 0xE, 0x1E, 0xF, 0x20, }, // Control(14): - new long[] { 0x4, 0x5, 0x10, 0x21, 0x32, 0x43, 0x54, 0x205, 0x65, 0xE06, 0xE86, 0x1497, 0x1608, 0x1809, 0x1A0A, 0x1C0B, 0x1E0C, 0x200D, 0x220E, 0x240F, }, + new byte[] { 0x2, 0x4, 0x0, 0x5, 0x0, 0x10, 0x0, 0x21, 0x0, 0x32, 0x0, 0x43, 0x0, 0x54, 0x0, 0x5, 0x2, 0x65, 0x0, 0x6, 0xE, 0x86, 0xE, 0x97, 0x14, 0x8, 0x16, 0x9, 0x18, 0xA, 0x1A, 0xB, 0x1C, 0xC, 0x1E, 0xD, 0x20, 0xE, 0x22, 0xF, 0x24, }, // Format(15): - new long[] { 0x4, 0x7, 0x10, 0x800, 0x1011, 0x21, 0x1811, 0x831, 0x11, 0x31, 0x1001, 0x1801, 0x801, 0x2002, 0x52, 0x862, 0x4072, 0x2812, 0x92, 0x4802, 0xA2, 0xB2, 0x8C2, 0xD3, 0xE3, 0x7813, 0x103, 0x113, 0x123, 0x9803, 0x143, 0x153, 0xB003, 0x174, 0x184, 0xC804, 0xD004, 0xD804, 0xE004, 0xE804, 0xC004, 0x1E4, 0x101F4, 0xF004, 0x215, 0x225, 0x235, 0x12A45, 0x13005, 0x275, 0x14005, 0x14805, 0x15005, 0x2B5, 0x2C6, 0x2D6, 0x17AE6, 0x18006, 0x316, 0x19006, 0x336, 0x1A006, 0x1A806, 0x367, 0x377, 0x1C007, 0x1C807, 0x3A7, 0x1D807, 0x1EBC7, 0x3E7, 0x203F8, 0x20808, 0x21008, 0x21808, 0x22C48, 0x23008, 0x479, 0x24009, 0x24809, 0x25009, 0x4B9, 0x26009, 0x4DA, 0x2700A, 0x2780A, 0x2800A, 0x2951A, 0x53B, 0x2A00B, 0x55B, 0x2BD6B, 0x58C, 0x2C80C, 0x2DDAC, 0x5CD, 0x2F5DD, 0x5FE, 0x3000E, 0x3161F, }, + new byte[] { 0x3, 0x4, 0x0, 0x0, 0x7, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x8, 0x0, 0x11, 0x10, 0x0, 0x21, 0x0, 0x0, 0x11, 0x18, 0x0, 0x31, 0x8, 0x0, 0x11, 0x0, 0x0, 0x31, 0x0, 0x0, 0x1, 0x10, 0x0, 0x1, 0x18, 0x0, 0x1, 0x8, 0x0, 0x2, 0x20, 0x0, 0x52, 0x0, 0x0, 0x62, 0x8, 0x0, 0x72, 0x40, 0x0, 0x12, 0x28, 0x0, 0x92, 0x0, 0x0, 0x2, 0x48, 0x0, 0xA2, 0x0, 0x0, 0xB2, 0x0, 0x0, 0xC2, 0x8, 0x0, 0xD3, 0x0, 0x0, 0xE3, 0x0, 0x0, 0x13, 0x78, 0x0, 0x3, 0x1, 0x0, 0x13, 0x1, 0x0, 0x23, 0x1, 0x0, 0x3, 0x98, 0x0, 0x43, 0x1, 0x0, 0x53, 0x1, 0x0, 0x3, 0xB0, 0x0, 0x74, 0x1, 0x0, 0x84, 0x1, 0x0, 0x4, 0xC8, 0x0, 0x4, 0xD0, 0x0, 0x4, 0xD8, 0x0, 0x4, 0xE0, 0x0, 0x4, 0xE8, 0x0, 0x4, 0xC0, 0x0, 0xE4, 0x1, 0x0, 0xF4, 0x1, 0x1, 0x4, 0xF0, 0x0, 0x15, 0x2, 0x0, 0x25, 0x2, 0x0, 0x35, 0x2, 0x0, 0x45, 0x2A, 0x1, 0x5, 0x30, 0x1, 0x75, 0x2, 0x0, 0x5, 0x40, 0x1, 0x5, 0x48, 0x1, 0x5, 0x50, 0x1, 0xB5, 0x2, 0x0, 0xC6, 0x2, 0x0, 0xD6, 0x2, 0x0, 0xE6, 0x7A, 0x1, 0x6, 0x80, 0x1, 0x16, 0x3, 0x0, 0x6, 0x90, 0x1, 0x36, 0x3, 0x0, 0x6, 0xA0, 0x1, 0x6, 0xA8, 0x1, 0x67, 0x3, 0x0, 0x77, 0x3, 0x0, 0x7, 0xC0, 0x1, 0x7, 0xC8, 0x1, 0xA7, 0x3, 0x0, 0x7, 0xD8, 0x1, 0xC7, 0xEB, 0x1, 0xE7, 0x3, 0x0, 0xF8, 0x3, 0x2, 0x8, 0x8, 0x2, 0x8, 0x10, 0x2, 0x8, 0x18, 0x2, 0x48, 0x2C, 0x2, 0x8, 0x30, 0x2, 0x79, 0x4, 0x0, 0x9, 0x40, 0x2, 0x9, 0x48, 0x2, 0x9, 0x50, 0x2, 0xB9, 0x4, 0x0, 0x9, 0x60, 0x2, 0xDA, 0x4, 0x0, 0xA, 0x70, 0x2, 0xA, 0x78, 0x2, 0xA, 0x80, 0x2, 0x1A, 0x95, 0x2, 0x3B, 0x5, 0x0, 0xB, 0xA0, 0x2, 0x5B, 0x5, 0x0, 0x6B, 0xBD, 0x2, 0x8C, 0x5, 0x0, 0xC, 0xC8, 0x2, 0xAC, 0xDD, 0x2, 0xCD, 0x5, 0x0, 0xDD, 0xF5, 0x2, 0xFE, 0x5, 0x0, 0xE, 0x0, 0x3, 0x1F, 0x16, 0x3, }, // Surrogate(16): - new long[] { 0x4, 0x3, 0x1B, 0x2C, 0x18D, 0x4E, 0x5F, }, + new byte[] { 0x2, 0x4, 0x0, 0x3, 0x0, 0x1B, 0x0, 0x2C, 0x0, 0x8D, 0x1, 0x4E, 0x0, 0x5F, 0x0, }, // PrivateUse(17): - new long[] { 0x4, 0x4, 0x108, 0x209, 0x30A, 0x14B, 0x15C, 0x6D, 0x7E, 0x8F, }, + new byte[] { 0x2, 0x4, 0x0, 0x4, 0x0, 0x8, 0x1, 0x9, 0x2, 0xA, 0x3, 0x4B, 0x1, 0x5C, 0x1, 0x6D, 0x0, 0x7E, 0x0, 0x8F, 0x0, }, // ConnectorPunctuation(18): - new long[] { 0x4, 0x6, 0x10, 0x400, 0x21, 0x811, 0xC01, 0x42, 0x52, 0x1062, 0x62, 0x1802, 0x73, 0x83, 0x2403, 0x2803, 0x2C03, 0xC4, 0x3404, 0xE4, 0x40F4, 0x115, 0x4805, 0x135, 0x5005, 0x4405, 0x5406, 0x5D66, 0x5586, 0x196, 0x6807, 0x6C07, 0x7007, 0x7407, 0x7DE8, 0x8008, 0x8408, 0x229, 0x8C09, 0x9009, 0x25A, 0x980A, 0x9C0A, 0x28B, 0xA40B, 0xA80B, 0x2BC, 0xB00C, 0xB40C, 0x2ED, 0xC2FD, 0x31E, 0xC80E, 0xD33F, }, + new byte[] { 0x2, 0x4, 0x0, 0x6, 0x0, 0x10, 0x0, 0x0, 0x4, 0x21, 0x0, 0x11, 0x8, 0x1, 0xC, 0x42, 0x0, 0x52, 0x0, 0x62, 0x10, 0x62, 0x0, 0x2, 0x18, 0x73, 0x0, 0x83, 0x0, 0x3, 0x24, 0x3, 0x28, 0x3, 0x2C, 0xC4, 0x0, 0x4, 0x34, 0xE4, 0x0, 0xF4, 0x40, 0x15, 0x1, 0x5, 0x48, 0x35, 0x1, 0x5, 0x50, 0x5, 0x44, 0x6, 0x54, 0x66, 0x5D, 0x86, 0x55, 0x96, 0x1, 0x7, 0x68, 0x7, 0x6C, 0x7, 0x70, 0x7, 0x74, 0xE8, 0x7D, 0x8, 0x80, 0x8, 0x84, 0x29, 0x2, 0x9, 0x8C, 0x9, 0x90, 0x5A, 0x2, 0xA, 0x98, 0xA, 0x9C, 0x8B, 0x2, 0xB, 0xA4, 0xB, 0xA8, 0xBC, 0x2, 0xC, 0xB0, 0xC, 0xB4, 0xED, 0x2, 0xFD, 0xC2, 0x1E, 0x3, 0xE, 0xC8, 0x3F, 0xD3, }, // DashPunctuation(19): - new long[] { 0x4, 0x7, 0x10, 0x800, 0x1001, 0x21, 0x1801, 0x1031, 0x11, 0x31, 0x801, 0x42, 0x2802, 0x3002, 0x3802, 0x62, 0x4002, 0x4802, 0x52, 0x8A2, 0x92, 0xB3, 0x6003, 0xD3, 0x7003, 0x6803, 0xF3, 0x103, 0x9113, 0x9803, 0xA003, 0x143, 0x113, 0xA804, 0xB004, 0x174, 0x184, 0xC804, 0x194, 0x1A4, 0x1B4, 0x1C4, 0x1D4, 0xF004, 0x1F4, 0x10004, 0x10805, 0x11A25, 0x245, 0x255, 0x13A65, 0x12805, 0x14A85, 0x15005, 0x15805, 0x16AC5, 0x215, 0x17006, 0x182F6, 0x18806, 0x19006, 0x1A336, 0x1A806, 0x1B006, 0x19806, 0x1B806, 0x1C006, 0x1C807, 0x1D007, 0x1E3B7, 0x1E807, 0x1F007, 0x1F807, 0x20007, 0x417, 0x21007, 0x22438, 0x22808, 0x23008, 0x23808, 0x24008, 0x24808, 0x4A8, 0x25808, 0x4C9, 0x26809, 0x4E9, 0x27809, 0x28009, 0x28809, 0x29009, 0x29809, 0x54A, 0x2A80A, 0x56A, 0x2B80A, 0x2C00A, 0x59A, 0x2DDAA, 0x5CB, 0x2E80B, 0x2FDEB, 0x30E0B, 0x3100B, 0x63C, 0x32E4C, 0x33E6C, 0x68D, 0x3569D, 0x6BE, 0x3600E, 0x376DF, }, + new byte[] { 0x3, 0x4, 0x0, 0x0, 0x7, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x8, 0x0, 0x1, 0x10, 0x0, 0x21, 0x0, 0x0, 0x1, 0x18, 0x0, 0x31, 0x10, 0x0, 0x11, 0x0, 0x0, 0x31, 0x0, 0x0, 0x1, 0x8, 0x0, 0x42, 0x0, 0x0, 0x2, 0x28, 0x0, 0x2, 0x30, 0x0, 0x2, 0x38, 0x0, 0x62, 0x0, 0x0, 0x2, 0x40, 0x0, 0x2, 0x48, 0x0, 0x52, 0x0, 0x0, 0xA2, 0x8, 0x0, 0x92, 0x0, 0x0, 0xB3, 0x0, 0x0, 0x3, 0x60, 0x0, 0xD3, 0x0, 0x0, 0x3, 0x70, 0x0, 0x3, 0x68, 0x0, 0xF3, 0x0, 0x0, 0x3, 0x1, 0x0, 0x13, 0x91, 0x0, 0x3, 0x98, 0x0, 0x3, 0xA0, 0x0, 0x43, 0x1, 0x0, 0x13, 0x1, 0x0, 0x4, 0xA8, 0x0, 0x4, 0xB0, 0x0, 0x74, 0x1, 0x0, 0x84, 0x1, 0x0, 0x4, 0xC8, 0x0, 0x94, 0x1, 0x0, 0xA4, 0x1, 0x0, 0xB4, 0x1, 0x0, 0xC4, 0x1, 0x0, 0xD4, 0x1, 0x0, 0x4, 0xF0, 0x0, 0xF4, 0x1, 0x0, 0x4, 0x0, 0x1, 0x5, 0x8, 0x1, 0x25, 0x1A, 0x1, 0x45, 0x2, 0x0, 0x55, 0x2, 0x0, 0x65, 0x3A, 0x1, 0x5, 0x28, 0x1, 0x85, 0x4A, 0x1, 0x5, 0x50, 0x1, 0x5, 0x58, 0x1, 0xC5, 0x6A, 0x1, 0x15, 0x2, 0x0, 0x6, 0x70, 0x1, 0xF6, 0x82, 0x1, 0x6, 0x88, 0x1, 0x6, 0x90, 0x1, 0x36, 0xA3, 0x1, 0x6, 0xA8, 0x1, 0x6, 0xB0, 0x1, 0x6, 0x98, 0x1, 0x6, 0xB8, 0x1, 0x6, 0xC0, 0x1, 0x7, 0xC8, 0x1, 0x7, 0xD0, 0x1, 0xB7, 0xE3, 0x1, 0x7, 0xE8, 0x1, 0x7, 0xF0, 0x1, 0x7, 0xF8, 0x1, 0x7, 0x0, 0x2, 0x17, 0x4, 0x0, 0x7, 0x10, 0x2, 0x38, 0x24, 0x2, 0x8, 0x28, 0x2, 0x8, 0x30, 0x2, 0x8, 0x38, 0x2, 0x8, 0x40, 0x2, 0x8, 0x48, 0x2, 0xA8, 0x4, 0x0, 0x8, 0x58, 0x2, 0xC9, 0x4, 0x0, 0x9, 0x68, 0x2, 0xE9, 0x4, 0x0, 0x9, 0x78, 0x2, 0x9, 0x80, 0x2, 0x9, 0x88, 0x2, 0x9, 0x90, 0x2, 0x9, 0x98, 0x2, 0x4A, 0x5, 0x0, 0xA, 0xA8, 0x2, 0x6A, 0x5, 0x0, 0xA, 0xB8, 0x2, 0xA, 0xC0, 0x2, 0x9A, 0x5, 0x0, 0xAA, 0xDD, 0x2, 0xCB, 0x5, 0x0, 0xB, 0xE8, 0x2, 0xEB, 0xFD, 0x2, 0xB, 0xE, 0x3, 0xB, 0x10, 0x3, 0x3C, 0x6, 0x0, 0x4C, 0x2E, 0x3, 0x6C, 0x3E, 0x3, 0x8D, 0x6, 0x0, 0x9D, 0x56, 0x3, 0xBE, 0x6, 0x0, 0xE, 0x60, 0x3, 0xDF, 0x76, 0x3, }, // OpenPunctuation(20): - new long[] { 0x4, 0x8, 0x1000, 0x10, 0x21, 0x31, 0x2001, 0x3001, 0x4002, 0x5002, 0x6002, 0x3072, 0x3052, 0x32, 0x52, 0x2072, 0x6022, 0x4022, 0x62, 0x2002, 0x5032, 0x42, 0x72, 0x2062, 0x7002, 0x4062, 0x8003, 0x53, 0x93, 0xA3, 0xB3, 0xC003, 0xD033, 0xE003, 0xE3, 0x100F3, 0x23, 0x110A3, 0x123, 0x133, 0x3003, 0x14033, 0x15023, 0x16003, 0x17003, 0x183, 0x163, 0x43, 0x193, 0x1A004, 0x1B4, 0x1C4, 0x1D004, 0x1F1E4, 0x204, 0x214, 0x224, 0x24234, 0x25004, 0x264, 0x274, 0x29284, 0x2A004, 0x2B004, 0x242C4, 0x2D004, 0x27004, 0x2E004, 0x2E4, 0x2F4, 0x304, 0x32315, 0x34335, 0x35005, 0x37365, 0x385, 0x39005, 0x31005, 0x3A5, 0x3C3B5, 0x3D005, 0x3F3E5, 0x405, 0x42415, 0x43005, 0x3F445, 0x45005, 0x33005, 0x465, 0x345, 0x48476, 0x4A496, 0x4B006, 0x4C006, 0x4E4D6, 0x504F6, 0x516, 0x526, 0x53006, 0x54006, 0x56556, 0x57006, 0x58006, 0x59336, 0x5A007, 0x5B007, 0x5C007, 0x5D007, 0x5E007, 0x5F7, 0x61607, 0x62007, 0x64637, 0x657, 0x66007, 0x67007, 0x69688, 0x6A8, 0x6B008, 0x6C008, 0x6D8, 0x6E8, 0x6F8, 0x70008, 0x71008, 0x728, 0x73008, 0x75749, 0x76009, 0x779, 0x78009, 0x799, 0x7B7A9, 0x7C9, 0x7D9, 0x7E009, 0x7FA, 0x8000A, 0x8281A, 0x8483A, 0x85A, 0x86A, 0x8700A, 0x88B, 0x8900B, 0x8B8AB, 0x8C00B, 0x8E8DB, 0x8FC, 0x9190C, 0x9392C, 0x94D, 0x9695D, 0x97E, 0x9800E, 0x9A99F, }, + new byte[] { 0x3, 0x4, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x10, 0x0, 0x10, 0x0, 0x0, 0x21, 0x0, 0x0, 0x31, 0x0, 0x0, 0x1, 0x20, 0x0, 0x1, 0x30, 0x0, 0x2, 0x40, 0x0, 0x2, 0x50, 0x0, 0x2, 0x60, 0x0, 0x72, 0x30, 0x0, 0x52, 0x30, 0x0, 0x32, 0x0, 0x0, 0x52, 0x0, 0x0, 0x72, 0x20, 0x0, 0x22, 0x60, 0x0, 0x22, 0x40, 0x0, 0x62, 0x0, 0x0, 0x2, 0x20, 0x0, 0x32, 0x50, 0x0, 0x42, 0x0, 0x0, 0x72, 0x0, 0x0, 0x62, 0x20, 0x0, 0x2, 0x70, 0x0, 0x62, 0x40, 0x0, 0x3, 0x80, 0x0, 0x53, 0x0, 0x0, 0x93, 0x0, 0x0, 0xA3, 0x0, 0x0, 0xB3, 0x0, 0x0, 0x3, 0xC0, 0x0, 0x33, 0xD0, 0x0, 0x3, 0xE0, 0x0, 0xE3, 0x0, 0x0, 0xF3, 0x0, 0x1, 0x23, 0x0, 0x0, 0xA3, 0x10, 0x1, 0x23, 0x1, 0x0, 0x33, 0x1, 0x0, 0x3, 0x30, 0x0, 0x33, 0x40, 0x1, 0x23, 0x50, 0x1, 0x3, 0x60, 0x1, 0x3, 0x70, 0x1, 0x83, 0x1, 0x0, 0x63, 0x1, 0x0, 0x43, 0x0, 0x0, 0x93, 0x1, 0x0, 0x4, 0xA0, 0x1, 0xB4, 0x1, 0x0, 0xC4, 0x1, 0x0, 0x4, 0xD0, 0x1, 0xE4, 0xF1, 0x1, 0x4, 0x2, 0x0, 0x14, 0x2, 0x0, 0x24, 0x2, 0x0, 0x34, 0x42, 0x2, 0x4, 0x50, 0x2, 0x64, 0x2, 0x0, 0x74, 0x2, 0x0, 0x84, 0x92, 0x2, 0x4, 0xA0, 0x2, 0x4, 0xB0, 0x2, 0xC4, 0x42, 0x2, 0x4, 0xD0, 0x2, 0x4, 0x70, 0x2, 0x4, 0xE0, 0x2, 0xE4, 0x2, 0x0, 0xF4, 0x2, 0x0, 0x4, 0x3, 0x0, 0x15, 0x23, 0x3, 0x35, 0x43, 0x3, 0x5, 0x50, 0x3, 0x65, 0x73, 0x3, 0x85, 0x3, 0x0, 0x5, 0x90, 0x3, 0x5, 0x10, 0x3, 0xA5, 0x3, 0x0, 0xB5, 0xC3, 0x3, 0x5, 0xD0, 0x3, 0xE5, 0xF3, 0x3, 0x5, 0x4, 0x0, 0x15, 0x24, 0x4, 0x5, 0x30, 0x4, 0x45, 0xF4, 0x3, 0x5, 0x50, 0x4, 0x5, 0x30, 0x3, 0x65, 0x4, 0x0, 0x45, 0x3, 0x0, 0x76, 0x84, 0x4, 0x96, 0xA4, 0x4, 0x6, 0xB0, 0x4, 0x6, 0xC0, 0x4, 0xD6, 0xE4, 0x4, 0xF6, 0x4, 0x5, 0x16, 0x5, 0x0, 0x26, 0x5, 0x0, 0x6, 0x30, 0x5, 0x6, 0x40, 0x5, 0x56, 0x65, 0x5, 0x6, 0x70, 0x5, 0x6, 0x80, 0x5, 0x36, 0x93, 0x5, 0x7, 0xA0, 0x5, 0x7, 0xB0, 0x5, 0x7, 0xC0, 0x5, 0x7, 0xD0, 0x5, 0x7, 0xE0, 0x5, 0xF7, 0x5, 0x0, 0x7, 0x16, 0x6, 0x7, 0x20, 0x6, 0x37, 0x46, 0x6, 0x57, 0x6, 0x0, 0x7, 0x60, 0x6, 0x7, 0x70, 0x6, 0x88, 0x96, 0x6, 0xA8, 0x6, 0x0, 0x8, 0xB0, 0x6, 0x8, 0xC0, 0x6, 0xD8, 0x6, 0x0, 0xE8, 0x6, 0x0, 0xF8, 0x6, 0x0, 0x8, 0x0, 0x7, 0x8, 0x10, 0x7, 0x28, 0x7, 0x0, 0x8, 0x30, 0x7, 0x49, 0x57, 0x7, 0x9, 0x60, 0x7, 0x79, 0x7, 0x0, 0x9, 0x80, 0x7, 0x99, 0x7, 0x0, 0xA9, 0xB7, 0x7, 0xC9, 0x7, 0x0, 0xD9, 0x7, 0x0, 0x9, 0xE0, 0x7, 0xFA, 0x7, 0x0, 0xA, 0x0, 0x8, 0x1A, 0x28, 0x8, 0x3A, 0x48, 0x8, 0x5A, 0x8, 0x0, 0x6A, 0x8, 0x0, 0xA, 0x70, 0x8, 0x8B, 0x8, 0x0, 0xB, 0x90, 0x8, 0xAB, 0xB8, 0x8, 0xB, 0xC0, 0x8, 0xDB, 0xE8, 0x8, 0xFC, 0x8, 0x0, 0xC, 0x19, 0x9, 0x2C, 0x39, 0x9, 0x4D, 0x9, 0x0, 0x5D, 0x69, 0x9, 0x7E, 0x9, 0x0, 0xE, 0x80, 0x9, 0x9F, 0xA9, 0x9, }, // ClosePunctuation(21): - new long[] { 0x4, 0x8, 0x10, 0x1000, 0x3021, 0x2001, 0x31, 0x3001, 0x11, 0x21, 0x4002, 0x52, 0x5002, 0x6032, 0x7002, 0x3072, 0x62, 0x2082, 0x5022, 0x9022, 0x2002, 0x32, 0x92, 0x2052, 0x6002, 0x72, 0x9052, 0xA003, 0xB3, 0xC3, 0xD3, 0xF0E3, 0x10033, 0xE3, 0x103, 0x12113, 0x23, 0x130C3, 0x143, 0x30E3, 0x15033, 0x16023, 0x10003, 0x17003, 0x183, 0x193, 0x1A3, 0x1B004, 0x1C4, 0x1D004, 0x1F1E4, 0x204, 0x214, 0x224, 0x24234, 0x25004, 0x264, 0x28274, 0x29004, 0x2A004, 0x242B4, 0x2C004, 0x26004, 0x22004, 0x2D4, 0x2E4, 0x302F5, 0x31305, 0x32005, 0x34335, 0x355, 0x36005, 0x375, 0x38305, 0x39005, 0x3B3A5, 0x3C5, 0x3E3D5, 0x3F005, 0x3B355, 0x40005, 0x415, 0x315, 0x43426, 0x45446, 0x46006, 0x47006, 0x48006, 0x4A496, 0x4B6, 0x4C6, 0x4D006, 0x4E006, 0x4F6, 0x50006, 0x51006, 0x52306, 0x53007, 0x54007, 0x55007, 0x56007, 0x57007, 0x587, 0x5A597, 0x5B007, 0x5D5C7, 0x5E7, 0x5F007, 0x60007, 0x62618, 0x638, 0x64008, 0x65008, 0x668, 0x678, 0x688, 0x69008, 0x6A008, 0x6B8, 0x6C008, 0x6E6D9, 0x6F009, 0x709, 0x71009, 0x729, 0x74739, 0x759, 0x769, 0x77009, 0x78A, 0x7900A, 0x7B7AA, 0x7D7CA, 0x7EA, 0x7FA, 0x8000A, 0x81B, 0x8200B, 0x8483B, 0x8500B, 0x8786B, 0x88C, 0x8A89C, 0x8C8BC, 0x8DD, 0x8F8ED, 0x90E, 0x9100E, 0x9392F, }, + new byte[] { 0x3, 0x4, 0x0, 0x0, 0x8, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x0, 0x21, 0x30, 0x0, 0x1, 0x20, 0x0, 0x31, 0x0, 0x0, 0x1, 0x30, 0x0, 0x11, 0x0, 0x0, 0x21, 0x0, 0x0, 0x2, 0x40, 0x0, 0x52, 0x0, 0x0, 0x2, 0x50, 0x0, 0x32, 0x60, 0x0, 0x2, 0x70, 0x0, 0x72, 0x30, 0x0, 0x62, 0x0, 0x0, 0x82, 0x20, 0x0, 0x22, 0x50, 0x0, 0x22, 0x90, 0x0, 0x2, 0x20, 0x0, 0x32, 0x0, 0x0, 0x92, 0x0, 0x0, 0x52, 0x20, 0x0, 0x2, 0x60, 0x0, 0x72, 0x0, 0x0, 0x52, 0x90, 0x0, 0x3, 0xA0, 0x0, 0xB3, 0x0, 0x0, 0xC3, 0x0, 0x0, 0xD3, 0x0, 0x0, 0xE3, 0xF0, 0x0, 0x33, 0x0, 0x1, 0xE3, 0x0, 0x0, 0x3, 0x1, 0x0, 0x13, 0x21, 0x1, 0x23, 0x0, 0x0, 0xC3, 0x30, 0x1, 0x43, 0x1, 0x0, 0xE3, 0x30, 0x0, 0x33, 0x50, 0x1, 0x23, 0x60, 0x1, 0x3, 0x0, 0x1, 0x3, 0x70, 0x1, 0x83, 0x1, 0x0, 0x93, 0x1, 0x0, 0xA3, 0x1, 0x0, 0x4, 0xB0, 0x1, 0xC4, 0x1, 0x0, 0x4, 0xD0, 0x1, 0xE4, 0xF1, 0x1, 0x4, 0x2, 0x0, 0x14, 0x2, 0x0, 0x24, 0x2, 0x0, 0x34, 0x42, 0x2, 0x4, 0x50, 0x2, 0x64, 0x2, 0x0, 0x74, 0x82, 0x2, 0x4, 0x90, 0x2, 0x4, 0xA0, 0x2, 0xB4, 0x42, 0x2, 0x4, 0xC0, 0x2, 0x4, 0x60, 0x2, 0x4, 0x20, 0x2, 0xD4, 0x2, 0x0, 0xE4, 0x2, 0x0, 0xF5, 0x2, 0x3, 0x5, 0x13, 0x3, 0x5, 0x20, 0x3, 0x35, 0x43, 0x3, 0x55, 0x3, 0x0, 0x5, 0x60, 0x3, 0x75, 0x3, 0x0, 0x5, 0x83, 0x3, 0x5, 0x90, 0x3, 0xA5, 0xB3, 0x3, 0xC5, 0x3, 0x0, 0xD5, 0xE3, 0x3, 0x5, 0xF0, 0x3, 0x55, 0xB3, 0x3, 0x5, 0x0, 0x4, 0x15, 0x4, 0x0, 0x15, 0x3, 0x0, 0x26, 0x34, 0x4, 0x46, 0x54, 0x4, 0x6, 0x60, 0x4, 0x6, 0x70, 0x4, 0x6, 0x80, 0x4, 0x96, 0xA4, 0x4, 0xB6, 0x4, 0x0, 0xC6, 0x4, 0x0, 0x6, 0xD0, 0x4, 0x6, 0xE0, 0x4, 0xF6, 0x4, 0x0, 0x6, 0x0, 0x5, 0x6, 0x10, 0x5, 0x6, 0x23, 0x5, 0x7, 0x30, 0x5, 0x7, 0x40, 0x5, 0x7, 0x50, 0x5, 0x7, 0x60, 0x5, 0x7, 0x70, 0x5, 0x87, 0x5, 0x0, 0x97, 0xA5, 0x5, 0x7, 0xB0, 0x5, 0xC7, 0xD5, 0x5, 0xE7, 0x5, 0x0, 0x7, 0xF0, 0x5, 0x7, 0x0, 0x6, 0x18, 0x26, 0x6, 0x38, 0x6, 0x0, 0x8, 0x40, 0x6, 0x8, 0x50, 0x6, 0x68, 0x6, 0x0, 0x78, 0x6, 0x0, 0x88, 0x6, 0x0, 0x8, 0x90, 0x6, 0x8, 0xA0, 0x6, 0xB8, 0x6, 0x0, 0x8, 0xC0, 0x6, 0xD9, 0xE6, 0x6, 0x9, 0xF0, 0x6, 0x9, 0x7, 0x0, 0x9, 0x10, 0x7, 0x29, 0x7, 0x0, 0x39, 0x47, 0x7, 0x59, 0x7, 0x0, 0x69, 0x7, 0x0, 0x9, 0x70, 0x7, 0x8A, 0x7, 0x0, 0xA, 0x90, 0x7, 0xAA, 0xB7, 0x7, 0xCA, 0xD7, 0x7, 0xEA, 0x7, 0x0, 0xFA, 0x7, 0x0, 0xA, 0x0, 0x8, 0x1B, 0x8, 0x0, 0xB, 0x20, 0x8, 0x3B, 0x48, 0x8, 0xB, 0x50, 0x8, 0x6B, 0x78, 0x8, 0x8C, 0x8, 0x0, 0x9C, 0xA8, 0x8, 0xBC, 0xC8, 0x8, 0xDD, 0x8, 0x0, 0xED, 0xF8, 0x8, 0xE, 0x9, 0x0, 0xE, 0x10, 0x9, 0x2F, 0x39, 0x9, }, // InitialQuotePunctuation(22): - new long[] { 0x4, 0x6, 0x400, 0x10, 0x801, 0xC01, 0x21, 0x831, 0x31, 0x1002, 0x42, 0x1442, 0x1842, 0x1402, 0x2002, 0x2403, 0xA3, 0x30B3, 0xD3, 0x73, 0xE3, 0x3C04, 0x4504, 0x124, 0x134, 0x5004, 0x5955, 0x6175, 0x195, 0x6806, 0x6C06, 0x7006, 0x7407, 0x7807, 0x1F7, 0x8008, 0x8408, 0x8808, 0x239, 0x9009, 0x9409, 0x26A, 0x9C0A, 0xA00A, 0xAA9B, 0xAC0B, 0xB00C, 0xB40C, 0xBEED, 0xC00E, 0xC40F, }, + new byte[] { 0x2, 0x4, 0x0, 0x6, 0x0, 0x0, 0x4, 0x10, 0x0, 0x1, 0x8, 0x1, 0xC, 0x21, 0x0, 0x31, 0x8, 0x31, 0x0, 0x2, 0x10, 0x42, 0x0, 0x42, 0x14, 0x42, 0x18, 0x2, 0x14, 0x2, 0x20, 0x3, 0x24, 0xA3, 0x0, 0xB3, 0x30, 0xD3, 0x0, 0x73, 0x0, 0xE3, 0x0, 0x4, 0x3C, 0x4, 0x45, 0x24, 0x1, 0x34, 0x1, 0x4, 0x50, 0x55, 0x59, 0x75, 0x61, 0x95, 0x1, 0x6, 0x68, 0x6, 0x6C, 0x6, 0x70, 0x7, 0x74, 0x7, 0x78, 0xF7, 0x1, 0x8, 0x80, 0x8, 0x84, 0x8, 0x88, 0x39, 0x2, 0x9, 0x90, 0x9, 0x94, 0x6A, 0x2, 0xA, 0x9C, 0xA, 0xA0, 0x9B, 0xAA, 0xB, 0xAC, 0xC, 0xB0, 0xC, 0xB4, 0xED, 0xBE, 0xE, 0xC0, 0xF, 0xC4, }, // FinalQuotePunctuation(23): - new long[] { 0x4, 0x6, 0x10, 0x400, 0x801, 0x31, 0x21, 0x1002, 0x42, 0x1442, 0x1842, 0x1402, 0x1802, 0x1C03, 0x83, 0x2893, 0xB3, 0x43, 0xC3, 0x3404, 0x3CE4, 0x104, 0x114, 0x124, 0x5135, 0x5955, 0x175, 0x6006, 0x6406, 0x6806, 0x6C07, 0x7007, 0x1D7, 0x7808, 0x7C08, 0x8008, 0x219, 0x8809, 0x8C09, 0x24A, 0x940A, 0x980A, 0xA27B, 0xA40B, 0xA80C, 0xAC0C, 0xB6CD, 0xB80E, 0xBC0F, }, + new byte[] { 0x2, 0x4, 0x0, 0x6, 0x0, 0x10, 0x0, 0x0, 0x4, 0x1, 0x8, 0x31, 0x0, 0x21, 0x0, 0x2, 0x10, 0x42, 0x0, 0x42, 0x14, 0x42, 0x18, 0x2, 0x14, 0x2, 0x18, 0x3, 0x1C, 0x83, 0x0, 0x93, 0x28, 0xB3, 0x0, 0x43, 0x0, 0xC3, 0x0, 0x4, 0x34, 0xE4, 0x3C, 0x4, 0x1, 0x14, 0x1, 0x24, 0x1, 0x35, 0x51, 0x55, 0x59, 0x75, 0x1, 0x6, 0x60, 0x6, 0x64, 0x6, 0x68, 0x7, 0x6C, 0x7, 0x70, 0xD7, 0x1, 0x8, 0x78, 0x8, 0x7C, 0x8, 0x80, 0x19, 0x2, 0x9, 0x88, 0x9, 0x8C, 0x4A, 0x2, 0xA, 0x94, 0xA, 0x98, 0x7B, 0xA2, 0xB, 0xA4, 0xC, 0xA8, 0xC, 0xAC, 0xCD, 0xB6, 0xE, 0xB8, 0xF, 0xBC, }, // OtherPunctuation(24): - new long[] { 0x4, 0x9, 0x10, 0x2000, 0x2001, 0x4001, 0x6001, 0x21, 0x11, 0x6011, 0x31, 0x4011, 0x2031, 0x4031, 0x2021, 0x6021, 0xA042, 0x62, 0xC002, 0x10072, 0x14092, 0x12002, 0x8002, 0x72, 0x18012, 0x16062, 0xD2, 0xA002, 0x20C2, 0xE002, 0x82, 0x12, 0x2042, 0x16012, 0x18062, 0x10012, 0xA2, 0xB2, 0x52, 0x16002, 0x14002, 0x4012, 0x8012, 0x100C2, 0x1C082, 0x1E082, 0x8082, 0x16092, 0x1C0B2, 0x16072, 0x1E0C2, 0xE012, 0x42, 0x18002, 0x20E2, 0xC2, 0xE042, 0x1A002, 0x2062, 0x10002, 0x10042, 0xE082, 0x1A042, 0xE062, 0x1E0A2, 0xA072, 0x20003, 0x113, 0x24003, 0x133, 0x16143, 0x2C153, 0x30173, 0x34193, 0x381B3, 0x1D3, 0x2C003, 0x1E3, 0x1F3, 0x42203, 0x173, 0x223, 0x3E003, 0x46003, 0x3A243, 0x253, 0x263, 0x4E003, 0x50003, 0x52013, 0x22A3, 0x2B3, 0x382C3, 0x5C2D3, 0x2F3, 0x601C3, 0x62013, 0x2323, 0x2003, 0x3C003, 0x3A003, 0x333, 0x233, 0x38203, 0x68003, 0x6C353, 0x6E353, 0x34003, 0x383, 0x243, 0x2123, 0x74393, 0x4C003, 0x44003, 0x3E013, 0x3B3, 0x22003, 0x2E003, 0x48003, 0x21C3, 0x2E163, 0x2203, 0x3C3, 0x3D3, 0x3E3, 0x7E003, 0x80003, 0x1B3, 0x3C173, 0x82003, 0x84004, 0x88434, 0x8C454, 0x8E004, 0x92484, 0x444, 0x4A4, 0x96004, 0x4C4, 0x4D4, 0x4E4, 0x9E4D4, 0x504, 0x9A004, 0x514, 0x524, 0x534, 0x544, 0xAA004, 0x4B4, 0x564, 0xAE004, 0xB2584, 0xB65A4, 0xBA5C4, 0x5E4, 0xC05F4, 0xC4614, 0x634, 0xC4644, 0x654, 0x88004, 0x664, 0xCE004, 0xD0004, 0xD2004, 0x6A4, 0x6B4, 0xD8004, 0xDA004, 0xDC004, 0xCC004, 0x6F4, 0xE0004, 0xE4714, 0xA0734, 0x744, 0xE8004, 0x754, 0x764, 0xD0444, 0x6D4, 0x774, 0x784, 0xF2004, 0xF4004, 0xF87B4, 0x7D4, 0xFC004, 0xFE004, 0xEA004, 0x102804, 0x825, 0x108835, 0x10C855, 0x110875, 0x895, 0x1168A5, 0x118005, 0x11A005, 0x11C005, 0x8F5, 0x11E905, 0x915, 0x925, 0x935, 0x128005, 0x8B5, 0x955, 0x12E965, 0x130005, 0x134995, 0x875, 0x9B5, 0x138005, 0x13C9D5, 0x13E005, 0xA05, 0x8C5, 0x144A15, 0xA35, 0x116005, 0x148005, 0x14A005, 0x14C005, 0xA75, 0xA85, 0xA95, 0xAA5, 0x156005, 0x158005, 0x15A005, 0x15C005, 0x15E005, 0xB05, 0x162005, 0xB25, 0xB35, 0x965, 0xB45, 0x16A005, 0xB65, 0xB75, 0x170005, 0x160005, 0xB95, 0x174005, 0x178BB5, 0x17A005, 0x144005, 0x17C005, 0xB55, 0xBF5, 0x106005, 0x845, 0x182C06, 0x186C26, 0xC46, 0xC56, 0xC66, 0xC76, 0x192C86, 0xCA6, 0xCB6, 0xCC6, 0x19CCD6, 0xCF6, 0xD06, 0x1A2006, 0x1A6D26, 0xD46, 0xD56, 0x1AED66, 0xD86, 0x1B2CF6, 0xDA6, 0xDB6, 0x1B8006, 0x1BA006, 0xDE6, 0x1BE006, 0xE06, 0x1C2006, 0xE26, 0xE36, 0xE46, 0xE56, 0x1CEE66, 0x1D0006, 0xE96, 0xEA6, 0x1D6006, 0xEC6, 0xED6, 0xEE6, 0xEF6, 0x1E2F06, 0xF26, 0x1E6006, 0xF46, 0x1ECF56, 0x1F0F76, 0xF96, 0x1F4006, 0xFB6, 0x1F8006, 0x1FCFD6, 0x1FE007, 0x200007, 0x1017, 0x207027, 0x20B047, 0x20F067, 0x213087, 0x10A7, 0x2190B7, 0x21A007, 0x21C007, 0x10F7, 0x220007, 0x225117, 0x229137, 0x22D157, 0x22E007, 0x230007, 0x235197, 0x2391B7, 0x23A007, 0x23D0B7, 0x2411F7, 0x242007, 0x1227, 0x249237, 0x24B0E7, 0x24F267, 0x250007, 0x255297, 0x2592B7, 0x25D2D7, 0x2612F7, 0x265317, 0x269338, 0x26D358, 0x271378, 0x272008, 0x274008, 0x276008, 0x278008, 0x27D3D8, 0x27E008, 0x280008, 0x285418, 0x289438, 0x28D458, 0x1478, 0x290008, 0x295498, 0x2994B8, 0x29A008, 0x29F4E8, 0x2A3508, 0x1528, 0x1538, 0x2A8008, 0x1559, 0x2AF569, 0x2B3589, 0x2B4009, 0x2B95B9, 0x2BA009, 0x2BC009, 0x2C15F9, 0x1619, 0x2C7629, 0x2CB649, 0x2CF669, 0x2D3689, 0x2D76A9, 0x16CA, 0x2DA00A, 0x16EA, 0x2DE00A, 0x170A, 0x2E200A, 0x2E772A, 0x2EB74A, 0x2EF76A, 0x2F378A, 0x17AB, 0x2F97BB, 0x2FA00B, 0x2FF7EB, 0x30380B, 0x30782B, 0x184C, 0x30A00C, 0x30F86C, 0x31388C, 0x18AD, 0x18BD, 0x31B8CD, 0x31F8EE, 0x32000E, 0x32591F, }, + new byte[] { 0x3, 0x4, 0x0, 0x0, 0x9, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x20, 0x0, 0x1, 0x20, 0x0, 0x1, 0x40, 0x0, 0x1, 0x60, 0x0, 0x21, 0x0, 0x0, 0x11, 0x0, 0x0, 0x11, 0x60, 0x0, 0x31, 0x0, 0x0, 0x11, 0x40, 0x0, 0x31, 0x20, 0x0, 0x31, 0x40, 0x0, 0x21, 0x20, 0x0, 0x21, 0x60, 0x0, 0x42, 0xA0, 0x0, 0x62, 0x0, 0x0, 0x2, 0xC0, 0x0, 0x72, 0x0, 0x1, 0x92, 0x40, 0x1, 0x2, 0x20, 0x1, 0x2, 0x80, 0x0, 0x72, 0x0, 0x0, 0x12, 0x80, 0x1, 0x62, 0x60, 0x1, 0xD2, 0x0, 0x0, 0x2, 0xA0, 0x0, 0xC2, 0x20, 0x0, 0x2, 0xE0, 0x0, 0x82, 0x0, 0x0, 0x12, 0x0, 0x0, 0x42, 0x20, 0x0, 0x12, 0x60, 0x1, 0x62, 0x80, 0x1, 0x12, 0x0, 0x1, 0xA2, 0x0, 0x0, 0xB2, 0x0, 0x0, 0x52, 0x0, 0x0, 0x2, 0x60, 0x1, 0x2, 0x40, 0x1, 0x12, 0x40, 0x0, 0x12, 0x80, 0x0, 0xC2, 0x0, 0x1, 0x82, 0xC0, 0x1, 0x82, 0xE0, 0x1, 0x82, 0x80, 0x0, 0x92, 0x60, 0x1, 0xB2, 0xC0, 0x1, 0x72, 0x60, 0x1, 0xC2, 0xE0, 0x1, 0x12, 0xE0, 0x0, 0x42, 0x0, 0x0, 0x2, 0x80, 0x1, 0xE2, 0x20, 0x0, 0xC2, 0x0, 0x0, 0x42, 0xE0, 0x0, 0x2, 0xA0, 0x1, 0x62, 0x20, 0x0, 0x2, 0x0, 0x1, 0x42, 0x0, 0x1, 0x82, 0xE0, 0x0, 0x42, 0xA0, 0x1, 0x62, 0xE0, 0x0, 0xA2, 0xE0, 0x1, 0x72, 0xA0, 0x0, 0x3, 0x0, 0x2, 0x13, 0x1, 0x0, 0x3, 0x40, 0x2, 0x33, 0x1, 0x0, 0x43, 0x61, 0x1, 0x53, 0xC1, 0x2, 0x73, 0x1, 0x3, 0x93, 0x41, 0x3, 0xB3, 0x81, 0x3, 0xD3, 0x1, 0x0, 0x3, 0xC0, 0x2, 0xE3, 0x1, 0x0, 0xF3, 0x1, 0x0, 0x3, 0x22, 0x4, 0x73, 0x1, 0x0, 0x23, 0x2, 0x0, 0x3, 0xE0, 0x3, 0x3, 0x60, 0x4, 0x43, 0xA2, 0x3, 0x53, 0x2, 0x0, 0x63, 0x2, 0x0, 0x3, 0xE0, 0x4, 0x3, 0x0, 0x5, 0x13, 0x20, 0x5, 0xA3, 0x22, 0x0, 0xB3, 0x2, 0x0, 0xC3, 0x82, 0x3, 0xD3, 0xC2, 0x5, 0xF3, 0x2, 0x0, 0xC3, 0x1, 0x6, 0x13, 0x20, 0x6, 0x23, 0x23, 0x0, 0x3, 0x20, 0x0, 0x3, 0xC0, 0x3, 0x3, 0xA0, 0x3, 0x33, 0x3, 0x0, 0x33, 0x2, 0x0, 0x3, 0x82, 0x3, 0x3, 0x80, 0x6, 0x53, 0xC3, 0x6, 0x53, 0xE3, 0x6, 0x3, 0x40, 0x3, 0x83, 0x3, 0x0, 0x43, 0x2, 0x0, 0x23, 0x21, 0x0, 0x93, 0x43, 0x7, 0x3, 0xC0, 0x4, 0x3, 0x40, 0x4, 0x13, 0xE0, 0x3, 0xB3, 0x3, 0x0, 0x3, 0x20, 0x2, 0x3, 0xE0, 0x2, 0x3, 0x80, 0x4, 0xC3, 0x21, 0x0, 0x63, 0xE1, 0x2, 0x3, 0x22, 0x0, 0xC3, 0x3, 0x0, 0xD3, 0x3, 0x0, 0xE3, 0x3, 0x0, 0x3, 0xE0, 0x7, 0x3, 0x0, 0x8, 0xB3, 0x1, 0x0, 0x73, 0xC1, 0x3, 0x3, 0x20, 0x8, 0x4, 0x40, 0x8, 0x34, 0x84, 0x8, 0x54, 0xC4, 0x8, 0x4, 0xE0, 0x8, 0x84, 0x24, 0x9, 0x44, 0x4, 0x0, 0xA4, 0x4, 0x0, 0x4, 0x60, 0x9, 0xC4, 0x4, 0x0, 0xD4, 0x4, 0x0, 0xE4, 0x4, 0x0, 0xD4, 0xE4, 0x9, 0x4, 0x5, 0x0, 0x4, 0xA0, 0x9, 0x14, 0x5, 0x0, 0x24, 0x5, 0x0, 0x34, 0x5, 0x0, 0x44, 0x5, 0x0, 0x4, 0xA0, 0xA, 0xB4, 0x4, 0x0, 0x64, 0x5, 0x0, 0x4, 0xE0, 0xA, 0x84, 0x25, 0xB, 0xA4, 0x65, 0xB, 0xC4, 0xA5, 0xB, 0xE4, 0x5, 0x0, 0xF4, 0x5, 0xC, 0x14, 0x46, 0xC, 0x34, 0x6, 0x0, 0x44, 0x46, 0xC, 0x54, 0x6, 0x0, 0x4, 0x80, 0x8, 0x64, 0x6, 0x0, 0x4, 0xE0, 0xC, 0x4, 0x0, 0xD, 0x4, 0x20, 0xD, 0xA4, 0x6, 0x0, 0xB4, 0x6, 0x0, 0x4, 0x80, 0xD, 0x4, 0xA0, 0xD, 0x4, 0xC0, 0xD, 0x4, 0xC0, 0xC, 0xF4, 0x6, 0x0, 0x4, 0x0, 0xE, 0x14, 0x47, 0xE, 0x34, 0x7, 0xA, 0x44, 0x7, 0x0, 0x4, 0x80, 0xE, 0x54, 0x7, 0x0, 0x64, 0x7, 0x0, 0x44, 0x4, 0xD, 0xD4, 0x6, 0x0, 0x74, 0x7, 0x0, 0x84, 0x7, 0x0, 0x4, 0x20, 0xF, 0x4, 0x40, 0xF, 0xB4, 0x87, 0xF, 0xD4, 0x7, 0x0, 0x4, 0xC0, 0xF, 0x4, 0xE0, 0xF, 0x4, 0xA0, 0xE, 0x4, 0x28, 0x10, 0x25, 0x8, 0x0, 0x35, 0x88, 0x10, 0x55, 0xC8, 0x10, 0x75, 0x8, 0x11, 0x95, 0x8, 0x0, 0xA5, 0x68, 0x11, 0x5, 0x80, 0x11, 0x5, 0xA0, 0x11, 0x5, 0xC0, 0x11, 0xF5, 0x8, 0x0, 0x5, 0xE9, 0x11, 0x15, 0x9, 0x0, 0x25, 0x9, 0x0, 0x35, 0x9, 0x0, 0x5, 0x80, 0x12, 0xB5, 0x8, 0x0, 0x55, 0x9, 0x0, 0x65, 0xE9, 0x12, 0x5, 0x0, 0x13, 0x95, 0x49, 0x13, 0x75, 0x8, 0x0, 0xB5, 0x9, 0x0, 0x5, 0x80, 0x13, 0xD5, 0xC9, 0x13, 0x5, 0xE0, 0x13, 0x5, 0xA, 0x0, 0xC5, 0x8, 0x0, 0x15, 0x4A, 0x14, 0x35, 0xA, 0x0, 0x5, 0x60, 0x11, 0x5, 0x80, 0x14, 0x5, 0xA0, 0x14, 0x5, 0xC0, 0x14, 0x75, 0xA, 0x0, 0x85, 0xA, 0x0, 0x95, 0xA, 0x0, 0xA5, 0xA, 0x0, 0x5, 0x60, 0x15, 0x5, 0x80, 0x15, 0x5, 0xA0, 0x15, 0x5, 0xC0, 0x15, 0x5, 0xE0, 0x15, 0x5, 0xB, 0x0, 0x5, 0x20, 0x16, 0x25, 0xB, 0x0, 0x35, 0xB, 0x0, 0x65, 0x9, 0x0, 0x45, 0xB, 0x0, 0x5, 0xA0, 0x16, 0x65, 0xB, 0x0, 0x75, 0xB, 0x0, 0x5, 0x0, 0x17, 0x5, 0x0, 0x16, 0x95, 0xB, 0x0, 0x5, 0x40, 0x17, 0xB5, 0x8B, 0x17, 0x5, 0xA0, 0x17, 0x5, 0x40, 0x14, 0x5, 0xC0, 0x17, 0x55, 0xB, 0x0, 0xF5, 0xB, 0x0, 0x5, 0x60, 0x10, 0x45, 0x8, 0x0, 0x6, 0x2C, 0x18, 0x26, 0x6C, 0x18, 0x46, 0xC, 0x0, 0x56, 0xC, 0x0, 0x66, 0xC, 0x0, 0x76, 0xC, 0x0, 0x86, 0x2C, 0x19, 0xA6, 0xC, 0x0, 0xB6, 0xC, 0x0, 0xC6, 0xC, 0x0, 0xD6, 0xCC, 0x19, 0xF6, 0xC, 0x0, 0x6, 0xD, 0x0, 0x6, 0x20, 0x1A, 0x26, 0x6D, 0x1A, 0x46, 0xD, 0x0, 0x56, 0xD, 0x0, 0x66, 0xED, 0x1A, 0x86, 0xD, 0x0, 0xF6, 0x2C, 0x1B, 0xA6, 0xD, 0x0, 0xB6, 0xD, 0x0, 0x6, 0x80, 0x1B, 0x6, 0xA0, 0x1B, 0xE6, 0xD, 0x0, 0x6, 0xE0, 0x1B, 0x6, 0xE, 0x0, 0x6, 0x20, 0x1C, 0x26, 0xE, 0x0, 0x36, 0xE, 0x0, 0x46, 0xE, 0x0, 0x56, 0xE, 0x0, 0x66, 0xEE, 0x1C, 0x6, 0x0, 0x1D, 0x96, 0xE, 0x0, 0xA6, 0xE, 0x0, 0x6, 0x60, 0x1D, 0xC6, 0xE, 0x0, 0xD6, 0xE, 0x0, 0xE6, 0xE, 0x0, 0xF6, 0xE, 0x0, 0x6, 0x2F, 0x1E, 0x26, 0xF, 0x0, 0x6, 0x60, 0x1E, 0x46, 0xF, 0x0, 0x56, 0xCF, 0x1E, 0x76, 0xF, 0x1F, 0x96, 0xF, 0x0, 0x6, 0x40, 0x1F, 0xB6, 0xF, 0x0, 0x6, 0x80, 0x1F, 0xD6, 0xCF, 0x1F, 0x7, 0xE0, 0x1F, 0x7, 0x0, 0x20, 0x17, 0x10, 0x0, 0x27, 0x70, 0x20, 0x47, 0xB0, 0x20, 0x67, 0xF0, 0x20, 0x87, 0x30, 0x21, 0xA7, 0x10, 0x0, 0xB7, 0x90, 0x21, 0x7, 0xA0, 0x21, 0x7, 0xC0, 0x21, 0xF7, 0x10, 0x0, 0x7, 0x0, 0x22, 0x17, 0x51, 0x22, 0x37, 0x91, 0x22, 0x57, 0xD1, 0x22, 0x7, 0xE0, 0x22, 0x7, 0x0, 0x23, 0x97, 0x51, 0x23, 0xB7, 0x91, 0x23, 0x7, 0xA0, 0x23, 0xB7, 0xD0, 0x23, 0xF7, 0x11, 0x24, 0x7, 0x20, 0x24, 0x27, 0x12, 0x0, 0x37, 0x92, 0x24, 0xE7, 0xB0, 0x24, 0x67, 0xF2, 0x24, 0x7, 0x0, 0x25, 0x97, 0x52, 0x25, 0xB7, 0x92, 0x25, 0xD7, 0xD2, 0x25, 0xF7, 0x12, 0x26, 0x17, 0x53, 0x26, 0x38, 0x93, 0x26, 0x58, 0xD3, 0x26, 0x78, 0x13, 0x27, 0x8, 0x20, 0x27, 0x8, 0x40, 0x27, 0x8, 0x60, 0x27, 0x8, 0x80, 0x27, 0xD8, 0xD3, 0x27, 0x8, 0xE0, 0x27, 0x8, 0x0, 0x28, 0x18, 0x54, 0x28, 0x38, 0x94, 0x28, 0x58, 0xD4, 0x28, 0x78, 0x14, 0x0, 0x8, 0x0, 0x29, 0x98, 0x54, 0x29, 0xB8, 0x94, 0x29, 0x8, 0xA0, 0x29, 0xE8, 0xF4, 0x29, 0x8, 0x35, 0x2A, 0x28, 0x15, 0x0, 0x38, 0x15, 0x0, 0x8, 0x80, 0x2A, 0x59, 0x15, 0x0, 0x69, 0xF5, 0x2A, 0x89, 0x35, 0x2B, 0x9, 0x40, 0x2B, 0xB9, 0x95, 0x2B, 0x9, 0xA0, 0x2B, 0x9, 0xC0, 0x2B, 0xF9, 0x15, 0x2C, 0x19, 0x16, 0x0, 0x29, 0x76, 0x2C, 0x49, 0xB6, 0x2C, 0x69, 0xF6, 0x2C, 0x89, 0x36, 0x2D, 0xA9, 0x76, 0x2D, 0xCA, 0x16, 0x0, 0xA, 0xA0, 0x2D, 0xEA, 0x16, 0x0, 0xA, 0xE0, 0x2D, 0xA, 0x17, 0x0, 0xA, 0x20, 0x2E, 0x2A, 0x77, 0x2E, 0x4A, 0xB7, 0x2E, 0x6A, 0xF7, 0x2E, 0x8A, 0x37, 0x2F, 0xAB, 0x17, 0x0, 0xBB, 0x97, 0x2F, 0xB, 0xA0, 0x2F, 0xEB, 0xF7, 0x2F, 0xB, 0x38, 0x30, 0x2B, 0x78, 0x30, 0x4C, 0x18, 0x0, 0xC, 0xA0, 0x30, 0x6C, 0xF8, 0x30, 0x8C, 0x38, 0x31, 0xAD, 0x18, 0x0, 0xBD, 0x18, 0x0, 0xCD, 0xB8, 0x31, 0xEE, 0xF8, 0x31, 0xE, 0x0, 0x32, 0x1F, 0x59, 0x32, }, // MathSymbol(25): - new long[] { 0x4, 0x8, 0x1000, 0x10, 0x2001, 0x3011, 0x21, 0x1021, 0x31, 0x3001, 0x2031, 0x11, 0x1001, 0x5042, 0x6002, 0x22, 0x72, 0x8002, 0x6072, 0x9002, 0x1042, 0x10A2, 0x10B2, 0x12, 0x5012, 0x7002, 0x10C2, 0x82, 0xC002, 0x1002, 0x8012, 0x42, 0x6042, 0xB2, 0x62, 0xA062, 0xB002, 0x4002, 0xB042, 0xE0D3, 0xF3, 0x103, 0x113, 0x12003, 0x133, 0x15143, 0x1163, 0x1173, 0x183, 0x19003, 0x1A003, 0x15013, 0x1B3, 0x13, 0x13003, 0x1B003, 0x1C003, 0x173, 0x1D003, 0x1E3, 0x1F3, 0x17013, 0x20003, 0x213, 0x23223, 0x14243, 0x14113, 0x253, 0x263, 0xE003, 0x1F003, 0x21253, 0x22003, 0x27004, 0x284, 0x2A294, 0x2B004, 0x2C004, 0x2D004, 0x14, 0x12E4, 0x12F4, 0x31304, 0x32014, 0x33014, 0x34004, 0x354, 0x36004, 0x374, 0x38004, 0x394, 0x13A4, 0x3B4, 0x3C4, 0x3D4, 0x3F3E4, 0x40004, 0x414, 0x42004, 0x434, 0x44004, 0x444, 0x46454, 0x47004, 0x484, 0x3C364, 0x495, 0x4A005, 0x4B005, 0x4C5, 0x4D5, 0x4E005, 0x4F5, 0x51505, 0x52015, 0x54535, 0x555, 0x57565, 0x585, 0x5A595, 0x5C5B5, 0x5D5, 0x595, 0x5F5E5, 0x61605, 0x62005, 0x63005, 0x64005, 0x66655, 0x67005, 0x685, 0x695, 0x4A5, 0x4B5, 0x6A6, 0x6C6B6, 0x6D6, 0x6E006, 0x706F6, 0x72716, 0x736, 0x746, 0x76756, 0x78776, 0x7A796, 0x7C7B6, 0x7E7D6, 0x7F006, 0x806, 0x81006, 0x826, 0x83586, 0x85846, 0x87867, 0x88007, 0x89007, 0x8A007, 0x18B7, 0x8C7, 0x8D007, 0x8E7, 0x908F7, 0x92917, 0x94937, 0x95007, 0x967, 0x98977, 0x9A998, 0x9B8, 0x19C8, 0x9D8, 0x9F9E8, 0xA08, 0x1A18, 0xA3A28, 0xA4008, 0xA58, 0xA6008, 0xA79, 0xA89, 0xAAA99, 0xACAB9, 0xAEAD9, 0xAF9, 0xB1B09, 0xB3B2A, 0xB400A, 0xB6B5A, 0xB8B7A, 0xB9B, 0xBBBAB, 0xBC00B, 0xBDC, 0xBE00C, 0xBF00C, 0xC0D, 0xC2C1D, 0xC3E, 0xC400E, 0xC6C5F, }, + new byte[] { 0x3, 0x4, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x10, 0x0, 0x10, 0x0, 0x0, 0x1, 0x20, 0x0, 0x11, 0x30, 0x0, 0x21, 0x0, 0x0, 0x21, 0x10, 0x0, 0x31, 0x0, 0x0, 0x1, 0x30, 0x0, 0x31, 0x20, 0x0, 0x11, 0x0, 0x0, 0x1, 0x10, 0x0, 0x42, 0x50, 0x0, 0x2, 0x60, 0x0, 0x22, 0x0, 0x0, 0x72, 0x0, 0x0, 0x2, 0x80, 0x0, 0x72, 0x60, 0x0, 0x2, 0x90, 0x0, 0x42, 0x10, 0x0, 0xA2, 0x10, 0x0, 0xB2, 0x10, 0x0, 0x12, 0x0, 0x0, 0x12, 0x50, 0x0, 0x2, 0x70, 0x0, 0xC2, 0x10, 0x0, 0x82, 0x0, 0x0, 0x2, 0xC0, 0x0, 0x2, 0x10, 0x0, 0x12, 0x80, 0x0, 0x42, 0x0, 0x0, 0x42, 0x60, 0x0, 0xB2, 0x0, 0x0, 0x62, 0x0, 0x0, 0x62, 0xA0, 0x0, 0x2, 0xB0, 0x0, 0x2, 0x40, 0x0, 0x42, 0xB0, 0x0, 0xD3, 0xE0, 0x0, 0xF3, 0x0, 0x0, 0x3, 0x1, 0x0, 0x13, 0x1, 0x0, 0x3, 0x20, 0x1, 0x33, 0x1, 0x0, 0x43, 0x51, 0x1, 0x63, 0x11, 0x0, 0x73, 0x11, 0x0, 0x83, 0x1, 0x0, 0x3, 0x90, 0x1, 0x3, 0xA0, 0x1, 0x13, 0x50, 0x1, 0xB3, 0x1, 0x0, 0x13, 0x0, 0x0, 0x3, 0x30, 0x1, 0x3, 0xB0, 0x1, 0x3, 0xC0, 0x1, 0x73, 0x1, 0x0, 0x3, 0xD0, 0x1, 0xE3, 0x1, 0x0, 0xF3, 0x1, 0x0, 0x13, 0x70, 0x1, 0x3, 0x0, 0x2, 0x13, 0x2, 0x0, 0x23, 0x32, 0x2, 0x43, 0x42, 0x1, 0x13, 0x41, 0x1, 0x53, 0x2, 0x0, 0x63, 0x2, 0x0, 0x3, 0xE0, 0x0, 0x3, 0xF0, 0x1, 0x53, 0x12, 0x2, 0x3, 0x20, 0x2, 0x4, 0x70, 0x2, 0x84, 0x2, 0x0, 0x94, 0xA2, 0x2, 0x4, 0xB0, 0x2, 0x4, 0xC0, 0x2, 0x4, 0xD0, 0x2, 0x14, 0x0, 0x0, 0xE4, 0x12, 0x0, 0xF4, 0x12, 0x0, 0x4, 0x13, 0x3, 0x14, 0x20, 0x3, 0x14, 0x30, 0x3, 0x4, 0x40, 0x3, 0x54, 0x3, 0x0, 0x4, 0x60, 0x3, 0x74, 0x3, 0x0, 0x4, 0x80, 0x3, 0x94, 0x3, 0x0, 0xA4, 0x13, 0x0, 0xB4, 0x3, 0x0, 0xC4, 0x3, 0x0, 0xD4, 0x3, 0x0, 0xE4, 0xF3, 0x3, 0x4, 0x0, 0x4, 0x14, 0x4, 0x0, 0x4, 0x20, 0x4, 0x34, 0x4, 0x0, 0x4, 0x40, 0x4, 0x44, 0x4, 0x0, 0x54, 0x64, 0x4, 0x4, 0x70, 0x4, 0x84, 0x4, 0x0, 0x64, 0xC3, 0x3, 0x95, 0x4, 0x0, 0x5, 0xA0, 0x4, 0x5, 0xB0, 0x4, 0xC5, 0x4, 0x0, 0xD5, 0x4, 0x0, 0x5, 0xE0, 0x4, 0xF5, 0x4, 0x0, 0x5, 0x15, 0x5, 0x15, 0x20, 0x5, 0x35, 0x45, 0x5, 0x55, 0x5, 0x0, 0x65, 0x75, 0x5, 0x85, 0x5, 0x0, 0x95, 0xA5, 0x5, 0xB5, 0xC5, 0x5, 0xD5, 0x5, 0x0, 0x95, 0x5, 0x0, 0xE5, 0xF5, 0x5, 0x5, 0x16, 0x6, 0x5, 0x20, 0x6, 0x5, 0x30, 0x6, 0x5, 0x40, 0x6, 0x55, 0x66, 0x6, 0x5, 0x70, 0x6, 0x85, 0x6, 0x0, 0x95, 0x6, 0x0, 0xA5, 0x4, 0x0, 0xB5, 0x4, 0x0, 0xA6, 0x6, 0x0, 0xB6, 0xC6, 0x6, 0xD6, 0x6, 0x0, 0x6, 0xE0, 0x6, 0xF6, 0x6, 0x7, 0x16, 0x27, 0x7, 0x36, 0x7, 0x0, 0x46, 0x7, 0x0, 0x56, 0x67, 0x7, 0x76, 0x87, 0x7, 0x96, 0xA7, 0x7, 0xB6, 0xC7, 0x7, 0xD6, 0xE7, 0x7, 0x6, 0xF0, 0x7, 0x6, 0x8, 0x0, 0x6, 0x10, 0x8, 0x26, 0x8, 0x0, 0x86, 0x35, 0x8, 0x46, 0x58, 0x8, 0x67, 0x78, 0x8, 0x7, 0x80, 0x8, 0x7, 0x90, 0x8, 0x7, 0xA0, 0x8, 0xB7, 0x18, 0x0, 0xC7, 0x8, 0x0, 0x7, 0xD0, 0x8, 0xE7, 0x8, 0x0, 0xF7, 0x8, 0x9, 0x17, 0x29, 0x9, 0x37, 0x49, 0x9, 0x7, 0x50, 0x9, 0x67, 0x9, 0x0, 0x77, 0x89, 0x9, 0x98, 0xA9, 0x9, 0xB8, 0x9, 0x0, 0xC8, 0x19, 0x0, 0xD8, 0x9, 0x0, 0xE8, 0xF9, 0x9, 0x8, 0xA, 0x0, 0x18, 0x1A, 0x0, 0x28, 0x3A, 0xA, 0x8, 0x40, 0xA, 0x58, 0xA, 0x0, 0x8, 0x60, 0xA, 0x79, 0xA, 0x0, 0x89, 0xA, 0x0, 0x99, 0xAA, 0xA, 0xB9, 0xCA, 0xA, 0xD9, 0xEA, 0xA, 0xF9, 0xA, 0x0, 0x9, 0x1B, 0xB, 0x2A, 0x3B, 0xB, 0xA, 0x40, 0xB, 0x5A, 0x6B, 0xB, 0x7A, 0x8B, 0xB, 0x9B, 0xB, 0x0, 0xAB, 0xBB, 0xB, 0xB, 0xC0, 0xB, 0xDC, 0xB, 0x0, 0xC, 0xE0, 0xB, 0xC, 0xF0, 0xB, 0xD, 0xC, 0x0, 0x1D, 0x2C, 0xC, 0x3E, 0xC, 0x0, 0xE, 0x40, 0xC, 0x5F, 0x6C, 0xC, }, // CurrencySymbol(26): - new long[] { 0x4, 0x8, 0x1000, 0x10, 0x3021, 0x1001, 0x2001, 0x3001, 0x31, 0x11, 0x5042, 0x62, 0x7002, 0x6002, 0x8002, 0x82, 0x9002, 0x92, 0x9052, 0xA003, 0xB003, 0xC3, 0xB3, 0xD3, 0xE3, 0xF3, 0xC003, 0x100E3, 0x113, 0x12003, 0x13004, 0x14004, 0x15004, 0x164, 0x174, 0x184, 0x194, 0x154, 0x1A4, 0x1B4, 0x1C4, 0x18004, 0x19004, 0x1D004, 0x1E5, 0x1F005, 0x205, 0x215, 0x225, 0x15, 0x23005, 0x245, 0x255, 0x265, 0x275, 0x285, 0x29005, 0x2A005, 0x2B5, 0x1F5, 0x2C6, 0x2D006, 0x2E6, 0x2F6, 0x30006, 0x31006, 0x326, 0x33006, 0x346, 0x356, 0x366, 0x376, 0x38006, 0x39006, 0x3A006, 0x3B006, 0x3D3C7, 0x3E007, 0x3F7, 0x40007, 0x417, 0x427, 0x43007, 0x447, 0x457, 0x467, 0x477, 0x48007, 0x497, 0x4B4A7, 0x4D4C8, 0x4E8, 0x4F008, 0x50008, 0x518, 0x52008, 0x54538, 0x558, 0x57568, 0x588, 0x59008, 0x5B5A9, 0x5C009, 0x5D009, 0x5E9, 0x5F9, 0x61609, 0x63629, 0x64009, 0x65A, 0x6600A, 0x6700A, 0x68A, 0x6A69A, 0x6C6BA, 0x6DB, 0x6EB, 0x6F00B, 0x7000B, 0x7271B, 0x73C, 0x7400C, 0x7500C, 0x7776C, 0x78D, 0x79D, 0x7B7AD, 0x7D7CE, 0x7E00E, 0x807FF, }, + new byte[] { 0x3, 0x4, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x10, 0x0, 0x10, 0x0, 0x0, 0x21, 0x30, 0x0, 0x1, 0x10, 0x0, 0x1, 0x20, 0x0, 0x1, 0x30, 0x0, 0x31, 0x0, 0x0, 0x11, 0x0, 0x0, 0x42, 0x50, 0x0, 0x62, 0x0, 0x0, 0x2, 0x70, 0x0, 0x2, 0x60, 0x0, 0x2, 0x80, 0x0, 0x82, 0x0, 0x0, 0x2, 0x90, 0x0, 0x92, 0x0, 0x0, 0x52, 0x90, 0x0, 0x3, 0xA0, 0x0, 0x3, 0xB0, 0x0, 0xC3, 0x0, 0x0, 0xB3, 0x0, 0x0, 0xD3, 0x0, 0x0, 0xE3, 0x0, 0x0, 0xF3, 0x0, 0x0, 0x3, 0xC0, 0x0, 0xE3, 0x0, 0x1, 0x13, 0x1, 0x0, 0x3, 0x20, 0x1, 0x4, 0x30, 0x1, 0x4, 0x40, 0x1, 0x4, 0x50, 0x1, 0x64, 0x1, 0x0, 0x74, 0x1, 0x0, 0x84, 0x1, 0x0, 0x94, 0x1, 0x0, 0x54, 0x1, 0x0, 0xA4, 0x1, 0x0, 0xB4, 0x1, 0x0, 0xC4, 0x1, 0x0, 0x4, 0x80, 0x1, 0x4, 0x90, 0x1, 0x4, 0xD0, 0x1, 0xE5, 0x1, 0x0, 0x5, 0xF0, 0x1, 0x5, 0x2, 0x0, 0x15, 0x2, 0x0, 0x25, 0x2, 0x0, 0x15, 0x0, 0x0, 0x5, 0x30, 0x2, 0x45, 0x2, 0x0, 0x55, 0x2, 0x0, 0x65, 0x2, 0x0, 0x75, 0x2, 0x0, 0x85, 0x2, 0x0, 0x5, 0x90, 0x2, 0x5, 0xA0, 0x2, 0xB5, 0x2, 0x0, 0xF5, 0x1, 0x0, 0xC6, 0x2, 0x0, 0x6, 0xD0, 0x2, 0xE6, 0x2, 0x0, 0xF6, 0x2, 0x0, 0x6, 0x0, 0x3, 0x6, 0x10, 0x3, 0x26, 0x3, 0x0, 0x6, 0x30, 0x3, 0x46, 0x3, 0x0, 0x56, 0x3, 0x0, 0x66, 0x3, 0x0, 0x76, 0x3, 0x0, 0x6, 0x80, 0x3, 0x6, 0x90, 0x3, 0x6, 0xA0, 0x3, 0x6, 0xB0, 0x3, 0xC7, 0xD3, 0x3, 0x7, 0xE0, 0x3, 0xF7, 0x3, 0x0, 0x7, 0x0, 0x4, 0x17, 0x4, 0x0, 0x27, 0x4, 0x0, 0x7, 0x30, 0x4, 0x47, 0x4, 0x0, 0x57, 0x4, 0x0, 0x67, 0x4, 0x0, 0x77, 0x4, 0x0, 0x7, 0x80, 0x4, 0x97, 0x4, 0x0, 0xA7, 0xB4, 0x4, 0xC8, 0xD4, 0x4, 0xE8, 0x4, 0x0, 0x8, 0xF0, 0x4, 0x8, 0x0, 0x5, 0x18, 0x5, 0x0, 0x8, 0x20, 0x5, 0x38, 0x45, 0x5, 0x58, 0x5, 0x0, 0x68, 0x75, 0x5, 0x88, 0x5, 0x0, 0x8, 0x90, 0x5, 0xA9, 0xB5, 0x5, 0x9, 0xC0, 0x5, 0x9, 0xD0, 0x5, 0xE9, 0x5, 0x0, 0xF9, 0x5, 0x0, 0x9, 0x16, 0x6, 0x29, 0x36, 0x6, 0x9, 0x40, 0x6, 0x5A, 0x6, 0x0, 0xA, 0x60, 0x6, 0xA, 0x70, 0x6, 0x8A, 0x6, 0x0, 0x9A, 0xA6, 0x6, 0xBA, 0xC6, 0x6, 0xDB, 0x6, 0x0, 0xEB, 0x6, 0x0, 0xB, 0xF0, 0x6, 0xB, 0x0, 0x7, 0x1B, 0x27, 0x7, 0x3C, 0x7, 0x0, 0xC, 0x40, 0x7, 0xC, 0x50, 0x7, 0x6C, 0x77, 0x7, 0x8D, 0x7, 0x0, 0x9D, 0x7, 0x0, 0xAD, 0xB7, 0x7, 0xCE, 0xD7, 0x7, 0xE, 0xE0, 0x7, 0xFF, 0x7, 0x8, }, // ModifierSymbol(27): - new long[] { 0x4, 0x8, 0x10, 0x1000, 0x21, 0x3001, 0x31, 0x1001, 0x11, 0x2031, 0x1031, 0x2011, 0x2001, 0x4002, 0x5002, 0x62, 0x7002, 0x8012, 0x8002, 0x9002, 0x10A2, 0x4052, 0x92, 0xB2, 0x22, 0x72, 0xC2, 0x1022, 0x8072, 0x52, 0x5042, 0xD003, 0xE003, 0xF3, 0x10003, 0x11013, 0x123, 0xD3, 0x133, 0x14003, 0x153, 0x163, 0x173, 0x10173, 0x183, 0x19003, 0x1A003, 0x171B3, 0x1C003, 0x1D0E3, 0x1E3, 0x1F004, 0x20004, 0x214, 0x22004, 0x234, 0x24004, 0x254, 0x26004, 0x1274, 0x284, 0x2A294, 0x2B2A4, 0x2C4, 0x2D004, 0x2E4, 0x2F014, 0x30234, 0x32314, 0x335, 0x34005, 0x355, 0x36005, 0x375, 0x39385, 0x3A005, 0x3B365, 0x3C005, 0x3E3D5, 0x3F5, 0x40005, 0x415, 0x43425, 0x445, 0x35345, 0x456, 0x47466, 0x49486, 0x4A6, 0x4B006, 0x4C006, 0x4D006, 0x4F4E6, 0x50006, 0x516, 0x526, 0x53006, 0x546, 0x56557, 0x577, 0x58007, 0x5A597, 0x5B7, 0x5C7, 0x5E5D7, 0x5F7, 0x61607, 0x628, 0x638, 0x648, 0x658, 0x66008, 0x678, 0x69688, 0x6A008, 0x6B9, 0x6C9, 0x6D9, 0x6E9, 0x6F009, 0x709, 0x72719, 0x7473A, 0x7500A, 0x76A, 0x7700A, 0x78A, 0x7900A, 0x7AB, 0x7C7BB, 0x7D00B, 0x7EB, 0x7F00B, 0x80C, 0x8100C, 0x82C, 0x8483C, 0x85D, 0x86D, 0x8887D, 0x8A89E, 0x8B00E, 0x8D8CF, }, + new byte[] { 0x3, 0x4, 0x0, 0x0, 0x8, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x0, 0x21, 0x0, 0x0, 0x1, 0x30, 0x0, 0x31, 0x0, 0x0, 0x1, 0x10, 0x0, 0x11, 0x0, 0x0, 0x31, 0x20, 0x0, 0x31, 0x10, 0x0, 0x11, 0x20, 0x0, 0x1, 0x20, 0x0, 0x2, 0x40, 0x0, 0x2, 0x50, 0x0, 0x62, 0x0, 0x0, 0x2, 0x70, 0x0, 0x12, 0x80, 0x0, 0x2, 0x80, 0x0, 0x2, 0x90, 0x0, 0xA2, 0x10, 0x0, 0x52, 0x40, 0x0, 0x92, 0x0, 0x0, 0xB2, 0x0, 0x0, 0x22, 0x0, 0x0, 0x72, 0x0, 0x0, 0xC2, 0x0, 0x0, 0x22, 0x10, 0x0, 0x72, 0x80, 0x0, 0x52, 0x0, 0x0, 0x42, 0x50, 0x0, 0x3, 0xD0, 0x0, 0x3, 0xE0, 0x0, 0xF3, 0x0, 0x0, 0x3, 0x0, 0x1, 0x13, 0x10, 0x1, 0x23, 0x1, 0x0, 0xD3, 0x0, 0x0, 0x33, 0x1, 0x0, 0x3, 0x40, 0x1, 0x53, 0x1, 0x0, 0x63, 0x1, 0x0, 0x73, 0x1, 0x0, 0x73, 0x1, 0x1, 0x83, 0x1, 0x0, 0x3, 0x90, 0x1, 0x3, 0xA0, 0x1, 0xB3, 0x71, 0x1, 0x3, 0xC0, 0x1, 0xE3, 0xD0, 0x1, 0xE3, 0x1, 0x0, 0x4, 0xF0, 0x1, 0x4, 0x0, 0x2, 0x14, 0x2, 0x0, 0x4, 0x20, 0x2, 0x34, 0x2, 0x0, 0x4, 0x40, 0x2, 0x54, 0x2, 0x0, 0x4, 0x60, 0x2, 0x74, 0x12, 0x0, 0x84, 0x2, 0x0, 0x94, 0xA2, 0x2, 0xA4, 0xB2, 0x2, 0xC4, 0x2, 0x0, 0x4, 0xD0, 0x2, 0xE4, 0x2, 0x0, 0x14, 0xF0, 0x2, 0x34, 0x2, 0x3, 0x14, 0x23, 0x3, 0x35, 0x3, 0x0, 0x5, 0x40, 0x3, 0x55, 0x3, 0x0, 0x5, 0x60, 0x3, 0x75, 0x3, 0x0, 0x85, 0x93, 0x3, 0x5, 0xA0, 0x3, 0x65, 0xB3, 0x3, 0x5, 0xC0, 0x3, 0xD5, 0xE3, 0x3, 0xF5, 0x3, 0x0, 0x5, 0x0, 0x4, 0x15, 0x4, 0x0, 0x25, 0x34, 0x4, 0x45, 0x4, 0x0, 0x45, 0x53, 0x3, 0x56, 0x4, 0x0, 0x66, 0x74, 0x4, 0x86, 0x94, 0x4, 0xA6, 0x4, 0x0, 0x6, 0xB0, 0x4, 0x6, 0xC0, 0x4, 0x6, 0xD0, 0x4, 0xE6, 0xF4, 0x4, 0x6, 0x0, 0x5, 0x16, 0x5, 0x0, 0x26, 0x5, 0x0, 0x6, 0x30, 0x5, 0x46, 0x5, 0x0, 0x57, 0x65, 0x5, 0x77, 0x5, 0x0, 0x7, 0x80, 0x5, 0x97, 0xA5, 0x5, 0xB7, 0x5, 0x0, 0xC7, 0x5, 0x0, 0xD7, 0xE5, 0x5, 0xF7, 0x5, 0x0, 0x7, 0x16, 0x6, 0x28, 0x6, 0x0, 0x38, 0x6, 0x0, 0x48, 0x6, 0x0, 0x58, 0x6, 0x0, 0x8, 0x60, 0x6, 0x78, 0x6, 0x0, 0x88, 0x96, 0x6, 0x8, 0xA0, 0x6, 0xB9, 0x6, 0x0, 0xC9, 0x6, 0x0, 0xD9, 0x6, 0x0, 0xE9, 0x6, 0x0, 0x9, 0xF0, 0x6, 0x9, 0x7, 0x0, 0x19, 0x27, 0x7, 0x3A, 0x47, 0x7, 0xA, 0x50, 0x7, 0x6A, 0x7, 0x0, 0xA, 0x70, 0x7, 0x8A, 0x7, 0x0, 0xA, 0x90, 0x7, 0xAB, 0x7, 0x0, 0xBB, 0xC7, 0x7, 0xB, 0xD0, 0x7, 0xEB, 0x7, 0x0, 0xB, 0xF0, 0x7, 0xC, 0x8, 0x0, 0xC, 0x10, 0x8, 0x2C, 0x8, 0x0, 0x3C, 0x48, 0x8, 0x5D, 0x8, 0x0, 0x6D, 0x8, 0x0, 0x7D, 0x88, 0x8, 0x9E, 0xA8, 0x8, 0xE, 0xB0, 0x8, 0xCF, 0xD8, 0x8, }, // OtherSymbol(28): - new long[] { 0x4, 0x9, 0x2000, 0x10, 0x2001, 0x6021, 0x4001, 0x6001, 0x31, 0x11, 0x2021, 0x2031, 0x6011, 0x4011, 0x4031, 0x21, 0x42, 0xC052, 0x62, 0x72, 0x8002, 0x82, 0xE002, 0x92, 0x2002, 0x20A2, 0xC002, 0x12012, 0x8092, 0x12002, 0x2042, 0x16012, 0x14002, 0xC2, 0x20B2, 0x2092, 0x52, 0x12, 0x1A012, 0x20C2, 0x1C012, 0x160C2, 0xA0B2, 0x8012, 0x1E0B2, 0xE0F2, 0x2032, 0xD2, 0x160A2, 0x2062, 0x18012, 0x20D2, 0x22, 0x100C2, 0x18002, 0x4002, 0x10012, 0x1E002, 0xF2, 0x103, 0x24113, 0x133, 0x2A143, 0x2E163, 0x183, 0x32003, 0x34003, 0x1B3, 0x2003, 0x2193, 0x30003, 0x38013, 0x3A003, 0x24003, 0x2183, 0x3C003, 0x21F3, 0x28003, 0x42203, 0x44013, 0x46013, 0x48213, 0x4A013, 0x4C013, 0x32013, 0x2143, 0x253, 0x2203, 0x36013, 0x2273, 0x36283, 0x2253, 0x52013, 0x21E3, 0x54223, 0x422B3, 0x1D3, 0x2C3, 0x5C2D3, 0x5E173, 0x60143, 0x4A313, 0x64203, 0x173, 0x421A3, 0x44333, 0x681A3, 0x6A1B3, 0x6C003, 0x163, 0x153, 0x70373, 0x393, 0x74003, 0x243, 0x3A3, 0x72003, 0x742D3, 0x783B4, 0x3D4, 0x3E4, 0x803F4, 0x82004, 0x14, 0x2424, 0x86014, 0x88424, 0x2454, 0x8C004, 0x474, 0x84174, 0x92484, 0x4A4, 0x24B4, 0x2464, 0x24C4, 0x4D4, 0x9C004, 0x24F4, 0x2504, 0xA2014, 0x2004, 0x524, 0x88004, 0x8A014, 0x2444, 0xA6014, 0x2544, 0xAA004, 0x564, 0xAE004, 0xB0014, 0x24A4, 0x2574, 0x2594, 0xB4014, 0xB6014, 0xBA5C4, 0xBC014, 0xC05F4, 0xC2004, 0xC4604, 0xC8634, 0xCC654, 0x674, 0x84004, 0x7A004, 0x554, 0xD2684, 0x6A4, 0xD86B4, 0x6D4, 0xDC004, 0x6E4, 0x6F4, 0x424, 0x704, 0x714, 0xDA724, 0x734, 0xCE004, 0xE4004, 0xE8004, 0xEA424, 0x765, 0x775, 0x785, 0x795, 0xF4005, 0xF6015, 0xFA7C5, 0xFC015, 0xFE7D5, 0x2805, 0x102005, 0x106825, 0x10A845, 0x2865, 0x10E015, 0x110005, 0x895, 0x114015, 0x1188B5, 0x28D5, 0x11C015, 0x28F5, 0x2905, 0x124915, 0x2935, 0x2945, 0x12A015, 0x12C005, 0x27A5, 0x130975, 0x1328E5, 0x29A5, 0x1389B5, 0x13A865, 0x13E9E5, 0x140005, 0x144A15, 0xA35, 0x148015, 0x14A005, 0xA65, 0x14E005, 0x148005, 0x150005, 0xA45, 0x154A95, 0x158AB5, 0xAD5, 0xAE5, 0xAF5, 0xB05, 0xB15, 0x166B25, 0x168005, 0x16A005, 0x16C005, 0xB75, 0xB86, 0xB96, 0xBA6, 0x176006, 0x17ABC6, 0x16, 0x17C016, 0x180BF6, 0x184C16, 0x186006, 0x2C46, 0x18CC56, 0xC76, 0xC86, 0x192016, 0x196CA6, 0x198006, 0x2CD6, 0x2CE6, 0x1A0CF6, 0x1A4D16, 0x1A8D36, 0x1ACD56, 0x1B0D76, 0x1B4D96, 0x1B8DB6, 0xDD6, 0xDE6, 0xDF6, 0xE06, 0x1C2006, 0x1C4006, 0x1C8E36, 0x1CA006, 0xE66, 0xE76, 0xE86, 0xE96, 0xEA6, 0xEB6, 0xEC6, 0x1DA006, 0x1DC006, 0x1DE006, 0x1E0006, 0xF17, 0xF27, 0x1E6007, 0x1E8007, 0xF57, 0xF67, 0x1F0F77, 0xF97, 0x1F4007, 0x2FB7, 0x1FAFC7, 0xFE7, 0x200FF7, 0x205017, 0x206017, 0x3047, 0x20D057, 0x211077, 0x215097, 0x216007, 0x21B0C7, 0x21C007, 0x10F7, 0x1107, 0x225117, 0x226007, 0x228007, 0x22D157, 0x1177, 0x1187, 0x235197, 0x11B7, 0x11C7, 0x11D7, 0x11E8, 0x11F8, 0x240008, 0x242008, 0x244008, 0x1238, 0x248018, 0x24D258, 0x251278, 0x252008, 0x12A8, 0x2008, 0x2592B8, 0x25D2D8, 0x12F8, 0x1308, 0x1318, 0x1328, 0x266008, 0x1348, 0x26A008, 0x1368, 0x271378, 0x1398, 0x13A8, 0x2793B8, 0x27D3D8, 0x27E008, 0x283409, 0x287429, 0x288009, 0x28A009, 0x28F469, 0x293489, 0x2974A9, 0x29B4C9, 0x29F4E9, 0x2A3509, 0x1529, 0x2A9539, 0x2AD559, 0x2B1579, 0x2B5599, 0x2B6009, 0x15CA, 0x2BA00A, 0x15EA, 0x15FA, 0x2C000A, 0x2C561A, 0x2C963A, 0x2CA00A, 0x2CF66A, 0x2D368A, 0x2D76AA, 0x16CB, 0x2DD6DB, 0x16FB, 0x2E000B, 0x2E571B, 0x2E973B, 0x2ED75B, 0x177C, 0x2F000C, 0x2F200C, 0x2F77AC, 0x2FB7CC, 0x17ED, 0x17FD, 0x30000D, 0x30581D, 0x30983E, 0x30D85E, 0x31187F, }, + new byte[] { 0x3, 0x4, 0x0, 0x0, 0x9, 0x0, 0x0, 0x0, 0x20, 0x0, 0x10, 0x0, 0x0, 0x1, 0x20, 0x0, 0x21, 0x60, 0x0, 0x1, 0x40, 0x0, 0x1, 0x60, 0x0, 0x31, 0x0, 0x0, 0x11, 0x0, 0x0, 0x21, 0x20, 0x0, 0x31, 0x20, 0x0, 0x11, 0x60, 0x0, 0x11, 0x40, 0x0, 0x31, 0x40, 0x0, 0x21, 0x0, 0x0, 0x42, 0x0, 0x0, 0x52, 0xC0, 0x0, 0x62, 0x0, 0x0, 0x72, 0x0, 0x0, 0x2, 0x80, 0x0, 0x82, 0x0, 0x0, 0x2, 0xE0, 0x0, 0x92, 0x0, 0x0, 0x2, 0x20, 0x0, 0xA2, 0x20, 0x0, 0x2, 0xC0, 0x0, 0x12, 0x20, 0x1, 0x92, 0x80, 0x0, 0x2, 0x20, 0x1, 0x42, 0x20, 0x0, 0x12, 0x60, 0x1, 0x2, 0x40, 0x1, 0xC2, 0x0, 0x0, 0xB2, 0x20, 0x0, 0x92, 0x20, 0x0, 0x52, 0x0, 0x0, 0x12, 0x0, 0x0, 0x12, 0xA0, 0x1, 0xC2, 0x20, 0x0, 0x12, 0xC0, 0x1, 0xC2, 0x60, 0x1, 0xB2, 0xA0, 0x0, 0x12, 0x80, 0x0, 0xB2, 0xE0, 0x1, 0xF2, 0xE0, 0x0, 0x32, 0x20, 0x0, 0xD2, 0x0, 0x0, 0xA2, 0x60, 0x1, 0x62, 0x20, 0x0, 0x12, 0x80, 0x1, 0xD2, 0x20, 0x0, 0x22, 0x0, 0x0, 0xC2, 0x0, 0x1, 0x2, 0x80, 0x1, 0x2, 0x40, 0x0, 0x12, 0x0, 0x1, 0x2, 0xE0, 0x1, 0xF2, 0x0, 0x0, 0x3, 0x1, 0x0, 0x13, 0x41, 0x2, 0x33, 0x1, 0x0, 0x43, 0xA1, 0x2, 0x63, 0xE1, 0x2, 0x83, 0x1, 0x0, 0x3, 0x20, 0x3, 0x3, 0x40, 0x3, 0xB3, 0x1, 0x0, 0x3, 0x20, 0x0, 0x93, 0x21, 0x0, 0x3, 0x0, 0x3, 0x13, 0x80, 0x3, 0x3, 0xA0, 0x3, 0x3, 0x40, 0x2, 0x83, 0x21, 0x0, 0x3, 0xC0, 0x3, 0xF3, 0x21, 0x0, 0x3, 0x80, 0x2, 0x3, 0x22, 0x4, 0x13, 0x40, 0x4, 0x13, 0x60, 0x4, 0x13, 0x82, 0x4, 0x13, 0xA0, 0x4, 0x13, 0xC0, 0x4, 0x13, 0x20, 0x3, 0x43, 0x21, 0x0, 0x53, 0x2, 0x0, 0x3, 0x22, 0x0, 0x13, 0x60, 0x3, 0x73, 0x22, 0x0, 0x83, 0x62, 0x3, 0x53, 0x22, 0x0, 0x13, 0x20, 0x5, 0xE3, 0x21, 0x0, 0x23, 0x42, 0x5, 0xB3, 0x22, 0x4, 0xD3, 0x1, 0x0, 0xC3, 0x2, 0x0, 0xD3, 0xC2, 0x5, 0x73, 0xE1, 0x5, 0x43, 0x1, 0x6, 0x13, 0xA3, 0x4, 0x3, 0x42, 0x6, 0x73, 0x1, 0x0, 0xA3, 0x21, 0x4, 0x33, 0x43, 0x4, 0xA3, 0x81, 0x6, 0xB3, 0xA1, 0x6, 0x3, 0xC0, 0x6, 0x63, 0x1, 0x0, 0x53, 0x1, 0x0, 0x73, 0x3, 0x7, 0x93, 0x3, 0x0, 0x3, 0x40, 0x7, 0x43, 0x2, 0x0, 0xA3, 0x3, 0x0, 0x3, 0x20, 0x7, 0xD3, 0x42, 0x7, 0xB4, 0x83, 0x7, 0xD4, 0x3, 0x0, 0xE4, 0x3, 0x0, 0xF4, 0x3, 0x8, 0x4, 0x20, 0x8, 0x14, 0x0, 0x0, 0x24, 0x24, 0x0, 0x14, 0x60, 0x8, 0x24, 0x84, 0x8, 0x54, 0x24, 0x0, 0x4, 0xC0, 0x8, 0x74, 0x4, 0x0, 0x74, 0x41, 0x8, 0x84, 0x24, 0x9, 0xA4, 0x4, 0x0, 0xB4, 0x24, 0x0, 0x64, 0x24, 0x0, 0xC4, 0x24, 0x0, 0xD4, 0x4, 0x0, 0x4, 0xC0, 0x9, 0xF4, 0x24, 0x0, 0x4, 0x25, 0x0, 0x14, 0x20, 0xA, 0x4, 0x20, 0x0, 0x24, 0x5, 0x0, 0x4, 0x80, 0x8, 0x14, 0xA0, 0x8, 0x44, 0x24, 0x0, 0x14, 0x60, 0xA, 0x44, 0x25, 0x0, 0x4, 0xA0, 0xA, 0x64, 0x5, 0x0, 0x4, 0xE0, 0xA, 0x14, 0x0, 0xB, 0xA4, 0x24, 0x0, 0x74, 0x25, 0x0, 0x94, 0x25, 0x0, 0x14, 0x40, 0xB, 0x14, 0x60, 0xB, 0xC4, 0xA5, 0xB, 0x14, 0xC0, 0xB, 0xF4, 0x5, 0xC, 0x4, 0x20, 0xC, 0x4, 0x46, 0xC, 0x34, 0x86, 0xC, 0x54, 0xC6, 0xC, 0x74, 0x6, 0x0, 0x4, 0x40, 0x8, 0x4, 0xA0, 0x7, 0x54, 0x5, 0x0, 0x84, 0x26, 0xD, 0xA4, 0x6, 0x0, 0xB4, 0x86, 0xD, 0xD4, 0x6, 0x0, 0x4, 0xC0, 0xD, 0xE4, 0x6, 0x0, 0xF4, 0x6, 0x0, 0x24, 0x4, 0x0, 0x4, 0x7, 0x0, 0x14, 0x7, 0x0, 0x24, 0xA7, 0xD, 0x34, 0x7, 0x0, 0x4, 0xE0, 0xC, 0x4, 0x40, 0xE, 0x4, 0x80, 0xE, 0x24, 0xA4, 0xE, 0x65, 0x7, 0x0, 0x75, 0x7, 0x0, 0x85, 0x7, 0x0, 0x95, 0x7, 0x0, 0x5, 0x40, 0xF, 0x15, 0x60, 0xF, 0xC5, 0xA7, 0xF, 0x15, 0xC0, 0xF, 0xD5, 0xE7, 0xF, 0x5, 0x28, 0x0, 0x5, 0x20, 0x10, 0x25, 0x68, 0x10, 0x45, 0xA8, 0x10, 0x65, 0x28, 0x0, 0x15, 0xE0, 0x10, 0x5, 0x0, 0x11, 0x95, 0x8, 0x0, 0x15, 0x40, 0x11, 0xB5, 0x88, 0x11, 0xD5, 0x28, 0x0, 0x15, 0xC0, 0x11, 0xF5, 0x28, 0x0, 0x5, 0x29, 0x0, 0x15, 0x49, 0x12, 0x35, 0x29, 0x0, 0x45, 0x29, 0x0, 0x15, 0xA0, 0x12, 0x5, 0xC0, 0x12, 0xA5, 0x27, 0x0, 0x75, 0x9, 0x13, 0xE5, 0x28, 0x13, 0xA5, 0x29, 0x0, 0xB5, 0x89, 0x13, 0x65, 0xA8, 0x13, 0xE5, 0xE9, 0x13, 0x5, 0x0, 0x14, 0x15, 0x4A, 0x14, 0x35, 0xA, 0x0, 0x15, 0x80, 0x14, 0x5, 0xA0, 0x14, 0x65, 0xA, 0x0, 0x5, 0xE0, 0x14, 0x5, 0x80, 0x14, 0x5, 0x0, 0x15, 0x45, 0xA, 0x0, 0x95, 0x4A, 0x15, 0xB5, 0x8A, 0x15, 0xD5, 0xA, 0x0, 0xE5, 0xA, 0x0, 0xF5, 0xA, 0x0, 0x5, 0xB, 0x0, 0x15, 0xB, 0x0, 0x25, 0x6B, 0x16, 0x5, 0x80, 0x16, 0x5, 0xA0, 0x16, 0x5, 0xC0, 0x16, 0x75, 0xB, 0x0, 0x86, 0xB, 0x0, 0x96, 0xB, 0x0, 0xA6, 0xB, 0x0, 0x6, 0x60, 0x17, 0xC6, 0xAB, 0x17, 0x16, 0x0, 0x0, 0x16, 0xC0, 0x17, 0xF6, 0xB, 0x18, 0x16, 0x4C, 0x18, 0x6, 0x60, 0x18, 0x46, 0x2C, 0x0, 0x56, 0xCC, 0x18, 0x76, 0xC, 0x0, 0x86, 0xC, 0x0, 0x16, 0x20, 0x19, 0xA6, 0x6C, 0x19, 0x6, 0x80, 0x19, 0xD6, 0x2C, 0x0, 0xE6, 0x2C, 0x0, 0xF6, 0xC, 0x1A, 0x16, 0x4D, 0x1A, 0x36, 0x8D, 0x1A, 0x56, 0xCD, 0x1A, 0x76, 0xD, 0x1B, 0x96, 0x4D, 0x1B, 0xB6, 0x8D, 0x1B, 0xD6, 0xD, 0x0, 0xE6, 0xD, 0x0, 0xF6, 0xD, 0x0, 0x6, 0xE, 0x0, 0x6, 0x20, 0x1C, 0x6, 0x40, 0x1C, 0x36, 0x8E, 0x1C, 0x6, 0xA0, 0x1C, 0x66, 0xE, 0x0, 0x76, 0xE, 0x0, 0x86, 0xE, 0x0, 0x96, 0xE, 0x0, 0xA6, 0xE, 0x0, 0xB6, 0xE, 0x0, 0xC6, 0xE, 0x0, 0x6, 0xA0, 0x1D, 0x6, 0xC0, 0x1D, 0x6, 0xE0, 0x1D, 0x6, 0x0, 0x1E, 0x17, 0xF, 0x0, 0x27, 0xF, 0x0, 0x7, 0x60, 0x1E, 0x7, 0x80, 0x1E, 0x57, 0xF, 0x0, 0x67, 0xF, 0x0, 0x77, 0xF, 0x1F, 0x97, 0xF, 0x0, 0x7, 0x40, 0x1F, 0xB7, 0x2F, 0x0, 0xC7, 0xAF, 0x1F, 0xE7, 0xF, 0x0, 0xF7, 0xF, 0x20, 0x17, 0x50, 0x20, 0x17, 0x60, 0x20, 0x47, 0x30, 0x0, 0x57, 0xD0, 0x20, 0x77, 0x10, 0x21, 0x97, 0x50, 0x21, 0x7, 0x60, 0x21, 0xC7, 0xB0, 0x21, 0x7, 0xC0, 0x21, 0xF7, 0x10, 0x0, 0x7, 0x11, 0x0, 0x17, 0x51, 0x22, 0x7, 0x60, 0x22, 0x7, 0x80, 0x22, 0x57, 0xD1, 0x22, 0x77, 0x11, 0x0, 0x87, 0x11, 0x0, 0x97, 0x51, 0x23, 0xB7, 0x11, 0x0, 0xC7, 0x11, 0x0, 0xD7, 0x11, 0x0, 0xE8, 0x11, 0x0, 0xF8, 0x11, 0x0, 0x8, 0x0, 0x24, 0x8, 0x20, 0x24, 0x8, 0x40, 0x24, 0x38, 0x12, 0x0, 0x18, 0x80, 0x24, 0x58, 0xD2, 0x24, 0x78, 0x12, 0x25, 0x8, 0x20, 0x25, 0xA8, 0x12, 0x0, 0x8, 0x20, 0x0, 0xB8, 0x92, 0x25, 0xD8, 0xD2, 0x25, 0xF8, 0x12, 0x0, 0x8, 0x13, 0x0, 0x18, 0x13, 0x0, 0x28, 0x13, 0x0, 0x8, 0x60, 0x26, 0x48, 0x13, 0x0, 0x8, 0xA0, 0x26, 0x68, 0x13, 0x0, 0x78, 0x13, 0x27, 0x98, 0x13, 0x0, 0xA8, 0x13, 0x0, 0xB8, 0x93, 0x27, 0xD8, 0xD3, 0x27, 0x8, 0xE0, 0x27, 0x9, 0x34, 0x28, 0x29, 0x74, 0x28, 0x9, 0x80, 0x28, 0x9, 0xA0, 0x28, 0x69, 0xF4, 0x28, 0x89, 0x34, 0x29, 0xA9, 0x74, 0x29, 0xC9, 0xB4, 0x29, 0xE9, 0xF4, 0x29, 0x9, 0x35, 0x2A, 0x29, 0x15, 0x0, 0x39, 0x95, 0x2A, 0x59, 0xD5, 0x2A, 0x79, 0x15, 0x2B, 0x99, 0x55, 0x2B, 0x9, 0x60, 0x2B, 0xCA, 0x15, 0x0, 0xA, 0xA0, 0x2B, 0xEA, 0x15, 0x0, 0xFA, 0x15, 0x0, 0xA, 0x0, 0x2C, 0x1A, 0x56, 0x2C, 0x3A, 0x96, 0x2C, 0xA, 0xA0, 0x2C, 0x6A, 0xF6, 0x2C, 0x8A, 0x36, 0x2D, 0xAA, 0x76, 0x2D, 0xCB, 0x16, 0x0, 0xDB, 0xD6, 0x2D, 0xFB, 0x16, 0x0, 0xB, 0x0, 0x2E, 0x1B, 0x57, 0x2E, 0x3B, 0x97, 0x2E, 0x5B, 0xD7, 0x2E, 0x7C, 0x17, 0x0, 0xC, 0x0, 0x2F, 0xC, 0x20, 0x2F, 0xAC, 0x77, 0x2F, 0xCC, 0xB7, 0x2F, 0xED, 0x17, 0x0, 0xFD, 0x17, 0x0, 0xD, 0x0, 0x30, 0x1D, 0x58, 0x30, 0x3E, 0x98, 0x30, 0x5E, 0xD8, 0x30, 0x7F, 0x18, 0x31, }, // OtherNotAssigned(29): - new long[] { 0x4, 0xA, 0x4000, 0x10, 0x11, 0x8001, 0x31, 0xC011, 0x4001, 0xC021, 0xC001, 0x4021, 0x21, 0x8011, 0x8031, 0x4031, 0x14042, 0x62, 0x20072, 0x20002, 0x14002, 0x92, 0xA2, 0x12, 0x18002, 0x10012, 0x42, 0x2C002, 0x300A2, 0x32, 0x4052, 0x14062, 0x18012, 0x10002, 0x10082, 0xC2, 0x72, 0x40B2, 0x4082, 0x30002, 0x1C012, 0x40D2, 0x82, 0x200A2, 0x52, 0x18052, 0x10052, 0x4002, 0x18082, 0x1C002, 0x28012, 0x28042, 0x22, 0x380A2, 0x180B2, 0x3C0B2, 0xD2, 0x28002, 0x38012, 0x40F2, 0x40E2, 0x1C0B2, 0x2C072, 0x20052, 0x40C2, 0x24042, 0x28052, 0x24002, 0x30042, 0x14032, 0x34012, 0x100A2, 0x280E2, 0x24062, 0xC082, 0xF2, 0x180A2, 0x4103, 0x4C123, 0x113, 0x50003, 0x153, 0x58003, 0x44173, 0x60003, 0x193, 0x1A3, 0x13, 0x4C003, 0x6C003, 0x64013, 0x70003, 0x441D3, 0x6C1E3, 0x44013, 0x173, 0x441B3, 0x5C013, 0x7C013, 0x41B3, 0x80013, 0x213, 0x223, 0x233, 0x243, 0x5C253, 0x68263, 0x78003, 0x4C203, 0x44143, 0x68013, 0x273, 0xA0253, 0x253, 0x8C293, 0x5C143, 0x8C003, 0xA8003, 0x203, 0xA0013, 0x84003, 0xAC113, 0xA82C3, 0x23, 0x2D3, 0x283, 0x2E3, 0x1B3, 0x5C2F3, 0x2A3, 0x303, 0x90013, 0xC4003, 0xC8013, 0x163, 0xCC003, 0x44003, 0xCC113, 0x333, 0x44333, 0x143, 0x741A3, 0xD0003, 0xD4183, 0x363, 0x48013, 0x98003, 0x74003, 0x44373, 0x9C383, 0x44133, 0x14003, 0xBC003, 0x58393, 0xE4003, 0xE8013, 0xF03B3, 0x58333, 0xB0213, 0x393, 0x94003, 0xF0203, 0xF4013, 0xC0333, 0xF8303, 0xCC353, 0xFC303, 0x78403, 0x54413, 0x108213, 0x10C003, 0x14153, 0x64143, 0x8C443, 0x9C003, 0x14233, 0x118453, 0xD8413, 0x120473, 0x14363, 0x94403, 0x54493, 0x128213, 0xB0153, 0x4B3, 0xBC4C3, 0x133, 0x444D4, 0x4C4E4, 0x4F4, 0x140004, 0x514, 0x14C524, 0x544, 0x554, 0x4564, 0x15C014, 0x584, 0x4004, 0x168594, 0x16C004, 0x5C4, 0x1785D4, 0x158004, 0x5F4, 0x180004, 0x184004, 0x158554, 0x17C004, 0x44004, 0x7C624, 0x5E4, 0x190634, 0x158654, 0x19C664, 0x684, 0x694, 0x1A8554, 0x574, 0x1A0554, 0x46B4, 0x1B0014, 0x17C014, 0x178004, 0x1A0004, 0x13C004, 0x504, 0x1AC004, 0x6D4, 0x45F4, 0x6E4, 0x614, 0x6F4, 0x644, 0x1C4704, 0x1C8004, 0x734, 0x744, 0x754, 0x1D8014, 0x178014, 0x774, 0x13C684, 0x148784, 0x794, 0x1487A4, 0x524, 0x564, 0x687B4, 0x1A4, 0x764, 0x15C004, 0x7C4, 0x1F4004, 0x1F8004, 0x7F4, 0x804, 0x1DC014, 0x814, 0x154824, 0x158834, 0x210004, 0x1D8004, 0x7D4, 0x13C554, 0x218854, 0x218834, 0x874, 0x21C884, 0x894, 0x228004, 0x2288B4, 0x218764, 0x864, 0x8C4, 0x1A0504, 0x230004, 0x234654, 0x238564, 0x23C004, 0x904, 0x248914, 0x250934, 0x954, 0x25C964, 0x1D4004, 0x264984, 0x2189A4, 0x1D49B4, 0x2749C4, 0x27C9E4, 0x1D4A04, 0x274A14, 0x27C7E4, 0x248764, 0x28CA24, 0x290664, 0x298A54, 0x1D4574, 0x2A0A74, 0x27CA94, 0x2ACAA4, 0x1D4AC4, 0x2B4774, 0x2BCAE4, 0x2485E4, 0x2C4B04, 0x27CB24, 0x2CCAA4, 0x1D44F4, 0x2D4B44, 0x27CB64, 0x2DCAA4, 0x15C594, 0xB84, 0x1584F4, 0x5A4, 0x1F0004, 0x19C004, 0x240834, 0x1F0504, 0x2B8004, 0x2E4004, 0xBA4, 0x2F0BB5, 0xBD5, 0x2F8005, 0xBF5, 0x304C05, 0x308005, 0x310C35, 0x314005, 0x318005, 0x31C005, 0x320005, 0x328C95, 0x308015, 0xCB5, 0x334CC5, 0xCE5, 0xCF5, 0xD05, 0x348D15, 0x350D35, 0x354005, 0xD35, 0x358BD5, 0x360D75, 0x364005, 0xDA5, 0xDB5, 0x374DC5, 0xDE5, 0x37C005, 0x380005, 0xD75, 0x2F4005, 0x384005, 0x38CE25, 0x390005, 0x398E55, 0xE75, 0x3A0005, 0x3A4015, 0x44005, 0x34C115, 0xEA5, 0xEB5, 0xEC5, 0xE15, 0x3B4005, 0xEE5, 0x3BC005, 0xF05, 0x340005, 0x318F15, 0x3C8005, 0xF35, 0x3D4F45, 0xF65, 0x3E0F75, 0x3E4005, 0xE85, 0x3ECFA5, 0x3F4FC5, 0x3F8005, 0xFF5, 0x1005, 0x340D75, 0x404015, 0x154CB5, 0x2F4BF5, 0x408005, 0x40C005, 0x415045, 0x2F45F5, 0xE65, 0x1065, 0x1075, 0x420005, 0x3DC555, 0x39D095, 0x428D35, 0x35C005, 0xF95, 0x3F0D75, 0x42C005, 0x430005, 0x4390D5, 0x43C005, 0x3AC005, 0x440015, 0x449115, 0x451135, 0x454015, 0x45D165, 0x330015, 0x2F9185, 0x469195, 0x4711B5, 0x4791D5, 0x47C005, 0x485205, 0x47D225, 0x491235, 0x47D255, 0x49D265, 0x4A5285, 0x4AD2A5, 0x4B52C5, 0x4BD2E5, 0x4C12C5, 0x4C9315, 0x4D1335, 0x4D9355, 0x4E1375, 0x4E4005, 0x4F65, 0x4E8EF5, 0x13B5, 0xFC5, 0x13C5, 0x4F4005, 0x4F8005, 0x444005, 0x3ED3F5, 0x500005, 0xE25, 0x509415, 0x1435, 0x515446, 0x518006, 0x1476, 0x525486, 0x52D4A6, 0x14C6, 0x14D6, 0x53D4E6, 0x1506, 0x1516, 0x54D526, 0x1546, 0x559556, 0x1576, 0x565586, 0x15A6, 0x15B6, 0x15C6, 0x5795D6, 0x15F6, 0x15D6, 0x580006, 0x589616, 0x1636, 0x590006, 0x595536, 0x598006, 0x59C006, 0x1466, 0x1686, 0x5A9696, 0x16B6, 0x5B56C6, 0x5BD6E6, 0x1706, 0x5C5646, 0x5C8006, 0x1736, 0x5D5746, 0x5D8006, 0x5E1776, 0x1796, 0x5ED7A6, 0x5F57C6, 0x17E6, 0x6017F6, 0x609816, 0x1836, 0x1846, 0x619856, 0x621876, 0x555896, 0x62D8A6, 0x6358C6, 0x63D8E6, 0x1906, 0x649916, 0x64D8E6, 0x525946, 0x659956, 0x661976, 0x1996, 0x19A6, 0x6719B6, 0x19D6, 0x67D9E6, 0x685A06, 0x68DA26, 0x695A46, 0x69DA66, 0x6A5A86, 0x6ADAA6, 0x6B5AC6, 0x6BDAE6, 0x6C5B06, 0x6CDB26, 0x6D5B46, 0x6DDB66, 0x6E5B86, 0x6EDBA6, 0x6F0006, 0x6F9BD6, 0x6FD676, 0x700006, 0x1C16, 0x70DC27, 0x715C47, 0x71DC67, 0x725C87, 0x72DCA7, 0x1CC7, 0x739CD7, 0x741CF7, 0x749D17, 0x751D37, 0x1D57, 0x75DD67, 0x1D87, 0x1D97, 0x768007, 0x771DB7, 0x779DD7, 0x1DF7, 0x785E07, 0x78DE27, 0x795E47, 0x79DE67, 0x7A0007, 0x1E97, 0x7ADEA7, 0x7B5EC7, 0x1EE7, 0x7C1EF7, 0x7C9F17, 0x7D1F37, 0x7D9F57, 0x7E1F77, 0x7E9F97, 0x1FB7, 0x7F5FC7, 0x7FDFE7, 0x2007, 0x80A017, 0x812037, 0x81A057, 0x822077, 0x82A097, 0x8320B7, 0x20D7, 0x83E0E7, 0x846107, 0x848007, 0x852137, 0x85A157, 0x862178, 0x2198, 0x86E1A8, 0x21C8, 0x87A1D8, 0x8821F8, 0x88A218, 0x88C008, 0x2248, 0x894008, 0x89E268, 0x8A6288, 0x8AE2A8, 0x22C8, 0x8B4008, 0x8BE2E8, 0x2308, 0x8CA318, 0x8D2338, 0x8DA358, 0x8E2378, 0x8EA398, 0x8EC008, 0x8F63C8, 0x8FE3E8, 0x906408, 0x90E428, 0x916448, 0x2468, 0x2478, 0x926489, 0x24A9, 0x24B9, 0x9364C9, 0x93E4E9, 0x2509, 0x94A519, 0x952539, 0x2559, 0x958009, 0x95C009, 0x966589, 0x96E5A9, 0x25C9, 0x97A5D9, 0x9825F9, 0x98A619, 0x992639, 0x2659, 0x99E66A, 0x268A, 0x9A400A, 0x26AA, 0x26BA, 0x9B000A, 0x9BA6DA, 0x9C26FA, 0x9CA71A, 0x9D273A, 0x9DA75A, 0x9E277A, 0x279B, 0x9E800B, 0x9F27BB, 0x27DB, 0x9F800B, 0xA027FB, 0xA0A81B, 0xA1283B, 0x285C, 0x286C, 0xA1C00C, 0x288C, 0xA2A89C, 0xA328BC, 0xA3A8DD, 0xA428FD, 0xA4A91D, 0xA5293E, 0xA5400E, 0xA5E96F, }, + new byte[] { 0x3, 0x4, 0x0, 0x0, 0xA, 0x0, 0x0, 0x0, 0x40, 0x0, 0x10, 0x0, 0x0, 0x11, 0x0, 0x0, 0x1, 0x80, 0x0, 0x31, 0x0, 0x0, 0x11, 0xC0, 0x0, 0x1, 0x40, 0x0, 0x21, 0xC0, 0x0, 0x1, 0xC0, 0x0, 0x21, 0x40, 0x0, 0x21, 0x0, 0x0, 0x11, 0x80, 0x0, 0x31, 0x80, 0x0, 0x31, 0x40, 0x0, 0x42, 0x40, 0x1, 0x62, 0x0, 0x0, 0x72, 0x0, 0x2, 0x2, 0x0, 0x2, 0x2, 0x40, 0x1, 0x92, 0x0, 0x0, 0xA2, 0x0, 0x0, 0x12, 0x0, 0x0, 0x2, 0x80, 0x1, 0x12, 0x0, 0x1, 0x42, 0x0, 0x0, 0x2, 0xC0, 0x2, 0xA2, 0x0, 0x3, 0x32, 0x0, 0x0, 0x52, 0x40, 0x0, 0x62, 0x40, 0x1, 0x12, 0x80, 0x1, 0x2, 0x0, 0x1, 0x82, 0x0, 0x1, 0xC2, 0x0, 0x0, 0x72, 0x0, 0x0, 0xB2, 0x40, 0x0, 0x82, 0x40, 0x0, 0x2, 0x0, 0x3, 0x12, 0xC0, 0x1, 0xD2, 0x40, 0x0, 0x82, 0x0, 0x0, 0xA2, 0x0, 0x2, 0x52, 0x0, 0x0, 0x52, 0x80, 0x1, 0x52, 0x0, 0x1, 0x2, 0x40, 0x0, 0x82, 0x80, 0x1, 0x2, 0xC0, 0x1, 0x12, 0x80, 0x2, 0x42, 0x80, 0x2, 0x22, 0x0, 0x0, 0xA2, 0x80, 0x3, 0xB2, 0x80, 0x1, 0xB2, 0xC0, 0x3, 0xD2, 0x0, 0x0, 0x2, 0x80, 0x2, 0x12, 0x80, 0x3, 0xF2, 0x40, 0x0, 0xE2, 0x40, 0x0, 0xB2, 0xC0, 0x1, 0x72, 0xC0, 0x2, 0x52, 0x0, 0x2, 0xC2, 0x40, 0x0, 0x42, 0x40, 0x2, 0x52, 0x80, 0x2, 0x2, 0x40, 0x2, 0x42, 0x0, 0x3, 0x32, 0x40, 0x1, 0x12, 0x40, 0x3, 0xA2, 0x0, 0x1, 0xE2, 0x80, 0x2, 0x62, 0x40, 0x2, 0x82, 0xC0, 0x0, 0xF2, 0x0, 0x0, 0xA2, 0x80, 0x1, 0x3, 0x41, 0x0, 0x23, 0xC1, 0x4, 0x13, 0x1, 0x0, 0x3, 0x0, 0x5, 0x53, 0x1, 0x0, 0x3, 0x80, 0x5, 0x73, 0x41, 0x4, 0x3, 0x0, 0x6, 0x93, 0x1, 0x0, 0xA3, 0x1, 0x0, 0x13, 0x0, 0x0, 0x3, 0xC0, 0x4, 0x3, 0xC0, 0x6, 0x13, 0x40, 0x6, 0x3, 0x0, 0x7, 0xD3, 0x41, 0x4, 0xE3, 0xC1, 0x6, 0x13, 0x40, 0x4, 0x73, 0x1, 0x0, 0xB3, 0x41, 0x4, 0x13, 0xC0, 0x5, 0x13, 0xC0, 0x7, 0xB3, 0x41, 0x0, 0x13, 0x0, 0x8, 0x13, 0x2, 0x0, 0x23, 0x2, 0x0, 0x33, 0x2, 0x0, 0x43, 0x2, 0x0, 0x53, 0xC2, 0x5, 0x63, 0x82, 0x6, 0x3, 0x80, 0x7, 0x3, 0xC2, 0x4, 0x43, 0x41, 0x4, 0x13, 0x80, 0x6, 0x73, 0x2, 0x0, 0x53, 0x2, 0xA, 0x53, 0x2, 0x0, 0x93, 0xC2, 0x8, 0x43, 0xC1, 0x5, 0x3, 0xC0, 0x8, 0x3, 0x80, 0xA, 0x3, 0x2, 0x0, 0x13, 0x0, 0xA, 0x3, 0x40, 0x8, 0x13, 0xC1, 0xA, 0xC3, 0x82, 0xA, 0x23, 0x0, 0x0, 0xD3, 0x2, 0x0, 0x83, 0x2, 0x0, 0xE3, 0x2, 0x0, 0xB3, 0x1, 0x0, 0xF3, 0xC2, 0x5, 0xA3, 0x2, 0x0, 0x3, 0x3, 0x0, 0x13, 0x0, 0x9, 0x3, 0x40, 0xC, 0x13, 0x80, 0xC, 0x63, 0x1, 0x0, 0x3, 0xC0, 0xC, 0x3, 0x40, 0x4, 0x13, 0xC1, 0xC, 0x33, 0x3, 0x0, 0x33, 0x43, 0x4, 0x43, 0x1, 0x0, 0xA3, 0x41, 0x7, 0x3, 0x0, 0xD, 0x83, 0x41, 0xD, 0x63, 0x3, 0x0, 0x13, 0x80, 0x4, 0x3, 0x80, 0x9, 0x3, 0x40, 0x7, 0x73, 0x43, 0x4, 0x83, 0xC3, 0x9, 0x33, 0x41, 0x4, 0x3, 0x40, 0x1, 0x3, 0xC0, 0xB, 0x93, 0x83, 0x5, 0x3, 0x40, 0xE, 0x13, 0x80, 0xE, 0xB3, 0x3, 0xF, 0x33, 0x83, 0x5, 0x13, 0x2, 0xB, 0x93, 0x3, 0x0, 0x3, 0x40, 0x9, 0x3, 0x2, 0xF, 0x13, 0x40, 0xF, 0x33, 0x3, 0xC, 0x3, 0x83, 0xF, 0x53, 0xC3, 0xC, 0x3, 0xC3, 0xF, 0x3, 0x84, 0x7, 0x13, 0x44, 0x5, 0x13, 0x82, 0x10, 0x3, 0xC0, 0x10, 0x53, 0x41, 0x1, 0x43, 0x41, 0x6, 0x43, 0xC4, 0x8, 0x3, 0xC0, 0x9, 0x33, 0x42, 0x1, 0x53, 0x84, 0x11, 0x13, 0x84, 0xD, 0x73, 0x4, 0x12, 0x63, 0x43, 0x1, 0x3, 0x44, 0x9, 0x93, 0x44, 0x5, 0x13, 0x82, 0x12, 0x53, 0x1, 0xB, 0xB3, 0x4, 0x0, 0xC3, 0xC4, 0xB, 0x33, 0x1, 0x0, 0xD4, 0x44, 0x4, 0xE4, 0xC4, 0x4, 0xF4, 0x4, 0x0, 0x4, 0x0, 0x14, 0x14, 0x5, 0x0, 0x24, 0xC5, 0x14, 0x44, 0x5, 0x0, 0x54, 0x5, 0x0, 0x64, 0x45, 0x0, 0x14, 0xC0, 0x15, 0x84, 0x5, 0x0, 0x4, 0x40, 0x0, 0x94, 0x85, 0x16, 0x4, 0xC0, 0x16, 0xC4, 0x5, 0x0, 0xD4, 0x85, 0x17, 0x4, 0x80, 0x15, 0xF4, 0x5, 0x0, 0x4, 0x0, 0x18, 0x4, 0x40, 0x18, 0x54, 0x85, 0x15, 0x4, 0xC0, 0x17, 0x4, 0x40, 0x4, 0x24, 0xC6, 0x7, 0xE4, 0x5, 0x0, 0x34, 0x6, 0x19, 0x54, 0x86, 0x15, 0x64, 0xC6, 0x19, 0x84, 0x6, 0x0, 0x94, 0x6, 0x0, 0x54, 0x85, 0x1A, 0x74, 0x5, 0x0, 0x54, 0x5, 0x1A, 0xB4, 0x46, 0x0, 0x14, 0x0, 0x1B, 0x14, 0xC0, 0x17, 0x4, 0x80, 0x17, 0x4, 0x0, 0x1A, 0x4, 0xC0, 0x13, 0x4, 0x5, 0x0, 0x4, 0xC0, 0x1A, 0xD4, 0x6, 0x0, 0xF4, 0x45, 0x0, 0xE4, 0x6, 0x0, 0x14, 0x6, 0x0, 0xF4, 0x6, 0x0, 0x44, 0x6, 0x0, 0x4, 0x47, 0x1C, 0x4, 0x80, 0x1C, 0x34, 0x7, 0x0, 0x44, 0x7, 0x0, 0x54, 0x7, 0x0, 0x14, 0x80, 0x1D, 0x14, 0x80, 0x17, 0x74, 0x7, 0x0, 0x84, 0xC6, 0x13, 0x84, 0x87, 0x14, 0x94, 0x7, 0x0, 0xA4, 0x87, 0x14, 0x24, 0x5, 0x0, 0x64, 0x5, 0x0, 0xB4, 0x87, 0x6, 0xA4, 0x1, 0x0, 0x64, 0x7, 0x0, 0x4, 0xC0, 0x15, 0xC4, 0x7, 0x0, 0x4, 0x40, 0x1F, 0x4, 0x80, 0x1F, 0xF4, 0x7, 0x0, 0x4, 0x8, 0x0, 0x14, 0xC0, 0x1D, 0x14, 0x8, 0x0, 0x24, 0x48, 0x15, 0x34, 0x88, 0x15, 0x4, 0x0, 0x21, 0x4, 0x80, 0x1D, 0xD4, 0x7, 0x0, 0x54, 0xC5, 0x13, 0x54, 0x88, 0x21, 0x34, 0x88, 0x21, 0x74, 0x8, 0x0, 0x84, 0xC8, 0x21, 0x94, 0x8, 0x0, 0x4, 0x80, 0x22, 0xB4, 0x88, 0x22, 0x64, 0x87, 0x21, 0x64, 0x8, 0x0, 0xC4, 0x8, 0x0, 0x4, 0x5, 0x1A, 0x4, 0x0, 0x23, 0x54, 0x46, 0x23, 0x64, 0x85, 0x23, 0x4, 0xC0, 0x23, 0x4, 0x9, 0x0, 0x14, 0x89, 0x24, 0x34, 0x9, 0x25, 0x54, 0x9, 0x0, 0x64, 0xC9, 0x25, 0x4, 0x40, 0x1D, 0x84, 0x49, 0x26, 0xA4, 0x89, 0x21, 0xB4, 0x49, 0x1D, 0xC4, 0x49, 0x27, 0xE4, 0xC9, 0x27, 0x4, 0x4A, 0x1D, 0x14, 0x4A, 0x27, 0xE4, 0xC7, 0x27, 0x64, 0x87, 0x24, 0x24, 0xCA, 0x28, 0x64, 0x6, 0x29, 0x54, 0x8A, 0x29, 0x74, 0x45, 0x1D, 0x74, 0xA, 0x2A, 0x94, 0xCA, 0x27, 0xA4, 0xCA, 0x2A, 0xC4, 0x4A, 0x1D, 0x74, 0x47, 0x2B, 0xE4, 0xCA, 0x2B, 0xE4, 0x85, 0x24, 0x4, 0x4B, 0x2C, 0x24, 0xCB, 0x27, 0xA4, 0xCA, 0x2C, 0xF4, 0x44, 0x1D, 0x44, 0x4B, 0x2D, 0x64, 0xCB, 0x27, 0xA4, 0xCA, 0x2D, 0x94, 0xC5, 0x15, 0x84, 0xB, 0x0, 0xF4, 0x84, 0x15, 0xA4, 0x5, 0x0, 0x4, 0x0, 0x1F, 0x4, 0xC0, 0x19, 0x34, 0x8, 0x24, 0x4, 0x5, 0x1F, 0x4, 0x80, 0x2B, 0x4, 0x40, 0x2E, 0xA4, 0xB, 0x0, 0xB5, 0xB, 0x2F, 0xD5, 0xB, 0x0, 0x5, 0x80, 0x2F, 0xF5, 0xB, 0x0, 0x5, 0x4C, 0x30, 0x5, 0x80, 0x30, 0x35, 0xC, 0x31, 0x5, 0x40, 0x31, 0x5, 0x80, 0x31, 0x5, 0xC0, 0x31, 0x5, 0x0, 0x32, 0x95, 0x8C, 0x32, 0x15, 0x80, 0x30, 0xB5, 0xC, 0x0, 0xC5, 0x4C, 0x33, 0xE5, 0xC, 0x0, 0xF5, 0xC, 0x0, 0x5, 0xD, 0x0, 0x15, 0x8D, 0x34, 0x35, 0xD, 0x35, 0x5, 0x40, 0x35, 0x35, 0xD, 0x0, 0xD5, 0x8B, 0x35, 0x75, 0xD, 0x36, 0x5, 0x40, 0x36, 0xA5, 0xD, 0x0, 0xB5, 0xD, 0x0, 0xC5, 0x4D, 0x37, 0xE5, 0xD, 0x0, 0x5, 0xC0, 0x37, 0x5, 0x0, 0x38, 0x75, 0xD, 0x0, 0x5, 0x40, 0x2F, 0x5, 0x40, 0x38, 0x25, 0xCE, 0x38, 0x5, 0x0, 0x39, 0x55, 0x8E, 0x39, 0x75, 0xE, 0x0, 0x5, 0x0, 0x3A, 0x15, 0x40, 0x3A, 0x5, 0x40, 0x4, 0x15, 0xC1, 0x34, 0xA5, 0xE, 0x0, 0xB5, 0xE, 0x0, 0xC5, 0xE, 0x0, 0x15, 0xE, 0x0, 0x5, 0x40, 0x3B, 0xE5, 0xE, 0x0, 0x5, 0xC0, 0x3B, 0x5, 0xF, 0x0, 0x5, 0x0, 0x34, 0x15, 0x8F, 0x31, 0x5, 0x80, 0x3C, 0x35, 0xF, 0x0, 0x45, 0x4F, 0x3D, 0x65, 0xF, 0x0, 0x75, 0xF, 0x3E, 0x5, 0x40, 0x3E, 0x85, 0xE, 0x0, 0xA5, 0xCF, 0x3E, 0xC5, 0x4F, 0x3F, 0x5, 0x80, 0x3F, 0xF5, 0xF, 0x0, 0x5, 0x10, 0x0, 0x75, 0xD, 0x34, 0x15, 0x40, 0x40, 0xB5, 0x4C, 0x15, 0xF5, 0x4B, 0x2F, 0x5, 0x80, 0x40, 0x5, 0xC0, 0x40, 0x45, 0x50, 0x41, 0xF5, 0x45, 0x2F, 0x65, 0xE, 0x0, 0x65, 0x10, 0x0, 0x75, 0x10, 0x0, 0x5, 0x0, 0x42, 0x55, 0xC5, 0x3D, 0x95, 0xD0, 0x39, 0x35, 0x8D, 0x42, 0x5, 0xC0, 0x35, 0x95, 0xF, 0x0, 0x75, 0xD, 0x3F, 0x5, 0xC0, 0x42, 0x5, 0x0, 0x43, 0xD5, 0x90, 0x43, 0x5, 0xC0, 0x43, 0x5, 0xC0, 0x3A, 0x15, 0x0, 0x44, 0x15, 0x91, 0x44, 0x35, 0x11, 0x45, 0x15, 0x40, 0x45, 0x65, 0xD1, 0x45, 0x15, 0x0, 0x33, 0x85, 0x91, 0x2F, 0x95, 0x91, 0x46, 0xB5, 0x11, 0x47, 0xD5, 0x91, 0x47, 0x5, 0xC0, 0x47, 0x5, 0x52, 0x48, 0x25, 0xD2, 0x47, 0x35, 0x12, 0x49, 0x55, 0xD2, 0x47, 0x65, 0xD2, 0x49, 0x85, 0x52, 0x4A, 0xA5, 0xD2, 0x4A, 0xC5, 0x52, 0x4B, 0xE5, 0xD2, 0x4B, 0xC5, 0x12, 0x4C, 0x15, 0x93, 0x4C, 0x35, 0x13, 0x4D, 0x55, 0x93, 0x4D, 0x75, 0x13, 0x4E, 0x5, 0x40, 0x4E, 0x65, 0x4F, 0x0, 0xF5, 0x8E, 0x4E, 0xB5, 0x13, 0x0, 0xC5, 0xF, 0x0, 0xC5, 0x13, 0x0, 0x5, 0x40, 0x4F, 0x5, 0x80, 0x4F, 0x5, 0x40, 0x44, 0xF5, 0xD3, 0x3E, 0x5, 0x0, 0x50, 0x25, 0xE, 0x0, 0x15, 0x94, 0x50, 0x35, 0x14, 0x0, 0x46, 0x54, 0x51, 0x6, 0x80, 0x51, 0x76, 0x14, 0x0, 0x86, 0x54, 0x52, 0xA6, 0xD4, 0x52, 0xC6, 0x14, 0x0, 0xD6, 0x14, 0x0, 0xE6, 0xD4, 0x53, 0x6, 0x15, 0x0, 0x16, 0x15, 0x0, 0x26, 0xD5, 0x54, 0x46, 0x15, 0x0, 0x56, 0x95, 0x55, 0x76, 0x15, 0x0, 0x86, 0x55, 0x56, 0xA6, 0x15, 0x0, 0xB6, 0x15, 0x0, 0xC6, 0x15, 0x0, 0xD6, 0x95, 0x57, 0xF6, 0x15, 0x0, 0xD6, 0x15, 0x0, 0x6, 0x0, 0x58, 0x16, 0x96, 0x58, 0x36, 0x16, 0x0, 0x6, 0x0, 0x59, 0x36, 0x55, 0x59, 0x6, 0x80, 0x59, 0x6, 0xC0, 0x59, 0x66, 0x14, 0x0, 0x86, 0x16, 0x0, 0x96, 0x96, 0x5A, 0xB6, 0x16, 0x0, 0xC6, 0x56, 0x5B, 0xE6, 0xD6, 0x5B, 0x6, 0x17, 0x0, 0x46, 0x56, 0x5C, 0x6, 0x80, 0x5C, 0x36, 0x17, 0x0, 0x46, 0x57, 0x5D, 0x6, 0x80, 0x5D, 0x76, 0x17, 0x5E, 0x96, 0x17, 0x0, 0xA6, 0xD7, 0x5E, 0xC6, 0x57, 0x5F, 0xE6, 0x17, 0x0, 0xF6, 0x17, 0x60, 0x16, 0x98, 0x60, 0x36, 0x18, 0x0, 0x46, 0x18, 0x0, 0x56, 0x98, 0x61, 0x76, 0x18, 0x62, 0x96, 0x58, 0x55, 0xA6, 0xD8, 0x62, 0xC6, 0x58, 0x63, 0xE6, 0xD8, 0x63, 0x6, 0x19, 0x0, 0x16, 0x99, 0x64, 0xE6, 0xD8, 0x64, 0x46, 0x59, 0x52, 0x56, 0x99, 0x65, 0x76, 0x19, 0x66, 0x96, 0x19, 0x0, 0xA6, 0x19, 0x0, 0xB6, 0x19, 0x67, 0xD6, 0x19, 0x0, 0xE6, 0xD9, 0x67, 0x6, 0x5A, 0x68, 0x26, 0xDA, 0x68, 0x46, 0x5A, 0x69, 0x66, 0xDA, 0x69, 0x86, 0x5A, 0x6A, 0xA6, 0xDA, 0x6A, 0xC6, 0x5A, 0x6B, 0xE6, 0xDA, 0x6B, 0x6, 0x5B, 0x6C, 0x26, 0xDB, 0x6C, 0x46, 0x5B, 0x6D, 0x66, 0xDB, 0x6D, 0x86, 0x5B, 0x6E, 0xA6, 0xDB, 0x6E, 0x6, 0x0, 0x6F, 0xD6, 0x9B, 0x6F, 0x76, 0xD6, 0x6F, 0x6, 0x0, 0x70, 0x16, 0x1C, 0x0, 0x27, 0xDC, 0x70, 0x47, 0x5C, 0x71, 0x67, 0xDC, 0x71, 0x87, 0x5C, 0x72, 0xA7, 0xDC, 0x72, 0xC7, 0x1C, 0x0, 0xD7, 0x9C, 0x73, 0xF7, 0x1C, 0x74, 0x17, 0x9D, 0x74, 0x37, 0x1D, 0x75, 0x57, 0x1D, 0x0, 0x67, 0xDD, 0x75, 0x87, 0x1D, 0x0, 0x97, 0x1D, 0x0, 0x7, 0x80, 0x76, 0xB7, 0x1D, 0x77, 0xD7, 0x9D, 0x77, 0xF7, 0x1D, 0x0, 0x7, 0x5E, 0x78, 0x27, 0xDE, 0x78, 0x47, 0x5E, 0x79, 0x67, 0xDE, 0x79, 0x7, 0x0, 0x7A, 0x97, 0x1E, 0x0, 0xA7, 0xDE, 0x7A, 0xC7, 0x5E, 0x7B, 0xE7, 0x1E, 0x0, 0xF7, 0x1E, 0x7C, 0x17, 0x9F, 0x7C, 0x37, 0x1F, 0x7D, 0x57, 0x9F, 0x7D, 0x77, 0x1F, 0x7E, 0x97, 0x9F, 0x7E, 0xB7, 0x1F, 0x0, 0xC7, 0x5F, 0x7F, 0xE7, 0xDF, 0x7F, 0x7, 0x20, 0x0, 0x17, 0xA0, 0x80, 0x37, 0x20, 0x81, 0x57, 0xA0, 0x81, 0x77, 0x20, 0x82, 0x97, 0xA0, 0x82, 0xB7, 0x20, 0x83, 0xD7, 0x20, 0x0, 0xE7, 0xE0, 0x83, 0x7, 0x61, 0x84, 0x7, 0x80, 0x84, 0x37, 0x21, 0x85, 0x57, 0xA1, 0x85, 0x78, 0x21, 0x86, 0x98, 0x21, 0x0, 0xA8, 0xE1, 0x86, 0xC8, 0x21, 0x0, 0xD8, 0xA1, 0x87, 0xF8, 0x21, 0x88, 0x18, 0xA2, 0x88, 0x8, 0xC0, 0x88, 0x48, 0x22, 0x0, 0x8, 0x40, 0x89, 0x68, 0xE2, 0x89, 0x88, 0x62, 0x8A, 0xA8, 0xE2, 0x8A, 0xC8, 0x22, 0x0, 0x8, 0x40, 0x8B, 0xE8, 0xE2, 0x8B, 0x8, 0x23, 0x0, 0x18, 0xA3, 0x8C, 0x38, 0x23, 0x8D, 0x58, 0xA3, 0x8D, 0x78, 0x23, 0x8E, 0x98, 0xA3, 0x8E, 0x8, 0xC0, 0x8E, 0xC8, 0x63, 0x8F, 0xE8, 0xE3, 0x8F, 0x8, 0x64, 0x90, 0x28, 0xE4, 0x90, 0x48, 0x64, 0x91, 0x68, 0x24, 0x0, 0x78, 0x24, 0x0, 0x89, 0x64, 0x92, 0xA9, 0x24, 0x0, 0xB9, 0x24, 0x0, 0xC9, 0x64, 0x93, 0xE9, 0xE4, 0x93, 0x9, 0x25, 0x0, 0x19, 0xA5, 0x94, 0x39, 0x25, 0x95, 0x59, 0x25, 0x0, 0x9, 0x80, 0x95, 0x9, 0xC0, 0x95, 0x89, 0x65, 0x96, 0xA9, 0xE5, 0x96, 0xC9, 0x25, 0x0, 0xD9, 0xA5, 0x97, 0xF9, 0x25, 0x98, 0x19, 0xA6, 0x98, 0x39, 0x26, 0x99, 0x59, 0x26, 0x0, 0x6A, 0xE6, 0x99, 0x8A, 0x26, 0x0, 0xA, 0x40, 0x9A, 0xAA, 0x26, 0x0, 0xBA, 0x26, 0x0, 0xA, 0x0, 0x9B, 0xDA, 0xA6, 0x9B, 0xFA, 0x26, 0x9C, 0x1A, 0xA7, 0x9C, 0x3A, 0x27, 0x9D, 0x5A, 0xA7, 0x9D, 0x7A, 0x27, 0x9E, 0x9B, 0x27, 0x0, 0xB, 0x80, 0x9E, 0xBB, 0x27, 0x9F, 0xDB, 0x27, 0x0, 0xB, 0x80, 0x9F, 0xFB, 0x27, 0xA0, 0x1B, 0xA8, 0xA0, 0x3B, 0x28, 0xA1, 0x5C, 0x28, 0x0, 0x6C, 0x28, 0x0, 0xC, 0xC0, 0xA1, 0x8C, 0x28, 0x0, 0x9C, 0xA8, 0xA2, 0xBC, 0x28, 0xA3, 0xDD, 0xA8, 0xA3, 0xFD, 0x28, 0xA4, 0x1D, 0xA9, 0xA4, 0x3E, 0x29, 0xA5, 0xE, 0x40, 0xA5, 0x6F, 0xE9, 0xA5, }, }; /// Serialized BDD representation of the set of all whitespace characters. - public static readonly long[] WhitespaceSerializedBDD = new long[] { 0x4, 0x6, 0x400, 0x10, 0x801, 0x31, 0x401, 0x421, 0xC01, 0xC11, 0x1002, 0x52, 0x1852, 0x1C02, 0x82, 0x2462, 0x2803, 0xB3, 0xC3, 0x4D3, 0x3803, 0xF3, 0x4004, 0x114, 0x4804, 0x4C04, 0x5004, 0x5404, 0x5805, 0x5C05, 0x6585, 0x6965, 0x6D65, 0x7006, 0x79D6, 0x7C06, 0x8006, 0x8407, 0x8807, 0x217, 0x9237, 0x9408, 0x9808, 0x9C08, 0xA008, 0xA409, 0xA809, 0x2B9, 0xB009, 0xB40A, 0xB80A, 0x2FA, 0xC00A, 0xC40B, 0xC80B, 0xCC0B, 0xD00B, 0xDB5C, 0xE37C, 0xEB9D, 0xEC0E, 0xF00F, }; - - /// Serialized BDD representation of the set of all word characters - public static readonly long[] WordCharactersSerializedBDD = new long[] { 0x4, 0xA, 0x4000, 0x10, 0x8001, 0x11, 0x4021, 0xC011, 0x31, 0x4001, 0x8011, 0x4031, 0xC001, 0x21, 0xC021, 0x8031, 0x14042, 0x14012, 0x4062, 0x52, 0x18002, 0x1C012, 0x18082, 0x24002, 0x4042, 0x40A2, 0x72, 0x20042, 0x4002, 0x4092, 0x20012, 0x2C0A2, 0x4022, 0x28012, 0x100C2, 0x180C2, 0x18012, 0x1C062, 0x14022, 0x18092, 0x20092, 0x340A2, 0x82, 0x4052, 0x20072, 0x92, 0x42, 0x180E2, 0x3C012, 0x40B2, 0x12, 0x38072, 0x1C092, 0x14092, 0xE2, 0xC2, 0x240D2, 0x24012, 0x280B2, 0x22, 0x40C2, 0x34082, 0x10002, 0x30072, 0x30002, 0x140A2, 0x2C012, 0x18072, 0x24072, 0x24032, 0x28092, 0x34072, 0x18042, 0x4072, 0x40F2, 0x8072, 0x3C002, 0x1C002, 0x34002, 0x4082, 0xD2, 0x28002, 0x240C2, 0x240E2, 0x32, 0x4032, 0x380A2, 0x62, 0x1C042, 0x38002, 0x240B2, 0x10052, 0x10012, 0x18052, 0x14072, 0xB2, 0x28072, 0x1C0B2, 0x1C022, 0x3C092, 0x38082, 0x24042, 0x280E2, 0x8052, 0x340C2, 0x24052, 0x380B2, 0x180A2, 0x140B2, 0x44103, 0x4123, 0x4C013, 0x4143, 0x54013, 0x4163, 0x4173, 0x4183, 0x64013, 0x1A3, 0x6C003, 0x41C3, 0x4003, 0x44013, 0x41D3, 0x78013, 0x5C003, 0x7C013, 0x48203, 0x4213, 0x781A3, 0x48003, 0x481E3, 0x70003, 0x8C223, 0x4243, 0x94003, 0x98003, 0x4273, 0x283, 0x50003, 0x48293, 0x38003, 0x2A3, 0xAC093, 0x90013, 0x42C3, 0xB4003, 0xBC2E3, 0x68013, 0x44143, 0x4303, 0xA8013, 0x74003, 0xC8313, 0x48333, 0xD01B3, 0x353, 0xD8003, 0x42A3, 0xC4373, 0x601E3, 0x68383, 0x4393, 0xEC3A3, 0xF0343, 0xF4113, 0xF8003, 0xFC013, 0x1002A3, 0xB8003, 0x104183, 0xAC1C3, 0x64203, 0x4033, 0x4423, 0x48143, 0x84013, 0x4433, 0x43E3, 0x4443, 0xAC003, 0x70323, 0x48453, 0x118423, 0x108013, 0x1E3, 0x11C1C3, 0x64483, 0x124013, 0x4313, 0xA8003, 0x784A3, 0x12C183, 0x80123, 0x44C3, 0x60003, 0x1384D3, 0x583E3, 0x13C2D3, 0x140153, 0xC41D3, 0x144003, 0x4193, 0x543E3, 0x44A3, 0x118013, 0x48013, 0x118123, 0x4463, 0x48463, 0x4523, 0xBC363, 0x14C133, 0x74013, 0x84333, 0x140003, 0x4153, 0x54123, 0x150403, 0x173, 0x801D3, 0x154013, 0x158243, 0x484E3, 0x1083C3, 0x48113, 0x113, 0xAC013, 0x15C2A3, 0x160363, 0xE4193, 0x164003, 0x503, 0x1402D3, 0x1245A3, 0x110193, 0xD8143, 0x16C463, 0x170193, 0xF8373, 0x6C5D3, 0x118563, 0x1785D3, 0x100003, 0xD85F3, 0x160373, 0x1805A3, 0xC0013, 0xFC4A3, 0x153, 0x184223, 0x180093, 0xCC313, 0x100623, 0x190633, 0x198653, 0xCC163, 0x5C3B3, 0x5F3, 0x19C093, 0x1104A3, 0x54223, 0x74683, 0x1244A3, 0x4693, 0x1A8003, 0x48403, 0x108113, 0xC4013, 0x1406B3, 0x646C3, 0x603B3, 0x1A4013, 0xDC4E3, 0x4E3, 0x446D4, 0x46E4, 0x1BC014, 0x1C4704, 0x1C4724, 0x734, 0x4744, 0x754, 0x1D8004, 0x4774, 0x4004, 0x784, 0x1E4004, 0x47A4, 0x14, 0x47B4, 0x7C4, 0x47D4, 0x1F8014, 0x2007F4, 0x208814, 0x4734, 0x1EC014, 0x4784, 0x20C014, 0x210014, 0x214734, 0x1CC014, 0x4864, 0x48014, 0x94874, 0x224884, 0x22C8A4, 0x48C4, 0x1D0734, 0x1B88D4, 0x238734, 0x48F4, 0x240014, 0x4914, 0x248734, 0x4844, 0x1E8014, 0x24C004, 0x944, 0x254004, 0x258014, 0x974, 0x2607D4, 0x4994, 0x1E0004, 0x1D0014, 0x1D0004, 0x1B8004, 0x4714, 0x250014, 0x1C4014, 0x49A4, 0x2709B4, 0x274004, 0x238004, 0x4824, 0x2788E4, 0x27C014, 0x280844, 0x1B8014, 0x1DC004, 0x284004, 0x28CA24, 0x294A44, 0x29CA64, 0x744, 0xA84, 0x298A94, 0x8E4, 0x1D0AA4, 0x2A8AB4, 0x4AC4, 0x74AD4, 0x41D4, 0x4AE4, 0x2C0AF4, 0x904, 0x4B14, 0x2C8014, 0x2CC014, 0x2D4B44, 0x2D87D4, 0x2DC014, 0x2E0014, 0x2E4844, 0x2E8734, 0x4BB4, 0x2F0014, 0x298004, 0x2F8BD4, 0x300BF4, 0x4C14, 0x4C24, 0x1E0014, 0x1ECC34, 0x314C44, 0x4984, 0x1C0014, 0x4B24, 0x228734, 0x1CC004, 0x31CC64, 0x4C84, 0x328C94, 0x4C34, 0x328C34, 0x1C0CB4, 0x330014, 0x4CD4, 0x334CE4, 0x4CF4, 0x340014, 0x340D14, 0x34CD24, 0x350014, 0x1CCD54, 0x2C4D64, 0x35C004, 0x1D4D84, 0x1D0D94, 0x360014, 0x1CCDA4, 0x298DB4, 0x370A24, 0x3747B4, 0x378014, 0x1B8734, 0x4704, 0x1BC004, 0x37C884, 0x4E04, 0x29CE14, 0x38CE24, 0x394E44, 0x398B04, 0x38CE74, 0x3A4E84, 0x200EA4, 0x3ACB04, 0x38C004, 0x3B4EC4, 0x200B34, 0x3B8B04, 0x3BCA64, 0x3C0734, 0x3C8F14, 0x38CF34, 0x3D4F44, 0x200F64, 0x3E0F74, 0x38CF94, 0x3E8A64, 0x200FB4, 0x3F0B84, 0x1BC984, 0x3F8FD4, 0x200FF4, 0x400F74, 0x38D014, 0x395024, 0x201034, 0x410F74, 0x38C714, 0x414014, 0x4894, 0x1E47C4, 0x4754, 0x1C0004, 0x1EC004, 0x5064, 0x2C4014, 0x200CC4, 0x5074, 0x420014, 0x704, 0x1C88B4, 0x424014, 0x4BD4, 0x2C8714, 0x50A4, 0x42C014, 0x50C4, 0x434014, 0x50E4, 0x43C004, 0x4407D4, 0x4CE4, 0x449114, 0x44C005, 0x5145, 0x459155, 0x461175, 0x5195, 0x46D1A5, 0x4751C5, 0x47D1E5, 0x480015, 0x484015, 0x5225, 0x48C015, 0x5245, 0x494015, 0x49D265, 0x4A0005, 0x5295, 0x4AD2A5, 0x52C5, 0x52D5, 0x4BD2E5, 0x4C5305, 0x4CD325, 0x4D5345, 0x5365, 0x4DD145, 0x4E5385, 0x491195, 0x4ED3A5, 0x4F53C5, 0x53C5, 0x53E5, 0x5013F5, 0x504015, 0x5093D5, 0x5435, 0x5445, 0x519455, 0x485225, 0x51C005, 0x1215, 0x520015, 0x529495, 0x52F5, 0x5314B5, 0x52C015, 0x5394D5, 0x14F5, 0x48015, 0x540125, 0x5515, 0x5525, 0x5535, 0x450015, 0x5545, 0x554005, 0x558005, 0x561575, 0x569595, 0x568005, 0x5715B5, 0x15D5, 0x57D5E5, 0x5605, 0x585225, 0x588015, 0x5635, 0x595645, 0x59D665, 0x5A1225, 0x5695, 0x56A5, 0x5B16B5, 0x5B96D5, 0x5C16F5, 0x5C4005, 0x1CD725, 0x5D1735, 0x5D4015, 0x1CC005, 0x5765, 0x455775, 0x451785, 0x5795, 0x57A5, 0x57B5, 0x5F0015, 0x5F97D5, 0x57F5, 0x4F1805, 0x609815, 0x5835, 0x458015, 0x5845, 0x5625, 0x474015, 0x598005, 0x614015, 0x618015, 0x621875, 0x624015, 0x5492F5, 0x628015, 0x6318B5, 0x58D5, 0x638005, 0x63D195, 0x645905, 0x64D925, 0x650005, 0x659955, 0x65C005, 0x52D985, 0x669995, 0x6719B5, 0x6799D5, 0x67D225, 0x685A05, 0x68DA25, 0x695A45, 0x69DA65, 0x6A1995, 0x6A9A95, 0x6B1AB5, 0x6B9AD5, 0x6C1AF5, 0x6C9B15, 0x6D1B35, 0x6D9B55, 0x6E1B75, 0x6E9B95, 0x6F1BB5, 0x4E5BD5, 0x6F96C5, 0x1BF5, 0x4A9C05, 0x5C15, 0x5C25, 0x70C015, 0x715C45, 0x5C65, 0x71C015, 0x725C85, 0x72DCA5, 0x730015, 0x5495, 0x734015, 0x5CE5, 0x73D6C5, 0x5D05, 0x749D15, 0x1D45, 0x45D165, 0x1185, 0x759D56, 0x761D76, 0x5D96, 0x76DDA6, 0x775DC6, 0x77DDE6, 0x785E06, 0x78DE26, 0x5E46, 0x5E56, 0x79DE66, 0x5E86, 0x7A9E96, 0x5EB6, 0x7B5EC6, 0x7BDEE6, 0x795F06, 0x7C9F16, 0x7D1F36, 0x7D9F56, 0x7DC016, 0x5F86, 0x7E9F96, 0x7F1FB6, 0x4006, 0x7F9FD6, 0x7FC016, 0x806006, 0x80E026, 0x810006, 0x81A056, 0x822076, 0x6096, 0x82E0A6, 0x830006, 0x83A0D6, 0x8420F6, 0x84A116, 0x852136, 0x85A156, 0x6176, 0x866186, 0x86E1A6, 0x8761C6, 0x87E1E6, 0x886206, 0x88E226, 0x896246, 0x89E266, 0x8A6286, 0x8AE2A6, 0x8B62C6, 0x8BE2E6, 0x8C6306, 0x6326, 0x808016, 0x8D2336, 0x8DA356, 0x8E2376, 0x6396, 0x8EE3A6, 0x8F63C6, 0x8FE3E6, 0x906406, 0x90E426, 0x916446, 0x91E466, 0x926486, 0x92E4A6, 0x9364C6, 0x93E4E6, 0x946506, 0x94E526, 0x956546, 0x95E566, 0x966586, 0x96E5A6, 0x9765C6, 0x7865E6, 0x77A5F6, 0x6606, 0x98A616, 0x992636, 0x99A656, 0x99C016, 0x9A6686, 0x66A6, 0x66B6, 0x9B1D36, 0x9BA6D6, 0x9C26F7, 0x9CA717, 0x9D2737, 0x9DA757, 0x9E2777, 0x6797, 0x9EE7A7, 0x9F67C7, 0x9FE7E7, 0xA06807, 0xA0E827, 0xA16847, 0x6867, 0x6717, 0x6877, 0xA26887, 0xA2E8A7, 0xA30007, 0xA3A8D7, 0xA428F7, 0xA4A917, 0xA52937, 0xA5A957, 0x6977, 0xA66987, 0xA6E9A7, 0xA769C7, 0xA7E9E7, 0xA86A07, 0xA8EA27, 0xA96A47, 0xA98017, 0xAA2A77, 0xAAAA97, 0xAB2AB7, 0xABAAD7, 0xAC2AF7, 0xACAB17, 0xAD2B37, 0xADAB57, 0xAE2B77, 0xAEAB97, 0xAF2BB7, 0xAFABD7, 0xB02BF7, 0xB0AC17, 0x6C37, 0xB16C47, 0x6C67, 0xB22C77, 0xB2AC98, 0x6CB8, 0xB36CC8, 0x18, 0x6CE8, 0xB42CF8, 0xB4AD18, 0xB52D38, 0xB54018, 0x6D68, 0x6D78, 0xB66D88, 0xB68008, 0xB72DB8, 0xB7ADD8, 0x6DF8, 0xB86E08, 0xB8EE28, 0xB96E48, 0xB9EE68, 0xBA0018, 0xBAAE98, 0xBAC018, 0xBB6EC8, 0xBBEEE8, 0xBC6F08, 0xBCEF28, 0xBD6F48, 0xBDEF68, 0xBE6F88, 0xBE8018, 0xBF2FB9, 0xBFAFD9, 0x6FF9, 0xC07009, 0xC0F029, 0x7049, 0xC14019, 0xC18009, 0xC23079, 0xC24009, 0xC2F0A9, 0xC370C9, 0xC3F0E9, 0xC47109, 0xC4F129, 0xC57149, 0xC5F169, 0xC67189, 0xC6F1AA, 0x71CA, 0xC7401A, 0x71EA, 0x71FA, 0x720A, 0xC8401A, 0x322A, 0xC8C00A, 0xC9724A, 0xC9F26A, 0xCA728A, 0xCAF2AA, 0x32CB, 0xCB400B, 0xCBF2EB, 0x730B, 0x731B, 0xCC801B, 0xCD333B, 0xCDB35B, 0xCE337B, 0x339C, 0x73AC, 0xCEC01C, 0x73CC, 0xCF401C, 0xCFF3EC, 0xD0740C, 0xD0F42D, 0xD1744D, 0xD1801D, 0xD2347D, 0xD2B49E, 0xD334BE, 0xD3B4DF, }; + public static readonly byte[] WhitespaceSerializedBDD = new byte[] { 0x2, 0x4, 0x0, 0x6, 0x0, 0x0, 0x4, 0x10, 0x0, 0x1, 0x8, 0x31, 0x0, 0x1, 0x4, 0x21, 0x4, 0x1, 0xC, 0x11, 0xC, 0x2, 0x10, 0x52, 0x0, 0x52, 0x18, 0x2, 0x1C, 0x82, 0x0, 0x62, 0x24, 0x3, 0x28, 0xB3, 0x0, 0xC3, 0x0, 0xD3, 0x4, 0x3, 0x38, 0xF3, 0x0, 0x4, 0x40, 0x14, 0x1, 0x4, 0x48, 0x4, 0x4C, 0x4, 0x50, 0x4, 0x54, 0x5, 0x58, 0x5, 0x5C, 0x85, 0x65, 0x65, 0x69, 0x65, 0x6D, 0x6, 0x70, 0xD6, 0x79, 0x6, 0x7C, 0x6, 0x80, 0x7, 0x84, 0x7, 0x88, 0x17, 0x2, 0x37, 0x92, 0x8, 0x94, 0x8, 0x98, 0x8, 0x9C, 0x8, 0xA0, 0x9, 0xA4, 0x9, 0xA8, 0xB9, 0x2, 0x9, 0xB0, 0xA, 0xB4, 0xA, 0xB8, 0xFA, 0x2, 0xA, 0xC0, 0xB, 0xC4, 0xB, 0xC8, 0xB, 0xCC, 0xB, 0xD0, 0x5C, 0xDB, 0x7C, 0xE3, 0x9D, 0xEB, 0xE, 0xEC, 0xF, 0xF0, }; } } diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/UnicodeCategoryRangesGenerator.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/UnicodeCategoryRangesGenerator.cs index b705f88247d6cc..c3ced759b02224 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/UnicodeCategoryRangesGenerator.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/UnicodeCategoryRangesGenerator.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; @@ -10,6 +11,7 @@ namespace System.Text.RegularExpressions.Symbolic.Unicode { #if DEBUG /// Utility for generating unicode category ranges and corresponing binary decision diagrams. + [ExcludeFromCodeCoverage] internal static class UnicodeCategoryRangesGenerator { /// Generator for BDD Unicode category definitions. @@ -49,9 +51,7 @@ private static void WriteSerializedBDDs(StreamWriter sw) } Ranges whitespace = new Ranges(); - Ranges wordcharacter = new Ranges(); Regex whitespaceRegex = new(@"\s"); - Regex wordcharRegex = new(@"\w"); for (int i = 0; i <= maxChar; i++) { char ch = (char)i; @@ -59,9 +59,6 @@ private static void WriteSerializedBDDs(StreamWriter sw) if (whitespaceRegex.IsMatch(ch.ToString())) whitespace.Add(i); - - if (wordcharRegex.IsMatch(ch.ToString())) - wordcharacter.Add(i); } //generate bdd reprs for each of the category ranges @@ -72,35 +69,28 @@ private static void WriteSerializedBDDs(StreamWriter sw) BDD whitespaceBdd = bddb.CreateBddForIntRanges(whitespace.ranges); - BDD wordCharBdd = bddb.CreateBddForIntRanges(wordcharacter.ranges); - sw.WriteLine(" /// Serialized BDD representations of all the Unicode categories."); - sw.WriteLine(" public static readonly long[][] AllCategoriesSerializedBDD = new long[][]"); + sw.WriteLine(" public static readonly byte[][] AllCategoriesSerializedBDD = new byte[][]"); sw.WriteLine(" {"); for (int i = 0; i < catBDDs.Length; i++) { sw.WriteLine(" // {0}({1}):", (UnicodeCategory)i, i); sw.Write(" "); - GeneratorHelper.WriteInt64ArrayInitSyntax(sw, catBDDs[i].Serialize()); + GeneratorHelper.WriteByteArrayInitSyntax(sw, catBDDs[i].SerializeToBytes()); sw.WriteLine(","); } sw.WriteLine(" };"); sw.WriteLine(); sw.WriteLine(" /// Serialized BDD representation of the set of all whitespace characters."); - sw.Write($" public static readonly long[] WhitespaceSerializedBDD = "); - GeneratorHelper.WriteInt64ArrayInitSyntax(sw, whitespaceBdd.Serialize()); - sw.WriteLine(";"); - sw.WriteLine(); - - sw.WriteLine(" /// Serialized BDD representation of the set of all word characters"); - sw.Write($" public static readonly long[] WordCharactersSerializedBDD = "); - GeneratorHelper.WriteInt64ArrayInitSyntax(sw, wordCharBdd.Serialize()); + sw.Write($" public static readonly byte[] WhitespaceSerializedBDD = "); + GeneratorHelper.WriteByteArrayInitSyntax(sw, whitespaceBdd.SerializeToBytes()); sw.WriteLine(";"); } } /// Used internally for creating a collection of ranges for serialization. + [ExcludeFromCodeCoverage] internal sealed class Ranges { public readonly List ranges = new List(); diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/UnicodeCategoryTheory.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/UnicodeCategoryTheory.cs index f167d563c20b42..2d931fb9c95c2d 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/UnicodeCategoryTheory.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/Unicode/UnicodeCategoryTheory.cs @@ -45,8 +45,11 @@ public TPredicate WordLetterCondition { if (_wordLetterCondition is not TPredicate condition) { - BDD bdd = BDD.Deserialize(UnicodeCategoryRanges.WordCharactersSerializedBDD, _solver.CharSetProvider); - _wordLetterCondition = condition = _solver.ConvertFromCharSet(_solver.CharSetProvider, bdd); + // \w is the union of the 8 categories: 0,1,2,3,4,5,8,18 + TPredicate[] predicates = new TPredicate[] { + CategoryCondition(0), CategoryCondition(1), CategoryCondition(2), CategoryCondition(3), + CategoryCondition(4), CategoryCondition(5), CategoryCondition(8), CategoryCondition(18)}; + _wordLetterCondition = condition = _solver.Or(predicates); } return condition; diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Threading/StackHelper.cs b/src/libraries/System.Text.RegularExpressions/src/System/Threading/StackHelper.cs index 247c60ff46bd34..e15d49c78ff4c2 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Threading/StackHelper.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Threading/StackHelper.cs @@ -114,5 +114,21 @@ public static TResult CallOnEmptyStack(Func func(arg1, arg2, arg3)) .ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) .GetAwaiter().GetResult(); + + /// Calls the provided function on the stack of a different thread pool thread. + /// The type of the first argument to pass to the function. + /// The type of the second argument to pass to the function. + /// The type of the third argument to pass to the function. + /// The type of the fourth argument to pass to the function. + /// The return type of the function. + /// The function to invoke. + /// The first argument to pass to the function. + /// The second argument to pass to the function. + /// The third argument to pass to the function. + /// The fourth argument to pass to the function. + public static TResult CallOnEmptyStack(Func func, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4) => + Task.Run(() => func(arg1, arg2, arg3, arg4)) + .ContinueWith(t => t.GetAwaiter().GetResult(), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default) + .GetAwaiter().GetResult(); } } diff --git a/src/libraries/System.Text.RegularExpressions/tests/MonoRegexTests.cs b/src/libraries/System.Text.RegularExpressions/tests/MonoRegexTests.cs index 65289ac73d1216..9fa5749f667d05 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/MonoRegexTests.cs +++ b/src/libraries/System.Text.RegularExpressions/tests/MonoRegexTests.cs @@ -70,7 +70,10 @@ public static IEnumerable ValidateRegex_MemberData() (string Pattern, RegexOptions Options, string Input, string Expected) testCase = allEngineCases[i]; yield return new object[] { engine, testCase.Pattern, testCase.Options, results[i], testCase.Input, expected }; - yield return new object[] { engine, testCase.Pattern, testCase.Options | RegexOptions.CultureInvariant, results[i], testCase.Input, expected }; + if ((testCase.Options & RegexOptions.IgnoreCase) != 0) + { + yield return new object[] { engine, testCase.Pattern, testCase.Options | RegexOptions.CultureInvariant, results[i], testCase.Input, expected }; + } } } diff --git a/src/libraries/System.Text.RegularExpressions/tests/Regex.Groups.Tests.cs b/src/libraries/System.Text.RegularExpressions/tests/Regex.Groups.Tests.cs index 5b43fab690865f..723bb034acc6cd 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/Regex.Groups.Tests.cs +++ b/src/libraries/System.Text.RegularExpressions/tests/Regex.Groups.Tests.cs @@ -13,119 +13,121 @@ public class RegexGroupTests { public static IEnumerable Groups_Basic_TestData() { - // (A - B) B is a subset of A(ie B only contains chars that are in A) - yield return new object[] { null, "[abcd-[d]]+", "dddaabbccddd", RegexOptions.None, new string[] { "aabbcc" } }; + foreach (RegexEngine engine in RegexHelpers.AvailableEngines) + { + // (A - B) B is a subset of A(ie B only contains chars that are in A) + yield return new object[] { engine, null, "[abcd-[d]]+", "dddaabbccddd", RegexOptions.None, new string[] { "aabbcc" } }; - yield return new object[] { null, @"[\d-[357]]+", "33312468955", RegexOptions.None, new string[] { "124689" } }; - yield return new object[] { null, @"[\d-[357]]+", "51246897", RegexOptions.None, new string[] { "124689" } }; - yield return new object[] { null, @"[\d-[357]]+", "3312468977", RegexOptions.None, new string[] { "124689" } }; + yield return new object[] { engine, null, @"[\d-[357]]+", "33312468955", RegexOptions.None, new string[] { "124689" } }; + yield return new object[] { engine, null, @"[\d-[357]]+", "51246897", RegexOptions.None, new string[] { "124689" } }; + yield return new object[] { engine, null, @"[\d-[357]]+", "3312468977", RegexOptions.None, new string[] { "124689" } }; - yield return new object[] { null, @"[\w-[b-y]]+", "bbbaaaABCD09zzzyyy", RegexOptions.None, new string[] { "aaaABCD09zzz" } }; + yield return new object[] { engine, null, @"[\w-[b-y]]+", "bbbaaaABCD09zzzyyy", RegexOptions.None, new string[] { "aaaABCD09zzz" } }; - yield return new object[] { null, @"[\w-[\d]]+", "0AZaz9", RegexOptions.None, new string[] { "AZaz" } }; - yield return new object[] { null, @"[\w-[\p{Ll}]]+", "a09AZz", RegexOptions.None, new string[] { "09AZ" } }; + yield return new object[] { engine, null, @"[\w-[\d]]+", "0AZaz9", RegexOptions.None, new string[] { "AZaz" } }; + yield return new object[] { engine, null, @"[\w-[\p{Ll}]]+", "a09AZz", RegexOptions.None, new string[] { "09AZ" } }; - yield return new object[] { null, @"[\d-[13579]]+", "1024689", RegexOptions.ECMAScript, new string[] { "02468" } }; - yield return new object[] { null, @"[\d-[13579]]+", "\x066102468\x0660", RegexOptions.ECMAScript, new string[] { "02468" } }; - yield return new object[] { null, @"[\d-[13579]]+", "\x066102468\x0660", RegexOptions.None, new string[] { "\x066102468\x0660" } }; + yield return new object[] { engine, null, @"[\d-[13579]]+", "1024689", RegexOptions.ECMAScript, new string[] { "02468" } }; + yield return new object[] { engine, null, @"[\d-[13579]]+", "\x066102468\x0660", RegexOptions.ECMAScript, new string[] { "02468" } }; + yield return new object[] { engine, null, @"[\d-[13579]]+", "\x066102468\x0660", RegexOptions.None, new string[] { "\x066102468\x0660" } }; - yield return new object[] { null, @"[\p{Ll}-[ae-z]]+", "aaabbbcccdddeee", RegexOptions.None, new string[] { "bbbcccddd" } }; - yield return new object[] { null, @"[\p{Nd}-[2468]]+", "20135798", RegexOptions.None, new string[] { "013579" } }; + yield return new object[] { engine, null, @"[\p{Ll}-[ae-z]]+", "aaabbbcccdddeee", RegexOptions.None, new string[] { "bbbcccddd" } }; + yield return new object[] { engine, null, @"[\p{Nd}-[2468]]+", "20135798", RegexOptions.None, new string[] { "013579" } }; - yield return new object[] { null, @"[\P{Lu}-[ae-z]]+", "aaabbbcccdddeee", RegexOptions.None, new string[] { "bbbcccddd" } }; - yield return new object[] { null, @"[\P{Nd}-[\p{Ll}]]+", "az09AZ'[]", RegexOptions.None, new string[] { "AZ'[]" } }; + yield return new object[] { engine, null, @"[\P{Lu}-[ae-z]]+", "aaabbbcccdddeee", RegexOptions.None, new string[] { "bbbcccddd" } }; + yield return new object[] { engine, null, @"[\P{Nd}-[\p{Ll}]]+", "az09AZ'[]", RegexOptions.None, new string[] { "AZ'[]" } }; - // (A - B) B is a superset of A (ie B contains chars that are in A plus other chars that are not in A) - yield return new object[] { null, "[abcd-[def]]+", "fedddaabbccddd", RegexOptions.None, new string[] { "aabbcc" } }; + // (A - B) B is a superset of A (ie B contains chars that are in A plus other chars that are not in A) + yield return new object[] { engine, null, "[abcd-[def]]+", "fedddaabbccddd", RegexOptions.None, new string[] { "aabbcc" } }; - yield return new object[] { null, @"[\d-[357a-z]]+", "az33312468955", RegexOptions.None, new string[] { "124689" } }; - yield return new object[] { null, @"[\d-[de357fgA-Z]]+", "AZ51246897", RegexOptions.None, new string[] { "124689" } }; - yield return new object[] { null, @"[\d-[357\p{Ll}]]+", "az3312468977", RegexOptions.None, new string[] { "124689" } }; + yield return new object[] { engine, null, @"[\d-[357a-z]]+", "az33312468955", RegexOptions.None, new string[] { "124689" } }; + yield return new object[] { engine, null, @"[\d-[de357fgA-Z]]+", "AZ51246897", RegexOptions.None, new string[] { "124689" } }; + yield return new object[] { engine, null, @"[\d-[357\p{Ll}]]+", "az3312468977", RegexOptions.None, new string[] { "124689" } }; - yield return new object[] { null, @"[\w-[b-y\s]]+", " \tbbbaaaABCD09zzzyyy", RegexOptions.None, new string[] { "aaaABCD09zzz" } }; + yield return new object[] { engine, null, @"[\w-[b-y\s]]+", " \tbbbaaaABCD09zzzyyy", RegexOptions.None, new string[] { "aaaABCD09zzz" } }; - yield return new object[] { null, @"[\w-[\d\p{Po}]]+", "!#0AZaz9", RegexOptions.None, new string[] { "AZaz" } }; - yield return new object[] { null, @"[\w-[\p{Ll}\s]]+", "a09AZz", RegexOptions.None, new string[] { "09AZ" } }; + yield return new object[] { engine, null, @"[\w-[\d\p{Po}]]+", "!#0AZaz9", RegexOptions.None, new string[] { "AZaz" } }; + yield return new object[] { engine, null, @"[\w-[\p{Ll}\s]]+", "a09AZz", RegexOptions.None, new string[] { "09AZ" } }; - yield return new object[] { null, @"[\d-[13579a-zA-Z]]+", "AZ1024689", RegexOptions.ECMAScript, new string[] { "02468" } }; - yield return new object[] { null, @"[\d-[13579abcd]]+", "abcd\x066102468\x0660", RegexOptions.ECMAScript, new string[] { "02468" } }; - yield return new object[] { null, @"[\d-[13579\s]]+", " \t\x066102468\x0660", RegexOptions.None, new string[] { "\x066102468\x0660" } }; + yield return new object[] { engine, null, @"[\d-[13579a-zA-Z]]+", "AZ1024689", RegexOptions.ECMAScript, new string[] { "02468" } }; + yield return new object[] { engine, null, @"[\d-[13579abcd]]+", "abcd\x066102468\x0660", RegexOptions.ECMAScript, new string[] { "02468" } }; + yield return new object[] { engine, null, @"[\d-[13579\s]]+", " \t\x066102468\x0660", RegexOptions.None, new string[] { "\x066102468\x0660" } }; - yield return new object[] { null, @"[\w-[b-y\p{Po}]]+", "!#bbbaaaABCD09zzzyyy", RegexOptions.None, new string[] { "aaaABCD09zzz" } }; + yield return new object[] { engine, null, @"[\w-[b-y\p{Po}]]+", "!#bbbaaaABCD09zzzyyy", RegexOptions.None, new string[] { "aaaABCD09zzz" } }; - yield return new object[] { null, @"[\w-[b-y!.,]]+", "!.,bbbaaaABCD09zzzyyy", RegexOptions.None, new string[] { "aaaABCD09zzz" } }; - yield return new object[] { null, "[\\w-[b-y\x00-\x0F]]+", "\0bbbaaaABCD09zzzyyy", RegexOptions.None, new string[] { "aaaABCD09zzz" } }; + yield return new object[] { engine, null, @"[\w-[b-y!.,]]+", "!.,bbbaaaABCD09zzzyyy", RegexOptions.None, new string[] { "aaaABCD09zzz" } }; + yield return new object[] { engine, null, "[\\w-[b-y\x00-\x0F]]+", "\0bbbaaaABCD09zzzyyy", RegexOptions.None, new string[] { "aaaABCD09zzz" } }; - yield return new object[] { null, @"[\p{Ll}-[ae-z0-9]]+", "09aaabbbcccdddeee", RegexOptions.None, new string[] { "bbbcccddd" } }; - yield return new object[] { null, @"[\p{Nd}-[2468az]]+", "az20135798", RegexOptions.None, new string[] { "013579" } }; + yield return new object[] { engine, null, @"[\p{Ll}-[ae-z0-9]]+", "09aaabbbcccdddeee", RegexOptions.None, new string[] { "bbbcccddd" } }; + yield return new object[] { engine, null, @"[\p{Nd}-[2468az]]+", "az20135798", RegexOptions.None, new string[] { "013579" } }; - yield return new object[] { null, @"[\P{Lu}-[ae-zA-Z]]+", "AZaaabbbcccdddeee", RegexOptions.None, new string[] { "bbbcccddd" } }; - yield return new object[] { null, @"[\P{Nd}-[\p{Ll}0123456789]]+", "09az09AZ'[]", RegexOptions.None, new string[] { "AZ'[]" } }; + yield return new object[] { engine, null, @"[\P{Lu}-[ae-zA-Z]]+", "AZaaabbbcccdddeee", RegexOptions.None, new string[] { "bbbcccddd" } }; + yield return new object[] { engine, null, @"[\P{Nd}-[\p{Ll}0123456789]]+", "09az09AZ'[]", RegexOptions.None, new string[] { "AZ'[]" } }; - // (A - B) B only contains chars that are not in A - yield return new object[] { null, "[abc-[defg]]+", "dddaabbccddd", RegexOptions.None, new string[] { "aabbcc" } }; + // (A - B) B only contains chars that are not in A + yield return new object[] { engine, null, "[abc-[defg]]+", "dddaabbccddd", RegexOptions.None, new string[] { "aabbcc" } }; - yield return new object[] { null, @"[\d-[abc]]+", "abc09abc", RegexOptions.None, new string[] { "09" } }; - yield return new object[] { null, @"[\d-[a-zA-Z]]+", "az09AZ", RegexOptions.None, new string[] { "09" } }; - yield return new object[] { null, @"[\d-[\p{Ll}]]+", "az09az", RegexOptions.None, new string[] { "09" } }; + yield return new object[] { engine, null, @"[\d-[abc]]+", "abc09abc", RegexOptions.None, new string[] { "09" } }; + yield return new object[] { engine, null, @"[\d-[a-zA-Z]]+", "az09AZ", RegexOptions.None, new string[] { "09" } }; + yield return new object[] { engine, null, @"[\d-[\p{Ll}]]+", "az09az", RegexOptions.None, new string[] { "09" } }; - yield return new object[] { null, @"[\w-[\x00-\x0F]]+", "bbbaaaABYZ09zzzyyy", RegexOptions.None, new string[] { "bbbaaaABYZ09zzzyyy" } }; + yield return new object[] { engine, null, @"[\w-[\x00-\x0F]]+", "bbbaaaABYZ09zzzyyy", RegexOptions.None, new string[] { "bbbaaaABYZ09zzzyyy" } }; - yield return new object[] { null, @"[\w-[\s]]+", "0AZaz9", RegexOptions.None, new string[] { "0AZaz9" } }; - yield return new object[] { null, @"[\w-[\W]]+", "0AZaz9", RegexOptions.None, new string[] { "0AZaz9" } }; - yield return new object[] { null, @"[\w-[\p{Po}]]+", "#a09AZz!", RegexOptions.None, new string[] { "a09AZz" } }; + yield return new object[] { engine, null, @"[\w-[\s]]+", "0AZaz9", RegexOptions.None, new string[] { "0AZaz9" } }; + yield return new object[] { engine, null, @"[\w-[\W]]+", "0AZaz9", RegexOptions.None, new string[] { "0AZaz9" } }; + yield return new object[] { engine, null, @"[\w-[\p{Po}]]+", "#a09AZz!", RegexOptions.None, new string[] { "a09AZz" } }; - yield return new object[] { null, @"[\d-[\D]]+", "azAZ1024689", RegexOptions.ECMAScript, new string[] { "1024689" } }; - yield return new object[] { null, @"[\d-[a-zA-Z]]+", "azAZ\x066102468\x0660", RegexOptions.ECMAScript, new string[] { "02468" } }; - yield return new object[] { null, @"[\d-[\p{Ll}]]+", "\x066102468\x0660", RegexOptions.None, new string[] { "\x066102468\x0660" } }; + yield return new object[] { engine, null, @"[\d-[\D]]+", "azAZ1024689", RegexOptions.ECMAScript, new string[] { "1024689" } }; + yield return new object[] { engine, null, @"[\d-[a-zA-Z]]+", "azAZ\x066102468\x0660", RegexOptions.ECMAScript, new string[] { "02468" } }; + yield return new object[] { engine, null, @"[\d-[\p{Ll}]]+", "\x066102468\x0660", RegexOptions.None, new string[] { "\x066102468\x0660" } }; - yield return new object[] { null, @"[a-zA-Z0-9-[\s]]+", " \tazAZ09", RegexOptions.None, new string[] { "azAZ09" } }; + yield return new object[] { engine, null, @"[a-zA-Z0-9-[\s]]+", " \tazAZ09", RegexOptions.None, new string[] { "azAZ09" } }; - yield return new object[] { null, @"[a-zA-Z0-9-[\W]]+", "bbbaaaABCD09zzzyyy", RegexOptions.None, new string[] { "bbbaaaABCD09zzzyyy" } }; - yield return new object[] { null, @"[a-zA-Z0-9-[^a-zA-Z0-9]]+", "bbbaaaABCD09zzzyyy", RegexOptions.None, new string[] { "bbbaaaABCD09zzzyyy" } }; + yield return new object[] { engine, null, @"[a-zA-Z0-9-[\W]]+", "bbbaaaABCD09zzzyyy", RegexOptions.None, new string[] { "bbbaaaABCD09zzzyyy" } }; + yield return new object[] { engine, null, @"[a-zA-Z0-9-[^a-zA-Z0-9]]+", "bbbaaaABCD09zzzyyy", RegexOptions.None, new string[] { "bbbaaaABCD09zzzyyy" } }; - yield return new object[] { null, @"[\p{Ll}-[A-Z]]+", "AZaz09", RegexOptions.None, new string[] { "az" } }; - yield return new object[] { null, @"[\p{Nd}-[a-z]]+", "az09", RegexOptions.None, new string[] { "09" } }; + yield return new object[] { engine, null, @"[\p{Ll}-[A-Z]]+", "AZaz09", RegexOptions.None, new string[] { "az" } }; + yield return new object[] { engine, null, @"[\p{Nd}-[a-z]]+", "az09", RegexOptions.None, new string[] { "09" } }; - yield return new object[] { null, @"[\P{Lu}-[\p{Lu}]]+", "AZazAZ", RegexOptions.None, new string[] { "az" } }; - yield return new object[] { null, @"[\P{Lu}-[A-Z]]+", "AZazAZ", RegexOptions.None, new string[] { "az" } }; - yield return new object[] { null, @"[\P{Nd}-[\p{Nd}]]+", "azAZ09", RegexOptions.None, new string[] { "azAZ" } }; - yield return new object[] { null, @"[\P{Nd}-[2-8]]+", "1234567890azAZ1234567890", RegexOptions.None, new string[] { "azAZ" } }; + yield return new object[] { engine, null, @"[\P{Lu}-[\p{Lu}]]+", "AZazAZ", RegexOptions.None, new string[] { "az" } }; + yield return new object[] { engine, null, @"[\P{Lu}-[A-Z]]+", "AZazAZ", RegexOptions.None, new string[] { "az" } }; + yield return new object[] { engine, null, @"[\P{Nd}-[\p{Nd}]]+", "azAZ09", RegexOptions.None, new string[] { "azAZ" } }; + yield return new object[] { engine, null, @"[\P{Nd}-[2-8]]+", "1234567890azAZ1234567890", RegexOptions.None, new string[] { "azAZ" } }; - // Alternating construct - yield return new object[] { null, @"([ ]|[\w-[0-9]])+", "09az AZ90", RegexOptions.None, new string[] { "az AZ", "Z" } }; - yield return new object[] { null, @"([0-9-[02468]]|[0-9-[13579]])+", "az1234567890za", RegexOptions.None, new string[] { "1234567890", "0" } }; - yield return new object[] { null, @"([^0-9-[a-zAE-Z]]|[\w-[a-zAF-Z]])+", "azBCDE1234567890BCDEFza", RegexOptions.None, new string[] { "BCDE1234567890BCDE", "E" } }; - yield return new object[] { null, @"([\p{Ll}-[aeiou]]|[^\w-[\s]])+", "aeiobcdxyz!@#aeio", RegexOptions.None, new string[] { "bcdxyz!@#", "#" } }; - yield return new object[] { null, @"(?:hello|hi){1,3}", "hello", RegexOptions.None, new string[] { "hello" } }; - yield return new object[] { null, @"(hello|hi){1,3}", "hellohihey", RegexOptions.None, new string[] { "hellohi", "hi" } }; - yield return new object[] { null, @"(?:hello|hi){1,3}", "hellohihey", RegexOptions.None, new string[] { "hellohi" } }; - yield return new object[] { null, @"(?:hello|hi){2,2}", "hellohihey", RegexOptions.None, new string[] { "hellohi" } }; - yield return new object[] { null, @"(?:hello|hi){2,2}?", "hellohihihello", RegexOptions.None, new string[] { "hellohi" } }; - yield return new object[] { null, @"(?:abc|def|ghi|hij|klm|no){1,4}", "this is a test nonoabcxyz this is only a test", RegexOptions.None, new string[] { "nonoabc" } }; - yield return new object[] { null, @"xyz(abc|def)xyz", "abcxyzdefxyzabc", RegexOptions.None, new string[] { "xyzdefxyz", "def" } }; - yield return new object[] { null, @"abc|(?:def|ghi)", "ghi", RegexOptions.None, new string[] { "ghi" } }; - yield return new object[] { null, @"abc|(def|ghi)", "def", RegexOptions.None, new string[] { "def", "def" } }; + // Alternating construct + yield return new object[] { engine, null, @"([ ]|[\w-[0-9]])+", "09az AZ90", RegexOptions.None, new string[] { "az AZ", "Z" } }; + yield return new object[] { engine, null, @"([0-9-[02468]]|[0-9-[13579]])+", "az1234567890za", RegexOptions.None, new string[] { "1234567890", "0" } }; + yield return new object[] { engine, null, @"([^0-9-[a-zAE-Z]]|[\w-[a-zAF-Z]])+", "azBCDE1234567890BCDEFza", RegexOptions.None, new string[] { "BCDE1234567890BCDE", "E" } }; + yield return new object[] { engine, null, @"([\p{Ll}-[aeiou]]|[^\w-[\s]])+", "aeiobcdxyz!@#aeio", RegexOptions.None, new string[] { "bcdxyz!@#", "#" } }; + yield return new object[] { engine, null, @"(?:hello|hi){1,3}", "hello", RegexOptions.None, new string[] { "hello" } }; + yield return new object[] { engine, null, @"(hello|hi){1,3}", "hellohihey", RegexOptions.None, new string[] { "hellohi", "hi" } }; + yield return new object[] { engine, null, @"(?:hello|hi){1,3}", "hellohihey", RegexOptions.None, new string[] { "hellohi" } }; + yield return new object[] { engine, null, @"(?:hello|hi){2,2}", "hellohihey", RegexOptions.None, new string[] { "hellohi" } }; + yield return new object[] { engine, null, @"(?:hello|hi){2,2}?", "hellohihihello", RegexOptions.None, new string[] { "hellohi" } }; + yield return new object[] { engine, null, @"(?:abc|def|ghi|hij|klm|no){1,4}", "this is a test nonoabcxyz this is only a test", RegexOptions.None, new string[] { "nonoabc" } }; + yield return new object[] { engine, null, @"xyz(abc|def)xyz", "abcxyzdefxyzabc", RegexOptions.None, new string[] { "xyzdefxyz", "def" } }; + yield return new object[] { engine, null, @"abc|(?:def|ghi)", "ghi", RegexOptions.None, new string[] { "ghi" } }; + yield return new object[] { engine, null, @"abc|(def|ghi)", "def", RegexOptions.None, new string[] { "def", "def" } }; - // Multiple character classes using character class subtraction - yield return new object[] { null, @"98[\d-[9]][\d-[8]][\d-[0]]", "98911 98881 98870 98871", RegexOptions.None, new string[] { "98871" } }; - yield return new object[] { null, @"m[\w-[^aeiou]][\w-[^aeiou]]t", "mbbt mect meet", RegexOptions.None, new string[] { "meet" } }; + // Multiple character classes using character class subtraction + yield return new object[] { engine, null, @"98[\d-[9]][\d-[8]][\d-[0]]", "98911 98881 98870 98871", RegexOptions.None, new string[] { "98871" } }; + yield return new object[] { engine, null, @"m[\w-[^aeiou]][\w-[^aeiou]]t", "mbbt mect meet", RegexOptions.None, new string[] { "meet" } }; - // Negation with character class subtraction - yield return new object[] { null, "[abcdef-[^bce]]+", "adfbcefda", RegexOptions.None, new string[] { "bce" } }; - yield return new object[] { null, "[^cde-[ag]]+", "agbfxyzga", RegexOptions.None, new string[] { "bfxyz" } }; + // Negation with character class subtraction + yield return new object[] { engine, null, "[abcdef-[^bce]]+", "adfbcefda", RegexOptions.None, new string[] { "bce" } }; + yield return new object[] { engine, null, "[^cde-[ag]]+", "agbfxyzga", RegexOptions.None, new string[] { "bfxyz" } }; - // Misc The idea here is come up with real world examples of char class subtraction. Things that - // would be difficult to define without it - yield return new object[] { null, @"[\p{L}-[^\p{Lu}]]+", "09',.abcxyzABCXYZ", RegexOptions.None, new string[] { "ABCXYZ" } }; + // Misc The idea here is come up with real world examples of char class subtraction. Things that + // would be difficult to define without it + yield return new object[] { engine, null, @"[\p{L}-[^\p{Lu}]]+", "09',.abcxyzABCXYZ", RegexOptions.None, new string[] { "ABCXYZ" } }; - yield return new object[] { null, @"[\p{IsGreek}-[\P{Lu}]]+", "\u0390\u03FE\u0386\u0388\u03EC\u03EE\u0400", RegexOptions.None, new string[] { "\u03FE\u0386\u0388\u03EC\u03EE" } }; - yield return new object[] { null, @"[\p{IsBasicLatin}-[G-L]]+", "GAFMZL", RegexOptions.None, new string[] { "AFMZ" } }; + yield return new object[] { engine, null, @"[\p{IsGreek}-[\P{Lu}]]+", "\u0390\u03FE\u0386\u0388\u03EC\u03EE\u0400", RegexOptions.None, new string[] { "\u03FE\u0386\u0388\u03EC\u03EE" } }; + yield return new object[] { engine, null, @"[\p{IsBasicLatin}-[G-L]]+", "GAFMZL", RegexOptions.None, new string[] { "AFMZ" } }; - yield return new object[] { null, "[a-zA-Z-[aeiouAEIOU]]+", "aeiouAEIOUbcdfghjklmnpqrstvwxyz", RegexOptions.None, new string[] { "bcdfghjklmnpqrstvwxyz" } }; + yield return new object[] { engine, null, "[a-zA-Z-[aeiouAEIOU]]+", "aeiouAEIOUbcdfghjklmnpqrstvwxyz", RegexOptions.None, new string[] { "bcdfghjklmnpqrstvwxyz" } }; - // The following is an overly complex way of matching an ip address using char class subtraction - yield return new object[] { null, @"^ + // The following is an overly complex way of matching an ip address using char class subtraction + yield return new object[] { engine, null, @"^ (?^ ( ( @@ -157,370 +159,370 @@ public static IEnumerable Groups_Basic_TestData() )$" , "255", RegexOptions.IgnorePatternWhitespace, new string[] { "255", "255", "2", "5", "5", "", "255", "2", "5" } }; - // Character Class Substraction - yield return new object[] { null, @"[abcd\-d-[bc]]+", "bbbaaa---dddccc", RegexOptions.None, new string[] { "aaa---ddd" } }; - yield return new object[] { null, @"[^a-f-[\x00-\x60\u007B-\uFFFF]]+", "aaafffgggzzz{{{", RegexOptions.None, new string[] { "gggzzz" } }; - yield return new object[] { null, @"[\[\]a-f-[[]]+", "gggaaafff]]][[[", RegexOptions.None, new string[] { "aaafff]]]" } }; - yield return new object[] { null, @"[\[\]a-f-[]]]+", "gggaaafff[[[]]]", RegexOptions.None, new string[] { "aaafff[[[" } }; - - yield return new object[] { null, @"[ab\-\[cd-[-[]]]]", "a]]", RegexOptions.None, new string[] { "a]]" } }; - yield return new object[] { null, @"[ab\-\[cd-[-[]]]]", "b]]", RegexOptions.None, new string[] { "b]]" } }; - yield return new object[] { null, @"[ab\-\[cd-[-[]]]]", "c]]", RegexOptions.None, new string[] { "c]]" } }; - yield return new object[] { null, @"[ab\-\[cd-[-[]]]]", "d]]", RegexOptions.None, new string[] { "d]]" } }; - - yield return new object[] { null, @"[ab\-\[cd-[[]]]]", "a]]", RegexOptions.None, new string[] { "a]]" } }; - yield return new object[] { null, @"[ab\-\[cd-[[]]]]", "b]]", RegexOptions.None, new string[] { "b]]" } }; - yield return new object[] { null, @"[ab\-\[cd-[[]]]]", "c]]", RegexOptions.None, new string[] { "c]]" } }; - yield return new object[] { null, @"[ab\-\[cd-[[]]]]", "d]]", RegexOptions.None, new string[] { "d]]" } }; - yield return new object[] { null, @"[ab\-\[cd-[[]]]]", "-]]", RegexOptions.None, new string[] { "-]]" } }; - - yield return new object[] { null, @"[a-[c-e]]+", "bbbaaaccc", RegexOptions.None, new string[] { "aaa" } }; - yield return new object[] { null, @"[a-[c-e]]+", "```aaaccc", RegexOptions.None, new string[] { "aaa" } }; - - yield return new object[] { null, @"[a-d\--[bc]]+", "cccaaa--dddbbb", RegexOptions.None, new string[] { "aaa--ddd" } }; - - // Not Character class substraction - yield return new object[] { null, @"[\0- [bc]+", "!!!\0\0\t\t [[[[bbbcccaaa", RegexOptions.None, new string[] { "\0\0\t\t [[[[bbbccc" } }; - yield return new object[] { null, "[[abcd]-[bc]]+", "a-b]", RegexOptions.None, new string[] { "a-b]" } }; - yield return new object[] { null, "[-[e-g]+", "ddd[[[---eeefffggghhh", RegexOptions.None, new string[] { "[[[---eeefffggg" } }; - yield return new object[] { null, "[-e-g]+", "ddd---eeefffggghhh", RegexOptions.None, new string[] { "---eeefffggg" } }; - yield return new object[] { null, "[a-e - m-p]+", "---a b c d e m n o p---", RegexOptions.None, new string[] { "a b c d e m n o p" } }; - yield return new object[] { null, "[^-[bc]]", "b] c] -] aaaddd]", RegexOptions.None, new string[] { "d]" } }; - yield return new object[] { null, "[^-[bc]]", "b] c] -] aaa]ddd]", RegexOptions.None, new string[] { "a]" } }; - - // Make sure we correctly handle \- - yield return new object[] { null, @"[a\-[bc]+", "```bbbaaa---[[[cccddd", RegexOptions.None, new string[] { "bbbaaa---[[[ccc" } }; - yield return new object[] { null, @"[a\-[\-\-bc]+", "```bbbaaa---[[[cccddd", RegexOptions.None, new string[] { "bbbaaa---[[[ccc" } }; - yield return new object[] { null, @"[a\-\[\-\[\-bc]+", "```bbbaaa---[[[cccddd", RegexOptions.None, new string[] { "bbbaaa---[[[ccc" } }; - yield return new object[] { null, @"[abc\--[b]]+", "[[[```bbbaaa---cccddd", RegexOptions.None, new string[] { "aaa---ccc" } }; - yield return new object[] { null, @"[abc\-z-[b]]+", "```aaaccc---zzzbbb", RegexOptions.None, new string[] { "aaaccc---zzz" } }; - yield return new object[] { null, @"[a-d\-[b]+", "```aaabbbcccddd----[[[[]]]", RegexOptions.None, new string[] { "aaabbbcccddd----[[[[" } }; - yield return new object[] { null, @"[abcd\-d\-[bc]+", "bbbaaa---[[[dddccc", RegexOptions.None, new string[] { "bbbaaa---[[[dddccc" } }; - - // Everything works correctly with option RegexOptions.IgnorePatternWhitespace - yield return new object[] { null, "[a - c - [ b ] ]+", "dddaaa ccc [[[[ bbb ]]]", RegexOptions.IgnorePatternWhitespace, new string[] { " ]]]" } }; - yield return new object[] { null, "[a - c - [ b ] +", "dddaaa ccc [[[[ bbb ]]]", RegexOptions.IgnorePatternWhitespace, new string[] { "aaa ccc [[[[ bbb " } }; - - // Unicode Char Classes - yield return new object[] { null, @"(\p{Lu}\w*)\s(\p{Lu}\w*)", "Hello World", RegexOptions.None, new string[] { "Hello World", "Hello", "World" } }; - yield return new object[] { null, @"(\p{Lu}\p{Ll}*)\s(\p{Lu}\p{Ll}*)", "Hello World", RegexOptions.None, new string[] { "Hello World", "Hello", "World" } }; - yield return new object[] { null, @"(\P{Ll}\p{Ll}*)\s(\P{Ll}\p{Ll}*)", "Hello World", RegexOptions.None, new string[] { "Hello World", "Hello", "World" } }; - yield return new object[] { null, @"(\P{Lu}+\p{Lu})\s(\P{Lu}+\p{Lu})", "hellO worlD", RegexOptions.None, new string[] { "hellO worlD", "hellO", "worlD" } }; - yield return new object[] { null, @"(\p{Lt}\w*)\s(\p{Lt}*\w*)", "\u01C5ello \u01C5orld", RegexOptions.None, new string[] { "\u01C5ello \u01C5orld", "\u01C5ello", "\u01C5orld" } }; - yield return new object[] { null, @"(\P{Lt}\w*)\s(\P{Lt}*\w*)", "Hello World", RegexOptions.None, new string[] { "Hello World", "Hello", "World" } }; - - // Character ranges IgnoreCase - yield return new object[] { null, @"[@-D]+", "eE?@ABCDabcdeE", RegexOptions.IgnoreCase, new string[] { "@ABCDabcd" } }; - yield return new object[] { null, @"[>-D]+", "eE=>?@ABCDabcdeE", RegexOptions.IgnoreCase, new string[] { ">?@ABCDabcd" } }; - yield return new object[] { null, @"[\u0554-\u0557]+", "\u0583\u0553\u0554\u0555\u0556\u0584\u0585\u0586\u0557\u0558", RegexOptions.IgnoreCase, new string[] { "\u0554\u0555\u0556\u0584\u0585\u0586\u0557" } }; - yield return new object[] { null, @"[X-\]]+", "wWXYZxyz[\\]^", RegexOptions.IgnoreCase, new string[] { "XYZxyz[\\]" } }; - yield return new object[] { null, @"[X-\u0533]+", "\u0551\u0554\u0560AXYZaxyz\u0531\u0532\u0533\u0561\u0562\u0563\u0564", RegexOptions.IgnoreCase, new string[] { "AXYZaxyz\u0531\u0532\u0533\u0561\u0562\u0563" } }; - yield return new object[] { null, @"[X-a]+", "wWAXYZaxyz", RegexOptions.IgnoreCase, new string[] { "AXYZaxyz" } }; - yield return new object[] { null, @"[X-c]+", "wWABCXYZabcxyz", RegexOptions.IgnoreCase, new string[] { "ABCXYZabcxyz" } }; - yield return new object[] { null, @"[X-\u00C0]+", "\u00C1\u00E1\u00C0\u00E0wWABCXYZabcxyz", RegexOptions.IgnoreCase, new string[] { "\u00C0\u00E0wWABCXYZabcxyz" } }; - yield return new object[] { null, @"[\u0100\u0102\u0104]+", "\u00FF \u0100\u0102\u0104\u0101\u0103\u0105\u0106", RegexOptions.IgnoreCase, new string[] { "\u0100\u0102\u0104\u0101\u0103\u0105" } }; - yield return new object[] { null, @"[B-D\u0130]+", "aAeE\u0129\u0131\u0068 BCDbcD\u0130\u0069\u0070", RegexOptions.IgnoreCase, new string[] { "BCDbcD\u0130\u0069" } }; - yield return new object[] { null, @"[\u013B\u013D\u013F]+", "\u013A\u013B\u013D\u013F\u013C\u013E\u0140\u0141", RegexOptions.IgnoreCase, new string[] { "\u013B\u013D\u013F\u013C\u013E\u0140" } }; - - // Escape Chars - yield return new object[] { null, "(Cat)\r(Dog)", "Cat\rDog", RegexOptions.None, new string[] { "Cat\rDog", "Cat", "Dog" } }; - yield return new object[] { null, "(Cat)\t(Dog)", "Cat\tDog", RegexOptions.None, new string[] { "Cat\tDog", "Cat", "Dog" } }; - yield return new object[] { null, "(Cat)\f(Dog)", "Cat\fDog", RegexOptions.None, new string[] { "Cat\fDog", "Cat", "Dog" } }; - - // Miscellaneous { witout matching } - yield return new object[] { null, @"{5", "hello {5 world", RegexOptions.None, new string[] { "{5" } }; - yield return new object[] { null, @"{5,", "hello {5, world", RegexOptions.None, new string[] { "{5," } }; - yield return new object[] { null, @"{5,6", "hello {5,6 world", RegexOptions.None, new string[] { "{5,6" } }; - - // Miscellaneous inline options - yield return new object[] { null, @"(?n:(?cat)(\s+)(?dog))", "cat dog", RegexOptions.None, new string[] { "cat dog", "cat", "dog" } }; - yield return new object[] { null, @"(?n:(cat)(\s+)(dog))", "cat dog", RegexOptions.None, new string[] { "cat dog" } }; - yield return new object[] { null, @"(?n:(cat)(?\s+)(dog))", "cat dog", RegexOptions.None, new string[] { "cat dog", " " } }; - yield return new object[] { null, @"(?x: + // Character Class Substraction + yield return new object[] { engine, null, @"[abcd\-d-[bc]]+", "bbbaaa---dddccc", RegexOptions.None, new string[] { "aaa---ddd" } }; + yield return new object[] { engine, null, @"[^a-f-[\x00-\x60\u007B-\uFFFF]]+", "aaafffgggzzz{{{", RegexOptions.None, new string[] { "gggzzz" } }; + yield return new object[] { engine, null, @"[\[\]a-f-[[]]+", "gggaaafff]]][[[", RegexOptions.None, new string[] { "aaafff]]]" } }; + yield return new object[] { engine, null, @"[\[\]a-f-[]]]+", "gggaaafff[[[]]]", RegexOptions.None, new string[] { "aaafff[[[" } }; + + yield return new object[] { engine, null, @"[ab\-\[cd-[-[]]]]", "a]]", RegexOptions.None, new string[] { "a]]" } }; + yield return new object[] { engine, null, @"[ab\-\[cd-[-[]]]]", "b]]", RegexOptions.None, new string[] { "b]]" } }; + yield return new object[] { engine, null, @"[ab\-\[cd-[-[]]]]", "c]]", RegexOptions.None, new string[] { "c]]" } }; + yield return new object[] { engine, null, @"[ab\-\[cd-[-[]]]]", "d]]", RegexOptions.None, new string[] { "d]]" } }; + + yield return new object[] { engine, null, @"[ab\-\[cd-[[]]]]", "a]]", RegexOptions.None, new string[] { "a]]" } }; + yield return new object[] { engine, null, @"[ab\-\[cd-[[]]]]", "b]]", RegexOptions.None, new string[] { "b]]" } }; + yield return new object[] { engine, null, @"[ab\-\[cd-[[]]]]", "c]]", RegexOptions.None, new string[] { "c]]" } }; + yield return new object[] { engine, null, @"[ab\-\[cd-[[]]]]", "d]]", RegexOptions.None, new string[] { "d]]" } }; + yield return new object[] { engine, null, @"[ab\-\[cd-[[]]]]", "-]]", RegexOptions.None, new string[] { "-]]" } }; + + yield return new object[] { engine, null, @"[a-[c-e]]+", "bbbaaaccc", RegexOptions.None, new string[] { "aaa" } }; + yield return new object[] { engine, null, @"[a-[c-e]]+", "```aaaccc", RegexOptions.None, new string[] { "aaa" } }; + + yield return new object[] { engine, null, @"[a-d\--[bc]]+", "cccaaa--dddbbb", RegexOptions.None, new string[] { "aaa--ddd" } }; + + // Not Character class substraction + yield return new object[] { engine, null, @"[\0- [bc]+", "!!!\0\0\t\t [[[[bbbcccaaa", RegexOptions.None, new string[] { "\0\0\t\t [[[[bbbccc" } }; + yield return new object[] { engine, null, "[[abcd]-[bc]]+", "a-b]", RegexOptions.None, new string[] { "a-b]" } }; + yield return new object[] { engine, null, "[-[e-g]+", "ddd[[[---eeefffggghhh", RegexOptions.None, new string[] { "[[[---eeefffggg" } }; + yield return new object[] { engine, null, "[-e-g]+", "ddd---eeefffggghhh", RegexOptions.None, new string[] { "---eeefffggg" } }; + yield return new object[] { engine, null, "[a-e - m-p]+", "---a b c d e m n o p---", RegexOptions.None, new string[] { "a b c d e m n o p" } }; + yield return new object[] { engine, null, "[^-[bc]]", "b] c] -] aaaddd]", RegexOptions.None, new string[] { "d]" } }; + yield return new object[] { engine, null, "[^-[bc]]", "b] c] -] aaa]ddd]", RegexOptions.None, new string[] { "a]" } }; + + // Make sure we correctly handle \- + yield return new object[] { engine, null, @"[a\-[bc]+", "```bbbaaa---[[[cccddd", RegexOptions.None, new string[] { "bbbaaa---[[[ccc" } }; + yield return new object[] { engine, null, @"[a\-[\-\-bc]+", "```bbbaaa---[[[cccddd", RegexOptions.None, new string[] { "bbbaaa---[[[ccc" } }; + yield return new object[] { engine, null, @"[a\-\[\-\[\-bc]+", "```bbbaaa---[[[cccddd", RegexOptions.None, new string[] { "bbbaaa---[[[ccc" } }; + yield return new object[] { engine, null, @"[abc\--[b]]+", "[[[```bbbaaa---cccddd", RegexOptions.None, new string[] { "aaa---ccc" } }; + yield return new object[] { engine, null, @"[abc\-z-[b]]+", "```aaaccc---zzzbbb", RegexOptions.None, new string[] { "aaaccc---zzz" } }; + yield return new object[] { engine, null, @"[a-d\-[b]+", "```aaabbbcccddd----[[[[]]]", RegexOptions.None, new string[] { "aaabbbcccddd----[[[[" } }; + yield return new object[] { engine, null, @"[abcd\-d\-[bc]+", "bbbaaa---[[[dddccc", RegexOptions.None, new string[] { "bbbaaa---[[[dddccc" } }; + + // Everything works correctly with option RegexOptions.IgnorePatternWhitespace + yield return new object[] { engine, null, "[a - c - [ b ] ]+", "dddaaa ccc [[[[ bbb ]]]", RegexOptions.IgnorePatternWhitespace, new string[] { " ]]]" } }; + yield return new object[] { engine, null, "[a - c - [ b ] +", "dddaaa ccc [[[[ bbb ]]]", RegexOptions.IgnorePatternWhitespace, new string[] { "aaa ccc [[[[ bbb " } }; + + // Unicode Char Classes + yield return new object[] { engine, null, @"(\p{Lu}\w*)\s(\p{Lu}\w*)", "Hello World", RegexOptions.None, new string[] { "Hello World", "Hello", "World" } }; + yield return new object[] { engine, null, @"(\p{Lu}\p{Ll}*)\s(\p{Lu}\p{Ll}*)", "Hello World", RegexOptions.None, new string[] { "Hello World", "Hello", "World" } }; + yield return new object[] { engine, null, @"(\P{Ll}\p{Ll}*)\s(\P{Ll}\p{Ll}*)", "Hello World", RegexOptions.None, new string[] { "Hello World", "Hello", "World" } }; + yield return new object[] { engine, null, @"(\P{Lu}+\p{Lu})\s(\P{Lu}+\p{Lu})", "hellO worlD", RegexOptions.None, new string[] { "hellO worlD", "hellO", "worlD" } }; + yield return new object[] { engine, null, @"(\p{Lt}\w*)\s(\p{Lt}*\w*)", "\u01C5ello \u01C5orld", RegexOptions.None, new string[] { "\u01C5ello \u01C5orld", "\u01C5ello", "\u01C5orld" } }; + yield return new object[] { engine, null, @"(\P{Lt}\w*)\s(\P{Lt}*\w*)", "Hello World", RegexOptions.None, new string[] { "Hello World", "Hello", "World" } }; + + // Character ranges IgnoreCase + yield return new object[] { engine, null, @"[@-D]+", "eE?@ABCDabcdeE", RegexOptions.IgnoreCase, new string[] { "@ABCDabcd" } }; + yield return new object[] { engine, null, @"[>-D]+", "eE=>?@ABCDabcdeE", RegexOptions.IgnoreCase, new string[] { ">?@ABCDabcd" } }; + yield return new object[] { engine, null, @"[\u0554-\u0557]+", "\u0583\u0553\u0554\u0555\u0556\u0584\u0585\u0586\u0557\u0558", RegexOptions.IgnoreCase, new string[] { "\u0554\u0555\u0556\u0584\u0585\u0586\u0557" } }; + yield return new object[] { engine, null, @"[X-\]]+", "wWXYZxyz[\\]^", RegexOptions.IgnoreCase, new string[] { "XYZxyz[\\]" } }; + yield return new object[] { engine, null, @"[X-\u0533]+", "\u0551\u0554\u0560AXYZaxyz\u0531\u0532\u0533\u0561\u0562\u0563\u0564", RegexOptions.IgnoreCase, new string[] { "AXYZaxyz\u0531\u0532\u0533\u0561\u0562\u0563" } }; + yield return new object[] { engine, null, @"[X-a]+", "wWAXYZaxyz", RegexOptions.IgnoreCase, new string[] { "AXYZaxyz" } }; + yield return new object[] { engine, null, @"[X-c]+", "wWABCXYZabcxyz", RegexOptions.IgnoreCase, new string[] { "ABCXYZabcxyz" } }; + yield return new object[] { engine, null, @"[X-\u00C0]+", "\u00C1\u00E1\u00C0\u00E0wWABCXYZabcxyz", RegexOptions.IgnoreCase, new string[] { "\u00C0\u00E0wWABCXYZabcxyz" } }; + yield return new object[] { engine, null, @"[\u0100\u0102\u0104]+", "\u00FF \u0100\u0102\u0104\u0101\u0103\u0105\u0106", RegexOptions.IgnoreCase, new string[] { "\u0100\u0102\u0104\u0101\u0103\u0105" } }; + yield return new object[] { engine, null, @"[B-D\u0130]+", "aAeE\u0129\u0131\u0068 BCDbcD\u0130\u0069\u0070", RegexOptions.IgnoreCase, new string[] { "BCDbcD\u0130\u0069" } }; + yield return new object[] { engine, null, @"[\u013B\u013D\u013F]+", "\u013A\u013B\u013D\u013F\u013C\u013E\u0140\u0141", RegexOptions.IgnoreCase, new string[] { "\u013B\u013D\u013F\u013C\u013E\u0140" } }; + + // Escape Chars + yield return new object[] { engine, null, "(Cat)\r(Dog)", "Cat\rDog", RegexOptions.None, new string[] { "Cat\rDog", "Cat", "Dog" } }; + yield return new object[] { engine, null, "(Cat)\t(Dog)", "Cat\tDog", RegexOptions.None, new string[] { "Cat\tDog", "Cat", "Dog" } }; + yield return new object[] { engine, null, "(Cat)\f(Dog)", "Cat\fDog", RegexOptions.None, new string[] { "Cat\fDog", "Cat", "Dog" } }; + + // Miscellaneous { witout matching } + yield return new object[] { engine, null, @"{5", "hello {5 world", RegexOptions.None, new string[] { "{5" } }; + yield return new object[] { engine, null, @"{5,", "hello {5, world", RegexOptions.None, new string[] { "{5," } }; + yield return new object[] { engine, null, @"{5,6", "hello {5,6 world", RegexOptions.None, new string[] { "{5,6" } }; + + // Miscellaneous inline options + yield return new object[] { engine, null, @"(?n:(?cat)(\s+)(?dog))", "cat dog", RegexOptions.None, new string[] { "cat dog", "cat", "dog" } }; + yield return new object[] { engine, null, @"(?n:(cat)(\s+)(dog))", "cat dog", RegexOptions.None, new string[] { "cat dog" } }; + yield return new object[] { engine, null, @"(?n:(cat)(?\s+)(dog))", "cat dog", RegexOptions.None, new string[] { "cat dog", " " } }; + yield return new object[] { engine, null, @"(?x: (?cat) # Cat statement (\s+) # Whitespace chars (?dog # Dog statement ))", "cat dog", RegexOptions.None, new string[] { "cat dog", " ", "cat", "dog" } }; - yield return new object[] { null, @"(?+i:cat)", "CAT", RegexOptions.None, new string[] { "CAT" } }; - - // \d, \D, \s, \S, \w, \W, \P, \p inside character range - yield return new object[] { null, @"cat([\d]*)dog", "hello123cat230927dog1412d", RegexOptions.None, new string[] { "cat230927dog", "230927" } }; - yield return new object[] { null, @"([\D]*)dog", "65498catdog58719", RegexOptions.None, new string[] { "catdog", "cat" } }; - yield return new object[] { null, @"cat([\s]*)dog", "wiocat dog3270", RegexOptions.None, new string[] { "cat dog", " " } }; - yield return new object[] { null, @"cat([\S]*)", "sfdcatdog 3270", RegexOptions.None, new string[] { "catdog", "dog" } }; - yield return new object[] { null, @"cat([\w]*)", "sfdcatdog 3270", RegexOptions.None, new string[] { "catdog", "dog" } }; - yield return new object[] { null, @"cat([\W]*)dog", "wiocat dog3270", RegexOptions.None, new string[] { "cat dog", " " } }; - yield return new object[] { null, @"([\p{Lu}]\w*)\s([\p{Lu}]\w*)", "Hello World", RegexOptions.None, new string[] { "Hello World", "Hello", "World" } }; - yield return new object[] { null, @"([\P{Ll}][\p{Ll}]*)\s([\P{Ll}][\p{Ll}]*)", "Hello World", RegexOptions.None, new string[] { "Hello World", "Hello", "World" } }; - - // \x, \u, \a, \b, \e, \f, \n, \r, \t, \v, \c, inside character range - yield return new object[] { null, @"(cat)([\x41]*)(dog)", "catAAAdog", RegexOptions.None, new string[] { "catAAAdog", "cat", "AAA", "dog" } }; - yield return new object[] { null, @"(cat)([\u0041]*)(dog)", "catAAAdog", RegexOptions.None, new string[] { "catAAAdog", "cat", "AAA", "dog" } }; - yield return new object[] { null, @"(cat)([\a]*)(dog)", "cat\a\a\adog", RegexOptions.None, new string[] { "cat\a\a\adog", "cat", "\a\a\a", "dog" } }; - yield return new object[] { null, @"(cat)([\b]*)(dog)", "cat\b\b\bdog", RegexOptions.None, new string[] { "cat\b\b\bdog", "cat", "\b\b\b", "dog" } }; - yield return new object[] { null, @"(cat)([\e]*)(dog)", "cat\u001B\u001B\u001Bdog", RegexOptions.None, new string[] { "cat\u001B\u001B\u001Bdog", "cat", "\u001B\u001B\u001B", "dog" } }; - yield return new object[] { null, @"(cat)([\f]*)(dog)", "cat\f\f\fdog", RegexOptions.None, new string[] { "cat\f\f\fdog", "cat", "\f\f\f", "dog" } }; - yield return new object[] { null, @"(cat)([\r]*)(dog)", "cat\r\r\rdog", RegexOptions.None, new string[] { "cat\r\r\rdog", "cat", "\r\r\r", "dog" } }; - yield return new object[] { null, @"(cat)([\v]*)(dog)", "cat\v\v\vdog", RegexOptions.None, new string[] { "cat\v\v\vdog", "cat", "\v\v\v", "dog" } }; - - // \d, \D, \s, \S, \w, \W, \P, \p inside character range ([0-5]) with ECMA Option - yield return new object[] { null, @"cat([\d]*)dog", "hello123cat230927dog1412d", RegexOptions.ECMAScript, new string[] { "cat230927dog", "230927" } }; - yield return new object[] { null, @"([\D]*)dog", "65498catdog58719", RegexOptions.ECMAScript, new string[] { "catdog", "cat" } }; - yield return new object[] { null, @"cat([\s]*)dog", "wiocat dog3270", RegexOptions.ECMAScript, new string[] { "cat dog", " " } }; - yield return new object[] { null, @"cat([\S]*)", "sfdcatdog 3270", RegexOptions.ECMAScript, new string[] { "catdog", "dog" } }; - yield return new object[] { null, @"cat([\w]*)", "sfdcatdog 3270", RegexOptions.ECMAScript, new string[] { "catdog", "dog" } }; - yield return new object[] { null, @"cat([\W]*)dog", "wiocat dog3270", RegexOptions.ECMAScript, new string[] { "cat dog", " " } }; - yield return new object[] { null, @"([\p{Lu}]\w*)\s([\p{Lu}]\w*)", "Hello World", RegexOptions.ECMAScript, new string[] { "Hello World", "Hello", "World" } }; - yield return new object[] { null, @"([\P{Ll}][\p{Ll}]*)\s([\P{Ll}][\p{Ll}]*)", "Hello World", RegexOptions.ECMAScript, new string[] { "Hello World", "Hello", "World" } }; - - // \d, \D, \s, \S, \w, \W, \P, \p outside character range ([0-5]) with ECMA Option - yield return new object[] { null, @"(cat)\d*dog", "hello123cat230927dog1412d", RegexOptions.ECMAScript, new string[] { "cat230927dog", "cat" } }; - yield return new object[] { null, @"\D*(dog)", "65498catdog58719", RegexOptions.ECMAScript, new string[] { "catdog", "dog" } }; - yield return new object[] { null, @"(cat)\s*(dog)", "wiocat dog3270", RegexOptions.ECMAScript, new string[] { "cat dog", "cat", "dog" } }; - yield return new object[] { null, @"(cat)\S*", "sfdcatdog 3270", RegexOptions.ECMAScript, new string[] { "catdog", "cat" } }; - yield return new object[] { null, @"(cat)\w*", "sfdcatdog 3270", RegexOptions.ECMAScript, new string[] { "catdog", "cat" } }; - yield return new object[] { null, @"(cat)\W*(dog)", "wiocat dog3270", RegexOptions.ECMAScript, new string[] { "cat dog", "cat", "dog" } }; - yield return new object[] { null, @"\p{Lu}(\w*)\s\p{Lu}(\w*)", "Hello World", RegexOptions.ECMAScript, new string[] { "Hello World", "ello", "orld" } }; - yield return new object[] { null, @"\P{Ll}\p{Ll}*\s\P{Ll}\p{Ll}*", "Hello World", RegexOptions.ECMAScript, new string[] { "Hello World" } }; - - // Use < in a group - yield return new object[] { null, @"cat(?dog)", "catcatdogdogcat", RegexOptions.None, new string[] { "catdog", "dog" } }; - yield return new object[] { null, @"(?cat)\s*(?dog)", "catcat dogdogcat", RegexOptions.None, new string[] { "cat dog", "dog" } }; - yield return new object[] { null, @"(?<1>cat)\s*(?<1>dog)", "catcat dogdogcat", RegexOptions.None, new string[] { "cat dog", "dog" } }; - yield return new object[] { null, @"(?<2048>cat)\s*(?<2048>dog)", "catcat dogdogcat", RegexOptions.None, new string[] { "cat dog", "dog" } }; - yield return new object[] { null, @"(?cat)\w+(?dog)", "cat_Hello_World_dog", RegexOptions.None, new string[] { "cat_Hello_World_dog", "", "_Hello_World_" } }; - yield return new object[] { null, @"(?cat)\w+(?<-cat>dog)", "cat_Hello_World_dog", RegexOptions.None, new string[] { "cat_Hello_World_dog", "" } }; - yield return new object[] { null, @"(?cat)\w+(?dog)", "cat_Hello_World_dog", RegexOptions.None, new string[] { "cat_Hello_World_dog", "_Hello_World_" } }; - yield return new object[] { null, @"(?<1>cat)\w+(?dog)", "cat_Hello_World_dog", RegexOptions.None, new string[] { "cat_Hello_World_dog", "", "_Hello_World_" } }; - yield return new object[] { null, @"(?cat)\w+(?<2-cat>dog)", "cat_Hello_World_dog", RegexOptions.None, new string[] { "cat_Hello_World_dog", "", "_Hello_World_" } }; - yield return new object[] { null, @"(?<1>cat)\w+(?<2-1>dog)", "cat_Hello_World_dog", RegexOptions.None, new string[] { "cat_Hello_World_dog", "", "_Hello_World_" } }; - - // Quantifiers - yield return new object[] { null, @"(?cat){", "STARTcat{", RegexOptions.None, new string[] { "cat{", "cat" } }; - yield return new object[] { null, @"(?cat){fdsa", "STARTcat{fdsa", RegexOptions.None, new string[] { "cat{fdsa", "cat" } }; - yield return new object[] { null, @"(?cat){1", "STARTcat{1", RegexOptions.None, new string[] { "cat{1", "cat" } }; - yield return new object[] { null, @"(?cat){1END", "STARTcat{1END", RegexOptions.None, new string[] { "cat{1END", "cat" } }; - yield return new object[] { null, @"(?cat){1,", "STARTcat{1,", RegexOptions.None, new string[] { "cat{1,", "cat" } }; - yield return new object[] { null, @"(?cat){1,END", "STARTcat{1,END", RegexOptions.None, new string[] { "cat{1,END", "cat" } }; - yield return new object[] { null, @"(?cat){1,2", "STARTcat{1,2", RegexOptions.None, new string[] { "cat{1,2", "cat" } }; - yield return new object[] { null, @"(?cat){1,2END", "STARTcat{1,2END", RegexOptions.None, new string[] { "cat{1,2END", "cat" } }; - - // Use IgnorePatternWhitespace - yield return new object[] { null, @"(cat) #cat + yield return new object[] { engine, null, @"(?+i:cat)", "CAT", RegexOptions.None, new string[] { "CAT" } }; + + // \d, \D, \s, \S, \w, \W, \P, \p inside character range + yield return new object[] { engine, null, @"cat([\d]*)dog", "hello123cat230927dog1412d", RegexOptions.None, new string[] { "cat230927dog", "230927" } }; + yield return new object[] { engine, null, @"([\D]*)dog", "65498catdog58719", RegexOptions.None, new string[] { "catdog", "cat" } }; + yield return new object[] { engine, null, @"cat([\s]*)dog", "wiocat dog3270", RegexOptions.None, new string[] { "cat dog", " " } }; + yield return new object[] { engine, null, @"cat([\S]*)", "sfdcatdog 3270", RegexOptions.None, new string[] { "catdog", "dog" } }; + yield return new object[] { engine, null, @"cat([\w]*)", "sfdcatdog 3270", RegexOptions.None, new string[] { "catdog", "dog" } }; + yield return new object[] { engine, null, @"cat([\W]*)dog", "wiocat dog3270", RegexOptions.None, new string[] { "cat dog", " " } }; + yield return new object[] { engine, null, @"([\p{Lu}]\w*)\s([\p{Lu}]\w*)", "Hello World", RegexOptions.None, new string[] { "Hello World", "Hello", "World" } }; + yield return new object[] { engine, null, @"([\P{Ll}][\p{Ll}]*)\s([\P{Ll}][\p{Ll}]*)", "Hello World", RegexOptions.None, new string[] { "Hello World", "Hello", "World" } }; + + // \x, \u, \a, \b, \e, \f, \n, \r, \t, \v, \c, inside character range + yield return new object[] { engine, null, @"(cat)([\x41]*)(dog)", "catAAAdog", RegexOptions.None, new string[] { "catAAAdog", "cat", "AAA", "dog" } }; + yield return new object[] { engine, null, @"(cat)([\u0041]*)(dog)", "catAAAdog", RegexOptions.None, new string[] { "catAAAdog", "cat", "AAA", "dog" } }; + yield return new object[] { engine, null, @"(cat)([\a]*)(dog)", "cat\a\a\adog", RegexOptions.None, new string[] { "cat\a\a\adog", "cat", "\a\a\a", "dog" } }; + yield return new object[] { engine, null, @"(cat)([\b]*)(dog)", "cat\b\b\bdog", RegexOptions.None, new string[] { "cat\b\b\bdog", "cat", "\b\b\b", "dog" } }; + yield return new object[] { engine, null, @"(cat)([\e]*)(dog)", "cat\u001B\u001B\u001Bdog", RegexOptions.None, new string[] { "cat\u001B\u001B\u001Bdog", "cat", "\u001B\u001B\u001B", "dog" } }; + yield return new object[] { engine, null, @"(cat)([\f]*)(dog)", "cat\f\f\fdog", RegexOptions.None, new string[] { "cat\f\f\fdog", "cat", "\f\f\f", "dog" } }; + yield return new object[] { engine, null, @"(cat)([\r]*)(dog)", "cat\r\r\rdog", RegexOptions.None, new string[] { "cat\r\r\rdog", "cat", "\r\r\r", "dog" } }; + yield return new object[] { engine, null, @"(cat)([\v]*)(dog)", "cat\v\v\vdog", RegexOptions.None, new string[] { "cat\v\v\vdog", "cat", "\v\v\v", "dog" } }; + + // \d, \D, \s, \S, \w, \W, \P, \p inside character range ([0-5]) with ECMA Option + yield return new object[] { engine, null, @"cat([\d]*)dog", "hello123cat230927dog1412d", RegexOptions.ECMAScript, new string[] { "cat230927dog", "230927" } }; + yield return new object[] { engine, null, @"([\D]*)dog", "65498catdog58719", RegexOptions.ECMAScript, new string[] { "catdog", "cat" } }; + yield return new object[] { engine, null, @"cat([\s]*)dog", "wiocat dog3270", RegexOptions.ECMAScript, new string[] { "cat dog", " " } }; + yield return new object[] { engine, null, @"cat([\S]*)", "sfdcatdog 3270", RegexOptions.ECMAScript, new string[] { "catdog", "dog" } }; + yield return new object[] { engine, null, @"cat([\w]*)", "sfdcatdog 3270", RegexOptions.ECMAScript, new string[] { "catdog", "dog" } }; + yield return new object[] { engine, null, @"cat([\W]*)dog", "wiocat dog3270", RegexOptions.ECMAScript, new string[] { "cat dog", " " } }; + yield return new object[] { engine, null, @"([\p{Lu}]\w*)\s([\p{Lu}]\w*)", "Hello World", RegexOptions.ECMAScript, new string[] { "Hello World", "Hello", "World" } }; + yield return new object[] { engine, null, @"([\P{Ll}][\p{Ll}]*)\s([\P{Ll}][\p{Ll}]*)", "Hello World", RegexOptions.ECMAScript, new string[] { "Hello World", "Hello", "World" } }; + + // \d, \D, \s, \S, \w, \W, \P, \p outside character range ([0-5]) with ECMA Option + yield return new object[] { engine, null, @"(cat)\d*dog", "hello123cat230927dog1412d", RegexOptions.ECMAScript, new string[] { "cat230927dog", "cat" } }; + yield return new object[] { engine, null, @"\D*(dog)", "65498catdog58719", RegexOptions.ECMAScript, new string[] { "catdog", "dog" } }; + yield return new object[] { engine, null, @"(cat)\s*(dog)", "wiocat dog3270", RegexOptions.ECMAScript, new string[] { "cat dog", "cat", "dog" } }; + yield return new object[] { engine, null, @"(cat)\S*", "sfdcatdog 3270", RegexOptions.ECMAScript, new string[] { "catdog", "cat" } }; + yield return new object[] { engine, null, @"(cat)\w*", "sfdcatdog 3270", RegexOptions.ECMAScript, new string[] { "catdog", "cat" } }; + yield return new object[] { engine, null, @"(cat)\W*(dog)", "wiocat dog3270", RegexOptions.ECMAScript, new string[] { "cat dog", "cat", "dog" } }; + yield return new object[] { engine, null, @"\p{Lu}(\w*)\s\p{Lu}(\w*)", "Hello World", RegexOptions.ECMAScript, new string[] { "Hello World", "ello", "orld" } }; + yield return new object[] { engine, null, @"\P{Ll}\p{Ll}*\s\P{Ll}\p{Ll}*", "Hello World", RegexOptions.ECMAScript, new string[] { "Hello World" } }; + + // Use < in a group + yield return new object[] { engine, null, @"cat(?dog)", "catcatdogdogcat", RegexOptions.None, new string[] { "catdog", "dog" } }; + yield return new object[] { engine, null, @"(?cat)\s*(?dog)", "catcat dogdogcat", RegexOptions.None, new string[] { "cat dog", "dog" } }; + yield return new object[] { engine, null, @"(?<1>cat)\s*(?<1>dog)", "catcat dogdogcat", RegexOptions.None, new string[] { "cat dog", "dog" } }; + yield return new object[] { engine, null, @"(?<2048>cat)\s*(?<2048>dog)", "catcat dogdogcat", RegexOptions.None, new string[] { "cat dog", "dog" } }; + yield return new object[] { engine, null, @"(?cat)\w+(?dog)", "cat_Hello_World_dog", RegexOptions.None, new string[] { "cat_Hello_World_dog", "", "_Hello_World_" } }; + yield return new object[] { engine, null, @"(?cat)\w+(?<-cat>dog)", "cat_Hello_World_dog", RegexOptions.None, new string[] { "cat_Hello_World_dog", "" } }; + yield return new object[] { engine, null, @"(?cat)\w+(?dog)", "cat_Hello_World_dog", RegexOptions.None, new string[] { "cat_Hello_World_dog", "_Hello_World_" } }; + yield return new object[] { engine, null, @"(?<1>cat)\w+(?dog)", "cat_Hello_World_dog", RegexOptions.None, new string[] { "cat_Hello_World_dog", "", "_Hello_World_" } }; + yield return new object[] { engine, null, @"(?cat)\w+(?<2-cat>dog)", "cat_Hello_World_dog", RegexOptions.None, new string[] { "cat_Hello_World_dog", "", "_Hello_World_" } }; + yield return new object[] { engine, null, @"(?<1>cat)\w+(?<2-1>dog)", "cat_Hello_World_dog", RegexOptions.None, new string[] { "cat_Hello_World_dog", "", "_Hello_World_" } }; + + // Quantifiers + yield return new object[] { engine, null, @"(?cat){", "STARTcat{", RegexOptions.None, new string[] { "cat{", "cat" } }; + yield return new object[] { engine, null, @"(?cat){fdsa", "STARTcat{fdsa", RegexOptions.None, new string[] { "cat{fdsa", "cat" } }; + yield return new object[] { engine, null, @"(?cat){1", "STARTcat{1", RegexOptions.None, new string[] { "cat{1", "cat" } }; + yield return new object[] { engine, null, @"(?cat){1END", "STARTcat{1END", RegexOptions.None, new string[] { "cat{1END", "cat" } }; + yield return new object[] { engine, null, @"(?cat){1,", "STARTcat{1,", RegexOptions.None, new string[] { "cat{1,", "cat" } }; + yield return new object[] { engine, null, @"(?cat){1,END", "STARTcat{1,END", RegexOptions.None, new string[] { "cat{1,END", "cat" } }; + yield return new object[] { engine, null, @"(?cat){1,2", "STARTcat{1,2", RegexOptions.None, new string[] { "cat{1,2", "cat" } }; + yield return new object[] { engine, null, @"(?cat){1,2END", "STARTcat{1,2END", RegexOptions.None, new string[] { "cat{1,2END", "cat" } }; + + // Use IgnorePatternWhitespace + yield return new object[] { engine, null, @"(cat) #cat \s+ #followed by 1 or more whitespace (dog) #followed by dog ", "cat dog", RegexOptions.IgnorePatternWhitespace, new string[] { "cat dog", "cat", "dog" } }; - yield return new object[] { null, @"(cat) #cat + yield return new object[] { engine, null, @"(cat) #cat \s+ #followed by 1 or more whitespace (dog) #followed by dog", "cat dog", RegexOptions.IgnorePatternWhitespace, new string[] { "cat dog", "cat", "dog" } }; - yield return new object[] { null, @"(cat) (?#cat) \s+ (?#followed by 1 or more whitespace) (dog) (?#followed by dog)", "cat dog", RegexOptions.IgnorePatternWhitespace, new string[] { "cat dog", "cat", "dog" } }; - - // Back Reference - yield return new object[] { null, @"(?cat)(?dog)\k", "asdfcatdogcatdog", RegexOptions.None, new string[] { "catdogcat", "cat", "dog" } }; - yield return new object[] { null, @"(?cat)\s+(?dog)\k", "asdfcat dogcat dog", RegexOptions.None, new string[] { "cat dogcat", "cat", "dog" } }; - yield return new object[] { null, @"(?cat)\s+(?dog)\k'cat'", "asdfcat dogcat dog", RegexOptions.None, new string[] { "cat dogcat", "cat", "dog" } }; - yield return new object[] { null, @"(?cat)\s+(?dog)\", "asdfcat dogcat dog", RegexOptions.None, new string[] { "cat dogcat", "cat", "dog" } }; - yield return new object[] { null, @"(?cat)\s+(?dog)\'cat'", "asdfcat dogcat dog", RegexOptions.None, new string[] { "cat dogcat", "cat", "dog" } }; - - yield return new object[] { null, @"(?cat)\s+(?dog)\k<1>", "asdfcat dogcat dog", RegexOptions.None, new string[] { "cat dogcat", "cat", "dog" } }; - yield return new object[] { null, @"(?cat)\s+(?dog)\k'1'", "asdfcat dogcat dog", RegexOptions.None, new string[] { "cat dogcat", "cat", "dog" } }; - yield return new object[] { null, @"(?cat)\s+(?dog)\<1>", "asdfcat dogcat dog", RegexOptions.None, new string[] { "cat dogcat", "cat", "dog" } }; - yield return new object[] { null, @"(?cat)\s+(?dog)\'1'", "asdfcat dogcat dog", RegexOptions.None, new string[] { "cat dogcat", "cat", "dog" } }; - yield return new object[] { null, @"(?cat)\s+(?dog)\1", "asdfcat dogcat dog", RegexOptions.None, new string[] { "cat dogcat", "cat", "dog" } }; - yield return new object[] { null, @"(?cat)\s+(?dog)\1", "asdfcat dogcat dog", RegexOptions.ECMAScript, new string[] { "cat dogcat", "cat", "dog" } }; - - yield return new object[] { null, @"(?cat)\s+(?dog)\k", "asdfcat dogdog dog", RegexOptions.None, new string[] { "cat dogdog", "cat", "dog" } }; - yield return new object[] { null, @"(?cat)\s+(?dog)\2", "asdfcat dogdog dog", RegexOptions.None, new string[] { "cat dogdog", "cat", "dog" } }; - yield return new object[] { null, @"(?cat)\s+(?dog)\2", "asdfcat dogdog dog", RegexOptions.ECMAScript, new string[] { "cat dogdog", "cat", "dog" } }; - - // Octal - yield return new object[] { null, @"(cat)(\077)", "hellocat?dogworld", RegexOptions.None, new string[] { "cat?", "cat", "?" } }; - yield return new object[] { null, @"(cat)(\77)", "hellocat?dogworld", RegexOptions.None, new string[] { "cat?", "cat", "?" } }; - yield return new object[] { null, @"(cat)(\176)", "hellocat~dogworld", RegexOptions.None, new string[] { "cat~", "cat", "~" } }; - yield return new object[] { null, @"(cat)(\400)", "hellocat\0dogworld", RegexOptions.None, new string[] { "cat\0", "cat", "\0" } }; - yield return new object[] { null, @"(cat)(\300)", "hellocat\u00C0dogworld", RegexOptions.None, new string[] { "cat\u00C0", "cat", "\u00C0" } }; - yield return new object[] { null, @"(cat)(\477)", "hellocat\u003Fdogworld", RegexOptions.None, new string[] { "cat\u003F", "cat", "\u003F" } }; - yield return new object[] { null, @"(cat)(\777)", "hellocat\u00FFdogworld", RegexOptions.None, new string[] { "cat\u00FF", "cat", "\u00FF" } }; - yield return new object[] { null, @"(cat)(\7770)", "hellocat\u00FF0dogworld", RegexOptions.None, new string[] { "cat\u00FF0", "cat", "\u00FF0" } }; - - yield return new object[] { null, @"(cat)(\077)", "hellocat?dogworld", RegexOptions.ECMAScript, new string[] { "cat?", "cat", "?" } }; - yield return new object[] { null, @"(cat)(\77)", "hellocat?dogworld", RegexOptions.ECMAScript, new string[] { "cat?", "cat", "?" } }; - yield return new object[] { null, @"(cat)(\7)", "hellocat\adogworld", RegexOptions.ECMAScript, new string[] { "cat\a", "cat", "\a" } }; - yield return new object[] { null, @"(cat)(\40)", "hellocat dogworld", RegexOptions.ECMAScript, new string[] { "cat ", "cat", " " } }; - yield return new object[] { null, @"(cat)(\040)", "hellocat dogworld", RegexOptions.ECMAScript, new string[] { "cat ", "cat", " " } }; - yield return new object[] { null, @"(cat)(\176)", "hellocatcat76dogworld", RegexOptions.ECMAScript, new string[] { "catcat76", "cat", "cat76" } }; - yield return new object[] { null, @"(cat)(\377)", "hellocat\u00FFdogworld", RegexOptions.ECMAScript, new string[] { "cat\u00FF", "cat", "\u00FF" } }; - yield return new object[] { null, @"(cat)(\400)", "hellocat 0Fdogworld", RegexOptions.ECMAScript, new string[] { "cat 0", "cat", " 0" } }; - - // Decimal - yield return new object[] { null, @"(cat)\s+(?<2147483646>dog)", "asdlkcat dogiwod", RegexOptions.None, new string[] { "cat dog", "cat", "dog" } }; - yield return new object[] { null, @"(cat)\s+(?<2147483647>dog)", "asdlkcat dogiwod", RegexOptions.None, new string[] { "cat dog", "cat", "dog" } }; - - // Hex - yield return new object[] { null, @"(cat)(\x2a*)(dog)", "asdlkcat***dogiwod", RegexOptions.None, new string[] { "cat***dog", "cat", "***", "dog" } }; - yield return new object[] { null, @"(cat)(\x2b*)(dog)", "asdlkcat+++dogiwod", RegexOptions.None, new string[] { "cat+++dog", "cat", "+++", "dog" } }; - yield return new object[] { null, @"(cat)(\x2c*)(dog)", "asdlkcat,,,dogiwod", RegexOptions.None, new string[] { "cat,,,dog", "cat", ",,,", "dog" } }; - yield return new object[] { null, @"(cat)(\x2d*)(dog)", "asdlkcat---dogiwod", RegexOptions.None, new string[] { "cat---dog", "cat", "---", "dog" } }; - yield return new object[] { null, @"(cat)(\x2e*)(dog)", "asdlkcat...dogiwod", RegexOptions.None, new string[] { "cat...dog", "cat", "...", "dog" } }; - yield return new object[] { null, @"(cat)(\x2f*)(dog)", "asdlkcat///dogiwod", RegexOptions.None, new string[] { "cat///dog", "cat", "///", "dog" } }; - - yield return new object[] { null, @"(cat)(\x2A*)(dog)", "asdlkcat***dogiwod", RegexOptions.None, new string[] { "cat***dog", "cat", "***", "dog" } }; - yield return new object[] { null, @"(cat)(\x2B*)(dog)", "asdlkcat+++dogiwod", RegexOptions.None, new string[] { "cat+++dog", "cat", "+++", "dog" } }; - yield return new object[] { null, @"(cat)(\x2C*)(dog)", "asdlkcat,,,dogiwod", RegexOptions.None, new string[] { "cat,,,dog", "cat", ",,,", "dog" } }; - yield return new object[] { null, @"(cat)(\x2D*)(dog)", "asdlkcat---dogiwod", RegexOptions.None, new string[] { "cat---dog", "cat", "---", "dog" } }; - yield return new object[] { null, @"(cat)(\x2E*)(dog)", "asdlkcat...dogiwod", RegexOptions.None, new string[] { "cat...dog", "cat", "...", "dog" } }; - yield return new object[] { null, @"(cat)(\x2F*)(dog)", "asdlkcat///dogiwod", RegexOptions.None, new string[] { "cat///dog", "cat", "///", "dog" } }; - - // ScanControl - yield return new object[] { null, @"(cat)(\c@*)(dog)", "asdlkcat\0\0dogiwod", RegexOptions.None, new string[] { "cat\0\0dog", "cat", "\0\0", "dog" } }; - yield return new object[] { null, @"(cat)(\cA*)(dog)", "asdlkcat\u0001dogiwod", RegexOptions.None, new string[] { "cat\u0001dog", "cat", "\u0001", "dog" } }; - yield return new object[] { null, @"(cat)(\ca*)(dog)", "asdlkcat\u0001dogiwod", RegexOptions.None, new string[] { "cat\u0001dog", "cat", "\u0001", "dog" } }; - - yield return new object[] { null, @"(cat)(\cC*)(dog)", "asdlkcat\u0003dogiwod", RegexOptions.None, new string[] { "cat\u0003dog", "cat", "\u0003", "dog" } }; - yield return new object[] { null, @"(cat)(\cc*)(dog)", "asdlkcat\u0003dogiwod", RegexOptions.None, new string[] { "cat\u0003dog", "cat", "\u0003", "dog" } }; - - yield return new object[] { null, @"(cat)(\cD*)(dog)", "asdlkcat\u0004dogiwod", RegexOptions.None, new string[] { "cat\u0004dog", "cat", "\u0004", "dog" } }; - yield return new object[] { null, @"(cat)(\cd*)(dog)", "asdlkcat\u0004dogiwod", RegexOptions.None, new string[] { "cat\u0004dog", "cat", "\u0004", "dog" } }; - - yield return new object[] { null, @"(cat)(\cX*)(dog)", "asdlkcat\u0018dogiwod", RegexOptions.None, new string[] { "cat\u0018dog", "cat", "\u0018", "dog" } }; - yield return new object[] { null, @"(cat)(\cx*)(dog)", "asdlkcat\u0018dogiwod", RegexOptions.None, new string[] { "cat\u0018dog", "cat", "\u0018", "dog" } }; - - yield return new object[] { null, @"(cat)(\cZ*)(dog)", "asdlkcat\u001adogiwod", RegexOptions.None, new string[] { "cat\u001adog", "cat", "\u001a", "dog" } }; - yield return new object[] { null, @"(cat)(\cz*)(dog)", "asdlkcat\u001adogiwod", RegexOptions.None, new string[] { "cat\u001adog", "cat", "\u001a", "dog" } }; - - if (!PlatformDetection.IsNetFramework) // missing fix for https://github.com/dotnet/runtime/issues/24759 - { - yield return new object[] { null, @"(cat)(\c[*)(dog)", "asdlkcat\u001bdogiwod", RegexOptions.None, new string[] { "cat\u001bdog", "cat", "\u001b", "dog" } }; - } + yield return new object[] { engine, null, @"(cat) (?#cat) \s+ (?#followed by 1 or more whitespace) (dog) (?#followed by dog)", "cat dog", RegexOptions.IgnorePatternWhitespace, new string[] { "cat dog", "cat", "dog" } }; + + // Back Reference + yield return new object[] { engine, null, @"(?cat)(?dog)\k", "asdfcatdogcatdog", RegexOptions.None, new string[] { "catdogcat", "cat", "dog" } }; + yield return new object[] { engine, null, @"(?cat)\s+(?dog)\k", "asdfcat dogcat dog", RegexOptions.None, new string[] { "cat dogcat", "cat", "dog" } }; + yield return new object[] { engine, null, @"(?cat)\s+(?dog)\k'cat'", "asdfcat dogcat dog", RegexOptions.None, new string[] { "cat dogcat", "cat", "dog" } }; + yield return new object[] { engine, null, @"(?cat)\s+(?dog)\", "asdfcat dogcat dog", RegexOptions.None, new string[] { "cat dogcat", "cat", "dog" } }; + yield return new object[] { engine, null, @"(?cat)\s+(?dog)\'cat'", "asdfcat dogcat dog", RegexOptions.None, new string[] { "cat dogcat", "cat", "dog" } }; + + yield return new object[] { engine, null, @"(?cat)\s+(?dog)\k<1>", "asdfcat dogcat dog", RegexOptions.None, new string[] { "cat dogcat", "cat", "dog" } }; + yield return new object[] { engine, null, @"(?cat)\s+(?dog)\k'1'", "asdfcat dogcat dog", RegexOptions.None, new string[] { "cat dogcat", "cat", "dog" } }; + yield return new object[] { engine, null, @"(?cat)\s+(?dog)\<1>", "asdfcat dogcat dog", RegexOptions.None, new string[] { "cat dogcat", "cat", "dog" } }; + yield return new object[] { engine, null, @"(?cat)\s+(?dog)\'1'", "asdfcat dogcat dog", RegexOptions.None, new string[] { "cat dogcat", "cat", "dog" } }; + yield return new object[] { engine, null, @"(?cat)\s+(?dog)\1", "asdfcat dogcat dog", RegexOptions.None, new string[] { "cat dogcat", "cat", "dog" } }; + yield return new object[] { engine, null, @"(?cat)\s+(?dog)\1", "asdfcat dogcat dog", RegexOptions.ECMAScript, new string[] { "cat dogcat", "cat", "dog" } }; + + yield return new object[] { engine, null, @"(?cat)\s+(?dog)\k", "asdfcat dogdog dog", RegexOptions.None, new string[] { "cat dogdog", "cat", "dog" } }; + yield return new object[] { engine, null, @"(?cat)\s+(?dog)\2", "asdfcat dogdog dog", RegexOptions.None, new string[] { "cat dogdog", "cat", "dog" } }; + yield return new object[] { engine, null, @"(?cat)\s+(?dog)\2", "asdfcat dogdog dog", RegexOptions.ECMAScript, new string[] { "cat dogdog", "cat", "dog" } }; + + // Octal + yield return new object[] { engine, null, @"(cat)(\077)", "hellocat?dogworld", RegexOptions.None, new string[] { "cat?", "cat", "?" } }; + yield return new object[] { engine, null, @"(cat)(\77)", "hellocat?dogworld", RegexOptions.None, new string[] { "cat?", "cat", "?" } }; + yield return new object[] { engine, null, @"(cat)(\176)", "hellocat~dogworld", RegexOptions.None, new string[] { "cat~", "cat", "~" } }; + yield return new object[] { engine, null, @"(cat)(\400)", "hellocat\0dogworld", RegexOptions.None, new string[] { "cat\0", "cat", "\0" } }; + yield return new object[] { engine, null, @"(cat)(\300)", "hellocat\u00C0dogworld", RegexOptions.None, new string[] { "cat\u00C0", "cat", "\u00C0" } }; + yield return new object[] { engine, null, @"(cat)(\477)", "hellocat\u003Fdogworld", RegexOptions.None, new string[] { "cat\u003F", "cat", "\u003F" } }; + yield return new object[] { engine, null, @"(cat)(\777)", "hellocat\u00FFdogworld", RegexOptions.None, new string[] { "cat\u00FF", "cat", "\u00FF" } }; + yield return new object[] { engine, null, @"(cat)(\7770)", "hellocat\u00FF0dogworld", RegexOptions.None, new string[] { "cat\u00FF0", "cat", "\u00FF0" } }; + + yield return new object[] { engine, null, @"(cat)(\077)", "hellocat?dogworld", RegexOptions.ECMAScript, new string[] { "cat?", "cat", "?" } }; + yield return new object[] { engine, null, @"(cat)(\77)", "hellocat?dogworld", RegexOptions.ECMAScript, new string[] { "cat?", "cat", "?" } }; + yield return new object[] { engine, null, @"(cat)(\7)", "hellocat\adogworld", RegexOptions.ECMAScript, new string[] { "cat\a", "cat", "\a" } }; + yield return new object[] { engine, null, @"(cat)(\40)", "hellocat dogworld", RegexOptions.ECMAScript, new string[] { "cat ", "cat", " " } }; + yield return new object[] { engine, null, @"(cat)(\040)", "hellocat dogworld", RegexOptions.ECMAScript, new string[] { "cat ", "cat", " " } }; + yield return new object[] { engine, null, @"(cat)(\176)", "hellocatcat76dogworld", RegexOptions.ECMAScript, new string[] { "catcat76", "cat", "cat76" } }; + yield return new object[] { engine, null, @"(cat)(\377)", "hellocat\u00FFdogworld", RegexOptions.ECMAScript, new string[] { "cat\u00FF", "cat", "\u00FF" } }; + yield return new object[] { engine, null, @"(cat)(\400)", "hellocat 0Fdogworld", RegexOptions.ECMAScript, new string[] { "cat 0", "cat", " 0" } }; + + // Decimal + yield return new object[] { engine, null, @"(cat)\s+(?<2147483646>dog)", "asdlkcat dogiwod", RegexOptions.None, new string[] { "cat dog", "cat", "dog" } }; + yield return new object[] { engine, null, @"(cat)\s+(?<2147483647>dog)", "asdlkcat dogiwod", RegexOptions.None, new string[] { "cat dog", "cat", "dog" } }; + + // Hex + yield return new object[] { engine, null, @"(cat)(\x2a*)(dog)", "asdlkcat***dogiwod", RegexOptions.None, new string[] { "cat***dog", "cat", "***", "dog" } }; + yield return new object[] { engine, null, @"(cat)(\x2b*)(dog)", "asdlkcat+++dogiwod", RegexOptions.None, new string[] { "cat+++dog", "cat", "+++", "dog" } }; + yield return new object[] { engine, null, @"(cat)(\x2c*)(dog)", "asdlkcat,,,dogiwod", RegexOptions.None, new string[] { "cat,,,dog", "cat", ",,,", "dog" } }; + yield return new object[] { engine, null, @"(cat)(\x2d*)(dog)", "asdlkcat---dogiwod", RegexOptions.None, new string[] { "cat---dog", "cat", "---", "dog" } }; + yield return new object[] { engine, null, @"(cat)(\x2e*)(dog)", "asdlkcat...dogiwod", RegexOptions.None, new string[] { "cat...dog", "cat", "...", "dog" } }; + yield return new object[] { engine, null, @"(cat)(\x2f*)(dog)", "asdlkcat///dogiwod", RegexOptions.None, new string[] { "cat///dog", "cat", "///", "dog" } }; + + yield return new object[] { engine, null, @"(cat)(\x2A*)(dog)", "asdlkcat***dogiwod", RegexOptions.None, new string[] { "cat***dog", "cat", "***", "dog" } }; + yield return new object[] { engine, null, @"(cat)(\x2B*)(dog)", "asdlkcat+++dogiwod", RegexOptions.None, new string[] { "cat+++dog", "cat", "+++", "dog" } }; + yield return new object[] { engine, null, @"(cat)(\x2C*)(dog)", "asdlkcat,,,dogiwod", RegexOptions.None, new string[] { "cat,,,dog", "cat", ",,,", "dog" } }; + yield return new object[] { engine, null, @"(cat)(\x2D*)(dog)", "asdlkcat---dogiwod", RegexOptions.None, new string[] { "cat---dog", "cat", "---", "dog" } }; + yield return new object[] { engine, null, @"(cat)(\x2E*)(dog)", "asdlkcat...dogiwod", RegexOptions.None, new string[] { "cat...dog", "cat", "...", "dog" } }; + yield return new object[] { engine, null, @"(cat)(\x2F*)(dog)", "asdlkcat///dogiwod", RegexOptions.None, new string[] { "cat///dog", "cat", "///", "dog" } }; + + // ScanControl + yield return new object[] { engine, null, @"(cat)(\c@*)(dog)", "asdlkcat\0\0dogiwod", RegexOptions.None, new string[] { "cat\0\0dog", "cat", "\0\0", "dog" } }; + yield return new object[] { engine, null, @"(cat)(\cA*)(dog)", "asdlkcat\u0001dogiwod", RegexOptions.None, new string[] { "cat\u0001dog", "cat", "\u0001", "dog" } }; + yield return new object[] { engine, null, @"(cat)(\ca*)(dog)", "asdlkcat\u0001dogiwod", RegexOptions.None, new string[] { "cat\u0001dog", "cat", "\u0001", "dog" } }; + + yield return new object[] { engine, null, @"(cat)(\cC*)(dog)", "asdlkcat\u0003dogiwod", RegexOptions.None, new string[] { "cat\u0003dog", "cat", "\u0003", "dog" } }; + yield return new object[] { engine, null, @"(cat)(\cc*)(dog)", "asdlkcat\u0003dogiwod", RegexOptions.None, new string[] { "cat\u0003dog", "cat", "\u0003", "dog" } }; + + yield return new object[] { engine, null, @"(cat)(\cD*)(dog)", "asdlkcat\u0004dogiwod", RegexOptions.None, new string[] { "cat\u0004dog", "cat", "\u0004", "dog" } }; + yield return new object[] { engine, null, @"(cat)(\cd*)(dog)", "asdlkcat\u0004dogiwod", RegexOptions.None, new string[] { "cat\u0004dog", "cat", "\u0004", "dog" } }; + + yield return new object[] { engine, null, @"(cat)(\cX*)(dog)", "asdlkcat\u0018dogiwod", RegexOptions.None, new string[] { "cat\u0018dog", "cat", "\u0018", "dog" } }; + yield return new object[] { engine, null, @"(cat)(\cx*)(dog)", "asdlkcat\u0018dogiwod", RegexOptions.None, new string[] { "cat\u0018dog", "cat", "\u0018", "dog" } }; + + yield return new object[] { engine, null, @"(cat)(\cZ*)(dog)", "asdlkcat\u001adogiwod", RegexOptions.None, new string[] { "cat\u001adog", "cat", "\u001a", "dog" } }; + yield return new object[] { engine, null, @"(cat)(\cz*)(dog)", "asdlkcat\u001adogiwod", RegexOptions.None, new string[] { "cat\u001adog", "cat", "\u001a", "dog" } }; + + if (!PlatformDetection.IsNetFramework) // missing fix for https://github.com/dotnet/runtime/issues/24759 + { + yield return new object[] { engine, null, @"(cat)(\c[*)(dog)", "asdlkcat\u001bdogiwod", RegexOptions.None, new string[] { "cat\u001bdog", "cat", "\u001b", "dog" } }; + } - // Atomic Zero-Width Assertions \A \G ^ \Z \z \b \B - //\A - yield return new object[] { null, @"\Acat\s+dog", "cat \n\n\n dog", RegexOptions.None, new string[] { "cat \n\n\n dog" } }; - yield return new object[] { null, @"\Acat\s+dog", "cat \n\n\n dog", RegexOptions.Multiline, new string[] { "cat \n\n\n dog" } }; - yield return new object[] { null, @"\A(cat)\s+(dog)", "cat \n\n\n dog", RegexOptions.None, new string[] { "cat \n\n\n dog", "cat", "dog" } }; - yield return new object[] { null, @"\A(cat)\s+(dog)", "cat \n\n\n dog", RegexOptions.Multiline, new string[] { "cat \n\n\n dog", "cat", "dog" } }; - - //\G - yield return new object[] { null, @"\Gcat\s+dog", "cat \n\n\n dog", RegexOptions.None, new string[] { "cat \n\n\n dog" } }; - yield return new object[] { null, @"\Gcat\s+dog", "cat \n\n\n dog", RegexOptions.Multiline, new string[] { "cat \n\n\n dog" } }; - yield return new object[] { null, @"\Gcat\s+dog", "cat \n\n\n dog", RegexOptions.ECMAScript, new string[] { "cat \n\n\n dog" } }; - yield return new object[] { null, @"\G(cat)\s+(dog)", "cat \n\n\n dog", RegexOptions.None, new string[] { "cat \n\n\n dog", "cat", "dog" } }; - yield return new object[] { null, @"\G(cat)\s+(dog)", "cat \n\n\n dog", RegexOptions.Multiline, new string[] { "cat \n\n\n dog", "cat", "dog" } }; - yield return new object[] { null, @"\G(cat)\s+(dog)", "cat \n\n\n dog", RegexOptions.ECMAScript, new string[] { "cat \n\n\n dog", "cat", "dog" } }; - - //^ - yield return new object[] { null, @"^cat\s+dog", "cat \n\n\n dog", RegexOptions.None, new string[] { "cat \n\n\n dog" } }; - yield return new object[] { null, @"^cat\s+dog", "cat \n\n\n dog", RegexOptions.Multiline, new string[] { "cat \n\n\n dog" } }; - yield return new object[] { null, @"mouse\s\n^cat\s+dog", "mouse\n\ncat \n\n\n dog", RegexOptions.Multiline, new string[] { "mouse\n\ncat \n\n\n dog" } }; - yield return new object[] { null, @"^cat\s+dog", "cat \n\n\n dog", RegexOptions.ECMAScript, new string[] { "cat \n\n\n dog" } }; - yield return new object[] { null, @"^(cat)\s+(dog)", "cat \n\n\n dog", RegexOptions.None, new string[] { "cat \n\n\n dog", "cat", "dog" } }; - yield return new object[] { null, @"^(cat)\s+(dog)", "cat \n\n\n dog", RegexOptions.Multiline, new string[] { "cat \n\n\n dog", "cat", "dog" } }; - yield return new object[] { null, @"(mouse)\s\n^(cat)\s+(dog)", "mouse\n\ncat \n\n\n dog", RegexOptions.Multiline, new string[] { "mouse\n\ncat \n\n\n dog", "mouse", "cat", "dog" } }; - yield return new object[] { null, @"^(cat)\s+(dog)", "cat \n\n\n dog", RegexOptions.ECMAScript, new string[] { "cat \n\n\n dog", "cat", "dog" } }; - - //\Z - yield return new object[] { null, @"cat\s+dog\Z", "cat \n\n\n dog", RegexOptions.None, new string[] { "cat \n\n\n dog" } }; - yield return new object[] { null, @"cat\s+dog\Z", "cat \n\n\n dog", RegexOptions.Multiline, new string[] { "cat \n\n\n dog" } }; - yield return new object[] { null, @"cat\s+dog\Z", "cat \n\n\n dog", RegexOptions.ECMAScript, new string[] { "cat \n\n\n dog" } }; - yield return new object[] { null, @"cat\s+dog\Z", "cat \n\n\n dog\n", RegexOptions.None, new string[] { "cat \n\n\n dog" } }; - yield return new object[] { null, @"cat\s+dog\Z", "cat \n\n\n dog\n", RegexOptions.Multiline, new string[] { "cat \n\n\n dog" } }; - yield return new object[] { null, @"cat\s+dog\Z", "cat \n\n\n dog\n", RegexOptions.ECMAScript, new string[] { "cat \n\n\n dog" } }; - yield return new object[] { null, @"(cat)\s+(dog)\Z", "cat \n\n\n dog", RegexOptions.None, new string[] { "cat \n\n\n dog", "cat", "dog" } }; - yield return new object[] { null, @"(cat)\s+(dog)\Z", "cat \n\n\n dog", RegexOptions.Multiline, new string[] { "cat \n\n\n dog", "cat", "dog" } }; - yield return new object[] { null, @"(cat)\s+(dog)\Z", "cat \n\n\n dog", RegexOptions.ECMAScript, new string[] { "cat \n\n\n dog", "cat", "dog" } }; - yield return new object[] { null, @"(cat)\s+(dog)\Z", "cat \n\n\n dog\n", RegexOptions.None, new string[] { "cat \n\n\n dog", "cat", "dog" } }; - yield return new object[] { null, @"(cat)\s+(dog)\Z", "cat \n\n\n dog\n", RegexOptions.Multiline, new string[] { "cat \n\n\n dog", "cat", "dog" } }; - yield return new object[] { null, @"(cat)\s+(dog)\Z", "cat \n\n\n dog\n", RegexOptions.ECMAScript, new string[] { "cat \n\n\n dog", "cat", "dog" } }; - - //\z - yield return new object[] { null, @"cat\s+dog\z", "cat \n\n\n dog", RegexOptions.None, new string[] { "cat \n\n\n dog" } }; - yield return new object[] { null, @"cat\s+dog\z", "cat \n\n\n dog", RegexOptions.Multiline, new string[] { "cat \n\n\n dog" } }; - yield return new object[] { null, @"cat\s+dog\z", "cat \n\n\n dog", RegexOptions.ECMAScript, new string[] { "cat \n\n\n dog" } }; - yield return new object[] { null, @"(cat)\s+(dog)\z", "cat \n\n\n dog", RegexOptions.None, new string[] { "cat \n\n\n dog", "cat", "dog" } }; - yield return new object[] { null, @"(cat)\s+(dog)\z", "cat \n\n\n dog", RegexOptions.Multiline, new string[] { "cat \n\n\n dog", "cat", "dog" } }; - yield return new object[] { null, @"(cat)\s+(dog)\z", "cat \n\n\n dog", RegexOptions.ECMAScript, new string[] { "cat \n\n\n dog", "cat", "dog" } }; - - //\b - yield return new object[] { null, @"\bcat\b", "cat", RegexOptions.None, new string[] { "cat" } }; - yield return new object[] { null, @"\bcat\b", "dog cat mouse", RegexOptions.None, new string[] { "cat" } }; - yield return new object[] { null, @"\bcat\b", "cat", RegexOptions.ECMAScript, new string[] { "cat" } }; - yield return new object[] { null, @"\bcat\b", "dog cat mouse", RegexOptions.ECMAScript, new string[] { "cat" } }; - yield return new object[] { null, @".*\bcat\b", "cat", RegexOptions.None, new string[] { "cat" } }; - yield return new object[] { null, @".*\bcat\b", "dog cat mouse", RegexOptions.None, new string[] { "dog cat" } }; - yield return new object[] { null, @".*\bcat\b", "cat", RegexOptions.ECMAScript, new string[] { "cat" } }; - yield return new object[] { null, @".*\bcat\b", "dog cat mouse", RegexOptions.ECMAScript, new string[] { "dog cat" } }; - yield return new object[] { null, @"\b@cat", "123START123@catEND", RegexOptions.None, new string[] { "@cat" } }; - yield return new object[] { null, @"\b\cat)\s+(?dog)\s+\123\s+\234", "asdfcat dog cat23 dog34eia", RegexOptions.ECMAScript, new string[] { "cat dog cat23 dog34", "cat", "dog" } }; - - // Balanced Matching - yield return new object[] { null, @"
+ // Atomic Zero-Width Assertions \A \G ^ \Z \z \b \B + //\A + yield return new object[] { engine, null, @"\Acat\s+dog", "cat \n\n\n dog", RegexOptions.None, new string[] { "cat \n\n\n dog" } }; + yield return new object[] { engine, null, @"\Acat\s+dog", "cat \n\n\n dog", RegexOptions.Multiline, new string[] { "cat \n\n\n dog" } }; + yield return new object[] { engine, null, @"\A(cat)\s+(dog)", "cat \n\n\n dog", RegexOptions.None, new string[] { "cat \n\n\n dog", "cat", "dog" } }; + yield return new object[] { engine, null, @"\A(cat)\s+(dog)", "cat \n\n\n dog", RegexOptions.Multiline, new string[] { "cat \n\n\n dog", "cat", "dog" } }; + + //\G + yield return new object[] { engine, null, @"\Gcat\s+dog", "cat \n\n\n dog", RegexOptions.None, new string[] { "cat \n\n\n dog" } }; + yield return new object[] { engine, null, @"\Gcat\s+dog", "cat \n\n\n dog", RegexOptions.Multiline, new string[] { "cat \n\n\n dog" } }; + yield return new object[] { engine, null, @"\Gcat\s+dog", "cat \n\n\n dog", RegexOptions.ECMAScript, new string[] { "cat \n\n\n dog" } }; + yield return new object[] { engine, null, @"\G(cat)\s+(dog)", "cat \n\n\n dog", RegexOptions.None, new string[] { "cat \n\n\n dog", "cat", "dog" } }; + yield return new object[] { engine, null, @"\G(cat)\s+(dog)", "cat \n\n\n dog", RegexOptions.Multiline, new string[] { "cat \n\n\n dog", "cat", "dog" } }; + yield return new object[] { engine, null, @"\G(cat)\s+(dog)", "cat \n\n\n dog", RegexOptions.ECMAScript, new string[] { "cat \n\n\n dog", "cat", "dog" } }; + + //^ + yield return new object[] { engine, null, @"^cat\s+dog", "cat \n\n\n dog", RegexOptions.None, new string[] { "cat \n\n\n dog" } }; + yield return new object[] { engine, null, @"^cat\s+dog", "cat \n\n\n dog", RegexOptions.Multiline, new string[] { "cat \n\n\n dog" } }; + yield return new object[] { engine, null, @"mouse\s\n^cat\s+dog", "mouse\n\ncat \n\n\n dog", RegexOptions.Multiline, new string[] { "mouse\n\ncat \n\n\n dog" } }; + yield return new object[] { engine, null, @"^cat\s+dog", "cat \n\n\n dog", RegexOptions.ECMAScript, new string[] { "cat \n\n\n dog" } }; + yield return new object[] { engine, null, @"^(cat)\s+(dog)", "cat \n\n\n dog", RegexOptions.None, new string[] { "cat \n\n\n dog", "cat", "dog" } }; + yield return new object[] { engine, null, @"^(cat)\s+(dog)", "cat \n\n\n dog", RegexOptions.Multiline, new string[] { "cat \n\n\n dog", "cat", "dog" } }; + yield return new object[] { engine, null, @"(mouse)\s\n^(cat)\s+(dog)", "mouse\n\ncat \n\n\n dog", RegexOptions.Multiline, new string[] { "mouse\n\ncat \n\n\n dog", "mouse", "cat", "dog" } }; + yield return new object[] { engine, null, @"^(cat)\s+(dog)", "cat \n\n\n dog", RegexOptions.ECMAScript, new string[] { "cat \n\n\n dog", "cat", "dog" } }; + + //\Z + yield return new object[] { engine, null, @"cat\s+dog\Z", "cat \n\n\n dog", RegexOptions.None, new string[] { "cat \n\n\n dog" } }; + yield return new object[] { engine, null, @"cat\s+dog\Z", "cat \n\n\n dog", RegexOptions.Multiline, new string[] { "cat \n\n\n dog" } }; + yield return new object[] { engine, null, @"cat\s+dog\Z", "cat \n\n\n dog", RegexOptions.ECMAScript, new string[] { "cat \n\n\n dog" } }; + yield return new object[] { engine, null, @"cat\s+dog\Z", "cat \n\n\n dog\n", RegexOptions.None, new string[] { "cat \n\n\n dog" } }; + yield return new object[] { engine, null, @"cat\s+dog\Z", "cat \n\n\n dog\n", RegexOptions.Multiline, new string[] { "cat \n\n\n dog" } }; + yield return new object[] { engine, null, @"cat\s+dog\Z", "cat \n\n\n dog\n", RegexOptions.ECMAScript, new string[] { "cat \n\n\n dog" } }; + yield return new object[] { engine, null, @"(cat)\s+(dog)\Z", "cat \n\n\n dog", RegexOptions.None, new string[] { "cat \n\n\n dog", "cat", "dog" } }; + yield return new object[] { engine, null, @"(cat)\s+(dog)\Z", "cat \n\n\n dog", RegexOptions.Multiline, new string[] { "cat \n\n\n dog", "cat", "dog" } }; + yield return new object[] { engine, null, @"(cat)\s+(dog)\Z", "cat \n\n\n dog", RegexOptions.ECMAScript, new string[] { "cat \n\n\n dog", "cat", "dog" } }; + yield return new object[] { engine, null, @"(cat)\s+(dog)\Z", "cat \n\n\n dog\n", RegexOptions.None, new string[] { "cat \n\n\n dog", "cat", "dog" } }; + yield return new object[] { engine, null, @"(cat)\s+(dog)\Z", "cat \n\n\n dog\n", RegexOptions.Multiline, new string[] { "cat \n\n\n dog", "cat", "dog" } }; + yield return new object[] { engine, null, @"(cat)\s+(dog)\Z", "cat \n\n\n dog\n", RegexOptions.ECMAScript, new string[] { "cat \n\n\n dog", "cat", "dog" } }; + + //\z + yield return new object[] { engine, null, @"cat\s+dog\z", "cat \n\n\n dog", RegexOptions.None, new string[] { "cat \n\n\n dog" } }; + yield return new object[] { engine, null, @"cat\s+dog\z", "cat \n\n\n dog", RegexOptions.Multiline, new string[] { "cat \n\n\n dog" } }; + yield return new object[] { engine, null, @"cat\s+dog\z", "cat \n\n\n dog", RegexOptions.ECMAScript, new string[] { "cat \n\n\n dog" } }; + yield return new object[] { engine, null, @"(cat)\s+(dog)\z", "cat \n\n\n dog", RegexOptions.None, new string[] { "cat \n\n\n dog", "cat", "dog" } }; + yield return new object[] { engine, null, @"(cat)\s+(dog)\z", "cat \n\n\n dog", RegexOptions.Multiline, new string[] { "cat \n\n\n dog", "cat", "dog" } }; + yield return new object[] { engine, null, @"(cat)\s+(dog)\z", "cat \n\n\n dog", RegexOptions.ECMAScript, new string[] { "cat \n\n\n dog", "cat", "dog" } }; + + //\b + yield return new object[] { engine, null, @"\bcat\b", "cat", RegexOptions.None, new string[] { "cat" } }; + yield return new object[] { engine, null, @"\bcat\b", "dog cat mouse", RegexOptions.None, new string[] { "cat" } }; + yield return new object[] { engine, null, @"\bcat\b", "cat", RegexOptions.ECMAScript, new string[] { "cat" } }; + yield return new object[] { engine, null, @"\bcat\b", "dog cat mouse", RegexOptions.ECMAScript, new string[] { "cat" } }; + yield return new object[] { engine, null, @".*\bcat\b", "cat", RegexOptions.None, new string[] { "cat" } }; + yield return new object[] { engine, null, @".*\bcat\b", "dog cat mouse", RegexOptions.None, new string[] { "dog cat" } }; + yield return new object[] { engine, null, @".*\bcat\b", "cat", RegexOptions.ECMAScript, new string[] { "cat" } }; + yield return new object[] { engine, null, @".*\bcat\b", "dog cat mouse", RegexOptions.ECMAScript, new string[] { "dog cat" } }; + yield return new object[] { engine, null, @"\b@cat", "123START123@catEND", RegexOptions.None, new string[] { "@cat" } }; + yield return new object[] { engine, null, @"\b\cat)\s+(?dog)\s+\123\s+\234", "asdfcat dog cat23 dog34eia", RegexOptions.ECMAScript, new string[] { "cat dog cat23 dog34", "cat", "dog" } }; + + // Balanced Matching + yield return new object[] { engine, null, @"
(?>
(?) |
(?<-DEPTH>) | @@ -529,374 +531,399 @@ public static IEnumerable Groups_Basic_TestData() (?(DEPTH)(?!))
", "
this is some
red
text
", RegexOptions.IgnorePatternWhitespace, new string[] { "
this is some
red
text
", "" } }; - yield return new object[] { null, @"( + yield return new object[] { engine, null, @"( ((?'open'<+)[^<>]*)+ ((?'close-open'>+)[^<>]*)+ )+", "<01deep_01<02deep_01<03deep_01>><02deep_02><02deep_03<03deep_03>>>", RegexOptions.IgnorePatternWhitespace, new string[] { "<01deep_01<02deep_01<03deep_01>><02deep_02><02deep_03<03deep_03>>>", "<02deep_03<03deep_03>>>", "<03deep_03", ">>>", "<", "03deep_03" } }; - yield return new object[] { null, @"( + yield return new object[] { engine, null, @"( (?<)? [^<>]? (?>)? )*", "<01deep_01<02deep_01<03deep_01>><02deep_02><02deep_03<03deep_03>>>", RegexOptions.IgnorePatternWhitespace, new string[] { "<01deep_01<02deep_01<03deep_01>><02deep_02><02deep_03<03deep_03>>>", "", "", "01deep_01<02deep_01<03deep_01>><02deep_02><02deep_03<03deep_03>>" } }; - yield return new object[] { null, @"( + yield return new object[] { engine, null, @"( (?<[^/<>]*>)? [^<>]? (?]*>)? )*", "Cat", RegexOptions.IgnorePatternWhitespace, new string[] { "Cat", "", "", "Cat" } }; - yield return new object[] { null, @"( + yield return new object[] { engine, null, @"( (?<(?[^/<>]*)>)? [^<>]? (?>)? )*", "catdog", RegexOptions.IgnorePatternWhitespace, new string[] { "catdog", "", "", "a", "dog" } }; - // Balanced Matching With Backtracking - yield return new object[] { null, @"( + // Balanced Matching With Backtracking + yield return new object[] { engine, null, @"( (?<[^/<>]*>)? .? (?]*>)? )* (?(start)(?!)) ", "Cat<<<>>><><<<>>>>", RegexOptions.IgnorePatternWhitespace, new string[] { "Cat<<<>>><><<<>>>>", "", "", "Cat" } }; - // Character Classes and Lazy quantifier - yield return new object[] { null, @"([0-9]+?)([\w]+?)", "55488aheiaheiad", RegexOptions.ECMAScript, new string[] { "55", "5", "5" } }; - yield return new object[] { null, @"([0-9]+?)([a-z]+?)", "55488aheiaheiad", RegexOptions.ECMAScript, new string[] { "55488a", "55488", "a" } }; + // Character Classes and Lazy quantifier + yield return new object[] { engine, null, @"([0-9]+?)([\w]+?)", "55488aheiaheiad", RegexOptions.ECMAScript, new string[] { "55", "5", "5" } }; + yield return new object[] { engine, null, @"([0-9]+?)([a-z]+?)", "55488aheiaheiad", RegexOptions.ECMAScript, new string[] { "55488a", "55488", "a" } }; - // Miscellaneous/Regression scenarios - yield return new object[] { null, @"(?1)(?.*?)(?=2)", "1" + Environment.NewLine + "" + Environment.NewLine + "2", RegexOptions.Singleline | RegexOptions.ExplicitCapture, + // Miscellaneous/Regression scenarios + yield return new object[] { engine, null, @"(?1)(?.*?)(?=2)", "1" + Environment.NewLine + "" + Environment.NewLine + "2", RegexOptions.Singleline | RegexOptions.ExplicitCapture, new string[] { "1" + Environment.NewLine + "" + Environment.NewLine, "1", Environment.NewLine + ""+ Environment.NewLine } }; - yield return new object[] { null, @"\G<%#(?.*?)?%>", @"<%# DataBinder.Eval(this, ""MyNumber"") %>", RegexOptions.Singleline, new string[] { @"<%# DataBinder.Eval(this, ""MyNumber"") %>", @" DataBinder.Eval(this, ""MyNumber"") " } }; - - // Nested Quantifiers - yield return new object[] { null, @"^[abcd]{0,0x10}*$", "a{0,0x10}}}", RegexOptions.None, new string[] { "a{0,0x10}}}" } }; - - // Lazy operator Backtracking - yield return new object[] { null, @"http://([a-zA-z0-9\-]*\.?)*?(:[0-9]*)??/", "http://www.msn.com/", RegexOptions.IgnoreCase, new string[] { "http://www.msn.com/", "com", string.Empty } }; - yield return new object[] { null, @"http://([a-zA-Z0-9\-]*\.?)*?/", @"http://www.google.com/", RegexOptions.IgnoreCase, new string[] { "http://www.google.com/", "com" } }; - - yield return new object[] { null, @"([a-z]*?)([\w])", "cat", RegexOptions.IgnoreCase, new string[] { "c", string.Empty, "c" } }; - yield return new object[] { null, @"^([a-z]*?)([\w])$", "cat", RegexOptions.IgnoreCase, new string[] { "cat", "ca", "t" } }; - - // Backtracking - yield return new object[] { null, @"([a-z]*)([\w])", "cat", RegexOptions.IgnoreCase, new string[] { "cat", "ca", "t" } }; - yield return new object[] { null, @"^([a-z]*)([\w])$", "cat", RegexOptions.IgnoreCase, new string[] { "cat", "ca", "t" } }; - - // Backtracking with multiple (.*) groups -- important ASP.NET scenario - yield return new object[] { null, @"(.*)/(.*).aspx", "/.aspx", RegexOptions.None, new string[] { "/.aspx", string.Empty, string.Empty } }; - yield return new object[] { null, @"(.*)/(.*).aspx", "/homepage.aspx", RegexOptions.None, new string[] { "/homepage.aspx", string.Empty, "homepage" } }; - yield return new object[] { null, @"(.*)/(.*).aspx", "pages/.aspx", RegexOptions.None, new string[] { "pages/.aspx", "pages", string.Empty } }; - yield return new object[] { null, @"(.*)/(.*).aspx", "pages/homepage.aspx", RegexOptions.None, new string[] { "pages/homepage.aspx", "pages", "homepage" } }; - yield return new object[] { null, @"(.*)/(.*).aspx", "/pages/homepage.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx", "/pages", "homepage" } }; - yield return new object[] { null, @"(.*)/(.*).aspx", "/pages/homepage/index.aspx", RegexOptions.None, new string[] { "/pages/homepage/index.aspx", "/pages/homepage", "index" } }; - yield return new object[] { null, @"(.*)/(.*).aspx", "/pages/homepage.aspx/index.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx/index.aspx", "/pages/homepage.aspx", "index" } }; - yield return new object[] { null, @"(.*)/(.*)/(.*).aspx", "/pages/homepage.aspx/index.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx/index.aspx", "/pages", "homepage.aspx", "index" } }; - - // Backtracking with multiple (.+) groups - yield return new object[] { null, @"(.+)/(.+).aspx", "pages/homepage.aspx", RegexOptions.None, new string[] { "pages/homepage.aspx", "pages", "homepage" } }; - yield return new object[] { null, @"(.+)/(.+).aspx", "/pages/homepage.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx", "/pages", "homepage" } }; - yield return new object[] { null, @"(.+)/(.+).aspx", "/pages/homepage/index.aspx", RegexOptions.None, new string[] { "/pages/homepage/index.aspx", "/pages/homepage", "index" } }; - yield return new object[] { null, @"(.+)/(.+).aspx", "/pages/homepage.aspx/index.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx/index.aspx", "/pages/homepage.aspx", "index" } }; - yield return new object[] { null, @"(.+)/(.+)/(.+).aspx", "/pages/homepage.aspx/index.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx/index.aspx", "/pages", "homepage.aspx", "index" } }; - - // Backtracking with (.+) group followed by (.*) - yield return new object[] { null, @"(.+)/(.*).aspx", "pages/.aspx", RegexOptions.None, new string[] { "pages/.aspx", "pages", string.Empty } }; - yield return new object[] { null, @"(.+)/(.*).aspx", "pages/homepage.aspx", RegexOptions.None, new string[] { "pages/homepage.aspx", "pages", "homepage" } }; - yield return new object[] { null, @"(.+)/(.*).aspx", "/pages/homepage.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx", "/pages", "homepage" } }; - yield return new object[] { null, @"(.+)/(.*).aspx", "/pages/homepage/index.aspx", RegexOptions.None, new string[] { "/pages/homepage/index.aspx", "/pages/homepage", "index" } }; - yield return new object[] { null, @"(.+)/(.*).aspx", "/pages/homepage.aspx/index.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx/index.aspx", "/pages/homepage.aspx", "index" } }; - yield return new object[] { null, @"(.+)/(.*)/(.*).aspx", "/pages/homepage.aspx/index.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx/index.aspx", "/pages", "homepage.aspx", "index" } }; - - // Backtracking with (.*) group followed by (.+) - yield return new object[] { null, @"(.*)/(.+).aspx", "/homepage.aspx", RegexOptions.None, new string[] { "/homepage.aspx", string.Empty, "homepage" } }; - yield return new object[] { null, @"(.*)/(.+).aspx", "pages/homepage.aspx", RegexOptions.None, new string[] { "pages/homepage.aspx", "pages", "homepage" } }; - yield return new object[] { null, @"(.*)/(.+).aspx", "/pages/homepage.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx", "/pages", "homepage" } }; - yield return new object[] { null, @"(.*)/(.+).aspx", "/pages/homepage/index.aspx", RegexOptions.None, new string[] { "/pages/homepage/index.aspx", "/pages/homepage", "index" } }; - yield return new object[] { null, @"(.*)/(.+).aspx", "/pages/homepage.aspx/index.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx/index.aspx", "/pages/homepage.aspx", "index" } }; - yield return new object[] { null, @"(.*)/(.+)/(.+).aspx", "/pages/homepage.aspx/index.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx/index.aspx", "/pages", "homepage.aspx", "index" } }; - - // Quantifiers - yield return new object[] { null, @"a*", "", RegexOptions.None, new string[] { "" } }; - yield return new object[] { null, @"a*", "a", RegexOptions.None, new string[] { "a" } }; - yield return new object[] { null, @"a*", "aa", RegexOptions.None, new string[] { "aa" } }; - yield return new object[] { null, @"a*", "aaa", RegexOptions.None, new string[] { "aaa" } }; - yield return new object[] { null, @"a*?", "", RegexOptions.None, new string[] { "" } }; - yield return new object[] { null, @"a*?", "a", RegexOptions.None, new string[] { "" } }; - yield return new object[] { null, @"a*?", "aa", RegexOptions.None, new string[] { "" } }; - yield return new object[] { null, @"a+?", "aa", RegexOptions.None, new string[] { "a" } }; - yield return new object[] { null, @"a{1,", "a{1,", RegexOptions.None, new string[] { "a{1," } }; - yield return new object[] { null, @"a{1,3}", "aaaaa", RegexOptions.None, new string[] { "aaa" } }; - yield return new object[] { null, @"a{1,3}?", "aaaaa", RegexOptions.None, new string[] { "a" } }; - yield return new object[] { null, @"a{2,2}", "aaaaa", RegexOptions.None, new string[] { "aa" } }; - yield return new object[] { null, @"a{2,2}?", "aaaaa", RegexOptions.None, new string[] { "aa" } }; - yield return new object[] { null, @".{1,3}", "bb\nba", RegexOptions.None, new string[] { "bb" } }; - yield return new object[] { null, @".{1,3}?", "bb\nba", RegexOptions.None, new string[] { "b" } }; - yield return new object[] { null, @".{2,2}", "bbb\nba", RegexOptions.None, new string[] { "bb" } }; - yield return new object[] { null, @".{2,2}?", "bbb\nba", RegexOptions.None, new string[] { "bb" } }; - yield return new object[] { null, @"[abc]{1,3}", "ccaba", RegexOptions.None, new string[] { "cca" } }; - yield return new object[] { null, @"[abc]{1,3}?", "ccaba", RegexOptions.None, new string[] { "c" } }; - yield return new object[] { null, @"[abc]{2,2}", "ccaba", RegexOptions.None, new string[] { "cc" } }; - yield return new object[] { null, @"[abc]{2,2}?", "ccaba", RegexOptions.None, new string[] { "cc" } }; - yield return new object[] { null, @"(?:[abc]def){1,3}xyz", "cdefxyz", RegexOptions.None, new string[] { "cdefxyz" } }; - yield return new object[] { null, @"(?:[abc]def){1,3}xyz", "adefbdefcdefxyz", RegexOptions.None, new string[] { "adefbdefcdefxyz" } }; - yield return new object[] { null, @"(?:[abc]def){1,3}?xyz", "cdefxyz", RegexOptions.None, new string[] { "cdefxyz" } }; - yield return new object[] { null, @"(?:[abc]def){1,3}?xyz", "adefbdefcdefxyz", RegexOptions.None, new string[] { "adefbdefcdefxyz" } }; - yield return new object[] { null, @"(?:[abc]def){2,2}xyz", "adefbdefcdefxyz", RegexOptions.None, new string[] { "bdefcdefxyz" } }; - yield return new object[] { null, @"(?:[abc]def){2,2}?xyz", "adefbdefcdefxyz", RegexOptions.None, new string[] { "bdefcdefxyz" } }; - foreach (string prefix in new[] { "", "xyz" }) - { - yield return new object[] { null, prefix + @"(?:[abc]def){1,3}", prefix + "cdef", RegexOptions.None, new string[] { prefix + "cdef" } }; - yield return new object[] { null, prefix + @"(?:[abc]def){1,3}", prefix + "cdefadefbdef", RegexOptions.None, new string[] { prefix + "cdefadefbdef" } }; - yield return new object[] { null, prefix + @"(?:[abc]def){1,3}", prefix + "cdefadefbdefadef", RegexOptions.None, new string[] { prefix + "cdefadefbdef" } }; - yield return new object[] { null, prefix + @"(?:[abc]def){1,3}?", prefix + "cdef", RegexOptions.None, new string[] { prefix + "cdef" } }; - yield return new object[] { null, prefix + @"(?:[abc]def){1,3}?", prefix + "cdefadefbdef", RegexOptions.None, new string[] { prefix + "cdef" } }; - yield return new object[] { null, prefix + @"(?:[abc]def){2,2}", prefix + "cdefadefbdefadef", RegexOptions.None, new string[] { prefix + "cdefadef" } }; - yield return new object[] { null, prefix + @"(?:[abc]def){2,2}?", prefix + "cdefadefbdefadef", RegexOptions.None, new string[] { prefix + "cdefadef" } }; - } - yield return new object[] { null, @"(cat){", "cat{", RegexOptions.None, new string[] { "cat{", "cat" } }; - yield return new object[] { null, @"(cat){}", "cat{}", RegexOptions.None, new string[] { "cat{}", "cat" } }; - yield return new object[] { null, @"(cat){,", "cat{,", RegexOptions.None, new string[] { "cat{,", "cat" } }; - yield return new object[] { null, @"(cat){,}", "cat{,}", RegexOptions.None, new string[] { "cat{,}", "cat" } }; - yield return new object[] { null, @"(cat){cat}", "cat{cat}", RegexOptions.None, new string[] { "cat{cat}", "cat" } }; - yield return new object[] { null, @"(cat){cat,5}", "cat{cat,5}", RegexOptions.None, new string[] { "cat{cat,5}", "cat" } }; - yield return new object[] { null, @"(cat){5,dog}", "cat{5,dog}", RegexOptions.None, new string[] { "cat{5,dog}", "cat" } }; - yield return new object[] { null, @"(cat){cat,dog}", "cat{cat,dog}", RegexOptions.None, new string[] { "cat{cat,dog}", "cat" } }; - yield return new object[] { null, @"(cat){,}?", "cat{,}?", RegexOptions.None, new string[] { "cat{,}", "cat" } }; - yield return new object[] { null, @"(cat){cat}?", "cat{cat}?", RegexOptions.None, new string[] { "cat{cat}", "cat" } }; - yield return new object[] { null, @"(cat){cat,5}?", "cat{cat,5}?", RegexOptions.None, new string[] { "cat{cat,5}", "cat" } }; - yield return new object[] { null, @"(cat){5,dog}?", "cat{5,dog}?", RegexOptions.None, new string[] { "cat{5,dog}", "cat" } }; - yield return new object[] { null, @"(cat){cat,dog}?", "cat{cat,dog}?", RegexOptions.None, new string[] { "cat{cat,dog}", "cat" } }; - - // Atomic subexpressions - // Implicitly upgrading (or not) oneloop to be atomic - yield return new object[] { null, @"a*b", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"a*b+", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"a*b+?", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"a*(?>b+)", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"a*[^a]", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"a*[^a]+", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"a*[^a]+?", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"a*(?>[^a]+)", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"a*bcd", "aaabcd", RegexOptions.None, new string[] { "aaabcd" } }; - yield return new object[] { null, @"a*[bcd]", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"a*[bcd]+", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"a*[bcd]+?", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"a*(?>[bcd]+)", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"a*[bcd]{1,3}", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"a*([bcd]ab|[bef]cd){1,3}", "aaababecdcac", RegexOptions.ExplicitCapture, new string[] { "aaababecd" } }; - yield return new object[] { null, @"a*([bcd]|[aef]){1,3}", "befb", RegexOptions.ExplicitCapture, new string[] { "bef" } }; // can't upgrade - yield return new object[] { null, @"a*$", "aaa", RegexOptions.None, new string[] { "aaa" } }; - yield return new object[] { null, @"a*$", "aaa", RegexOptions.Multiline, new string[] { "aaa" } }; - yield return new object[] { null, @"a*\b", "aaa bbb", RegexOptions.None, new string[] { "aaa" } }; - yield return new object[] { null, @"a*\b", "aaa bbb", RegexOptions.ECMAScript, new string[] { "aaa" } }; - yield return new object[] { null, @"@*\B", "@@@", RegexOptions.None, new string[] { "@@@" } }; - yield return new object[] { null, @"@*\B", "@@@", RegexOptions.ECMAScript, new string[] { "@@@" } }; - yield return new object[] { null, @"(?:abcd*|efgh)i", "efghi", RegexOptions.None, new string[] { "efghi" } }; - yield return new object[] { null, @"(?:abcd|efgh*)i", "efgi", RegexOptions.None, new string[] { "efgi" } }; - yield return new object[] { null, @"(?:abcd|efghj{2,}|j[klm]o+)i", "efghjjjjji", RegexOptions.None, new string[] { "efghjjjjji" } }; - yield return new object[] { null, @"(?:abcd|efghi{2,}|j[klm]o+)i", "efghiii", RegexOptions.None, new string[] { "efghiii" } }; - yield return new object[] { null, @"(?:abcd|efghi{2,}|j[klm]o+)i", "efghiiiiiiii", RegexOptions.None, new string[] { "efghiiiiiiii" } }; - yield return new object[] { null, @"a?ba?ba?ba?b", "abbabab", RegexOptions.None, new string[] { "abbabab" } }; - yield return new object[] { null, @"a?ba?ba?ba?b", "abBAbab", RegexOptions.IgnoreCase, new string[] { "abBAbab" } }; - // Implicitly upgrading (or not) notoneloop to be atomic - yield return new object[] { null, @"[^b]*b", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"[^b]*b+", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"[^b]*b+?", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"[^b]*(?>b+)", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"[^b]*bac", "aaabac", RegexOptions.None, new string[] { "aaabac" } }; - yield return new object[] { null, @"[^b]*", "aaa", RegexOptions.None, new string[] { "aaa" } }; - yield return new object[] { null, @"(?:abc[^b]*|efgh)i", "efghi", RegexOptions.None, new string[] { "efghi" } }; // can't upgrade - yield return new object[] { null, @"(?:abcd|efg[^b]*)b", "efgb", RegexOptions.None, new string[] { "efgb" } }; - yield return new object[] { null, @"(?:abcd|efg[^b]*)i", "efgi", RegexOptions.None, new string[] { "efgi" } }; // can't upgrade - yield return new object[] { null, @"[^a]?a[^a]?a[^a]?a[^a]?a", "baababa", RegexOptions.None, new string[] { "baababa" } }; - yield return new object[] { null, @"[^a]?a[^a]?a[^a]?a[^a]?a", "BAababa", RegexOptions.IgnoreCase, new string[] { "BAababa" } }; - // Implicitly upgrading (or not) setloop to be atomic - yield return new object[] { null, @"[ac]*", "aaa", RegexOptions.None, new string[] { "aaa" } }; - yield return new object[] { null, @"[ac]*b", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"[ac]*b+", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"[ac]*b+?", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"[ac]*(?>b+)", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"[ac]*[^a]", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"[ac]*[^a]+", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"[ac]*[^a]+?", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"[ac]*(?>[^a]+)", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"[ac]*bcd", "aaabcd", RegexOptions.None, new string[] { "aaabcd" } }; - yield return new object[] { null, @"[ac]*[bd]", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"[ac]*[bd]+", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"[ac]*[bd]+?", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"[ac]*(?>[bd]+)", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"[ac]*[bd]{1,3}", "aaab", RegexOptions.None, new string[] { "aaab" } }; - yield return new object[] { null, @"[ac]*$", "aaa", RegexOptions.None, new string[] { "aaa" } }; - yield return new object[] { null, @"[ac]*$", "aaa", RegexOptions.Multiline, new string[] { "aaa" } }; - yield return new object[] { null, @"[ac]*\b", "aaa bbb", RegexOptions.None, new string[] { "aaa" } }; - yield return new object[] { null, @"[ac]*\b", "aaa bbb", RegexOptions.ECMAScript, new string[] { "aaa" } }; - yield return new object[] { null, @"[@']*\B", "@@@", RegexOptions.None, new string[] { "@@@" } }; - yield return new object[] { null, @"[@']*\B", "@@@", RegexOptions.ECMAScript, new string[] { "@@@" } }; - yield return new object[] { null, @".*.", "@@@", RegexOptions.Singleline, new string[] { "@@@" } }; - yield return new object[] { null, @"(?:abcd|efg[hij]*)h", "efgh", RegexOptions.None, new string[] { "efgh" } }; // can't upgrade - yield return new object[] { null, @"(?:abcd|efg[hij]*)ih", "efgjih", RegexOptions.None, new string[] { "efgjih" } }; // can't upgrade - yield return new object[] { null, @"(?:abcd|efg[hij]*)k", "efgjk", RegexOptions.None, new string[] { "efgjk" } }; - yield return new object[] { null, @"[ace]?b[ace]?b[ace]?b[ace]?b", "cbbabeb", RegexOptions.None, new string[] { "cbbabeb" } }; - yield return new object[] { null, @"[ace]?b[ace]?b[ace]?b[ace]?b", "cBbAbEb", RegexOptions.IgnoreCase, new string[] { "cBbAbEb" } }; - yield return new object[] { null, @"a[^wz]*w", "abcdcdcdwz", RegexOptions.None, new string[] { "abcdcdcdw" } }; - yield return new object[] { null, @"a[^wyz]*w", "abcdcdcdwz", RegexOptions.None, new string[] { "abcdcdcdw" } }; - yield return new object[] { null, @"a[^wyz]*W", "abcdcdcdWz", RegexOptions.IgnoreCase, new string[] { "abcdcdcdW" } }; - // Implicitly upgrading (or not) concat loops to be atomic - yield return new object[] { null, @"(?:[ab]c[de]f)*", "", RegexOptions.None, new string[] { "" } }; - yield return new object[] { null, @"(?:[ab]c[de]f)*", "acdf", RegexOptions.None, new string[] { "acdf" } }; - yield return new object[] { null, @"(?:[ab]c[de]f)*", "acdfbcef", RegexOptions.None, new string[] { "acdfbcef" } }; - yield return new object[] { null, @"(?:[ab]c[de]f)*", "cdfbcef", RegexOptions.None, new string[] { "" } }; - yield return new object[] { null, @"(?:[ab]c[de]f)+", "cdfbcef", RegexOptions.None, new string[] { "bcef" } }; - yield return new object[] { null, @"(?:[ab]c[de]f)*", "bcefbcdfacfe", RegexOptions.None, new string[] { "bcefbcdf" } }; - // Implicitly upgrading (or not) nested loops to be atomic - yield return new object[] { null, @"(?:a){3}", "aaaaaaaaa", RegexOptions.None, new string[] { "aaa" } }; - yield return new object[] { null, @"(?:a){3}?", "aaaaaaaaa", RegexOptions.None, new string[] { "aaa" } }; - yield return new object[] { null, @"(?:a{2}){3}", "aaaaaaaaa", RegexOptions.None, new string[] { "aaaaaa" } }; - yield return new object[] { null, @"(?:a{2}?){3}?", "aaaaaaaaa", RegexOptions.None, new string[] { "aaaaaa" } }; - yield return new object[] { null, @"(?:(?:[ab]c[de]f){3}){2}", "acdfbcdfacefbcefbcefbcdfacdef", RegexOptions.None, new string[] { "acdfbcdfacefbcefbcefbcdf" } }; - yield return new object[] { null, @"(?:(?:[ab]c[de]f){3}hello){2}", "aaaaaacdfbcdfacefhellobcefbcefbcdfhellooooo", RegexOptions.None, new string[] { "acdfbcdfacefhellobcefbcefbcdfhello" } }; - yield return new object[] { null, @"CN=(.*[^,]+).*", "CN=localhost", RegexOptions.Singleline, new string[] { "CN=localhost", "localhost" } }; - // Nested atomic - yield return new object[] { null, @"(?>abc[def]gh(i*))", "123abceghiii456", RegexOptions.None, new string[] { "abceghiii", "iii" } }; - yield return new object[] { null, @"(?>(?:abc)*)", "abcabcabc", RegexOptions.None, new string[] { "abcabcabc" } }; - - // Anchoring loops beginning with .* / .+ - yield return new object[] { null, @".*", "", RegexOptions.None, new string[] { "" } }; - yield return new object[] { null, @".*", "\n\n\n\n", RegexOptions.None, new string[] { "" } }; - yield return new object[] { null, @".*", "\n\n\n\n", RegexOptions.Singleline, new string[] { "\n\n\n\n" } }; - yield return new object[] { null, @".*[1a]", "\n\n\n\n1", RegexOptions.None, new string[] { "1" } }; - yield return new object[] { null, @"(?s).*(?-s)[1a]", "1\n\n\n\n", RegexOptions.None, new string[] { "1" } }; - yield return new object[] { null, @"(?s).*(?-s)[1a]", "\n\n\n\n1", RegexOptions.None, new string[] { "\n\n\n\n1" } }; - yield return new object[] { null, @".*|.*|.*", "", RegexOptions.None, new string[] { "" } }; - yield return new object[] { null, @".*123|abc", "abc\n123", RegexOptions.None, new string[] { "abc" } }; - yield return new object[] { null, @".*123|abc", "abc\n123", RegexOptions.Singleline, new string[] { "abc\n123" }, "abc" }; // <-- Nonbacktracking match same as for "abc|.*123" - yield return new object[] { null, @"abc|.*123", "abc\n123", RegexOptions.Singleline, new string[] { "abc" } }; - yield return new object[] { null, @".*", "\n", RegexOptions.None, new string[] { "" } }; - yield return new object[] { null, @".*\n", "\n", RegexOptions.None, new string[] { "\n" } }; - yield return new object[] { null, @".*", "\n", RegexOptions.Singleline, new string[] { "\n" } }; - yield return new object[] { null, @".*\n", "\n", RegexOptions.Singleline, new string[] { "\n" } }; - yield return new object[] { null, @".*", "abc", RegexOptions.None, new string[] { "abc" } }; - yield return new object[] { null, @".*abc", "abc", RegexOptions.None, new string[] { "abc" } }; - yield return new object[] { null, @".*abc|ghi", "ghi", RegexOptions.None, new string[] { "ghi" } }; - yield return new object[] { null, @".*abc|.*ghi", "abcghi", RegexOptions.None, new string[] { "abc" }, "abcghi" }; // <-- Nonbacktracking match same as for ".*ghi|.*abc" - yield return new object[] { null, @".*ghi|.*abc", "abcghi", RegexOptions.None, new string[] { "abcghi" } }; - yield return new object[] { null, @".*abc|.*ghi", "bcghi", RegexOptions.None, new string[] { "bcghi" } }; - yield return new object[] { null, @".*abc|.+c", " \n \n bc", RegexOptions.None, new string[] { " bc" } }; - yield return new object[] { null, @".*abc", "12345 abc", RegexOptions.None, new string[] { "12345 abc" } }; - yield return new object[] { null, @".*abc", "12345\n abc", RegexOptions.None, new string[] { " abc" } }; - yield return new object[] { null, @".*abc", "12345\n abc", RegexOptions.Singleline, new string[] { "12345\n abc" } }; - yield return new object[] { null, @"(.*)abc\1", "\n12345abc12345", RegexOptions.Singleline, new string[] { "12345abc12345", "12345" } }; - yield return new object[] { null, @".*\nabc", "\n123\nabc", RegexOptions.None, new string[] { "123\nabc" } }; - yield return new object[] { null, @".*\nabc", "\n123\nabc", RegexOptions.Singleline, new string[] { "\n123\nabc" } }; - yield return new object[] { null, @".*abc", "abc abc abc \nabc", RegexOptions.None, new string[] { "abc abc abc" } }; - yield return new object[] { null, @".*abc", "abc abc abc \nabc", RegexOptions.Singleline, new string[] { "abc abc abc \nabc" } }; - yield return new object[] { null, @".*?abc", "abc abc abc \nabc", RegexOptions.None, new string[] { "abc" } }; - yield return new object[] { null, @"[^\n]*abc", "123abc\n456abc\n789abc", RegexOptions.None, new string[] { "123abc" } }; - yield return new object[] { null, @"[^\n]*abc", "123abc\n456abc\n789abc", RegexOptions.Singleline, new string[] { "123abc" } }; - yield return new object[] { null, @"[^\n]*abc", "123ab\n456abc\n789abc", RegexOptions.None, new string[] { "456abc" } }; - yield return new object[] { null, @"[^\n]*abc", "123ab\n456abc\n789abc", RegexOptions.Singleline, new string[] { "456abc" } }; - yield return new object[] { null, @".+", "a", RegexOptions.None, new string[] { "a" } }; - yield return new object[] { null, @".+", "\nabc", RegexOptions.None, new string[] { "abc" } }; - yield return new object[] { null, @".+", "\n", RegexOptions.Singleline, new string[] { "\n" } }; - yield return new object[] { null, @".+", "\nabc", RegexOptions.Singleline, new string[] { "\nabc" } }; - yield return new object[] { null, @".+abc", "aaaabc", RegexOptions.None, new string[] { "aaaabc" } }; - yield return new object[] { null, @".+abc", "12345 abc", RegexOptions.None, new string[] { "12345 abc" } }; - yield return new object[] { null, @".+abc", "12345\n abc", RegexOptions.None, new string[] { " abc" } }; - yield return new object[] { null, @".+abc", "12345\n abc", RegexOptions.Singleline, new string[] { "12345\n abc" } }; - yield return new object[] { null, @"(.+)abc\1", "\n12345abc12345", RegexOptions.Singleline, new string[] { "12345abc12345", "12345" } }; - - // Unanchored .* - yield return new object[] { null, @"\A\s*(?\w+)(\s*\((?.*)\))?\s*\Z", "Match(Name)", RegexOptions.None, new string[] { "Match(Name)", "(Name)", "Match", "Name" } }; - yield return new object[] { null, @"\A\s*(?\w+)(\s*\((?.*)\))?\s*\Z", "Match(Na\nme)", RegexOptions.Singleline, new string[] { "Match(Na\nme)", "(Na\nme)", "Match", "Na\nme" } }; - foreach (RegexOptions options in new[] { RegexOptions.None, RegexOptions.Singleline }) - { - yield return new object[] { null, @"abcd.*", @"abcabcd", options, new string[] { "abcd" } }; - yield return new object[] { null, @"abcd.*", @"abcabcde", options, new string[] { "abcde" } }; - yield return new object[] { null, @"abcd.*", @"abcabcdefg", options, new string[] { "abcdefg" } }; - yield return new object[] { null, @"abcd(.*)", @"ababcd", options, new string[] { "abcd", "" } }; - yield return new object[] { null, @"abcd(.*)", @"aabcde", options, new string[] { "abcde", "e" } }; - yield return new object[] { null, @"abcd(.*)", @"abcabcdefg", options, new string[] { "abcdefg", "efg" } }; - yield return new object[] { null, @"abcd(.*)e", @"abcabcdefg", options, new string[] { "abcde", "" } }; - yield return new object[] { null, @"abcd(.*)f", @"abcabcdefg", options, new string[] { "abcdef", "e" } }; - } + yield return new object[] { engine, null, @"\G<%#(?.*?)?%>", @"<%# DataBinder.Eval(this, ""MyNumber"") %>", RegexOptions.Singleline, new string[] { @"<%# DataBinder.Eval(this, ""MyNumber"") %>", @" DataBinder.Eval(this, ""MyNumber"") " } }; + + // Nested Quantifiers + yield return new object[] { engine, null, @"^[abcd]{0,0x10}*$", "a{0,0x10}}}", RegexOptions.None, new string[] { "a{0,0x10}}}" } }; + + // Lazy operator Backtracking + yield return new object[] { engine, null, @"http://([a-zA-z0-9\-]*\.?)*?(:[0-9]*)??/", "http://www.msn.com/", RegexOptions.IgnoreCase, new string[] { "http://www.msn.com/", "com", string.Empty } }; + yield return new object[] { engine, null, @"http://([a-zA-Z0-9\-]*\.?)*?/", @"http://www.google.com/", RegexOptions.IgnoreCase, new string[] { "http://www.google.com/", "com" } }; + + yield return new object[] { engine, null, @"([a-z]*?)([\w])", "cat", RegexOptions.IgnoreCase, new string[] { "c", string.Empty, "c" } }; + yield return new object[] { engine, null, @"^([a-z]*?)([\w])$", "cat", RegexOptions.IgnoreCase, new string[] { "cat", "ca", "t" } }; + + // Backtracking + yield return new object[] { engine, null, @"([a-z]*)([\w])", "cat", RegexOptions.IgnoreCase, new string[] { "cat", "ca", "t" } }; + yield return new object[] { engine, null, @"^([a-z]*)([\w])$", "cat", RegexOptions.IgnoreCase, new string[] { "cat", "ca", "t" } }; + + // Backtracking with multiple (.*) groups -- important ASP.NET scenario + yield return new object[] { engine, null, @"(.*)/(.*).aspx", "/.aspx", RegexOptions.None, new string[] { "/.aspx", string.Empty, string.Empty } }; + yield return new object[] { engine, null, @"(.*)/(.*).aspx", "/homepage.aspx", RegexOptions.None, new string[] { "/homepage.aspx", string.Empty, "homepage" } }; + yield return new object[] { engine, null, @"(.*)/(.*).aspx", "pages/.aspx", RegexOptions.None, new string[] { "pages/.aspx", "pages", string.Empty } }; + yield return new object[] { engine, null, @"(.*)/(.*).aspx", "pages/homepage.aspx", RegexOptions.None, new string[] { "pages/homepage.aspx", "pages", "homepage" } }; + yield return new object[] { engine, null, @"(.*)/(.*).aspx", "/pages/homepage.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx", "/pages", "homepage" } }; + yield return new object[] { engine, null, @"(.*)/(.*).aspx", "/pages/homepage/index.aspx", RegexOptions.None, new string[] { "/pages/homepage/index.aspx", "/pages/homepage", "index" } }; + yield return new object[] { engine, null, @"(.*)/(.*).aspx", "/pages/homepage.aspx/index.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx/index.aspx", "/pages/homepage.aspx", "index" } }; + yield return new object[] { engine, null, @"(.*)/(.*)/(.*).aspx", "/pages/homepage.aspx/index.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx/index.aspx", "/pages", "homepage.aspx", "index" } }; + + // Backtracking with multiple (.+) groups + yield return new object[] { engine, null, @"(.+)/(.+).aspx", "pages/homepage.aspx", RegexOptions.None, new string[] { "pages/homepage.aspx", "pages", "homepage" } }; + yield return new object[] { engine, null, @"(.+)/(.+).aspx", "/pages/homepage.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx", "/pages", "homepage" } }; + yield return new object[] { engine, null, @"(.+)/(.+).aspx", "/pages/homepage/index.aspx", RegexOptions.None, new string[] { "/pages/homepage/index.aspx", "/pages/homepage", "index" } }; + yield return new object[] { engine, null, @"(.+)/(.+).aspx", "/pages/homepage.aspx/index.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx/index.aspx", "/pages/homepage.aspx", "index" } }; + yield return new object[] { engine, null, @"(.+)/(.+)/(.+).aspx", "/pages/homepage.aspx/index.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx/index.aspx", "/pages", "homepage.aspx", "index" } }; + + // Backtracking with (.+) group followed by (.*) + yield return new object[] { engine, null, @"(.+)/(.*).aspx", "pages/.aspx", RegexOptions.None, new string[] { "pages/.aspx", "pages", string.Empty } }; + yield return new object[] { engine, null, @"(.+)/(.*).aspx", "pages/homepage.aspx", RegexOptions.None, new string[] { "pages/homepage.aspx", "pages", "homepage" } }; + yield return new object[] { engine, null, @"(.+)/(.*).aspx", "/pages/homepage.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx", "/pages", "homepage" } }; + yield return new object[] { engine, null, @"(.+)/(.*).aspx", "/pages/homepage/index.aspx", RegexOptions.None, new string[] { "/pages/homepage/index.aspx", "/pages/homepage", "index" } }; + yield return new object[] { engine, null, @"(.+)/(.*).aspx", "/pages/homepage.aspx/index.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx/index.aspx", "/pages/homepage.aspx", "index" } }; + yield return new object[] { engine, null, @"(.+)/(.*)/(.*).aspx", "/pages/homepage.aspx/index.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx/index.aspx", "/pages", "homepage.aspx", "index" } }; + + // Backtracking with (.*) group followed by (.+) + yield return new object[] { engine, null, @"(.*)/(.+).aspx", "/homepage.aspx", RegexOptions.None, new string[] { "/homepage.aspx", string.Empty, "homepage" } }; + yield return new object[] { engine, null, @"(.*)/(.+).aspx", "pages/homepage.aspx", RegexOptions.None, new string[] { "pages/homepage.aspx", "pages", "homepage" } }; + yield return new object[] { engine, null, @"(.*)/(.+).aspx", "/pages/homepage.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx", "/pages", "homepage" } }; + yield return new object[] { engine, null, @"(.*)/(.+).aspx", "/pages/homepage/index.aspx", RegexOptions.None, new string[] { "/pages/homepage/index.aspx", "/pages/homepage", "index" } }; + yield return new object[] { engine, null, @"(.*)/(.+).aspx", "/pages/homepage.aspx/index.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx/index.aspx", "/pages/homepage.aspx", "index" } }; + yield return new object[] { engine, null, @"(.*)/(.+)/(.+).aspx", "/pages/homepage.aspx/index.aspx", RegexOptions.None, new string[] { "/pages/homepage.aspx/index.aspx", "/pages", "homepage.aspx", "index" } }; + + // Captures inside varying constructs with backtracking needing to uncapture + yield return new object[] { engine, null, @"a(bc)d|abc(e)", "abce", RegexOptions.None, new string[] { "abce", "", "e" } }; // alternation + yield return new object[] { engine, null, @"((ab){2}cd)*", "ababcdababcdababc", RegexOptions.None, new string[] { "ababcdababcd", "ababcd", "ab" } }; // loop + yield return new object[] { engine, null, @"(ab(?=(\w)\w))*a", "aba", RegexOptions.None, new string[] { "a", "", "" } }; // positive lookahead in a loop + yield return new object[] { engine, null, @"(ab(?=(\w)\w))*a", "ababa", RegexOptions.None, new string[] { "aba", "ab", "a" } }; // positive lookahead in a loop + yield return new object[] { engine, null, @"(ab(?=(\w)\w))*a", "abababa", RegexOptions.None, new string[] { "ababa", "ab", "a" } }; // positive lookahead in a loop + yield return new object[] { engine, null, @"\w\w(?!(\d)\d)", "aa..", RegexOptions.None, new string[] { "aa", "" } }; // negative lookahead + yield return new object[] { engine, null, @"\w\w(?!(\d)\d)", "aa.3", RegexOptions.None, new string[] { "aa", "" } }; // negative lookahead + + // Quantifiers + yield return new object[] { engine, null, @"a*", "", RegexOptions.None, new string[] { "" } }; + yield return new object[] { engine, null, @"a*", "a", RegexOptions.None, new string[] { "a" } }; + yield return new object[] { engine, null, @"a*", "aa", RegexOptions.None, new string[] { "aa" } }; + yield return new object[] { engine, null, @"a*", "aaa", RegexOptions.None, new string[] { "aaa" } }; + yield return new object[] { engine, null, @"a*?", "", RegexOptions.None, new string[] { "" } }; + yield return new object[] { engine, null, @"a*?", "a", RegexOptions.None, new string[] { "" } }; + yield return new object[] { engine, null, @"a*?", "aa", RegexOptions.None, new string[] { "" } }; + yield return new object[] { engine, null, @"a+?", "aa", RegexOptions.None, new string[] { "a" } }; + yield return new object[] { engine, null, @"a{1,", "a{1,", RegexOptions.None, new string[] { "a{1," } }; + yield return new object[] { engine, null, @"a{1,3}", "aaaaa", RegexOptions.None, new string[] { "aaa" } }; + yield return new object[] { engine, null, @"a{1,3}?", "aaaaa", RegexOptions.None, new string[] { "a" } }; + yield return new object[] { engine, null, @"a{2,2}", "aaaaa", RegexOptions.None, new string[] { "aa" } }; + yield return new object[] { engine, null, @"a{2,2}?", "aaaaa", RegexOptions.None, new string[] { "aa" } }; + yield return new object[] { engine, null, @".{1,3}", "bb\nba", RegexOptions.None, new string[] { "bb" } }; + yield return new object[] { engine, null, @".{1,3}?", "bb\nba", RegexOptions.None, new string[] { "b" } }; + yield return new object[] { engine, null, @".{2,2}", "bbb\nba", RegexOptions.None, new string[] { "bb" } }; + yield return new object[] { engine, null, @".{2,2}?", "bbb\nba", RegexOptions.None, new string[] { "bb" } }; + yield return new object[] { engine, null, @"[abc]{1,3}", "ccaba", RegexOptions.None, new string[] { "cca" } }; + yield return new object[] { engine, null, @"[abc]{1,3}?", "ccaba", RegexOptions.None, new string[] { "c" } }; + yield return new object[] { engine, null, @"[abc]{2,2}", "ccaba", RegexOptions.None, new string[] { "cc" } }; + yield return new object[] { engine, null, @"[abc]{2,2}?", "ccaba", RegexOptions.None, new string[] { "cc" } }; + yield return new object[] { engine, null, @"(?:[abc]def){1,3}xyz", "cdefxyz", RegexOptions.None, new string[] { "cdefxyz" } }; + yield return new object[] { engine, null, @"(?:[abc]def){1,3}xyz", "adefbdefcdefxyz", RegexOptions.None, new string[] { "adefbdefcdefxyz" } }; + yield return new object[] { engine, null, @"(?:[abc]def){1,3}?xyz", "cdefxyz", RegexOptions.None, new string[] { "cdefxyz" } }; + yield return new object[] { engine, null, @"(?:[abc]def){1,3}?xyz", "adefbdefcdefxyz", RegexOptions.None, new string[] { "adefbdefcdefxyz" } }; + yield return new object[] { engine, null, @"(?:[abc]def){2,2}xyz", "adefbdefcdefxyz", RegexOptions.None, new string[] { "bdefcdefxyz" } }; + yield return new object[] { engine, null, @"(?:[abc]def){2,2}?xyz", "adefbdefcdefxyz", RegexOptions.None, new string[] { "bdefcdefxyz" } }; + foreach (string prefix in new[] { "", "xyz" }) + { + yield return new object[] { engine, null, prefix + @"(?:[abc]def){1,3}", prefix + "cdef", RegexOptions.None, new string[] { prefix + "cdef" } }; + yield return new object[] { engine, null, prefix + @"(?:[abc]def){1,3}", prefix + "cdefadefbdef", RegexOptions.None, new string[] { prefix + "cdefadefbdef" } }; + yield return new object[] { engine, null, prefix + @"(?:[abc]def){1,3}", prefix + "cdefadefbdefadef", RegexOptions.None, new string[] { prefix + "cdefadefbdef" } }; + yield return new object[] { engine, null, prefix + @"(?:[abc]def){1,3}?", prefix + "cdef", RegexOptions.None, new string[] { prefix + "cdef" } }; + yield return new object[] { engine, null, prefix + @"(?:[abc]def){1,3}?", prefix + "cdefadefbdef", RegexOptions.None, new string[] { prefix + "cdef" } }; + yield return new object[] { engine, null, prefix + @"(?:[abc]def){2,2}", prefix + "cdefadefbdefadef", RegexOptions.None, new string[] { prefix + "cdefadef" } }; + yield return new object[] { engine, null, prefix + @"(?:[abc]def){2,2}?", prefix + "cdefadefbdefadef", RegexOptions.None, new string[] { prefix + "cdefadef" } }; + } + yield return new object[] { engine, null, @"(cat){", "cat{", RegexOptions.None, new string[] { "cat{", "cat" } }; + yield return new object[] { engine, null, @"(cat){}", "cat{}", RegexOptions.None, new string[] { "cat{}", "cat" } }; + yield return new object[] { engine, null, @"(cat){,", "cat{,", RegexOptions.None, new string[] { "cat{,", "cat" } }; + yield return new object[] { engine, null, @"(cat){,}", "cat{,}", RegexOptions.None, new string[] { "cat{,}", "cat" } }; + yield return new object[] { engine, null, @"(cat){cat}", "cat{cat}", RegexOptions.None, new string[] { "cat{cat}", "cat" } }; + yield return new object[] { engine, null, @"(cat){cat,5}", "cat{cat,5}", RegexOptions.None, new string[] { "cat{cat,5}", "cat" } }; + yield return new object[] { engine, null, @"(cat){5,dog}", "cat{5,dog}", RegexOptions.None, new string[] { "cat{5,dog}", "cat" } }; + yield return new object[] { engine, null, @"(cat){cat,dog}", "cat{cat,dog}", RegexOptions.None, new string[] { "cat{cat,dog}", "cat" } }; + yield return new object[] { engine, null, @"(cat){,}?", "cat{,}?", RegexOptions.None, new string[] { "cat{,}", "cat" } }; + yield return new object[] { engine, null, @"(cat){cat}?", "cat{cat}?", RegexOptions.None, new string[] { "cat{cat}", "cat" } }; + yield return new object[] { engine, null, @"(cat){cat,5}?", "cat{cat,5}?", RegexOptions.None, new string[] { "cat{cat,5}", "cat" } }; + yield return new object[] { engine, null, @"(cat){5,dog}?", "cat{5,dog}?", RegexOptions.None, new string[] { "cat{5,dog}", "cat" } }; + yield return new object[] { engine, null, @"(cat){cat,dog}?", "cat{cat,dog}?", RegexOptions.None, new string[] { "cat{cat,dog}", "cat" } }; + + // Atomic subexpressions + // Implicitly upgrading (or not) oneloop to be atomic + yield return new object[] { engine, null, @"a*b", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"a*b+", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"a*b+?", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"a*(?>b+)", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"a*[^a]", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"a*[^a]+", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"a*[^a]+?", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"a*(?>[^a]+)", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"a*bcd", "aaabcd", RegexOptions.None, new string[] { "aaabcd" } }; + yield return new object[] { engine, null, @"a*[bcd]", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"a*[bcd]+", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"a*[bcd]+?", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"a*(?>[bcd]+)", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"a*[bcd]{1,3}", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"a*([bcd]ab|[bef]cd){1,3}", "aaababecdcac", RegexOptions.ExplicitCapture, new string[] { "aaababecd" } }; + yield return new object[] { engine, null, @"a*([bcd]|[aef]){1,3}", "befb", RegexOptions.ExplicitCapture, new string[] { "bef" } }; // can't upgrade + yield return new object[] { engine, null, @"a*$", "aaa", RegexOptions.None, new string[] { "aaa" } }; + yield return new object[] { engine, null, @"a*$", "aaa", RegexOptions.Multiline, new string[] { "aaa" } }; + yield return new object[] { engine, null, @"a*\b", "aaa bbb", RegexOptions.None, new string[] { "aaa" } }; + yield return new object[] { engine, null, @"a*\b", "aaa bbb", RegexOptions.ECMAScript, new string[] { "aaa" } }; + yield return new object[] { engine, null, @"@*\B", "@@@", RegexOptions.None, new string[] { "@@@" } }; + yield return new object[] { engine, null, @"@*\B", "@@@", RegexOptions.ECMAScript, new string[] { "@@@" } }; + yield return new object[] { engine, null, @"(?:abcd*|efgh)i", "efghi", RegexOptions.None, new string[] { "efghi" } }; + yield return new object[] { engine, null, @"(?:abcd|efgh*)i", "efgi", RegexOptions.None, new string[] { "efgi" } }; + yield return new object[] { engine, null, @"(?:abcd|efghj{2,}|j[klm]o+)i", "efghjjjjji", RegexOptions.None, new string[] { "efghjjjjji" } }; + yield return new object[] { engine, null, @"(?:abcd|efghi{2,}|j[klm]o+)i", "efghiii", RegexOptions.None, new string[] { "efghiii" } }; + yield return new object[] { engine, null, @"(?:abcd|efghi{2,}|j[klm]o+)i", "efghiiiiiiii", RegexOptions.None, new string[] { "efghiiiiiiii" } }; + yield return new object[] { engine, null, @"a?ba?ba?ba?b", "abbabab", RegexOptions.None, new string[] { "abbabab" } }; + yield return new object[] { engine, null, @"a?ba?ba?ba?b", "abBAbab", RegexOptions.IgnoreCase, new string[] { "abBAbab" } }; + // Implicitly upgrading (or not) notoneloop to be atomic + yield return new object[] { engine, null, @"[^b]*b", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"[^b]*b+", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"[^b]*b+?", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"[^b]*(?>b+)", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"[^b]*bac", "aaabac", RegexOptions.None, new string[] { "aaabac" } }; + yield return new object[] { engine, null, @"[^b]*", "aaa", RegexOptions.None, new string[] { "aaa" } }; + yield return new object[] { engine, null, @"(?:abc[^b]*|efgh)i", "efghi", RegexOptions.None, new string[] { "efghi" } }; // can't upgrade + yield return new object[] { engine, null, @"(?:abcd|efg[^b]*)b", "efgb", RegexOptions.None, new string[] { "efgb" } }; + yield return new object[] { engine, null, @"(?:abcd|efg[^b]*)i", "efgi", RegexOptions.None, new string[] { "efgi" } }; // can't upgrade + yield return new object[] { engine, null, @"[^a]?a[^a]?a[^a]?a[^a]?a", "baababa", RegexOptions.None, new string[] { "baababa" } }; + yield return new object[] { engine, null, @"[^a]?a[^a]?a[^a]?a[^a]?a", "BAababa", RegexOptions.IgnoreCase, new string[] { "BAababa" } }; + // Implicitly upgrading (or not) setloop to be atomic + yield return new object[] { engine, null, @"[ac]*", "aaa", RegexOptions.None, new string[] { "aaa" } }; + yield return new object[] { engine, null, @"[ac]*b", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"[ac]*b+", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"[ac]*b+?", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"[ac]*(?>b+)", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"[ac]*[^a]", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"[ac]*[^a]+", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"[ac]*[^a]+?", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"[ac]*(?>[^a]+)", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"[ac]*bcd", "aaabcd", RegexOptions.None, new string[] { "aaabcd" } }; + yield return new object[] { engine, null, @"[ac]*[bd]", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"[ac]*[bd]+", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"[ac]*[bd]+?", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"[ac]*(?>[bd]+)", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"[ac]*[bd]{1,3}", "aaab", RegexOptions.None, new string[] { "aaab" } }; + yield return new object[] { engine, null, @"[ac]*$", "aaa", RegexOptions.None, new string[] { "aaa" } }; + yield return new object[] { engine, null, @"[ac]*$", "aaa", RegexOptions.Multiline, new string[] { "aaa" } }; + yield return new object[] { engine, null, @"[ac]*\b", "aaa bbb", RegexOptions.None, new string[] { "aaa" } }; + yield return new object[] { engine, null, @"[ac]*\b", "aaa bbb", RegexOptions.ECMAScript, new string[] { "aaa" } }; + yield return new object[] { engine, null, @"[@']*\B", "@@@", RegexOptions.None, new string[] { "@@@" } }; + yield return new object[] { engine, null, @"[@']*\B", "@@@", RegexOptions.ECMAScript, new string[] { "@@@" } }; + yield return new object[] { engine, null, @".*.", "@@@", RegexOptions.Singleline, new string[] { "@@@" } }; + yield return new object[] { engine, null, @"(?:abcd|efg[hij]*)h", "efgh", RegexOptions.None, new string[] { "efgh" } }; // can't upgrade + yield return new object[] { engine, null, @"(?:abcd|efg[hij]*)ih", "efgjih", RegexOptions.None, new string[] { "efgjih" } }; // can't upgrade + yield return new object[] { engine, null, @"(?:abcd|efg[hij]*)k", "efgjk", RegexOptions.None, new string[] { "efgjk" } }; + yield return new object[] { engine, null, @"[ace]?b[ace]?b[ace]?b[ace]?b", "cbbabeb", RegexOptions.None, new string[] { "cbbabeb" } }; + yield return new object[] { engine, null, @"[ace]?b[ace]?b[ace]?b[ace]?b", "cBbAbEb", RegexOptions.IgnoreCase, new string[] { "cBbAbEb" } }; + yield return new object[] { engine, null, @"a[^wz]*w", "abcdcdcdwz", RegexOptions.None, new string[] { "abcdcdcdw" } }; + yield return new object[] { engine, null, @"a[^wyz]*w", "abcdcdcdwz", RegexOptions.None, new string[] { "abcdcdcdw" } }; + yield return new object[] { engine, null, @"a[^wyz]*W", "abcdcdcdWz", RegexOptions.IgnoreCase, new string[] { "abcdcdcdW" } }; + // Implicitly upgrading (or not) concat loops to be atomic + yield return new object[] { engine, null, @"(?:[ab]c[de]f)*", "", RegexOptions.None, new string[] { "" } }; + yield return new object[] { engine, null, @"(?:[ab]c[de]f)*", "acdf", RegexOptions.None, new string[] { "acdf" } }; + yield return new object[] { engine, null, @"(?:[ab]c[de]f)*", "acdfbcef", RegexOptions.None, new string[] { "acdfbcef" } }; + yield return new object[] { engine, null, @"(?:[ab]c[de]f)*", "cdfbcef", RegexOptions.None, new string[] { "" } }; + yield return new object[] { engine, null, @"(?:[ab]c[de]f)+", "cdfbcef", RegexOptions.None, new string[] { "bcef" } }; + yield return new object[] { engine, null, @"(?:[ab]c[de]f)*", "bcefbcdfacfe", RegexOptions.None, new string[] { "bcefbcdf" } }; + // Implicitly upgrading (or not) nested loops to be atomic + yield return new object[] { engine, null, @"(?:a){3}", "aaaaaaaaa", RegexOptions.None, new string[] { "aaa" } }; + yield return new object[] { engine, null, @"(?:a){3}?", "aaaaaaaaa", RegexOptions.None, new string[] { "aaa" } }; + yield return new object[] { engine, null, @"(?:a{2}){3}", "aaaaaaaaa", RegexOptions.None, new string[] { "aaaaaa" } }; + yield return new object[] { engine, null, @"(?:a{2}?){3}?", "aaaaaaaaa", RegexOptions.None, new string[] { "aaaaaa" } }; + yield return new object[] { engine, null, @"(?:(?:[ab]c[de]f){3}){2}", "acdfbcdfacefbcefbcefbcdfacdef", RegexOptions.None, new string[] { "acdfbcdfacefbcefbcefbcdf" } }; + yield return new object[] { engine, null, @"(?:(?:[ab]c[de]f){3}hello){2}", "aaaaaacdfbcdfacefhellobcefbcefbcdfhellooooo", RegexOptions.None, new string[] { "acdfbcdfacefhellobcefbcefbcdfhello" } }; + yield return new object[] { engine, null, @"CN=(.*[^,]+).*", "CN=localhost", RegexOptions.Singleline, new string[] { "CN=localhost", "localhost" } }; + // Nested atomic + yield return new object[] { engine, null, @"(?>abc[def]gh(i*))", "123abceghiii456", RegexOptions.None, new string[] { "abceghiii", "iii" } }; + yield return new object[] { engine, null, @"(?>(?:abc)*)", "abcabcabc", RegexOptions.None, new string[] { "abcabcabc" } }; + + // Anchoring loops beginning with .* / .+ + yield return new object[] { engine, null, @".*", "", RegexOptions.None, new string[] { "" } }; + yield return new object[] { engine, null, @".*", "\n\n\n\n", RegexOptions.None, new string[] { "" } }; + yield return new object[] { engine, null, @".*", "\n\n\n\n", RegexOptions.Singleline, new string[] { "\n\n\n\n" } }; + yield return new object[] { engine, null, @".*[1a]", "\n\n\n\n1", RegexOptions.None, new string[] { "1" } }; + yield return new object[] { engine, null, @"(?s).*(?-s)[1a]", "1\n\n\n\n", RegexOptions.None, new string[] { "1" } }; + yield return new object[] { engine, null, @"(?s).*(?-s)[1a]", "\n\n\n\n1", RegexOptions.None, new string[] { "\n\n\n\n1" } }; + yield return new object[] { engine, null, @".*|.*|.*", "", RegexOptions.None, new string[] { "" } }; + yield return new object[] { engine, null, @".*123|abc", "abc\n123", RegexOptions.None, new string[] { "abc" } }; + yield return new object[] { engine, null, @".*123|abc", "abc\n123", RegexOptions.Singleline, new string[] { "abc\n123" }, "abc" }; // <-- Nonbacktracking match same as for "abc|.*123" + yield return new object[] { engine, null, @"abc|.*123", "abc\n123", RegexOptions.Singleline, new string[] { "abc" } }; + yield return new object[] { engine, null, @".*", "\n", RegexOptions.None, new string[] { "" } }; + yield return new object[] { engine, null, @".*\n", "\n", RegexOptions.None, new string[] { "\n" } }; + yield return new object[] { engine, null, @".*", "\n", RegexOptions.Singleline, new string[] { "\n" } }; + yield return new object[] { engine, null, @".*\n", "\n", RegexOptions.Singleline, new string[] { "\n" } }; + yield return new object[] { engine, null, @".*", "abc", RegexOptions.None, new string[] { "abc" } }; + yield return new object[] { engine, null, @".*abc", "abc", RegexOptions.None, new string[] { "abc" } }; + yield return new object[] { engine, null, @".*abc|ghi", "ghi", RegexOptions.None, new string[] { "ghi" } }; + yield return new object[] { engine, null, @".*abc|.*ghi", "abcghi", RegexOptions.None, new string[] { "abc" }, "abcghi" }; // <-- Nonbacktracking match same as for ".*ghi|.*abc" + yield return new object[] { engine, null, @".*ghi|.*abc", "abcghi", RegexOptions.None, new string[] { "abcghi" } }; + yield return new object[] { engine, null, @".*abc|.*ghi", "bcghi", RegexOptions.None, new string[] { "bcghi" } }; + yield return new object[] { engine, null, @".*abc|.+c", " \n \n bc", RegexOptions.None, new string[] { " bc" } }; + yield return new object[] { engine, null, @".*abc", "12345 abc", RegexOptions.None, new string[] { "12345 abc" } }; + yield return new object[] { engine, null, @".*abc", "12345\n abc", RegexOptions.None, new string[] { " abc" } }; + yield return new object[] { engine, null, @".*abc", "12345\n abc", RegexOptions.Singleline, new string[] { "12345\n abc" } }; + yield return new object[] { engine, null, @"(.*)abc\1", "\n12345abc12345", RegexOptions.Singleline, new string[] { "12345abc12345", "12345" } }; + yield return new object[] { engine, null, @".*\nabc", "\n123\nabc", RegexOptions.None, new string[] { "123\nabc" } }; + yield return new object[] { engine, null, @".*\nabc", "\n123\nabc", RegexOptions.Singleline, new string[] { "\n123\nabc" } }; + yield return new object[] { engine, null, @".*abc", "abc abc abc \nabc", RegexOptions.None, new string[] { "abc abc abc" } }; + yield return new object[] { engine, null, @".*abc", "abc abc abc \nabc", RegexOptions.Singleline, new string[] { "abc abc abc \nabc" } }; + yield return new object[] { engine, null, @".*?abc", "abc abc abc \nabc", RegexOptions.None, new string[] { "abc" } }; + yield return new object[] { engine, null, @"[^\n]*abc", "123abc\n456abc\n789abc", RegexOptions.None, new string[] { "123abc" } }; + yield return new object[] { engine, null, @"[^\n]*abc", "123abc\n456abc\n789abc", RegexOptions.Singleline, new string[] { "123abc" } }; + yield return new object[] { engine, null, @"[^\n]*abc", "123ab\n456abc\n789abc", RegexOptions.None, new string[] { "456abc" } }; + yield return new object[] { engine, null, @"[^\n]*abc", "123ab\n456abc\n789abc", RegexOptions.Singleline, new string[] { "456abc" } }; + yield return new object[] { engine, null, @".+", "a", RegexOptions.None, new string[] { "a" } }; + yield return new object[] { engine, null, @".+", "\nabc", RegexOptions.None, new string[] { "abc" } }; + yield return new object[] { engine, null, @".+", "\n", RegexOptions.Singleline, new string[] { "\n" } }; + yield return new object[] { engine, null, @".+", "\nabc", RegexOptions.Singleline, new string[] { "\nabc" } }; + yield return new object[] { engine, null, @".+abc", "aaaabc", RegexOptions.None, new string[] { "aaaabc" } }; + yield return new object[] { engine, null, @".+abc", "12345 abc", RegexOptions.None, new string[] { "12345 abc" } }; + yield return new object[] { engine, null, @".+abc", "12345\n abc", RegexOptions.None, new string[] { " abc" } }; + yield return new object[] { engine, null, @".+abc", "12345\n abc", RegexOptions.Singleline, new string[] { "12345\n abc" } }; + yield return new object[] { engine, null, @"(.+)abc\1", "\n12345abc12345", RegexOptions.Singleline, new string[] { "12345abc12345", "12345" } }; + + // Unanchored .* + yield return new object[] { engine, null, @"\A\s*(?\w+)(\s*\((?.*)\))?\s*\Z", "Match(Name)", RegexOptions.None, new string[] { "Match(Name)", "(Name)", "Match", "Name" } }; + yield return new object[] { engine, null, @"\A\s*(?\w+)(\s*\((?.*)\))?\s*\Z", "Match(Na\nme)", RegexOptions.Singleline, new string[] { "Match(Na\nme)", "(Na\nme)", "Match", "Na\nme" } }; + foreach (RegexOptions options in new[] { RegexOptions.None, RegexOptions.Singleline }) + { + yield return new object[] { engine, null, @"abcd.*", @"abcabcd", options, new string[] { "abcd" } }; + yield return new object[] { engine, null, @"abcd.*", @"abcabcde", options, new string[] { "abcde" } }; + yield return new object[] { engine, null, @"abcd.*", @"abcabcdefg", options, new string[] { "abcdefg" } }; + yield return new object[] { engine, null, @"abcd(.*)", @"ababcd", options, new string[] { "abcd", "" } }; + yield return new object[] { engine, null, @"abcd(.*)", @"aabcde", options, new string[] { "abcde", "e" } }; + yield return new object[] { engine, null, @"abcd(.*)", @"abcabcdefg", options, new string[] { "abcdefg", "efg" } }; + yield return new object[] { engine, null, @"abcd(.*)e", @"abcabcdefg", options, new string[] { "abcde", "" } }; + yield return new object[] { engine, null, @"abcd(.*)f", @"abcabcdefg", options, new string[] { "abcdef", "e" } }; + } - // Grouping Constructs Invalid Regular Expressions - yield return new object[] { null, @"()", "cat", RegexOptions.None, new string[] { string.Empty, string.Empty } }; - yield return new object[] { null, @"(?)", "cat", RegexOptions.None, new string[] { string.Empty, string.Empty } }; - yield return new object[] { null, @"(?'cat')", "cat", RegexOptions.None, new string[] { string.Empty, string.Empty } }; - yield return new object[] { null, @"(?:)", "cat", RegexOptions.None, new string[] { string.Empty } }; - yield return new object[] { null, @"(?imn)", "cat", RegexOptions.None, new string[] { string.Empty } }; - yield return new object[] { null, @"(?imn)cat", "(?imn)cat", RegexOptions.None, new string[] { "cat" } }; - yield return new object[] { null, @"(?=)", "cat", RegexOptions.None, new string[] { string.Empty } }; - yield return new object[] { null, @"(?<=)", "cat", RegexOptions.None, new string[] { string.Empty } }; - yield return new object[] { null, @"(?>)", "cat", RegexOptions.None, new string[] { string.Empty } }; - - // Alternation construct Invalid Regular Expressions - yield return new object[] { null, @"(?()|)", "(?()|)", RegexOptions.None, new string[] { "" } }; - - yield return new object[] { null, @"(?(cat)|)", "cat", RegexOptions.None, new string[] { "" } }; - yield return new object[] { null, @"(?(cat)|)", "dog", RegexOptions.None, new string[] { "" } }; - - yield return new object[] { null, @"(?(cat)catdog|)", "catdog", RegexOptions.None, new string[] { "catdog" } }; - yield return new object[] { null, @"(?(cat)catdog|)", "dog", RegexOptions.None, new string[] { "" } }; - yield return new object[] { null, @"(?(cat)dog|)", "dog", RegexOptions.None, new string[] { "" } }; - yield return new object[] { null, @"(?(cat)dog|)", "cat", RegexOptions.None, new string[] { "" } }; - - yield return new object[] { null, @"(?(cat)|catdog)", "cat", RegexOptions.None, new string[] { "" } }; - yield return new object[] { null, @"(?(cat)|catdog)", "catdog", RegexOptions.None, new string[] { "" } }; - yield return new object[] { null, @"(?(cat)|dog)", "dog", RegexOptions.None, new string[] { "dog" } }; - - // Invalid unicode - yield return new object[] { null, "([\u0000-\uFFFF-[azAZ09]]|[\u0000-\uFFFF-[^azAZ09]])+", "azAZBCDE1234567890BCDEFAZza", RegexOptions.None, new string[] { "azAZBCDE1234567890BCDEFAZza", "a" } }; - yield return new object[] { null, "[\u0000-\uFFFF-[\u0000-\uFFFF-[\u0000-\uFFFF-[\u0000-\uFFFF-[\u0000-\uFFFF-[a]]]]]]+", "abcxyzABCXYZ123890", RegexOptions.None, new string[] { "bcxyzABCXYZ123890" } }; - yield return new object[] { null, "[\u0000-\uFFFF-[\u0000-\uFFFF-[\u0000-\uFFFF-[\u0000-\uFFFF-[\u0000-\uFFFF-[\u0000-\uFFFF-[a]]]]]]]+", "bcxyzABCXYZ123890a", RegexOptions.None, new string[] { "a" } }; - yield return new object[] { null, "[\u0000-\uFFFF-[\\p{P}\\p{S}\\p{C}]]+", "!@`';.,$+<>=\x0001\x001FazAZ09", RegexOptions.None, new string[] { "azAZ09" } }; - - yield return new object[] { null, @"[\uFFFD-\uFFFF]+", "\uFFFC\uFFFD\uFFFE\uFFFF", RegexOptions.IgnoreCase, new string[] { "\uFFFD\uFFFE\uFFFF" } }; - yield return new object[] { null, @"[\uFFFC-\uFFFE]+", "\uFFFB\uFFFC\uFFFD\uFFFE\uFFFF", RegexOptions.IgnoreCase, new string[] { "\uFFFC\uFFFD\uFFFE" } }; - - // Empty Match - yield return new object[] { null, @"([a*]*)+?$", "ab", RegexOptions.None, new string[] { "", "" } }; - yield return new object[] { null, @"(a*)+?$", "b", RegexOptions.None, new string[] { "", "" } }; + // Grouping Constructs Invalid Regular Expressions + yield return new object[] { engine, null, @"()", "cat", RegexOptions.None, new string[] { string.Empty, string.Empty } }; + yield return new object[] { engine, null, @"(?)", "cat", RegexOptions.None, new string[] { string.Empty, string.Empty } }; + yield return new object[] { engine, null, @"(?'cat')", "cat", RegexOptions.None, new string[] { string.Empty, string.Empty } }; + yield return new object[] { engine, null, @"(?:)", "cat", RegexOptions.None, new string[] { string.Empty } }; + yield return new object[] { engine, null, @"(?imn)", "cat", RegexOptions.None, new string[] { string.Empty } }; + yield return new object[] { engine, null, @"(?imn)cat", "(?imn)cat", RegexOptions.None, new string[] { "cat" } }; + yield return new object[] { engine, null, @"(?=)", "cat", RegexOptions.None, new string[] { string.Empty } }; + yield return new object[] { engine, null, @"(?<=)", "cat", RegexOptions.None, new string[] { string.Empty } }; + yield return new object[] { engine, null, @"(?>)", "cat", RegexOptions.None, new string[] { string.Empty } }; + + // Alternation construct Invalid Regular Expressions + yield return new object[] { engine, null, @"(?()|)", "(?()|)", RegexOptions.None, new string[] { "" } }; + + yield return new object[] { engine, null, @"(?(cat)|)", "cat", RegexOptions.None, new string[] { "" } }; + yield return new object[] { engine, null, @"(?(cat)|)", "dog", RegexOptions.None, new string[] { "" } }; + + yield return new object[] { engine, null, @"(?(cat)catdog|)", "catdog", RegexOptions.None, new string[] { "catdog" } }; + yield return new object[] { engine, null, @"(?(cat)catdog|)", "dog", RegexOptions.None, new string[] { "" } }; + yield return new object[] { engine, null, @"(?(cat)dog|)", "dog", RegexOptions.None, new string[] { "" } }; + yield return new object[] { engine, null, @"(?(cat)dog|)", "cat", RegexOptions.None, new string[] { "" } }; + + yield return new object[] { engine, null, @"(?(cat)|catdog)", "cat", RegexOptions.None, new string[] { "" } }; + yield return new object[] { engine, null, @"(?(cat)|catdog)", "catdog", RegexOptions.None, new string[] { "" } }; + yield return new object[] { engine, null, @"(?(cat)|dog)", "dog", RegexOptions.None, new string[] { "dog" } }; + + // Invalid unicode + yield return new object[] { engine, null, "([\u0000-\uFFFF-[azAZ09]]|[\u0000-\uFFFF-[^azAZ09]])+", "azAZBCDE1234567890BCDEFAZza", RegexOptions.None, new string[] { "azAZBCDE1234567890BCDEFAZza", "a" } }; + yield return new object[] { engine, null, "[\u0000-\uFFFF-[\u0000-\uFFFF-[\u0000-\uFFFF-[\u0000-\uFFFF-[\u0000-\uFFFF-[a]]]]]]+", "abcxyzABCXYZ123890", RegexOptions.None, new string[] { "bcxyzABCXYZ123890" } }; + yield return new object[] { engine, null, "[\u0000-\uFFFF-[\u0000-\uFFFF-[\u0000-\uFFFF-[\u0000-\uFFFF-[\u0000-\uFFFF-[\u0000-\uFFFF-[a]]]]]]]+", "bcxyzABCXYZ123890a", RegexOptions.None, new string[] { "a" } }; + yield return new object[] { engine, null, "[\u0000-\uFFFF-[\\p{P}\\p{S}\\p{C}]]+", "!@`';.,$+<>=\x0001\x001FazAZ09", RegexOptions.None, new string[] { "azAZ09" } }; + + yield return new object[] { engine, null, @"[\uFFFD-\uFFFF]+", "\uFFFC\uFFFD\uFFFE\uFFFF", RegexOptions.IgnoreCase, new string[] { "\uFFFD\uFFFE\uFFFF" } }; + yield return new object[] { engine, null, @"[\uFFFC-\uFFFE]+", "\uFFFB\uFFFC\uFFFD\uFFFE\uFFFF", RegexOptions.IgnoreCase, new string[] { "\uFFFC\uFFFD\uFFFE" } }; + + // Empty Match + yield return new object[] { engine, null, @"([a*]*)+?$", "ab", RegexOptions.None, new string[] { "", "" } }; + yield return new object[] { engine, null, @"(a*)+?$", "b", RegexOptions.None, new string[] { "", "" } }; + } } public static IEnumerable Groups_CustomCulture_TestData_enUS() { - yield return new object[] { "en-US", "CH", "Ch", RegexOptions.IgnoreCase, new string[] { "Ch" } }; - yield return new object[] { "en-US", "cH", "Ch", RegexOptions.IgnoreCase, new string[] { "Ch" } }; - yield return new object[] { "en-US", "AA", "Aa", RegexOptions.IgnoreCase, new string[] { "Aa" } }; - yield return new object[] { "en-US", "aA", "Aa", RegexOptions.IgnoreCase, new string[] { "Aa" } }; - yield return new object[] { "en-US", "\u0130", "\u0049", RegexOptions.IgnoreCase, new string[] { "\u0049" } }; - yield return new object[] { "en-US", "\u0130", "\u0069", RegexOptions.IgnoreCase, new string[] { "\u0069" } }; + foreach (RegexEngine engine in RegexHelpers.AvailableEngines) + { + yield return new object[] { engine, "en-US", "CH", "Ch", RegexOptions.IgnoreCase, new string[] { "Ch" } }; + yield return new object[] { engine, "en-US", "cH", "Ch", RegexOptions.IgnoreCase, new string[] { "Ch" } }; + yield return new object[] { engine, "en-US", "AA", "Aa", RegexOptions.IgnoreCase, new string[] { "Aa" } }; + yield return new object[] { engine, "en-US", "aA", "Aa", RegexOptions.IgnoreCase, new string[] { "Aa" } }; + yield return new object[] { engine, "en-US", "\u0130", "\u0049", RegexOptions.IgnoreCase, new string[] { "\u0049" } }; + yield return new object[] { engine, "en-US", "\u0130", "\u0069", RegexOptions.IgnoreCase, new string[] { "\u0069" } }; + } } public static IEnumerable Groups_CustomCulture_TestData_Czech() { - yield return new object[] { "cs-CZ", "CH", "Ch", RegexOptions.IgnoreCase, new string[] { "Ch" } }; - yield return new object[] { "cs-CZ", "cH", "Ch", RegexOptions.IgnoreCase, new string[] { "Ch" } }; + foreach (RegexEngine engine in RegexHelpers.AvailableEngines) + { + yield return new object[] { engine, "cs-CZ", "CH", "Ch", RegexOptions.IgnoreCase, new string[] { "Ch" } }; + yield return new object[] { engine, "cs-CZ", "cH", "Ch", RegexOptions.IgnoreCase, new string[] { "Ch" } }; + } } public static IEnumerable Groups_CustomCulture_TestData_Danish() { - yield return new object[] { "da-DK", "AA", "Aa", RegexOptions.IgnoreCase, new string[] { "Aa" } }; - yield return new object[] { "da-DK", "aA", "Aa", RegexOptions.IgnoreCase, new string[] { "Aa" } }; + foreach (RegexEngine engine in RegexHelpers.AvailableEngines) + { + yield return new object[] { engine, "da-DK", "AA", "Aa", RegexOptions.IgnoreCase, new string[] { "Aa" } }; + yield return new object[] { engine, "da-DK", "aA", "Aa", RegexOptions.IgnoreCase, new string[] { "Aa" } }; + } } public static IEnumerable Groups_CustomCulture_TestData_Turkish() { - yield return new object[] { "tr-TR", "\u0131", "\u0049", RegexOptions.IgnoreCase, new string[] { "\u0049" } }; - yield return new object[] { "tr-TR", "\u0130", "\u0069", RegexOptions.IgnoreCase, new string[] { "\u0069" } }; + foreach (RegexEngine engine in RegexHelpers.AvailableEngines) + { + yield return new object[] { engine, "tr-TR", "\u0131", "\u0049", RegexOptions.IgnoreCase, new string[] { "\u0049" } }; + yield return new object[] { engine, "tr-TR", "\u0130", "\u0069", RegexOptions.IgnoreCase, new string[] { "\u0069" } }; + } } public static IEnumerable Groups_CustomCulture_TestData_AzeriLatin() { - if (PlatformDetection.IsNotBrowser) + foreach (RegexEngine engine in RegexHelpers.AvailableEngines) { - yield return new object[] { "az-Latn-AZ", "\u0131", "\u0049", RegexOptions.IgnoreCase, new string[] { "\u0049" } }; - yield return new object[] { "az-Latn-AZ", "\u0130", "\u0069", RegexOptions.IgnoreCase, new string[] { "\u0069" } }; + if (PlatformDetection.IsNotBrowser) + { + yield return new object[] { engine, "az-Latn-AZ", "\u0131", "\u0049", RegexOptions.IgnoreCase, new string[] { "\u0049" } }; + yield return new object[] { engine, "az-Latn-AZ", "\u0130", "\u0069", RegexOptions.IgnoreCase, new string[] { "\u0069" } }; + } } } @@ -909,7 +936,7 @@ public static IEnumerable Groups_CustomCulture_TestData_AzeriLatin() [MemberData(nameof(Groups_CustomCulture_TestData_AzeriLatin))] [ActiveIssue("https://github.com/dotnet/runtime/issues/56407", TestPlatforms.Android)] [ActiveIssue("https://github.com/dotnet/runtime/issues/36900", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] - public async Task Groups(string cultureName, string pattern, string input, RegexOptions options, string[] expectedGroups, string altMatch = null) + public async Task Groups(RegexEngine engine, string cultureName, string pattern, string input, RegexOptions options, string[] expectedGroups, string altMatch = null) { if (cultureName is null) { @@ -917,59 +944,50 @@ public async Task Groups(string cultureName, string pattern, string input, Regex cultureName = culture.Equals(CultureInfo.InvariantCulture) ? "en-US" : culture.Name; } - using (new ThreadCultureChange(cultureName)) - { - foreach (RegexEngine engine in RegexHelpers.AvailableEngines) - { - // Alternative altMatch when order of alternations matters in backtracking but order does not matter in NonBacktracking mode - // Also in NonBacktracking there is only a single top-level match, which is expectedGroups[0] when altMatch is null - string[] expected = engine == RegexEngine.NonBacktracking ? - new string[] { altMatch ?? expectedGroups[0] } : - expectedGroups; + // Alternative altMatch when order of alternations matters in backtracking but order does not matter in NonBacktracking mode + // Also in NonBacktracking there is only a single top-level match, which is expectedGroups[0] when altMatch is null + expectedGroups = engine == RegexEngine.NonBacktracking ? + new string[] { altMatch ?? expectedGroups[0] } : + expectedGroups; - await GroupsAsync(engine, pattern, input, options, expected); - } + if (engine == RegexEngine.NonBacktracking && pattern.Contains("?(cat)")) + { + // General if-then-else construct is not supported and uses the ?(cat) condition in the tests + // TODO-NONBACKTRACKING: The constructor will throw NotSupportedException so this check will become obsolete + return; } - static async Task GroupsAsync(RegexEngine engine, string pattern, string input, RegexOptions options, string[] expectedGroups) + using var _ = new ThreadCultureChange(cultureName); + + Regex regex; + try { - if (engine == RegexEngine.NonBacktracking && pattern.Contains("?(cat)")) - { - // General if-then-else construct is not supported and uses the ?(cat) condition in the tests - // TODO-NONBACKTRACKING: The constructor will throw NotSupportedException so this check will become obsolete - return; - } + regex = await RegexHelpers.GetRegexAsync(engine, pattern, options); + } + catch (NotSupportedException) when (RegexHelpers.IsNonBacktracking(engine)) + { + // Some constructs are not supported in NonBacktracking mode, such as: if-then-else, lookaround, and backreferences + return; + } - Regex regex; - try - { - regex = await RegexHelpers.GetRegexAsync(engine, pattern, options); - } - catch (NotSupportedException) when (RegexHelpers.IsNonBacktracking(engine)) - { - // Some constructs are not supported in NonBacktracking mode, such as: if-then-else, lookaround, and backreferences - return; - } + Match match = regex.Match(input); - Match match = regex.Match(input); + Assert.True(match.Success); + Assert.Equal(expectedGroups[0], match.Value); - Assert.True(match.Success); - Assert.Equal(expectedGroups[0], match.Value); + if (!RegexHelpers.IsNonBacktracking(engine)) + { + Assert.Equal(expectedGroups.Length, match.Groups.Count); - if (!RegexHelpers.IsNonBacktracking(engine)) + int[] groupNumbers = regex.GetGroupNumbers(); + string[] groupNames = regex.GetGroupNames(); + for (int i = 0; i < expectedGroups.Length; i++) { - Assert.Equal(expectedGroups.Length, match.Groups.Count); - - int[] groupNumbers = regex.GetGroupNumbers(); - string[] groupNames = regex.GetGroupNames(); - for (int i = 0; i < expectedGroups.Length; i++) - { - Assert.Equal(expectedGroups[i], match.Groups[groupNumbers[i]].Value); - Assert.Equal(match.Groups[groupNumbers[i]], match.Groups[groupNames[i]]); - - Assert.Equal(groupNumbers[i], regex.GroupNumberFromName(groupNames[i])); - Assert.Equal(groupNames[i], regex.GroupNameFromNumber(groupNumbers[i])); - } + Assert.Equal(expectedGroups[i], match.Groups[groupNumbers[i]].Value); + Assert.Equal(match.Groups[groupNumbers[i]], match.Groups[groupNames[i]]); + + Assert.Equal(groupNumbers[i], regex.GroupNumberFromName(groupNames[i])); + Assert.Equal(groupNames[i], regex.GroupNameFromNumber(groupNumbers[i])); } } } diff --git a/src/libraries/System.Text.RegularExpressions/tests/Regex.KnownPattern.Tests.cs b/src/libraries/System.Text.RegularExpressions/tests/Regex.KnownPattern.Tests.cs index 7aefe06de78b7b..b53526645705f9 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/Regex.KnownPattern.Tests.cs +++ b/src/libraries/System.Text.RegularExpressions/tests/Regex.KnownPattern.Tests.cs @@ -504,8 +504,6 @@ public async Task Docs_GroupingConstructs_NonbacktrackingSubexpressions(RegexEng Regex rBack = await RegexHelpers.GetRegexAsync(engine, @"(\w)\1+.\b"); Regex rNoBack = await RegexHelpers.GetRegexAsync(engine, @"(?>(\w)\1+).\b"); - string[] inputs = { "aaad", "aaaa" }; - Match back, noback; back = rBack.Match("cccd."); @@ -1117,6 +1115,95 @@ public async Task Docs_Anchors_ContiguousMatches(RegexEngine engine) Regex.Replace(Input, Pattern, m => string.Concat(m.Value.Reverse()))); } + // + // Based on examples from https://blog.stevenlevithan.com/archives/balancing-groups + // + + [Theory] + [MemberData(nameof(RegexHelpers.AvailableEngines_MemberData), MemberType = typeof(RegexHelpers))] + public async Task Blog_Levithan_BalancingGroups_Palindromes(RegexEngine engine) + { + if (RegexHelpers.IsNonBacktracking(engine)) + { + // balancing groups not supported + return; + } + + Regex r = await RegexHelpers.GetRegexAsync(engine, @"(?.)+.?(?<-N>\k)+(?(N)(?!))"); + + // Palindromes + Assert.All(new[] + { + "kayak", + "racecar", + "never odd or even", + "madam im adam" + }, p => Assert.True(r.IsMatch(p))); + + // Non-Palindromes + Assert.All(new[] + { + "canoe", + "raceboat" + }, p => Assert.False(r.IsMatch(p))); + } + + [Theory] + [MemberData(nameof(RegexHelpers.AvailableEngines_MemberData), MemberType = typeof(RegexHelpers))] + public async Task Blog_Levithan_BalancingGroups_MatchingParentheses(RegexEngine engine) + { + if (RegexHelpers.IsNonBacktracking(engine)) + { + // balancing groups not supported + return; + } + + Regex r = await RegexHelpers.GetRegexAsync(engine, @"^\( + (?> + [^()]+ + | + \( (?) + | + \) (?<-Depth>) + )* + (?(Depth)(?!)) + \)$", RegexOptions.IgnorePatternWhitespace); + + Assert.True(r.IsMatch("()")); + Assert.True(r.IsMatch("(a(b c(de(f(g)hijkl))mn))")); + + Assert.False(r.IsMatch("(")); + Assert.False(r.IsMatch(")")); + Assert.False(r.IsMatch("())")); + Assert.False(r.IsMatch("(()")); + Assert.False(r.IsMatch("(ab(cd)ef")); + } + + [Theory] + [MemberData(nameof(RegexHelpers.AvailableEngines_MemberData), MemberType = typeof(RegexHelpers))] + public async Task Blog_Levithan_BalancingGroups_WordLengthIncreases(RegexEngine engine) + { + if (RegexHelpers.IsNonBacktracking(engine)) + { + // balancing groups not supported + return; + } + + Regex r = await RegexHelpers.GetRegexAsync(engine, @"^(?: + (?(A)\s|) + (?) + (?\w)+ (?(B)(?!)) + (?: + \s + (?) + (?\w)+ (?(C)(?!)) + (?) + )? + )+ \b$", RegexOptions.IgnorePatternWhitespace); + + Assert.True(r.IsMatch("a bc def ghij klmni")); + Assert.False(r.IsMatch("a bc def ghi klmn")); + } // // These patterns come from real-world customer usages diff --git a/src/libraries/System.Text.RegularExpressions/tests/Regex.Match.Tests.cs b/src/libraries/System.Text.RegularExpressions/tests/Regex.Match.Tests.cs index 6dd56fc109e9b3..2314d778c8c5d9 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/Regex.Match.Tests.cs +++ b/src/libraries/System.Text.RegularExpressions/tests/Regex.Match.Tests.cs @@ -239,6 +239,8 @@ public static IEnumerable Match_MemberData() { yield return ("aaa(?i:match this)bbb", "aaaMaTcH ThIsbbb", RegexOptions.None, 0, 16, true, "aaaMaTcH ThIsbbb"); } + yield return ("(?i:a)b(?i:c)d", "aaaaAbCdddd", RegexOptions.None, 0, 11, true, "AbCd"); + yield return ("(?i:[\u0000-\u1000])[Bb]", "aaaaAbCdddd", RegexOptions.None, 0, 11, true, "Ab"); // Turning off case insensitive option in mid-pattern : Actual - "aaa(?-i:match this)bbb", "i" yield return ("aAa(?-i:match this)bbb", "AaAmatch thisBBb", RegexOptions.IgnoreCase, 0, 16, true, "AaAmatch thisBBb"); @@ -274,6 +276,8 @@ public static IEnumerable Match_MemberData() yield return (@"\p{Ll}", "1bc", RegexOptions.IgnoreCase, 0, 3, true, "b"); yield return (@"\p{Lt}", "1bc", RegexOptions.IgnoreCase, 0, 3, true, "b"); yield return (@"\p{Lo}", "1bc", RegexOptions.IgnoreCase, 0, 3, false, string.Empty); + yield return (".[abc]", "xYZAbC", RegexOptions.IgnoreCase, 0, 6, true, "ZA"); + yield return (".[abc]", "xYzXyZx", RegexOptions.IgnoreCase, 0, 6, false, ""); // "\D+" yield return (@"\D+", "12321", RegexOptions.None, 0, 5, false, string.Empty); @@ -360,7 +364,6 @@ public static IEnumerable Match_MemberData() yield return ("(?>(?:a|ab|abc|abcd))d", "abcd", RegexOptions.RightToLeft, 0, 4, true, "abcd"); } yield return ("[^a-z0-9]etag|[^a-z0-9]digest", "this string has .digest as a substring", RegexOptions.None, 16, 7, true, ".digest"); - yield return (@"a\w*a|def", "aaaaa", RegexOptions.None, 0, 5, true, "aaaaa"); // No Negation yield return ("[abcd-[abcd]]+", "abcxyzABCXYZ`!@#$%^&*()_-+= \t\n", RegexOptions.None, 0, 30, false, string.Empty); @@ -516,6 +519,8 @@ public static IEnumerable Match_MemberData() yield return (@".*\dFoo", "This1foo should 2FoO match", RegexOptions.IgnoreCase | RegexOptions.RightToLeft, 0, 26, true, "This1foo should 2FoO"); yield return (@".*\dFoo", "This1Foo should 2fOo match", RegexOptions.IgnoreCase | RegexOptions.RightToLeft, 0, 26, true, "This1Foo should 2fOo"); yield return (@".*\dfoo", "1fooThis2FOO should 1foo match", RegexOptions.IgnoreCase | RegexOptions.RightToLeft, 8, 4, true, "2FOO"); + yield return (@"[\w\s].*", "1fooThis2FOO should 1foo match", RegexOptions.IgnoreCase | RegexOptions.RightToLeft, 0, 30, true, "1fooThis2FOO should 1foo match"); + yield return (@"i.*", "1fooThis2FOO should 1foo match", RegexOptions.IgnoreCase | RegexOptions.RightToLeft, 0, 30, true, "is2FOO should 1foo match"); } // [ActiveIssue("https://github.com/dotnet/runtime/issues/36149")] @@ -537,6 +542,29 @@ public static IEnumerable Match_MemberData() // yield return (@"^(?i:[\u24B6-\u24D0])$", ((char)('\u24CF' + 26)).ToString(), RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, 0, 1, true, ((char)('\u24CF' + 26)).ToString()); //} + // Long inputs + string longCharacterRange = string.Concat(Enumerable.Range(1, 0x2000).Select(c => (char)c)); + foreach (RegexOptions options in new[] { RegexOptions.None, RegexOptions.IgnoreCase }) + { + yield return ("\u1000", longCharacterRange, options, 0, 0x2000, true, "\u1000"); + yield return ("[\u1000-\u1001]", longCharacterRange, options, 0, 0x2000, true, "\u1000"); + yield return ("[\u0FF0-\u0FFF][\u1000-\u1001]", longCharacterRange, options, 0, 0x2000, true, "\u0FFF\u1000"); + + yield return ("\uA640", longCharacterRange, options, 0, 0x2000, false, ""); + yield return ("[\u3000-\u3001]", longCharacterRange, options, 0, 0x2000, false, ""); + yield return ("[\uA640-\uA641][\u3000-\u3010]", longCharacterRange, options, 0, 0x2000, false, ""); + + if (!RegexHelpers.IsNonBacktracking(engine)) + { + yield return ("\u1000", longCharacterRange, options | RegexOptions.RightToLeft, 0, 0x2000, true, "\u1000"); + yield return ("[\u1000-\u1001]", longCharacterRange, options | RegexOptions.RightToLeft, 0, 0x2000, true, "\u1001"); + yield return ("[\u1000][\u1001-\u1010]", longCharacterRange, options, 0, 0x2000, true, "\u1000\u1001"); + + yield return ("\uA640", longCharacterRange, options | RegexOptions.RightToLeft, 0, 0x2000, false, ""); + yield return ("[\u3000-\u3001][\uA640-\uA641]", longCharacterRange, options | RegexOptions.RightToLeft, 0, 0x2000, false, ""); + } + } + foreach (RegexOptions options in new[] { RegexOptions.None, RegexOptions.Singleline }) { yield return (@"\W.*?\D", "seq 012 of 3 digits", options, 0, 19, true, " 012 "); @@ -766,9 +794,7 @@ public void Match_DefaultTimeout_Throws(RegexOptions options) // TODO: Figure out what to do with default timeouts for source generated regexes [Theory] [InlineData(RegexOptions.None)] - [InlineData(RegexOptions.None | RegexHelpers.RegexOptionDebug)] [InlineData(RegexOptions.Compiled)] - [InlineData(RegexOptions.Compiled | RegexHelpers.RegexOptionDebug)] public void Match_CachedPattern_NewTimeoutApplies(RegexOptions options) { const string PatternLeadingToLotsOfBacktracking = @"^(\w+\s?)*$"; @@ -1283,13 +1309,11 @@ public void Match_ExcessPrefix(RegexEngine engine) // Repeaters Assert.False((await RegexHelpers.GetRegexAsync(engine, @"a{2147483647,}")).IsMatch("a")); - Assert.False((await RegexHelpers.GetRegexAsync(engine, @"a{50,}")).IsMatch("a")); // cutoff for Boyer-Moore prefix in debug - Assert.False((await RegexHelpers.GetRegexAsync(engine, @"a{51,}")).IsMatch("a")); + Assert.False((await RegexHelpers.GetRegexAsync(engine, @"a{50,}")).IsMatch("a")); Assert.False((await RegexHelpers.GetRegexAsync(engine, @"a{50_000,}")).IsMatch("a")); // cutoff for Boyer-Moore prefix in release - Assert.False((await RegexHelpers.GetRegexAsync(engine, @"a{50_001,}")).IsMatch("a")); // Multis - foreach (int length in new[] { 50, 51, 50_000, 50_001, char.MaxValue + 1 }) // based on knowledge of cut-offs used in Boyer-Moore + foreach (int length in new[] { 50, 50_000, char.MaxValue + 1 }) { // The large counters are too slow for counting a's in NonBacktracking engine // They will incur a constant of size length because in .*a{k} after reading n a's the @@ -1827,5 +1851,33 @@ public async Task UseRegexConcurrently_ThreadSafe_Success(RegexEngine engine, Ti }, CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default)).ToArray()); } } + + [Theory] + [MemberData(nameof(MatchWordsInAnchoredRegexes_TestData))] + public async Task MatchWordsInAnchoredRegexes(RegexEngine engine, RegexOptions options, string pattern, string input, (int, int)[] matches) + { + // The aim of these test is to test corner cases of matches involving anchors + // For NonBacktracking these tests are meant to + // cover most contexts in _nullabilityForContext in SymbolicRegexNode + Regex r = await RegexHelpers.GetRegexAsync(engine, pattern, options); + MatchCollection ms = r.Matches(input); + Assert.Equal(matches.Length, ms.Count); + for (int i = 0; i < matches.Length; i++) + { + Assert.Equal(ms[i].Index, matches[i].Item1); + Assert.Equal(ms[i].Length, matches[i].Item2); + } + } + + public static IEnumerable MatchWordsInAnchoredRegexes_TestData() + { + foreach (RegexEngine engine in RegexHelpers.AvailableEngines) + { + yield return new object[] { engine, RegexOptions.None, @"\b\w{10,}\b", "this is a complicated word in a\nnontrivial sentence", new (int, int)[] { (10, 11), (32, 10) } }; + yield return new object[] { engine, RegexOptions.Multiline, @"^\w{10,}\b", "this is a\ncomplicated word in a\nnontrivial sentence", new (int, int)[] { (10, 11), (32, 10) } }; + yield return new object[] { engine, RegexOptions.None, @"\b\d{1,2}\/\d{1,2}\/\d{2,4}\b", "date 10/12/1966 and 10/12/66 are the same", new (int, int)[] { (5, 10), (20, 8) } }; + yield return new object[] { engine, RegexOptions.Multiline, @"\b\d{1,2}\/\d{1,2}\/\d{2,4}$", "date 10/12/1966\nand 10/12/66\nare the same", new (int, int)[] { (5, 10), (20, 8) } }; + } + } } } diff --git a/src/libraries/System.Text.RegularExpressions/tests/Regex.Tests.Common.cs b/src/libraries/System.Text.RegularExpressions/tests/Regex.Tests.Common.cs index b325f1c0bf2c79..e1792c623be215 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/Regex.Tests.Common.cs +++ b/src/libraries/System.Text.RegularExpressions/tests/Regex.Tests.Common.cs @@ -48,11 +48,11 @@ public static bool IsDefaultStart(string input, RegexOptions options, int start) return start == 0; } - public static Regex CreateRegexInCulture(string pattern, RegexOptions options, Globalization.CultureInfo culture) + public static async Task GetRegexAsync(RegexEngine engine, string pattern, RegexOptions options, Globalization.CultureInfo culture) { using (new System.Tests.ThreadCultureChange(culture)) { - return new Regex(pattern, options); + return await GetRegexAsync(engine, pattern, options); } } @@ -116,7 +116,7 @@ public static async Task GetRegexAsync(RegexEngine engine, string pattern // - Handle NonBacktrackingSourceGenerated return - options is null ? new Regex(pattern, RegexOptions.Compiled | OptionsFromEngine(engine)) : + options is null ? new Regex(pattern, OptionsFromEngine(engine)) : matchTimeout is null ? new Regex(pattern, options.Value | OptionsFromEngine(engine)) : new Regex(pattern, options.Value | OptionsFromEngine(engine), matchTimeout.Value); } @@ -136,7 +136,7 @@ public static async Task GetRegexesAsync(RegexEngine engine, params (st { (string pattern, RegexOptions? options, TimeSpan? matchTimeout) = regexes[i]; results[i] = - options is null ? new Regex(pattern, RegexOptions.Compiled | OptionsFromEngine(engine)) : + options is null ? new Regex(pattern, OptionsFromEngine(engine)) : matchTimeout is null ? new Regex(pattern, options.Value | OptionsFromEngine(engine)) : new Regex(pattern, options.Value | OptionsFromEngine(engine), matchTimeout.Value); } diff --git a/src/libraries/System.Text.RegularExpressions/tests/RegexCultureTests.cs b/src/libraries/System.Text.RegularExpressions/tests/RegexCultureTests.cs index adcde90c42b970..207854957fedf0 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/RegexCultureTests.cs +++ b/src/libraries/System.Text.RegularExpressions/tests/RegexCultureTests.cs @@ -12,62 +12,43 @@ namespace System.Text.RegularExpressions.Tests { public class RegexCultureTests { - // TODO: Validate source generator after figuring out what to do with culture - - public static IEnumerable RegexOptionsExtended() - { - yield return RegexOptions.None; - yield return RegexOptions.Compiled; - if (PlatformDetection.IsNetCore) - { - yield return RegexHelpers.RegexOptionNonBacktracking; - } - } - - public static IEnumerable RegexOptionsExtended_MemberData() => - from options in RegexOptionsExtended() - select new object[] { options }; - public static IEnumerable CharactersComparedOneByOne_AnchoredPattern_TestData() { - foreach (RegexOptions options in RegexOptionsExtended()) + foreach (RegexEngine engine in RegexHelpers.AvailableEngines) { - yield return new object[] { "^aa$", "aA", "da-DK", options, false }; - yield return new object[] { "^aA$", "aA", "da-DK", options, true }; - yield return new object[] { "^aa$", "aA", "da-DK", options | RegexOptions.IgnoreCase, true }; - yield return new object[] { "^aA$", "aA", "da-DK", options | RegexOptions.IgnoreCase, true }; + yield return new object[] { engine, "^aa$", "aA", "da-DK", RegexOptions.None, false }; + yield return new object[] { engine, "^aA$", "aA", "da-DK", RegexOptions.None, true }; + yield return new object[] { engine, "^aa$", "aA", "da-DK", RegexOptions.IgnoreCase, true }; + yield return new object[] { engine, "^aA$", "aA", "da-DK", RegexOptions.IgnoreCase, true }; } } [Theory] [MemberData(nameof(CharactersComparedOneByOne_AnchoredPattern_TestData))] - public void CharactersComparedOneByOne_AnchoredPattern(string pattern, string input, string culture, RegexOptions options, bool expected) + public async Task CharactersComparedOneByOne_AnchoredPattern(RegexEngine engine, string pattern, string input, string culture, RegexOptions options, bool expected) { // Regex compares characters one by one. If that changes, it could impact the behavior of // a case like this, where these characters are not the same, but the strings compare // as equal with the invariant culture (and some other cultures as well). using (new ThreadCultureChange(culture)) { - foreach (RegexOptions compiled in new[] { RegexOptions.None, RegexOptions.Compiled }) - { - Assert.Equal(expected, new Regex(pattern, options | compiled).IsMatch(input)); - } + Regex r = await RegexHelpers.GetRegexAsync(engine, pattern, options); + Assert.Equal(expected, r.IsMatch(input)); } } - public static IEnumerable CharactersComparedOneByOne_Invariant_TestData() { - foreach (RegexOptions options in RegexOptionsExtended()) + foreach (RegexEngine engine in RegexHelpers.AvailableEngines) { - yield return new object[] { options }; - yield return new object[] { options | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant }; + yield return new object[] { engine, RegexOptions.None }; + yield return new object[] { engine, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant }; } } [Theory] [MemberData(nameof(CharactersComparedOneByOne_Invariant_TestData))] - public void CharactersComparedOneByOne_Invariant(RegexOptions options) + public async Task CharactersComparedOneByOne_Invariant(RegexEngine engine, RegexOptions options) { // Regex compares characters one by one. If that changes, it could impact the behavior of // a case like this, where these characters are not the same, but the strings compare @@ -88,35 +69,20 @@ public void CharactersComparedOneByOne_Invariant(RegexOptions options) string input = string.Concat(Enumerable.Repeat(S2, multiple)); Regex r; - // Validate when the string is at the beginning of the pattern, as it impacts Boyer-Moore prefix matching. - r = new Regex(pattern, options); + // Validate when the string is at the beginning of the pattern, as it impacts prefix matching. + r = await RegexHelpers.GetRegexAsync(engine, pattern, options); Assert.False(r.IsMatch(input)); Assert.True(r.IsMatch(pattern)); // Validate when it's not at the beginning of the pattern, as it impacts "multi" matching. - r = new Regex("[abc]" + pattern, options); + r = await RegexHelpers.GetRegexAsync(engine, "[abc]" + pattern, options); Assert.False(r.IsMatch("a" + input)); Assert.True(r.IsMatch("a" + pattern)); } } - public static IEnumerable CharactersLowercasedOneByOne_MemberData() - { - foreach (RegexEngine engine in RegexHelpers.AvailableEngines) - { - switch (engine) - { - case RegexEngine.SourceGenerated: - case RegexEngine.NonBacktrackingSourceGenerated: - continue; - } - - yield return new object[] { engine }; - } - } - [Theory] - [MemberData(nameof(CharactersLowercasedOneByOne_MemberData))] + [MemberData(nameof(RegexHelpers.AvailableEngines_MemberData), MemberType = typeof(RegexHelpers))] public async Task CharactersLowercasedOneByOne(RegexEngine engine) { using (new ThreadCultureChange("en-US")) @@ -191,15 +157,15 @@ Regex[] Create(string input, CultureInfo info, RegexOptions additional) [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Doesn't support NonBacktracking")] [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/60568", TestPlatforms.Android)] - public void TurkishI_Is_Differently_LowerUpperCased_In_Turkish_Culture_NonBacktracking() + public async Task TurkishI_Is_Differently_LowerUpperCased_In_Turkish_Culture_NonBacktracking() { var turkish = new CultureInfo("tr-TR"); string input = "I\u0131\u0130i"; // Use the input as the regex also // Ignore the Compiled option here because it is a noop in combination with NonBacktracking - Regex cultInvariantRegex = RegexHelpers.CreateRegexInCulture(input, RegexHelpers.RegexOptionNonBacktracking | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, CultureInfo.InvariantCulture); - Regex turkishRegex = RegexHelpers.CreateRegexInCulture(input, RegexHelpers.RegexOptionNonBacktracking | RegexOptions.IgnoreCase, turkish); + Regex cultInvariantRegex = await RegexHelpers.GetRegexAsync(RegexEngine.NonBacktracking, input, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, CultureInfo.InvariantCulture); + Regex turkishRegex = await RegexHelpers.GetRegexAsync(RegexEngine.NonBacktracking, input, RegexOptions.IgnoreCase, turkish); Assert.True(cultInvariantRegex.IsMatch(input)); Assert.True(turkishRegex.IsMatch(input)); // <---------- This result differs from the result in the previous test!!! @@ -220,60 +186,71 @@ public void TurkishI_Is_Differently_LowerUpperCased_In_Turkish_Culture_NonBacktr Assert.True(turkishRegex.IsMatch(input.ToUpper(turkish))); } - [ActiveIssue("Incorrect handling of IgnoreCase over intervals in Turkish Culture, https://github.com/dotnet/runtime/issues/58958")] - [Fact] - public void TurkishCulture_Handling_Of_IgnoreCase() + [ActiveIssue("https://github.com/dotnet/runtime/issues/58958")] + [Theory] + [MemberData(nameof(RegexHelpers.AvailableEngines_MemberData), MemberType = typeof(RegexHelpers))] + public async Task TurkishCulture_Handling_Of_IgnoreCase(RegexEngine engine) { var turkish = new CultureInfo("tr-TR"); string input = "I\u0131\u0130i"; string pattern = "[H-J][\u0131-\u0140][\u0120-\u0130][h-j]"; - Regex regex = RegexHelpers.CreateRegexInCulture(pattern, RegexOptions.IgnoreCase, turkish); + Regex regex = await RegexHelpers.GetRegexAsync(engine, pattern, RegexOptions.IgnoreCase, turkish); // The pattern must trivially match the input because all of the letters fall in the given intervals // Ignoring case can only add more letters here -- not REMOVE letters Assert.True(regex.IsMatch(input)); } - [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Doesn't support NonBacktracking")] - [Fact] - public void TurkishCulture_Handling_Of_IgnoreCase_NonBacktracking() + public static IEnumerable TurkishCulture_MatchesWordChar_MemberData() { - var turkish = new CultureInfo("tr-TR"); - string input = "I\u0131\u0130i"; - string pattern = "[H-J][\u0131-\u0140][\u0120-\u0130][h-j]"; - - Regex regex = RegexHelpers.CreateRegexInCulture(pattern, RegexOptions.IgnoreCase | RegexHelpers.RegexOptionNonBacktracking, turkish); + foreach (RegexEngine engine in RegexHelpers.AvailableEngines) + { + yield return new object[] { engine, "I\u0131\u0130i", RegexOptions.None, "I\u0131\u0130i" }; + yield return new object[] { engine, "I\u0131\u0130i", RegexOptions.IgnoreCase, "I\u0131\u0130i" }; + if (!RegexHelpers.IsNonBacktracking(engine)) + { + yield return new object[] { engine, "I\u0131\u0130i", RegexOptions.IgnoreCase | RegexOptions.ECMAScript, "" }; + } + } + } - // The pattern must trivially match the input because all of the letters fall in the given intervals - // Ignoring case can only add more letters here -- not REMOVE letters - Assert.True(regex.IsMatch(input)); + [Theory] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60568", TestPlatforms.Android)] + [MemberData(nameof(TurkishCulture_MatchesWordChar_MemberData))] + public async Task TurkishCulture_MatchesWordChar(RegexEngine engine, string input, RegexOptions options, string expectedResult) + { + using (new ThreadCultureChange(new CultureInfo("tr-TR"))) + { + Regex regex = await RegexHelpers.GetRegexAsync(engine, @"\w*", options); + Assert.Equal(expectedResult, regex.Match(input).Value); + } } public static IEnumerable Match_In_Different_Cultures_TestData() { CultureInfo invariant = CultureInfo.InvariantCulture; - CultureInfo current = CultureInfo.CurrentCulture; + CultureInfo enUS = new CultureInfo("en-US"); CultureInfo turkish = new CultureInfo("tr-TR"); - foreach (RegexOptions options in RegexOptionsExtended()) + foreach (RegexEngine engine in RegexHelpers.AvailableEngines) { // \u0130 (Turkish I with dot) and \u0131 (Turkish i without dot) are unrelated characters in general // Expected answers in the default en-US culture - yield return new object[] { "(?i:I)", options, current, "xy\u0131ab", "" }; - yield return new object[] { "(?i:iI+)", options, current, "abcIIIxyz", "III" }; - yield return new object[] { "(?i:iI+)", options, current, "abcIi\u0130xyz", "Ii\u0130" }; - yield return new object[] { "(?i:iI+)", options, current, "abcI\u0130ixyz", "I\u0130i" }; - yield return new object[] { "(?i:iI+)", options, current, "abc\u0130IIxyz", "\u0130II" }; - yield return new object[] { "(?i:iI+)", options, current, "abc\u0130\u0131Ixyz", "" }; - yield return new object[] { "(?i:iI+)", options, current, "abc\u0130Iixyz", "\u0130Ii" }; - yield return new object[] { "(?i:[^IJKLM]I)", options, current, "ii\u0130i\u0131ab", "" }; + yield return new object[] { "(?i:I)", engine, enUS, "xy\u0131ab", "" }; + yield return new object[] { "(?i:iI+)", engine, enUS, "abcIIIxyz", "III" }; + yield return new object[] { "(?i:iI+)", engine, enUS, "abcIi\u0130xyz", "Ii\u0130" }; + yield return new object[] { "(?i:iI+)", engine, enUS, "abcI\u0130ixyz", "I\u0130i" }; + yield return new object[] { "(?i:iI+)", engine, enUS, "abc\u0130IIxyz", "\u0130II" }; + yield return new object[] { "(?i:iI+)", engine, enUS, "abc\u0130\u0131Ixyz", "" }; + yield return new object[] { "(?i:iI+)", engine, enUS, "abc\u0130Iixyz", "\u0130Ii" }; + yield return new object[] { "(?i:[^IJKLM]I)", engine, enUS, "ii\u0130i\u0131ab", "" }; // Expected answers in the invariant culture - yield return new object[] { "(?i:I)", options, invariant, "xy\u0131ab", "" }; - yield return new object[] { "(?i:iI+)", options, invariant, "abcIIIxyz", "III" }; - yield return new object[] { "(?i:iI+)", options, invariant, "abc\u0130\u0131Ixyz", "" }; + yield return new object[] { "(?i:I)", engine, invariant, "xy\u0131ab", "" }; + yield return new object[] { "(?i:iI+)", engine, invariant, "abcIIIxyz", "III" }; + yield return new object[] { "(?i:iI+)", engine, invariant, "abc\u0130\u0131Ixyz", "" }; // Expected answers in the Turkish culture // @@ -281,17 +258,17 @@ public static IEnumerable Match_In_Different_Cultures_TestData() // https://github.com/dotnet/runtime/issues/60568 if (!PlatformDetection.IsAndroid) { - yield return new object[] { "(?i:I)", options, turkish, "xy\u0131ab", "\u0131" }; - yield return new object[] { "(?i:iI+)", options, turkish, "abcIIIxyz", "" }; - yield return new object[] { "(?i:iI+)", options, turkish, "abcIi\u0130xyz", "" }; - yield return new object[] { "(?i:iI+)", options, turkish, "abcI\u0130ixyz", "" }; - yield return new object[] { "(?i:[^IJKLM]I)", options, turkish, "ii\u0130i\u0131ab", "i\u0131" }; + yield return new object[] { "(?i:I)", engine, turkish, "xy\u0131ab", "\u0131" }; + yield return new object[] { "(?i:iI+)", engine, turkish, "abcIIIxyz", "" }; + yield return new object[] { "(?i:iI+)", engine, turkish, "abcIi\u0130xyz", "" }; + yield return new object[] { "(?i:iI+)", engine, turkish, "abcI\u0130ixyz", "" }; + yield return new object[] { "(?i:[^IJKLM]I)", engine, turkish, "ii\u0130i\u0131ab", "i\u0131" }; } // None and Compiled are separated into the Match_In_Different_Cultures_CriticalCases test - if (options == RegexHelpers.RegexOptionNonBacktracking) + if (RegexHelpers.IsNonBacktracking(engine)) { - foreach (object[] data in Match_In_Different_Cultures_CriticalCases_TestData_For(options)) + foreach (object[] data in Match_In_Different_Cultures_CriticalCases_TestData_For(engine)) { yield return data; } @@ -299,39 +276,39 @@ public static IEnumerable Match_In_Different_Cultures_TestData() } } - public static IEnumerable Match_In_Different_Cultures_CriticalCases_TestData_For(RegexOptions options) + public static IEnumerable Match_In_Different_Cultures_CriticalCases_TestData_For(RegexEngine engine) { CultureInfo invariant = CultureInfo.InvariantCulture; CultureInfo turkish = new CultureInfo("tr-TR"); // Expected answers in the invariant culture - yield return new object[] { "(?i:iI+)", options, invariant, "abcIi\u0130xyz", "Ii" }; // <-- failing for None, Compiled - yield return new object[] { "(?i:iI+)", options, invariant, "abcI\u0130ixyz", "" }; // <-- failing for Compiled - yield return new object[] { "(?i:iI+)", options, invariant, "abc\u0130IIxyz", "II" }; // <-- failing for Compiled - yield return new object[] { "(?i:iI+)", options, invariant, "abc\u0130Iixyz", "Ii" }; // <-- failing for Compiled - yield return new object[] { "(?i:[^IJKLM]I)", options, invariant, "ii\u0130i\u0131ab", "\u0130i" }; // <-- failing for None, Compiled + yield return new object[] { "(?i:iI+)", engine, invariant, "abcIi\u0130xyz", "Ii" }; // <-- failing for None, Compiled + yield return new object[] { "(?i:iI+)", engine, invariant, "abcI\u0130ixyz", "" }; // <-- failing for Compiled + yield return new object[] { "(?i:iI+)", engine, invariant, "abc\u0130IIxyz", "II" }; // <-- failing for Compiled + yield return new object[] { "(?i:iI+)", engine, invariant, "abc\u0130Iixyz", "Ii" }; // <-- failing for Compiled + yield return new object[] { "(?i:[^IJKLM]I)", engine, invariant, "ii\u0130i\u0131ab", "\u0130i" }; // <-- failing for None, Compiled // Expected answers in the Turkish culture // Android produces unexpected results for tr-TR // https://github.com/dotnet/runtime/issues/60568 if (!PlatformDetection.IsAndroid) { - yield return new object[] { "(?i:iI+)", options, turkish, "abc\u0130IIxyz", "\u0130II" }; // <-- failing for None, Compiled - yield return new object[] { "(?i:iI+)", options, turkish, "abc\u0130\u0131Ixyz", "\u0130\u0131I" }; // <-- failing for None, Compiled - yield return new object[] { "(?i:iI+)", options, turkish, "abc\u0130Iixyz", "\u0130I" }; // <-- failing for None, Compiled + yield return new object[] { "(?i:iI+)", engine, turkish, "abc\u0130IIxyz", "\u0130II" }; // <-- failing for None, Compiled + yield return new object[] { "(?i:iI+)", engine, turkish, "abc\u0130\u0131Ixyz", "\u0130\u0131I" }; // <-- failing for None, Compiled + yield return new object[] { "(?i:iI+)", engine, turkish, "abc\u0130Iixyz", "\u0130I" }; // <-- failing for None, Compiled } } public static IEnumerable Match_In_Different_Cultures_CriticalCases_TestData() => - Match_In_Different_Cultures_CriticalCases_TestData_For(RegexOptions.None).Union(Match_In_Different_Cultures_CriticalCases_TestData_For(RegexOptions.Compiled)); + Match_In_Different_Cultures_CriticalCases_TestData_For(RegexEngine.Interpreter).Union(Match_In_Different_Cultures_CriticalCases_TestData_For(RegexEngine.Compiled)); [ActiveIssue("https://github.com/dotnet/runtime/issues/60899", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/60697", TestPlatforms.iOS | TestPlatforms.tvOS)] [Theory] [MemberData(nameof(Match_In_Different_Cultures_TestData))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/60697", TestPlatforms.iOS | TestPlatforms.tvOS)] - public void Match_In_Different_Cultures(string pattern, RegexOptions options, CultureInfo culture, string input, string match_expected) + public async Task Match_In_Different_Cultures(string pattern, RegexEngine engine, CultureInfo culture, string input, string match_expected) { - Regex r = RegexHelpers.CreateRegexInCulture(pattern, options, culture); + Regex r = await RegexHelpers.GetRegexAsync(engine, pattern, RegexOptions.None, culture); Match match = r.Match(input); Assert.Equal(match_expected, match.Value); } @@ -339,9 +316,9 @@ public void Match_In_Different_Cultures(string pattern, RegexOptions options, Cu [ActiveIssue("Incorrect treatment of IgnoreCase in Turkish and Invariant cultures, https://github.com/dotnet/runtime/issues/58956, https://github.com/dotnet/runtime/issues/58958 ")] [Theory] [MemberData(nameof(Match_In_Different_Cultures_CriticalCases_TestData))] - public void Match_In_Different_Cultures_CriticalCases(string pattern, RegexOptions options, CultureInfo culture, string input, string match_expected) + public async Task Match_In_Different_Cultures_CriticalCases(string pattern, RegexEngine engine, CultureInfo culture, string input, string match_expected) { - Regex r = RegexHelpers.CreateRegexInCulture(pattern, options, culture); + Regex r = await RegexHelpers.GetRegexAsync(engine, pattern, RegexOptions.None, culture); Match match = r.Match(input); Assert.Equal(match_expected, match.Value); } @@ -367,9 +344,8 @@ public void Match_InvariantCulture_None_vs_Compiled() ///
[OuterLoop("May take several seconds due to large number of cultures tested")] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] - [Theory] - [MemberData(nameof(RegexOptionsExtended_MemberData))] - public void TestIgnoreCaseRelation(RegexOptions options) + [Fact] + public void TestIgnoreCaseRelation() { // these 22 characters are considered case-insensitive by regex, while they are case-sensitive outside regex // but they are only case-sensitive in an asymmmetrical way: tolower(c)=c, tolower(toupper(c)) != c @@ -380,10 +356,10 @@ public void TestIgnoreCaseRelation(RegexOptions options) { char cU = char.ToUpper(c); Assert.NotEqual(c, cU); - Assert.False(Regex.IsMatch(c.ToString(), cU.ToString(), options | RegexOptions.IgnoreCase)); + Assert.False(Regex.IsMatch(c.ToString(), cU.ToString(), RegexOptions.IgnoreCase)); } - Assert.False(Regex.IsMatch(Turkish_i_withoutDot.ToString(), "i", options | RegexOptions.IgnoreCase)); + Assert.False(Regex.IsMatch(Turkish_i_withoutDot.ToString(), "i", RegexOptions.IgnoreCase)); // as baseline it is assumed the the invariant culture does not change HashSet[] inv_table = ComputeIgnoreCaseTable(CultureInfo.InvariantCulture, treatedAsCaseInsensitive); diff --git a/src/libraries/System.Text.RegularExpressions/tests/RegexExperiment.cs b/src/libraries/System.Text.RegularExpressions/tests/RegexExperiment.cs index 85d17ebc4dd486..3f27aab3d89b86 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/RegexExperiment.cs +++ b/src/libraries/System.Text.RegularExpressions/tests/RegexExperiment.cs @@ -33,11 +33,14 @@ public class RegexExperiment /// Output directory for generated dgml files. private static string DgmlOutputDirectoryPath => Path.Combine(s_tmpWorkingDir, "dgml"); - private static string ExperimentDirectoryPath => Path.Combine(s_tmpWorkingDir, "experiments"); - - [ConditionalFact(nameof(Enabled))] + [Fact] public void RegenerateUnicodeTables() { + if (!Enabled) + { + return; + } + MethodInfo? genUnicode = typeof(Regex).GetMethod("GenerateUnicodeTables", BindingFlags.NonPublic | BindingFlags.Static); // GenerateUnicodeTables is not available in Release build if (genUnicode is not null) @@ -46,9 +49,6 @@ public void RegenerateUnicodeTables() } } - private static void WriteOutput(string message) => - File.AppendAllText(OutputFilePath, message); - /// Save the regex as a DFA in DGML format in the textwriter. private static bool TrySaveDGML(Regex regex, TextWriter writer, int bound = -1, bool hideStateInfo = false, bool addDotStar = false, bool inReverse = false, bool onlyDFAinfo = false, int maxLabelLength = -1, bool asNFA = false) { @@ -85,60 +85,6 @@ internal static void ViewDGML(Regex regex, int bound = -1, bool hideStateInfo = } } - /// - /// The intent is that this method is run in realease build for lightweight performance testing. - /// One can e.g. open the outputfile in emacs with AUTO-REVERT-ON in order to follow the progress in real time. - /// It will print timing info and match info for both DFA, Compiled option and None. - /// Place sample regexes in the regexesfile (one per line) and sample input in inputfile. - /// It will essentially produce a csv file with the info: - /// regexnr, matchtime_DFA, result_DFA, matchtime_Compiled, result_Compiled, matchtime_None, result_None, - /// where result_.. is one of - /// Yes(index,length) - /// No - /// TIMEOUT - /// ERROR - /// and in the case of TIMEOUT or ERROR time is 10000 (the timeout limit of 10sec) - /// - [ConditionalFact(nameof(Enabled))] - public void TestRunPerformance() - { - if (!Directory.Exists(ExperimentDirectoryPath)) - { - Directory.CreateDirectory(ExperimentDirectoryPath); - } - - string[] dirs = Directory.GetDirectories(ExperimentDirectoryPath); - if (dirs.Length == 0) - { - WriteOutput("\nExperiments directory is empty"); - return; - } - - DirectoryInfo experimentDI = Directory.GetParent(dirs[0]); - DirectoryInfo[] experiments = - Array.FindAll(experimentDI.GetDirectories(), - di => ((di.Attributes & FileAttributes.Hidden) != (FileAttributes.Hidden)) && - Array.Exists(di.GetFiles(), f => f.Name.Equals("regexes.txt")) && - Array.Exists(di.GetFiles(), f => f.Name.Equals("input.txt"))); - if (experiments.Length == 0) - { - WriteOutput("\nExperiments directory has no indiviual experiment subdirectories containing files 'regexes.txt' and 'input.txt'."); - return; - } - - for (int i = 0; i < experiments.Length; i++) - { - string input = File.ReadAllText(Path.Combine(experiments[i].FullName, "input.txt")); - string[] rawRegexes = File.ReadAllLines(Path.Combine(experiments[i].FullName, "regexes.txt")); - - WriteOutput($"\n---------- {experiments[i].Name} ----------"); - for (int r = 0; r < rawRegexes.Length; r++) - { - TestRunRegex((r + 1).ToString(), rawRegexes[r], input); - } - } - } - private static long MeasureMatchTime(Regex re, string input, out Match match) { try @@ -178,9 +124,14 @@ private static string And(params string[] regexes) /// private static string Not(string regex) => $"(?({regex})[0-[0]]|.*)"; - [ConditionalFact(nameof(Enabled))] + [Fact] public void ViewSampleRegexInDGML() { + if (!Enabled) + { + return; + } + try { //string rawregex = @"\bis\w*\b"; @@ -233,45 +184,6 @@ static bool TrySaveDGML(Regex regex, TextWriter writer, int bound = -1, bool hid } } - private void TestRunRegex(string name, string rawregex, string input, bool viewDGML = false, bool dotStar = false) - { - var reNone = new Regex(rawregex, RegexOptions.None, new TimeSpan(0, 0, 10)); - var reCompiled = new Regex(rawregex, RegexOptions.Compiled, new TimeSpan(0, 0, 10)); - var reNonBacktracking = new Regex(rawregex, RegexOptions.NonBacktracking); - - if (viewDGML) - ViewDGML(reNonBacktracking, addDotStar: dotStar); - WriteOutput($"\n{name}"); - - // First call in each case is a warmup - - // None - MeasureMatchTime(reNone, input, out _); - long tN = MeasureMatchTime(reNone, input, out Match mN); - WriteMatchOutput(tN, mN); - - // Compiled - MeasureMatchTime(reCompiled, input, out _); - long tC = MeasureMatchTime(reCompiled, input, out Match mC); - WriteMatchOutput(tC, mC); - - // Non-Backtracking - MeasureMatchTime(reNonBacktracking, input, out _); - long tD = MeasureMatchTime(reNonBacktracking, input, out Match mD); - WriteMatchOutput(tD, mD); - - void WriteMatchOutput(long t, Match m) - { - WriteOutput(t switch - { - -1 => ",10000,TIMEOUT", - -2 => ",10000,ERROR", - _ when m.Success => $",{t},Yes({m.Index}:{m.Length})", - _ => $",{t},No" - }); - } - } - #region Tests involving Intersection and Complement // Currently only run in DEBUG mode in the NonBacktracking engine [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNetCore))] @@ -520,8 +432,9 @@ public void TestConjunctionOverCounting(string conjunct1, string conjunct2, stri Assert.Contains("conditional", e.Message); } } + #endregion - + #region Random input generation tests public static IEnumerable GenerateRandomMembers_TestData() { string[] patterns = new string[] { @"pa[5\$s]{2}w[o0]rd$", @"\w\d+", @"\d{10}" }; @@ -536,7 +449,7 @@ public static IEnumerable GenerateRandomMembers_TestData() { foreach (string input in inputs) { - yield return new object[] {engine, pattern, input, !negative }; + yield return new object[] { engine, pattern, input, !negative }; } } } diff --git a/src/libraries/System.Text.RegularExpressions/tests/RegexGeneratorHelper.netcoreapp.cs b/src/libraries/System.Text.RegularExpressions/tests/RegexGeneratorHelper.netcoreapp.cs index 47ece73defcc76..3c77f7110b0730 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/RegexGeneratorHelper.netcoreapp.cs +++ b/src/libraries/System.Text.RegularExpressions/tests/RegexGeneratorHelper.netcoreapp.cs @@ -111,8 +111,8 @@ internal static async Task SourceGenRegexAsync( if (generatorResults.Diagnostics.Length != 0) { throw new ArgumentException( - string.Join(Environment.NewLine, generatorResults.Diagnostics) + Environment.NewLine + - string.Join(Environment.NewLine, generatorResults.GeneratedTrees.Select(t => NumberLines(t.ToString())))); + string.Join(Environment.NewLine, generatorResults.GeneratedTrees.Select(t => NumberLines(t.ToString()))) + Environment.NewLine + + string.Join(Environment.NewLine, generatorResults.Diagnostics)); } // Compile the assembly to a stream @@ -122,8 +122,8 @@ internal static async Task SourceGenRegexAsync( if (!results.Success || results.Diagnostics.Length != 0) { throw new ArgumentException( - string.Join(Environment.NewLine, results.Diagnostics.Concat(generatorResults.Diagnostics)) + Environment.NewLine + - string.Join(Environment.NewLine, generatorResults.GeneratedTrees.Select(t => NumberLines(t.ToString())))); + string.Join(Environment.NewLine, generatorResults.GeneratedTrees.Select(t => NumberLines(t.ToString()))) + Environment.NewLine + + string.Join(Environment.NewLine, results.Diagnostics.Concat(generatorResults.Diagnostics))); } dll.Position = 0; diff --git a/src/libraries/System.Text.RegularExpressions/tests/RegexReductionTests.cs b/src/libraries/System.Text.RegularExpressions/tests/RegexReductionTests.cs index ad5ca8d0754d98..d541964bfb6f05 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/RegexReductionTests.cs +++ b/src/libraries/System.Text.RegularExpressions/tests/RegexReductionTests.cs @@ -324,6 +324,13 @@ private static int GetMinRequiredLength(Regex r) [InlineData("[^\n]*", ".*")] [InlineData("(?>[^\n]*)", "(?>.*)")] [InlineData("[^\n]*?", ".*?")] + // Set reduction + [InlineData("[\u0001-\uFFFF]", "[^\u0000]")] + [InlineData("[\u0000-\uFFFE]", "[^\uFFFF]")] + [InlineData("[\u0000-AB-\uFFFF]", "[\u0000-\uFFFF]")] + [InlineData("[ABC-EG-J]", "[A-EG-J]")] + [InlineData("[\u0000-AC-\uFFFF]", "[^B]")] + [InlineData("[\u0000-AF-\uFFFF]", "[^B-E]")] // Large loop patterns [InlineData("a*a*a*a*a*a*a*b*b*?a+a*", "a*b*b*?a+")] [InlineData("a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "a{0,30}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")] @@ -363,6 +370,7 @@ private static int GetMinRequiredLength(Regex r) [InlineData("(?i:abcde)|(?i:abcdf)", "(?i:abcd[ef])")] [InlineData("xyz(?:(?i:abcde)|(?i:abcdf))", "xyz(?i:abcd[ef])")] [InlineData("bonjour|hej|ciao|shalom|zdravo|pozdrav|hallo|hola|hello|hey|witam|tere|bonjou|salam|helo|sawubona", "(?>bonjou(?>r|)|h(?>e(?>j|(?>l(?>lo|o)|y))|allo|ola)|ciao|s(?>halom|a(?>lam|wubona))|zdravo|pozdrav|witam|tere)")] + [InlineData("\\w\\d123|\\w\\dabc", "\\w\\d(?:123|abc)")] // Auto-atomicity [InlineData("a*b", "(?>a*)b")] [InlineData("a*b+", "(?>a*)b+")] @@ -384,6 +392,16 @@ private static int GetMinRequiredLength(Regex r) [InlineData("(?:w*)+\\.", "(?>w*)+\\.")] [InlineData("(a[bcd]e*)*fg", "(a[bcd](?>e*))*fg")] [InlineData("(\\w[bcd]\\s*)*fg", "(\\w[bcd](?>\\s*))*fg")] + // IgnoreCase set creation + [InlineData("(?i)abcd", "[Aa][Bb][Cc][Dd]")] + [InlineData("(?i)abcd|efgh", "[Aa][Bb][Cc][Dd]|[Ee][Ff][Gg][Hh]")] + [InlineData("(?i)a|b", "[AaBb]")] + [InlineData("(?i)[abcd]", "[AaBbCcDd]")] + [InlineData("(?i)[acexyz]", "[AaCcEeXxYyZz]")] + [InlineData("(?i)\\w", "\\w")] + [InlineData("(?i)\\d", "\\d")] + [InlineData("(?i).", ".")] + [InlineData("(?i)\\$", "\\$")] public void PatternsReduceIdentically(string pattern1, string pattern2) { string result1 = GetRegexCodes(new Regex(pattern1)); @@ -392,12 +410,6 @@ public void PatternsReduceIdentically(string pattern1, string pattern2) { throw new Xunit.Sdk.EqualException(result2, result1); } - - Assert.NotEqual(GetRegexCodes(new Regex(pattern1, RegexOptions.RightToLeft)), GetRegexCodes(new Regex(pattern2))); - if (!pattern1.Contains("?i:") && !pattern2.Contains("?i:")) - { - Assert.NotEqual(GetRegexCodes(new Regex(pattern1, RegexOptions.IgnoreCase)), GetRegexCodes(new Regex(pattern2))); - } } [Theory] @@ -443,7 +455,6 @@ public void PatternsReduceIdentically(string pattern1, string pattern2) // Not reducing branches of alternations with different casing [InlineData("(?i:abcd)|abcd", "abcd|abcd")] [InlineData("abcd|(?i:abcd)", "abcd|abcd")] - [InlineData("abc(?:(?i:e)|f)", "abc[ef]")] // Not applying auto-atomicity [InlineData("a*b*", "(?>a*)b*")] [InlineData("[ab]*[^a]", "(?>[ab]*)[^a]")] @@ -463,9 +474,12 @@ public void PatternsReduceIdentically(string pattern1, string pattern2) [InlineData("(?:ab|cd|ae)f", "(?>ab|cd|ae)f")] public void PatternsReduceDifferently(string pattern1, string pattern2) { - var r1 = new Regex(pattern1); - var r2 = new Regex(pattern2); - Assert.NotEqual(GetRegexCodes(r1), GetRegexCodes(r2)); + string result1 = GetRegexCodes(new Regex(pattern1)); + string result2 = GetRegexCodes(new Regex(pattern2)); + if (result1 == result2) + { + throw new Xunit.Sdk.EqualException(result2, result1); + } } [Theory] diff --git a/src/libraries/System.Threading.AccessControl/src/System.Threading.AccessControl.csproj b/src/libraries/System.Threading.AccessControl/src/System.Threading.AccessControl.csproj index 4ca5ab65e37a92..577a87e8461572 100644 --- a/src/libraries/System.Threading.AccessControl/src/System.Threading.AccessControl.csproj +++ b/src/libraries/System.Threading.AccessControl/src/System.Threading.AccessControl.csproj @@ -61,7 +61,9 @@ System.Security.AccessControl.SemaphoreSecurity + + diff --git a/src/libraries/System.Threading.Tasks/tests/CancellationTokenTests.cs b/src/libraries/System.Threading.Tasks/tests/CancellationTokenTests.cs index 63a37468eb3d6a..153d0db3d6322a 100644 --- a/src/libraries/System.Threading.Tasks/tests/CancellationTokenTests.cs +++ b/src/libraries/System.Threading.Tasks/tests/CancellationTokenTests.cs @@ -1779,7 +1779,7 @@ public override void Send(SendOrPostCallback d, object state) t.Wait(); if (marshalledException != null) - throw new AggregateException("DUMMY: ThreadCrossingSynchronizationContext.Send captured and propogated an exception", + throw new AggregateException("DUMMY: ThreadCrossingSynchronizationContext.Send captured and propagated an exception", marshalledException); } } diff --git a/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs b/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs index d85fe81ffac8fa..281c26d326d9c7 100644 --- a/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs +++ b/src/libraries/System.Threading.Tasks/tests/Task/TaskRunSyncTests.cs @@ -314,7 +314,7 @@ internal void RealRun() if (_postRunSyncAction == PostRunSyncAction.Wait) _task.Wait(0); if (_workloadType == WorkloadType.ThrowException) - Assert.True(false, string.Format("expected failure is not propogated out of Wait")); + Assert.True(false, string.Format("expected failure is not propagated out of Wait")); } catch (AggregateException ae) { diff --git a/src/libraries/System.Threading.Tasks/tests/Task/TaskWaitAllAnyTest.cs b/src/libraries/System.Threading.Tasks/tests/Task/TaskWaitAllAnyTest.cs index f597310020d626..0068a8203cf97c 100644 --- a/src/libraries/System.Threading.Tasks/tests/Task/TaskWaitAllAnyTest.cs +++ b/src/libraries/System.Threading.Tasks/tests/Task/TaskWaitAllAnyTest.cs @@ -351,7 +351,7 @@ private void Verify() if (workType == WorkloadType.Exceptional) { - // verify whether exception has(not) been propogated + // verify whether exception has(not) been propagated expCaught = VerifyException((ex) => { TPLTestException expectedExp = ex as TPLTestException; diff --git a/src/libraries/System.Threading/tests/SemaphoreSlimTests.cs b/src/libraries/System.Threading/tests/SemaphoreSlimTests.cs index 2682166b24c512..7aabd01c39f1e2 100644 --- a/src/libraries/System.Threading/tests/SemaphoreSlimTests.cs +++ b/src/libraries/System.Threading/tests/SemaphoreSlimTests.cs @@ -2,7 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Runtime.CompilerServices; using System.Threading.Tasks; +using Microsoft.DotNet.RemoteExecutor; using Xunit; namespace System.Threading.Tests @@ -615,5 +617,28 @@ public static void TestConcurrentWaitAndWaitAsync(int syncWaiters, int asyncWait semaphore.Release(totalWaiters / 2); Task.WaitAll(tasks); } + + [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] + public void WaitAsync_Timeout_NoUnhandledException() + { + RemoteExecutor.Invoke(async () => + { + Exception error = null; + TaskScheduler.UnobservedTaskException += (s, e) => Volatile.Write(ref error, e.Exception); + + var sem = new SemaphoreSlim(0); + for (int i = 0; i < 2; ++i) + { + await sem.WaitAsync(1); + GC.Collect(); + GC.WaitForPendingFinalizers(); + } + + if (Volatile.Read(ref error) is Exception e) + { + throw e; + } + }).Dispose(); + } } } diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/Transaction.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/Transaction.cs index e6594884552a97..531f4e8ca3a7f4 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/Transaction.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/Transaction.cs @@ -1150,7 +1150,7 @@ internal enum DefaultComContextState // The TxLookup enum is used internally to detect where the ambient context needs to be stored or looked up. // Default - Used internally when looking up Transaction.Current. // DefaultCallContext - Used when TransactionScope with async flow option is enabled. Internally we will use CallContext to store the ambient transaction. - // Default TLS - Used for legacy/syncronous TransactionScope. Internally we will use TLS to store the ambient transaction. + // Default TLS - Used for legacy/synchronous TransactionScope. Internally we will use TLS to store the ambient transaction. // internal enum TxLookup { diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionInformation.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionInformation.cs index 1519d81e496555..ff764d94b8caa8 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionInformation.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionInformation.cs @@ -51,7 +51,7 @@ public Guid DistributedIdentifier try { - // syncronize to avoid potential race between accessing the DistributerIdentifier + // synchronize to avoid potential race between accessing the DistributerIdentifier // and getting the transaction information entry populated... lock (_internalTransaction) diff --git a/src/libraries/System.Transactions.Local/tests/AsyncTransactionScopeTests.cs b/src/libraries/System.Transactions.Local/tests/AsyncTransactionScopeTests.cs index 05dce18d7129b9..baabd24424dee3 100644 --- a/src/libraries/System.Transactions.Local/tests/AsyncTransactionScopeTests.cs +++ b/src/libraries/System.Transactions.Local/tests/AsyncTransactionScopeTests.cs @@ -399,7 +399,7 @@ public void AsyncTSTest(int variation) break; } - // Final test - wrap the DoAsyncTSTaskWorkAsync in syncronous scope + // Final test - wrap the DoAsyncTSTaskWorkAsync in synchronous scope case 54: { string txId1 = null; @@ -437,7 +437,7 @@ public void AsyncTSTest(int variation) [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [InlineData(true, false, null)] [InlineData(true, true, null)] - public void AsyncTSAndDependantClone(bool requiresNew, bool syncronizeScope, string txId) + public void AsyncTSAndDependantClone(bool requiresNew, bool synchronizeScope, string txId) { string txId1 = null; string txId2 = null; @@ -458,9 +458,9 @@ public void AsyncTSAndDependantClone(bool requiresNew, bool syncronizeScope, str { try { - // Since we use BlockCommitUntilComplete dependent transaction to syncronize the root TransactionScope, the ambient Tx may not be available and will be disposed and block on Commit. - // The flag will ensure we explicitly syncronize before disposing the root TransactionScope and the ambient transaction will still be available in the Task. - if (syncronizeScope) + // Since we use BlockCommitUntilComplete dependent transaction to synchronize the root TransactionScope, the ambient Tx may not be available and will be disposed and block on Commit. + // The flag will ensure we explicitly synchronize before disposing the root TransactionScope and the ambient transaction will still be available in the Task. + if (synchronizeScope) { txId2 = AssertAndGetCurrentTransactionId(); } @@ -472,7 +472,7 @@ public void AsyncTSAndDependantClone(bool requiresNew, bool syncronizeScope, str scope2.Complete(); } - if (syncronizeScope) + if (synchronizeScope) { txId4 = AssertAndGetCurrentTransactionId(); } @@ -483,7 +483,7 @@ public void AsyncTSAndDependantClone(bool requiresNew, bool syncronizeScope, str dependentTx.Dispose(); } - if (syncronizeScope) + if (synchronizeScope) { txId5 = AssertAndGetCurrentTransactionId(); } @@ -500,7 +500,7 @@ public void AsyncTSAndDependantClone(bool requiresNew, bool syncronizeScope, str txId6 = AssertAndGetCurrentTransactionId(); - if (syncronizeScope) + if (synchronizeScope) { task1.Wait(); } @@ -513,7 +513,7 @@ public void AsyncTSAndDependantClone(bool requiresNew, bool syncronizeScope, str Assert.Equal(txId1, txId3); Assert.Equal(txId3, txId6); - if (syncronizeScope) + if (synchronizeScope) { Assert.Equal(txId1, txId2); Assert.Equal(txId1, txId4); diff --git a/src/libraries/System.Windows.Extensions/ref/System.Windows.Extensions.cs b/src/libraries/System.Windows.Extensions/ref/System.Windows.Extensions.cs index 057fbfc5ed3189..c1f732f2baad40 100644 --- a/src/libraries/System.Windows.Extensions/ref/System.Windows.Extensions.cs +++ b/src/libraries/System.Windows.Extensions/ref/System.Windows.Extensions.cs @@ -10,17 +10,17 @@ namespace System.Media public partial class SoundPlayer : System.ComponentModel.Component, System.Runtime.Serialization.ISerializable { public SoundPlayer() { } - public SoundPlayer(System.IO.Stream stream) { } + public SoundPlayer(System.IO.Stream? stream) { } protected SoundPlayer(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext context) { } public SoundPlayer(string soundLocation) { } public bool IsLoadCompleted { get { throw null; } } public int LoadTimeout { get { throw null; } set { } } public string SoundLocation { get { throw null; } set { } } - public System.IO.Stream Stream { get { throw null; } set { } } - public object Tag { get { throw null; } set { } } - public event System.ComponentModel.AsyncCompletedEventHandler LoadCompleted { add { } remove { } } - public event System.EventHandler SoundLocationChanged { add { } remove { } } - public event System.EventHandler StreamChanged { add { } remove { } } + public System.IO.Stream? Stream { get { throw null; } set { } } + public object? Tag { get { throw null; } set { } } + public event System.ComponentModel.AsyncCompletedEventHandler? LoadCompleted { add { } remove { } } + public event System.EventHandler? SoundLocationChanged { add { } remove { } } + public event System.EventHandler? StreamChanged { add { } remove { } } public void Load() { } public void LoadAsync() { } protected virtual void OnLoadCompleted(System.ComponentModel.AsyncCompletedEventArgs e) { } @@ -53,8 +53,8 @@ public sealed partial class X509Certificate2UI public X509Certificate2UI() { } public static void DisplayCertificate(System.Security.Cryptography.X509Certificates.X509Certificate2 certificate) { } public static void DisplayCertificate(System.Security.Cryptography.X509Certificates.X509Certificate2 certificate, System.IntPtr hwndParent) { } - public static System.Security.Cryptography.X509Certificates.X509Certificate2Collection SelectFromCollection(System.Security.Cryptography.X509Certificates.X509Certificate2Collection certificates, string title, string message, System.Security.Cryptography.X509Certificates.X509SelectionFlag selectionFlag) { throw null; } - public static System.Security.Cryptography.X509Certificates.X509Certificate2Collection SelectFromCollection(System.Security.Cryptography.X509Certificates.X509Certificate2Collection certificates, string title, string message, System.Security.Cryptography.X509Certificates.X509SelectionFlag selectionFlag, System.IntPtr hwndParent) { throw null; } + public static System.Security.Cryptography.X509Certificates.X509Certificate2Collection SelectFromCollection(System.Security.Cryptography.X509Certificates.X509Certificate2Collection certificates, string? title, string? message, System.Security.Cryptography.X509Certificates.X509SelectionFlag selectionFlag) { throw null; } + public static System.Security.Cryptography.X509Certificates.X509Certificate2Collection SelectFromCollection(System.Security.Cryptography.X509Certificates.X509Certificate2Collection certificates, string? title, string? message, System.Security.Cryptography.X509Certificates.X509SelectionFlag selectionFlag, System.IntPtr hwndParent) { throw null; } } public enum X509SelectionFlag { @@ -68,7 +68,7 @@ public partial class XamlAccessLevel { internal XamlAccessLevel() { } public System.Reflection.AssemblyName AssemblyAccessToAssemblyName { get { throw null; } } - public string PrivateAccessToTypeName { get { throw null; } } + public string? PrivateAccessToTypeName { get { throw null; } } public static System.Xaml.Permissions.XamlAccessLevel AssemblyAccessTo(System.Reflection.Assembly assembly) { throw null; } public static System.Xaml.Permissions.XamlAccessLevel AssemblyAccessTo(System.Reflection.AssemblyName assemblyName) { throw null; } public static System.Xaml.Permissions.XamlAccessLevel PrivateAccessTo(string assemblyQualifiedTypeName) { throw null; } diff --git a/src/libraries/System.Windows.Extensions/ref/System.Windows.Extensions.csproj b/src/libraries/System.Windows.Extensions/ref/System.Windows.Extensions.csproj index 324bdf24af2466..76ce42118ef059 100644 --- a/src/libraries/System.Windows.Extensions/ref/System.Windows.Extensions.csproj +++ b/src/libraries/System.Windows.Extensions/ref/System.Windows.Extensions.csproj @@ -1,6 +1,7 @@ $(NetCoreAppCurrent);$(NetCoreAppMinimum) + enable diff --git a/src/libraries/System.Windows.Extensions/src/System.Windows.Extensions.csproj b/src/libraries/System.Windows.Extensions/src/System.Windows.Extensions.csproj index 8b6ce7bb7f1f3a..6e587b9c50f8f8 100644 --- a/src/libraries/System.Windows.Extensions/src/System.Windows.Extensions.csproj +++ b/src/libraries/System.Windows.Extensions/src/System.Windows.Extensions.csproj @@ -1,7 +1,9 @@ true + annotations $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum) + enable true Provides miscellaneous Windows-specific types @@ -93,6 +95,7 @@ System.Security.Cryptography.X509Certificates.X509SelectionFlag + diff --git a/src/libraries/System.Windows.Extensions/src/System/Media/SoundPlayer.cs b/src/libraries/System.Windows.Extensions/src/System/Media/SoundPlayer.cs index 28a49eeababa84..f84f503682efcf 100644 --- a/src/libraries/System.Windows.Extensions/src/System/Media/SoundPlayer.cs +++ b/src/libraries/System.Windows.Extensions/src/System/Media/SoundPlayer.cs @@ -3,6 +3,7 @@ using System.ComponentModel; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Net; using System.Runtime.InteropServices; @@ -18,7 +19,7 @@ public class SoundPlayer : Component, ISerializable private const int BlockSize = 1024; private const int DefaultLoadTimeout = 10000; // 10 secs - private Uri _uri; + private Uri? _uri; private string _soundLocation = string.Empty; private int _loadTimeout = DefaultLoadTimeout; @@ -28,16 +29,16 @@ public class SoundPlayer : Component, ISerializable // the worker copyTask // we start the worker copyTask ONLY from entry points in the SoundPlayer API // we also set the tread to null only from the entry points in the SoundPlayer API - private Task _copyTask; - private CancellationTokenSource _copyTaskCancellation; + private Task? _copyTask; + private CancellationTokenSource? _copyTaskCancellation; // local buffer information private int _currentPos; - private Stream _stream; - private Exception _lastLoadException; + private Stream? _stream; + private Exception? _lastLoadException; private bool _doesLoadAppearSynchronous; - private byte[] _streamData; - private AsyncOperation _asyncOperation; + private byte[]? _streamData; + private AsyncOperation? _asyncOperation; private readonly SendOrPostCallback _loadAsyncOperationCompleted; // event @@ -55,7 +56,7 @@ public SoundPlayer(string soundLocation) : this() SetupSoundLocation(soundLocation ?? string.Empty); } - public SoundPlayer(Stream stream) : this() + public SoundPlayer(Stream? stream) : this() { _stream = stream; } @@ -99,7 +100,7 @@ public string SoundLocation } } - public Stream Stream + public Stream? Stream { get { @@ -126,7 +127,7 @@ public Stream Stream public bool IsLoadCompleted { get; private set; } - public object Tag { get; set; } + public object? Tag { get; set; } public void LoadAsync() { @@ -161,9 +162,9 @@ public void LoadAsync() LoadStream(false); } - private void LoadAsyncOperationCompleted(object arg) + private void LoadAsyncOperationCompleted(object? arg) { - OnLoadCompleted((AsyncCompletedEventArgs)arg); + OnLoadCompleted((AsyncCompletedEventArgs)arg!); } // called for loading a stream synchronously @@ -227,6 +228,7 @@ private void LoadAndPlay(int flags) else { LoadSync(); + Debug.Assert(_streamData != null); ValidateSoundData(_streamData); Interop.WinMM.PlaySound(_streamData, IntPtr.Zero, Interop.WinMM.SND_MEMORY | Interop.WinMM.SND_NODEFAULT | flags); } @@ -271,7 +273,9 @@ private void LoadSync() _stream = webResponse.GetResponseStream(); } - if (_stream.CanSeek) + // DO NOT assert - NRE is expected for null stream + // See SoundPlayerTests.Load_NullStream_ThrowsNullReferenceException + if (_stream!.CanSeek) { // if we can get data synchronously, then get it LoadStream(true); @@ -304,6 +308,7 @@ private void LoadSync() private void LoadStream(bool loadSync) { + Debug.Assert(_stream != null); if (loadSync && _stream.CanSeek) { int streamLen = (int)_stream.Length; @@ -339,9 +344,9 @@ public void PlayLooping() LoadAndPlay(Interop.WinMM.SND_LOOP | Interop.WinMM.SND_ASYNC); } - private static Uri ResolveUri(string partialUri) + private static Uri? ResolveUri(string partialUri) { - Uri result = null; + Uri? result = null; try { result = new Uri(partialUri); @@ -399,7 +404,7 @@ private void SetupSoundLocation(string soundLocation) } } - private void SetupStream(Stream stream) + private void SetupStream(Stream? stream) { if (_copyTask != null) { @@ -420,10 +425,10 @@ private void SetupStream(Stream stream) public void Stop() { - Interop.WinMM.PlaySound((byte[])null, IntPtr.Zero, Interop.WinMM.SND_PURGE); + Interop.WinMM.PlaySound((byte[]?)null, IntPtr.Zero, Interop.WinMM.SND_PURGE); } - public event AsyncCompletedEventHandler LoadCompleted + public event AsyncCompletedEventHandler? LoadCompleted { add { @@ -435,7 +440,7 @@ public event AsyncCompletedEventHandler LoadCompleted } } - public event EventHandler SoundLocationChanged + public event EventHandler? SoundLocationChanged { add { @@ -447,7 +452,7 @@ public event EventHandler SoundLocationChanged } } - public event EventHandler StreamChanged + public event EventHandler? StreamChanged { add { @@ -461,22 +466,22 @@ public event EventHandler StreamChanged protected virtual void OnLoadCompleted(AsyncCompletedEventArgs e) { - ((AsyncCompletedEventHandler)Events[s_eventLoadCompleted])?.Invoke(this, e); + ((AsyncCompletedEventHandler?)Events[s_eventLoadCompleted])?.Invoke(this, e); } protected virtual void OnSoundLocationChanged(EventArgs e) { - ((EventHandler)Events[s_eventSoundLocationChanged])?.Invoke(this, e); + ((EventHandler?)Events[s_eventSoundLocationChanged])?.Invoke(this, e); } protected virtual void OnStreamChanged(EventArgs e) { - ((EventHandler)Events[s_eventStreamChanged])?.Invoke(this, e); + ((EventHandler?)Events[s_eventStreamChanged])?.Invoke(this, e); } private async Task CopyStreamAsync(CancellationToken cancellationToken) { - Exception exception = null; + Exception? exception = null; try { // setup the http stream @@ -485,7 +490,7 @@ private async Task CopyStreamAsync(CancellationToken cancellationToken) #pragma warning disable SYSLIB0014 // WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead. WebRequest webRequest = WebRequest.Create(_uri); #pragma warning restore SYSLIB0014 - using (cancellationToken.Register(r => ((WebRequest)r).Abort(), webRequest)) + using (cancellationToken.Register(r => ((WebRequest)r!).Abort(), webRequest)) { WebResponse webResponse = await webRequest.GetResponseAsync().ConfigureAwait(false); _stream = webResponse.GetResponseStream(); @@ -494,6 +499,7 @@ private async Task CopyStreamAsync(CancellationToken cancellationToken) _streamData = new byte[BlockSize]; + Debug.Assert(_stream != null); int readBytes = await _stream.ReadAsync(_streamData.AsMemory(_currentPos, BlockSize), cancellationToken).ConfigureAwait(false); int totalBytes = readBytes; @@ -525,6 +531,7 @@ private async Task CopyStreamAsync(CancellationToken cancellationToken) AsyncCompletedEventArgs ea = exception is OperationCanceledException ? new AsyncCompletedEventArgs(null, cancelled: true, null) : new AsyncCompletedEventArgs(exception, cancelled: false, null); + Debug.Assert(_asyncOperation != null); _asyncOperation.PostOperationCompleted(_loadAsyncOperationCompleted, ea); } } @@ -539,18 +546,18 @@ private unsafe void ValidateSoundFile(string fileName) try { - Interop.WinMM.WAVEFORMATEX waveFormat = null; + Interop.WinMM.WAVEFORMATEX? waveFormat = null; var ckRIFF = new Interop.WinMM.MMCKINFO() { fccType = mmioFOURCC('W', 'A', 'V', 'E') }; - var ck = new Interop.WinMM.MMCKINFO(); - if (Interop.WinMM.mmioDescend(hMIO, ckRIFF, null, Interop.WinMM.MMIO_FINDRIFF) != 0) + var ck = default(Interop.WinMM.MMCKINFO); + if (Interop.WinMM.mmioDescend(hMIO, &ckRIFF, null, Interop.WinMM.MMIO_FINDRIFF) != 0) { throw new InvalidOperationException(SR.Format(SR.SoundAPIInvalidWaveFile, _soundLocation)); } - while (Interop.WinMM.mmioDescend(hMIO, ck, ckRIFF, 0) == 0) + while (Interop.WinMM.mmioDescend(hMIO, &ck, &ckRIFF, 0) == 0) { if (ck.dwDataOffset + ck.cksize > ckRIFF.dwDataOffset + ckRIFF.cksize) { @@ -584,7 +591,7 @@ private unsafe void ValidateSoundFile(string fileName) // multiple formats? } } - Interop.WinMM.mmioAscend(hMIO, ck, 0); + Interop.WinMM.mmioAscend(hMIO, &ck, 0); } if (waveFormat == null) diff --git a/src/libraries/System.Windows.Extensions/src/System/Media/SystemSounds.cs b/src/libraries/System.Windows.Extensions/src/System/Media/SystemSounds.cs index 145b53cd8c1060..b6bffe257a733a 100644 --- a/src/libraries/System.Windows.Extensions/src/System/Media/SystemSounds.cs +++ b/src/libraries/System.Windows.Extensions/src/System/Media/SystemSounds.cs @@ -5,11 +5,11 @@ namespace System.Media { public static class SystemSounds { - private static volatile SystemSound s_asterisk; - private static volatile SystemSound s_beep; - private static volatile SystemSound s_exclamation; - private static volatile SystemSound s_hand; - private static volatile SystemSound s_question; + private static volatile SystemSound? s_asterisk; + private static volatile SystemSound? s_beep; + private static volatile SystemSound? s_exclamation; + private static volatile SystemSound? s_hand; + private static volatile SystemSound? s_question; public static SystemSound Asterisk { diff --git a/src/libraries/System.Windows.Extensions/src/System/Security/Cryptography/X509Certificates/X509Certificate2UI.cs b/src/libraries/System.Windows.Extensions/src/System/Security/Cryptography/X509Certificates/X509Certificate2UI.cs index 9e5a9af0b92b4d..2f0db1203faca7 100644 --- a/src/libraries/System.Windows.Extensions/src/System/Security/Cryptography/X509Certificates/X509Certificate2UI.cs +++ b/src/libraries/System.Windows.Extensions/src/System/Security/Cryptography/X509Certificates/X509Certificate2UI.cs @@ -31,12 +31,12 @@ public static void DisplayCertificate(X509Certificate2 certificate, IntPtr hwndP DisplayX509Certificate(certificate, hwndParent); } - public static X509Certificate2Collection SelectFromCollection(X509Certificate2Collection certificates, string title, string message, X509SelectionFlag selectionFlag) + public static X509Certificate2Collection SelectFromCollection(X509Certificate2Collection certificates, string? title, string? message, X509SelectionFlag selectionFlag) { return SelectFromCollectionHelper(certificates, title, message, selectionFlag, IntPtr.Zero); } - public static X509Certificate2Collection SelectFromCollection(X509Certificate2Collection certificates, string title, string message, X509SelectionFlag selectionFlag, IntPtr hwndParent) + public static X509Certificate2Collection SelectFromCollection(X509Certificate2Collection certificates, string? title, string? message, X509SelectionFlag selectionFlag, IntPtr hwndParent) { return SelectFromCollectionHelper(certificates, title, message, selectionFlag, hwndParent); } @@ -82,7 +82,7 @@ private static void DisplayX509Certificate(X509Certificate2 certificate, IntPtr } } - private static X509Certificate2Collection SelectFromCollectionHelper(X509Certificate2Collection certificates, string title, string message, X509SelectionFlag selectionFlag, IntPtr hwndParent) + private static X509Certificate2Collection SelectFromCollectionHelper(X509Certificate2Collection certificates, string? title, string? message, X509SelectionFlag selectionFlag, IntPtr hwndParent) { if (certificates == null) throw new ArgumentNullException(nameof(certificates)); @@ -96,7 +96,7 @@ private static X509Certificate2Collection SelectFromCollectionHelper(X509Certifi } } - private static unsafe SafeCertStoreHandle SelectFromStore(SafeCertStoreHandle safeSourceStoreHandle, string title, string message, X509SelectionFlag selectionFlags, IntPtr hwndParent) + private static unsafe SafeCertStoreHandle SelectFromStore(SafeCertStoreHandle safeSourceStoreHandle, string? title, string? message, X509SelectionFlag selectionFlags, IntPtr hwndParent) { int dwErrorCode = ERROR_SUCCESS; @@ -105,7 +105,7 @@ private static unsafe SafeCertStoreHandle SelectFromStore(SafeCertStoreHandle sa Interop.Crypt32.X509_ASN_ENCODING | Interop.Crypt32.PKCS_7_ASN_ENCODING, IntPtr.Zero, 0, - null); + IntPtr.Zero); if (safeCertStoreHandle == null || safeCertStoreHandle.IsInvalid) throw new CryptographicException(Marshal.GetLastWin32Error()); diff --git a/src/libraries/System.Windows.Extensions/src/System/Security/Cryptography/X509Certificates/X509Utils.cs b/src/libraries/System.Windows.Extensions/src/System/Security/Cryptography/X509Certificates/X509Utils.cs index 39084758aa0d0f..eb445034c25466 100644 --- a/src/libraries/System.Windows.Extensions/src/System/Security/Cryptography/X509Certificates/X509Utils.cs +++ b/src/libraries/System.Windows.Extensions/src/System/Security/Cryptography/X509Certificates/X509Utils.cs @@ -29,7 +29,7 @@ internal static SafeCertStoreHandle ExportToMemoryStore(X509Certificate2Collecti Interop.Crypt32.X509_ASN_ENCODING | Interop.Crypt32.PKCS_7_ASN_ENCODING, IntPtr.Zero, CERT_STORE_ENUM_ARCHIVED_FLAG | CERT_STORE_CREATE_NEW_FLAG, - null); + IntPtr.Zero); if (safeCertStoreHandle == null || safeCertStoreHandle.IsInvalid) throw new CryptographicException(Marshal.GetLastWin32Error()); diff --git a/src/libraries/System.Windows.Extensions/src/System/Xaml/Permissions/XamlAccessLevel.cs b/src/libraries/System.Windows.Extensions/src/System/Xaml/Permissions/XamlAccessLevel.cs index 123543a8024439..3c4d510fd3a17b 100644 --- a/src/libraries/System.Windows.Extensions/src/System/Xaml/Permissions/XamlAccessLevel.cs +++ b/src/libraries/System.Windows.Extensions/src/System/Xaml/Permissions/XamlAccessLevel.cs @@ -8,7 +8,7 @@ namespace System.Xaml.Permissions { public class XamlAccessLevel { - private XamlAccessLevel(string assemblyName, string typeName) + private XamlAccessLevel(string assemblyName, string? typeName) { AssemblyNameString = assemblyName; PrivateAccessToTypeName = typeName; @@ -16,7 +16,7 @@ private XamlAccessLevel(string assemblyName, string typeName) public static XamlAccessLevel AssemblyAccessTo(Assembly assembly) { - return new XamlAccessLevel(assembly.FullName, null); + return new XamlAccessLevel(assembly.FullName!, null); } public static XamlAccessLevel AssemblyAccessTo(AssemblyName assemblyName) @@ -26,7 +26,7 @@ public static XamlAccessLevel AssemblyAccessTo(AssemblyName assemblyName) public static XamlAccessLevel PrivateAccessTo(Type type) { - return new XamlAccessLevel(type.Assembly.FullName, type.FullName); + return new XamlAccessLevel(type.Assembly.FullName!, type.FullName); } public static XamlAccessLevel PrivateAccessTo(string assemblyQualifiedTypeName) @@ -43,7 +43,7 @@ public AssemblyName AssemblyAccessToAssemblyName get { return new AssemblyName(AssemblyNameString); } } - public string PrivateAccessToTypeName { get; private set; } + public string? PrivateAccessToTypeName { get; private set; } internal string AssemblyNameString { get; private set; } } diff --git a/src/libraries/Native/native-binplace.proj b/src/libraries/native-binplace.proj similarity index 100% rename from src/libraries/Native/native-binplace.proj rename to src/libraries/native-binplace.proj diff --git a/src/libraries/pretest.proj b/src/libraries/pretest.proj index fc2fee13d5c33c..dc879eb62d5f13 100644 --- a/src/libraries/pretest.proj +++ b/src/libraries/pretest.proj @@ -5,6 +5,7 @@ true true + true diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj index 3eac0bacd92457..c3f4fc1549607b 100644 --- a/src/libraries/sendtohelixhelp.proj +++ b/src/libraries/sendtohelixhelp.proj @@ -364,15 +364,23 @@ Workloads- EMSDK- + + - - - 768968 + 929513 https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/$(ChromiumRevision)/chrome-linux.zip https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/$(ChromiumRevision)/chromedriver_linux64.zip - 768983 + 929513 https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/$(ChromiumRevision)/chrome-win.zip https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/$(ChromiumRevision)/chromedriver_win32.zip @@ -431,9 +439,9 @@ - - - + + + @@ -491,7 +499,7 @@ %(Identity) - $(ExecXHarnessCmd) wasm $(XHarnessCommand) --app=. --engine=V8 --engine-arg=--stack-trace-limit=1000 --js-file=runtime.js --output-directory=$(XHarnessOutput) -- --run %(FileName).dll + $(ExecXHarnessCmd) wasm $(XHarnessCommand) --app=. --engine=V8 --engine-arg=--stack-trace-limit=1000 --js-file=main.js --output-directory=$(XHarnessOutput) -- --run %(FileName).dll @@ -501,7 +509,7 @@ %(Identity) - $(ExecXHarnessCmd) wasm $(XHarnessCommand) --app=. --browser=Chrome $(XHarnessBrowserPathArg) --html-file=index.html --output-directory=$(XHarnessOutput) -- %(FileName).dll --testing + $(ExecXHarnessCmd) wasm $(XHarnessCommand) --app=. --browser=Chrome $(XHarnessBrowserPathArg) --html-file=index.html --output-directory=$(XHarnessOutput) -- %(FileName).dll diff --git a/src/libraries/shims/ApiCompatBaseline.PreviousNetCoreApp.txt b/src/libraries/shims/ApiCompatBaseline.PreviousNetCoreApp.txt index aaf4b8a58aed46..0fdeb001ef9d87 100644 --- a/src/libraries/shims/ApiCompatBaseline.PreviousNetCoreApp.txt +++ b/src/libraries/shims/ApiCompatBaseline.PreviousNetCoreApp.txt @@ -37,7 +37,31 @@ CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.DynamicallyAc CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.Marshal.AddRef(System.IntPtr)' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.Marshal.QueryInterface(System.IntPtr, System.Guid, System.IntPtr)' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.Marshal.Release(System.IntPtr)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.Aes' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.AsymmetricKeyExchangeDeformatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.AsymmetricKeyExchangeFormatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.AsymmetricSignatureDeformatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.AsymmetricSignatureFormatter' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.CryptoConfig' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.DeriveBytes' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.DES' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.DSA' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.DSASignatureDeformatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.DSASignatureFormatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.MaskGenerationMethod' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.PKCS1MaskGenerationMethod' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RandomNumberGenerator.Create(System.String)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RC2' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.Rijndael' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSA' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSAEncryptionPadding' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSAOAEPKeyExchangeDeformatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSAOAEPKeyExchangeFormatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSAPKCS1KeyExchangeFormatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSASignaturePadding' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.SignatureDescription' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.TripleDES' in the contract but not the implementation. Compat issues with assembly netstandard: CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Console.Beep()' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("android")]' in the implementation. CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Console.BufferHeight.get()' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("android")]' in the implementation. @@ -75,6 +99,19 @@ CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatfo CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Net.HttpListenerResponse.Abort()' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Net.HttpListenerResponse.Close()' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Net.HttpListenerResponse.Close(System.Byte[], System.Boolean)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.CopyTo(System.Span)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.CopyTo(System.Span)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.CopyTo(T[])' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.CopyTo(T[], System.Int32)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.Equals(System.Numerics.Vector)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.Equals(System.Object)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.GetHashCode()' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.Item.get(System.Int32)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.ToString()' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.ToString(System.String)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.ToString(System.String, System.IFormatProvider)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.TryCopyTo(System.Span)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.TryCopyTo(System.Span)' in the contract but not the implementation. CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute' on 'System.Reflection.IReflect.GetMember(System.String, System.Reflection.BindingFlags)' changed from '[DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes.All)]' in the contract to '[DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes.NonPublicConstructors | DynamicallyAccessedMemberTypes.NonPublicEvents | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.NonPublicMethods | DynamicallyAccessedMemberTypes.NonPublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicProperties | DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.PublicProperties)]' in the implementation. CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute' on 'System.Reflection.IReflect.GetMembers(System.Reflection.BindingFlags)' changed from '[DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes.All)]' in the contract to '[DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes.NonPublicConstructors | DynamicallyAccessedMemberTypes.NonPublicEvents | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.NonPublicMethods | DynamicallyAccessedMemberTypes.NonPublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicProperties | DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.PublicProperties)]' in the implementation. CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute' on 'System.Reflection.TypeDelegator.GetMember(System.String, System.Reflection.MemberTypes, System.Reflection.BindingFlags)' changed from '[DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes.All)]' in the contract to '[DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes.NonPublicConstructors | DynamicallyAccessedMemberTypes.NonPublicEvents | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.NonPublicMethods | DynamicallyAccessedMemberTypes.NonPublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicProperties | DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.PublicProperties)]' in the implementation. @@ -89,9 +126,37 @@ CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Ru CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.Marshal.AddRef(System.IntPtr)' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.Marshal.QueryInterface(System.IntPtr, System.Guid, System.IntPtr)' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.Marshal.Release(System.IntPtr)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.Aes' in the contract but not the implementation. CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Security.Cryptography.AesCcm' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("browser")]' in the implementation. CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Security.Cryptography.AesGcm' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("browser")]' in the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.AsymmetricKeyExchangeDeformatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.AsymmetricKeyExchangeFormatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.AsymmetricSignatureDeformatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.AsymmetricSignatureFormatter' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.CryptoConfig' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.DeriveBytes' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.DES' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.DSA' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.DSASignatureDeformatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.DSASignatureFormatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.ECCurve' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.ECDiffieHellman' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.ECDsa' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.ECParameters' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.MaskGenerationMethod' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.PKCS1MaskGenerationMethod' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RandomNumberGenerator.Create(System.String)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RC2' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.Rijndael' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSA' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSAEncryptionPadding' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSAOAEPKeyExchangeDeformatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSAOAEPKeyExchangeFormatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSAPKCS1KeyExchangeFormatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSASignaturePadding' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.SignatureDescription' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.TripleDES' in the contract but not the implementation. Compat issues with assembly System: CannotChangeAttribute : Attribute 'System.ComponentModel.DesignerAttribute' on 'System.ComponentModel.IComponent' changed from '[DesignerAttribute("System.ComponentModel.Design.ComponentDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]' in the contract to '[DesignerAttribute("System.ComponentModel.Design.ComponentDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]' in the implementation. CannotRemoveAttribute : Attribute 'System.ComponentModel.DesignerAttribute' exists on 'System.ComponentModel.MarshalByValueComponent' in the contract but not the implementation. @@ -129,6 +194,12 @@ CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatfo CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Console.Title.set(System.String)' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("android")]' in the implementation. CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Console.WindowHeight.get()' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("android")]' in the implementation. CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Console.WindowWidth.get()' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("android")]' in the implementation. +Compat issues with assembly System.Core: +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.Aes' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.ECCurve' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.ECDiffieHellman' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.ECDsa' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.ECParameters' in the contract but not the implementation. Compat issues with assembly System.Diagnostics.Process: CannotChangeAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' on 'System.Diagnostics.Process.MaxWorkingSet.set(System.IntPtr)' changed from '[SupportedOSPlatformAttribute("windows")]' in the contract to '[SupportedOSPlatformAttribute("freebsd")]' in the implementation. CannotChangeAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' on 'System.Diagnostics.Process.MinWorkingSet.set(System.IntPtr)' changed from '[SupportedOSPlatformAttribute("windows")]' in the contract to '[SupportedOSPlatformAttribute("freebsd")]' in the implementation. @@ -141,6 +212,22 @@ CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatfo CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Net.HttpListenerResponse.Close(System.Byte[], System.Boolean)' in the contract but not the implementation. Compat issues with assembly System.Net.Primitives: CannotRemoveAttribute : Attribute 'System.Diagnostics.CodeAnalysis.AllowNullAttribute' exists on parameter 'value' on member 'System.Net.Cookie.Name.set(System.String)' in the contract but not the implementation. +Compat issues with assembly System.Numerics.Vectors: +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.CopyTo(System.Span)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.CopyTo(System.Span)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.CopyTo(T[])' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.CopyTo(T[], System.Int32)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.Equals(System.Numerics.Vector)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.Equals(System.Object)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.GetHashCode()' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.Item.get(System.Int32)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.ToString()' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.ToString(System.String)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.ToString(System.String, System.IFormatProvider)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.TryCopyTo(System.Span)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.TryCopyTo(System.Span)' in the contract but not the implementation. +Compat issues with assembly System.ObjectModel: +TypesMustExist : Type 'System.Collections.ObjectModel.ReadOnlyDictionary' does not exist in the implementation but it does exist in the contract. Compat issues with assembly System.Reflection.Emit: CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute' on 'System.Reflection.Emit.EnumBuilder.GetMember(System.String, System.Reflection.MemberTypes, System.Reflection.BindingFlags)' changed from '[DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes.All)]' in the contract to '[DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes.NonPublicConstructors | DynamicallyAccessedMemberTypes.NonPublicEvents | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.NonPublicMethods | DynamicallyAccessedMemberTypes.NonPublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicProperties | DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.PublicProperties)]' in the implementation. CannotChangeAttribute : Attribute 'System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute' on 'System.Reflection.Emit.EnumBuilder.GetMembers(System.Reflection.BindingFlags)' changed from '[DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes.All)]' in the contract to '[DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes.NonPublicConstructors | DynamicallyAccessedMemberTypes.NonPublicEvents | DynamicallyAccessedMemberTypes.NonPublicFields | DynamicallyAccessedMemberTypes.NonPublicMethods | DynamicallyAccessedMemberTypes.NonPublicNestedTypes | DynamicallyAccessedMemberTypes.NonPublicProperties | DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.PublicNestedTypes | DynamicallyAccessedMemberTypes.PublicProperties)]' in the implementation. @@ -170,10 +257,42 @@ CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatform CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.Marshal.AddRef(System.IntPtr)' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.Marshal.QueryInterface(System.IntPtr, System.Guid, System.IntPtr)' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.Marshal.Release(System.IntPtr)' in the contract but not the implementation. +Compat issues with assembly System.Runtime.Intrinsics: +MembersMustExist : Member 'public System.Runtime.Intrinsics.Vector128 System.Runtime.Intrinsics.Vector128.As(System.Runtime.Intrinsics.Vector128)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Runtime.Intrinsics.Vector256 System.Runtime.Intrinsics.Vector256.As(System.Runtime.Intrinsics.Vector256)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public System.Runtime.Intrinsics.Vector64 System.Runtime.Intrinsics.Vector64.As(System.Runtime.Intrinsics.Vector64)' does not exist in the implementation but it does exist in the contract. Compat issues with assembly System.Security.Cryptography.Algorithms: +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.Aes' in the contract but not the implementation. CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Security.Cryptography.AesCcm' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("browser")]' in the implementation. CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Security.Cryptography.AesGcm' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("browser")]' in the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.AsymmetricKeyExchangeDeformatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.AsymmetricKeyExchangeFormatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.AsymmetricSignatureDeformatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.AsymmetricSignatureFormatter' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.CryptoConfig' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.DeriveBytes' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.DES' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.DSA' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.DSASignatureDeformatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.DSASignatureFormatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.ECCurve' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.ECDiffieHellman' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.ECDsa' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.ECParameters' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.MaskGenerationMethod' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.PKCS1MaskGenerationMethod' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RandomNumberGenerator.Create(System.String)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RC2' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.Rijndael' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSA' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSAEncryptionPadding' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSAOAEPKeyExchangeDeformatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSAOAEPKeyExchangeFormatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSAPKCS1KeyExchangeFormatter' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.RSASignaturePadding' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.SignatureDescription' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.TripleDES' in the contract but not the implementation. Compat issues with assembly System.Text.Json: CannotRemoveAttribute : Attribute 'System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute' exists on parameter 'returnType' on member 'System.Text.Json.JsonSerializer.Deserialize(System.ReadOnlySpan, System.Type, System.Text.Json.JsonSerializerOptions)' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute' exists on parameter 'returnType' on member 'System.Text.Json.JsonSerializer.Deserialize(System.String, System.Type, System.Text.Json.JsonSerializerOptions)' in the contract but not the implementation. @@ -186,37 +305,4 @@ CannotRemoveAttribute : Attribute 'System.Diagnostics.CodeAnalysis.DynamicallyAc CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Text.Json.Serialization.JsonConverterAttribute' changed from '[AttributeUsageAttribute(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Struct, AllowMultiple=false)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Property | AttributeTargets.Struct, AllowMultiple=false)]' in the implementation. Compat issues with assembly System.Threading.Tasks.Extensions: CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Runtime.CompilerServices.AsyncMethodBuilderAttribute' changed from '[AttributeUsageAttribute(AttributeTargets.Class | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Struct, Inherited=false, AllowMultiple=false)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Class | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Method | AttributeTargets.Struct, Inherited=false, AllowMultiple=false)]' in the implementation. -CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Security.Cryptography.AesCcm' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("browser")]' in the implementation. -CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Security.Cryptography.AesGcm' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("browser")]' in the implementation. -CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Security.Cryptography.AesCcm' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("browser")]' in the implementation. -CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Security.Cryptography.AesGcm' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("browser")]' in the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.CopyTo(System.Span)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.CopyTo(System.Span)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.CopyTo(T[])' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.CopyTo(T[], System.Int32)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.Equals(System.Numerics.Vector)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.Equals(System.Object)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.GetHashCode()' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.Item.get(System.Int32)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.ToString()' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.ToString(System.String)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.ToString(System.String, System.IFormatProvider)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.TryCopyTo(System.Span)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.TryCopyTo(System.Span)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.CopyTo(System.Span)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.CopyTo(System.Span)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.CopyTo(T[])' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.CopyTo(T[], System.Int32)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.Equals(System.Numerics.Vector)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.Equals(System.Object)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.GetHashCode()' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.Item.get(System.Int32)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.ToString()' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.ToString(System.String)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.ToString(System.String, System.IFormatProvider)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.TryCopyTo(System.Span)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Numerics.Vector.TryCopyTo(System.Span)' in the contract but not the implementation. -MembersMustExist : Member 'public System.Runtime.Intrinsics.Vector128 System.Runtime.Intrinsics.Vector128.As(System.Runtime.Intrinsics.Vector128)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'public System.Runtime.Intrinsics.Vector256 System.Runtime.Intrinsics.Vector256.As(System.Runtime.Intrinsics.Vector256)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'public System.Runtime.Intrinsics.Vector64 System.Runtime.Intrinsics.Vector64.As(System.Runtime.Intrinsics.Vector64)' does not exist in the implementation but it does exist in the contract. -Total Issues: 195 +Total Issues: 287 diff --git a/src/libraries/shims/ApiCompatBaseline.netcoreapp.netstandard.txt b/src/libraries/shims/ApiCompatBaseline.netcoreapp.netstandard.txt index 1d4a30c30f10ea..40ec257771a8bc 100644 --- a/src/libraries/shims/ApiCompatBaseline.netcoreapp.netstandard.txt +++ b/src/libraries/shims/ApiCompatBaseline.netcoreapp.netstandard.txt @@ -630,4 +630,5 @@ CannotSealType : Type 'System.Xml.Schema.XmlSchemaGroupBase' is effectively (has MembersMustExist : Member 'protected void System.Xml.Schema.XmlSchemaGroupBase..ctor()' does not exist in the implementation but it does exist in the contract. CannotMakeMemberNonVirtual : Member 'public System.Xml.Schema.XmlSchemaObjectCollection System.Xml.Schema.XmlSchemaGroupBase.Items' is non-virtual in the implementation but is virtual in the contract. CannotMakeMemberNonVirtual : Member 'public System.Xml.Schema.XmlSchemaObjectCollection System.Xml.Schema.XmlSchemaGroupBase.Items.get()' is non-virtual in the implementation but is virtual in the contract. -Total Issues: 617 +TypesMustExist : Type 'System.Collections.ObjectModel.ReadOnlyDictionary' does not exist in the implementation but it does exist in the contract. +Total Issues: 618 diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 766d862dda49f0..592a83a1a93149 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -14,6 +14,11 @@ + + + + + @@ -26,6 +31,7 @@ + @@ -163,7 +169,6 @@ - @@ -174,6 +179,11 @@ + + + + + @@ -251,8 +261,6 @@ - - @@ -398,11 +406,16 @@ BuildInParallel="false" /> + + false + true + + + BuildInParallel="$(Samples_BuildInParallel)" /> diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index 0016841316c9f5..7ce13324e2fc16 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -589,7 +589,7 @@ endif() ###################################### # ICU CHECKS ###################################### -set(ICU_SHIM_PATH "${CLR_SRC_LIBS_NATIVE_DIR}/Unix/System.Globalization.Native") +set(ICU_SHIM_PATH "${CLR_SRC_NATIVE_DIR}/libs/System.Globalization.Native") if(MONO_CROSS_COMPILE) elseif(HOST_OSX AND NOT HOST_MACCAT) include(FindPkgConfig) diff --git a/src/mono/Directory.Build.props b/src/mono/Directory.Build.props index 3536792b6c2f43..64cbb38bceab80 100644 --- a/src/mono/Directory.Build.props +++ b/src/mono/Directory.Build.props @@ -12,7 +12,7 @@ - + 10.0 10.0 2.0 diff --git a/src/mono/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.Mono.cs b/src/mono/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.Mono.cs index 1c6e10f1db2339..b715e4e3869623 100644 --- a/src/mono/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.Mono.cs @@ -374,7 +374,7 @@ private RuntimeType[] ArgumentTypes internal extern object? InternalInvoke(object? obj, in Span parameters, out Exception? exc); [MethodImpl(MethodImplOptions.AggressiveInlining)] - private object? InvokeWorker(object? obj, BindingFlags invokeAttr, in Span parameters) + private object? InvokeWorker(object? obj, BindingFlags invokeAttr, Span parameters) { Exception? exc; object? o = null; @@ -862,7 +862,7 @@ private void InvokeClassConstructor() } [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal object? InvokeWorker(object? obj, BindingFlags invokeAttr, in Span arguments) + internal object? InvokeWorker(object? obj, BindingFlags invokeAttr, Span arguments) { bool wrapExceptions = (invokeAttr & BindingFlags.DoNotWrapExceptions) == 0; return InternalInvoke(obj, arguments, wrapExceptions); diff --git a/src/mono/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.Mono.cs b/src/mono/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.Mono.cs index 01446a2ad9e4a5..5cf723dc60aed5 100644 --- a/src/mono/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.Mono.cs @@ -19,6 +19,17 @@ public static void InitializeArray(Array array, RuntimeFieldHandle fldHandle) InitializeArray(array, fldHandle.Value); } + private static unsafe void* GetSpanDataFrom( + RuntimeFieldHandle fldHandle, + RuntimeTypeHandle targetTypeHandle, + out int count) + { + fixed (int *pCount = &count) + { + return (void*)GetSpanDataFrom(fldHandle.Value, targetTypeHandle.Value, new IntPtr(pCount)); + } + } + public static int OffsetToStringData { [Intrinsic] @@ -165,6 +176,12 @@ public static object GetUninitializedObject( [MethodImplAttribute(MethodImplOptions.InternalCall)] private static extern void InitializeArray(Array array, IntPtr fldHandle); + [MethodImplAttribute(MethodImplOptions.InternalCall)] + private static extern unsafe IntPtr GetSpanDataFrom( + IntPtr fldHandle, + IntPtr targetTypeHandle, + IntPtr count); + [MethodImplAttribute(MethodImplOptions.InternalCall)] private static extern void RunClassConstructor(IntPtr type); diff --git a/src/mono/mono/component/debugger-agent.c b/src/mono/mono/component/debugger-agent.c index 792563b7965791..2cfd24d64ebc3c 100644 --- a/src/mono/mono/component/debugger-agent.c +++ b/src/mono/mono/component/debugger-agent.c @@ -197,12 +197,12 @@ struct _DebuggerTlsData { /* It is freed up when the thread is resumed */ int frame_count; StackFrame **frames; - /* + /* * Whenever the frame info is up-to-date. If not, compute_frame_info () will need to * re-compute it. */ gboolean frames_up_to_date; - /* + /* * Points to data about a pending invoke which needs to be executed after the thread * resumes. */ @@ -338,7 +338,7 @@ static DebuggerTlsData debugger_wasm_thread; #endif static AgentConfig agent_config; -/* +/* * Whenever the agent is fully initialized. * When using the onuncaught or onthrow options, only some parts of the agent are * initialized on startup, and the full initialization which includes connection @@ -431,7 +431,7 @@ MonoDefaults *mdbg_mono_defaults; mono_loader_unlock(); #define GET_DEBUGGER_TLS() \ DebuggerTlsData *tls; \ - tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id); + tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id); #else #define GET_TLS_DATA_FROM_THREAD(thread) \ DebuggerTlsData *tls; \ @@ -750,7 +750,7 @@ debugger_agent_init (MonoDefaults *mono_defaults) return; mdbg_mono_defaults = mono_defaults; - + DebuggerEngineCallbacks cbs; memset (&cbs, 0, sizeof (cbs)); cbs.tls_get_restore_state = tls_get_restore_state; @@ -823,7 +823,7 @@ debugger_agent_init (MonoDefaults *mono_defaults) suspend_init (); mini_get_debug_options ()->gen_sdb_seq_points = TRUE; - /* + /* * This is needed because currently we don't handle liveness info. */ mini_get_debug_options ()->mdb_optimizations = TRUE; @@ -971,7 +971,7 @@ socket_transport_recv (void *buf, int len) return total; } - + static void set_keepalive (void) { @@ -999,7 +999,7 @@ socket_transport_accept (int socket_fd) } else { PRINT_DEBUG_MSG (1, "Accepted connection from client, connection fd=%d.\n", conn_fd); } - + return conn_fd; } @@ -1050,7 +1050,7 @@ socket_transport_connect (const char *address) conn_fd = -1; listen_fd = -1; - + MONO_ENTER_GC_UNSAFE; mono_networking_init(); MONO_EXIT_GC_UNSAFE; @@ -1197,7 +1197,7 @@ socket_transport_connect (const char *address) if (res != -1) break; /* Success */ - + #ifdef HOST_WIN32 closesocket (sfd); #else @@ -1208,7 +1208,7 @@ socket_transport_connect (const char *address) if (rp == 0) sleep (1); } while ((elapsedTime < agent_config.timeout) && (rp == 0)); - + if (rp == 0) { PRINT_ERROR_MSG ("debugger-agent: Unable to connect to %s:%d\n", host, port); @@ -1221,7 +1221,7 @@ socket_transport_connect (const char *address) mono_free_address_info (result); MONO_EXIT_GC_UNSAFE; } - + gboolean handshake_ok; MONO_ENTER_GC_UNSAFE; handshake_ok = transport_handshake (); @@ -1410,11 +1410,11 @@ transport_handshake (void) char handshake_msg [128]; guint8 buf [128]; int res; - + MONO_REQ_GC_UNSAFE_MODE; disconnected = TRUE; - + /* Write handshake message */ sprintf (handshake_msg, "DWP-Handshake"); @@ -1442,7 +1442,7 @@ transport_handshake (void) #ifndef DISABLE_SOCKET_TRANSPORT // FIXME: Move this somewhere else - /* + /* * Set TCP_NODELAY on the socket so the client receives events/command * results immediately. */ @@ -1460,7 +1460,7 @@ transport_handshake (void) set_keepalive (); MONO_EXIT_GC_SAFE; #endif - + disconnected = FALSE; return TRUE; } @@ -1473,7 +1473,7 @@ stop_debugger_thread (void) transport_close1 (); - /* + /* * Wait for the thread to exit. * * If we continue with the shutdown without waiting for it, then the client might @@ -1505,7 +1505,7 @@ start_debugger_thread (MonoError *error) /* Is it possible for the thread to be dead alreay ? */ debugger_thread_handle = mono_threads_open_thread_handle (thread->handle); g_assert (debugger_thread_handle); - + } static gboolean @@ -1612,7 +1612,7 @@ static GHashTable *obj_to_objref; static MonoGHashTable *suspended_objs; #ifdef TARGET_WASM -void +void mono_init_debugger_agent_for_wasm (int log_level_parm, MonoProfilerHandle *prof) { if (mono_atomic_cas_i32 (&agent_inited, 1, 0) == 1) @@ -1676,7 +1676,7 @@ get_objref (MonoObject *obj) } mono_loader_lock (); - + /* FIXME: The tables can grow indefinitely */ if (mono_gc_is_moving ()) { @@ -2223,14 +2223,14 @@ save_thread_context (MonoContext *ctx) #ifdef TARGET_WASM void -mono_wasm_save_thread_context (void) +mono_wasm_save_thread_context (void) { debugger_wasm_thread.really_suspended = TRUE; mono_thread_state_init_from_current (&debugger_wasm_thread.context); } DebuggerTlsData* -mono_wasm_get_tls (void) +mono_wasm_get_tls (void) { return &debugger_wasm_thread; } @@ -2248,7 +2248,7 @@ static void suspend_init (void) { mono_coop_mutex_init (&suspend_mutex); - mono_coop_cond_init (&suspend_cond); + mono_coop_cond_init (&suspend_cond); mono_coop_sem_init (&suspend_sem, 0); } @@ -2319,8 +2319,8 @@ thread_interrupt (DebuggerTlsData *tls, MonoThreadInfo *info, MonoJitInfo *ji) /* Running managed code, will be suspended by the single step code */ PRINT_DEBUG_MSG (1, "[%p] Received interrupt while at %s(%p), continuing.\n", (gpointer)(gsize)tid, jinfo_get_method (ji)->name, ip); } else { - /* - * Running native code, will be suspended when it returns to/enters + /* + * Running native code, will be suspended when it returns to/enters * managed code. Treat it as already suspended. * This might interrupt the code in mono_de_process_single_step (), we use the * tls->suspending flag to avoid races when that happens. @@ -2344,7 +2344,7 @@ thread_interrupt (DebuggerTlsData *tls, MonoThreadInfo *info, MonoJitInfo *ji) * the thread is still running, so it might return to managed code, * making these invalid. * So we start a stack walk and save the first frame, along with the - * parent frame's ctx+lmf. This (hopefully) works because the thread will be + * parent frame's ctx+lmf. This (hopefully) works because the thread will be * suspended when it returns to managed code, so the parent's ctx should * remain valid. */ @@ -2381,7 +2381,7 @@ thread_interrupt (DebuggerTlsData *tls, MonoThreadInfo *info, MonoJitInfo *ji) /* * reset_native_thread_suspend_state: - * + * * Reset the suspended flag and state on native threads */ static void @@ -2452,7 +2452,7 @@ notify_thread (gpointer key, gpointer value, gpointer user_data) mono_thread_info_safe_suspend_and_run ((MonoNativeThreadId)(gsize)thread->tid, FALSE, debugger_interrupt_critical, &interrupt_data); if (!interrupt_data.valid_info) { PRINT_DEBUG_MSG (1, "[%p] mono_thread_info_suspend_sync () failed for %p...\n", (gpointer) (gsize) mono_native_thread_id_get (), (gpointer)tid); - /* + /* * Attached thread which died without detaching. */ tls->terminated = TRUE; @@ -2485,8 +2485,8 @@ process_suspend (DebuggerTlsData *tls, MonoContext *ctx) PRINT_DEBUG_MSG (1, "[%p] Received single step event for suspending.\n", (gpointer) (gsize) mono_native_thread_id_get ()); if (suspend_count - tls->resume_count == 0) { - /* - * We are executing a single threaded invoke but the single step for + /* + * We are executing a single threaded invoke but the single step for * suspending is still active. * FIXME: This slows down single threaded invokes. */ @@ -2512,16 +2512,16 @@ static gboolean try_process_suspend (void *the_tls, MonoContext *ctx, gboolean from_breakpoint) { MONO_REQ_GC_UNSAFE_MODE; - + DebuggerTlsData *tls = (DebuggerTlsData*)the_tls; /* if there is a suspend pending that is not executed yes */ - if (suspend_count > 0) { + if (suspend_count > 0) { /* Fastpath during invokes, see in process_suspend () */ /* if there is a suspend pending but this thread is already resumed, we shouldn't suspend it again and the breakpoint/ss can run */ - if (suspend_count - tls->resume_count == 0) + if (suspend_count - tls->resume_count == 0) return FALSE; /* if there is in a invoke the breakpoint/step should be executed even with the suspend pending */ - if (tls->invoke) + if (tls->invoke) return FALSE; /* with the multithreaded single step check if there is a suspend_count pending in the current thread and not in the vm */ if (from_breakpoint && tls->suspend_count <= tls->resume_count_internal) @@ -2535,7 +2535,7 @@ try_process_suspend (void *the_tls, MonoContext *ctx, gboolean from_breakpoint) /* * suspend_vm: * - * Increase the suspend count of the VM. While the suspend count is greater + * Increase the suspend count of the VM. While the suspend count is greater * than 0, runtime threads are suspended at certain points during execution. */ static void @@ -2621,7 +2621,7 @@ resume_thread (MonoInternalThread *thread) tls->resume_count_internal += tls->suspend_count; tls->suspend_count = 0; - /* + /* * Signal suspend_count without decreasing suspend_count, the threads will wake up * but only the one whose resume_count field is > 0 will be resumed. */ @@ -2669,8 +2669,8 @@ invalidate_frames (DebuggerTlsData *tls) /* * suspend_current: * - * Suspend the current thread until the runtime is resumed. If the thread has a - * pending invoke, then the invoke is executed before this function returns. + * Suspend the current thread until the runtime is resumed. If the thread has a + * pending invoke, then the invoke is executed before this function returns. */ static void suspend_current (void) @@ -2757,7 +2757,7 @@ count_threads_to_wait_for (void) mono_loader_unlock (); return count; -} +} /* * wait_for_suspend: @@ -3078,7 +3078,7 @@ compute_frame_info (MonoInternalThread *thread, DebuggerTlsData *tls, gboolean f #ifndef TARGET_WASM int i; - /* + /* * Reuse the id for already existing stack frames, so invokes don't invalidate * the still valid stack frames. */ @@ -3091,7 +3091,7 @@ compute_frame_info (MonoInternalThread *thread, DebuggerTlsData *tls, gboolean f if (i >= tls->frame_count) f->id = mono_atomic_inc_i32 (&frame_id); -#else //keep the same behavior that we have for wasm before start using debugger-agent +#else //keep the same behavior that we have for wasm before start using debugger-agent f->id = findex+1; #endif new_frames [findex ++] = f; @@ -3119,7 +3119,7 @@ compute_frame_info (MonoInternalThread *thread, DebuggerTlsData *tls, gboolean f } } } -#endif +#endif } /* @@ -3298,7 +3298,7 @@ init_jit_info_dbg_attrs (MonoJitInfo *ji) * Return a list of event request ids matching EVENT, starting from REQS, which * can be NULL to include all event requests. Set SUSPEND_POLICY to the suspend * policy. - * We return request ids, instead of requests, to simplify threading, since + * We return request ids, instead of requests, to simplify threading, since * requests could be deleted anytime when the loader lock is not held. * LOCKING: Assumes the loader lock is held. */ @@ -3359,7 +3359,7 @@ create_event_list (EventKind event, GPtrArray *reqs, MonoJitInfo *ji, EventInfo (mod->data.exc_class && !mod->subclasses && mod->data.exc_class != ei->exc->vtable->klass)) { is_already_filtered = TRUE; if ((ei->caught && mod->caught) || (!ei->caught && mod->uncaught)) { - filteredException = FALSE; + filteredException = FALSE; filtered_suspend_policy = req->suspend_policy; filtered_req_id = req->id; } @@ -3373,7 +3373,7 @@ create_event_list (EventKind event, GPtrArray *reqs, MonoJitInfo *ji, EventInfo } if (!mod->data.exc_class && !mod->everything_else) { if ((ei->caught && mod->caught) || (!ei->caught && mod->uncaught)) { - filteredException = FALSE; + filteredException = FALSE; filtered_suspend_policy = req->suspend_policy; filtered_req_id = req->id; } @@ -3468,7 +3468,7 @@ create_event_list (EventKind event, GPtrArray *reqs, MonoJitInfo *ji, EventInfo } if (has_everything_else && !is_already_filtered) { - filteredException = FALSE; + filteredException = FALSE; filtered_suspend_policy = everything_else_suspend_policy; filtered_req_id = everything_else_req_id; } @@ -3551,9 +3551,9 @@ process_event (EventKind event, gpointer arg, gint32 il_offset, MonoContext *ctx } } - if (event == EVENT_KIND_VM_START) - suspend_policy = agent_config.suspend ? SUSPEND_POLICY_ALL : SUSPEND_POLICY_NONE; - + if (event == EVENT_KIND_VM_START) + suspend_policy = agent_config.suspend ? SUSPEND_POLICY_ALL : SUSPEND_POLICY_NONE; + nevents = g_slist_length (events); buffer_init (&buf, 128); buffer_add_byte (&buf, suspend_policy); @@ -3635,7 +3635,7 @@ process_event (EventKind event, gpointer arg, gint32 il_offset, MonoContext *ctx buffer_add_objid (&buf, ei->exc); #ifdef TARGET_WASM buffer_add_byte (&buf, ei->caught); -#endif +#endif /* * We are not yet suspending, so get_objref () will not keep this object alive. So we need to do it * later after the suspension. (#12494). @@ -3662,7 +3662,7 @@ process_event (EventKind event, gpointer arg, gint32 il_offset, MonoContext *ctx case EVENT_KIND_KEEPALIVE: suspend_policy = SUSPEND_POLICY_NONE; break; - + case MDBGPROT_EVENT_KIND_ENC_UPDATE: { EnCInfo *ei = (EnCInfo *)arg; buffer_add_moduleid (&buf, mono_domain_get (), ei->image); @@ -3683,7 +3683,7 @@ process_event (EventKind event, gpointer arg, gint32 il_offset, MonoContext *ctx mono_error_assert_ok (error); } } - + if (event == EVENT_KIND_VM_DEATH) { vm_death_event_sent = TRUE; suspend_policy = SUSPEND_POLICY_NONE; @@ -3693,7 +3693,7 @@ process_event (EventKind event, gpointer arg, gint32 il_offset, MonoContext *ctx suspend_policy = SUSPEND_POLICY_NONE; if (suspend_policy != SUSPEND_POLICY_NONE) { - /* + /* * Save the thread context and start suspending before sending the packet, * since we could be receiving the resume request before send_packet () * returns. @@ -3724,7 +3724,7 @@ process_event (EventKind event, gpointer arg, gint32 il_offset, MonoContext *ctx PRINT_DEBUG_MSG (2, "Sending command %s failed.\n", event_to_string (event)); return; } - + if (event == EVENT_KIND_VM_START) { vm_start_event_sent = TRUE; } @@ -3802,7 +3802,7 @@ thread_startup (MonoProfiler *prof, uintptr_t tid) mono_loader_unlock (); if (old_thread) { if (thread == old_thread) { - /* + /* * For some reason, thread_startup () might be called for the same thread * multiple times (attach ?). */ @@ -3842,10 +3842,10 @@ thread_startup (MonoProfiler *prof, uintptr_t tid) process_profiler_event (EVENT_KIND_THREAD_START, thread); - /* + /* * suspend_vm () could have missed this thread, so wait for a resume. */ - + suspend_current (); } @@ -3930,12 +3930,12 @@ appdomain_unload (MonoProfiler *prof, MonoDomain *domain) tls->domain_unloading = NULL; mono_de_clear_breakpoints_for_domain (domain); - + mono_loader_lock (); /* Invalidate each thread's frame stack */ mono_g_hash_table_foreach (thread_to_tls, invalidate_each_thread, NULL); mono_loader_unlock (); - + process_profiler_event (EVENT_KIND_APPDOMAIN_UNLOAD, domain); } @@ -4010,7 +4010,7 @@ send_types_for_domain (MonoDomain *domain, void *user_data) old_domain = mono_domain_get (); mono_domain_set_fast (domain); - + mono_loader_lock (); g_hash_table_foreach (info->loaded_classes, emit_type_load, NULL); mono_loader_unlock (); @@ -4074,7 +4074,7 @@ jit_end (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *jinfo) } } - // only send typeload from AOTed classes if has .cctor when .cctor emits jit_end + // only send typeload from AOTed classes if has .cctor when .cctor emits jit_end // to avoid deadlock while trying to set a breakpoint in a class that was not fully initialized if (jinfo->from_aot && m_class_has_cctor(method->klass) && (!(method->flags & METHOD_ATTRIBUTE_SPECIAL_NAME) || strcmp (method->name, ".cctor"))) { @@ -4122,7 +4122,7 @@ void mono_ss_calculate_framecount (void *the_tls, MonoContext *ctx, gboolean force_use_ctx, DbgEngineStackFrame ***frames, int *nframes) { DebuggerTlsData *tls = (DebuggerTlsData*)the_tls; -#ifndef TARGET_WASM +#ifndef TARGET_WASM if (force_use_ctx || !tls->context.valid) mono_thread_state_init_from_monoctx (&tls->context, ctx); compute_frame_info (tls->thread, tls, FALSE); @@ -4333,7 +4333,7 @@ resume_from_signal_handler (void *sigctx, void *func) PRINT_ERROR_MSG ("Thread %p is not attached to the JIT.\n", (gpointer) (gsize) mono_native_thread_id_get ()); g_assert (tls); - // FIXME: MonoContext usually doesn't include the fp registers, so these are + // FIXME: MonoContext usually doesn't include the fp registers, so these are // clobbered by a single step/breakpoint event. If this turns out to be a problem, // clob:c could be added to op_seq_point. @@ -4443,8 +4443,8 @@ debugger_agent_single_step_event (void *sigctx) // here if (is_debugger_thread ()) { - /* - * This could happen despite our best effors when the runtime calls + /* + * This could happen despite our best effors when the runtime calls * assembly/type resolve hooks. * FIXME: Breakpoints too. */ @@ -4513,8 +4513,8 @@ debugger_agent_breakpoint_from_context (MonoContext *ctx) tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id); g_assert (tls); - - //if a thread was suspended and doesn't have any managed stack, it was considered as terminated, + + //if a thread was suspended and doesn't have any managed stack, it was considered as terminated, //but it wasn't really terminated because it can execute managed code again, and stop in a breakpoint so here we set terminated as FALSE tls->terminated = FALSE; @@ -4572,9 +4572,9 @@ mono_ss_create_init_args (SingleStepReq *ss_req, SingleStepArgs *args) gboolean set_ip = FALSE; StackFrame **frames = NULL; int nframes = 0; - + GET_TLS_DATA_FROM_THREAD (ss_req->thread); - + g_assert (tls); if (!tls->context.valid) { PRINT_DEBUG_MSG (1, "Received a single step request on a thread with no managed frames.\n"); @@ -4937,7 +4937,7 @@ debugger_agent_end_exception_filter (MonoException *exc, MonoContext *ctx, MonoC tls->filter_state.valid = FALSE; } -static void +static void buffer_add_fixed_array (Buffer *buf, MonoType *t, void *addr, MonoDomain *domain, gboolean as_vtype, GHashTable *parent_vtypes, gint32 len_fixed_array) { @@ -4968,7 +4968,7 @@ buffer_add_fixed_array (Buffer *buf, MonoType *t, void *addr, MonoDomain *domain break; case MONO_TYPE_PTR: { gssize val = *(gssize*)addr; - + buffer_add_byte (buf, t->type); buffer_add_long (buf, val); if (CHECK_PROTOCOL_VERSION(2, 46)) @@ -4993,7 +4993,7 @@ buffer_add_info_for_null_value (Buffer* buf, MonoType* t, MonoDomain* domain) buffer_add_int (buf, m_class_get_rank (mono_class_from_mono_type_internal (t))); if (m_class_get_byval_arg (m_class_get_element_class (mono_class_from_mono_type_internal (t)))->type == MONO_TYPE_CLASS) buffer_add_typeid (buf, domain, m_class_get_element_class (mono_class_from_mono_type_internal (t))); - buffer_add_typeid (buf, domain, mono_class_from_mono_type_internal (t)); + buffer_add_typeid (buf, domain, mono_class_from_mono_type_internal (t)); break; default: buffer_add_typeid (buf, domain, mono_class_from_mono_type_internal (t)); @@ -5047,7 +5047,7 @@ buffer_add_value_full (Buffer *buf, MonoType *t, void *addr, MonoDomain *domain, break; } } - + if (len_fixed_array > 1 && t->type != MONO_TYPE_VALUETYPE && CHECK_PROTOCOL_VERSION (2, 53)) { buffer_add_fixed_array(buf, t, addr, domain, as_vtype, parent_vtypes, len_fixed_array); @@ -5110,7 +5110,7 @@ buffer_add_value_full (Buffer *buf, MonoType *t, void *addr, MonoDomain *domain, case MONO_TYPE_PTR: case MONO_TYPE_FNPTR: { gssize val = *(gssize*)addr; - + buffer_add_byte (buf, t->type); buffer_add_long (buf, val); if (CHECK_PROTOCOL_VERSION(2, 46)) @@ -5514,7 +5514,7 @@ decode_value_internal (MonoType *t, int type, MonoDomain *domain, guint8 *addr, g_free (name); return ERR_INVALID_ARGUMENT; } - } else if ((t->type == MONO_TYPE_GENERICINST) && + } else if ((t->type == MONO_TYPE_GENERICINST) && mono_metadata_generic_class_is_valuetype (t->data.generic_class) && m_class_is_enumtype (t->data.generic_class->container_class)){ err = decode_vtype (t, domain, addr, buf, &buf, limit, check_field_datatype); @@ -5727,7 +5727,7 @@ set_var (MonoType *t, MonoDebugVarInfo *var, MonoContext *ctx, MonoDomain *domai /* Not saved yet */ PRINT_DEBUG_MSG (1, "[dbg] Setting context location for reg %x to %p.\n", reg, (gpointer)v); mono_arch_context_set_int_reg (restore_ctx, reg, v); - } + } // FIXME: Move these to mono-context.h/c. mono_arch_context_set_int_reg (ctx, reg, v); @@ -5749,7 +5749,7 @@ set_var (MonoType *t, MonoDebugVarInfo *var, MonoContext *ctx, MonoDomain *domai if (!addr) break; } - + // FIXME: Write barriers mono_gc_memmove_atomic (addr, val, size); break; @@ -5969,7 +5969,7 @@ mono_do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, gu MonoStopwatch watch; if (invoke->method) { - /* + /* * Invoke this method directly, currently only Environment.Exit () is supported. */ this_arg = NULL; @@ -6120,7 +6120,7 @@ mono_do_invoke_method (DebuggerTlsData *tls, Buffer *buf, InvokeData *invoke, gu else tls->disable_breakpoints = FALSE; - /* + /* * Add an LMF frame to link the stack frames on the invoke method with our caller. */ #ifdef MONO_ARCH_SOFT_DEBUG_SUPPORTED @@ -6289,7 +6289,7 @@ invoke_method (void) } send_reply_packet (id, err, &buf); - + buffer_free (&buf); } @@ -6488,9 +6488,9 @@ get_types_for_source_file (gpointer key, gpointer value, gpointer user_data) } } -static void +static void send_enc_delta (MonoImage *image, gconstpointer dmeta_bytes, int32_t dmeta_len, gconstpointer dpdb_bytes, int32_t dpdb_len) -{ +{ //TODO: if it came from debugger we don't need to pass the parameters back, they are already on debugger client side. if (agent_config.enabled) { int suspend_policy; @@ -6507,7 +6507,7 @@ send_enc_delta (MonoImage *image, gconstpointer dmeta_bytes, int32_t dmeta_len, info.pdb_len = dpdb_len; process_event (MDBGPROT_EVENT_KIND_ENC_UPDATE, &info, 0, NULL, events, suspend_policy); - } + } } static gboolean @@ -6523,7 +6523,7 @@ module_apply_changes (MonoImage *image, MonoArray *dmeta, MonoArray *dil, MonoAr mono_image_load_enc_delta (MONO_ENC_DELTA_DBG, image, dmeta_bytes, dmeta_len, dil_bytes, dil_len, dpdb_bytes, dpdb_len, error); return is_ok (error); } - + static void buffer_add_cattr_arg (Buffer *buf, MonoType *t, MonoDomain *domain, MonoObject *val) @@ -6632,9 +6632,9 @@ buffer_add_cattrs (Buffer *buf, MonoDomain *domain, MonoImage *image, MonoClass return ERR_NONE; } -static void add_error_string (Buffer *buf, const char *str) +static void add_error_string (Buffer *buf, const char *str) { - if (CHECK_PROTOCOL_VERSION (2, 56)) + if (CHECK_PROTOCOL_VERSION (2, 56)) buffer_add_string (buf, str); } @@ -6674,7 +6674,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) count--; buffer_add_int (buf, count); mono_g_hash_table_foreach (tid_to_thread_obj, add_thread, buf); - + mono_loader_unlock (); break; } @@ -6762,7 +6762,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) while (suspend_count > 0) resume_vm (); } else { - /* + /* * No thread found, do it ourselves. * FIXME: This can race with normal shutdown etc. */ @@ -6782,7 +6782,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) exit (exit_code); } break; - } + } case CMD_VM_INVOKE_METHOD: case CMD_VM_INVOKE_METHODS: { int objid = decode_objid (p, &p, end); @@ -6817,7 +6817,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) /* The thread is still running native code, can't do invokes */ return ERR_NOT_SUSPENDED; - /* + /* * Store the invoke data into tls, the thread will execute it after it is * resumed. */ @@ -7024,7 +7024,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf) if (!assembly) { PRINT_DEBUG_MSG (1, "Could not resolve assembly %s\n", assembly_name); buffer_add_int(buf, -1); - mono_assembly_name_free_internal (aname); + mono_assembly_name_free_internal (aname); break; } } @@ -7128,7 +7128,7 @@ event_commands (int command, guint8 *p, guint8 *end, Buffer *buf) req->modifiers [i].everything_else = FALSE; PRINT_DEBUG_MSG (1, "[dbg] \tEXCEPTION_ONLY filter (%s%s%s%s).\n", exc_class ? m_class_get_name (exc_class) : "all", req->modifiers [i].caught ? ", caught" : "", req->modifiers [i].uncaught ? ", uncaught" : "", req->modifiers [i].subclasses ? ", include-subclasses" : ""); } - + } else if (mod == MOD_KIND_ASSEMBLY_ONLY) { int n = decode_int (p, &p, end); int j; @@ -7196,10 +7196,10 @@ event_commands (int command, guint8 *p, guint8 *end, Buffer *buf) } GET_TLS_DATA_FROM_THREAD (THREAD_TO_INTERNAL(step_thread)); - + g_assert (tls); - - if (tls->terminated) { + + if (tls->terminated) { /* if the thread is already terminated ignore the single step */ buffer_add_int (buf, req->id); return ERR_NONE; @@ -7210,7 +7210,7 @@ event_commands (int command, guint8 *p, guint8 *end, Buffer *buf) g_free (req); return err; } -#ifdef TARGET_WASM +#ifdef TARGET_WASM int isBPOnManagedCode = 0; SingleStepReq *ss_req = req->info; if (ss_req && ss_req->bps) { @@ -7242,7 +7242,7 @@ event_commands (int command, guint8 *p, guint8 *end, Buffer *buf) mono_loader_lock (); g_ptr_array_add (event_requests, req); - + if (agent_config.defer) { /* Transmit cached data to the client on receipt of the event request */ switch (req->event_kind) { @@ -7372,7 +7372,7 @@ domain_commands (int command, guint8 *p, guint8 *end, Buffer *buf) mono_error_cleanup (error); return ERR_INVALID_OBJECT; } - + if (CHECK_PROTOCOL_VERSION(3, 0)) { buffer_add_byte(buf, 1); buffer_add_byte(buf, MONO_TYPE_STRING); @@ -7460,7 +7460,7 @@ assembly_commands (int command, guint8 *p, guint8 *end, Buffer *buf) switch (command) { case CMD_ASSEMBLY_GET_LOCATION: { buffer_add_string (buf, mono_image_get_filename (ass->image)); - break; + break; } case CMD_ASSEMBLY_GET_ENTRY_POINT: { guint32 token; @@ -7480,7 +7480,7 @@ assembly_commands (int command, guint8 *p, guint8 *end, Buffer *buf) buffer_add_methodid (buf, domain, m); } } - break; + break; } case CMD_ASSEMBLY_GET_MANIFEST_MODULE: { buffer_add_moduleid (buf, domain, ass->image); @@ -7576,7 +7576,7 @@ assembly_commands (int command, guint8 *p, guint8 *end, Buffer *buf) } case CMD_ASSEMBLY_GET_PDB_BLOB: { MonoImage* image = ass->image; - MonoDebugHandle* handle = mono_debug_get_handle (image); + MonoDebugHandle* handle = mono_debug_get_handle (image); if (!handle) { return ERR_INVALID_ARGUMENT; } @@ -7654,7 +7654,7 @@ assembly_commands (int command, guint8 *p, guint8 *end, Buffer *buf) return ERR_NOT_IMPLEMENTED; } - // Mdbg uses arithmetics with this pointer and RVA to get information using readmemory, + // Mdbg uses arithmetics with this pointer and RVA to get information using readmemory, // but it doesn't work on mono, it should call mono_cli_rva_image_map to get the right offset and don't use pure RVA. // To run the tests I changed mdbg but maybe in future we may need to find another solution // PRINT_DEBUG_MSG(1, "MDBGPROT_CMD_ASSEMBLY_GET_PEIMAGE_ADDRESS - [%p] - %d\n", module_handle, image->raw_data_len); @@ -7693,7 +7693,7 @@ module_commands (int command, guint8 *p, guint8 *end, Buffer *buf) buffer_add_string (buf, sourcelink); g_free (basename); g_free (sourcelink); - break; + break; } case MDBGPROT_CMD_MODULE_APPLY_CHANGES: { MonoImage *image = decode_moduleid (p, &p, end, &domain, &err); @@ -7857,7 +7857,7 @@ type_commands_internal (int command, MonoClass *klass, MonoDomain *domain, guint buffer_add_string (buf, m_class_get_name_space (klass)); buffer_add_string (buf, m_class_get_name (klass)); // FIXME: byref - + MonoTypeNameFormat format = MONO_TYPE_NAME_FORMAT_FULL_NAME; if (CHECK_PROTOCOL_VERSION(2, 61)) format = (MonoTypeNameFormat) decode_int (p, &p, end); @@ -8594,7 +8594,7 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g result = method; } else { MonoMethodInflated *imethod = (MonoMethodInflated *)method; - + result = imethod->declaring; if (imethod->context.class_inst) { MonoClass *klass = ((MonoMethod *) imethod)->klass; @@ -8883,7 +8883,7 @@ thread_commands (int command, guint8 *p, guint8 *end, Buffer *buf) return err; thread = THREAD_TO_INTERNAL (thread_obj); - + switch (command) { case CMD_THREAD_GET_NAME: { char *s = mono_thread_get_name_utf8 (thread_obj); @@ -8979,7 +8979,7 @@ thread_commands (int command, guint8 *p, guint8 *end, Buffer *buf) /* * Instead of passing the frame type directly to the client, we associate * it with the previous frame using a set of flags. This avoids lots of - * conditional code in the client, since a frame whose type isn't + * conditional code in the client, since a frame whose type isn't * FRAME_TYPE_MANAGED has no method, location, etc. */ buffer_add_byte (buf, tls->frames [i]->flags); @@ -9111,7 +9111,7 @@ cmd_stack_frame_get_this (StackFrame *frame, MonoMethodSignature *sig, Buffer *b } return ERR_NONE; } -static void +static void cmd_stack_frame_get_parameter (StackFrame *frame, MonoMethodSignature *sig, int pos, Buffer *buf, MonoDebugMethodJitInfo *jit) { PRINT_DEBUG_MSG (4, "[dbg] send arg %d.\n", pos); @@ -9143,7 +9143,7 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf) gssize id; MonoMethodHeader *header; ERROR_DECL (error); - + objid = decode_objid (p, &p, end); err = get_object (objid, (MonoObject**)&thread_obj); if (err != ERR_NONE) @@ -9211,7 +9211,7 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf) else pos--; } - len = 1; + len = 1; cmd_stack_frame_get_parameter (frame, sig, pos, buf, jit); break; } @@ -9347,7 +9347,7 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf) addr = (guint8*)mini_get_interp_callbacks_api ()->frame_get_this (frame->interp_frame); err = mono_de_set_interp_var (m_class_get_this_arg (frame->actual_method->klass), addr, val_buf); if (err != ERR_NONE) - return err; + return err; } else { var = jit->this_var; if (!var) { @@ -9498,8 +9498,8 @@ string_commands (int command, guint8 *p, guint8 *end, Buffer *buf) return ERR_NONE; } -static void -create_file_to_check_memory_address (void) +static void +create_file_to_check_memory_address (void) { if (file_check_valid_memory != -1) return; @@ -9509,7 +9509,7 @@ create_file_to_check_memory_address (void) g_free (file_name); } -static gboolean +static gboolean valid_memory_address (gpointer addr, gint size) { #ifndef _MSC_VER @@ -9532,7 +9532,7 @@ valid_memory_address (gpointer addr, gint size) } __except(1) { return ret; } -#endif +#endif return ret; } @@ -9559,7 +9559,7 @@ pointer_commands (int command, guint8 *p, guint8 *end, Buffer *buf) type = m_class_get_byval_arg (m_class_get_element_class (klass)); size = mono_type_size (type, &align); - + if (!valid_memory_address((gpointer)addr, size)) return ERR_INVALID_ARGUMENT; @@ -9857,7 +9857,7 @@ static const char* assembly_cmds_str[] = { "GET_METADATA_BLOB", "GET_IS_DYNAMIC", "GET_PDB_BLOB", - "GET_TYPE_FROM_TOKEN", + "GET_TYPE_FROM_TOKEN", "GET_METHOD_FROM_TOKEN", "HAS_DEBUG_INFO", "GET_CUSTOM_ATTRIBUTES", @@ -10051,7 +10051,7 @@ wait_for_attach (void) PRINT_DEBUG_MSG (1, "Transport handshake failed!\n"); return FALSE; } - + return TRUE; } @@ -10153,7 +10153,7 @@ debugger_thread (void *arg) } else { mono_set_is_debugger_attached (TRUE); } - + #ifndef HOST_WASM if (!attach_failed) { if (mono_metadata_has_updates_api ()) { @@ -10218,7 +10218,7 @@ debugger_thread (void *arg) err = ERR_NONE; no_reply = FALSE; - err = mono_process_dbg_packet (id, command_set, command, &no_reply, p, end, &buf); + err = mono_process_dbg_packet (id, command_set, command, &no_reply, p, end, &buf); if (command_set == CMD_SET_VM && command == CMD_VM_START_BUFFERING) { buffer_replies = TRUE; @@ -10263,7 +10263,7 @@ debugger_thread (void *arg) mono_coop_mutex_unlock (&debugger_thread_exited_mutex); PRINT_DEBUG_MSG (1, "[dbg] Debugger thread exited.\n"); - + if (!attach_failed && command_set == CMD_SET_VM && command == CMD_VM_DISPOSE && !(vm_death_event_sent || mono_runtime_is_shutting_down ())) { PRINT_DEBUG_MSG (2, "[dbg] Detached - restarting clean debugger thread.\n"); ERROR_DECL (error); diff --git a/src/mono/mono/component/hot_reload-stub.c b/src/mono/mono/component/hot_reload-stub.c index 35b8fe38a56e46..6064a6a78f8758 100644 --- a/src/mono/mono/component/hot_reload-stub.c +++ b/src/mono/mono/component/hot_reload-stub.c @@ -39,10 +39,7 @@ static void hot_reload_stub_cleanup_on_close (MonoImage *image); static void -hot_reload_stub_effective_table_slow (const MonoTableInfo **t, int *idx); - -static int -hot_reload_stub_relative_delta_index (MonoImage *image_dmeta, int token); +hot_reload_stub_effective_table_slow (const MonoTableInfo **t, int idx); static void hot_reload_stub_close_except_pools_all (MonoImage *base_image); @@ -65,6 +62,15 @@ hot_reload_stub_get_updated_method_ppdb (MonoImage *base_image, uint32_t idx); static gboolean hot_reload_stub_has_modified_rows (const MonoTableInfo *table); +static int +hot_reload_stub_table_num_rows_slow (MonoImage *image, int table_index); + +static GArray* +hot_reload_stub_get_added_methods (MonoClass *klass); + +static uint32_t +hot_reload_stub_method_parent (MonoImage *image, uint32_t method_index); + static MonoComponentHotReload fn_table = { { MONO_COMPONENT_ITF_VERSION, &hot_reload_stub_available }, &hot_reload_stub_set_fastpath_data, @@ -74,7 +80,6 @@ static MonoComponentHotReload fn_table = { &hot_reload_stub_get_thread_generation, &hot_reload_stub_cleanup_on_close, &hot_reload_stub_effective_table_slow, - &hot_reload_stub_relative_delta_index, &hot_reload_stub_apply_changes, &hot_reload_stub_close_except_pools_all, &hot_reload_stub_close_all, @@ -83,6 +88,9 @@ static MonoComponentHotReload fn_table = { &hot_reload_stub_delta_heap_lookup, &hot_reload_stub_get_updated_method_ppdb, &hot_reload_stub_has_modified_rows, + &hot_reload_stub_table_num_rows_slow, + &hot_reload_stub_get_added_methods, + &hot_reload_stub_method_parent, }; static bool @@ -135,13 +143,7 @@ hot_reload_stub_cleanup_on_close (MonoImage *image) } void -hot_reload_stub_effective_table_slow (const MonoTableInfo **t, int *idx) -{ - g_assert_not_reached (); -} - -static int -hot_reload_stub_relative_delta_index (MonoImage *image_dmeta, int token) +hot_reload_stub_effective_table_slow (const MonoTableInfo **t, int idx) { g_assert_not_reached (); } @@ -192,6 +194,25 @@ hot_reload_stub_has_modified_rows (const MonoTableInfo *table) return FALSE; } +static int +hot_reload_stub_table_num_rows_slow (MonoImage *image, int table_index) +{ + g_assert_not_reached (); /* should always take the fast path */ +} + +static GArray* +hot_reload_stub_get_added_methods (MonoClass *klass) +{ + return NULL; +} + +static uint32_t +hot_reload_stub_method_parent (MonoImage *image, uint32_t method_index) +{ + return 0; +} + + MONO_COMPONENT_EXPORT_ENTRYPOINT MonoComponentHotReload * mono_component_hot_reload_init (void) diff --git a/src/mono/mono/component/hot_reload.c b/src/mono/mono/component/hot_reload.c index 83faf008067fa3..a3caeb13ef3a15 100644 --- a/src/mono/mono/component/hot_reload.c +++ b/src/mono/mono/component/hot_reload.c @@ -28,6 +28,10 @@ #include +#undef ALLOW_METHOD_ADD + +typedef struct _DeltaInfo DeltaInfo; + static void hot_reload_init (void); @@ -53,13 +57,13 @@ static void hot_reload_cleanup_on_close (MonoImage *image); static void -hot_reload_effective_table_slow (const MonoTableInfo **t, int *idx); +hot_reload_effective_table_slow (const MonoTableInfo **t, int idx); static void hot_reload_apply_changes (int origin, MonoImage *base_image, gconstpointer dmeta, uint32_t dmeta_len, gconstpointer dil, uint32_t dil_len, gconstpointer dpdb_bytes_orig, uint32_t dpdb_length, MonoError *error); static int -hot_reload_relative_delta_index (MonoImage *image_dmeta, int token); +hot_reload_relative_delta_index (MonoImage *image_dmeta, DeltaInfo *delta_info, int token); static void hot_reload_close_except_pools_all (MonoImage *base_image); @@ -82,6 +86,16 @@ hot_reload_get_updated_method_ppdb (MonoImage *base_image, uint32_t idx); static gboolean hot_reload_has_modified_rows (const MonoTableInfo *table); +static int +hot_reload_table_num_rows_slow (MonoImage *image, int table_index); + +static GArray* +hot_reload_get_added_methods (MonoClass *klass); + +static uint32_t +hot_reload_method_parent (MonoImage *base, uint32_t method_token); + + static MonoComponentHotReload fn_table = { { MONO_COMPONENT_ITF_VERSION, &hot_reload_available }, &hot_reload_set_fastpath_data, @@ -91,7 +105,6 @@ static MonoComponentHotReload fn_table = { &hot_reload_get_thread_generation, &hot_reload_cleanup_on_close, &hot_reload_effective_table_slow, - &hot_reload_relative_delta_index, &hot_reload_apply_changes, &hot_reload_close_except_pools_all, &hot_reload_close_all, @@ -100,6 +113,9 @@ static MonoComponentHotReload fn_table = { &hot_reload_delta_heap_lookup, &hot_reload_get_updated_method_ppdb, &hot_reload_has_modified_rows, + &hot_reload_table_num_rows_slow, + &hot_reload_get_added_methods, + &hot_reload_method_parent, }; MonoComponentHotReload * @@ -151,8 +167,9 @@ typedef struct _delta_row_count { } delta_row_count; /* Additional informaiton for MonoImages representing deltas */ -typedef struct _DeltaInfo { +struct _DeltaInfo { uint32_t generation; /* global update ID that added this delta image */ + MonoImage *delta_image; /* DeltaInfo doesn't own the image, the base MonoImage owns the reference */ /* Maps MethodDef token indices to a pointer into the RVA of the delta IL */ GHashTable *method_table_update; @@ -165,25 +182,36 @@ typedef struct _DeltaInfo { delta_row_count count [MONO_TABLE_NUM]; MonoPPDBFile *ppdb_file; -} DeltaInfo; + + MonoMemPool *pool; /* mutated tables are allocated here */ + + MonoTableInfo mutants[MONO_TABLE_NUM]; +}; /* Additional informaiton for baseline MonoImages */ typedef struct _BaselineInfo { - /* List of MonoImages of deltas. Parent image owns 1 refcount ref of the delta image */ - GList *delta_image; - /* Tail of delta_image for fast appends */ - GList *delta_image_last; + /* List of DeltaInfos of deltas*/ + GList *delta_info; + /* Tail of delta_info for fast appends */ + GList *delta_info_last; /* Maps MethodDef token indices to a boolean flag that there's an update for the method */ GHashTable *method_table_update; /* TRUE if any published update modified an existing row */ gboolean any_modified_rows [MONO_TABLE_NUM]; + + GHashTable *added_methods; /* maps each MonoClass to a GArray of added method tokens */ + GHashTable *method_parent; /* maps added methoddef tokens to typedef tokens */ } BaselineInfo; + #define DOTNET_MODIFIABLE_ASSEMBLIES "DOTNET_MODIFIABLE_ASSEMBLIES" +/* See Note: Suppressed Columns */ +static guint16 m_SuppressedDeltaColumns [MONO_TABLE_NUM]; + /** * mono_metadata_update_enable: * \param modifiable_assemblies_out: set to MonoModifiableAssemblies value @@ -206,7 +234,8 @@ hot_reload_update_enabled (int *modifiable_assemblies_out) char *val = g_getenv (DOTNET_MODIFIABLE_ASSEMBLIES); if (val && !g_strcasecmp (val, "debug")) { mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_METADATA_UPDATE, "Metadata update enabled for debuggable assemblies"); - modifiable = MONO_MODIFIABLE_ASSM_DEBUG; + modifiable + = MONO_MODIFIABLE_ASSM_DEBUG; } g_free (val); inited = TRUE; @@ -254,7 +283,7 @@ hot_reload_no_inline (MonoMethod *caller, MonoMethod *callee) * this for deltas. */ static GHashTable *table_to_image; -/* Maps each delta MonoImage to its DeltaInfo */ +/* Maps each delta MonoImage to its DeltaInfo. Doesn't own the DeltaInfo or the images */ static GHashTable *delta_image_to_info; /* Maps each baseline MonoImage to its BaselineInfo */ static GHashTable *baseline_image_to_info; @@ -324,7 +353,7 @@ baseline_info_lookup (MonoImage *base_image) } static DeltaInfo* -delta_info_init (MonoImage *image_dmeta, MonoImage *image_base, MonoPPDBFile *ppdb_file, BaselineInfo *base_info, uint32_t generation); +delta_info_init (MonoImage *image_dmeta, MonoImage *image_base, MonoPPDBFile *ppdb_file, BaselineInfo *base_info, uint32_t generation, DeltaInfo **prev_last_delta); static void free_ppdb_entry (gpointer key, gpointer val, gpointer user_data) @@ -342,6 +371,9 @@ delta_info_destroy (DeltaInfo *dinfo) g_hash_table_destroy (dinfo->method_ppdb_table_update); } mono_ppdb_close (dinfo->ppdb_file); + + if (dinfo->pool) + mono_mempool_destroy (dinfo->pool); g_free (dinfo); } @@ -357,6 +389,7 @@ delta_info_lookup (MonoImage *delta_image) DeltaInfo *result; table_to_image_lock (); result = delta_info_lookup_locked (delta_image); + g_assert (!result || result->delta_image == delta_image); table_to_image_unlock (); return result; } @@ -384,12 +417,6 @@ hot_reload_cleanup_on_close (MonoImage *image) table_to_image_lock (); /* remove all keys (delta images) that map to the given image (base image) */ g_hash_table_foreach_remove (table_to_image, remove_base_image, (gpointer)image); - /* remove delta image info */ - DeltaInfo *delta_info = delta_info_lookup_locked (image); - if (delta_info) { - g_hash_table_remove (delta_image_to_info, image); - delta_info_destroy (delta_info); - } table_to_image_unlock (); } @@ -399,11 +426,16 @@ hot_reload_close_except_pools_all (MonoImage *base_image) BaselineInfo *info = baseline_info_lookup (base_image); if (!info) return; - for (GList *ptr = info->delta_image; ptr; ptr = ptr->next) { - MonoImage *image = (MonoImage *)ptr->data; + for (GList *ptr = info->delta_info; ptr; ptr = ptr->next) { + DeltaInfo *info = (DeltaInfo *)ptr->data; + MonoImage *image = info->delta_image; if (image) { + table_to_image_lock (); + g_hash_table_remove (delta_image_to_info, image); + table_to_image_unlock (); + /* if for some reason the image has other references, break the link to this delta_info that is going away */ if (!mono_image_close_except_pools (image)) - ptr->data = NULL; + info->delta_image = NULL; } } } @@ -414,12 +446,18 @@ hot_reload_close_all (MonoImage *base_image) BaselineInfo *info = baseline_info_lookup (base_image); if (!info) return; - for (GList *ptr = info->delta_image; ptr; ptr = ptr->next) { - MonoImage *image = (MonoImage *)ptr->data; - if (image) + for (GList *ptr = info->delta_info; ptr; ptr = ptr->next) { + DeltaInfo *info = (DeltaInfo *)ptr->data; + if (!info) + continue; + MonoImage *image = info->delta_image; + if (image) { mono_image_close_finish (image); + } + delta_info_destroy (info); + ptr->data = NULL; } - g_list_free (info->delta_image); + g_list_free (info->delta_info); baseline_info_remove (base_image); baseline_info_destroy (info); } @@ -474,17 +512,24 @@ table_info_find_in_base (const MonoTableInfo *table, MonoImage **base_out, int * static MonoImage* image_open_dmeta_from_data (MonoImage *base_image, uint32_t generation, gconstpointer dmeta_bytes, uint32_t dmeta_length); -static void +static DeltaInfo* image_append_delta (MonoImage *base, BaselineInfo *base_info, MonoImage *delta, DeltaInfo *delta_info); -static int -metadata_update_local_generation (MonoImage *base, BaselineInfo *base_info, MonoImage *delta); +static void +add_method_to_baseline (BaselineInfo *base_info, DeltaInfo *delta_info, MonoClass *klass, uint32_t method_token, MonoDebugInformationEnc* pdb_address); + void hot_reload_init (void) { table_to_image_init (); mono_native_tls_alloc (&exposed_generation_id, NULL); + + /* See CMiniMdRW::ApplyDelta in metamodelenc.cpp in CoreCLR */ + m_SuppressedDeltaColumns[MONO_TABLE_EVENTMAP] = (1 << MONO_EVENT_MAP_EVENTLIST); + m_SuppressedDeltaColumns[MONO_TABLE_PROPERTYMAP] = (1 << MONO_PROPERTY_MAP_PROPERTY_LIST); + m_SuppressedDeltaColumns[MONO_TABLE_METHOD] = (1 << MONO_METHOD_PARAMLIST); + m_SuppressedDeltaColumns[MONO_TABLE_TYPEDEF] = (1 << MONO_TYPEDEF_FIELD_LIST)|(1<pool); + + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_METADATA_UPDATE, "Initializing mutant tables for image %p (generation %d)", base, delta->generation); + for (int i = 0; i < MONO_TABLE_NUM; ++i) + { + gboolean need_copy = FALSE; + /* if any generation modified any row of this table, make a copy for the current generation. */ + if (base_info->any_modified_rows [i]) + need_copy = TRUE; + delta_row_count *count = &delta->count [i]; + guint32 base_rows = table_info_get_rows (&base->tables [i]); + /* if some previous generation added rows, or we're adding rows, make a copy */ + if (base_rows != count->prev_gen_rows || count->inserted_rows) + need_copy = TRUE; + if (!need_copy) { + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_METADATA_UPDATE, " Table 0x%02x unchanged (rows: base %d, prev %d, inserted %d), not copied", i, base_rows, count->prev_gen_rows, count->inserted_rows); + continue; + } else { + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_METADATA_UPDATE, " Table 0x%02x changed (rows: base %d, prev %d, inserted %d), IS copied", i, base_rows, count->prev_gen_rows, count->inserted_rows); + } + /* The invariant is that once we made a copy in any previous generation, we'll make + * a copy in this generation. So subsequent generations can copy either from the + * immediately preceeding generation or from the baseline if the preceeding + * generation didn't make a copy. */ + + guint32 rows = count->prev_gen_rows + count->inserted_rows; + + MonoTableInfo *tbl = &delta->mutants [i]; + tbl->row_size = base->tables[i].row_size; + tbl->size_bitfield = base->tables[i].size_bitfield; + tbl->rows_ = rows; + + tbl->base = mono_mempool_alloc (delta->pool, tbl->row_size * rows); + const MonoTableInfo *prev_table; + if (!prev_delta || prev_delta->mutants [i].base == NULL) + prev_table = &base->tables [i]; + else + prev_table = &prev_delta->mutants [i]; + + g_assert (prev_table != NULL); + g_assert (table_info_get_rows (prev_table) == count->prev_gen_rows); + + /* copy the old rows and zero out the new ones */ + memcpy ((char*)tbl->base, prev_table->base, count->prev_gen_rows * tbl->row_size); + memset (((char*)tbl->base) + count->prev_gen_rows * tbl->row_size, 0, count->inserted_rows * tbl->row_size); + } +} + + /** * LOCKING: Assumes the publish_lock is held + * Returns: The previous latest delta, or NULL if this is the first delta */ -void +DeltaInfo * image_append_delta (MonoImage *base, BaselineInfo *base_info, MonoImage *delta, DeltaInfo *delta_info) { - if (!base_info->delta_image) { - base_info->delta_image = base_info->delta_image_last = g_list_alloc (); - base_info->delta_image->data = (gpointer)delta; + if (!base_info->delta_info) { + base_info->delta_info = base_info->delta_info_last = g_list_alloc (); + base_info->delta_info->data = (gpointer)delta_info; mono_memory_write_barrier (); /* Have to set this here so that passes over the metadata in the updater thread start using the slow path */ base->has_updates = TRUE; - return; + return NULL; } - g_assert (delta_info_lookup(((MonoImage*)base_info->delta_image_last->data))->generation < delta_info->generation); + DeltaInfo *prev_last_delta = (DeltaInfo*)base_info->delta_info_last->data; + g_assert (prev_last_delta->generation < delta_info->generation); /* g_list_append returns the given list, not the newly appended */ - GList *l = g_list_append (base_info->delta_image_last, delta); + GList *l = g_list_append (base_info->delta_info_last, delta_info); g_assert (l != NULL && l->next != NULL && l->next->next == NULL); - base_info->delta_image_last = l->next; + base_info->delta_info_last = l->next; mono_memory_write_barrier (); /* Have to set this here so that passes over the metadata in the updater thread start using the slow path */ base->has_updates = TRUE; - + return prev_last_delta; } /** @@ -773,8 +877,33 @@ dump_update_summary (MonoImage *image_base, MonoImage *image_dmeta) } +static gboolean +effective_table_mutant (MonoImage *base, BaselineInfo *info, int tbl_index, const MonoTableInfo **t, int idx) +{ + GList *ptr =info->delta_info_last; + uint32_t exposed_gen = hot_reload_get_thread_generation (); + MonoImage *dmeta = NULL; + DeltaInfo *delta_info = NULL; + + /* walk backward from the latest image until we find one that matches the current thread's exposed generation */ + do { + delta_info = (DeltaInfo*)ptr->data; + dmeta = delta_info->delta_image; + if (delta_info->generation <= exposed_gen) + break; + ptr = ptr->prev; + } while (ptr); + if (!ptr) + return FALSE; + g_assert (dmeta != NULL); + g_assert (delta_info != NULL); + + *t = &delta_info->mutants [tbl_index]; + return TRUE; +} + void -hot_reload_effective_table_slow (const MonoTableInfo **t, int *idx) +hot_reload_effective_table_slow (const MonoTableInfo **t, int idx) { /* FIXME: don't let any thread other than the updater thread see values from a delta image * with a generation past update_published @@ -788,61 +917,9 @@ hot_reload_effective_table_slow (const MonoTableInfo **t, int *idx) if (!info) return; - gboolean any_modified = info->any_modified_rows[tbl_index]; - - if (G_LIKELY (*idx < table_info_get_rows (*t) && !any_modified)) - return; - - /* FIXME: when adding methods this won't work anymore. We will need to update the delta - * images' suppressed columns (see the Note in pass2 about - * CMiniMdRW::m_SuppressedDeltaColumns) with the baseline values. */ - /* The only column from the updates that matters the RVA, which is looked up elsewhere. */ - if (tbl_index == MONO_TABLE_METHOD) - return; + gboolean success = effective_table_mutant (base, info, tbl_index, t, idx); - GList *list = info->delta_image; - MonoImage *dmeta = NULL; - int ridx; - MonoTableInfo *table; - int g = 0; - - /* Candidate: the last delta that had updates for the requested row */ - MonoImage *cand_dmeta = NULL; - MonoTableInfo *cand_table = NULL; - int cand_ridx = -1; - int cand_g = 0; - - gboolean cont; - do { - g_assertf (list, "couldn't find idx=0x%08x in assembly=%s", *idx, dmeta && dmeta->name ? dmeta->name : "unknown image"); - dmeta = (MonoImage*)list->data; - list = list->next; - table = &dmeta->tables [tbl_index]; - int rel_row = hot_reload_relative_delta_index (dmeta, mono_metadata_make_token (tbl_index, *idx + 1)); - g_assert (rel_row == -1 || (rel_row > 0 && rel_row <= table_info_get_rows (table))); - g++; - if (rel_row != -1) { - cand_dmeta = dmeta; - cand_table = table; - cand_ridx = rel_row - 1; - cand_g = g; - } - ridx = rel_row - 1; - if (!any_modified) { - /* if the table only got additions, not modifications, don't continue after we find the first image that has the right number of rows */ - cont = ridx < 0 || ridx >= table_info_get_rows (table); - } else { - /* otherwise, keep going in case a later generation modified the row again */ - cont = list != NULL; - } - } while (cont); - - if (cand_ridx != -1) { - mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_METADATA_UPDATE, "effective table for %s: 0x%08x -> 0x%08x (rows = 0x%08x) (gen %d, g %d)", mono_meta_table_name (tbl_index), *idx, cand_ridx, table_info_get_rows (cand_table), metadata_update_local_generation (base, info, cand_dmeta), cand_g); - - *t = cand_table; - *idx = cand_ridx; - } + g_assert (success); } /* @@ -866,29 +943,25 @@ hot_reload_effective_table_slow (const MonoTableInfo **t, int *idx) * relative index faster. */ int -hot_reload_relative_delta_index (MonoImage *image_dmeta, int token) +hot_reload_relative_delta_index (MonoImage *image_dmeta, DeltaInfo *delta_info, int token) { MonoTableInfo *encmap = &image_dmeta->tables [MONO_TABLE_ENCMAP]; + int table = mono_metadata_token_table (token); int index = mono_metadata_token_index (token); - /* this helper expects and returns as "index origin = 1" */ - g_assert (index > 0); + int index_map = delta_info->enc_recs [table]; + int encmap_rows = table_info_get_rows (encmap); if (!table_info_get_rows (encmap) || !image_dmeta->minimal_delta) return mono_metadata_token_index (token); - DeltaInfo *delta_info = delta_info_lookup (image_dmeta); - g_assert (delta_info); - - int index_map = delta_info->enc_recs [table]; - int encmap_rows = table_info_get_rows (encmap); - /* if the table didn't have any updates in this generation and the * table index is bigger than the last table that got updates, * enc_recs will point past the last row */ if (index_map - 1 == encmap_rows) return -1; + guint32 cols[MONO_ENCMAP_SIZE]; mono_metadata_decode_row (encmap, index_map - 1, cols, MONO_ENCMAP_SIZE); int map_entry = cols [MONO_ENCMAP_TOKEN]; @@ -930,7 +1003,7 @@ hot_reload_relative_delta_index (MonoImage *image_dmeta, int token) /* LOCKING: assumes publish_lock is held */ static DeltaInfo* -delta_info_init (MonoImage *image_dmeta, MonoImage *image_base, MonoPPDBFile *ppdb_file, BaselineInfo *base_info, uint32_t generation) +delta_info_init (MonoImage *image_dmeta, MonoImage *image_base, MonoPPDBFile *ppdb_file, BaselineInfo *base_info, uint32_t generation, DeltaInfo **prev_delta_info) { MonoTableInfo *encmap = &image_dmeta->tables [MONO_TABLE_ENCMAP]; g_assert (!delta_info_lookup (image_dmeta)); @@ -942,13 +1015,19 @@ delta_info_init (MonoImage *image_dmeta, MonoImage *image_base, MonoPPDBFile *pp delta_info->generation = generation; delta_info->ppdb_file = ppdb_file; + delta_info->delta_image = image_dmeta; table_to_image_lock (); g_hash_table_insert (delta_image_to_info, image_dmeta, delta_info); table_to_image_unlock (); + delta_info->pool = mono_mempool_new (); + + + g_assert (prev_delta_info); + /* base_image takes ownership of 1 refcount ref of dmeta_image */ - image_append_delta (image_base, base_info, image_dmeta, delta_info); + *prev_delta_info = image_append_delta (image_base, base_info, image_dmeta, delta_info); return delta_info; } @@ -962,19 +1041,15 @@ delta_info_compute_table_records (MonoImage *image_dmeta, MonoImage *image_base, int table, prev_table = -1, idx; /*** Compute logical table sizes ***/ - if (base_info->delta_image == base_info->delta_image_last) { + if (base_info->delta_info == base_info->delta_info_last) { /* this is the first update. */ for (int i = 0; i < MONO_TABLE_NUM; ++i) { delta_info->count[i].prev_gen_rows = table_info_get_rows (&image_base->tables[i]); } } else { - /* Current image_dmeta is image_base->delta_image_last->data, - * find its predecessor - */ - MonoImage *prev_delta = NULL; - g_assert (base_info->delta_image_last->prev != NULL); - prev_delta = (MonoImage*)base_info->delta_image_last->prev->data; - DeltaInfo *prev_gen_info = delta_info_lookup (prev_delta); + g_assert (delta_info == (DeltaInfo*)base_info->delta_info_last->data); + g_assert (base_info->delta_info_last->prev != NULL); + DeltaInfo *prev_gen_info = (DeltaInfo*)base_info->delta_info_last->prev->data; for (int i = 0; i < MONO_TABLE_NUM; ++i) { delta_info->count[i].prev_gen_rows = prev_gen_info->count[i].prev_gen_rows + prev_gen_info->count[i].inserted_rows; } @@ -1025,6 +1100,15 @@ delta_info_compute_table_records (MonoImage *image_dmeta, MonoImage *image_base, return TRUE; } +enum MonoEnCFuncCode { + ENC_FUNC_DEFAULT = 0, + ENC_FUNC_ADD_METHOD = 1, + ENC_FUNC_ADD_FIELD = 2, + ENC_FUNC_ADD_PARAM = 3, + ENC_FUNC_ADD_PROPERTY = 4, + ENC_FUNC_ADD_EVENT = 5, +}; + static const char* funccode_to_str (int func_code) { @@ -1040,11 +1124,106 @@ funccode_to_str (int func_code) return NULL; } +/* + * Apply the row from the delta image given by log_token to the cur_delta mutated table. + * + */ +static void +delta_info_mutate_row (MonoImage *image_base, MonoImage *image_dmeta, DeltaInfo *cur_delta, guint32 log_token) +{ + int token_table = mono_metadata_token_table (log_token); + int token_index = mono_metadata_token_index (log_token); /* 1-based */ + + gboolean modified = token_index <= cur_delta->count [token_table].prev_gen_rows; + + int delta_index = hot_reload_relative_delta_index (image_dmeta, cur_delta, log_token); + + /* The complication here is that we want the mutant table to look like the table in + * image_base with respect to column widths, but the delta tables are generally coming in + * uncompressed (4-byte columns). So we have to copy one column at a time and adjust the + * widths as we go. + */ + + guint32 dst_bitfield = image_base->tables [token_table].size_bitfield; + guint32 src_bitfield = image_dmeta->tables [token_table].size_bitfield; + + const char *src_base = image_dmeta->tables [token_table].base + (delta_index - 1) * image_dmeta->tables [token_table].row_size; + char *dst_base = (char*)cur_delta->mutants [token_table].base + (token_index - 1) * image_base->tables [token_table].row_size; + + guint32 src_offset = 0, dst_offset = 0; + for (int col = 0; col < mono_metadata_table_count (dst_bitfield); ++col) { + guint32 dst_col_size = mono_metadata_table_size (dst_bitfield, col); + guint32 src_col_size = mono_metadata_table_size (src_bitfield, col); + if ((m_SuppressedDeltaColumns [token_table] & (1 << col)) == 0) { + const char *src = src_base + src_offset; + char *dst = dst_base + dst_offset; + + /* copy src to dst, via a temporary to adjust for size differences */ + /* FIXME: unaligned access, endianness */ + guint32 tmp; + + switch (src_col_size) { + case 1: + tmp = *(guint8*)src; + break; + case 2: + tmp = *(guint16*)src; + break; + case 4: + tmp = *(guint32*)src; + break; + default: + g_assert_not_reached (); + } + + /* FIXME: unaligned access, endianness */ + switch (dst_col_size) { + case 1: + *(guint8*)dst = (guint8)tmp; + break; + case 2: + *(guint16*)dst = (guint16)tmp; + break; + case 4: + *(guint32*)dst = tmp; + break; + default: + g_assert_not_reached (); + } + + } + src_offset += src_col_size; + dst_offset += dst_col_size; + } + g_assert (dst_offset == image_base->tables [token_table].row_size); + + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_METADATA_UPDATE, "mutate: table=0x%02x row=0x%04x delta row=0x%04x %s", token_table, token_index, delta_index, modified ? "Mod" : "Add"); +} + +static void +prepare_mutated_rows (const MonoTableInfo *table_enclog, MonoImage *image_base, MonoImage *image_dmeta, DeltaInfo *delta_info) +{ + int rows = table_info_get_rows (table_enclog); + /* Prepare the mutated metadata tables */ + for (int i = 0; i < rows ; ++i) { + guint32 cols [MONO_ENCLOG_SIZE]; + mono_metadata_decode_row (table_enclog, i, cols, MONO_ENCLOG_SIZE); + + int log_token = cols [MONO_ENCLOG_TOKEN]; + int func_code = cols [MONO_ENCLOG_FUNC_CODE]; + + if (func_code != ENC_FUNC_DEFAULT) + continue; + + delta_info_mutate_row (image_base, image_dmeta, delta_info, log_token); + } +} + /* Run some sanity checks first. If we detect unsupported scenarios, this * function will fail and the metadata update should be aborted. This should * run before anything in the metadata world is updated. */ static gboolean -apply_enclog_pass1 (MonoImage *image_base, MonoImage *image_dmeta, gconstpointer dil_data, uint32_t dil_length, MonoError *error) +apply_enclog_pass1 (MonoImage *image_base, MonoImage *image_dmeta, DeltaInfo *delta_info, gconstpointer dil_data, uint32_t dil_length, MonoError *error) { MonoTableInfo *table_enclog = &image_dmeta->tables [MONO_TABLE_ENCLOG]; int rows = table_info_get_rows (table_enclog); @@ -1069,18 +1248,29 @@ apply_enclog_pass1 (MonoImage *image_base, MonoImage *image_dmeta, gconstpointer int token_table = mono_metadata_token_table (log_token); int token_index = mono_metadata_token_index (log_token); - mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_METADATA_UPDATE, "row[0x%02x]:0x%08x (%s idx=0x%02x) (base table has 0x%04x rows)\tfunc=0x%02x\n", i, log_token, mono_meta_table_name (token_table), token_index, table_info_get_rows (&image_base->tables [token_table]), func_code); + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_METADATA_UPDATE, "row[0x%02x]:0x%08x (%s idx=0x%02x) (base table has 0x%04x rows)\tfunc=0x%02x (\"%s\")\n", i, log_token, mono_meta_table_name (token_table), token_index, table_info_get_rows (&image_base->tables [token_table]), func_code, funccode_to_str (func_code)); if (token_table != MONO_TABLE_METHOD) continue; +#ifndef ALLOW_METHOD_ADD + if (token_index > table_info_get_rows (&image_base->tables [token_table])) { mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_METADATA_UPDATE, "\tcannot add new method with token 0x%08x", log_token); mono_error_set_type_load_name (error, NULL, image_base->name, "EnC: cannot add new method with token 0x%08x", log_token); unsupported_edits = TRUE; } +#endif + +#ifdef ALLOW_METHOD_ADD + /* adding a new parameter to a new method is ok */ + /* FIXME: total rows, not just the baseline rows */ + if (func_code == ENC_FUNC_ADD_PARAM && token_index > table_info_get_rows (&image_base->tables [token_table])) + continue; +#endif + g_assert (func_code == 0); /* anything else doesn't make sense here */ } @@ -1099,6 +1289,10 @@ apply_enclog_pass1 (MonoImage *image_base, MonoImage *image_dmeta, gconstpointer /* okay, supported */ break; case MONO_TABLE_METHOD: +#ifdef ALLOW_METHOD_ADD + if (func_code == ENC_FUNC_ADD_PARAM) + continue; /* ok, allowed */ +#endif /* handled above */ break; case MONO_TABLE_PROPERTY: { @@ -1116,7 +1310,7 @@ apply_enclog_pass1 (MonoImage *image_base, MonoImage *image_dmeta, gconstpointer if (token_index > table_info_get_rows (&image_base->tables [token_table])) { /* new rows are fine, as long as they point at existing methods */ guint32 sema_cols [MONO_METHOD_SEMA_SIZE]; - int mapped_token = hot_reload_relative_delta_index (image_dmeta, mono_metadata_make_token (token_table, token_index)); + int mapped_token = hot_reload_relative_delta_index (image_dmeta, delta_info, mono_metadata_make_token (token_table, token_index)); g_assert (mapped_token != -1); mono_metadata_decode_row (&image_dmeta->tables [MONO_TABLE_METHODSEMANTICS], mapped_token - 1, sema_cols, MONO_METHOD_SEMA_SIZE); @@ -1151,7 +1345,7 @@ apply_enclog_pass1 (MonoImage *image_base, MonoImage *image_dmeta, gconstpointer /* modifying existing rows is ok, as long as the parent and ctor are the same */ guint32 ca_upd_cols [MONO_CUSTOM_ATTR_SIZE]; guint32 ca_base_cols [MONO_CUSTOM_ATTR_SIZE]; - int mapped_token = hot_reload_relative_delta_index (image_dmeta, mono_metadata_make_token (token_table, token_index)); + int mapped_token = hot_reload_relative_delta_index (image_dmeta, delta_info, mono_metadata_make_token (token_table, token_index)); g_assert (mapped_token != -1); mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_METADATA_UPDATE, "row[0x%02x]:0x%08x CUSTOM_ATTR update. mapped index = 0x%08x\n", i, log_token, mapped_token); @@ -1186,7 +1380,7 @@ apply_enclog_pass1 (MonoImage *image_base, MonoImage *image_dmeta, gconstpointer /* We only allow modifications where the parameter name doesn't change. */ uint32_t base_param [MONO_PARAM_SIZE]; uint32_t upd_param [MONO_PARAM_SIZE]; - int mapped_token = hot_reload_relative_delta_index (image_dmeta, mono_metadata_make_token (token_table, token_index)); + int mapped_token = hot_reload_relative_delta_index (image_dmeta, delta_info, mono_metadata_make_token (token_table, token_index)); g_assert (mapped_token != -1); mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_METADATA_UPDATE, "row[0x%02x]:0x%08x PARAM update. mapped index = 0x%08x\n", i, log_token, mapped_token); @@ -1206,6 +1400,28 @@ apply_enclog_pass1 (MonoImage *image_base, MonoImage *image_dmeta, gconstpointer } else break; /* added a row. ok */ } + case MONO_TABLE_TYPEDEF: { +#ifdef ALLOW_METHOD_ADD + /* FIXME: wrong for cumulative updates - need to look at DeltaInfo:count.prev_gen_rows */ + gboolean new_class = token_index > table_info_get_rows (&image_base->tables [token_table]); + /* only allow adding methods to existing classes for now */ + if (!new_class && func_code == ENC_FUNC_ADD_METHOD) { + /* next record should be a MONO_TABLE_METHOD addition (func == default) */ + g_assert (i + 1 < rows); + guint32 next_cols [MONO_ENCLOG_SIZE]; + mono_metadata_decode_row (table_enclog, i + 1, next_cols, MONO_ENCLOG_SIZE); + g_assert (next_cols [MONO_ENCLOG_FUNC_CODE] == ENC_FUNC_DEFAULT); + int next_token = next_cols [MONO_ENCLOG_TOKEN]; + int next_table = mono_metadata_token_table (next_token); + int next_index = mono_metadata_token_index (next_token); + g_assert (next_table == MONO_TABLE_METHOD); + g_assert (next_index > table_info_get_rows (&image_base->tables [next_table])); + i++; /* skip the next record */ + continue; + } +#endif + /* fallthru */ + } default: /* FIXME: this bounds check is wrong for cumulative updates - need to look at the DeltaInfo:count.prev_gen_rows */ if (token_index <= table_info_get_rows (&image_base->tables [token_table])) { @@ -1223,7 +1439,7 @@ apply_enclog_pass1 (MonoImage *image_base, MonoImage *image_dmeta, gconstpointer * the preceeding MONO_TABLE_TYPEDEF enc record that identifies the parent type). */ switch (func_code) { - case 0: /* default */ + case ENC_FUNC_DEFAULT: /* default */ break; default: mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_METADATA_UPDATE, "row[0x%02x]:0x%08x FunCode %d (%s) not supported (token=0x%08x)", i, log_token, func_code, funccode_to_str (func_code), log_token); @@ -1235,6 +1451,12 @@ apply_enclog_pass1 (MonoImage *image_base, MonoImage *image_dmeta, gconstpointer return !unsupported_edits; } +static void +set_delta_method_debug_info (DeltaInfo *delta_info, uint32_t token_index, MonoDebugInformationEnc *pdb_address) +{ + g_hash_table_insert (delta_info->method_ppdb_table_update, GUINT_TO_POINTER (token_index), (gpointer) pdb_address); +} + static void set_update_method (MonoImage *image_base, BaselineInfo *base_info, uint32_t generation, MonoImage *image_dmeta, DeltaInfo *delta_info, uint32_t token_index, const char* il_address, MonoDebugInformationEnc* pdb_address) { @@ -1242,7 +1464,7 @@ set_update_method (MonoImage *image_base, BaselineInfo *base_info, uint32_t gene /* FIXME: this is a race if other threads are doing a lookup. */ g_hash_table_insert (base_info->method_table_update, GUINT_TO_POINTER (token_index), GUINT_TO_POINTER (generation)); g_hash_table_insert (delta_info->method_table_update, GUINT_TO_POINTER (token_index), (gpointer) il_address); - g_hash_table_insert (delta_info->method_ppdb_table_update, GUINT_TO_POINTER (token_index), (gpointer) pdb_address); + set_delta_method_debug_info (delta_info, token_index, pdb_address); } static MonoDebugInformationEnc * @@ -1272,6 +1494,26 @@ hot_reload_get_method_debug_information (MonoPPDBFile *ppdb_file, int idx) return NULL; } +static void G_GNUC_UNUSED +dump_assembly_ref_names (MonoImage *image) +{ + if (!mono_trace_is_traced (G_LOG_LEVEL_DEBUG, MONO_TRACE_METADATA_UPDATE)) + return; + for (int i = 0; i < image->nreferences; ++i) { + ERROR_DECL(local_error); + MonoAssemblyName aname; + mono_assembly_get_assemblyref_checked (image, i, &aname, local_error); + + if (is_ok (local_error)) + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_METADATA_UPDATE, "Reference[%02d] = '%s'", i, aname.name); + else { + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_METADATA_UPDATE, "Reference[%02d] error '%s'", i, mono_error_get_message (local_error)); + mono_error_cleanup (local_error); + } + } +} + + /* do actuall enclog application */ static gboolean apply_enclog_pass2 (MonoImage *image_base, BaselineInfo *base_info, uint32_t generation, MonoImage *image_dmeta, DeltaInfo *delta_info, gconstpointer dil_data, uint32_t dil_length, MonoError *error) @@ -1302,6 +1544,12 @@ apply_enclog_pass2 (MonoImage *image_base, BaselineInfo *base_info, uint32_t gen * have it in writable memory (and not mmap-ed pages), so we can rewrite the table values. */ + + MonoClass *add_method_klass = NULL; +#ifdef ALLOW_METHOD_ADD + uint32_t add_param_method_index = 0; +#endif + gboolean assemblyref_updated = FALSE; for (int i = 0; i < rows ; ++i) { guint32 cols [MONO_ENCLOG_SIZE]; @@ -1317,11 +1565,31 @@ apply_enclog_pass2 (MonoImage *image_base, BaselineInfo *base_info, uint32_t gen /* TODO: See CMiniMdRW::ApplyDelta for how to drive this. */ switch (func_code) { - case 0: /* default */ - break; - default: - g_error ("EnC: unsupported FuncCode, should be caught by pass1"); - break; + case ENC_FUNC_DEFAULT: /* default */ + break; +#ifdef ALLOW_METHOD_ADD + case ENC_FUNC_ADD_METHOD: { + g_assert (token_table == MONO_TABLE_TYPEDEF); + /* FIXME: this bounds check is wrong for cumulative updates - need to look at the DeltaInfo:count.prev_gen_rows */ + /* should've been caught by pass1 if we're adding a new method to a new class. */ + MonoClass *klass = mono_class_get_checked (image_base, log_token, error); + if (!is_ok (error)) { + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_METADATA_UPDATE, "Can't get class with token 0x%08x due to: %s", log_token, mono_error_get_message (error)); + return FALSE; + } + add_method_klass = klass; + break; + } + + case ENC_FUNC_ADD_PARAM: { + g_assert (token_table == MONO_TABLE_METHOD); + add_param_method_index = token_index; + break; + } +#endif + default: + g_error ("EnC: unsupported FuncCode, should be caught by pass1"); + break; } switch (token_table) { @@ -1336,8 +1604,8 @@ apply_enclog_pass2 (MonoImage *image_base, BaselineInfo *base_info, uint32_t gen /* FIXME: use DeltaInfo:prev_gen_rows instead of looping */ /* TODO: do we know that there will never be modified rows in ASSEMBLYREF? */ int old_rows = table_info_get_rows (&image_base->tables [MONO_TABLE_ASSEMBLYREF]); - for (GList *l = base_info->delta_image; l; l = l->next) { - MonoImage *delta_child = l->data; + for (GList *l = base_info->delta_info; l; l = l->next) { + MonoImage *delta_child = ((DeltaInfo*)l->data)->delta_image; old_rows += table_info_get_rows (&delta_child->tables [MONO_TABLE_ASSEMBLYREF]); } int new_rows = table_info_get_rows (&image_dmeta->tables [MONO_TABLE_ASSEMBLYREF]); @@ -1356,13 +1624,29 @@ apply_enclog_pass2 (MonoImage *image_base, BaselineInfo *base_info, uint32_t gen image_base->nreferences = old_rows + new_rows; mono_image_unlock (image_base); +#if 0 + dump_assembly_ref_names (image_base); +#endif + g_free (old_array); break; } case MONO_TABLE_METHOD: { +#ifdef ALLOW_METHOD_ADD + /* if adding a param, handle it with the next record */ + if (func_code == ENC_FUNC_ADD_PARAM) + break; + if (token_index > table_info_get_rows (&image_base->tables [token_table])) { - g_error ("EnC: new method added, should be caught by pass1"); + if (!add_method_klass) + g_error ("EnC: new method added but I don't know the class, should be caught by pass1"); + g_assert (add_method_klass); + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_METADATA_UPDATE, "Adding new method 0x%08x to class %s.%s", token_index, m_class_get_name_space (add_method_klass), m_class_get_name (add_method_klass)); + MonoDebugInformationEnc *method_debug_information = hot_reload_get_method_debug_information (delta_info->ppdb_file, token_index); + add_method_to_baseline (base_info, delta_info, add_method_klass, token_index, method_debug_information); + add_method_klass = NULL; } +#endif if (!base_info->method_table_update) base_info->method_table_update = g_hash_table_new (g_direct_hash, g_direct_equal); @@ -1372,7 +1656,7 @@ apply_enclog_pass2 (MonoImage *image_base, BaselineInfo *base_info, uint32_t gen delta_info->method_ppdb_table_update = g_hash_table_new (g_direct_hash, g_direct_equal); - int mapped_token = hot_reload_relative_delta_index (image_dmeta, mono_metadata_make_token (token_table, token_index)); + int mapped_token = hot_reload_relative_delta_index (image_dmeta, delta_info, mono_metadata_make_token (token_table, token_index)); int rva = mono_metadata_decode_row_col (&image_dmeta->tables [MONO_TABLE_METHOD], mapped_token - 1, MONO_METHOD_RVA); if (rva < dil_length) { char *il_address = ((char *) dil_data) + rva; @@ -1382,6 +1666,7 @@ apply_enclog_pass2 (MonoImage *image_base, BaselineInfo *base_info, uint32_t gen /* rva points probably into image_base IL stream. can this ever happen? */ g_print ("TODO: this case is still a bit contrived. token=0x%08x with rva=0x%04x\n", log_token, rva); } + add_method_klass = NULL; break; } case MONO_TABLE_TYPEDEF: { @@ -1405,6 +1690,26 @@ apply_enclog_pass2 (MonoImage *image_base, BaselineInfo *base_info, uint32_t gen } case MONO_TABLE_PARAM: { /* ok, pass1 checked for disallowed modifications */ + /* ALLOW_METHOD_ADD: FIXME: here we would really like to update the method's paramlist column to point to the new params. */ + /* if there were multiple added methods, this comes in as several method + * additions, followed by the parameter additions. + * + * 10: 0x02000002 (TypeDef) 0x00000001 (AddMethod) + * 11: 0x06000006 (MethodDef) 0 + * 12: 0x02000002 (TypeDef) 0x00000001 (AddMethod) + * 13: 0x06000007 (MethodDef) 0 + * 14: 0x06000006 (MethodDef) 0x00000003 (AddParameter) + * 15: 0x08000003 (Param) 0 + * 16: 0x06000006 (MethodDef) 0x00000003 (AddParameter) + * 17: 0x08000004 (Param) 0 + * 18: 0x06000007 (MethodDef) 0x00000003 (AddParameter) + * 19: 0x08000005 (Param) 0 + * + * So by the time we see the param additions, the methods are already in. + * + * FIXME: we need a lookaside table (like method_parent) for every place + * that looks at MONO_METHOD_PARAMLIST + */ break; } default: { @@ -1468,6 +1773,7 @@ hot_reload_apply_changes (int origin, MonoImage *image_base, gconstpointer dmeta /* makes a copy of dil_bytes_orig */ gpointer dil_bytes = open_dil_data (image_base, dil_bytes_orig, dil_length); + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_METADATA_UPDATE, "delta IL bytes copied to addr=%p", dil_bytes); MonoPPDBFile *ppdb_file = NULL; if (dpdb_length > 0) @@ -1482,7 +1788,8 @@ hot_reload_apply_changes (int origin, MonoImage *image_base, gconstpointer dmeta BaselineInfo *base_info = baseline_info_lookup_or_add (image_base); - DeltaInfo *delta_info = delta_info_init (image_dmeta, image_base, ppdb_file, base_info, generation); + DeltaInfo *prev_delta_info = NULL; + DeltaInfo *delta_info = delta_info_init (image_dmeta, image_base, ppdb_file, base_info, generation, &prev_delta_info); if (image_dmeta->minimal_delta) { @@ -1517,8 +1824,14 @@ hot_reload_apply_changes (int origin, MonoImage *image_base, gconstpointer dmeta return; } + delta_info_initialize_mutants (image_base, base_info, prev_delta_info, delta_info); + + prepare_mutated_rows (table_enclog, image_base, image_dmeta, delta_info); + + mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_METADATA_UPDATE, "Populated mutated tables for delta image %p", image_dmeta); + - if (!apply_enclog_pass1 (image_base, image_dmeta, dil_bytes, dil_length, error)) { + if (!apply_enclog_pass1 (image_base, image_dmeta, delta_info, dil_bytes, dil_length, error)) { mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_METADATA_UPDATE, "Error on sanity-checking delta image to base=%s, due to: %s", basename, mono_error_get_message (error)); hot_reload_update_cancel (generation); return; @@ -1547,35 +1860,6 @@ hot_reload_apply_changes (int origin, MonoImage *image_base, gconstpointer dmeta mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_METADATA_UPDATE, ">>> EnC delta for base=%s (generation %d) applied", basename, generation); } -/* - * Returns how many times the base image was updated upto and including the given delta. - */ -static int -metadata_update_local_generation (MonoImage *base, BaselineInfo *base_info, MonoImage *delta) -{ - if (delta == base) - return 0; - int index = g_list_index (base_info->delta_image, delta); - g_assert (index != -1); - return 1 + index; -} - -/* - * Returns how many times the given base image has been updated so far. - * - * NOTE: doesn't look at update_published or update_alloc_frontier, and therefore only usable by the - * update originator. - */ -static int -metadata_update_count_updates (MonoImage *base) -{ - BaselineInfo *base_info = baseline_info_lookup (base); - if (!base_info || !base_info->delta_image_last) - return 0; - else - return metadata_update_local_generation (base, base_info, (MonoImage*)base_info->delta_image_last->data); -} - static gpointer get_method_update_rva (MonoImage *image_base, BaselineInfo *base_info, uint32_t idx, gboolean is_pdb) { @@ -1585,9 +1869,8 @@ get_method_update_rva (MonoImage *image_base, BaselineInfo *base_info, uint32_t /* Go through all the updates that the current thread can see and see * if they updated the method. Keep the latest visible update */ - for (GList *ptr = base_info->delta_image; ptr != NULL; ptr = ptr->next) { - MonoImage *image_delta = (MonoImage*) ptr->data; - DeltaInfo *delta_info = delta_info_lookup (image_delta); + for (GList *ptr = base_info->delta_info; ptr != NULL; ptr = ptr->next) { + DeltaInfo *delta_info = (DeltaInfo*)ptr->data; g_assert (delta_info); if (delta_info->generation > cur) break; @@ -1624,6 +1907,10 @@ hot_reload_get_updated_method_ppdb (MonoImage *base_image, uint32_t idx) if (G_UNLIKELY (gen > 0)) { loc = get_method_update_rva (base_image, info, idx, TRUE); } + /* Check the method_parent table as a way of checking if the method was added by a later generation. If so, still look for its PPDB info in our update tables */ + if (G_UNLIKELY (loc == 0 && info->method_parent && GPOINTER_TO_UINT (g_hash_table_lookup (info->method_parent, GUINT_TO_POINTER (idx))) > 0)) { + loc = get_method_update_rva (base_image, info, idx, TRUE); + } } return loc; } @@ -1653,27 +1940,25 @@ hot_reload_table_bounds_check (MonoImage *base_image, int table_index, int token BaselineInfo *base_info = baseline_info_lookup (base_image); g_assert (base_info); - GList *list = base_info->delta_image; + GList *list = base_info->delta_info; MonoImage *dmeta; MonoTableInfo *table; /* result row, 0-based */ int ridx; - int original_token = mono_metadata_make_token (table_index, token_index); - uint32_t exposed_gen = hot_reload_get_thread_generation (); do { if (!list) return TRUE; - dmeta = list->data; - DeltaInfo *delta_info = delta_info_lookup (dmeta); + DeltaInfo *delta_info = (DeltaInfo*)list->data; g_assert (delta_info); + dmeta = delta_info->delta_image; if (delta_info->generation > exposed_gen) return TRUE; list = list->next; - table = &dmeta->tables [table_index]; - /* mono_image_relative_delta_index returns a 1-based index */ - ridx = hot_reload_relative_delta_index (dmeta, original_token) - 1; + + table = &delta_info->mutants [table_index]; + ridx = token_index - 1; } while (ridx < 0 || ridx >= table_info_get_rows (table)); return FALSE; @@ -1688,7 +1973,7 @@ hot_reload_delta_heap_lookup (MonoImage *base_image, MetadataHeapGetterFunc get_ g_assert (orig_index >= heap->size); BaselineInfo *base_info = baseline_info_lookup (base_image); g_assert (base_info); - g_assert (base_info->delta_image); + g_assert (base_info->delta_info); *image_out = base_image; *index_out = orig_index; @@ -1697,13 +1982,15 @@ hot_reload_delta_heap_lookup (MonoImage *base_image, MetadataHeapGetterFunc get_ uint32_t current_gen = hot_reload_get_thread_generation (); GList *cur; - for (cur = base_info->delta_image; cur; cur = cur->next) { - MonoImage *delta_image = (MonoImage*)cur->data; + for (cur = base_info->delta_info; cur; cur = cur->next) { + DeltaInfo *delta_info = (DeltaInfo*)cur->data; + g_assert (delta_info); + MonoImage *delta_image = delta_info->delta_image; + g_assert (delta_image); heap = get_heap (delta_image); *image_out = delta_image; - DeltaInfo *delta_info = delta_info_lookup (delta_image); if (delta_info->generation > current_gen) return FALSE; @@ -1730,3 +2017,74 @@ hot_reload_has_modified_rows (const MonoTableInfo *table) return info->any_modified_rows[tbl_index]; } +static int +hot_reload_table_num_rows_slow (MonoImage *base, int table_index) +{ + BaselineInfo *base_info = baseline_info_lookup (base); + if (!base_info) + return FALSE; + + uint32_t current_gen = hot_reload_get_thread_generation (); + + int rows = table_info_get_rows (&base->tables [table_index]); + GList *cur; + for (cur = base_info->delta_info; cur; cur = cur->next) { + DeltaInfo *delta_info = (DeltaInfo*)cur->data; + g_assert (delta_info); + if (delta_info->generation > current_gen) + break; + rows = delta_info->count [table_index].prev_gen_rows + delta_info->count [table_index].inserted_rows; + } + return rows; +} + +static void +add_method_to_baseline (BaselineInfo *base_info, DeltaInfo *delta_info, MonoClass *klass, uint32_t method_token, MonoDebugInformationEnc* pdb_address) +{ + if (!base_info->added_methods) { + base_info->added_methods = g_hash_table_new (g_direct_hash, g_direct_equal); + } + if (!base_info->method_parent) { + base_info->method_parent = g_hash_table_new (g_direct_hash, g_direct_equal); + } + /* FIXME: locking for readers/writers of the GArray */ + GArray *arr = g_hash_table_lookup (base_info->added_methods, klass); + if (!arr) { + arr = g_array_new (FALSE, FALSE, sizeof(uint32_t)); + g_hash_table_insert (base_info->added_methods, klass, arr); + } + g_array_append_val (arr, method_token); + g_hash_table_insert (base_info->method_parent, GUINT_TO_POINTER (method_token), GUINT_TO_POINTER (m_class_get_type_token (klass))); + + if (pdb_address) + set_delta_method_debug_info (delta_info, method_token, pdb_address); +} + +static GArray* +hot_reload_get_added_methods (MonoClass *klass) +{ + /* FIXME: locking for the GArray? */ + MonoImage *image = m_class_get_image (klass); + if (!image->has_updates) + return NULL; + BaselineInfo *base_info = baseline_info_lookup (image); + if (!base_info || base_info->added_methods == NULL) + return NULL; + + return g_hash_table_lookup (base_info->added_methods, klass); +} + +static uint32_t +hot_reload_method_parent (MonoImage *base_image, uint32_t method_token) +{ + if (!base_image->has_updates) + return 0; + BaselineInfo *base_info = baseline_info_lookup (base_image); + if (!base_info || base_info->method_parent == NULL) + return 0; + + uint32_t res = GPOINTER_TO_UINT (g_hash_table_lookup (base_info->method_parent, GUINT_TO_POINTER (method_token))); + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_METADATA_UPDATE, "method_parent lookup: 0x%08x returned 0x%08x\n", method_token, res); + + return res; +} diff --git a/src/mono/mono/component/hot_reload.h b/src/mono/mono/component/hot_reload.h index 37dc1401bbd111..416ff56e70eab0 100644 --- a/src/mono/mono/component/hot_reload.h +++ b/src/mono/mono/component/hot_reload.h @@ -21,8 +21,7 @@ typedef struct _MonoComponentHotReload { uint32_t (*thread_expose_published) (void); uint32_t (*get_thread_generation) (void); void (*cleanup_on_close) (MonoImage *image); - void (*effective_table_slow) (const MonoTableInfo **t, int *idx); - int (*relative_delta_index) (MonoImage *image_dmeta, int token); + void (*effective_table_slow) (const MonoTableInfo **t, int idx); void (*apply_changes) (int origin, MonoImage *base_image, gconstpointer dmeta, uint32_t dmeta_len, gconstpointer dil, uint32_t dil_len, gconstpointer dpdb_bytes_orig, uint32_t dpdb_length, MonoError *error); void (*image_close_except_pools_all) (MonoImage *base_image); void (*image_close_all) (MonoImage *base_image); @@ -31,6 +30,9 @@ typedef struct _MonoComponentHotReload { gboolean (*delta_heap_lookup) (MonoImage *base_image, MetadataHeapGetterFunc get_heap, uint32_t orig_index, MonoImage **image_out, uint32_t *index_out); gpointer (*get_updated_method_ppdb) (MonoImage *base_image, uint32_t idx); gboolean (*has_modified_rows) (const MonoTableInfo *table); + gboolean (*table_num_rows_slow) (MonoImage *base_image, int table_index); + GArray* (*get_added_methods) (MonoClass *klass); + uint32_t (*method_parent) (MonoImage *base_image, uint32_t method_index); } MonoComponentHotReload; MONO_COMPONENT_EXPORT_ENTRYPOINT diff --git a/src/mono/mono/component/mini-wasm-debugger.c b/src/mono/mono/component/mini-wasm-debugger.c index 77ceed873a2457..0cfcd5cce95882 100644 --- a/src/mono/mono/component/mini-wasm-debugger.c +++ b/src/mono/mono/component/mini-wasm-debugger.c @@ -54,6 +54,8 @@ static gboolean has_pending_lazy_loaded_assemblies; #define THREAD_TO_INTERNAL(thread) (thread)->internal_thread +extern void mono_wasm_debugger_log (int level, char *message); + void wasm_debugger_log (int level, const gchar *format, ...) { va_list args; @@ -62,19 +64,7 @@ void wasm_debugger_log (int level, const gchar *format, ...) va_start (args, format); mesg = g_strdup_vprintf (format, args); va_end (args); - - EM_ASM ({ - var level = $0; - var message = Module.UTF8ToString ($1); - var namespace = "Debugger.Debug"; - - if (INTERNAL["logging"] && INTERNAL.logging["debugger"]) { - INTERNAL.logging.debugger (level, message); - return; - } - - console.debug("%s: %s", namespace, message); - }, level, mesg); + mono_wasm_debugger_log(level, mesg); g_free (mesg); } @@ -367,16 +357,22 @@ mono_wasm_set_is_debugger_attached (gboolean is_attached) } } +extern void mono_wasm_add_dbg_command_received(mono_bool res_ok, int id, void* buffer, int buffer_len); + EMSCRIPTEN_KEEPALIVE gboolean mono_wasm_send_dbg_command_with_parms (int id, MdbgProtCommandSet command_set, int command, guint8* data, unsigned int size, int valtype, char* newvalue) { + if (!debugger_enabled) { + EM_ASM ({ + MONO.mono_wasm_add_dbg_command_received ($0, $1, $2, $3); + }, 0, id, 0, 0); + return TRUE; + } MdbgProtBuffer bufWithParms; buffer_init (&bufWithParms, 128); m_dbgprot_buffer_add_data (&bufWithParms, data, size); if (!write_value_to_buffer(&bufWithParms, valtype, newvalue)) { - EM_ASM ({ - INTERNAL.mono_wasm_add_dbg_command_received ($0, $1, $2, $3); - }, 0, id, 0, 0); + mono_wasm_add_dbg_command_received(0, id, 0, 0); return TRUE; } mono_wasm_send_dbg_command(id, command_set, command, bufWithParms.buf, m_dbgprot_buffer_len(&bufWithParms)); @@ -387,6 +383,12 @@ mono_wasm_send_dbg_command_with_parms (int id, MdbgProtCommandSet command_set, i EMSCRIPTEN_KEEPALIVE gboolean mono_wasm_send_dbg_command (int id, MdbgProtCommandSet command_set, int command, guint8* data, unsigned int size) { + if (!debugger_enabled) { + EM_ASM ({ + MONO.mono_wasm_add_dbg_command_received ($0, $1, $2, $3); + }, 0, id, 0, 0); + return TRUE; + } ss_calculate_framecount (NULL, NULL, TRUE, NULL, NULL); MdbgProtBuffer buf; buffer_init (&buf, 128); @@ -402,10 +404,9 @@ mono_wasm_send_dbg_command (int id, MdbgProtCommandSet command_set, int command, } else error = mono_process_dbg_packet (id, command_set, command, &no_reply, data, data + size, &buf); - EM_ASM ({ - INTERNAL.mono_wasm_add_dbg_command_received ($0, $1, $2, $3); - }, error == MDBGPROT_ERR_NONE, id, buf.buf, buf.p-buf.buf); - + + mono_wasm_add_dbg_command_received(error == MDBGPROT_ERR_NONE, id, buf.buf, buf.p-buf.buf); + buffer_free (&buf); return TRUE; } @@ -413,9 +414,7 @@ mono_wasm_send_dbg_command (int id, MdbgProtCommandSet command_set, int command, static gboolean receive_debugger_agent_message (void *data, int len) { - EM_ASM ({ - INTERNAL.mono_wasm_add_dbg_command_received (1, -1, $0, $1); - }, data, len); + mono_wasm_add_dbg_command_received(1, -1, data, len); mono_wasm_save_thread_context(); mono_wasm_fire_debugger_agent_message (); return FALSE; diff --git a/src/mono/mono/eglib/ghashtable.c b/src/mono/mono/eglib/ghashtable.c index 5329fab0cabc5a..8b5c29a1a9044c 100644 --- a/src/mono/mono/eglib/ghashtable.c +++ b/src/mono/mono/eglib/ghashtable.c @@ -86,7 +86,7 @@ static int calc_prime (int x) { int i; - + for (i = (x & (~1))-1; i< G_MAXINT32; i += 2) { if (test_prime (i)) return i; @@ -98,7 +98,7 @@ guint g_spaced_primes_closest (guint x) { int i; - + for (i = 0; i < G_N_ELEMENTS (prime_tbl); i++) { if (x <= prime_tbl [i]) return prime_tbl [i]; @@ -123,7 +123,7 @@ g_hash_table_new (GHashFunc hash_func, GEqualFunc key_equal_func) hash->table_size = g_spaced_primes_closest (1); hash->table = g_new0 (Slot *, hash->table_size); hash->last_rehash = hash->table_size; - + return hash; } @@ -134,10 +134,10 @@ g_hash_table_new_full (GHashFunc hash_func, GEqualFunc key_equal_func, GHashTable *hash = g_hash_table_new (hash_func, key_equal_func); if (hash == NULL) return NULL; - + hash->key_destroy_func = key_destroy_func; hash->value_destroy_func = value_destroy_func; - + return hash; } @@ -199,7 +199,7 @@ do_rehash (GHashTable *hash) /* printf ("New size: %d\n", hash->table_size); */ table = hash->table; hash->table = g_new0 (Slot *, hash->table_size); - + for (i = 0; i < current_size; i++){ Slot *s, *next; @@ -234,7 +234,7 @@ g_hash_table_insert_replace (GHashTable *hash, gpointer key, gpointer value, gbo guint hashcode; Slot *s; GEqualFunc equal; - + g_return_if_fail (hash != NULL); sanity_check (hash); @@ -301,7 +301,7 @@ guint g_hash_table_size (GHashTable *hash) { g_return_val_if_fail (hash != NULL, 0); - + return hash->in_use; } @@ -317,7 +317,7 @@ gpointer g_hash_table_lookup (GHashTable *hash, gconstpointer key) { gpointer orig_key, value; - + if (g_hash_table_lookup_extended (hash, key, &orig_key, &value)) return value; else @@ -330,13 +330,13 @@ g_hash_table_lookup_extended (GHashTable *hash, gconstpointer key, gpointer *ori GEqualFunc equal; Slot *s; guint hashcode; - + g_return_val_if_fail (hash != NULL, FALSE); sanity_check (hash); equal = hash->key_equal_func; hashcode = ((*hash->hash_func) (key)) % hash->table_size; - + for (s = hash->table [hashcode]; s != NULL; s = s->next){ if ((*equal)(s->key, key)){ if (orig_key) @@ -353,7 +353,7 @@ void g_hash_table_foreach (GHashTable *hash, GHFunc func, gpointer user_data) { int i; - + g_return_if_fail (hash != NULL); g_return_if_fail (func != NULL); @@ -369,7 +369,7 @@ gpointer g_hash_table_find (GHashTable *hash, GHRFunc predicate, gpointer user_data) { int i; - + g_return_val_if_fail (hash != NULL, NULL); g_return_val_if_fail (predicate != NULL, NULL); @@ -387,7 +387,7 @@ void g_hash_table_remove_all (GHashTable *hash) { int i; - + g_return_if_fail (hash != NULL); for (i = 0; i < hash->table_size; i++){ @@ -406,7 +406,7 @@ g_hash_table_remove (GHashTable *hash, gconstpointer key) GEqualFunc equal; Slot *s, *last; guint hashcode; - + g_return_val_if_fail (hash != NULL, FALSE); sanity_check (hash); equal = hash->key_equal_func; @@ -439,7 +439,7 @@ g_hash_table_foreach_remove (GHashTable *hash, GHRFunc func, gpointer user_data) { int i; int count = 0; - + g_return_val_if_fail (hash != NULL, 0); g_return_val_if_fail (func != NULL, 0); @@ -485,11 +485,11 @@ g_hash_table_steal (GHashTable *hash, gconstpointer key) GEqualFunc equal; Slot *s, *last; guint hashcode; - + g_return_val_if_fail (hash != NULL, FALSE); sanity_check (hash); equal = hash->key_equal_func; - + hashcode = ((*hash->hash_func)(key)) % hash->table_size; last = NULL; for (s = hash->table [hashcode]; s != NULL; s = s->next){ @@ -507,7 +507,7 @@ g_hash_table_steal (GHashTable *hash, gconstpointer key) } sanity_check (hash); return FALSE; - + } guint @@ -515,7 +515,7 @@ g_hash_table_foreach_steal (GHashTable *hash, GHRFunc func, gpointer user_data) { int i; int count = 0; - + g_return_val_if_fail (hash != NULL, 0); g_return_val_if_fail (func != NULL, 0); @@ -564,7 +564,7 @@ g_hash_table_destroy (GHashTable *hash) for (s = hash->table [i]; s != NULL; s = next){ next = s->next; - + if (hash->key_destroy_func != NULL) (*hash->key_destroy_func)(s->key); if (hash->value_destroy_func != NULL) @@ -573,7 +573,7 @@ g_hash_table_destroy (GHashTable *hash) } } g_free (hash->table); - + g_free (hash); } diff --git a/src/mono/mono/eglib/giconv.c b/src/mono/mono/eglib/giconv.c index 378b7ef0693848..6ab22e11933b48 100644 --- a/src/mono/mono/eglib/giconv.c +++ b/src/mono/mono/eglib/giconv.c @@ -116,41 +116,41 @@ g_iconv_open (const char *to_charset, const char *from_charset) Encoder encoder = NULL; GIConv cd; guint i; - + if (!to_charset || !from_charset || !to_charset[0] || !from_charset[0]) { mono_set_errno (EINVAL); - + return (GIConv) -1; } - + for (i = 0; i < G_N_ELEMENTS (charsets); i++) { if (!g_ascii_strcasecmp (charsets[i].name, from_charset)) decoder = charsets[i].decoder; - + if (!g_ascii_strcasecmp (charsets[i].name, to_charset)) encoder = charsets[i].encoder; } - + if (!encoder || !decoder) { #ifdef HAVE_LIBICONV if ((icd = iconv_open (to_charset, from_charset)) == (iconv_t) -1) return (GIConv) -1; #else mono_set_errno (EINVAL); - + return (GIConv) -1; #endif } - + cd = (GIConv) g_malloc (sizeof (struct _GIConv)); cd->decode = decoder; cd->encode = encoder; cd->c = -1; - + #ifdef HAVE_LIBICONV cd->cd = icd; #endif - + return cd; } @@ -161,9 +161,9 @@ g_iconv_close (GIConv cd) if (cd->cd != (iconv_t) -1) iconv_close (cd->cd); #endif - + g_free (cd); - + return 0; } @@ -175,21 +175,21 @@ g_iconv (GIConv cd, gchar **inbytes, gsize *inbytesleft, char *inptr, *outptr; gunichar c; int rc = 0; - + #ifdef HAVE_LIBICONV if (cd->cd != (iconv_t) -1) { /* Note: gsize may have a different size than size_t, so we need to remap inbytesleft and outbytesleft to size_t's. */ size_t *outleftptr, *inleftptr; size_t n_outleft, n_inleft; - + if (inbytesleft) { n_inleft = *inbytesleft; inleftptr = &n_inleft; } else { inleftptr = NULL; } - + if (outbytesleft) { n_outleft = *outbytesleft; outleftptr = &n_outleft; @@ -204,47 +204,47 @@ g_iconv (GIConv cd, gchar **inbytes, gsize *inbytesleft, #endif } #endif - + if (outbytes == NULL || outbytesleft == NULL) { /* reset converter */ cd->c = -1; return 0; } - + inleft = inbytesleft ? *inbytesleft : 0; inptr = inbytes ? *inbytes : NULL; outleft = *outbytesleft; outptr = *outbytes; - + if ((c = cd->c) != (gunichar) -1) goto encode; - + while (inleft > 0) { if ((rc = cd->decode (inptr, inleft, &c)) < 0) break; - + inleft -= rc; inptr += rc; - + encode: if ((rc = cd->encode (c, outptr, outleft)) < 0) break; - + c = (gunichar) -1; outleft -= rc; outptr += rc; } - + if (inbytesleft) *inbytesleft = inleft; - + if (inbytes) *inbytes = inptr; - + *outbytesleft = outleft; *outbytes = outptr; cd->c = c; - + return rc < 0 ? -1 : 0; } @@ -265,14 +265,14 @@ decode_utf32_endian (char *inbuf, size_t inleft, gunichar *outchar, unsigned end { unsigned char *inptr = (unsigned char *) inbuf; gunichar c; - + if (inleft < 4) { mono_set_errno (EINVAL); return -1; } - + c = read_uint32_endian (inptr, endian); - + if (c >= 0xd800 && c < 0xe000) { mono_set_errno (EILSEQ); return -1; @@ -280,9 +280,9 @@ decode_utf32_endian (char *inbuf, size_t inleft, gunichar *outchar, unsigned end mono_set_errno (EILSEQ); return -1; } - + *outchar = c; - + return 4; } @@ -302,17 +302,17 @@ static int encode_utf32be (gunichar c, char *outbuf, size_t outleft) { unsigned char *outptr = (unsigned char *) outbuf; - + if (outleft < 4) { mono_set_errno (E2BIG); return -1; } - + outptr[0] = (c >> 24) & 0xff; outptr[1] = (c >> 16) & 0xff; outptr[2] = (c >> 8) & 0xff; outptr[3] = c & 0xff; - + return 4; } @@ -320,17 +320,17 @@ static int encode_utf32le (gunichar c, char *outbuf, size_t outleft) { unsigned char *outptr = (unsigned char *) outbuf; - + if (outleft < 4) { mono_set_errno (E2BIG); return -1; } - + outptr[0] = c & 0xff; outptr[1] = (c >> 8) & 0xff; outptr[2] = (c >> 16) & 0xff; outptr[3] = (c >> 24) & 0xff; - + return 4; } @@ -348,14 +348,14 @@ decode_utf16_endian (char *inbuf, size_t inleft, gunichar *outchar, unsigned end unsigned char *inptr = (unsigned char *) inbuf; gunichar2 c; gunichar u; - + if (inleft < 2) { mono_set_errno (E2BIG); return -1; } - + u = read_uint16_endian (inptr, endian); - + if (u < 0xd800) { /* 0x0000 -> 0xd7ff */ *outchar = u; @@ -366,17 +366,17 @@ decode_utf16_endian (char *inbuf, size_t inleft, gunichar *outchar, unsigned end mono_set_errno (EINVAL); return -2; } - + c = read_uint16_endian (inptr + 2, endian); - + if (c < 0xdc00 || c > 0xdfff) { mono_set_errno (EILSEQ); return -2; } - + u = ((u - 0xd800) << 10) + (c - 0xdc00) + 0x0010000UL; *outchar = u; - + return 4; } else if (u < 0xe000) { /* 0xdc00 -> 0xdfff */ @@ -419,13 +419,13 @@ encode_utf16_endian (gunichar c, char *outbuf, size_t outleft, unsigned endian) unsigned char *outptr = (unsigned char *) outbuf; gunichar2 ch; gunichar c2; - + if (c < 0x10000) { if (outleft < 2) { mono_set_errno (E2BIG); return -1; } - + write_uint16_endian (outptr, c, endian); return 2; } else { @@ -433,14 +433,14 @@ encode_utf16_endian (gunichar c, char *outbuf, size_t outleft, unsigned endian) mono_set_errno (E2BIG); return -1; } - + c2 = c - 0x10000; - + ch = (gunichar2) ((c2 >> 10) + 0xd800); write_uint16_endian (outptr, ch, endian); ch = (gunichar2) ((c2 & 0x3ff) + 0xdc00); - write_uint16_endian (outptr + 2, ch, endian); + write_uint16_endian (outptr + 2, ch, endian); return 4; } } @@ -463,9 +463,9 @@ decode_utf8 (char *inbuf, size_t inleft, gunichar *outchar) unsigned char *inptr = (unsigned char *) inbuf; gunichar u; int n, i; - + u = *inptr; - + if (u < 0x80) { /* simple ascii case */ *outchar = u; @@ -492,12 +492,12 @@ decode_utf8 (char *inbuf, size_t inleft, gunichar *outchar) mono_set_errno (EILSEQ); return -1; } - + if (n > inleft) { mono_set_errno (EINVAL); return -1; } - + #if UNROLL_DECODE_UTF8 switch (n) { case 6: u = (u << 6) | (*++inptr ^ 0x80); @@ -510,9 +510,9 @@ decode_utf8 (char *inbuf, size_t inleft, gunichar *outchar) for (i = 1; i < n; i++) u = (u << 6) | (*++inptr ^ 0x80); #endif - + *outchar = u; - + return n; } @@ -521,7 +521,7 @@ encode_utf8 (gunichar c, char *outbuf, size_t outleft) { unsigned char *outptr = (unsigned char *) outbuf; int base, n, i; - + if (c < 0x80) { outptr[0] = c; return 1; @@ -541,12 +541,12 @@ encode_utf8 (gunichar c, char *outbuf, size_t outleft) base = 252; n = 6; } - + if (outleft < n) { mono_set_errno (E2BIG); return -1; } - + #if UNROLL_ENCODE_UTF8 switch (n) { case 6: outptr[5] = (c & 0x3f) | 0x80; c >>= 6; @@ -561,10 +561,10 @@ encode_utf8 (gunichar c, char *outbuf, size_t outleft) outptr[i] = (c & 0x3f) | 0x80; c >>= 6; } - + outptr[0] = c | base; #endif - + return n; } @@ -582,14 +582,14 @@ encode_latin1 (gunichar c, char *outbuf, size_t outleft) mono_set_errno (E2BIG); return -1; } - + if (c > 0xff) { mono_set_errno (EILSEQ); return -1; } - + *outbuf = (char) c; - + return 1; } @@ -615,37 +615,37 @@ g_convert (const gchar *str, gssize len, const gchar *to_charset, const gchar *f gboolean flush = FALSE; gboolean done = FALSE; GIConv cd; - + g_return_val_if_fail (str != NULL, NULL); g_return_val_if_fail (to_charset != NULL, NULL); g_return_val_if_fail (from_charset != NULL, NULL); - + if ((cd = g_iconv_open (to_charset, from_charset)) == (GIConv) -1) { g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_NO_CONVERSION, "Conversion from %s to %s not supported.", from_charset, to_charset); - + if (bytes_written) *bytes_written = 0; - + if (bytes_read) *bytes_read = 0; - + return NULL; } - + inleft = len < 0 ? strlen (str) : len; inbuf = (char *) str; - + outleft = outsize = MAX (inleft, 8); outbuf = result = g_malloc (outsize + 4); - + do { if (!flush) rc = g_iconv (cd, &inbuf, &inleft, &outbuf, &outleft); else rc = g_iconv (cd, NULL, NULL, &outbuf, &outleft); - + if (rc == (gsize) -1) { switch (errno) { case E2BIG: @@ -667,28 +667,28 @@ g_convert (const gchar *str, gssize len, const gchar *to_charset, const gchar *f case EILSEQ: /* illegal sequence in the input */ g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, "%s", g_strerror (errno)); - + if (bytes_read) { /* save offset of the illegal input sequence */ *bytes_read = (inbuf - str); } - + if (bytes_written) *bytes_written = 0; - + g_iconv_close (cd); g_free (result); return NULL; default: /* unknown errno */ g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, "%s", g_strerror (errno)); - + if (bytes_written) *bytes_written = 0; - + if (bytes_read) *bytes_read = 0; - + g_iconv_close (cd); g_free (result); return NULL; @@ -701,23 +701,23 @@ g_convert (const gchar *str, gssize len, const gchar *to_charset, const gchar *f flush = TRUE; } } while (!done); - + g_iconv_close (cd); - + /* Note: not all charsets can be null-terminated with a single null byte. UCS2, for example, needs 2 null bytes and UCS4 needs 4. I hope that 4 null bytes is enough to terminate all multibyte charsets? */ - + /* null-terminate the result */ memset (outbuf, 0, 4); - + if (bytes_written) *bytes_written = outbuf - result; - + if (bytes_read) *bytes_read = inbuf - str; - + return result; } @@ -735,7 +735,7 @@ gint g_unichar_to_utf8 (gunichar c, gchar *outbuf) { int base, n, i; - + if (c < 0x80) { base = 0; n = 1; @@ -757,18 +757,18 @@ g_unichar_to_utf8 (gunichar c, gchar *outbuf) } else { return -1; } - + if (outbuf != NULL) { for (i = n - 1; i > 0; i--) { /* mask off 6 bits worth and add 128 */ outbuf[i] = (c & 0x3f) | 0x80; c >>= 6; } - + /* first character has a different base */ outbuf[0] = c | base; } - + return n; } @@ -776,27 +776,27 @@ static FORCE_INLINE (int) g_unichar_to_utf16 (gunichar c, gunichar2 *outbuf) { gunichar c2; - + if (c < 0xd800) { if (outbuf) *outbuf = (gunichar2) c; - + return 1; } else if (c < 0xe000) { return -1; } else if (c < 0x10000) { if (outbuf) *outbuf = (gunichar2) c; - + return 1; } else if (c < 0x110000) { if (outbuf) { c2 = c - 0x10000; - + outbuf[0] = (gunichar2) ((c2 >> 10) + 0xd800); outbuf[1] = (gunichar2) ((c2 & 0x3ff) + 0xdc00); } - + return 2; } else { return -1; @@ -809,29 +809,29 @@ g_utf8_to_ucs4_fast (const gchar *str, glong len, glong *items_written) gunichar *outbuf, *outptr; char *inptr; glong n, i; - + g_return_val_if_fail (str != NULL, NULL); - + n = g_utf8_strlen (str, len); - + if (items_written) *items_written = n; - + outptr = outbuf = g_malloc ((n + 1) * sizeof (gunichar)); inptr = (char *) str; - + for (i = 0; i < n; i++) { *outptr++ = g_utf8_get_char (inptr); inptr = g_utf8_next_char (inptr); } - + *outptr = 0; - + return outbuf; } static gunichar2 * -eg_utf8_to_utf16_general (const gchar *str, glong len, glong *items_read, glong *items_written, gboolean include_nuls, gboolean replace_invalid_codepoints, GCustomAllocator custom_alloc_func, gpointer custom_alloc_data, GError **err) +eg_utf8_to_utf16_general (const gchar *str, glong len, glong *items_read, glong *items_written, gboolean include_nuls, gboolean replace_invalid_codepoints, GCustomAllocator custom_alloc_func, gpointer custom_alloc_data, GError **err) { gunichar2 *outbuf, *outptr; size_t outlen = 0; @@ -839,28 +839,28 @@ eg_utf8_to_utf16_general (const gchar *str, glong len, glong *items_read, glong char *inptr; gunichar c; int u, n; - + g_return_val_if_fail (str != NULL, NULL); - + if (len < 0) { if (include_nuls) { g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED, "Conversions with embedded nulls must pass the string length"); return NULL; } - + len = strlen (str); } - + inptr = (char *) str; inleft = len; - + while (inleft > 0) { if ((n = decode_utf8 (inptr, inleft, &c)) < 0) goto error; - + if (c == 0 && !include_nuls) break; - + if ((u = g_unichar_to_utf16 (c, NULL)) < 0) { if (replace_invalid_codepoints) { u = 2; @@ -869,18 +869,18 @@ eg_utf8_to_utf16_general (const gchar *str, glong len, glong *items_read, glong goto error; } } - + outlen += u; inleft -= n; inptr += n; } - + if (items_read) *items_read = inptr - str; - + if (items_written) *items_written = outlen; - + if (G_LIKELY (!custom_alloc_func)) outptr = outbuf = g_malloc ((outlen + 1) * sizeof (gunichar2)); else @@ -893,14 +893,14 @@ eg_utf8_to_utf16_general (const gchar *str, glong len, glong *items_read, glong inptr = (char *) str; inleft = len; - + while (inleft > 0) { if ((n = decode_utf8 (inptr, inleft, &c)) < 0) break; - + if (c == 0 && !include_nuls) break; - + u = g_unichar_to_utf16 (c, outptr); if ((u < 0) && replace_invalid_codepoints) { outptr[0] = 0xFFFD; @@ -912,11 +912,11 @@ eg_utf8_to_utf16_general (const gchar *str, glong len, glong *items_read, glong inleft -= n; inptr += n; } - + *outptr = '\0'; - + return outbuf; - + error: if (errno == ENOMEM) { g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_NO_MEMORY, @@ -930,13 +930,13 @@ eg_utf8_to_utf16_general (const gchar *str, glong len, glong *items_read, glong g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT, "Partial byte sequence encountered in the input."); } - + if (items_read) *items_read = inptr - str; - + if (items_written) *items_written = 0; - + return NULL; } @@ -973,15 +973,15 @@ g_utf8_to_ucs4 (const gchar *str, glong len, glong *items_read, glong *items_wri char *inptr; gunichar c; int n; - + g_return_val_if_fail (str != NULL, NULL); - + if (len < 0) len = strlen (str); - + inptr = (char *) str; inleft = len; - + while (inleft > 0) { if ((n = decode_utf8 (inptr, inleft, &c)) < 0) { if (errno == EILSEQ) { @@ -994,45 +994,45 @@ g_utf8_to_ucs4 (const gchar *str, glong len, glong *items_read, glong *items_wri g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT, "Partial byte sequence encountered in the input."); } - + if (items_read) *items_read = inptr - str; - + if (items_written) *items_written = 0; - + return NULL; } else if (c == 0) break; - + outlen += 4; inleft -= n; inptr += n; } - + if (items_written) *items_written = outlen / 4; - + if (items_read) *items_read = inptr - str; - + outptr = outbuf = g_malloc (outlen + 4); inptr = (char *) str; inleft = len; - + while (inleft > 0) { if ((n = decode_utf8 (inptr, inleft, &c)) < 0) break; else if (c == 0) break; - + *outptr++ = c; inleft -= n; inptr += n; } - + *outptr = 0; - + return outbuf; } @@ -1045,18 +1045,18 @@ eg_utf16_to_utf8_general (const gunichar2 *str, glong len, glong *items_read, gl size_t inleft; gunichar c; int n; - + g_return_val_if_fail (str != NULL, NULL); - + if (len < 0) { len = 0; while (str[len]) len++; } - + inptr = (char *) str; inleft = len * 2; - + while (inleft > 0) { if ((n = decode_utf16 (inptr, inleft, &c)) < 0) { if (n == -2 && inleft > 2) { @@ -1064,7 +1064,7 @@ eg_utf16_to_utf8_general (const gunichar2 *str, glong len, glong *items_read, gl inleft -= 2; inptr += 2; } - + if (errno == EILSEQ) { g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, "Illegal byte sequence encounted in the input."); @@ -1075,25 +1075,25 @@ eg_utf16_to_utf8_general (const gunichar2 *str, glong len, glong *items_read, gl g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT, "Partial byte sequence encountered in the input."); } - + if (items_read) *items_read = (inptr - (char *) str) / 2; - + if (items_written) *items_written = 0; - + return NULL; } else if (c == 0) break; - + outlen += g_unichar_to_utf8 (c, NULL); inleft -= n; inptr += n; } - + if (items_read) *items_read = (inptr - (char *) str) / 2; - + if (items_written) *items_written = outlen; @@ -1108,23 +1108,23 @@ eg_utf16_to_utf8_general (const gunichar2 *str, glong len, glong *items_read, gl *items_written = 0; return NULL; } - + inptr = (char *) str; inleft = len * 2; - + while (inleft > 0) { if ((n = decode_utf16 (inptr, inleft, &c)) < 0) break; else if (c == 0) break; - + outptr += g_unichar_to_utf8 (c, outptr); inleft -= n; inptr += n; } - + *outptr = '\0'; - + return outbuf; } @@ -1149,18 +1149,18 @@ g_utf16_to_ucs4 (const gunichar2 *str, glong len, glong *items_read, glong *item char *inptr; gunichar c; int n; - + g_return_val_if_fail (str != NULL, NULL); - + if (len < 0) { len = 0; while (str[len]) len++; } - + inptr = (char *) str; inleft = len * 2; - + while (inleft > 0) { if ((n = decode_utf16 (inptr, inleft, &c)) < 0) { if (n == -2 && inleft > 2) { @@ -1168,7 +1168,7 @@ g_utf16_to_ucs4 (const gunichar2 *str, glong len, glong *items_read, glong *item inleft -= 2; inptr += 2; } - + if (errno == EILSEQ) { g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, "Illegal byte sequence encounted in the input."); @@ -1179,45 +1179,45 @@ g_utf16_to_ucs4 (const gunichar2 *str, glong len, glong *items_read, glong *item g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_PARTIAL_INPUT, "Partial byte sequence encountered in the input."); } - + if (items_read) *items_read = (inptr - (char *) str) / 2; - + if (items_written) *items_written = 0; - + return NULL; } else if (c == 0) break; - + outlen += 4; inleft -= n; inptr += n; } - + if (items_read) *items_read = (inptr - (char *) str) / 2; - + if (items_written) *items_written = outlen / 4; - + outptr = outbuf = g_malloc (outlen + 4); inptr = (char *) str; inleft = len * 2; - + while (inleft > 0) { if ((n = decode_utf16 (inptr, inleft, &c)) < 0) break; else if (c == 0) break; - + *outptr++ = c; inleft -= n; inptr += n; } - + *outptr = 0; - + return outbuf; } @@ -1228,24 +1228,24 @@ g_ucs4_to_utf8 (const gunichar *str, glong len, glong *items_read, glong *items_ size_t outlen = 0; glong i; int n; - + g_return_val_if_fail (str != NULL, NULL); - + if (len < 0) { for (i = 0; str[i] != 0; i++) { if ((n = g_unichar_to_utf8 (str[i], NULL)) < 0) { g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, "Illegal byte sequence encounted in the input."); - + if (items_written) *items_written = 0; - + if (items_read) *items_read = i; - + return NULL; } - + outlen += n; } } else { @@ -1253,33 +1253,33 @@ g_ucs4_to_utf8 (const gunichar *str, glong len, glong *items_read, glong *items_ if ((n = g_unichar_to_utf8 (str[i], NULL)) < 0) { g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, "Illegal byte sequence encounted in the input."); - + if (items_written) *items_written = 0; - + if (items_read) *items_read = i; - + return NULL; } - + outlen += n; } } - + len = i; - + outptr = outbuf = g_malloc (outlen + 1); for (i = 0; i < len; i++) outptr += g_unichar_to_utf8 (str[i], outptr); *outptr = 0; - + if (items_written) *items_written = outlen; - + if (items_read) *items_read = i; - + return outbuf; } @@ -1290,24 +1290,24 @@ g_ucs4_to_utf16 (const gunichar *str, glong len, glong *items_read, glong *items size_t outlen = 0; glong i; int n; - + g_return_val_if_fail (str != NULL, NULL); - + if (len < 0) { for (i = 0; str[i] != 0; i++) { if ((n = g_unichar_to_utf16 (str[i], NULL)) < 0) { g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, "Illegal byte sequence encounted in the input."); - + if (items_written) *items_written = 0; - + if (items_read) *items_read = i; - + return NULL; } - + outlen += n; } } else { @@ -1315,33 +1315,33 @@ g_ucs4_to_utf16 (const gunichar *str, glong len, glong *items_read, glong *items if ((n = g_unichar_to_utf16 (str[i], NULL)) < 0) { g_set_error (err, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE, "Illegal byte sequence encounted in the input."); - + if (items_written) *items_written = 0; - + if (items_read) *items_read = i; - + return NULL; } - + outlen += n; } } - + len = i; - + outptr = outbuf = g_malloc ((outlen + 1) * sizeof (gunichar2)); for (i = 0; i < len; i++) outptr += g_unichar_to_utf16 (str[i], outptr); *outptr = 0; - + if (items_written) *items_written = outlen; - + if (items_read) *items_read = i; - + return outbuf; } diff --git a/src/mono/mono/eglib/glib.h b/src/mono/mono/eglib/glib.h index 5a454a037202f5..14872b9814f481 100644 --- a/src/mono/mono/eglib/glib.h +++ b/src/mono/mono/eglib/glib.h @@ -27,6 +27,7 @@ #include #include #include +#include // - Pointers should only be converted to or from pointer-sized integers. // - Any size integer can be converted to any other size integer. @@ -206,10 +207,7 @@ typedef guint32 gunichar; /* * Macros */ -#define G_N_ELEMENTS(s) (sizeof(s) / sizeof ((s) [0])) - -// e.g. strncmp (foo, G_STRING_CONSTANT_AND_LENGTH ("version")) -#define G_STRING_CONSTANT_AND_LENGTH(x) (x), G_N_ELEMENTS (x) - 1 +#define G_N_ELEMENTS(s) ARRAY_SIZE(s) #define FALSE 0 #define TRUE 1 @@ -234,7 +232,7 @@ typedef guint32 gunichar; #define G_LITTLE_ENDIAN 1234 #define G_BIG_ENDIAN 4321 -#define G_STMT_START do +#define G_STMT_START do #define G_STMT_END while (0) #define G_USEC_PER_SEC 1000000 @@ -755,14 +753,14 @@ void g_queue_foreach (GQueue *queue, GFunc func, gpointer user_data); typedef enum { G_LOG_FLAG_RECURSION = 1 << 0, G_LOG_FLAG_FATAL = 1 << 1, - + G_LOG_LEVEL_ERROR = 1 << 2, G_LOG_LEVEL_CRITICAL = 1 << 3, G_LOG_LEVEL_WARNING = 1 << 4, G_LOG_LEVEL_MESSAGE = 1 << 5, G_LOG_LEVEL_INFO = 1 << 6, G_LOG_LEVEL_DEBUG = 1 << 7, - + G_LOG_LEVEL_MASK = ~(G_LOG_FLAG_RECURSION | G_LOG_FLAG_FATAL) } GLogLevelFlags; @@ -951,16 +949,16 @@ GUnicodeBreakType g_unichar_break_type (gunichar c); * Where you might have said: * if (!(expr)) * g_error("%s invalid bar:%d", __func__, bar) - * + * * You can say: * g_assertf(expr, "bar:%d", bar); - * + * * The usual assertion text of file/line/expr/newline are builtin, and __func__. - * + * * g_assertf is a boolean expression -- the precise value is not preserved, just true or false. - * + * * Other than expr, the parameters are not evaluated unless expr is false. - * + * * format must be a string literal, in order to be concatenated. * If this is too restrictive, g_error remains. */ @@ -1222,7 +1220,7 @@ g_async_safe_fgets (char *str, int num, int handle, gboolean *newline) str [i] = '\0'; *newline = TRUE; } - + if (!isprint (str [i])) str [i] = '\0'; @@ -1317,16 +1315,16 @@ typedef struct { const gchar *element_name, gpointer user_data, GError **gerror); - + void (*text) (GMarkupParseContext *context, const gchar *text, - gsize text_len, + gsize text_len, gpointer user_data, GError **gerror); - + void (*passthrough) (GMarkupParseContext *context, const gchar *passthrough_text, - gsize text_len, + gsize text_len, gpointer user_data, GError **gerror); void (*error) (GMarkupParseContext *context, @@ -1393,12 +1391,12 @@ glong g_utf8_pointer_to_offset (const gchar *str, const gchar *pos); ((((guint32) (x)) & 0xff0000) >> 8) | \ ((((guint32) (x)) & 0xff00) << 8) | \ (((guint32) (x)) >> 24)) ) - + #define GUINT64_SWAP_LE_BE(x) ((guint64) (((guint64)(GUINT32_SWAP_LE_BE(((guint64)x) & 0xffffffff))) << 32) | \ GUINT32_SWAP_LE_BE(((guint64)x) >> 32)) - - + + #if G_BYTE_ORDER == G_LITTLE_ENDIAN # define GUINT64_FROM_BE(x) GUINT64_SWAP_LE_BE(x) # define GUINT32_FROM_BE(x) GUINT32_SWAP_LE_BE(x) @@ -1445,7 +1443,7 @@ glong g_utf8_pointer_to_offset (const gchar *str, const gchar *pos); #define _EGLIB_MAJOR 2 #define _EGLIB_MIDDLE 4 #define _EGLIB_MINOR 0 - + #define GLIB_CHECK_VERSION(a,b,c) ((a < _EGLIB_MAJOR) || (a == _EGLIB_MAJOR && (b < _EGLIB_MIDDLE || (b == _EGLIB_MIDDLE && c <= _EGLIB_MINOR)))) #define G_HAVE_API_SUPPORT(x) (x) diff --git a/src/mono/mono/eglib/gmodule-win32.c b/src/mono/mono/eglib/gmodule-win32.c index b4521c61cd20fb..18084b24577a6e 100644 --- a/src/mono/mono/eglib/gmodule-win32.c +++ b/src/mono/mono/eglib/gmodule-win32.c @@ -56,7 +56,7 @@ g_module_open (const gchar *file, GModuleFlags flags) if (file != NULL) { gunichar2 *file16; - file16 = u8to16(file); + file16 = u8to16(file); module->main_module = FALSE; module->handle = LoadLibraryW (file16); g_free(file16); @@ -64,7 +64,7 @@ g_module_open (const gchar *file, GModuleFlags flags) g_free (module); return NULL; } - + } else { module->main_module = TRUE; module->handle = GetModuleHandle (NULL); @@ -221,7 +221,7 @@ g_module_error (void) #else WCHAR local_buf [1024]; if (!FormatMessageW (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, - code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), local_buf, G_N_ELEMENTS (local_buf) - 1, NULL) ) + code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), local_buf, STRING_LENGTH (local_buf), NULL) ) local_buf [0] = TEXT('\0'); ret = u16to8 (local_buf); @@ -256,18 +256,18 @@ gchar * g_module_build_path (const gchar *directory, const gchar *module_name) { const char *lib_prefix = ""; - + if (module_name == NULL) return NULL; if (strncmp (module_name, "lib", 3) != 0) lib_prefix = LIBPREFIX; - - if (directory && *directory){ - + + if (directory && *directory){ + return g_strdup_printf ("%s/%s%s" LIBSUFFIX, directory, lib_prefix, module_name); } - return g_strdup_printf ("%s%s" LIBSUFFIX, lib_prefix, module_name); + return g_strdup_printf ("%s%s" LIBSUFFIX, lib_prefix, module_name); } // This is not about GModule but is still a close fit. diff --git a/src/mono/mono/eglib/test/utf8.c b/src/mono/mono/eglib/test/utf8.c index cc298b0d2cece2..4f0766ce2ec3d4 100644 --- a/src/mono/mono/eglib/test/utf8.c +++ b/src/mono/mono/eglib/test/utf8.c @@ -115,7 +115,7 @@ test_utf16_to_utf8 (void) } /* - * g_utf8_to_utf16 + * g_utf8_to_utf16 */ static glong @@ -312,94 +312,94 @@ test_convert (void) gboolean loaded; guint i, j, k; char c; - + if (!(srcdir = getenv ("srcdir")) && !(srcdir = getenv ("PWD"))) return FAILED ("srcdir not defined!"); - + expected = g_malloc (sizeof (convert_result_t *) * G_N_ELEMENTS (charsets)); - + /* first load all our test samples... */ for (i = 0; i < G_N_ELEMENTS (charsets); i++) { path = g_strdup_printf ("%s%c%s.txt", srcdir, G_DIR_SEPARATOR, charsets[i]); loaded = g_file_get_contents (path, &content, &length, &err); g_free (path); - + if (!loaded) { for (j = 0; j < i; j++) { g_free (expected[j]->content); g_free (expected[j]); } - + g_free (expected); - + return FAILED ("Failed to load content for %s: %s", charsets[i], err->message); } - + expected[i] = g_malloc (sizeof (convert_result_t)); expected[i]->content = content; expected[i]->length = length; } - + /* test conversion from every charset to every other charset */ for (i = 0; i < G_N_ELEMENTS (charsets); i++) { for (j = 0; j < G_N_ELEMENTS (charsets); j++) { converted = g_convert (expected[i]->content, expected[i]->length, charsets[j], charsets[i], NULL, &converted_length, NULL); - + if (converted == NULL) { for (k = 0; k < G_N_ELEMENTS (charsets); k++) { g_free (expected[k]->content); g_free (expected[k]); } - + g_free (expected); - + return FAILED ("Failed to convert from %s to %s: NULL", charsets[i], charsets[j]); } - + if (converted_length != expected[j]->length) { length = expected[j]->length; - + for (k = 0; k < G_N_ELEMENTS (charsets); k++) { g_free (expected[k]->content); g_free (expected[k]); } - + g_free (converted); g_free (expected); - + return FAILED ("Failed to convert from %s to %s: expected %u bytes, got %u", charsets[i], charsets[j], length, converted_length); } - + for (n = 0; n < converted_length; n++) { if (converted[n] != expected[j]->content[n]) { c = expected[j]->content[n]; - + for (k = 0; k < G_N_ELEMENTS (charsets); k++) { g_free (expected[k]->content); g_free (expected[k]); } - + g_free (converted); g_free (expected); - + return FAILED ("Failed to convert from %s to %s: expected 0x%x at offset %u, got 0x%x", charsets[i], charsets[j], c, n, converted[n]); } } - + g_free (converted); } } - + for (k = 0; k < G_N_ELEMENTS (charsets); k++) { g_free (expected[k]->content); g_free (expected[k]); } - + g_free (expected); - + return OK; } @@ -407,13 +407,13 @@ static RESULT test_xdigit (void) { static char test_chars[] = { - '0', '1', '2', '3', '4', - '5', '6', '7', '8', '9', + '0', '1', '2', '3', '4', + '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'A', 'B', 'C', 'D', 'E', 'F', 'G'}; static gint32 test_values[] = { - 0, 1, 2, 3, 4, - 5, 6, 7, 8, 9, + 0, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1, 10, 11, 12, 13, 14, 15, -1}; @@ -449,9 +449,9 @@ ucs4_to_utf16_check_result (const gunichar2 *result_str, const gunichar2 *expect if (result_str [i] != expected_str [i]) return FAILED("Incorrect value %d at index %d", result_str [i], i); } - if (result_str && result_str[expected_items_written] != '\0') + if (result_str && result_str[expected_items_written] != '\0') return FAILED("Null termination not found at the end of the string."); - + return OK; } @@ -475,7 +475,7 @@ test_ucs4_to_utf16 (void) GError* err=0; RESULT check_result; glong i; - + res = g_ucs4_to_utf16 (str1, 12, &items_read, &items_written, &err); check_result = ucs4_to_utf16_check_result (res, exp1, items_read, 11, items_written, 11, err, FALSE); if (check_result) return check_result; @@ -519,7 +519,7 @@ test_ucs4_to_utf16 (void) items_read = items_written = 0; err = 0; res = g_ucs4_to_utf16 (&str5[i], 1, &items_read, &items_written, &err); - check_result = ucs4_to_utf16_check_result (res, &exp5[current_write_index], + check_result = ucs4_to_utf16_check_result (res, &exp5[current_write_index], items_read, read_write[i*2], items_written, read_write[(i*2)+1], err, !read_write[(i*2)+1]); if (check_result) return check_result; g_free (res); @@ -559,9 +559,9 @@ utf16_to_ucs4_check_result (const gunichar *result_str, const gunichar *expected if (result_str [i] != expected_str [i]) return FAILED("Incorrect value %d at index %d", result_str [i], i); } - if (result_str && result_str[expected_items_written] != '\0') + if (result_str && result_str[expected_items_written] != '\0') return FAILED("Null termination not found at the end of the string."); - + return OK; } @@ -585,63 +585,63 @@ test_utf16_to_ucs4 (void) GError* err=0; RESULT check_result; glong i; - + res = g_utf16_to_ucs4 (str1, 12, &items_read, &items_written, &err); check_result = utf16_to_ucs4_check_result (res, exp1, items_read, 11, items_written, 11, err, FALSE); if (check_result) return check_result; g_free (res); - + items_read = items_written = 0; res = g_utf16_to_ucs4 (str2, 0, &items_read, &items_written, &err); check_result = utf16_to_ucs4_check_result (res, exp2, items_read, 0, items_written, 0, err, FALSE); if (check_result) return check_result; g_free (res); - + items_read = items_written = 0; res = g_utf16_to_ucs4 (str2, 1, &items_read, &items_written, &err); check_result = utf16_to_ucs4_check_result (res, exp2, items_read, 1, items_written, 1, err, FALSE); if (check_result) return check_result; g_free (res); - + items_read = items_written = 0; res = g_utf16_to_ucs4 (str2, 2, &items_read, &items_written, &err); check_result = utf16_to_ucs4_check_result (res, exp2, items_read, 1, items_written, 1, err, FALSE); if (check_result) return check_result; g_free (res); - + items_read = items_written = 0; res = g_utf16_to_ucs4 (str2, 3, &items_read, &items_written, &err); check_result = utf16_to_ucs4_check_result (res, exp2, items_read, 3, items_written, 2, err, FALSE); if (check_result) return check_result; g_free (res); - + items_read = items_written = 0; res = g_utf16_to_ucs4 (str2, 4, &items_read, &items_written, &err); check_result = utf16_to_ucs4_check_result (res, exp2, items_read, 3, items_written, 2, err, FALSE); if (check_result) return check_result; g_free (res); - + items_read = items_written = 0; res = g_utf16_to_ucs4 (str2, 5, &items_read, &items_written, &err); check_result = utf16_to_ucs4_check_result (res, exp2, items_read, 4, items_written, 0, err, TRUE); if (check_result) return check_result; g_free (res); - + items_read = items_written = 0; err = 0; res = g_utf16_to_ucs4 (str3, 5, &items_read, &items_written, &err); check_result = utf16_to_ucs4_check_result (res, exp3, items_read, 1, items_written, 0, err, TRUE); if (check_result) return check_result; g_free (res); - + // This loop tests the bounds of the conversion algorithm current_read_index = current_write_index = 0; for (i=0;i<11;i++) { items_read = items_written = 0; err = 0; res = g_utf16_to_ucs4 (&str4[current_read_index], read_write[i*3], &items_read, &items_written, &err); - check_result = utf16_to_ucs4_check_result (res, &exp4[current_write_index], items_read, - read_write[(i*3)+1], items_written, read_write[(i*3)+2], err, + check_result = utf16_to_ucs4_check_result (res, &exp4[current_write_index], items_read, + read_write[(i*3)+1], items_written, read_write[(i*3)+2], err, !read_write[(i*3)+2]); if (check_result) return check_result; g_free (res); @@ -666,9 +666,9 @@ test_utf8_strlen (void) gchar word2 [] = {0xF1, 0x82, 0x82, 0x82,0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,'\0'};//Valid, len = 5 gchar word3 [] = {'h','e',0xC2, 0x82,0x45,'\0'}; //Valid, len = 4 gchar word4 [] = {0x62,0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,'\0'}; //Valid, len = 5 - + glong len = 0; - + //Test word1 len = g_utf8_strlen (word1,-1); if (len != 5) @@ -683,22 +683,22 @@ test_utf8_strlen (void) len = g_utf8_strlen (word1,3); if (len != 2) return FAILED ("Word1, max = 2, expected length of 2, but was %i", len); - + //Test word2 len = g_utf8_strlen (word2,-1); if (len != 5) return FAILED ("Word2 expected length of 5, but was %i", len); - + //Test word3 len = g_utf8_strlen (word3,-1); if (len != 4) return FAILED ("Word3 expected length of 4, but was %i", len); - + //Test word4 len = g_utf8_strlen (word4,-1); if (len != 5) return FAILED ("Word4 expected length of 5, but was %i", len); - + //Test null case len = g_utf8_strlen(NULL,0); if (len != 0) @@ -737,7 +737,7 @@ test_utf8_next_char (void) gchar word2 [] = {0xF1, 0x82, 0x82, 0x82,0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,'\0'}; //Valid, len = 5 gchar word1ExpectedValues [] = {0xC2, 0x45,0xE1, 0x58, 0xF1}; gchar word2ExpectedValues [] = {0xF1, 0xC2, 0x45, 0xE1, 0x58}; - + gchar* ptr = word1; gint count = 0; //Test word1 @@ -749,7 +749,7 @@ test_utf8_next_char (void) ptr = g_utf8_next_char (ptr); count++; } - + //Test word2 count = 0; ptr = word2; @@ -761,7 +761,7 @@ test_utf8_next_char (void) ptr = g_utf8_next_char (ptr); count++; } - + return OK; } @@ -774,7 +774,7 @@ test_utf8_validate (void) gchar validWord1 [] = {0xC2, 0x82, 0xC3,0xA0,'\0'}; //Valid gchar validWord2 [] = {0xC2, 0x82,0x45,0xE1, 0x81, 0x83,0x58,0xF1, 0x82, 0x82, 0x82,'\0'}; //Valid - + const gchar* end; gboolean retVal = g_utf8_validate (invalidWord1, -1, &end); if (retVal != FALSE) diff --git a/src/mono/mono/eventpipe/ep-rt-mono.h b/src/mono/mono/eventpipe/ep-rt-mono.h index 02ba8024a7fc76..6829e696f41d87 100644 --- a/src/mono/mono/eventpipe/ep-rt-mono.h +++ b/src/mono/mono/eventpipe/ep-rt-mono.h @@ -28,9 +28,6 @@ #include #include -#undef EP_ARRAY_SIZE -#define EP_ARRAY_SIZE(expr) G_N_ELEMENTS(expr) - #undef EP_INFINITE_WAIT #define EP_INFINITE_WAIT MONO_INFINITE_WAIT @@ -1756,7 +1753,7 @@ ep_rt_utf8_string_replace ( if (strFound != NULL) { size_t strSearchLen = strlen(strSearch); - size_t newStrSize = strlen(*str) + strlen(strReplacement) - strSearchLen + 1; + size_t newStrSize = strlen(*str) + strlen(strReplacement) - strSearchLen + 1; ep_char8_t *newStr = g_new(ep_char8_t, newStrSize); if (newStr == NULL) { diff --git a/src/mono/mono/eventpipe/test/ep-buffer-manager-tests.c b/src/mono/mono/eventpipe/test/ep-buffer-manager-tests.c index 642b58e52975c2..126b04740c0b20 100644 --- a/src/mono/mono/eventpipe/test/ep-buffer-manager-tests.c +++ b/src/mono/mono/eventpipe/test/ep-buffer-manager-tests.c @@ -162,7 +162,7 @@ write_events ( uint32_t i = 0; for (; i < event_count; ++i) { EventPipeEventPayload payload; - ep_event_payload_init (&payload, (uint8_t *)TEST_EVENT_DATA, EP_ARRAY_SIZE (TEST_EVENT_DATA)); + ep_event_payload_init (&payload, (uint8_t *)TEST_EVENT_DATA, ARRAY_SIZE (TEST_EVENT_DATA)); result = ep_buffer_manager_write_event (buffer_manager, thread, session, ep_event, &payload, NULL, NULL, thread, NULL); ep_event_payload_fini (&payload); diff --git a/src/mono/mono/eventpipe/test/ep-buffer-tests.c b/src/mono/mono/eventpipe/test/ep-buffer-tests.c index 4ff600864c4ad2..add8bfe358b6eb 100644 --- a/src/mono/mono/eventpipe/test/ep-buffer-tests.c +++ b/src/mono/mono/eventpipe/test/ep-buffer-tests.c @@ -141,7 +141,7 @@ load_buffer ( event_data_len = strlen (event_data) + 1; }else { event_data = (gchar *)TEST_EVENT_DATA; - event_data_len = EP_ARRAY_SIZE (TEST_EVENT_DATA); + event_data_len = ARRAY_SIZE (TEST_EVENT_DATA); } if (event_data) { ep_event_payload_init (&payload, (uint8_t *)event_data, event_data_len); diff --git a/src/mono/mono/eventpipe/test/ep-tests.c b/src/mono/mono/eventpipe/test/ep-tests.c index e9e30c39833215..f7eab1c96b9638 100644 --- a/src/mono/mono/eventpipe/test/ep-tests.c +++ b/src/mono/mono/eventpipe/test/ep-tests.c @@ -1107,7 +1107,7 @@ test_write_event (void) EventData data[1]; ep_event_data_init (&data[0], 0, 0, 0); - ep_write_event_2 (ep_event, data, EP_ARRAY_SIZE (data), NULL, NULL); + ep_write_event_2 (ep_event, data, ARRAY_SIZE (data), NULL, NULL); ep_event_data_fini (data); ep_on_exit: @@ -1158,7 +1158,7 @@ test_write_get_next_event (void) EventData data[1]; ep_event_data_init (&data[0], 0, 0, 0); - ep_write_event_2 (ep_event, data, EP_ARRAY_SIZE (data), NULL, NULL); + ep_write_event_2 (ep_event, data, ARRAY_SIZE (data), NULL, NULL); ep_event_data_fini (data); event_instance = ep_get_next_event (session_id); @@ -1234,7 +1234,7 @@ test_write_wait_get_next_event (void) EventData data[1]; ep_event_data_init (&data[0], 0, 0, 0); for (int i = 0; i < 100; i++) - ep_write_event_2 (ep_event, data, EP_ARRAY_SIZE (data), NULL, NULL); + ep_write_event_2 (ep_event, data, ARRAY_SIZE (data), NULL, NULL); ep_event_data_fini (data); //Should be signaled, since we should have buffers put in readonly by now. @@ -1303,7 +1303,7 @@ test_write_event_perf (void) for (events_written = 0; events_written < 10 * 1000 * 1000; events_written += 1000) { int64_t start = ep_perf_timestamp_get (); for (uint32_t i = 0; i < 1000; i++) - ep_write_event_2 (ep_event, data, EP_ARRAY_SIZE (data), NULL, NULL); + ep_write_event_2 (ep_event, data, ARRAY_SIZE (data), NULL, NULL); int64_t stop = ep_perf_timestamp_get (); accumulted_write_time_ticks += stop - start; diff --git a/src/mono/mono/metadata/assembly-load-context.c b/src/mono/mono/metadata/assembly-load-context.c index 93686653fb098e..627086e3f5dfdc 100644 --- a/src/mono/mono/metadata/assembly-load-context.c +++ b/src/mono/mono/metadata/assembly-load-context.c @@ -424,11 +424,19 @@ mono_alc_from_gchandle (MonoGCHandle alc_gchandle) if (alc_gchandle == default_alc->gchandle) return default_alc; - HANDLE_FUNCTION_ENTER (); - MonoManagedAssemblyLoadContextHandle managed_alc = MONO_HANDLE_CAST (MonoManagedAssemblyLoadContext, mono_gchandle_get_target_handle (alc_gchandle)); - g_assert (!MONO_HANDLE_IS_NULL (managed_alc)); - MonoAssemblyLoadContext *alc = MONO_HANDLE_GETVAL (managed_alc, native_assembly_load_context); - HANDLE_FUNCTION_RETURN_VAL (alc); + MONO_STATIC_POINTER_INIT (MonoClassField, resolve) + + MonoClass *alc_class = mono_class_get_assembly_load_context_class (); + g_assert (alc_class); + resolve = mono_class_get_field_from_name_full (alc_class, "_nativeAssemblyLoadContext", NULL); + + MONO_STATIC_POINTER_INIT_END (MonoClassField, resolve) + + g_assert (resolve); + + MonoAssemblyLoadContext *alc = NULL; + mono_field_get_value_internal (mono_gchandle_get_target_internal (alc_gchandle), resolve, &alc); + return alc; } MonoGCHandle diff --git a/src/mono/mono/metadata/assembly.c b/src/mono/mono/metadata/assembly.c index 1014840fc3f54f..e8c4bbee3c0a46 100644 --- a/src/mono/mono/metadata/assembly.c +++ b/src/mono/mono/metadata/assembly.c @@ -46,7 +46,7 @@ #include #include #include -#include +#include #ifndef HOST_WIN32 #include diff --git a/src/mono/mono/metadata/class-accessors.c b/src/mono/mono/metadata/class-accessors.c index fbbbc8cda4be4f..76065cb45c456f 100644 --- a/src/mono/mono/metadata/class-accessors.c +++ b/src/mono/mono/metadata/class-accessors.c @@ -25,7 +25,10 @@ typedef enum { PROP_FIELD_DEF_VALUES = 7, /* MonoFieldDefaultValue* */ PROP_DECLSEC_FLAGS = 8, /* guint32 */ PROP_WEAK_BITMAP = 9, - PROP_DIM_CONFLICTS = 10 /* GSList of MonoMethod* */ + PROP_DIM_CONFLICTS = 10, /* GSList of MonoMethod* */ + PROP_FIELD_DEF_VALUES_2BYTESWIZZLE = 11, /* MonoFieldDefaultValue* with default values swizzled at 2 byte boundaries*/ + PROP_FIELD_DEF_VALUES_4BYTESWIZZLE = 12, /* MonoFieldDefaultValue* with default values swizzled at 4 byte boundaries*/ + PROP_FIELD_DEF_VALUES_8BYTESWIZZLE = 13 /* MonoFieldDefaultValue* with default values swizzled at 8 byte boundaries*/ } InfrequentDataKind; /* Accessors based on class kind*/ @@ -382,12 +385,39 @@ mono_class_get_field_def_values (MonoClass *klass) return (MonoFieldDefaultValue*)get_pointer_property (klass, PROP_FIELD_DEF_VALUES); } +MonoFieldDefaultValue* +mono_class_get_field_def_values_with_swizzle (MonoClass *klass, int swizzle) +{ + InfrequentDataKind dataKind = PROP_FIELD_DEF_VALUES; + if (swizzle == 2) + dataKind = PROP_FIELD_DEF_VALUES_2BYTESWIZZLE; + else if (swizzle == 4) + dataKind = PROP_FIELD_DEF_VALUES_4BYTESWIZZLE; + else + dataKind = PROP_FIELD_DEF_VALUES_8BYTESWIZZLE; + return (MonoFieldDefaultValue*)get_pointer_property (klass, dataKind); +} + + void mono_class_set_field_def_values (MonoClass *klass, MonoFieldDefaultValue *values) { set_pointer_property (klass, PROP_FIELD_DEF_VALUES, values); } +void +mono_class_set_field_def_values_with_swizzle (MonoClass *klass, MonoFieldDefaultValue *values, int swizzle) +{ + InfrequentDataKind dataKind = PROP_FIELD_DEF_VALUES; + if (swizzle == 2) + dataKind = PROP_FIELD_DEF_VALUES_2BYTESWIZZLE; + else if (swizzle == 4) + dataKind = PROP_FIELD_DEF_VALUES_4BYTESWIZZLE; + else + dataKind = PROP_FIELD_DEF_VALUES_8BYTESWIZZLE; + set_pointer_property (klass, dataKind, values); +} + guint32 mono_class_get_declsec_flags (MonoClass *klass) { diff --git a/src/mono/mono/metadata/class-internals.h b/src/mono/mono/metadata/class-internals.h index 3759bb4de274f3..72234b97d4542a 100644 --- a/src/mono/mono/metadata/class-internals.h +++ b/src/mono/mono/metadata/class-internals.h @@ -1406,9 +1406,15 @@ mono_class_set_event_info (MonoClass *klass, MonoClassEventInfo *info); MonoFieldDefaultValue* mono_class_get_field_def_values (MonoClass *klass); +MonoFieldDefaultValue* +mono_class_get_field_def_values_with_swizzle (MonoClass *klass, int swizzle); + void mono_class_set_field_def_values (MonoClass *klass, MonoFieldDefaultValue *values); +void +mono_class_set_field_def_values_with_swizzle (MonoClass *klass, MonoFieldDefaultValue *values, int swizzle); + guint32 mono_class_get_declsec_flags (MonoClass *klass); @@ -1467,6 +1473,9 @@ mono_class_get_object_finalize_slot (void); MonoMethod * mono_class_get_default_finalize_method (void); +const char * +mono_field_get_rva (MonoClassField *field, int swizzle); + void mono_field_resolve_type (MonoClassField *field, MonoError *error); diff --git a/src/mono/mono/metadata/class.c b/src/mono/mono/metadata/class.c index 2a1fd8f1e4d72f..076419d078604f 100644 --- a/src/mono/mono/metadata/class.c +++ b/src/mono/mono/metadata/class.c @@ -5435,8 +5435,8 @@ mono_field_get_offset (MonoClassField *field) return field->offset; } -static const char * -mono_field_get_rva (MonoClassField *field) +const char * +mono_field_get_rva (MonoClassField *field, int swizzle) { guint32 rva; int field_index; @@ -5445,21 +5445,59 @@ mono_field_get_rva (MonoClassField *field) g_assert (field->type->attrs & FIELD_ATTRIBUTE_HAS_FIELD_RVA); - def_values = mono_class_get_field_def_values (klass); + def_values = mono_class_get_field_def_values_with_swizzle (klass, swizzle); if (!def_values) { def_values = (MonoFieldDefaultValue *)mono_class_alloc0 (klass, sizeof (MonoFieldDefaultValue) * mono_class_get_field_count (klass)); - mono_class_set_field_def_values (klass, def_values); + mono_class_set_field_def_values_with_swizzle (klass, def_values, swizzle); } field_index = mono_field_get_index (field); - if (!def_values [field_index].data && !image_is_dynamic (m_class_get_image (klass))) { - int first_field_idx = mono_class_get_first_field_idx (klass); - mono_metadata_field_info (m_class_get_image (field->parent), first_field_idx + field_index, NULL, &rva, NULL); - if (!rva) - g_warning ("field %s in %s should have RVA data, but hasn't", mono_field_get_name (field), m_class_get_name (field->parent)); - def_values [field_index].data = mono_image_rva_map (m_class_get_image (field->parent), rva); + if (!def_values [field_index].data) { + const char *rvaData; + + if (!image_is_dynamic (m_class_get_image (klass))) { + int first_field_idx = mono_class_get_first_field_idx (klass); + mono_metadata_field_info (m_class_get_image (field->parent), first_field_idx + field_index, NULL, &rva, NULL); + if (!rva) + g_warning ("field %s in %s should have RVA data, but hasn't", mono_field_get_name (field), m_class_get_name (field->parent)); + + rvaData = mono_image_rva_map (m_class_get_image (field->parent), rva); + } else { + rvaData = mono_field_get_data (field); + } + + if (rvaData == NULL) + return NULL; + + if (swizzle != 1) { + int dummy; + int dataSizeInBytes = mono_type_size (field->type, &dummy); + char *swizzledRvaData = mono_class_alloc0 (klass, dataSizeInBytes); + +#define SWAP(n) { \ + guint ## n *data = (guint ## n *) swizzledRvaData; \ + guint ## n *src = (guint ## n *) rvaData; \ + int i, \ + nEnt = (dataSizeInBytes / sizeof(guint ## n)); \ + \ + for (i = 0; i < nEnt; i++) { \ + data[i] = read ## n (&src[i]); \ + } \ +} + if (swizzle == 2) { + SWAP (16); + } else if (swizzle == 4) { + SWAP (32); + } else { + SWAP (64); + } +#undef SWAP + def_values [field_index].data = swizzledRvaData; + } else { + def_values [field_index].data = rvaData; + } } return def_values [field_index].data; @@ -5480,7 +5518,7 @@ mono_field_get_data (MonoClassField *field) return mono_class_get_field_default_value (field, &def_type); } else if (field->type->attrs & FIELD_ATTRIBUTE_HAS_FIELD_RVA) { - return mono_field_get_rva (field); + return mono_field_get_rva (field, 1); } else { return NULL; } diff --git a/src/mono/mono/metadata/components.c b/src/mono/mono/metadata/components.c index 1794d1e6fc51c1..3750bbf33b323b 100644 --- a/src/mono/mono/metadata/components.c +++ b/src/mono/mono/metadata/components.c @@ -75,7 +75,7 @@ mono_components_init (void) { #ifdef STATIC_COMPONENTS /* directly call each components init function */ - /* TODO: support disabled components. + /* TODO: support disabled components. * * The issue here is that we need to do static linking, so if we don't * directly reference mono_component__init anywhere (ie @@ -94,7 +94,7 @@ mono_components_init (void) /* call get_component for each component and init it or its stubs and add it to loaded_components */ MonoComponentLibrary *component_lib = NULL; - + for (int i = 0; i < G_N_ELEMENTS (components); ++i) { *components [i].component = get_component (&components [i], &component_lib); components [i].lib = component_lib; diff --git a/src/mono/mono/metadata/debug-helpers.c b/src/mono/mono/metadata/debug-helpers.c index 2eddf8a35103a7..c294477458f232 100644 --- a/src/mono/mono/metadata/debug-helpers.c +++ b/src/mono/mono/metadata/debug-helpers.c @@ -470,6 +470,13 @@ mono_method_desc_match (MonoMethodDesc *desc, MonoMethod *method) char *sig; gboolean name_match; + if (desc->name_glob && !strcmp (desc->name, "*")) + return TRUE; +#if 0 + /* FIXME: implement g_pattern_match_simple in eglib */ + if (desc->name_glob && g_pattern_match_simple (desc->name, method->name)) + return TRUE; +#endif name_match = strcmp (desc->name, method->name) == 0; if (!name_match) return FALSE; diff --git a/src/mono/mono/metadata/domain.c b/src/mono/mono/metadata/domain.c index 869e7f00d0ec4e..ec0e8c71e728a3 100644 --- a/src/mono/mono/metadata/domain.c +++ b/src/mono/mono/metadata/domain.c @@ -72,7 +72,7 @@ static MonoDomain *mono_root_domain; gboolean mono_dont_free_domains; -/* AppConfigInfo: Information about runtime versions supported by an +/* AppConfigInfo: Information about runtime versions supported by an * aplication. */ typedef struct { @@ -134,13 +134,13 @@ create_root_domain (void) #endif MONO_PROFILER_RAISE (domain_loaded, (domain)); - + return domain; } /** * mono_init_internal: - * + * * Creates the initial application domain and initializes the mono_defaults * structure. * This function is guaranteed to not run any IL code. @@ -236,7 +236,7 @@ mono_init_internal (const char *filename, const char *exe_filename, const char * g_print ("WARNING: The requested runtime version \"%s\" is unavailable.\n", runtime_version); else g_print ("WARNING: The runtime version supported by this application is unavailable.\n"); - g_print ("Using default runtime: %s\n", default_runtime->runtime_version); + g_print ("Using default runtime: %s\n", default_runtime->runtime_version); } /* The selected runtime will be the first one for which there is a mscrolib.dll */ @@ -251,7 +251,7 @@ mono_init_internal (const char *filename, const char *exe_filename, const char * } g_slist_free (runtimes); - + if ((status != MONO_IMAGE_OK) || (ass == NULL)) { switch (status){ case MONO_IMAGE_ERROR_ERRNO: { @@ -273,7 +273,7 @@ mono_init_internal (const char *filename, const char *exe_filename, const char * /* to suppress compiler warning */ break; } - + exit (1); } mono_defaults.corlib = mono_assembly_get_image_internal (ass); @@ -425,7 +425,7 @@ mono_init_internal (const char *filename, const char *exe_filename, const char * /** * mono_init: - * + * * Creates the initial application domain and initializes the mono_defaults * structure. * @@ -451,7 +451,7 @@ mono_init (const char *domain_name) * structure. * This function is guaranteed to not run any IL code. * The runtime is initialized using the runtime version required by the - * provided executable. The version is determined by looking at the exe + * provided executable. The version is determined by looking at the exe * configuration file and the version PE field) * * \returns the initial domain. @@ -464,9 +464,9 @@ mono_init_from_assembly (const char *domain_name, const char *filename) /** * mono_init_version: - * + * * Used by the runtime, users should use \c mono_jit_init instead. - * + * * Creates the initial application domain and initializes the \c mono_defaults * structure. * @@ -833,7 +833,7 @@ get_runtime_by_version (const char *version) if (strcmp (version, supported_runtimes[n].runtime_version) == 0) return &supported_runtimes[n]; } - + vlen = strlen (version); if (vlen >= 4 && version [1] - '0' >= 4) { for (n=0; n MONO_TYPE_R8 || src_type > MONO_TYPE_R8) { @@ -289,7 +289,7 @@ get_normalized_integral_array_element_type (MonoTypeEnum elementType) return elementType; } -MonoBoolean +MonoBoolean ves_icall_System_Array_CanChangePrimitive (MonoReflectionType *volatile* ref_src_type_handle, MonoReflectionType *volatile* ref_dst_type_handle, MonoBoolean reliable) { MonoReflectionType* const ref_src_type = *ref_src_type_handle; @@ -838,7 +838,7 @@ ves_icall_System_Array_FastCopy (MonoArrayHandle source, int source_idx, MonoArr * Handle common cases. */ - /* Case1: object[] -> valuetype[] (ArrayList::ToArray) + /* Case1: object[] -> valuetype[] (ArrayList::ToArray) We fallback to managed here since we need to typecheck each boxed valuetype before storing them in the dest array. */ if (src_class == mono_defaults.object_class && m_class_is_valuetype (dest_class)) @@ -942,6 +942,38 @@ ves_icall_System_Runtime_RuntimeImports_ZeroMemory (guint8 *p, size_t byte_lengt memset (p, 0, byte_length); } +gpointer +ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_GetSpanDataFrom (MonoClassField *field_handle, MonoType_ptr targetTypeHandle, gpointer countPtr, MonoError *error) +{ + gint32* count = (gint32*)countPtr; + MonoType *field_type = mono_field_get_type_checked (field_handle, error); + if (!field_type) { + mono_error_set_argument (error, "fldHandle", "fldHandle invalid"); + return NULL; + } + + if (!(field_type->attrs & FIELD_ATTRIBUTE_HAS_FIELD_RVA)) { + mono_error_set_argument_format (error, "field_handle", "Field '%s' doesn't have an RVA", mono_field_get_name (field_handle)); + return NULL; + } + + MonoType *type = targetTypeHandle; + if (MONO_TYPE_IS_REFERENCE (type) || type->type == MONO_TYPE_VALUETYPE) { + mono_error_set_argument (error, "array", "Cannot initialize array of non-primitive type"); + return NULL; + } + + int swizzle = 1; + int align; +#if G_BYTE_ORDER != G_LITTLE_ENDIAN + swizzle = mono_type_size (type, &align); +#endif + + int dummy; + *count = mono_type_size (field_type, &dummy)/mono_type_size (type, &align); + return (gpointer)mono_field_get_rva (field_handle, swizzle); +} + void ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray (MonoArrayHandle array, MonoClassField *field_handle, MonoError *error) { @@ -1249,8 +1281,8 @@ ves_icall_System_ValueType_Equals (MonoObjectHandle this_obj, MonoObjectHandle t /* * Do the comparison for fields of primitive type and return a result if - * possible. Otherwise, return the remaining fields in an array to the - * managed side. This way, we can avoid costly reflection operations in + * possible. Otherwise, return the remaining fields in an array to the + * managed side. This way, we can avoid costly reflection operations in * managed code. */ iter = NULL; @@ -1582,7 +1614,7 @@ type_from_parsed_name (MonoTypeNameParse *info, MonoStackCrawlMark *stack_mark, goto_if_nok (error, fail); } - if (!type) + if (!type) goto fail; return mono_type_get_object_handle (type, error); @@ -1632,7 +1664,7 @@ ves_icall_System_RuntimeTypeHandle_internal_from_name (MonoStringHandle name, } goto leave; } - + leave: if (free_info) mono_reflection_free_type_info (&info); @@ -1707,7 +1739,7 @@ guint32 ves_icall_RuntimeTypeHandle_type_is_assignable_from (MonoReflectionTypeHandle ref_type, MonoReflectionTypeHandle ref_c, MonoError *error) { g_assert (!MONO_HANDLE_IS_NULL (ref_type)); - + MonoType *type = MONO_HANDLE_GETVAL (ref_type, type); MonoClass *klass = mono_class_from_mono_type_internal (type); MonoType *ctype = MONO_HANDLE_GETVAL (ref_c, type); @@ -1968,7 +2000,7 @@ ves_icall_System_MonoMethodInfo_get_retval_marshal (MonoMethod *method, MonoErro MONO_HANDLE_ASSIGN (res, mono_reflection_marshal_as_attribute_from_marshal_spec (method->klass, mspecs [0], error)); goto_if_nok (error, leave); } - + leave: for (int i = mono_method_signature_internal (method)->param_count; i >= 0; i--) if (mspecs [i]) @@ -2004,7 +2036,7 @@ ves_icall_RuntimeFieldInfo_GetParentType (MonoReflectionFieldHandle field, MonoB MonoObjectHandle ves_icall_RuntimeFieldInfo_GetValueInternal (MonoReflectionFieldHandle field_handle, MonoObjectHandle obj_handle, MonoError *error) -{ +{ MonoReflectionField * const field = MONO_HANDLE_RAW (field_handle); MonoClassField *cf = field->field; @@ -2063,7 +2095,7 @@ ves_icall_RuntimeFieldInfo_SetValueInternal (MonoReflectionFieldHandle field, Mo if (mono_class_is_nullable (mono_class_from_mono_type_internal (type))) { MonoClass *nklass = mono_class_from_mono_type_internal (type); - /* + /* * Convert the boxed vtype into a Nullable structure. * This is complicated by the fact that Nullables have * a variable structure. @@ -2338,9 +2370,9 @@ ves_icall_RuntimePropertyInfo_get_property_info (MonoReflectionPropertyHandle pr MONO_STRUCT_SETREF_INTERNAL (info, set, MONO_HANDLE_RAW (rm)); } - /* - * There may be other methods defined for properties, though, it seems they are not exposed - * in the reflection API + /* + * There may be other methods defined for properties, though, it seems they are not exposed + * in the reflection API */ } @@ -2417,7 +2449,7 @@ ves_icall_RuntimeEventInfo_get_event_info (MonoReflectionMonoEventHandle ref_eve for (i = 0; i < n; i++) if (!add_event_other_methods_to_array (event->other [i], info_arr, i, error)) return; - } + } #endif } @@ -2611,7 +2643,7 @@ set_interface_map_data_method_object (MonoMethod *method, MonoClass *iclass, int goto_if_nok (error, leave); MONO_HANDLE_ARRAY_SETREF (targets, i, member); } - + leave: HANDLE_FUNCTION_RETURN_VAL (is_ok (error)); } @@ -2644,7 +2676,7 @@ ves_icall_RuntimeType_GetInterfaceMapData (MonoReflectionTypeHandle ref_type, Mo if (method->flags & METHOD_ATTRIBUTE_VIRTUAL) i++; } - + MonoArrayHandle targets_arr = mono_array_new_handle (mono_defaults.method_info_class, i, error); return_if_nok (error); MONO_HANDLE_ASSIGN (targets, targets_arr); @@ -2816,7 +2848,7 @@ ves_icall_RuntimeType_get_DeclaringType (MonoReflectionTypeHandle ref_type, Mono MonoStringHandle ves_icall_RuntimeType_get_Name (MonoReflectionTypeHandle reftype, MonoError *error) { - MonoType *type = MONO_HANDLE_RAW(reftype)->type; + MonoType *type = MONO_HANDLE_RAW(reftype)->type; MonoClass *klass = mono_class_from_mono_type_internal (type); // FIXME: this should be escaped in some scenarios with mono_identifier_escape_type_name_chars // Determining exactly when to do so is fairly difficult, so for now we don't bother to avoid regressions @@ -2907,7 +2939,7 @@ ves_icall_RuntimeType_GetGenericArguments (MonoReflectionTypeHandle ref_type, Mo if (!set_type_object_in_array (m_class_get_byval_arg (pklass), res, i, error)) goto leave; } - + } else if (mono_class_is_ginst (klass)) { MonoGenericInst *inst = mono_class_get_generic_class (klass)->context.class_inst; MONO_HANDLE_ASSIGN (res, create_type_array (runtimeTypeArray, inst->type_argc, error)); @@ -2961,7 +2993,7 @@ ves_icall_RuntimeTypeHandle_GetGenericTypeDefinition_impl (MonoReflectionTypeHan MonoClass *generic_class = mono_class_get_generic_class (klass)->container_class; MonoGCHandle ref_info_handle = mono_class_get_ref_info_handle (generic_class); - + if (m_class_was_typebuilder (generic_class) && ref_info_handle) { MonoObjectHandle tb = mono_gchandle_get_target_handle (ref_info_handle); g_assert (!MONO_HANDLE_IS_NULL (tb)); @@ -3056,19 +3088,19 @@ ves_icall_RuntimeTypeHandle_IsGenericVariable (MonoReflectionTypeHandle ref_type } MonoReflectionMethodHandle -ves_icall_RuntimeType_GetCorrespondingInflatedMethod (MonoReflectionTypeHandle ref_type, +ves_icall_RuntimeType_GetCorrespondingInflatedMethod (MonoReflectionTypeHandle ref_type, MonoReflectionMethodHandle generic, MonoError *error) { error_init (error); MonoType *type = MONO_HANDLE_GETVAL (ref_type, type); MonoClass *klass = mono_class_from_mono_type_internal (type); - + mono_class_init_checked (klass, error); return_val_if_nok (error, MONO_HANDLE_CAST (MonoReflectionMethod, NULL_HANDLE)); MonoMethod *generic_method = MONO_HANDLE_GETVAL (generic, method); - + MonoReflectionMethodHandle ret = MONO_HANDLE_CAST (MonoReflectionMethod, NULL_HANDLE); MonoMethod *method; gpointer iter = NULL; @@ -3122,7 +3154,7 @@ ves_icall_RuntimeMethodInfo_GetPInvoke (MonoReflectionMethodHandle ref_method, i error_init (error); if (image_is_dynamic (image)) { - MonoReflectionMethodAux *method_aux = + MonoReflectionMethodAux *method_aux = (MonoReflectionMethodAux *)g_hash_table_lookup (((MonoDynamicImage*)image)->method_aux_hash, method); if (method_aux) { import = method_aux->dllentry; @@ -3137,14 +3169,14 @@ ves_icall_RuntimeMethodInfo_GetPInvoke (MonoReflectionMethodHandle ref_method, i else { if (piinfo->implmap_idx) { mono_metadata_decode_row (im, piinfo->implmap_idx - 1, im_cols, MONO_IMPLMAP_SIZE); - + piinfo->piflags = im_cols [MONO_IMPLMAP_FLAGS]; import = mono_metadata_string_heap (image, im_cols [MONO_IMPLMAP_NAME]); scope_token = mono_metadata_decode_row_col (mr, im_cols [MONO_IMPLMAP_SCOPE] - 1, MONO_MODULEREF_NAME); scope = mono_metadata_string_heap (image, scope_token); } } - + *flags = piinfo->piflags; MONO_HANDLE_ASSIGN (entry_point, mono_string_new_handle (import, error)); return_if_nok (error); @@ -3364,7 +3396,7 @@ ves_icall_InternalInvoke (MonoReflectionMethodHandle method_handle, MonoObjectHa MonoObject* const this_arg = MONO_HANDLE_RAW (this_arg_handle); g_assert (params_span != NULL); - /* + /* * Invoke from reflection is supposed to always be a virtual call (the API * is stupid), mono_runtime_invoke_*() calls the provided method, allowing * greater flexibility. @@ -3373,9 +3405,6 @@ ves_icall_InternalInvoke (MonoReflectionMethodHandle method_handle, MonoObjectHa MonoMethodSignature* const sig = mono_method_signature_internal (m); int pcount = 0; void *obj = this_arg; - char *this_name = NULL; - char *target_name = NULL; - char *msg = NULL; MonoObject *result = NULL; MonoArray *arr = NULL; MonoException *exception = NULL; @@ -3403,6 +3432,7 @@ ves_icall_InternalInvoke (MonoReflectionMethodHandle method_handle, MonoObjectHa } } + /* Array constructor */ if (m_class_get_rank (m->klass) && !strcmp (m->name, ".ctor")) { int i; pcount = mono_span_length (params_span); @@ -3457,9 +3487,6 @@ ves_icall_InternalInvoke (MonoReflectionMethodHandle method_handle, MonoObjectHa MONO_HANDLE_NEW (MonoException, exception); // FIXME? overkill? mono_gc_wbarrier_generic_store_internal (MONO_HANDLE_REF (exception_out), (MonoObject*)exception); } - g_free (target_name); - g_free (this_name); - g_free (msg); g_assert (!result || !arr); // only one, or neither, should be set return result ? MONO_HANDLE_NEW (MonoObject, result) : arr ? MONO_HANDLE_NEW (MonoObject, (MonoObject*)arr) : NULL_HANDLE; } @@ -3715,15 +3742,15 @@ ves_icall_RuntimeType_GetFields_native (MonoReflectionTypeHandle ref_type, char return g_ptr_array_new (); } - int (*compare_func) (const char *s1, const char *s2) = NULL; + int (*compare_func) (const char *s1, const char *s2) = NULL; compare_func = ((bflags & BFLAGS_IgnoreCase) || (mlisttype == MLISTTYPE_CaseInsensitive)) ? mono_utf8_strcasecmp : strcmp; MonoClass *startklass, *klass; klass = startklass = mono_class_from_mono_type_internal (type); GPtrArray *ptr_array = g_ptr_array_sized_new (16); - -handle_parent: + +handle_parent: if (mono_class_has_failure (klass)) { mono_error_set_for_class_failure (error, klass); goto fail; @@ -3806,7 +3833,7 @@ mono_class_get_methods_by_name (MonoClass *klass, const char *name, guint32 bfla array = g_ptr_array_new (); startklass = klass; error_init (error); - + compare_func = ((bflags & BFLAGS_IgnoreCase) || (mlisttype == MLISTTYPE_CaseInsensitive)) ? mono_utf8_strcasecmp : strcmp; /* An optimization for calls made from Delegate:CreateDelegate () */ @@ -3837,7 +3864,7 @@ mono_class_get_methods_by_name (MonoClass *klass, const char *name, guint32 bfla mono_class_setup_methods (klass); mono_class_setup_vtable (klass); if (mono_class_has_failure (klass)) - goto loader_error; + goto loader_error; iter = NULL; while ((method = mono_class_get_methods (klass, &iter))) { @@ -3877,7 +3904,7 @@ mono_class_get_methods_by_name (MonoClass *klass, const char *name, guint32 bfla if (compare_func (name, method->name)) continue; } - + match = 0; g_ptr_array_add (array, method); } @@ -3927,7 +3954,7 @@ ves_icall_RuntimeType_GetConstructors_native (MonoReflectionTypeHandle ref_type, mono_error_set_for_class_failure (error, klass); return NULL; } - + GPtrArray *res_array = g_ptr_array_sized_new (4); /* FIXME, guestimating */ @@ -4038,7 +4065,7 @@ ves_icall_RuntimeType_GetPropertiesByName_native (MonoReflectionTypeHandle ref_t return g_ptr_array_new (); } - + MonoClass *startklass, *klass; klass = startklass = mono_class_from_mono_type_internal (type); @@ -4097,12 +4124,12 @@ ves_icall_RuntimeType_GetPropertiesByName_native (MonoReflectionTypeHandle ref_t if ((mlisttype != MLISTTYPE_All) && (propname != NULL) && compare_func (propname, prop->name)) continue; - + if (g_hash_table_lookup (properties, prop)) continue; g_ptr_array_add (res_array, prop); - + g_hash_table_insert (properties, prop, prop); } if (!(bflags & BFLAGS_DeclaredOnly) && (klass = m_class_get_parent (klass))) { @@ -4190,7 +4217,7 @@ ves_icall_RuntimeType_GetEvents_native (MonoReflectionTypeHandle ref_type, char if (g_hash_table_lookup (events, event)) continue; - g_ptr_array_add (res_array, event); + g_ptr_array_add (res_array, event); g_hash_table_insert (events, event, event); } @@ -4236,7 +4263,7 @@ ves_icall_RuntimeType_GetNestedTypes_native (MonoReflectionTypeHandle ref_type, klass = mono_class_get_generic_class (klass)->container_class; GPtrArray *res_array = g_ptr_array_new (); - + MonoClass *nested; gpointer iter = NULL; while ((nested = mono_class_get_nested_types (klass, &iter))) { @@ -4423,7 +4450,7 @@ MonoStringHandle ves_icall_System_Reflection_RuntimeAssembly_get_code_base (MonoReflectionAssemblyHandle assembly, MonoError *error) { MonoAssembly *mass = MONO_HANDLE_GETVAL (assembly, assembly); - + /* return NULL for bundled assemblies in single-file scenarios */ const char* filename = m_image_get_filename (mass->image); @@ -4471,7 +4498,7 @@ ves_icall_System_Reflection_RuntimeAssembly_InternalImageRuntimeVersion (MonoRef } MonoReflectionMethodHandle -ves_icall_System_Reflection_RuntimeAssembly_get_EntryPoint (MonoReflectionAssemblyHandle assembly_h, MonoError *error) +ves_icall_System_Reflection_RuntimeAssembly_get_EntryPoint (MonoReflectionAssemblyHandle assembly_h, MonoError *error) { MonoAssembly *assembly = MONO_HANDLE_GETVAL (assembly_h, assembly); MonoMethod *method; @@ -4490,7 +4517,7 @@ ves_icall_System_Reflection_RuntimeAssembly_get_EntryPoint (MonoReflectionAssemb } MonoReflectionModuleHandle -ves_icall_System_Reflection_Assembly_GetManifestModuleInternal (MonoReflectionAssemblyHandle assembly, MonoError *error) +ves_icall_System_Reflection_Assembly_GetManifestModuleInternal (MonoReflectionAssemblyHandle assembly, MonoError *error) { MonoAssembly *a = MONO_HANDLE_GETVAL (assembly, assembly); return mono_module_get_object_handle (a->image, error); @@ -4509,7 +4536,7 @@ add_manifest_resource_name_to_array (MonoImage *image, MonoTableInfo *table, int } MonoArrayHandle -ves_icall_System_Reflection_RuntimeAssembly_GetManifestResourceNames (MonoReflectionAssemblyHandle assembly_h, MonoError *error) +ves_icall_System_Reflection_RuntimeAssembly_GetManifestResourceNames (MonoReflectionAssemblyHandle assembly_h, MonoError *error) { MonoAssembly *assembly = MONO_HANDLE_GETVAL (assembly_h, assembly); MonoTableInfo *table = &assembly->image->tables [MONO_TABLE_MANIFESTRESOURCE]; @@ -4545,14 +4572,14 @@ create_referenced_assembly_name (MonoImage *image, int i, MonoError *error) aname->hash_value = NULL; aname->hash_len = 0; g_assert (aname->public_key == NULL); - + /* note: this function doesn't return the codebase on purpose (i.e. it can be used under partial trust as path information isn't present). */ return aname; } GPtrArray* -ves_icall_System_Reflection_Assembly_InternalGetReferencedAssemblies (MonoReflectionAssemblyHandle assembly, MonoError *error) +ves_icall_System_Reflection_Assembly_InternalGetReferencedAssemblies (MonoReflectionAssemblyHandle assembly, MonoError *error) { error_init (error); MonoAssembly *ass = MONO_HANDLE_GETVAL(assembly, assembly); @@ -4671,7 +4698,7 @@ get_manifest_resource_internal (MonoReflectionAssemblyHandle assembly_h, MonoStr impl = cols [MONO_MANIFEST_IMPLEMENTATION]; if (impl) { /* - * this code should only be called after obtaining the + * this code should only be called after obtaining the * ResourceInfo and handling the other cases. */ g_assert ((impl & MONO_IMPLEMENTATION_MASK) == MONO_IMPLEMENTATION_FILE); @@ -4684,7 +4711,7 @@ get_manifest_resource_internal (MonoReflectionAssemblyHandle assembly_h, MonoStr else module = assembly->image; - + MonoReflectionModuleHandle rm = mono_module_get_object_handle (module, error); return_val_if_nok (error, NULL); MONO_HANDLE_ASSIGN (ref_module, rm); @@ -4693,7 +4720,7 @@ get_manifest_resource_internal (MonoReflectionAssemblyHandle assembly_h, MonoStr } void * -ves_icall_System_Reflection_RuntimeAssembly_GetManifestResourceInternal (MonoReflectionAssemblyHandle assembly_h, MonoStringHandle name, gint32 *size, MonoReflectionModuleHandleOut ref_module, MonoError *error) +ves_icall_System_Reflection_RuntimeAssembly_GetManifestResourceInternal (MonoReflectionAssemblyHandle assembly_h, MonoStringHandle name, gint32 *size, MonoReflectionModuleHandleOut ref_module, MonoError *error) { gpointer ret = get_manifest_resource_internal (assembly_h, name, size, ref_module, error); @@ -4719,7 +4746,7 @@ get_manifest_resource_info_internal (MonoReflectionAssemblyHandle assembly_h, Mo char *n; gboolean result = FALSE; - + n = mono_string_handle_to_utf8 (name, error); goto_if_nok (error, leave); @@ -4804,7 +4831,7 @@ add_filename_to_files_array (MonoAssembly * assembly, MonoTableInfo *table, int } MonoObjectHandle -ves_icall_System_Reflection_RuntimeAssembly_GetFilesInternal (MonoReflectionAssemblyHandle assembly_h, MonoStringHandle name, MonoBoolean resource_modules, MonoError *error) +ves_icall_System_Reflection_RuntimeAssembly_GetFilesInternal (MonoReflectionAssemblyHandle assembly_h, MonoStringHandle name, MonoBoolean resource_modules, MonoError *error) { MonoAssembly *assembly = MONO_HANDLE_GETVAL (assembly_h, assembly); MonoTableInfo *table = &assembly->image->tables [MONO_TABLE_FILE]; @@ -4862,7 +4889,7 @@ add_module_to_modules_array (MonoArrayHandle dest, int *dest_idx, MonoImage* mod if (module) { MonoReflectionModuleHandle rm = mono_module_get_object_handle (module, error); goto_if_nok (error, leave); - + MONO_HANDLE_ARRAY_SETREF (dest, *dest_idx, rm); ++(*dest_idx); } @@ -4951,7 +4978,7 @@ ves_icall_System_Reflection_RuntimeAssembly_GetModulesInternal (MonoReflectionAs } MonoReflectionMethodHandle -ves_icall_GetCurrentMethod (MonoError *error) +ves_icall_GetCurrentMethod (MonoError *error) { MonoMethod *m = mono_method_get_last_managed (); @@ -4996,7 +5023,7 @@ mono_method_get_equivalent_method (MonoMethod *method, MonoClass *klass) if (method_klass_methods [i] == method) { offset = i; break; - } + } } mono_class_setup_methods (klass); if (mono_class_has_failure (klass)) @@ -5087,7 +5114,7 @@ ves_icall_System_RuntimeType_getFullName (MonoReflectionTypeHandle object, MonoB MONO_TYPE_NAME_FORMAT_FULL_NAME; else format = MONO_TYPE_NAME_FORMAT_REFLECTION; - + name = mono_type_get_name_full (type, format); if (!name) return NULL_HANDLE_STRING; @@ -5244,7 +5271,7 @@ mono_module_get_types (MonoImage *image, MonoArrayHandleOut exceptions, MonoBool count++; } } - + return res; } @@ -5322,7 +5349,7 @@ assembly_get_types (MonoReflectionAssemblyHandle assembly_handle, MonoBoolean ex } } - /* the ReflectionTypeLoadException must have all the types (Types property), + /* the ReflectionTypeLoadException must have all the types (Types property), * NULL replacing types which throws an exception. The LoaderException must * contain all exceptions for NULL items. */ @@ -5379,7 +5406,7 @@ assembly_get_types (MonoReflectionAssemblyHandle assembly_handle, MonoBoolean ex mono_error_set_exception_handle (error, exc); return NULL_HANDLE_ARRAY; } - + return res; } @@ -5396,7 +5423,7 @@ get_top_level_forwarded_type (MonoImage *image, MonoTableInfo *table, int i, Mon guint32 cols [MONO_EXP_TYPE_SIZE]; MonoClass *klass; MonoReflectionTypeHandle rt; - + mono_metadata_decode_row (table, i, cols, MONO_EXP_TYPE_SIZE); if (!(cols [MONO_EXP_TYPE_FLAGS] & TYPE_ATTRIBUTE_FORWARDER)) return; @@ -5459,7 +5486,7 @@ ves_icall_System_Reflection_RuntimeAssembly_GetTopLevelForwardedTypes (MonoRefle if (mono_metadata_decode_row_col (table, i, MONO_EXP_TYPE_FLAGS) & TYPE_ATTRIBUTE_FORWARDER) count ++; } - + MonoArrayHandle types = mono_array_new_handle (mono_defaults.runtimetype_class, count, error); return_val_if_nok (error, NULL_HANDLE_ARRAY); MonoArrayHandle exceptions = mono_array_new_handle (mono_defaults.exception_class, count, error); @@ -5511,7 +5538,7 @@ ves_icall_AssemblyExtensions_ApplyUpdate (MonoAssembly *assm, #endif mono_image_load_enc_delta (MONO_ENC_DELTA_API, image_base, dmeta_bytes, dmeta_len, dil_bytes, dil_len, dpdb_bytes, dpdb_len, error); - + mono_error_set_pending_exception (error); } @@ -5704,7 +5731,7 @@ module_resolve_type_token (MonoImage *image, guint32 token, MonoArrayHandle type *resolve_error = ResolveTokenError_Other; /* Validate token */ - if ((table != MONO_TABLE_TYPEDEF) && (table != MONO_TABLE_TYPEREF) && + if ((table != MONO_TABLE_TYPEDEF) && (table != MONO_TABLE_TYPEREF) && (table != MONO_TABLE_TYPESPEC)) { *resolve_error = ResolveTokenError_BadTable; goto leave; @@ -5763,7 +5790,7 @@ module_resolve_method_token (MonoImage *image, guint32 token, MonoArrayHandle ty *resolve_error = ResolveTokenError_Other; /* Validate token */ - if ((table != MONO_TABLE_METHOD) && (table != MONO_TABLE_METHODSPEC) && + if ((table != MONO_TABLE_METHOD) && (table != MONO_TABLE_METHODSPEC) && (table != MONO_TABLE_MEMBERREF)) { *resolve_error = ResolveTokenError_BadTable; goto leave; @@ -5892,7 +5919,7 @@ module_resolve_field_token (MonoImage *image, guint32 token, MonoArrayHandle typ init_generic_context_from_args_handles (&context, type_args, method_args); field = mono_field_from_token_checked (image, token, &klass, &context, error); - + leave: HANDLE_FUNCTION_RETURN_VAL (field); } @@ -5928,7 +5955,7 @@ ves_icall_System_Reflection_RuntimeModule_ResolveMemberToken (MonoImage *image, return MONO_HANDLE_CAST (MonoObject, mono_method_get_object_handle (m, m->klass, merror)); } else return NULL_HANDLE; - } + } case MONO_TABLE_FIELD: { MonoClassField *f = module_resolve_field_token (image, token, type_args, method_args, error, merror); if (f) { @@ -6339,7 +6366,7 @@ void ves_icall_System_ArgIterator_Setup (MonoArgIterator *iter, char* argsp, char* start) { iter->sig = *(MonoMethodSignature**)argsp; - + g_assert (iter->sig->sentinelpos <= iter->sig->param_count); g_assert (iter->sig->call_convention == MONO_CALL_VARARG); @@ -6420,7 +6447,7 @@ MonoType* ves_icall_System_ArgIterator_IntGetNextArgType (MonoArgIterator *iter) { gint i; - + i = iter->sig->sentinelpos + iter->next_arg; g_assert (i < iter->sig->param_count); @@ -6576,7 +6603,7 @@ ves_icall_RuntimeParameterInfo_GetTypeModifiers (MonoReflectionTypeHandle rt, Mo MonoProperty *prop = MONO_HANDLE_GETVAL (MONO_HANDLE_CAST (MonoReflectionProperty, member), property); if (!(method = prop->get)) method = prop->set; - g_assert (method); + g_assert (method); } else if (strcmp (m_class_get_name (member_class), "DynamicMethod") == 0 && strcmp (m_class_get_name_space (member_class), "System.Reflection.Emit") == 0) { MonoArrayHandle params = MONO_HANDLE_NEW_GET (MonoArray, MONO_HANDLE_CAST (MonoReflectionDynamicMethod, member), parameters); MonoReflectionTypeHandle t = MONO_HANDLE_NEW (MonoReflectionType, NULL); @@ -6969,7 +6996,7 @@ mono_add_internal_call_internal (const char *name, gconstpointer method) add_internal_call_with_flags (name, method, MONO_ICALL_FLAGS_COOPERATIVE); } -/* +/* * we should probably export this as an helper (handle nested types). * Returns the number of chars written in buf. */ diff --git a/src/mono/mono/metadata/loader.c b/src/mono/mono/metadata/loader.c index fc64623fad6525..a3e451d4517f44 100644 --- a/src/mono/mono/metadata/loader.c +++ b/src/mono/mono/metadata/loader.c @@ -427,6 +427,8 @@ find_method_in_class (MonoClass *klass, const char *name, const char *qname, con { int i; + /* FIXME: method refs from metadata-upate probably end up here */ + /* Search directly in the metadata to avoid calling setup_methods () */ error_init (error); @@ -1160,6 +1162,8 @@ mono_get_method_checked (MonoImage *image, guint32 token, MonoClass *klass, Mono MonoMethod *result = NULL; gboolean used_context = FALSE; + /* FIXME: method definition lookups for metadata-update probably end up here */ + /* We do everything inside the lock to prevent creation races */ error_init (error); diff --git a/src/mono/mono/metadata/metadata-internals.h b/src/mono/mono/metadata/metadata-internals.h index f750438ac7d33e..4e5ddf40abe86b 100644 --- a/src/mono/mono/metadata/metadata-internals.h +++ b/src/mono/mono/metadata/metadata-internals.h @@ -791,24 +791,21 @@ gboolean mono_metadata_has_updates_api (void); void -mono_image_effective_table_slow (const MonoTableInfo **t, int *idx); +mono_image_effective_table_slow (const MonoTableInfo **t, int idx); gboolean mono_metadata_update_has_modified_rows (const MonoTableInfo *t); static inline void -mono_image_effective_table (const MonoTableInfo **t, int *idx) +mono_image_effective_table (const MonoTableInfo **t, int idx) { if (G_UNLIKELY (mono_metadata_has_updates ())) { - if (G_UNLIKELY (*idx >= table_info_get_rows ((*t)) || mono_metadata_update_has_modified_rows (*t))) { + if (G_UNLIKELY (idx >= table_info_get_rows ((*t)) || mono_metadata_update_has_modified_rows (*t))) { mono_image_effective_table_slow (t, idx); } } } -int -mono_image_relative_delta_index (MonoImage *image_dmeta, int token); - enum MonoEnCDeltaOrigin { MONO_ENC_DELTA_API = 0, MONO_ENC_DELTA_DBG = 1, @@ -848,6 +845,18 @@ mono_metadata_clean_generic_classes_for_image (MonoImage *image); gboolean mono_metadata_table_bounds_check_slow (MonoImage *image, int table_index, int token_index); +int +mono_metadata_table_num_rows_slow (MonoImage *image, int table_index); + +static inline int +mono_metadata_table_num_rows (MonoImage *image, int table_index) +{ + if (G_LIKELY (!image->has_updates)) + return table_info_get_rows (&image->tables [table_index]); + else + return mono_metadata_table_num_rows_slow (image, table_index); +} + /* token_index is 1-based */ static inline gboolean mono_metadata_table_bounds_check (MonoImage *image, int table_index, int token_index) @@ -1223,4 +1232,18 @@ mono_type_get_array_type_internal (MonoType *type) return type->data.array; } +static inline int +mono_metadata_table_to_ptr_table (int table_num) +{ + switch (table_num) { + case MONO_TABLE_FIELD: return MONO_TABLE_FIELD_POINTER; + case MONO_TABLE_METHOD: return MONO_TABLE_METHOD_POINTER; + case MONO_TABLE_PARAM: return MONO_TABLE_PARAM_POINTER; + case MONO_TABLE_PROPERTY: return MONO_TABLE_PROPERTY_POINTER; + case MONO_TABLE_EVENT: return MONO_TABLE_EVENT_POINTER; + default: + g_assert_not_reached (); + } +} + #endif /* __MONO_METADATA_INTERNALS_H__ */ diff --git a/src/mono/mono/metadata/metadata-update.c b/src/mono/mono/metadata/metadata-update.c index 99a2d99a5d7c36..800ffb9f047270 100644 --- a/src/mono/mono/metadata/metadata-update.c +++ b/src/mono/mono/metadata/metadata-update.c @@ -61,17 +61,11 @@ mono_metadata_update_cleanup_on_close (MonoImage *base_image) } void -mono_image_effective_table_slow (const MonoTableInfo **t, int *idx) +mono_image_effective_table_slow (const MonoTableInfo **t, int idx) { mono_component_hot_reload ()->effective_table_slow (t, idx); } -int -mono_image_relative_delta_index (MonoImage *image_dmeta, int token) -{ - return mono_component_hot_reload ()->relative_delta_index (image_dmeta, token); -} - void mono_image_load_enc_delta (int origin, MonoImage *base_image, gconstpointer dmeta, uint32_t dmeta_len, gconstpointer dil, uint32_t dil_len, gconstpointer dpdb, uint32_t dpdb_len, MonoError *error) { @@ -141,3 +135,15 @@ mono_metadata_has_updates_api (void) { return mono_metadata_has_updates (); } + +/** + * mono_metadata_table_num_rows: + * + * Returns the number of rows from the specified table that the current thread can see. + * If there's a EnC metadata update, this number may change. + */ +int +mono_metadata_table_num_rows_slow (MonoImage *base_image, int table_index) +{ + return mono_component_hot_reload()->table_num_rows_slow (base_image, table_index); +} diff --git a/src/mono/mono/metadata/metadata.c b/src/mono/mono/metadata/metadata.c index 698a9a20fa1915..5912a12a0c9093 100644 --- a/src/mono/mono/metadata/metadata.c +++ b/src/mono/mono/metadata/metadata.c @@ -91,7 +91,7 @@ enum { /* HasCustomAttribute index. Indexes any table except CustomAttribute */ MONO_MT_HASCAT_IDX, - + /* CustomAttributeType encoded index */ MONO_MT_CAT_IDX, @@ -541,7 +541,7 @@ static gboolean check_assembly_names_strictly = FALSE; * * Returns the name of the given ECMA metadata logical format table * as described in ECMA 335, Partition II, Section 22. - * + * * \returns the name for the \p table index */ const char * @@ -555,11 +555,11 @@ mono_meta_table_name (int table) /* The guy who wrote the spec for this should not be allowed near a * computer again. - -If e is a coded token(see clause 23.1.7) that points into table ti out of n possible tables t0, .. tn-1, -then it is stored as e << (log n) & tag{ t0, .. tn-1}[ ti] using 2 bytes if the maximum number of -rows of tables t0, ..tn-1, is less than 2^16 - (log n), and using 4 bytes otherwise. The family of -finite maps tag{ t0, ..tn-1} is defined below. Note that to decode a physical row, you need the + +If e is a coded token(see clause 23.1.7) that points into table ti out of n possible tables t0, .. tn-1, +then it is stored as e << (log n) & tag{ t0, .. tn-1}[ ti] using 2 bytes if the maximum number of +rows of tables t0, ..tn-1, is less than 2^16 - (log n), and using 4 bytes otherwise. The family of +finite maps tag{ t0, ..tn-1} is defined below. Note that to decode a physical row, you need the inverse of this mapping. */ @@ -600,7 +600,7 @@ get_nrows (MonoImage *meta, int idx) * \param meta metadata context * \param tableindex metadata table number * \param result_bitfield pointer to \c guint32 where to store additional info - * + * * \c mono_metadata_compute_size computes the length in bytes of a single * row in a metadata table. The size of each column is encoded in the * \p result_bitfield return value along with the number of columns in the table. @@ -621,26 +621,26 @@ mono_metadata_compute_size (MonoImage *meta, int tableindex, guint32 *result_bit switch (code){ case MONO_MT_UINT32: field_size = 4; break; - + case MONO_MT_UINT16: field_size = 2; break; - + case MONO_MT_UINT8: field_size = 1; break; - + case MONO_MT_BLOB_IDX: field_size = meta->idx_blob_wide ? 4 : 2; break; - + case MONO_MT_STRING_IDX: field_size = meta->idx_string_wide ? 4 : 2; break; - + case MONO_MT_GUID_IDX: field_size = meta->idx_guid_wide ? 4 : 2; break; case MONO_MT_TABLE_IDX: /* Uhm, a table index can point to other tables besides the current one * so, it's not correct to use the rowcount of the current table to - * get the size for this column - lupus + * get the size for this column - lupus */ switch (tableindex) { case MONO_TABLE_ASSEMBLYREFOS: @@ -781,7 +781,7 @@ mono_metadata_compute_size (MonoImage *meta, int tableindex, guint32 *result_bit field_size = 4; break; }*/ - + n = MAX (get_nrows (meta, MONO_TABLE_METHOD), get_nrows (meta, MONO_TABLE_FIELD)); n = MAX (n, get_nrows (meta, MONO_TABLE_TYPEREF)); @@ -931,7 +931,7 @@ mono_metadata_compute_size (MonoImage *meta, int tableindex, guint32 *result_bit /* 3 bits to encode */ field_size = rtsize (meta, n, 16 - 3); break; - + /* * MethodDefOrRef: MethodDef, MemberRef */ @@ -942,7 +942,7 @@ mono_metadata_compute_size (MonoImage *meta, int tableindex, guint32 *result_bit /* 1 bit used to encode tag */ field_size = rtsize (meta, n, 16-1); break; - + /* * HasSemantics: Property, Event */ @@ -1011,7 +1011,7 @@ mono_metadata_compute_table_bases (MonoImage *meta) { int i; const char *base = meta->tables_base; - + for (i = 0; i < MONO_TABLE_NUM; i++) { MonoTableInfo *table = &meta->tables [i]; if (table_info_get_rows (table) == 0) @@ -1038,7 +1038,7 @@ mono_metadata_locate (MonoImage *meta, int table, int idx) /* FIXME: metadata-update */ /* idx == 0 refers always to NULL */ g_return_val_if_fail (idx > 0 && idx <= table_info_get_rows (&meta->tables [table]), ""); /*FIXME shouldn't we return NULL here?*/ - + return meta->tables [table].base + (meta->tables [table].row_size * (idx - 1)); } @@ -1132,7 +1132,7 @@ mono_metadata_string_heap_checked (MonoImage *meta, guint32 index, MonoError *er if (G_UNLIKELY (!ok)) { const char *image_name = meta && meta->name ? meta->name : "unknown image"; mono_error_set_bad_image_by_name (error, image_name, "string heap index %ud out bounds %u: %s, also checked delta images", index, meta->heap_strings.size, image_name); - + return NULL; } meta = dmeta; @@ -1303,7 +1303,7 @@ mono_metadata_decode_row (const MonoTableInfo *t, int idx, guint32 *res, int res void mono_metadata_decode_row_slow (const MonoTableInfo *t, int idx, guint32 *res, int res_size) { - mono_image_effective_table (&t, &idx); + mono_image_effective_table (&t, idx); mono_metadata_decode_row_raw (t, idx, res, res_size); } @@ -1320,7 +1320,7 @@ mono_metadata_decode_row_raw (const MonoTableInfo *t, int idx, guint32 *res, int g_assert (idx < table_info_get_rows (t)); g_assert (idx >= 0); data = t->base + idx * t->row_size; - + g_assert (res_size == count); for (i = 0; i < count; i++) { @@ -1359,7 +1359,7 @@ mono_metadata_decode_row_checked (const MonoImage *image, const MonoTableInfo *t { const char *image_name = image && image->name ? image->name : "unknown image"; - mono_image_effective_table (&t, &idx); + mono_image_effective_table (&t, idx); guint32 bitfield = t->size_bitfield; int i, count = mono_metadata_table_count (bitfield); @@ -1448,7 +1448,7 @@ mono_metadata_decode_row_col (const MonoTableInfo *t, int idx, guint col) guint32 mono_metadata_decode_row_col_slow (const MonoTableInfo *t, int idx, guint col) { - mono_image_effective_table (&t, &idx); + mono_image_effective_table (&t, idx); return mono_metadata_decode_row_col_raw (t, idx, col); } @@ -1466,7 +1466,7 @@ mono_metadata_decode_row_col_raw (const MonoTableInfo *t, int idx, guint col) int n; guint32 bitfield = t->size_bitfield; - + g_assert (idx < table_info_get_rows (t)); g_assert (col < mono_metadata_table_count (bitfield)); data = t->base + idx * t->row_size; @@ -1503,7 +1503,7 @@ mono_metadata_decode_blob_size (const char *xptr, const char **rptr) { const unsigned char *ptr = (const unsigned char *)xptr; guint32 size; - + if ((*ptr & 0x80) == 0){ size = ptr [0] & 0x7f; ptr++; @@ -1538,7 +1538,7 @@ mono_metadata_decode_value (const char *_ptr, const char **rptr) const unsigned char *ptr = (const unsigned char *) _ptr; unsigned char b = *ptr; guint32 len; - + if ((b & 0x80) == 0){ len = b; ++ptr; @@ -1554,7 +1554,7 @@ mono_metadata_decode_value (const char *_ptr, const char **rptr) } if (rptr) *rptr = (char*)ptr; - + return len; } @@ -1595,7 +1595,7 @@ mono_metadata_decode_signed_value (const char *ptr, const char **rptr) * Translates the given 1-based index into the \c Method, \c Field, \c Event, or \c Param tables * using the \c *Ptr tables in uncompressed metadata, if they are available. * - * FIXME: The caller is not forced to call this function, which is error-prone, since + * FIXME: The caller is not forced to call this function, which is error-prone, since * forgetting to call it would only show up as a bug on uncompressed metadata. */ guint32 @@ -1732,7 +1732,7 @@ mono_metadata_parse_array_internal (MonoImage *m, MonoGenericContainer *containe int i; MonoArrayType *array; MonoType *etype; - + etype = mono_metadata_parse_type_checked (m, container, 0, FALSE, ptr, &ptr, error); //FIXME this doesn't respect @transient if (!etype) return NULL; @@ -1833,8 +1833,6 @@ builtin_types[] = { {{NULL}, 0, MONO_TYPE_U, 0, 1, 0}, }; -#define NBUILTIN_TYPES() (sizeof (builtin_types) / sizeof (builtin_types [0])) - static GHashTable *type_cache = NULL; static gint32 next_generic_inst_id = 0; @@ -1858,7 +1856,7 @@ mono_type_equal (gconstpointer ka, gconstpointer kb) { const MonoType *a = (const MonoType *) ka; const MonoType *b = (const MonoType *) kb; - + if (a->type != b->type || m_type_is_byref (a) != m_type_is_byref (b) || a->attrs != b->attrs || a->pinned != b->pinned) return 0; /* need other checks */ @@ -1873,7 +1871,7 @@ mono_metadata_generic_inst_hash (gconstpointer data) int i; g_assert (ginst); g_assert (ginst->type_argv); - + for (i = 0; i < ginst->type_argc; ++i) { hash *= 13; g_assert (ginst->type_argv [i]); @@ -1964,14 +1962,14 @@ mono_metadata_init (void) type_cache = g_hash_table_new (mono_type_hash, mono_type_equal); - for (i = 0; i < NBUILTIN_TYPES (); ++i) + for (i = 0; i < G_N_ELEMENTS (builtin_types); ++i) g_hash_table_insert (type_cache, (gpointer) &builtin_types [i], (gpointer) &builtin_types [i]); mono_metadata_update_init (); } /* - * Make a pass over the metadata signature blob starting at \p tmp_ptr and count the custom modifiers. + * Make a pass over the metadata signature blob starting at \p tmp_ptr and count the custom modifiers. */ static int count_custom_modifiers (MonoImage *m, const char *tmp_ptr) @@ -2160,7 +2158,7 @@ do_mono_metadata_parse_type_with_cmods (MonoType *type, int cmod_count, MonoImag * \param ptr pointer to the type representation * \param rptr pointer updated to match the end of the decoded stream * \param transient whenever to allocate the result from the heap or from a mempool - * + * * Decode a compressed type description found at \p ptr in \p m . * \p mode can be one of \c MONO_PARSE_MOD_TYPE, \c MONO_PARSE_PARAM, \c MONO_PARSE_RET, * \c MONO_PARSE_FIELD, \c MONO_PARSE_LOCAL, \c MONO_PARSE_TYPE. @@ -2229,7 +2227,7 @@ mono_metadata_parse_type_internal (MonoImage *m, MonoGenericContainer *container free_parsed_type (type, transient); return NULL; } - + // Possibly we can return an already-allocated type instead of the one we decoded if (!allocated && !transient) { @@ -2238,7 +2236,7 @@ mono_metadata_parse_type_internal (MonoImage *m, MonoGenericContainer *container if (try_get_canonical_type (type, &ret_type)) return ret_type; } - + /* printf ("%x %x %c %s\n", type->attrs, type->num_mods, type->pinned ? 'p' : ' ', mono_type_full_name (type)); */ // Otherwise return the type we decoded @@ -2300,7 +2298,7 @@ mono_metadata_method_has_param_attrs (MonoImage *m, int def) * @def method def token (one based) * @param_count number of params to decode including the return value * - * Return the parameter attributes for the method whose MethodDef index is DEF. The + * Return the parameter attributes for the method whose MethodDef index is DEF. The * returned memory needs to be freed by the caller. If all the param attributes are * 0, then NULL is returned. */ @@ -2313,8 +2311,12 @@ mono_metadata_get_param_attrs (MonoImage *m, int def, int param_count) guint lastp, i, param_index = mono_metadata_decode_row_col (methodt, def - 1, MONO_METHOD_PARAMLIST); int *pattrs = NULL; + /* hot reload deltas may specify 0 for the param table index */ + if (param_index == 0) + return NULL; + /* FIXME: metadata-update */ - int rows = table_info_get_rows (methodt); + int rows = mono_metadata_table_num_rows (m, MONO_TABLE_METHOD); if (def < rows) lastp = mono_metadata_decode_row_col (methodt, def, MONO_METHOD_PARAMLIST); else @@ -2383,7 +2385,7 @@ mono_metadata_parse_signature_checked (MonoImage *image, guint32 token, MonoErro } g_assert (mono_metadata_token_table(token) == MONO_TABLE_STANDALONESIG); - + sig = mono_metadata_decode_row_col (&tables [MONO_TABLE_STANDALONESIG], idx - 1, 0); ptr = mono_metadata_blob_heap (image, sig); @@ -2963,7 +2965,7 @@ aggregate_modifiers_in_image (MonoAggregateModContainer *amods, MonoImage *image return FALSE; } -/* +/* * Structure used by the collect_..._images functions to store the image list. */ typedef struct { @@ -3083,7 +3085,7 @@ collect_aggregate_modifiers_images (MonoAggregateModContainer *amods, CollectDat for (int i = 0; i < amods->count; ++i) collect_type_images (amods->modifiers [i].type, data); } - + static void collect_type_images (MonoType *type, CollectData *data) { @@ -3255,7 +3257,7 @@ free_aggregate_modifiers (MonoAggregateModContainer *amods) /* * mono_metadata_get_inflated_signature: * - * Given an inflated signature and a generic context, return a canonical copy of the + * Given an inflated signature and a generic context, return a canonical copy of the * signature. The returned signature might be equal to SIG or it might be a cached copy. */ MonoMethodSignature * @@ -3445,7 +3447,7 @@ mono_metadata_get_canonical_aggregate_modifiers (MonoAggregateModContainer *cand { g_assert (candidate->count > 0); MonoMemoryManager *mm = mono_metadata_get_mem_manager_for_aggregate_modifiers (candidate); - + mono_mem_manager_lock (mm); if (!mm->aggregate_modifiers_cache) @@ -3470,7 +3472,7 @@ mono_metadata_get_canonical_aggregate_modifiers (MonoAggregateModContainer *cand static gboolean mono_metadata_is_type_builder_generic_type_definition (MonoClass *container_class, MonoGenericInst *inst, gboolean is_dynamic) { - MonoGenericContainer *container = mono_class_get_generic_container (container_class); + MonoGenericContainer *container = mono_class_get_generic_container (container_class); if (!is_dynamic || m_class_was_typebuilder (container_class) || container->type_argc != inst->type_argc) return FALSE; @@ -3957,7 +3959,7 @@ verify_var_type_and_container (MonoImage *image, int var_type, MonoGenericContai return TRUE; } -/* +/* * do_mono_metadata_parse_type: * @type: MonoType to be filled in with the return value * @m: image context @@ -3965,8 +3967,8 @@ verify_var_type_and_container (MonoImage *image, int var_type, MonoGenericContai * @transient: whenever to allocate data from the heap * @ptr: pointer to the encoded type * @rptr: pointer where the end of the encoded type is saved - * - * Internal routine used to "fill" the contents of @type from an + * + * Internal routine used to "fill" the contents of @type from an * allocated pointer. This is done this way to avoid doing too * many mini-allocations (particularly for the MonoFieldType which * most of the time is just a MonoType, but sometimes might be augmented). @@ -3974,7 +3976,7 @@ verify_var_type_and_container (MonoImage *image, int var_type, MonoGenericContai * This routine is used by mono_metadata_parse_type and * mono_metadata_parse_field_type * - * This extracts a Type as specified in Partition II (22.2.12) + * This extracts a Type as specified in Partition II (22.2.12) * * Returns: FALSE if the type could not be loaded */ @@ -3985,7 +3987,7 @@ do_mono_metadata_parse_type (MonoType *type, MonoImage *m, MonoGenericContainer error_init (error); type->type = (MonoTypeEnum)mono_metadata_decode_value (ptr, &ptr); - + switch (type->type){ case MONO_TYPE_VOID: case MONO_TYPE_BOOLEAN: @@ -4072,7 +4074,7 @@ do_mono_metadata_parse_type (MonoType *type, MonoImage *m, MonoGenericContainer mono_error_set_bad_image (error, m, "type 0x%02x not handled in do_mono_metadata_parse_type on image %s", type->type, m->name); return FALSE; } - + if (rptr) *rptr = ptr; return TRUE; @@ -4089,9 +4091,9 @@ mono_metadata_free_type (MonoType *type) { /* Note: keep in sync with do_mono_metadata_parse_type and try_get_canonical_type which * allocate memory or try to avoid allocating memory. */ - if (type >= builtin_types && type < builtin_types + NBUILTIN_TYPES ()) + if (type >= builtin_types && type < builtin_types + G_N_ELEMENTS (builtin_types)) return; - + switch (type->type){ case MONO_TYPE_OBJECT: case MONO_TYPE_STRING: @@ -4130,7 +4132,7 @@ hex_dump (const char *buffer, int base, int count) count = -count; show_header = 0; } - + for (i = 0; i < count; i++){ if (show_header) if ((i % 16) == 0) @@ -4142,7 +4144,7 @@ hex_dump (const char *buffer, int base, int count) } #endif -/** +/** * @ptr: Points to the beginning of the Section Data (25.3) */ static MonoExceptionClause* @@ -4154,13 +4156,13 @@ parse_section_data (MonoImage *m, int *num_clauses, const unsigned char *ptr, Mo MonoExceptionClause* clauses = NULL; error_init (error); - + while (1) { /* align on 32-bit boundary */ - ptr = dword_align (ptr); + ptr = dword_align (ptr); sect_data_flags = *ptr; ptr++; - + is_fat = sect_data_flags & METHOD_HEADER_SECTION_FAT_FORMAT; if (is_fat) { sect_data_len = (ptr [2] << 16) | (ptr [1] << 8) | ptr [0]; @@ -4574,7 +4576,7 @@ mono_method_header_get_clauses (MonoMethodHeader *header, MonoMethod *method, gp * \param ptr pointer to the field signature * \param rptr pointer updated to match the end of the decoded stream * - * Parses the field signature, and returns the type information for it. + * Parses the field signature, and returns the type information for it. * * \returns The \c MonoType that was extracted from \p ptr . */ @@ -4593,7 +4595,7 @@ mono_metadata_parse_field_type (MonoImage *m, short field_flags, const char *ptr * \param ptr pointer to the param signature * \param rptr pointer updated to match the end of the decoded stream * - * Parses the param signature, and returns the type information for it. + * Parses the param signature, and returns the type information for it. * * \returns The \c MonoType that was extracted from \p ptr . */ @@ -4656,10 +4658,10 @@ typedef struct { * ___|___ Table B * ___|___------> _______ * ___|___ _______ - * + * * A column in the rows of table A references an index in table B. * For example A may be the TYPEDEF table and B the METHODDEF table. - * + * * Given an index in table B we want to get the row in table A * where the column n references our index in B. * @@ -4702,11 +4704,11 @@ typedef_locator (const void *a, const void *b) return 1; if (col == col_next) - return 1; + return 1; } loc->result = typedef_index; - + return 0; } @@ -4717,7 +4719,7 @@ table_locator (const void *a, const void *b) const char *bb = (const char *) b; guint32 table_index = (bb - loc->t->base) / loc->t->row_size; guint32 col; - + col = mono_metadata_decode_row_col (loc->t, table_index, loc->col_idx); if (loc->idx == col) { @@ -4726,7 +4728,7 @@ table_locator (const void *a, const void *b) } if (loc->idx < col) return -1; - else + else return 1; } @@ -4753,7 +4755,7 @@ declsec_locator (const void *a, const void *b) /** * search_ptr_table: * - * Return the 1-based row index in TABLE, which must be one of the *Ptr tables, + * Return the 1-based row index in TABLE, which must be one of the *Ptr tables, * which contains IDX. */ static guint32 @@ -4820,7 +4822,7 @@ mono_metadata_typedef_from_method (MonoImage *meta, guint32 index) { MonoTableInfo *tdef = &meta->tables [MONO_TABLE_TYPEDEF]; locator_t loc; - + if (!tdef->base) return 0; @@ -4831,7 +4833,12 @@ mono_metadata_typedef_from_method (MonoImage *meta, guint32 index) if (meta->uncompressed_metadata) loc.idx = search_ptr_table (meta, MONO_TABLE_METHOD_POINTER, loc.idx); - /* FIXME: metadata-update */ + /* if it's not in the base image, look in the hot reload table */ + gboolean added = (loc.idx > table_info_get_rows (&meta->tables [MONO_TABLE_METHOD])); + if (added) { + uint32_t res = mono_component_hot_reload ()->method_parent (meta, loc.idx); + return res; /* 0 if not found, otherwise 1-based */ + } if (!mono_binary_search (&loc, tdef->base, table_info_get_rows (tdef), tdef->row_size, typedef_locator)) return 0; @@ -4849,7 +4856,7 @@ mono_metadata_typedef_from_method (MonoImage *meta, guint32 index) * \param heap_alloc_result if TRUE the result array will be \c g_malloc'd * \param context The generic context * \param error set on error - * + * * The array of interfaces that the \p index typedef token implements is returned in * \p interfaces. The number of elements in the array is returned in \p count. * @@ -4883,7 +4890,7 @@ mono_metadata_interfaces_from_typedef_full (MonoImage *meta, guint32 index, Mono start = loc.result; /* - * We may end up in the middle of the rows... + * We may end up in the middle of the rows... */ while (start > 0) { if (loc.idx == mono_metadata_decode_row_col (tdef, start - 1, MONO_INTERFACEIMPL_CLASS)) @@ -4908,7 +4915,7 @@ mono_metadata_interfaces_from_typedef_full (MonoImage *meta, guint32 index, Mono pos = start; while (pos < rows) { MonoClass *iface; - + mono_metadata_decode_row (tdef, pos, cols, MONO_INTERFACEIMPL_SIZE); if (cols [MONO_INTERFACEIMPL_CLASS] != loc.idx) break; @@ -4929,7 +4936,7 @@ mono_metadata_interfaces_from_typedef_full (MonoImage *meta, guint32 index, Mono * \param meta metadata context * \param index typedef token * \param count Out parameter used to store the number of interfaces - * + * * The array of interfaces that the \p index typedef token implements is returned in * \p interfaces. The number of elements in the array is returned in \p count. The returned * array is allocated with \c g_malloc and the caller must free it. @@ -4966,7 +4973,7 @@ mono_metadata_nested_in_typedef (MonoImage *meta, guint32 index) { MonoTableInfo *tdef = &meta->tables [MONO_TABLE_NESTEDCLASS]; locator_t loc; - + if (!tdef->base) return 0; @@ -4997,7 +5004,7 @@ mono_metadata_nesting_typedef (MonoImage *meta, guint32 index, guint32 start_ind MonoTableInfo *tdef = &meta->tables [MONO_TABLE_NESTEDCLASS]; guint32 start; guint32 class_index = mono_metadata_token_index (index); - + if (!tdef->base) return 0; @@ -5033,7 +5040,7 @@ mono_metadata_packing_from_typedef (MonoImage *meta, guint32 index, guint32 *pac MonoTableInfo *tdef = &meta->tables [MONO_TABLE_CLASSLAYOUT]; locator_t loc; guint32 cols [MONO_CLASS_LAYOUT_SIZE]; - + if (!tdef->base) return 0; @@ -5042,7 +5049,7 @@ mono_metadata_packing_from_typedef (MonoImage *meta, guint32 index, guint32 *pac loc.t = tdef; /* FIXME: metadata-update */ - + if (!mono_binary_search (&loc, tdef->base, table_info_get_rows (tdef), tdef->row_size, table_locator)) return 0; @@ -5060,7 +5067,7 @@ mono_metadata_packing_from_typedef (MonoImage *meta, guint32 index, guint32 *pac * mono_metadata_custom_attrs_from_index: * \param meta metadata context * \param index token representing the parent - * \returns: the 1-based index into the \c CustomAttribute table of the first + * \returns: the 1-based index into the \c CustomAttribute table of the first * attribute which belongs to the metadata object described by \p index. * Returns 0 if no such attribute is found. */ @@ -5069,7 +5076,7 @@ mono_metadata_custom_attrs_from_index (MonoImage *meta, guint32 index) { MonoTableInfo *tdef = &meta->tables [MONO_TABLE_CUSTOMATTRIBUTE]; locator_t loc; - + if (!tdef->base) return 0; @@ -5095,7 +5102,7 @@ mono_metadata_custom_attrs_from_index (MonoImage *meta, guint32 index) * mono_metadata_declsec_from_index: * \param meta metadata context * \param index token representing the parent - * \returns the 0-based index into the \c DeclarativeSecurity table of the first + * \returns the 0-based index into the \c DeclarativeSecurity table of the first * attribute which belongs to the metadata object described by \p index. * Returns \c -1 if no such attribute is found. */ @@ -5113,7 +5120,7 @@ mono_metadata_declsec_from_index (MonoImage *meta, guint32 index) loc.t = tdef; /* FIXME: metadata-update */ - + if (!mono_binary_search (&loc, tdef->base, table_info_get_rows (tdef), tdef->row_size, declsec_locator)) return -1; @@ -5128,7 +5135,7 @@ mono_metadata_declsec_from_index (MonoImage *meta, guint32 index) * mono_metadata_localscope_from_methoddef: * @meta: metadata context * @index: methoddef index - * + * * Returns: the 1-based index into the LocalScope table of the first * scope which belongs to the method described by @index. * Returns 0 if no such row is found. @@ -5147,7 +5154,7 @@ mono_metadata_localscope_from_methoddef (MonoImage *meta, guint32 index) loc.t = tdef; /* FIXME: metadata-update */ - + if (!mono_binary_search (&loc, tdef->base, table_info_get_rows (tdef), tdef->row_size, table_locator)) return 0; @@ -5234,7 +5241,7 @@ mono_type_size (MonoType *t, int *align) case MONO_TYPE_I2: case MONO_TYPE_U2: *align = MONO_ABI_ALIGNOF (gint16); - return 2; + return 2; case MONO_TYPE_I4: case MONO_TYPE_U4: *align = MONO_ABI_ALIGNOF (gint32); @@ -5245,10 +5252,10 @@ mono_type_size (MonoType *t, int *align) case MONO_TYPE_I8: case MONO_TYPE_U8: *align = MONO_ABI_ALIGNOF (gint64); - return 8; + return 8; case MONO_TYPE_R8: *align = MONO_ABI_ALIGNOF (double); - return 8; + return 8; case MONO_TYPE_I: case MONO_TYPE_U: *align = MONO_ABI_ALIGNOF (gpointer); @@ -5368,11 +5375,11 @@ mono_type_stack_size_internal (MonoType *t, int *align, gboolean allow_open) return stack_slot_size * 3; case MONO_TYPE_R4: *align = MONO_ABI_ALIGNOF (float); - return sizeof (float); + return sizeof (float); case MONO_TYPE_I8: case MONO_TYPE_U8: *align = MONO_ABI_ALIGNOF (gint64); - return sizeof (gint64); + return sizeof (gint64); case MONO_TYPE_R8: *align = MONO_ABI_ALIGNOF (double); return sizeof (double); @@ -5507,7 +5514,7 @@ mono_metadata_str_hash (gconstpointer v1) } return hash; -} +} /** * mono_metadata_type_hash: @@ -5857,10 +5864,10 @@ signature_equiv (MonoMethodSignature *sig1, MonoMethodSignature *sig2, int equiv * That's what the `signature_only' argument of do_mono_metadata_type_equal() is for. */ - for (i = 0; i < sig1->param_count; i++) { + for (i = 0; i < sig1->param_count; i++) { MonoType *p1 = sig1->params[i]; MonoType *p2 = sig2->params[i]; - + /* if (p1->attrs != p2->attrs) return FALSE; */ @@ -5987,7 +5994,7 @@ do_metadata_type_dup_append_cmods (MonoImage *image, const MonoType *o, const Mo uint8_t total_cmods = 0; total_cmods += mono_type_custom_modifier_count (o); total_cmods += mono_type_custom_modifier_count (cmods_source); - + gboolean aggregate = TRUE; size_t sizeof_dup = mono_sizeof_type_with_mods (total_cmods, aggregate); @@ -6103,7 +6110,7 @@ void mono_metadata_encode_value (guint32 value, char *buf, char **endbuf) { char *p = buf; - + if (value < 0x80) *p++ = value; else if (value < 0x4000) { @@ -6129,27 +6136,27 @@ mono_metadata_encode_value (guint32 value, char *buf, char **endbuf) * \param rva a pointer to the RVA of the field data in the image that may have been defined in a \c FieldRVA table * \param marshal_spec a pointer to the marshal spec that may have been defined for the field in a \c FieldMarshal table. * - * Gather info for field \p index that may have been defined in the \c FieldLayout, + * Gather info for field \p index that may have been defined in the \c FieldLayout, * \c FieldRVA and \c FieldMarshal tables. - * Either of \p offset, \p rva and \p marshal_spec can be NULL if you're not interested + * Either of \p offset, \p rva and \p marshal_spec can be NULL if you're not interested * in the data. */ void -mono_metadata_field_info (MonoImage *meta, guint32 index, guint32 *offset, guint32 *rva, +mono_metadata_field_info (MonoImage *meta, guint32 index, guint32 *offset, guint32 *rva, MonoMarshalSpec **marshal_spec) { mono_metadata_field_info_full (meta, index, offset, rva, marshal_spec, FALSE); } void -mono_metadata_field_info_with_mempool (MonoImage *meta, guint32 index, guint32 *offset, guint32 *rva, +mono_metadata_field_info_with_mempool (MonoImage *meta, guint32 index, guint32 *offset, guint32 *rva, MonoMarshalSpec **marshal_spec) { mono_metadata_field_info_full (meta, index, offset, rva, marshal_spec, TRUE); } static void -mono_metadata_field_info_full (MonoImage *meta, guint32 index, guint32 *offset, guint32 *rva, +mono_metadata_field_info_full (MonoImage *meta, guint32 index, guint32 *offset, guint32 *rva, MonoMarshalSpec **marshal_spec, gboolean alloc_from_image) { MonoTableInfo *tdef; @@ -6178,7 +6185,7 @@ mono_metadata_field_info_full (MonoImage *meta, guint32 index, guint32 *offset, loc.col_idx = MONO_FIELD_RVA_FIELD; loc.t = tdef; - + if (tdef->base && mono_binary_search (&loc, tdef->base, table_info_get_rows (tdef), tdef->row_size, table_locator)) { /* * LAMESPEC: There is no signature, no nothing, just the raw data. @@ -6190,7 +6197,7 @@ mono_metadata_field_info_full (MonoImage *meta, guint32 index, guint32 *offset, } if (marshal_spec) { const char *p; - + if ((p = mono_metadata_get_marshal_info (meta, index, TRUE))) { *marshal_spec = mono_metadata_parse_marshal_spec_full (alloc_from_image ? meta : NULL, meta, p); } @@ -6264,7 +6271,7 @@ mono_metadata_events_from_typedef (MonoImage *meta, guint32 index, guint *end_id MonoTableInfo *tdef = &meta->tables [MONO_TABLE_EVENTMAP]; *end_idx = 0; - + if (!tdef->base) return 0; @@ -6276,7 +6283,7 @@ mono_metadata_events_from_typedef (MonoImage *meta, guint32 index, guint *end_id if (!mono_binary_search (&loc, tdef->base, table_info_get_rows (tdef), tdef->row_size, table_locator)) return 0; - + start = mono_metadata_decode_row_col (tdef, loc.result, MONO_EVENT_MAP_EVENTLIST); if (loc.result + 1 < table_info_get_rows (tdef)) { end = mono_metadata_decode_row_col (tdef, loc.result + 1, MONO_EVENT_MAP_EVENTLIST) - 1; @@ -6322,7 +6329,7 @@ mono_metadata_methods_from_event (MonoImage *meta, guint32 index, guint *end_i start = loc.result; /* - * We may end up in the middle of the rows... + * We may end up in the middle of the rows... */ while (start > 0) { if (loc.idx == mono_metadata_decode_row_col (msemt, start - 1, MONO_METHOD_SEMA_ASSOCIATION)) @@ -6358,7 +6365,7 @@ mono_metadata_properties_from_typedef (MonoImage *meta, guint32 index, guint *en MonoTableInfo *tdef = &meta->tables [MONO_TABLE_PROPERTYMAP]; *end_idx = 0; - + if (!tdef->base) return 0; @@ -6370,7 +6377,7 @@ mono_metadata_properties_from_typedef (MonoImage *meta, guint32 index, guint *en if (!mono_binary_search (&loc, tdef->base, table_info_get_rows (tdef), tdef->row_size, table_locator)) return 0; - + start = mono_metadata_decode_row_col (tdef, loc.result, MONO_PROPERTY_MAP_PROPERTY_LIST); if (loc.result + 1 < table_info_get_rows (tdef)) { end = mono_metadata_decode_row_col (tdef, loc.result + 1, MONO_PROPERTY_MAP_PROPERTY_LIST) - 1; @@ -6410,13 +6417,13 @@ mono_metadata_methods_from_property (MonoImage *meta, guint32 index, guint *en loc.idx = ((index + 1) << MONO_HAS_SEMANTICS_BITS) | MONO_HAS_SEMANTICS_PROPERTY; /* Method association coded index */ /* FIXME: metadata-update */ - + if (!mono_binary_search (&loc, msemt->base, table_info_get_rows (msemt), msemt->row_size, table_locator)) return 0; start = loc.result; /* - * We may end up in the middle of the rows... + * We may end up in the middle of the rows... */ while (start > 0) { if (loc.idx == mono_metadata_decode_row_col (msemt, start - 1, MONO_METHOD_SEMA_ASSOCIATION)) @@ -6562,7 +6569,7 @@ mono_metadata_parse_marshal_spec_full (MonoImage *image, MonoImage *parent_image res = (MonoMarshalSpec *)mono_image_alloc0 (image, sizeof (MonoMarshalSpec)); else res = g_new0 (MonoMarshalSpec, 1); - + len = mono_metadata_decode_value (ptr, &ptr); res->native = (MonoMarshalNative)*ptr++; @@ -6579,7 +6586,7 @@ mono_metadata_parse_marshal_spec_full (MonoImage *image, MonoImage *parent_image res->data.array_data.num_elem = mono_metadata_decode_value (ptr, &ptr); if (ptr - start <= len) { /* - * LAMESPEC: Older spec versions say this parameter comes before + * LAMESPEC: Older spec versions say this parameter comes before * num_elem. Never spec versions don't talk about elem_mult at * all, but csc still emits it, and it is used to distinguish * between param_num being 0, and param_num being omitted. @@ -6589,7 +6596,7 @@ mono_metadata_parse_marshal_spec_full (MonoImage *image, MonoImage *parent_image */ res->data.array_data.elem_mult = mono_metadata_decode_value (ptr, &ptr); } - } + } if (res->native == MONO_NATIVE_BYVALTSTR) { if (ptr - start <= len) @@ -6600,7 +6607,7 @@ mono_metadata_parse_marshal_spec_full (MonoImage *image, MonoImage *parent_image if (ptr - start <= len) res->data.array_data.num_elem = mono_metadata_decode_value (ptr, &ptr); } - + if (res->native == MONO_NATIVE_CUSTOM) { /* skip unused type guid */ len = mono_metadata_decode_value (ptr, &ptr); @@ -6610,7 +6617,7 @@ mono_metadata_parse_marshal_spec_full (MonoImage *image, MonoImage *parent_image ptr += len; /* read custom marshaler type name */ len = mono_metadata_decode_value (ptr, &ptr); - res->data.custom_data.custom_name = mono_image_strndup (image, ptr, len); + res->data.custom_data.custom_name = mono_image_strndup (image, ptr, len); ptr += len; /* read cookie string */ len = mono_metadata_decode_value (ptr, &ptr); @@ -6632,7 +6639,7 @@ mono_metadata_parse_marshal_spec_full (MonoImage *image, MonoImage *parent_image /** * mono_metadata_free_marshal_spec: */ -void +void mono_metadata_free_marshal_spec (MonoMarshalSpec *spec) { if (!spec) @@ -6654,7 +6661,7 @@ mono_metadata_free_marshal_spec (MonoMarshalSpec *spec) */ guint32 // FIXMEcxx MonoMarshalNative mono_type_to_unmanaged (MonoType *type, MonoMarshalSpec *mspec, gboolean as_field, - gboolean unicode, MonoMarshalConv *conv) + gboolean unicode, MonoMarshalConv *conv) { MonoMarshalConv dummy_conv; int t = type->type; @@ -6669,7 +6676,7 @@ mono_type_to_unmanaged (MonoType *type, MonoMarshalSpec *mspec, gboolean as_fiel handle_enum: switch (t) { - case MONO_TYPE_BOOLEAN: + case MONO_TYPE_BOOLEAN: if (mspec) { switch (mspec->native) { case MONO_NATIVE_VARIANTBOOL: @@ -6741,14 +6748,14 @@ mono_type_to_unmanaged (MonoType *type, MonoMarshalSpec *mspec, gboolean as_fiel default: g_error ("Can not marshal string to native type '%02x': Invalid managed/unmanaged type combination (String fields must be paired with LPStr, LPWStr, BStr or ByValTStr).", mspec->native); } - } + } if (unicode) { *conv = MONO_MARSHAL_CONV_STR_LPWSTR; - return MONO_NATIVE_LPWSTR; + return MONO_NATIVE_LPWSTR; } else { *conv = MONO_MARSHAL_CONV_STR_LPSTR; - return MONO_NATIVE_LPSTR; + return MONO_NATIVE_LPSTR; } case MONO_TYPE_PTR: return MONO_NATIVE_UINT; case MONO_TYPE_VALUETYPE: /*FIXME*/ @@ -6761,8 +6768,8 @@ mono_type_to_unmanaged (MonoType *type, MonoMarshalSpec *mspec, gboolean as_fiel return MONO_NATIVE_INT; } return MONO_NATIVE_STRUCT; - case MONO_TYPE_SZARRAY: - case MONO_TYPE_ARRAY: + case MONO_TYPE_SZARRAY: + case MONO_TYPE_ARRAY: if (mspec) { switch (mspec->native) { case MONO_NATIVE_BYVALARRAY: @@ -6774,19 +6781,19 @@ mono_type_to_unmanaged (MonoType *type, MonoMarshalSpec *mspec, gboolean as_fiel case MONO_NATIVE_SAFEARRAY: *conv = MONO_MARSHAL_CONV_ARRAY_SAVEARRAY; return MONO_NATIVE_SAFEARRAY; - case MONO_NATIVE_LPARRAY: + case MONO_NATIVE_LPARRAY: *conv = MONO_MARSHAL_CONV_ARRAY_LPARRAY; return MONO_NATIVE_LPARRAY; default: g_error ("cant marshal array as native type %02x", mspec->native); } - } + } *conv = MONO_MARSHAL_CONV_ARRAY_LPARRAY; return MONO_NATIVE_LPARRAY; case MONO_TYPE_I: return MONO_NATIVE_INT; case MONO_TYPE_U: return MONO_NATIVE_UINT; - case MONO_TYPE_CLASS: + case MONO_TYPE_CLASS: case MONO_TYPE_OBJECT: { /* FIXME : we need to handle ArrayList and StringBuilder here, probably */ if (mspec) { @@ -6817,7 +6824,7 @@ mono_type_to_unmanaged (MonoType *type, MonoMarshalSpec *mspec, gboolean as_fiel return MONO_NATIVE_IUNKNOWN; case MONO_NATIVE_FUNC: if (t == MONO_TYPE_CLASS && (type->data.klass == mono_defaults.multicastdelegate_class || - type->data.klass == mono_defaults.delegate_class || + type->data.klass == mono_defaults.delegate_class || m_class_get_parent (type->data.klass) == mono_defaults.multicastdelegate_class)) { *conv = MONO_MARSHAL_CONV_DEL_FTN; return MONO_NATIVE_FUNC; @@ -6828,7 +6835,7 @@ mono_type_to_unmanaged (MonoType *type, MonoMarshalSpec *mspec, gboolean as_fiel } } if (t == MONO_TYPE_CLASS && (type->data.klass == mono_defaults.multicastdelegate_class || - type->data.klass == mono_defaults.delegate_class || + type->data.klass == mono_defaults.delegate_class || m_class_get_parent (type->data.klass) == mono_defaults.multicastdelegate_class)) { *conv = MONO_MARSHAL_CONV_DEL_FTN; return MONO_NATIVE_FUNC; @@ -6921,7 +6928,7 @@ mono_class_get_overrides_full (MonoImage *image, guint32 type_token, MonoMethod gint32 i, num; guint32 cols [MONO_METHODIMPL_SIZE]; MonoMethod **result; - + error_init (error); *overrides = NULL; @@ -6943,7 +6950,7 @@ mono_class_get_overrides_full (MonoImage *image, guint32 type_token, MonoMethod start = loc.result; end = start + 1; /* - * We may end up in the middle of the rows... + * We may end up in the middle of the rows... */ while (start > 0) { if (loc.idx == mono_metadata_decode_row_col (tdef, start - 1, MONO_METHODIMPL_CLASS)) @@ -6996,7 +7003,7 @@ mono_class_get_overrides_full (MonoImage *image, guint32 type_token, MonoMethod char * mono_guid_to_string (const guint8 *guid) { - return g_strdup_printf ("%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X", + return g_strdup_printf ("%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X", guid[3], guid[2], guid[1], guid[0], guid[5], guid[4], guid[7], guid[6], @@ -7069,7 +7076,7 @@ get_constraints (MonoImage *image, int owner, MonoClass ***constraints, MonoGene * @image: * @token: TypeOrMethodDef token, owner for GenericParam * @owner: coded token, set on return - * + * * Returns: 1-based row-id in the GenericParam table whose * owner is @token. 0 if not found. */ @@ -7353,7 +7360,7 @@ mono_type_is_struct (MonoType *type) { return (!m_type_is_byref (type) && ((type->type == MONO_TYPE_VALUETYPE && !m_class_is_enumtype (type->data.klass)) || (type->type == MONO_TYPE_TYPEDBYREF) || - ((type->type == MONO_TYPE_GENERICINST) && + ((type->type == MONO_TYPE_GENERICINST) && mono_metadata_generic_class_is_valuetype (type->data.generic_class) && !m_class_is_enumtype (type->data.generic_class->container_class)))); } @@ -7675,7 +7682,7 @@ mono_sizeof_aggregate_modifiers (uint8_t num_mods) return accum; } -size_t +size_t mono_sizeof_type_with_mods (uint8_t num_mods, gboolean is_aggregate) { if (num_mods == 0) @@ -7693,7 +7700,7 @@ mono_sizeof_type_with_mods (uint8_t num_mods, gboolean is_aggregate) return accum; } -size_t +size_t mono_sizeof_type (const MonoType *ty) { if (ty->has_cmods) { diff --git a/src/mono/mono/metadata/mono-perfcounters.c b/src/mono/mono/metadata/mono-perfcounters.c index 316e1b340473b9..d38f69a9da930b 100644 --- a/src/mono/mono/metadata/mono-perfcounters.c +++ b/src/mono/mono/metadata/mono-perfcounters.c @@ -406,7 +406,7 @@ predef_cleanup (ImplVtable *vtable) { PredefVtable *vt = (PredefVtable*)vtable; /* ExternalSArea *data; */ - + perfctr_lock (); if (!pid_to_shared_area) { perfctr_unlock (); diff --git a/src/mono/mono/metadata/native-library-qcall.c b/src/mono/mono/metadata/native-library-qcall.c index 519d37daecf943..5b17173c666123 100644 --- a/src/mono/mono/metadata/native-library-qcall.c +++ b/src/mono/mono/metadata/native-library-qcall.c @@ -1,7 +1,7 @@ -#include +#include #include "mono/metadata/native-library.h" -static Entry mono_qcalls[] = +static Entry mono_qcalls[] = { DllImportEntry(NULL) // This NULL entry can be removed when a QCall is added to Mono (and added to this array) }; @@ -9,5 +9,5 @@ static Entry mono_qcalls[] = gpointer mono_lookup_pinvoke_qcall_internal (const char *name) { - return (gpointer)minipal_resolve_dllimport(mono_qcalls, lengthof(mono_qcalls), name); + return (gpointer)minipal_resolve_dllimport(mono_qcalls, G_N_ELEMENTS(mono_qcalls), name); } diff --git a/src/mono/mono/metadata/object-internals.h b/src/mono/mono/metadata/object-internals.h index 361a6dbcc01dc2..425604aeabdbd1 100644 --- a/src/mono/mono/metadata/object-internals.h +++ b/src/mono/mono/metadata/object-internals.h @@ -176,10 +176,13 @@ struct _MonoArray { }; /* match the layout of the managed definition of Span */ -typedef struct { - MonoObject** _pointer; - int32_t _length; -} MonoSpanOfObjects; +#define MONO_DEFINE_SPAN_OF_T(name, type) \ + typedef struct { \ + type* _pointer; \ + uint32_t _length; \ + } name; + +MONO_DEFINE_SPAN_OF_T (MonoSpanOfObjects, MonoObject*) #define MONO_SIZEOF_MONO_ARRAY (MONO_STRUCT_OFFSET_CONSTANT (MonoArray, vector)) @@ -284,7 +287,7 @@ mono_handle_array_get_bounds_dim (MonoArrayHandle arr, gint32 dim, MonoArrayBoun #define mono_span_length(span) (span->_length) -#define mono_span_get(span,type,idx) (type)(!span->_pointer ? NULL : span->_pointer[idx]) +#define mono_span_get(span,type,idx) (type)(!span->_pointer ? (type)0 : span->_pointer[idx]) #define mono_span_addr(span,type,idx) (type*)(span->_pointer + idx) @@ -1403,13 +1406,6 @@ typedef enum { UNLOADING = 1 } MonoManagedAssemblyLoadContextInternalState; -// Keep in sync with System.Runtime.Loader.AssemblyLoadContext -typedef struct { - MonoObject object; - MonoAssemblyLoadContext *native_assembly_load_context; -} MonoManagedAssemblyLoadContext; - -TYPED_HANDLE_DECL (MonoManagedAssemblyLoadContext); /* All MonoInternalThread instances should be pinned, so it's safe to use the raw ptr. However * for uniformity, icall wrapping will make handles anyway. So this is the method for getting the payload. diff --git a/src/mono/mono/metadata/object.c b/src/mono/mono/metadata/object.c index 70f77b0495c495..7def77c718f468 100644 --- a/src/mono/mono/metadata/object.c +++ b/src/mono/mono/metadata/object.c @@ -3714,24 +3714,25 @@ mono_get_delegate_end_invoke_checked (MonoClass *klass, MonoError *error) MonoObject* mono_runtime_delegate_invoke (MonoObject *delegate, void **params, MonoObject **exc) { - MONO_REQ_GC_UNSAFE_MODE; - ERROR_DECL (error); + MonoObject* result = NULL; + MONO_ENTER_GC_UNSAFE; if (exc) { - MonoObject *result = mono_runtime_delegate_try_invoke (delegate, params, exc, error); + result = mono_runtime_delegate_try_invoke (delegate, params, exc, error); if (*exc) { mono_error_cleanup (error); - return NULL; + result = NULL; } else { if (!is_ok (error)) *exc = (MonoObject*)mono_error_convert_to_exception (error); - return result; } } else { - MonoObject *result = mono_runtime_delegate_invoke_checked (delegate, params, error); + result = mono_runtime_delegate_invoke_checked (delegate, params, error); mono_error_raise_exception_deprecated (error); /* OK to throw, external only without a good alternative */ - return result; + } + MONO_EXIT_GC_UNSAFE; + return result; } /** diff --git a/src/mono/mono/metadata/profiler-events.h b/src/mono/mono/metadata/profiler-events.h index c7ab3f66d516dd..20300bff65f1c2 100644 --- a/src/mono/mono/metadata/profiler-events.h +++ b/src/mono/mono/metadata/profiler-events.h @@ -106,3 +106,5 @@ MONO_PROFILER_EVENT_1(thread_exited, ThreadExited, uintptr_t, tid) MONO_PROFILER_EVENT_2(thread_name, ThreadName, uintptr_t, tid, const char *, name) MONO_PROFILER_EVENT_2(sample_hit, SampleHit, const mono_byte *, ip, const void *, context) + +MONO_PROFILER_EVENT_2(inline_method, InlineMethod, MonoMethod *, method, MonoMethod *, inlined_method) diff --git a/src/mono/mono/metadata/threads-types.h b/src/mono/mono/metadata/threads-types.h index 0e38b09429c6f4..fe57d74a02e393 100644 --- a/src/mono/mono/metadata/threads-types.h +++ b/src/mono/mono/metadata/threads-types.h @@ -261,7 +261,7 @@ mono_thread_set_name (MonoInternalThread *thread, MonoSetThreadNameFlags flags, MonoError *error); #define mono_thread_set_name_constant_ignore_error(thread, name, flags) \ - mono_thread_set_name ((thread), name, G_N_ELEMENTS (name) - 1, \ + mono_thread_set_name ((thread), name, STRING_LENGTH (name), \ MONO_THREAD_NAME_WINDOWS_CONSTANT (name), \ (flags) | MonoSetThreadNameFlag_Constant, NULL) @@ -379,11 +379,11 @@ mono_threads_exiting (void); /* Spin lock for unaligned InterlockedXXX 64 bit functions on 32bit platforms. */ extern mono_mutex_t mono_interlocked_mutex; static inline void -mono_interlocked_lock(void) { +mono_interlocked_lock(void) { mono_os_mutex_lock (&mono_interlocked_mutex); } static inline void -mono_interlocked_unlock(void) { +mono_interlocked_unlock(void) { mono_os_mutex_unlock (&mono_interlocked_mutex); } #endif diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index 17c52fc6d22032..2610dda6b93c8f 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -81,7 +81,7 @@ if(HAVE_SYS_ICU) ${pal_icushim_sources_base}) addprefix(icu_shim_sources "${ICU_SHIM_PATH}" "${icu_shim_sources_base}") set_source_files_properties(${icu_shim_sources} PROPERTIES COMPILE_DEFINITIONS OSX_ICU_LIBRARY_PATH="${OSX_ICU_LIBRARY_PATH}") - set_source_files_properties(${icu_shim_sources} PROPERTIES COMPILE_FLAGS "-I\"${ICU_INCLUDEDIR}\" -I\"${CMAKE_CURRENT_SOURCE_DIR}/../../../libraries/Native/Unix/System.Globalization.Native/\" -I\"${CMAKE_CURRENT_SOURCE_DIR}/../../../libraries/Native/Unix/Common/\" ${ICU_FLAGS}") + set_source_files_properties(${icu_shim_sources} PROPERTIES COMPILE_FLAGS "-I\"${ICU_INCLUDEDIR}\" -I\"${CLR_SRC_NATIVE_DIR}/libs/System.Globalization.Native/\" -I\"${CLR_SRC_NATIVE_DIR}/libs/Common/\" ${ICU_FLAGS}") if(TARGET_WIN32) set_source_files_properties(${icu_shim_sources} PROPERTIES LANGUAGE CXX) endif() diff --git a/src/mono/mono/mini/aot-compiler.c b/src/mono/mono/mini/aot-compiler.c index 9a46d36be63515..a8c1188832cef7 100644 --- a/src/mono/mono/mini/aot-compiler.c +++ b/src/mono/mono/mini/aot-compiler.c @@ -8,7 +8,7 @@ * Johan Lorensson (lateralusx.github@gmail.com) * * (C) 2002 Ximian, Inc. - * Copyright 2003-2011 Novell, Inc + * Copyright 2003-2011 Novell, Inc * Copyright 2011 Xamarin Inc (http://www.xamarin.com) * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ @@ -210,10 +210,10 @@ typedef struct MonoAotOptions { gboolean use_trampolines_page; gboolean no_instances; // We are collecting inflated methods and emitting non-inflated - gboolean dedup; - // The name of the assembly for which the AOT module is going to have all deduped methods moved to. + gboolean dedup; + // The name of the assembly for which the AOT module is going to have all deduped methods moved to. // When set, we are emitting inflated methods only - char *dedup_include; + char *dedup_include; gboolean gnu_asm; gboolean try_llvm; gboolean llvm; @@ -450,10 +450,10 @@ get_patch_name (int info) static int emit_aot_image (MonoAotCompile *acfg); -static void +static void mono_flush_method_cache (MonoAotCompile *acfg); -static void +static void mono_read_method_cache (MonoAotCompile *acfg); static guint32 @@ -604,40 +604,40 @@ emit_local_symbol (MonoAotCompile *acfg, const char *name, const char *end_label #else static void -emit_local_symbol (MonoAotCompile *acfg, const char *name, const char *end_label, gboolean func) -{ +emit_local_symbol (MonoAotCompile *acfg, const char *name, const char *end_label, gboolean func) +{ mono_img_writer_emit_local_symbol (acfg->w, name, end_label, func); } #endif static void -emit_label (MonoAotCompile *acfg, const char *name) -{ - mono_img_writer_emit_label (acfg->w, name); +emit_label (MonoAotCompile *acfg, const char *name) +{ + mono_img_writer_emit_label (acfg->w, name); } static void -emit_bytes (MonoAotCompile *acfg, const guint8* buf, int size) -{ - mono_img_writer_emit_bytes (acfg->w, buf, size); +emit_bytes (MonoAotCompile *acfg, const guint8* buf, int size) +{ + mono_img_writer_emit_bytes (acfg->w, buf, size); } static void -emit_string (MonoAotCompile *acfg, const char *value) -{ - mono_img_writer_emit_string (acfg->w, value); +emit_string (MonoAotCompile *acfg, const char *value) +{ + mono_img_writer_emit_string (acfg->w, value); } static void -emit_line (MonoAotCompile *acfg) -{ - mono_img_writer_emit_line (acfg->w); +emit_line (MonoAotCompile *acfg) +{ + mono_img_writer_emit_line (acfg->w); } static void emit_alignment (MonoAotCompile *acfg, int size) -{ +{ mono_img_writer_emit_alignment (acfg->w, size); } @@ -672,14 +672,14 @@ emit_padding (MonoAotCompile *acfg, int size) } static void -emit_pointer (MonoAotCompile *acfg, const char *target) -{ - mono_img_writer_emit_pointer (acfg->w, target); +emit_pointer (MonoAotCompile *acfg, const char *target) +{ + mono_img_writer_emit_pointer (acfg->w, target); } static void -emit_pointer_2 (MonoAotCompile *acfg, const char *prefix, const char *target) -{ +emit_pointer_2 (MonoAotCompile *acfg, const char *prefix, const char *target) +{ if (prefix [0] != '\0') { char *s = g_strdup_printf ("%s%s", prefix, target); mono_img_writer_emit_pointer (acfg->w, s); @@ -690,33 +690,33 @@ emit_pointer_2 (MonoAotCompile *acfg, const char *prefix, const char *target) } static void -emit_int16 (MonoAotCompile *acfg, int value) -{ - mono_img_writer_emit_int16 (acfg->w, value); +emit_int16 (MonoAotCompile *acfg, int value) +{ + mono_img_writer_emit_int16 (acfg->w, value); } static void -emit_int32 (MonoAotCompile *acfg, int value) -{ - mono_img_writer_emit_int32 (acfg->w, value); +emit_int32 (MonoAotCompile *acfg, int value) +{ + mono_img_writer_emit_int32 (acfg->w, value); } static void -emit_symbol_diff (MonoAotCompile *acfg, const char *end, const char* start, int offset) -{ - mono_img_writer_emit_symbol_diff (acfg->w, end, start, offset); +emit_symbol_diff (MonoAotCompile *acfg, const char *end, const char* start, int offset) +{ + mono_img_writer_emit_symbol_diff (acfg->w, end, start, offset); } static void -emit_zero_bytes (MonoAotCompile *acfg, int num) -{ - mono_img_writer_emit_zero_bytes (acfg->w, num); +emit_zero_bytes (MonoAotCompile *acfg, int num) +{ + mono_img_writer_emit_zero_bytes (acfg->w, num); } static void -emit_byte (MonoAotCompile *acfg, guint8 val) -{ - mono_img_writer_emit_byte (acfg->w, val); +emit_byte (MonoAotCompile *acfg, guint8 val) +{ + mono_img_writer_emit_byte (acfg->w, val); } #if defined(TARGET_WIN32) && defined(TARGET_X86) @@ -729,7 +729,7 @@ emit_global_inner (MonoAotCompile *acfg, const char *name, gboolean func) mangled_symbol_name_alloc = mangle_symbol_alloc (name); mangled_symbol_name = mangled_symbol_name_alloc; - + if (0 != g_strcasecmp (name, mangled_symbol_name)) { mono_img_writer_emit_label (acfg->w, mangled_symbol_name); } @@ -1035,7 +1035,7 @@ arch_emit_unwind_info_sections (MonoAotCompile *acfg, const char *function_start #else #define AOT_FUNC_ALIGNMENT 16 #endif - + #if defined(TARGET_POWERPC64) && !defined(MONO_ARCH_ILP32) #define PPC_LD_OP "ld" #define PPC_LDX_OP "ldx" @@ -1666,7 +1666,7 @@ arch_emit_label_address (MonoAotCompile *acfg, const char *target, gboolean exte /* * PPC32 design: - * - we use an approach similar to the x86 abi: reserve a register (r30) to hold + * - we use an approach similar to the x86 abi: reserve a register (r30) to hold * the GOT pointer. * - The full-aot trampolines need access to the GOT of mscorlib, so we store * in in the 2. slot of every GOT, and require every method to place the GOT @@ -1677,13 +1677,13 @@ arch_emit_label_address (MonoAotCompile *acfg, const char *target, gboolean exte /* * PPC64 design: * PPC64 uses function descriptors which greatly complicate all code, since - * these are used very inconsistently in the runtime. Some functions like + * these are used very inconsistently in the runtime. Some functions like * mono_compile_method () return ftn descriptors, while others like the * trampoline creation functions do not. - * We assume that all GOT slots contain function descriptors, and create + * We assume that all GOT slots contain function descriptors, and create * descriptors in aot-runtime.c when needed. * The ppc64 abi uses r2 to hold the address of the TOC/GOT, which is loaded - * from function descriptors, we could do the same, but it would require + * from function descriptors, we could do the same, but it would require * rewriting all the ppc/aot code to handle function descriptors properly. * So instead, we use the same approach as on PPC32. * This is a horrible mess, but fixing it would probably lead to an even bigger @@ -1708,7 +1708,7 @@ arch_emit_got_offset (MonoAotCompile *acfg, guint8 *code, int *code_size) { #if defined(TARGET_POWERPC64) emit_unset_mode (acfg); - /* + /* * The ppc32 code doesn't seem to work on ppc64, the assembler complains about * unsupported relocations. So we store the got address into the .Lgot_addr * symbol which is in the text segment, compute its address, and load it. @@ -2253,8 +2253,8 @@ static void arch_emit_specific_trampoline (MonoAotCompile *acfg, int offset, int *tramp_size) { /* - * The trampolines created here are variations of the specific - * trampolines created in mono_arch_create_specific_trampoline (). The + * The trampolines created here are variations of the specific + * trampolines created in mono_arch_create_specific_trampoline (). The * differences are: * - the generic trampoline address is taken from a got slot. * - the offset of the got slot where the trampoline argument is stored @@ -2298,7 +2298,7 @@ arch_emit_specific_trampoline (MonoAotCompile *acfg, int offset, int *tramp_size /* Emit it */ emit_bytes (acfg, buf, code - buf); - /* + /* * Only one offset is needed, since the second one would be equal to the * first one. */ @@ -2563,7 +2563,7 @@ arch_emit_static_rgctx_trampoline (MonoAotCompile *acfg, int offset, int *tramp_ #else g_assert_not_reached (); #endif -} +} /* * arch_emit_imt_trampoline: @@ -2571,8 +2571,8 @@ arch_emit_static_rgctx_trampoline (MonoAotCompile *acfg, int offset, int *tramp_ * Emit an IMT trampoline usable in full-aot mode. The trampoline uses 1 got slot which * points to an array of pointer pairs. The pairs of the form [key, ptr], where * key is the IMT key, and ptr holds the address of a memory location holding - * the address to branch to if the IMT arg matches the key. The array is - * terminated by a pair whose key is NULL, and whose ptr is the address of the + * the address to branch to if the IMT arg matches the key. The array is + * terminated by a pair whose key is NULL, and whose ptr is the address of the * fail_tramp. * TRAMP_SIZE is set to the size of the emitted trampoline. */ @@ -2705,7 +2705,7 @@ arch_emit_imt_trampoline (MonoAotCompile *acfg, int offset, int *tramp_size) x86_breakpoint (code); emit_bytes (acfg, buf, code - buf); - + *tramp_size = code - buf; g_free (buf); @@ -2903,7 +2903,7 @@ arch_emit_gsharedvt_arg_trampoline (MonoAotCompile *acfg, int offset, int *tramp #else g_assert_not_reached (); #endif -} +} static void arch_emit_ftnptr_arg_trampoline (MonoAotCompile *acfg, int offset, int *tramp_size) @@ -2987,7 +2987,7 @@ arch_emit_unbox_arbitrary_trampoline (MonoAotCompile *acfg, int offset, int *tra /* END OF ARCH SPECIFIC CODE */ static guint32 -mono_get_field_token (MonoClassField *field) +mono_get_field_token (MonoClassField *field) { MonoClass *klass = field->parent; int i; @@ -3010,7 +3010,7 @@ encode_value (gint32 value, guint8 *buf, guint8 **endbuf) //printf ("ENCODE: %d 0x%x.\n", value, value); - /* + /* * Same encoding as the one used in the metadata, extended to handle values * greater than 0x1fffffff. */ @@ -3056,14 +3056,14 @@ make_room_in_stream (MonoDynamicStream *stream, int size) { if (size <= stream->alloc_size) return; - + while (stream->alloc_size <= size) { if (stream->alloc_size < 4096) stream->alloc_size = 4096; else stream->alloc_size *= 2; } - + stream->data = (char *)g_realloc (stream->data, stream->alloc_size); } @@ -3071,7 +3071,7 @@ static guint32 add_stream_data (MonoDynamicStream *stream, const char *data, guint32 len) { guint32 idx; - + make_room_in_stream (stream, stream->index + len); memcpy (stream->data + stream->index, data, len); idx = stream->index; @@ -3449,7 +3449,7 @@ encode_klass_ref (MonoAotCompile *acfg, MonoClass *klass, guint8 *buf, guint8 ** { gboolean shared = FALSE; - /* + /* * The encoding of generic instances is large so emit them only once. */ if (mono_class_is_ginst (klass)) { @@ -3709,7 +3709,7 @@ encode_method_ref (MonoAotCompile *acfg, MonoMethod *method, guint8 *buf, guint8 * types of method encodings. */ - /* Mark methods which can't use aot trampolines because they need the further + /* Mark methods which can't use aot trampolines because they need the further * processing in mono_magic_trampoline () which requires a MonoMethod*. */ if ((method->is_generic && (method->flags & METHOD_ATTRIBUTE_VIRTUAL)) || @@ -3855,7 +3855,7 @@ encode_method_ref (MonoAotCompile *acfg, MonoMethod *method, guint8 *buf, guint8 g_assert_not_reached (); } } else if (mono_method_signature_internal (method)->is_inflated) { - /* + /* * This is a generic method, find the original token which referenced it and * encode that. * Obtain the token from information recorded by the JIT. @@ -3884,8 +3884,8 @@ encode_method_ref (MonoAotCompile *acfg, MonoMethod *method, guint8 *buf, guint8 declaring = ((MonoMethodInflated*)method)->declaring; /* - * This might be a non-generic method of a generic instance, which - * doesn't have a token since the reference is generated by the JIT + * This might be a non-generic method of a generic instance, which + * doesn't have a token since the reference is generated by the JIT * like Nullable:Box/Unbox, or by generic sharing. */ encode_value ((MONO_AOT_METHODREF_GINST << 24), p, &p); @@ -4043,7 +4043,7 @@ static char* get_plt_symbol (MonoAotCompile *acfg, int plt_offset, MonoJumpInfo *patch_info) { #ifdef TARGET_MACH - /* + /* * The Apple linker reorganizes object files, so it doesn't like branches to local * labels, since those have no relocations. */ @@ -4073,7 +4073,7 @@ get_plt_entry (MonoAotCompile *acfg, MonoJumpInfo *patch_info) res = (MonoPltEntry *)g_hash_table_lookup (acfg->patch_to_plt_entry [patch_info->type], patch_info); if (!acfg->llvm && patch_info->type == MONO_PATCH_INFO_METHOD && (patch_info->data.method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)) { - /* + /* * Allocate a separate PLT slot for each such patch, since some plt * entries will refer to the method itself, and some will refer to the * wrapper. @@ -4217,7 +4217,7 @@ static guint32 get_method_index (MonoAotCompile *acfg, MonoMethod *method) { int index = GPOINTER_TO_UINT (g_hash_table_lookup (acfg->method_indexes, method)); - + g_assert (index); return index - 1; @@ -4623,7 +4623,7 @@ add_wrappers (MonoAotCompile *acfg) MonoMethodSignature *sig, *csig; guint32 token; - /* + /* * FIXME: Instead of AOTing all the wrappers, it might be better to redesign them * so there is only one wrapper of a given type, or inlining their contents into their * callers. @@ -4813,7 +4813,7 @@ add_wrappers (MonoAotCompile *acfg) } } - /* + /* * remoting-invoke-with-check wrappers are very frequent, so avoid emitting them, * we use the original method instead at runtime. * Since full-aot doesn't support remoting, this is not a problem. @@ -4824,7 +4824,7 @@ add_wrappers (MonoAotCompile *acfg) for (i = 0; i < rows; ++i) { ERROR_DECL (error); MonoMethodSignature *sig; - + token = MONO_TOKEN_METHOD_DEF | (i + 1); method = mono_get_method_checked (acfg->image, token, NULL, NULL, error); g_assert (is_ok (error)); /* FIXME don't swallow the error */ @@ -4844,7 +4844,7 @@ add_wrappers (MonoAotCompile *acfg) for (i = 0; i < rows; ++i) { ERROR_DECL (error); MonoClass *klass; - + token = MONO_TOKEN_TYPE_DEF | (i + 1); klass = mono_class_get_checked (acfg->image, token, error); @@ -4963,7 +4963,7 @@ add_wrappers (MonoAotCompile *acfg) for (i = 0; i < rows; ++i) { ERROR_DECL (error); MonoClass *klass; - + token = MONO_TOKEN_TYPE_SPEC | (i + 1); klass = mono_class_get_checked (acfg->image, token, error); @@ -5049,7 +5049,7 @@ add_wrappers (MonoAotCompile *acfg) } } } - + /* native-to-managed wrappers */ rows = table_info_get_rows (&acfg->image->tables [MONO_TABLE_METHOD]); for (i = 0; i < rows; ++i) { @@ -5062,7 +5062,7 @@ add_wrappers (MonoAotCompile *acfg) method = mono_get_method_checked (acfg->image, token, NULL, NULL, error); report_loader_error (acfg, error, TRUE, "Failed to load method token 0x%x due to %s\n", i, mono_error_get_message (error)); - /* + /* * Only generate native-to-managed wrappers for methods which have an * attribute named MonoPInvokeCallbackAttribute. We search for the attribute by * name to avoid defining a new assembly to contain it. @@ -5100,11 +5100,11 @@ add_wrappers (MonoAotCompile *acfg) g_assert (sig->param_count == 1); g_assert (sig->params [0]->type == MONO_TYPE_CLASS && !strcmp (m_class_get_name (mono_class_from_mono_type_internal (sig->params [0])), "Type")); - /* + /* * Decode the cattr manually since we can't create objects * during aot compilation. */ - + /* Skip prolog */ p += 2; @@ -5221,7 +5221,7 @@ MONO_RESTORE_WARNING for (i = 0; i < rows; ++i) { ERROR_DECL (error); MonoClass *klass; - + token = MONO_TOKEN_TYPE_DEF | (i + 1); klass = mono_class_get_checked (acfg->image, token, error); @@ -5495,7 +5495,7 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth, const char *klass_name = m_class_get_name (klass); const char *klass_name_space = m_class_get_name_space (klass); const gboolean in_corlib = m_class_get_image (klass) == mono_defaults.corlib; - /* + /* * For ICollection, add instances of the helper methods * in Array, since a T[] could be cast to ICollection. */ @@ -5759,7 +5759,7 @@ add_generic_instances (MonoAotCompile *acfg) else type_argv [i] = inst->type_argv [i]; } - + shared_context.class_inst = mono_metadata_get_generic_inst (inst->type_argc, type_argv); g_free (type_argv); } @@ -5787,7 +5787,7 @@ add_generic_instances (MonoAotCompile *acfg) g_assert (is_ok (error)); /* FIXME don't swallow the error */ } - /* + /* * If the method is fully sharable, it was already added in place of its * generic definition. */ @@ -5896,7 +5896,7 @@ add_generic_instances (MonoAotCompile *acfg) if (klass) add_instances_of (acfg, klass, insts, ninsts, TRUE); - /* + /* * Add a managed-to-native wrapper of Array.GetGenericValue_icall, which is * used for all instances of GetGenericValue_icall by the AOT runtime. */ @@ -6077,7 +6077,7 @@ method_is_externally_callable (MonoAotCompile *acfg, MonoMethod *method) /* * is_direct_callable: * - * Return whenever the method identified by JI is directly callable without + * Return whenever the method identified by JI is directly callable without * going through the PLT. */ static gboolean @@ -6168,7 +6168,7 @@ get_pinvoke_import (MonoAotCompile *acfg, MonoMethod *method) import = g_strdup_printf ("%s", mono_metadata_string_heap (image, im_cols [MONO_IMPLMAP_NAME])); g_hash_table_insert (acfg->method_to_pinvoke_import, method, import); - + return import; } #else @@ -6383,7 +6383,7 @@ emit_and_reloc_code (MonoAotCompile *acfg, MonoMethod *method, guint8 *code, gui break; case MONO_PATCH_INFO_GOT_OFFSET: { int code_size; - + arch_emit_got_offset (acfg, code + i, &code_size); i += code_size - INST_LEN; skip = TRUE; @@ -6498,7 +6498,7 @@ emit_and_reloc_code (MonoAotCompile *acfg, MonoMethod *method, guint8 *code, gui /* This patch has a PLT entry, so we must emit a call to the PLT entry */ direct_call = TRUE; direct_call_target = plt_entry->symbol; - + /* Nullify the patch */ patch_info->type = MONO_PATCH_INFO_NONE; plt_entry->jit_used = TRUE; @@ -6683,14 +6683,14 @@ emit_method_code (MonoAotCompile *acfg, MonoCompile *cfg) /* Make the labels local */ emit_section_change (acfg, ".text", 0); emit_alignment_code (acfg, func_alignment); - + if (acfg->global_symbols && acfg->need_no_dead_strip) fprintf (acfg->fp, " .no_dead_strip %s\n", cfg->asm_symbol); - + emit_label (acfg, cfg->asm_symbol); if (acfg->aot_opts.write_symbols && !acfg->global_symbols && !acfg->llvm) { - /* + /* * Write a C style symbol for every method, this has two uses: * - it works on platforms where the dwarf debugging info is not * yet supported. @@ -6880,7 +6880,7 @@ encode_patch (MonoAotCompile *acfg, MonoJumpInfo *patch_info, guint8 *buf, guint MonoJumpInfoRgctxEntry *entry = patch_info->data.rgctx_entry; guint32 offset; - /* + /* * entry->d.klass/method has a lenghtly encoding and multiple rgctx_fetch entries * reference the same klass/method, so encode it only once. * For patches which refer to got entries, this sharing is done by get_got_offset, but @@ -7006,7 +7006,7 @@ emit_method_info (MonoAotCompile *acfg, MonoCompile *cfg) n_patches = 0; for (pindex = 0; pindex < patches->len; ++pindex) { patch_info = (MonoJumpInfo *)g_ptr_array_index (patches, pindex); - + if ((patch_info->type == MONO_PATCH_INFO_GOT_OFFSET) || (patch_info->type == MONO_PATCH_INFO_NONE)) { patch_info->type = MONO_PATCH_INFO_NONE; @@ -7114,7 +7114,7 @@ get_unwind_info_offset (MonoAotCompile *acfg, guint8 *encoded, guint32 encoded_l guint8 buf [16]; guint8 *p; - /* + /* * It would be easier to use assembler symbols, but the caller needs an * offset now. */ @@ -7344,7 +7344,7 @@ emit_exception_debug_info (MonoAotCompile *acfg, MonoCompile *cfg, gboolean stor } } - /* + /* * Need to encode jinfo->method too, since it is not equal to 'method' * when using generic sharing. */ @@ -7422,7 +7422,7 @@ emit_klass_info (MonoAotCompile *acfg, guint32 token) return res; } - + buf_size = 10240 + (m_class_get_vtable_size (klass) * 16); p = buf = (guint8 *)g_malloc (buf_size); @@ -7435,7 +7435,7 @@ emit_klass_info (MonoAotCompile *acfg, guint32 token) mono_class_setup_vtable (klass); - /* + /* * Emit all the information which is required for creating vtables so * the runtime does not need to create the MonoMethod structures which * take up a lot of space. @@ -7467,7 +7467,7 @@ emit_klass_info (MonoAotCompile *acfg, guint32 token) encode_method_ref (acfg, mono_class_get_cctor (klass), p, &p); if (m_class_has_finalize (klass)) encode_method_ref (acfg, mono_class_get_finalizer (klass), p, &p); - + encode_value (m_class_get_instance_size (klass), p, &p); encode_value (mono_class_data_size (klass), p, &p); encode_value (m_class_get_packing_size (klass), p, &p); @@ -7522,7 +7522,7 @@ get_plt_entry_debug_sym (MonoAotCompile *acfg, MonoJumpInfo *ji, GHashTable *cac case MONO_PATCH_INFO_ICALL_ADDR: case MONO_PATCH_INFO_ICALL_ADDR_CALL: { char *s = get_debug_sym (ji->data.method, "", cache); - + debug_sym = g_strdup_printf ("%s_icall_native_%s", prefix, s); g_free (s); break; @@ -7569,7 +7569,7 @@ emit_plt (MonoAotCompile *acfg) MonoPltEntry *plt_entry = NULL; if (i == 0) - /* + /* * The first plt entry is unused. */ continue; @@ -7617,7 +7617,7 @@ emit_plt (MonoAotCompile *acfg) /* Make sure the ARM symbols don't alias the thumb ones */ emit_zero_bytes (acfg, 16); - /* + /* * Emit a separate set of PLT entries using thumb2 which is called by LLVM generated * code. */ @@ -7712,7 +7712,7 @@ emit_trampoline_full (MonoAotCompile *acfg, MonoTrampInfo *info, gboolean emit_t sprintf (symbol, "%snamed_%s", acfg->temp_prefix, name); emit_label (acfg, symbol); - /* + /* * The code should access everything through the GOT, so we pass * TRUE here. */ @@ -7805,7 +7805,7 @@ emit_trampolines (MonoAotCompile *acfg) return; if (acfg->aot_opts.llvm_only) return; - + g_assert (acfg->image->assembly); /* Currently, we emit most trampolines into the mscorlib AOT image. */ @@ -7939,21 +7939,21 @@ emit_trampolines (MonoAotCompile *acfg) * - specific trampolines * - static rgctx invoke trampolines * - imt trampolines - * These trampolines have the same code, they are parameterized by GOT - * slots. + * These trampolines have the same code, they are parameterized by GOT + * slots. * They are defined in this file, in the arch_... routines instead of * in tramp-.c, since it is easier to do it this way. */ /* - * When running in aot-only mode, we can't create specific trampolines at - * runtime, so we create a few, and save them in the AOT file. - * Normal trampolines embed their argument as a literal inside the + * When running in aot-only mode, we can't create specific trampolines at + * runtime, so we create a few, and save them in the AOT file. + * Normal trampolines embed their argument as a literal inside the * trampoline code, we can't do that here, so instead we embed an offset * which needs to be added to the trampoline address to get the address of * the GOT slot which contains the argument value. * The generated trampolines jump to the generic trampolines using another - * GOT slot, which will be setup by the AOT loader to point to the + * GOT slot, which will be setup by the AOT loader to point to the * generic trampoline code of the given type. */ @@ -8009,7 +8009,7 @@ emit_trampolines (MonoAotCompile *acfg) tramp_got_offset += 2; break; case MONO_AOT_TRAMP_STATIC_RGCTX: - arch_emit_static_rgctx_trampoline (acfg, tramp_got_offset, &tramp_size); + arch_emit_static_rgctx_trampoline (acfg, tramp_got_offset, &tramp_size); tramp_got_offset += 2; break; case MONO_AOT_TRAMP_IMT: @@ -8017,7 +8017,7 @@ emit_trampolines (MonoAotCompile *acfg) tramp_got_offset += 1; break; case MONO_AOT_TRAMP_GSHAREDVT_ARG: - arch_emit_gsharedvt_arg_trampoline (acfg, tramp_got_offset, &tramp_size); + arch_emit_gsharedvt_arg_trampoline (acfg, tramp_got_offset, &tramp_size); tramp_got_offset += 2; break; case MONO_AOT_TRAMP_FTNPTR_ARG: @@ -8206,7 +8206,7 @@ mono_aot_split_options (const char *aot_options) // If we find a quote, then if we're in the default case then // it means we've found the start of a string, if not then it // means we've found the end of the string and should switch - // back to the default case. + // back to the default case. switch (state) { case MONO_AOT_OPTION_STATE_DEFAULT: state = MONO_AOT_OPTION_STATE_STRING; @@ -8221,8 +8221,8 @@ mono_aot_split_options (const char *aot_options) break; case '\\': // If we've found an escaping operator, then this means we - // should not process the next character if inside a string. - if (state == MONO_AOT_OPTION_STATE_STRING) + // should not process the next character if inside a string. + if (state == MONO_AOT_OPTION_STATE_STRING) state = MONO_AOT_OPTION_STATE_ESCAPE; break; case ',': @@ -8334,7 +8334,7 @@ parse_cpu_features (const gchar *attr) if (enabled) mono_cpu_features_enabled = (MonoCPUFeatures) (mono_cpu_features_enabled | feature); - else + else mono_cpu_features_disabled = (MonoCPUFeatures) (mono_cpu_features_disabled | feature); return TRUE; @@ -8371,7 +8371,7 @@ mono_aot_parse_options (const char *aot_options, MonoAotOptions *opts) } else if (str_begins_with (arg, "full")) { opts->mode = MONO_AOT_MODE_FULL; } else if (str_begins_with (arg, "hybrid")) { - opts->mode = MONO_AOT_MODE_HYBRID; + opts->mode = MONO_AOT_MODE_HYBRID; } else if (str_begins_with (arg, "interp")) { opts->interp = TRUE; } else if (str_begins_with (arg, "threads=")) { @@ -8997,7 +8997,7 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method) switch (patch_info->type) { case MONO_PATCH_INFO_ABS: /* unable to handle this */ - skip = TRUE; + skip = TRUE; break; default: break; @@ -9051,8 +9051,8 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method) } /* Adds generic instances referenced by this method */ - /* - * The depth is used to avoid infinite loops when generic virtual recursion is + /* + * The depth is used to avoid infinite loops when generic virtual recursion is * encountered. */ depth = GPOINTER_TO_UINT (g_hash_table_lookup (acfg->method_depth, method)); @@ -9195,7 +9195,7 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method) g_hash_table_insert (acfg->export_names, cfg->method, export_name); } - /* + /* * FIXME: Instead of this mess, allocate the patches from the aot mempool. */ /* Make a copy of the patch info which is in the mempool */ @@ -9233,7 +9233,7 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method) MonoMethodSignature *sig; MonoMethodHeader *header; int i; - + sig = mono_method_signature_internal (method); args = (MonoInst **)mono_mempool_alloc (acfg->mempool, sizeof (MonoInst*) * (sig->param_count + sig->hasthis)); for (i = 0; i < sig->param_count + sig->hasthis; ++i) { @@ -9274,7 +9274,7 @@ compile_method (MonoAotCompile *acfg, MonoMethod *method) mono_atomic_inc_i32 (&acfg->stats.ccount); } - + static mono_thread_start_return_t WINAPI compile_thread_main (gpointer user_data) { @@ -9289,7 +9289,7 @@ compile_thread_main (gpointer user_data) return 0; } - + /* Used by the LLVM backend */ guint32 mono_aot_get_got_offset (MonoJumpInfo *ji) @@ -9521,11 +9521,11 @@ append_mangled_wrapper_type (GString *s, guint32 wrapper_type) } static void -append_mangled_wrapper_subtype (GString *s, WrapperSubtype subtype) +append_mangled_wrapper_subtype (GString *s, WrapperSubtype subtype) { const char *label; - switch (subtype) + switch (subtype) { case WRAPPER_SUBTYPE_NONE: return; @@ -9710,7 +9710,7 @@ static gboolean append_mangled_method (GString *s, MonoMethod *method); static gboolean -append_mangled_wrapper (GString *s, MonoMethod *method) +append_mangled_wrapper (GString *s, MonoMethod *method) { gboolean success = TRUE; gboolean append_sig = TRUE; @@ -10073,7 +10073,7 @@ execute_system (const char * command) int status = 0; #if defined (HOST_WIN32) - // We need an extra set of quotes around the whole command to properly handle commands + // We need an extra set of quotes around the whole command to properly handle commands // with spaces since internally the command is called through "cmd /c. char * quoted_command = g_strdup_printf ("\"%s\"", command); @@ -10293,7 +10293,7 @@ dedup_skip_methods (MonoAotCompile *acfg) // // In second phase, we emit methods that // are dedupable. We also emit later methods - // which are referenced by them and added later. + // which are referenced by them and added later. // For this reason, when in the dedup_include mode, // we never set skip. if (acfg->aot_opts.dedup) @@ -10339,7 +10339,7 @@ emit_code (MonoAotCompile *acfg) emit_pointer (acfg, acfg->got_symbol); #endif - /* + /* * This global symbol is used to compute the address of each method using the * code_offsets array. It is also used to compute the memory ranges occupied by * AOT code, so it must be equal to the address of the first emitted method. @@ -10348,7 +10348,7 @@ emit_code (MonoAotCompile *acfg) emit_alignment_code (acfg, 8); emit_info_symbol (acfg, "jit_code_start", TRUE); - /* + /* * Emit some padding so the local symbol for the first method doesn't have the * same address as 'methods'. */ @@ -10427,7 +10427,7 @@ emit_code (MonoAotCompile *acfg) /* To distinguish it from the next symbol */ emit_padding (acfg, 4); - /* + /* * Add .no_dead_strip directives for all LLVM methods to prevent the OSX linker * from optimizing them away, since it doesn't see that code_offsets references them. * JITted methods don't need this since they are referenced using assembler local @@ -10704,7 +10704,7 @@ mono_aot_method_hash (MonoMethod *method) if (ginst) { for (i = 0; i < ginst->type_argc; ++i) hashes [hindex ++] = mono_aot_type_hash (ginst->type_argv [i]); - } + } g_assert (hindex == hashes_count); /* Setup internal state */ @@ -10721,7 +10721,7 @@ mono_aot_method_hash (MonoMethod *method) } /* Handle the last 3 hashes (all the case statements fall through) */ - switch (hashes_count) { + switch (hashes_count) { case 3 : c += hashes [2]; case 2 : b += hashes [1]; case 1 : a += hashes [0]; @@ -10729,9 +10729,9 @@ mono_aot_method_hash (MonoMethod *method) case 0: /* nothing left to add */ break; } - + g_free (hashes_start); - + return c; } #undef rot @@ -10870,7 +10870,7 @@ emit_extra_methods (MonoAotCompile *acfg) } else { while (entry->next) entry = entry->next; - + entry->next = new_entry; new_entry->index = table->len; g_ptr_array_add (table, new_entry); @@ -10908,7 +10908,7 @@ emit_extra_methods (MonoAotCompile *acfg) g_free (buf); - /* + /* * Emit a table reverse mapping method indexes to their index in extra_method_info. * This is used by mono_aot_find_jit_info (). */ @@ -10926,7 +10926,7 @@ emit_extra_methods (MonoAotCompile *acfg) g_free (buf); g_free (info_offsets); g_ptr_array_free (table, TRUE); -} +} static void generate_aotid (guint8* aotid) @@ -10961,7 +10961,7 @@ emit_exception_info (MonoAotCompile *acfg) gboolean method_seq_points_to_file = acfg->aot_opts.gen_msym_dir && cfg->gen_seq_points && !cfg->gen_sdb_seq_points; gboolean method_seq_points_to_binary = cfg->gen_seq_points && !method_seq_points_to_file; - + emit_exception_debug_info (acfg, cfg, method_seq_points_to_binary); offsets [i] = cfg->ex_info_offset; @@ -11014,7 +11014,7 @@ emit_unwind_info (MonoAotCompile *acfg) return; } - /* + /* * The unwind info contains a lot of duplicates so we emit each unique * entry once, and only store the offset from the start of the table in the * exception info. @@ -11105,7 +11105,7 @@ emit_class_name_table (MonoAotCompile *acfg) } else { while (entry->next) entry = entry->next; - + entry->next = new_entry; new_entry->index = table->len; g_ptr_array_add (table, new_entry); @@ -11246,11 +11246,11 @@ emit_got_info (MonoAotCompile *acfg, gboolean llvm) } /** - * FIXME: + * FIXME: * - optimize offsets table. * - reduce number of exported symbols. * - emit info for a klass only once. - * - determine when a method uses a GOT slot which is guaranteed to be already + * - determine when a method uses a GOT slot which is guaranteed to be already * initialized. * - clean up and document the code. * - use String.Empty in class libs. @@ -11397,7 +11397,7 @@ emit_globals (MonoAotCompile *acfg) return; } - /* + /* * When static linking, we emit a table containing our globals. */ @@ -11425,7 +11425,7 @@ emit_globals (MonoAotCompile *acfg) } else { while (entry->next) entry = entry->next; - + entry->next = new_entry; new_entry->index = table->len; g_ptr_array_add (table, new_entry); @@ -11665,7 +11665,7 @@ emit_aot_file_info (MonoAotCompile *acfg, MonoAotFileInfo *info) emit_int32 (acfg, info->version); emit_int32 (acfg, info->dummy); - /* + /* * We emit pointers to our data structures instead of emitting global symbols which * point to them, to reduce the number of globals, and because using globals leads to * various problems (i.e. arm/thumb). @@ -12284,7 +12284,7 @@ collect_methods (MonoAotCompile *acfg) mono_error_cleanup (error); return FALSE; } - + /* Load all methods eagerly to skip the slower lazy loading code */ mono_class_setup_methods (method->klass); @@ -12374,7 +12374,7 @@ compile_methods (MonoAotCompile *acfg) len = acfg->methods->len / acfg->aot_opts.nthreads; g_assert (len > 0); - /* + /* * Partition the list of methods into fragments, and hand it to threads to * process. */ @@ -12400,7 +12400,7 @@ compile_methods (MonoAotCompile *acfg) user_data = g_new0 (gpointer, 3); user_data [0] = acfg; user_data [1] = frag; - + thread = mono_thread_create_internal ((MonoThreadStart)compile_thread_main, user_data, MONO_THREAD_CREATE_FLAGS_NONE, error); mono_error_assert_ok (error); @@ -12531,7 +12531,7 @@ compile_asm (MonoAotCompile *acfg) #endif command = g_strdup_printf ("\"%s%s\" %s %s -o %s %s", tool_prefix, AS_NAME, AS_OPTIONS, - acfg->as_args ? acfg->as_args->str : "", + acfg->as_args ? acfg->as_args->str : "", wrap_path (objfile), wrap_path (acfg->tmpfname)); aot_printf (acfg, "Executing the native assembler: %s\n", command); if (execute_system (command) != 0) { @@ -12638,8 +12638,8 @@ compile_asm (MonoAotCompile *acfg) g_free (com);*/ #if defined(TARGET_ARM) && !defined(TARGET_MACH) - /* - * gas generates 'mapping symbols' each time code and data is mixed, which + /* + * gas generates 'mapping symbols' each time code and data is mixed, which * happens a lot in emit_and_reloc_code (), so we need to get rid of them. */ command = g_strdup_printf ("\"%sstrip\" --strip-symbol=\\$a --strip-symbol=\\$d %s", tool_prefix, wrap_path(tmp_outfile_name)); @@ -12909,8 +12909,15 @@ resolve_class (ClassProfileData *cdata) } if (cdata->inst) { resolve_ginst (cdata->inst); - if (!cdata->inst->inst) + if (!cdata->inst->inst) { + /* + * The instance might not be found if its arguments are in another assembly, + * use the definition instead. + */ + cdata->klass = klass; + //printf ("[%s] %s.%s\n", cdata->image->name, cdata->ns, cdata->name); return; + } MonoGenericContext ctx; memset (&ctx, 0, sizeof (ctx)); @@ -12989,12 +12996,14 @@ resolve_profile_data (MonoAotCompile *acfg, ProfileData *data, MonoAssembly* cur printf ("Unable to load method '%s' because its class '%s.%s' is not loaded.\n", mdata->name, mdata->klass->ns, mdata->klass->name); continue; } + miter = NULL; while ((m = mono_class_get_methods (klass, &miter))) { ERROR_DECL (error); if (strcmp (m->name, mdata->name)) continue; + MonoMethodSignature *sig = mono_method_signature_internal (m); if (!sig) continue; @@ -13021,9 +13030,11 @@ resolve_profile_data (MonoAotCompile *acfg, ProfileData *data, MonoAssembly* cur char *sig_str = mono_signature_full_name (sig); gboolean match = !strcmp (sig_str, mdata->signature); g_free (sig_str); - if (!match) - - continue; + if (!match) { + // The signature might not match for methods on gtds + if (!mono_class_is_gtd (klass)) + continue; + } //printf ("%s\n", mono_method_full_name (m, 1)); mdata->method = m; break; @@ -13114,8 +13125,14 @@ add_profile_instances (MonoAotCompile *acfg, ProfileData *data) continue; if (!m->is_inflated) continue; - if (mono_method_is_generic_sharable_full (m, FALSE, FALSE, FALSE)) + if (mono_method_is_generic_sharable_full (m, FALSE, FALSE, FALSE)) { + if (acfg->aot_opts.profile_only && m_class_get_image (m->klass) == acfg->image) { + // Add the fully shared version to its home image + add_profile_method (acfg, m); + count ++; + } continue; + } if (acfg->aot_opts.dedup_include) { /* Add all instances from the profile */ @@ -13361,7 +13378,7 @@ static void aot_dump (MonoAotCompile *acfg) MonoJumpInfo *ji; if (i == 0) - /* + /* * The first plt entry is unused. */ continue; @@ -13589,7 +13606,7 @@ mono_flush_method_cache (MonoAotCompile *acfg) if (!cache) g_error ("Could not create cache at %s because of error: %s\n", filename, strerror (errno)); - + GHashTableIter iter; gchar *name = NULL; g_hash_table_iter_init (&iter, method_cache); @@ -13621,7 +13638,7 @@ mono_read_method_cache (MonoAotCompile *acfg) if (acfg->aot_opts.dedup_include || acfg->aot_opts.dedup) g_assert (acfg->dedup_stats); - + // only in skip mode if (!acfg->aot_opts.dedup) goto early_exit; @@ -13687,7 +13704,7 @@ typedef struct { } MonoAotState; static MonoAotState * -alloc_aot_state (void) +alloc_aot_state (void) { MonoAotState *state = g_malloc (sizeof (MonoAotState)); // FIXME: Should this own the memory? @@ -13700,7 +13717,7 @@ alloc_aot_state (void) } static void -free_aot_state (MonoAotState *astate) +free_aot_state (MonoAotState *astate) { g_hash_table_destroy (astate->cache); g_free (astate); @@ -13723,7 +13740,7 @@ mono_add_deferred_extra_methods (MonoAotCompile *acfg, MonoAotState *astate) } static void -mono_setup_dedup_state (MonoAotCompile *acfg, MonoAotState **global_aot_state, MonoAssembly *ass, MonoAotState **astate, gboolean *is_dedup_dummy) +mono_setup_dedup_state (MonoAotCompile *acfg, MonoAotState **global_aot_state, MonoAssembly *ass, MonoAotState **astate, gboolean *is_dedup_dummy) { if (!acfg->aot_opts.dedup_include && !acfg->aot_opts.dedup) return; @@ -13764,7 +13781,7 @@ mono_setup_dedup_state (MonoAotCompile *acfg, MonoAotState **global_aot_state, M } } -int +int mono_compile_deferred_assemblies (guint32 opts, const char *aot_options, gpointer **aot_state) { // create assembly, loop and add extra_methods @@ -13779,7 +13796,7 @@ mono_compile_deferred_assemblies (guint32 opts, const char *aot_options, gpointe const char* inflate = strstr (aot_options, "dedup-inflate"); if (!inflate) return 0; - else + else g_error ("Error: mono was not given an assembly with the provided inflate name\n"); } @@ -13903,7 +13920,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options, // Process later if (is_dedup_dummy && astate && !astate->emit_inflated_methods) - return 0; + return 0; if (acfg->aot_opts.dedup_include && !is_dedup_dummy) acfg->dedup_collect_only = TRUE; @@ -14333,7 +14350,7 @@ emit_aot_image (MonoAotCompile *acfg) g_assertf (temp_path, "mkdtemp failed, error = (%d) %s", errno, g_strerror (errno)); acfg->temp_dir_to_delete = g_strdup (temp_path); } - + acfg->tmpbasename = g_build_filename (temp_path, "temp", (const char*)NULL); acfg->tmpfname = g_strdup_printf ("%s.s", acfg->tmpbasename); acfg->llvm_sfile = g_strdup_printf ("%s-llvm.s", acfg->tmpbasename); @@ -14534,7 +14551,7 @@ emit_aot_image (MonoAotCompile *acfg) } acfg_free (acfg); - + return 0; } diff --git a/src/mono/mono/mini/driver.c b/src/mono/mono/mini/driver.c index 9ad3f21a12d87d..a249b3d6d3678c 100644 --- a/src/mono/mono/mini/driver.c +++ b/src/mono/mono/mini/driver.c @@ -240,7 +240,7 @@ typedef struct { MonoGraphOptions value; } GraphName; -static const GraphName +static const GraphName graph_names [] = { {"cfg", "Control Flow", MONO_GRAPH_CFG}, {"dtree", "Dominator Tree", MONO_GRAPH_DTREE}, @@ -324,7 +324,7 @@ opt_sets [] = { MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP | MONO_OPT_DEADCE | MONO_OPT_LOOP | MONO_OPT_INLINE | MONO_OPT_INTRINS | MONO_OPT_EXCEPTION | MONO_OPT_ABCREM, MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP | MONO_OPT_DEADCE | MONO_OPT_LOOP | MONO_OPT_INLINE | MONO_OPT_INTRINS | MONO_OPT_ABCREM, MONO_OPT_BRANCH | MONO_OPT_PEEPHOLE | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP | MONO_OPT_DEADCE | MONO_OPT_LOOP | MONO_OPT_INLINE | MONO_OPT_INTRINS | MONO_OPT_EXCEPTION | MONO_OPT_CMOV, - DEFAULT_OPTIMIZATIONS, + DEFAULT_OPTIMIZATIONS, }; static const guint32 @@ -621,7 +621,7 @@ mini_regression (MonoImage *image, int verbose, int *total_run) if (opt) fprintf (mini_stats_fd, " "); fprintf (mini_stats_fd, "%s", n); - + } fprintf (mini_stats_fd, "));\n"); @@ -704,7 +704,7 @@ mini_regression_list (int verbose, int count, char *images []) { int i, total, total_run, run; MonoAssembly *ass; - + total_run = total = 0; for (i = 0; i < count; ++i) { MonoAssemblyOpenRequest req; @@ -718,13 +718,13 @@ mini_regression_list (int verbose, int count, char *images []) total_run += run; } if (total > 0){ - g_print ("Overall results: tests: %d, failed: %d, opt combinations: %d (pass: %.2f%%)\n", + g_print ("Overall results: tests: %d, failed: %d, opt combinations: %d (pass: %.2f%%)\n", total_run, total, (int)G_N_ELEMENTS (opt_sets), 100.0*(total_run-total)/total_run); } else { - g_print ("Overall results: tests: %d, 100%% pass, opt combinations: %d\n", + g_print ("Overall results: tests: %d, 100%% pass, opt combinations: %d\n", total_run, (int)G_N_ELEMENTS (opt_sets)); } - + return total; } @@ -1299,7 +1299,7 @@ compile_all_methods (MonoAssembly *ass, int verbose, guint32 opts, guint32 recom args.opts = opts; args.recompilation_times = recompilation_times; - /* + /* * Need to create a mono thread since compilation might trigger * running of managed code. */ @@ -1316,7 +1316,7 @@ compile_all_methods (MonoAssembly *ass, int verbose, guint32 opts, guint32 recom * \param argv argument vector * Start execution of a program. */ -int +int mono_jit_exec (MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[]) { int rv; @@ -1363,7 +1363,7 @@ mono_jit_exec_internal (MonoDomain *domain, MonoAssembly *assembly, int argc, ch mono_environment_exitcode_set (1); return 1; } - + if (mono_llvm_only) { MonoObject *exc = NULL; int res; @@ -1389,7 +1389,7 @@ mono_jit_exec_internal (MonoDomain *domain, MonoAssembly *assembly, int argc, ch } } -typedef struct +typedef struct { MonoDomain *domain; const char *file; @@ -1446,7 +1446,7 @@ static void main_thread_handler (gpointer user_data) exit (1); } - /* + /* * This must be done in a thread managed by mono since it can invoke * managed code. */ @@ -1461,7 +1461,7 @@ static int load_agent (MonoDomain *domain, char *desc) { ERROR_DECL (error); - char* col = strchr (desc, ':'); + char* col = strchr (desc, ':'); char *agent, *args; MonoAssembly *agent_assembly; MonoImage *image; @@ -1489,7 +1489,7 @@ load_agent (MonoDomain *domain, char *desc) return 2; } - /* + /* * Can't use mono_jit_exec (), as it sets things which might confuse the * real Main method. */ @@ -1508,7 +1508,7 @@ load_agent (MonoDomain *domain, char *desc) g_free (agent); return 1; } - + mono_thread_set_main (mono_thread_current ()); if (args) { @@ -1527,7 +1527,7 @@ load_agent (MonoDomain *domain, char *desc) g_free (agent); return 1; } - + pa [0] = main_args; /* Pass NULL as 'exc' so unhandled exceptions abort the runtime */ @@ -1547,7 +1547,7 @@ static void mini_usage_jitdeveloper (void) { int i; - + fprintf (stdout, "Runtime and JIT debugging options:\n" " --apply-bindings=FILE Apply assembly bindings from FILE (only for AOT)\n" @@ -1571,9 +1571,9 @@ mini_usage_jitdeveloper (void) "\n" "The options supported by MONO_DEBUG can also be passed on the command line.\n" "\n" - "Other options:\n" + "Other options:\n" " --graph[=TYPE] METHOD Draws a graph of the specified method:\n"); - + for (i = 0; i < G_N_ELEMENTS (graph_names); ++i) { fprintf (stdout, " %-10s %s\n", graph_names [i].name, graph_names [i].desc); } @@ -1583,7 +1583,7 @@ static void mini_usage_list_opt (void) { int i; - + for (i = 0; i < G_N_ELEMENTS (opt_names); ++i) fprintf (stdout, " %-10s %s\n", optflag_get_name (i), optflag_get_desc (i)); } @@ -1601,7 +1601,7 @@ mini_usage (void) " --debugger-agent=options Enable the debugger agent\n" " --profile[=profiler] Runs in profiling mode with the specified profiler module\n" " --trace[=EXPR] Enable tracing, use --help-trace for details\n" -#ifdef __linux__ +#ifdef __linux__ " --jitmap Output a jit method map to /tmp/perf-PID.map\n" #endif #ifdef ENABLE_JIT_DUMP @@ -1683,7 +1683,7 @@ mini_debug_usage (void) #endif static char * -mono_get_version_info (void) +mono_get_version_info (void) { GString *output; output = g_string_new (""); @@ -1790,8 +1790,8 @@ mono_jit_parse_options (int argc, char * argv[]) int mini_verbose_level = 0; guint32 opt; - /* - * Some options have no effect here, since they influence the behavior of + /* + * Some options have no effect here, since they influence the behavior of * mono_main (). */ @@ -1840,7 +1840,7 @@ mono_jit_parse_options (int argc, char * argv[]) fprintf (stderr, "Missing method name in --break command line option\n"); exit (1); } - + if (!mono_debugger_insert_breakpoint (argv [++i], FALSE)) fprintf (stderr, "Error: invalid method name '%s'\n", argv [i]); } else if (strncmp (argv[i], "--gc-params=", 12) == 0) { @@ -1867,8 +1867,8 @@ mono_jit_parse_options (int argc, char * argv[]) } if (trace_options != NULL) { - /* - * Need to call this before mini_init () so we can trace methods + /* + * Need to call this before mini_init () so we can trace methods * compiled there too. */ mono_jit_trace_calls = mono_trace_set_options (trace_options); @@ -1932,7 +1932,7 @@ static void darwin_change_default_file_handles () { struct rlimit limit; - + if (getrlimit (RLIMIT_NOFILE, &limit) == 0){ if (limit.rlim_cur < 1024){ limit.rlim_cur = MAX(1024,limit.rlim_cur); @@ -1971,7 +1971,7 @@ switch_arch (char* argv[], const char* target_arch) #endif #define MONO_HANDLERS_ARGUMENT "--handlers=" -#define MONO_HANDLERS_ARGUMENT_LEN G_N_ELEMENTS(MONO_HANDLERS_ARGUMENT)-1 +#define MONO_HANDLERS_ARGUMENT_LEN STRING_LENGTH(MONO_HANDLERS_ARGUMENT) static void apply_root_domain_configuration_file_bindings (MonoDomain *domain, char *root_domain_configuration_file) @@ -2115,7 +2115,7 @@ mono_main (int argc, char* argv[]) mono_init_jemalloc (); #endif - + g_log_set_always_fatal (G_LOG_LEVEL_ERROR); g_log_set_fatal_mask (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR); @@ -2242,7 +2242,7 @@ mono_main (int argc, char* argv[]) fprintf (stderr, "Missing method name in --break command line option\n"); return 1; } - + if (!mono_debugger_insert_breakpoint (argv [++i], FALSE)) fprintf (stderr, "Error: invalid method name '%s'\n", argv [i]); } else if (strcmp (argv [i], "--break-at-bb") == 0) { @@ -2343,7 +2343,7 @@ mono_main (int argc, char* argv[]) fprintf (stderr, "error: --compile option requires a method name argument\n"); return 1; } - + mname = argv [++i]; action = DO_BENCH; } else if (strncmp (argv [i], "--graph=", 8) == 0) { @@ -2351,7 +2351,7 @@ mono_main (int argc, char* argv[]) fprintf (stderr, "error: --graph option requires a method name argument\n"); return 1; } - + mono_graph_options = mono_parse_graph_options (argv [i] + 8); mname = argv [++i]; action = DO_DRAW; @@ -2360,7 +2360,7 @@ mono_main (int argc, char* argv[]) fprintf (stderr, "error: --graph option requires a method name argument\n"); return 1; } - + mname = argv [++i]; mono_graph_options = MONO_GRAPH_CFG; action = DO_DRAW; @@ -2538,8 +2538,8 @@ mono_main (int argc, char* argv[]) mono_set_rootdir (); if (trace_options != NULL){ - /* - * Need to call this before mini_init () so we can trace methods + /* + * Need to call this before mini_init () so we can trace methods * compiled there too. */ mono_jit_trace_calls = mono_trace_set_options (trace_options); @@ -2587,7 +2587,7 @@ mono_main (int argc, char* argv[]) g_ptr_array_free (agents, TRUE); } - + switch (action) { case DO_SINGLE_METHOD_REGRESSION: case DO_REGRESSION: @@ -2668,7 +2668,7 @@ mono_main (int argc, char* argv[]) #endif main_args.domain = domain; - main_args.file = aname; + main_args.file = aname; main_args.argc = argc - i; main_args.argv = argv + i; main_args.opts = opt; @@ -2744,7 +2744,7 @@ mono_main (int argc, char* argv[]) const char *n; double no_opt_time = 0.0; GTimer *timer = g_timer_new (); - fprintf (mini_stats_fd, "$stattitle = \'Compilations times for %s\';\n", + fprintf (mini_stats_fd, "$stattitle = \'Compilations times for %s\';\n", mono_method_full_name (method, TRUE)); fprintf (mini_stats_fd, "@data = (\n"); fprintf (mini_stats_fd, "["); @@ -2775,7 +2775,7 @@ mono_main (int argc, char* argv[]) fprintf (mini_stats_fd, "]"); if (no_opt_time > 0.0) { fprintf (mini_stats_fd, ", \n["); - for (i = 0; i < G_N_ELEMENTS (opt_sets); i++) + for (i = 0; i < G_N_ELEMENTS (opt_sets); i++) fprintf (mini_stats_fd, "%f,", no_opt_time); fprintf (mini_stats_fd, "]"); } @@ -2803,7 +2803,7 @@ mono_main (int argc, char* argv[]) /** * mono_jit_init: */ -MonoDomain * +MonoDomain * mono_jit_init (const char *file) { MonoDomain *ret = mini_init (file, NULL); @@ -2831,7 +2831,7 @@ mono_jit_init (const char *file) * \returns the \c MonoDomain representing the domain where the assembly * was loaded. */ -MonoDomain * +MonoDomain * mono_jit_init_version (const char *domain_name, const char *runtime_version) { MonoDomain *ret = mini_init (domain_name, runtime_version); @@ -2839,7 +2839,7 @@ mono_jit_init_version (const char *domain_name, const char *runtime_version) return ret; } -MonoDomain * +MonoDomain * mono_jit_init_version_for_test_only (const char *domain_name, const char *runtime_version) { MonoDomain *ret = mini_init (domain_name, runtime_version); @@ -2849,7 +2849,7 @@ mono_jit_init_version_for_test_only (const char *domain_name, const char *runtim /** * mono_jit_cleanup: */ -void +void mono_jit_cleanup (MonoDomain *domain) { MONO_STACKDATA (dummy); @@ -2956,7 +2956,7 @@ mono_jit_set_aot_mode (MonoAotMode mode) g_assert (!inited); mono_aot_mode = mode; inited = TRUE; - + mono_runtime_set_execution_mode (mode); } @@ -3018,8 +3018,8 @@ mono_set_crash_chaining (gboolean chain_crashes) /** * mono_parse_options_from: - * \param options string containing strings - * \param ref_argc pointer to the \c argc variable that might be updated + * \param options string containing strings + * \param ref_argc pointer to the \c argc variable that might be updated * \param ref_argv pointer to the \c argv string vector variable that might be updated * * This function parses the contents of the \c MONO_ENV_OPTIONS @@ -3031,7 +3031,7 @@ mono_set_crash_chaining (gboolean chain_crashes) * * The \ character can be used to escape the next character which will * be added to the current element verbatim. Typically this is used - * inside quotes. If the quotes are not balanced, this method + * inside quotes. If the quotes are not balanced, this method * * If the environment variable is empty, no changes are made * to the values pointed by \p ref_argc and \p ref_argv. @@ -3131,7 +3131,7 @@ mono_parse_options (const char *options, int *ref_argc, char **ref_argv [], gboo break; } } - if (in_quotes) + if (in_quotes) return g_strdup_printf ("Unmatched quotes in value: [%s]\n", options); if (buffer->len != 0) @@ -3214,7 +3214,7 @@ mono_parse_response_options (const char *options, int *ref_argc, char **ref_argv /** * mono_parse_env_options: - * \param ref_argc pointer to the \c argc variable that might be updated + * \param ref_argc pointer to the \c argc variable that might be updated * \param ref_argv pointer to the \c argv string vector variable that might be updated * * This function parses the contents of the \c MONO_ENV_OPTIONS @@ -3226,7 +3226,7 @@ mono_parse_response_options (const char *options, int *ref_argc, char **ref_argv * * The \ character can be used to escape the next character which will * be added to the current element verbatim. Typically this is used - * inside quotes. If the quotes are not balanced, this method + * inside quotes. If the quotes are not balanced, this method * * If the environment variable is empty, no changes are made * to the values pointed by \p ref_argc and \p ref_argv. @@ -3245,7 +3245,7 @@ void mono_parse_env_options (int *ref_argc, char **ref_argv []) { char *ret; - + char *env_options = g_getenv ("MONO_ENV_OPTIONS"); if (env_options == NULL) return; diff --git a/src/mono/mono/mini/dwarfwriter.c b/src/mono/mono/mini/dwarfwriter.c index febfef0fc416c2..e18f86e7dc78c6 100644 --- a/src/mono/mono/mini/dwarfwriter.c +++ b/src/mono/mono/mini/dwarfwriter.c @@ -60,7 +60,7 @@ struct _MonoDwarfWriter }; static void -emit_line_number_info (MonoDwarfWriter *w, MonoMethod *method, +emit_line_number_info (MonoDwarfWriter *w, MonoMethod *method, char *start_symbol, char *end_symbol, guint8 *code, guint32 code_size, MonoDebugMethodJitInfo *debug_info); @@ -68,7 +68,7 @@ emit_line_number_info (MonoDwarfWriter *w, MonoMethod *method, /* * mono_dwarf_writer_create: * - * Create a DWARF writer object. WRITER is the underlying image writer this + * Create a DWARF writer object. WRITER is the underlying image writer this * writer will emit to. IL_FILE is the file where IL code will be dumped to for * methods which have no line number info. It can be NULL. */ @@ -128,57 +128,57 @@ emit_pop_section (MonoDwarfWriter *w) } static void -emit_label (MonoDwarfWriter *w, const char *name) -{ - mono_img_writer_emit_label (w->w, name); +emit_label (MonoDwarfWriter *w, const char *name) +{ + mono_img_writer_emit_label (w->w, name); } static void -emit_bytes (MonoDwarfWriter *w, const guint8* buf, int size) -{ - mono_img_writer_emit_bytes (w->w, buf, size); +emit_bytes (MonoDwarfWriter *w, const guint8* buf, int size) +{ + mono_img_writer_emit_bytes (w->w, buf, size); } static void -emit_string (MonoDwarfWriter *w, const char *value) -{ - mono_img_writer_emit_string (w->w, value); +emit_string (MonoDwarfWriter *w, const char *value) +{ + mono_img_writer_emit_string (w->w, value); } static void -emit_line (MonoDwarfWriter *w) -{ - mono_img_writer_emit_line (w->w); +emit_line (MonoDwarfWriter *w) +{ + mono_img_writer_emit_line (w->w); } static void -emit_alignment (MonoDwarfWriter *w, int size) -{ - mono_img_writer_emit_alignment (w->w, size); +emit_alignment (MonoDwarfWriter *w, int size) +{ + mono_img_writer_emit_alignment (w->w, size); } static void -emit_pointer_unaligned (MonoDwarfWriter *w, const char *target) -{ - mono_img_writer_emit_pointer_unaligned (w->w, target); +emit_pointer_unaligned (MonoDwarfWriter *w, const char *target) +{ + mono_img_writer_emit_pointer_unaligned (w->w, target); } static void -emit_pointer (MonoDwarfWriter *w, const char *target) -{ - mono_img_writer_emit_pointer (w->w, target); +emit_pointer (MonoDwarfWriter *w, const char *target) +{ + mono_img_writer_emit_pointer (w->w, target); } static void -emit_int16 (MonoDwarfWriter *w, int value) -{ - mono_img_writer_emit_int16 (w->w, value); +emit_int16 (MonoDwarfWriter *w, int value) +{ + mono_img_writer_emit_int16 (w->w, value); } static void -emit_int32 (MonoDwarfWriter *w, int value) -{ - mono_img_writer_emit_int32 (w->w, value); +emit_int32 (MonoDwarfWriter *w, int value) +{ + mono_img_writer_emit_int32 (w->w, value); } static void @@ -188,15 +188,15 @@ emit_symbol (MonoDwarfWriter *w, const char *symbol) } static void -emit_symbol_diff (MonoDwarfWriter *w, const char *end, const char* start, int offset) -{ - mono_img_writer_emit_symbol_diff (w->w, end, start, offset); +emit_symbol_diff (MonoDwarfWriter *w, const char *end, const char* start, int offset) +{ + mono_img_writer_emit_symbol_diff (w->w, end, start, offset); } static void -emit_byte (MonoDwarfWriter *w, guint8 val) -{ - mono_img_writer_emit_byte (w->w, val); +emit_byte (MonoDwarfWriter *w, guint8 val) +{ + mono_img_writer_emit_byte (w->w, val); } static void @@ -415,7 +415,7 @@ emit_fde (MonoDwarfWriter *w, int fde_index, char *start_symbol, char *end_symbo l = l->next; } - /* Convert the list of MonoUnwindOps to the format used by DWARF */ + /* Convert the list of MonoUnwindOps to the format used by DWARF */ uw_info = mono_unwind_ops_encode_full (l, &uw_info_len, FALSE); emit_bytes (w, uw_info, uw_info_len); g_free (uw_info); @@ -541,7 +541,7 @@ static int variable_loclist_attr [] = { DW_AT_type, DW_FORM_ref4, DW_AT_location, DW_FORM_data4 }; - + static int inheritance_attr [] = { DW_AT_type, DW_FORM_ref4, DW_AT_data_member_location, DW_FORM_block1 @@ -664,7 +664,7 @@ emit_all_line_number_info (MonoDwarfWriter *w) MonoDebugSourceInfo *sinfo = (MonoDebugSourceInfo *)g_ptr_array_index (source_file_list, i); add_line_number_file_name (w, sinfo->source_file, 0, 0); } - } + } /* Preprocess files */ dir_to_index = g_hash_table_new (g_str_hash, g_str_equal); @@ -739,7 +739,7 @@ emit_all_line_number_info (MonoDwarfWriter *w) dir_index = GPOINTER_TO_UINT (g_hash_table_lookup (dir_to_index, dir)); basename = g_path_get_basename (name); } - + if (basename) emit_string (w, basename); else @@ -776,7 +776,7 @@ emit_all_line_number_info (MonoDwarfWriter *w) /* * Some assemblers like apple's do not support subsections, so we can't place - * .Ldebug_info_end at the end of the section using subsections. Instead, we + * .Ldebug_info_end at the end of the section using subsections. Instead, we * define it every time something gets added to the .debug_info section. * The apple assember seems to use the last definition. */ @@ -806,23 +806,23 @@ mono_dwarf_writer_emit_base_info (MonoDwarfWriter *w, const char *cu_name, GSLis emit_section_change (w, ".debug_abbrev", 0); emit_label (w, ".Ldebug_abbrev_start"); - emit_dwarf_abbrev (w, ABBREV_COMPILE_UNIT, DW_TAG_compile_unit, TRUE, + emit_dwarf_abbrev (w, ABBREV_COMPILE_UNIT, DW_TAG_compile_unit, TRUE, compile_unit_attr, G_N_ELEMENTS (compile_unit_attr)); - emit_dwarf_abbrev (w, ABBREV_SUBPROGRAM, DW_TAG_subprogram, TRUE, + emit_dwarf_abbrev (w, ABBREV_SUBPROGRAM, DW_TAG_subprogram, TRUE, subprogram_attr, G_N_ELEMENTS (subprogram_attr)); - emit_dwarf_abbrev (w, ABBREV_PARAM, DW_TAG_formal_parameter, FALSE, + emit_dwarf_abbrev (w, ABBREV_PARAM, DW_TAG_formal_parameter, FALSE, param_attr, G_N_ELEMENTS (param_attr)); - emit_dwarf_abbrev (w, ABBREV_PARAM_LOCLIST, DW_TAG_formal_parameter, FALSE, + emit_dwarf_abbrev (w, ABBREV_PARAM_LOCLIST, DW_TAG_formal_parameter, FALSE, param_loclist_attr, G_N_ELEMENTS (param_loclist_attr)); - emit_dwarf_abbrev (w, ABBREV_BASE_TYPE, DW_TAG_base_type, FALSE, + emit_dwarf_abbrev (w, ABBREV_BASE_TYPE, DW_TAG_base_type, FALSE, base_type_attr, G_N_ELEMENTS (base_type_attr)); - emit_dwarf_abbrev (w, ABBREV_STRUCT_TYPE, DW_TAG_class_type, TRUE, + emit_dwarf_abbrev (w, ABBREV_STRUCT_TYPE, DW_TAG_class_type, TRUE, struct_type_attr, G_N_ELEMENTS (struct_type_attr)); - emit_dwarf_abbrev (w, ABBREV_STRUCT_TYPE_NOCHILDREN, DW_TAG_class_type, FALSE, + emit_dwarf_abbrev (w, ABBREV_STRUCT_TYPE_NOCHILDREN, DW_TAG_class_type, FALSE, struct_type_attr, G_N_ELEMENTS (struct_type_attr)); - emit_dwarf_abbrev (w, ABBREV_DATA_MEMBER, DW_TAG_member, FALSE, + emit_dwarf_abbrev (w, ABBREV_DATA_MEMBER, DW_TAG_member, FALSE, data_member_attr, G_N_ELEMENTS (data_member_attr)); - emit_dwarf_abbrev (w, ABBREV_TYPEDEF, DW_TAG_typedef, FALSE, + emit_dwarf_abbrev (w, ABBREV_TYPEDEF, DW_TAG_typedef, FALSE, typedef_attr, G_N_ELEMENTS (typedef_attr)); emit_dwarf_abbrev (w, ABBREV_ENUM_TYPE, DW_TAG_enumeration_type, TRUE, enum_type_attr, G_N_ELEMENTS (enum_type_attr)); @@ -960,7 +960,7 @@ emit_class_dwarf_info (MonoDwarfWriter *w, MonoClass *klass, gboolean vtype) } full_name = g_strdup_printf ("%s%s%s", m_class_get_name_space (klass), m_class_get_name_space (klass) ? "." : "", m_class_get_name (klass)); - /* + /* * gdb doesn't support namespaces for non-C++ dwarf objects, so use _ * to separate components. */ @@ -1302,8 +1302,8 @@ emit_loclist (MonoDwarfWriter *w, MonoInst *ins, emit_symbol_diff (w, label, ".Ldebug_loc_start", 0); } -/* - * MonoDisHelper->tokener doesn't take an IP argument, and we can't add one since +/* + * MonoDisHelper->tokener doesn't take an IP argument, and we can't add one since * it is a public header. */ static const guint8 *token_handler_ip; @@ -1435,7 +1435,7 @@ disasm_ins (MonoMethod *method, const guchar *ip, const guint8 **endip) } static gint32 -il_offset_from_address (MonoMethod *method, MonoDebugMethodJitInfo *jit, +il_offset_from_address (MonoMethod *method, MonoDebugMethodJitInfo *jit, guint32 native_offset) { int i; @@ -1497,7 +1497,7 @@ compare_lne (MonoDebugLineNumberEntry *a, MonoDebugLineNumberEntry *b) } static void -emit_line_number_info (MonoDwarfWriter *w, MonoMethod *method, +emit_line_number_info (MonoDwarfWriter *w, MonoMethod *method, char *start_symbol, char *end_symbol, guint8 *code, guint32 code_size, MonoDebugMethodJitInfo *debug_info) @@ -1513,7 +1513,7 @@ emit_line_number_info (MonoDwarfWriter *w, MonoMethod *method, MonoDebugMethodInfo *minfo; MonoDebugLineNumberEntry *ln_array; int *native_to_il_offset = NULL; - + mono_error_assert_ok (error); /* FIXME don't swallow the error */ if (!w->emit_line) { @@ -1598,7 +1598,7 @@ emit_line_number_info (MonoDwarfWriter *w, MonoMethod *method, line_diff = (gint32)loc->row - (gint32)prev_line; addr_diff = i - prev_native_offset; - if (first) { + if (first) { emit_section_change (w, ".debug_line", 0); emit_byte (w, 0); @@ -1624,7 +1624,7 @@ emit_line_number_info (MonoDwarfWriter *w, MonoMethod *method, emit_uleb128 (w, file_index); emit_byte (w, DW_LNS_copy); w->cur_file_index = file_index; - } + } } } @@ -1704,7 +1704,7 @@ emit_line_number_info (MonoDwarfWriter *w, MonoMethod *method, continue; line = il_to_line [lne->il_offset]; if (!line) { - /* + /* * This seems to happen randomly, it looks like il_offset points * into the middle of an instruction. */ @@ -1895,7 +1895,7 @@ mono_dwarf_writer_emit_method (MonoDwarfWriter *w, MonoCompile *cfg, MonoMethod emit_byte (w, p - buf); emit_bytes (w, buf, p - buf); } - } + } g_free (names); /* Locals */ diff --git a/src/mono/mono/mini/exceptions-amd64.c b/src/mono/mono/mini/exceptions-amd64.c index 20eb44c8fbdb2b..fd118ad499760a 100644 --- a/src/mono/mono/mini/exceptions-amd64.c +++ b/src/mono/mono/mini/exceptions-amd64.c @@ -289,7 +289,7 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot) * mono_arch_get_call_filter: * * Returns a pointer to a method which calls an exception filter. We - * also use this function to call finally handlers (we pass NULL as + * also use this function to call finally handlers (we pass NULL as * @exc object in this case). */ gpointer @@ -374,7 +374,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot) } #endif /* !DISABLE_JIT */ -/* +/* * The first few arguments are dummy, to force the other arguments to be passed on * the stack, this avoids overwriting the argument registers in the throw trampoline. */ @@ -564,9 +564,9 @@ get_throw_trampoline (MonoTrampInfo **info, gboolean rethrow, gboolean corlib, g /** * mono_arch_get_throw_exception: - * \returns a function pointer which can be used to raise - * exceptions. The returned function has the following - * signature: void (*func) (MonoException *exc); + * \returns a function pointer which can be used to raise + * exceptions. The returned function has the following + * signature: void (*func) (MonoException *exc); */ gpointer mono_arch_get_throw_exception (MonoTrampInfo **info, gboolean aot) @@ -574,13 +574,13 @@ mono_arch_get_throw_exception (MonoTrampInfo **info, gboolean aot) return get_throw_trampoline (info, FALSE, FALSE, FALSE, FALSE, "throw_exception", aot, FALSE); } -gpointer +gpointer mono_arch_get_rethrow_exception (MonoTrampInfo **info, gboolean aot) { return get_throw_trampoline (info, TRUE, FALSE, FALSE, FALSE, "rethrow_exception", aot, FALSE); } -gpointer +gpointer mono_arch_get_rethrow_preserve_exception (MonoTrampInfo **info, gboolean aot) { return get_throw_trampoline (info, TRUE, FALSE, FALSE, FALSE, "rethrow_preserve_exception", aot, TRUE); @@ -589,14 +589,14 @@ mono_arch_get_rethrow_preserve_exception (MonoTrampInfo **info, gboolean aot) /** * mono_arch_get_throw_corlib_exception: * - * Returns a function pointer which can be used to raise - * corlib exceptions. The returned function has the following - * signature: void (*func) (guint32 ex_token, guint32 offset); - * Here, offset is the offset which needs to be substracted from the caller IP - * to get the IP of the throw. Passing the offset has the advantage that it + * Returns a function pointer which can be used to raise + * corlib exceptions. The returned function has the following + * signature: void (*func) (guint32 ex_token, guint32 offset); + * Here, offset is the offset which needs to be substracted from the caller IP + * to get the IP of the throw. Passing the offset has the advantage that it * needs no relocations in the caller. */ -gpointer +gpointer mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot) { return get_throw_trampoline (info, FALSE, TRUE, FALSE, FALSE, "throw_corlib_exception", aot, FALSE); @@ -650,7 +650,7 @@ mono_arch_unwind_frame (MonoJitTlsData *jit_tls, /* LLVM compiled code doesn't have this info */ if (ji->has_arch_eh_info) epilog = (guint8*)ji->code_start + ji->code_size - mono_jinfo_get_epilog_size (ji); - + for (i = 0; i < AMD64_NREG; ++i) regs [i] = new_ctx->gregs [i]; @@ -664,7 +664,7 @@ mono_arch_unwind_frame (MonoJitTlsData *jit_tls, for (i = 0; i < AMD64_NREG; ++i) new_ctx->gregs [i] = regs [i]; - + /* The CFA becomes the new SP value */ new_ctx->gregs [AMD64_RSP] = (host_mgreg_t)(gsize)cfa; @@ -685,8 +685,8 @@ mono_arch_unwind_frame (MonoJitTlsData *jit_tls, /* Top LMF entry */ return FALSE; } else { - /* - * The rsp field is set just before the call which transitioned to native + /* + * The rsp field is set just before the call which transitioned to native * code. Obtain the rip from the stack. */ rip = *(guint64*)((*lmf)->rsp - sizeof(host_mgreg_t)); @@ -826,7 +826,7 @@ mono_arch_ip_from_context (void *sigctx) #else MonoContext *ctx = (MonoContext*)sigctx; return (gpointer)ctx->gregs [AMD64_RIP]; -#endif +#endif } static MonoObject* @@ -844,7 +844,7 @@ restore_soft_guard_pages (void) return NULL; } -/* +/* * this function modifies mctx so that when it is restored, it * won't execcute starting at mctx.eip, but in a function that * will restore the protection on the soft-guard pages and return back to @@ -1908,7 +1908,7 @@ void mono_arch_code_chunk_destroy (void *chunk) void mono_arch_setup_resume_sighandler_ctx (MonoContext *ctx, gpointer func) { - /* + /* * When resuming from a signal handler, the stack should be misaligned, just like right after * a call. */ diff --git a/src/mono/mono/mini/image-writer.c b/src/mono/mono/mini/image-writer.c index cc81ac7b070dcd..436d2b316635fc 100644 --- a/src/mono/mono/mini/image-writer.c +++ b/src/mono/mono/mini/image-writer.c @@ -29,7 +29,7 @@ #include "mini.h" -/* +/* * The used assembler dialect * TARGET_ASM_APPLE == apple assembler on OSX * TARGET_ASM_GAS == GNU assembler @@ -318,7 +318,7 @@ asm_writer_emit_line (MonoImageWriter *acfg) fprintf (acfg->fp, "\n"); } -static void +static void asm_writer_emit_alignment (MonoImageWriter *acfg, int size) { asm_writer_emit_unset_mode (acfg); @@ -336,7 +336,7 @@ asm_writer_emit_alignment (MonoImageWriter *acfg, int size) #endif } -static void +static void asm_writer_emit_alignment_fill (MonoImageWriter *acfg, int size, int fill) { asm_writer_emit_unset_mode (acfg); @@ -646,7 +646,7 @@ mono_img_writer_emit_byte (MonoImageWriter *acfg, guint8 val) mono_img_writer_emit_bytes (acfg, &val, 1); } -/* +/* * Emit a relocation entry of type RELOC_TYPE against symbol SYMBOL at the current PC. * Do not advance PC. */ diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index 7c5d22d6a5c35d..f5ee46419ac4d3 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -3447,8 +3447,33 @@ interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClauseArgs LOCAL_VAR (ip [1], gint64) = READ64 (ip + 2); /* note union usage */ ip += 6; MINT_IN_BREAK; + MINT_IN_CASE(MINT_TAILCALL) + MINT_IN_CASE(MINT_TAILCALL_VIRT) MINT_IN_CASE(MINT_JMP) { - InterpMethod *new_method = (InterpMethod*)frame->imethod->data_items [ip [1]]; + gboolean is_tailcall = *ip != MINT_JMP; + InterpMethod *new_method; + + if (is_tailcall) { + guint16 params_offset = ip [1]; + guint16 params_size = ip [3]; + + // Copy the params to their location at the start of the frame + memmove (frame->stack, (guchar*)frame->stack + params_offset, params_size); + new_method = (InterpMethod*)frame->imethod->data_items [ip [2]]; + + if (*ip == MINT_TAILCALL_VIRT) { + gint16 slot = (gint16)ip [4]; + MonoObject *this_arg = LOCAL_VAR (0, MonoObject*); + new_method = get_virtual_method_fast (new_method, this_arg->vtable, slot); + if (m_class_is_valuetype (this_arg->vtable->klass) && m_class_is_valuetype (new_method->method->klass)) { + /* unbox */ + gpointer unboxed = mono_object_unbox_internal (this_arg); + LOCAL_VAR (0, gpointer) = unboxed; + } + } + } else { + new_method = (InterpMethod*)frame->imethod->data_items [ip [1]]; + } if (frame->imethod->prof_flags & MONO_PROFILER_CALL_INSTRUMENTATION_TAIL_CALL) MONO_PROFILER_RAISE (method_tail_call, (frame->imethod->method, new_method->method)); diff --git a/src/mono/mono/mini/interp/mintops.def b/src/mono/mono/mini/interp/mintops.def index e464902f816857..52b2c4bb1522cf 100644 --- a/src/mono/mono/mini/interp/mintops.def +++ b/src/mono/mono/mini/interp/mintops.def @@ -670,6 +670,8 @@ OPDEF(MINT_CALLI_NAT_DYNAMIC, "calli.nat.dynamic", 5, 1, 2, MintOpMethodToken) OPDEF(MINT_CALLI_NAT_FAST, "calli.nat.fast", 7, 1, 2, MintOpMethodToken) OPDEF(MINT_CALL_VARARG, "call.vararg", 6, 1, 1, MintOpMethodToken) OPDEF(MINT_CALLRUN, "callrun", 5, 1, 1, MintOpNoArgs) +OPDEF(MINT_TAILCALL, "tailcall", 4, 0, 1, MintOpMethodToken) +OPDEF(MINT_TAILCALL_VIRT, "tailcall.virt", 5, 0, 1, MintOpMethodToken) OPDEF(MINT_ICALL_V_V, "mono_icall_v_v", 3, 0, 1, MintOpShortInt) OPDEF(MINT_ICALL_V_P, "mono_icall_v_p", 4, 1, 1, MintOpShortInt) diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index 1e9dcb3d589541..576f5db0fca436 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -1424,6 +1424,7 @@ dump_interp_ins_data (InterpInst *ins, gint32 ins_offset, const guint16 *data, g target = ins_offset + *(gint16*)(data + 1); g_string_append_printf (str, " %u, IR_%04x", *(guint16*)data, target); } + break; case MintOpPair2: g_string_append_printf (str, " %u <- %u, %u <- %u", data [0], data [1], data [2], data [3]); break; @@ -1445,25 +1446,27 @@ dump_interp_compacted_ins (const guint16 *ip, const guint16 *start) { int opcode = *ip; int ins_offset = ip - start; + GString *str = g_string_new (""); - g_print ("IR_%04x: %-14s", ins_offset, mono_interp_opname (opcode)); + g_string_append_printf (str, "IR_%04x: %-14s", ins_offset, mono_interp_opname (opcode)); ip++; if (mono_interp_op_dregs [opcode] > 0) - g_print (" [%d <-", *ip++); + g_string_append_printf (str, " [%d <-", *ip++); else - g_print (" [nil <-"); + g_string_append_printf (str, " [nil <-"); if (mono_interp_op_sregs [opcode] > 0) { for (int i = 0; i < mono_interp_op_sregs [opcode]; i++) - g_print (" %d", *ip++); - g_print ("],"); + g_string_append_printf (str, " %d", *ip++); + g_string_append_printf (str, "],"); } else { - g_print (" nil],"); + g_string_append_printf (str, " nil],"); } - char *ins = dump_interp_ins_data (NULL, ins_offset, ip, opcode); - g_print ("%s\n", ins); - g_free (ins); + char *ins_data = dump_interp_ins_data (NULL, ins_offset, ip, opcode); + g_print ("%s%s\n", str->str, ins_data); + g_string_free (str, TRUE); + g_free (ins_data); } static void @@ -1477,51 +1480,47 @@ dump_interp_code (const guint16 *start, const guint16* end) } static void -dump_interp_inst_no_newline (InterpInst *ins) +dump_interp_inst (InterpInst *ins) { int opcode = ins->opcode; - g_print ("IL_%04x: %-14s", ins->il_offset, mono_interp_opname (opcode)); + GString *str = g_string_new (""); + g_string_append_printf (str, "IL_%04x: %-14s", ins->il_offset, mono_interp_opname (opcode)); if (mono_interp_op_dregs [opcode] > 0) - g_print (" [%d <-", ins->dreg); + g_string_append_printf (str, " [%d <-", ins->dreg); else - g_print (" [nil <-"); + g_string_append_printf (str, " [nil <-"); if (mono_interp_op_sregs [opcode] > 0) { for (int i = 0; i < mono_interp_op_sregs [opcode]; i++) { if (ins->sregs [i] == MINT_CALL_ARGS_SREG) { - g_print (" c:"); + g_string_append_printf (str, " c:"); int *call_args = ins->info.call_args; if (call_args) { while (*call_args != -1) { - g_print (" %d", *call_args); + g_string_append_printf (str, " %d", *call_args); call_args++; } } } else { - g_print (" %d", ins->sregs [i]); + g_string_append_printf (str, " %d", ins->sregs [i]); } } - g_print ("],"); + g_string_append_printf (str, "],"); } else { - g_print (" nil],"); + g_string_append_printf (str, " nil],"); } if (opcode == MINT_LDLOCA_S) { // LDLOCA has special semantics, it has data in sregs [0], but it doesn't have any sregs - g_print (" %d", ins->sregs [0]); + g_string_append_printf (str, " %d", ins->sregs [0]); } else { char *descr = dump_interp_ins_data (ins, ins->il_offset, &ins->data [0], ins->opcode); - g_print ("%s", descr); + g_string_append_printf (str, "%s", descr); g_free (descr); } -} - -static void -dump_interp_inst (InterpInst *ins) -{ - dump_interp_inst_no_newline (ins); - g_print ("\n"); + g_print ("%s\n", str->str); + g_string_free (str, TRUE); } static G_GNUC_UNUSED void @@ -1580,21 +1579,6 @@ interp_method_get_header (MonoMethod* method, MonoError *error) return mono_method_get_header_internal (method, error); } -/* stores top of stack as local and pushes address of it on stack */ -static void -emit_store_value_as_local (TransformData *td, MonoType *src) -{ - int local = create_interp_local (td, mini_native_type_replace_type (src)); - - store_local (td, local); - - interp_add_ins (td, MINT_LDLOCA_S); - push_simple_type (td, STACK_TYPE_MP); - interp_ins_set_dreg (td->last_ins, td->sp [-1].local); - interp_ins_set_sreg (td->last_ins, local); - td->locals [local].indirects++; -} - static gboolean interp_ip_in_cbb (TransformData *td, int il_offset) { @@ -1905,15 +1889,15 @@ interp_handle_magic_type_intrinsics (TransformData *td, MonoMethod *target_metho int src_size = mini_magic_type_size (NULL, src); int dst_size = mini_magic_type_size (NULL, dst); - gboolean store_value_as_local = FALSE; + gboolean managed_fallback = FALSE; switch (type_index) { case 0: case 1: if (!mini_magic_is_int_type (src) || !mini_magic_is_int_type (dst)) { if (mini_magic_is_int_type (src)) - store_value_as_local = TRUE; + managed_fallback = TRUE; else if (mono_class_is_magic_float (src_klass)) - store_value_as_local = TRUE; + managed_fallback = TRUE; else return FALSE; } @@ -1921,21 +1905,17 @@ interp_handle_magic_type_intrinsics (TransformData *td, MonoMethod *target_metho case 2: if (!mini_magic_is_float_type (src) || !mini_magic_is_float_type (dst)) { if (mini_magic_is_float_type (src)) - store_value_as_local = TRUE; + managed_fallback = TRUE; else if (mono_class_is_magic_int (src_klass)) - store_value_as_local = TRUE; + managed_fallback = TRUE; else return FALSE; } break; } - if (store_value_as_local) { - emit_store_value_as_local (td, src); - - /* emit call to managed conversion method */ + if (managed_fallback) return FALSE; - } if (src_size > dst_size) { // 8 -> 4 switch (type_index) { @@ -1992,15 +1972,6 @@ interp_handle_magic_type_intrinsics (TransformData *td, MonoMethod *target_metho td->ip += 5; return TRUE; } else if (!strcmp ("CompareTo", tm) || !strcmp ("Equals", tm)) { - MonoType *arg = csignature->params [0]; - int mt = mint_type (arg); - - /* on 'System.n*::{CompareTo,Equals} (System.n*)' variant we need to push managed - * pointer instead of value */ - if (mt != MINT_TYPE_O) - emit_store_value_as_local (td, arg); - - /* emit call to managed conversion method */ return FALSE; } else if (!strcmp (".cctor", tm)) { return FALSE; @@ -2440,7 +2411,7 @@ interp_handle_intrinsics (TransformData *td, MonoMethod *target_method, MonoClas if (!strcmp (tm, "InternalGetHashCode")) { *op = MINT_INTRINS_GET_HASHCODE; } else if (!strcmp (tm, "GetType")) { - if (constrained_class && m_class_is_valuetype (constrained_class)) { + if (constrained_class && m_class_is_valuetype (constrained_class) && !mono_class_is_nullable (constrained_class)) { // If constrained_class is valuetype we already know its type. // Resolve GetType to a constant so we can fold type comparisons ERROR_DECL(error); @@ -2457,8 +2428,16 @@ interp_handle_intrinsics (TransformData *td, MonoMethod *target_method, MonoClas return TRUE; } else { if (constrained_class) { - // deref the managed pointer to get the object - interp_add_ins (td, MINT_LDIND_I); + if (mono_class_is_nullable (constrained_class)) { + // We can't determine the behavior here statically because we don't know if the + // nullable vt has a value or not. If it has a value, the result type is + // m_class_get_cast_class (constrained_class), otherwise GetType should throw NRE. + interp_add_ins (td, MINT_BOX_NULLABLE_PTR); + td->last_ins->data [0] = get_data_item_index (td, constrained_class); + } else { + // deref the managed pointer to get the object + interp_add_ins (td, MINT_LDIND_I); + } td->sp--; interp_ins_set_sreg (td->last_ins, td->sp [0].local); push_simple_type (td, STACK_TYPE_O); @@ -2827,8 +2806,7 @@ interp_method_check_inlining (TransformData *td, MonoMethod *method, MonoMethodS if (method->wrapper_type != MONO_WRAPPER_NONE) return FALSE; - /* Our usage of `emit_store_value_as_local ()` for nint, nuint and nfloat - * is kinda hacky, and doesn't work with the inliner */ + // FIXME Re-enable this if (mono_class_get_magic_index (method->klass) >= 0) return FALSE; @@ -2927,6 +2905,7 @@ interp_inline_method (TransformData *td, MonoMethod *target_method, MonoMethodHe td->last_ins->next = NULL; UnlockedIncrement (&mono_interp_stats.inline_failures); } else { + MONO_PROFILER_RAISE (inline_method, (td->rtm->method, target_method)); if (td->verbose_level) g_print ("Inline end method %s.%s\n", m_class_get_name (target_method->klass), target_method->name); UnlockedIncrement (&mono_interp_stats.inlined_methods); @@ -3133,6 +3112,24 @@ interp_emit_arg_conv (TransformData *td, MonoMethodSignature *csignature) emit_convert (td, &arg_start [i], csignature->params [i]); } +static gint16 +get_virt_method_slot (MonoMethod *method) +{ + if (mono_class_is_interface (method->klass)) + return (gint16)(-2 * MONO_IMT_SIZE + mono_method_get_imt_slot (method)); + else + return (gint16)mono_method_get_vtable_slot (method); +} + +static int* +create_call_args (TransformData *td, int num_args) +{ + int *call_args = (int*) mono_mempool_alloc (td->mempool, (num_args + 1) * sizeof (int)); + for (int i = 0; i < num_args; i++) + call_args [i] = td->sp [i].local; + call_args [num_args] = -1; + return call_args; +} /* Return FALSE if error, including inline failure */ static gboolean interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target_method, MonoGenericContext *generic_context, MonoClass *constrained_class, gboolean readonly, MonoError *error, gboolean check_visibility, gboolean save_last_error, gboolean tailcall) @@ -3141,7 +3138,6 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target MonoMethodSignature *csignature; int is_virtual = *td->ip == CEE_CALLVIRT; int calli = *td->ip == CEE_CALLI || *td->ip == CEE_MONO_CALLI_EXTRA_ARG; - int i; guint32 res_size = 0; int op = -1; int native = 0; @@ -3214,8 +3210,10 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target } /* Intrinsics */ - if (target_method && interp_handle_intrinsics (td, target_method, constrained_class, csignature, readonly, &op)) + if (target_method && interp_handle_intrinsics (td, target_method, constrained_class, csignature, readonly, &op)) { + MONO_PROFILER_RAISE (inline_method, (td->rtm->method, target_method)); return TRUE; + } if (constrained_class) { if (m_class_is_enumtype (constrained_class) && !strcmp (target_method->name, "GetHashCode")) { @@ -3243,8 +3241,10 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target g_print (" : %s::%s. %s (%p)\n", target_method->klass->name, target_method->name, mono_signature_full_name (target_method->signature), target_method); #endif /* Intrinsics: Try again, it could be that `mono_get_method_constrained_with_method` resolves to a method that we can substitute */ - if (target_method && interp_handle_intrinsics (td, target_method, constrained_class, csignature, readonly, &op)) + if (target_method && interp_handle_intrinsics (td, target_method, constrained_class, csignature, readonly, &op)) { + MONO_PROFILER_RAISE (inline_method, (td->rtm->method, target_method)); return TRUE; + } return_val_if_nok (error, FALSE); mono_class_setup_vtable (target_method->klass); @@ -3292,26 +3292,44 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target } CHECK_STACK (td, csignature->param_count + csignature->hasthis); - if (tailcall && !td->gen_sdb_seq_points && !calli && op == -1 && (!is_virtual || (target_method->flags & METHOD_ATTRIBUTE_VIRTUAL) == 0) && + if (tailcall && !td->gen_sdb_seq_points && !calli && op == -1 && (target_method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) == 0 && (target_method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) == 0 && !(target_method->iflags & METHOD_IMPL_ATTRIBUTE_NOINLINING)) { (void)mono_class_vtable_checked (target_method->klass, error); return_val_if_nok (error, FALSE); - if (method == target_method && *(td->ip + 5) == CEE_RET && !(csignature->hasthis && m_class_is_valuetype (target_method->klass))) { + if (*(td->ip + 5) == CEE_RET) { if (td->inlined_method) return FALSE; if (td->verbose_level) g_print ("Optimize tail call of %s.%s\n", m_class_get_name (target_method->klass), target_method->name); - for (i = csignature->param_count - 1 + !!csignature->hasthis; i >= 0; --i) - store_arg (td, i); + int num_args = csignature->param_count + !!csignature->hasthis; + td->sp -= num_args; + guint32 params_stack_size = get_stack_size (td->sp, num_args); + + int *call_args = create_call_args (td, num_args); + + if (is_virtual) { + interp_add_ins (td, MINT_CKNULL); + interp_ins_set_sreg (td->last_ins, td->sp->local); + set_simple_type_and_local (td, td->sp, td->sp->type); + interp_ins_set_dreg (td->last_ins, td->sp->local); + + interp_add_ins (td, MINT_TAILCALL_VIRT); + td->last_ins->data [2] = get_virt_method_slot (target_method); + } else { + interp_add_ins (td, MINT_TAILCALL); + } + interp_ins_set_sreg (td->last_ins, MINT_CALL_ARGS_SREG); + td->last_ins->data [0] = get_data_item_index (td, mono_interp_get_imethod (target_method, error)); + return_val_if_nok (error, FALSE); + td->last_ins->data [1] = params_stack_size; + td->last_ins->flags |= INTERP_INST_FLAG_CALL; + td->last_ins->info.call_args = call_args; - interp_add_ins (td, MINT_BR); - // We are branching to the beginning of the method - td->last_ins->info.target_bb = td->entry_bb; int in_offset = td->ip - td->il_code; if (interp_ip_in_cbb (td, in_offset + 5)) ++td->ip; /* gobble the CEE_RET if it isn't branched to */ @@ -3367,10 +3385,7 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target td->sp -= num_args; guint32 params_stack_size = get_stack_size (td->sp, num_args); - int *call_args = (int*) mono_mempool_alloc (td->mempool, (num_args + 1) * sizeof (int)); - for (int i = 0; i < num_args; i++) - call_args [i] = td->sp [i].local; - call_args [num_args] = -1; + int *call_args = create_call_args (td, num_args); // We overwrite it with the return local, save it for future use if (csignature->param_count || csignature->hasthis) @@ -3509,10 +3524,7 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target td->last_ins->data [2] = params_stack_size; } else if (is_virtual) { interp_add_ins (td, MINT_CALLVIRT_FAST); - if (mono_class_is_interface (target_method->klass)) - td->last_ins->data [1] = -2 * MONO_IMT_SIZE + mono_method_get_imt_slot (target_method); - else - td->last_ins->data [1] = mono_method_get_vtable_slot (target_method); + td->last_ins->data [1] = get_virt_method_slot (target_method); } else if (is_virtual) { interp_add_ins (td, MINT_CALLVIRT); } else { @@ -5732,6 +5744,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, !strcmp (m_class_get_name (m->klass), "ByReference`1") && !strcmp (m->name, ".ctor")) { /* public ByReference(ref T value) */ + MONO_PROFILER_RAISE (inline_method, (td->rtm->method, m)); g_assert (csignature->hasthis && csignature->param_count == 1); td->sp--; /* We already have the vt on top of the stack. Just do a dummy mov that should be optimized out */ @@ -5746,6 +5759,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, csignature->params [0]->type == MONO_TYPE_PTR && !type_has_references (mono_method_get_context (m)->class_inst->type_argv [0])) { /* ctor frequently used with ReadOnlySpan over static arrays */ + MONO_PROFILER_RAISE (inline_method, (td->rtm->method, m)); interp_add_ins (td, MINT_INTRINS_SPAN_CTOR); td->sp -= 2; interp_ins_set_sregs2 (td->last_ins, td->sp [0].local, td->sp [1].local); @@ -6014,6 +6028,8 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, td->sp--; interp_emit_sfld_access (td, field, field_klass, mt, TRUE, error); goto_if_nok (error, exit); + } else if (td->sp [-1].type != STACK_TYPE_O && td->sp [-1].type != STACK_TYPE_MP && (mono_class_is_magic_int (klass) || mono_class_is_magic_float (klass))) { + // No need to load anything, the value is already on the execution stack } else if (td->sp [-1].type == STACK_TYPE_VT) { int size = 0; /* First we pop the vt object from the stack. Then we push the field */ diff --git a/src/mono/mono/mini/intrinsics.c b/src/mono/mono/mini/intrinsics.c index 4e89ab2d0f1a4e..a25a215d08235a 100644 --- a/src/mono/mono/mini/intrinsics.c +++ b/src/mono/mono/mini/intrinsics.c @@ -1894,11 +1894,36 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign MONO_ADD_INS (cfg->cbb, ins); } return ins; - } else if (((!strcmp (cmethod_klass_image->assembly->aname.name, "MonoMac") || - !strcmp (cmethod_klass_image->assembly->aname.name, "monotouch")) && - !strcmp (cmethod_klass_name_space, "XamCore.ObjCRuntime") && - !strcmp (cmethod_klass_name, "Selector")) || - ((!strcmp (cmethod_klass_image->assembly->aname.name, "Xamarin.iOS") || + } else if (cmethod->klass == mono_defaults.systemtype_class && !strcmp (cmethod->name, "get_IsValueType") && + args [0]->klass == mono_defaults.runtimetype_class) { + MonoClass *k1 = get_class_from_ldtoken_ins (args [0]); + if (k1) { + MonoType *t1 = m_class_get_byval_arg (k1); + MonoType *constraint1 = NULL; + + /* Common case in gshared BCL code: t1 is a gshared type like T_INT */ + if (mono_class_is_gparam (k1)) { + MonoGenericParam *gparam = t1->data.generic_param; + constraint1 = gparam->gshared_constraint; + if (constraint1) { + if (constraint1->type == MONO_TYPE_OBJECT) { + if (cfg->verbose_level > 2) + printf ("-> false\n"); + EMIT_NEW_ICONST (cfg, ins, 0); + return ins; + } else if (MONO_TYPE_IS_PRIMITIVE (constraint1)) { + if (cfg->verbose_level > 2) + printf ("-> true\n"); + EMIT_NEW_ICONST (cfg, ins, 1); + return ins; + } + } + } + } + return NULL; + } else if (((!strcmp (cmethod_klass_image->assembly->aname.name, "Xamarin.iOS") || + !strcmp (cmethod_klass_image->assembly->aname.name, "Xamarin.TVOS") || + !strcmp (cmethod_klass_image->assembly->aname.name, "Xamarin.MacCatalyst") || !strcmp (cmethod_klass_image->assembly->aname.name, "Xamarin.Mac")) && !strcmp (cmethod_klass_name_space, "ObjCRuntime") && !strcmp (cmethod_klass_name, "Selector")) diff --git a/src/mono/mono/mini/jit-icalls.c b/src/mono/mono/mini/jit-icalls.c index 98290fde4e1603..a0078c45656987 100644 --- a/src/mono/mono/mini/jit-icalls.c +++ b/src/mono/mono/mini/jit-icalls.c @@ -125,13 +125,13 @@ ldvirtfn_internal (MonoObject *obj, MonoMethod *method, gboolean gshared) } void* -mono_ldvirtfn (MonoObject *obj, MonoMethod *method) +mono_ldvirtfn (MonoObject *obj, MonoMethod *method) { return ldvirtfn_internal (obj, method, FALSE); } void* -mono_ldvirtfn_gshared (MonoObject *obj, MonoMethod *method) +mono_ldvirtfn_gshared (MonoObject *obj, MonoMethod *method) { return ldvirtfn_internal (obj, method, TRUE); } @@ -155,19 +155,19 @@ mono_helper_stelem_ref_check (MonoArray *array, MonoObject *val) #if !defined(MONO_ARCH_NO_EMULATE_LONG_MUL_OPTS) || defined(MONO_ARCH_EMULATE_LONG_MUL_OVF_OPTS) -gint64 +gint64 mono_llmult (gint64 a, gint64 b) { return a * b; } -guint64 +guint64 mono_llmult_ovf_un (guint64 a, guint64 b) { guint32 al = a; guint32 ah = a >> 32; guint32 bl = b; - guint32 bh = b >> 32; + guint32 bh = b >> 32; guint64 res, t1; // fixme: this is incredible slow @@ -182,7 +182,7 @@ mono_llmult_ovf_un (guint64 a, guint64 b) if (t1 > 0xffffffff) goto raise_exception; - res += ((guint64)t1) << 32; + res += ((guint64)t1) << 32; return res; @@ -195,13 +195,13 @@ mono_llmult_ovf_un (guint64 a, guint64 b) return 0; } -guint64 -mono_llmult_ovf (gint64 a, gint64 b) +guint64 +mono_llmult_ovf (gint64 a, gint64 b) { guint32 al = a; gint32 ah = a >> 32; guint32 bl = b; - gint32 bh = b >> 32; + gint32 bh = b >> 32; /* Use Karatsuba algorithm where: a*b is: AhBh(R^2+R)+(Ah-Al)(Bl-Bh)R+AlBl(R+1) @@ -214,7 +214,7 @@ mono_llmult_ovf (gint64 a, gint64 b) result, ah and/or bh must be 0. This will save us from doing the AhBh term at all. - Also note that we refactor so that we don't overflow 64 bits with + Also note that we refactor so that we don't overflow 64 bits with intermediate results. So we use [(Ah-Al)(Bl-Bh)+AlBl]R+AlBl */ @@ -267,9 +267,9 @@ mono_llmult_ovf (gint64 a, gint64 b) bl +=1; } } - - /* we overflow for sure if both upper halves are greater - than zero because we would need to shift their + + /* we overflow for sure if both upper halves are greater + than zero because we would need to shift their product 64 bits to the left and that will not fit in a 64 bit result */ if (ah && bh) @@ -308,7 +308,7 @@ mono_llmult_ovf (gint64 a, gint64 b) return 0; } -gint64 +gint64 mono_lldiv (gint64 a, gint64 b) { #ifdef MONO_ARCH_NEED_DIV_CHECK @@ -328,7 +328,7 @@ mono_lldiv (gint64 a, gint64 b) return a / b; } -gint64 +gint64 mono_llrem (gint64 a, gint64 b) { #ifdef MONO_ARCH_NEED_DIV_CHECK @@ -348,7 +348,7 @@ mono_llrem (gint64 a, gint64 b) return a % b; } -guint64 +guint64 mono_lldiv_un (guint64 a, guint64 b) { #ifdef MONO_ARCH_NEED_DIV_CHECK @@ -362,7 +362,7 @@ mono_lldiv_un (guint64 a, guint64 b) return a / b; } -guint64 +guint64 mono_llrem_un (guint64 a, guint64 b) { #ifdef MONO_ARCH_NEED_DIV_CHECK @@ -380,7 +380,7 @@ mono_llrem_un (guint64 a, guint64 b) #ifndef MONO_ARCH_NO_EMULATE_LONG_SHIFT_OPS -guint64 +guint64 mono_lshl (guint64 a, gint32 shamt) { const guint64 res = a << (shamt & 0x7f); @@ -390,7 +390,7 @@ mono_lshl (guint64 a, gint32 shamt) return res; } -guint64 +guint64 mono_lshr_un (guint64 a, gint32 shamt) { const guint64 res = a >> (shamt & 0x7f); @@ -400,7 +400,7 @@ mono_lshr_un (guint64 a, gint32 shamt) return res; } -gint64 +gint64 mono_lshr (gint64 a, gint32 shamt) { const gint64 res = a >> (shamt & 0x7f); @@ -977,10 +977,10 @@ mono_fconv_ovf_u8 (double v) * The soft-float implementation of some ARM devices have a buggy guin64 to double * conversion that it looses precision even when the integer if fully representable * as a double. - * + * * This was found with 4294967295ull, converting to double and back looses one bit of precision. - * - * To work around this issue we test for value boundaries instead. + * + * To work around this issue we test for value boundaries instead. */ #if defined(__arm__) && defined(MONO_ARCH_SOFT_FLOAT_FALLBACK) if (mono_isnan (v) || !(v >= -0.5 && v <= ULLONG_MAX+0.5)) { diff --git a/src/mono/mono/mini/linear-scan.c b/src/mono/mono/mini/linear-scan.c index 15ec1680582fa2..f3679d3b1de7c7 100644 --- a/src/mono/mono/mini/linear-scan.c +++ b/src/mono/mono/mini/linear-scan.c @@ -26,12 +26,12 @@ mono_varlist_insert_sorted (MonoCompile *cfg, GList *list, MonoMethodVar *mv, in for (l = list; l; l = l->next) { MonoMethodVar *v1 = (MonoMethodVar *)l->data; - + if (sort_type == 2) { if (mv->spill_costs >= v1->spill_costs) { list = g_list_insert_before (list, l, mv); break; - } + } } else if (sort_type == 1) { if (mv->range.last_use.abs_pos <= v1->range.last_use.abs_pos) { list = g_list_insert_before (list, l, mv); @@ -50,7 +50,7 @@ mono_varlist_insert_sorted (MonoCompile *cfg, GList *list, MonoMethodVar *mv, in return list; } -static gint +static gint compare_by_first_use_func (gconstpointer a, gconstpointer b) { MonoMethodVar *v1 = (MonoMethodVar*)a; @@ -98,7 +98,7 @@ mono_linear_scan (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_ma #ifdef DEBUG_LSCAN for (l = vars; l; l = l->next) { vmv = l->data; - printf ("VAR %d %08x %08x C%d\n", vmv->idx, vmv->range.first_use.abs_pos, + printf ("VAR %d %08x %08x C%d\n", vmv->idx, vmv->range.first_use.abs_pos, vmv->range.last_use.abs_pos, vmv->spill_costs); } #endif @@ -115,7 +115,7 @@ mono_linear_scan (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_ma vmv = (MonoMethodVar *)l->data; #ifdef DEBUG_LSCAN - printf ("START %2d %08x %08x\n", vmv->idx, vmv->range.first_use.abs_pos, + printf ("START %2d %08x %08x\n", vmv->idx, vmv->range.first_use.abs_pos, vmv->range.last_use.abs_pos); #endif /* expire old intervals in active */ @@ -127,7 +127,7 @@ mono_linear_scan (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_ma break; #ifdef DEBUG_LSCAN - printf ("EXPIR %2d %08x %08x C%d R%d\n", amv->idx, amv->range.first_use.abs_pos, + printf ("EXPIR %2d %08x %08x C%d R%d\n", amv->idx, amv->range.first_use.abs_pos, amv->range.last_use.abs_pos, amv->spill_costs, amv->reg); #endif active = g_list_delete_link (active, active); @@ -142,25 +142,25 @@ mono_linear_scan (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_ma a = g_list_nth (active, max_regs - 1); amv = (MonoMethodVar *)a->data; - if ((cost_driven && amv->spill_costs < vmv->spill_costs) || + if ((cost_driven && amv->spill_costs < vmv->spill_costs) || (!cost_driven && amv->range.last_use.abs_pos > vmv->range.last_use.abs_pos)) { vmv->reg = amv->reg; amv->reg = -1; active = g_list_delete_link (active, a); if (cost_driven) - active = mono_varlist_insert_sorted (cfg, active, vmv, 2); + active = mono_varlist_insert_sorted (cfg, active, vmv, 2); else - active = mono_varlist_insert_sorted (cfg, active, vmv, 1); + active = mono_varlist_insert_sorted (cfg, active, vmv, 1); #ifdef DEBUG_LSCAN - printf ("SPILL0 %2d %08x %08x C%d\n", amv->idx, + printf ("SPILL0 %2d %08x %08x C%d\n", amv->idx, amv->range.first_use.abs_pos, amv->range.last_use.abs_pos, amv->spill_costs); #endif } else { #ifdef DEBUG_LSCAN - printf ("SPILL1 %2d %08x %08x C%d\n", vmv->idx, + printf ("SPILL1 %2d %08x %08x C%d\n", vmv->idx, vmv->range.first_use.abs_pos, vmv->range.last_use.abs_pos, vmv->spill_costs); #endif @@ -178,33 +178,33 @@ mono_linear_scan (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_ma regs = g_list_delete_link (regs, regs); #ifdef DEBUG_LSCAN - printf ("ADD %2d %08x %08x C%d R%d\n", vmv->idx, - vmv->range.first_use.abs_pos, vmv->range.last_use.abs_pos, + printf ("ADD %2d %08x %08x C%d R%d\n", vmv->idx, + vmv->range.first_use.abs_pos, vmv->range.last_use.abs_pos, vmv->spill_costs, vmv->reg); #endif - active = mono_varlist_insert_sorted (cfg, active, vmv, TRUE); + active = mono_varlist_insert_sorted (cfg, active, vmv, TRUE); } #ifdef DEBUG_LSCAN for (a = active; a; a = a->next) { - amv = (MonoMethodVar *)a->data; - printf ("ACT %2d %08x %08x C%d R%d\n", amv->idx, amv->range.first_use.abs_pos, + amv = (MonoMethodVar *)a->data; + printf ("ACT %2d %08x %08x C%d R%d\n", amv->idx, amv->range.first_use.abs_pos, amv->range.last_use.abs_pos, amv->spill_costs, amv->reg); } printf ("NEXT\n"); #endif - } + } for (a = active; a; a = a->next) { - amv = (MonoMethodVar *)a->data; + amv = (MonoMethodVar *)a->data; gains [amv->reg] += amv->spill_costs; } n_regvars = 0; for (l = vars; l; l = l->next) { vmv = (MonoMethodVar *)l->data; - + if (vmv->reg >= 0) { if ((gains [vmv->reg] > mono_arch_regalloc_cost (cfg, vmv)) && (cfg->varinfo [vmv->idx]->opcode != OP_REGVAR)) { if (cfg->verbose_level > 2) { @@ -232,7 +232,7 @@ mono_linear_scan (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_ma used_regs = 0; for (l = vars; l; l = l->next) { vmv = (MonoMethodVar *)l->data; - + if (vmv->reg >= 0) used_regs |= 1LL << vmv->reg; } @@ -293,7 +293,7 @@ mono_linear_scan2 (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_m for (l = vars; l; l = l->next) { vmv = (MonoMethodVar *)l->data; - LSCAN_DEBUG (printf ("VAR R%d %08x %08x C%d\n", cfg->varinfo [vmv->idx]->dreg, vmv->range.first_use.abs_pos, + LSCAN_DEBUG (printf ("VAR R%d %08x %08x C%d\n", cfg->varinfo [vmv->idx]->dreg, vmv->range.first_use.abs_pos, vmv->range.last_use.abs_pos, vmv->spill_costs)); } @@ -318,7 +318,7 @@ mono_linear_scan2 (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_m if (!current->interval->range) continue; - + pos = current->interval->range->from; /* Check for intervals in active which expired or inactive */ @@ -414,7 +414,7 @@ mono_linear_scan2 (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_m gains [current->reg] += current->spill_costs; } else { - /* + /* * free_pos [reg] > 0 means there is a register available for parts * of the interval, so splitting it is possible. This is not yet * supported, so we spill in this case too. @@ -427,7 +427,7 @@ mono_linear_scan2 (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_m if (active) { GList *min_spill_pos; #if 0 - /* + /* * This favors registers with big spill costs, thus larger liveness ranges, * thus actually leading to worse code size. */ @@ -503,7 +503,7 @@ mono_linear_scan2 (MonoCompile *cfg, GList *vars, GList *regs, regmask_t *used_m used_regs = 0; for (l = vars; l; l = l->next) { vmv = (MonoMethodVar *)l->data; - + if (vmv->reg >= 0) used_regs |= 1LL << vmv->reg; } diff --git a/src/mono/mono/mini/method-to-ir.c b/src/mono/mono/mini/method-to-ir.c index 9e5d8e42bde580..8ea45f63791c3a 100644 --- a/src/mono/mono/mini/method-to-ir.c +++ b/src/mono/mono/mini/method-to-ir.c @@ -5680,12 +5680,17 @@ handle_constrained_call (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignat gboolean constrained_is_generic_param = m_class_get_byval_arg (constrained_class)->type == MONO_TYPE_VAR || m_class_get_byval_arg (constrained_class)->type == MONO_TYPE_MVAR; + MonoType *gshared_constraint = NULL; if (constrained_is_generic_param && cfg->gshared) { if (!mini_is_gsharedvt_klass (constrained_class)) { g_assert (!m_class_is_valuetype (cmethod->klass)); if (!mini_type_is_reference (m_class_get_byval_arg (constrained_class))) constrained_partial_call = TRUE; + + MonoType *t = m_class_get_byval_arg (constrained_class); + MonoGenericParam *gparam = t->data.generic_param; + gshared_constraint = gparam->gshared_constraint; } } @@ -5727,6 +5732,24 @@ handle_constrained_call (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignat need_box = FALSE; } + if (gshared_constraint && MONO_TYPE_IS_PRIMITIVE (gshared_constraint) && cmethod->klass == mono_defaults.object_class && + !strcmp (cmethod->name, "GetHashCode")) { + /* + * The receiver is constrained to a primitive type or an enum with the same basetype. + * Enum.GetHashCode () returns the hash code of the underlying type (see comments in Enum.cs), + * so the constrained call can be replaced with a normal call to the basetype GetHashCode () + * method. + */ + MonoClass *gshared_constraint_class = mono_class_from_mono_type_internal (gshared_constraint); + cmethod = get_method_nofail (gshared_constraint_class, cmethod->name, 0, 0); + g_assert (cmethod); + *ref_cmethod = cmethod; + *ref_virtual = FALSE; + if (cfg->verbose_level) + printf (" -> %s\n", mono_method_get_full_name (cmethod)); + return NULL; + } + if (!(cmethod->flags & METHOD_ATTRIBUTE_VIRTUAL) && (cmethod->klass == mono_defaults.object_class || cmethod->klass == m_class_get_parent (mono_defaults.enum_class) || cmethod->klass == mono_defaults.enum_class)) { /* The called method is not virtual, i.e. Object:GetType (), the receiver is a vtype, has to box */ EMIT_NEW_LOAD_MEMBASE_TYPE (cfg, ins, m_class_get_byval_arg (constrained_class), sp [0]->dreg, 0); diff --git a/src/mono/mono/mini/mini-amd64.h b/src/mono/mono/mini/mini-amd64.h index 2c3e8a009beaca..5528a7b03039f2 100644 --- a/src/mono/mono/mini/mini-amd64.h +++ b/src/mono/mono/mini/mini-amd64.h @@ -176,12 +176,12 @@ struct sigcontext { #define MONO_ARCH_FRAME_ALIGNMENT 16 -/* fixme: align to 16byte instead of 32byte (we align to 32byte to get +/* fixme: align to 16byte instead of 32byte (we align to 32byte to get * reproduceable results for benchmarks */ #define MONO_ARCH_CODE_ALIGNMENT 32 struct MonoLMF { - /* + /* * The rsp field points to the stack location where the caller ip is saved. * If the second lowest bit is set, then this is a MonoLMFExt structure, and * the other fields are not valid. @@ -364,7 +364,7 @@ typedef struct { #else -/* +/* * __builtin_frame_address () is broken on some older gcc versions in the presence of * frame pointer elimination, see bug #82095. */ @@ -500,7 +500,7 @@ typedef struct { // can pass context to generics or interfaces? #define MONO_ARCH_HAVE_VOLATILE_NON_PARAM_REGISTER 1 -void +void mono_amd64_patch (unsigned char* code, gpointer target); void @@ -644,5 +644,5 @@ mono_arch_unwindinfo_validate_size (GSList *unwind_ops, guint max_size) CallInfo* mono_arch_get_call_info (MonoMemPool *mp, MonoMethodSignature *sig); -#endif /* __MONO_MINI_AMD64_H__ */ +#endif /* __MONO_MINI_AMD64_H__ */ diff --git a/src/mono/mono/mini/mini-generic-sharing.c b/src/mono/mono/mini/mini-generic-sharing.c index 69e0a16debf72b..e69da90cfb055f 100644 --- a/src/mono/mono/mini/mini-generic-sharing.c +++ b/src/mono/mono/mini/mini-generic-sharing.c @@ -3324,6 +3324,16 @@ mono_generic_context_is_sharable (MonoGenericContext *context, gboolean allow_ty return mono_generic_context_is_sharable_full (context, allow_type_vars, partial_sharing_supported ()); } +static gboolean +is_primitive_inst (MonoGenericInst *inst) +{ + for (int i = 0; i < inst->type_argc; ++i) { + if (!MONO_TYPE_IS_PRIMITIVE (inst->type_argv [i])) + return FALSE; + } + return TRUE; +} + /* * mono_method_is_generic_impl: * @method: a method @@ -3350,18 +3360,45 @@ mono_method_is_generic_impl (MonoMethod *method) static gboolean has_constraints (MonoGenericContainer *container) { - //int i; + int i; - return FALSE; - /* g_assert (container->type_argc > 0); g_assert (container->type_params); for (i = 0; i < container->type_argc; ++i) - if (container->type_params [i].constraints) + if (container->type_params [i].info.constraints) return TRUE; return FALSE; - */ +} + +/* + * Return whenever GPARAM can be instantiated with an enum. + */ +static gboolean +gparam_can_be_enum (MonoGenericParam *gparam) +{ + if (!gparam->info.constraints) + return TRUE; + /* + * If a constraint is an interface which is not implemented by Enum, then the gparam can't be + * instantiated with an enum. + */ + for (int cindex = 0; gparam->info.constraints [cindex]; cindex ++) { + MonoClass *k = gparam->info.constraints [cindex]; + if (MONO_CLASS_IS_INTERFACE_INTERNAL (k)) { + MonoClass **enum_ifaces = m_class_get_interfaces (mono_defaults.enum_class); + gboolean is_enum_iface = FALSE; + for (int i = 0; i < m_class_get_interface_count (mono_defaults.enum_class); i++) { + if (k == enum_ifaces [i]) { + is_enum_iface = TRUE; + break; + } + } + if (!is_enum_iface) + return FALSE; + } + } + return TRUE; } static gboolean @@ -3488,21 +3525,39 @@ mono_method_is_generic_sharable_full (MonoMethod *method, gboolean allow_type_va g_assert (inflated->declaring); +#if FALSE if (inflated->declaring->is_generic) { - if (has_constraints (mono_method_get_generic_container (inflated->declaring))) - return FALSE; + if (has_constraints (mono_method_get_generic_container (inflated->declaring))) { + } } +#endif } if (mono_class_is_ginst (method->klass)) { - if (!mono_generic_context_is_sharable_full (&mono_class_get_generic_class (method->klass)->context, allow_type_vars, allow_partial)) + MonoGenericContext *ctx = &mono_class_get_generic_class (method->klass)->context; + if (!mono_generic_context_is_sharable_full (ctx, allow_type_vars, allow_partial)) return FALSE; g_assert (mono_class_get_generic_class (method->klass)->container_class && mono_class_is_gtd (mono_class_get_generic_class (method->klass)->container_class)); - if (has_constraints (mono_class_get_generic_container (mono_class_get_generic_class (method->klass)->container_class))) - return FALSE; + /* + * If all the parameters are primitive types and constraints prevent + * them from being instantiated with enums, then only the primitive + * type instantiation is possible, thus sharing is not useful. + * Happens with generic math interfaces. + */ + if ((!ctx->class_inst || is_primitive_inst (ctx->class_inst)) && + (!ctx->method_inst || is_primitive_inst (ctx->method_inst))) { + MonoGenericContainer *container = mono_class_get_generic_container (mono_class_get_generic_class (method->klass)->container_class); + if (has_constraints (container)) { + g_assert (ctx->class_inst->type_argc == container->type_argc); + for (int i = 0; i < container->type_argc; ++i) { + if (!gparam_can_be_enum (&container->type_params [i])) + return FALSE; + } + } + } } if (mono_class_is_gtd (method->klass) && !allow_type_vars) diff --git a/src/mono/mono/mini/mini-llvm.c b/src/mono/mono/mini/mini-llvm.c index 2b8e07dfb3745a..84573c71d9c305 100644 --- a/src/mono/mono/mini/mini-llvm.c +++ b/src/mono/mono/mini/mini-llvm.c @@ -125,7 +125,7 @@ typedef struct { LLVMBasicBlockRef bblock, end_bblock; LLVMValueRef finally_ind; gboolean added, invoke_target; - /* + /* * If this bblock is the start of a finally clause, this is a list of bblocks it * needs to branch to in ENDFINALLY. */ @@ -780,7 +780,7 @@ type_to_llvm_type (EmitContext *ctx, MonoType *t) case MONO_TYPE_U4: return LLVMPointerType (type_to_llvm_type (ctx, ptr_type), 0); } - + return ObjRefType (); } case MONO_TYPE_VAR: @@ -869,7 +869,7 @@ type_to_llvm_arg_type (EmitContext *ctx, MonoType *t) */ #ifndef TARGET_ARM64 if (ptype == LLVMInt8Type () || ptype == LLVMInt16Type ()) { - /* + /* * LLVM generates code which only sets the lower bits, while JITted * code expects all the bits to be set. */ @@ -904,7 +904,7 @@ llvm_type_to_stack_type (MonoCompile *cfg, LLVMTypeRef type) /* * regtype_to_llvm_type: * - * Return the LLVM type corresponding to the regtype C used in instruction + * Return the LLVM type corresponding to the regtype C used in instruction * descriptions. */ static LLVMTypeRef @@ -999,7 +999,7 @@ op_to_llvm_type (int opcode) g_assert_not_reached (); return NULL; } -} +} #define CLAUSE_START(clause) ((clause)->try_offset) #define CLAUSE_END(clause) (((clause))->try_offset + ((clause))->try_len) @@ -1267,7 +1267,7 @@ get_bb (EmitContext *ctx, MonoBasicBlock *bb) return ctx->bblocks [bb->block_num].bblock; } -/* +/* * get_end_bb: * * Return the last LLVM bblock corresponding to BB. @@ -1415,8 +1415,8 @@ emit_volatile_load (EmitContext *ctx, int vreg) v = mono_llvm_build_load (ctx->builder, ctx->addresses [vreg], "", TRUE); t = ctx->vreg_cli_types [vreg]; if (t && !m_type_is_byref (t)) { - /* - * Might have to zero extend since llvm doesn't have + /* + * Might have to zero extend since llvm doesn't have * unsigned types. */ if (t->type == MONO_TYPE_U1 || t->type == MONO_TYPE_U2 || t->type == MONO_TYPE_CHAR || t->type == MONO_TYPE_BOOLEAN) @@ -1618,7 +1618,7 @@ sig_to_llvm_sig_full (EmitContext *ctx, MonoMethodSignature *sig, LLVMCallInfo * } cinfo->vret_arg_pindex = vret_arg_pindex; - } + } if (vretaddr && vret_arg_pindex == pindex) param_types [pindex ++] = IntPtrType (); @@ -1744,7 +1744,7 @@ LLVMFunctionType0 (LLVMTypeRef ReturnType, * * Create an LLVM function type from the arguments. */ -static G_GNUC_UNUSED LLVMTypeRef +static G_GNUC_UNUSED LLVMTypeRef LLVMFunctionType1 (LLVMTypeRef ReturnType, LLVMTypeRef ParamType1, int IsVarArg) @@ -2001,7 +2001,7 @@ get_aotconst (EmitContext *ctx, MonoJumpInfoType type, gconstpointer data, LLVMT ji->next = cfg->patch_info; cfg->patch_info = ji; - /* + /* * If the got slot is shared, it means its initialized when the aot image is loaded, so we don't need to * explicitly initialize it. */ @@ -2267,7 +2267,7 @@ get_handler_clause (MonoCompile *cfg, MonoBasicBlock *bb) /* Indirectly */ for (i = 0; i < header->num_clauses; ++i) { clause = &header->clauses [i]; - + if (MONO_OFFSET_IN_CLAUSE (clause, bb->real_offset) && clause->flags == MONO_EXCEPTION_CLAUSE_NONE) return i; } @@ -2291,7 +2291,7 @@ get_most_deep_clause (MonoCompile *cfg, EmitContext *ctx, MonoBasicBlock *bb) return NULL; } - + static void set_metadata_flag (LLVMValueRef v, const char *flag_name) { @@ -2421,7 +2421,7 @@ emit_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref, LL ctx->bblocks [bb->block_num].end_bblock = noex_bb; } } - + if (!lcall) { lcall = LLVMBuildCall (builder, callee, args, pindex, ""); ctx->builder = builder; @@ -2438,7 +2438,7 @@ emit_load (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref, in { LLVMValueRef res; - /* + /* * We emit volatile loads for loads which can fault, because otherwise * LLVM will generate invalid code when encountering a load from a * NULL address. @@ -2491,7 +2491,7 @@ emit_cond_system_exception (EmitContext *ctx, MonoBasicBlock *bb, const char *ex if (!exc_classes [exc_id]) exc_classes [exc_id] = mono_class_load_from_name (mono_get_corlib (), "System", exc_type); exc_class = exc_classes [exc_id]; - + ex_bb = gen_bb (ctx, "EX_BB"); if (ctx->llvm_only) ex2_bb = gen_bb (ctx, "EX2_BB"); @@ -2563,7 +2563,7 @@ emit_cond_system_exception (EmitContext *ctx, MonoBasicBlock *bb, const char *ex callee = get_jit_callee (ctx, "llvm_throw_corlib_exception_trampoline", sig, MONO_PATCH_INFO_JIT_ICALL_ID, GUINT_TO_POINTER (icall_id)); /* - * Make sure that ex_bb starts with the invoke, so the block address points to it, and not to the load + * Make sure that ex_bb starts with the invoke, so the block address points to it, and not to the load * added by get_jit_callee (). */ ex2_bb = gen_bb (ctx, "EX2_BB"); @@ -2827,7 +2827,7 @@ emit_llvm_used (MonoLLVMModule *module) LLVMTypeRef used_type; LLVMValueRef used, *used_elem; int i; - + if (!module->used) return; @@ -4291,7 +4291,7 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref, } } - /* + /* * Collect and convert arguments */ nargs = (sig->param_count * 16) + sig->hasthis + vretaddr + call->rgctx_reg + call->imt_arg_reg + call->cinfo->dummy_arg + 1; @@ -4622,7 +4622,7 @@ emit_throw (EmitContext *ctx, MonoBasicBlock *bb, gboolean rethrow, LLVMValueRef callee = get_callee (ctx, sig_to_llvm_sig (ctx, throw_sig), MONO_PATCH_INFO_JIT_ICALL_ID, GUINT_TO_POINTER (icall_id)); } else { #ifdef TARGET_X86 - /* + /* * LLVM doesn't push the exception argument, so we need a different * trampoline. */ @@ -5678,7 +5678,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) has_terminator = TRUE; g_assert (!ins->next); - + break; } @@ -5976,12 +5976,12 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) case OP_FMOVE: case OP_RMOVE: { MonoInst *var = get_vreg_to_inst (cfg, ins->dreg); - + g_assert (lhs); values [ins->dreg] = lhs; if (var && m_class_get_byval_arg (var->klass)->type == MONO_TYPE_R4) { - /* + /* * This is added by the spilling pass in case of the JIT, * but we have to do it ourselves. */ @@ -6452,7 +6452,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) } case OP_LOCALLOC: { LLVMValueRef v, size; - + size = LLVMBuildAnd (builder, LLVMBuildAdd (builder, convert (ctx, lhs, LLVMInt32Type ()), LLVMConstInt (LLVMInt32Type (), MONO_ARCH_FRAME_ALIGNMENT - 1, FALSE), ""), LLVMConstInt (LLVMInt32Type (), ~ (MONO_ARCH_FRAME_ALIGNMENT - 1), FALSE), ""); v = mono_llvm_build_alloca (builder, LLVMInt8Type (), size, MONO_ARCH_FRAME_ALIGNMENT, ""); @@ -6688,7 +6688,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) /* Might have instructions after this */ while (ins->next) { MonoInst *next = ins->next; - /* + /* * FIXME: If later code uses the regs defined by these instructions, * compilation will fail. */ @@ -6696,7 +6696,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) if (spec [MONO_INST_DEST] == 'i' && !MONO_IS_STORE_MEMBASE (next)) ctx->values [next->dreg] = LLVMConstNull (LLVMInt32Type ()); MONO_DELETE_INS (bb, next); - } + } break; case OP_LDADDR: { MonoInst *var = ins->inst_i0; @@ -6851,7 +6851,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) args [0] = convert (ctx, values [ins->sreg1], LLVMDoubleType ()); args [1] = convert (ctx, values [ins->sreg2], LLVMDoubleType ()); args [2] = convert (ctx, values [ins->sreg3], LLVMDoubleType ()); - + values [ins->dreg] = call_intrins (ctx, INTRINS_FMA, args, dname); break; } @@ -6861,7 +6861,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) args [0] = convert (ctx, values [ins->sreg1], LLVMFloatType ()); args [1] = convert (ctx, values [ins->sreg2], LLVMFloatType ()); args [2] = convert (ctx, values [ins->sreg3], LLVMFloatType ()); - + values [ins->dreg] = call_intrins (ctx, INTRINS_FMAF, args, dname); break; } @@ -6983,7 +6983,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) case OP_ATOMIC_EXCHANGE_I8: { LLVMValueRef args [2]; LLVMTypeRef t; - + if (ins->opcode == OP_ATOMIC_EXCHANGE_I4) t = LLVMInt32Type (); else @@ -7035,7 +7035,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) case OP_ATOMIC_CAS_I8: { LLVMValueRef args [3], val; LLVMTypeRef t; - + if (ins->opcode == OP_ATOMIC_CAS_I4) t = LLVMInt32Type (); else @@ -7254,10 +7254,10 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) break; } - /* + /* * Valuetypes. - * We currently model them using arrays. Promotion to local vregs is - * disabled for them in mono_handle_global_vregs () in the LLVM case, + * We currently model them using arrays. Promotion to local vregs is + * disabled for them in mono_handle_global_vregs () in the LLVM case, * so we always have an entry in cfg->varinfo for them. * FIXME: Is this needed ? */ @@ -8007,7 +8007,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) LLVMValueRef v1 = NULL, v2 = NULL, mask_values [16]; int i, mask_size = 0; int imask = ins->inst_c0; - + /* Convert the x86 shuffle mask to LLVM's */ switch (ins->opcode) { case OP_SHUFPS: @@ -8141,7 +8141,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) for (i = 0; i < mask_size; ++i) mask_values [i] = LLVMConstInt (LLVMInt32Type (), mask [i], FALSE); - + values [ins->dreg] = LLVMBuildShuffleVector (builder, values [ins->sreg1], values [ins->sreg2], LLVMConstVector (mask_values, mask_size), dname); @@ -8164,7 +8164,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) case OP_DUPPS_HIGH: { LLVMTypeRef t = simd_op_to_llvm_type (ins->opcode); LLVMValueRef v1, v2, val; - + if (ins->opcode == OP_DUPPS_LOW) { v1 = LLVMBuildExtractElement (builder, lhs, LLVMConstInt (LLVMInt32Type (), 0, FALSE), ""); @@ -8178,7 +8178,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) val = LLVMBuildInsertElement (builder, val, v1, LLVMConstInt (LLVMInt32Type (), 1, FALSE), ""); val = LLVMBuildInsertElement (builder, val, v2, LLVMConstInt (LLVMInt32Type (), 2, FALSE), ""); val = LLVMBuildInsertElement (builder, val, v2, LLVMConstInt (LLVMInt32Type (), 3, FALSE), ""); - + values [ins->dreg] = val; break; } @@ -8216,8 +8216,8 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) else if (ins->inst_c1 == MONO_TYPE_R8) values [ins->dreg] = LLVMBuildShuffleVector (builder, rhs, lhs, create_const_vector_2_i32 (0, 3), ""); else if (ins->inst_c1 == MONO_TYPE_I8 || ins->inst_c1 == MONO_TYPE_U8) - values [ins->dreg] = LLVMBuildInsertElement (builder, lhs, - LLVMConstInt (LLVMInt64Type (), 0, FALSE), + values [ins->dreg] = LLVMBuildInsertElement (builder, lhs, + LLVMConstInt (LLVMInt64Type (), 0, FALSE), LLVMConstInt (LLVMInt32Type (), 1, FALSE), ""); else g_assert_not_reached (); // will be needed for other types later @@ -8247,14 +8247,14 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) values [ins->dreg] = LLVMBuildShuffleVector (builder, lhs, rhs, create_const_vector_4_i32 (0, 4, 1, 5), ""); } else if (ins->inst_c1 == MONO_TYPE_I2 || ins->inst_c1 == MONO_TYPE_U2) { const int mask_values [] = { 0, 8, 1, 9, 2, 10, 3, 11 }; - LLVMValueRef shuffled = LLVMBuildShuffleVector (builder, + LLVMValueRef shuffled = LLVMBuildShuffleVector (builder, convert (ctx, lhs, sse_i2_t), convert (ctx, rhs, sse_i2_t), create_const_vector_i32 (mask_values, 8), ""); values [ins->dreg] = convert (ctx, shuffled, type_to_sse_type (ins->inst_c1)); } else if (ins->inst_c1 == MONO_TYPE_I1 || ins->inst_c1 == MONO_TYPE_U1) { const int mask_values [] = { 0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23 }; - LLVMValueRef shuffled = LLVMBuildShuffleVector (builder, + LLVMValueRef shuffled = LLVMBuildShuffleVector (builder, convert (ctx, lhs, sse_i1_t), convert (ctx, rhs, sse_i1_t), create_const_vector_i32 (mask_values, 16), ""); @@ -8272,14 +8272,14 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) values [ins->dreg] = LLVMBuildShuffleVector (builder, lhs, rhs, create_const_vector_4_i32 (2, 6, 3, 7), ""); } else if (ins->inst_c1 == MONO_TYPE_I2 || ins->inst_c1 == MONO_TYPE_U2) { const int mask_values [] = { 4, 12, 5, 13, 6, 14, 7, 15 }; - LLVMValueRef shuffled = LLVMBuildShuffleVector (builder, + LLVMValueRef shuffled = LLVMBuildShuffleVector (builder, convert (ctx, lhs, sse_i2_t), convert (ctx, rhs, sse_i2_t), create_const_vector_i32 (mask_values, 8), ""); values [ins->dreg] = convert (ctx, shuffled, type_to_sse_type (ins->inst_c1)); } else if (ins->inst_c1 == MONO_TYPE_I1 || ins->inst_c1 == MONO_TYPE_U1) { const int mask_values [] = { 8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31 }; - LLVMValueRef shuffled = LLVMBuildShuffleVector (builder, + LLVMValueRef shuffled = LLVMBuildShuffleVector (builder, convert (ctx, lhs, sse_i1_t), convert (ctx, rhs, sse_i1_t), create_const_vector_i32 (mask_values, 16), ""); @@ -8675,7 +8675,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) args [0] = convert (ctx, args [0], sse_i8_t); args [1] = convert (ctx, args [1], sse_i8_t); } - + LLVMValueRef call = call_intrins (ctx, id, args, ""); if (ret_bool) { // if return type is bool (it's still i32) we need to normalize it to 1/0 @@ -8751,7 +8751,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) LLVMValueRef args [2]; args [0] = convert (ctx, lhs, sse_i2_t); args [1] = convert (ctx, rhs, sse_i2_t); - values [ins->dreg] = convert (ctx, + values [ins->dreg] = convert (ctx, call_intrins (ctx, INTRINS_SSE_PACKUSWB, args, dname), type_to_sse_type (ins->inst_c1)); break; @@ -8759,7 +8759,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) case OP_SSE2_SRLI: { LLVMValueRef args [] = { lhs, rhs }; - values [ins->dreg] = convert (ctx, + values [ins->dreg] = convert (ctx, call_intrins (ctx, INTRINS_SSE_PSRLI_W, args, dname), type_to_sse_type (ins->inst_c1)); break; @@ -9161,7 +9161,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) } case OP_SSE_CVTII: { - gboolean is_signed = (ins->inst_c1 == MONO_TYPE_I1) || + gboolean is_signed = (ins->inst_c1 == MONO_TYPE_I1) || (ins->inst_c1 == MONO_TYPE_I2) || (ins->inst_c1 == MONO_TYPE_I4); LLVMTypeRef vec_type; @@ -9226,12 +9226,12 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) mul_args[i] = mono_llvm_build_exact_ashr (builder, padded, shift_vec); } values [ins->dreg] = LLVMBuildNSWMul (builder, mul_args [0], mul_args [1], dname); - break; + break; } case OP_SSE41_MULLO: { values [ins->dreg] = LLVMBuildMul (ctx->builder, lhs, rhs, ""); - break; + break; } case OP_SSE42_CRC32: @@ -9747,11 +9747,11 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) // %mul = shl i32 %xor, 1 // %add = or i32 %mul, 1 // %0 = tail call i32 @llvm.ctlz.i32(i32 %add, i1 false) - LLVMValueRef shr = LLVMBuildAShr (builder, lhs, ins->opcode == OP_LSCNT32 ? - LLVMConstInt (LLVMInt32Type (), 31, FALSE) : + LLVMValueRef shr = LLVMBuildAShr (builder, lhs, ins->opcode == OP_LSCNT32 ? + LLVMConstInt (LLVMInt32Type (), 31, FALSE) : LLVMConstInt (LLVMInt64Type (), 63, FALSE), ""); - LLVMValueRef one = ins->opcode == OP_LSCNT32 ? - LLVMConstInt (LLVMInt32Type (), 1, FALSE) : + LLVMValueRef one = ins->opcode == OP_LSCNT32 ? + LLVMConstInt (LLVMInt32Type (), 1, FALSE) : LLVMConstInt (LLVMInt64Type (), 1, FALSE); LLVMValueRef xor = LLVMBuildXor (builder, shr, lhs, ""); LLVMValueRef mul = LLVMBuildShl (builder, xor, one, ""); @@ -10892,7 +10892,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) break; } case OP_CALL_HANDLER: { - /* + /* * We don't 'call' handlers, but instead simply branch to them. * The code generated by ENDFINALLY will branch back to us. */ @@ -10902,13 +10902,13 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) bb_list = info->call_handler_return_bbs; - /* + /* * Set the indicator variable for the finally clause. */ lhs = info->finally_ind; g_assert (lhs); LLVMBuildStore (builder, LLVMConstInt (LLVMInt32Type (), g_slist_length (bb_list) + 1, FALSE), lhs); - + /* Branch to the finally clause */ LLVMBuildBr (builder, info->call_handler_target_bb); @@ -11241,7 +11241,7 @@ mono_llvm_emit_method (MonoCompile *cfg) ctx->is_vphi = g_new0 (gboolean, cfg->next_vreg); ctx->vreg_cli_types = g_new0 (MonoType*, cfg->next_vreg); ctx->phi_values = g_ptr_array_sized_new (256); - /* + /* * This signals whenever the vreg was defined by a phi node with no input vars * (i.e. all its input bblocks end with NOT_REACHABLE). */ @@ -11652,7 +11652,7 @@ emit_method_inner (EmitContext *ctx) for (bb = cfg->bb_entry; bb; bb = bb->next_bb) { if (bb->last_ins && MONO_IS_COND_BRANCH_OP (bb->last_ins) && bb->next_bb != bb->last_ins->inst_false_bb) { - + MonoInst *inst = (MonoInst*)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst)); inst->opcode = OP_BR; inst->inst_target_bb = bb->last_ins->inst_false_bb; @@ -11691,7 +11691,7 @@ emit_method_inner (EmitContext *ctx) phi_type = LLVMPointerType (type_to_llvm_type (ctx, m_class_get_byval_arg (ins->klass)), 0); } - /* + /* * Have to precreate these, as they can be referenced by * earlier instructions. */ @@ -11704,13 +11704,13 @@ emit_method_inner (EmitContext *ctx) g_ptr_array_add (ctx->phi_values, values [ins->dreg]); - /* + /* * Set the expected type of the incoming arguments since these have * to have the same type. */ for (i = 0; i < ins->inst_phi_args [0]; i++) { int sreg1 = ins->inst_phi_args [i + 1]; - + if (sreg1 != -1) { if (ins->opcode == OP_VPHI) ctx->is_vphi [sreg1] = TRUE; @@ -11728,7 +11728,7 @@ emit_method_inner (EmitContext *ctx) } } - /* + /* * Create an ordering for bblocks, use the depth first order first, then * put the exception handling bblocks last. */ @@ -12124,7 +12124,7 @@ mono_llvm_emit_call (MonoCompile *cfg, MonoCallInst *call) ainfo = call->cinfo->args + i; in = call->args [i]; - + /* Simply remember the arguments */ switch (ainfo->storage) { case LLVMArgNormal: { @@ -13007,7 +13007,7 @@ mono_llvm_propagate_nonnull_final (GHashTable *all_specializable, MonoLLVMModule { // When we first traverse the mini IL, we mark the things that are // nonnull (the roots). Then, for all of the methods that can be specialized, we - // see if their call sites have nonnull attributes. + // see if their call sites have nonnull attributes. // If so, we mark the function's param. This param has uses to propagate // the attribute to. This propagation can trigger a need to mark more attributes @@ -13049,7 +13049,7 @@ mono_llvm_propagate_nonnull_final (GHashTable *all_specializable, MonoLLVMModule while (queue) { // Update the queue state. - // Our only other per-iteration responsibility is now to free current + // Our only other per-iteration responsibility is now to free current NonnullPropWorkItem *current = (NonnullPropWorkItem *) queue->data; queue = queue->next; g_assert (current->argument < LLVMCountParams (current->lmethod)); @@ -13072,8 +13072,8 @@ mono_llvm_propagate_nonnull_final (GHashTable *all_specializable, MonoLLVMModule LLVMValueRef lcall = (LLVMValueRef) cursor->data; LLVMValueRef callee_lmethod = LLVMGetCalledValue (lcall); - // If this wasn't a direct call for which mono_aot_can_specialize is true, - // this lookup won't find a MonoMethod. + // If this wasn't a direct call for which mono_aot_can_specialize is true, + // this lookup won't find a MonoMethod. MonoMethod *callee_method = (MonoMethod *) g_hash_table_lookup (all_specializable, callee_lmethod); if (!callee_method) continue; @@ -13135,7 +13135,7 @@ mono_llvm_emit_aot_module (const char *filename, const char *cu_name) emit_llvm_code_end (module); - /* + /* * Create the real init_var and replace all uses of the dummy variable with * the real one. */ @@ -13318,7 +13318,7 @@ emit_default_dbg_loc (EmitContext *ctx, LLVMBuilderRef builder) into something we can't handle. */ -/* +/* A partial list of issues: - Handling of opcodes which can throw exceptions. @@ -13336,7 +13336,7 @@ emit_default_dbg_loc (EmitContext *ctx, LLVMBuilderRef builder) in the LLVM IR, since it does not support label values. -> this can be implemented in AOT mode using inline asm + labels, but cannot be implemented in JIT mode ? - -> a possible but slower implementation would use the normal exception + -> a possible but slower implementation would use the normal exception throwing code but it would need to control the placement of the throw code (it needs to be exactly after the compare+branch). -> perhaps add a PC offset intrinsics ? @@ -13350,7 +13350,7 @@ emit_default_dbg_loc (EmitContext *ctx, LLVMBuilderRef builder) Some overflow opcodes are now supported by LLVM SVN. - exception handling, unwinding. - - SSA is disabled for methods with exception handlers + - SSA is disabled for methods with exception handlers - How to obtain unwind info for LLVM compiled methods ? -> this is now solved by converting the unwind info generated by LLVM into our format. @@ -13360,21 +13360,21 @@ emit_default_dbg_loc (EmitContext *ctx, LLVMBuilderRef builder) - it might be impossible to support filter clauses with it. - trampolines. - + The trampolines need a predictable call sequence, since they need to disasm the calling code to obtain register numbers / offsets. LLVM currently generates this code in non-JIT mode: mov -0x98(%rax),%eax callq *%rax - Here, the vtable pointer is lost. + Here, the vtable pointer is lost. -> solution: use one vtable trampoline per class. - passing/receiving the IMT pointer/RGCTX. -> solution: pass them as normal arguments ? - argument passing. - + LLVM does not allow the specification of argument registers etc. This means that all calls are made according to the platform ABI. @@ -13395,7 +13395,7 @@ emit_default_dbg_loc (EmitContext *ctx, LLVMBuilderRef builder) The mono JIT uses pointer sized iregs/double fregs, while LLVM uses precisely typed registers, so we have to keep track of the precise LLVM type of each vreg. This is made easier because the IR is already in SSA form. - An additional problem is that our IR is not consistent with types, i.e. i32/i64 + An additional problem is that our IR is not consistent with types, i.e. i32/i64 types are frequently used incorrectly. */ @@ -13571,7 +13571,7 @@ llvm_jit_finalize_method (EmitContext *ctx) { MonoCompile *cfg = ctx->cfg; int nvars = g_hash_table_size (ctx->jit_callees); - LLVMValueRef *callee_vars = g_new0 (LLVMValueRef, nvars); + LLVMValueRef *callee_vars = g_new0 (LLVMValueRef, nvars); gpointer *callee_addrs = g_new0 (gpointer, nvars); GHashTableIter iter; LLVMValueRef var; diff --git a/src/mono/mono/mini/mini-windows.c b/src/mono/mono/mini/mini-windows.c index 87de60ea9b5684..c678f4c4594c45 100644 --- a/src/mono/mono/mini/mini-windows.c +++ b/src/mono/mono/mini/mini-windows.c @@ -55,10 +55,9 @@ #include "jit-icalls.h" #define MONO_HANDLER_DELIMITER ',' -#define MONO_HANDLER_DELIMITER_LEN G_N_ELEMENTS(MONO_HANDLER_DELIMITER)-1 #define MONO_HANDLER_ATEXIT_WAIT_KEYPRESS "atexit-waitkeypress" -#define MONO_HANDLER_ATEXIT_WAIT_KEYPRESS_LEN G_N_ELEMENTS(MONO_HANDLER_ATEXIT_WAIT_KEYPRESS)-1 +#define MONO_HANDLER_ATEXIT_WAIT_KEYPRESS_LEN STRING_LENGTH(MONO_HANDLER_ATEXIT_WAIT_KEYPRESS) // Typedefs used to setup handler table. typedef void (*handler)(void); diff --git a/src/mono/mono/mini/mini.c b/src/mono/mono/mini/mini.c index 0ad288fd0fca4c..c9486dce45c48d 100644 --- a/src/mono/mono/mini/mini.c +++ b/src/mono/mono/mini/mini.c @@ -3403,7 +3403,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts for (i = 0; verbose_method_names [i] != NULL; i++){ const char *name = verbose_method_names [i]; - if ((strchr (name, '.') > name) || strchr (name, ':')) { + if ((strchr (name, '.') > name) || strchr (name, ':') || strchr (name, '*')) { MonoMethodDesc *desc; desc = mono_method_desc_new (name, TRUE); diff --git a/src/mono/mono/mini/ssa.c b/src/mono/mono/mini/ssa.c index c91851baee5973..47579c57e12855 100644 --- a/src/mono/mono/mini/ssa.c +++ b/src/mono/mono/mini/ssa.c @@ -159,24 +159,47 @@ typedef struct { int idx; } RenameInfo; -/** - * mono_ssa_rename_vars: - * Implement renaming of SSA variables. Also compute def-use information in parallel. - * \p stack_history points to an area of memory which can be used for storing changes - * made to the stack, so they can be reverted later. - */ static void -mono_ssa_rename_vars (MonoCompile *cfg, int max_vars, MonoBasicBlock *bb, gboolean *originals_used, MonoInst **stack, guint32 *lvreg_stack, gboolean *lvreg_defined, RenameInfo *stack_history, int stack_history_size) +rename_phi_arguments_in_out_bbs(MonoCompile *cfg, MonoBasicBlock *bb, MonoInst **stack) { MonoInst *ins, *new_var; - int i, j, idx; - GSList *tmp; - int stack_history_len = 0; + int i, j; - if (cfg->verbose_level >= 4) - printf ("\nRENAME VARS BLOCK %d:\n", bb->block_num); + for (i = 0; i < bb->out_count; i++) { + MonoBasicBlock *n = bb->out_bb [i]; + + for (j = 0; j < n->in_count; j++) + if (n->in_bb [j] == bb) + break; + + for (ins = n->code; ins; ins = ins->next) { + if (MONO_IS_PHI (ins)) { + int idx = ins->inst_c0; + if (stack [idx]) + new_var = stack [idx]; + else + new_var = cfg->varinfo [idx]; +#ifdef DEBUG_SSA + printf ("FOUND PHI %d (%d, %d)\n", idx, j, new_var->inst_c0); +#endif + ins->inst_phi_args [j + 1] = new_var->dreg; + record_use (cfg, new_var, n, ins); + if (G_UNLIKELY (cfg->verbose_level >= 4)) + printf ("\tAdd PHI R%d <- R%d to BB%d\n", ins->dreg, new_var->dreg, n->block_num); + } + else + /* The phi nodes are at the beginning of the bblock */ + break; + } + } +} + +static int +create_new_vars (MonoCompile *cfg, int max_vars, MonoBasicBlock *bb, gboolean *originals_used, MonoInst **stack, guint32 *lvreg_stack, gboolean *lvreg_defined, RenameInfo **stack_history, int *stack_history_size) +{ + MonoInst *ins, *new_var; + int i, stack_history_len = 0; - /* First pass: Create new vars */ for (ins = bb->code; ins; ins = ins->next) { const char *spec = INS_INFO (ins->opcode); int num_sregs; @@ -233,21 +256,21 @@ mono_ssa_rename_vars (MonoCompile *cfg, int max_vars, MonoBasicBlock *bb, gboole MonoMethodVar *info; if (var && !(var->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT))) { - idx = var->inst_c0; + int idx = var->inst_c0; g_assert (idx < max_vars); if (var->opcode == OP_ARG) originals_used [idx] = TRUE; - if (stack_history_len + 128 > stack_history_size) { - stack_history_size += 1024; - RenameInfo *new_history = mono_mempool_alloc (cfg->mempool, sizeof (RenameInfo) * stack_history_size); - memcpy (new_history, stack_history, stack_history_len * sizeof (RenameInfo)); - stack_history = new_history; + if (stack_history_len + 128 > *stack_history_size) { + *stack_history_size += 1024; + RenameInfo *new_history = mono_mempool_alloc (cfg->mempool, sizeof (RenameInfo) * *stack_history_size); + memcpy (new_history, *stack_history, stack_history_len * sizeof (RenameInfo)); + *stack_history = new_history; } - stack_history [stack_history_len].var = stack [idx]; - stack_history [stack_history_len].idx = idx; + (*stack_history) [stack_history_len].var = stack [idx]; + (*stack_history) [stack_history_len].idx = idx; stack_history_len ++; if (originals_used [idx]) { @@ -284,49 +307,102 @@ mono_ssa_rename_vars (MonoCompile *cfg, int max_vars, MonoBasicBlock *bb, gboole #ifdef DEBUG_SSA printf ("\tAfter processing "); mono_print_ins (ins); #endif + } + + return stack_history_len; +} +static void +restore_stack (MonoInst **stack, RenameInfo *stack_history, int stack_history_len) +{ + int i = stack_history_len; + while (i-- > 0) { + stack [stack_history [i].idx] = stack_history [i].var; } +} - /* Rename PHI arguments in succeeding bblocks */ - for (i = 0; i < bb->out_count; i++) { - MonoBasicBlock *n = bb->out_bb [i]; +typedef struct { + GSList *blocks; + RenameInfo *history; + int size; + int len; +} RenameStackInfo; - for (j = 0; j < n->in_count; j++) - if (n->in_bb [j] == bb) - break; - - for (ins = n->code; ins; ins = ins->next) { - if (MONO_IS_PHI (ins)) { - idx = ins->inst_c0; - if (stack [idx]) - new_var = stack [idx]; - else - new_var = cfg->varinfo [idx]; -#ifdef DEBUG_SSA - printf ("FOUND PHI %d (%d, %d)\n", idx, j, new_var->inst_c0); -#endif - ins->inst_phi_args [j + 1] = new_var->dreg; - record_use (cfg, new_var, n, ins); - if (G_UNLIKELY (cfg->verbose_level >= 4)) - printf ("\tAdd PHI R%d <- R%d to BB%d\n", ins->dreg, new_var->dreg, n->block_num); +/** + * mono_ssa_rename_vars: + * Implement renaming of SSA variables. Also compute def-use information in parallel. + * \p stack_history points to an area of memory which can be used for storing changes + * made to the stack, so they can be reverted later. + */ +static void +mono_ssa_rename_vars (MonoCompile *cfg, int max_vars, MonoBasicBlock *bb) +{ + GSList *blocks = NULL; + RenameStackInfo* rename_stack; + int rename_stack_size, rename_stack_idx = 0; + RenameInfo *stack_history; + int stack_history_size; + gboolean *originals; + guint32 *lvreg_stack; + gboolean *lvreg_defined; + MonoInst **stack; + + stack = g_newa (MonoInst*, cfg->num_varinfo); + memset (stack, 0, sizeof (MonoInst *) * cfg->num_varinfo); + lvreg_stack = g_new0 (guint32, cfg->next_vreg); + lvreg_defined = g_new0 (gboolean, cfg->next_vreg); + stack_history_size = 10240; + stack_history = g_new (RenameInfo, stack_history_size); + originals = g_new0 (gboolean, cfg->num_varinfo); + rename_stack_size = 16; + rename_stack = g_new (RenameStackInfo, rename_stack_size); + + do { + if (G_UNLIKELY (cfg->verbose_level >= 4)) + printf ("\nRENAME VARS BLOCK %d:\n", bb->block_num); + + int stack_history_len = create_new_vars (cfg, max_vars, bb, originals, stack, lvreg_stack, lvreg_defined, &stack_history, &stack_history_size); + rename_phi_arguments_in_out_bbs (cfg, bb, stack); + + if (bb->dominated) { + if (rename_stack_idx >= rename_stack_size - 1) { + rename_stack_size += MIN(rename_stack_size, 1024); + rename_stack = g_realloc(rename_stack, sizeof(RenameStackInfo)*rename_stack_size); } - else - /* The phi nodes are at the beginning of the bblock */ - break; - } - } - if (bb->dominated) { - for (tmp = bb->dominated; tmp; tmp = tmp->next) { - mono_ssa_rename_vars (cfg, max_vars, (MonoBasicBlock *)tmp->data, originals_used, stack, lvreg_stack, lvreg_defined, stack_history + stack_history_len, stack_history_size - stack_history_len); + RenameStackInfo* info = rename_stack + rename_stack_idx; + rename_stack_idx++; + info->blocks = blocks; + info->history = stack_history; + info->size = stack_history_size; + info->len = stack_history_len; + stack_history += stack_history_len; + stack_history_size -= stack_history_len; + blocks = bb->dominated; + } else { + restore_stack (stack, stack_history, stack_history_len); + blocks = blocks->next; + + while (!blocks && rename_stack_idx > 0) { + rename_stack_idx--; + RenameStackInfo* info = rename_stack + rename_stack_idx; + blocks = info->blocks ? info->blocks->next : NULL; + stack_history = info->history; + stack_history_size = info->size; + stack_history_len = info->len; + restore_stack (stack, stack_history, stack_history_len); + } } - } - /* Restore stack */ - for (i = stack_history_len - 1; i >= 0; i--) { - stack [stack_history [i].idx] = stack_history [i].var; - } + if (blocks) + bb = (MonoBasicBlock*) blocks->data; + } while (blocks); + g_free (stack_history); + g_free (originals); + g_free (lvreg_stack); + g_free (lvreg_defined); + g_free (rename_stack); cfg->comp_done |= MONO_COMP_SSA_DEF_USE; } @@ -336,13 +412,8 @@ mono_ssa_compute (MonoCompile *cfg) int i, j, idx, bitsize; MonoBitSet *set; MonoMethodVar *vinfo = g_new0 (MonoMethodVar, cfg->num_varinfo); - MonoInst *ins, **stack; + MonoInst *ins; guint8 *buf, *buf_start; - RenameInfo *stack_history; - int stack_history_size; - gboolean *originals; - guint32 *lvreg_stack; - gboolean *lvreg_defined; g_assert (!(cfg->comp_done & MONO_COMP_SSA)); @@ -464,20 +535,7 @@ mono_ssa_compute (MonoCompile *cfg) g_free (buf_start); /* Renaming phase */ - - stack = g_newa (MonoInst*, cfg->num_varinfo); - memset (stack, 0, sizeof (MonoInst *) * cfg->num_varinfo); - - lvreg_stack = g_new0 (guint32, cfg->next_vreg); - lvreg_defined = g_new0 (gboolean, cfg->next_vreg); - stack_history_size = 10240; - stack_history = g_new (RenameInfo, stack_history_size); - originals = g_new0 (gboolean, cfg->num_varinfo); - mono_ssa_rename_vars (cfg, cfg->num_varinfo, cfg->bb_entry, originals, stack, lvreg_stack, lvreg_defined, stack_history, stack_history_size); - g_free (stack_history); - g_free (originals); - g_free (lvreg_stack); - g_free (lvreg_defined); + mono_ssa_rename_vars (cfg, cfg->num_varinfo, cfg->bb_entry); if (cfg->verbose_level >= 4) printf ("\nEND COMPUTE SSA.\n\n"); diff --git a/src/mono/mono/profiler/aot.c b/src/mono/mono/profiler/aot.c index 71be9f1fdcaaa2..7988d23b058d0f 100644 --- a/src/mono/mono/profiler/aot.c +++ b/src/mono/mono/profiler/aot.c @@ -81,6 +81,12 @@ prof_jit_done (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *jinfo) mono_os_mutex_unlock (&prof->mutex); } +static void +prof_inline_method (MonoProfiler *prof, MonoMethod *method, MonoMethod *inlined_method) +{ + prof_jit_done (prof, inlined_method, NULL); +} + static void usage (void) { @@ -396,6 +402,7 @@ mono_profiler_init_aot (const char *desc) MonoProfilerHandle handle = mono_profiler_create (&aot_profiler); mono_profiler_set_runtime_initialized_callback (handle, runtime_initialized); mono_profiler_set_jit_done_callback (handle, prof_jit_done); + mono_profiler_set_inline_method_callback (handle, prof_inline_method); } static void diff --git a/src/mono/mono/profiler/log-args.c b/src/mono/mono/profiler/log-args.c index baa444c319cce6..c8609177d18b08 100644 --- a/src/mono/mono/profiler/log-args.c +++ b/src/mono/mono/profiler/log-args.c @@ -232,7 +232,7 @@ proflog_parse_args (ProfilerConfig *config, const char *desc) break; } } - + if (buffer_pos != 0) { buffer [buffer_pos] = 0; parse_arg (buffer, config); diff --git a/src/mono/mono/profiler/log.c b/src/mono/mono/profiler/log.c index efe7bbfb56d1f3..bbdf3ee44a840c 100644 --- a/src/mono/mono/profiler/log.c +++ b/src/mono/mono/profiler/log.c @@ -3201,7 +3201,7 @@ profiler_thread_begin_function (const char *name8, const gunichar2* name16, size } #define profiler_thread_begin(name, send) \ - profiler_thread_begin_function (name, MONO_THREAD_NAME_WINDOWS_CONSTANT (name), G_N_ELEMENTS (name) - 1, (send)) + profiler_thread_begin_function (name, MONO_THREAD_NAME_WINDOWS_CONSTANT (name), STRING_LENGTH (name), (send)) static void profiler_thread_end (MonoProfilerThread *thread, MonoOSEvent *event, gboolean send) diff --git a/src/mono/mono/tests/libtest.c b/src/mono/mono/tests/libtest.c index 053d8678e30e09..ce0dd55cf732aa 100644 --- a/src/mono/mono/tests/libtest.c +++ b/src/mono/mono/tests/libtest.c @@ -139,7 +139,7 @@ test_lpwstr_marshal (unsigned short* chars, int length) res = (unsigned short *)marshal_alloc (2 * (length + 1)); // printf("test_lpwstr_marshal()\n"); - + while ( i < length ) { // printf("X|%u|\n", chars[i]); res [i] = chars[i]; @@ -160,7 +160,7 @@ test_lpwstr_marshal_out (unsigned short** chars) glong len = strlen(abc); *chars = (unsigned short *)marshal_alloc (2 * (len + 1)); - + while ( i < len ) { (*chars) [i] = abc[i]; i++; @@ -175,19 +175,19 @@ typedef struct { int c; } union_test_1_type; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_union_test_1 (union_test_1_type u1) { // printf ("Got values %d %d %d\n", u1.b, u1.a, u1.c); return u1.a + u1.b + u1.c; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_return_int (int a) { // printf ("Got value %d\n", a); return a; } -LIBTEST_API float STDCALL +LIBTEST_API float STDCALL mono_test_marshal_pass_return_float (float f) { return f + 1.0; } @@ -197,7 +197,7 @@ struct ss int i; }; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_return_int_ss (struct ss a) { // printf ("Got value %d\n", a.i); return a.i; @@ -228,7 +228,7 @@ struct sc3 char c[3]; }; -LIBTEST_API struct sc3 STDCALL +LIBTEST_API struct sc3 STDCALL mono_return_sc3 (struct sc3 a) { // printf ("Got values %d %d %d\n", a.c[0], a.c[1], a.c[2]); a.c[0]++; @@ -242,7 +242,7 @@ struct sc5 char c[5]; }; -LIBTEST_API struct sc5 STDCALL +LIBTEST_API struct sc5 STDCALL mono_return_sc5 (struct sc5 a) { // printf ("Got values %d %d %d %d %d\n", a.c[0], a.c[1], a.c[2], a.c[3], a.c[4]); a.c[0]++; @@ -259,7 +259,7 @@ union su int i2; }; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_return_int_su (union su a) { // printf ("Got value %d\n", a.i1); return a.i1; @@ -306,53 +306,53 @@ mono_return_struct_4_double (void *ptr, struct Rect rect, struct Scalar4 sc4, in return buffer; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_many_int_arguments (int a, int b, int c, int d, int e, int f, int g, int h, int i, int j); -LIBTEST_API short STDCALL +LIBTEST_API short STDCALL mono_test_many_short_arguments (short a, short b, short c, short d, short e, short f, short g, short h, short i, short j); -LIBTEST_API char STDCALL +LIBTEST_API char STDCALL mono_test_many_char_arguments (char a, char b, char c, char d, char e, char f, char g, char h, char i, char j); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_many_int_arguments (int a, int b, int c, int d, int e, int f, int g, int h, int i, int j) { return a + b + c + d + e + f + g + h + i + j; } -LIBTEST_API short STDCALL +LIBTEST_API short STDCALL mono_test_many_short_arguments (short a, short b, short c, short d, short e, short f, short g, short h, short i, short j) { return a + b + c + d + e + f + g + h + i + j; } -LIBTEST_API char STDCALL +LIBTEST_API char STDCALL mono_test_many_byte_arguments (char a, char b, char c, char d, char e, char f, char g, char h, char i, char j) { return a + b + c + d + e + f + g + h + i + j; } -LIBTEST_API float STDCALL +LIBTEST_API float STDCALL mono_test_many_float_arguments (float a, float b, float c, float d, float e, float f, float g, float h, float i, float j) { return a + b + c + d + e + f + g + h + i + j; } -LIBTEST_API double STDCALL +LIBTEST_API double STDCALL mono_test_many_double_arguments (double a, double b, double c, double d, double e, double f, double g, double h, double i, double j) { return a + b + c + d + e + f + g + h + i + j; } -LIBTEST_API double STDCALL +LIBTEST_API double STDCALL mono_test_split_double_arguments (double a, double b, float c, double d, double e) { return a + b + c + d + e; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_puts_static (char *s) { // printf ("TEST %s\n", s); @@ -361,7 +361,7 @@ mono_test_puts_static (char *s) typedef int (STDCALL *SimpleDelegate3) (int a, int b); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_invoke_delegate (SimpleDelegate3 delegate) { int res; @@ -381,12 +381,12 @@ mono_invoke_simple_delegate (SimpleDelegate d) return d (4); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_char (short a1) { if (a1 == 'a') return 0; - + return 1; } @@ -398,7 +398,7 @@ mono_test_marshal_char_array (gunichar2 *s) glong len; s2 = g_utf8_to_utf16 (m, -1, NULL, &len, NULL); - + len = (len * 2) + 2; memcpy (s, s2, len); @@ -437,13 +437,13 @@ mono_test_marshal_unicode_char_array (gunichar2 *s) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_empty_pinvoke (int i) { return i; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_bool_byref (int a, int *b, int c) { int res = *b; @@ -453,7 +453,7 @@ mono_test_marshal_bool_byref (int a, int *b, int c) return res; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_bool_in_as_I1_U1 (char bTrue, char bFalse) { if (!bTrue) @@ -463,7 +463,7 @@ mono_test_marshal_bool_in_as_I1_U1 (char bTrue, char bFalse) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_bool_out_as_I1_U1 (char* bTrue, char* bFalse) { if (!bTrue || !bFalse) @@ -475,7 +475,7 @@ mono_test_marshal_bool_out_as_I1_U1 (char* bTrue, char* bFalse) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_bool_ref_as_I1_U1 (char* bTrue, char* bFalse) { if (!bTrue || !bFalse) @@ -492,18 +492,18 @@ mono_test_marshal_bool_ref_as_I1_U1 (char* bTrue, char* bFalse) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_array (int *a1) { int i, sum = 0; for (i = 0; i < 50; i++) sum += a1 [i]; - + return sum; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_inout_array (int *a1) { int i, sum = 0; @@ -512,7 +512,7 @@ mono_test_marshal_inout_array (int *a1) sum += a1 [i]; a1 [i] = 50 - a1 [i]; } - + return sum; } @@ -522,7 +522,7 @@ mono_test_marshal_inout_array_cdecl (int *a1) return mono_test_marshal_inout_array (a1); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_out_array (int *a1) { int i; @@ -530,7 +530,7 @@ mono_test_marshal_out_array (int *a1) for (i = 0; i < 50; i++) { a1 [i] = i; } - + return 0; } @@ -563,7 +563,7 @@ mono_test_marshal_out_lparray_out_size_param (int *arr, int *out_len) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_inout_nonblittable_array (gunichar2 *a1) { int i, sum = 0; @@ -571,7 +571,7 @@ mono_test_marshal_inout_nonblittable_array (gunichar2 *a1) for (i = 0; i < 10; i++) { a1 [i] = 'F'; } - + return sum; } @@ -588,7 +588,7 @@ typedef struct { double y; } point; -LIBTEST_API simplestruct STDCALL +LIBTEST_API simplestruct STDCALL mono_test_return_vtype (int i) { simplestruct res; @@ -611,7 +611,7 @@ mono_test_delegate_struct (void) typedef char* (STDCALL *ReturnStringDelegate) (const char *s); -LIBTEST_API char * STDCALL +LIBTEST_API char * STDCALL mono_test_return_string (ReturnStringDelegate func) { char *res; @@ -627,7 +627,7 @@ mono_test_return_string (ReturnStringDelegate func) typedef int (STDCALL *RefVTypeDelegate) (int a, simplestruct *ss, int b); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_ref_vtype (int a, simplestruct *ss, int b, RefVTypeDelegate func) { if (a == 1 && b == 2 && ss->a == 0 && ss->b == 1 && ss->c == 0 && @@ -645,7 +645,7 @@ mono_test_ref_vtype (int a, simplestruct *ss, int b, RefVTypeDelegate func) typedef int (STDCALL *OutVTypeDelegate) (int a, simplestruct *ss, int b); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_out_struct (int a, simplestruct *ss, int b, OutVTypeDelegate func) { /* Check that the input pointer is ignored */ @@ -661,7 +661,7 @@ mono_test_marshal_out_struct (int a, simplestruct *ss, int b, OutVTypeDelegate f typedef int (STDCALL *InVTypeDelegate) (int a, simplestruct *ss, int b); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_in_struct (int a, simplestruct *ss, int b, InVTypeDelegate func) { simplestruct ss2; @@ -687,7 +687,7 @@ typedef struct { SimpleDelegate func, func2, func3; } DelegateStruct; -LIBTEST_API DelegateStruct STDCALL +LIBTEST_API DelegateStruct STDCALL mono_test_marshal_delegate_struct (DelegateStruct ds) { DelegateStruct res; @@ -700,7 +700,7 @@ mono_test_marshal_delegate_struct (DelegateStruct ds) return res; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_byref_struct (simplestruct *ss, int a, int b, int c, char *d) { gboolean res = (ss->a == a && ss->b == b && ss->c == c && strcmp (ss->d, d) == 0); @@ -726,11 +726,11 @@ typedef struct { guint64 h; } simplestruct2; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_struct2 (simplestruct2 ss) { if (ss.a == 0 && ss.b == 1 && ss.c == 0 && - !strcmp (ss.d, "TEST") && + !strcmp (ss.d, "TEST") && ss.e == 99 && ss.f == 1.5 && ss.g == 42 && ss.h == (guint64)123) return 0; @@ -738,20 +738,20 @@ mono_test_marshal_struct2 (simplestruct2 ss) } /* on HP some of the struct should be on the stack and not in registers */ -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_struct2_2 (int i, int j, int k, simplestruct2 ss) { if (i != 10 || j != 11 || k != 12) return 1; if (ss.a == 0 && ss.b == 1 && ss.c == 0 && - !strcmp (ss.d, "TEST") && + !strcmp (ss.d, "TEST") && ss.e == 99 && ss.f == 1.5 && ss.g == 42 && ss.h == (guint64)123) return 0; return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_lpstruct (simplestruct *ss) { if (ss->a == 0 && ss->b == 1 && ss->c == 0 && @@ -761,7 +761,7 @@ mono_test_marshal_lpstruct (simplestruct *ss) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_lpstruct_blittable (point *p) { if (p->x == 1.0 && p->y == 2.0) @@ -770,16 +770,16 @@ mono_test_marshal_lpstruct_blittable (point *p) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_struct_array (simplestruct2 *ss) { if (! (ss[0].a == 0 && ss[0].b == 1 && ss[0].c == 0 && - !strcmp (ss[0].d, "TEST") && + !strcmp (ss[0].d, "TEST") && ss[0].e == 99 && ss[0].f == 1.5 && ss[0].g == 42 && ss[0].h == (guint64)123)) return 1; if (! (ss[1].a == 0 && ss[1].b == 0 && ss[1].c == 0 && - !strcmp (ss[1].d, "TEST2") && + !strcmp (ss[1].d, "TEST2") && ss[1].e == 100 && ss[1].f == 2.5 && ss[1].g == 43 && ss[1].h == (guint64)124)) return 1; @@ -792,13 +792,13 @@ typedef struct long_align_struct { gint64 c; } long_align_struct; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_long_align_struct_array (long_align_struct *ss) { return ss[0].a + ss[0].b + ss[0].c + ss[1].a + ss[1].b + ss[1].c; } -LIBTEST_API simplestruct2 * STDCALL +LIBTEST_API simplestruct2 * STDCALL mono_test_marshal_class (int i, int j, int k, simplestruct2 *ss, int l) { simplestruct2 *res; @@ -809,7 +809,7 @@ mono_test_marshal_class (int i, int j, int k, simplestruct2 *ss, int l) if (i != 10 || j != 11 || k != 12 || l != 14) return NULL; if (! (ss->a == 0 && ss->b == 1 && ss->c == 0 && - !strcmp (ss->d, "TEST") && + !strcmp (ss->d, "TEST") && ss->e == 99 && ss->f == 1.5 && ss->g == 42 && ss->h == (guint64)123)) return NULL; @@ -819,14 +819,14 @@ mono_test_marshal_class (int i, int j, int k, simplestruct2 *ss, int l) return res; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_byref_class (simplestruct2 **ssp) { simplestruct2 *ss = *ssp; simplestruct2 *res; - + if (! (ss->a == 0 && ss->b == 1 && ss->c == 0 && - !strcmp (ss->d, "TEST") && + !strcmp (ss->d, "TEST") && ss->e == 99 && ss->f == 1.5 && ss->g == 42 && ss->h == (guint64)123)) return 1; @@ -853,7 +853,7 @@ get_sp (void) MONO_RESTORE_WARNING -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL reliable_delegate (int a) { return a; @@ -872,9 +872,9 @@ is_get_sp_reliable (void) reliable_delegate(1); sp2 = get_sp(); return sp1 == sp2; -} +} -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_delegate (SimpleDelegate delegate) { void *sp1, *sp2; @@ -895,7 +895,7 @@ static int STDCALL inc_cb (int i) return i + 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_out_delegate (SimpleDelegate *delegate) { *delegate = inc_cb; @@ -903,7 +903,7 @@ mono_test_marshal_out_delegate (SimpleDelegate *delegate) return 0; } -LIBTEST_API SimpleDelegate STDCALL +LIBTEST_API SimpleDelegate STDCALL mono_test_marshal_return_delegate (SimpleDelegate delegate) { return delegate; @@ -927,7 +927,7 @@ return_plus_one (int i) return i + 1; } -LIBTEST_API SimpleDelegate STDCALL +LIBTEST_API SimpleDelegate STDCALL mono_test_marshal_return_delegate_2 (void) { return return_plus_one; @@ -958,7 +958,7 @@ mono_test_marshal_struct (simplestruct ss) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_delegate2 (SimpleDelegate2 delegate) { simplestruct ss, res; @@ -967,7 +967,7 @@ mono_test_marshal_delegate2 (SimpleDelegate2 delegate) ss.b = 1; ss.c = 0; ss.d = "TEST"; - ss.d2 = g_utf8_to_utf16 ("TEST2", -1, NULL, NULL, NULL); + ss.d2 = g_utf8_to_utf16 ("TEST2", -1, NULL, NULL, NULL); res = delegate (ss); if (! (res.a && !res.b && res.c && !strcmp (res.d, "TEST-RES") && is_utf16_equals (res.d2, "TEST2-RES"))) @@ -978,7 +978,7 @@ mono_test_marshal_delegate2 (SimpleDelegate2 delegate) typedef simplestruct* (STDCALL *SimpleDelegate4) (simplestruct *ss); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_delegate4 (SimpleDelegate4 delegate) { simplestruct ss; @@ -1008,7 +1008,7 @@ mono_test_marshal_delegate4 (SimpleDelegate4 delegate) typedef int (STDCALL *SimpleDelegate5) (simplestruct **ss); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_delegate5 (SimpleDelegate5 delegate) { simplestruct ss; @@ -1032,7 +1032,7 @@ mono_test_marshal_delegate5 (SimpleDelegate5 delegate) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_delegate6 (SimpleDelegate5 delegate) { delegate (NULL); @@ -1041,7 +1041,7 @@ mono_test_marshal_delegate6 (SimpleDelegate5 delegate) typedef int (STDCALL *SimpleDelegate7) (simplestruct **ss); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_delegate7 (SimpleDelegate7 delegate) { int res; @@ -1062,7 +1062,7 @@ mono_test_marshal_delegate7 (SimpleDelegate7 delegate) typedef int (STDCALL *InOutByvalClassDelegate) (simplestruct *ss); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_inout_byval_class_delegate (InOutByvalClassDelegate delegate) { int res; @@ -1085,7 +1085,7 @@ mono_test_marshal_inout_byval_class_delegate (InOutByvalClassDelegate delegate) typedef int (STDCALL *SimpleDelegate8) (gunichar2 *s); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_delegate8 (SimpleDelegate8 delegate, gunichar2 *s) { return delegate (s); @@ -1094,19 +1094,19 @@ mono_test_marshal_delegate8 (SimpleDelegate8 delegate, gunichar2 *s) typedef int (STDCALL *return_int_fnt) (int i); typedef int (STDCALL *SimpleDelegate9) (return_int_fnt d); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_delegate9 (SimpleDelegate9 delegate, gpointer ftn) { return delegate ((return_int_fnt)ftn); } -static int STDCALL +static int STDCALL return_self (int i) { return i; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_delegate10 (SimpleDelegate9 delegate) { return delegate (return_self); @@ -1114,7 +1114,7 @@ mono_test_marshal_delegate10 (SimpleDelegate9 delegate) typedef int (STDCALL *PrimitiveByrefDelegate) (int *i); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_primitive_byref_delegate (PrimitiveByrefDelegate delegate) { int i = 1; @@ -1133,7 +1133,7 @@ typedef int (STDCALL *return_int_delegate) (int i); typedef return_int_delegate (STDCALL *ReturnDelegateDelegate) (void); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_return_delegate_delegate (ReturnDelegateDelegate d) { return (d ()) (55); @@ -1155,7 +1155,7 @@ mono_test_marshal_icall_delegate (IcallDelegate del) return strcmp (res, "ABC") == 0 ? 0 : 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_stringbuilder (char *s, int n) { const char m[] = "This is my message. Isn't it nice?"; @@ -1167,7 +1167,7 @@ mono_test_marshal_stringbuilder (char *s, int n) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_stringbuilder_append (char *s, int length) { const char out_sentinel[] = "CSHARP_"; @@ -1183,7 +1183,7 @@ mono_test_marshal_stringbuilder_append (char *s, int length) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_stringbuilder_default (char *s, int n) { const char m[] = "This is my message. Isn't it nice?"; @@ -1193,7 +1193,7 @@ mono_test_marshal_stringbuilder_default (char *s, int n) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_stringbuilder_unicode (gunichar2 *s, int n) { const char m[] = "This is my message. Isn't it nice?"; @@ -1201,7 +1201,7 @@ mono_test_marshal_stringbuilder_unicode (gunichar2 *s, int n) glong len; s2 = g_utf8_to_utf16 (m, -1, NULL, &len, NULL); - + len = (len * 2) + 2; if (len > (n * 2)) len = n * 2; @@ -1220,11 +1220,11 @@ mono_test_marshal_stringbuilder_out (char **s) str = (char *)marshal_alloc (strlen (m) + 1); memcpy (str, m, strlen (m) + 1); - + *s = str; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_stringbuilder_out_unicode (gunichar2 **s) { const char m[] = "This is my message. Isn't it nice?"; @@ -1232,7 +1232,7 @@ mono_test_marshal_stringbuilder_out_unicode (gunichar2 **s) glong len; s2 = g_utf8_to_utf16 (m, -1, NULL, &len, NULL); - + len = (len * 2) + 2; *s = (gunichar2 *)marshal_alloc (len); memcpy (*s, s2, len); @@ -1253,12 +1253,12 @@ mono_test_marshal_stringbuilder_ref (char **s) str = (char *)marshal_alloc (strlen (m) + 1); memcpy (str, m, strlen (m) + 1); - + *s = str; return 0; } -LIBTEST_API void STDCALL +LIBTEST_API void STDCALL mono_test_marshal_stringbuilder_utf16_tolower (short *s, int n) { for (int i = 0; i < n; i++) @@ -1290,13 +1290,13 @@ typedef struct { #pragma GCC diagnostic pop #endif -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_empty_string_array (char **array) { return (array == NULL) ? 0 : 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_string_array (char **array) { if (strcmp (array [0], "ABC")) @@ -1310,7 +1310,7 @@ mono_test_marshal_string_array (char **array) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_byref_string_array (char ***array) { if (*array == NULL) @@ -1326,7 +1326,7 @@ mono_test_marshal_byref_string_array (char ***array) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_stringbuilder_array (char **array) { if (strcmp (array [0], "ABC")) @@ -1340,12 +1340,12 @@ mono_test_marshal_stringbuilder_array (char **array) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_unicode_string_array (gunichar2 **array, char **array2) { GError *gerror = NULL; char *s; - + s = g_utf16_to_utf8 (array [0], -1, NULL, NULL, &gerror); if (strcmp (s, "ABC")) { g_free (s); @@ -1365,14 +1365,14 @@ mono_test_marshal_unicode_string_array (gunichar2 **array, char **array2) if (strcmp (array2 [0], "ABC")) return 3; - if (strcmp (array2 [1], "DEF")) + if (strcmp (array2 [1], "DEF")) return 4; return 0; } /* this does not work on Redhat gcc 2.96 */ -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_empty_struct (int a, EmptyStruct es, int b) { // printf ("mono_test_empty_struct %d %d\n", a, b); @@ -1406,11 +1406,11 @@ typedef struct { char a[100]; } ByValStrStruct; -LIBTEST_API ByValStrStruct * STDCALL +LIBTEST_API ByValStrStruct * STDCALL mono_test_byvalstr_gen (void) { ByValStrStruct *ret; - + ret = (ByValStrStruct *)malloc (sizeof (ByValStrStruct)); memset(ret, 'a', sizeof(ByValStrStruct)-1); ret->a[sizeof(ByValStrStruct)-1] = 0; @@ -1418,7 +1418,7 @@ mono_test_byvalstr_gen (void) return ret; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_byvalstr_check (ByValStrStruct* data, char* correctString) { int ret; @@ -1437,14 +1437,14 @@ typedef struct { int flag; } ByValStrStruct_Unicode; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_byvalstr_check_unicode (ByValStrStruct_Unicode *ref, int test) { if (ref->flag != 0x1234abcd){ printf ("overwritten data"); return 1; } - + if (test == 1 || test == 3){ if (ref->a [0] != '1' || ref->a [1] != '2' || @@ -1461,55 +1461,55 @@ mono_test_byvalstr_check_unicode (ByValStrStruct_Unicode *ref, int test) return 10; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL NameManglingAnsi (char *data) { return data [0] + data [1] + data [2]; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL NameManglingAnsiA (char *data) { g_assert_not_reached (); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL NameManglingAnsiW (char *data) { g_assert_not_reached (); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL NameManglingAnsi2A (char *data) { return data [0] + data [1] + data [2]; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL NameManglingAnsi2W (char *data) { g_assert_not_reached (); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL NameManglingUnicode (char *data) { g_assert_not_reached (); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL NameManglingUnicodeW (gunichar2 *data) { return data [0] + data [1] + data [2]; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL NameManglingUnicode2 (gunichar2 *data) { return data [0] + data [1] + data [2]; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL NameManglingAutoW (char *data) { #ifdef WIN32 @@ -1519,7 +1519,7 @@ NameManglingAutoW (char *data) #endif } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL NameManglingAuto (char *data) { #ifndef WIN32 @@ -1531,7 +1531,7 @@ NameManglingAuto (char *data) typedef int (STDCALL *intcharFunc)(const char*); -LIBTEST_API void STDCALL +LIBTEST_API void STDCALL callFunction (intcharFunc f) { f ("ABC"); @@ -1542,7 +1542,7 @@ typedef struct { int i; } SimpleObj; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL class_marshal_test0 (SimpleObj *obj1) { // printf ("class_marshal_test0 %s %d\n", obj1->str, obj1->i); @@ -1555,7 +1555,7 @@ class_marshal_test0 (SimpleObj *obj1) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL class_marshal_test4 (SimpleObj *obj1) { if (obj1) @@ -1575,7 +1575,7 @@ class_marshal_test1 (SimpleObj **obj1) *obj1 = res; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL class_marshal_test2 (SimpleObj **obj1) { // printf ("class_marshal_test2 %s %d\n", (*obj1)->str, (*obj1)->i); @@ -1588,7 +1588,7 @@ class_marshal_test2 (SimpleObj **obj1) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL string_marshal_test0 (char *str) { if (strcmp (str, "TEST0")) @@ -1603,7 +1603,7 @@ string_marshal_test1 (const char **str) *str = marshal_strdup ("TEST1"); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL string_marshal_test2 (char **str) { // printf ("string_marshal_test2 %s\n", *str); @@ -1616,7 +1616,7 @@ string_marshal_test2 (char **str) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL string_marshal_test3 (char *str) { if (str) @@ -1630,7 +1630,7 @@ typedef struct { int b; } BlittableClass; -LIBTEST_API BlittableClass* STDCALL +LIBTEST_API BlittableClass* STDCALL TestBlittableClass (BlittableClass *vl) { BlittableClass *res; @@ -1653,12 +1653,12 @@ TestBlittableClass (BlittableClass *vl) } typedef struct OSVERSIONINFO_STRUCT -{ - int a; - int b; +{ + int a; + int b; } OSVERSIONINFO_STRUCT; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL MyGetVersionEx (OSVERSIONINFO_STRUCT *osvi) { @@ -1670,7 +1670,7 @@ MyGetVersionEx (OSVERSIONINFO_STRUCT *osvi) return osvi->a + osvi->b; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL BugGetVersionEx (int a, int b, int c, int d, int e, int f, int g, int h, OSVERSIONINFO_STRUCT *osvi) { @@ -1682,7 +1682,7 @@ BugGetVersionEx (int a, int b, int c, int d, int e, int f, int g, int h, OSVERSI return osvi->a + osvi->b; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_point (point pt) { // printf("point %g %g\n", pt.x, pt.y); @@ -1697,7 +1697,7 @@ typedef struct { double y; } mixed_point; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_mixed_point (mixed_point pt) { // printf("mixed point %d %g\n", pt.x, pt.y); @@ -1707,7 +1707,7 @@ mono_test_marshal_mixed_point (mixed_point pt) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_mixed_point_2 (mixed_point *pt) { if (pt->x != 5 || pt->y != 6.75) @@ -1719,7 +1719,7 @@ mono_test_marshal_mixed_point_2 (mixed_point *pt) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL marshal_test_ref_bool(int i, char *b1, short *b2, int *b3) { int res = 1; @@ -1745,7 +1745,7 @@ struct BoolStruct int b3; }; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL marshal_test_bool_struct(struct BoolStruct *s) { int res = 1; @@ -1797,13 +1797,13 @@ mono_test_last_error (int err) */ char buffer[256] = { 0 }; char value[] = "Dummy"; - strncpy (buffer, value, G_N_ELEMENTS (value) - 1); + strncpy (buffer, value, STRING_LENGTH (value)); #else mono_set_errno (err); #endif } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_asany (void *ptr, int what) { switch (what) { @@ -1815,7 +1815,7 @@ mono_test_asany (void *ptr, int what) simplestruct2 ss = *(simplestruct2*)ptr; if (ss.a == 0 && ss.b == 1 && ss.c == 0 && - !strcmp (ss.d, "TEST") && + !strcmp (ss.d, "TEST") && ss.e == 99 && ss.f == 1.5 && ss.g == 42 && ss.h == (guint64)123) return 0; else @@ -1857,7 +1857,7 @@ typedef struct char *s; } AsAnyStruct; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_asany_in (void* ptr) { AsAnyStruct *asAny = (AsAnyStruct *)ptr; @@ -1866,7 +1866,7 @@ mono_test_marshal_asany_in (void* ptr) return res; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_asany_inout (void* ptr) { AsAnyStruct *asAny = (AsAnyStruct *)ptr; @@ -1882,7 +1882,7 @@ mono_test_marshal_asany_inout (void* ptr) return res; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_asany_out (void* ptr) { AsAnyStruct *asAny = (AsAnyStruct *)ptr; @@ -1907,7 +1907,7 @@ typedef struct amd64_struct1 { int l; } amd64_struct1; -LIBTEST_API amd64_struct1 STDCALL +LIBTEST_API amd64_struct1 STDCALL mono_test_marshal_amd64_pass_return_struct1 (amd64_struct1 s) { s.i ++; @@ -1918,7 +1918,7 @@ mono_test_marshal_amd64_pass_return_struct1 (amd64_struct1 s) return s; } -LIBTEST_API amd64_struct1 STDCALL +LIBTEST_API amd64_struct1 STDCALL mono_test_marshal_amd64_pass_return_struct1_many_args (amd64_struct1 s, int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8) { s.i ++; @@ -1934,7 +1934,7 @@ typedef struct amd64_struct2 { int j; } amd64_struct2; -LIBTEST_API amd64_struct2 STDCALL +LIBTEST_API amd64_struct2 STDCALL mono_test_marshal_amd64_pass_return_struct2 (amd64_struct2 s) { s.i ++; @@ -1947,7 +1947,7 @@ typedef struct amd64_struct3 { int i; } amd64_struct3; -LIBTEST_API amd64_struct3 STDCALL +LIBTEST_API amd64_struct3 STDCALL mono_test_marshal_amd64_pass_return_struct3 (amd64_struct3 s) { s.i ++; @@ -1959,7 +1959,7 @@ typedef struct amd64_struct4 { double d1, d2; } amd64_struct4; -LIBTEST_API amd64_struct4 STDCALL +LIBTEST_API amd64_struct4 STDCALL mono_test_marshal_amd64_pass_return_struct4 (amd64_struct4 s) { s.d1 ++; @@ -1975,7 +1975,7 @@ typedef struct test_struct5 { float d1, d2; } test_struct5; -LIBTEST_API test_struct5 STDCALL +LIBTEST_API test_struct5 STDCALL mono_test_marshal_ia64_pass_return_struct5 (double d1, double d2, test_struct5 s, int i, double d3, double d4) { s.d1 += d1 + d2 + i; @@ -1988,7 +1988,7 @@ typedef struct test_struct6 { double d1, d2; } test_struct6; -LIBTEST_API test_struct6 STDCALL +LIBTEST_API test_struct6 STDCALL mono_test_marshal_ia64_pass_return_struct6 (double d1, double d2, test_struct6 s, int i, double d3, double d4) { s.d1 += d1 + d2 + i; @@ -2009,7 +2009,7 @@ mono_test_marshal_pass_return_custom (int i, guint32 *ptr, int j) return &custom_res; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_pass_out_custom (int i, guint32 **ptr, int j) { custom_res [0] = 0; @@ -2020,7 +2020,7 @@ mono_test_marshal_pass_out_custom (int i, guint32 **ptr, int j) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_pass_inout_custom (int i, guint32 *ptr, int j) { ptr [0] = 0; @@ -2029,13 +2029,13 @@ mono_test_marshal_pass_inout_custom (int i, guint32 *ptr, int j) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_pass_out_byval_custom (int i, guint32 *ptr, int j) { return ptr == NULL ? 0 : 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_pass_byref_custom (int i, guint32 **ptr, int j) { (*ptr)[1] += i + j; @@ -2061,7 +2061,7 @@ mono_test_marshal_pass_return_custom_null (int i, guint32 *ptr, int j) typedef void *(STDCALL *PassReturnPtrDelegate) (void *ptr); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_pass_return_custom_in_delegate (PassReturnPtrDelegate del) { guint32 buf [2]; @@ -2084,7 +2084,7 @@ mono_test_marshal_pass_return_custom_in_delegate (PassReturnPtrDelegate del) return res; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_pass_return_custom_null_in_delegate (PassReturnPtrDelegate del) { void *ptr = del (NULL); @@ -2094,7 +2094,7 @@ mono_test_marshal_pass_return_custom_null_in_delegate (PassReturnPtrDelegate del typedef void (STDCALL *CustomOutParamDelegate) (void **pptr); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_custom_out_param_delegate (CustomOutParamDelegate del) { void* pptr = (void*)del; @@ -2109,7 +2109,7 @@ mono_test_marshal_custom_out_param_delegate (CustomOutParamDelegate del) typedef int (STDCALL *ReturnEnumDelegate) (int e); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_return_enum_delegate (ReturnEnumDelegate func) { return func (1); @@ -2119,10 +2119,10 @@ typedef struct { int a, b, c; gint64 d; } BlittableStruct; - + typedef BlittableStruct (STDCALL *SimpleDelegate10) (BlittableStruct ss); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_blittable_struct_delegate (SimpleDelegate10 delegate) { BlittableStruct ss, res; @@ -2139,7 +2139,7 @@ mono_test_marshal_blittable_struct_delegate (SimpleDelegate10 delegate) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_stdcall_name_mangling (int a, int b, int c) { return a + b + c; @@ -2164,10 +2164,10 @@ mono_test_stdcall_mismatch_2 (int a, int b, int c) typedef struct { int i; } SmallStruct1; - + typedef SmallStruct1 (STDCALL *SmallStructDelegate1) (SmallStruct1 ss); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_small_struct_delegate1 (SmallStructDelegate1 delegate) { SmallStruct1 ss, res; @@ -2184,10 +2184,10 @@ mono_test_marshal_small_struct_delegate1 (SmallStructDelegate1 delegate) typedef struct { gint16 i, j; } SmallStruct2; - + typedef SmallStruct2 (STDCALL *SmallStructDelegate2) (SmallStruct2 ss); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_small_struct_delegate2 (SmallStructDelegate2 delegate) { SmallStruct2 ss, res; @@ -2206,10 +2206,10 @@ typedef struct { gint16 i; gint8 j; } SmallStruct3; - + typedef SmallStruct3 (STDCALL *SmallStructDelegate3) (SmallStruct3 ss); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_small_struct_delegate3 (SmallStructDelegate3 delegate) { SmallStruct3 ss, res; @@ -2227,10 +2227,10 @@ mono_test_marshal_small_struct_delegate3 (SmallStructDelegate3 delegate) typedef struct { gint16 i; } SmallStruct4; - + typedef SmallStruct4 (STDCALL *SmallStructDelegate4) (SmallStruct4 ss); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_small_struct_delegate4 (SmallStructDelegate4 delegate) { SmallStruct4 ss, res; @@ -2247,10 +2247,10 @@ mono_test_marshal_small_struct_delegate4 (SmallStructDelegate4 delegate) typedef struct { gint64 i; } SmallStruct5; - + typedef SmallStruct5 (STDCALL *SmallStructDelegate5) (SmallStruct5 ss); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_small_struct_delegate5 (SmallStructDelegate5 delegate) { SmallStruct5 ss, res; @@ -2267,10 +2267,10 @@ mono_test_marshal_small_struct_delegate5 (SmallStructDelegate5 delegate) typedef struct { int i, j; } SmallStruct6; - + typedef SmallStruct6 (STDCALL *SmallStructDelegate6) (SmallStruct6 ss); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_small_struct_delegate6 (SmallStructDelegate6 delegate) { SmallStruct6 ss, res; @@ -2289,10 +2289,10 @@ typedef struct { int i; gint16 j; } SmallStruct7; - + typedef SmallStruct7 (STDCALL *SmallStructDelegate7) (SmallStruct7 ss); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_small_struct_delegate7 (SmallStructDelegate7 delegate) { SmallStruct7 ss, res; @@ -2310,10 +2310,10 @@ mono_test_marshal_small_struct_delegate7 (SmallStructDelegate7 delegate) typedef struct { float i; } SmallStruct8; - + typedef SmallStruct8 (STDCALL *SmallStructDelegate8) (SmallStruct8 ss); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_small_struct_delegate8 (SmallStructDelegate8 delegate) { SmallStruct8 ss, res; @@ -2330,10 +2330,10 @@ mono_test_marshal_small_struct_delegate8 (SmallStructDelegate8 delegate) typedef struct { double i; } SmallStruct9; - + typedef SmallStruct9 (STDCALL *SmallStructDelegate9) (SmallStruct9 ss); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_small_struct_delegate9 (SmallStructDelegate9 delegate) { SmallStruct9 ss, res; @@ -2350,10 +2350,10 @@ mono_test_marshal_small_struct_delegate9 (SmallStructDelegate9 delegate) typedef struct { float i, j; } SmallStruct10; - + typedef SmallStruct10 (STDCALL *SmallStructDelegate10) (SmallStruct10 ss); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_small_struct_delegate10 (SmallStructDelegate10 delegate) { SmallStruct10 ss, res; @@ -2372,10 +2372,10 @@ typedef struct { float i; int j; } SmallStruct11; - + typedef SmallStruct11 (STDCALL *SmallStructDelegate11) (SmallStruct11 ss); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_small_struct_delegate11 (SmallStructDelegate11 delegate) { SmallStruct11 ss, res; @@ -2392,7 +2392,7 @@ mono_test_marshal_small_struct_delegate11 (SmallStructDelegate11 delegate) typedef int (STDCALL *ArrayDelegate) (int i, char *j, void *arr); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_array_delegate (void *arr, int len, ArrayDelegate del) { return del (len, NULL, arr); @@ -2400,13 +2400,13 @@ mono_test_marshal_array_delegate (void *arr, int len, ArrayDelegate del) typedef int (STDCALL *ArrayDelegateLong) (gint64 i, char *j, void *arr); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_array_delegate_long (void *arr, gint64 len, ArrayDelegateLong del) { return del (len, NULL, arr); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_out_array_delegate (int *arr, int len, ArrayDelegate del) { del (len, NULL, arr); @@ -2419,7 +2419,7 @@ mono_test_marshal_out_array_delegate (int *arr, int len, ArrayDelegate del) typedef gunichar2* (STDCALL *UnicodeStringDelegate) (gunichar2 *message); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_return_unicode_string_delegate (UnicodeStringDelegate del) { const char m[] = "abcdef"; @@ -2435,7 +2435,7 @@ mono_test_marshal_return_unicode_string_delegate (UnicodeStringDelegate del) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_out_string_array_delegate (char **arr, int len, ArrayDelegate del) { del (len, NULL, arr); @@ -2448,7 +2448,7 @@ mono_test_marshal_out_string_array_delegate (char **arr, int len, ArrayDelegate typedef int (*CdeclDelegate) (int i, int j); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_cdecl_delegate (CdeclDelegate del) { int i; @@ -2461,7 +2461,7 @@ mono_test_marshal_cdecl_delegate (CdeclDelegate del) typedef char** (STDCALL *ReturnStringArrayDelegate) (int i); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_return_string_array_delegate (ReturnStringArrayDelegate d) { char **arr = d (2); @@ -2482,7 +2482,7 @@ mono_test_marshal_return_string_array_delegate (ReturnStringArrayDelegate d) typedef int (STDCALL *ByrefStringDelegate) (char **s); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_byref_string_delegate (ByrefStringDelegate d) { char *s = (char*)"ABC"; @@ -2502,19 +2502,19 @@ mono_test_marshal_byref_string_delegate (ByrefStringDelegate d) return res; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL add_delegate (int i, int j) { return i + j; } -LIBTEST_API gpointer STDCALL +LIBTEST_API gpointer STDCALL mono_test_marshal_return_fnptr (void) { return (gpointer)&add_delegate; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_xr (int code) { printf ("codigo %x\n", code); @@ -2525,7 +2525,7 @@ typedef struct { int handle; } HandleRef; -LIBTEST_API HandleRef STDCALL +LIBTEST_API HandleRef STDCALL mono_xr_as_handle (int code) { HandleRef ref; @@ -2534,7 +2534,7 @@ mono_xr_as_handle (int code) return ref; } - + typedef struct { int a; void *handle1; @@ -2542,7 +2542,7 @@ typedef struct { int b; } HandleStructs; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_safe_handle_struct_ref (HandleStructs *x) { printf ("Dingus Ref! \n"); @@ -2561,7 +2561,7 @@ mono_safe_handle_struct_ref (HandleStructs *x) return 0xf00d; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_safe_handle_struct (HandleStructs x) { printf ("Dingus Standard! \n"); @@ -2576,7 +2576,7 @@ mono_safe_handle_struct (HandleStructs x) if (x.handle2 != (void*) 0x1234abcd) return 4; - + return 0xf00f; } @@ -2584,14 +2584,14 @@ typedef struct { void *a; } TrivialHandle; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_safe_handle_struct_simple (TrivialHandle x) { printf ("The value is %p\n", x.a); return ((int)(gsize)x.a) * 2; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_safe_handle_return (void) { return 0x1000f00d; @@ -2742,7 +2742,7 @@ void VariantInit(VARIANT* vt) #endif -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_bstr_in(gunichar2* bstr) { gint32 result = 0; @@ -2754,14 +2754,14 @@ mono_test_marshal_bstr_in(gunichar2* bstr) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_bstr_out(gunichar2** bstr) { *bstr = marshal_bstr_alloc ("mono_test_marshal_bstr_out"); return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_bstr_in_null(gunichar2* bstr) { if (!bstr) @@ -2769,14 +2769,14 @@ mono_test_marshal_bstr_in_null(gunichar2* bstr) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_bstr_out_null(gunichar2** bstr) { *bstr = NULL; return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_sbyte(VARIANT variant) { if (variant.vt == VT_I1 && variant.cVal == 100) @@ -2784,7 +2784,7 @@ mono_test_marshal_variant_in_sbyte(VARIANT variant) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_byte(VARIANT variant) { if (variant.vt == VT_UI1 && variant.bVal == 100) @@ -2792,7 +2792,7 @@ mono_test_marshal_variant_in_byte(VARIANT variant) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_short(VARIANT variant) { if (variant.vt == VT_I2 && variant.iVal == 314) @@ -2800,7 +2800,7 @@ mono_test_marshal_variant_in_short(VARIANT variant) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_ushort(VARIANT variant) { if (variant.vt == VT_UI2 && variant.uiVal == 314) @@ -2808,7 +2808,7 @@ mono_test_marshal_variant_in_ushort(VARIANT variant) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_int(VARIANT variant) { if (variant.vt == VT_I4 && variant.lVal == 314) @@ -2816,7 +2816,7 @@ mono_test_marshal_variant_in_int(VARIANT variant) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_uint(VARIANT variant) { if (variant.vt == VT_UI4 && variant.ulVal == 314) @@ -2824,7 +2824,7 @@ mono_test_marshal_variant_in_uint(VARIANT variant) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_long(VARIANT variant) { if (variant.vt == VT_I8 && variant.llVal == 314) @@ -2832,7 +2832,7 @@ mono_test_marshal_variant_in_long(VARIANT variant) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_ulong(VARIANT variant) { if (variant.vt == VT_UI8 && variant.ullVal == 314) @@ -2840,7 +2840,7 @@ mono_test_marshal_variant_in_ulong(VARIANT variant) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_float(VARIANT variant) { if (variant.vt == VT_R4 && (variant.fltVal - 3.14)/3.14 < .001) @@ -2848,7 +2848,7 @@ mono_test_marshal_variant_in_float(VARIANT variant) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_double(VARIANT variant) { if (variant.vt == VT_R8 && (variant.dblVal - 3.14)/3.14 < .001) @@ -2856,7 +2856,7 @@ mono_test_marshal_variant_in_double(VARIANT variant) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_bstr(VARIANT variant) { gint32 result = 0; @@ -2869,7 +2869,7 @@ mono_test_marshal_variant_in_bstr(VARIANT variant) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_bool_true (VARIANT variant) { if (variant.vt == VT_BOOL && variant.boolVal == VARIANT_TRUE) @@ -2877,7 +2877,7 @@ mono_test_marshal_variant_in_bool_true (VARIANT variant) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_bool_false (VARIANT variant) { if (variant.vt == VT_BOOL && variant.boolVal == VARIANT_FALSE) @@ -2885,7 +2885,7 @@ mono_test_marshal_variant_in_bool_false (VARIANT variant) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_sbyte(VARIANT* variant) { variant->vt = VT_I1; @@ -2894,7 +2894,7 @@ mono_test_marshal_variant_out_sbyte(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_sbyte_byref(VARIANT* variant) { variant->vt = VT_I1|VT_BYREF; @@ -2904,18 +2904,18 @@ mono_test_marshal_variant_out_sbyte_byref(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_byte(VARIANT* variant) -{ +{ variant->vt = VT_UI1; variant->bVal = 100; return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_byte_byref(VARIANT* variant) -{ +{ variant->vt = VT_UI1|VT_BYREF; variant->byref = marshal_alloc(1); *((gint8*)variant->byref) = 100; @@ -2923,7 +2923,7 @@ mono_test_marshal_variant_out_byte_byref(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_short(VARIANT* variant) { variant->vt = VT_I2; @@ -2932,7 +2932,7 @@ mono_test_marshal_variant_out_short(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_short_byref(VARIANT* variant) { variant->vt = VT_I2|VT_BYREF; @@ -2942,7 +2942,7 @@ mono_test_marshal_variant_out_short_byref(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_ushort(VARIANT* variant) { variant->vt = VT_UI2; @@ -2951,7 +2951,7 @@ mono_test_marshal_variant_out_ushort(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_ushort_byref(VARIANT* variant) { variant->vt = VT_UI2|VT_BYREF; @@ -2961,7 +2961,7 @@ mono_test_marshal_variant_out_ushort_byref(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_int(VARIANT* variant) { variant->vt = VT_I4; @@ -2970,7 +2970,7 @@ mono_test_marshal_variant_out_int(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_int_byref(VARIANT* variant) { variant->vt = VT_I4|VT_BYREF; @@ -2980,7 +2980,7 @@ mono_test_marshal_variant_out_int_byref(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_uint(VARIANT* variant) { variant->vt = VT_UI4; @@ -2989,7 +2989,7 @@ mono_test_marshal_variant_out_uint(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_uint_byref(VARIANT* variant) { variant->vt = VT_UI4|VT_BYREF; @@ -2999,7 +2999,7 @@ mono_test_marshal_variant_out_uint_byref(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_long(VARIANT* variant) { variant->vt = VT_I8; @@ -3008,7 +3008,7 @@ mono_test_marshal_variant_out_long(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_long_byref(VARIANT* variant) { variant->vt = VT_I8|VT_BYREF; @@ -3018,7 +3018,7 @@ mono_test_marshal_variant_out_long_byref(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_ulong(VARIANT* variant) { variant->vt = VT_UI8; @@ -3027,7 +3027,7 @@ mono_test_marshal_variant_out_ulong(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_ulong_byref(VARIANT* variant) { variant->vt = VT_UI8|VT_BYREF; @@ -3037,7 +3037,7 @@ mono_test_marshal_variant_out_ulong_byref(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_float(VARIANT* variant) { variant->vt = VT_R4; @@ -3046,7 +3046,7 @@ mono_test_marshal_variant_out_float(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_float_byref(VARIANT* variant) { variant->vt = VT_R4|VT_BYREF; @@ -3056,7 +3056,7 @@ mono_test_marshal_variant_out_float_byref(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_double(VARIANT* variant) { variant->vt = VT_R8; @@ -3065,7 +3065,7 @@ mono_test_marshal_variant_out_double(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_double_byref(VARIANT* variant) { variant->vt = VT_R8|VT_BYREF; @@ -3075,7 +3075,7 @@ mono_test_marshal_variant_out_double_byref(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_bstr(VARIANT* variant) { variant->vt = VT_BSTR; @@ -3084,7 +3084,7 @@ mono_test_marshal_variant_out_bstr(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_bstr_byref(VARIANT* variant) { variant->vt = VT_BSTR|VT_BYREF; @@ -3094,7 +3094,7 @@ mono_test_marshal_variant_out_bstr_byref(VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_bool_true (VARIANT* variant) { variant->vt = VT_BOOL; @@ -3103,7 +3103,7 @@ mono_test_marshal_variant_out_bool_true (VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_bool_true_byref (VARIANT* variant) { variant->vt = VT_BOOL|VT_BYREF; @@ -3113,7 +3113,7 @@ mono_test_marshal_variant_out_bool_true_byref (VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_bool_false (VARIANT* variant) { variant->vt = VT_BOOL; @@ -3122,7 +3122,7 @@ mono_test_marshal_variant_out_bool_false (VARIANT* variant) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_bool_false_byref (VARIANT* variant) { variant->vt = VT_BOOL|VT_BYREF; @@ -3135,7 +3135,7 @@ mono_test_marshal_variant_out_bool_false_byref (VARIANT* variant) typedef int (STDCALL *VarFunc) (int vt, VARIANT variant); typedef int (STDCALL *VarRefFunc) (int vt, VARIANT* variant); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_sbyte_unmanaged(VarFunc func) { VARIANT vt; @@ -3144,7 +3144,7 @@ mono_test_marshal_variant_in_sbyte_unmanaged(VarFunc func) return func (VT_I1, vt); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_byte_unmanaged(VarFunc func) { VARIANT vt; @@ -3153,7 +3153,7 @@ mono_test_marshal_variant_in_byte_unmanaged(VarFunc func) return func (VT_UI1, vt); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_short_unmanaged(VarFunc func) { VARIANT vt; @@ -3162,7 +3162,7 @@ mono_test_marshal_variant_in_short_unmanaged(VarFunc func) return func (VT_I2, vt); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_ushort_unmanaged(VarFunc func) { VARIANT vt; @@ -3171,7 +3171,7 @@ mono_test_marshal_variant_in_ushort_unmanaged(VarFunc func) return func (VT_UI2, vt); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_int_unmanaged(VarFunc func) { VARIANT vt; @@ -3180,7 +3180,7 @@ mono_test_marshal_variant_in_int_unmanaged(VarFunc func) return func (VT_I4, vt); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_uint_unmanaged(VarFunc func) { VARIANT vt; @@ -3189,7 +3189,7 @@ mono_test_marshal_variant_in_uint_unmanaged(VarFunc func) return func (VT_UI4, vt); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_long_unmanaged(VarFunc func) { VARIANT vt; @@ -3198,7 +3198,7 @@ mono_test_marshal_variant_in_long_unmanaged(VarFunc func) return func (VT_I8, vt); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_ulong_unmanaged(VarFunc func) { VARIANT vt; @@ -3207,7 +3207,7 @@ mono_test_marshal_variant_in_ulong_unmanaged(VarFunc func) return func (VT_UI8, vt); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_float_unmanaged(VarFunc func) { VARIANT vt; @@ -3216,7 +3216,7 @@ mono_test_marshal_variant_in_float_unmanaged(VarFunc func) return func (VT_R4, vt); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_double_unmanaged(VarFunc func) { VARIANT vt; @@ -3225,7 +3225,7 @@ mono_test_marshal_variant_in_double_unmanaged(VarFunc func) return func (VT_R8, vt); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_bstr_unmanaged(VarFunc func) { VARIANT vt; @@ -3234,7 +3234,7 @@ mono_test_marshal_variant_in_bstr_unmanaged(VarFunc func) return func (VT_BSTR, vt); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_bool_true_unmanaged(VarFunc func) { VARIANT vt; @@ -3243,7 +3243,7 @@ mono_test_marshal_variant_in_bool_true_unmanaged(VarFunc func) return func (VT_BOOL, vt); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_in_bool_false_unmanaged(VarFunc func) { VARIANT vt; @@ -3252,7 +3252,7 @@ mono_test_marshal_variant_in_bool_false_unmanaged(VarFunc func) return func (VT_BOOL, vt); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_sbyte_unmanaged(VarRefFunc func) { VARIANT vt; @@ -3263,7 +3263,7 @@ mono_test_marshal_variant_out_sbyte_unmanaged(VarRefFunc func) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_byte_unmanaged(VarRefFunc func) { VARIANT vt; @@ -3274,7 +3274,7 @@ mono_test_marshal_variant_out_byte_unmanaged(VarRefFunc func) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_short_unmanaged(VarRefFunc func) { VARIANT vt; @@ -3285,7 +3285,7 @@ mono_test_marshal_variant_out_short_unmanaged(VarRefFunc func) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_ushort_unmanaged(VarRefFunc func) { VARIANT vt; @@ -3296,7 +3296,7 @@ mono_test_marshal_variant_out_ushort_unmanaged(VarRefFunc func) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_int_unmanaged(VarRefFunc func) { VARIANT vt; @@ -3307,7 +3307,7 @@ mono_test_marshal_variant_out_int_unmanaged(VarRefFunc func) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_uint_unmanaged(VarRefFunc func) { VARIANT vt; @@ -3318,7 +3318,7 @@ mono_test_marshal_variant_out_uint_unmanaged(VarRefFunc func) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_long_unmanaged(VarRefFunc func) { VARIANT vt; @@ -3329,7 +3329,7 @@ mono_test_marshal_variant_out_long_unmanaged(VarRefFunc func) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_ulong_unmanaged(VarRefFunc func) { VARIANT vt; @@ -3340,7 +3340,7 @@ mono_test_marshal_variant_out_ulong_unmanaged(VarRefFunc func) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_float_unmanaged(VarRefFunc func) { VARIANT vt; @@ -3351,7 +3351,7 @@ mono_test_marshal_variant_out_float_unmanaged(VarRefFunc func) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_double_unmanaged(VarRefFunc func) { VARIANT vt; @@ -3362,7 +3362,7 @@ mono_test_marshal_variant_out_double_unmanaged(VarRefFunc func) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_bstr_unmanaged(VarRefFunc func) { VARIANT vt; @@ -3380,7 +3380,7 @@ mono_test_marshal_variant_out_bstr_unmanaged(VarRefFunc func) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_bool_true_unmanaged(VarRefFunc func) { VARIANT vt; @@ -3391,7 +3391,7 @@ mono_test_marshal_variant_out_bool_true_unmanaged(VarRefFunc func) return 1; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_variant_out_bool_false_unmanaged(VarRefFunc func) { VARIANT vt; @@ -3407,7 +3407,7 @@ typedef struct _StructWithVariant { } StructWithVariant; typedef int (STDCALL *CheckStructWithVariantFunc) (StructWithVariant sv); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_struct_with_variant_in_unmanaged(CheckStructWithVariantFunc func) { StructWithVariant sv; @@ -3431,7 +3431,7 @@ typedef struct _StructWithBstr { } StructWithBstr; typedef int (STDCALL *CheckStructWithBstrFunc) (StructWithBstr sb); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_struct_with_bstr_in_unmanaged(CheckStructWithBstrFunc func) { StructWithBstr sb; @@ -3525,85 +3525,85 @@ MonoQueryInterface(MonoComObject* pUnk, gpointer riid, gpointer* ppv) return 0x80004002; //E_NOINTERFACE; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL MonoAddRef(MonoComObject* pUnk) { return ++(pUnk->m_ref); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL MonoRelease(MonoComObject* pUnk) { return --(pUnk->m_ref); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL SByteIn(MonoComObject* pUnk, char a) { return S_OK; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL ByteIn(MonoComObject* pUnk, unsigned char a) { return S_OK; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL ShortIn(MonoComObject* pUnk, short a) { return S_OK; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL UShortIn(MonoComObject* pUnk, unsigned short a) { return S_OK; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL IntIn(MonoComObject* pUnk, int a) { return S_OK; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL UIntIn(MonoComObject* pUnk, unsigned int a) { return S_OK; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL LongIn(MonoComObject* pUnk, gint64 a) { return S_OK; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL ULongIn(MonoComObject* pUnk, guint64 a) { return S_OK; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL FloatIn(MonoComObject* pUnk, float a) { return S_OK; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL DoubleIn(MonoComObject* pUnk, double a) { return S_OK; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL ITestIn(MonoComObject* pUnk, MonoComObject *pUnk2) { return S_OK; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL ITestOut(MonoComObject* pUnk, MonoComObject* *ppUnk) { return S_OK; @@ -3659,7 +3659,7 @@ GetDefInterface2(MonoComObject* pUnk, MonoDefItfObject **obj) static void create_com_object (MonoComObject** pOut); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL get_ITest(MonoComObject* pUnk, MonoComObject* *ppUnk) { create_com_object (ppUnk); @@ -3700,7 +3700,7 @@ static void create_com_object (MonoComObject** pOut) static MonoComObject* same_object = NULL; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_com_object_create(MonoComObject* *pUnk) { create_com_object (pUnk); @@ -3711,7 +3711,7 @@ mono_test_marshal_com_object_create(MonoComObject* *pUnk) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_com_object_same(MonoComObject* *pUnk) { *pUnk = same_object; @@ -3719,7 +3719,7 @@ mono_test_marshal_com_object_same(MonoComObject* *pUnk) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_com_object_destroy(MonoComObject *pUnk) { int ref = --(pUnk->m_ref); @@ -3729,13 +3729,13 @@ mono_test_marshal_com_object_destroy(MonoComObject *pUnk) return ref; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_com_object_ref_count(MonoComObject *pUnk) { return pUnk->m_ref; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_ccw_itest (MonoComObject *pUnk) { int hr = 0; @@ -3912,7 +3912,7 @@ mono_test_marshal_lookup_symbol (const char *symbol_name) * @test_method_handle: MonoMethod* of the C# test method * @create_object_method_handle: MonoMethod* of thunks.cs:Test.CreateObject */ -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_object_method_handle) { int ret = 0; @@ -3941,7 +3941,7 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj void (*mono_threads_exit_gc_unsafe_region) (gpointer, gpointer) = (void (*)(gpointer, gpointer))lookup_mono_symbol ("mono_threads_exit_gc_unsafe_region"); - + gpointer test_method, ex = NULL; gpointer (STDCALL *CreateObject)(gpointer*); @@ -3964,7 +3964,7 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj ret = 3; goto done; } - + switch (test_id) { @@ -4321,7 +4321,7 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj ret = 5; goto done; } - + a1 = (TestStruct *)mono_object_unbox (obj); if (!a1) { @@ -4363,12 +4363,12 @@ test_method_thunk (int test_id, gpointer test_method_handle, gpointer create_obj return ret; } -typedef struct +typedef struct { char a; } winx64_struct1; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_Winx64_struct1_in (winx64_struct1 var) { if (var.a != 123) @@ -4382,7 +4382,7 @@ typedef struct char b; } winx64_struct2; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_Winx64_struct2_in (winx64_struct2 var) { if (var.a != 4) @@ -4400,7 +4400,7 @@ typedef struct short c; } winx64_struct3; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_Winx64_struct3_in (winx64_struct3 var) { if (var.a != 4) @@ -4420,7 +4420,7 @@ typedef struct unsigned int d; } winx64_struct4; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_Winx64_struct4_in (winx64_struct4 var) { if (var.a != 4) @@ -4441,7 +4441,7 @@ typedef struct char c; } winx64_struct5; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_Winx64_struct5_in (winx64_struct5 var) { if (var.a != 4) @@ -4460,7 +4460,7 @@ typedef struct char c; } winx64_struct6; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_Winx64_struct6_in (winx64_struct6 var) { if (var.a.a != 4) @@ -4472,7 +4472,7 @@ mono_test_Winx64_struct6_in (winx64_struct6 var) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_Winx64_structs_in1 (winx64_struct1 var1, winx64_struct2 var2, winx64_struct3 var3, @@ -4480,19 +4480,19 @@ mono_test_Winx64_structs_in1 (winx64_struct1 var1, { if (var1.a != 123) return 1; - + if (var2.a != 4) return 2; if (var2.b != 5) return 3; - + if (var3.a != 4) return 4; if (var3.b != 5) return 2; if (var3.c != 0x1234) return 5; - + if (var4.a != 4) return 6; if (var4.b != 5) @@ -4504,7 +4504,7 @@ mono_test_Winx64_structs_in1 (winx64_struct1 var1, return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_Winx64_structs_in2 (winx64_struct1 var1, winx64_struct1 var2, winx64_struct1 var3, @@ -4521,11 +4521,11 @@ mono_test_Winx64_structs_in2 (winx64_struct1 var1, return 4; if (var5.a != 5) return 5; - + return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_Winx64_structs_in3 (winx64_struct1 var1, winx64_struct5 var2, winx64_struct1 var3, @@ -4535,24 +4535,24 @@ mono_test_Winx64_structs_in3 (winx64_struct1 var1, { if (var1.a != 1) return 1; - + if (var2.a != 2) return 2; if (var2.b != 3) return 2; if (var2.c != 4) return 4; - + if (var3.a != 5) return 5; - + if (var4.a != 6) return 6; if (var4.b != 7) return 7; if (var4.c != 8) return 8; - + if (var5.a != 9) return 9; @@ -4562,11 +4562,11 @@ mono_test_Winx64_structs_in3 (winx64_struct1 var1, return 11; if (var6.c != 12) return 12; - + return 0; } -LIBTEST_API winx64_struct1 STDCALL +LIBTEST_API winx64_struct1 STDCALL mono_test_Winx64_struct1_ret (void) { winx64_struct1 ret; @@ -4574,7 +4574,7 @@ mono_test_Winx64_struct1_ret (void) return ret; } -LIBTEST_API winx64_struct2 STDCALL +LIBTEST_API winx64_struct2 STDCALL mono_test_Winx64_struct2_ret (void) { winx64_struct2 ret; @@ -4583,7 +4583,7 @@ mono_test_Winx64_struct2_ret (void) return ret; } -LIBTEST_API winx64_struct3 STDCALL +LIBTEST_API winx64_struct3 STDCALL mono_test_Winx64_struct3_ret (void) { winx64_struct3 ret; @@ -4593,7 +4593,7 @@ mono_test_Winx64_struct3_ret (void) return ret; } -LIBTEST_API winx64_struct4 STDCALL +LIBTEST_API winx64_struct4 STDCALL mono_test_Winx64_struct4_ret (void) { winx64_struct4 ret; @@ -4604,7 +4604,7 @@ mono_test_Winx64_struct4_ret (void) return ret; } -LIBTEST_API winx64_struct5 STDCALL +LIBTEST_API winx64_struct5 STDCALL mono_test_Winx64_struct5_ret (void) { winx64_struct5 ret; @@ -4614,7 +4614,7 @@ mono_test_Winx64_struct5_ret (void) return ret; } -LIBTEST_API winx64_struct1 STDCALL +LIBTEST_API winx64_struct1 STDCALL mono_test_Winx64_struct1_ret_5_args (char a, char b, char c, char d, char e) { winx64_struct1 ret; @@ -4638,7 +4638,7 @@ typedef struct float b; } winx64_floatStruct; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_Winx64_floatStruct (winx64_floatStruct a) { if (a.a > 5.6 || a.a < 5.4) @@ -4646,7 +4646,7 @@ mono_test_Winx64_floatStruct (winx64_floatStruct a) if (a.b > 9.6 || a.b < 9.4) return 2; - + return 0; } @@ -4655,18 +4655,18 @@ typedef struct double a; } winx64_doubleStruct; -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_Winx64_doubleStruct (winx64_doubleStruct a) { if (a.a > 5.6 || a.a < 5.4) return 1; - + return 0; } typedef int (STDCALL *managed_struct1_delegate) (winx64_struct1 a); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_managed_Winx64_struct1_in(managed_struct1_delegate func) { winx64_struct1 val; @@ -4676,7 +4676,7 @@ mono_test_managed_Winx64_struct1_in(managed_struct1_delegate func) typedef int (STDCALL *managed_struct5_delegate) (winx64_struct5 a); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_managed_Winx64_struct5_in(managed_struct5_delegate func) { winx64_struct5 val; @@ -4690,7 +4690,7 @@ typedef int (STDCALL *managed_struct1_struct5_delegate) (winx64_struct1 a, winx6 winx64_struct1 c, winx64_struct5 d, winx64_struct1 e, winx64_struct5 f); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_managed_Winx64_struct1_struct5_in(managed_struct1_struct5_delegate func) { winx64_struct1 a, c, e; @@ -4707,7 +4707,7 @@ mono_test_managed_Winx64_struct1_struct5_in(managed_struct1_struct5_delegate fun typedef winx64_struct1 (STDCALL *managed_struct1_ret_delegate) (void); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_Winx64_struct1_ret_managed (managed_struct1_ret_delegate func) { winx64_struct1 ret; @@ -4716,13 +4716,13 @@ mono_test_Winx64_struct1_ret_managed (managed_struct1_ret_delegate func) if (ret.a != 0x45) return 1; - + return 0; } typedef winx64_struct5 (STDCALL *managed_struct5_ret_delegate) (void); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_Winx64_struct5_ret_managed (managed_struct5_ret_delegate func) { winx64_struct5 ret; @@ -4735,112 +4735,112 @@ mono_test_Winx64_struct5_ret_managed (managed_struct5_ret_delegate func) return 2; if (ret.c != 0x56) return 3; - + return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_bool_in (int arg, unsigned int expected, unsigned int bDefaultMarsh, unsigned int bBoolCustMarsh, char bI1CustMarsh, unsigned char bU1CustMarsh, short bVBCustMarsh) { switch (arg) { - case 1: + case 1: if (bDefaultMarsh != expected) return 1; break; - case 2: + case 2: if (bBoolCustMarsh != expected) return 2; break; - case 3: + case 3: if (bI1CustMarsh != expected) return 3; break; - case 4: + case 4: if (bU1CustMarsh != expected) return 4; break; - case 5: + case 5: if (bVBCustMarsh != expected) return 5; break; default: - return 999; + return 999; } return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_bool_out (int arg, unsigned int testVal, unsigned int* bDefaultMarsh, unsigned int* bBoolCustMarsh, char* bI1CustMarsh, unsigned char* bU1CustMarsh, unsigned short* bVBCustMarsh) { switch (arg) { - case 1: + case 1: if (!bDefaultMarsh) return 1; *bDefaultMarsh = testVal; - break; - case 2: + break; + case 2: if (!bBoolCustMarsh) return 2; *bBoolCustMarsh = testVal; - break; - case 3: + break; + case 3: if (!bI1CustMarsh) return 3; *bI1CustMarsh = (char)testVal; - break; - case 4: + break; + case 4: if (!bU1CustMarsh) return 4; *bU1CustMarsh = (unsigned char)testVal; - break; - case 5: + break; + case 5: if (!bVBCustMarsh) return 5; *bVBCustMarsh = (unsigned short)testVal; - break; + break; default: return 999; } return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_bool_ref (int arg, unsigned int expected, unsigned int testVal, unsigned int* bDefaultMarsh, - unsigned int* bBoolCustMarsh, char* bI1CustMarsh, unsigned char* bU1CustMarsh, + unsigned int* bBoolCustMarsh, char* bI1CustMarsh, unsigned char* bU1CustMarsh, unsigned short* bVBCustMarsh) { switch (arg) { - case 1: + case 1: if (!bDefaultMarsh) return 1; if (*bDefaultMarsh != expected) return 2; *bDefaultMarsh = testVal; break; - case 2: + case 2: if (!bBoolCustMarsh) return 3; if (*bBoolCustMarsh != expected) return 4; *bBoolCustMarsh = testVal; break; - case 3: + case 3: if (!bI1CustMarsh) return 5; if (*bI1CustMarsh != expected) return 6; *bI1CustMarsh = (char)testVal; break; - case 4: + case 4: if (!bU1CustMarsh) return 7; if (*bU1CustMarsh != expected) return 8; *bU1CustMarsh = (unsigned char)testVal; break; - case 5: + case 5: if (!bVBCustMarsh) return 9; if (*bVBCustMarsh != expected) @@ -4848,7 +4848,7 @@ mono_test_marshal_bool_ref (int arg, unsigned int expected, unsigned int testVal *bVBCustMarsh = (unsigned short)testVal; break; default: - return 999; + return 999; } return 0; } @@ -4857,7 +4857,7 @@ mono_test_marshal_bool_ref (int arg, unsigned int expected, unsigned int testVal typedef int (STDCALL *MarshalBoolInDelegate) (int arg, unsigned int expected, unsigned int bDefaultMarsh, unsigned int bBoolCustMarsh, char bI1CustMarsh, unsigned char bU1CustMarsh, unsigned short bVBCustMarsh); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_managed_marshal_bool_in (int arg, unsigned int expected, unsigned int testVal, MarshalBoolInDelegate pfcn) { if (!pfcn) @@ -4884,7 +4884,7 @@ mono_test_managed_marshal_bool_in (int arg, unsigned int expected, unsigned int typedef int (STDCALL *MarshalBoolOutDelegate) (int arg, unsigned int expected, unsigned int* bDefaultMarsh, unsigned int* bBoolCustMarsh, char* bI1CustMarsh, unsigned char* bU1CustMarsh, unsigned short* bVBCustMarsh); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_managed_marshal_bool_out (int arg, unsigned int expected, unsigned int testVal, MarshalBoolOutDelegate pfcn) { int ret; @@ -4953,7 +4953,7 @@ mono_test_managed_marshal_bool_out (int arg, unsigned int expected, unsigned int typedef int (STDCALL *MarshalBoolRefDelegate) (int arg, unsigned int expected, unsigned int testVal, unsigned int* bDefaultMarsh, unsigned int* bBoolCustMarsh, char* bI1CustMarsh, unsigned char* bU1CustMarsh, unsigned short* bVBCustMarsh); -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_managed_marshal_bool_ref (int arg, unsigned int expected, unsigned int testVal, unsigned int outExpected, unsigned int outTestVal, MarshalBoolRefDelegate pfcn) { @@ -5027,7 +5027,7 @@ mono_test_managed_marshal_bool_ref (int arg, unsigned int expected, unsigned int #ifdef WIN32 -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_safearray_out_1dim_vt_bstr_empty (SAFEARRAY** safearray) { /* Create an empty one-dimensional array of variants */ @@ -5042,7 +5042,7 @@ mono_test_marshal_safearray_out_1dim_vt_bstr_empty (SAFEARRAY** safearray) return S_OK; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_safearray_out_1dim_vt_bstr (SAFEARRAY** safearray) { /* Create a one-dimensional array of 10 variants filled with "0" to "9" */ @@ -5075,7 +5075,7 @@ mono_test_marshal_safearray_out_1dim_vt_bstr (SAFEARRAY** safearray) return hr; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_safearray_out_2dim_vt_i4 (SAFEARRAY** safearray) { /* Create a two-dimensional array of 4x3 variants filled with 11, 12, 13, etc. */ @@ -5104,14 +5104,14 @@ mono_test_marshal_safearray_out_2dim_vt_i4 (SAFEARRAY** safearray) SafeArrayDestroy (pSA); return hr; } - VariantClear (&vOut); // does a deep destroy of source VARIANT + VariantClear (&vOut); // does a deep destroy of source VARIANT } } *safearray = pSA; return hr; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_safearray_out_4dim_vt_i4 (SAFEARRAY** safearray) { /* Create a four-dimensional array of 10x3x6x7 variants filled with their indices */ @@ -5145,14 +5145,14 @@ mono_test_marshal_safearray_out_4dim_vt_i4 (SAFEARRAY** safearray) return hr; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_safearray_in_byval_1dim_empty (SAFEARRAY* safearray) { /* Check that array is one dimensional and empty */ UINT dim; long lbound, ubound; - + dim = SafeArrayGetDim (safearray); if (dim != 1) return 1; @@ -5166,14 +5166,14 @@ mono_test_marshal_safearray_in_byval_1dim_empty (SAFEARRAY* safearray) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_safearray_in_byval_1dim_vt_i4 (SAFEARRAY* safearray) { /* Check that array is one dimensional containing integers from 1 to 10 */ UINT dim; long lbound, ubound; - VARIANT *pData; + VARIANT *pData; long i; int result=0; @@ -5197,14 +5197,14 @@ mono_test_marshal_safearray_in_byval_1dim_vt_i4 (SAFEARRAY* safearray) return result; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_safearray_in_byval_1dim_vt_mixed (SAFEARRAY* safearray) { /* Check that array is one dimensional containing integers mixed with strings from 0 to 12 */ UINT dim; long lbound, ubound; - VARIANT *pData; + VARIANT *pData; long i; long indices [1]; VARIANT element; @@ -5218,7 +5218,7 @@ mono_test_marshal_safearray_in_byval_1dim_vt_mixed (SAFEARRAY* safearray) SafeArrayGetLBound (safearray, 1, &lbound); SafeArrayGetUBound (safearray, 1, &ubound); - + if ((lbound != 0) || (ubound != 12)) return 1; @@ -5244,7 +5244,7 @@ mono_test_marshal_safearray_in_byval_1dim_vt_mixed (SAFEARRAY* safearray) return result; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_safearray_in_byval_2dim_vt_i4 (SAFEARRAY* safearray) { /* Check that array is one dimensional containing integers mixed with strings from 0 to 12 */ @@ -5299,7 +5299,7 @@ mono_test_marshal_safearray_in_byval_2dim_vt_i4 (SAFEARRAY* safearray) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_safearray_in_byval_3dim_vt_bstr (SAFEARRAY* safearray) { /* Check that array is one dimensional containing integers mixed with strings from 0 to 12 */ @@ -5342,8 +5342,8 @@ mono_test_marshal_safearray_in_byval_3dim_vt_bstr (SAFEARRAY* safearray) indices [2] = k; if (SafeArrayGetElement (safearray, indices, &element) != S_OK) return 1; - failed = ((element.vt != VT_BSTR) - || (VariantChangeType (&element, &element, VARIANT_NOUSEROVERRIDE, VT_I4) != S_OK) + failed = ((element.vt != VT_BSTR) + || (VariantChangeType (&element, &element, VARIANT_NOUSEROVERRIDE, VT_I4) != S_OK) || (element.lVal != 100*(i+1)+10*(j+1)+(k+1))); VariantClear (&element); if (failed) @@ -5365,13 +5365,13 @@ mono_test_marshal_safearray_in_byval_3dim_vt_bstr (SAFEARRAY* safearray) return 0; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_safearray_in_byref_3dim_vt_bstr (SAFEARRAY** safearray) { return mono_test_marshal_safearray_in_byval_3dim_vt_bstr (*safearray); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_safearray_in_out_byref_1dim_empty (SAFEARRAY** safearray) { /* Check that the input array is what is expected and change it so the caller can check */ @@ -5394,7 +5394,7 @@ mono_test_marshal_safearray_in_out_byref_1dim_empty (SAFEARRAY** safearray) SafeArrayGetLBound (*safearray, 1, &lbound); SafeArrayGetUBound (*safearray, 1, &ubound); - + if ((lbound > 0) || (ubound > 0)) { return 1; } @@ -5425,7 +5425,7 @@ mono_test_marshal_safearray_in_out_byref_1dim_empty (SAFEARRAY** safearray) return hr; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_safearray_in_out_byref_3dim_vt_bstr (SAFEARRAY** safearray) { /* Check that the input array is what is expected and change it so the caller can check */ @@ -5474,8 +5474,8 @@ mono_test_marshal_safearray_in_out_byref_3dim_vt_bstr (SAFEARRAY** safearray) indices [2] = k; if (SafeArrayGetElement (*safearray, indices, &element) != S_OK) return 1; - failed = ((element.vt != VT_BSTR) - || (VariantChangeType (&element, &element, VARIANT_NOUSEROVERRIDE, VT_I4) != S_OK) + failed = ((element.vt != VT_BSTR) + || (VariantChangeType (&element, &element, VARIANT_NOUSEROVERRIDE, VT_I4) != S_OK) || (element.lVal != 100*(i+1)+10*(j+1)+(k+1))); VariantClear (&element); if (failed) @@ -5512,7 +5512,7 @@ mono_test_marshal_safearray_in_out_byref_3dim_vt_bstr (SAFEARRAY** safearray) return hr; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_safearray_in_out_byref_1dim_vt_i4 (SAFEARRAY** safearray) { /* Check that the input array is what is expected and change it so the caller can check */ @@ -5524,7 +5524,7 @@ mono_test_marshal_safearray_in_out_byref_1dim_vt_i4 (SAFEARRAY** safearray) HRESULT hr = S_OK; long indices [1]; VARIANT element; - + VariantInit (&element); /* Check that in array is one dimensional and contains the expected value */ @@ -5562,7 +5562,7 @@ mono_test_marshal_safearray_in_out_byref_1dim_vt_i4 (SAFEARRAY** safearray) return hr; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_safearray_in_out_byval_1dim_vt_i4 (SAFEARRAY* safearray) { /* Check that the input array is what is expected and change it so the caller can check */ @@ -5586,7 +5586,7 @@ mono_test_marshal_safearray_in_out_byval_1dim_vt_i4 (SAFEARRAY* safearray) SafeArrayGetLBound (safearray, 1, &lbound1); SafeArrayGetUBound (safearray, 1, &ubound1); - + if ((lbound1 != 0) || (ubound1 != 0)) return 1; @@ -5622,7 +5622,7 @@ mono_test_marshal_safearray_in_out_byval_1dim_vt_i4 (SAFEARRAY* safearray) return hr; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_safearray_in_out_byval_3dim_vt_bstr (SAFEARRAY* safearray) { /* Check that the input array is what is expected and change it so the caller can check */ @@ -5669,8 +5669,8 @@ mono_test_marshal_safearray_in_out_byval_3dim_vt_bstr (SAFEARRAY* safearray) indices [2] = k; if (SafeArrayGetElement (safearray, indices, &element) != S_OK) return 1; - failed = ((element.vt != VT_BSTR) - || (VariantChangeType (&element, &element, VARIANT_NOUSEROVERRIDE, VT_I4) != S_OK) + failed = ((element.vt != VT_BSTR) + || (VariantChangeType (&element, &element, VARIANT_NOUSEROVERRIDE, VT_I4) != S_OK) || (element.lVal != 100*(i+1)+10*(j+1)+(k+1))); VariantClear (&element); if (failed) @@ -5708,7 +5708,7 @@ mono_test_marshal_safearray_in_out_byval_3dim_vt_bstr (SAFEARRAY* safearray) return hr; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_safearray_mixed( SAFEARRAY *safearray1, SAFEARRAY **safearray2, @@ -5805,7 +5805,7 @@ call_managed (gpointer arg) call_managed_res = del (42); } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_thread_attach (SimpleDelegate del) { #ifdef WIN32 @@ -5858,13 +5858,13 @@ typedef int (STDCALL *Callback) (void); static Callback callback; -LIBTEST_API void STDCALL +LIBTEST_API void STDCALL mono_test_marshal_set_callback (Callback cb) { callback = cb; } -LIBTEST_API int STDCALL +LIBTEST_API int STDCALL mono_test_marshal_call_callback (void) { return callback (); @@ -6016,7 +6016,7 @@ mono_return_sbyte1 (sbyte1 s1, int addend) { if (s1.f1 != 1) { fprintf(stderr, "mono_return_sbyte1 s1.f1: got %d but expected %d\n", s1.f1, 1); } - s1.f1+=addend; + s1.f1+=addend; return s1; } @@ -6032,7 +6032,7 @@ mono_return_sbyte2 (sbyte2 s2, int addend) { if (s2.f2 != 2) { fprintf(stderr, "mono_return_sbyte2 s2.f2: got %d but expected %d\n", s2.f2, 2); } - s2.f1+=addend; s2.f2+=addend; + s2.f1+=addend; s2.f2+=addend; return s2; } @@ -6051,7 +6051,7 @@ mono_return_sbyte3 (sbyte3 s3, int addend) { if (s3.f3 != 3) { fprintf(stderr, "mono_return_sbyte3 s3.f3: got %d but expected %d\n", s3.f3, 3); } - s3.f1+=addend; s3.f2+=addend; s3.f3+=addend; + s3.f1+=addend; s3.f2+=addend; s3.f3+=addend; return s3; } @@ -6073,7 +6073,7 @@ mono_return_sbyte4 (sbyte4 s4, int addend) { if (s4.f4 != 4) { fprintf(stderr, "mono_return_sbyte4 s4.f4: got %d but expected %d\n", s4.f4, 4); } - s4.f1+=addend; s4.f2+=addend; s4.f3+=addend; s4.f4+=addend; + s4.f1+=addend; s4.f2+=addend; s4.f3+=addend; s4.f4+=addend; return s4; } @@ -6098,7 +6098,7 @@ mono_return_sbyte5 (sbyte5 s5, int addend) { if (s5.f5 != 5) { fprintf(stderr, "mono_return_sbyte5 s5.f5: got %d but expected %d\n", s5.f5, 5); } - s5.f1+=addend; s5.f2+=addend; s5.f3+=addend; s5.f4+=addend; s5.f5+=addend; + s5.f1+=addend; s5.f2+=addend; s5.f3+=addend; s5.f4+=addend; s5.f5+=addend; return s5; } @@ -6126,7 +6126,7 @@ mono_return_sbyte6 (sbyte6 s6, int addend) { if (s6.f6 != 6) { fprintf(stderr, "mono_return_sbyte6 s6.f6: got %d but expected %d\n", s6.f6, 6); } - s6.f1+=addend; s6.f2+=addend; s6.f3+=addend; s6.f4+=addend; s6.f5+=addend; s6.f6+=addend; + s6.f1+=addend; s6.f2+=addend; s6.f3+=addend; s6.f4+=addend; s6.f5+=addend; s6.f6+=addend; return s6; } @@ -6157,7 +6157,7 @@ mono_return_sbyte7 (sbyte7 s7, int addend) { if (s7.f7 != 7) { fprintf(stderr, "mono_return_sbyte7 s7.f7: got %d but expected %d\n", s7.f7, 7); } - s7.f1+=addend; s7.f2+=addend; s7.f3+=addend; s7.f4+=addend; s7.f5+=addend; s7.f6+=addend; s7.f7+=addend; + s7.f1+=addend; s7.f2+=addend; s7.f3+=addend; s7.f4+=addend; s7.f5+=addend; s7.f6+=addend; s7.f7+=addend; return s7; } @@ -6191,7 +6191,7 @@ mono_return_sbyte8 (sbyte8 s8, int addend) { if (s8.f8 != 8) { fprintf(stderr, "mono_return_sbyte8 s8.f8: got %d but expected %d\n", s8.f8, 8); } - s8.f1+=addend; s8.f2+=addend; s8.f3+=addend; s8.f4+=addend; s8.f5+=addend; s8.f6+=addend; s8.f7+=addend; s8.f8+=addend; + s8.f1+=addend; s8.f2+=addend; s8.f3+=addend; s8.f4+=addend; s8.f5+=addend; s8.f6+=addend; s8.f7+=addend; s8.f8+=addend; return s8; } @@ -6228,7 +6228,7 @@ mono_return_sbyte9 (sbyte9 s9, int addend) { if (s9.f9 != 9) { fprintf(stderr, "mono_return_sbyte9 s9.f9: got %d but expected %d\n", s9.f9, 9); } - s9.f1+=addend; s9.f2+=addend; s9.f3+=addend; s9.f4+=addend; s9.f5+=addend; s9.f6+=addend; s9.f7+=addend; s9.f8+=addend; s9.f9+=addend; + s9.f1+=addend; s9.f2+=addend; s9.f3+=addend; s9.f4+=addend; s9.f5+=addend; s9.f6+=addend; s9.f7+=addend; s9.f8+=addend; s9.f9+=addend; return s9; } @@ -6268,7 +6268,7 @@ mono_return_sbyte10 (sbyte10 s10, int addend) { if (s10.f10 != 10) { fprintf(stderr, "mono_return_sbyte10 s10.f10: got %d but expected %d\n", s10.f10, 10); } - s10.f1+=addend; s10.f2+=addend; s10.f3+=addend; s10.f4+=addend; s10.f5+=addend; s10.f6+=addend; s10.f7+=addend; s10.f8+=addend; s10.f9+=addend; s10.f10+=addend; + s10.f1+=addend; s10.f2+=addend; s10.f3+=addend; s10.f4+=addend; s10.f5+=addend; s10.f6+=addend; s10.f7+=addend; s10.f8+=addend; s10.f9+=addend; s10.f10+=addend; return s10; } @@ -6311,7 +6311,7 @@ mono_return_sbyte11 (sbyte11 s11, int addend) { if (s11.f11 != 11) { fprintf(stderr, "mono_return_sbyte11 s11.f11: got %d but expected %d\n", s11.f11, 11); } - s11.f1+=addend; s11.f2+=addend; s11.f3+=addend; s11.f4+=addend; s11.f5+=addend; s11.f6+=addend; s11.f7+=addend; s11.f8+=addend; s11.f9+=addend; s11.f10+=addend; s11.f11+=addend; + s11.f1+=addend; s11.f2+=addend; s11.f3+=addend; s11.f4+=addend; s11.f5+=addend; s11.f6+=addend; s11.f7+=addend; s11.f8+=addend; s11.f9+=addend; s11.f10+=addend; s11.f11+=addend; return s11; } @@ -6357,7 +6357,7 @@ mono_return_sbyte12 (sbyte12 s12, int addend) { if (s12.f12 != 12) { fprintf(stderr, "mono_return_sbyte12 s12.f12: got %d but expected %d\n", s12.f12, 12); } - s12.f1+=addend; s12.f2+=addend; s12.f3+=addend; s12.f4+=addend; s12.f5+=addend; s12.f6+=addend; s12.f7+=addend; s12.f8+=addend; s12.f9+=addend; s12.f10+=addend; s12.f11+=addend; s12.f12+=addend; + s12.f1+=addend; s12.f2+=addend; s12.f3+=addend; s12.f4+=addend; s12.f5+=addend; s12.f6+=addend; s12.f7+=addend; s12.f8+=addend; s12.f9+=addend; s12.f10+=addend; s12.f11+=addend; s12.f12+=addend; return s12; } @@ -6406,7 +6406,7 @@ mono_return_sbyte13 (sbyte13 s13, int addend) { if (s13.f13 != 13) { fprintf(stderr, "mono_return_sbyte13 s13.f13: got %d but expected %d\n", s13.f13, 13); } - s13.f1+=addend; s13.f2+=addend; s13.f3+=addend; s13.f4+=addend; s13.f5+=addend; s13.f6+=addend; s13.f7+=addend; s13.f8+=addend; s13.f9+=addend; s13.f10+=addend; s13.f11+=addend; s13.f12+=addend; s13.f13+=addend; + s13.f1+=addend; s13.f2+=addend; s13.f3+=addend; s13.f4+=addend; s13.f5+=addend; s13.f6+=addend; s13.f7+=addend; s13.f8+=addend; s13.f9+=addend; s13.f10+=addend; s13.f11+=addend; s13.f12+=addend; s13.f13+=addend; return s13; } @@ -6458,7 +6458,7 @@ mono_return_sbyte14 (sbyte14 s14, int addend) { if (s14.f14 != 14) { fprintf(stderr, "mono_return_sbyte14 s14.f14: got %d but expected %d\n", s14.f14, 14); } - s14.f1+=addend; s14.f2+=addend; s14.f3+=addend; s14.f4+=addend; s14.f5+=addend; s14.f6+=addend; s14.f7+=addend; s14.f8+=addend; s14.f9+=addend; s14.f10+=addend; s14.f11+=addend; s14.f12+=addend; s14.f13+=addend; s14.f14+=addend; + s14.f1+=addend; s14.f2+=addend; s14.f3+=addend; s14.f4+=addend; s14.f5+=addend; s14.f6+=addend; s14.f7+=addend; s14.f8+=addend; s14.f9+=addend; s14.f10+=addend; s14.f11+=addend; s14.f12+=addend; s14.f13+=addend; s14.f14+=addend; return s14; } @@ -6513,7 +6513,7 @@ mono_return_sbyte15 (sbyte15 s15, int addend) { if (s15.f15 != 15) { fprintf(stderr, "mono_return_sbyte15 s15.f15: got %d but expected %d\n", s15.f15, 15); } - s15.f1+=addend; s15.f2+=addend; s15.f3+=addend; s15.f4+=addend; s15.f5+=addend; s15.f6+=addend; s15.f7+=addend; s15.f8+=addend; s15.f9+=addend; s15.f10+=addend; s15.f11+=addend; s15.f12+=addend; s15.f13+=addend; s15.f14+=addend; s15.f15+=addend; + s15.f1+=addend; s15.f2+=addend; s15.f3+=addend; s15.f4+=addend; s15.f5+=addend; s15.f6+=addend; s15.f7+=addend; s15.f8+=addend; s15.f9+=addend; s15.f10+=addend; s15.f11+=addend; s15.f12+=addend; s15.f13+=addend; s15.f14+=addend; s15.f15+=addend; return s15; } @@ -6571,7 +6571,7 @@ mono_return_sbyte16 (sbyte16 s16, int addend) { if (s16.f16 != 16) { fprintf(stderr, "mono_return_sbyte16 s16.f16: got %d but expected %d\n", s16.f16, 16); } - s16.f1+=addend; s16.f2+=addend; s16.f3+=addend; s16.f4+=addend; s16.f5+=addend; s16.f6+=addend; s16.f7+=addend; s16.f8+=addend; s16.f9+=addend; s16.f10+=addend; s16.f11+=addend; s16.f12+=addend; s16.f13+=addend; s16.f14+=addend; s16.f15+=addend; s16.f16+=addend; + s16.f1+=addend; s16.f2+=addend; s16.f3+=addend; s16.f4+=addend; s16.f5+=addend; s16.f6+=addend; s16.f7+=addend; s16.f8+=addend; s16.f9+=addend; s16.f10+=addend; s16.f11+=addend; s16.f12+=addend; s16.f13+=addend; s16.f14+=addend; s16.f15+=addend; s16.f16+=addend; return s16; } @@ -6632,7 +6632,7 @@ mono_return_sbyte17 (sbyte17 s17, int addend) { if (s17.f17 != 17) { fprintf(stderr, "mono_return_sbyte17 s17.f17: got %d but expected %d\n", s17.f17, 17); } - s17.f1+=addend; s17.f2+=addend; s17.f3+=addend; s17.f4+=addend; s17.f5+=addend; s17.f6+=addend; s17.f7+=addend; s17.f8+=addend; s17.f9+=addend; s17.f10+=addend; s17.f11+=addend; s17.f12+=addend; s17.f13+=addend; s17.f14+=addend; s17.f15+=addend; s17.f16+=addend; s17.f17+=addend; + s17.f1+=addend; s17.f2+=addend; s17.f3+=addend; s17.f4+=addend; s17.f5+=addend; s17.f6+=addend; s17.f7+=addend; s17.f8+=addend; s17.f9+=addend; s17.f10+=addend; s17.f11+=addend; s17.f12+=addend; s17.f13+=addend; s17.f14+=addend; s17.f15+=addend; s17.f16+=addend; s17.f17+=addend; return s17; } @@ -6696,7 +6696,7 @@ mono_return_sbyte16_nested (sbyte16_nested sn16, int addend) { if (sn16.nested2.f16 != 16) { fprintf(stderr, "mono_return_sbyte16_nested sn16.nested2.f16: got %d but expected %d\n", sn16.nested2.f16, 16); } - sn16.nested1.f1+=addend; sn16.f2+=addend; sn16.f3+=addend; sn16.f4+=addend; sn16.f5+=addend; sn16.f6+=addend; sn16.f7+=addend; sn16.f8+=addend; sn16.f9+=addend; sn16.f10+=addend; sn16.f11+=addend; sn16.f12+=addend; sn16.f13+=addend; sn16.f14+=addend; sn16.f15+=addend; sn16.nested2.f16+=addend; + sn16.nested1.f1+=addend; sn16.f2+=addend; sn16.f3+=addend; sn16.f4+=addend; sn16.f5+=addend; sn16.f6+=addend; sn16.f7+=addend; sn16.f8+=addend; sn16.f9+=addend; sn16.f10+=addend; sn16.f11+=addend; sn16.f12+=addend; sn16.f13+=addend; sn16.f14+=addend; sn16.f15+=addend; sn16.nested2.f16+=addend; return sn16; } @@ -6710,7 +6710,7 @@ mono_return_short1 (short1 s1, int addend) { if (s1.f1 != 1) { fprintf(stderr, "mono_return_short1 s1.f1: got %d but expected %d\n", s1.f1, 1); } - s1.f1+=addend; + s1.f1+=addend; return s1; } @@ -6726,7 +6726,7 @@ mono_return_short2 (short2 s2, int addend) { if (s2.f2 != 2) { fprintf(stderr, "mono_return_short2 s2.f2: got %d but expected %d\n", s2.f2, 2); } - s2.f1+=addend; s2.f2+=addend; + s2.f1+=addend; s2.f2+=addend; return s2; } @@ -6745,7 +6745,7 @@ mono_return_short3 (short3 s3, int addend) { if (s3.f3 != 3) { fprintf(stderr, "mono_return_short3 s3.f3: got %d but expected %d\n", s3.f3, 3); } - s3.f1+=addend; s3.f2+=addend; s3.f3+=addend; + s3.f1+=addend; s3.f2+=addend; s3.f3+=addend; return s3; } @@ -6767,7 +6767,7 @@ mono_return_short4 (short4 s4, int addend) { if (s4.f4 != 4) { fprintf(stderr, "mono_return_short4 s4.f4: got %d but expected %d\n", s4.f4, 4); } - s4.f1+=addend; s4.f2+=addend; s4.f3+=addend; s4.f4+=addend; + s4.f1+=addend; s4.f2+=addend; s4.f3+=addend; s4.f4+=addend; return s4; } @@ -6792,7 +6792,7 @@ mono_return_short5 (short5 s5, int addend) { if (s5.f5 != 5) { fprintf(stderr, "mono_return_short5 s5.f5: got %d but expected %d\n", s5.f5, 5); } - s5.f1+=addend; s5.f2+=addend; s5.f3+=addend; s5.f4+=addend; s5.f5+=addend; + s5.f1+=addend; s5.f2+=addend; s5.f3+=addend; s5.f4+=addend; s5.f5+=addend; return s5; } @@ -6820,7 +6820,7 @@ mono_return_short6 (short6 s6, int addend) { if (s6.f6 != 6) { fprintf(stderr, "mono_return_short6 s6.f6: got %d but expected %d\n", s6.f6, 6); } - s6.f1+=addend; s6.f2+=addend; s6.f3+=addend; s6.f4+=addend; s6.f5+=addend; s6.f6+=addend; + s6.f1+=addend; s6.f2+=addend; s6.f3+=addend; s6.f4+=addend; s6.f5+=addend; s6.f6+=addend; return s6; } @@ -6851,7 +6851,7 @@ mono_return_short7 (short7 s7, int addend) { if (s7.f7 != 7) { fprintf(stderr, "mono_return_short7 s7.f7: got %d but expected %d\n", s7.f7, 7); } - s7.f1+=addend; s7.f2+=addend; s7.f3+=addend; s7.f4+=addend; s7.f5+=addend; s7.f6+=addend; s7.f7+=addend; + s7.f1+=addend; s7.f2+=addend; s7.f3+=addend; s7.f4+=addend; s7.f5+=addend; s7.f6+=addend; s7.f7+=addend; return s7; } @@ -6885,7 +6885,7 @@ mono_return_short8 (short8 s8, int addend) { if (s8.f8 != 8) { fprintf(stderr, "mono_return_short8 s8.f8: got %d but expected %d\n", s8.f8, 8); } - s8.f1+=addend; s8.f2+=addend; s8.f3+=addend; s8.f4+=addend; s8.f5+=addend; s8.f6+=addend; s8.f7+=addend; s8.f8+=addend; + s8.f1+=addend; s8.f2+=addend; s8.f3+=addend; s8.f4+=addend; s8.f5+=addend; s8.f6+=addend; s8.f7+=addend; s8.f8+=addend; return s8; } @@ -6922,7 +6922,7 @@ mono_return_short9 (short9 s9, int addend) { if (s9.f9 != 9) { fprintf(stderr, "mono_return_short9 s9.f9: got %d but expected %d\n", s9.f9, 9); } - s9.f1+=addend; s9.f2+=addend; s9.f3+=addend; s9.f4+=addend; s9.f5+=addend; s9.f6+=addend; s9.f7+=addend; s9.f8+=addend; s9.f9+=addend; + s9.f1+=addend; s9.f2+=addend; s9.f3+=addend; s9.f4+=addend; s9.f5+=addend; s9.f6+=addend; s9.f7+=addend; s9.f8+=addend; s9.f9+=addend; return s9; } @@ -6962,7 +6962,7 @@ mono_return_short8_nested (short8_nested sn8, int addend) { if (sn8.nested2.f8 != 8) { fprintf(stderr, "mono_return_short8_nested sn8.nested2.f8: got %d but expected %d\n", sn8.nested2.f8, 8); } - sn8.nested1.f1+=addend; sn8.f2+=addend; sn8.f3+=addend; sn8.f4+=addend; sn8.f5+=addend; sn8.f6+=addend; sn8.f7+=addend; sn8.nested2.f8+=addend; + sn8.nested1.f1+=addend; sn8.f2+=addend; sn8.f3+=addend; sn8.f4+=addend; sn8.f5+=addend; sn8.f6+=addend; sn8.f7+=addend; sn8.nested2.f8+=addend; return sn8; } @@ -6976,7 +6976,7 @@ mono_return_int1 (int1 s1, int addend) { if (s1.f1 != 1) { fprintf(stderr, "mono_return_int1 s1.f1: got %d but expected %d\n", s1.f1, 1); } - s1.f1+=addend; + s1.f1+=addend; return s1; } @@ -6992,7 +6992,7 @@ mono_return_int2 (int2 s2, int addend) { if (s2.f2 != 2) { fprintf(stderr, "mono_return_int2 s2.f2: got %d but expected %d\n", s2.f2, 2); } - s2.f1+=addend; s2.f2+=addend; + s2.f1+=addend; s2.f2+=addend; return s2; } @@ -7011,7 +7011,7 @@ mono_return_int3 (int3 s3, int addend) { if (s3.f3 != 3) { fprintf(stderr, "mono_return_int3 s3.f3: got %d but expected %d\n", s3.f3, 3); } - s3.f1+=addend; s3.f2+=addend; s3.f3+=addend; + s3.f1+=addend; s3.f2+=addend; s3.f3+=addend; return s3; } @@ -7033,7 +7033,7 @@ mono_return_int4 (int4 s4, int addend) { if (s4.f4 != 4) { fprintf(stderr, "mono_return_int4 s4.f4: got %d but expected %d\n", s4.f4, 4); } - s4.f1+=addend; s4.f2+=addend; s4.f3+=addend; s4.f4+=addend; + s4.f1+=addend; s4.f2+=addend; s4.f3+=addend; s4.f4+=addend; return s4; } @@ -7058,7 +7058,7 @@ mono_return_int5 (int5 s5, int addend) { if (s5.f5 != 5) { fprintf(stderr, "mono_return_int5 s5.f5: got %d but expected %d\n", s5.f5, 5); } - s5.f1+=addend; s5.f2+=addend; s5.f3+=addend; s5.f4+=addend; s5.f5+=addend; + s5.f1+=addend; s5.f2+=addend; s5.f3+=addend; s5.f4+=addend; s5.f5+=addend; return s5; } @@ -7086,7 +7086,7 @@ mono_return_int4_nested (int4_nested sn4, int addend) { if (sn4.nested2.f4 != 4) { fprintf(stderr, "mono_return_int4_nested sn4.nested2.f4: got %d but expected %d\n", sn4.nested2.f4, 4); } - sn4.nested1.f1+=addend; sn4.f2+=addend; sn4.f3+=addend; sn4.nested2.f4+=addend; + sn4.nested1.f1+=addend; sn4.f2+=addend; sn4.f3+=addend; sn4.nested2.f4+=addend; return sn4; } @@ -7099,7 +7099,7 @@ mono_return_float1 (float1 s1, int addend) { if (s1.f1 != 1) { fprintf(stderr, "mono_return_float1 s1.f1: got %f but expected %d\n", s1.f1, 1); } - s1.f1+=addend; + s1.f1+=addend; return s1; } @@ -7115,7 +7115,7 @@ mono_return_float2 (float2 s2, int addend) { if (s2.f2 != 2) { fprintf(stderr, "mono_return_float2 s2.f2: got %f but expected %d\n", s2.f2, 2); } - s2.f1+=addend; s2.f2+=addend; + s2.f1+=addend; s2.f2+=addend; return s2; } @@ -7134,7 +7134,7 @@ mono_return_float3 (float3 s3, int addend) { if (s3.f3 != 3) { fprintf(stderr, "mono_return_float3 s3.f3: got %f but expected %d\n", s3.f3, 3); } - s3.f1+=addend; s3.f2+=addend; s3.f3+=addend; + s3.f1+=addend; s3.f2+=addend; s3.f3+=addend; return s3; } @@ -7156,7 +7156,7 @@ mono_return_float4 (float4 s4, int addend) { if (s4.f4 != 4) { fprintf(stderr, "mono_return_float4 s4.f4: got %f but expected %d\n", s4.f4, 4); } - s4.f1+=addend; s4.f2+=addend; s4.f3+=addend; s4.f4+=addend; + s4.f1+=addend; s4.f2+=addend; s4.f3+=addend; s4.f4+=addend; return s4; } @@ -7181,7 +7181,7 @@ mono_return_float5 (float5 s5, int addend) { if (s5.f5 != 5) { fprintf(stderr, "mono_return_float5 s5.f5: got %f but expected %d\n", s5.f5, 5); } - s5.f1+=addend; s5.f2+=addend; s5.f3+=addend; s5.f4+=addend; s5.f5+=addend; + s5.f1+=addend; s5.f2+=addend; s5.f3+=addend; s5.f4+=addend; s5.f5+=addend; return s5; } @@ -7209,7 +7209,7 @@ mono_return_float6 (float6 s6, int addend) { if (s6.f6 != 6) { fprintf(stderr, "mono_return_float6 s6.f6: got %f but expected %d\n", s6.f6, 6); } - s6.f1+=addend; s6.f2+=addend; s6.f3+=addend; s6.f4+=addend; s6.f5+=addend; s6.f6+=addend; + s6.f1+=addend; s6.f2+=addend; s6.f3+=addend; s6.f4+=addend; s6.f5+=addend; s6.f6+=addend; return s6; } @@ -7240,7 +7240,7 @@ mono_return_float7 (float7 s7, int addend) { if (s7.f7 != 7) { fprintf(stderr, "mono_return_float7 s7.f7: got %f but expected %d\n", s7.f7, 7); } - s7.f1+=addend; s7.f2+=addend; s7.f3+=addend; s7.f4+=addend; s7.f5+=addend; s7.f6+=addend; s7.f7+=addend; + s7.f1+=addend; s7.f2+=addend; s7.f3+=addend; s7.f4+=addend; s7.f5+=addend; s7.f6+=addend; s7.f7+=addend; return s7; } @@ -7274,7 +7274,7 @@ mono_return_float8 (float8 s8, int addend) { if (s8.f8 != 8) { fprintf(stderr, "mono_return_float8 s8.f8: got %f but expected %d\n", s8.f8, 8); } - s8.f1+=addend; s8.f2+=addend; s8.f3+=addend; s8.f4+=addend; s8.f5+=addend; s8.f6+=addend; s8.f7+=addend; s8.f8+=addend; + s8.f1+=addend; s8.f2+=addend; s8.f3+=addend; s8.f4+=addend; s8.f5+=addend; s8.f6+=addend; s8.f7+=addend; s8.f8+=addend; return s8; } @@ -7311,7 +7311,7 @@ mono_return_float9 (float9 s9, int addend) { if (s9.f9 != 9) { fprintf(stderr, "mono_return_float9 s9.f9: got %f but expected %d\n", s9.f9, 9); } - s9.f1+=addend; s9.f2+=addend; s9.f3+=addend; s9.f4+=addend; s9.f5+=addend; s9.f6+=addend; s9.f7+=addend; s9.f8+=addend; s9.f9+=addend; + s9.f1+=addend; s9.f2+=addend; s9.f3+=addend; s9.f4+=addend; s9.f5+=addend; s9.f6+=addend; s9.f7+=addend; s9.f8+=addend; s9.f9+=addend; return s9; } @@ -7339,7 +7339,7 @@ mono_return_float4_nested (float4_nested sn4, int addend) { if (sn4.nested2.f4 != 4) { fprintf(stderr, "mono_return_float4_nested sn4.nested2.f4: got %f but expected %d\n", sn4.nested2.f4, 4); } - sn4.nested1.f1+=addend; sn4.f2+=addend; sn4.f3+=addend; sn4.nested2.f4+=addend; + sn4.nested1.f1+=addend; sn4.f2+=addend; sn4.f3+=addend; sn4.nested2.f4+=addend; return sn4; } @@ -7352,7 +7352,7 @@ mono_return_double1 (double1 s1, int addend) { if (s1.f1 != 1) { fprintf(stderr, "mono_return_double1 s1.f1: got %f but expected %d\n", s1.f1, 1); } - s1.f1+=addend; + s1.f1+=addend; return s1; } @@ -7368,7 +7368,7 @@ mono_return_double2 (double2 s2, int addend) { if (s2.f2 != 2) { fprintf(stderr, "mono_return_double2 s2.f2: got %f but expected %d\n", s2.f2, 2); } - s2.f1+=addend; s2.f2+=addend; + s2.f1+=addend; s2.f2+=addend; return s2; } @@ -7387,7 +7387,7 @@ mono_return_double3 (double3 s3, int addend) { if (s3.f3 != 3) { fprintf(stderr, "mono_return_double3 s3.f3: got %f but expected %d\n", s3.f3, 3); } - s3.f1+=addend; s3.f2+=addend; s3.f3+=addend; + s3.f1+=addend; s3.f2+=addend; s3.f3+=addend; return s3; } @@ -7409,7 +7409,7 @@ mono_return_double4 (double4 s4, int addend) { if (s4.f4 != 4) { fprintf(stderr, "mono_return_double4 s4.f4: got %f but expected %d\n", s4.f4, 4); } - s4.f1+=addend; s4.f2+=addend; s4.f3+=addend; s4.f4+=addend; + s4.f1+=addend; s4.f2+=addend; s4.f3+=addend; s4.f4+=addend; return s4; } @@ -7434,7 +7434,7 @@ mono_return_double5 (double5 s5, int addend) { if (s5.f5 != 5) { fprintf(stderr, "mono_return_double5 s5.f5: got %f but expected %d\n", s5.f5, 5); } - s5.f1+=addend; s5.f2+=addend; s5.f3+=addend; s5.f4+=addend; s5.f5+=addend; + s5.f1+=addend; s5.f2+=addend; s5.f3+=addend; s5.f4+=addend; s5.f5+=addend; return s5; } @@ -7462,7 +7462,7 @@ mono_return_double6 (double6 s6, int addend) { if (s6.f6 != 6) { fprintf(stderr, "mono_return_double6 s6.f6: got %f but expected %d\n", s6.f6, 6); } - s6.f1+=addend; s6.f2+=addend; s6.f3+=addend; s6.f4+=addend; s6.f5+=addend; s6.f6+=addend; + s6.f1+=addend; s6.f2+=addend; s6.f3+=addend; s6.f4+=addend; s6.f5+=addend; s6.f6+=addend; return s6; } @@ -7493,7 +7493,7 @@ mono_return_double7 (double7 s7, int addend) { if (s7.f7 != 7) { fprintf(stderr, "mono_return_double7 s7.f7: got %f but expected %d\n", s7.f7, 7); } - s7.f1+=addend; s7.f2+=addend; s7.f3+=addend; s7.f4+=addend; s7.f5+=addend; s7.f6+=addend; s7.f7+=addend; + s7.f1+=addend; s7.f2+=addend; s7.f3+=addend; s7.f4+=addend; s7.f5+=addend; s7.f6+=addend; s7.f7+=addend; return s7; } @@ -7527,7 +7527,7 @@ mono_return_double8 (double8 s8, int addend) { if (s8.f8 != 8) { fprintf(stderr, "mono_return_double8 s8.f8: got %f but expected %d\n", s8.f8, 8); } - s8.f1+=addend; s8.f2+=addend; s8.f3+=addend; s8.f4+=addend; s8.f5+=addend; s8.f6+=addend; s8.f7+=addend; s8.f8+=addend; + s8.f1+=addend; s8.f2+=addend; s8.f3+=addend; s8.f4+=addend; s8.f5+=addend; s8.f6+=addend; s8.f7+=addend; s8.f8+=addend; return s8; } @@ -7564,7 +7564,7 @@ mono_return_double9 (double9 s9, int addend) { if (s9.f9 != 9) { fprintf(stderr, "mono_return_double9 s9.f9: got %f but expected %d\n", s9.f9, 9); } - s9.f1+=addend; s9.f2+=addend; s9.f3+=addend; s9.f4+=addend; s9.f5+=addend; s9.f6+=addend; s9.f7+=addend; s9.f8+=addend; s9.f9+=addend; + s9.f1+=addend; s9.f2+=addend; s9.f3+=addend; s9.f4+=addend; s9.f5+=addend; s9.f6+=addend; s9.f7+=addend; s9.f8+=addend; s9.f9+=addend; return s9; } @@ -7585,7 +7585,7 @@ mono_return_double2_nested (double2_nested sn2, int addend) { if (sn2.nested2.f2 != 2) { fprintf(stderr, "mono_return_double2_nested sn2.nested2.f2: got %f but expected %d\n", sn2.nested2.f2, 2); } - sn2.nested1.f1+=addend; sn2.nested2.f2+=addend; + sn2.nested1.f1+=addend; sn2.nested2.f2+=addend; return sn2; } @@ -7609,7 +7609,7 @@ mono_return_double_array4 (double_array4 sa4, int addend) { if (sa4.f1[3] != 4) { fprintf(stderr, "mono_return_double_array4 sa4.f1[3]: got %f but expected %d\n", sa4.f1[3], 4); } - sa4.f1[0]+=addend; sa4.f1[1]+=addend; sa4.f1[2]+=addend; sa4.f1[3]+=addend; + sa4.f1[0]+=addend; sa4.f1[1]+=addend; sa4.f1[2]+=addend; sa4.f1[3]+=addend; return sa4; } @@ -7657,7 +7657,7 @@ mono_test_marshal_fixed_buffer_unicode (FixedBufferUnicode *s) const int NSTRINGS = 6; //test strings -const char *utf8Strings[] = { +const char *utf8Strings[] = { "Managed", "Sîne klâwen durh die wolken sint geslagen" , "काचं शक्नोम्यत्तुम् । नोपहिनस्ति माम्", @@ -7718,7 +7718,7 @@ StringParameterRef(/*ref*/ char **s, int index) { marshal_free (*s); } - // overwrite the orginal + // overwrite the orginal *s = (char *)(marshal_alloc (sizeof(char)* (strLength + 1))); memcpy(*s, pszTextutf8, strLength); (*s)[strLength] = '\0'; @@ -7727,7 +7727,7 @@ StringParameterRef(/*ref*/ char **s, int index) LIBTEST_API void StringBuilderParameterInOut(/*[In,Out] StringBuilder*/ char *s, int index) { - // if string.empty + // if string.empty if (s == 0 || *s == 0) return; @@ -7735,16 +7735,16 @@ StringBuilderParameterInOut(/*[In,Out] StringBuilder*/ char *s, int index) // do byte by byte validation of in string size_t szLen = strlen(s); - for (size_t i = 0; i < szLen; i++) + for (size_t i = 0; i < szLen; i++) { if (s[i] != pszTextutf8[i]) { printf("[in] managed string do not match native string\n"); abort (); } - } + } - // modify the string inplace + // modify the string inplace size_t outLen = strlen(pszTextutf8); for (size_t i = 0; i < outLen; i++) { s[i] = pszTextutf8[i]; @@ -7759,7 +7759,7 @@ StringBuilderParameterOut(/*[Out] StringBuilder*/ char *s, int index) char *pszTextutf8 = (char*)utf8Strings[index]; printf ("SBPO: Receiving %s\n", s); - // modify the string inplace + // modify the string inplace size_t outLen = strlen(pszTextutf8); for (size_t i = 0; i < outLen; i++) { s[i] = pszTextutf8[i]; @@ -7797,9 +7797,9 @@ TestStructWithUtf8Field(struct FieldWithUtf8 fieldStruct) outLen = strlen(pszNative); // do byte by byte comparision - for (size_t i = 0; i < outLen; i++) + for (size_t i = 0; i < outLen; i++) { - if (pszNative[i] != pszManagedutf8[i]) + if (pszNative[i] != pszManagedutf8[i]) { printf("Native and managed string do not match.\n"); abort (); @@ -7812,7 +7812,7 @@ typedef void (* Callback2)(char *text, int index); LIBTEST_API void Utf8DelegateAsParameter(Callback2 managedCallback) { - for (int i = 0; i < NSTRINGS; ++i) + for (int i = 0; i < NSTRINGS; ++i) { char *pszNative = 0; pszNative = (char*)utf8Strings[i]; diff --git a/src/mono/mono/tests/safehandle.2.cs b/src/mono/mono/tests/safehandle.2.cs index 8de22907c47915..89bad1fccb6e62 100644 --- a/src/mono/mono/tests/safehandle.2.cs +++ b/src/mono/mono/tests/safehandle.2.cs @@ -14,8 +14,8 @@ public MyHandle () : base (IntPtr.Zero, true) public MyHandle (IntPtr x) : base (x, true) { } - - + + public override bool IsInvalid { get { return false; @@ -36,7 +36,7 @@ public class MyHandleNoCtor : SafeHandle { public MyHandleNoCtor (IntPtr handle) : base (handle, true) { } - + public override bool IsInvalid { get { return false; @@ -48,7 +48,7 @@ protected override bool ReleaseHandle () return true; } } - + [DllImport ("libtest")] public static extern void mono_safe_handle_ref (ref MyHandle handle); @@ -71,20 +71,20 @@ public static int test_0_safehandle_ref_noctor () try { mono_safe_handle_ref2 (ref m); } catch (MissingMethodException) { - Console.WriteLine ("Good: got exception requried"); + Console.WriteLine ("Good: got exception required"); return 0; } return 1; } - + public static int test_0_safehandle_ref () { MyHandle m = new MyHandle ((IntPtr) 0xdead); MyHandle m_saved = m; mono_safe_handle_ref (ref m); - + if (m.DangerousGetHandle () != (IntPtr) 0x800d){ Console.WriteLine ("test_0_safehandle_ref: fail; Expected 0x800d, got: {0:x}", m.DangerousGetHandle ()); return 1; @@ -135,7 +135,7 @@ public static int test_0_safehandle_ref_nomod_ref () [DllImport ("libtest")] public static extern int mono_xr (SafeHandle sh); - + public static int test_0_marshal_safehandle_argument () { SafeHandle s = new SafeFileHandle ((IntPtr) 0xeadcafe, true); @@ -153,7 +153,7 @@ public static int test_0_marshal_safehandle_argument_null () } return 1; } - + [StructLayout (LayoutKind.Sequential)] public struct StringOnStruct { @@ -172,7 +172,7 @@ public struct StructTest { public struct StructTest1 { public SafeHandle a; } - + [DllImport ("libtest")] public static extern int mono_safe_handle_struct_ref (ref StructTest test); @@ -190,7 +190,7 @@ public struct StructTest1 { [DllImport ("libtest", EntryPoint="mono_safe_handle_return")] public static extern MyHandleNoCtor mono_safe_handle_return_2 (); - + static StructTest x = new StructTest (); public static int test_0_safehandle_return_noctor () @@ -205,7 +205,7 @@ public static int test_0_safehandle_return_noctor () Console.WriteLine ("Failed, expected an exception because there is no parameterless ctor"); return 1; } - + public static int test_0_safehandle_return_exc () { try { @@ -225,7 +225,7 @@ public static int test_0_safehandle_return () Console.WriteLine ("Got the following handle: {0}", x.DangerousGetHandle ()); return x.DangerousGetHandle () == (IntPtr) 0x1000f00d ? 0 : 1; } - + public static int test_0_marshal_safehandle_field () { x.a = 1234; @@ -245,13 +245,13 @@ public static int test_0_marshal_safehandle_field_ref () x.b = 8743; x.handle1 = new SafeFileHandle ((IntPtr) 0x7080feed, false); x.handle2 = new SafeFileHandle ((IntPtr) 0x1234abcd, false); - + if (mono_safe_handle_struct_ref (ref x) != 0xf00d) return 1; return 0; } - + public static int test_0_simple () { StructTest1 s = new StructTest1 (); @@ -271,7 +271,7 @@ public static int test_0_struct_empty () } return 1; } - + public static int test_0_sf_dispose () { SafeFileHandle sf = new SafeFileHandle ((IntPtr) 0x0d00d, false); @@ -290,7 +290,7 @@ static int Error (string msg) Console.WriteLine ("Error: " + msg); return 1; } - + static int Main () { return TestDriver.RunTests (typeof (Tests)); diff --git a/src/mono/mono/tests/verifier/make_access_test.sh b/src/mono/mono/tests/verifier/make_access_test.sh index 72be8020ee54eb..d75fa965ce985a 100755 --- a/src/mono/mono/tests/verifier/make_access_test.sh +++ b/src/mono/mono/tests/verifier/make_access_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -38,7 +38,7 @@ $SED -e "s/SUPER_TYPE/${TEST_SUPER_TYPE}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" - .ver 0:0:0:0 } -// VALIDITY CIL which breaks the ECMA-335 rules. +// VALIDITY CIL which breaks the ECMA-335 rules. // this CIL should fail verification by a conforming CLI verifier. .assembly extern mscorlib @@ -55,7 +55,7 @@ $SED -e "s/SUPER_TYPE/${TEST_SUPER_TYPE}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" - .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void object::.ctor() ret } @@ -71,7 +71,7 @@ $SED -e "s/SUPER_TYPE/${TEST_SUPER_TYPE}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" - .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void SUPER_TYPE::.ctor() ret } diff --git a/src/mono/mono/tests/verifier/make_bad_op_test.sh b/src/mono/mono/tests/verifier/make_bad_op_test.sh index 4356497ea37651..59a4ce6bfb37d2 100755 --- a/src/mono/mono/tests/verifier/make_bad_op_test.sh +++ b/src/mono/mono/tests/verifier/make_bad_op_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -11,7 +11,7 @@ TEST_BYTE_0=$3 TEST_BYTE_1=$4 -if [ "x$TEST_BYTE_1" = "x" ] ; then +if [ "x$TEST_BYTE_1" = "x" ]; then TEST_BYTE_1="0"; fi @@ -19,7 +19,7 @@ TEST_FILE=`echo ${TEST_VALIDITY}_${TEST_NAME} | $SED -e 's/ /_/g' -e 's/\./_/g' echo $TEST_FILE $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/BYTE_0/${TEST_BYTE_0}/g" -e "s/BYTE_1/${TEST_BYTE_1}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi TEST_NAME=$1 @@ -26,7 +26,7 @@ TEST_TYPE1=`echo $TEST_TYPE1 | $SED -s 's/&/\\\&/'` TEST_TYPE2=`echo $TEST_TYPE2 | $SED -s 's/&/\\\&/'` $SED -e "s/INIT/${TEST_INIT}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE1/${TEST_TYPE1}/g" -e "s/TYPE2/${TEST_TYPE2}/g" -e "s/OPCODE/${TEST_OP}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -17,7 +17,7 @@ echo $TEST_FILE TEST_TYPE1=`echo $TEST_TYPE1 | $SED -s 's/&/\\\&/'` $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE1/${TEST_TYPE1}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/EXTRAS/${TEST_EXTRAS}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -37,7 +37,7 @@ $SED -e "s/TYPE/${TEST_TYPE}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/BEFORE_OP/${T .class interface public auto ansi abstract IFace { - .method public virtual hidebysig newslot abstract instance default void Tst () cil managed + .method public virtual hidebysig newslot abstract instance default void Tst () cil managed { } } @@ -46,48 +46,48 @@ $SED -e "s/TYPE/${TEST_TYPE}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/BEFORE_OP/${T { .field public int32 fld - .method public hidebysig specialname rtspecialname instance default void '.ctor' () cil managed + .method public hidebysig specialname rtspecialname instance default void '.ctor' () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void object::'.ctor'() - ret + ret } } .class public auto ansi beforefieldinit IFaceImpl extends BaseClass implements IFace { - .method public hidebysig specialname rtspecialname instance default void '.ctor' () cil managed + .method public hidebysig specialname rtspecialname instance default void '.ctor' () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void BaseClass::'.ctor'() - ret + ret } - .method public final virtual hidebysig newslot instance default void Tst () cil managed + .method public final virtual hidebysig newslot instance default void Tst () cil managed { .maxstack 8 - ret + ret } } .class public auto ansi sealed TstDelegate extends [mscorlib]System.MulticastDelegate { - .method public hidebysig specialname rtspecialname instance default void '.ctor' (object 'object', native int 'method') runtime managed + .method public hidebysig specialname rtspecialname instance default void '.ctor' (object 'object', native int 'method') runtime managed { } - .method public virtual hidebysig newslot instance default void Invoke () runtime managed + .method public virtual hidebysig newslot instance default void Invoke () runtime managed { } - .method public virtual hidebysig newslot instance default class [mscorlib]System.IAsyncResult BeginInvoke (class [mscorlib]System.AsyncCallback callback, object 'object') runtime managed + .method public virtual hidebysig newslot instance default class [mscorlib]System.IAsyncResult BeginInvoke (class [mscorlib]System.AsyncCallback callback, object 'object') runtime managed { } - .method public virtual hidebysig newslot - instance default void EndInvoke (class [mscorlib]System.IAsyncResult result) runtime managed + .method public virtual hidebysig newslot + instance default void EndInvoke (class [mscorlib]System.IAsyncResult result) runtime managed { } } @@ -97,16 +97,16 @@ $SED -e "s/TYPE/${TEST_TYPE}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/BEFORE_OP/${T .field !T t .field ${TEST_CONSTRAINT_TYPE} ifField - .method public hidebysig specialname rtspecialname instance default void .ctor (!T A_0) cil managed + .method public hidebysig specialname rtspecialname instance default void .ctor (!T A_0) cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void object::.ctor() ldarg.0 ldarg.1 stfld !0 class DriverClass::t - ret + ret } .method public void Driver () @@ -134,7 +134,7 @@ $SED -e "s/TYPE/${TEST_TYPE}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/BEFORE_OP/${T TARGET: leave END END: - ret + ret } } @@ -152,7 +152,7 @@ END: call instance void class DriverClass::Driver() ldc.i4.0 - ret + ret } //EOF diff --git a/src/mono/mono/tests/verifier/make_branch_test.sh b/src/mono/mono/tests/verifier/make_branch_test.sh index 9ea87a414cfec2..459a32589bba2e 100755 --- a/src/mono/mono/tests/verifier/make_branch_test.sh +++ b/src/mono/mono/tests/verifier/make_branch_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -23,7 +23,7 @@ echo $TEST_FILE $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/FINALLY/${TEST_FIN}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -29,7 +29,7 @@ TEST_FILE=${TEST_NAME}_generated.il echo $TEST_FILE $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/LOAD_ARGS/${TEST_LOAD_ARGS}/g" -e "s/MEMBER_OP/${MEMBER_TEST_OP}/g" -e "s/MEMBER_LD_ARGS/${MEMBER_TEST_LOAD_ARGS}/g" -e "s/EXTRA_STUFF/${TEST_EXTRA_STUFF}/g" -e "s/EXTRA/${MEMBER_TEST_EXTRA_STUFF}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -18,7 +18,7 @@ TEST_FILE=${TEST_NAME}_generated.il echo $TEST_FILE $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/LOCAL/${TEST_LOCAL}/g" -e "s/LOAD/${TEST_LOAD}/g" -e "s/OP/${TEST_OP}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -49,12 +49,12 @@ $SED -e "s/TYPE/${TEST_TYPE}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/BEFORE_OP/${T { .field public int32 valid - .method public hidebysig specialname rtspecialname instance default void .ctor (int32&) cil managed + .method public hidebysig specialname rtspecialname instance default void .ctor (int32&) cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void object::.ctor() - ret + ret } .method public virtual void VirtTest (ClassA& arg) @@ -120,7 +120,7 @@ $SED -e "s/TYPE/${TEST_TYPE}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/BEFORE_OP/${T leave END END: ldc.i4.0 - ret + ret } //EOF diff --git a/src/mono/mono/tests/verifier/make_constrained_test.sh b/src/mono/mono/tests/verifier/make_constrained_test.sh index 12154b1f12df7c..d45d2e9c0211f3 100755 --- a/src/mono/mono/tests/verifier/make_constrained_test.sh +++ b/src/mono/mono/tests/verifier/make_constrained_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -19,7 +19,7 @@ TEST_FILE=${TEST_NAME}_generated.il echo $TEST_FILE $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/CONSTRAINED_TYPE/${TEST_CONSTRAINED_TYPE}/g" -e "s/ARG_TYPE/${TEST_ARG_TYPE}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/LOAD_OP/${TEST_LOAD_OP}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -107,7 +107,7 @@ $SED -e "s/EXTRA_OPS/${TEST_EXTRA_OPS}/g" -e "s/TYPE1/${TEST_TYPE1}/g" -e "s/VAL ldc.i4.0 - ret + ret } //EOF diff --git a/src/mono/mono/tests/verifier/make_cross_nested_access_test.sh b/src/mono/mono/tests/verifier/make_cross_nested_access_test.sh index b94b7e960bf38c..f57e0ce01603e9 100755 --- a/src/mono/mono/tests/verifier/make_cross_nested_access_test.sh +++ b/src/mono/mono/tests/verifier/make_cross_nested_access_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -39,7 +39,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/CONSTRU .ver 0:0:0:0 } -// VALIDITY CIL which breaks the ECMA-335 rules. +// VALIDITY CIL which breaks the ECMA-335 rules. // this CIL should fail verification by a conforming CLI verifier. .assembly extern mscorlib @@ -60,7 +60,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/CONSTRU .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void object::.ctor() ret } @@ -73,7 +73,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/CONSTRU .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void object::.ctor() ret } @@ -82,8 +82,8 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/CONSTRU { .maxstack 8 ldc.i4.0 - ret - } + ret + } } .class nested public Test EXTENDS @@ -91,7 +91,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/CONSTRU .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 CONSTRUCTOR ret } @@ -103,7 +103,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/CONSTRU OPCODE // VALIDITY. pop ret - } + } } } diff --git a/src/mono/mono/tests/verifier/make_ctor_test.sh b/src/mono/mono/tests/verifier/make_ctor_test.sh index 6325f616797105..9078b809c09321 100755 --- a/src/mono/mono/tests/verifier/make_ctor_test.sh +++ b/src/mono/mono/tests/verifier/make_ctor_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -36,35 +36,35 @@ $SED -e "s/CODE/${TEST_CODE}/g" -e "s/OTHER/${TEST_OTHER_CODE}/g" -e "s/VALIDITY .module delegate_test.exe .class ansi beforefieldinit TestClass extends [mscorlib]System.Object { - .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed + .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 ldarg.0 call instance void object::'.ctor'() - ret + ret } - .method public hidebysig specialname rtspecialname instance default void .ctor (object V_1) cil managed + .method public hidebysig specialname rtspecialname instance default void .ctor (object V_1) cil managed { .maxstack 8 ldarg.0 call instance void object::'.ctor'() - ret + ret } } .module delegate_test.exe .class ansi beforefieldinit TestSubClass extends TestClass { - .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed + .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 ldarg.0 OTHER - + leave END END: - ret + ret } } @@ -76,29 +76,29 @@ END: .field int32 val .field object obj - .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed + .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 .locals init (Test V_0) ldarg.0 CODE - + leave END END: - ret + ret } - .method public hidebysig static default void StaticMethod (object A_0) cil managed + .method public hidebysig static default void StaticMethod (object A_0) cil managed { .maxstack 8 - ret + ret } - .method public hidebysig instance default void InstanceMethod () cil managed + .method public hidebysig instance default void InstanceMethod () cil managed { .maxstack 8 - ret + ret } } @@ -107,13 +107,13 @@ END: .class public auto ansi beforefieldinit Driver extends [mscorlib]System.Object { - .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed + .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 ldarg.0 call instance void object::'.ctor'() - ret + ret } .method public static int32 Main () @@ -124,7 +124,7 @@ END: newobj instance void ${TARGET_TYPE}::.ctor() pop ldc.i4.0 - ret + ret } } diff --git a/src/mono/mono/tests/verifier/make_delegate_compat_test.sh b/src/mono/mono/tests/verifier/make_delegate_compat_test.sh index 31b8581fbe7f68..31a38082276e85 100755 --- a/src/mono/mono/tests/verifier/make_delegate_compat_test.sh +++ b/src/mono/mono/tests/verifier/make_delegate_compat_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -18,7 +18,7 @@ TEST_USE_NATIVE=$9 TCONV_1="default" TCONV_2="" -if [ "$TEST_CCONV1" != "" ]; then +if [ -z "$TEST_CCONV1" ]; then TCONV_1=$TEST_CCONV1 TCONV_2=$TEST_CCONV2 fi @@ -63,7 +63,7 @@ echo $TEST_FILE $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/RET_1/${TEST_RET_TYPE1}/g" -e "s/RET_2/${TEST_RET_TYPE2}/g" -e "s/PARAM_1/${TEST_PARAM_TYPE1}/g" -e "s/PARAM_2/${TEST_PARAM_TYPE2}/g"> $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -38,99 +38,99 @@ $SED -e "s/OPCODE/${TEST_OP}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/DELEGAT { .field private int32 dd - .method public virtual hidebysig instance default string ToString () cil managed + .method public virtual hidebysig instance default string ToString () cil managed { .maxstack 8 ldstr "test" - ret + ret } - .method public hidebysig instance default void NonVirtMethod () cil managed + .method public hidebysig instance default void NonVirtMethod () cil managed { .maxstack 8 - ret + ret } } .class public auto ansi sealed ToStringDelegate extends [mscorlib]System.MulticastDelegate { - .method public hidebysig specialname rtspecialname - instance default void .ctor (object 'object', native int 'method') runtime managed + .method public hidebysig specialname rtspecialname + instance default void .ctor (object 'object', native int 'method') runtime managed { } .method public virtual hidebysig newslot - instance default string Invoke () runtime managed + instance default string Invoke () runtime managed { } - .method public virtual hidebysig newslot - instance default class [mscorlib]System.IAsyncResult BeginInvoke (class [mscorlib]System.AsyncCallback callback, object 'object') runtime managed + .method public virtual hidebysig newslot + instance default class [mscorlib]System.IAsyncResult BeginInvoke (class [mscorlib]System.AsyncCallback callback, object 'object') runtime managed { } - .method public virtual hidebysig newslot - instance default string EndInvoke (class [mscorlib]System.IAsyncResult result) runtime managed + .method public virtual hidebysig newslot + instance default string EndInvoke (class [mscorlib]System.IAsyncResult result) runtime managed { } } .class public auto ansi sealed DelegateNoArg extends [mscorlib]System.MulticastDelegate { - .method public hidebysig specialname rtspecialname - instance default void .ctor (object 'object', native int 'method') runtime managed + .method public hidebysig specialname rtspecialname + instance default void .ctor (object 'object', native int 'method') runtime managed { } .method public virtual hidebysig newslot - instance default void Invoke () runtime managed + instance default void Invoke () runtime managed { } - .method public virtual hidebysig newslot - instance default class [mscorlib]System.IAsyncResult BeginInvoke (class [mscorlib]System.AsyncCallback callback, object 'object') runtime managed + .method public virtual hidebysig newslot + instance default class [mscorlib]System.IAsyncResult BeginInvoke (class [mscorlib]System.AsyncCallback callback, object 'object') runtime managed { } - .method public virtual hidebysig newslot - instance default void EndInvoke (class [mscorlib]System.IAsyncResult result) runtime managed + .method public virtual hidebysig newslot + instance default void EndInvoke (class [mscorlib]System.IAsyncResult result) runtime managed { } -} +} .class public auto ansi sealed DelegateIntArg extends [mscorlib]System.MulticastDelegate { - .method public hidebysig specialname rtspecialname - instance default void .ctor (object 'object', native int 'method') runtime managed + .method public hidebysig specialname rtspecialname + instance default void .ctor (object 'object', native int 'method') runtime managed { } .method public virtual hidebysig newslot - instance default void Invoke (int32 d) runtime managed + instance default void Invoke (int32 d) runtime managed { } - .method public virtual hidebysig newslot - instance default class [mscorlib]System.IAsyncResult BeginInvoke (int32 d, class [mscorlib]System.AsyncCallback callback, object 'object') runtime managed + .method public virtual hidebysig newslot + instance default class [mscorlib]System.IAsyncResult BeginInvoke (int32 d, class [mscorlib]System.AsyncCallback callback, object 'object') runtime managed { } - .method public virtual hidebysig newslot - instance default void EndInvoke (class [mscorlib]System.IAsyncResult result) runtime managed + .method public virtual hidebysig newslot + instance default void EndInvoke (class [mscorlib]System.IAsyncResult result) runtime managed { } -} +} .class public Parent extends [mscorlib]System.Object { - .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed + .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 ldarg.0 call instance void object::.ctor() - ret + ret } .method public virtual void VirtMethod () @@ -163,12 +163,12 @@ $SED -e "s/OPCODE/${TEST_OP}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/DELEGAT .class public auto ansi beforefieldinit Driver extends Parent { - .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed + .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 ldarg.0 call instance void Parent::.ctor() - ret + ret } .method public static void Method () @@ -210,7 +210,7 @@ $SED -e "s/OPCODE/${TEST_OP}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/DELEGAT { .maxstack 8 .locals init (MyValueType V_0) - + OPCODE LDFTN_OP DELEGATE_OP: @@ -234,11 +234,11 @@ DELEGATE_OP: { pop leave END - + } END: ldc.i4.0 - ret + ret } } diff --git a/src/mono/mono/tests/verifier/make_double_nesting_test.sh b/src/mono/mono/tests/verifier/make_double_nesting_test.sh index f6271e2fb9599a..2fc11c759cb8f5 100755 --- a/src/mono/mono/tests/verifier/make_double_nesting_test.sh +++ b/src/mono/mono/tests/verifier/make_double_nesting_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -50,7 +50,7 @@ $SED -e "s/CLASS_ACCESS/${TEST_CLASS_ACCESS}/g" -e "s/NESTED_ACCESS/${TEST_NESTE .ver 0:0:0:0 } -// VALIDITY CIL which breaks the ECMA-335 rules. +// VALIDITY CIL which breaks the ECMA-335 rules. // this CIL should fail verification by a conforming CLI verifier. .assembly extern mscorlib @@ -71,7 +71,7 @@ $SED -e "s/CLASS_ACCESS/${TEST_CLASS_ACCESS}/g" -e "s/NESTED_ACCESS/${TEST_NESTE .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void object::.ctor() ret } @@ -84,7 +84,7 @@ $SED -e "s/CLASS_ACCESS/${TEST_CLASS_ACCESS}/g" -e "s/NESTED_ACCESS/${TEST_NESTE .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void object::.ctor() ret } @@ -93,8 +93,8 @@ $SED -e "s/CLASS_ACCESS/${TEST_CLASS_ACCESS}/g" -e "s/NESTED_ACCESS/${TEST_NESTE { .maxstack 8 ldc.i4.0 - ret - } + ret + } } } @@ -112,7 +112,7 @@ $SED -e "s/CLASS_ACCESS/${TEST_CLASS_ACCESS}/g" -e "s/NESTED_ACCESS/${TEST_NESTE .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 ROOT_CONSTRUCTOR ret } @@ -123,13 +123,13 @@ $SED -e "s/CLASS_ACCESS/${TEST_CLASS_ACCESS}/g" -e "s/NESTED_ACCESS/${TEST_NESTE { .maxstack 8 ldc.i4.0 - ret + ret } .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 NESTED_CONSTRUCTOR ret } diff --git a/src/mono/mono/tests/verifier/make_endfilter_test.sh b/src/mono/mono/tests/verifier/make_endfilter_test.sh index 5f6c53871d23e3..24c38e9a9760a9 100755 --- a/src/mono/mono/tests/verifier/make_endfilter_test.sh +++ b/src/mono/mono/tests/verifier/make_endfilter_test.sh @@ -1,6 +1,6 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -42,11 +42,11 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/FILTER_EXTRAS/${TEST_FILTER_EXTRAS .try { nop - nop + nop ${LEAVE_2} } - catch [mscorlib]System.Exception + catch [mscorlib]System.Exception { pop ${LEAVE_3} @@ -73,14 +73,14 @@ TRY_2: leave END - } catch [mscorlib]System.Exception + } catch [mscorlib]System.Exception { pop leave END } NEXT_4: - .try + .try { nop nop diff --git a/src/mono/mono/tests/verifier/make_endfinally_test.sh b/src/mono/mono/tests/verifier/make_endfinally_test.sh index 1038536faec81a..2234131faa1a69 100755 --- a/src/mono/mono/tests/verifier/make_endfinally_test.sh +++ b/src/mono/mono/tests/verifier/make_endfinally_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -39,7 +39,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/LOCAL/${TEST_LOCAL}/g" -e "s/BLOC ${OPCODE_2} leave TRY_2 } - catch [mscorlib]System.NullReferenceException + catch [mscorlib]System.NullReferenceException { pop ${OPCODE_3} @@ -70,7 +70,7 @@ TRY_3: nop leave TRY_4 } - catch [mscorlib]System.NullReferenceException + catch [mscorlib]System.NullReferenceException { pop ${OPCODE_5} @@ -86,7 +86,7 @@ TRY_3: TRY_4: - .try + .try { nop leave END diff --git a/src/mono/mono/tests/verifier/make_exception_branch_test.sh b/src/mono/mono/tests/verifier/make_exception_branch_test.sh index c46d8820ccdf85..88111a2033bed0 100755 --- a/src/mono/mono/tests/verifier/make_exception_branch_test.sh +++ b/src/mono/mono/tests/verifier/make_exception_branch_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -18,7 +18,7 @@ TEST_OP5=$7 TEST_FILE=${TEST_VALIDITY}_exception_branch_${TEST_NAME}_generated.il echo $TEST_FILE $SED -e "s/OPCODE1/${TEST_OP1}/g" -e "s/OPCODE2/${TEST_OP2}/g" -e "s/OPCODE3/${TEST_OP3}/g" -e "s/OPCODE4/${TEST_OP4}/g" -e "s/OPCODE5/${TEST_OP5}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -25,7 +25,7 @@ AFTER_PREFIX_3: pop FILTER_BLOCK_3_A: - stloc.0 + stloc.0 nop nop ldc.i4.0 @@ -48,7 +48,7 @@ AFTER_PREFIX_6: pop FINALLY_BLOCK_1_A: - stloc.0 + stloc.0 nop nop ldc.i4.0 @@ -76,7 +76,7 @@ $SED -e "s/EXCEPTION_BLOCK_1/${TEST_BLOCK_1}/g" -e "s/EXCEPTION_BLOCK_2/${TEST_B .entrypoint .maxstack 8 .locals init (object _X0, int32 V0) - + ldloca 1 volatile. AFTER_PREFIX_1: @@ -84,7 +84,7 @@ AFTER_PREFIX_1: ldind.i4 pop - + TRY_BLOCK_1: nop TRY_BLOCK_1_A: @@ -111,7 +111,7 @@ ${FINALLY_BLOCK} CATCH_BLOCK_1: nop CATCH_BLOCK_1_A: - stloc.0 + stloc.0 nop ldloca 1 @@ -147,7 +147,7 @@ TRY_BLOCK_2_END: CATCH_BLOCK_2: nop CATCH_BLOCK_2_A: - stloc.0 + stloc.0 nop nop leave END diff --git a/src/mono/mono/tests/verifier/make_field_store_test.sh b/src/mono/mono/tests/verifier/make_field_store_test.sh index 8d72117ffc2918..b605bbd0edcfe7 100755 --- a/src/mono/mono/tests/verifier/make_field_store_test.sh +++ b/src/mono/mono/tests/verifier/make_field_store_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -30,7 +30,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/CSTOR/${TEST_CSTOR}/g" -e "s/OPC .ver 0:0:0:0 } -// VALIDITY CIL which breaks the ECMA-335 rules. +// VALIDITY CIL which breaks the ECMA-335 rules. // this CIL should fail verification by a conforming CLI verifier. .assembly extern mscorlib @@ -60,7 +60,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/CSTOR/${TEST_CSTOR}/g" -e "s/OPC .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void object::.ctor() ret } @@ -76,7 +76,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/CSTOR/${TEST_CSTOR}/g" -e "s/OPC .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void object::.ctor() ret } @@ -90,7 +90,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/CSTOR/${TEST_CSTOR}/g" -e "s/OPC .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void ClassA::.ctor() ret } @@ -109,7 +109,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/CSTOR/${TEST_CSTOR}/g" -e "s/OPC .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void object::.ctor() ret } @@ -122,7 +122,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/CSTOR/${TEST_CSTOR}/g" -e "s/OPC .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void Overlapped::.ctor() ret } diff --git a/src/mono/mono/tests/verifier/make_field_valuetype_test.sh b/src/mono/mono/tests/verifier/make_field_valuetype_test.sh index ccc55e1e644e51..c62ba7b4dca6df 100755 --- a/src/mono/mono/tests/verifier/make_field_valuetype_test.sh +++ b/src/mono/mono/tests/verifier/make_field_valuetype_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -21,7 +21,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/LOAD/${TEST_LOAD}/g" -e "s/OPCOD .ver 0:0:0:0 } -// VALIDITY CIL which breaks the ECMA-335 rules. +// VALIDITY CIL which breaks the ECMA-335 rules. // this CIL should fail verification by a conforming CLI verifier. .assembly extern mscorlib diff --git a/src/mono/mono/tests/verifier/make_generic_argument_constraints_test.sh b/src/mono/mono/tests/verifier/make_generic_argument_constraints_test.sh index 0f0769ef5d51f8..c75795fb6cbce3 100755 --- a/src/mono/mono/tests/verifier/make_generic_argument_constraints_test.sh +++ b/src/mono/mono/tests/verifier/make_generic_argument_constraints_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -12,18 +12,16 @@ TEST_DEST=$4 TEST_INST_TYPE=$5 INST_TYPE="DefaultArgument"; -if [ "$TEST_INST_TYPE" != "" ]; then +if [ -n "$TEST_INST_TYPE" ]; then INST_TYPE="$TEST_INST_TYPE"; fi - - TEST_NAME=${TEST_VALIDITY}_${TEST_NAME} TEST_FILE=${TEST_NAME}_generated.il echo $TEST_FILE $SED -e "s/INIT/${TEST_INIT}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TARGET_CONSTRAINT/${TEST_DEST}/g" -e "s/SOURCE_CONSTRAINT/${TEST_SRC}/g" > $TEST_FILE < () @@ -110,7 +108,7 @@ $SED -e "s/INIT/${TEST_INIT}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TARGET_ call void class Test2< $INST_TYPE >::Method() ldc.i4.0 - ret + ret } //EOF diff --git a/src/mono/mono/tests/verifier/make_il_overflow_test.sh b/src/mono/mono/tests/verifier/make_il_overflow_test.sh index 8bc47a91bee142..55f52e4bd8fdac 100755 --- a/src/mono/mono/tests/verifier/make_il_overflow_test.sh +++ b/src/mono/mono/tests/verifier/make_il_overflow_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -14,23 +14,23 @@ TEST_BYTE_3=$6 TEST_BYTE_4=$7 -if [ "$TEST_BYTE_1" != "" ] ; then +if [ -n "$TEST_BYTE_1" ]; then EMIT_BYTE_1=".emitbyte $TEST_BYTE_1"; fi -if [ "$TEST_BYTE_2" != "" ] ; then +if [ -n "$TEST_BYTE_2" ]; then EMIT_BYTE_2=".emitbyte $TEST_BYTE_2"; fi -if [ "$TEST_BYTE_3" != "" ] ; then +if [ -n "$TEST_BYTE_3" ]; then EMIT_BYTE_3=".emitbyte $TEST_BYTE_3"; fi -if [ "$TEST_BYTE_4" != "" ] ; then +if [ -n "$TEST_BYTE_4" ]; then EMIT_BYTE_4=".emitbyte $TEST_BYTE_4"; fi -if [ "$TEST_BYTE_5" != "" ] ; then +if [ -n "$TEST_BYTE_5" ]; then EMIT_BYTE_5=".emitbyte $TEST_BYTE_5"; fi @@ -38,7 +38,7 @@ TEST_FILE=`echo ${TEST_VALIDITY}_${TEST_NAME} | $SED -e 's/ /_/g' -e 's/\./_/g' echo $TEST_FILE $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/BYTE_0/${TEST_BYTE_0}/g" -e "s/BYTE_1/${TEST_BYTE_1}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -86,7 +86,7 @@ $SED -e "s/TYPE1/${TEST_TYPE1}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE2 initobj TYPE2 // VALIDITY ldc.i4.0 - ret + ret } //EOF diff --git a/src/mono/mono/tests/verifier/make_invalid_ret_type.sh b/src/mono/mono/tests/verifier/make_invalid_ret_type.sh index 3b68b51ae89ad2..0dbcd9f0927f74 100755 --- a/src/mono/mono/tests/verifier/make_invalid_ret_type.sh +++ b/src/mono/mono/tests/verifier/make_invalid_ret_type.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -16,7 +16,7 @@ echo $TEST_FILE $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE/${TEST_TYPE}/g" > $TEST_FILE < $TEST_FILE .class public auto ansi beforefieldinit Driver extends [mscorlib]System.Object { - .method public static hidebysig default TYPE Foo () cil managed + .method public static hidebysig default TYPE Foo () cil managed { .maxstack 8 .locals init (TYPE V_0) - ldloc.0 - ret + ldloc.0 + ret } - .method public static hidebysig default int32 Main () cil managed + .method public static hidebysig default int32 Main () cil managed { .entrypoint .maxstack 2 @@ -43,7 +43,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE/${TEST_TYPE}/g" > $TEST_FILE call TYPE class Driver::Foo() pop ldc.i4.0 - ret + ret } } diff --git a/src/mono/mono/tests/verifier/make_ldelem_test.sh b/src/mono/mono/tests/verifier/make_ldelem_test.sh index 8f1f48f8b72b77..a86e92e492c8f0 100755 --- a/src/mono/mono/tests/verifier/make_ldelem_test.sh +++ b/src/mono/mono/tests/verifier/make_ldelem_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -17,7 +17,7 @@ TEST_FILE=${TEST_NAME}_generated.il echo $TEST_FILE $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/ARR/${TEST_ARR}/g" -e "s/IDX/${TEST_IDX}/g" -e "s/LD/${TEST_LD}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -17,7 +17,7 @@ TEST_FILE=${TEST_NAME}_generated.il echo $TEST_FILE $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/ARR/${TEST_ARR}/g" -e "s/IDX/${TEST_IDX}/g" -e "s/TOKEN/${TEST_TOKEN}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -30,12 +30,12 @@ $SED -e "s/OPCODE/${TEST_OP}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/LDFTN_O .class public Test extends [mscorlib]System.Object { - .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed + .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 ldarg.0 call instance void object::.ctor() - ret + ret } .method public virtual void VirtMethod () @@ -77,7 +77,7 @@ $SED -e "s/OPCODE/${TEST_OP}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/LDFTN_O LDFTN_OP pop ldc.i4.0 - ret + ret } } //EOF diff --git a/src/mono/mono/tests/verifier/make_ldlen_test.sh b/src/mono/mono/tests/verifier/make_ldlen_test.sh index d0a967d236a81f..8357303db71be6 100755 --- a/src/mono/mono/tests/verifier/make_ldlen_test.sh +++ b/src/mono/mono/tests/verifier/make_ldlen_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -14,7 +14,7 @@ TEST_FILE=${TEST_NAME}_generated.il echo $TEST_FILE $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE/${TEST_TYPE}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -84,7 +84,7 @@ $SED -e "s/TYPE1/${TEST_TYPE1}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE2 ldobj TYPE2 // VALIDITY pop ldc.i4.0 - ret + ret } //EOF diff --git a/src/mono/mono/tests/verifier/make_ldtoken_test.sh b/src/mono/mono/tests/verifier/make_ldtoken_test.sh index 3c570f4880bac9..1b9267a109b677 100755 --- a/src/mono/mono/tests/verifier/make_ldtoken_test.sh +++ b/src/mono/mono/tests/verifier/make_ldtoken_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -45,13 +45,13 @@ $SED -e "s/OPCODE/${TEST_OP}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/CALL_OP CALL_OP pop ldc.i4.0 - ret + ret } } - + //EOF diff --git a/src/mono/mono/tests/verifier/make_ldvirtftn_test.sh b/src/mono/mono/tests/verifier/make_ldvirtftn_test.sh index 5eefd91ef20f27..735d1268e5912f 100755 --- a/src/mono/mono/tests/verifier/make_ldvirtftn_test.sh +++ b/src/mono/mono/tests/verifier/make_ldvirtftn_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -30,12 +30,12 @@ $SED -e "s/OPCODE/${TEST_OP}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/LDFTN_O .class public Test extends [mscorlib]System.Object { - .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed + .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 ldarg.0 call instance void object::.ctor() - ret + ret } .method public virtual void VirtMethod () @@ -89,7 +89,7 @@ $SED -e "s/OPCODE/${TEST_OP}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/LDFTN_O pop ldc.i4.0 - ret + ret } } //EOF diff --git a/src/mono/mono/tests/verifier/make_leave_test.sh b/src/mono/mono/tests/verifier/make_leave_test.sh index 33a4efaa0425f9..9fb62b37a6f4fa 100755 --- a/src/mono/mono/tests/verifier/make_leave_test.sh +++ b/src/mono/mono/tests/verifier/make_leave_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -42,7 +42,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE_EXTRA_1/${OPCODE_EXTRA_1}/g throw leave END } - catch [mscorlib]System.Exception + catch [mscorlib]System.Exception { pop leave END @@ -51,7 +51,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE_EXTRA_1/${OPCODE_EXTRA_1}/g .try { newobj instance void class [mscorlib]System.Exception::.ctor() - throw + throw leave END } finally @@ -63,10 +63,10 @@ END_2: endfinally } - .try + .try { newobj instance void class [mscorlib]System.Exception::.ctor() - throw + throw leave END } filter diff --git a/src/mono/mono/tests/verifier/make_load_indirect_test.sh b/src/mono/mono/tests/verifier/make_load_indirect_test.sh index b6637ca7b991da..3c4c44a3e05643 100755 --- a/src/mono/mono/tests/verifier/make_load_indirect_test.sh +++ b/src/mono/mono/tests/verifier/make_load_indirect_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -55,7 +55,7 @@ $SED -e "s/TYPE/${TEST_TYPE}/g" -e "s/OP/${TEST_OP}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -20,7 +20,7 @@ TEST_PARAMS=`echo $TEST_PARAMS | $SED -s 's/&/\\\&/'` TEST_LOCALS=`echo $TEST_LOCALS | $SED -s 's/&/\\\&/'` $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/PARAMS/${TEST_PARAMS}/g" -e "s/LOCALS/${TEST_LOCALS}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/ARGS/${TEST_ARGS}/g" -e "s/SIG/${TEST_SIG}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -68,7 +68,7 @@ TEST_TYPE1=`echo $TEST_TYPE1 | $SED -s 's/&/\\\&/'` $SED -e "s/OPCODE/${TEST_OP}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/INIT/${TEST_INIT}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -17,7 +17,7 @@ echo $TEST_FILE $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/INSTANTIATION/${TEST_INSTANTIATION}/g" -e "s/CONSTRAINTS/${TEST_CONSTRAINTS}/g" -e "s/EXTRA_CODE/${TEST_EXTRA_CODE}/g" > $TEST_FILE < () cil managed diff --git a/src/mono/mono/tests/verifier/make_mkrefany.sh b/src/mono/mono/tests/verifier/make_mkrefany.sh index 3e3f6a88377d69..1e3e7c61258730 100755 --- a/src/mono/mono/tests/verifier/make_mkrefany.sh +++ b/src/mono/mono/tests/verifier/make_mkrefany.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -80,7 +80,7 @@ $SED -e "s/TYPE1/${TEST_TYPE1}/g" -e "s/TYPE2/${TEST_TYPE2}/g" -e "s/VALIDITY/${ pop ldc.i4.0 - ret + ret } //EOF diff --git a/src/mono/mono/tests/verifier/make_nested_access_test.sh b/src/mono/mono/tests/verifier/make_nested_access_test.sh index 5fd41668a68d9a..b721cfb69a67e0 100755 --- a/src/mono/mono/tests/verifier/make_nested_access_test.sh +++ b/src/mono/mono/tests/verifier/make_nested_access_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -31,7 +31,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/CONSTRU .ver 0:0:0:0 } -// VALIDITY CIL which breaks the ECMA-335 rules. +// VALIDITY CIL which breaks the ECMA-335 rules. // this CIL should fail verification by a conforming CLI verifier. .assembly extern mscorlib @@ -52,7 +52,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/CONSTRU .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void object::.ctor() ret } @@ -65,7 +65,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/CONSTRU .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void object::.ctor() ret } @@ -74,8 +74,8 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/CONSTRU { .maxstack 8 ldc.i4.0 - ret - } + ret + } } } @@ -93,7 +93,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/CONSTRU .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 CONSTRUCTOR ret } diff --git a/src/mono/mono/tests/verifier/make_newarr_test.sh b/src/mono/mono/tests/verifier/make_newarr_test.sh index 464695ba6a39a0..b97d3bdcbb12f7 100755 --- a/src/mono/mono/tests/verifier/make_newarr_test.sh +++ b/src/mono/mono/tests/verifier/make_newarr_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -49,7 +49,7 @@ $SED -e "s/TYPE1/${TEST_TYPE1}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE2 POST_OP pop ldc.i4.0 - ret + ret } //EOF diff --git a/src/mono/mono/tests/verifier/make_newobj_test.sh b/src/mono/mono/tests/verifier/make_newobj_test.sh index d8e4a62720528a..e7925cee1e21e6 100755 --- a/src/mono/mono/tests/verifier/make_newobj_test.sh +++ b/src/mono/mono/tests/verifier/make_newobj_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -16,7 +16,7 @@ TEST_FILE=${TEST_NAME}_generated.il echo $TEST_FILE $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE1/${TEST1_TYPE}/g" -e "s/TYPE2/${TEST2_TYPE}/g" -e "s/OPCODE/${TEST_OP}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -32,7 +32,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/CLASS_FIELDS/${CLASS_FIELDS}/g" -e .ver 0:0:0:0 } -// VALIDITY CIL which breaks the ECMA-335 rules. +// VALIDITY CIL which breaks the ECMA-335 rules. // this CIL should fail verification by a conforming CLI verifier. .assembly extern mscorlib @@ -69,7 +69,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/CLASS_FIELDS/${CLASS_FIELDS}/g" -e .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void object::.ctor() ret } diff --git a/src/mono/mono/tests/verifier/make_overlapped_test.sh b/src/mono/mono/tests/verifier/make_overlapped_test.sh index 239e27dc3b94c1..0bc9aa3378f894 100755 --- a/src/mono/mono/tests/verifier/make_overlapped_test.sh +++ b/src/mono/mono/tests/verifier/make_overlapped_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -12,7 +12,7 @@ TEST_POS_1=$4 TEST_POS_2=$5 TEST_TYPE_0=$6 -if [ "x$TEST_TYPE_0" = "x" ] ; then +if [ "x$TEST_TYPE_0" = "x" ]; then TEST_TYPE_0="int32"; fi @@ -21,7 +21,7 @@ echo $TEST_FILE TEST_TYPE1=`echo $TEST_TYPE1 | $SED -s 's/&/\\\&/'` $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE_0/${TEST_TYPE_0}/g"> $TEST_FILE < $TEST_FI .field [${TEST_POS_1}] public object objVal .field [${TEST_POS_2}] public int32 intVal2 - .method public hidebysig specialname rtspecialname instance default void '.ctor' () cil managed + .method public hidebysig specialname rtspecialname instance default void '.ctor' () cil managed { .maxstack 8 - ret + ret } } diff --git a/src/mono/mono/tests/verifier/make_prefix_test.sh b/src/mono/mono/tests/verifier/make_prefix_test.sh index f6e311cb13ebfc..05f24b9537eb0f 100755 --- a/src/mono/mono/tests/verifier/make_prefix_test.sh +++ b/src/mono/mono/tests/verifier/make_prefix_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -34,12 +34,12 @@ $SED -e "s/TYPE/${TEST_TYPE}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/BEFORE_OP/${T { .field public int32 valid - .method public hidebysig specialname rtspecialname instance default void .ctor (int32&) cil managed + .method public hidebysig specialname rtspecialname instance default void .ctor (int32&) cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void object::.ctor() - ret + ret } .method public virtual void VirtTest (ClassA& arg) @@ -103,7 +103,7 @@ $SED -e "s/TYPE/${TEST_TYPE}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/BEFORE_OP/${T leave END END: ldc.i4.0 - ret + ret } //EOF diff --git a/src/mono/mono/tests/verifier/make_ret_test.sh b/src/mono/mono/tests/verifier/make_ret_test.sh index 1f512fd126749a..3ff878868c6fb1 100755 --- a/src/mono/mono/tests/verifier/make_ret_test.sh +++ b/src/mono/mono/tests/verifier/make_ret_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -17,7 +17,7 @@ TEST_TYPE1=`echo $TEST_TYPE1 | $SED -s 's/&/\\\&/'` TEST_TYPE2=`echo $TEST_TYPE2 | $SED -s 's/&/\\\&/'` $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE1/${TEST_TYPE1}/g" -e "s/TYPE2/${TEST_TYPE2}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -37,7 +37,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/LOCAL/${TEST_LOCAL}/g" > $TEST_FIL ${OPCODE_2} leave END } - catch [mscorlib]System.NullReferenceException + catch [mscorlib]System.NullReferenceException { pop ${OPCODE_3} @@ -47,7 +47,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/LOCAL/${TEST_LOCAL}/g" > $TEST_FIL ${OPCODE_4} leave END } - catch [mscorlib]System.NullReferenceException + catch [mscorlib]System.NullReferenceException { pop ${OPCODE_5} @@ -55,7 +55,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/LOCAL/${TEST_LOCAL}/g" > $TEST_FIL } - .try + .try { nop leave END @@ -87,7 +87,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/LOCAL/${TEST_LOCAL}/g" > $TEST_FIL endfinally } - .try + .try { nop leave END diff --git a/src/mono/mono/tests/verifier/make_self_nested_test.sh b/src/mono/mono/tests/verifier/make_self_nested_test.sh index c6521173ebe36d..763ed67f3b3450 100755 --- a/src/mono/mono/tests/verifier/make_self_nested_test.sh +++ b/src/mono/mono/tests/verifier/make_self_nested_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -22,7 +22,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/CLASS_A .ver 0:0:0:0 } -// VALIDITY CIL which breaks the ECMA-335 rules. +// VALIDITY CIL which breaks the ECMA-335 rules. // this CIL should fail verification by a conforming CLI verifier. .assembly extern mscorlib @@ -36,7 +36,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/CLASS_A .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void object::.ctor() ret } @@ -49,7 +49,7 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/CLASS_A .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void object::.ctor() ret } @@ -58,8 +58,8 @@ $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/CLASS_A { .maxstack 8 ldc.i4.0 - ret - } + ret + } } .method public void Method () diff --git a/src/mono/mono/tests/verifier/make_sizeof_test.sh b/src/mono/mono/tests/verifier/make_sizeof_test.sh index 135b21e90ecfa8..a8d2edb054327c 100755 --- a/src/mono/mono/tests/verifier/make_sizeof_test.sh +++ b/src/mono/mono/tests/verifier/make_sizeof_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -15,7 +15,7 @@ TEST_TYPE1=`echo $TEST_TYPE1 | $SED -s 's/&/\\\&/'` $SED -e "s/OPCODE/${TEST_OP}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE1/${TEST_TYPE1}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -11,7 +11,7 @@ TEST_OP_SHORT=`echo $TEST_OP | cut -d " " -f 1` TEST_FILE=`echo invalid_stack_0_${TEST_OP_SHORT} | $SED -e "s/ /_/g" -e "s/\./_/g" -e "s/&/mp/g"`_generated.il echo $TEST_FILE $SED -e "s/OPCODE/${TEST_OP}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -12,7 +12,7 @@ TEST_OP_SHORT=`echo $TEST_OP | cut -d " " -f 1` TEST_FILE=`echo ${TEST_VALIDITY}_stack_0_${TEST_OP_SHORT} | $SED -e "s/ /_/g" -e "s/\./_/g" -e "s/&/mp/g"`_generated.il echo $TEST_FILE $SED -e "s/OPCODE/${TEST_OP}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi diff --git a/src/mono/mono/tests/verifier/make_stack_merge_test.sh b/src/mono/mono/tests/verifier/make_stack_merge_test.sh index 5ffeb8300b136d..81a6178d07af99 100755 --- a/src/mono/mono/tests/verifier/make_stack_merge_test.sh +++ b/src/mono/mono/tests/verifier/make_stack_merge_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -17,7 +17,7 @@ TEST_TYPE1=`echo $TEST_TYPE1 | $SED -s 's/&/\\\&/'` TEST_TYPE2=`echo $TEST_TYPE2 | $SED -s 's/&/\\\&/'` $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE1/${TEST_TYPE1}/g" -e "s/TYPE2/${TEST_TYPE2}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -18,7 +18,7 @@ TEST_FILE=${TEST_NAME}_generated.il echo $TEST_FILE $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/ARR/${TEST_ARR}/g" -e "s/IDX/${TEST_IDX}/g" -e "s/VAL/${TEST_VAL}/g" -e "s/LD/${TEST_LD}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -94,7 +94,7 @@ $SED -e "s/EXTRA_OPS/${TEST_EXTRA_OPS}/g" -e "s/TYPE1/${TEST_TYPE1}/g" -e "s/VAL ldc.i4.0 - ret + ret } //EOF diff --git a/src/mono/mono/tests/verifier/make_store_indirect_test.sh b/src/mono/mono/tests/verifier/make_store_indirect_test.sh index 6ff4f9076e33fd..f0c21d28fc90d1 100755 --- a/src/mono/mono/tests/verifier/make_store_indirect_test.sh +++ b/src/mono/mono/tests/verifier/make_store_indirect_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -60,7 +60,7 @@ $SED -e "s/TYPE1/${TEST_TYPE1}/g" -e "s/T1_VAL/${T1_VAL}/g" -e "s/TYPE2/${TEST_T ldloc.1 OP ldc.i4.0 - ret + ret } //EOF diff --git a/src/mono/mono/tests/verifier/make_store_test.sh b/src/mono/mono/tests/verifier/make_store_test.sh index 78e6081721aeba..40ebd0b0f706dc 100755 --- a/src/mono/mono/tests/verifier/make_store_test.sh +++ b/src/mono/mono/tests/verifier/make_store_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -18,7 +18,7 @@ TEST_TYPE1=`echo $TEST_TYPE1 | $SED -s 's/&/\\\&/'` TEST_TYPE2=`echo $TEST_TYPE2 | $SED -s 's/&/\\\&/'` $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE1/${TEST_TYPE1}/g" -e "s/TYPE2/${TEST_TYPE2}/g" -e "s/OPCODE/${TEST_OP}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -25,7 +25,7 @@ echo $TEST_FILE $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/FINALLY/${TEST_FIN}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -41,12 +41,12 @@ $SED -e "s/RET_TYPE/${TEST_RET_TYPE}/g" -e "s/TYPE/${TEST_TYPE}/g" -e "s/OPCODE { .field public int32 valid - .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed + .method public hidebysig specialname rtspecialname instance default void .ctor () cil managed { .maxstack 8 - ldarg.0 + ldarg.0 call instance void object::.ctor() - ret + ret } .method public virtual void VirtTest () @@ -121,7 +121,7 @@ AFTER: leave END END: $LD_RET_CODE - ret + ret } @@ -136,7 +136,7 @@ END: leave END END: ldc.i4.0 - ret + ret } //EOF diff --git a/src/mono/mono/tests/verifier/make_tests.sh b/src/mono/mono/tests/verifier/make_tests.sh index 5674f821b0aa03..b614b5dbf9a2eb 100755 --- a/src/mono/mono/tests/verifier/make_tests.sh +++ b/src/mono/mono/tests/verifier/make_tests.sh @@ -30,7 +30,7 @@ do else INIT="no"; fi - + ./make_bin_test.sh bin_num_op_32_${I} valid $OP int32 int32 "ldc.i4.1" "${INIT}" ./make_bin_test.sh bin_num_op_33_${I} valid $OP int32 'native int' "ldc.i4.1" "${INIT}" ./make_bin_test.sh bin_num_op_34_${I} valid $OP int64 int64 "ldc.i8 1" "${INIT}" @@ -40,7 +40,7 @@ do ./make_bin_test.sh bin_num_op_38_${I} valid $OP float32 float64 "ldc.r8 0" "${INIT}" ./make_bin_test.sh bin_num_op_39_${I} valid $OP float64 float32 "ldc.r4 0" "${INIT}" ./make_bin_test.sh bin_num_op_40_${I} valid $OP float32 float32 "ldc.r4 0" "${INIT}" - + ./make_bin_test.sh bin_num_op_1_${I} unverifiable $OP int32 int64 "ldc.i8 1" "${INIT}" ./make_bin_test.sh bin_num_op_2_${I} unverifiable $OP int32 float64 "ldc.r8 0" "${INIT}" ./make_bin_test.sh bin_num_op_3_${I} unverifiable $OP int32 object "ldnull" "${INIT}" @@ -184,7 +184,7 @@ do done -for TYPE in int32 float32 int64 "int32&" "native int" +for TYPE in int32 float32 int64 "int32&" "native int" do ./make_bin_test.sh bin_cgt_un_a_${I} unverifiable 'cgt.un' "${TYPE}" 'object' ./make_bin_test.sh bin_cgt_un_b_${I} unverifiable 'cgt.un' 'object' "${TYPE}" @@ -313,7 +313,7 @@ done # Table 8: Conversion Operations I=1 J=1 -for OP in "conv.i1\n\tpop" "conv.i2\n\tpop" "conv.i4\n\tpop" "conv.i8\n\tpop" "conv.r4\n\tpop" "conv.r8\n\tpop" "conv.u1\n\tpop" "conv.u2\n\tpop" "conv.u4\n\tpop" "conv.u8\n\tpop" "conv.i\n\tpop" "conv.u\n\tpop" "conv.r.un\n\tpop" "conv.ovf.i1\n\tpop" "conv.ovf.i2\n\tpop" "conv.ovf.i4\n\tpop" "conv.ovf.i8\n\tpop" "conv.ovf.u1\n\tpop" "conv.ovf.u2\n\tpop" "conv.ovf.u4\n\tpop" "conv.ovf.u8\n\tpop" "conv.ovf.i\n\tpop" "conv.ovf.u\n\tpop" "conv.ovf.i1.un\n\tpop" "conv.ovf.i2.un\n\tpop" "conv.ovf.i4.un\n\tpop" "conv.ovf.i8.un\n\tpop" "conv.ovf.u1.un\n\tpop" "conv.ovf.u2.un\n\tpop" "conv.ovf.u4.un\n\tpop" "conv.ovf.u8.un\n\tpop" "conv.ovf.i.un\n\tpop" "conv.ovf.u.un\n\tpop" +for OP in "conv.i1\n\tpop" "conv.i2\n\tpop" "conv.i4\n\tpop" "conv.i8\n\tpop" "conv.r4\n\tpop" "conv.r8\n\tpop" "conv.u1\n\tpop" "conv.u2\n\tpop" "conv.u4\n\tpop" "conv.u8\n\tpop" "conv.i\n\tpop" "conv.u\n\tpop" "conv.r.un\n\tpop" "conv.ovf.i1\n\tpop" "conv.ovf.i2\n\tpop" "conv.ovf.i4\n\tpop" "conv.ovf.i8\n\tpop" "conv.ovf.u1\n\tpop" "conv.ovf.u2\n\tpop" "conv.ovf.u4\n\tpop" "conv.ovf.u8\n\tpop" "conv.ovf.i\n\tpop" "conv.ovf.u\n\tpop" "conv.ovf.i1.un\n\tpop" "conv.ovf.i2.un\n\tpop" "conv.ovf.i4.un\n\tpop" "conv.ovf.i8.un\n\tpop" "conv.ovf.u1.un\n\tpop" "conv.ovf.u2.un\n\tpop" "conv.ovf.u4.un\n\tpop" "conv.ovf.u8.un\n\tpop" "conv.ovf.i.un\n\tpop" "conv.ovf.u.un\n\tpop" do for TYPE in 'int8' 'bool' 'unsigned int8' 'int16' 'char' 'unsigned int16' 'int32' 'unsigned int32' 'int64' 'unsigned int64' 'float32' 'float64' 'native int' 'native unsigned int' do @@ -357,55 +357,55 @@ do ./make_store_test.sh coercion_14_${I} unverifiable "$OP" int16 float64 ./make_store_test.sh coercion_15_${I} unverifiable "$OP" int16 'int16&' ./make_store_test.sh coercion_16_${I} unverifiable "$OP" int16 object - + ./make_store_test.sh coercion_17_${I} unverifiable "$OP" 'unsigned int16' int64 ./make_store_test.sh coercion_18_${I} unverifiable "$OP" 'unsigned int16' float64 ./make_store_test.sh coercion_19_${I} unverifiable "$OP" 'unsigned int16' 'unsigned int16&' ./make_store_test.sh coercion_20_${I} unverifiable "$OP" 'unsigned int16' object - + ./make_store_test.sh coercion_21_${I} unverifiable "$OP" char int64 ./make_store_test.sh coercion_22_${I} unverifiable "$OP" char float64 ./make_store_test.sh coercion_23_${I} unverifiable "$OP" char 'char&' ./make_store_test.sh coercion_24_${I} unverifiable "$OP" char object - + ./make_store_test.sh coercion_25_${I} unverifiable "$OP" int32 int64 ./make_store_test.sh coercion_26_${I} unverifiable "$OP" int32 float64 ./make_store_test.sh coercion_27_${I} unverifiable "$OP" int32 'int32&' ./make_store_test.sh coercion_28_${I} unverifiable "$OP" int32 object - + ./make_store_test.sh coercion_29_${I} unverifiable "$OP" 'unsigned int32' int64 ./make_store_test.sh coercion_30_${I} unverifiable "$OP" 'unsigned int32' float64 ./make_store_test.sh coercion_31_${I} unverifiable "$OP" 'unsigned int32' 'unsigned int32&' ./make_store_test.sh coercion_32_${I} unverifiable "$OP" 'unsigned int32' object - + ./make_store_test.sh coercion_33_${I} unverifiable "$OP" int64 int32 ./make_store_test.sh coercion_34_${I} unverifiable "$OP" int64 'native int' ./make_store_test.sh coercion_35_${I} unverifiable "$OP" int64 float64 ./make_store_test.sh coercion_36_${I} unverifiable "$OP" int64 'int64&' ./make_store_test.sh coercion_37_${I} unverifiable "$OP" int64 object - + ./make_store_test.sh coercion_38_${I} unverifiable "$OP" 'unsigned int64' int32 ./make_store_test.sh coercion_39_${I} unverifiable "$OP" 'unsigned int64' 'native int' ./make_store_test.sh coercion_40_${I} unverifiable "$OP" 'unsigned int64' float64 ./make_store_test.sh coercion_41_${I} unverifiable "$OP" 'unsigned int64' 'unsigned int64&' ./make_store_test.sh coercion_42_${I} unverifiable "$OP" 'unsigned int64' object - + ./make_store_test.sh coercion_43_${I} unverifiable "$OP" 'native int' int64 ./make_store_test.sh coercion_44_${I} unverifiable "$OP" 'native int' float64 ./make_store_test.sh coercion_45_${I} unverifiable "$OP" 'native int' 'native int&' ./make_store_test.sh coercion_46_${I} unverifiable "$OP" 'native int' object - + ./make_store_test.sh coercion_47_${I} unverifiable "$OP" 'native unsigned int' int64 ./make_store_test.sh coercion_48_${I} unverifiable "$OP" 'native unsigned int' float64 ./make_store_test.sh coercion_49_${I} unverifiable "$OP" 'native unsigned int' 'native unsigned int&' ./make_store_test.sh coercion_50_${I} unverifiable "$OP" 'native unsigned int' object - + ./make_store_test.sh coercion_51_${I} unverifiable "$OP" float32 int32 ./make_store_test.sh coercion_52_${I} unverifiable "$OP" float32 'native int' ./make_store_test.sh coercion_53_${I} unverifiable "$OP" float32 int64 ./make_store_test.sh coercion_54_${I} unverifiable "$OP" float32 'float32&' ./make_store_test.sh coercion_55_${I} unverifiable "$OP" float32 object - + ./make_store_test.sh coercion_56_${I} unverifiable "$OP" float64 int32 ./make_store_test.sh coercion_57_${I} unverifiable "$OP" float64 'native int' ./make_store_test.sh coercion_58_${I} unverifiable "$OP" float64 int64 @@ -417,20 +417,20 @@ do ./make_store_test.sh coercion_63_${I} unverifiable "$OP" object int64 ./make_store_test.sh coercion_64_${I} unverifiable "$OP" object float64 ./make_store_test.sh coercion_65_${I} unverifiable "$OP" object 'object&' - + ./make_store_test.sh coercion_66_${I} unverifiable "$OP" 'class ValueType' int32 ./make_store_test.sh coercion_67_${I} unverifiable "$OP" 'class ValueType' 'native int' ./make_store_test.sh coercion_68_${I} unverifiable "$OP" 'class ValueType' int64 ./make_store_test.sh coercion_69_${I} unverifiable "$OP" 'class ValueType' float64 ./make_store_test.sh coercion_70_${I} unverifiable "$OP" 'class ValueType' 'class ValueType&' ./make_store_test.sh coercion_71_${I} unverifiable "$OP" 'class ValueType' object - + ./make_store_test.sh coercion_72_${I} unverifiable "$OP" 'int32&' int32 ./make_store_test.sh coercion_73_${I} unverifiable "$OP" 'int32&' 'native int' ./make_store_test.sh coercion_74_${I} unverifiable "$OP" 'int32&' int64 ./make_store_test.sh coercion_75_${I} unverifiable "$OP" 'int32&' float64 ./make_store_test.sh coercion_76_${I} unverifiable "$OP" 'int32&' object - + ./make_store_test.sh coercion_77_${I} unverifiable "$OP" typedref int32 ./make_store_test.sh coercion_78_${I} unverifiable "$OP" typedref 'native int' ./make_store_test.sh coercion_89_${I} unverifiable "$OP" typedref int64 @@ -442,7 +442,7 @@ done #valid coercion between native int and int32 I=1 -for OP in stloc.0 "starg 0" +for OP in stloc.0 "starg 0" do ./make_store_test.sh coercion_83_${I} valid "$OP" int32 "native int" ./make_store_test.sh coercion_84_${I} valid "$OP" "native int" int32 @@ -495,9 +495,9 @@ done function fix () { - if [ "$3" != "" ]; then + if [ -n "$3" ]; then A=$3; - elif [ "$2" != "" ]; then + elif [ -n "$2" ]; then A=$2; else A=$1; @@ -595,55 +595,55 @@ do ./make_obj_store_test.sh obj_coercion_14_${I} unverifiable "$OP" int16 float64 ./make_obj_store_test.sh obj_coercion_15_${I} unverifiable "$OP" int16 'int16&' ./make_obj_store_test.sh obj_coercion_16_${I} unverifiable "$OP" int16 object - + ./make_obj_store_test.sh obj_coercion_17_${I} unverifiable "$OP" 'unsigned int16' int64 ./make_obj_store_test.sh obj_coercion_18_${I} unverifiable "$OP" 'unsigned int16' float64 ./make_obj_store_test.sh obj_coercion_19_${I} unverifiable "$OP" 'unsigned int16' 'unsigned int16&' ./make_obj_store_test.sh obj_coercion_20_${I} unverifiable "$OP" 'unsigned int16' object - + ./make_obj_store_test.sh obj_coercion_21_${I} unverifiable "$OP" char int64 ./make_obj_store_test.sh obj_coercion_22_${I} unverifiable "$OP" char float64 ./make_obj_store_test.sh obj_coercion_23_${I} unverifiable "$OP" char 'char&' ./make_obj_store_test.sh obj_coercion_24_${I} unverifiable "$OP" char object - + ./make_obj_store_test.sh obj_coercion_25_${I} unverifiable "$OP" int32 int64 ./make_obj_store_test.sh obj_coercion_26_${I} unverifiable "$OP" int32 float64 ./make_obj_store_test.sh obj_coercion_27_${I} unverifiable "$OP" int32 'int32&' ./make_obj_store_test.sh obj_coercion_28_${I} unverifiable "$OP" int32 object - + ./make_obj_store_test.sh obj_coercion_29_${I} unverifiable "$OP" 'unsigned int32' int64 ./make_obj_store_test.sh obj_coercion_30_${I} unverifiable "$OP" 'unsigned int32' float64 ./make_obj_store_test.sh obj_coercion_31_${I} unverifiable "$OP" 'unsigned int32' 'unsigned int32&' ./make_obj_store_test.sh obj_coercion_32_${I} unverifiable "$OP" 'unsigned int32' object - + ./make_obj_store_test.sh obj_coercion_33_${I} unverifiable "$OP" int64 int32 ./make_obj_store_test.sh obj_coercion_34_${I} unverifiable "$OP" int64 'native int' ./make_obj_store_test.sh obj_coercion_35_${I} unverifiable "$OP" int64 float64 ./make_obj_store_test.sh obj_coercion_36_${I} unverifiable "$OP" int64 'int64&' ./make_obj_store_test.sh obj_coercion_37_${I} unverifiable "$OP" int64 object - + ./make_obj_store_test.sh obj_coercion_38_${I} unverifiable "$OP" 'unsigned int64' int32 ./make_obj_store_test.sh obj_coercion_39_${I} unverifiable "$OP" 'unsigned int64' 'native int' ./make_obj_store_test.sh obj_coercion_40_${I} unverifiable "$OP" 'unsigned int64' float64 ./make_obj_store_test.sh obj_coercion_41_${I} unverifiable "$OP" 'unsigned int64' 'unsigned int64&' ./make_obj_store_test.sh obj_coercion_42_${I} unverifiable "$OP" 'unsigned int64' object - + ./make_obj_store_test.sh obj_coercion_43_${I} unverifiable "$OP" 'native int' int64 ./make_obj_store_test.sh obj_coercion_44_${I} unverifiable "$OP" 'native int' float64 ./make_obj_store_test.sh obj_coercion_45_${I} unverifiable "$OP" 'native int' 'native int&' ./make_obj_store_test.sh obj_coercion_46_${I} unverifiable "$OP" 'native int' object - + ./make_obj_store_test.sh obj_coercion_47_${I} unverifiable "$OP" 'native unsigned int' int64 ./make_obj_store_test.sh obj_coercion_48_${I} unverifiable "$OP" 'native unsigned int' float64 ./make_obj_store_test.sh obj_coercion_49_${I} unverifiable "$OP" 'native unsigned int' 'native unsigned int&' ./make_obj_store_test.sh obj_coercion_50_${I} unverifiable "$OP" 'native unsigned int' object - + ./make_obj_store_test.sh obj_coercion_51_${I} unverifiable "$OP" float32 int32 ./make_obj_store_test.sh obj_coercion_52_${I} unverifiable "$OP" float32 'native int' ./make_obj_store_test.sh obj_coercion_53_${I} unverifiable "$OP" float32 int64 ./make_obj_store_test.sh obj_coercion_54_${I} unverifiable "$OP" float32 'float32&' ./make_obj_store_test.sh obj_coercion_55_${I} unverifiable "$OP" float32 object - + ./make_obj_store_test.sh obj_coercion_56_${I} unverifiable "$OP" float64 int32 ./make_obj_store_test.sh obj_coercion_57_${I} unverifiable "$OP" float64 'native int' ./make_obj_store_test.sh obj_coercion_58_${I} unverifiable "$OP" float64 int64 @@ -655,15 +655,15 @@ do ./make_obj_store_test.sh obj_coercion_63_${I} unverifiable "$OP" object int64 ./make_obj_store_test.sh obj_coercion_64_${I} unverifiable "$OP" object float64 ./make_obj_store_test.sh obj_coercion_65_${I} unverifiable "$OP" object 'object&' - + ./make_obj_store_test.sh obj_coercion_66_${I} unverifiable "$OP" 'class ValueType' int32 ./make_obj_store_test.sh obj_coercion_67_${I} unverifiable "$OP" 'class ValueType' 'native int' ./make_obj_store_test.sh obj_coercion_68_${I} unverifiable "$OP" 'class ValueType' int64 ./make_obj_store_test.sh obj_coercion_69_${I} unverifiable "$OP" 'class ValueType' float64 ./make_obj_store_test.sh obj_coercion_70_${I} unverifiable "$OP" 'class ValueType' 'class ValueType&' ./make_obj_store_test.sh obj_coercion_71_${I} unverifiable "$OP" 'class ValueType' object - - + + #These tests don't test store error since one cannot have an 'int32&' field #They should exist in the structural tests session #./make_obj_store_test.sh obj_coercion_72_${I} invalid "$OP" 'int32&' int32 @@ -671,17 +671,17 @@ do #./make_obj_store_test.sh obj_coercion_74_${I} invalid "$OP" 'int32&' int64 #./make_obj_store_test.sh obj_coercion_75_${I} invalid "$OP" 'int32&' float64 #./make_obj_store_test.sh obj_coercion_76_${I} invalid "$OP" 'int32&' object - + ./make_obj_store_test.sh obj_coercion_83_${I} valid "$OP" int32 "native int" ./make_obj_store_test.sh obj_coercion_84_${I} valid "$OP" "native int" int32 - + ./make_obj_store_test.sh obj_coercion_85_${I} valid "$OP" "unsigned int32" "native int" ./make_obj_store_test.sh obj_coercion_86_${I} valid "$OP" "native int" "unsigned int32" - + ./make_obj_store_test.sh obj_coercion_87_${I} valid "$OP" int32 "native unsigned int" ./make_obj_store_test.sh obj_coercion_88_${I} valid "$OP" "native unsigned int" int32 - + ./make_obj_store_test.sh obj_coercion_89_${I} valid "$OP" "unsigned int32" "native int" ./make_obj_store_test.sh obj_coercion_90_${I} valid "$OP" "native unsigned int" "unsigned int32" I=`expr $I + 1` @@ -708,7 +708,7 @@ do # ClassA not interface type. # FIXME: what was the purpoise of this test? on it's current for it is valid and not unverifiable ./make_store_test.sh assign_compat_3_${I} valid "$OP" object 'class ClassA' - + # Implementation of InterfaceB does not require the implementation of InterfaceA ./make_store_test.sh assign_compat_4_${I} unverifiable "$OP" 'class InterfaceA' 'class InterfaceB' @@ -749,7 +749,7 @@ do # ClassA not interface type. #FIXME: this test is valid, you can store type ClassA in a object field ./make_obj_store_test.sh assign_compat_3_${I} valid "$OP" object 'class ClassA' - + # Implementation of InterfaceB does not require the implementation of InterfaceA ./make_obj_store_test.sh assign_compat_4_${I} unverifiable "$OP" 'class InterfaceA' 'class InterfaceB' @@ -770,13 +770,13 @@ do # Method pointers with different calling conventions. ./make_obj_store_test.sh assign_compat_10_${I} unverifiable "$OP" 'method vararg int32 *(int32)' 'method int32 *(int32)' - + # Method pointers with different calling conventions. (2) ./make_obj_store_test.sh assign_compat_11_${I} unverifiable "$OP" 'method unmanaged fastcall int32 *(int32)' 'method int32 *(int32)' - + # Method pointers with different calling conventions. (3) ./make_obj_store_test.sh assign_compat_12_${I} unverifiable "$OP" 'method unmanaged fastcall int32 *(int32)' 'method unmanaged stdcall int32 *(int32)' - + I=`expr $I + 1` done @@ -790,7 +790,7 @@ do T1_PTR=$? ZZ=`echo $TYPE2 | grep "*";` T2_PTR=$? - + if [ $T1_PTR -eq 0 ] || [ $T2_PTR -eq 0 ]; then ./make_stack_merge_test.sh stack_merge_${I} unverifiable "$TYPE1" "$TYPE2" elif [ "$TYPE1" = "$TYPE2" ]; then @@ -813,9 +813,9 @@ done # Unverifiable array stack merges # These are verifiable, the merged type is 'object' or 'Array' -#for TYPE1 in 'string []' 'string [,]' 'string [,,]' +#for TYPE1 in 'string []' 'string [,]' 'string [,,]' #do -# for TYPE2 in 'string []' 'string [,]' 'string [,,]' +# for TYPE2 in 'string []' 'string [,]' 'string [,,]' # do # if [ "$TYPE1" != "$TYPE2" ]; then # ./make_stack_merge_test.sh stack_merge_${I} unverifiable "$TYPE1" "$TYPE2" @@ -974,55 +974,55 @@ done ./make_ret_test.sh ret_coercion_14 unverifiable int16 float64 ./make_ret_test.sh ret_coercion_15 unverifiable int16 'int16&' ./make_ret_test.sh ret_coercion_16 unverifiable int16 object - + ./make_ret_test.sh ret_coercion_17 unverifiable 'unsigned int16' int64 ./make_ret_test.sh ret_coercion_18 unverifiable 'unsigned int16' float64 ./make_ret_test.sh ret_coercion_19 unverifiable 'unsigned int16' 'unsigned int16&' ./make_ret_test.sh ret_coercion_20 unverifiable 'unsigned int16' object - + ./make_ret_test.sh ret_coercion_21 unverifiable char int64 ./make_ret_test.sh ret_coercion_22 unverifiable char float64 ./make_ret_test.sh ret_coercion_23 unverifiable char 'char&' ./make_ret_test.sh ret_coercion_24 unverifiable char object - + ./make_ret_test.sh ret_coercion_25 unverifiable int32 int64 ./make_ret_test.sh ret_coercion_26 unverifiable int32 float64 ./make_ret_test.sh ret_coercion_27 unverifiable int32 'int32&' ./make_ret_test.sh ret_coercion_28 unverifiable int32 object - + ./make_ret_test.sh ret_coercion_29 unverifiable 'unsigned int32' int64 ./make_ret_test.sh ret_coercion_30 unverifiable 'unsigned int32' float64 ./make_ret_test.sh ret_coercion_31 unverifiable 'unsigned int32' 'unsigned int32&' ./make_ret_test.sh ret_coercion_32 unverifiable 'unsigned int32' object - + ./make_ret_test.sh ret_coercion_33 unverifiable int64 int32 ./make_ret_test.sh ret_coercion_34 unverifiable int64 'native int' ./make_ret_test.sh ret_coercion_35 unverifiable int64 float64 ./make_ret_test.sh ret_coercion_36 unverifiable int64 'int64&' ./make_ret_test.sh ret_coercion_37 unverifiable int64 object - + ./make_ret_test.sh ret_coercion_38 unverifiable 'unsigned int64' int32 ./make_ret_test.sh ret_coercion_39 unverifiable 'unsigned int64' 'native int' ./make_ret_test.sh ret_coercion_40 unverifiable 'unsigned int64' float64 ./make_ret_test.sh ret_coercion_41 unverifiable 'unsigned int64' 'unsigned int64&' ./make_ret_test.sh ret_coercion_42 unverifiable 'unsigned int64' object - + ./make_ret_test.sh ret_coercion_43 unverifiable 'native int' int64 ./make_ret_test.sh ret_coercion_44 unverifiable 'native int' float64 ./make_ret_test.sh ret_coercion_45 unverifiable 'native int' 'native int&' ./make_ret_test.sh ret_coercion_46 unverifiable 'native int' object - + ./make_ret_test.sh ret_coercion_47 unverifiable 'native unsigned int' int64 ./make_ret_test.sh ret_coercion_48 unverifiable 'native unsigned int' float64 ./make_ret_test.sh ret_coercion_49 unverifiable 'native unsigned int' 'native unsigned int&' ./make_ret_test.sh ret_coercion_50 unverifiable 'native unsigned int' object - + ./make_ret_test.sh ret_coercion_51 unverifiable float32 int32 ./make_ret_test.sh ret_coercion_52 unverifiable float32 'native int' ./make_ret_test.sh ret_coercion_53 unverifiable float32 int64 ./make_ret_test.sh ret_coercion_54 unverifiable float32 'float32&' ./make_ret_test.sh ret_coercion_55 unverifiable float32 object - + ./make_ret_test.sh ret_coercion_56 unverifiable float64 int32 ./make_ret_test.sh ret_coercion_57 unverifiable float64 'native int' ./make_ret_test.sh ret_coercion_58 unverifiable float64 int64 @@ -1034,20 +1034,20 @@ done ./make_ret_test.sh ret_coercion_63 unverifiable object int64 ./make_ret_test.sh ret_coercion_64 unverifiable object float64 ./make_ret_test.sh ret_coercion_65 unverifiable object 'object&' - + ./make_ret_test.sh ret_coercion_66 unverifiable 'class MyValueType' int32 ./make_ret_test.sh ret_coercion_67 unverifiable 'class MyValueType' 'native int' ./make_ret_test.sh ret_coercion_68 unverifiable 'class MyValueType' int64 ./make_ret_test.sh ret_coercion_69 unverifiable 'class MyValueType' float64 ./make_ret_test.sh ret_coercion_70 unverifiable 'class MyValueType' 'class MyValueType&' ./make_ret_test.sh ret_coercion_71 unverifiable 'class MyValueType' object - + ./make_ret_test.sh ret_coercion_72 unverifiable 'int32&' int32 ./make_ret_test.sh ret_coercion_73 unverifiable 'int32&' 'native int' ./make_ret_test.sh ret_coercion_74 unverifiable 'int32&' int64 ./make_ret_test.sh ret_coercion_75 unverifiable 'int32&' float64 ./make_ret_test.sh ret_coercion_76 unverifiable 'int32&' object - + ./make_ret_test.sh ret_coercion_77 unverifiable typedref int32 ./make_ret_test.sh ret_coercion_78 unverifiable typedref 'native int' ./make_ret_test.sh ret_coercion_79 unverifiable typedref int64 @@ -1317,24 +1317,24 @@ do LOCALS_1='' CALL_1='ldc.i4.0' SIG_1='int32' - + ARGS_2='int32 V, int32 V1' LOCALS_2='' CALL_2='ldc.i4.0\n\tldc.i4.0' SIG_2='int32, int32' - + ARGS_3='int32 V, int32 V1, int32 V1' LOCALS_3='' CALL_3='ldc.i4.0\n\tldc.i4.0\n\tldc.i4.0' SIG_3='int32, int32, int32' - + ARGS_4='int32 V, int32 V1, int32 V1, int32 V1' LOCALS_4='' CALL_4='ldc.i4.0\n\tldc.i4.0\n\tldc.i4.0\n\tldc.i4.0' SIG_4='int32, int32, int32, int32' MAX_PARAM_RESULT="unverifiable" POPS="pop\npop\npop\npop\npop\npop\npop\npop\n" - + if [ "$OP" = "ldloc" ]; then MAX_PARAM_RESULT="invalid" @@ -1358,26 +1358,26 @@ do CALL_4='' SIG_4='' fi; - + ./make_load_test.sh ${OP}0_max_params "${MAX_PARAM_RESULT}" "${OP}.0" '' '' '' '' ./make_load_test.sh ${OP}1_max_params "${MAX_PARAM_RESULT}" "${OP}.1" '' '' '' '' ./make_load_test.sh ${OP}2_max_params "${MAX_PARAM_RESULT}" "${OP}.2" '' '' '' '' ./make_load_test.sh ${OP}3_max_params "${MAX_PARAM_RESULT}" "${OP}.3" '' '' '' '' - + ./make_load_test.sh ${OP}1_1_max_params "${MAX_PARAM_RESULT}" "${OP}.1" "${ARGS_1}" "${LOCALS_1}" "${CALL_1}" "${SIG_1}" ./make_load_test.sh ${OP}2_1_max_params "${MAX_PARAM_RESULT}" "${OP}.2" "${ARGS_1}" "${LOCALS_1}" "${CALL_1}" "${SIG_1}" ./make_load_test.sh ${OP}3_1_max_params "${MAX_PARAM_RESULT}" "${OP}.3" "${ARGS_1}" "${LOCALS_1}" "${CALL_1}" "${SIG_1}" - + ./make_load_test.sh ${OP}2_2_max_params "${MAX_PARAM_RESULT}" "${OP}.2" "${ARGS_2}" "${LOCALS_2}" "${CALL_2}" "${SIG_2}" ./make_load_test.sh ${OP}3_2_max_params "${MAX_PARAM_RESULT}" "${OP}.3" "${ARGS_2}" "${LOCALS_2}" "${CALL_2}" "${SIG_2}" - + ./make_load_test.sh ${OP}3_3_max_params "${MAX_PARAM_RESULT}" "${OP}.3" "${ARGS_3}" "${LOCALS_3}" "${CALL_3}" "${SIG_3}" - + ./make_load_test.sh ${OP}0_max_params valid "${OP}.0" "${ARGS_1}" "${LOCALS_1}" "${CALL_1}" "${SIG_1}" ./make_load_test.sh ${OP}1_max_params valid "${OP}.1" "${ARGS_2}" "${LOCALS_2}" "${CALL_2}" "${SIG_2}" ./make_load_test.sh ${OP}2_max_params valid "${OP}.2" "${ARGS_3}" "${LOCALS_3}" "${CALL_3}" "${SIG_3}" ./make_load_test.sh ${OP}3_max_params valid "${OP}.3" "${ARGS_4}" "${LOCALS_4}" "${CALL_4}" "${SIG_4}" - + ./make_load_test.sh ${OP}0_stack_overflow invalid "${OP}.0\n${OP}.0\n${OP}.0\n${OP}.0\n${OP}.0\n${OP}.0\n${OP}.0\n${OP}.0\n${OP}.0\n${POPS}" "${ARGS_4}" "${LOCALS_4}" "${CALL_4}" "${SIG_4}" ./make_load_test.sh ${OP}1_stack_overflow invalid "${OP}.1\n${OP}.1\n${OP}.1\n${OP}.1\n${OP}.1\n${OP}.1\n${OP}.1\n${OP}.1\n${OP}.1\n${POPS}" "${ARGS_4}" "${LOCALS_4}" "${CALL_4}" "${SIG_4}" ./make_load_test.sh ${OP}2_stack_overflow invalid "${OP}.2\n${OP}.2\n${OP}.2\n${OP}.2\n${OP}.2\n${OP}.2\n${OP}.2\n${OP}.2\n${OP}.2\n${POPS}" "${ARGS_4}" "${LOCALS_4}" "${CALL_4}" "${SIG_4}" @@ -1393,7 +1393,7 @@ do ./make_bool_branch_test.sh boolean_branch_${I}_3 valid ${OP} int32 ./make_bool_branch_test.sh boolean_branch_${I}_4 valid ${OP} int64 ./make_bool_branch_test.sh boolean_branch_${I}_5 valid ${OP} 'native int' - + #unmanaged pointers are not veriable types, all ops on unmanaged pointers are unverifiable ./make_bool_branch_test.sh boolean_branch_${I}_6 unverifiable ${OP} 'int32*' ./make_bool_branch_test.sh boolean_branch_${I}_8 unverifiable ${OP} 'method int32 *(int32)' @@ -1407,7 +1407,7 @@ do ./make_bool_branch_test.sh boolean_branch_${I}_14 valid ${OP} 'class Template`1' ./make_bool_branch_test.sh boolean_branch_${I}_15 valid ${OP} 'class Template`1[]' ./make_bool_branch_test.sh boolean_branch_${I}_16 valid ${OP} 'class Template`1[,,]' - + ./make_bool_branch_test.sh boolean_branch_${I}_17 unverifiable ${OP} float32 ./make_bool_branch_test.sh boolean_branch_${I}_18 unverifiable ${OP} float64 ./make_bool_branch_test.sh boolean_branch_${I}_19 unverifiable ${OP} 'class MyValueType' @@ -1846,7 +1846,7 @@ done #static members are different from instance members I=1 -for OP in "ldc.i4.0\n\t\tstsfld int32 Class::sfld" "ldsfld int32 Class::sfld\n\n\tpop" "ldsflda int32 Class::sfld\n\n\tpop" +for OP in "ldc.i4.0\n\t\tstsfld int32 Class::sfld" "ldsfld int32 Class::sfld\n\n\tpop" "ldsflda int32 Class::sfld\n\n\tpop" do ./make_access_test.sh access_check_41_${I} valid "$OP" public family yes ./make_access_test.sh access_check_42_${I} valid "$OP" public famandassem yes @@ -2180,12 +2180,12 @@ done #ldobj tests function fix_ldobj () { - if [ "$3" != "" ]; then - A=$3; - elif [ "$2" != "" ]; then - A=$2; + if [ -n "$3" ]; then + A="$3"; + elif [ -n "$2" ]; then + A="$2"; else - A=$1; + A="$1"; fi if [ "$A" = "bool" ]; then @@ -2207,7 +2207,7 @@ do do TYPE1="$(fix_ldobj $T1)" TYPE2="$(fix_ldobj $T2)" - if [ "$TYPE1" = "$TYPE2" ] ; then + if [ "$TYPE1" = "$TYPE2" ]; then ./make_ldobj_test.sh ldobj_${I} valid "${T1}\&" "${T2}" else ./make_ldobj_test.sh ldobj_${I} unverifiable "${T1}\&" "${T2}" @@ -2220,16 +2220,16 @@ done #unverifiable #for T1 in "int8" "int64" "float64" "object" "string" "class Class" "int32[]" "int32[,]" "valuetype MyStruct" "valuetype MyStruct2" "int32 *" "valuetype MyStruct *" "method int32 *(int32)" -for T1 in "native int" "int8*" "typedref" +for T1 in "native int" "int8*" "typedref" do for T2 in "int8" "int64" "float64" "object" "string" "class Class" "int32[]" "int32[,]" "valuetype MyStruct" "valuetype MyStruct2" "int32 *" "valuetype MyStruct *" "method int32 *(int32)" "native int" "typedref" "class Template\`1" "valuetype StructTemplate\`1" "valuetype StructTemplate2\`1" - do + do ./make_ldobj_test.sh ldobj_${I} unverifiable "${T1}" "${T2}" I=`expr $I + 1` done done -for T1 in "native int" "int8*" "typedref" +for T1 in "native int" "int8*" "typedref" do ./make_ldobj_test.sh ldobj_${I} invalid "${T1}" "typedref\&" I=`expr $I + 1` @@ -2240,9 +2240,9 @@ done #invalid #for T1 in "int8" "int64" "float64" "object" "string" "class Class" "int32[]" "int32[,]" "valuetype MyStruct" "valuetype MyStruct2" "int32 *" "valuetype MyStruct *" "method int32 *(int32)" for T1 in 'int8' 'native int' -do +do for T2 in "int8\&" "int64\&" "float64\&" "object\&" "string\&" "class Class\&" "valuetype MyStruct\&" "native int\&" "class Template\`1\&" "valuetype StructTemplate\`1\&" "valuetype StructTemplate2\`1\&" "class [mscorlib]ExampleMM" "class [mscorlib]ExampleMM\&" - do + do ./make_ldobj_test.sh ldobj_${I} invalid "${T1}" "${T2}" I=`expr $I + 1` done @@ -2427,7 +2427,7 @@ done I=1 -for TYPE in "int32" "unsigned int32" "native int" "native unsigned int" +for TYPE in "int32" "unsigned int32" "native int" "native unsigned int" do ./make_load_indirect_test.sh indirect_load_i_${I} valid "ldind.i" "${TYPE}" I=`expr $I + 1` @@ -2523,14 +2523,14 @@ I=1 for TYPE1 in "int8" "bool" "int32" "native int" do ./make_store_indirect_test.sh indirect_store_bad_addr_i2_${I} unverifiable "stind.i2" "${TYPE1}\&" "int16" - ./make_store_indirect_test.sh indirect_store_good_val_i2_${I} valid "stind.i2" "int16\&" "${TYPE1}" + ./make_store_indirect_test.sh indirect_store_good_val_i2_${I} valid "stind.i2" "int16\&" "${TYPE1}" I=`expr $I + 1` done for TYPE1 in "int64" "float32" "float64" "object" "string" "class Class" "valuetype MyStruct" "int32[]" "int32[,]" "int32*" "method int32 *(int32)" "class Template\`1" do ./make_store_indirect_test.sh indirect_store_bad_addr_i2_${I} unverifiable "stind.i2" "${TYPE1}\&" "int16" - ./make_store_indirect_test.sh indirect_store_bad_val_i2_${I} unverifiable "stind.i2" "int16\&" "${TYPE1}" + ./make_store_indirect_test.sh indirect_store_bad_val_i2_${I} unverifiable "stind.i2" "int16\&" "${TYPE1}" I=`expr $I + 1` done @@ -2589,14 +2589,14 @@ done I=1 for TYPE1 in "int8" "bool" "int16" "char" do - ./make_store_indirect_test.sh indirect_store_bad_addr_i_${I} unverifiable "stind.i" "${TYPE1}\&" "native int" + ./make_store_indirect_test.sh indirect_store_bad_addr_i_${I} unverifiable "stind.i" "${TYPE1}\&" "native int" ./make_store_indirect_test.sh indirect_store_good_val_i_${I} valid "stind.i" "native int\&" "${TYPE1}" I=`expr $I + 1` done for TYPE1 in "int64" "float32" "float64" "object" "string" "class Class" "valuetype MyStruct" "int32[]" "int32[,]" "int32*" "method int32 *(int32)" "class Template\`1" do - ./make_store_indirect_test.sh indirect_store_bad_addr_i_${I} unverifiable "stind.i" "${TYPE1}\&" "native int" + ./make_store_indirect_test.sh indirect_store_bad_addr_i_${I} unverifiable "stind.i" "${TYPE1}\&" "native int" ./make_store_indirect_test.sh indirect_store_bad_val_i_${I} unverifiable "stind.i" "native int\&" "${TYPE1}" I=`expr $I + 1` done @@ -2701,7 +2701,7 @@ done ./make_ldelema_test.sh ldelema_empty_stack_3 invalid "pop" "ldc.i4.0" "int32" I=1 -for ARR in "int8" "int16" "int32" +for ARR in "int8" "int16" "int32" do ./make_ldelema_test.sh ldelema_size_compat_${I} valid "newarr ${ARR}" "ldc.i4.0" "unsigned ${ARR}" I=`expr $I + 1` @@ -2722,12 +2722,12 @@ done ./make_ldelema_test.sh ldelema_misc_size_compat_3 valid "newarr native int" "ldc.i4.0" "int32" ./make_ldelema_test.sh ldelema_misc_size_compat_4 valid "newarr native unsigned int" "ldc.i4.0" "int32" -./make_ldelema_test.sh ldelema_misc_size_compat_5 valid "newarr int8" "ldc.i4.0" "bool" +./make_ldelema_test.sh ldelema_misc_size_compat_5 valid "newarr int8" "ldc.i4.0" "bool" ./make_ldelema_test.sh ldelema_misc_size_compat_6 valid "newarr int16" "ldc.i4.0" "char" ./make_ldelema_test.sh ldelema_misc_size_compat_7 valid "newarr int32" "ldc.i4.0" "native int" ./make_ldelema_test.sh ldelema_misc_size_compat_8 valid "newarr int32" "ldc.i4.0" "native unsigned int" -./make_ldelema_test.sh ldelema_misc_size_compat_9 valid "newarr unsigned int8" "ldc.i4.0" "bool" +./make_ldelema_test.sh ldelema_misc_size_compat_9 valid "newarr unsigned int8" "ldc.i4.0" "bool" ./make_ldelema_test.sh ldelema_misc_size_compat_10 valid "newarr unsigned int16" "ldc.i4.0" "char" ./make_ldelema_test.sh ldelema_misc_size_compat_11 valid "newarr unsigned int32" "ldc.i4.0" "native int" ./make_ldelema_test.sh ldelema_misc_size_compat_12 valid "newarr unsigned int32" "ldc.i4.0" "native unsigned int" @@ -2804,7 +2804,7 @@ do I=`expr $I + 1` done -for ARR in "int32" "unsigned int32" "IntEnum" +for ARR in "int32" "unsigned int32" "IntEnum" do ./make_ldelem_test.sh ldelem_base_types_i_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldelem.i4" ./make_ldelem_test.sh ldelem_base_types_u_${I} valid "newarr ${ARR}" "ldc.i4.0" "ldelem.u4" @@ -2876,7 +2876,7 @@ do I=`expr $I + 1` done -for ARR in "valuetype MyStruct" "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16" "int32" "unsigned int32" "native int" "native unsigned int" "int64" "unsigned int64" "float32" "float64" +for ARR in "valuetype MyStruct" "int8" "bool" "unsigned int8" "int16" "char" "unsigned int16" "int32" "unsigned int32" "native int" "native unsigned int" "int64" "unsigned int64" "float32" "float64" do ./make_ldelem_test.sh ldelem_base_types_o_${I} unverifiable "newarr ${ARR}" "ldc.i4.0" "ldelem.ref" I=`expr $I + 1` @@ -3187,7 +3187,7 @@ done #object I=1 -for LOAD in "ldloc.0" "ldnull" +for LOAD in "ldloc.0" "ldnull" do ./make_cast_test.sh cast_good_obj_${I} valid "object" "$LOAD" "castclass object" ./make_cast_test.sh isinst_good_obj_${I} valid "object" "$LOAD" "isinst object" @@ -3349,7 +3349,7 @@ done #branching in the middle of an instruction ./make_branch_test.sh branch_middle_of_instruction invalid 1 "br 2"; -#branching in between prefix and instruction +#branching in between prefix and instruction ./make_branch_test.sh branch_middle_of_instruction_prefix_1 invalid 1 "br AFTER_FIRST_PREFIX"; ./make_branch_test.sh branch_middle_of_instruction_prefix_2 invalid 1 "br AFTER_SECOND_PREFIX"; @@ -3408,7 +3408,7 @@ done #regions must not overlap with each other ./make_exception_overlap_test.sh exception_entry_overlap_separate_1 valid ".try TRY_BLOCK_1 to TRY_BLOCK_1_END catch [mscorlib]System.Exception handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END" ".try TRY_BLOCK_2 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END" -./make_exception_overlap_test.sh exception_entry_overlap_separate_2 valid ".try TRY_BLOCK_2 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END" ".try TRY_BLOCK_1 to TRY_BLOCK_1_END catch [mscorlib]System.Exception handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END" +./make_exception_overlap_test.sh exception_entry_overlap_separate_2 valid ".try TRY_BLOCK_2 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END" ".try TRY_BLOCK_1 to TRY_BLOCK_1_END catch [mscorlib]System.Exception handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END" ./make_exception_overlap_test.sh exception_entry_overlap_try_over_catch invalid ".try TRY_BLOCK_1 to CATCH_BLOCK_1_A catch [mscorlib]System.Exception handler CATCH_BLOCK_1 to CATCH_BLOCK_1_END" ".try TRY_BLOCK_2 to TRY_BLOCK_2_END catch [mscorlib]System.Exception handler CATCH_BLOCK_2 to CATCH_BLOCK_2_END" @@ -3590,7 +3590,7 @@ done #tests for ovf opcodes I=1 -for OP in "add.ovf" "add.ovf.un" "mul.ovf" "mul.ovf.un" "sub.ovf" "sub.ovf.un" +for OP in "add.ovf" "add.ovf.un" "mul.ovf" "mul.ovf.un" "sub.ovf" "sub.ovf.un" do for TYPE in "object" "string" "float32" "float64" "int32*" "typedref" "int32[]" "int32[,]" "method int32 *(int32)" do @@ -3613,8 +3613,8 @@ do I=`expr $I + 1` done done - -for OP in "add.ovf.un" "sub.ovf.un" + +for OP in "add.ovf.un" "sub.ovf.un" do for TYPE in "int32" "native int" "int32&" do @@ -3682,20 +3682,20 @@ done I=1 for TYPE in "int32" "int64" "float32" "float64" Class MyStruct string object "int32[]" "int32[,]" "native int" do - ./make_stobj_test.sh stobj_simple_${I} valid "$TYPE" "$TYPE\&" "$TYPE" + ./make_stobj_test.sh stobj_simple_${I} valid "$TYPE" "$TYPE\&" "$TYPE" I=`expr $I + 1` done for TYPE in "int32*" "method int32 *(int32)" do - ./make_stobj_test.sh stobj_simple_${I} unverifiable "$TYPE" "$TYPE\&" "$TYPE" + ./make_stobj_test.sh stobj_simple_${I} unverifiable "$TYPE" "$TYPE\&" "$TYPE" I=`expr $I + 1` done for TYPE in "int32\&" "void" "typedref" do - ./make_stobj_test.sh stobj_simple_${I} invalid "$TYPE" "$TYPE\&" "$TYPE" + ./make_stobj_test.sh stobj_simple_${I} invalid "$TYPE" "$TYPE\&" "$TYPE" I=`expr $I + 1` done @@ -3703,7 +3703,7 @@ done I=1 for TYPE in "int32\&" "int32*" "typedref" do - ./make_stobj_test.sh stobj_bad_src_${I} unverifiable "$TYPE" "int32\&" "int32" + ./make_stobj_test.sh stobj_bad_src_${I} unverifiable "$TYPE" "int32\&" "int32" I=`expr $I + 1` done @@ -3711,27 +3711,27 @@ done I=1 for TYPE in "int32" "int64" "float32" "float64" Class MyStruct string object "int32[]" "int32[,]" "native int" do - ./make_stobj_test.sh stobj_dest_not_managed_pointer_${I} unverifiable "$TYPE" "$TYPE" "$TYPE" + ./make_stobj_test.sh stobj_dest_not_managed_pointer_${I} unverifiable "$TYPE" "$TYPE" "$TYPE" I=`expr $I + 1` done #src is compat to dest I=1 for TYPE in "int8" "unsigned int8" "bool" "int16" "unsigned int16" "char" "int32" "unsigned int32" "native int" "native unsigned int" -do - ./make_stobj_test.sh stobj_src_compat_to_token_${I} valid "$TYPE" "int32\&" "int32" +do + ./make_stobj_test.sh stobj_src_compat_to_token_${I} valid "$TYPE" "int32\&" "int32" I=`expr $I + 1` done for TYPE in "int64" "unsigned int64" "float32" "float64" string object -do - ./make_stobj_test.sh stobj_src_compat_to_token_${I} unverifiable "$TYPE" "int32\&" "int32" +do + ./make_stobj_test.sh stobj_src_compat_to_token_${I} unverifiable "$TYPE" "int32\&" "int32" I=`expr $I + 1` done for TYPE in string object Class -do - ./make_stobj_test.sh stobj_src_compat_to_token_${I} valid "$TYPE" "object\&" "object" +do + ./make_stobj_test.sh stobj_src_compat_to_token_${I} valid "$TYPE" "object\&" "object" I=`expr $I + 1` done @@ -3741,8 +3741,8 @@ done #token type subtype of dest_type for TYPE in string object Class "int32[]" "int32[,]" -do - ./make_stobj_test.sh stobj_token_subtype_of_dest_${I} valid "$TYPE" "object\&" "$TYPE" +do + ./make_stobj_test.sh stobj_token_subtype_of_dest_${I} valid "$TYPE" "object\&" "$TYPE" I=`expr $I + 1` done @@ -3930,7 +3930,7 @@ done #valid types I=1 -for INIT in "ldc.i4.1" "ldc.i4.1\n\tconv.i" +for INIT in "ldc.i4.1" "ldc.i4.1\n\tconv.i" do ./make_localloc_test.sh localloc_stack_type_$I unverifiable "$INIT" I=`expr $I + 1` @@ -3944,7 +3944,7 @@ do done #stack underflow -./make_localloc_test.sh localloc_empty_stack invalid +./make_localloc_test.sh localloc_empty_stack invalid ./make_localloc_test.sh localloc_stack_with_more_than_2_items invalid "ldc.i4.1\n\tldc.i4.1" #inside exception blocks @@ -3964,7 +3964,7 @@ done #call test #invalid method token #valid -#validate the this pointer for signatures with HASTHIS. +#validate the this pointer for signatures with HASTHIS. #this ptr: reference types must be a value, value type can be a MP or a BT. #number of args #args are compatible @@ -4006,7 +4006,7 @@ done ./make_call_test.sh call_final_virtual_method_2 unverifiable "call instance void ClassC::VirtMethod()" "newobj instance void ClassA::.ctor()" ./make_call_test.sh call_final_virtual_method_3 unverifiable "call instance void ClassA::VirtMethod()" "newobj instance void ClassA::.ctor()" -./make_call_test.sh call_virtual_method_3 unverifiable "call instance void BaseClass::VirtMethod()" "ldarg.0" "instance" "ldarg.0\n\t\tstarg 0" +./make_call_test.sh call_virtual_method_3 unverifiable "call instance void BaseClass::VirtMethod()" "ldarg.0" "instance" "ldarg.0\n\t\tstarg 0" ./make_call_test.sh call_virtual_method_4 unverifiable "call instance void BaseClass::VirtMethod()" "ldarg.0" "instance" "ldarga 0\n\t\tpop" #value type (we can call non final virtual on boxed VT) @@ -4030,7 +4030,7 @@ done ./make_call_test.sh callvirt_final_virtual_method_2 unverifiable "callvirt instance void ClassC::VirtMethod()" "newobj instance void ClassA::.ctor()" ./make_call_test.sh callvirt_final_virtual_method_3 valid "callvirt instance void ClassA::VirtMethod()" "newobj instance void ClassA::.ctor()" -./make_call_test.sh callvirt_virtual_method_3 valid "callvirt instance void BaseClass::VirtMethod()" "ldarg.0" "instance" "ldarg.0\n\t\tstarg 0" +./make_call_test.sh callvirt_virtual_method_3 valid "callvirt instance void BaseClass::VirtMethod()" "ldarg.0" "instance" "ldarg.0\n\t\tstarg 0" ./make_call_test.sh callvirt_virtual_method_4 valid "callvirt instance void BaseClass::VirtMethod()" "ldarg.0" "instance" "ldarga 0\n\t\tpop" #value type (we can call non final virtual on boxed VT) @@ -4227,7 +4227,7 @@ done ./make_delegate_compat_test.sh delegate_pointers_ret_1 unverifiable "object*" "string*" int32 int32 ./make_delegate_compat_test.sh delegate_pointers_ret_2 unverifiable "InterfaceA*" "ImplA*" int32 int32 -./make_delegate_compat_test.sh delegate_pointers_ret_3 unverifiable "string*" "object*" int32 int32 +./make_delegate_compat_test.sh delegate_pointers_ret_3 unverifiable "string*" "object*" int32 int32 ./make_delegate_compat_test.sh delegate_pointers_ret_4 unverifiable "int32*" "int32*" int32 int32 @@ -4278,8 +4278,8 @@ done I=1 for TYPE in "ldind.i1 int8" "ldind.u1 int8" "ldind.i2 int16" "ldind.u2 int16" "ldind.i4 int32" "ldind.u4 int32" "ldind.i8 int64" "ldind.u8 int64" "ldind.i native int" "ldind.r4 float32" "ldind.r8 float64" do - LOAD=`echo $TYPE | cut -d' ' -f 1` - TYPE=`echo $TYPE | cut -d' ' -f 2-` + LOAD=`echo $TYPE | cut -d' ' -f 1` + TYPE=`echo $TYPE | cut -d' ' -f 2-` ./make_cmmp_test.sh cmmp_basic_test_ro_$I valid "readonly. ldelema $TYPE" "$LOAD" "$TYPE" ./make_cmmp_test.sh cmmp_basic_test_ub_$I valid "unbox $TYPE" "$LOAD" "$TYPE" I=`expr $I + 1` @@ -4333,8 +4333,8 @@ done I=1 for TYPE in "stind.i1 int8" "stind.i2 int16" "stind.i4 int32" "stind.i8 int64" "stind.r4 float32" "stind.r8 float64" "stind.i native int" do - STORE=`echo $TYPE | cut -d' ' -f 1` - TYPE=`echo $TYPE | cut -d' ' -f 2-` + STORE=`echo $TYPE | cut -d' ' -f 1` + TYPE=`echo $TYPE | cut -d' ' -f 2-` ./make_cmmp_test.sh cmmp_bad_ops_test_ro_$I unverifiable "readonly. ldelema $TYPE" "ldloc.0\n\t$STORE" "$TYPE" ./make_cmmp_test.sh cmmp_bad_ops_test_ub_$I unverifiable "unbox $TYPE" "ldloc.0\n\t$STORE" "$TYPE" I=`expr $I + 1` @@ -4667,7 +4667,7 @@ do I=`expr $I + 1` done -for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor "valuetype MyValueType" "valuetype [mscorlib]System.Nullable\`1" "[mscorlib]System.ValueType" "[mscorlib]System.Enum" IFace IFaceImpl +for TYPE in object ClassNoDefaultCtor AbstractClass ClassWithDefaultCtorNotVisible ClassWithDefaultCtor "valuetype MyValueType" "valuetype [mscorlib]System.Nullable\`1" "[mscorlib]System.ValueType" "[mscorlib]System.Enum" IFace IFaceImpl do ./make_type_constraint_test.sh type_constraint_system_enum_ctor_ct_$I invalid "$TYPE" ".ctor (class [mscorlib]System.Enum)" ./make_type_constraint_test.sh type_constraint_system_enum_vt_ct_$I invalid "$TYPE" "valuetype (class [mscorlib]System.Enum)" @@ -4761,8 +4761,8 @@ done I=1 for TYPE in "stind.i1 int8" "stind.i2 int16" "stind.i4 int32" "stind.i8 int64" "stind.r4 float32" "stind.r8 float64" "stind.i native int" do - STORE=`echo $TYPE | cut -d' ' -f 1` - TYPE=`echo $TYPE | cut -d' ' -f 2-` + STORE=`echo $TYPE | cut -d' ' -f 1` + TYPE=`echo $TYPE | cut -d' ' -f 2-` ./make_prefix_test.sh "prefix_test_stind_volatile_$I" valid "volatile. $STORE" "ldloca 0\n\tldloc.0" "$TYPE" ./make_prefix_test.sh "prefix_test_stind_unaligned_$I" valid "unaligned. 1 $STORE" "ldloca 0\n\tldloc.0" "$TYPE" I=`expr $I + 1` @@ -4776,8 +4776,8 @@ done I=1 for TYPE in "ldind.i1 int8" "ldind.u1 unsigned int8" "ldind.i2 int16" "ldind.u2 unsigned int16" "ldind.i4 int32" "ldind.u4 unsigned int32" "ldind.i8 int64" "ldind.u8 unsigned int64" "ldind.r4 float32" "ldind.r8 float64" "ldind.i native int" do - STORE=`echo $TYPE | cut -d' ' -f 1` - TYPE=`echo $TYPE | cut -d' ' -f 2-` + STORE=`echo $TYPE | cut -d' ' -f 1` + TYPE=`echo $TYPE | cut -d' ' -f 2-` ./make_prefix_test.sh "prefix_test_ldind_volatile_$I" valid "volatile. $STORE" "ldloca 0" "$TYPE" ./make_prefix_test.sh "prefix_test_ldind_unaligned_$I" valid "unaligned. 1 $STORE" "ldloca 0" "$TYPE" I=`expr $I + 1` @@ -5133,7 +5133,7 @@ done ./make_generic_argument_constraints_test.sh no_constraints valid "" "" I=1 -for SRC in "(IfaceA)" "(IfaceB)" "(IfaceA, IfaceB)" ".ctor" "class" +for SRC in "(IfaceA)" "(IfaceB)" "(IfaceA, IfaceB)" ".ctor" "class" do ./make_generic_argument_constraints_test.sh src_ctrs_only_${I} unverifiable "$SRC" "" I=`expr $I + 1` diff --git a/src/mono/mono/tests/verifier/make_throw_test.sh b/src/mono/mono/tests/verifier/make_throw_test.sh index fb39d08fec29e6..d4d6eb466a1fe0 100755 --- a/src/mono/mono/tests/verifier/make_throw_test.sh +++ b/src/mono/mono/tests/verifier/make_throw_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -16,7 +16,7 @@ TEST_FILE=${TEST_NAME}_generated.il echo $TEST_FILE $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/LOCAL/${TEST_LOCAL}/g" -e "s/OP/${TEST_OP}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -17,7 +17,7 @@ echo $TEST_FILE $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/INSTANTIATION/${TEST_INSTANTIATION}/g" -e "s/CONSTRAINTS/${TEST_CONSTRAINTS}/g" -e "s/EXTRA_CODE/${TEST_EXTRA_CODE}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -12,7 +12,7 @@ TEST_INIT=$4 TEST_EXTRA_LOC=$5 -if [ "$TEST_EXTRA_LOC" != "" ]; then +if [ -n "$TEST_EXTRA_LOC" ]; then EXTRA_LOC=", $TEST_EXTRA_LOC V_1" fi @@ -22,7 +22,7 @@ echo $TEST_FILE TEST_TYPE=`echo $TEST_TYPE | $SED -s 's/&/\\\&/'` $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE/${TEST_TYPE}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/INIT/${TEST_INIT}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -15,7 +15,7 @@ echo $TEST_FILE TEST_TYPE1=`echo $TEST_TYPE1 | $SED -s 's/&/\\\&/'` $SED -e "s/OPCODE/${TEST_OP}/g" -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE1/${TEST_TYPE1}/g" -e "s/LOAD_OPCODE/${TEST_LOAD_OP}/g" > $TEST_FILE < /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -91,7 +91,7 @@ $SED -e "s/INIT_OP/${TEST_INIT}/g" -e "s/TYPE1/${TEST_TYPE1}/g" -e "s/VALIDITY/ END: ldc.i4.0 - ret + ret } //EOF diff --git a/src/mono/mono/tests/verifier/make_unbox_test.sh b/src/mono/mono/tests/verifier/make_unbox_test.sh index 744e931a2a9ad8..9d48d4920807c5 100755 --- a/src/mono/mono/tests/verifier/make_unbox_test.sh +++ b/src/mono/mono/tests/verifier/make_unbox_test.sh @@ -1,7 +1,7 @@ #! /bin/sh SED="sed" -if [ `which gsed 2> /dev/null` ] ; then +if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi @@ -84,7 +84,7 @@ $SED -e "s/BOX_OP/${TEST_BOX}/g" -e "s/TYPE1/${TEST_TYPE1}/g" -e "s/VALIDITY/${ POST_OP pop ldc.i4.0 - ret + ret } //EOF diff --git a/src/mono/mono/tools/offsets-tool/offsets-tool.py b/src/mono/mono/tools/offsets-tool/offsets-tool.py index 0c9dff64d2b79b..11de36fda20b11 100644 --- a/src/mono/mono/tools/offsets-tool/offsets-tool.py +++ b/src/mono/mono/tools/offsets-tool/offsets-tool.py @@ -221,10 +221,11 @@ def run_clang(self): args.mono_path, args.mono_path + "/mono", args.mono_path + "/mono/eglib", + args.mono_path + "/../native", args.target_path, args.target_path + "/mono/eglib" ] - + self.basic_types = ["gint8", "gint16", "gint32", "gint64", "float", "double", "gpointer"] self.runtime_type_names = [ "MonoObject", @@ -259,7 +260,7 @@ def run_clang(self): "MonoDelegateTrampInfo", "GSharedVtCallInfo", "SeqPointInfo", - "DynCallArgs", + "DynCallArgs", "MonoLMFTramp", "CallContext", "MonoFtnDesc" @@ -268,7 +269,7 @@ def run_clang(self): self.runtime_types [name] = TypeInfo (name, False) for name in self.jit_type_names: self.runtime_types [name] = TypeInfo (name, True) - + self.basic_type_size = {} self.basic_type_align = {} @@ -285,9 +286,9 @@ def run_clang(self): clang_args.append (include) for define in self.target.get_clang_args (): clang_args.append ("-D" + define) - + clang.cindex.Config.set_library_file (args.libclang) - + for srcfile in srcfiles: src = args.mono_path + "/" + srcfile file_args = clang_args[:] @@ -363,7 +364,7 @@ def gen (self): for field in type.fields: f.write ("DECL_OFFSET2(%s,%s,%s)\n" % (type.name, field.name, field.offset)) f.write ("#endif //disable metadata check\n") - + f.write ("#ifndef DISABLE_JIT_OFFSETS\n") f.write ("#define USED_CROSS_COMPILER_OFFSETS\n") for type_name in self.jit_type_names: @@ -374,7 +375,7 @@ def gen (self): for field in type.fields: f.write ("DECL_OFFSET2(%s,%s,%s)\n" % (type.name, field.name, field.offset)) f.write ("#endif //disable jit check\n") - + f.write ("#endif //cross compiler checks\n") f.write ("#endif //gc check\n") if target.arch_define: diff --git a/src/mono/mono/utils/mono-context.c b/src/mono/mono/utils/mono-context.c index 81de515cafdc44..c77193186e5b9d 100644 --- a/src/mono/mono/utils/mono-context.c +++ b/src/mono/mono/utils/mono-context.c @@ -51,7 +51,7 @@ mono_sigctx_to_monoctx (void *sigctx, MonoContext *mctx) g_assert_not_reached (); #elif defined(MONO_SIGNAL_USE_UCONTEXT_T) ucontext_t *ctx = (ucontext_t*)sigctx; - + mctx->eax = UCONTEXT_REG_EAX (ctx); mctx->ebx = UCONTEXT_REG_EBX (ctx); mctx->ecx = UCONTEXT_REG_ECX (ctx); @@ -85,7 +85,7 @@ mono_sigctx_to_monoctx (void *sigctx, MonoContext *mctx) mctx->eax = context->Eax; mctx->ebp = context->Ebp; mctx->esp = context->Esp; -#else +#else struct sigcontext *ctx = (struct sigcontext *)sigctx; mctx->eax = ctx->SC_EAX; @@ -468,7 +468,7 @@ mono_sigctx_to_monoctx (void *sigctx, MonoContext *mctx) mctx->pc = context->Pc; mctx->cpsr = context->Cpsr; memcpy (&mctx->regs, &context->R0, sizeof (DWORD) * 16); - + /* Why are we only copying 16 registers?! There are 32! */ memcpy (&mctx->fregs, &context->D, sizeof (double) * 16); #else @@ -495,7 +495,7 @@ mono_monoctx_to_sigctx (MonoContext *mctx, void *ctx) context->Pc = mctx->pc; context->Cpsr = mctx->cpsr; memcpy (&context->R0, &mctx->regs, sizeof (DWORD) * 16); - + /* Why are we only copying 16 registers?! There are 32! */ memcpy (&context->D, &mctx->fregs, sizeof (double) * 16); #else diff --git a/src/mono/mono/utils/mono-dl-windows.c b/src/mono/mono/utils/mono-dl-windows.c index e2c6d2dfc64cad..a7ad6d80c8d968 100644 --- a/src/mono/mono/utils/mono-dl-windows.c +++ b/src/mono/mono/utils/mono-dl-windows.c @@ -205,7 +205,7 @@ mono_dl_current_error_string (void) #else WCHAR local_buf [1024]; if (!FormatMessageW (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, - code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), local_buf, G_N_ELEMENTS (local_buf) - 1, NULL) ) + code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), local_buf, STRING_LENGTH (local_buf), NULL) ) local_buf [0] = TEXT('\0'); ret = u16to8 (local_buf) diff --git a/src/mono/mono/utils/mono-dl.c b/src/mono/mono/utils/mono-dl.c index 137999e2083462..5583be758e17bf 100644 --- a/src/mono/mono/utils/mono-dl.c +++ b/src/mono/mono/utils/mono-dl.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #if defined(TARGET_ANDROID) && !defined(WIN32) #include diff --git a/src/mono/mono/utils/mono-mmap-windows.c b/src/mono/mono/utils/mono-mmap-windows.c index a7612ad75daf6b..e6945440363d54 100644 --- a/src/mono/mono/utils/mono-mmap-windows.c +++ b/src/mono/mono/utils/mono-mmap-windows.c @@ -165,7 +165,7 @@ format_win32_error_string (gint32 win32_error) #else WCHAR local_buf [1024]; if (!FormatMessageW (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, - win32_error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), local_buf, G_N_ELEMENTS (local_buf) - 1, NULL) ) + win32_error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), local_buf, STRING_LENGTH (local_buf), NULL) ) local_buf [0] = TEXT('\0'); ret = u16to8 (local_buf) diff --git a/src/mono/mono/utils/mono-threads-windows.c b/src/mono/mono/utils/mono-threads-windows.c index bd639adfcd56ea..b8279499ddbb56 100644 --- a/src/mono/mono/utils/mono-threads-windows.c +++ b/src/mono/mono/utils/mono-threads-windows.c @@ -408,7 +408,7 @@ mono_thread_platform_create_thread (MonoThreadStart thread_fn, gpointer thread_d *tid = thread_id; if (stack_size) { - // TOOD: Use VirtualQuery to get correct value + // TOOD: Use VirtualQuery to get correct value // http://stackoverflow.com/questions/2480095/thread-stack-size-on-windows-visual-c *stack_size = set_stack_size; } diff --git a/src/mono/sample/mbr/browser/WasmDelta.csproj b/src/mono/sample/mbr/browser/WasmDelta.csproj index c150529f753c6d..5cc4b15f09511b 100644 --- a/src/mono/sample/mbr/browser/WasmDelta.csproj +++ b/src/mono/sample/mbr/browser/WasmDelta.csproj @@ -7,7 +7,7 @@ bin $(MSBuildProjectDirectory)\bin\$(Configuration)\AppBundle\ - runtime.js + main.js false diff --git a/src/mono/sample/mbr/browser/index.html b/src/mono/sample/mbr/browser/index.html index 6122370dd9d650..91ccdf9c1e4bc9 100644 --- a/src/mono/sample/mbr/browser/index.html +++ b/src/mono/sample/mbr/browser/index.html @@ -2,37 +2,37 @@ - - TESTS - - - - - - Result from Sample.Test.TestMeaning: -
- Click here (upto 2 times): -
- - - + + Hot Reload Sample + + + + + + Result from Sample.Test.TestMeaning: +
+ Click here (upto 2 times): +
+ + + + - - + \ No newline at end of file diff --git a/src/mono/sample/mbr/browser/runtime.js b/src/mono/sample/mbr/browser/main.js similarity index 95% rename from src/mono/sample/mbr/browser/runtime.js rename to src/mono/sample/mbr/browser/main.js index 36feada2026d68..6294d62187e37d 100644 --- a/src/mono/sample/mbr/browser/runtime.js +++ b/src/mono/sample/mbr/browser/main.js @@ -3,7 +3,6 @@ "use strict"; var Module = { - config: null, configSrc: "./mono-config.json", onConfigLoaded: function () { MONO.config.environment_variables["DOTNET_MODIFIABLE_ASSEMBLIES"] = "debug"; diff --git a/src/mono/sample/wasm/Directory.Build.targets b/src/mono/sample/wasm/Directory.Build.targets index bc7f6b24b0ba27..95415ef67fb168 100644 --- a/src/mono/sample/wasm/Directory.Build.targets +++ b/src/mono/sample/wasm/Directory.Build.targets @@ -14,12 +14,12 @@ - + - + diff --git a/src/mono/sample/wasm/browser-bench/AppStart.cs b/src/mono/sample/wasm/browser-bench/AppStart.cs new file mode 100644 index 00000000000000..98fe46c229bcda --- /dev/null +++ b/src/mono/sample/wasm/browser-bench/AppStart.cs @@ -0,0 +1,88 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Diagnostics.CodeAnalysis; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Text.Json; +using System.Threading.Tasks; + +namespace Sample +{ + public class AppStartTask : BenchTask + { + public override string Name => "AppStart"; + public override bool BrowserOnly => true; + + [DynamicDependency(DynamicallyAccessedMemberTypes.NonPublicConstructors, "System.Runtime.InteropServices.JavaScript.Runtime", "System.Private.Runtime.InteropServices.JavaScript")] + static Type jsRuntimeType = System.Type.GetType("System.Runtime.InteropServices.JavaScript.Runtime, System.Private.Runtime.InteropServices.JavaScript", true); + static Type jsFunctionType = System.Type.GetType("System.Runtime.InteropServices.JavaScript.Function, System.Private.Runtime.InteropServices.JavaScript", true); + [DynamicDependency("InvokeJS(System.String)", "System.Runtime.InteropServices.JavaScript.Runtime", "System.Private.Runtime.InteropServices.JavaScript")] + static MethodInfo invokeJSMethod = jsRuntimeType.GetMethod("InvokeJS", new Type[] { typeof(string) }); + [DynamicDependency(DynamicallyAccessedMemberTypes.PublicConstructors, "System.Runtime.InteropServices.JavaScript.Function", "System.Private.Runtime.InteropServices.JavaScript")] + static ConstructorInfo functionConstructor = jsRuntimeType.GetConstructor(new Type[] { typeof(object[]) }); + [DynamicDependency("Call()", "System.Runtime.InteropServices.JavaScript.Function", "System.Private.Runtime.InteropServices.JavaScript")] + static MethodInfo functionCall = jsFunctionType.GetMethod("Call", BindingFlags.Instance | BindingFlags.Public, new Type[] { }); + + public AppStartTask() + { + measurements = new Measurement[] { + new PageShow(), + new ReachManaged(), + }; + } + + Measurement[] measurements; + public override Measurement[] Measurements => measurements; + + static string InvokeJS(string js) + { + return (string)invokeJSMethod.Invoke(null, new object[] { js }); + } + + class PageShow : BenchTask.Measurement + { + public override string Name => "Page show"; + + public override int InitialSamples => 3; + + async Task RunAsyncStep() + { + var function = Activator.CreateInstance(jsFunctionType, new object[] { new object[] { @"return App.StartAppUI();" } }); + var task = (Task)functionCall.Invoke(function, new object[] { }); + + await task; + } + + public override bool HasRunStepAsync => true; + + public override async Task RunStepAsync() + { + var function = Activator.CreateInstance(jsFunctionType, new object[] { new object[] { @"return App.PageShow();" } }); + await (Task)functionCall.Invoke(function, null); + } + } + + class ReachManaged : BenchTask.Measurement + { + public override string Name => "Reach managed"; + public override int InitialSamples => 3; + public override bool HasRunStepAsync => true; + + static object jsUIReachedManagedFunction = Activator.CreateInstance(jsFunctionType, new object[] { new object[] { @"return App.ReachedManaged();" } }); + static object jsReached = Activator.CreateInstance(jsFunctionType, new object[] { new object[] { @"return App.reached();" } }); + + [MethodImpl(MethodImplOptions.NoInlining)] + public static void Reached() + { + functionCall.Invoke(jsReached, null); + } + + public override async Task RunStepAsync() + { + await (Task)functionCall.Invoke(jsUIReachedManagedFunction, null); + } + } + } +} diff --git a/src/mono/sample/wasm/browser-bench/BenchTask.cs b/src/mono/sample/wasm/browser-bench/BenchTask.cs index fd95e453b3127a..45f87a7b5310de 100644 --- a/src/mono/sample/wasm/browser-bench/BenchTask.cs +++ b/src/mono/sample/wasm/browser-bench/BenchTask.cs @@ -6,17 +6,19 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; -abstract class BenchTask +public abstract class BenchTask { public abstract string Name { get; } readonly List results = new(); public Regex pattern; + public virtual bool BrowserOnly => false; + public async Task RunBatch(List results, int measurementIdx, int milliseconds = 5000) { var measurement = Measurements[measurementIdx]; await measurement.BeforeBatch(); - var result = measurement.RunBatch(this, milliseconds); + var result = await measurement.RunBatch(this, milliseconds); results.Add(result); await measurement.AfterBatch(); @@ -48,14 +50,17 @@ public abstract class Measurement public virtual Task AfterBatch() { return Task.CompletedTask; } - public abstract void RunStep(); + public virtual void RunStep() { } + public virtual async Task RunStepAsync() { await Task.CompletedTask; } + + public virtual bool HasRunStepAsync => false; protected virtual int CalculateSteps(int milliseconds, TimeSpan initTs) { return (int)(milliseconds * InitialSamples / Math.Max(1.0, initTs.TotalMilliseconds)); } - public Result RunBatch(BenchTask task, int milliseconds) + public async Task RunBatch(BenchTask task, int milliseconds) { DateTime start = DateTime.Now; DateTime end; @@ -63,12 +68,19 @@ public Result RunBatch(BenchTask task, int milliseconds) try { // run one to eliminate possible startup overhead and do GC collection - RunStep(); + if (HasRunStepAsync) + await RunStepAsync(); + else + RunStep(); + GC.Collect(); start = DateTime.Now; for (i = 0; i < InitialSamples; i++) - RunStep(); + if (HasRunStepAsync) + await RunStepAsync(); + else + RunStep(); end = DateTime.Now; var initTs = end - start; @@ -77,7 +89,10 @@ public Result RunBatch(BenchTask task, int milliseconds) start = DateTime.Now; for (i = 0; i < steps; i++) { - RunStep(); + if (HasRunStepAsync) + await RunStepAsync(); + else + RunStep(); } end = DateTime.Now; diff --git a/src/mono/sample/wasm/browser-bench/Browser.cs b/src/mono/sample/wasm/browser-bench/Browser.cs new file mode 100644 index 00000000000000..3dcbe36a844b83 --- /dev/null +++ b/src/mono/sample/wasm/browser-bench/Browser.cs @@ -0,0 +1,13 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Sample +{ + public partial class Test + { + public static int Main(string[] args) + { + return 0; + } + } +} diff --git a/src/mono/sample/wasm/browser-bench/Console/Console.cs b/src/mono/sample/wasm/browser-bench/Console/Console.cs new file mode 100644 index 00000000000000..6adb5ecf736bc6 --- /dev/null +++ b/src/mono/sample/wasm/browser-bench/Console/Console.cs @@ -0,0 +1,72 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; + +using Mono.Options; + +namespace Sample +{ + public partial class Test + { + static string tasksArg; + + static List ProcessArguments(string[] args) + { + var help = false; + var options = new OptionSet { + "Simple mono wasm benchmark", + "", + "Copyright 2021 Microsoft Corporation", + "", + "Options:", + { "h|help|?", + "Show this message and exit", + v => help = v != null }, + { "t|tasks=", + "Filter comma separated tasks and its measurements matching, TASK[:REGEX][,TASK[:REGEX],...]. Example: -t Json:non,Exceptions:Inline", + v => tasksArg = v }, + }; + + var remaining = options.Parse(args); + + if (help || remaining.Count > 0) + { + options.WriteOptionDescriptions(Console.Out); + + Environment.Exit(0); + } + + return remaining; + } + + public static async Task Main(string[] args) + { + ProcessArguments(args); + + if (tasksArg != null) + SetTasks(tasksArg); + + string output; + + instance.formatter = new PlainFormatter(); + instance.tasks.RemoveAll(t => t.BrowserOnly); + + if (instance.tasks.Count < 1) + { + Console.WriteLine("No task(s) to run"); + Environment.Exit(0); + } + + do + { + output = await instance.RunTasks(); + Console.Write(output); + } while (!string.IsNullOrEmpty(output)); + + return 0; + } + } +} diff --git a/src/mono/sample/wasm/browser-bench/Console/Makefile b/src/mono/sample/wasm/browser-bench/Console/Makefile new file mode 100644 index 00000000000000..bab3c8cdf9b89f --- /dev/null +++ b/src/mono/sample/wasm/browser-bench/Console/Makefile @@ -0,0 +1,12 @@ +TOP=../../../../../.. + +include ../../wasm.mk + +ifneq ($(AOT),) +override MSBUILD_ARGS+=/p:RunAOTCompilation=true +endif + +PROJECT_NAME=Wasm.Console.Bench.Sample.csproj +CONSOLE_DLL=Wasm.Console.Bench.Sample.dll + +run: run-console diff --git a/src/mono/sample/wasm/browser-bench/Console/Wasm.Console.Bench.Sample.csproj b/src/mono/sample/wasm/browser-bench/Console/Wasm.Console.Bench.Sample.csproj new file mode 100644 index 00000000000000..ab8a632046fa72 --- /dev/null +++ b/src/mono/sample/wasm/browser-bench/Console/Wasm.Console.Bench.Sample.csproj @@ -0,0 +1,22 @@ + + + true + $(MonoProjectRoot)\wasm\test-main.js + true + true + + + + <_SampleProject>Wasm.Console.Bench.Sample.csproj + <_SampleAssembly>Wasm.Console.Bench.Sample.dll + False + + + + + + + + + + diff --git a/src/mono/sample/wasm/browser-bench/Program.cs b/src/mono/sample/wasm/browser-bench/Program.cs index 71e522649655b5..0b6dedfa326a99 100644 --- a/src/mono/sample/wasm/browser-bench/Program.cs +++ b/src/mono/sample/wasm/browser-bench/Program.cs @@ -11,24 +11,22 @@ namespace Sample { - public class Test + public partial class Test { - public static void Main(string[] args) - { - } - - BenchTask[] tasks = + List tasks = new() { + new AppStartTask(), new ExceptionsTask(), - new JsonTask (), + new JsonTask(), new WebSocketTask() }; - static Test instance = new Test (); + static Test instance = new Test(); + Formatter formatter = new HTMLFormatter(); [MethodImpl(MethodImplOptions.NoInlining)] public static Task RunBenchmark() { - return instance.RunTasks (); + return instance.RunTasks(); } [MethodImpl(MethodImplOptions.NoInlining)] @@ -46,14 +44,15 @@ public static void SetTasks(string taskNames) var idx = names[i].IndexOf(':'); string name; - if (idx == -1) { + if (idx == -1) + { name = names[i]; pattern = null; } else { name = names[i].Substring(0, idx); - pattern = new Regex (names[i][(idx + 1)..]); + pattern = new Regex(names[i][(idx + 1)..]); } var taskType = Type.GetType($"Sample.{name}Task"); @@ -62,10 +61,10 @@ public static void SetTasks(string taskNames) var task = (BenchTask)Activator.CreateInstance(taskType); task.pattern = pattern; - tasksList.Add (task); + tasksList.Add(task); } - instance.tasks = tasksList.ToArray (); + instance.tasks = tasksList; } int taskCounter = 0; @@ -80,11 +79,12 @@ BenchTask Task List results = new(); bool resultsReturned; - bool NextTask () + bool NextTask() { bool hasMeasurement; - do { - if (taskCounter == tasks.Length) + do + { + if (taskCounter == tasks.Count) return false; Task = tasks[taskCounter]; @@ -100,7 +100,7 @@ bool NextTask () return true; } - bool NextMeasurement () + bool NextMeasurement() { runIdx = 0; @@ -122,45 +122,46 @@ public async Task RunTasks() if (resultsReturned) return ""; - if (taskCounter == 0) { - NextTask (); - return "Benchmark started
"; + if (taskCounter == 0) + { + NextTask(); + return $"Benchmark started{formatter.NewLine}"; } if (measurementIdx == -1) return ResultsSummary(); - if (runIdx >= Task.Measurements [measurementIdx].NumberOfRuns && !NextMeasurement() && !NextTask ()) - return ResultsSummary(); + if (runIdx >= Task.Measurements[measurementIdx].NumberOfRuns && !NextMeasurement() && !NextTask()) + return ResultsSummary(); runIdx++; - return await Task.RunBatch(results, measurementIdx); + return $"{await Task.RunBatch(results, measurementIdx)}{formatter.NewLine}"; } - string ResultsSummary () + string ResultsSummary() { - Dictionary minTimes = new Dictionary (); + Dictionary minTimes = new Dictionary(); StringBuilder sb = new(); foreach (var result in results) { double t; var key = $"{result.taskName}, {result.measurementName}"; - t = result.span.TotalMilliseconds/result.steps; + t = result.span.TotalMilliseconds / result.steps; if (minTimes.ContainsKey(key)) - t = Math.Min (minTimes[key], t); + t = Math.Min(minTimes[key], t); minTimes[key] = t; } - sb.Append("

Summary

"); + sb.Append($"{formatter.NewLine}Summary{formatter.NewLine}"); foreach (var key in minTimes.Keys) { - sb.Append($"{key}: {minTimes [key]}ms
"); + sb.Append($"{key}: {minTimes[key]}ms{formatter.NewLine}"); } - sb.Append("

.md

| measurement | time |
|-:|-:|
"); + sb.Append($"{formatter.NewLine}.md{formatter.NewLine}{formatter.CodeStart}| measurement | time |{formatter.NewLine}|-:|-:|{formatter.NewLine}"); foreach (var key in minTimes.Keys) { var time = minTimes[key]; @@ -170,13 +171,37 @@ string ResultsSummary () time *= 1000; unit = "us"; } - sb.Append($"| {key.Replace('_',' '),38} | {time,10:F4}{unit} |
".Replace (" ", " ")); + sb.Append($"| {key.Replace('_', ' '),38} | {time,10:F4}{unit} |{formatter.NewLine}".Replace(" ", formatter.NonBreakingSpace)); } - sb.Append("
"); + sb.Append($"{formatter.CodeEnd}"); resultsReturned = true; return sb.ToString(); } } + + public abstract class Formatter + { + public abstract string NewLine { get; } + public abstract string NonBreakingSpace { get; } + public abstract string CodeStart { get; } + public abstract string CodeEnd { get; } + } + + public class PlainFormatter : Formatter + { + override public string NewLine => "\n"; + override public string NonBreakingSpace => " "; + override public string CodeStart => ""; + override public string CodeEnd => ""; + } + + public class HTMLFormatter : Formatter + { + override public string NewLine => "
"; + override public string NonBreakingSpace => " "; + override public string CodeStart => ""; + override public string CodeEnd => ""; + } } diff --git a/src/mono/sample/wasm/browser-bench/README.md b/src/mono/sample/wasm/browser-bench/README.md new file mode 100644 index 00000000000000..3f4f7950779024 --- /dev/null +++ b/src/mono/sample/wasm/browser-bench/README.md @@ -0,0 +1,92 @@ +## Simple wasm benchmark sample app + +Runs various performance measurements. It is intended as a quick tool to measure mono/wasm performance +in dotnet/runtime repo, using in-tree runtime. Can be used to check performance impact of runtime changes +and the summary is provided in [.md](https://guides.github.com/features/mastering-markdown/) markdown format, +suitable for commit messages and PR descriptions. + +Browser and console versions are available. + +### Running the benchmark + +To run the benchmark on linux/mac: + + > make build + > make run + +can be used in the `browser-bench/` and also in the `browser-bench/Console/`. + +To run the benchmark on windows: + + > dotnet build /t:RunSample + +Example console output: + + > make run + console.debug: MONO_WASM: Initializing mono runtime + console.debug: MONO_WASM: ICU data archive(s) loaded, disabling invariant mode + console.debug: mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28 + console.info: Initializing..... + Benchmark started + Exceptions, NoExceptionHandling count: 8344090, per call: 6.807213249138013E-05ms, total: 0.568s + Exceptions, NoExceptionHandling count: 8500347, per call: 6.940893118833855E-05ms, total: 0.59s + ... + .md + | measurement | time | + |-:|-:| + | Exceptions, NoExceptionHandling | 0.0680us | + | Exceptions, TryCatch | 0.0723us | + | Exceptions, TryCatchThrow | 0.0035ms | + | Exceptions, TryCatchFilter | 0.0848us | + | Exceptions, TryCatchFilterInline | 0.0659us | + | Exceptions, TryCatchFilterThrow | 0.0046ms | + | Exceptions, TryCatchFilterThrowApplies | 0.0036ms | + | Json, non-ASCII text serialize | 15.3855ms | + | Json, non-ASCII text deserialize | 24.7299ms | + | Json, small serialize | 0.2980ms | + | Json, small deserialize | 0.5080ms | + | Json, large serialize | 95.3333ms | + | Json, large deserialize | 141.4737ms | + +The `.md` output will look like this: + +| measurement | time | +|-:|-:| +| Exceptions, NoExceptionHandling | 0.0680us | +| Exceptions, TryCatch | 0.0723us | +| Exceptions, TryCatchThrow | 0.0035ms | +| Exceptions, TryCatchFilter | 0.0848us | +| Exceptions, TryCatchFilterInline | 0.0659us | +| Exceptions, TryCatchFilterThrow | 0.0046ms | +| Exceptions, TryCatchFilterThrowApplies | 0.0036ms | +| Json, non-ASCII text serialize | 15.3855ms | +| Json, non-ASCII text deserialize | 24.7299ms | +| Json, small serialize | 0.2980ms | +| Json, small deserialize | 0.5080ms | +| Json, large serialize | 95.3333ms | +| Json, large deserialize | 141.4737ms | + +Multiple results can be also easily combined together in text editor to have a table with measurements next to each other for comparison. + +### Filter jobs/measurements + +The `-t` option can be used to run subset of jobs/measurements like this, 1st line linux/mac, 2nd line windows: + + > make run ARGS="-t Json:non,Exceptions:Inline" + > dotnet build /v:n /t:RunSample /p:Args="-t Json:non%2cExceptions:Inline" + +Note the escaped `,` character (`%2c`) in the dotnet property above. + +### Console options + + > make run ARGS=-h + ... + Simple mono wasm benchmark + + Copyright 2021 Microsoft Corporation + + Options: + -h, --help, -? Show this message and exit + -t, --tasks=VALUE Filter comma separated tasks and its measurements + matching, TASK[:REGEX][,TASK[:REGEX],...]. + Example: -t Json:non,Exceptions:Inline diff --git a/src/mono/sample/wasm/browser-bench/Wasm.Browser.Bench.Sample.csproj b/src/mono/sample/wasm/browser-bench/Wasm.Browser.Bench.Sample.csproj index ff9f990c78cafa..89c7feed07ef75 100644 --- a/src/mono/sample/wasm/browser-bench/Wasm.Browser.Bench.Sample.csproj +++ b/src/mono/sample/wasm/browser-bench/Wasm.Browser.Bench.Sample.csproj @@ -2,15 +2,21 @@ false - runtime.js + main.js + true + + + + <_SampleProject>Wasm.Browser.Bench.Sample.csproj + <_SampleAssembly> Wasm.Browser.Bench.Sample.dll diff --git a/src/mono/sample/wasm/browser-bench/WebSocket.cs b/src/mono/sample/wasm/browser-bench/WebSocket.cs index e91d2391916510..d163537f7c593e 100644 --- a/src/mono/sample/wasm/browser-bench/WebSocket.cs +++ b/src/mono/sample/wasm/browser-bench/WebSocket.cs @@ -20,6 +20,7 @@ class WebSocketTask : BenchTask public override string Name => "WebSocket"; public override Measurement[] Measurements => measurements; + public override bool BrowserOnly => true; Measurement[] measurements; diff --git a/src/mono/sample/wasm/browser-bench/appstart-frame.html b/src/mono/sample/wasm/browser-bench/appstart-frame.html new file mode 100644 index 00000000000000..84f0832330583b --- /dev/null +++ b/src/mono/sample/wasm/browser-bench/appstart-frame.html @@ -0,0 +1,41 @@ + + + + + + App task + + + + + + + + + + + diff --git a/src/mono/sample/wasm/browser-bench/appstart.js b/src/mono/sample/wasm/browser-bench/appstart.js new file mode 100644 index 00000000000000..5aa11c1e2b66b6 --- /dev/null +++ b/src/mono/sample/wasm/browser-bench/appstart.js @@ -0,0 +1,31 @@ +var AppStart = { + Construct: function() { + this._frame = document.createElement('iframe'); + document.body.appendChild(this._frame); + }, + + WaitForPageShow: async function() { + let promise; + let promiseResolve; + this._frame.src = 'appstart-frame.html'; + promise = new Promise(resolve => { promiseResolve = resolve; }) + window.resolveAppStartEvent = function(event) { promiseResolve(); } + await promise; + }, + + WaitForReached: async function() { + let promise; + let promiseResolve; + this._frame.src = 'appstart-frame.html'; + promise = new Promise(resolve => { promiseResolve = resolve; }) + window.resolveAppStartEvent = function(event) { + if (event == "reached") + promiseResolve(); + } + await promise; + }, + + RemoveFrame: function () { + document.body.removeChild(this._frame); + } +}; diff --git a/src/mono/sample/wasm/browser-bench/index.html b/src/mono/sample/wasm/browser-bench/index.html index 136e400e70c2ae..bec077fe5324c2 100644 --- a/src/mono/sample/wasm/browser-bench/index.html +++ b/src/mono/sample/wasm/browser-bench/index.html @@ -2,64 +2,78 @@ - - TESTS - - - - - - Output:

- - + yieldBench(); + }, - + PageShow: async function () { + AppStart.Construct(); + try { + await AppStart.WaitForPageShow(); + } finally { + AppStart.RemoveFrame(); + } + }, + + ReachedManaged: async function () { + AppStart.Construct(); + try { + await AppStart.WaitForReached(); + } finally { + AppStart.RemoveFrame(); + } + } + }; + + + + + - - + \ No newline at end of file diff --git a/src/mono/sample/wasm/browser-bench/main.js b/src/mono/sample/wasm/browser-bench/main.js new file mode 100644 index 00000000000000..40c3e7f673219a --- /dev/null +++ b/src/mono/sample/wasm/browser-bench/main.js @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +"use strict"; +var Module = { + configSrc: "./mono-config.json", + onDotNetReady: () => { + try { + App.init(); + } catch (error) { + console.log("exception: " + error); + set_exit_code(1, error); + throw (error); + } + }, + onAbort: (error) => { + set_exit_code(1, error); + }, +}; diff --git a/src/mono/sample/wasm/browser-bench/runtime.js b/src/mono/sample/wasm/browser-bench/runtime.js deleted file mode 100644 index bc7f510ce5931c..00000000000000 --- a/src/mono/sample/wasm/browser-bench/runtime.js +++ /dev/null @@ -1,28 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -"use strict"; -var Module = { - config: null, - configSrc: "./mono-config.json", - onConfigLoaded: function () { - if (MONO.config.enable_profiler) { - MONO.config.aot_profiler_options = { - write_at: "Sample.Test::StopProfile", - send_to: "System.Runtime.InteropServices.JavaScript.Runtime::DumpAotProfileData" - } - } - }, - onDotNetReady: function () { - try { - App.init(); - } catch (error) { - test_exit(1); - throw (error); - } - }, - onAbort: function (err) { - test_exit(1); - - }, -}; diff --git a/src/mono/sample/wasm/browser-bench/style.css b/src/mono/sample/wasm/browser-bench/style.css new file mode 100644 index 00000000000000..d21cd30bd1f3ec --- /dev/null +++ b/src/mono/sample/wasm/browser-bench/style.css @@ -0,0 +1,3 @@ +iframe { + display:none; +} diff --git a/src/mono/sample/wasm/browser-profile/README.md b/src/mono/sample/wasm/browser-profile/README.md index 26afb1386711bd..909b296c5208ae 100644 --- a/src/mono/sample/wasm/browser-profile/README.md +++ b/src/mono/sample/wasm/browser-profile/README.md @@ -9,11 +9,11 @@ public static void StopProfile(){} ``` -2. Initialize the profiler in the main javascript (e.g. runtime.js) +2. Initialize the profiler in the main javascript (e.g. main.js) ``` var Module = { - onRuntimeInitialized: function () { + onConfigLoaded: () => { ... if (config.enable_profiler) diff --git a/src/mono/sample/wasm/browser-profile/Wasm.BrowserProfile.Sample.csproj b/src/mono/sample/wasm/browser-profile/Wasm.BrowserProfile.Sample.csproj index 9d14836ecb4f3a..be10935e8bc325 100644 --- a/src/mono/sample/wasm/browser-profile/Wasm.BrowserProfile.Sample.csproj +++ b/src/mono/sample/wasm/browser-profile/Wasm.BrowserProfile.Sample.csproj @@ -1,7 +1,7 @@ true - runtime.js + main.js aot; @@ -9,4 +9,6 @@ + + diff --git a/src/mono/sample/wasm/browser-profile/index.html b/src/mono/sample/wasm/browser-profile/index.html index de4a5599e94ad0..db4344793d2ee3 100644 --- a/src/mono/sample/wasm/browser-profile/index.html +++ b/src/mono/sample/wasm/browser-profile/index.html @@ -3,15 +3,15 @@ - TESTS + Profiler Sample - + Result from Sample.Test.TestMeaning: - + diff --git a/src/mono/sample/wasm/browser-profile/runtime.js b/src/mono/sample/wasm/browser-profile/main.js similarity index 66% rename from src/mono/sample/wasm/browser-profile/runtime.js rename to src/mono/sample/wasm/browser-profile/main.js index ebedaba70e29e2..4f9abe18afd65c 100644 --- a/src/mono/sample/wasm/browser-profile/runtime.js +++ b/src/mono/sample/wasm/browser-profile/main.js @@ -3,10 +3,8 @@ "use strict"; var Module = { - is_testing: false, - config: null, configSrc: "./mono-config.json", - onConfigLoaded: function () { + onConfigLoaded: () => { if (MONO.config.enable_profiler) { MONO.config.aot_profiler_options = { write_at: "Sample.Test::StopProfile", @@ -14,42 +12,37 @@ var Module = { } } }, - onDotNetReady: function () { + onDotNetReady: () => { try { Module.init(); } catch (error) { - test_exit(1); + set_exit_code(1, error); throw (error); } }, - onAbort: function (err) { - test_exit(1); + onAbort: (error) => { + set_exit_code(1, error); }, - init: function () { + init: () => { console.log("not ready yet") - const ret = INTERNAL.call_static_method("[Wasm.BrowserProfile.Sample] Sample.Test:TestMeaning", []); + const testMeaning = BINDING.bind_static_method("[Wasm.BrowserProfile.Sample] Sample.Test:TestMeaning"); + const stopProfile = BINDING.bind_static_method("[Wasm.BrowserProfile.Sample] Sample.Test:StopProfile"); + const ret = testMeaning(); document.getElementById("out").innerHTML = ret; console.log("ready"); - if (Module.is_testing) { - console.debug(`ret: ${ret}`); - let exit_code = ret == 42 ? 0 : 1; - Module.test_exit(exit_code); - } + console.debug(`ret: ${ret}`); + let exit_code = ret == 42 ? 0 : 1; + Module.set_exit_code(exit_code); if (MONO.config.enable_profiler) { - INTERNAL.call_static_method("[Wasm.BrowserProfile.Sample] Sample.Test:StopProfile", []); + stopProfile(); Module.saveProfile(); } }, - test_exit: function (exit_code) { - if (!Module.is_testing) { - console.log(`test_exit: ${exit_code}`); - return; - } - + set_exit_code: (exit_code, reason) => { /* Set result in a tests_done element, to be read by xharness */ const tests_done_elem = document.createElement("label"); tests_done_elem.id = "tests_done"; @@ -59,7 +52,7 @@ var Module = { console.log(`WASM EXIT ${exit_code}`); }, - saveProfile: function () { + saveProfile: () => { const a = document.createElement('a'); const blob = new Blob([INTERNAL.aot_profile_data]); a.href = URL.createObjectURL(blob); diff --git a/src/mono/sample/wasm/browser/Wasm.Browser.Sample.csproj b/src/mono/sample/wasm/browser/Wasm.Browser.Sample.csproj index 15386dece90a91..eb9934dc662ca6 100644 --- a/src/mono/sample/wasm/browser/Wasm.Browser.Sample.csproj +++ b/src/mono/sample/wasm/browser/Wasm.Browser.Sample.csproj @@ -2,7 +2,7 @@ Debug true - runtime.js + main.js true embedded 1 diff --git a/src/mono/sample/wasm/browser/index.html b/src/mono/sample/wasm/browser/index.html index cedcae5715afb0..2fa08c756cbf24 100644 --- a/src/mono/sample/wasm/browser/index.html +++ b/src/mono/sample/wasm/browser/index.html @@ -2,55 +2,42 @@ - - TESTS - - - - - - Result from Sample.Test.TestMeaning: - - + console.debug(`ret: ${ret}`); + let exit_code = ret == 42 ? 0 : 1; + set_exit_code(exit_code); + }, + }; + + + - + - \ No newline at end of file diff --git a/src/mono/sample/wasm/browser/runtime.js b/src/mono/sample/wasm/browser/main.js similarity index 71% rename from src/mono/sample/wasm/browser/runtime.js rename to src/mono/sample/wasm/browser/main.js index ef84c7108e8bf8..9e347d4d346cd5 100644 --- a/src/mono/sample/wasm/browser/runtime.js +++ b/src/mono/sample/wasm/browser/main.js @@ -2,19 +2,18 @@ // The .NET Foundation licenses this file to you under the MIT license. "use strict"; + var Module = { - config: null, configSrc: "./mono-config.json", - onDotNetReady: function () { + onDotNetReady: () => { try { App.init(); } catch (error) { - test_exit(1); + set_exit_code(1, error); throw (error); } }, - onAbort: function () { - test_exit(1); - + onAbort: (error) => { + set_exit_code(1, error); }, -}; +}; \ No newline at end of file diff --git a/src/mono/sample/wasm/console/Makefile b/src/mono/sample/wasm/console/Makefile index d68cd314be01af..20c9da20ad0be5 100644 --- a/src/mono/sample/wasm/console/Makefile +++ b/src/mono/sample/wasm/console/Makefile @@ -11,5 +11,6 @@ DOTNET_MONO_LOG_LEVEL=--setenv=MONO_LOG_LEVEL=debug endif PROJECT_NAME=Wasm.Console.Sample.csproj +CONSOLE_DLL=Wasm.Console.Sample.dll run: run-console diff --git a/src/mono/sample/wasm/console/Wasm.Console.Sample.csproj b/src/mono/sample/wasm/console/Wasm.Console.Sample.csproj index 7097ef20ab9bd6..1dabb4aa0c787f 100644 --- a/src/mono/sample/wasm/console/Wasm.Console.Sample.csproj +++ b/src/mono/sample/wasm/console/Wasm.Console.Sample.csproj @@ -1,12 +1,13 @@ true - $(MonoProjectRoot)\wasm\runtime-test.js + $(MonoProjectRoot)\wasm\test-main.js true <_SampleProject>Wasm.Console.Sample.csproj + <_SampleAssembly>Wasm.Console.Sample.dll diff --git a/src/mono/sample/wasm/wasm.mk b/src/mono/sample/wasm/wasm.mk index c9bbdd00a41d03..5a1c70133489f8 100644 --- a/src/mono/sample/wasm/wasm.mk +++ b/src/mono/sample/wasm/wasm.mk @@ -26,8 +26,8 @@ run-browser: echo "The tool dotnet-serve could not be found. Install with: $(DOTNET) tool install --global dotnet-serve"; \ exit 1; \ else \ - $(DOTNET) serve -d:bin/$(CONFIG)/AppBundle -p:8000; \ + $(DOTNET) serve -d:bin/$(CONFIG)/AppBundle -o -p:8000; \ fi run-console: - cd bin/$(CONFIG)/AppBundle && ~/.jsvu/v8 --stack-trace-limit=1000 --single-threaded --expose_wasm runtime.js -- $(DOTNET_MONO_LOG_LEVEL) --run Wasm.Console.Sample.dll + cd bin/$(CONFIG)/AppBundle && ~/.jsvu/v8 --stack-trace-limit=1000 --single-threaded --expose_wasm main.js -- $(DOTNET_MONO_LOG_LEVEL) --run $(CONSOLE_DLL) $(ARGS) diff --git a/src/mono/wasm/Makefile b/src/mono/wasm/Makefile index 960bcfaa892c5a..4152d959e50278 100644 --- a/src/mono/wasm/Makefile +++ b/src/mono/wasm/Makefile @@ -19,7 +19,7 @@ PINVOKE_TABLE?=$(TOP)/artifacts/obj/wasm/pinvoke-table.h MONO_BIN_DIR?=$(BINDIR)/mono/Browser.wasm.$(CONFIG) NATIVE_BIN_DIR?=$(BINDIR)/native/net7.0-Browser-$(CONFIG)-wasm ICU_LIBDIR?= -SYSTEM_NATIVE_LIBDIR?=$(TOP)/src/libraries/Native/Unix/System.Native +SYSTEM_NATIVE_LIBDIR?=$(TOP)/src/native/libs/System.Native _MSBUILD_WASM_BUILD_ARGS=/p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=$(CONFIG) XHARNESS_BROWSER?=chrome EMCC_DEFAULT_RSP=$(NATIVE_BIN_DIR)/src/emcc-default.rsp @@ -71,9 +71,6 @@ MONO_LIBS = \ $(ICU_LIBDIR)/libicuuc.a \ $(ICU_LIBDIR)/libicui18n.a -EMCC_DEBUG_FLAGS =-g -Os -s -DDEBUG=1 -EMCC_RELEASE_FLAGS=-Oz - ifeq ($(NOSTRIP),) STRIP_CMD=&& $(EMSDK_PATH)/upstream/bin/wasm-opt --strip-dwarf $(NATIVE_BIN_DIR)/dotnet.wasm -o $(NATIVE_BIN_DIR)/dotnet.wasm else @@ -84,11 +81,6 @@ endif # Wasm builds # -# $(1) - EMCC_FLAGS -# $(2) - libs -# $(3) - strip cmd -define WasmBuildTemplate - $(NATIVE_BIN_DIR): mkdir -p $$@ @@ -101,7 +93,7 @@ $(NATIVE_BIN_DIR)/include/wasm: $(BUILDS_OBJ_DIR): mkdir -p $$@ -$(NATIVE_BIN_DIR)/dotnet.js: runtime/driver.c runtime/pinvoke.c runtime/pinvoke.h runtime/corebindings.c $(NATIVE_BIN_DIR)/src/runtime.iffe.js runtime/library-dotnet.js $(SYSTEM_NATIVE_LIBDIR)/pal_random.js $(2) $(EMCC_DEFAULT_RSP) | $(NATIVE_BIN_DIR) +$(NATIVE_BIN_DIR)/dotnet.js: runtime/driver.c runtime/pinvoke.c runtime/pinvoke.h runtime/corebindings.c $(NATIVE_BIN_DIR)/src/runtime.iffe.js runtime/library-dotnet.js $(SYSTEM_NATIVE_LIBDIR)/pal_random.js $(MONO_LIBS) $(EMCC_DEFAULT_RSP) | $(NATIVE_BIN_DIR) $(DOTNET) build $(CURDIR)/wasm.proj $(_MSBUILD_WASM_BUILD_ARGS) /t:BuildWasmRuntimes $(MSBUILD_ARGS) $(EMCC_DEFAULT_RSP): $(CURDIR)/wasm.proj | $(NATIVE_BIN_DIR)/src Makefile @@ -112,14 +104,6 @@ $(NATIVE_BIN_DIR)/src/emcc-props.json: $(EMSDK_PATH)/upstream/.emsdk_version | $ build-native: $(NATIVE_BIN_DIR)/dotnet.js $(NATIVE_BIN_DIR)/src/emcc-default.rsp $(NATIVE_BIN_DIR)/src/emcc-props.json -endef - -ifeq ($(CONFIG),Debug) -$(eval $(call WasmBuildTemplate,$(EMCC_DEBUG_FLAGS),$(MONO_LIBS),)) -else -$(eval $(call WasmBuildTemplate,$(EMCC_RELEASE_FLAGS),$(MONO_LIBS),$(STRIP_CMD))) -endif - clean-emsdk: $(RM) -rf $(EMSDK_LOCAL_PATH) diff --git a/src/mono/wasm/README.md b/src/mono/wasm/README.md index c4ad2cf2edb793..b68aeb2d54c99a 100644 --- a/src/mono/wasm/README.md +++ b/src/mono/wasm/README.md @@ -2,7 +2,7 @@ This depends on `emsdk` to be installed. -## emsdk on mac +## emsdk on macOS * You can run `make provision-wasm`, which will install it to `$reporoot/src/mono/wasm/emsdk` . Note: Irrespective of `$(EMSDK_PATH)`'s value, `provision-wasm` will always install into `$reporoot/src/mono/wasm/emsdk`. @@ -17,13 +17,7 @@ Do not install `latest` but rather specific version e.g. `./emsdk install 2.0.23 Make sure to set `EMSDK_PATH` variable, whenever building, or running tests for wasm. -### Windows dependencies - -Windows build [requirements](https://github.com/dotnet/runtime/blob/main/docs/workflow/requirements/windows-requirements.md) - -If `EMSDK_PATH` is not set, the `emsdk` should be provisioned automatically during the build. - -## Building on mac +## Building on macOS * To build the whole thing, with libraries: @@ -33,9 +27,17 @@ If `EMSDK_PATH` is not set, the `emsdk` should be provisioned automatically duri `make runtime` -### Note: Additional msbuild arguments can be passed with: `make build-all MSBUILD_ARGS="/p:a=b"` +**Note:** Additional msbuild arguments can be passed with: `make build-all MSBUILD_ARGS="/p:a=b"` + +## emsdk on Windows -### Bulding on windows +Windows build [requirements](https://github.com/dotnet/runtime/blob/main/docs/workflow/requirements/windows-requirements.md) + +If `EMSDK_PATH` is not set, the `emsdk` should be provisioned automatically during the build. + +**Note:** The EMSDK has an implicit dependency on Python for it to be initialized. A consequence of this is that if the system doesn't have Python installed prior to attempting a build, the automatic provisioning will fail and be in an invalid state. Therefore, if Python needs to be installed after a build attempt the `$reporoot/src/mono/wasm/emsdk` directory should be manually deleted and then a rebuild attempted. + +## Bulding on Windows * To build everything @@ -47,7 +49,7 @@ If `EMSDK_PATH` is not set, the `emsdk` should be provisioned automatically duri The latest engines can be installed with jsvu (JavaScript engine Version Updater https://github.com/GoogleChromeLabs/jsvu) -### Mac +### macOS * Install npm with brew: @@ -83,7 +85,7 @@ Add `~/.jsvu` to your `PATH`: Library tests can be run with js engines: `v8`, `SpiderMonkey`,or `JavaScriptCore`: -### Mac +### macOS * `v8`: `make run-tests-v8-$(lib_name)` * SpiderMonkey: `make run-tests-sm-$(lib_name)` @@ -105,7 +107,7 @@ Examples of running tests for individual libraries: `.\dotnet.cmd build /t:Test /p:TargetOS=Browser src\libraries\System.Collections.Concurrent\tests` `.\dotnet.cmd build /t:Test /p:TargetOS=Browser /p:JSEngine="SpiderMonkey" src\libraries\System.Text.Json\tests` -### Browser tests on mac +### Browser tests on macOS Or they can be run with a browser (Chrome): @@ -125,9 +127,9 @@ The wrapper script used to actually run these tests, accepts: * set `XHARNESS_CLI_PATH=/path/to/xharness/artifacts/bin/Microsoft.DotNet.XHarness.CLI/Debug/netcoreapp3.1/Microsoft.DotNet.XHarness.CLI.dll` -### Note: Additional msbuild arguments can be passed with: `make .. MSBUILD_ARGS="/p:a=b"` +**Note:** Additional msbuild arguments can be passed with: `make .. MSBUILD_ARGS="/p:a=b"` -## Debugger tests on mac +## Debugger tests on macOS Debugger tests need `Google Chrome` to be installed. @@ -155,6 +157,10 @@ The samples in `src/mono/sample/wasm` can be build and run like this: To build and run the samples with AOT, add `/p:RunAOTCompilation=true` to the above command lines. +* bench sample + +Also check [bench](../sample/wasm/browser-bench/README.md) sample to measure mono/wasm runtime performance. + ### Upgrading Emscripten Bumping Emscripten version involves these steps: @@ -169,4 +175,4 @@ Bumping Emscripten version involves these steps: ## Code style * Is enforced via [eslint](https://eslint.org/) and rules are in `./.eslintrc.js` * You could check the style by running `npm run lint` in `src/mono/wasm/runtime` directory -* You can install [plugin into your VS Code](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) to show you the errors as you type \ No newline at end of file +* You can install [plugin into your VS Code](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) to show you the errors as you type diff --git a/src/mono/wasm/build/README.md b/src/mono/wasm/build/README.md index 8d4920a7be5328..79b9ef30f46dd5 100644 --- a/src/mono/wasm/build/README.md +++ b/src/mono/wasm/build/README.md @@ -10,9 +10,9 @@ Wasm app build can run in two scenarios: A dotnet wasm app has some native wasm files (`dotnet.wasm`, and `dotnet.js`). How these files are obtained, or generated: 1. Build - a. with no native libraries referenced (AOT setting is ignored here) + - a. with no native libraries referenced (AOT setting is ignored here) - files from the runtime pack are used as-is - b. with native libraries referenced + - b. with native libraries referenced - dotnet.wasm is relinked with the native libraries 2. Publish - dotnet.wasm is relinked with the native libraries, and updated pinvoke/icalls from the trimmed assemblies diff --git a/src/mono/wasm/build/WasmApp.Native.targets b/src/mono/wasm/build/WasmApp.Native.targets index 8476977afef425..bfac812dadd9b1 100644 --- a/src/mono/wasm/build/WasmApp.Native.targets +++ b/src/mono/wasm/build/WasmApp.Native.targets @@ -7,7 +7,6 @@ <_WasmBuildNativeCoreDependsOn> - _CheckEmccIsExpectedVersion; _PrepareForWasmBuildNative; _GenerateDriverGenC; _GeneratePInvokeTable; @@ -224,8 +223,11 @@ <_WasmRuntimePackSrcFile ObjectFile="$(_WasmIntermediateOutputPath)%(FileName).o" /> <_DotnetJSSrcFile Include="$(_WasmRuntimePackSrcDir)\*.js" Exclude="$(_WasmRuntimePackSrcDir)\*.iffe.js"/> - <_WasmExtraJSFile Include="$(_WasmRuntimePackSrcDir)\*.iffe.js" Kind="pre-js" /> + <_WasmExtraJSFile Include="$(_WasmRuntimePackSrcDir)\*.iffe.js" Kind="extern-pre-js" /> <_WasmNativeFileForLinking Include="@(NativeFileReference)" /> + + + @@ -260,14 +262,17 @@ - - + OutputPath="$(_WasmICallTablePath)" /> + + + + + - + <_EmBuilder Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">embuilder.bat <_EmBuilder Condition="!$([MSBuild]::IsOSPlatform('WINDOWS'))">embuilder.py @@ -304,7 +309,7 @@ Inputs="@(_BitcodeFile);$(_EmccDefaultFlagsRsp);$(_EmccCompileBitcodeRsp)" Outputs="@(_BitcodeFile->'%(ObjectFile)')" Condition="'$(_WasmShouldAOT)' == 'true' and @(_BitcodeFile->Count()) > 0" - DependsOnTargets="_WasmWriteRspForCompilingBitcode" + DependsOnTargets="_CheckEmccIsExpectedVersion;_WasmWriteRspForCompilingBitcode" Returns="@(FileWrites)"> @@ -351,8 +356,9 @@ <_EmccLinkStepArgs Include="--js-library "%(_WasmExtraJSFile.Identity)"" Condition="'%(_WasmExtraJSFile.Kind)' == 'js-library'" /> <_EmccLinkStepArgs Include="--pre-js "%(_WasmExtraJSFile.Identity)"" Condition="'%(_WasmExtraJSFile.Kind)' == 'pre-js'" /> + <_EmccLinkStepArgs Include="--extern-pre-js "%(_WasmExtraJSFile.Identity)"" Condition="'%(_WasmExtraJSFile.Kind)' == 'extern-pre-js'" /> <_EmccLinkStepArgs Include="--post-js "%(_WasmExtraJSFile.Identity)"" Condition="'%(_WasmExtraJSFile.Kind)' == 'post-js'" /> - <_WasmLinkDependencies Include="@(_WasmExtraJSFile)" Condition="'%(_WasmExtraJSFile.Kind)' == 'js-library' or '%(_WasmExtraJSFile.Kind)' == 'pre-js' or '%(_WasmExtraJSFile.Kind)' == 'post-js'" /> + <_WasmLinkDependencies Include="@(_WasmExtraJSFile)" Condition="'%(_WasmExtraJSFile.Kind)' == 'js-library' or '%(_WasmExtraJSFile.Kind)' == 'pre-js' or '%(_WasmExtraJSFile.Kind)' == 'post-js' or '%(_WasmExtraJSFile.Kind)' == 'extern-post-js'" /> <_EmccLinkStepArgs Include=""%(_WasmNativeFileForLinking.Identity)"" /> <_WasmLinkDependencies Include="@(_WasmNativeFileForLinking)" /> @@ -372,7 +378,7 @@ @@ -427,10 +433,24 @@ EMSCRIPTEN_KEEPALIVE void mono_wasm_load_profiler_aot (const char *desc) { mono_ - + + <_EmccVersionCommand>emcc --version + + + + + + + diff --git a/src/mono/wasm/build/WasmApp.targets b/src/mono/wasm/build/WasmApp.targets index 9c96d759a228a1..4bcaac94f329d8 100644 --- a/src/mono/wasm/build/WasmApp.targets +++ b/src/mono/wasm/build/WasmApp.targets @@ -180,6 +180,7 @@ <_WasmShouldAOT Condition="'$(_WasmShouldAOT)' == ''">false + @@ -299,7 +300,7 @@ diff --git a/src/mono/wasm/data/aot-tests/ProxyProjectForAOTOnHelix.proj b/src/mono/wasm/data/aot-tests/ProxyProjectForAOTOnHelix.proj index 65a0df19fb640c..51dcde0db6c09e 100644 --- a/src/mono/wasm/data/aot-tests/ProxyProjectForAOTOnHelix.proj +++ b/src/mono/wasm/data/aot-tests/ProxyProjectForAOTOnHelix.proj @@ -29,7 +29,7 @@ $(TestRootDir)AppBundle\ $(OriginalPublishDir)WasmTestRunner.dll - $(OriginalPublishDir)runtime-test.js + $(OriginalPublishDir)test-main.js true diff --git a/src/mono/wasm/debugger/BrowserDebugHost/Startup.cs b/src/mono/wasm/debugger/BrowserDebugHost/Startup.cs index c4de27f4ee9f6f..f5dc5ecca471b9 100644 --- a/src/mono/wasm/debugger/BrowserDebugHost/Startup.cs +++ b/src/mono/wasm/debugger/BrowserDebugHost/Startup.cs @@ -151,6 +151,12 @@ async Task ConnectProxy(HttpContext context) } var endpoint = new Uri($"ws://{devToolsHost.Authority}{context.Request.Path}"); + int runtimeId = 0; + if (context.Request.Query.TryGetValue("RuntimeId", out StringValues runtimeIdValue) && + int.TryParse(runtimeIdValue.FirstOrDefault(), out int parsedId)) + { + runtimeId = parsedId; + } try { using ILoggerFactory loggerFactory = LoggerFactory.Create(builder => @@ -159,7 +165,7 @@ async Task ConnectProxy(HttpContext context) ); context.Request.Query.TryGetValue("urlSymbolServer", out StringValues urlSymbolServerList); - var proxy = new DebuggerProxy(loggerFactory, urlSymbolServerList.ToList()); + var proxy = new DebuggerProxy(loggerFactory, urlSymbolServerList.ToList(), runtimeId); System.Net.WebSockets.WebSocket ideSocket = await context.WebSockets.AcceptWebSocketAsync(); diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/BrowserDebugProxy.csproj b/src/mono/wasm/debugger/BrowserDebugProxy/BrowserDebugProxy.csproj index 169856bc091234..0c5d37b7afe9a9 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/BrowserDebugProxy.csproj +++ b/src/mono/wasm/debugger/BrowserDebugProxy/BrowserDebugProxy.csproj @@ -7,6 +7,7 @@ + diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs b/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs index 8579898faf715d..148fd03d37c84e 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs @@ -157,9 +157,9 @@ public VarInfo(Parameter p, MetadataReader pdbReader) public override string ToString() => $"(var-info [{Index}] '{Name}')"; } - internal class NewCliLocation + internal class IlLocation { - public NewCliLocation(MethodInfo method, int offset) + public IlLocation(MethodInfo method, int offset) { Method = method; Offset = offset; @@ -174,7 +174,7 @@ internal class SourceLocation private SourceId id; private int line; private int column; - private NewCliLocation cliLoc; + private IlLocation ilLocation; public SourceLocation(SourceId id, int line, int column) { @@ -188,13 +188,13 @@ public SourceLocation(MethodInfo mi, SequencePoint sp) this.id = mi.SourceId; this.line = sp.StartLine - 1; this.column = sp.StartColumn - 1; - this.cliLoc = new NewCliLocation(mi, sp.Offset); + this.ilLocation = new IlLocation(mi, sp.Offset); } public SourceId Id { get => id; } public int Line { get => line; } public int Column { get => column; } - public NewCliLocation CliLocation => this.cliLoc; + public IlLocation IlLocation => this.ilLocation; public override string ToString() => $"{id}:{Line}:{Column}"; @@ -331,6 +331,8 @@ internal class MethodInfo public bool IsStatic() => (methodDef.Attributes & MethodAttributes.Static) != 0; public int IsAsync { get; set; } public bool IsHiddenFromDebugger { get; } + public TypeInfo TypeInfo { get; } + public MethodInfo(AssemblyInfo assembly, MethodDefinitionHandle methodDefHandle, int token, SourceFile source, TypeInfo type, MetadataReader asmMetadataReader, MetadataReader pdbMetadataReader) { this.IsAsync = -1; @@ -343,6 +345,7 @@ public MethodInfo(AssemblyInfo assembly, MethodDefinitionHandle methodDefHandle, this.Name = asmMetadataReader.GetString(methodDef.Name); this.pdbMetadataReader = pdbMetadataReader; this.IsEnCMethod = false; + this.TypeInfo = type; if (!DebugInformation.SequencePointsBlob.IsNil) { var sps = DebugInformation.GetSequencePoints(); @@ -373,7 +376,11 @@ public MethodInfo(AssemblyInfo assembly, MethodDefinitionHandle methodDefHandle, var container = asmMetadataReader.GetMemberReference((MemberReferenceHandle)ctorHandle).Parent; var name = asmMetadataReader.GetString(asmMetadataReader.GetTypeReference((TypeReferenceHandle)container).Name); if (name == "DebuggerHiddenAttribute") + { this.IsHiddenFromDebugger = true; + break; + } + } } } @@ -471,6 +478,7 @@ internal class TypeInfo private TypeDefinition type; private List methods; internal int Token { get; } + internal string Namespace { get; } public TypeInfo(AssemblyInfo assembly, TypeDefinitionHandle typeHandle, TypeDefinition type) { @@ -480,21 +488,17 @@ public TypeInfo(AssemblyInfo assembly, TypeDefinitionHandle typeHandle, TypeDefi this.type = type; methods = new List(); Name = metadataReader.GetString(type.Name); - var namespaceName = ""; - if (type.IsNested) + var declaringType = type; + while (declaringType.IsNested) { - var declaringType = metadataReader.GetTypeDefinition(type.GetDeclaringType()); - Name = metadataReader.GetString(declaringType.Name) + "/" + Name; - namespaceName = metadataReader.GetString(declaringType.Namespace); + declaringType = metadataReader.GetTypeDefinition(declaringType.GetDeclaringType()); + Name = metadataReader.GetString(declaringType.Name) + "." + Name; } + Namespace = metadataReader.GetString(declaringType.Namespace); + if (Namespace.Length > 0) + FullName = Namespace + "." + Name; else - { - namespaceName = metadataReader.GetString(type.Namespace); - } - - if (namespaceName.Length > 0) - namespaceName += "."; - FullName = namespaceName + Name; + FullName = Name; } public TypeInfo(AssemblyInfo assembly, string name) @@ -919,7 +923,7 @@ private class DebugItem public Task Data { get; set; } } - public IEnumerable EnC(SessionId sessionId, AssemblyInfo asm, byte[] meta_data, byte[] pdb_data) + public IEnumerable EnC(AssemblyInfo asm, byte[] meta_data, byte[] pdb_data) { asm.EnC(meta_data, pdb_data); foreach (var method in asm.Methods) @@ -929,12 +933,12 @@ public IEnumerable EnC(SessionId sessionId, AssemblyInfo asm, byte[] } } - public IEnumerable Add(SessionId sessionId, byte[] assembly_data, byte[] pdb_data) + public IEnumerable Add(string name, byte[] assembly_data, byte[] pdb_data) { AssemblyInfo assembly = null; try { - assembly = new AssemblyInfo(sessionId.ToString(), assembly_data, pdb_data); + assembly = new AssemblyInfo(name, assembly_data, pdb_data); } catch (Exception e) { @@ -958,7 +962,7 @@ public IEnumerable Add(SessionId sessionId, byte[] assembly_data, by } } - public async IAsyncEnumerable Load(SessionId sessionId, string[] loaded_files, [EnumeratorCancellation] CancellationToken token) + public async IAsyncEnumerable Load(string[] loaded_files, [EnumeratorCancellation] CancellationToken token) { var asm_files = new List(); var pdb_files = new List(); diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/DebuggerProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/DebuggerProxy.cs index 197f4dd6cea5db..4c030d98fe6939 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/DebuggerProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/DebuggerProxy.cs @@ -17,9 +17,9 @@ public class DebuggerProxy { private readonly MonoProxy proxy; - public DebuggerProxy(ILoggerFactory loggerFactory, IList urlSymbolServerList) + public DebuggerProxy(ILoggerFactory loggerFactory, IList urlSymbolServerList, int runtimeId = 0) { - proxy = new MonoProxy(loggerFactory, urlSymbolServerList); + proxy = new MonoProxy(loggerFactory, urlSymbolServerList, runtimeId); } public Task Run(Uri browserUri, WebSocket ideSocket) diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs b/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs index 97acfe9517d4ee..ee7def9514c54c 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs @@ -172,31 +172,31 @@ internal class MonoCommands public MonoCommands(string expression) => this.expression = expression; - public static MonoCommands GetDebuggerAgentBufferReceived() => new MonoCommands("INTERNAL.mono_wasm_get_dbg_command_info()"); + public static MonoCommands GetDebuggerAgentBufferReceived(int runtimeId) => new MonoCommands($"getDotnetRuntime({runtimeId}).INTERNAL.mono_wasm_get_dbg_command_info()"); - public static MonoCommands IsRuntimeReady() => new MonoCommands("INTERNAL.mono_wasm_runtime_is_ready"); + public static MonoCommands IsRuntimeReady(int runtimeId) => new MonoCommands($"getDotnetRuntime({runtimeId}).INTERNAL.mono_wasm_runtime_is_ready"); - public static MonoCommands GetLoadedFiles() => new MonoCommands("INTERNAL.mono_wasm_get_loaded_files()"); + public static MonoCommands GetLoadedFiles(int runtimeId) => new MonoCommands($"getDotnetRuntime({runtimeId}).INTERNAL.mono_wasm_get_loaded_files()"); - public static MonoCommands SendDebuggerAgentCommand(int id, int command_set, int command, string command_parameters) + public static MonoCommands SendDebuggerAgentCommand(int runtimeId, int id, int command_set, int command, string command_parameters) { - return new MonoCommands($"INTERNAL.mono_wasm_send_dbg_command ({id}, {command_set}, {command},'{command_parameters}')"); + return new MonoCommands($"getDotnetRuntime({runtimeId}).INTERNAL.mono_wasm_send_dbg_command ({id}, {command_set}, {command},'{command_parameters}')"); } - public static MonoCommands SendDebuggerAgentCommandWithParms(int id, int command_set, int command, string command_parameters, int len, int type, string parm) + public static MonoCommands SendDebuggerAgentCommandWithParms(int runtimeId, int id, int command_set, int command, string command_parameters, int len, int type, string parm) { - return new MonoCommands($"INTERNAL.mono_wasm_send_dbg_command_with_parms ({id}, {command_set}, {command},'{command_parameters}', {len}, {type}, '{parm}')"); + return new MonoCommands($"getDotnetRuntime({runtimeId}).INTERNAL.mono_wasm_send_dbg_command_with_parms ({id}, {command_set}, {command},'{command_parameters}', {len}, {type}, '{parm}')"); } - public static MonoCommands CallFunctionOn(JToken args) => new MonoCommands($"INTERNAL.mono_wasm_call_function_on ({args})"); + public static MonoCommands CallFunctionOn(int runtimeId, JToken args) => new MonoCommands($"getDotnetRuntime({runtimeId}).INTERNAL.mono_wasm_call_function_on ({args})"); - public static MonoCommands GetDetails(int objectId, JToken args = null) => new MonoCommands($"INTERNAL.mono_wasm_get_details ({objectId}, {(args ?? "{ }")})"); + public static MonoCommands GetDetails(int runtimeId, int objectId, JToken args = null) => new MonoCommands($"getDotnetRuntime({runtimeId}).INTERNAL.mono_wasm_get_details ({objectId}, {(args ?? "{ }")})"); - public static MonoCommands Resume() => new MonoCommands($"INTERNAL.mono_wasm_debugger_resume ()"); + public static MonoCommands Resume(int runtimeId) => new MonoCommands($"getDotnetRuntime({runtimeId}).INTERNAL.mono_wasm_debugger_resume ()"); - public static MonoCommands DetachDebugger() => new MonoCommands($"INTERNAL.mono_wasm_detach_debugger()"); + public static MonoCommands DetachDebugger(int runtimeId) => new MonoCommands($"getDotnetRuntime({runtimeId}).INTERNAL.mono_wasm_detach_debugger()"); - public static MonoCommands ReleaseObject(DotnetObjectId objectId) => new MonoCommands($"INTERNAL.mono_wasm_release_object('{objectId}')"); + public static MonoCommands ReleaseObject(int runtimeId, DotnetObjectId objectId) => new MonoCommands($"getDotnetRuntime({runtimeId}).INTERNAL.mono_wasm_release_object('{objectId}')"); } internal enum MonoErrorCodes @@ -275,12 +275,19 @@ internal enum PauseOnExceptionsKind internal class ExecutionContext { + public ExecutionContext(MonoSDBHelper sdbAgent, int id, object auxData) + { + Id = id; + AuxData = auxData; + SdbAgent = sdbAgent; + } + public string DebugId { get; set; } public Dictionary BreakpointRequests { get; } = new Dictionary(); public TaskCompletionSource ready; public bool IsRuntimeReady => ready != null && ready.Task.IsCompleted; - + public bool IsSkippingHiddenMethod { get; set; } public int ThreadId { get; set; } public int Id { get; set; } public object AuxData { get; set; } @@ -291,6 +298,7 @@ internal class ExecutionContext public string[] LoadedFiles { get; set; } internal DebugStore store; + internal MonoSDBHelper SdbAgent { get; init; } public TaskCompletionSource Source { get; } = new TaskCompletionSource(); private Dictionary perScopeCaches { get; } = new Dictionary(); @@ -319,6 +327,7 @@ public PerScopeCache GetCacheForScope(int scopeId) public void ClearState() { CallStack = null; + SdbAgent.ClearCache(); perScopeCaches.Clear(); } } diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/EvaluateExpression.cs b/src/mono/wasm/debugger/BrowserDebugProxy/EvaluateExpression.cs index 6d1367fd209a11..6e52ae37c528e8 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/EvaluateExpression.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/EvaluateExpression.cs @@ -12,17 +12,28 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Scripting; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Emit; +using Microsoft.CodeAnalysis.Scripting; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using System.Text.RegularExpressions; namespace Microsoft.WebAssembly.Diagnostics { internal static class EvaluateExpression { + internal static Script script = CSharpScript.Create( + "", + ScriptOptions.Default.WithReferences( + typeof(object).Assembly, + typeof(Enumerable).Assembly, + typeof(JObject).Assembly + )); private class FindVariableNMethodCall : CSharpSyntaxWalker { + private static Regex regexForReplaceVarName = new Regex(@"[^A-Za-z0-9_]", RegexOptions.Singleline); public List identifiers = new List(); public List methodCall = new List(); public List memberAccesses = new List(); @@ -32,6 +43,7 @@ private class FindVariableNMethodCall : CSharpSyntaxWalker private int visitCount; public bool hasMethodCalls; public bool hasElementAccesses; + internal List variableDefinitions = new List(); public void VisitInternal(SyntaxNode node) { @@ -97,7 +109,7 @@ public SyntaxTree ReplaceVars(SyntaxTree syntaxTree, IEnumerable ma_val { // Generate a random suffix string suffix = Guid.NewGuid().ToString().Substring(0, 5); - string prefix = ma_str.Trim().Replace(".", "_"); + string prefix = regexForReplaceVarName.Replace(ma_str, "_"); id_name = $"{prefix}_{suffix}"; memberAccessToParamName[ma_str] = id_name; @@ -114,7 +126,7 @@ public SyntaxTree ReplaceVars(SyntaxTree syntaxTree, IEnumerable ma_val { // Generate a random suffix string suffix = Guid.NewGuid().ToString().Substring(0, 5); - string prefix = iesStr.Trim().Replace(".", "_").Replace("(", "_").Replace(")", "_"); + string prefix = regexForReplaceVarName.Replace(iesStr, "_"); id_name = $"{prefix}_{suffix}"; methodCallToParamName[iesStr] = id_name; } @@ -138,7 +150,7 @@ public SyntaxTree ReplaceVars(SyntaxTree syntaxTree, IEnumerable ma_val return SyntaxFactory.IdentifierName(id_name); }); - var paramsSet = new HashSet(); + var localsSet = new HashSet(); // 2. For every unique member ref, add a corresponding method param if (ma_values != null) @@ -151,7 +163,7 @@ public SyntaxTree ReplaceVars(SyntaxTree syntaxTree, IEnumerable ma_val throw new Exception($"BUG: Expected to find an id name for the member access string: {node_str}"); } memberAccessValues[id_name] = value; - root = UpdateWithNewMethodParam(root, id_name, value); + AddLocalVariableWithValue(id_name, value); } } @@ -159,7 +171,7 @@ public SyntaxTree ReplaceVars(SyntaxTree syntaxTree, IEnumerable ma_val { foreach ((IdentifierNameSyntax idns, JObject value) in identifiers.Zip(id_values)) { - root = UpdateWithNewMethodParam(root, idns.Identifier.Text, value); + AddLocalVariableWithValue(idns.Identifier.Text, value); } } @@ -172,7 +184,7 @@ public SyntaxTree ReplaceVars(SyntaxTree syntaxTree, IEnumerable ma_val { throw new Exception($"BUG: Expected to find an id name for the member access string: {node_str}"); } - root = UpdateWithNewMethodParam(root, id_name, value); + AddLocalVariableWithValue(id_name, value); } } @@ -185,96 +197,73 @@ public SyntaxTree ReplaceVars(SyntaxTree syntaxTree, IEnumerable ma_val { throw new Exception($"BUG: Expected to find an id name for the element access string: {node_str}"); } - root = UpdateWithNewMethodParam(root, id_name, value); + AddLocalVariableWithValue(id_name, value); } } return syntaxTree.WithRootAndOptions(root, syntaxTree.Options); - CompilationUnitSyntax UpdateWithNewMethodParam(CompilationUnitSyntax root, string id_name, JObject value) + void AddLocalVariableWithValue(string idName, JObject value) { - var classDeclaration = root.Members.ElementAt(0) as ClassDeclarationSyntax; - var method = classDeclaration.Members.ElementAt(0) as MethodDeclarationSyntax; - - if (paramsSet.Contains(id_name)) - { - // repeated member access expression - // eg. this.a + this.a - return root; - } - - argValues.Add(ConvertJSToCSharpType(value)); - - MethodDeclarationSyntax updatedMethod = method.AddParameterListParameters( - SyntaxFactory.Parameter( - SyntaxFactory.Identifier(id_name)) - .WithType(SyntaxFactory.ParseTypeName(GetTypeFullName(value)))); - - paramsSet.Add(id_name); - root = root.ReplaceNode(method, updatedMethod); - - return root; + if (localsSet.Contains(idName)) + return; + localsSet.Add(idName); + variableDefinitions.Add(ConvertJSToCSharpLocalVariableAssignment(idName, value)); } } - private object ConvertJSToCSharpType(JToken variable) + private string ConvertJSToCSharpLocalVariableAssignment(string idName, JToken variable) { + string typeRet; + object valueRet; JToken value = variable["value"]; string type = variable["type"].Value(); string subType = variable["subtype"]?.Value(); - + string objectId = variable["objectId"]?.Value(); switch (type) { case "string": - return value?.Value(); + { + var str = value?.Value(); + str = str.Replace("\"", "\\\""); + valueRet = $"\"{str}\""; + typeRet = "string"; + break; + } case "number": - return value?.Value(); + valueRet = value?.Value(); + typeRet = "double"; + break; case "boolean": - return value?.Value(); + valueRet = value?.Value().ToLower(); + typeRet = "bool"; + break; case "object": - return variable; + valueRet = "Newtonsoft.Json.Linq.JObject.FromObject(new {" + + $"type = \"{type}\"" + + $", description = \"{variable["description"].Value()}\"" + + $", className = \"{variable["className"].Value()}\"" + + (subType != null ? $", subtype = \"{subType}\"" : "") + + (objectId != null ? $", objectId = \"{objectId}\"" : "") + + "})"; + typeRet = "object"; + break; case "void": - return null; - } - throw new Exception($"Evaluate of this datatype {type} not implemented yet");//, "Unsupported"); - } - - private string GetTypeFullName(JToken variable) - { - string type = variable["type"].ToString(); - string subType = variable["subtype"]?.Value(); - object value = ConvertJSToCSharpType(variable); - - switch (type) - { - case "object": - { - if (subType == "null") - return variable["className"].Value(); - else - return "object"; - } - case "void": - return "object"; + valueRet = "Newtonsoft.Json.Linq.JObject.FromObject(new {" + + $"type = \"object\"," + + $"description = \"object\"," + + $"className = \"object\"," + + $"subtype = \"null\"" + + "})"; + typeRet = "object"; + break; default: - return value.GetType().FullName; + throw new Exception($"Evaluate of this datatype {type} not implemented yet");//, "Unsupported"); } - throw new ReturnAsErrorException($"GetTypefullName: Evaluate of this datatype {type} not implemented yet", "Unsupported"); + return $"{typeRet} {idName} = {valueRet};"; } } - private static SyntaxNode GetExpressionFromSyntaxTree(SyntaxTree syntaxTree) - { - CompilationUnitSyntax root = syntaxTree.GetCompilationUnitRoot(); - ClassDeclarationSyntax classDeclaration = root.Members.ElementAt(0) as ClassDeclarationSyntax; - MethodDeclarationSyntax methodDeclaration = classDeclaration.Members.ElementAt(0) as MethodDeclarationSyntax; - BlockSyntax blockValue = methodDeclaration.Body; - ReturnStatementSyntax returnValue = blockValue.Statements.ElementAt(0) as ReturnStatementSyntax; - ParenthesizedExpressionSyntax expressionParenthesized = returnValue.Expression as ParenthesizedExpressionSyntax; - - return expressionParenthesized?.Expression; - } - private static async Task> ResolveMemberAccessExpressions(IEnumerable member_accesses, MemberReferenceResolver resolver, CancellationToken token) { @@ -335,32 +324,20 @@ private static async Task> ResolveElementAccess(IEnumerable CompileAndRunTheExpression(string expression, MemberReferenceResolver resolver, CancellationToken token) { expression = expression.Trim(); if (!expression.StartsWith('(')) { - expression = "(" + expression + ")"; + expression = "(" + expression + "\n)"; } - SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(@" - using System; - public class CompileAndRunTheExpression - { - public static object Evaluate() - { - return " + expression + @"; - } - }", cancellationToken: token); + SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(expression + @";", cancellationToken: token); - SyntaxNode expressionTree = GetExpressionFromSyntaxTree(syntaxTree); + SyntaxNode expressionTree = syntaxTree.GetCompilationUnitRoot(token); if (expressionTree == null) throw new Exception($"BUG: Unable to evaluate {expression}, could not get expression from the syntax tree"); - FindVariableNMethodCall findVarNMethodCall = new FindVariableNMethodCall(); findVarNMethodCall.VisitInternal(expressionTree); - // this fails with `"a)"` // because the code becomes: return (a)); // and the returned expression from GetExpressionFromSyntaxTree is `a`! @@ -388,7 +365,7 @@ public static object Evaluate() if (findVarNMethodCall.hasMethodCalls) { - expressionTree = GetExpressionFromSyntaxTree(syntaxTree); + expressionTree = syntaxTree.GetCompilationUnitRoot(token); findVarNMethodCall.VisitInternal(expressionTree); @@ -400,7 +377,7 @@ public static object Evaluate() // eg. "elements[0]" if (findVarNMethodCall.hasElementAccesses) { - expressionTree = GetExpressionFromSyntaxTree(syntaxTree); + expressionTree = syntaxTree.GetCompilationUnitRoot(token); findVarNMethodCall.VisitInternal(expressionTree); @@ -409,48 +386,21 @@ public static object Evaluate() syntaxTree = findVarNMethodCall.ReplaceVars(syntaxTree, null, null, null, elementAccessValues); } - expressionTree = GetExpressionFromSyntaxTree(syntaxTree); + expressionTree = syntaxTree.GetCompilationUnitRoot(token); if (expressionTree == null) throw new Exception($"BUG: Unable to evaluate {expression}, could not get expression from the syntax tree"); - MetadataReference[] references = new MetadataReference[] - { - MetadataReference.CreateFromFile(typeof(object).Assembly.Location), - MetadataReference.CreateFromFile(typeof(Enumerable).Assembly.Location) - }; - - CSharpCompilation compilation = CSharpCompilation.Create( - "compileAndRunTheExpression", - syntaxTrees: new[] { syntaxTree }, - references: references, - options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); + try { + var newScript = script.ContinueWith( + string.Join("\n", findVarNMethodCall.variableDefinitions) + "\nreturn " + syntaxTree.ToString()); - SemanticModel semanticModel = compilation.GetSemanticModel(syntaxTree); - CodeAnalysis.TypeInfo TypeInfo = semanticModel.GetTypeInfo(expressionTree, cancellationToken: token); + var state = await newScript.RunAsync(cancellationToken: token); - using (var ms = new MemoryStream()) + return JObject.FromObject(ConvertCSharpToJSType(state.ReturnValue, state.ReturnValue.GetType())); + } + catch (Exception) { - EmitResult result = compilation.Emit(ms, cancellationToken: token); - if (!result.Success) - { - var sb = new StringBuilder(); - foreach (Diagnostic d in result.Diagnostics) - sb.Append(d.ToString()); - - throw new ReturnAsErrorException(sb.ToString(), "CompilationError"); - } - - ms.Seek(0, SeekOrigin.Begin); - Assembly assembly = Assembly.Load(ms.ToArray()); - Type type = assembly.GetType("CompileAndRunTheExpression"); - - object ret = type.InvokeMember("Evaluate", - BindingFlags.InvokeMethod | BindingFlags.Static | BindingFlags.Public, - null, - null, - findVarNMethodCall.argValues.ToArray()); - - return JObject.FromObject(ConvertCSharpToJSType(ret, TypeInfo.Type)); + throw new ReturnAsErrorException($"Cannot evaluate '{expression}'.", "CompilationError"); } } @@ -462,7 +412,7 @@ public static object Evaluate() typeof(float), typeof(double) }; - private static object ConvertCSharpToJSType(object v, ITypeSymbol type) + private static object ConvertCSharpToJSType(object v, Type type) { if (v == null) return new { type = "object", subtype = "null", className = type.ToString(), description = type.ToString() }; diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MemberReferenceResolver.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MemberReferenceResolver.cs index 5c7b4d3d1405f0..4415db53b2ec20 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MemberReferenceResolver.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MemberReferenceResolver.cs @@ -6,7 +6,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; -using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System.IO; using Microsoft.CodeAnalysis.CSharp.Syntax; @@ -19,22 +18,20 @@ internal class MemberReferenceResolver private SessionId sessionId; private int scopeId; private MonoProxy proxy; - private ExecutionContext ctx; + private ExecutionContext context; private PerScopeCache scopeCache; private ILogger logger; private bool localsFetched; private int linqTypeId; - private MonoSDBHelper sdbHelper; public MemberReferenceResolver(MonoProxy proxy, ExecutionContext ctx, SessionId sessionId, int scopeId, ILogger logger) { this.sessionId = sessionId; this.scopeId = scopeId; this.proxy = proxy; - this.ctx = ctx; + this.context = ctx; this.logger = logger; scopeCache = ctx.GetCacheForScope(scopeId); - sdbHelper = proxy.SdbHelper; linqTypeId = -1; } @@ -43,11 +40,10 @@ public MemberReferenceResolver(MonoProxy proxy, ExecutionContext ctx, SessionId this.sessionId = sessionId; scopeId = -1; this.proxy = proxy; - this.ctx = ctx; + this.context = ctx; this.logger = logger; scopeCache = new PerScopeCache(objectValues); localsFetched = true; - sdbHelper = proxy.SdbHelper; linqTypeId = -1; } @@ -57,7 +53,7 @@ public async Task GetValueFromObject(JToken objRet, CancellationToken t { if (DotnetObjectId.TryParse(objRet?["value"]?["objectId"]?.Value(), out DotnetObjectId objectId)) { - var exceptionObject = await sdbHelper.GetObjectValues(sessionId, int.Parse(objectId.Value), GetObjectCommandOptions.WithProperties | GetObjectCommandOptions.OwnProperties, token); + var exceptionObject = await context.SdbAgent.GetObjectValues(int.Parse(objectId.Value), GetObjectCommandOptions.WithProperties | GetObjectCommandOptions.OwnProperties, token); var exceptionObjectMessage = exceptionObject.FirstOrDefault(attr => attr["name"].Value().Equals("_message")); exceptionObjectMessage["value"]["value"] = objRet["value"]?["className"]?.Value() + ": " + exceptionObjectMessage["value"]?["value"]?.Value(); return exceptionObjectMessage["value"]?.Value(); @@ -71,10 +67,9 @@ public async Task GetValueFromObject(JToken objRet, CancellationToken t { if (DotnetObjectId.TryParse(objRet?["get"]?["objectIdValue"]?.Value(), out DotnetObjectId objectId)) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); - commandParamsWriter.WriteObj(objectId, sdbHelper); - var ret = await sdbHelper.InvokeMethod(sessionId, commandParams.ToArray(), objRet["get"]["methodId"].Value(), objRet["name"].Value(), token); + using var commandParamsWriter = new MonoBinaryWriter(); + commandParamsWriter.WriteObj(objectId, context.SdbAgent); + var ret = await context.SdbAgent.InvokeMethod(commandParamsWriter.GetParameterBuffer(), objRet["get"]["methodId"].Value(), objRet["name"].Value(), token); return await GetValueFromObject(ret, token); } @@ -82,53 +77,99 @@ public async Task GetValueFromObject(JToken objRet, CancellationToken t return null; } - public async Task TryToRunOnLoadedClasses(string varName, CancellationToken token) + public async Task<(JObject containerObject, string remaining)> ResolveStaticMembersInStaticTypes(string varName, CancellationToken token) { string classNameToFind = ""; - string[] parts = varName.Split("."); - var typeId = -1; - foreach (string part in parts) + string[] parts = varName.Split(".", StringSplitOptions.TrimEntries); + var store = await proxy.LoadStore(sessionId, token); + var methodInfo = context.CallStack.FirstOrDefault(s => s.Id == scopeId)?.Method?.Info; + + if (methodInfo == null) + return (null, null); + + int typeId = -1; + for (int i = 0; i < parts.Length; i++) { - if (classNameToFind.Length > 0) - classNameToFind += "."; - classNameToFind += part.Trim(); + string part = parts[i]; + if (typeId != -1) { - var fields = await sdbHelper.GetTypeFields(sessionId, typeId, token); - foreach (var field in fields) + JObject memberObject = await FindStaticMemberInType(part, typeId); + if (memberObject != null) { - if (field.Name == part.Trim()) - { - var isInitialized = await sdbHelper.TypeIsInitialized(sessionId, typeId, token); - if (isInitialized == 0) - { - isInitialized = await sdbHelper.TypeInitialize(sessionId, typeId, token); - } - var valueRet = await sdbHelper.GetFieldValue(sessionId, typeId, field.Id, token); - return await GetValueFromObject(valueRet, token); - } + string remaining = null; + if (i < parts.Length - 1) + remaining = string.Join('.', parts[(i + 1)..]); + + return (memberObject, remaining); } - var methodId = await sdbHelper.GetPropertyMethodIdByName(sessionId, typeId, part.Trim(), token); - if (methodId != -1) + + // Didn't find a member named `part` in `typeId`. + // Could be a nested type. Let's continue the search + // with `part` added to the type name + + typeId = -1; + } + + if (classNameToFind.Length > 0) + classNameToFind += "."; + classNameToFind += part; + + if (!string.IsNullOrEmpty(methodInfo?.TypeInfo?.Namespace)) + { + typeId = await FindStaticTypeId(methodInfo?.TypeInfo?.Namespace + "." + classNameToFind); + if (typeId != -1) + continue; + } + typeId = await FindStaticTypeId(classNameToFind); + } + + return (null, null); + + async Task FindStaticMemberInType(string name, int typeId) + { + var fields = await context.SdbAgent.GetTypeFields(typeId, token); + foreach (var field in fields) + { + if (field.Name != name) + continue; + + var isInitialized = await context.SdbAgent.TypeIsInitialized(typeId, token); + if (isInitialized == 0) { - var commandParamsObj = new MemoryStream(); - var commandParamsObjWriter = new MonoBinaryWriter(commandParamsObj); - commandParamsObjWriter.Write(0); //param count - var retMethod = await sdbHelper.InvokeMethod(sessionId, commandParamsObj.ToArray(), methodId, "methodRet", token); - return await GetValueFromObject(retMethod, token); + isInitialized = await context.SdbAgent.TypeInitialize(typeId, token); } + var valueRet = await context.SdbAgent.GetFieldValue(typeId, field.Id, token); + + return await GetValueFromObject(valueRet, token); } - var store = await proxy.LoadStore(sessionId, token); + + var methodId = await context.SdbAgent.GetPropertyMethodIdByName(typeId, name, token); + if (methodId != -1) + { + using var commandParamsObjWriter = new MonoBinaryWriter(); + commandParamsObjWriter.Write(0); //param count + var retMethod = await context.SdbAgent.InvokeMethod(commandParamsObjWriter.GetParameterBuffer(), methodId, "methodRet", token); + return await GetValueFromObject(retMethod, token); + } + return null; + } + + async Task FindStaticTypeId(string typeName) + { foreach (var asm in store.assemblies) { - var type = asm.GetTypeByName(classNameToFind); - if (type != null) - { - typeId = await sdbHelper.GetTypeIdFromToken(sessionId, asm.DebugId, type.Token, token); - } + var type = asm.GetTypeByName(typeName); + if (type == null) + continue; + + int id = await context.SdbAgent.GetTypeIdFromToken(asm.DebugId, type.Token, token); + if (id != -1) + return id; } + + return -1; } - return null; } // Checks Locals, followed by `this` @@ -138,37 +179,43 @@ public async Task Resolve(string varName, CancellationToken token) if (varName.Contains('(')) return null; - string[] parts = varName.Split("."); - JObject rootObject = null; - - if (scopeCache.MemberReferences.TryGetValue(varName, out JObject ret)) { + if (scopeCache.MemberReferences.TryGetValue(varName, out JObject ret)) return ret; - } - if (scopeCache.ObjectFields.TryGetValue(varName, out JObject valueRet)) { + if (scopeCache.ObjectFields.TryGetValue(varName, out JObject valueRet)) return await GetValueFromObject(valueRet, token); - } - foreach (string part in parts) + string[] parts = varName.Split("."); + if (parts.Length == 0) + return null; + + JObject retObject = await ResolveAsLocalOrThisMember(parts[0]); + if (retObject != null && parts.Length > 1) + retObject = await ResolveAsInstanceMember(string.Join('.', parts[1..]), retObject); + + if (retObject == null) { - string partTrimmed = part.Trim(); - if (partTrimmed == "") - return null; - if (rootObject != null) + (retObject, string remaining) = await ResolveStaticMembersInStaticTypes(varName, token); + if (!string.IsNullOrEmpty(remaining)) { - if (rootObject?["subtype"]?.Value() == "null") - return null; - if (DotnetObjectId.TryParse(rootObject?["objectId"]?.Value(), out DotnetObjectId objectId)) + if (retObject?["subtype"]?.Value() == "null") { - var rootResObj = await proxy.RuntimeGetPropertiesInternal(sessionId, objectId, null, token); - var objRet = rootResObj.FirstOrDefault(objPropAttr => objPropAttr["name"].Value() == partTrimmed); - if (objRet == null) - return null; - - rootObject = await GetValueFromObject(objRet, token); + // NRE on null.$remaining + retObject = null; + } + else + { + retObject = await ResolveAsInstanceMember(remaining, retObject); } - continue; } + } + + scopeCache.MemberReferences[varName] = retObject; + return retObject; + + async Task ResolveAsLocalOrThisMember(string name) + { + var nameTrimmed = name.Trim(); if (scopeCache.Locals.Count == 0 && !localsFetched) { Result scope_res = await proxy.GetScopeProperties(sessionId, scopeId, token); @@ -176,34 +223,61 @@ public async Task Resolve(string varName, CancellationToken token) throw new Exception($"BUG: Unable to get properties for scope: {scopeId}. {scope_res}"); localsFetched = true; } - if (scopeCache.Locals.TryGetValue(partTrimmed, out JObject obj)) - { - rootObject = obj["value"]?.Value(); - } - else if (scopeCache.Locals.TryGetValue("this", out JObject objThis)) + + if (scopeCache.Locals.TryGetValue(nameTrimmed, out JObject obj)) + return obj["value"]?.Value(); + + if (!scopeCache.Locals.TryGetValue("this", out JObject objThis)) + return null; + + if (!DotnetObjectId.TryParse(objThis?["value"]?["objectId"]?.Value(), out DotnetObjectId objectId)) + return null; + + var rootResObj = await proxy.RuntimeGetPropertiesInternal(sessionId, objectId, null, token); + var objRet = rootResObj.FirstOrDefault(objPropAttr => objPropAttr["name"].Value() == nameTrimmed); + if (objRet != null) + return await GetValueFromObject(objRet, token); + + return null; + } + + async Task ResolveAsInstanceMember(string expr, JObject baseObject) + { + JObject resolvedObject = baseObject; + string[] parts = expr.Split('.'); + for (int i = 0; i < parts.Length; i++) { - if (partTrimmed == "this") - { - rootObject = objThis?["value"].Value(); - } - else if (DotnetObjectId.TryParse(objThis?["value"]?["objectId"]?.Value(), out DotnetObjectId objectId)) + string partTrimmed = parts[i].Trim(); + if (partTrimmed.Length == 0) + return null; + + if (!DotnetObjectId.TryParse(resolvedObject?["objectId"]?.Value(), out DotnetObjectId objectId)) + return null; + + var resolvedResObj = await proxy.RuntimeGetPropertiesInternal(sessionId, objectId, null, token); + var objRet = resolvedResObj.FirstOrDefault(objPropAttr => objPropAttr["name"]?.Value() == partTrimmed); + if (objRet == null) + return null; + + resolvedObject = await GetValueFromObject(objRet, token); + if (resolvedObject == null) + return null; + + if (resolvedObject["subtype"]?.Value() == "null") { - var rootResObj = await proxy.RuntimeGetPropertiesInternal(sessionId, objectId, null, token); - var objRet = rootResObj.FirstOrDefault(objPropAttr => objPropAttr["name"].Value() == partTrimmed); - if (objRet != null) + if (i < parts.Length - 1) { - rootObject = await GetValueFromObject(objRet, token); - } - else - { - rootObject = await TryToRunOnLoadedClasses(varName, token); - return rootObject; + // there is some parts remaining, and can't + // do null.$remaining + return null; } + + return resolvedObject; } } + + return resolvedObject; } - scopeCache.MemberReferences[varName] = rootObject; - return rootObject; } public async Task Resolve(ElementAccessExpressionSyntax elementAccess, Dictionary memberAccessValues, JObject indexObject, CancellationToken token) @@ -227,8 +301,6 @@ public async Task Resolve(ElementAccessExpressionSyntax elementAccess, { if (elementAccess.ArgumentList != null) { - var commandParamsObj = new MemoryStream(); - var commandParamsObjWriter = new MonoBinaryWriter(commandParamsObj); foreach (var arg in elementAccess.ArgumentList.Arguments) { // e.g. x[1] @@ -270,18 +342,17 @@ public async Task Resolve(ElementAccessExpressionSyntax elementAccess, switch (objectId.Scheme) { case "array": - rootObject["value"] = await sdbHelper.GetArrayValues(sessionId, int.Parse(objectId.Value), token); + rootObject["value"] = await context.SdbAgent.GetArrayValues(int.Parse(objectId.Value), token); return (JObject)rootObject["value"][elementIdx]["value"]; case "object": - var typeIds = await sdbHelper.GetTypeIdFromObject(sessionId, int.Parse(objectId.Value), true, token); - int methodId = await sdbHelper.GetMethodIdByName(sessionId, typeIds[0], "ToArray", token); - var commandParamsObj = new MemoryStream(); - var commandParamsObjWriter = new MonoBinaryWriter(commandParamsObj); - commandParamsObjWriter.WriteObj(objectId, sdbHelper); - var toArrayRetMethod = await sdbHelper.InvokeMethod(sessionId, commandParamsObj.ToArray(), methodId, elementAccess.Expression.ToString(), token); + var typeIds = await context.SdbAgent.GetTypeIdFromObject(int.Parse(objectId.Value), true, token); + int methodId = await context.SdbAgent.GetMethodIdByName(typeIds[0], "ToArray", token); + var commandParamsObjWriter = new MonoBinaryWriter(); + commandParamsObjWriter.WriteObj(objectId, context.SdbAgent); + var toArrayRetMethod = await context.SdbAgent.InvokeMethod(commandParamsObjWriter.GetParameterBuffer(), methodId, elementAccess.Expression.ToString(), token); rootObject = await GetValueFromObject(toArrayRetMethod, token); DotnetObjectId.TryParse(rootObject?["objectId"]?.Value(), out DotnetObjectId arrayObjectId); - rootObject["value"] = await sdbHelper.GetArrayValues(sessionId, int.Parse(arrayObjectId.Value), token); + rootObject["value"] = await context.SdbAgent.GetArrayValues(int.Parse(arrayObjectId.Value), token); return (JObject)rootObject["value"][elementIdx]["value"]; default: throw new InvalidOperationException($"Cannot apply indexing with [] to an expression of type '{objectId.Scheme}'"); @@ -320,56 +391,55 @@ public async Task Resolve(InvocationExpressionSyntax method, Dictionary if (rootObject != null) { DotnetObjectId.TryParse(rootObject?["objectId"]?.Value(), out DotnetObjectId objectId); - var typeIds = await sdbHelper.GetTypeIdFromObject(sessionId, int.Parse(objectId.Value), true, token); - int methodId = await sdbHelper.GetMethodIdByName(sessionId, typeIds[0], methodName, token); - var className = await sdbHelper.GetTypeNameOriginal(sessionId, typeIds[0], token); + var typeIds = await context.SdbAgent.GetTypeIdFromObject(int.Parse(objectId.Value), true, token); + int methodId = await context.SdbAgent.GetMethodIdByName(typeIds[0], methodName, token); + var className = await context.SdbAgent.GetTypeNameOriginal(typeIds[0], token); if (methodId == 0) //try to search on System.Linq.Enumerable { if (linqTypeId == -1) - linqTypeId = await sdbHelper.GetTypeByName(sessionId, "System.Linq.Enumerable", token); - methodId = await sdbHelper.GetMethodIdByName(sessionId, linqTypeId, methodName, token); + linqTypeId = await context.SdbAgent.GetTypeByName("System.Linq.Enumerable", token); + methodId = await context.SdbAgent.GetMethodIdByName(linqTypeId, methodName, token); if (methodId != 0) { foreach (var typeId in typeIds) { - var genericTypeArgs = await sdbHelper.GetTypeParamsOrArgsForGenericType(sessionId, typeId, token); + var genericTypeArgs = await context.SdbAgent.GetTypeParamsOrArgsForGenericType(typeId, token); if (genericTypeArgs.Count > 0) { isTryingLinq = 1; - methodId = await sdbHelper.MakeGenericMethod(sessionId, methodId, genericTypeArgs, token); + methodId = await context.SdbAgent.MakeGenericMethod(methodId, genericTypeArgs, token); break; } } } } if (methodId == 0) { - var typeName = await sdbHelper.GetTypeName(sessionId, typeIds[0], token); + var typeName = await context.SdbAgent.GetTypeName(typeIds[0], token); throw new Exception($"Method '{methodName}' not found in type '{typeName}'"); } - var commandParamsObj = new MemoryStream(); - var commandParamsObjWriter = new MonoBinaryWriter(commandParamsObj); + using var commandParamsObjWriter = new MonoBinaryWriter(); if (isTryingLinq == 0) - commandParamsObjWriter.WriteObj(objectId, sdbHelper); + commandParamsObjWriter.WriteObj(objectId, context.SdbAgent); if (method.ArgumentList != null) { commandParamsObjWriter.Write((int)method.ArgumentList.Arguments.Count + isTryingLinq); if (isTryingLinq == 1) - commandParamsObjWriter.WriteObj(objectId, sdbHelper); + commandParamsObjWriter.WriteObj(objectId, context.SdbAgent); foreach (var arg in method.ArgumentList.Arguments) { if (arg.Expression is LiteralExpressionSyntax) { - if (!await commandParamsObjWriter.WriteConst(sessionId, arg.Expression as LiteralExpressionSyntax, sdbHelper, token)) + if (!await commandParamsObjWriter.WriteConst(arg.Expression as LiteralExpressionSyntax, context.SdbAgent, token)) return null; } if (arg.Expression is IdentifierNameSyntax) { var argParm = arg.Expression as IdentifierNameSyntax; - if (!await commandParamsObjWriter.WriteJsonValue(sessionId, memberAccessValues[argParm.Identifier.Text], sdbHelper, token)) + if (!await commandParamsObjWriter.WriteJsonValue(memberAccessValues[argParm.Identifier.Text], context.SdbAgent, token)) return null; } } - var retMethod = await sdbHelper.InvokeMethod(sessionId, commandParamsObj.ToArray(), methodId, "methodRet", token); + var retMethod = await context.SdbAgent.InvokeMethod(commandParamsObjWriter.GetParameterBuffer(), methodId, "methodRet", token); return await GetValueFromObject(retMethod, token); } } diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs index cb0a51ccd78047..f6689614aafd71 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs @@ -18,18 +18,19 @@ namespace Microsoft.WebAssembly.Diagnostics { internal class MonoProxy : DevToolsProxy { - internal MonoSDBHelper SdbHelper { get; set; } private IList urlSymbolServerList; private static HttpClient client = new HttpClient(); private HashSet sessions = new HashSet(); private Dictionary contexts = new Dictionary(); private const string sPauseOnUncaught = "pause_on_uncaught"; private const string sPauseOnCaught = "pause_on_caught"; + // index of the runtime in a same JS page/process + public int RuntimeId { get; private init; } - public MonoProxy(ILoggerFactory loggerFactory, IList urlSymbolServerList) : base(loggerFactory) + public MonoProxy(ILoggerFactory loggerFactory, IList urlSymbolServerList, int runtimeId = 0) : base(loggerFactory) { this.urlSymbolServerList = urlSymbolServerList ?? new List(); - SdbHelper = new MonoSDBHelper(this, logger); + RuntimeId = runtimeId; } internal ExecutionContext GetContext(SessionId sessionId) @@ -118,7 +119,7 @@ protected override async Task AcceptEvent(SessionId sessionId, string meth bool? is_default = aux_data["isDefault"]?.Value(); if (is_default == true) { - await OnDefaultContext(sessionId, new ExecutionContext { Id = id, AuxData = aux_data }, token); + await OnDefaultContext(sessionId, new ExecutionContext(new MonoSDBHelper (this, logger, sessionId), id, aux_data), token); } } return true; @@ -225,7 +226,7 @@ protected override async Task AcceptEvent(SessionId sessionId, string meth case "Target.targetDestroyed": { - await SendMonoCommand(sessionId, MonoCommands.DetachDebugger(), token); + await SendMonoCommand(sessionId, MonoCommands.DetachDebugger(RuntimeId), token); break; } } @@ -238,7 +239,7 @@ private async Task IsRuntimeAlreadyReadyAlready(SessionId sessionId, Cance if (contexts.TryGetValue(sessionId, out ExecutionContext context) && context.IsRuntimeReady) return true; - Result res = await SendMonoCommand(sessionId, MonoCommands.IsRuntimeReady(), token); + Result res = await SendMonoCommand(sessionId, MonoCommands.IsRuntimeReady(RuntimeId), token); return res.Value?["result"]?["value"]?.Value() ?? false; } @@ -400,7 +401,17 @@ protected override async Task AcceptCommand(MessageId id, string method, J { return await Step(id, StepKind.Over, token); } - + case "Runtime.evaluate": + { + if (context.CallStack != null) + { + Frame scope = context.CallStack.First(); + return await OnEvaluateOnCallFrame(id, + scope.Id, + args?["expression"]?.Value(), token); + } + break; + } case "Debugger.evaluateOnCallFrame": { if (!DotnetObjectId.TryParse(args?["callFrameId"], out DotnetObjectId objectId)) @@ -436,7 +447,7 @@ protected override async Task AcceptCommand(MessageId id, string method, J if (!(DotnetObjectId.TryParse(args["objectId"], out DotnetObjectId objectId) && objectId.Scheme == "cfo_res")) break; - await SendMonoCommand(id, MonoCommands.ReleaseObject(objectId), token); + await SendMonoCommand(id, MonoCommands.ReleaseObject(RuntimeId, objectId), token); SendResponse(id, Result.OkFromObject(new { }), token); return true; } @@ -453,7 +464,7 @@ protected override async Task AcceptCommand(MessageId id, string method, J }; if (context.IsRuntimeReady) - await SdbHelper.EnableExceptions(id, context.PauseOnExceptions, token); + await context.SdbAgent.EnableExceptions(context.PauseOnExceptions, token); // Pass this on to JS too return false; } @@ -502,8 +513,8 @@ protected override async Task AcceptCommand(MessageId id, string method, J { // Maybe this is an async method, in which case the debug info is attached // to the async method implementation, in class named: - // `{type_name}/::MoveNext` - methodInfo = assembly.TypesByName.Values.SingleOrDefault(t => t.FullName.StartsWith($"{typeName}/<{methodName}>"))? + // `{type_name}.::MoveNext` + methodInfo = assembly.TypesByName.Values.SingleOrDefault(t => t.FullName.StartsWith($"{typeName}.<{methodName}>"))? .Methods.FirstOrDefault(mi => mi.Name == "MoveNext"); } @@ -540,26 +551,27 @@ protected override async Task AcceptCommand(MessageId id, string method, J } private async Task CallOnFunction(MessageId id, JObject args, CancellationToken token) { + var context = GetContext(id); if (!DotnetObjectId.TryParse(args["objectId"], out DotnetObjectId objectId)) { return false; } switch (objectId.Scheme) { case "object": - args["details"] = await SdbHelper.GetObjectProxy(id, int.Parse(objectId.Value), token); + args["details"] = await context.SdbAgent.GetObjectProxy(int.Parse(objectId.Value), token); break; case "valuetype": - args["details"] = await SdbHelper.GetValueTypeProxy(id, int.Parse(objectId.Value), token); + args["details"] = await context.SdbAgent.GetValueTypeProxy(int.Parse(objectId.Value), token); break; case "pointer": - args["details"] = await SdbHelper.GetPointerContent(id, int.Parse(objectId.Value), token); + args["details"] = await context.SdbAgent.GetPointerContent(int.Parse(objectId.Value), token); break; case "array": - args["details"] = await SdbHelper.GetArrayValues(id, int.Parse(objectId.Value), token); + args["details"] = await context.SdbAgent.GetArrayValuesProxy(int.Parse(objectId.Value), token); break; case "cfo_res": { - Result cfo_res = await SendMonoCommand(id, MonoCommands.CallFunctionOn(args), token); + Result cfo_res = await SendMonoCommand(id, MonoCommands.CallFunctionOn(RuntimeId, args), token); cfo_res = Result.OkFromObject(new { result = cfo_res.Value?["result"]?["value"]}); SendResponse(id, cfo_res, token); return true; @@ -575,7 +587,7 @@ private async Task CallOnFunction(MessageId id, JObject args, Cancellation default: return false; } - Result res = await SendMonoCommand(id, MonoCommands.CallFunctionOn(args), token); + Result res = await SendMonoCommand(id, MonoCommands.CallFunctionOn(RuntimeId, args), token); if (res.IsErr) { SendResponse(id, res, token); @@ -584,10 +596,9 @@ private async Task CallOnFunction(MessageId id, JObject args, Cancellation if (res.Value?["result"]?["value"]?["type"] == null) //it means that is not a buffer returned from the debugger-agent { byte[] newBytes = Convert.FromBase64String(res.Value?["result"]?["value"]?["value"]?.Value()); - var retDebuggerCmd = new MemoryStream(newBytes); - var retDebuggerCmdReader = new MonoBinaryReader(retDebuggerCmd); + var retDebuggerCmdReader = new MonoBinaryReader(newBytes); retDebuggerCmdReader.ReadByte(); //number of objects returned. - var obj = await SdbHelper.CreateJObjectForVariableValue(id, retDebuggerCmdReader, "ret", false, -1, false, token); + var obj = await context.SdbAgent.CreateJObjectForVariableValue(retDebuggerCmdReader, "ret", false, -1, false, token); /*JTokenType? res_value_type = res.Value?["result"]?["value"]?.Type;*/ res = Result.OkFromObject(new { result = obj["value"]}); SendResponse(id, res, token); @@ -600,17 +611,17 @@ private async Task CallOnFunction(MessageId id, JObject args, Cancellation private async Task OnSetVariableValue(MessageId id, int scopeId, string varName, JToken varValue, CancellationToken token) { - ExecutionContext ctx = GetContext(id); - Frame scope = ctx.CallStack.FirstOrDefault(s => s.Id == scopeId); + ExecutionContext context = GetContext(id); + Frame scope = context.CallStack.FirstOrDefault(s => s.Id == scopeId); if (scope == null) return false; - var varIds = scope.Method.Info.GetLiveVarsAt(scope.Location.CliLocation.Offset); + var varIds = scope.Method.Info.GetLiveVarsAt(scope.Location.IlLocation.Offset); if (varIds == null) return false; var varToSetValue = varIds.FirstOrDefault(v => v.Name == varName); if (varToSetValue == null) return false; - var res = await SdbHelper.SetVariableValue(id, ctx.ThreadId, scopeId, varToSetValue.Index, varValue["value"].Value(), token); + var res = await context.SdbAgent.SetVariableValue(context.ThreadId, scopeId, varToSetValue.Index, varValue["value"].Value(), token); if (res) SendResponse(id, Result.Ok(new JObject()), token); else @@ -620,6 +631,7 @@ private async Task OnSetVariableValue(MessageId id, int scopeId, string va internal async Task RuntimeGetPropertiesInternal(SessionId id, DotnetObjectId objectId, JToken args, CancellationToken token) { + var context = GetContext(id); var accessorPropertiesOnly = false; GetObjectCommandOptions objectValuesOpt = GetObjectCommandOptions.WithProperties; if (args != null) @@ -644,16 +656,16 @@ internal async Task RuntimeGetPropertiesInternal(SessionId id, DotnetObj return res.Value?["result"]; } case "valuetype": - return await SdbHelper.GetValueTypeValues(id, int.Parse(objectId.Value), accessorPropertiesOnly, token); + return await context.SdbAgent.GetValueTypeValues(int.Parse(objectId.Value), accessorPropertiesOnly, token); case "array": - return await SdbHelper.GetArrayValues(id, int.Parse(objectId.Value), token); + return await context.SdbAgent.GetArrayValues(int.Parse(objectId.Value), token); case "object": - return await SdbHelper.GetObjectValues(id, int.Parse(objectId.Value), objectValuesOpt, token); + return await context.SdbAgent.GetObjectValues(int.Parse(objectId.Value), objectValuesOpt, token); case "pointer": - return new JArray{await SdbHelper.GetPointerContent(id, int.Parse(objectId.Value), token)}; + return new JArray{await context.SdbAgent.GetPointerContent(int.Parse(objectId.Value), token)}; case "cfo_res": { - Result res = await SendMonoCommand(id, MonoCommands.GetDetails(int.Parse(objectId.Value), args), token); + Result res = await SendMonoCommand(id, MonoCommands.GetDetails(RuntimeId, int.Parse(objectId.Value), args), token); string value_json_str = res.Value["result"]?["value"]?["__value_as_json_string__"]?.Value(); return value_json_str != null ? JArray.Parse(value_json_str) : null; } @@ -707,10 +719,10 @@ private async Task ProcessEnC(SessionId sessionId, ExecutionContext contex int pdb_size = retDebuggerCmdReader.ReadInt32(); byte[] pdb_buf = retDebuggerCmdReader.ReadBytes(pdb_size); - var assemblyName = await SdbHelper.GetAssemblyNameFromModule(sessionId, moduleId, token); + var assemblyName = await context.SdbAgent.GetAssemblyNameFromModule(moduleId, token); DebugStore store = await LoadStore(sessionId, token); AssemblyInfo asm = store.GetAssemblyByName(assemblyName); - foreach (var method in store.EnC(sessionId, asm, meta_buf, pdb_buf)) + foreach (var method in store.EnC(asm, meta_buf, pdb_buf)) await ResetBreakpoint(sessionId, method, token); return true; } @@ -718,7 +730,7 @@ private async Task ProcessEnC(SessionId sessionId, ExecutionContext contex private async Task SendBreakpointsOfMethodUpdated(SessionId sessionId, ExecutionContext context, MonoBinaryReader retDebuggerCmdReader, CancellationToken token) { var methodId = retDebuggerCmdReader.ReadInt32(); - var method = await SdbHelper.GetMethodInfo(sessionId, methodId, token); + var method = await context.SdbAgent.GetMethodInfo(methodId, token); if (method == null) { return true; @@ -733,16 +745,15 @@ private async Task SendBreakpointsOfMethodUpdated(SessionId sessionId, Exe return true; } - private async Task SendCallStack(SessionId sessionId, ExecutionContext context, string reason, int thread_id, Breakpoint bp, JObject data, IEnumerable orig_callframes, CancellationToken token) + private async Task SendCallStack(SessionId sessionId, ExecutionContext context, string reason, int thread_id, Breakpoint bp, JObject data, IEnumerable orig_callframes, EventKind event_kind, CancellationToken token) { var callFrames = new List(); var frames = new List(); - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(thread_id); commandParamsWriter.Write(0); commandParamsWriter.Write(-1); - var retDebuggerCmdReader = await SdbHelper.SendDebuggerAgentCommand(sessionId, CmdThread.GetFrameInfo, commandParams, token); + using var retDebuggerCmdReader = await context.SdbAgent.SendDebuggerAgentCommand(CmdThread.GetFrameInfo, commandParamsWriter, token); var frame_count = retDebuggerCmdReader.ReadInt32(); //Console.WriteLine("frame_count - " + frame_count); for (int j = 0; j < frame_count; j++) { @@ -751,7 +762,27 @@ private async Task SendCallStack(SessionId sessionId, ExecutionContext con var il_pos = retDebuggerCmdReader.ReadInt32(); var flags = retDebuggerCmdReader.ReadByte(); DebugStore store = await LoadStore(sessionId, token); - var method = await SdbHelper.GetMethodInfo(sessionId, methodId, token); + var method = await context.SdbAgent.GetMethodInfo(methodId, token); + + if (context.IsSkippingHiddenMethod == true) + { + context.IsSkippingHiddenMethod = false; + if (event_kind != EventKind.UserBreak) + { + await context.SdbAgent.Step(context.ThreadId, StepKind.Over, token); + await SendCommand(sessionId, "Debugger.resume", new JObject(), token); + return true; + } + } + + if (j == 0 && method?.Info.IsHiddenFromDebugger == true) + { + if (event_kind == EventKind.Step) + context.IsSkippingHiddenMethod = true; + await context.SdbAgent.Step(context.ThreadId, StepKind.Out, token); + await SendCommand(sessionId, "Debugger.resume", new JObject(), token); + return true; + } SourceLocation location = method?.Info.GetLocationByIl(il_pos); @@ -833,14 +864,13 @@ private async Task SendCallStack(SessionId sessionId, ExecutionContext con } private async Task OnReceiveDebuggerAgentEvent(SessionId sessionId, JObject args, CancellationToken token) { - Result res = await SendMonoCommand(sessionId, MonoCommands.GetDebuggerAgentBufferReceived(), token); + Result res = await SendMonoCommand(sessionId, MonoCommands.GetDebuggerAgentBufferReceived(RuntimeId), token); if (res.IsErr) return false; ExecutionContext context = GetContext(sessionId); byte[] newBytes = Convert.FromBase64String(res.Value?["result"]?["value"]?["value"]?.Value()); - var retDebuggerCmd = new MemoryStream(newBytes); - var retDebuggerCmdReader = new MonoBinaryReader(retDebuggerCmd); + using var retDebuggerCmdReader = new MonoBinaryReader(newBytes); retDebuggerCmdReader.ReadBytes(11); //skip HEADER_LEN retDebuggerCmdReader.ReadByte(); //suspend_policy var number_of_events = retDebuggerCmdReader.ReadInt32(); //number of events -> should be always one @@ -848,7 +878,7 @@ private async Task OnReceiveDebuggerAgentEvent(SessionId sessionId, JObjec var event_kind = (EventKind)retDebuggerCmdReader.ReadByte(); //event kind var request_id = retDebuggerCmdReader.ReadInt32(); //request id if (event_kind == EventKind.Step) - await SdbHelper.ClearSingleStep(sessionId, request_id, token); + await context.SdbAgent.ClearSingleStep(request_id, token); int thread_id = retDebuggerCmdReader.ReadInt32(); switch (event_kind) { @@ -869,19 +899,19 @@ private async Task OnReceiveDebuggerAgentEvent(SessionId sessionId, JObjec string reason = "exception"; int object_id = retDebuggerCmdReader.ReadInt32(); var caught = retDebuggerCmdReader.ReadByte(); - var exceptionObject = await SdbHelper.GetObjectValues(sessionId, object_id, GetObjectCommandOptions.WithProperties | GetObjectCommandOptions.OwnProperties, token); + var exceptionObject = await context.SdbAgent.GetObjectValues(object_id, GetObjectCommandOptions.WithProperties | GetObjectCommandOptions.OwnProperties, token); var exceptionObjectMessage = exceptionObject.FirstOrDefault(attr => attr["name"].Value().Equals("_message")); var data = JObject.FromObject(new { type = "object", subtype = "error", - className = await SdbHelper.GetClassNameFromObject(sessionId, object_id, token), + className = await context.SdbAgent.GetClassNameFromObject(object_id, token), uncaught = caught == 0, description = exceptionObjectMessage["value"]["value"].Value(), objectId = $"dotnet:object:{object_id}" }); - var ret = await SendCallStack(sessionId, context, reason, thread_id, null, data, args?["callFrames"]?.Values(), token); + var ret = await SendCallStack(sessionId, context, reason, thread_id, null, data, args?["callFrames"]?.Values(), event_kind, token); return ret; } case EventKind.UserBreak: @@ -893,7 +923,7 @@ private async Task OnReceiveDebuggerAgentEvent(SessionId sessionId, JObjec int methodId = 0; if (event_kind != EventKind.UserBreak) methodId = retDebuggerCmdReader.ReadInt32(); - var ret = await SendCallStack(sessionId, context, reason, thread_id, bp, null, args?["callFrames"]?.Values(), token); + var ret = await SendCallStack(sessionId, context, reason, thread_id, bp, null, args?["callFrames"]?.Values(), event_kind, token); return ret; } } @@ -969,40 +999,38 @@ private async Task OnDefaultContext(SessionId sessionId, ExecutionContext contex private async Task OnResume(MessageId msg_id, CancellationToken token) { - ExecutionContext ctx = GetContext(msg_id); - if (ctx.CallStack != null) + ExecutionContext context = GetContext(msg_id); + if (context.CallStack != null) { // Stopped on managed code - await SendMonoCommand(msg_id, MonoCommands.Resume(), token); + await SendMonoCommand(msg_id, MonoCommands.Resume(RuntimeId), token); } //discard managed frames - SdbHelper.ClearCache(); GetContext(msg_id).ClearState(); } - private async Task Step(MessageId msg_id, StepKind kind, CancellationToken token) + private async Task Step(MessageId msgId, StepKind kind, CancellationToken token) { - ExecutionContext context = GetContext(msg_id); + ExecutionContext context = GetContext(msgId); if (context.CallStack == null) return false; if (context.CallStack.Count <= 1 && kind == StepKind.Out) return false; - var step = await SdbHelper.Step(msg_id, context.ThreadId, kind, token); + var step = await context.SdbAgent.Step(context.ThreadId, kind, token); if (step == false) { - SdbHelper.ClearCache(); context.ClearState(); - await SendCommand(msg_id, "Debugger.stepOut", new JObject(), token); + await SendCommand(msgId, "Debugger.stepOut", new JObject(), token); return false; } - SendResponse(msg_id, Result.Ok(new JObject()), token); + SendResponse(msgId, Result.Ok(new JObject()), token); context.ClearState(); - await SendCommand(msg_id, "Debugger.resume", new JObject(), token); + await SendCommand(msgId, "Debugger.resume", new JObject(), token); return true; } @@ -1055,7 +1083,7 @@ private async Task OnAssemblyLoadedJSEvent(SessionId sessionId, JObject ev var pdb_data = string.IsNullOrEmpty(pdb_b64) ? null : Convert.FromBase64String(pdb_b64); var context = GetContext(sessionId); - foreach (var source in store.Add(sessionId, assembly_data, pdb_data)) + foreach (var source in store.Add(assembly_name, assembly_data, pdb_data)) { await OnSourceFileAdded(sessionId, source, context, token); } @@ -1114,20 +1142,20 @@ internal async Task GetScopeProperties(SessionId msg_id, int scopeId, Ca { try { - ExecutionContext ctx = GetContext(msg_id); - Frame scope = ctx.CallStack.FirstOrDefault(s => s.Id == scopeId); + ExecutionContext context = GetContext(msg_id); + Frame scope = context.CallStack.FirstOrDefault(s => s.Id == scopeId); if (scope == null) return Result.Err(JObject.FromObject(new { message = $"Could not find scope with id #{scopeId}" })); - VarInfo[] varIds = scope.Method.Info.GetLiveVarsAt(scope.Location.CliLocation.Offset); + VarInfo[] varIds = scope.Method.Info.GetLiveVarsAt(scope.Location.IlLocation.Offset); - var values = await SdbHelper.StackFrameGetValues(msg_id, scope.Method, ctx.ThreadId, scopeId, varIds, token); + var values = await context.SdbAgent.StackFrameGetValues(scope.Method, context.ThreadId, scopeId, varIds, token); if (values != null) { if (values == null || values.Count == 0) return Result.OkFromObject(new { result = Array.Empty() }); - PerScopeCache frameCache = ctx.GetCacheForScope(scopeId); + PerScopeCache frameCache = context.GetCacheForScope(scopeId); foreach (JObject value in values) { frameCache.Locals[value["name"]?.Value()] = value; @@ -1145,14 +1173,15 @@ internal async Task GetScopeProperties(SessionId msg_id, int scopeId, Ca private async Task SetMonoBreakpoint(SessionId sessionId, string reqId, SourceLocation location, string condition, CancellationToken token) { + var context = GetContext(sessionId); var bp = new Breakpoint(reqId, location, condition, BreakpointState.Pending); - string asm_name = bp.Location.CliLocation.Method.Assembly.Name; - int method_token = bp.Location.CliLocation.Method.Token; - int il_offset = bp.Location.CliLocation.Offset; + string asm_name = bp.Location.IlLocation.Method.Assembly.Name; + int method_token = bp.Location.IlLocation.Method.Token; + int il_offset = bp.Location.IlLocation.Offset; - var assembly_id = await SdbHelper.GetAssemblyId(sessionId, asm_name, token); - var methodId = await SdbHelper.GetMethodIdByToken(sessionId, assembly_id, method_token, token); - var breakpoint_id = await SdbHelper.SetBreakpoint(sessionId, methodId, il_offset, token); + var assembly_id = await context.SdbAgent.GetAssemblyId(asm_name, token); + var methodId = await context.SdbAgent.GetMethodIdByToken(assembly_id, method_token, token); + var breakpoint_id = await context.SdbAgent.SetBreakpoint(methodId, il_offset, token); if (breakpoint_id > 0) { @@ -1191,12 +1220,12 @@ internal async Task LoadStore(SessionId sessionId, CancellationToken if (loaded_files == null) { - Result loaded = await SendMonoCommand(sessionId, MonoCommands.GetLoadedFiles(), token); + Result loaded = await SendMonoCommand(sessionId, MonoCommands.GetLoadedFiles(RuntimeId), token); loaded_files = loaded.Value?["result"]?["value"]?.ToObject(); } await - foreach (SourceFile source in context.store.Load(sessionId, loaded_files, token).WithCancellation(token)) + foreach (SourceFile source in context.store.Load(loaded_files, token).WithCancellation(token)) { await OnSourceFileAdded(sessionId, source, context, token); } @@ -1217,21 +1246,20 @@ private async Task RuntimeReady(SessionId sessionId, CancellationTok if (Interlocked.CompareExchange(ref context.ready, new TaskCompletionSource(), null) != null) return await context.ready.Task; - var commandParams = new MemoryStream(); - await SdbHelper.SendDebuggerAgentCommand(sessionId, CmdEventRequest.ClearAllBreakpoints, commandParams, token); + await context.SdbAgent.SendDebuggerAgentCommand(CmdEventRequest.ClearAllBreakpoints, null, token); if (context.PauseOnExceptions != PauseOnExceptionsKind.None && context.PauseOnExceptions != PauseOnExceptionsKind.Unset) - await SdbHelper.EnableExceptions(sessionId, context.PauseOnExceptions, token); + await context.SdbAgent.EnableExceptions(context.PauseOnExceptions, token); - await SdbHelper.SetProtocolVersion(sessionId, token); - await SdbHelper.EnableReceiveRequests(sessionId, EventKind.UserBreak, token); - await SdbHelper.EnableReceiveRequests(sessionId, EventKind.EnC, token); - await SdbHelper.EnableReceiveRequests(sessionId, EventKind.MethodUpdate, token); + await context.SdbAgent.SetProtocolVersion(token); + await context.SdbAgent.EnableReceiveRequests(EventKind.UserBreak, token); + await context.SdbAgent.EnableReceiveRequests(EventKind.EnC, token); + await context.SdbAgent.EnableReceiveRequests(EventKind.MethodUpdate, token); DebugStore store = await LoadStore(sessionId, token); context.ready.SetResult(store); SendEvent(sessionId, "Mono.runtimeReady", new JObject(), token); - SdbHelper.ResetStore(store); + context.SdbAgent.ResetStore(store); return store; } @@ -1259,7 +1287,7 @@ private async Task RemoveBreakpoint(SessionId msg_id, JObject args, bool isEnCRe foreach (Breakpoint bp in breakpointRequest.Locations) { - var breakpoint_removed = await SdbHelper.RemoveBreakpoint(msg_id, bp.RemoteId, token); + var breakpoint_removed = await context.SdbAgent.RemoveBreakpoint(bp.RemoteId, token); if (breakpoint_removed) { bp.RemoteId = -1; @@ -1300,7 +1328,7 @@ private async Task SetBreakpoint(SessionId sessionId, DebugStore store, Breakpoi foreach (IGrouping sourceId in locations) { SourceLocation loc = sourceId.First(); - req.Method = loc.CliLocation.Method; + req.Method = loc.IlLocation.Method; if (req.Method.IsHiddenFromDebugger) continue; diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs index dee4b5ac0f5fde..2adcad6a14e3e9 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs @@ -5,19 +5,17 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Net; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.Extensions.Logging; -using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using System.Net.Http; using System.Text.RegularExpressions; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.CSharp; using System.Reflection; using System.Text; +using System.Runtime.CompilerServices; namespace Microsoft.WebAssembly.Diagnostics { @@ -358,6 +356,52 @@ internal enum StepSize Line } + internal record ArrayDimensions + { + internal int Rank { get; } + internal int [] Bounds { get; } + internal int TotalLength { get; } + public ArrayDimensions(int [] rank) + { + Rank = rank.Length; + Bounds = rank; + TotalLength = 1; + for (int i = 0 ; i < Rank ; i++) + TotalLength *= Bounds[i]; + } + + public override string ToString() + { + return $"{string.Join(", ", Bounds)}"; + } + internal string GetArrayIndexString(int idx) + { + if (idx < 0 || idx >= TotalLength) + return "Invalid Index"; + int boundLimit = 1; + int lastBoundLimit = 1; + int[] arrayStr = new int[Rank]; + int rankStart = 0; + while (idx > 0) + { + boundLimit = 1; + for (int i = Rank - 1; i >= rankStart; i--) + { + lastBoundLimit = boundLimit; + boundLimit *= Bounds[i]; + if (idx < boundLimit) + { + arrayStr[i] = (int)(idx / lastBoundLimit); + idx -= arrayStr[i] * lastBoundLimit; + rankStart = i; + break; + } + } + } + return $"{string.Join(", ", arrayStr)}"; + } + } + internal record MethodInfoWithDebugInformation(MethodInfo Info, int DebugId, string Name); internal class TypeInfoWithDebugInformation @@ -380,23 +424,21 @@ public TypeInfoWithDebugInformation(TypeInfo typeInfo, int debugId, string name) internal class MonoBinaryReader : BinaryReader { public bool HasError { get; } - public MonoBinaryReader(Stream stream, bool hasError = false) : base(stream) + + private MonoBinaryReader(Stream stream, bool hasError = false) : base(stream) { HasError = hasError; } - internal static unsafe void PutBytesBE (byte *dest, byte *src, int count) - { - int i = 0; + public MonoBinaryReader(byte [] data) : base(new MemoryStream(data)) {} - if (BitConverter.IsLittleEndian){ - dest += count; - for (; i < count; i++) - *(--dest) = *src++; - } else { - for (; i < count; i++) - *dest++ = *src++; + public static MonoBinaryReader From(Result result) + { + byte[] newBytes = Array.Empty(); + if (!result.IsErr) { + newBytes = Convert.FromBase64String(result.Value?["result"]?["value"]?["value"]?.Value()); } + return new MonoBinaryReader(new MemoryStream(newBytes), result.IsErr); } public override string ReadString() @@ -407,147 +449,138 @@ public override string ReadString() return new string(Encoding.UTF8.GetChars(value, 0, valueLen)); } - public unsafe long ReadLong() - { - byte[] data = new byte[8]; - Read(data, 0, 8); - - long ret; - fixed (byte *src = &data[0]){ - PutBytesBE ((byte *) &ret, src, 8); - } - return ret; - } - public override unsafe sbyte ReadSByte() - { - byte[] data = new byte[4]; - Read(data, 0, 4); + // SDB encodes these as 4 bytes + public override sbyte ReadSByte() => (sbyte)ReadInt32(); + public byte ReadUByte() => (byte)ReadUInt32(); + public ushort ReadUShort() => (ushort)ReadUInt32(); - int ret; - fixed (byte *src = &data[0]){ - PutBytesBE ((byte *) &ret, src, 4); - } - return (sbyte)ret; - } + // Big endian overrides + public override int ReadInt32() => ReadBigEndian(); + public override double ReadDouble() => ReadBigEndian(); + public override uint ReadUInt32() => ReadBigEndian(); + public override float ReadSingle() => ReadBigEndian(); + public override ulong ReadUInt64() => ReadBigEndian(); + public override long ReadInt64() => ReadBigEndian(); - public unsafe byte ReadUByte() + protected unsafe T ReadBigEndian() where T : struct { - byte[] data = new byte[4]; - Read(data, 0, 4); - - int ret; - fixed (byte *src = &data[0]){ - PutBytesBE ((byte *) &ret, src, 4); - } - return (byte)ret; - } - - public override unsafe int ReadInt32() - { - byte[] data = new byte[4]; - Read(data, 0, 4); - int ret; - fixed (byte *src = &data[0]){ - PutBytesBE ((byte *) &ret, src, 4); + Span data = stackalloc byte[Unsafe.SizeOf()]; + T ret = default; + Read(data); + if (BitConverter.IsLittleEndian) + { + data.Reverse(); } + data.CopyTo(new Span(Unsafe.AsPointer(ref ret), data.Length)); return ret; } + } - public override unsafe double ReadDouble() - { - byte[] data = new byte[8]; - Read(data, 0, 8); + internal class MonoBinaryWriter : BinaryWriter + { + public MonoBinaryWriter() : base(new MemoryStream(20)) {} - double ret; - fixed (byte *src = &data[0]){ - PutBytesBE ((byte *) &ret, src, 8); - } - return ret; + public override void Write(string val) + { + var bytes = Encoding.UTF8.GetBytes(val); + Write(bytes.Length); + Write(bytes); } - public override unsafe uint ReadUInt32() - { - byte[] data = new byte[4]; - Read(data, 0, 4); + public override void Write(long val) => WriteBigEndian(val); + public override void Write(int val) => WriteBigEndian(val); - uint ret; - fixed (byte *src = &data[0]){ - PutBytesBE ((byte *) &ret, src, 4); - } - return ret; - } - public unsafe ushort ReadUShort() + protected unsafe void WriteBigEndian(T val) where T : struct { - byte[] data = new byte[4]; - Read(data, 0, 4); - - uint ret; - fixed (byte *src = &data[0]){ - PutBytesBE ((byte *) &ret, src, 4); + Span data = stackalloc byte[Unsafe.SizeOf()]; + new Span(Unsafe.AsPointer(ref val), data.Length).CopyTo(data); + if (BitConverter.IsLittleEndian) + { + data.Reverse(); } - return (ushort)ret; + base.Write(data); } - } - internal class MonoBinaryWriter : BinaryWriter - { - public MonoBinaryWriter(Stream stream) : base(stream) {} - public void WriteString(string val) - { - Write(val.Length); - Write(val.ToCharArray()); - } - public void WriteLong(long val) - { - Write((int)((val >> 32) & 0xffffffff)); - Write((int)((val >> 0) & 0xffffffff)); - } - public override void Write(int val) + private void Write(ElementType type, T value) where T : struct => Write((byte)type, value); + + private void Write(T1 type, T2 value) where T1 : struct where T2 : struct { - byte[] bytes = BitConverter.GetBytes(val); - Array.Reverse(bytes, 0, bytes.Length); - Write(bytes); + WriteBigEndian(type); + WriteBigEndian(value); } + public void WriteObj(DotnetObjectId objectId, MonoSDBHelper SdbHelper) { if (objectId.Scheme == "object") { - Write((byte)ElementType.Class); - Write(int.Parse(objectId.Value)); + Write(ElementType.Class, int.Parse(objectId.Value)); } - if (objectId.Scheme == "valuetype") + else if (objectId.Scheme == "valuetype") { Write(SdbHelper.valueTypes[int.Parse(objectId.Value)].valueTypeBuffer); } } - public async Task WriteConst(SessionId sessionId, LiteralExpressionSyntax constValue, MonoSDBHelper SdbHelper, CancellationToken token) + public async Task WriteConst(LiteralExpressionSyntax constValue, MonoSDBHelper SdbHelper, CancellationToken token) { switch (constValue.Kind()) { case SyntaxKind.NumericLiteralExpression: { - Write((byte)ElementType.I4); - Write((int)constValue.Token.Value); + switch (constValue.Token.Value) { + case double d: + Write(ElementType.R8, d); + break; + case float f: + Write(ElementType.R4, f); + break; + case long l: + Write(ElementType.I8, l); + break; + case ulong ul: + Write(ElementType.U8, ul); + break; + case byte b: + Write(ElementType.U1, (int)b); + break; + case sbyte sb: + Write(ElementType.I1, (uint)sb); + break; + case ushort us: + Write(ElementType.U2, (int)us); + break; + case short s: + Write(ElementType.I2, (uint)s); + break; + case uint ui: + Write(ElementType.U4, ui); + break; + case IntPtr ip: + Write(ElementType.I, (int)ip); + break; + case UIntPtr up: + Write(ElementType.U, (uint)up); + break; + default: + Write(ElementType.I4, (int)constValue.Token.Value); + break; + } return true; } case SyntaxKind.StringLiteralExpression: { - int stringId = await SdbHelper.CreateString(sessionId, (string)constValue.Token.Value, token); - Write((byte)ElementType.String); - Write((int)stringId); + int stringId = await SdbHelper.CreateString((string)constValue.Token.Value, token); + Write(ElementType.String, stringId); return true; } case SyntaxKind.TrueLiteralExpression: { - Write((byte)ElementType.Boolean); - Write((int)1); + Write(ElementType.Boolean, 1); return true; } case SyntaxKind.FalseLiteralExpression: { - Write((byte)ElementType.Boolean); - Write((int)0); + Write(ElementType.Boolean, 0); return true; } case SyntaxKind.NullLiteralExpression: @@ -559,38 +592,31 @@ public async Task WriteConst(SessionId sessionId, LiteralExpressionSyntax } case SyntaxKind.CharacterLiteralExpression: { - Write((byte)ElementType.Char); - Write((int)(char)constValue.Token.Value); + Write(ElementType.Char, (int)(char)constValue.Token.Value); return true; } } return false; } - public async Task WriteJsonValue(SessionId sessionId, JObject objValue, MonoSDBHelper SdbHelper, CancellationToken token) + public async Task WriteJsonValue(JObject objValue, MonoSDBHelper SdbHelper, CancellationToken token) { switch (objValue["type"].Value()) { case "number": { - Write((byte)ElementType.I4); - Write(objValue["value"].Value()); + Write(ElementType.I4, objValue["value"].Value()); return true; } case "string": { - int stringId = await SdbHelper.CreateString(sessionId, objValue["value"].Value(), token); - Write((byte)ElementType.String); - Write((int)stringId); + int stringId = await SdbHelper.CreateString(objValue["value"].Value(), token); + Write(ElementType.String, stringId); return true; } case "boolean": { - Write((byte)ElementType.Boolean); - if (objValue["value"].Value()) - Write((int)1); - else - Write((int)0); + Write(ElementType.Boolean, objValue["value"].Value() ? 1 : 0); return true; } case "object": @@ -602,6 +628,17 @@ public async Task WriteJsonValue(SessionId sessionId, JObject objValue, Mo } return false; } + + public ArraySegment GetParameterBuffer() + { + ((MemoryStream)BaseStream).TryGetBuffer(out var segment); + return segment; + } + + public (string data, int length) ToBase64() { + var segment = GetParameterBuffer(); + return (Convert.ToBase64String(segment), segment.Count); + } } internal class FieldTypeClass { @@ -669,14 +706,16 @@ internal class MonoSDBHelper private MonoProxy proxy; private DebugStore store; + private SessionId sessionId; private readonly ILogger logger; private Regex regexForAsyncLocals = new Regex(@"\<([^)]*)\>", RegexOptions.Singleline); - public MonoSDBHelper(MonoProxy proxy, ILogger logger) + public MonoSDBHelper(MonoProxy proxy, ILogger logger, SessionId sessionId) { this.proxy = proxy; this.logger = logger; + this.sessionId = sessionId; ResetStore(null); } @@ -689,20 +728,20 @@ public void ResetStore(DebugStore store) ClearCache(); } - public async Task GetAssemblyInfo(SessionId sessionId, int assemblyId, CancellationToken token) + public async Task GetAssemblyInfo(int assemblyId, CancellationToken token) { AssemblyInfo asm = null; if (assemblies.TryGetValue(assemblyId, out asm)) { return asm; } - var assemblyName = await GetAssemblyName(sessionId, assemblyId, token); + var assemblyName = await GetAssemblyName(assemblyId, token); asm = store.GetAssemblyByName(assemblyName); if (asm == null) { - assemblyName = await GetAssemblyFileNameFromId(sessionId, assemblyId, token); //maybe is a lazy loaded assembly + assemblyName = await GetAssemblyFileNameFromId(assemblyId, token); //maybe is a lazy loaded assembly asm = store.GetAssemblyByName(assemblyName); if (asm == null) { @@ -715,17 +754,17 @@ public async Task GetAssemblyInfo(SessionId sessionId, int assembl return asm; } - public async Task GetMethodInfo(SessionId sessionId, int methodId, CancellationToken token) + public async Task GetMethodInfo(int methodId, CancellationToken token) { MethodInfoWithDebugInformation methodDebugInfo = null; if (methods.TryGetValue(methodId, out methodDebugInfo)) { return methodDebugInfo; } - var methodToken = await GetMethodToken(sessionId, methodId, token); - var assemblyId = await GetAssemblyIdFromMethod(sessionId, methodId, token); + var methodToken = await GetMethodToken(methodId, token); + var assemblyId = await GetAssemblyIdFromMethod(methodId, token); - var asm = await GetAssemblyInfo(sessionId, assemblyId, token); + var asm = await GetAssemblyInfo(assemblyId, token); if (asm == null) { @@ -754,12 +793,12 @@ public async Task GetMethodInfo(SessionId sessio return null; } - string methodName = await GetMethodName(sessionId, methodId, token); + string methodName = await GetMethodName(methodId, token); methods[methodId] = new MethodInfoWithDebugInformation(method, methodId, methodName); return methods[methodId]; } - public async Task GetTypeInfo(SessionId sessionId, int typeId, CancellationToken token) + public async Task GetTypeInfo(int typeId, CancellationToken token) { TypeInfoWithDebugInformation typeDebugInfo = null; if (types.TryGetValue(typeId, out typeDebugInfo)) @@ -769,10 +808,10 @@ public async Task GetTypeInfo(SessionId sessionId, TypeInfo type = null; - var typeToken = await GetTypeToken(sessionId, typeId, token); - var typeName = await GetTypeName(sessionId, typeId, token); - var assemblyId = await GetAssemblyFromType(sessionId, typeId, token); - var asm = await GetAssemblyInfo(sessionId, assemblyId, token); + var typeToken = await GetTypeToken(typeId, token); + var typeName = await GetTypeName(typeId, token); + var assemblyId = await GetAssemblyFromType(typeId, token); + var asm = await GetAssemblyInfo(assemblyId, token); if (asm == null) { @@ -798,40 +837,29 @@ public void ClearCache() pointerValues = new Dictionary(); } - public async Task SetProtocolVersion(SessionId sessionId, CancellationToken token) + public async Task SetProtocolVersion(CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(MAJOR_VERSION); commandParamsWriter.Write(MINOR_VERSION); commandParamsWriter.Write((byte)0); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdVM.SetProtocolVersion, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdVM.SetProtocolVersion, commandParamsWriter, token); return true; } - public async Task EnableReceiveRequests(SessionId sessionId, EventKind eventKind, CancellationToken token) + public async Task EnableReceiveRequests(EventKind eventKind, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write((byte)eventKind); commandParamsWriter.Write((byte)SuspendPolicy.None); commandParamsWriter.Write((byte)0); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdEventRequest.Set, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdEventRequest.Set, commandParamsWriter, token); return true; } - internal async Task SendDebuggerAgentCommandInternal(SessionId sessionId, int command_set, int command, MemoryStream parms, CancellationToken token) - { - Result res = await proxy.SendMonoCommand(sessionId, MonoCommands.SendDebuggerAgentCommand(GetId(), command_set, command, Convert.ToBase64String(parms.ToArray())), token); - byte[] newBytes = Array.Empty(); - if (!res.IsErr) { - newBytes = Convert.FromBase64String(res.Value?["result"]?["value"]?["value"]?.Value()); - } - var retDebuggerCmd = new MemoryStream(newBytes); - var retDebuggerCmdReader = new MonoBinaryReader(retDebuggerCmd, res.IsErr); - return retDebuggerCmdReader; - } + internal async Task SendDebuggerAgentCommand(T command, MonoBinaryWriter arguments, CancellationToken token) => + MonoBinaryReader.From (await proxy.SendMonoCommand(sessionId, MonoCommands.SendDebuggerAgentCommand(proxy.RuntimeId, GetId(), (int)GetCommandSetForCommand(command), (int)(object)command, arguments?.ToBase64().data ?? string.Empty), token)); internal CommandSet GetCommandSetForCommand(T command) => command switch { @@ -853,99 +881,78 @@ internal CommandSet GetCommandSetForCommand(T command) => _ => throw new Exception ("Unknown CommandSet") }; - internal Task SendDebuggerAgentCommand(SessionId sessionId, T command, MemoryStream parms, CancellationToken token) where T : Enum => - SendDebuggerAgentCommandInternal(sessionId, (int)GetCommandSetForCommand(command), (int)(object)command, parms, token); - - internal Task SendDebuggerAgentCommandWithParms(SessionId sessionId, T command, MemoryStream parms, int type, string extraParm, CancellationToken token) where T : Enum => - SendDebuggerAgentCommandWithParmsInternal(sessionId, (int)GetCommandSetForCommand(command), (int)(object)command, parms, type, extraParm, token); - - internal async Task SendDebuggerAgentCommandWithParmsInternal(SessionId sessionId, int command_set, int command, MemoryStream parms, int type, string extraParm, CancellationToken token) - { - Result res = await proxy.SendMonoCommand(sessionId, MonoCommands.SendDebuggerAgentCommandWithParms(GetId(), command_set, command, Convert.ToBase64String(parms.ToArray()), parms.ToArray().Length, type, extraParm), token); - byte[] newBytes = Array.Empty(); - if (!res.IsErr) { - newBytes = Convert.FromBase64String(res.Value?["result"]?["value"]?["value"]?.Value()); - } - var retDebuggerCmd = new MemoryStream(newBytes); - var retDebuggerCmdReader = new MonoBinaryReader(retDebuggerCmd, res.IsErr); - return retDebuggerCmdReader; - } + internal async Task SendDebuggerAgentCommandWithParms(T command, (string data, int length) encoded, int type, string extraParm, CancellationToken token) => + MonoBinaryReader.From(await proxy.SendMonoCommand(sessionId, MonoCommands.SendDebuggerAgentCommandWithParms(proxy.RuntimeId, GetId(), (int)GetCommandSetForCommand(command), (int)(object)command, encoded.data, encoded.length, type, extraParm), token)); - public async Task CreateString(SessionId sessionId, string value, CancellationToken token) + public async Task CreateString(string value, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdAppDomain.GetRootDomain, commandParams, token); - var root_domain = retDebuggerCmdReader.ReadInt32(); - commandParamsWriter.Write(root_domain); - commandParamsWriter.WriteString(value); - retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdAppDomain.CreateString, commandParams, token); - return retDebuggerCmdReader.ReadInt32(); + using var commandParamsWriter = new MonoBinaryWriter(); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdAppDomain.GetRootDomain, commandParamsWriter, token); + var root = retDebuggerCmdReader.ReadInt32(); + commandParamsWriter.Write(root); + commandParamsWriter.Write(value); + using var stringDebuggerCmdReader = await SendDebuggerAgentCommand(CmdAppDomain.CreateString, commandParamsWriter, token); + return stringDebuggerCmdReader.ReadInt32(); } - public async Task GetMethodToken(SessionId sessionId, int methodId, CancellationToken token) + public async Task GetMethodToken(int methodId, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(methodId); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdMethod.Token, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdMethod.Token, commandParamsWriter, token); return retDebuggerCmdReader.ReadInt32() & 0xffffff; //token } - public async Task MakeGenericMethod(SessionId sessionId, int methodId, List genericTypes, CancellationToken token) + public async Task MakeGenericMethod(int methodId, List genericTypes, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(methodId); commandParamsWriter.Write(genericTypes.Count); foreach (var genericType in genericTypes) { commandParamsWriter.Write(genericType); } - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdMethod.MakeGenericMethod, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdMethod.MakeGenericMethod, commandParamsWriter, token); return retDebuggerCmdReader.ReadInt32(); } - public async Task GetMethodIdByToken(SessionId sessionId, int assembly_id, int method_token, CancellationToken token) + public async Task GetMethodIdByToken(int assembly_id, int method_token, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(assembly_id); commandParamsWriter.Write(method_token | (int)TokenType.MdtMethodDef); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdAssembly.GetMethodFromToken, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdAssembly.GetMethodFromToken, commandParamsWriter, token); return retDebuggerCmdReader.ReadInt32(); } - public async Task GetAssemblyIdFromType(SessionId sessionId, int type_id, CancellationToken token) + public async Task GetAssemblyIdFromType(int type_id, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(type_id); commandParamsWriter.Write((int) MonoTypeNameFormat.FormatReflection); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdType.GetInfo, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdType.GetInfo, commandParamsWriter, token); retDebuggerCmdReader.ReadString(); //namespace retDebuggerCmdReader.ReadString(); //name retDebuggerCmdReader.ReadString(); //formatted name return retDebuggerCmdReader.ReadInt32(); } - public async Task> GetTypeParamsOrArgsForGenericType(SessionId sessionId, int typeId, CancellationToken token) + public async Task> GetTypeParamsOrArgsForGenericType(int typeId, CancellationToken token) { - var typeInfo = await GetTypeInfo(sessionId, typeId, token); + var typeInfo = await GetTypeInfo(typeId, token); - if (typeInfo == null) + if (typeInfo is null) return null; if (typeInfo.TypeParamsOrArgsForGenericType != null) return typeInfo.TypeParamsOrArgsForGenericType; var ret = new List(); - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(typeId); commandParamsWriter.Write((int) MonoTypeNameFormat.FormatReflection); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdType.GetInfo, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdType.GetInfo, commandParamsWriter, token); retDebuggerCmdReader.ReadString(); //namespace retDebuggerCmdReader.ReadString(); //name @@ -975,129 +982,118 @@ public async Task> GetTypeParamsOrArgsForGenericType(SessionId session return ret; } - public async Task GetAssemblyIdFromMethod(SessionId sessionId, int methodId, CancellationToken token) + public async Task GetAssemblyIdFromMethod(int methodId, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(methodId); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdMethod.Assembly, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdMethod.Assembly, commandParamsWriter, token); return retDebuggerCmdReader.ReadInt32(); //assembly_id } - public async Task GetAssemblyId(SessionId sessionId, string asm_name, CancellationToken token) + public async Task GetAssemblyId(string asm_name, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); - commandParamsWriter.WriteString(asm_name); + using var commandParamsWriter = new MonoBinaryWriter(); + commandParamsWriter.Write(asm_name); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdVM.GetAssemblyByName, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdVM.GetAssemblyByName, commandParamsWriter, token); return retDebuggerCmdReader.ReadInt32(); } - public async Task GetAssemblyNameFromModule(SessionId sessionId, int moduleId, CancellationToken token) + public async Task GetAssemblyNameFromModule(int moduleId, CancellationToken token) { - var command_params = new MemoryStream(); - var command_params_writer = new MonoBinaryWriter(command_params); + using var command_params_writer = new MonoBinaryWriter(); command_params_writer.Write(moduleId); - var ret_debugger_cmd_reader = await SendDebuggerAgentCommand(sessionId, CmdModule.GetInfo, command_params, token); + using var ret_debugger_cmd_reader = await SendDebuggerAgentCommand(CmdModule.GetInfo, command_params_writer, token); ret_debugger_cmd_reader.ReadString(); return ret_debugger_cmd_reader.ReadString(); } - public async Task GetAssemblyName(SessionId sessionId, int assembly_id, CancellationToken token) + public async Task GetAssemblyName(int assembly_id, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(assembly_id); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdAssembly.GetLocation, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdAssembly.GetLocation, commandParamsWriter, token); return retDebuggerCmdReader.ReadString(); } - public async Task GetFullAssemblyName(SessionId sessionId, int assemblyId, CancellationToken token) + public async Task GetFullAssemblyName(int assemblyId, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(assemblyId); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdAssembly.GetName, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdAssembly.GetName, commandParamsWriter, token); var name = retDebuggerCmdReader.ReadString(); return name; } - public async Task GetAssemblyFileNameFromId(SessionId sessionId, int assemblyId, CancellationToken token) + public async Task GetAssemblyFileNameFromId(int assemblyId, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(assemblyId); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdAssembly.GetName, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdAssembly.GetName, commandParamsWriter, token); var name = retDebuggerCmdReader.ReadString(); return name.Remove(name.IndexOf(",")) + ".dll"; } - public async Task GetMethodName(SessionId sessionId, int methodId, CancellationToken token) + public async Task GetMethodName(int methodId, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(methodId); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdMethod.GetNameFull, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdMethod.GetNameFull, commandParamsWriter, token); var methodName = retDebuggerCmdReader.ReadString(); return methodName.Substring(methodName.IndexOf(":")+1); } - public async Task MethodIsStatic(SessionId sessionId, int methodId, CancellationToken token) + public async Task MethodIsStatic(int methodId, CancellationToken token) { - var methodInfo = await GetMethodInfo(sessionId, methodId, token); + var methodInfo = await GetMethodInfo(methodId, token); if (methodInfo != null) return methodInfo.Info.IsStatic(); - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(methodId); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdMethod.GetInfo, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdMethod.GetInfo, commandParamsWriter, token); var flags = retDebuggerCmdReader.ReadInt32(); return (flags & 0x0010) > 0; //check method is static } - public async Task GetParamCount(SessionId sessionId, int methodId, CancellationToken token) + public async Task GetParamCount(int methodId, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(methodId); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdMethod.GetParamInfo, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdMethod.GetParamInfo, commandParamsWriter, token); retDebuggerCmdReader.ReadInt32(); int param_count = retDebuggerCmdReader.ReadInt32(); return param_count; } - public async Task GetReturnType(SessionId sessionId, int methodId, CancellationToken token) + public async Task GetReturnType(int methodId, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(methodId); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdMethod.GetParamInfo, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdMethod.GetParamInfo, commandParamsWriter, token); retDebuggerCmdReader.ReadInt32(); retDebuggerCmdReader.ReadInt32(); retDebuggerCmdReader.ReadInt32(); var retType = retDebuggerCmdReader.ReadInt32(); - var ret = await GetTypeName(sessionId, retType, token); + var ret = await GetTypeName(retType, token); return ret; } - public async Task GetParameters(SessionId sessionId, int methodId, CancellationToken token) + public async Task GetParameters(int methodId, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(methodId); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdMethod.GetParamInfo, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdMethod.GetParamInfo, commandParamsWriter, token); retDebuggerCmdReader.ReadInt32(); var paramCount = retDebuggerCmdReader.ReadInt32(); retDebuggerCmdReader.ReadInt32(); @@ -1106,7 +1102,7 @@ public async Task GetParameters(SessionId sessionId, int methodId, Cance for (int i = 0 ; i < paramCount; i++) { var paramType = retDebuggerCmdReader.ReadInt32(); - parameters += await GetTypeName(sessionId, paramType, token); + parameters += await GetTypeName(paramType, token); parameters = parameters.Replace("System.Func", "Func"); if (i + 1 < paramCount) parameters += ","; @@ -1115,38 +1111,35 @@ public async Task GetParameters(SessionId sessionId, int methodId, Cance return parameters; } - public async Task SetBreakpoint(SessionId sessionId, int methodId, long il_offset, CancellationToken token) + public async Task SetBreakpoint(int methodId, long il_offset, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write((byte)EventKind.Breakpoint); commandParamsWriter.Write((byte)SuspendPolicy.None); commandParamsWriter.Write((byte)1); commandParamsWriter.Write((byte)ModifierKind.LocationOnly); commandParamsWriter.Write(methodId); - commandParamsWriter.WriteLong(il_offset); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdEventRequest.Set, commandParams, token); + commandParamsWriter.Write(il_offset); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdEventRequest.Set, commandParamsWriter, token); return retDebuggerCmdReader.ReadInt32(); } - public async Task RemoveBreakpoint(SessionId sessionId, int breakpoint_id, CancellationToken token) + public async Task RemoveBreakpoint(int breakpoint_id, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write((byte)EventKind.Breakpoint); commandParamsWriter.Write((int) breakpoint_id); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdEventRequest.Clear, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdEventRequest.Clear, commandParamsWriter, token); if (retDebuggerCmdReader != null) return true; return false; } - public async Task Step(SessionId sessionId, int thread_id, StepKind kind, CancellationToken token) + public async Task Step(int thread_id, StepKind kind, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write((byte)EventKind.Step); commandParamsWriter.Write((byte)SuspendPolicy.None); commandParamsWriter.Write((byte)1); @@ -1154,9 +1147,9 @@ public async Task Step(SessionId sessionId, int thread_id, StepKind kind, commandParamsWriter.Write(thread_id); commandParamsWriter.Write((int)StepSize.Line); commandParamsWriter.Write((int)kind); - commandParamsWriter.Write((int)(StepFilter.StaticCtor | StepFilter.DebuggerHidden)); //filter - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdEventRequest.Set, commandParams, token); - if (retDebuggerCmdReader == null) + commandParamsWriter.Write((int)(StepFilter.StaticCtor)); //filter + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdEventRequest.Set, commandParamsWriter, token); + if (retDebuggerCmdReader.HasError) return false; var isBPOnManagedCode = retDebuggerCmdReader.ReadInt32(); if (isBPOnManagedCode == 0) @@ -1164,93 +1157,79 @@ public async Task Step(SessionId sessionId, int thread_id, StepKind kind, return true; } - public async Task ClearSingleStep(SessionId sessionId, int req_id, CancellationToken token) + public async Task ClearSingleStep(int req_id, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write((byte)EventKind.Step); commandParamsWriter.Write((int) req_id); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdEventRequest.Clear, commandParams, token); - - if (retDebuggerCmdReader != null) - return true; - return false; + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdEventRequest.Clear, commandParamsWriter, token); + return !retDebuggerCmdReader.HasError ? true : false; } - public async Task GetFieldValue(SessionId sessionId, int typeId, int fieldId, CancellationToken token) + public async Task GetFieldValue(int typeId, int fieldId, CancellationToken token) { var ret = new List(); - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(typeId); commandParamsWriter.Write(1); commandParamsWriter.Write(fieldId); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdType.GetValues, commandParams, token); - return await CreateJObjectForVariableValue(sessionId, retDebuggerCmdReader, "", false, -1, false, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdType.GetValues, commandParamsWriter, token); + return await CreateJObjectForVariableValue(retDebuggerCmdReader, "", false, -1, false, token); } - public async Task TypeIsInitialized(SessionId sessionId, int typeId, CancellationToken token) + public async Task TypeIsInitialized(int typeId, CancellationToken token) { var ret = new List(); - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(typeId); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdType.IsInitialized, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdType.IsInitialized, commandParamsWriter, token); return retDebuggerCmdReader.ReadInt32(); } - public async Task TypeInitialize(SessionId sessionId, int typeId, CancellationToken token) + public async Task TypeInitialize(int typeId, CancellationToken token) { var ret = new List(); - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(typeId); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdType.Initialize, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdType.Initialize, commandParamsWriter, token); return retDebuggerCmdReader.ReadInt32(); } - public async Task GetTypePropertiesReader(SessionId sessionId, int typeId, CancellationToken token) + public async Task GetTypePropertiesReader(int typeId, CancellationToken token) { - var typeInfo = await GetTypeInfo(sessionId, typeId, token); + var typeInfo = await GetTypeInfo(typeId, token); - if (typeInfo == null) + if (typeInfo is null) return null; - if (typeInfo.PropertiesBuffer != null) - { - var retDebuggerCmd = new MemoryStream(typeInfo.PropertiesBuffer); - var retDebuggerCmdReader = new MonoBinaryReader(retDebuggerCmd); - return retDebuggerCmdReader; - } + if (typeInfo.PropertiesBuffer is not null) + return new MonoBinaryReader(typeInfo.PropertiesBuffer); - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(typeId); - var reader = await SendDebuggerAgentCommand(sessionId, CmdType.GetProperties, commandParams, token); - typeInfo.PropertiesBuffer = reader.ReadBytes((int)reader.BaseStream.Length); - reader.BaseStream.Position = 0; + var reader = await SendDebuggerAgentCommand(CmdType.GetProperties, commandParamsWriter, token); + typeInfo.PropertiesBuffer = ((MemoryStream)reader.BaseStream).ToArray(); return reader; } - public async Task> GetTypeFields(SessionId sessionId, int typeId, CancellationToken token) + public async Task> GetTypeFields(int typeId, CancellationToken token) { - var typeInfo = await GetTypeInfo(sessionId, typeId, token); + var typeInfo = await GetTypeInfo(typeId, token); if (typeInfo.FieldsList != null) { return typeInfo.FieldsList; } var ret = new List(); - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(typeId); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdType.GetFields, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdType.GetFields, commandParamsWriter, token); var nFields = retDebuggerCmdReader.ReadInt32(); for (int i = 0 ; i < nFields; i++) @@ -1277,39 +1256,42 @@ public async Task> GetTypeFields(SessionId sessionId, int t return ret; } - public string ReplaceCommonClassNames(string className) - { - className = className.Replace("System.String", "string"); - className = className.Replace("System.Boolean", "bool"); - className = className.Replace("System.Char", "char"); - className = className.Replace("System.Int32", "int"); - className = className.Replace("System.Object", "object"); - className = className.Replace("System.Void", "void"); - className = className.Replace("System.Byte", "byte"); - return className; - } - - internal async Task GetCAttrsFromType(SessionId sessionId, int objectId, int typeId, string attrName, CancellationToken token) - { - var invokeParams = new MemoryStream(); - var invokeParamsWriter = new MonoBinaryWriter(invokeParams); - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + public string ReplaceCommonClassNames(string className) => + new StringBuilder(className) + .Replace("System.String", "string") + .Replace("System.Boolean", "bool") + .Replace("System.Char", "char") + .Replace("System.SByte", "sbyte") + .Replace("System.Int32", "int") + .Replace("System.Int64", "long") + .Replace("System.Single", "float") + .Replace("System.Double", "double") + .Replace("System.Byte", "byte") + .Replace("System.UInt16", "ushort") + .Replace("System.UInt32", "uint") + .Replace("System.UInt64", "ulong") + .Replace("System.Object", "object") + .Replace("System.Void", "void") + //.Replace("System.Decimal", "decimal") + .ToString(); + + internal async Task GetCAttrsFromType(int objectId, int typeId, string attrName, CancellationToken token) + { + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(typeId); commandParamsWriter.Write(0); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdType.GetCattrs, commandParams, token); + var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdType.GetCattrs, commandParamsWriter, token); var count = retDebuggerCmdReader.ReadInt32(); if (count == 0) return null; for (int i = 0 ; i < count; i++) { var methodId = retDebuggerCmdReader.ReadInt32(); - commandParams = new MemoryStream(); - commandParamsWriter = new MonoBinaryWriter(commandParams); - commandParamsWriter.Write(methodId); - var retDebuggerCmdReader2 = await SendDebuggerAgentCommand(sessionId, CmdMethod.GetDeclaringType, commandParams, token); + using var commandCattrParamsWriter = new MonoBinaryWriter(); + commandCattrParamsWriter.Write(methodId); + using var retDebuggerCmdReader2 = await SendDebuggerAgentCommand(CmdMethod.GetDeclaringType, commandCattrParamsWriter, token); var customAttributeTypeId = retDebuggerCmdReader2.ReadInt32(); - var customAttributeName = await GetTypeName(sessionId, customAttributeTypeId, token); + var customAttributeName = await GetTypeName(customAttributeTypeId, token); if (customAttributeName == attrName) return retDebuggerCmdReader; @@ -1320,20 +1302,19 @@ internal async Task GetCAttrsFromType(SessionId sessionId, int for (int j = 0; j < parmCount; j++) { //to typed_args - await CreateJObjectForVariableValue(sessionId, retDebuggerCmdReader, "varName", false, -1, false, token); + await CreateJObjectForVariableValue(retDebuggerCmdReader, "varName", false, -1, false, token); } } } return null; } - public async Task GetAssemblyFromType(SessionId sessionId, int type_id, CancellationToken token) + public async Task GetAssemblyFromType(int type_id, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(type_id); commandParamsWriter.Write((int) MonoTypeNameFormat.FormatReflection); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdType.GetInfo, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdType.GetInfo, commandParamsWriter, token); retDebuggerCmdReader.ReadString(); retDebuggerCmdReader.ReadString(); @@ -1342,28 +1323,23 @@ public async Task GetAssemblyFromType(SessionId sessionId, int type_id, Can return retDebuggerCmdReader.ReadInt32(); } - public async Task GetValueFromDebuggerDisplayAttribute(SessionId sessionId, int objectId, int typeId, CancellationToken token) + public async Task GetValueFromDebuggerDisplayAttribute(int objectId, int typeId, CancellationToken token) { string expr = ""; try { - var getCAttrsRetReader = await GetCAttrsFromType(sessionId, objectId, typeId, "System.Diagnostics.DebuggerDisplayAttribute", token); + var getCAttrsRetReader = await GetCAttrsFromType(objectId, typeId, "System.Diagnostics.DebuggerDisplayAttribute", token); if (getCAttrsRetReader == null) return null; - var invokeParams = new MemoryStream(); - var invokeParamsWriter = new MonoBinaryWriter(invokeParams); - invokeParamsWriter.Write((byte)ValueTypeId.Null); - invokeParamsWriter.Write((byte)0); //not used - invokeParamsWriter.Write(0); //not used var parmCount = getCAttrsRetReader.ReadInt32(); var monoType = (ElementType) getCAttrsRetReader.ReadByte(); //MonoTypeEnum -> MONO_TYPE_STRING if (monoType != ElementType.String) return null; var stringId = getCAttrsRetReader.ReadInt32(); - var dispAttrStr = await GetStringValue(sessionId, stringId, token); + var dispAttrStr = await GetStringValue(stringId, token); ExecutionContext context = proxy.GetContext(sessionId); - JArray objectValues = await GetObjectValues(sessionId, objectId, GetObjectCommandOptions.WithProperties | GetObjectCommandOptions.ForDebuggerDisplayAttribute, token); + JArray objectValues = await GetObjectValues(objectId, GetObjectCommandOptions.WithProperties | GetObjectCommandOptions.ForDebuggerDisplayAttribute, token); var thisObj = CreateJObject(value: "", type: "object", description: "", writable: false, objectId: $"dotnet:object:{objectId}"); thisObj["name"] = "this"; @@ -1390,17 +1366,18 @@ public async Task GetValueFromDebuggerDisplayAttribute(SessionId session } catch (Exception) { - logger.LogDebug($"Could not evaluate DebuggerDisplayAttribute - {expr} - {await GetTypeName(sessionId, typeId, token)}"); + logger.LogDebug($"Could not evaluate DebuggerDisplayAttribute - {expr} - {await GetTypeName(typeId, token)}"); } return null; } - public async Task GetTypeName(SessionId sessionId, int typeId, CancellationToken token) + public async Task GetTypeName(int typeId, CancellationToken token) { - string className = await GetTypeNameOriginal(sessionId, typeId, token); + string className = await GetTypeNameOriginal(typeId, token); className = className.Replace("+", "."); className = Regex.Replace(className, @"`\d+", ""); - className = className.Replace("[]", "__SQUARED_BRACKETS__"); + className = Regex.Replace(className, @"[[, ]+]", "__SQUARED_BRACKETS__"); + //className = className.Replace("[]", "__SQUARED_BRACKETS__"); className = className.Replace("[", "<"); className = className.Replace("]", ">"); className = className.Replace("__SQUARED_BRACKETS__", "[]"); @@ -1409,25 +1386,23 @@ public async Task GetTypeName(SessionId sessionId, int typeId, Cancellat return className; } - public async Task GetTypeNameOriginal(SessionId sessionId, int typeId, CancellationToken token) + public async Task GetTypeNameOriginal(int typeId, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(typeId); commandParamsWriter.Write((int) MonoTypeNameFormat.FormatReflection); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdType.GetInfo, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdType.GetInfo, commandParamsWriter, token); retDebuggerCmdReader.ReadString(); //namespace retDebuggerCmdReader.ReadString(); //class name return retDebuggerCmdReader.ReadString(); //class name formatted } - public async Task GetTypeToken(SessionId sessionId, int typeId, CancellationToken token) + public async Task GetTypeToken(int typeId, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(typeId); commandParamsWriter.Write((int) MonoTypeNameFormat.FormatReflection); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdType.GetInfo, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdType.GetInfo, commandParamsWriter, token); retDebuggerCmdReader.ReadString(); //namespace retDebuggerCmdReader.ReadString(); //class name retDebuggerCmdReader.ReadString(); //class name formatted @@ -1438,138 +1413,133 @@ public async Task GetTypeToken(SessionId sessionId, int typeId, Cancellatio return retDebuggerCmdReader.ReadInt32(); //token } - public async Task GetStringValue(SessionId sessionId, int string_id, CancellationToken token) + public async Task GetStringValue(int string_id, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(string_id); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdString.GetValue, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdString.GetValue, commandParamsWriter, token); var isUtf16 = retDebuggerCmdReader.ReadByte(); if (isUtf16 == 0) { return retDebuggerCmdReader.ReadString(); } return null; } - public async Task GetArrayLength(SessionId sessionId, int object_id, CancellationToken token) + public async Task GetArrayDimensions(int object_id, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(object_id); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdArray.GetLength, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdArray.GetLength, commandParamsWriter, token); var length = retDebuggerCmdReader.ReadInt32(); - length = retDebuggerCmdReader.ReadInt32(); - return length; + var rank = new int[length]; + for (int i = 0 ; i < length; i++) + { + rank[i] = retDebuggerCmdReader.ReadInt32(); + retDebuggerCmdReader.ReadInt32(); //lower_bound + } + return new ArrayDimensions(rank); } - public async Task> GetTypeIdFromObject(SessionId sessionId, int object_id, bool withParents, CancellationToken token) + public async Task> GetTypeIdFromObject(int object_id, bool withParents, CancellationToken token) { List ret = new List(); - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(object_id); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdObject.RefGetType, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdObject.RefGetType, commandParamsWriter, token); var type_id = retDebuggerCmdReader.ReadInt32(); ret.Add(type_id); if (withParents) { - commandParams = new MemoryStream(); - commandParamsWriter = new MonoBinaryWriter(commandParams); - commandParamsWriter.Write(type_id); - retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdType.GetParents, commandParams, token); - var parentsCount = retDebuggerCmdReader.ReadInt32(); + using var commandParentsParamsWriter = new MonoBinaryWriter(); + commandParentsParamsWriter.Write(type_id); + using var parentsCmdReader = await SendDebuggerAgentCommand(CmdType.GetParents, commandParentsParamsWriter, token); + var parentsCount = parentsCmdReader.ReadInt32(); for (int i = 0 ; i < parentsCount; i++) { - ret.Add(retDebuggerCmdReader.ReadInt32()); + ret.Add(parentsCmdReader.ReadInt32()); } } return ret; } - public async Task GetClassNameFromObject(SessionId sessionId, int object_id, CancellationToken token) + public async Task GetClassNameFromObject(int object_id, CancellationToken token) { - var type_id = await GetTypeIdFromObject(sessionId, object_id, false, token); - return await GetTypeName(sessionId, type_id[0], token); + var type_id = await GetTypeIdFromObject(object_id, false, token); + return await GetTypeName(type_id[0], token); } - public async Task GetTypeIdFromToken(SessionId sessionId, int assemblyId, int typeToken, CancellationToken token) + public async Task GetTypeIdFromToken(int assemblyId, int typeToken, CancellationToken token) { var ret = new List(); - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write((int)assemblyId); commandParamsWriter.Write((int)typeToken); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdAssembly.GetTypeFromToken, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdAssembly.GetTypeFromToken, commandParamsWriter, token); return retDebuggerCmdReader.ReadInt32(); } - public async Task GetMethodIdByName(SessionId sessionId, int type_id, string method_name, CancellationToken token) + public async Task GetMethodIdByName(int type_id, string method_name, CancellationToken token) { var ret = new List(); - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write((int)type_id); - commandParamsWriter.WriteString(method_name); + commandParamsWriter.Write(method_name); commandParamsWriter.Write((int)(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static)); commandParamsWriter.Write((int)1); //case sensitive - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdType.GetMethodsByNameFlags, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdType.GetMethodsByNameFlags, commandParamsWriter, token); var nMethods = retDebuggerCmdReader.ReadInt32(); return retDebuggerCmdReader.ReadInt32(); } - public async Task IsDelegate(SessionId sessionId, int objectId, CancellationToken token) + public async Task IsDelegate(int objectId, CancellationToken token) { var ret = new List(); - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write((int)objectId); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdObject.RefIsDelegate, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdObject.RefIsDelegate, commandParamsWriter, token); return retDebuggerCmdReader.ReadByte() == 1; } - public async Task GetDelegateMethod(SessionId sessionId, int objectId, CancellationToken token) + public async Task GetDelegateMethod(int objectId, CancellationToken token) { var ret = new List(); - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write((int)objectId); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdObject.RefDelegateGetMethod, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdObject.RefDelegateGetMethod, commandParamsWriter, token); return retDebuggerCmdReader.ReadInt32(); } - public async Task GetDelegateMethodDescription(SessionId sessionId, int objectId, CancellationToken token) + public async Task GetDelegateMethodDescription(int objectId, CancellationToken token) { - var methodId = await GetDelegateMethod(sessionId, objectId, token); + var methodId = await GetDelegateMethod(objectId, token); - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(methodId); //Console.WriteLine("methodId - " + methodId); if (methodId == 0) return ""; - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdMethod.GetName, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdMethod.GetName, commandParamsWriter, token); var methodName = retDebuggerCmdReader.ReadString(); - var returnType = await GetReturnType(sessionId, methodId, token); - var parameters = await GetParameters(sessionId, methodId, token); + var returnType = await GetReturnType(methodId, token); + var parameters = await GetParameters(methodId, token); return $"{returnType} {methodName} {parameters}"; } - public async Task InvokeMethod(SessionId sessionId, byte[] valueTypeBuffer, int methodId, string varName, CancellationToken token) + public async Task InvokeMethod(ArraySegment valueTypeBuffer, int methodId, string varName, CancellationToken token) { - MemoryStream parms = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(parms); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(methodId); commandParamsWriter.Write(valueTypeBuffer); commandParamsWriter.Write(0); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdVM.InvokeMethod, parms, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdVM.InvokeMethod, commandParamsWriter, token); retDebuggerCmdReader.ReadByte(); //number of objects returned. - return await CreateJObjectForVariableValue(sessionId, retDebuggerCmdReader, varName, false, -1, false, token); + return await CreateJObjectForVariableValue(retDebuggerCmdReader, varName, false, -1, false, token); } - public async Task GetPropertyMethodIdByName(SessionId sessionId, int typeId, string propertyName, CancellationToken token) + public async Task GetPropertyMethodIdByName(int typeId, string propertyName, CancellationToken token) { - var retDebuggerCmdReader = await GetTypePropertiesReader(sessionId, typeId, token); + using var retDebuggerCmdReader = await GetTypePropertiesReader(typeId, token); if (retDebuggerCmdReader == null) return -1; @@ -1589,10 +1559,10 @@ public async Task GetPropertyMethodIdByName(SessionId sessionId, int typeId return -1; } - public async Task CreateJArrayForProperties(SessionId sessionId, int typeId, byte[] object_buffer, JArray attributes, bool isAutoExpandable, string objectId, bool isOwn, CancellationToken token) + public async Task CreateJArrayForProperties(int typeId, ArraySegment object_buffer, JArray attributes, bool isAutoExpandable, string objectId, bool isOwn, CancellationToken token) { JArray ret = new JArray(); - var retDebuggerCmdReader = await GetTypePropertiesReader(sessionId, typeId, token); + using var retDebuggerCmdReader = await GetTypePropertiesReader(typeId, token); if (retDebuggerCmdReader == null) return null; @@ -1604,7 +1574,7 @@ public async Task CreateJArrayForProperties(SessionId sessionId, int typ var getMethodId = retDebuggerCmdReader.ReadInt32(); retDebuggerCmdReader.ReadInt32(); //setmethod var attrs = retDebuggerCmdReader.ReadInt32(); //attrs - if (getMethodId == 0 || await GetParamCount(sessionId, getMethodId, token) != 0 || await MethodIsStatic(sessionId, getMethodId, token)) + if (getMethodId == 0 || await GetParamCount(getMethodId, token) != 0 || await MethodIsStatic(getMethodId, token)) continue; JObject propRet = null; if (attributes.Where(attribute => attribute["name"].Value().Equals(propertyNameStr)).Any()) @@ -1612,7 +1582,7 @@ public async Task CreateJArrayForProperties(SessionId sessionId, int typ if (isAutoExpandable) { try { - propRet = await InvokeMethod(sessionId, object_buffer, getMethodId, propertyNameStr, token); + propRet = await InvokeMethod(object_buffer, getMethodId, propertyNameStr, token); } catch (Exception) { @@ -1640,28 +1610,26 @@ public async Task CreateJArrayForProperties(SessionId sessionId, int typ } return ret; } - public async Task GetPointerContent(SessionId sessionId, int pointerId, CancellationToken token) + public async Task GetPointerContent(int pointerId, CancellationToken token) { var ret = new List(); - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); - commandParamsWriter.WriteLong(pointerValues[pointerId].address); + using var commandParamsWriter = new MonoBinaryWriter(); + commandParamsWriter.Write(pointerValues[pointerId].address); commandParamsWriter.Write(pointerValues[pointerId].typeId); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdPointer.GetValue, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdPointer.GetValue, commandParamsWriter, token); var varName = pointerValues[pointerId].varName; if (int.TryParse(varName, out _)) varName = $"[{varName}]"; - return await CreateJObjectForVariableValue(sessionId, retDebuggerCmdReader, "*" + varName, false, -1, false, token); + return await CreateJObjectForVariableValue(retDebuggerCmdReader, "*" + varName, false, -1, false, token); } - public async Task GetPropertiesValuesOfValueType(SessionId sessionId, int valueTypeId, CancellationToken token) + public async Task GetPropertiesValuesOfValueType(int valueTypeId, CancellationToken token) { JArray ret = new JArray(); var valueType = valueTypes[valueTypeId]; - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(valueType.typeId); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdType.GetParents, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdType.GetParents, commandParamsWriter, token); var parentsCount = retDebuggerCmdReader.ReadInt32(); List typesToGetProperties = new List(); typesToGetProperties.Add(valueType.typeId); @@ -1671,7 +1639,7 @@ public async Task GetPropertiesValuesOfValueType(SessionId sessionId, in } for (int i = 0 ; i < typesToGetProperties.Count; i++) { - var properties = await CreateJArrayForProperties(sessionId, typesToGetProperties[i], valueType.valueTypeBuffer, valueType.valueTypeJson, valueType.valueTypeAutoExpand, $"dotnet:valuetype:{valueType.Id}", i == 0, token); + var properties = await CreateJArrayForProperties(typesToGetProperties[i], valueType.valueTypeBuffer, valueType.valueTypeJson, valueType.valueTypeAutoExpand, $"dotnet:valuetype:{valueType.Id}", i == 0, token); ret = new JArray(ret.Union(properties)); } @@ -1740,17 +1708,17 @@ public JObject CreateJObjectForChar(int value) return CreateJObject(description, "symbol", description, true); } - public async Task CreateJObjectForPtr(SessionId sessionId, ElementType etype, MonoBinaryReader retDebuggerCmdReader, string name, CancellationToken token) + public async Task CreateJObjectForPtr(ElementType etype, MonoBinaryReader retDebuggerCmdReader, string name, CancellationToken token) { string type; string value; - long valueAddress = retDebuggerCmdReader.ReadLong(); + long valueAddress = retDebuggerCmdReader.ReadInt64(); var typeId = retDebuggerCmdReader.ReadInt32(); var className = ""; if (etype == ElementType.FnPtr) className = "(*())"; //to keep the old behavior else - className = "(" + await GetTypeName(sessionId, typeId, token) + ")"; + className = "(" + await GetTypeName(typeId, token) + ")"; int pointerId = 0; if (valueAddress != 0 && className != "(void*)") @@ -1768,43 +1736,48 @@ public async Task CreateJObjectForPtr(SessionId sessionId, ElementType return CreateJObject(value, type, value, false, className, $"dotnet:pointer:{pointerId}", "pointer"); } - public async Task CreateJObjectForString(SessionId sessionId, MonoBinaryReader retDebuggerCmdReader, CancellationToken token) + public async Task CreateJObjectForString(MonoBinaryReader retDebuggerCmdReader, CancellationToken token) { var string_id = retDebuggerCmdReader.ReadInt32(); - var value = await GetStringValue(sessionId, string_id, token); + var value = await GetStringValue(string_id, token); return CreateJObject(value, "string", value, false); } - public async Task CreateJObjectForArray(SessionId sessionId, MonoBinaryReader retDebuggerCmdReader, CancellationToken token) + public async Task CreateJObjectForArray(MonoBinaryReader retDebuggerCmdReader, CancellationToken token) { var objectId = retDebuggerCmdReader.ReadInt32(); - var value = await GetClassNameFromObject(sessionId, objectId, token); - var length = await GetArrayLength(sessionId, objectId, token); - return CreateJObject(null, "object", $"{value.ToString()}({length})", false, value.ToString(), "dotnet:array:" + objectId, null, "array"); + var className = await GetClassNameFromObject(objectId, token); + var arrayType = className.ToString(); + var length = await GetArrayDimensions(objectId, token); + if (arrayType.LastIndexOf('[') > 0) + arrayType = arrayType.Insert(arrayType.LastIndexOf('[')+1, length.ToString()); + if (className.LastIndexOf('[') > 0) + className = className.Insert(arrayType.LastIndexOf('[')+1, new string(',', length.Rank-1)); + return CreateJObject(null, "object", description : arrayType, writable : false, className.ToString(), "dotnet:array:" + objectId, null, subtype : length.Rank == 1 ? "array" : null); } - public async Task CreateJObjectForObject(SessionId sessionId, MonoBinaryReader retDebuggerCmdReader, int typeIdFromAttribute, bool forDebuggerDisplayAttribute, CancellationToken token) + public async Task CreateJObjectForObject(MonoBinaryReader retDebuggerCmdReader, int typeIdFromAttribute, bool forDebuggerDisplayAttribute, CancellationToken token) { var objectId = retDebuggerCmdReader.ReadInt32(); var className = ""; - var type_id = await GetTypeIdFromObject(sessionId, objectId, false, token); - className = await GetTypeName(sessionId, type_id[0], token); + var type_id = await GetTypeIdFromObject(objectId, false, token); + className = await GetTypeName(type_id[0], token); string debuggerDisplayAttribute = null; if (!forDebuggerDisplayAttribute) - debuggerDisplayAttribute = await GetValueFromDebuggerDisplayAttribute(sessionId, objectId, type_id[0], token); + debuggerDisplayAttribute = await GetValueFromDebuggerDisplayAttribute(objectId, type_id[0], token); var description = className.ToString(); if (debuggerDisplayAttribute != null) description = debuggerDisplayAttribute; - if (await IsDelegate(sessionId, objectId, token)) + if (await IsDelegate(objectId, token)) { if (typeIdFromAttribute != -1) { - className = await GetTypeName(sessionId, typeIdFromAttribute, token); + className = await GetTypeName(typeIdFromAttribute, token); } - description = await GetDelegateMethodDescription(sessionId, objectId, token); + description = await GetDelegateMethodDescription(objectId, token); if (description == "") { return CreateJObject(className.ToString(), "symbol", className.ToString(), false); @@ -1813,22 +1786,22 @@ public async Task CreateJObjectForObject(SessionId sessionId, MonoBinar return CreateJObject(null, "object", description, false, className, $"dotnet:object:{objectId}"); } - public async Task CreateJObjectForValueType(SessionId sessionId, MonoBinaryReader retDebuggerCmdReader, string name, long initialPos, CancellationToken token) + public async Task CreateJObjectForValueType(MonoBinaryReader retDebuggerCmdReader, string name, long initialPos, CancellationToken token) { JObject fieldValueType = null; var isEnum = retDebuggerCmdReader.ReadByte(); var isBoxed = retDebuggerCmdReader.ReadByte() == 1; var typeId = retDebuggerCmdReader.ReadInt32(); - var className = await GetTypeName(sessionId, typeId, token); + var className = await GetTypeName(typeId, token); var description = className; var numFields = retDebuggerCmdReader.ReadInt32(); - var fields = await GetTypeFields(sessionId, typeId, token); + var fields = await GetTypeFields(typeId, token); JArray valueTypeFields = new JArray(); if (className.IndexOf("System.Nullable<") == 0) //should we call something on debugger-agent to check??? { retDebuggerCmdReader.ReadByte(); //ignoring the boolean type var isNull = retDebuggerCmdReader.ReadInt32(); - var value = await CreateJObjectForVariableValue(sessionId, retDebuggerCmdReader, name, false, -1, false, token); + var value = await CreateJObjectForVariableValue(retDebuggerCmdReader, name, false, -1, false, token); if (isNull != 0) return value; else @@ -1836,7 +1809,7 @@ public async Task CreateJObjectForValueType(SessionId sessionId, MonoBi } for (int i = 0; i < numFields ; i++) { - fieldValueType = await CreateJObjectForVariableValue(sessionId, retDebuggerCmdReader, fields.ElementAt(i).Name, true, fields.ElementAt(i).TypeId, false, token); + fieldValueType = await CreateJObjectForVariableValue(retDebuggerCmdReader, fields.ElementAt(i).Name, true, fields.ElementAt(i).TypeId, false, token); valueTypeFields.Add(fieldValueType); } @@ -1849,8 +1822,8 @@ public async Task CreateJObjectForValueType(SessionId sessionId, MonoBi retDebuggerCmdReader.BaseStream.Position = endPos; valueTypes[valueTypeId] = new ValueTypeClass(name, valueTypeBuffer, valueTypeFields, typeId, AutoExpandable(className), valueTypeId); if (AutoInvokeToString(className) || isEnum == 1) { - int methodId = await GetMethodIdByName(sessionId, typeId, "ToString", token); - var retMethod = await InvokeMethod(sessionId, valueTypeBuffer, methodId, "methodRet", token); + int methodId = await GetMethodIdByName(typeId, "ToString", token); + var retMethod = await InvokeMethod(valueTypeBuffer, methodId, "methodRet", token); description = retMethod["value"]?["value"].Value(); if (className.Equals("System.Guid")) description = description.ToUpper(); //to keep the old behavior @@ -1861,7 +1834,7 @@ public async Task CreateJObjectForValueType(SessionId sessionId, MonoBi return CreateJObject(null, "object", description, false, className, $"dotnet:valuetype:{valueTypeId}", null, null, true, true, isEnum == 1); } - public async Task CreateJObjectForNull(SessionId sessionId, MonoBinaryReader retDebuggerCmdReader, CancellationToken token) + public async Task CreateJObjectForNull(MonoBinaryReader retDebuggerCmdReader, CancellationToken token) { string className = ""; ElementType variableType = (ElementType)retDebuggerCmdReader.ReadByte(); @@ -1871,7 +1844,7 @@ public async Task CreateJObjectForNull(SessionId sessionId, MonoBinaryR case ElementType.Class: { var type_id = retDebuggerCmdReader.ReadInt32(); - className = await GetTypeName(sessionId, type_id, token); + className = await GetTypeName(type_id, token); break; } @@ -1884,20 +1857,20 @@ public async Task CreateJObjectForNull(SessionId sessionId, MonoBinaryR var internal_type_id = retDebuggerCmdReader.ReadInt32(); } var type_id = retDebuggerCmdReader.ReadInt32(); - className = await GetTypeName(sessionId, type_id, token); + className = await GetTypeName(type_id, token); break; } default: { var type_id = retDebuggerCmdReader.ReadInt32(); - className = await GetTypeName(sessionId, type_id, token); + className = await GetTypeName(type_id, token); break; } } return CreateJObject(null, "object", className, false, className, null, null, "null"); } - public async Task CreateJObjectForVariableValue(SessionId sessionId, MonoBinaryReader retDebuggerCmdReader, string name, bool isOwn, int typeIdFromAttribute, bool forDebuggerDisplayAttribute, CancellationToken token) + public async Task CreateJObjectForVariableValue(MonoBinaryReader retDebuggerCmdReader, string name, bool isOwn, int typeIdFromAttribute, bool forDebuggerDisplayAttribute, CancellationToken token) { long initialPos = retDebuggerCmdReader == null ? 0 : retDebuggerCmdReader.BaseStream.Position; ElementType etype = (ElementType)retDebuggerCmdReader.ReadByte(); @@ -1955,7 +1928,7 @@ public async Task CreateJObjectForVariableValue(SessionId sessionId, Mo } case ElementType.R4: { - float value = BitConverter.Int32BitsToSingle(retDebuggerCmdReader.ReadInt32()); + float value = retDebuggerCmdReader.ReadSingle(); ret = CreateJObjectForNumber(value); break; } @@ -1967,15 +1940,13 @@ public async Task CreateJObjectForVariableValue(SessionId sessionId, Mo } case ElementType.I8: { - long value = retDebuggerCmdReader.ReadLong(); + long value = retDebuggerCmdReader.ReadInt64(); ret = CreateJObjectForNumber(value); break; } case ElementType.U8: { - ulong high = (ulong) retDebuggerCmdReader.ReadInt32(); - ulong low = (ulong) retDebuggerCmdReader.ReadInt32(); - var value = ((high << 32) | low); + ulong value = retDebuggerCmdReader.ReadUInt64(); ret = CreateJObjectForNumber(value); break; } @@ -1988,34 +1959,34 @@ public async Task CreateJObjectForVariableValue(SessionId sessionId, Mo case ElementType.FnPtr: case ElementType.Ptr: { - ret = await CreateJObjectForPtr(sessionId, etype, retDebuggerCmdReader, name, token); + ret = await CreateJObjectForPtr(etype, retDebuggerCmdReader, name, token); break; } case ElementType.String: { - ret = await CreateJObjectForString(sessionId, retDebuggerCmdReader, token); + ret = await CreateJObjectForString(retDebuggerCmdReader, token); break; } case ElementType.SzArray: case ElementType.Array: { - ret = await CreateJObjectForArray(sessionId, retDebuggerCmdReader, token); + ret = await CreateJObjectForArray(retDebuggerCmdReader, token); break; } case ElementType.Class: case ElementType.Object: { - ret = await CreateJObjectForObject(sessionId, retDebuggerCmdReader, typeIdFromAttribute, forDebuggerDisplayAttribute, token); + ret = await CreateJObjectForObject(retDebuggerCmdReader, typeIdFromAttribute, forDebuggerDisplayAttribute, token); break; } case ElementType.ValueType: { - ret = await CreateJObjectForValueType(sessionId, retDebuggerCmdReader, name, initialPos, token); + ret = await CreateJObjectForValueType(retDebuggerCmdReader, name, initialPos, token); break; } case (ElementType)ValueTypeId.Null: { - ret = await CreateJObjectForNull(sessionId, retDebuggerCmdReader, token); + ret = await CreateJObjectForNull(retDebuggerCmdReader, token); break; } case (ElementType)ValueTypeId.Type: @@ -2038,19 +2009,18 @@ public async Task CreateJObjectForVariableValue(SessionId sessionId, Mo return ret; } - public async Task IsAsyncMethod(SessionId sessionId, int methodId, CancellationToken token) + public async Task IsAsyncMethod(int methodId, CancellationToken token) { - var methodInfo = await GetMethodInfo(sessionId, methodId, token); + var methodInfo = await GetMethodInfo(methodId, token); if (methodInfo != null && methodInfo.Info.IsAsync != -1) { return methodInfo.Info.IsAsync == 1; } - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(methodId); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdMethod.AsyncDebugInfo, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdMethod.AsyncDebugInfo, commandParamsWriter, token); methodInfo.Info.IsAsync = retDebuggerCmdReader.ReadByte(); return methodInfo.Info.IsAsync == 1; } @@ -2067,7 +2037,7 @@ private bool IsClosureReferenceField (string fieldName) fieldName.StartsWith ("<>8__", StringComparison.Ordinal); } - public async Task GetHoistedLocalVariables(SessionId sessionId, int objectId, JArray asyncLocals, CancellationToken token) + public async Task GetHoistedLocalVariables(int objectId, JArray asyncLocals, CancellationToken token) { JArray asyncLocalsFull = new JArray(); List objectsAlreadyRead = new(); @@ -2086,8 +2056,8 @@ public async Task GetHoistedLocalVariables(SessionId sessionId, int obje { if (int.TryParse(dotnetObjectId.Value, out int objectIdToGetInfo) && !objectsAlreadyRead.Contains(objectIdToGetInfo)) { - var asyncLocalsFromObject = await GetObjectValues(sessionId, objectIdToGetInfo, GetObjectCommandOptions.WithProperties, token); - var hoistedLocalVariable = await GetHoistedLocalVariables(sessionId, objectIdToGetInfo, asyncLocalsFromObject, token); + var asyncLocalsFromObject = await GetObjectValues(objectIdToGetInfo, GetObjectCommandOptions.WithProperties, token); + var hoistedLocalVariable = await GetHoistedLocalVariables(objectIdToGetInfo, asyncLocalsFromObject, token); asyncLocalsFull = new JArray(asyncLocalsFull.Union(hoistedLocalVariable)); } } @@ -2111,11 +2081,9 @@ public async Task GetHoistedLocalVariables(SessionId sessionId, int obje return asyncLocalsFull; } - public async Task StackFrameGetValues(SessionId sessionId, MethodInfoWithDebugInformation method, int thread_id, int frame_id, VarInfo[] varIds, CancellationToken token) + public async Task StackFrameGetValues(MethodInfoWithDebugInformation method, int thread_id, int frame_id, VarInfo[] varIds, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); - MonoBinaryReader retDebuggerCmdReader = null; + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(thread_id); commandParamsWriter.Write(frame_id); commandParamsWriter.Write(varIds.Length); @@ -2124,27 +2092,27 @@ public async Task StackFrameGetValues(SessionId sessionId, MethodInfoWit commandParamsWriter.Write(var.Index); } - if (await IsAsyncMethod(sessionId, method.DebugId, token)) + if (await IsAsyncMethod(method.DebugId, token)) { - retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdFrame.GetThis, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdFrame.GetThis, commandParamsWriter, token); retDebuggerCmdReader.ReadByte(); //ignore type var objectId = retDebuggerCmdReader.ReadInt32(); - var asyncLocals = await GetObjectValues(sessionId, objectId, GetObjectCommandOptions.WithProperties, token); - asyncLocals = await GetHoistedLocalVariables(sessionId, objectId, asyncLocals, token); + var asyncLocals = await GetObjectValues(objectId, GetObjectCommandOptions.WithProperties, token); + asyncLocals = await GetHoistedLocalVariables(objectId, asyncLocals, token); return asyncLocals; } JArray locals = new JArray(); - retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdFrame.GetValues, commandParams, token); + using var localsDebuggerCmdReader = await SendDebuggerAgentCommand(CmdFrame.GetValues, commandParamsWriter, token); foreach (var var in varIds) { - var var_json = await CreateJObjectForVariableValue(sessionId, retDebuggerCmdReader, var.Name, false, -1, false, token); + var var_json = await CreateJObjectForVariableValue(localsDebuggerCmdReader, var.Name, false, -1, false, token); locals.Add(var_json); } if (!method.Info.IsStatic()) { - retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdFrame.GetThis, commandParams, token); - var var_json = await CreateJObjectForVariableValue(sessionId, retDebuggerCmdReader, "this", false, -1, false, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdFrame.GetThis, commandParamsWriter, token); + var var_json = await CreateJObjectForVariableValue(retDebuggerCmdReader, "this", false, -1, false, token); var_json.Add("fieldOffset", -1); locals.Add(var_json); } @@ -2152,11 +2120,11 @@ public async Task StackFrameGetValues(SessionId sessionId, MethodInfoWit } - public async Task GetValueTypeValues(SessionId sessionId, int valueTypeId, bool accessorPropertiesOnly, CancellationToken token) + public async Task GetValueTypeValues(int valueTypeId, bool accessorPropertiesOnly, CancellationToken token) { if (valueTypes[valueTypeId].valueTypeJsonProps == null) { - valueTypes[valueTypeId].valueTypeJsonProps = await GetPropertiesValuesOfValueType(sessionId, valueTypeId, token); + valueTypes[valueTypeId].valueTypeJsonProps = await GetPropertiesValuesOfValueType(valueTypeId, token); } if (accessorPropertiesOnly) return valueTypes[valueTypeId].valueTypeJsonProps; @@ -2164,13 +2132,13 @@ public async Task GetValueTypeValues(SessionId sessionId, int valueTypeI return ret; } - public async Task GetValueTypeProxy(SessionId sessionId, int valueTypeId, CancellationToken token) + public async Task GetValueTypeProxy(int valueTypeId, CancellationToken token) { if (valueTypes[valueTypeId].valueTypeProxy != null) return valueTypes[valueTypeId].valueTypeProxy; valueTypes[valueTypeId].valueTypeProxy = new JArray(valueTypes[valueTypeId].valueTypeJson); - var retDebuggerCmdReader = await GetTypePropertiesReader(sessionId, valueTypes[valueTypeId].typeId, token); + var retDebuggerCmdReader = await GetTypePropertiesReader(valueTypes[valueTypeId].typeId, token); if (retDebuggerCmdReader == null) return null; @@ -2184,19 +2152,19 @@ public async Task GetValueTypeProxy(SessionId sessionId, int valueTypeId var getMethodId = retDebuggerCmdReader.ReadInt32(); retDebuggerCmdReader.ReadInt32(); //setmethod retDebuggerCmdReader.ReadInt32(); //attrs - if (await MethodIsStatic(sessionId, getMethodId, token)) + if (await MethodIsStatic(getMethodId, token)) continue; - var command_params_to_proxy = new MemoryStream(); - var command_params_writer_to_proxy = new MonoBinaryWriter(command_params_to_proxy); + using var command_params_writer_to_proxy = new MonoBinaryWriter(); command_params_writer_to_proxy.Write(getMethodId); command_params_writer_to_proxy.Write(valueTypes[valueTypeId].valueTypeBuffer); command_params_writer_to_proxy.Write(0); + var (data, length) = command_params_writer_to_proxy.ToBase64(); valueTypes[valueTypeId].valueTypeProxy.Add(JObject.FromObject(new { get = JObject.FromObject(new { commandSet = CommandSet.Vm, command = CmdVM.InvokeMethod, - buffer = Convert.ToBase64String(command_params_to_proxy.ToArray()), - length = command_params_to_proxy.ToArray().Length + buffer = data, + length = length, }), name = propertyNameStr })); @@ -2204,24 +2172,35 @@ public async Task GetValueTypeProxy(SessionId sessionId, int valueTypeId return valueTypes[valueTypeId].valueTypeProxy; } - public async Task GetArrayValues(SessionId sessionId, int arrayId, CancellationToken token) + public async Task GetArrayValues(int arrayId, CancellationToken token) { - var length = await GetArrayLength(sessionId, arrayId, token); - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + var dimensions = await GetArrayDimensions(arrayId, token); + var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(arrayId); commandParamsWriter.Write(0); - commandParamsWriter.Write(length); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdArray.GetValues, commandParams, token); + commandParamsWriter.Write(dimensions.TotalLength); + var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdArray.GetValues, commandParamsWriter, token); JArray array = new JArray(); - for (int i = 0 ; i < length ; i++) + for (int i = 0 ; i < dimensions.TotalLength; i++) { - var var_json = await CreateJObjectForVariableValue(sessionId, retDebuggerCmdReader, i.ToString(), false, -1, false, token); + var var_json = await CreateJObjectForVariableValue(retDebuggerCmdReader, dimensions.GetArrayIndexString(i), isOwn : false, -1, forDebuggerDisplayAttribute : false, token); array.Add(var_json); } return array; } - public async Task EnableExceptions(SessionId sessionId, PauseOnExceptionsKind state, CancellationToken token) + + public async Task GetArrayValuesProxy(int arrayId, CancellationToken token) + { + var length = await GetArrayDimensions(arrayId, token); + var arrayProxy = JObject.FromObject(new + { + items = await GetArrayValues(arrayId, token), + dimensionsDetails = length.Bounds + }); + return arrayProxy; + } + + public async Task EnableExceptions(PauseOnExceptionsKind state, CancellationToken token) { if (state == PauseOnExceptionsKind.Unset) { @@ -2229,8 +2208,7 @@ public async Task EnableExceptions(SessionId sessionId, PauseOnExceptionsK return false; } - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write((byte)EventKind.Exception); commandParamsWriter.Write((byte)SuspendPolicy.None); commandParamsWriter.Write((byte)1); @@ -2249,29 +2227,27 @@ public async Task EnableExceptions(SessionId sessionId, PauseOnExceptionsK commandParamsWriter.Write((byte)1);//subclasses commandParamsWriter.Write((byte)0);//not_filtered_feature commandParamsWriter.Write((byte)0);//everything_else - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdEventRequest.Set, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdEventRequest.Set, commandParamsWriter, token); return true; } - public async Task GetTypeByName(SessionId sessionId, string typeToSearch, CancellationToken token) + public async Task GetTypeByName(string typeToSearch, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); - commandParamsWriter.WriteString(typeToSearch); - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdVM.GetTypes, commandParams, token); + using var commandParamsWriter = new MonoBinaryWriter(); + commandParamsWriter.Write(typeToSearch); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdVM.GetTypes, commandParamsWriter, token); var count = retDebuggerCmdReader.ReadInt32(); //count ret return retDebuggerCmdReader.ReadInt32(); } - public async Task GetValuesFromDebuggerProxyAttribute(SessionId sessionId, int objectId, int typeId, CancellationToken token) + public async Task GetValuesFromDebuggerProxyAttribute(int objectId, int typeId, CancellationToken token) { try { - var getCAttrsRetReader = await GetCAttrsFromType(sessionId, objectId, typeId, "System.Diagnostics.DebuggerTypeProxyAttribute", token); + var getCAttrsRetReader = await GetCAttrsFromType(objectId, typeId, "System.Diagnostics.DebuggerTypeProxyAttribute", token); var methodId = -1; if (getCAttrsRetReader == null) return null; - var invokeParams = new MemoryStream(); - var invokeParamsWriter = new MonoBinaryWriter(invokeParams); + using var invokeParamsWriter = new MonoBinaryWriter(); invokeParamsWriter.Write((byte)ValueTypeId.Null); invokeParamsWriter.Write((byte)0); //not used invokeParamsWriter.Write(0); //not used @@ -2283,23 +2259,22 @@ public async Task GetValuesFromDebuggerProxyAttribute(SessionId sessionI if ((ValueTypeId)monoTypeId != ValueTypeId.Type) continue; var cAttrTypeId = getCAttrsRetReader.ReadInt32(); - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(cAttrTypeId); - var className = await GetTypeNameOriginal(sessionId, cAttrTypeId, token); + var className = await GetTypeNameOriginal(cAttrTypeId, token); if (className.IndexOf('[') > 0) { className = className.Remove(className.IndexOf('[')); - var assemblyId = await GetAssemblyIdFromType(sessionId, cAttrTypeId, token); - var assemblyName = await GetFullAssemblyName(sessionId, assemblyId, token); + var assemblyId = await GetAssemblyIdFromType(cAttrTypeId, token); + var assemblyName = await GetFullAssemblyName(assemblyId, token); var typeToSearch = className; typeToSearch += "[["; //System.Collections.Generic.List`1[[System.Int32,mscorlib,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089]],mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - List genericTypeArgs = await GetTypeParamsOrArgsForGenericType(sessionId, typeId, token); + List genericTypeArgs = await GetTypeParamsOrArgsForGenericType(typeId, token); for (int k = 0; k < genericTypeArgs.Count; k++) { - var assemblyIdArg = await GetAssemblyIdFromType(sessionId, genericTypeArgs[k], token); - var assemblyNameArg = await GetFullAssemblyName(sessionId, assemblyIdArg, token); - var classNameArg = await GetTypeNameOriginal(sessionId, genericTypeArgs[k], token); + var assemblyIdArg = await GetAssemblyIdFromType(genericTypeArgs[k], token); + var assemblyNameArg = await GetFullAssemblyName(assemblyIdArg, token); + var classNameArg = await GetTypeNameOriginal(genericTypeArgs[k], token); typeToSearch += classNameArg +", " + assemblyNameArg; if (k + 1 < genericTypeArgs.Count) typeToSearch += "], ["; @@ -2308,43 +2283,43 @@ public async Task GetValuesFromDebuggerProxyAttribute(SessionId sessionI } typeToSearch += "]"; typeToSearch += ", " + assemblyName; - var genericTypeId = await GetTypeByName(sessionId, typeToSearch, token); + var genericTypeId = await GetTypeByName(typeToSearch, token); if (genericTypeId < 0) return null; - methodId = await GetMethodIdByName(sessionId, genericTypeId, ".ctor", token); + methodId = await GetMethodIdByName(genericTypeId, ".ctor", token); } else - methodId = await GetMethodIdByName(sessionId, cAttrTypeId, ".ctor", token); + methodId = await GetMethodIdByName(cAttrTypeId, ".ctor", token); invokeParamsWriter.Write((byte)ElementType.Object); invokeParamsWriter.Write(objectId); - var retMethod = await InvokeMethod(sessionId, invokeParams.ToArray(), methodId, "methodRet", token); + var retMethod = await InvokeMethod(invokeParamsWriter.GetParameterBuffer(), methodId, "methodRet", token); DotnetObjectId.TryParse(retMethod?["value"]?["objectId"]?.Value(), out DotnetObjectId dotnetObjectId); - var displayAttrs = await GetObjectValues(sessionId, int.Parse(dotnetObjectId.Value), GetObjectCommandOptions.WithProperties | GetObjectCommandOptions.ForDebuggerProxyAttribute, token); + var displayAttrs = await GetObjectValues(int.Parse(dotnetObjectId.Value), GetObjectCommandOptions.WithProperties | GetObjectCommandOptions.ForDebuggerProxyAttribute, token); return displayAttrs; } } catch (Exception e) { - logger.LogDebug($"Could not evaluate DebuggerTypeProxyAttribute of type {await GetTypeName(sessionId, typeId, token)} - {e}"); + logger.LogDebug($"Could not evaluate DebuggerTypeProxyAttribute of type {await GetTypeName(typeId, token)} - {e}"); } return null; } - public async Task GetObjectValues(SessionId sessionId, int objectId, GetObjectCommandOptions getCommandType, CancellationToken token) + public async Task GetObjectValues(int objectId, GetObjectCommandOptions getCommandType, CancellationToken token) { - var typeId = await GetTypeIdFromObject(sessionId, objectId, true, token); + var typeId = await GetTypeIdFromObject(objectId, true, token); if (!getCommandType.HasFlag(GetObjectCommandOptions.ForDebuggerDisplayAttribute)) { - var debuggerProxy = await GetValuesFromDebuggerProxyAttribute(sessionId, objectId, typeId[0], token); + var debuggerProxy = await GetValuesFromDebuggerProxyAttribute(objectId, typeId[0], token); if (debuggerProxy != null) return debuggerProxy; } - var className = await GetTypeName(sessionId, typeId[0], token); + var className = await GetTypeName(typeId[0], token); JArray ret = new JArray(); - if (await IsDelegate(sessionId, objectId, token)) + if (await IsDelegate(objectId, token)) { - var description = await GetDelegateMethodDescription(sessionId, objectId, token); + var description = await GetDelegateMethodDescription(objectId, token); var obj = JObject.FromObject(new { value = new @@ -2362,14 +2337,13 @@ public async Task GetObjectValues(SessionId sessionId, int objectId, Get { if (!getCommandType.HasFlag(GetObjectCommandOptions.AccessorPropertiesOnly)) { - className = await GetTypeName(sessionId, typeId[i], token); - var fields = await GetTypeFields(sessionId, typeId[i], token); + className = await GetTypeName(typeId[i], token); + var fields = await GetTypeFields(typeId[i], token); if (getCommandType.HasFlag(GetObjectCommandOptions.ForDebuggerProxyAttribute)) fields = fields.Where(field => field.IsPublic).ToList(); JArray objectFields = new JArray(); - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(objectId); commandParamsWriter.Write(fields.Count); foreach (var field in fields) @@ -2377,31 +2351,31 @@ public async Task GetObjectValues(SessionId sessionId, int objectId, Get commandParamsWriter.Write(field.Id); } - var retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdObject.RefGetValues, commandParams, token); + using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdObject.RefGetValues, commandParamsWriter, token); foreach (var field in fields) { long initialPos = retDebuggerCmdReader.BaseStream.Position; int valtype = retDebuggerCmdReader.ReadByte(); retDebuggerCmdReader.BaseStream.Position = initialPos; - var fieldValue = await CreateJObjectForVariableValue(sessionId, retDebuggerCmdReader, field.Name, i == 0, field.TypeId, getCommandType.HasFlag(GetObjectCommandOptions.ForDebuggerDisplayAttribute), token); + var fieldValue = await CreateJObjectForVariableValue(retDebuggerCmdReader, field.Name, i == 0, field.TypeId, getCommandType.HasFlag(GetObjectCommandOptions.ForDebuggerDisplayAttribute), token); if (ret.Where(attribute => attribute["name"].Value().Equals(fieldValue["name"].Value())).Any()) { continue; } if (getCommandType.HasFlag(GetObjectCommandOptions.WithSetter)) { - var command_params_to_set = new MemoryStream(); - var command_params_writer_to_set = new MonoBinaryWriter(command_params_to_set); + var command_params_writer_to_set = new MonoBinaryWriter(); command_params_writer_to_set.Write(objectId); command_params_writer_to_set.Write(1); command_params_writer_to_set.Write(field.Id); + var (data, length) = command_params_writer_to_set.ToBase64(); fieldValue.Add("set", JObject.FromObject(new { commandSet = CommandSet.ObjectRef, command = CmdObject.RefSetValues, - buffer = Convert.ToBase64String(command_params_to_set.ToArray()), + buffer = data, valtype, - length = command_params_to_set.ToArray().Length + length = length })); } objectFields.Add(fieldValue); @@ -2410,10 +2384,9 @@ public async Task GetObjectValues(SessionId sessionId, int objectId, Get } if (!getCommandType.HasFlag(GetObjectCommandOptions.WithProperties)) return ret; - var command_params_obj = new MemoryStream(); - var commandParamsObjWriter = new MonoBinaryWriter(command_params_obj); + using var commandParamsObjWriter = new MonoBinaryWriter(); commandParamsObjWriter.WriteObj(new DotnetObjectId("object", $"{objectId}"), this); - var props = await CreateJArrayForProperties(sessionId, typeId[i], command_params_obj.ToArray(), ret, getCommandType.HasFlag(GetObjectCommandOptions.ForDebuggerProxyAttribute), $"dotnet:object:{objectId}", i == 0, token); + var props = await CreateJArrayForProperties(typeId[i], commandParamsObjWriter.GetParameterBuffer(), ret, getCommandType.HasFlag(GetObjectCommandOptions.ForDebuggerProxyAttribute), $"dotnet:object:{objectId}", i == 0, token); ret = new JArray(ret.Union(props)); // ownProperties @@ -2431,7 +2404,7 @@ public async Task GetObjectValues(SessionId sessionId, int objectId, Get List> allFields = new List>(); for (int i = 0; i < typeId.Count; i++) { - var fields = await GetTypeFields(sessionId, typeId[i], token); + var fields = await GetTypeFields(typeId[i], token); allFields.Add(fields); } foreach (var item in ret) @@ -2459,13 +2432,13 @@ public async Task GetObjectValues(SessionId sessionId, int objectId, Get return ret; } - public async Task GetObjectProxy(SessionId sessionId, int objectId, CancellationToken token) + public async Task GetObjectProxy(int objectId, CancellationToken token) { - var ret = await GetObjectValues(sessionId, objectId, GetObjectCommandOptions.WithSetter, token); - var typeIds = await GetTypeIdFromObject(sessionId, objectId, true, token); + var ret = await GetObjectValues(objectId, GetObjectCommandOptions.WithSetter, token); + var typeIds = await GetTypeIdFromObject(objectId, true, token); foreach (var typeId in typeIds) { - var retDebuggerCmdReader = await GetTypePropertiesReader(sessionId, typeId, token); + var retDebuggerCmdReader = await GetTypePropertiesReader(typeId, token); if (retDebuggerCmdReader == null) return null; @@ -2482,64 +2455,63 @@ public async Task GetObjectProxy(SessionId sessionId, int objectId, Canc { var attr = ret.Where(attribute => attribute["name"].Value().Equals(propertyNameStr)).First(); - var command_params_to_set = new MemoryStream(); - var command_params_writer_to_set = new MonoBinaryWriter(command_params_to_set); + using var command_params_writer_to_set = new MonoBinaryWriter(); command_params_writer_to_set.Write(setMethodId); command_params_writer_to_set.Write((byte)ElementType.Class); command_params_writer_to_set.Write(objectId); command_params_writer_to_set.Write(1); + var (data, length) = command_params_writer_to_set.ToBase64(); + if (attr["set"] != null) { attr["set"] = JObject.FromObject(new { commandSet = CommandSet.Vm, command = CmdVM.InvokeMethod, - buffer = Convert.ToBase64String(command_params_to_set.ToArray()), + buffer = data, valtype = attr["set"]["valtype"], - length = command_params_to_set.ToArray().Length + length = length }); } continue; } else { - var command_params_to_get = new MemoryStream(); - var command_params_writer_to_get = new MonoBinaryWriter(command_params_to_get); + var command_params_writer_to_get = new MonoBinaryWriter(); command_params_writer_to_get.Write(getMethodId); command_params_writer_to_get.Write((byte)ElementType.Class); command_params_writer_to_get.Write(objectId); command_params_writer_to_get.Write(0); + var (data, length) = command_params_writer_to_get.ToBase64(); ret.Add(JObject.FromObject(new { get = JObject.FromObject(new { commandSet = CommandSet.Vm, command = CmdVM.InvokeMethod, - buffer = Convert.ToBase64String(command_params_to_get.ToArray()), - length = command_params_to_get.ToArray().Length + buffer = data, + length = length }), name = propertyNameStr })); } - if (await MethodIsStatic(sessionId, getMethodId, token)) + if (await MethodIsStatic(getMethodId, token)) continue; } } return ret; } - public async Task SetVariableValue(SessionId sessionId, int thread_id, int frame_id, int varId, string newValue, CancellationToken token) + public async Task SetVariableValue(int thread_id, int frame_id, int varId, string newValue, CancellationToken token) { - var commandParams = new MemoryStream(); - var commandParamsWriter = new MonoBinaryWriter(commandParams); - MonoBinaryReader retDebuggerCmdReader = null; + using var commandParamsWriter = new MonoBinaryWriter(); commandParamsWriter.Write(thread_id); commandParamsWriter.Write(frame_id); commandParamsWriter.Write(1); commandParamsWriter.Write(varId); JArray locals = new JArray(); - retDebuggerCmdReader = await SendDebuggerAgentCommand(sessionId, CmdFrame.GetValues, commandParams, token); - int etype = retDebuggerCmdReader.ReadByte(); - retDebuggerCmdReader = await SendDebuggerAgentCommandWithParms(sessionId, CmdFrame.SetValues, commandParams, etype, newValue, token); - if (retDebuggerCmdReader.HasError) + using var getDebuggerCmdReader = await SendDebuggerAgentCommand(CmdFrame.GetValues, commandParamsWriter, token); + int etype = getDebuggerCmdReader.ReadByte(); + using var setDebuggerCmdReader = await SendDebuggerAgentCommandWithParms(CmdFrame.SetValues, commandParamsWriter.ToBase64(), etype, newValue, token); + if (setDebuggerCmdReader.HasError) return false; return true; } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/ArrayTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/ArrayTests.cs index 7f685734cd9b9d..3d7cdf93ae5411 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/ArrayTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/ArrayTests.cs @@ -198,6 +198,24 @@ public async Task InspectGenericValueTypeArrayLocals2(int line, int col, string frame_idx: frame_idx, use_cfo: use_cfo); + async Task GetObjectWithCFO(string objectId, JObject fn_args = null) + { + var fn_decl = "function () { return this; }"; + var cfo_args = JObject.FromObject(new + { + functionDeclaration = fn_decl, + objectId = objectId + }); + + if (fn_args != null) + cfo_args["arguments"] = fn_args; + + // callFunctionOn + var result = await cli.SendCommand("Runtime.callFunctionOn", cfo_args, token); + + return await GetProperties(result.Value["result"]["objectId"]?.Value(), fn_args); + } + async Task TestSimpleArrayLocals(int line, int col, string entry_method_name, string method_name, string etype_name, string local_var_name_prefix, object[] array, object[] array_elem_props, bool test_prev_frame = false, int frame_idx = 0, bool use_cfo = false) @@ -215,8 +233,8 @@ async Task TestSimpleArrayLocals(int line, int col, string entry_method_name, st var locals = await GetProperties(pause_location["callFrames"][frame_idx]["callFrameId"].Value()); Assert.Equal(4, locals.Count()); - CheckArray(locals, $"{local_var_name_prefix}_arr", $"{etype_name}[]", array?.Length ?? 0); - CheckArray(locals, $"{local_var_name_prefix}_arr_empty", $"{etype_name}[]", 0); + CheckArray(locals, $"{local_var_name_prefix}_arr", $"{etype_name}[]", $"{etype_name}[{array?.Length ?? 0}]"); + CheckArray(locals, $"{local_var_name_prefix}_arr_empty", $"{etype_name}[]", $"{etype_name}[0]"); CheckObject(locals, $"{local_var_name_prefix}_arr_null", $"{etype_name}[]", is_null: true); CheckBool(locals, "call_other", test_prev_frame); @@ -264,24 +282,6 @@ async Task TestSimpleArrayLocals(int line, int col, string entry_method_name, st var props = await GetObjectOnFrame(pause_location["callFrames"][frame_idx], $"{local_var_name_prefix}_arr_empty"); await CheckProps(props, new object[0], "${local_var_name_prefix}_arr_empty"); - - async Task GetObjectWithCFO(string objectId, JObject fn_args = null) - { - var fn_decl = "function () { return this; }"; - var cfo_args = JObject.FromObject(new - { - functionDeclaration = fn_decl, - objectId = objectId - }); - - if (fn_args != null) - cfo_args["arguments"] = fn_args; - - // callFunctionOn - var result = await cli.SendCommand("Runtime.callFunctionOn", cfo_args, token); - - return await GetProperties(result.Value["result"]["objectId"]?.Value(), fn_args); - } } [Theory] @@ -313,10 +313,10 @@ public async Task InspectObjectArrayMembers(bool use_cfo) await CheckProps(c_props, new { id = TString("c#id"), - ClassArrayProperty = TArray("DebuggerTests.SimpleClass[]", 3), - ClassArrayField = TArray("DebuggerTests.SimpleClass[]", 3), - PointsProperty = TArray("DebuggerTests.Point[]", 2), - PointsField = TArray("DebuggerTests.Point[]", 2) + ClassArrayProperty = TArray("DebuggerTests.SimpleClass[]", "DebuggerTests.SimpleClass[3]"), + ClassArrayField = TArray("DebuggerTests.SimpleClass[]", "DebuggerTests.SimpleClass[3]"), + PointsProperty = TArray("DebuggerTests.Point[]", "DebuggerTests.Point[2]"), + PointsField = TArray("DebuggerTests.Point[]", "DebuggerTests.Point[2]") }, "c" ); @@ -382,8 +382,8 @@ public async Task InspectValueTypeArrayLocalsStaticAsync(bool use_cfo) await CheckProps(frame_locals, new { call_other = TBool(false), - gvclass_arr = TArray("DebuggerTests.SimpleGenericStruct[]", 2), - gvclass_arr_empty = TArray("DebuggerTests.SimpleGenericStruct[]"), + gvclass_arr = TArray("DebuggerTests.SimpleGenericStruct[]", "DebuggerTests.SimpleGenericStruct[2]"), + gvclass_arr_empty = TArray("DebuggerTests.SimpleGenericStruct[]", "DebuggerTests.SimpleGenericStruct[0]"), gvclass_arr_null = TObject("DebuggerTests.SimpleGenericStruct[]", is_null: true), gvclass = TValueType("DebuggerTests.SimpleGenericStruct"), // BUG: this shouldn't be null! @@ -448,7 +448,7 @@ public async Task InspectValueTypeArrayLocalsInstanceAsync(bool use_cfo) { t1 = TObject("DebuggerTests.SimpleGenericStruct"), @this = TObject("DebuggerTests.ArrayTestsClass"), - point_arr = TArray("DebuggerTests.Point[]", 2), + point_arr = TArray("DebuggerTests.Point[]", "DebuggerTests.Point[2]"), point = TValueType("DebuggerTests.Point") }, "InspectValueTypeArrayLocalsInstanceAsync#locals"); @@ -642,6 +642,59 @@ public async Task InvalidAccessors() => await CheckInspectLocalsAtBreakpointSite AssertEqual("undefined", res.Value["result"]?["type"]?.ToString(), "Expected to get undefined result for non-existant accessor"); } }); + + [Theory] + [InlineData(false)] + [InlineData(true)] + public async Task InspectPrimitiveTypeMultiArrayLocals(bool use_cfo) + { + var debugger_test_loc = "dotnet://debugger-test.dll/debugger-array-test.cs"; + + var eval_expr = "window.setTimeout(function() { invoke_static_method (" + + $"'[debugger-test] DebuggerTests.MultiDimensionalArray:run'" + + "); }, 1);"; + var pause_location = await EvaluateAndCheck(eval_expr, debugger_test_loc, 343, 12, "run"); + + var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); + Assert.Equal(3, locals.Count()); + var int_arr_1 = !use_cfo ? + await GetProperties(locals[0]["value"]["objectId"].Value()) : + await GetObjectWithCFO((locals[0]["value"]["objectId"].Value())); + + CheckNumber(int_arr_1, "0", 0); + CheckNumber(int_arr_1, "1", 1); + var int_arr_2 = !use_cfo ? + await GetProperties(locals[1]["value"]["objectId"].Value()) : + await GetObjectWithCFO((locals[1]["value"]["objectId"].Value())); + CheckNumber(int_arr_2, "0, 0", 0); + CheckNumber(int_arr_2, "0, 1", 1); + CheckNumber(int_arr_2, "0, 2", 2); + CheckNumber(int_arr_2, "1, 0", 10); + CheckNumber(int_arr_2, "1, 1", 11); + CheckNumber(int_arr_2, "1, 2", 12); + + var int_arr_3 = !use_cfo ? + await GetProperties(locals[2]["value"]["objectId"].Value()) : + await GetObjectWithCFO((locals[2]["value"]["objectId"].Value())); + CheckNumber(int_arr_3, "0, 0, 0", 0); + CheckNumber(int_arr_3, "0, 0, 1", 1); + CheckNumber(int_arr_3, "0, 0, 2", 2); + CheckNumber(int_arr_3, "0, 1, 0", 10); + CheckNumber(int_arr_3, "0, 1, 1", 11); + CheckNumber(int_arr_3, "0, 1, 2", 12); + CheckNumber(int_arr_3, "0, 2, 0", 20); + CheckNumber(int_arr_3, "0, 2, 1", 21); + CheckNumber(int_arr_3, "0, 2, 2", 22); + CheckNumber(int_arr_3, "1, 0, 0", 100); + CheckNumber(int_arr_3, "1, 0, 1", 101); + CheckNumber(int_arr_3, "1, 0, 2", 102); + CheckNumber(int_arr_3, "1, 1, 0", 110); + CheckNumber(int_arr_3, "1, 1, 1", 111); + CheckNumber(int_arr_3, "1, 1, 2", 112); + CheckNumber(int_arr_3, "1, 2, 0", 120); + CheckNumber(int_arr_3, "1, 2, 1", 121); + CheckNumber(int_arr_3, "1, 2, 2", 122); + } } } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/AssignmentTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/AssignmentTests.cs index 1afa97939d5ef1..0601552db6b606 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/AssignmentTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/AssignmentTests.cs @@ -19,7 +19,7 @@ public class AssignmentTests : DebuggerTestBase { "MONO_TYPE_CHAR", TSymbol("0 '\u0000'"), TSymbol("97 'a'") }, { "MONO_TYPE_STRING", TString(default), TString("hello") }, { "MONO_TYPE_ENUM", TEnum("DebuggerTests.RGB", "Red"), TEnum("DebuggerTests.RGB", "Blue") }, - { "MONO_TYPE_ARRAY", TObject("byte[]", is_null: true), TArray("byte[]", 2) }, + { "MONO_TYPE_ARRAY", TObject("byte[]", is_null: true), TArray("byte[]", "byte[2]") }, { "MONO_TYPE_VALUETYPE", TValueType("DebuggerTests.Point"), TValueType("DebuggerTests.Point") }, { "MONO_TYPE_VALUETYPE2", TValueType("System.Decimal","0"), TValueType("System.Decimal", "1.1") }, { "MONO_TYPE_GENERICINST", TObject("System.Func", is_null: true), TDelegate("System.Func", "int Prepare ()") }, diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs index 398df51a299dd2..f3bf3c8ecb4a6f 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs @@ -27,8 +27,8 @@ public async Task CreateGoodBreakpoint() Assert.NotNull(loc["scriptId"]); Assert.Equal("dotnet://debugger-test.dll/debugger-test.cs", scripts[loc["scriptId"]?.Value()]); - Assert.Equal(10, loc["lineNumber"]); - Assert.Equal(8, loc["columnNumber"]); + Assert.Equal(10, (int)loc["lineNumber"]); + Assert.Equal(8, (int)loc["columnNumber"]); } [Fact] @@ -36,7 +36,7 @@ public async Task CreateJSBreakpoint() { // Test that js breakpoints get set correctly // 13 24 - // 13 33 + // 13 53 var bp1_res = await SetBreakpoint("/debugger-driver.html", 13, 24); Assert.EndsWith("debugger-driver.html", bp1_res.Value["breakpointId"].ToString()); @@ -45,10 +45,10 @@ public async Task CreateJSBreakpoint() var loc = bp1_res.Value["locations"]?.Value()[0]; Assert.NotNull(loc["scriptId"]); - Assert.Equal(13, loc["lineNumber"]); - Assert.Equal(24, loc["columnNumber"]); + Assert.Equal(13, (int)loc["lineNumber"]); + Assert.Equal(24, (int)loc["columnNumber"]); - var bp2_res = await SetBreakpoint("/debugger-driver.html", 13, 33); + var bp2_res = await SetBreakpoint("/debugger-driver.html", 13, 53); Assert.EndsWith("debugger-driver.html", bp2_res.Value["breakpointId"].ToString()); Assert.Equal(1, bp2_res.Value["locations"]?.Value()?.Count); @@ -56,15 +56,15 @@ public async Task CreateJSBreakpoint() var loc2 = bp2_res.Value["locations"]?.Value()[0]; Assert.NotNull(loc2["scriptId"]); - Assert.Equal(13, loc2["lineNumber"]); - Assert.Equal(33, loc2["columnNumber"]); + Assert.Equal(13, (int)loc2["lineNumber"]); + Assert.Equal(53, (int)loc2["columnNumber"]); } [Fact] public async Task CreateJS0Breakpoint() { // 13 24 - // 13 33 + // 13 53 var bp1_res = await SetBreakpoint("/debugger-driver.html", 13, 0); Assert.EndsWith("debugger-driver.html", bp1_res.Value["breakpointId"].ToString()); @@ -73,10 +73,10 @@ public async Task CreateJS0Breakpoint() var loc = bp1_res.Value["locations"]?.Value()[0]; Assert.NotNull(loc["scriptId"]); - Assert.Equal(13, loc["lineNumber"]); - Assert.Equal(24, loc["columnNumber"]); + Assert.Equal(13, (int)loc["lineNumber"]); + Assert.Equal(4, (int)loc["columnNumber"]); - var bp2_res = await SetBreakpoint("/debugger-driver.html", 13, 33); + var bp2_res = await SetBreakpoint("/debugger-driver.html", 13, 53); Assert.EndsWith("debugger-driver.html", bp2_res.Value["breakpointId"].ToString()); Assert.Equal(1, bp2_res.Value["locations"]?.Value()?.Count); @@ -84,8 +84,8 @@ public async Task CreateJS0Breakpoint() var loc2 = bp2_res.Value["locations"]?.Value()[0]; Assert.NotNull(loc2["scriptId"]); - Assert.Equal(13, loc2["lineNumber"]); - Assert.Equal(33, loc2["columnNumber"]); + Assert.Equal(13, (int)loc2["lineNumber"]); + Assert.Equal(53, (int)loc2["columnNumber"]); } [Theory] @@ -651,12 +651,38 @@ public async Task DebuggerAttributeNoStopInDebuggerHidden() var bp_visible = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", "VisibleMethod", 1); Assert.Empty(bp_hidden.Value["locations"]); await EvaluateAndCheck( - "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerAttribute:VisibleMethod'); }, 1);", + "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerAttribute:Run'); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bp_visible.Value["locations"][0]["lineNumber"].Value(), bp_visible.Value["locations"][0]["columnNumber"].Value(), "VisibleMethod" ); } + + [Fact] + public async Task DebuggerAttributeStopOnDebuggerHiddenCallWithDebuggerBreakCall() + { + var bp_init = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", "RunDebuggerBreak", 0); + var init_location = await EvaluateAndCheck( + "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerAttribute:RunDebuggerBreak'); }, 1);", + "dotnet://debugger-test.dll/debugger-test.cs", + bp_init.Value["locations"][0]["lineNumber"].Value(), + bp_init.Value["locations"][0]["columnNumber"].Value(), + "RunDebuggerBreak" + ); + var pause_location = await SendCommandAndCheck(null, "Debugger.resume", + "dotnet://debugger-test.dll/debugger-test.cs", + bp_init.Value["locations"][0]["lineNumber"].Value() + 1, + 8, + "RunDebuggerBreak"); + Assert.Equal(init_location["callFrames"][0]["functionName"], pause_location["callFrames"][0]["functionName"]); + var id = pause_location["callFrames"][0]["callFrameId"].Value(); + await EvaluateOnCallFrame(id, "local_var", false); + await SendCommandAndCheck(null, "Debugger.resume", + "dotnet://debugger-test.dll/debugger-test.cs", + 835, + 8, + "VisibleMethodDebuggerBreak"); + } } } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/CallFunctionOnTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/CallFunctionOnTests.cs index d1e3a6511dd935..92e36a3bdca1e2 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/CallFunctionOnTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/CallFunctionOnTests.cs @@ -361,7 +361,7 @@ public async Task RunOnJSObject(bool roundtrip) => await RunCallFunctionOn( await CheckProps(obj_own_val, new { a_obj = TObject("Object"), - b_arr = TArray("Array", 2) + b_arr = TArray("Array", "Array(2)") }, "obj_own"); }); @@ -641,7 +641,7 @@ public async Task PropertyGettersTest(string eval_fn, string method_name, int li // Check arrays through getters res = await InvokeGetter(obj, get_args_fn(new[] { "IntArray" }), cfo_fn); - await CheckValue(res.Value["result"], TArray("int[]", 2), $"{local_name}.IntArray"); + await CheckValue(res.Value["result"], TArray("int[]", "int[2]"), $"{local_name}.IntArray"); { var arr_elems = await GetProperties(res.Value["result"]?["objectId"]?.Value()); var exp_elems = new[] @@ -654,7 +654,7 @@ public async Task PropertyGettersTest(string eval_fn, string method_name, int li } res = await InvokeGetter(obj, get_args_fn(new[] { "DTArray" }), cfo_fn); - await CheckValue(res.Value["result"], TArray("System.DateTime[]", 2), $"{local_name}.DTArray"); + await CheckValue(res.Value["result"], TArray("System.DateTime[]", "System.DateTime[2]"), $"{local_name}.DTArray"); { var dt0 = new DateTime(6, 7, 8, 9, 10, 11); var dt1 = new DateTime(1, 2, 3, 4, 5, 6); @@ -944,7 +944,7 @@ async Task CheckCFOResult(Result result) if (res_array_len < 0) await CheckValue(result.Value["result"], TObject("Object"), $"cfo-res"); else - await CheckValue(result.Value["result"], TArray("Array", res_array_len), $"cfo-res"); + await CheckValue(result.Value["result"], TArray("Array", $"Array({res_array_len})"), $"cfo-res"); } } } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/CustomViewTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/CustomViewTests.cs index 52087e598624fc..06516155b7d399 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/CustomViewTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/CustomViewTests.cs @@ -51,7 +51,7 @@ public async Task UsingDebuggerTypeProxy() var props = await GetObjectOnFrame(frame, "myList"); Assert.Equal(1, props.Count()); - CheckArray(props, "Items", "int[]", 4); + CheckArray(props, "Items", "int[]", "int[4]"); CheckObject(locals, "b", "DebuggerTests.WithProxy", description:"DebuggerTests.WithProxy"); props = await GetObjectOnFrame(frame, "b"); diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs index bd92af72637add..c94697133d5330 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs @@ -357,10 +357,10 @@ internal JToken CheckEnum(JToken locals, string name, string class_name, string return l; } - internal void CheckArray(JToken locals, string name, string class_name, int length) + internal void CheckArray(JToken locals, string name, string class_name, string description) => CheckValue( GetAndAssertObjectWithName(locals, name)["value"], - TArray(class_name, length), name).Wait(); + TArray(class_name, description), name).Wait(); internal JToken GetAndAssertObjectWithName(JToken obj, string name, string label = "") { @@ -841,6 +841,37 @@ internal async Task GetProperties(string id, JToken fn_args = null, bool return (null, res); } + internal async Task RuntimeEvaluateAndCheck(params (string expression, JObject expected)[] args) + { + foreach (var arg in args) + { + var (eval_val, _) = await RuntimeEvaluate(arg.expression); + try + { + await CheckValue(eval_val, arg.expected, arg.expression); + } + catch + { + Console.WriteLine($"CheckValue failed for {arg.expression}. Expected: {arg.expected}, vs {eval_val}"); + throw; + } + } + } + internal async Task<(JToken, Result)> RuntimeEvaluate(string expression, bool expect_ok = true) + { + var evaluate_req = JObject.FromObject(new + { + expression = expression + }); + + var res = await cli.SendCommand("Runtime.evaluate", evaluate_req, token); + AssertEqual(expect_ok, res.IsOk, $"Runtime.evaluate ('{expression}') returned {res.IsOk} instead of {expect_ok}, with Result: {res}"); + if (res.IsOk) + return (res.Value["result"], res); + + return (null, res); + } + internal async Task<(JToken, Result)> SetVariableValueOnCallFrame(JObject parms, bool expect_ok = true) { var res = await cli.SendCommand("Debugger.setVariableValue", parms, token); @@ -979,7 +1010,7 @@ internal static JObject TObject(string className, string description = null, boo JObject.FromObject(new { type = "object", className = className, description = description ?? className, subtype = is_null ? "null" : null }) : JObject.FromObject(new { type = "object", className = className, description = description ?? className }); - internal static JObject TArray(string className, int length = 0) => JObject.FromObject(new { type = "object", className = className, description = $"{className}({length})", subtype = "array" }); + internal static JObject TArray(string className, string description) => JObject.FromObject(new { type = "object", className, description, subtype = "array" }); internal static JObject TBool(bool value) => JObject.FromObject(new { type = "boolean", value = @value, description = @value ? "true" : "false" }); diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/DelegateTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/DelegateTests.cs index 2fc0fb52ce99f9..cdbee2079e72aa 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/DelegateTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/DelegateTests.cs @@ -32,19 +32,19 @@ await CheckInspectLocalsAtBreakpointSite( { fn_func = TDelegate("System.Func", "bool |(Math)"), fn_func_null = TObject("System.Func", is_null: true), - fn_func_arr = TArray("System.Func[]", 1), + fn_func_arr = TArray("System.Func[]", "System.Func[1]"), fn_del = TDelegate("Math.IsMathNull", "bool IsMathNullDelegateTarget (Math)"), fn_del_null = TObject("Math.IsMathNull", is_null: true), - fn_del_arr = TArray("Math.IsMathNull[]", 1), + fn_del_arr = TArray("Math.IsMathNull[]", "Math.IsMathNull[1]"), // Unused locals fn_func_unused = TDelegate("System.Func", "bool |(Math)"), fn_func_null_unused = TObject("System.Func", is_null: true), - fn_func_arr_unused = TArray("System.Func[]", 1), + fn_func_arr_unused = TArray("System.Func[]", "System.Func[1]"), fn_del_unused = TDelegate("Math.IsMathNull", "bool IsMathNullDelegateTarget (Math)"), fn_del_null_unused = TObject("Math.IsMathNull", is_null: true), - fn_del_arr_unused = TArray("Math.IsMathNull[]", 1), + fn_del_arr_unused = TArray("Math.IsMathNull[]", "Math.IsMathNull[1]"), res = TBool(false), m_obj = TObject("Math") @@ -105,7 +105,7 @@ public async Task InspectDelegateSignaturesWithFunc(int frame, int line, int col fn_func_null = TObject("System.Func>, Math.GenericStruct>", is_null: true), fn_func_only_ret = TDelegate("System.Func", "bool |()"), - fn_func_arr = TArray("System.Func>, Math.GenericStruct>[]", 1), + fn_func_arr = TArray("System.Func>, Math.GenericStruct>[]", "System.Func>, Math.GenericStruct>[1]"), fn_del = TDelegate("Math.DelegateForSignatureTest", "Math.GenericStruct DelegateTargetForSignatureTest (Math,Math.GenericStruct>)"), @@ -114,16 +114,16 @@ public async Task InspectDelegateSignaturesWithFunc(int frame, int line, int col "Math.GenericStruct |(Math,Math.GenericStruct>)"), fn_del_null = TObject("Math.DelegateForSignatureTest", is_null: true), - fn_del_arr = TArray("Math.DelegateForSignatureTest[]", 2), + fn_del_arr = TArray("Math.DelegateForSignatureTest[]", "Math.DelegateForSignatureTest[2]"), m_obj = TObject("Math"), gs_gs = TValueType("Math.GenericStruct>"), fn_void_del = TDelegate("Math.DelegateWithVoidReturn", "void DelegateTargetWithVoidReturn (Math.GenericStruct)"), - fn_void_del_arr = TArray("Math.DelegateWithVoidReturn[]", 1), + fn_void_del_arr = TArray("Math.DelegateWithVoidReturn[]", "Math.DelegateWithVoidReturn[1]"), fn_void_del_null = TObject("Math.DelegateWithVoidReturn", is_null: true), gs = TValueType("Math.GenericStruct"), - rets = TArray("Math.GenericStruct[]", 6) + rets = TArray("Math.GenericStruct[]", "Math.GenericStruct[6]") }, "locals"); await CompareObjectPropertiesFor(locals, "fn_func_arr", new[] @@ -176,7 +176,7 @@ public async Task ActionTSignatureTest(int frame, int line, int col, string bp_m fn_action_null = TObject("System.Action>", is_null: true), - fn_action_arr = TArray("System.Action>[]", 3), + fn_action_arr = TArray("System.Action>[]", "System.Action>[3]"), gs = TValueType("Math.GenericStruct"), }, "locals"); @@ -212,8 +212,8 @@ public async Task NestedDelegatesTest(int frame, int line, int col, string bp_me fn_func = TDelegate("System.Func, bool>", "bool |(Func)"), fn_func_null = TObject("System.Func, bool>", is_null: true), - fn_func_arr = TArray("System.Func, bool>[]", 1), - fn_del_arr = TArray("System.Func, bool>[]", 1), + fn_func_arr = TArray("System.Func, bool>[]", "System.Func, bool>[1]"), + fn_del_arr = TArray("System.Func, bool>[]", "System.Func, bool>[1]"), m_obj = TObject("Math"), fn_del_null = TObject("System.Func, bool>", is_null: true), @@ -253,7 +253,7 @@ public async Task DelegatesAsMethodArgsTest(int frame, int line, int col, string await CheckProps(locals, new { @this = TObject("Math"), - dst_arr = TArray("Math.DelegateForSignatureTest[]", 2), + dst_arr = TArray("Math.DelegateForSignatureTest[]", "Math.DelegateForSignatureTest[2]"), fn_func = TDelegate("System.Func", "bool |(char[])"), fn_action = TDelegate("System.Action[]>", @@ -284,7 +284,7 @@ public async Task MethodWithDelegatesAsyncTest(bool use_cfo) => await CheckInspe await CheckProps(locals, new { @this = TObject("Math"), - _dst_arr = TArray("Math.DelegateForSignatureTest[]", 2), + _dst_arr = TArray("Math.DelegateForSignatureTest[]", "Math.DelegateForSignatureTest[2]"), _fn_func = TDelegate("System.Func", "bool |(char[])"), _fn_action = TDelegate("System.Action[]>", diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs index 524ff68fb9e2db..600067a47be62b 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs @@ -36,6 +36,12 @@ public static IEnumerable InstanceMethodForTypeMembersTestData(string } } + public static IEnumerable EvaluateStaticClassFromStaticMethodTestData(string type_name) + { + yield return new object[] { type_name, "EvaluateAsyncMethods", "EvaluateAsyncMethods", true }; + yield return new object[] { type_name, "EvaluateMethods", "EvaluateMethods", false }; + } + [Theory] [MemberData(nameof(InstanceMethodForTypeMembersTestData), parameters: "DebuggerTests.EvaluateTestsStructWithProperties")] [MemberData(nameof(InstanceMethodForTypeMembersTestData), parameters: "DebuggerTests.EvaluateTestsClassWithProperties")] @@ -247,7 +253,7 @@ await EvaluateOnCallFrameAndCheck(id, [Fact] public async Task EvaluateSimpleExpressions() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateTestsClass:EvaluateLocals'); })", wait_for_event_fn: async (pause_location) => { @@ -426,7 +432,7 @@ await EvaluateOnCallFrameFail(id, [Fact] public async Task NegativeTestsInInstanceMethod() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateTestsClass:EvaluateLocals'); })", wait_for_event_fn: async (pause_location) => { @@ -461,7 +467,7 @@ public async Task NegativeTestsInStaticMethod() => await CheckInspectLocalsAtBre await EvaluateOnCallFrameFail(id, ("me.foo", "ReferenceError"), - ("this", "ReferenceError"), + ("this", "CompilationError"), ("this.NullIfAIsNotZero.foo", "ReferenceError")); }); @@ -489,7 +495,7 @@ async Task EvaluateOnCallFrameFail(string call_frame_id, params (string expressi [Fact] public async Task EvaluateSimpleMethodCallsError() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { @@ -513,7 +519,7 @@ public async Task EvaluateSimpleMethodCallsError() => await CheckInspectLocalsAt [Fact] public async Task EvaluateSimpleMethodCallsWithoutParms() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { @@ -530,7 +536,7 @@ await EvaluateOnCallFrameAndCheck(id, [Fact] public async Task EvaluateSimpleMethodCallsWithConstParms() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { @@ -542,6 +548,11 @@ await EvaluateOnCallFrameAndCheck(id, ("this.CallMethodWithParmBool(true)", TString("TRUE")), ("this.CallMethodWithParmBool(false)", TString("FALSE")), ("this.CallMethodWithParmString(\"concat\")", TString("str_const_concat")), + ("this.CallMethodWithParmString(\"\\\"\\\"\")", TString("str_const_\"\"")), + ("this.CallMethodWithParmString(\"🛶\")", TString("str_const_🛶")), + ("this.CallMethodWithParmString(\"\\uD83D\\uDEF6\")", TString("str_const_🛶")), + ("this.CallMethodWithParmString(\"🚀\")", TString("str_const_🚀")), + ("this.CallMethodWithParmString_λ(\"🚀\")", TString("λ_🚀")), ("this.CallMethodWithParm(10) + this.a", TNumber(12)), ("this.CallMethodWithObj(null)", TNumber(-1)), ("this.CallMethodWithChar('a')", TString("str_const_a"))); @@ -549,7 +560,7 @@ await EvaluateOnCallFrameAndCheck(id, [Fact] public async Task EvaluateSimpleMethodCallsWithVariableParms() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { @@ -659,7 +670,7 @@ await EvaluateOnCallFrameAndCheck(id, [Fact] public async Task EvaluateSimpleMethodCallsCheckChangedValue() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { @@ -679,7 +690,7 @@ await EvaluateOnCallFrameAndCheck(id, [Fact] public async Task EvaluateStaticClass() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { @@ -695,9 +706,107 @@ await EvaluateOnCallFrameAndCheck(id, ("DebuggerTests.EvaluateStaticClass.StaticPropertyWithError", TString("System.Exception: not implemented"))); }); + [Theory] + [MemberData(nameof(EvaluateStaticClassFromStaticMethodTestData), parameters: "DebuggerTests.EvaluateMethodTestsClass")] + // [MemberData(nameof(EvaluateStaticClassFromStaticMethodTestData), parameters: "EvaluateMethodTestsClass")] + public async Task EvaluateStaticClassFromStaticMethod(string type, string method, string bp_function_name, bool is_async) + => await CheckInspectLocalsAtBreakpointSite( + type, method, 1, bp_function_name, + $"window.setTimeout(function() {{ invoke_static_method ('[debugger-test] {type}:{method}'); }})", + wait_for_event_fn: async (pause_location) => + { + var id = pause_location["callFrames"][0]["callFrameId"].Value(); + + var frame = pause_location["callFrames"][0]; + + await EvaluateOnCallFrameAndCheck(id, + ("EvaluateStaticClass.StaticField1", TNumber(10)), + ("EvaluateStaticClass.StaticProperty1", TString("StaticProperty1")), + ("EvaluateStaticClass.StaticPropertyWithError", TString("System.Exception: not implemented")), + ("DebuggerTests.EvaluateStaticClass.StaticField1", TNumber(10)), + ("DebuggerTests.EvaluateStaticClass.StaticProperty1", TString("StaticProperty1")), + ("DebuggerTests.EvaluateStaticClass.StaticPropertyWithError", TString("System.Exception: not implemented"))); + }); + + [Fact] + public async Task EvaluateNonStaticClassWithStaticFields() => await CheckInspectLocalsAtBreakpointSite( + "DebuggerTests.EvaluateMethodTestsClass", "EvaluateAsyncMethods", 3, "EvaluateAsyncMethods", + "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateAsyncMethods'); })", + wait_for_event_fn: async (pause_location) => + { + var id = pause_location["callFrames"][0]["callFrameId"].Value(); + + var frame = pause_location["callFrames"][0]; + + await EvaluateOnCallFrameAndCheck(id, + ("DebuggerTests.EvaluateNonStaticClassWithStaticFields.StaticField1", TNumber(10)), + ("DebuggerTests.EvaluateNonStaticClassWithStaticFields.StaticProperty1", TString("StaticProperty1")), + ("DebuggerTests.EvaluateNonStaticClassWithStaticFields.StaticPropertyWithError", TString("System.Exception: not implemented")), + ("EvaluateNonStaticClassWithStaticFields.StaticField1", TNumber(10)), + ("EvaluateNonStaticClassWithStaticFields.StaticProperty1", TString("StaticProperty1")), + ("EvaluateNonStaticClassWithStaticFields.StaticPropertyWithError", TString("System.Exception: not implemented"))); + }); + + [Fact] + public async Task EvaluateStaticClassesNested() => await CheckInspectLocalsAtBreakpointSite( + "DebuggerTests.EvaluateMethodTestsClass", "EvaluateMethods", 3, "EvaluateMethods", + "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", + wait_for_event_fn: async (pause_location) => + { + var id = pause_location["callFrames"][0]["callFrameId"].Value(); + + var frame = pause_location["callFrames"][0]; + + await EvaluateOnCallFrameAndCheck(id, + ("DebuggerTests.EvaluateStaticClass.NestedClass1.NestedClass2.NestedClass3.StaticField1", TNumber(3)), + ("DebuggerTests.EvaluateStaticClass.NestedClass1.NestedClass2.NestedClass3.StaticProperty1", TString("StaticProperty3")), + ("DebuggerTests.EvaluateStaticClass.NestedClass1.NestedClass2.NestedClass3.StaticPropertyWithError", TString("System.Exception: not implemented 3")), + ("EvaluateStaticClass.NestedClass1.NestedClass2.NestedClass3.StaticField1", TNumber(3)), + ("EvaluateStaticClass.NestedClass1.NestedClass2.NestedClass3.StaticProperty1", TString("StaticProperty3")), + ("EvaluateStaticClass.NestedClass1.NestedClass2.NestedClass3.StaticPropertyWithError", TString("System.Exception: not implemented 3"))); + }); + + [Fact] + public async Task EvaluateStaticClassesNestedWithNoNamespace() => await CheckInspectLocalsAtBreakpointSite( + "NoNamespaceClass", "EvaluateMethods", 1, "EvaluateMethods", + "window.setTimeout(function() { invoke_static_method ('[debugger-test] NoNamespaceClass:EvaluateMethods'); })", + wait_for_event_fn: async (pause_location) => + { + var id = pause_location["callFrames"][0]["callFrameId"].Value(); + + var frame = pause_location["callFrames"][0]; + + await EvaluateOnCallFrameAndCheck(id, + ("NoNamespaceClass.NestedClass1.NestedClass2.NestedClass3.StaticField1", TNumber(30)), + ("NoNamespaceClass.NestedClass1.NestedClass2.NestedClass3.StaticProperty1", TString("StaticProperty30")), + ("NoNamespaceClass.NestedClass1.NestedClass2.NestedClass3.StaticPropertyWithError", TString("System.Exception: not implemented 30"))); + }); + + [Fact] + public async Task EvaluateStaticClassesFromDifferentNamespaceInDifferentFrames() => await CheckInspectLocalsAtBreakpointSite( + "DebuggerTestsV2.EvaluateStaticClass", "Run", 1, "Run", + "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", + wait_for_event_fn: async (pause_location) => + { + var id_top = pause_location["callFrames"][0]["callFrameId"].Value(); + var frame = pause_location["callFrames"][0]; + + await EvaluateOnCallFrameAndCheck(id_top, + ("EvaluateStaticClass.StaticField1", TNumber(20)), + ("EvaluateStaticClass.StaticProperty1", TString("StaticProperty2")), + ("EvaluateStaticClass.StaticPropertyWithError", TString("System.Exception: not implemented"))); + + var id_second = pause_location["callFrames"][1]["callFrameId"].Value(); + + await EvaluateOnCallFrameAndCheck(id_second, + ("EvaluateStaticClass.StaticField1", TNumber(10)), + ("EvaluateStaticClass.StaticProperty1", TString("StaticProperty1")), + ("EvaluateStaticClass.StaticPropertyWithError", TString("System.Exception: not implemented"))); + }); + [Fact] public async Task EvaluateStaticClassInvalidField() => await CheckInspectLocalsAtBreakpointSite( - "DebuggerTests.EvaluateMethodTestsClass/TestEvaluate", "run", 9, "run", + "DebuggerTests.EvaluateMethodTestsClass.TestEvaluate", "run", 9, "run", "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateMethodTestsClass:EvaluateMethods'); })", wait_for_event_fn: async (pause_location) => { @@ -731,6 +840,20 @@ await EvaluateOnCallFrameFail(id, (" str", "ReferenceError") ); }); + + [Fact] + public async Task EvaluateConstantValueUsingRuntimeEvaluate() => await CheckInspectLocalsAtBreakpointSite( + "DebuggerTests.EvaluateTestsClass", "EvaluateLocals", 9, "EvaluateLocals", + "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateTestsClass:EvaluateLocals'); })", + wait_for_event_fn: async (pause_location) => + { + var dt = new DateTime(2020, 1, 2, 3, 4, 5); + await RuntimeEvaluateAndCheck( + ("15\n//comment as vs does\n", TNumber(15)), + ("15", TNumber(15)), + ("\"15\"\n//comment as vs does\n", TString("15")), + ("\"15\"", TString("15"))); + }); } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/MonoJsTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/MonoJsTests.cs index 38742d8d363304..eacdda9f8b803f 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/MonoJsTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/MonoJsTests.cs @@ -18,12 +18,12 @@ public async Task BadRaiseDebugEventsTest() { var bad_expressions = new[] { - "INTERNAL.mono_wasm_raise_debug_event('')", - "INTERNAL.mono_wasm_raise_debug_event(undefined)", - "INTERNAL.mono_wasm_raise_debug_event({})", + "getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event('')", + "getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event(undefined)", + "getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event({})", - "INTERNAL.mono_wasm_raise_debug_event({eventName:'foo'}, '')", - "INTERNAL.mono_wasm_raise_debug_event({eventName:'foo'}, 12)" + "getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event({eventName:'foo'}, '')", + "getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event({eventName:'foo'}, 12)" }; foreach (var expression in bad_expressions) @@ -58,7 +58,7 @@ public async Task RaiseDebugEventTraceTest(bool? trace) }); var trace_str = trace.HasValue ? $"trace: {trace.ToString().ToLower()}" : String.Empty; - var expression = $"INTERNAL.mono_wasm_raise_debug_event({{ eventName:'qwe' }}, {{ {trace_str} }})"; + var expression = $"getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event({{ eventName:'qwe' }}, {{ {trace_str} }})"; var res = await cli.SendCommand($"Runtime.evaluate", JObject.FromObject(new { expression }), token); Assert.True(res.IsOk, $"Expected to pass for {expression}"); @@ -139,7 +139,7 @@ async Task AssemblyLoadedEventTest(string asm_name, string asm_path, string pdb_ pdb_base64 = Convert.ToBase64String(bytes); } - var expression = $@"INTERNAL.mono_wasm_raise_debug_event({{ + var expression = $@"getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event({{ eventName: 'AssemblyLoaded', assembly_name: '{asm_name}', assembly_b64: '{asm_base64}', diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/PointerTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/PointerTests.cs index ee703b29648bb1..891eea7352c8aa 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/PointerTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/PointerTests.cs @@ -81,7 +81,7 @@ public async Task InspectLocalPointerArrays(string eval_fn, string type, string var dt = new DateTime(5, 6, 7, 8, 9, 10); await CheckProps(locals, new { - ipa = TArray("int*[]", 3) + ipa = TArray("int*[]", "int*[3]") }, "locals", num_fields: 26); var ipa_elems = await CompareObjectPropertiesFor(locals, "ipa", new[] @@ -112,7 +112,7 @@ public async Task InspectLocalDoublePointerToPrimitiveTypeArrays(string eval_fn, var dt = new DateTime(5, 6, 7, 8, 9, 10); await CheckProps(locals, new { - ippa = TArray("int**[]", 5) + ippa = TArray("int**[]", "int**[5]") }, "locals", num_fields: 26); var ippa_elems = await CompareObjectPropertiesFor(locals, "ippa", new[] @@ -223,7 +223,7 @@ public async Task InspectLocalPointersToValueTypeArrays(string eval_fn, string t var dt = new DateTime(5, 6, 7, 8, 9, 10); await CheckProps(locals, new { - dtpa = TArray("System.DateTime*[]", 2) + dtpa = TArray("System.DateTime*[]", "System.DateTime*[2]") }, "locals", num_fields: 26); // dtpa @@ -256,7 +256,7 @@ public async Task InspectLocalPointersToGenericValueTypeArrays(string eval_fn, s var dt = new DateTime(5, 6, 7, 8, 9, 10); await CheckProps(locals, new { - gspa = TArray("DebuggerTests.GenericStructWithUnmanagedT*[]", 3), + gspa = TArray("DebuggerTests.GenericStructWithUnmanagedT*[]", "DebuggerTests.GenericStructWithUnmanagedT*[3]"), }, "locals", num_fields: 26); // dtpa @@ -323,7 +323,7 @@ public async Task InspectLocalDoublePointersToValueTypeArrays(string eval_fn, st var dt = new DateTime(5, 6, 7, 8, 9, 10); await CheckProps(locals, new { - dtppa = TArray("System.DateTime**[]", 3), + dtppa = TArray("System.DateTime**[]", "System.DateTime**[3]"), }, "locals", num_fields: 26); // DateTime**[] dtppa = new DateTime**[] { &dtp, &dtp_null, null }; @@ -395,8 +395,8 @@ public async Task InspectPrimitiveTypePointersAsMethodArgs(string eval_fn, strin { ip = TPointer("int*"), ipp = TPointer("int**"), - ipa = TArray("int*[]", 3), - ippa = TArray("int**[]", 5) + ipa = TArray("int*[]", "int*[3]"), + ippa = TArray("int**[]", "int**[5]") }, "locals", num_fields: 8); // ip @@ -468,8 +468,8 @@ public async Task InspectValueTypePointersAsMethodArgs(string eval_fn, string ty { dtp = TPointer("System.DateTime*"), dtpp = TPointer("System.DateTime**"), - dtpa = TArray("System.DateTime*[]", 2), - dtppa = TArray("System.DateTime**[]", 3) + dtpa = TArray("System.DateTime*[]", "System.DateTime*[2]"), + dtppa = TArray("System.DateTime**[]", "System.DateTime**[3]") }, "locals", num_fields: 8); // *dtp diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs index de1bd7a829b2a4..bec62b77f97545 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs @@ -354,7 +354,7 @@ public async Task InspectLocalsInAsyncMethods(bool use_cfo) CheckObject(locals, "this", "Math.NestedInMath"); //FIXME: check fields CheckValueType(locals, "ss", "Math.SimpleStruct"); - CheckArray(locals, "ss_arr", "Math.SimpleStruct[]", 0); + CheckArray(locals, "ss_arr", "Math.SimpleStruct[]", "Math.SimpleStruct[0]"); // TODO: struct fields } ); @@ -584,7 +584,7 @@ async Task CheckArrayElements(JToken pause_location, DateTime dt) var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value()); await CheckProps(locals, new { - ssta = TArray("DebuggerTests.StructForToStringTests[]", 1) + ssta = TArray("DebuggerTests.StructForToStringTests[]", "DebuggerTests.StructForToStringTests[1]") }, "locals"); var ssta = await GetObjectOnLocals(locals, "ssta"); @@ -948,5 +948,77 @@ await EvaluateAndCheck( pause_location = await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test.cs", 806, 8, "Increment"); Assert.Equal(pause_location["callFrames"][0]["callFrameId"], "dotnet:scope:1"); } + + [Fact] + public async Task DebuggerAttributeIgnoreStepIntoDebuggerHidden() + { + var pause_location = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", "Run", 1); + await EvaluateAndCheck( + "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerAttribute:Run'); }, 1);", + "dotnet://debugger-test.dll/debugger-test.cs", + pause_location.Value["locations"][0]["lineNumber"].Value(), + pause_location.Value["locations"][0]["columnNumber"].Value(), + "Run" + ); + var step_into = await SendCommandAndCheck(null, $"Debugger.stepInto", null, -1, -1, null); + + Assert.Equal( + step_into["callFrames"][0]["location"]["lineNumber"].Value(), + pause_location.Value["locations"][0]["lineNumber"].Value() + 1 + ); + + } + + [Fact] + public async Task DebuggerAttributeIgnoreStepIntoDebuggerHiddenWithDebuggerBreakCall() + { + var pause_location = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", "RunDebuggerBreak", 1); + await EvaluateAndCheck( + "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerAttribute:RunDebuggerBreak'); }, 1);", + "dotnet://debugger-test.dll/debugger-test.cs", + pause_location.Value["locations"][0]["lineNumber"].Value(), + pause_location.Value["locations"][0]["columnNumber"].Value(), + "RunDebuggerBreak" + ); + var step_into1 = await SendCommandAndCheck(null, $"Debugger.stepInto", null, -1, -1, null); + + Assert.Equal( + pause_location.Value["locations"][0]["lineNumber"].Value(), + step_into1["callFrames"][0]["location"]["lineNumber"].Value() + ); + + var step_into2 = await SendCommandAndCheck(null, $"Debugger.stepInto", null, -1, -1, null); + + Assert.Equal( + pause_location.Value["locations"][0]["lineNumber"].Value() + 1, + step_into2["callFrames"][0]["location"]["lineNumber"].Value() + ); + + } + + [Fact] + public async Task DebuggerAttributeIgnoreStepOverDebuggerHiddenWithDebuggerBreakCall() + { + var pause_location = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", "RunDebuggerBreak", 1); + await EvaluateAndCheck( + "window.setTimeout(function() { invoke_static_method('[debugger-test] DebuggerAttribute:RunDebuggerBreak'); 1});", + "dotnet://debugger-test.dll/debugger-test.cs", + pause_location.Value["locations"][0]["lineNumber"].Value(), + pause_location.Value["locations"][0]["columnNumber"].Value(), + "RunDebuggerBreak" + ); + var step_over1 = await SendCommandAndCheck(null, $"Debugger.stepOver", null, -1, -1, null); + Assert.Equal( + pause_location.Value["locations"][0]["lineNumber"].Value(), + step_over1["callFrames"][0]["location"]["lineNumber"].Value() + ); + + var step_over2 = await SendCommandAndCheck(null, $"Debugger.stepOver", null, -1, -1, null); + + Assert.Equal( + pause_location.Value["locations"][0]["lineNumber"].Value() + 1, + step_over2["callFrames"][0]["location"]["lineNumber"].Value() + ); + } } } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/Tests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/Tests.cs index d5e47384796d2d..d6b260375c1f0e 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/Tests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/Tests.cs @@ -140,7 +140,7 @@ await CheckInspectLocalsAtBreakpointSite( str_spaces, str_esc, - strings = TArray("string[]", 4) + strings = TArray("string[]", "string[4]") }, "locals"); var strings_arr = await GetObjectOnLocals(locals, "strings"); @@ -204,14 +204,14 @@ await CheckInspectLocalsAtBreakpointSite( CheckObject(locals, "list", "System.Collections.Generic.Dictionary", description: "Count = 0"); CheckObject(locals, "list_null", "System.Collections.Generic.Dictionary", is_null: true); - CheckArray(locals, "list_arr", "System.Collections.Generic.Dictionary[]", 1); + CheckArray(locals, "list_arr", "System.Collections.Generic.Dictionary[]", "System.Collections.Generic.Dictionary[1]"); CheckObject(locals, "list_arr_null", "System.Collections.Generic.Dictionary[]", is_null: true); // Unused locals CheckObject(locals, "list_unused", "System.Collections.Generic.Dictionary", description: "Count = 0"); CheckObject(locals, "list_null_unused", "System.Collections.Generic.Dictionary", is_null: true); - CheckArray(locals, "list_arr_unused", "System.Collections.Generic.Dictionary[]", 1); + CheckArray(locals, "list_arr_unused", "System.Collections.Generic.Dictionary[]", "System.Collections.Generic.Dictionary[1]"); CheckObject(locals, "list_arr_null_unused", "System.Collections.Generic.Dictionary[]", is_null: true); } ); @@ -367,7 +367,7 @@ public async Task InspectBoxedLocals(string method_name, bool is_async) => await o_n_dt = TDateTime(dt), o_null = TObject("object", is_null: true), - o_ia = TArray("int[]", 2), + o_ia = TArray("int[]", "int[2]"), }, "locals"); foreach (var name in new[] { "n_gs", "o_gs", "o_n_gs" }) @@ -541,7 +541,7 @@ public async Task InspectLocalsForToStringDescriptions(int line, int col, string ts = TValueType("System.TimeSpan", ts.ToString()), dec = TValueType("System.Decimal", "123987123"), guid = TValueType("System.Guid", "3D36E07E-AC90-48C6-B7EC-A481E289D014"), - dts = TArray("System.DateTime[]", 2), + dts = TArray("System.DateTime[]", "System.DateTime[2]"), obj = TObject("DebuggerTests.ClassForToStringTests"), sst = TObject("DebuggerTests.StructForToStringTests") }, "locals#0"); @@ -712,7 +712,7 @@ public async Task PreviousFrameForAReflectedCall() => await CheckInspectLocalsAt mi = TObject("System.Reflection.RuntimeMethodInfo"), //this is what is returned when debugging desktop apps using VS dt = TDateTime(new DateTime(4210, 3, 4, 5, 6, 7)), i = TNumber(4), - strings = TArray("string[]", 1), + strings = TArray("string[]", "string[1]"), cs = TValueType("DebuggerTests.GetPropertiesTests.CloneableStruct"), num = TNumber(10), diff --git a/src/mono/wasm/debugger/tests/debugger-test/debugger-array-test.cs b/src/mono/wasm/debugger/tests/debugger-test/debugger-array-test.cs index 26acccf68dc767..f1a2b41bd18a48 100644 --- a/src/mono/wasm/debugger/tests/debugger-test/debugger-array-test.cs +++ b/src/mono/wasm/debugger/tests/debugger-test/debugger-array-test.cs @@ -305,4 +305,44 @@ public static void run() new Point { X = 90, Y = -4, Id = "point#Id", Color = RGB.Green }.GenericInstanceMethod(sc); } } + public class MultiDimensionalArray + { + public static void run() + { + var int_arr_1 = new int[2]; + int_arr_1[0] = 0; + int_arr_1[1] = 1; + + var int_arr_2 = new int[2, 3]; + int_arr_2[0, 0] = 0; + int_arr_2[0, 1] = 1; + int_arr_2[0, 2] = 2; + int_arr_2[1, 0] = 10; + int_arr_2[1, 1] = 11; + int_arr_2[1, 2] = 12; + + var int_arr_3 = new int[2, 3, 3]; + int_arr_3[0, 0, 0] = 0; + int_arr_3[0, 0, 1] = 1; + int_arr_3[0, 0, 2] = 2; + int_arr_3[0, 1, 0] = 10; + int_arr_3[0, 1, 1] = 11; + int_arr_3[0, 1, 2] = 12; + int_arr_3[0, 2, 0] = 20; + int_arr_3[0, 2, 1] = 21; + int_arr_3[0, 2, 2] = 22; + int_arr_3[1, 0, 0] = 100; + int_arr_3[1, 0, 1] = 101; + int_arr_3[1, 0, 2] = 102; + int_arr_3[1, 1, 0] = 110; + int_arr_3[1, 1, 1] = 111; + int_arr_3[1, 1, 2] = 112; + int_arr_3[1, 2, 0] = 120; + int_arr_3[1, 2, 1] = 121; + int_arr_3[1, 2, 2] = 122; + + System.Diagnostics.Debugger.Break(); + Console.WriteLine($"int_arr: {int_arr_3.Length}"); + } + } } diff --git a/src/mono/wasm/debugger/tests/debugger-test/debugger-driver.html b/src/mono/wasm/debugger/tests/debugger-test/debugger-driver.html index 07b06b95fe9e85..a141d677744e37 100644 --- a/src/mono/wasm/debugger/tests/debugger-test/debugger-driver.html +++ b/src/mono/wasm/debugger/tests/debugger-test/debugger-driver.html @@ -6,14 +6,14 @@ - + Stuff goes here diff --git a/src/mono/wasm/debugger/tests/debugger-test/debugger-evaluate-test.cs b/src/mono/wasm/debugger/tests/debugger-test/debugger-evaluate-test.cs index 74153fa3793761..6a9d87ba3f9e3d 100644 --- a/src/mono/wasm/debugger/tests/debugger-test/debugger-evaluate-test.cs +++ b/src/mono/wasm/debugger/tests/debugger-test/debugger-evaluate-test.cs @@ -378,6 +378,11 @@ public string CallMethodWithParmString(string parm) return str + parm; } + public string CallMethodWithParmString_λ(string parm) + { + return "λ_" + parm; + } + public string CallMethodWithParmBool(bool parm) { if (parm) @@ -403,6 +408,14 @@ public static void EvaluateMethods() { TestEvaluate f = new TestEvaluate(); f.run(100, 200, "9000", "test", 45); + DebuggerTestsV2.EvaluateStaticClass.Run(); + var a = 0; + } + + public static void EvaluateAsyncMethods() + { + var staticClass = new EvaluateNonStaticClassWithStaticFields(); + staticClass.run(); } } @@ -411,7 +424,37 @@ public static class EvaluateStaticClass { public static int StaticField1 = 10; public static string StaticProperty1 => "StaticProperty1"; - public static string StaticPropertyWithError => throw new Exception("not implemented"); + public static string StaticPropertyWithError => throw new Exception("not implemented"); + + public static class NestedClass1 + { + public static class NestedClass2 + { + public static class NestedClass3 + { + public static int StaticField1 = 3; + public static string StaticProperty1 => "StaticProperty3"; + public static string StaticPropertyWithError => throw new Exception("not implemented 3"); + } + } + } + } + + public class EvaluateNonStaticClassWithStaticFields + { + public static int StaticField1 = 10; + public static string StaticProperty1 => "StaticProperty1"; + public static string StaticPropertyWithError => throw new Exception("not implemented"); + + private int HelperMethod() + { + return 5; + } + + public async void run() + { + var makeAwaitable = await Task.Run(() => HelperMethod()); + } } public class EvaluateLocalsWithElementAccessTests @@ -454,3 +497,41 @@ public static void EvaluateLocals() } } + +namespace DebuggerTestsV2 +{ + public static class EvaluateStaticClass + { + public static int StaticField1 = 20; + public static string StaticProperty1 => "StaticProperty2"; + public static string StaticPropertyWithError => throw new Exception("not implemented"); + + public static void Run() + { + var a = 0; + } + } +} + + +public static class NoNamespaceClass +{ + public static void EvaluateMethods() + { + var stopHere = true; + } + + public static class NestedClass1 + { + public static class NestedClass2 + { + public static class NestedClass3 + { + public static int StaticField1 = 30; + public static string StaticProperty1 => "StaticProperty30"; + public static string StaticPropertyWithError => throw new Exception("not implemented 30"); + } + } + } +} + diff --git a/src/mono/wasm/debugger/tests/debugger-test/debugger-main.js b/src/mono/wasm/debugger/tests/debugger-test/debugger-main.js new file mode 100644 index 00000000000000..c34cdf6bae4308 --- /dev/null +++ b/src/mono/wasm/debugger/tests/debugger-test/debugger-main.js @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +"use strict"; + +var Module = { + configSrc: "./mono-config.json", + onConfigLoaded: () => { + MONO.config.environment_variables["DOTNET_MODIFIABLE_ASSEMBLIES"] = "debug"; + // For custom logging patch the functions below + /* + MONO.config.environment_variables["MONO_LOG_LEVEL"] = "debug"; + MONO.config.environment_variables["MONO_LOG_MASK"] = "all"; + INTERNAL.logging = { + trace: function (domain, log_level, message, isFatal, dataPtr) { }, + debugger: function (level, message) { } + }; + */ + }, + onDotNetReady: () => { + App.init(); + }, +}; diff --git a/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs b/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs index 4a029949d156d0..813102bbbc047d 100644 --- a/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs +++ b/src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs @@ -818,14 +818,34 @@ public static void HiddenMethod() currentCount++; } + [System.Diagnostics.DebuggerHidden] + public static void HiddenMethodDebuggerBreak() + { + var local_var = 12; + System.Diagnostics.Debugger.Break(); + currentCount++; + } + public static void VisibleMethod() { currentCount++; } + public static void VisibleMethodDebuggerBreak() + { + System.Diagnostics.Debugger.Break(); + currentCount++; + } + public static void Run() { HiddenMethod(); VisibleMethod(); } + + public static void RunDebuggerBreak() + { + HiddenMethodDebuggerBreak(); + VisibleMethodDebuggerBreak(); + } } diff --git a/src/mono/wasm/debugger/tests/debugger-test/debugger-test.csproj b/src/mono/wasm/debugger/tests/debugger-test/debugger-test.csproj index 46bbe3c6d4144d..c3cc1800aad87e 100644 --- a/src/mono/wasm/debugger/tests/debugger-test/debugger-test.csproj +++ b/src/mono/wasm/debugger/tests/debugger-test/debugger-test.csproj @@ -12,7 +12,7 @@ - + @@ -28,7 +28,7 @@ false $(AppDir) - $(MonoProjectRoot)wasm\runtime-test.js + $(MonoProjectRoot)wasm\test-main.js -1 diff --git a/src/mono/wasm/debugger/tests/debugger-test/runtime-debugger.js b/src/mono/wasm/debugger/tests/debugger-test/runtime-debugger.js deleted file mode 100644 index 7eea4d3c515999..00000000000000 --- a/src/mono/wasm/debugger/tests/debugger-test/runtime-debugger.js +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -"use strict"; - -var Module = { - config: null, - configSrc: "./mono-config.json", - onConfigLoaded: function () { - MONO.config.environment_variables["DOTNET_MODIFIABLE_ASSEMBLIES"] = "debug"; - // For custom logging patch the functions below - /* - MONO.config.environment_variables["MONO_LOG_LEVEL"] = "debug"; - MONO.config.environment_variables["MONO_LOG_MASK"] = "all"; - INTERNAL.logging = { - trace: function (domain, log_level, message, isFatal, dataPtr) { }, - debugger: function (level, message) { } - }; - */ - }, - onDotNetReady: function () { - App.init(); - }, -}; diff --git a/src/mono/wasm/runtime/CMakeLists.txt b/src/mono/wasm/runtime/CMakeLists.txt index 450d8df3918b8b..4a67bcfe1a816e 100644 --- a/src/mono/wasm/runtime/CMakeLists.txt +++ b/src/mono/wasm/runtime/CMakeLists.txt @@ -25,7 +25,7 @@ target_link_libraries(dotnet set_target_properties(dotnet PROPERTIES LINK_DEPENDS "${NATIVE_BIN_DIR}/src/emcc-default.rsp;${NATIVE_BIN_DIR}/src/runtime.iffe.js;${SOURCE_DIR}/library-dotnet.js;${SYSTEM_NATIVE_DIR}/pal_random.js" - LINK_FLAGS "@${NATIVE_BIN_DIR}/src/emcc-default.rsp ${CONFIGURATION_LINK_FLAGS} -DENABLE_NETCORE=1 --pre-js ${NATIVE_BIN_DIR}/src/runtime.iffe.js --js-library ${SOURCE_DIR}/library-dotnet.js --js-library ${SYSTEM_NATIVE_DIR}/pal_random.js" + LINK_FLAGS "@${NATIVE_BIN_DIR}/src/emcc-default.rsp ${CONFIGURATION_LINK_FLAGS} -DENABLE_NETCORE=1 --extern-pre-js ${NATIVE_BIN_DIR}/src/runtime.iffe.js --js-library ${SOURCE_DIR}/library-dotnet.js --js-library ${SYSTEM_NATIVE_DIR}/pal_random.js" RUNTIME_OUTPUT_DIRECTORY "${NATIVE_BIN_DIR}") if(CMAKE_BUILD_TYPE STREQUAL "Release") diff --git a/src/mono/wasm/runtime/buffers.ts b/src/mono/wasm/runtime/buffers.ts index 874de814f22da9..727ac3e8b5908b 100644 --- a/src/mono/wasm/runtime/buffers.ts +++ b/src/mono/wasm/runtime/buffers.ts @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. import { Int32Ptr, JSHandle, MonoArray, MonoObject, MonoString, VoidPtr } from "./types"; -import { Module } from "./modules"; +import { Module } from "./imports"; import { mono_wasm_get_jsobj_from_js_handle } from "./gc-handles"; import { wrap_error } from "./method-calls"; import { _js_to_mono_obj } from "./js-to-cs"; diff --git a/src/mono/wasm/runtime/corebindings.ts b/src/mono/wasm/runtime/corebindings.ts index 471914a932cb69..9e12e3f74d8c4f 100644 --- a/src/mono/wasm/runtime/corebindings.ts +++ b/src/mono/wasm/runtime/corebindings.ts @@ -4,7 +4,7 @@ import { JSHandle, GCHandle, MonoObject } from "./types"; import { ArgsMarshalString } from "./method-binding"; import { PromiseControl } from "./cancelable-promise"; -import { runtimeHelpers } from "./modules"; +import { runtimeHelpers } from "./imports"; const fn_signatures: [jsname: string, csname: string, signature: ArgsMarshalString][] = [ ["_get_cs_owned_object_by_js_handle", "GetCSOwnedObjectByJSHandle", "ii!"], diff --git a/src/mono/wasm/runtime/cs-to-js.ts b/src/mono/wasm/runtime/cs-to-js.ts index 070f2c498453e3..a0883815aa831d 100644 --- a/src/mono/wasm/runtime/cs-to-js.ts +++ b/src/mono/wasm/runtime/cs-to-js.ts @@ -7,7 +7,7 @@ import { MonoArrayNull, MonoObject, MonoObjectNull, MonoString, MonoType, MonoTypeNull } from "./types"; -import { Module, runtimeHelpers } from "./modules"; +import { runtimeHelpers } from "./imports"; import { conv_string } from "./strings"; import corebindings from "./corebindings"; import cwraps from "./cwraps"; @@ -15,6 +15,7 @@ import { get_js_owned_object_by_gc_handle, js_owned_gc_handle_symbol, mono_wasm_ import { mono_method_get_call_signature, call_method, wrap_error } from "./method-calls"; import { _js_to_mono_obj } from "./js-to-cs"; import { _are_promises_supported, _create_cancelable_promise } from "./cancelable-promise"; +import { getU32, getI32, getF32, getF64 } from "./memory"; // see src/mono/wasm/driver.c MARSHAL_TYPE_xxx and Runtime.cs MarshalType export enum MarshalType { @@ -132,7 +133,7 @@ export function _unbox_mono_obj_root_with_known_nonprimitive_type(root: WasmRoot let typePtr = MonoTypeNull; if ((type === MarshalType.VT) || (type == MarshalType.OBJECT)) { - typePtr = Module.HEAPU32[unbox_buffer >>> 2]; + typePtr = getU32(unbox_buffer); if (typePtr < 1024) throw new Error(`Got invalid MonoType ${typePtr} for object at address ${root.value} (root located at ${root.get_address()})`); } @@ -148,20 +149,20 @@ export function _unbox_mono_obj_root(root: WasmRoot): any { const type = cwraps.mono_wasm_try_unbox_primitive_and_get_type(root.value, unbox_buffer, runtimeHelpers._unbox_buffer_size); switch (type) { case MarshalType.INT: - return Module.HEAP32[unbox_buffer >>> 2]; + return getI32(unbox_buffer); case MarshalType.UINT32: - return Module.HEAPU32[unbox_buffer >>> 2]; + return getU32(unbox_buffer); case MarshalType.POINTER: // FIXME: Is this right? - return Module.HEAPU32[unbox_buffer >>> 2]; + return getU32(unbox_buffer); case MarshalType.FP32: - return Module.HEAPF32[unbox_buffer >>> 2]; + return getF32(unbox_buffer); case MarshalType.FP64: - return Module.HEAPF64[unbox_buffer >>> 3]; + return getF64(unbox_buffer); case MarshalType.BOOL: - return (Module.HEAP32[unbox_buffer >>> 2]) !== 0; + return (getI32(unbox_buffer)) !== 0; case MarshalType.CHAR: - return String.fromCharCode(Module.HEAP32[unbox_buffer >>> 2]); + return String.fromCharCode(getI32(unbox_buffer)); case MarshalType.NULL: return null; default: diff --git a/src/mono/wasm/runtime/cwraps.ts b/src/mono/wasm/runtime/cwraps.ts index 5270c13050d5b2..e991bab9a72c31 100644 --- a/src/mono/wasm/runtime/cwraps.ts +++ b/src/mono/wasm/runtime/cwraps.ts @@ -7,7 +7,7 @@ import { MonoMethod, MonoObject, MonoString, MonoType, VoidPtr } from "./types"; -import { Module } from "./modules"; +import { Module } from "./imports"; const fn_signatures: [ident: string, returnType: string | null, argTypes?: string[], opts?: any][] = [ // MONO diff --git a/src/mono/wasm/runtime/debug.ts b/src/mono/wasm/runtime/debug.ts index b55aad2f017f6c..229003a95477c9 100644 --- a/src/mono/wasm/runtime/debug.ts +++ b/src/mono/wasm/runtime/debug.ts @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -import { Module, MONO, runtimeHelpers } from "./modules"; +import { INTERNAL, Module, MONO, runtimeHelpers } from "./imports"; import { toBase64StringImpl } from "./base64"; import cwraps from "./cwraps"; import { VoidPtr } from "./types"; @@ -45,6 +45,7 @@ export function mono_wasm_add_dbg_command_received(res_ok: boolean, id: number, }; commands_received = buffer_obj; } + function mono_wasm_malloc_and_set_debug_buffer(command_parameters: string) { if (command_parameters.length > _debugger_buffer_len) { if (_debugger_buffer) @@ -118,8 +119,11 @@ export function mono_wasm_get_loaded_files(): string[] { function _create_proxy_from_object_id(objectId: string, details: any) { if (objectId.startsWith("dotnet:array:")) { - const ret = details.map((p: any) => p.value); - return ret; + let ret: Array; + if (details.dimensionsDetails === undefined || details.dimensionsDetails.length === 1) { + ret = details.items.map((p: any) => p.value); + return ret; + } } const proxy: any = {}; @@ -290,6 +294,55 @@ export function mono_wasm_release_object(objectId: string): void { delete _call_function_res_cache[objectId]; } +export function mono_wasm_debugger_log(level: number, message_ptr: CharPtr): void { + const message = Module.UTF8ToString(message_ptr); + + if (INTERNAL["logging"] && typeof INTERNAL.logging["debugger"] === "function") { + INTERNAL.logging.debugger(level, message); + return; + } + + console.debug(`Debugger.Debug: ${message}`); +} + +export function mono_wasm_trace_logger(log_domain_ptr: CharPtr, log_level_ptr: CharPtr, message_ptr: CharPtr, fatal: number, user_data: VoidPtr): void { + const message = Module.UTF8ToString(message_ptr); + const isFatal = !!fatal; + const domain = Module.UTF8ToString(log_domain_ptr); // is this always Mono? + const dataPtr = user_data; + const log_level = Module.UTF8ToString(log_level_ptr); + + if (INTERNAL["logging"] && typeof INTERNAL.logging["trace"] === "function") { + INTERNAL.logging.trace(domain, log_level, message, isFatal, dataPtr); + return; + } + + if (isFatal) + console.trace(message); + + switch (log_level) { + case "critical": + case "error": + console.error(message); + break; + case "warning": + console.warn(message); + break; + case "message": + console.log(message); + break; + case "info": + console.info(message); + break; + case "debug": + console.debug(message); + break; + default: + console.log(message); + break; + } +} + type CallDetails = { value: string } diff --git a/src/mono/wasm/runtime/driver.c b/src/mono/wasm/runtime/driver.c index a978fc59790d65..dbe9800b9f12de 100644 --- a/src/mono/wasm/runtime/driver.c +++ b/src/mono/wasm/runtime/driver.c @@ -136,47 +136,12 @@ static MonoDomain *root_domain; #define RUNTIMECONFIG_BIN_FILE "runtimeconfig.bin" +extern void mono_wasm_trace_logger (const char *log_domain, const char *log_level, const char *message, mono_bool fatal, void *user_data); + static void wasm_trace_logger (const char *log_domain, const char *log_level, const char *message, mono_bool fatal, void *user_data) { - EM_ASM({ - var log_level = $0; - var message = Module.UTF8ToString ($1); - var isFatal = $2; - var domain = Module.UTF8ToString ($3); // is this always Mono? - var dataPtr = $4; - - if (INTERNAL["logging"] && INTERNAL.logging["trace"]) { - INTERNAL.logging.trace(domain, log_level, message, isFatal, dataPtr); - return; - } - - if (isFatal) - console.trace (message); - - switch (Module.UTF8ToString ($0)) { - case "critical": - case "error": - console.error (message); - break; - case "warning": - console.warn (message); - break; - case "message": - console.log (message); - break; - case "info": - console.info (message); - break; - case "debug": - console.debug (message); - break; - default: - console.log (message); - break; - } - }, log_level, message, fatal, log_domain, user_data); - + mono_wasm_trace_logger(log_domain, log_level, message, fatal, user_data); if (fatal) exit (1); } @@ -485,12 +450,12 @@ mono_wasm_load_runtime (const char *unused, int debug_level) #endif #ifdef DEBUG - monoeg_g_setenv ("MONO_LOG_LEVEL", "debug", 0); - monoeg_g_setenv ("MONO_LOG_MASK", "gc", 0); + // monoeg_g_setenv ("MONO_LOG_LEVEL", "debug", 0); + // monoeg_g_setenv ("MONO_LOG_MASK", "gc", 0); // Setting this env var allows Diagnostic.Debug to write to stderr. In a browser environment this // output will be sent to the console. Right now this is the only way to emit debug logging from // corlib assemblies. - monoeg_g_setenv ("COMPlus_DebugWriteToStdErr", "1", 0); + // monoeg_g_setenv ("COMPlus_DebugWriteToStdErr", "1", 0); #endif // When the list of app context properties changes, please update RuntimeConfigReservedProperties for // target _WasmGenerateRuntimeConfig in WasmApp.targets file @@ -1072,41 +1037,6 @@ mono_wasm_try_unbox_primitive_and_get_type (MonoObject *obj, void *result, int r return resultType; } -// FIXME: This function is retained specifically because runtime-test.js uses it -EMSCRIPTEN_KEEPALIVE int -mono_unbox_int (MonoObject *obj) -{ - if (!obj) - return 0; - MonoType *type = mono_class_get_type (mono_object_get_class(obj)); - - void *ptr = mono_object_unbox (obj); - switch (mono_type_get_type (type)) { - case MONO_TYPE_I1: - case MONO_TYPE_BOOLEAN: - return *(signed char*)ptr; - case MONO_TYPE_U1: - return *(unsigned char*)ptr; - case MONO_TYPE_I2: - return *(short*)ptr; - case MONO_TYPE_U2: - return *(unsigned short*)ptr; - case MONO_TYPE_I4: - case MONO_TYPE_I: - return *(int*)ptr; - case MONO_TYPE_U4: - return *(unsigned int*)ptr; - case MONO_TYPE_CHAR: - return *(short*)ptr; - // WASM doesn't support returning longs to JS - // case MONO_TYPE_I8: - // case MONO_TYPE_U8: - default: - printf ("Invalid type %d to mono_unbox_int\n", mono_type_get_type (type)); - return 0; - } -} - EMSCRIPTEN_KEEPALIVE int mono_wasm_array_length (MonoArray *array) { diff --git a/src/mono/wasm/runtime/export-types.ts b/src/mono/wasm/runtime/export-types.ts new file mode 100644 index 00000000000000..281e9fa80aa0b9 --- /dev/null +++ b/src/mono/wasm/runtime/export-types.ts @@ -0,0 +1,18 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +import { DotNetPublicAPI } from "./exports"; +import { EmscriptenModuleConfig } from "./types"; + +// ----------------------------------------------------------- +// this files has all public exports from the dotnet.js module +// ----------------------------------------------------------- + +declare function createDotnetRuntime(moduleFactory: (api: DotNetPublicAPI) => EmscriptenModuleConfig): Promise; + +// Here, declare things that go in the global namespace, or augment existing declarations in the global namespace +declare global { + function getDotnetRuntime(runtimeId: number): DotNetPublicAPI | undefined; +} + +export default createDotnetRuntime; \ No newline at end of file diff --git a/src/mono/wasm/runtime/exports.ts b/src/mono/wasm/runtime/exports.ts index bafde4cec98e95..de092d79fb5390 100644 --- a/src/mono/wasm/runtime/exports.ts +++ b/src/mono/wasm/runtime/exports.ts @@ -1,12 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +import ProductVersion from "consts:productVersion"; +import Configuration from "consts:configuration"; + import { mono_wasm_new_root, mono_wasm_new_roots, mono_wasm_release_roots, mono_wasm_new_root_buffer, mono_wasm_new_root_buffer_from_pointer } from "./roots"; import { - mono_wasm_add_dbg_command_received, mono_wasm_send_dbg_command_with_parms, mono_wasm_send_dbg_command, mono_wasm_get_dbg_command_info, @@ -19,8 +21,11 @@ import { mono_wasm_get_loaded_files, mono_wasm_raise_debug_event, mono_wasm_fire_debugger_agent_message, + mono_wasm_debugger_log, + mono_wasm_trace_logger, + mono_wasm_add_dbg_command_received, } from "./debug"; -import { runtimeHelpers, setLegacyModules } from "./modules"; +import { runtimeHelpers, setImportsAndExports } from "./imports"; import { EmscriptenModuleMono, MonoArray, MonoConfig, MonoConfigError, MonoObject } from "./types"; import { mono_load_runtime_and_bcl_args, mono_wasm_load_config, @@ -32,7 +37,7 @@ import { } from "./startup"; import { mono_set_timeout, schedule_background_exec } from "./scheduling"; import { mono_wasm_load_icu_data, mono_wasm_get_icudt_name } from "./icu"; -import { conv_string, js_string_to_mono_string, mono_intern_string, string_decoder } from "./strings"; +import { conv_string, js_string_to_mono_string, mono_intern_string } from "./strings"; import { js_to_mono_obj, js_typed_array_to_array, mono_wasm_typed_array_to_array } from "./js-to-cs"; import { mono_array_to_js_array, mono_wasm_create_cs_owned_object, unbox_mono_obj, @@ -56,8 +61,15 @@ import { mono_wasm_release_cs_owned_object } from "./gc-handles"; import { mono_wasm_web_socket_open, mono_wasm_web_socket_send, mono_wasm_web_socket_receive, mono_wasm_web_socket_close, mono_wasm_web_socket_abort } from "./web-socket"; import cwraps from "./cwraps"; import { ArgsMarshalString } from "./method-binding"; +import { + setI8, setI16, setI32, setI64, + setU8, setU16, setU32, setF32, setF64, + getI8, getI16, getI32, getI64, + getU8, getU16, getU32, getF32, getF64, +} from "./memory"; +import { create_weak_ref } from "./weak-ref"; -export const MONO: MONO = { +const MONO: MONO = { // current "public" MONO API mono_wasm_setenv, mono_wasm_load_bytes_into_heap, @@ -82,7 +94,7 @@ export const MONO: MONO = { mono_wasm_new_roots, }; -export const BINDING: BINDING = { +const BINDING: BINDING = { //current "public" BINDING API mono_obj_array_new: cwraps.mono_wasm_obj_array_new, mono_obj_array_set: cwraps.mono_wasm_obj_array_set, @@ -106,73 +118,125 @@ export const BINDING: BINDING = { _teardown_after_call, }; +let api: DotNetPublicAPI; + // this is executed early during load of emscripten runtime // it exports methods to global objects MONO, BINDING and Module in backward compatible way // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -function export_to_emscripten(dotnet: any, mono: any, binding: any, internal: any, module: any): void { - const moduleExt = module as EmscriptenModuleMono; +function initializeImportsAndExports( + imports: { isGlobal: boolean, isNode: boolean, isShell: boolean, isWeb: boolean, locateFile: Function }, + exports: { mono: any, binding: any, internal: any, module: any }, +): DotNetPublicAPI { + const module = exports.module as EmscriptenModuleMono; + const globalThisAny = globalThis as any; // we want to have same instance of MONO, BINDING and Module in dotnet iffe - setLegacyModules(dotnet, mono, binding, internal, module); + setImportsAndExports(imports, exports); + + // here we merge methods from the local objects into exported objects + Object.assign(exports.mono, MONO); + Object.assign(exports.binding, BINDING); + Object.assign(exports.internal, INTERNAL); - // here we merge methods to it from the local objects - Object.assign(dotnet, DOTNET); - Object.assign(mono, MONO); - Object.assign(binding, BINDING); - Object.assign(internal, INTERNAL); + api = { + MONO: exports.mono, + BINDING: exports.binding, + INTERNAL: exports.internal, + Module: module, + RuntimeBuildInfo: { + ProductVersion, + Configuration + } + }; + if (module.configSrc) { + // this could be overriden on Module + if (!module.preInit) { + module.preInit = []; + } else if (typeof module.preInit === "function") { + module.preInit = [module.preInit]; + } + module.preInit.unshift(mono_wasm_pre_init); + } // this could be overriden on Module - moduleExt.preInit = mono_wasm_pre_init; - moduleExt.onRuntimeInitialized = mono_wasm_on_runtime_initialized; + if (!module.onRuntimeInitialized) { + module.onRuntimeInitialized = mono_wasm_on_runtime_initialized; + } + if (!module.print) { + module.print = console.log; + } + if (!module.printErr) { + module.printErr = console.error; + } + + if (imports.isGlobal || !module.disableDotNet6Compatibility) { + Object.assign(module, api); - if (!moduleExt.disableDotNet6Compatibility) { // backward compatibility // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - moduleExt.mono_bind_static_method = (fqn: string, signature: ArgsMarshalString): Function => { + module.mono_bind_static_method = (fqn: string, signature: ArgsMarshalString): Function => { console.warn("Module.mono_bind_static_method is obsolete, please use BINDING.bind_static_method instead"); return mono_bind_static_method(fqn, signature); }; // here we expose objects used in tests to global namespace - (globalThis).Module = module; - const warnWrap = (name: string, value: any) => { - if (typeof ((globalThis)[name]) !== "undefined") { + const warnWrap = (name: string, provider: () => any) => { + if (typeof globalThisAny[name] !== "undefined") { // it already exists in the global namespace return; } - let warnOnce = true; + let value: any = undefined; Object.defineProperty(globalThis, name, { get: () => { - if (warnOnce) { + if (!value) { const stack = (new Error()).stack; const nextLine = stack ? stack.substr(stack.indexOf("\n", 8) + 1) : ""; console.warn(`global ${name} is obsolete, please use Module.${name} instead ${nextLine}`); - warnOnce = false; + value = provider(); } return value; } }); }; - warnWrap("MONO", mono); - warnWrap("BINDING", binding); + globalThisAny.MONO = exports.mono; + globalThisAny.BINDING = exports.binding; + globalThisAny.INTERNAL = exports.internal; + if (!imports.isGlobal) { + globalThisAny.Module = module; + } // Blazor back compat - warnWrap("cwrap", Module.cwrap); - warnWrap("addRunDependency", Module.addRunDependency); - warnWrap("removeRunDependency", Module.removeRunDependency); + warnWrap("cwrap", () => module.cwrap); + warnWrap("addRunDependency", () => module.addRunDependency); + warnWrap("removeRunDependency", () => module.removeRunDependency); + } + let list: RuntimeList; + if (!globalThisAny.getDotnetRuntime) { + globalThisAny.getDotnetRuntime = (runtimeId: string) => globalThisAny.getDotnetRuntime.__list.getRuntime(runtimeId); + globalThisAny.getDotnetRuntime.__list = list = new RuntimeList(); } + else { + list = globalThisAny.getDotnetRuntime.__list; + } + list.registerRuntime(api); + + return api; } +export const __initializeImportsAndExports: any = initializeImportsAndExports; // don't want to export the type + // the methods would be visible to EMCC linker -// --- keep in sync with library-dotnet.js --- -const linker_exports = { +// --- keep in sync with dotnet.lib.js --- +export const __linker_exports: any = { // mini-wasm.c mono_set_timeout, // mini-wasm-debugger.c mono_wasm_asm_loaded, mono_wasm_fire_debugger_agent_message, + mono_wasm_debugger_log, + mono_wasm_add_dbg_command_received, // mono-threads-wasm.c schedule_background_exec, @@ -180,6 +244,7 @@ const linker_exports = { // also keep in sync with driver.c mono_wasm_invoke_js, mono_wasm_invoke_js_blazor, + mono_wasm_trace_logger, // also keep in sync with corebindings.c mono_wasm_invoke_js_with_args, @@ -208,16 +273,10 @@ const linker_exports = { mono_wasm_load_icu_data, mono_wasm_get_icudt_name, }; -export const DOTNET: any = { -}; -export const INTERNAL: any = { +const INTERNAL: any = { // startup BINDING_ASM: "[System.Private.Runtime.InteropServices.JavaScript]System.Runtime.InteropServices.JavaScript.Runtime", - export_to_emscripten, - - // linker - linker_exports: linker_exports, // tests call_static_method, @@ -226,19 +285,14 @@ export const INTERNAL: any = { mono_profiler_init_aot: cwraps.mono_profiler_init_aot, mono_wasm_set_runtime_options, mono_wasm_set_main_args: mono_wasm_set_main_args, - mono_wasm_strdup: cwraps.mono_wasm_strdup, mono_wasm_exec_regression: cwraps.mono_wasm_exec_regression, mono_method_resolve,//MarshalTests.cs mono_bind_static_method,// MarshalTests.cs mono_intern_string,// MarshalTests.cs - // EM_JS,EM_ASM,EM_ASM_INT macros - string_decoder, + // with mono_wasm_debugger_log and mono_wasm_trace_logger logging: undefined, - // used in EM_ASM macros in debugger - mono_wasm_add_dbg_command_received, - // used in debugger DevToolsHelper.cs mono_wasm_get_loaded_files, mono_wasm_send_dbg_command_with_parms, @@ -251,11 +305,31 @@ export const INTERNAL: any = { mono_wasm_detach_debugger, mono_wasm_raise_debug_event, mono_wasm_runtime_is_ready: runtimeHelpers.mono_wasm_runtime_is_ready, + + // memory accessors + setI8, + setI16, + setI32, + setI64, + setU8, + setU16, + setU32, + setF32, + setF64, + getI8, + getI16, + getI32, + getI64, + getU8, + getU16, + getU32, + getF32, + getF64, }; // this represents visibility in the javascript // like https://github.com/dotnet/aspnetcore/blob/main/src/Components/Web.JS/src/Platform/Mono/MonoTypes.ts -export interface MONO { +interface MONO { mono_wasm_runtime_ready: typeof mono_wasm_runtime_ready mono_wasm_setenv: typeof mono_wasm_setenv mono_wasm_load_data_archive: typeof mono_wasm_load_data_archive; @@ -268,8 +342,8 @@ export interface MONO { mono_wasm_release_roots: typeof mono_wasm_release_roots; // for Blazor's future! - mono_wasm_add_assembly: typeof cwraps.mono_wasm_add_assembly, - mono_wasm_load_runtime: typeof cwraps.mono_wasm_load_runtime, + mono_wasm_add_assembly: (name: string, data: VoidPtr, size: number) => number, + mono_wasm_load_runtime: (unused: string, debug_level: number) => void, loaded_files: string[]; config: MonoConfig | MonoConfigError, @@ -277,7 +351,7 @@ export interface MONO { // this represents visibility in the javascript // like https://github.com/dotnet/aspnetcore/blob/main/src/Components/Web.JS/src/Platform/Mono/MonoTypes.ts -export interface BINDING { +interface BINDING { mono_obj_array_new: (size: number) => MonoArray, mono_obj_array_set: (array: MonoArray, idx: number, obj: MonoObject) => void, js_string_to_mono_string: typeof js_string_to_mono_string, @@ -288,4 +362,29 @@ export interface BINDING { bind_static_method: typeof mono_bind_static_method, call_assembly_entry_point: typeof mono_call_assembly_entry_point, unbox_mono_obj: typeof unbox_mono_obj +} +export interface DotNetPublicAPI { + MONO: MONO, + BINDING: BINDING, + Module: any, + RuntimeId: number, + RuntimeBuildInfo: { + ProductVersion: string, + Configuration: string, + } +} + +class RuntimeList { + private list: { [runtimeId: number]: WeakRef } = {}; + + public registerRuntime(api: DotNetPublicAPI): number { + api.RuntimeId = Object.keys(this.list).length; + this.list[api.RuntimeId] = create_weak_ref(api); + return api.RuntimeId; + } + + public getRuntime(runtimeId: number): DotNetPublicAPI | undefined { + const wr = this.list[runtimeId]; + return wr ? wr.deref() : undefined; + } } \ No newline at end of file diff --git a/src/mono/wasm/runtime/gc-handles.ts b/src/mono/wasm/runtime/gc-handles.ts index 7ae56053caa41c..18e8462021a7ba 100644 --- a/src/mono/wasm/runtime/gc-handles.ts +++ b/src/mono/wasm/runtime/gc-handles.ts @@ -3,9 +3,9 @@ import corebindings from "./corebindings"; import { GCHandle, JSHandle, JSHandleDisposed, JSHandleNull, MonoObject, MonoObjectNull } from "./types"; +import { create_weak_ref } from "./weak-ref"; export const _use_finalization_registry = typeof globalThis.FinalizationRegistry === "function"; -export const _use_weak_ref = typeof globalThis.WeakRef === "function"; export let _js_owned_object_registry: FinalizationRegistry; // this is array, not map. We maintain list of gaps in _js_handle_free_list so that it could be as compact as possible @@ -78,18 +78,7 @@ export function _lookup_js_owned_object(gc_handle: GCHandle): any { // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function _register_js_owned_object(gc_handle: GCHandle, js_obj: any): void { - let wr; - if (_use_weak_ref) { - wr = new WeakRef(js_obj); - } - else { - // this is trivial WeakRef replacement, which holds strong refrence, instead of weak one, when the browser doesn't support it - wr = { - deref: () => { - return js_obj; - } - }; - } + const wr = create_weak_ref(js_obj); _js_owned_object_table.set(gc_handle, wr); } diff --git a/src/mono/wasm/runtime/modules.ts b/src/mono/wasm/runtime/imports.ts similarity index 58% rename from src/mono/wasm/runtime/modules.ts rename to src/mono/wasm/runtime/imports.ts index 3dfa33312712be..be89b335731c98 100644 --- a/src/mono/wasm/runtime/modules.ts +++ b/src/mono/wasm/runtime/imports.ts @@ -7,19 +7,33 @@ import { EmscriptenModuleMono, MonoConfig, RuntimeHelpers } from "./types"; +// these are our public API (except internal) export let Module: EmscriptenModule & EmscriptenModuleMono; export let MONO: any; export let BINDING: any; -export let DOTNET: any; export let INTERNAL: any; +// these are imported and re-exported from emscripten internals +export let ENVIRONMENT_IS_GLOBAL: boolean; +export let ENVIRONMENT_IS_NODE: boolean; +export let ENVIRONMENT_IS_SHELL: boolean; +export let ENVIRONMENT_IS_WEB: boolean; +export let locateFile: Function; + // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types -export function setLegacyModules(dotnet: any, mono: any, binding: any, internal: any, module: EmscriptenModule & EmscriptenModuleMono) { - DOTNET = dotnet; - MONO = mono; - BINDING = binding; - INTERNAL = internal; - Module = module; +export function setImportsAndExports( + imports: { isGlobal: boolean, isNode: boolean, isShell: boolean, isWeb: boolean, locateFile: Function }, + exports: { mono: any, binding: any, internal: any, module: any }, +) { + MONO = exports.mono; + BINDING = exports.binding; + INTERNAL = exports.internal; + Module = exports.module; + ENVIRONMENT_IS_GLOBAL = imports.isGlobal; + ENVIRONMENT_IS_NODE = imports.isNode; + ENVIRONMENT_IS_SHELL = imports.isShell; + ENVIRONMENT_IS_WEB = imports.isWeb; + locateFile = imports.locateFile; } let monoConfig: MonoConfig; diff --git a/src/mono/wasm/runtime/js-to-cs.ts b/src/mono/wasm/runtime/js-to-cs.ts index e9807e6033affe..01be716a7b7019 100644 --- a/src/mono/wasm/runtime/js-to-cs.ts +++ b/src/mono/wasm/runtime/js-to-cs.ts @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -import { Module, runtimeHelpers } from "./modules"; +import { Module, runtimeHelpers } from "./imports"; import { cs_owned_js_handle_symbol, get_cs_owned_object_by_js_handle, get_js_owned_object_by_gc_handle, js_owned_gc_handle_symbol, mono_wasm_get_jsobj_from_js_handle, mono_wasm_get_js_handle, @@ -15,6 +15,7 @@ import { js_string_to_mono_string, js_string_to_mono_string_interned } from "./s import { isThenable } from "./cancelable-promise"; import { has_backing_array_buffer } from "./buffers"; import { Int32Ptr, JSHandle, MonoArray, MonoMethod, MonoObject, MonoObjectNull, MonoString, wasm_type_symbol } from "./types"; +import { setI32, setU32, setF64 } from "./memory"; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export function _js_to_mono_uri(should_add_in_flight: boolean, js_obj: any): MonoObject { @@ -109,22 +110,22 @@ function _extract_mono_obj(should_add_in_flight: boolean, js_obj: any): MonoObje } function _box_js_int(js_obj: number) { - Module.HEAP32[runtimeHelpers._box_buffer >>> 2] = js_obj; + setI32(runtimeHelpers._box_buffer, js_obj); return cwraps.mono_wasm_box_primitive(runtimeHelpers._class_int32, runtimeHelpers._box_buffer, 4); } function _box_js_uint(js_obj: number) { - Module.HEAPU32[runtimeHelpers._box_buffer >>> 2] = js_obj; + setU32(runtimeHelpers._box_buffer, js_obj); return cwraps.mono_wasm_box_primitive(runtimeHelpers._class_uint32, runtimeHelpers._box_buffer, 4); } function _box_js_double(js_obj: number) { - Module.HEAPF64[runtimeHelpers._box_buffer >>> 3] = js_obj; + setF64(runtimeHelpers._box_buffer, js_obj); return cwraps.mono_wasm_box_primitive(runtimeHelpers._class_double, runtimeHelpers._box_buffer, 8); } export function _box_js_bool(js_obj: boolean): MonoObject { - Module.HEAP32[runtimeHelpers._box_buffer >>> 2] = js_obj ? 1 : 0; + setI32(runtimeHelpers._box_buffer, js_obj ? 1 : 0); return cwraps.mono_wasm_box_primitive(runtimeHelpers._class_boolean, runtimeHelpers._box_buffer, 4); } diff --git a/src/mono/wasm/runtime/library-dotnet.js b/src/mono/wasm/runtime/library-dotnet.js index a999659b1949dd..eede40a28f6dd8 100644 --- a/src/mono/wasm/runtime/library-dotnet.js +++ b/src/mono/wasm/runtime/library-dotnet.js @@ -1,6 +1,6 @@ -/* eslint-disable no-undef */ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +/* eslint-disable no-undef */ "use strict"; @@ -9,8 +9,8 @@ const DotNetSupportLib = { $MONO: {}, $BINDING: {}, $INTERNAL: {}, - // this line will be executed on runtime, populating the objects with methods - $DOTNET__postset: "__dotnet_runtime.INTERNAL.export_to_emscripten (DOTNET, MONO, BINDING, INTERNAL, Module);", + // this line will be executed early on runtime, passing import and export objects into __dotnet_runtime IFFE + $DOTNET__postset: "let api = __dotnet_runtime.__initializeImportsAndExports({isGlobal:true, isNode:ENVIRONMENT_IS_NODE, isShell:ENVIRONMENT_IS_SHELL, isWeb:ENVIRONMENT_IS_WEB, locateFile}, {mono:MONO, binding:BINDING, internal:INTERNAL, module:Module});", }; // the methods would be visible to EMCC linker @@ -22,6 +22,8 @@ const linked_functions = [ // mini-wasm-debugger.c "mono_wasm_asm_loaded", "mono_wasm_fire_debugger_agent_message", + "mono_wasm_debugger_log", + "mono_wasm_add_dbg_command_received", // mono-threads-wasm.c "schedule_background_exec", @@ -29,6 +31,7 @@ const linked_functions = [ // driver.c "mono_wasm_invoke_js", "mono_wasm_invoke_js_blazor", + "mono_wasm_trace_logger", // corebindings.c "mono_wasm_invoke_js_with_args", @@ -61,7 +64,7 @@ const linked_functions = [ // -- this javascript file is evaluated by emcc during compilation! -- // we generate simple proxy for each exported function so that emcc will include them in the final output for (let linked_function of linked_functions) { - const fn_template = `return __dotnet_runtime.INTERNAL.linker_exports.${linked_function}.apply(__dotnet_runtime, arguments)`; + const fn_template = `return __dotnet_runtime.__linker_exports.${linked_function}.apply(__dotnet_runtime, arguments)`; DotNetSupportLib[linked_function] = new Function(fn_template); } diff --git a/src/mono/wasm/runtime/memory.ts b/src/mono/wasm/runtime/memory.ts index f56322ba4b3787..55a322637b90f4 100644 --- a/src/mono/wasm/runtime/memory.ts +++ b/src/mono/wasm/runtime/memory.ts @@ -1,4 +1,4 @@ -import { Module } from "./modules"; +import { Module } from "./imports"; const _temp_mallocs: Array | null> = []; @@ -28,3 +28,80 @@ export function _release_temp_frame(): void { for (let i = 0, l = frame.length; i < l; i++) Module._free(frame[i]); } + +type _MemOffset = number | VoidPtr | NativePointer; + +export function setU8(offset: _MemOffset, value: number): void { + Module.HEAPU8[offset] = value; +} + +export function setU16(offset: _MemOffset, value: number): void { + Module.HEAPU16[offset >>> 1] = value; +} + +export function setU32(offset: _MemOffset, value: number): void { + Module.HEAPU32[offset >>> 2] = value; +} + +export function setI8(offset: _MemOffset, value: number): void { + Module.HEAP8[offset] = value; +} + +export function setI16(offset: _MemOffset, value: number): void { + Module.HEAP16[offset >>> 1] = value; +} + +export function setI32(offset: _MemOffset, value: number): void { + Module.HEAP32[offset >>> 2] = value; +} + +// NOTE: Accepts a number, not a BigInt, so values over Number.MAX_SAFE_INTEGER will be corrupted +export function setI64(offset: _MemOffset, value: number): void { + Module.setValue(offset, value, "i64"); +} + +export function setF32(offset: _MemOffset, value: number): void { + Module.HEAPF32[offset >>> 2] = value; +} + +export function setF64(offset: _MemOffset, value: number): void { + Module.HEAPF64[offset >>> 3] = value; +} + + +export function getU8(offset: _MemOffset): number { + return Module.HEAPU8[offset]; +} + +export function getU16(offset: _MemOffset): number { + return Module.HEAPU16[offset >>> 1]; +} + +export function getU32(offset: _MemOffset): number { + return Module.HEAPU32[offset >>> 2]; +} + +export function getI8(offset: _MemOffset): number { + return Module.HEAP8[offset]; +} + +export function getI16(offset: _MemOffset): number { + return Module.HEAP16[offset >>> 1]; +} + +export function getI32(offset: _MemOffset): number { + return Module.HEAP32[offset >>> 2]; +} + +// NOTE: Returns a number, not a BigInt. This means values over Number.MAX_SAFE_INTEGER will be corrupted +export function getI64(offset: _MemOffset): number { + return Module.getValue(offset, "i64"); +} + +export function getF32(offset: _MemOffset): number { + return Module.HEAPF32[offset >>> 2]; +} + +export function getF64(offset: _MemOffset): number { + return Module.HEAPF64[offset >>> 3]; +} diff --git a/src/mono/wasm/runtime/method-binding.ts b/src/mono/wasm/runtime/method-binding.ts index 57944e357453d1..1cd070ae944ad8 100644 --- a/src/mono/wasm/runtime/method-binding.ts +++ b/src/mono/wasm/runtime/method-binding.ts @@ -3,11 +3,15 @@ import { WasmRoot, WasmRootBuffer, mono_wasm_new_root } from "./roots"; import { MonoClass, MonoMethod, MonoObject, coerceNull, VoidPtrNull, VoidPtr, MonoType } from "./types"; -import { BINDING, runtimeHelpers } from "./modules"; +import { BINDING, Module, runtimeHelpers } from "./imports"; import { js_to_mono_enum, _js_to_mono_obj, _js_to_mono_uri } from "./js-to-cs"; import { js_string_to_mono_string, js_string_to_mono_string_interned } from "./strings"; import { MarshalType, _unbox_mono_obj_root_with_known_nonprimitive_type } from "./cs-to-js"; -import { _create_temp_frame } from "./memory"; +import { + _create_temp_frame, + getI32, getU32, getF32, getF64, + setI32, setU32, setF32, setF64, setI64, +} from "./memory"; import { _get_args_root_buffer_for_method_call, _get_buffer_for_method_call, _handle_exception_for_call, _teardown_after_call @@ -213,6 +217,11 @@ export function _compile_converter_for_marshal_string(args_marshal: ArgsMarshalS Module, _malloc: Module._malloc, mono_wasm_unbox_rooted: cwraps.mono_wasm_unbox_rooted, + setI32, + setU32, + setF32, + setF64, + setI64 }; let indirectLocalOffset = 0; @@ -220,8 +229,6 @@ export function _compile_converter_for_marshal_string(args_marshal: ArgsMarshalS "if (!method) throw new Error('no method provided');", `if (!buffer) buffer = _malloc (${bufferSizeBytes});`, `let indirectStart = buffer + ${indirectBaseOffset};`, - "let indirect32 = indirectStart >>> 2, indirect64 = indirectStart >>> 3;", - "let buffer32 = buffer >>> 2;", "" ); @@ -253,37 +260,35 @@ export function _compile_converter_for_marshal_string(args_marshal: ArgsMarshalS body.push(`${valueKey} = mono_wasm_unbox_rooted (${valueKey});`); if (step.indirect) { - let heapArrayName = null; + const offsetText = `(indirectStart + ${indirectLocalOffset})`; switch (step.indirect) { case "u32": - heapArrayName = "HEAPU32"; + body.push(`setU32(${offsetText}, ${valueKey});`); break; case "i32": - heapArrayName = "HEAP32"; + body.push(`setI32(${offsetText}, ${valueKey});`); break; case "float": - heapArrayName = "HEAPF32"; + body.push(`setF32(${offsetText}, ${valueKey});`); break; case "double": - body.push(`Module.HEAPF64[indirect64 + ${(indirectLocalOffset >>> 3)}] = ${valueKey};`); + body.push(`setF64(${offsetText}, ${valueKey});`); break; case "i64": - body.push(`Module.setValue (indirectStart + ${indirectLocalOffset}, ${valueKey}, 'i64');`); + body.push(`setI64(${offsetText}, ${valueKey});`); break; default: throw new Error("Unimplemented indirect type: " + step.indirect); } - if (heapArrayName) - body.push(`Module.${heapArrayName}[indirect32 + ${(indirectLocalOffset >>> 2)}] = ${valueKey};`); - - body.push(`Module.HEAP32[buffer32 + ${i}] = indirectStart + ${indirectLocalOffset};`, ""); + body.push(`setU32(buffer + (${i} * 4), ${offsetText});`); indirectLocalOffset += step.size!; } else { - body.push(`Module.HEAP32[buffer32 + ${i}] = ${valueKey};`, ""); + body.push(`setI32(buffer + (${i} * 4), ${valueKey});`); indirectLocalOffset += 4; } + body.push(""); } body.push("return buffer;"); @@ -404,7 +409,11 @@ export function mono_bind_method(method: MonoMethod, this_arg: MonoObject | null this_arg, token, unbox_buffer, - unbox_buffer_size + unbox_buffer_size, + getI32, + getU32, + getF32, + getF64 }; const converterKey = converter ? "converter_" + converter.name : ""; @@ -493,18 +502,18 @@ export function mono_bind_method(method: MonoMethod, this_arg: MonoObject | null " let resultType = mono_wasm_try_unbox_primitive_and_get_type (resultPtr, unbox_buffer, unbox_buffer_size);", " switch (resultType) {", ` case ${MarshalType.INT}:`, - " result = Module.HEAP32[unbox_buffer >>> 2]; break;", + " result = getI32(unbox_buffer); break;", ` case ${MarshalType.POINTER}:`, // FIXME: Is this right? ` case ${MarshalType.UINT32}:`, - " result = Module.HEAPU32[unbox_buffer >>> 2]; break;", + " result = getU32(unbox_buffer); break;", ` case ${MarshalType.FP32}:`, - " result = Module.HEAPF32[unbox_buffer >>> 2]; break;", + " result = getF32(unbox_buffer); break;", ` case ${MarshalType.FP64}:`, - " result = Module.HEAPF64[unbox_buffer >>> 3]; break;", + " result = getF64(unbox_buffer); break;", ` case ${MarshalType.BOOL}:`, - " result = (Module.HEAP32[unbox_buffer >>> 2]) !== 0; break;", + " result = getI32(unbox_buffer) !== 0; break;", ` case ${MarshalType.CHAR}:`, - " result = String.fromCharCode(Module.HEAP32[unbox_buffer >>> 2]); break;", + " result = String.fromCharCode(getI32(unbox_buffer)); break;", " default:", " result = _unbox_mono_obj_root_with_known_nonprimitive_type (resultRoot, resultType, unbox_buffer); break;", " }", diff --git a/src/mono/wasm/runtime/method-calls.ts b/src/mono/wasm/runtime/method-calls.ts index a2dd26d51f7e64..8d7174e8b488bb 100644 --- a/src/mono/wasm/runtime/method-calls.ts +++ b/src/mono/wasm/runtime/method-calls.ts @@ -7,7 +7,7 @@ import { MonoObjectNull, MonoString, coerceNull as coerceNull, VoidPtr, VoidPtrNull, Int32Ptr, MonoStringNull } from "./types"; -import { BINDING, INTERNAL, Module, MONO, runtimeHelpers } from "./modules"; +import { BINDING, INTERNAL, Module, MONO, runtimeHelpers } from "./imports"; import { _mono_array_root_to_js_array, _unbox_mono_obj_root } from "./cs-to-js"; import { get_js_obj, mono_wasm_get_jsobj_from_js_handle } from "./gc-handles"; import { js_array_to_mono_array, _box_js_bool, _js_to_mono_obj } from "./js-to-cs"; @@ -541,21 +541,18 @@ export function mono_wasm_invoke_js(code: MonoString, is_exception: Int32Ptr): M if (code === MonoStringNull) return MonoStringNull; - const js_code = conv_string(code); + const js_code = conv_string(code)!; try { - const closure = { - Module, MONO, BINDING, INTERNAL + const closedEval = function (Module: EmscriptenModule, MONO: any, BINDING: any, INTERNAL: any, code: string) { + return eval(code); }; - const fn_body_template = `const {Module, MONO, BINDING, INTERNAL} = __closure; const __fn = function(){ ${js_code} }; return __fn.call(__closure);`; - const fn_defn = new Function("__closure", fn_body_template); - const res = fn_defn(closure); + const res = closedEval(Module, MONO, BINDING, INTERNAL, js_code); Module.setValue(is_exception, 0, "i32"); if (typeof res === "undefined" || res === null) return MonoStringNull; - if (typeof res !== "string") - return wrap_error(is_exception, `Return type of InvokeJS is string. Can't marshal response of type ${typeof res}.`); - return js_string_to_mono_string(res); + + return js_string_to_mono_string(res.toString()); } catch (ex) { return wrap_error(is_exception, ex); } diff --git a/src/mono/wasm/runtime/package-lock.json b/src/mono/wasm/runtime/package-lock.json index 31cf072f632648..35a7cae09610e7 100644 --- a/src/mono/wasm/runtime/package-lock.json +++ b/src/mono/wasm/runtime/package-lock.json @@ -1194,6 +1194,12 @@ "fsevents": "~2.3.2" } }, + "rollup-plugin-consts": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-consts/-/rollup-plugin-consts-1.0.2.tgz", + "integrity": "sha512-vsy9uyIGTXHsVVlD6c2f43xgiQQYRWY29ycC3ezewxc9AHySjQh5Oi3NEX/9c4OnRnnxe+PMwOtvYBMyP0993Q==", + "dev": true + }, "rollup-plugin-dts": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-4.0.0.tgz", diff --git a/src/mono/wasm/runtime/package.json b/src/mono/wasm/runtime/package.json index dae87adeaef126..b332bf1141e0e6 100644 --- a/src/mono/wasm/runtime/package.json +++ b/src/mono/wasm/runtime/package.json @@ -8,7 +8,7 @@ "version": "1.0.0", "scripts": { "rollup": "rollup -c", - "lint": "eslint --no-color --max-warnings=0 ./**/*.ts ./**/*.js" + "lint": "eslint --no-color --max-warnings=0 ./**/*.ts ./*.js" }, "keywords": [ "dotnet", @@ -23,6 +23,7 @@ "@typescript-eslint/parser": "4.31.2", "eslint": "7.32.0", "rollup": "2.56.3", + "rollup-plugin-consts": "1.0.2", "rollup-plugin-dts": "4.0.0", "rollup-plugin-terser": "7.0.2", "tslib": "2.3.1", diff --git a/src/mono/wasm/runtime/profiler.ts b/src/mono/wasm/runtime/profiler.ts index b4abc9aacdb920..07e88acf4f47d5 100644 --- a/src/mono/wasm/runtime/profiler.ts +++ b/src/mono/wasm/runtime/profiler.ts @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -import { Module } from "./modules"; +import { Module } from "./imports"; import { AOTProfilerOptions, CoverageProfilerOptions } from "./types"; // Initialize the AOT profiler with OPTIONS. diff --git a/src/mono/wasm/runtime/rollup.config.js b/src/mono/wasm/runtime/rollup.config.js index d3bca849bef4aa..f3cbc55bda9e1f 100644 --- a/src/mono/wasm/runtime/rollup.config.js +++ b/src/mono/wasm/runtime/rollup.config.js @@ -5,19 +5,24 @@ import { readFile, writeFile, mkdir } from "fs/promises"; import * as fs from "fs"; import { createHash } from "crypto"; import dts from "rollup-plugin-dts"; +import consts from "rollup-plugin-consts"; const outputFileName = "runtime.iffe.js"; -const isDebug = process.env.Configuration !== "Release"; +const configuration = process.env.Configuration; +const isDebug = configuration !== "Release"; +const productVersion = process.env.ProductVersion || "7.0.0-dev"; const nativeBinDir = process.env.NativeBinDir ? process.env.NativeBinDir.replace(/"/g, "") : "bin"; const terserConfig = { compress: { - defaults: false,// to agressive minification breaks subsequent emcc compilation + defaults: false,// too agressive minification breaks subsequent emcc compilation drop_debugger: false,// we invoke debugger drop_console: false,// we log to console unused: false,// this breaks stuff // below are minification features which seems to work fine collapse_vars: true, conditionals: true, + computed_props: true, + properties: true, dead_code: true, if_return: true, inline: true, @@ -32,39 +37,40 @@ const terserConfig = { // because of stack walk at src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs keep_fnames: /(mono_wasm_runtime_ready|mono_wasm_fire_debugger_agent_message)/, }, - // we export ES5 because emcc parser has trouble parsing it otherwise - ecma: 5, }; const plugins = isDebug ? [writeOnChangePlugin()] : [terser(terserConfig), writeOnChangePlugin()]; +const banner = "//! Licensed to the .NET Foundation under one or more agreements.\n//! The .NET Foundation licenses this file to you under the MIT license.\n"; +// emcc doesn't know how to load ES6 module, that's why we need the whole rollup.js +const format = "iife"; +const name = "__dotnet_runtime"; export default defineConfig([ { treeshake: !isDebug, input: "exports.ts", output: [{ - banner: "//! Licensed to the .NET Foundation under one or more agreements.\n//! The .NET Foundation licenses this file to you under the MIT license.\n", - name: "__dotnet_runtime", file: nativeBinDir + "/src/" + outputFileName, - - // emcc doesn't know how to load ES6 module, that's why we need the whole rollup.js - format: "iife", - plugins: plugins + name, + banner, + format, + plugins, }], - plugins: [typescript()] + plugins: [consts({ productVersion, configuration }), typescript()] }, { - input: "./exports.ts", + input: "./export-types.ts", output: [ + // dotnet.d.ts { format: "es", file: nativeBinDir + "/src/" + "dotnet.d.ts", } ], plugins: [dts()], - }, + } ]); -// this would create .md5 file next to the output file, so that we do not touch datetime of the file if it's same -> faster incremental build. +// this would create .sha256 file next to the output file, so that we do not touch datetime of the file if it's same -> faster incremental build. function writeOnChangePlugin() { return { name: "writeOnChange", diff --git a/src/mono/wasm/runtime/roots.ts b/src/mono/wasm/runtime/roots.ts index 6d16379d914604..1eb88b3d7dc7fd 100644 --- a/src/mono/wasm/runtime/roots.ts +++ b/src/mono/wasm/runtime/roots.ts @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. import cwraps from "./cwraps"; -import { Module } from "./modules"; +import { Module } from "./imports"; import { VoidPtr, ManagedPointer, NativePointer } from "./types"; const maxScratchRoots = 8192; @@ -196,13 +196,18 @@ export class WasmRootBuffer { return this.__offset32 + index; } + // NOTE: These functions do not use the helpers from memory.ts because WasmRoot.get and WasmRoot.set + // are hot-spots when you profile any application that uses the bindings extensively. + get(index: number): ManagedPointer { this._check_in_range(index); - return Module.HEAP32[this.get_address_32(index)]; + const offset = this.get_address_32(index); + return Module.HEAP32[offset]; } set(index: number, value: ManagedPointer): ManagedPointer { - Module.HEAP32[this.get_address_32(index)] = value; + const offset = this.get_address_32(index); + Module.HEAP32[offset] = value; return value; } diff --git a/src/mono/wasm/runtime/startup.ts b/src/mono/wasm/runtime/startup.ts index f398adee92d963..e08370090f5481 100644 --- a/src/mono/wasm/runtime/startup.ts +++ b/src/mono/wasm/runtime/startup.ts @@ -1,8 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -import { INTERNAL, Module, MONO, runtimeHelpers } from "./modules"; -import { AssetEntry, CharPtr, CharPtrNull, EmscriptenModuleMono, GlobalizationMode, MonoConfig, TypedArray, VoidPtr, wasm_type_symbol } from "./types"; +import { AllAssetEntryTypes, AssetEntry, CharPtr, CharPtrNull, EmscriptenModuleMono, GlobalizationMode, MonoConfig, VoidPtr, wasm_type_symbol } from "./types"; +import { ENVIRONMENT_IS_NODE, ENVIRONMENT_IS_SHELL, INTERNAL, locateFile, Module, MONO, runtimeHelpers } from "./imports"; import cwraps from "./cwraps"; import { mono_wasm_raise_debug_event, mono_wasm_runtime_ready } from "./debug"; import { mono_wasm_globalization_init, mono_wasm_load_icu_data } from "./icu"; @@ -12,11 +12,25 @@ import { mono_wasm_load_bytes_into_heap } from "./buffers"; import { bind_runtime_method, get_method, _create_primitive_converters } from "./method-binding"; import { find_corlib_class } from "./class-loader"; +export let runtime_is_initialized_resolve: Function; +export let runtime_is_initialized_reject: Function; +export const mono_wasm_runtime_is_initialized = new Promise((resolve, reject) => { + runtime_is_initialized_resolve = resolve; + runtime_is_initialized_reject = reject; +}); + + export async function mono_wasm_pre_init(): Promise { const moduleExt = Module as EmscriptenModuleMono; if (moduleExt.configSrc) { - // sets MONO.config implicitly - await mono_wasm_load_config(moduleExt.configSrc); + try { + // sets MONO.config implicitly + await mono_wasm_load_config(moduleExt.configSrc); + } + catch (err: any) { + runtime_is_initialized_reject(err); + throw err; + } if (moduleExt.onConfigLoaded) { try { @@ -26,6 +40,7 @@ export async function mono_wasm_pre_init(): Promise { Module.printErr("MONO_WASM: onConfigLoaded () failed: " + err); Module.printErr("MONO_WASM: Stacktrace: \n"); Module.printErr(err.stack); + runtime_is_initialized_reject(err); throw err; } } @@ -56,7 +71,45 @@ export function mono_wasm_set_runtime_options(options: string[]): void { cwraps.mono_wasm_parse_runtime_options(options.length, argv); } -function _handle_loaded_asset(ctx: MonoInitContext, asset: AssetEntry, url: string, blob: ArrayBuffer) { +async function _fetch_asset(url: string): Promise { + try { + if (typeof (fetch) === "function") { + return fetch(url, { credentials: "same-origin" }); + } + else if (ENVIRONMENT_IS_NODE) { + //const fs = (globalThis).require("fs"); + // eslint-disable-next-line @typescript-eslint/no-var-requires + const fs = require("fs"); + const arrayBuffer = await fs.promises.readFile(url); + return { + ok: true, + url, + arrayBuffer: () => arrayBuffer, + json: () => JSON.parse(arrayBuffer) + }; + } + else if (typeof (read) === "function") { + const arrayBuffer = new Uint8Array(read(url, "binary")); + return { + ok: true, + url, + arrayBuffer: () => arrayBuffer, + json: () => JSON.parse(Module.UTF8ArrayToString(arrayBuffer, 0, arrayBuffer.length)) + }; + } + } + catch (e: any) { + return { + ok: false, + url, + arrayBuffer: () => { throw e; }, + json: () => { throw e; } + }; + } + throw new Error("No fetch implementation available"); +} + +function _handle_fetched_asset(ctx: MonoInitContext, asset: AssetEntry, url: string, blob: ArrayBuffer) { const bytes = new Uint8Array(blob); if (ctx.tracing) console.log(`MONO_WASM: Loaded:${asset.name} as ${asset.behavior} size ${bytes.length} from ${url}`); @@ -129,16 +182,6 @@ function _handle_loaded_asset(ctx: MonoInitContext, asset: AssetEntry, url: stri } } -// Initializes the runtime and loads assemblies, debug information, and other files. -export function mono_load_runtime_and_bcl_args(args: MonoConfig): void { - try { - return _load_assets_and_runtime(args); - } catch (exc: any) { - console.error("MONO_WASM: Error in mono_load_runtime_and_bcl_args:", exc); - throw exc; - } -} - function _apply_configuration_from_args(args: MonoConfig) { for (const k in (args.environment_variables || {})) mono_wasm_setenv(k, args.environment_variables![k]); @@ -153,47 +196,6 @@ function _apply_configuration_from_args(args: MonoConfig) { mono_wasm_init_coverage_profiler(args.coverage_profiler_options); } -function _get_fetch_file_cb_from_args(args: MonoConfig): (asset: string) => Promise { - if (typeof (args.fetch_file_cb) === "function") - return args.fetch_file_cb; - - if (typeof (fetch) === "function") { - return function (asset) { - return fetch(asset, { credentials: "same-origin" }); - }; - } else if (ENVIRONMENT_IS_NODE || typeof (read) === "function") { - return async function (asset) { - let data: any = null; - let err: any = null; - try { - if (ENVIRONMENT_IS_NODE) { - // eslint-disable-next-line @typescript-eslint/no-var-requires - const fs = require("fs"); - data = await fs.promises.readFile(asset); - } - else { - data = read(asset, "binary"); - } - } - catch (exc) { - data = null; - err = exc; - } - const res: any = { - ok: !!data, - url: asset, - arrayBuffer: async function () { - if (err) throw err; - return new Uint8Array(data); - } - }; - return res; - }; - } else { - throw new Error("No fetch_file_cb was provided and this environment does not expose 'fetch'."); - } -} - function _finalize_startup(args: MonoConfig, ctx: MonoInitContext) { const moduleExt = Module as EmscriptenModuleMono; @@ -210,11 +212,12 @@ function _finalize_startup(args: MonoConfig, ctx: MonoInitContext) { if (ENVIRONMENT_IS_SHELL || ENVIRONMENT_IS_NODE) { try { cwraps.mono_wasm_load_runtime("unused", args.debug_level || 0); - } catch (ex: any) { - Module.printErr("MONO_WASM: mono_wasm_load_runtime () failed: " + ex); + } catch (err: any) { + Module.printErr("MONO_WASM: mono_wasm_load_runtime () failed: " + err); Module.printErr("MONO_WASM: Stacktrace: \n"); - Module.printErr(ex.stack); + Module.printErr(err.stack); + runtime_is_initialized_reject(err); const wasm_exit = cwraps.mono_wasm_exit; wasm_exit(1); } @@ -233,6 +236,21 @@ function _finalize_startup(args: MonoConfig, ctx: MonoInitContext) { mono_wasm_setenv("TZ", tz || "UTC"); mono_wasm_runtime_ready(); + //legacy config loading + const argsAny: any = args; + if (argsAny.loaded_cb) { + try { + argsAny.loaded_cb(); + } + catch (err: any) { + Module.printErr("MONO_WASM: loaded_cb () failed: " + err); + Module.printErr("MONO_WASM: Stacktrace: \n"); + Module.printErr(err.stack); + runtime_is_initialized_reject(err); + throw err; + } + } + if (moduleExt.onDotNetReady) { try { moduleExt.onDotNetReady(); @@ -241,9 +259,12 @@ function _finalize_startup(args: MonoConfig, ctx: MonoInitContext) { Module.printErr("MONO_WASM: onDotNetReady () failed: " + err); Module.printErr("MONO_WASM: Stacktrace: \n"); Module.printErr(err.stack); + runtime_is_initialized_reject(err); throw err; } } + + runtime_is_initialized_resolve(); } export function bindings_lazy_init(): void { @@ -307,116 +328,50 @@ export function bindings_lazy_init(): void { _create_primitive_converters(); } -function _load_assets_and_runtime(args: MonoConfig) { - if (args.enable_debugging) - args.debug_level = args.enable_debugging; - - const ctx: MonoInitContext = { - tracing: args.diagnostic_tracing || false, - pending_count: args.assets.length, - loaded_assets: Object.create(null), - // dlls and pdbs, used by blazor and the debugger - loaded_files: [], - createPath: Module.FS_createPath, - createDataFile: Module.FS_createDataFile - }; - - if (ctx.tracing) - console.log("MONO_WASM: mono_wasm_load_runtime_with_args", JSON.stringify(args)); - - _apply_configuration_from_args(args); - - const fetch_file_cb = _get_fetch_file_cb_from_args(args); - - const onPendingRequestComplete = function () { - --ctx.pending_count; - if (ctx.pending_count === 0) { - try { - _finalize_startup(args, ctx); - } catch (exc: any) { - console.error("MONO_WASM: Unhandled exception in _finalize_startup", exc); - console.error(exc.stack); - throw exc; - } - } - }; +// Initializes the runtime and loads assemblies, debug information, and other files. +export async function mono_load_runtime_and_bcl_args(args: MonoConfig): Promise { + try { + if (args.enable_debugging) + args.debug_level = args.enable_debugging; + + const ctx: MonoInitContext = { + tracing: args.diagnostic_tracing || false, + pending_count: args.assets.length, + loaded_assets: Object.create(null), + // dlls and pdbs, used by blazor and the debugger + loaded_files: [], + createPath: Module.FS_createPath, + createDataFile: Module.FS_createDataFile + }; - const processFetchResponseBuffer = function (asset: AssetEntry, url: string, buffer: ArrayBuffer) { - try { - _handle_loaded_asset(ctx, asset, url, buffer); - } catch (exc) { - console.error(`MONO_WASM: Unhandled exception in processFetchResponseBuffer ${url} ${exc}`); - throw exc; - } finally { - onPendingRequestComplete(); - } - }; + _apply_configuration_from_args(args); - args.assets.forEach(function (asset: AssetEntry) { - let sourceIndex = 0; - const sourcesList = asset.load_remote ? args.remote_sources! : [""]; + const local_fetch = typeof (args.fetch_file_cb) === "function" ? args.fetch_file_cb : _fetch_asset; - const handleFetchResponse = function (response: Response) { - if (!response.ok) { - try { - attemptNextSource(); - return; - } catch (exc) { - console.error(`MONO_WASM: Unhandled exception in handleFetchResponse attemptNextSource for asset ${asset.name} ${exc}`); - throw exc; - } - } + const load_asset = async (asset: AllAssetEntryTypes): Promise => { + //TODO we could do module.addRunDependency(asset.name) and delay emscripten run() after all assets are loaded - try { - const bufferPromise = response.arrayBuffer(); - bufferPromise.then((data) => processFetchResponseBuffer(asset, response.url, data)); - } catch (exc) { - console.error(`MONO_WASM: Unhandled exception in handleFetchResponse for asset ${asset.name} ${exc}`); - attemptNextSource(); - } - }; + const sourcesList = asset.load_remote ? args.remote_sources! : [""]; + let error = undefined; + for (let sourcePrefix of sourcesList) { + // HACK: Special-case because MSBuild doesn't allow "" as an attribute + if (sourcePrefix === "./") + sourcePrefix = ""; - const attemptNextSource = function () { - if (sourceIndex >= sourcesList.length) { - const msg = `MONO_WASM: Failed to load ${asset.name}`; - try { - const isOk = asset.is_optional || - (asset.name.match(/\.pdb$/) && args.ignore_pdb_load_errors); - - if (isOk) - console.debug(msg); - else { - console.error(msg); - throw new Error(msg); + let attemptUrl; + if (sourcePrefix.trim() === "") { + if (asset.behavior === "assembly") + attemptUrl = locateFile(args.assembly_root + "/" + asset.name); + else if (asset.behavior === "resource") { + const path = asset.culture !== "" ? `${asset.culture}/${asset.name}` : asset.name; + attemptUrl = locateFile(args.assembly_root + "/" + path); } - } finally { - onPendingRequestComplete(); - } - } - - let sourcePrefix = sourcesList[sourceIndex]; - sourceIndex++; - - // HACK: Special-case because MSBuild doesn't allow "" as an attribute - if (sourcePrefix === "./") - sourcePrefix = ""; - - let attemptUrl; - if (sourcePrefix.trim() === "") { - if (asset.behavior === "assembly") - attemptUrl = locateFile(args.assembly_root + "/" + asset.name); - else if (asset.behavior === "resource") { - const path = asset.culture !== "" ? `${asset.culture}/${asset.name}` : asset.name; - attemptUrl = locateFile(args.assembly_root + "/" + path); + else + attemptUrl = asset.name; + } else { + attemptUrl = sourcePrefix + asset.name; } - else - attemptUrl = asset.name; - } else { - attemptUrl = sourcePrefix + asset.name; - } - - try { if (asset.name === attemptUrl) { if (ctx.tracing) console.log(`MONO_WASM: Attempting to fetch '${attemptUrl}'`); @@ -424,20 +379,52 @@ function _load_assets_and_runtime(args: MonoConfig) { if (ctx.tracing) console.log(`MONO_WASM: Attempting to fetch '${attemptUrl}' for ${asset.name}`); } - const fetch_promise = fetch_file_cb(attemptUrl); - fetch_promise.then(handleFetchResponse); - } catch (exc) { - console.error(`MONO_WASM: Error fetching ${attemptUrl} ${exc}`); - attemptNextSource(); + try { + const response = await local_fetch(attemptUrl); + if (!response.ok) { + error = new Error(`MONO_WASM: Fetch '${attemptUrl}' for ${asset.name} failed ${response.status} ${response.statusText}`); + continue;// next source + } + + const buffer = await response.arrayBuffer(); + _handle_fetched_asset(ctx, asset, attemptUrl, buffer); + --ctx.pending_count; + error = undefined; + } + catch (err) { + error = new Error(`MONO_WASM: Fetch '${attemptUrl}' for ${asset.name} failed ${err}`); + continue; //next source + } + + if (!error) { + //TODO Module.removeRunDependency(configFilePath); + break; // this source worked, stop searching + } + } + if (error) { + const isOkToFail = asset.is_optional || (asset.name.match(/\.pdb$/) && args.ignore_pdb_load_errors); + if (!isOkToFail) + throw error; } }; + const fetch_promises: Promise[] = []; + // start fetching all assets in parallel + for (const asset of args.assets) { + fetch_promises.push(load_asset(asset)); + } - attemptNextSource(); - }); + await Promise.all(fetch_promises); + + _finalize_startup(args, ctx); + } catch (err: any) { + console.error("MONO_WASM: Error in mono_load_runtime_and_bcl_args:", err); + runtime_is_initialized_reject(err); + throw err; + } } -// used from ASP.NET -export function mono_wasm_load_data_archive(data: TypedArray, prefix: string): boolean { +// used from Blazor +export function mono_wasm_load_data_archive(data: Uint8Array, prefix: string): boolean { if (data.length < 8) return false; @@ -501,31 +488,22 @@ export async function mono_wasm_load_config(configFilePath: string): PromiseModule._malloc(main_argc * 4); let aindex = 0; - Module.setValue(main_argv + (aindex * 4), INTERNAL.mono_wasm_strdup(name), "i32"); + Module.setValue(main_argv + (aindex * 4), cwraps.mono_wasm_strdup(name), "i32"); aindex += 1; for (let i = 0; i < allRuntimeArguments.length; ++i) { - Module.setValue(main_argv + (aindex * 4), INTERNAL.mono_wasm_strdup(allRuntimeArguments[i]), "i32"); + Module.setValue(main_argv + (aindex * 4), cwraps.mono_wasm_strdup(allRuntimeArguments[i]), "i32"); aindex += 1; } cwraps.mono_wasm_set_main_args(main_argc, main_argv); diff --git a/src/mono/wasm/runtime/strings.ts b/src/mono/wasm/runtime/strings.ts index 18871e42599f65..215b73f6c67b64 100644 --- a/src/mono/wasm/runtime/strings.ts +++ b/src/mono/wasm/runtime/strings.ts @@ -3,9 +3,10 @@ import { mono_wasm_new_root_buffer, WasmRootBuffer } from "./roots"; import { CharPtr, MonoString, MonoStringNull, NativePointer } from "./types"; -import { Module } from "./modules"; +import { Module } from "./imports"; import cwraps from "./cwraps"; import { mono_wasm_new_root } from "./roots"; +import { getI32 } from "./memory"; export class StringDecoder { @@ -31,9 +32,9 @@ export class StringDecoder { cwraps.mono_wasm_string_get_data(mono_string, ppChars, pLengthBytes, pIsInterned); let result = mono_wasm_empty_string; - const lengthBytes = Module.HEAP32[pLengthBytes >>> 2], - pChars = Module.HEAP32[ppChars >>> 2], - isInterned = Module.HEAP32[pIsInterned >>> 2]; + const lengthBytes = getI32(pLengthBytes), + pChars = getI32(ppChars), + isInterned = getI32(pIsInterned); if (pLengthBytes && pChars) { if ( @@ -186,7 +187,7 @@ export function js_string_to_mono_string(string: string): MonoString | null { return js_string_to_mono_string_new(string); } -export function js_string_to_mono_string_new(string: string) : MonoString { +export function js_string_to_mono_string_new(string: string): MonoString { const buffer = Module._malloc((string.length + 1) * 2); const buffer16 = (buffer >>> 1) | 0; for (let i = 0; i < string.length; i++) diff --git a/src/mono/wasm/runtime/tsconfig.json b/src/mono/wasm/runtime/tsconfig.json index a1f0c306021894..63d7619e09f9f4 100644 --- a/src/mono/wasm/runtime/tsconfig.json +++ b/src/mono/wasm/runtime/tsconfig.json @@ -4,7 +4,7 @@ "noEmitOnError": true, "removeComments": false, "sourceMap": false, - "target": "ES5", + "target": "ES2018", "moduleResolution": "Node", "lib": [ "esnext", diff --git a/src/mono/wasm/runtime/types.ts b/src/mono/wasm/runtime/types.ts index 93d31c55dc6c2d..d452649c96b2ef 100644 --- a/src/mono/wasm/runtime/types.ts +++ b/src/mono/wasm/runtime/types.ts @@ -75,7 +75,7 @@ export function coerceNull(ptr: T | nu export type MonoConfig = { isError: false, assembly_root: string, // the subfolder containing managed assemblies and pdbs - assets: (AssetEntry | AssemblyEntry | SatelliteAssemblyEntry | VfsEntry | IcuData)[], // a list of assets to load along with the runtime. each asset is a dictionary-style Object with the following properties: + assets: AllAssetEntryTypes[], // a list of assets to load along with the runtime. each asset is a dictionary-style Object with the following properties: debug_level?: number, // Either this or the next one needs to be set enable_debugging?: number, // Either this or the previous one needs to be set fetch_file_cb?: Request, // a function (string) invoked to fetch a given file. If no callback is provided a default implementation appropriate for the current environment will be selected (readFileSync in node, fetch elsewhere). If no default implementation is available this call will fail. @@ -97,6 +97,8 @@ export type MonoConfigError = { error: any } +export type AllAssetEntryTypes = AssetEntry | AssemblyEntry | SatelliteAssemblyEntry | VfsEntry | IcuData; + // Types of assets that can be in the mono-config.js/mono-config.json file (taken from /src/tasks/WasmAppBuilder/WasmAppBuilder.cs) export type AssetEntry = { name: string, // the name of the asset, including extension. @@ -177,7 +179,9 @@ export type CoverageProfilerOptions = { } // how we extended emscripten Module -export type EmscriptenModuleMono = EmscriptenModule & { +export type EmscriptenModuleMono = EmscriptenModule & EmscriptenModuleConfig; + +export type EmscriptenModuleConfig = { disableDotNet6Compatibility?: boolean, // backward compatibility diff --git a/src/mono/wasm/runtime/types/consts.d.ts b/src/mono/wasm/runtime/types/consts.d.ts new file mode 100644 index 00000000000000..f7256df937350f --- /dev/null +++ b/src/mono/wasm/runtime/types/consts.d.ts @@ -0,0 +1,5 @@ +declare module "consts:*" { + //Constant that will be inlined by Rollup and rollup-plugin-consts. + const constant: any; + export default constant; +} \ No newline at end of file diff --git a/src/mono/wasm/runtime/types/emscripten.d.ts b/src/mono/wasm/runtime/types/emscripten.d.ts index 5ddcea2beb8e71..51dbcbe364cfee 100644 --- a/src/mono/wasm/runtime/types/emscripten.d.ts +++ b/src/mono/wasm/runtime/types/emscripten.d.ts @@ -22,20 +22,6 @@ declare interface CharPtrPtr extends NativePointer { __brand: "CharPtrPtr" } -declare let ENVIRONMENT_IS_WEB: boolean; -declare let ENVIRONMENT_IS_SHELL: boolean; -declare let ENVIRONMENT_IS_NODE: boolean; -declare let ENVIRONMENT_IS_WORKER: boolean; -declare let LibraryManager: any; - -declare function autoAddDeps(a: object, b: string): void; -declare function mergeInto(a: object, b: object): void; - -// TODO, what's wrong with EXPORTED_RUNTIME_METHODS ? -declare function locateFile(path: string, prefix?: string): string; - -declare let Module: EmscriptenModule; - declare interface EmscriptenModule { HEAP8: Int8Array, HEAP16: Int16Array; @@ -59,14 +45,14 @@ declare interface EmscriptenModule { setValue(ptr: VoidPtr, value: number, type: string, noSafe?: number | boolean): void; setValue(ptr: Int32Ptr, value: number, type: string, noSafe?: number | boolean): void; getValue(ptr: number, type: string, noSafe?: number | boolean): number; - UTF8ToString(arg: CharPtr): string; - UTF8ArrayToString(str: TypedArray, heap: number[] | number, outIdx: number, maxBytesToWrite?: number): string; + UTF8ToString(ptr: CharPtr, maxBytesToRead?: number): string; + UTF8ArrayToString(u8Array: Uint8Array, idx?: number, maxBytesToRead?: number): string; FS_createPath(parent: string, path: string, canRead?: boolean, canWrite?: boolean): string; FS_createDataFile(parent: string, name: string, data: TypedArray, canRead: boolean, canWrite: boolean, canOwn?: boolean): string; removeRunDependency(id: string): void; addRunDependency(id: string): void; - preInit?: () => Promise; + preInit?: (() => Promise)[]; onRuntimeInitialized?: () => void; } diff --git a/src/mono/wasm/runtime/weak-ref.ts b/src/mono/wasm/runtime/weak-ref.ts new file mode 100644 index 00000000000000..52fffeb10ecd33 --- /dev/null +++ b/src/mono/wasm/runtime/weak-ref.ts @@ -0,0 +1,18 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +const _use_weak_ref = typeof globalThis.WeakRef === "function"; + +export function create_weak_ref(js_obj: T): WeakRef { + if (_use_weak_ref) { + return new WeakRef(js_obj); + } + else { + // this is trivial WeakRef replacement, which holds strong refrence, instead of weak one, when the browser doesn't support it + return { + deref: () => { + return js_obj; + } + }; + } +} diff --git a/src/mono/wasm/runtime/web-socket.ts b/src/mono/wasm/runtime/web-socket.ts index 00dac60a7f4905..319af2f4650456 100644 --- a/src/mono/wasm/runtime/web-socket.ts +++ b/src/mono/wasm/runtime/web-socket.ts @@ -11,6 +11,7 @@ import { _wrap_js_thenable_as_task } from "./js-to-cs"; import { wrap_error } from "./method-calls"; import { conv_string } from "./strings"; import { Int32Ptr, JSHandle, MonoArray, MonoObject, MonoObjectNull, MonoString } from "./types"; +import { Module } from "./imports"; const wasm_ws_pending_send_buffer = Symbol.for("wasm ws_pending_send_buffer"); const wasm_ws_pending_send_buffer_offset = Symbol.for("wasm ws_pending_send_buffer_offset"); diff --git a/src/mono/wasm/runtime-test.js b/src/mono/wasm/test-main.js similarity index 71% rename from src/mono/wasm/runtime-test.js rename to src/mono/wasm/test-main.js index 60ff70d065fe6a..8ef7f699b10ea5 100644 --- a/src/mono/wasm/runtime-test.js +++ b/src/mono/wasm/test-main.js @@ -8,7 +8,7 @@ //glue code to deal with the differences between chrome, ch, d8, jsc and sm. const is_browser = typeof window != "undefined"; -const is_node = !is_browser && typeof process != 'undefined'; +const is_node = !is_browser && typeof process === 'object' && typeof process.versions === 'object' && typeof process.versions.node === 'string'; // if the engine doesn't provide a console if (typeof (console) === "undefined") { @@ -22,6 +22,9 @@ const originalConsole = { error: console.error }; +let isXUnitDoneCheck = false; +let isXmlDoneCheck = false; + function proxyMethod(prefix, func, asJson) { return function () { const args = [...arguments]; @@ -36,8 +39,16 @@ function proxyMethod(prefix, func, asJson) { payload = payload.toString(); } } + if (payload.indexOf("=== TEST EXECUTION SUMMARY ===") != -1) { + isXUnitDoneCheck = true; + } - if (asJson) { + if (payload.startsWith("STARTRESULTXML")) { + originalConsole.log('Sending RESULTXML') + isXmlDoneCheck = true; + func(payload); + } + else if (asJson) { func(JSON.stringify({ method: prefix, payload: payload, @@ -61,18 +72,27 @@ function proxyJson(func) { console[m] = proxyMethod(`console.${m}`, func, true); } +let consoleWebSocket; + if (is_browser) { const consoleUrl = `${window.location.origin}/console`.replace('http://', 'ws://'); - let consoleWebSocket = new WebSocket(consoleUrl); - consoleWebSocket.onopen = function (event) { - proxyJson(function (msg) { + consoleWebSocket = new WebSocket(consoleUrl); + // redirect output so that when emscripten starts it's already redirected + proxyJson(function (msg) { + if (consoleWebSocket.readyState === WebSocket.OPEN) { consoleWebSocket.send(msg); - }); - console.log("browser: Console websocket connected."); + } + else { + originalConsole.log(msg); + } + }); + + consoleWebSocket.onopen = function (event) { + originalConsole.log("browser: Console websocket connected."); }; consoleWebSocket.onerror = function (event) { - console.error(`websocket error: ${event}`); + originalConsole.error(`websocket error: ${event}`); }; } @@ -101,18 +121,14 @@ if (typeof globalThis.performance === 'undefined') { } } } - var Module = { - no_global_exports: true, - mainScriptUrlOrBlob: "dotnet.js", config: null, configSrc: "./mono-config.json", - print: console.log, - printErr: console.error, - onConfigLoaded: function () { + onConfigLoaded: () => { if (!Module.config) { - console.error("Could not find ./mono-config.json. Cancelling run"); - fail_exec(1); + const err = new Error("Could not find ./mono-config.json. Cancelling run"); + set_exit_code(1,); + throw err; } // Have to set env vars here to enable setting MONO_LOG_LEVEL etc. for (let variable in processedArguments.setenv) { @@ -123,10 +139,10 @@ var Module = { INTERNAL.mono_wasm_enable_on_demand_gc(0); } }, - onDotNetReady: function () { + onDotNetReady: () => { let wds = Module.FS.stat(processedArguments.working_dir); if (wds === undefined || !Module.FS.isDir(wds.mode)) { - fail_exec(1, `Could not find working directory ${processedArguments.working_dir}`); + set_exit_code(1, `Could not find working directory ${processedArguments.working_dir}`); return; } @@ -134,26 +150,26 @@ var Module = { App.init(); }, - onAbort: function (x) { - console.log("ABORT: " + x); + onAbort: (error) => { + console.log("ABORT: " + error); const err = new Error(); console.log("Stacktrace: \n"); console.error(err.stack); - fail_exec(1); + set_exit_code(1, error); }, }; + const App = { - init: function () { + init: async function () { console.info("Initializing....."); - for (let i = 0; i < processedArguments.profilers.length; ++i) { const init = Module.cwrap('mono_wasm_load_profiler_' + processedArguments.profilers[i], 'void', ['string']); init(""); } if (processedArguments.applicationArgs.length == 0) { - fail_exec(1, "Missing required --run argument"); + set_exit_code(1, "Missing required --run argument"); return; } @@ -171,7 +187,7 @@ const App = { } if (res) - fail_exec(1, "REGRESSION TEST FAILED"); + set_exit_code(1, "REGRESSION TEST FAILED"); return; } @@ -182,31 +198,23 @@ const App = { if (processedArguments.applicationArgs[0] == "--run") { // Run an exe if (processedArguments.applicationArgs.length == 1) { - fail_exec(1, "Error: Missing main executable argument."); + set_exit_code(1, "Error: Missing main executable argument."); return; } + try { - const main_assembly_name = processedArguments.applicationArgs[1]; - const app_args = processedArguments.applicationArgs.slice(2); - INTERNAL.mono_wasm_set_main_args(processedArguments.applicationArgs[1], app_args); - - // Automatic signature isn't working correctly - const result = BINDING.call_assembly_entry_point(main_assembly_name, [app_args], "m"); - const onError = function (error) { - console.error(error); - if (error.stack) - console.error(error.stack); + const main_assembly_name = processedArguments.applicationArgs[1]; + const app_args = processedArguments.applicationArgs.slice(2); + INTERNAL.mono_wasm_set_main_args(processedArguments.applicationArgs[1], app_args); - fail_exec(1); - } - try { - result.then(fail_exec).catch(onError); + // Automatic signature isn't working correctly + const result = await BINDING.call_assembly_entry_point(main_assembly_name, [app_args], "m"); + set_exit_code(result); } catch (error) { - onError(error); + set_exit_code(1, error); } - } else { - fail_exec(1, "Unhandled argument: " + processedArguments.applicationArgs[0]); + set_exit_code(1, "Unhandled argument: " + processedArguments.applicationArgs[0]); } }, @@ -229,19 +237,41 @@ const App = { }; globalThis.App = App; // Necessary as System.Runtime.InteropServices.JavaScript.Tests.MarshalTests (among others) call the App.call_test_method directly -function fail_exec(exit_code, reason) { +function set_exit_code(exit_code, reason) { if (reason) { - console.error(reason); + console.error(reason.toString()); + if (reason.stack) { + console.error(reason.stack); + } } if (is_browser) { + const stack = (new Error()).stack.replace(/\n/g, "").replace(/[ ]*at/g, " at").replace(/https?:\/\/[0-9.:]*/g, "").replace("Error", ""); + const messsage = `Exit called with ${exit_code} when isXUnitDoneCheck=${isXUnitDoneCheck} isXmlDoneCheck=${isXmlDoneCheck} WS.bufferedAmount=${consoleWebSocket.bufferedAmount} ${stack}.`; + // Notify the selenium script Module.exit_code = exit_code; - originalConsole.log("WASM EXIT " + exit_code); + + //Tell xharness WasmBrowserTestRunner what was the exit code const tests_done_elem = document.createElement("label"); tests_done_elem.id = "tests_done"; tests_done_elem.innerHTML = exit_code.toString(); document.body.appendChild(tests_done_elem); - } else { // shell or node + + console.log('WS: ' + messsage); + originalConsole.log('CDP: ' + messsage); + const stop_when_ws_buffer_empty = () => { + if (consoleWebSocket.bufferedAmount == 0) { + // tell xharness WasmTestMessagesProcessor we are done. + // note this sends last few bytes into the same WS + console.log("WASM EXIT " + exit_code); + } + else { + setTimeout(stop_when_ws_buffer_empty, 100); + } + }; + stop_when_ws_buffer_empty(); + + } else if (INTERNAL) { INTERNAL.mono_wasm_exit(exit_code); } } @@ -262,7 +292,7 @@ function processArguments(incomingArguments) { const arg = currentArg.substring("--setenv=".length); const parts = arg.split('='); if (parts.length != 2) - fail_exec(1, "Error: malformed argument: '" + currentArg); + set_exit_code(1, "Error: malformed argument: '" + currentArg); setenv[parts[0]] = parts[1]; } else if (currentArg.startsWith("--runtime-arg=")) { const arg = currentArg.substring("--runtime-arg=".length); @@ -322,8 +352,10 @@ try { async function loadDotnet(file) { let loadScript = undefined; if (typeof WScript !== "undefined") { // Chakra - loadScript = WScript.LoadScriptFile; - return globalThis.Module; + loadScript = function (file) { + WScript.LoadScriptFile(file); + return globalThis.Module; + }; } else if (is_node) { // NodeJS loadScript = async function (file) { return require(file); @@ -333,7 +365,17 @@ async function loadDotnet(file) { const script = document.createElement("script"); script.src = file; document.head.appendChild(script); - return globalThis.Module; + let timeout = 100; + // bysy spin waiting for script to load into global namespace + while (timeout > 0) { + if (globalThis.Module) { + return globalThis.Module; + } + // delay 10ms + await new Promise(resolve => setTimeout(resolve, 10)); + timeout--; + } + throw new Error("Can't load " + file); } } else if (typeof globalThis.load !== 'undefined') { @@ -351,6 +393,6 @@ async function loadDotnet(file) { loadDotnet("./dotnet.js").catch(function (err) { console.error(err); - fail_exec(1, "failed to load the dotnet.js file"); + set_exit_code(1, "failed to load the dotnet.js file"); throw err; }); \ No newline at end of file diff --git a/src/mono/wasm/wasm.proj b/src/mono/wasm/wasm.proj index 68482d708962c7..b31983a8666018 100644 --- a/src/mono/wasm/wasm.proj +++ b/src/mono/wasm/wasm.proj @@ -152,14 +152,13 @@ $(CMakeConfigurationEmccFlags) -O2 -DEMSDK_PATH="$(EMSDK_PATH.TrimEnd('\/'))" - emcmake cmake $(MSBuildThisFileDirectory)runtime -DCMAKE_BUILD_TYPE=$(Configuration) -DCONFIGURATION_EMCC_FLAGS="$(CMakeConfigurationEmccFlags)" -DCONFIGURATION_LINK_FLAGS="$(CMakeConfigurationLinkFlags)" -DMONO_INCLUDES="$(MonoArtifactsPath)include/mono-2.0" -DMONO_OBJ_INCLUDES="$(MonoObjDir.TrimEnd('\/'))" -DICU_LIB_DIR="$(ICULibDir.TrimEnd('\/'))" -DMONO_ARTIFACTS_DIR="$(MonoArtifactsPath.TrimEnd('\/'))" -DNATIVE_BIN_DIR="$(NativeBinDir.TrimEnd('\/'))" -DSYSTEM_NATIVE_DIR="$(RepoRoot)src/libraries/Native/Unix/System.Native" -DSOURCE_DIR="$(MSBuildThisFileDirectory.TrimEnd('\/'))/runtime"$(CMakeConfigurationEmsdkPath) + emcmake cmake $(MSBuildThisFileDirectory)runtime -DCMAKE_BUILD_TYPE=$(Configuration) -DCONFIGURATION_EMCC_FLAGS="$(CMakeConfigurationEmccFlags)" -DCONFIGURATION_LINK_FLAGS="$(CMakeConfigurationLinkFlags)" -DMONO_INCLUDES="$(MonoArtifactsPath)include/mono-2.0" -DMONO_OBJ_INCLUDES="$(MonoObjDir.TrimEnd('\/'))" -DICU_LIB_DIR="$(ICULibDir.TrimEnd('\/'))" -DMONO_ARTIFACTS_DIR="$(MonoArtifactsPath.TrimEnd('\/'))" -DNATIVE_BIN_DIR="$(NativeBinDir.TrimEnd('\/'))" -DSYSTEM_NATIVE_DIR="$(RepoRoot)src/native/libs/System.Native" -DSOURCE_DIR="$(MSBuildThisFileDirectory.TrimEnd('\/'))/runtime"$(CMakeConfigurationEmsdkPath) call "$(RepositoryEngineeringDir)native\init-vs-env.cmd" && call "$([MSBuild]::NormalizePath('$(EMSDK_PATH)', 'emsdk_env.bat'))" && $(CMakeBuildRuntimeConfigureCmd) bash -c 'source $(EMSDK_PATH)/emsdk_env.sh 2>&1 && $(CMakeBuildRuntimeConfigureCmd)' cmake --build . --config $(Configuration) call "$(RepositoryEngineeringDir)native\init-vs-env.cmd" && call "$([MSBuild]::NormalizePath('$(EMSDK_PATH)', 'emsdk_env.bat'))" && $(CMakeBuildRuntimeCmd) bash -c 'source $(EMSDK_PATH)/emsdk_env.sh 2>&1 && $(CMakeBuildRuntimeCmd)' - $(RepoRoot)src\libraries\Native\Unix\System.Native - + diff --git a/src/native/corehost/apphost/static/CMakeLists.txt b/src/native/corehost/apphost/static/CMakeLists.txt index 0d9ae541c33b1d..d9c92506635a69 100644 --- a/src/native/corehost/apphost/static/CMakeLists.txt +++ b/src/native/corehost/apphost/static/CMakeLists.txt @@ -18,11 +18,8 @@ set(SKIP_VERSIONING 1) include_directories(..) include_directories(../../json) - -include_directories(${CLR_SRC_LIBS_NATIVE_DIR}/AnyOS/zlib) -if(NOT CLR_CMAKE_TARGET_WIN32) - include_directories(${CLR_SRC_LIBS_NATIVE_DIR}/Unix/Common) -endif() +include_directories(${CLR_SRC_NATIVE_DIR}/libs/System.IO.Compression.Native) +include_directories(${CLR_SRC_NATIVE_DIR}/libs/Common) set(SOURCES ../bundle_marker.cpp @@ -151,19 +148,19 @@ else() ) # additional requirements for System.IO.Compression.Native - include(${CLR_REPO_ROOT_DIR}/src/libraries/Native/Unix/System.IO.Compression.Native/extra_libs.cmake) + include(${CLR_SRC_NATIVE_DIR}/libs/System.IO.Compression.Native/extra_libs.cmake) append_extra_compression_libs(NATIVE_LIBS) # Additional requirements for System.Net.Security.Native - include(${CLR_REPO_ROOT_DIR}/src/libraries/Native/Unix/System.Net.Security.Native/extra_libs.cmake) + include(${CLR_SRC_NATIVE_DIR}/libs/System.Net.Security.Native/extra_libs.cmake) append_extra_security_libs(NATIVE_LIBS) # Additional requirements for System.Native - include(${CLR_REPO_ROOT_DIR}/src/libraries/Native/Unix/System.Native/extra_libs.cmake) + include(${CLR_SRC_NATIVE_DIR}/libs/System.Native/extra_libs.cmake) append_extra_system_libs(NATIVE_LIBS) # Additional requirements for System.Security.Cryptography.Native.OpenSsl - include(${CLR_REPO_ROOT_DIR}/src/libraries/Native/Unix/System.Security.Cryptography.Native/extra_libs.cmake) + include(${CLR_SRC_NATIVE_DIR}/libs/System.Security.Cryptography.Native/extra_libs.cmake) append_extra_cryptography_libs(NATIVE_LIBS) set(RUNTIMEINFO_LIB runtimeinfo) @@ -176,7 +173,7 @@ if(CLR_CMAKE_TARGET_OSX) ) # Additional requirements for System.Security.Cryptography.Native.Apple - include(${CLR_REPO_ROOT_DIR}/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/extra_libs.cmake) + include(${CLR_SRC_NATIVE_DIR}/libs/System.Security.Cryptography.Native.Apple/extra_libs.cmake) append_extra_cryptography_apple_libs(NATIVE_LIBS) endif() diff --git a/src/native/corehost/comhost/comhost.cpp b/src/native/corehost/comhost/comhost.cpp index 9e7317b15917c2..23c673c89736eb 100644 --- a/src/native/corehost/comhost/comhost.cpp +++ b/src/native/corehost/comhost/comhost.cpp @@ -10,6 +10,7 @@ #include "error_codes.h" #include "utils.h" #include +#include using comhost::clsid_map_entry; using comhost::clsid_map; @@ -273,7 +274,7 @@ namespace if (res != ERROR_SUCCESS) return __HRESULT_FROM_WIN32(res); - WCHAR regKeyProgIdClsidPath[ARRAYSIZE(regKeyProgIdPath) * 2]; + WCHAR regKeyProgIdClsidPath[ARRAY_SIZE(regKeyProgIdPath) * 2]; ::swprintf_s(regKeyProgIdClsidPath, L"%s\\CLSID", regKeyProgIdPath); HKEY regProgIdClsidRaw; @@ -350,7 +351,7 @@ namespace if (res != ERROR_SUCCESS) return __HRESULT_FROM_WIN32(res); - WCHAR regKeyServerPath[ARRAYSIZE(regKeyClsidPath) * 2]; + WCHAR regKeyServerPath[ARRAY_SIZE(regKeyClsidPath) * 2]; ::swprintf_s(regKeyServerPath, L"%s\\InProcServer32", regKeyClsidPath); HKEY regServerKeyRaw; @@ -411,7 +412,7 @@ namespace if (!entry.progid.empty()) { // Register the ProgID in the CLSID key - WCHAR regKeyProgIdPath[ARRAYSIZE(regKeyClsidPath) * 2]; + WCHAR regKeyProgIdPath[ARRAY_SIZE(regKeyClsidPath) * 2]; ::swprintf_s(regKeyProgIdPath, L"%s\\ProgID", regKeyClsidPath); HKEY regProgIdKeyRaw; diff --git a/src/native/corehost/hostmisc/pal.unix.cpp b/src/native/corehost/hostmisc/pal.unix.cpp index 0657041541af4a..8d3fcbb5314d0a 100644 --- a/src/native/corehost/hostmisc/pal.unix.cpp +++ b/src/native/corehost/hostmisc/pal.unix.cpp @@ -19,7 +19,7 @@ #include #include #include "config.h" -#include +#include #if defined(TARGET_OSX) #include diff --git a/src/native/corehost/hostpolicy/hostpolicy_context.cpp b/src/native/corehost/hostpolicy/hostpolicy_context.cpp index 324c70e63ff272..22d26f25d92aff 100644 --- a/src/native/corehost/hostpolicy/hostpolicy_context.cpp +++ b/src/native/corehost/hostpolicy/hostpolicy_context.cpp @@ -281,11 +281,16 @@ int hostpolicy_context_t::initialize(hostpolicy_init_t &hostpolicy_init, const a pal::string_t startup_hooks; if (pal::getenv(_X("DOTNET_STARTUP_HOOKS"), &startup_hooks)) { - if (!coreclr_properties.add(common_property::StartUpHooks, startup_hooks.c_str())) + const pal::char_t *config_startup_hooks; + if (coreclr_properties.try_get(common_property::StartUpHooks, &config_startup_hooks)) { - log_duplicate_property_error(coreclr_property_bag_t::common_property_to_string(common_property::StartUpHooks)); - return StatusCode::LibHostDuplicateProperty; + // env startup hooks shoold have precedence over config startup hooks + // therefore append config_startup_hooks AFTER startup_hooks + startup_hooks.push_back(PATH_SEPARATOR); + startup_hooks.append(config_startup_hooks); } + + coreclr_properties.add(common_property::StartUpHooks, startup_hooks.c_str()); } // Single-File Bundle Probe @@ -297,7 +302,7 @@ int hostpolicy_context_t::initialize(hostpolicy_init_t &hostpolicy_init, const a if (!coreclr_properties.add(common_property::BundleProbe, ptr_stream.str().c_str())) { - log_duplicate_property_error(coreclr_property_bag_t::common_property_to_string(common_property::StartUpHooks)); + log_duplicate_property_error(coreclr_property_bag_t::common_property_to_string(common_property::BundleProbe)); return StatusCode::LibHostDuplicateProperty; } } @@ -312,7 +317,7 @@ int hostpolicy_context_t::initialize(hostpolicy_init_t &hostpolicy_init, const a if (!coreclr_properties.add(common_property::PInvokeOverride, ptr_stream.str().c_str())) { - log_duplicate_property_error(coreclr_property_bag_t::common_property_to_string(common_property::StartUpHooks)); + log_duplicate_property_error(coreclr_property_bag_t::common_property_to_string(common_property::PInvokeOverride)); return StatusCode::LibHostDuplicateProperty; } } @@ -321,7 +326,7 @@ int hostpolicy_context_t::initialize(hostpolicy_init_t &hostpolicy_init, const a #if defined(HOSTPOLICY_EMBEDDED) if (!coreclr_properties.add(common_property::HostPolicyEmbedded, _X("true"))) { - log_duplicate_property_error(coreclr_property_bag_t::common_property_to_string(common_property::StartUpHooks)); + log_duplicate_property_error(coreclr_property_bag_t::common_property_to_string(common_property::HostPolicyEmbedded)); return StatusCode::LibHostDuplicateProperty; } #endif diff --git a/src/native/eventpipe/ds-ipc.c b/src/native/eventpipe/ds-ipc.c index 063b98b84aef86..b9c00030e69bf9 100644 --- a/src/native/eventpipe/ds-ipc.c +++ b/src/native/eventpipe/ds-ipc.c @@ -218,11 +218,11 @@ ipc_log_poll_handles (ds_rt_ipc_poll_handle_array_t *ipc_poll_handles) while (!ds_rt_ipc_poll_handle_array_iterator_end (ipc_poll_handles, &ipc_poll_handles_iterator)) { ipc_poll_handle = ds_rt_ipc_poll_handle_array_iterator_value (&ipc_poll_handles_iterator); if (ipc_poll_handle.ipc) { - if (!(ds_ipc_to_string (ipc_poll_handle.ipc, buffer, (uint32_t)EP_ARRAY_SIZE (buffer)) > 0)) + if (!(ds_ipc_to_string (ipc_poll_handle.ipc, buffer, (uint32_t)ARRAY_SIZE (buffer)) > 0)) buffer [0] = '\0'; DS_LOG_DEBUG_2 ("\tSERVER IpcPollHandle[%d] = %s", connection_id, buffer); } else { - if (!(ds_ipc_stream_to_string (ipc_poll_handle.stream, buffer, (uint32_t)EP_ARRAY_SIZE (buffer)))) + if (!(ds_ipc_stream_to_string (ipc_poll_handle.stream, buffer, (uint32_t)ARRAY_SIZE (buffer)))) buffer [0] = '\0'; DS_LOG_DEBUG_2 ("\tCLIENT IpcPollHandle[%d] = %s", connection_id, buffer); } @@ -703,7 +703,7 @@ connect_port_get_ipc_poll_handle_func ( } ep_char8_t buffer [DS_IPC_MAX_TO_STRING_LEN]; - if (!(ds_ipc_stream_to_string (connection, buffer, (uint32_t)EP_ARRAY_SIZE (buffer)))) + if (!(ds_ipc_stream_to_string (connection, buffer, (uint32_t)ARRAY_SIZE (buffer)))) buffer [0] = '\0'; DS_LOG_DEBUG_1 ("connect_port_get_ipc_poll_handle - returned connection %s", buffer); diff --git a/src/native/eventpipe/ds-profiler-protocol.c b/src/native/eventpipe/ds-profiler-protocol.c index 73999ffe429859..56cc5a559fdc94 100644 --- a/src/native/eventpipe/ds-profiler-protocol.c +++ b/src/native/eventpipe/ds-profiler-protocol.c @@ -67,7 +67,7 @@ attach_profiler_command_try_parse_payload ( instance->incoming_buffer = buffer; if (!ds_ipc_message_try_parse_uint32_t (&buffer_cursor, &buffer_cursor_len, &instance->attach_timeout ) || - !ds_ipc_message_try_parse_value (&buffer_cursor, &buffer_cursor_len, (uint8_t *)&instance->profiler_guid, (uint32_t)EP_ARRAY_SIZE (instance->profiler_guid)) || + !ds_ipc_message_try_parse_value (&buffer_cursor, &buffer_cursor_len, (uint8_t *)&instance->profiler_guid, (uint32_t)ARRAY_SIZE (instance->profiler_guid)) || !ds_ipc_message_try_parse_string_utf16_t (&buffer_cursor, &buffer_cursor_len, &instance->profiler_path) || !ds_ipc_message_try_parse_uint32_t (&buffer_cursor, &buffer_cursor_len, &instance->client_data_len) || !(buffer_cursor_len <= instance->client_data_len)) @@ -193,7 +193,7 @@ startup_profiler_command_try_parse_payload ( instance->incoming_buffer = buffer; - if (!ds_ipc_message_try_parse_value (&buffer_cursor, &buffer_cursor_len, (uint8_t *)&instance->profiler_guid, (uint32_t)EP_ARRAY_SIZE (instance->profiler_guid)) || + if (!ds_ipc_message_try_parse_value (&buffer_cursor, &buffer_cursor_len, (uint8_t *)&instance->profiler_guid, (uint32_t)ARRAY_SIZE (instance->profiler_guid)) || !ds_ipc_message_try_parse_string_utf16_t (&buffer_cursor, &buffer_cursor_len, &instance->profiler_path)) ep_raise_error (); @@ -223,7 +223,7 @@ profiler_protocol_helper_startup_profiler ( if (!ds_server_is_paused_in_startup()) { ds_ipc_message_send_error (stream, DS_IPC_E_INVALIDARG); ep_raise_error (); - } + } payload = (DiagnosticsStartupProfilerCommandPayload *)ds_ipc_message_try_parse_payload (message, startup_profiler_command_try_parse_payload); @@ -294,7 +294,7 @@ ds_profiler_protocol_helper_handle_ipc_message ( return true; } -#endif // PROFILING_SUPPORTED +#endif // PROFILING_SUPPORTED #endif /* !defined(DS_INCLUDE_SOURCE_FILES) || defined(DS_FORCE_INCLUDE_SOURCE_FILES) */ #endif /* ENABLE_PERFTRACING */ diff --git a/src/native/eventpipe/ep-block.c b/src/native/eventpipe/ep-block.c index 267ce30cbbd3cb..0bd7d1e941a765 100644 --- a/src/native/eventpipe/ep-block.c +++ b/src/native/eventpipe/ep-block.c @@ -441,7 +441,7 @@ ep_event_block_base_init ( event_block_base->use_header_compression = use_header_compression; - memset (event_block_base->compressed_header, 0, EP_ARRAY_SIZE (event_block_base->compressed_header)); + memset (event_block_base->compressed_header, 0, ARRAY_SIZE (event_block_base->compressed_header)); ep_event_block_base_clear (event_block_base); ep_on_exit: diff --git a/src/native/eventpipe/ep-event-instance.c b/src/native/eventpipe/ep-event-instance.c index b021ca399999a6..4266d2bbcf23bc 100644 --- a/src/native/eventpipe/ep-event-instance.c +++ b/src/native/eventpipe/ep-event-instance.c @@ -200,13 +200,13 @@ ep_event_instance_serialize_to_json_file ( int32_t characters_written = -1; characters_written = ep_rt_utf8_string_snprintf ( buffer, - EP_ARRAY_SIZE (buffer), + ARRAY_SIZE (buffer), "Provider=%s/EventID=%d/Version=%d", ep_provider_get_provider_name (ep_event_get_provider (ep_event_instance->ep_event)), ep_event_get_event_id (ep_event_instance->ep_event), ep_event_get_event_version (ep_event_instance->ep_event)); - if (characters_written > 0 && characters_written < (int32_t)EP_ARRAY_SIZE (buffer)) + if (characters_written > 0 && characters_written < (int32_t)ARRAY_SIZE (buffer)) ep_json_file_write_event_data (json_file, ep_event_instance->timestamp, ep_rt_uint64_t_to_thread_id_t (ep_event_instance->thread_id), buffer, &ep_event_instance->stack_contents); } #else diff --git a/src/native/eventpipe/ep-event-source.c b/src/native/eventpipe/ep-event-source.c index 237f0346128ded..36eac2dcbbfc45 100644 --- a/src/native/eventpipe/ep-event-source.c +++ b/src/native/eventpipe/ep-event-source.c @@ -100,7 +100,7 @@ ep_event_source_init (EventPipeEventSource *event_source) // Generate metadata. EventPipeParameterDesc params [3]; uint32_t params_len; - params_len = (uint32_t)EP_ARRAY_SIZE (params); + params_len = (uint32_t)ARRAY_SIZE (params); command_line_arg_utf16 = ep_rt_utf8_to_utf16_string ("CommandLine", -1); ep_raise_error_if_nok (command_line_arg_utf16 != NULL); @@ -221,7 +221,7 @@ ep_event_source_send_process_info ( if (arch_info_utf16) ep_event_data_init (&data[2], (uint64_t)arch_info_utf16, (uint32_t)((ep_rt_utf16_string_len (arch_info_utf16) + 1) * sizeof (ep_char16_t)), 0); - ep_write_event_2 (event_source->process_info_event, data, (uint32_t)EP_ARRAY_SIZE (data), NULL, NULL); + ep_write_event_2 (event_source->process_info_event, data, (uint32_t)ARRAY_SIZE (data), NULL, NULL); ep_rt_utf16_string_free (arch_info_utf16); ep_rt_utf16_string_free (os_info_utf16); diff --git a/src/native/eventpipe/ep-file.c b/src/native/eventpipe/ep-file.c index 40acec0a8392c0..1606d7a9c2fedd 100644 --- a/src/native/eventpipe/ep-file.c +++ b/src/native/eventpipe/ep-file.c @@ -398,7 +398,7 @@ ep_file_initialize_file (EventPipeFile *file) bool success = true; if (file->format >= EP_SERIALIZATION_FORMAT_NETTRACE_V4) { const ep_char8_t header[] = "Nettrace"; - const uint32_t bytes_to_write = (uint32_t)(EP_ARRAY_SIZE (header) - 1); + const uint32_t bytes_to_write = (uint32_t)(STRING_LENGTH (header)); uint32_t bytes_written = 0; success = ep_stream_writer_write (file->stream_writer, (const uint8_t *)header, bytes_to_write, &bytes_written) && bytes_written == bytes_to_write; } diff --git a/src/native/eventpipe/ep-json-file.c b/src/native/eventpipe/ep-json-file.c index 35d33b3026d09c..5340895424b036 100644 --- a/src/native/eventpipe/ep-json-file.c +++ b/src/native/eventpipe/ep-json-file.c @@ -111,8 +111,8 @@ ep_json_file_write_event_data ( ep_char8_t buffer [MAX_BUFFER_SIZE]; int32_t characters_written = -1; - characters_written = ep_rt_utf8_string_snprintf (buffer, EP_ARRAY_SIZE (buffer), "{\"Time\" : \"%f\", \"Metric\" : \"1\",\n\"Stack\": [\n\"", millis_since_trace_start); - if (characters_written > 0 && characters_written < (int32_t)EP_ARRAY_SIZE (buffer)) + characters_written = ep_rt_utf8_string_snprintf (buffer, ARRAY_SIZE (buffer), "{\"Time\" : \"%f\", \"Metric\" : \"1\",\n\"Stack\": [\n\"", millis_since_trace_start); + if (characters_written > 0 && characters_written < (int32_t)ARRAY_SIZE (buffer)) json_file_write_string (json_file, buffer); if (message) @@ -126,23 +126,23 @@ ep_json_file_write_event_data ( for (uint32_t i = 0; i < ep_stack_contents_get_length (stack_contents); ++i) { ep_rt_method_desc_t *method = ep_stack_contents_get_method (stack_contents, i); - if (!ep_rt_method_get_simple_assembly_name (method, assembly_name, EP_ARRAY_SIZE (assembly_name))) { + if (!ep_rt_method_get_simple_assembly_name (method, assembly_name, ARRAY_SIZE (assembly_name))) { assembly_name [0] = '?'; assembly_name [1] = 0; } - if (!ep_rt_method_get_full_name (method, method_name, EP_ARRAY_SIZE (method_name))) { + if (!ep_rt_method_get_full_name (method, method_name, ARRAY_SIZE (method_name))) { method_name [0] = '?'; method_name [1] = 0; } - characters_written = ep_rt_utf8_string_snprintf (buffer, EP_ARRAY_SIZE (buffer), "\"%s!%s\",\n", assembly_name, method_name); - if (characters_written > 0 && characters_written < (int32_t)EP_ARRAY_SIZE (buffer)) + characters_written = ep_rt_utf8_string_snprintf (buffer, ARRAY_SIZE (buffer), "\"%s!%s\",\n", assembly_name, method_name); + if (characters_written > 0 && characters_written < (int32_t)ARRAY_SIZE (buffer)) json_file_write_string (json_file, buffer); } - characters_written = ep_rt_utf8_string_snprintf (buffer, EP_ARRAY_SIZE (buffer), "\"Thread (%" PRIu64 ")\"]},", ep_rt_thread_id_t_to_uint64_t (thread_id)); - if (characters_written > 0 && characters_written < (int32_t)EP_ARRAY_SIZE (buffer)) + characters_written = ep_rt_utf8_string_snprintf (buffer, ARRAY_SIZE (buffer), "\"Thread (%" PRIu64 ")\"]},", ep_rt_thread_id_t_to_uint64_t (thread_id)); + if (characters_written > 0 && characters_written < (int32_t)ARRAY_SIZE (buffer)) json_file_write_string (json_file, buffer); } diff --git a/src/native/eventpipe/ep-rt.h b/src/native/eventpipe/ep-rt.h index d043710f46c1a6..4fc22632c6c17b 100644 --- a/src/native/eventpipe/ep-rt.h +++ b/src/native/eventpipe/ep-rt.h @@ -3,10 +3,11 @@ #include "ep-rt-config.h" +#include + #ifdef ENABLE_PERFTRACING #include "ep-types.h" -#define EP_ARRAY_SIZE(expr) ep_rt_redefine #define EP_INFINITE_WAIT ep_rt_redefine #define EP_GCX_PREEMP_ENTER ep_rt_redefine diff --git a/src/native/eventpipe/ep-session.c b/src/native/eventpipe/ep-session.c index dc3a259cae28ea..4f572f98b49b4e 100644 --- a/src/native/eventpipe/ep-session.c +++ b/src/native/eventpipe/ep-session.c @@ -276,7 +276,7 @@ ep_session_enable_rundown (EventPipeSession *session) const EventPipeEventLevel verbose_logging_level = EP_EVENT_LEVEL_VERBOSE; EventPipeProviderConfiguration rundown_providers [2]; - uint32_t rundown_providers_len = (uint32_t)EP_ARRAY_SIZE (rundown_providers); + uint32_t rundown_providers_len = (uint32_t)ARRAY_SIZE (rundown_providers); ep_provider_config_init (&rundown_providers [0], ep_config_get_public_provider_name_utf8 (), keywords, verbose_logging_level, NULL); // Public provider. ep_provider_config_init (&rundown_providers [1], ep_config_get_rundown_provider_name_utf8 (), keywords, verbose_logging_level, NULL); // Rundown provider. diff --git a/src/native/eventpipe/ep-stream.c b/src/native/eventpipe/ep-stream.c index f650dd61427627..fafe72b06db1de 100644 --- a/src/native/eventpipe/ep-stream.c +++ b/src/native/eventpipe/ep-stream.c @@ -167,7 +167,7 @@ ep_fast_serializer_alloc (StreamWriter *stream_writer) EP_ASSERT (stream_writer != NULL); const ep_char8_t signature[] = "!FastSerialization.1"; // the consumer lib expects exactly the same string, it must not be changed - uint32_t signature_len = (uint32_t)(EP_ARRAY_SIZE (signature) - 1); + uint32_t signature_len = (uint32_t)(STRING_LENGTH (signature)); FastSerializer *instance = ep_rt_object_alloc (FastSerializer); ep_raise_error_if_nok (instance != NULL); diff --git a/src/native/eventpipe/ep.c b/src/native/eventpipe/ep.c index ae8f3ce24f62fe..bdac36b3effe49 100644 --- a/src/native/eventpipe/ep.c +++ b/src/native/eventpipe/ep.c @@ -868,7 +868,7 @@ enable_default_session_via_env_variables (void) ep_config_output_path = ep_rt_config_value_get_output_path (); ep_char8_t pidStr[24]; - ep_rt_utf8_string_snprintf(pidStr, EP_ARRAY_SIZE (pidStr), "%u", (unsigned)ep_rt_current_process_get_id()); + ep_rt_utf8_string_snprintf(pidStr, ARRAY_SIZE (pidStr), "%u", (unsigned)ep_rt_current_process_get_id()); while (true) { @@ -1115,7 +1115,7 @@ ep_disable (EventPipeSessionID id) // single threaded. HOWEVER, if the runtime was suspended during startup, // then ep_finish_init might not have executed yet. Disabling a session // needs to either happen before we resume or after initialization. We briefly take the - // lock to check _ep_can_start_threads to check whether we've finished initialization. We + // lock to check _ep_can_start_threads to check whether we've finished initialization. We // also check whether we are still suspended in which case we can safely disable the session // without deferral. EP_LOCK_ENTER (section1) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt new file mode 100644 index 00000000000000..46dfafc4ee6953 --- /dev/null +++ b/src/native/libs/CMakeLists.txt @@ -0,0 +1,176 @@ +cmake_minimum_required(VERSION 3.6.2) +include(CheckCCompilerFlag) + +if (CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) + # CMake 3.14.5 contains bug fixes for iOS + cmake_minimum_required(VERSION 3.14.5) +elseif (CLR_CMAKE_TARGET_MACCATALYST) + # CMake 3.18.1 properly generates MacCatalyst C compiler + cmake_minimum_required(VERSION 3.18.1) +endif () + +if (WIN32) + cmake_policy(SET CMP0091 NEW) +else () + cmake_policy(SET CMP0042 NEW) +endif () + +project(CoreFX C) + +include(../../../eng/native/configurepaths.cmake) +include(${CLR_ENG_NATIVE_DIR}/configurecompiler.cmake) + +include_directories(${CLR_SRC_NATIVE_DIR}) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +if (STATIC_LIBS_ONLY) + # Suppress exporting of the PAL APIs + add_definitions(-DPALEXPORT=EXTERN_C) + + set(GEN_SHARED_LIB 0) + set(STATIC_LIB_DESTINATION lib) +else () + set(GEN_SHARED_LIB 1) + set(STATIC_LIB_DESTINATION .) +endif () + +if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER) + set(CMAKE_MACOSX_RPATH ON) + if (CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) + set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) + set(CMAKE_INSTALL_NAME_DIR "@rpath") + endif () + + set(CMAKE_INSTALL_PREFIX $ENV{__CMakeBinDir}) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") + + add_compile_options(-I${CMAKE_CURRENT_SOURCE_DIR}/Common) + add_compile_options(-I${CMAKE_CURRENT_BINARY_DIR}/Common) + + if (CLR_CMAKE_TARGET_BROWSER) + set(GEN_SHARED_LIB 0) + set(STATIC_LIB_DESTINATION .) + endif () + + if (CLR_CMAKE_TARGET_TVOS) + # with -fembed-bitcode passing -headerpad_max_install_names is not allowed so remove it from the CMake flags + string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_C_LINK_FLAGS ${CMAKE_C_LINK_FLAGS}) + string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) + add_compile_options(-fembed-bitcode) + add_link_options(-fembed-bitcode) + endif () + + if (CLR_CMAKE_TARGET_ANDROID) + if (CROSS_ROOTFS) + include_directories(SYSTEM "${CROSS_ROOTFS}/usr/include") + endif () + endif () + + string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_CMAKE_BUILD_TYPE) + + if (UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL CHECKED) + if (UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG) + add_compile_options(-O0) + elseif (UPPERCASE_CMAKE_BUILD_TYPE STREQUAL CHECKED) + add_compile_options(-O2) + endif () + + add_definitions(-DDEBUG) + + # obtain settings from running coreclr\enablesanitizers.sh + string(FIND "$ENV{DEBUG_SANITIZERS}" "asan" __ASAN_POS) + string(FIND "$ENV{DEBUG_SANITIZERS}" "ubsan" __UBSAN_POS) + if (${__ASAN_POS} GREATER -1 OR ${__UBSAN_POS} GREATER -1) + set(CLR_SANITIZE_LINK_FLAGS "${CLR_SANITIZE_LINK_FLAGS} -fsanitize=") + if (${__ASAN_POS} GREATER -1) + set(CLR_SANITIZE_LINK_FLAGS "${CLR_SANITIZE_LINK_FLAGS}address,") + message("Address Sanitizer (asan) enabled") + endif () + if (${__UBSAN_POS} GREATER -1) + set(CLR_SANITIZE_LINK_FLAGS "${CLR_SANITIZE_LINK_FLAGS}undefined") + message("Undefined Behavior Sanitizer (ubsan) enabled") + endif () + + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CLR_SANITIZE_LINK_FLAGS}") + + # -Wl and --gc-sections: drop unused sections\functions (similar to Windows /Gy function-level-linking) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CLR_SANITIZE_LINK_FLAGS} -Wl,--gc-sections") + endif () + elseif (UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELEASE) + # Use O1 option when the clang version is smaller than 3.9 + # Otherwise use O3 option in release build + if (CLR_CMAKE_TARGET_ARCH_ARMV7L AND DEFINED ENV{CROSSCOMPILE} AND CMAKE_C_COMPILER_VERSION VERSION_LESS 3.9) + add_compile_options (-O1) + else () + add_compile_options (-O3) + endif () + else () + message(FATAL_ERROR "Unknown build type. Set CMAKE_BUILD_TYPE to DEBUG or RELEASE.") + endif () + + if (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) + add_definitions(-D__APPLE_USE_RFC_3542) + endif () + + if (CLR_CMAKE_TARGET_LINUX) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE") + endif () +else () + set(CMAKE_SHARED_LIBRARY_PREFIX "") + + # we only need to build System.Globalization.Native when building static libs. + if (STATIC_LIBS_ONLY) + add_subdirectory(System.Globalization.Native) + endif () +endif () + +add_subdirectory(System.IO.Compression.Native) + +if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER) + include(configure.cmake) + + if (NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID) + add_subdirectory(System.IO.Ports.Native) + endif () + + if (CMAKE_C_COMPILER_ID STREQUAL Clang) + add_compile_options(-Weverything) + add_compile_options(-Wno-format-nonliteral) + add_compile_options(-Wno-disabled-macro-expansion) + add_compile_options(-Wno-padded) + add_compile_options(-Wno-empty-translation-unit) + add_compile_options(-Wno-cast-align) + add_compile_options(-Wno-typedef-redefinition) + add_compile_options(-Wno-c11-extensions) + add_compile_options(-Wno-thread-safety-analysis) + endif () + + add_subdirectory(System.Native) + + if (CLR_CMAKE_TARGET_BROWSER) + # skip for now + elseif (CLR_CMAKE_TARGET_MACCATALYST) + add_subdirectory(System.Net.Security.Native) + # System.Security.Cryptography.Native is intentionally disabled on iOS + # it is only used for interacting with OpenSSL which isn't useful there + elseif (CLR_CMAKE_TARGET_IOS) + add_subdirectory(System.Net.Security.Native) + # System.Security.Cryptography.Native is intentionally disabled on iOS + # it is only used for interacting with OpenSSL which isn't useful there + elseif (CLR_CMAKE_TARGET_TVOS) + #add_subdirectory(System.Net.Security.Native) # no gssapi on tvOS, see https://developer.apple.com/documentation/gss + # System.Security.Cryptography.Native is intentionally disabled on tvOS + # it is only used for interacting with OpenSSL which isn't useful there + elseif (CLR_CMAKE_TARGET_ANDROID) + add_subdirectory(System.Security.Cryptography.Native.Android) + else () + add_subdirectory(System.Globalization.Native) + add_subdirectory(System.Net.Security.Native) + add_subdirectory(System.Security.Cryptography.Native) + endif () + + if (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) + add_subdirectory(System.Security.Cryptography.Native.Apple) + endif () +endif () diff --git a/src/libraries/Native/Unix/Common/pal_atomic.h b/src/native/libs/Common/pal_atomic.h similarity index 100% rename from src/libraries/Native/Unix/Common/pal_atomic.h rename to src/native/libs/Common/pal_atomic.h diff --git a/src/libraries/Native/Unix/Common/pal_compiler.h b/src/native/libs/Common/pal_compiler.h similarity index 100% rename from src/libraries/Native/Unix/Common/pal_compiler.h rename to src/native/libs/Common/pal_compiler.h diff --git a/src/libraries/Native/Unix/Common/pal_config.h.in b/src/native/libs/Common/pal_config.h.in similarity index 99% rename from src/libraries/Native/Unix/Common/pal_config.h.in rename to src/native/libs/Common/pal_config.h.in index 9cffccbb0cc718..00b774b87341b4 100644 --- a/src/libraries/Native/Unix/Common/pal_config.h.in +++ b/src/native/libs/Common/pal_config.h.in @@ -112,6 +112,7 @@ #cmakedefine01 HAVE_GETDOMAINNAME #cmakedefine01 HAVE_UNAME #cmakedefine01 HAVE_UTIMENSAT +#cmakedefine01 HAVE_LUTIMES #cmakedefine01 HAVE_FUTIMES #cmakedefine01 HAVE_FUTIMENS #cmakedefine01 HAVE_MKSTEMPS diff --git a/src/libraries/Native/Unix/Common/pal_error_common.h b/src/native/libs/Common/pal_error_common.h similarity index 100% rename from src/libraries/Native/Unix/Common/pal_error_common.h rename to src/native/libs/Common/pal_error_common.h diff --git a/src/libraries/Native/Unix/Common/pal_io_common.h b/src/native/libs/Common/pal_io_common.h similarity index 99% rename from src/libraries/Native/Unix/Common/pal_io_common.h rename to src/native/libs/Common/pal_io_common.h index 0cd640cca9d47c..82a82897444739 100644 --- a/src/libraries/Native/Unix/Common/pal_io_common.h +++ b/src/native/libs/Common/pal_io_common.h @@ -8,6 +8,7 @@ #include #include #include +#include /** * Our intermediate pollfd struct to normalize the data types diff --git a/src/libraries/Native/Unix/Common/pal_networking_common.h b/src/native/libs/Common/pal_networking_common.h similarity index 100% rename from src/libraries/Native/Unix/Common/pal_networking_common.h rename to src/native/libs/Common/pal_networking_common.h diff --git a/src/libraries/Native/Unix/Common/pal_safecrt.h b/src/native/libs/Common/pal_safecrt.h similarity index 100% rename from src/libraries/Native/Unix/Common/pal_safecrt.h rename to src/native/libs/Common/pal_safecrt.h diff --git a/src/libraries/Native/Unix/Common/pal_ssl_types.h b/src/native/libs/Common/pal_ssl_types.h similarity index 100% rename from src/libraries/Native/Unix/Common/pal_ssl_types.h rename to src/native/libs/Common/pal_ssl_types.h diff --git a/src/libraries/Native/Unix/Common/pal_types.h b/src/native/libs/Common/pal_types.h similarity index 100% rename from src/libraries/Native/Unix/Common/pal_types.h rename to src/native/libs/Common/pal_types.h diff --git a/src/libraries/Native/Unix/Common/pal_utilities.h b/src/native/libs/Common/pal_utilities.h similarity index 98% rename from src/libraries/Native/Unix/Common/pal_utilities.h rename to src/native/libs/Common/pal_utilities.h index 55d35030ce24df..4e582ed6cd0027 100644 --- a/src/libraries/Native/Unix/Common/pal_utilities.h +++ b/src/native/libs/Common/pal_utilities.h @@ -43,8 +43,6 @@ #define CONST_CAST2(TOTYPE, FROMTYPE, X) ((union { FROMTYPE _q; TOTYPE _nq; }){ ._q = (X) }._nq) #define CONST_CAST(TYPE, X) CONST_CAST2(TYPE, const TYPE, (X)) -#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0])) - #if __has_attribute(fallthrough) #define FALLTHROUGH __attribute__((fallthrough)) #else diff --git a/src/libraries/Native/Unix/Common/pal_x509_types.h b/src/native/libs/Common/pal_x509_types.h similarity index 100% rename from src/libraries/Native/Unix/Common/pal_x509_types.h rename to src/native/libs/Common/pal_x509_types.h diff --git a/src/libraries/Native/Unix/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/CMakeLists.txt rename to src/native/libs/System.Globalization.Native/CMakeLists.txt diff --git a/src/libraries/Native/Unix/System.Globalization.Native/config.h.in b/src/native/libs/System.Globalization.Native/config.h.in similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/config.h.in rename to src/native/libs/System.Globalization.Native/config.h.in diff --git a/src/libraries/Native/Unix/System.Globalization.Native/configure.cmake b/src/native/libs/System.Globalization.Native/configure.cmake similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/configure.cmake rename to src/native/libs/System.Globalization.Native/configure.cmake diff --git a/src/libraries/Native/Unix/System.Globalization.Native/entrypoints.c b/src/native/libs/System.Globalization.Native/entrypoints.c similarity index 95% rename from src/libraries/Native/Unix/System.Globalization.Native/entrypoints.c rename to src/native/libs/System.Globalization.Native/entrypoints.c index 70db3145cd48b3..8d4901f62dcf6d 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/entrypoints.c +++ b/src/native/libs/System.Globalization.Native/entrypoints.c @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#include +#include typedef uint16_t UChar; @@ -64,5 +64,5 @@ EXTERN_C const void* GlobalizationResolveDllImport(const char* name); EXTERN_C const void* GlobalizationResolveDllImport(const char* name) { - return minipal_resolve_dllimport(s_globalizationNative, lengthof(s_globalizationNative), name); + return minipal_resolve_dllimport(s_globalizationNative, ARRAY_SIZE(s_globalizationNative), name); } diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_calendarData.c b/src/native/libs/System.Globalization.Native/pal_calendarData.c similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_calendarData.c rename to src/native/libs/System.Globalization.Native/pal_calendarData.c diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_calendarData.h b/src/native/libs/System.Globalization.Native/pal_calendarData.h similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_calendarData.h rename to src/native/libs/System.Globalization.Native/pal_calendarData.h diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_casing.c b/src/native/libs/System.Globalization.Native/pal_casing.c similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_casing.c rename to src/native/libs/System.Globalization.Native/pal_casing.c diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_casing.h b/src/native/libs/System.Globalization.Native/pal_casing.h similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_casing.h rename to src/native/libs/System.Globalization.Native/pal_casing.h diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_collation.c b/src/native/libs/System.Globalization.Native/pal_collation.c similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_collation.c rename to src/native/libs/System.Globalization.Native/pal_collation.c diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_collation.h b/src/native/libs/System.Globalization.Native/pal_collation.h similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_collation.h rename to src/native/libs/System.Globalization.Native/pal_collation.h diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_errors.h b/src/native/libs/System.Globalization.Native/pal_errors.h similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_errors.h rename to src/native/libs/System.Globalization.Native/pal_errors.h diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_errors_internal.h b/src/native/libs/System.Globalization.Native/pal_errors_internal.h similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_errors_internal.h rename to src/native/libs/System.Globalization.Native/pal_errors_internal.h diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim.c b/src/native/libs/System.Globalization.Native/pal_icushim.c similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_icushim.c rename to src/native/libs/System.Globalization.Native/pal_icushim.c diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim.h b/src/native/libs/System.Globalization.Native/pal_icushim.h similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_icushim.h rename to src/native/libs/System.Globalization.Native/pal_icushim.h diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim_internal.h b/src/native/libs/System.Globalization.Native/pal_icushim_internal.h similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_icushim_internal.h rename to src/native/libs/System.Globalization.Native/pal_icushim_internal.h diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim_internal_android.h b/src/native/libs/System.Globalization.Native/pal_icushim_internal_android.h similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_icushim_internal_android.h rename to src/native/libs/System.Globalization.Native/pal_icushim_internal_android.h diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_icushim_static.c b/src/native/libs/System.Globalization.Native/pal_icushim_static.c similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_icushim_static.c rename to src/native/libs/System.Globalization.Native/pal_icushim_static.c diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_idna.c b/src/native/libs/System.Globalization.Native/pal_idna.c similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_idna.c rename to src/native/libs/System.Globalization.Native/pal_idna.c diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_idna.h b/src/native/libs/System.Globalization.Native/pal_idna.h similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_idna.h rename to src/native/libs/System.Globalization.Native/pal_idna.h diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_locale.c b/src/native/libs/System.Globalization.Native/pal_locale.c similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_locale.c rename to src/native/libs/System.Globalization.Native/pal_locale.c diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_locale.h b/src/native/libs/System.Globalization.Native/pal_locale.h similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_locale.h rename to src/native/libs/System.Globalization.Native/pal_locale.h diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_localeNumberData.c b/src/native/libs/System.Globalization.Native/pal_localeNumberData.c similarity index 96% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_localeNumberData.c rename to src/native/libs/System.Globalization.Native/pal_localeNumberData.c index 686fbf5631fd97..9c82586c687755 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/pal_localeNumberData.c +++ b/src/native/libs/System.Globalization.Native/pal_localeNumberData.c @@ -7,6 +7,8 @@ #include #include +#include + #include "pal_locale_internal.h" #include "pal_localeNumberData.h" @@ -21,8 +23,6 @@ #define UCHAR_CLOSEPAREN ((UChar)0x0029) // ')' #define UCHAR_ZERO ((UChar)0x0030) // '0' -#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0])) - /* Function: NormalizeNumericPattern @@ -239,7 +239,7 @@ static int GetCurrencyNegativePattern(const char* locale) if (U_SUCCESS(status)) { - int value = GetNumericPattern(pFormat, Patterns, ARRAY_LENGTH(Patterns), true); + int value = GetNumericPattern(pFormat, Patterns, ARRAY_SIZE(Patterns), true); if (value >= 0) { unum_close(pFormat); @@ -270,7 +270,7 @@ static int GetCurrencyPositivePattern(const char* locale) if (U_SUCCESS(status)) { - int value = GetNumericPattern(pFormat, Patterns, ARRAY_LENGTH(Patterns), false); + int value = GetNumericPattern(pFormat, Patterns, ARRAY_SIZE(Patterns), false); if (value >= 0) { unum_close(pFormat); @@ -301,7 +301,7 @@ static int GetNumberNegativePattern(const char* locale) if (U_SUCCESS(status)) { - int value = GetNumericPattern(pFormat, Patterns, ARRAY_LENGTH(Patterns), true); + int value = GetNumericPattern(pFormat, Patterns, ARRAY_SIZE(Patterns), true); if (value >= 0) { unum_close(pFormat); @@ -333,7 +333,7 @@ static int GetPercentNegativePattern(const char* locale) if (U_SUCCESS(status)) { - int value = GetNumericPattern(pFormat, Patterns, ARRAY_LENGTH(Patterns), true); + int value = GetNumericPattern(pFormat, Patterns, ARRAY_SIZE(Patterns), true); if (value >= 0) { unum_close(pFormat); @@ -364,7 +364,7 @@ static int GetPercentPositivePattern(const char* locale) if (U_SUCCESS(status)) { - int value = GetNumericPattern(pFormat, Patterns, ARRAY_LENGTH(Patterns), false); + int value = GetNumericPattern(pFormat, Patterns, ARRAY_SIZE(Patterns), false); if (value >= 0) { unum_close(pFormat); diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_localeNumberData.h b/src/native/libs/System.Globalization.Native/pal_localeNumberData.h similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_localeNumberData.h rename to src/native/libs/System.Globalization.Native/pal_localeNumberData.h diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_localeStringData.c b/src/native/libs/System.Globalization.Native/pal_localeStringData.c similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_localeStringData.c rename to src/native/libs/System.Globalization.Native/pal_localeStringData.c diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_localeStringData.h b/src/native/libs/System.Globalization.Native/pal_localeStringData.h similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_localeStringData.h rename to src/native/libs/System.Globalization.Native/pal_localeStringData.h diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_locale_internal.h b/src/native/libs/System.Globalization.Native/pal_locale_internal.h similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_locale_internal.h rename to src/native/libs/System.Globalization.Native/pal_locale_internal.h diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_normalization.c b/src/native/libs/System.Globalization.Native/pal_normalization.c similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_normalization.c rename to src/native/libs/System.Globalization.Native/pal_normalization.c diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_normalization.h b/src/native/libs/System.Globalization.Native/pal_normalization.h similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_normalization.h rename to src/native/libs/System.Globalization.Native/pal_normalization.h diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_timeZoneInfo.c b/src/native/libs/System.Globalization.Native/pal_timeZoneInfo.c similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_timeZoneInfo.c rename to src/native/libs/System.Globalization.Native/pal_timeZoneInfo.c diff --git a/src/libraries/Native/Unix/System.Globalization.Native/pal_timeZoneInfo.h b/src/native/libs/System.Globalization.Native/pal_timeZoneInfo.h similarity index 100% rename from src/libraries/Native/Unix/System.Globalization.Native/pal_timeZoneInfo.h rename to src/native/libs/System.Globalization.Native/pal_timeZoneInfo.h diff --git a/src/native/libs/System.IO.Compression.Native/CMakeLists.txt b/src/native/libs/System.IO.Compression.Native/CMakeLists.txt new file mode 100644 index 00000000000000..4dcc4b8b7a4bf6 --- /dev/null +++ b/src/native/libs/System.IO.Compression.Native/CMakeLists.txt @@ -0,0 +1,186 @@ +project(System.IO.Compression.Native C) + +include(${CMAKE_CURRENT_LIST_DIR}/extra_libs.cmake) + +set(NATIVECOMPRESSION_SOURCES + pal_zlib.c +) + +if (NOT CLR_CMAKE_TARGET_BROWSER) + #Include Brotli include files + include_directories("brotli/include") + + set (NATIVECOMPRESSION_SOURCES + ${NATIVECOMPRESSION_SOURCES} + brotli/common/constants.c + brotli/common/context.c + brotli/common/dictionary.c + brotli/common/platform.c + brotli/common/transform.c + brotli/dec/bit_reader.c + brotli/dec/decode.c + brotli/dec/huffman.c + brotli/dec/state.c + brotli/enc/backward_references.c + brotli/enc/backward_references_hq.c + brotli/enc/bit_cost.c + brotli/enc/block_splitter.c + brotli/enc/brotli_bit_stream.c + brotli/enc/cluster.c + brotli/enc/command.c + brotli/enc/compress_fragment.c + brotli/enc/compress_fragment_two_pass.c + brotli/enc/dictionary_hash.c + brotli/enc/encode.c + brotli/enc/encoder_dict.c + brotli/enc/entropy_encode.c + brotli/enc/fast_log.c + brotli/enc/histogram.c + brotli/enc/literal_cost.c + brotli/enc/memory.c + brotli/enc/metablock.c + brotli/enc/static_dict.c + brotli/enc/utf8_util.c + entrypoints.c + ) +endif () + +if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER) + set(NATIVE_LIBS_EXTRA) + append_extra_compression_libs(NATIVE_LIBS_EXTRA) + + if (CLR_CMAKE_TARGET_BROWSER) + add_definitions(-s USE_ZLIB) + else () + # Disable implicit fallthrough warning for Brotli + set(FLAGS -Wno-implicit-fallthrough) + + # Delete this supression once brotli is upgraded to vNext (current latest v1.0.9 + # does not contain upstream fix: https://github.com/google/brotli/commit/0a3944c) + set(FLAGS "${FLAGS} -Wno-vla-parameter") + + set_source_files_properties(${NATIVECOMPRESSION_SOURCES} PROPERTIES COMPILE_FLAGS ${FLAGS}) + endif () + + if (GEN_SHARED_LIB) + add_definitions(-DBROTLI_SHARED_COMPILATION) + + add_library(System.IO.Compression.Native + SHARED + ${NATIVECOMPRESSION_SOURCES} + ${VERSION_FILE_PATH} + ) + + target_link_libraries(System.IO.Compression.Native + ${NATIVE_LIBS_EXTRA} + ) + + if (NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID) + set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/System.IO.Compression.Native_unixexports.src) + set(EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/System.IO.Compression.Native.exports) + generate_exports_file(${DEF_SOURCES} ${EXPORTS_FILE}) + set_exports_linker_option(${EXPORTS_FILE}) + + add_custom_target(System.IO.Compression.Native_exports DEPENDS ${EXPORTS_FILE}) + add_dependencies(System.IO.Compression.Native System.IO.Compression.Native_exports) + + set_property(TARGET System.IO.Compression.Native APPEND_STRING PROPERTY LINK_FLAGS ${EXPORTS_LINKER_OPTION}) + set_property(TARGET System.IO.Compression.Native APPEND_STRING PROPERTY LINK_DEPENDS ${EXPORTS_FILE}) + + add_custom_command(TARGET System.IO.Compression.Native POST_BUILD + COMMENT "Verifying System.IO.Compression.Native entry points against entrypoints.c " + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../verify-entrypoints.sh + $ + ${CMAKE_CURRENT_SOURCE_DIR}/entrypoints.c + ${CMAKE_NM} + VERBATIM + ) + endif () + + install_with_stripped_symbols (System.IO.Compression.Native PROGRAMS .) + endif () + + add_library(System.IO.Compression.Native-Static + STATIC + ${NATIVECOMPRESSION_SOURCES} + ) + + set_target_properties(System.IO.Compression.Native-Static PROPERTIES OUTPUT_NAME System.IO.Compression.Native CLEAN_DIRECT_OUTPUT 1) +else () + if (GEN_SHARED_LIB) + include (GenerateExportHeader) + endif () + + if (CLR_CMAKE_HOST_ARCH_I386 OR CLR_CMAKE_HOST_ARCH_AMD64) + set(ZLIB_SOURCES + zlib-intel/adler32.c + zlib-intel/compress.c + zlib-intel/crc_folding.c + zlib-intel/crc32.c + zlib-intel/deflate_medium.c + zlib-intel/deflate_quick.c + zlib-intel/deflate.c + zlib-intel/inffast.c + zlib-intel/inflate.c + zlib-intel/inftrees.c + zlib-intel/match.c + zlib-intel/slide_sse.c + zlib-intel/trees.c + zlib-intel/x86.c + zlib-intel/zutil.c + ) + else () + set(ZLIB_SOURCES + zlib/adler32.c + zlib/compress.c + zlib/crc32.c + zlib/deflate.c + zlib/inffast.c + zlib/inflate.c + zlib/inftrees.c + zlib/trees.c + zlib/zutil.c + ) + endif () + + set(NATIVECOMPRESSION_SOURCES ${ZLIB_SOURCES} ${NATIVECOMPRESSION_SOURCES}) + + if (GEN_SHARED_LIB) + add_library(System.IO.Compression.Native + SHARED + ${NATIVECOMPRESSION_SOURCES} + System.IO.Compression.Native.def + # This will add versioning to the library + ${VERSION_FILE_RC_PATH} + ) + endif () + + if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) + set(NATIVECOMPRESSION_SOURCES ${NATIVECOMPRESSION_SOURCES} entrypoints.c) + endif () + + add_library(System.IO.Compression.Native-Static + STATIC + ${NATIVECOMPRESSION_SOURCES} + ) + + # Allow specification of libraries that should be linked against + if (GEN_SHARED_LIB) + target_link_libraries(System.IO.Compression.Native ${__LinkLibraries}) + endif () + target_link_libraries(System.IO.Compression.Native-Static ${__LinkLibraries}) + + if (GEN_SHARED_LIB) + GENERATE_EXPORT_HEADER( System.IO.Compression.Native + BASE_NAME System.IO.Compression.Native + EXPORT_MACRO_NAME System.IO.Compression.Native_EXPORT + EXPORT_FILE_NAME System.IO.Compression.Native_Export.h + STATIC_DEFINE System.IO.Compression.Native_BUILT_AS_STATIC + ) + + install (TARGETS System.IO.Compression.Native DESTINATION .) + install (FILES $ DESTINATION .) + endif () +endif () + +install (TARGETS System.IO.Compression.Native-Static DESTINATION ${STATIC_LIB_DESTINATION} COMPONENT libs) diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/Native.rc b/src/native/libs/System.IO.Compression.Native/Native.rc similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/Native.rc rename to src/native/libs/System.IO.Compression.Native/Native.rc diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/System.IO.Compression.Native.def b/src/native/libs/System.IO.Compression.Native/System.IO.Compression.Native.def similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/System.IO.Compression.Native.def rename to src/native/libs/System.IO.Compression.Native/System.IO.Compression.Native.def diff --git a/src/libraries/Native/Unix/System.IO.Compression.Native/System.IO.Compression.Native_unixexports.src b/src/native/libs/System.IO.Compression.Native/System.IO.Compression.Native_unixexports.src similarity index 100% rename from src/libraries/Native/Unix/System.IO.Compression.Native/System.IO.Compression.Native_unixexports.src rename to src/native/libs/System.IO.Compression.Native/System.IO.Compression.Native_unixexports.src diff --git a/src/libraries/Native/AnyOS/brotli-version.txt b/src/native/libs/System.IO.Compression.Native/brotli-version.txt similarity index 100% rename from src/libraries/Native/AnyOS/brotli-version.txt rename to src/native/libs/System.IO.Compression.Native/brotli-version.txt diff --git a/src/libraries/Native/AnyOS/brotli/common/constants.c b/src/native/libs/System.IO.Compression.Native/brotli/common/constants.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/common/constants.c rename to src/native/libs/System.IO.Compression.Native/brotli/common/constants.c diff --git a/src/libraries/Native/AnyOS/brotli/common/constants.h b/src/native/libs/System.IO.Compression.Native/brotli/common/constants.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/common/constants.h rename to src/native/libs/System.IO.Compression.Native/brotli/common/constants.h diff --git a/src/libraries/Native/AnyOS/brotli/common/context.c b/src/native/libs/System.IO.Compression.Native/brotli/common/context.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/common/context.c rename to src/native/libs/System.IO.Compression.Native/brotli/common/context.c diff --git a/src/libraries/Native/AnyOS/brotli/common/context.h b/src/native/libs/System.IO.Compression.Native/brotli/common/context.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/common/context.h rename to src/native/libs/System.IO.Compression.Native/brotli/common/context.h diff --git a/src/libraries/Native/AnyOS/brotli/common/dictionary.bin b/src/native/libs/System.IO.Compression.Native/brotli/common/dictionary.bin similarity index 100% rename from src/libraries/Native/AnyOS/brotli/common/dictionary.bin rename to src/native/libs/System.IO.Compression.Native/brotli/common/dictionary.bin diff --git a/src/libraries/Native/AnyOS/brotli/common/dictionary.bin.br b/src/native/libs/System.IO.Compression.Native/brotli/common/dictionary.bin.br similarity index 100% rename from src/libraries/Native/AnyOS/brotli/common/dictionary.bin.br rename to src/native/libs/System.IO.Compression.Native/brotli/common/dictionary.bin.br diff --git a/src/libraries/Native/AnyOS/brotli/common/dictionary.c b/src/native/libs/System.IO.Compression.Native/brotli/common/dictionary.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/common/dictionary.c rename to src/native/libs/System.IO.Compression.Native/brotli/common/dictionary.c diff --git a/src/libraries/Native/AnyOS/brotli/common/dictionary.h b/src/native/libs/System.IO.Compression.Native/brotli/common/dictionary.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/common/dictionary.h rename to src/native/libs/System.IO.Compression.Native/brotli/common/dictionary.h diff --git a/src/libraries/Native/AnyOS/brotli/common/platform.c b/src/native/libs/System.IO.Compression.Native/brotli/common/platform.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/common/platform.c rename to src/native/libs/System.IO.Compression.Native/brotli/common/platform.c diff --git a/src/libraries/Native/AnyOS/brotli/common/platform.h b/src/native/libs/System.IO.Compression.Native/brotli/common/platform.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/common/platform.h rename to src/native/libs/System.IO.Compression.Native/brotli/common/platform.h diff --git a/src/libraries/Native/AnyOS/brotli/common/transform.c b/src/native/libs/System.IO.Compression.Native/brotli/common/transform.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/common/transform.c rename to src/native/libs/System.IO.Compression.Native/brotli/common/transform.c diff --git a/src/libraries/Native/AnyOS/brotli/common/transform.h b/src/native/libs/System.IO.Compression.Native/brotli/common/transform.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/common/transform.h rename to src/native/libs/System.IO.Compression.Native/brotli/common/transform.h diff --git a/src/libraries/Native/AnyOS/brotli/common/version.h b/src/native/libs/System.IO.Compression.Native/brotli/common/version.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/common/version.h rename to src/native/libs/System.IO.Compression.Native/brotli/common/version.h diff --git a/src/libraries/Native/AnyOS/brotli/dec/bit_reader.c b/src/native/libs/System.IO.Compression.Native/brotli/dec/bit_reader.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/dec/bit_reader.c rename to src/native/libs/System.IO.Compression.Native/brotli/dec/bit_reader.c diff --git a/src/libraries/Native/AnyOS/brotli/dec/bit_reader.h b/src/native/libs/System.IO.Compression.Native/brotli/dec/bit_reader.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/dec/bit_reader.h rename to src/native/libs/System.IO.Compression.Native/brotli/dec/bit_reader.h diff --git a/src/libraries/Native/AnyOS/brotli/dec/decode.c b/src/native/libs/System.IO.Compression.Native/brotli/dec/decode.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/dec/decode.c rename to src/native/libs/System.IO.Compression.Native/brotli/dec/decode.c diff --git a/src/libraries/Native/AnyOS/brotli/dec/huffman.c b/src/native/libs/System.IO.Compression.Native/brotli/dec/huffman.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/dec/huffman.c rename to src/native/libs/System.IO.Compression.Native/brotli/dec/huffman.c diff --git a/src/libraries/Native/AnyOS/brotli/dec/huffman.h b/src/native/libs/System.IO.Compression.Native/brotli/dec/huffman.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/dec/huffman.h rename to src/native/libs/System.IO.Compression.Native/brotli/dec/huffman.h diff --git a/src/libraries/Native/AnyOS/brotli/dec/prefix.h b/src/native/libs/System.IO.Compression.Native/brotli/dec/prefix.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/dec/prefix.h rename to src/native/libs/System.IO.Compression.Native/brotli/dec/prefix.h diff --git a/src/libraries/Native/AnyOS/brotli/dec/state.c b/src/native/libs/System.IO.Compression.Native/brotli/dec/state.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/dec/state.c rename to src/native/libs/System.IO.Compression.Native/brotli/dec/state.c diff --git a/src/libraries/Native/AnyOS/brotli/dec/state.h b/src/native/libs/System.IO.Compression.Native/brotli/dec/state.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/dec/state.h rename to src/native/libs/System.IO.Compression.Native/brotli/dec/state.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/backward_references.c b/src/native/libs/System.IO.Compression.Native/brotli/enc/backward_references.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/backward_references.c rename to src/native/libs/System.IO.Compression.Native/brotli/enc/backward_references.c diff --git a/src/libraries/Native/AnyOS/brotli/enc/backward_references.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/backward_references.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/backward_references.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/backward_references.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/backward_references_hq.c b/src/native/libs/System.IO.Compression.Native/brotli/enc/backward_references_hq.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/backward_references_hq.c rename to src/native/libs/System.IO.Compression.Native/brotli/enc/backward_references_hq.c diff --git a/src/libraries/Native/AnyOS/brotli/enc/backward_references_hq.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/backward_references_hq.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/backward_references_hq.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/backward_references_hq.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/backward_references_inc.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/backward_references_inc.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/backward_references_inc.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/backward_references_inc.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/bit_cost.c b/src/native/libs/System.IO.Compression.Native/brotli/enc/bit_cost.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/bit_cost.c rename to src/native/libs/System.IO.Compression.Native/brotli/enc/bit_cost.c diff --git a/src/libraries/Native/AnyOS/brotli/enc/bit_cost.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/bit_cost.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/bit_cost.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/bit_cost.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/bit_cost_inc.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/bit_cost_inc.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/bit_cost_inc.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/bit_cost_inc.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/block_encoder_inc.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/block_encoder_inc.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/block_encoder_inc.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/block_encoder_inc.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/block_splitter.c b/src/native/libs/System.IO.Compression.Native/brotli/enc/block_splitter.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/block_splitter.c rename to src/native/libs/System.IO.Compression.Native/brotli/enc/block_splitter.c diff --git a/src/libraries/Native/AnyOS/brotli/enc/block_splitter.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/block_splitter.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/block_splitter.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/block_splitter.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/block_splitter_inc.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/block_splitter_inc.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/block_splitter_inc.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/block_splitter_inc.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/brotli_bit_stream.c b/src/native/libs/System.IO.Compression.Native/brotli/enc/brotli_bit_stream.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/brotli_bit_stream.c rename to src/native/libs/System.IO.Compression.Native/brotli/enc/brotli_bit_stream.c diff --git a/src/libraries/Native/AnyOS/brotli/enc/brotli_bit_stream.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/brotli_bit_stream.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/brotli_bit_stream.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/brotli_bit_stream.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/cluster.c b/src/native/libs/System.IO.Compression.Native/brotli/enc/cluster.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/cluster.c rename to src/native/libs/System.IO.Compression.Native/brotli/enc/cluster.c diff --git a/src/libraries/Native/AnyOS/brotli/enc/cluster.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/cluster.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/cluster.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/cluster.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/cluster_inc.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/cluster_inc.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/cluster_inc.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/cluster_inc.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/command.c b/src/native/libs/System.IO.Compression.Native/brotli/enc/command.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/command.c rename to src/native/libs/System.IO.Compression.Native/brotli/enc/command.c diff --git a/src/libraries/Native/AnyOS/brotli/enc/command.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/command.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/command.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/command.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/compress_fragment.c b/src/native/libs/System.IO.Compression.Native/brotli/enc/compress_fragment.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/compress_fragment.c rename to src/native/libs/System.IO.Compression.Native/brotli/enc/compress_fragment.c diff --git a/src/libraries/Native/AnyOS/brotli/enc/compress_fragment.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/compress_fragment.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/compress_fragment.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/compress_fragment.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/compress_fragment_two_pass.c b/src/native/libs/System.IO.Compression.Native/brotli/enc/compress_fragment_two_pass.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/compress_fragment_two_pass.c rename to src/native/libs/System.IO.Compression.Native/brotli/enc/compress_fragment_two_pass.c diff --git a/src/libraries/Native/AnyOS/brotli/enc/compress_fragment_two_pass.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/compress_fragment_two_pass.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/compress_fragment_two_pass.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/compress_fragment_two_pass.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/dictionary_hash.c b/src/native/libs/System.IO.Compression.Native/brotli/enc/dictionary_hash.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/dictionary_hash.c rename to src/native/libs/System.IO.Compression.Native/brotli/enc/dictionary_hash.c diff --git a/src/libraries/Native/AnyOS/brotli/enc/dictionary_hash.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/dictionary_hash.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/dictionary_hash.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/dictionary_hash.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/encode.c b/src/native/libs/System.IO.Compression.Native/brotli/enc/encode.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/encode.c rename to src/native/libs/System.IO.Compression.Native/brotli/enc/encode.c diff --git a/src/libraries/Native/AnyOS/brotli/enc/encoder_dict.c b/src/native/libs/System.IO.Compression.Native/brotli/enc/encoder_dict.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/encoder_dict.c rename to src/native/libs/System.IO.Compression.Native/brotli/enc/encoder_dict.c diff --git a/src/libraries/Native/AnyOS/brotli/enc/encoder_dict.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/encoder_dict.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/encoder_dict.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/encoder_dict.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/entropy_encode.c b/src/native/libs/System.IO.Compression.Native/brotli/enc/entropy_encode.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/entropy_encode.c rename to src/native/libs/System.IO.Compression.Native/brotli/enc/entropy_encode.c diff --git a/src/libraries/Native/AnyOS/brotli/enc/entropy_encode.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/entropy_encode.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/entropy_encode.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/entropy_encode.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/entropy_encode_static.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/entropy_encode_static.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/entropy_encode_static.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/entropy_encode_static.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/fast_log.c b/src/native/libs/System.IO.Compression.Native/brotli/enc/fast_log.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/fast_log.c rename to src/native/libs/System.IO.Compression.Native/brotli/enc/fast_log.c diff --git a/src/libraries/Native/AnyOS/brotli/enc/fast_log.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/fast_log.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/fast_log.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/fast_log.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/find_match_length.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/find_match_length.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/find_match_length.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/find_match_length.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/hash.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/hash.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/hash.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/hash.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/hash_composite_inc.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/hash_composite_inc.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/hash_composite_inc.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/hash_composite_inc.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/hash_forgetful_chain_inc.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/hash_forgetful_chain_inc.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/hash_forgetful_chain_inc.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/hash_forgetful_chain_inc.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/hash_longest_match64_inc.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/hash_longest_match64_inc.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/hash_longest_match64_inc.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/hash_longest_match64_inc.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/hash_longest_match_inc.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/hash_longest_match_inc.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/hash_longest_match_inc.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/hash_longest_match_inc.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/hash_longest_match_quickly_inc.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/hash_longest_match_quickly_inc.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/hash_longest_match_quickly_inc.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/hash_longest_match_quickly_inc.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/hash_rolling_inc.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/hash_rolling_inc.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/hash_rolling_inc.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/hash_rolling_inc.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/hash_to_binary_tree_inc.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/hash_to_binary_tree_inc.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/hash_to_binary_tree_inc.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/hash_to_binary_tree_inc.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/histogram.c b/src/native/libs/System.IO.Compression.Native/brotli/enc/histogram.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/histogram.c rename to src/native/libs/System.IO.Compression.Native/brotli/enc/histogram.c diff --git a/src/libraries/Native/AnyOS/brotli/enc/histogram.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/histogram.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/histogram.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/histogram.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/histogram_inc.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/histogram_inc.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/histogram_inc.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/histogram_inc.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/literal_cost.c b/src/native/libs/System.IO.Compression.Native/brotli/enc/literal_cost.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/literal_cost.c rename to src/native/libs/System.IO.Compression.Native/brotli/enc/literal_cost.c diff --git a/src/libraries/Native/AnyOS/brotli/enc/literal_cost.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/literal_cost.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/literal_cost.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/literal_cost.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/memory.c b/src/native/libs/System.IO.Compression.Native/brotli/enc/memory.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/memory.c rename to src/native/libs/System.IO.Compression.Native/brotli/enc/memory.c diff --git a/src/libraries/Native/AnyOS/brotli/enc/memory.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/memory.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/memory.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/memory.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/metablock.c b/src/native/libs/System.IO.Compression.Native/brotli/enc/metablock.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/metablock.c rename to src/native/libs/System.IO.Compression.Native/brotli/enc/metablock.c diff --git a/src/libraries/Native/AnyOS/brotli/enc/metablock.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/metablock.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/metablock.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/metablock.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/metablock_inc.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/metablock_inc.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/metablock_inc.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/metablock_inc.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/params.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/params.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/params.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/params.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/prefix.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/prefix.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/prefix.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/prefix.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/quality.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/quality.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/quality.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/quality.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/ringbuffer.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/ringbuffer.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/ringbuffer.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/ringbuffer.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/static_dict.c b/src/native/libs/System.IO.Compression.Native/brotli/enc/static_dict.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/static_dict.c rename to src/native/libs/System.IO.Compression.Native/brotli/enc/static_dict.c diff --git a/src/libraries/Native/AnyOS/brotli/enc/static_dict.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/static_dict.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/static_dict.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/static_dict.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/static_dict_lut.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/static_dict_lut.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/static_dict_lut.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/static_dict_lut.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/utf8_util.c b/src/native/libs/System.IO.Compression.Native/brotli/enc/utf8_util.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/utf8_util.c rename to src/native/libs/System.IO.Compression.Native/brotli/enc/utf8_util.c diff --git a/src/libraries/Native/AnyOS/brotli/enc/utf8_util.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/utf8_util.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/utf8_util.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/utf8_util.h diff --git a/src/libraries/Native/AnyOS/brotli/enc/write_bits.h b/src/native/libs/System.IO.Compression.Native/brotli/enc/write_bits.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/enc/write_bits.h rename to src/native/libs/System.IO.Compression.Native/brotli/enc/write_bits.h diff --git a/src/libraries/Native/AnyOS/brotli/fuzz/decode_fuzzer.c b/src/native/libs/System.IO.Compression.Native/brotli/fuzz/decode_fuzzer.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/fuzz/decode_fuzzer.c rename to src/native/libs/System.IO.Compression.Native/brotli/fuzz/decode_fuzzer.c diff --git a/src/libraries/Native/AnyOS/brotli/fuzz/run_decode_fuzzer.c b/src/native/libs/System.IO.Compression.Native/brotli/fuzz/run_decode_fuzzer.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/fuzz/run_decode_fuzzer.c rename to src/native/libs/System.IO.Compression.Native/brotli/fuzz/run_decode_fuzzer.c diff --git a/src/libraries/Native/AnyOS/brotli/fuzz/test_fuzzer.sh b/src/native/libs/System.IO.Compression.Native/brotli/fuzz/test_fuzzer.sh similarity index 100% rename from src/libraries/Native/AnyOS/brotli/fuzz/test_fuzzer.sh rename to src/native/libs/System.IO.Compression.Native/brotli/fuzz/test_fuzzer.sh diff --git a/src/libraries/Native/AnyOS/brotli/include/brotli/decode.h b/src/native/libs/System.IO.Compression.Native/brotli/include/brotli/decode.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/include/brotli/decode.h rename to src/native/libs/System.IO.Compression.Native/brotli/include/brotli/decode.h diff --git a/src/libraries/Native/AnyOS/brotli/include/brotli/encode.h b/src/native/libs/System.IO.Compression.Native/brotli/include/brotli/encode.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/include/brotli/encode.h rename to src/native/libs/System.IO.Compression.Native/brotli/include/brotli/encode.h diff --git a/src/libraries/Native/AnyOS/brotli/include/brotli/port.h b/src/native/libs/System.IO.Compression.Native/brotli/include/brotli/port.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/include/brotli/port.h rename to src/native/libs/System.IO.Compression.Native/brotli/include/brotli/port.h diff --git a/src/libraries/Native/AnyOS/brotli/include/brotli/types.h b/src/native/libs/System.IO.Compression.Native/brotli/include/brotli/types.h similarity index 100% rename from src/libraries/Native/AnyOS/brotli/include/brotli/types.h rename to src/native/libs/System.IO.Compression.Native/brotli/include/brotli/types.h diff --git a/src/libraries/Native/AnyOS/brotli/tools/brotli.c b/src/native/libs/System.IO.Compression.Native/brotli/tools/brotli.c similarity index 100% rename from src/libraries/Native/AnyOS/brotli/tools/brotli.c rename to src/native/libs/System.IO.Compression.Native/brotli/tools/brotli.c diff --git a/src/libraries/Native/AnyOS/brotli/tools/brotli.md b/src/native/libs/System.IO.Compression.Native/brotli/tools/brotli.md similarity index 100% rename from src/libraries/Native/AnyOS/brotli/tools/brotli.md rename to src/native/libs/System.IO.Compression.Native/brotli/tools/brotli.md diff --git a/src/libraries/Native/AnyOS/System.IO.Compression.Native/entrypoints.c b/src/native/libs/System.IO.Compression.Native/entrypoints.c similarity index 79% rename from src/libraries/Native/AnyOS/System.IO.Compression.Native/entrypoints.c rename to src/native/libs/System.IO.Compression.Native/entrypoints.c index c9cd85ca437825..459db03a7f70eb 100644 --- a/src/libraries/Native/AnyOS/System.IO.Compression.Native/entrypoints.c +++ b/src/native/libs/System.IO.Compression.Native/entrypoints.c @@ -1,14 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#include +#include // Include System.IO.Compression.Native headers -#include "../zlib/pal_zlib.h" -#include "../brotli/include/brotli/decode.h" -#include "../brotli/include/brotli/encode.h" -#include "../brotli/include/brotli/port.h" -#include "../brotli/include/brotli/types.h" +#include "pal_zlib.h" +#include "brotli/include/brotli/decode.h" +#include "brotli/include/brotli/encode.h" +#include "brotli/include/brotli/port.h" +#include "brotli/include/brotli/types.h" static const Entry s_compressionNative[] = { @@ -38,5 +38,5 @@ EXTERN_C const void* CompressionResolveDllImport(const char* name); EXTERN_C const void* CompressionResolveDllImport(const char* name) { - return minipal_resolve_dllimport(s_compressionNative, lengthof(s_compressionNative), name); + return minipal_resolve_dllimport(s_compressionNative, ARRAY_SIZE(s_compressionNative), name); } diff --git a/src/libraries/Native/Unix/System.IO.Compression.Native/extra_libs.cmake b/src/native/libs/System.IO.Compression.Native/extra_libs.cmake similarity index 100% rename from src/libraries/Native/Unix/System.IO.Compression.Native/extra_libs.cmake rename to src/native/libs/System.IO.Compression.Native/extra_libs.cmake diff --git a/src/libraries/Native/AnyOS/zlib/pal_zlib.c b/src/native/libs/System.IO.Compression.Native/pal_zlib.c similarity index 98% rename from src/libraries/Native/AnyOS/zlib/pal_zlib.c rename to src/native/libs/System.IO.Compression.Native/pal_zlib.c index aa4dcdca8a29e8..27bb12a05e7f48 100644 --- a/src/libraries/Native/AnyOS/zlib/pal_zlib.c +++ b/src/native/libs/System.IO.Compression.Native/pal_zlib.c @@ -7,7 +7,7 @@ #ifdef _WIN32 #define c_static_assert(e) static_assert((e),"") - #include "../../Windows/System.IO.Compression.Native/zlib/zlib.h" + #include "zlib/zlib.h" #else #include "pal_utilities.h" #include diff --git a/src/libraries/Native/AnyOS/zlib/pal_zlib.h b/src/native/libs/System.IO.Compression.Native/pal_zlib.h similarity index 100% rename from src/libraries/Native/AnyOS/zlib/pal_zlib.h rename to src/native/libs/System.IO.Compression.Native/pal_zlib.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/README.txt b/src/native/libs/System.IO.Compression.Native/zlib-intel/README.txt similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/README.txt rename to src/native/libs/System.IO.Compression.Native/zlib-intel/README.txt diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/adler32.c b/src/native/libs/System.IO.Compression.Native/zlib-intel/adler32.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/adler32.c rename to src/native/libs/System.IO.Compression.Native/zlib-intel/adler32.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/compress.c b/src/native/libs/System.IO.Compression.Native/zlib-intel/compress.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/compress.c rename to src/native/libs/System.IO.Compression.Native/zlib-intel/compress.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/crc32.c b/src/native/libs/System.IO.Compression.Native/zlib-intel/crc32.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/crc32.c rename to src/native/libs/System.IO.Compression.Native/zlib-intel/crc32.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/crc32.h b/src/native/libs/System.IO.Compression.Native/zlib-intel/crc32.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/crc32.h rename to src/native/libs/System.IO.Compression.Native/zlib-intel/crc32.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/crc_folding.c b/src/native/libs/System.IO.Compression.Native/zlib-intel/crc_folding.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/crc_folding.c rename to src/native/libs/System.IO.Compression.Native/zlib-intel/crc_folding.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/deflate.c b/src/native/libs/System.IO.Compression.Native/zlib-intel/deflate.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/deflate.c rename to src/native/libs/System.IO.Compression.Native/zlib-intel/deflate.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/deflate.h b/src/native/libs/System.IO.Compression.Native/zlib-intel/deflate.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/deflate.h rename to src/native/libs/System.IO.Compression.Native/zlib-intel/deflate.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/deflate_medium.c b/src/native/libs/System.IO.Compression.Native/zlib-intel/deflate_medium.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/deflate_medium.c rename to src/native/libs/System.IO.Compression.Native/zlib-intel/deflate_medium.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/deflate_quick.c b/src/native/libs/System.IO.Compression.Native/zlib-intel/deflate_quick.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/deflate_quick.c rename to src/native/libs/System.IO.Compression.Native/zlib-intel/deflate_quick.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/gzguts.h b/src/native/libs/System.IO.Compression.Native/zlib-intel/gzguts.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/gzguts.h rename to src/native/libs/System.IO.Compression.Native/zlib-intel/gzguts.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/inffast.c b/src/native/libs/System.IO.Compression.Native/zlib-intel/inffast.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/inffast.c rename to src/native/libs/System.IO.Compression.Native/zlib-intel/inffast.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/inffast.h b/src/native/libs/System.IO.Compression.Native/zlib-intel/inffast.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/inffast.h rename to src/native/libs/System.IO.Compression.Native/zlib-intel/inffast.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/inffixed.h b/src/native/libs/System.IO.Compression.Native/zlib-intel/inffixed.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/inffixed.h rename to src/native/libs/System.IO.Compression.Native/zlib-intel/inffixed.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/inflate.c b/src/native/libs/System.IO.Compression.Native/zlib-intel/inflate.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/inflate.c rename to src/native/libs/System.IO.Compression.Native/zlib-intel/inflate.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/inflate.h b/src/native/libs/System.IO.Compression.Native/zlib-intel/inflate.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/inflate.h rename to src/native/libs/System.IO.Compression.Native/zlib-intel/inflate.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/inftrees.c b/src/native/libs/System.IO.Compression.Native/zlib-intel/inftrees.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/inftrees.c rename to src/native/libs/System.IO.Compression.Native/zlib-intel/inftrees.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/inftrees.h b/src/native/libs/System.IO.Compression.Native/zlib-intel/inftrees.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/inftrees.h rename to src/native/libs/System.IO.Compression.Native/zlib-intel/inftrees.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/match.c b/src/native/libs/System.IO.Compression.Native/zlib-intel/match.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/match.c rename to src/native/libs/System.IO.Compression.Native/zlib-intel/match.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/slide_sse.c b/src/native/libs/System.IO.Compression.Native/zlib-intel/slide_sse.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/slide_sse.c rename to src/native/libs/System.IO.Compression.Native/zlib-intel/slide_sse.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/trees.c b/src/native/libs/System.IO.Compression.Native/zlib-intel/trees.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/trees.c rename to src/native/libs/System.IO.Compression.Native/zlib-intel/trees.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/trees.h b/src/native/libs/System.IO.Compression.Native/zlib-intel/trees.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/trees.h rename to src/native/libs/System.IO.Compression.Native/zlib-intel/trees.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/x86.c b/src/native/libs/System.IO.Compression.Native/zlib-intel/x86.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/x86.c rename to src/native/libs/System.IO.Compression.Native/zlib-intel/x86.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/x86.h b/src/native/libs/System.IO.Compression.Native/zlib-intel/x86.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/x86.h rename to src/native/libs/System.IO.Compression.Native/zlib-intel/x86.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/zconf.h b/src/native/libs/System.IO.Compression.Native/zlib-intel/zconf.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/zconf.h rename to src/native/libs/System.IO.Compression.Native/zlib-intel/zconf.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/zlib.h b/src/native/libs/System.IO.Compression.Native/zlib-intel/zlib.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/zlib.h rename to src/native/libs/System.IO.Compression.Native/zlib-intel/zlib.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/zutil.c b/src/native/libs/System.IO.Compression.Native/zlib-intel/zutil.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/zutil.c rename to src/native/libs/System.IO.Compression.Native/zlib-intel/zutil.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/zutil.h b/src/native/libs/System.IO.Compression.Native/zlib-intel/zutil.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib-intel/zutil.h rename to src/native/libs/System.IO.Compression.Native/zlib-intel/zutil.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib.md b/src/native/libs/System.IO.Compression.Native/zlib.md similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib.md rename to src/native/libs/System.IO.Compression.Native/zlib.md diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/CMakeLists.txt b/src/native/libs/System.IO.Compression.Native/zlib/CMakeLists.txt similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/CMakeLists.txt rename to src/native/libs/System.IO.Compression.Native/zlib/CMakeLists.txt diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/ChangeLog b/src/native/libs/System.IO.Compression.Native/zlib/ChangeLog similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/ChangeLog rename to src/native/libs/System.IO.Compression.Native/zlib/ChangeLog diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/FAQ b/src/native/libs/System.IO.Compression.Native/zlib/FAQ similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/FAQ rename to src/native/libs/System.IO.Compression.Native/zlib/FAQ diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/INDEX b/src/native/libs/System.IO.Compression.Native/zlib/INDEX similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/INDEX rename to src/native/libs/System.IO.Compression.Native/zlib/INDEX diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/Makefile b/src/native/libs/System.IO.Compression.Native/zlib/Makefile similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/Makefile rename to src/native/libs/System.IO.Compression.Native/zlib/Makefile diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/Makefile.in b/src/native/libs/System.IO.Compression.Native/zlib/Makefile.in similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/Makefile.in rename to src/native/libs/System.IO.Compression.Native/zlib/Makefile.in diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/README b/src/native/libs/System.IO.Compression.Native/zlib/README similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/README rename to src/native/libs/System.IO.Compression.Native/zlib/README diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/adler32.c b/src/native/libs/System.IO.Compression.Native/zlib/adler32.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/adler32.c rename to src/native/libs/System.IO.Compression.Native/zlib/adler32.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/compress.c b/src/native/libs/System.IO.Compression.Native/zlib/compress.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/compress.c rename to src/native/libs/System.IO.Compression.Native/zlib/compress.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/configure b/src/native/libs/System.IO.Compression.Native/zlib/configure similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/configure rename to src/native/libs/System.IO.Compression.Native/zlib/configure diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/crc32.c b/src/native/libs/System.IO.Compression.Native/zlib/crc32.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/crc32.c rename to src/native/libs/System.IO.Compression.Native/zlib/crc32.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/crc32.h b/src/native/libs/System.IO.Compression.Native/zlib/crc32.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/crc32.h rename to src/native/libs/System.IO.Compression.Native/zlib/crc32.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/deflate.c b/src/native/libs/System.IO.Compression.Native/zlib/deflate.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/deflate.c rename to src/native/libs/System.IO.Compression.Native/zlib/deflate.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/deflate.h b/src/native/libs/System.IO.Compression.Native/zlib/deflate.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/deflate.h rename to src/native/libs/System.IO.Compression.Native/zlib/deflate.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/gzclose.c b/src/native/libs/System.IO.Compression.Native/zlib/gzclose.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/gzclose.c rename to src/native/libs/System.IO.Compression.Native/zlib/gzclose.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/gzguts.h b/src/native/libs/System.IO.Compression.Native/zlib/gzguts.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/gzguts.h rename to src/native/libs/System.IO.Compression.Native/zlib/gzguts.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/gzlib.c b/src/native/libs/System.IO.Compression.Native/zlib/gzlib.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/gzlib.c rename to src/native/libs/System.IO.Compression.Native/zlib/gzlib.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/gzread.c b/src/native/libs/System.IO.Compression.Native/zlib/gzread.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/gzread.c rename to src/native/libs/System.IO.Compression.Native/zlib/gzread.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/gzwrite.c b/src/native/libs/System.IO.Compression.Native/zlib/gzwrite.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/gzwrite.c rename to src/native/libs/System.IO.Compression.Native/zlib/gzwrite.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/infback.c b/src/native/libs/System.IO.Compression.Native/zlib/infback.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/infback.c rename to src/native/libs/System.IO.Compression.Native/zlib/infback.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/inffast.c b/src/native/libs/System.IO.Compression.Native/zlib/inffast.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/inffast.c rename to src/native/libs/System.IO.Compression.Native/zlib/inffast.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/inffast.h b/src/native/libs/System.IO.Compression.Native/zlib/inffast.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/inffast.h rename to src/native/libs/System.IO.Compression.Native/zlib/inffast.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/inffixed.h b/src/native/libs/System.IO.Compression.Native/zlib/inffixed.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/inffixed.h rename to src/native/libs/System.IO.Compression.Native/zlib/inffixed.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/inflate.c b/src/native/libs/System.IO.Compression.Native/zlib/inflate.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/inflate.c rename to src/native/libs/System.IO.Compression.Native/zlib/inflate.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/inflate.h b/src/native/libs/System.IO.Compression.Native/zlib/inflate.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/inflate.h rename to src/native/libs/System.IO.Compression.Native/zlib/inflate.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/inftrees.c b/src/native/libs/System.IO.Compression.Native/zlib/inftrees.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/inftrees.c rename to src/native/libs/System.IO.Compression.Native/zlib/inftrees.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/inftrees.h b/src/native/libs/System.IO.Compression.Native/zlib/inftrees.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/inftrees.h rename to src/native/libs/System.IO.Compression.Native/zlib/inftrees.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/make_vms.com b/src/native/libs/System.IO.Compression.Native/zlib/make_vms.com similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/make_vms.com rename to src/native/libs/System.IO.Compression.Native/zlib/make_vms.com diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/treebuild.xml b/src/native/libs/System.IO.Compression.Native/zlib/treebuild.xml similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/treebuild.xml rename to src/native/libs/System.IO.Compression.Native/zlib/treebuild.xml diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/trees.c b/src/native/libs/System.IO.Compression.Native/zlib/trees.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/trees.c rename to src/native/libs/System.IO.Compression.Native/zlib/trees.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/trees.h b/src/native/libs/System.IO.Compression.Native/zlib/trees.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/trees.h rename to src/native/libs/System.IO.Compression.Native/zlib/trees.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/uncompr.c b/src/native/libs/System.IO.Compression.Native/zlib/uncompr.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/uncompr.c rename to src/native/libs/System.IO.Compression.Native/zlib/uncompr.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zconf.h b/src/native/libs/System.IO.Compression.Native/zlib/zconf.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zconf.h rename to src/native/libs/System.IO.Compression.Native/zlib/zconf.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zconf.h.cmakein b/src/native/libs/System.IO.Compression.Native/zlib/zconf.h.cmakein similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zconf.h.cmakein rename to src/native/libs/System.IO.Compression.Native/zlib/zconf.h.cmakein diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zconf.h.in b/src/native/libs/System.IO.Compression.Native/zlib/zconf.h.in similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zconf.h.in rename to src/native/libs/System.IO.Compression.Native/zlib/zconf.h.in diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zlib.3 b/src/native/libs/System.IO.Compression.Native/zlib/zlib.3 similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zlib.3 rename to src/native/libs/System.IO.Compression.Native/zlib/zlib.3 diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zlib.3.pdf b/src/native/libs/System.IO.Compression.Native/zlib/zlib.3.pdf similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zlib.3.pdf rename to src/native/libs/System.IO.Compression.Native/zlib/zlib.3.pdf diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zlib.h b/src/native/libs/System.IO.Compression.Native/zlib/zlib.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zlib.h rename to src/native/libs/System.IO.Compression.Native/zlib/zlib.h diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zlib.map b/src/native/libs/System.IO.Compression.Native/zlib/zlib.map similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zlib.map rename to src/native/libs/System.IO.Compression.Native/zlib/zlib.map diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zlib.pc.cmakein b/src/native/libs/System.IO.Compression.Native/zlib/zlib.pc.cmakein similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zlib.pc.cmakein rename to src/native/libs/System.IO.Compression.Native/zlib/zlib.pc.cmakein diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zlib.pc.in b/src/native/libs/System.IO.Compression.Native/zlib/zlib.pc.in similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zlib.pc.in rename to src/native/libs/System.IO.Compression.Native/zlib/zlib.pc.in diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zlib2ansi b/src/native/libs/System.IO.Compression.Native/zlib/zlib2ansi similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zlib2ansi rename to src/native/libs/System.IO.Compression.Native/zlib/zlib2ansi diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zutil.c b/src/native/libs/System.IO.Compression.Native/zlib/zutil.c similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zutil.c rename to src/native/libs/System.IO.Compression.Native/zlib/zutil.c diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zutil.h b/src/native/libs/System.IO.Compression.Native/zlib/zutil.h similarity index 100% rename from src/libraries/Native/Windows/System.IO.Compression.Native/zlib/zutil.h rename to src/native/libs/System.IO.Compression.Native/zlib/zutil.h diff --git a/src/libraries/Native/Unix/System.IO.Ports.Native/CMakeLists.txt b/src/native/libs/System.IO.Ports.Native/CMakeLists.txt similarity index 100% rename from src/libraries/Native/Unix/System.IO.Ports.Native/CMakeLists.txt rename to src/native/libs/System.IO.Ports.Native/CMakeLists.txt diff --git a/src/libraries/Native/Unix/System.IO.Ports.Native/pal_serial.c b/src/native/libs/System.IO.Ports.Native/pal_serial.c similarity index 100% rename from src/libraries/Native/Unix/System.IO.Ports.Native/pal_serial.c rename to src/native/libs/System.IO.Ports.Native/pal_serial.c diff --git a/src/libraries/Native/Unix/System.IO.Ports.Native/pal_serial.h b/src/native/libs/System.IO.Ports.Native/pal_serial.h similarity index 100% rename from src/libraries/Native/Unix/System.IO.Ports.Native/pal_serial.h rename to src/native/libs/System.IO.Ports.Native/pal_serial.h diff --git a/src/libraries/Native/Unix/System.IO.Ports.Native/pal_termios.c b/src/native/libs/System.IO.Ports.Native/pal_termios.c similarity index 100% rename from src/libraries/Native/Unix/System.IO.Ports.Native/pal_termios.c rename to src/native/libs/System.IO.Ports.Native/pal_termios.c diff --git a/src/libraries/Native/Unix/System.IO.Ports.Native/pal_termios.h b/src/native/libs/System.IO.Ports.Native/pal_termios.h similarity index 100% rename from src/libraries/Native/Unix/System.IO.Ports.Native/pal_termios.h rename to src/native/libs/System.IO.Ports.Native/pal_termios.h diff --git a/src/libraries/Native/Unix/System.Native/CMakeLists.txt b/src/native/libs/System.Native/CMakeLists.txt similarity index 100% rename from src/libraries/Native/Unix/System.Native/CMakeLists.txt rename to src/native/libs/System.Native/CMakeLists.txt diff --git a/src/libraries/Native/Unix/System.Native/entrypoints.c b/src/native/libs/System.Native/entrypoints.c similarity index 98% rename from src/libraries/Native/Unix/System.Native/entrypoints.c rename to src/native/libs/System.Native/entrypoints.c index 2440e3fcd41a31..ab227685b5a898 100644 --- a/src/libraries/Native/Unix/System.Native/entrypoints.c +++ b/src/native/libs/System.Native/entrypoints.c @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#include +#include // Include System.Native headers #include "pal_autoreleasepool.h" @@ -244,7 +244,6 @@ static const Entry s_sysNative[] = DllImportEntry(SystemNative_GetEGid) DllImportEntry(SystemNative_SetEUid) DllImportEntry(SystemNative_GetGroupList) - DllImportEntry(SystemNative_GetUid) DllImportEntry(SystemNative_CreateAutoreleasePool) DllImportEntry(SystemNative_DrainAutoreleasePool) DllImportEntry(SystemNative_iOSSupportVersion) @@ -269,5 +268,5 @@ EXTERN_C const void* SystemResolveDllImport(const char* name); EXTERN_C const void* SystemResolveDllImport(const char* name) { - return minipal_resolve_dllimport(s_sysNative, lengthof(s_sysNative), name); + return minipal_resolve_dllimport(s_sysNative, ARRAY_SIZE(s_sysNative), name); } diff --git a/src/libraries/Native/Unix/System.Native/extra_libs.cmake b/src/native/libs/System.Native/extra_libs.cmake similarity index 100% rename from src/libraries/Native/Unix/System.Native/extra_libs.cmake rename to src/native/libs/System.Native/extra_libs.cmake diff --git a/src/libraries/Native/Unix/System.Native/ios/net/if_media.h b/src/native/libs/System.Native/ios/net/if_media.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/ios/net/if_media.h rename to src/native/libs/System.Native/ios/net/if_media.h diff --git a/src/libraries/Native/Unix/System.Native/ios/net/route.h b/src/native/libs/System.Native/ios/net/route.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/ios/net/route.h rename to src/native/libs/System.Native/ios/net/route.h diff --git a/src/libraries/Native/Unix/System.Native/ios/netinet/icmp_var.h b/src/native/libs/System.Native/ios/netinet/icmp_var.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/ios/netinet/icmp_var.h rename to src/native/libs/System.Native/ios/netinet/icmp_var.h diff --git a/src/libraries/Native/Unix/System.Native/ios/netinet/ip_var.h b/src/native/libs/System.Native/ios/netinet/ip_var.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/ios/netinet/ip_var.h rename to src/native/libs/System.Native/ios/netinet/ip_var.h diff --git a/src/libraries/Native/Unix/System.Native/ios/netinet/tcp_fsm.h b/src/native/libs/System.Native/ios/netinet/tcp_fsm.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/ios/netinet/tcp_fsm.h rename to src/native/libs/System.Native/ios/netinet/tcp_fsm.h diff --git a/src/libraries/Native/Unix/System.Native/ios/netinet/udp_var.h b/src/native/libs/System.Native/ios/netinet/udp_var.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/ios/netinet/udp_var.h rename to src/native/libs/System.Native/ios/netinet/udp_var.h diff --git a/src/libraries/Native/Unix/System.Native/pal_autoreleasepool.c b/src/native/libs/System.Native/pal_autoreleasepool.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_autoreleasepool.c rename to src/native/libs/System.Native/pal_autoreleasepool.c diff --git a/src/libraries/Native/Unix/System.Native/pal_autoreleasepool.h b/src/native/libs/System.Native/pal_autoreleasepool.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_autoreleasepool.h rename to src/native/libs/System.Native/pal_autoreleasepool.h diff --git a/src/libraries/Native/Unix/System.Native/pal_autoreleasepool.m b/src/native/libs/System.Native/pal_autoreleasepool.m similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_autoreleasepool.m rename to src/native/libs/System.Native/pal_autoreleasepool.m diff --git a/src/libraries/Native/Unix/System.Native/pal_console.c b/src/native/libs/System.Native/pal_console.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_console.c rename to src/native/libs/System.Native/pal_console.c diff --git a/src/libraries/Native/Unix/System.Native/pal_console.h b/src/native/libs/System.Native/pal_console.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_console.h rename to src/native/libs/System.Native/pal_console.h diff --git a/src/libraries/Native/Unix/System.Native/pal_datetime.c b/src/native/libs/System.Native/pal_datetime.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_datetime.c rename to src/native/libs/System.Native/pal_datetime.c diff --git a/src/libraries/Native/Unix/System.Native/pal_datetime.h b/src/native/libs/System.Native/pal_datetime.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_datetime.h rename to src/native/libs/System.Native/pal_datetime.h diff --git a/src/libraries/Native/Unix/System.Native/pal_environment.c b/src/native/libs/System.Native/pal_environment.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_environment.c rename to src/native/libs/System.Native/pal_environment.c diff --git a/src/libraries/Native/Unix/System.Native/pal_environment.h b/src/native/libs/System.Native/pal_environment.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_environment.h rename to src/native/libs/System.Native/pal_environment.h diff --git a/src/libraries/Native/Unix/System.Native/pal_environment.m b/src/native/libs/System.Native/pal_environment.m similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_environment.m rename to src/native/libs/System.Native/pal_environment.m diff --git a/src/libraries/Native/Unix/System.Native/pal_errno.c b/src/native/libs/System.Native/pal_errno.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_errno.c rename to src/native/libs/System.Native/pal_errno.c diff --git a/src/libraries/Native/Unix/System.Native/pal_errno.h b/src/native/libs/System.Native/pal_errno.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_errno.h rename to src/native/libs/System.Native/pal_errno.h diff --git a/src/libraries/Native/Unix/System.Native/pal_interfaceaddresses.c b/src/native/libs/System.Native/pal_interfaceaddresses.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_interfaceaddresses.c rename to src/native/libs/System.Native/pal_interfaceaddresses.c diff --git a/src/libraries/Native/Unix/System.Native/pal_interfaceaddresses.h b/src/native/libs/System.Native/pal_interfaceaddresses.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_interfaceaddresses.h rename to src/native/libs/System.Native/pal_interfaceaddresses.h diff --git a/src/libraries/Native/Unix/System.Native/pal_io.c b/src/native/libs/System.Native/pal_io.c similarity index 96% rename from src/libraries/Native/Unix/System.Native/pal_io.c rename to src/native/libs/System.Native/pal_io.c index 49aaeca6c2078f..66c934ed182fa0 100644 --- a/src/libraries/Native/Unix/System.Native/pal_io.c +++ b/src/native/libs/System.Native/pal_io.c @@ -61,6 +61,14 @@ extern int getpeereid(int, uid_t *__restrict__, gid_t *__restrict__); #endif #endif +// The portable build is performed on RHEL7 which doesn't define FICLONE yet. +// Ensure FICLONE is defined for all Linux builds. +#ifdef __linux__ +#ifndef FICLONE +#define FICLONE _IOW(0x94, 9, int) +#endif +#endif + #if HAVE_STAT64 #define stat_ stat64 #define fstat_ fstat64 @@ -1138,8 +1146,10 @@ static int32_t CopyFile_ReadWrite(int inFd, int outFd) } #endif // !HAVE_FCOPYFILE -int32_t SystemNative_CopyFile(intptr_t sourceFd, intptr_t destinationFd) +int32_t SystemNative_CopyFile(intptr_t sourceFd, intptr_t destinationFd, int64_t sourceLength) { + (void)sourceLength; // unused on some platforms. + int inFd = ToFileDescriptor(sourceFd); int outFd = ToFileDescriptor(destinationFd); @@ -1151,28 +1161,27 @@ int32_t SystemNative_CopyFile(intptr_t sourceFd, intptr_t destinationFd) #else // Get the stats on the source file. int ret; - struct stat_ sourceStat; bool copied = false; -#if HAVE_SENDFILE_4 - // If sendfile is available (Linux), try to use it, as the whole copy - // can be performed in the kernel, without lots of unnecessary copying. - while ((ret = fstat_(inFd, &sourceStat)) < 0 && errno == EINTR); - if (ret != 0) + + // Certain files (e.g. procfs) may return a size of 0 even though reading them will + // produce data. We use plain read/write for those. +#ifdef FICLONE + // Try copying data using a copy-on-write clone. This shares storage between the files. + if (sourceLength != 0) { - return -1; + while ((ret = ioctl(outFd, FICLONE, inFd)) < 0 && errno == EINTR); + copied = ret == 0; } - - // On 32-bit, if you use 64-bit offsets, the last argument of `sendfile' will be a - // `size_t' a 32-bit integer while the `st_size' field of the stat structure will be off64_t. - // So `size' will have to be `uint64_t'. In all other cases, it will be `size_t'. - uint64_t size = (uint64_t)sourceStat.st_size; - if (size != 0) +#endif +#if HAVE_SENDFILE_4 + // Try copying the data using sendfile. + if (!copied && sourceLength != 0) { // Note that per man page for large files, you have to iterate until the // whole file is copied (Linux has a limit of 0x7ffff000 bytes copied). - while (size > 0) + do { - ssize_t sent = sendfile(outFd, inFd, NULL, (size >= SSIZE_MAX ? SSIZE_MAX : (size_t)size)); + ssize_t sent = sendfile(outFd, inFd, NULL, (sourceLength >= SSIZE_MAX ? SSIZE_MAX : (size_t)sourceLength)); if (sent < 0) { if (errno != EINVAL && errno != ENOSYS) @@ -1184,36 +1193,31 @@ int32_t SystemNative_CopyFile(intptr_t sourceFd, intptr_t destinationFd) break; } } + else if (sent == 0) + { + // The file was truncated (or maybe some other condition occurred). + // Perform the remaining copying using read/write. + break; + } else { - assert((size_t)sent <= size); - size -= (size_t)sent; + assert(sent <= sourceLength); + sourceLength -= sent; } - } + } while (sourceLength > 0); - if (size == 0) - { - copied = true; - } + copied = sourceLength == 0; } - - // sendfile couldn't be used; fall back to a manual copy below. This could happen - // if we're on an old kernel, for example, where sendfile could only be used - // with sockets and not regular files. Additionally, certain files (e.g. procfs) - // may return a size of 0 even though reading from then will produce data. As such, - // we avoid using sendfile with the queried size if the size is reported as 0. #endif // HAVE_SENDFILE_4 - // Manually read all data from the source and write it to the destination. + // Perform a manual copy. if (!copied && CopyFile_ReadWrite(inFd, outFd) != 0) { return -1; } - // Now that the data from the file has been copied, copy over metadata - // from the source file. First copy the file times. - // If futimes nor futimes are available on this platform, file times will - // not be copied over. + // Copy file times. + struct stat_ sourceStat; while ((ret = fstat_(inFd, &sourceStat)) < 0 && errno == EINTR); if (ret == 0) { @@ -1242,7 +1246,10 @@ int32_t SystemNative_CopyFile(intptr_t sourceFd, intptr_t destinationFd) { return -1; } - // Then copy permissions. + + // Copy permissions. + // Even though managed code created the file with permissions matching those of the source file, + // we need to copy permissions because the open permissions may be filtered by 'umask'. while ((ret = fchmod(outFd, sourceStat.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO))) < 0 && errno == EINTR); if (ret != 0 && errno != EPERM) // See EPERM comment above { diff --git a/src/libraries/Native/Unix/System.Native/pal_io.h b/src/native/libs/System.Native/pal_io.h similarity index 99% rename from src/libraries/Native/Unix/System.Native/pal_io.h rename to src/native/libs/System.Native/pal_io.h index 0e5d4cae2feb8f..726b097aff1332 100644 --- a/src/libraries/Native/Unix/System.Native/pal_io.h +++ b/src/native/libs/System.Native/pal_io.h @@ -675,7 +675,7 @@ PALEXPORT int32_t SystemNative_Write(intptr_t fd, const void* buffer, int32_t bu * * Returns 0 on success; otherwise, returns -1 and sets errno. */ -PALEXPORT int32_t SystemNative_CopyFile(intptr_t sourceFd, intptr_t destinationFd); +PALEXPORT int32_t SystemNative_CopyFile(intptr_t sourceFd, intptr_t destinationFd, int64_t sourceLength); /** * Initializes a new inotify instance and returns a file diff --git a/src/libraries/Native/Unix/System.Native/pal_iossupportversion.c b/src/native/libs/System.Native/pal_iossupportversion.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_iossupportversion.c rename to src/native/libs/System.Native/pal_iossupportversion.c diff --git a/src/libraries/Native/Unix/System.Native/pal_iossupportversion.h b/src/native/libs/System.Native/pal_iossupportversion.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_iossupportversion.h rename to src/native/libs/System.Native/pal_iossupportversion.h diff --git a/src/libraries/Native/Unix/System.Native/pal_iossupportversion.m b/src/native/libs/System.Native/pal_iossupportversion.m similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_iossupportversion.m rename to src/native/libs/System.Native/pal_iossupportversion.m diff --git a/src/libraries/Native/Unix/System.Native/pal_log.c b/src/native/libs/System.Native/pal_log.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_log.c rename to src/native/libs/System.Native/pal_log.c diff --git a/src/libraries/Native/Unix/System.Native/pal_log.h b/src/native/libs/System.Native/pal_log.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_log.h rename to src/native/libs/System.Native/pal_log.h diff --git a/src/libraries/Native/Unix/System.Native/pal_log.m b/src/native/libs/System.Native/pal_log.m similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_log.m rename to src/native/libs/System.Native/pal_log.m diff --git a/src/libraries/Native/Unix/System.Native/pal_maphardwaretype.c b/src/native/libs/System.Native/pal_maphardwaretype.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_maphardwaretype.c rename to src/native/libs/System.Native/pal_maphardwaretype.c diff --git a/src/libraries/Native/Unix/System.Native/pal_maphardwaretype.h b/src/native/libs/System.Native/pal_maphardwaretype.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_maphardwaretype.h rename to src/native/libs/System.Native/pal_maphardwaretype.h diff --git a/src/libraries/Native/Unix/System.Native/pal_memory.c b/src/native/libs/System.Native/pal_memory.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_memory.c rename to src/native/libs/System.Native/pal_memory.c diff --git a/src/libraries/Native/Unix/System.Native/pal_memory.h b/src/native/libs/System.Native/pal_memory.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_memory.h rename to src/native/libs/System.Native/pal_memory.h diff --git a/src/libraries/Native/Unix/System.Native/pal_mount.c b/src/native/libs/System.Native/pal_mount.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_mount.c rename to src/native/libs/System.Native/pal_mount.c diff --git a/src/libraries/Native/Unix/System.Native/pal_mount.h b/src/native/libs/System.Native/pal_mount.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_mount.h rename to src/native/libs/System.Native/pal_mount.h diff --git a/src/libraries/Native/Unix/System.Native/pal_networkchange.c b/src/native/libs/System.Native/pal_networkchange.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_networkchange.c rename to src/native/libs/System.Native/pal_networkchange.c diff --git a/src/libraries/Native/Unix/System.Native/pal_networkchange.h b/src/native/libs/System.Native/pal_networkchange.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_networkchange.h rename to src/native/libs/System.Native/pal_networkchange.h diff --git a/src/libraries/Native/Unix/System.Native/pal_networking.c b/src/native/libs/System.Native/pal_networking.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_networking.c rename to src/native/libs/System.Native/pal_networking.c diff --git a/src/libraries/Native/Unix/System.Native/pal_networking.h b/src/native/libs/System.Native/pal_networking.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_networking.h rename to src/native/libs/System.Native/pal_networking.h diff --git a/src/libraries/Native/Unix/System.Native/pal_networkstatistics.c b/src/native/libs/System.Native/pal_networkstatistics.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_networkstatistics.c rename to src/native/libs/System.Native/pal_networkstatistics.c diff --git a/src/libraries/Native/Unix/System.Native/pal_networkstatistics.h b/src/native/libs/System.Native/pal_networkstatistics.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_networkstatistics.h rename to src/native/libs/System.Native/pal_networkstatistics.h diff --git a/src/libraries/Native/Unix/System.Native/pal_process.c b/src/native/libs/System.Native/pal_process.c similarity index 99% rename from src/libraries/Native/Unix/System.Native/pal_process.c rename to src/native/libs/System.Native/pal_process.c index cb8bdf319eb10e..01a9db0bb6f6ef 100644 --- a/src/libraries/Native/Unix/System.Native/pal_process.c +++ b/src/native/libs/System.Native/pal_process.c @@ -39,7 +39,7 @@ #include #endif -#include +#include // Validate that our SysLogPriority values are correct for the platform c_static_assert(PAL_LOG_EMERG == LOG_EMERG); diff --git a/src/libraries/Native/Unix/System.Native/pal_process.h b/src/native/libs/System.Native/pal_process.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_process.h rename to src/native/libs/System.Native/pal_process.h diff --git a/src/libraries/Native/Unix/System.Native/pal_random.c b/src/native/libs/System.Native/pal_random.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_random.c rename to src/native/libs/System.Native/pal_random.c diff --git a/src/libraries/Native/Unix/System.Native/pal_random.h b/src/native/libs/System.Native/pal_random.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_random.h rename to src/native/libs/System.Native/pal_random.h diff --git a/src/libraries/Native/Unix/System.Native/pal_random.js b/src/native/libs/System.Native/pal_random.js similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_random.js rename to src/native/libs/System.Native/pal_random.js diff --git a/src/libraries/Native/Unix/System.Native/pal_runtimeextensions.c b/src/native/libs/System.Native/pal_runtimeextensions.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_runtimeextensions.c rename to src/native/libs/System.Native/pal_runtimeextensions.c diff --git a/src/libraries/Native/Unix/System.Native/pal_runtimeextensions.h b/src/native/libs/System.Native/pal_runtimeextensions.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_runtimeextensions.h rename to src/native/libs/System.Native/pal_runtimeextensions.h diff --git a/src/libraries/Native/Unix/System.Native/pal_runtimeinformation.c b/src/native/libs/System.Native/pal_runtimeinformation.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_runtimeinformation.c rename to src/native/libs/System.Native/pal_runtimeinformation.c diff --git a/src/libraries/Native/Unix/System.Native/pal_runtimeinformation.h b/src/native/libs/System.Native/pal_runtimeinformation.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_runtimeinformation.h rename to src/native/libs/System.Native/pal_runtimeinformation.h diff --git a/src/libraries/Native/Unix/System.Native/pal_searchpath.c b/src/native/libs/System.Native/pal_searchpath.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_searchpath.c rename to src/native/libs/System.Native/pal_searchpath.c diff --git a/src/libraries/Native/Unix/System.Native/pal_searchpath.h b/src/native/libs/System.Native/pal_searchpath.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_searchpath.h rename to src/native/libs/System.Native/pal_searchpath.h diff --git a/src/libraries/Native/Unix/System.Native/pal_searchpath.m b/src/native/libs/System.Native/pal_searchpath.m similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_searchpath.m rename to src/native/libs/System.Native/pal_searchpath.m diff --git a/src/libraries/Native/Unix/System.Native/pal_signal.c b/src/native/libs/System.Native/pal_signal.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_signal.c rename to src/native/libs/System.Native/pal_signal.c diff --git a/src/libraries/Native/Unix/System.Native/pal_signal.h b/src/native/libs/System.Native/pal_signal.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_signal.h rename to src/native/libs/System.Native/pal_signal.h diff --git a/src/libraries/Native/Unix/System.Native/pal_string.c b/src/native/libs/System.Native/pal_string.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_string.c rename to src/native/libs/System.Native/pal_string.c diff --git a/src/libraries/Native/Unix/System.Native/pal_string.h b/src/native/libs/System.Native/pal_string.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_string.h rename to src/native/libs/System.Native/pal_string.h diff --git a/src/libraries/Native/Unix/System.Native/pal_sysctl.c b/src/native/libs/System.Native/pal_sysctl.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_sysctl.c rename to src/native/libs/System.Native/pal_sysctl.c diff --git a/src/libraries/Native/Unix/System.Native/pal_sysctl.h b/src/native/libs/System.Native/pal_sysctl.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_sysctl.h rename to src/native/libs/System.Native/pal_sysctl.h diff --git a/src/libraries/Native/Unix/System.Native/pal_tcpstate.c b/src/native/libs/System.Native/pal_tcpstate.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_tcpstate.c rename to src/native/libs/System.Native/pal_tcpstate.c diff --git a/src/libraries/Native/Unix/System.Native/pal_tcpstate.h b/src/native/libs/System.Native/pal_tcpstate.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_tcpstate.h rename to src/native/libs/System.Native/pal_tcpstate.h diff --git a/src/libraries/Native/Unix/System.Native/pal_threading.c b/src/native/libs/System.Native/pal_threading.c similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_threading.c rename to src/native/libs/System.Native/pal_threading.c diff --git a/src/libraries/Native/Unix/System.Native/pal_threading.h b/src/native/libs/System.Native/pal_threading.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_threading.h rename to src/native/libs/System.Native/pal_threading.h diff --git a/src/libraries/Native/Unix/System.Native/pal_time.c b/src/native/libs/System.Native/pal_time.c similarity index 95% rename from src/libraries/Native/Unix/System.Native/pal_time.c rename to src/native/libs/System.Native/pal_time.c index 56e23138a7b77e..4f9b5326cb73c3 100644 --- a/src/libraries/Native/Unix/System.Native/pal_time.c +++ b/src/native/libs/System.Native/pal_time.c @@ -33,7 +33,7 @@ int32_t SystemNative_UTimensat(const char* path, TimeSpec* times) updatedTimes[1].tv_sec = (time_t)times[1].tv_sec; updatedTimes[1].tv_nsec = (long)times[1].tv_nsec; - while (CheckInterrupted(result = utimensat(AT_FDCWD, path, updatedTimes, 0))); + while (CheckInterrupted(result = utimensat(AT_FDCWD, path, updatedTimes, AT_SYMLINK_NOFOLLOW))); #else struct timeval updatedTimes[2]; updatedTimes[0].tv_sec = (long)times[0].tv_sec; @@ -41,7 +41,13 @@ int32_t SystemNative_UTimensat(const char* path, TimeSpec* times) updatedTimes[1].tv_sec = (long)times[1].tv_sec; updatedTimes[1].tv_usec = (int)times[1].tv_nsec / 1000; - while (CheckInterrupted(result = utimes(path, updatedTimes))); + while (CheckInterrupted(result = +#if HAVE_LUTIMES + lutimes +#else + utimes +#endif + (path, updatedTimes))); #endif return result; diff --git a/src/libraries/Native/Unix/System.Native/pal_time.h b/src/native/libs/System.Native/pal_time.h similarity index 100% rename from src/libraries/Native/Unix/System.Native/pal_time.h rename to src/native/libs/System.Native/pal_time.h diff --git a/src/libraries/Native/Unix/System.Native/pal_uid.c b/src/native/libs/System.Native/pal_uid.c similarity index 99% rename from src/libraries/Native/Unix/System.Native/pal_uid.c rename to src/native/libs/System.Native/pal_uid.c index 6571fb1e600cb2..e1f64f03d5019a 100644 --- a/src/libraries/Native/Unix/System.Native/pal_uid.c +++ b/src/native/libs/System.Native/pal_uid.c @@ -102,11 +102,6 @@ int32_t SystemNative_SetEUid(uint32_t euid) return seteuid(euid); } -uint32_t SystemNative_GetUid() -{ - return getuid(); -} - #ifdef USE_GROUPLIST_LOCK static pthread_mutex_t s_groupLock = PTHREAD_MUTEX_INITIALIZER; #endif diff --git a/src/libraries/Native/Unix/System.Native/pal_uid.h b/src/native/libs/System.Native/pal_uid.h similarity index 93% rename from src/libraries/Native/Unix/System.Native/pal_uid.h rename to src/native/libs/System.Native/pal_uid.h index d0b16eef97a038..b9a24f42304608 100644 --- a/src/libraries/Native/Unix/System.Native/pal_uid.h +++ b/src/native/libs/System.Native/pal_uid.h @@ -74,14 +74,6 @@ PALEXPORT int32_t SystemNative_SetEUid(uint32_t euid); */ 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. -* Implemented as shim to getuid(2). -* -* Always succeeds. -*/ -PALEXPORT uint32_t SystemNative_GetUid(void); - /** * Gets groups associated with current process. * diff --git a/src/libraries/Native/Unix/System.Net.Security.Native/CMakeLists.txt b/src/native/libs/System.Net.Security.Native/CMakeLists.txt similarity index 100% rename from src/libraries/Native/Unix/System.Net.Security.Native/CMakeLists.txt rename to src/native/libs/System.Net.Security.Native/CMakeLists.txt diff --git a/src/libraries/Native/Unix/System.Net.Security.Native/entrypoints.c b/src/native/libs/System.Net.Security.Native/entrypoints.c similarity index 91% rename from src/libraries/Native/Unix/System.Net.Security.Native/entrypoints.c rename to src/native/libs/System.Net.Security.Native/entrypoints.c index 6c442722734e5f..cdcc012b18afad 100644 --- a/src/libraries/Native/Unix/System.Net.Security.Native/entrypoints.c +++ b/src/native/libs/System.Net.Security.Native/entrypoints.c @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#include +#include // Include System.Net.Security.Native headers #include "pal_gssapi.h" @@ -33,5 +33,5 @@ EXTERN_C const void* SecurityResolveDllImport(const char* name); EXTERN_C const void* SecurityResolveDllImport(const char* name) { - return minipal_resolve_dllimport(s_securityNative, lengthof(s_securityNative), name); + return minipal_resolve_dllimport(s_securityNative, ARRAY_SIZE(s_securityNative), name); } diff --git a/src/libraries/Native/Unix/System.Net.Security.Native/extra_libs.cmake b/src/native/libs/System.Net.Security.Native/extra_libs.cmake similarity index 100% rename from src/libraries/Native/Unix/System.Net.Security.Native/extra_libs.cmake rename to src/native/libs/System.Net.Security.Native/extra_libs.cmake diff --git a/src/libraries/Native/Unix/System.Net.Security.Native/pal_gssapi.c b/src/native/libs/System.Net.Security.Native/pal_gssapi.c similarity index 99% rename from src/libraries/Native/Unix/System.Net.Security.Native/pal_gssapi.c rename to src/native/libs/System.Net.Security.Native/pal_gssapi.c index ef84a024777d3c..7ccc59631b95c2 100644 --- a/src/libraries/Native/Unix/System.Net.Security.Native/pal_gssapi.c +++ b/src/native/libs/System.Net.Security.Native/pal_gssapi.c @@ -5,6 +5,8 @@ #include "pal_utilities.h" #include "pal_gssapi.h" +#include + #if HAVE_GSSFW_HEADERS #include #else @@ -45,12 +47,12 @@ c_static_assert(PAL_GSS_CONTINUE_NEEDED == GSS_S_CONTINUE_NEEDED); #if !HAVE_GSS_SPNEGO_MECHANISM static char gss_spnego_oid_value[] = "\x2b\x06\x01\x05\x05\x02"; // Binary representation of SPNEGO Oid (RFC 4178) -static gss_OID_desc gss_mech_spnego_OID_desc = {.length = ARRAY_SIZE(gss_spnego_oid_value) - 1, +static gss_OID_desc gss_mech_spnego_OID_desc = {.length = STRING_LENGTH(gss_spnego_oid_value), .elements = gss_spnego_oid_value}; static char gss_ntlm_oid_value[] = "\x2b\x06\x01\x04\x01\x82\x37\x02\x02\x0a"; // Binary representation of NTLM OID // (https://msdn.microsoft.com/en-us/library/cc236636.aspx) -static gss_OID_desc gss_mech_ntlm_OID_desc = {.length = ARRAY_SIZE(gss_ntlm_oid_value) - 1, +static gss_OID_desc gss_mech_ntlm_OID_desc = {.length = STRING_LENGTH(gss_ntlm_oid_value), .elements = gss_ntlm_oid_value}; #endif diff --git a/src/libraries/Native/Unix/System.Net.Security.Native/pal_gssapi.h b/src/native/libs/System.Net.Security.Native/pal_gssapi.h similarity index 100% rename from src/libraries/Native/Unix/System.Net.Security.Native/pal_gssapi.h rename to src/native/libs/System.Net.Security.Native/pal_gssapi.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/CMakeLists.txt b/src/native/libs/System.Security.Cryptography.Native.Android/CMakeLists.txt similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/CMakeLists.txt rename to src/native/libs/System.Security.Cryptography.Native.Android/CMakeLists.txt diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_bignum.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_bignum.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_bignum.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_bignum.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_bignum.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_bignum.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_bignum.h rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_bignum.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_cipher.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_cipher.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_cipher.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_cipher.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_cipher.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_cipher.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_cipher.h rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_cipher.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_dsa.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_dsa.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_dsa.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_dsa.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_dsa.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_dsa.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_dsa.h rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_dsa.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_ecc_import_export.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_ecc_import_export.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_ecc_import_export.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_ecc_import_export.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_ecc_import_export.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_ecc_import_export.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_ecc_import_export.h rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_ecc_import_export.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_ecdh.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_ecdh.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_ecdh.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_ecdh.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_ecdh.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_ecdh.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_ecdh.h rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_ecdh.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_ecdsa.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_ecdsa.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_ecdsa.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_ecdsa.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_ecdsa.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_ecdsa.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_ecdsa.h rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_ecdsa.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_eckey.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_eckey.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_eckey.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_eckey.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_eckey.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_eckey.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_eckey.h rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_eckey.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_err.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_err.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_err.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_err.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_err.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_err.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_err.h rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_err.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_evp.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_evp.c similarity index 97% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_evp.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_evp.c index 3156d524503fd2..04ff98209b0c4b 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_evp.c +++ b/src/native/libs/System.Security.Cryptography.Native.Android/pal_evp.c @@ -50,9 +50,7 @@ static jobject GetMessageDigestInstance(JNIEnv* env, intptr_t type) int32_t CryptoNative_EvpDigestOneShot(intptr_t type, void* source, int32_t sourceSize, uint8_t* md, uint32_t* mdSize) { - abort_if_invalid_pointer_argument (source); - - if (!type || !md || !mdSize || sourceSize < 0) + if (!type || !md || !mdSize || sourceSize < 0 || (sourceSize > 0 && !source)) return FAIL; JNIEnv* env = GetJNIEnv(); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_evp.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_evp.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_evp.h rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_evp.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_hmac.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_hmac.c similarity index 98% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_hmac.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_hmac.c index 7632eed59050fd..0dccef8d2c590c 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_hmac.c +++ b/src/native/libs/System.Security.Cryptography.Native.Android/pal_hmac.c @@ -82,10 +82,10 @@ int32_t CryptoNative_HmacReset(jobject ctx) int32_t CryptoNative_HmacUpdate(jobject ctx, uint8_t* data, int32_t len) { - if (!ctx) + // Callers are expected to skip update calls with no data. + if (!ctx || !data || len <= 0) return FAIL; - abort_if_invalid_pointer_argument (data); JNIEnv* env = GetJNIEnv(); jbyteArray dataBytes = make_java_byte_array(env, len); (*env)->SetByteArrayRegion(env, dataBytes, 0, len, (jbyte*)data); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_hmac.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_hmac.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_hmac.h rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_hmac.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_jni.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_jni.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_jni.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_jni.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_jni.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_jni.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_jni.h rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_jni.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_lifetime.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_lifetime.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_lifetime.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_lifetime.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_lifetime.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_lifetime.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_lifetime.h rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_lifetime.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_memory.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_memory.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_memory.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_memory.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_misc.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_misc.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_misc.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_misc.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_misc.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_misc.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_misc.h rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_misc.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_rsa.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_rsa.c similarity index 99% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_rsa.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_rsa.c index 54613c6e64b513..91fcc38ffb29e3 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_rsa.c +++ b/src/native/libs/System.Security.Cryptography.Native.Android/pal_rsa.c @@ -44,10 +44,12 @@ PALEXPORT void AndroidCryptoNative_RsaDestroy(RSA* rsa) PALEXPORT int32_t AndroidCryptoNative_RsaPublicEncrypt(int32_t flen, uint8_t* from, uint8_t* to, RSA* rsa, RsaPadding padding) { - abort_if_invalid_pointer_argument (from); abort_if_invalid_pointer_argument (to); abort_if_invalid_pointer_argument (rsa); + if ((flen > 0 && !from) || flen < 0) + return RSA_FAIL; + JNIEnv* env = GetJNIEnv(); int32_t ret = RSA_FAIL; diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_rsa.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_rsa.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_rsa.h rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_rsa.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_signature.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_signature.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_signature.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_signature.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_signature.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_signature.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_signature.h rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_signature.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_ssl.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_ssl.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_ssl.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_ssl.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_ssl.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_ssl.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_ssl.h rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_ssl.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_sslstream.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_sslstream.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_sslstream.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_sslstream.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_sslstream.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_sslstream.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_sslstream.h rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_sslstream.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_x509.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_x509.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_x509.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_x509.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_x509.h rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_x509.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_x509chain.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509chain.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_x509chain.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_x509chain.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_x509chain.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509chain.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_x509chain.h rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_x509chain.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_x509store.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509store.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_x509store.c rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_x509store.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_x509store.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_x509store.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Android/pal_x509store.h rename to src/native/libs/System.Security.Cryptography.Native.Android/pal_x509store.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/CMakeLists.txt b/src/native/libs/System.Security.Cryptography.Native.Apple/CMakeLists.txt similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/CMakeLists.txt rename to src/native/libs/System.Security.Cryptography.Native.Apple/CMakeLists.txt diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/entrypoints.c b/src/native/libs/System.Security.Cryptography.Native.Apple/entrypoints.c similarity index 98% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/entrypoints.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/entrypoints.c index c6df8a210029bc..78b451a781f539 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/entrypoints.c +++ b/src/native/libs/System.Security.Cryptography.Native.Apple/entrypoints.c @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#include +#include // Include System.Security.Cryptography.Native.Apple headers #include "pal_digest.h" @@ -131,5 +131,5 @@ EXTERN_C const void* CryptoAppleResolveDllImport(const char* name); EXTERN_C const void* CryptoAppleResolveDllImport(const char* name) { - return minipal_resolve_dllimport(s_cryptoAppleNative, lengthof(s_cryptoAppleNative), name); + return minipal_resolve_dllimport(s_cryptoAppleNative, ARRAY_SIZE(s_cryptoAppleNative), name); } diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/extra_libs.cmake b/src/native/libs/System.Security.Cryptography.Native.Apple/extra_libs.cmake similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/extra_libs.cmake rename to src/native/libs/System.Security.Cryptography.Native.Apple/extra_libs.cmake diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_digest.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_digest.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_digest.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_digest.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_digest.h b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_digest.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_digest.h rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_digest.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_ecc.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_ecc.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.h b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_ecc.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.h rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_ecc.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_hmac.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_hmac.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_hmac.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_hmac.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_hmac.h b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_hmac.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_hmac.h rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_hmac.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keyagree.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_keyagree.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keyagree.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_keyagree.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keyagree.h b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_keyagree.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keyagree.h rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_keyagree.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain_ios.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_keychain_ios.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain_ios.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_keychain_ios.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain_ios.h b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_keychain_ios.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain_ios.h rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_keychain_ios.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain_macos.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_keychain_macos.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain_macos.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_keychain_macos.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain_macos.h b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_keychain_macos.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain_macos.h rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_keychain_macos.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keyderivation_macos.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_keyderivation_macos.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keyderivation_macos.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_keyderivation_macos.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keyderivation_macos.h b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_keyderivation_macos.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keyderivation_macos.h rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_keyderivation_macos.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_random.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_random.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_random.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_random.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_random.h b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_random.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_random.h rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_random.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_rsa.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_rsa.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.h b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_rsa.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.h rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_rsa.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_sec.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_sec.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.h b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_sec.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.h rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_sec.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_seckey.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_seckey.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.h b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_seckey.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.h rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_seckey.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey_macos.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_seckey_macos.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey_macos.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_seckey_macos.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey_macos.h b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_seckey_macos.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey_macos.h rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_seckey_macos.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_signverify.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_signverify.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.h b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_signverify.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.h rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_signverify.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ssl.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_ssl.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ssl.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_ssl.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ssl.h b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_ssl.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ssl.h rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_ssl.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_symmetric.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_symmetric.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_symmetric.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_symmetric.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_symmetric.h b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_symmetric.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_symmetric.h rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_symmetric.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust_macos.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_trust_macos.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust_macos.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_trust_macos.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust_macos.h b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_trust_macos.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust_macos.h rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_trust_macos.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.h b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.h rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509_ios.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509_ios.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509_ios.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509_ios.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509_ios.h b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509_ios.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509_ios.h rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509_ios.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509_macos.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509_macos.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509_macos.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509_macos.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509_macos.h b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509_macos.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509_macos.h rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509_macos.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509chain.c b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509chain.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509chain.c rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509chain.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509chain.h b/src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509chain.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509chain.h rename to src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509chain.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/CMakeLists.txt b/src/native/libs/System.Security.Cryptography.Native/CMakeLists.txt similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/CMakeLists.txt rename to src/native/libs/System.Security.Cryptography.Native/CMakeLists.txt diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/apibridge.c b/src/native/libs/System.Security.Cryptography.Native/apibridge.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/apibridge.c rename to src/native/libs/System.Security.Cryptography.Native/apibridge.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/apibridge.h b/src/native/libs/System.Security.Cryptography.Native/apibridge.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/apibridge.h rename to src/native/libs/System.Security.Cryptography.Native/apibridge.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/apibridge_30.c b/src/native/libs/System.Security.Cryptography.Native/apibridge_30.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/apibridge_30.c rename to src/native/libs/System.Security.Cryptography.Native/apibridge_30.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/apibridge_30.h b/src/native/libs/System.Security.Cryptography.Native/apibridge_30.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/apibridge_30.h rename to src/native/libs/System.Security.Cryptography.Native/apibridge_30.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/apibridge_30_rev.h b/src/native/libs/System.Security.Cryptography.Native/apibridge_30_rev.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/apibridge_30_rev.h rename to src/native/libs/System.Security.Cryptography.Native/apibridge_30_rev.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/configure.cmake b/src/native/libs/System.Security.Cryptography.Native/configure.cmake similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/configure.cmake rename to src/native/libs/System.Security.Cryptography.Native/configure.cmake diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/entrypoints.c b/src/native/libs/System.Security.Cryptography.Native/entrypoints.c similarity index 99% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/entrypoints.c rename to src/native/libs/System.Security.Cryptography.Native/entrypoints.c index 2a00d550854597..4a95b97756a32e 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/entrypoints.c +++ b/src/native/libs/System.Security.Cryptography.Native/entrypoints.c @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#include +#include // Include System.Security.Cryptography.Native headers #include "openssl.h" @@ -29,7 +29,6 @@ #include "pal_x509_name.h" #include "pal_x509_root.h" - static const Entry s_cryptoNative[] = { DllImportEntry(CryptoNative_Asn1BitStringFree) @@ -336,5 +335,5 @@ EXTERN_C const void* CryptoResolveDllImport(const char* name); EXTERN_C const void* CryptoResolveDllImport(const char* name) { - return minipal_resolve_dllimport(s_cryptoNative, lengthof(s_cryptoNative), name); + return minipal_resolve_dllimport(s_cryptoNative, ARRAY_SIZE(s_cryptoNative), name); } diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/extra_libs.cmake b/src/native/libs/System.Security.Cryptography.Native/extra_libs.cmake similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/extra_libs.cmake rename to src/native/libs/System.Security.Cryptography.Native/extra_libs.cmake diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/openssl.c b/src/native/libs/System.Security.Cryptography.Native/openssl.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/openssl.c rename to src/native/libs/System.Security.Cryptography.Native/openssl.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/openssl.h b/src/native/libs/System.Security.Cryptography.Native/openssl.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/openssl.h rename to src/native/libs/System.Security.Cryptography.Native/openssl.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/openssl_1_0_structs.h b/src/native/libs/System.Security.Cryptography.Native/openssl_1_0_structs.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/openssl_1_0_structs.h rename to src/native/libs/System.Security.Cryptography.Native/openssl_1_0_structs.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/opensslshim.c b/src/native/libs/System.Security.Cryptography.Native/opensslshim.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/opensslshim.c rename to src/native/libs/System.Security.Cryptography.Native/opensslshim.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/opensslshim.h b/src/native/libs/System.Security.Cryptography.Native/opensslshim.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/opensslshim.h rename to src/native/libs/System.Security.Cryptography.Native/opensslshim.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/osslcompat_102.h b/src/native/libs/System.Security.Cryptography.Native/osslcompat_102.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/osslcompat_102.h rename to src/native/libs/System.Security.Cryptography.Native/osslcompat_102.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/osslcompat_111.h b/src/native/libs/System.Security.Cryptography.Native/osslcompat_111.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/osslcompat_111.h rename to src/native/libs/System.Security.Cryptography.Native/osslcompat_111.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/osslcompat_30.h b/src/native/libs/System.Security.Cryptography.Native/osslcompat_30.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/osslcompat_30.h rename to src/native/libs/System.Security.Cryptography.Native/osslcompat_30.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_asn1.c b/src/native/libs/System.Security.Cryptography.Native/pal_asn1.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_asn1.c rename to src/native/libs/System.Security.Cryptography.Native/pal_asn1.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_asn1.h b/src/native/libs/System.Security.Cryptography.Native/pal_asn1.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_asn1.h rename to src/native/libs/System.Security.Cryptography.Native/pal_asn1.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_bignum.c b/src/native/libs/System.Security.Cryptography.Native/pal_bignum.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_bignum.c rename to src/native/libs/System.Security.Cryptography.Native/pal_bignum.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_bignum.h b/src/native/libs/System.Security.Cryptography.Native/pal_bignum.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_bignum.h rename to src/native/libs/System.Security.Cryptography.Native/pal_bignum.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_bio.c b/src/native/libs/System.Security.Cryptography.Native/pal_bio.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_bio.c rename to src/native/libs/System.Security.Cryptography.Native/pal_bio.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_bio.h b/src/native/libs/System.Security.Cryptography.Native/pal_bio.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_bio.h rename to src/native/libs/System.Security.Cryptography.Native/pal_bio.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_crypto_config.h.in b/src/native/libs/System.Security.Cryptography.Native/pal_crypto_config.h.in similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_crypto_config.h.in rename to src/native/libs/System.Security.Cryptography.Native/pal_crypto_config.h.in diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_crypto_types.h b/src/native/libs/System.Security.Cryptography.Native/pal_crypto_types.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_crypto_types.h rename to src/native/libs/System.Security.Cryptography.Native/pal_crypto_types.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_dsa.c b/src/native/libs/System.Security.Cryptography.Native/pal_dsa.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_dsa.c rename to src/native/libs/System.Security.Cryptography.Native/pal_dsa.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_dsa.h b/src/native/libs/System.Security.Cryptography.Native/pal_dsa.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_dsa.h rename to src/native/libs/System.Security.Cryptography.Native/pal_dsa.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ecc_import_export.c b/src/native/libs/System.Security.Cryptography.Native/pal_ecc_import_export.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ecc_import_export.c rename to src/native/libs/System.Security.Cryptography.Native/pal_ecc_import_export.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ecc_import_export.h b/src/native/libs/System.Security.Cryptography.Native/pal_ecc_import_export.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ecc_import_export.h rename to src/native/libs/System.Security.Cryptography.Native/pal_ecc_import_export.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ecdsa.c b/src/native/libs/System.Security.Cryptography.Native/pal_ecdsa.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ecdsa.c rename to src/native/libs/System.Security.Cryptography.Native/pal_ecdsa.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ecdsa.h b/src/native/libs/System.Security.Cryptography.Native/pal_ecdsa.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ecdsa.h rename to src/native/libs/System.Security.Cryptography.Native/pal_ecdsa.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_eckey.c b/src/native/libs/System.Security.Cryptography.Native/pal_eckey.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_eckey.c rename to src/native/libs/System.Security.Cryptography.Native/pal_eckey.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_eckey.h b/src/native/libs/System.Security.Cryptography.Native/pal_eckey.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_eckey.h rename to src/native/libs/System.Security.Cryptography.Native/pal_eckey.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_err.c b/src/native/libs/System.Security.Cryptography.Native/pal_err.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_err.c rename to src/native/libs/System.Security.Cryptography.Native/pal_err.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_err.h b/src/native/libs/System.Security.Cryptography.Native/pal_err.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_err.h rename to src/native/libs/System.Security.Cryptography.Native/pal_err.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp.c b/src/native/libs/System.Security.Cryptography.Native/pal_evp.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp.c rename to src/native/libs/System.Security.Cryptography.Native/pal_evp.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp.h b/src/native/libs/System.Security.Cryptography.Native/pal_evp.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp.h rename to src/native/libs/System.Security.Cryptography.Native/pal_evp.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_cipher.c b/src/native/libs/System.Security.Cryptography.Native/pal_evp_cipher.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_cipher.c rename to src/native/libs/System.Security.Cryptography.Native/pal_evp_cipher.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_cipher.h b/src/native/libs/System.Security.Cryptography.Native/pal_evp_cipher.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_cipher.h rename to src/native/libs/System.Security.Cryptography.Native/pal_evp_cipher.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey.c b/src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey.c rename to src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey.h b/src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey.h rename to src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_dsa.c b/src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey_dsa.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_dsa.c rename to src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey_dsa.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_dsa.h b/src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey_dsa.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_dsa.h rename to src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey_dsa.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_ecdh.c b/src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey_ecdh.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_ecdh.c rename to src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey_ecdh.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_ecdh.h b/src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey_ecdh.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_ecdh.h rename to src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey_ecdh.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_eckey.c b/src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey_eckey.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_eckey.c rename to src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey_eckey.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_eckey.h b/src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey_eckey.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_eckey.h rename to src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey_eckey.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_rsa.c b/src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey_rsa.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_rsa.c rename to src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey_rsa.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_rsa.h b/src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey_rsa.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_rsa.h rename to src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey_rsa.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_hmac.c b/src/native/libs/System.Security.Cryptography.Native/pal_hmac.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_hmac.c rename to src/native/libs/System.Security.Cryptography.Native/pal_hmac.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_hmac.h b/src/native/libs/System.Security.Cryptography.Native/pal_hmac.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_hmac.h rename to src/native/libs/System.Security.Cryptography.Native/pal_hmac.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ocsp.c b/src/native/libs/System.Security.Cryptography.Native/pal_ocsp.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ocsp.c rename to src/native/libs/System.Security.Cryptography.Native/pal_ocsp.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ocsp.h b/src/native/libs/System.Security.Cryptography.Native/pal_ocsp.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ocsp.h rename to src/native/libs/System.Security.Cryptography.Native/pal_ocsp.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_pkcs7.c b/src/native/libs/System.Security.Cryptography.Native/pal_pkcs7.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_pkcs7.c rename to src/native/libs/System.Security.Cryptography.Native/pal_pkcs7.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_pkcs7.h b/src/native/libs/System.Security.Cryptography.Native/pal_pkcs7.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_pkcs7.h rename to src/native/libs/System.Security.Cryptography.Native/pal_pkcs7.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ssl.c b/src/native/libs/System.Security.Cryptography.Native/pal_ssl.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ssl.c rename to src/native/libs/System.Security.Cryptography.Native/pal_ssl.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ssl.h b/src/native/libs/System.Security.Cryptography.Native/pal_ssl.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ssl.h rename to src/native/libs/System.Security.Cryptography.Native/pal_ssl.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509.c b/src/native/libs/System.Security.Cryptography.Native/pal_x509.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509.c rename to src/native/libs/System.Security.Cryptography.Native/pal_x509.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509.h b/src/native/libs/System.Security.Cryptography.Native/pal_x509.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509.h rename to src/native/libs/System.Security.Cryptography.Native/pal_x509.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509_name.c b/src/native/libs/System.Security.Cryptography.Native/pal_x509_name.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509_name.c rename to src/native/libs/System.Security.Cryptography.Native/pal_x509_name.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509_name.h b/src/native/libs/System.Security.Cryptography.Native/pal_x509_name.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509_name.h rename to src/native/libs/System.Security.Cryptography.Native/pal_x509_name.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509_root.c b/src/native/libs/System.Security.Cryptography.Native/pal_x509_root.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509_root.c rename to src/native/libs/System.Security.Cryptography.Native/pal_x509_root.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509_root.h b/src/native/libs/System.Security.Cryptography.Native/pal_x509_root.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509_root.h rename to src/native/libs/System.Security.Cryptography.Native/pal_x509_root.h diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509ext.c b/src/native/libs/System.Security.Cryptography.Native/pal_x509ext.c similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509ext.c rename to src/native/libs/System.Security.Cryptography.Native/pal_x509ext.c diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509ext.h b/src/native/libs/System.Security.Cryptography.Native/pal_x509ext.h similarity index 100% rename from src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_x509ext.h rename to src/native/libs/System.Security.Cryptography.Native/pal_x509ext.h diff --git a/src/libraries/Native/build-native.cmd b/src/native/libs/build-native.cmd similarity index 93% rename from src/libraries/Native/build-native.cmd rename to src/native/libs/build-native.cmd index 8d54bc7fa685de..ae97ff4e3262ff 100644 --- a/src/libraries/Native/build-native.cmd +++ b/src/native/libs/build-native.cmd @@ -56,12 +56,6 @@ set __cmakeRepoRoot=%__repoRoot:\=/% set __ExtraCmakeParams="-DCMAKE_REPO_ROOT=%__cmakeRepoRoot%" set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE%" -if /i "%__BuildArch%" == "wasm" ( - set __sourceDir=%__sourceRootDir%\Unix -) else ( - set __sourceDir=%__sourceRootDir%\Windows -) - if [%__outConfig%] == [] set __outConfig=%__TargetOS%-%__BuildArch%-%CMAKE_BUILD_TYPE% if %__CMakeBinDir% == "" ( @@ -91,7 +85,7 @@ echo %MSBUILD_EMPTY_PROJECT_CONTENT% > "%__artifactsDir%\obj\native\Directory.Bu :: Regenerate the VS solution pushd "%__IntermediatesDir%" -call "%__repoRoot%\eng\native\gen-buildsys.cmd" "%__sourceDir%" "%__IntermediatesDir%" %__VSVersion% %__BuildArch% %__ExtraCmakeParams% +call "%__repoRoot%\eng\native\gen-buildsys.cmd" "%__sourceRootDir%" "%__IntermediatesDir%" %__VSVersion% %__BuildArch% %__ExtraCmakeParams% if NOT [%errorlevel%] == [0] goto :Failure popd diff --git a/src/libraries/Native/build-native.proj b/src/native/libs/build-native.proj similarity index 97% rename from src/libraries/Native/build-native.proj rename to src/native/libs/build-native.proj index c23e65add6c869..b35a2b335d29a1 100644 --- a/src/libraries/Native/build-native.proj +++ b/src/native/libs/build-native.proj @@ -9,7 +9,7 @@ - + #include - -#ifndef lengthof -#define lengthof(rg) (sizeof(rg)/sizeof(rg[0])) -#endif +#include typedef struct { @@ -32,3 +30,5 @@ static const void* minipal_resolve_dllimport(const Entry* resolutionTable, size_ return NULL; } + +#endif // HAVE_MINIPAL_ENTRYPOINTS_H diff --git a/src/native/common/getexepath.h b/src/native/minipal/getexepath.h similarity index 95% rename from src/native/common/getexepath.h rename to src/native/minipal/getexepath.h index 01c6b01e249a17..ecc6dc8d72771b 100644 --- a/src/native/common/getexepath.h +++ b/src/native/minipal/getexepath.h @@ -1,8 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#ifndef GETEXEPATH_H -#define GETEXEPATH_H +#ifndef HAVE_MINIPAL_GETEXEPATH_H +#define HAVE_MINIPAL_GETEXEPATH_H #include #include @@ -95,4 +95,4 @@ static inline char* minipal_getexepath(void) } #endif // extern "C" -#endif // GETEXEPATH_H +#endif // HAVE_MINIPAL_GETEXEPATH_H diff --git a/src/native/minipal/utils.h b/src/native/minipal/utils.h new file mode 100644 index 00000000000000..140ea158fdba10 --- /dev/null +++ b/src/native/minipal/utils.h @@ -0,0 +1,12 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef HAVE_MINIPAL_UTILS_H +#define HAVE_MINIPAL_UTILS_H + +#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0])) + +// Number of characters in a string literal. Excludes terminating NULL. +#define STRING_LENGTH(str) (ARRAY_SIZE(str) - 1) + +#endif // HAVE_MINIPAL_UTILS_H diff --git a/src/samples/DllImportGeneratorSample/DllImportGeneratorSample.csproj b/src/samples/DllImportGeneratorSample/DllImportGeneratorSample.csproj index 32bd062dfe8c7e..f42621f44c254b 100644 --- a/src/samples/DllImportGeneratorSample/DllImportGeneratorSample.csproj +++ b/src/samples/DllImportGeneratorSample/DllImportGeneratorSample.csproj @@ -16,7 +16,6 @@ - diff --git a/src/tasks/WasmAppBuilder/IcallTableGenerator.cs b/src/tasks/WasmAppBuilder/IcallTableGenerator.cs index 7101815a73ba80..08a560aa37bf33 100644 --- a/src/tasks/WasmAppBuilder/IcallTableGenerator.cs +++ b/src/tasks/WasmAppBuilder/IcallTableGenerator.cs @@ -31,8 +31,16 @@ public class IcallTableGenerator : Task public override bool Execute() { - GenIcallTable(RuntimeIcallTableFile!, Assemblies!.Select(item => item.ItemSpec).ToArray()); - return true; + try + { + GenIcallTable(RuntimeIcallTableFile!, Assemblies!.Select(item => item.ItemSpec).ToArray()); + return !Log.HasLoggedErrors; + } + catch (LogAsErrorException laee) + { + Log.LogError(laee.Message); + return false; + } } // @@ -152,20 +160,9 @@ private void ProcessType (Type type) icallClass.Icalls.TryGetValue (method.Name, out icall); if (icall == null) { - // Then with signature - var sig = new StringBuilder (method.Name + "("); - int pindex = 0; - foreach (var par in method.GetParameters()) - { - if (pindex > 0) - sig.Append (','); - var t = par.ParameterType; - AppendType (sig, t); - pindex++; - } - sig.Append (')'); - if (icallClass.Icalls.ContainsKey (sig.ToString ())) - icall = icallClass.Icalls [sig.ToString ()]; + string? methodSig = BuildSignature(method, className); + if (methodSig != null && icallClass.Icalls.ContainsKey (methodSig)) + icall = icallClass.Icalls [methodSig]; } if (icall == null) // Registered at runtime @@ -178,6 +175,33 @@ private void ProcessType (Type type) foreach (var nestedType in type.GetNestedTypes()) ProcessType(nestedType); + + string? BuildSignature(MethodInfo method, string className) + { + // Then with signature + var sig = new StringBuilder (method.Name + "("); + int pindex = 0; + foreach (var par in method.GetParameters()) + { + if (pindex > 0) + sig.Append (','); + var t = par.ParameterType; + try + { + AppendType (sig, t); + } + catch (NotImplementedException nie) + { + Log.LogWarning($"Failed to generate icall function for method '[{method.DeclaringType!.Assembly.GetName().Name}] {className}::{method.Name}'" + + $" because type '{nie.Message}' is not supported for parameter named '{par.Name}'. Ignoring."); + return null; + } + pindex++; + } + sig.Append (')'); + + return sig.ToString(); + } } // Append the type name used by the runtime icall tables diff --git a/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs b/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs index fddc4ba4e7d836..8170c0f04c483a 100644 --- a/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs +++ b/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs @@ -415,7 +415,7 @@ private void EmitNativeToInterp(StreamWriter w, List callbacks) private static bool IsBlittable (Type type) { - if (type.IsPrimitive || type.IsByRef || type.IsPointer) + if (type.IsPrimitive || type.IsByRef || type.IsPointer || type.IsEnum) return true; else return false; diff --git a/src/tasks/WasmAppBuilder/WasmAppBuilder.cs b/src/tasks/WasmAppBuilder/WasmAppBuilder.cs index 4c3054cad30e91..f592f488327cf6 100644 --- a/src/tasks/WasmAppBuilder/WasmAppBuilder.cs +++ b/src/tasks/WasmAppBuilder/WasmAppBuilder.cs @@ -174,12 +174,12 @@ private bool ExecuteInternal () if (!FileCopyChecked(item.ItemSpec, dest, "NativeAssets")) return false; } - FileCopyChecked(MainJS!, Path.Combine(AppDir, "runtime.js"), string.Empty); + FileCopyChecked(MainJS!, Path.Combine(AppDir, "main.js"), string.Empty); string indexHtmlPath = Path.Combine(AppDir, "index.html"); if (!File.Exists(indexHtmlPath)) { - var html = @""; + var html = @""; File.WriteAllText(indexHtmlPath, html); } @@ -365,9 +365,16 @@ private bool FileCopyChecked(string src, string dst, string label) } Log.LogMessage(MessageImportance.Low, $"Copying file from '{src}' to '{dst}'"); - File.Copy(src, dst, true); - _fileWrites.Add(dst); + try + { + File.Copy(src, dst, true); + _fileWrites.Add(dst); - return true; + return true; + } + catch (IOException ioex) + { + throw new LogAsErrorException($"{label} Failed to copy {src} to {dst} because {ioex.Message}"); + } } } diff --git a/src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs b/src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs index 6c5f4a71a08578..08f933b2b6e01d 100644 --- a/src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs +++ b/src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs @@ -27,14 +27,30 @@ public class InstallWorkloadFromArtifacts : Task [Required, NotNull] public string? LocalNuGetsPath { get; set; } + [Required, NotNull] + public string? TemplateNuGetConfigPath { get; set; } + [Required, NotNull] public string? SdkDir { get; set; } public bool OnlyUpdateManifests{ get; set; } - public ITaskItem[] ExtraNuGetSources { get; set; } = Array.Empty(); + private const string s_nugetInsertionTag = ""; public override bool Execute() + { + try + { + return ExecuteInternal(); + } + catch (LogAsErrorException laee) + { + Log.LogError(laee.Message); + return false; + } + } + + private bool ExecuteInternal() { if (!HasMetadata(WorkloadId, nameof(WorkloadId), "Version") || !HasMetadata(WorkloadId, nameof(WorkloadId), "ManifestName")) @@ -48,6 +64,12 @@ public override bool Execute() return false; } + if (!File.Exists(TemplateNuGetConfigPath)) + { + Log.LogError($"Cannot find TemplateNuGetConfigPath={TemplateNuGetConfigPath}"); + return false; + } + Log.LogMessage(MessageImportance.High, $"{Environment.NewLine}** Installing workload manifest {WorkloadId.ItemSpec} **{Environment.NewLine}"); string nugetConfigContents = GetNuGetConfig(); @@ -86,25 +108,11 @@ public override bool Execute() private string GetNuGetConfig() { - StringBuilder nugetConfigBuilder = new(); - nugetConfigBuilder.AppendLine($"{Environment.NewLine}"); - - nugetConfigBuilder.AppendLine($@""); - foreach (ITaskItem source in ExtraNuGetSources) - { - string key = source.ItemSpec; - string value = source.GetMetadata("Value"); - if (string.IsNullOrEmpty(value)) - { - Log.LogWarning($"ExtraNuGetSource {key} is missing Value metadata"); - continue; - } - - nugetConfigBuilder.AppendLine($@""); - } + string contents = File.ReadAllText(TemplateNuGetConfigPath); + if (contents.IndexOf(s_nugetInsertionTag) < 0) + throw new LogAsErrorException($"Could not find {s_nugetInsertionTag} in {TemplateNuGetConfigPath}"); - nugetConfigBuilder.AppendLine($"{Environment.NewLine}"); - return nugetConfigBuilder.ToString(); + return contents.Replace(s_nugetInsertionTag, $@""); } private bool InstallWorkloadManifest(string name, string version, string nugetConfigContents, bool stopOnMissing) diff --git a/src/tasks/WorkloadBuildTasks/WorkloadBuildTasks.csproj b/src/tasks/WorkloadBuildTasks/WorkloadBuildTasks.csproj index bec88895f4c28a..738fbedb31eaa7 100644 --- a/src/tasks/WorkloadBuildTasks/WorkloadBuildTasks.csproj +++ b/src/tasks/WorkloadBuildTasks/WorkloadBuildTasks.csproj @@ -7,6 +7,7 @@ + diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmBuildPublishTests.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmBuildPublishTests.cs index d4fb7cf49875cf..ee527b6013c22d 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmBuildPublishTests.cs +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmBuildPublishTests.cs @@ -3,9 +3,11 @@ using System.IO; using System.Linq; +using System.Text.Json; using System.Text.RegularExpressions; using Xunit; using Xunit.Abstractions; +using Xunit.Sdk; #nullable enable @@ -225,6 +227,56 @@ void CheckNativeFileLinked(bool forPublish) } } + [ConditionalFact(typeof(BuildTestBase), nameof(IsUsingWorkloads))] + public void BugRegression_60479_WithRazorClassLib() + { + string id = "blz_razor_lib_top"; + InitBlazorWasmProjectDir(id); + + string wasmProjectDir = Path.Combine(_projectDir!, "wasm"); + string wasmProjectFile = Path.Combine(wasmProjectDir, "wasm.csproj"); + Directory.CreateDirectory(wasmProjectDir); + new DotNetCommand(s_buildEnv, useDefaultArgs: false) + .WithWorkingDirectory(wasmProjectDir) + .ExecuteWithCapturedOutput("new blazorwasm") + .EnsureSuccessful(); + + + string razorProjectDir = Path.Combine(_projectDir!, "RazorClassLibrary"); + Directory.CreateDirectory(razorProjectDir); + new DotNetCommand(s_buildEnv, useDefaultArgs: false) + .WithWorkingDirectory(razorProjectDir) + .ExecuteWithCapturedOutput("new razorclasslib") + .EnsureSuccessful(); + + AddItemsPropertiesToProject(wasmProjectFile, extraItems:@" + + + "); + + _projectDir = wasmProjectDir; + string config = "Release"; + // No relinking, no AOT + BlazorBuild(id, config, NativeFilesType.FromRuntimePack); + + // will relink + BlazorPublish(id, config, NativeFilesType.Relinked); + + // publish/wwwroot/_framework/blazor.boot.json + string frameworkDir = FindBlazorBinFrameworkDir(config, forPublish: true); + string bootJson = Path.Combine(frameworkDir, "blazor.boot.json"); + + Assert.True(File.Exists(bootJson), $"Could not find {bootJson}"); + var jdoc = JsonDocument.Parse(File.ReadAllText(bootJson)); + if (!jdoc.RootElement.TryGetProperty("resources", out JsonElement resValue) || + !resValue.TryGetProperty("lazyAssembly", out JsonElement lazyVal)) + { + throw new XunitException($"Could not find resources.lazyAssembly object in {bootJson}"); + } + + Assert.Contains("RazorClassLibrary.dll", lazyVal.EnumerateObject().Select(jp => jp.Name)); + } + private string CreateProjectWithNativeReference(string id) { CreateBlazorWasmTemplateProject(id); diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmTests.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmTests.cs index 727e6589c4c6d2..6c7e3ed788be56 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmTests.cs +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmTests.cs @@ -79,7 +79,6 @@ private CommandResult PublishForRequiresWorkloadTest(string config, string extra [Theory] [InlineData("Debug")] [InlineData("Release")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/59538")] public void Net50Projects_NativeReference(string config) => BuildNet50Project(config, aot: false, expectError: true, @""); @@ -93,7 +92,6 @@ public void Net50Projects_NativeReference(string config) [Theory] [MemberData(nameof(Net50TestData))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/59538")] public void Net50Projects_AOT(string config, bool aot, bool expectError) => BuildNet50Project(config, aot: aot, expectError: expectError); diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildEnvironment.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildEnvironment.cs index b1de19ba1690db..366612b850f625 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildEnvironment.cs +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildEnvironment.cs @@ -111,6 +111,15 @@ public BuildEnvironment() EnvVars["MSBuildSDKsPath"] = string.Empty; EnvVars["PATH"] = $"{sdkForWorkloadPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"; + // helps with debugging + EnvVars["WasmNativeStrip"] = "false"; + + if (OperatingSystem.IsWindows()) + { + EnvVars["WasmCachePath"] = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), + ".emscripten-cache"); + } + RuntimeNativeDir = Path.Combine(RuntimePackDir, "runtimes", "browser-wasm", "native"); DotNet = Path.Combine(sdkForWorkloadPath!, "dotnet"); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs index b6fab5c6c434b7..cc4aa85a2c39d6 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs @@ -147,7 +147,7 @@ protected string RunAndTestWasmApp(BuildArgs buildArgs, string bundleDir = Path.Combine(GetBinDir(baseDir: buildDir, config: buildArgs.Config), "AppBundle"); (string testCommand, string extraXHarnessArgs) = host switch { - RunHost.V8 => ("wasm test", "--js-file=runtime.js --engine=V8 -v trace"), + RunHost.V8 => ("wasm test", "--js-file=main.js --engine=V8 -v trace"), _ => ("wasm test-browser", $"-v trace -b {host}") }; @@ -254,7 +254,7 @@ protected static void InitProjectDir(string dir) {s_targetFramework} Exe true - runtime-test.js + test-main.js ##EXTRA_PROPERTIES## @@ -310,7 +310,7 @@ protected static BuildArgs ExpandBuildArgs(BuildArgs buildArgs, string extraProp initProject?.Invoke(); File.WriteAllText(Path.Combine(_projectDir, $"{buildArgs.ProjectName}.csproj"), buildArgs.ProjectFileContents); - File.Copy(Path.Combine(AppContext.BaseDirectory, "runtime-test.js"), Path.Combine(_projectDir, "runtime-test.js")); + File.Copy(Path.Combine(AppContext.BaseDirectory, "test-main.js"), Path.Combine(_projectDir, "test-main.js")); } else if (_projectDir is null) { @@ -486,7 +486,7 @@ protected static void AssertBasicAppBundle(string bundleDir, string projectName, AssertFilesExist(bundleDir, new [] { "index.html", - "runtime.js", + "main.js", "dotnet.timezones.blat", "dotnet.wasm", "mono-config.json", diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/MainWithArgsTests.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/MainWithArgsTests.cs index b97a0490d2e872..73598d8b079b13 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/MainWithArgsTests.cs +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/MainWithArgsTests.cs @@ -25,6 +25,7 @@ public MainWithArgsTests(ITestOutputHelper output, SharedBuildPerTestClassFixtur ).WithRunHosts(host).UnwrapItemsAsArrays(); [Theory] + [ActiveIssue("https://github.com/dotnet/runtime/issues/61725", TestPlatforms.Windows)] [MemberData(nameof(MainWithArgsTestData), parameters: new object[] { /*aot*/ false, RunHost.All })] [MemberData(nameof(MainWithArgsTestData), parameters: new object[] { /*aot*/ true, RunHost.All })] public void AsyncMainWithArgs(BuildArgs buildArgs, string[] args, RunHost host, string id) @@ -39,6 +40,7 @@ public static async System.Threading.Tasks.Task Main(string[] args) buildArgs, args, host, id); [Theory] + [ActiveIssue("https://github.com/dotnet/runtime/issues/61725", TestPlatforms.Windows)] [MemberData(nameof(MainWithArgsTestData), parameters: new object[] { /*aot*/ false, RunHost.All })] [MemberData(nameof(MainWithArgsTestData), parameters: new object[] { /*aot*/ true, RunHost.All })] public void TopLevelWithArgs(BuildArgs buildArgs, string[] args, RunHost host, string id) diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/NativeRebuildTests/FlagsChangeRebuildTest.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/NativeRebuildTests/FlagsChangeRebuildTest.cs index b73e521f8ca206..21671324a210e9 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/NativeRebuildTests/FlagsChangeRebuildTest.cs +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/NativeRebuildTests/FlagsChangeRebuildTest.cs @@ -54,7 +54,7 @@ public void ExtraEmccFlagsSetButNoRealChange(BuildArgs buildArgs, string extraCF AssertSubstring("pinvoke.c -> pinvoke.o", output, contains: extraCFlags.Length > 0); // ldflags: link step args change, so it should trigger relink - AssertSubstring("wasm-opt", output, contains: extraLDFlags.Length > 0); + AssertSubstring("Linking with emcc", output, contains: extraLDFlags.Length > 0); if (buildArgs.AOT) { diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/NativeRebuildTests/ReferenceNewAssemblyRebuildTest.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/NativeRebuildTests/ReferenceNewAssemblyRebuildTest.cs index 5aa3d2916f36fe..d920ac400559ab 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/NativeRebuildTests/ReferenceNewAssemblyRebuildTest.cs +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/NativeRebuildTests/ReferenceNewAssemblyRebuildTest.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.IO; using System.Linq; using Wasm.Build.Tests; @@ -19,6 +20,7 @@ public ReferenceNewAssemblyRebuildTest(ITestOutputHelper output, SharedBuildPerT } [Theory] + [ActiveIssue("https://github.com/dotnet/runtime/issues/61725", TestPlatforms.Windows)] [MemberData(nameof(NativeBuildData))] public void ReferenceNewAssembly(BuildArgs buildArgs, bool nativeRelink, bool invariant, RunHost host, string id) { diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/SatelliteAssembliesTests.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/SatelliteAssembliesTests.cs index c3a40b470200a6..b65c274ae62ed4 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/SatelliteAssembliesTests.cs +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/SatelliteAssembliesTests.cs @@ -29,6 +29,7 @@ public SatelliteAssembliesTests(ITestOutputHelper output, SharedBuildPerTestClas .UnwrapItemsAsArrays(); [Theory] + [ActiveIssue("https://github.com/dotnet/runtime/issues/61725", TestPlatforms.Windows)] [MemberData(nameof(SatelliteAssemblyTestData), parameters: new object[] { /*aot*/ false, /*relinking*/ false, RunHost.All })] [MemberData(nameof(SatelliteAssemblyTestData), parameters: new object[] { /*aot*/ false, /*relinking*/ true, RunHost.All })] [MemberData(nameof(SatelliteAssemblyTestData), parameters: new object[] { /*aot*/ true, /*relinking*/ false, RunHost.All })] @@ -66,6 +67,7 @@ public void ResourcesFromMainAssembly(BuildArgs buildArgs, } [Theory] + [ActiveIssue("https://github.com/dotnet/runtime/issues/61725", TestPlatforms.Windows)] [MemberData(nameof(SatelliteAssemblyTestData), parameters: new object[] { /*aot*/ false, /*relinking*/ false, RunHost.All })] [MemberData(nameof(SatelliteAssemblyTestData), parameters: new object[] { /*aot*/ false, /*relinking*/ true, RunHost.All })] [MemberData(nameof(SatelliteAssemblyTestData), parameters: new object[] { /*aot*/ true, /*relinking*/ false, RunHost.All })] @@ -148,7 +150,7 @@ private void CreateProgramForCultureTest(string dir, string resourceName, string {s_targetFramework} Exe true - runtime-test.js + test-main.js ##EXTRA_PROPERTIES## diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/Wasm.Build.Tests.csproj b/src/tests/BuildWasmApps/Wasm.Build.Tests/Wasm.Build.Tests.csproj index 0b05047a21fecb..9411e65e0be56e 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/Wasm.Build.Tests.csproj +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/Wasm.Build.Tests.csproj @@ -1,7 +1,6 @@ $(NetCoreAppToolCurrent) - true true true true @@ -27,7 +26,7 @@ - + @@ -66,6 +65,7 @@ $(RunScriptCommand) -nocolor $(RunScriptCommand) -verbose + $(RunScriptCommand) -parallel none $(RunScriptCommand) -method $(XUnitMethodName) $(RunScriptCommand) -class $(XUnitClassName) diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/WasmBuildAppTest.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/WasmBuildAppTest.cs index 412bf4a3da2eae..68bc578754c04b 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/WasmBuildAppTest.cs +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/WasmBuildAppTest.cs @@ -21,6 +21,7 @@ public WasmBuildAppTest(ITestOutputHelper output, SharedBuildPerTestClassFixture .UnwrapItemsAsArrays(); [Theory] + [ActiveIssue("https://github.com/dotnet/runtime/issues/61725", TestPlatforms.Windows)] [MemberData(nameof(MainMethodTestData), parameters: new object[] { /*aot*/ true, RunHost.All })] [MemberData(nameof(MainMethodTestData), parameters: new object[] { /*aot*/ false, RunHost.All })] public void TopLevelMain(BuildArgs buildArgs, RunHost host, string id) @@ -29,6 +30,7 @@ public void TopLevelMain(BuildArgs buildArgs, RunHost host, string id) buildArgs, host, id); [Theory] + [ActiveIssue("https://github.com/dotnet/runtime/issues/61725", TestPlatforms.Windows)] [MemberData(nameof(MainMethodTestData), parameters: new object[] { /*aot*/ true, RunHost.All })] [MemberData(nameof(MainMethodTestData), parameters: new object[] { /*aot*/ false, RunHost.All })] public void AsyncMain(BuildArgs buildArgs, RunHost host, string id) diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Blazor.Directory.Build.targets b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Blazor.Directory.Build.targets index 5cef9821d8f805..eef5145d0bc1f0 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Blazor.Directory.Build.targets +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Blazor.Directory.Build.targets @@ -3,6 +3,9 @@ <_MicrosoftNetCoreAppRefDir>$(AppRefDir)\ Microsoft.NETCore.App + + + diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Local.Directory.Build.targets b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Local.Directory.Build.targets index b327d1e91f6eb8..2bc257a74862f7 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Local.Directory.Build.targets +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Local.Directory.Build.targets @@ -1,4 +1,8 @@ + + + + diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/RunScriptTemplate.sh b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/RunScriptTemplate.sh index 66f889350dd4f2..7965b10230178e 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/RunScriptTemplate.sh +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/RunScriptTemplate.sh @@ -4,13 +4,13 @@ EXECUTION_DIR=$(dirname $0) cd $EXECUTION_DIR -if [ -z "$HELIX_WORKITEM_UPLOAD_ROOT" ]; then +if [[ -z "$HELIX_WORKITEM_UPLOAD_ROOT" ]]; then XHARNESS_OUT="$EXECUTION_DIR/xharness-output" else XHARNESS_OUT="$HELIX_WORKITEM_UPLOAD_ROOT/xharness-output" fi -if [ ! -z "$XHARNESS_CLI_PATH" ]; then +if [[ -n "$XHARNESS_CLI_PATH" ]]; then # When running in CI, we only have the .NET runtime available # We need to call the XHarness CLI DLL directly via dotnet exec HARNESS_RUNNER="dotnet exec $XHARNESS_CLI_PATH" @@ -25,7 +25,7 @@ function set_env_vars() export SDK_HAS_WORKLOAD_INSTALLED=true export SDK_FOR_WORKLOAD_TESTING_PATH=$BASE_DIR/dotnet-workload export AppRefDir=$BASE_DIR/microsoft.netcore.app.ref - elif [ ! -z "$HELIX_WORKITEM_UPLOAD_ROOT" ]; then + elif [[ -n "$HELIX_WORKITEM_UPLOAD_ROOT" ]]; then export WasmBuildSupportDir=$BASE_DIR/build else export PATH=$BASE_DIR/sdk-no-workload:$PATH diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Workloads.Directory.Build.targets b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Workloads.Directory.Build.targets index 34eeeaeee7bd7c..76e505544f534e 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Workloads.Directory.Build.targets +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/data/Workloads.Directory.Build.targets @@ -3,6 +3,10 @@ <_MicrosoftNetCoreAppRefDir>$(AppRefDir)\ + + + + diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index fdc509005e4370..1d22f41db5ff99 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -9,6 +9,8 @@ project(Tests) include(../../eng/native/configurepaths.cmake) include(${CLR_ENG_NATIVE_DIR}/configurecompiler.cmake) +include_directories("${CLR_SRC_NATIVE_DIR}") + # Add this subdir. We install the headers for the jit. add_subdirectory(../coreclr/pal/prebuilt/inc ../coreclr/pal/prebuilt/inc) diff --git a/src/tests/Common/Assert.cs b/src/tests/Common/Assert.cs new file mode 100644 index 00000000000000..1593326e92b2f6 --- /dev/null +++ b/src/tests/Common/Assert.cs @@ -0,0 +1,244 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// This file is used to provide some basic Assert functionality for assemblies that directly reference System.Private.CoreLib +// and not the ref pack. + +// Note: Exception messages call ToString instead of Name to avoid MissingMetadataException when just outputting basic info + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Xunit +{ + /// + /// A copy of the Xunit.FactAttribute type for assemblies that reference System.Private.CoreLib directly. + /// + public sealed class FactAttribute : Attribute + {} + + /// + /// A collection of helper classes to test various conditions within + /// unit tests. If the condition being tested is not met, an exception + /// is thrown. + /// + public static class Assert + { + /// + /// Asserts that the given delegate throws an of type . + /// + /// + /// The delagate of type to execute. + /// + /// + /// A containing additional information for when the assertion fails. + /// + /// + /// The thrown . + /// + /// + /// of type was not thrown. + /// + public static T Throws(Action action) where T : Exception + { + Exception exception = RunWithCatch(action); + + if (exception == null) + Assert.True(false, $"Expected '{typeof(T)}' to be thrown."); + + if (exception is not T) + Assert.True(false, $"Expected '{typeof(T)}' to be thrown, however '{exception.GetType()}' was thrown."); + + return (T)exception; + } + + /// + /// Tests whether the specified condition is true and throws an exception + /// if the condition is false. + /// + /// The condition the test expects to be true. + /// + /// The message to include in the exception when + /// is false. The message is shown in test results. + /// + /// + /// Thrown if is false. + /// + public static void True(bool condition, string message = "") + { + if (!condition) + { + Assert.HandleFail("Assert.True", message); + } + } + + /// + /// Tests whether the specified condition is false and throws an exception + /// if the condition is true. + /// + /// The condition the test expects to be false. + /// + /// The message to include in the exception when + /// is true. The message is shown in test results. + /// + /// + /// Thrown if is true. + /// + public static void False(bool condition, string message = "") + { + if (condition) + { + Assert.HandleFail("Assert.False", message); + } + } + + /// + /// Tests whether the specified object is null and throws an exception + /// if it is not. + /// + /// The object the test expects to be null. + /// + /// The message to include in the exception when + /// is not null. The message is shown in test results. + /// + /// + /// Thrown if is not null. + /// + public static void Null(object value) + { + if (value != null) + { + Assert.HandleFail("Assert.Null", ""); + } + } + + /// + /// Tests whether the specified object is non-null and throws an exception + /// if it is null. + /// + /// The object the test expects not to be null. + /// + /// The message to include in the exception when + /// is null. The message is shown in test results. + /// + /// + /// Thrown if is null. + /// + public static void NotNull(object value) + { + if (value == null) + { + Assert.HandleFail("Assert.NotNull", ""); + } + } + + /// + /// Tests whether the expected object is equal to the actual object and + /// throws an exception if it is not. + /// + /// Expected object. + /// Actual object. + /// Message to display upon failure. + public static void Equal(T expected, T actual) + { + if (!Object.Equals(expected, actual)) + { + Assert.HandleFail("Assert.Equal", ""); + } + } + + /// + /// Tests whether the expected object is equal to the actual object and + /// throws an exception if it is not. + /// + /// Expected object. + /// Actual object. + /// Message to display upon failure. + public static void Same(object expected, object actual) + { + const string EXPECTED_MSG = @"Expected: [{1}]. Actual: [{2}]. {0}"; + + if (!Object.ReferenceEquals(expected, actual)) + { + Assert.HandleFail("Assert.Same", ""); + } + } + + /// + /// Tests whether the expected object is equal to the actual object and + /// throws an exception if it is not. + /// + /// Expected object. + /// Actual object. + /// Message to display upon failure. + public static void Equal(T expected, T actual, string format, params Object[] args) + { + Equal(expected, actual); + } + + /// + /// Tests whether the expected object is equal to the actual object and + /// throws an exception if it is not. + /// + /// + /// Expected object that we do not want it to be. + /// Actual object. + /// Message to display upon failure. + public static void NotEqual(T notExpected, T actual) + { + if (Object.Equals(notExpected, actual)) + { + Assert.HandleFail("Assert.NotEqual", ""); + } + } + + /// + /// Helper function that creates and throws an exception. + /// + /// name of the assertion throwing an exception. + /// message describing conditions for assertion failure. + /// The parameters.= + internal static void HandleFail(string assertionName, string message) + { + throw new XunitException(assertionName + ": " + message); + } + + + [Obsolete("Did you mean to call Assert.Equal()")] + public static new bool Equals(Object o1, Object o2) + { + Assert.True(false, "Don't call this."); + throw new Exception(); + } + + private static Exception RunWithCatch(Action action) + { + try + { + action(); + return null; + } + catch (Exception ex) + { + return ex; + } + } + } + + /// + /// Exception raised by the Assert on Fail + /// + public class XunitException : Exception + { + public XunitException(string message) + : base(message) + { + } + + public XunitException() + : base() + { + } + } +} diff --git a/src/tests/Common/CoreCLRTestLibrary/AssertExtensions.cs b/src/tests/Common/CoreCLRTestLibrary/AssertExtensions.cs new file mode 100644 index 00000000000000..c039f5a71814b5 --- /dev/null +++ b/src/tests/Common/CoreCLRTestLibrary/AssertExtensions.cs @@ -0,0 +1,176 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// Note: Exception messages call ToString instead of Name to avoid MissingMetadataException when just outputting basic info + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Xunit +{ + public static class AssertExtensions + { + /// + /// Asserts that the given delegate throws an with the given parameter name. + /// + /// + /// The delagate of type to execute. + /// + /// + /// A containing additional information for when the assertion fails. + /// + /// + /// A containing the parameter of name to check, to skip parameter validation. + /// + /// + /// The thrown . + /// + /// + /// of type was not thrown. + /// + /// -or- + /// + /// is not equal to . + /// + public static ArgumentException ThrowsArgumentException(string parameterName, Action action) + { + return ThrowsArgumentException(parameterName, action); + } + + /// + /// Asserts that the given delegate throws an of type with the given parameter name. + /// + /// + /// The delagate of type to execute. + /// + /// + /// A containing additional information for when the assertion fails. + /// + /// + /// A containing the parameter of name to check, to skip parameter validation. + /// + /// + /// The thrown . + /// + /// + /// of type was not thrown. + /// + /// -or- + /// + /// is not equal to . + /// + public static T ThrowsArgumentException(string parameterName, Action action) + where T : ArgumentException + { + T exception = Assert.Throws(action); + +#if DEBUG + // ParamName's not available on ret builds + if (parameterName != null) + Assert.Equal(parameterName, exception.ParamName); +#endif + + return exception; + } + + /// + /// Asserts that the given async delegate throws an of type and + /// returns an of type . + /// + /// + /// The delagate of type to execute. + /// + /// + /// A containing additional information for when the assertion fails. + /// + /// + /// Specifies whether should require an exact type match when comparing the expected exception type with the thrown exception. The default is . + /// + /// + /// The thrown inner . + /// + /// + /// of type was not thrown. + /// + /// -or- + /// + /// is not of type . + /// + public static TInner ThrowsWithInnerException(Action action) + where T : Exception + where TInner : Exception + { + T outerException = Assert.Throws(action); + + if (outerException.InnerException == null) + Assert.True(false, string.Format("Expected '{0}.InnerException' to be '{1}', however it is null.", typeof(T), typeof(TInner))); + + if (outerException.InnerException is not TInner) + Assert.True(false, string.Format("Expected '{0}.InnerException', to be '{1}', however, '{2}' is.", typeof(T), typeof(TInner), outerException.InnerException.GetType())); + + return (TInner)outerException.InnerException; + } + + + /// + /// Tests whether the two lists are the same length and contain the same objects (using Object.Equals()) in the same order and + /// throws an exception if it is not. + /// + /// Expected list. + /// Actual list. + /// Message to display upon failure. + public static void CollectionEqual(T[] expected, T[] actual) + { + Assert.Equal(expected.Length, actual.Length); + + for (int i = 0; i < expected.Length; i++) + Assert.Equal(expected[i], actual[i]); + } + + /// + /// Tests whether the two enumerables are the same length and contain the same objects (using Object.Equals()) in the same order and + /// throws an exception if it is not. + /// + /// Expected enumerables. + /// Actual enumerables. + /// Message to display upon failure. + public static void CollectionEqual(IEnumerable expected, IEnumerable actual) + { + CollectionEqual(CopyToArray(expected), CopyToArray(actual)); + } + + /// + /// Iterates through an IEnumerable to generate an array of elements. The rational for using this instead of + /// System.Linq.ToArray is that this will not require a dependency on System.Linq.dll + /// + private static T[] CopyToArray(IEnumerable source) + { + T[] items = new T[4]; + int count = 0; + + if (source == null) + return null; + + foreach (var item in source) + { + if (items.Length == count) + { + var newItems = new T[checked(count * 2)]; + Array.Copy(items, 0, newItems, 0, count); + items = newItems; + } + + items[count] = item; + count++; + } + + if (items.Length == count) + return items; + + var finalItems = new T[count]; + Array.Copy(items, 0, finalItems, 0, count); + return finalItems; + } + } +} diff --git a/src/tests/Common/CoreCLRTestLibrary/Assertion.cs b/src/tests/Common/CoreCLRTestLibrary/Assertion.cs deleted file mode 100644 index f921ce2983436f..00000000000000 --- a/src/tests/Common/CoreCLRTestLibrary/Assertion.cs +++ /dev/null @@ -1,822 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// Note: Exception messages call ToString instead of Name to avoid MissingMetadataException when just outputting basic info - -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace TestLibrary -{ - /// - /// A collection of helper classes to test various conditions within - /// unit tests. If the condition being tested is not met, an exception - /// is thrown. - /// - public static class Assert - { - /// - /// Asserts that the given delegate throws an with the given parameter name. - /// - /// - /// The delagate of type to execute. - /// - /// - /// A containing additional information for when the assertion fails. - /// - /// - /// A containing the parameter of name to check, to skip parameter validation. - /// - /// - /// The thrown . - /// - /// - /// of type was not thrown. - /// - /// -or- - /// - /// is not equal to . - /// - public static ArgumentNullException ThrowsArgumentNullException(string parameterName, Action action, string message = null) - { - return ThrowsArgumentException(parameterName, action, message); - } - - /// - /// Asserts that the given delegate throws an with the given parameter name. - /// - /// - /// The delagate of type to execute. - /// - /// - /// A containing additional information for when the assertion fails. - /// - /// - /// A containing the parameter of name to check, to skip parameter validation. - /// - /// - /// The thrown . - /// - /// - /// of type was not thrown. - /// - /// -or- - /// - /// is not equal to . - /// - public static ArgumentException ThrowsArgumentException(string parameterName, Action action, string message = null) - { - return ThrowsArgumentException(parameterName, action, message); - } - - /// - /// Asserts that the given delegate throws an of type with the given parameter name. - /// - /// - /// The delagate of type to execute. - /// - /// - /// A containing additional information for when the assertion fails. - /// - /// - /// A containing the parameter of name to check, to skip parameter validation. - /// - /// - /// The thrown . - /// - /// - /// of type was not thrown. - /// - /// -or- - /// - /// is not equal to . - /// - public static T ThrowsArgumentException(string parameterName, Action action, string message = null) - where T : ArgumentException - { - T exception = Throws(action, message); - -#if DEBUG - // ParamName's not available on ret builds - if (parameterName != null) - Assert.AreEqual(parameterName, exception.ParamName, "Expected '{0}.ParamName' to be '{1}'. {2}", typeof(T), parameterName, message); -#endif - - return exception; - } - - /// - /// Asserts that the given delegate throws an with a base exception of type . - /// - /// - /// The delagate of type to execute. - /// - /// - /// A containing additional information for when the assertion fails. - /// - /// - /// The base of the . - /// - /// - /// of was not thrown. - /// -or- - /// - /// is not of type . - /// - public static TBase ThrowsAggregateException(Action action, string message = "") where TBase : Exception - { - AggregateException exception = Throws(action, message); - - Exception baseException = exception.GetBaseException(); - if (baseException == null) - Assert.Fail("Expected 'AggregateException.GetBaseException()' to be '{0}', however it is null. {1}", typeof(TBase), message); - - if (baseException.GetType() != typeof(TBase)) - Assert.Fail("Expected 'AggregateException.GetBaseException()', to be '{0}', however, '{1}' is. {2}", typeof(TBase), baseException.GetType(), message); - - return (TBase)baseException; - } - - /// - /// Asserts that the given delegate throws an of type . - /// - /// - /// The delagate of type to execute. - /// - /// - /// A containing format information for when the assertion fails. - /// - /// - /// An of arguments to be formatted. - /// - /// - /// The thrown . - /// - /// - /// of type was not thrown. - /// - public static T Throws(Action action, string format, params Object[] args) where T : Exception - { - return Throws(action, String.Format(format, args)); - } - - /// - /// Asserts that the given delegate throws an of type . - /// - /// - /// The delagate of type to execute. - /// - /// - /// A containing additional information for when the assertion fails. - /// - /// - /// Specifies whether should require an exact type match when comparing the expected exception type with the thrown exception. The default is . - /// - /// - /// The thrown . - /// - /// - /// of type was not thrown. - /// - public static T Throws(Action action, string message = "", AssertThrowsOptions options = AssertThrowsOptions.None) where T : Exception - { - Exception exception = RunWithCatch(action); - - if (exception == null) - Assert.Fail("Expected '{0}' to be thrown. {1}", typeof(T).ToString(), message); - - if (!IsOfExceptionType(exception, options)) - Assert.Fail("Expected '{0}' to be thrown, however '{1}' was thrown. {2}", typeof(T), exception.GetType(), message); - - return (T)exception; - } - - /// - /// Asserts that the given async delegate throws an of type - /// - /// The delagate of type to execute. - /// - /// - /// A containing additional information for when the assertion fails. - /// - /// - /// Specifies whether should require an exact type match when comparing the expected exception type with the thrown exception. The default is . - /// - /// - /// The thrown . - /// - /// - /// of type was not thrown. - /// - public static async Task ThrowsAsync(Func action, string message = "", AssertThrowsOptions options = AssertThrowsOptions.None) where T : Exception - { - Exception exception = await RunWithCatchAsync(action); - - if (exception == null) - Assert.Fail("Expected '{0}' to be thrown. {1}", typeof(T).ToString(), message); - - if (!IsOfExceptionType(exception, options)) - Assert.Fail("Expected '{0}' to be thrown, however '{1}' was thrown. {2}", typeof(T), exception.GetType(), message); - - return (T)exception; - } - - /// - /// Asserts that the given async delegate throws an of type and - /// returns an of type . - /// - /// - /// The delagate of type to execute. - /// - /// - /// A containing additional information for when the assertion fails. - /// - /// - /// Specifies whether should require an exact type match when comparing the expected exception type with the thrown exception. The default is . - /// - /// - /// The thrown inner . - /// - /// - /// of type was not thrown. - /// - /// -or- - /// - /// is not of type . - /// - public static TInner Throws(Action action, string message = "", AssertThrowsOptions options = AssertThrowsOptions.None) - where T : Exception - where TInner : Exception - { - T outerException = Throws(action, message, options); - - if (outerException.InnerException == null) - Assert.Fail("Expected '{0}.InnerException' to be '{1}', however it is null. {2}", typeof(T), typeof(TInner), message); - - if (!IsOfExceptionType(outerException.InnerException, options)) - Assert.Fail("Expected '{0}.InnerException', to be '{1}', however, '{2}' is. {3}", typeof(T), typeof(TInner), outerException.InnerException.GetType(), message); - - return (TInner)outerException.InnerException; - } - - - /// - /// Tests whether the specified condition is true and throws an exception - /// if the condition is false. - /// - /// The condition the test expects to be true. - /// - /// The message to include in the exception when - /// is false. The message is shown in test results. - /// - /// - /// Thrown if is false. - /// - public static void IsTrue(bool condition, string format, params Object[] args) - { - if (!condition) - { - Assert.HandleFail("Assert.IsTrue", String.Format(format, args)); - } - } - - /// - /// Tests whether the specified condition is true and throws an exception - /// if the condition is false. - /// - /// The condition the test expects to be true. - /// - /// The message to include in the exception when - /// is false. The message is shown in test results. - /// - /// - /// Thrown if is false. - /// - public static void IsTrue(bool condition, string message = "") - { - if (!condition) - { - Assert.HandleFail("Assert.IsTrue", message); - } - } - - /// - /// Tests whether the specified condition is false and throws an exception - /// if the condition is true. - /// - /// The condition the test expects to be false. - /// - /// The message to include in the exception when - /// is true. The message is shown in test results. - /// - /// - /// Thrown if is true. - /// - public static void IsFalse(bool condition, string message = "") - { - if (condition) - { - Assert.HandleFail("Assert.IsFalse", message); - } - } - - /// - /// Tests whether the specified condition is false and throws an exception - /// if the condition is true. - /// - /// The condition the test expects to be false. - /// - /// The message to include in the exception when - /// is true. The message is shown in test results. - /// - /// - /// Thrown if is true. - /// - public static void IsFalse(bool condition, string format, params Object[] args) - { - IsFalse(condition, String.Format(format, args)); - } - - /// - /// Tests whether the specified object is null and throws an exception - /// if it is not. - /// - /// The object the test expects to be null. - /// - /// The message to include in the exception when - /// is not null. The message is shown in test results. - /// - /// - /// Thrown if is not null. - /// - public static void IsNull(object value, string message = "") - { - if (value != null) - { - Assert.HandleFail("Assert.IsNull", message); - } - } - - /// - /// Tests whether the specified object is null and throws an exception - /// if it is not. - /// - /// The object the test expects to be null. - /// - /// The message to include in the exception when - /// is not null. The message is shown in test results. - /// - /// - /// Thrown if is not null. - /// - public static void IsNull(object value, string format, params Object[] args) - { - IsNull(value, String.Format(format, args)); - } - - /// - /// Tests whether the specified object is non-null and throws an exception - /// if it is null. - /// - /// The object the test expects not to be null. - /// - /// The message to include in the exception when - /// is null. The message is shown in test results. - /// - /// - /// Thrown if is null. - /// - public static void IsNotNull(object value, string message = "") - { - if (value == null) - { - Assert.HandleFail("Assert.IsNotNull", message); - } - } - - /// - /// Tests whether the expected object is equal to the actual object and - /// throws an exception if it is not. - /// - /// Expected object. - /// Actual object. - /// Message to display upon failure. - public static void AreEqual(T expected, T actual, string message = "") - { - const string EXPECTED_MSG = @"Expected: [{1}]. Actual: [{2}]. {0}"; - - if (!Object.Equals(expected, actual)) - { - string finalMessage = String.Format(EXPECTED_MSG, message, (object)expected ?? "NULL", (object)actual ?? "NULL"); - Assert.HandleFail("Assert.AreEqual", finalMessage); - } - } - - /// - /// Tests whether the expected object is equal to the actual object and - /// throws an exception if it is not. - /// - /// Expected object. - /// Actual object. - /// Message to display upon failure. - public static void AreEqual(T expected, T actual, string format, params Object[] args) - { - AreEqual(expected, actual, String.Format(format, args)); - } - - /// - /// Tests whether the expected object is equal to the actual object and - /// throws an exception if it is not. - /// - /// Expected object that we do not want it to be. - /// Actual object. - /// Message to display upon failure. - public static void AreNotEqual(T notExpected, T actual, string message = "") - { - if (Object.Equals(notExpected, actual)) - { - String finalMessage = - String.Format(@"Expected any value except:[{1}]. Actual:[{2}]. {0}", - message, notExpected, actual); - - Assert.HandleFail("Assert.AreNotEqual", finalMessage); - } - } - - /// - /// Tests whether the expected object is equal to the actual object and - /// throws an exception if it is not. - /// - /// Expected object that we do not want it to be. - /// Actual object. - /// Message to display upon failure. - public static void AreNotEqual(T notExpected, T actual, string format, params Object[] args) - { - AreNotEqual(notExpected, actual, String.Format(format, args)); - } - - /// - /// Tests whether the two lists are the same length and contain the same objects (using Object.Equals()) in the same order and - /// throws an exception if it is not. - /// - /// Expected list. - /// Actual list. - /// Message to display upon failure. - public static void AreAllEqual(T[] expected, T[] actual, string message = "") - { - Assert.AreEqual(expected.Length, actual.Length, message); - - for (int i = 0; i < expected.Length; i++) - Assert.AreEqual(expected[i], actual[i], message); - } - - /// - /// Tests whether the two lists are the same length and contain the same objects (using Object.Equals()) in the same order and - /// throws an exception if it is not. - /// - /// Expected list. - /// Actual list. - /// Message to display upon failure. - public static void AreAllEqual(T[] expected, T[] actual, string format, params Object[] args) - { - AreAllEqual(expected, actual, String.Format(format, args)); - } - - /// - /// Tests whether the two lists are the same length and contain the same objects (using Object.Equals()) (but not necessarily in the same order) and - /// throws an exception if it is not. - /// - /// Expected list. - /// Actual list. - /// Message to display upon failure. - public static void AreAllEqualUnordered(T[] expected, T[] actual) - { - Assert.AreEqual(expected.Length, actual.Length); - - int count = expected.Length; - bool[] removedFromActual = new bool[count]; - for (int i = 0; i < count; i++) - { - T item1 = expected[i]; - bool foundMatch = false; - for (int j = 0; j < count; j++) - { - if (!removedFromActual[j]) - { - T item2 = actual[j]; - if ((item1 == null && item2 == null) || (item1 != null && item1.Equals(item2))) - { - foundMatch = true; - removedFromActual[j] = true; - break; - } - } - } - if (!foundMatch) - Assert.HandleFail("Assert.AreAllEqualUnordered", "First array has element not found in second array: " + item1); - } - return; - } - - /// - /// Tests whether the two enumerables are the same length and contain the same objects (using Object.Equals()) in the same order and - /// throws an exception if it is not. - /// - /// Expected enumerables. - /// Actual enumerables. - /// Message to display upon failure. - public static void AreAllEqual(IEnumerable expected, IEnumerable actual, string message = "") - { - AreAllEqual(CopyToArray(expected), CopyToArray(actual), message); - } - - /// - /// Tests whether the two enumerables are the same length and contain the same objects (using Object.Equals()) (but not necessarily - /// in the same order) and throws an exception if it is not. - /// - /// Expected enumerable. - /// Actual enumerable. - /// Message to display upon failure. - public static void AreAllEqualUnordered(IEnumerable expected, IEnumerable actual, string message = "") - { - AreAllEqualUnordered(CopyToArray(expected), CopyToArray(actual), message); - } - - /// - /// Iterates through an IEnumerable to generate an array of elements. The rational for using this instead of - /// System.Linq.ToArray is that this will not require a dependency on System.Linq.dll - /// - private static T[] CopyToArray(IEnumerable source) - { - T[] items = new T[4]; - int count = 0; - - if (source == null) - return null; - - foreach (var item in source) - { - if (items.Length == count) - { - var newItems = new T[checked(count * 2)]; - Array.Copy(items, 0, newItems, 0, count); - items = newItems; - } - - items[count] = item; - count++; - } - - if (items.Length == count) - return items; - - var finalItems = new T[count]; - Array.Copy(items, 0, finalItems, 0, count); - return finalItems; - } - - - /// - /// Tests whether the specified objects both refer to the same object and - /// throws an exception if the two inputs do not refer to the same object. - /// - /// - /// The first object to compare. This is the value the test expects. - /// - /// - /// The second object to compare. This is the value produced by the code under test. - /// - /// - /// Thrown if does not refer to the same object - /// as . - /// - static public void AreSame(object expected, object actual) - { - Assert.AreSame(expected, actual, string.Empty); - } - - /// - /// Tests whether the specified objects both refer to the same object and - /// throws an exception if the two inputs do not refer to the same object. - /// - /// - /// The first object to compare. This is the value the test expects. - /// - /// - /// The second object to compare. This is the value produced by the code under test. - /// - /// - /// The message to include in the exception when - /// is not the same as . The message is shown - /// in test results. - /// - /// - /// Thrown if does not refer to the same object - /// as . - /// - static public void AreSame(object expected, object actual, string message) - { - if (!Object.ReferenceEquals(expected, actual)) - { - string finalMessage = message; - - ValueType valExpected = expected as ValueType; - if (valExpected != null) - { - ValueType valActual = actual as ValueType; - if (valActual != null) - { - finalMessage = message == null ? String.Empty : message; - } - } - - Assert.HandleFail("Assert.AreSame", finalMessage); - } - } - - /// - /// Tests whether the specified objects refer to different objects and - /// throws an exception if the two inputs refer to the same object. - /// - /// - /// The first object to compare. This is the value the test expects not - /// to match . - /// - /// - /// The second object to compare. This is the value produced by the code under test. - /// - /// - /// Thrown if refers to the same object - /// as . - /// - static public void AreNotSame(object notExpected, object actual) - { - Assert.AreNotSame(notExpected, actual, string.Empty); - } - - /// - /// Tests whether the specified objects refer to different objects and - /// throws an exception if the two inputs refer to the same object. - /// - /// - /// The first object to compare. This is the value the test expects not - /// to match . - /// - /// - /// The second object to compare. This is the value produced by the code under test. - /// - /// - /// The message to include in the exception when - /// is the same as . The message is shown in - /// test results. - /// - /// - /// Thrown if refers to the same object - /// as . - /// - static public void AreNotSame(object notExpected, object actual, string message) - { - if (Object.ReferenceEquals(notExpected, actual)) - { - Assert.HandleFail("Assert.AreNotSame", message); - } - } - - static public void OfType(object obj) - { - if (!(obj is T)) - { - Assert.HandleFail( - "Assert.IsOfType", - $"Expected an object of type [{typeof(T).AssemblyQualifiedName}], got type of type [{obj.GetType().AssemblyQualifiedName}]."); - } - } - - /// - /// Throws an AssertFailedException. - /// - /// - /// Always thrown. - /// - public static void Fail() - { - Assert.HandleFail("Assert.Fail", ""); - } - - /// - /// Throws an AssertFailedException. - /// - /// - /// The message to include in the exception. The message is shown in - /// test results. - /// - /// - /// Always thrown. - /// - public static void Fail(string message, params object[] args) - { - string exceptionMessage = args.Length == 0 ? message : string.Format(message, args); - Assert.HandleFail("Assert.Fail", exceptionMessage); - } - - /// - /// Helper function that creates and throws an exception. - /// - /// name of the assertion throwing an exception. - /// message describing conditions for assertion failure. - /// The parameters. - /// TODO: Modify HandleFail to take in parameters - internal static void HandleFail(string assertionName, string message) - { - // change this to use AssertFailedException - throw new AssertTestException(assertionName + ": " + message); - } - - - [Obsolete("Did you mean to call Assert.AreEqual()")] - public static new bool Equals(Object o1, Object o2) - { - Assert.Fail("Don\u2019t call this."); - throw new Exception(); - } - - private static bool IsOfExceptionType(Exception thrown, AssertThrowsOptions options) - { - if ((options & AssertThrowsOptions.AllowDerived) == AssertThrowsOptions.AllowDerived) - return thrown is T; - - return thrown.GetType() == typeof(T); - } - - private static Exception RunWithCatch(Action action) - { - try - { - action(); - return null; - } - catch (Exception ex) - { - return ex; - } - } - - private static async Task RunWithCatchAsync(Func action) - { - try - { - await action(); - return null; - } - catch (Exception ex) - { - return ex; - } - } - } - - /// - /// Exception raised by the Assert on Fail - /// - public class AssertTestException : Exception - { - public AssertTestException(string message) - : base(message) - { - } - - public AssertTestException() - : base() - { - } - } - - public static class ExceptionAssert - { - public static void Throws(String message, Action a) where T : Exception - { - Assert.Throws(a, message); - } - } - - /// - /// Specifies whether should require an exact type match when comparing the expected exception type with the thrown exception. - /// - [Flags] - public enum AssertThrowsOptions - { - /// - /// Specifies that should require an exact type - /// match when comparing the specified exception type with the throw exception. - /// - None = 0, - - /// - /// Specifies that should not require an exact type - /// match when comparing the specified exception type with the thrown exception. - /// - AllowDerived = 1, - } -} diff --git a/src/tests/Common/CoreCLRTestLibrary/CoreCLRTestLibrary.csproj b/src/tests/Common/CoreCLRTestLibrary/CoreCLRTestLibrary.csproj index bcf8a159d45b13..61ea72fa3ba176 100644 --- a/src/tests/Common/CoreCLRTestLibrary/CoreCLRTestLibrary.csproj +++ b/src/tests/Common/CoreCLRTestLibrary/CoreCLRTestLibrary.csproj @@ -8,13 +8,21 @@ $(NetCoreAppToolCurrent) - + + + + + + + + + diff --git a/src/tests/Common/CoreCLRTestLibrary/CoreClrConfigurationDetection.cs b/src/tests/Common/CoreCLRTestLibrary/CoreClrConfigurationDetection.cs new file mode 100644 index 00000000000000..3fb8adccf02233 --- /dev/null +++ b/src/tests/Common/CoreCLRTestLibrary/CoreClrConfigurationDetection.cs @@ -0,0 +1,57 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// + +using System; +using System.Globalization; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security; +using System.Text; + +namespace TestLibrary; + +public static class CoreClrConfigurationDetection +{ + public static bool IsJitStress => !string.Equals(GetEnvironmentVariableValue("JitStress"), "0", StringComparison.InvariantCulture); + public static bool IsJitStressRegs => !string.Equals(GetEnvironmentVariableValue("JitStressRegs"), "0", StringComparison.InvariantCulture); + public static bool IsJitMinOpts => string.Equals(GetEnvironmentVariableValue("JITMinOpts"), "1", StringComparison.InvariantCulture); + public static bool IsTailCallStress => string.Equals(GetEnvironmentVariableValue("TailcallStress"), "1", StringComparison.InvariantCulture); + public static bool IsZapDisable => string.Equals(GetEnvironmentVariableValue("ZapDisable"), "1", StringComparison.InvariantCulture); + public static bool IsGCStress3 => CompareGCStressModeAsLower(GetEnvironmentVariableValue("GCStress"), "0x3", "3"); + public static bool IsGCStressC => CompareGCStressModeAsLower(GetEnvironmentVariableValue("GCStress"), "0xC", "C"); + + public static bool IsGCStress => GetEnvironmentVariableValue("GCStress") != string.Empty; + + public static bool IsCheckedRuntime => AssemblyConfigurationEquals("Checked"); + public static bool IsReleaseRuntime => AssemblyConfigurationEquals("Release"); + public static bool IsDebugRuntime => AssemblyConfigurationEquals("Debug"); + + public static bool IsStressTest => + IsGCStress || + IsZapDisable || + IsTailCallStress || + IsJitStressRegs || + IsJitStress || + IsJitMinOpts; + + private static string GetEnvironmentVariableValue(string name) => + Environment.GetEnvironmentVariable("DOTNET_" + name) ?? Environment.GetEnvironmentVariable("COMPlus_" + name) ?? "0"; + + private static bool AssemblyConfigurationEquals(string configuration) + { + AssemblyConfigurationAttribute assemblyConfigurationAttribute = typeof(string).Assembly.GetCustomAttribute(); + + return assemblyConfigurationAttribute != null && + string.Equals(assemblyConfigurationAttribute.Configuration, configuration, StringComparison.InvariantCulture); + } + + private static bool CompareGCStressModeAsLower(string value, string first, string second) + { + value = value.ToLowerInvariant(); + return string.Equals(value, first.ToLowerInvariant(), StringComparison.InvariantCulture) || + string.Equals(value, second.ToLowerInvariant(), StringComparison.InvariantCulture) || + string.Equals(value, "0xf", StringComparison.InvariantCulture) || + string.Equals(value, "f", StringComparison.InvariantCulture); + } +} diff --git a/src/tests/Common/CoreCLRTestLibrary/OutOfProcessTest.cs b/src/tests/Common/CoreCLRTestLibrary/OutOfProcessTest.cs new file mode 100644 index 00000000000000..e96378339b8b7b --- /dev/null +++ b/src/tests/Common/CoreCLRTestLibrary/OutOfProcessTest.cs @@ -0,0 +1,132 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using CoreclrTestLib; +using Xunit; + +namespace TestLibrary +{ + public static class OutOfProcessTest + { + internal static bool runningInWindows; + internal static string reportBase; + internal static string testBinaryBase; + internal static string helixUploadRoot; + + static OutOfProcessTest() + { + reportBase = Directory.GetCurrentDirectory(); + testBinaryBase = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!; + helixUploadRoot = Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT"); + if (!String.IsNullOrEmpty(helixUploadRoot)) + { + reportBase = Path.Combine(Path.GetFullPath(helixUploadRoot), "Reports"); + } + + if (String.IsNullOrEmpty(reportBase)) + { + reportBase = Path.Combine(testBinaryBase, "Reports"); + } + else + { + reportBase = Path.GetFullPath(reportBase); + } + } + + public static void RunOutOfProcessTest(string basePath, string assemblyPath) + { + int ret = -100; + string outputFile = System.IO.Path.GetFullPath(reportBase + assemblyPath + "output.txt"); + string errorFile = System.IO.Path.GetFullPath(reportBase + assemblyPath + "error.txt"); + string outputDir = System.IO.Path.GetDirectoryName(outputFile)!; + string testExecutable = null; + Exception infraEx = null; + + try + { + CoreclrTestWrapperLib wrapper = new CoreclrTestWrapperLib(); + + if (OperatingSystem.IsWindows()) + { + testExecutable = Path.Combine(basePath, Path.ChangeExtension(assemblyPath, ".cmd")); + } + else + { + testExecutable = Path.Combine(basePath, Path.ChangeExtension(assemblyPath.Replace("\\", "/"), ".sh")); + } + + System.IO.Directory.CreateDirectory(reportBase + Path.GetDirectoryName(assemblyPath)); + + ret = wrapper.RunTest(testExecutable, outputFile, errorFile, Assembly.GetEntryAssembly()!.FullName!, testBinaryBase, outputDir); + } + catch (Exception ex) + { + infraEx = ex; + } + + if (infraEx != null) + { + Assert.True(false, "Test Infrastructure Failure: " + infraEx.ToString()); + } + else + { + List testOutput = new List(); + + try + { + testOutput.AddRange(System.IO.File.ReadAllLines(errorFile)); + } + catch (Exception ex) + { + testOutput.Add("Unable to read error file: " + errorFile); + testOutput.Add(ex.ToString()); + } + + testOutput.Add(string.Empty); + testOutput.Add("Return code: " + ret); + testOutput.Add("Raw output file: " + outputFile); + testOutput.Add("Raw output:"); + + try + { + testOutput.AddRange(System.IO.File.ReadAllLines(outputFile)); + } + catch (Exception ex) + { + testOutput.Add("Unable to read output file: " + outputFile); + testOutput.Add(ex.ToString()); + } + + testOutput.Add("To run the test:"); + testOutput.Add("Set up CORE_ROOT and run."); + testOutput.Add("> " + testExecutable); + + var unicodeControlCharsRegex = new Regex("%5C%5Cp{C}+"); + + // Remove all characters that have no visual or spatial representation. + for (int i = 0; i < testOutput.Count; i++) + { + string line = testOutput[i]; + line = unicodeControlCharsRegex.Replace(line, string.Empty); + testOutput[i] = line; + } + + foreach (string line in testOutput) + { + Console.WriteLine(line); + } + + Assert.True(ret == CoreclrTestWrapperLib.EXIT_SUCCESS_CODE, string.Join(Environment.NewLine, testOutput)); + } + } + } +} diff --git a/src/tests/Common/CoreCLRTestLibrary/Utilities.cs b/src/tests/Common/CoreCLRTestLibrary/Utilities.cs index bd1eb1be37de73..a7917eb640a84d 100644 --- a/src/tests/Common/CoreCLRTestLibrary/Utilities.cs +++ b/src/tests/Common/CoreCLRTestLibrary/Utilities.cs @@ -13,6 +13,7 @@ using System.Security; using System.Text; using System.Threading; +using Xunit; namespace TestLibrary { @@ -205,7 +206,7 @@ internal static uint GetWindowsVersion() return 0; } - Assert.AreEqual(0, Ntdll.RtlGetVersionEx(out Ntdll.RTL_OSVERSIONINFOEX osvi)); + Assert.Equal(0, Ntdll.RtlGetVersionEx(out Ntdll.RTL_OSVERSIONINFOEX osvi)); return osvi.dwMajorVersion; } internal static uint GetWindowsMinorVersion() @@ -215,7 +216,7 @@ internal static uint GetWindowsMinorVersion() return 0; } - Assert.AreEqual(0, Ntdll.RtlGetVersionEx(out Ntdll.RTL_OSVERSIONINFOEX osvi)); + Assert.Equal(0, Ntdll.RtlGetVersionEx(out Ntdll.RTL_OSVERSIONINFOEX osvi)); return osvi.dwMinorVersion; } internal static uint GetWindowsBuildNumber() @@ -225,7 +226,7 @@ internal static uint GetWindowsBuildNumber() return 0; } - Assert.AreEqual(0, Ntdll.RtlGetVersionEx(out Ntdll.RTL_OSVERSIONINFOEX osvi)); + Assert.Equal(0, Ntdll.RtlGetVersionEx(out Ntdll.RTL_OSVERSIONINFOEX osvi)); return osvi.dwBuildNumber; } diff --git a/src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs b/src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs index da13ad2492e676..91e7f8c461c196 100644 --- a/src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs +++ b/src/tests/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // +#nullable disable using System; using System.Collections.Generic; @@ -196,7 +197,7 @@ public class CoreclrTestWrapperLib { public const int EXIT_SUCCESS_CODE = 0; public const string TIMEOUT_ENVIRONMENT_VAR = "__TestTimeout"; - + // Default timeout set to 10 minutes public const int DEFAULT_TIMEOUT_MS = 1000 * 60 * 10; @@ -289,7 +290,7 @@ public int RunTest(string executable, string outputFile, string errorFile, strin Debug.Assert(outputFile != errorFile); int exitCode = -100; - + // If a timeout was given to us by an environment variable, use it instead of the default // timeout. string environmentVar = Environment.GetEnvironmentVariable(TIMEOUT_ENVIRONMENT_VAR); @@ -387,7 +388,5 @@ public int RunTest(string executable, string outputFile, string errorFile, strin return exitCode; } - - } } diff --git a/src/tests/Common/Directory.Build.props b/src/tests/Common/Directory.Build.props index 99bbac2cdaa729..965600c743fdaf 100644 --- a/src/tests/Common/Directory.Build.props +++ b/src/tests/Common/Directory.Build.props @@ -1,4 +1,8 @@ + + true + + diff --git a/src/tests/Common/Directory.Build.targets b/src/tests/Common/Directory.Build.targets index 009a19e92c7753..e003e2dc6ec860 100644 --- a/src/tests/Common/Directory.Build.targets +++ b/src/tests/Common/Directory.Build.targets @@ -155,7 +155,7 @@ TargetDir="wasm-test-runner/"/> + + + Exe + net6.0 + enable + enable + true + + + + + + + + + + + + + diff --git a/src/tests/Common/Platform/platformdefines.h b/src/tests/Common/Platform/platformdefines.h index 35781efa84432f..c8dd750add3009 100644 --- a/src/tests/Common/Platform/platformdefines.h +++ b/src/tests/Common/Platform/platformdefines.h @@ -8,6 +8,7 @@ #include #include #include +#include #ifndef _PLATFORMDEFINES__H #define _PLATFORMDEFINES__H @@ -91,8 +92,6 @@ typedef unsigned int ULONG, *PULONG; #define UInt32x32To64(a, b) ((unsigned __int64)((ULONG)(a)) * (unsigned __int64)((ULONG)(b))) -#define ARRAYSIZE(x) (sizeof(x)/sizeof(*x)) - #ifndef TRUE #define TRUE 1 #endif @@ -270,5 +269,11 @@ inline void CoreClrFree(void *p) #define strcpy_s TP_strcpy_s #endif +#if defined(TARGET_XARCH) && !defined(_MSC_VER) +#define ENABLE_AVX __attribute__ ((target("avx"))) +#else +#define ENABLE_AVX +#endif + #endif diff --git a/src/tests/Common/XUnitWrapperGenerator/ITestInfo.cs b/src/tests/Common/XUnitWrapperGenerator/ITestInfo.cs new file mode 100644 index 00000000000000..633f534e72efdb --- /dev/null +++ b/src/tests/Common/XUnitWrapperGenerator/ITestInfo.cs @@ -0,0 +1,309 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.IO; +using System.Text; +using Microsoft.CodeAnalysis; + +namespace XUnitWrapperGenerator; + +interface ITestInfo +{ + string TestNameExpression { get; } + string DisplayNameForFiltering { get; } + string Method { get; } + string ContainingType { get; } + + string GenerateTestExecution(ITestReporterWrapper testReporterWrapper); +} + +interface ITestReporterWrapper +{ + string WrapTestExecutionWithReporting(string testExecution, ITestInfo test); + + string GenerateSkippedTestReporting(ITestInfo skippedTest); +} + +sealed class BasicTestMethod : ITestInfo +{ + public BasicTestMethod(IMethodSymbol method, string externAlias, ImmutableArray arguments = default, string? displayNameExpression = null) + { + var args = arguments.IsDefaultOrEmpty ? "" : string.Join(", ", arguments); + ContainingType = method.ContainingType.ToDisplayString(XUnitWrapperGenerator.FullyQualifiedWithoutGlobalNamespace); + Method = method.Name; + DisplayNameForFiltering = $"{ContainingType}.{Method}({args})"; + TestNameExpression = displayNameExpression ?? $"\"{externAlias}::{ContainingType}.{Method}({args})\""; + if (method.IsStatic) + { + ExecutionStatement = $"{externAlias}::{ContainingType}.{Method}({args});"; + } + else + { + ExecutionStatement = $"using ({externAlias}::{ContainingType} obj = new()) obj.{Method}({args});"; + } + } + + public string TestNameExpression { get; } + public string DisplayNameForFiltering { get; } + public string Method { get; } + public string ContainingType { get; } + private string ExecutionStatement { get; } + + public string GenerateTestExecution(ITestReporterWrapper testReporterWrapper) + { + return testReporterWrapper.WrapTestExecutionWithReporting(ExecutionStatement, this); + } + + public override bool Equals(object obj) + { + return obj is BasicTestMethod other + && TestNameExpression == other.TestNameExpression + && Method == other.Method + && ContainingType == other.ContainingType + && ExecutionStatement == other.ExecutionStatement; + } +} +sealed class LegacyStandaloneEntryPointTestMethod : ITestInfo +{ + public LegacyStandaloneEntryPointTestMethod(IMethodSymbol method, string externAlias) + { + ContainingType = method.ContainingType.ToDisplayString(XUnitWrapperGenerator.FullyQualifiedWithoutGlobalNamespace); + Method = method.Name; + TestNameExpression = $"\"{externAlias}::{ContainingType}.{Method}()\""; + DisplayNameForFiltering = $"{ContainingType}.{Method}()"; + ExecutionStatement = $"Xunit.Assert.Equal(100, {externAlias}::{ContainingType}.{Method}());"; + } + + public string TestNameExpression { get; } + public string DisplayNameForFiltering { get; } + + public string Method { get; } + public string ContainingType { get; } + private string ExecutionStatement { get; } + + public string GenerateTestExecution(ITestReporterWrapper testReporterWrapper) + { + return testReporterWrapper.WrapTestExecutionWithReporting(ExecutionStatement, this); + } + + public override bool Equals(object obj) + { + return obj is LegacyStandaloneEntryPointTestMethod other + && TestNameExpression == other.TestNameExpression + && Method == other.Method + && ContainingType == other.ContainingType; ; + } +} + +sealed class ConditionalTest : ITestInfo +{ + private ITestInfo _innerTest; + private string _condition; + public ConditionalTest(ITestInfo innerTest, string condition) + { + _innerTest = innerTest; + _condition = condition; + TestNameExpression = innerTest.TestNameExpression; + DisplayNameForFiltering = innerTest.DisplayNameForFiltering; + Method = innerTest.Method; + ContainingType = innerTest.ContainingType; + } + + public ConditionalTest(ITestInfo innerTest, Xunit.TestPlatforms platform) + : this(innerTest, GetPlatformConditionFromTestPlatform(platform)) + { + } + + public string TestNameExpression { get; } + + public string DisplayNameForFiltering { get; } + + public string Method { get; } + public string ContainingType { get; } + + public string GenerateTestExecution(ITestReporterWrapper testReporterWrapper) + { + return $"if ({_condition}) {{ {_innerTest.GenerateTestExecution(testReporterWrapper)} }} else {{ {testReporterWrapper.GenerateSkippedTestReporting(_innerTest)} }}"; + } + + public override bool Equals(object obj) + { + return obj is ConditionalTest other + && TestNameExpression == other.TestNameExpression + && Method == other.Method + && ContainingType == other.ContainingType + && _condition == other._condition + && _innerTest.Equals(other._innerTest); + } + + private static string GetPlatformConditionFromTestPlatform(Xunit.TestPlatforms platform) + { + List platformCheckConditions = new(); + if (platform.HasFlag(Xunit.TestPlatforms.Windows)) + { + platformCheckConditions.Add("global::System.OperatingSystem.IsWindows()"); + } + if (platform.HasFlag(Xunit.TestPlatforms.Linux)) + { + platformCheckConditions.Add("global::System.OperatingSystem.IsLinux()"); + } + if (platform.HasFlag(Xunit.TestPlatforms.OSX)) + { + platformCheckConditions.Add("global::System.OperatingSystem.IsMacOS()"); + } + if (platform.HasFlag(Xunit.TestPlatforms.illumos)) + { + platformCheckConditions.Add(@"global::System.OperatingSystem.IsOSPlatform(""illumos"")"); + } + if (platform.HasFlag(Xunit.TestPlatforms.Solaris)) + { + platformCheckConditions.Add(@"global::System.OperatingSystem.IsOSPlatform(""Solaris"")"); + } + if (platform.HasFlag(Xunit.TestPlatforms.Android)) + { + platformCheckConditions.Add("global::System.OperatingSystem.IsAndroid()"); + } + if (platform.HasFlag(Xunit.TestPlatforms.iOS)) + { + platformCheckConditions.Add("(global::System.OperatingSystem.IsIOS() && !global::System.OperatingSystem.IsMacCatalyst())"); + } + if (platform.HasFlag(Xunit.TestPlatforms.tvOS)) + { + platformCheckConditions.Add("global::System.OperatingSystem.IsTvOS()"); + } + if (platform.HasFlag(Xunit.TestPlatforms.MacCatalyst)) + { + platformCheckConditions.Add("global::System.OperatingSystem.IsMacCatalyst()"); + } + if (platform.HasFlag(Xunit.TestPlatforms.Browser)) + { + platformCheckConditions.Add("global::System.OperatingSystem.IsBrowser()"); + } + if (platform.HasFlag(Xunit.TestPlatforms.FreeBSD)) + { + platformCheckConditions.Add(@"global::System.OperatingSystem.IsFreeBSD()"); + } + if (platform.HasFlag(Xunit.TestPlatforms.NetBSD)) + { + platformCheckConditions.Add(@"global::System.OperatingSystem.IsOSPlatform(""NetBSD"")"); + } + return string.Join(" || ", platformCheckConditions); + } +} + +sealed class MemberDataTest : ITestInfo +{ + private ITestInfo _innerTest; + private string _memberInvocation; + private string _loopVarIdentifier; + public MemberDataTest(ISymbol referencedMember, ITestInfo innerTest, string externAlias, string argumentLoopVarIdentifier) + { + TestNameExpression = innerTest.TestNameExpression; + Method = innerTest.Method; + ContainingType = innerTest.ContainingType; + DisplayNameForFiltering = $"{ContainingType}.{Method}(...)"; + _innerTest = innerTest; + _loopVarIdentifier = argumentLoopVarIdentifier; + + string containingType = referencedMember.ContainingType.ToDisplayString(XUnitWrapperGenerator.FullyQualifiedWithoutGlobalNamespace); + _memberInvocation = referencedMember switch + { + IPropertySymbol { IsStatic: true } => $"{externAlias}::{containingType}.{referencedMember.Name}", + IMethodSymbol { IsStatic: true, Parameters: { Length: 0 } } => $"{externAlias}::{containingType}.{referencedMember.Name}()", + _ => throw new ArgumentException() + }; + } + + public string TestNameExpression { get; } + public string DisplayNameForFiltering { get; } + public string Method { get; } + public string ContainingType { get; } + + public string GenerateTestExecution(ITestReporterWrapper testReporterWrapper) + { + return $@" +foreach (object[] {_loopVarIdentifier} in {_memberInvocation}) +{{ + {_innerTest.GenerateTestExecution(testReporterWrapper)} +}} +"; + } + + public override bool Equals(object obj) + { + return obj is MemberDataTest other + && TestNameExpression == other.TestNameExpression + && Method == other.Method + && ContainingType == other.ContainingType + && _innerTest.Equals(other._innerTest); + } +} + +sealed class OutOfProcessTest : ITestInfo +{ + public OutOfProcessTest(string displayName, string relativeAssemblyPath) + { + Method = displayName; + DisplayNameForFiltering = displayName; + TestNameExpression = $"@\"{displayName}\""; + ExecutionStatement = $@"TestLibrary.OutOfProcessTest.RunOutOfProcessTest(typeof(Program).Assembly.Location, @""{relativeAssemblyPath}"");"; + } + + public string TestNameExpression { get; } + + public string DisplayNameForFiltering { get; } + + public string Method { get; } + + public string ContainingType => "OutOfProcessTest"; + + private string ExecutionStatement { get; } + + public string GenerateTestExecution(ITestReporterWrapper testReporterWrapper) => testReporterWrapper.WrapTestExecutionWithReporting(ExecutionStatement, this); +} + +sealed class NoTestReporting : ITestReporterWrapper +{ + public string WrapTestExecutionWithReporting(string testExecution, ITestInfo test) => testExecution; + + public string GenerateSkippedTestReporting(ITestInfo skippedTest) => string.Empty; +} + +sealed class WrapperLibraryTestSummaryReporting : ITestReporterWrapper +{ + private string _summaryLocalIdentifier; + private readonly string _filterLocalIdentifier; + + public WrapperLibraryTestSummaryReporting(string summaryLocalIdentifier, string filterLocalIdentifier) + { + _summaryLocalIdentifier = summaryLocalIdentifier; + _filterLocalIdentifier = filterLocalIdentifier; + } + + public string WrapTestExecutionWithReporting(string testExecutionExpression, ITestInfo test) + { + StringBuilder builder = new(); + builder.AppendLine($"if ({_filterLocalIdentifier} is null || {_filterLocalIdentifier}.ShouldRunTest(@\"{test.ContainingType}.{test.Method}\", {test.TestNameExpression}))"); + builder.AppendLine("{"); + + builder.AppendLine($"TimeSpan testStart = stopwatch.Elapsed;"); + builder.AppendLine("try {"); + builder.AppendLine(testExecutionExpression); + builder.AppendLine($"{_summaryLocalIdentifier}.ReportPassedTest({test.TestNameExpression}, \"{test.ContainingType}\", @\"{test.Method}\", stopwatch.Elapsed - testStart);"); + builder.AppendLine("}"); + builder.AppendLine("catch (System.Exception ex) {"); + builder.AppendLine($"{_summaryLocalIdentifier}.ReportFailedTest({test.TestNameExpression}, \"{test.ContainingType}\", @\"{test.Method}\", stopwatch.Elapsed - testStart, ex);"); + builder.AppendLine("}"); + + builder.AppendLine("}"); + return builder.ToString(); + } + + public string GenerateSkippedTestReporting(ITestInfo skippedTest) + { + return $"{_summaryLocalIdentifier}.ReportSkippedTest({skippedTest.TestNameExpression}, \"{skippedTest.ContainingType}\", \"{skippedTest.Method}\", TimeSpan.Zero, string.Empty);"; + } +} diff --git a/src/tests/Common/XUnitWrapperGenerator/ImmutableDictionaryValueComparer.cs b/src/tests/Common/XUnitWrapperGenerator/ImmutableDictionaryValueComparer.cs new file mode 100644 index 00000000000000..ec69869e08044a --- /dev/null +++ b/src/tests/Common/XUnitWrapperGenerator/ImmutableDictionaryValueComparer.cs @@ -0,0 +1,39 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Text; + +namespace XUnitWrapperGenerator; + +internal class ImmutableDictionaryValueComparer : IEqualityComparer> + where TKey : notnull +{ + private readonly IEqualityComparer _valueComparer; + + public ImmutableDictionaryValueComparer(IEqualityComparer valueComparer) + { + _valueComparer = valueComparer; + } + + public bool Equals(ImmutableDictionary x, ImmutableDictionary y) + { + if (x.Count != y.Count) + { + return false; + } + + foreach (var pair in x) + { + if (!y.TryGetValue(pair.Key, out TValue? value) || !_valueComparer.Equals(value, pair.Value)) + { + return false; + } + } + return true; + } + + public int GetHashCode(ImmutableDictionary obj) => throw new NotImplementedException(); +} diff --git a/src/tests/Common/XUnitWrapperGenerator/OptionsHelper.cs b/src/tests/Common/XUnitWrapperGenerator/OptionsHelper.cs new file mode 100644 index 00000000000000..39a766bd03f4b4 --- /dev/null +++ b/src/tests/Common/XUnitWrapperGenerator/OptionsHelper.cs @@ -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. +using Microsoft.CodeAnalysis.Diagnostics; + +namespace XUnitWrapperGenerator; + +public static class OptionsHelper +{ + private const string IsMergedTestRunnerAssemblyOption = "build_property.IsMergedTestRunnerAssembly"; + private const string PriorityOption = "build_property.Priority"; + private const string RuntimeFlavorOption = "build_property.RuntimeFlavor"; + private const string IsOutOfProcessTestAssemblyOption = "build_metadata.AdditionalFiles.IsOutOfProcessTestAssembly"; + private const string TestFilterOption = "build_metadata.AdditionalFiles.TestFilter"; + private const string TestAssemblyRelativePathOption = "build_metadata.AdditionalFiles.TestAssemblyRelativePath"; + private const string TestDisplayNameOption = "build_metadata.AdditionalFiles.TestDisplayName"; + + private static bool GetBoolOption(this AnalyzerConfigOptions options, string key) + { + return options.TryGetValue(key, out string? value) + && bool.TryParse(value, out bool result) + && result; + } + + private static int? GetIntOption(this AnalyzerConfigOptions options, string key) + { + return options.TryGetValue(key, out string? value) + && int.TryParse(value, out int result) + ? result : 0; + } + + internal static bool IsMergedTestRunnerAssembly(this AnalyzerConfigOptions options) => options.GetBoolOption(IsMergedTestRunnerAssemblyOption); + + internal static int? Priority(this AnalyzerConfigOptions options) => options.GetIntOption(PriorityOption); + + internal static string RuntimeFlavor(this AnalyzerConfigOptions options) => options.TryGetValue(RuntimeFlavorOption, out string? flavor) ? flavor : "CoreCLR"; + + internal static bool IsOutOfProcessTestAssembly(this AnalyzerConfigOptions options) => options.GetBoolOption(IsOutOfProcessTestAssemblyOption); + + internal static string? TestFilter(this AnalyzerConfigOptions options) => options.TryGetValue(TestFilterOption, out string? filter) ? filter : null; + + internal static string? TestAssemblyRelativePath(this AnalyzerConfigOptions options) => options.TryGetValue(TestAssemblyRelativePathOption, out string? flavor) ? flavor : null; + + internal static string? TestDisplayName(this AnalyzerConfigOptions options) => options.TryGetValue(TestDisplayNameOption, out string? flavor) ? flavor : null; +} diff --git a/src/tests/Common/XUnitWrapperGenerator/RuntimeConfiguration.cs b/src/tests/Common/XUnitWrapperGenerator/RuntimeConfiguration.cs new file mode 100644 index 00000000000000..74f3da88fa416d --- /dev/null +++ b/src/tests/Common/XUnitWrapperGenerator/RuntimeConfiguration.cs @@ -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. + +using System; + +namespace Xunit +{ + [Flags] + public enum RuntimeConfiguration + { + Any = ~0, + Checked = 1, + Debug = 1 << 1, + Release = 1 << 2 + } +} diff --git a/src/tests/Common/XUnitWrapperGenerator/RuntimeTestModes.cs b/src/tests/Common/XUnitWrapperGenerator/RuntimeTestModes.cs new file mode 100644 index 00000000000000..b8c32c93654956 --- /dev/null +++ b/src/tests/Common/XUnitWrapperGenerator/RuntimeTestModes.cs @@ -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. + +using System; + +namespace Xunit +{ + [Flags] + public enum RuntimeTestModes + { + // Disable always when using coreclr runtime. + Any = ~0, + + // We're running regular tests with no runtime stress modes + RegularRun = 1, + + // JitStress, JitStressRegs, JitMinOpts and TailcallStress enable + // various modes in the JIT that cause us to exercise more code paths, + // and generate different kinds of code + JitStress = 1 << 1, // COMPlus_JitStress is set. + JitStressRegs = 1 << 2, // COMPlus_JitStressRegs is set. + JitMinOpts = 1 << 3, // COMPlus_JITMinOpts is set. + TailcallStress = 1 << 4, // COMPlus_TailcallStress is set. + + // ZapDisable says to not use NGEN or ReadyToRun images. + // This means we JIT everything. + ZapDisable = 1 << 5, // COMPlus_ZapDisable is set. + + // GCStress3 forces a GC at various locations, typically transitions + // to/from the VM from managed code. + GCStress3 = 1 << 6, // COMPlus_GCStress includes mode 0x3. + + // GCStressC forces a GC at every JIT-generated code instruction, + // including in NGEN/ReadyToRun code. + GCStressC = 1 << 7, // COMPlus_GCStress includes mode 0xC. + AnyGCStress = GCStress3 | GCStressC // Disable when any GCStress is exercised. + } +} diff --git a/src/tests/Common/XUnitWrapperGenerator/SymbolExtensions.cs b/src/tests/Common/XUnitWrapperGenerator/SymbolExtensions.cs new file mode 100644 index 00000000000000..6dc122ba04b554 --- /dev/null +++ b/src/tests/Common/XUnitWrapperGenerator/SymbolExtensions.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.CodeAnalysis; + +namespace XUnitWrapperGenerator; + +internal static class SymbolExtensions +{ + public static IEnumerable GetAttributesOnSelfAndContainingSymbols(this ISymbol symbol) + { + for (ISymbol? containing = symbol; containing is not null; containing = containing.ContainingSymbol) + { + foreach (var attr in containing.GetAttributes()) + { + yield return attr; + } + } + } +} diff --git a/src/tests/Common/XUnitWrapperGenerator/TargetFrameworkMonikers.cs b/src/tests/Common/XUnitWrapperGenerator/TargetFrameworkMonikers.cs new file mode 100644 index 00000000000000..255e28493dc4de --- /dev/null +++ b/src/tests/Common/XUnitWrapperGenerator/TargetFrameworkMonikers.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; + +namespace Xunit +{ + [Flags] + public enum TargetFrameworkMonikers + { + Netcoreapp = 1, + NetFramework = 2, + Any = ~0 + } +} diff --git a/src/tests/Common/XUnitWrapperGenerator/TestPlatforms.cs b/src/tests/Common/XUnitWrapperGenerator/TestPlatforms.cs new file mode 100644 index 00000000000000..b84e9f250045ec --- /dev/null +++ b/src/tests/Common/XUnitWrapperGenerator/TestPlatforms.cs @@ -0,0 +1,26 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; + +namespace Xunit +{ + [Flags] + public enum TestPlatforms + { + Windows = 1, + Linux = 2, + OSX = 4, + FreeBSD = 8, + NetBSD = 16, + illumos= 32, + Solaris = 64, + iOS = 128, + tvOS = 256, + Android = 512, + Browser = 1024, + MacCatalyst = 2048, + AnyUnix = FreeBSD | Linux | NetBSD | OSX | illumos | Solaris | iOS | tvOS | MacCatalyst | Android | Browser, + Any = ~0 + } +} diff --git a/src/tests/Common/XUnitWrapperGenerator/TestRuntimes.cs b/src/tests/Common/XUnitWrapperGenerator/TestRuntimes.cs new file mode 100644 index 00000000000000..1e821c10a64897 --- /dev/null +++ b/src/tests/Common/XUnitWrapperGenerator/TestRuntimes.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; + +namespace Xunit +{ + [Flags] + public enum TestRuntimes + { + CoreCLR = 1, + Mono = 2, + Any = ~0 + } +} diff --git a/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs new file mode 100644 index 00000000000000..88fb05d7801abc --- /dev/null +++ b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs @@ -0,0 +1,607 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Diagnostics; +using System.Linq; +using System.Text; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Diagnostics; + +namespace XUnitWrapperGenerator; + +[Generator] +public sealed class XUnitWrapperGenerator : IIncrementalGenerator +{ + public void Initialize(IncrementalGeneratorInitializationContext context) + { + var methodsInSource = context.SyntaxProvider.CreateSyntaxProvider( + static (node, ct) => + node.IsKind(SyntaxKind.MethodDeclaration) + && node is MethodDeclarationSyntax method + && method.AttributeLists.Count > 0, + static (context, ct) => (IMethodSymbol)context.SemanticModel.GetDeclaredSymbol(context.Node)!); + + var methodsInReferencedAssemblies = context.MetadataReferencesProvider.Combine(context.CompilationProvider).SelectMany((data, ct) => + { + ExternallyReferencedTestMethodsVisitor visitor = new(); + return visitor.Visit(data.Right.GetAssemblyOrModuleSymbol(data.Left))!; + }); + + var outOfProcessTests = context.AdditionalTextsProvider.Combine(context.AnalyzerConfigOptionsProvider).SelectMany((data, ct) => + { + var (file, options) = data; + + AnalyzerConfigOptions fileOptions = options.GetOptions(file); + + if (fileOptions.IsOutOfProcessTestAssembly()) + { + string? assemblyPath = fileOptions.TestAssemblyRelativePath(); + string? testDisplayName = fileOptions.TestDisplayName(); + if (assemblyPath is not null && testDisplayName is not null) + { + return ImmutableArray.Create(new OutOfProcessTest(testDisplayName, assemblyPath)); + } + } + + return ImmutableArray.Empty; + }); + + var allMethods = methodsInSource.Collect().Combine(methodsInReferencedAssemblies.Collect()).SelectMany((methods, ct) => methods.Left.AddRange(methods.Right)); + + var aliasMap = context.CompilationProvider.Select((comp, ct) => + { + var aliasMap = ImmutableDictionary.CreateBuilder(); + aliasMap.Add(comp.Assembly.MetadataName, "global"); + foreach (var reference in comp.References) + { + aliasMap.Add(comp.GetAssemblyOrModuleSymbol(reference)!.MetadataName, reference.Properties.Aliases.FirstOrDefault() ?? "global"); + } + + return aliasMap.ToImmutable(); + }).WithComparer(new ImmutableDictionaryValueComparer(EqualityComparer.Default)); + + var assemblyName = context.CompilationProvider.Select((comp, ct) => comp.Assembly.MetadataName); + + var alwaysWriteEntryPoint = context.CompilationProvider.Select((comp, ct) => comp.Options.OutputKind == OutputKind.ConsoleApplication && comp.GetEntryPoint(ct) is null); + + context.RegisterImplementationSourceOutput( + allMethods + .Combine(context.AnalyzerConfigOptionsProvider) + .Combine(aliasMap) + .SelectMany((data, ct) => ImmutableArray.CreateRange(GetTestMethodInfosForMethod(data.Left.Left, data.Left.Right, data.Right))) + .Collect() + .Combine(outOfProcessTests.Collect()) + .Select((tests, ct) => tests.Left.AddRange(tests.Right)) + .Combine(context.AnalyzerConfigOptionsProvider) + .Select((data, ct) => + { + var (tests, options) = data; + var filter = new XUnitWrapperLibrary.TestFilter(options.GlobalOptions.TestFilter() ?? ""); + return (ImmutableArray.CreateRange(tests.Where(test => filter.ShouldRunTest($"{test.ContainingType}.{test.Method}", test.DisplayNameForFiltering, Array.Empty()))), options); + }) + .Combine(aliasMap) + .Combine(assemblyName) + .Combine(alwaysWriteEntryPoint), + static (context, data) => + { + var ((((methods, configOptions), aliasMap), assemblyName), alwaysWriteEntryPoint) = data; + + if (methods.Length == 0 && !alwaysWriteEntryPoint) + { + // If we have no test methods, assume that this project is not migrated to the new system yet + // and that we shouldn't generate a no-op Main method. + return; + } + + bool isMergedTestRunnerAssembly = configOptions.GlobalOptions.IsMergedTestRunnerAssembly(); + + // TODO: add error (maybe in MSBuild that referencing CoreLib directly from a merged test runner is not supported) + if (isMergedTestRunnerAssembly) + { + context.AddSource("FullRunner.g.cs", GenerateFullTestRunner(methods, aliasMap, assemblyName)); + } + else + { + string consoleType = "System.Console"; + context.AddSource("SimpleRunner.g.cs", GenerateStandaloneSimpleTestRunner(methods, aliasMap, consoleType)); + } + }); + } + + private static string GenerateFullTestRunner(ImmutableArray testInfos, ImmutableDictionary aliasMap, string assemblyName) + { + // For simplicity, we'll use top-level statements for the generated Main method. + StringBuilder builder = new(); + ITestReporterWrapper reporter = new WrapperLibraryTestSummaryReporting("summary", "filter"); + builder.AppendLine(string.Join("\n", aliasMap.Values.Where(alias => alias != "global").Select(alias => $"extern alias {alias};"))); + + builder.AppendLine("XUnitWrapperLibrary.TestFilter filter = args.Length != 0 ? new XUnitWrapperLibrary.TestFilter(args[0]) : null;"); + builder.AppendLine("XUnitWrapperLibrary.TestSummary summary = new();"); + builder.AppendLine("System.Diagnostics.Stopwatch stopwatch = new();"); + + foreach (ITestInfo test in testInfos) + { + builder.AppendLine(test.GenerateTestExecution(reporter)); + } + + builder.AppendLine($@"System.IO.File.WriteAllText(""{assemblyName}.testResults.xml"", summary.GetTestResultOutput());"); + + return builder.ToString(); + } + + private static string GenerateStandaloneSimpleTestRunner(ImmutableArray testInfos, ImmutableDictionary aliasMap, string consoleType) + { + // For simplicity, we'll use top-level statements for the generated Main method. + ITestReporterWrapper reporter = new NoTestReporting(); + StringBuilder builder = new(); + builder.AppendLine(string.Join("\n", aliasMap.Values.Where(alias => alias != "global").Select(alias => $"extern alias {alias};"))); + builder.AppendLine("try {"); + builder.AppendLine(string.Join("\n", testInfos.Select(m => m.GenerateTestExecution(reporter)))); + builder.AppendLine("} catch(System.Exception ex) { System.Console.WriteLine(ex.ToString()); return 101; }"); + builder.AppendLine("return 100;"); + return builder.ToString(); + } + + private class ExternallyReferencedTestMethodsVisitor : SymbolVisitor> + { + public override IEnumerable? VisitAssembly(IAssemblySymbol symbol) + { + return Visit(symbol.GlobalNamespace); + } + + public override IEnumerable? VisitModule(IModuleSymbol symbol) + { + return Visit(symbol.GlobalNamespace); + } + + public override IEnumerable? VisitNamespace(INamespaceSymbol symbol) + { + foreach (var type in symbol.GetMembers()) + { + foreach (var result in Visit(type) ?? Array.Empty()) + { + yield return result; + } + } + } + + public override IEnumerable? VisitNamedType(INamedTypeSymbol symbol) + { + if (symbol.DeclaredAccessibility == Accessibility.Public) + { + foreach (var type in symbol.GetMembers()) + { + foreach (var result in Visit(type) ?? Array.Empty()) + { + yield return result; + } + } + } + } + + public override IEnumerable? VisitMethod(IMethodSymbol symbol) + { + if (symbol.DeclaredAccessibility == Accessibility.Public + && symbol.GetAttributes().Any(attr => attr.AttributeClass?.ContainingNamespace.Name == "Xunit")) + { + return new[] { symbol }; + } + return Array.Empty(); + } + } + + private static IEnumerable GetTestMethodInfosForMethod(IMethodSymbol method, AnalyzerConfigOptionsProvider options, ImmutableDictionary aliasMap) + { + bool factAttribute = false; + bool theoryAttribute = false; + List theoryDataAttributes = new(); + List filterAttributes = new(); + foreach (var attr in method.GetAttributesOnSelfAndContainingSymbols()) + { + switch (attr.AttributeClass?.ToDisplayString()) + { + case "Xunit.ConditionalFactAttribute": + filterAttributes.Add(attr); + factAttribute = true; + break; + case "Xunit.FactAttribute": + factAttribute = true; + break; + case "Xunit.ConditionalTheoryAttribute": + filterAttributes.Add(attr); + theoryAttribute = true; + break; + case "Xunit.TheoryAttribute": + theoryAttribute = true; + break; + case "Xunit.ConditionalClassAttribute": + case "Xunit.SkipOnPlatformAttribute": + case "Xunit.ActiveIssueAttribute": + case "Xunit.OuterloopAttribute": + case "Xunit.PlatformSpecificAttribute": + case "Xunit.SkipOnMonoAttribute": + case "Xunit.SkipOnTargetFrameworkAttribute": + case "Xunit.SkipOnCoreClrAttribute": + filterAttributes.Add(attr); + break; + case "Xunit.InlineDataAttribute": + case "Xunit.MemberDataAttribute": + theoryDataAttributes.Add(attr); + break; + } + } + + ImmutableArray testInfos = ImmutableArray.Empty; + + if (factAttribute) + { + if (!method.Parameters.IsEmpty) + { + // todo: emit diagnostic + } + else if (method.IsStatic && method.ReturnType.SpecialType == SpecialType.System_Int32) + { + // Support the old executable-based test design where an int return of 100 is success. + testInfos = ImmutableArray.Create((ITestInfo)new LegacyStandaloneEntryPointTestMethod(method, aliasMap[method.ContainingAssembly.MetadataName])); + } + else + { + testInfos = ImmutableArray.Create((ITestInfo)new BasicTestMethod(method, aliasMap[method.ContainingAssembly.MetadataName])); + } + } + else if (theoryAttribute) + { + testInfos = CreateTestCases(method, theoryDataAttributes, aliasMap[method.ContainingAssembly.MetadataName]); + } + + foreach (var filterAttribute in filterAttributes) + { + switch (filterAttribute.AttributeClass!.ToDisplayString()) + { + case "Xunit.ConditionalFactAttribute": + case "Xunit.ConditionalTheoryAttribute": + case "Xunit.ConditionalClassAttribute": + { + ITypeSymbol conditionType; + ImmutableArray conditionMembers; + if (filterAttribute.AttributeConstructor!.Parameters.Length == 1) + { + conditionType = method.ContainingType; + conditionMembers = filterAttribute.ConstructorArguments[0].Values; + } + else + { + Debug.Assert(filterAttribute.AttributeConstructor!.Parameters.Length == 2); + conditionType = (ITypeSymbol)filterAttribute.ConstructorArguments[0].Value!; + conditionMembers = filterAttribute.ConstructorArguments[1].Values; + } + testInfos = DecorateWithUserDefinedCondition( + testInfos, + conditionType, + conditionMembers, + aliasMap[conditionType.ContainingAssembly.MetadataName]); + break; + } + case "Xunit.OuterloopAttribute": + if (options.GlobalOptions.Priority() == 0) + { + // If we aren't building the outerloop/Pri 1 test suite, then this attribute acts like an + // [ActiveIssue] attribute (it has the same shape). + goto case "Xunit.ActiveIssueAttribute"; + } + break; + case "Xunit.ActiveIssueAttribute": + if (filterAttribute.AttributeConstructor!.Parameters.Length == 3) + { + ITypeSymbol conditionType = (ITypeSymbol)filterAttribute.ConstructorArguments[1].Value!; + testInfos = DecorateWithUserDefinedCondition( + testInfos, + conditionType, + filterAttribute.ConstructorArguments[2].Values, + aliasMap[conditionType.ContainingAssembly.MetadataName]); + break; + } + else if (filterAttribute.AttributeConstructor.Parameters.Length == 4) + { + testInfos = FilterForSkippedRuntime( + FilterForSkippedTargetFrameworkMonikers( + DecorateWithSkipOnPlatform(testInfos, (int)filterAttribute.ConstructorArguments[1].Value!, options), + (int)filterAttribute.ConstructorArguments[2].Value!), + (int)filterAttribute.ConstructorArguments[3].Value!, options); + } + else + { + switch (filterAttribute.AttributeConstructor.Parameters[1].Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)) + { + case "global::Xunit.TestPlatforms": + testInfos = DecorateWithSkipOnPlatform(testInfos, (int)filterAttribute.ConstructorArguments[1].Value!, options); + break; + case "global::Xunit.TestRuntimes": + testInfos = FilterForSkippedRuntime(testInfos, (int)filterAttribute.ConstructorArguments[1].Value!, options); + break; + case "global::Xunit.TargetFrameworkMonikers": + testInfos = FilterForSkippedTargetFrameworkMonikers(testInfos, (int)filterAttribute.ConstructorArguments[1].Value!); + break; + default: + break; + } + } + break; + case "Xunit.SkipOnMonoAttribute": + if (options.GlobalOptions.RuntimeFlavor() != "Mono") + { + // If we're building tests not for Mono, we can skip handling the specifics of the SkipOnMonoAttribute. + continue; + } + testInfos = DecorateWithSkipOnPlatform(testInfos, (int)filterAttribute.ConstructorArguments[1].Value!, options); + break; + case "Xunit.SkipOnPlatformAttribute": + testInfos = DecorateWithSkipOnPlatform(testInfos, (int)filterAttribute.ConstructorArguments[0].Value!, options); + break; + case "Xunit.PlatformSpecificAttribute": + testInfos = DecorateWithSkipOnPlatform(testInfos, ~(int)filterAttribute.ConstructorArguments[0].Value!, options); + break; + case "Xunit.SkipOnTargetFrameworkAttribute": + testInfos = FilterForSkippedTargetFrameworkMonikers(testInfos, (int)filterAttribute.ConstructorArguments[0].Value!); + break; + case "Xunit.SkipOnCoreClrAttribute": + if (options.GlobalOptions.RuntimeFlavor() != "CoreCLR") + { + // If we're building tests not for CoreCLR, we can skip handling the specifics of the SkipOnCoreClrAttribute. + continue; + } + + Xunit.TestPlatforms skippedTestPlatforms = 0; + Xunit.RuntimeConfiguration skippedConfigurations = 0; + Xunit.RuntimeTestModes skippedTestModes = 0; + + for (int i = 1; i < filterAttribute.AttributeConstructor!.Parameters.Length; i++) + { + ReadSkippedInformationFromSkipOnCoreClrAttributeArgument(filterAttribute, i); + } + + void ReadSkippedInformationFromSkipOnCoreClrAttributeArgument(AttributeData filterAttribute, int argumentIndex) + { + int argumentValue = (int)filterAttribute.ConstructorArguments[argumentIndex].Value!; + switch (filterAttribute.AttributeConstructor!.Parameters[argumentIndex].Type.ToDisplayString()) + { + case "Xunit.TestPlatforms": + skippedTestPlatforms = (Xunit.TestPlatforms)argumentValue; + break; + case "Xunit.RuntimeTestModes": + skippedTestModes = (Xunit.RuntimeTestModes)argumentValue; + break; + case "Xunit.RuntimeConfiguration": + skippedConfigurations = (Xunit.RuntimeConfiguration)argumentValue; + break; + default: + break; + } + } + + if (skippedTestModes == Xunit.RuntimeTestModes.Any) + { + testInfos = FilterForSkippedRuntime(testInfos, (int)Xunit.TestRuntimes.CoreCLR, options); + } + testInfos = DecorateWithSkipOnPlatform(testInfos, (int)skippedTestPlatforms, options); + testInfos = DecorateWithSkipOnCoreClrConfiguration(testInfos, skippedTestModes, skippedConfigurations); + + break; + } + } + + return testInfos; + } + + private static ImmutableArray DecorateWithSkipOnCoreClrConfiguration(ImmutableArray testInfos, Xunit.RuntimeTestModes skippedTestModes, Xunit.RuntimeConfiguration skippedConfigurations) + { + const string ConditionClass = "TestLibrary.CoreClrConfigurationDetection"; + List conditions = new(); + if (skippedConfigurations.HasFlag(Xunit.RuntimeConfiguration.Debug | Xunit.RuntimeConfiguration.Checked | Xunit.RuntimeConfiguration.Release)) + { + // If all configurations are skipped, just skip the test as a whole + return ImmutableArray.Empty; + } + + if (skippedConfigurations.HasFlag(Xunit.RuntimeConfiguration.Debug)) + { + conditions.Add($"!{ConditionClass}.IsDebugRuntime"); + } + if (skippedConfigurations.HasFlag(Xunit.RuntimeConfiguration.Checked)) + { + conditions.Add($"!{ConditionClass}.IsCheckedRuntime"); + } + if (skippedConfigurations.HasFlag(Xunit.RuntimeConfiguration.Release)) + { + conditions.Add($"!{ConditionClass}.IsReleaseRuntime"); + } + if (skippedTestModes.HasFlag(Xunit.RuntimeTestModes.RegularRun)) + { + conditions.Add($"{ConditionClass}.IsStressTest"); + } + if (skippedTestModes.HasFlag(Xunit.RuntimeTestModes.JitStress)) + { + conditions.Add($"!{ConditionClass}.IsJitStress"); + } + if (skippedTestModes.HasFlag(Xunit.RuntimeTestModes.JitStressRegs)) + { + conditions.Add($"!{ConditionClass}.IsJitStressRegs"); + } + if (skippedTestModes.HasFlag(Xunit.RuntimeTestModes.JitMinOpts)) + { + conditions.Add($"!{ConditionClass}.IsJitMinOpts"); + } + if (skippedTestModes.HasFlag(Xunit.RuntimeTestModes.TailcallStress)) + { + conditions.Add($"!{ConditionClass}.IsTailcallStress"); + } + if (skippedTestModes.HasFlag(Xunit.RuntimeTestModes.ZapDisable)) + { + conditions.Add($"!{ConditionClass}.IsZapDisable"); + } + + if (skippedTestModes.HasFlag(Xunit.RuntimeTestModes.AnyGCStress)) + { + conditions.Add($"!{ConditionClass}.IsGCStress"); + } + else if (skippedTestModes.HasFlag(Xunit.RuntimeTestModes.GCStress3)) + { + conditions.Add($"!{ConditionClass}.IsGCStress3"); + } + else if (skippedTestModes.HasFlag(Xunit.RuntimeTestModes.GCStressC)) + { + conditions.Add($"!{ConditionClass}.IsGCStressC"); + } + + return ImmutableArray.CreateRange(testInfos.Select(t => new ConditionalTest(t, string.Join(" && ", conditions)))); + } + + private static ImmutableArray FilterForSkippedTargetFrameworkMonikers(ImmutableArray testInfos, int v) + { + var tfm = (Xunit.TargetFrameworkMonikers)v; + + if (tfm.HasFlag(Xunit.TargetFrameworkMonikers.Netcoreapp)) + { + return ImmutableArray.Empty; + } + else + { + return testInfos; + } + } + + private static ImmutableArray CreateTestCases(IMethodSymbol method, List theoryDataAttributes, string alias) + { + var testCasesBuilder = ImmutableArray.CreateBuilder(); + foreach (var attr in theoryDataAttributes) + { + switch (attr.AttributeClass!.ToDisplayString()) + { + case "Xunit.InlineDataAttribute": + { + var args = attr.ConstructorArguments[0].Values; + if (method.Parameters.Length != args.Length) + { + // Emit diagnostic + continue; + } + var argsAsCode = ImmutableArray.CreateRange(args.Select(a => a.ToCSharpString())); + testCasesBuilder.Add(new BasicTestMethod(method, alias, arguments: argsAsCode)); + break; + } + case "Xunit.MemberDataAttribute": + { + string? memberName = (string?)attr.ConstructorArguments[0].Value; + if (string.IsNullOrEmpty(memberName)) + { + // Emit diagnostic + continue; + } + INamedTypeSymbol memberType = method.ContainingType; + if (attr.NamedArguments.FirstOrDefault(p => p.Key == "MemberType").Value.Value is INamedTypeSymbol memberTypeOverride) + { + memberType = memberTypeOverride; + } + var membersByName = memberType.GetMembers(memberName!); + if (membersByName.Length != 1) + { + // Emit diagnostic + continue; + } + const string argumentVariableIdentifier = "testArguments"; + // The display name for the test is an interpolated string that includes the arguments. + string displayNameOverride = $@"$""{alias}::{method.ContainingType.ToDisplayString(FullyQualifiedWithoutGlobalNamespace)}.{method.Name}({{string.Join("","", {argumentVariableIdentifier})}})"""; + var argsAsCode = method.Parameters.Select((p, i) => $"({p.Type.ToDisplayString()}){argumentVariableIdentifier}[{i}]").ToImmutableArray(); + testCasesBuilder.Add(new MemberDataTest(membersByName[0], new BasicTestMethod(method, alias, argsAsCode, displayNameOverride), alias, argumentVariableIdentifier)); + break; + } + default: + break; + } + } + return testCasesBuilder.ToImmutable(); + } + + private static ImmutableArray FilterForSkippedRuntime(ImmutableArray testInfos, int skippedRuntimeValue, AnalyzerConfigOptionsProvider options) + { + Xunit.TestRuntimes skippedRuntimes = (Xunit.TestRuntimes)skippedRuntimeValue; + string runtimeFlavor = options.GlobalOptions.RuntimeFlavor(); + if (runtimeFlavor == "Mono" && skippedRuntimes.HasFlag(Xunit.TestRuntimes.Mono)) + { + return ImmutableArray.Empty; + } + else if (runtimeFlavor == "CoreCLR" && skippedRuntimes.HasFlag(Xunit.TestRuntimes.CoreCLR)) + { + return ImmutableArray.Empty; + } + return testInfos; + } + + private static ImmutableArray DecorateWithSkipOnPlatform(ImmutableArray testInfos, int v, AnalyzerConfigOptionsProvider options) + { + Xunit.TestPlatforms platformsToSkip = (Xunit.TestPlatforms)v; + options.GlobalOptions.TryGetValue("build_property.TargetOS", out string? targetOS); + Xunit.TestPlatforms targetPlatform = GetPlatformForTargetOS(targetOS); + + if (platformsToSkip == 0) + { + // In this case, we don't need to skip any platforms + return testInfos; + } + else if (platformsToSkip.HasFlag(targetPlatform)) + { + // If the target platform is skipped, then we don't have any tests to emit. + return ImmutableArray.Empty; + } + else if (targetPlatform.HasFlag(platformsToSkip)) + { + // If our target platform encompases one or more of the skipped platforms, + // emit a runtime platform check here. + Xunit.TestPlatforms platformsToEnableTest = targetPlatform & ~platformsToSkip; + return ImmutableArray.CreateRange(testInfos.Select(t => (ITestInfo)new ConditionalTest(t, platformsToEnableTest))); + } + else + { + // The target platform is not mentioned in the attribute, just run it as-is. + return testInfos; + } + + static Xunit.TestPlatforms GetPlatformForTargetOS(string? targetOS) + { + return targetOS?.ToLowerInvariant() switch + { + "windows" => Xunit.TestPlatforms.Windows, + "linux" => Xunit.TestPlatforms.Linux, + "osx" => Xunit.TestPlatforms.OSX, + "illumos" => Xunit.TestPlatforms.illumos, + "solaris" => Xunit.TestPlatforms.Solaris, + "android" => Xunit.TestPlatforms.Android, + "ios" => Xunit.TestPlatforms.iOS, + "tvos" => Xunit.TestPlatforms.tvOS, + "maccatalyst" => Xunit.TestPlatforms.MacCatalyst, + "browser" => Xunit.TestPlatforms.Browser, + "freebsd" => Xunit.TestPlatforms.FreeBSD, + "netbsd" => Xunit.TestPlatforms.NetBSD, + null or "" or "anyos" => Xunit.TestPlatforms.Any, + _ => 0 + }; + } + } + + private static ImmutableArray DecorateWithUserDefinedCondition( + ImmutableArray testInfos, + ITypeSymbol conditionType, + ImmutableArray values, + string externAlias) + { + string condition = string.Join("&&", values.Select(v => $"{externAlias}::{conditionType.ToDisplayString(FullyQualifiedWithoutGlobalNamespace)}.{v.Value}")); + return ImmutableArray.CreateRange(testInfos.Select(m => new ConditionalTest(m, condition))); + } + + public static readonly SymbolDisplayFormat FullyQualifiedWithoutGlobalNamespace = SymbolDisplayFormat.FullyQualifiedFormat.WithGlobalNamespaceStyle(SymbolDisplayGlobalNamespaceStyle.Omitted); +} diff --git a/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj new file mode 100644 index 00000000000000..fe22933c6ae690 --- /dev/null +++ b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj @@ -0,0 +1,19 @@ + + + + netstandard2.0 + enable + true + true + + + + + + + + + + + + diff --git a/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.props b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.props new file mode 100644 index 00000000000000..b05866e9812294 --- /dev/null +++ b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.props @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/tests/Common/XUnitWrapperLibrary/TestFilter.cs b/src/tests/Common/XUnitWrapperLibrary/TestFilter.cs new file mode 100644 index 00000000000000..b290307e6ff77e --- /dev/null +++ b/src/tests/Common/XUnitWrapperLibrary/TestFilter.cs @@ -0,0 +1,103 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// + +using System; +using System.Collections.Generic; +using System.Text; +namespace XUnitWrapperLibrary; + +public class TestFilter +{ + interface ISearchClause + { + bool IsMatch(string fullyQualifiedName, string displayName, string[] traits); + } + + enum TermKind + { + FullyQualifiedName, + DisplayName + } + sealed class NameClause : ISearchClause + { + public NameClause(TermKind kind, string filter, bool substring) + { + Kind = kind; + Filter = filter; + Substring = substring; + } + public TermKind Kind { get; } + public string Filter { get; } + public bool Substring { get; } + + public bool IsMatch(string fullyQualifiedName, string displayName, string[] traits) + { + string stringToSearch = Kind switch + { + TermKind.FullyQualifiedName => fullyQualifiedName, + TermKind.DisplayName => displayName, + _ => throw new InvalidOperationException() + }; + + if (Substring) + { + return stringToSearch.Contains(Filter); + } + return stringToSearch == Filter; + } + } + + sealed class AndClause : ISearchClause + { + private ISearchClause _left; + private ISearchClause _right; + + public AndClause(ISearchClause left, ISearchClause right) + { + _left = left; + _right = right; + } + + public bool IsMatch(string fullyQualifiedName, string displayName, string[] traits) => _left.IsMatch(fullyQualifiedName, displayName, traits) && _right.IsMatch(fullyQualifiedName, displayName, traits); + } + + sealed class OrClause : ISearchClause + { + private ISearchClause _left; + private ISearchClause _right; + + public OrClause(ISearchClause left, ISearchClause right) + { + _left = left; + _right = right; + } + + public bool IsMatch(string fullyQualifiedName, string displayName, string[] traits) => _left.IsMatch(fullyQualifiedName, displayName, traits) || _right.IsMatch(fullyQualifiedName, displayName, traits); + } + + sealed class NotClause : ISearchClause + { + private ISearchClause _inner; + + public NotClause(ISearchClause inner) + { + _inner = inner; + } + + public bool IsMatch(string fullyQualifiedName, string displayName, string[] traits) => !_inner.IsMatch(fullyQualifiedName, displayName, traits); + } + + private ISearchClause? _filter; + + public TestFilter(string filterString) + { + if (filterString.IndexOfAny(new[] { '!', '(', ')', '~', '=' }) != -1) + { + throw new ArgumentException("Complex test filter expressions are not supported today. The only filters supported today are the simple form supported in 'dotnet test --filter' (substrings of the test's fully qualified name). If further filtering options are desired, file an issue on dotnet/runtime for support.", nameof(filterString)); + } + _filter = new NameClause(TermKind.FullyQualifiedName, filterString, substring: true); + } + + public bool ShouldRunTest(string fullyQualifiedName, string displayName, string[]? traits = null) => _filter is null ? true : _filter.IsMatch(fullyQualifiedName, displayName, traits ?? Array.Empty()); +} diff --git a/src/tests/Common/XUnitWrapperLibrary/TestSummary.cs b/src/tests/Common/XUnitWrapperLibrary/TestSummary.cs new file mode 100644 index 00000000000000..f7e47ebdeb619b --- /dev/null +++ b/src/tests/Common/XUnitWrapperLibrary/TestSummary.cs @@ -0,0 +1,95 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// + +using System; +using System.Collections.Generic; +using System.Text; +namespace XUnitWrapperLibrary; + +public class TestSummary +{ + readonly record struct TestResult(string Name, string ContainingTypeName, string MethodName, TimeSpan Duration, Exception? Exception, string? SkipReason); + + private int _numPassed = 0; + + private int _numFailed = 0; + + private int _numSkipped = 0; + + private readonly List _testResults = new(); + + private DateTime _testRunStart = DateTime.Now; + + public void ReportPassedTest(string name, string containingTypeName, string methodName, TimeSpan duration) + { + _numPassed++; + _testResults.Add(new TestResult(name, containingTypeName, methodName, duration, null, null)); + } + + public void ReportFailedTest(string name, string containingTypeName, string methodName, TimeSpan duration, Exception ex) + { + _numFailed++; + _testResults.Add(new TestResult(name, containingTypeName, methodName, duration, ex, null)); + } + + public void ReportSkippedTest(string name, string containingTypeName, string methodName, TimeSpan duration, string reason) + { + _numSkipped++; + _testResults.Add(new TestResult(name, containingTypeName, methodName, duration, null, reason)); + } + + public string GetTestResultOutput() + { + double totalRunSeconds = (DateTime.Now - _testRunStart).TotalSeconds; + // using StringBuilder here for simplicity of loaded IL. + StringBuilder resultsFile = new(); + resultsFile.AppendLine(""); + resultsFile.AppendLine($@" +"); + + resultsFile.AppendLine($@" +"); + + foreach (var test in _testResults) + { + resultsFile.Append($@""); + } + else if (test.SkipReason is not null) + { + resultsFile.AppendLine($@"result=""Skip"">"); + } + else + { + resultsFile.AppendLine(@" result=""Pass"" />"); + } + } + + resultsFile.AppendLine(""); + resultsFile.AppendLine(""); + resultsFile.AppendLine(""); + + return resultsFile.ToString(); + } +} diff --git a/src/tests/Common/XUnitWrapperLibrary/XUnitWrapperLibrary.csproj b/src/tests/Common/XUnitWrapperLibrary/XUnitWrapperLibrary.csproj new file mode 100644 index 00000000000000..4d2fc0407701c1 --- /dev/null +++ b/src/tests/Common/XUnitWrapperLibrary/XUnitWrapperLibrary.csproj @@ -0,0 +1,11 @@ + + + Library + BuildOnly + true + false + $(NetCoreAppToolCurrent) + true + enable + + diff --git a/src/tests/Common/XunitBase.cs b/src/tests/Common/XunitBase.cs deleted file mode 100644 index abaa1bb1406d73..00000000000000 --- a/src/tests/Common/XunitBase.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Threading; -using Xunit.Runners; - -namespace Xunit -{ - public abstract class XunitBase - { - private static object consoleLock = new object(); - - private static ManualResetEvent finished = new ManualResetEvent(false); - - private static int result = 100; - - public int RunTests() - { - var runner = AssemblyRunner.WithoutAppDomain(GetType().Assembly.Location); - runner.OnDiscoveryComplete = OnDiscoveryComplete; - runner.OnExecutionComplete = OnExecutionComplete; - runner.OnTestFailed = OnTestFailed; - runner.OnTestSkipped = OnTestSkipped; - - Console.WriteLine("Discovering..."); - - runner.Start(); - - finished.WaitOne(); - finished.Dispose(); - - return result; - } - - private static void OnDiscoveryComplete(DiscoveryCompleteInfo info) - { - lock (consoleLock) - Console.WriteLine($"Running {info.TestCasesToRun} of {info.TestCasesDiscovered} tests..."); - } - - private static void OnExecutionComplete(ExecutionCompleteInfo info) - { - lock (consoleLock) - Console.WriteLine($"Finished: {info.TotalTests} tests in {Math.Round(info.ExecutionTime, 3)}s ({info.TestsFailed} failed, {info.TestsSkipped} skipped)"); - - finished.Set(); - } - - private static void OnTestFailed(TestFailedInfo info) - { - lock (consoleLock) - { - Console.ForegroundColor = ConsoleColor.Red; - - Console.WriteLine("[FAIL] {0}: {1}", info.TestDisplayName, info.ExceptionMessage); - if (info.ExceptionStackTrace != null) - Console.WriteLine(info.ExceptionStackTrace); - - Console.ResetColor(); - } - - result = 101; - } - - private static void OnTestSkipped(TestSkippedInfo info) - { - lock (consoleLock) - { - Console.ForegroundColor = ConsoleColor.Yellow; - Console.WriteLine("[SKIP] {0}: {1}", info.TestDisplayName, info.SkipReason); - Console.ResetColor(); - } - } - } -} diff --git a/src/tests/Common/dirs.proj b/src/tests/Common/dirs.proj index 1f01854d5b7470..48ba1a8b3afd3a 100644 --- a/src/tests/Common/dirs.proj +++ b/src/tests/Common/dirs.proj @@ -12,7 +12,6 @@ - diff --git a/src/tests/Common/external/external.csproj b/src/tests/Common/external/external.csproj index 2f7bb3abb8b3c0..3040614a467970 100644 --- a/src/tests/Common/external/external.csproj +++ b/src/tests/Common/external/external.csproj @@ -63,6 +63,7 @@ + @@ -71,6 +72,7 @@ + diff --git a/src/tests/Common/override.targets b/src/tests/Common/override.targets deleted file mode 100644 index 0586ffe389928b..00000000000000 --- a/src/tests/Common/override.targets +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/src/tests/Common/scripts/arm32_ci_script.sh b/src/tests/Common/scripts/arm32_ci_script.sh index 33d884f4f990de..986152f911d161 100755 --- a/src/tests/Common/scripts/arm32_ci_script.sh +++ b/src/tests/Common/scripts/arm32_ci_script.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #Usage message function usage { @@ -66,7 +66,7 @@ function exit_with_error { local printUsage=$2 echo "ERROR: $errorMessage" - if [ "$printUsage" == "true" ]; then + if [[ "$printUsage" == "true" ]]; then echo '' usage fi @@ -153,7 +153,7 @@ function handle_exit { echo 'The script is exited. Cleaning environment..' - if [ "$__ciMode" == "emulator" ]; then + if [[ "$__ciMode" == "emulator" ]]; then clean_env fi } @@ -242,7 +242,7 @@ function cross_build_coreclr_with_docker { # Check build configuration and choose Docker image __dockerEnvironmentVariables="" - if [ "$__buildArch" == "arm" ]; then + if [[ "$__buildArch" == "arm" ]]; then # TODO: For arm, we are going to embed RootFS inside Docker image. case $__linuxCodeName in trusty) @@ -261,7 +261,7 @@ function cross_build_coreclr_with_docker { exit_with_error "ERROR: $__linuxCodeName is not a supported linux name for $__buildArch" false ;; esac - elif [ "$__buildArch" == "armel" ]; then + elif [[ "$__buildArch" == "armel" ]]; then # For armel Tizen, we are going to construct RootFS on the fly. case $__linuxCodeName in tizen) @@ -280,7 +280,7 @@ function cross_build_coreclr_with_docker { fi __dockerCmd="sudo docker run ${__dockerEnvironmentVariables} --privileged -i --rm -v $__currentWorkingDirectory:/opt/code -w /opt/code $__dockerImage" - if [ $__skipRootFS == 0 ]; then + if [[ "$__skipRootFS" == 0 ]]; then # Build rootfs __buildRootfsCmd="$__RepoRootDir/eng/common/cross/build-rootfs.sh $__buildArch $__linuxCodeName --skipunmount" @@ -369,7 +369,7 @@ function run_tests_using_docker { # Configure docker __dockerEnvironmentVariables="" - if [ "$__buildArch" == "arm" ]; then + if [[ "$__buildArch" == "arm" ]]; then case $__linuxCodeName in trusty) __dockerImage=" mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu1404_cross_prereqs_v3" @@ -385,7 +385,7 @@ function run_tests_using_docker { exit_with_error "ERROR: $__linuxCodeName is not a supported linux name for $__buildArch" false ;; esac - elif [ "$__buildArch" == "armel" ]; then + elif [[ "$__buildArch" == "armel" ]]; then case $__linuxCodeName in tizen) __dockerImage=" tizendotnet/dotnet-buildtools-prereqs:ubuntu-16.04-cross-e435274-20180426002255-tizen-rootfs-5.0m1" @@ -494,7 +494,7 @@ do done #Check if there are any uncommited changes in the source directory as git adds and removes patches -if [[ $(git status -s) != "" ]]; then +if [[ -n $(git status -s) ]]; then echo 'ERROR: There are some uncommited changes. To avoid losing these changes commit them and try again.' echo '' git status @@ -502,7 +502,7 @@ if [[ $(git status -s) != "" ]]; then fi exit_if_empty "$__buildConfig" "--buildConfig is a mandatory argument, not provided" true -if [ "$__ciMode" == "emulator" ]; then +if [[ "$__ciMode" == "emulator" ]]; then #Check if the compulsory arguments have been presented to the script and if the input paths exist exit_if_empty "$__ARMEmulPath" "--emulatorPath is a mandatory argument, not provided" true exit_if_empty "$__ARMRootfsMountPath" "--mountPath is a mandatory argument, not provided" true @@ -513,7 +513,7 @@ fi __coreFxBinDir="./bin/CoreFxBinDir" # TODO-cleanup: Just for testing.... #Check if the optional arguments are present in the case that testing is to be done -if [ $__skipTests == 0 ]; then +if [[ "$__skipTests" == 0 ]]; then exit_if_empty "$__testRootDir" "Testing requested, but --testRootDir not provided" true exit_if_path_absent "$__testRootDir" "Path specified in --testRootDir does not exist" false @@ -523,10 +523,10 @@ if [ $__skipTests == 0 ]; then exit_if_empty "$__testDirFile" "Testing requested, but --testDirFile not provided" true exit_if_path_absent "$__testDirFile" "Path specified in --testDirFile does not exist" false - if [ ! -z "$__skipMscorlib" ]; then + if [[ -n "$__skipMscorlib" ]]; then exit_if_empty "$__mscorlibDir" "Testing and skipmscorlib requested, but --mscorlibDir not provided" true fi - if [ ! -z "$__mscorlibDir" ]; then + if [[ -n "$__mscorlibDir" ]]; then echo '--mscorlibDir provided; will be using this path for running tests and ignoring the generated mscorlib.dll' exit_if_path_absent "$__mscorlibDir/mscorlib.dll" "Path specified in --mscorlibDir does not contain mscorlib.dll" fi @@ -562,7 +562,7 @@ set -e ## Begin cross build (set +x; echo "Git HEAD @ $__initialGitHead") -if [ "$__ciMode" == "docker" ]; then +if [[ "$__ciMode" == "docker" ]]; then # Complete the cross build using Docker (set +x; echo 'Building coreclr...') cross_build_coreclr_with_docker @@ -581,13 +581,13 @@ else fi #If tests are to be skipped end the script here, else continue -if [ $__skipTests == 1 ]; then +if [[ "$__skipTests" == 1 ]]; then exit 0 fi __unittestResult=0 ## Begin CoreCLR test -if [ "$__ciMode" == "docker" ]; then +if [[ "$__ciMode" == "docker" ]]; then run_tests_using_docker __unittestResult=$? else diff --git a/src/tests/Common/scripts/arm32_ci_test.sh b/src/tests/Common/scripts/arm32_ci_test.sh index aee795378f4ded..07ccf89a163c8c 100755 --- a/src/tests/Common/scripts/arm32_ci_test.sh +++ b/src/tests/Common/scripts/arm32_ci_test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -x @@ -20,7 +20,7 @@ function exit_with_error { local printUsage=$2 echo "ERROR: $errorMessage" - if [ "$printUsage" == "true" ]; then + if [[ "$printUsage" == "true" ]]; then echo '' usage fi @@ -80,7 +80,7 @@ else __ROOTFS_DIR=${ROOTFS_DIR} fi -if [ "$__abi" == "armel" ]; then +if [[ "$__abi" == "armel" ]]; then # Prepare armel emulation environment pushd ${CORECLR_DIR}/eng/common/cross/armel/tizen apt-get update diff --git a/src/tests/Common/scripts/bringup_runtest.sh b/src/tests/Common/scripts/bringup_runtest.sh index f551150c535398..e87f04b8929b72 100755 --- a/src/tests/Common/scripts/bringup_runtest.sh +++ b/src/tests/Common/scripts/bringup_runtest.sh @@ -45,7 +45,7 @@ function print_usage { echo ' --test-env : Script to set environment variables for tests' echo ' --copyNativeTestBin : Explicitly copy native test components into the test dir' echo ' --crossgen : Precompiles the framework managed assemblies' - echo ' --runcrossgentests : Runs the ready to run tests' + echo ' --runcrossgentests : Runs the ready to run tests' echo ' --jitstress= : Runs the tests with COMPlus_JitStress=n' echo ' --jitstressregs= : Runs the tests with COMPlus_JitStressRegs=n' echo ' --jitminopts : Runs the tests with COMPlus_JITMinOpts=1' @@ -173,11 +173,11 @@ function xunit_output_add_test { line="${line} type=\"${testDir}\"" line="${line} method=\"${testName}\"" line="${line} result=\"${testResult}\"" - if [ -n "$testRunningTime" ] && [ "$testResult" != "Skip" ]; then + if [[ -n "$testRunningTime" && "$testResult" != "Skip" ]]; then line="${line} time=\"${testRunningTime}\"" fi - if [ "$testResult" == "Pass" ]; then + if [[ "$testResult" == "Pass" ]]; then line="${line}/>" echo "$line" >>"$xunitTestOutputPath" return @@ -187,7 +187,7 @@ function xunit_output_add_test { echo "$line" >>"$xunitTestOutputPath" line=" " - if [ "$testResult" == "Skip" ]; then + if [[ "$testResult" == "Skip" ]]; then line="${line}" echo "$line" >>"$xunitTestOutputPath" else @@ -341,9 +341,9 @@ function text_file_output_add_test { local scriptFilePath=$1 local testResult=$2 # Pass, Fail, or Skip - if [ "$testResult" == "Pass" ]; then + if [[ "$testResult" == "Pass" ]]; then echo "$scriptFilePath" >>"$testsPassOutputPath" - elif [ "$testResult" == "Skip" ]; then + elif [[ "$testResult" == "Skip" ]]; then echo "$scriptFilePath" >>"$testsSkipOutputPath" else echo "$scriptFilePath" >>"$testsFailOutputPath" @@ -438,7 +438,7 @@ declare -a skipCrossGenFiles function is_skip_crossgen_test { for skip in "${skipCrossGenFiles[@]}"; do - if [ "$1" == "$skip" ]; then + if [[ "$1" == "$skip" ]]; then return 0 fi done @@ -448,17 +448,17 @@ function is_skip_crossgen_test { function precompile_overlay_assemblies { skipCrossGenFiles=($(read_array "$(dirname "$0")/skipCrossGenFiles.$ARCH.txt")) - if [ $doCrossgen == 1 ]; then + if [[ "$doCrossgen" == 1 ]]; then local overlayDir=$CORE_ROOT filesToPrecompile=$(find -L $overlayDir -iname \*.dll -not -iname \*.ni.dll -not -iname \*-ms-win-\* -type f ) for fileToPrecompile in ${filesToPrecompile} do local filename=${fileToPrecompile} - if [ $jitdisasm == 1 ]; then + if [[ "$jitdisasm" == 1 ]]; then $overlayDir/corerun $overlayDir/jit-dasm.dll --crossgen $overlayDir/crossgen --platform $overlayDir --output $testRootDir/dasm $filename local exitCode=$? - if [ $exitCode != 0 ]; then + if [[ "$exitCode" != 0 ]]; then echo Unable to generate dasm for $filename fi else @@ -551,7 +551,7 @@ function load_playlist_tests { function is_unsupported_test { for unsupportedTest in "${unsupportedTests[@]}"; do - if [ "$1" == "$unsupportedTest" ]; then + if [[ "$1" == "$unsupportedTest" ]]; then return 0 fi done @@ -560,7 +560,7 @@ function is_unsupported_test { function is_failing_test { for failingTest in "${failingTests[@]}"; do - if [ "$1" == "$failingTest" ]; then + if [[ "$1" == "$failingTest" ]]; then return 0 fi done @@ -569,7 +569,7 @@ function is_failing_test { function is_playlist_test { for playlistTest in "${playlistTests[@]}"; do - if [ "$1" == "$playlistTest" ]; then + if [[ "$1" == "$playlistTest" ]]; then return 0 fi done @@ -625,7 +625,7 @@ function set_up_core_dump_generation { # Allow dump generation ulimit -c unlimited - if [ "$(uname -s)" == "Linux" ]; then + if [[ "$(uname -s)" == "Linux" ]]; then if [ -e /proc/self/coredump_filter ]; then # Include memory in private and shared file-backed mappings in the dump. # This ensures that we can see disassembly from our shared libraries when @@ -638,7 +638,7 @@ function set_up_core_dump_generation { function print_info_from_core_file { #### temporary - if [ "$ARCH" == "arm64" ]; then + if [[ "$ARCH" == "arm64" ]]; then echo "Not inspecting core dumps on arm64 at the moment." return fi @@ -675,19 +675,19 @@ function print_info_from_core_file { function inspect_and_delete_core_files { # This function prints some basic information from core files in the current # 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 + # or "core." by default. We will read /proc/sys/kernel/core_uses_pid to # determine which one it is. # On OS X/macOS, we checked the kern.corefile value before enabling core dump # generation, so we know it always includes the PID. local core_name_uses_pid=0 - if [[ (( -e /proc/sys/kernel/core_uses_pid ) && ( "1" == $(cat /proc/sys/kernel/core_uses_pid) )) + if [[ (( -e /proc/sys/kernel/core_uses_pid ) && ( "1" == $(cat /proc/sys/kernel/core_uses_pid) )) || ( "$(uname -s)" == "Darwin" ) ]]; then core_name_uses_pid=1 fi - if [ $core_name_uses_pid == "1" ]; then + if [[ "$core_name_uses_pid" == "1" ]]; then # 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 @@ -711,7 +711,7 @@ function run_test { local scriptFileName=$(basename "$scriptFilePath") local outputFileName=$(basename "$outputFilePath") - if [ "$limitedCoreDumps" == "ON" ]; then + if [[ "$limitedCoreDumps" == "ON" ]]; then set_up_core_dump_generation fi @@ -720,7 +720,7 @@ function run_test { # We will try to print some information from generated core dumps if a debugger # is available, and possibly store a dump in a non-transient location. - if [ "$limitedCoreDumps" == "ON" ]; then + if [[ "$limitedCoreDumps" == "ON" ]]; then inspect_and_delete_core_files fi @@ -757,7 +757,7 @@ function waitany { while true; do for (( i=0; i<$maxProcesses; i++ )); do pid=${processIds[$i]} - if [ -z "$pid" ] || [ "$pid" == "$pidNone" ]; then + if [[ -z "$pid" || "$pid" == "$pidNone" ]]; then continue fi if ! kill -0 $pid 2>/dev/null; then @@ -777,7 +777,7 @@ function get_available_process_index { local i=0 for (( i=0; i<$maxProcesses; i++ )); do pid=${processIds[$i]} - if [ -z "$pid" ] || [ "$pid" == "$pidNone" ]; then + if [[ -z "$pid" || "$pid" == "$pidNone" ]]; then break fi done @@ -802,7 +802,7 @@ function finish_test { header=$(printf "[%4d]" $countTotalTests) fi - if [ "$showTime" == "ON" ]; then + if [[ "$showTime" == "ON" ]]; then testEndTime=$(date +%s) testRunningTime=$(( $testEndTime - ${testStartTimes[$finishedProcessIndex]} )) header=$header$(printf "[%4ds]" $testRunningTime) @@ -853,13 +853,13 @@ function prep_test { local scriptFilePath=$1 local scriptFileDir=$(dirname "$scriptFilePath") - test "$verbose" == 1 && echo "Preparing $scriptFilePath" + test "$verbose" = 1 && echo "Preparing $scriptFilePath" - if [ ! "$noLFConversion" == "ON" ]; then + if [[ "$noLFConversion" != "ON" ]]; then # Convert DOS line endings to Unix if needed perl -pi -e 's/\r\n|\n|\r/\n/g' "$scriptFilePath" fi - + # Add executable file mode bit if needed chmod +x "$scriptFilePath" @@ -891,11 +891,11 @@ function start_test { local outputFilePath=$(dirname "$scriptFilePath")/${scriptFileName}.out outputFilePaths[$nextProcessIndex]=$outputFilePath - if [ "$showTime" == "ON" ]; then + if [[ "$showTime" == "ON" ]]; then testStartTimes[$nextProcessIndex]=$(date +%s) fi - test "$verbose" == 1 && echo "Starting $scriptFilePath" + test "$verbose" = 1 && echo "Starting $scriptFilePath" if is_unsupported_test "$scriptFilePath"; then skip_unsupported_test "$scriptFilePath" "$outputFilePath" & elif ((runFailingTestsOnly == 0)) && is_failing_test "$scriptFilePath"; then @@ -1136,10 +1136,10 @@ do ;; --test-env=*) testEnv=${i#*=} - ;; + ;; --gcstresslevel=*) export COMPlus_GCStress=${i#*=} - ;; + ;; --gcname=*) export COMPlus_GCName=${i#*=} ;; @@ -1166,7 +1166,7 @@ do esac done -if [ -n "$coreOverlayDir" ] && [ "$buildOverlayOnly" == "ON" ]; then +if [[ -n "$coreOverlayDir" && "$buildOverlayOnly" == "ON" ]]; then echo "Can not use \'--coreOverlayDir=\' and \'--build-overlay-only\' at the same time." exit $EXIT_CODE_EXCEPTION fi @@ -1189,36 +1189,36 @@ fi # Copy native interop test libraries over to the mscorlib path in # order for interop tests to run on linux. -if [ -z "$mscorlibDir" ]; then +if [[ -z "$mscorlibDir" ]]; then mscorlibDir=$coreClrBinDir fi -if [ ! -z "$longgc" ]; then +if [[ -n "$longgc" ]]; then echo "Running Long GC tests" export RunningLongGCTests=1 fi -if [ ! -z "$gcsimulator" ]; then +if [[ -n "$gcsimulator" ]]; then echo "Running GC simulator tests" export RunningGCSimulatorTests=1 fi -if [[ ! "$jitdisasm" -eq 0 ]]; then +if [[ "$jitdisasm" -ne 0 ]]; then echo "Running jit disasm" export RunningJitDisasm=1 fi -if [ ! -z "$ilasmroundtrip" ]; then +if [[ -n "$ilasmroundtrip" ]]; then echo "Running Ilasm round trip" export RunningIlasmRoundTrip=1 fi # If this is a coverage run, make sure the appropriate args have been passed -if [ "$CoreClrCoverage" == "ON" ] +if [[ "$CoreClrCoverage" == "ON" ]] then echo "Code coverage is enabled for this run" echo "" - if [ ! "$OSName" == "Darwin" ] && [ ! "$OSName" == "Linux" ] + if [[ "$OSName" != "Darwin" && "$OSName" != "Linux" ]] then echo "Code Coverage not supported on $OS" exit 1 @@ -1251,7 +1251,7 @@ text_file_output_begin create_core_overlay precompile_overlay_assemblies -if [ "$buildOverlayOnly" == "ON" ]; +if [[ "$buildOverlayOnly" == "ON" ]]; then echo "Build overlay directory '$coreOverlayDir' complete." exit 0 @@ -1302,7 +1302,7 @@ echo "$(($time_diff / 60)) minutes and $(($time_diff % 60)) seconds taken to run xunit_output_end -if [ "$CoreClrCoverage" == "ON" ] +if [[ "$CoreClrCoverage" == "ON" ]] then coreclr_code_coverage fi diff --git a/src/tests/Common/scripts/build_illink.sh b/src/tests/Common/scripts/build_illink.sh index 26fae14bc7a260..ec24b72c3b273d 100755 --- a/src/tests/Common/scripts/build_illink.sh +++ b/src/tests/Common/scripts/build_illink.sh @@ -25,19 +25,19 @@ do print_usage exit $EXIT_CODE_SUCCESS ;; - + --clone) clone=1 ;; - + --arch=*) arch=${i#*=} ;; - + --os=*) os=${i#*=} ;; - + *) echo "Unknown switch: $i" print_usage @@ -48,7 +48,7 @@ done rid="$os-$arch" -if [ ! -z "$clone" ]; then +if [[ -n "$clone" ]]; then git clone --recursive https://github.com/mono/linker fi diff --git a/src/tests/Common/scripts/format.py b/src/tests/Common/scripts/format.py index 3e8d5509de4ae6..bccdbd72971bbb 100644 --- a/src/tests/Common/scripts/format.py +++ b/src/tests/Common/scripts/format.py @@ -199,7 +199,7 @@ def main(argv): if platform == 'Linux' or platform == 'OSX': jitformat = os.path.join(jitformat, "jit-format") elif platform == 'windows': - jitformat = os.path.join(jitformat,"jit-format.bat") + jitformat = os.path.join(jitformat,"jit-format.exe") errorMessage = "" builds = ["Checked", "Debug", "Release"] diff --git a/src/tests/Common/scripts/run-corefx-tests.sh b/src/tests/Common/scripts/run-corefx-tests.sh index 39a87d03834d23..13c274599b353d 100755 --- a/src/tests/Common/scripts/run-corefx-tests.sh +++ b/src/tests/Common/scripts/run-corefx-tests.sh @@ -95,7 +95,7 @@ esac CPUName=$(uname -p) # Some Linux platforms report unknown for platform, but the arch for machine. -if [ "$CPUName" == "unknown" ]; then +if [[ "$CPUName" == "unknown" ]]; then CPUName=$(uname -m) fi @@ -147,7 +147,7 @@ function waitany { while true; do for (( i=0; i<$maxProcesses; i++ )); do pid=${processIds[$i]} - if [ -z "$pid" ] || [ "$pid" == "$pidNone" ]; then + if [[ -z "$pid" || "$pid" == "$pidNone" ]]; then continue fi if ! kill -0 $pid 2>/dev/null; then @@ -167,7 +167,7 @@ function get_available_process_index { local i=0 for (( i=0; i<$maxProcesses; i++ )); do pid=${processIds[$i]} - if [ -z "$pid" ] || [ "$pid" == "$pidNone" ]; then + if [[ -z "$pid" || "$pid" == "$pidNone" ]]; then break fi done @@ -189,7 +189,7 @@ function finish_test { cat ${outputFilePath} echo "<<<<<" - if [ $testScriptExitCode -ne 0 ] ; then + if [ $testScriptExitCode -ne 0 ]; then failedTests[$countFailedTests]=$testProject countFailedTests=$(($countFailedTests+1)) else @@ -266,7 +266,7 @@ function summarize_test_run { echo "# Failed : $countFailedTests" echo "=======================" - if [ $countFailedTests -gt 0 ] ; then + if [ $countFailedTests -gt 0 ]; then echo echo "===== Failed tests:" for (( i=0; i<$countFailedTests; i++ )); do @@ -336,7 +336,7 @@ run_test() ${TimeoutTool}./RunTests.sh --runtime-path "$Runtime" --rsp-file "$ExclusionRspFile" exitCode=$? - if [ $exitCode -ne 0 ] ; then + if [ $exitCode -ne 0 ]; then echo "error: One or more tests failed while running tests from '$fileNameWithoutExtension'. Exit code $exitCode." fi @@ -346,12 +346,12 @@ run_test() coreclr_code_coverage() { - if [ "$OS" != "FreeBSD" ] && [ "$OS" != "Linux" ] && [ "$OS" != "NetBSD" ] && [ "$OS" != "OSX" ] && [ "$OS" != "SunOS" ] ; then + if [[ "$OS" != "FreeBSD" && "$OS" != "Linux" && "$OS" != "NetBSD" && "$OS" != "OSX" && "$OS" != "SunOS" ]]; then echo "error: Code Coverage not supported on $OS" exit 1 fi - if [ "$CoreClrSrc" == "" ] ; then + if [[ -z "$CoreClrSrc" ]]; then echo "error: Coreclr source files are required to generate code coverage reports" echo "Coreclr source files root path can be passed using '--coreclr-src' argument" exit 1 @@ -487,26 +487,22 @@ done # Compute paths to the binaries if they haven't already been computed -if [ "$Runtime" == "" ] -then +if [[ -z "$Runtime" ]]; then Runtime="$ProjectRoot/bin/testhost/netcoreapp-$OS-$Configuration-$__Arch" fi -if [ "$CoreFxTests" == "" ] -then +if [[ -z "$CoreFxTests" ]]; then CoreFxTests="$ProjectRoot/bin" fi # Check parameters up front for valid values: -if [ ! "$Configuration" == "Debug" ] && [ ! "$Configuration" == "Release" ] -then +if [[ "$Configuration" != "Debug" && "$Configuration" != "Release" ]]; then echo "error: Configuration should be Debug or Release" exit 1 fi -if [ "$OS" != "FreeBSD" ] && [ "$OS" != "Linux" ] && [ "$OS" != "NetBSD" ] && [ "$OS" != "OSX" ] && [ "$OS" != "SunOS" ] -then +if [[ "$OS" != "FreeBSD" && "$OS" != "Linux" && "$OS" != "NetBSD" && "$OS" != "OSX" && "$OS" != "SunOS" ]]; then echo "error: OS should be FreeBSD, Linux, NetBSD, OSX or SunOS" exit 1 fi @@ -514,8 +510,7 @@ fi export CORECLR_SERVER_GC="$serverGC" export PAL_OUTPUTDEBUGSTRING="1" -if [ "$LANG" == "" ] -then +if [[ -z "$LANG" ]]; then export LANG="en_US.UTF-8" fi @@ -551,15 +546,13 @@ if [ $RunTestSequential -eq 1 ]; then maxProcesses=1 fi -if [ -n "$TestDirFile" ] || [ -n "$TestDir" ] -then +if [[ -n "$TestDirFile" || -n "$TestDir" ]]; then run_selected_tests else run_all_tests "$CoreFxTests/tests/"*.Tests fi -if [ "$CoreClrCoverage" == "ON" ] -then +if [[ "$CoreClrCoverage" == "ON" ]]; then coreclr_code_coverage fi diff --git a/src/tests/Common/scripts/run-gc-reliability-framework.sh b/src/tests/Common/scripts/run-gc-reliability-framework.sh index c136c1561ec9ca..c634fbbb11426e 100755 --- a/src/tests/Common/scripts/run-gc-reliability-framework.sh +++ b/src/tests/Common/scripts/run-gc-reliability-framework.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash OSName=$(uname -s) case $OSName in diff --git a/src/tests/Common/scripts/runincontext.sh b/src/tests/Common/scripts/runincontext.sh index 8e36564e0db8aa..991d1805ed2dcf 100755 --- a/src/tests/Common/scripts/runincontext.sh +++ b/src/tests/Common/scripts/runincontext.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash + # This script is a bridge that allows .cmd files of individual tests to run the respective test executables # in an unloadable AssemblyLoadContext. # diff --git a/src/tests/Common/scripts/tieringtest.sh b/src/tests/Common/scripts/tieringtest.sh index c6f6a3f276826c..f4322131324955 100644 --- a/src/tests/Common/scripts/tieringtest.sh +++ b/src/tests/Common/scripts/tieringtest.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash + # This script is a bridge that allows .cmd files of individual tests to run the respective test executables # repeatedly so that more methods get rejitted at Tier1 # diff --git a/src/tests/Common/scripts/x86_ci_script.sh b/src/tests/Common/scripts/x86_ci_script.sh index fa39c530bde1a4..1a6832d894ae9a 100755 --- a/src/tests/Common/scripts/x86_ci_script.sh +++ b/src/tests/Common/scripts/x86_ci_script.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash #Parse command line arguments __buildConfig= @@ -17,7 +17,7 @@ do done #Check if there are any uncommited changes in the source directory as git adds and removes patches -if [[ $(git status -s) != "" ]]; then +if [[ -n $(git status -s) ]]; then echo 'ERROR: There are some uncommited changes. To avoid losing these changes commit them and try again.' echo '' git status diff --git a/src/tests/Common/testenvironment.proj b/src/tests/Common/testenvironment.proj index 359db9e2b6d137..c8d6e0d31e59e9 100644 --- a/src/tests/Common/testenvironment.proj +++ b/src/tests/Common/testenvironment.proj @@ -187,7 +187,11 @@ + + + + diff --git a/src/tests/Common/testgrouping.proj b/src/tests/Common/testgrouping.proj index bd6da5968c054e..6c32c7f7e61953 100644 --- a/src/tests/Common/testgrouping.proj +++ b/src/tests/Common/testgrouping.proj @@ -25,18 +25,158 @@ $(TestBinDir)JIT\jit64\JIT.jit64.XUnitWrapper.dll - - JIT.HardwareIntrinsics.Arm + + JIT.HardwareIntrinsics.Arm.AdvSimd $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll - - JIT.HardwareIntrinsics.General + + JIT.HardwareIntrinsics.Arm.Aes $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll - - JIT.HardwareIntrinsics.X86 + + JIT.HardwareIntrinsics.Arm.ArmBase + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.Arm.Crc32 + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.Arm.Dp + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.Arm.Rdm + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.Arm.Sha1 + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.Arm.Sha256 + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.General.NotSupported + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.General.Vector64 + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.General.Vector128 + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.General.Vector256 + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.X86.Aes + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.X86.Avx1 + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.X86.Avx2 + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.X86.AvxVnni + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.X86.Bmi1 + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.X86.Bmi2 + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.X86.Fma + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.X86.General + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.X86.Lzcnt + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.X86.Pclmulqdq + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.X86.Popcnt + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.X86.Regression + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.X86.Sse1 + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.X86.Sse2 + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.X86.Sse3 + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.X86.Sse41 + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.X86.Sse42 + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.X86.Ssse3 + $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll + + + + JIT.HardwareIntrinsics.X86.X86Base $(TestBinDir)JIT\HardwareIntrinsics\JIT.HardwareIntrinsics.XUnitWrapper.dll diff --git a/src/tests/Common/wasm-test-runner/WasmTestRunner.proj b/src/tests/Common/wasm-test-runner/WasmTestRunner.proj index ab92b77866e3c3..81ef252829f2f1 100644 --- a/src/tests/Common/wasm-test-runner/WasmTestRunner.proj +++ b/src/tests/Common/wasm-test-runner/WasmTestRunner.proj @@ -23,7 +23,7 @@ $(TestAssemblyFileName) $(AppDir) - $(CORE_ROOT)\runtime-test\runtime-test.js + $(CORE_ROOT)\runtime-test\test-main.js true true true diff --git a/src/tests/CoreMangLib/system/delegate/VSD/OpenDelegate.csproj b/src/tests/CoreMangLib/system/delegate/VSD/OpenDelegate.csproj index 249c25e8d7634d..73107e770d30f6 100644 --- a/src/tests/CoreMangLib/system/delegate/VSD/OpenDelegate.csproj +++ b/src/tests/CoreMangLib/system/delegate/VSD/OpenDelegate.csproj @@ -1,5 +1,6 @@ + exe true 1 diff --git a/src/tests/CoreMangLib/system/delegate/generics/NullableTypes.csproj b/src/tests/CoreMangLib/system/delegate/generics/NullableTypes.csproj deleted file mode 100644 index a33928e49a4346..00000000000000 --- a/src/tests/CoreMangLib/system/delegate/generics/NullableTypes.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - Library - true - SharedLibrary - 1 - - - - - - - - diff --git a/src/tests/CoreMangLib/system/delegate/generics/nullabletypes.cs b/src/tests/CoreMangLib/system/delegate/generics/nullabletypes.cs deleted file mode 100644 index cf5a4799bd7e58..00000000000000 --- a/src/tests/CoreMangLib/system/delegate/generics/nullabletypes.cs +++ /dev/null @@ -1,348 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -#pragma warning disable 414 - -using System; -using System.Globalization; - -//Define all the standard delegates to be used -public delegate int iDi(int i, out string m); -public delegate int iDNi(int? i, out string m); -public delegate int iDI(I i, out string m); -public delegate int iDS(S s, out string m); -public delegate int iDNS(S? s, out string m); -public delegate int IDo(object o, out string m); -public delegate S SDi(int i, out string m); -public delegate S? NSDi(int i, out string m); -public delegate I IDi(int i, out string m); -public delegate int iDo(object o, out string m); -public delegate object oDi(int i, out string m); - -//Define all the open instance delegates to be used -public delegate int iDi(T t,int i, out string m); -public delegate int iDNi(T t,int? i, out string m); -public delegate int iDI(T t,I i, out string m); -public delegate int iDS(T t,S s, out string m); -public delegate int iDNS(T t,S? s, out string m); -public delegate int iDo(T t,object o, out string m); -public delegate S SDi(T t, int i, out string m); -public delegate S? NSDi(T t, int i, out string m); -public delegate I IDi(T t, int i, out string m); -public delegate int IDo(T t,object o, out string m); -public delegate object oDi(T t, int i, out string m); - -//Define all the closed static delegates to be used -public delegate T tD(out string m); -public delegate T tDi(int i, out string m); - -//@TODO - Are G and G equivalent? Can you even specify a G?? -//@TODO - Can you close over an out or ref parameter??? -//@TODO - another case, ex. close this method static M(int? i) over a null argument -//@TODO - A delegate declared as D(S?) used as an open instance to bind to a method on S????? Probably just doesn't work as the type isn't really an S, might work to bind to methods on the Nullable type, but that would be expected. Should check it to be sure. - -//Define the custom types to be used -public interface I{ - bool Equals(int i); -} - -public struct S : I{ - //Dummy fields to extend this value type and stress - //the stub. We really don't care that they're not used. - private double f1,f2,f3,f4,f5,f6,f7,f8,f9,f10; - - //An assignable field to be checked for correctness - public int value; - - public S(int i){ - f1=0;f2=0;f3=0;f4=0;f5=0;f6=0;f7=0;f8=0;f9=0;f10=0;//@BUGBUG - It puzzles me to no end why there is a compiler error if I don't initialize these in the constructor - value = i; - } - - public bool Equals(int i){ - return (value==i); - } - - //For later cleanliness - public static bool operator ==(S s, int i){ - return s.Equals(i); - } - - public static bool operator !=(S s, int i){ - return !s.Equals(i); - } - - public override bool Equals(object o){ - throw new Exception("this just exists to stop a compiler warning, don't call it"); - } - public override int GetHashCode(){ - throw new Exception("this just exists to stop a compiler warning, don't call it"); - } -} - -//Define the various delegate target methods - -public class RefInst{ //Instance methods on a reference class - //The out parameters are a crude tag to verify which method - //was actually called. Necessary because the other functionality - //of the methods is pretty much identical - -#region Overloads for BindToMethodName ambiguity testing - //These should appear in order from most general to most - //specific or (@TODO) we should have additional tests that - //vary the method order. This is to confirm that any - //ambiguous matching logic in BindToMethodName isn't just - //settling for the first "match" it sees. There should - //be no ambiguity at all in matching. - - public int M(int? i, out string m){ - m = "one"; - if(i==null) - throw new ArgumentNullException(); - else - return (int)i; - } - - public int M(S? s, out string m){ - m = "two"; - if(s==null) - throw new ArgumentException(); - else - return ((S)s).value; - } - - public int M(I i, out string m){ - m = "three"; - if(i==null) - throw new ArgumentNullException(); - if(!(i is S)) - throw new ArgumentException(); - return ((S)i).value; - } - - public int M(object o, out string m){ - m = "four"; - if(o == null) - throw new ArgumentNullException(); - if(!(o is S)) - throw new ArgumentException(); - return ((S)o).value; - } - - public int M(S s, out string m){ - m = "five"; - return s.value; - } - - public int M(int i, out string m){ - m = "six"; - return i; - } -#endregion - -#region Non-overloaded methods to allow for (easier) explicit method selection - public int iMNi(int? i, out string m){ - m = "iMNi"; - if(i==null) - throw new ArgumentNullException(); - else - return (int)i; - } - - public int iMNS(S? s, out string m){ - m = "iMNS"; - if(s==null) - throw new ArgumentException(); - else - return ((S)s).value; - } - - public int iMI(I i, out string m){ - m = "iMI"; - if(i==null) - throw new ArgumentNullException(); - if(!(i is S)) - throw new ArgumentException(); - return ((S)i).value; - } - - public int iMo(object o, out string m){ - m = "iMo"; - if(o == null) - throw new ArgumentNullException(); - if(!(o is S)) - throw new ArgumentException(); - return ((S)o).value; - } - - public int iMS(S s, out string m){ - m = "iMS"; - return s.value; - } - - public int iMi(int i, out string m){ - m = "iMi"; - return i; - } -#endregion - - public S SMi(int i, out string m){ - m = "SMi"; - return new S(i); - } - - public S? NSMi(int i, out string m){ - m = "NSMi"; - return new S(i); - } - - public I IMi(int i, out string m){ - m = "IMi"; - return new S(i); - } - - public object oMi(int i, out string m){ - m = "oMi"; - return new S(i); - } -} - -public class RefStat{ //Static methods on a reference class - //The out parameters are a crude tag to verify which method - //was actually called. Necessary because the other functionality - //of the methods is pretty much identical - -#region Overloads for BindToMethodName ambiguity testing - //These should appear in order from most general to most - //specific or (@TODO) we should have additional tests that - //vary the method order. This is to confirm that any - //ambiguous matching logic in BindToMethodName isn't just - //settling for the first "match" it sees. There should - //be no ambiguity at all in matching. - - public static int M(int? i, out string m){ - m = "one"; - if(i==null) - throw new ArgumentNullException(); - else - return (int)i; - } - - public static int M(S? s, out string m){ - m = "two"; - if(s==null) - throw new ArgumentException(); - else - return ((S)s).value; - } - - public static int M(I i, out string m){ - m = "three"; - if(i==null) - throw new ArgumentNullException(); - if(!(i is S)) - throw new ArgumentException(); - return ((S)i).value; - } - - public static int M(object o, out string m){ - m = "four"; - if(o == null) - throw new ArgumentNullException(); - if(!(o is S)) - throw new ArgumentException(); - return ((S)o).value; - } - - public static int M(S s, out string m){ - m = "five"; - return s.value; - } - - public static int M(int i, out string m){ - m = "six"; - return i; - } -#endregion - -#region Non-overloaded methods to allow for (easier) explicit method selection - public static int iMNi(int? i, out string m){ - m = "iMNi"; - if(i==null) - throw new ArgumentNullException(); - else - return (int)i; - } - - public static int iMNS(S? s, out string m){ - m = "iMNS"; - if(s==null) - throw new ArgumentException(); - else - return ((S)s).value; - } - - public static int iMI(I i, out string m){ - m = "iMI"; - if(i==null) - throw new ArgumentNullException(); - if(!(i is S)) - throw new ArgumentException(); - return ((S)i).value; - } - - public static int iMo(object o, out string m){ - m = "iMo"; - if(o == null) - throw new ArgumentNullException(); - if(!(o is S)) - throw new ArgumentException(); - return ((S)o).value; - } - - public static int iMS(S s, out string m){ - m = "iMS"; - return s.value; - } - - public static int iMi(int i, out string m){ - m = "iMi"; - return i; - } -#endregion - - public static S SMi(int i, out string m){ - m = "SMi"; - return new S(i); - } - - public static S? NSMi(int i, out string m){ - m = "NSMi"; - return new S(i); - } - - public static I IMi(int i, out string m){ - m = "IMi"; - return new S(i); - } - - public static object oMi(int i, out string m){ - m = "oMi"; - return new S(i); - } -} - -public struct ValInst{ //Instance methods on a value class -} - -public struct ValStat{ //Static methods on a value class -} - -//Some reusable helper methods -public class Util{ - //Method to do quick culture invariant string comparisons (quick in the sense that I don't have to type of cultureinfo.invariantlsjflakjdlfjsldkjf 7000 times). - public static bool Equals(string s1, string s2){ - return String.Equals(s1, s2, StringComparison.Ordinal); - } -} - -#pragma warning restore diff --git a/src/tests/CoreMangLib/system/delegate/miscellaneous/Central.csproj b/src/tests/CoreMangLib/system/delegate/miscellaneous/Central.csproj deleted file mode 100644 index 0482a514e8d4cb..00000000000000 --- a/src/tests/CoreMangLib/system/delegate/miscellaneous/Central.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - Library - true - SharedLibrary - 1 - - - - - - - - diff --git a/src/tests/CoreMangLib/system/delegate/miscellaneous/central.cs b/src/tests/CoreMangLib/system/delegate/miscellaneous/central.cs deleted file mode 100644 index be997ac3e1dfdf..00000000000000 Binary files a/src/tests/CoreMangLib/system/delegate/miscellaneous/central.cs and /dev/null differ diff --git a/src/tests/Directory.Build.props b/src/tests/Directory.Build.props index 51cd548023ac78..12dbe872646f6c 100644 --- a/src/tests/Directory.Build.props +++ b/src/tests/Directory.Build.props @@ -3,7 +3,7 @@ Release - + @@ -179,4 +179,9 @@ /p:MSBuildEnableWorkloadResolver=false + + + true + Exe + diff --git a/src/tests/Directory.Build.targets b/src/tests/Directory.Build.targets index 26c8ae6aa3e631..a3aca72d338e58 100644 --- a/src/tests/Directory.Build.targets +++ b/src/tests/Directory.Build.targets @@ -11,7 +11,6 @@ - SharedLibrary BuildAndRun 0 @@ -81,7 +80,6 @@ <_WillCLRTestProjectBuild Condition="'$(BuildAllProjects)' != 'true'">true <_WillCLRTestProjectBuild Condition="'$(BuildAllProjects)' == 'true' And '$(CLRTestPriority)' <= '$(CLRTestPriorityToBuild)'">true <_WillCLRTestProjectBuild Condition="'$(CLRTestBuildAllTargets)' != 'allTargets' And '$(CLRTestTargetUnsupported)' == 'true'">false - <_WillCLRTestProjectBuild Condition="'$(ReferenceSystemPrivateCoreLib)' == 'true' and '$(RuntimeFlavor)' == 'mono'">false <_WillCLRTestProjectBuild Condition="'$(DisableProjectBuild)' == 'true'">false @@ -96,8 +94,6 @@ - - @@ -226,8 +222,7 @@ BeforeTargets="BeforeResolveReferences" > + Targets="GetLiveRefAssemblies"> @@ -240,7 +235,7 @@ + DependsOnTargets="ResolveLibrariesRefAssembliesFromLocalBuild"> @@ -256,10 +251,6 @@ $(BaseOutputPath)\packages\Common\test_dependencies\test_dependencies\project.assets.json - - - - true @@ -388,7 +379,7 @@ TargetDir="wasm-test-runner/"/> + + + + + + + + + + + + + + + + + + + true + + + + + + + diff --git a/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/ApplyUpdateReferencedAssembly/ApplyUpdateReferencedAssembly.csproj b/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/ApplyUpdateReferencedAssembly/ApplyUpdateReferencedAssembly.csproj index b32d3ba167d612..d7efb6b3e39b57 100644 --- a/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/ApplyUpdateReferencedAssembly/ApplyUpdateReferencedAssembly.csproj +++ b/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/ApplyUpdateReferencedAssembly/ApplyUpdateReferencedAssembly.csproj @@ -3,6 +3,7 @@ true deltascript.json library + SharedLibrary false true diff --git a/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/WebAssembly.Browser.HotReload.Test.csproj b/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/WebAssembly.Browser.HotReload.Test.csproj index d9dbaa2ebd4443..f3ca0161fc5fe6 100644 --- a/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/WebAssembly.Browser.HotReload.Test.csproj +++ b/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/WebAssembly.Browser.HotReload.Test.csproj @@ -6,9 +6,9 @@ true WasmTestOnBrowser 42 - runtime.js + main.js false - + diff --git a/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/index.html b/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/index.html index 7832e37351d5b7..8f85c8d7d8d48e 100644 --- a/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/index.html +++ b/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/index.html @@ -2,54 +2,41 @@ - - TESTS - - - - - - Result from Sample.Test.TestMeaning: - - + console.debug(`exit_code: ${exit_code}`); + set_exit_code(exit_code); + }, + }; + + + - + - - + \ No newline at end of file diff --git a/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/runtime.js b/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/main.js similarity index 72% rename from src/tests/FunctionalTests/WebAssembly/Browser/HotReload/runtime.js rename to src/tests/FunctionalTests/WebAssembly/Browser/HotReload/main.js index 065061d86b22d7..861ddd263cd843 100644 --- a/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/runtime.js +++ b/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/main.js @@ -4,20 +4,19 @@ "use strict"; var Module = { - config: null, configSrc: "./mono-config.json", - onConfigLoaded: function () { + onConfigLoaded: () => { MONO.config.environment_variables["DOTNET_MODIFIABLE_ASSEMBLIES"] = "debug"; }, - onDotNetReady: function () { + onDotNetReady: () => { try { App.init(); } catch (error) { - test_exit(1); + set_exit_code(1, error); throw (error); } }, - onAbort: function () { - test_exit(1); + onAbort: (error) => { + set_exit_code(1, error); }, }; diff --git a/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/WebAssembly.Browser.RuntimeConfig.Test.csproj b/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/WebAssembly.Browser.RuntimeConfig.Test.csproj index 35e9eec2cae877..d9c7984051cd39 100644 --- a/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/WebAssembly.Browser.RuntimeConfig.Test.csproj +++ b/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/WebAssembly.Browser.RuntimeConfig.Test.csproj @@ -3,7 +3,7 @@ true WasmTestOnBrowser 42 - runtime.js + main.js diff --git a/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/index.html b/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/index.html index 2b618eaf31cbd3..b8640040e73ac9 100644 --- a/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/index.html +++ b/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/index.html @@ -2,54 +2,41 @@ - - TESTS - - - - - - Result from Sample.Test.TestMeaning: - - + console.debug(`exit_code: ${exit_code}`); + set_exit_code(exit_code); + }, + }; + + + - + - - + \ No newline at end of file diff --git a/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/runtime.js b/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/main.js similarity index 71% rename from src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/runtime.js rename to src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/main.js index 5c388258c859af..88db9c67c1dd91 100644 --- a/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/runtime.js +++ b/src/tests/FunctionalTests/WebAssembly/Browser/RuntimeConfig/main.js @@ -4,17 +4,16 @@ "use strict"; var Module = { - config: null, configSrc: "./mono-config.json", - onDotNetReady: function () { + onDotNetReady: () => { try { App.init(); } catch (error) { - test_exit(1); + set_exit_code(1, error); throw (error); } }, - onAbort: function () { - test_exit(1); + onAbort: (error) => { + set_exit_code(1, error); }, }; diff --git a/src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.cs b/src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.cs index 03335e402f4ce0..57e26d9df8384a 100644 --- a/src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.cs +++ b/src/tests/Interop/ArrayMarshalling/SafeArray/SafeArrayTest.cs @@ -5,7 +5,7 @@ using System.Linq; using System.Threading; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; #pragma warning disable CS0612, CS0618 @@ -17,29 +17,29 @@ public static int Main() { var boolArray = new bool[] { true, false, true, false, false, true }; SafeArrayNative.XorBoolArray(boolArray, out var xorResult); - Assert.AreEqual(XorArray(boolArray), xorResult); + Assert.Equal(XorArray(boolArray), xorResult); var decimalArray = new decimal[] { 1.5M, 30.2M, 6432M, 12.5832M }; SafeArrayNative.MeanDecimalArray(decimalArray, out var meanDecimalValue); - Assert.AreEqual(decimalArray.Average(), meanDecimalValue); + Assert.Equal(decimalArray.Average(), meanDecimalValue); SafeArrayNative.SumCurrencyArray(decimalArray, out var sumCurrencyValue); - Assert.AreEqual(decimalArray.Sum(), sumCurrencyValue); + Assert.Equal(decimalArray.Sum(), sumCurrencyValue); var strings = new [] {"ABCDE", "12345", "Microsoft"}; var reversedStrings = strings.Select(str => Reverse(str)).ToArray(); var ansiTest = strings.ToArray(); SafeArrayNative.ReverseStringsAnsi(ansiTest); - Assert.AreAllEqual(reversedStrings, ansiTest); + AssertExtensions.CollectionEqual(reversedStrings, ansiTest); var unicodeTest = strings.ToArray(); SafeArrayNative.ReverseStringsUnicode(unicodeTest); - Assert.AreAllEqual(reversedStrings, unicodeTest); + AssertExtensions.CollectionEqual(reversedStrings, unicodeTest); var bstrTest = strings.ToArray(); SafeArrayNative.ReverseStringsBSTR(bstrTest); - Assert.AreAllEqual(reversedStrings, bstrTest); + AssertExtensions.CollectionEqual(reversedStrings, bstrTest); var blittableRecords = new SafeArrayNative.BlittableRecord[] { @@ -50,23 +50,23 @@ public static int Main() new SafeArrayNative.BlittableRecord { a = 9 }, new SafeArrayNative.BlittableRecord { a = 15 }, }; - Assert.AreAllEqual(blittableRecords, SafeArrayNative.CreateSafeArrayOfRecords(blittableRecords)); + AssertExtensions.CollectionEqual(blittableRecords, SafeArrayNative.CreateSafeArrayOfRecords(blittableRecords)); var nonBlittableRecords = boolArray.Select(b => new SafeArrayNative.NonBlittableRecord{ b = b }).ToArray(); - Assert.AreAllEqual(nonBlittableRecords, SafeArrayNative.CreateSafeArrayOfRecords(nonBlittableRecords)); + AssertExtensions.CollectionEqual(nonBlittableRecords, SafeArrayNative.CreateSafeArrayOfRecords(nonBlittableRecords)); var objects = new object[] { new object(), new object(), new object() }; SafeArrayNative.VerifyIUnknownArray(objects); SafeArrayNative.VerifyIDispatchArray(objects); var variantInts = new object[] {1, 2, 3, 4, 5, 6, 7, 8, 9}; - + SafeArrayNative.MeanVariantIntArray(variantInts, out var variantMean); - Assert.AreEqual(variantInts.OfType().Average(), variantMean); + Assert.Equal(variantInts.OfType().Average(), variantMean); var dates = new DateTime[] { new DateTime(2008, 5, 1), new DateTime(2010, 1, 1) }; SafeArrayNative.DistanceBetweenDates(dates, out var numDays); - Assert.AreEqual((dates[1] - dates[0]).TotalDays, numDays); + Assert.Equal((dates[1] - dates[0]).TotalDays, numDays); SafeArrayNative.XorBoolArrayInStruct( new SafeArrayNative.StructWithSafeArray @@ -75,7 +75,7 @@ public static int Main() }, out var structXor); - Assert.AreEqual(XorArray(boolArray), structXor); + Assert.Equal(XorArray(boolArray), structXor); } catch (Exception e) { diff --git a/src/tests/Interop/COM/Activator/Activator.csproj b/src/tests/Interop/COM/Activator/Activator.csproj index 87b0633ad30052..6090e01d90d5e8 100644 --- a/src/tests/Interop/COM/Activator/Activator.csproj +++ b/src/tests/Interop/COM/Activator/Activator.csproj @@ -1,14 +1,15 @@ Exe - - true true true + true + true + diff --git a/src/tests/Interop/COM/Activator/ActivatorBuiltInComDisabled.csproj b/src/tests/Interop/COM/Activator/ActivatorBuiltInComDisabled.csproj index b119bcc691df99..5414a400d23ab1 100644 --- a/src/tests/Interop/COM/Activator/ActivatorBuiltInComDisabled.csproj +++ b/src/tests/Interop/COM/Activator/ActivatorBuiltInComDisabled.csproj @@ -1,14 +1,15 @@ Exe - - true true true + true + true + diff --git a/src/tests/Interop/COM/Activator/ComActivationContext.cs b/src/tests/Interop/COM/Activator/ComActivationContext.cs new file mode 100644 index 00000000000000..9864107f694f5f --- /dev/null +++ b/src/tests/Interop/COM/Activator/ComActivationContext.cs @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Reflection; +using System.Runtime.InteropServices; + +namespace Activator +{ + [StructLayout(LayoutKind.Sequential)] + public partial struct ComActivationContext + { + public Guid ClassId; + public Guid InterfaceId; + public string AssemblyPath; + public string AssemblyName; + public string TypeName; + } +} diff --git a/src/tests/Interop/COM/Activator/Program.cs b/src/tests/Interop/COM/Activator/Program.cs index 04049e79c2a828..48bd0d5f13d1ef 100644 --- a/src/tests/Interop/COM/Activator/Program.cs +++ b/src/tests/Interop/COM/Activator/Program.cs @@ -1,20 +1,65 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; +using System.IO; +using System.Reflection; +using System.Runtime.InteropServices; -namespace Activator +using Internal.Runtime.InteropServices; +using TestLibrary; +using Xunit; + +namespace Internal.Runtime.InteropServices { - using Internal.Runtime.InteropServices; + [ComImport] + [ComVisible(false)] + [Guid("00000001-0000-0000-C000-000000000046")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public interface IClassFactory + { + void CreateInstance( + [MarshalAs(UnmanagedType.Interface)] object pUnkOuter, + ref Guid riid, + out IntPtr ppvObject); - using System; - using System.IO; - using System.Runtime.InteropServices; + void LockServer([MarshalAs(UnmanagedType.Bool)] bool fLock); + } +} - using TestLibrary; +sealed class ClassFactoryWrapper +{ + private static readonly MethodInfo IClassFactory_Create = typeof(object).Assembly.GetType("Internal.Runtime.InteropServices.IClassFactory").GetMethod("CreateInstance"); + private readonly object _obj; + + public ClassFactoryWrapper(object obj) + { + _obj = obj; + } - using Console = Internal.Console; + public void CreateInstance( + object pUnkOuter, + ref Guid riid, + out IntPtr ppvObject) + { + object[] args = new object[] { pUnkOuter, riid, null }; + IClassFactory_Create.Invoke(_obj, BindingFlags.DoNotWrapExceptions, binder: null, args, culture: null); + riid = (Guid)args[1]; + ppvObject = (IntPtr)args[2]; + } +} - class Program +namespace Activator +{ + unsafe class Program { + private static delegate* GetClassFactoryForTypeMethod = (delegate*)typeof(object).Assembly.GetType("Internal.Runtime.InteropServices.ComActivator", throwOnError: true).GetMethod("GetClassFactoryForType", BindingFlags.NonPublic | BindingFlags.Static).MethodHandle.GetFunctionPointer(); + private static delegate* ClassRegistrationScenarioForType = (delegate*)typeof(object).Assembly.GetType("Internal.Runtime.InteropServices.ComActivator", throwOnError: true).GetMethod("ClassRegistrationScenarioForType", BindingFlags.NonPublic | BindingFlags.Static).MethodHandle.GetFunctionPointer(); + + private static ClassFactoryWrapper GetClassFactoryForType(ComActivationContext context) + { + return new ClassFactoryWrapper(GetClassFactoryForTypeMethod(context)); + } + static void InvalidInterfaceRequest() { Console.WriteLine($"Running {nameof(InvalidInterfaceRequest)}..."); @@ -27,9 +72,8 @@ static void InvalidInterfaceRequest() { InterfaceId = notIClassFactory }; - ComActivator.GetClassFactoryForType(cxt); - }, - "Non-IClassFactory request should fail"); + GetClassFactoryForType(cxt); + }); } static void NonrootedAssemblyPath(bool builtInComDisabled) @@ -43,16 +87,16 @@ static void NonrootedAssemblyPath(bool builtInComDisabled) InterfaceId = typeof(IClassFactory).GUID, AssemblyPath = "foo.dll" }; - ComActivator.GetClassFactoryForType(cxt); + GetClassFactoryForType(cxt); }; if (!builtInComDisabled) { - Assert.Throws(action, "Non-root assembly path should not be valid"); + Assert.Throws(action); } else { - Assert.Throws(action, "Built-in COM has been disabled via a feature switch"); + Assert.Throws(action); } } @@ -69,18 +113,18 @@ static void ClassNotRegistered(bool builtInComDisabled) InterfaceId = typeof(IClassFactory).GUID, AssemblyPath = @"C:\foo.dll" }; - ComActivator.GetClassFactoryForType(cxt); + GetClassFactoryForType(cxt); }; if (!builtInComDisabled) { - COMException e = Assert.Throws(action, "Class should not be found"); + COMException e = Assert.Throws(action); const int CLASS_E_CLASSNOTAVAILABLE = unchecked((int)0x80040111); - Assert.AreEqual(CLASS_E_CLASSNOTAVAILABLE, e.HResult, "Unexpected HRESULT"); + Assert.Equal(CLASS_E_CLASSNOTAVAILABLE, e.HResult); } else { - Assert.Throws(action, "Built-in COM has been disabled via a feature switch"); + Assert.Throws(action); } } @@ -119,11 +163,11 @@ static void ValidateAssemblyIsolation(bool builtInComDisabled) if (builtInComDisabled) { Assert.Throws( - () => ComActivator.GetClassFactoryForType(cxt), "Built-in COM has been disabled via a feature switch"); + () => GetClassFactoryForType(cxt)); return; } - var factory = (IClassFactory)ComActivator.GetClassFactoryForType(cxt); + var factory = GetClassFactoryForType(cxt); IntPtr svrRaw; factory.CreateInstance(null, ref iid, out svrRaw); @@ -147,7 +191,7 @@ static void ValidateAssemblyIsolation(bool builtInComDisabled) TypeName = "ClassFromB" }; - var factory = (IClassFactory)ComActivator.GetClassFactoryForType(cxt); + var factory = GetClassFactoryForType(cxt); IntPtr svrRaw; factory.CreateInstance(null, ref iid, out svrRaw); @@ -156,7 +200,7 @@ static void ValidateAssemblyIsolation(bool builtInComDisabled) typeCFromAssemblyB = (Type)svr.GetTypeFromC(); } - Assert.AreNotEqual(typeCFromAssemblyA, typeCFromAssemblyB, "Types should be from different AssemblyLoadContexts"); + Assert.NotEqual(typeCFromAssemblyA, typeCFromAssemblyB); } static void ValidateUserDefinedRegistrationCallbacks() @@ -200,7 +244,7 @@ static void ValidateUserDefinedRegistrationCallbacks() TypeName = typeName }; - var factory = (IClassFactory)ComActivator.GetClassFactoryForType(cxt); + var factory = GetClassFactoryForType(cxt); IntPtr svrRaw; factory.CreateInstance(null, ref iid, out svrRaw); @@ -208,15 +252,15 @@ static void ValidateUserDefinedRegistrationCallbacks() Marshal.Release(svrRaw); var inst = (IValidateRegistrationCallbacks)svr; - Assert.IsFalse(inst.DidRegister()); - Assert.IsFalse(inst.DidUnregister()); + Assert.False(inst.DidRegister()); + Assert.False(inst.DidUnregister()); cxt.InterfaceId = Guid.Empty; - ComActivator.ClassRegistrationScenarioForType(cxt, register: true); - ComActivator.ClassRegistrationScenarioForType(cxt, register: false); + ClassRegistrationScenarioForType(cxt, true); + ClassRegistrationScenarioForType(cxt, false); - Assert.IsTrue(inst.DidRegister(), $"User-defined register function should have been called."); - Assert.IsTrue(inst.DidUnregister(), $"User-defined unregister function should have been called."); + Assert.True(inst.DidRegister(), $"User-defined register function should have been called."); + Assert.True(inst.DidUnregister(), $"User-defined unregister function should have been called."); } } @@ -239,7 +283,7 @@ static void ValidateUserDefinedRegistrationCallbacks() TypeName = typename }; - var factory = (IClassFactory)ComActivator.GetClassFactoryForType(cxt); + var factory = GetClassFactoryForType(cxt); IntPtr svrRaw; factory.CreateInstance(null, ref iid, out svrRaw); @@ -251,26 +295,26 @@ static void ValidateUserDefinedRegistrationCallbacks() bool exceptionThrown = false; try { - ComActivator.ClassRegistrationScenarioForType(cxt, register: true); + ClassRegistrationScenarioForType(cxt, true); } catch { exceptionThrown = true; } - Assert.IsTrue(exceptionThrown || !inst.DidRegister()); + Assert.True(exceptionThrown || !inst.DidRegister()); exceptionThrown = false; try { - ComActivator.ClassRegistrationScenarioForType(cxt, register: false); + ClassRegistrationScenarioForType(cxt, false); } catch { exceptionThrown = true; } - Assert.IsTrue(exceptionThrown || !inst.DidUnregister()); + Assert.True(exceptionThrown || !inst.DidUnregister()); } } } diff --git a/src/tests/Interop/COM/Activator/Servers/AssemblyA.csproj b/src/tests/Interop/COM/Activator/Servers/AssemblyA.csproj index f45dd134b5aba6..e89acacf3bf393 100644 --- a/src/tests/Interop/COM/Activator/Servers/AssemblyA.csproj +++ b/src/tests/Interop/COM/Activator/Servers/AssemblyA.csproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/COM/Activator/Servers/AssemblyB.csproj b/src/tests/Interop/COM/Activator/Servers/AssemblyB.csproj index 06f18447601fc7..e167fbfa6fb068 100644 --- a/src/tests/Interop/COM/Activator/Servers/AssemblyB.csproj +++ b/src/tests/Interop/COM/Activator/Servers/AssemblyB.csproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/COM/Activator/Servers/AssemblyC.csproj b/src/tests/Interop/COM/Activator/Servers/AssemblyC.csproj index 98381754613dd1..77484f4e95cbb3 100644 --- a/src/tests/Interop/COM/Activator/Servers/AssemblyC.csproj +++ b/src/tests/Interop/COM/Activator/Servers/AssemblyC.csproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/COM/Activator/Servers/AssemblyContracts.csproj b/src/tests/Interop/COM/Activator/Servers/AssemblyContracts.csproj index fb872e9728d7cf..92f15b7cdc6b8e 100644 --- a/src/tests/Interop/COM/Activator/Servers/AssemblyContracts.csproj +++ b/src/tests/Interop/COM/Activator/Servers/AssemblyContracts.csproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/COM/ComWrappers/API/Program.cs b/src/tests/Interop/COM/ComWrappers/API/Program.cs index 98f09ac4d00a70..99a2094c80b912 100644 --- a/src/tests/Interop/COM/ComWrappers/API/Program.cs +++ b/src/tests/Interop/COM/ComWrappers/API/Program.cs @@ -10,7 +10,7 @@ namespace ComWrappersTests using System.Runtime.InteropServices; using ComWrappersTests.Common; - using TestLibrary; + using Xunit; class Program { @@ -54,7 +54,7 @@ protected override object CreateObject(IntPtr externalComObject, CreateObjectFla var iid = typeof(ITrackerObject).GUID; IntPtr iTrackerComObject; int hr = Marshal.QueryInterface(externalComObject, ref iid, out iTrackerComObject); - Assert.AreEqual(0, hr); + Assert.Equal(0, hr); return new ITrackerObjectWrapper(iTrackerComObject); } @@ -72,9 +72,9 @@ public static void ValidateIUnknownImpls() ComWrappers.GetIUnknownImpl(out IntPtr fpQueryInterface, out IntPtr fpAddRef, out IntPtr fpRelease); - Assert.AreNotEqual(fpQueryInterface, IntPtr.Zero); - Assert.AreNotEqual(fpAddRef, IntPtr.Zero); - Assert.AreNotEqual(fpRelease, IntPtr.Zero); + Assert.NotEqual(fpQueryInterface, IntPtr.Zero); + Assert.NotEqual(fpAddRef, IntPtr.Zero); + Assert.NotEqual(fpRelease, IntPtr.Zero); } } @@ -100,27 +100,27 @@ static void ValidateComInterfaceCreation() // Allocate a wrapper for the object IntPtr comWrapper = wrappers.GetOrCreateComInterfaceForObject(testObj, CreateComInterfaceFlags.TrackerSupport); - Assert.AreNotEqual(IntPtr.Zero, comWrapper); + Assert.NotEqual(IntPtr.Zero, comWrapper); // Get a wrapper for an object and verify it is the same one. IntPtr comWrapperMaybe = wrappers.GetOrCreateComInterfaceForObject(testObj, CreateComInterfaceFlags.TrackerSupport); - Assert.AreEqual(comWrapper, comWrapperMaybe); + Assert.Equal(comWrapper, comWrapperMaybe); // Release the wrapper int count = Marshal.Release(comWrapper); - Assert.AreEqual(1, count); + Assert.Equal(1, count); count = Marshal.Release(comWrapperMaybe); - Assert.AreEqual(0, count); + Assert.Equal(0, count); // Create a new wrapper IntPtr comWrapperNew = wrappers.GetOrCreateComInterfaceForObject(testObj, CreateComInterfaceFlags.TrackerSupport); // Once a wrapper is created for a managed object it is always present - Assert.AreEqual(comWrapperNew, comWrapper); + Assert.Equal(comWrapperNew, comWrapper); // Release the new wrapper count = Marshal.Release(comWrapperNew); - Assert.AreEqual(0, count); + Assert.Equal(0, count); } static void ValidateComInterfaceCreationRoundTrip() @@ -133,14 +133,14 @@ static void ValidateComInterfaceCreationRoundTrip() // Allocate a wrapper for the object IntPtr comWrapper = wrappers.GetOrCreateComInterfaceForObject(testObj, CreateComInterfaceFlags.None); - Assert.AreNotEqual(IntPtr.Zero, comWrapper); + Assert.NotEqual(IntPtr.Zero, comWrapper); var testObjUnwrapped = wrappers.GetOrCreateObjectForComInstance(comWrapper, CreateObjectFlags.Unwrap); - Assert.AreEqual(testObj, testObjUnwrapped); + Assert.Equal(testObj, testObjUnwrapped); // Release the wrapper int count = Marshal.Release(comWrapper); - Assert.AreEqual(0, count); + Assert.Equal(0, count); } static void ValidateFallbackQueryInterface() @@ -163,17 +163,17 @@ static void ValidateFallbackQueryInterface() var anyGuid = new Guid("1E42439C-DCB5-4701-ACBD-87FE92E785DE"); testObj.ICustomQueryInterface_GetInterfaceIID = anyGuid; int hr = Marshal.QueryInterface(comWrapper, ref anyGuid, out result); - Assert.AreEqual(0, hr); - Assert.AreEqual(testObj.ICustomQueryInterface_GetInterfaceResult, result); + Assert.Equal(0, hr); + Assert.Equal(testObj.ICustomQueryInterface_GetInterfaceResult, result); var anyGuid2 = new Guid("7996D0F9-C8DD-4544-B708-0F75C6FF076F"); hr = Marshal.QueryInterface(comWrapper, ref anyGuid2, out result); const int E_NOINTERFACE = unchecked((int)0x80004002); - Assert.AreEqual(E_NOINTERFACE, hr); - Assert.AreEqual(IntPtr.Zero, result); + Assert.Equal(E_NOINTERFACE, hr); + Assert.Equal(IntPtr.Zero, result); int count = Marshal.Release(comWrapper); - Assert.AreEqual(0, count); + Assert.Equal(0, count); } static void ValidateCreateObjectCachingScenario() @@ -187,13 +187,13 @@ static void ValidateCreateObjectCachingScenario() var trackerObj1 = (ITrackerObjectWrapper)cw.GetOrCreateObjectForComInstance(trackerObjRaw, CreateObjectFlags.TrackerObject); var trackerObj2 = (ITrackerObjectWrapper)cw.GetOrCreateObjectForComInstance(trackerObjRaw, CreateObjectFlags.TrackerObject); - Assert.AreEqual(trackerObj1, trackerObj2); + Assert.Equal(trackerObj1, trackerObj2); // Ownership has been transferred to the wrapper. Marshal.Release(trackerObjRaw); var trackerObj3 = (ITrackerObjectWrapper)cw.GetOrCreateObjectForComInstance(trackerObjRaw, CreateObjectFlags.TrackerObject | CreateObjectFlags.UniqueInstance); - Assert.AreNotEqual(trackerObj1, trackerObj3); + Assert.NotEqual(trackerObj1, trackerObj3); } static void ValidateWrappersInstanceIsolation() @@ -208,15 +208,15 @@ static void ValidateWrappersInstanceIsolation() // Allocate a wrapper for the object IntPtr comWrapper1 = cw1.GetOrCreateComInterfaceForObject(testObj, CreateComInterfaceFlags.TrackerSupport); IntPtr comWrapper2 = cw2.GetOrCreateComInterfaceForObject(testObj, CreateComInterfaceFlags.TrackerSupport); - Assert.AreNotEqual(comWrapper1, IntPtr.Zero); - Assert.AreNotEqual(comWrapper2, IntPtr.Zero); - Assert.AreNotEqual(comWrapper1, comWrapper2); + Assert.NotEqual(comWrapper1, IntPtr.Zero); + Assert.NotEqual(comWrapper2, IntPtr.Zero); + Assert.NotEqual(comWrapper1, comWrapper2); IntPtr comWrapper3 = cw1.GetOrCreateComInterfaceForObject(testObj, CreateComInterfaceFlags.TrackerSupport); IntPtr comWrapper4 = cw2.GetOrCreateComInterfaceForObject(testObj, CreateComInterfaceFlags.TrackerSupport); - Assert.AreNotEqual(comWrapper3, comWrapper4); - Assert.AreEqual(comWrapper1, comWrapper3); - Assert.AreEqual(comWrapper2, comWrapper4); + Assert.NotEqual(comWrapper3, comWrapper4); + Assert.Equal(comWrapper1, comWrapper3); + Assert.Equal(comWrapper2, comWrapper4); Marshal.Release(comWrapper1); Marshal.Release(comWrapper2); @@ -229,13 +229,13 @@ static void ValidateWrappersInstanceIsolation() // Create objects for the COM instance var trackerObj1 = (ITrackerObjectWrapper)cw1.GetOrCreateObjectForComInstance(trackerObjRaw, CreateObjectFlags.TrackerObject); var trackerObj2 = (ITrackerObjectWrapper)cw2.GetOrCreateObjectForComInstance(trackerObjRaw, CreateObjectFlags.TrackerObject); - Assert.AreNotEqual(trackerObj1, trackerObj2); + Assert.NotEqual(trackerObj1, trackerObj2); var trackerObj3 = (ITrackerObjectWrapper)cw1.GetOrCreateObjectForComInstance(trackerObjRaw, CreateObjectFlags.TrackerObject); var trackerObj4 = (ITrackerObjectWrapper)cw2.GetOrCreateObjectForComInstance(trackerObjRaw, CreateObjectFlags.TrackerObject); - Assert.AreNotEqual(trackerObj3, trackerObj4); - Assert.AreEqual(trackerObj1, trackerObj3); - Assert.AreEqual(trackerObj2, trackerObj4); + Assert.NotEqual(trackerObj3, trackerObj4); + Assert.Equal(trackerObj1, trackerObj3); + Assert.Equal(trackerObj2, trackerObj4); Marshal.Release(trackerObjRaw); } @@ -253,12 +253,12 @@ static void ValidatePrecreatedExternalWrapper() var iid = typeof(ITrackerObject).GUID; IntPtr iTestComObject; int hr = Marshal.QueryInterface(trackerObjRaw, ref iid, out iTestComObject); - Assert.AreEqual(0, hr); + Assert.Equal(0, hr); var nativeWrapper = new ITrackerObjectWrapper(iTestComObject); // Register wrapper, but supply the wrapper. var nativeWrapper2 = (ITrackerObjectWrapper)cw.GetOrRegisterObjectForComInstance(trackerObjRaw, CreateObjectFlags.TrackerObject, nativeWrapper); - Assert.AreEqual(nativeWrapper, nativeWrapper2); + Assert.Equal(nativeWrapper, nativeWrapper2); // Ownership has been transferred to the wrapper. Marshal.Release(trackerObjRaw); @@ -300,12 +300,12 @@ static void ValidateExternalWrapperCacheCleanUp() // We are using a tracking resurrection WeakReference so we should be able // to get back the objects as they are all continually re-registering for Finalization. - Assert.IsTrue(weakRef1.TryGetTarget(out ITrackerObjectWrapper wrapper1)); - Assert.IsTrue(weakRef2.TryGetTarget(out ITrackerObjectWrapper wrapper2)); + Assert.True(weakRef1.TryGetTarget(out ITrackerObjectWrapper wrapper1)); + Assert.True(weakRef2.TryGetTarget(out ITrackerObjectWrapper wrapper2)); // Check that the two wrappers aren't equal, meaning we created a new wrapper since // the first wrapper was removed from the internal cache. - Assert.AreNotEqual(wrapper1, wrapper2); + Assert.NotEqual(wrapper1, wrapper2); // Let the wrappers Finalize. wrapper1.ReregisterForFinalize = false; @@ -317,7 +317,7 @@ static WeakReference CreateAndRegisterWrapper(ComWrappers var iid = typeof(ITrackerObject).GUID; IntPtr iTestComObject; int hr = Marshal.QueryInterface(trackerObjRaw, ref iid, out iTestComObject); - Assert.AreEqual(0, hr); + Assert.Equal(0, hr); var nativeWrapper = new ITrackerObjectWrapper(iTestComObject); nativeWrapper = (ITrackerObjectWrapper)cw.GetOrRegisterObjectForComInstance(trackerObjRaw, CreateObjectFlags.None, nativeWrapper); @@ -375,7 +375,7 @@ public enum FailureMode case FailureMode.ThrowException: throw new Exception() { HResult = ExceptionErrorCode }; default: - Assert.Fail("Invalid failure mode"); + Assert.True(false, "Invalid failure mode"); throw new Exception("UNREACHABLE"); } } @@ -389,7 +389,7 @@ protected override object CreateObject(IntPtr externalComObject, CreateObjectFla case FailureMode.ThrowException: throw new Exception() { HResult = ExceptionErrorCode }; default: - Assert.Fail("Invalid failure mode"); + Assert.True(false, "Invalid failure mode"); throw new Exception("UNREACHABLE"); } } @@ -420,7 +420,7 @@ static void ValidateBadComWrapperImpl() } catch (Exception e) { - Assert.AreEqual(BadComWrappers.ExceptionErrorCode, e.HResult); + Assert.Equal(BadComWrappers.ExceptionErrorCode, e.HResult); } IntPtr trackerObjRaw = MockReferenceTrackerRuntime.CreateTrackerObject(); @@ -439,7 +439,7 @@ static void ValidateBadComWrapperImpl() } catch (Exception e) { - Assert.AreEqual(BadComWrappers.ExceptionErrorCode, e.HResult); + Assert.Equal(BadComWrappers.ExceptionErrorCode, e.HResult); } Marshal.Release(trackerObjRaw); @@ -475,11 +475,11 @@ static void ValidateRuntimeTrackerScenario() Marshal.Release(testWrapper); } - Assert.IsTrue(testWrapperIds.Count <= Test.InstanceCount); + Assert.True(testWrapperIds.Count <= Test.InstanceCount); ForceGC(); - Assert.IsTrue(testWrapperIds.Count <= Test.InstanceCount); + Assert.True(testWrapperIds.Count <= Test.InstanceCount); // Remove the managed object ref from the native object. foreach (int id in testWrapperIds) @@ -518,7 +518,7 @@ static void ValidateQueryInterfaceAfterManagedObjectCollected() // The COM reference count should be 0 and indicates to the GC the managed object // can be collected. refCount = Marshal.Release(testWrapper); - Assert.AreEqual(0, refCount); + Assert.Equal(0, refCount); } ForceGC(); @@ -532,11 +532,11 @@ static void ValidateQueryInterfaceAfterManagedObjectCollected() int hr = Marshal.QueryInterface(refTrackerTarget, ref iid, out iTestComObject); const int COR_E_ACCESSING_CCW = unchecked((int)0x80131544); - Assert.AreEqual(COR_E_ACCESSING_CCW, hr); + Assert.Equal(COR_E_ACCESSING_CCW, hr); // Release the IReferenceTrackerTarget instance. refCount = MockReferenceTrackerRuntime.TrackerTarget_ReleaseFromReferenceTracker(refTrackerTarget); - Assert.AreEqual(0, refCount); + Assert.Equal(0, refCount); static IntPtr CreateWrapper(TestComWrappers cw) { @@ -582,8 +582,8 @@ static void ValidateAggregationWithComObject() ForceGC(); // Validate all instances were cleaned up - Assert.IsFalse(weakRef.TryGetTarget(out _)); - Assert.AreEqual(0, allocTracker.GetCount()); + Assert.False(weakRef.TryGetTarget(out _)); + Assert.Equal(0, allocTracker.GetCount()); } static void ValidateAggregationWithReferenceTrackerObject() @@ -597,13 +597,13 @@ static void ValidateAggregationWithReferenceTrackerObject() ForceGC(); // Validate all instances were cleaned up. - Assert.IsFalse(weakRef.TryGetTarget(out _)); + Assert.False(weakRef.TryGetTarget(out _)); // Reference counter cleanup requires additional GCs since the Finalizer is used // to clean up the Reference Tracker runtime references. ForceGC(); - Assert.AreEqual(0, allocTracker.GetCount()); + Assert.Equal(0, allocTracker.GetCount()); } static int Main(string[] doNotUse) diff --git a/src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.Marshalling.cs b/src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.Marshalling.cs index 1738dbc08affca..bef5f1317497c4 100644 --- a/src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.Marshalling.cs +++ b/src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.Marshalling.cs @@ -7,6 +7,7 @@ namespace ComWrappersTests.GlobalInstance using ComWrappersTests.Common; using TestLibrary; + using Xunit; partial class Program { @@ -15,7 +16,7 @@ private static void ValidateNotRegisteredForTrackerSupport() Console.WriteLine($"Running {nameof(ValidateNotRegisteredForTrackerSupport)}..."); int hr = MockReferenceTrackerRuntime.Trigger_NotifyEndOfReferenceTrackingOnThread(); - Assert.AreNotEqual(GlobalComWrappers.ReleaseObjectsCallAck, hr); + Assert.NotEqual(GlobalComWrappers.ReleaseObjectsCallAck, hr); } static int Main(string[] doNotUse) diff --git a/src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.TrackerSupport.cs b/src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.TrackerSupport.cs index dd8ea4f5f3e858..f1f45b29896d70 100644 --- a/src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.TrackerSupport.cs +++ b/src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.TrackerSupport.cs @@ -8,6 +8,7 @@ namespace ComWrappersTests.GlobalInstance using ComWrappersTests.Common; using TestLibrary; + using Xunit; partial class Program { @@ -17,11 +18,11 @@ private static void ValidateNotRegisteredForMarshalling() var testObj = new Test(); IntPtr comWrapper1 = Marshal.GetIUnknownForObject(testObj); - Assert.IsNull(GlobalComWrappers.Instance.LastComputeVtablesObject, "ComWrappers instance should not have been called"); + Assert.Null(GlobalComWrappers.Instance.LastComputeVtablesObject); IntPtr trackerObjRaw = MockReferenceTrackerRuntime.CreateTrackerObject(); object objWrapper = Marshal.GetObjectForIUnknown(trackerObjRaw); - Assert.IsFalse(objWrapper is FakeWrapper, $"ComWrappers instance should not have been called"); + Assert.False(objWrapper is FakeWrapper, $"ComWrappers instance should not have been called"); } static int Main(string[] doNotUse) diff --git a/src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.cs b/src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.cs index 38c25329315968..d07a0adc89c67c 100644 --- a/src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.cs +++ b/src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.cs @@ -10,6 +10,7 @@ namespace ComWrappersTests.GlobalInstance using ComWrappersTests.Common; using TestLibrary; + using Xunit; partial class Program { @@ -173,7 +174,7 @@ protected override void ReleaseObjects(IEnumerable objects) { foreach (object o in objects) { - Assert.IsNotNull(o); + Assert.NotNull(o); } throw new Exception() { HResult = ReleaseObjectsCallAck }; @@ -235,14 +236,14 @@ private static void ValidateRegisterForMarshalling() () => { ComWrappers.RegisterForMarshalling(wrappers1); - }, "Should not be able to re-register for global ComWrappers"); + }); var wrappers2 = new GlobalComWrappers(); Assert.Throws( () => { ComWrappers.RegisterForMarshalling(wrappers2); - }, "Should not be able to reset for global ComWrappers"); + }); } private static void ValidateRegisterForTrackerSupport() @@ -255,14 +256,14 @@ private static void ValidateRegisterForTrackerSupport() () => { ComWrappers.RegisterForTrackerSupport(wrappers1); - }, "Should not be able to re-register for global ComWrappers"); + }); var wrappers2 = new GlobalComWrappers(); Assert.Throws( () => { ComWrappers.RegisterForTrackerSupport(wrappers2); - }, "Should not be able to reset for global ComWrappers"); + }); } private static void ValidateMarshalAPIs(bool validateUseRegistered) @@ -277,11 +278,11 @@ private static void ValidateMarshalAPIs(bool validateUseRegistered) var testObj = new Test(); IntPtr comWrapper1 = Marshal.GetIUnknownForObject(testObj); - Assert.AreNotEqual(IntPtr.Zero, comWrapper1); - Assert.AreEqual(testObj, registeredWrapper.LastComputeVtablesObject, "Registered ComWrappers instance should have been called"); + Assert.NotEqual(IntPtr.Zero, comWrapper1); + Assert.Equal(testObj, registeredWrapper.LastComputeVtablesObject); IntPtr comWrapper2 = Marshal.GetIUnknownForObject(testObj); - Assert.AreEqual(comWrapper1, comWrapper2); + Assert.Equal(comWrapper1, comWrapper2); Marshal.Release(comWrapper1); Marshal.Release(comWrapper2); @@ -294,29 +295,29 @@ private static void ValidateMarshalAPIs(bool validateUseRegistered) { var dispatchObj = new TestEx(IID_IDISPATCH); IntPtr dispatchWrapper = Marshal.GetIDispatchForObject(dispatchObj); - Assert.AreNotEqual(IntPtr.Zero, dispatchWrapper); - Assert.AreEqual(dispatchObj, registeredWrapper.LastComputeVtablesObject, "Registered ComWrappers instance should have been called"); + Assert.NotEqual(IntPtr.Zero, dispatchWrapper); + Assert.Equal(dispatchObj, registeredWrapper.LastComputeVtablesObject); Console.WriteLine($" -- Validate Marshal.GetIDispatchForObject != Marshal.GetIUnknownForObject..."); IntPtr unknownWrapper = Marshal.GetIUnknownForObject(dispatchObj); - Assert.AreNotEqual(IntPtr.Zero, unknownWrapper); - Assert.AreNotEqual(unknownWrapper, dispatchWrapper); + Assert.NotEqual(IntPtr.Zero, unknownWrapper); + Assert.NotEqual(unknownWrapper, dispatchWrapper); } Console.WriteLine($" -- Validate Marshal.GetObjectForIUnknown..."); IntPtr trackerObjRaw = MockReferenceTrackerRuntime.CreateTrackerObject(); object objWrapper1 = Marshal.GetObjectForIUnknown(trackerObjRaw); - Assert.AreEqual(validateUseRegistered, objWrapper1 is FakeWrapper, $"GetObjectForIUnknown should{(validateUseRegistered ? string.Empty : "not")} have returned {nameof(FakeWrapper)} instance"); + Assert.Equal(validateUseRegistered, objWrapper1 is FakeWrapper); object objWrapper2 = Marshal.GetObjectForIUnknown(trackerObjRaw); - Assert.AreEqual(objWrapper1, objWrapper2); + Assert.Equal(objWrapper1, objWrapper2); Console.WriteLine($" -- Validate Marshal.GetUniqueObjectForIUnknown..."); object objWrapper3 = Marshal.GetUniqueObjectForIUnknown(trackerObjRaw); - Assert.AreEqual(validateUseRegistered, objWrapper3 is FakeWrapper, $"GetObjectForIUnknown should{(validateUseRegistered ? string.Empty : "not")} have returned {nameof(FakeWrapper)} instance"); + Assert.Equal(validateUseRegistered, objWrapper3 is FakeWrapper); - Assert.AreNotEqual(objWrapper1, objWrapper3); + Assert.NotEqual(objWrapper1, objWrapper3); Marshal.Release(trackerObjRaw); } @@ -331,7 +332,7 @@ private static void ValidatePInvokes(bool validateUseRegistered) Console.WriteLine($" -- Validate MarshalAs IUnknown..."); ValidateInterfaceMarshaler(MarshalInterface.UpdateTestObjectAsIUnknown, shouldSucceed: validateUseRegistered); object obj = MarshalInterface.CreateTrackerObjectAsIUnknown(); - Assert.AreEqual(validateUseRegistered, obj is FakeWrapper, $"Should{(validateUseRegistered ? string.Empty : "not")} have returned {nameof(FakeWrapper)} instance"); + Assert.Equal(validateUseRegistered, obj is FakeWrapper); if (validateUseRegistered) { @@ -347,7 +348,7 @@ private static void ValidatePInvokes(bool validateUseRegistered) Assert.Throws(() => MarshalInterface.CreateTrackerObjectWrongType()); FakeWrapper wrapper = MarshalInterface.CreateTrackerObjectAsInterface(); - Assert.IsNotNull(wrapper, $"Should have returned {nameof(FakeWrapper)} instance"); + Assert.NotNull(wrapper); } } @@ -362,16 +363,16 @@ private static void ValidateInterfaceMarshaler(UpdateTestObject func, bool T retObj; int hr = func(testObj as T, value, out retObj); - Assert.AreEqual(testObj, GlobalComWrappers.Instance.LastComputeVtablesObject, "Registered ComWrappers instance should have been called"); + Assert.Equal(testObj, GlobalComWrappers.Instance.LastComputeVtablesObject); if (shouldSucceed) { - Assert.IsTrue(retObj is Test); - Assert.AreEqual(value, testObj.GetValue()); - Assert.AreEqual(testObj, retObj); + Assert.True(retObj is Test); + Assert.Equal(value, testObj.GetValue()); + Assert.Equal(testObj, retObj); } else { - Assert.AreEqual(E_NOINTERFACE, hr); + Assert.Equal(E_NOINTERFACE, hr); } } @@ -394,11 +395,11 @@ private static void ValidateNativeServerActivation() Type t= Type.GetTypeFromCLSID(Guid.Parse(Server.Contract.Guids.DispatchTesting)); var server = Activator.CreateInstance(t); - Assert.AreEqual(returnValid, server is FakeWrapper, $"Should{(returnValid ? string.Empty : "not")} have returned {nameof(FakeWrapper)} instance"); + Assert.Equal(returnValid, server is FakeWrapper); IntPtr ptr = Marshal.GetIUnknownForObject(server); var obj = Marshal.GetObjectForIUnknown(ptr); - Assert.AreEqual(server, obj); + Assert.Equal(server, obj); } private static void ValidateManagedServerActivation() @@ -414,14 +415,14 @@ private static void ValidateManagedServerActivation() { Type t = Type.GetTypeFromCLSID(Guid.Parse(Server.Contract.Guids.ConsumeNETServerTesting)); var server = Activator.CreateInstance(t); - Assert.AreEqual(returnValid, server is FakeWrapper, $"Should{(returnValid ? string.Empty : "not")} have returned {nameof(FakeWrapper)} instance"); + Assert.Equal(returnValid, server is FakeWrapper); object serverUnwrapped = GlobalComWrappers.Instance.LastComputeVtablesObject; - Assert.AreEqual(ManagedServerTypeName, serverUnwrapped.GetType().Name); + Assert.Equal(ManagedServerTypeName, serverUnwrapped.GetType().Name); IntPtr ptr = Marshal.GetIUnknownForObject(server); var obj = Marshal.GetObjectForIUnknown(ptr); - Assert.AreEqual(server, obj); - Assert.AreEqual(returnValid, obj is FakeWrapper, $"Should{(returnValid ? string.Empty : "not")} have returned {nameof(FakeWrapper)} instance"); + Assert.Equal(server, obj); + Assert.Equal(returnValid, obj is FakeWrapper); serverUnwrapped.GetType().GetMethod("NotEqualByRCW").Invoke(serverUnwrapped, new object[] { obj }); } } @@ -436,7 +437,7 @@ private static void ValidateNotifyEndOfReferenceTrackingOnThread() // Trigger the thread lifetime end API and verify the callback occurs. int hr = MockReferenceTrackerRuntime.Trigger_NotifyEndOfReferenceTrackingOnThread(); - Assert.AreEqual(GlobalComWrappers.ReleaseObjectsCallAck, hr); + Assert.Equal(GlobalComWrappers.ReleaseObjectsCallAck, hr); } } } diff --git a/src/tests/Interop/COM/ComWrappers/WeakReference/WeakReferenceNative.cpp b/src/tests/Interop/COM/ComWrappers/WeakReference/WeakReferenceNative.cpp index 89a0b996f88eab..1b521366f21e70 100644 --- a/src/tests/Interop/COM/ComWrappers/WeakReference/WeakReferenceNative.cpp +++ b/src/tests/Interop/COM/ComWrappers/WeakReference/WeakReferenceNative.cpp @@ -167,8 +167,122 @@ namespace return UnknownImpl::DoRelease(); } }; + + struct WeakReferenceSource : public IWeakReferenceSource, public IInspectable + { + private: + IUnknown* _outerUnknown; + ComSmartPtr _weakReference; + public: + WeakReferenceSource(IUnknown* outerUnknown) + :_outerUnknown(outerUnknown), + _weakReference(new WeakReference(this, 1)) + { + } + + STDMETHOD(GetWeakReference)(IWeakReference** ppWeakReference) + { + _weakReference->AddRef(); + *ppWeakReference = _weakReference; + return S_OK; + } + + STDMETHOD(QueryInterface)( + /* [in] */ REFIID riid, + /* [iid_is][out] */ void ** ppvObject) + { + if (riid == __uuidof(IWeakReferenceSource)) + { + *ppvObject = static_cast(this); + _weakReference->AddStrongRef(); + return S_OK; + } + return _outerUnknown->QueryInterface(riid, ppvObject); + } + STDMETHOD_(ULONG, AddRef)(void) + { + return _weakReference->AddStrongRef(); + } + STDMETHOD_(ULONG, Release)(void) + { + return _weakReference->ReleaseStrongRef(); + } + + STDMETHOD(GetRuntimeClassName)(HSTRING* pRuntimeClassName) + { + return E_NOTIMPL; + } + + STDMETHOD(GetIids)( + ULONG *iidCount, + IID **iids) + { + return E_NOTIMPL; + } + + STDMETHOD(GetTrustLevel)(TrustLevel *trustLevel) + { + *trustLevel = FullTrust; + return S_OK; + } + }; + + struct AggregatedWeakReferenceSource : IInspectable + { + private: + IUnknown* _outerUnknown; + ComSmartPtr _weakReference; + public: + AggregatedWeakReferenceSource(IUnknown* outerUnknown) + :_outerUnknown(outerUnknown), + _weakReference(new WeakReferenceSource(outerUnknown)) + { + } + + STDMETHOD(GetRuntimeClassName)(HSTRING* pRuntimeClassName) + { + return E_NOTIMPL; + } + + STDMETHOD(GetIids)( + ULONG *iidCount, + IID **iids) + { + return E_NOTIMPL; + } + + STDMETHOD(GetTrustLevel)(TrustLevel *trustLevel) + { + *trustLevel = FullTrust; + return S_OK; + } + + STDMETHOD(QueryInterface)( + /* [in] */ REFIID riid, + /* [iid_is][out] */ void ** ppvObject) + { + if (riid == __uuidof(IWeakReferenceSource)) + { + return _weakReference->QueryInterface(riid, ppvObject); + } + return _outerUnknown->QueryInterface(riid, ppvObject); + } + STDMETHOD_(ULONG, AddRef)(void) + { + return _outerUnknown->AddRef(); + } + STDMETHOD_(ULONG, Release)(void) + { + return _outerUnknown->Release(); + } + }; } extern "C" DLL_EXPORT WeakReferencableObject* STDMETHODCALLTYPE CreateWeakReferencableObject() { return new WeakReferencableObject(); } + +extern "C" DLL_EXPORT AggregatedWeakReferenceSource* STDMETHODCALLTYPE CreateAggregatedWeakReferenceObject(IUnknown* pOuter) +{ + return new AggregatedWeakReferenceSource(pOuter); +} diff --git a/src/tests/Interop/COM/ComWrappers/WeakReference/WeakReferenceTest.cs b/src/tests/Interop/COM/ComWrappers/WeakReference/WeakReferenceTest.cs index 38e40d129243f6..03024c9e650230 100644 --- a/src/tests/Interop/COM/ComWrappers/WeakReference/WeakReferenceTest.cs +++ b/src/tests/Interop/COM/ComWrappers/WeakReference/WeakReferenceTest.cs @@ -8,12 +8,15 @@ namespace ComWrappersTests using System.Collections.Generic; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using TestLibrary; + using Xunit; static class WeakReferenceNative { [DllImport(nameof(WeakReferenceNative))] public static extern IntPtr CreateWeakReferencableObject(); + + [DllImport(nameof(WeakReferenceNative))] + public static extern IntPtr CreateAggregatedWeakReferenceObject(IntPtr outer); } public struct VtblPtr @@ -28,79 +31,104 @@ public enum WrapperRegistration Marshalling, } - public class WeakReferenceableWrapper + public unsafe class WeakReferenceableWrapper { private struct Vtbl { - public IntPtr QueryInterface; - public _AddRef AddRef; - public _Release Release; + public delegate* unmanaged QueryInterface; + public delegate* unmanaged AddRef; + public delegate* unmanaged Release; } - private delegate int _AddRef(IntPtr This); - private delegate int _Release(IntPtr This); - private readonly IntPtr instance; private readonly Vtbl vtable; + private readonly bool releaseInFinalizer; public WrapperRegistration Registration { get; } - public WeakReferenceableWrapper(IntPtr instance, WrapperRegistration reg) + public WeakReferenceableWrapper(IntPtr instance, WrapperRegistration reg, bool releaseInFinalizer = true) { var inst = Marshal.PtrToStructure(instance); this.vtable = Marshal.PtrToStructure(inst.Vtbl); this.instance = instance; + this.releaseInFinalizer = releaseInFinalizer; Registration = reg; } + public int QueryInterface(Guid iid, out IntPtr ptr) + { + fixed(IntPtr* ppv = &ptr) + { + return this.vtable.QueryInterface(this.instance, &iid, ppv); + } + } + ~WeakReferenceableWrapper() { - if (this.instance != IntPtr.Zero) + if (this.instance != IntPtr.Zero && this.releaseInFinalizer) { this.vtable.Release(this.instance); } } } - class Program + class DerivedObject : ICustomQueryInterface { - class TestComWrappers : ComWrappers + private WeakReferenceableWrapper inner; + public DerivedObject(TestComWrappers comWrappersInstance) { - public WrapperRegistration Registration { get; } + IntPtr innerInstance = WeakReferenceNative.CreateAggregatedWeakReferenceObject( + comWrappersInstance.GetOrCreateComInterfaceForObject(this, CreateComInterfaceFlags.None)); + inner = new WeakReferenceableWrapper(innerInstance, comWrappersInstance.Registration, releaseInFinalizer: false); + comWrappersInstance.GetOrRegisterObjectForComInstance(innerInstance, CreateObjectFlags.Aggregation, this); + } - public TestComWrappers(WrapperRegistration reg = WrapperRegistration.Local) - { - Registration = reg; - } + public CustomQueryInterfaceResult GetInterface(ref Guid iid, out IntPtr ppv) + { + return inner.QueryInterface(iid, out ppv) == 0 ? CustomQueryInterfaceResult.Handled : CustomQueryInterfaceResult.Failed; + } + } - protected unsafe override ComInterfaceEntry* ComputeVtables(object obj, CreateComInterfaceFlags flags, out int count) - { - count = 0; - return null; - } + class TestComWrappers : ComWrappers + { + public WrapperRegistration Registration { get; } - protected override object CreateObject(IntPtr externalComObject, CreateObjectFlags flag) - { - Marshal.AddRef(externalComObject); - return new WeakReferenceableWrapper(externalComObject, Registration); - } + public TestComWrappers(WrapperRegistration reg = WrapperRegistration.Local) + { + Registration = reg; + } - protected override void ReleaseObjects(IEnumerable objects) - { - } + protected unsafe override ComInterfaceEntry* ComputeVtables(object obj, CreateComInterfaceFlags flags, out int count) + { + count = 0; + return null; + } + + protected override object CreateObject(IntPtr externalComObject, CreateObjectFlags flag) + { + Marshal.AddRef(externalComObject); + return new WeakReferenceableWrapper(externalComObject, Registration); + } - public static readonly TestComWrappers TrackerSupportInstance = new TestComWrappers(WrapperRegistration.TrackerSupport); - public static readonly TestComWrappers MarshallingInstance = new TestComWrappers(WrapperRegistration.Marshalling); + protected override void ReleaseObjects(IEnumerable objects) + { } + public static readonly TestComWrappers TrackerSupportInstance = new TestComWrappers(WrapperRegistration.TrackerSupport); + public static readonly TestComWrappers MarshallingInstance = new TestComWrappers(WrapperRegistration.Marshalling); + } + + class Program + { + private static void ValidateWeakReferenceState(WeakReference wr, bool expectedIsAlive, TestComWrappers sourceWrappers = null) { WeakReferenceableWrapper target; bool isAlive = wr.TryGetTarget(out target); - Assert.AreEqual(expectedIsAlive, isAlive); + Assert.Equal(expectedIsAlive, isAlive); if (isAlive && sourceWrappers != null) - Assert.AreEqual(sourceWrappers.Registration, target.Registration); + Assert.Equal(sourceWrappers.Registration, target.Registration); } private static (WeakReference, IntPtr) GetWeakReference(TestComWrappers cw) @@ -135,7 +163,7 @@ private static void ValidateNativeWeakReference(TestComWrappers cw) // a global ComWrappers instance. If the RCW was created throug a local ComWrappers instance, the weak // reference should be dead and stay dead once the RCW is collected. bool supportsRehydration = cw.Registration != WrapperRegistration.Local; - + Console.WriteLine($" -- Validate RCW recreation"); ValidateWeakReferenceState(weakRef, expectedIsAlive: supportsRehydration, cw); @@ -209,8 +237,8 @@ bool HasTarget(WeakReference wr) // A weak reference to an RCW wrapping an IWeakReference created throguh the built-in system // should stay alive even after the RCW dies - Assert.IsFalse(weakRef.IsAlive); - Assert.IsTrue(HasTarget(weakRef)); + Assert.False(weakRef.IsAlive); + Assert.True(HasTarget(weakRef)); // Release the last native reference. Marshal.Release(nativeRef); @@ -218,7 +246,27 @@ bool HasTarget(WeakReference wr) GC.WaitForPendingFinalizers(); // After all native references die and the RCW is collected, the weak reference should be dead and stay dead. - Assert.IsNull(weakRef.Target); + Assert.Null(weakRef.Target); + } + + static void ValidateAggregatedWeakReference() + { + Console.WriteLine("Validate weak reference with aggregation."); + var (handle, weakRef) = GetWeakReference(); + + GC.Collect(); + GC.WaitForPendingFinalizers(); + + Assert.Null(handle.Target); + Assert.False(weakRef.TryGetTarget(out _)); + + static (GCHandle handle, WeakReference) GetWeakReference() + { + DerivedObject obj = new DerivedObject(TestComWrappers.TrackerSupportInstance); + // We use an explicit weak GC handle here to enable us to validate that we are using "weak" GCHandle + // semantics with the weak reference. + return (GCHandle.Alloc(obj, GCHandleType.Weak), new WeakReference(obj)); + } } static int Main(string[] doNotUse) @@ -235,6 +283,7 @@ static int Main(string[] doNotUse) ComWrappers.RegisterForTrackerSupport(TestComWrappers.TrackerSupportInstance); ValidateGlobalInstanceTrackerSupport(); + ValidateAggregatedWeakReference(); ValidateLocalInstance(); } diff --git a/src/tests/Interop/COM/Dynamic/BasicTest.cs b/src/tests/Interop/COM/Dynamic/BasicTest.cs index c2310f8942c388..1e6fa7f5604e99 100644 --- a/src/tests/Interop/COM/Dynamic/BasicTest.cs +++ b/src/tests/Interop/COM/Dynamic/BasicTest.cs @@ -5,7 +5,7 @@ namespace Dynamic { using System; using System.Runtime.InteropServices; - using TestLibrary; + using Xunit; internal class BasicTest { @@ -59,23 +59,23 @@ private void DefaultMember() int expected = val * 2; // Invoke default member - Assert.AreEqual(expected, obj(val)); - Assert.AreEqual(expected, obj.Default(val)); + Assert.Equal(expected, obj(val)); + Assert.Equal(expected, obj.Default(val)); } private void Boolean() { // Get and set property obj.Boolean_Property = true; - Assert.IsTrue(obj.Boolean_Property); + Assert.True(obj.Boolean_Property); // Call method with return value - Assert.IsFalse(obj.Boolean_Inverse_Ret(true)); + Assert.False(obj.Boolean_Inverse_Ret(true)); // Call method passing by ref bool inout = true; obj.Boolean_Inverse_InOut(ref inout); - Assert.IsFalse(inout); + Assert.False(inout); // Pass as variant Variant(true, false); @@ -88,15 +88,15 @@ private void SByte() // Get and set property obj.SByte_Property = val; - Assert.AreEqual(val, obj.SByte_Property); + Assert.Equal(val, obj.SByte_Property); // Call method with return value - Assert.AreEqual(expected, obj.SByte_Doubled_Ret(val)); + Assert.Equal(expected, obj.SByte_Doubled_Ret(val)); // Call method passing by ref sbyte inout = val; obj.SByte_Doubled_InOut(ref inout); - Assert.AreEqual(expected, inout); + Assert.Equal(expected, inout); // Pass as variant Variant(val, expected); @@ -109,15 +109,15 @@ private void Byte() // Get and set property obj.Byte_Property = val; - Assert.AreEqual(val, obj.Byte_Property); + Assert.Equal(val, obj.Byte_Property); // Call method with return value - Assert.AreEqual(expected, obj.Byte_Doubled_Ret(val)); + Assert.Equal(expected, obj.Byte_Doubled_Ret(val)); // Call method passing by ref byte inout = val; obj.Byte_Doubled_InOut(ref inout); - Assert.AreEqual(expected, inout); + Assert.Equal(expected, inout); // Pass as variant Variant(val, expected); @@ -130,15 +130,15 @@ private void Short() // Get and set property obj.Short_Property = val; - Assert.AreEqual(val, obj.Short_Property); + Assert.Equal(val, obj.Short_Property); // Call method with return value - Assert.AreEqual(expected, obj.Short_Doubled_Ret(val)); + Assert.Equal(expected, obj.Short_Doubled_Ret(val)); // Call method passing by ref short inout = val; obj.Short_Doubled_InOut(ref inout); - Assert.AreEqual(expected, inout); + Assert.Equal(expected, inout); // Pass as variant Variant(val, expected); @@ -151,15 +151,15 @@ private void UShort() // Get and set property obj.UShort_Property = val; - Assert.AreEqual(val, obj.UShort_Property); + Assert.Equal(val, obj.UShort_Property); // Call method with return value - Assert.AreEqual(expected, obj.UShort_Doubled_Ret(val)); + Assert.Equal(expected, obj.UShort_Doubled_Ret(val)); // Call method passing by ref ushort inout = val; obj.UShort_Doubled_InOut(ref inout); - Assert.AreEqual(expected, inout); + Assert.Equal(expected, inout); // Pass as variant Variant(val, expected); @@ -172,15 +172,15 @@ private void Int() // Get and set property obj.Int_Property = val; - Assert.AreEqual(val, obj.Int_Property); + Assert.Equal(val, obj.Int_Property); // Call method with return value - Assert.AreEqual(expected, obj.Int_Doubled_Ret(val)); + Assert.Equal(expected, obj.Int_Doubled_Ret(val)); // Call method passing by ref int inout = val; obj.Int_Doubled_InOut(ref inout); - Assert.AreEqual(expected, inout); + Assert.Equal(expected, inout); // Pass as variant Variant(val, expected); @@ -193,15 +193,15 @@ private void UInt() // Get and set property obj.UInt_Property = val; - Assert.AreEqual(val, obj.UInt_Property); + Assert.Equal(val, obj.UInt_Property); // Call method with return value - Assert.AreEqual(expected, obj.UInt_Doubled_Ret(val)); + Assert.Equal(expected, obj.UInt_Doubled_Ret(val)); // Call method passing by ref uint inout = val; obj.UInt_Doubled_InOut(ref inout); - Assert.AreEqual(expected, inout); + Assert.Equal(expected, inout); // Pass as variant Variant(val, expected); @@ -214,15 +214,15 @@ private void Int64() // Get and set property obj.Int64_Property = val; - Assert.AreEqual(val, obj.Int64_Property); + Assert.Equal(val, obj.Int64_Property); // Call method with return value - Assert.AreEqual(expected, obj.Int64_Doubled_Ret(val)); + Assert.Equal(expected, obj.Int64_Doubled_Ret(val)); // Call method passing by ref long inout = val; obj.Int64_Doubled_InOut(ref inout); - Assert.AreEqual(expected, inout); + Assert.Equal(expected, inout); // Pass as variant Variant(val, expected); @@ -235,15 +235,15 @@ private void UInt64() // Get and set property obj.UInt64_Property = val; - Assert.AreEqual(val, obj.UInt64_Property); + Assert.Equal(val, obj.UInt64_Property); // Call method with return value - Assert.AreEqual(expected, obj.UInt64_Doubled_Ret(val)); + Assert.Equal(expected, obj.UInt64_Doubled_Ret(val)); // Call method passing by ref ulong inout = val; obj.UInt64_Doubled_InOut(ref inout); - Assert.AreEqual(expected, inout); + Assert.Equal(expected, inout); // Pass as variant Variant(val, expected); @@ -256,15 +256,15 @@ private void Float() // Get and set property obj.Float_Property = val; - Assert.AreEqual(val, obj.Float_Property); + Assert.Equal(val, obj.Float_Property); // Call method with return value - Assert.AreEqual(expected, obj.Float_Ceil_Ret(val)); + Assert.Equal(expected, obj.Float_Ceil_Ret(val)); // Call method passing by ref float inout = val; obj.Float_Ceil_InOut(ref inout); - Assert.AreEqual(expected, inout); + Assert.Equal(expected, inout); // Pass as variant Variant(val, expected); @@ -277,15 +277,15 @@ private void Double() // Get and set property obj.Double_Property = val; - Assert.AreEqual(val, obj.Double_Property); + Assert.Equal(val, obj.Double_Property); // Call method with return value - Assert.AreEqual(expected, obj.Double_Ceil_Ret(val)); + Assert.Equal(expected, obj.Double_Ceil_Ret(val)); // Call method passing by ref double inout = val; obj.Double_Ceil_InOut(ref inout); - Assert.AreEqual(expected, inout); + Assert.Equal(expected, inout); // Pass as variant Variant(val, expected); @@ -304,15 +304,15 @@ private void IntPtr() // Get and set property obj.Variant_Property = val; - Assert.AreEqual(valRaw, obj.Variant_Property); + Assert.Equal(valRaw, obj.Variant_Property); // Call method with return value - Assert.AreEqual(expectedRaw, obj.Variant_Ret(val)); + Assert.Equal(expectedRaw, obj.Variant_Ret(val)); // Call method passing by ref IntPtr inout = val; obj.Variant_InOut(ref inout); - Assert.AreEqual(expected, inout); + Assert.Equal(expected, inout); } private void UIntPtr() @@ -328,15 +328,15 @@ private void UIntPtr() // Get and set property obj.Variant_Property = val; - Assert.AreEqual(valRaw, obj.Variant_Property); + Assert.Equal(valRaw, obj.Variant_Property); // Call method with return value - Assert.AreEqual(expectedRaw, obj.Variant_Ret(val)); + Assert.Equal(expectedRaw, obj.Variant_Ret(val)); // Call method passing by ref UIntPtr inout = val; obj.Variant_InOut(ref inout); - Assert.AreEqual(expected, inout); + Assert.Equal(expected, inout); } private void String() @@ -348,15 +348,15 @@ private void String() // Get and set property obj.String_Property = val; - Assert.AreEqual(val, obj.String_Property); + Assert.Equal(val, obj.String_Property); // Call method with return value - Assert.AreEqual(expected, obj.String_Reverse_Ret(val)); + Assert.Equal(expected, obj.String_Reverse_Ret(val)); // Call method passing by ref string inout = val; obj.String_Reverse_InOut(ref inout); - Assert.AreEqual(expected, inout); + Assert.Equal(expected, inout); // Pass as variant Variant(val, expected); @@ -371,15 +371,15 @@ private void Date() // Get and set property obj.Date_Property = val; - Assert.AreEqual(val, obj.Date_Property); + Assert.Equal(val, obj.Date_Property); // Call method with return value - Assert.AreEqual(expected, obj.Date_AddDay_Ret(val)); + Assert.Equal(expected, obj.Date_AddDay_Ret(val)); // Call method passing by ref DateTime inout = val; obj.Date_AddDay_InOut(ref inout); - Assert.AreEqual(expected, inout); + Assert.Equal(expected, inout); // Pass as variant Variant(val, expected); @@ -392,25 +392,25 @@ private void ComObject() // Get and set property obj.Dispatch_Property = val; - Assert.AreEqual(val, obj.Dispatch_Property); + Assert.Equal(val, obj.Dispatch_Property); // Update dispatch object obj.Dispatch_Property.Boolean_Property = false; - Assert.IsFalse(obj.Dispatch_Property.Boolean_Property); - Assert.IsFalse(val.Boolean_Property); + Assert.False(obj.Dispatch_Property.Boolean_Property); + Assert.False(val.Boolean_Property); // Call method with return value dynamic ret = obj.Dispatch_Ret(val); - Assert.IsTrue(ret.Boolean_Property); - Assert.IsFalse(val.Boolean_Property); + Assert.True(ret.Boolean_Property); + Assert.False(val.Boolean_Property); // Call method passing by ref obj.Dispatch_InOut(ref val); - Assert.IsTrue(val.Boolean_Property); + Assert.True(val.Boolean_Property); val.Boolean_Property = false; - Variant(val, new Action(d => Assert.IsTrue(d.Boolean_Property))); - Assert.IsTrue(val.Boolean_Property); + Variant(val, new Action(d => Assert.True(d.Boolean_Property))); + Assert.True(val.Boolean_Property); val.Boolean_Property = false; UnknownWrapper(val); @@ -419,10 +419,10 @@ private void ComObject() private void Null() { obj.Variant_Property = null; - Assert.IsNull(obj.Variant_Property); + Assert.Null(obj.Variant_Property); obj.String_Property = null; - Assert.AreEqual(string.Empty, obj.String_Property); + Assert.Equal(string.Empty, obj.String_Property); } private void StringWrapper(string toWrap, string expected) @@ -431,15 +431,15 @@ private void StringWrapper(string toWrap, string expected) // Get and set property obj.String_Property = val; - Assert.AreEqual(val.WrappedObject, obj.String_Property); + Assert.Equal(val.WrappedObject, obj.String_Property); // Call method with return value - Assert.AreEqual(expected, obj.String_Reverse_Ret(val)); + Assert.Equal(expected, obj.String_Reverse_Ret(val)); // Call method passing by ref BStrWrapper inout = new BStrWrapper(val.WrappedObject); obj.String_Reverse_InOut(ref inout); - Assert.AreEqual(expected, inout.WrappedObject); + Assert.Equal(expected, inout.WrappedObject); } private void UnknownWrapper(dynamic toWrap) @@ -448,16 +448,16 @@ private void UnknownWrapper(dynamic toWrap) // Get and set property obj.Variant_Property = val; - Assert.AreEqual(val.WrappedObject, obj.Variant_Property); + Assert.Equal(val.WrappedObject, obj.Variant_Property); // Call method with return value dynamic ret = obj.Variant_Ret(val); - Assert.IsTrue(ret.Boolean_Property); - Assert.IsTrue(toWrap.Boolean_Property); + Assert.True(ret.Boolean_Property); + Assert.True(toWrap.Boolean_Property); // Call method passing by ref obj.Variant_InOut(ref val); - Assert.IsTrue(toWrap.Boolean_Property); + Assert.True(toWrap.Boolean_Property); } private void ErrorWrapper() @@ -467,7 +467,7 @@ private void ErrorWrapper() // Get and set property obj.Variant_Property = val; - Assert.AreEqual(val.ErrorCode, obj.Variant_Property); + Assert.Equal(val.ErrorCode, obj.Variant_Property); } #pragma warning disable 618 // CurrencyWrapper is marked obsolete @@ -478,7 +478,7 @@ private void CurrencyWrapper() // Get and set property obj.Variant_Property = val; - Assert.AreEqual(val.WrappedObject, obj.Variant_Property); + Assert.Equal(val.WrappedObject, obj.Variant_Property); } #pragma warning restore 618 @@ -490,22 +490,22 @@ private void VariantWrapper() // Get and set property obj.Variant_Property = val; - Assert.AreEqual(val.WrappedObject, obj.Variant_Property); + Assert.Equal(val.WrappedObject, obj.Variant_Property); // Call method with return value dynamic ret = obj.Variant_Ret(val); - Assert.AreEqual(expected, ret); + Assert.Equal(expected, ret); // Call method passing by ref obj.Variant_InOut(ref val); - Assert.AreEqual(expected, val.WrappedObject); + Assert.Equal(expected, val.WrappedObject); } private void Variant(T val, Action validate) { // Get and set property obj.Variant_Property = val; - Assert.AreEqual(val, obj.Variant_Property); + Assert.Equal(val, obj.Variant_Property); // Call method with return value validate(obj.Variant_Ret(val)); @@ -518,7 +518,7 @@ private void Variant(T val, Action validate) private void Variant(T val, T expected) { - Variant(val, v => Assert.AreEqual(expected, v)); + Variant(val, v => Assert.Equal(expected, v)); } private void Fail() @@ -526,8 +526,8 @@ private void Fail() const int E_ABORT = unchecked((int)0x80004004); string message = "CUSTOM ERROR MESSAGE"; COMException comException = Assert.Throws(() => obj.Fail(E_ABORT, message)); - Assert.AreEqual(E_ABORT, comException.HResult, "Unexpected HRESULT on COMException"); - Assert.AreEqual(message, comException.Message, "Unexpected message on COMException"); + Assert.Equal(E_ABORT, comException.HResult); + Assert.Equal(message, comException.Message); Assert.Throws(() => obj.Throw()); } diff --git a/src/tests/Interop/COM/Dynamic/CollectionTest.cs b/src/tests/Interop/COM/Dynamic/CollectionTest.cs index bf3e341ee3f0ac..9feefc0b225e81 100644 --- a/src/tests/Interop/COM/Dynamic/CollectionTest.cs +++ b/src/tests/Interop/COM/Dynamic/CollectionTest.cs @@ -5,7 +5,7 @@ namespace Dynamic { using System; using System.Collections.Generic; - using TestLibrary; + using Xunit; internal class CollectionTest { @@ -40,28 +40,28 @@ private void Array() } // Call method returning array - Assert.AreAllEqual(expected, obj.Array_PlusOne_Ret(array)); + AssertExtensions.CollectionEqual(expected, obj.Array_PlusOne_Ret(array)); // Call method with array in/out int[] inout = new int[len]; System.Array.Copy(array, inout, len); obj.Array_PlusOne_InOut(ref inout); - Assert.AreAllEqual(expected, inout); + AssertExtensions.CollectionEqual(expected, inout); // Call method returning array as variant - Assert.AreAllEqual(expected, obj.ArrayVariant_PlusOne_Ret(array)); + AssertExtensions.CollectionEqual(expected, obj.ArrayVariant_PlusOne_Ret(array)); // Call method with array as variant in/out inout = new int[len]; System.Array.Copy(array, inout, len); obj.ArrayVariant_PlusOne_InOut(ref inout); - Assert.AreAllEqual(expected, inout); + AssertExtensions.CollectionEqual(expected, inout); } private void CustomCollection() { // Add to the collection - Assert.AreEqual(0, obj.Count); + Assert.Equal(0, obj.Count); string[] array = { "ONE", "TWO", "THREE" }; foreach (string s in array) { @@ -69,14 +69,14 @@ private void CustomCollection() } // Get item by index - Assert.AreEqual(array[0], obj[0]); - Assert.AreEqual(array[0], obj.Item(0)); - Assert.AreEqual(array[0], obj.Item[0]); - Assert.AreEqual(array[1], obj[1]); - Assert.AreEqual(array[1], obj.Item(1)); - Assert.AreEqual(array[2], obj[2]); - Assert.AreEqual(array[2], obj.Item(2)); - Assert.AreEqual(array.Length, obj.Count); + Assert.Equal(array[0], obj[0]); + Assert.Equal(array[0], obj.Item(0)); + Assert.Equal(array[0], obj.Item[0]); + Assert.Equal(array[1], obj[1]); + Assert.Equal(array[1], obj.Item(1)); + Assert.Equal(array[2], obj[2]); + Assert.Equal(array[2], obj.Item(2)); + Assert.Equal(array.Length, obj.Count); // Enumerate collection List list = new List(); @@ -87,7 +87,7 @@ private void CustomCollection() { list.Add((string)enumerator.Current); } - Assert.AreAllEqual(array, list); + AssertExtensions.CollectionEqual(array, list); list.Clear(); enumerator.Reset(); @@ -95,7 +95,7 @@ private void CustomCollection() { list.Add((string)enumerator.Current); } - Assert.AreAllEqual(array, list); + AssertExtensions.CollectionEqual(array, list); // Iterate over object that handles DISPID_NEWENUM list.Clear(); @@ -103,34 +103,34 @@ private void CustomCollection() { list.Add(str); } - Assert.AreAllEqual(array, list); + AssertExtensions.CollectionEqual(array, list); array = new string[] { "NEW_ONE", "NEW_TWO", "NEW_THREE" }; // Update items by index obj[0] = array[0]; - Assert.AreEqual(array[0], obj[0]); + Assert.Equal(array[0], obj[0]); obj[1] = array[1]; - Assert.AreEqual(array[1], obj[1]); + Assert.Equal(array[1], obj[1]); obj[2] = array[2]; - Assert.AreEqual(array[2], obj[2]); - Assert.AreEqual(array.Length, obj.Count); + Assert.Equal(array[2], obj[2]); + Assert.Equal(array.Length, obj.Count); list.Clear(); foreach (string str in obj) { list.Add(str); } - Assert.AreAllEqual(array, list); + AssertExtensions.CollectionEqual(array, list); // Remove item obj.Remove(1); - Assert.AreEqual(2, obj.Count); - Assert.AreEqual(array[0], obj[0]); - Assert.AreEqual(array[2], obj[1]); + Assert.Equal(2, obj.Count); + Assert.Equal(array[0], obj[0]); + Assert.Equal(array[2], obj[1]); // Clear collection obj.Clear(); - Assert.AreEqual(0, obj.Count); + Assert.Equal(0, obj.Count); } private void IndexChain() @@ -138,12 +138,12 @@ private void IndexChain() dynamic collection = obj.GetDispatchCollection(); collection.Add(collection); - Assert.AreEqual(1, collection.Item[0][0][0].Count); + Assert.Equal(1, collection.Item[0][0][0].Count); collection[0].Add(obj); - Assert.AreEqual(2, collection.Count); - Assert.AreEqual(2, collection[0].Item[1].GetDispatchCollection()[0].Count); + Assert.Equal(2, collection.Count); + Assert.Equal(2, collection[0].Item[1].GetDispatchCollection()[0].Count); } } } diff --git a/src/tests/Interop/COM/Dynamic/EventTest.cs b/src/tests/Interop/COM/Dynamic/EventTest.cs index 47bae8302877fc..a48879cf094a55 100644 --- a/src/tests/Interop/COM/Dynamic/EventTest.cs +++ b/src/tests/Interop/COM/Dynamic/EventTest.cs @@ -4,7 +4,7 @@ namespace Dynamic { using System; - using TestLibrary; + using Xunit; internal class EventTest { @@ -264,14 +264,14 @@ public void Reset() public void Validate(bool called, int id = InvalidId) { - Assert.AreEqual(called, _eventReceived, $"Event handler should {(called ? "" : "not ")}have been called"); - Assert.AreEqual(id, _id, "Unexpected event arguments received"); + Assert.Equal(called, _eventReceived); + Assert.Equal(id, _id); } public void ValidateMessage(bool called, string message = "") { - Assert.AreEqual(called, _eventMessageReceived, $"Event handler should {(called ? "" : "not ")}have been called"); - Assert.AreEqual(message, _message, "Unexpected event arguments received"); + Assert.Equal(called, _eventMessageReceived); + Assert.Equal(message, _message); } } } diff --git a/src/tests/Interop/COM/Dynamic/NETServerTest.cs b/src/tests/Interop/COM/Dynamic/NETServerTest.cs index eafd092a9225b7..5180dc7e53110e 100644 --- a/src/tests/Interop/COM/Dynamic/NETServerTest.cs +++ b/src/tests/Interop/COM/Dynamic/NETServerTest.cs @@ -6,6 +6,7 @@ namespace Dynamic using System; using System.Runtime.InteropServices; using TestLibrary; + using Xunit; internal class NETServerTest { @@ -29,8 +30,8 @@ public void Run() try { - Assert.IsTrue(obj.EqualByCCW(obj)); - Assert.IsTrue(obj.NotEqualByRCW(obj)); + Assert.True(obj.EqualByCCW(obj)); + Assert.True(obj.NotEqualByRCW(obj)); } finally { diff --git a/src/tests/Interop/COM/Dynamic/ParametersTest.cs b/src/tests/Interop/COM/Dynamic/ParametersTest.cs index 5abb9b03faad98..95bda805fca487 100644 --- a/src/tests/Interop/COM/Dynamic/ParametersTest.cs +++ b/src/tests/Interop/COM/Dynamic/ParametersTest.cs @@ -5,7 +5,7 @@ namespace Dynamic { using System; using System.Runtime.InteropServices; - using TestLibrary; + using Xunit; internal class ParametersTest { @@ -47,26 +47,26 @@ private void Named() // Name all arguments int[] ret = obj.Required(first: one, second: two, third: three); - Assert.AreAllEqual(expected, ret, "Unexpected result calling function with all named arguments"); + AssertExtensions.CollectionEqual(expected, ret); // Name some arguments ret = obj.Required(one, two, third: three); - Assert.AreAllEqual(expected, ret, "Unexpected result calling function with some named arguments"); + AssertExtensions.CollectionEqual(expected, ret); ret = obj.Required(one, second: two, third: three); - Assert.AreAllEqual(expected, ret, "Unexpected result calling function with some named arguments"); + AssertExtensions.CollectionEqual(expected, ret); // Name in different order ret = obj.Required(third: three, first: one, second: two); - Assert.AreAllEqual(expected, ret, "Unexpected result calling function with out-of-order named arguments"); + AssertExtensions.CollectionEqual(expected, ret); ret = obj.Required(one, third: three, second: two); - Assert.AreAllEqual(expected, ret, "Unexpected result calling function with out-of-order named arguments"); + AssertExtensions.CollectionEqual(expected, ret); // Invalid name COMException e = Assert.Throws(() => obj.Required(one, two, invalid: three)); const int DISP_E_UNKNOWNNAME = unchecked((int)0x80020006); - Assert.AreEqual(DISP_E_UNKNOWNNAME, e.HResult, "Unexpected HRESULT on COMException"); + Assert.Equal(DISP_E_UNKNOWNNAME, e.HResult); } private void DefaultValue() @@ -75,28 +75,28 @@ private void DefaultValue() // Omit all arguments int[] ret = obj.DefaultValue(); - Assert.AreAllEqual(expected, ret, "Unexpected result calling function with all arguments omitted"); + AssertExtensions.CollectionEqual(expected, ret); // Specify some arguments expected[0] = one; ret = obj.DefaultValue(one); - Assert.AreAllEqual(expected, ret, "Unexpected result calling function with some arguments specified"); + AssertExtensions.CollectionEqual(expected, ret); expected[1] = two; ret = obj.DefaultValue(one, two); - Assert.AreAllEqual(expected, ret); + AssertExtensions.CollectionEqual(expected, ret); // Specify all arguments expected[1] = two; expected[2] = three; ret = obj.DefaultValue(one, two, three); - Assert.AreAllEqual(expected, ret, "Unexpected result calling function with all arguments specified"); + AssertExtensions.CollectionEqual(expected, ret); // Named arguments expected[0] = Default1; expected[1] = Default2; ret = obj.DefaultValue(third: three); - Assert.AreAllEqual(expected, ret, "Unexpected result calling function with named arguments"); + AssertExtensions.CollectionEqual(expected, ret); } private void Optional() @@ -105,53 +105,53 @@ private void Optional() // Omit all arguments int[] ret = obj.Optional(); - Assert.AreAllEqual(expected, ret, "Unexpected result calling function with all arguments omitted"); + AssertExtensions.CollectionEqual(expected, ret); // Specify some arguments expected[0] = one; ret = obj.Optional(one); - Assert.AreAllEqual(expected, ret, "Unexpected result calling function with some arguments specified"); + AssertExtensions.CollectionEqual(expected, ret); expected[1] = Default2; ret = obj.Mixed(one); - Assert.AreAllEqual(expected, ret, "Unexpected result calling function with some arguments specified"); + AssertExtensions.CollectionEqual(expected, ret); expected[1] = two; ret = obj.Optional(one, two); - Assert.AreAllEqual(expected, ret, "Unexpected result calling function with some arguments specified"); + AssertExtensions.CollectionEqual(expected, ret); ret = obj.Mixed(one, two); - Assert.AreAllEqual(expected, ret, "Unexpected result calling function with some arguments specified"); + AssertExtensions.CollectionEqual(expected, ret); // Specify all arguments expected[1] = two; expected[2] = three; ret = obj.Optional(one, two, three); - Assert.AreAllEqual(expected, ret, "Unexpected result calling function with all arguments specified"); + AssertExtensions.CollectionEqual(expected, ret); ret = obj.Mixed(one, two, three); - Assert.AreAllEqual(expected, ret, "Unexpected result calling function with all arguments specified"); + AssertExtensions.CollectionEqual(expected, ret); // Named arguments expected[1] = MissingParamId; ret = obj.Optional(first: one, third: three); - Assert.AreAllEqual(expected, ret, "Unexpected result calling function with named arguments"); + AssertExtensions.CollectionEqual(expected, ret); } private void VarArgs() { VarEnum[] ret = obj.VarArgs(); - Assert.AreEqual(0, ret.Length); + Assert.Equal(0, ret.Length); // COM server returns the type of each variant ret = obj.VarArgs(false); - Assert.AreEqual(1, ret.Length); - Assert.AreAllEqual(new [] { VarEnum.VT_BOOL }, ret); + Assert.Equal(1, ret.Length); + AssertExtensions.CollectionEqual(new [] { VarEnum.VT_BOOL }, ret); VarEnum[] expected = { VarEnum.VT_BSTR, VarEnum.VT_R8, VarEnum.VT_DATE, VarEnum.VT_I4 }; ret = obj.VarArgs("s", 10d, new DateTime(), 10); - Assert.AreEqual(expected.Length, ret.Length); - Assert.AreAllEqual(expected, ret); + Assert.Equal(expected.Length, ret.Length); + AssertExtensions.CollectionEqual(expected, ret); } private void Invalid() diff --git a/src/tests/Interop/COM/Dynamic/Program.cs b/src/tests/Interop/COM/Dynamic/Program.cs index 8f22c9ec6fa0f1..a269d0d3e3ed56 100644 --- a/src/tests/Interop/COM/Dynamic/Program.cs +++ b/src/tests/Interop/COM/Dynamic/Program.cs @@ -5,6 +5,7 @@ namespace Dynamic { using System; using TestLibrary; + using Xunit; class Program { diff --git a/src/tests/Interop/COM/NETClients/Aggregation/Program.cs b/src/tests/Interop/COM/NETClients/Aggregation/Program.cs index 2072b41a01184e..367ec33d660ab7 100644 --- a/src/tests/Interop/COM/NETClients/Aggregation/Program.cs +++ b/src/tests/Interop/COM/NETClients/Aggregation/Program.cs @@ -7,6 +7,7 @@ namespace NetClient using System.Runtime.InteropServices; using TestLibrary; + using Xunit; using Server.Contract; using Server.Contract.Servers; @@ -21,15 +22,15 @@ static void ValidateNativeOuter() var managedInner = new ManagedInner(); var nativeOuter = (AggregationTesting)managedInner; - Assert.IsTrue(typeof(ManagedInner).IsCOMObject); - Assert.IsTrue(typeof(AggregationTestingClass).IsCOMObject); - Assert.IsFalse(typeof(AggregationTesting).IsCOMObject); - Assert.IsTrue(Marshal.IsComObject(managedInner)); - Assert.IsTrue(Marshal.IsComObject(nativeOuter)); + Assert.True(typeof(ManagedInner).IsCOMObject); + Assert.True(typeof(AggregationTestingClass).IsCOMObject); + Assert.False(typeof(AggregationTesting).IsCOMObject); + Assert.True(Marshal.IsComObject(managedInner)); + Assert.True(Marshal.IsComObject(nativeOuter)); - Assert.IsTrue(nativeOuter.IsAggregated()); - Assert.IsTrue(nativeOuter.AreAggregated(managedInner, nativeOuter)); - Assert.IsFalse(nativeOuter.AreAggregated(nativeOuter, new object())); + Assert.True(nativeOuter.IsAggregated()); + Assert.True(nativeOuter.AreAggregated(managedInner, nativeOuter)); + Assert.False(nativeOuter.AreAggregated(nativeOuter, new object())); } static int Main(string[] doNotUse) diff --git a/src/tests/Interop/COM/NETClients/ConsumeNETServer/Program.cs b/src/tests/Interop/COM/NETClients/ConsumeNETServer/Program.cs index 76de709979b3d3..b6afa8e8ce9c97 100644 --- a/src/tests/Interop/COM/NETClients/ConsumeNETServer/Program.cs +++ b/src/tests/Interop/COM/NETClients/ConsumeNETServer/Program.cs @@ -9,6 +9,7 @@ namespace NetClient using System.Runtime.InteropServices; using TestLibrary; + using Xunit; using Server.Contract; using CoClass = Server.Contract.Servers; @@ -23,10 +24,10 @@ static void Validate_Activation() test.ReleaseResources(); // The CoClass should be the activated type, _not_ the activation interface. - Assert.AreEqual(test.GetType(), typeof(CoClass.ConsumeNETServerTestingClass)); - Assert.IsTrue(typeof(CoClass.ConsumeNETServerTestingClass).IsCOMObject); - Assert.IsFalse(typeof(CoClass.ConsumeNETServerTesting).IsCOMObject); - Assert.IsTrue(Marshal.IsComObject(test)); + Assert.Equal(test.GetType(), typeof(CoClass.ConsumeNETServerTestingClass)); + Assert.True(typeof(CoClass.ConsumeNETServerTestingClass).IsCOMObject); + Assert.False(typeof(CoClass.ConsumeNETServerTesting).IsCOMObject); + Assert.True(Marshal.IsComObject(test)); } static void Validate_Activation_CreateInstance() @@ -34,13 +35,13 @@ static void Validate_Activation_CreateInstance() Console.WriteLine($"{nameof(Validate_Activation_CreateInstance)}..."); Type t = Type.GetTypeFromCLSID(Guid.Parse(Guids.ConsumeNETServerTesting)); - Assert.IsTrue(t.IsCOMObject); + Assert.True(t.IsCOMObject); object obj = Activator.CreateInstance(t); var test = (CoClass.ConsumeNETServerTesting)obj; test.ReleaseResources(); - - Assert.IsTrue(Marshal.IsComObject(test)); + + Assert.True(Marshal.IsComObject(test)); // Use the overload that takes constructor arguments. This tests the path where the runtime searches for the // constructor to use (which has some special-casing for COM) instead of just always using the default. @@ -48,7 +49,7 @@ static void Validate_Activation_CreateInstance() test = (CoClass.ConsumeNETServerTesting)obj; test.ReleaseResources(); - Assert.IsTrue(Marshal.IsComObject(test)); + Assert.True(Marshal.IsComObject(test)); } static void Validate_CCW_Wasnt_Unwrapped() @@ -61,7 +62,7 @@ static void Validate_CCW_Wasnt_Unwrapped() // The CoClass should be the activated type, _not_ the implementation class. // This indicates the real implementation class is wrapped in its CCW and exposed // to the runtime as an RCW. - Assert.AreNotEqual(test.GetType(), typeof(ConsumeNETServerTesting)); + Assert.NotEqual(test.GetType(), typeof(ConsumeNETServerTesting)); } static void Validate_Client_CCW_RCW() @@ -77,7 +78,7 @@ static void Validate_Client_CCW_RCW() ccw = test.GetCCW(); object rcw = Marshal.GetObjectForIUnknown(ccw); object inst = test.GetRCW(); - Assert.AreEqual(rcw, inst); + Assert.Equal(rcw, inst); } finally { @@ -93,8 +94,8 @@ static void Validate_Server_CCW_RCW() var test = new CoClass.ConsumeNETServerTesting(); try { - Assert.IsTrue(test.EqualByCCW(test)); - Assert.IsTrue(test.NotEqualByRCW(test)); + Assert.True(test.EqualByCCW(test)); + Assert.True(test.NotEqualByRCW(test)); } finally { diff --git a/src/tests/Interop/COM/NETClients/Events/Program.cs b/src/tests/Interop/COM/NETClients/Events/Program.cs index e3ed917b4699d7..e52a5ecf699534 100644 --- a/src/tests/Interop/COM/NETClients/Events/Program.cs +++ b/src/tests/Interop/COM/NETClients/Events/Program.cs @@ -8,6 +8,7 @@ namespace NetClient using System.Runtime.InteropServices; using TestLibrary; + using Xunit; using Server.Contract; using Server.Contract.Servers; using Server.Contract.Events; @@ -29,8 +30,8 @@ static void Validate_BasicCOMEvent() string message = string.Empty; eventTesting.FireEvent(); - Assert.IsTrue(eventFired, "Event didn't fire"); - Assert.AreEqual(nameof(EventTesting.FireEvent), message, "Event message is incorrect"); + Assert.True(eventFired); + Assert.Equal(nameof(EventTesting.FireEvent), message); // Remove event eventTesting.OnEvent -= OnEventEventHandler; @@ -40,7 +41,7 @@ static void Validate_BasicCOMEvent() eventFired = false; eventTesting.FireEvent(); - Assert.IsFalse(eventFired, "Event shouldn't fire"); + Assert.False(eventFired); void OnEventEventHandler(string msg) { @@ -68,8 +69,8 @@ static void Validate_COMEventViaComAwareEventInfo() string message = string.Empty; eventTesting.FireEvent(); - Assert.IsTrue(eventFired, "Event didn't fire"); - Assert.AreEqual(nameof(EventTesting.FireEvent), message, "Event message is incorrect"); + Assert.True(eventFired); + Assert.Equal(nameof(EventTesting.FireEvent), message); comAwareEventInfo.RemoveEventHandler(eventTesting, handler); @@ -78,7 +79,7 @@ static void Validate_COMEventViaComAwareEventInfo() eventFired = false; eventTesting.FireEvent(); - Assert.IsFalse(eventFired, "Event shouldn't fire"); + Assert.False(eventFired); void OnEventEventHandler(string msg) { diff --git a/src/tests/Interop/COM/NETClients/IDispatch/Program.cs b/src/tests/Interop/COM/NETClients/IDispatch/Program.cs index 54a611e1aa1a60..0cb80c16ea2d2b 100644 --- a/src/tests/Interop/COM/NETClients/IDispatch/Program.cs +++ b/src/tests/Interop/COM/NETClients/IDispatch/Program.cs @@ -9,6 +9,7 @@ namespace NetClient using System.Runtime.InteropServices; using TestLibrary; + using Xunit; using Server.Contract; using Server.Contract.Servers; @@ -44,13 +45,13 @@ static void Validate_Numeric_In_ReturnByRef() ul1, ref ul2); Console.WriteLine($"Call to {nameof(DispatchTesting.DoubleNumeric_ReturnByRef)} complete"); - Assert.AreEqual(b1 * 2, b2); - Assert.AreEqual(s1 * 2, s2); - Assert.AreEqual(us1 * 2, us2); - Assert.AreEqual(i1 * 2, i2); - Assert.AreEqual(ui1 * 2, ui2); - Assert.AreEqual(l1 * 2, l2); - Assert.AreEqual(ul1 * 2, ul2); + Assert.Equal(b1 * 2, b2); + Assert.Equal(s1 * 2, s2); + Assert.Equal(us1 * 2, us2); + Assert.Equal(i1 * 2, i2); + Assert.Equal(ui1 * 2, ui2); + Assert.Equal(l1 * 2, l2); + Assert.Equal(ul1 * 2, ul2); } static private bool EqualByBound(float expected, float actual) @@ -82,8 +83,8 @@ static void Validate_Float_In_ReturnAndUpdateByRef() float d = dispatchTesting.Add_Float_ReturnAndUpdateByRef (a, ref c); Console.WriteLine($"Call to {nameof(DispatchTesting.Add_Float_ReturnAndUpdateByRef)} complete: {a} + {b} = {d}; {c} == {d}"); - Assert.IsTrue(EqualByBound(expected, c)); - Assert.IsTrue(EqualByBound(expected, d)); + Assert.True(EqualByBound(expected, c)); + Assert.True(EqualByBound(expected, d)); } static void Validate_Double_In_ReturnAndUpdateByRef() @@ -99,8 +100,8 @@ static void Validate_Double_In_ReturnAndUpdateByRef() double d = dispatchTesting.Add_Double_ReturnAndUpdateByRef (a, ref c); Console.WriteLine($"Call to {nameof(DispatchTesting.Add_Double_ReturnAndUpdateByRef)} complete: {a} + {b} = {d}; {c} == {d}"); - Assert.IsTrue(EqualByBound(expected, c)); - Assert.IsTrue(EqualByBound(expected, d)); + Assert.True(EqualByBound(expected, c)); + Assert.True(EqualByBound(expected, d)); } static int GetErrorCodeFromHResult(int hresult) @@ -119,23 +120,23 @@ static void Validate_Exception() { Console.WriteLine($"Calling {nameof(DispatchTesting.TriggerException)} with {nameof(IDispatchTesting_Exception.Disp)} {errorCode}..."); dispatchTesting.TriggerException(IDispatchTesting_Exception.Disp, errorCode); - Assert.Fail("DISP exception not thrown properly"); + Assert.True(false, "DISP exception not thrown properly"); } catch (COMException e) { - Assert.AreEqual(GetErrorCodeFromHResult(e.HResult), errorCode); - Assert.AreEqual(e.Message, resultString); + Assert.Equal(GetErrorCodeFromHResult(e.HResult), errorCode); + Assert.Equal(e.Message, resultString); } try { Console.WriteLine($"Calling {nameof(DispatchTesting.TriggerException)} with {nameof(IDispatchTesting_Exception.HResult)} {errorCode}..."); dispatchTesting.TriggerException(IDispatchTesting_Exception.HResult, errorCode); - Assert.Fail("HRESULT exception not thrown properly"); + Assert.True(false, "HRESULT exception not thrown properly"); } catch (COMException e) { - Assert.AreEqual(GetErrorCodeFromHResult(e.HResult), errorCode); + Assert.Equal(GetErrorCodeFromHResult(e.HResult), errorCode); // Failing HRESULT exceptions contain CLR generated messages } } @@ -159,7 +160,7 @@ static void Validate_LCID_Marshaled() CultureInfo englishCulture = new CultureInfo("en-US", false); CultureInfo.CurrentCulture = newCulture; int lcid = dispatchTesting.PassThroughLCID(); - Assert.AreEqual(englishCulture.LCID, lcid); // CLR->Dispatch LCID marshalling is explicitly hardcoded to en-US instead of passing the current culture. + Assert.Equal(englishCulture.LCID, lcid); // CLR->Dispatch LCID marshalling is explicitly hardcoded to en-US instead of passing the current culture. } finally { @@ -173,18 +174,18 @@ static void Validate_Enumerator() var expected = System.Linq.Enumerable.Range(0, 10); Console.WriteLine($"Calling {nameof(DispatchTesting.GetEnumerator)} ..."); - var enumerator = dispatchTesting.GetEnumerator(); - Assert.AreAllEqual(expected, GetEnumerable(enumerator)); + var enumerator = dispatchTesting.GetEnumerator(); + AssertExtensions.CollectionEqual(expected, GetEnumerable(enumerator)); enumerator.Reset(); - Assert.AreAllEqual(expected, GetEnumerable(enumerator)); + AssertExtensions.CollectionEqual(expected, GetEnumerable(enumerator)); Console.WriteLine($"Calling {nameof(DispatchTesting.ExplicitGetEnumerator)} ..."); var enumeratorExplicit = dispatchTesting.ExplicitGetEnumerator(); - Assert.AreAllEqual(expected, GetEnumerable(enumeratorExplicit)); + AssertExtensions.CollectionEqual(expected, GetEnumerable(enumeratorExplicit)); enumeratorExplicit.Reset(); - Assert.AreAllEqual(expected, GetEnumerable(enumeratorExplicit)); + AssertExtensions.CollectionEqual(expected, GetEnumerable(enumeratorExplicit)); System.Collections.Generic.IEnumerable GetEnumerable(System.Collections.IEnumerator e) { diff --git a/src/tests/Interop/COM/NETClients/IInspectable/Program.cs b/src/tests/Interop/COM/NETClients/IInspectable/Program.cs index 5cea072c0c8420..16c41acb676f04 100644 --- a/src/tests/Interop/COM/NETClients/IInspectable/Program.cs +++ b/src/tests/Interop/COM/NETClients/IInspectable/Program.cs @@ -9,6 +9,7 @@ namespace NetClient using System.Runtime.InteropServices; using TestLibrary; + using Xunit; using Server.Contract; using Server.Contract.Servers; diff --git a/src/tests/Interop/COM/NETClients/Licensing/Program.cs b/src/tests/Interop/COM/NETClients/Licensing/Program.cs index f1566936c20669..648c95e5cc74e1 100644 --- a/src/tests/Interop/COM/NETClients/Licensing/Program.cs +++ b/src/tests/Interop/COM/NETClients/Licensing/Program.cs @@ -10,6 +10,7 @@ namespace NetClient using System.Runtime.InteropServices; using TestLibrary; + using Xunit; using Server.Contract; using Server.Contract.Servers; @@ -28,12 +29,12 @@ static void ActivateLicensedObject() try { var tmp = (LicenseTesting)new LicenseTestingClass(); - Assert.Fail("Activation of licensed class should fail"); + Assert.True(false, "Activation of licensed class should fail"); } catch (COMException e) { const int CLASS_E_NOTLICENSED = unchecked((int)0x80040112); - Assert.AreEqual(CLASS_E_NOTLICENSED, e.HResult); + Assert.Equal(CLASS_E_NOTLICENSED, e.HResult); } finally { @@ -87,10 +88,10 @@ static void ActivateUnderDesigntimeContext() var licenseTesting = (LicenseTesting)new LicenseTestingClass(); // During design time the IClassFactory::CreateInstance will be called - no license - Assert.AreEqual(null, licenseTesting.GetLicense()); + Assert.Equal(null, licenseTesting.GetLicense()); // Verify the value retrieved from the IClassFactory2::RequestLicKey was what was set - Assert.AreEqual(DefaultLicKey, LicenseManager.CurrentContext.GetSavedLicenseKey(typeof(LicenseTestingClass), resourceAssembly: null)); + Assert.Equal(DefaultLicKey, LicenseManager.CurrentContext.GetSavedLicenseKey(typeof(LicenseTestingClass), resourceAssembly: null)); } finally { @@ -112,7 +113,7 @@ static void ActivateUnderRuntimeContext() var licenseTesting = (LicenseTesting)new LicenseTestingClass(); // During runtime the IClassFactory::CreateInstance2 will be called with license from context - Assert.AreEqual(licKey, licenseTesting.GetLicense()); + Assert.Equal(licKey, licenseTesting.GetLicense()); } finally { diff --git a/src/tests/Interop/COM/NETClients/Lifetime/Program.cs b/src/tests/Interop/COM/NETClients/Lifetime/Program.cs index ee6fb79fcc5143..6bfb3df29c7069 100644 --- a/src/tests/Interop/COM/NETClients/Lifetime/Program.cs +++ b/src/tests/Interop/COM/NETClients/Lifetime/Program.cs @@ -8,6 +8,7 @@ namespace NetClient using System.Runtime.InteropServices; using TestLibrary; + using Xunit; using Server.Contract; using Server.Contract.Servers; @@ -49,17 +50,17 @@ static void Validate_COMServer_CleanUp() allocated += AllocateInstances(1); allocated += AllocateInstances(2); allocated += AllocateInstances(3); - Assert.AreNotEqual(0, GetAllocationCount()); + Assert.NotEqual(0, GetAllocationCount()); ForceGC(); - Assert.AreEqual(0, GetAllocationCount()); + Assert.Equal(0, GetAllocationCount()); } static void Validate_COMServer_DisableEagerCleanUp() { Console.WriteLine($"Calling {nameof(Validate_COMServer_DisableEagerCleanUp)}..."); - Assert.AreEqual(0, GetAllocationCount()); + Assert.Equal(0, GetAllocationCount()); Thread.CurrentThread.DisableComObjectEagerCleanup(); @@ -67,18 +68,18 @@ static void Validate_COMServer_DisableEagerCleanUp() allocated += AllocateInstances(1); allocated += AllocateInstances(2); allocated += AllocateInstances(3); - Assert.AreNotEqual(0, GetAllocationCount()); + Assert.NotEqual(0, GetAllocationCount()); ForceGC(); - Assert.AreNotEqual(0, GetAllocationCount()); + Assert.NotEqual(0, GetAllocationCount()); Marshal.CleanupUnusedObjectsInCurrentContext(); ForceGC(); - Assert.AreEqual(0, GetAllocationCount()); - Assert.IsFalse(Marshal.AreComObjectsAvailableForCleanup()); + Assert.Equal(0, GetAllocationCount()); + Assert.False(Marshal.AreComObjectsAvailableForCleanup()); } static int Main(string[] doNotUse) @@ -99,7 +100,7 @@ static int Main(string[] doNotUse) { // Initialization for all future tests Initialize(); - Assert.IsTrue(GetAllocationCount != null); + Assert.True(GetAllocationCount != null); Validate_COMServer_CleanUp(); Validate_COMServer_DisableEagerCleanUp(); diff --git a/src/tests/Interop/COM/NETClients/Primitives/ArrayTests.cs b/src/tests/Interop/COM/NETClients/Primitives/ArrayTests.cs index 63f47d1873e4a7..2edffed11d24fc 100644 --- a/src/tests/Interop/COM/NETClients/Primitives/ArrayTests.cs +++ b/src/tests/Interop/COM/NETClients/Primitives/ArrayTests.cs @@ -6,7 +6,7 @@ namespace NetClient using System; using System.Collections.Generic; using System.Linq; - using TestLibrary; + using Xunit; class ArrayTests { @@ -62,10 +62,10 @@ private void Marshal_ByteArray() byte[] data = BaseData.Select(i => (byte)i).ToArray(); Console.WriteLine($"{data.GetType().Name} marshalling"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Byte_LP_PreLen(data.Length, data)), $"Mean_Byte_LP_PreLen"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Byte_LP_PostLen(data, data.Length)), $"Mean_Byte_LP_PostLen"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Byte_SafeArray_OutLen(data, out len)), $"Mean_Byte_SafeArray_OutLen"); - Assert.AreEqual(data.Length, len); + Assert.True(EqualByBound(expectedMean, this.server.Mean_Byte_LP_PreLen(data.Length, data)), $"Mean_Byte_LP_PreLen"); + Assert.True(EqualByBound(expectedMean, this.server.Mean_Byte_LP_PostLen(data, data.Length)), $"Mean_Byte_LP_PostLen"); + Assert.True(EqualByBound(expectedMean, this.server.Mean_Byte_SafeArray_OutLen(data, out len)), $"Mean_Byte_SafeArray_OutLen"); + Assert.Equal(data.Length, len); } private void Marshal_ShortArray() @@ -74,10 +74,10 @@ private void Marshal_ShortArray() short[] data = BaseData.Select(i => (short)i).ToArray(); Console.WriteLine($"{data.GetType().Name} marshalling"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Short_LP_PreLen(data.Length, data)), $"Mean_Short_LP_PreLen"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Short_LP_PostLen(data, data.Length)), $"Mean_Short_LP_PostLen"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Short_SafeArray_OutLen(data, out len)), $"Mean_Short_SafeArray_OutLen"); - Assert.AreEqual(data.Length, len); + Assert.True(EqualByBound(expectedMean, this.server.Mean_Short_LP_PreLen(data.Length, data)), $"Mean_Short_LP_PreLen"); + Assert.True(EqualByBound(expectedMean, this.server.Mean_Short_LP_PostLen(data, data.Length)), $"Mean_Short_LP_PostLen"); + Assert.True(EqualByBound(expectedMean, this.server.Mean_Short_SafeArray_OutLen(data, out len)), $"Mean_Short_SafeArray_OutLen"); + Assert.Equal(data.Length, len); } private void Marshal_UShortArray() @@ -86,10 +86,10 @@ private void Marshal_UShortArray() ushort[] data = BaseData.Select(i => (ushort)i).ToArray(); Console.WriteLine($"{data.GetType().Name} marshalling"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_UShort_LP_PreLen(data.Length, data)), $"Mean_UShort_LP_PreLen"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_UShort_LP_PostLen(data, data.Length)), $"Mean_UShort_LP_PostLen"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_UShort_SafeArray_OutLen(data, out len)), $"Mean_UShort_SafeArray_OutLen"); - Assert.AreEqual(data.Length, len); + Assert.True(EqualByBound(expectedMean, this.server.Mean_UShort_LP_PreLen(data.Length, data)), $"Mean_UShort_LP_PreLen"); + Assert.True(EqualByBound(expectedMean, this.server.Mean_UShort_LP_PostLen(data, data.Length)), $"Mean_UShort_LP_PostLen"); + Assert.True(EqualByBound(expectedMean, this.server.Mean_UShort_SafeArray_OutLen(data, out len)), $"Mean_UShort_SafeArray_OutLen"); + Assert.Equal(data.Length, len); } private void Marshal_IntArray() @@ -98,10 +98,10 @@ private void Marshal_IntArray() int[] data = BaseData.Select(i => i).ToArray(); Console.WriteLine($"{data.GetType().Name} marshalling"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Int_LP_PreLen(data.Length, data)), $"Mean_Int_LP_PreLen"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Int_LP_PostLen(data, data.Length)), $"Mean_Int_LP_PostLen"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Int_SafeArray_OutLen(data, out len)), $"Mean_Int_SafeArray_OutLen"); - Assert.AreEqual(data.Length, len); + Assert.True(EqualByBound(expectedMean, this.server.Mean_Int_LP_PreLen(data.Length, data)), $"Mean_Int_LP_PreLen"); + Assert.True(EqualByBound(expectedMean, this.server.Mean_Int_LP_PostLen(data, data.Length)), $"Mean_Int_LP_PostLen"); + Assert.True(EqualByBound(expectedMean, this.server.Mean_Int_SafeArray_OutLen(data, out len)), $"Mean_Int_SafeArray_OutLen"); + Assert.Equal(data.Length, len); } private void Marshal_UIntArray() @@ -110,10 +110,10 @@ private void Marshal_UIntArray() uint[] data = BaseData.Select(i => (uint)i).ToArray(); Console.WriteLine($"{data.GetType().Name} marshalling"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_UInt_LP_PreLen(data.Length, data)), $"Mean_UInt_LP_PreLen"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_UInt_LP_PostLen(data, data.Length)), $"Mean_UInt_LP_PostLen"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_UInt_SafeArray_OutLen(data, out len)), $"Mean_UInt_SafeArray_OutLen"); - Assert.AreEqual(data.Length, len); + Assert.True(EqualByBound(expectedMean, this.server.Mean_UInt_LP_PreLen(data.Length, data)), $"Mean_UInt_LP_PreLen"); + Assert.True(EqualByBound(expectedMean, this.server.Mean_UInt_LP_PostLen(data, data.Length)), $"Mean_UInt_LP_PostLen"); + Assert.True(EqualByBound(expectedMean, this.server.Mean_UInt_SafeArray_OutLen(data, out len)), $"Mean_UInt_SafeArray_OutLen"); + Assert.Equal(data.Length, len); } private void Marshal_LongArray() @@ -122,10 +122,10 @@ private void Marshal_LongArray() long[] data = BaseData.Select(i => (long)i).ToArray(); Console.WriteLine($"{data.GetType().Name} marshalling"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Long_LP_PreLen(data.Length, data)), $"Mean_Long_LP_PreLen"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Long_LP_PostLen(data, data.Length)), $"Mean_Long_LP_PostLen"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Long_SafeArray_OutLen(data, out len)), $"Mean_Long_SafeArray_OutLen"); - Assert.AreEqual(data.Length, len); + Assert.True(EqualByBound(expectedMean, this.server.Mean_Long_LP_PreLen(data.Length, data)), $"Mean_Long_LP_PreLen"); + Assert.True(EqualByBound(expectedMean, this.server.Mean_Long_LP_PostLen(data, data.Length)), $"Mean_Long_LP_PostLen"); + Assert.True(EqualByBound(expectedMean, this.server.Mean_Long_SafeArray_OutLen(data, out len)), $"Mean_Long_SafeArray_OutLen"); + Assert.Equal(data.Length, len); } private void Marshal_ULongArray() @@ -134,10 +134,10 @@ private void Marshal_ULongArray() ulong[] data = BaseData.Select(i => (ulong)i).ToArray(); Console.WriteLine($"{data.GetType().Name} marshalling"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_ULong_LP_PreLen(data.Length, data)), $"Mean_ULong_LP_PreLen"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_ULong_LP_PostLen(data, data.Length)), $"Mean_ULong_LP_PostLen"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_ULong_SafeArray_OutLen(data, out len)), $"Mean_ULong_SafeArray_OutLen"); - Assert.AreEqual(data.Length, len); + Assert.True(EqualByBound(expectedMean, this.server.Mean_ULong_LP_PreLen(data.Length, data)), $"Mean_ULong_LP_PreLen"); + Assert.True(EqualByBound(expectedMean, this.server.Mean_ULong_LP_PostLen(data, data.Length)), $"Mean_ULong_LP_PostLen"); + Assert.True(EqualByBound(expectedMean, this.server.Mean_ULong_SafeArray_OutLen(data, out len)), $"Mean_ULong_SafeArray_OutLen"); + Assert.Equal(data.Length, len); } private void Marshal_FloatArray() @@ -146,10 +146,10 @@ private void Marshal_FloatArray() float[] data = BaseData.Select(i => (float)i).ToArray(); Console.WriteLine($"{data.GetType().Name} marshalling"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Float_LP_PreLen(data.Length, data)), $"Mean_Float_LP_PreLen"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Float_LP_PostLen(data, data.Length)), $"Mean_Float_LP_PostLen"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Float_SafeArray_OutLen(data, out len)), $"Mean_Float_SafeArray_OutLen"); - Assert.AreEqual(data.Length, len); + Assert.True(EqualByBound(expectedMean, this.server.Mean_Float_LP_PreLen(data.Length, data)), $"Mean_Float_LP_PreLen"); + Assert.True(EqualByBound(expectedMean, this.server.Mean_Float_LP_PostLen(data, data.Length)), $"Mean_Float_LP_PostLen"); + Assert.True(EqualByBound(expectedMean, this.server.Mean_Float_SafeArray_OutLen(data, out len)), $"Mean_Float_SafeArray_OutLen"); + Assert.Equal(data.Length, len); } private void Marshal_DoubleArray() @@ -158,10 +158,10 @@ private void Marshal_DoubleArray() double[] data = BaseData.Select(i => (double)i).ToArray(); Console.WriteLine($"{data.GetType().Name} marshalling"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Double_LP_PreLen(data.Length, data)), $"Mean_Double_LP_PreLen"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Double_LP_PostLen(data, data.Length)), $"Mean_Double_LP_PostLen"); - Assert.IsTrue(EqualByBound(expectedMean, this.server.Mean_Double_SafeArray_OutLen(data, out len)), $"Mean_Double_SafeArray_OutLen"); - Assert.AreEqual(data.Length, len); + Assert.True(EqualByBound(expectedMean, this.server.Mean_Double_LP_PreLen(data.Length, data)), $"Mean_Double_LP_PreLen"); + Assert.True(EqualByBound(expectedMean, this.server.Mean_Double_LP_PostLen(data, data.Length)), $"Mean_Double_LP_PostLen"); + Assert.True(EqualByBound(expectedMean, this.server.Mean_Double_SafeArray_OutLen(data, out len)), $"Mean_Double_SafeArray_OutLen"); + Assert.Equal(data.Length, len); } } } diff --git a/src/tests/Interop/COM/NETClients/Primitives/ColorTests.cs b/src/tests/Interop/COM/NETClients/Primitives/ColorTests.cs index 0529b542623472..0ecea298de08fd 100644 --- a/src/tests/Interop/COM/NETClients/Primitives/ColorTests.cs +++ b/src/tests/Interop/COM/NETClients/Primitives/ColorTests.cs @@ -6,7 +6,7 @@ namespace NetClient using System; using System.Drawing; using System.Runtime.InteropServices; - using TestLibrary; + using Xunit; class ColorTests { @@ -24,12 +24,12 @@ public void Run() private void VerifyColorMarshalling() { - Assert.IsTrue(server.AreColorsEqual(Color.Green, ColorTranslator.ToOle(Color.Green))); + Assert.True(server.AreColorsEqual(Color.Green, ColorTranslator.ToOle(Color.Green))); } private void VerifyGetRed() { - Assert.AreEqual(Color.Red, server.GetRed()); + Assert.Equal(Color.Red, server.GetRed()); } } } diff --git a/src/tests/Interop/COM/NETClients/Primitives/ErrorTests.cs b/src/tests/Interop/COM/NETClients/Primitives/ErrorTests.cs index 1ba6b93b1a7eee..b741416ba56b1b 100644 --- a/src/tests/Interop/COM/NETClients/Primitives/ErrorTests.cs +++ b/src/tests/Interop/COM/NETClients/Primitives/ErrorTests.cs @@ -5,7 +5,7 @@ namespace NetClient { using System; using System.Runtime.InteropServices; - using TestLibrary; + using Xunit; class ErrorTests { @@ -52,8 +52,8 @@ private void VerifyReturnHResult() foreach (var hr in hrs) { - Assert.AreEqual(hr, this.server.Return_As_HResult(hr)); - Assert.AreEqual(hr, this.server.Return_As_HResult_Struct(hr).hr); + Assert.Equal(hr, this.server.Return_As_HResult(hr)); + Assert.Equal(hr, this.server.Return_As_HResult_Struct(hr).hr); } } } diff --git a/src/tests/Interop/COM/NETClients/Primitives/NumericTests.cs b/src/tests/Interop/COM/NETClients/Primitives/NumericTests.cs index ec6a2d545505c9..6517191f53cc58 100644 --- a/src/tests/Interop/COM/NETClients/Primitives/NumericTests.cs +++ b/src/tests/Interop/COM/NETClients/Primitives/NumericTests.cs @@ -4,7 +4,7 @@ namespace NetClient { using System; - using TestLibrary; + using Xunit; class NumericTests { @@ -59,145 +59,145 @@ private void Marshal_Byte(byte a, byte b) { var expected = (byte)(a + b); Console.WriteLine($"{expected.GetType().Name} test invariant: {a} + {b} = {expected}"); - Assert.AreEqual(expected, this.server.Add_Byte(a, b)); + Assert.Equal(expected, this.server.Add_Byte(a, b)); var c = byte.MaxValue; this.server.Add_Byte_Ref(a, b, ref c); - Assert.AreEqual(expected, c); + Assert.Equal(expected, c); c = 0; this.server.Add_Byte_Out(a, b, out c); - Assert.AreEqual(expected, c); + Assert.Equal(expected, c); } private void Marshal_Short(short a, short b) { var expected = (short)(a + b); Console.WriteLine($"{expected.GetType().Name} test invariant: {a} + {b} = {expected}"); - Assert.AreEqual(expected, this.server.Add_Short(a, b)); + Assert.Equal(expected, this.server.Add_Short(a, b)); var c = short.MaxValue; this.server.Add_Short_Ref(a, b, ref c); - Assert.AreEqual(expected, c); + Assert.Equal(expected, c); c = 0; this.server.Add_Short_Out(a, b, out c); - Assert.AreEqual(expected, c); + Assert.Equal(expected, c); } private void Marshal_UShort(ushort a, ushort b) { var expected = (ushort)(a + b); Console.WriteLine($"{expected.GetType().Name} test invariant: {a} + {b} = {expected}"); - Assert.AreEqual(expected, this.server.Add_UShort(a, b)); + Assert.Equal(expected, this.server.Add_UShort(a, b)); var c = ushort.MaxValue; this.server.Add_UShort_Ref(a, b, ref c); - Assert.AreEqual(expected, c); + Assert.Equal(expected, c); c = 0; this.server.Add_UShort_Out(a, b, out c); - Assert.AreEqual(expected, c); + Assert.Equal(expected, c); } private void Marshal_Int(int a, int b) { var expected = a + b; Console.WriteLine($"{expected.GetType().Name} test invariant: {a} + {b} = {expected}"); - Assert.AreEqual(expected, this.server.Add_Int(a, b)); + Assert.Equal(expected, this.server.Add_Int(a, b)); var c = int.MaxValue; this.server.Add_Int_Ref(a, b, ref c); - Assert.AreEqual(expected, c); + Assert.Equal(expected, c); c = 0; this.server.Add_Int_Out(a, b, out c); - Assert.AreEqual(expected, c); + Assert.Equal(expected, c); } private void Marshal_UInt(uint a, uint b) { var expected = a + b; Console.WriteLine($"{expected.GetType().Name} test invariant: {a} + {b} = {expected}"); - Assert.AreEqual(expected, this.server.Add_UInt(a, b)); + Assert.Equal(expected, this.server.Add_UInt(a, b)); var c = uint.MaxValue; this.server.Add_UInt_Ref(a, b, ref c); - Assert.AreEqual(expected, c); + Assert.Equal(expected, c); c = 0; this.server.Add_UInt_Out(a, b, out c); - Assert.AreEqual(expected, c); + Assert.Equal(expected, c); } private void Marshal_Long(long a, long b) { var expected = a + b; Console.WriteLine($"{expected.GetType().Name} test invariant: {a} + {b} = {expected}"); - Assert.AreEqual(expected, this.server.Add_Long(a, b)); + Assert.Equal(expected, this.server.Add_Long(a, b)); var c = long.MaxValue; this.server.Add_Long_Ref(a, b, ref c); - Assert.AreEqual(expected, c); + Assert.Equal(expected, c); c = 0; this.server.Add_Long_Out(a, b, out c); - Assert.AreEqual(expected, c); + Assert.Equal(expected, c); } private void Marshal_ULong(ulong a, ulong b) { var expected = a + b; Console.WriteLine($"{expected.GetType().Name} test invariant: {a} + {b} = {expected}"); - Assert.AreEqual(expected, this.server.Add_ULong(a, b)); + Assert.Equal(expected, this.server.Add_ULong(a, b)); var c = ulong.MaxValue; this.server.Add_ULong_Ref(a, b, ref c); - Assert.AreEqual(expected, c); + Assert.Equal(expected, c); c = 0; this.server.Add_ULong_Out(a, b, out c); - Assert.AreEqual(expected, c); + Assert.Equal(expected, c); } private void Marshal_Float(float a, float b) { var expected = a + b; Console.WriteLine($"{expected.GetType().Name} test invariant: {a} + {b} = {expected}"); - Assert.IsTrue(EqualByBound(expected, this.server.Add_Float(a, b)), $"Add_Float: {this.server.Add_Float(a, b)}"); + Assert.True(EqualByBound(expected, this.server.Add_Float(a, b)), $"Add_Float: {this.server.Add_Float(a, b)}"); var c = float.MaxValue; this.server.Add_Float_Ref(a, b, ref c); - Assert.IsTrue(EqualByBound(expected, c), "Add_Float_Ref"); + Assert.True(EqualByBound(expected, c)); c = 0; this.server.Add_Float_Out(a, b, out c); - Assert.IsTrue(EqualByBound(expected, c), "Add_Float_Out"); + Assert.True(EqualByBound(expected, c)); } private void Marshal_Double(double a, double b) { var expected = a + b; Console.WriteLine($"{expected.GetType().Name} test invariant: {a} + {b} = {expected}"); - Assert.IsTrue(EqualByBound(expected, this.server.Add_Double(a, b))); + Assert.True(EqualByBound(expected, this.server.Add_Double(a, b))); var c = double.MaxValue; this.server.Add_Double_Ref(a, b, ref c); - Assert.IsTrue(EqualByBound(expected, c)); + Assert.True(EqualByBound(expected, c)); c = 0; this.server.Add_Double_Out(a, b, out c); - Assert.IsTrue(EqualByBound(expected, c)); + Assert.True(EqualByBound(expected, c)); } private void Marshal_ManyInts() { var expected = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11; Console.WriteLine($"{expected.GetType().Name} 11 test invariant: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 = {expected}"); - Assert.IsTrue(expected == this.server.Add_ManyInts11(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)); + Assert.True(expected == this.server.Add_ManyInts11(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)); expected = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12; Console.WriteLine($"{expected.GetType().Name} 12 test invariant: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 = {expected}"); - Assert.IsTrue(expected == this.server.Add_ManyInts12(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)); + Assert.True(expected == this.server.Add_ManyInts12(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)); } } } diff --git a/src/tests/Interop/COM/NETClients/Primitives/Program.cs b/src/tests/Interop/COM/NETClients/Primitives/Program.cs index 4b1e41121af553..281f4b0719ec14 100644 --- a/src/tests/Interop/COM/NETClients/Primitives/Program.cs +++ b/src/tests/Interop/COM/NETClients/Primitives/Program.cs @@ -6,7 +6,7 @@ namespace NetClient using System; using System.Threading; using System.Runtime.InteropServices; - using TestLibrary; + using Xunit; class Program { diff --git a/src/tests/Interop/COM/NETClients/Primitives/StringTests.cs b/src/tests/Interop/COM/NETClients/Primitives/StringTests.cs index 39267f40521ffe..65ede3c6f1f0f3 100644 --- a/src/tests/Interop/COM/NETClients/Primitives/StringTests.cs +++ b/src/tests/Interop/COM/NETClients/Primitives/StringTests.cs @@ -9,7 +9,7 @@ namespace NetClient using System.Linq; using System.Text; using System.Runtime.InteropServices; - using TestLibrary; + using Xunit; class StringTests { @@ -83,7 +83,7 @@ private void Marshal_LPString() string expected = p.Item1 + p.Item2; string actual = this.server.Add_LPStr(p.Item1, p.Item2); - Assert.AreEqual(expected, actual, "Add_String_LPStr (simple)"); + Assert.Equal(expected, actual); } foreach (var s in reversableStrings) @@ -98,23 +98,23 @@ private void Marshal_LPString() string expected = Reverse(local); string actual = this.server.Reverse_LPStr(local); - Assert.AreEqual(expected, actual); + Assert.Equal(expected, actual); actual = this.server.Reverse_LPStr_Ref(ref local); - Assert.AreEqual(expected, actual); - Assert.AreEqual(expected, local); + Assert.Equal(expected, actual); + Assert.Equal(expected, local); local = s; actual = this.server.Reverse_LPStr_InRef(ref local); - Assert.AreEqual(expected, actual); - Assert.AreEqual(s, local); + Assert.Equal(expected, actual); + Assert.Equal(s, local); this.server.Reverse_LPStr_Out(local, out actual); - Assert.AreEqual(expected, actual); + Assert.Equal(expected, actual); actual = local; this.server.Reverse_LPStr_OutAttr(local, actual); // No-op for strings - Assert.AreEqual(local, actual); + Assert.Equal(local, actual); } foreach (var s in reversableStrings) @@ -129,35 +129,35 @@ private void Marshal_LPString() string expected = Reverse(local.ToString()); StringBuilder actual = this.server.Reverse_SB_LPStr(local); - Assert.AreEqual(expected, actual.ToString()); - Assert.AreEqual(expected, local.ToString()); + Assert.Equal(expected, actual.ToString()); + Assert.Equal(expected, local.ToString()); local = new StringBuilder(s); actual = this.server.Reverse_SB_LPStr_Ref(ref local); - Assert.AreEqual(expected, actual.ToString()); - Assert.AreEqual(expected, local.ToString()); + Assert.Equal(expected, actual.ToString()); + Assert.Equal(expected, local.ToString()); local = new StringBuilder(s); actual = this.server.Reverse_SB_LPStr_InRef(ref local); - Assert.AreEqual(expected, actual.ToString()); + Assert.Equal(expected, actual.ToString()); // Palindromes are _always_ equal if (!string.Equals(s, expected)) { - Assert.AreNotEqual(expected, local.ToString()); + Assert.NotEqual(expected, local.ToString()); } local = new StringBuilder(s); actual = new StringBuilder(); this.server.Reverse_SB_LPStr_Out(local, out actual); - Assert.AreEqual(expected, actual.ToString()); - Assert.AreEqual(expected, local.ToString()); + Assert.Equal(expected, actual.ToString()); + Assert.Equal(expected, local.ToString()); local = new StringBuilder(s); actual = new StringBuilder(s.Length); this.server.Reverse_SB_LPStr_OutAttr(local, actual); - Assert.AreEqual(expected, actual.ToString()); - Assert.AreEqual(expected, local.ToString()); + Assert.Equal(expected, actual.ToString()); + Assert.Equal(expected, local.ToString()); } } @@ -168,7 +168,7 @@ private void Marshal_LPWString() { string expected = p.Item1 + p.Item2; string actual = this.server.Add_LPWStr(p.Item1, p.Item2); - Assert.AreEqual(expected, actual, "Add_String_LPWStr (simple)"); + Assert.Equal(expected, actual); } foreach (var s in reversableStrings) @@ -177,19 +177,19 @@ private void Marshal_LPWString() string expected = Reverse(local); string actual = this.server.Reverse_LPWStr(local); - Assert.AreEqual(expected, actual); + Assert.Equal(expected, actual); actual = this.server.Reverse_LPWStr_Ref(ref local); - Assert.AreEqual(expected, actual); - Assert.AreEqual(expected, local); + Assert.Equal(expected, actual); + Assert.Equal(expected, local); local = s; actual = this.server.Reverse_LPWStr_InRef(ref local); - Assert.AreEqual(expected, actual); - Assert.AreEqual(s, local); + Assert.Equal(expected, actual); + Assert.Equal(s, local); this.server.Reverse_LPWStr_Out(local, out actual); - Assert.AreEqual(expected, actual); + Assert.Equal(expected, actual); actual = local; Assert.Throws( () => this.server.Reverse_LPWStr_OutAttr(local, actual)); @@ -201,35 +201,35 @@ private void Marshal_LPWString() string expected = Reverse(local.ToString()); StringBuilder actual = this.server.Reverse_SB_LPWStr(local); - Assert.AreEqual(expected, actual.ToString()); - Assert.AreEqual(expected, local.ToString()); + Assert.Equal(expected, actual.ToString()); + Assert.Equal(expected, local.ToString()); local = new StringBuilder(s); actual = this.server.Reverse_SB_LPWStr_Ref(ref local); - Assert.AreEqual(expected, actual.ToString()); - Assert.AreEqual(expected, local.ToString()); + Assert.Equal(expected, actual.ToString()); + Assert.Equal(expected, local.ToString()); local = new StringBuilder(s); actual = this.server.Reverse_SB_LPWStr_InRef(ref local); - Assert.AreEqual(expected, actual.ToString()); + Assert.Equal(expected, actual.ToString()); // Palindromes are _always_ equal if (!string.Equals(s, expected)) { - Assert.AreNotEqual(expected, local.ToString()); + Assert.NotEqual(expected, local.ToString()); } local = new StringBuilder(s); actual = new StringBuilder(); this.server.Reverse_SB_LPWStr_Out(local, out actual); - Assert.AreEqual(expected, actual.ToString()); - Assert.AreEqual(expected, local.ToString()); + Assert.Equal(expected, actual.ToString()); + Assert.Equal(expected, local.ToString()); local = new StringBuilder(s); actual = new StringBuilder(s.Length); this.server.Reverse_SB_LPWStr_OutAttr(local, actual); - Assert.AreEqual(expected, actual.ToString()); - Assert.AreEqual(expected, local.ToString()); + Assert.Equal(expected, actual.ToString()); + Assert.Equal(expected, local.ToString()); } } @@ -240,7 +240,7 @@ private void Marshal_BStrString() { string expected = p.Item1 + p.Item2; string actual = this.server.Add_BStr(p.Item1, p.Item2); - Assert.AreEqual(expected, actual, "Add_String_BStr (simple)"); + Assert.Equal(expected, actual); } foreach (var s in reversableStrings) @@ -249,23 +249,23 @@ private void Marshal_BStrString() string expected = Reverse(local); string actual = this.server.Reverse_BStr(local); - Assert.AreEqual(expected, actual); + Assert.Equal(expected, actual); actual = this.server.Reverse_BStr_Ref(ref local); - Assert.AreEqual(expected, actual); - Assert.AreEqual(expected, local); + Assert.Equal(expected, actual); + Assert.Equal(expected, local); local = s; actual = this.server.Reverse_BStr_InRef(ref local); - Assert.AreEqual(expected, actual); - Assert.AreEqual(s, local); + Assert.Equal(expected, actual); + Assert.Equal(s, local); this.server.Reverse_BStr_Out(local, out actual); - Assert.AreEqual(expected, actual); + Assert.Equal(expected, actual); actual = local; this.server.Reverse_BStr_OutAttr(local, actual); // No-op for strings - Assert.AreEqual(local, actual); + Assert.Equal(local, actual); } } @@ -278,7 +278,7 @@ private void Marshal_LCID() string expected = Reverse(local); string actual = this.server.Reverse_LPWStr_With_LCID(local); - Assert.AreEqual(expected, actual); + Assert.Equal(expected, actual); } CultureInfo culture = new CultureInfo("es-ES", false); @@ -288,7 +288,7 @@ private void Marshal_LCID() { CultureInfo.CurrentCulture = culture; this.server.Pass_Through_LCID(out int lcid); - Assert.AreEqual(englishCulture.LCID, lcid); // CLR->COM LCID marshalling is explicitly hardcoded to en-US as requested by VSTO instead of passing the current culture. + Assert.Equal(englishCulture.LCID, lcid); // CLR->COM LCID marshalling is explicitly hardcoded to en-US as requested by VSTO instead of passing the current culture. } finally { diff --git a/src/tests/Interop/COM/NETServer/NETServer.DefaultInterfaces.ilproj b/src/tests/Interop/COM/NETServer/NETServer.DefaultInterfaces.ilproj index f1af2b9c4dedad..852007d0e40fe5 100644 --- a/src/tests/Interop/COM/NETServer/NETServer.DefaultInterfaces.ilproj +++ b/src/tests/Interop/COM/NETServer/NETServer.DefaultInterfaces.ilproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/COM/NETServer/NETServer.csproj b/src/tests/Interop/COM/NETServer/NETServer.csproj index 692bf41ba905b1..0811eaeb0bea09 100644 --- a/src/tests/Interop/COM/NETServer/NETServer.csproj +++ b/src/tests/Interop/COM/NETServer/NETServer.csproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/COM/NativeClients/Events/EventTests.cpp b/src/tests/Interop/COM/NativeClients/Events/EventTests.cpp index 53a05e6bba240e..7b5b7db7caa9a1 100644 --- a/src/tests/Interop/COM/NativeClients/Events/EventTests.cpp +++ b/src/tests/Interop/COM/NativeClients/Events/EventTests.cpp @@ -33,7 +33,7 @@ namespace public: DispIDToStringMap() : _pairs{} - , _end{ _pairs + ARRAYSIZE(_pairs) } + , _end{ _pairs + ARRAY_SIZE(_pairs) } { for (auto curr = _pairs; curr != _end; ++curr) curr->id = DISPID_UNKNOWN; diff --git a/src/tests/Interop/COM/NativeClients/Primitives/ErrorTests.cpp b/src/tests/Interop/COM/NativeClients/Primitives/ErrorTests.cpp index 2def0ac0b9d487..99639a40e052a7 100644 --- a/src/tests/Interop/COM/NativeClients/Primitives/ErrorTests.cpp +++ b/src/tests/Interop/COM/NativeClients/Primitives/ErrorTests.cpp @@ -20,7 +20,7 @@ namespace HRESULT{-1} }; - for (int i = 0; i < ARRAYSIZE(hrs); ++i) + for (int i = 0; i < ARRAY_SIZE(hrs); ++i) { HRESULT hr = hrs[i]; HRESULT hrMaybe = et->Throw_HResult(hr); @@ -44,7 +44,7 @@ namespace HRESULT{2} }; - for (int i = 0; i < ARRAYSIZE(hrs); ++i) + for (int i = 0; i < ARRAY_SIZE(hrs); ++i) { HRESULT hr = hrs[i]; HRESULT hrMaybe = et->Return_As_HResult(hr); @@ -68,7 +68,7 @@ namespace HRESULT{2} }; - for (int i = 0; i < ARRAYSIZE(hrs); ++i) + for (int i = 0; i < ARRAY_SIZE(hrs); ++i) { HRESULT hr = hrs[i]; HRESULT hrMaybe = et->Return_As_HResult_Struct(hr); diff --git a/src/tests/Interop/COM/NativeServer/DispatchTesting.h b/src/tests/Interop/COM/NativeServer/DispatchTesting.h index 26ab5e86ed94b7..927439fe03dc48 100644 --- a/src/tests/Interop/COM/NativeServer/DispatchTesting.h +++ b/src/tests/Interop/COM/NativeServer/DispatchTesting.h @@ -25,7 +25,7 @@ class Enumerator : public UnknownImpl, public IEnumVARIANT { } public: // IEnumVARIANT - HRESULT STDMETHODCALLTYPE Next( + HRESULT STDMETHODCALLTYPE Next( ULONG celt, VARIANT *rgVar, ULONG *pCeltFetched) @@ -36,7 +36,7 @@ class Enumerator : public UnknownImpl, public IEnumVARIANT V_VT(&rgVar[*pCeltFetched]) = VT_I4; V_I4(&(rgVar[*pCeltFetched])) = _current; } - + return celt == *pCeltFetched ? S_OK : S_FALSE; } @@ -89,22 +89,22 @@ class DispatchTesting : public UnknownImpl, public IDispatchTesting static const int NamesCount; public: // IDispatch - virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount( + virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount( /* [out] */ __RPC__out UINT *pctinfo) { *pctinfo = 0; return S_OK; } - - virtual HRESULT STDMETHODCALLTYPE GetTypeInfo( + + virtual HRESULT STDMETHODCALLTYPE GetTypeInfo( /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames( + + virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames( /* [in] */ __RPC__in REFIID, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, @@ -134,7 +134,7 @@ class DispatchTesting : public UnknownImpl, public IDispatchTesting return (containsUnknown) ? DISP_E_UNKNOWNNAME : S_OK; } - virtual /* [local] */ HRESULT STDMETHODCALLTYPE Invoke( + virtual /* [local] */ HRESULT STDMETHODCALLTYPE Invoke( /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, @@ -278,13 +278,13 @@ class DispatchTesting : public UnknownImpl, public IDispatchTesting __int64 *l_args[2]; unsigned __int64 *ul_args[2]; size_t expectedArgCount = - ARRAYSIZE(b_args) - + ARRAYSIZE(s_args) - + ARRAYSIZE(us_args) - + ARRAYSIZE(i_args) - + ARRAYSIZE(ui_args) - + ARRAYSIZE(l_args) - + ARRAYSIZE(ul_args); + ARRAY_SIZE(b_args) + + ARRAY_SIZE(s_args) + + ARRAY_SIZE(us_args) + + ARRAY_SIZE(i_args) + + ARRAY_SIZE(ui_args) + + ARRAY_SIZE(l_args) + + ARRAY_SIZE(ul_args); RETURN_IF_FAILED(VerifyValues(UINT(expectedArgCount), pDispParams->cArgs)); VARENUM currType; @@ -371,7 +371,7 @@ class DispatchTesting : public UnknownImpl, public IDispatchTesting HRESULT hr; float *args[2]; - size_t expectedArgCount = ARRAYSIZE(args); + size_t expectedArgCount = ARRAY_SIZE(args); RETURN_IF_FAILED(VerifyValues(UINT(expectedArgCount), pDispParams->cArgs)); if (pVarResult == nullptr) @@ -401,7 +401,7 @@ class DispatchTesting : public UnknownImpl, public IDispatchTesting HRESULT hr; double *args[2]; - size_t expectedArgCount = ARRAYSIZE(args); + size_t expectedArgCount = ARRAY_SIZE(args); RETURN_IF_FAILED(VerifyValues(UINT(expectedArgCount), pDispParams->cArgs)); if (pVarResult == nullptr) @@ -434,7 +434,7 @@ class DispatchTesting : public UnknownImpl, public IDispatchTesting HRESULT hr; int *args[2]; - size_t expectedArgCount = ARRAYSIZE(args); + size_t expectedArgCount = ARRAY_SIZE(args); RETURN_IF_FAILED(VerifyValues(UINT(expectedArgCount), pDispParams->cArgs)); VARENUM currType; @@ -461,8 +461,8 @@ class DispatchTesting : public UnknownImpl, public IDispatchTesting *puArgErr = 1; pExcepInfo->scode = HRESULT_FROM_WIN32(*args[1]); - WCHAR buffer[ARRAYSIZE(W("4294967295"))]; - _snwprintf_s(buffer, ARRAYSIZE(buffer), _TRUNCATE, W("%x"), *args[1]); + WCHAR buffer[ARRAY_SIZE(W("4294967295"))]; + _snwprintf_s(buffer, ARRAY_SIZE(buffer), _TRUNCATE, W("%x"), *args[1]); pExcepInfo->bstrDescription = SysAllocString(buffer); } @@ -474,7 +474,7 @@ class DispatchTesting : public UnknownImpl, public IDispatchTesting HRESULT hr; HFA_4 *args[1]; - size_t expectedArgCount = ARRAYSIZE(args); + size_t expectedArgCount = ARRAY_SIZE(args); RETURN_IF_FAILED(VerifyValues(UINT(expectedArgCount), pDispParams->cArgs)); VARENUM currType; @@ -523,4 +523,4 @@ const WCHAR * const DispatchTesting::Names[] = W("ExplicitGetEnumerator") }; -const int DispatchTesting::NamesCount = ARRAYSIZE(DispatchTesting::Names); +const int DispatchTesting::NamesCount = ARRAY_SIZE(DispatchTesting::Names); diff --git a/src/tests/Interop/COM/NativeServer/EventTesting.h b/src/tests/Interop/COM/NativeServer/EventTesting.h index ce5ef5b094ecf4..f9ffc32ae19a3e 100644 --- a/src/tests/Interop/COM/NativeServer/EventTesting.h +++ b/src/tests/Interop/COM/NativeServer/EventTesting.h @@ -26,22 +26,22 @@ class EventTesting : } public: // IDispatch - virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount( + virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount( /* [out] */ __RPC__out UINT *pctinfo) { *pctinfo = 0; return S_OK; } - - virtual HRESULT STDMETHODCALLTYPE GetTypeInfo( + + virtual HRESULT STDMETHODCALLTYPE GetTypeInfo( /* [in] */ UINT iTInfo, /* [in] */ LCID lcid, /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames( + + virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames( /* [in] */ __RPC__in REFIID, /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, @@ -71,7 +71,7 @@ class EventTesting : return (containsUnknown) ? DISP_E_UNKNOWNNAME : S_OK; } - virtual /* [local] */ HRESULT STDMETHODCALLTYPE Invoke( + virtual /* [local] */ HRESULT STDMETHODCALLTYPE Invoke( /* [annotation][in] */ _In_ DISPID dispIdMember, /* [annotation][in] */ _In_ REFIID riid, /* [annotation][in] */ _In_ LCID lcid, @@ -103,12 +103,12 @@ class EventTesting : } public: // IConnectionPointContainer - virtual HRESULT STDMETHODCALLTYPE EnumConnectionPoints( + virtual HRESULT STDMETHODCALLTYPE EnumConnectionPoints( /* [out] */ __RPC__deref_out_opt IEnumConnectionPoints **ppEnum) { return E_NOTIMPL; } - virtual HRESULT STDMETHODCALLTYPE FindConnectionPoint( + virtual HRESULT STDMETHODCALLTYPE FindConnectionPoint( /* [in] */ __RPC__in REFIID riid, /* [out] */ __RPC__deref_out_opt IConnectionPoint **ppCP) { @@ -119,24 +119,24 @@ class EventTesting : } public: // IConnectionPoint - virtual HRESULT STDMETHODCALLTYPE GetConnectionInterface( + virtual HRESULT STDMETHODCALLTYPE GetConnectionInterface( /* [out] */ __RPC__out IID *pIID) { return E_NOTIMPL; } - virtual HRESULT STDMETHODCALLTYPE GetConnectionPointContainer( + virtual HRESULT STDMETHODCALLTYPE GetConnectionPointContainer( /* [out] */ __RPC__deref_out_opt IConnectionPointContainer **ppCPC) { return E_NOTIMPL; } - virtual HRESULT STDMETHODCALLTYPE Advise( + virtual HRESULT STDMETHODCALLTYPE Advise( /* [in] */ __RPC__in_opt IUnknown *pUnkSink, /* [out] */ __RPC__out DWORD *pdwCookie) { if (pUnkSink == nullptr || pdwCookie == nullptr) return E_POINTER; - for (DWORD i = 0; i < ARRAYSIZE(_eventConnections); ++i) + for (DWORD i = 0; i < ARRAY_SIZE(_eventConnections); ++i) { if (_eventConnections[i] == nullptr) { @@ -153,10 +153,10 @@ class EventTesting : return CONNECT_E_ADVISELIMIT; } - virtual HRESULT STDMETHODCALLTYPE Unadvise( + virtual HRESULT STDMETHODCALLTYPE Unadvise( /* [in] */ DWORD dwCookie) { - if (0 <= dwCookie && dwCookie < ARRAYSIZE(_eventConnections)) + if (0 <= dwCookie && dwCookie < ARRAY_SIZE(_eventConnections)) { IDispatch *handler = _eventConnections[dwCookie]; if (handler != nullptr) @@ -169,7 +169,7 @@ class EventTesting : return E_POINTER; } - virtual HRESULT STDMETHODCALLTYPE EnumConnections( + virtual HRESULT STDMETHODCALLTYPE EnumConnections( /* [out] */ __RPC__deref_out_opt IEnumConnections **ppEnum) { return E_NOTIMPL; @@ -186,7 +186,7 @@ class EventTesting : arg.vt = VT_BSTR; arg.bstrVal = TP_SysAllocString(Names[dispId]); - for (DWORD i = 0; i < ARRAYSIZE(_eventConnections); ++i) + for (DWORD i = 0; i < ARRAY_SIZE(_eventConnections); ++i) { IDispatch *handler = _eventConnections[i]; if (handler != nullptr) @@ -233,4 +233,4 @@ const WCHAR * const EventTesting::Names[] = W("FireEvent"), }; -const int EventTesting::NamesCount = ARRAYSIZE(EventTesting::Names); +const int EventTesting::NamesCount = ARRAY_SIZE(EventTesting::Names); diff --git a/src/tests/Interop/COM/NativeServer/Servers.cpp b/src/tests/Interop/COM/NativeServer/Servers.cpp index 30fcea847aee2e..6ed9d11460dee3 100644 --- a/src/tests/Interop/COM/NativeServer/Servers.cpp +++ b/src/tests/Interop/COM/NativeServer/Servers.cpp @@ -124,7 +124,7 @@ namespace return HRESULT_FROM_WIN32(::GetLastError()); } - ::GetModuleFileNameW(mod, fullPath, ARRAYSIZE(fullPath)); + ::GetModuleFileNameW(mod, fullPath, ARRAY_SIZE(fullPath)); // The default value for the key is the path to the DLL res = ::RegSetValueExW( diff --git a/src/tests/Interop/COM/Reflection/Reflection.cs b/src/tests/Interop/COM/Reflection/Reflection.cs index d850e9c5b61375..fc1c871702968f 100644 --- a/src/tests/Interop/COM/Reflection/Reflection.cs +++ b/src/tests/Interop/COM/Reflection/Reflection.cs @@ -7,7 +7,7 @@ using System.Security; using System.Reflection; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; public class Reflection { diff --git a/src/tests/Interop/Directory.Build.targets b/src/tests/Interop/Directory.Build.targets index e8bd4283d77df0..12c68c9564410a 100644 --- a/src/tests/Interop/Directory.Build.targets +++ b/src/tests/Interop/Directory.Build.targets @@ -3,19 +3,11 @@ - + - - - - - - diff --git a/src/tests/Interop/DllImportAttribute/ExactSpelling/ExactSpellingTest.cs b/src/tests/Interop/DllImportAttribute/ExactSpelling/ExactSpellingTest.cs index 929f2b7518765f..0747fd478df389 100644 --- a/src/tests/Interop/DllImportAttribute/ExactSpelling/ExactSpellingTest.cs +++ b/src/tests/Interop/DllImportAttribute/ExactSpelling/ExactSpellingTest.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; class ExactSpellingTest { @@ -149,7 +149,7 @@ public static int Main(string[] args) private static void Verify(int expectedReturnValue, int expectedParameterValue, int actualReturnValue, int actualParameterValue) { - Assert.AreEqual(expectedReturnValue, actualReturnValue); - Assert.AreEqual(expectedParameterValue, actualParameterValue); + Assert.Equal(expectedReturnValue, actualReturnValue); + Assert.Equal(expectedParameterValue, actualParameterValue); } } diff --git a/src/tests/Interop/ICastable/Castable.cs b/src/tests/Interop/ICastable/Castable.cs index ee45820c9c808b..5493d164189992 100644 --- a/src/tests/Interop/ICastable/Castable.cs +++ b/src/tests/Interop/ICastable/Castable.cs @@ -4,8 +4,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Runtime.CompilerServices; - -using Console = Internal.Console; +using Xunit; public interface IRetArg { @@ -114,22 +113,17 @@ public RuntimeTypeHandle GetImplType(RuntimeTypeHandle interfaceType) return default(RuntimeTypeHandle); } } - -public class Program +public class CastableTests { - private static bool passed = true; - public static void Assert(bool value, string message) { - if (!value) - { - Console.WriteLine("FAIL! " + message); - passed = false; - } + Xunit.Assert.True(value, message); } - public static int Main() + [Fact] + [SkipOnMono("ICastable is unsupported on Mono")] + public static void Test() { //Console.WriteLine("Execution started. Attach debugger and press enter."); //Console.ReadLine(); @@ -145,7 +139,7 @@ public static int Main() { typeof(IExtra), null }, //we should never use it } ); - + // testing simple cases Assert(implProxy is IRetThis, "implProxy should be castable to IRetThis via is"); Assert(!(implProxy is IUnimplemented), "implProxy should not be castable to IUnimplemented via is"); @@ -158,7 +152,7 @@ public static int Main() Assert(!(implProxy is IUnimplemented), "implProxy should not be castable to IUnimplemented via is"); Assert((implProxy as IUnimplemented) == null, "implProxy should not be castable to IUnimplemented via as"); - + // testing generics IRetArg retArgStr = (IRetArg)implProxy; Assert(retArgStr.ReturnArg("hohoho") == "hohoho", "retArgStr.ReturnArg() should return arg"); @@ -184,7 +178,7 @@ public static int Main() { var _ = (IRetThis)nullCastable; Assert(false, "Exceptions should be thrown from IsInstanceOfInterface"); - } + } catch (CastableException) {} Assert(!(nullCastable is IRetThis), "null castable shouldn't be allowed to be casted to anything"); @@ -198,7 +192,7 @@ public static int Main() var r = (IRetThis)badCastable; r.ReturnThis(); Assert(false, "Exceptions should be thrown from ReturnThis()"); - } + } catch (EntryPointNotFoundException) {} //delegate testing @@ -212,17 +206,5 @@ public static int Main() { Assert(false, e.ToString()); } - - if (passed) - { - Console.WriteLine("Test PASSED!"); - return 100; - } - else - { - Console.WriteLine("Test FAILED!"); - return -1; - } - } } diff --git a/src/tests/Interop/ICastable/Castable.csproj b/src/tests/Interop/ICastable/Castable.csproj index 6a0eb0bcfe5472..76fc6021a4ae72 100644 --- a/src/tests/Interop/ICastable/Castable.csproj +++ b/src/tests/Interop/ICastable/Castable.csproj @@ -1,11 +1,9 @@ - Exe - - true - true + true + diff --git a/src/tests/Interop/ICastable/ICastable.CoreLib.csproj b/src/tests/Interop/ICastable/ICastable.CoreLib.csproj new file mode 100644 index 00000000000000..482a08e0f78ca5 --- /dev/null +++ b/src/tests/Interop/ICastable/ICastable.CoreLib.csproj @@ -0,0 +1,17 @@ + + + + Library + SharedLibrary + System.Private.CoreLib + annotations + + + + + diff --git a/src/tests/Interop/ICustomMarshaler/ConflictingNames/CustomMarshaler.csproj b/src/tests/Interop/ICustomMarshaler/ConflictingNames/CustomMarshaler.csproj index 62f881960dfb6c..f5b3f49b5fa46c 100644 --- a/src/tests/Interop/ICustomMarshaler/ConflictingNames/CustomMarshaler.csproj +++ b/src/tests/Interop/ICustomMarshaler/ConflictingNames/CustomMarshaler.csproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/ICustomMarshaler/ConflictingNames/CustomMarshaler2.csproj b/src/tests/Interop/ICustomMarshaler/ConflictingNames/CustomMarshaler2.csproj index d4ce512927a3d0..6ff4d64566d732 100644 --- a/src/tests/Interop/ICustomMarshaler/ConflictingNames/CustomMarshaler2.csproj +++ b/src/tests/Interop/ICustomMarshaler/ConflictingNames/CustomMarshaler2.csproj @@ -1,6 +1,7 @@ library + SharedLibrary $(DefineConstants);CUSTOMMARSHALERS2 diff --git a/src/tests/Interop/ICustomMarshaler/ConflictingNames/RunInALC.cs b/src/tests/Interop/ICustomMarshaler/ConflictingNames/RunInALC.cs index 35731c7d6d3aa8..2881add91b2a2f 100644 --- a/src/tests/Interop/ICustomMarshaler/ConflictingNames/RunInALC.cs +++ b/src/tests/Interop/ICustomMarshaler/ConflictingNames/RunInALC.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Reflection; using System.Runtime.Loader; -using TestLibrary; +using Xunit; public class RunInALC { @@ -44,7 +44,7 @@ static void Run(AssemblyLoadContext context) Type inContextType = inContextAssembly.GetType("CustomMarshalers.CustomMarshalerTest"); object instance = Activator.CreateInstance(inContextType); MethodInfo parseIntMethod = inContextType.GetMethod("ParseInt", BindingFlags.Instance | BindingFlags.Public); - Assert.AreEqual(1234, (int)parseIntMethod.Invoke(instance, new object[]{"1234"})); + Assert.Equal(1234, (int)parseIntMethod.Invoke(instance, new object[]{"1234"})); GC.KeepAlive(context); } } diff --git a/src/tests/Interop/ICustomMarshaler/ConflictingNames/SameNameDifferentAssembly.cs b/src/tests/Interop/ICustomMarshaler/ConflictingNames/SameNameDifferentAssembly.cs index 81712793bd2f8d..f9dec3c507d2fa 100644 --- a/src/tests/Interop/ICustomMarshaler/ConflictingNames/SameNameDifferentAssembly.cs +++ b/src/tests/Interop/ICustomMarshaler/ConflictingNames/SameNameDifferentAssembly.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Reflection; using System.Runtime.Loader; -using TestLibrary; +using Xunit; public class RunInALC { @@ -14,8 +14,8 @@ public static int Main(string[] args) { try { - Assert.AreEqual(123, new CustomMarshalers.CustomMarshalerTest().ParseInt("123")); - Assert.AreEqual(123, new CustomMarshalers2.CustomMarshalerTest().ParseInt("123")); + Assert.Equal(123, new CustomMarshalers.CustomMarshalerTest().ParseInt("123")); + Assert.Equal(123, new CustomMarshalers2.CustomMarshalerTest().ParseInt("123")); return 100; } catch (Exception e) diff --git a/src/tests/Interop/ICustomMarshaler/Primitives/ICustomMarshaler.cs b/src/tests/Interop/ICustomMarshaler/Primitives/ICustomMarshaler.cs index 2b6a388c25bafc..a8ef865e7a832b 100644 --- a/src/tests/Interop/ICustomMarshaler/Primitives/ICustomMarshaler.cs +++ b/src/tests/Interop/ICustomMarshaler/Primitives/ICustomMarshaler.cs @@ -630,8 +630,6 @@ public static int Main(String[] args) Parameter_MarshalerOnValueType_ThrowsMarshalDirectiveException(); Parameter_MarshalerOnPointer_ThrowsMarshalDirectiveException(); Parameter_NullICustomMarshaler_ThrowsTypeLoadException(); - Parameter_MarshalerOnPointer_ThrowsMarshalDirectiveException(); - Parameter_NullICustomMarshaler_ThrowsTypeLoadException(); Parameter_NotICustomMarshaler_ThrowsApplicationException(); Parameter_OpenGenericICustomMarshaler_ThrowsTypeLoadException(); Parameter_GetInstanceMethodDoesntExist_ThrowsApplicationException(); diff --git a/src/tests/Interop/ICustomMarshaler/Primitives/ICustomMarshaler_TargetUnix.csproj b/src/tests/Interop/ICustomMarshaler/Primitives/ICustomMarshaler_TargetUnix.csproj index dd746d4181fb87..6fcc5f2e6ac204 100644 --- a/src/tests/Interop/ICustomMarshaler/Primitives/ICustomMarshaler_TargetUnix.csproj +++ b/src/tests/Interop/ICustomMarshaler/Primitives/ICustomMarshaler_TargetUnix.csproj @@ -9,6 +9,5 @@ - diff --git a/src/tests/Interop/ICustomMarshaler/Primitives/ICustomMarshaler_TargetWindows.csproj b/src/tests/Interop/ICustomMarshaler/Primitives/ICustomMarshaler_TargetWindows.csproj index 3c152f7cb31b83..febed8fcc2aa01 100644 --- a/src/tests/Interop/ICustomMarshaler/Primitives/ICustomMarshaler_TargetWindows.csproj +++ b/src/tests/Interop/ICustomMarshaler/Primitives/ICustomMarshaler_TargetWindows.csproj @@ -10,6 +10,5 @@ - diff --git a/src/tests/Interop/IDynamicInterfaceCastable/Program.cs b/src/tests/Interop/IDynamicInterfaceCastable/Program.cs index 73ab60afa3adea..b1c8d2511a6e09 100644 --- a/src/tests/Interop/IDynamicInterfaceCastable/Program.cs +++ b/src/tests/Interop/IDynamicInterfaceCastable/Program.cs @@ -6,7 +6,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; namespace IDynamicInterfaceCastableTests { @@ -72,7 +72,7 @@ public static int GetNumberStatic() public int GetNumberHelper() { - Assert.Fail("Calling a public interface method with a default implementation should go through IDynamicInterfaceCastable for interface dispatch."); + Assert.True(false, "Calling a public interface method with a default implementation should go through IDynamicInterfaceCastable for interface dispatch."); return 0; } @@ -312,24 +312,24 @@ private static void ValidateBasicInterface() Console.WriteLine(" -- Validate cast"); // ITest -> ITestImpl - Assert.IsTrue(castableObj is ITest, $"Should be castable to {nameof(ITest)} via is"); - Assert.IsNotNull(castableObj as ITest, $"Should be castable to {nameof(ITest)} via as"); + Assert.True(castableObj is ITest); + Assert.NotNull(castableObj as ITest); var testObj = (ITest)castableObj; Console.WriteLine(" -- Validate method call"); - Assert.AreSame(castableObj, testObj.ReturnThis(), $"{nameof(ITest.ReturnThis)} should return actual object"); - Assert.AreEqual(typeof(DynamicInterfaceCastable), testObj.GetMyType(), $"{nameof(ITest.GetMyType)} should return typeof(DynamicInterfaceCastable)"); + Assert.Same(castableObj, testObj.ReturnThis()); + Assert.Equal(typeof(DynamicInterfaceCastable), testObj.GetMyType()); Console.WriteLine(" -- Validate method call which calls methods using 'this'"); - Assert.AreEqual(DynamicInterfaceCastable.ImplementedMethodReturnValue, testObj.CallImplemented(ImplementationToCall.Class)); - Assert.AreEqual(ITestImpl.GetNumberReturnValue, testObj.CallImplemented(ImplementationToCall.Interface)); - Assert.AreEqual(ITestImpl.GetNumberPrivateReturnValue, testObj.CallImplemented(ImplementationToCall.InterfacePrivate)); - Assert.AreEqual(ITestImpl.GetNumberStaticReturnValue, testObj.CallImplemented(ImplementationToCall.InterfaceStatic)); + Assert.Equal(DynamicInterfaceCastable.ImplementedMethodReturnValue, testObj.CallImplemented(ImplementationToCall.Class)); + Assert.Equal(ITestImpl.GetNumberReturnValue, testObj.CallImplemented(ImplementationToCall.Interface)); + Assert.Equal(ITestImpl.GetNumberPrivateReturnValue, testObj.CallImplemented(ImplementationToCall.InterfacePrivate)); + Assert.Equal(ITestImpl.GetNumberStaticReturnValue, testObj.CallImplemented(ImplementationToCall.InterfaceStatic)); Assert.Throws(() => testObj.CallImplemented(ImplementationToCall.ImplInterfacePublic)); Console.WriteLine(" -- Validate delegate call"); Func func = new Func(testObj.ReturnThis); - Assert.AreSame(castableObj, func(), $"Delegate call to {nameof(ITest.ReturnThis)} should return this"); + Assert.Same(castableObj, func()); } private static void ValidateGenericInterface() @@ -345,42 +345,42 @@ private static void ValidateGenericInterface() Console.WriteLine(" -- Validate cast"); // ITestGeneric -> ITestGenericIntImpl - Assert.IsTrue(castableObj is ITestGeneric, $"Should be castable to {nameof(ITestGeneric)} via is"); - Assert.IsNotNull(castableObj as ITestGeneric, $"Should be castable to {nameof(ITestGeneric)} via as"); + Assert.True(castableObj is ITestGeneric, $"Should be castable to {nameof(ITestGeneric)} via is"); + Assert.NotNull(castableObj as ITestGeneric); ITestGeneric testInt = (ITestGeneric)castableObj; // ITestGeneric -> ITestGenericImpl - Assert.IsTrue(castableObj is ITestGeneric, $"Should be castable to {nameof(ITestGeneric)} via is"); - Assert.IsNotNull(castableObj as ITestGeneric, $"Should be castable to {nameof(ITestGeneric)} via as"); + Assert.True(castableObj is ITestGeneric, $"Should be castable to {nameof(ITestGeneric)} via is"); + Assert.NotNull(castableObj as ITestGeneric); ITestGeneric testStr = (ITestGeneric)castableObj; // Validate Variance // ITestGeneric -> ITestGenericImpl - Assert.IsTrue(castableObj is ITestGeneric, $"Should be castable to {nameof(ITestGeneric)} via is"); - Assert.IsNotNull(castableObj as ITestGeneric, $"Should be castable to {nameof(ITestGeneric)} via as"); + Assert.True(castableObj is ITestGeneric, $"Should be castable to {nameof(ITestGeneric)} via is"); + Assert.NotNull(castableObj as ITestGeneric); ITestGeneric testVar = (ITestGeneric)castableObj; // ITestGeneric is not recognized - Assert.IsFalse(castableObj is ITestGeneric, $"Should not be castable to {nameof(ITestGeneric)} via is"); - Assert.IsNull(castableObj as ITestGeneric, $"Should not be castable to {nameof(ITestGeneric)} via as"); + Assert.False(castableObj is ITestGeneric, $"Should not be castable to {nameof(ITestGeneric)} via is"); + Assert.Null(castableObj as ITestGeneric); var ex = Assert.Throws(() => { var _ = (ITestGeneric)castableObj; }); - Assert.AreEqual(string.Format(DynamicInterfaceCastableException.ErrorFormat, typeof(ITestGeneric)), ex.Message); + Assert.Equal(string.Format(DynamicInterfaceCastableException.ErrorFormat, typeof(ITestGeneric)), ex.Message); int expectedInt = 42; string expectedStr = "str"; Console.WriteLine(" -- Validate method call"); - Assert.AreEqual(expectedInt, testInt.ReturnArg(42)); - Assert.AreEqual(expectedStr, testStr.ReturnArg(expectedStr)); - Assert.AreEqual(expectedStr, testVar.ReturnArg(expectedStr)); + Assert.Equal(expectedInt, testInt.ReturnArg(42)); + Assert.Equal(expectedStr, testStr.ReturnArg(expectedStr)); + Assert.Equal(expectedStr, testVar.ReturnArg(expectedStr)); Console.WriteLine(" -- Validate delegate call"); Func funcInt = new Func(testInt.ReturnArg); - Assert.AreEqual(expectedInt, funcInt(expectedInt)); + Assert.Equal(expectedInt, funcInt(expectedInt)); Func funcStr = new Func(testStr.ReturnArg); - Assert.AreEqual(expectedStr, funcStr(expectedStr)); + Assert.Equal(expectedStr, funcStr(expectedStr)); Func funcVar = new Func(testVar.ReturnArg); - Assert.AreEqual(expectedStr, funcVar(expectedStr)); + Assert.Equal(expectedStr, funcVar(expectedStr)); } private static void ValidateOverriddenInterface() @@ -395,25 +395,25 @@ private static void ValidateOverriddenInterface() Console.WriteLine(" -- Validate cast"); // IOverrideTest -> IOverrideTestImpl - Assert.IsTrue(castableObj is IOverrideTest, $"Should be castable to {nameof(IOverrideTest)} via is"); - Assert.IsNotNull(castableObj as IOverrideTest, $"Should be castable to {nameof(IOverrideTest)} via as"); + Assert.True(castableObj is IOverrideTest, $"Should be castable to {nameof(IOverrideTest)} via is"); + Assert.NotNull(castableObj as IOverrideTest); var testObj = (IOverrideTest)castableObj; Console.WriteLine(" -- Validate method call"); - Assert.AreSame(castableObj, testObj.ReturnThis(), $"{nameof(IOverrideTest.ReturnThis)} should return actual object"); - Assert.AreEqual(IOverrideTestImpl.GetMyTypeReturnValue, testObj.GetMyType(), $"{nameof(IOverrideTest.GetMyType)} should return {IOverrideTestImpl.GetMyTypeReturnValue}"); + Assert.Same(castableObj, testObj.ReturnThis()); + Assert.Equal(IOverrideTestImpl.GetMyTypeReturnValue, testObj.GetMyType()); Console.WriteLine(" -- Validate method call which calls methods using 'this'"); - Assert.AreEqual(DynamicInterfaceCastable.ImplementedMethodReturnValue, testObj.CallImplemented(ImplementationToCall.Class)); - Assert.AreEqual(IOverrideTestImpl.GetNumberReturnValue_Override, testObj.CallImplemented(ImplementationToCall.Interface)); - Assert.AreEqual(ITestImpl.GetNumberPrivateReturnValue, testObj.CallImplemented(ImplementationToCall.InterfacePrivate)); - Assert.AreEqual(ITestImpl.GetNumberStaticReturnValue, testObj.CallImplemented(ImplementationToCall.InterfaceStatic)); + Assert.Equal(DynamicInterfaceCastable.ImplementedMethodReturnValue, testObj.CallImplemented(ImplementationToCall.Class)); + Assert.Equal(IOverrideTestImpl.GetNumberReturnValue_Override, testObj.CallImplemented(ImplementationToCall.Interface)); + Assert.Equal(ITestImpl.GetNumberPrivateReturnValue, testObj.CallImplemented(ImplementationToCall.InterfacePrivate)); + Assert.Equal(ITestImpl.GetNumberStaticReturnValue, testObj.CallImplemented(ImplementationToCall.InterfaceStatic)); Console.WriteLine(" -- Validate delegate call"); Func func = new Func(testObj.ReturnThis); - Assert.AreSame(castableObj, func(), $"Delegate call to {nameof(IOverrideTest.ReturnThis)} should return this"); + Assert.Same(castableObj, func()); Func funcGetType = new Func(testObj.GetMyType); - Assert.AreEqual(IOverrideTestImpl.GetMyTypeReturnValue, funcGetType(), $"Delegate call to {nameof(IOverrideTest.GetMyType)} should return {IOverrideTestImpl.GetMyTypeReturnValue}"); + Assert.Equal(IOverrideTestImpl.GetMyTypeReturnValue, funcGetType()); } private static void ValidateNotImplemented() @@ -424,10 +424,10 @@ private static void ValidateNotImplemented() { typeof(ITest), typeof(ITestImpl) } }); - Assert.IsFalse(castableObj is INotImplemented, $"Should not be castable to {nameof(INotImplemented)} via is"); - Assert.IsNull(castableObj as INotImplemented, $"Should not be castable to {nameof(INotImplemented)} via as"); + Assert.False(castableObj is INotImplemented, $"Should not be castable to {nameof(INotImplemented)} via is"); + Assert.Null(castableObj as INotImplemented); var ex = Assert.Throws(() => { var _ = (INotImplemented)castableObj; }); - Assert.AreEqual(string.Format(DynamicInterfaceCastableException.ErrorFormat, typeof(INotImplemented)), ex.Message); + Assert.Equal(string.Format(DynamicInterfaceCastableException.ErrorFormat, typeof(INotImplemented)), ex.Message); } private static void ValidateDirectlyImplemented() @@ -440,16 +440,16 @@ private static void ValidateDirectlyImplemented() }); Console.WriteLine(" -- Validate cast"); - Assert.IsTrue(castableObj is IDirectlyImplemented, $"Should be castable to {nameof(IDirectlyImplemented)} via is"); - Assert.IsNotNull(castableObj as IDirectlyImplemented, $"Should be castable to {nameof(IDirectlyImplemented)} via as"); + Assert.True(castableObj is IDirectlyImplemented, $"Should be castable to {nameof(IDirectlyImplemented)} via is"); + Assert.NotNull(castableObj as IDirectlyImplemented); var direct = (IDirectlyImplemented)castableObj; Console.WriteLine(" -- Validate method call"); - Assert.AreEqual(DynamicInterfaceCastable.ImplementedMethodReturnValue, direct.ImplementedMethod()); + Assert.Equal(DynamicInterfaceCastable.ImplementedMethodReturnValue, direct.ImplementedMethod()); Console.WriteLine(" -- Validate delegate call"); Func func = new Func(direct.ImplementedMethod); - Assert.AreEqual(DynamicInterfaceCastable.ImplementedMethodReturnValue, func()); + Assert.Equal(DynamicInterfaceCastable.ImplementedMethodReturnValue, func()); } private static void ValidateErrorHandling() @@ -496,7 +496,7 @@ private static void ValidateErrorHandling() Console.WriteLine(" -- Validate exception thrown"); castableObj.InvalidImplementation = BadDynamicInterfaceCastable.InvalidReturn.ThrowException; ex = Assert.Throws(() => { var _ = (ITest)castableObj; }); - Assert.AreEqual(string.Format(DynamicInterfaceCastableException.ErrorFormat, typeof(ITest)), ex.Message); + Assert.Equal(string.Format(DynamicInterfaceCastableException.ErrorFormat, typeof(ITest)), ex.Message); Console.WriteLine($" ---- {ex.GetType().Name}: {ex.Message}"); Console.WriteLine(" -- Validate reabstracted implementation"); diff --git a/src/tests/Interop/IJW/CopyConstructorMarshaler/CopyConstructorMarshaler.cs b/src/tests/Interop/IJW/CopyConstructorMarshaler/CopyConstructorMarshaler.cs index 4b3008aa72dd02..0ed2e87e266ed1 100644 --- a/src/tests/Interop/IJW/CopyConstructorMarshaler/CopyConstructorMarshaler.cs +++ b/src/tests/Interop/IJW/CopyConstructorMarshaler/CopyConstructorMarshaler.cs @@ -5,7 +5,7 @@ using System.IO; using System.Reflection; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; namespace CopyConstructorMarshaler { @@ -26,24 +26,24 @@ static int Main(string[] args) MethodInfo testMethod = testType.GetMethod("PInvokeNumCopies"); // PInvoke will copy twice. Once from argument to parameter, and once from the managed to native parameter. - Assert.AreEqual(2, (int)testMethod.Invoke(testInstance, null)); + Assert.Equal(2, (int)testMethod.Invoke(testInstance, null)); testMethod = testType.GetMethod("ReversePInvokeNumCopies"); // Reverse PInvoke will copy 3 times. Two are from the same paths as the PInvoke, // and the third is from the reverse P/Invoke call. - Assert.AreEqual(3, (int)testMethod.Invoke(testInstance, null)); + Assert.Equal(3, (int)testMethod.Invoke(testInstance, null)); testMethod = testType.GetMethod("PInvokeNumCopiesDerivedType"); // PInvoke will copy twice. Once from argument to parameter, and once from the managed to native parameter. - Assert.AreEqual(2, (int)testMethod.Invoke(testInstance, null)); + Assert.Equal(2, (int)testMethod.Invoke(testInstance, null)); testMethod = testType.GetMethod("ReversePInvokeNumCopiesDerivedType"); // Reverse PInvoke will copy 3 times. Two are from the same paths as the PInvoke, // and the third is from the reverse P/Invoke call. - Assert.AreEqual(3, (int)testMethod.Invoke(testInstance, null)); + Assert.Equal(3, (int)testMethod.Invoke(testInstance, null)); } catch (Exception ex) { diff --git a/src/tests/Interop/IJW/FixupCallsHostWhenLoaded/FixupCallsHostWhenLoaded.cs b/src/tests/Interop/IJW/FixupCallsHostWhenLoaded/FixupCallsHostWhenLoaded.cs index 5007ec3c80f0a4..c7d9f4ce0c52f6 100644 --- a/src/tests/Interop/IJW/FixupCallsHostWhenLoaded/FixupCallsHostWhenLoaded.cs +++ b/src/tests/Interop/IJW/FixupCallsHostWhenLoaded/FixupCallsHostWhenLoaded.cs @@ -5,7 +5,7 @@ using System.IO; using System.Reflection; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; namespace FixupCallsHostWhenLoaded { @@ -30,8 +30,8 @@ static int Main(string[] args) IntPtr ijwModuleHandle = GetModuleHandle("IjwNativeDll.dll"); - Assert.AreNotEqual(IntPtr.Zero, ijwModuleHandle); - Assert.IsTrue(wasModuleVTableQueried(ijwModuleHandle)); + Assert.NotEqual(IntPtr.Zero, ijwModuleHandle); + Assert.True(wasModuleVTableQueried(ijwModuleHandle)); } catch (Exception e) { diff --git a/src/tests/Interop/IJW/LoadIjwFromModuleHandle/LoadIjwFromModuleHandle.cs b/src/tests/Interop/IJW/LoadIjwFromModuleHandle/LoadIjwFromModuleHandle.cs index cdcacd6b3eb2a0..66232d4939e00c 100644 --- a/src/tests/Interop/IJW/LoadIjwFromModuleHandle/LoadIjwFromModuleHandle.cs +++ b/src/tests/Interop/IJW/LoadIjwFromModuleHandle/LoadIjwFromModuleHandle.cs @@ -5,10 +5,8 @@ using System.IO; using System.Reflection; using System.Runtime.InteropServices; -using Internal.Runtime.InteropServices; using TestLibrary; - -using Console = Internal.Console; +using Xunit; namespace LoadIjwFromModuleHandle { @@ -37,12 +35,20 @@ unsafe static int Main(string[] args) string.Empty)) fixed (char* path = ijwModulePath) { - InMemoryAssemblyLoader.LoadInMemoryAssembly(ijwNativeHandle, (IntPtr)path); + typeof(object).Assembly + .GetType("Internal.Runtime.InteropServices.InMemoryAssemblyLoader") + .GetMethod("LoadInMemoryAssembly") + .Invoke( + null, + BindingFlags.DoNotWrapExceptions, + binder: null, + new object[] { ijwNativeHandle, (IntPtr)path }, + culture: null); } NativeEntryPointDelegate nativeEntryPoint = Marshal.GetDelegateForFunctionPointer(NativeLibrary.GetExport(ijwNativeHandle, "NativeEntryPoint")); - Assert.AreEqual(100, nativeEntryPoint()); + Assert.Equal(100, nativeEntryPoint()); Console.WriteLine("Test calls from managed to native to managed when an IJW assembly was first loaded via native."); @@ -51,7 +57,7 @@ unsafe static int Main(string[] args) object testInstance = Activator.CreateInstance(testType); MethodInfo testMethod = testType.GetMethod("ManagedEntryPoint"); - Assert.AreEqual(100, (int)testMethod.Invoke(testInstance, null)); + Assert.Equal(100, (int)testMethod.Invoke(testInstance, null)); MethodInfo changeReturnedValueMethod = testType.GetMethod("ChangeReturnedValue"); MethodInfo getReturnValueMethod = testType.GetMethod("GetReturnValue"); @@ -59,14 +65,14 @@ unsafe static int Main(string[] args) int newValue = 42; changeReturnedValueMethod.Invoke(null, new object[] { newValue }); - Assert.AreEqual(newValue, (int)getReturnValueMethod.Invoke(null, null)); + Assert.Equal(newValue, (int)getReturnValueMethod.Invoke(null, null)); // Native images are only loaded into memory once. As a result, the stubs in the vtfixup table // will always point to JIT stubs that exist in the first ALC that the module was loaded into. // As a result, if an IJW module is loaded into two different ALCs, or if the module is // first loaded via a native call and then loaded via the managed loader, the call stack can change ALCs when // jumping from managed->native->managed code within the IJW module. - Assert.AreEqual(100, (int)testMethod.Invoke(testInstance, null)); + Assert.Equal(100, (int)testMethod.Invoke(testInstance, null)); return 100; } catch (Exception ex) diff --git a/src/tests/Interop/IJW/LoadIjwFromModuleHandle/LoadIjwFromModuleHandle.csproj b/src/tests/Interop/IJW/LoadIjwFromModuleHandle/LoadIjwFromModuleHandle.csproj index a42c985e422b89..f5f12e84db3796 100644 --- a/src/tests/Interop/IJW/LoadIjwFromModuleHandle/LoadIjwFromModuleHandle.csproj +++ b/src/tests/Interop/IJW/LoadIjwFromModuleHandle/LoadIjwFromModuleHandle.csproj @@ -1,8 +1,6 @@ Exe - - true true true @@ -12,6 +10,7 @@ true true + true true diff --git a/src/tests/Interop/IJW/NativeVarargs/NativeVarargsTest.cs b/src/tests/Interop/IJW/NativeVarargs/NativeVarargsTest.cs index ffbf04eda1d309..7348bcc6b8edd0 100644 --- a/src/tests/Interop/IJW/NativeVarargs/NativeVarargsTest.cs +++ b/src/tests/Interop/IJW/NativeVarargs/NativeVarargsTest.cs @@ -8,7 +8,7 @@ using System.Linq; using System.Reflection; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; namespace NativeVarargsTest { diff --git a/src/tests/Interop/LayoutClass/LayoutClassTest.cs b/src/tests/Interop/LayoutClass/LayoutClassTest.cs index b333c7ddd98517..26f5e8f43a1dad 100644 --- a/src/tests/Interop/LayoutClass/LayoutClassTest.cs +++ b/src/tests/Interop/LayoutClass/LayoutClassTest.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; namespace PInvokeTests { @@ -192,14 +192,14 @@ public static void SequentialClass() string s = "before"; var p = new SeqClass(0, false, s); - Assert.IsTrue(SimpleSeqLayoutClassByRef(p)); + Assert.True(SimpleSeqLayoutClassByRef(p)); } public static void SequentialClassNull() { Console.WriteLine($"Running {nameof(SequentialClassNull)}..."); - Assert.IsTrue(SimpleSeqLayoutClassByRefNull(null)); + Assert.True(SimpleSeqLayoutClassByRefNull(null)); } public static void DerivedClassWithEmptyBase() @@ -207,8 +207,8 @@ public static void DerivedClassWithEmptyBase() Console.WriteLine($"Running {nameof(DerivedClassWithEmptyBase)}..."); string s = "before"; - Assert.IsTrue(DerivedSeqLayoutClassByRef(new SeqDerivedClass(42), 42)); - Assert.IsTrue(DerivedSeqLayoutClassByRef(new SeqDerivedClass2(42), 42)); + Assert.True(DerivedSeqLayoutClassByRef(new SeqDerivedClass(42), 42)); + Assert.True(DerivedSeqLayoutClassByRef(new SeqDerivedClass2(42), 42)); } public static void ExplicitClass() @@ -216,7 +216,7 @@ public static void ExplicitClass() Console.WriteLine($"Running {nameof(ExplicitClass)}..."); var p = new ExpClass(DialogResult.None, 10); - Assert.IsTrue(SimpleExpLayoutClassByRef(p)); + Assert.True(SimpleExpLayoutClassByRef(p)); } private static void ValidateBlittableClassInOut(Func pinvoke) @@ -224,8 +224,8 @@ private static void ValidateBlittableClassInOut(Func pinvoke) int a = 10; int expected = a + 1; Blittable p = new Blittable(a); - Assert.IsTrue(pinvoke(p)); - Assert.AreEqual(expected, p.a); + Assert.True(pinvoke(p)); + Assert.Equal(expected, p.a); } public static void BlittableClass() @@ -239,7 +239,7 @@ public static void BlittableClassNull() { // [Compat] Marshalled with [In, Out] behaviour by default Console.WriteLine($"Running {nameof(BlittableClassNull)}..."); - Assert.IsTrue(SimpleBlittableSeqLayoutClass_Null(null)); + Assert.True(SimpleBlittableSeqLayoutClass_Null(null)); } public static void BlittableClassByInAttr() @@ -261,8 +261,8 @@ private static void ValidateSealedBlittableClassInOut(Func(md); VoidDelegate del = (VoidDelegate)Marshal.GetDelegateForFunctionPointer(fcnptr, typeof(VoidDelegate)); - Assert.AreEqual(md.Target, del.Target, "Failure - the Target of the funcptr->delegate should be equal to the original method."); - Assert.AreEqual(md.Method, del.Method, "Failure - The Method of the funcptr->delegate should be equal to the MethodInfo of the original method."); + Assert.Equal(md.Target, del.Target); + Assert.Equal(md.Method, del.Method); } // Native FcnPtr -> Delegate { IntPtr fcnptr = FunctionPointerNative.GetVoidVoidFcnPtr(); VoidDelegate del = (VoidDelegate)Marshal.GetDelegateForFunctionPointer(fcnptr, typeof(VoidDelegate)); - Assert.AreEqual(null, del.Target, "Failure - the Target of the funcptr->delegate should be null since we provided native funcptr."); - Assert.AreEqual("Invoke", del.Method.Name, "Failure - The Method of the native funcptr->delegate should be the Invoke method."); + Assert.Equal(null, del.Target); + Assert.Equal("Invoke", del.Method.Name); // Round trip of a native function pointer is never legal for a non-concrete Delegate type Assert.Throws(() => diff --git a/src/tests/Interop/MarshalAPI/FunctionPointer/SingleMulticastTest.cs b/src/tests/Interop/MarshalAPI/FunctionPointer/SingleMulticastTest.cs index 3cfa46bbf8e379..e5b913e8f09987 100644 --- a/src/tests/Interop/MarshalAPI/FunctionPointer/SingleMulticastTest.cs +++ b/src/tests/Interop/MarshalAPI/FunctionPointer/SingleMulticastTest.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; partial class FunctionPtr { @@ -18,7 +18,7 @@ public static void RunGetFcnPtrSingleMulticastTest() { IntPtr fcnptr = Marshal.GetFunctionPointerForDelegate(s_DelWithLongBool); - Assert.IsTrue(FunctionPointerNative.CheckFcnPtr(fcnptr)); + Assert.True(FunctionPointerNative.CheckFcnPtr(fcnptr)); } { diff --git a/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.cs b/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.cs index de3f20c78e7772..26082d53a2550c 100644 --- a/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.cs +++ b/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.cs @@ -6,7 +6,7 @@ using System.Security; using System.Runtime.InteropServices; using System.Collections.Generic; -using TestLibrary; +using Xunit; #pragma warning disable 618 diff --git a/src/tests/Interop/NativeLibrary/API/NativeLibraryTests.cs b/src/tests/Interop/NativeLibrary/API/NativeLibraryTests.cs index 4742b2e0b5bdbb..a85e163e997ef6 100644 --- a/src/tests/Interop/NativeLibrary/API/NativeLibraryTests.cs +++ b/src/tests/Interop/NativeLibrary/API/NativeLibraryTests.cs @@ -4,7 +4,7 @@ using System.IO; using System.Reflection; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; enum TestResult { Success, diff --git a/src/tests/Interop/NativeLibrary/AssemblyLoadContext/ResolveUnmanagedDllTests.cs b/src/tests/Interop/NativeLibrary/AssemblyLoadContext/ResolveUnmanagedDllTests.cs index a0af26f497bc45..7b09f063fb006f 100644 --- a/src/tests/Interop/NativeLibrary/AssemblyLoadContext/ResolveUnmanagedDllTests.cs +++ b/src/tests/Interop/NativeLibrary/AssemblyLoadContext/ResolveUnmanagedDllTests.cs @@ -9,7 +9,7 @@ using System.Reflection; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; public class FakeNativeLibrary { @@ -30,7 +30,7 @@ public void Reset() public void Validate(params string[] expectedNames) { - Assert.AreAllEqual(expectedNames, invocations, $"Unexpected invocations for {nameof(LoadUnmanagedDll)}."); + AssertExtensions.CollectionEqual(expectedNames, invocations); } protected override IntPtr LoadUnmanagedDll(string unmanagedDllName) @@ -87,30 +87,30 @@ public static void ValidateLoadUnmanagedDll() // ALC implementation returns a fake handle value IntPtr ptr = NativeLibrary.Load(FakeNativeLibrary.Name, asm, null); alc.Validate(FakeNativeLibrary.Name); - Assert.AreEqual(FakeNativeLibrary.Handle, ptr, $"Unexpected return value for {nameof(NativeLibrary.Load)}"); + Assert.Equal(FakeNativeLibrary.Handle, ptr); alc.Reset(); ptr = IntPtr.Zero; bool success = NativeLibrary.TryLoad(FakeNativeLibrary.Name, asm, null, out ptr); - Assert.IsTrue(success, $"NativeLibrary.TryLoad should have succeeded"); + Assert.True(success, $"NativeLibrary.TryLoad should have succeeded"); alc.Validate(FakeNativeLibrary.Name); - Assert.AreEqual(FakeNativeLibrary.Handle, ptr, $"Unexpected return value for {nameof(NativeLibrary.Load)}"); + Assert.Equal(FakeNativeLibrary.Handle, ptr); alc.Reset(); // ALC implementation calls NativeLibrary.TryLoad with a different name ptr = NativeLibrary.Load(FakeNativeLibrary.RedirectName, asm, null); alc.Validate(FakeNativeLibrary.RedirectName, FakeNativeLibrary.Name); - Assert.AreEqual(FakeNativeLibrary.Handle, ptr, $"Unexpected return value for {nameof(NativeLibrary.Load)}"); + Assert.Equal(FakeNativeLibrary.Handle, ptr); alc.Reset(); ptr = IntPtr.Zero; success = NativeLibrary.TryLoad(FakeNativeLibrary.RedirectName, asm, null, out ptr); - Assert.IsTrue(success, $"NativeLibrary.TryLoad should have succeeded"); + Assert.True(success, $"NativeLibrary.TryLoad should have succeeded"); alc.Validate(FakeNativeLibrary.RedirectName, FakeNativeLibrary.Name); - Assert.AreEqual(FakeNativeLibrary.Handle, ptr, $"Unexpected return value for {nameof(NativeLibrary.Load)}"); + Assert.Equal(FakeNativeLibrary.Handle, ptr); alc.Reset(); @@ -121,7 +121,7 @@ public static void ValidateLoadUnmanagedDll() int value = NativeSumInAssemblyLoadContext(alc, addend1, addend2); alc.Validate(NativeLibraryToLoad.InvalidName); - Assert.AreEqual(expected, value, $"Unexpected return value for {nameof(NativeSum)}"); + Assert.Equal(expected, value); } public static void ValidateResolvingUnmanagedDllEvent() @@ -150,14 +150,14 @@ private static void ValidateResolvingUnmanagedDllEvent_ExplicitLoad(Assembly ass using (var handler = new Handlers(alc, returnValid: false)) { Assert.Throws(() => NativeLibrary.Load(FakeNativeLibrary.Name, assembly, null)); - Assert.IsTrue(handler.EventHandlerInvoked, "Event handler should have been invoked"); + Assert.True(handler.EventHandlerInvoked); } using (var handler = new Handlers(alc, returnValid: true)) { IntPtr ptr = NativeLibrary.Load(FakeNativeLibrary.Name, assembly, null); - Assert.IsTrue(handler.EventHandlerInvoked, "Event handler should have been invoked"); - Assert.AreEqual(FakeNativeLibrary.Handle, ptr, $"Unexpected return value for {nameof(NativeLibrary.Load)}"); + Assert.True(handler.EventHandlerInvoked); + Assert.Equal(FakeNativeLibrary.Handle, ptr); } } @@ -176,10 +176,10 @@ private static void ValidateResolvingUnmanagedDllEvent_PInvoke(AssemblyLoadConte else { TargetInvocationException ex = Assert.Throws(() => NativeSumInAssemblyLoadContext(alc, addend1, addend2)); - Assert.AreEqual(typeof(DllNotFoundException), ex.InnerException.GetType()); + Assert.Equal(typeof(DllNotFoundException), ex.InnerException.GetType()); } - Assert.IsTrue(handler.EventHandlerInvoked, "Event handler should have been invoked"); + Assert.True(handler.EventHandlerInvoked); } // Multiple handlers - first valid result is used @@ -192,10 +192,10 @@ private static void ValidateResolvingUnmanagedDllEvent_PInvoke(AssemblyLoadConte ? NativeSum(addend1, addend2) : NativeSumInAssemblyLoadContext(alc, addend1, addend2); - Assert.IsTrue(handlerInvalid.EventHandlerInvoked, "Event handler should have been invoked"); - Assert.IsTrue(handlerValid1.EventHandlerInvoked, "Event handler should have been invoked"); - Assert.IsFalse(handlerValid2.EventHandlerInvoked, "Event handler should not have been invoked"); - Assert.AreEqual(expected, value, $"Unexpected return value for {nameof(NativeSum)} in {alc}"); + Assert.True(handlerInvalid.EventHandlerInvoked); + Assert.True(handlerValid1.EventHandlerInvoked); + Assert.False(handlerValid2.EventHandlerInvoked); + Assert.Equal(expected, value); } } diff --git a/src/tests/Interop/NativeLibrary/AssemblyLoadContext/TestAsm/TestAsm.csproj b/src/tests/Interop/NativeLibrary/AssemblyLoadContext/TestAsm/TestAsm.csproj index 1d7ed015cabc3b..2a638a2e57458f 100644 --- a/src/tests/Interop/NativeLibrary/AssemblyLoadContext/TestAsm/TestAsm.csproj +++ b/src/tests/Interop/NativeLibrary/AssemblyLoadContext/TestAsm/TestAsm.csproj @@ -1,6 +1,7 @@ Library + SharedLibrary true diff --git a/src/tests/Interop/NativeLibrary/Callback/CallbackTests.cs b/src/tests/Interop/NativeLibrary/Callback/CallbackTests.cs index 5f4a0d765f4c11..c77a187e5c0874 100644 --- a/src/tests/Interop/NativeLibrary/Callback/CallbackTests.cs +++ b/src/tests/Interop/NativeLibrary/Callback/CallbackTests.cs @@ -6,7 +6,7 @@ using System.Reflection; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; [assembly: DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)] public class CallbackTests @@ -40,8 +40,8 @@ public static void ValidateSetDllImportResolver() DllImportResolver resolver = Resolver.Instance.Callback; // Invalid arguments - Assert.Throws(() => NativeLibrary.SetDllImportResolver(null, resolver), "Exception expected for null assembly parameter"); - Assert.Throws(() => NativeLibrary.SetDllImportResolver(assembly, null), "Exception expected for null resolver parameter"); + Assert.Throws(() => NativeLibrary.SetDllImportResolver(null, resolver)); + Assert.Throws(() => NativeLibrary.SetDllImportResolver(assembly, null)); // No callback registered yet Assert.Throws(() => NativeSum(10, 10)); @@ -50,13 +50,13 @@ public static void ValidateSetDllImportResolver() NativeLibrary.SetDllImportResolver(assembly, resolver); // Try to set the resolver again on the same assembly - Assert.Throws(() => NativeLibrary.SetDllImportResolver(assembly, resolver), "Should not be able to re-register resolver"); + Assert.Throws(() => NativeLibrary.SetDllImportResolver(assembly, resolver)); // Try to set another resolver on the same assembly DllImportResolver anotherResolver = (string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) => IntPtr.Zero; - Assert.Throws(() => NativeLibrary.SetDllImportResolver(assembly, anotherResolver), "Should not be able to register another resolver"); + Assert.Throws(() => NativeLibrary.SetDllImportResolver(assembly, anotherResolver)); } public static void ValidatePInvoke() @@ -69,7 +69,7 @@ public static void ValidatePInvoke() Resolver.Instance.Reset(); int value = NativeSum(addend1, addend2); Resolver.Instance.Validate(NativeLibraryToLoad.InvalidName); - Assert.AreEqual(expected, value, $"Unexpected return value from {nameof(NativeSum)}"); + Assert.Equal(expected, value); } private class Resolver @@ -87,9 +87,9 @@ public void Reset() public void Validate(params string[] expectedNames) { - Assert.AreEqual(expectedNames.Length, invocations.Count, $"Unexpected invocation count for registered {nameof(DllImportResolver)}."); + Assert.Equal(expectedNames.Length, invocations.Count); for (int i = 0; i < expectedNames.Length; i++) - Assert.AreEqual(expectedNames[i], invocations[i], $"Unexpected library name received by registered resolver."); + Assert.Equal(expectedNames[i], invocations[i]); } private IntPtr ResolveDllImport(string libraryName, Assembly asm, DllImportSearchPath? dllImportSearchPath) @@ -98,7 +98,7 @@ private IntPtr ResolveDllImport(string libraryName, Assembly asm, DllImportSearc if (string.Equals(libraryName, NativeLibraryToLoad.InvalidName)) { - Assert.AreEqual(DllImportSearchPath.System32, dllImportSearchPath, $"Unexpected {nameof(dllImportSearchPath)}: {dllImportSearchPath.ToString()}"); + Assert.Equal(DllImportSearchPath.System32, dllImportSearchPath); return NativeLibrary.Load(NativeLibraryToLoad.Name, asm, null); } diff --git a/src/tests/Interop/ObjectiveC/AutoReleaseTest/AutoReleaseTest.cs b/src/tests/Interop/ObjectiveC/AutoReleaseTest/AutoReleaseTest.cs index b3efd220ff6ac0..60967944837a88 100644 --- a/src/tests/Interop/ObjectiveC/AutoReleaseTest/AutoReleaseTest.cs +++ b/src/tests/Interop/ObjectiveC/AutoReleaseTest/AutoReleaseTest.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Threading; -using TestLibrary; +using Xunit; internal static unsafe class ObjectiveC { @@ -47,7 +47,7 @@ private static void ValidateNewManagedThreadAutoRelease() GC.Collect(); GC.WaitForPendingFinalizers(); - Assert.AreEqual(numReleaseCalls + 1, ObjectiveC.getNumReleaseCalls()); + Assert.Equal(numReleaseCalls + 1, ObjectiveC.getNumReleaseCalls()); } static void RunScenario(AutoResetEvent evt) @@ -80,7 +80,7 @@ private static void ValidateThreadPoolAutoRelease() evt.WaitOne(); // Wait 60 ms after the signal to ensure that the thread has finished the work item and has drained the thread's autorelease pool. Thread.Sleep(60); - Assert.AreEqual(numReleaseCalls + 1, ObjectiveC.getNumReleaseCalls()); + Assert.Equal(numReleaseCalls + 1, ObjectiveC.getNumReleaseCalls()); } } } diff --git a/src/tests/Interop/ObjectiveC/ObjectiveCMarshalAPI/Program.cs b/src/tests/Interop/ObjectiveC/ObjectiveCMarshalAPI/Program.cs index 9072890ba668be..b9d06dd5421624 100644 --- a/src/tests/Interop/ObjectiveC/ObjectiveCMarshalAPI/Program.cs +++ b/src/tests/Interop/ObjectiveC/ObjectiveCMarshalAPI/Program.cs @@ -9,7 +9,7 @@ namespace ObjectiveCMarshalAPI using System.Runtime.InteropServices; using System.Runtime.InteropServices.ObjectiveC; - using TestLibrary; + using Xunit; class NativeObjCMarshalTests { @@ -97,8 +97,8 @@ public Base() { if (_contract != null) { - Assert.AreEqual(nuint.MaxValue, _contract->RefCountDown); // Validate finalizer queue callback - Assert.AreEqual(_expectedCount, _contract->RefCountUp); // Validate "is referenced" callback + Assert.Equal(nuint.MaxValue, _contract->RefCountDown); // Validate finalizer queue callback + Assert.Equal(_expectedCount, _contract->RefCountUp); // Validate "is referenced" callback } FinalizeCount++; @@ -111,8 +111,8 @@ public void SetContractMemory(IntPtr mem, uint count) _contract = (Contract*)mem; // Contract should be 0 initialized when supplied. - Assert.AreEqual((nuint)0, _contract->RefCountDown); - Assert.AreEqual((nuint)0, _contract->RefCountUp); + Assert.Equal((nuint)0, _contract->RefCountDown); + Assert.Equal((nuint)0, _contract->RefCountUp); _expectedCount = (nuint)count; _contract->RefCountDown = _expectedCount; @@ -145,7 +145,7 @@ static void InitializeObjectiveCMarshal() GCHandle h = ObjectiveCMarshal.CreateReferenceTrackingHandle(obj, out Span s); // Validate contract length for tagged memory. - Assert.AreEqual(2, s.Length); + Assert.Equal(2, s.Length); // Make the "is referenced" callback run at least 'count' number of times. fixed (void* p = s) @@ -160,9 +160,9 @@ static void InitializeObjectiveCMarshal() // Validate the memory is the same but the GCHandles are distinct. fixed (void* p = s) - Assert.AreEqual(obj.Contract, new IntPtr(p)); + Assert.Equal(obj.Contract, new IntPtr(p)); - Assert.AreNotEqual(handle, h); + Assert.NotEqual(handle, h); h.Free(); } @@ -217,7 +217,7 @@ static unsafe void Validate_ReferenceTracking_Scenario() // Validate we finalized all the objects we allocated. // It is important to validate the count prior to freeing // the handles to verify they are not keeping objects alive. - Assert.AreEqual(Base.FinalizeCount, Base.AllocCount); + Assert.Equal(Base.FinalizeCount, Base.AllocCount); // Clean up all allocated handles that are no longer needed. foreach (var h in handles) @@ -255,7 +255,7 @@ public ExceptionException() {} out IntPtr context) { var lastMethod = (MethodInfo)MethodBase.GetMethodFromHandle(lastMethodHandle); - Assert.IsTrue(lastMethod != null); + Assert.True(lastMethod != null); context = IntPtr.Zero; if (e is IntException ie) @@ -268,7 +268,7 @@ public ExceptionException() {} return (delegate* unmanaged)NativeObjCMarshalTests.GetThrowException(); } - Assert.Fail("Unknown exception type"); + Assert.True(false, "Unknown exception type"); throw new Exception("Unreachable"); } @@ -296,7 +296,7 @@ static void _Validate_ExceptionPropagation() { delegate* unmanaged testNativeMethod = scen.Fptr; int ret = NativeObjCMarshalTests.CallAndCatch((IntPtr)testNativeMethod, scen.Expected); - Assert.AreEqual(scen.Expected, ret); + Assert.Equal(scen.Expected, ret); } GC.KeepAlive(delThrowInt); @@ -306,7 +306,7 @@ static void _Validate_ExceptionPropagation() static void Validate_Initialize_FailsOnSecondAttempt() { Console.WriteLine($"Running {nameof(Validate_Initialize_FailsOnSecondAttempt)}..."); - + Assert.Throws( () => { @@ -331,4 +331,4 @@ static int Main(string[] doNotUse) return 100; } } -} \ No newline at end of file +} diff --git a/src/tests/Interop/PInvoke/Array/MarshalArray.h b/src/tests/Interop/PInvoke/Array/MarshalArray.h index 54c8a4052a12cc..c53c2e4bcba36d 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArray.h +++ b/src/tests/Interop/PInvoke/Array/MarshalArray.h @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#pragma once +#pragma once #include #include // required by itoa #include @@ -10,11 +10,10 @@ ////////////////////////////////////////////////////////////////////////////// // Macro definitions ////////////////////////////////////////////////////////////////////////////// -#define ARRAY_SIZE 100 +#define ARRAY_LENGTH 100 #define ROWS 2 #define COLUMNS 3 -#define COUNTOF(__arr) sizeof(__arr) / sizeof(__arr[0]) #define ELEM_PER_ROW_2D(__arr) (&(__arr[1][0]) - &(__arr[0][0])) #define ROWS_2D(__arr) sizeof(__arr) / (ELEM_PER_ROW_2D(__arr) * sizeof(__arr[0][0])) diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.cs b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.cs index 3336eba93aabc2..e728712b3f9d0e 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.cs +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsByValArray/AsByValArrayTest.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; #region Sequential #region sequential struct definition @@ -605,10 +605,10 @@ class Test [DllImport("MarshalArrayByValArrayNative", CallingConvention = CallingConvention.Cdecl)] static extern bool TakeLPSTRArrayExpStructByVal([In]S_LPSTRArray_Exp s, int size); - + [DllImport("MarshalArrayByValArrayNative", CallingConvention = CallingConvention.Cdecl)] static extern bool TakeLPCSTRArrayExpStructByVal([In]S_LPCSTRArray_Exp s, int size); - + [DllImport("MarshalArrayByValArrayNative", CallingConvention = CallingConvention.Cdecl)] static extern bool TakeBSTRArrayExpStructByVal([In]S_BSTRArray_Exp s, int size); @@ -805,62 +805,62 @@ static void RunTest1(string report) S_INTArray_Seq s1 = new S_INTArray_Seq(); s1.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeIntArraySeqStructByVal(s1, s1.arr.Length), "TakeIntArraySeqStructByVal"); + Assert.True(TakeIntArraySeqStructByVal(s1, s1.arr.Length)); S_UINTArray_Seq s2 = new S_UINTArray_Seq(); s2.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeUIntArraySeqStructByVal(s2, s2.arr.Length), "TakeUIntArraySeqStructByVal"); + Assert.True(TakeUIntArraySeqStructByVal(s2, s2.arr.Length)); S_SHORTArray_Seq s3 = new S_SHORTArray_Seq(); s3.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeShortArraySeqStructByVal(s3, s3.arr.Length), "TakeShortArraySeqStructByVal"); + Assert.True(TakeShortArraySeqStructByVal(s3, s3.arr.Length)); S_WORDArray_Seq s4 = new S_WORDArray_Seq(); s4.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeWordArraySeqStructByVal(s4, s4.arr.Length), "TakeWordArraySeqStructByVal"); + Assert.True(TakeWordArraySeqStructByVal(s4, s4.arr.Length)); S_LONG64Array_Seq s5 = new S_LONG64Array_Seq(); s5.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeLong64ArraySeqStructByVal(s5, s5.arr.Length), "TakeLong64ArraySeqStructByVal"); + Assert.True(TakeLong64ArraySeqStructByVal(s5, s5.arr.Length)); S_ULONG64Array_Seq s6 = new S_ULONG64Array_Seq(); s6.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeULong64ArraySeqStructByVal(s6, s6.arr.Length), "TakeULong64ArraySeqStructByVal"); + Assert.True(TakeULong64ArraySeqStructByVal(s6, s6.arr.Length)); S_DOUBLEArray_Seq s7 = new S_DOUBLEArray_Seq(); s7.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeDoubleArraySeqStructByVal(s7, s7.arr.Length), "TakeDoubleArraySeqStructByVal"); + Assert.True(TakeDoubleArraySeqStructByVal(s7, s7.arr.Length)); S_FLOATArray_Seq s8 = new S_FLOATArray_Seq(); s8.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeFloatArraySeqStructByVal(s8, s8.arr.Length), "TakeFloatArraySeqStructByVal"); + Assert.True(TakeFloatArraySeqStructByVal(s8, s8.arr.Length)); S_BYTEArray_Seq s9 = new S_BYTEArray_Seq(); s9.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeByteArraySeqStructByVal(s9, s9.arr.Length), "TakeByteArraySeqStructByVal"); + Assert.True(TakeByteArraySeqStructByVal(s9, s9.arr.Length)); S_CHARArray_Seq s10 = new S_CHARArray_Seq(); s10.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeCharArraySeqStructByVal(s10, s10.arr.Length), "TakeCharArraySeqStructByVal"); + Assert.True(TakeCharArraySeqStructByVal(s10, s10.arr.Length)); S_LPSTRArray_Seq s11 = new S_LPSTRArray_Seq(); s11.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeLPSTRArraySeqStructByVal(s11, s11.arr.Length),"TakeLPSTRArraySeqStructByVal"); + Assert.True(TakeLPSTRArraySeqStructByVal(s11, s11.arr.Length),"TakeLPSTRArraySeqStructByVal"); S_LPCSTRArray_Seq s12 = new S_LPCSTRArray_Seq(); s12.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeLPCSTRArraySeqStructByVal(s12, s12.arr.Length),"TakeLPCSTRArraySeqStructByVal"); + Assert.True(TakeLPCSTRArraySeqStructByVal(s12, s12.arr.Length),"TakeLPCSTRArraySeqStructByVal"); if (OperatingSystem.IsWindows()) { S_BSTRArray_Seq s13 = new S_BSTRArray_Seq(); s13.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeBSTRArraySeqStructByVal(s13, s13.arr.Length),"TakeBSTRArraySeqStructByVal"); + Assert.True(TakeBSTRArraySeqStructByVal(s13, s13.arr.Length),"TakeBSTRArraySeqStructByVal"); } S_StructArray_Seq s14 = new S_StructArray_Seq(); s14.arr = InitStructArray(ARRAY_SIZE); - Assert.IsTrue(TakeStructArraySeqStructByVal(s14, s14.arr.Length),"TakeStructArraySeqStructByVal"); + Assert.True(TakeStructArraySeqStructByVal(s14, s14.arr.Length),"TakeStructArraySeqStructByVal"); EnregisterableNonBlittable_Seq s15 = new EnregisterableNonBlittable_Seq { @@ -872,7 +872,7 @@ static void RunTest1(string report) } }; - Assert.IsTrue(TakeEnregistrableNonBlittableSeqStructByVal(s15, s15.arr), "EnregisterableNonBlittableSeqStructByVal"); + Assert.True(TakeEnregistrableNonBlittableSeqStructByVal(s15, s15.arr)); EnregisterableUserType s16 = new EnregisterableUserType { @@ -884,7 +884,7 @@ static void RunTest1(string report) } }; - Assert.IsTrue(TakeEnregisterableUserTypeStructByVal(s16, s16.arr), "TakeEnregisterableUserTypeStructByVal"); + Assert.True(TakeEnregisterableUserTypeStructByVal(s16, s16.arr)); } static void RunTest2(string report) @@ -893,62 +893,62 @@ static void RunTest2(string report) C_INTArray_Seq c1 = new C_INTArray_Seq(); c1.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeIntArraySeqClassByVal(c1, c1.arr.Length)); + Assert.True(TakeIntArraySeqClassByVal(c1, c1.arr.Length)); C_UINTArray_Seq c2 = new C_UINTArray_Seq(); c2.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeUIntArraySeqClassByVal(c2, c2.arr.Length)); + Assert.True(TakeUIntArraySeqClassByVal(c2, c2.arr.Length)); C_SHORTArray_Seq c3 = new C_SHORTArray_Seq(); c3.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeShortArraySeqClassByVal(c3, c3.arr.Length)); + Assert.True(TakeShortArraySeqClassByVal(c3, c3.arr.Length)); C_WORDArray_Seq c4 = new C_WORDArray_Seq(); c4.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeWordArraySeqClassByVal(c4, c4.arr.Length)); + Assert.True(TakeWordArraySeqClassByVal(c4, c4.arr.Length)); C_LONG64Array_Seq c5 = new C_LONG64Array_Seq(); c5.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeLong64ArraySeqClassByVal(c5, c5.arr.Length)); + Assert.True(TakeLong64ArraySeqClassByVal(c5, c5.arr.Length)); C_ULONG64Array_Seq c6 = new C_ULONG64Array_Seq(); c6.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeULong64ArraySeqClassByVal(c6, c6.arr.Length)); + Assert.True(TakeULong64ArraySeqClassByVal(c6, c6.arr.Length)); C_DOUBLEArray_Seq c7 = new C_DOUBLEArray_Seq(); c7.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeDoubleArraySeqClassByVal(c7, c7.arr.Length)); + Assert.True(TakeDoubleArraySeqClassByVal(c7, c7.arr.Length)); C_FLOATArray_Seq c8 = new C_FLOATArray_Seq(); c8.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeFloatArraySeqClassByVal(c8, c8.arr.Length)); + Assert.True(TakeFloatArraySeqClassByVal(c8, c8.arr.Length)); C_BYTEArray_Seq c9 = new C_BYTEArray_Seq(); c9.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeByteArraySeqClassByVal(c9, c9.arr.Length)); + Assert.True(TakeByteArraySeqClassByVal(c9, c9.arr.Length)); C_CHARArray_Seq c10 = new C_CHARArray_Seq(); c10.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeCharArraySeqClassByVal(c10, c10.arr.Length)); + Assert.True(TakeCharArraySeqClassByVal(c10, c10.arr.Length)); C_LPSTRArray_Seq c11 = new C_LPSTRArray_Seq(); c11.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeLPSTRArraySeqClassByVal(c11, c11.arr.Length)); + Assert.True(TakeLPSTRArraySeqClassByVal(c11, c11.arr.Length)); C_LPCSTRArray_Seq c12 = new C_LPCSTRArray_Seq(); c12.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeLPCSTRArraySeqClassByVal(c12, c12.arr.Length)); + Assert.True(TakeLPCSTRArraySeqClassByVal(c12, c12.arr.Length)); if (OperatingSystem.IsWindows()) { C_BSTRArray_Seq c13 = new C_BSTRArray_Seq(); c13.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeBSTRArraySeqClassByVal(c13, c13.arr.Length)); + Assert.True(TakeBSTRArraySeqClassByVal(c13, c13.arr.Length)); } C_StructArray_Seq c14 = new C_StructArray_Seq(); c14.arr = InitStructArray(ARRAY_SIZE); - Assert.IsTrue(TakeStructArraySeqClassByVal(c14, c14.arr.Length)); + Assert.True(TakeStructArraySeqClassByVal(c14, c14.arr.Length)); } static void RunTest3(string report) @@ -957,62 +957,62 @@ static void RunTest3(string report) S_INTArray_Exp s1 = new S_INTArray_Exp(); s1.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeIntArrayExpStructByVal(s1, s1.arr.Length), "TakeIntArrayExpStructByVal"); + Assert.True(TakeIntArrayExpStructByVal(s1, s1.arr.Length)); S_UINTArray_Exp s2 = new S_UINTArray_Exp(); s2.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeUIntArrayExpStructByVal(s2, s2.arr.Length), "TakeUIntArrayExpStructByVal"); + Assert.True(TakeUIntArrayExpStructByVal(s2, s2.arr.Length)); S_SHORTArray_Exp s3 = new S_SHORTArray_Exp(); s3.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeShortArrayExpStructByVal(s3, s3.arr.Length), "TakeShortArrayExpStructByVal"); + Assert.True(TakeShortArrayExpStructByVal(s3, s3.arr.Length)); S_WORDArray_Exp s4 = new S_WORDArray_Exp(); s4.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeWordArrayExpStructByVal(s4, s4.arr.Length), "TakeWordArrayExpStructByVal"); + Assert.True(TakeWordArrayExpStructByVal(s4, s4.arr.Length)); S_LONG64Array_Exp s5 = new S_LONG64Array_Exp(); s5.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeLong64ArrayExpStructByVal(s5, s5.arr.Length), "TakeLong64ArrayExpStructByVal"); + Assert.True(TakeLong64ArrayExpStructByVal(s5, s5.arr.Length)); S_ULONG64Array_Exp s6 = new S_ULONG64Array_Exp(); s6.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeULong64ArrayExpStructByVal(s6, s6.arr.Length), "TakeULong64ArrayExpStructByVal"); + Assert.True(TakeULong64ArrayExpStructByVal(s6, s6.arr.Length)); S_DOUBLEArray_Exp s7 = new S_DOUBLEArray_Exp(); s7.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeDoubleArrayExpStructByVal(s7, s7.arr.Length), "TakeDoubleArrayExpStructByVal"); + Assert.True(TakeDoubleArrayExpStructByVal(s7, s7.arr.Length)); S_FLOATArray_Exp s8 = new S_FLOATArray_Exp(); s8.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeFloatArrayExpStructByVal(s8, s8.arr.Length), "TakeFloatArrayExpStructByVal"); + Assert.True(TakeFloatArrayExpStructByVal(s8, s8.arr.Length)); S_BYTEArray_Exp s9 = new S_BYTEArray_Exp(); s9.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeByteArrayExpStructByVal(s9, s9.arr.Length), "TakeByteArrayExpStructByVal"); + Assert.True(TakeByteArrayExpStructByVal(s9, s9.arr.Length)); S_CHARArray_Exp s10 = new S_CHARArray_Exp(); s10.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeCharArrayExpStructByVal(s10, s10.arr.Length), "TakeCharArrayExpStructByVal"); + Assert.True(TakeCharArrayExpStructByVal(s10, s10.arr.Length)); S_LPSTRArray_Exp s11 = new S_LPSTRArray_Exp(); s11.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeLPSTRArrayExpStructByVal(s11, s11.arr.Length)); + Assert.True(TakeLPSTRArrayExpStructByVal(s11, s11.arr.Length)); S_LPCSTRArray_Exp s12 = new S_LPCSTRArray_Exp(); s12.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeLPCSTRArrayExpStructByVal(s12, s12.arr.Length)); + Assert.True(TakeLPCSTRArrayExpStructByVal(s12, s12.arr.Length)); if (OperatingSystem.IsWindows()) { S_BSTRArray_Exp c13 = new S_BSTRArray_Exp(); c13.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeBSTRArrayExpStructByVal(c13, c13.arr.Length)); + Assert.True(TakeBSTRArrayExpStructByVal(c13, c13.arr.Length)); } S_StructArray_Exp s14 = new S_StructArray_Exp(); s14.arr = InitStructArray(ARRAY_SIZE); - Assert.IsTrue(TakeStructArrayExpStructByVal(s14, s14.arr.Length)); + Assert.True(TakeStructArrayExpStructByVal(s14, s14.arr.Length)); } static void RunTest4(string report) @@ -1021,112 +1021,112 @@ static void RunTest4(string report) C_INTArray_Exp c1 = new C_INTArray_Exp(); c1.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeIntArrayExpClassByVal(c1, c1.arr.Length)); + Assert.True(TakeIntArrayExpClassByVal(c1, c1.arr.Length)); C_UINTArray_Exp c2 = new C_UINTArray_Exp(); c2.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeUIntArrayExpClassByVal(c2, c2.arr.Length)); + Assert.True(TakeUIntArrayExpClassByVal(c2, c2.arr.Length)); C_SHORTArray_Exp c3 = new C_SHORTArray_Exp(); c3.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeShortArrayExpClassByVal(c3, c3.arr.Length)); + Assert.True(TakeShortArrayExpClassByVal(c3, c3.arr.Length)); C_WORDArray_Exp c4 = new C_WORDArray_Exp(); c4.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeWordArrayExpClassByVal(c4, c4.arr.Length)); + Assert.True(TakeWordArrayExpClassByVal(c4, c4.arr.Length)); C_LONG64Array_Exp c5 = new C_LONG64Array_Exp(); c5.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeLong64ArrayExpClassByVal(c5, c5.arr.Length)); + Assert.True(TakeLong64ArrayExpClassByVal(c5, c5.arr.Length)); C_ULONG64Array_Exp c6 = new C_ULONG64Array_Exp(); c6.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeULong64ArrayExpClassByVal(c6, c6.arr.Length)); + Assert.True(TakeULong64ArrayExpClassByVal(c6, c6.arr.Length)); C_DOUBLEArray_Exp c7 = new C_DOUBLEArray_Exp(); c7.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeDoubleArrayExpClassByVal(c7, c7.arr.Length)); + Assert.True(TakeDoubleArrayExpClassByVal(c7, c7.arr.Length)); C_FLOATArray_Exp c8 = new C_FLOATArray_Exp(); c8.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeFloatArrayExpClassByVal(c8, c8.arr.Length)); + Assert.True(TakeFloatArrayExpClassByVal(c8, c8.arr.Length)); C_BYTEArray_Exp c9 = new C_BYTEArray_Exp(); c9.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeByteArrayExpClassByVal(c9, c9.arr.Length)); + Assert.True(TakeByteArrayExpClassByVal(c9, c9.arr.Length)); C_CHARArray_Exp c10 = new C_CHARArray_Exp(); c10.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeCharArrayExpClassByVal(c10, c10.arr.Length)); + Assert.True(TakeCharArrayExpClassByVal(c10, c10.arr.Length)); C_LPSTRArray_Exp c11 = new C_LPSTRArray_Exp(); c11.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeLPSTRArrayExpClassByVal(c11, c11.arr.Length)); + Assert.True(TakeLPSTRArrayExpClassByVal(c11, c11.arr.Length)); C_LPCSTRArray_Exp c12 = new C_LPCSTRArray_Exp(); c12.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeLPCSTRArrayExpClassByVal(c12, c12.arr.Length)); + Assert.True(TakeLPCSTRArrayExpClassByVal(c12, c12.arr.Length)); if (OperatingSystem.IsWindows()) { C_BSTRArray_Exp c13 = new C_BSTRArray_Exp(); c13.arr = InitArray(ARRAY_SIZE); - Assert.IsTrue(TakeBSTRArrayExpClassByVal(c13, c13.arr.Length)); + Assert.True(TakeBSTRArrayExpClassByVal(c13, c13.arr.Length)); } C_StructArray_Exp c14 = new C_StructArray_Exp(); c14.arr = InitStructArray(ARRAY_SIZE); - Assert.IsTrue(TakeStructArrayExpClassByVal(c14, c14.arr.Length)); + Assert.True(TakeStructArrayExpClassByVal(c14, c14.arr.Length)); } static void RunTest5(string report) { Console.WriteLine(report); - + S_INTArray_Seq retval = S_INTArray_Ret_ByValue(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval.arr)); C_INTArray_Seq retval1 = S_INTArray_Ret(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval1.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval1.arr)); C_UINTArray_Seq retval2 = S_UINTArray_Ret(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval2.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval2.arr)); C_SHORTArray_Seq retval3 = S_SHORTArray_Ret(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval3.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval3.arr)); C_WORDArray_Seq retval4 = S_WORDArray_Ret(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval4.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval4.arr)); C_LONG64Array_Seq retval5 = S_LONG64Array_Ret(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval5.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval5.arr)); C_ULONG64Array_Seq retval6 = S_ULONG64Array_Ret(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval6.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval6.arr)); C_DOUBLEArray_Seq retval7 = S_DOUBLEArray_Ret(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval7.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval7.arr)); C_FLOATArray_Seq retval8 = S_FLOATArray_Ret(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval8.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval8.arr)); C_BYTEArray_Seq retval9 = S_BYTEArray_Ret(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval9.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval9.arr)); C_CHARArray_Seq retval10 = S_CHARArray_Ret(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval10.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval10.arr)); C_LPSTRArray_Seq retval11 = S_LPSTRArray_Ret(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval11.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval11.arr)); if (OperatingSystem.IsWindows()) { C_BSTRArray_Seq retval12 = S_BSTRArray_Ret(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval12.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval12.arr)); } C_StructArray_Seq retval13 = S_StructArray_Ret(); - Assert.IsTrue(TestStructEquals(InitStructArray(ARRAY_SIZE), retval13.arr)); + Assert.True(TestStructEquals(InitStructArray(ARRAY_SIZE), retval13.arr)); } static void RunTest6(string report) @@ -1134,46 +1134,46 @@ static void RunTest6(string report) Console.WriteLine(report); C_INTArray_Exp retval1 = S_INTArray_Ret2(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval1.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval1.arr)); C_UINTArray_Exp retval2 = S_UINTArray_Ret2(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval2.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval2.arr)); C_SHORTArray_Exp retval3 = S_SHORTArray_Ret2(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval3.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval3.arr)); C_WORDArray_Exp retval4 = S_WORDArray_Ret2(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval4.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval4.arr)); C_LONG64Array_Exp retval5 = S_LONG64Array_Ret2(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval5.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval5.arr)); C_ULONG64Array_Exp retval6 = S_ULONG64Array_Ret2(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval6.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval6.arr)); C_DOUBLEArray_Exp retval7 = S_DOUBLEArray_Ret2(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval7.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval7.arr)); C_FLOATArray_Exp retval8 = S_FLOATArray_Ret2(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval8.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval8.arr)); C_BYTEArray_Exp retval9 = S_BYTEArray_Ret2(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval9.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval9.arr)); C_CHARArray_Exp retval10 = S_CHARArray_Ret2(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval10.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval10.arr)); C_LPSTRArray_Exp retval11 = S_LPSTRArray_Ret2(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval11.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval11.arr)); if (OperatingSystem.IsWindows()) { C_BSTRArray_Exp retval12 = S_BSTRArray_Ret2(); - Assert.IsTrue(Equals(InitArray(ARRAY_SIZE), retval12.arr)); + Assert.True(Equals(InitArray(ARRAY_SIZE), retval12.arr)); } C_StructArray_Exp retval13 = S_StructArray_Ret2(); - Assert.IsTrue(TestStructEquals(InitStructArray(ARRAY_SIZE), retval13.arr)); + Assert.True(TestStructEquals(InitStructArray(ARRAY_SIZE), retval13.arr)); } static int Main(string[] args) @@ -1186,7 +1186,7 @@ static int Main(string[] args) RunTest4("RunTest4 : Marshal array as field as ByValArray in explicit class as parameter."); RunTest5("RunTest5 : Marshal array as field as ByValArray in sequential class as return type."); RunTest6("RunTest6 : Marshal array as field as ByValArray in explicit class as return type."); - + Console.WriteLine("\nTest PASS."); return 100; } diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.cs b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.cs index 70b9618e57752a..b2de3fe16e9585 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.cs +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/AsLPArray/AsLPArrayTest.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; class Test { @@ -172,62 +172,62 @@ static void RunTest1(string report) Console.WriteLine(report); S_INTArray_Seq s1 = new S_INTArray_Seq(); s1.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeIntArraySeqStructByVal(s1, ARRAY_SIZE), "TakeIntArraySeqStructByVal"); + Assert.Throws(() => TakeIntArraySeqStructByVal(s1, ARRAY_SIZE)); S_UINTArray_Seq s2 = new S_UINTArray_Seq(); s2.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeUIntArraySeqStructByVal(s2, ARRAY_SIZE), "TakeUIntArraySeqStructByVal"); + Assert.Throws(() => TakeUIntArraySeqStructByVal(s2, ARRAY_SIZE)); S_SHORTArray_Seq s3 = new S_SHORTArray_Seq(); s3.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeShortArraySeqStructByVal(s3, ARRAY_SIZE), "TakeShortArraySeqStructByVal"); + Assert.Throws(() => TakeShortArraySeqStructByVal(s3, ARRAY_SIZE)); S_WORDArray_Seq s4 = new S_WORDArray_Seq(); s4.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeWordArraySeqStructByVal(s4, ARRAY_SIZE), "TakeWordArraySeqStructByVal"); + Assert.Throws(() => TakeWordArraySeqStructByVal(s4, ARRAY_SIZE)); S_LONG64Array_Seq s5 = new S_LONG64Array_Seq(); s5.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeLong64ArraySeqStructByVal(s5, ARRAY_SIZE), "TakeLong64ArraySeqStructByVal"); + Assert.Throws(() => TakeLong64ArraySeqStructByVal(s5, ARRAY_SIZE)); S_ULONG64Array_Seq s6 = new S_ULONG64Array_Seq(); s6.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeULong64ArraySeqStructByVal(s6, ARRAY_SIZE), "TakeULong64ArraySeqStructByVal"); + Assert.Throws(() => TakeULong64ArraySeqStructByVal(s6, ARRAY_SIZE)); S_DOUBLEArray_Seq s7 = new S_DOUBLEArray_Seq(); s7.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeDoubleArraySeqStructByVal(s7, ARRAY_SIZE), "TakeDoubleArraySeqStructByVal"); + Assert.Throws(() => TakeDoubleArraySeqStructByVal(s7, ARRAY_SIZE)); S_FLOATArray_Seq s8 = new S_FLOATArray_Seq(); s8.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeFloatArraySeqStructByVal(s8, ARRAY_SIZE), "TakeFloatArraySeqStructByVal"); + Assert.Throws(() => TakeFloatArraySeqStructByVal(s8, ARRAY_SIZE)); S_BYTEArray_Seq s9 = new S_BYTEArray_Seq(); s9.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeByteArraySeqStructByVal(s9, ARRAY_SIZE), "TakeByteArraySeqStructByVal"); + Assert.Throws(() => TakeByteArraySeqStructByVal(s9, ARRAY_SIZE)); S_CHARArray_Seq s10 = new S_CHARArray_Seq(); s10.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeCharArraySeqStructByVal(s10, ARRAY_SIZE), "TakeCharArraySeqStructByVal"); + Assert.Throws(() => TakeCharArraySeqStructByVal(s10, ARRAY_SIZE)); S_LPSTRArray_Seq s11 = new S_LPSTRArray_Seq(); s11.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeLPSTRArraySeqStructByVal(s11, ARRAY_SIZE), "TakeLPSTRArraySeqStructByVal"); + Assert.Throws(() => TakeLPSTRArraySeqStructByVal(s11, ARRAY_SIZE)); S_LPCSTRArray_Seq s12 = new S_LPCSTRArray_Seq(); s12.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeLPCSTRArraySeqStructByVal(s12, ARRAY_SIZE), "TakeLPCSTRArraySeqStructByVal"); + Assert.Throws(() => TakeLPCSTRArraySeqStructByVal(s12, ARRAY_SIZE)); if (OperatingSystem.IsWindows()) { S_BSTRArray_Seq s13 = new S_BSTRArray_Seq(); s13.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeBSTRArraySeqStructByVal(s13, ARRAY_SIZE), "TakeBSTRArraySeqStructByVal"); + Assert.Throws(() => TakeBSTRArraySeqStructByVal(s13, ARRAY_SIZE)); } S_StructArray_Seq s14 = new S_StructArray_Seq(); s14.arr = InitStructArray(ARRAY_SIZE); - Assert.Throws(() => TakeStructArraySeqStructByVal(s14, ARRAY_SIZE), "TakeStructArraySeqStructByVal"); + Assert.Throws(() => TakeStructArraySeqStructByVal(s14, ARRAY_SIZE)); } static void RunTest2(string report) @@ -235,62 +235,62 @@ static void RunTest2(string report) Console.WriteLine(report); C_INTArray_Seq c1 = new C_INTArray_Seq(); c1.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeIntArraySeqClassByVal(c1, ARRAY_SIZE), "TakeIntArraySeqClassByVal"); + Assert.Throws(() => TakeIntArraySeqClassByVal(c1, ARRAY_SIZE)); C_UINTArray_Seq c2 = new C_UINTArray_Seq(); c2.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeUIntArraySeqClassByVal(c2, ARRAY_SIZE), "TakeUIntArraySeqClassByVal"); + Assert.Throws(() => TakeUIntArraySeqClassByVal(c2, ARRAY_SIZE)); C_SHORTArray_Seq c3 = new C_SHORTArray_Seq(); c3.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeShortArraySeqClassByVal(c3, ARRAY_SIZE), "TakeShortArraySeqClassByVal"); + Assert.Throws(() => TakeShortArraySeqClassByVal(c3, ARRAY_SIZE)); C_WORDArray_Seq c4 = new C_WORDArray_Seq(); c4.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeWordArraySeqClassByVal(c4, ARRAY_SIZE), "TakeWordArraySeqClassByVal"); + Assert.Throws(() => TakeWordArraySeqClassByVal(c4, ARRAY_SIZE)); C_LONG64Array_Seq c5 = new C_LONG64Array_Seq(); c5.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeLong64ArraySeqClassByVal(c5, ARRAY_SIZE), "TakeLong64ArraySeqClassByVal"); + Assert.Throws(() => TakeLong64ArraySeqClassByVal(c5, ARRAY_SIZE)); C_ULONG64Array_Seq c6 = new C_ULONG64Array_Seq(); c6.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeULong64ArraySeqClassByVal(c6, ARRAY_SIZE), "TakeULong64ArraySeqClassByVal"); + Assert.Throws(() => TakeULong64ArraySeqClassByVal(c6, ARRAY_SIZE)); C_DOUBLEArray_Seq c7 = new C_DOUBLEArray_Seq(); c7.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeDoubleArraySeqClassByVal(c7, ARRAY_SIZE), "TakeDoubleArraySeqClassByVal"); + Assert.Throws(() => TakeDoubleArraySeqClassByVal(c7, ARRAY_SIZE)); C_FLOATArray_Seq c8 = new C_FLOATArray_Seq(); c8.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeFloatArraySeqClassByVal(c8, ARRAY_SIZE), "TakeFloatArraySeqClassByVal"); + Assert.Throws(() => TakeFloatArraySeqClassByVal(c8, ARRAY_SIZE)); C_BYTEArray_Seq c9 = new C_BYTEArray_Seq(); c9.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeByteArraySeqClassByVal(c9, ARRAY_SIZE), "TakeByteArraySeqClassByVal"); + Assert.Throws(() => TakeByteArraySeqClassByVal(c9, ARRAY_SIZE)); C_CHARArray_Seq c10 = new C_CHARArray_Seq(); c10.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeCharArraySeqClassByVal(c10, ARRAY_SIZE), "TakeCharArraySeqClassByVal"); + Assert.Throws(() => TakeCharArraySeqClassByVal(c10, ARRAY_SIZE)); C_LPSTRArray_Seq c11 = new C_LPSTRArray_Seq(); c11.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeLPSTRArraySeqClassByVal(c11, ARRAY_SIZE), "TakeLPSTRArraySeqClassByVal"); + Assert.Throws(() => TakeLPSTRArraySeqClassByVal(c11, ARRAY_SIZE)); C_LPCSTRArray_Seq c12 = new C_LPCSTRArray_Seq(); c12.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeLPCSTRArraySeqClassByVal(c12, ARRAY_SIZE), "TakeLPCSTRArraySeqClassByVal"); + Assert.Throws(() => TakeLPCSTRArraySeqClassByVal(c12, ARRAY_SIZE)); if (OperatingSystem.IsWindows()) { C_BSTRArray_Seq c13 = new C_BSTRArray_Seq(); c13.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeBSTRArraySeqClassByVal(c13, ARRAY_SIZE), "TakeBSTRArraySeqClassByVal"); + Assert.Throws(() => TakeBSTRArraySeqClassByVal(c13, ARRAY_SIZE)); } C_StructArray_Seq c14 = new C_StructArray_Seq(); c14.arr = InitStructArray(ARRAY_SIZE); - Assert.Throws(() => TakeStructArraySeqClassByVal(c14, ARRAY_SIZE), "TakeStructArraySeqClassByVal"); + Assert.Throws(() => TakeStructArraySeqClassByVal(c14, ARRAY_SIZE)); } static void RunTest3(string report) @@ -299,62 +299,62 @@ static void RunTest3(string report) S_INTArray_Exp s1 = new S_INTArray_Exp(); s1.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeIntArrayExpStructByVal(s1, ARRAY_SIZE), "TakeIntArrayExpStructByVal"); + Assert.Throws(() => TakeIntArrayExpStructByVal(s1, ARRAY_SIZE)); S_UINTArray_Exp s2 = new S_UINTArray_Exp(); s2.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeUIntArrayExpStructByVal(s2, ARRAY_SIZE), "TakeUIntArrayExpStructByVal"); + Assert.Throws(() => TakeUIntArrayExpStructByVal(s2, ARRAY_SIZE)); S_SHORTArray_Exp s3 = new S_SHORTArray_Exp(); s3.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeShortArrayExpStructByVal(s3, ARRAY_SIZE), "TakeShortArrayExpStructByVal"); + Assert.Throws(() => TakeShortArrayExpStructByVal(s3, ARRAY_SIZE)); S_WORDArray_Exp s4 = new S_WORDArray_Exp(); s4.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeWordArrayExpStructByVal(s4, ARRAY_SIZE), "TakeWordArrayExpStructByVal"); + Assert.Throws(() => TakeWordArrayExpStructByVal(s4, ARRAY_SIZE)); S_LONG64Array_Exp s5 = new S_LONG64Array_Exp(); s5.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeLong64ArrayExpStructByVal(s5, ARRAY_SIZE), "TakeLong64ArrayExpStructByVal"); + Assert.Throws(() => TakeLong64ArrayExpStructByVal(s5, ARRAY_SIZE)); S_ULONG64Array_Exp s6 = new S_ULONG64Array_Exp(); s6.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeULong64ArrayExpStructByVal(s6, ARRAY_SIZE), "TakeULong64ArrayExpStructByVal"); + Assert.Throws(() => TakeULong64ArrayExpStructByVal(s6, ARRAY_SIZE)); S_DOUBLEArray_Exp s7 = new S_DOUBLEArray_Exp(); s7.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeDoubleArrayExpStructByVal(s7, ARRAY_SIZE), "TakeDoubleArrayExpStructByVal"); + Assert.Throws(() => TakeDoubleArrayExpStructByVal(s7, ARRAY_SIZE)); S_FLOATArray_Exp s8 = new S_FLOATArray_Exp(); s8.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeFloatArrayExpStructByVal(s8, ARRAY_SIZE), "TakeFloatArrayExpStructByVal"); + Assert.Throws(() => TakeFloatArrayExpStructByVal(s8, ARRAY_SIZE)); S_BYTEArray_Exp s9 = new S_BYTEArray_Exp(); s9.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeByteArrayExpStructByVal(s9, ARRAY_SIZE), "TakeByteArrayExpStructByVal"); + Assert.Throws(() => TakeByteArrayExpStructByVal(s9, ARRAY_SIZE)); S_CHARArray_Exp s10 = new S_CHARArray_Exp(); s10.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeCharArrayExpStructByVal(s10, ARRAY_SIZE), "TakeCharArrayExpStructByVal"); + Assert.Throws(() => TakeCharArrayExpStructByVal(s10, ARRAY_SIZE)); S_LPSTRArray_Exp s11 = new S_LPSTRArray_Exp(); s11.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeLPSTRArrayExpStructByVal(s11, ARRAY_SIZE), "TakeLPSTRArrayExpStructByVal"); + Assert.Throws(() => TakeLPSTRArrayExpStructByVal(s11, ARRAY_SIZE)); S_LPCSTRArray_Exp s12 = new S_LPCSTRArray_Exp(); s12.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeLPCSTRArrayExpStructByVal(s12, ARRAY_SIZE), "TakeLPCSTRArrayExpStructByVal"); + Assert.Throws(() => TakeLPCSTRArrayExpStructByVal(s12, ARRAY_SIZE)); if (OperatingSystem.IsWindows()) { S_BSTRArray_Exp s13 = new S_BSTRArray_Exp(); s13.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeBSTRArrayExpStructByVal(s13, ARRAY_SIZE), "TakeBSTRArrayExpStructByVal"); + Assert.Throws(() => TakeBSTRArrayExpStructByVal(s13, ARRAY_SIZE)); } S_StructArray_Exp s14 = new S_StructArray_Exp(); s14.arr = InitStructArray(ARRAY_SIZE); - Assert.Throws(() => TakeStructArrayExpStructByVal(s14, ARRAY_SIZE), "TakeStructArrayExpStructByVal"); + Assert.Throws(() => TakeStructArrayExpStructByVal(s14, ARRAY_SIZE)); } static void RunTest4(string report) @@ -363,62 +363,62 @@ static void RunTest4(string report) C_INTArray_Exp c1 = new C_INTArray_Exp(); c1.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeIntArrayExpClassByVal(c1, ARRAY_SIZE), "TakeIntArrayExpClassByVal"); + Assert.Throws(() => TakeIntArrayExpClassByVal(c1, ARRAY_SIZE)); C_UINTArray_Exp c2 = new C_UINTArray_Exp(); c2.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeUIntArrayExpClassByVal(c2, ARRAY_SIZE), "TakeUIntArrayExpClassByVal"); + Assert.Throws(() => TakeUIntArrayExpClassByVal(c2, ARRAY_SIZE)); C_SHORTArray_Exp c3 = new C_SHORTArray_Exp(); c3.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeShortArrayExpClassByVal(c3, ARRAY_SIZE), "TakeShortArrayExpClassByVal"); + Assert.Throws(() => TakeShortArrayExpClassByVal(c3, ARRAY_SIZE)); C_WORDArray_Exp c4 = new C_WORDArray_Exp(); c4.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeWordArrayExpClassByVal(c4, ARRAY_SIZE), "TakeWordArrayExpClassByVal"); + Assert.Throws(() => TakeWordArrayExpClassByVal(c4, ARRAY_SIZE)); C_LONG64Array_Exp c5 = new C_LONG64Array_Exp(); c5.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeLong64ArrayExpClassByVal(c5, ARRAY_SIZE), "TakeLong64ArrayExpClassByVal"); + Assert.Throws(() => TakeLong64ArrayExpClassByVal(c5, ARRAY_SIZE)); C_ULONG64Array_Exp c6 = new C_ULONG64Array_Exp(); c6.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeULong64ArrayExpClassByVal(c6, ARRAY_SIZE), "TakeULong64ArrayExpClassByVal"); + Assert.Throws(() => TakeULong64ArrayExpClassByVal(c6, ARRAY_SIZE)); C_DOUBLEArray_Exp c7 = new C_DOUBLEArray_Exp(); c7.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeDoubleArrayExpClassByVal(c7, ARRAY_SIZE), "TakeDoubleArrayExpClassByVal"); + Assert.Throws(() => TakeDoubleArrayExpClassByVal(c7, ARRAY_SIZE)); C_FLOATArray_Exp c8 = new C_FLOATArray_Exp(); c8.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeFloatArrayExpClassByVal(c8, ARRAY_SIZE), "TakeFloatArrayExpClassByVal"); + Assert.Throws(() => TakeFloatArrayExpClassByVal(c8, ARRAY_SIZE)); C_BYTEArray_Exp c9 = new C_BYTEArray_Exp(); c9.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeByteArrayExpClassByVal(c9, ARRAY_SIZE), "TakeByteArrayExpClassByVal"); + Assert.Throws(() => TakeByteArrayExpClassByVal(c9, ARRAY_SIZE)); C_CHARArray_Exp c10 = new C_CHARArray_Exp(); c10.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeCharArrayExpClassByVal(c10, ARRAY_SIZE), "TakeCharArrayExpClassByVal"); + Assert.Throws(() => TakeCharArrayExpClassByVal(c10, ARRAY_SIZE)); C_LPSTRArray_Exp c11 = new C_LPSTRArray_Exp(); c11.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeLPSTRArrayExpClassByVal(c11, ARRAY_SIZE), "TakeLPSTRArrayExpClassByVal"); + Assert.Throws(() => TakeLPSTRArrayExpClassByVal(c11, ARRAY_SIZE)); C_LPCSTRArray_Exp c12 = new C_LPCSTRArray_Exp(); c12.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeLPCSTRArrayExpClassByVal(c12, ARRAY_SIZE), "TakeLPCSTRArrayExpClassByVal"); + Assert.Throws(() => TakeLPCSTRArrayExpClassByVal(c12, ARRAY_SIZE)); if (OperatingSystem.IsWindows()) { C_BSTRArray_Exp c13 = new C_BSTRArray_Exp(); c13.arr = InitArray(ARRAY_SIZE); - Assert.Throws(() => TakeBSTRArrayExpClassByVal(c13, ARRAY_SIZE), "TakeBSTRArrayExpClassByVal"); + Assert.Throws(() => TakeBSTRArrayExpClassByVal(c13, ARRAY_SIZE)); } C_StructArray_Exp c14 = new C_StructArray_Exp(); c14.arr = InitStructArray(ARRAY_SIZE); - Assert.Throws(() => TakeStructArrayExpClassByVal(c14, ARRAY_SIZE), "TakeStructArrayExpClassByVal"); + Assert.Throws(() => TakeStructArrayExpClassByVal(c14, ARRAY_SIZE)); } static int Main(string[] args) @@ -429,7 +429,7 @@ static int Main(string[] args) RunTest2("RunTest 2 : Marshal Array In Sequential Class As LPArray. "); if (OperatingSystem.IsWindows()) { - RunTest3("RunTest 3 : Marshal Array In Explicit Struct As LPArray. "); + RunTest3("RunTest 3 : Marshal Array In Explicit Struct As LPArray. "); } RunTest4("RunTest 4 : Marshal Array In Explicit Class As LPArray. "); Console.WriteLine("\nTest PASS."); diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/LPArrayNative/MarshalArrayByValArrayNative.cpp b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/LPArrayNative/MarshalArrayByValArrayNative.cpp index 5f9aaf419b3184..05a306b26a7e43 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/LPArrayNative/MarshalArrayByValArrayNative.cpp +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsField/LPArrayNative/MarshalArrayByValArrayNative.cpp @@ -34,29 +34,27 @@ macro definition struct definition ----------------------------------------------------------------------------*/ -typedef struct { INT arr[ARRAY_SIZE]; } S_INTArray; -typedef struct { UINT arr[ARRAY_SIZE]; } S_UINTArray; -typedef struct { SHORT arr[ARRAY_SIZE]; } S_SHORTArray; -typedef struct { WORD arr[ARRAY_SIZE]; } S_WORDArray; -typedef struct { LONG64 arr[ARRAY_SIZE]; } S_LONG64Array; - -typedef struct { ULONG64 arr[ARRAY_SIZE]; } S_ULONG64Array; -typedef struct { DOUBLE arr[ARRAY_SIZE]; } S_DOUBLEArray; -typedef struct { FLOAT arr[ARRAY_SIZE]; } S_FLOATArray; -typedef struct { BYTE arr[ARRAY_SIZE]; } S_BYTEArray; -typedef struct { CHAR arr[ARRAY_SIZE]; } S_CHARArray; - -typedef struct { LPSTR arr[ARRAY_SIZE]; } S_LPSTRArray; -typedef struct { LPCSTR arr[ARRAY_SIZE]; } S_LPCSTRArray; +typedef struct { INT arr[ARRAY_LENGTH]; } S_INTArray; +typedef struct { UINT arr[ARRAY_LENGTH]; } S_UINTArray; +typedef struct { SHORT arr[ARRAY_LENGTH]; } S_SHORTArray; +typedef struct { WORD arr[ARRAY_LENGTH]; } S_WORDArray; +typedef struct { LONG64 arr[ARRAY_LENGTH]; } S_LONG64Array; + +typedef struct { ULONG64 arr[ARRAY_LENGTH]; } S_ULONG64Array; +typedef struct { DOUBLE arr[ARRAY_LENGTH]; } S_DOUBLEArray; +typedef struct { FLOAT arr[ARRAY_LENGTH]; } S_FLOATArray; +typedef struct { BYTE arr[ARRAY_LENGTH]; } S_BYTEArray; +typedef struct { CHAR arr[ARRAY_LENGTH]; } S_CHARArray; + +typedef struct { LPSTR arr[ARRAY_LENGTH]; } S_LPSTRArray; +typedef struct { LPCSTR arr[ARRAY_LENGTH]; } S_LPCSTRArray; #ifdef _WIN32 -typedef struct { BSTR arr[ARRAY_SIZE]; } S_BSTRArray; +typedef struct { BSTR arr[ARRAY_LENGTH]; } S_BSTRArray; #endif //struct array in a struct - -typedef struct { TestStruct arr[ARRAY_SIZE]; } S_StructArray; - -typedef struct { BOOL arr[ARRAY_SIZE]; } S_BOOLArray; +typedef struct { TestStruct arr[ARRAY_LENGTH]; } S_StructArray; +typedef struct { BOOL arr[ARRAY_LENGTH]; } S_BOOLArray; enum class TestEnum : int32_t { @@ -66,9 +64,7 @@ enum class TestEnum : int32_t }; typedef struct { TestEnum arr[3]; } EnregisterableNonBlittable; - typedef struct { int32_t i; } SimpleStruct; - typedef struct { SimpleStruct arr[3]; } EnregisterableUserType; /*---------------------------------------------------------------------------- @@ -77,9 +73,9 @@ helper function TestStruct* InitTestStruct() { - TestStruct *expected = (TestStruct *)CoreClrAlloc( sizeof(TestStruct) * ARRAY_SIZE ); + TestStruct *expected = (TestStruct *)CoreClrAlloc( sizeof(TestStruct) * ARRAY_LENGTH ); - for ( int i = 0; i < ARRAY_SIZE; i++) + for ( int i = 0; i < ARRAY_LENGTH; i++) { expected[i].x = i; expected[i].d = i; @@ -124,7 +120,7 @@ bool TestStructEquals(TestStruct Actual[], TestStruct Expected[]) else if ( Actual != NULL && Expected == NULL ) return false; - for ( int i = 0; i < ARRAY_SIZE; ++i ) + for ( int i = 0; i < ARRAY_LENGTH; ++i ) { if ( !(IsObjectEquals(Actual[i].x, Expected[i].x) && IsObjectEquals(Actual[i].d, Expected[i].d) && @@ -151,93 +147,93 @@ marshal sequential strut extern "C" DLL_EXPORT BOOL __cdecl TakeIntArraySeqStructByVal( S_INTArray s, int size ) { CHECK_PARAM_NOT_EMPTY( s.arr ); - INIT_EXPECTED( INT, ARRAY_SIZE ); - return Equals( s.arr, size, expected, ARRAY_SIZE ); + INIT_EXPECTED( INT, ARRAY_LENGTH ); + return Equals( s.arr, size, expected, ARRAY_LENGTH ); } extern "C" DLL_EXPORT BOOL __cdecl TakeUIntArraySeqStructByVal( S_UINTArray s, int size ) { CHECK_PARAM_NOT_EMPTY( s.arr ); - INIT_EXPECTED( UINT, ARRAY_SIZE ); - return Equals( s.arr, size, expected, ARRAY_SIZE ); + INIT_EXPECTED( UINT, ARRAY_LENGTH ); + return Equals( s.arr, size, expected, ARRAY_LENGTH ); } extern "C" DLL_EXPORT BOOL __cdecl TakeShortArraySeqStructByVal( S_SHORTArray s, int size ) { CHECK_PARAM_NOT_EMPTY( s.arr ); - INIT_EXPECTED( SHORT, ARRAY_SIZE ); - return Equals( s.arr, size, expected, ARRAY_SIZE ); + INIT_EXPECTED( SHORT, ARRAY_LENGTH ); + return Equals( s.arr, size, expected, ARRAY_LENGTH ); } extern "C" DLL_EXPORT BOOL __cdecl TakeWordArraySeqStructByVal( S_WORDArray s, int size ) { CHECK_PARAM_NOT_EMPTY( s.arr ); - INIT_EXPECTED( WORD, ARRAY_SIZE ); - return Equals( s.arr, size, expected, ARRAY_SIZE ); + INIT_EXPECTED( WORD, ARRAY_LENGTH ); + return Equals( s.arr, size, expected, ARRAY_LENGTH ); } extern "C" DLL_EXPORT BOOL __cdecl TakeLong64ArraySeqStructByVal( S_LONG64Array s, int size ) { CHECK_PARAM_NOT_EMPTY( s.arr ); - INIT_EXPECTED( LONG64, ARRAY_SIZE ); - return Equals( s.arr, size, expected, ARRAY_SIZE ); + INIT_EXPECTED( LONG64, ARRAY_LENGTH ); + return Equals( s.arr, size, expected, ARRAY_LENGTH ); } extern "C" DLL_EXPORT BOOL __cdecl TakeULong64ArraySeqStructByVal( S_ULONG64Array s, int size ) { CHECK_PARAM_NOT_EMPTY( s.arr ); - INIT_EXPECTED( ULONG64, ARRAY_SIZE ); - return Equals( s.arr, size, expected, ARRAY_SIZE ); + INIT_EXPECTED( ULONG64, ARRAY_LENGTH ); + return Equals( s.arr, size, expected, ARRAY_LENGTH ); } extern "C" DLL_EXPORT BOOL __cdecl TakeDoubleArraySeqStructByVal( S_DOUBLEArray s, int size ) { CHECK_PARAM_NOT_EMPTY( s.arr ); - INIT_EXPECTED( DOUBLE, ARRAY_SIZE ); - return Equals( s.arr, size, expected, ARRAY_SIZE ); + INIT_EXPECTED( DOUBLE, ARRAY_LENGTH ); + return Equals( s.arr, size, expected, ARRAY_LENGTH ); } extern "C" DLL_EXPORT BOOL __cdecl TakeFloatArraySeqStructByVal( S_FLOATArray s, int size ) { CHECK_PARAM_NOT_EMPTY( s.arr ); - INIT_EXPECTED( FLOAT, ARRAY_SIZE ); - return Equals( s.arr, size, expected, ARRAY_SIZE ); + INIT_EXPECTED( FLOAT, ARRAY_LENGTH ); + return Equals( s.arr, size, expected, ARRAY_LENGTH ); } extern "C" DLL_EXPORT BOOL __cdecl TakeByteArraySeqStructByVal( S_BYTEArray s, int size ) { CHECK_PARAM_NOT_EMPTY( s.arr ); - INIT_EXPECTED( BYTE, ARRAY_SIZE ); - return Equals( s.arr, size, expected, ARRAY_SIZE ); + INIT_EXPECTED( BYTE, ARRAY_LENGTH ); + return Equals( s.arr, size, expected, ARRAY_LENGTH ); } extern "C" DLL_EXPORT BOOL __cdecl TakeCharArraySeqStructByVal( S_CHARArray s, int size ) { CHECK_PARAM_NOT_EMPTY( s.arr ); - INIT_EXPECTED( CHAR, ARRAY_SIZE ); - return Equals( s.arr, size, expected, ARRAY_SIZE ); + INIT_EXPECTED( CHAR, ARRAY_LENGTH ); + return Equals( s.arr, size, expected, ARRAY_LENGTH ); } extern "C" DLL_EXPORT BOOL __cdecl TakeLPSTRArraySeqStructByVal( S_LPSTRArray s, int size ) { CHECK_PARAM_NOT_EMPTY( s.arr ); - LPSTR expected[ARRAY_SIZE]; - for ( int i = 0; i < ARRAY_SIZE; ++i ) + LPSTR expected[ARRAY_LENGTH]; + for ( int i = 0; i < ARRAY_LENGTH; ++i ) expected[i] = ToString(i); - return Equals( s.arr, size, expected, ARRAY_SIZE ); + return Equals( s.arr, size, expected, ARRAY_LENGTH ); } extern "C" DLL_EXPORT BOOL __cdecl TakeLPCSTRArraySeqStructByVal( S_LPCSTRArray s, int size ) { CHECK_PARAM_NOT_EMPTY( s.arr ); - LPSTR expected[ARRAY_SIZE]; - for ( int i = 0; i < ARRAY_SIZE; ++i ) + LPSTR expected[ARRAY_LENGTH]; + for ( int i = 0; i < ARRAY_LENGTH; ++i ) expected[i] = ToString(i); - return Equals( s.arr, size, (LPCSTR *)expected, ARRAY_SIZE ); + return Equals( s.arr, size, (LPCSTR *)expected, ARRAY_LENGTH ); } #ifdef _WIN32 @@ -245,11 +241,11 @@ extern "C" DLL_EXPORT BOOL __cdecl TakeBSTRArraySeqStructByVal( S_BSTRArray s, i { CHECK_PARAM_NOT_EMPTY( s.arr ); - BSTR expected[ARRAY_SIZE]; - for ( int i = 0; i < ARRAY_SIZE; ++i ) + BSTR expected[ARRAY_LENGTH]; + for ( int i = 0; i < ARRAY_LENGTH; ++i ) expected[i] = ToBSTR(i); - return Equals( s.arr, size, expected, ARRAY_SIZE ); + return Equals( s.arr, size, expected, ARRAY_LENGTH ); } #endif @@ -502,77 +498,77 @@ return a struct including a C array ----------------------------------------------------------------------------*/ extern "C" DLL_EXPORT S_INTArray __cdecl S_INTArray_Ret_ByValue() { - INIT_EXPECTED_STRUCT( S_INTArray, ARRAY_SIZE, INT ); + INIT_EXPECTED_STRUCT( S_INTArray, ARRAY_LENGTH, INT ); return *expected; } extern "C" DLL_EXPORT S_INTArray* __cdecl S_INTArray_Ret() { - INIT_EXPECTED_STRUCT( S_INTArray, ARRAY_SIZE, INT ); + INIT_EXPECTED_STRUCT( S_INTArray, ARRAY_LENGTH, INT ); return expected; } extern "C" DLL_EXPORT S_UINTArray* __cdecl S_UINTArray_Ret() { - INIT_EXPECTED_STRUCT( S_UINTArray, ARRAY_SIZE, UINT ); + INIT_EXPECTED_STRUCT( S_UINTArray, ARRAY_LENGTH, UINT ); return expected; } extern "C" DLL_EXPORT S_SHORTArray* __cdecl S_SHORTArray_Ret() { - INIT_EXPECTED_STRUCT( S_SHORTArray, ARRAY_SIZE, SHORT ); + INIT_EXPECTED_STRUCT( S_SHORTArray, ARRAY_LENGTH, SHORT ); return expected; } extern "C" DLL_EXPORT S_WORDArray* __cdecl S_WORDArray_Ret() { - INIT_EXPECTED_STRUCT( S_WORDArray, ARRAY_SIZE, WORD ); + INIT_EXPECTED_STRUCT( S_WORDArray, ARRAY_LENGTH, WORD ); return expected; } extern "C" DLL_EXPORT S_LONG64Array* __cdecl S_LONG64Array_Ret() { - INIT_EXPECTED_STRUCT( S_LONG64Array, ARRAY_SIZE, LONG64 ); + INIT_EXPECTED_STRUCT( S_LONG64Array, ARRAY_LENGTH, LONG64 ); return expected; } extern "C" DLL_EXPORT S_ULONG64Array* __cdecl S_ULONG64Array_Ret() { - INIT_EXPECTED_STRUCT( S_ULONG64Array, ARRAY_SIZE, ULONG64 ); + INIT_EXPECTED_STRUCT( S_ULONG64Array, ARRAY_LENGTH, ULONG64 ); return expected; } extern "C" DLL_EXPORT S_DOUBLEArray* __cdecl S_DOUBLEArray_Ret() { - INIT_EXPECTED_STRUCT( S_DOUBLEArray, ARRAY_SIZE, DOUBLE ); + INIT_EXPECTED_STRUCT( S_DOUBLEArray, ARRAY_LENGTH, DOUBLE ); return expected; } extern "C" DLL_EXPORT S_FLOATArray* __cdecl S_FLOATArray_Ret() { - INIT_EXPECTED_STRUCT( S_FLOATArray, ARRAY_SIZE, FLOAT ); + INIT_EXPECTED_STRUCT( S_FLOATArray, ARRAY_LENGTH, FLOAT ); return expected; } extern "C" DLL_EXPORT S_BYTEArray* __cdecl S_BYTEArray_Ret() { - INIT_EXPECTED_STRUCT( S_BYTEArray, ARRAY_SIZE, BYTE ); + INIT_EXPECTED_STRUCT( S_BYTEArray, ARRAY_LENGTH, BYTE ); return expected; } extern "C" DLL_EXPORT S_CHARArray* __cdecl S_CHARArray_Ret() { - INIT_EXPECTED_STRUCT( S_CHARArray, ARRAY_SIZE, CHAR ); + INIT_EXPECTED_STRUCT( S_CHARArray, ARRAY_LENGTH, CHAR ); return expected; } @@ -580,7 +576,7 @@ extern "C" DLL_EXPORT S_CHARArray* __cdecl S_CHARArray_Ret() extern "C" DLL_EXPORT S_LPSTRArray* __cdecl S_LPSTRArray_Ret() { S_LPSTRArray *expected = (S_LPSTRArray *)CoreClrAlloc( sizeof(S_LPSTRArray) ); - for ( int i = 0; i < ARRAY_SIZE; ++i ) + for ( int i = 0; i < ARRAY_LENGTH; ++i ) expected->arr[i] = ToString(i); return expected; @@ -590,7 +586,7 @@ extern "C" DLL_EXPORT S_LPSTRArray* __cdecl S_LPSTRArray_Ret() extern "C" DLL_EXPORT S_BSTRArray* __cdecl S_BSTRArray_Ret() { S_BSTRArray *expected = (S_BSTRArray *)CoreClrAlloc( sizeof(S_BSTRArray) ); - for ( int i = 0; i < ARRAY_SIZE; ++i ) + for ( int i = 0; i < ARRAY_LENGTH; ++i ) expected->arr[i] = ToBSTR(i); return expected; @@ -600,7 +596,7 @@ extern "C" DLL_EXPORT S_BSTRArray* __cdecl S_BSTRArray_Ret() extern "C" DLL_EXPORT S_StructArray* __cdecl S_StructArray_Ret() { S_StructArray *expected = (S_StructArray *)CoreClrAlloc( sizeof(S_StructArray) ); - for ( int i = 0; i < ARRAY_SIZE; ++i ) + for ( int i = 0; i < ARRAY_LENGTH; ++i ) { expected->arr[i].x = i; expected->arr[i].d = i; diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs index d30ef8bf9a2e73..afc96f9a1d7d0a 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsDefault/AsDefaultTest.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; public class ArrayMarshal { @@ -314,32 +314,32 @@ private static void TestMarshalByVal_NoAttributes() { Console.WriteLine("ByVal marshaling CLR array as c-style-array no attributes"); - Assert.IsTrue(CStyle_Array_Int(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Int"); - Assert.IsTrue(CStyle_Array_Uint(InitArray(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Uint") ; - Assert.IsTrue(CStyle_Array_Short(InitArray(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Short"); - Assert.IsTrue(CStyle_Array_Word(InitArray(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Word"); - Assert.IsTrue(CStyle_Array_Long64(InitArray(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Long64"); - Assert.IsTrue(CStyle_Array_ULong64(InitArray(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_ULong64"); - Assert.IsTrue(CStyle_Array_Double(InitArray(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Double"); - Assert.IsTrue(CStyle_Array_Float(InitArray(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Float"); - Assert.IsTrue(CStyle_Array_Byte(InitArray(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Byte"); - Assert.IsTrue(CStyle_Array_Char(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Char"); + Assert.True(CStyle_Array_Int(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Uint(InitArray(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Uint") ; + Assert.True(CStyle_Array_Short(InitArray(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Short"); + Assert.True(CStyle_Array_Word(InitArray(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Word"); + Assert.True(CStyle_Array_Long64(InitArray(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Long64"); + Assert.True(CStyle_Array_ULong64(InitArray(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_ULong64"); + Assert.True(CStyle_Array_Double(InitArray(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Double"); + Assert.True(CStyle_Array_Float(InitArray(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Float"); + Assert.True(CStyle_Array_Byte(InitArray(ARRAY_SIZE), ARRAY_SIZE),"CStyle_Array_Byte"); + Assert.True(CStyle_Array_Char(InitArray(ARRAY_SIZE), ARRAY_SIZE)); string[] strArr = InitArray(ARRAY_SIZE); // Test nesting null value scenario strArr[strArr.Length / 2] = null; - Assert.IsTrue(CStyle_Array_LPCSTR(strArr, ARRAY_SIZE), "CStyle_Array_LPCSTR"); - Assert.IsTrue(CStyle_Array_LPSTR(strArr, ARRAY_SIZE), "CStyle_Array_LPSTR"); - Assert.IsTrue(CStyle_Array_Struct(InitStructArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Struct"); + Assert.True(CStyle_Array_LPCSTR(strArr, ARRAY_SIZE)); + Assert.True(CStyle_Array_LPSTR(strArr, ARRAY_SIZE)); + Assert.True(CStyle_Array_Struct(InitStructArray(ARRAY_SIZE), ARRAY_SIZE)); - Assert.IsTrue(CStyle_Array_Bool(InitBoolArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Bool"); + Assert.True(CStyle_Array_Bool(InitBoolArray(ARRAY_SIZE), ARRAY_SIZE)); if (OperatingSystem.IsWindows()) { object[] oArr = InitArray(ARRAY_SIZE); // Test nesting null value scenario oArr[oArr.Length / 2] = null; - Assert.IsTrue(CStyle_Array_Object(oArr, ARRAY_SIZE), "CStyle_Array_Object"); + Assert.True(CStyle_Array_Object(oArr, ARRAY_SIZE)); } } @@ -347,31 +347,31 @@ private static void TestMarshalByVal_In() { Console.WriteLine("ByVal marshaling CLR array as c-style-array with InAttribute applied"); - Assert.IsTrue(CStyle_Array_Int_In(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Int_In"); - Assert.IsTrue(CStyle_Array_Uint_In(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Uint_In"); - Assert.IsTrue(CStyle_Array_Short_In(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Short_In"); - Assert.IsTrue(CStyle_Array_Word_In(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Word_In"); - Assert.IsTrue(CStyle_Array_Long64_In(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Long64_In"); - Assert.IsTrue(CStyle_Array_ULong64_In(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_ULong64_In"); - Assert.IsTrue(CStyle_Array_Double_In(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Double_In"); - Assert.IsTrue(CStyle_Array_Float_In(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Float_In"); - Assert.IsTrue(CStyle_Array_Byte_In(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Byte_In"); - Assert.IsTrue(CStyle_Array_Char_In(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Char_In"); + Assert.True(CStyle_Array_Int_In(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Uint_In(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Short_In(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Word_In(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Long64_In(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_ULong64_In(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Double_In(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Float_In(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Byte_In(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Char_In(InitArray(ARRAY_SIZE), ARRAY_SIZE)); string[] strArr = InitArray(ARRAY_SIZE); // Test nesting null value scenario strArr[strArr.Length / 2] = null; - Assert.IsTrue(CStyle_Array_LPCSTR_In(strArr, ARRAY_SIZE), "CStyle_Array_LPCSTR_In"); - Assert.IsTrue(CStyle_Array_LPSTR_In(strArr, ARRAY_SIZE), "CStyle_Array_LPSTR_In"); - Assert.IsTrue(CStyle_Array_Struct_In(InitStructArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Struct_In"); - Assert.IsTrue(CStyle_Array_Bool_In(InitBoolArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Bool_In"); + Assert.True(CStyle_Array_LPCSTR_In(strArr, ARRAY_SIZE)); + Assert.True(CStyle_Array_LPSTR_In(strArr, ARRAY_SIZE)); + Assert.True(CStyle_Array_Struct_In(InitStructArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Bool_In(InitBoolArray(ARRAY_SIZE), ARRAY_SIZE)); if (OperatingSystem.IsWindows()) { object[] oArr = InitArray(ARRAY_SIZE); // Test nesting null value scenario oArr[oArr.Length / 2] = null; - Assert.IsTrue(CStyle_Array_Object_In(oArr, ARRAY_SIZE), "CStyle_Array_Object_In"); + Assert.True(CStyle_Array_Object_In(oArr, ARRAY_SIZE)); } } @@ -384,94 +384,94 @@ private static void TestMarshalInOut_ByVal() Console.WriteLine("By value marshaling CLR array as c-style-array with InAttribute and OutAttribute applied"); Console.WriteLine("CStyle_Array_Int_InOut"); int[] iArr = InitArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Int_InOut(iArr, ARRAY_SIZE), "CStyle_Array_Int_InOut"); - Assert.IsTrue(Equals(iArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Int_InOut:Equals"); + Assert.True(CStyle_Array_Int_InOut(iArr, ARRAY_SIZE)); + Assert.True(Equals(iArr, GetExpectedOutArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_Int_InOut_Null"); int[] iArrNull = null; - Assert.IsTrue(CStyle_Array_Int_InOut_Null(iArrNull), "CStyle_Array_Int_InOut_Null"); - Assert.IsNull(iArrNull, "CStyle_Array_Int_InOut_Null:Equals"); + Assert.True(CStyle_Array_Int_InOut_Null(iArrNull)); + Assert.Null(iArrNull); Console.WriteLine("CStyle_Array_Int_InOut_ZeroLength"); int[] iArrLength0 = InitArray(0); - Assert.IsTrue(CStyle_Array_Int_InOut_ZeroLength(iArrLength0), "CStyle_Array_Int_InOut_ZeroLength"); - Assert.AreEqual(0, iArrLength0.Length, "CStyle_Array_Int_InOut_ZeroLength:Length"); + Assert.True(CStyle_Array_Int_InOut_ZeroLength(iArrLength0)); + Assert.Equal(0, iArrLength0.Length); Console.WriteLine("CStyle_Array_Uint_InOut"); uint[] uiArr = InitArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Uint_InOut(uiArr, ARRAY_SIZE), "CStyle_Array_Uint_InOut"); - Assert.IsTrue(Equals(uiArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Uint_InOut:Equals"); + Assert.True(CStyle_Array_Uint_InOut(uiArr, ARRAY_SIZE)); + Assert.True(Equals(uiArr, GetExpectedOutArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_Short_InOut"); short[] sArr = InitArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Short_InOut(sArr, ARRAY_SIZE), "CStyle_Array_Short_InOut"); - Assert.IsTrue(Equals(sArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Short_InOut:Equals"); + Assert.True(CStyle_Array_Short_InOut(sArr, ARRAY_SIZE)); + Assert.True(Equals(sArr, GetExpectedOutArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_Word_InOut"); ushort[] usArr = InitArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Word_InOut(usArr, ARRAY_SIZE), "CStyle_Array_Word_InOut"); - Assert.IsTrue(Equals(usArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Word_InOut:Equals"); + Assert.True(CStyle_Array_Word_InOut(usArr, ARRAY_SIZE)); + Assert.True(Equals(usArr, GetExpectedOutArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_Long64_InOut"); long[] lArr = InitArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Long64_InOut(lArr, ARRAY_SIZE), "CStyle_Array_Long64_InOut"); - Assert.IsTrue(Equals(lArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Long64_InOut:Equals"); + Assert.True(CStyle_Array_Long64_InOut(lArr, ARRAY_SIZE)); + Assert.True(Equals(lArr, GetExpectedOutArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_ULong64_InOut"); ulong[] ulArr = InitArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_ULong64_InOut(ulArr, ARRAY_SIZE), "CStyle_Array_ULong64_InOut"); - Assert.IsTrue(Equals(ulArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_ULong64_InOut:Equals"); + Assert.True(CStyle_Array_ULong64_InOut(ulArr, ARRAY_SIZE)); + Assert.True(Equals(ulArr, GetExpectedOutArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_Double_InOut"); double[] dArr = InitArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Double_InOut(dArr, ARRAY_SIZE), "CStyle_Array_Double_InOut"); - Assert.IsTrue(Equals(dArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Double_InOut:Equals"); + Assert.True(CStyle_Array_Double_InOut(dArr, ARRAY_SIZE)); + Assert.True(Equals(dArr, GetExpectedOutArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_Float_InOut"); float[] fArr = InitArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Float_InOut(fArr, ARRAY_SIZE), "CStyle_Array_Float_InOut"); - Assert.IsTrue(Equals(fArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Float_InOut:Equals"); + Assert.True(CStyle_Array_Float_InOut(fArr, ARRAY_SIZE)); + Assert.True(Equals(fArr, GetExpectedOutArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_Byte_InOut"); byte[] bArr = InitArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Byte_InOut(bArr, ARRAY_SIZE), "CStyle_Array_Byte_InOut"); - Assert.IsTrue(Equals(bArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Byte_InOut:Equals"); + Assert.True(CStyle_Array_Byte_InOut(bArr, ARRAY_SIZE)); + Assert.True(Equals(bArr, GetExpectedOutArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_Char_InOut"); char[] cArr = InitArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Char_InOut(cArr, ARRAY_SIZE), "CStyle_Array_Char_InOut"); - Assert.IsTrue(Equals(cArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Char_InOut:Equals"); + Assert.True(CStyle_Array_Char_InOut(cArr, ARRAY_SIZE)); + Assert.True(Equals(cArr, GetExpectedOutArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_LPSTR_InOut"); string[] strArr = InitArray(ARRAY_SIZE); strArr[strArr.Length / 2] = null; - Assert.IsTrue(CStyle_Array_LPSTR_InOut(strArr, ARRAY_SIZE), "CStyle_Array_LPSTR_InOut"); + Assert.True(CStyle_Array_LPSTR_InOut(strArr, ARRAY_SIZE)); string[] expectedArr = GetExpectedOutArray(ARRAY_SIZE); // Test nesting null value scenario expectedArr[expectedArr.Length / 2 - 1] = null; - Assert.IsTrue(Equals(strArr, expectedArr), "CStyle_Array_LPSTR_InOut:Equals"); + Assert.True(Equals(strArr, expectedArr)); Console.WriteLine("CStyle_Array_Struct_InOut"); TestStruct[] tsArr = InitStructArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Struct_InOut(tsArr, ARRAY_SIZE), "CStyle_Array_Struct_InOut"); - Assert.IsTrue(Equals(tsArr, GetExpectedOutStructArray(ARRAY_SIZE)), "CStyle_Array_Struct_InOut:Equals"); + Assert.True(CStyle_Array_Struct_InOut(tsArr, ARRAY_SIZE)); + Assert.True(Equals(tsArr, GetExpectedOutStructArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_Bool_InOut"); bool[] boolArr = InitBoolArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Bool_InOut(boolArr, ARRAY_SIZE), "CStyle_Array_Bool_InOut"); - Assert.IsTrue(Equals(boolArr, GetExpectedOutBoolArray(ARRAY_SIZE)), "CStyle_Array_Bool_InOut:Equals"); + Assert.True(CStyle_Array_Bool_InOut(boolArr, ARRAY_SIZE)); + Assert.True(Equals(boolArr, GetExpectedOutBoolArray(ARRAY_SIZE))); if (OperatingSystem.IsWindows()) { Console.WriteLine("CStyle_Array_Object_InOut"); object[] oArr = InitArray(ARRAY_SIZE); oArr[oArr.Length / 2] = null; - Assert.IsTrue(CStyle_Array_Object_InOut(oArr, ARRAY_SIZE), "CStyle_Array_Object_InOut"); + Assert.True(CStyle_Array_Object_InOut(oArr, ARRAY_SIZE)); object[] expectedOArr = GetExpectedOutArray(ARRAY_SIZE); // Test nesting null value scenario expectedOArr[expectedOArr.Length / 2 - 1] = null; - Assert.IsTrue(Equals(oArr, expectedOArr), "CStyle_Array_Object_InOut:Equals"); + Assert.True(Equals(oArr, expectedOArr)); } } @@ -549,91 +549,91 @@ private static void TestMarshalOut_ByVal() Console.WriteLine("CStyle_Array_Int_Out"); int[] iArr = new int[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Int_Out(iArr, ARRAY_SIZE), "CStyle_Array_Int_Out"); - Assert.IsTrue(Equals(iArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Int_Out:Equals"); + Assert.True(CStyle_Array_Int_Out(iArr, ARRAY_SIZE)); + Assert.True(Equals(iArr, GetExpectedOutArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_Int_Out_Null"); int[] iArrNull = null; - Assert.IsTrue(CStyle_Array_Int_Out_Null(iArrNull), "CStyle_Array_Int_Out_Null"); - Assert.IsNull(iArrNull, "CStyle_Array_Int_Out_Null:Equals"); + Assert.True(CStyle_Array_Int_Out_Null(iArrNull)); + Assert.Null(iArrNull); Console.WriteLine("CStyle_Array_Int_Out_ZeroLength"); int[] iArrLength0 = new int[0]; - Assert.IsTrue(CStyle_Array_Int_Out_ZeroLength(iArrLength0), "CStyle_Array_Int_Out_ZeroLength"); - Assert.AreEqual(0, iArrLength0.Length, "CStyle_Array_Int_Out_ZeroLength:Length"); + Assert.True(CStyle_Array_Int_Out_ZeroLength(iArrLength0)); + Assert.Equal(0, iArrLength0.Length); Console.WriteLine("CStyle_Array_Uint_Out"); uint[] uiArr = new uint[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Uint_Out(uiArr, ARRAY_SIZE), "CStyle_Array_Uint_Out"); - Assert.IsTrue(Equals(uiArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Uint_Out:Equals"); + Assert.True(CStyle_Array_Uint_Out(uiArr, ARRAY_SIZE)); + Assert.True(Equals(uiArr, GetExpectedOutArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_Short_Out"); short[] sArr = new short[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Short_Out(sArr, ARRAY_SIZE), "CStyle_Array_Short_Out"); - Assert.IsTrue(Equals(sArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Short_Out:Equals"); + Assert.True(CStyle_Array_Short_Out(sArr, ARRAY_SIZE)); + Assert.True(Equals(sArr, GetExpectedOutArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_Word_Out"); ushort[] usArr = new ushort[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Word_Out(usArr, ARRAY_SIZE), "CStyle_Array_Word_Out"); - Assert.IsTrue(Equals(usArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Word_Out:Equals"); + Assert.True(CStyle_Array_Word_Out(usArr, ARRAY_SIZE)); + Assert.True(Equals(usArr, GetExpectedOutArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_Long64_Out"); long[] lArr = new long[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Long64_Out(lArr, ARRAY_SIZE), "CStyle_Array_Long64_Out"); - Assert.IsTrue(Equals(lArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Long64_Out:Equals"); + Assert.True(CStyle_Array_Long64_Out(lArr, ARRAY_SIZE)); + Assert.True(Equals(lArr, GetExpectedOutArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_ULong64_Out"); ulong[] ulArr = new ulong[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_ULong64_Out(ulArr, ARRAY_SIZE), "CStyle_Array_ULong64_Out"); - Assert.IsTrue(Equals(ulArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_ULong64_Out:Equals"); + Assert.True(CStyle_Array_ULong64_Out(ulArr, ARRAY_SIZE)); + Assert.True(Equals(ulArr, GetExpectedOutArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_Double_Out"); double[] dArr = new double[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Double_Out(dArr, ARRAY_SIZE), "CStyle_Array_Double_Out"); - Assert.IsTrue(Equals(dArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Double_Out:Equals"); + Assert.True(CStyle_Array_Double_Out(dArr, ARRAY_SIZE)); + Assert.True(Equals(dArr, GetExpectedOutArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_Float_Out"); float[] fArr = new float[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Float_Out(fArr, ARRAY_SIZE), "CStyle_Array_Float_Out"); - Assert.IsTrue(Equals(fArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Float_Out:Equals"); + Assert.True(CStyle_Array_Float_Out(fArr, ARRAY_SIZE)); + Assert.True(Equals(fArr, GetExpectedOutArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_Byte_Out"); byte[] bArr = new byte[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Byte_Out(bArr, ARRAY_SIZE), "CStyle_Array_Byte_Out"); - Assert.IsTrue(Equals(bArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Byte_Out:Equals"); + Assert.True(CStyle_Array_Byte_Out(bArr, ARRAY_SIZE)); + Assert.True(Equals(bArr, GetExpectedOutArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_Char_Out"); char[] cArr = new char[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Char_Out(cArr, ARRAY_SIZE), "CStyle_Array_Char_Out"); - Assert.IsTrue(Equals(cArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Char_Out:Equals"); + Assert.True(CStyle_Array_Char_Out(cArr, ARRAY_SIZE)); + Assert.True(Equals(cArr, GetExpectedOutArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_LPSTR_Out"); string[] strArr = new string[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_LPSTR_Out(strArr, ARRAY_SIZE), "CStyle_Array_LPSTR_Out"); + Assert.True(CStyle_Array_LPSTR_Out(strArr, ARRAY_SIZE)); string[] expectedArr = GetExpectedOutArray(ARRAY_SIZE); // Test nesting null value scenario expectedArr[expectedArr.Length / 2 - 1] = null; - Assert.IsTrue(Equals(strArr, expectedArr), "CStyle_Array_LPSTR_Out:Equals"); + Assert.True(Equals(strArr, expectedArr)); Console.WriteLine("CStyle_Array_Struct_Out"); TestStruct[] tsArr = new TestStruct[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Struct_Out(tsArr, ARRAY_SIZE), "CStyle_Array_Struct_Out"); - Assert.IsTrue(Equals(tsArr, GetExpectedOutStructArray(ARRAY_SIZE)), "Equals"); + Assert.True(CStyle_Array_Struct_Out(tsArr, ARRAY_SIZE)); + Assert.True(Equals(tsArr, GetExpectedOutStructArray(ARRAY_SIZE))); Console.WriteLine("CStyle_Array_Bool_Out"); bool[] boolArr = new bool[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Bool_Out(boolArr, ARRAY_SIZE), "CStyle_Array_Bool_Out"); - Assert.IsTrue(Equals(boolArr, GetExpectedOutBoolArray(ARRAY_SIZE)), "CStyle_Array_Bool_Out:Equals"); + Assert.True(CStyle_Array_Bool_Out(boolArr, ARRAY_SIZE)); + Assert.True(Equals(boolArr, GetExpectedOutBoolArray(ARRAY_SIZE))); if (OperatingSystem.IsWindows()) { Console.WriteLine("CStyle_Array_Object_Out"); object[] oArr = new object[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Object_Out(oArr, ARRAY_SIZE), "CStyle_Array_Object_Out"); + Assert.True(CStyle_Array_Object_Out(oArr, ARRAY_SIZE)); object[] expectedOArr = GetExpectedOutArray(ARRAY_SIZE); // Test nesting null value scenario expectedOArr[expectedOArr.Length / 2 - 1] = null; - Assert.IsTrue(Equals(oArr, expectedOArr), "CStyle_Array_Object_Out:Equals"); + Assert.True(Equals(oArr, expectedOArr)); } } @@ -649,7 +649,7 @@ private static void TestMultidimensional() sum += item; } - Assert.AreEqual(sum, Get_Multidimensional_Array_Sum(array, ROWS, COLUMNS)); + Assert.Equal(sum, Get_Multidimensional_Array_Sum(array, ROWS, COLUMNS)); } public static int Main() @@ -661,7 +661,7 @@ public static int Main() TestMarshalInOut_ByVal(); TestMarshalOut_ByVal(); TestMultidimensional(); - + Console.WriteLine("\nTest PASS."); return 100; } diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.cs b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.cs index b152744d89cbe0..899f15f9b6eb0e 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.cs +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/AsLPArray/AsLPArrayTest.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; public class ArrayMarshal { @@ -77,7 +77,7 @@ public struct S2 [DllImport("MarshalArrayLPArrayNative")] private static extern bool CStyle_Array_Bool([MarshalAs(UnmanagedType.LPArray)] bool[] actual, int cActual); - + [DllImport("MarshalArrayLPArrayNative")] private static extern bool MarshalArrayOfStructAsLPArrayByVal([MarshalAs(UnmanagedType.LPArray, SizeConst = ARRAY_SIZE)] S2[] arrS2, int cActual, [In, MarshalAs(UnmanagedType.LPArray, SizeConst = ARRAY_SIZE)]S2[] pExpect); @@ -129,7 +129,7 @@ private static extern bool CStyle_Array_Object_In( [DllImport("MarshalArrayLPArrayNative", EntryPoint = "CStyle_Array_Bool")] private static extern bool CStyle_Array_Bool_In([In, MarshalAs(UnmanagedType.LPArray)] bool[] actual, int cActual); - + [DllImport("MarshalArrayLPArrayNative", EntryPoint = "MarshalArrayOfStructAsLPArrayByVal")] private static extern bool MarshalArrayOfStructAsLPArrayByValIn([In, MarshalAs(UnmanagedType.LPArray, SizeConst = ARRAY_SIZE)] S2[] arrS2, int cActual, [In, MarshalAs(UnmanagedType.LPArray, SizeConst = ARRAY_SIZE)]S2[] pExpect); @@ -195,7 +195,7 @@ private static extern bool CStyle_Array_Object_In( [DllImport("MarshalArrayLPArrayNative")] private static extern bool CStyle_Array_Int_Out_Null([Out, MarshalAs(UnmanagedType.LPArray)] int[] actual); - + [DllImport("MarshalArrayLPArrayNative")] private static extern bool CStyle_Array_Int_Out_ZeroLength([Out, MarshalAs(UnmanagedType.LPArray)] int[] actual); @@ -297,64 +297,64 @@ private static void TestMarshalByVal_NoAttributes() { Console.WriteLine("ByVal marshaling CLR array as c-style-array no attributes"); - Assert.IsTrue(CStyle_Array_Int(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Int"); - Assert.IsTrue(CStyle_Array_Uint(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Uint"); - Assert.IsTrue(CStyle_Array_Short(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Short"); - Assert.IsTrue(CStyle_Array_Word(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Word"); - Assert.IsTrue(CStyle_Array_Long64(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Long64"); - Assert.IsTrue(CStyle_Array_ULong64(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_ULong64"); - Assert.IsTrue(CStyle_Array_Double(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Double"); - Assert.IsTrue(CStyle_Array_Float(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Float"); - Assert.IsTrue(CStyle_Array_Byte(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Byte"); - Assert.IsTrue(CStyle_Array_Char(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Char"); + Assert.True(CStyle_Array_Int(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Uint(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Short(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Word(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Long64(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_ULong64(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Double(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Float(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Byte(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Char(InitArray(ARRAY_SIZE), ARRAY_SIZE)); string[] strArr = InitArray(ARRAY_SIZE); // Test nesting null value scenario strArr[strArr.Length / 2] = null; - Assert.IsTrue(CStyle_Array_LPCSTR(strArr, ARRAY_SIZE), "CStyle_Array_LPCSTR"); - Assert.IsTrue(CStyle_Array_LPSTR(strArr, ARRAY_SIZE), "CStyle_Array_LPSTRs"); - Assert.IsTrue(CStyle_Array_Struct(InitStructArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Struct"); - Assert.IsTrue(CStyle_Array_Bool(InitBoolArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Bool"); + Assert.True(CStyle_Array_LPCSTR(strArr, ARRAY_SIZE)); + Assert.True(CStyle_Array_LPSTR(strArr, ARRAY_SIZE)); + Assert.True(CStyle_Array_Struct(InitStructArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Bool(InitBoolArray(ARRAY_SIZE), ARRAY_SIZE)); if (OperatingSystem.IsWindows()) { object[] oArr = InitArray(ARRAY_SIZE); // Test nesting null value scenario oArr[oArr.Length / 2] = null; - Assert.IsTrue(CStyle_Array_Object(oArr, ARRAY_SIZE), "CStyle_Array_Object"); - } - + Assert.True(CStyle_Array_Object(oArr, ARRAY_SIZE)); + } + } private static void TestMarshalByVal_In() { Console.WriteLine("ByVal marshaling CLR array as c-style-array with InAttribute applied"); - Assert.IsTrue(CStyle_Array_Int_In(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Int_In"); - Assert.IsTrue(CStyle_Array_Uint_In(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Uint_In"); - Assert.IsTrue(CStyle_Array_Short_In(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Short_In"); - Assert.IsTrue(CStyle_Array_Word_In(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Word_In"); - Assert.IsTrue(CStyle_Array_Long64_In(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Long64_In"); - Assert.IsTrue(CStyle_Array_ULong64_In(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_ULong64_In"); - Assert.IsTrue(CStyle_Array_Double_In(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Double_In"); - Assert.IsTrue(CStyle_Array_Float_In(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Float_In"); - Assert.IsTrue(CStyle_Array_Byte_In(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Byte_In"); - Assert.IsTrue(CStyle_Array_Char_In(InitArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Char_In"); + Assert.True(CStyle_Array_Int_In(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Uint_In(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Short_In(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Word_In(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Long64_In(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_ULong64_In(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Double_In(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Float_In(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Byte_In(InitArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Char_In(InitArray(ARRAY_SIZE), ARRAY_SIZE)); string[] strArr = InitArray(ARRAY_SIZE); // Test nesting null value scenario strArr[strArr.Length / 2] = null; - Assert.IsTrue(CStyle_Array_LPCSTR_In(strArr, ARRAY_SIZE), "CStyle_Array_LPCSTR_In"); - Assert.IsTrue(CStyle_Array_LPSTR_In(strArr, ARRAY_SIZE), "CStyle_Array_LPSTR_In"); - Assert.IsTrue(CStyle_Array_Struct_In(InitStructArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Struct_In"); - Assert.IsTrue(CStyle_Array_Bool_In(InitBoolArray(ARRAY_SIZE), ARRAY_SIZE), "CStyle_Array_Bool_In"); + Assert.True(CStyle_Array_LPCSTR_In(strArr, ARRAY_SIZE)); + Assert.True(CStyle_Array_LPSTR_In(strArr, ARRAY_SIZE)); + Assert.True(CStyle_Array_Struct_In(InitStructArray(ARRAY_SIZE), ARRAY_SIZE)); + Assert.True(CStyle_Array_Bool_In(InitBoolArray(ARRAY_SIZE), ARRAY_SIZE)); if (OperatingSystem.IsWindows()) { object[] oArr = InitArray(ARRAY_SIZE); // Test nesting null value scenario oArr[oArr.Length / 2] = null; - Assert.IsTrue(CStyle_Array_Object_In(oArr, ARRAY_SIZE), "CStyle_Array_Object_In"); + Assert.True(CStyle_Array_Object_In(oArr, ARRAY_SIZE)); } } #endregion @@ -364,69 +364,69 @@ private static void TestMarshalByVal_InOut() { Console.WriteLine("By value marshaling CLR array as c-style-array with InAttribute and OutAttribute applied"); int[] iArr = InitArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Int_InOut(iArr, ARRAY_SIZE), "CStyle_Array_Int_InOut"); - Assert.IsTrue(Equals(iArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Int_InOut:Equals"); + Assert.True(CStyle_Array_Int_InOut(iArr, ARRAY_SIZE)); + Assert.True(Equals(iArr, GetExpectedOutArray(ARRAY_SIZE))); int[] iArrNull = null; - Assert.IsTrue(CStyle_Array_Int_InOut_Null(iArrNull), "CStyle_Array_Int_InOut_Null"); - Assert.IsNull(iArrNull, "CStyle_Array_Int_InOut_Null:Equals"); + Assert.True(CStyle_Array_Int_InOut_Null(iArrNull)); + Assert.Null(iArrNull); int[] iArrLength0 = InitArray(0); - Assert.IsTrue(CStyle_Array_Int_InOut_ZeroLength(iArrLength0), "CStyle_Array_Int_InOut_ZeroLength"); - Assert.AreEqual(0, iArrLength0.Length, "CStyle_Array_Int_InOut_ZeroLength:Length"); + Assert.True(CStyle_Array_Int_InOut_ZeroLength(iArrLength0)); + Assert.Equal(0, iArrLength0.Length); uint[] uiArr = InitArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Uint_InOut(uiArr, ARRAY_SIZE), "CStyle_Array_Uint_InOut"); - Assert.IsTrue(Equals(uiArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Uint_InOut:Equals"); + Assert.True(CStyle_Array_Uint_InOut(uiArr, ARRAY_SIZE)); + Assert.True(Equals(uiArr, GetExpectedOutArray(ARRAY_SIZE))); short[] sArr = InitArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Short_InOut(sArr, ARRAY_SIZE), "CStyle_Array_Short_InOut"); - Assert.IsTrue(Equals(sArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Short_InOut:Equals"); + Assert.True(CStyle_Array_Short_InOut(sArr, ARRAY_SIZE)); + Assert.True(Equals(sArr, GetExpectedOutArray(ARRAY_SIZE))); ushort[] usArr = InitArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Word_InOut(usArr, ARRAY_SIZE), "CStyle_Array_Word_InOut"); - Assert.IsTrue(Equals(usArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Word_InOut:Equals"); + Assert.True(CStyle_Array_Word_InOut(usArr, ARRAY_SIZE)); + Assert.True(Equals(usArr, GetExpectedOutArray(ARRAY_SIZE))); long[] lArr = InitArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Long64_InOut(lArr, ARRAY_SIZE), "CStyle_Array_Long64_InOut"); - Assert.IsTrue(Equals(lArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Long64_InOut:Equals"); + Assert.True(CStyle_Array_Long64_InOut(lArr, ARRAY_SIZE)); + Assert.True(Equals(lArr, GetExpectedOutArray(ARRAY_SIZE))); ulong[] ulArr = InitArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_ULong64_InOut(ulArr, ARRAY_SIZE), "CStyle_Array_ULong64_InOut"); - Assert.IsTrue(Equals(ulArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_ULong64_InOut:Equals"); + Assert.True(CStyle_Array_ULong64_InOut(ulArr, ARRAY_SIZE)); + Assert.True(Equals(ulArr, GetExpectedOutArray(ARRAY_SIZE))); double[] dArr = InitArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Double_InOut(dArr, ARRAY_SIZE), "CStyle_Array_Double_InOut"); - Assert.IsTrue(Equals(dArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Double_InOut:Equals"); + Assert.True(CStyle_Array_Double_InOut(dArr, ARRAY_SIZE)); + Assert.True(Equals(dArr, GetExpectedOutArray(ARRAY_SIZE))); float[] fArr = InitArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Float_InOut(fArr, ARRAY_SIZE), "CStyle_Array_Float_InOut"); - Assert.IsTrue(Equals(fArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Float_InOut:Equals"); + Assert.True(CStyle_Array_Float_InOut(fArr, ARRAY_SIZE)); + Assert.True(Equals(fArr, GetExpectedOutArray(ARRAY_SIZE))); byte[] bArr = InitArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Byte_InOut(bArr, ARRAY_SIZE), "CStyle_Array_Byte_InOut"); - Assert.IsTrue(Equals(bArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Byte_InOut:Equals"); + Assert.True(CStyle_Array_Byte_InOut(bArr, ARRAY_SIZE)); + Assert.True(Equals(bArr, GetExpectedOutArray(ARRAY_SIZE))); char[] cArr = InitArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Char_InOut(cArr, ARRAY_SIZE), "CStyle_Array_Char_InOut"); - Assert.IsTrue(Equals(cArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Char_InOut:Equals"); + Assert.True(CStyle_Array_Char_InOut(cArr, ARRAY_SIZE)); + Assert.True(Equals(cArr, GetExpectedOutArray(ARRAY_SIZE))); string[] strArr = InitArray(ARRAY_SIZE); strArr[strArr.Length / 2] = null; - Assert.IsTrue(CStyle_Array_LPSTR_InOut(strArr, ARRAY_SIZE), "CStyle_Array_LPSTR_InOut"); + Assert.True(CStyle_Array_LPSTR_InOut(strArr, ARRAY_SIZE)); string[] expectedArr = GetExpectedOutArray(ARRAY_SIZE); // Test nesting null value scenario expectedArr[expectedArr.Length / 2 - 1] = null; - Assert.IsTrue(Equals(strArr, expectedArr), "CStyle_Array_LPSTR_InOut:Equals"); + Assert.True(Equals(strArr, expectedArr)); TestStruct[] tsArr = InitStructArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Struct_InOut(tsArr, ARRAY_SIZE), "CStyle_Array_Struct_InOut"); - Assert.IsTrue(Equals(tsArr, GetExpectedOutStructArray(ARRAY_SIZE)), "CStyle_Array_Struct_InOut:Equals"); + Assert.True(CStyle_Array_Struct_InOut(tsArr, ARRAY_SIZE)); + Assert.True(Equals(tsArr, GetExpectedOutStructArray(ARRAY_SIZE))); bool[] boolArr = InitBoolArray(ARRAY_SIZE); - Assert.IsTrue(CStyle_Array_Bool_InOut(boolArr, ARRAY_SIZE), "CStyle_Array_Bool_InOut"); - Assert.IsTrue(Equals(boolArr, GetExpectedOutBoolArray(ARRAY_SIZE)), "CStyle_Array_Bool_InOut:Equals"); + Assert.True(CStyle_Array_Bool_InOut(boolArr, ARRAY_SIZE)); + Assert.True(Equals(boolArr, GetExpectedOutBoolArray(ARRAY_SIZE))); } private static bool Equals(T[] arr1, T[] arr2) @@ -493,77 +493,77 @@ private static void TestMarshalByVal_Out() Console.WriteLine("By value marshaling CLR array as c-style-array with OutAttribute applied"); int[] iArr = new int[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Int_Out(iArr, ARRAY_SIZE), "CStyle_Array_Int_Out"); - Assert.IsTrue(Equals(iArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Int_Out:Equals"); + Assert.True(CStyle_Array_Int_Out(iArr, ARRAY_SIZE)); + Assert.True(Equals(iArr, GetExpectedOutArray(ARRAY_SIZE))); int[] iArrNull = null; - Assert.IsTrue(CStyle_Array_Int_Out_Null(iArrNull), "CStyle_Array_Int_Out_Null"); - Assert.IsNull(iArrNull, "CStyle_Array_Int_Out_Null:Equals"); + Assert.True(CStyle_Array_Int_Out_Null(iArrNull)); + Assert.Null(iArrNull); int[] iArrLength0 = new int[0]; - Assert.IsTrue(CStyle_Array_Int_Out_ZeroLength(iArrLength0), "CStyle_Array_Int_Out_ZeroLength"); - Assert.AreEqual(0, iArrLength0.Length, "CStyle_Array_Int_Out_ZeroLength:Length"); + Assert.True(CStyle_Array_Int_Out_ZeroLength(iArrLength0)); + Assert.Equal(0, iArrLength0.Length); uint[] uiArr = new uint[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Uint_Out(uiArr, ARRAY_SIZE), "CStyle_Array_Uint_Out"); - Assert.IsTrue(Equals(uiArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Uint_Out:Equals"); + Assert.True(CStyle_Array_Uint_Out(uiArr, ARRAY_SIZE)); + Assert.True(Equals(uiArr, GetExpectedOutArray(ARRAY_SIZE))); short[] sArr = new short[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Short_Out(sArr, ARRAY_SIZE), "CStyle_Array_Short_Out"); - Assert.IsTrue(Equals(sArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Short_Out:Equals"); + Assert.True(CStyle_Array_Short_Out(sArr, ARRAY_SIZE)); + Assert.True(Equals(sArr, GetExpectedOutArray(ARRAY_SIZE))); ushort[] usArr = new ushort[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Word_Out(usArr, ARRAY_SIZE), "CStyle_Array_Word_Out"); - Assert.IsTrue(Equals(usArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Word_Out:Equals"); + Assert.True(CStyle_Array_Word_Out(usArr, ARRAY_SIZE)); + Assert.True(Equals(usArr, GetExpectedOutArray(ARRAY_SIZE))); long[] lArr = new long[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Long64_Out(lArr, ARRAY_SIZE), "CStyle_Array_Long64_Out"); - Assert.IsTrue(Equals(lArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Long64_Out:Equals"); + Assert.True(CStyle_Array_Long64_Out(lArr, ARRAY_SIZE)); + Assert.True(Equals(lArr, GetExpectedOutArray(ARRAY_SIZE))); ulong[] ulArr = new ulong[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_ULong64_Out(ulArr, ARRAY_SIZE), "CStyle_Array_ULong64_Out"); - Assert.IsTrue(Equals(ulArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_ULong64_Out:Equals"); + Assert.True(CStyle_Array_ULong64_Out(ulArr, ARRAY_SIZE)); + Assert.True(Equals(ulArr, GetExpectedOutArray(ARRAY_SIZE))); double[] dArr = new double[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Double_Out(dArr, ARRAY_SIZE), "CStyle_Array_Double_Out"); - Assert.IsTrue(Equals(dArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Double_Out:Equals"); + Assert.True(CStyle_Array_Double_Out(dArr, ARRAY_SIZE)); + Assert.True(Equals(dArr, GetExpectedOutArray(ARRAY_SIZE))); float[] fArr = new float[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Float_Out(fArr, ARRAY_SIZE), "CStyle_Array_Float_Out"); - Assert.IsTrue(Equals(fArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Float_Out:Equals"); + Assert.True(CStyle_Array_Float_Out(fArr, ARRAY_SIZE)); + Assert.True(Equals(fArr, GetExpectedOutArray(ARRAY_SIZE))); byte[] bArr = new byte[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Byte_Out(bArr, ARRAY_SIZE), "CStyle_Array_Byte_Out"); - Assert.IsTrue(Equals(bArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Byte_Out:Equals"); + Assert.True(CStyle_Array_Byte_Out(bArr, ARRAY_SIZE)); + Assert.True(Equals(bArr, GetExpectedOutArray(ARRAY_SIZE))); char[] cArr = new char[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Char_Out(cArr, ARRAY_SIZE), "CStyle_Array_Char_Out"); - Assert.IsTrue(Equals(cArr, GetExpectedOutArray(ARRAY_SIZE)), "CStyle_Array_Char_Out:Equals"); + Assert.True(CStyle_Array_Char_Out(cArr, ARRAY_SIZE)); + Assert.True(Equals(cArr, GetExpectedOutArray(ARRAY_SIZE))); string[] strArr = new string[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_LPSTR_Out(strArr, ARRAY_SIZE), "CStyle_Array_LPSTR_Out"); + Assert.True(CStyle_Array_LPSTR_Out(strArr, ARRAY_SIZE)); string[] expectedArr = GetExpectedOutArray(ARRAY_SIZE); // Test nesting null value scenario expectedArr[expectedArr.Length / 2 - 1] = null; - Assert.IsTrue(Equals(strArr, expectedArr), "CStyle_Array_LPSTR_Out:Equals"); + Assert.True(Equals(strArr, expectedArr)); TestStruct[] tsArr = new TestStruct[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Struct_Out(tsArr, ARRAY_SIZE), "CStyle_Array_Struct_Out"); - Assert.IsTrue(Equals(tsArr, GetExpectedOutStructArray(ARRAY_SIZE)), "CStyle_Array_Struct_Out:Equals"); + Assert.True(CStyle_Array_Struct_Out(tsArr, ARRAY_SIZE)); + Assert.True(Equals(tsArr, GetExpectedOutStructArray(ARRAY_SIZE))); bool[] boolArr = new bool[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Bool_Out(boolArr, ARRAY_SIZE), "CStyle_Array_Bool_Out"); - Assert.IsTrue(Equals(boolArr, GetExpectedOutBoolArray(ARRAY_SIZE)), "CStyle_Array_Bool_Out:Equals"); - + Assert.True(CStyle_Array_Bool_Out(boolArr, ARRAY_SIZE)); + Assert.True(Equals(boolArr, GetExpectedOutBoolArray(ARRAY_SIZE))); + if (OperatingSystem.IsWindows()) { object[] oArr = new object[ARRAY_SIZE]; - Assert.IsTrue(CStyle_Array_Object_Out(oArr, ARRAY_SIZE), "CStyle_Array_Object_Out"); + Assert.True(CStyle_Array_Object_Out(oArr, ARRAY_SIZE)); object[] expectedOArr = GetExpectedOutArray(ARRAY_SIZE); // Test nesting null value scenario expectedOArr[expectedOArr.Length / 2 - 1] = null; - Assert.IsTrue(Equals(oArr, expectedOArr), "CStyle_Array_Object_Out:Equals"); + Assert.True(Equals(oArr, expectedOArr)); } } @@ -636,7 +636,7 @@ public static int Main() TestMarshalByVal_In(); TestMarshalByVal_InOut(); TestMarshalByVal_Out(); - + Console.WriteLine("\nTest PASS."); return 100; } diff --git a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/LPArrayNative/MarshalArrayLPArrayNative.cpp b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/LPArrayNative/MarshalArrayLPArrayNative.cpp index 3c98214341ab05..4493b5b671f180 100644 --- a/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/LPArrayNative/MarshalArrayLPArrayNative.cpp +++ b/src/tests/Interop/PInvoke/Array/MarshalArrayAsParam/LPArrayNative/MarshalArrayLPArrayNative.cpp @@ -45,7 +45,7 @@ extern "C" DLL_EXPORT BOOL CStyle_Array_Int(int *pActual, int cActual) { CHECK_PARAM_NOT_EMPTY(pActual); - INIT_EXPECTED(int, ARRAY_SIZE); + INIT_EXPECTED(int, ARRAY_LENGTH); return EQUALS(pActual, cActual, expected); } @@ -55,10 +55,10 @@ extern "C" DLL_EXPORT BOOL CStyle_Array_Object(VARIANT *pActual, int cActual) { CHECK_PARAM_NOT_EMPTY(pActual); - //VARIANT expected[ARRAY_SIZE]; - size_t nullIdx = ARRAY_SIZE / 2; + //VARIANT expected[ARRAY_LENGTH]; + size_t nullIdx = ARRAY_LENGTH / 2; - for (size_t i = 0; i < ARRAY_SIZE; ++i) + for (size_t i = 0; i < ARRAY_LENGTH; ++i) { //VariantInit(&expected[i]); if (i == nullIdx) @@ -89,7 +89,7 @@ extern "C" DLL_EXPORT BOOL CStyle_Array_Uint(UINT *pActual, int cActual) { CHECK_PARAM_NOT_EMPTY(pActual); - INIT_EXPECTED(UINT, ARRAY_SIZE); + INIT_EXPECTED(UINT, ARRAY_LENGTH); return EQUALS(pActual, cActual, expected); } @@ -98,7 +98,7 @@ extern "C" DLL_EXPORT BOOL CStyle_Array_Short(SHORT *pActual, int cActual) { CHECK_PARAM_NOT_EMPTY(pActual); - INIT_EXPECTED(SHORT, ARRAY_SIZE); + INIT_EXPECTED(SHORT, ARRAY_LENGTH); return EQUALS(pActual, cActual, expected); } @@ -107,7 +107,7 @@ extern "C" DLL_EXPORT BOOL CStyle_Array_Word(WORD *pActual, int cActual) { CHECK_PARAM_NOT_EMPTY(pActual); - INIT_EXPECTED(WORD, ARRAY_SIZE); + INIT_EXPECTED(WORD, ARRAY_LENGTH); return EQUALS(pActual, cActual, expected); } @@ -116,7 +116,7 @@ extern "C" DLL_EXPORT BOOL CStyle_Array_Long64(LONG64 *pActual, int cActual) { CHECK_PARAM_NOT_EMPTY(pActual); - INIT_EXPECTED(LONG64, ARRAY_SIZE); + INIT_EXPECTED(LONG64, ARRAY_LENGTH); return EQUALS(pActual, cActual, expected); } @@ -125,7 +125,7 @@ extern "C" DLL_EXPORT BOOL CStyle_Array_ULong64(ULONG64 *pActual, int cActual) { CHECK_PARAM_NOT_EMPTY(pActual); - INIT_EXPECTED(ULONG64, ARRAY_SIZE); + INIT_EXPECTED(ULONG64, ARRAY_LENGTH); return EQUALS(pActual, cActual, expected); } @@ -134,7 +134,7 @@ extern "C" DLL_EXPORT BOOL CStyle_Array_Double(DOUBLE *pActual, int cActual) { CHECK_PARAM_NOT_EMPTY(pActual); - INIT_EXPECTED(DOUBLE, ARRAY_SIZE); + INIT_EXPECTED(DOUBLE, ARRAY_LENGTH); return EQUALS(pActual, cActual, expected); } @@ -143,7 +143,7 @@ extern "C" DLL_EXPORT BOOL CStyle_Array_Float(FLOAT *pActual, int cActual) { CHECK_PARAM_NOT_EMPTY(pActual); - INIT_EXPECTED(FLOAT, ARRAY_SIZE); + INIT_EXPECTED(FLOAT, ARRAY_LENGTH); return EQUALS(pActual, cActual, expected); } @@ -152,7 +152,7 @@ extern "C" DLL_EXPORT BOOL CStyle_Array_Byte(BYTE *pActual, int cActual) { CHECK_PARAM_NOT_EMPTY(pActual); - INIT_EXPECTED(BYTE, ARRAY_SIZE); + INIT_EXPECTED(BYTE, ARRAY_LENGTH); return EQUALS(pActual, cActual, expected); } @@ -161,7 +161,7 @@ extern "C" DLL_EXPORT BOOL CStyle_Array_Char(CHAR *pActual, int cActual) { CHECK_PARAM_NOT_EMPTY(pActual); - INIT_EXPECTED(CHAR, ARRAY_SIZE); + INIT_EXPECTED(CHAR, ARRAY_LENGTH); return EQUALS(pActual, cActual, expected); } @@ -170,9 +170,9 @@ extern "C" DLL_EXPORT BOOL CStyle_Array_LPCSTR(LPCSTR *pActual, int cActual) { CHECK_PARAM_NOT_EMPTY(pActual); - LPSTR expected[ARRAY_SIZE]; - size_t nullIdx = ARRAY_SIZE / 2; - for (size_t i = 0; i < ARRAY_SIZE; ++i) + LPSTR expected[ARRAY_LENGTH]; + size_t nullIdx = ARRAY_LENGTH / 2; + for (size_t i = 0; i < ARRAY_LENGTH; ++i) { if (i == nullIdx) { @@ -184,7 +184,7 @@ extern "C" DLL_EXPORT BOOL CStyle_Array_LPCSTR(LPCSTR *pActual, int cActual) int retval = EQUALS((LPSTR *)pActual, cActual, expected); - for (size_t i = 0; i < ARRAY_SIZE; ++i) + for (size_t i = 0; i < ARRAY_LENGTH; ++i) { if (i == nullIdx) continue; @@ -206,8 +206,8 @@ extern "C" DLL_EXPORT BOOL CStyle_Array_Struct(TestStruct *pActual, int cActual) { CHECK_PARAM_NOT_EMPTY(pActual); - TestStruct expected[ARRAY_SIZE]; - for (size_t i = 0; i < ARRAY_SIZE; ++i) + TestStruct expected[ARRAY_LENGTH]; + for (size_t i = 0; i < ARRAY_LENGTH; ++i) { expected[i].x = (int)i; expected[i].d = (int)i; @@ -222,8 +222,8 @@ extern "C" DLL_EXPORT BOOL CStyle_Array_Bool(BOOL *pActual, int cActual) { CHECK_PARAM_NOT_EMPTY(pActual); - BOOL expected[ARRAY_SIZE]; - for (size_t i = 0; i < ARRAY_SIZE; ++i) + BOOL expected[ARRAY_LENGTH]; + for (size_t i = 0; i < ARRAY_LENGTH; ++i) { if (i % 2 == 0) expected[i] = TRUE; diff --git a/src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.cs b/src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.cs index 56c7a61d5b77aa..a2096d4755c3be 100644 --- a/src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.cs +++ b/src/tests/Interop/PInvoke/ArrayWithOffset/ArrayWithOffsetTest.cs @@ -4,7 +4,7 @@ using System; using System.Text; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe class ArrayWithOffsetTest { @@ -23,17 +23,17 @@ public static int Main() fixed (int* expectedSubArray = expected.Slice(i)) fixed (int* newValueSubArray = newValue.Slice(i)) { - Assert.IsTrue(ArrayWithOffsetNative.Marshal_InOut(expectedSubArray, offset, expected.Length - i, newValueSubArray), $"Native call failed with element offset {i}."); + Assert.True(ArrayWithOffsetNative.Marshal_InOut(expectedSubArray, offset, expected.Length - i, newValueSubArray), $"Native call failed with element offset {i}."); } for (int j = 0; j < i; j++) { - Assert.AreEqual(expected[j], array[j]); + Assert.Equal(expected[j], array[j]); } for (int j = i; j < array.Length; j++) { - Assert.AreEqual(newValue[j], array[j]); + Assert.Equal(newValue[j], array[j]); } } diff --git a/src/tests/Interop/PInvoke/AsAny/AsAnyTest.cs b/src/tests/Interop/PInvoke/AsAny/AsAnyTest.cs index 71c26a8b344936..d4f4925ba1ccfb 100644 --- a/src/tests/Interop/PInvoke/AsAny/AsAnyTest.cs +++ b/src/tests/Interop/PInvoke/AsAny/AsAnyTest.cs @@ -6,7 +6,7 @@ using System.Text; using System.Runtime.InteropServices; using System.Reflection; -using TestLibrary; +using Xunit; #pragma warning disable CS0612, CS0618 @@ -31,7 +31,7 @@ class AsAnyTests private static readonly string MappableString = "" + NormalChar1 + mappableChar + NormalChar2; private static readonly string UnmappableString = "" + NormalChar1 + unmappableChar + NormalChar2; - + [DllImport("AsAnyNative")] public static extern bool PassArraySbyte( [MarshalAs(UnmanagedType.AsAny)] object sbyteArray, @@ -41,7 +41,7 @@ public static extern bool PassArraySbyte( sbyte[] expected, int len ); - + [DllImport("AsAnyNative")] public static extern bool PassArrayByte( [MarshalAs(UnmanagedType.AsAny)] object byteArray, @@ -172,12 +172,12 @@ public static extern bool PassArrayUIntPtr( UIntPtr[] expected, int len ); - + [DllImport("AsAnyNative")] public static extern long PassLayout( [MarshalAs(UnmanagedType.AsAny)] Object i); - [DllImport("AsAnyNative", EntryPoint = "PassUnicodeStr", CharSet = CharSet.Unicode, + [DllImport("AsAnyNative", EntryPoint = "PassUnicodeStr", CharSet = CharSet.Unicode, BestFitMapping = true, ThrowOnUnmappableChar = true)] public static extern bool PassUnicodeStrTT( [MarshalAs(UnmanagedType.AsAny)] @@ -191,7 +191,7 @@ public static extern bool PassUnicodeStrFT( [DllImport("AsAnyNative", EntryPoint = "PassUnicodeStr", CharSet = CharSet.Unicode, BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool PassUnicodeStrFF( + public static extern bool PassUnicodeStrFF( [MarshalAs(UnmanagedType.AsAny)] Object i); @@ -367,9 +367,9 @@ private static void TestAnsiStringArrayBestFitMapping() CharArrayInit(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out, mappableCharArray_In, mappableCharArray_InOut, mappableCharArray_Out, UnmappableString, MappableString); - Assert.IsTrue(PassAnsiCharArrayTT(mappableCharArray_In, mappableCharArray_InOut, mappableCharArray_Out, false)); - Assert.AreAllEqual(mappableAnsiStr_back.ToCharArray(), mappableCharArray_InOut); - Assert.AreAllEqual(mappableAnsiStr_back.ToCharArray(), mappableCharArray_Out); + Assert.True(PassAnsiCharArrayTT(mappableCharArray_In, mappableCharArray_InOut, mappableCharArray_Out, false)); + AssertExtensions.CollectionEqual(mappableAnsiStr_back.ToCharArray(), mappableCharArray_InOut); + AssertExtensions.CollectionEqual(mappableAnsiStr_back.ToCharArray(), mappableCharArray_Out); CharArrayInit(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out, mappableCharArray_In, mappableCharArray_InOut, mappableCharArray_Out, UnmappableString, MappableString); @@ -381,9 +381,9 @@ private static void TestAnsiStringArrayBestFitMapping() CharArrayInit(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out, mappableCharArray_In, mappableCharArray_InOut, mappableCharArray_Out, UnmappableString, MappableString); - Assert.IsTrue(PassAnsiCharArrayFF(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out, true)); - Assert.AreAllEqual(unMappableAnsiStr_back.ToCharArray(), unMappableCharArray_InOut); - Assert.AreAllEqual(unMappableAnsiStr_back.ToCharArray(), unMappableCharArray_Out); + Assert.True(PassAnsiCharArrayFF(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out, true)); + AssertExtensions.CollectionEqual(unMappableAnsiStr_back.ToCharArray(), unMappableCharArray_InOut); + AssertExtensions.CollectionEqual(unMappableAnsiStr_back.ToCharArray(), unMappableCharArray_Out); } private static void TestUnicodeStringArray() @@ -399,21 +399,21 @@ private static void TestUnicodeStringArray() CharArrayInit(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out, mappableCharArray_In, mappableCharArray_InOut, mappableCharArray_Out, UnmappableString, MappableString); - Assert.IsTrue(PassUnicodeCharArrayTT(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out)); - Assert.AreAllEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_InOut); - Assert.AreAllEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_Out); + Assert.True(PassUnicodeCharArrayTT(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out)); + AssertExtensions.CollectionEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_InOut); + AssertExtensions.CollectionEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_Out); CharArrayInit(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out, mappableCharArray_In, mappableCharArray_InOut, mappableCharArray_Out, UnmappableString, MappableString); - Assert.IsTrue(PassUnicodeCharArrayFT(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out)); - Assert.AreAllEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_InOut); - Assert.AreAllEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_Out); + Assert.True(PassUnicodeCharArrayFT(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out)); + AssertExtensions.CollectionEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_InOut); + AssertExtensions.CollectionEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_Out); CharArrayInit(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out, mappableCharArray_In, mappableCharArray_InOut, mappableCharArray_Out, UnmappableString, MappableString); - Assert.IsTrue(PassUnicodeCharArrayFF(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out)); - Assert.AreAllEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_InOut); - Assert.AreAllEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_Out); + Assert.True(PassUnicodeCharArrayFF(unMappableCharArray_In, unMappableCharArray_InOut, unMappableCharArray_Out)); + AssertExtensions.CollectionEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_InOut); + AssertExtensions.CollectionEqual(unMappableUnicodeStr_back.ToCharArray(), unMappableCharArray_Out); } private static void TestAnsiStringBuilder() @@ -422,34 +422,34 @@ private static void TestAnsiStringBuilder() StringBuilder mappableStrbd = new StringBuilder(MappableString); Assert.Throws(() => PassAnsiStrbdTT(unMappableStrbd, true)); - Assert.IsTrue(PassAnsiStrbdTT(mappableStrbd, false)); + Assert.True(PassAnsiStrbdTT(mappableStrbd, false)); Assert.Throws(() => PassAnsiStrbdFT(unMappableStrbd, true)); Assert.Throws(() => PassAnsiStrbdFT(mappableStrbd, false)); - Assert.IsTrue(PassAnsiStrbdFF(unMappableStrbd, true)); + Assert.True(PassAnsiStrbdFF(unMappableStrbd, true)); } private static void TestUnicodeStringBuilder() { StringBuilder unMappableStrbd = new StringBuilder(UnmappableString); - Assert.IsTrue(PassUnicodeStrbdTT(unMappableStrbd)); - Assert.IsTrue(PassUnicodeStrbdFT(unMappableStrbd)); - Assert.IsTrue(PassUnicodeStrbdFF(unMappableStrbd)); + Assert.True(PassUnicodeStrbdTT(unMappableStrbd)); + Assert.True(PassUnicodeStrbdFT(unMappableStrbd)); + Assert.True(PassUnicodeStrbdFF(unMappableStrbd)); } private static void TestAnsiStringBestFitMapping() { Assert.Throws(() => PassAnsiStrTT(UnmappableString, true)); - Assert.IsTrue(PassAnsiStrTT(MappableString, false)); + Assert.True(PassAnsiStrTT(MappableString, false)); Assert.Throws(() => PassAnsiStrFT(UnmappableString, true)); Assert.Throws(() => PassAnsiStrFT(MappableString, false)); - Assert.IsTrue(PassAnsiStrFF(UnmappableString, true)); + Assert.True(PassAnsiStrFF(UnmappableString, true)); } private static void TestUnicodeString() { - Assert.IsTrue(PassUnicodeStrTT(UnmappableString)); - Assert.IsTrue(PassUnicodeStrFT(UnmappableString)); - Assert.IsTrue(PassUnicodeStrFF(UnmappableString)); + Assert.True(PassUnicodeStrTT(UnmappableString)); + Assert.True(PassUnicodeStrFT(UnmappableString)); + Assert.True(PassUnicodeStrFF(UnmappableString)); } private static void TestUIntPtrArray() @@ -461,9 +461,9 @@ private static void TestUIntPtrArray() UIntPtr[] uIntPtrArray_Out = new UIntPtr[] { new UIntPtr(0), new UIntPtr(1), new UIntPtr(2) }; UIntPtr[] uIntPtrArray_Back = new UIntPtr[] { new UIntPtr(10), new UIntPtr(11), new UIntPtr(12) }; UIntPtr[] expected = new UIntPtr[] { new UIntPtr(0), new UIntPtr(1), new UIntPtr(2) }; - Assert.IsTrue(PassArrayUIntPtr(uIntPtrArray, uIntPtrArray_In, uIntPtrArray_InOut, uIntPtrArray_Out, expected, 3)); - Assert.AreAllEqual(uIntPtrArray_Back, uIntPtrArray_InOut); - Assert.AreAllEqual(uIntPtrArray_Back, uIntPtrArray_Out); + Assert.True(PassArrayUIntPtr(uIntPtrArray, uIntPtrArray_In, uIntPtrArray_InOut, uIntPtrArray_Out, expected, 3)); + AssertExtensions.CollectionEqual(uIntPtrArray_Back, uIntPtrArray_InOut); + AssertExtensions.CollectionEqual(uIntPtrArray_Back, uIntPtrArray_Out); } private static void TestIntPtrArray() @@ -475,9 +475,9 @@ private static void TestIntPtrArray() IntPtr[] intPtrArray_Out = new IntPtr[] { new IntPtr(0), new IntPtr(1), new IntPtr(2) }; IntPtr[] intPtrArray_Back = new IntPtr[] { new IntPtr(10), new IntPtr(11), new IntPtr(12) }; IntPtr[] expected = new IntPtr[] { new IntPtr(0), new IntPtr(1), new IntPtr(2) }; - Assert.IsTrue(PassArrayIntPtr(intPtrArray, intPtrArray_In, intPtrArray_InOut, intPtrArray_Out, expected, 3)); - Assert.AreAllEqual(intPtrArray_Back, intPtrArray_InOut); - Assert.AreAllEqual(intPtrArray_Back, intPtrArray_Out); + Assert.True(PassArrayIntPtr(intPtrArray, intPtrArray_In, intPtrArray_InOut, intPtrArray_Out, expected, 3)); + AssertExtensions.CollectionEqual(intPtrArray_Back, intPtrArray_InOut); + AssertExtensions.CollectionEqual(intPtrArray_Back, intPtrArray_Out); } private static void TestBoolArray() @@ -488,9 +488,9 @@ private static void TestBoolArray() bool[] boolArray_InOut = new bool[] { true, false, false }; bool[] boolArray_Out = new bool[] { true, false, false }; bool[] boolArray_Back = new bool[] { false, true, true }; - Assert.IsTrue(PassArrayBool(boolArray, boolArray_In, boolArray_InOut, boolArray_Out, new bool[] { true, false, false }, 3)); - Assert.AreAllEqual(boolArray_Back, boolArray_InOut); - Assert.AreAllEqual(boolArray_Back, boolArray_Out); + Assert.True(PassArrayBool(boolArray, boolArray_In, boolArray_InOut, boolArray_Out, new bool[] { true, false, false }, 3)); + AssertExtensions.CollectionEqual(boolArray_Back, boolArray_InOut); + AssertExtensions.CollectionEqual(boolArray_Back, boolArray_Out); } private static void TestCharArray() @@ -501,9 +501,9 @@ private static void TestCharArray() char[] charArray_InOut = new char[] { 'a', 'b', 'c' }; char[] charArray_Out = new char[] { 'a', 'b', 'c' }; char[] charArray_Back = new char[] { 'd', 'e', 'f' }; - Assert.IsTrue(PassArrayChar(charArray, charArray_In, charArray_InOut, charArray_Out, new char[] { 'a', 'b', 'c' }, 3)); - Assert.AreAllEqual(charArray_Back, charArray_InOut); - Assert.AreAllEqual(charArray_Back, charArray_Out); + Assert.True(PassArrayChar(charArray, charArray_In, charArray_InOut, charArray_Out, new char[] { 'a', 'b', 'c' }, 3)); + AssertExtensions.CollectionEqual(charArray_Back, charArray_InOut); + AssertExtensions.CollectionEqual(charArray_Back, charArray_Out); } private static void TestDoubleArray() @@ -514,9 +514,9 @@ private static void TestDoubleArray() double[] doubleArray_InOut = new double[] { 0.0, 1.1, 2.2 }; double[] doubleArray_Out = new double[] { 0.0, 1.1, 2.2 }; double[] doubleArray_Back = new double[] { 10.0, 11.1, 12.2 }; - Assert.IsTrue(PassArrayDouble(doubleArray, doubleArray_In, doubleArray_InOut, doubleArray_Out, new double[] { 0.0, 1.1, 2.2 }, 3)); - Assert.AreAllEqual(doubleArray_Back, doubleArray_InOut); - Assert.AreAllEqual(doubleArray_Back, doubleArray_Out); + Assert.True(PassArrayDouble(doubleArray, doubleArray_In, doubleArray_InOut, doubleArray_Out, new double[] { 0.0, 1.1, 2.2 }, 3)); + AssertExtensions.CollectionEqual(doubleArray_Back, doubleArray_InOut); + AssertExtensions.CollectionEqual(doubleArray_Back, doubleArray_Out); } private static void TestSingleArray() @@ -527,9 +527,9 @@ private static void TestSingleArray() float[] singleArray_InOut = new float[] { 0, 1, 2 }; float[] singleArray_Out = new float[] { 0, 1, 2 }; float[] singleArray_Back = new float[] { 10, 11, 12 }; - Assert.IsTrue(PassArraySingle(singleArray, singleArray_In, singleArray_InOut, singleArray_Out, new float[] { 0, 1, 2 }, 3)); - Assert.AreAllEqual(singleArray_Back, singleArray_InOut); - Assert.AreAllEqual(singleArray_Back, singleArray_Out); + Assert.True(PassArraySingle(singleArray, singleArray_In, singleArray_InOut, singleArray_Out, new float[] { 0, 1, 2 }, 3)); + AssertExtensions.CollectionEqual(singleArray_Back, singleArray_InOut); + AssertExtensions.CollectionEqual(singleArray_Back, singleArray_Out); } private static void TestULongArray() @@ -540,9 +540,9 @@ private static void TestULongArray() ulong[] ulongArray_InOut = new ulong[] { 0, 1, 2 }; ulong[] ulongArray_Out = new ulong[] { 0, 1, 2 }; ulong[] ulongArray_Back = new ulong[] { 10, 11, 12 }; - Assert.IsTrue(PassArrayUlong(ulongArray, ulongArray_In, ulongArray_InOut, ulongArray_Out, new ulong[] { 0, 1, 2 }, 3)); - Assert.AreAllEqual(ulongArray_Back, ulongArray_InOut); - Assert.AreAllEqual(ulongArray_Back, ulongArray_Out); + Assert.True(PassArrayUlong(ulongArray, ulongArray_In, ulongArray_InOut, ulongArray_Out, new ulong[] { 0, 1, 2 }, 3)); + AssertExtensions.CollectionEqual(ulongArray_Back, ulongArray_InOut); + AssertExtensions.CollectionEqual(ulongArray_Back, ulongArray_Out); } private static void TestLongArray() @@ -553,9 +553,9 @@ private static void TestLongArray() long[] longArray_InOut = new long[] { 0, 1, 2 }; long[] longArray_Out = new long[] { 0, 1, 2 }; long[] longArray_Back = new long[] { 10, 11, 12 }; - Assert.IsTrue(PassArrayLong(longArray, longArray_In, longArray_InOut, longArray_Out, new long[] { 0, 1, 2 }, 3)); - Assert.AreAllEqual(longArray_Back, longArray_InOut); - Assert.AreAllEqual(longArray_Back, longArray_Out); + Assert.True(PassArrayLong(longArray, longArray_In, longArray_InOut, longArray_Out, new long[] { 0, 1, 2 }, 3)); + AssertExtensions.CollectionEqual(longArray_Back, longArray_InOut); + AssertExtensions.CollectionEqual(longArray_Back, longArray_Out); } private static void TestUInt32Array() @@ -566,9 +566,9 @@ private static void TestUInt32Array() uint[] uintArray_InOut = new uint[] { 0, 1, 2 }; uint[] uintArray_Out = new uint[] { 0, 1, 2 }; uint[] uintArray_Back = new uint[] { 10, 11, 12 }; - Assert.IsTrue(PassArrayUint(uintArray, uintArray_In, uintArray_InOut, uintArray_Out, new uint[] { 0, 1, 2 }, 3)); - Assert.AreAllEqual(uintArray_Back, uintArray_InOut); - Assert.AreAllEqual(uintArray_Back, uintArray_Out); + Assert.True(PassArrayUint(uintArray, uintArray_In, uintArray_InOut, uintArray_Out, new uint[] { 0, 1, 2 }, 3)); + AssertExtensions.CollectionEqual(uintArray_Back, uintArray_InOut); + AssertExtensions.CollectionEqual(uintArray_Back, uintArray_Out); } private static void TestInt32Array() @@ -579,9 +579,9 @@ private static void TestInt32Array() int[] intArray_InOut = new int[] { 0, 1, 2 }; int[] intArray_Out = new int[] { 0, 1, 2 }; int[] intArray_Back = new int[] { 10, 11, 12 }; - Assert.IsTrue(PassArrayInt(intArray, intArray_In, intArray_InOut, intArray_Out, new int[] { 0, 1, 2 }, 3)); - Assert.AreAllEqual(intArray_Back, intArray_InOut); - Assert.AreAllEqual(intArray_Back, intArray_Out); + Assert.True(PassArrayInt(intArray, intArray_In, intArray_InOut, intArray_Out, new int[] { 0, 1, 2 }, 3)); + AssertExtensions.CollectionEqual(intArray_Back, intArray_InOut); + AssertExtensions.CollectionEqual(intArray_Back, intArray_Out); } private static void TestUInt16Array() @@ -592,9 +592,9 @@ private static void TestUInt16Array() ushort[] ushortArray_InOut = new ushort[] { 0, 1, 2 }; ushort[] ushortArray_Out = new ushort[] { 0, 1, 2 }; ushort[] ushortArray_Back = new ushort[] { 10, 11, 12 }; - Assert.IsTrue(PassArrayUshort(ushortArray, ushortArray_In, ushortArray_InOut, ushortArray_Out, new ushort[] { 0, 1, 2 }, 3)); - Assert.AreAllEqual(ushortArray_Back, ushortArray_InOut); - Assert.AreAllEqual(ushortArray_Back, ushortArray_Out); + Assert.True(PassArrayUshort(ushortArray, ushortArray_In, ushortArray_InOut, ushortArray_Out, new ushort[] { 0, 1, 2 }, 3)); + AssertExtensions.CollectionEqual(ushortArray_Back, ushortArray_InOut); + AssertExtensions.CollectionEqual(ushortArray_Back, ushortArray_Out); } private static void TestInt16Array() @@ -605,9 +605,9 @@ private static void TestInt16Array() short[] shortArray_InOut = new short[] { -1, 0, 1 }; short[] shortArray_Out = new short[] { -1, 0, 1 }; short[] shortArray_Back = new short[] { 9, 10, 11 }; - Assert.IsTrue(PassArrayShort(shortArray, shortArray_In, shortArray_InOut, shortArray_Out, new short[] { -1, 0, 1 }, 3)); - Assert.AreAllEqual(shortArray_Back, shortArray_InOut); - Assert.AreAllEqual(shortArray_Back, shortArray_Out); + Assert.True(PassArrayShort(shortArray, shortArray_In, shortArray_InOut, shortArray_Out, new short[] { -1, 0, 1 }, 3)); + AssertExtensions.CollectionEqual(shortArray_Back, shortArray_InOut); + AssertExtensions.CollectionEqual(shortArray_Back, shortArray_Out); } private static void TestByteArray() @@ -618,9 +618,9 @@ private static void TestByteArray() byte[] byteArray_InOut = new byte[] { 0, 1, 2 }; byte[] byteArray_Out = new byte[] { 0, 1, 2 }; byte[] byteArray_Back = new byte[] { 10, 11, 12 }; - Assert.IsTrue(PassArrayByte(byteArray, byteArray_In, byteArray_InOut, byteArray_Out, new byte[] { 0, 1, 2 }, 3)); - Assert.AreAllEqual(byteArray_Back, byteArray_InOut); - Assert.AreAllEqual(byteArray_Back, byteArray_Out); + Assert.True(PassArrayByte(byteArray, byteArray_In, byteArray_InOut, byteArray_Out, new byte[] { 0, 1, 2 }, 3)); + AssertExtensions.CollectionEqual(byteArray_Back, byteArray_InOut); + AssertExtensions.CollectionEqual(byteArray_Back, byteArray_Out); } private static void TestSByteArray() @@ -631,9 +631,9 @@ private static void TestSByteArray() sbyte[] sbyteArray_InOut = new sbyte[] { -1, 0, 1 }; sbyte[] sbyteArray_Out = new sbyte[] { -1, 0, 1 }; sbyte[] sbyteArray_Back = new sbyte[] { 9, 10, 11 }; - Assert.IsTrue(PassArraySbyte(sbyteArray, sbyteArray_In, sbyteArray_InOut, sbyteArray_Out, new sbyte[] {-1, 0, 1}, 3)); - Assert.AreAllEqual(sbyteArray_Back, sbyteArray_InOut); - Assert.AreAllEqual(sbyteArray_Back, sbyteArray_Out); + Assert.True(PassArraySbyte(sbyteArray, sbyteArray_In, sbyteArray_InOut, sbyteArray_Out, new sbyte[] {-1, 0, 1}, 3)); + AssertExtensions.CollectionEqual(sbyteArray_Back, sbyteArray_InOut); + AssertExtensions.CollectionEqual(sbyteArray_Back, sbyteArray_Out); } public static void TestLayout() { @@ -645,8 +645,8 @@ public static void TestLayout() { a = 12, b = 3 }; - - Assert.AreEqual(layoutStruct.b, PassLayout(layoutStruct)); + + Assert.Equal(layoutStruct.b, PassLayout(layoutStruct)); Console.WriteLine("------------------------"); } diff --git a/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.cs b/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.cs index 193acfa5861f17..065c4b3b4697c2 100644 --- a/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.cs +++ b/src/tests/Interop/PInvoke/Attributes/LCID/LCIDTest.cs @@ -6,7 +6,7 @@ using System.Reflection; using System.Runtime.InteropServices; using System.Text; -using TestLibrary; +using Xunit; class LCIDNative { @@ -34,13 +34,13 @@ public static int Main() { string testString = "Test string"; LCIDNative.ReverseString(testString, out string reversed); - Assert.AreEqual(Reverse(testString), reversed); + Assert.Equal(Reverse(testString), reversed); CultureInfo originalCulture = CultureInfo.CurrentCulture; try { CultureInfo spanishCulture = new CultureInfo("es-ES", false); CultureInfo.CurrentCulture = spanishCulture; - Assert.IsTrue(LCIDNative.VerifyValidLCIDPassed(CultureInfo.CurrentCulture.LCID)); + Assert.True(LCIDNative.VerifyValidLCIDPassed(CultureInfo.CurrentCulture.LCID)); } finally { diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PTF/AFF_PTF.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_Default/Assembly_Default.csproj similarity index 69% rename from src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PTF/AFF_PTF.csproj rename to src/tests/Interop/PInvoke/BestFitMapping/Assembly_Default/Assembly_Default.csproj index dcb39b6b27c578..2b9c677b90a845 100644 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PTF/AFF_PTF.csproj +++ b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_Default/Assembly_Default.csproj @@ -5,9 +5,6 @@ true - - - - + diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Assembly_Default/PInvoke_Default.cs b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_Default/PInvoke_Default.cs new file mode 100644 index 00000000000000..60723e479bbf02 --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_Default/PInvoke_Default.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Char +{ + public partial class PInvoke_Default + { + public static void RunTest() + { + RunTest(bestFitMapping: true, throwOnUnmappableChar: false); + } + } +} + +namespace LPStr +{ + public partial class PInvoke_Default + { + public static void RunTest() + { + RunTest(bestFitMapping: true, throwOnUnmappableChar: false); + } + } +} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_False/AssemblyInfo.cs b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_False/AssemblyInfo.cs new file mode 100644 index 00000000000000..ba71ae63b953a2 --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_False/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; + +[assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)] diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_False_False/Assembly_False_False.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_False/Assembly_False_False.csproj similarity index 69% rename from src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_False_False/Assembly_False_False.csproj rename to src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_False/Assembly_False_False.csproj index dcb39b6b27c578..2b9c677b90a845 100644 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_False_False/Assembly_False_False.csproj +++ b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_False/Assembly_False_False.csproj @@ -5,9 +5,6 @@ true - - - - + diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_False/PInvoke_Default.cs b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_False/PInvoke_Default.cs new file mode 100644 index 00000000000000..15be8e2e49ec68 --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_False/PInvoke_Default.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Char +{ + public partial class PInvoke_Default + { + public static void RunTest() + { + RunTest(bestFitMapping: false, throwOnUnmappableChar: false); + } + } +} + +namespace LPStr +{ + public partial class PInvoke_Default + { + public static void RunTest() + { + RunTest(bestFitMapping: false, throwOnUnmappableChar: false); + } + } +} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_True/AssemblyInfo.cs b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_True/AssemblyInfo.cs new file mode 100644 index 00000000000000..9d7331548071eb --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_True/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; + +[assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)] diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_False_True/Assembly_False_True.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_True/Assembly_False_True.csproj similarity index 69% rename from src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_False_True/Assembly_False_True.csproj rename to src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_True/Assembly_False_True.csproj index dcb39b6b27c578..2b9c677b90a845 100644 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_False_True/Assembly_False_True.csproj +++ b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_True/Assembly_False_True.csproj @@ -5,9 +5,6 @@ true - - - - + diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_True/PInvoke_Default.cs b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_True/PInvoke_Default.cs new file mode 100644 index 00000000000000..1a7afb964c2715 --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_False_True/PInvoke_Default.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Char +{ + public partial class PInvoke_Default + { + public static void RunTest() + { + RunTest(bestFitMapping: false, throwOnUnmappableChar: true); + } + } +} + +namespace LPStr +{ + public partial class PInvoke_Default + { + public static void RunTest() + { + RunTest(bestFitMapping: false, throwOnUnmappableChar: true); + } + } +} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_False/AssemblyInfo.cs b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_False/AssemblyInfo.cs new file mode 100644 index 00000000000000..1b8dfcd8a3475a --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_False/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; + +[assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)] diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_True_False/Assembly_True_False.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_False/Assembly_True_False.csproj similarity index 69% rename from src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_True_False/Assembly_True_False.csproj rename to src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_False/Assembly_True_False.csproj index dcb39b6b27c578..2b9c677b90a845 100644 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_True_False/Assembly_True_False.csproj +++ b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_False/Assembly_True_False.csproj @@ -5,9 +5,6 @@ true - - - - + diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_False/PInvoke_Default.cs b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_False/PInvoke_Default.cs new file mode 100644 index 00000000000000..60723e479bbf02 --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_False/PInvoke_Default.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Char +{ + public partial class PInvoke_Default + { + public static void RunTest() + { + RunTest(bestFitMapping: true, throwOnUnmappableChar: false); + } + } +} + +namespace LPStr +{ + public partial class PInvoke_Default + { + public static void RunTest() + { + RunTest(bestFitMapping: true, throwOnUnmappableChar: false); + } + } +} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_True/AssemblyInfo.cs b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_True/AssemblyInfo.cs new file mode 100644 index 00000000000000..b92e13d520b9f6 --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_True/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; + +[assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)] diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_True_True/Assembly_True_True.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_True/Assembly_True_True.csproj similarity index 69% rename from src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_True_True/Assembly_True_True.csproj rename to src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_True/Assembly_True_True.csproj index dcb39b6b27c578..2b9c677b90a845 100644 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_True_True/Assembly_True_True.csproj +++ b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_True/Assembly_True_True.csproj @@ -5,9 +5,6 @@ true - - - - + diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_True/PInvoke_Default.cs b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_True/PInvoke_Default.cs new file mode 100644 index 00000000000000..440e7252214b96 --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/Assembly_True_True/PInvoke_Default.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Char +{ + public partial class PInvoke_Default + { + public static void RunTest() + { + RunTest(bestFitMapping: true, throwOnUnmappableChar: true); + } + } +} + +namespace LPStr +{ + public partial class PInvoke_Default + { + public static void RunTest() + { + RunTest(bestFitMapping: true, throwOnUnmappableChar: true); + } + } +} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PFF/AFF_PFF.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PFF/AFF_PFF.cs deleted file mode 100644 index 77a0504d6bc924..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PFF/AFF_PFF.cs +++ /dev/null @@ -1,180 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)] - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3"); - - cTemp = GetValidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4"); - - cTemp = GetInvalidChar(); - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc5"); - Assert.AreEqual('?', cTemp, "[Error] Location tc6"); - - cTemp = GetValidChar(); - char cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc8"); - } - - static void testCharBufferString() - { - Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs6"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs8"); - } - - static void testCharBufferStringBuilder() - { - StringBuilder sb = GetInvalidStringBuilder(); - Assert.IsTrue(CharBuffer_In_StringBuilder(sb), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4"); - - cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PFF/AFF_PFF.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PFF/AFF_PFF.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PFF/AFF_PFF.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PFT/AFF_PFT.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PFT/AFF_PFT.cs deleted file mode 100644 index e40e3fe125f32e..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PFT/AFF_PFT.cs +++ /dev/null @@ -1,172 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)] - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.Throws(() => Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - Assert.Throws(() => Char_InByRef(ref cTemp), "[Error] Location tc3"); - - cTemp = GetValidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4"); - - cTemp = GetInvalidChar(); - Assert.Throws(() => Char_InOutByRef(ref cTemp), "[Error] Location tc5"); - - cTemp = GetValidChar(); - char cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6"); - } - - static void testCharBufferString() - { - Assert.Throws(() => CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - Assert.Throws(() => CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - Assert.Throws(() => CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - - cTemp = GetValidString(); - String cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6"); - } - - static void testCharBufferStringBuilder() - { - Assert.Throws(() => CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4"); - - cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb"); - - cTemp = GetValidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb7"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PFT/AFF_PFT.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PFT/AFF_PFT.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PFT/AFF_PFT.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PTF/AFF_PTF.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PTF/AFF_PTF.cs deleted file mode 100644 index 9cb125053b9f62..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PTF/AFF_PTF.cs +++ /dev/null @@ -1,191 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)] - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1"); - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - char cTempClone = cTemp; - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc4"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc5"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc6"); - - cTemp = GetInvalidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tc8"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc9"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc10"); - } - - static void testCharBufferString() - { - Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs4"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs5"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs6"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs8"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs9"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs10"); - } - - static void testCharBufferStringBuilder() - { - Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb4"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb9"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb10"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PTT/AFF_PTT.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PTT/AFF_PTT.cs deleted file mode 100644 index 5b26eee49b9977..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PTT/AFF_PTT.cs +++ /dev/null @@ -1,180 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)] - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - char cTempClone = GetInvalidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4"); - - cTemp = GetInvalidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc5"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6"); - } - - static void testCharBufferString() - { - Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = GetInvalidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6"); - } - - static void testCharBufferStringBuilder() - { - Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PTT/AFF_PTT.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PTT/AFF_PTT.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFF_PTT/AFF_PTT.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PFF/AFT_PFF.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PFF/AFT_PFF.cs deleted file mode 100644 index 5cee92f7a17f65..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PFF/AFT_PFF.cs +++ /dev/null @@ -1,180 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)] - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3"); - - cTemp = GetValidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4"); - - cTemp = GetInvalidChar(); - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc5"); - Assert.AreEqual('?', cTemp, "[Error] Location tc66"); - - cTemp = GetValidChar(); - char cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc8"); - } - - static void testCharBufferString() - { - Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs6"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs88"); - } - - static void testCharBufferStringBuilder() - { - StringBuilder sb = GetInvalidStringBuilder(); - Assert.IsTrue(CharBuffer_In_StringBuilder(sb), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4"); - - cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PFF/AFT_PFF.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PFF/AFT_PFF.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PFF/AFT_PFF.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PFT/AFT_PFT.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PFT/AFT_PFT.cs deleted file mode 100644 index f0fdec9fc0f77b..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PFT/AFT_PFT.cs +++ /dev/null @@ -1,174 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)] - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.Throws(() => Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - Assert.Throws(() => Char_InByRef(ref cTemp), "[Error] Location tc3"); - - cTemp = GetValidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4"); - - cTemp = GetInvalidChar(); - Assert.Throws(() => Char_InOutByRef(ref cTemp), "[Error] Location tc5"); - - cTemp = GetValidChar(); - char cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc7"); - } - - static void testCharBufferString() - { - Assert.Throws(() => CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - Assert.Throws(() => CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - Assert.Throws(() => CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - - cTemp = GetValidString(); - String cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs7"); - } - - static void testCharBufferStringBuilder() - { - Assert.Throws(() => CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4"); - - cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - - cTemp = GetValidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb7"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PFT/AFT_PFT.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PFT/AFT_PFT.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PFT/AFT_PFT.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PTF/AFT_PTF.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PTF/AFT_PTF.cs deleted file mode 100644 index 166ea359ae61b3..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PTF/AFT_PTF.cs +++ /dev/null @@ -1,192 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)] - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - char cTempClone = cTemp; - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc4"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc5"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc6"); - - cTemp = GetInvalidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tc8"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc9"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc10"); - } - - static void testCharBufferString() - { - Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs4"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs5"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs6"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs8"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Locationtcbs9"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs10"); - } - - static void testCharBufferStringBuilder() - { - Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb4"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb9"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb10"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PTF/AFT_PTF.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PTF/AFT_PTF.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PTF/AFT_PTF.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PTT/AFT_PTT.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PTT/AFT_PTT.cs deleted file mode 100644 index e6827f9112dfcd..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PTT/AFT_PTT.cs +++ /dev/null @@ -1,180 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)] - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - char cTempClone = GetInvalidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4"); - - cTemp = GetInvalidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc5"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6"); - } - - static void testCharBufferString() - { - Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = GetInvalidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6"); - } - - static void testCharBufferStringBuilder() - { - Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PTT/AFT_PTT.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PTT/AFT_PTT.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/AFT_PTT/AFT_PTT.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PFF/ATF_PFF.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PFF/ATF_PFF.cs deleted file mode 100644 index a67b2c5805e010..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PFF/ATF_PFF.cs +++ /dev/null @@ -1,180 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)] - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3"); - - cTemp = GetValidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4"); - - cTemp = GetInvalidChar(); - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc5"); - Assert.AreEqual('?', cTemp, "[Error] Location tc6"); - - cTemp = GetValidChar(); - char cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc8"); - } - - static void testCharBufferString() - { - Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs6"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs8"); - } - - static void testCharBufferStringBuilder() - { - StringBuilder sb = GetInvalidStringBuilder(); - Assert.IsTrue(CharBuffer_In_StringBuilder(sb), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4"); - - cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PFF/ATF_PFF.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PFF/ATF_PFF.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PFF/ATF_PFF.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PFT/ATF_PFT.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PFT/ATF_PFT.cs deleted file mode 100644 index 5dae8986560f91..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PFT/ATF_PFT.cs +++ /dev/null @@ -1,173 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)] - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.Throws(() => Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - Assert.Throws(() => Char_InByRef(ref cTemp), "[Error] Location tc3"); - - cTemp = GetValidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4"); - - cTemp = GetInvalidChar(); - Assert.Throws(() => Char_InOutByRef(ref cTemp), "[Error] Location tc5"); - - cTemp = GetValidChar(); - char cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6"); - } - - static void testCharBufferString() - { - Assert.Throws(() => CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - Assert.Throws(() => CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - Assert.Throws(() => CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - - cTemp = GetValidString(); - String cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6"); - } - - static void testCharBufferStringBuilder() - { - Assert.Throws(() => CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4"); - - cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - - cTemp = GetValidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6"); - - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb7"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PFT/ATF_PFT.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PFT/ATF_PFT.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PFT/ATF_PFT.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PTF/ATF_PTF.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PTF/ATF_PTF.cs deleted file mode 100644 index 6b4cef5a852b81..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PTF/ATF_PTF.cs +++ /dev/null @@ -1,192 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)] - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - char cTempClone = cTemp; - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc4"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc5"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc6"); - - cTemp = GetInvalidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tc8"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc9"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc10"); - } - - static void testCharBufferString() - { - Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "Error location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "Error location tcbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "Error location tcbs3"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs4"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "Error location tcbs5"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs6"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "Error location tcbs7"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs8"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "Error location tcbs9"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs10"); - } - - static void testCharBufferStringBuilder() - { - Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "Error location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "Error location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "Error location tcbsb3"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "Error location tcbsb4"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "Error location tcbsb5"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "Error location tcbsb6"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "Error location tcbsb7"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "Error location tcbsb8"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "Error location tcbsb9"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "Error location tcbsb10"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PTF/ATF_PTF.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PTF/ATF_PTF.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PTF/ATF_PTF.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PTT/ATF_PTT.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PTT/ATF_PTT.cs deleted file mode 100644 index b015a905f7854c..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PTT/ATF_PTT.cs +++ /dev/null @@ -1,180 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)] - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - char cTempClone = GetInvalidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4"); - - cTemp = GetInvalidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc5"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6"); - } - - static void testCharBufferString() - { - Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = GetInvalidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6"); - } - - static void testCharBufferStringBuilder() - { - Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PTT/ATF_PTT.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PTT/ATF_PTT.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATF_PTT/ATF_PTT.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PFF/ATT_PFF.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PFF/ATT_PFF.cs deleted file mode 100644 index 704069b3d203fd..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PFF/ATT_PFF.cs +++ /dev/null @@ -1,180 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)] - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3"); - - cTemp = GetValidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4"); - - cTemp = GetInvalidChar(); - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc5"); - Assert.AreEqual('?', cTemp, "[Error] Location tc6"); - - cTemp = GetValidChar(); - char cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc6"); - } - - static void testCharBufferString() - { - Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs6"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs8"); - } - - static void testCharBufferStringBuilder() - { - StringBuilder sb = GetInvalidStringBuilder(); - Assert.IsTrue(CharBuffer_In_StringBuilder(sb), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4"); - - cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PFF/ATT_PFF.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PFF/ATT_PFF.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PFF/ATT_PFF.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PFT/ATT_PFT.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PFT/ATT_PFT.cs deleted file mode 100644 index c75979c2dcd1ea..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PFT/ATT_PFT.cs +++ /dev/null @@ -1,174 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)] - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.Throws(() => Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - Assert.Throws(() => Char_InByRef(ref cTemp), "[Error] Location tc3"); - - cTemp = GetValidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location t4"); - - cTemp = GetInvalidChar(); - Assert.Throws(() => Char_InOutByRef(ref cTemp), "[Error] Location tc55"); - - cTemp = GetValidChar(); - char cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc7"); - } - - static void testCharBufferString() - { - Assert.Throws(() => CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - Assert.Throws(() => CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - Assert.Throws(() => CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - - cTemp = GetValidString(); - String cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs7"); - } - - static void testCharBufferStringBuilder() - { - Assert.Throws(() => CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4"); - - cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - - cTemp = GetValidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb7"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PFT/ATT_PFT.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PFT/ATT_PFT.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PFT/ATT_PFT.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PTF/ATT_PTF.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PTF/ATT_PTF.cs deleted file mode 100644 index e89ff5ec7ac85d..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PTF/ATT_PTF.cs +++ /dev/null @@ -1,192 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)] - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - char cTempClone = cTemp; - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc4"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc5"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc6"); - - cTemp = GetInvalidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tc8"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc9"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc10"); - } - - static void testCharBufferString() - { - Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs4"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs5"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs6"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs8"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs9"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs10"); - } - - static void testCharBufferStringBuilder() - { - Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb4"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb9"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb10"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PTF/ATT_PTF.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PTF/ATT_PTF.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PTF/ATT_PTF.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PTT/ATT_PTT.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PTT/ATT_PTT.cs deleted file mode 100644 index 82ef7530ee00ad..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PTT/ATT_PTT.cs +++ /dev/null @@ -1,180 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)] - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - char cTempClone = GetInvalidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4"); - - cTemp = GetInvalidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc5"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6"); - } - - static void testCharBufferString() - { - Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = GetInvalidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6"); - } - - static void testCharBufferStringBuilder() - { - Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PTT/ATT_PTT.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PTT/ATT_PTT.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/ATT_PTT/ATT_PTT.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_False_False/Assembly_False_False.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_False_False/Assembly_False_False.cs deleted file mode 100644 index 29d39dfed049fe..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_False_False/Assembly_False_False.cs +++ /dev/null @@ -1,180 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)] - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative")] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3"); - - cTemp = GetValidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4"); - - cTemp = GetInvalidChar(); - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc5"); - Assert.AreEqual('?', cTemp, "[Error] Location tc6"); - - cTemp = GetValidChar(); - char cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc8"); - } - - static void testCharBufferString() - { - Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs6"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs8"); - } - - static void testCharBufferStringBuilder() - { - StringBuilder sb = GetInvalidStringBuilder(); - Assert.IsTrue(CharBuffer_In_StringBuilder(sb), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4"); - - cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_False_True/Assembly_False_True.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_False_True/Assembly_False_True.cs deleted file mode 100644 index ea17e497b42d6a..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_False_True/Assembly_False_True.cs +++ /dev/null @@ -1,174 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)] - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative")] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.Throws(() => Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - Assert.Throws(() => Char_InByRef(ref cTemp), "[Error] Location tc3"); - - cTemp = GetValidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4"); - - cTemp = GetInvalidChar(); - Assert.Throws(() => Char_InOutByRef(ref cTemp), "[Error] Location tc5"); - - cTemp = GetValidChar(); - char cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc7"); - } - - static void testCharBufferString() - { - Assert.Throws(() => CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - Assert.Throws(() => CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - Assert.Throws(() => CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - - cTemp = GetValidString(); - String cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs7"); - } - - static void testCharBufferStringBuilder() - { - Assert.Throws(() => CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4"); - - cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - - cTemp = GetValidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb7"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_True_False/Assembly_True_False.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_True_False/Assembly_True_False.cs deleted file mode 100644 index 09fbd50fd1275e..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_True_False/Assembly_True_False.cs +++ /dev/null @@ -1,229 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)] - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative")] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool Char_InOut_ArrayWithOffset([In, Out]ArrayWithOffset charArrayWithOffset); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - char cTempClone = cTemp; - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc4"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc5"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc6"); - - cTemp = GetInvalidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tc8"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc9"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc10"); - } - - static void testCharBufferString() - { - Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs4"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs5"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs6"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs8"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs9"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs10"); - } - - static void testCharBufferStringBuilder() - { - Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb4"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb9"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb10"); - } - - static char[] GetInvalidArray() - { - char[] c = new char[3]; - - c[0] = (char)0x2216; - c[1] = (char)0x2216; - c[2] = (char)0x2216; - - return c; - } - - static char[] GetValidArray() - { - char[] c = new char[3]; - - c[0] = 'a'; - c[1] = 'b'; - c[2] = 'c'; - - return c; - } - - static void testCharArrayWithOffset() - { - char[] c = GetInvalidArray(); - ArrayWithOffset arrWOff_0 = new ArrayWithOffset(c, 0); - Assert.IsTrue(Char_InOut_ArrayWithOffset(arrWOff_0), "[Error] Location ctlpsawo11"); - - c = GetValidArray(); - ArrayWithOffset arrWOff_1 = new ArrayWithOffset(c, 1); - Assert.IsTrue(Char_InOut_ArrayWithOffset(arrWOff_1), "[Error] Location ctlpsawo22"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - testCharArrayWithOffset(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_True_True/Assembly_True_True.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_True_True/Assembly_True_True.cs deleted file mode 100644 index e367098baa0a0d..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/Assembly_True_True/Assembly_True_True.cs +++ /dev/null @@ -1,181 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)] - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative")] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative")] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - char cTempClone = GetInvalidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4"); - - cTemp = GetInvalidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc5"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6"); - } - - static void testCharBufferString() - { - Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = GetInvalidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6"); - } - - static void testCharBufferStringBuilder() - { - Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/BestFitMappingNative.cpp b/src/tests/Interop/PInvoke/BestFitMapping/Char/BestFitMappingNative.cpp index 1ae2bba3d9c776..cb0501b13102ba 100644 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/BestFitMappingNative.cpp +++ b/src/tests/Interop/PInvoke/BestFitMapping/Char/BestFitMappingNative.cpp @@ -75,23 +75,3 @@ extern "C" bool DLL_EXPORT STDMETHODCALLTYPE CharBuffer_InOutByRef_StringBuilder return TRUE; } - -extern "C" bool DLL_EXPORT STDMETHODCALLTYPE Char_In_ArrayWithOffset (char* pArrayWithOffset) -{ - return TRUE; -} - -extern "C" bool DLL_EXPORT STDMETHODCALLTYPE Char_InOut_ArrayWithOffset (char* pArrayWithOffset) -{ - return TRUE; -} - -extern "C" bool DLL_EXPORT STDMETHODCALLTYPE Char_InByRef_ArrayWithOffset (char** ppArrayWithOffset) -{ - return TRUE; -} - -extern "C" bool DLL_EXPORT STDMETHODCALLTYPE Char_InOutByRef_ArrayWithOffset (char** ppArrayWithOffset) -{ - return TRUE; -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/PInvoke_Default.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/PInvoke_Default.cs new file mode 100644 index 00000000000000..36582abe8004e6 --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/Char/PInvoke_Default.cs @@ -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. + +using System; +using System.Text; +using System.Runtime.InteropServices; + +namespace Char; + +public partial class PInvoke_Default +{ + [DllImport("Char_BestFitMappingNative")] + public static extern bool Char_In([In]char c); + + [DllImport("Char_BestFitMappingNative")] + public static extern bool Char_InByRef([In]ref char c); + + [DllImport("Char_BestFitMappingNative")] + public static extern bool Char_InOutByRef([In, Out]ref char c); + + [DllImport("Char_BestFitMappingNative")] + public static extern bool CharBuffer_In_String([In]String s); + + [DllImport("Char_BestFitMappingNative")] + public static extern bool CharBuffer_InByRef_String([In]ref String s); + + [DllImport("Char_BestFitMappingNative")] + public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); + + [DllImport("Char_BestFitMappingNative")] + public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); + + [DllImport("Char_BestFitMappingNative")] + public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); + + [DllImport("Char_BestFitMappingNative")] + public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); + + private static unsafe void RunTest(bool bestFitMapping, bool throwOnUnmappableChar) + { + Console.WriteLine(" -- Validate P/Invokes: BestFitMapping not set, ThrowOnUnmappableChar not set"); + + Test.ValidateChar( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &Char_In, + &Char_InByRef, + &Char_InOutByRef)); + + Test.ValidateString( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &CharBuffer_In_String, + &CharBuffer_InByRef_String, + &CharBuffer_InOutByRef_String)); + + Test.ValidateStringBuilder( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &CharBuffer_In_StringBuilder, + &CharBuffer_InByRef_StringBuilder, + &CharBuffer_InOutByRef_StringBuilder)); + } +} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/PInvoke_False_False.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/PInvoke_False_False.cs new file mode 100644 index 00000000000000..e0dd77c40ffc39 --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/Char/PInvoke_False_False.cs @@ -0,0 +1,70 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Text; +using System.Runtime.InteropServices; + +namespace Char; + +public class PInvoke_False_False +{ + [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool Char_In([In]char c); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool Char_InByRef([In]ref char c); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool Char_InOutByRef([In, Out]ref char c); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool CharBuffer_In_String([In]String s); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool CharBuffer_InByRef_String([In]ref String s); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); + + public static unsafe void RunTest() + { + Console.WriteLine(" -- Validate P/Invokes: BestFitMapping=false, ThrowOnUnmappableChar=false"); + + bool bestFitMapping = false; + bool throwOnUnmappableChar = false; + + Test.ValidateChar( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &Char_In, + &Char_InByRef, + &Char_InOutByRef)); + + Test.ValidateString( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &CharBuffer_In_String, + &CharBuffer_InByRef_String, + &CharBuffer_InOutByRef_String)); + + Test.ValidateStringBuilder( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &CharBuffer_In_StringBuilder, + &CharBuffer_InByRef_StringBuilder, + &CharBuffer_InOutByRef_StringBuilder)); + } +} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/PInvoke_False_True.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/PInvoke_False_True.cs new file mode 100644 index 00000000000000..5caf8b3d434679 --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/Char/PInvoke_False_True.cs @@ -0,0 +1,69 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Text; +using System.Runtime.InteropServices; + +namespace Char; + +public class PInvoke_False_True +{ + [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool Char_In([In]char c); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool Char_InByRef([In]ref char c); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool Char_InOutByRef([In, Out]ref char c); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool CharBuffer_In_String([In]String s); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool CharBuffer_InByRef_String([In]ref String s); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); + + public static unsafe void RunTest() + { + Console.WriteLine(" -- Validate P/Invokes: BestFitMapping=false, ThrowOnUnmappableChar=true"); + + bool bestFitMapping = false; + bool throwOnUnmappableChar = true; + Test.ValidateChar( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &Char_In, + &Char_InByRef, + &Char_InOutByRef)); + + Test.ValidateString( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &CharBuffer_In_String, + &CharBuffer_InByRef_String, + &CharBuffer_InOutByRef_String)); + + Test.ValidateStringBuilder( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &CharBuffer_In_StringBuilder, + &CharBuffer_InByRef_StringBuilder, + &CharBuffer_InOutByRef_StringBuilder)); + } +} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/PInvoke_True_False.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/PInvoke_True_False.cs new file mode 100644 index 00000000000000..64a1bff8708afd --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/Char/PInvoke_True_False.cs @@ -0,0 +1,70 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Text; +using System.Runtime.InteropServices; + +namespace Char; + +public class PInvoke_True_False +{ + [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool Char_In([In]char c); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool Char_InByRef([In]ref char c); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool Char_InOutByRef([In, Out]ref char c); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool CharBuffer_In_String([In]String s); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool CharBuffer_InByRef_String([In]ref String s); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); + + public static unsafe void RunTest() + { + Console.WriteLine(" -- Validate P/Invokes: BestFitMapping=true, ThrowOnUnmappableChar=false"); + + bool bestFitMapping = true; + bool throwOnUnmappableChar = false; + + Test.ValidateChar( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &Char_In, + &Char_InByRef, + &Char_InOutByRef)); + + Test.ValidateString( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &CharBuffer_In_String, + &CharBuffer_InByRef_String, + &CharBuffer_InOutByRef_String)); + + Test.ValidateStringBuilder( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &CharBuffer_In_StringBuilder, + &CharBuffer_InByRef_StringBuilder, + &CharBuffer_InOutByRef_StringBuilder)); + } +} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/PInvoke_True_True.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/PInvoke_True_True.cs new file mode 100644 index 00000000000000..7f408a83cd4193 --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/Char/PInvoke_True_True.cs @@ -0,0 +1,70 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Text; +using System.Runtime.InteropServices; + +namespace Char; + +public class PInvoke_True_True +{ + [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool Char_In([In]char c); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool Char_InByRef([In]ref char c); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool Char_InOutByRef([In, Out]ref char c); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool CharBuffer_In_String([In]String s); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool CharBuffer_InByRef_String([In]ref String s); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); + + [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); + + public static unsafe void RunTest() + { + Console.WriteLine(" -- Validate P/Invokes: BestFitMapping=true, ThrowOnUnmappableChar=true"); + + bool bestFitMapping = true; + bool throwOnUnmappableChar = true; + + Test.ValidateChar( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &Char_In, + &Char_InByRef, + &Char_InOutByRef)); + + Test.ValidateString( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &CharBuffer_In_String, + &CharBuffer_InByRef_String, + &CharBuffer_InOutByRef_String)); + + Test.ValidateStringBuilder( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &CharBuffer_In_StringBuilder, + &CharBuffer_InByRef_StringBuilder, + &CharBuffer_InOutByRef_StringBuilder)); + } +} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_False_False/Pinvoke_False_False.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_False_False/Pinvoke_False_False.cs deleted file mode 100644 index fce90517ce0e9d..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_False_False/Pinvoke_False_False.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3"); - - cTemp = GetValidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location t4"); - - cTemp = GetInvalidChar(); - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc55"); - Assert.AreEqual('?', cTemp, "[Error] Location tc6"); - - cTemp = GetValidChar(); - char cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc6"); - } - - static void testCharBufferString() - { - Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs6"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs77"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs8"); - } - - static void testCharBufferStringBuilder() - { - StringBuilder sb = GetInvalidStringBuilder(); - Assert.IsTrue(CharBuffer_In_StringBuilder(sb), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4"); - - cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_False_False/Pinvoke_False_False.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_False_False/Pinvoke_False_False.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_False_False/Pinvoke_False_False.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_False_True/Pinvoke_False_True.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_False_True/Pinvoke_False_True.cs deleted file mode 100644 index 6339df89ceae72..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_False_True/Pinvoke_False_True.cs +++ /dev/null @@ -1,172 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.Throws(() => Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - Assert.Throws(() => Char_InByRef(ref cTemp), "[Error] Location tc3"); - - cTemp = GetValidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4"); - - cTemp = GetInvalidChar(); - Assert.Throws(() => Char_InOutByRef(ref cTemp), "[Error] Location tc5"); - - cTemp = GetValidChar(); - char cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc7"); - } - - static void testCharBufferString() - { - Assert.Throws(() => CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - Assert.Throws(() => CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - Assert.Throws(() => CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - - cTemp = GetValidString(); - String cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs7"); - } - - static void testCharBufferStringBuilder() - { - Assert.Throws(() => CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4"); - - cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - - cTemp = GetValidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb7"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_False_True/Pinvoke_False_True.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_False_True/Pinvoke_False_True.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_False_True/Pinvoke_False_True.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_True_False/Pinvoke_True_False.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_True_False/Pinvoke_True_False.cs deleted file mode 100644 index b9a2f6c530b77b..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_True_False/Pinvoke_True_False.cs +++ /dev/null @@ -1,190 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - char cTempClone = cTemp; - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc4"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc5"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc6"); - - cTemp = GetInvalidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc7"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tc8"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc9"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tc10"); - } - - static void testCharBufferString() - { - Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "Error location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "Error location tcbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "Error location tcbs3"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs4"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "Error location tcbs5"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs6"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "Error location tcbs7"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs8"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "Error location tcbs9"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs10"); - } - - static void testCharBufferStringBuilder() - { - Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "Error location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "Error location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "Error location tcbsb3"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb4"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "Error location tcbsb5"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "Error location tcbsb7"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "Error location tcbsb9"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb10"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_True_False/Pinvoke_True_False.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_True_False/Pinvoke_True_False.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_True_False/Pinvoke_True_False.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_True_True/Pinvoke_True_True.cs b/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_True_True/Pinvoke_True_True.cs deleted file mode 100644 index 008bc0830a695d..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_True_True/Pinvoke_True_True.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -public class BFM_CharMarshaler -{ - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool Char_In([In]char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool Char_InByRef([In]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool Char_InOutByRef([In, Out]ref char c); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_In_String([In]String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InByRef_String([In]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InOutByRef_String([In, Out]ref String s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_In_StringBuilder([In]StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InByRef_StringBuilder([In]ref StringBuilder s); - - [DllImport("Char_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool CharBuffer_InOutByRef_StringBuilder([In, Out]ref StringBuilder s); - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl; - } - - static char GetInvalidChar() - { - return (char)0x2216; - } - - static char GetValidChar() - { - return 'c'; - } - - static void testChar() - { - Assert.IsTrue(Char_In(GetInvalidChar()), "[Error] Location tc1"); - - Assert.IsTrue(Char_In(GetValidChar()), "[Error] Location tc2"); - - char cTemp = GetInvalidChar(); - char cTempClone = GetInvalidChar(); - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc3"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InByRef(ref cTemp), "[Error] Location tc4"); - - cTemp = GetInvalidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location t5"); - - cTemp = GetValidChar(); - cTempClone = cTemp; - Assert.IsTrue(Char_InOutByRef(ref cTemp), "[Error] Location tc6"); - } - - static void testCharBufferString() - { - Assert.IsTrue(CharBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(CharBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = GetInvalidString(); - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6"); - } - - static void testCharBufferStringBuilder() - { - Assert.IsTrue(CharBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1"); - - Assert.IsTrue(CharBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(CharBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6"); - } - - static void runTest() - { - testChar(); - testCharBufferString(); - testCharBufferStringBuilder(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_True_True/Pinvoke_True_True.csproj b/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_True_True/Pinvoke_True_True.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/Char/Pinvoke_True_True/Pinvoke_True_True.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Directory.Build.props b/src/tests/Interop/PInvoke/BestFitMapping/Directory.Build.props new file mode 100644 index 00000000000000..498cfdda30a371 --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/Directory.Build.props @@ -0,0 +1,30 @@ + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PFF/AFF_PFF.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PFF/AFF_PFF.cs deleted file mode 100644 index 6ee1f3b77fe969..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PFF/AFF_PFF.cs +++ /dev/null @@ -1,356 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)] - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(false, ThrowOnUnmappableChar = false)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(false, ThrowOnUnmappableChar = false)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs6"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs88"); - } - - static void testLPStrBufferStringBuilder() - { - StringBuilder sb = GetInvalidStringBuilder(); - Assert.IsTrue(LPStrBuffer_In_StringBuilder(sb), "[Error] Location tcbsb1"); - - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); -; - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4"); - - cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb6"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb7"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tcbsb8"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferStruct() - { - LPStrTestStruct lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Struct_String(lpss), "[Error] Location tlpsbs1"); - - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbs2"); - - LPStrTestStruct cTemp = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbs3"); - - cTemp = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbs4"); - - cTemp = GetInvalidStruct(); - LPStrTestStruct cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbs5"); - Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbs6"); - - cTemp = GetValidStruct(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbs7"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbs8"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass lpss = new LPStrTestClass(); - lpss.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc1"); - - lpss.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc2"); - - LPStrTestClass cTemp = new LPStrTestClass(); - cTemp.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3"); - - cTemp.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4"); - - cTemp.str = GetInvalidString(); - LPStrTestClass cTempClone = new LPStrTestClass(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5"); - Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc6"); - - cTemp.str = GetValidString(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc7"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc8"); - } - - static void testLPStrBufferArray() - { - String[] lpss = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(lpss), "[Error] Location tlpsba1"); - - Assert.IsTrue(LPStrBuffer_In_Array_String(GetValidArray()), "[Error] Location tlpsba2"); - - String[] cTemp = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3"); - - cTemp = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4"); - - cTemp = GetInvalidArray(); - String[] cTempClone = new String[3]; - cTempClone[0] = cTemp[0]; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5"); - Assert.AreNotEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba6"); - - cTemp = GetValidArray(); - cTempClone[0] = cTemp[0]; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba7"); - Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba8"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsba11"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsba22"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsba33"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsba44"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - - LPStrTestStruct[] lpssClone = new LPStrTestStruct[2]; - lpssClone[0].str = lpss[0].str; - lpssClone[1].str = lpss[1].str; - - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsba55"); - Assert.AreNotEqual(lpssClone[0].str, lpss[0].str, "[Error] Location tlpsba66"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - - lpssClone = new LPStrTestStruct[2]; - lpssClone[0].str = lpss[0].str; - lpssClone[1].str = lpss[1].str; - - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsba77"); - Assert.AreEqual(lpssClone[0].str, lpss[0].str, "[Error] Location tlpsba88"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PFF/AFF_PFF.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PFF/AFF_PFF.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PFF/AFF_PFF.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PFT/AFF_PFT.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PFT/AFF_PFT.cs deleted file mode 100644 index e3c152fe944971..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PFT/AFF_PFT.cs +++ /dev/null @@ -1,343 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)] - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(false, ThrowOnUnmappableChar = true)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(false, ThrowOnUnmappableChar = true)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - // struct attribute should override PI flags for BFM - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.Throws(() => LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4"); - - cTemp = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - - cTemp = GetValidString(); - String cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs7"); - } - - static void testLPStrBufferStringBuilder() - { - Assert.Throws(() => LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1"); - - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4"); - - cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - - cTemp = GetValidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb7"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferStruct() - { - Assert.Throws(() => LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1"); - - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct cTemp = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3"); - - cTemp = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4"); - - cTemp = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5"); - - cTemp = GetValidStruct(); - LPStrTestStruct cTempClone = new LPStrTestStruct(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst6"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst7"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass cTest = new LPStrTestClass(); - cTest.str = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc1"); - - cTest.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc2"); - - LPStrTestClass cTemp = new LPStrTestClass(); - cTemp.str = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3"); - - cTemp.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4"); - - cTemp.str = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5"); - - LPStrTestClass cTempClone = new LPStrTestClass(); - cTemp.str = GetValidString(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc6"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc7"); - } - - static void testLPStrBufferArray() - { - String[] cTest = null; - cTest = GetInvalidArray(); - Assert.Throws(() => LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba1"); - - cTest = GetValidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba2"); - - String[] cTemp = GetInvalidArray(); - Assert.Throws(() => LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3"); - - cTemp = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4"); - - cTemp = GetInvalidArray(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5"); - - String[] cTempClone = new String[3]; - cTemp = GetValidArray(); - cTempClone[0] = cTemp[0]; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba6"); - Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba7"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = null; - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - LPStrTestStruct[] lpssClone = new LPStrTestStruct[2]; - lpssClone[0].str = lpss[0].str; - lpssClone[1].str = lpss[1].str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6"); - Assert.AreEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos7"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PFT/AFF_PFT.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PFT/AFF_PFT.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PFT/AFF_PFT.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PTF/AFF_PTF.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PTF/AFF_PTF.cs deleted file mode 100644 index 55b087381dfc97..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PTF/AFF_PTF.cs +++ /dev/null @@ -1,340 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)] - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true, ThrowOnUnmappableChar = false)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true, ThrowOnUnmappableChar = false)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs4"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs6"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs7"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tlpsbs8"); - - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs9"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs10"); - } - - static void testLPStrBufferStringBuilder() - { - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1"); - - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb4"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb9"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb10"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static void testLPStrBufferStruct() - { - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1"); - - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4"); - - lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6"); - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferArray() - { - String[] s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass sClass = new LPStrTestClass(); - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc1"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc2"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc3"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc4"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc5"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc6"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6"); - - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PTF/AFF_PTF.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PTF/AFF_PTF.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PTF/AFF_PTF.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PTT/AFF_PTT.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PTT/AFF_PTT.cs deleted file mode 100644 index ece37c2da77e6f..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PTT/AFF_PTT.cs +++ /dev/null @@ -1,329 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)] - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true, ThrowOnUnmappableChar = true)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true, ThrowOnUnmappableChar = true)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6"); - } - - static void testLPStrBufferStringBuilder() - { - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1"); - - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static void testLPStrBufferStruct() - { - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1"); - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4"); - - lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6"); - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferArray() - { - String[] s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass sClass = new LPStrTestClass(); - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc1"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc2"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc3"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc4"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc5"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc6"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PTT/AFF_PTT.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PTT/AFF_PTT.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFF_PTT/AFF_PTT.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PFF/AFT_PFF.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PFF/AFT_PFF.cs deleted file mode 100644 index ba37d8fe9d9da9..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PFF/AFT_PFF.cs +++ /dev/null @@ -1,352 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)] - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(false, ThrowOnUnmappableChar = false)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(false, ThrowOnUnmappableChar = false)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tcbs6"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs7"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tcbs8"); - } - - static void testLPStrBufferStringBuilder() - { - StringBuilder sb = GetInvalidStringBuilder(); - Assert.IsTrue(LPStrBuffer_In_StringBuilder(sb), "[Error] Location tlpsbsb1"); - - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4"); - - cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferStruct() - { - LPStrTestStruct lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Struct_String(lpss), "[Error] Location tlpsbst1"); - - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct cTemp = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3"); - - cTemp = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4"); - - cTemp = GetInvalidStruct(); - LPStrTestStruct cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5"); - Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst6"); - - cTemp = GetValidStruct(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst7"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst8"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass lpss = new LPStrTestClass(); - lpss.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc1"); - - lpss.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc2"); - - LPStrTestClass cTemp = new LPStrTestClass(); - cTemp.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3"); - - cTemp.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4"); - - cTemp.str = GetInvalidString(); - LPStrTestClass cTempClone = new LPStrTestClass(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5"); - Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc6"); - - cTemp.str = GetValidString(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc7"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc8"); - } - - static void testLPStrBufferArray() - { - String[] lpss = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(lpss), "[Error] Location tlpsba1"); - Assert.IsTrue(LPStrBuffer_In_Array_String(GetValidArray()), "[Error] Location tlpsba2"); - - String[] cTemp = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3"); - - cTemp = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4"); - - cTemp = GetInvalidArray(); - String[] cTempClone = new String[3]; - cTempClone[0] = cTemp[0]; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5"); - Assert.AreNotEqual(cTempClone[0], cTemp[0], "[Error] Location ttlpsba6"); - - cTemp = GetValidArray(); - cTempClone[0] = cTemp[0]; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba7"); - Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba8"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - LPStrTestStruct[] lpssClone = new LPStrTestStruct[2]; - lpssClone[0].str = lpss[0].str; - lpssClone[1].str = lpss[1].str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - Assert.AreNotEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos6"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - lpssClone = new LPStrTestStruct[2]; - lpssClone[0].str = lpss[0].str; - lpssClone[1].str = lpss[1].str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos7"); - Assert.AreEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos8"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PFF/AFT_PFF.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PFF/AFT_PFF.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PFF/AFT_PFF.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PFT/AFT_PFT.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PFT/AFT_PFT.cs deleted file mode 100644 index a2abff36585f26..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PFT/AFT_PFT.cs +++ /dev/null @@ -1,341 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)] - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(false, ThrowOnUnmappableChar = true)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(false, ThrowOnUnmappableChar = true)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.Throws(() => LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4"); - - cTemp = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - - cTemp = GetValidString(); - String cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs7"); - } - - static void testLPStrBufferStringBuilder() - { - Assert.Throws(() => LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1"); - - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4"); - - cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - - cTemp = GetValidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb7"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferStruct() - { - Assert.Throws(() => LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1"); - - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct cTemp = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3"); - - cTemp = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4"); - - cTemp = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5"); - - cTemp = GetValidStruct(); - LPStrTestStruct cTempClone = new LPStrTestStruct(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst6"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst7"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass cTest = new LPStrTestClass(); - cTest.str = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc1"); - - cTest.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc2"); - - LPStrTestClass cTemp = new LPStrTestClass(); - cTemp.str = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3"); - - cTemp.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4"); - - cTemp.str = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5"); - - cTemp.str = GetValidString(); - LPStrTestClass cTempClone = new LPStrTestClass(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc6"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc7"); - } - - static void testLPStrBufferArray() - { - String[] cTest = null; - cTest = GetInvalidArray(); - Assert.Throws(() => LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba1"); - - cTest = GetValidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba2"); - - String[] cTemp = GetInvalidArray(); - Assert.Throws(() => LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3"); - - cTemp = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4"); - - cTemp = GetInvalidArray(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5"); - - cTemp = GetValidArray(); - String[] cTempClone = new String[3]; - cTempClone[0] = cTemp[0]; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba6"); - Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba7"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = null; - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - LPStrTestStruct[] lpssClone = new LPStrTestStruct[2]; - lpssClone[0].str = lpss[0].str; - lpssClone[1].str = lpss[1].str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6"); - Assert.AreEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos7"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PFT/AFT_PFT.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PFT/AFT_PFT.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PFT/AFT_PFT.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PTF/AFT_PTF.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PTF/AFT_PTF.cs deleted file mode 100644 index dded63727d4d25..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PTF/AFT_PTF.cs +++ /dev/null @@ -1,335 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)] - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true, ThrowOnUnmappableChar = false)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true, ThrowOnUnmappableChar = false)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs4"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs6"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs7"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tlpsbs8"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs9"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs10"); - } - - static void testLPStrBufferStringBuilder() - { - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1"); - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb4"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb9"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb10"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static void testLPStrBufferStruct() - { - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1"); - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4"); - - lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6"); - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferArray() - { - String[] s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass sClass = new LPStrTestClass(); - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc1"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc2"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc3"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc4"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc5"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc6"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PTF/AFT_PTF.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PTF/AFT_PTF.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PTF/AFT_PTF.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PTT/AFT_PTT.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PTT/AFT_PTT.cs deleted file mode 100644 index 3d4cbc28e6b289..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PTT/AFT_PTT.cs +++ /dev/null @@ -1,363 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - - -[assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)] - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true)] -public struct LPStrTestStruct_nothrow -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true, ThrowOnUnmappableChar = true)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true, ThrowOnUnmappableChar = true)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Struct_String_nothrow([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct_nothrow strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6"); - } - - static void testLPStrBufferStringBuilder() - { - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1"); - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static LPStrTestStruct_nothrow GetInvalidStruct_nothrow() - { - LPStrTestStruct_nothrow inValidStruct = new LPStrTestStruct_nothrow(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - static LPStrTestStruct_nothrow GetValidStruct_nothrow() - { - LPStrTestStruct_nothrow validStruct = new LPStrTestStruct_nothrow(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static void testLPStrBufferStruct() - { - LPStrTestStruct_nothrow lpss_nt = GetInvalidStruct_nothrow(); - Assert.IsTrue(LPStrBuffer_In_Struct_String_nothrow(lpss_nt), "[Error] Location tlpsbst1"); - - lpss_nt = GetValidStruct_nothrow(); - Assert.IsTrue(LPStrBuffer_In_Struct_String_nothrow(lpss_nt), "[Error] Location tlpsbst2"); - - LPStrTestStruct lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Struct_String(lpss), "[Error] Location tlpsbst3"); - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst4"); - - lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6"); - - lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst7"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst8"); - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferArray() - { - String[] s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass sClass = new LPStrTestClass(); - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc1"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc2"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc3"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc4"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc5"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc6"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PTT/AFT_PTT.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PTT/AFT_PTT.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/AFT_PTT/AFT_PTT.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PFF/ATF_PFF.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PFF/ATF_PFF.cs deleted file mode 100644 index 479f2800c3cc88..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PFF/ATF_PFF.cs +++ /dev/null @@ -1,351 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)] - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(false, ThrowOnUnmappableChar = false)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(false, ThrowOnUnmappableChar = false)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4"); - - cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tlpsbs6"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs7"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs8"); - } - - static void testLPStrBufferStringBuilder() - { - StringBuilder sb = GetInvalidStringBuilder(); - Assert.IsTrue(LPStrBuffer_In_StringBuilder(sb), "[Error] Location tlpsbsb1"); - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4"); - - cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferStruct() - { - LPStrTestStruct lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Struct_String(lpss), "[Error] Location tlpsbst1"); - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct cTemp = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3"); - - cTemp = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4"); - - cTemp = GetInvalidStruct(); - LPStrTestStruct cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5"); - Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst6"); - - cTemp = GetValidStruct(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst7"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst8"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass lpss = new LPStrTestClass(); - lpss.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc1"); - - lpss.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc2"); - - LPStrTestClass cTemp = new LPStrTestClass(); - cTemp.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3"); - - cTemp.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4"); - - cTemp.str = GetInvalidString(); - LPStrTestClass cTempClone = new LPStrTestClass(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5"); - Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc6"); - - cTemp.str = GetValidString(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc7"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc8"); - } - - static void testLPStrBufferArray() - { - String[] lpss = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(lpss), "[Error] Location tlpsba1"); - Assert.IsTrue(LPStrBuffer_In_Array_String(GetValidArray()), "[Error] Location tlpsba2"); - - String[] cTemp = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3"); - - cTemp = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4"); - - cTemp = GetInvalidArray(); - String[] cTempClone = new String[3]; - cTempClone[0] = cTemp[0]; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5"); - Assert.AreNotEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba6"); - - cTemp = GetValidArray(); - cTempClone[0] = cTemp[0]; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba7"); - Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba8"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - - LPStrTestStruct[] lpssClone = new LPStrTestStruct[2]; - lpssClone[0].str = lpss[0].str; - lpssClone[1].str = lpss[1].str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - Assert.AreNotEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos6"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - lpssClone = new LPStrTestStruct[2]; - lpssClone[0].str = lpss[0].str; - lpssClone[1].str = lpss[1].str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos7"); - Assert.AreEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos8"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PFF/ATF_PFF.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PFF/ATF_PFF.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PFF/ATF_PFF.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PFT/ATF_PFT.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PFT/ATF_PFT.cs deleted file mode 100644 index bb7485d5148a4c..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PFT/ATF_PFT.cs +++ /dev/null @@ -1,339 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)] - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(false, ThrowOnUnmappableChar = true)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(false, ThrowOnUnmappableChar = true)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.Throws(() => LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4"); - - cTemp = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - - cTemp = GetValidString(); - String cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs7"); - } - - static void testLPStrBufferStringBuilder() - { - Assert.Throws(() => LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1"); - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4"); - - cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - - cTemp = GetValidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb7"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferStruct() - { - Assert.Throws(() => LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1"); - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct cTemp = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3"); - - cTemp = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4"); - - cTemp = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5"); - - cTemp = GetValidStruct(); - LPStrTestStruct cTempClone = new LPStrTestStruct(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst6"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst7"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass cTest = new LPStrTestClass(); - cTest.str = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc1"); - - cTest.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc2"); - - LPStrTestClass cTemp = new LPStrTestClass(); - cTemp.str = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3"); - - cTemp.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4"); - - cTemp.str = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5"); - - cTemp.str = GetValidString(); - LPStrTestClass cTempClone = new LPStrTestClass(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc6"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc7"); - } - - static void testLPStrBufferArray() - { - String[] cTest = null; - cTest = GetInvalidArray(); - Assert.Throws(() => LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba1"); - - cTest = GetValidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba2"); - - String[] cTemp = GetInvalidArray(); - Assert.Throws(() => LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3"); - - cTemp = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4"); - - cTemp = GetInvalidArray(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5"); - - cTemp = GetValidArray(); - String[] cTempClone = new String[3]; - cTempClone[0] = cTemp[0]; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba6"); - Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba7"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = null; - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - LPStrTestStruct[] lpssClone = new LPStrTestStruct[2]; - lpssClone[0].str = lpss[0].str; - lpssClone[1].str = lpss[1].str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6"); - Assert.AreEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos7"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PFT/ATF_PFT.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PFT/ATF_PFT.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PFT/ATF_PFT.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PTF/ATF_PTF.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PTF/ATF_PTF.cs deleted file mode 100644 index 52a11c952fc940..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PTF/ATF_PTF.cs +++ /dev/null @@ -1,336 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)] - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true, ThrowOnUnmappableChar = false)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true, ThrowOnUnmappableChar = false)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs4"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs6"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs7"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tlpsbs8"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs9"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs10"); - } - - static void testLPStrBufferStringBuilder() - { - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1"); - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb4"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb9"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb10"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static void testLPStrBufferStruct() - { - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1"); - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4"); - - lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6"); - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferArray() - { - String[] s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass sClass = new LPStrTestClass(); - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc1"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc2"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc3"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc4"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc5"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc6"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PTF/ATF_PTF.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PTF/ATF_PTF.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PTF/ATF_PTF.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PTT/ATF_PTT.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PTT/ATF_PTT.cs deleted file mode 100644 index 1b4479434818aa..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PTT/ATF_PTT.cs +++ /dev/null @@ -1,328 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)] - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true, ThrowOnUnmappableChar = true)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true, ThrowOnUnmappableChar = true)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6"); - } - - static void testLPStrBufferStringBuilder() - { - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1"); - - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static void testLPStrBufferStruct() - { - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1"); - - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4"); - - lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6"); - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferArray() - { - String[] s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass sClass = new LPStrTestClass(); - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpbc1"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpbc2"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpbc3"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpbc4"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpbc5"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpbc6"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PTT/ATF_PTT.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PTT/ATF_PTT.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATF_PTT/ATF_PTT.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PFF/ATT_PFF.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PFF/ATT_PFF.cs deleted file mode 100644 index b9b698d7d4c25a..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PFF/ATT_PFF.cs +++ /dev/null @@ -1,353 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)] - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(false, ThrowOnUnmappableChar = false)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(false, ThrowOnUnmappableChar = false)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4"); - - cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tlpsbs6"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs7"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs6"); - } - - static void testLPStrBufferStringBuilder() - { - StringBuilder sb = GetInvalidStringBuilder(); - Assert.IsTrue(LPStrBuffer_In_StringBuilder(sb), "[Error] Location tlpsbsb1"); - - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4"); - - cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferStruct() - { - LPStrTestStruct lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Struct_String(lpss), "[Error] Location tlpsbst1"); - - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct cTemp = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3"); - - cTemp = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4"); - - cTemp = GetInvalidStruct(); - LPStrTestStruct cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5"); - Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbsqt6"); - - cTemp = GetValidStruct(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst7"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst8"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass lpss = new LPStrTestClass(); - lpss.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc1"); - - lpss.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc2"); - - LPStrTestClass cTemp = new LPStrTestClass(); - cTemp.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3"); - - cTemp.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4"); - - cTemp.str = GetInvalidString(); - LPStrTestClass cTempClone = new LPStrTestClass(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5"); - Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc6"); - - cTemp.str = GetValidString(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc7"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc8"); - } - - static void testLPStrBufferArray() - { - String[] lpss = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(lpss), "[Error] Location tlpsba1"); - - Assert.IsTrue(LPStrBuffer_In_Array_String(GetValidArray()), "[Error] Location tlpsba2"); - - String[] cTemp = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3"); - - cTemp = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4"); - - cTemp = GetInvalidArray(); - String[] cTempClone = new String[3]; - cTempClone[0] = cTemp[0]; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5"); - Assert.AreNotEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba6"); - - cTemp = GetValidArray(); - cTempClone[0] = cTemp[0]; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba7"); - Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba8"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - LPStrTestStruct[] lpssClone = new LPStrTestStruct[2]; - lpssClone[0].str = lpss[0].str; - lpssClone[1].str = lpss[1].str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - Assert.AreNotEqual(lpssClone[0].str, lpss[0].str, "[Error] Location tlpsbaos6"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - lpssClone = new LPStrTestStruct[2]; - lpssClone[0].str = lpss[0].str; - lpssClone[1].str = lpss[1].str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos7"); - Assert.AreEqual(lpssClone[0].str, lpss[0].str, "[Error] Location tlpsbaos8"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PFF/ATT_PFF.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PFF/ATT_PFF.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PFF/ATT_PFF.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PFT/ATT_PFT.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PFT/ATT_PFT.cs deleted file mode 100644 index 79991c04b8474a..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PFT/ATT_PFT.cs +++ /dev/null @@ -1,342 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)] - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(false, ThrowOnUnmappableChar = true)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(false, ThrowOnUnmappableChar = true)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.Throws(() => LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4"); - - cTemp = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - - cTemp = GetValidString(); - String cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6"); - - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs7"); - } - - static void testLPStrBufferStringBuilder() - { - Assert.Throws(() => LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1"); - - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4"); - - cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - - cTemp = GetValidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb7"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferStruct() - { - Assert.Throws(() => LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1"); - - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct cTemp = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3"); - - cTemp = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4"); - - cTemp = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5"); - - cTemp = GetValidStruct(); - LPStrTestStruct cTempClone = new LPStrTestStruct(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst6"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst7"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass cTest = new LPStrTestClass(); - cTest.str = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc1"); - - cTest.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc2"); - - LPStrTestClass cTemp = new LPStrTestClass(); - cTemp.str = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3"); - - cTemp.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4"); - - cTemp.str = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5"); - - cTemp.str = GetValidString(); - LPStrTestClass cTempClone = new LPStrTestClass(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc6"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc7"); - } - - static void testLPStrBufferArray() - { - String[] cTest = null; - cTest = GetInvalidArray(); - Assert.Throws(() => LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba1"); - - cTest = GetValidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba2"); - - String[] cTemp = GetInvalidArray(); - Assert.Throws(() => LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3"); - - cTemp = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4"); - - cTemp = GetInvalidArray(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5"); - - cTemp = GetValidArray(); - String[] cTempClone = new String[3]; - cTempClone[0] = cTemp[0]; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba6"); - Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba7"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = null; - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - - LPStrTestStruct[] lpssClone = new LPStrTestStruct[2]; - lpssClone[0].str = lpss[0].str; - lpssClone[1].str = lpss[1].str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6"); - Assert.AreEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos7"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PFT/ATT_PFT.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PFT/ATT_PFT.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PFT/ATT_PFT.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PTF/ATT_PTF.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PTF/ATT_PTF.cs deleted file mode 100644 index 2c39b483b5eb6f..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PTF/ATT_PTF.cs +++ /dev/null @@ -1,337 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)] - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true, ThrowOnUnmappableChar = false)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true, ThrowOnUnmappableChar = false)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs4"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs6"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs7"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tlpsbs8"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs9"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs10"); - } - - static void testLPStrBufferStringBuilder() - { - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1"); - - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb4"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb9"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb10"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static void testLPStrBufferStruct() - { - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1"); - - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4"); - - lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6"); - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferArray() - { - String[] s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass sClass = new LPStrTestClass(); - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpbc1"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpbc2"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpbc3"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpbc4"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpbc5"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpbc6"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PTF/ATT_PTF.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PTF/ATT_PTF.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PTF/ATT_PTF.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PTT/ATT_PTT.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PTT/ATT_PTT.cs deleted file mode 100644 index 2e4713bc3317d7..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PTT/ATT_PTT.cs +++ /dev/null @@ -1,330 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)] - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true, ThrowOnUnmappableChar = true)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true, ThrowOnUnmappableChar = true)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6"); - } - - static void testLPStrBufferStringBuilder() - { - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1"); - - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static void testLPStrBufferStruct() - { - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1"); - - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4"); - - lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6"); - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferArray() - { - String[] s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass sClass = new LPStrTestClass(); - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpbc1"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpbc2"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpbc3"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpbc4"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpbc5"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpbc6"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PTT/ATT_PTT.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PTT/ATT_PTT.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/ATT_PTT/ATT_PTT.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_False_False/Assembly_False_False.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_False_False/Assembly_False_False.cs deleted file mode 100644 index a2d95008620017..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_False_False/Assembly_False_False.cs +++ /dev/null @@ -1,348 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(false, ThrowOnUnmappableChar = false)] - -[StructLayout(LayoutKind.Sequential)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4"); - - cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tlpsbs6"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs7"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs8"); - } - - static void testLPStrBufferStringBuilder() - { - StringBuilder sb = GetInvalidStringBuilder(); - Assert.IsTrue(LPStrBuffer_In_StringBuilder(sb), "[Error] Location tlpsbsb1"); - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4"); - - cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferStruct() - { - LPStrTestStruct lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Struct_String(lpss), "[Error] Location tlpsbst1"); - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct cTemp = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3"); - - cTemp = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4"); - - cTemp = GetInvalidStruct(); - LPStrTestStruct cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5"); - Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst6"); - - cTemp = GetValidStruct(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst7"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst8"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass lpss = new LPStrTestClass(); - lpss.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc1"); - - lpss.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc2"); - - LPStrTestClass cTemp = new LPStrTestClass(); - cTemp.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3"); - - cTemp.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4"); - - cTemp.str = GetInvalidString(); - LPStrTestClass cTempClone = new LPStrTestClass(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5"); - Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc6"); - - cTemp.str = GetValidString(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc7"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc8"); - } - - static void testLPStrBufferArray() - { - String[] lpss = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(lpss), "[Error] Location tlpsba1"); - Assert.IsTrue(LPStrBuffer_In_Array_String(GetValidArray()), "[Error] Location tlpsba2"); - - String[] cTemp = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3"); - - cTemp = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4"); - - cTemp = GetInvalidArray(); - String[] cTempClone = new String[3]; - cTempClone[0] = cTemp[0]; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5"); - Assert.AreNotEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba6"); - - cTemp = GetValidArray(); - cTempClone[0] = cTemp[0]; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba7"); - Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba8"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - LPStrTestStruct[] lpssClone = new LPStrTestStruct[2]; - lpssClone[0].str = lpss[0].str; - lpssClone[1].str = lpss[1].str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - Assert.AreNotEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos6"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - lpssClone = new LPStrTestStruct[2]; - lpssClone[0].str = lpss[0].str; - lpssClone[1].str = lpss[1].str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos7"); - Assert.AreEqual(lpss[0].str, lpssClone[0].str , "[Error] Location tlpsbaos8"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_False_False/Assembly_False_False.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_False_False/Assembly_False_False.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_False_False/Assembly_False_False.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_False_True/Assembly_False_True.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_False_True/Assembly_False_True.cs deleted file mode 100644 index c86d0baa130e34..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_False_True/Assembly_False_True.cs +++ /dev/null @@ -1,337 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(false, ThrowOnUnmappableChar = true)] - -[StructLayout(LayoutKind.Sequential)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.Throws(() => LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4"); - - cTemp = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - - cTemp = GetValidString(); - String cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs7"); - } - - static void testLPStrBufferStringBuilder() - { - Assert.Throws(() => LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1"); - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4"); - - cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - - cTemp = GetValidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString() , "[Error] Location tlpsbsb7"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferStruct() - { - Assert.Throws(() => LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1"); - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct cTemp = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3"); - - cTemp = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4"); - - cTemp = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5"); - - cTemp = GetValidStruct(); - LPStrTestStruct cTempClone = new LPStrTestStruct(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst6"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst7"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass cTest = new LPStrTestClass(); - cTest.str = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc1"); - - cTest.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc2"); - - LPStrTestClass cTemp = new LPStrTestClass(); - cTemp.str = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3"); - - cTemp.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4"); - - cTemp.str = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5"); - - cTemp.str = GetValidString(); - LPStrTestClass cTempClone = new LPStrTestClass(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc6"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc7"); - } - - static void testLPStrBufferArray() - { - String[] cTest = null; - cTest = GetInvalidArray(); - Assert.Throws(() => LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba1"); - - cTest = GetValidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba2"); - - String[] cTemp = GetInvalidArray(); - Assert.Throws(() => LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3"); - - cTemp = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4"); - - cTemp = GetInvalidArray(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5"); - - cTemp = GetValidArray(); - String[] cTempClone = new String[3]; - cTempClone[0] = cTemp[0]; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba6"); - Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba7"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = null; - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - LPStrTestStruct[] lpssClone = new LPStrTestStruct[2]; - lpssClone[0].str = lpss[0].str; - lpssClone[1].str = lpss[1].str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6"); - Assert.AreEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos7"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_False_True/Assembly_False_True.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_False_True/Assembly_False_True.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_False_True/Assembly_False_True.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_True_False/Assembly_True_False.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_True_False/Assembly_True_False.cs deleted file mode 100644 index 87fddf06a35842..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_True_False/Assembly_True_False.cs +++ /dev/null @@ -1,333 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(true, ThrowOnUnmappableChar = false)] - -[StructLayout(LayoutKind.Sequential)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs4"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs6"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs7"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tlpsbs8"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs9"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs10"); - } - - static void testLPStrBufferStringBuilder() - { - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1"); - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb4"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb9"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb10"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static void testLPStrBufferStruct() - { - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1"); - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4"); - - lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6"); - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferArray() - { - String[] s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass sClass = new LPStrTestClass(); - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc1"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc2"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc3"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc4"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc5"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc6"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_True_False/Assembly_True_False.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_True_False/Assembly_True_False.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_True_False/Assembly_True_False.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_True_True/Assembly_True_True.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_True_True/Assembly_True_True.cs deleted file mode 100644 index b52de3aa8bcb25..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_True_True/Assembly_True_True.cs +++ /dev/null @@ -1,329 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[assembly: BestFitMapping(true, ThrowOnUnmappableChar = true)] - -[StructLayout(LayoutKind.Sequential)] -//[BestFitMapping(true, ThrowOnUnmappableChar=true)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -//[BestFitMapping(true, ThrowOnUnmappableChar=true)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative")] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6"); - - } - - static void testLPStrBufferStringBuilder() - { - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1"); - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static void testLPStrBufferStruct() - { - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1"); - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4"); - - lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6"); - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferArray() - { - String[] s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass sClass = new LPStrTestClass(); - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc1"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc2"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc3"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc4"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc5"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc6"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_True_True/Assembly_True_True.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_True_True/Assembly_True_True.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Assembly_True_True/Assembly_True_True.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/PInvoke_Default.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/PInvoke_Default.cs new file mode 100644 index 00000000000000..422ac57c5918c6 --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/PInvoke_Default.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. + +using System; +using System.Text; +using System.Runtime.InteropServices; + +using static TestData; + +namespace LPStr; + +public partial class PInvoke_Default +{ + [StructLayout(LayoutKind.Sequential)] + public struct LPStrTestStruct + { + [MarshalAs(UnmanagedType.LPStr)] + public String str; + } + + [StructLayout(LayoutKind.Sequential)] + public class LPStrTestClass + { + [MarshalAs(UnmanagedType.LPStr)] + public String str; + } + + [DllImport("LPStr_BestFitMappingNative")] + public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); + + [DllImport("LPStr_BestFitMappingNative")] + public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); + + [DllImport("LPStr_BestFitMappingNative")] + public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); + + [DllImport("LPStr_BestFitMappingNative")] + public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); + + [DllImport("LPStr_BestFitMappingNative")] + public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); + + [DllImport("LPStr_BestFitMappingNative")] + public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); + + [DllImport("LPStr_BestFitMappingNative")] + public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); + + [DllImport("LPStr_BestFitMappingNative")] + public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); + + [DllImport("LPStr_BestFitMappingNative")] + public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); + + [DllImport("LPStr_BestFitMappingNative")] + public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); + + [DllImport("LPStr_BestFitMappingNative")] + public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); + + [DllImport("LPStr_BestFitMappingNative")] + public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); + + [DllImport("LPStr_BestFitMappingNative")] + public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); + + [DllImport("LPStr_BestFitMappingNative")] + public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); + + [DllImport("LPStr_BestFitMappingNative")] + public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); + + [DllImport("LPStr_BestFitMappingNative")] + public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); + + [DllImport("LPStr_BestFitMappingNative")] + public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); + + [DllImport("LPStr_BestFitMappingNative")] + public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); + + private static LPStrTestStruct GetInvalidStruct() => new LPStrTestStruct() { str = InvalidString }; + private static LPStrTestStruct GetUnmappableStruct() => new LPStrTestStruct() { str = UnmappableString }; + private static LPStrTestStruct GetValidStruct() => new LPStrTestStruct() { str = ValidString }; + + private static unsafe void RunTest(bool bestFitMapping, bool throwOnUnmappableChar) + { + Console.WriteLine(" -- Validate P/Invokes: BestFitMapping not set, ThrowOnUnmappableChar not set"); + + Test.ValidateString( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_String, + &LPStrBuffer_InByRef_String, + &LPStrBuffer_InOutByRef_String)); + + Test.ValidateStringBuilder( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_StringBuilder, + &LPStrBuffer_InByRef_StringBuilder, + &LPStrBuffer_InOutByRef_StringBuilder)); + + Test.ValidateStringArray( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_Array_String, + &LPStrBuffer_InByRef_Array_String, + &LPStrBuffer_InOutByRef_Array_String)); + + Test.Validate( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_Struct_String, + &LPStrBuffer_InByRef_Struct_String, + &LPStrBuffer_InOutByRef_Struct_String), + new Test.DataContext( + GetInvalidStruct(), + GetUnmappableStruct(), + GetValidStruct(), + (LPStrTestStruct s) => s.str)); + + Test.Validate( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_Class_String, + &LPStrBuffer_InByRef_Class_String, + &LPStrBuffer_InOutByRef_Class_String), + new Test.DataContext( + new LPStrTestClass() { str = InvalidString }, + new LPStrTestClass() { str = UnmappableString }, + new LPStrTestClass() { str = ValidString }, + (LPStrTestClass s) => s.str)); + + Test.Validate( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_Array_Struct, + &LPStrBuffer_InByRef_Array_Struct, + &LPStrBuffer_InOutByRef_Array_Struct), + new Test.DataContext( + new LPStrTestStruct[] { GetInvalidStruct(), GetInvalidStruct() }, + new LPStrTestStruct[] { GetUnmappableStruct(), GetUnmappableStruct() }, + new LPStrTestStruct[] { GetValidStruct(), GetValidStruct() }, + (LPStrTestStruct[] s) => s[0].str)); + } +} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/PInvoke_False_False.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/PInvoke_False_False.cs new file mode 100644 index 00000000000000..cf0ee9632f769c --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/PInvoke_False_False.cs @@ -0,0 +1,158 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Text; +using System.Runtime.InteropServices; + +using static TestData; + +namespace LPStr; + +public class PInvoke_False_False +{ + [StructLayout(LayoutKind.Sequential)] + [BestFitMapping(false, ThrowOnUnmappableChar = false)] + public struct LPStrTestStruct + { + [MarshalAs(UnmanagedType.LPStr)] + public String str; + } + + [StructLayout(LayoutKind.Sequential)] + [BestFitMapping(false, ThrowOnUnmappableChar = false)] + public class LPStrTestClass + { + [MarshalAs(UnmanagedType.LPStr)] + public String str; + } + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); + + private static LPStrTestStruct GetInvalidStruct() => new LPStrTestStruct() { str = InvalidString }; + private static LPStrTestStruct GetUnmappableStruct() => new LPStrTestStruct() { str = UnmappableString }; + private static LPStrTestStruct GetValidStruct() => new LPStrTestStruct() { str = ValidString }; + + public static unsafe void RunTest() + { + Console.WriteLine(" -- Validate P/Invokes: BestFitMapping=false, ThrowOnUnmappableChar=false"); + + bool bestFitMapping = false; + bool throwOnUnmappableChar = false; + + Test.ValidateString( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_String, + &LPStrBuffer_InByRef_String, + &LPStrBuffer_InOutByRef_String)); + + Test.ValidateStringBuilder( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_StringBuilder, + &LPStrBuffer_InByRef_StringBuilder, + &LPStrBuffer_InOutByRef_StringBuilder)); + + Test.ValidateStringArray( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_Array_String, + &LPStrBuffer_InByRef_Array_String, + &LPStrBuffer_InOutByRef_Array_String)); + + Test.Validate( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_Struct_String, + &LPStrBuffer_InByRef_Struct_String, + &LPStrBuffer_InOutByRef_Struct_String), + new Test.DataContext( + GetInvalidStruct(), + GetUnmappableStruct(), + GetValidStruct(), + (LPStrTestStruct s) => s.str)); + + Test.Validate( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_Class_String, + &LPStrBuffer_InByRef_Class_String, + &LPStrBuffer_InOutByRef_Class_String), + new Test.DataContext( + new LPStrTestClass() { str = InvalidString }, + new LPStrTestClass() { str = UnmappableString }, + new LPStrTestClass() { str = ValidString }, + (LPStrTestClass s) => s.str)); + + Test.Validate( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_Array_Struct, + &LPStrBuffer_InByRef_Array_Struct, + &LPStrBuffer_InOutByRef_Array_Struct), + new Test.DataContext( + new LPStrTestStruct[] { GetInvalidStruct(), GetInvalidStruct() }, + new LPStrTestStruct[] { GetUnmappableStruct(), GetUnmappableStruct() }, + new LPStrTestStruct[] { GetValidStruct(), GetValidStruct() }, + (LPStrTestStruct[] s) => s[0].str)); + } +} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/PInvoke_False_True.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/PInvoke_False_True.cs new file mode 100644 index 00000000000000..efd6effa7296d5 --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/PInvoke_False_True.cs @@ -0,0 +1,158 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Text; +using System.Runtime.InteropServices; + +using static TestData; + +namespace LPStr; + +public class PInvoke_False_True +{ + [StructLayout(LayoutKind.Sequential)] + [BestFitMapping(false, ThrowOnUnmappableChar = true)] + public struct LPStrTestStruct + { + [MarshalAs(UnmanagedType.LPStr)] + public String str; + } + + [StructLayout(LayoutKind.Sequential)] + [BestFitMapping(false, ThrowOnUnmappableChar = true)] + public class LPStrTestClass + { + [MarshalAs(UnmanagedType.LPStr)] + public String str; + } + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); + + private static LPStrTestStruct GetInvalidStruct() => new LPStrTestStruct() { str = InvalidString }; + private static LPStrTestStruct GetUnmappableStruct() => new LPStrTestStruct() { str = UnmappableString }; + private static LPStrTestStruct GetValidStruct() => new LPStrTestStruct() { str = ValidString }; + + public static unsafe void RunTest() + { + Console.WriteLine(" -- Validate P/Invokes: BestFitMapping=false, ThrowOnUnmappableChar=true"); + + bool bestFitMapping = false; + bool throwOnUnmappableChar = true; + + Test.ValidateString( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_String, + &LPStrBuffer_InByRef_String, + &LPStrBuffer_InOutByRef_String)); + + Test.ValidateStringBuilder( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_StringBuilder, + &LPStrBuffer_InByRef_StringBuilder, + &LPStrBuffer_InOutByRef_StringBuilder)); + + Test.ValidateStringArray( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_Array_String, + &LPStrBuffer_InByRef_Array_String, + &LPStrBuffer_InOutByRef_Array_String)); + + Test.Validate( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_Struct_String, + &LPStrBuffer_InByRef_Struct_String, + &LPStrBuffer_InOutByRef_Struct_String), + new Test.DataContext( + GetInvalidStruct(), + GetUnmappableStruct(), + GetValidStruct(), + (LPStrTestStruct s) => s.str)); + + Test.Validate( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_Class_String, + &LPStrBuffer_InByRef_Class_String, + &LPStrBuffer_InOutByRef_Class_String), + new Test.DataContext( + new LPStrTestClass() { str = InvalidString }, + new LPStrTestClass() { str = UnmappableString }, + new LPStrTestClass() { str = ValidString }, + (LPStrTestClass s) => s.str)); + + Test.Validate( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_Array_Struct, + &LPStrBuffer_InByRef_Array_Struct, + &LPStrBuffer_InOutByRef_Array_Struct), + new Test.DataContext( + new LPStrTestStruct[] { GetInvalidStruct(), GetInvalidStruct() }, + new LPStrTestStruct[] { GetUnmappableStruct(), GetUnmappableStruct() }, + new LPStrTestStruct[] { GetValidStruct(), GetValidStruct() }, + (LPStrTestStruct[] s) => s[0].str)); + } +} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/PInvoke_True_False.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/PInvoke_True_False.cs new file mode 100644 index 00000000000000..4e17c9a6d64e07 --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/PInvoke_True_False.cs @@ -0,0 +1,157 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Text; +using System.Runtime.InteropServices; + +using static TestData; + +namespace LPStr; + +public class PInvoke_True_False +{ + [StructLayout(LayoutKind.Sequential)] + [BestFitMapping(true, ThrowOnUnmappableChar = false)] + public struct LPStrTestStruct + { + [MarshalAs(UnmanagedType.LPStr)] + public String str; + } + + [StructLayout(LayoutKind.Sequential)] + [BestFitMapping(true, ThrowOnUnmappableChar = false)] + public class LPStrTestClass + { + [MarshalAs(UnmanagedType.LPStr)] + public String str; + } + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); + + private static LPStrTestStruct GetInvalidStruct() => new LPStrTestStruct() { str = InvalidString }; + private static LPStrTestStruct GetUnmappableStruct() => new LPStrTestStruct() { str = UnmappableString }; + private static LPStrTestStruct GetValidStruct() => new LPStrTestStruct() { str = ValidString }; + public static unsafe void RunTest() + { + Console.WriteLine(" -- Validate P/Invokes: BestFitMapping=true, ThrowOnUnmappableChar=false"); + + bool bestFitMapping = true; + bool throwOnUnmappableChar = false; + + Test.ValidateString( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_String, + &LPStrBuffer_InByRef_String, + &LPStrBuffer_InOutByRef_String)); + + Test.ValidateStringBuilder( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_StringBuilder, + &LPStrBuffer_InByRef_StringBuilder, + &LPStrBuffer_InOutByRef_StringBuilder)); + + Test.ValidateStringArray( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_Array_String, + &LPStrBuffer_InByRef_Array_String, + &LPStrBuffer_InOutByRef_Array_String)); + + Test.Validate( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_Struct_String, + &LPStrBuffer_InByRef_Struct_String, + &LPStrBuffer_InOutByRef_Struct_String), + new Test.DataContext( + GetInvalidStruct(), + GetUnmappableStruct(), + GetValidStruct(), + (LPStrTestStruct s) => s.str)); + + Test.Validate( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_Class_String, + &LPStrBuffer_InByRef_Class_String, + &LPStrBuffer_InOutByRef_Class_String), + new Test.DataContext( + new LPStrTestClass() { str = InvalidString }, + new LPStrTestClass() { str = UnmappableString }, + new LPStrTestClass() { str = ValidString }, + (LPStrTestClass s) => s.str)); + + Test.Validate( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_Array_Struct, + &LPStrBuffer_InByRef_Array_Struct, + &LPStrBuffer_InOutByRef_Array_Struct), + new Test.DataContext( + new LPStrTestStruct[] { GetInvalidStruct(), GetInvalidStruct() }, + new LPStrTestStruct[] { GetUnmappableStruct(), GetUnmappableStruct() }, + new LPStrTestStruct[] { GetValidStruct(), GetValidStruct() }, + (LPStrTestStruct[] s) => s[0].str)); + } +} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/PInvoke_True_True.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/PInvoke_True_True.cs new file mode 100644 index 00000000000000..0b32243ab9e1ae --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/PInvoke_True_True.cs @@ -0,0 +1,158 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Text; +using System.Runtime.InteropServices; + +using static TestData; + +namespace LPStr; + +public class PInvoke_True_True +{ + [StructLayout(LayoutKind.Sequential)] + [BestFitMapping(true, ThrowOnUnmappableChar = true)] + public struct LPStrTestStruct + { + [MarshalAs(UnmanagedType.LPStr)] + public String str; + } + + [StructLayout(LayoutKind.Sequential)] + [BestFitMapping(true, ThrowOnUnmappableChar = true)] + public class LPStrTestClass + { + [MarshalAs(UnmanagedType.LPStr)] + public String str; + } + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] + public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); + + [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] + public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); + + private static LPStrTestStruct GetInvalidStruct() => new LPStrTestStruct() { str = InvalidString }; + private static LPStrTestStruct GetUnmappableStruct() => new LPStrTestStruct() { str = UnmappableString }; + private static LPStrTestStruct GetValidStruct() => new LPStrTestStruct() { str = ValidString }; + + public static unsafe void RunTest() + { + Console.WriteLine(" -- Validate P/Invokes: BestFitMapping=true, ThrowOnUnmappableChar=true"); + + bool bestFitMapping = true; + bool throwOnUnmappableChar = true; + + Test.ValidateString( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_String, + &LPStrBuffer_InByRef_String, + &LPStrBuffer_InOutByRef_String)); + + Test.ValidateStringBuilder( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_StringBuilder, + &LPStrBuffer_InByRef_StringBuilder, + &LPStrBuffer_InOutByRef_StringBuilder)); + + Test.ValidateStringArray( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_Array_String, + &LPStrBuffer_InByRef_Array_String, + &LPStrBuffer_InOutByRef_Array_String)); + + Test.Validate( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_Struct_String, + &LPStrBuffer_InByRef_Struct_String, + &LPStrBuffer_InOutByRef_Struct_String), + new Test.DataContext( + GetInvalidStruct(), + GetUnmappableStruct(), + GetValidStruct(), + (LPStrTestStruct s) => s.str)); + + Test.Validate( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_Class_String, + &LPStrBuffer_InByRef_Class_String, + &LPStrBuffer_InOutByRef_Class_String), + new Test.DataContext( + new LPStrTestClass() { str = InvalidString }, + new LPStrTestClass() { str = UnmappableString }, + new LPStrTestClass() { str = ValidString }, + (LPStrTestClass s) => s.str)); + + Test.Validate( + bestFitMapping, + throwOnUnmappableChar, + new Test.Functions( + &LPStrBuffer_In_Array_Struct, + &LPStrBuffer_InByRef_Array_Struct, + &LPStrBuffer_InOutByRef_Array_Struct), + new Test.DataContext( + new LPStrTestStruct[] { GetInvalidStruct(), GetInvalidStruct() }, + new LPStrTestStruct[] { GetUnmappableStruct(), GetUnmappableStruct() }, + new LPStrTestStruct[] { GetValidStruct(), GetValidStruct() }, + (LPStrTestStruct[] s) => s[0].str)); + } +} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_False_False/Pinvoke_False_False.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_False_False/Pinvoke_False_False.cs deleted file mode 100644 index 0e3e101b7c0124..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_False_False/Pinvoke_False_False.cs +++ /dev/null @@ -1,351 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(false, ThrowOnUnmappableChar = false)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(false, ThrowOnUnmappableChar = false)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4"); - - cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tlpsbs6"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs7"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs8"); - } - - static void testLPStrBufferStringBuilder() - { - StringBuilder sb = GetInvalidStringBuilder(); - Assert.IsTrue(LPStrBuffer_In_StringBuilder(sb), "[Error] Location tlpsbsb1"); - - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4"); - - cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferStruct() - { - LPStrTestStruct lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Struct_String(lpss), "[Error] Location tlpsbst1"); - - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct cTemp = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3"); - - cTemp = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4"); - - cTemp = GetInvalidStruct(); - LPStrTestStruct cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5"); - Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst6"); - - cTemp = GetValidStruct(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst7"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst8"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass lpss = new LPStrTestClass(); - lpss.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc1"); - - lpss.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(lpss), "[Error] Location tlpsbc2"); - - LPStrTestClass cTemp = new LPStrTestClass(); - cTemp.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3"); - - cTemp.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4"); - - cTemp.str = GetInvalidString(); - LPStrTestClass cTempClone = new LPStrTestClass(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5"); - Assert.AreNotEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc6"); - - cTemp.str = GetValidString(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc7"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc8"); - } - - static void testLPStrBufferArray() - { - String[] lpss = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(lpss), "[Error] Location tlpsba1"); - - Assert.IsTrue(LPStrBuffer_In_Array_String(GetValidArray()), "[Error] Location tlpsba2"); - - String[] cTemp = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3"); - - cTemp = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4"); - - cTemp = GetInvalidArray(); - String[] cTempClone = new String[3]; - cTempClone[0] = cTemp[0]; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5"); - Assert.AreNotEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba6"); - - cTemp = GetValidArray(); - cTempClone[0] = cTemp[0]; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba7"); - Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba8"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - LPStrTestStruct[] lpssClone = new LPStrTestStruct[2]; - lpssClone[0].str = lpss[0].str; - lpssClone[1].str = lpss[1].str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - Assert.AreNotEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos6"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - lpssClone = new LPStrTestStruct[2]; - lpssClone[0].str = lpss[0].str; - lpssClone[1].str = lpss[1].str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos7"); - Assert.AreEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos8"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_False_False/Pinvoke_False_False.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_False_False/Pinvoke_False_False.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_False_False/Pinvoke_False_False.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_False_True/Pinvoke_False_True.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_False_True/Pinvoke_False_True.cs deleted file mode 100644 index 82529bd4ea2461..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_False_True/Pinvoke_False_True.cs +++ /dev/null @@ -1,338 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(false, ThrowOnUnmappableChar = true)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(false, ThrowOnUnmappableChar = true)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.Throws(() => LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - - cTemp = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs4"); - - cTemp = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - - cTemp = GetValidString(); - String cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs6"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs7"); - } - - static void testLPStrBufferStringBuilder() - { - Assert.Throws(() => LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1"); - - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - - cTemp = GetValidStringBuilder(); - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb4"); - - cTemp = GetInvalidStringBuilder(); - Assert.Throws(() => LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - - cTemp = GetValidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb6"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb7"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferStruct() - { - Assert.Throws(() => LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1"); - - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct cTemp = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst3"); - - cTemp = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst4"); - - cTemp = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst5"); - - cTemp = GetValidStruct(); - LPStrTestStruct cTempClone = new LPStrTestStruct(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref cTemp), "[Error] Location tlpsbst6"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbst7"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass cTest = new LPStrTestClass(); - cTest.str = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc1"); - - cTest.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(cTest), "[Error] Location tlpsbc2"); - - LPStrTestClass cTemp = new LPStrTestClass(); - cTemp.str = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc3"); - - cTemp.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref cTemp), "[Error] Location tlpsbc4"); - - cTemp.str = GetInvalidString(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc5"); - - cTemp.str = GetValidString(); - LPStrTestClass cTempClone = new LPStrTestClass(); - cTempClone.str = cTemp.str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref cTemp), "[Error] Location tlpsbc6"); - Assert.AreEqual(cTempClone.str, cTemp.str, "[Error] Location tlpsbc7"); - } - - static void testLPStrBufferArray() - { - String[] cTest = null; - cTest = GetInvalidArray(); - Assert.Throws(() => LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba1"); - - cTest = GetValidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(cTest), "[Error] Location tlpsba2"); - - String[] cTemp = GetInvalidArray(); - Assert.Throws(() => LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba3"); - - cTemp = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref cTemp), "[Error] Location tlpsba4"); - - cTemp = GetInvalidArray(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba5"); - - cTemp = GetValidArray(); - String[] cTempClone = new String[3]; - cTempClone[0] = cTemp[0]; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref cTemp), "[Error] Location tlpsba6"); - Assert.AreEqual(cTempClone[0], cTemp[0], "[Error] Location tlpsba7"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = null; - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.Throws(() => LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - LPStrTestStruct[] lpssClone = new LPStrTestStruct[2]; - lpssClone[0].str = lpss[0].str; - lpssClone[1].str = lpss[1].str; - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6"); - Assert.AreEqual(lpss[0].str, lpssClone[0].str, "[Error] Location tlpsbaos7"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_False_True/Pinvoke_False_True.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_False_True/Pinvoke_False_True.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_False_True/Pinvoke_False_True.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_True_False/Pinvoke_True_False.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_True_False/Pinvoke_True_False.cs deleted file mode 100644 index 0e70e61cc355e5..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_True_False/Pinvoke_True_False.cs +++ /dev/null @@ -1,335 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true, ThrowOnUnmappableChar = false)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true, ThrowOnUnmappableChar = false)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - sbl.Append('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tlpsbs1"); - - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tlpsbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs3"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs4"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tlpsbs5"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs6"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs7"); - Assert.AreNotEqual(cTempClone, cTemp, "[Error] Location tlpsbs8"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tlpsbs9"); - Assert.AreEqual(cTempClone, cTemp, "[Error] Location tlpsbs10"); - } - - static void testLPStrBufferStringBuilder() - { - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tlpsbsb1"); - - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tlpsbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb3"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb4"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb5"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb6"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb7"); - Assert.AreNotEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb8"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tlpsbsb9"); - Assert.AreEqual(cTempClone.ToString(), cTemp.ToString(), "[Error] Location tlpsbsb10"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static void testLPStrBufferStruct() - { - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1"); - - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4"); - - lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6"); - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferArray() - { - String[] s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass sClass = new LPStrTestClass(); - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc1"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpsbc2"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc3"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpsbc4"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc5"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpsbc6"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos11"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_True_False/Pinvoke_True_False.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_True_False/Pinvoke_True_False.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_True_False/Pinvoke_True_False.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_True_True/Pinvoke_True_True.cs b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_True_True/Pinvoke_True_True.cs deleted file mode 100644 index 942c31a35ae887..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_True_True/Pinvoke_True_True.cs +++ /dev/null @@ -1,327 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Text; -using System.Runtime.InteropServices; -using TestLibrary; - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true, ThrowOnUnmappableChar = true)] -public struct LPStrTestStruct -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -[StructLayout(LayoutKind.Sequential)] -[BestFitMapping(true, ThrowOnUnmappableChar = true)] -public class LPStrTestClass -{ - [MarshalAs(UnmanagedType.LPStr)] - public String str; -} - -public class BFM_LPStrMarshaler -{ -#pragma warning disable 618 - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_String([In][MarshalAs(UnmanagedType.LPStr)]String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_String([In][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_String([In, Out][MarshalAs(UnmanagedType.LPStr)]ref String s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_StringBuilder([In][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_StringBuilder([In, Out][MarshalAs(UnmanagedType.LPStr)]ref StringBuilder s); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Struct_String([In][MarshalAs(UnmanagedType.Struct)]LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Struct_String([In][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Struct_String([In, Out][MarshalAs(UnmanagedType.Struct)]ref LPStrTestStruct strStruct); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Array_String([In][MarshalAs(UnmanagedType.LPArray)]String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Array_String([In][MarshalAs(UnmanagedType.LPArray)]ref String[] strArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Array_String([In, Out][MarshalAs(UnmanagedType.LPArray)]ref String[] Array); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_In_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InByRef_Class_String([In][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = true, ThrowOnUnmappableChar = true)] - public static extern bool LPStrBuffer_InOutByRef_Class_String([In, Out][MarshalAs(UnmanagedType.LPStruct)]ref LPStrTestClass strClass); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_In_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InByRef_Array_Struct([In][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); - - [DllImport("LPStr_BestFitMappingNative", BestFitMapping = false, ThrowOnUnmappableChar = false)] - public static extern bool LPStrBuffer_InOutByRef_Array_Struct([In, Out][MarshalAs(UnmanagedType.LPArray)]ref LPStrTestStruct[] structArray); -#pragma warning restore 618 - - static String GetValidString() - { - return "This is the initial test string."; - } - - static String GetInvalidString() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl.ToString(); - } - - static StringBuilder GetValidStringBuilder() - { - StringBuilder sb = new StringBuilder("test string."); - return sb; - } - - static StringBuilder GetInvalidStringBuilder() - { - StringBuilder sbl = new StringBuilder(); - sbl.Append((char)0x2216); - sbl.Append((char)0x2044); - sbl.Append((char)0x2215); - sbl.Append((char)0x0589); - sbl.Append((char)0x2236); - //sbl.Append ('乀'); - return sbl; - } - - static void testLPStrBufferString() - { - Assert.IsTrue(LPStrBuffer_In_String(GetInvalidString()), "[Error] Location tcbs1"); - - Assert.IsTrue(LPStrBuffer_In_String(GetValidString()), "[Error] Location tcbs2"); - - String cTemp = GetInvalidString(); - String cTempClone = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs3"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_String(ref cTemp), "[Error] Location tcbs4"); - - cTemp = GetInvalidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs5"); - - cTemp = GetValidString(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_String(ref cTemp), "[Error] Location tcbs6"); - } - - static void testLPStrBufferStringBuilder() - { - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetInvalidStringBuilder()), "[Error] Location tcbsb1"); - - Assert.IsTrue(LPStrBuffer_In_StringBuilder(GetValidStringBuilder()), "[Error] Location tcbsb2"); - - StringBuilder cTemp = GetInvalidStringBuilder(); - StringBuilder cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb3"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb4"); - - cTemp = GetInvalidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb5"); - - cTemp = GetValidStringBuilder(); - cTempClone = cTemp; - Assert.IsTrue(LPStrBuffer_InOutByRef_StringBuilder(ref cTemp), "[Error] Location tcbsb6"); - } - - static LPStrTestStruct GetInvalidStruct() - { - LPStrTestStruct inValidStruct = new LPStrTestStruct(); - inValidStruct.str = GetInvalidString(); - - return inValidStruct; - } - - - static LPStrTestStruct GetValidStruct() - { - LPStrTestStruct validStruct = new LPStrTestStruct(); - validStruct.str = GetValidString(); - - return validStruct; - } - - static void testLPStrBufferStruct() - { - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetInvalidStruct()), "[Error] Location tlpsbst1"); - - Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst2"); - - LPStrTestStruct lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst3"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst4"); - - lpss = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5"); - - lpss = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6"); - } - - static String[] GetValidArray() - { - String[] s = new String[3]; - - s[0] = GetValidString(); - s[1] = GetValidString(); - s[2] = GetValidString(); - - return s; - } - - static String[] GetInvalidArray() - { - String[] s = new String[3]; - - s[0] = GetInvalidString(); - s[1] = GetInvalidString(); - s[2] = GetInvalidString(); - - return s; - } - - static void testLPStrBufferArray() - { - String[] s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba1"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_In_Array_String(s), "[Error] Location tlpsba2"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba3"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_String(ref s), "[Error] Location tlpsba4"); - - s = GetInvalidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba5"); - - s = GetValidArray(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_String(ref s), "[Error] Location tlpsba6"); - } - - static void testLPStrBufferClass() - { - LPStrTestClass sClass = new LPStrTestClass(); - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpbc1"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_In_Class_String(sClass), "[Error] Location tlpbc2"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpbc3"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InByRef_Class_String(ref sClass), "[Error] Location tlpbc4"); - - sClass.str = GetInvalidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpbc5"); - - sClass.str = GetValidString(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Class_String(ref sClass), "[Error] Location tlpbc6"); - } - - static void testLPStrBufferArrayOfStructs() - { - LPStrTestStruct[] lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos1"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_In_Array_Struct(lpss), "[Error] Location tlpsbaos2"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos3"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos4"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetInvalidStruct(); - lpss[1] = GetInvalidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos5"); - - lpss = new LPStrTestStruct[2]; - lpss[0] = GetValidStruct(); - lpss[1] = GetValidStruct(); - Assert.IsTrue(LPStrBuffer_InOutByRef_Array_Struct(ref lpss), "[Error] Location tlpsbaos6"); - } - - static void runTest() - { - testLPStrBufferString(); - testLPStrBufferStringBuilder(); - testLPStrBufferStruct(); - testLPStrBufferArray(); - testLPStrBufferClass(); - testLPStrBufferArrayOfStructs(); - } - - public static int Main() - { - if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") - { - Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); - - Console.WriteLine("--- Success"); - return 100; - } - - try - { - runTest(); - return 100; - } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } - } -} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_True_True/Pinvoke_True_True.csproj b/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_True_True/Pinvoke_True_True.csproj deleted file mode 100644 index dcb39b6b27c578..00000000000000 --- a/src/tests/Interop/PInvoke/BestFitMapping/LPStr/Pinvoke_True_True/Pinvoke_True_True.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - - true - - - - - - - - diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Program.cs b/src/tests/Interop/PInvoke/BestFitMapping/Program.cs new file mode 100644 index 00000000000000..e9e0725fe49f72 --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/Program.cs @@ -0,0 +1,42 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Text; +using System.Runtime.InteropServices; +using TestLibrary; + +public class Program +{ + public static int Main() + { + if (System.Globalization.CultureInfo.CurrentCulture.Name != "en-US") + { + Console.WriteLine("Non-US English platforms are not supported.\nPassing without running tests"); + + Console.WriteLine("--- Success"); + return 100; + } + + try + { + Console.WriteLine("Validating char marshalling..."); + Char.PInvoke_Default.RunTest(); + Char.PInvoke_False_False.RunTest(); + Char.PInvoke_False_True.RunTest(); + Char.PInvoke_True_False.RunTest(); + Char.PInvoke_True_True.RunTest(); + + Console.WriteLine("Validating LPStr marshalling..."); + LPStr.PInvoke_Default.RunTest(); + LPStr.PInvoke_False_False.RunTest(); + LPStr.PInvoke_False_True.RunTest(); + LPStr.PInvoke_True_False.RunTest(); + LPStr.PInvoke_True_True.RunTest(); + return 100; + } catch (Exception e){ + Console.WriteLine($"Test Failure: {e}"); + return 101; + } + } +} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/Test.cs b/src/tests/Interop/PInvoke/BestFitMapping/Test.cs new file mode 100644 index 00000000000000..936ebecd45d3ea --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/Test.cs @@ -0,0 +1,121 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Text; +using System.Runtime.InteropServices; +using Xunit; + +using static TestData; + +internal unsafe class Test +{ + internal record DataContext(T Invalid, T Unmappable, T Valid, Func GetValueToCompare); + + internal readonly struct Functions + { + public Functions( + delegate* inByValue, + delegate* inByRef, + delegate* inOutByRef) + { + In = inByValue; + InByRef = inByRef; + InOutByRef = inOutByRef; + } + + public readonly delegate* In; + public readonly delegate* InByRef; + public readonly delegate* InOutByRef; + } + + public static void Validate(bool bestFitMapping, bool throwOnUnmappableChar, Functions funcs, DataContext data) + { + Console.WriteLine($" ---- Marshal {typeof(T).Name}"); + + bool shouldThrowOnInvalid = !bestFitMapping && throwOnUnmappableChar; + + T invalid = data.Invalid; + if (shouldThrowOnInvalid) + { + Assert.Throws(() => funcs.In(invalid)); + + invalid = data.Invalid; + Assert.Throws(() => funcs.InByRef(ref invalid)); + + invalid = data.Invalid; + Assert.Throws(() => funcs.InOutByRef(ref invalid)); + } + else + { + Assert.True(funcs.In(invalid)); + + invalid = data.Invalid; + Assert.True(funcs.InByRef(ref invalid)); + Assert.Equal(data.GetValueToCompare(data.Invalid), data.GetValueToCompare(invalid)); + + invalid = data.Invalid; + Assert.True(funcs.InOutByRef(ref invalid)); + Assert.NotEqual(data.GetValueToCompare(data.Invalid), data.GetValueToCompare(invalid)); + } + + T unmappable = data.Unmappable; + if (throwOnUnmappableChar) + { + Assert.Throws(() => funcs.In(unmappable)); + + unmappable = data.Unmappable; + Assert.Throws(() => funcs.InByRef(ref unmappable)); + + unmappable = data.Unmappable; + Assert.Throws(() => funcs.InOutByRef(ref unmappable)); + } + else + { + Assert.True(funcs.In(unmappable)); + + unmappable = data.Unmappable; + Assert.True(funcs.InByRef(ref unmappable)); + Assert.Equal(data.GetValueToCompare(data.Unmappable), data.GetValueToCompare(unmappable)); + + unmappable = data.Unmappable; + Assert.True(funcs.InOutByRef(ref unmappable)); + Assert.NotEqual(data.GetValueToCompare(data.Unmappable), data.GetValueToCompare(unmappable)); + } + + T valid = data.Valid; + Assert.True(funcs.In(valid)); + + valid = data.Valid; + Assert.True(funcs.InByRef(ref valid)); + Assert.Equal(data.GetValueToCompare(data.Valid), data.GetValueToCompare(valid)); + + valid = data.Valid; + Assert.True(funcs.InOutByRef(ref valid)); + Assert.Equal(data.GetValueToCompare(data.Valid), data.GetValueToCompare(valid)); + } + + public static void ValidateChar(bool bestFitMapping, bool throwOnUnmappableChar, Functions funcs) + { + var context = new DataContext(InvalidChar, UnmappableChar, ValidChar, (char c) => c); + Validate(bestFitMapping, throwOnUnmappableChar, funcs, context); + } + + public static void ValidateString(bool bestFitMapping, bool throwOnUnmappableChar, Functions funcs) + { + var context = new DataContext(InvalidString, UnmappableString, ValidString, (string s) => s); + Validate(bestFitMapping, throwOnUnmappableChar, funcs, context); + } + + public static void ValidateStringBuilder(bool bestFitMapping, bool throwOnUnmappableChar, Functions funcs) + { + var context = new DataContext(InvalidStringBuilder, UnmappableStringBuilder, ValidStringBuilder, (StringBuilder s) => s.ToString()); + Validate(bestFitMapping, throwOnUnmappableChar, funcs, context); + } + + public static void ValidateStringArray(bool bestFitMapping, bool throwOnUnmappableChar, Functions funcs) + { + var context = new DataContext(InvalidStringArray, UnmappableStringArray, ValidStringArray, (string[] s) => s[0]); + Validate(bestFitMapping, throwOnUnmappableChar, funcs, context); + } +} diff --git a/src/tests/Interop/PInvoke/BestFitMapping/TestData.cs b/src/tests/Interop/PInvoke/BestFitMapping/TestData.cs new file mode 100644 index 00000000000000..d8e93106b590f6 --- /dev/null +++ b/src/tests/Interop/PInvoke/BestFitMapping/TestData.cs @@ -0,0 +1,30 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Text; + +public static class TestData +{ + public const char InvalidChar = (char)0x2216; + public const char UnmappableChar = '火'; + public const char ValidChar = 'c'; + + public static readonly string InvalidString = new string(new char[] + { + (char)0x2216, + (char)0x2044, + (char)0x2215, + (char)0x0589, + (char)0x2236 + }); + public static readonly string UnmappableString = new string(new char[] { '乀', 'Ω', '火' }); + public static readonly string ValidString = "This is the initial test string."; + + public static readonly StringBuilder InvalidStringBuilder = new StringBuilder(InvalidString); + public static readonly StringBuilder UnmappableStringBuilder = new StringBuilder(UnmappableString); + public static readonly StringBuilder ValidStringBuilder = new StringBuilder(ValidString); + + public static readonly string[] InvalidStringArray = new string[] { InvalidString, InvalidString, InvalidString }; + public static readonly string[] UnmappableStringArray = new string[] { UnmappableString, UnmappableString, UnmappableString }; + public static readonly string[] ValidStringArray = new string[] { ValidString, ValidString, ValidString }; +} diff --git a/src/tests/Interop/PInvoke/CriticalHandles/ArrayTest/ArrayTest.cs b/src/tests/Interop/PInvoke/CriticalHandles/ArrayTest/ArrayTest.cs index b2568ad5c187a1..a198b5dd9c96ce 100644 --- a/src/tests/Interop/PInvoke/CriticalHandles/ArrayTest/ArrayTest.cs +++ b/src/tests/Interop/PInvoke/CriticalHandles/ArrayTest/ArrayTest.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; -using TestLibrary; +using Xunit; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; @@ -39,17 +39,17 @@ internal IntPtr Handle { return handle; } - set + set { handle = value; } } - + internal static IntPtr GetUniqueHandle() { return new IntPtr(s_uniqueHandleValue++); } - + internal static bool IsHandleClosed(IntPtr handle) { return s_closedHandles.Contains(handle.ToInt32()); @@ -75,7 +75,7 @@ internal class Native [DllImport("CriticalHandlesNative", CallingConvention = CallingConvention.StdCall)] internal static extern IntPtr RefModify(IntPtr handleValue, [MarshalAs(UnmanagedType.LPArray)]ref MyCriticalHandle[] handle); - + [DllImport("CriticalHandlesNative", CallingConvention = CallingConvention.StdCall)] internal static extern MyCriticalHandle[] Ret(IntPtr handleValue); @@ -85,7 +85,7 @@ internal class Native public class CriticalHandleArrayTest { - private static Native.IsHandleClosed s_isHandleClose = (handleValue) => + private static Native.IsHandleClosed s_isHandleClose = (handleValue) => { GC.Collect(); GC.WaitForPendingFinalizers(); diff --git a/src/tests/Interop/PInvoke/CriticalHandles/ReverseTest/ReverseTest.cs b/src/tests/Interop/PInvoke/CriticalHandles/ReverseTest/ReverseTest.cs index 756f568579d818..b3a62ab9fa87eb 100644 --- a/src/tests/Interop/PInvoke/CriticalHandles/ReverseTest/ReverseTest.cs +++ b/src/tests/Interop/PInvoke/CriticalHandles/ReverseTest/ReverseTest.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; -using TestLibrary; +using Xunit; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; @@ -39,17 +39,17 @@ internal IntPtr Handle { return handle; } - set + set { handle = value; } } - + internal static IntPtr GetUniqueHandle() { return new IntPtr(s_uniqueHandleValue++); } - + internal static bool IsHandleClosed(IntPtr handle) { return s_closedHandles.Contains(handle.ToInt32()); @@ -62,7 +62,7 @@ public static void In() { IntPtr handleValue = new IntPtr(1); Native.InCallback callback = (handle) => { }; - Assert.Throws(() => Native.InvokeInCallback(callback, handleValue), "Calling P/Invoke that invokes a delegate that has an CriticalHandle parameter"); + Assert.Throws(() => Native.InvokeInCallback(callback, handleValue)); GC.KeepAlive(callback); } @@ -70,7 +70,7 @@ public static void Ret() { IntPtr handleValue = new IntPtr(2); Native.RetCallback callback = () => new MyCriticalHandle(); - Assert.Throws(() => Native.InvokeRetCallback(callback), "Calling P/Invoke that invokes a delegate that returns a CriticalHandle parameter"); + Assert.Throws(() => Native.InvokeRetCallback(callback)); GC.KeepAlive(callback); } @@ -78,7 +78,7 @@ public static void Out() { IntPtr handleValue = new IntPtr(3); Native.OutCallback callback = (out MyCriticalHandle handle) => handle = null; - Assert.Throws(() => Native.InvokeOutCallback(callback, ref handleValue), "Calling P/Invoke that invokes a delegate that has an out CriticalHandle parameter"); + Assert.Throws(() => Native.InvokeOutCallback(callback, ref handleValue)); GC.KeepAlive(callback); } @@ -86,7 +86,7 @@ public static void InRef() { IntPtr handleValue = new IntPtr(4); Native.InRefCallback callback = (ref MyCriticalHandle handle) => { }; - Assert.Throws(() => Native.InvokeInRefCallback(callback, ref handleValue), "Calling P/Invoke that invokes a delegate that has an [In] ref CriticalHandle parameter"); + Assert.Throws(() => Native.InvokeInRefCallback(callback, ref handleValue)); GC.KeepAlive(callback); } @@ -94,7 +94,7 @@ public static void Ref() { IntPtr handleValue = new IntPtr(5); Native.RefCallback callback = (ref MyCriticalHandle handle) => { }; - Assert.Throws(() => Native.InvokeRefCallback(callback, ref handleValue), "Calling P/Invoke that invokes a delegate that has an ref CriticalHandle parameter"); + Assert.Throws(() => Native.InvokeRefCallback(callback, ref handleValue)); GC.KeepAlive(callback); } diff --git a/src/tests/Interop/PInvoke/CriticalHandles/StructTest/StructTest.cs b/src/tests/Interop/PInvoke/CriticalHandles/StructTest/StructTest.cs index 54ec48e1479cc8..80bb6bb7a8a5e1 100644 --- a/src/tests/Interop/PInvoke/CriticalHandles/StructTest/StructTest.cs +++ b/src/tests/Interop/PInvoke/CriticalHandles/StructTest/StructTest.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; -using TestLibrary; +using Xunit; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; @@ -39,17 +39,17 @@ internal IntPtr Handle { return handle; } - set + set { handle = value; } } - + internal static IntPtr GetUniqueHandle() { return new IntPtr(s_uniqueHandleValue++); } - + internal static bool IsHandleClosed(IntPtr handle) { return s_closedHandles.Contains(handle.ToInt32()); @@ -58,7 +58,7 @@ internal static bool IsHandleClosed(IntPtr handle) public class CriticalHandleStructTest { - private static Native.HandleCallback s_handleCallback = (handleValue) => + private static Native.HandleCallback s_handleCallback = (handleValue) => { GC.Collect(); GC.WaitForPendingFinalizers(); @@ -71,7 +71,7 @@ public static void In() InWorker(handleValue); GC.Collect(); GC.WaitForPendingFinalizers(); - Assert.IsTrue(MyCriticalHandle.IsHandleClosed(handleValue), "Handle was not closed"); + Assert.True(MyCriticalHandle.IsHandleClosed(handleValue)); } [MethodImpl(MethodImplOptions.NoInlining)] @@ -80,7 +80,7 @@ private static void InWorker(IntPtr handleValue) Native.MyCriticalHandleStruct handleStruct = new Native.MyCriticalHandleStruct() { Handle = new MyCriticalHandle() { Handle = handleValue } }; IntPtr value; value = Native.In(handleStruct, s_handleCallback); - Assert.AreEqual(handleValue.ToInt32(), value.ToInt32(), "Handle value"); + Assert.Equal(handleValue.ToInt32(), value.ToInt32()); } public static void Ret() @@ -101,7 +101,7 @@ private static void OutWorker(IntPtr handleValue) { Native.MyCriticalHandleStruct handleStruct; Native.Out(handleValue, out handleStruct); - Assert.AreEqual(handleValue.ToInt32(), handleStruct.Handle.Handle.ToInt32(), "Handle value"); + Assert.Equal(handleValue.ToInt32(), handleStruct.Handle.Handle.ToInt32()); } public static void InRef() @@ -110,7 +110,7 @@ public static void InRef() InRefWorker(handleValue); GC.Collect(); GC.WaitForPendingFinalizers(); - Assert.IsTrue(MyCriticalHandle.IsHandleClosed(handleValue), "Handle was not closed"); + Assert.True(MyCriticalHandle.IsHandleClosed(handleValue)); } [MethodImpl(MethodImplOptions.NoInlining)] @@ -118,7 +118,7 @@ private static void InRefWorker(IntPtr handleValue) { Native.MyCriticalHandleStruct handleStruct = new Native.MyCriticalHandleStruct() { Handle = new MyCriticalHandle() { Handle = handleValue } }; Native.InRef(ref handleStruct, s_handleCallback); - Assert.AreEqual(handleValue.ToInt32(), handleStruct.Handle.Handle.ToInt32(), "Handle value"); + Assert.Equal(handleValue.ToInt32(), handleStruct.Handle.Handle.ToInt32()); } public static void Ref() @@ -127,7 +127,7 @@ public static void Ref() RefWorker(handleValue); GC.Collect(); GC.WaitForPendingFinalizers(); - Assert.IsTrue(MyCriticalHandle.IsHandleClosed(handleValue), "Handle was not closed"); + Assert.True(MyCriticalHandle.IsHandleClosed(handleValue)); } [MethodImpl(MethodImplOptions.NoInlining)] @@ -135,7 +135,7 @@ private static void RefWorker(IntPtr handleValue) { Native.MyCriticalHandleStruct handleStruct = new Native.MyCriticalHandleStruct() { Handle = new MyCriticalHandle() { Handle = handleValue } }; Native.Ref(ref handleStruct, s_handleCallback); - Assert.AreEqual(handleValue.ToInt32(), handleStruct.Handle.Handle.ToInt32(), "Handle value"); + Assert.Equal(handleValue.ToInt32(), handleStruct.Handle.Handle.ToInt32()); } public static void RefModify() diff --git a/src/tests/Interop/PInvoke/CriticalHandles/Test/Test.cs b/src/tests/Interop/PInvoke/CriticalHandles/Test/Test.cs index 7f455d0d3f76d5..f8416b358a1087 100644 --- a/src/tests/Interop/PInvoke/CriticalHandles/Test/Test.cs +++ b/src/tests/Interop/PInvoke/CriticalHandles/Test/Test.cs @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; -using TestLibrary; +using Xunit; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; @@ -39,17 +39,17 @@ internal IntPtr Handle { return handle; } - set + set { handle = value; } } - + internal static IntPtr GetUniqueHandle() { return new IntPtr(s_uniqueHandleValue++); } - + internal static bool IsHandleClosed(IntPtr handle) { return s_closedHandles.Contains(handle.ToInt32()); @@ -92,7 +92,7 @@ protected override bool ReleaseHandle() public class CriticalHandleTest { - private static Native.HandleCallback s_handleCallback = (handleValue) => + private static Native.HandleCallback s_handleCallback = (handleValue) => { GC.Collect(); GC.WaitForPendingFinalizers(); @@ -105,7 +105,7 @@ public static void In() InWorker(handleValue); GC.Collect(); GC.WaitForPendingFinalizers(); - Assert.IsTrue(MyCriticalHandle.IsHandleClosed(handleValue), "Handle was not closed"); + Assert.True(MyCriticalHandle.IsHandleClosed(handleValue)); } [MethodImpl(MethodImplOptions.NoInlining)] @@ -114,7 +114,7 @@ private static void InWorker(IntPtr handleValue) MyCriticalHandle hande = new MyCriticalHandle() { Handle = handleValue }; IntPtr value; value = Native.In(hande, s_handleCallback); - Assert.AreEqual(handleValue.ToInt32(), value.ToInt32(), "Handle value"); + Assert.Equal(handleValue.ToInt32(), value.ToInt32()); } public static void Ret() @@ -123,14 +123,14 @@ public static void Ret() RetWorker(handleValue); GC.Collect(); GC.WaitForPendingFinalizers(); - Assert.IsTrue(MyCriticalHandle.IsHandleClosed(handleValue), "Handle was not closed"); + Assert.True(MyCriticalHandle.IsHandleClosed(handleValue)); } [MethodImpl(MethodImplOptions.NoInlining)] private static void RetWorker(IntPtr handleValue) { MyCriticalHandle hande = Native.Ret(handleValue); - Assert.AreEqual(handleValue.ToInt32(), hande.Handle.ToInt32(), "Handle value"); + Assert.Equal(handleValue.ToInt32(), hande.Handle.ToInt32()); } public static void Out() @@ -139,7 +139,7 @@ public static void Out() OutWorker(handleValue); GC.Collect(); GC.WaitForPendingFinalizers(); - Assert.IsTrue(MyCriticalHandle.IsHandleClosed(handleValue), "Handle was not closed"); + Assert.True(MyCriticalHandle.IsHandleClosed(handleValue)); } [MethodImpl(MethodImplOptions.NoInlining)] @@ -147,7 +147,7 @@ private static void OutWorker(IntPtr handleValue) { MyCriticalHandle hande; Native.Out(handleValue, out hande); - Assert.AreEqual(handleValue.ToInt32(), hande.Handle.ToInt32(), "Handle value"); + Assert.Equal(handleValue.ToInt32(), hande.Handle.ToInt32()); } public static void InRef() @@ -156,7 +156,7 @@ public static void InRef() InRefWorker(handleValue); GC.Collect(); GC.WaitForPendingFinalizers(); - Assert.IsTrue(MyCriticalHandle.IsHandleClosed(handleValue), "Handle was not closed"); + Assert.True(MyCriticalHandle.IsHandleClosed(handleValue)); } [MethodImpl(MethodImplOptions.NoInlining)] @@ -164,7 +164,7 @@ private static void InRefWorker(IntPtr handleValue) { MyCriticalHandle hande = new MyCriticalHandle() { Handle = handleValue }; Native.InRef(ref hande, s_handleCallback); - Assert.AreEqual(handleValue.ToInt32(), hande.Handle.ToInt32(), "Handle value"); + Assert.Equal(handleValue.ToInt32(), hande.Handle.ToInt32()); } public static void Ref() @@ -173,7 +173,7 @@ public static void Ref() RefWorker(handleValue); GC.Collect(); GC.WaitForPendingFinalizers(); - Assert.IsTrue(MyCriticalHandle.IsHandleClosed(handleValue), "Handle was not closed"); + Assert.True(MyCriticalHandle.IsHandleClosed(handleValue)); } [MethodImpl(MethodImplOptions.NoInlining)] @@ -181,7 +181,7 @@ private static void RefWorker(IntPtr handleValue) { MyCriticalHandle hande = new MyCriticalHandle() { Handle = handleValue }; Native.Ref(ref hande, s_handleCallback); - Assert.AreEqual(handleValue.ToInt32(), hande.Handle.ToInt32(), "Handle value"); + Assert.Equal(handleValue.ToInt32(), hande.Handle.ToInt32()); } public static void RefModify() @@ -191,8 +191,8 @@ public static void RefModify() RefModifyWorker(handleValue1, handleValue2); GC.Collect(); GC.WaitForPendingFinalizers(); - Assert.IsTrue(MyCriticalHandle.IsHandleClosed(handleValue1), "Handle 1 was not closed"); - Assert.IsTrue(MyCriticalHandle.IsHandleClosed(handleValue2), "Handle 2 was not closed"); + Assert.True(MyCriticalHandle.IsHandleClosed(handleValue1)); + Assert.True(MyCriticalHandle.IsHandleClosed(handleValue2)); } [MethodImpl(MethodImplOptions.NoInlining)] @@ -200,7 +200,7 @@ private static void RefModifyWorker(IntPtr handleValue1, IntPtr handleValue2) { MyCriticalHandle hande = new MyCriticalHandle() { Handle = handleValue1 }; Native.RefModify(handleValue2, ref hande, s_handleCallback); - Assert.AreEqual(handleValue2.ToInt32(), hande.Handle.ToInt32(), "Handle value"); + Assert.Equal(handleValue2.ToInt32(), hande.Handle.ToInt32()); } internal class Native @@ -237,20 +237,20 @@ public static void In() AbstractCriticalHandle handle = new CriticalHandleWithNoDefaultCtor(handleValue); IntPtr value; value = Native.In(handle, null); - Assert.AreEqual(handleValue.ToInt32(), value.ToInt32(), "Handle value"); + Assert.Equal(handleValue.ToInt32(), value.ToInt32()); } public static void Ret() { IntPtr handleValue = new IntPtr(2); - Assert.Throws(() => Native.Ret(handleValue), "Calling P/Invoke that returns an abstract critical handle"); + Assert.Throws(() => Native.Ret(handleValue)); } public static void Out() { IntPtr handleValue = new IntPtr(3); AbstractCriticalHandle handle; - Assert.Throws(() => Native.Out(handleValue, out handle), "Calling P/Invoke that has an out abstract critical handle parameter"); + Assert.Throws(() => Native.Out(handleValue, out handle)); } public static void InRef() @@ -258,14 +258,14 @@ public static void InRef() IntPtr handleValue = new IntPtr(4); AbstractCriticalHandle handle = new CriticalHandleWithNoDefaultCtor(handleValue); Native.InRef(ref handle, null); - Assert.AreEqual(handleValue.ToInt32(), handle.Handle.ToInt32(), "Handle value"); + Assert.Equal(handleValue.ToInt32(), handle.Handle.ToInt32()); } public static void Ref() { IntPtr handleValue = new IntPtr(5); AbstractCriticalHandle handle = new CriticalHandleWithNoDefaultCtor(handleValue); - Assert.Throws(() => Native.Ref(ref handle, null), "Calling P/Invoke that has a ref abstract critical handle parameter"); + Assert.Throws(() => Native.Ref(ref handle, null)); } internal class Native @@ -299,14 +299,14 @@ public static void In() CriticalHandleWithNoDefaultCtor handle = new CriticalHandleWithNoDefaultCtor(handleValue); IntPtr value; value = Native.In(handle, null); - Assert.AreEqual(handleValue.ToInt32(), value.ToInt32(), "Handle value"); + Assert.Equal(handleValue.ToInt32(), value.ToInt32()); } public static void Ret() { IntPtr handleValue = new IntPtr(2); //TODO: Expected MissingMemberException but throws MissingMethodException - Assert.Throws(() => Native.Ret(handleValue), "Calling P/Invoke that returns an no default ctor critical handle"); + Assert.Throws(() => Native.Ret(handleValue)); } public static void Out() @@ -314,7 +314,7 @@ public static void Out() IntPtr handleValue = new IntPtr(3); CriticalHandleWithNoDefaultCtor handle; //TODO: Expected MissingMemberException but throws MissingMethodException - Assert.Throws(() => Native.Out(handleValue, out handle), "Calling P/Invoke that has an out no default ctor critical handle parameter"); + Assert.Throws(() => Native.Out(handleValue, out handle)); } public static void InRef() @@ -322,7 +322,7 @@ public static void InRef() IntPtr handleValue = new IntPtr(4); CriticalHandleWithNoDefaultCtor handle = new CriticalHandleWithNoDefaultCtor(handleValue); //TODO: Expected MissingMemberException but throws MissingMethodException - Assert.Throws(() => Native.InRef(ref handle, null), "Calling P/Invoke that has a [In] ref no default ctor critical handle parameter"); + Assert.Throws(() => Native.InRef(ref handle, null)); } public static void Ref() @@ -330,7 +330,7 @@ public static void Ref() IntPtr handleValue = new IntPtr(5); CriticalHandleWithNoDefaultCtor handle = new CriticalHandleWithNoDefaultCtor(handleValue); //TODO: Expected MissingMemberException but throws MissingMethodException - Assert.Throws(() => Native.Ref(ref handle, null), "Calling P/Invoke that has a ref no default ctor critical handle parameter"); + Assert.Throws(() => Native.Ref(ref handle, null)); } internal class Native diff --git a/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.cs b/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.cs index b3983b325e9707..b72beb0f8f6b7a 100644 --- a/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.cs +++ b/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.cs @@ -5,7 +5,7 @@ using System.Globalization; using System.Reflection; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; namespace PInvokeTests { diff --git a/src/tests/Interop/PInvoke/DateTime/DateTimeTest.cs b/src/tests/Interop/PInvoke/DateTime/DateTimeTest.cs index 6f25cfbacd1ece..08c03e20595f32 100644 --- a/src/tests/Interop/PInvoke/DateTime/DateTimeTest.cs +++ b/src/tests/Interop/PInvoke/DateTime/DateTimeTest.cs @@ -4,7 +4,7 @@ using System; using System.Text; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; public struct DateWrapper { @@ -31,20 +31,20 @@ static int Main(string[] args) { DateTime currentDate = new DateTime(2019, 5, 2); - Assert.AreEqual(currentDate.AddDays(1), NativeDateTime.GetTomorrow(currentDate)); + Assert.Equal(currentDate.AddDays(1), NativeDateTime.GetTomorrow(currentDate)); NativeDateTime.GetTomorrowByRef(currentDate, out DateTime nextDay); - - Assert.AreEqual(currentDate.AddDays(1), nextDay); + + Assert.Equal(currentDate.AddDays(1), nextDay); DateWrapper wrapper = new DateWrapper { date = currentDate }; - Assert.AreEqual(currentDate.AddDays(1), NativeDateTime.GetTomorrowWrapped(wrapper).date); + Assert.Equal(currentDate.AddDays(1), NativeDateTime.GetTomorrowWrapped(wrapper).date); } catch (Exception e) { - Console.WriteLine($"Test Failure: {e}"); - return 101; + Console.WriteLine($"Test Failure: {e}"); + return 101; } return 100; } diff --git a/src/tests/Interop/PInvoke/Decimal/DecimalTest.cs b/src/tests/Interop/PInvoke/Decimal/DecimalTest.cs index e98277dd42e5f7..40afd032ab1b67 100644 --- a/src/tests/Interop/PInvoke/Decimal/DecimalTest.cs +++ b/src/tests/Interop/PInvoke/Decimal/DecimalTest.cs @@ -3,99 +3,84 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; public class DecimalTest { private const int StartingIntValue = 42; private const int NewIntValue = 18; - public static int Main() + [Fact] + public static void RunDecimalTests() { - try - { - RunDecimalTests(); - RunLPDecimalTests(); - if (OperatingSystem.IsWindows()) - { - RunCurrencyTests(); - } - } - catch (System.Exception ex) - { - Console.WriteLine(ex.ToString()); - return 101; - } - return 100; - } - - private static void RunDecimalTests() - { - Assert.AreEqual((decimal)StartingIntValue, DecimalTestNative.CreateDecimalFromInt(StartingIntValue)); + Assert.Equal((decimal)StartingIntValue, DecimalTestNative.CreateDecimalFromInt(StartingIntValue)); - Assert.IsTrue(DecimalTestNative.DecimalEqualToInt((decimal)StartingIntValue, StartingIntValue)); + Assert.True(DecimalTestNative.DecimalEqualToInt((decimal)StartingIntValue, StartingIntValue)); decimal localDecimal = (decimal)StartingIntValue; - Assert.IsTrue(DecimalTestNative.ValidateAndChangeDecimal(ref localDecimal, StartingIntValue, NewIntValue)); - Assert.AreEqual((decimal)NewIntValue, localDecimal); + Assert.True(DecimalTestNative.ValidateAndChangeDecimal(ref localDecimal, StartingIntValue, NewIntValue)); + Assert.Equal((decimal)NewIntValue, localDecimal); DecimalTestNative.GetDecimalForInt(NewIntValue, out var dec); - Assert.AreEqual((decimal)NewIntValue, dec); - - Assert.AreEqual((decimal)StartingIntValue, DecimalTestNative.CreateWrappedDecimalFromInt(StartingIntValue).dec); + Assert.Equal((decimal)NewIntValue, dec); + + Assert.Equal((decimal)StartingIntValue, DecimalTestNative.CreateWrappedDecimalFromInt(StartingIntValue).dec); - Assert.IsTrue(DecimalTestNative.WrappedDecimalEqualToInt(new DecimalTestNative.DecimalWrapper { dec = (decimal)StartingIntValue }, StartingIntValue)); + Assert.True(DecimalTestNative.WrappedDecimalEqualToInt(new DecimalTestNative.DecimalWrapper { dec = (decimal)StartingIntValue }, StartingIntValue)); var localDecimalWrapper = new DecimalTestNative.DecimalWrapper { dec = (decimal)StartingIntValue }; - Assert.IsTrue(DecimalTestNative.ValidateAndChangeWrappedDecimal(ref localDecimalWrapper, StartingIntValue, NewIntValue)); - Assert.AreEqual((decimal)NewIntValue, localDecimalWrapper.dec); + Assert.True(DecimalTestNative.ValidateAndChangeWrappedDecimal(ref localDecimalWrapper, StartingIntValue, NewIntValue)); + Assert.Equal((decimal)NewIntValue, localDecimalWrapper.dec); DecimalTestNative.GetWrappedDecimalForInt(NewIntValue, out var decWrapper); - Assert.AreEqual((decimal)NewIntValue, decWrapper.dec); + Assert.Equal((decimal)NewIntValue, decWrapper.dec); - DecimalTestNative.PassThroughDecimalToCallback((decimal)NewIntValue, d => Assert.AreEqual((decimal)NewIntValue, d)); + DecimalTestNative.PassThroughDecimalToCallback((decimal)NewIntValue, d => Assert.Equal((decimal)NewIntValue, d)); } - private static void RunLPDecimalTests() + [Fact] + public static void RunLPDecimalTests() { - Assert.AreEqual((decimal)StartingIntValue, DecimalTestNative.CreateLPDecimalFromInt(StartingIntValue)); + Assert.Equal((decimal)StartingIntValue, DecimalTestNative.CreateLPDecimalFromInt(StartingIntValue)); - Assert.IsTrue(DecimalTestNative.LPDecimalEqualToInt((decimal)StartingIntValue, StartingIntValue)); + Assert.True(DecimalTestNative.LPDecimalEqualToInt((decimal)StartingIntValue, StartingIntValue)); decimal localDecimal = (decimal)StartingIntValue; - Assert.IsTrue(DecimalTestNative.ValidateAndChangeLPDecimal(ref localDecimal, StartingIntValue, NewIntValue)); - Assert.AreEqual((decimal)NewIntValue, localDecimal); + Assert.True(DecimalTestNative.ValidateAndChangeLPDecimal(ref localDecimal, StartingIntValue, NewIntValue)); + Assert.Equal((decimal)NewIntValue, localDecimal); DecimalTestNative.GetLPDecimalForInt(NewIntValue, out var dec); - Assert.AreEqual((decimal)NewIntValue, dec); + Assert.Equal((decimal)NewIntValue, dec); - DecimalTestNative.PassThroughLPDecimalToCallback((decimal)NewIntValue, d => Assert.AreEqual((decimal)NewIntValue, d)); + DecimalTestNative.PassThroughLPDecimalToCallback((decimal)NewIntValue, d => Assert.Equal((decimal)NewIntValue, d)); } - private static void RunCurrencyTests() - { + [Fact] + [PlatformSpecific(TestPlatforms.Windows)] + public static void RunCurrencyTests() + { Assert.Throws(() => DecimalTestNative.CreateCurrencyFromInt(StartingIntValue)); - Assert.IsTrue(DecimalTestNative.CurrencyEqualToInt((decimal)StartingIntValue, StartingIntValue)); + Assert.True(DecimalTestNative.CurrencyEqualToInt((decimal)StartingIntValue, StartingIntValue)); decimal localCurrency = (decimal)StartingIntValue; - Assert.IsTrue(DecimalTestNative.ValidateAndChangeCurrency(ref localCurrency, StartingIntValue, NewIntValue)); - Assert.AreEqual((decimal)NewIntValue, localCurrency); + Assert.True(DecimalTestNative.ValidateAndChangeCurrency(ref localCurrency, StartingIntValue, NewIntValue)); + Assert.Equal((decimal)NewIntValue, localCurrency); DecimalTestNative.GetCurrencyForInt(NewIntValue, out var cy); - Assert.AreEqual((decimal)NewIntValue, cy); - - Assert.AreEqual((decimal)StartingIntValue, DecimalTestNative.CreateWrappedCurrencyFromInt(StartingIntValue).currency); + Assert.Equal((decimal)NewIntValue, cy); + + Assert.Equal((decimal)StartingIntValue, DecimalTestNative.CreateWrappedCurrencyFromInt(StartingIntValue).currency); - Assert.IsTrue(DecimalTestNative.WrappedCurrencyEqualToInt(new DecimalTestNative.CurrencyWrapper { currency = (decimal)StartingIntValue }, StartingIntValue)); + Assert.True(DecimalTestNative.WrappedCurrencyEqualToInt(new DecimalTestNative.CurrencyWrapper { currency = (decimal)StartingIntValue }, StartingIntValue)); var localCurrencyWrapper = new DecimalTestNative.CurrencyWrapper { currency = (decimal)StartingIntValue }; - Assert.IsTrue(DecimalTestNative.ValidateAndChangeWrappedCurrency(ref localCurrencyWrapper, StartingIntValue, NewIntValue)); - Assert.AreEqual((decimal)NewIntValue, localCurrencyWrapper.currency); + Assert.True(DecimalTestNative.ValidateAndChangeWrappedCurrency(ref localCurrencyWrapper, StartingIntValue, NewIntValue)); + Assert.Equal((decimal)NewIntValue, localCurrencyWrapper.currency); DecimalTestNative.GetWrappedCurrencyForInt(NewIntValue, out var currencyWrapper); - Assert.AreEqual((decimal)NewIntValue, currencyWrapper.currency); - - DecimalTestNative.PassThroughCurrencyToCallback((decimal)NewIntValue, d => Assert.AreEqual((decimal)NewIntValue, d)); + Assert.Equal((decimal)NewIntValue, currencyWrapper.currency); + + DecimalTestNative.PassThroughCurrencyToCallback((decimal)NewIntValue, d => Assert.Equal((decimal)NewIntValue, d)); } } diff --git a/src/tests/Interop/PInvoke/Decimal/DecimalTest.csproj b/src/tests/Interop/PInvoke/Decimal/DecimalTest.csproj index 78c3de24d972d1..e868b25ab24053 100644 --- a/src/tests/Interop/PInvoke/Decimal/DecimalTest.csproj +++ b/src/tests/Interop/PInvoke/Decimal/DecimalTest.csproj @@ -1,7 +1,4 @@ - - Exe - diff --git a/src/tests/Interop/PInvoke/Delegate/DelegateTest.cs b/src/tests/Interop/PInvoke/Delegate/DelegateTest.cs index 37ed43c910b4bf..c696155b7e169c 100644 --- a/src/tests/Interop/PInvoke/Delegate/DelegateTest.cs +++ b/src/tests/Interop/PInvoke/Delegate/DelegateTest.cs @@ -4,7 +4,7 @@ using System; using System.Text; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; using static DelegateTestNative; @@ -15,22 +15,22 @@ private static void TestFunctionPointer() int expectedValue = 987654; int TestFunction() => expectedValue; - Assert.IsTrue(ValidateDelegateReturnsExpected(expectedValue, TestFunction)); - + Assert.True(ValidateDelegateReturnsExpected(expectedValue, TestFunction)); + { TestDelegate localDelegate = TestFunction; - Assert.IsTrue(ReplaceDelegate(expectedValue, ref localDelegate, out int newExpectedValue)); - Assert.AreEqual(newExpectedValue, localDelegate()); + Assert.True(ReplaceDelegate(expectedValue, ref localDelegate, out int newExpectedValue)); + Assert.Equal(newExpectedValue, localDelegate()); } { GetNativeTestFunction(out TestDelegate test, out int value); - Assert.AreEqual(value, test()); + Assert.Equal(value, test()); } { var returned = GetNativeTestFunctionReturned(out int value); - Assert.AreEqual(value, returned()); + Assert.Equal(value, returned()); } { @@ -40,7 +40,7 @@ private static void TestFunctionPointer() del = TestFunction }; - Assert.IsTrue(ValidateCallbackWithValue(cb)); + Assert.True(ValidateCallbackWithValue(cb)); } { @@ -50,13 +50,13 @@ private static void TestFunctionPointer() del = TestFunction }; - Assert.IsTrue(ValidateAndUpdateCallbackWithValue(ref cb)); - Assert.AreEqual(cb.expectedValue, cb.del()); + Assert.True(ValidateAndUpdateCallbackWithValue(ref cb)); + Assert.Equal(cb.expectedValue, cb.del()); } { GetNativeCallbackAndValue(out CallbackWithExpectedValue cb); - Assert.AreEqual(cb.expectedValue, cb.del()); + Assert.Equal(cb.expectedValue, cb.del()); } } @@ -65,23 +65,23 @@ private static void TestIDispatch() int expectedValue = 987654; int TestFunction() => expectedValue; - Assert.IsTrue(ValidateDelegateValueMatchesExpected(expectedValue, TestFunction)); - + Assert.True(ValidateDelegateValueMatchesExpected(expectedValue, TestFunction)); + { TestDelegate localDelegate = TestFunction; - Assert.IsTrue(ValidateDelegateValueMatchesExpectedAndClear(expectedValue, ref localDelegate)); - Assert.AreEqual(null, localDelegate); + Assert.True(ValidateDelegateValueMatchesExpectedAndClear(expectedValue, ref localDelegate)); + Assert.Equal(null, localDelegate); } { TestDelegate localDelegate = TestFunction; - Assert.IsTrue(DuplicateDelegate(expectedValue, localDelegate, out var outDelegate)); - Assert.AreEqual(localDelegate, outDelegate); + Assert.True(DuplicateDelegate(expectedValue, localDelegate, out var outDelegate)); + Assert.Equal(localDelegate, outDelegate); } { TestDelegate localDelegate = TestFunction; - Assert.AreEqual(localDelegate, DuplicateDelegateReturned(localDelegate)); + Assert.Equal(localDelegate, DuplicateDelegateReturned(localDelegate)); } { @@ -91,7 +91,7 @@ private static void TestIDispatch() del = TestFunction }; - Assert.IsTrue(ValidateStructDelegateValueMatchesExpected(cb)); + Assert.True(ValidateStructDelegateValueMatchesExpected(cb)); } { @@ -101,8 +101,8 @@ private static void TestIDispatch() del = TestFunction }; - Assert.IsTrue(ValidateDelegateValueMatchesExpectedAndClearStruct(ref cb)); - Assert.AreEqual(null, cb.del); + Assert.True(ValidateDelegateValueMatchesExpectedAndClearStruct(ref cb)); + Assert.Equal(null, cb.del); } { @@ -112,8 +112,8 @@ private static void TestIDispatch() del = TestFunction }; - Assert.IsTrue(DuplicateStruct(cb, out var cbOut)); - Assert.AreEqual(cbOut.expectedValue, cbOut.del()); + Assert.True(DuplicateStruct(cb, out var cbOut)); + Assert.Equal(cbOut.expectedValue, cbOut.del()); } Assert.Throws(() => MarshalDelegateAsInterface(TestFunction)); @@ -131,8 +131,8 @@ static int Main(string[] args) } catch (Exception e) { - Console.WriteLine($"Test Failure: {e}"); - return 101; + Console.WriteLine($"Test Failure: {e}"); + return 101; } return 100; } diff --git a/src/tests/Interop/PInvoke/Generics/CMakeLists.txt b/src/tests/Interop/PInvoke/Generics/CMakeLists.txt index 9d6a3f34adc1b2..67b1020d6ec96f 100644 --- a/src/tests/Interop/PInvoke/Generics/CMakeLists.txt +++ b/src/tests/Interop/PInvoke/Generics/CMakeLists.txt @@ -17,16 +17,6 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # The ABI for passing parameters with 32-byte alignment has changed in GCC 4.6 add_compile_options(-Wno-psabi) endif() -if (MSVC) - # The MSVC require explicitly ask for AVX2 so define would be present. - add_compile_options(/arch:AVX2) -else() - if (NOT CLR_CMAKE_TARGET_ARCH_ARM64 AND NOT CLR_CMAKE_TARGET_ARCH_ARM) - # We need -march=native so we can detect if AVX2 is present. - # ARM does not like that option too and it make no sense to have this detection there. - add_compile_options(-march=native) - endif() -endif() set(SOURCES GenericsNative.IUnknown.cpp GenericsNative.NullableB.cpp diff --git a/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256B.cpp b/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256B.cpp index 895d5d2a40372a..405aa08949b29a 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256B.cpp +++ b/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256B.cpp @@ -14,7 +14,7 @@ #error Unsupported target architecture #endif -#if defined(__AVX2__) +#if defined(TARGET_XARCH) typedef __m256i Vector256B; #else typedef struct { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256C.cpp b/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256C.cpp index e1b55e13dbe56b..6f4d4d3315e7b3 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256C.cpp +++ b/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256C.cpp @@ -14,7 +14,7 @@ #error Unsupported target architecture #endif -#if defined(__AVX2__) +#if defined(TARGET_XARCH) typedef __m256i Vector256C; #else typedef struct { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256D.cpp b/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256D.cpp index 769004e10cb605..abde579656f005 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256D.cpp +++ b/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256D.cpp @@ -14,7 +14,7 @@ #error Unsupported target architecture #endif -#if defined(__AVX2__) +#if defined(TARGET_XARCH) typedef __m256 Vector256D; #else typedef struct { @@ -27,7 +27,7 @@ static Vector256D Vector256DValue = { }; -extern "C" DLL_EXPORT Vector256D STDMETHODCALLTYPE GetVector256D(double e00, double e01, double e02, double e03) +extern "C" DLL_EXPORT Vector256D STDMETHODCALLTYPE ENABLE_AVX GetVector256D(double e00, double e01, double e02, double e03) { union { double value[4]; @@ -42,7 +42,7 @@ extern "C" DLL_EXPORT Vector256D STDMETHODCALLTYPE GetVector256D(double e00, dou return result; } -extern "C" DLL_EXPORT void STDMETHODCALLTYPE GetVector256DOut(double e00, double e01, double e02, double e03, Vector256D* pValue) +extern "C" DLL_EXPORT void STDMETHODCALLTYPE ENABLE_AVX GetVector256DOut(double e00, double e01, double e02, double e03, Vector256D* pValue) { Vector256D value = GetVector256D(e00, e01, e02, e03); @@ -54,18 +54,18 @@ extern "C" DLL_EXPORT void STDMETHODCALLTYPE GetVector256DOut(double e00, double #endif } -extern "C" DLL_EXPORT const Vector256D* STDMETHODCALLTYPE GetVector256DPtr(double e00, double e01, double e02, double e03) +extern "C" DLL_EXPORT const Vector256D* STDMETHODCALLTYPE ENABLE_AVX GetVector256DPtr(double e00, double e01, double e02, double e03) { GetVector256DOut(e00, e01, e02, e03, &Vector256DValue); return &Vector256DValue; } -extern "C" DLL_EXPORT Vector256D STDMETHODCALLTYPE AddVector256D(Vector256D lhs, Vector256D rhs) +extern "C" DLL_EXPORT Vector256D STDMETHODCALLTYPE ENABLE_AVX AddVector256D(Vector256D lhs, Vector256D rhs) { throw "P/Invoke for Vector256 should be unsupported."; } -extern "C" DLL_EXPORT Vector256D STDMETHODCALLTYPE AddVector256Ds(const Vector256D* pValues, uint32_t count) +extern "C" DLL_EXPORT Vector256D STDMETHODCALLTYPE ENABLE_AVX AddVector256Ds(const Vector256D* pValues, uint32_t count) { throw "P/Invoke for Vector256 should be unsupported."; } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256F.cpp b/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256F.cpp index c261ca25ab7b5a..f9418962865104 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256F.cpp +++ b/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256F.cpp @@ -14,7 +14,7 @@ #error Unsupported target architecture #endif -#if defined(__AVX2__) +#if defined(TARGET_XARCH) typedef __m256 Vector256F; #else typedef struct { @@ -31,7 +31,7 @@ static Vector256F Vector256FValue = { }; -extern "C" DLL_EXPORT Vector256F STDMETHODCALLTYPE GetVector256F(float e00, float e01, float e02, float e03, float e04, float e05, float e06, float e07) +extern "C" DLL_EXPORT Vector256F STDMETHODCALLTYPE ENABLE_AVX GetVector256F(float e00, float e01, float e02, float e03, float e04, float e05, float e06, float e07) { union { float value[8]; @@ -50,7 +50,7 @@ extern "C" DLL_EXPORT Vector256F STDMETHODCALLTYPE GetVector256F(float e00, floa return result; } -extern "C" DLL_EXPORT void STDMETHODCALLTYPE GetVector256FOut(float e00, float e01, float e02, float e03, float e04, float e05, float e06, float e07, Vector256F* pValue) +extern "C" DLL_EXPORT void STDMETHODCALLTYPE ENABLE_AVX GetVector256FOut(float e00, float e01, float e02, float e03, float e04, float e05, float e06, float e07, Vector256F* pValue) { Vector256F value = GetVector256F(e00, e01, e02, e03, e04, e05, e06, e07); @@ -62,18 +62,18 @@ extern "C" DLL_EXPORT void STDMETHODCALLTYPE GetVector256FOut(float e00, float e #endif } -extern "C" DLL_EXPORT const Vector256F* STDMETHODCALLTYPE GetVector256FPtr(float e00, float e01, float e02, float e03, float e04, float e05, float e06, float e07) +extern "C" DLL_EXPORT const Vector256F* STDMETHODCALLTYPE ENABLE_AVX GetVector256FPtr(float e00, float e01, float e02, float e03, float e04, float e05, float e06, float e07) { GetVector256FOut(e00, e01, e02, e03, e04, e05, e06, e07, &Vector256FValue); return &Vector256FValue; } -extern "C" DLL_EXPORT Vector256F STDMETHODCALLTYPE AddVector256F(Vector256F lhs, Vector256F rhs) +extern "C" DLL_EXPORT Vector256F STDMETHODCALLTYPE ENABLE_AVX AddVector256F(Vector256F lhs, Vector256F rhs) { throw "P/Invoke for Vector256 should be unsupported."; } -extern "C" DLL_EXPORT Vector256F STDMETHODCALLTYPE AddVector256Fs(const Vector256F* pValues, uint32_t count) +extern "C" DLL_EXPORT Vector256F STDMETHODCALLTYPE ENABLE_AVX AddVector256Fs(const Vector256F* pValues, uint32_t count) { throw "P/Invoke for Vector256 should be unsupported."; } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256L.cpp b/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256L.cpp index 62fc21a6d4eb8e..ffc2aff692648c 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256L.cpp +++ b/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256L.cpp @@ -14,7 +14,7 @@ #error Unsupported target architecture #endif -#if defined(__AVX2__) +#if defined(TARGET_XARCH) typedef __m256i Vector256L; #else typedef struct { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256U.cpp b/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256U.cpp index 99fe029d3eefa3..2e3e5421a34e49 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256U.cpp +++ b/src/tests/Interop/PInvoke/Generics/GenericsNative.Vector256U.cpp @@ -14,7 +14,7 @@ #error Unsupported target architecture #endif -#if defined(__AVX2__) +#if defined(TARGET_XARCH) typedef __m256i Vector256U; #else typedef struct { @@ -31,7 +31,7 @@ static Vector256U Vector256UValue = { }; -extern "C" DLL_EXPORT Vector256U STDMETHODCALLTYPE GetVector256U(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03, uint32_t e04, uint32_t e05, uint32_t e06, uint32_t e07) +extern "C" DLL_EXPORT Vector256U STDMETHODCALLTYPE ENABLE_AVX GetVector256U(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03, uint32_t e04, uint32_t e05, uint32_t e06, uint32_t e07) { union { uint32_t value[8]; @@ -50,7 +50,7 @@ extern "C" DLL_EXPORT Vector256U STDMETHODCALLTYPE GetVector256U(uint32_t e00, u return result; } -extern "C" DLL_EXPORT void STDMETHODCALLTYPE GetVector256UOut(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03, uint32_t e04, uint32_t e05, uint32_t e06, uint32_t e07, Vector256U* pValue) +extern "C" DLL_EXPORT void STDMETHODCALLTYPE ENABLE_AVX GetVector256UOut(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03, uint32_t e04, uint32_t e05, uint32_t e06, uint32_t e07, Vector256U* pValue) { Vector256U value = GetVector256U(e00, e01, e02, e03, e04, e05, e06, e07); @@ -62,18 +62,18 @@ extern "C" DLL_EXPORT void STDMETHODCALLTYPE GetVector256UOut(uint32_t e00, uint #endif } -extern "C" DLL_EXPORT const Vector256U* STDMETHODCALLTYPE GetVector256UPtr(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03, uint32_t e04, uint32_t e05, uint32_t e06, uint32_t e07) +extern "C" DLL_EXPORT const Vector256U* STDMETHODCALLTYPE ENABLE_AVX GetVector256UPtr(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03, uint32_t e04, uint32_t e05, uint32_t e06, uint32_t e07) { GetVector256UOut(e00, e01, e02, e03, e04, e05, e06, e07, &Vector256UValue); return &Vector256UValue; } -extern "C" DLL_EXPORT Vector256U STDMETHODCALLTYPE AddVector256U(Vector256U lhs, Vector256U rhs) +extern "C" DLL_EXPORT Vector256U STDMETHODCALLTYPE ENABLE_AVX AddVector256U(Vector256U lhs, Vector256U rhs) { throw "P/Invoke for Vector256 should be unsupported."; } -extern "C" DLL_EXPORT Vector256U STDMETHODCALLTYPE AddVector256Us(const Vector256U* pValues, uint32_t count) +extern "C" DLL_EXPORT Vector256U STDMETHODCALLTYPE ENABLE_AVX AddVector256Us(const Vector256U* pValues, uint32_t count) { throw "P/Invoke for Vector256 should be unsupported."; } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsNative.VectorD.cpp b/src/tests/Interop/PInvoke/Generics/GenericsNative.VectorD.cpp index 3c7be41dd0c303..a870ee55ba193b 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsNative.VectorD.cpp +++ b/src/tests/Interop/PInvoke/Generics/GenericsNative.VectorD.cpp @@ -27,7 +27,7 @@ extern "C" DLL_EXPORT VectorD128 STDMETHODCALLTYPE GetVectorD128(double e00, dou return *reinterpret_cast(value); } -extern "C" DLL_EXPORT VectorD256 STDMETHODCALLTYPE GetVectorD256(double e00, double e01, double e02, double e03) +extern "C" DLL_EXPORT VectorD256 STDMETHODCALLTYPE ENABLE_AVX GetVectorD256(double e00, double e01, double e02, double e03) { double value[4] = { e00, e01, e02, e03 }; return *reinterpret_cast(value); @@ -38,7 +38,7 @@ extern "C" DLL_EXPORT void STDMETHODCALLTYPE GetVectorD128Out(double e00, double *pValue = GetVectorD128(e00, e01); } -extern "C" DLL_EXPORT void STDMETHODCALLTYPE GetVectorD256Out(double e00, double e01, double e02, double e03, VectorD256* pValue) +extern "C" DLL_EXPORT void STDMETHODCALLTYPE ENABLE_AVX GetVectorD256Out(double e00, double e01, double e02, double e03, VectorD256* pValue) { *pValue = GetVectorD256(e00, e01, e02, e03); } @@ -49,7 +49,7 @@ extern "C" DLL_EXPORT const VectorD128* STDMETHODCALLTYPE GetVectorD128Ptr(doubl return &VectorD128Value; } -extern "C" DLL_EXPORT const VectorD256* STDMETHODCALLTYPE GetVectorD256Ptr(double e00, double e01, double e02, double e03) +extern "C" DLL_EXPORT const VectorD256* STDMETHODCALLTYPE ENABLE_AVX GetVectorD256Ptr(double e00, double e01, double e02, double e03) { GetVectorD256Out(e00, e01, e02, e03, &VectorD256Value); return &VectorD256Value; @@ -60,7 +60,7 @@ extern "C" DLL_EXPORT VectorD128 STDMETHODCALLTYPE AddVectorD128(VectorD128 lhs, throw "P/Invoke for Vector should be unsupported."; } -extern "C" DLL_EXPORT VectorD256 STDMETHODCALLTYPE AddVectorD256(VectorD256 lhs, VectorD256 rhs) +extern "C" DLL_EXPORT VectorD256 STDMETHODCALLTYPE ENABLE_AVX AddVectorD256(VectorD256 lhs, VectorD256 rhs) { throw "P/Invoke for Vector should be unsupported."; } @@ -70,7 +70,7 @@ extern "C" DLL_EXPORT VectorD128 STDMETHODCALLTYPE AddVectorD128s(const VectorD1 throw "P/Invoke for Vector should be unsupported."; } -extern "C" DLL_EXPORT VectorD256 STDMETHODCALLTYPE AddVectorD256s(const VectorD256* pValues, double count) +extern "C" DLL_EXPORT VectorD256 STDMETHODCALLTYPE ENABLE_AVX AddVectorD256s(const VectorD256* pValues, double count) { throw "P/Invoke for Vector should be unsupported."; } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsNative.VectorL.cpp b/src/tests/Interop/PInvoke/Generics/GenericsNative.VectorL.cpp index d3b2ea40fce59a..a7f6ec540e39cc 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsNative.VectorL.cpp +++ b/src/tests/Interop/PInvoke/Generics/GenericsNative.VectorL.cpp @@ -27,7 +27,7 @@ extern "C" DLL_EXPORT VectorL128 STDMETHODCALLTYPE GetVectorL128(int64_t e00, in return *reinterpret_cast(value); } -extern "C" DLL_EXPORT VectorL256 STDMETHODCALLTYPE GetVectorL256(int64_t e00, int64_t e01, int64_t e02, int64_t e03) +extern "C" DLL_EXPORT VectorL256 STDMETHODCALLTYPE ENABLE_AVX GetVectorL256(int64_t e00, int64_t e01, int64_t e02, int64_t e03) { int64_t value[4] = { e00, e01, e02, e03 }; return *reinterpret_cast(value); @@ -38,7 +38,7 @@ extern "C" DLL_EXPORT void STDMETHODCALLTYPE GetVectorL128Out(int64_t e00, int64 *pValue = GetVectorL128(e00, e01); } -extern "C" DLL_EXPORT void STDMETHODCALLTYPE GetVectorL256Out(int64_t e00, int64_t e01, int64_t e02, int64_t e03, VectorL256* pValue) +extern "C" DLL_EXPORT void STDMETHODCALLTYPE ENABLE_AVX GetVectorL256Out(int64_t e00, int64_t e01, int64_t e02, int64_t e03, VectorL256* pValue) { *pValue = GetVectorL256(e00, e01, e02, e03); } @@ -49,7 +49,7 @@ extern "C" DLL_EXPORT const VectorL128* STDMETHODCALLTYPE GetVectorL128Ptr(int64 return &VectorL128Value; } -extern "C" DLL_EXPORT const VectorL256* STDMETHODCALLTYPE GetVectorL256Ptr(int64_t e00, int64_t e01, int64_t e02, int64_t e03) +extern "C" DLL_EXPORT const VectorL256* STDMETHODCALLTYPE ENABLE_AVX GetVectorL256Ptr(int64_t e00, int64_t e01, int64_t e02, int64_t e03) { GetVectorL256Out(e00, e01, e02, e03, &VectorL256Value); return &VectorL256Value; @@ -60,7 +60,7 @@ extern "C" DLL_EXPORT VectorL128 STDMETHODCALLTYPE AddVectorL128(VectorL128 lhs, throw "P/Invoke for Vector should be unsupported."; } -extern "C" DLL_EXPORT VectorL256 STDMETHODCALLTYPE AddVectorL256(VectorL256 lhs, VectorL256 rhs) +extern "C" DLL_EXPORT VectorL256 STDMETHODCALLTYPE ENABLE_AVX AddVectorL256(VectorL256 lhs, VectorL256 rhs) { throw "P/Invoke for Vector should be unsupported."; } @@ -70,7 +70,7 @@ extern "C" DLL_EXPORT VectorL128 STDMETHODCALLTYPE AddVectorL128s(const VectorL1 throw "P/Invoke for Vector should be unsupported."; } -extern "C" DLL_EXPORT VectorL256 STDMETHODCALLTYPE AddVectorL256s(const VectorL256* pValues, int64_t count) +extern "C" DLL_EXPORT VectorL256 STDMETHODCALLTYPE ENABLE_AVX AddVectorL256s(const VectorL256* pValues, int64_t count) { throw "P/Invoke for Vector should be unsupported."; } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsNative.VectorU.cpp b/src/tests/Interop/PInvoke/Generics/GenericsNative.VectorU.cpp index c125f6de4cec5c..246801c25d0b10 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsNative.VectorU.cpp +++ b/src/tests/Interop/PInvoke/Generics/GenericsNative.VectorU.cpp @@ -33,7 +33,7 @@ extern "C" DLL_EXPORT VectorU128 STDMETHODCALLTYPE GetVectorU128(uint32_t e00, u return *reinterpret_cast(value); } -extern "C" DLL_EXPORT VectorU256 STDMETHODCALLTYPE GetVectorU256(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03, uint32_t e04, uint32_t e05, uint32_t e06, uint32_t e07) +extern "C" DLL_EXPORT VectorU256 STDMETHODCALLTYPE ENABLE_AVX GetVectorU256(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03, uint32_t e04, uint32_t e05, uint32_t e06, uint32_t e07) { uint32_t value[8] = { e00, e01, e02, e03, e04, e05, e06, e07 }; return *reinterpret_cast(value); @@ -44,7 +44,7 @@ extern "C" DLL_EXPORT void STDMETHODCALLTYPE GetVectorU128Out(uint32_t e00, uint *pValue = GetVectorU128(e00, e01, e02, e03); } -extern "C" DLL_EXPORT void STDMETHODCALLTYPE GetVectorU256Out(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03, uint32_t e04, uint32_t e05, uint32_t e06, uint32_t e07, VectorU256* pValue) +extern "C" DLL_EXPORT void STDMETHODCALLTYPE ENABLE_AVX GetVectorU256Out(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03, uint32_t e04, uint32_t e05, uint32_t e06, uint32_t e07, VectorU256* pValue) { *pValue = GetVectorU256(e00, e01, e02, e03, e04, e05, e06, e07); } @@ -55,7 +55,7 @@ extern "C" DLL_EXPORT const VectorU128* STDMETHODCALLTYPE GetVectorU128Ptr(uint3 return &VectorU128Value; } -extern "C" DLL_EXPORT const VectorU256* STDMETHODCALLTYPE GetVectorU256Ptr(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03, uint32_t e04, uint32_t e05, uint32_t e06, uint32_t e07) +extern "C" DLL_EXPORT const VectorU256* STDMETHODCALLTYPE ENABLE_AVX GetVectorU256Ptr(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03, uint32_t e04, uint32_t e05, uint32_t e06, uint32_t e07) { GetVectorU256Out(e00, e01, e02, e03, e04, e05, e06, e07, &VectorU256Value); return &VectorU256Value; @@ -66,7 +66,7 @@ extern "C" DLL_EXPORT VectorU128 STDMETHODCALLTYPE AddVectorU128(VectorU128 lhs, throw "P/Invoke for Vector should be unsupported."; } -extern "C" DLL_EXPORT VectorU256 STDMETHODCALLTYPE AddVectorU256(VectorU256 lhs, VectorU256 rhs) +extern "C" DLL_EXPORT VectorU256 STDMETHODCALLTYPE ENABLE_AVX AddVectorU256(VectorU256 lhs, VectorU256 rhs) { throw "P/Invoke for Vector should be unsupported."; } @@ -76,7 +76,7 @@ extern "C" DLL_EXPORT VectorU128 STDMETHODCALLTYPE AddVectorU128s(const VectorU1 throw "P/Invoke for Vector should be unsupported."; } -extern "C" DLL_EXPORT VectorU256 STDMETHODCALLTYPE AddVectorU256s(const VectorU256* pValues, uint32_t count) +extern "C" DLL_EXPORT VectorU256 STDMETHODCALLTYPE ENABLE_AVX AddVectorU256s(const VectorU256* pValues, uint32_t count) { throw "P/Invoke for Vector should be unsupported."; } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceB.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceB.cs index c53add4736714b..3ca01be785ae67 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceB.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceB.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceC.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceC.cs index 3ac4589da3f4b1..9259a828f88140 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceC.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceC.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceD.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceD.cs index edb69da23912f3..6fa84268e34a34 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceD.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceD.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceF.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceF.cs index 17cff906a27dbf..0f0e7e10e4d7a3 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceF.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceF.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceL.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceL.cs index 48ad9513ad4c6e..2b8cb74006a70d 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceL.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceL.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceU.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceU.cs index 99590711b7342a..365ad7a9096c4c 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceU.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.IComInterfaceU.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableB.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableB.cs index 82c64128d9fcc2..83d787e613aa89 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableB.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableB.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableC.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableC.cs index 62faa82827bb7f..728ef995c14b2f 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableC.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableC.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableD.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableD.cs index 1347e9b21b4358..ef5a3264bf85ea 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableD.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableD.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableF.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableF.cs index 2a49a83d109fa8..f5933b1708431a 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableF.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableF.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableL.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableL.cs index 9e2690611297d2..6cc2b03101307b 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableL.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableL.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableU.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableU.cs index ba0b7b50e51318..e51e1a06f91a9f 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableU.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.NullableU.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1B.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1B.cs index a1e5337f001f0d..726628e731c6f2 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1B.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1B.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1C.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1C.cs index dede7ad87b1048..4c39e0b14da361 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1C.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1C.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1D.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1D.cs index e940e84b35f7bd..0dc19c5362173b 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1D.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1D.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -40,23 +40,23 @@ unsafe partial class GenericsTest private static void TestPoint1D() { GenericsNative.Point1 value = GenericsNative.GetPoint1D(1.0); - Assert.AreEqual(value.e00, 1.0); + Assert.Equal(value.e00, 1.0); GenericsNative.Point1 value2; GenericsNative.GetPoint1DOut(1.0, &value2); - Assert.AreEqual(value2.e00, 1.0); + Assert.Equal(value2.e00, 1.0); GenericsNative.GetPoint1DOut(1.0, out GenericsNative.Point1 value3); - Assert.AreEqual(value3.e00, 1.0); + Assert.Equal(value3.e00, 1.0); GenericsNative.Point1* value4 = GenericsNative.GetPoint1DPtr(1.0); - Assert.AreEqual(value4->e00, 1.0); + Assert.Equal(value4->e00, 1.0); ref readonly GenericsNative.Point1 value5 = ref GenericsNative.GetPoint1DRef(1.0); - Assert.AreEqual(value5.e00, 1.0); + Assert.Equal(value5.e00, 1.0); GenericsNative.Point1 result = GenericsNative.AddPoint1D(value, value); - Assert.AreEqual(result.e00, 2.0); + Assert.Equal(result.e00, 2.0); GenericsNative.Point1[] values = new GenericsNative.Point1[] { value, @@ -69,13 +69,13 @@ private static void TestPoint1D() fixed (GenericsNative.Point1* pValues = &values[0]) { GenericsNative.Point1 result2 = GenericsNative.AddPoint1Ds(pValues, values.Length); - Assert.AreEqual(result2.e00, 5.0); + Assert.Equal(result2.e00, 5.0); } GenericsNative.Point1 result3 = GenericsNative.AddPoint1Ds(values, values.Length); - Assert.AreEqual(result3.e00, 5.0); + Assert.Equal(result3.e00, 5.0); GenericsNative.Point1 result4 = GenericsNative.AddPoint1Ds(in values[0], values.Length); - Assert.AreEqual(result4.e00, 5.0); + Assert.Equal(result4.e00, 5.0); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1F.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1F.cs index 55e23142b69bc7..29f6acddb6d627 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1F.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1F.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -40,23 +40,23 @@ unsafe partial class GenericsTest private static void TestPoint1F() { GenericsNative.Point1 value = GenericsNative.GetPoint1F(1.0f); - Assert.AreEqual(value.e00, 1.0f); + Assert.Equal(value.e00, 1.0f); GenericsNative.Point1 value2; GenericsNative.GetPoint1FOut(1.0f, &value2); - Assert.AreEqual(value2.e00, 1.0f); + Assert.Equal(value2.e00, 1.0f); GenericsNative.GetPoint1FOut(1.0f, out GenericsNative.Point1 value3); - Assert.AreEqual(value3.e00, 1.0f); + Assert.Equal(value3.e00, 1.0f); GenericsNative.Point1* value4 = GenericsNative.GetPoint1FPtr(1.0f); - Assert.AreEqual(value4->e00, 1.0f); + Assert.Equal(value4->e00, 1.0f); ref readonly GenericsNative.Point1 value5 = ref GenericsNative.GetPoint1FRef(1.0f); - Assert.AreEqual(value5.e00, 1.0f); + Assert.Equal(value5.e00, 1.0f); GenericsNative.Point1 result = GenericsNative.AddPoint1F(value, value); - Assert.AreEqual(result.e00, 2.0f); + Assert.Equal(result.e00, 2.0f); GenericsNative.Point1[] values = new GenericsNative.Point1[] { value, @@ -69,13 +69,13 @@ private static void TestPoint1F() fixed (GenericsNative.Point1* pValues = &values[0]) { GenericsNative.Point1 result2 = GenericsNative.AddPoint1Fs(pValues, values.Length); - Assert.AreEqual(result2.e00, 5.0f); + Assert.Equal(result2.e00, 5.0f); } GenericsNative.Point1 result3 = GenericsNative.AddPoint1Fs(values, values.Length); - Assert.AreEqual(result3.e00, 5.0f); + Assert.Equal(result3.e00, 5.0f); GenericsNative.Point1 result4 = GenericsNative.AddPoint1Fs(in values[0], values.Length); - Assert.AreEqual(result4.e00, 5.0f); + Assert.Equal(result4.e00, 5.0f); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1L.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1L.cs index 2506e2d667e1d3..d981f07d14d836 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1L.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1L.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -40,23 +40,23 @@ unsafe partial class GenericsTest private static void TestPoint1L() { GenericsNative.Point1 value = GenericsNative.GetPoint1L(1L); - Assert.AreEqual(value.e00, 1L); + Assert.Equal(value.e00, 1L); GenericsNative.Point1 value2; GenericsNative.GetPoint1LOut(1L, &value2); - Assert.AreEqual(value2.e00, 1L); + Assert.Equal(value2.e00, 1L); GenericsNative.GetPoint1LOut(1L, out GenericsNative.Point1 value3); - Assert.AreEqual(value3.e00, 1L); + Assert.Equal(value3.e00, 1L); GenericsNative.Point1* value4 = GenericsNative.GetPoint1LPtr(1L); - Assert.AreEqual(value4->e00, 1L); + Assert.Equal(value4->e00, 1L); ref readonly GenericsNative.Point1 value5 = ref GenericsNative.GetPoint1LRef(1L); - Assert.AreEqual(value5.e00, 1L); + Assert.Equal(value5.e00, 1L); GenericsNative.Point1 result = GenericsNative.AddPoint1L(value, value); - Assert.AreEqual(result.e00, 2L); + Assert.Equal(result.e00, 2L); GenericsNative.Point1[] values = new GenericsNative.Point1[] { value, @@ -69,13 +69,13 @@ private static void TestPoint1L() fixed (GenericsNative.Point1* pValues = &values[0]) { GenericsNative.Point1 result2 = GenericsNative.AddPoint1Ls(pValues, values.Length); - Assert.AreEqual(result2.e00, 5l); + Assert.Equal(result2.e00, 5l); } GenericsNative.Point1 result3 = GenericsNative.AddPoint1Ls(values, values.Length); - Assert.AreEqual(result3.e00, 5l); + Assert.Equal(result3.e00, 5l); GenericsNative.Point1 result4 = GenericsNative.AddPoint1Ls(in values[0], values.Length); - Assert.AreEqual(result4.e00, 5l); + Assert.Equal(result4.e00, 5l); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1U.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1U.cs index ecf873e0596b18..8aeda75880f2ca 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1U.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point1U.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -40,23 +40,23 @@ unsafe partial class GenericsTest private static void TestPoint1U() { GenericsNative.Point1 value = GenericsNative.GetPoint1U(1u); - Assert.AreEqual(value.e00, 1u); + Assert.Equal(value.e00, 1u); GenericsNative.Point1 value2; GenericsNative.GetPoint1UOut(1u, &value2); - Assert.AreEqual(value2.e00, 1u); + Assert.Equal(value2.e00, 1u); GenericsNative.GetPoint1UOut(1u, out GenericsNative.Point1 value3); - Assert.AreEqual(value3.e00, 1u); + Assert.Equal(value3.e00, 1u); GenericsNative.Point1* value4 = GenericsNative.GetPoint1UPtr(1u); - Assert.AreEqual(value4->e00, 1u); + Assert.Equal(value4->e00, 1u); ref readonly GenericsNative.Point1 value5 = ref GenericsNative.GetPoint1URef(1u); - Assert.AreEqual(value5.e00, 1u); + Assert.Equal(value5.e00, 1u); GenericsNative.Point1 result = GenericsNative.AddPoint1U(value, value); - Assert.AreEqual(result.e00, 2u); + Assert.Equal(result.e00, 2u); GenericsNative.Point1[] values = new GenericsNative.Point1[] { value, @@ -69,13 +69,13 @@ private static void TestPoint1U() fixed (GenericsNative.Point1* pValues = &values[0]) { GenericsNative.Point1 result2 = GenericsNative.AddPoint1Us(pValues, values.Length); - Assert.AreEqual(result2.e00, 5u); + Assert.Equal(result2.e00, 5u); } GenericsNative.Point1 result3 = GenericsNative.AddPoint1Us(values, values.Length); - Assert.AreEqual(result3.e00, 5u); + Assert.Equal(result3.e00, 5u); GenericsNative.Point1 result4 = GenericsNative.AddPoint1Us(in values[0], values.Length); - Assert.AreEqual(result4.e00, 5u); + Assert.Equal(result4.e00, 5u); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2B.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2B.cs index da42508ca407c8..41710f1bf1c1e8 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2B.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2B.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2C.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2C.cs index 3bde7d6047638d..e54ff64e86e628 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2C.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2C.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2D.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2D.cs index 47e048b3d0a73e..b269a7ac0487d1 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2D.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2D.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -40,29 +40,29 @@ unsafe partial class GenericsTest private static void TestPoint2D() { GenericsNative.Point2 value = GenericsNative.GetPoint2D(1.0, 2.0); - Assert.AreEqual(value.e00, 1.0); - Assert.AreEqual(value.e01, 2.0); + Assert.Equal(value.e00, 1.0); + Assert.Equal(value.e01, 2.0); GenericsNative.Point2 value2; GenericsNative.GetPoint2DOut(1.0, 2.0, &value2); - Assert.AreEqual(value2.e00, 1.0); - Assert.AreEqual(value2.e01, 2.0); + Assert.Equal(value2.e00, 1.0); + Assert.Equal(value2.e01, 2.0); GenericsNative.GetPoint2DOut(1.0, 2.0, out GenericsNative.Point2 value3); - Assert.AreEqual(value3.e00, 1.0); - Assert.AreEqual(value3.e01, 2.0); + Assert.Equal(value3.e00, 1.0); + Assert.Equal(value3.e01, 2.0); GenericsNative.Point2* value4 = GenericsNative.GetPoint2DPtr(1.0, 2.0); - Assert.AreEqual(value4->e00, 1.0); - Assert.AreEqual(value4->e01, 2.0); + Assert.Equal(value4->e00, 1.0); + Assert.Equal(value4->e01, 2.0); ref readonly GenericsNative.Point2 value5 = ref GenericsNative.GetPoint2DRef(1.0, 2.0); - Assert.AreEqual(value5.e00, 1.0); - Assert.AreEqual(value5.e01, 2.0); + Assert.Equal(value5.e00, 1.0); + Assert.Equal(value5.e01, 2.0); GenericsNative.Point2 result = GenericsNative.AddPoint2D(value, value); - Assert.AreEqual(result.e00, 2.0); - Assert.AreEqual(result.e01, 4.0); + Assert.Equal(result.e00, 2.0); + Assert.Equal(result.e01, 4.0); GenericsNative.Point2[] values = new GenericsNative.Point2[] { value, @@ -75,16 +75,16 @@ private static void TestPoint2D() fixed (GenericsNative.Point2* pValues = &values[0]) { GenericsNative.Point2 result2 = GenericsNative.AddPoint2Ds(pValues, values.Length); - Assert.AreEqual(result2.e00, 5.0); - Assert.AreEqual(result2.e01, 10.0); + Assert.Equal(result2.e00, 5.0); + Assert.Equal(result2.e01, 10.0); } GenericsNative.Point2 result3 = GenericsNative.AddPoint2Ds(values, values.Length); - Assert.AreEqual(result3.e00, 5.0); - Assert.AreEqual(result3.e01, 10.0); + Assert.Equal(result3.e00, 5.0); + Assert.Equal(result3.e01, 10.0); GenericsNative.Point2 result4 = GenericsNative.AddPoint2Ds(in values[0], values.Length); - Assert.AreEqual(result4.e00, 5.0); - Assert.AreEqual(result4.e01, 10.0); + Assert.Equal(result4.e00, 5.0); + Assert.Equal(result4.e01, 10.0); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2F.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2F.cs index 4a526051608081..27855458f80910 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2F.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2F.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -40,29 +40,29 @@ unsafe partial class GenericsTest private static void TestPoint2F() { GenericsNative.Point2 value = GenericsNative.GetPoint2F(1.0f, 2.0f); - Assert.AreEqual(value.e00, 1.0f); - Assert.AreEqual(value.e01, 2.0f); + Assert.Equal(value.e00, 1.0f); + Assert.Equal(value.e01, 2.0f); GenericsNative.Point2 value2; GenericsNative.GetPoint2FOut(1.0f, 2.0f, &value2); - Assert.AreEqual(value2.e00, 1.0f); - Assert.AreEqual(value2.e01, 2.0f); + Assert.Equal(value2.e00, 1.0f); + Assert.Equal(value2.e01, 2.0f); GenericsNative.GetPoint2FOut(1.0f, 2.0f, out GenericsNative.Point2 value3); - Assert.AreEqual(value3.e00, 1.0f); - Assert.AreEqual(value3.e01, 2.0f); + Assert.Equal(value3.e00, 1.0f); + Assert.Equal(value3.e01, 2.0f); GenericsNative.Point2* value4 = GenericsNative.GetPoint2FPtr(1.0f, 2.0f); - Assert.AreEqual(value4->e00, 1.0f); - Assert.AreEqual(value4->e01, 2.0f); + Assert.Equal(value4->e00, 1.0f); + Assert.Equal(value4->e01, 2.0f); ref readonly GenericsNative.Point2 value5 = ref GenericsNative.GetPoint2FRef(1.0f, 2.0f); - Assert.AreEqual(value5.e00, 1.0f); - Assert.AreEqual(value5.e01, 2.0f); + Assert.Equal(value5.e00, 1.0f); + Assert.Equal(value5.e01, 2.0f); GenericsNative.Point2 result = GenericsNative.AddPoint2F(value, value); - Assert.AreEqual(result.e00, 2.0f); - Assert.AreEqual(result.e01, 4.0f); + Assert.Equal(result.e00, 2.0f); + Assert.Equal(result.e01, 4.0f); GenericsNative.Point2[] values = new GenericsNative.Point2[] { value, @@ -75,16 +75,16 @@ private static void TestPoint2F() fixed (GenericsNative.Point2* pValues = &values[0]) { GenericsNative.Point2 result2 = GenericsNative.AddPoint2Fs(pValues, values.Length); - Assert.AreEqual(result2.e00, 5.0f); - Assert.AreEqual(result2.e01, 10.0f); + Assert.Equal(result2.e00, 5.0f); + Assert.Equal(result2.e01, 10.0f); } GenericsNative.Point2 result3 = GenericsNative.AddPoint2Fs(values, values.Length); - Assert.AreEqual(result3.e00, 5.0f); - Assert.AreEqual(result3.e01, 10.0f); + Assert.Equal(result3.e00, 5.0f); + Assert.Equal(result3.e01, 10.0f); GenericsNative.Point2 result4 = GenericsNative.AddPoint2Fs(in values[0], values.Length); - Assert.AreEqual(result4.e00, 5.0f); - Assert.AreEqual(result4.e01, 10.0f); + Assert.Equal(result4.e00, 5.0f); + Assert.Equal(result4.e01, 10.0f); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2L.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2L.cs index b62f65ebca1654..7220acb39715a6 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2L.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2L.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -40,29 +40,29 @@ unsafe partial class GenericsTest private static void TestPoint2L() { GenericsNative.Point2 value = GenericsNative.GetPoint2L(1L, 2L); - Assert.AreEqual(value.e00, 1L); - Assert.AreEqual(value.e01, 2L); + Assert.Equal(value.e00, 1L); + Assert.Equal(value.e01, 2L); GenericsNative.Point2 value2; GenericsNative.GetPoint2LOut(1L, 2L, &value2); - Assert.AreEqual(value2.e00, 1L); - Assert.AreEqual(value2.e01, 2L); + Assert.Equal(value2.e00, 1L); + Assert.Equal(value2.e01, 2L); GenericsNative.GetPoint2LOut(1L, 2L, out GenericsNative.Point2 value3); - Assert.AreEqual(value3.e00, 1L); - Assert.AreEqual(value3.e01, 2L); + Assert.Equal(value3.e00, 1L); + Assert.Equal(value3.e01, 2L); GenericsNative.Point2* value4 = GenericsNative.GetPoint2LPtr(1L, 2L); - Assert.AreEqual(value4->e00, 1L); - Assert.AreEqual(value4->e01, 2L); + Assert.Equal(value4->e00, 1L); + Assert.Equal(value4->e01, 2L); ref readonly GenericsNative.Point2 value5 = ref GenericsNative.GetPoint2LRef(1L, 2L); - Assert.AreEqual(value5.e00, 1L); - Assert.AreEqual(value5.e01, 2L); + Assert.Equal(value5.e00, 1L); + Assert.Equal(value5.e01, 2L); GenericsNative.Point2 result = GenericsNative.AddPoint2L(value, value); - Assert.AreEqual(result.e00, 2L); - Assert.AreEqual(result.e01, 4L); + Assert.Equal(result.e00, 2L); + Assert.Equal(result.e01, 4L); GenericsNative.Point2[] values = new GenericsNative.Point2[] { value, @@ -75,16 +75,16 @@ private static void TestPoint2L() fixed (GenericsNative.Point2* pValues = &values[0]) { GenericsNative.Point2 result2 = GenericsNative.AddPoint2Ls(pValues, values.Length); - Assert.AreEqual(result2.e00, 5l); - Assert.AreEqual(result2.e01, 10l); + Assert.Equal(result2.e00, 5l); + Assert.Equal(result2.e01, 10l); } GenericsNative.Point2 result3 = GenericsNative.AddPoint2Ls(values, values.Length); - Assert.AreEqual(result3.e00, 5l); - Assert.AreEqual(result3.e01, 10l); + Assert.Equal(result3.e00, 5l); + Assert.Equal(result3.e01, 10l); GenericsNative.Point2 result4 = GenericsNative.AddPoint2Ls(in values[0], values.Length); - Assert.AreEqual(result4.e00, 5l); - Assert.AreEqual(result4.e01, 10l); + Assert.Equal(result4.e00, 5l); + Assert.Equal(result4.e01, 10l); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2U.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2U.cs index 06f366216ee1eb..05d3e5f4a978a9 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2U.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point2U.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -40,29 +40,29 @@ unsafe partial class GenericsTest private static void TestPoint2U() { GenericsNative.Point2 value = GenericsNative.GetPoint2U(1u, 2u); - Assert.AreEqual(value.e00, 1u); - Assert.AreEqual(value.e01, 2u); + Assert.Equal(value.e00, 1u); + Assert.Equal(value.e01, 2u); GenericsNative.Point2 value2; GenericsNative.GetPoint2UOut(1u, 2u, &value2); - Assert.AreEqual(value2.e00, 1u); - Assert.AreEqual(value2.e01, 2u); + Assert.Equal(value2.e00, 1u); + Assert.Equal(value2.e01, 2u); GenericsNative.GetPoint2UOut(1u, 2u, out GenericsNative.Point2 value3); - Assert.AreEqual(value3.e00, 1u); - Assert.AreEqual(value3.e01, 2u); + Assert.Equal(value3.e00, 1u); + Assert.Equal(value3.e01, 2u); GenericsNative.Point2* value4 = GenericsNative.GetPoint2UPtr(1u, 2u); - Assert.AreEqual(value4->e00, 1u); - Assert.AreEqual(value4->e01, 2u); + Assert.Equal(value4->e00, 1u); + Assert.Equal(value4->e01, 2u); ref readonly GenericsNative.Point2 value5 = ref GenericsNative.GetPoint2URef(1u, 2u); - Assert.AreEqual(value5.e00, 1u); - Assert.AreEqual(value5.e01, 2u); + Assert.Equal(value5.e00, 1u); + Assert.Equal(value5.e01, 2u); GenericsNative.Point2 result = GenericsNative.AddPoint2U(value, value); - Assert.AreEqual(result.e00, 2u); - Assert.AreEqual(result.e01, 4u); + Assert.Equal(result.e00, 2u); + Assert.Equal(result.e01, 4u); GenericsNative.Point2[] values = new GenericsNative.Point2[] { value, @@ -75,16 +75,16 @@ private static void TestPoint2U() fixed (GenericsNative.Point2* pValues = &values[0]) { GenericsNative.Point2 result2 = GenericsNative.AddPoint2Us(pValues, values.Length); - Assert.AreEqual(result2.e00, 5u); - Assert.AreEqual(result2.e01, 10u); + Assert.Equal(result2.e00, 5u); + Assert.Equal(result2.e01, 10u); } GenericsNative.Point2 result3 = GenericsNative.AddPoint2Us(values, values.Length); - Assert.AreEqual(result3.e00, 5u); - Assert.AreEqual(result3.e01, 10u); + Assert.Equal(result3.e00, 5u); + Assert.Equal(result3.e01, 10u); GenericsNative.Point2 result4 = GenericsNative.AddPoint2Us(in values[0], values.Length); - Assert.AreEqual(result4.e00, 5u); - Assert.AreEqual(result4.e01, 10u); + Assert.Equal(result4.e00, 5u); + Assert.Equal(result4.e01, 10u); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3B.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3B.cs index c8262783281f3d..83fd891efc1b47 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3B.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3B.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3C.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3C.cs index c210836c6934b6..662b7d282c1d88 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3C.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3C.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3D.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3D.cs index 342038e1cc76ea..0215ce508c2c29 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3D.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3D.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -40,35 +40,35 @@ unsafe partial class GenericsTest private static void TestPoint3D() { GenericsNative.Point3 value = GenericsNative.GetPoint3D(1.0, 2.0, 3.0); - Assert.AreEqual(value.e00, 1.0); - Assert.AreEqual(value.e01, 2.0); - Assert.AreEqual(value.e02, 3.0); + Assert.Equal(value.e00, 1.0); + Assert.Equal(value.e01, 2.0); + Assert.Equal(value.e02, 3.0); GenericsNative.Point3 value2; GenericsNative.GetPoint3DOut(1.0, 2.0, 3.0, &value2); - Assert.AreEqual(value2.e00, 1.0); - Assert.AreEqual(value2.e01, 2.0); - Assert.AreEqual(value2.e02, 3.0); + Assert.Equal(value2.e00, 1.0); + Assert.Equal(value2.e01, 2.0); + Assert.Equal(value2.e02, 3.0); GenericsNative.GetPoint3DOut(1.0, 2.0, 3.0, out GenericsNative.Point3 value3); - Assert.AreEqual(value3.e00, 1.0); - Assert.AreEqual(value3.e01, 2.0); - Assert.AreEqual(value3.e02, 3.0); + Assert.Equal(value3.e00, 1.0); + Assert.Equal(value3.e01, 2.0); + Assert.Equal(value3.e02, 3.0); GenericsNative.Point3* value4 = GenericsNative.GetPoint3DPtr(1.0, 2.0, 3.0); - Assert.AreEqual(value4->e00, 1.0); - Assert.AreEqual(value4->e01, 2.0); - Assert.AreEqual(value4->e02, 3.0); + Assert.Equal(value4->e00, 1.0); + Assert.Equal(value4->e01, 2.0); + Assert.Equal(value4->e02, 3.0); ref readonly GenericsNative.Point3 value5 = ref GenericsNative.GetPoint3DRef(1.0, 2.0, 3.0); - Assert.AreEqual(value5.e00, 1.0); - Assert.AreEqual(value5.e01, 2.0); - Assert.AreEqual(value5.e02, 3.0); + Assert.Equal(value5.e00, 1.0); + Assert.Equal(value5.e01, 2.0); + Assert.Equal(value5.e02, 3.0); GenericsNative.Point3 result = GenericsNative.AddPoint3D(value, value); - Assert.AreEqual(result.e00, 2.0); - Assert.AreEqual(result.e01, 4.0); - Assert.AreEqual(result.e02, 6.0); + Assert.Equal(result.e00, 2.0); + Assert.Equal(result.e01, 4.0); + Assert.Equal(result.e02, 6.0); GenericsNative.Point3[] values = new GenericsNative.Point3[] { value, @@ -81,19 +81,19 @@ private static void TestPoint3D() fixed (GenericsNative.Point3* pValues = &values[0]) { GenericsNative.Point3 result2 = GenericsNative.AddPoint3Ds(pValues, values.Length); - Assert.AreEqual(result2.e00, 5.0); - Assert.AreEqual(result2.e01, 10.0); - Assert.AreEqual(result2.e02, 15.0); + Assert.Equal(result2.e00, 5.0); + Assert.Equal(result2.e01, 10.0); + Assert.Equal(result2.e02, 15.0); } GenericsNative.Point3 result3 = GenericsNative.AddPoint3Ds(values, values.Length); - Assert.AreEqual(result3.e00, 5.0); - Assert.AreEqual(result3.e01, 10.0); - Assert.AreEqual(result3.e02, 15.0); + Assert.Equal(result3.e00, 5.0); + Assert.Equal(result3.e01, 10.0); + Assert.Equal(result3.e02, 15.0); GenericsNative.Point3 result4 = GenericsNative.AddPoint3Ds(in values[0], values.Length); - Assert.AreEqual(result4.e00, 5.0); - Assert.AreEqual(result4.e01, 10.0); - Assert.AreEqual(result4.e02, 15.0); + Assert.Equal(result4.e00, 5.0); + Assert.Equal(result4.e01, 10.0); + Assert.Equal(result4.e02, 15.0); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3F.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3F.cs index bf66f0fd096767..bb95658a3ecec1 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3F.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3F.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -40,35 +40,35 @@ unsafe partial class GenericsTest private static void TestPoint3F() { GenericsNative.Point3 value = GenericsNative.GetPoint3F(1.0f, 2.0f, 3.0f); - Assert.AreEqual(value.e00, 1.0f); - Assert.AreEqual(value.e01, 2.0f); - Assert.AreEqual(value.e02, 3.0f); + Assert.Equal(value.e00, 1.0f); + Assert.Equal(value.e01, 2.0f); + Assert.Equal(value.e02, 3.0f); GenericsNative.Point3 value2; GenericsNative.GetPoint3FOut(1.0f, 2.0f, 3.0f, &value2); - Assert.AreEqual(value2.e00, 1.0f); - Assert.AreEqual(value2.e01, 2.0f); - Assert.AreEqual(value2.e02, 3.0f); + Assert.Equal(value2.e00, 1.0f); + Assert.Equal(value2.e01, 2.0f); + Assert.Equal(value2.e02, 3.0f); GenericsNative.GetPoint3FOut(1.0f, 2.0f, 3.0f, out GenericsNative.Point3 value3); - Assert.AreEqual(value3.e00, 1.0f); - Assert.AreEqual(value3.e01, 2.0f); - Assert.AreEqual(value3.e02, 3.0f); + Assert.Equal(value3.e00, 1.0f); + Assert.Equal(value3.e01, 2.0f); + Assert.Equal(value3.e02, 3.0f); GenericsNative.Point3* value4 = GenericsNative.GetPoint3FPtr(1.0f, 2.0f, 3.0f); - Assert.AreEqual(value4->e00, 1.0f); - Assert.AreEqual(value4->e01, 2.0f); - Assert.AreEqual(value4->e02, 3.0f); + Assert.Equal(value4->e00, 1.0f); + Assert.Equal(value4->e01, 2.0f); + Assert.Equal(value4->e02, 3.0f); ref readonly GenericsNative.Point3 value5 = ref GenericsNative.GetPoint3FRef(1.0f, 2.0f, 3.0f); - Assert.AreEqual(value5.e00, 1.0f); - Assert.AreEqual(value5.e01, 2.0f); - Assert.AreEqual(value5.e02, 3.0f); + Assert.Equal(value5.e00, 1.0f); + Assert.Equal(value5.e01, 2.0f); + Assert.Equal(value5.e02, 3.0f); GenericsNative.Point3 result = GenericsNative.AddPoint3F(value, value); - Assert.AreEqual(result.e00, 2.0f); - Assert.AreEqual(result.e01, 4.0f); - Assert.AreEqual(result.e02, 6.0f); + Assert.Equal(result.e00, 2.0f); + Assert.Equal(result.e01, 4.0f); + Assert.Equal(result.e02, 6.0f); GenericsNative.Point3[] values = new GenericsNative.Point3[] { value, @@ -81,19 +81,19 @@ private static void TestPoint3F() fixed (GenericsNative.Point3* pValues = &values[0]) { GenericsNative.Point3 result2 = GenericsNative.AddPoint3Fs(pValues, values.Length); - Assert.AreEqual(result2.e00, 5.0f); - Assert.AreEqual(result2.e01, 10.0f); - Assert.AreEqual(result2.e02, 15.0f); + Assert.Equal(result2.e00, 5.0f); + Assert.Equal(result2.e01, 10.0f); + Assert.Equal(result2.e02, 15.0f); } GenericsNative.Point3 result3 = GenericsNative.AddPoint3Fs(values, values.Length); - Assert.AreEqual(result3.e00, 5.0f); - Assert.AreEqual(result3.e01, 10.0f); - Assert.AreEqual(result3.e02, 15.0f); + Assert.Equal(result3.e00, 5.0f); + Assert.Equal(result3.e01, 10.0f); + Assert.Equal(result3.e02, 15.0f); GenericsNative.Point3 result4 = GenericsNative.AddPoint3Fs(in values[0], values.Length); - Assert.AreEqual(result4.e00, 5.0f); - Assert.AreEqual(result4.e01, 10.0f); - Assert.AreEqual(result4.e02, 15.0f); + Assert.Equal(result4.e00, 5.0f); + Assert.Equal(result4.e01, 10.0f); + Assert.Equal(result4.e02, 15.0f); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3L.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3L.cs index 2a28836ed94b62..ede3b6cbf22bb8 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3L.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3L.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -40,35 +40,35 @@ unsafe partial class GenericsTest private static void TestPoint3L() { GenericsNative.Point3 value = GenericsNative.GetPoint3L(1L, 2L, 3L); - Assert.AreEqual(value.e00, 1L); - Assert.AreEqual(value.e01, 2L); - Assert.AreEqual(value.e02, 3L); + Assert.Equal(value.e00, 1L); + Assert.Equal(value.e01, 2L); + Assert.Equal(value.e02, 3L); GenericsNative.Point3 value2; GenericsNative.GetPoint3LOut(1L, 2L, 3L, &value2); - Assert.AreEqual(value2.e00, 1L); - Assert.AreEqual(value2.e01, 2L); - Assert.AreEqual(value2.e02, 3L); + Assert.Equal(value2.e00, 1L); + Assert.Equal(value2.e01, 2L); + Assert.Equal(value2.e02, 3L); GenericsNative.GetPoint3LOut(1L, 2L, 3L, out GenericsNative.Point3 value3); - Assert.AreEqual(value3.e00, 1L); - Assert.AreEqual(value3.e01, 2L); - Assert.AreEqual(value3.e02, 3L); + Assert.Equal(value3.e00, 1L); + Assert.Equal(value3.e01, 2L); + Assert.Equal(value3.e02, 3L); GenericsNative.Point3* value4 = GenericsNative.GetPoint3LPtr(1L, 2L, 3L); - Assert.AreEqual(value4->e00, 1L); - Assert.AreEqual(value4->e01, 2L); - Assert.AreEqual(value4->e02, 3L); + Assert.Equal(value4->e00, 1L); + Assert.Equal(value4->e01, 2L); + Assert.Equal(value4->e02, 3L); ref readonly GenericsNative.Point3 value5 = ref GenericsNative.GetPoint3LRef(1L, 2L, 3L); - Assert.AreEqual(value5.e00, 1L); - Assert.AreEqual(value5.e01, 2L); - Assert.AreEqual(value5.e02, 3L); + Assert.Equal(value5.e00, 1L); + Assert.Equal(value5.e01, 2L); + Assert.Equal(value5.e02, 3L); GenericsNative.Point3 result = GenericsNative.AddPoint3L(value, value); - Assert.AreEqual(result.e00, 2L); - Assert.AreEqual(result.e01, 4L); - Assert.AreEqual(result.e02, 6l); + Assert.Equal(result.e00, 2L); + Assert.Equal(result.e01, 4L); + Assert.Equal(result.e02, 6l); GenericsNative.Point3[] values = new GenericsNative.Point3[] { value, @@ -81,19 +81,19 @@ private static void TestPoint3L() fixed (GenericsNative.Point3* pValues = &values[0]) { GenericsNative.Point3 result2 = GenericsNative.AddPoint3Ls(pValues, values.Length); - Assert.AreEqual(result2.e00, 5l); - Assert.AreEqual(result2.e01, 10l); - Assert.AreEqual(result2.e02, 15l); + Assert.Equal(result2.e00, 5l); + Assert.Equal(result2.e01, 10l); + Assert.Equal(result2.e02, 15l); } GenericsNative.Point3 result3 = GenericsNative.AddPoint3Ls(values, values.Length); - Assert.AreEqual(result3.e00, 5l); - Assert.AreEqual(result3.e01, 10l); - Assert.AreEqual(result3.e02, 15l); + Assert.Equal(result3.e00, 5l); + Assert.Equal(result3.e01, 10l); + Assert.Equal(result3.e02, 15l); GenericsNative.Point3 result4 = GenericsNative.AddPoint3Ls(in values[0], values.Length); - Assert.AreEqual(result4.e00, 5l); - Assert.AreEqual(result4.e01, 10l); - Assert.AreEqual(result4.e02, 15l); + Assert.Equal(result4.e00, 5l); + Assert.Equal(result4.e01, 10l); + Assert.Equal(result4.e02, 15l); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3U.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3U.cs index a6a859245f3510..f7ec5528c4c83c 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3U.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point3U.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -40,35 +40,35 @@ unsafe partial class GenericsTest private static void TestPoint3U() { GenericsNative.Point3 value = GenericsNative.GetPoint3U(1u, 2u, 3u); - Assert.AreEqual(value.e00, 1u); - Assert.AreEqual(value.e01, 2u); - Assert.AreEqual(value.e02, 3u); + Assert.Equal(value.e00, 1u); + Assert.Equal(value.e01, 2u); + Assert.Equal(value.e02, 3u); GenericsNative.Point3 value2; GenericsNative.GetPoint3UOut(1u, 2u, 3u, &value2); - Assert.AreEqual(value2.e00, 1u); - Assert.AreEqual(value2.e01, 2u); - Assert.AreEqual(value2.e02, 3u); + Assert.Equal(value2.e00, 1u); + Assert.Equal(value2.e01, 2u); + Assert.Equal(value2.e02, 3u); GenericsNative.GetPoint3UOut(1u, 2u, 3u, out GenericsNative.Point3 value3); - Assert.AreEqual(value3.e00, 1u); - Assert.AreEqual(value3.e01, 2u); - Assert.AreEqual(value3.e02, 3u); + Assert.Equal(value3.e00, 1u); + Assert.Equal(value3.e01, 2u); + Assert.Equal(value3.e02, 3u); GenericsNative.Point3* value4 = GenericsNative.GetPoint3UPtr(1u, 2u, 3u); - Assert.AreEqual(value4->e00, 1u); - Assert.AreEqual(value4->e01, 2u); - Assert.AreEqual(value4->e02, 3u); + Assert.Equal(value4->e00, 1u); + Assert.Equal(value4->e01, 2u); + Assert.Equal(value4->e02, 3u); ref readonly GenericsNative.Point3 value5 = ref GenericsNative.GetPoint3URef(1u, 2u, 3u); - Assert.AreEqual(value5.e00, 1u); - Assert.AreEqual(value5.e01, 2u); - Assert.AreEqual(value5.e02, 3u); + Assert.Equal(value5.e00, 1u); + Assert.Equal(value5.e01, 2u); + Assert.Equal(value5.e02, 3u); GenericsNative.Point3 result = GenericsNative.AddPoint3U(value, value); - Assert.AreEqual(result.e00, 2u); - Assert.AreEqual(result.e01, 4u); - Assert.AreEqual(result.e02, 6u); + Assert.Equal(result.e00, 2u); + Assert.Equal(result.e01, 4u); + Assert.Equal(result.e02, 6u); GenericsNative.Point3[] values = new GenericsNative.Point3[] { value, @@ -81,19 +81,19 @@ private static void TestPoint3U() fixed (GenericsNative.Point3* pValues = &values[0]) { GenericsNative.Point3 result2 = GenericsNative.AddPoint3Us(pValues, values.Length); - Assert.AreEqual(result2.e00, 5u); - Assert.AreEqual(result2.e01, 10u); - Assert.AreEqual(result2.e02, 15u); + Assert.Equal(result2.e00, 5u); + Assert.Equal(result2.e01, 10u); + Assert.Equal(result2.e02, 15u); } GenericsNative.Point3 result3 = GenericsNative.AddPoint3Us(values, values.Length); - Assert.AreEqual(result3.e00, 5u); - Assert.AreEqual(result3.e01, 10u); - Assert.AreEqual(result3.e02, 15u); + Assert.Equal(result3.e00, 5u); + Assert.Equal(result3.e01, 10u); + Assert.Equal(result3.e02, 15u); GenericsNative.Point3 result4 = GenericsNative.AddPoint3Us(in values[0], values.Length); - Assert.AreEqual(result4.e00, 5u); - Assert.AreEqual(result4.e01, 10u); - Assert.AreEqual(result4.e02, 15u); + Assert.Equal(result4.e00, 5u); + Assert.Equal(result4.e01, 10u); + Assert.Equal(result4.e02, 15u); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4B.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4B.cs index edfbd7a024f8bb..751a02c104a573 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4B.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4B.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4C.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4C.cs index e40dd646848196..ec39a719e3e0c8 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4C.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4C.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4D.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4D.cs index 81a47ab263ee74..1cee797b41b0d7 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4D.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4D.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -40,41 +40,41 @@ unsafe partial class GenericsTest private static void TestPoint4D() { GenericsNative.Point4 value = GenericsNative.GetPoint4D(1.0, 2.0, 3.0, 4.0); - Assert.AreEqual(value.e00, 1.0); - Assert.AreEqual(value.e01, 2.0); - Assert.AreEqual(value.e02, 3.0); - Assert.AreEqual(value.e03, 4.0); + Assert.Equal(value.e00, 1.0); + Assert.Equal(value.e01, 2.0); + Assert.Equal(value.e02, 3.0); + Assert.Equal(value.e03, 4.0); GenericsNative.Point4 value2; GenericsNative.GetPoint4DOut(1.0, 2.0, 3.0, 4.0, &value2); - Assert.AreEqual(value2.e00, 1.0); - Assert.AreEqual(value2.e01, 2.0); - Assert.AreEqual(value2.e02, 3.0); - Assert.AreEqual(value2.e03, 4.0); + Assert.Equal(value2.e00, 1.0); + Assert.Equal(value2.e01, 2.0); + Assert.Equal(value2.e02, 3.0); + Assert.Equal(value2.e03, 4.0); GenericsNative.GetPoint4DOut(1.0, 2.0, 3.0, 4.0, out GenericsNative.Point4 value3); - Assert.AreEqual(value3.e00, 1.0); - Assert.AreEqual(value3.e01, 2.0); - Assert.AreEqual(value3.e02, 3.0); - Assert.AreEqual(value3.e03, 4.0); + Assert.Equal(value3.e00, 1.0); + Assert.Equal(value3.e01, 2.0); + Assert.Equal(value3.e02, 3.0); + Assert.Equal(value3.e03, 4.0); GenericsNative.Point4* value4 = GenericsNative.GetPoint4DPtr(1.0, 2.0, 3.0, 4.0); - Assert.AreEqual(value4->e00, 1.0); - Assert.AreEqual(value4->e01, 2.0); - Assert.AreEqual(value4->e02, 3.0); - Assert.AreEqual(value4->e03, 4.0); + Assert.Equal(value4->e00, 1.0); + Assert.Equal(value4->e01, 2.0); + Assert.Equal(value4->e02, 3.0); + Assert.Equal(value4->e03, 4.0); ref readonly GenericsNative.Point4 value5 = ref GenericsNative.GetPoint4DRef(1.0, 2.0, 3.0, 4.0); - Assert.AreEqual(value5.e00, 1.0); - Assert.AreEqual(value5.e01, 2.0); - Assert.AreEqual(value5.e02, 3.0); - Assert.AreEqual(value5.e03, 4.0); + Assert.Equal(value5.e00, 1.0); + Assert.Equal(value5.e01, 2.0); + Assert.Equal(value5.e02, 3.0); + Assert.Equal(value5.e03, 4.0); GenericsNative.Point4 result = GenericsNative.AddPoint4D(value, value); - Assert.AreEqual(result.e00, 2.0); - Assert.AreEqual(result.e01, 4.0); - Assert.AreEqual(result.e02, 6.0); - Assert.AreEqual(result.e03, 8.0); + Assert.Equal(result.e00, 2.0); + Assert.Equal(result.e01, 4.0); + Assert.Equal(result.e02, 6.0); + Assert.Equal(result.e03, 8.0); GenericsNative.Point4[] values = new GenericsNative.Point4[] { value, @@ -87,22 +87,22 @@ private static void TestPoint4D() fixed (GenericsNative.Point4* pValues = &values[0]) { GenericsNative.Point4 result2 = GenericsNative.AddPoint4Ds(pValues, values.Length); - Assert.AreEqual(result2.e00, 5.0); - Assert.AreEqual(result2.e01, 10.0); - Assert.AreEqual(result2.e02, 15.0); - Assert.AreEqual(result2.e03, 20.0); + Assert.Equal(result2.e00, 5.0); + Assert.Equal(result2.e01, 10.0); + Assert.Equal(result2.e02, 15.0); + Assert.Equal(result2.e03, 20.0); } GenericsNative.Point4 result3 = GenericsNative.AddPoint4Ds(values, values.Length); - Assert.AreEqual(result3.e00, 5.0); - Assert.AreEqual(result3.e01, 10.0); - Assert.AreEqual(result3.e02, 15.0); - Assert.AreEqual(result3.e03, 20.0); + Assert.Equal(result3.e00, 5.0); + Assert.Equal(result3.e01, 10.0); + Assert.Equal(result3.e02, 15.0); + Assert.Equal(result3.e03, 20.0); GenericsNative.Point4 result4 = GenericsNative.AddPoint4Ds(in values[0], values.Length); - Assert.AreEqual(result4.e00, 5.0); - Assert.AreEqual(result4.e01, 10.0); - Assert.AreEqual(result4.e02, 15.0); - Assert.AreEqual(result4.e03, 20.0); + Assert.Equal(result4.e00, 5.0); + Assert.Equal(result4.e01, 10.0); + Assert.Equal(result4.e02, 15.0); + Assert.Equal(result4.e03, 20.0); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4F.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4F.cs index 0786aea0d2ca93..9c12cbf9604dc2 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4F.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4F.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -40,41 +40,41 @@ unsafe partial class GenericsTest private static void TestPoint4F() { GenericsNative.Point4 value = GenericsNative.GetPoint4F(1.0f, 2.0f, 3.0f, 4.0f); - Assert.AreEqual(value.e00, 1.0f); - Assert.AreEqual(value.e01, 2.0f); - Assert.AreEqual(value.e02, 3.0f); - Assert.AreEqual(value.e03, 4.0f); + Assert.Equal(value.e00, 1.0f); + Assert.Equal(value.e01, 2.0f); + Assert.Equal(value.e02, 3.0f); + Assert.Equal(value.e03, 4.0f); GenericsNative.Point4 value2; GenericsNative.GetPoint4FOut(1.0f, 2.0f, 3.0f, 4.0f, &value2); - Assert.AreEqual(value2.e00, 1.0f); - Assert.AreEqual(value2.e01, 2.0f); - Assert.AreEqual(value2.e02, 3.0f); - Assert.AreEqual(value2.e03, 4.0f); + Assert.Equal(value2.e00, 1.0f); + Assert.Equal(value2.e01, 2.0f); + Assert.Equal(value2.e02, 3.0f); + Assert.Equal(value2.e03, 4.0f); GenericsNative.GetPoint4FOut(1.0f, 2.0f, 3.0f, 4.0f, out GenericsNative.Point4 value3); - Assert.AreEqual(value3.e00, 1.0f); - Assert.AreEqual(value3.e01, 2.0f); - Assert.AreEqual(value3.e02, 3.0f); - Assert.AreEqual(value3.e03, 4.0f); + Assert.Equal(value3.e00, 1.0f); + Assert.Equal(value3.e01, 2.0f); + Assert.Equal(value3.e02, 3.0f); + Assert.Equal(value3.e03, 4.0f); GenericsNative.Point4* value4 = GenericsNative.GetPoint4FPtr(1.0f, 2.0f, 3.0f, 4.0f); - Assert.AreEqual(value4->e00, 1.0f); - Assert.AreEqual(value4->e01, 2.0f); - Assert.AreEqual(value4->e02, 3.0f); - Assert.AreEqual(value4->e03, 4.0f); + Assert.Equal(value4->e00, 1.0f); + Assert.Equal(value4->e01, 2.0f); + Assert.Equal(value4->e02, 3.0f); + Assert.Equal(value4->e03, 4.0f); ref readonly GenericsNative.Point4 value5 = ref GenericsNative.GetPoint4FRef(1.0f, 2.0f, 3.0f, 4.0f); - Assert.AreEqual(value5.e00, 1.0f); - Assert.AreEqual(value5.e01, 2.0f); - Assert.AreEqual(value5.e02, 3.0f); - Assert.AreEqual(value5.e03, 4.0f); + Assert.Equal(value5.e00, 1.0f); + Assert.Equal(value5.e01, 2.0f); + Assert.Equal(value5.e02, 3.0f); + Assert.Equal(value5.e03, 4.0f); GenericsNative.Point4 result = GenericsNative.AddPoint4F(value, value); - Assert.AreEqual(result.e00, 2.0f); - Assert.AreEqual(result.e01, 4.0f); - Assert.AreEqual(result.e02, 6.0f); - Assert.AreEqual(result.e03, 8.0f); + Assert.Equal(result.e00, 2.0f); + Assert.Equal(result.e01, 4.0f); + Assert.Equal(result.e02, 6.0f); + Assert.Equal(result.e03, 8.0f); GenericsNative.Point4[] values = new GenericsNative.Point4[] { value, @@ -87,22 +87,22 @@ private static void TestPoint4F() fixed (GenericsNative.Point4* pValues = &values[0]) { GenericsNative.Point4 result2 = GenericsNative.AddPoint4Fs(pValues, values.Length); - Assert.AreEqual(result2.e00, 5.0f); - Assert.AreEqual(result2.e01, 10.0f); - Assert.AreEqual(result2.e02, 15.0f); - Assert.AreEqual(result2.e03, 20.0f); + Assert.Equal(result2.e00, 5.0f); + Assert.Equal(result2.e01, 10.0f); + Assert.Equal(result2.e02, 15.0f); + Assert.Equal(result2.e03, 20.0f); } GenericsNative.Point4 result3 = GenericsNative.AddPoint4Fs(values, values.Length); - Assert.AreEqual(result3.e00, 5.0f); - Assert.AreEqual(result3.e01, 10.0f); - Assert.AreEqual(result3.e02, 15.0f); - Assert.AreEqual(result3.e03, 20.0f); + Assert.Equal(result3.e00, 5.0f); + Assert.Equal(result3.e01, 10.0f); + Assert.Equal(result3.e02, 15.0f); + Assert.Equal(result3.e03, 20.0f); GenericsNative.Point4 result4 = GenericsNative.AddPoint4Fs(in values[0], values.Length); - Assert.AreEqual(result4.e00, 5.0f); - Assert.AreEqual(result4.e01, 10.0f); - Assert.AreEqual(result4.e02, 15.0f); - Assert.AreEqual(result4.e03, 20.0f); + Assert.Equal(result4.e00, 5.0f); + Assert.Equal(result4.e01, 10.0f); + Assert.Equal(result4.e02, 15.0f); + Assert.Equal(result4.e03, 20.0f); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4L.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4L.cs index a650c5362604af..d7c29248a9efe0 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4L.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4L.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -40,41 +40,41 @@ unsafe partial class GenericsTest private static void TestPoint4L() { GenericsNative.Point4 value = GenericsNative.GetPoint4L(1L, 2L, 3L, 4L); - Assert.AreEqual(value.e00, 1L); - Assert.AreEqual(value.e01, 2L); - Assert.AreEqual(value.e02, 3L); - Assert.AreEqual(value.e03, 4L); + Assert.Equal(value.e00, 1L); + Assert.Equal(value.e01, 2L); + Assert.Equal(value.e02, 3L); + Assert.Equal(value.e03, 4L); GenericsNative.Point4 value2; GenericsNative.GetPoint4LOut(1L, 2L, 3L, 4L, &value2); - Assert.AreEqual(value2.e00, 1L); - Assert.AreEqual(value2.e01, 2L); - Assert.AreEqual(value2.e02, 3L); - Assert.AreEqual(value2.e03, 4L); + Assert.Equal(value2.e00, 1L); + Assert.Equal(value2.e01, 2L); + Assert.Equal(value2.e02, 3L); + Assert.Equal(value2.e03, 4L); GenericsNative.GetPoint4LOut(1L, 2L, 3L, 4L, out GenericsNative.Point4 value3); - Assert.AreEqual(value3.e00, 1L); - Assert.AreEqual(value3.e01, 2L); - Assert.AreEqual(value3.e02, 3L); - Assert.AreEqual(value3.e03, 4L); + Assert.Equal(value3.e00, 1L); + Assert.Equal(value3.e01, 2L); + Assert.Equal(value3.e02, 3L); + Assert.Equal(value3.e03, 4L); GenericsNative.Point4* value4 = GenericsNative.GetPoint4LPtr(1L, 2L, 3L, 4L); - Assert.AreEqual(value4->e00, 1L); - Assert.AreEqual(value4->e01, 2L); - Assert.AreEqual(value4->e02, 3L); - Assert.AreEqual(value4->e03, 4L); + Assert.Equal(value4->e00, 1L); + Assert.Equal(value4->e01, 2L); + Assert.Equal(value4->e02, 3L); + Assert.Equal(value4->e03, 4L); ref readonly GenericsNative.Point4 value5 = ref GenericsNative.GetPoint4LRef(1L, 2L, 3L, 4L); - Assert.AreEqual(value5.e00, 1L); - Assert.AreEqual(value5.e01, 2L); - Assert.AreEqual(value5.e02, 3L); - Assert.AreEqual(value5.e03, 4L); + Assert.Equal(value5.e00, 1L); + Assert.Equal(value5.e01, 2L); + Assert.Equal(value5.e02, 3L); + Assert.Equal(value5.e03, 4L); GenericsNative.Point4 result = GenericsNative.AddPoint4L(value, value); - Assert.AreEqual(result.e00, 2L); - Assert.AreEqual(result.e01, 4L); - Assert.AreEqual(result.e02, 6l); - Assert.AreEqual(result.e03, 8l); + Assert.Equal(result.e00, 2L); + Assert.Equal(result.e01, 4L); + Assert.Equal(result.e02, 6l); + Assert.Equal(result.e03, 8l); GenericsNative.Point4[] values = new GenericsNative.Point4[] { value, @@ -87,22 +87,22 @@ private static void TestPoint4L() fixed (GenericsNative.Point4* pValues = &values[0]) { GenericsNative.Point4 result2 = GenericsNative.AddPoint4Ls(pValues, values.Length); - Assert.AreEqual(result2.e00, 5l); - Assert.AreEqual(result2.e01, 10l); - Assert.AreEqual(result2.e02, 15l); - Assert.AreEqual(result2.e03, 20l); + Assert.Equal(result2.e00, 5l); + Assert.Equal(result2.e01, 10l); + Assert.Equal(result2.e02, 15l); + Assert.Equal(result2.e03, 20l); } GenericsNative.Point4 result3 = GenericsNative.AddPoint4Ls(values, values.Length); - Assert.AreEqual(result3.e00, 5l); - Assert.AreEqual(result3.e01, 10l); - Assert.AreEqual(result3.e02, 15l); - Assert.AreEqual(result3.e03, 20l); + Assert.Equal(result3.e00, 5l); + Assert.Equal(result3.e01, 10l); + Assert.Equal(result3.e02, 15l); + Assert.Equal(result3.e03, 20l); GenericsNative.Point4 result4 = GenericsNative.AddPoint4Ls(in values[0], values.Length); - Assert.AreEqual(result4.e00, 5l); - Assert.AreEqual(result4.e01, 10l); - Assert.AreEqual(result4.e02, 15l); - Assert.AreEqual(result4.e03, 20l); + Assert.Equal(result4.e00, 5l); + Assert.Equal(result4.e01, 10l); + Assert.Equal(result4.e02, 15l); + Assert.Equal(result4.e03, 20l); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4U.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4U.cs index 0c92e6662d6ad3..6f2b08ebd20181 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4U.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Point4U.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -40,41 +40,41 @@ unsafe partial class GenericsTest private static void TestPoint4U() { GenericsNative.Point4 value = GenericsNative.GetPoint4U(1u, 2u, 3u, 4u); - Assert.AreEqual(value.e00, 1u); - Assert.AreEqual(value.e01, 2u); - Assert.AreEqual(value.e02, 3u); - Assert.AreEqual(value.e03, 4u); + Assert.Equal(value.e00, 1u); + Assert.Equal(value.e01, 2u); + Assert.Equal(value.e02, 3u); + Assert.Equal(value.e03, 4u); GenericsNative.Point4 value2; GenericsNative.GetPoint4UOut(1u, 2u, 3u, 4u, &value2); - Assert.AreEqual(value2.e00, 1u); - Assert.AreEqual(value2.e01, 2u); - Assert.AreEqual(value2.e02, 3u); - Assert.AreEqual(value2.e03, 4u); + Assert.Equal(value2.e00, 1u); + Assert.Equal(value2.e01, 2u); + Assert.Equal(value2.e02, 3u); + Assert.Equal(value2.e03, 4u); GenericsNative.GetPoint4UOut(1u, 2u, 3u, 4u, out GenericsNative.Point4 value3); - Assert.AreEqual(value3.e00, 1u); - Assert.AreEqual(value3.e01, 2u); - Assert.AreEqual(value3.e02, 3u); - Assert.AreEqual(value3.e03, 4u); + Assert.Equal(value3.e00, 1u); + Assert.Equal(value3.e01, 2u); + Assert.Equal(value3.e02, 3u); + Assert.Equal(value3.e03, 4u); GenericsNative.Point4* value4 = GenericsNative.GetPoint4UPtr(1u, 2u, 3u, 4u); - Assert.AreEqual(value4->e00, 1u); - Assert.AreEqual(value4->e01, 2u); - Assert.AreEqual(value4->e02, 3u); - Assert.AreEqual(value4->e03, 4u); + Assert.Equal(value4->e00, 1u); + Assert.Equal(value4->e01, 2u); + Assert.Equal(value4->e02, 3u); + Assert.Equal(value4->e03, 4u); ref readonly GenericsNative.Point4 value5 = ref GenericsNative.GetPoint4URef(1u, 2u, 3u, 4u); - Assert.AreEqual(value5.e00, 1u); - Assert.AreEqual(value5.e01, 2u); - Assert.AreEqual(value5.e02, 3u); - Assert.AreEqual(value5.e03, 4u); + Assert.Equal(value5.e00, 1u); + Assert.Equal(value5.e01, 2u); + Assert.Equal(value5.e02, 3u); + Assert.Equal(value5.e03, 4u); GenericsNative.Point4 result = GenericsNative.AddPoint4U(value, value); - Assert.AreEqual(result.e00, 2u); - Assert.AreEqual(result.e01, 4u); - Assert.AreEqual(result.e02, 6u); - Assert.AreEqual(result.e03, 8u); + Assert.Equal(result.e00, 2u); + Assert.Equal(result.e01, 4u); + Assert.Equal(result.e02, 6u); + Assert.Equal(result.e03, 8u); GenericsNative.Point4[] values = new GenericsNative.Point4[] { value, @@ -87,22 +87,22 @@ private static void TestPoint4U() fixed (GenericsNative.Point4* pValues = &values[0]) { GenericsNative.Point4 result2 = GenericsNative.AddPoint4Us(pValues, values.Length); - Assert.AreEqual(result2.e00, 5u); - Assert.AreEqual(result2.e01, 10u); - Assert.AreEqual(result2.e02, 15u); - Assert.AreEqual(result2.e03, 20u); + Assert.Equal(result2.e00, 5u); + Assert.Equal(result2.e01, 10u); + Assert.Equal(result2.e02, 15u); + Assert.Equal(result2.e03, 20u); } GenericsNative.Point4 result3 = GenericsNative.AddPoint4Us(values, values.Length); - Assert.AreEqual(result3.e00, 5u); - Assert.AreEqual(result3.e01, 10u); - Assert.AreEqual(result3.e02, 15u); - Assert.AreEqual(result3.e03, 20u); + Assert.Equal(result3.e00, 5u); + Assert.Equal(result3.e01, 10u); + Assert.Equal(result3.e02, 15u); + Assert.Equal(result3.e03, 20u); GenericsNative.Point4 result4 = GenericsNative.AddPoint4Us(in values[0], values.Length); - Assert.AreEqual(result4.e00, 5u); - Assert.AreEqual(result4.e01, 10u); - Assert.AreEqual(result4.e02, 15u); - Assert.AreEqual(result4.e03, 20u); + Assert.Equal(result4.e00, 5u); + Assert.Equal(result4.e01, 10u); + Assert.Equal(result4.e02, 15u); + Assert.Equal(result4.e03, 20u); } } diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanB.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanB.cs index b59a1788a188fc..884e7586542c04 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanB.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanB.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanC.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanC.cs index e99656e9a2f1ca..c7cc9209b5cbc2 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanC.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanC.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanD.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanD.cs index 567f249789d7b2..9998f2c62f5de1 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanD.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanD.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanF.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanF.cs index b2018c51efa2b2..1804dc60b1b964 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanF.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanF.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanL.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanL.cs index 191b43b9071399..083ae48d40b8ea 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanL.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanL.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanU.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanU.cs index 4bcb7d305f7891..1fab3396d25f8e 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanU.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.ReadOnlySpanU.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassB.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassB.cs index 2bd9d8ba8fbe86..acd49ddde4a18a 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassB.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassB.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassC.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassC.cs index 9b22d0daeb5766..702f2c2887b7e8 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassC.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassC.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassD.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassD.cs index e9df533ad07ba3..3210f147a1a55a 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassD.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassD.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassF.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassF.cs index 2792326bd7599c..c89724ba7ecc84 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassF.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassF.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassL.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassL.cs index 32fc00b533bf72..5019035515f256 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassL.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassL.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassU.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassU.cs index 3757f7e371cab7..cf33f580754dcc 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassU.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SequentialClassU.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanB.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanB.cs index e36ac3fa110cb9..8964b3a7c5bd51 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanB.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanB.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanC.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanC.cs index 22a25cf9209c66..5b2a42faa95ea3 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanC.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanC.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanD.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanD.cs index 922f5b01142410..ab887cb9440143 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanD.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanD.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanF.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanF.cs index e6c0988b9abd5e..d93cf90ba833f4 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanF.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanF.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanL.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanL.cs index 71004f995564a5..99e19b6264ea18 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanL.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanL.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanU.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanU.cs index 805ed4fb817af0..0d7ce784caa025 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanU.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.SpanU.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128B.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128B.cs index 93885ae82800c3..1542545a912ff7 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128B.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128B.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -45,43 +45,43 @@ private static void TestVector128B() Vector128 value2; GenericsNative.GetVector128BOut(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, &value2); Vector128 tValue2 = *(Vector128*)&value2; - Assert.AreEqual(tValue2.GetElement(0), 1); - Assert.AreEqual(tValue2.GetElement(1), 0); - Assert.AreEqual(tValue2.GetElement(2), 1); - Assert.AreEqual(tValue2.GetElement(3), 0); - Assert.AreEqual(tValue2.GetElement(4), 1); - Assert.AreEqual(tValue2.GetElement(5), 0); - Assert.AreEqual(tValue2.GetElement(6), 1); - Assert.AreEqual(tValue2.GetElement(7), 0); - Assert.AreEqual(tValue2.GetElement(8), 1); - Assert.AreEqual(tValue2.GetElement(9), 0); - Assert.AreEqual(tValue2.GetElement(10), 1); - Assert.AreEqual(tValue2.GetElement(11), 0); - Assert.AreEqual(tValue2.GetElement(12), 1); - Assert.AreEqual(tValue2.GetElement(13), 0); - Assert.AreEqual(tValue2.GetElement(14), 1); - Assert.AreEqual(tValue2.GetElement(15), 0); + Assert.Equal(tValue2.GetElement(0), 1); + Assert.Equal(tValue2.GetElement(1), 0); + Assert.Equal(tValue2.GetElement(2), 1); + Assert.Equal(tValue2.GetElement(3), 0); + Assert.Equal(tValue2.GetElement(4), 1); + Assert.Equal(tValue2.GetElement(5), 0); + Assert.Equal(tValue2.GetElement(6), 1); + Assert.Equal(tValue2.GetElement(7), 0); + Assert.Equal(tValue2.GetElement(8), 1); + Assert.Equal(tValue2.GetElement(9), 0); + Assert.Equal(tValue2.GetElement(10), 1); + Assert.Equal(tValue2.GetElement(11), 0); + Assert.Equal(tValue2.GetElement(12), 1); + Assert.Equal(tValue2.GetElement(13), 0); + Assert.Equal(tValue2.GetElement(14), 1); + Assert.Equal(tValue2.GetElement(15), 0); Assert.Throws(() => GenericsNative.GetVector128BOut(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, out Vector128 value3)); Vector128* value4 = GenericsNative.GetVector128BPtr(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false); Vector128* tValue4 = (Vector128*)value4; - Assert.AreEqual(tValue4->GetElement(0), 1); - Assert.AreEqual(tValue4->GetElement(1), 0); - Assert.AreEqual(tValue4->GetElement(2), 1); - Assert.AreEqual(tValue4->GetElement(3), 0); - Assert.AreEqual(tValue4->GetElement(4), 1); - Assert.AreEqual(tValue4->GetElement(5), 0); - Assert.AreEqual(tValue4->GetElement(6), 1); - Assert.AreEqual(tValue4->GetElement(7), 0); - Assert.AreEqual(tValue4->GetElement(8), 1); - Assert.AreEqual(tValue4->GetElement(9), 0); - Assert.AreEqual(tValue4->GetElement(10), 1); - Assert.AreEqual(tValue4->GetElement(11), 0); - Assert.AreEqual(tValue4->GetElement(12), 1); - Assert.AreEqual(tValue4->GetElement(13), 0); - Assert.AreEqual(tValue4->GetElement(14), 1); - Assert.AreEqual(tValue4->GetElement(15), 0); + Assert.Equal(tValue4->GetElement(0), 1); + Assert.Equal(tValue4->GetElement(1), 0); + Assert.Equal(tValue4->GetElement(2), 1); + Assert.Equal(tValue4->GetElement(3), 0); + Assert.Equal(tValue4->GetElement(4), 1); + Assert.Equal(tValue4->GetElement(5), 0); + Assert.Equal(tValue4->GetElement(6), 1); + Assert.Equal(tValue4->GetElement(7), 0); + Assert.Equal(tValue4->GetElement(8), 1); + Assert.Equal(tValue4->GetElement(9), 0); + Assert.Equal(tValue4->GetElement(10), 1); + Assert.Equal(tValue4->GetElement(11), 0); + Assert.Equal(tValue4->GetElement(12), 1); + Assert.Equal(tValue4->GetElement(13), 0); + Assert.Equal(tValue4->GetElement(14), 1); + Assert.Equal(tValue4->GetElement(15), 0); Assert.Throws(() => GenericsNative.GetVector128BRef(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128C.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128C.cs index a03f1e03d2c794..eab8feb30aa327 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128C.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128C.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -45,27 +45,27 @@ private static void TestVector128C() Vector128 value2; GenericsNative.GetVector128COut('0', '1', '2', '3', '4', '5', '6', '7', &value2); Vector128 tValue2 = *(Vector128*)&value2; - Assert.AreEqual(tValue2.GetElement(0), (short)'0'); - Assert.AreEqual(tValue2.GetElement(1), (short)'1'); - Assert.AreEqual(tValue2.GetElement(2), (short)'2'); - Assert.AreEqual(tValue2.GetElement(3), (short)'3'); - Assert.AreEqual(tValue2.GetElement(4), (short)'4'); - Assert.AreEqual(tValue2.GetElement(5), (short)'5'); - Assert.AreEqual(tValue2.GetElement(6), (short)'6'); - Assert.AreEqual(tValue2.GetElement(7), (short)'7'); + Assert.Equal(tValue2.GetElement(0), (short)'0'); + Assert.Equal(tValue2.GetElement(1), (short)'1'); + Assert.Equal(tValue2.GetElement(2), (short)'2'); + Assert.Equal(tValue2.GetElement(3), (short)'3'); + Assert.Equal(tValue2.GetElement(4), (short)'4'); + Assert.Equal(tValue2.GetElement(5), (short)'5'); + Assert.Equal(tValue2.GetElement(6), (short)'6'); + Assert.Equal(tValue2.GetElement(7), (short)'7'); Assert.Throws(() => GenericsNative.GetVector128COut('0', '1', '2', '3', '4', '5', '6', '7', out Vector128 value3)); Vector128* value4 = GenericsNative.GetVector128CPtr('0', '1', '2', '3', '4', '5', '6', '7'); Vector128* tValue4 = (Vector128*)value4; - Assert.AreEqual(tValue4->GetElement(0), (short)'0'); - Assert.AreEqual(tValue4->GetElement(1), (short)'1'); - Assert.AreEqual(tValue4->GetElement(2), (short)'2'); - Assert.AreEqual(tValue4->GetElement(3), (short)'3'); - Assert.AreEqual(tValue4->GetElement(4), (short)'4'); - Assert.AreEqual(tValue4->GetElement(5), (short)'5'); - Assert.AreEqual(tValue4->GetElement(6), (short)'6'); - Assert.AreEqual(tValue4->GetElement(7), (short)'7'); + Assert.Equal(tValue4->GetElement(0), (short)'0'); + Assert.Equal(tValue4->GetElement(1), (short)'1'); + Assert.Equal(tValue4->GetElement(2), (short)'2'); + Assert.Equal(tValue4->GetElement(3), (short)'3'); + Assert.Equal(tValue4->GetElement(4), (short)'4'); + Assert.Equal(tValue4->GetElement(5), (short)'5'); + Assert.Equal(tValue4->GetElement(6), (short)'6'); + Assert.Equal(tValue4->GetElement(7), (short)'7'); Assert.Throws(() => GenericsNative.GetVector128CRef('0', '1', '2', '3', '4', '5', '6', '7')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128D.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128D.cs index c117145a19e6e2..553f6ec184aad1 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128D.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128D.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -44,14 +44,14 @@ private static void TestVector128D() Vector128 value2; GenericsNative.GetVector128DOut(1.0, 2.0, &value2); - Assert.AreEqual(value2.GetElement(0), 1.0); - Assert.AreEqual(value2.GetElement(1), 2.0); + Assert.Equal(value2.GetElement(0), 1.0); + Assert.Equal(value2.GetElement(1), 2.0); Assert.Throws(() => GenericsNative.GetVector128DOut(1.0, 2.0, out Vector128 value3)); Vector128* value4 = GenericsNative.GetVector128DPtr(1.0, 2.0); - Assert.AreEqual(value4->GetElement(0), 1.0); - Assert.AreEqual(value4->GetElement(1), 2.0); + Assert.Equal(value4->GetElement(0), 1.0); + Assert.Equal(value4->GetElement(1), 2.0); Assert.Throws(() => GenericsNative.GetVector128DRef(1.0, 2.0)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128F.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128F.cs index 5bcf9deae222f9..52585f3caba268 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128F.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128F.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -44,18 +44,18 @@ private static void TestVector128F() Vector128 value2; GenericsNative.GetVector128FOut(1.0f, 2.0f, 3.0f, 4.0f, &value2); - Assert.AreEqual(value2.GetElement(0), 1.0f); - Assert.AreEqual(value2.GetElement(1), 2.0f); - Assert.AreEqual(value2.GetElement(2), 3.0f); - Assert.AreEqual(value2.GetElement(3), 4.0f); + Assert.Equal(value2.GetElement(0), 1.0f); + Assert.Equal(value2.GetElement(1), 2.0f); + Assert.Equal(value2.GetElement(2), 3.0f); + Assert.Equal(value2.GetElement(3), 4.0f); Assert.Throws(() => GenericsNative.GetVector128FOut(1.0f, 2.0f, 3.0f, 4.0f, out Vector128 value3)); Vector128* value4 = GenericsNative.GetVector128FPtr(1.0f, 2.0f, 3.0f, 4.0f); - Assert.AreEqual(value4->GetElement(0), 1.0f); - Assert.AreEqual(value4->GetElement(1), 2.0f); - Assert.AreEqual(value4->GetElement(2), 3.0f); - Assert.AreEqual(value4->GetElement(3), 4.0f); + Assert.Equal(value4->GetElement(0), 1.0f); + Assert.Equal(value4->GetElement(1), 2.0f); + Assert.Equal(value4->GetElement(2), 3.0f); + Assert.Equal(value4->GetElement(3), 4.0f); Assert.Throws(() => GenericsNative.GetVector128FRef(1.0f, 2.0f, 3.0f, 4.0f)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128L.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128L.cs index 12ce1d2b22b8d3..4cda095a857a5a 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128L.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128L.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -44,14 +44,14 @@ private static void TestVector128L() Vector128 value2; GenericsNative.GetVector128LOut(1L, 2L, &value2); - Assert.AreEqual(value2.GetElement(0), 1L); - Assert.AreEqual(value2.GetElement(1), 2L); + Assert.Equal(value2.GetElement(0), 1L); + Assert.Equal(value2.GetElement(1), 2L); Assert.Throws(() => GenericsNative.GetVector128LOut(1L, 2L, out Vector128 value3)); Vector128* value4 = GenericsNative.GetVector128LPtr(1L, 2L); - Assert.AreEqual(value4->GetElement(0), 1L); - Assert.AreEqual(value4->GetElement(1), 2L); + Assert.Equal(value4->GetElement(0), 1L); + Assert.Equal(value4->GetElement(1), 2L); Assert.Throws(() => GenericsNative.GetVector128LRef(1L, 2L)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128U.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128U.cs index b30e3ff571af0f..f0b8893fdb61e3 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128U.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector128U.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -44,18 +44,18 @@ private static void TestVector128U() Vector128 value2; GenericsNative.GetVector128UOut(1u, 2u, 3u, 4u, &value2); - Assert.AreEqual(value2.GetElement(0), 1u); - Assert.AreEqual(value2.GetElement(1), 2u); - Assert.AreEqual(value2.GetElement(2), 3u); - Assert.AreEqual(value2.GetElement(3), 4u); + Assert.Equal(value2.GetElement(0), 1u); + Assert.Equal(value2.GetElement(1), 2u); + Assert.Equal(value2.GetElement(2), 3u); + Assert.Equal(value2.GetElement(3), 4u); Assert.Throws(() => GenericsNative.GetVector128UOut(1u, 2u, 3u, 4u, out Vector128 value3)); Vector128* value4 = GenericsNative.GetVector128UPtr(1u, 2u, 3u, 4u); - Assert.AreEqual(value4->GetElement(0), 1u); - Assert.AreEqual(value4->GetElement(1), 2u); - Assert.AreEqual(value4->GetElement(2), 3u); - Assert.AreEqual(value4->GetElement(3), 4u); + Assert.Equal(value4->GetElement(0), 1u); + Assert.Equal(value4->GetElement(1), 2u); + Assert.Equal(value4->GetElement(2), 3u); + Assert.Equal(value4->GetElement(3), 4u); Assert.Throws(() => GenericsNative.GetVector128URef(1u, 2u, 3u, 4u)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256B.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256B.cs index 9916b13894e50e..a4bfd5874e7aa2 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256B.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256B.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -45,75 +45,75 @@ private static void TestVector256B() Vector256 value2; GenericsNative.GetVector256BOut(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, &value2); Vector256 tValue2 = *(Vector256*)&value2; - Assert.AreEqual(tValue2.GetElement(0), 1); - Assert.AreEqual(tValue2.GetElement(1), 0); - Assert.AreEqual(tValue2.GetElement(2), 1); - Assert.AreEqual(tValue2.GetElement(3), 0); - Assert.AreEqual(tValue2.GetElement(4), 1); - Assert.AreEqual(tValue2.GetElement(5), 0); - Assert.AreEqual(tValue2.GetElement(6), 1); - Assert.AreEqual(tValue2.GetElement(7), 0); - Assert.AreEqual(tValue2.GetElement(8), 1); - Assert.AreEqual(tValue2.GetElement(9), 0); - Assert.AreEqual(tValue2.GetElement(10), 1); - Assert.AreEqual(tValue2.GetElement(11), 0); - Assert.AreEqual(tValue2.GetElement(12), 1); - Assert.AreEqual(tValue2.GetElement(13), 0); - Assert.AreEqual(tValue2.GetElement(14), 1); - Assert.AreEqual(tValue2.GetElement(15), 0); - Assert.AreEqual(tValue2.GetElement(16), 1); - Assert.AreEqual(tValue2.GetElement(17), 0); - Assert.AreEqual(tValue2.GetElement(18), 1); - Assert.AreEqual(tValue2.GetElement(19), 0); - Assert.AreEqual(tValue2.GetElement(20), 1); - Assert.AreEqual(tValue2.GetElement(21), 0); - Assert.AreEqual(tValue2.GetElement(22), 1); - Assert.AreEqual(tValue2.GetElement(23), 0); - Assert.AreEqual(tValue2.GetElement(24), 1); - Assert.AreEqual(tValue2.GetElement(25), 0); - Assert.AreEqual(tValue2.GetElement(26), 1); - Assert.AreEqual(tValue2.GetElement(27), 0); - Assert.AreEqual(tValue2.GetElement(28), 1); - Assert.AreEqual(tValue2.GetElement(29), 0); - Assert.AreEqual(tValue2.GetElement(30), 1); - Assert.AreEqual(tValue2.GetElement(31), 0); + Assert.Equal(tValue2.GetElement(0), 1); + Assert.Equal(tValue2.GetElement(1), 0); + Assert.Equal(tValue2.GetElement(2), 1); + Assert.Equal(tValue2.GetElement(3), 0); + Assert.Equal(tValue2.GetElement(4), 1); + Assert.Equal(tValue2.GetElement(5), 0); + Assert.Equal(tValue2.GetElement(6), 1); + Assert.Equal(tValue2.GetElement(7), 0); + Assert.Equal(tValue2.GetElement(8), 1); + Assert.Equal(tValue2.GetElement(9), 0); + Assert.Equal(tValue2.GetElement(10), 1); + Assert.Equal(tValue2.GetElement(11), 0); + Assert.Equal(tValue2.GetElement(12), 1); + Assert.Equal(tValue2.GetElement(13), 0); + Assert.Equal(tValue2.GetElement(14), 1); + Assert.Equal(tValue2.GetElement(15), 0); + Assert.Equal(tValue2.GetElement(16), 1); + Assert.Equal(tValue2.GetElement(17), 0); + Assert.Equal(tValue2.GetElement(18), 1); + Assert.Equal(tValue2.GetElement(19), 0); + Assert.Equal(tValue2.GetElement(20), 1); + Assert.Equal(tValue2.GetElement(21), 0); + Assert.Equal(tValue2.GetElement(22), 1); + Assert.Equal(tValue2.GetElement(23), 0); + Assert.Equal(tValue2.GetElement(24), 1); + Assert.Equal(tValue2.GetElement(25), 0); + Assert.Equal(tValue2.GetElement(26), 1); + Assert.Equal(tValue2.GetElement(27), 0); + Assert.Equal(tValue2.GetElement(28), 1); + Assert.Equal(tValue2.GetElement(29), 0); + Assert.Equal(tValue2.GetElement(30), 1); + Assert.Equal(tValue2.GetElement(31), 0); Assert.Throws(() => GenericsNative.GetVector256BOut(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, out Vector256 value3)); Vector256* value4 = GenericsNative.GetVector256BPtr(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false); Vector256* tValue4 = (Vector256*)value4; - Assert.AreEqual(tValue4->GetElement(0), 1); - Assert.AreEqual(tValue4->GetElement(1), 0); - Assert.AreEqual(tValue4->GetElement(2), 1); - Assert.AreEqual(tValue4->GetElement(3), 0); - Assert.AreEqual(tValue4->GetElement(4), 1); - Assert.AreEqual(tValue4->GetElement(5), 0); - Assert.AreEqual(tValue4->GetElement(6), 1); - Assert.AreEqual(tValue4->GetElement(7), 0); - Assert.AreEqual(tValue4->GetElement(8), 1); - Assert.AreEqual(tValue4->GetElement(9), 0); - Assert.AreEqual(tValue4->GetElement(10), 1); - Assert.AreEqual(tValue4->GetElement(11), 0); - Assert.AreEqual(tValue4->GetElement(12), 1); - Assert.AreEqual(tValue4->GetElement(13), 0); - Assert.AreEqual(tValue4->GetElement(14), 1); - Assert.AreEqual(tValue4->GetElement(15), 0); - Assert.AreEqual(tValue4->GetElement(16), 1); - Assert.AreEqual(tValue4->GetElement(17), 0); - Assert.AreEqual(tValue4->GetElement(18), 1); - Assert.AreEqual(tValue4->GetElement(19), 0); - Assert.AreEqual(tValue4->GetElement(20), 1); - Assert.AreEqual(tValue4->GetElement(21), 0); - Assert.AreEqual(tValue4->GetElement(22), 1); - Assert.AreEqual(tValue4->GetElement(23), 0); - Assert.AreEqual(tValue4->GetElement(24), 1); - Assert.AreEqual(tValue4->GetElement(25), 0); - Assert.AreEqual(tValue4->GetElement(26), 1); - Assert.AreEqual(tValue4->GetElement(27), 0); - Assert.AreEqual(tValue4->GetElement(28), 1); - Assert.AreEqual(tValue4->GetElement(29), 0); - Assert.AreEqual(tValue4->GetElement(30), 1); - Assert.AreEqual(tValue4->GetElement(31), 0); + Assert.Equal(tValue4->GetElement(0), 1); + Assert.Equal(tValue4->GetElement(1), 0); + Assert.Equal(tValue4->GetElement(2), 1); + Assert.Equal(tValue4->GetElement(3), 0); + Assert.Equal(tValue4->GetElement(4), 1); + Assert.Equal(tValue4->GetElement(5), 0); + Assert.Equal(tValue4->GetElement(6), 1); + Assert.Equal(tValue4->GetElement(7), 0); + Assert.Equal(tValue4->GetElement(8), 1); + Assert.Equal(tValue4->GetElement(9), 0); + Assert.Equal(tValue4->GetElement(10), 1); + Assert.Equal(tValue4->GetElement(11), 0); + Assert.Equal(tValue4->GetElement(12), 1); + Assert.Equal(tValue4->GetElement(13), 0); + Assert.Equal(tValue4->GetElement(14), 1); + Assert.Equal(tValue4->GetElement(15), 0); + Assert.Equal(tValue4->GetElement(16), 1); + Assert.Equal(tValue4->GetElement(17), 0); + Assert.Equal(tValue4->GetElement(18), 1); + Assert.Equal(tValue4->GetElement(19), 0); + Assert.Equal(tValue4->GetElement(20), 1); + Assert.Equal(tValue4->GetElement(21), 0); + Assert.Equal(tValue4->GetElement(22), 1); + Assert.Equal(tValue4->GetElement(23), 0); + Assert.Equal(tValue4->GetElement(24), 1); + Assert.Equal(tValue4->GetElement(25), 0); + Assert.Equal(tValue4->GetElement(26), 1); + Assert.Equal(tValue4->GetElement(27), 0); + Assert.Equal(tValue4->GetElement(28), 1); + Assert.Equal(tValue4->GetElement(29), 0); + Assert.Equal(tValue4->GetElement(30), 1); + Assert.Equal(tValue4->GetElement(31), 0); Assert.Throws(() => GenericsNative.GetVector256BRef(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256C.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256C.cs index 847806801d9d02..37a6119e719d1f 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256C.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256C.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -45,43 +45,43 @@ private static void TestVector256C() Vector256 value2; GenericsNative.GetVector256COut('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', &value2); Vector256 tValue2 = *(Vector256*)&value2; - Assert.AreEqual(tValue2.GetElement(0), (short)'0'); - Assert.AreEqual(tValue2.GetElement(1), (short)'1'); - Assert.AreEqual(tValue2.GetElement(2), (short)'2'); - Assert.AreEqual(tValue2.GetElement(3), (short)'3'); - Assert.AreEqual(tValue2.GetElement(4), (short)'4'); - Assert.AreEqual(tValue2.GetElement(5), (short)'5'); - Assert.AreEqual(tValue2.GetElement(6), (short)'6'); - Assert.AreEqual(tValue2.GetElement(7), (short)'7'); - Assert.AreEqual(tValue2.GetElement(8), (short)'8'); - Assert.AreEqual(tValue2.GetElement(9), (short)'9'); - Assert.AreEqual(tValue2.GetElement(10), (short)'A'); - Assert.AreEqual(tValue2.GetElement(11), (short)'B'); - Assert.AreEqual(tValue2.GetElement(12), (short)'C'); - Assert.AreEqual(tValue2.GetElement(13), (short)'D'); - Assert.AreEqual(tValue2.GetElement(14), (short)'E'); - Assert.AreEqual(tValue2.GetElement(15), (short)'F'); + Assert.Equal(tValue2.GetElement(0), (short)'0'); + Assert.Equal(tValue2.GetElement(1), (short)'1'); + Assert.Equal(tValue2.GetElement(2), (short)'2'); + Assert.Equal(tValue2.GetElement(3), (short)'3'); + Assert.Equal(tValue2.GetElement(4), (short)'4'); + Assert.Equal(tValue2.GetElement(5), (short)'5'); + Assert.Equal(tValue2.GetElement(6), (short)'6'); + Assert.Equal(tValue2.GetElement(7), (short)'7'); + Assert.Equal(tValue2.GetElement(8), (short)'8'); + Assert.Equal(tValue2.GetElement(9), (short)'9'); + Assert.Equal(tValue2.GetElement(10), (short)'A'); + Assert.Equal(tValue2.GetElement(11), (short)'B'); + Assert.Equal(tValue2.GetElement(12), (short)'C'); + Assert.Equal(tValue2.GetElement(13), (short)'D'); + Assert.Equal(tValue2.GetElement(14), (short)'E'); + Assert.Equal(tValue2.GetElement(15), (short)'F'); Assert.Throws(() => GenericsNative.GetVector256COut('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', out Vector256 value3)); Vector256* value4 = GenericsNative.GetVector256CPtr('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'); Vector256* tValue4 = (Vector256*)value4; - Assert.AreEqual(tValue4->GetElement(0), (short)'0'); - Assert.AreEqual(tValue4->GetElement(1), (short)'1'); - Assert.AreEqual(tValue4->GetElement(2), (short)'2'); - Assert.AreEqual(tValue4->GetElement(3), (short)'3'); - Assert.AreEqual(tValue4->GetElement(4), (short)'4'); - Assert.AreEqual(tValue4->GetElement(5), (short)'5'); - Assert.AreEqual(tValue4->GetElement(6), (short)'6'); - Assert.AreEqual(tValue4->GetElement(7), (short)'7'); - Assert.AreEqual(tValue4->GetElement(8), (short)'8'); - Assert.AreEqual(tValue4->GetElement(9), (short)'9'); - Assert.AreEqual(tValue4->GetElement(10), (short)'A'); - Assert.AreEqual(tValue4->GetElement(11), (short)'B'); - Assert.AreEqual(tValue4->GetElement(12), (short)'C'); - Assert.AreEqual(tValue4->GetElement(13), (short)'D'); - Assert.AreEqual(tValue4->GetElement(14), (short)'E'); - Assert.AreEqual(tValue4->GetElement(15), (short)'F'); + Assert.Equal(tValue4->GetElement(0), (short)'0'); + Assert.Equal(tValue4->GetElement(1), (short)'1'); + Assert.Equal(tValue4->GetElement(2), (short)'2'); + Assert.Equal(tValue4->GetElement(3), (short)'3'); + Assert.Equal(tValue4->GetElement(4), (short)'4'); + Assert.Equal(tValue4->GetElement(5), (short)'5'); + Assert.Equal(tValue4->GetElement(6), (short)'6'); + Assert.Equal(tValue4->GetElement(7), (short)'7'); + Assert.Equal(tValue4->GetElement(8), (short)'8'); + Assert.Equal(tValue4->GetElement(9), (short)'9'); + Assert.Equal(tValue4->GetElement(10), (short)'A'); + Assert.Equal(tValue4->GetElement(11), (short)'B'); + Assert.Equal(tValue4->GetElement(12), (short)'C'); + Assert.Equal(tValue4->GetElement(13), (short)'D'); + Assert.Equal(tValue4->GetElement(14), (short)'E'); + Assert.Equal(tValue4->GetElement(15), (short)'F'); Assert.Throws(() => GenericsNative.GetVector256CRef('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256D.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256D.cs index 3a7bc810deaa60..527ce2319b7bbf 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256D.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256D.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -44,18 +44,18 @@ private static void TestVector256D() Vector256 value2; GenericsNative.GetVector256DOut(1.0, 2.0, 3.0, 4.0, &value2); - Assert.AreEqual(value2.GetElement(0), 1.0); - Assert.AreEqual(value2.GetElement(1), 2.0); - Assert.AreEqual(value2.GetElement(2), 3.0); - Assert.AreEqual(value2.GetElement(3), 4.0); + Assert.Equal(value2.GetElement(0), 1.0); + Assert.Equal(value2.GetElement(1), 2.0); + Assert.Equal(value2.GetElement(2), 3.0); + Assert.Equal(value2.GetElement(3), 4.0); Assert.Throws(() => GenericsNative.GetVector256DOut(1.0, 2.0, 3.0, 4.0, out Vector256 value3)); Vector256* value4 = GenericsNative.GetVector256DPtr(1.0, 2.0, 3.0, 4.0); - Assert.AreEqual(value4->GetElement(0), 1.0); - Assert.AreEqual(value4->GetElement(1), 2.0); - Assert.AreEqual(value4->GetElement(2), 3.0); - Assert.AreEqual(value4->GetElement(3), 4.0); + Assert.Equal(value4->GetElement(0), 1.0); + Assert.Equal(value4->GetElement(1), 2.0); + Assert.Equal(value4->GetElement(2), 3.0); + Assert.Equal(value4->GetElement(3), 4.0); Assert.Throws(() => GenericsNative.GetVector256DRef(1.0, 2.0, 3.0, 4.0)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256F.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256F.cs index 9d7c4398fc1eee..601f400316ac99 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256F.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256F.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -44,26 +44,26 @@ private static void TestVector256F() Vector256 value2; GenericsNative.GetVector256FOut(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, &value2); - Assert.AreEqual(value2.GetElement(0), 1.0f); - Assert.AreEqual(value2.GetElement(1), 2.0f); - Assert.AreEqual(value2.GetElement(2), 3.0f); - Assert.AreEqual(value2.GetElement(3), 4.0f); - Assert.AreEqual(value2.GetElement(4), 5.0f); - Assert.AreEqual(value2.GetElement(5), 6.0f); - Assert.AreEqual(value2.GetElement(6), 7.0f); - Assert.AreEqual(value2.GetElement(7), 8.0f); + Assert.Equal(value2.GetElement(0), 1.0f); + Assert.Equal(value2.GetElement(1), 2.0f); + Assert.Equal(value2.GetElement(2), 3.0f); + Assert.Equal(value2.GetElement(3), 4.0f); + Assert.Equal(value2.GetElement(4), 5.0f); + Assert.Equal(value2.GetElement(5), 6.0f); + Assert.Equal(value2.GetElement(6), 7.0f); + Assert.Equal(value2.GetElement(7), 8.0f); Assert.Throws(() => GenericsNative.GetVector256FOut(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, out Vector256 value3)); Vector256* value4 = GenericsNative.GetVector256FPtr(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f); - Assert.AreEqual(value4->GetElement(0), 1.0f); - Assert.AreEqual(value4->GetElement(1), 2.0f); - Assert.AreEqual(value4->GetElement(2), 3.0f); - Assert.AreEqual(value4->GetElement(3), 4.0f); - Assert.AreEqual(value4->GetElement(4), 5.0f); - Assert.AreEqual(value4->GetElement(5), 6.0f); - Assert.AreEqual(value4->GetElement(6), 7.0f); - Assert.AreEqual(value4->GetElement(7), 8.0f); + Assert.Equal(value4->GetElement(0), 1.0f); + Assert.Equal(value4->GetElement(1), 2.0f); + Assert.Equal(value4->GetElement(2), 3.0f); + Assert.Equal(value4->GetElement(3), 4.0f); + Assert.Equal(value4->GetElement(4), 5.0f); + Assert.Equal(value4->GetElement(5), 6.0f); + Assert.Equal(value4->GetElement(6), 7.0f); + Assert.Equal(value4->GetElement(7), 8.0f); Assert.Throws(() => GenericsNative.GetVector256FRef(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256L.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256L.cs index 167e91fc7536b5..a1ff3223f526c0 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256L.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256L.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -44,18 +44,18 @@ private static void TestVector256L() Vector256 value2; GenericsNative.GetVector256LOut(1L, 2L, 3L, 4L, &value2); - Assert.AreEqual(value2.GetElement(0), 1L); - Assert.AreEqual(value2.GetElement(1), 2L); - Assert.AreEqual(value2.GetElement(2), 3L); - Assert.AreEqual(value2.GetElement(3), 4L); + Assert.Equal(value2.GetElement(0), 1L); + Assert.Equal(value2.GetElement(1), 2L); + Assert.Equal(value2.GetElement(2), 3L); + Assert.Equal(value2.GetElement(3), 4L); Assert.Throws(() => GenericsNative.GetVector256LOut(1L, 2L, 3L, 4L, out Vector256 value3)); Vector256* value4 = GenericsNative.GetVector256LPtr(1L, 2L, 3L, 4L); - Assert.AreEqual(value4->GetElement(0), 1L); - Assert.AreEqual(value4->GetElement(1), 2L); - Assert.AreEqual(value4->GetElement(2), 3L); - Assert.AreEqual(value4->GetElement(3), 4L); + Assert.Equal(value4->GetElement(0), 1L); + Assert.Equal(value4->GetElement(1), 2L); + Assert.Equal(value4->GetElement(2), 3L); + Assert.Equal(value4->GetElement(3), 4L); Assert.Throws(() => GenericsNative.GetVector256LRef(1L, 2L, 3L, 4L)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256U.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256U.cs index 138c020cc8823e..c4b468ae67ff60 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256U.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector256U.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -44,26 +44,26 @@ private static void TestVector256U() Vector256 value2; GenericsNative.GetVector256UOut(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, &value2); - Assert.AreEqual(value2.GetElement(0), 1u); - Assert.AreEqual(value2.GetElement(1), 2u); - Assert.AreEqual(value2.GetElement(2), 3u); - Assert.AreEqual(value2.GetElement(3), 4u); - Assert.AreEqual(value2.GetElement(4), 5u); - Assert.AreEqual(value2.GetElement(5), 6u); - Assert.AreEqual(value2.GetElement(6), 7u); - Assert.AreEqual(value2.GetElement(7), 8u); + Assert.Equal(value2.GetElement(0), 1u); + Assert.Equal(value2.GetElement(1), 2u); + Assert.Equal(value2.GetElement(2), 3u); + Assert.Equal(value2.GetElement(3), 4u); + Assert.Equal(value2.GetElement(4), 5u); + Assert.Equal(value2.GetElement(5), 6u); + Assert.Equal(value2.GetElement(6), 7u); + Assert.Equal(value2.GetElement(7), 8u); Assert.Throws(() => GenericsNative.GetVector256UOut(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, out Vector256 value3)); Vector256* value4 = GenericsNative.GetVector256UPtr(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u); - Assert.AreEqual(value4->GetElement(0), 1u); - Assert.AreEqual(value4->GetElement(1), 2u); - Assert.AreEqual(value4->GetElement(2), 3u); - Assert.AreEqual(value4->GetElement(3), 4u); - Assert.AreEqual(value4->GetElement(4), 5u); - Assert.AreEqual(value4->GetElement(5), 6u); - Assert.AreEqual(value4->GetElement(6), 7u); - Assert.AreEqual(value4->GetElement(7), 8u); + Assert.Equal(value4->GetElement(0), 1u); + Assert.Equal(value4->GetElement(1), 2u); + Assert.Equal(value4->GetElement(2), 3u); + Assert.Equal(value4->GetElement(3), 4u); + Assert.Equal(value4->GetElement(4), 5u); + Assert.Equal(value4->GetElement(5), 6u); + Assert.Equal(value4->GetElement(6), 7u); + Assert.Equal(value4->GetElement(7), 8u); Assert.Throws(() => GenericsNative.GetVector256URef(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64B.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64B.cs index 78befd919aa009..d0961cb506a325 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64B.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64B.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -45,27 +45,27 @@ private static void TestVector64B() Vector64 value2; GenericsNative.GetVector64BOut(true, false, true, false, true, false, true, false, &value2); Vector64 tValue2 = *(Vector64*)&value2; - Assert.AreEqual(tValue2.GetElement(0), 1); - Assert.AreEqual(tValue2.GetElement(1), 0); - Assert.AreEqual(tValue2.GetElement(2), 1); - Assert.AreEqual(tValue2.GetElement(3), 0); - Assert.AreEqual(tValue2.GetElement(4), 1); - Assert.AreEqual(tValue2.GetElement(5), 0); - Assert.AreEqual(tValue2.GetElement(6), 1); - Assert.AreEqual(tValue2.GetElement(7), 0); + Assert.Equal(tValue2.GetElement(0), 1); + Assert.Equal(tValue2.GetElement(1), 0); + Assert.Equal(tValue2.GetElement(2), 1); + Assert.Equal(tValue2.GetElement(3), 0); + Assert.Equal(tValue2.GetElement(4), 1); + Assert.Equal(tValue2.GetElement(5), 0); + Assert.Equal(tValue2.GetElement(6), 1); + Assert.Equal(tValue2.GetElement(7), 0); Assert.Throws(() => GenericsNative.GetVector64BOut(true, false, true, false, true, false, true, false, out Vector64 value3)); Vector64* value4 = GenericsNative.GetVector64BPtr(true, false, true, false, true, false, true, false); Vector64* tValue4 = (Vector64*)value4; - Assert.AreEqual(tValue4->GetElement(0), 1); - Assert.AreEqual(tValue4->GetElement(1), 0); - Assert.AreEqual(tValue4->GetElement(2), 1); - Assert.AreEqual(tValue4->GetElement(3), 0); - Assert.AreEqual(tValue4->GetElement(4), 1); - Assert.AreEqual(tValue4->GetElement(5), 0); - Assert.AreEqual(tValue4->GetElement(6), 1); - Assert.AreEqual(tValue4->GetElement(7), 0); + Assert.Equal(tValue4->GetElement(0), 1); + Assert.Equal(tValue4->GetElement(1), 0); + Assert.Equal(tValue4->GetElement(2), 1); + Assert.Equal(tValue4->GetElement(3), 0); + Assert.Equal(tValue4->GetElement(4), 1); + Assert.Equal(tValue4->GetElement(5), 0); + Assert.Equal(tValue4->GetElement(6), 1); + Assert.Equal(tValue4->GetElement(7), 0); Assert.Throws(() => GenericsNative.GetVector64BRef(true, false, true, false, true, false, true, false)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64C.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64C.cs index f0214f73ac947e..265e5a90e305c9 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64C.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64C.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -45,19 +45,19 @@ private static void TestVector64C() Vector64 value2; GenericsNative.GetVector64COut('0', '1', '2', '3', &value2); Vector64 tValue2 = *(Vector64*)&value2; - Assert.AreEqual(tValue2.GetElement(0), (short)'0'); - Assert.AreEqual(tValue2.GetElement(1), (short)'1'); - Assert.AreEqual(tValue2.GetElement(2), (short)'2'); - Assert.AreEqual(tValue2.GetElement(3), (short)'3'); + Assert.Equal(tValue2.GetElement(0), (short)'0'); + Assert.Equal(tValue2.GetElement(1), (short)'1'); + Assert.Equal(tValue2.GetElement(2), (short)'2'); + Assert.Equal(tValue2.GetElement(3), (short)'3'); Assert.Throws(() => GenericsNative.GetVector64COut('0', '1', '2', '3', out Vector64 value3)); Vector64* value4 = GenericsNative.GetVector64CPtr('0', '1', '2', '3'); Vector64* tValue4 = (Vector64*)value4; - Assert.AreEqual(tValue4->GetElement(0), (short)'0'); - Assert.AreEqual(tValue4->GetElement(1), (short)'1'); - Assert.AreEqual(tValue4->GetElement(2), (short)'2'); - Assert.AreEqual(tValue4->GetElement(3), (short)'3'); + Assert.Equal(tValue4->GetElement(0), (short)'0'); + Assert.Equal(tValue4->GetElement(1), (short)'1'); + Assert.Equal(tValue4->GetElement(2), (short)'2'); + Assert.Equal(tValue4->GetElement(3), (short)'3'); Assert.Throws(() => GenericsNative.GetVector64CRef('0', '1', '2', '3')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64D.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64D.cs index 04e0ff6a52e5ae..2be39f93bdb4c4 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64D.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64D.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -44,12 +44,12 @@ private static void TestVector64D() Vector64 value2; GenericsNative.GetVector64DOut(1.0, &value2); - Assert.AreEqual(value2.GetElement(0), 1.0); + Assert.Equal(value2.GetElement(0), 1.0); Assert.Throws(() => GenericsNative.GetVector64DOut(1.0, out Vector64 value3)); Vector64* value4 = GenericsNative.GetVector64DPtr(1.0); - Assert.AreEqual(value4->GetElement(0), 1.0); + Assert.Equal(value4->GetElement(0), 1.0); Assert.Throws(() => GenericsNative.GetVector64DRef(1.0)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64F.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64F.cs index 9397a8386e2391..54a3cadbd93ec6 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64F.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64F.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -44,14 +44,14 @@ private static void TestVector64F() Vector64 value2; GenericsNative.GetVector64FOut(1.0f, 2.0f, &value2); - Assert.AreEqual(value2.GetElement(0), 1.0f); - Assert.AreEqual(value2.GetElement(1), 2.0f); + Assert.Equal(value2.GetElement(0), 1.0f); + Assert.Equal(value2.GetElement(1), 2.0f); Assert.Throws(() => GenericsNative.GetVector64FOut(1.0f, 2.0f, out Vector64 value3)); Vector64* value4 = GenericsNative.GetVector64FPtr(1.0f, 2.0f); - Assert.AreEqual(value4->GetElement(0), 1.0f); - Assert.AreEqual(value4->GetElement(1), 2.0f); + Assert.Equal(value4->GetElement(0), 1.0f); + Assert.Equal(value4->GetElement(1), 2.0f); Assert.Throws(() => GenericsNative.GetVector64FRef(1.0f, 2.0f)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64L.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64L.cs index 1e24a89da0818a..cb215a0515b02d 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64L.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64L.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -44,12 +44,12 @@ private static void TestVector64L() Vector64 value2; GenericsNative.GetVector64LOut(1L, &value2); - Assert.AreEqual(value2.GetElement(0), 1L); + Assert.Equal(value2.GetElement(0), 1L); Assert.Throws(() => GenericsNative.GetVector64LOut(1L, out Vector64 value3)); Vector64* value4 = GenericsNative.GetVector64LPtr(1L); - Assert.AreEqual(value4->GetElement(0), 1L); + Assert.Equal(value4->GetElement(0), 1L); Assert.Throws(() => GenericsNative.GetVector64LRef(1L)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64U.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64U.cs index 6d305a6094fa64..20be15fca9cf14 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64U.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.Vector64U.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -44,14 +44,14 @@ private static void TestVector64U() Vector64 value2; GenericsNative.GetVector64UOut(1u, 2u, &value2); - Assert.AreEqual(value2.GetElement(0), 1u); - Assert.AreEqual(value2.GetElement(1), 2u); + Assert.Equal(value2.GetElement(0), 1u); + Assert.Equal(value2.GetElement(1), 2u); Assert.Throws(() => GenericsNative.GetVector64UOut(1u, 2u, out Vector64 value3)); Vector64* value4 = GenericsNative.GetVector64UPtr(1u, 2u); - Assert.AreEqual(value4->GetElement(0), 1u); - Assert.AreEqual(value4->GetElement(1), 2u); + Assert.Equal(value4->GetElement(0), 1u); + Assert.Equal(value4->GetElement(1), 2u); Assert.Throws(() => GenericsNative.GetVector64URef(1u, 2u)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorB.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorB.cs index 4ba03f2d28b12e..16d6d42882d7b0 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorB.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorB.cs @@ -4,7 +4,7 @@ using System; using System.Numerics; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -73,7 +73,7 @@ private static void TestVectorB() } else { - Assert.AreEqual(Vector.Count, 16); + Assert.Equal(Vector.Count, 16); TestVectorB128(); } } @@ -85,43 +85,43 @@ private static void TestVectorB128() Vector value2; GenericsNative.GetVectorB128Out(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, &value2); Vector tValue2 = *(Vector*)&value2; - Assert.AreEqual(tValue2[0], 1); - Assert.AreEqual(tValue2[1], 0); - Assert.AreEqual(tValue2[2], 1); - Assert.AreEqual(tValue2[3], 0); - Assert.AreEqual(tValue2[4], 1); - Assert.AreEqual(tValue2[5], 0); - Assert.AreEqual(tValue2[6], 1); - Assert.AreEqual(tValue2[7], 0); - Assert.AreEqual(tValue2[8], 1); - Assert.AreEqual(tValue2[9], 0); - Assert.AreEqual(tValue2[10], 1); - Assert.AreEqual(tValue2[11], 0); - Assert.AreEqual(tValue2[12], 1); - Assert.AreEqual(tValue2[13], 0); - Assert.AreEqual(tValue2[14], 1); - Assert.AreEqual(tValue2[15], 0); + Assert.Equal(tValue2[0], 1); + Assert.Equal(tValue2[1], 0); + Assert.Equal(tValue2[2], 1); + Assert.Equal(tValue2[3], 0); + Assert.Equal(tValue2[4], 1); + Assert.Equal(tValue2[5], 0); + Assert.Equal(tValue2[6], 1); + Assert.Equal(tValue2[7], 0); + Assert.Equal(tValue2[8], 1); + Assert.Equal(tValue2[9], 0); + Assert.Equal(tValue2[10], 1); + Assert.Equal(tValue2[11], 0); + Assert.Equal(tValue2[12], 1); + Assert.Equal(tValue2[13], 0); + Assert.Equal(tValue2[14], 1); + Assert.Equal(tValue2[15], 0); Assert.Throws(() => GenericsNative.GetVectorB128Out(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, out Vector value3)); Vector* value4 = GenericsNative.GetVectorB128Ptr(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false); Vector* tValue4 = (Vector*)value4; - Assert.AreEqual((*tValue4)[0], 1); - Assert.AreEqual((*tValue4)[1], 0); - Assert.AreEqual((*tValue4)[2], 1); - Assert.AreEqual((*tValue4)[3], 0); - Assert.AreEqual((*tValue4)[4], 1); - Assert.AreEqual((*tValue4)[5], 0); - Assert.AreEqual((*tValue4)[6], 1); - Assert.AreEqual((*tValue4)[7], 0); - Assert.AreEqual((*tValue4)[8], 1); - Assert.AreEqual((*tValue4)[9], 0); - Assert.AreEqual((*tValue4)[10], 1); - Assert.AreEqual((*tValue4)[11], 0); - Assert.AreEqual((*tValue4)[12], 1); - Assert.AreEqual((*tValue4)[13], 0); - Assert.AreEqual((*tValue4)[14], 1); - Assert.AreEqual((*tValue4)[15], 0); + Assert.Equal((*tValue4)[0], 1); + Assert.Equal((*tValue4)[1], 0); + Assert.Equal((*tValue4)[2], 1); + Assert.Equal((*tValue4)[3], 0); + Assert.Equal((*tValue4)[4], 1); + Assert.Equal((*tValue4)[5], 0); + Assert.Equal((*tValue4)[6], 1); + Assert.Equal((*tValue4)[7], 0); + Assert.Equal((*tValue4)[8], 1); + Assert.Equal((*tValue4)[9], 0); + Assert.Equal((*tValue4)[10], 1); + Assert.Equal((*tValue4)[11], 0); + Assert.Equal((*tValue4)[12], 1); + Assert.Equal((*tValue4)[13], 0); + Assert.Equal((*tValue4)[14], 1); + Assert.Equal((*tValue4)[15], 0); Assert.Throws(() => GenericsNative.GetVectorB128Ref(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false)); @@ -154,75 +154,75 @@ private static void TestVectorB256() Vector value2; GenericsNative.GetVectorB256Out(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, &value2); Vector tValue2 = *(Vector*)&value2; - Assert.AreEqual(tValue2[0], 1); - Assert.AreEqual(tValue2[1], 0); - Assert.AreEqual(tValue2[2], 1); - Assert.AreEqual(tValue2[3], 0); - Assert.AreEqual(tValue2[4], 1); - Assert.AreEqual(tValue2[5], 0); - Assert.AreEqual(tValue2[6], 1); - Assert.AreEqual(tValue2[7], 0); - Assert.AreEqual(tValue2[8], 1); - Assert.AreEqual(tValue2[9], 0); - Assert.AreEqual(tValue2[10], 1); - Assert.AreEqual(tValue2[11], 0); - Assert.AreEqual(tValue2[12], 1); - Assert.AreEqual(tValue2[13], 0); - Assert.AreEqual(tValue2[14], 1); - Assert.AreEqual(tValue2[15], 0); - Assert.AreEqual(tValue2[16], 1); - Assert.AreEqual(tValue2[17], 0); - Assert.AreEqual(tValue2[18], 1); - Assert.AreEqual(tValue2[19], 0); - Assert.AreEqual(tValue2[20], 1); - Assert.AreEqual(tValue2[21], 0); - Assert.AreEqual(tValue2[22], 1); - Assert.AreEqual(tValue2[23], 0); - Assert.AreEqual(tValue2[24], 1); - Assert.AreEqual(tValue2[25], 0); - Assert.AreEqual(tValue2[26], 1); - Assert.AreEqual(tValue2[27], 0); - Assert.AreEqual(tValue2[28], 1); - Assert.AreEqual(tValue2[29], 0); - Assert.AreEqual(tValue2[30], 1); - Assert.AreEqual(tValue2[31], 0); + Assert.Equal(tValue2[0], 1); + Assert.Equal(tValue2[1], 0); + Assert.Equal(tValue2[2], 1); + Assert.Equal(tValue2[3], 0); + Assert.Equal(tValue2[4], 1); + Assert.Equal(tValue2[5], 0); + Assert.Equal(tValue2[6], 1); + Assert.Equal(tValue2[7], 0); + Assert.Equal(tValue2[8], 1); + Assert.Equal(tValue2[9], 0); + Assert.Equal(tValue2[10], 1); + Assert.Equal(tValue2[11], 0); + Assert.Equal(tValue2[12], 1); + Assert.Equal(tValue2[13], 0); + Assert.Equal(tValue2[14], 1); + Assert.Equal(tValue2[15], 0); + Assert.Equal(tValue2[16], 1); + Assert.Equal(tValue2[17], 0); + Assert.Equal(tValue2[18], 1); + Assert.Equal(tValue2[19], 0); + Assert.Equal(tValue2[20], 1); + Assert.Equal(tValue2[21], 0); + Assert.Equal(tValue2[22], 1); + Assert.Equal(tValue2[23], 0); + Assert.Equal(tValue2[24], 1); + Assert.Equal(tValue2[25], 0); + Assert.Equal(tValue2[26], 1); + Assert.Equal(tValue2[27], 0); + Assert.Equal(tValue2[28], 1); + Assert.Equal(tValue2[29], 0); + Assert.Equal(tValue2[30], 1); + Assert.Equal(tValue2[31], 0); Assert.Throws(() => GenericsNative.GetVectorB256Out(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, out Vector value3)); Vector* value4 = GenericsNative.GetVectorB256Ptr(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false); Vector* tValue4 = (Vector*)value4; - Assert.AreEqual((*tValue4)[0], 1); - Assert.AreEqual((*tValue4)[1], 0); - Assert.AreEqual((*tValue4)[2], 1); - Assert.AreEqual((*tValue4)[3], 0); - Assert.AreEqual((*tValue4)[4], 1); - Assert.AreEqual((*tValue4)[5], 0); - Assert.AreEqual((*tValue4)[6], 1); - Assert.AreEqual((*tValue4)[7], 0); - Assert.AreEqual((*tValue4)[8], 1); - Assert.AreEqual((*tValue4)[9], 0); - Assert.AreEqual((*tValue4)[10], 1); - Assert.AreEqual((*tValue4)[11], 0); - Assert.AreEqual((*tValue4)[12], 1); - Assert.AreEqual((*tValue4)[13], 0); - Assert.AreEqual((*tValue4)[14], 1); - Assert.AreEqual((*tValue4)[15], 0); - Assert.AreEqual((*tValue4)[16], 1); - Assert.AreEqual((*tValue4)[17], 0); - Assert.AreEqual((*tValue4)[18], 1); - Assert.AreEqual((*tValue4)[19], 0); - Assert.AreEqual((*tValue4)[20], 1); - Assert.AreEqual((*tValue4)[21], 0); - Assert.AreEqual((*tValue4)[22], 1); - Assert.AreEqual((*tValue4)[23], 0); - Assert.AreEqual((*tValue4)[24], 1); - Assert.AreEqual((*tValue4)[25], 0); - Assert.AreEqual((*tValue4)[26], 1); - Assert.AreEqual((*tValue4)[27], 0); - Assert.AreEqual((*tValue4)[28], 1); - Assert.AreEqual((*tValue4)[29], 0); - Assert.AreEqual((*tValue4)[30], 1); - Assert.AreEqual((*tValue4)[31], 0); + Assert.Equal((*tValue4)[0], 1); + Assert.Equal((*tValue4)[1], 0); + Assert.Equal((*tValue4)[2], 1); + Assert.Equal((*tValue4)[3], 0); + Assert.Equal((*tValue4)[4], 1); + Assert.Equal((*tValue4)[5], 0); + Assert.Equal((*tValue4)[6], 1); + Assert.Equal((*tValue4)[7], 0); + Assert.Equal((*tValue4)[8], 1); + Assert.Equal((*tValue4)[9], 0); + Assert.Equal((*tValue4)[10], 1); + Assert.Equal((*tValue4)[11], 0); + Assert.Equal((*tValue4)[12], 1); + Assert.Equal((*tValue4)[13], 0); + Assert.Equal((*tValue4)[14], 1); + Assert.Equal((*tValue4)[15], 0); + Assert.Equal((*tValue4)[16], 1); + Assert.Equal((*tValue4)[17], 0); + Assert.Equal((*tValue4)[18], 1); + Assert.Equal((*tValue4)[19], 0); + Assert.Equal((*tValue4)[20], 1); + Assert.Equal((*tValue4)[21], 0); + Assert.Equal((*tValue4)[22], 1); + Assert.Equal((*tValue4)[23], 0); + Assert.Equal((*tValue4)[24], 1); + Assert.Equal((*tValue4)[25], 0); + Assert.Equal((*tValue4)[26], 1); + Assert.Equal((*tValue4)[27], 0); + Assert.Equal((*tValue4)[28], 1); + Assert.Equal((*tValue4)[29], 0); + Assert.Equal((*tValue4)[30], 1); + Assert.Equal((*tValue4)[31], 0); Assert.Throws(() => GenericsNative.GetVectorB256Ref(true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorC.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorC.cs index 96341de2602c0e..44ca102a3dffb1 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorC.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorC.cs @@ -4,7 +4,7 @@ using System; using System.Numerics; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -73,7 +73,7 @@ private static void TestVectorC() } else { - Assert.AreEqual(Vector.Count, 8); + Assert.Equal(Vector.Count, 8); TestVectorC128(); } } @@ -85,27 +85,27 @@ private static void TestVectorC128() Vector value2; GenericsNative.GetVectorC128Out('0', '1', '2', '3', '4', '5', '6', '7', &value2); Vector tValue2 = *(Vector*)&value2; - Assert.AreEqual(tValue2[0], (short)'0'); - Assert.AreEqual(tValue2[1], (short)'1'); - Assert.AreEqual(tValue2[2], (short)'2'); - Assert.AreEqual(tValue2[3], (short)'3'); - Assert.AreEqual(tValue2[4], (short)'4'); - Assert.AreEqual(tValue2[5], (short)'5'); - Assert.AreEqual(tValue2[6], (short)'6'); - Assert.AreEqual(tValue2[7], (short)'7'); + Assert.Equal(tValue2[0], (short)'0'); + Assert.Equal(tValue2[1], (short)'1'); + Assert.Equal(tValue2[2], (short)'2'); + Assert.Equal(tValue2[3], (short)'3'); + Assert.Equal(tValue2[4], (short)'4'); + Assert.Equal(tValue2[5], (short)'5'); + Assert.Equal(tValue2[6], (short)'6'); + Assert.Equal(tValue2[7], (short)'7'); Assert.Throws(() => GenericsNative.GetVectorC128Out('0', '1', '2', '3', '4', '5', '6', '7', out Vector value3)); Vector* value4 = GenericsNative.GetVectorC128Ptr('0', '1', '2', '3', '4', '5', '6', '7'); Vector* tValue4 = (Vector*)value4; - Assert.AreEqual((*tValue4)[0], (short)'0'); - Assert.AreEqual((*tValue4)[1], (short)'1'); - Assert.AreEqual((*tValue4)[2], (short)'2'); - Assert.AreEqual((*tValue4)[3], (short)'3'); - Assert.AreEqual((*tValue4)[4], (short)'4'); - Assert.AreEqual((*tValue4)[5], (short)'5'); - Assert.AreEqual((*tValue4)[6], (short)'6'); - Assert.AreEqual((*tValue4)[7], (short)'7'); + Assert.Equal((*tValue4)[0], (short)'0'); + Assert.Equal((*tValue4)[1], (short)'1'); + Assert.Equal((*tValue4)[2], (short)'2'); + Assert.Equal((*tValue4)[3], (short)'3'); + Assert.Equal((*tValue4)[4], (short)'4'); + Assert.Equal((*tValue4)[5], (short)'5'); + Assert.Equal((*tValue4)[6], (short)'6'); + Assert.Equal((*tValue4)[7], (short)'7'); Assert.Throws(() => GenericsNative.GetVectorC128Ref('0', '1', '2', '3', '4', '5', '6', '7')); @@ -138,43 +138,43 @@ private static void TestVectorC256() Vector value2; GenericsNative.GetVectorC256Out('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', &value2); Vector tValue2 = *(Vector*)&value2; - Assert.AreEqual(tValue2[0], (short)'0'); - Assert.AreEqual(tValue2[1], (short)'1'); - Assert.AreEqual(tValue2[2], (short)'2'); - Assert.AreEqual(tValue2[3], (short)'3'); - Assert.AreEqual(tValue2[4], (short)'4'); - Assert.AreEqual(tValue2[5], (short)'5'); - Assert.AreEqual(tValue2[6], (short)'6'); - Assert.AreEqual(tValue2[7], (short)'7'); - Assert.AreEqual(tValue2[8], (short)'8'); - Assert.AreEqual(tValue2[9], (short)'9'); - Assert.AreEqual(tValue2[10], (short)'A'); - Assert.AreEqual(tValue2[11], (short)'B'); - Assert.AreEqual(tValue2[12], (short)'C'); - Assert.AreEqual(tValue2[13], (short)'D'); - Assert.AreEqual(tValue2[14], (short)'E'); - Assert.AreEqual(tValue2[15], (short)'F'); + Assert.Equal(tValue2[0], (short)'0'); + Assert.Equal(tValue2[1], (short)'1'); + Assert.Equal(tValue2[2], (short)'2'); + Assert.Equal(tValue2[3], (short)'3'); + Assert.Equal(tValue2[4], (short)'4'); + Assert.Equal(tValue2[5], (short)'5'); + Assert.Equal(tValue2[6], (short)'6'); + Assert.Equal(tValue2[7], (short)'7'); + Assert.Equal(tValue2[8], (short)'8'); + Assert.Equal(tValue2[9], (short)'9'); + Assert.Equal(tValue2[10], (short)'A'); + Assert.Equal(tValue2[11], (short)'B'); + Assert.Equal(tValue2[12], (short)'C'); + Assert.Equal(tValue2[13], (short)'D'); + Assert.Equal(tValue2[14], (short)'E'); + Assert.Equal(tValue2[15], (short)'F'); Assert.Throws(() => GenericsNative.GetVectorC256Out('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', out Vector value3)); Vector* value4 = GenericsNative.GetVectorC256Ptr('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'); Vector* tValue4 = (Vector*)value4; - Assert.AreEqual((*tValue4)[0], (short)'0'); - Assert.AreEqual((*tValue4)[1], (short)'1'); - Assert.AreEqual((*tValue4)[2], (short)'2'); - Assert.AreEqual((*tValue4)[3], (short)'3'); - Assert.AreEqual((*tValue4)[4], (short)'4'); - Assert.AreEqual((*tValue4)[5], (short)'5'); - Assert.AreEqual((*tValue4)[6], (short)'6'); - Assert.AreEqual((*tValue4)[7], (short)'7'); - Assert.AreEqual((*tValue4)[8], (short)'8'); - Assert.AreEqual((*tValue4)[9], (short)'9'); - Assert.AreEqual((*tValue4)[10], (short)'A'); - Assert.AreEqual((*tValue4)[11], (short)'B'); - Assert.AreEqual((*tValue4)[12], (short)'C'); - Assert.AreEqual((*tValue4)[13], (short)'D'); - Assert.AreEqual((*tValue4)[14], (short)'E'); - Assert.AreEqual((*tValue4)[15], (short)'F'); + Assert.Equal((*tValue4)[0], (short)'0'); + Assert.Equal((*tValue4)[1], (short)'1'); + Assert.Equal((*tValue4)[2], (short)'2'); + Assert.Equal((*tValue4)[3], (short)'3'); + Assert.Equal((*tValue4)[4], (short)'4'); + Assert.Equal((*tValue4)[5], (short)'5'); + Assert.Equal((*tValue4)[6], (short)'6'); + Assert.Equal((*tValue4)[7], (short)'7'); + Assert.Equal((*tValue4)[8], (short)'8'); + Assert.Equal((*tValue4)[9], (short)'9'); + Assert.Equal((*tValue4)[10], (short)'A'); + Assert.Equal((*tValue4)[11], (short)'B'); + Assert.Equal((*tValue4)[12], (short)'C'); + Assert.Equal((*tValue4)[13], (short)'D'); + Assert.Equal((*tValue4)[14], (short)'E'); + Assert.Equal((*tValue4)[15], (short)'F'); Assert.Throws(() => GenericsNative.GetVectorC256Ref('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F')); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorD.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorD.cs index 0697abb3ea481f..40f7228d20d559 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorD.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorD.cs @@ -4,7 +4,7 @@ using System; using System.Numerics; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -73,7 +73,7 @@ private static void TestVectorD() } else { - Assert.AreEqual(Vector.Count, 2); + Assert.Equal(Vector.Count, 2); TestVectorD128(); } } @@ -84,14 +84,14 @@ private static void TestVectorD128() Vector value2; GenericsNative.GetVectorD128Out(1.0, 2.0, &value2); - Assert.AreEqual(value2[0], 1.0); - Assert.AreEqual(value2[1], 2.0); + Assert.Equal(value2[0], 1.0); + Assert.Equal(value2[1], 2.0); Assert.Throws(() => GenericsNative.GetVectorD128Out(1.0, 2.0, out Vector value3)); Vector* value4 = GenericsNative.GetVectorD128Ptr(1.0, 2.0); - Assert.AreEqual((*value4)[0], 1.0); - Assert.AreEqual((*value4)[1], 2.0); + Assert.Equal((*value4)[0], 1.0); + Assert.Equal((*value4)[1], 2.0); Assert.Throws(() => GenericsNative.GetVectorD128Ref(1.0, 2.0)); @@ -123,18 +123,18 @@ private static void TestVectorD256() Vector value2; GenericsNative.GetVectorD256Out(1.0, 2.0, 3.0, 4.0, &value2); - Assert.AreEqual(value2[0], 1.0); - Assert.AreEqual(value2[1], 2.0); - Assert.AreEqual(value2[2], 3.0); - Assert.AreEqual(value2[3], 4.0); + Assert.Equal(value2[0], 1.0); + Assert.Equal(value2[1], 2.0); + Assert.Equal(value2[2], 3.0); + Assert.Equal(value2[3], 4.0); Assert.Throws(() => GenericsNative.GetVectorD256Out(1.0, 2.0, 3.0, 4.0, out Vector value3)); Vector* value4 = GenericsNative.GetVectorD256Ptr(1.0, 2.0, 3.0, 4.0); - Assert.AreEqual((*value4)[0], 1.0); - Assert.AreEqual((*value4)[1], 2.0); - Assert.AreEqual((*value4)[2], 3.0); - Assert.AreEqual((*value4)[3], 4.0); + Assert.Equal((*value4)[0], 1.0); + Assert.Equal((*value4)[1], 2.0); + Assert.Equal((*value4)[2], 3.0); + Assert.Equal((*value4)[3], 4.0); Assert.Throws(() => GenericsNative.GetVectorD256Ref(1.0, 2.0, 3.0, 4.0)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorF.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorF.cs index 6b9d1cf822cd79..2919f3cf49d7ad 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorF.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorF.cs @@ -4,7 +4,7 @@ using System; using System.Numerics; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -73,7 +73,7 @@ private static void TestVectorF() } else { - Assert.AreEqual(Vector.Count, 4); + Assert.Equal(Vector.Count, 4); TestVectorF128(); } } @@ -84,18 +84,18 @@ private static void TestVectorF128() Vector value2; GenericsNative.GetVectorF128Out(1.0f, 2.0f, 3.0f, 4.0f, &value2); - Assert.AreEqual(value2[0], 1.0f); - Assert.AreEqual(value2[1], 2.0f); - Assert.AreEqual(value2[2], 3.0f); - Assert.AreEqual(value2[3], 4.0f); + Assert.Equal(value2[0], 1.0f); + Assert.Equal(value2[1], 2.0f); + Assert.Equal(value2[2], 3.0f); + Assert.Equal(value2[3], 4.0f); Assert.Throws(() => GenericsNative.GetVectorF128Out(1.0f, 2.0f, 3.0f, 4.0f, out Vector value3)); Vector* value4 = GenericsNative.GetVectorF128Ptr(1.0f, 2.0f, 3.0f, 4.0f); - Assert.AreEqual((*value4)[0], 1.0f); - Assert.AreEqual((*value4)[1], 2.0f); - Assert.AreEqual((*value4)[2], 3.0f); - Assert.AreEqual((*value4)[3], 4.0f); + Assert.Equal((*value4)[0], 1.0f); + Assert.Equal((*value4)[1], 2.0f); + Assert.Equal((*value4)[2], 3.0f); + Assert.Equal((*value4)[3], 4.0f); Assert.Throws(() => GenericsNative.GetVectorF128Ref(1.0f, 2.0f, 3.0f, 4.0f)); @@ -127,26 +127,26 @@ private static void TestVectorF256() Vector value2; GenericsNative.GetVectorF256Out(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, &value2); - Assert.AreEqual(value2[0], 1.0f); - Assert.AreEqual(value2[1], 2.0f); - Assert.AreEqual(value2[2], 3.0f); - Assert.AreEqual(value2[3], 4.0f); - Assert.AreEqual(value2[4], 5.0f); - Assert.AreEqual(value2[5], 6.0f); - Assert.AreEqual(value2[6], 7.0f); - Assert.AreEqual(value2[7], 8.0f); + Assert.Equal(value2[0], 1.0f); + Assert.Equal(value2[1], 2.0f); + Assert.Equal(value2[2], 3.0f); + Assert.Equal(value2[3], 4.0f); + Assert.Equal(value2[4], 5.0f); + Assert.Equal(value2[5], 6.0f); + Assert.Equal(value2[6], 7.0f); + Assert.Equal(value2[7], 8.0f); Assert.Throws(() => GenericsNative.GetVectorF256Out(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, out Vector value3)); Vector* value4 = GenericsNative.GetVectorF256Ptr(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f); - Assert.AreEqual((*value4)[0], 1.0f); - Assert.AreEqual((*value4)[1], 2.0f); - Assert.AreEqual((*value4)[2], 3.0f); - Assert.AreEqual((*value4)[3], 4.0f); - Assert.AreEqual((*value4)[4], 5.0f); - Assert.AreEqual((*value4)[5], 6.0f); - Assert.AreEqual((*value4)[6], 7.0f); - Assert.AreEqual((*value4)[7], 8.0f); + Assert.Equal((*value4)[0], 1.0f); + Assert.Equal((*value4)[1], 2.0f); + Assert.Equal((*value4)[2], 3.0f); + Assert.Equal((*value4)[3], 4.0f); + Assert.Equal((*value4)[4], 5.0f); + Assert.Equal((*value4)[5], 6.0f); + Assert.Equal((*value4)[6], 7.0f); + Assert.Equal((*value4)[7], 8.0f); Assert.Throws(() => GenericsNative.GetVectorF256Ref(1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorL.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorL.cs index 31c83f2d3d85f6..69070238f54fad 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorL.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorL.cs @@ -4,7 +4,7 @@ using System; using System.Numerics; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -73,7 +73,7 @@ private static void TestVectorL() } else { - Assert.AreEqual(Vector.Count, 2); + Assert.Equal(Vector.Count, 2); TestVectorL128(); } } @@ -84,14 +84,14 @@ private static void TestVectorL128() Vector value2; GenericsNative.GetVectorL128Out(1L, 2L, &value2); - Assert.AreEqual(value2[0], 1L); - Assert.AreEqual(value2[1], 2L); + Assert.Equal(value2[0], 1L); + Assert.Equal(value2[1], 2L); Assert.Throws(() => GenericsNative.GetVectorL128Out(1L, 2L, out Vector value3)); Vector* value4 = GenericsNative.GetVectorL128Ptr(1L, 2L); - Assert.AreEqual((*value4)[0], 1L); - Assert.AreEqual((*value4)[1], 2L); + Assert.Equal((*value4)[0], 1L); + Assert.Equal((*value4)[1], 2L); Assert.Throws(() => GenericsNative.GetVectorL128Ref(1L, 2L)); @@ -123,18 +123,18 @@ private static void TestVectorL256() Vector value2; GenericsNative.GetVectorL256Out(1L, 2L, 3L, 4L, &value2); - Assert.AreEqual(value2[0], 1L); - Assert.AreEqual(value2[1], 2L); - Assert.AreEqual(value2[2], 3L); - Assert.AreEqual(value2[3], 4L); + Assert.Equal(value2[0], 1L); + Assert.Equal(value2[1], 2L); + Assert.Equal(value2[2], 3L); + Assert.Equal(value2[3], 4L); Assert.Throws(() => GenericsNative.GetVectorL256Out(1L, 2L, 3L, 4L, out Vector value3)); Vector* value4 = GenericsNative.GetVectorL256Ptr(1L, 2L, 3L, 4L); - Assert.AreEqual((*value4)[0], 1L); - Assert.AreEqual((*value4)[1], 2L); - Assert.AreEqual((*value4)[2], 3L); - Assert.AreEqual((*value4)[3], 4L); + Assert.Equal((*value4)[0], 1L); + Assert.Equal((*value4)[1], 2L); + Assert.Equal((*value4)[2], 3L); + Assert.Equal((*value4)[3], 4L); Assert.Throws(() => GenericsNative.GetVectorL256Ref(1L, 2L, 3L, 4L)); diff --git a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorU.cs b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorU.cs index 306e240b5f7f54..2bfc5d8578bdef 100644 --- a/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorU.cs +++ b/src/tests/Interop/PInvoke/Generics/GenericsTest.VectorU.cs @@ -4,7 +4,7 @@ using System; using System.Numerics; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe partial class GenericsNative { @@ -73,7 +73,7 @@ private static void TestVectorU() } else { - Assert.AreEqual(Vector.Count, 4); + Assert.Equal(Vector.Count, 4); TestVectorU128(); } } @@ -84,18 +84,18 @@ private static void TestVectorU128() Vector value2; GenericsNative.GetVectorU128Out(1u, 2u, 3u, 4u, &value2); - Assert.AreEqual(value2[0], 1u); - Assert.AreEqual(value2[1], 2u); - Assert.AreEqual(value2[2], 3u); - Assert.AreEqual(value2[3], 4u); + Assert.Equal(value2[0], 1u); + Assert.Equal(value2[1], 2u); + Assert.Equal(value2[2], 3u); + Assert.Equal(value2[3], 4u); Assert.Throws(() => GenericsNative.GetVectorU128Out(1u, 2u, 3u, 4u, out Vector value3)); Vector* value4 = GenericsNative.GetVectorU128Ptr(1u, 2u, 3u, 4u); - Assert.AreEqual((*value4)[0], 1u); - Assert.AreEqual((*value4)[1], 2u); - Assert.AreEqual((*value4)[2], 3u); - Assert.AreEqual((*value4)[3], 4u); + Assert.Equal((*value4)[0], 1u); + Assert.Equal((*value4)[1], 2u); + Assert.Equal((*value4)[2], 3u); + Assert.Equal((*value4)[3], 4u); Assert.Throws(() => GenericsNative.GetVectorU128Ref(1u, 2u, 3u, 4u)); @@ -127,26 +127,26 @@ private static void TestVectorU256() Vector value2; GenericsNative.GetVectorU256Out(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, &value2); - Assert.AreEqual(value2[0], 1u); - Assert.AreEqual(value2[1], 2u); - Assert.AreEqual(value2[2], 3u); - Assert.AreEqual(value2[3], 4u); - Assert.AreEqual(value2[4], 5u); - Assert.AreEqual(value2[5], 6u); - Assert.AreEqual(value2[6], 7u); - Assert.AreEqual(value2[7], 8u); + Assert.Equal(value2[0], 1u); + Assert.Equal(value2[1], 2u); + Assert.Equal(value2[2], 3u); + Assert.Equal(value2[3], 4u); + Assert.Equal(value2[4], 5u); + Assert.Equal(value2[5], 6u); + Assert.Equal(value2[6], 7u); + Assert.Equal(value2[7], 8u); Assert.Throws(() => GenericsNative.GetVectorU256Out(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u, out Vector value3)); Vector* value4 = GenericsNative.GetVectorU256Ptr(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u); - Assert.AreEqual((*value4)[0], 1u); - Assert.AreEqual((*value4)[1], 2u); - Assert.AreEqual((*value4)[2], 3u); - Assert.AreEqual((*value4)[3], 4u); - Assert.AreEqual((*value4)[4], 5u); - Assert.AreEqual((*value4)[5], 6u); - Assert.AreEqual((*value4)[6], 7u); - Assert.AreEqual((*value4)[7], 8u); + Assert.Equal((*value4)[0], 1u); + Assert.Equal((*value4)[1], 2u); + Assert.Equal((*value4)[2], 3u); + Assert.Equal((*value4)[3], 4u); + Assert.Equal((*value4)[4], 5u); + Assert.Equal((*value4)[5], 6u); + Assert.Equal((*value4)[6], 7u); + Assert.Equal((*value4)[7], 8u); Assert.Throws(() => GenericsNative.GetVectorU256Ref(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u)); diff --git a/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs b/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs index f89d38ed3d3d0e..11400d92afa9fb 100644 --- a/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs +++ b/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; namespace PInvokeTests { @@ -42,8 +42,8 @@ public static class IEnumeratorTests { private static void TestNativeToManaged() { - Assert.AreAllEqual(Enumerable.Range(1, 10), EnumeratorAsEnumerable(IEnumeratorNative.GetIntegerEnumerator(1, 10))); - Assert.AreAllEqual(Enumerable.Range(1, 10), IEnumeratorNative.GetIntegerEnumeration(1, 10).OfType()); + AssertExtensions.CollectionEqual(Enumerable.Range(1, 10), EnumeratorAsEnumerable(IEnumeratorNative.GetIntegerEnumerator(1, 10))); + AssertExtensions.CollectionEqual(Enumerable.Range(1, 10), IEnumeratorNative.GetIntegerEnumeration(1, 10).OfType()); } private static void TestManagedToNative() @@ -55,13 +55,13 @@ private static void TestManagedToNative() private static void TestNativeRoundTrip() { IEnumerator nativeEnumerator = IEnumeratorNative.GetIntegerEnumerator(1, 10); - Assert.AreEqual(nativeEnumerator, IEnumeratorNative.PassThroughEnumerator(nativeEnumerator)); + Assert.Equal(nativeEnumerator, IEnumeratorNative.PassThroughEnumerator(nativeEnumerator)); } private static void TestManagedRoundTrip() { IEnumerator managedEnumerator = Enumerable.Range(1, 10).GetEnumerator(); - Assert.AreEqual(managedEnumerator, IEnumeratorNative.PassThroughEnumerator(managedEnumerator)); + Assert.Equal(managedEnumerator, IEnumeratorNative.PassThroughEnumerator(managedEnumerator)); } public static int Main() diff --git a/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs b/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs index 31f64bb6b4e692..37e8e3c48f5202 100644 --- a/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs +++ b/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs @@ -6,7 +6,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; static unsafe class CopyCtor { diff --git a/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorUtil.ilproj b/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorUtil.ilproj index 7eb71cef69df39..3cfdd6869fbff8 100644 --- a/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorUtil.ilproj +++ b/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorUtil.ilproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/PInvoke/Miscellaneous/HandleRef/HandleRefTest.cs b/src/tests/Interop/PInvoke/Miscellaneous/HandleRef/HandleRefTest.cs index 27c92dd1b19b06..8b6d1b3ef3beea 100644 --- a/src/tests/Interop/PInvoke/Miscellaneous/HandleRef/HandleRefTest.cs +++ b/src/tests/Interop/PInvoke/Miscellaneous/HandleRef/HandleRefTest.cs @@ -5,7 +5,7 @@ using System; using System.Reflection; using System.Text; -using TestLibrary; +using Xunit; class HandleRefTest { @@ -36,25 +36,25 @@ public unsafe static int Main(string[] args) int int1 = intManaged; int* int1Ptr = &int1; HandleRef hr1 = new HandleRef(new Object(), (IntPtr)int1Ptr); - Assert.AreEqual(intReturn, MarshalPointer_In(hr1, stackGuard), "The return value is wrong"); - Assert.AreEqual(intManaged, int1, "The parameter value is changed"); - + Assert.Equal(intReturn, MarshalPointer_In(hr1, stackGuard)); + Assert.Equal(intManaged, int1); + Console.WriteLine("MarshalPointer_InOut"); int int2 = intManaged; int* int2Ptr = &int2; HandleRef hr2 = new HandleRef(new Object(), (IntPtr)int2Ptr); - Assert.AreEqual(intReturn, MarshalPointer_InOut(hr2, stackGuard), "The return value is wrong"); - Assert.AreEqual(intNative, int2, "The passed value is wrong"); - + Assert.Equal(intReturn, MarshalPointer_InOut(hr2, stackGuard)); + Assert.Equal(intNative, int2); + Console.WriteLine("MarshalPointer_Out"); int int3 = intManaged; int* int3Ptr = &int3; HandleRef hr3 = new HandleRef(new Object(), (IntPtr)int3Ptr); - Assert.AreEqual(intReturn, MarshalPointer_Out(hr3, stackGuard), "The return value is wrong"); - Assert.AreEqual(intNative, int3, "The passed value is wrong"); + Assert.Equal(intReturn, MarshalPointer_Out(hr3, stackGuard)); + Assert.Equal(intNative, int3); - // Note that this scenario will always pass in a debug build because all values - // stay rooted until the end of the method. + // Note that this scenario will always pass in a debug build because all values + // stay rooted until the end of the method. Console.WriteLine("TestNoGC"); int* int4Ptr = (int*)Marshal.AllocHGlobal(sizeof(int)); // We don't free this memory so we don't have to worry about a GC run between freeing and return (possible in a GCStress mode). @@ -63,7 +63,7 @@ public unsafe static int Main(string[] args) CollectableClass collectableClass = new CollectableClass(int4Ptr); HandleRef hr4 = new HandleRef(collectableClass, (IntPtr)int4Ptr); Action gcCallback = () => { Console.WriteLine("GC callback now"); GC.Collect(2, GCCollectionMode.Forced); GC.WaitForPendingFinalizers(); GC.Collect(2, GCCollectionMode.Forced); }; - Assert.AreEqual(intReturn, TestNoGC(hr4, gcCallback), "The return value is wrong"); + Assert.Equal(intReturn, TestNoGC(hr4, gcCallback)); Console.WriteLine("Native code finished"); Console.WriteLine("InvalidMarshalPointer_Return"); @@ -71,8 +71,8 @@ public unsafe static int Main(string[] args) return 100; } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; + Console.WriteLine($"Test Failure: {e}"); + return 101; } } diff --git a/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/MAWSPITest.cs b/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/MAWSPITest.cs index 3cbfee078f5fbe..770bb9750acee0 100644 --- a/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/MAWSPITest.cs +++ b/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/MAWSPITest.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; class MultipleAssembliesWithSamePInvokeTest { @@ -13,14 +13,14 @@ class MultipleAssembliesWithSamePInvokeTest public static int Main(string[] args) { try{ - Assert.AreEqual(24, GetInt(), "MultipleAssembliesWithSamePInvoke.GetInt() failed."); - Assert.AreEqual(24, ManagedDll1.Class1.GetInt(), "ManagedDll.Class1.GetInt() failed."); - Assert.AreEqual(24, ManagedDll2.Class2.GetInt(), "ManagedDll.Class2.GetInt() failed."); - + Assert.Equal(24, GetInt()); + Assert.Equal(24, ManagedDll1.Class1.GetInt()); + Assert.Equal(24, ManagedDll2.Class2.GetInt()); + return 100; } catch (Exception e){ - Console.WriteLine($"Test Failure: {e}"); - return 101; - } + Console.WriteLine($"Test Failure: {e}"); + return 101; + } } } diff --git a/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/ManagedDll1/ManagedDll1.csproj b/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/ManagedDll1/ManagedDll1.csproj index e28377ad0818d4..e1be91a4ed6122 100644 --- a/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/ManagedDll1/ManagedDll1.csproj +++ b/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/ManagedDll1/ManagedDll1.csproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/ManagedDll2/ManagedDll2.csproj b/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/ManagedDll2/ManagedDll2.csproj index e28377ad0818d4..e1be91a4ed6122 100644 --- a/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/ManagedDll2/ManagedDll2.csproj +++ b/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/ManagedDll2/ManagedDll2.csproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.cs b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.cs index 53d07912e97fae..6495fdaaa278e0 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.cs +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.cs @@ -5,10 +5,10 @@ using System.Runtime.InteropServices; using System.Collections.Generic; using NativeCallManagedComVisible; -using TestLibrary; +using Xunit; -// Setting ComVisible to true makes the types in this assembly visible -// to COM components by default. If you don't need to access a type in +// Setting ComVisible to true makes the types in this assembly visible +// to COM components by default. If you don't need to access a type in // this assembly from COM, set the ComVisible attribute to false on that type. [assembly: ComVisible(true)] @@ -120,7 +120,7 @@ public interface IDerivedInterfaceWithoutVisibleNoGuid /// /// Interface visible with ComVisible(true) and without Custom Attribute Guid. -/// Note that in this test, change the method sequence in the interface will +/// Note that in this test, change the method sequence in the interface will /// change the GUID and could reduce the test efficiency. /// [ComVisible(true)] @@ -261,7 +261,7 @@ int IInterfaceVisibleTrueNoGuid.Foo2(string str, out int outIntVal, IntPtr intPt int IDerivedInterfaceVisibleTrueNoGuid.Foo1(UInt16 int16Val, bool boolVal) { return 13; } int IDerivedInterfaceVisibleTrueNoGuid.Foo5(Int32 int32Val) { return 14; } int IDerivedInterfaceWithoutVisibleNoGuid.Foo7(Int32 int32Val) { return 15; } - int IInterfaceNotVisibleNoGuid.Foo() { return 16; } + int IInterfaceNotVisibleNoGuid.Foo() { return 16; } int IInterfaceComImport_ComImport.Foo() { return 101; } int IInterfaceVisibleTrue_ComImport.Foo() { return 102; } @@ -482,7 +482,7 @@ interface INestedInterfaceNotPublic_VisibleTrue : INestedInterfaceVisibleTrue /// [ComVisible(true)] [Guid("CF681980-CE6D-421E-8B21-AEAE3F1B7DAC")] - public sealed class NestedClassVisibleTrueServer : + public sealed class NestedClassVisibleTrueServer : INestedInterfaceComImport, INestedInterfaceVisibleTrue, INestedInterfaceVisibleFalse, INestedInterfaceWithoutVisible, INestedInterfaceNotPublic, NestedClass.INestedInterfaceNestedInClass, INestedInterfaceComImport_ComImport, INestedInterfaceVisibleTrue_ComImport, INestedInterfaceVisibleFalse_ComImport, INestedInterfaceVisibleTrue_VisibleTrue, INestedInterfaceVisibleFalse_VisibleTrue, INestedInterfaceVisibleTrue_VisibleFalse, INestedInterfaceNotPublic_VisibleTrue @@ -510,7 +510,7 @@ public sealed class NestedClassVisibleTrueServer : /// [ComVisible(false)] [Guid("6DF17EC1-A8F4-4693-B195-EDB27DF00170")] - public sealed class NestedClassVisibleFalseServer : + public sealed class NestedClassVisibleFalseServer : INestedInterfaceComImport, INestedInterfaceVisibleTrue, INestedInterfaceVisibleFalse, INestedInterfaceWithoutVisible, INestedInterfaceNotPublic { int INestedInterfaceComImport.Foo() { return 20; } @@ -525,7 +525,7 @@ public sealed class NestedClassVisibleFalseServer : /// Nested class not visible without ComVisible(). /// [Guid("A57430B8-E0C1-486E-AE57-A15D6A729F99")] - public sealed class NestedClassWithoutVisibleServer : + public sealed class NestedClassWithoutVisibleServer : INestedInterfaceComImport, INestedInterfaceVisibleTrue, INestedInterfaceVisibleFalse, INestedInterfaceWithoutVisible, INestedInterfaceNotPublic { int INestedInterfaceComImport.Foo() { return 30; } @@ -554,10 +554,10 @@ public sealed class NestedClassGenericServer : INestedInterfaceVisibleTrue, I [DllImport("ComVisibleNative")] public static extern int CCWTest_InterfaceVisibleTrue([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal); - + [DllImport("ComVisibleNative")] public static extern int CCWTest_InterfaceVisibleFalse([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal); - + [DllImport("ComVisibleNative")] public static extern int CCWTest_InterfaceWithoutVisible([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal); @@ -608,7 +608,7 @@ public sealed class NestedClassGenericServer : INestedInterfaceVisibleTrue, I [DllImport("ComVisibleNative")] public static extern int CCWTest_NestedInterfaceNotPublic([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal); - + [DllImport("ComVisibleNative")] public static extern int CCWTest_NestedInterfaceNestedInClass([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal); @@ -650,60 +650,60 @@ private static void RunComVisibleTests() ClassVisibleTrueServer visibleBaseClass = new ClassVisibleTrueServer(); Console.WriteLine("CCWTest_InterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(1, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(1, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(2, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(2, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceVisibleFalse"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); - + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleBaseClass, out fooSuccessVal)); + Console.WriteLine("CCWTest_InterfaceWithoutVisible"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(4, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(4, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceNotPublic"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_InterfaceVisibleTrueNoGuid"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrueNoGuid((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(6, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrueNoGuid((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(6, fooSuccessVal); Console.WriteLine("CCWTest_InterfaceNotVisibleNoGuid"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceNotVisibleNoGuid((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(16, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceNotVisibleNoGuid((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(16, fooSuccessVal); // // Tests for nested Interface in a class with ComVisible(true) // Console.WriteLine("Nested Interface in a class with ComVisible(true)"); - + Console.WriteLine("CCWTest_InterfaceComImport_ComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport_ComImport((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(101, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport_ComImport((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(101, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceVisibleTrue_ComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_ComImport((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(102, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_ComImport((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(102, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceVisibleFalse_ComImport"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_ComImport((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); - + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_ComImport((object)visibleBaseClass, out fooSuccessVal)); + Console.WriteLine("CCWTest_InterfaceVisibleTrue_VisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleTrue((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(104, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleTrue((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(104, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceVisibleFalse_VisibleTrue"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_VisibleTrue((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); - + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_VisibleTrue((object)visibleBaseClass, out fooSuccessVal)); + Console.WriteLine("CCWTest_InterfaceVisibleTrue_VisibleFalse"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleFalse((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(106, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleFalse((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(106, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceNotPublic_VisibleTrue"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic_VisibleTrue((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic_VisibleTrue((object)visibleBaseClass, out fooSuccessVal)); // // Tests for class with ComVisible(false) @@ -712,22 +712,22 @@ private static void RunComVisibleTests() ClassVisibleFalseServer visibleFalseBaseClass = new ClassVisibleFalseServer(); Console.WriteLine("CCWTest_InterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleFalseBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(120, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleFalseBaseClass, out fooSuccessVal)); + Assert.Equal(120, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleFalseBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(121, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleFalseBaseClass, out fooSuccessVal)); + Assert.Equal(121, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceVisibleFalse"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleFalseBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); - + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleFalseBaseClass, out fooSuccessVal)); + Console.WriteLine("CCWTest_InterfaceWithoutVisible"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)visibleFalseBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(123, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)visibleFalseBaseClass, out fooSuccessVal)); + Assert.Equal(123, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceNotPublic"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleFalseBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleFalseBaseClass, out fooSuccessVal)); // // Tests for class without ComVisible() @@ -736,22 +736,22 @@ private static void RunComVisibleTests() ClassWithoutVisibleServer withoutVisibleBaseClass = new ClassWithoutVisibleServer(); Console.WriteLine("CCWTest_InterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)withoutVisibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(130, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)withoutVisibleBaseClass, out fooSuccessVal)); + Assert.Equal(130, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)withoutVisibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(131, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)withoutVisibleBaseClass, out fooSuccessVal)); + Assert.Equal(131, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceVisibleFalse"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)withoutVisibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); - + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)withoutVisibleBaseClass, out fooSuccessVal)); + Console.WriteLine("CCWTest_InterfaceWithoutVisible"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)withoutVisibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(133, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)withoutVisibleBaseClass, out fooSuccessVal)); + Assert.Equal(133, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceNotPublic"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)withoutVisibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)withoutVisibleBaseClass, out fooSuccessVal)); // @@ -761,39 +761,39 @@ private static void RunComVisibleTests() ClassGenericServer genericServer = new ClassGenericServer(); Console.WriteLine("CCWTest_InterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)genericServer, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(140, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)genericServer, out fooSuccessVal)); + Assert.Equal(140, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)genericServer, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(141, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)genericServer, out fooSuccessVal)); + Assert.Equal(141, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceGenericVisibleTrue"); - Assert.AreEqual(Helpers.COR_E_INVALIDOPERATION, CCWTest_InterfaceGenericVisibleTrue((object)genericServer, out fooSuccessVal), "Returned diferent exception than the expected COR_E_INVALIDOPERATION."); + Assert.Equal(Helpers.COR_E_INVALIDOPERATION, CCWTest_InterfaceGenericVisibleTrue((object)genericServer, out fooSuccessVal)); // // Tests for nested class with ComVisible(true) // Console.WriteLine("Nested class with ComVisible(true)"); NestedClassVisibleTrueServer visibleNestedBaseClass = new NestedClassVisibleTrueServer(); - + Console.WriteLine("CCWTest_NestedInterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(10, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(10, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(11, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(11, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); - + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal)); + Console.WriteLine("CCWTest_NestedInterfaceWithoutVisible"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(13, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(13, fooSuccessVal); + Console.WriteLine("CCWTest_NestedInterfaceNotPublic"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleNestedBaseClass, out fooSuccessVal)); // // Tests for nested Interface in a nested class with ComVisible(true) @@ -801,100 +801,100 @@ private static void RunComVisibleTests() Console.WriteLine("Nested Interface in a nested class with ComVisible(true)"); Console.WriteLine("CCWTest_NestedInterfaceNestedInClass"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceNestedInClass((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(110, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceNestedInClass((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(110, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceComImport_ComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport_ComImport((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(111, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport_ComImport((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(111, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue_ComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_ComImport((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(112, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_ComImport((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(112, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse_ComImport"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_ComImport((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_ComImport((object)visibleNestedBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue_VisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(114, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(114, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse_VisibleTrue"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); - + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal)); + Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue_VisibleFalse"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(116, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(116, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceNotPublic_VisibleTrue"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal)); // // Tests for nested class with ComVisible(false) // Console.WriteLine("Nested class with ComVisible(false)"); NestedClassVisibleFalseServer visibleFalseNestedBaseClass = new NestedClassVisibleFalseServer(); - + Console.WriteLine("CCWTest_NestedInterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleFalseNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(20, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleFalseNestedBaseClass, out fooSuccessVal)); + Assert.Equal(20, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleFalseNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(21, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleFalseNestedBaseClass, out fooSuccessVal)); + Assert.Equal(21, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleFalseNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleFalseNestedBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_NestedInterfaceWithoutVisible"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)visibleFalseNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(23, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)visibleFalseNestedBaseClass, out fooSuccessVal)); + Assert.Equal(23, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceNotPublic"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleFalseNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleFalseNestedBaseClass, out fooSuccessVal)); // // Tests for nested class without ComVisible() // Console.WriteLine("Nested class without ComVisible()"); NestedClassWithoutVisibleServer withoutVisibleNestedBaseClass = new NestedClassWithoutVisibleServer(); - + Console.WriteLine("CCWTest_NestedInterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(30, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)withoutVisibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(30, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(31, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)withoutVisibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(31, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)withoutVisibleNestedBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_NestedInterfaceWithoutVisible"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(33, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)withoutVisibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(33, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceNotPublic"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)withoutVisibleNestedBaseClass, out fooSuccessVal)); // // Tests for generic nested class with ComVisible(true) // Console.WriteLine("Nested generic class with ComVisible(true)"); NestedClassGenericServer nestedGenericServer = new NestedClassGenericServer(); - + Console.WriteLine("CCWTest_NestedInterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)nestedGenericServer, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(40, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)nestedGenericServer, out fooSuccessVal)); + Assert.Equal(40, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)nestedGenericServer, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(41, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)nestedGenericServer, out fooSuccessVal)); + Assert.Equal(41, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceGenericVisibleTrue"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceGenericVisibleTrue((object)nestedGenericServer, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceGenericVisibleTrue((object)nestedGenericServer, out fooSuccessVal)); } - + public static int Main() { try diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.cs b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.cs index 0833adf607c40f..3b8e668dd6f705 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.cs +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.cs @@ -5,7 +5,7 @@ using System.Runtime.InteropServices; using System.Collections.Generic; using NativeCallManagedComVisible; -using TestLibrary; +using Xunit; // Don't set ComVisible. // [assembly: ComVisible(true)] @@ -118,7 +118,7 @@ public interface IDerivedInterfaceWithoutVisibleNoGuid /// /// Interface visible with ComVisible(true) and without Custom Attribute Guid. -/// Note that in this test, change the method sequence in the interface will +/// Note that in this test, change the method sequence in the interface will /// change the GUID and could reduce the test efficiency. /// [ComVisible(true)] @@ -649,30 +649,30 @@ private static void RunComVisibleTests() ClassVisibleTrueServer visibleBaseClass = new ClassVisibleTrueServer(); Console.WriteLine("CCWTest_InterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(1, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(1, fooSuccessVal); Console.WriteLine("CCWTest_InterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(2, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(2, fooSuccessVal); Console.WriteLine("CCWTest_InterfaceVisibleFalse"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_InterfaceWithoutVisible"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(4, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(4, fooSuccessVal); Console.WriteLine("CCWTest_InterfaceNotPublic"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_InterfaceVisibleTrueNoGuid"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrueNoGuid((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(6, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrueNoGuid((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(6, fooSuccessVal); Console.WriteLine("CCWTest_InterfaceNotVisibleNoGuid"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceNotVisibleNoGuid((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(16, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceNotVisibleNoGuid((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(16, fooSuccessVal); // // Tests for nested Interface in a class with ComVisible(true) @@ -680,29 +680,29 @@ private static void RunComVisibleTests() Console.WriteLine("Nested Interface in a class with ComVisible(true)"); Console.WriteLine("CCWTest_InterfaceComImport_ComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport_ComImport((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(101, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport_ComImport((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(101, fooSuccessVal); Console.WriteLine("CCWTest_InterfaceVisibleTrue_ComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_ComImport((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(102, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_ComImport((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(102, fooSuccessVal); Console.WriteLine("CCWTest_InterfaceVisibleFalse_ComImport"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_ComImport((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_ComImport((object)visibleBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_InterfaceVisibleTrue_VisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleTrue((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(104, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleTrue((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(104, fooSuccessVal); Console.WriteLine("CCWTest_InterfaceVisibleFalse_VisibleTrue"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_VisibleTrue((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_VisibleTrue((object)visibleBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_InterfaceVisibleTrue_VisibleFalse"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleFalse((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(106, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleFalse((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(106, fooSuccessVal); Console.WriteLine("CCWTest_InterfaceNotPublic_VisibleTrue"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic_VisibleTrue((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic_VisibleTrue((object)visibleBaseClass, out fooSuccessVal)); // // Tests for class with ComVisible(false) @@ -711,22 +711,22 @@ private static void RunComVisibleTests() ClassVisibleFalseServer visibleFalseBaseClass = new ClassVisibleFalseServer(); Console.WriteLine("CCWTest_InterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleFalseBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(120, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleFalseBaseClass, out fooSuccessVal)); + Assert.Equal(120, fooSuccessVal); Console.WriteLine("CCWTest_InterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleFalseBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(121, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleFalseBaseClass, out fooSuccessVal)); + Assert.Equal(121, fooSuccessVal); Console.WriteLine("CCWTest_InterfaceVisibleFalse"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleFalseBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleFalseBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_InterfaceWithoutVisible"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)visibleFalseBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(123, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)visibleFalseBaseClass, out fooSuccessVal)); + Assert.Equal(123, fooSuccessVal); Console.WriteLine("CCWTest_InterfaceNotPublic"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleFalseBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleFalseBaseClass, out fooSuccessVal)); // // Tests for class without ComVisible() @@ -735,22 +735,22 @@ private static void RunComVisibleTests() ClassWithoutVisibleServer withoutVisibleBaseClass = new ClassWithoutVisibleServer(); Console.WriteLine("CCWTest_InterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)withoutVisibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(130, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)withoutVisibleBaseClass, out fooSuccessVal)); + Assert.Equal(130, fooSuccessVal); Console.WriteLine("CCWTest_InterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)withoutVisibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(131, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)withoutVisibleBaseClass, out fooSuccessVal)); + Assert.Equal(131, fooSuccessVal); Console.WriteLine("CCWTest_InterfaceVisibleFalse"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)withoutVisibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)withoutVisibleBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_InterfaceWithoutVisible"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)withoutVisibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(133, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceWithoutVisible((object)withoutVisibleBaseClass, out fooSuccessVal)); + Assert.Equal(133, fooSuccessVal); Console.WriteLine("CCWTest_InterfaceNotPublic"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)withoutVisibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)withoutVisibleBaseClass, out fooSuccessVal)); // @@ -760,15 +760,15 @@ private static void RunComVisibleTests() ClassGenericServer genericServer = new ClassGenericServer(); Console.WriteLine("CCWTest_InterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)genericServer, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(140, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)genericServer, out fooSuccessVal)); + Assert.Equal(140, fooSuccessVal); Console.WriteLine("CCWTest_InterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)genericServer, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(141, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)genericServer, out fooSuccessVal)); + Assert.Equal(141, fooSuccessVal); Console.WriteLine("CCWTest_InterfaceGenericVisibleTrue"); - Assert.AreEqual(Helpers.COR_E_INVALIDOPERATION, CCWTest_InterfaceGenericVisibleTrue((object)genericServer, out fooSuccessVal), "Returned diferent exception than the expected COR_E_INVALIDOPERATION."); + Assert.Equal(Helpers.COR_E_INVALIDOPERATION, CCWTest_InterfaceGenericVisibleTrue((object)genericServer, out fooSuccessVal)); // // Tests for nested class with ComVisible(true) @@ -777,22 +777,22 @@ private static void RunComVisibleTests() NestedClassVisibleTrueServer visibleNestedBaseClass = new NestedClassVisibleTrueServer(); Console.WriteLine("CCWTest_NestedInterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(10, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(10, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(11, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(11, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_NestedInterfaceWithoutVisible"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(13, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(13, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceNotPublic"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleNestedBaseClass, out fooSuccessVal)); // // Tests for nested Interface in a nested class with ComVisible(true) @@ -800,33 +800,33 @@ private static void RunComVisibleTests() Console.WriteLine("Nested Interface in a nested class with ComVisible(true)"); Console.WriteLine("CCWTest_NestedInterfaceNestedInClass"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceNestedInClass((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(110, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceNestedInClass((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(110, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceComImport_ComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport_ComImport((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(111, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport_ComImport((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(111, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue_ComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_ComImport((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(112, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_ComImport((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(112, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse_ComImport"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_ComImport((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_ComImport((object)visibleNestedBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue_VisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(114, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(114, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse_VisibleTrue"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue_VisibleFalse"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(116, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(116, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceNotPublic_VisibleTrue"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal)); // // Tests for nested class with ComVisible(false) @@ -835,22 +835,22 @@ private static void RunComVisibleTests() NestedClassVisibleFalseServer visibleFalseNestedBaseClass = new NestedClassVisibleFalseServer(); Console.WriteLine("CCWTest_NestedInterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleFalseNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(20, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleFalseNestedBaseClass, out fooSuccessVal)); + Assert.Equal(20, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleFalseNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(21, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleFalseNestedBaseClass, out fooSuccessVal)); + Assert.Equal(21, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleFalseNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleFalseNestedBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_NestedInterfaceWithoutVisible"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)visibleFalseNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(23, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)visibleFalseNestedBaseClass, out fooSuccessVal)); + Assert.Equal(23, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceNotPublic"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleFalseNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleFalseNestedBaseClass, out fooSuccessVal)); // // Tests for nested class without ComVisible() @@ -859,22 +859,22 @@ private static void RunComVisibleTests() NestedClassWithoutVisibleServer withoutVisibleNestedBaseClass = new NestedClassWithoutVisibleServer(); Console.WriteLine("CCWTest_NestedInterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(30, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)withoutVisibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(30, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(31, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)withoutVisibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(31, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)withoutVisibleNestedBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_NestedInterfaceWithoutVisible"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(33, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceWithoutVisible((object)withoutVisibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(33, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceNotPublic"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)withoutVisibleNestedBaseClass, out fooSuccessVal)); // // Tests for generic nested class with ComVisible(true) @@ -883,17 +883,17 @@ private static void RunComVisibleTests() NestedClassGenericServer nestedGenericServer = new NestedClassGenericServer(); Console.WriteLine("CCWTest_NestedInterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)nestedGenericServer, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(40, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)nestedGenericServer, out fooSuccessVal)); + Assert.Equal(40, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)nestedGenericServer, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(41, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)nestedGenericServer, out fooSuccessVal)); + Assert.Equal(41, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceGenericVisibleTrue"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceGenericVisibleTrue((object)nestedGenericServer, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceGenericVisibleTrue((object)nestedGenericServer, out fooSuccessVal)); } - + public static int Main() { try diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs index 0584433cf24bd3..d18cd70c0c231e 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs @@ -6,10 +6,10 @@ using System.Reflection; using System.Collections.Generic; using NativeCallManagedComVisible; -using TestLibrary; +using Xunit; -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components by default. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components by default. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -121,7 +121,7 @@ public interface IDerivedInterfaceWithoutVisibleNoGuid /// /// Interface visible with ComVisible(true) and without Custom Attribute Guid. -/// Note that in this test, change the method sequence in the interface will +/// Note that in this test, change the method sequence in the interface will /// change the GUID and could reduce the test efficiency. /// [ComVisible(true)] @@ -250,7 +250,7 @@ interface IInterfaceNotPublic_VisibleTrue : IInterfaceVisibleTrue [ComVisible(true)] [Guid("48FC2EFC-C7ED-4E02-8D02-F05B6A439FC9")] public sealed class ClassVisibleTrueServer : - IInterfaceComImport, IInterfaceVisibleTrue, IInterfaceVisibleFalse, IInterfaceWithoutVisible, IInterfaceNotPublic, + IInterfaceComImport, IInterfaceVisibleTrue, IInterfaceVisibleFalse, IInterfaceWithoutVisible, IInterfaceNotPublic, IInterfaceVisibleTrueNoGuid, IInterfaceNotVisibleNoGuid, IInterfaceVisibleTrueNoGuidGenericInterface, IInterfaceComImport_ComImport, IInterfaceVisibleTrue_ComImport, IInterfaceVisibleFalse_ComImport, IInterfaceVisibleTrue_VisibleTrue, IInterfaceVisibleFalse_VisibleTrue, IInterfaceVisibleTrue_VisibleFalse, IInterfaceNotPublic_VisibleTrue @@ -263,10 +263,10 @@ public sealed class ClassVisibleTrueServer : int IInterfaceVisibleTrueNoGuid.Foo() { return 6; } int IInterfaceVisibleTrueNoGuid.Foo1(UInt16 int16Val, bool boolVal) { return 7; } - int IInterfaceVisibleTrueNoGuid.Foo2(string str, out int outIntVal, IntPtr intPtrVal, int[] arrayVal, byte inByteVal, int inIntVal) + int IInterfaceVisibleTrueNoGuid.Foo2(string str, out int outIntVal, IntPtr intPtrVal, int[] arrayVal, byte inByteVal, int inIntVal) { - outIntVal = 10; - return 8; + outIntVal = 10; + return 8; } int IInterfaceVisibleTrueNoGuid.Foo3(ref short refShortVal, params byte[] paramsList) { return 9; } int IInterfaceVisibleTrueNoGuid.Foo4(ref List refShortVal, GenericClassW2Pars genericClass, params object[] paramsList) { return 10; } @@ -278,7 +278,7 @@ int IInterfaceVisibleTrueNoGuid.Foo2(string str, out int outIntVal, IntPtr intPt int IInterfaceVisibleTrueNoGuidGenericInterface.Foo() { return 17; } int IInterfaceVisibleTrueNoGuidGenericInterface.Foo9(List listInt) { return 18; } int IInterfaceVisibleTrueNoGuidGenericInterface.Foo10(ICollection intCollection, ICollection stringCollection) { return 19; } - + int IInterfaceComImport_ComImport.Foo() { return 101; } int IInterfaceVisibleTrue_ComImport.Foo() { return 102; } int IInterfaceVisibleFalse_ComImport.Foo() { return 103; } @@ -336,7 +336,7 @@ public sealed class ClassGenericServer : IInterfaceVisibleTrue, IInterfaceGen /// /// Class visible with ComVisible(true) and without Custom Attribute Guid. -/// Note that in this test, change the method sequence in the interface will +/// Note that in this test, change the method sequence in the interface will /// change the GUID and could broke the test or reduce the test efficiency. /// [ComVisible(true)] @@ -529,7 +529,7 @@ public interface INestedInterfaceVisibleTrueNoGuid /// [ComVisible(true)] [Guid("CF681980-CE6D-421E-8B21-AEAE3F1B7DAC")] - public sealed class NestedClassVisibleTrueServer : + public sealed class NestedClassVisibleTrueServer : INestedInterfaceComImport, INestedInterfaceVisibleTrue, INestedInterfaceVisibleFalse, INestedInterfaceWithoutVisible, INestedInterfaceNotPublic, INestedInterfaceVisibleTrueNoGuid, NestedClass.INestedInterfaceNestedInClassNoGuid, NestedClass.INestedInterfaceNestedInClass, INestedInterfaceComImport_ComImport, INestedInterfaceVisibleTrue_ComImport, INestedInterfaceVisibleFalse_ComImport, @@ -561,7 +561,7 @@ public sealed class NestedClassVisibleTrueServer : /// [ComVisible(false)] [Guid("6DF17EC1-A8F4-4693-B195-EDB27DF00170")] - public sealed class NestedClassVisibleFalseServer : + public sealed class NestedClassVisibleFalseServer : INestedInterfaceComImport, INestedInterfaceVisibleTrue, INestedInterfaceVisibleFalse, INestedInterfaceWithoutVisible, INestedInterfaceNotPublic { int INestedInterfaceComImport.Foo() { return 20; } @@ -576,7 +576,7 @@ public sealed class NestedClassVisibleFalseServer : /// Nested class not visible without ComVisible(). /// [Guid("A57430B8-E0C1-486E-AE57-A15D6A729F99")] - public sealed class NestedClassWithoutVisibleServer : + public sealed class NestedClassWithoutVisibleServer : INestedInterfaceComImport, INestedInterfaceVisibleTrue, INestedInterfaceVisibleFalse, INestedInterfaceWithoutVisible, INestedInterfaceNotPublic { int INestedInterfaceComImport.Foo() { return 30; } @@ -606,10 +606,10 @@ public sealed class NestedClassGenericServer : INestedInterfaceVisibleTrue, I [DllImport("ComVisibleNative")] public static extern int CCWTest_InterfaceVisibleTrue([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal); - + [DllImport("ComVisibleNative")] public static extern int CCWTest_InterfaceVisibleFalse([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal); - + [DllImport("ComVisibleNative")] public static extern int CCWTest_InterfaceWithoutVisible([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal); @@ -663,7 +663,7 @@ public sealed class NestedClassGenericServer : INestedInterfaceVisibleTrue, I [DllImport("ComVisibleNative")] public static extern int CCWTest_NestedInterfaceNotPublic([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal); - + [DllImport("ComVisibleNative")] public static extern int CCWTest_NestedInterfaceNestedInClass([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal); @@ -711,61 +711,61 @@ private static void RunComVisibleTests() ClassVisibleTrueServer visibleBaseClass = new ClassVisibleTrueServer(); Console.WriteLine("CCWTest_InterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(1, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(1, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(2, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(2, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceVisibleFalse"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); - + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleBaseClass, out fooSuccessVal)); + Console.WriteLine("CCWTest_InterfaceWithoutVisible"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceWithoutVisible((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); - + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceWithoutVisible((object)visibleBaseClass, out fooSuccessVal)); + Console.WriteLine("CCWTest_InterfaceNotPublic"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_InterfaceVisibleTrueNoGuid"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrueNoGuid((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(6, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrueNoGuid((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(6, fooSuccessVal); Console.WriteLine("CCWTest_InterfaceVisibleTrueNoGuidGenericInterface"); - Assert.AreEqual(Helpers.COR_E_GENERICMETHOD, CCWTest_InterfaceVisibleTrueNoGuidGenericInterface((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.COR_E_GENERICMETHOD, CCWTest_InterfaceVisibleTrueNoGuidGenericInterface((object)visibleBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_InterfaceNotVisibleNoGuid"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotVisibleNoGuid((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotVisibleNoGuid((object)visibleBaseClass, out fooSuccessVal)); // // Tests for nested Interface in a class with ComVisible(true) // Console.WriteLine("Nested Interface in a class with ComVisible(true)"); - + Console.WriteLine("CCWTest_InterfaceComImport_ComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport_ComImport((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(101, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport_ComImport((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(101, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceVisibleTrue_ComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_ComImport((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(102, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_ComImport((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(102, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceVisibleFalse_ComImport"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_ComImport((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); - + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_ComImport((object)visibleBaseClass, out fooSuccessVal)); + Console.WriteLine("CCWTest_InterfaceVisibleTrue_VisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleTrue((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(104, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleTrue((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(104, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceVisibleFalse_VisibleTrue"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_VisibleTrue((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); - + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse_VisibleTrue((object)visibleBaseClass, out fooSuccessVal)); + Console.WriteLine("CCWTest_InterfaceVisibleTrue_VisibleFalse"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleFalse((object)visibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(106, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue_VisibleFalse((object)visibleBaseClass, out fooSuccessVal)); + Assert.Equal(106, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceNotPublic_VisibleTrue"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic_VisibleTrue((object)visibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic_VisibleTrue((object)visibleBaseClass, out fooSuccessVal)); // // Tests for class with ComVisible(false) @@ -774,21 +774,21 @@ private static void RunComVisibleTests() ClassVisibleFalseServer visibleFalseBaseClass = new ClassVisibleFalseServer(); Console.WriteLine("CCWTest_InterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleFalseBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(120, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)visibleFalseBaseClass, out fooSuccessVal)); + Assert.Equal(120, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleFalseBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(121, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleFalseBaseClass, out fooSuccessVal)); + Assert.Equal(121, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceVisibleFalse"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleFalseBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); - + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)visibleFalseBaseClass, out fooSuccessVal)); + Console.WriteLine("CCWTest_InterfaceWithoutVisible"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceWithoutVisible((object)visibleFalseBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); - + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceWithoutVisible((object)visibleFalseBaseClass, out fooSuccessVal)); + Console.WriteLine("CCWTest_InterfaceNotPublic"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleFalseBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)visibleFalseBaseClass, out fooSuccessVal)); // // Tests for class without ComVisible() @@ -797,21 +797,21 @@ private static void RunComVisibleTests() ClassWithoutVisibleServer withoutVisibleBaseClass = new ClassWithoutVisibleServer(); Console.WriteLine("CCWTest_InterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)withoutVisibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(130, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)withoutVisibleBaseClass, out fooSuccessVal)); + Assert.Equal(130, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)withoutVisibleBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(131, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)withoutVisibleBaseClass, out fooSuccessVal)); + Assert.Equal(131, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceVisibleFalse"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)withoutVisibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); - + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceVisibleFalse((object)withoutVisibleBaseClass, out fooSuccessVal)); + Console.WriteLine("CCWTest_InterfaceWithoutVisible"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceWithoutVisible((object)withoutVisibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); - + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceWithoutVisible((object)withoutVisibleBaseClass, out fooSuccessVal)); + Console.WriteLine("CCWTest_InterfaceNotPublic"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)withoutVisibleBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_InterfaceNotPublic((object)withoutVisibleBaseClass, out fooSuccessVal)); // // Tests for generic class with ComVisible(true) @@ -820,38 +820,38 @@ private static void RunComVisibleTests() ClassGenericServer genericServer = new ClassGenericServer(); Console.WriteLine("CCWTest_InterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceComImport((object)genericServer, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(140, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceComImport((object)genericServer, out fooSuccessVal)); + Assert.Equal(140, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)genericServer, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(141, fooSuccessVal, "COM method didn't return the expected value."); - + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)genericServer, out fooSuccessVal)); + Assert.Equal(141, fooSuccessVal); + Console.WriteLine("CCWTest_InterfaceGenericVisibleTrue"); - Assert.AreEqual(Helpers.COR_E_INVALIDOPERATION, CCWTest_InterfaceGenericVisibleTrue((object)genericServer, out fooSuccessVal), "Returned diferent exception than the expected COR_E_INVALIDOPERATION."); + Assert.Equal(Helpers.COR_E_INVALIDOPERATION, CCWTest_InterfaceGenericVisibleTrue((object)genericServer, out fooSuccessVal)); // // Tests for nested class with ComVisible(true) // Console.WriteLine("Nested class with ComVisible(true)"); NestedClassVisibleTrueServer visibleNestedBaseClass = new NestedClassVisibleTrueServer(); - + Console.WriteLine("CCWTest_NestedInterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(10, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(10, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(11, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(11, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); - + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal)); + Console.WriteLine("CCWTest_NestedInterfaceWithoutVisible"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceWithoutVisible((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); - + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceWithoutVisible((object)visibleNestedBaseClass, out fooSuccessVal)); + Console.WriteLine("CCWTest_NestedInterfaceNotPublic"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleNestedBaseClass, out fooSuccessVal)); // // Tests for nested Interface in a nested class with ComVisible(true) @@ -859,104 +859,104 @@ private static void RunComVisibleTests() Console.WriteLine("Nested Interface in a nested class with ComVisible(true)"); Console.WriteLine("CCWTest_NestedInterfaceNestedInClass"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceNestedInClass((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(110, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceNestedInClass((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(110, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleTrueNoGuid"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrueNoGuid((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(50, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrueNoGuid((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(50, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceNestedInClassNoGuid"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceNestedInClassNoGuid((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(51, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceNestedInClassNoGuid((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(51, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceComImport_ComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport_ComImport((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(111, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport_ComImport((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(111, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue_ComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_ComImport((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(112, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_ComImport((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(112, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse_ComImport"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_ComImport((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_ComImport((object)visibleNestedBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue_VisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(114, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(114, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse_VisibleTrue"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); - + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal)); + Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue_VisibleFalse"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(116, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue_VisibleFalse((object)visibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(116, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceNotPublic_VisibleTrue"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic_VisibleTrue((object)visibleNestedBaseClass, out fooSuccessVal)); // // Tests for nested class with ComVisible(false) // Console.WriteLine("Nested class with ComVisible(false)"); NestedClassVisibleFalseServer visibleFalseNestedBaseClass = new NestedClassVisibleFalseServer(); - + Console.WriteLine("CCWTest_NestedInterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleFalseNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(20, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)visibleFalseNestedBaseClass, out fooSuccessVal)); + Assert.Equal(20, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleFalseNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(21, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)visibleFalseNestedBaseClass, out fooSuccessVal)); + Assert.Equal(21, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleFalseNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)visibleFalseNestedBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_NestedInterfaceWithoutVisible"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceWithoutVisible((object)visibleFalseNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceWithoutVisible((object)visibleFalseNestedBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_NestedInterfaceNotPublic"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleFalseNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)visibleFalseNestedBaseClass, out fooSuccessVal)); // // Tests for nested class without ComVisible() // Console.WriteLine("Nested class without ComVisible()"); NestedClassWithoutVisibleServer withoutVisibleNestedBaseClass = new NestedClassWithoutVisibleServer(); - + Console.WriteLine("CCWTest_NestedInterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(30, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)withoutVisibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(30, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(31, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)withoutVisibleNestedBaseClass, out fooSuccessVal)); + Assert.Equal(31, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleFalse"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceVisibleFalse((object)withoutVisibleNestedBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_NestedInterfaceWithoutVisible"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceWithoutVisible((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceWithoutVisible((object)withoutVisibleNestedBaseClass, out fooSuccessVal)); Console.WriteLine("CCWTest_NestedInterfaceNotPublic"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)withoutVisibleNestedBaseClass, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceNotPublic((object)withoutVisibleNestedBaseClass, out fooSuccessVal)); // // Tests for generic nested class with ComVisible(true) // Console.WriteLine("Nested generic class with ComVisible(true)"); NestedClassGenericServer nestedGenericServer = new NestedClassGenericServer(); - + Console.WriteLine("CCWTest_NestedInterfaceComImport"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)nestedGenericServer, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(40, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceComImport((object)nestedGenericServer, out fooSuccessVal)); + Assert.Equal(40, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)nestedGenericServer, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(41, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_NestedInterfaceVisibleTrue((object)nestedGenericServer, out fooSuccessVal)); + Assert.Equal(41, fooSuccessVal); Console.WriteLine("CCWTest_NestedInterfaceGenericVisibleTrue"); - Assert.AreEqual(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceGenericVisibleTrue((object)nestedGenericServer, out fooSuccessVal), "Returned diferent exception than the expected E_NOINTERFACE."); + Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceGenericVisibleTrue((object)nestedGenericServer, out fooSuccessVal)); // // Tests for class with ComVisible(true) without Custom Attribute Guid. @@ -965,8 +965,8 @@ private static void RunComVisibleTests() ClassVisibleTrueServerNoGuid visibleBaseClassNoGuid = new ClassVisibleTrueServerNoGuid(); Console.WriteLine("CCWTest_InterfaceVisibleTrue"); - Assert.AreEqual(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleBaseClassNoGuid, out fooSuccessVal), "COM method thrown an unexpected exception."); - Assert.AreEqual(150, fooSuccessVal, "COM method didn't return the expected value."); + Assert.Equal(Helpers.S_OK, CCWTest_InterfaceVisibleTrue((object)visibleBaseClassNoGuid, out fooSuccessVal)); + Assert.Equal(150, fooSuccessVal); // // Tests for get the GetTypeInfo().GUID for Interface and class without Custom Attribute Guid. @@ -974,38 +974,30 @@ private static void RunComVisibleTests() Console.WriteLine("GetTypeInfo().GUID for Interface and Class without GUID"); Console.WriteLine("IInterfaceVisibleTrueNoGuid.GUID"); - Assert.AreEqual(new Guid("ad50a327-d23a-38a4-9d6e-b32b32acf572"), typeof(IInterfaceVisibleTrueNoGuid).GetTypeInfo().GUID, - typeof(IInterfaceVisibleTrueNoGuid).GetTypeInfo() + " returns a wrong GUID {" + typeof(IInterfaceVisibleTrueNoGuid).GetTypeInfo().GUID + "}"); + Assert.Equal(new Guid("ad50a327-d23a-38a4-9d6e-b32b32acf572"), typeof(IInterfaceVisibleTrueNoGuid).GetTypeInfo().GUID); Console.WriteLine("IInterfaceNotVisibleNoGuid.GUID"); - Assert.AreEqual(new Guid("b45587ec-9671-35bc-8b8e-f6bfb18a4d3a"), typeof(IInterfaceNotVisibleNoGuid).GetTypeInfo().GUID, - typeof(IInterfaceNotVisibleNoGuid).GetTypeInfo() + " returns a wrong GUID {" + typeof(IInterfaceNotVisibleNoGuid).GetTypeInfo().GUID + "}"); + Assert.Equal(new Guid("b45587ec-9671-35bc-8b8e-f6bfb18a4d3a"), typeof(IInterfaceNotVisibleNoGuid).GetTypeInfo().GUID); Console.WriteLine("IDerivedInterfaceVisibleTrueNoGuid.GUID"); - Assert.AreEqual(new Guid("c3f73319-f6b3-3ef6-a095-8cb04fb8cf8b"), typeof(IDerivedInterfaceVisibleTrueNoGuid).GetTypeInfo().GUID, - typeof(IDerivedInterfaceVisibleTrueNoGuid).GetTypeInfo() + " returns a wrong GUID {" + typeof(IDerivedInterfaceVisibleTrueNoGuid).GetTypeInfo().GUID + "}"); + Assert.Equal(new Guid("c3f73319-f6b3-3ef6-a095-8cb04fb8cf8b"), typeof(IDerivedInterfaceVisibleTrueNoGuid).GetTypeInfo().GUID); Console.WriteLine("IInterfaceVisibleTrueNoGuidGeneric.GUID"); - Assert.AreEqual(new Guid("50c0a59c-b6e1-36dd-b488-a905b54910d4"), typeof(IInterfaceVisibleTrueNoGuidGeneric).GetTypeInfo().GUID, - typeof(IInterfaceVisibleTrueNoGuidGeneric).GetTypeInfo() + " returns a wrong GUID {" + typeof(IInterfaceVisibleTrueNoGuidGeneric).GetTypeInfo().GUID + "}"); + Assert.Equal(new Guid("50c0a59c-b6e1-36dd-b488-a905b54910d4"), typeof(IInterfaceVisibleTrueNoGuidGeneric).GetTypeInfo().GUID); Console.WriteLine("IInterfaceVisibleTrueNoGuidGenericInterface.GUID"); - Assert.AreEqual(new Guid("384f0b5c-28d0-368c-8c7e-5e31a84a5c84"), typeof(IInterfaceVisibleTrueNoGuidGenericInterface).GetTypeInfo().GUID, - typeof(IInterfaceVisibleTrueNoGuidGenericInterface).GetTypeInfo() + " returns a wrong GUID {" + typeof(IInterfaceVisibleTrueNoGuidGenericInterface).GetTypeInfo().GUID + "}"); + Assert.Equal(new Guid("384f0b5c-28d0-368c-8c7e-5e31a84a5c84"), typeof(IInterfaceVisibleTrueNoGuidGenericInterface).GetTypeInfo().GUID); Console.WriteLine("ClassVisibleTrueServerNoGuid.GUID"); - Assert.AreEqual(new Guid("afb3aafc-75bc-35d3-be41-a399c2701929"), typeof(ClassVisibleTrueServerNoGuid).GetTypeInfo().GUID, - typeof(ClassVisibleTrueServerNoGuid).GetTypeInfo() + " returns a wrong GUID {" + typeof(ClassVisibleTrueServerNoGuid).GetTypeInfo().GUID + "}"); + Assert.Equal(new Guid("afb3aafc-75bc-35d3-be41-a399c2701929"), typeof(ClassVisibleTrueServerNoGuid).GetTypeInfo().GUID); Console.WriteLine("INestedInterfaceNestedInClassNoGuid.GUID"); - Assert.AreEqual(new Guid("486bcec9-904d-3445-871c-e7084a52eb1a"), typeof(NestedClass.INestedInterfaceNestedInClassNoGuid).GetTypeInfo().GUID, - typeof(NestedClass.INestedInterfaceNestedInClassNoGuid).GetTypeInfo() + " returns a wrong GUID {" + typeof(NestedClass.INestedInterfaceNestedInClassNoGuid).GetTypeInfo().GUID + "}"); + Assert.Equal(new Guid("486bcec9-904d-3445-871c-e7084a52eb1a"), typeof(NestedClass.INestedInterfaceNestedInClassNoGuid).GetTypeInfo().GUID); Console.WriteLine("INestedInterfaceVisibleTrueNoGuid.GUID"); - Assert.AreEqual(new Guid("0ea2cb33-db9f-3655-9240-47ef1dea0f1e"), typeof(INestedInterfaceVisibleTrueNoGuid).GetTypeInfo().GUID, - typeof(INestedInterfaceVisibleTrueNoGuid).GetTypeInfo() + " returns a wrong GUID {" + typeof(INestedInterfaceVisibleTrueNoGuid).GetTypeInfo().GUID + "}"); + Assert.Equal(new Guid("0ea2cb33-db9f-3655-9240-47ef1dea0f1e"), typeof(INestedInterfaceVisibleTrueNoGuid).GetTypeInfo().GUID); } - + public static int Main() { try diff --git a/src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.cs b/src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.cs index 5dc0410882ff9a..052dcbc8455f57 100644 --- a/src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.cs +++ b/src/tests/Interop/PInvoke/Primitives/RuntimeHandles/RuntimeHandlesTest.cs @@ -4,7 +4,7 @@ using System.Runtime.InteropServices; using System; using System.Reflection; -using TestLibrary; +using Xunit; class TestClass { @@ -27,19 +27,19 @@ class RuntimeHandlesTest private static void TestRuntimeMethodHandle() { RuntimeMethodHandle handle = typeof(TestClass).GetMethod(nameof(TestClass.Method)).MethodHandle; - Assert.IsTrue(Marshal_In(handle, handle.Value)); + Assert.True(Marshal_In(handle, handle.Value)); } private static void TestRuntimeFieldHandle() { RuntimeFieldHandle handle = typeof(TestClass).GetField(nameof(TestClass.field)).FieldHandle; - Assert.IsTrue(Marshal_In(handle, handle.Value)); + Assert.True(Marshal_In(handle, handle.Value)); } private static void TestRuntimeTypeHandle() { RuntimeTypeHandle handle = typeof(TestClass).TypeHandle; - Assert.IsTrue(Marshal_In(handle, handle.Value)); + Assert.True(Marshal_In(handle, handle.Value)); } public static int Main() diff --git a/src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs b/src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs index 6cc62adcfb5af3..a0478363f057af 100644 --- a/src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs +++ b/src/tests/Interop/PInvoke/SafeHandles/InvalidSafeHandleMarshallingTests.cs @@ -4,7 +4,7 @@ using System; using System.IO; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; namespace SafeHandleTests { diff --git a/src/tests/Interop/PInvoke/SafeHandles/ReliableUnmarshalTest.cs b/src/tests/Interop/PInvoke/SafeHandles/ReliableUnmarshalTest.cs index a1cda16850a34c..d2ee3a3b21f8ef 100644 --- a/src/tests/Interop/PInvoke/SafeHandles/ReliableUnmarshalTest.cs +++ b/src/tests/Interop/PInvoke/SafeHandles/ReliableUnmarshalTest.cs @@ -4,7 +4,7 @@ using System; using System.IO; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; namespace SafeHandleTests { @@ -19,7 +19,7 @@ public static void RunTest() Assert.Throws(() => SafeHandleNative.GetHandleAndCookie(out _, value, out h)); - Assert.AreEqual(value, h.DangerousGetHandle()); + Assert.Equal(value, h.DangerousGetHandle()); // Try again, this time triggering unmarshal failure with an array. value = (IntPtr)456; @@ -27,7 +27,7 @@ public static void RunTest() Assert.Throws(() => SafeHandleNative.GetHandleAndArray(out _, out _, value, out h)); - Assert.AreEqual(value, h.DangerousGetHandle()); + Assert.Equal(value, h.DangerousGetHandle()); } } } diff --git a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs index 03980e3e678917..0295671dea6c57 100644 --- a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs +++ b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleLifetimeTests.cs @@ -4,7 +4,7 @@ using System; using System.IO; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; namespace SafeHandleTests { @@ -15,21 +15,21 @@ public class SafeHandleLifetimeTests public static void RunTest() { var testHandle = new TestSafeHandle(initialValue); - Assert.IsTrue(SafeHandleNative.SafeHandleByValue(testHandle, initialValue)); - Assert.IsFalse(testHandle.IsClosed); + Assert.True(SafeHandleNative.SafeHandleByValue(testHandle, initialValue)); + Assert.False(testHandle.IsClosed); - Assert.IsTrue(SafeHandleNative.SafeHandleByRef(ref testHandle, initialValue, newValue)); - Assert.IsFalse(testHandle.IsClosed); + Assert.True(SafeHandleNative.SafeHandleByRef(ref testHandle, initialValue, newValue)); + Assert.False(testHandle.IsClosed); testHandle = null; SafeHandleNative.SafeHandleOut(out testHandle, initialValue); - Assert.IsFalse(testHandle.IsClosed); + Assert.False(testHandle.IsClosed); testHandle = SafeHandleNative.SafeHandleReturn(newValue); - Assert.IsFalse(testHandle.IsClosed); + Assert.False(testHandle.IsClosed); testHandle = SafeHandleNative.SafeHandleReturn_Swapped(newValue); - Assert.IsFalse(testHandle.IsClosed); + Assert.False(testHandle.IsClosed); var str = new SafeHandleNative.StructWithHandle { @@ -37,10 +37,10 @@ public static void RunTest() }; SafeHandleNative.StructWithSafeHandleByValue(str, initialValue); - Assert.IsFalse(str.handle.IsClosed); - + Assert.False(str.handle.IsClosed); + SafeHandleNative.StructWithSafeHandleByRef(ref str, initialValue, initialValue); - Assert.IsFalse(str.handle.IsClosed); + Assert.False(str.handle.IsClosed); } } } diff --git a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs index b1179aa2d768d4..b0b3aaa88b8419 100644 --- a/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs +++ b/src/tests/Interop/PInvoke/SafeHandles/SafeHandleTests.cs @@ -4,7 +4,7 @@ using System; using System.IO; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; namespace SafeHandleTests { @@ -15,13 +15,13 @@ public class SafeHandleTest public static void RunTest() { var testHandle = new TestSafeHandle(initialValue); - Assert.IsTrue(SafeHandleNative.SafeHandleByValue(testHandle, initialValue)); + Assert.True(SafeHandleNative.SafeHandleByValue(testHandle, initialValue)); - Assert.IsTrue(SafeHandleNative.SafeHandleByRef(ref testHandle, initialValue, newValue)); - Assert.AreEqual(newValue, testHandle.DangerousGetHandle()); + Assert.True(SafeHandleNative.SafeHandleByRef(ref testHandle, initialValue, newValue)); + Assert.Equal(newValue, testHandle.DangerousGetHandle()); AbstractDerivedSafeHandle abstrHandle = new AbstractDerivedSafeHandleImplementation(initialValue); - Assert.IsTrue(SafeHandleNative.SafeHandleInByRef(abstrHandle, initialValue)); + Assert.True(SafeHandleNative.SafeHandleInByRef(abstrHandle, initialValue)); Assert.Throws(() => SafeHandleNative.SafeHandleByRef(ref abstrHandle, initialValue, newValue)); NoDefaultConstructorSafeHandle noDefaultCtorHandle = new NoDefaultConstructorSafeHandle(initialValue); @@ -29,20 +29,20 @@ public static void RunTest() testHandle = null; SafeHandleNative.SafeHandleOut(out testHandle, initialValue); - Assert.AreEqual(initialValue, testHandle.DangerousGetHandle()); + Assert.Equal(initialValue, testHandle.DangerousGetHandle()); testHandle = SafeHandleNative.SafeHandleReturn(newValue); - Assert.AreEqual(newValue, testHandle.DangerousGetHandle()); - + Assert.Equal(newValue, testHandle.DangerousGetHandle()); + Assert.Throws(() => SafeHandleNative.SafeHandleReturn_AbstractDerived(initialValue)); Assert.Throws(() => SafeHandleNative.SafeHandleReturn_NoDefaultConstructor(initialValue)); var abstractDerivedImplementationHandle = SafeHandleNative.SafeHandleReturn_AbstractDerivedImplementation(initialValue); - Assert.AreEqual(initialValue, abstractDerivedImplementationHandle.DangerousGetHandle()); - + Assert.Equal(initialValue, abstractDerivedImplementationHandle.DangerousGetHandle()); + testHandle = SafeHandleNative.SafeHandleReturn_Swapped(newValue); - Assert.AreEqual(newValue, testHandle.DangerousGetHandle()); - + Assert.Equal(newValue, testHandle.DangerousGetHandle()); + Assert.Throws(() => SafeHandleNative.SafeHandleReturn_Swapped_AbstractDerived(initialValue)); Assert.Throws(() => SafeHandleNative.SafeHandleReturn_Swapped_NoDefaultConstructor(initialValue)); @@ -51,9 +51,9 @@ public static void RunTest() handle = new TestSafeHandle(initialValue) }; - Assert.IsTrue(SafeHandleNative.StructWithSafeHandleByValue(str, initialValue)); - - Assert.IsTrue(SafeHandleNative.StructWithSafeHandleByRef(ref str, initialValue, initialValue)); + Assert.True(SafeHandleNative.StructWithSafeHandleByValue(str, initialValue)); + + Assert.True(SafeHandleNative.StructWithSafeHandleByRef(ref str, initialValue, initialValue)); // Cannot change the value of a SafeHandle-derived field in a struct when marshalling byref. Assert.Throws(() => SafeHandleNative.StructWithSafeHandleByRef(ref str, initialValue, newValue)); diff --git a/src/tests/Interop/PInvoke/SetLastError/SetLastErrorTest.cs b/src/tests/Interop/PInvoke/SetLastError/SetLastErrorTest.cs index d607ebd191b7d8..5335c6bd79aee1 100644 --- a/src/tests/Interop/PInvoke/SetLastError/SetLastErrorTest.cs +++ b/src/tests/Interop/PInvoke/SetLastError/SetLastErrorTest.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; class SetLastErrorTest { @@ -28,7 +28,7 @@ public static void LastErrorHasExpectedValue() int expected = Marshal.GetLastPInvokeError(); SetLastErrorNative.SetError_Default(expected + 1, shouldSetError: true); int actual = Marshal.GetLastPInvokeError(); - Assert.AreEqual(expected, actual); + Assert.Equal(expected, actual); } // SetLastError=false @@ -36,7 +36,7 @@ public static void LastErrorHasExpectedValue() int expected = Marshal.GetLastPInvokeError(); SetLastErrorNative.SetError_False(expected + 1, shouldSetError: true); int actual = Marshal.GetLastPInvokeError(); - Assert.AreEqual(expected, actual); + Assert.Equal(expected, actual); } // SetLastError=true @@ -45,7 +45,7 @@ public static void LastErrorHasExpectedValue() expected++; SetLastErrorNative.SetError_True(expected, shouldSetError: true); int actual = Marshal.GetLastPInvokeError(); - Assert.AreEqual(expected, actual); + Assert.Equal(expected, actual); } } @@ -59,7 +59,7 @@ public static void ClearPreviousError() // Calling a P/Invoke with SetLastError=true should clear any existing error. SetLastErrorNative.SetError_True(error, shouldSetError: false); int actual = Marshal.GetLastPInvokeError(); - Assert.AreEqual(0, actual); + Assert.Equal(0, actual); } static int Main(string[] args) diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.cs b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.cs index 8bdc87c31486ca..6a0ae8c4b4babd 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/Invalid/InvalidParamIndex.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; class Program { diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.cs b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.cs index f56c273bf1abfb..c92fce57f60fe0 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByOut/PassingByOutTest.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; /// /// Pass Array Size by out keyword using SizeParamIndex Attributes @@ -63,12 +63,12 @@ static void SizeParamTypeIsByte() byte byte_Array_Size; byte[] arrByte; - Assert.IsTrue(MarshalCStyleArrayByte_AsByOut_AsSizeParamIndex(out byte_Array_Size, out arrByte)); + Assert.True(MarshalCStyleArrayByte_AsByOut_AsSizeParamIndex(out byte_Array_Size, out arrByte)); //Construct Expected array int expected_ByteArray_Size = 1; byte[] expectedArrByte = Helper.GetExpChangeArray(expected_ByteArray_Size); - Assert.IsTrue(Helper.EqualArray(arrByte, (int)byte_Array_Size, expectedArrByte, (int)expectedArrByte.Length)); + Assert.True(Helper.EqualArray(arrByte, (int)byte_Array_Size, expectedArrByte, (int)expectedArrByte.Length)); Console.WriteLine(strDescription + " Ends!"); } @@ -81,10 +81,10 @@ static void SizeParamTypeIsSByte() sbyte sbyte_Array_Size; sbyte[] arrSbyte; - Assert.IsTrue(MarshalCStyleArraySbyte_AsByOut_AsSizeParamIndex(out sbyte_Array_Size, out arrSbyte)); + Assert.True(MarshalCStyleArraySbyte_AsByOut_AsSizeParamIndex(out sbyte_Array_Size, out arrSbyte)); sbyte[] expectedArrSbyte = Helper.GetExpChangeArray(sbyte.MaxValue); - Assert.IsTrue(Helper.EqualArray(arrSbyte, (int)sbyte_Array_Size, expectedArrSbyte, (int)expectedArrSbyte.Length)); + Assert.True(Helper.EqualArray(arrSbyte, (int)sbyte_Array_Size, expectedArrSbyte, (int)expectedArrSbyte.Length)); Console.WriteLine(strDescription + " Ends!"); } @@ -97,12 +97,12 @@ static void SizeParamTypeIsShort1() short shortArray_Size = (short)-1; short[] arrShort = Helper.InitArray(10); - Assert.IsTrue(MarshalCStyleArrayShort_AsByOut_AsSizeParamIndex(out shortArray_Size, out arrShort)); + Assert.True(MarshalCStyleArrayShort_AsByOut_AsSizeParamIndex(out shortArray_Size, out arrShort)); //Construct Expected Array int expected_ShortArray_Size = 16384;//(SHRT_MAX+1)/2 short[] expectedArrShort = Helper.GetExpChangeArray(expected_ShortArray_Size); - Assert.IsTrue(Helper.EqualArray(arrShort, (int)shortArray_Size, expectedArrShort, (int)expectedArrShort.Length)); + Assert.True(Helper.EqualArray(arrShort, (int)shortArray_Size, expectedArrShort, (int)expectedArrShort.Length)); Console.WriteLine(strDescription + " Ends!"); } @@ -127,11 +127,11 @@ static void SizeParamTypeIsUShort() ushort ushort_Array_Size; ushort[] arrUshort; - Assert.IsTrue(MarshalCStyleArrayUshort_AsByOut_AsSizeParamIndex(out arrUshort, out ushort_Array_Size)); + Assert.True(MarshalCStyleArrayUshort_AsByOut_AsSizeParamIndex(out arrUshort, out ushort_Array_Size)); //Expected Array ushort[] expectedArrUshort = Helper.GetExpChangeArray(ushort.MaxValue); - Assert.IsTrue(Helper.EqualArray(arrUshort, (int)ushort_Array_Size, expectedArrUshort, (ushort)expectedArrUshort.Length)); + Assert.True(Helper.EqualArray(arrUshort, (int)ushort_Array_Size, expectedArrUshort, (ushort)expectedArrUshort.Length)); Console.WriteLine(strDescription + " Ends!"); } @@ -145,11 +145,11 @@ static void SizeParamTypeIsInt32() Int32 Int32_Array_Size; Int32[] arrInt32; - Assert.IsTrue(MarshalCStyleArrayInt_AsByOut_AsSizeParamIndex(out Int32_Array_Size, out arrInt32)); + Assert.True(MarshalCStyleArrayInt_AsByOut_AsSizeParamIndex(out Int32_Array_Size, out arrInt32)); //Expected Array Int32[] expectedArrInt32 = Helper.GetExpChangeArray(0); - Assert.IsTrue(Helper.EqualArray(arrInt32, Int32_Array_Size, expectedArrInt32, expectedArrInt32.Length)); + Assert.True(Helper.EqualArray(arrInt32, Int32_Array_Size, expectedArrInt32, expectedArrInt32.Length)); Console.WriteLine(strDescription + " Ends!"); } @@ -165,11 +165,11 @@ static void SizeParamTypeIsUInt32() UInt32 UInt32_Array_Size = (UInt32)10; UInt32[] arrUInt32 = Helper.InitArray((Int32)UInt32_Array_Size); - Assert.IsTrue(MarshalCStyleArrayUInt_AsByOut_AsSizeParamIndex(out UInt32_Array_Size, out arrUInt32)); + Assert.True(MarshalCStyleArrayUInt_AsByOut_AsSizeParamIndex(out UInt32_Array_Size, out arrUInt32)); //Construct expected UInt32[] expectedArrUInt32 = Helper.GetExpChangeArray(expected_UInt32ArraySize); - Assert.IsTrue(Helper.EqualArray(arrUInt32, (Int32)UInt32_Array_Size, expectedArrUInt32, (Int32)expectedArrUInt32.Length)); + Assert.True(Helper.EqualArray(arrUInt32, (Int32)UInt32_Array_Size, expectedArrUInt32, (Int32)expectedArrUInt32.Length)); Console.WriteLine(strDescription + " Ends!"); } @@ -185,10 +185,10 @@ static void SizeParamTypeIsLong() long long_Array_Size = (long)10; long[] arrLong = Helper.InitArray((Int32)long_Array_Size); - Assert.IsTrue(MarshalCStyleArrayLong_AsByOut_AsSizeParamIndex(out long_Array_Size, out arrLong)); + Assert.True(MarshalCStyleArrayLong_AsByOut_AsSizeParamIndex(out long_Array_Size, out arrLong)); long[] expectedArrLong = Helper.GetExpChangeArray(expected_LongArraySize); - Assert.IsTrue(Helper.EqualArray(arrLong, (Int32)long_Array_Size, expectedArrLong, (Int32)expectedArrLong.Length)); + Assert.True(Helper.EqualArray(arrLong, (Int32)long_Array_Size, expectedArrLong, (Int32)expectedArrLong.Length)); Console.WriteLine(strDescription + " Ends!"); } @@ -204,10 +204,10 @@ static void SizeParamTypeIsULong() ulong ulong_Array_Size = (ulong)10; ulong[] arrUlong = Helper.InitArray((Int32)ulong_Array_Size); - Assert.IsTrue(MarshalCStyleArrayUlong_AsByOut_AsSizeParamIndex(out arrUlong, out ulong_Array_Size, ulong_Array_Size)); + Assert.True(MarshalCStyleArrayUlong_AsByOut_AsSizeParamIndex(out arrUlong, out ulong_Array_Size, ulong_Array_Size)); ulong[] expectedArrUlong = Helper.GetExpChangeArray(expected_ULongArraySize); - Assert.IsTrue(Helper.EqualArray(arrUlong, (Int32)ulong_Array_Size, expectedArrUlong, (Int32)expectedArrUlong.Length)); + Assert.True(Helper.EqualArray(arrUlong, (Int32)ulong_Array_Size, expectedArrUlong, (Int32)expectedArrUlong.Length)); Console.WriteLine(strDescription + " Ends!"); } @@ -222,10 +222,10 @@ static void SizeParamTypeIsString() int expected_StringArraySize = 20; int string_Array_Size = 10; String[] arrString = Helper.InitArray(string_Array_Size); - Assert.IsTrue(MarshalCStyleArrayString_AsByOut_AsSizeParamIndex(out arrString, out string_Array_Size)); + Assert.True(MarshalCStyleArrayString_AsByOut_AsSizeParamIndex(out arrString, out string_Array_Size)); String[] expArrString = Helper.GetExpChangeArray(expected_StringArraySize); - Assert.IsTrue(Helper.EqualArray(arrString, string_Array_Size, expArrString, expArrString.Length)); + Assert.True(Helper.EqualArray(arrString, string_Array_Size, expArrString, expArrString.Length)); Console.WriteLine(strDescription + " Ends!"); } diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.cs b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.cs index 20e0a20236f3c8..5ce6f7b08b142a 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/PInvoke/PassingByRef/PassingByRefTest.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; /// /// Pass LPArray Size by ref keyword using SizeParamIndex Attributes @@ -65,12 +65,12 @@ static void SizeParamTypeIsByte() byte byte_Array_Size = 1; byte[] arrByte = Helper.InitArray(byte_Array_Size); - Assert.IsTrue(MarshalCStyleArrayByte_AsByRef_AsSizeParamIndex(ref byte_Array_Size, ref arrByte)); + Assert.True(MarshalCStyleArrayByte_AsByRef_AsSizeParamIndex(ref byte_Array_Size, ref arrByte)); //Construct Expected array int expected_ByteArray_Size = Byte.MinValue; byte[] expectedArrByte = Helper.GetExpChangeArray(expected_ByteArray_Size); - Assert.IsTrue(Helper.EqualArray(arrByte, (int)byte_Array_Size, expectedArrByte, (int)expectedArrByte.Length)); + Assert.True(Helper.EqualArray(arrByte, (int)byte_Array_Size, expectedArrByte, (int)expectedArrByte.Length)); Console.WriteLine(strDescription + " Ends!"); } @@ -84,11 +84,11 @@ static void SizeParamTypeIsSByte() sbyte sbyte_Array_Size = (sbyte)10; sbyte[] arrSbyte = Helper.InitArray(sbyte_Array_Size); - Assert.IsTrue(MarshalCStyleArraySbyte_AsByRef_AsSizeParamIndex(ref sbyte_Array_Size, ref arrSbyte)); + Assert.True(MarshalCStyleArraySbyte_AsByRef_AsSizeParamIndex(ref sbyte_Array_Size, ref arrSbyte)); //Construct Expected sbyte[] expectedArrSbyte = Helper.GetExpChangeArray(sbyte.MaxValue); - Assert.IsTrue(Helper.EqualArray(arrSbyte, (int)sbyte_Array_Size, expectedArrSbyte, (int)sbyte.MaxValue)); + Assert.True(Helper.EqualArray(arrSbyte, (int)sbyte_Array_Size, expectedArrSbyte, (int)sbyte.MaxValue)); Console.WriteLine(strDescription + " Ends!"); } @@ -103,11 +103,11 @@ static void SizeParamTypeIsShort1() short[] arrShort = Helper.InitArray(10); int expected_ByteArraySize = 20; - Assert.IsTrue(MarshalCStyleArrayShort_AsByRef_AsSizeParamIndex(ref short_Array_Size, ref arrShort)); + Assert.True(MarshalCStyleArrayShort_AsByRef_AsSizeParamIndex(ref short_Array_Size, ref arrShort)); //Construct Expected short[] expectedArrShort = Helper.GetExpChangeArray(expected_ByteArraySize); - Assert.IsTrue(Helper.EqualArray(arrShort, (int)short_Array_Size, expectedArrShort, expectedArrShort.Length)); + Assert.True(Helper.EqualArray(arrShort, (int)short_Array_Size, expectedArrShort, expectedArrShort.Length)); Console.WriteLine(strDescription + " Ends!"); } @@ -134,11 +134,11 @@ static void SizeParamTypeIsUShort() ushort[] arrUshort = Helper.InitArray(ushort_Array_Size); int expected_UshortArraySize = ushort.MaxValue; - Assert.IsTrue(MarshalCStyleArrayUshort_AsByRef_AsSizeParamIndex(ref arrUshort, ref ushort_Array_Size)); + Assert.True(MarshalCStyleArrayUshort_AsByRef_AsSizeParamIndex(ref arrUshort, ref ushort_Array_Size)); //Construct Expected ushort[] expectedArrShort = Helper.GetExpChangeArray(expected_UshortArraySize); - Assert.IsTrue(Helper.EqualArray(arrUshort, (int)ushort_Array_Size, expectedArrShort, expectedArrShort.Length)); + Assert.True(Helper.EqualArray(arrUshort, (int)ushort_Array_Size, expectedArrShort, expectedArrShort.Length)); Console.WriteLine(strDescription + " Ends!"); } @@ -152,12 +152,12 @@ static void SizeParamTypeIsInt32() Int32 Int32_Array_Size = (Int32)10; Int32[] arrInt32 = Helper.InitArray(Int32_Array_Size); - Assert.IsTrue(MarshalCStyleArrayInt_AsByRef_AsSizeParamIndex(ref Int32_Array_Size, Int32.MaxValue, ref arrInt32)); + Assert.True(MarshalCStyleArrayInt_AsByRef_AsSizeParamIndex(ref Int32_Array_Size, Int32.MaxValue, ref arrInt32)); //Construct Expected int expected_UshortArraySize = 1; Int32[] expectedArrInt32 = Helper.GetExpChangeArray(expected_UshortArraySize); - Assert.IsTrue(Helper.EqualArray(arrInt32, Int32_Array_Size, expectedArrInt32, expectedArrInt32.Length)); + Assert.True(Helper.EqualArray(arrInt32, Int32_Array_Size, expectedArrInt32, expectedArrInt32.Length)); Console.WriteLine(strDescription + " Ends!"); } @@ -170,12 +170,12 @@ static void SizeParamTypeIsUInt32() UInt32 UInt32_Array_Size = (UInt32)1234; UInt32[] arrUInt32 = Helper.InitArray((Int32)UInt32_Array_Size); - Assert.IsTrue(MarshalCStyleArrayUInt_AsByRef_AsSizeParamIndex(ref arrUInt32, 1234, ref UInt32_Array_Size)); + Assert.True(MarshalCStyleArrayUInt_AsByRef_AsSizeParamIndex(ref arrUInt32, 1234, ref UInt32_Array_Size)); //Construct Expected int expected_UInt32ArraySize = 4321; UInt32[] expectedArrUInt32 = Helper.GetExpChangeArray(expected_UInt32ArraySize); - Assert.IsTrue(Helper.EqualArray(arrUInt32, (Int32)UInt32_Array_Size, expectedArrUInt32, (Int32)expectedArrUInt32.Length)); + Assert.True(Helper.EqualArray(arrUInt32, (Int32)UInt32_Array_Size, expectedArrUInt32, (Int32)expectedArrUInt32.Length)); Console.WriteLine(strDescription + " Ends!"); } @@ -188,12 +188,12 @@ static void SizeParamTypeIsLong() long long_Array_Size = (long)10; long[] arrLong = Helper.InitArray((Int32)long_Array_Size); - Assert.IsTrue(MarshalCStyleArrayLong_AsByRef_AsSizeParamIndex(ref long_Array_Size, ref arrLong)); + Assert.True(MarshalCStyleArrayLong_AsByRef_AsSizeParamIndex(ref long_Array_Size, ref arrLong)); //Construct Expected Array int expected_LongArraySize = 20; long[] expectedArrLong = Helper.GetExpChangeArray(expected_LongArraySize); - Assert.IsTrue(Helper.EqualArray(arrLong, (Int32)long_Array_Size, expectedArrLong, (Int32)expectedArrLong.Length)); + Assert.True(Helper.EqualArray(arrLong, (Int32)long_Array_Size, expectedArrLong, (Int32)expectedArrLong.Length)); Console.WriteLine(strDescription + " Ends!"); } @@ -207,12 +207,12 @@ static void SizeParamTypeIsULong() ulong ulong_Array_Size = (ulong)0; ulong[] arrUlong = Helper.InitArray((Int32)ulong_Array_Size); - Assert.IsTrue(MarshalCStyleArrayUlong_AsByRef_AsSizeParamIndex(ref ulong_Array_Size, ref arrUlong)); + Assert.True(MarshalCStyleArrayUlong_AsByRef_AsSizeParamIndex(ref ulong_Array_Size, ref arrUlong)); //Construct Expected int expected_ULongArraySize = 0; ulong[] expectedArrUlong = Helper.GetExpChangeArray(expected_ULongArraySize); - Assert.IsTrue(Helper.EqualArray(arrUlong, (Int32)ulong_Array_Size, expectedArrUlong, (Int32)expectedArrUlong.Length)); + Assert.True(Helper.EqualArray(arrUlong, (Int32)ulong_Array_Size, expectedArrUlong, (Int32)expectedArrUlong.Length)); Console.WriteLine(strDescription + " Ends!"); } @@ -227,12 +227,12 @@ static void SizeParamTypeIsString() String[] arrString = Helper.InitArray(array_Size); String[] arrString2 = Helper.InitArray(array_Size); - Assert.IsTrue(MarshalCStyleArrayString_AsByRef_AsSizeParamIndex(ref array_Size, ref arrString, ref arrString2)); + Assert.True(MarshalCStyleArrayString_AsByRef_AsSizeParamIndex(ref array_Size, ref arrString, ref arrString2)); //Construct Expected int expected_StringArraySize = 10; String[] expArrString = Helper.GetExpChangeArray(expected_StringArraySize); - Assert.IsTrue(Helper.EqualArray(arrString, array_Size, expArrString, expArrString.Length)); + Assert.True(Helper.EqualArray(arrString, array_Size, expArrString, expArrString.Length)); Console.WriteLine(strDescription + " Ends!"); } diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.cs b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.cs index bf0c46c83c4f13..bacac28fd6a22d 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByOut/PassingByOutTest.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; public class ReversePInvoke_MashalArrayByOut_AsManagedTest { @@ -56,7 +56,7 @@ public class ReversePInvoke_MashalArrayByOut_AsManagedTest public delegate bool DelUlongArrByOutAsCdeclCaller([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] out ulong[] arrArg, out ulong arraySize); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool DelStringArrByOutAsCdeclCaller([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1, ArraySubType = UnmanagedType.BStr)] out string[] arrArg, out Int32 arraySize); - + #endregion #region Test Method @@ -149,45 +149,45 @@ public static void RunTestByOut() //Common value type Console.WriteLine("\tScenario 1 : byte ==> BYTE, Array_Size = byte.MinValue, Return_Array_Size = 20"); - Assert.IsTrue(DoCallBack_MarshalByteArray_AsParam_AsByOut(new DelByteArrByOutAsCdeclCaller(TestMethodForByteArray_AsReversePInvokeByOut_AsCdecl))); + Assert.True(DoCallBack_MarshalByteArray_AsParam_AsByOut(new DelByteArrByOutAsCdeclCaller(TestMethodForByteArray_AsReversePInvokeByOut_AsCdecl))); Console.WriteLine("\t\tMarshalByteArray_AsReversePInvokeByOut_AsCdecl Passed!"); Console.WriteLine("\tScenario 2 : sbyte ==> CHAR, Array_Size = 1, Return_Array_Size = sbyte.Max"); - Assert.IsTrue(DoCallBack_MarshalSbyteArray_AsParam_AsByOut(new DelSbyteArrByOutAsCdeclCaller(TestMethodForSbyteArray_AsReversePInvokeByOut_AsCdecl))); + Assert.True(DoCallBack_MarshalSbyteArray_AsParam_AsByOut(new DelSbyteArrByOutAsCdeclCaller(TestMethodForSbyteArray_AsReversePInvokeByOut_AsCdecl))); Console.WriteLine("\t\tMarshalSbyteArray_AsReversePInvokeByOut_AsCdecl Passed!"); Console.WriteLine("\tScenario 3 : short ==> SHORT, Array_Size = -1, Return_Array_Size = 20"); - Assert.IsTrue(DoCallBack_MarshalShortArray_AsParam_AsByOut(new DelShortArrByOutAsCdeclCaller(TestMethodForShortArray_AsReversePInvokeByOut_AsCdecl))); + Assert.True(DoCallBack_MarshalShortArray_AsParam_AsByOut(new DelShortArrByOutAsCdeclCaller(TestMethodForShortArray_AsReversePInvokeByOut_AsCdecl))); Console.WriteLine("\t\tMarshalShortArray_AsReversePInvokeByOut_AsCdecl Failed!"); Console.WriteLine("\tScenario 4 : short ==> SHORT, Array_Size = 10, Return_Array_Size = -1"); - Assert.IsTrue(DoCallBack_MarshalShortArrayReturnNegativeSize_AsParam_AsByOut(new DelShortArrByOutAsCdeclCaller(TestMethodForShortArrayReturnNegativeSize_AsReversePInvokeByOut_AsCdecl))); + Assert.True(DoCallBack_MarshalShortArrayReturnNegativeSize_AsParam_AsByOut(new DelShortArrByOutAsCdeclCaller(TestMethodForShortArrayReturnNegativeSize_AsReversePInvokeByOut_AsCdecl))); Console.WriteLine("\t\tMarshalShortArray_AsReversePInvokeByOut_AsCdecl Passed!"); Console.WriteLine("\tScenario 5 : ushort ==> USHORT, Array_Size = ushort.MaxValue, Return_Array_Size = 20"); - Assert.IsTrue(DoCallBack_MarshalUshortArray_AsParam_AsByOut(new DelUshortArrByOutAsCdeclCaller(TestMethodForUshortArray_AsReversePInvokeByOut_AsCdecl))); + Assert.True(DoCallBack_MarshalUshortArray_AsParam_AsByOut(new DelUshortArrByOutAsCdeclCaller(TestMethodForUshortArray_AsReversePInvokeByOut_AsCdecl))); Console.WriteLine("\t\tMarshalUshortArray_AsReversePInvokeByOut_AsCdecl Passed!"); Console.WriteLine("\tScenario 6 : Int32 ==> LONG, Array_Size = 10, Return_Array_Size = 20"); - Assert.IsTrue(DoCallBack_MarshalInt32Array_AsParam_AsByOut(new DelInt32ArrByOutAsCdeclCaller(TestMethodForInt32Array_AsReversePInvokeByOut_AsCdecl))); + Assert.True(DoCallBack_MarshalInt32Array_AsParam_AsByOut(new DelInt32ArrByOutAsCdeclCaller(TestMethodForInt32Array_AsReversePInvokeByOut_AsCdecl))); Console.WriteLine("\t\tMarshalInt32Array_AsReversePInvokeByOut_AsCdecl Passed!"); Console.WriteLine("\tScenario 7 : UInt32 ==> ULONG, Array_Size = 10, Return_Array_Size = 20"); - Assert.IsTrue(DoCallBack_MarshalUint32Array_AsParam_AsByOut(new DelUint32ArrByOutAsCdeclCaller(TestMethodForUint32Array_AsReversePInvokeByOut_AsCdecl))); + Assert.True(DoCallBack_MarshalUint32Array_AsParam_AsByOut(new DelUint32ArrByOutAsCdeclCaller(TestMethodForUint32Array_AsReversePInvokeByOut_AsCdecl))); Console.WriteLine("\t\tMarshalUint32Array_AsReversePInvokeByOut_AsCdecl Passed!"); Console.WriteLine("\tScenario 8 : long ==> LONGLONG, Array_Size = 10, Return_Array_Size = 20"); - Assert.IsTrue(DoCallBack_MarshalLongArray_AsParam_AsByOut(new DelLongArrByOutAsCdeclCaller(TestMethodForLongArray_AsReversePInvokeByOut_AsCdecl))); + Assert.True(DoCallBack_MarshalLongArray_AsParam_AsByOut(new DelLongArrByOutAsCdeclCaller(TestMethodForLongArray_AsReversePInvokeByOut_AsCdecl))); Console.WriteLine("\t\tMarshalLongArray_AsReversePInvokeByOut_AsCdecl Passed!"); Console.WriteLine("\tScenario 9 : ulong ==> ULONGLONG, Array_Size = 10, Return_Array_Size = 20"); - Assert.IsTrue(DoCallBack_MarshalUlongArray_AsParam_AsByOut(new DelUlongArrByOutAsCdeclCaller(TestMethodForUlongArray_AsReversePInvokeByOut_AsCdecl))); + Assert.True(DoCallBack_MarshalUlongArray_AsParam_AsByOut(new DelUlongArrByOutAsCdeclCaller(TestMethodForUlongArray_AsReversePInvokeByOut_AsCdecl))); Console.WriteLine("\t\tMarshalUlongArray_AsReversePInvokeByOut_AsCdecl Passed!"); if (OperatingSystem.IsWindows()) { Console.WriteLine("\tScenario 10 : string ==> BSTR, Array_Size = 10, Return_Array_Size = 20"); - Assert.IsTrue(DoCallBack_MarshalStringArray_AsParam_AsByOut(new DelStringArrByOutAsCdeclCaller(TestMethodForStringArray_AsReversePInvokeByOut_AsCdecl))); + Assert.True(DoCallBack_MarshalStringArray_AsParam_AsByOut(new DelStringArrByOutAsCdeclCaller(TestMethodForStringArray_AsReversePInvokeByOut_AsCdecl))); Console.WriteLine("\t\tMarshalStringArray_AsReversePInvokeByOut_AsCdecl Passed!"); } } diff --git a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.cs b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.cs index 13b53e610b6bd1..afe1b114065a79 100644 --- a/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.cs +++ b/src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/PassingByRefTest.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; public class ReversePInvoke_MashalArrayByRef_AsManagedTest { @@ -56,7 +56,7 @@ public class ReversePInvoke_MashalArrayByRef_AsManagedTest public delegate bool DelUlongArrByRefAsCdeclCaller([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] ref ulong[] arrArg, ref ulong arraySize); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool DelStringArrByRefAsCdeclCaller([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1, ArraySubType = UnmanagedType.BStr)] ref string[] arrArg, ref Int32 arraySize); - + #endregion #region Test Method @@ -159,11 +159,11 @@ public static void RunTestByRef() //Common value type Console.WriteLine("\tScenario 1 : byte ==> BYTE, Array_Size = byte.MinValue, Return_Array_Size = 20"); - Assert.IsTrue(DoCallBack_MarshalByteArray_AsParam_AsByRef(new DelByteArrByRefAsCdeclCaller(TestMethodForByteArray_AsReversePInvokeByRef_AsCdecl))); + Assert.True(DoCallBack_MarshalByteArray_AsParam_AsByRef(new DelByteArrByRefAsCdeclCaller(TestMethodForByteArray_AsReversePInvokeByRef_AsCdecl))); Console.WriteLine("\t\tMarshalByteArray_AsReversePInvokeByRef_AsCdecl Passed!"); Console.WriteLine("\tScenario 2 : sbyte ==> CHAR, Array_Size = 1, Return_Array_Size = sbyte.Max"); - Assert.IsTrue(DoCallBack_MarshalSbyteArray_AsParam_AsByRef(new DelSbyteArrByRefAsCdeclCaller(TestMethodForSbyteArray_AsReversePInvokeByRef_AsCdecl))); + Assert.True(DoCallBack_MarshalSbyteArray_AsParam_AsByRef(new DelSbyteArrByRefAsCdeclCaller(TestMethodForSbyteArray_AsReversePInvokeByRef_AsCdecl))); Console.WriteLine("\t\tMarshalSbyteArray_AsReversePInvokeByRef_AsCdecl Passed!"); // We don't support exception interop in .NET off-Windows. @@ -176,33 +176,33 @@ public static void RunTestByRef() Console.WriteLine("\tScenario 4 : short ==> SHORT, Array_Size = 10, Return_Array_Size = -1"); - Assert.IsTrue(DoCallBack_MarshalShortArrayReturnNegativeSize_AsParam_AsByRef(new DelShortArrByRefAsCdeclCaller(TestMethodForShortArrayReturnNegativeSize_AsReversePInvokeByRef_AsCdecl))); + Assert.True(DoCallBack_MarshalShortArrayReturnNegativeSize_AsParam_AsByRef(new DelShortArrByRefAsCdeclCaller(TestMethodForShortArrayReturnNegativeSize_AsReversePInvokeByRef_AsCdecl))); Console.WriteLine("\t\tMarshalShortArray_AsReversePInvokeByRef_AsCdecl Passed!"); Console.WriteLine("\tScenario 5 : ushort ==> USHORT, Array_Size = ushort.MaxValue, Return_Array_Size = 20"); - Assert.IsTrue(DoCallBack_MarshalUshortArray_AsParam_AsByRef(new DelUshortArrByRefAsCdeclCaller(TestMethodForUshortArray_AsReversePInvokeByRef_AsCdecl))); + Assert.True(DoCallBack_MarshalUshortArray_AsParam_AsByRef(new DelUshortArrByRefAsCdeclCaller(TestMethodForUshortArray_AsReversePInvokeByRef_AsCdecl))); Console.WriteLine("\t\tMarshalUshortArray_AsReversePInvokeByRef_AsCdecl Passed!"); Console.WriteLine("\tScenario 6 : Int32 ==> LONG, Array_Size = 10, Return_Array_Size = 20"); - Assert.IsTrue(DoCallBack_MarshalInt32Array_AsParam_AsByRef(new DelInt32ArrByRefAsCdeclCaller(TestMethodForInt32Array_AsReversePInvokeByRef_AsCdecl))); + Assert.True(DoCallBack_MarshalInt32Array_AsParam_AsByRef(new DelInt32ArrByRefAsCdeclCaller(TestMethodForInt32Array_AsReversePInvokeByRef_AsCdecl))); Console.WriteLine("\t\tMarshalInt32Array_AsReversePInvokeByRef_AsCdecl Passed!"); Console.WriteLine("\tScenario 7 : UInt32 ==> ULONG, Array_Size = 10, Return_Array_Size = 20"); - Assert.IsTrue(DoCallBack_MarshalUint32Array_AsParam_AsByRef(new DelUint32ArrByRefAsCdeclCaller(TestMethodForUint32Array_AsReversePInvokeByRef_AsCdecl))); + Assert.True(DoCallBack_MarshalUint32Array_AsParam_AsByRef(new DelUint32ArrByRefAsCdeclCaller(TestMethodForUint32Array_AsReversePInvokeByRef_AsCdecl))); Console.WriteLine("\t\tMarshalUint32Array_AsReversePInvokeByRef_AsCdecl Passed!"); Console.WriteLine("\tScenario 8 : long ==> LONGLONG, Array_Size = 10, Return_Array_Size = 20"); - Assert.IsTrue(DoCallBack_MarshalLongArray_AsParam_AsByRef(new DelLongArrByRefAsCdeclCaller(TestMethodForLongArray_AsReversePInvokeByRef_AsCdecl))); + Assert.True(DoCallBack_MarshalLongArray_AsParam_AsByRef(new DelLongArrByRefAsCdeclCaller(TestMethodForLongArray_AsReversePInvokeByRef_AsCdecl))); Console.WriteLine("\t\tMarshalLongArray_AsReversePInvokeByRef_AsCdecl Passed!"); Console.WriteLine("\tScenario 9 : ulong ==> ULONGLONG, Array_Size = 10, Return_Array_Size = 20"); - Assert.IsTrue(DoCallBack_MarshalUlongArray_AsParam_AsByRef(new DelUlongArrByRefAsCdeclCaller(TestMethodForUlongArray_AsReversePInvokeByRef_AsCdecl))); + Assert.True(DoCallBack_MarshalUlongArray_AsParam_AsByRef(new DelUlongArrByRefAsCdeclCaller(TestMethodForUlongArray_AsReversePInvokeByRef_AsCdecl))); Console.WriteLine("\t\tMarshalUlongArray_AsReversePInvokeByRef_AsCdecl Passed!"); if (OperatingSystem.IsWindows()) { Console.WriteLine("\tScenario 10 : string ==> BSTR, Array_Size = 10, Return_Array_Size = 20"); - Assert.IsTrue(DoCallBack_MarshalStringArray_AsParam_AsByRef(new DelStringArrByRefAsCdeclCaller(TestMethodForStringArray_AsReversePInvokeByRef_AsCdecl))); + Assert.True(DoCallBack_MarshalStringArray_AsParam_AsByRef(new DelStringArrByRefAsCdeclCaller(TestMethodForStringArray_AsReversePInvokeByRef_AsCdecl))); Console.WriteLine("\t\tMarshalStringArray_AsReversePInvokeByRef_AsCdecl Passed!"); } } diff --git a/src/tests/Interop/PInvoke/Varargs/VarargsTest.cs b/src/tests/Interop/PInvoke/Varargs/VarargsTest.cs index 1268ee8d030c84..cd96936b520905 100644 --- a/src/tests/Interop/PInvoke/Varargs/VarargsTest.cs +++ b/src/tests/Interop/PInvoke/Varargs/VarargsTest.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; namespace PInvokeTests { diff --git a/src/tests/Interop/PInvoke/Variant/VariantNative.cpp b/src/tests/Interop/PInvoke/Variant/VariantNative.cpp index d55e7fae1cc54d..d92b2a0906c9c5 100644 --- a/src/tests/Interop/PInvoke/Variant/VariantNative.cpp +++ b/src/tests/Interop/PInvoke/Variant/VariantNative.cpp @@ -146,19 +146,19 @@ extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_ByValue_String(VARIANT valu extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_ByValue_Object(VARIANT value) { - + if (value.vt != VT_DISPATCH) { printf("Invalid format. Expected VT_DISPATCH.\n"); return FALSE; } - + IDispatch* obj = value.pdispVal; if (obj == NULL) { - printf("Marshal_ByValue (Native side) recieved an invalid IDispatch pointer\n"); + printf("Marshal_ByValue (Native side) received an invalid IDispatch pointer\n"); return FALSE; } @@ -171,19 +171,19 @@ extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_ByValue_Object(VARIANT valu extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_ByValue_Object_IUnknown(VARIANT value) { - + if (value.vt != VT_UNKNOWN) { printf("Invalid format. Expected VT_UNKNOWN.\n"); return FALSE; } - + IUnknown* obj = value.punkVal; if (obj == NULL) { - printf("Marshal_ByValue (Native side) recieved an invalid IUnknown pointer\n"); + printf("Marshal_ByValue (Native side) received an invalid IUnknown pointer\n"); return FALSE; } @@ -212,7 +212,7 @@ extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_ByValue_Empty(VARIANT value printf("Invalid format. Expected VT_EMPTY. \n"); return FALSE; } - + return TRUE; } @@ -270,7 +270,7 @@ extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_ByValue_Null(VARIANT value) printf("Invalid format. Expected VT_NULL. \n"); return FALSE; } - + return TRUE; } @@ -406,7 +406,7 @@ extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_ByRef_String(VARIANT* value printf("Invalid format. Expected VT_BSTR.\n"); return FALSE; } - + if (value->bstrVal == NULL || expected == NULL) { return value->bstrVal == NULL && expected == NULL; @@ -419,19 +419,19 @@ extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_ByRef_String(VARIANT* value extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_ByRef_Object(VARIANT* value) { - + if (value->vt != VT_DISPATCH) { printf("Invalid format. Expected VT_DISPATCH.\n"); return FALSE; } - + IDispatch* obj = value->pdispVal; if (obj == NULL) { - printf("Marshal_ByRef (Native side) recieved an invalid IDispatch pointer\n"); + printf("Marshal_ByRef (Native side) received an invalid IDispatch pointer\n"); return FALSE; } @@ -444,19 +444,19 @@ extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_ByRef_Object(VARIANT* value extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_ByRef_Object_IUnknown(VARIANT* value) { - + if (value->vt != VT_UNKNOWN) { printf("Invalid format. Expected VT_UNKNOWN.\n"); return FALSE; } - + IUnknown* obj = value->punkVal; if (obj == NULL) { - printf("Marshal_ByRef (Native side) recieved an invalid IUnknown pointer\n"); + printf("Marshal_ByRef (Native side) received an invalid IUnknown pointer\n"); return FALSE; } @@ -485,7 +485,7 @@ extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_ByRef_Empty(VARIANT* value) printf("Invalid format. Expected VT_EMPTY. \n"); return FALSE; } - + return TRUE; } @@ -542,7 +542,7 @@ extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_ByRef_Null(VARIANT* value) printf("Invalid format. Expected VT_NULL. \n"); return FALSE; } - + return TRUE; } @@ -704,7 +704,7 @@ extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_Struct_ByValue_String(Varia printf("Invalid format. Expected VT_BSTR.\n"); return FALSE; } - + if (wrapper.value.bstrVal == NULL || expected == NULL) { return wrapper.value.bstrVal == NULL && expected == NULL; @@ -717,19 +717,19 @@ extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_Struct_ByValue_String(Varia extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_Struct_ByValue_Object(VariantWrapper wrapper) { - + if (wrapper.value.vt != VT_DISPATCH) { printf("Invalid format. Expected VT_DISPATCH.\n"); return FALSE; } - + IDispatch* obj = wrapper.value.pdispVal; if (obj == NULL) { - printf("Marshal_Struct_ByValue (Native side) recieved an invalid IDispatch pointer\n"); + printf("Marshal_Struct_ByValue (Native side) received an invalid IDispatch pointer\n"); return FALSE; } @@ -742,19 +742,19 @@ extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_Struct_ByValue_Object(Varia extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_Struct_ByValue_Object_IUnknown(VariantWrapper wrapper) { - + if (wrapper.value.vt != VT_UNKNOWN) { printf("Invalid format. Expected VT_UNKNOWN.\n"); return FALSE; } - + IUnknown* obj = wrapper.value.punkVal; if (obj == NULL) { - printf("Marshal_Struct_ByValue (Native side) recieved an invalid IUnknown pointer\n"); + printf("Marshal_Struct_ByValue (Native side) received an invalid IUnknown pointer\n"); return FALSE; } @@ -783,7 +783,7 @@ extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_Struct_ByValue_Empty(Varian printf("Invalid format. Expected VT_EMPTY. \n"); return FALSE; } - + return TRUE; } @@ -840,7 +840,7 @@ extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_Struct_ByValue_Null(Variant printf("Invalid format. Expected VT_NULL. \n"); return FALSE; } - + return TRUE; } @@ -972,7 +972,7 @@ extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_Struct_ByRef_String(Variant printf("Invalid format. Expected VT_BSTR.\n"); return FALSE; } - + if (pWrapper->value.bstrVal == NULL || expected == NULL) { return pWrapper->value.bstrVal == NULL && expected == NULL; @@ -985,19 +985,19 @@ extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_Struct_ByRef_String(Variant extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_Struct_ByRef_Object(VariantWrapper* pWrapper) { - + if (pWrapper->value.vt != VT_DISPATCH) { printf("Invalid format. Expected VT_DISPATCH.\n"); return FALSE; } - + IDispatch* obj = pWrapper->value.pdispVal; if (obj == NULL) { - printf("Marshal_Struct_ByRef (Native side) recieved an invalid IDispatch pointer\n"); + printf("Marshal_Struct_ByRef (Native side) received an invalid IDispatch pointer\n"); return FALSE; } @@ -1010,19 +1010,19 @@ extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_Struct_ByRef_Object(Variant extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_Struct_ByRef_Object_IUnknown(VariantWrapper* pWrapper) { - + if (pWrapper->value.vt != VT_UNKNOWN) { printf("Invalid format. Expected VT_UNKNOWN.\n"); return FALSE; } - + IUnknown* obj = pWrapper->value.punkVal; if (obj == NULL) { - printf("Marshal_Struct_ByRef (Native side) recieved an invalid IUnknown pointer\n"); + printf("Marshal_Struct_ByRef (Native side) received an invalid IUnknown pointer\n"); return FALSE; } @@ -1051,7 +1051,7 @@ extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_Struct_ByRef_Empty(VariantW printf("Invalid format. Expected VT_EMPTY. \n"); return FALSE; } - + return TRUE; } @@ -1108,7 +1108,7 @@ extern "C" BOOL DLL_EXPORT STDMETHODCALLTYPE Marshal_Struct_ByRef_Null(VariantWr printf("Invalid format. Expected VT_NULL. \n"); return FALSE; } - + return TRUE; } diff --git a/src/tests/Interop/PInvoke/Variant/VariantTest.BuiltInCom.cs b/src/tests/Interop/PInvoke/Variant/VariantTest.BuiltInCom.cs index e7ab505fe2973e..76e980f82160a9 100644 --- a/src/tests/Interop/PInvoke/Variant/VariantTest.BuiltInCom.cs +++ b/src/tests/Interop/PInvoke/Variant/VariantTest.BuiltInCom.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; using static VariantNative; #pragma warning disable CS0612, CS0618 diff --git a/src/tests/Interop/PInvoke/Variant/VariantTest.ComWrappers.cs b/src/tests/Interop/PInvoke/Variant/VariantTest.ComWrappers.cs index a6f45314b2a008..bfbeacea91320b 100644 --- a/src/tests/Interop/PInvoke/Variant/VariantTest.ComWrappers.cs +++ b/src/tests/Interop/PInvoke/Variant/VariantTest.ComWrappers.cs @@ -5,7 +5,7 @@ using System.Collections; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; using static VariantNative; using ComTypes = System.Runtime.InteropServices.ComTypes; diff --git a/src/tests/Interop/PInvoke/Variant/VariantTest.cs b/src/tests/Interop/PInvoke/Variant/VariantTest.cs index d56ab2d3cc4eee..26829d8b34cbd3 100644 --- a/src/tests/Interop/PInvoke/Variant/VariantTest.cs +++ b/src/tests/Interop/PInvoke/Variant/VariantTest.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; using static VariantNative; // Class used to validate the IClassX generation path doesn't fail. @@ -34,33 +34,33 @@ partial class Test_VariantTest private unsafe static void TestByValue(bool hasComSupport) { - Assert.IsTrue(Marshal_ByValue_Byte((byte)NumericValue, NumericValue)); - Assert.IsTrue(Marshal_ByValue_SByte((sbyte)NumericValue, (sbyte)NumericValue)); - Assert.IsTrue(Marshal_ByValue_Int16((short)NumericValue, NumericValue)); - Assert.IsTrue(Marshal_ByValue_UInt16((ushort)NumericValue, NumericValue)); - Assert.IsTrue(Marshal_ByValue_Int32((int)NumericValue, NumericValue)); - Assert.IsTrue(Marshal_ByValue_UInt32((uint)NumericValue, NumericValue)); - Assert.IsTrue(Marshal_ByValue_Int64((long)NumericValue, NumericValue)); - Assert.IsTrue(Marshal_ByValue_UInt64((ulong)NumericValue, NumericValue)); - Assert.IsTrue(Marshal_ByValue_Single((float)NumericValue, NumericValue)); - Assert.IsTrue(Marshal_ByValue_Double((double)NumericValue, NumericValue)); - Assert.IsTrue(Marshal_ByValue_String(StringValue, StringValue)); - Assert.IsTrue(Marshal_ByValue_String(new BStrWrapper(null), null)); - Assert.IsTrue(Marshal_ByValue_Char(CharValue, CharValue)); - Assert.IsTrue(Marshal_ByValue_Boolean(true, true)); - Assert.IsTrue(Marshal_ByValue_DateTime(DateValue, DateValue)); - Assert.IsTrue(Marshal_ByValue_Decimal(DecimalValue, DecimalValue)); - Assert.IsTrue(Marshal_ByValue_Currency(new CurrencyWrapper(DecimalValue), DecimalValue)); - Assert.IsTrue(Marshal_ByValue_Null(DBNull.Value)); - Assert.IsTrue(Marshal_ByValue_Missing(System.Reflection.Missing.Value)); - Assert.IsTrue(Marshal_ByValue_Empty(null)); + Assert.True(Marshal_ByValue_Byte((byte)NumericValue, NumericValue)); + Assert.True(Marshal_ByValue_SByte((sbyte)NumericValue, (sbyte)NumericValue)); + Assert.True(Marshal_ByValue_Int16((short)NumericValue, NumericValue)); + Assert.True(Marshal_ByValue_UInt16((ushort)NumericValue, NumericValue)); + Assert.True(Marshal_ByValue_Int32((int)NumericValue, NumericValue)); + Assert.True(Marshal_ByValue_UInt32((uint)NumericValue, NumericValue)); + Assert.True(Marshal_ByValue_Int64((long)NumericValue, NumericValue)); + Assert.True(Marshal_ByValue_UInt64((ulong)NumericValue, NumericValue)); + Assert.True(Marshal_ByValue_Single((float)NumericValue, NumericValue)); + Assert.True(Marshal_ByValue_Double((double)NumericValue, NumericValue)); + Assert.True(Marshal_ByValue_String(StringValue, StringValue)); + Assert.True(Marshal_ByValue_String(new BStrWrapper(null), null)); + Assert.True(Marshal_ByValue_Char(CharValue, CharValue)); + Assert.True(Marshal_ByValue_Boolean(true, true)); + Assert.True(Marshal_ByValue_DateTime(DateValue, DateValue)); + Assert.True(Marshal_ByValue_Decimal(DecimalValue, DecimalValue)); + Assert.True(Marshal_ByValue_Currency(new CurrencyWrapper(DecimalValue), DecimalValue)); + Assert.True(Marshal_ByValue_Null(DBNull.Value)); + Assert.True(Marshal_ByValue_Missing(System.Reflection.Missing.Value)); + Assert.True(Marshal_ByValue_Empty(null)); if (hasComSupport) { - Assert.IsTrue(Marshal_ByValue_Object(new object())); - Assert.IsTrue(Marshal_ByValue_Object_IUnknown(new UnknownWrapper(new object()))); - Assert.IsTrue(Marshal_ByValue_Object(new GenerateIClassX())); - Assert.IsTrue(Marshal_ByValue_Object_IUnknown(new UnknownWrapper(new GenerateIClassX()))); + Assert.True(Marshal_ByValue_Object(new object())); + Assert.True(Marshal_ByValue_Object_IUnknown(new UnknownWrapper(new object()))); + Assert.True(Marshal_ByValue_Object(new GenerateIClassX())); + Assert.True(Marshal_ByValue_Object_IUnknown(new UnknownWrapper(new GenerateIClassX()))); } else { @@ -68,14 +68,12 @@ private unsafe static void TestByValue(bool hasComSupport) () => { Marshal_ByValue_Object(new object()); - }, - "Built-in COM has been disabled via a feature switch"); + }); Assert.Throws( () => { Marshal_ByValue_Object_IUnknown(new UnknownWrapper(new object())); - }, - "Built-in COM has been disabled via a feature switch"); + }); } Assert.Throws(() => Marshal_ByValue_Invalid(TimeSpan.Zero)); @@ -88,78 +86,78 @@ private unsafe static void TestByRef(bool hasComSupport) object obj; obj = (byte)NumericValue; - Assert.IsTrue(Marshal_ByRef_Byte(ref obj, NumericValue)); + Assert.True(Marshal_ByRef_Byte(ref obj, NumericValue)); obj = (sbyte)NumericValue; - Assert.IsTrue(Marshal_ByRef_SByte(ref obj, (sbyte)NumericValue)); + Assert.True(Marshal_ByRef_SByte(ref obj, (sbyte)NumericValue)); obj = (short)NumericValue; - Assert.IsTrue(Marshal_ByRef_Int16(ref obj, NumericValue)); + Assert.True(Marshal_ByRef_Int16(ref obj, NumericValue)); obj = (ushort)NumericValue; - Assert.IsTrue(Marshal_ByRef_UInt16(ref obj, NumericValue)); + Assert.True(Marshal_ByRef_UInt16(ref obj, NumericValue)); obj = (int)NumericValue; - Assert.IsTrue(Marshal_ByRef_Int32(ref obj, NumericValue)); + Assert.True(Marshal_ByRef_Int32(ref obj, NumericValue)); obj = (uint)NumericValue; - Assert.IsTrue(Marshal_ByRef_UInt32(ref obj, NumericValue)); + Assert.True(Marshal_ByRef_UInt32(ref obj, NumericValue)); obj = (long)NumericValue; - Assert.IsTrue(Marshal_ByRef_Int64(ref obj, NumericValue)); + Assert.True(Marshal_ByRef_Int64(ref obj, NumericValue)); obj = (ulong)NumericValue; - Assert.IsTrue(Marshal_ByRef_UInt64(ref obj, NumericValue)); + Assert.True(Marshal_ByRef_UInt64(ref obj, NumericValue)); obj = (float)NumericValue; - Assert.IsTrue(Marshal_ByRef_Single(ref obj, NumericValue)); + Assert.True(Marshal_ByRef_Single(ref obj, NumericValue)); obj = (double)NumericValue; - Assert.IsTrue(Marshal_ByRef_Double(ref obj, NumericValue)); + Assert.True(Marshal_ByRef_Double(ref obj, NumericValue)); obj = StringValue; - Assert.IsTrue(Marshal_ByRef_String(ref obj, StringValue)); + Assert.True(Marshal_ByRef_String(ref obj, StringValue)); obj = new BStrWrapper(null); - Assert.IsTrue(Marshal_ByRef_String(ref obj, null)); + Assert.True(Marshal_ByRef_String(ref obj, null)); obj = CharValue; - Assert.IsTrue(Marshal_ByRef_Char(ref obj, CharValue)); + Assert.True(Marshal_ByRef_Char(ref obj, CharValue)); obj = true; - Assert.IsTrue(Marshal_ByRef_Boolean(ref obj, true)); + Assert.True(Marshal_ByRef_Boolean(ref obj, true)); obj = DateValue; - Assert.IsTrue(Marshal_ByRef_DateTime(ref obj, DateValue)); + Assert.True(Marshal_ByRef_DateTime(ref obj, DateValue)); obj = DecimalValue; - Assert.IsTrue(Marshal_ByRef_Decimal(ref obj, DecimalValue)); + Assert.True(Marshal_ByRef_Decimal(ref obj, DecimalValue)); obj = new CurrencyWrapper(DecimalValue); - Assert.IsTrue(Marshal_ByRef_Currency(ref obj, DecimalValue)); + Assert.True(Marshal_ByRef_Currency(ref obj, DecimalValue)); obj = DBNull.Value; - Assert.IsTrue(Marshal_ByRef_Null(ref obj)); + Assert.True(Marshal_ByRef_Null(ref obj)); obj = System.Reflection.Missing.Value; - Assert.IsTrue(Marshal_ByRef_Missing(ref obj)); + Assert.True(Marshal_ByRef_Missing(ref obj)); obj = null; - Assert.IsTrue(Marshal_ByRef_Empty(ref obj)); + Assert.True(Marshal_ByRef_Empty(ref obj)); if (hasComSupport) { obj = new object(); - Assert.IsTrue(Marshal_ByRef_Object(ref obj)); + Assert.True(Marshal_ByRef_Object(ref obj)); obj = new UnknownWrapper(new object()); - Assert.IsTrue(Marshal_ByRef_Object_IUnknown(ref obj)); + Assert.True(Marshal_ByRef_Object_IUnknown(ref obj)); obj = new GenerateIClassX(); - Assert.IsTrue(Marshal_ByRef_Object(ref obj)); + Assert.True(Marshal_ByRef_Object(ref obj)); obj = new UnknownWrapper(new GenerateIClassX()); - Assert.IsTrue(Marshal_ByRef_Object_IUnknown(ref obj)); + Assert.True(Marshal_ByRef_Object_IUnknown(ref obj)); } else { @@ -168,28 +166,26 @@ private unsafe static void TestByRef(bool hasComSupport) { obj = new object(); Marshal_ByRef_Object(ref obj); - }, - "Built-in COM has been disabled via a feature switch"); + }); Assert.Throws( () => { obj = new UnknownWrapper(new object()); Marshal_ByRef_Object_IUnknown(ref obj); - }, - "Built-in COM has been disabled via a feature switch"); + }); } obj = DecimalValue; - Assert.IsTrue(Marshal_ChangeVariantType(ref obj, NumericValue)); - Assert.IsTrue(obj is int); - Assert.AreEqual(NumericValue, (int)obj); + Assert.True(Marshal_ChangeVariantType(ref obj, NumericValue)); + Assert.True(obj is int); + Assert.Equal(NumericValue, (int)obj); } private unsafe static void TestOut() { - Assert.IsTrue(Marshal_Out(out object obj, NumericValue)); - Assert.IsTrue(obj is int); - Assert.AreEqual(NumericValue, (int)obj); + Assert.True(Marshal_Out(out object obj, NumericValue)); + Assert.True(obj is int); + Assert.Equal(NumericValue, (int)obj); } private unsafe static void TestFieldByValue(bool hasComSupport) @@ -197,78 +193,78 @@ private unsafe static void TestFieldByValue(bool hasComSupport) ObjectWrapper wrapper = new ObjectWrapper(); wrapper.value = (byte)NumericValue; - Assert.IsTrue(Marshal_Struct_ByValue_Byte(wrapper, NumericValue)); + Assert.True(Marshal_Struct_ByValue_Byte(wrapper, NumericValue)); wrapper.value = (sbyte)NumericValue; - Assert.IsTrue(Marshal_Struct_ByValue_SByte(wrapper, (sbyte)NumericValue)); + Assert.True(Marshal_Struct_ByValue_SByte(wrapper, (sbyte)NumericValue)); wrapper.value = (short)NumericValue; - Assert.IsTrue(Marshal_Struct_ByValue_Int16(wrapper, NumericValue)); + Assert.True(Marshal_Struct_ByValue_Int16(wrapper, NumericValue)); wrapper.value = (ushort)NumericValue; - Assert.IsTrue(Marshal_Struct_ByValue_UInt16(wrapper, NumericValue)); + Assert.True(Marshal_Struct_ByValue_UInt16(wrapper, NumericValue)); wrapper.value = (int)NumericValue; - Assert.IsTrue(Marshal_Struct_ByValue_Int32(wrapper, NumericValue)); + Assert.True(Marshal_Struct_ByValue_Int32(wrapper, NumericValue)); wrapper.value = (uint)NumericValue; - Assert.IsTrue(Marshal_Struct_ByValue_UInt32(wrapper, NumericValue)); + Assert.True(Marshal_Struct_ByValue_UInt32(wrapper, NumericValue)); wrapper.value = (long)NumericValue; - Assert.IsTrue(Marshal_Struct_ByValue_Int64(wrapper, NumericValue)); + Assert.True(Marshal_Struct_ByValue_Int64(wrapper, NumericValue)); wrapper.value = (ulong)NumericValue; - Assert.IsTrue(Marshal_Struct_ByValue_UInt64(wrapper, NumericValue)); + Assert.True(Marshal_Struct_ByValue_UInt64(wrapper, NumericValue)); wrapper.value = (float)NumericValue; - Assert.IsTrue(Marshal_Struct_ByValue_Single(wrapper, NumericValue)); + Assert.True(Marshal_Struct_ByValue_Single(wrapper, NumericValue)); wrapper.value = (double)NumericValue; - Assert.IsTrue(Marshal_Struct_ByValue_Double(wrapper, NumericValue)); + Assert.True(Marshal_Struct_ByValue_Double(wrapper, NumericValue)); wrapper.value = StringValue; - Assert.IsTrue(Marshal_Struct_ByValue_String(wrapper, StringValue)); + Assert.True(Marshal_Struct_ByValue_String(wrapper, StringValue)); wrapper.value = new BStrWrapper(null); - Assert.IsTrue(Marshal_Struct_ByValue_String(wrapper, null)); + Assert.True(Marshal_Struct_ByValue_String(wrapper, null)); wrapper.value = CharValue; - Assert.IsTrue(Marshal_Struct_ByValue_Char(wrapper, CharValue)); + Assert.True(Marshal_Struct_ByValue_Char(wrapper, CharValue)); wrapper.value = true; - Assert.IsTrue(Marshal_Struct_ByValue_Boolean(wrapper, true)); + Assert.True(Marshal_Struct_ByValue_Boolean(wrapper, true)); wrapper.value = DateValue; - Assert.IsTrue(Marshal_Struct_ByValue_DateTime(wrapper, DateValue)); + Assert.True(Marshal_Struct_ByValue_DateTime(wrapper, DateValue)); wrapper.value = DecimalValue; - Assert.IsTrue(Marshal_Struct_ByValue_Decimal(wrapper, DecimalValue)); + Assert.True(Marshal_Struct_ByValue_Decimal(wrapper, DecimalValue)); wrapper.value = new CurrencyWrapper(DecimalValue); - Assert.IsTrue(Marshal_Struct_ByValue_Currency(wrapper, DecimalValue)); + Assert.True(Marshal_Struct_ByValue_Currency(wrapper, DecimalValue)); wrapper.value = DBNull.Value; - Assert.IsTrue(Marshal_Struct_ByValue_Null(wrapper)); + Assert.True(Marshal_Struct_ByValue_Null(wrapper)); wrapper.value = System.Reflection.Missing.Value; - Assert.IsTrue(Marshal_Struct_ByValue_Missing(wrapper)); + Assert.True(Marshal_Struct_ByValue_Missing(wrapper)); wrapper.value = null; - Assert.IsTrue(Marshal_Struct_ByValue_Empty(wrapper)); + Assert.True(Marshal_Struct_ByValue_Empty(wrapper)); if (hasComSupport) { wrapper.value = new object(); - Assert.IsTrue(Marshal_Struct_ByValue_Object(wrapper)); + Assert.True(Marshal_Struct_ByValue_Object(wrapper)); wrapper.value = new UnknownWrapper(new object()); - Assert.IsTrue(Marshal_Struct_ByValue_Object_IUnknown(wrapper)); + Assert.True(Marshal_Struct_ByValue_Object_IUnknown(wrapper)); wrapper.value = new GenerateIClassX(); - Assert.IsTrue(Marshal_Struct_ByValue_Object(wrapper)); + Assert.True(Marshal_Struct_ByValue_Object(wrapper)); wrapper.value = new UnknownWrapper(new GenerateIClassX()); - Assert.IsTrue(Marshal_Struct_ByValue_Object_IUnknown(wrapper)); + Assert.True(Marshal_Struct_ByValue_Object_IUnknown(wrapper)); } else { @@ -277,15 +273,13 @@ private unsafe static void TestFieldByValue(bool hasComSupport) { wrapper.value = new object(); Marshal_Struct_ByValue_Object(wrapper); - }, - "Built-in COM has been disabled via a feature switch"); + }); Assert.Throws( () => { wrapper.value = new UnknownWrapper(new object()); Marshal_Struct_ByValue_Object_IUnknown(wrapper); - }, - "Built-in COM has been disabled via a feature switch"); + }); } } @@ -294,78 +288,78 @@ private unsafe static void TestFieldByRef(bool hasComSupport) ObjectWrapper wrapper = new ObjectWrapper(); wrapper.value = (byte)NumericValue; - Assert.IsTrue(Marshal_Struct_ByRef_Byte(ref wrapper, NumericValue)); + Assert.True(Marshal_Struct_ByRef_Byte(ref wrapper, NumericValue)); wrapper.value = (sbyte)NumericValue; - Assert.IsTrue(Marshal_Struct_ByRef_SByte(ref wrapper, (sbyte)NumericValue)); + Assert.True(Marshal_Struct_ByRef_SByte(ref wrapper, (sbyte)NumericValue)); wrapper.value = (short)NumericValue; - Assert.IsTrue(Marshal_Struct_ByRef_Int16(ref wrapper, NumericValue)); + Assert.True(Marshal_Struct_ByRef_Int16(ref wrapper, NumericValue)); wrapper.value = (ushort)NumericValue; - Assert.IsTrue(Marshal_Struct_ByRef_UInt16(ref wrapper, NumericValue)); + Assert.True(Marshal_Struct_ByRef_UInt16(ref wrapper, NumericValue)); wrapper.value = (int)NumericValue; - Assert.IsTrue(Marshal_Struct_ByRef_Int32(ref wrapper, NumericValue)); + Assert.True(Marshal_Struct_ByRef_Int32(ref wrapper, NumericValue)); wrapper.value = (uint)NumericValue; - Assert.IsTrue(Marshal_Struct_ByRef_UInt32(ref wrapper, NumericValue)); + Assert.True(Marshal_Struct_ByRef_UInt32(ref wrapper, NumericValue)); wrapper.value = (long)NumericValue; - Assert.IsTrue(Marshal_Struct_ByRef_Int64(ref wrapper, NumericValue)); + Assert.True(Marshal_Struct_ByRef_Int64(ref wrapper, NumericValue)); wrapper.value = (ulong)NumericValue; - Assert.IsTrue(Marshal_Struct_ByRef_UInt64(ref wrapper, NumericValue)); + Assert.True(Marshal_Struct_ByRef_UInt64(ref wrapper, NumericValue)); wrapper.value = (float)NumericValue; - Assert.IsTrue(Marshal_Struct_ByRef_Single(ref wrapper, NumericValue)); + Assert.True(Marshal_Struct_ByRef_Single(ref wrapper, NumericValue)); wrapper.value = (double)NumericValue; - Assert.IsTrue(Marshal_Struct_ByRef_Double(ref wrapper, NumericValue)); + Assert.True(Marshal_Struct_ByRef_Double(ref wrapper, NumericValue)); wrapper.value = StringValue; - Assert.IsTrue(Marshal_Struct_ByRef_String(ref wrapper, StringValue)); + Assert.True(Marshal_Struct_ByRef_String(ref wrapper, StringValue)); wrapper.value = new BStrWrapper(null); - Assert.IsTrue(Marshal_Struct_ByRef_String(ref wrapper, null)); + Assert.True(Marshal_Struct_ByRef_String(ref wrapper, null)); wrapper.value = CharValue; - Assert.IsTrue(Marshal_Struct_ByRef_Char(ref wrapper, CharValue)); + Assert.True(Marshal_Struct_ByRef_Char(ref wrapper, CharValue)); wrapper.value = true; - Assert.IsTrue(Marshal_Struct_ByRef_Boolean(ref wrapper, true)); + Assert.True(Marshal_Struct_ByRef_Boolean(ref wrapper, true)); wrapper.value = DateValue; - Assert.IsTrue(Marshal_Struct_ByRef_DateTime(ref wrapper, DateValue)); + Assert.True(Marshal_Struct_ByRef_DateTime(ref wrapper, DateValue)); wrapper.value = DecimalValue; - Assert.IsTrue(Marshal_Struct_ByRef_Decimal(ref wrapper, DecimalValue)); + Assert.True(Marshal_Struct_ByRef_Decimal(ref wrapper, DecimalValue)); wrapper.value = new CurrencyWrapper(DecimalValue); - Assert.IsTrue(Marshal_Struct_ByRef_Currency(ref wrapper, DecimalValue)); + Assert.True(Marshal_Struct_ByRef_Currency(ref wrapper, DecimalValue)); wrapper.value = DBNull.Value; - Assert.IsTrue(Marshal_Struct_ByRef_Null(ref wrapper)); + Assert.True(Marshal_Struct_ByRef_Null(ref wrapper)); wrapper.value = System.Reflection.Missing.Value; - Assert.IsTrue(Marshal_Struct_ByRef_Missing(ref wrapper)); + Assert.True(Marshal_Struct_ByRef_Missing(ref wrapper)); wrapper.value = null; - Assert.IsTrue(Marshal_Struct_ByRef_Empty(ref wrapper)); + Assert.True(Marshal_Struct_ByRef_Empty(ref wrapper)); if (hasComSupport) { wrapper.value = new object(); - Assert.IsTrue(Marshal_Struct_ByRef_Object(ref wrapper)); + Assert.True(Marshal_Struct_ByRef_Object(ref wrapper)); wrapper.value = new UnknownWrapper(new object()); - Assert.IsTrue(Marshal_Struct_ByRef_Object_IUnknown(ref wrapper)); + Assert.True(Marshal_Struct_ByRef_Object_IUnknown(ref wrapper)); wrapper.value = new GenerateIClassX(); - Assert.IsTrue(Marshal_Struct_ByRef_Object(ref wrapper)); + Assert.True(Marshal_Struct_ByRef_Object(ref wrapper)); wrapper.value = new UnknownWrapper(new GenerateIClassX()); - Assert.IsTrue(Marshal_Struct_ByRef_Object_IUnknown(ref wrapper)); + Assert.True(Marshal_Struct_ByRef_Object_IUnknown(ref wrapper)); } else { @@ -374,15 +368,13 @@ private unsafe static void TestFieldByRef(bool hasComSupport) { wrapper.value = new object(); Marshal_Struct_ByRef_Object(ref wrapper); - }, - "Built-in COM has been disabled via a feature switch"); + }); Assert.Throws( () => { wrapper.value = new UnknownWrapper(new object()); Marshal_Struct_ByRef_Object_IUnknown(ref wrapper); - }, - "Built-in COM has been disabled via a feature switch"); + }); } } } diff --git a/src/tests/Interop/PInvoke/Vector2_3_4/Vector2_3_4.cs b/src/tests/Interop/PInvoke/Vector2_3_4/Vector2_3_4.cs index 3afc831b4523e3..2f79b9b20173eb 100644 --- a/src/tests/Interop/PInvoke/Vector2_3_4/Vector2_3_4.cs +++ b/src/tests/Interop/PInvoke/Vector2_3_4/Vector2_3_4.cs @@ -4,30 +4,15 @@ using System; using System.Numerics; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; public class Vector2_3_4Test { private const int StartingIntValue = 42; private const int NewIntValue = 18; - public static int Main() - { - try - { - RunVector2Tests(); - RunVector3Tests(); - RunVector4Tests(); - } - catch (System.Exception ex) - { - Console.WriteLine(ex); - return 101; - } - return 100; - } - - private static void RunVector2Tests() + [Fact] + public static void RunVector2Tests() { Console.WriteLine($"Running {nameof(RunVector2Tests)}... "); float X = StartingIntValue; @@ -43,33 +28,34 @@ private static void RunVector2Tests() Vector2 startingVector = new Vector2(X, Y); Vector2 newVector = new Vector2(XNew, YNew); - Assert.AreEqual(startingVector, Vector2_3_4TestNative.CreateVector2FromFloats(X, Y)); + Assert.Equal(startingVector, Vector2_3_4TestNative.CreateVector2FromFloats(X, Y)); - Assert.IsTrue(Vector2_3_4TestNative.Vector2EqualToFloats(startingVector, X, Y)); + Assert.True(Vector2_3_4TestNative.Vector2EqualToFloats(startingVector, X, Y)); Vector2 localVector = startingVector; - Assert.IsTrue(Vector2_3_4TestNative.ValidateAndChangeVector2(ref localVector, X, Y, XNew, YNew)); - Assert.AreEqual(newVector, localVector); + Assert.True(Vector2_3_4TestNative.ValidateAndChangeVector2(ref localVector, X, Y, XNew, YNew)); + Assert.Equal(newVector, localVector); Vector2_3_4TestNative.GetVector2ForFloats(X, Y, out var vec); - Assert.AreEqual(startingVector, vec); - - Assert.AreEqual(startingVector, Vector2_3_4TestNative.CreateWrappedVector2FromFloats(X, Y).vec); + Assert.Equal(startingVector, vec); + + Assert.Equal(startingVector, Vector2_3_4TestNative.CreateWrappedVector2FromFloats(X, Y).vec); - Assert.IsTrue(Vector2_3_4TestNative.WrappedVector2EqualToFloats(new Vector2_3_4TestNative.Vector2Wrapper { vec = startingVector }, X, Y)); + Assert.True(Vector2_3_4TestNative.WrappedVector2EqualToFloats(new Vector2_3_4TestNative.Vector2Wrapper { vec = startingVector }, X, Y)); var localVectorWrapper = new Vector2_3_4TestNative.Vector2Wrapper { vec = startingVector }; - Assert.IsTrue(Vector2_3_4TestNative.ValidateAndChangeWrappedVector2(ref localVectorWrapper, X, Y, XNew, YNew)); - Assert.AreEqual(newVector, localVectorWrapper.vec); + Assert.True(Vector2_3_4TestNative.ValidateAndChangeWrappedVector2(ref localVectorWrapper, X, Y, XNew, YNew)); + Assert.Equal(newVector, localVectorWrapper.vec); - Assert.AreEqual(newVector, Vector2_3_4TestNative.PassThroughVector2ToCallback(startingVector, vectorParam => + Assert.Equal(newVector, Vector2_3_4TestNative.PassThroughVector2ToCallback(startingVector, vectorParam => { - Assert.AreEqual(startingVector, vectorParam); + Assert.Equal(startingVector, vectorParam); return newVector; })); } - private static void RunVector3Tests() + [Fact] + public static void RunVector3Tests() { Console.WriteLine($"Running {nameof(RunVector3Tests)}... "); float X = StartingIntValue; @@ -85,33 +71,34 @@ private static void RunVector3Tests() 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.Equal(startingVector, Vector2_3_4TestNative.CreateVector3FromFloats(X, Y, Z)); - Assert.IsTrue(Vector2_3_4TestNative.Vector3EqualToFloats(startingVector, X, Y, Z)); + Assert.True(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); + Assert.True(Vector2_3_4TestNative.ValidateAndChangeVector3(ref localVector, X, Y, Z, XNew, YNew, ZNew)); + Assert.Equal(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.Equal(startingVector, vec); - Assert.IsTrue(Vector2_3_4TestNative.WrappedVector3EqualToFloats(new Vector2_3_4TestNative.Vector3Wrapper { vec = startingVector }, X, Y, Z)); + Assert.Equal(startingVector, Vector2_3_4TestNative.CreateWrappedVector3FromFloats(X, Y, Z).vec); + + Assert.True(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.True(Vector2_3_4TestNative.ValidateAndChangeWrappedVector3(ref localVectorWrapper, X, Y, Z, XNew, YNew, ZNew)); + Assert.Equal(newVector, localVectorWrapper.vec); - Assert.AreEqual(newVector, Vector2_3_4TestNative.PassThroughVector3ToCallback(startingVector, vectorParam => + Assert.Equal(newVector, Vector2_3_4TestNative.PassThroughVector3ToCallback(startingVector, vectorParam => { - Assert.AreEqual(startingVector, vectorParam); + Assert.Equal(startingVector, vectorParam); return newVector; })); } - private static void RunVector4Tests() + [Fact] + public static void RunVector4Tests() { Console.WriteLine($"Running {nameof(RunVector4Tests)}... "); float X = StartingIntValue; @@ -127,28 +114,28 @@ private static void RunVector4Tests() 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.Equal(startingVector, Vector2_3_4TestNative.CreateVector4FromFloats(X, Y, Z, W)); - Assert.IsTrue(Vector2_3_4TestNative.Vector4EqualToFloats(startingVector, X, Y, Z, W)); + Assert.True(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); + Assert.True(Vector2_3_4TestNative.ValidateAndChangeVector4(ref localVector, X, Y, Z, W, XNew, YNew, ZNew, WNew)); + Assert.Equal(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.Equal(startingVector, vec); + + Assert.Equal(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)); + Assert.True(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.True(Vector2_3_4TestNative.ValidateAndChangeWrappedVector4(ref localVectorWrapper, X, Y, Z, W, XNew, YNew, ZNew, WNew)); + Assert.Equal(newVector, localVectorWrapper.vec); - Assert.AreEqual(newVector, Vector2_3_4TestNative.PassThroughVector4ToCallback(startingVector, vectorParam => + Assert.Equal(newVector, Vector2_3_4TestNative.PassThroughVector4ToCallback(startingVector, vectorParam => { - Assert.AreEqual(startingVector, vectorParam); + Assert.Equal(startingVector, vectorParam); return newVector; })); } diff --git a/src/tests/Interop/PInvoke/Vector2_3_4/Vector2_3_4.csproj b/src/tests/Interop/PInvoke/Vector2_3_4/Vector2_3_4.csproj index 78c3de24d972d1..e868b25ab24053 100644 --- a/src/tests/Interop/PInvoke/Vector2_3_4/Vector2_3_4.csproj +++ b/src/tests/Interop/PInvoke/Vector2_3_4/Vector2_3_4.csproj @@ -1,7 +1,4 @@ - - Exe - diff --git a/src/tests/Interop/PrimitiveMarshalling/UIntPtr/PInvokeUIntPtrTest.cs b/src/tests/Interop/PrimitiveMarshalling/UIntPtr/PInvokeUIntPtrTest.cs index 06e18ade16b3a4..9fef58094911c3 100644 --- a/src/tests/Interop/PrimitiveMarshalling/UIntPtr/PInvokeUIntPtrTest.cs +++ b/src/tests/Interop/PrimitiveMarshalling/UIntPtr/PInvokeUIntPtrTest.cs @@ -5,7 +5,7 @@ using System; using System.Reflection; using System.Text; -using TestLibrary; +using Xunit; class Test { @@ -35,27 +35,27 @@ public static int Main(string[] args) UIntPtr uintPtrReturn = (UIntPtr)3000; UIntPtr uintPtr1 = uintPtrManaged; - Assert.AreEqual(uintPtrReturn, Marshal_In(uintPtr1), "The return value is wrong"); + Assert.Equal(uintPtrReturn, Marshal_In(uintPtr1)); UIntPtr uintPtr2 = uintPtrManaged; - Assert.AreEqual(uintPtrReturn, Marshal_InOut(uintPtr2), "The return value is wrong"); - Assert.AreEqual(uintPtrManaged, uintPtr2, "The parameter value is changed"); + Assert.Equal(uintPtrReturn, Marshal_InOut(uintPtr2)); + Assert.Equal(uintPtrManaged, uintPtr2); UIntPtr uintPtr3 = uintPtrManaged; - Assert.AreEqual(uintPtrReturn, Marshal_Out(uintPtr3), "The return value is wrong"); - Assert.AreEqual(uintPtrManaged, uintPtr3, "The parameter value is changed"); + Assert.Equal(uintPtrReturn, Marshal_Out(uintPtr3)); + Assert.Equal(uintPtrManaged, uintPtr3); UIntPtr uintPtr4 = uintPtrManaged; - Assert.AreEqual(uintPtrReturn, MarshalPointer_In(ref uintPtr4), "The return value is wrong"); - Assert.AreEqual(uintPtrManaged, uintPtr4, "The parameter value is changed"); + Assert.Equal(uintPtrReturn, MarshalPointer_In(ref uintPtr4)); + Assert.Equal(uintPtrManaged, uintPtr4); UIntPtr uintPtr5 = uintPtrManaged; - Assert.AreEqual(uintPtrReturn, MarshalPointer_InOut(ref uintPtr5), "The return value is wrong"); - Assert.AreEqual(uintPtrNative, uintPtr5, "The passed value is wrong"); + Assert.Equal(uintPtrReturn, MarshalPointer_InOut(ref uintPtr5)); + Assert.Equal(uintPtrNative, uintPtr5); UIntPtr uintPtr6 = uintPtrManaged; - Assert.AreEqual(uintPtrReturn, MarshalPointer_Out(out uintPtr6), "The return value is wrong"); - Assert.AreEqual(uintPtrNative, uintPtr6, "The passed value is wrong"); + Assert.Equal(uintPtrReturn, MarshalPointer_Out(out uintPtr6)); + Assert.Equal(uintPtrNative, uintPtr6); return 100; } diff --git a/src/tests/Interop/ReadMe.md b/src/tests/Interop/ReadMe.md index cb73505816ab3c..7b7917a55a2028 100644 --- a/src/tests/Interop/ReadMe.md +++ b/src/tests/Interop/ReadMe.md @@ -10,7 +10,7 @@ There should be no more than **1** project type per folder (i.e. a folder can co Ancillary source assets for all tests should be located in `Interop/common` and can be easily added to all managed tests via the `Interop.settings.targets` file or native tests via `Interop.cmake`. -A common pattern for testing is using the `Assert` utilities. This class is part of the `CoreCLRTestLibrary` which is included in all test projects by the `Interop.settings.targets` import. In order to use, add the following `using TestLibrary;` in the relevant test file. +A common pattern for testing is using xUnit's `Assert` utilities. These utilities can be referenced via `CoreCLRTestLibrary` which is included in all test projects by `Directory.Build.targets` in this directory. In order to use, add the following `using Xunit;` in the relevant test file. ### Managed diff --git a/src/tests/Interop/StringMarshalling/AnsiBSTR/AnsiBStrTest.cs b/src/tests/Interop/StringMarshalling/AnsiBSTR/AnsiBStrTest.cs index bc3e8da4ad9d81..83b4745ef15a7f 100644 --- a/src/tests/Interop/StringMarshalling/AnsiBSTR/AnsiBStrTest.cs +++ b/src/tests/Interop/StringMarshalling/AnsiBSTR/AnsiBStrTest.cs @@ -5,7 +5,7 @@ using System; using System.Reflection; using System.Text; -using TestLibrary; +using Xunit; class AnsiBStrTest { diff --git a/src/tests/Interop/StringMarshalling/AnsiBSTR/AnsiBStrTestNative.cpp b/src/tests/Interop/StringMarshalling/AnsiBSTR/AnsiBStrTestNative.cpp index 85e9173927965c..4414cbed14430b 100644 --- a/src/tests/Interop/StringMarshalling/AnsiBSTR/AnsiBStrTestNative.cpp +++ b/src/tests/Interop/StringMarshalling/AnsiBSTR/AnsiBStrTestNative.cpp @@ -7,6 +7,6 @@ using StringType = BSTR; using Tests = BStrMarshalingTests; -#define FUNCTION_NAME CoreClrBStrAlloc(__func__, ARRAYSIZE(__func__) - 1) +#define FUNCTION_NAME CoreClrBStrAlloc(__func__, STRING_LENGTH(__func__)) #include "../Native/StringTestEntrypoints.inl" diff --git a/src/tests/Interop/StringMarshalling/BSTR/BSTRTest.cs b/src/tests/Interop/StringMarshalling/BSTR/BSTRTest.cs index 6d626345306313..3888d641985999 100644 --- a/src/tests/Interop/StringMarshalling/BSTR/BSTRTest.cs +++ b/src/tests/Interop/StringMarshalling/BSTR/BSTRTest.cs @@ -5,7 +5,7 @@ using System; using System.Reflection; using System.Text; -using TestLibrary; +using Xunit; class BStrTest { diff --git a/src/tests/Interop/StringMarshalling/Common/CommonStringTests.cs b/src/tests/Interop/StringMarshalling/Common/CommonStringTests.cs index f44f353b0cf4da..69939dd912da09 100644 --- a/src/tests/Interop/StringMarshalling/Common/CommonStringTests.cs +++ b/src/tests/Interop/StringMarshalling/Common/CommonStringTests.cs @@ -5,7 +5,7 @@ using System; using System.Reflection; using System.Text; -using TestLibrary; +using Xunit; using static StringMarshalingTestNative; @@ -28,44 +28,44 @@ public static void RunTests(bool runStringBuilderTests = true, bool runStructTes private static void RunStringTests() { - Assert.IsTrue(MatchFunctionName(nameof(MatchFunctionName))); + Assert.True(MatchFunctionName(nameof(MatchFunctionName))); { string funcNameLocal = nameof(MatchFunctionNameByRef); - Assert.IsTrue(MatchFunctionNameByRef(ref funcNameLocal)); + Assert.True(MatchFunctionNameByRef(ref funcNameLocal)); } { string reversed = InitialString; ReverseInplaceByref(ref reversed); - Assert.AreEqual(Helpers.Reverse(InitialString), reversed); + Assert.Equal(Helpers.Reverse(InitialString), reversed); } { Reverse(InitialString, out string reversed); - Assert.AreEqual(Helpers.Reverse(InitialString), reversed); + Assert.Equal(Helpers.Reverse(InitialString), reversed); } - Assert.AreEqual(Helpers.Reverse(InitialString), ReverseAndReturn(InitialString)); + Assert.Equal(Helpers.Reverse(InitialString), ReverseAndReturn(InitialString)); - Assert.IsTrue(VerifyReversed(InitialString, (orig, rev) => rev == Helpers.Reverse(orig))); + Assert.True(VerifyReversed(InitialString, (orig, rev) => rev == Helpers.Reverse(orig))); - Assert.IsTrue(ReverseInCallback(InitialString, (string str, out string rev) => rev = Helpers.Reverse(InitialString))); + Assert.True(ReverseInCallback(InitialString, (string str, out string rev) => rev = Helpers.Reverse(InitialString))); - Assert.IsTrue(ReverseInCallbackReturned(InitialString, str => Helpers.Reverse(str))); + Assert.True(ReverseInCallbackReturned(InitialString, str => Helpers.Reverse(str))); } private static void RunStringBuilderTests() { var builder = new StringBuilder(InitialString); ReverseInplace(builder); - Assert.AreEqual(Helpers.Reverse(InitialString), builder.ToString()); + Assert.Equal(Helpers.Reverse(InitialString), builder.ToString()); builder = new StringBuilder(InitialString); ReverseInplaceByref(ref builder); - Assert.AreEqual(Helpers.Reverse(InitialString), builder.ToString()); + Assert.Equal(Helpers.Reverse(InitialString), builder.ToString()); builder = new StringBuilder(InitialString); - Assert.IsTrue(ReverseInplaceInCallback(builder, b => + Assert.True(ReverseInplaceInCallback(builder, b => { string reversed = Helpers.Reverse(b.ToString()); b.Clear(); @@ -75,7 +75,7 @@ private static void RunStringBuilderTests() private static void RunStructTests() { - Assert.IsTrue(MatchFunctionNameInStruct(new StringInStruct { str = nameof(MatchFunctionNameInStruct)})); + Assert.True(MatchFunctionNameInStruct(new StringInStruct { str = nameof(MatchFunctionNameInStruct)})); var str = new StringInStruct { @@ -84,6 +84,6 @@ private static void RunStructTests() ReverseInplaceByrefInStruct(ref str); - Assert.AreEqual(Helpers.Reverse(InitialString), str.str); + Assert.Equal(Helpers.Reverse(InitialString), str.str); } } diff --git a/src/tests/Interop/StringMarshalling/LPSTR/LPSTRTest.cs b/src/tests/Interop/StringMarshalling/LPSTR/LPSTRTest.cs index c3e4678e636b98..75d78b1b460dd9 100644 --- a/src/tests/Interop/StringMarshalling/LPSTR/LPSTRTest.cs +++ b/src/tests/Interop/StringMarshalling/LPSTR/LPSTRTest.cs @@ -5,7 +5,7 @@ using System; using System.Reflection; using System.Text; -using TestLibrary; +using Xunit; class LPStrTest { diff --git a/src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs b/src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs index 54054435fed23c..08dec90247fc80 100644 --- a/src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs +++ b/src/tests/Interop/StringMarshalling/LPTSTR/LPTSTRTest.cs @@ -5,7 +5,7 @@ using System; using System.Reflection; using System.Text; -using TestLibrary; +using Xunit; using static LPTStrTestNative; @@ -35,13 +35,13 @@ private static void RunStringBuilderTests() { int length = 10; StringBuilder nullTerminatorBuilder = new StringBuilder(length); - Assert.IsTrue(Verify_NullTerminators_PastEnd(nullTerminatorBuilder, length)); - Assert.IsTrue(Verify_NullTerminators_PastEnd_Out(nullTerminatorBuilder, length)); + Assert.True(Verify_NullTerminators_PastEnd(nullTerminatorBuilder, length)); + Assert.True(Verify_NullTerminators_PastEnd_Out(nullTerminatorBuilder, length)); } private static void RunByValTStrTests() { - Assert.IsTrue(MatchFuncNameAnsi(new ByValStringInStructAnsi { str = nameof(MatchFuncNameAnsi)})); + Assert.True(MatchFuncNameAnsi(new ByValStringInStructAnsi { str = nameof(MatchFuncNameAnsi)})); var ansiStr = new ByValStringInStructAnsi { @@ -50,9 +50,9 @@ private static void RunByValTStrTests() ReverseByValStringAnsi(ref ansiStr); - Assert.AreEqual(Helpers.Reverse(InitialString), ansiStr.str); + Assert.Equal(Helpers.Reverse(InitialString), ansiStr.str); - Assert.IsTrue(MatchFuncNameUni(new ByValStringInStructUnicode { str = nameof(MatchFuncNameUni)})); + Assert.True(MatchFuncNameUni(new ByValStringInStructUnicode { str = nameof(MatchFuncNameUni)})); var uniStr = new ByValStringInStructUnicode { @@ -60,21 +60,21 @@ private static void RunByValTStrTests() }; ReverseByValStringUni(ref uniStr); - Assert.AreEqual(Helpers.Reverse(InitialString), uniStr.str); + Assert.Equal(Helpers.Reverse(InitialString), uniStr.str); ReverseCopyByValStringAnsi(new ByValStringInStructAnsi { str = LongString }, out ByValStringInStructSplitAnsi ansiStrSplit); - Assert.AreEqual(Helpers.Reverse(LongString[^10..]), ansiStrSplit.str1); - Assert.AreEqual(Helpers.Reverse(LongString[..^10]), ansiStrSplit.str2); + Assert.Equal(Helpers.Reverse(LongString[^10..]), ansiStrSplit.str1); + Assert.Equal(Helpers.Reverse(LongString[..^10]), ansiStrSplit.str2); ReverseCopyByValStringUni(new ByValStringInStructUnicode { str = LongString }, out ByValStringInStructSplitUnicode uniStrSplit); - Assert.AreEqual(Helpers.Reverse(LongString[^10..]), uniStrSplit.str1); - Assert.AreEqual(Helpers.Reverse(LongString[..^10]), uniStrSplit.str2); + Assert.Equal(Helpers.Reverse(LongString[^10..]), uniStrSplit.str1); + Assert.Equal(Helpers.Reverse(LongString[..^10]), uniStrSplit.str2); ReverseCopyByValStringUni(new ByValStringInStructUnicode { str = LongUnicodeString }, out ByValStringInStructSplitUnicode uniStrSplit2); - Assert.AreEqual(Helpers.Reverse(LongUnicodeString[^10..]), uniStrSplit2.str1); - Assert.AreEqual(Helpers.Reverse(LongUnicodeString[..^10]), uniStrSplit2.str2); + Assert.Equal(Helpers.Reverse(LongUnicodeString[^10..]), uniStrSplit2.str1); + Assert.Equal(Helpers.Reverse(LongUnicodeString[..^10]), uniStrSplit2.str2); } } diff --git a/src/tests/Interop/StringMarshalling/VBByRefStr/VBByRefStrTest.cs b/src/tests/Interop/StringMarshalling/VBByRefStr/VBByRefStrTest.cs index 1ae0b76b78b802..54c7e1b57162b4 100644 --- a/src/tests/Interop/StringMarshalling/VBByRefStr/VBByRefStrTest.cs +++ b/src/tests/Interop/StringMarshalling/VBByRefStr/VBByRefStrTest.cs @@ -5,7 +5,7 @@ using System; using System.Reflection; using System.Text; -using TestLibrary; +using Xunit; #pragma warning disable CS0612, CS0618 @@ -21,12 +21,12 @@ public static int Main(string[] args) string newValue = "zyxwvut\0"; actual = expected; - Assert.IsTrue(VBByRefStrNative.Marshal_Ansi(expected, ref actual, newValue)); - Assert.AreEqual(newValue, actual); + Assert.True(VBByRefStrNative.Marshal_Ansi(expected, ref actual, newValue)); + Assert.Equal(newValue, actual); actual = expected; - Assert.IsTrue(VBByRefStrNative.Marshal_Unicode(expected, ref actual, newValue)); - Assert.AreEqual(newValue, actual); + Assert.True(VBByRefStrNative.Marshal_Unicode(expected, ref actual, newValue)); + Assert.Equal(newValue, actual); StringBuilder builder = new StringBuilder(); diff --git a/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalExpStruct/DelegatePInvoke/DelegatePInvokeTest.cs b/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalExpStruct/DelegatePInvoke/DelegatePInvokeTest.cs index 8338a5412ab4b6..04111777790ac5 100644 --- a/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalExpStruct/DelegatePInvoke/DelegatePInvokeTest.cs +++ b/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalExpStruct/DelegatePInvoke/DelegatePInvokeTest.cs @@ -5,7 +5,7 @@ using System.Text; using System.Security; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; public class Test_DelegatePInvokeTest { @@ -34,56 +34,56 @@ enum StructID [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateCdeclByRef_INNER2 Get_MarshalStructAsParam_AsExpByRefINNER2_Cdecl_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool DelegateCdeclByRef_InnerExplicit([In, Out]ref InnerExplicit ie); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateCdeclByRef_InnerExplicit Get_MarshalStructAsParam_AsExpByRefInnerExplicit_Cdecl_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool DelegateCdeclByRef_InnerArrayExplicit([In, Out]ref InnerArrayExplicit iae); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateCdeclByRef_InnerArrayExplicit Get_MarshalStructAsParam_AsExpByRefInnerArrayExplicit_Cdecl_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool DelegateCdeclByRef_OUTER3([In, Out]ref OUTER3 outer); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateCdeclByRef_OUTER3 Get_MarshalStructAsParam_AsExpByRefOUTER3_Cdecl_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool DelegateCdeclByRef_U([In, Out]ref U u); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateCdeclByRef_U Get_MarshalStructAsParam_AsExpByRefU_Cdecl_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool DelegateCdeclByRef_ByteStructPack2Explicit([In, Out]ref ByteStructPack2Explicit bspe); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateCdeclByRef_ByteStructPack2Explicit Get_MarshalStructAsParam_AsExpByRefByteStructPack2Explicit_Cdecl_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool DelegateCdeclByRef_ShortStructPack4Explicit([In, Out]ref ShortStructPack4Explicit bspe); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateCdeclByRef_ShortStructPack4Explicit Get_MarshalStructAsParam_AsExpByRefShortStructPack4Explicit_Cdecl_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool DelegateCdeclByRef_IntStructPack8Explicit([In, Out]ref IntStructPack8Explicit bspe); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateCdeclByRef_IntStructPack8Explicit Get_MarshalStructAsParam_AsExpByRefIntStructPack8Explicit_Cdecl_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool DelegateCdeclByRef_LongStructPack16Explicit([In, Out]ref LongStructPack16Explicit bspe); @@ -101,8 +101,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructID struc INNER2 changeINNER2 = Helper.NewINNER2(77, 77.0F, "changed string"); DelegateCdeclByRef_INNER2 caller_INNER2 = Get_MarshalStructAsParam_AsExpByRefINNER2_Cdecl_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefINNER2_Cdecl_FuncPtr..."); - Assert.IsTrue(caller_INNER2(ref sourceINNER2)); - Assert.IsTrue(Helper.ValidateINNER2(sourceINNER2, changeINNER2, "Get_MarshalStructAsParam_AsExpByRefINNER2_Cdecl_FuncPtr")); + Assert.True(caller_INNER2(ref sourceINNER2)); + Assert.True(Helper.ValidateINNER2(sourceINNER2, changeINNER2, "Get_MarshalStructAsParam_AsExpByRefINNER2_Cdecl_FuncPtr")); break; case StructID.InnerExplicitId: @@ -114,8 +114,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructID struc changeInnerExplicit.f3 = "changed string"; DelegateCdeclByRef_InnerExplicit caller_InnerExplicit = Get_MarshalStructAsParam_AsExpByRefInnerExplicit_Cdecl_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefInnerExplicit_Cdecl_FuncPtr..."); - Assert.IsTrue(caller_InnerExplicit(ref sourceInnerExplicit)); - Assert.IsTrue(Helper.ValidateInnerExplicit(sourceInnerExplicit, changeInnerExplicit, "Get_MarshalStructAsParam_AsExpByRefInnerExplicit_Cdecl_FuncPtr")); + Assert.True(caller_InnerExplicit(ref sourceInnerExplicit)); + Assert.True(Helper.ValidateInnerExplicit(sourceInnerExplicit, changeInnerExplicit, "Get_MarshalStructAsParam_AsExpByRefInnerExplicit_Cdecl_FuncPtr")); break; case StructID.InnerArrayExplicitId: @@ -123,8 +123,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructID struc InnerArrayExplicit changeInnerArrayExplicit = Helper.NewInnerArrayExplicit(77, 77.0F, "change string1", "change string2"); DelegateCdeclByRef_InnerArrayExplicit caller_InnerArrayExplicit = Get_MarshalStructAsParam_AsExpByRefInnerArrayExplicit_Cdecl_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefInnerArrayExplicit_Cdecl_FuncPtr..."); - Assert.IsTrue(caller_InnerArrayExplicit(ref sourceInnerArrayExplicit)); - Assert.IsTrue(Helper.ValidateInnerArrayExplicit(sourceInnerArrayExplicit, changeInnerArrayExplicit, "Get_MarshalStructAsParam_AsExpByRefInnerArrayExplicit_Cdecl_FuncPtr")); + Assert.True(caller_InnerArrayExplicit(ref sourceInnerArrayExplicit)); + Assert.True(Helper.ValidateInnerArrayExplicit(sourceInnerArrayExplicit, changeInnerArrayExplicit, "Get_MarshalStructAsParam_AsExpByRefInnerArrayExplicit_Cdecl_FuncPtr")); break; case StructID.OUTER3Id: @@ -132,19 +132,19 @@ private static void TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructID struc OUTER3 changeOUTER3 = Helper.NewOUTER3(77, 77.0F, "changed string", "changed string"); DelegateCdeclByRef_OUTER3 caller_OUTER3 = Get_MarshalStructAsParam_AsExpByRefOUTER3_Cdecl_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefOUTER3_Cdecl_FuncPtr..."); - Assert.IsTrue(caller_OUTER3(ref sourceOUTER3)); - Assert.IsTrue(Helper.ValidateOUTER3(sourceOUTER3, changeOUTER3, "Get_MarshalStructAsParam_AsExpByRefOUTER3_Cdecl_FuncPtr")); + Assert.True(caller_OUTER3(ref sourceOUTER3)); + Assert.True(Helper.ValidateOUTER3(sourceOUTER3, changeOUTER3, "Get_MarshalStructAsParam_AsExpByRefOUTER3_Cdecl_FuncPtr")); break; case StructID.UId: - U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, + U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2); - U changeU = Helper.NewU(Int32.MaxValue, UInt32.MinValue, new IntPtr(-64), new UIntPtr(64), short.MaxValue, ushort.MinValue, + U changeU = Helper.NewU(Int32.MaxValue, UInt32.MinValue, new IntPtr(-64), new UIntPtr(64), short.MaxValue, ushort.MinValue, byte.MaxValue, sbyte.MinValue, long.MaxValue, ulong.MinValue, 64.0F, 6.4); DelegateCdeclByRef_U caller_U = Get_MarshalStructAsParam_AsExpByRefU_Cdecl_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefU_Cdecl_FuncPtr..."); - Assert.IsTrue(caller_U(ref sourceU)); - Assert.IsTrue(Helper.ValidateU(sourceU, changeU, "Get_MarshalStructAsParam_AsExpByRefU_Cdecl_FuncPtr")); + Assert.True(caller_U(ref sourceU)); + Assert.True(Helper.ValidateU(sourceU, changeU, "Get_MarshalStructAsParam_AsExpByRefU_Cdecl_FuncPtr")); break; case StructID.ByteStructPack2ExplicitId: @@ -152,8 +152,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructID struc ByteStructPack2Explicit change_bspe = Helper.NewByteStructPack2Explicit(64, 64); DelegateCdeclByRef_ByteStructPack2Explicit caller_ByteStructPack2Explicit = Get_MarshalStructAsParam_AsExpByRefByteStructPack2Explicit_Cdecl_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefByteStructPack2Explicit_Cdecl_FuncPtr..."); - Assert.IsTrue(caller_ByteStructPack2Explicit(ref source_bspe)); - Assert.IsTrue(Helper.ValidateByteStructPack2Explicit(source_bspe, change_bspe, "Get_MarshalStructAsParam_AsExpByRefByteStructPack2Explicit_Cdecl_FuncPtr")); + Assert.True(caller_ByteStructPack2Explicit(ref source_bspe)); + Assert.True(Helper.ValidateByteStructPack2Explicit(source_bspe, change_bspe, "Get_MarshalStructAsParam_AsExpByRefByteStructPack2Explicit_Cdecl_FuncPtr")); break; case StructID.ShortStructPack4ExplicitId: @@ -161,8 +161,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructID struc ShortStructPack4Explicit change_sspe = Helper.NewShortStructPack4Explicit(64, 64); DelegateCdeclByRef_ShortStructPack4Explicit caller_ShortStructPack4Explicit = Get_MarshalStructAsParam_AsExpByRefShortStructPack4Explicit_Cdecl_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefShortStructPack4Explicit_Cdecl_FuncPtr..."); - Assert.IsTrue(caller_ShortStructPack4Explicit(ref source_sspe)); - Assert.IsTrue(Helper.ValidateShortStructPack4Explicit(source_sspe, change_sspe, "Get_MarshalStructAsParam_AsExpByRefShortStructPack4Explicit_Cdecl_FuncPtr")); + Assert.True(caller_ShortStructPack4Explicit(ref source_sspe)); + Assert.True(Helper.ValidateShortStructPack4Explicit(source_sspe, change_sspe, "Get_MarshalStructAsParam_AsExpByRefShortStructPack4Explicit_Cdecl_FuncPtr")); break; case StructID.IntStructPack8ExplicitId: @@ -170,8 +170,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructID struc IntStructPack8Explicit change_ispe = Helper.NewIntStructPack8Explicit(64, 64); DelegateCdeclByRef_IntStructPack8Explicit caller_IntStructPack8Explicit = Get_MarshalStructAsParam_AsExpByRefIntStructPack8Explicit_Cdecl_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefIntStructPack8Explicit_Cdecl_FuncPtr..."); - Assert.IsTrue(caller_IntStructPack8Explicit(ref source_ispe)); - Assert.IsTrue(Helper.ValidateIntStructPack8Explicit(source_ispe, change_ispe, "Get_MarshalStructAsParam_AsExpByRefIntStructPack8Explicit_Cdecl_FuncPtr")); + Assert.True(caller_IntStructPack8Explicit(ref source_ispe)); + Assert.True(Helper.ValidateIntStructPack8Explicit(source_ispe, change_ispe, "Get_MarshalStructAsParam_AsExpByRefIntStructPack8Explicit_Cdecl_FuncPtr")); break; case StructID.LongStructPack16ExplicitId: @@ -179,12 +179,12 @@ private static void TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructID struc LongStructPack16Explicit change_lspe = Helper.NewLongStructPack16Explicit(64, 64); DelegateCdeclByRef_LongStructPack16Explicit caller_LongStructPack16Explicit = Get_MarshalStructAsParam_AsExpByRefLongStructPack16Explicit_Cdecl_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefLongStructPack16Explicit_Cdecl_FuncPtr..."); - Assert.IsTrue(caller_LongStructPack16Explicit(ref source_lspe)); - Assert.IsTrue(Helper.ValidateLongStructPack16Explicit(source_lspe, change_lspe, "Get_MarshalStructAsParam_AsExpByRefLongStructPack16Explicit_Cdecl_FuncPtr")); + Assert.True(caller_LongStructPack16Explicit(ref source_lspe)); + Assert.True(Helper.ValidateLongStructPack16Explicit(source_lspe, change_lspe, "Get_MarshalStructAsParam_AsExpByRefLongStructPack16Explicit_Cdecl_FuncPtr")); break; default: - Assert.Fail("TestMethod_DelegatePInvoke_MarshalByRef_Cdecl:The structid (Managed Side) is wrong"); + Assert.True(false, "TestMethod_DelegatePInvoke_MarshalByRef_Cdecl:The structid (Managed Side) is wrong"); break; } } @@ -199,56 +199,56 @@ private static void TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructID struc [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateStdcallByRef_INNER2 Get_MarshalStructAsParam_AsExpByRefINNER2_Stdcall_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool DelegateStdcallByRef_InnerExplicit([In, Out]ref InnerExplicit ie); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateStdcallByRef_InnerExplicit Get_MarshalStructAsParam_AsExpByRefInnerExplicit_Stdcall_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool DelegateStdcallByRef_InnerArrayExplicit([In, Out]ref InnerArrayExplicit iae); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateStdcallByRef_InnerArrayExplicit Get_MarshalStructAsParam_AsExpByRefInnerArrayExplicit_Stdcall_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool DelegateStdcallByRef_OUTER3([In, Out]ref OUTER3 outer); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateStdcallByRef_OUTER3 Get_MarshalStructAsParam_AsExpByRefOUTER3_Stdcall_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool DelegateStdcallByRef_U([In, Out]ref U u); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateStdcallByRef_U Get_MarshalStructAsParam_AsExpByRefU_Stdcall_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool DelegateStdcallByRef_ByteStructPack2Explicit([In, Out]ref ByteStructPack2Explicit bspe); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateStdcallByRef_ByteStructPack2Explicit Get_MarshalStructAsParam_AsExpByRefByteStructPack2Explicit_Stdcall_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool DelegateStdcallByRef_ShortStructPack4Explicit([In, Out]ref ShortStructPack4Explicit bspe); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateStdcallByRef_ShortStructPack4Explicit Get_MarshalStructAsParam_AsExpByRefShortStructPack4Explicit_Stdcall_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool DelegateStdcallByRef_IntStructPack8Explicit([In, Out]ref IntStructPack8Explicit bspe); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateStdcallByRef_IntStructPack8Explicit Get_MarshalStructAsParam_AsExpByRefIntStructPack8Explicit_Stdcall_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool DelegateStdcallByRef_LongStructPack16Explicit([In, Out]ref LongStructPack16Explicit bspe); @@ -266,8 +266,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByRef_Stdcall(StructID str INNER2 changeINNER2 = Helper.NewINNER2(77, 77.0F, "changed string"); DelegateStdcallByRef_INNER2 caller_INNER2 = Get_MarshalStructAsParam_AsExpByRefINNER2_Stdcall_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefINNER2_Stdcall_FuncPtr..."); - Assert.IsTrue(caller_INNER2(ref sourceINNER2)); - Assert.IsTrue(Helper.ValidateINNER2(sourceINNER2, changeINNER2, "Get_MarshalStructAsParam_AsExpByRefINNER2_Stdcall_FuncPtr")); + Assert.True(caller_INNER2(ref sourceINNER2)); + Assert.True(Helper.ValidateINNER2(sourceINNER2, changeINNER2, "Get_MarshalStructAsParam_AsExpByRefINNER2_Stdcall_FuncPtr")); break; case StructID.InnerExplicitId: @@ -279,8 +279,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByRef_Stdcall(StructID str changeInnerExplicit.f3 = "changed string"; DelegateStdcallByRef_InnerExplicit caller_InnerExplicit = Get_MarshalStructAsParam_AsExpByRefInnerExplicit_Stdcall_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefInnerExplicit_Stdcall_FuncPtr..."); - Assert.IsTrue(caller_InnerExplicit(ref sourceInnerExplicit)); - Assert.IsTrue(Helper.ValidateInnerExplicit(sourceInnerExplicit, changeInnerExplicit, "Get_MarshalStructAsParam_AsExpByRefInnerExplicit_Stdcall_FuncPtr")); + Assert.True(caller_InnerExplicit(ref sourceInnerExplicit)); + Assert.True(Helper.ValidateInnerExplicit(sourceInnerExplicit, changeInnerExplicit, "Get_MarshalStructAsParam_AsExpByRefInnerExplicit_Stdcall_FuncPtr")); break; case StructID.InnerArrayExplicitId: @@ -288,8 +288,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByRef_Stdcall(StructID str InnerArrayExplicit changeInnerArrayExplicit = Helper.NewInnerArrayExplicit(77, 77.0F, "change string1", "change string2"); DelegateStdcallByRef_InnerArrayExplicit caller_InnerArrayExplicit = Get_MarshalStructAsParam_AsExpByRefInnerArrayExplicit_Stdcall_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefInnerArrayExplicit_Stdcall_FuncPtr..."); - Assert.IsTrue(caller_InnerArrayExplicit(ref sourceInnerArrayExplicit)); - Assert.IsTrue(Helper.ValidateInnerArrayExplicit(sourceInnerArrayExplicit, changeInnerArrayExplicit, "Get_MarshalStructAsParam_AsExpByRefInnerArrayExplicit_Stdcall_FuncPtr")); + Assert.True(caller_InnerArrayExplicit(ref sourceInnerArrayExplicit)); + Assert.True(Helper.ValidateInnerArrayExplicit(sourceInnerArrayExplicit, changeInnerArrayExplicit, "Get_MarshalStructAsParam_AsExpByRefInnerArrayExplicit_Stdcall_FuncPtr")); break; case StructID.OUTER3Id: @@ -297,19 +297,19 @@ private static void TestMethod_DelegatePInvoke_MarshalByRef_Stdcall(StructID str OUTER3 changeOUTER3 = Helper.NewOUTER3(77, 77.0F, "changed string", "changed string"); DelegateStdcallByRef_OUTER3 caller_OUTER3 = Get_MarshalStructAsParam_AsExpByRefOUTER3_Stdcall_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefOUTER3_Stdcall_FuncPtr..."); - Assert.IsTrue(caller_OUTER3(ref sourceOUTER3)); - Assert.IsTrue(Helper.ValidateOUTER3(sourceOUTER3, changeOUTER3, "Get_MarshalStructAsParam_AsExpByRefOUTER3_Stdcall_FuncPtr")); + Assert.True(caller_OUTER3(ref sourceOUTER3)); + Assert.True(Helper.ValidateOUTER3(sourceOUTER3, changeOUTER3, "Get_MarshalStructAsParam_AsExpByRefOUTER3_Stdcall_FuncPtr")); break; case StructID.UId: - U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, + U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2); - U changeU = Helper.NewU(Int32.MaxValue, UInt32.MinValue, new IntPtr(-64), new UIntPtr(64), short.MaxValue, ushort.MinValue, + U changeU = Helper.NewU(Int32.MaxValue, UInt32.MinValue, new IntPtr(-64), new UIntPtr(64), short.MaxValue, ushort.MinValue, byte.MaxValue, sbyte.MinValue, long.MaxValue, ulong.MinValue, 64.0F, 6.4); DelegateStdcallByRef_U caller_U = Get_MarshalStructAsParam_AsExpByRefU_Stdcall_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefU_Stdcall_FuncPtr..."); - Assert.IsTrue(caller_U(ref sourceU)); - Assert.IsTrue(Helper.ValidateU(sourceU, changeU, "Get_MarshalStructAsParam_AsExpByRefU_Stdcall_FuncPtr")); + Assert.True(caller_U(ref sourceU)); + Assert.True(Helper.ValidateU(sourceU, changeU, "Get_MarshalStructAsParam_AsExpByRefU_Stdcall_FuncPtr")); break; case StructID.ByteStructPack2ExplicitId: @@ -317,8 +317,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByRef_Stdcall(StructID str ByteStructPack2Explicit change_bspe = Helper.NewByteStructPack2Explicit(64, 64); DelegateStdcallByRef_ByteStructPack2Explicit caller_ByteStructPack2Explicit = Get_MarshalStructAsParam_AsExpByRefByteStructPack2Explicit_Stdcall_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefByteStructPack2Explicit_Stdcall_FuncPtr..."); - Assert.IsTrue(caller_ByteStructPack2Explicit(ref source_bspe)); - Assert.IsTrue(Helper.ValidateByteStructPack2Explicit(source_bspe, change_bspe, "Get_MarshalStructAsParam_AsExpByRefByteStructPack2Explicit_Stdcall_FuncPtr")); + Assert.True(caller_ByteStructPack2Explicit(ref source_bspe)); + Assert.True(Helper.ValidateByteStructPack2Explicit(source_bspe, change_bspe, "Get_MarshalStructAsParam_AsExpByRefByteStructPack2Explicit_Stdcall_FuncPtr")); break; case StructID.ShortStructPack4ExplicitId: @@ -326,8 +326,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByRef_Stdcall(StructID str ShortStructPack4Explicit change_sspe = Helper.NewShortStructPack4Explicit(64, 64); DelegateStdcallByRef_ShortStructPack4Explicit caller_ShortStructPack4Explicit = Get_MarshalStructAsParam_AsExpByRefShortStructPack4Explicit_Stdcall_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefShortStructPack4Explicit_Stdcall_FuncPtr..."); - Assert.IsTrue(caller_ShortStructPack4Explicit(ref source_sspe)); - Assert.IsTrue(Helper.ValidateShortStructPack4Explicit(source_sspe, change_sspe, "Get_MarshalStructAsParam_AsExpByRefShortStructPack4Explicit_Stdcall_FuncPtr")); + Assert.True(caller_ShortStructPack4Explicit(ref source_sspe)); + Assert.True(Helper.ValidateShortStructPack4Explicit(source_sspe, change_sspe, "Get_MarshalStructAsParam_AsExpByRefShortStructPack4Explicit_Stdcall_FuncPtr")); break; case StructID.IntStructPack8ExplicitId: @@ -335,8 +335,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByRef_Stdcall(StructID str IntStructPack8Explicit change_ispe = Helper.NewIntStructPack8Explicit(64, 64); DelegateStdcallByRef_IntStructPack8Explicit caller_IntStructPack8Explicit = Get_MarshalStructAsParam_AsExpByRefIntStructPack8Explicit_Stdcall_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefIntStructPack8Explicit_Stdcall_FuncPtr..."); - Assert.IsTrue(caller_IntStructPack8Explicit(ref source_ispe)); - Assert.IsTrue(Helper.ValidateIntStructPack8Explicit(source_ispe, change_ispe, "Get_MarshalStructAsParam_AsExpByRefIntStructPack8Explicit_Stdcall_FuncPtr")); + Assert.True(caller_IntStructPack8Explicit(ref source_ispe)); + Assert.True(Helper.ValidateIntStructPack8Explicit(source_ispe, change_ispe, "Get_MarshalStructAsParam_AsExpByRefIntStructPack8Explicit_Stdcall_FuncPtr")); break; case StructID.LongStructPack16ExplicitId: @@ -344,12 +344,12 @@ private static void TestMethod_DelegatePInvoke_MarshalByRef_Stdcall(StructID str LongStructPack16Explicit change_lspe = Helper.NewLongStructPack16Explicit(64, 64); DelegateStdcallByRef_LongStructPack16Explicit caller_LongStructPack16Explicit = Get_MarshalStructAsParam_AsExpByRefLongStructPack16Explicit_Stdcall_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByRefLongStructPack16Explicit_Stdcall_FuncPtr..."); - Assert.IsTrue(caller_LongStructPack16Explicit(ref source_lspe)); - Assert.IsTrue(Helper.ValidateLongStructPack16Explicit(source_lspe, change_lspe, "Get_MarshalStructAsParam_AsExpByRefLongStructPack16Explicit_Stdcall_FuncPtr")); + Assert.True(caller_LongStructPack16Explicit(ref source_lspe)); + Assert.True(Helper.ValidateLongStructPack16Explicit(source_lspe, change_lspe, "Get_MarshalStructAsParam_AsExpByRefLongStructPack16Explicit_Stdcall_FuncPtr")); break; default: - Assert.Fail("TestMethod_DelegatePInvoke_MarshalByRef_Stdcall:The structid (Managed Side) is wrong"); + Assert.True(false, "TestMethod_DelegatePInvoke_MarshalByRef_Stdcall:The structid (Managed Side) is wrong"); break; } } @@ -371,49 +371,49 @@ private static void TestMethod_DelegatePInvoke_MarshalByRef_Stdcall(StructID str [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateCdeclByVal_InnerExplicit Get_MarshalStructAsParam_AsExpByValInnerExplicit_Cdecl_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool DelegateCdeclByVal_InnerArrayExplicit([In, Out] InnerArrayExplicit iae); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateCdeclByVal_InnerArrayExplicit Get_MarshalStructAsParam_AsExpByValInnerArrayExplicit_Cdecl_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool DelegateCdeclByVal_OUTER3([In, Out] OUTER3 outer); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateCdeclByVal_OUTER3 Get_MarshalStructAsParam_AsExpByValOUTER3_Cdecl_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool DelegateCdeclByVal_U([In, Out] U u); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateCdeclByVal_U Get_MarshalStructAsParam_AsExpByValU_Cdecl_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool DelegateCdeclByVal_ByteStructPack2Explicit([In, Out] ByteStructPack2Explicit bspe); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateCdeclByVal_ByteStructPack2Explicit Get_MarshalStructAsParam_AsExpByValByteStructPack2Explicit_Cdecl_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool DelegateCdeclByVal_ShortStructPack4Explicit([In, Out] ShortStructPack4Explicit bspe); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateCdeclByVal_ShortStructPack4Explicit Get_MarshalStructAsParam_AsExpByValShortStructPack4Explicit_Cdecl_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool DelegateCdeclByVal_IntStructPack8Explicit([In, Out] IntStructPack8Explicit bspe); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateCdeclByVal_IntStructPack8Explicit Get_MarshalStructAsParam_AsExpByValIntStructPack8Explicit_Cdecl_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool DelegateCdeclByVal_LongStructPack16Explicit([In, Out] LongStructPack16Explicit bspe); @@ -431,8 +431,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructID struc INNER2 cloneINNER2 = Helper.NewINNER2(1, 1.0F, "some string"); DelegateCdeclByVal_INNER2 caller_INNER2 = Get_MarshalStructAsParam_AsExpByValINNER2_Cdecl_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValINNER2_Cdecl_FuncPtr..."); - Assert.IsTrue(caller_INNER2(sourceINNER2)); - Assert.IsTrue(Helper.ValidateINNER2(sourceINNER2, cloneINNER2, "Get_MarshalStructAsParam_AsExpByValINNER2_Cdecl_FuncPtr")); + Assert.True(caller_INNER2(sourceINNER2)); + Assert.True(Helper.ValidateINNER2(sourceINNER2, cloneINNER2, "Get_MarshalStructAsParam_AsExpByValINNER2_Cdecl_FuncPtr")); break; case StructID.InnerExplicitId: @@ -444,8 +444,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructID struc cloneInnerExplicit.f3 = "some string"; DelegateCdeclByVal_InnerExplicit caller_InnerExplicit = Get_MarshalStructAsParam_AsExpByValInnerExplicit_Cdecl_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValInnerExplicit_Cdecl_FuncPtr..."); - Assert.IsTrue(caller_InnerExplicit(sourceInnerExplicit)); - Assert.IsTrue(Helper.ValidateInnerExplicit(sourceInnerExplicit, cloneInnerExplicit, "Get_MarshalStructAsParam_AsExpByValInnerExplicit_Cdecl_FuncPtr")); + Assert.True(caller_InnerExplicit(sourceInnerExplicit)); + Assert.True(Helper.ValidateInnerExplicit(sourceInnerExplicit, cloneInnerExplicit, "Get_MarshalStructAsParam_AsExpByValInnerExplicit_Cdecl_FuncPtr")); break; case StructID.InnerArrayExplicitId: @@ -453,8 +453,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructID struc InnerArrayExplicit cloneInnerArrayExplicit = Helper.NewInnerArrayExplicit(1, 1.0F, "some string1", "some string2"); DelegateCdeclByVal_InnerArrayExplicit caller_InnerArrayExplicit = Get_MarshalStructAsParam_AsExpByValInnerArrayExplicit_Cdecl_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValInnerArrayExplicit_Cdecl_FuncPtr..."); - Assert.IsTrue(caller_InnerArrayExplicit(sourceInnerArrayExplicit)); - Assert.IsTrue(Helper.ValidateInnerArrayExplicit(sourceInnerArrayExplicit, cloneInnerArrayExplicit, "Get_MarshalStructAsParam_AsExpByValInnerArrayExplicit_Cdecl_FuncPtr")); + Assert.True(caller_InnerArrayExplicit(sourceInnerArrayExplicit)); + Assert.True(Helper.ValidateInnerArrayExplicit(sourceInnerArrayExplicit, cloneInnerArrayExplicit, "Get_MarshalStructAsParam_AsExpByValInnerArrayExplicit_Cdecl_FuncPtr")); break; case StructID.OUTER3Id: @@ -462,19 +462,19 @@ private static void TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructID struc OUTER3 cloneOUTER3 = Helper.NewOUTER3(1, 1.0F, "some string", "some string"); DelegateCdeclByVal_OUTER3 caller_OUTER3 = Get_MarshalStructAsParam_AsExpByValOUTER3_Cdecl_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValOUTER3_Cdecl_FuncPtr..."); - Assert.IsTrue(caller_OUTER3(sourceOUTER3)); - Assert.IsTrue(Helper.ValidateOUTER3(sourceOUTER3, cloneOUTER3, "Get_MarshalStructAsParam_AsExpByValOUTER3_Cdecl_FuncPtr")); + Assert.True(caller_OUTER3(sourceOUTER3)); + Assert.True(Helper.ValidateOUTER3(sourceOUTER3, cloneOUTER3, "Get_MarshalStructAsParam_AsExpByValOUTER3_Cdecl_FuncPtr")); break; case StructID.UId: - U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, + U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2); - U cloneU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, + U cloneU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2); DelegateCdeclByVal_U caller_U = Get_MarshalStructAsParam_AsExpByValU_Cdecl_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValU_Cdecl_FuncPtr..."); - Assert.IsTrue(caller_U(sourceU)); - Assert.IsTrue(Helper.ValidateU(sourceU, cloneU, "Get_MarshalStructAsParam_AsExpByValU_Cdecl_FuncPtr")); + Assert.True(caller_U(sourceU)); + Assert.True(Helper.ValidateU(sourceU, cloneU, "Get_MarshalStructAsParam_AsExpByValU_Cdecl_FuncPtr")); break; case StructID.ByteStructPack2ExplicitId: @@ -482,8 +482,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructID struc ByteStructPack2Explicit clone_bspe = Helper.NewByteStructPack2Explicit(32, 32); DelegateCdeclByVal_ByteStructPack2Explicit caller_ByteStructPack2Explicit = Get_MarshalStructAsParam_AsExpByValByteStructPack2Explicit_Cdecl_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValByteStructPack2Explicit_Cdecl_FuncPtr..."); - Assert.IsTrue(caller_ByteStructPack2Explicit(source_bspe)); - Assert.IsTrue(Helper.ValidateByteStructPack2Explicit(source_bspe, clone_bspe, "Get_MarshalStructAsParam_AsExpByValByteStructPack2Explicit_Cdecl_FuncPtr")); + Assert.True(caller_ByteStructPack2Explicit(source_bspe)); + Assert.True(Helper.ValidateByteStructPack2Explicit(source_bspe, clone_bspe, "Get_MarshalStructAsParam_AsExpByValByteStructPack2Explicit_Cdecl_FuncPtr")); break; case StructID.ShortStructPack4ExplicitId: @@ -491,8 +491,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructID struc ShortStructPack4Explicit clone_sspe = Helper.NewShortStructPack4Explicit(32, 32); DelegateCdeclByVal_ShortStructPack4Explicit caller_ShortStructPack4Explicit = Get_MarshalStructAsParam_AsExpByValShortStructPack4Explicit_Cdecl_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValShortStructPack4Explicit_Cdecl_FuncPtr..."); - Assert.IsTrue(caller_ShortStructPack4Explicit(source_sspe)); - Assert.IsTrue(Helper.ValidateShortStructPack4Explicit(source_sspe, clone_sspe, "Get_MarshalStructAsParam_AsExpByValShortStructPack4Explicit_Cdecl_FuncPtr")); + Assert.True(caller_ShortStructPack4Explicit(source_sspe)); + Assert.True(Helper.ValidateShortStructPack4Explicit(source_sspe, clone_sspe, "Get_MarshalStructAsParam_AsExpByValShortStructPack4Explicit_Cdecl_FuncPtr")); break; case StructID.IntStructPack8ExplicitId: @@ -500,8 +500,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructID struc IntStructPack8Explicit clone_ispe = Helper.NewIntStructPack8Explicit(32, 32); DelegateCdeclByVal_IntStructPack8Explicit caller_IntStructPack8Explicit = Get_MarshalStructAsParam_AsExpByValIntStructPack8Explicit_Cdecl_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValIntStructPack8Explicit_Cdecl_FuncPtr..."); - Assert.IsTrue(caller_IntStructPack8Explicit(source_ispe)); - Assert.IsTrue(Helper.ValidateIntStructPack8Explicit(source_ispe, clone_ispe, "Get_MarshalStructAsParam_AsExpByValIntStructPack8Explicit_Cdecl_FuncPtr")); + Assert.True(caller_IntStructPack8Explicit(source_ispe)); + Assert.True(Helper.ValidateIntStructPack8Explicit(source_ispe, clone_ispe, "Get_MarshalStructAsParam_AsExpByValIntStructPack8Explicit_Cdecl_FuncPtr")); break; case StructID.LongStructPack16ExplicitId: @@ -509,12 +509,12 @@ private static void TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructID struc LongStructPack16Explicit clone_lspe = Helper.NewLongStructPack16Explicit(32, 32); DelegateCdeclByVal_LongStructPack16Explicit caller_LongStructPack16Explicit = Get_MarshalStructAsParam_AsExpByValLongStructPack16Explicit_Cdecl_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValLongStructPack16Explicit_Cdecl_FuncPtr..."); - Assert.IsTrue(caller_LongStructPack16Explicit(source_lspe)); - Assert.IsTrue(Helper.ValidateLongStructPack16Explicit(source_lspe, clone_lspe, "Get_MarshalStructAsParam_AsExpByValLongStructPack16Explicit_Cdecl_FuncPtr")); + Assert.True(caller_LongStructPack16Explicit(source_lspe)); + Assert.True(Helper.ValidateLongStructPack16Explicit(source_lspe, clone_lspe, "Get_MarshalStructAsParam_AsExpByValLongStructPack16Explicit_Cdecl_FuncPtr")); break; default: - Assert.Fail("TestMethod_DelegatePInvoke_MarshalByRef_Cdecl:The structid (Managed Side) is wrong"); + Assert.True(false, "TestMethod_DelegatePInvoke_MarshalByRef_Cdecl:The structid (Managed Side) is wrong"); break; } } @@ -529,56 +529,56 @@ private static void TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructID struc [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateStdcallByVal_INNER2 Get_MarshalStructAsParam_AsExpByValINNER2_Stdcall_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool DelegateStdcallByVal_InnerExplicit([In, Out] InnerExplicit ie); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateStdcallByVal_InnerExplicit Get_MarshalStructAsParam_AsExpByValInnerExplicit_Stdcall_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool DelegateStdcallByVal_InnerArrayExplicit([In, Out] InnerArrayExplicit iae); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateStdcallByVal_InnerArrayExplicit Get_MarshalStructAsParam_AsExpByValInnerArrayExplicit_Stdcall_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool DelegateStdcallByVal_OUTER3([In, Out] OUTER3 outer); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateStdcallByVal_OUTER3 Get_MarshalStructAsParam_AsExpByValOUTER3_Stdcall_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool DelegateStdcallByVal_U([In, Out] U u); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateStdcallByVal_U Get_MarshalStructAsParam_AsExpByValU_Stdcall_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool DelegateStdcallByVal_ByteStructPack2Explicit([In, Out] ByteStructPack2Explicit bspe); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateStdcallByVal_ByteStructPack2Explicit Get_MarshalStructAsParam_AsExpByValByteStructPack2Explicit_Stdcall_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool DelegateStdcallByVal_ShortStructPack4Explicit([In, Out] ShortStructPack4Explicit bspe); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateStdcallByVal_ShortStructPack4Explicit Get_MarshalStructAsParam_AsExpByValShortStructPack4Explicit_Stdcall_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool DelegateStdcallByVal_IntStructPack8Explicit([In, Out] IntStructPack8Explicit bspe); [DllImport("ReversePInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern DelegateStdcallByVal_IntStructPack8Explicit Get_MarshalStructAsParam_AsExpByValIntStructPack8Explicit_Stdcall_FuncPtr(); - + [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool DelegateStdcallByVal_LongStructPack16Explicit([In, Out] LongStructPack16Explicit bspe); @@ -596,8 +596,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByVal_Stdcall(StructID str INNER2 cloneINNER2 = Helper.NewINNER2(1, 1.0F, "some string"); DelegateStdcallByVal_INNER2 caller_INNER2 = Get_MarshalStructAsParam_AsExpByValINNER2_Stdcall_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValINNER2_Stdcall_FuncPtr..."); - Assert.IsTrue(caller_INNER2(sourceINNER2)); - Assert.IsTrue(Helper.ValidateINNER2(sourceINNER2, cloneINNER2, "Get_MarshalStructAsParam_AsExpByValINNER2_Stdcall_FuncPtr")); + Assert.True(caller_INNER2(sourceINNER2)); + Assert.True(Helper.ValidateINNER2(sourceINNER2, cloneINNER2, "Get_MarshalStructAsParam_AsExpByValINNER2_Stdcall_FuncPtr")); break; case StructID.InnerExplicitId: @@ -609,8 +609,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByVal_Stdcall(StructID str cloneInnerExplicit.f3 = "some string"; DelegateStdcallByVal_InnerExplicit caller_InnerExplicit = Get_MarshalStructAsParam_AsExpByValInnerExplicit_Stdcall_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValInnerExplicit_Stdcall_FuncPtr..."); - Assert.IsTrue(caller_InnerExplicit(sourceInnerExplicit)); - Assert.IsTrue(Helper.ValidateInnerExplicit(sourceInnerExplicit, cloneInnerExplicit, "Get_MarshalStructAsParam_AsExpByValInnerExplicit_Stdcall_FuncPtr")); + Assert.True(caller_InnerExplicit(sourceInnerExplicit)); + Assert.True(Helper.ValidateInnerExplicit(sourceInnerExplicit, cloneInnerExplicit, "Get_MarshalStructAsParam_AsExpByValInnerExplicit_Stdcall_FuncPtr")); break; case StructID.InnerArrayExplicitId: @@ -618,8 +618,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByVal_Stdcall(StructID str InnerArrayExplicit cloneInnerArrayExplicit = Helper.NewInnerArrayExplicit(1, 1.0F, "some string1", "some string2"); DelegateStdcallByVal_InnerArrayExplicit caller_InnerArrayExplicit = Get_MarshalStructAsParam_AsExpByValInnerArrayExplicit_Stdcall_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValInnerArrayExplicit_Stdcall_FuncPtr..."); - Assert.IsTrue(caller_InnerArrayExplicit(sourceInnerArrayExplicit)); - Assert.IsTrue(Helper.ValidateInnerArrayExplicit(sourceInnerArrayExplicit, cloneInnerArrayExplicit, "Get_MarshalStructAsParam_AsExpByValInnerArrayExplicit_Stdcall_FuncPtr")); + Assert.True(caller_InnerArrayExplicit(sourceInnerArrayExplicit)); + Assert.True(Helper.ValidateInnerArrayExplicit(sourceInnerArrayExplicit, cloneInnerArrayExplicit, "Get_MarshalStructAsParam_AsExpByValInnerArrayExplicit_Stdcall_FuncPtr")); break; case StructID.OUTER3Id: @@ -627,19 +627,19 @@ private static void TestMethod_DelegatePInvoke_MarshalByVal_Stdcall(StructID str OUTER3 cloneOUTER3 = Helper.NewOUTER3(1, 1.0F, "some string", "some string"); DelegateStdcallByVal_OUTER3 caller_OUTER3 = Get_MarshalStructAsParam_AsExpByValOUTER3_Stdcall_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValOUTER3_Stdcall_FuncPtr..."); - Assert.IsTrue(caller_OUTER3(sourceOUTER3)); - Assert.IsTrue(Helper.ValidateOUTER3(sourceOUTER3, cloneOUTER3, "Get_MarshalStructAsParam_AsExpByValOUTER3_Stdcall_FuncPtr")); + Assert.True(caller_OUTER3(sourceOUTER3)); + Assert.True(Helper.ValidateOUTER3(sourceOUTER3, cloneOUTER3, "Get_MarshalStructAsParam_AsExpByValOUTER3_Stdcall_FuncPtr")); break; case StructID.UId: - U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, + U sourceU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2); - U cloneU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, + U cloneU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2); DelegateStdcallByVal_U caller_U = Get_MarshalStructAsParam_AsExpByValU_Stdcall_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValU_Stdcall_FuncPtr..."); - Assert.IsTrue(caller_U(sourceU)); - Assert.IsTrue(Helper.ValidateU(sourceU, cloneU, "Get_MarshalStructAsParam_AsExpByValU_Stdcall_FuncPtr")); + Assert.True(caller_U(sourceU)); + Assert.True(Helper.ValidateU(sourceU, cloneU, "Get_MarshalStructAsParam_AsExpByValU_Stdcall_FuncPtr")); break; case StructID.ByteStructPack2ExplicitId: @@ -647,8 +647,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByVal_Stdcall(StructID str ByteStructPack2Explicit clone_bspe = Helper.NewByteStructPack2Explicit(32, 32); DelegateStdcallByVal_ByteStructPack2Explicit caller_ByteStructPack2Explicit = Get_MarshalStructAsParam_AsExpByValByteStructPack2Explicit_Stdcall_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValByteStructPack2Explicit_Stdcall_FuncPtr..."); - Assert.IsTrue(caller_ByteStructPack2Explicit(source_bspe)); - Assert.IsTrue(Helper.ValidateByteStructPack2Explicit(source_bspe, clone_bspe, "Get_MarshalStructAsParam_AsExpByValByteStructPack2Explicit_Stdcall_FuncPtr")); + Assert.True(caller_ByteStructPack2Explicit(source_bspe)); + Assert.True(Helper.ValidateByteStructPack2Explicit(source_bspe, clone_bspe, "Get_MarshalStructAsParam_AsExpByValByteStructPack2Explicit_Stdcall_FuncPtr")); break; case StructID.ShortStructPack4ExplicitId: @@ -656,8 +656,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByVal_Stdcall(StructID str ShortStructPack4Explicit clone_sspe = Helper.NewShortStructPack4Explicit(32, 32); DelegateStdcallByVal_ShortStructPack4Explicit caller_ShortStructPack4Explicit = Get_MarshalStructAsParam_AsExpByValShortStructPack4Explicit_Stdcall_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValShortStructPack4Explicit_Stdcall_FuncPtr..."); - Assert.IsTrue(caller_ShortStructPack4Explicit(source_sspe)); - Assert.IsTrue(Helper.ValidateShortStructPack4Explicit(source_sspe, clone_sspe, "Get_MarshalStructAsParam_AsExpByValShortStructPack4Explicit_Stdcall_FuncPtr")); + Assert.True(caller_ShortStructPack4Explicit(source_sspe)); + Assert.True(Helper.ValidateShortStructPack4Explicit(source_sspe, clone_sspe, "Get_MarshalStructAsParam_AsExpByValShortStructPack4Explicit_Stdcall_FuncPtr")); break; case StructID.IntStructPack8ExplicitId: @@ -665,8 +665,8 @@ private static void TestMethod_DelegatePInvoke_MarshalByVal_Stdcall(StructID str IntStructPack8Explicit clone_ispe = Helper.NewIntStructPack8Explicit(32, 32); DelegateStdcallByVal_IntStructPack8Explicit caller_IntStructPack8Explicit = Get_MarshalStructAsParam_AsExpByValIntStructPack8Explicit_Stdcall_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValIntStructPack8Explicit_Stdcall_FuncPtr..."); - Assert.IsTrue(caller_IntStructPack8Explicit(source_ispe)); - Assert.IsTrue(Helper.ValidateIntStructPack8Explicit(source_ispe, clone_ispe, "Get_MarshalStructAsParam_AsExpByValIntStructPack8Explicit_Stdcall_FuncPtr")); + Assert.True(caller_IntStructPack8Explicit(source_ispe)); + Assert.True(Helper.ValidateIntStructPack8Explicit(source_ispe, clone_ispe, "Get_MarshalStructAsParam_AsExpByValIntStructPack8Explicit_Stdcall_FuncPtr")); break; case StructID.LongStructPack16ExplicitId: @@ -674,12 +674,12 @@ private static void TestMethod_DelegatePInvoke_MarshalByVal_Stdcall(StructID str LongStructPack16Explicit clone_lspe = Helper.NewLongStructPack16Explicit(32, 32); DelegateStdcallByVal_LongStructPack16Explicit caller_LongStructPack16Explicit = Get_MarshalStructAsParam_AsExpByValLongStructPack16Explicit_Stdcall_FuncPtr(); Console.WriteLine("Calling Get_MarshalStructAsParam_AsExpByValLongStructPack16Explicit_Stdcall_FuncPtr..."); - Assert.IsTrue(caller_LongStructPack16Explicit(source_lspe)); - Assert.IsTrue(Helper.ValidateLongStructPack16Explicit(source_lspe, clone_lspe, "Get_MarshalStructAsParam_AsExpByValLongStructPack16Explicit_Stdcall_FuncPtr")); + Assert.True(caller_LongStructPack16Explicit(source_lspe)); + Assert.True(Helper.ValidateLongStructPack16Explicit(source_lspe, clone_lspe, "Get_MarshalStructAsParam_AsExpByValLongStructPack16Explicit_Stdcall_FuncPtr")); break; default: - Assert.Fail("TestMethod_DelegatePInvoke_MarshalByRef_Stdcall:The structid (Managed Side) is wrong"); + Assert.True(false, "TestMethod_DelegatePInvoke_MarshalByRef_Stdcall:The structid (Managed Side) is wrong"); break; } } diff --git a/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalExpStruct/ReversePInvokeManaged/ReversePInvokeTest.cs b/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalExpStruct/ReversePInvokeManaged/ReversePInvokeTest.cs index c6a9085b7cd499..6120f3be3b67eb 100644 --- a/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalExpStruct/ReversePInvokeManaged/ReversePInvokeTest.cs +++ b/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalExpStruct/ReversePInvokeManaged/ReversePInvokeTest.cs @@ -5,7 +5,7 @@ using System.Text; using System.Security; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; public class Test_ReversePInvokeTest { @@ -27,8 +27,8 @@ enum StructID #region Methods implementation - #region ReversePinvoke, ByRef, Cdel - + #region ReversePinvoke, ByRef, Cdel + //ReversePinvoke,Cdel // 1.1 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] @@ -41,7 +41,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByRef_INNER2_Cdecl(ref INN { Console.WriteLine("Reverse,Pinvoke,By Ref,Cdecl"); INNER2 sourceINNER2 = Helper.NewINNER2(77, 77.0F, "Native"); - Assert.IsTrue(Helper.ValidateINNER2(sourceINNER2, inner2, "TestMethod_DoCallBack_MarshalStructByRef_INNER2_Cdecl")); + Assert.True(Helper.ValidateINNER2(sourceINNER2, inner2, "TestMethod_DoCallBack_MarshalStructByRef_INNER2_Cdecl")); //changed the value inner2.f1 = 1; inner2.f2 = 1.0F; @@ -62,7 +62,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByRef_InnerExplicit_Cdecl( InnerExplicit source_ie = new InnerExplicit(); source_ie.f1 = 77; source_ie.f3 = "Native"; - Assert.IsTrue(Helper.ValidateInnerExplicit(source_ie, inner2, "TestMethod_DoCallBack_MarshalStructByRef_InnerExplicit_Cdecl")); + Assert.True(Helper.ValidateInnerExplicit(source_ie, inner2, "TestMethod_DoCallBack_MarshalStructByRef_InnerExplicit_Cdecl")); //changed the value inner2.f1 = 1; inner2.f3 = "some string"; @@ -80,7 +80,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByRef_InnerArrayExplicit_C { Console.WriteLine("Reverse,Pinvoke,By Ref,Cdecl"); InnerArrayExplicit source_iae = Helper.NewInnerArrayExplicit(77, 77.0F, "Native", "Native"); - Assert.IsTrue(Helper.ValidateInnerArrayExplicit(source_iae, iae, "TestMethod_DoCallBack_MarshalStructByRef_InnerArrayExplicit_Cdecl")); + Assert.True(Helper.ValidateInnerArrayExplicit(source_iae, iae, "TestMethod_DoCallBack_MarshalStructByRef_InnerArrayExplicit_Cdecl")); //changed the value for (int i = 0; i < Common.NumArrElements; i++) { @@ -102,7 +102,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByRef_OUTER3_Cdecl(ref OUT { Console.WriteLine("Reverse,Pinvoke,By Ref,Cdecl"); OUTER3 sourceOUTER3 = Helper.NewOUTER3(77, 77.0F, "Native", "Native"); - Assert.IsTrue(Helper.ValidateOUTER3(sourceOUTER3, outer3, "TestMethod_DoCallBack_MarshalStructByRef_OUTER3_Cdecl")); + Assert.True(Helper.ValidateOUTER3(sourceOUTER3, outer3, "TestMethod_DoCallBack_MarshalStructByRef_OUTER3_Cdecl")); //changed the value for (int i = 0; i < Common.NumArrElements; i++) { @@ -124,9 +124,9 @@ public static bool TestMethod_DoCallBack_MarshalStructByRef_OUTER3_Cdecl(ref OUT public static bool TestMethod_DoCallBack_MarshalStructByRef_U_Cdecl(ref U u) { Console.WriteLine("Reverse,Pinvoke,By Ref,Cdecl"); - U changeU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, + U changeU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 1.23); - Assert.IsTrue(Helper.ValidateU(changeU, u, "TestMethod_DoCallBack_MarshalStructByRef_U_Cdecl")); + Assert.True(Helper.ValidateU(changeU, u, "TestMethod_DoCallBack_MarshalStructByRef_U_Cdecl")); //changed the value u.d = 3.2; return true; @@ -143,7 +143,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByRef_ByteStructPack2Expli { Console.WriteLine("Reverse,Pinvoke,By Ref,Cdecl"); ByteStructPack2Explicit change_bspe = Helper.NewByteStructPack2Explicit(64, 64); - Assert.IsTrue(Helper.ValidateByteStructPack2Explicit(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByRef_ByteStructPack2Explicit_Cdecl")); + Assert.True(Helper.ValidateByteStructPack2Explicit(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByRef_ByteStructPack2Explicit_Cdecl")); //changed the value bspe.b1 = 32; bspe.b2 = 32; @@ -161,7 +161,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByRef_ShortStructPack4Expl { Console.WriteLine("Reverse,Pinvoke,By Ref,Cdecl"); ShortStructPack4Explicit change_sspe = Helper.NewShortStructPack4Explicit(64, 64); - Assert.IsTrue(Helper.ValidateShortStructPack4Explicit(change_sspe, sspe, "TestMethod_DoCallBack_MarshalStructByRef_ShortStructPack4Explicit_Cdecl")); + Assert.True(Helper.ValidateShortStructPack4Explicit(change_sspe, sspe, "TestMethod_DoCallBack_MarshalStructByRef_ShortStructPack4Explicit_Cdecl")); //changed the value sspe.s1 = 32; sspe.s2 = 32; @@ -179,7 +179,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByRef_IntStructPack8Explic { Console.WriteLine("Reverse,Pinvoke,By Ref,Cdecl"); IntStructPack8Explicit change_ispe = Helper.NewIntStructPack8Explicit(64, 64); - Assert.IsTrue(Helper.ValidateIntStructPack8Explicit(change_ispe, ispe, "TestMethod_DoCallBack_MarshalStructByRef_IntStructPack8Explicit_Cdecl")); + Assert.True(Helper.ValidateIntStructPack8Explicit(change_ispe, ispe, "TestMethod_DoCallBack_MarshalStructByRef_IntStructPack8Explicit_Cdecl")); //changed the value ispe.i1 = 32; ispe.i2 = 32; @@ -197,7 +197,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByRef_LongStructPack16Expl { Console.WriteLine("Reverse,Pinvoke,By Ref,Cdecl"); LongStructPack16Explicit change_lspe = Helper.NewLongStructPack16Explicit(64, 64); - Assert.IsTrue(Helper.ValidateLongStructPack16Explicit(change_lspe, lspe, "TestMethod_DoCallBack_MarshalStructByRef_LongStructPack16Explicit_Cdecl")); + Assert.True(Helper.ValidateLongStructPack16Explicit(change_lspe, lspe, "TestMethod_DoCallBack_MarshalStructByRef_LongStructPack16Explicit_Cdecl")); //changed the value lspe.l1 = 32; lspe.l2 = 32; @@ -205,7 +205,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByRef_LongStructPack16Expl } #endregion - + #region ReversePinvoke, ByRef, Stdcall //ReversePinvoke,Stdcall @@ -220,7 +220,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByRef_INNER2_Stdcall(ref I { Console.WriteLine("Reverse,Pinvoke,By Ref,Stdcall"); INNER2 sourceINNER2 = Helper.NewINNER2(77, 77.0F, "Native"); - Assert.IsTrue(Helper.ValidateINNER2(sourceINNER2, inner2, "TestMethod_DoCallBack_MarshalStructByRef_INNER2_Stdcall")); + Assert.True(Helper.ValidateINNER2(sourceINNER2, inner2, "TestMethod_DoCallBack_MarshalStructByRef_INNER2_Stdcall")); //changed the value inner2.f1 = 1; inner2.f2 = 1.0F; @@ -241,7 +241,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByRef_InnerExplicit_Stdcal InnerExplicit source_ie = new InnerExplicit(); source_ie.f1 = 77; source_ie.f3 = "Native"; - Assert.IsTrue(Helper.ValidateInnerExplicit(inner2,source_ie, "TestMethod_DoCallBack_MarshalStructByRef_InnerExplicit_Stdcall")); + Assert.True(Helper.ValidateInnerExplicit(inner2,source_ie, "TestMethod_DoCallBack_MarshalStructByRef_InnerExplicit_Stdcall")); //changed the value inner2.f1 = 1; inner2.f3 = "some string"; @@ -259,7 +259,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByRef_InnerArrayExplicit_S { Console.WriteLine("Reverse,Pinvoke,By Ref,Stdcall"); InnerArrayExplicit source_iae = Helper.NewInnerArrayExplicit(77, 77.0F, "Native", "Native"); - Assert.IsTrue(Helper.ValidateInnerArrayExplicit(source_iae, iae, "TestMethod_DoCallBack_MarshalStructByRef_InnerArrayExplicit_Stdcall")); + Assert.True(Helper.ValidateInnerArrayExplicit(source_iae, iae, "TestMethod_DoCallBack_MarshalStructByRef_InnerArrayExplicit_Stdcall")); //changed the value for (int i = 0; i < Common.NumArrElements; i++) { @@ -281,7 +281,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByRef_OUTER3_Stdcall(ref O { Console.WriteLine("Reverse,Pinvoke,By Ref,Stdcall"); OUTER3 sourceOUTER3 = Helper.NewOUTER3(77, 77.0F, "Native", "Native"); - Assert.IsTrue(Helper.ValidateOUTER3(sourceOUTER3, outer3, "TestMethod_DoCallBack_MarshalStructByRef_OUTER3_Stdcall")); + Assert.True(Helper.ValidateOUTER3(sourceOUTER3, outer3, "TestMethod_DoCallBack_MarshalStructByRef_OUTER3_Stdcall")); //changed the value for (int i = 0; i < Common.NumArrElements; i++) { @@ -303,9 +303,9 @@ public static bool TestMethod_DoCallBack_MarshalStructByRef_OUTER3_Stdcall(ref O public static bool TestMethod_DoCallBack_MarshalStructByRef_U_Stdcall(ref U u) { Console.WriteLine("Reverse,Pinvoke,By Ref,Stdcall"); - U changeU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, + U changeU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 1.23); - Assert.IsTrue(Helper.ValidateU(changeU, u, "TestMethod_DoCallBack_MarshalStructByRef_U_Stdcall")); + Assert.True(Helper.ValidateU(changeU, u, "TestMethod_DoCallBack_MarshalStructByRef_U_Stdcall")); //changed the value u.d = 3.2; return true; @@ -322,7 +322,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByRef_ByteStructPack2Expli { Console.WriteLine("Reverse,Pinvoke,By Ref,Stdcall"); ByteStructPack2Explicit change_bspe = Helper.NewByteStructPack2Explicit(64, 64); - Assert.IsTrue(Helper.ValidateByteStructPack2Explicit(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByRef_ByteStructPack2Explicit_Stdcall")); + Assert.True(Helper.ValidateByteStructPack2Explicit(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByRef_ByteStructPack2Explicit_Stdcall")); //changed the value bspe.b1 = 32; bspe.b2 = 32; @@ -340,7 +340,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByRef_ShortStructPack4Expl { Console.WriteLine("Reverse,Pinvoke,By Ref,Stdcall"); ShortStructPack4Explicit change_sspe = Helper.NewShortStructPack4Explicit(64, 64); - Assert.IsTrue(Helper.ValidateShortStructPack4Explicit(change_sspe, sspe, "TestMethod_DoCallBack_MarshalStructByRef_ShortStructPack4Explicit_Stdcall")); + Assert.True(Helper.ValidateShortStructPack4Explicit(change_sspe, sspe, "TestMethod_DoCallBack_MarshalStructByRef_ShortStructPack4Explicit_Stdcall")); //changed the value sspe.s1 = 32; sspe.s2 = 32; @@ -358,7 +358,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByRef_IntStructPack8Explic { Console.WriteLine("Reverse,Pinvoke,By Ref,Stdcall"); IntStructPack8Explicit change_ispe = Helper.NewIntStructPack8Explicit(64, 64); - Assert.IsTrue(Helper.ValidateIntStructPack8Explicit(change_ispe, ispe, "TestMethod_DoCallBack_MarshalStructByRef_IntStructPack8Explicit_Stdcall")); + Assert.True(Helper.ValidateIntStructPack8Explicit(change_ispe, ispe, "TestMethod_DoCallBack_MarshalStructByRef_IntStructPack8Explicit_Stdcall")); //changed the value ispe.i1 = 32; ispe.i2 = 32; @@ -376,7 +376,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByRef_LongStructPack16Expl { Console.WriteLine("Reverse,Pinvoke,By Ref,Stdcall"); LongStructPack16Explicit change_lspe = Helper.NewLongStructPack16Explicit(64, 64); - Assert.IsTrue(Helper.ValidateLongStructPack16Explicit(change_lspe, lspe, "TestMethod_DoCallBack_MarshalStructByRef_LongStructPack16Explicit_Stdcall")); + Assert.True(Helper.ValidateLongStructPack16Explicit(change_lspe, lspe, "TestMethod_DoCallBack_MarshalStructByRef_LongStructPack16Explicit_Stdcall")); //changed the value lspe.l1 = 32; lspe.l2 = 32; @@ -384,7 +384,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByRef_LongStructPack16Expl } #endregion - + #region ReversePinvoke, ByVal, Cdel // 3.1 @@ -398,7 +398,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_INNER2_Cdecl( INNER2 { Console.WriteLine("Reverse,Pinvoke,By Ref,Cdecl"); INNER2 sourceINNER2 = Helper.NewINNER2(1, 1.0F, "some string"); - Assert.IsTrue(Helper.ValidateINNER2(sourceINNER2, inner2, "TestMethod_DoCallBack_MarshalStructByVal_INNER2_Cdecl")); + Assert.True(Helper.ValidateINNER2(sourceINNER2, inner2, "TestMethod_DoCallBack_MarshalStructByVal_INNER2_Cdecl")); //changed the value inner2.f1 = 77; inner2.f2 = 77.0F; @@ -419,7 +419,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_InnerExplicit_Cdecl( InnerExplicit source_ie = new InnerExplicit(); source_ie.f1 = 1; source_ie.f3 = "Native"; - Assert.IsTrue(Helper.ValidateInnerExplicit(source_ie, inner2, "TestMethod_DoCallBack_MarshalStructByVal_InnerExplicit_Cdecl")); + Assert.True(Helper.ValidateInnerExplicit(source_ie, inner2, "TestMethod_DoCallBack_MarshalStructByVal_InnerExplicit_Cdecl")); //changed the value inner2.f1 = 1; inner2.f3 = "changed string"; @@ -437,7 +437,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_InnerArrayExplicit_C { Console.WriteLine("Reverse,Pinvoke,By Val,Cdecl"); InnerArrayExplicit source_iae = Helper.NewInnerArrayExplicit(1, 1.0F, "some string", "some string"); - Assert.IsTrue(Helper.ValidateInnerArrayExplicit(source_iae, iae, "TestMethod_DoCallBack_MarshalStructByVal_InnerArrayExplicit_Cdecl")); + Assert.True(Helper.ValidateInnerArrayExplicit(source_iae, iae, "TestMethod_DoCallBack_MarshalStructByVal_InnerArrayExplicit_Cdecl")); //changed the value for (int i = 0; i < Common.NumArrElements; i++) { @@ -459,7 +459,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_OUTER3_Cdecl( OUTER3 { Console.WriteLine("Reverse,Pinvoke,By Val,Cdecl"); OUTER3 sourceOUTER3 = Helper.NewOUTER3(1, 1.0F, "some string", "some string"); - Assert.IsTrue(Helper.ValidateOUTER3(sourceOUTER3, outer3, "TestMethod_DoCallBack_MarshalStructByVal_OUTER3_Cdecl")); + Assert.True(Helper.ValidateOUTER3(sourceOUTER3, outer3, "TestMethod_DoCallBack_MarshalStructByVal_OUTER3_Cdecl")); //changed the value for (int i = 0; i < Common.NumArrElements; i++) { @@ -481,9 +481,9 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_OUTER3_Cdecl( OUTER3 public static bool TestMethod_DoCallBack_MarshalStructByVal_U_Cdecl( U u) { Console.WriteLine("Reverse,Pinvoke,By Val,Cdecl"); - U changeU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, + U changeU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2); - Assert.IsTrue(Helper.ValidateU(changeU, u, "TestMethod_DoCallBack_MarshalStructByVal_U_Cdecl")); + Assert.True(Helper.ValidateU(changeU, u, "TestMethod_DoCallBack_MarshalStructByVal_U_Cdecl")); //changed the value u.d = 1.23; return true; @@ -500,7 +500,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_ByteStructPack2Expli { Console.WriteLine("Reverse,Pinvoke,By Val,Cdecl"); ByteStructPack2Explicit change_bspe = Helper.NewByteStructPack2Explicit(32, 32); - Assert.IsTrue(Helper.ValidateByteStructPack2Explicit(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByVal_ByteStructPack2Explicit_Cdecl")); + Assert.True(Helper.ValidateByteStructPack2Explicit(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByVal_ByteStructPack2Explicit_Cdecl")); //changed the value bspe.b1 = 64; bspe.b2 = 64; @@ -518,7 +518,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_ShortStructPack4Expl { Console.WriteLine("Reverse,Pinvoke,By Val,Cdecl"); ShortStructPack4Explicit change_sspe = Helper.NewShortStructPack4Explicit(32, 32); - Assert.IsTrue(Helper.ValidateShortStructPack4Explicit(change_sspe, sspe, "TestMethod_DoCallBack_MarshalStructByVal_ShortStructPack4Explicit_Cdecl")); + Assert.True(Helper.ValidateShortStructPack4Explicit(change_sspe, sspe, "TestMethod_DoCallBack_MarshalStructByVal_ShortStructPack4Explicit_Cdecl")); //changed the value sspe.s1 = 64; sspe.s2 = 64; @@ -536,7 +536,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_IntStructPack8Explic { Console.WriteLine("Reverse,Pinvoke,By Val,Cdecl"); IntStructPack8Explicit change_ispe = Helper.NewIntStructPack8Explicit(32, 32); - Assert.IsTrue(Helper.ValidateIntStructPack8Explicit(change_ispe, ispe, "TestMethod_DoCallBack_MarshalStructByVal_IntStructPack8Explicit_Cdecl")); + Assert.True(Helper.ValidateIntStructPack8Explicit(change_ispe, ispe, "TestMethod_DoCallBack_MarshalStructByVal_IntStructPack8Explicit_Cdecl")); //changed the value ispe.i1 = 64; ispe.i2 = 64; @@ -554,7 +554,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_LongStructPack16Expl { Console.WriteLine("Reverse,Pinvoke,By Val,Cdecl"); LongStructPack16Explicit change_lspe = Helper.NewLongStructPack16Explicit(32, 32); - Assert.IsTrue(Helper.ValidateLongStructPack16Explicit(change_lspe, lspe, "TestMethod_DoCallBack_MarshalStructByVal_LongStructPack16Explicit_Cdecl")); + Assert.True(Helper.ValidateLongStructPack16Explicit(change_lspe, lspe, "TestMethod_DoCallBack_MarshalStructByVal_LongStructPack16Explicit_Cdecl")); //changed the value lspe.l1 = 64; lspe.l2 = 64; @@ -562,9 +562,9 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_LongStructPack16Expl } #endregion - + #region ReversePinvoke, ByVal, Stdcall - + // 4.1 [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool ByValStdcallcaller_INNER2([In, Out] INNER2 inner2); @@ -576,14 +576,14 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_INNER2_Stdcall(INNER { Console.WriteLine("Reverse,Pinvoke,By Val,Stdcall"); INNER2 sourceINNER2 = Helper.NewINNER2(1, 1.0F, "some string"); - Assert.IsTrue(Helper.ValidateINNER2(sourceINNER2, inner2, "TestMethod_DoCallBack_MarshalStructByVal_INNER2_Stdcall")); + Assert.True(Helper.ValidateINNER2(sourceINNER2, inner2, "TestMethod_DoCallBack_MarshalStructByVal_INNER2_Stdcall")); //changed the value inner2.f1 = 77; inner2.f2 = 77.0F; inner2.f3 = "changed string"; return true; } - + // 4.2 [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool ByValStdcallcaller_InnerExplicit([In, Out] InnerExplicit inner2); @@ -597,13 +597,13 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_InnerExplicit_Stdcal InnerExplicit source_ie = new InnerExplicit(); source_ie.f1 = 1; source_ie.f3 = "Native"; - Assert.IsTrue(Helper.ValidateInnerExplicit(source_ie, inner2, "TestMethod_DoCallBack_MarshalStructByVal_InnerExplicit_Stdcall")); + Assert.True(Helper.ValidateInnerExplicit(source_ie, inner2, "TestMethod_DoCallBack_MarshalStructByVal_InnerExplicit_Stdcall")); //changed the value inner2.f1 = 1; inner2.f3 = "changed string"; return true; } - + // 4.3 [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool ByValStdcallcaller_InnerArrayExplicit([In, Out] InnerArrayExplicit inner2); @@ -615,7 +615,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_InnerArrayExplicit_S { Console.WriteLine("Reverse,Pinvoke,By Val,Stdcall"); InnerArrayExplicit source_iae = Helper.NewInnerArrayExplicit(1, 1.0F, "some string", "some string"); - Assert.IsTrue(Helper.ValidateInnerArrayExplicit(source_iae, iae, "TestMethod_DoCallBack_MarshalStructByVal_InnerArrayExplicit_Stdcall")); + Assert.True(Helper.ValidateInnerArrayExplicit(source_iae, iae, "TestMethod_DoCallBack_MarshalStructByVal_InnerArrayExplicit_Stdcall")); //changed the value for (int i = 0; i < Common.NumArrElements; i++) { @@ -625,7 +625,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_InnerArrayExplicit_S iae.f4 = "changed string"; return true; } - + // 4.4 [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool ByValStdcallcaller_OUTER3([In, Out] OUTER3 outer3); @@ -637,7 +637,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_OUTER3_Stdcall(OUTER { Console.WriteLine("Reverse,Pinvoke,By Val,Stdcall"); OUTER3 sourceOUTER3 = Helper.NewOUTER3(1, 1.0F, "some string", "some string"); - Assert.IsTrue(Helper.ValidateOUTER3(sourceOUTER3, outer3, "TestMethod_DoCallBack_MarshalStructByVal_OUTER3_Stdcall")); + Assert.True(Helper.ValidateOUTER3(sourceOUTER3, outer3, "TestMethod_DoCallBack_MarshalStructByVal_OUTER3_Stdcall")); //changed the value for (int i = 0; i < Common.NumArrElements; i++) { @@ -659,14 +659,14 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_OUTER3_Stdcall(OUTER public static bool TestMethod_DoCallBack_MarshalStructByVal_U_Stdcall(U u) { Console.WriteLine("Reverse,Pinvoke,By Val,Stdcall"); - U changeU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, + U changeU = Helper.NewU(Int32.MinValue, UInt32.MaxValue, new IntPtr(-32), new UIntPtr(32), short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, long.MinValue, ulong.MaxValue, 32.0F, 3.2); - Assert.IsTrue(Helper.ValidateU(changeU, u, "TestMethod_DoCallBack_MarshalStructByVal_U_Stdcall")); + Assert.True(Helper.ValidateU(changeU, u, "TestMethod_DoCallBack_MarshalStructByVal_U_Stdcall")); //changed the value u.d = 1.23; return true; } - + // 4.6 [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate bool ByValStdcallcaller_ByteStructPack2Explicit([In, Out] ByteStructPack2Explicit bspe); @@ -678,7 +678,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_ByteStructPack2Expli { Console.WriteLine("Reverse,Pinvoke,By Val,Stdcall"); ByteStructPack2Explicit change_bspe = Helper.NewByteStructPack2Explicit(32, 32); - Assert.IsTrue(Helper.ValidateByteStructPack2Explicit(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByVal_ByteStructPack2Explicit_Stdcall")); + Assert.True(Helper.ValidateByteStructPack2Explicit(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByVal_ByteStructPack2Explicit_Stdcall")); //changed the value bspe.b1 = 64; bspe.b2 = 64; @@ -696,7 +696,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_ShortStructPack4Expl { Console.WriteLine("Reverse,Pinvoke,By Val,Stdcall"); ShortStructPack4Explicit change_sspe = Helper.NewShortStructPack4Explicit(32, 32); - Assert.IsTrue(Helper.ValidateShortStructPack4Explicit(change_sspe, sspe, "TestMethod_DoCallBack_MarshalStructByVal_ShortStructPack4Explicit_Stdcall")); + Assert.True(Helper.ValidateShortStructPack4Explicit(change_sspe, sspe, "TestMethod_DoCallBack_MarshalStructByVal_ShortStructPack4Explicit_Stdcall")); //changed the value sspe.s1 = 64; sspe.s2 = 64; @@ -714,7 +714,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_IntStructPack8Explic { Console.WriteLine("Reverse,Pinvoke,By Val,Stdcall"); IntStructPack8Explicit change_ispe = Helper.NewIntStructPack8Explicit(32, 32); - Assert.IsTrue(Helper.ValidateIntStructPack8Explicit(change_ispe, ispe, "TestMethod_DoCallBack_MarshalStructByVal_IntStructPack8Explicit_Stdcall")); + Assert.True(Helper.ValidateIntStructPack8Explicit(change_ispe, ispe, "TestMethod_DoCallBack_MarshalStructByVal_IntStructPack8Explicit_Stdcall")); //changed the value ispe.i1 = 64; ispe.i2 = 64; @@ -732,7 +732,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_LongStructPack16Expl { Console.WriteLine("Reverse,Pinvoke,By Val,Stdcall"); LongStructPack16Explicit change_lspe = Helper.NewLongStructPack16Explicit(32, 32); - Assert.IsTrue(Helper.ValidateLongStructPack16Explicit(change_lspe, lspe, "TestMethod_DoCallBack_MarshalStructByVal_LongStructPack16Explicit_Stdcall")); + Assert.True(Helper.ValidateLongStructPack16Explicit(change_lspe, lspe, "TestMethod_DoCallBack_MarshalStructByVal_LongStructPack16Explicit_Stdcall")); //changed the value lspe.l1 = 64; lspe.l2 = 64; @@ -740,7 +740,7 @@ public static bool TestMethod_DoCallBack_MarshalStructByVal_LongStructPack16Expl } #endregion - + #endregion static int Main() @@ -759,7 +759,7 @@ static int Main() DoCallBack_MarshalByRefStruct_Cdecl_ShortStructPack4Explicit(new ByRefCdeclcaller_ShortStructPack4Explicit(TestMethod_DoCallBack_MarshalStructByRef_ShortStructPack4Explicit_Cdecl)); DoCallBack_MarshalByRefStruct_Cdecl_IntStructPack8Explicit(new ByRefCdeclcaller_IntStructPack8Explicit(TestMethod_DoCallBack_MarshalStructByRef_IntStructPack8Explicit_Cdecl)); DoCallBack_MarshalByRefStruct_Cdecl_LongStructPack16Explicit(new ByRefCdeclcaller_LongStructPack16Explicit(TestMethod_DoCallBack_MarshalStructByRef_LongStructPack16Explicit_Cdecl)); - + ////Reverse Pinvoke,ByRef,StdCall DoCallBack_MarshalByRefStruct_Stdcall_INNER2(new ByRefStdcallcaller_INNER2(TestMethod_DoCallBack_MarshalStructByRef_INNER2_Stdcall)); DoCallBack_MarshalByRefStruct_Stdcall_InnerExplicit(new ByRefStdcallcaller_InnerExplicit(TestMethod_DoCallBack_MarshalStructByRef_InnerExplicit_Stdcall)); @@ -792,7 +792,7 @@ static int Main() DoCallBack_MarshalByValStruct_Stdcall_ShortStructPack4Explicit(new ByValStdcallcaller_ShortStructPack4Explicit(TestMethod_DoCallBack_MarshalStructByVal_ShortStructPack4Explicit_Stdcall)); DoCallBack_MarshalByValStruct_Stdcall_IntStructPack8Explicit(new ByValStdcallcaller_IntStructPack8Explicit(TestMethod_DoCallBack_MarshalStructByVal_IntStructPack8Explicit_Stdcall)); DoCallBack_MarshalByValStruct_Stdcall_LongStructPack16Explicit(new ByValStdcallcaller_LongStructPack16Explicit(TestMethod_DoCallBack_MarshalStructByVal_LongStructPack16Explicit_Stdcall)); - + #endregion return 100; diff --git a/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/DelegatePInvoke/DelegatePInvokeTest.cs b/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/DelegatePInvoke/DelegatePInvokeTest.cs index e8c2806a3b361e..c2b3e36749b2d2 100644 --- a/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/DelegatePInvoke/DelegatePInvokeTest.cs +++ b/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/DelegatePInvoke/DelegatePInvokeTest.cs @@ -5,7 +5,7 @@ using System.Text; using System.Security; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; public class MarshalStructTest { @@ -39,9 +39,9 @@ private static void testMethod(S9 s9) } #region Methods for the struct InnerSequential declaration - + #region PassByRef - + //For Delegate Pinvoke ByRef [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool InnerSequentialByRefDelegateCdecl([In, Out]ref InnerSequential argStr); @@ -61,11 +61,11 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern InnerSequentialByRefDelegateStdCall Get_MarshalStructInnerSequentialByRef_StdCall_FuncPtr(); - + #endregion - + #region PassByValue - + //For Delegate Pinvoke ByVal [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool InnerSequentialByValDelegateCdecl([In, Out] InnerSequential argStr); @@ -85,15 +85,15 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern InnerSequentialByValDelegateStdCall Get_MarshalStructInnerSequentialByVal_StdCall_FuncPtr(); - + #endregion #endregion #region Methods for the struct InnerArraySequential declaration - + #region PassByRef - + //For Delegate Pinvoke ByRef [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool InnerArraySequentialByRefDelegateCdecl([In, Out]ref InnerArraySequential argStr); @@ -113,11 +113,11 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern InnerArraySequentialByRefDelegateStdCall Get_MarshalStructInnerArraySequentialByRef_StdCall_FuncPtr(); - + #endregion - + #region PassByValue - + //For Delegate Pinvoke ByVal [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool InnerArraySequentialByValDelegateCdecl([In, Out] InnerArraySequential argStr); @@ -139,13 +139,13 @@ private static void testMethod(S9 s9) public static extern InnerArraySequentialByValDelegateStdCall Get_MarshalStructInnerArraySequentialByVal_StdCall_FuncPtr(); #endregion - + #endregion #region Methods for the struct CharSetAnsiSequential declaration - + #region PassByRef - + //For Delegate Pinvoke ByRef [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool CharSetAnsiSequentialByRefDelegateCdecl([In, Out]ref CharSetAnsiSequential argStr); @@ -165,11 +165,11 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern CharSetAnsiSequentialByRefDelegateStdCall Get_MarshalStructCharSetAnsiSequentialByRef_StdCall_FuncPtr(); - + #endregion - + #region PassByValue - + //For Delegate Pinvoke ByVal [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool CharSetAnsiSequentialByValDelegateCdecl([In, Out] CharSetAnsiSequential argStr); @@ -189,15 +189,15 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern CharSetAnsiSequentialByValDelegateStdCall Get_MarshalStructCharSetAnsiSequentialByVal_StdCall_FuncPtr(); - + #endregion - + #endregion #region Methods for the struct CharSetUnicodeSequential declaration - + #region PassByRef - + //For Delegate Pinvoke ByRef [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool CharSetUnicodeSequentialByRefDelegateCdecl([In, Out]ref CharSetUnicodeSequential argStr); @@ -217,11 +217,11 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern CharSetUnicodeSequentialByRefDelegateStdCall Get_MarshalStructCharSetUnicodeSequentialByRef_StdCall_FuncPtr(); - + #endregion - + #region PassByValue - + //For Delegate Pinvoke ByVal [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool CharSetUnicodeSequentialByValDelegateCdecl([In, Out] CharSetUnicodeSequential argStr); @@ -241,15 +241,15 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern CharSetUnicodeSequentialByValDelegateStdCall Get_MarshalStructCharSetUnicodeSequentialByVal_StdCall_FuncPtr(); - + #endregion - + #endregion #region Methods for the struct NumberSequential declaration #region PassByRef - + //For Delegate Pinvoke ByRef [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool NumberSequentialByRefDelegateCdecl([In, Out]ref NumberSequential argStr); @@ -269,11 +269,11 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern NumberSequentialByRefDelegateStdCall Get_MarshalStructNumberSequentialByRef_StdCall_FuncPtr(); - + #endregion - + #region PassByValue - + //For Delegate Pinvoke ByVal [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool NumberSequentialByValDelegateCdecl([In, Out] NumberSequential argStr); @@ -293,7 +293,7 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern NumberSequentialByValDelegateStdCall Get_MarshalStructNumberSequentialByVal_StdCall_FuncPtr(); - + #endregion #endregion @@ -301,7 +301,7 @@ private static void testMethod(S9 s9) #region Methods for the struct S3 declaration #region PassByRef - + //For Delegate Pinvoke ByRef [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool S3ByRefDelegateCdecl([In, Out]ref S3 argStr); @@ -321,11 +321,11 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern S3ByRefDelegateStdCall Get_MarshalStructS3ByRef_StdCall_FuncPtr(); - + #endregion - + #region PassByValue - + //For Delegate Pinvoke ByVal [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool S3ByValDelegateCdecl([In, Out] S3 argStr); @@ -345,7 +345,7 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern S3ByValDelegateStdCall Get_MarshalStructS3ByVal_StdCall_FuncPtr(); - + #endregion #endregion @@ -353,7 +353,7 @@ private static void testMethod(S9 s9) #region Methods for the struct S5 declaration #region PassByRef - + //For Delegate Pinvoke ByRef [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool S5ByRefDelegateCdecl([In, Out]ref S5 argStr); @@ -373,11 +373,11 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern S5ByRefDelegateStdCall Get_MarshalStructS5ByRef_StdCall_FuncPtr(); - + #endregion - + #region PassByValue - + //For Delegate Pinvoke ByVal [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool S5ByValDelegateCdecl([In, Out] S5 argStr); @@ -397,7 +397,7 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern S5ByValDelegateStdCall Get_MarshalStructS5ByVal_StdCall_FuncPtr(); - + #endregion #endregion @@ -405,7 +405,7 @@ private static void testMethod(S9 s9) #region Methods for the struct StringStructSequentialAnsi declaration #region PassByRef - + //For Delegate Pinvoke ByRef [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool StringStructSequentialAnsiByRefDelegateCdecl([In, Out]ref StringStructSequentialAnsi argStr); @@ -425,11 +425,11 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern StringStructSequentialAnsiByRefDelegateStdCall Get_MarshalStructStringStructSequentialAnsiByRef_StdCall_FuncPtr(); - + #endregion - + #region PassByValue - + //For Delegate Pinvoke ByVal [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool StringStructSequentialAnsiByValDelegateCdecl([In, Out] StringStructSequentialAnsi argStr); @@ -449,7 +449,7 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern StringStructSequentialAnsiByValDelegateStdCall Get_MarshalStructStringStructSequentialAnsiByVal_StdCall_FuncPtr(); - + #endregion #endregion @@ -457,7 +457,7 @@ private static void testMethod(S9 s9) #region Methods for the struct StringStructSequentialUnicode declaration #region PassByRef - + //For Delegate Pinvoke ByRef [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool StringStructSequentialUnicodeByRefDelegateCdecl([In, Out]ref StringStructSequentialUnicode argStr); @@ -477,11 +477,11 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern StringStructSequentialUnicodeByRefDelegateStdCall Get_MarshalStructStringStructSequentialUnicodeByRef_StdCall_FuncPtr(); - + #endregion - + #region PassByValue - + //For Delegate Pinvoke ByVal [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool StringStructSequentialUnicodeByValDelegateCdecl([In, Out] StringStructSequentialUnicode argStr); @@ -501,7 +501,7 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern StringStructSequentialUnicodeByValDelegateStdCall Get_MarshalStructStringStructSequentialUnicodeByVal_StdCall_FuncPtr(); - + #endregion #endregion @@ -509,7 +509,7 @@ private static void testMethod(S9 s9) #region Methods for the struct S8 declaration #region PassByRef - + //For Delegate Pinvoke ByRef [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool S8ByRefDelegateCdecl([In, Out]ref S8 argStr); @@ -529,11 +529,11 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern S8ByRefDelegateStdCall Get_MarshalStructS8ByRef_StdCall_FuncPtr(); - + #endregion - + #region PassByValue - + //For Delegate Pinvoke ByVal [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool S8ByValDelegateCdecl([In, Out] S8 argStr); @@ -553,7 +553,7 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern S8ByValDelegateStdCall Get_MarshalStructS8ByVal_StdCall_FuncPtr(); - + #endregion #endregion @@ -561,7 +561,7 @@ private static void testMethod(S9 s9) #region Methods for the struct S9 declaration #region PassByRef - + //For Delegate Pinvoke ByRef [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool S9ByRefDelegateCdecl([In, Out]ref S9 argStr); @@ -581,11 +581,11 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern S9ByRefDelegateStdCall Get_MarshalStructS9ByRef_StdCall_FuncPtr(); - + #endregion - + #region PassByValue - + //For Delegate Pinvoke ByVal [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool S9ByValDelegateCdecl([In, Out] S9 argStr); @@ -605,7 +605,7 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern S9ByValDelegateStdCall Get_MarshalStructS9ByVal_StdCall_FuncPtr(); - + #endregion #endregion @@ -613,7 +613,7 @@ private static void testMethod(S9 s9) #region Methods for the struct IncludeOuterIntergerStructSequential declaration #region PassByRef - + //For Delegate Pinvoke ByRef [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool IncludeOuterIntergerStructSequentialByRefDelegateCdecl([In, Out]ref IncludeOuterIntergerStructSequential argStr); @@ -633,11 +633,11 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern IncludeOuterIntergerStructSequentialByRefDelegateStdCall Get_MarshalStructIncludeOuterIntergerStructSequentialByRef_StdCall_FuncPtr(); - + #endregion - + #region PassByValue - + //For Delegate Pinvoke ByVal [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool IncludeOuterIntergerStructSequentialByValDelegateCdecl([In, Out] IncludeOuterIntergerStructSequential argStr); @@ -657,7 +657,7 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern IncludeOuterIntergerStructSequentialByValDelegateStdCall Get_MarshalStructIncludeOuterIntergerStructSequentialByVal_StdCall_FuncPtr(); - + #endregion #endregion @@ -665,7 +665,7 @@ private static void testMethod(S9 s9) #region Methods for the struct S11 declaration #region PassByRef - + //For Delegate Pinvoke ByRef [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool S11ByRefDelegateCdecl([In, Out]ref S11 argStr); @@ -685,11 +685,11 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern S11ByRefDelegateStdCall Get_MarshalStructS11ByRef_StdCall_FuncPtr(); - + #endregion - + #region PassByValue - + //For Delegate Pinvoke ByVal [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool S11ByValDelegateCdecl([In, Out] S11 argStr); @@ -709,7 +709,7 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern S11ByValDelegateStdCall Get_MarshalStructS11ByVal_StdCall_FuncPtr(); - + #endregion #endregion @@ -717,7 +717,7 @@ private static void testMethod(S9 s9) #region Methods for the struct ComplexStruct declaration #region PassByRef - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool ComplexStructByRefDelegateCdecl([In, Out]ref ComplexStruct argStr); [UnmanagedFunctionPointer(CallingConvention.StdCall)] @@ -738,7 +738,7 @@ private static void testMethod(S9 s9) #endregion #region PassByValue - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate bool ComplexStructByValDelegateCdecl([In, Out] ComplexStruct argStr); [UnmanagedFunctionPointer(CallingConvention.StdCall)] @@ -755,15 +755,15 @@ private static void testMethod(S9 s9) [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.FunctionPtr)] public static extern ComplexStructByValDelegateStdCall Get_MarshalStructComplexStructByVal_StdCall_FuncPtr(); - + #endregion #endregion #region Methods implementation - + //By Ref - //Delegate P/Invoke + //Delegate P/Invoke unsafe private static void TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructID structid) { Console.WriteLine("Delegate PInvoke,By Ref,Cdecl"); @@ -778,53 +778,53 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructI cs.type.idata = 123; cs.type.ptrdata = (IntPtr)0x120000; ComplexStructByRefDelegateCdecl caller1 = Get_MarshalStructComplexStructByRef_Cdecl_FuncPtr(); - Assert.IsTrue(caller1(ref cs)); - 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); + Assert.True(caller1(ref cs)); + Assert.Equal(9999, cs.i); + Assert.False(cs.b); + Assert.Equal("Native", cs.str); + Assert.Equal(-1, cs.type.idata); + Assert.Equal(3.14159, cs.type.ddata); break; case StructID.InnerSequentialId: InnerSequential source_is = Helper.NewInnerSequential(1, 1.0F, "some string"); InnerSequential change_is = Helper.NewInnerSequential(77, 77.0F, "changed string"); Console.WriteLine("Calling DelegatePInvoke_MarshalStructInnerSequentialByRef_Cdecl..."); InnerSequentialByRefDelegateCdecl caller2 = Get_MarshalStructInnerSequentialByRef_Cdecl_FuncPtr(); - Assert.IsTrue(caller2(ref source_is)); - Assert.IsTrue(Helper.ValidateInnerSequential(source_is, change_is, "DelegatePInvoke_MarshalStructInnerSequentialByRef_Cdecl")); + Assert.True(caller2(ref source_is)); + Assert.True(Helper.ValidateInnerSequential(source_is, change_is, "DelegatePInvoke_MarshalStructInnerSequentialByRef_Cdecl")); break; case StructID.InnerArraySequentialId: InnerArraySequential source_ias = Helper.NewInnerArraySequential(1, 1.0F, "some string"); InnerArraySequential change_ias = Helper.NewInnerArraySequential(77, 77.0F, "changed string"); Console.WriteLine("Calling DelegatePInvoke_MarshalStructInnerArraySequentialByRef_Cdecl..."); InnerArraySequentialByRefDelegateCdecl caller3 = Get_MarshalStructInnerArraySequentialByRef_Cdecl_FuncPtr(); - Assert.IsTrue(caller3(ref source_ias)); - Assert.IsTrue(Helper.ValidateInnerArraySequential(source_ias, change_ias, "DelegatePInvoke_MarshalStructInnerArraySequentialByRef_Cdecl")); + Assert.True(caller3(ref source_ias)); + Assert.True(Helper.ValidateInnerArraySequential(source_ias, change_ias, "DelegatePInvoke_MarshalStructInnerArraySequentialByRef_Cdecl")); break; case StructID.CharSetAnsiSequentialId: CharSetAnsiSequential source_csas = Helper.NewCharSetAnsiSequential("some string", 'c'); CharSetAnsiSequential change_csas = Helper.NewCharSetAnsiSequential("change string", 'n'); Console.WriteLine("Calling DelegatePInvoke_MarshalStructCharSetAnsiSequentialByRef_Cdecl..."); CharSetAnsiSequentialByRefDelegateCdecl caller4 = Get_MarshalStructCharSetAnsiSequentialByRef_Cdecl_FuncPtr(); - Assert.IsTrue(caller4(ref source_csas)); - Assert.IsTrue(Helper.ValidateCharSetAnsiSequential(source_csas, change_csas, "DelegatePInvoke_MarshalStructCharSetAnsiSequentialByRef_Cdecl")); + Assert.True(caller4(ref source_csas)); + Assert.True(Helper.ValidateCharSetAnsiSequential(source_csas, change_csas, "DelegatePInvoke_MarshalStructCharSetAnsiSequentialByRef_Cdecl")); break; case StructID.CharSetUnicodeSequentialId: CharSetUnicodeSequential source_csus = Helper.NewCharSetUnicodeSequential("some string", 'c'); CharSetUnicodeSequential change_csus = Helper.NewCharSetUnicodeSequential("change string", 'n'); Console.WriteLine("Calling DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByRef_Cdecl..."); CharSetUnicodeSequentialByRefDelegateCdecl caller5 = Get_MarshalStructCharSetUnicodeSequentialByRef_Cdecl_FuncPtr(); - Assert.IsTrue(caller5(ref source_csus)); - Assert.IsTrue(Helper.ValidateCharSetUnicodeSequential(source_csus, change_csus, "DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByRef_Cdecl")); + Assert.True(caller5(ref source_csus)); + Assert.True(Helper.ValidateCharSetUnicodeSequential(source_csus, change_csus, "DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByRef_Cdecl")); break; case StructID.NumberSequentialId: - NumberSequential source_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue, + NumberSequential source_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, Int16.MinValue, UInt16.MaxValue, -1234567890, 1234567890, 32.0F, 3.2); NumberSequential change_ns = Helper.NewNumberSequential(0, 32, 0, 16, 0, 8, 0, 16, 0, 64, 64.0F, 6.4); Console.WriteLine("Calling DelegatePInvoke_MarshalStructNumberSequentialByRef_Cdecl..."); NumberSequentialByRefDelegateCdecl caller6 = Get_MarshalStructNumberSequentialByRef_Cdecl_FuncPtr(); - Assert.IsTrue(caller6(ref source_ns)); - Assert.IsTrue(Helper.ValidateNumberSequential(source_ns, change_ns, "DelegatePInvoke_MarshalStructNumberSequentialByRef_Cdecl")); + Assert.True(caller6(ref source_ns)); + Assert.True(Helper.ValidateNumberSequential(source_ns, change_ns, "DelegatePInvoke_MarshalStructNumberSequentialByRef_Cdecl")); break; case StructID.S3Id: int[] iarr = new int[256]; @@ -834,8 +834,8 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructI S3 changeS3 = Helper.NewS3(false, "change string", icarr); Console.WriteLine("Calling DelegatePInvoke_MarshalStructS3ByRef_Cdecl..."); S3ByRefDelegateCdecl caller7 = Get_MarshalStructS3ByRef_Cdecl_FuncPtr(); - Assert.IsTrue(caller7(ref sourceS3)); - Assert.IsTrue(Helper.ValidateS3(sourceS3, changeS3, "DelegatePInvoke_MarshalStructS3ByRef_Cdecl")); + Assert.True(caller7(ref sourceS3)); + Assert.True(Helper.ValidateS3(sourceS3, changeS3, "DelegatePInvoke_MarshalStructS3ByRef_Cdecl")); break; case StructID.S5Id: Enum1 enums = Enum1.e1; @@ -844,8 +844,8 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructI S5 changeS5 = Helper.NewS5(64, "change string", enumch); Console.WriteLine("Calling DelegatePInvoke_MarshalStructS5ByRef_Cdecl..."); S5ByRefDelegateCdecl caller8 = Get_MarshalStructS5ByRef_Cdecl_FuncPtr(); - Assert.IsTrue(caller8(ref sourceS5)); - Assert.IsTrue(Helper.ValidateS5(sourceS5, changeS5, "DelegatePInvoke_MarshalStructS5ByRef_Cdecl")); + Assert.True(caller8(ref sourceS5)); + Assert.True(Helper.ValidateS5(sourceS5, changeS5, "DelegatePInvoke_MarshalStructS5ByRef_Cdecl")); break; case StructID.StringStructSequentialAnsiId: strOne = new String('a', 512); @@ -854,8 +854,8 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructI StringStructSequentialAnsi change_sssa = Helper.NewStringStructSequentialAnsi(strTwo, strOne); Console.WriteLine("Calling DelegatePInvoke_MarshalStructStringStructSequentialAnsiByRef_Cdecl..."); StringStructSequentialAnsiByRefDelegateCdecl caller9 = Get_MarshalStructStringStructSequentialAnsiByRef_Cdecl_FuncPtr(); - Assert.IsTrue(caller9(ref source_sssa)); - Assert.IsTrue(Helper.ValidateStringStructSequentialAnsi(source_sssa, change_sssa, "DelegatePInvoke_MarshalStructStringStructSequentialAnsiByRef_Cdecl")); + Assert.True(caller9(ref source_sssa)); + Assert.True(Helper.ValidateStringStructSequentialAnsi(source_sssa, change_sssa, "DelegatePInvoke_MarshalStructStringStructSequentialAnsiByRef_Cdecl")); break; case StructID.StringStructSequentialUnicodeId: strOne = new String('a', 256); @@ -864,32 +864,32 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructI StringStructSequentialUnicode change_sssu = Helper.NewStringStructSequentialUnicode(strTwo, strOne); Console.WriteLine("Calling DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByRef_Cdecl..."); StringStructSequentialUnicodeByRefDelegateCdecl caller10 = Get_MarshalStructStringStructSequentialUnicodeByRef_Cdecl_FuncPtr(); - Assert.IsTrue(caller10(ref source_sssu)); - Assert.IsTrue(Helper.ValidateStringStructSequentialUnicode(source_sssu, change_sssu, "DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByRef_Cdecl")); + Assert.True(caller10(ref source_sssu)); + Assert.True(Helper.ValidateStringStructSequentialUnicode(source_sssu, change_sssu, "DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByRef_Cdecl")); break; case StructID.S8Id: S8 sourceS8 = Helper.NewS8("hello", true, 10, 128, 128, 32); S8 changeS8 = Helper.NewS8("world", false, 1, 256, 256, 64); Console.WriteLine("Calling DelegatePInvoke_MarshalStructS8ByRef_Cdecl..."); S8ByRefDelegateCdecl caller11 = Get_MarshalStructS8ByRef_Cdecl_FuncPtr(); - Assert.IsTrue(caller11(ref sourceS8)); - Assert.IsTrue(Helper.ValidateS8(sourceS8, changeS8, "DelegatePInvoke_MarshalStructS8ByRef_Cdecl")); + Assert.True(caller11(ref sourceS8)); + Assert.True(Helper.ValidateS8(sourceS8, changeS8, "DelegatePInvoke_MarshalStructS8ByRef_Cdecl")); break; case StructID.S9Id: S9 sourceS9 = Helper.NewS9(128, new TestDelegate1(testMethod)); S9 changeS9 = Helper.NewS9(256, null); Console.WriteLine("Calling DelegatePInvoke_MarshalStructS9ByRef_Cdecl..."); S9ByRefDelegateCdecl caller12 = Get_MarshalStructS9ByRef_Cdecl_FuncPtr(); - Assert.IsTrue(caller12(ref sourceS9)); - Assert.IsTrue(Helper.ValidateS9(sourceS9, changeS9, "DelegatePInvoke_MarshalStructS9ByRef_Cdecl")); + Assert.True(caller12(ref sourceS9)); + Assert.True(Helper.ValidateS9(sourceS9, changeS9, "DelegatePInvoke_MarshalStructS9ByRef_Cdecl")); break; case StructID.IncludeOuterIntergerStructSequentialId: IncludeOuterIntergerStructSequential sourceIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(32, 32); IncludeOuterIntergerStructSequential changeIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(64, 64); Console.WriteLine("Calling DelegatePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByRef_Cdecl..."); IncludeOuterIntergerStructSequentialByRefDelegateCdecl caller13 = Get_MarshalStructIncludeOuterIntergerStructSequentialByRef_Cdecl_FuncPtr(); - Assert.IsTrue(caller13(ref sourceIncludeOuterIntergerStructSequential)); - Assert.IsTrue(Helper.ValidateIncludeOuterIntergerStructSequential(sourceIncludeOuterIntergerStructSequential, + Assert.True(caller13(ref sourceIncludeOuterIntergerStructSequential)); + Assert.True(Helper.ValidateIncludeOuterIntergerStructSequential(sourceIncludeOuterIntergerStructSequential, changeIncludeOuterIntergerStructSequential, "DelegatePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByRef_Cdecl")); break; case StructID.S11Id: @@ -897,11 +897,11 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructI S11 changeS11 = Helper.NewS11((int*)(64), 64); Console.WriteLine("Calling DelegatePInvoke_MarshalStructS11ByRef_Cdecl..."); S11ByRefDelegateCdecl caller14 = Get_MarshalStructS11ByRef_Cdecl_FuncPtr(); - Assert.IsTrue(caller14(ref sourceS11)); - Assert.IsTrue(Helper.ValidateS11(sourceS11, changeS11, "DelegatePInvoke_MarshalStructS11ByRef_Cdecl")); + Assert.True(caller14(ref sourceS11)); + Assert.True(Helper.ValidateS11(sourceS11, changeS11, "DelegatePInvoke_MarshalStructS11ByRef_Cdecl")); break; default: - Assert.Fail("TestMethod_DelegatePInvoke_MarshalByRef_Cdecl:The structid (Managed Side) is wrong"); + Assert.True(false, "TestMethod_DelegatePInvoke_MarshalByRef_Cdecl:The structid (Managed Side) is wrong"); break; } } @@ -920,53 +920,53 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByRef_StdCall(Struc cs.type.idata = 123; cs.type.ptrdata = (IntPtr)0x120000; ComplexStructByRefDelegateStdCall caller1 = Get_MarshalStructComplexStructByRef_StdCall_FuncPtr(); - Assert.IsTrue(caller1(ref cs)); - 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); + Assert.True(caller1(ref cs)); + Assert.Equal(9999, cs.i); + Assert.False(cs.b); + Assert.Equal("Native", cs.str); + Assert.Equal(-1, cs.type.idata); + Assert.Equal(3.14159, cs.type.ddata); break; case StructID.InnerSequentialId: InnerSequential source_is = Helper.NewInnerSequential(1, 1.0F, "some string"); InnerSequential change_is = Helper.NewInnerSequential(77, 77.0F, "changed string"); Console.WriteLine("Calling DelegatePInvoke_MarshalStructInnerSequentialByRef_StdCall..."); InnerSequentialByRefDelegateStdCall caller2 = Get_MarshalStructInnerSequentialByRef_StdCall_FuncPtr(); - Assert.IsTrue(caller2(ref source_is)); - Assert.IsTrue(Helper.ValidateInnerSequential(source_is, change_is, "DelegatePInvoke_MarshalStructInnerSequentialByRef_StdCall")); + Assert.True(caller2(ref source_is)); + Assert.True(Helper.ValidateInnerSequential(source_is, change_is, "DelegatePInvoke_MarshalStructInnerSequentialByRef_StdCall")); break; case StructID.InnerArraySequentialId: InnerArraySequential source_ias = Helper.NewInnerArraySequential(1, 1.0F, "some string"); InnerArraySequential change_ias = Helper.NewInnerArraySequential(77, 77.0F, "changed string"); Console.WriteLine("Calling DelegatePInvoke_MarshalStructInnerArraySequentialByRef_StdCall..."); InnerArraySequentialByRefDelegateStdCall caller3 = Get_MarshalStructInnerArraySequentialByRef_StdCall_FuncPtr(); - Assert.IsTrue(caller3(ref source_ias)); - Assert.IsTrue(Helper.ValidateInnerArraySequential(source_ias, change_ias, "DelegatePInvoke_MarshalStructInnerArraySequentialByRef_StdCall")); + Assert.True(caller3(ref source_ias)); + Assert.True(Helper.ValidateInnerArraySequential(source_ias, change_ias, "DelegatePInvoke_MarshalStructInnerArraySequentialByRef_StdCall")); break; case StructID.CharSetAnsiSequentialId: CharSetAnsiSequential source_csas = Helper.NewCharSetAnsiSequential("some string", 'c'); CharSetAnsiSequential change_csas = Helper.NewCharSetAnsiSequential("change string", 'n'); Console.WriteLine("Calling DelegatePInvoke_MarshalStructCharSetAnsiSequentialByRef_StdCall..."); CharSetAnsiSequentialByRefDelegateStdCall caller4 = Get_MarshalStructCharSetAnsiSequentialByRef_StdCall_FuncPtr(); - Assert.IsTrue(caller4(ref source_csas)); - Assert.IsTrue(Helper.ValidateCharSetAnsiSequential(source_csas, change_csas, "DelegatePInvoke_MarshalStructCharSetAnsiSequentialByRef_StdCall")); + Assert.True(caller4(ref source_csas)); + Assert.True(Helper.ValidateCharSetAnsiSequential(source_csas, change_csas, "DelegatePInvoke_MarshalStructCharSetAnsiSequentialByRef_StdCall")); break; case StructID.CharSetUnicodeSequentialId: CharSetUnicodeSequential source_csus = Helper.NewCharSetUnicodeSequential("some string", 'c'); CharSetUnicodeSequential change_csus = Helper.NewCharSetUnicodeSequential("change string", 'n'); Console.WriteLine("Calling DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByRef_StdCall..."); CharSetUnicodeSequentialByRefDelegateStdCall caller5 = Get_MarshalStructCharSetUnicodeSequentialByRef_StdCall_FuncPtr(); - Assert.IsTrue(caller5(ref source_csus)); - Assert.IsTrue(Helper.ValidateCharSetUnicodeSequential(source_csus, change_csus, "DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByRef_StdCall")); + Assert.True(caller5(ref source_csus)); + Assert.True(Helper.ValidateCharSetUnicodeSequential(source_csus, change_csus, "DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByRef_StdCall")); break; case StructID.NumberSequentialId: - NumberSequential source_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue, + NumberSequential source_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, Int16.MinValue, UInt16.MaxValue, -1234567890, 1234567890, 32.0F, 3.2); NumberSequential change_ns = Helper.NewNumberSequential(0, 32, 0, 16, 0, 8, 0, 16, 0, 64, 64.0F, 6.4); Console.WriteLine("Calling DelegatePInvoke_MarshalStructNumberSequentialByRef_StdCall..."); NumberSequentialByRefDelegateStdCall caller6 = Get_MarshalStructNumberSequentialByRef_StdCall_FuncPtr(); - Assert.IsTrue(caller6(ref source_ns)); - Assert.IsTrue(Helper.ValidateNumberSequential(source_ns, change_ns, "DelegatePInvoke_MarshalStructNumberSequentialByRef_StdCall")); + Assert.True(caller6(ref source_ns)); + Assert.True(Helper.ValidateNumberSequential(source_ns, change_ns, "DelegatePInvoke_MarshalStructNumberSequentialByRef_StdCall")); break; case StructID.S3Id: int[] iarr = new int[256]; @@ -976,8 +976,8 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByRef_StdCall(Struc S3 changeS3 = Helper.NewS3(false, "change string", icarr); Console.WriteLine("Calling DelegatePInvoke_MarshalStructS3ByRef_StdCall..."); S3ByRefDelegateStdCall caller7 = Get_MarshalStructS3ByRef_StdCall_FuncPtr(); - Assert.IsTrue(caller7(ref sourceS3)); - Assert.IsTrue(Helper.ValidateS3(sourceS3, changeS3, "DelegatePInvoke_MarshalStructS3ByRef_StdCall")); + Assert.True(caller7(ref sourceS3)); + Assert.True(Helper.ValidateS3(sourceS3, changeS3, "DelegatePInvoke_MarshalStructS3ByRef_StdCall")); break; case StructID.S5Id: Enum1 enums = Enum1.e1; @@ -986,8 +986,8 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByRef_StdCall(Struc S5 changeS5 = Helper.NewS5(64, "change string", enumch); Console.WriteLine("Calling DelegatePInvoke_MarshalStructS5ByRef_StdCall..."); S5ByRefDelegateStdCall caller8 = Get_MarshalStructS5ByRef_StdCall_FuncPtr(); - Assert.IsTrue(caller8(ref sourceS5)); - Assert.IsTrue(Helper.ValidateS5(sourceS5, changeS5, "DelegatePInvoke_MarshalStructS5ByRef_StdCall")); + Assert.True(caller8(ref sourceS5)); + Assert.True(Helper.ValidateS5(sourceS5, changeS5, "DelegatePInvoke_MarshalStructS5ByRef_StdCall")); break; case StructID.StringStructSequentialAnsiId: strOne = new String('a', 512); @@ -996,8 +996,8 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByRef_StdCall(Struc StringStructSequentialAnsi change_sssa = Helper.NewStringStructSequentialAnsi(strTwo, strOne); Console.WriteLine("Calling DelegatePInvoke_MarshalStructStringStructSequentialAnsiByRef_StdCall..."); StringStructSequentialAnsiByRefDelegateStdCall caller9 = Get_MarshalStructStringStructSequentialAnsiByRef_StdCall_FuncPtr(); - Assert.IsTrue(caller9(ref source_sssa)); - Assert.IsTrue(Helper.ValidateStringStructSequentialAnsi(source_sssa, change_sssa, "DelegatePInvoke_MarshalStructStringStructSequentialAnsiByRef_StdCall")); + Assert.True(caller9(ref source_sssa)); + Assert.True(Helper.ValidateStringStructSequentialAnsi(source_sssa, change_sssa, "DelegatePInvoke_MarshalStructStringStructSequentialAnsiByRef_StdCall")); break; case StructID.StringStructSequentialUnicodeId: strOne = new String('a', 256); @@ -1006,32 +1006,32 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByRef_StdCall(Struc StringStructSequentialUnicode change_sssu = Helper.NewStringStructSequentialUnicode(strTwo, strOne); Console.WriteLine("Calling DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByRef_StdCall..."); StringStructSequentialUnicodeByRefDelegateStdCall caller10 = Get_MarshalStructStringStructSequentialUnicodeByRef_StdCall_FuncPtr(); - Assert.IsTrue(caller10(ref source_sssu)); - Assert.IsTrue(Helper.ValidateStringStructSequentialUnicode(source_sssu, change_sssu, "DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByRef_StdCall")); + Assert.True(caller10(ref source_sssu)); + Assert.True(Helper.ValidateStringStructSequentialUnicode(source_sssu, change_sssu, "DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByRef_StdCall")); break; case StructID.S8Id: S8 sourceS8 = Helper.NewS8("hello", true, 10, 128, 128, 32); S8 changeS8 = Helper.NewS8("world", false, 1, 256, 256, 64); Console.WriteLine("Calling DelegatePInvoke_MarshalStructS8ByRef_StdCall..."); S8ByRefDelegateStdCall caller11 = Get_MarshalStructS8ByRef_StdCall_FuncPtr(); - Assert.IsTrue(caller11(ref sourceS8)); - Assert.IsTrue(Helper.ValidateS8(sourceS8, changeS8, "DelegatePInvoke_MarshalStructS8ByRef_StdCall")); + Assert.True(caller11(ref sourceS8)); + Assert.True(Helper.ValidateS8(sourceS8, changeS8, "DelegatePInvoke_MarshalStructS8ByRef_StdCall")); break; case StructID.S9Id: S9 sourceS9 = Helper.NewS9(128, new TestDelegate1(testMethod)); S9 changeS9 = Helper.NewS9(256, null); Console.WriteLine("Calling DelegatePInvoke_MarshalStructS9ByRef_StdCall..."); S9ByRefDelegateStdCall caller12 = Get_MarshalStructS9ByRef_StdCall_FuncPtr(); - Assert.IsTrue(caller12(ref sourceS9)); - Assert.IsTrue(Helper.ValidateS9(sourceS9, changeS9, "DelegatePInvoke_MarshalStructS9ByRef_StdCall")); + Assert.True(caller12(ref sourceS9)); + Assert.True(Helper.ValidateS9(sourceS9, changeS9, "DelegatePInvoke_MarshalStructS9ByRef_StdCall")); break; case StructID.IncludeOuterIntergerStructSequentialId: IncludeOuterIntergerStructSequential sourceIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(32, 32); IncludeOuterIntergerStructSequential changeIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(64, 64); Console.WriteLine("Calling DelegatePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByRef_StdCall..."); IncludeOuterIntergerStructSequentialByRefDelegateStdCall caller13 = Get_MarshalStructIncludeOuterIntergerStructSequentialByRef_StdCall_FuncPtr(); - Assert.IsTrue(caller13(ref sourceIncludeOuterIntergerStructSequential)); - Assert.IsTrue(Helper.ValidateIncludeOuterIntergerStructSequential(sourceIncludeOuterIntergerStructSequential, + Assert.True(caller13(ref sourceIncludeOuterIntergerStructSequential)); + Assert.True(Helper.ValidateIncludeOuterIntergerStructSequential(sourceIncludeOuterIntergerStructSequential, changeIncludeOuterIntergerStructSequential, "DelegatePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByRef_StdCall")); break; case StructID.S11Id: @@ -1039,11 +1039,11 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByRef_StdCall(Struc S11 changeS11 = Helper.NewS11((int*)(64), 64); Console.WriteLine("Calling DelegatePInvoke_MarshalStructS11ByRef_StdCall..."); S11ByRefDelegateStdCall caller14 = Get_MarshalStructS11ByRef_StdCall_FuncPtr(); - Assert.IsTrue(caller14(ref sourceS11)); - Assert.IsTrue(Helper.ValidateS11(sourceS11, changeS11, "DelegatePInvoke_MarshalStructS11ByRef_StdCall")); + Assert.True(caller14(ref sourceS11)); + Assert.True(Helper.ValidateS11(sourceS11, changeS11, "DelegatePInvoke_MarshalStructS11ByRef_StdCall")); break; default: - Assert.Fail("TestMethod_DelegatePInvoke_MarshalByRef_StdCall:The structid (Managed Side) is wrong"); + Assert.True(false, "TestMethod_DelegatePInvoke_MarshalByRef_StdCall:The structid (Managed Side) is wrong"); break; } } @@ -1062,54 +1062,54 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructI cs.type.idata = 123; cs.type.ptrdata = (IntPtr)0x120000; ComplexStructByValDelegateCdecl caller1 = Get_MarshalStructComplexStructByVal_Cdecl_FuncPtr(); - Assert.IsTrue(caller1(cs)); - Assert.AreEqual(321, cs.i); - Assert.IsTrue(cs.b); - Assert.AreEqual("Managed", cs.str); - Assert.AreEqual(123, cs.type.idata); - Assert.AreEqual(0x120000, (int)cs.type.ptrdata); + Assert.True(caller1(cs)); + Assert.Equal(321, cs.i); + Assert.True(cs.b); + Assert.Equal("Managed", cs.str); + Assert.Equal(123, cs.type.idata); + Assert.Equal(0x120000, (int)cs.type.ptrdata); break; case StructID.InnerSequentialId: Console.WriteLine("Calling DelegatePInvoke_MarshalStructInnerSequentialByVal_Cdecl..."); InnerSequential source_is = Helper.NewInnerSequential(1, 1.0F, "some string"); InnerSequential clone_is1 = Helper.NewInnerSequential(1, 1.0F, "some string"); InnerSequentialByValDelegateCdecl caller2 = Get_MarshalStructInnerSequentialByVal_Cdecl_FuncPtr(); - Assert.IsTrue(caller2(source_is)); - Assert.IsTrue(Helper.ValidateInnerSequential(source_is, clone_is1, "DelegatePInvoke_MarshalStructInnerSequentialByVal_Cdecl")); + Assert.True(caller2(source_is)); + Assert.True(Helper.ValidateInnerSequential(source_is, clone_is1, "DelegatePInvoke_MarshalStructInnerSequentialByVal_Cdecl")); break; case StructID.InnerArraySequentialId: Console.WriteLine("Calling DelegatePInvoke_MarshalStructInnerArraySequentialByVal_Cdecl..."); InnerArraySequential source_ias = Helper.NewInnerArraySequential(1, 1.0F, "some string"); InnerArraySequential clone_ias = Helper.NewInnerArraySequential(1, 1.0F, "some string"); InnerArraySequentialByValDelegateCdecl caller3 = Get_MarshalStructInnerArraySequentialByVal_Cdecl_FuncPtr(); - Assert.IsTrue(caller3(source_ias)); - Assert.IsTrue(Helper.ValidateInnerArraySequential(source_ias, clone_ias, "DelegatePInvoke_MarshalStructInnerArraySequentialByVal_Cdecl")); + Assert.True(caller3(source_ias)); + Assert.True(Helper.ValidateInnerArraySequential(source_ias, clone_ias, "DelegatePInvoke_MarshalStructInnerArraySequentialByVal_Cdecl")); break; case StructID.CharSetAnsiSequentialId: Console.WriteLine("Calling DelegatePInvoke_MarshalStructCharSetAnsiSequentialByVal_Cdecl..."); CharSetAnsiSequential source_csas = Helper.NewCharSetAnsiSequential("some string", 'c'); CharSetAnsiSequential clone_csas = Helper.NewCharSetAnsiSequential("some string", 'c'); CharSetAnsiSequentialByValDelegateCdecl caller4 = Get_MarshalStructCharSetAnsiSequentialByVal_Cdecl_FuncPtr(); - Assert.IsTrue(caller4(source_csas)); - Assert.IsTrue(Helper.ValidateCharSetAnsiSequential(source_csas, clone_csas, "DelegatePInvoke_MarshalStructCharSetAnsiSequentialByVal_Cdecl")); + Assert.True(caller4(source_csas)); + Assert.True(Helper.ValidateCharSetAnsiSequential(source_csas, clone_csas, "DelegatePInvoke_MarshalStructCharSetAnsiSequentialByVal_Cdecl")); break; case StructID.CharSetUnicodeSequentialId: Console.WriteLine("Calling DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByVal_Cdecl..."); CharSetUnicodeSequential source_csus = Helper.NewCharSetUnicodeSequential("some string", 'c'); CharSetUnicodeSequential clone_csus = Helper.NewCharSetUnicodeSequential("some string", 'c'); CharSetUnicodeSequentialByValDelegateCdecl caller5 = Get_MarshalStructCharSetUnicodeSequentialByVal_Cdecl_FuncPtr(); - Assert.IsTrue(caller5(source_csus)); - Assert.IsTrue(Helper.ValidateCharSetUnicodeSequential(source_csus, clone_csus, "DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByVal_Cdecl")); + Assert.True(caller5(source_csus)); + Assert.True(Helper.ValidateCharSetUnicodeSequential(source_csus, clone_csus, "DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByVal_Cdecl")); break; case StructID.NumberSequentialId: Console.WriteLine("Calling DelegatePInvoke_MarshalStructNumberSequentialByVal_Cdecl..."); - NumberSequential source_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue, + NumberSequential source_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, Int16.MinValue, UInt16.MaxValue, -1234567890, 1234567890, 32.0F, 3.2); - NumberSequential clone_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue, + NumberSequential clone_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, Int16.MinValue, UInt16.MaxValue, -1234567890, 1234567890, 32.0F, 3.2); NumberSequentialByValDelegateCdecl caller6 = Get_MarshalStructNumberSequentialByVal_Cdecl_FuncPtr(); - Assert.IsTrue(caller6(source_ns)); - Assert.IsTrue(Helper.ValidateNumberSequential(source_ns, clone_ns, "DelegatePInvoke_MarshalStructNumberSequentialByVal_Cdecl")); + Assert.True(caller6(source_ns)); + Assert.True(Helper.ValidateNumberSequential(source_ns, clone_ns, "DelegatePInvoke_MarshalStructNumberSequentialByVal_Cdecl")); break; case StructID.S3Id: int[] iarr = new int[256]; @@ -1119,8 +1119,8 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructI S3 cloneS3 = Helper.NewS3(true, "some string", iarr); Console.WriteLine("Calling DelegatePInvoke_MarshalStructS3ByVal_Cdecl..."); S3ByValDelegateCdecl caller7 = Get_MarshalStructS3ByVal_Cdecl_FuncPtr(); - Assert.IsTrue(caller7(sourceS3)); - Assert.IsTrue(Helper.ValidateS3(sourceS3, cloneS3, "DelegatePInvoke_MarshalStructS3ByVal_Cdecl")); + Assert.True(caller7(sourceS3)); + Assert.True(Helper.ValidateS3(sourceS3, cloneS3, "DelegatePInvoke_MarshalStructS3ByVal_Cdecl")); break; case StructID.S5Id: Enum1 enums = Enum1.e1; @@ -1128,8 +1128,8 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructI S5 cloneS5 = Helper.NewS5(32, "some string", enums); Console.WriteLine("Calling DelegatePInvoke_MarshalStructS5ByVal_Cdecl..."); S5ByValDelegateCdecl caller8 = Get_MarshalStructS5ByVal_Cdecl_FuncPtr(); - Assert.IsTrue(caller8(sourceS5)); - Assert.IsTrue(Helper.ValidateS5(sourceS5, cloneS5, "DelegatePInvoke_MarshalStructS5ByVal_Cdecl")); + Assert.True(caller8(sourceS5)); + Assert.True(Helper.ValidateS5(sourceS5, cloneS5, "DelegatePInvoke_MarshalStructS5ByVal_Cdecl")); break; case StructID.StringStructSequentialAnsiId: strOne = new String('a', 512); @@ -1138,8 +1138,8 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructI StringStructSequentialAnsi clone_sssa = Helper.NewStringStructSequentialAnsi(strOne, strTwo); Console.WriteLine("Calling DelegatePInvoke_MarshalStructStringStructSequentialAnsiByVal_Cdecl..."); StringStructSequentialAnsiByValDelegateCdecl caller9 = Get_MarshalStructStringStructSequentialAnsiByVal_Cdecl_FuncPtr(); - Assert.IsTrue(caller9(source_sssa)); - Assert.IsTrue(Helper.ValidateStringStructSequentialAnsi(source_sssa, clone_sssa, "DelegatePInvoke_MarshalStructStringStructSequentialAnsiByVal_Cdecl")); + Assert.True(caller9(source_sssa)); + Assert.True(Helper.ValidateStringStructSequentialAnsi(source_sssa, clone_sssa, "DelegatePInvoke_MarshalStructStringStructSequentialAnsiByVal_Cdecl")); break; case StructID.StringStructSequentialUnicodeId: strOne = new String('a', 256); @@ -1148,32 +1148,32 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructI StringStructSequentialUnicode clone_sssu = Helper.NewStringStructSequentialUnicode(strOne, strTwo); Console.WriteLine("Calling DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByVal_Cdecl..."); StringStructSequentialUnicodeByValDelegateCdecl caller10 = Get_MarshalStructStringStructSequentialUnicodeByVal_Cdecl_FuncPtr(); - Assert.IsTrue(caller10(source_sssu)); - Assert.IsTrue(Helper.ValidateStringStructSequentialUnicode(source_sssu, clone_sssu, "DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByVal_Cdecl")); + Assert.True(caller10(source_sssu)); + Assert.True(Helper.ValidateStringStructSequentialUnicode(source_sssu, clone_sssu, "DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByVal_Cdecl")); break; case StructID.S8Id: S8 sourceS8 = Helper.NewS8("hello", true, 10, 128, 128, 32); S8 cloneS8 = Helper.NewS8("hello", true, 10, 128, 128, 32); Console.WriteLine("Calling DelegatePInvoke_MarshalStructS8ByVal_Cdecl..."); S8ByValDelegateCdecl caller11 = Get_MarshalStructS8ByVal_Cdecl_FuncPtr(); - Assert.IsTrue(caller11(sourceS8)); - Assert.IsTrue(Helper.ValidateS8(sourceS8, cloneS8, "DelegatePInvoke_MarshalStructS8ByVal_Cdecl")); + Assert.True(caller11(sourceS8)); + Assert.True(Helper.ValidateS8(sourceS8, cloneS8, "DelegatePInvoke_MarshalStructS8ByVal_Cdecl")); break; case StructID.S9Id: S9 sourceS9 = Helper.NewS9(128, new TestDelegate1(testMethod)); S9 cloneS9 = Helper.NewS9(128, new TestDelegate1(testMethod)); Console.WriteLine("Calling DelegatePInvoke_MarshalStructS9ByVal_Cdecl..."); S9ByValDelegateCdecl caller12 = Get_MarshalStructS9ByVal_Cdecl_FuncPtr(); - Assert.IsTrue(caller12(sourceS9)); - Assert.IsTrue(Helper.ValidateS9(sourceS9, cloneS9, "DelegatePInvoke_MarshalStructS9ByVal_Cdecl")); + Assert.True(caller12(sourceS9)); + Assert.True(Helper.ValidateS9(sourceS9, cloneS9, "DelegatePInvoke_MarshalStructS9ByVal_Cdecl")); break; case StructID.IncludeOuterIntergerStructSequentialId: IncludeOuterIntergerStructSequential sourceIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(32, 32); IncludeOuterIntergerStructSequential cloneIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(32, 32); Console.WriteLine("Calling DelegatePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByVal_Cdecl..."); IncludeOuterIntergerStructSequentialByValDelegateCdecl caller13 = Get_MarshalStructIncludeOuterIntergerStructSequentialByVal_Cdecl_FuncPtr(); - Assert.IsTrue(caller13(sourceIncludeOuterIntergerStructSequential)); - Assert.IsTrue(Helper.ValidateIncludeOuterIntergerStructSequential(sourceIncludeOuterIntergerStructSequential, + Assert.True(caller13(sourceIncludeOuterIntergerStructSequential)); + Assert.True(Helper.ValidateIncludeOuterIntergerStructSequential(sourceIncludeOuterIntergerStructSequential, cloneIncludeOuterIntergerStructSequential, "DelegatePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByVal_Cdecl")); break; case StructID.S11Id: @@ -1181,11 +1181,11 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructI S11 cloneS11 = Helper.NewS11((int*)(32), 32); Console.WriteLine("Calling DelegatePInvoke_MarshalStructS11ByVal_Cdecl..."); S11ByValDelegateCdecl caller14 = Get_MarshalStructS11ByVal_Cdecl_FuncPtr(); - Assert.IsTrue(caller14(sourceS11)); - Assert.IsTrue(Helper.ValidateS11(sourceS11, cloneS11, "DelegatePInvoke_MarshalStructS11ByVal_Cdecl")); + Assert.True(caller14(sourceS11)); + Assert.True(Helper.ValidateS11(sourceS11, cloneS11, "DelegatePInvoke_MarshalStructS11ByVal_Cdecl")); break; default: - Assert.Fail("TestMethod_DelegatePInvoke_MarshalByVal_Cdecl:The structid (Managed Side) is wrong"); + Assert.True(false, "TestMethod_DelegatePInvoke_MarshalByVal_Cdecl:The structid (Managed Side) is wrong"); break; } } @@ -1204,54 +1204,54 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByVal_StdCall(Struc cs.type.idata = 123; cs.type.ptrdata = (IntPtr)0x120000; ComplexStructByValDelegateStdCall caller1 = Get_MarshalStructComplexStructByVal_StdCall_FuncPtr(); - Assert.IsTrue(caller1(cs)); - Assert.AreEqual(321, cs.i); - Assert.IsTrue(cs.b); - Assert.AreEqual("Managed", cs.str); - Assert.AreEqual(123, cs.type.idata); - Assert.AreEqual(0x120000, (int)cs.type.ptrdata); + Assert.True(caller1(cs)); + Assert.Equal(321, cs.i); + Assert.True(cs.b); + Assert.Equal("Managed", cs.str); + Assert.Equal(123, cs.type.idata); + Assert.Equal(0x120000, (int)cs.type.ptrdata); break; case StructID.InnerSequentialId: Console.WriteLine("Calling DelegatePInvoke_MarshalStructInnerSequentialByVal_StdCall..."); InnerSequential source_is = Helper.NewInnerSequential(1, 1.0F, "some string"); InnerSequential clone_is1 = Helper.NewInnerSequential(1, 1.0F, "some string"); InnerSequentialByValDelegateStdCall caller2 = Get_MarshalStructInnerSequentialByVal_StdCall_FuncPtr(); - Assert.IsTrue(caller2(source_is)); - Assert.IsTrue(Helper.ValidateInnerSequential(source_is, clone_is1, "DelegatePInvoke_MarshalStructInnerSequentialByVal_StdCall")); + Assert.True(caller2(source_is)); + Assert.True(Helper.ValidateInnerSequential(source_is, clone_is1, "DelegatePInvoke_MarshalStructInnerSequentialByVal_StdCall")); break; case StructID.InnerArraySequentialId: Console.WriteLine("Calling DelegatePInvoke_MarshalStructInnerArraySequentialByVal_StdCall..."); InnerArraySequential source_ias = Helper.NewInnerArraySequential(1, 1.0F, "some string"); InnerArraySequential clone_ias = Helper.NewInnerArraySequential(1, 1.0F, "some string"); InnerArraySequentialByValDelegateStdCall caller3 = Get_MarshalStructInnerArraySequentialByVal_StdCall_FuncPtr(); - Assert.IsTrue(caller3(source_ias)); - Assert.IsTrue(Helper.ValidateInnerArraySequential(source_ias, clone_ias, "DelegatePInvoke_MarshalStructInnerArraySequentialByVal_StdCall")); + Assert.True(caller3(source_ias)); + Assert.True(Helper.ValidateInnerArraySequential(source_ias, clone_ias, "DelegatePInvoke_MarshalStructInnerArraySequentialByVal_StdCall")); break; case StructID.CharSetAnsiSequentialId: Console.WriteLine("Calling DelegatePInvoke_MarshalStructCharSetAnsiSequentialByVal_StdCall..."); CharSetAnsiSequential source_csas = Helper.NewCharSetAnsiSequential("some string", 'c'); CharSetAnsiSequential clone_csas = Helper.NewCharSetAnsiSequential("some string", 'c'); CharSetAnsiSequentialByValDelegateStdCall caller4 = Get_MarshalStructCharSetAnsiSequentialByVal_StdCall_FuncPtr(); - Assert.IsTrue(caller4(source_csas)); - Assert.IsTrue(Helper.ValidateCharSetAnsiSequential(source_csas, clone_csas, "DelegatePInvoke_MarshalStructCharSetAnsiSequentialByVal_StdCall")); + Assert.True(caller4(source_csas)); + Assert.True(Helper.ValidateCharSetAnsiSequential(source_csas, clone_csas, "DelegatePInvoke_MarshalStructCharSetAnsiSequentialByVal_StdCall")); break; case StructID.CharSetUnicodeSequentialId: Console.WriteLine("Calling DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByVal_StdCall..."); CharSetUnicodeSequential source_csus = Helper.NewCharSetUnicodeSequential("some string", 'c'); CharSetUnicodeSequential clone_csus = Helper.NewCharSetUnicodeSequential("some string", 'c'); CharSetUnicodeSequentialByValDelegateStdCall caller5 = Get_MarshalStructCharSetUnicodeSequentialByVal_StdCall_FuncPtr(); - Assert.IsTrue(caller5(source_csus)); - Assert.IsTrue(Helper.ValidateCharSetUnicodeSequential(source_csus, clone_csus, "DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByVal_StdCall")); + Assert.True(caller5(source_csus)); + Assert.True(Helper.ValidateCharSetUnicodeSequential(source_csus, clone_csus, "DelegatePInvoke_MarshalStructCharSetUnicodeSequentialByVal_StdCall")); break; case StructID.NumberSequentialId: Console.WriteLine("Calling DelegatePInvoke_MarshalStructNumberSequentialByVal_StdCall..."); - NumberSequential source_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue, + NumberSequential source_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, Int16.MinValue, UInt16.MaxValue, -1234567890, 1234567890, 32.0F, 3.2); - NumberSequential clone_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue, + NumberSequential clone_ns = Helper.NewNumberSequential(Int32.MinValue, UInt32.MaxValue, short.MinValue, ushort.MaxValue, byte.MinValue, sbyte.MaxValue, Int16.MinValue, UInt16.MaxValue, -1234567890, 1234567890, 32.0F, 3.2); NumberSequentialByValDelegateStdCall caller6 = Get_MarshalStructNumberSequentialByVal_StdCall_FuncPtr(); - Assert.IsTrue(caller6(source_ns)); - Assert.IsTrue(Helper.ValidateNumberSequential(source_ns, clone_ns, "DelegatePInvoke_MarshalStructNumberSequentialByVal_StdCall")); + Assert.True(caller6(source_ns)); + Assert.True(Helper.ValidateNumberSequential(source_ns, clone_ns, "DelegatePInvoke_MarshalStructNumberSequentialByVal_StdCall")); break; case StructID.S3Id: int[] iarr = new int[256]; @@ -1261,8 +1261,8 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByVal_StdCall(Struc S3 cloneS3 = Helper.NewS3(true, "some string", iarr); Console.WriteLine("Calling DelegatePInvoke_MarshalStructS3ByVal_StdCall..."); S3ByValDelegateStdCall caller7 = Get_MarshalStructS3ByVal_StdCall_FuncPtr(); - Assert.IsTrue(caller7(sourceS3)); - Assert.IsTrue(Helper.ValidateS3(sourceS3, cloneS3, "DelegatePInvoke_MarshalStructS3ByVal_StdCall")); + Assert.True(caller7(sourceS3)); + Assert.True(Helper.ValidateS3(sourceS3, cloneS3, "DelegatePInvoke_MarshalStructS3ByVal_StdCall")); break; case StructID.S5Id: Enum1 enums = Enum1.e1; @@ -1270,8 +1270,8 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByVal_StdCall(Struc S5 cloneS5 = Helper.NewS5(32, "some string", enums); Console.WriteLine("Calling DelegatePInvoke_MarshalStructS5ByVal_StdCall..."); S5ByValDelegateStdCall caller8 = Get_MarshalStructS5ByVal_StdCall_FuncPtr(); - Assert.IsTrue(caller8(sourceS5)); - Assert.IsTrue(Helper.ValidateS5(sourceS5, cloneS5, "DelegatePInvoke_MarshalStructS5ByVal_StdCall")); + Assert.True(caller8(sourceS5)); + Assert.True(Helper.ValidateS5(sourceS5, cloneS5, "DelegatePInvoke_MarshalStructS5ByVal_StdCall")); break; case StructID.StringStructSequentialAnsiId: strOne = new String('a', 512); @@ -1280,8 +1280,8 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByVal_StdCall(Struc StringStructSequentialAnsi clone_sssa = Helper.NewStringStructSequentialAnsi(strOne, strTwo); Console.WriteLine("Calling DelegatePInvoke_MarshalStructStringStructSequentialAnsiByVal_StdCall..."); StringStructSequentialAnsiByValDelegateStdCall caller9 = Get_MarshalStructStringStructSequentialAnsiByVal_StdCall_FuncPtr(); - Assert.IsTrue(caller9(source_sssa)); - Assert.IsTrue(Helper.ValidateStringStructSequentialAnsi(source_sssa, clone_sssa, "DelegatePInvoke_MarshalStructStringStructSequentialAnsiByVal_StdCall")); + Assert.True(caller9(source_sssa)); + Assert.True(Helper.ValidateStringStructSequentialAnsi(source_sssa, clone_sssa, "DelegatePInvoke_MarshalStructStringStructSequentialAnsiByVal_StdCall")); break; case StructID.StringStructSequentialUnicodeId: strOne = new String('a', 256); @@ -1290,32 +1290,32 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByVal_StdCall(Struc StringStructSequentialUnicode clone_sssu = Helper.NewStringStructSequentialUnicode(strOne, strTwo); Console.WriteLine("Calling DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByVal_StdCall..."); StringStructSequentialUnicodeByValDelegateStdCall caller10 = Get_MarshalStructStringStructSequentialUnicodeByVal_StdCall_FuncPtr(); - Assert.IsTrue(caller10(source_sssu)); - Assert.IsTrue(Helper.ValidateStringStructSequentialUnicode(source_sssu, clone_sssu, "DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByVal_StdCall")); + Assert.True(caller10(source_sssu)); + Assert.True(Helper.ValidateStringStructSequentialUnicode(source_sssu, clone_sssu, "DelegatePInvoke_MarshalStructStringStructSequentialUnicodeByVal_StdCall")); break; case StructID.S8Id: S8 sourceS8 = Helper.NewS8("hello", true, 10, 128, 128, 32); S8 cloneS8 = Helper.NewS8("hello", true, 10, 128, 128, 32); Console.WriteLine("Calling DelegatePInvoke_MarshalStructS8ByVal_StdCall..."); S8ByValDelegateStdCall caller11 = Get_MarshalStructS8ByVal_StdCall_FuncPtr(); - Assert.IsTrue(caller11(sourceS8)); - Assert.IsTrue(Helper.ValidateS8(sourceS8, cloneS8, "DelegatePInvoke_MarshalStructS8ByVal_StdCall")); + Assert.True(caller11(sourceS8)); + Assert.True(Helper.ValidateS8(sourceS8, cloneS8, "DelegatePInvoke_MarshalStructS8ByVal_StdCall")); break; case StructID.S9Id: S9 sourceS9 = Helper.NewS9(128, new TestDelegate1(testMethod)); S9 cloneS9 = Helper.NewS9(128, new TestDelegate1(testMethod)); Console.WriteLine("Calling DelegatePInvoke_MarshalStructS9ByVal_StdCall..."); S9ByValDelegateStdCall caller12 = Get_MarshalStructS9ByVal_StdCall_FuncPtr(); - Assert.IsTrue(caller12(sourceS9)); - Assert.IsTrue(Helper.ValidateS9(sourceS9, cloneS9, "DelegatePInvoke_MarshalStructS9ByVal_StdCall")); + Assert.True(caller12(sourceS9)); + Assert.True(Helper.ValidateS9(sourceS9, cloneS9, "DelegatePInvoke_MarshalStructS9ByVal_StdCall")); break; case StructID.IncludeOuterIntergerStructSequentialId: IncludeOuterIntergerStructSequential sourceIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(32, 32); IncludeOuterIntergerStructSequential cloneIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(32, 32); Console.WriteLine("Calling DelegatePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByVal_StdCall..."); IncludeOuterIntergerStructSequentialByValDelegateStdCall caller13 = Get_MarshalStructIncludeOuterIntergerStructSequentialByVal_StdCall_FuncPtr(); - Assert.IsTrue(caller13(sourceIncludeOuterIntergerStructSequential)); - Assert.IsTrue(Helper.ValidateIncludeOuterIntergerStructSequential(sourceIncludeOuterIntergerStructSequential, + Assert.True(caller13(sourceIncludeOuterIntergerStructSequential)); + Assert.True(Helper.ValidateIncludeOuterIntergerStructSequential(sourceIncludeOuterIntergerStructSequential, cloneIncludeOuterIntergerStructSequential, "DelegatePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByVal_StdCall")); break; case StructID.S11Id: @@ -1323,10 +1323,10 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByVal_StdCall(Struc S11 cloneS11 = Helper.NewS11((int*)(32), 32); Console.WriteLine("Calling DelegatePInvoke_MarshalStructS11ByVal_StdCall..."); S11ByValDelegateStdCall caller14 = Get_MarshalStructS11ByVal_StdCall_FuncPtr(); - Assert.IsTrue(caller14(sourceS11)); + Assert.True(caller14(sourceS11)); break; default: - Assert.Fail("TestMethod_DelegatePInvoke_MarshalByVal_StdCall:The structid (Managed Side) is wrong"); + Assert.True(false, "TestMethod_DelegatePInvoke_MarshalByVal_StdCall:The structid (Managed Side) is wrong"); break; } } @@ -1334,7 +1334,7 @@ unsafe private static void TestMethod_DelegatePInvoke_MarshalByVal_StdCall(Struc #endregion #region By Ref - + unsafe private static void Run_TestMethod_DelegatePInvoke_MarshalByRef_Cdecl() { TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructID.ComplexStructId); @@ -1352,7 +1352,7 @@ unsafe private static void Run_TestMethod_DelegatePInvoke_MarshalByRef_Cdecl() TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructID.IncludeOuterIntergerStructSequentialId); TestMethod_DelegatePInvoke_MarshalByRef_Cdecl(StructID.S11Id); } - + unsafe private static void Run_TestMethod_DelegatePInvoke_MarshalByRef_StdCall() { TestMethod_DelegatePInvoke_MarshalByRef_StdCall(StructID.ComplexStructId); @@ -1370,11 +1370,11 @@ unsafe private static void Run_TestMethod_DelegatePInvoke_MarshalByRef_StdCall() TestMethod_DelegatePInvoke_MarshalByRef_StdCall(StructID.IncludeOuterIntergerStructSequentialId); TestMethod_DelegatePInvoke_MarshalByRef_StdCall(StructID.S11Id); } - + #endregion #region By Value - + unsafe private static void Run_TestMethod_DelegatePInvoke_MarshalByVal_Cdecl() { TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructID.ComplexStructId); @@ -1392,7 +1392,7 @@ unsafe private static void Run_TestMethod_DelegatePInvoke_MarshalByVal_Cdecl() TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructID.IncludeOuterIntergerStructSequentialId); TestMethod_DelegatePInvoke_MarshalByVal_Cdecl(StructID.S11Id); } - + unsafe private static void Run_TestMethod_DelegatePInvoke_MarshalByVal_StdCall() { TestMethod_DelegatePInvoke_MarshalByVal_StdCall(StructID.ComplexStructId); @@ -1410,7 +1410,7 @@ unsafe private static void Run_TestMethod_DelegatePInvoke_MarshalByVal_StdCall() TestMethod_DelegatePInvoke_MarshalByVal_StdCall(StructID.IncludeOuterIntergerStructSequentialId); TestMethod_DelegatePInvoke_MarshalByVal_StdCall(StructID.S11Id); } - + #endregion static int Main() diff --git a/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest_.cs b/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest_.cs index 2e56b1b1cee869..3ef07668dd1313 100644 --- a/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest_.cs +++ b/src/tests/Interop/StructMarshalling/ReversePInvoke/MarshalSeqStruct/ReversePInvoke/ReversePInvokeTest_.cs @@ -5,7 +5,7 @@ using System.Text; using System.Security; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; public class MarshalStructTest { @@ -52,7 +52,7 @@ private static bool TestMethodForStructInnerSequential_ReversePInvokeByRef_Cdecl 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")); + Assert.True(Helper.ValidateInnerSequential(argstr, change_is, "TestMethodForStructInnerSequential_ReversePInvokeByRef_Cdecl")); //Chanage the value argstr.f1 = 1; argstr.f2 = 1.0F; @@ -67,7 +67,7 @@ private static bool TestMethodForStructInnerSequential_ReversePInvokeByRef_StdCa 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")); + Assert.True(Helper.ValidateInnerSequential(argstr, change_is, "TestMethodForStructInnerSequential_ReversePInvokeByRef_StdCall")); //Chanage the value argstr.f1 = 1; argstr.f2 = 1.0F; @@ -94,7 +94,7 @@ private static bool TestMethodForStructInnerSequential_ReversePInvokeByVal_Cdecl 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")); + Assert.True(Helper.ValidateInnerSequential(argstr, change_is, "TestMethodForStructInnerSequential_ReversePInvokeByVal_Cdecl")); //Chanage the value argstr.f1 = 1; argstr.f2 = 1.0F; @@ -109,7 +109,7 @@ private static bool TestMethodForStructInnerSequential_ReversePInvokeByVal_StdCa 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")); + Assert.True(Helper.ValidateInnerSequential(argstr, change_is, "TestMethodForStructInnerSequential_ReversePInvokeByVal_StdCall")); //Chanage the value argstr.f1 = 1; argstr.f2 = 1.0F; @@ -140,7 +140,7 @@ private static bool TestMethodForStructInnerArraySequential_ReversePInvokeByRef_ 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")); + Assert.True(Helper.ValidateInnerArraySequential(argstr, change_is, "TestMethodForStructInnerArraySequential_ReversePInvokeByRef_Cdecl")); //Chanage the value for (int i = 0; i < Common.NumArrElements; i++) { @@ -158,7 +158,7 @@ private static bool TestMethodForStructInnerArraySequential_ReversePInvokeByRef_ 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")); + Assert.True(Helper.ValidateInnerArraySequential(argstr, change_is, "TestMethodForStructInnerArraySequential_ReversePInvokeByRef_StdCall")); //Chanage the value for (int i = 0; i < Common.NumArrElements; i++) { @@ -189,7 +189,7 @@ private static bool TestMethodForStructInnerArraySequential_ReversePInvokeByVal_ 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")); + Assert.True(Helper.ValidateInnerArraySequential(argstr, change_is, "TestMethodForStructInnerArraySequential_ReversePInvokeByVal_Cdecl")); //Chanage the value for (int i = 0; i < Common.NumArrElements; i++) { @@ -207,7 +207,7 @@ private static bool TestMethodForStructInnerArraySequential_ReversePInvokeByVal_ 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")); + Assert.True(Helper.ValidateInnerArraySequential(argstr, change_is, "TestMethodForStructInnerArraySequential_ReversePInvokeByVal_StdCall")); //Chanage the value for (int i = 0; i < Common.NumArrElements; i++) { @@ -241,7 +241,7 @@ private static bool TestMethodForStructCharSetAnsiSequential_ReversePInvokeByRef 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")); + Assert.True(Helper.ValidateCharSetAnsiSequential(argstr, change_is, "TestMethodForStructCharSetAnsiSequential_ReversePInvokeByRef_Cdecl")); //Chanage the value argstr.f1 = "some string"; argstr.f2 = 'c'; @@ -255,7 +255,7 @@ private static bool TestMethodForStructCharSetAnsiSequential_ReversePInvokeByRef 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")); + Assert.True(Helper.ValidateCharSetAnsiSequential(argstr, change_is, "TestMethodForStructCharSetAnsiSequential_ReversePInvokeByRef_StdCall")); //Chanage the value argstr.f1 = "some string"; argstr.f2 = 'c'; @@ -281,7 +281,7 @@ private static bool TestMethodForStructCharSetAnsiSequential_ReversePInvokeByVal 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")); + Assert.True(Helper.ValidateCharSetAnsiSequential(argstr, change_is, "TestMethodForStructCharSetAnsiSequential_ReversePInvokeByVal_Cdecl")); //Chanage the value argstr.f1 = "some string"; argstr.f2 = 'c'; @@ -295,7 +295,7 @@ private static bool TestMethodForStructCharSetAnsiSequential_ReversePInvokeByVal 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")); + Assert.True(Helper.ValidateCharSetAnsiSequential(argstr, change_is, "TestMethodForStructCharSetAnsiSequential_ReversePInvokeByVal_StdCall")); //Chanage the value argstr.f1 = "some string"; argstr.f2 = 'c'; @@ -325,7 +325,7 @@ private static bool TestMethodForStructCharSetUnicodeSequential_ReversePInvokeBy 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")); + Assert.True(Helper.ValidateCharSetUnicodeSequential(argstr, change_is, "TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByRef_Cdecl")); //Chanage the value argstr.f1 = "some string"; argstr.f2 = 'c'; @@ -339,7 +339,7 @@ private static bool TestMethodForStructCharSetUnicodeSequential_ReversePInvokeBy 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")); + Assert.True(Helper.ValidateCharSetUnicodeSequential(argstr, change_is, "TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByRef_StdCall")); //Chanage the value argstr.f1 = "some string"; argstr.f2 = 'c'; @@ -365,7 +365,7 @@ private static bool TestMethodForStructCharSetUnicodeSequential_ReversePInvokeBy 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")); + Assert.True(Helper.ValidateCharSetUnicodeSequential(argstr, change_is, "TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByVal_Cdecl")); //Chanage the value argstr.f1 = "some string"; argstr.f2 = 'c'; @@ -379,7 +379,7 @@ private static bool TestMethodForStructCharSetUnicodeSequential_ReversePInvokeBy 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")); + Assert.True(Helper.ValidateCharSetUnicodeSequential(argstr, change_is, "TestMethodForStructCharSetUnicodeSequential_ReversePInvokeByVal_StdCall")); //Chanage the value argstr.f1 = "some string"; argstr.f2 = 'c'; @@ -409,7 +409,7 @@ private static bool TestMethodForStructNumberSequential_ReversePInvokeByRef_Cdec 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")); + Assert.True(Helper.ValidateNumberSequential(argstr, change_is, "TestMethodForStructNumberSequential_ReversePInvokeByRef_Cdecl")); //Chanage the value argstr.i32 = Int32.MinValue; argstr.ui32 = UInt32.MaxValue; @@ -433,7 +433,7 @@ private static bool TestMethodForStructNumberSequential_ReversePInvokeByRef_StdC 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")); + Assert.True(Helper.ValidateNumberSequential(argstr, change_is, "TestMethodForStructNumberSequential_ReversePInvokeByRef_StdCall")); //Chanage the value argstr.i32 = Int32.MinValue; argstr.ui32 = UInt32.MaxValue; @@ -469,7 +469,7 @@ private static NumberSequential TestMethodForStructNumberSequential_ReversePInvo 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")); + Assert.True(Helper.ValidateNumberSequential(argstr, change_is, "TestMethodForStructNumberSequential_ReversePInvokeByVal_Cdecl")); //Chanage the value argstr.i32 = Int32.MinValue; argstr.ui32 = UInt32.MaxValue; @@ -493,7 +493,7 @@ private static NumberSequential TestMethodForStructNumberSequential_ReversePInvo 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")); + Assert.True(Helper.ValidateNumberSequential(argstr, change_is, "TestMethodForStructNumberSequential_ReversePInvokeByVal_StdCall")); //Chanage the value argstr.i32 = Int32.MinValue; argstr.ui32 = UInt32.MaxValue; @@ -536,7 +536,7 @@ private static bool TestMethodForStructS3_ReversePInvokeByRef_Cdecl(ref S3 argst Helper.InitialArray(iarr, icarr); S3 changeS3 = Helper.NewS3(false, "change string", icarr); //Check the input - Assert.IsTrue(Helper.ValidateS3(argstr, changeS3, "TestMethodForStructS3_ReversePInvokeByRef_Cdecl")); + Assert.True(Helper.ValidateS3(argstr, changeS3, "TestMethodForStructS3_ReversePInvokeByRef_Cdecl")); //Chanage the value argstr.flag = true; argstr.str = "some string"; @@ -554,7 +554,7 @@ private static bool TestMethodForStructS3_ReversePInvokeByRef_StdCall(ref S3 arg Helper.InitialArray(iarr, icarr); S3 changeS3 = Helper.NewS3(false, "change string", icarr); //Check the input - Assert.IsTrue(Helper.ValidateS3(argstr, changeS3, "TestMethodForStructS3_ReversePInvokeByRef_Cdecl")); + Assert.True(Helper.ValidateS3(argstr, changeS3, "TestMethodForStructS3_ReversePInvokeByRef_Cdecl")); //Chanage the value argstr.flag = true; argstr.str = "some string"; @@ -584,7 +584,7 @@ private static bool TestMethodForStructS3_ReversePInvokeByVal_Cdecl(S3 argstr) Helper.InitialArray(iarr, icarr); S3 changeS3 = Helper.NewS3(false, "change string", icarr); //Check the input - Assert.IsTrue(Helper.ValidateS3(argstr, changeS3, "TestMethodForStructS3_ReversePInvokeByVal_Cdecl")); + Assert.True(Helper.ValidateS3(argstr, changeS3, "TestMethodForStructS3_ReversePInvokeByVal_Cdecl")); //Chanage the value argstr.flag = true; argstr.str = "some string"; @@ -602,7 +602,7 @@ private static bool TestMethodForStructS3_ReversePInvokeByVal_StdCall(S3 argstr) Helper.InitialArray(iarr, icarr); S3 changeS3 = Helper.NewS3(false, "change string", icarr); //Check the input - Assert.IsTrue(Helper.ValidateS3(argstr, changeS3, "TestMethodForStructS3_ReversePInvokeByVal_StdCall")); + Assert.True(Helper.ValidateS3(argstr, changeS3, "TestMethodForStructS3_ReversePInvokeByVal_StdCall")); //Chanage the value argstr.flag = true; argstr.str = "some string"; @@ -622,9 +622,9 @@ private static bool TestMethodForStructS3_ReversePInvokeByVal_StdCall(S3 argstr) #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); @@ -638,13 +638,13 @@ private static bool TestMethodForStructS5_ReversePInvokeByRef_Cdecl(ref S5 argst s4.name = "some string"; S5 changeS5 = Helper.NewS5(64, "change string", enumch); //Check the input - Assert.IsTrue(Helper.ValidateS5(argstr, changeS5, "TestMethodForStructS5_ReversePInvokeByRef_Cdecl")); + Assert.True(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) @@ -657,7 +657,7 @@ private static bool TestMethodForStructS5_ReversePInvokeByRef_StdCall(ref S5 arg s4.name = "some string"; S5 changeS5 = Helper.NewS5(64, "change string", enumch); //Check the input - Assert.IsTrue(Helper.ValidateS5(argstr, changeS5, "TestMethodForStructS5_ReversePInvokeByRef_StdCall")); + Assert.True(Helper.ValidateS5(argstr, changeS5, "TestMethodForStructS5_ReversePInvokeByRef_StdCall")); //Chanage the value argstr.s4 = s4; argstr.ef = enums; @@ -670,11 +670,11 @@ private static bool TestMethodForStructS5_ReversePInvokeByRef_StdCall(ref S5 arg //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); @@ -688,7 +688,7 @@ private static bool TestMethodForStructS5_ReversePInvokeByVal_Cdecl(S5 argstr) s4.name = "some string"; S5 changeS5 = Helper.NewS5(64, "change string", enumch); //Check the input - Assert.IsTrue(Helper.ValidateS5(argstr, changeS5, "TestMethodForStructS5_ReversePInvokeByVal_Cdecl")); + Assert.True(Helper.ValidateS5(argstr, changeS5, "TestMethodForStructS5_ReversePInvokeByVal_Cdecl")); //Chanage the value argstr.s4 = s4; argstr.ef = enums; @@ -707,7 +707,7 @@ private static bool TestMethodForStructS5_ReversePInvokeByVal_StdCall(S5 argstr) s4.name = "some string"; S5 changeS5 = Helper.NewS5(64, "change string", enumch); //Check the input - Assert.IsTrue(Helper.ValidateS5(argstr, changeS5, "TestMethodForStructS5_ReversePInvokeByVal_StdCall")); + Assert.True(Helper.ValidateS5(argstr, changeS5, "TestMethodForStructS5_ReversePInvokeByVal_StdCall")); //Chanage the value argstr.s4 = s4; argstr.ef = enums; @@ -720,15 +720,15 @@ private static bool TestMethodForStructS5_ReversePInvokeByVal_StdCall(S5 argstr) //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); @@ -739,13 +739,13 @@ private static bool TestMethodForStructStringStructSequentialAnsi_ReversePInvoke 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")); + Assert.True(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) @@ -755,7 +755,7 @@ private static bool TestMethodForStructStringStructSequentialAnsi_ReversePInvoke 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")); + Assert.True(Helper.ValidateStringStructSequentialAnsi(argstr, change_sssa, "TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByRef_StdCall")); //Chanage the value argstr.first = strOne; argstr.last = strTwo; @@ -768,11 +768,11 @@ private static bool TestMethodForStructStringStructSequentialAnsi_ReversePInvoke //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); @@ -783,7 +783,7 @@ private static bool TestMethodForStructStringStructSequentialAnsi_ReversePInvoke 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")); + Assert.True(Helper.ValidateStringStructSequentialAnsi(argstr, change_sssa, "TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByVal_Cdecl")); //Chanage the value argstr.first = strOne; argstr.last = strTwo; @@ -799,7 +799,7 @@ private static bool TestMethodForStructStringStructSequentialAnsi_ReversePInvoke 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")); + Assert.True(Helper.ValidateStringStructSequentialAnsi(argstr, change_sssa, "TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByVal_StdCall")); //Chanage the value argstr.first = strOne; argstr.last = strTwo; @@ -812,15 +812,15 @@ private static bool TestMethodForStructStringStructSequentialAnsi_ReversePInvoke //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); @@ -831,13 +831,13 @@ private static bool TestMethodForStructStringStructSequentialUnicode_ReversePInv 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")); + Assert.True(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) @@ -847,7 +847,7 @@ private static bool TestMethodForStructStringStructSequentialUnicode_ReversePInv 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")); + Assert.True(Helper.ValidateStringStructSequentialUnicode(argstr, change_sssa, "TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByRef_StdCall")); //Chanage the value argstr.first = strOne; argstr.last = strTwo; @@ -860,9 +860,9 @@ private static bool TestMethodForStructStringStructSequentialUnicode_ReversePInv //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)] @@ -874,7 +874,7 @@ private static bool TestMethodForStructStringStructSequentialUnicode_ReversePInv 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")); + Assert.True(Helper.ValidateStringStructSequentialUnicode(argstr, change_sssa, "TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByVal_Cdecl")); //Chanage the value argstr.first = strOne; argstr.last = strTwo; @@ -890,7 +890,7 @@ private static bool TestMethodForStructStringStructSequentialUnicode_ReversePInv 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")); + Assert.True(Helper.ValidateStringStructSequentialUnicode(argstr, change_sssa, "TestMethodForStructStringStructSequentialUnicode_ReversePInvokeByVal_StdCall")); //Chanage the value argstr.first = strOne; argstr.last = strTwo; @@ -903,15 +903,15 @@ private static bool TestMethodForStructStringStructSequentialUnicode_ReversePInv //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); @@ -920,7 +920,7 @@ private static bool TestMethodForStructS8_ReversePInvokeByRef_Cdecl(ref S8 argst 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")); + Assert.True(Helper.ValidateS8(argstr, changeS8, "TestMethodForStructS8_ReversePInvokeByRef_Cdecl")); //Chanage the value argstr.name = "hello"; argstr.gender = true; @@ -930,7 +930,7 @@ private static bool TestMethodForStructS8_ReversePInvokeByRef_Cdecl(ref S8 argst 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) @@ -938,7 +938,7 @@ private static bool TestMethodForStructS8_ReversePInvokeByRef_StdCall(ref S8 arg 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")); + Assert.True(Helper.ValidateS8(argstr, changeS8, "TestMethodForStructS8_ReversePInvokeByRef_Cdecl")); //Chanage the value argstr.name = "hello"; argstr.gender = true; @@ -955,11 +955,11 @@ private static bool TestMethodForStructS8_ReversePInvokeByRef_StdCall(ref S8 arg //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); @@ -968,7 +968,7 @@ 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")); + Assert.True(Helper.ValidateS8(argstr, changeS8, "TestMethodForStructS8_ReversePInvokeByVal_Cdecl")); //Chanage the value argstr.name = "hello"; argstr.gender = true; @@ -986,7 +986,7 @@ 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")); + Assert.True(Helper.ValidateS8(argstr, changeS8, "TestMethodForStructS8_ReversePInvokeByVal_StdCall")); //Chanage the value argstr.name = "hello"; argstr.gender = true; @@ -1003,15 +1003,15 @@ private static bool TestMethodForStructS8_ReversePInvokeByVal_StdCall(S8 argstr) //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); @@ -1020,13 +1020,13 @@ private static bool TestMethodForStructS9_ReversePInvokeByRef_Cdecl(ref S9 argst Console.WriteLine("ReversePinvoke,By Ref,Cdecl"); S9 changeS9 = Helper.NewS9(256, null); //Check the input - Assert.IsTrue(Helper.ValidateS9(argstr, changeS9, "TestMethodForStructS9_ReversePInvokeByRef_Cdecl")); + Assert.True(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) @@ -1034,7 +1034,7 @@ private static bool TestMethodForStructS9_ReversePInvokeByRef_StdCall(ref S9 arg Console.WriteLine("ReversePinvoke,By Ref,StdCall"); S9 changeS9 = Helper.NewS9(256, null); //Check the input - Assert.IsTrue(Helper.ValidateS9(argstr, changeS9, "TestMethodForStructS9_ReversePInvokeByRef_StdCall")); + Assert.True(Helper.ValidateS9(argstr, changeS9, "TestMethodForStructS9_ReversePInvokeByRef_StdCall")); //Chanage the value argstr.i32 = 128; argstr.myDelegate1 = new TestDelegate1(testMethod); @@ -1047,11 +1047,11 @@ private static bool TestMethodForStructS9_ReversePInvokeByRef_StdCall(ref S9 arg //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); @@ -1060,7 +1060,7 @@ 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")); + Assert.True(Helper.ValidateS9(argstr, changeS9, "TestMethodForStructS9_ReversePInvokeByVal_Cdecl")); //Chanage the value argstr.i32 = 128; argstr.myDelegate1 = new TestDelegate1(testMethod); @@ -1074,7 +1074,7 @@ 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")); + Assert.True(Helper.ValidateS9(argstr, changeS9, "TestMethodForStructS9_ReversePInvokeByVal_StdCall")); //Chanage the value argstr.i32 = 128; argstr.myDelegate1 = new TestDelegate1(testMethod); @@ -1087,15 +1087,15 @@ private static bool TestMethodForStructS9_ReversePInvokeByVal_StdCall(S9 argstr) //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); @@ -1104,14 +1104,14 @@ private static bool TestMethodForStructIncludeOuterIntergerStructSequential_Reve Console.WriteLine("ReversePinvoke,By Ref,Cdecl"); IncludeOuterIntergerStructSequential changeIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(64, 64); //Check the input - Assert.IsTrue(Helper.ValidateIncludeOuterIntergerStructSequential(argstr, + Assert.True(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) @@ -1119,7 +1119,7 @@ private static bool TestMethodForStructIncludeOuterIntergerStructSequential_Reve Console.WriteLine("ReversePinvoke,By Ref,StdCall"); IncludeOuterIntergerStructSequential changeIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(64, 64); //Check the input - Assert.IsTrue(Helper.ValidateIncludeOuterIntergerStructSequential(argstr, + Assert.True(Helper.ValidateIncludeOuterIntergerStructSequential(argstr, changeIncludeOuterIntergerStructSequential, "TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByRef_Cdecl")); //Chanage the value argstr.s.s_int.i = 32; @@ -1133,11 +1133,11 @@ private static bool TestMethodForStructIncludeOuterIntergerStructSequential_Reve //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); @@ -1146,7 +1146,7 @@ private static IncludeOuterIntergerStructSequential TestMethodForStructIncludeOu Console.WriteLine("ReversePinvoke,By Value,Cdecl"); IncludeOuterIntergerStructSequential changeIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(64, 64); //Check the input - Assert.IsTrue(Helper.ValidateIncludeOuterIntergerStructSequential(argstr, + Assert.True(Helper.ValidateIncludeOuterIntergerStructSequential(argstr, changeIncludeOuterIntergerStructSequential, "TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByVal_Cdecl")); //Chanage the value argstr.s.s_int.i = 32; @@ -1161,7 +1161,7 @@ private static IncludeOuterIntergerStructSequential TestMethodForStructIncludeOu Console.WriteLine("ReversePinvoke,By Value,StdCall"); IncludeOuterIntergerStructSequential changeIncludeOuterIntergerStructSequential = Helper.NewIncludeOuterIntergerStructSequential(64, 64); //Check the input - Assert.IsTrue(Helper.ValidateIncludeOuterIntergerStructSequential(argstr, + Assert.True(Helper.ValidateIncludeOuterIntergerStructSequential(argstr, changeIncludeOuterIntergerStructSequential, "TestMethodForStructIncludeOuterIntergerStructSequential_ReversePInvokeByVal_StdCall")); //Chanage the value argstr.s.s_int.i = 32; @@ -1175,15 +1175,15 @@ private static IncludeOuterIntergerStructSequential TestMethodForStructIncludeOu //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); @@ -1192,13 +1192,13 @@ unsafe private static bool TestMethodForStructS11_ReversePInvokeByRef_Cdecl(ref 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")); + Assert.True(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) @@ -1206,7 +1206,7 @@ unsafe private static bool TestMethodForStructS11_ReversePInvokeByRef_StdCall(re 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")); + Assert.True(Helper.ValidateS11(argstr, changeS11, "TestMethodForStructS11_ReversePInvokeByRef_StdCall")); //Chanage the value argstr.i32 = (int*)(32); argstr.i = 32; @@ -1219,11 +1219,11 @@ unsafe private static bool TestMethodForStructS11_ReversePInvokeByRef_StdCall(re //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); @@ -1232,7 +1232,7 @@ unsafe private static bool TestMethodForStructS11_ReversePInvokeByVal_Cdecl(S11 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")); + Assert.True(Helper.ValidateS11(argstr, changeS11, "TestMethodForStructS11_ReversePInvokeByVal_Cdecl")); //Chanage the value argstr.i32 = (int*)(32); argstr.i = 32; @@ -1246,7 +1246,7 @@ unsafe private static bool TestMethodForStructS11_ReversePInvokeByVal_StdCall(S1 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")); + Assert.True(Helper.ValidateS11(argstr, changeS11, "TestMethodForStructS11_ReversePInvokeByVal_StdCall")); //Chanage the value argstr.i32 = (int*)(32); argstr.i = 32; @@ -1259,15 +1259,15 @@ unsafe private static bool TestMethodForStructS11_ReversePInvokeByVal_StdCall(S1 //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); @@ -1275,11 +1275,11 @@ private static bool TestMethodForStructComplexStruct_ReversePInvokeByRef_Cdecl(r { 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); + Assert.Equal(9999, cs.i); + Assert.False(cs.b); + Assert.Equal("Native", cs.str); + Assert.Equal(-1, cs.type.idata); + Assert.Equal(3.14159, cs.type.ddata); //Chanage the value cs.i = 321; cs.b = true; @@ -1295,11 +1295,11 @@ private static bool TestMethodForStructComplexStruct_ReversePInvokeByRef_StdCall { 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); + Assert.Equal(9999, cs.i); + Assert.False(cs.b); + Assert.Equal("Native", cs.str); + Assert.Equal(-1, cs.type.idata); + Assert.Equal(3.14159, cs.type.ddata); //Chanage the value cs.i = 321; cs.b = true; @@ -1315,11 +1315,11 @@ private static bool TestMethodForStructComplexStruct_ReversePInvokeByRef_StdCall //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); @@ -1327,11 +1327,11 @@ private static bool TestMethodForStructComplexStruct_ReversePInvokeByVal_Cdecl(C { 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); + Assert.Equal(9999, cs.i); + Assert.False(cs.b); + Assert.Equal("Native", cs.str); + Assert.Equal(-1, cs.type.idata); + Assert.Equal(3.14159, cs.type.ddata); //Try to Chanage the value cs.i = 321; cs.b = true; @@ -1347,11 +1347,11 @@ private static bool TestMethodForStructComplexStruct_ReversePInvokeByVal_StdCall { 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); + Assert.Equal(9999, cs.i); + Assert.False(cs.b); + Assert.Equal("Native", cs.str); + Assert.Equal(-1, cs.type.idata); + Assert.Equal(3.14159, cs.type.ddata); //Try to Chanage the value cs.i = 321; cs.b = true; @@ -1367,7 +1367,7 @@ private static bool TestMethodForStructComplexStruct_ReversePInvokeByVal_StdCall //Reverse Pinvoke,stdcall [DllImport("SeqPInvokeNative", CallingConvention = CallingConvention.StdCall)] public static extern bool DoCallBack_MarshalStructComplexStructByVal_StdCall(ComplexStructByValStdCallcaller caller); - + #endregion #endregion @@ -1378,7 +1378,7 @@ public static ByteStruct3Byte TestMethod_DoCallBack_MarshalStructByVal_ByteStruc { 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")); + Assert.True(Helper.ValidateByteStruct3Byte(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByVal_ByteStruct3Byte_Cdecl")); //changed the value bspe.b1 = 7; bspe.b2 = 12; @@ -1386,7 +1386,7 @@ public static ByteStruct3Byte TestMethod_DoCallBack_MarshalStructByVal_ByteStruc success = true; return bspe; } - + [UnmanagedFunctionPointer(CallingConvention.StdCall)] public delegate ByteStruct3Byte ByValStdCallcaller_ByteStruct3Byte(ByteStruct3Byte bspe, [MarshalAs(UnmanagedType.Bool)] out bool success); @@ -1394,7 +1394,7 @@ public static ByteStruct3Byte TestMethod_DoCallBack_MarshalStructByVal_ByteStruc { 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")); + Assert.True(Helper.ValidateByteStruct3Byte(change_bspe, bspe, "TestMethod_DoCallBack_MarshalStructByVal_ByteStruct3Byte_StdCall")); //changed the value bspe.b1 = 7; bspe.b2 = 12; @@ -1418,7 +1418,7 @@ private static IntergerStructSequential TestMethodForStructIntergerStructSequent Console.WriteLine("ReversePinvoke,By Value,Cdecl"); IntergerStructSequential changeIntergerStructSequential = Helper.NewIntergerStructSequential(64); //Check the input - Assert.IsTrue(Helper.ValidateIntergerStructSequential(argstr, + Assert.True(Helper.ValidateIntergerStructSequential(argstr, changeIntergerStructSequential, "TestMethodForStructIntergerStructSequential_ReversePInvokeByVal_Cdecl")); //Chanage the value argstr.i = 32; @@ -1432,7 +1432,7 @@ private static IntergerStructSequential TestMethodForStructIntergerStructSequent Console.WriteLine("ReversePinvoke,By Value,StdCall"); IntergerStructSequential changeIntergerStructSequential = Helper.NewIntergerStructSequential(64); //Check the input - Assert.IsTrue(Helper.ValidateIntergerStructSequential(argstr, + Assert.True(Helper.ValidateIntergerStructSequential(argstr, changeIntergerStructSequential, "TestMethodForStructIntergerStructSequential_ReversePInvokeByVal_StdCall")); //Chanage the value argstr.i = 32; @@ -1447,7 +1447,7 @@ private static IntergerStructSequential TestMethodForStructIntergerStructSequent 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) { @@ -1455,68 +1455,68 @@ private static void TestMethod_DoCallBack_MarshalStructByRef_Cdecl(StructID stru { case StructID.ComplexStructId: Console.WriteLine("Calling ReversePInvoke_MarshalStructComplexStructByRef_Cdecl..."); - Assert.IsTrue(DoCallBack_MarshalStructComplexStructByRef_Cdecl(new ComplexStructByRefCdeclcaller(TestMethodForStructComplexStruct_ReversePInvokeByRef_Cdecl))); + Assert.True(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))); + Assert.True(DoCallBack_MarshalStructInnerSequentialByRef_Cdecl(new InnerSequentialByRefCdeclcaller(TestMethodForStructInnerSequential_ReversePInvokeByRef_Cdecl))); break; case StructID.InnerArraySequentialId: Console.WriteLine("Calling ReversePInvoke_MarshalStructInnerArraySequentialByRef_Cdecl..."); - Assert.IsTrue(DoCallBack_MarshalStructInnerArraySequentialByRef_Cdecl( + Assert.True(DoCallBack_MarshalStructInnerArraySequentialByRef_Cdecl( new InnerArraySequentialByRefCdeclcaller(TestMethodForStructInnerArraySequential_ReversePInvokeByRef_Cdecl))); break; case StructID.CharSetAnsiSequentialId: Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetAnsiSequentialByRef_Cdecl..."); - Assert.IsTrue(DoCallBack_MarshalStructCharSetAnsiSequentialByRef_Cdecl( + Assert.True(DoCallBack_MarshalStructCharSetAnsiSequentialByRef_Cdecl( new CharSetAnsiSequentialByRefCdeclcaller(TestMethodForStructCharSetAnsiSequential_ReversePInvokeByRef_Cdecl))); break; case StructID.CharSetUnicodeSequentialId: Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetUnicodeSequentialByRef_Cdecl..."); - Assert.IsTrue(DoCallBack_MarshalStructCharSetUnicodeSequentialByRef_Cdecl( + Assert.True(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))); + Assert.True(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))); + Assert.True(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))); + Assert.True(DoCallBack_MarshalStructS5ByRef_Cdecl(new S5ByRefCdeclcaller(TestMethodForStructS5_ReversePInvokeByRef_Cdecl))); break; case StructID.StringStructSequentialAnsiId: Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialAnsiByRef_Cdecl..."); - Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialAnsiByRef_Cdecl( + Assert.True(DoCallBack_MarshalStructStringStructSequentialAnsiByRef_Cdecl( new StringStructSequentialAnsiByRefCdeclcaller(TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByRef_Cdecl))); break; case StructID.StringStructSequentialUnicodeId: Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialUnicodeByRef_Cdecl..."); - Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialUnicodeByRef_Cdecl( + Assert.True(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))); + Assert.True(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))); + Assert.True(DoCallBack_MarshalStructS9ByRef_Cdecl(new S9ByRefCdeclcaller(TestMethodForStructS9_ReversePInvokeByRef_Cdecl))); break; case StructID.IncludeOuterIntergerStructSequentialId: Console.WriteLine("Calling ReversePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByRef_Cdecl..."); - Assert.IsTrue(DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByRef_Cdecl( + Assert.True(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))); + Assert.True(DoCallBack_MarshalStructS11ByRef_Cdecl(new S11ByRefCdeclcaller(TestMethodForStructS11_ReversePInvokeByRef_Cdecl))); break; default: - Assert.Fail("DoCallBack_MarshalStructByRef_Cdecl:The structid (Managed Side) is wrong"); + Assert.True(false, "DoCallBack_MarshalStructByRef_Cdecl:The structid (Managed Side) is wrong"); break; } } @@ -1527,68 +1527,68 @@ private static void TestMethod_DoCallBack_MarshalStructByRef_StdCall(StructID st { case StructID.ComplexStructId: Console.WriteLine("Calling ReversePInvoke_MarshalStructComplexStructByRef_StdCall..."); - Assert.IsTrue(DoCallBack_MarshalStructComplexStructByRef_StdCall(new ComplexStructByRefStdCallcaller(TestMethodForStructComplexStruct_ReversePInvokeByRef_StdCall))); + Assert.True(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))); + Assert.True(DoCallBack_MarshalStructInnerSequentialByRef_StdCall(new InnerSequentialByRefStdCallcaller(TestMethodForStructInnerSequential_ReversePInvokeByRef_StdCall))); break; case StructID.InnerArraySequentialId: Console.WriteLine("Calling ReversePInvoke_MarshalStructInnerArraySequentialByRef_StdCall..."); - Assert.IsTrue(DoCallBack_MarshalStructInnerArraySequentialByRef_StdCall( + Assert.True(DoCallBack_MarshalStructInnerArraySequentialByRef_StdCall( new InnerArraySequentialByRefStdCallcaller(TestMethodForStructInnerArraySequential_ReversePInvokeByRef_StdCall))); break; case StructID.CharSetAnsiSequentialId: Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetAnsiSequentialByRef_StdCall..."); - Assert.IsTrue(DoCallBack_MarshalStructCharSetAnsiSequentialByRef_StdCall( + Assert.True(DoCallBack_MarshalStructCharSetAnsiSequentialByRef_StdCall( new CharSetAnsiSequentialByRefStdCallcaller(TestMethodForStructCharSetAnsiSequential_ReversePInvokeByRef_StdCall))); break; case StructID.CharSetUnicodeSequentialId: Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetUnicodeSequentialByRef_StdCall..."); - Assert.IsTrue(DoCallBack_MarshalStructCharSetUnicodeSequentialByRef_StdCall( + Assert.True(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))); + Assert.True(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))); + Assert.True(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))); + Assert.True(DoCallBack_MarshalStructS5ByRef_StdCall(new S5ByRefStdCallcaller(TestMethodForStructS5_ReversePInvokeByRef_StdCall))); break; case StructID.StringStructSequentialAnsiId: Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialAnsiByRef_StdCall..."); - Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialAnsiByRef_StdCall( + Assert.True(DoCallBack_MarshalStructStringStructSequentialAnsiByRef_StdCall( new StringStructSequentialAnsiByRefStdCallcaller(TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByRef_StdCall))); break; case StructID.StringStructSequentialUnicodeId: Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialUnicodeByRef_StdCall..."); - Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialUnicodeByRef_StdCall( + Assert.True(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))); + Assert.True(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))); + Assert.True(DoCallBack_MarshalStructS9ByRef_StdCall(new S9ByRefStdCallcaller(TestMethodForStructS9_ReversePInvokeByRef_StdCall))); break; case StructID.IncludeOuterIntergerStructSequentialId: Console.WriteLine("Calling ReversePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByRef_StdCall..."); - Assert.IsTrue(DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByRef_StdCall( + Assert.True(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))); + Assert.True(DoCallBack_MarshalStructS11ByRef_StdCall(new S11ByRefStdCallcaller(TestMethodForStructS11_ReversePInvokeByRef_StdCall))); break; default: - Assert.Fail("DoCallBack_MarshalStructByRef_StdCall:The structid (Managed Side) is wrong"); + Assert.True(false, "DoCallBack_MarshalStructByRef_StdCall:The structid (Managed Side) is wrong"); break; } } @@ -1636,73 +1636,73 @@ private static void TestMethod_DoCallBack_MarshalStructByVal_Cdecl(StructID stru { case StructID.ComplexStructId: Console.WriteLine("Calling ReversePInvoke_MarshalStructComplexeStructByVal_Cdecl..."); - Assert.IsTrue(DoCallBack_MarshalStructComplexStructByVal_Cdecl(new ComplexStructByValCdeclcaller(TestMethodForStructComplexStruct_ReversePInvokeByVal_Cdecl))); + Assert.True(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))); + Assert.True(DoCallBack_MarshalStructInnerSequentialByVal_Cdecl(new InnerSequentialByValCdeclcaller(TestMethodForStructInnerSequential_ReversePInvokeByVal_Cdecl))); break; case StructID.InnerArraySequentialId: Console.WriteLine("Calling ReversePInvoke_MarshalStructInnerArraySequentialByVal_Cdecl..."); - Assert.IsTrue(DoCallBack_MarshalStructInnerArraySequentialByVal_Cdecl( + Assert.True(DoCallBack_MarshalStructInnerArraySequentialByVal_Cdecl( new InnerArraySequentialByValCdeclcaller(TestMethodForStructInnerArraySequential_ReversePInvokeByVal_Cdecl))); break; case StructID.CharSetAnsiSequentialId: Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetAnsiSequentialByVal_Cdecl..."); - Assert.IsTrue(DoCallBack_MarshalStructCharSetAnsiSequentialByVal_Cdecl + Assert.True(DoCallBack_MarshalStructCharSetAnsiSequentialByVal_Cdecl (new CharSetAnsiSequentialByValCdeclcaller(TestMethodForStructCharSetAnsiSequential_ReversePInvokeByVal_Cdecl))); break; case StructID.CharSetUnicodeSequentialId: Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetUnicodeSequentialByVal_Cdecl..."); - Assert.IsTrue(DoCallBack_MarshalStructCharSetUnicodeSequentialByVal_Cdecl( + Assert.True(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))); + Assert.True(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))); + Assert.True(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))); + Assert.True(DoCallBack_MarshalStructS5ByVal_Cdecl(new S5ByValCdeclcaller(TestMethodForStructS5_ReversePInvokeByVal_Cdecl))); break; case StructID.StringStructSequentialAnsiId: Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialAnsiByVal_Cdecl..."); - Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialAnsiByVal_Cdecl( + Assert.True(DoCallBack_MarshalStructStringStructSequentialAnsiByVal_Cdecl( new StringStructSequentialAnsiByValCdeclcaller(TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByVal_Cdecl))); break; case StructID.StringStructSequentialUnicodeId: Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialUnicodeByVal_Cdecl..."); - Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialUnicodeByVal_Cdecl( + Assert.True(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))); + Assert.True(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))); + Assert.True(DoCallBack_MarshalStructS9ByVal_Cdecl(new S9ByValCdeclcaller(TestMethodForStructS9_ReversePInvokeByVal_Cdecl))); break; case StructID.IncludeOuterIntergerStructSequentialId: Console.WriteLine("Calling ReversePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByVal_Cdecl..."); - Assert.IsTrue(DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByVal_Cdecl( + Assert.True(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))); + Assert.True(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( + Assert.True(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"); + Assert.True(false, "DoCallBack_MarshalStructByVal_Cdecl:The structid (Managed Side) is wrong"); break; } } @@ -1713,73 +1713,73 @@ private static void TestMethod_DoCallBack_MarshalStructByVal_StdCall(StructID st { case StructID.ComplexStructId: Console.WriteLine("Calling ReversePInvoke_MarshalStructComplexStructByVal_StdCall..."); - Assert.IsTrue(DoCallBack_MarshalStructComplexStructByVal_StdCall(new ComplexStructByValStdCallcaller(TestMethodForStructComplexStruct_ReversePInvokeByVal_StdCall))); + Assert.True(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))); + Assert.True(DoCallBack_MarshalStructInnerSequentialByVal_StdCall(new InnerSequentialByValStdCallcaller(TestMethodForStructInnerSequential_ReversePInvokeByVal_StdCall))); break; case StructID.InnerArraySequentialId: Console.WriteLine("Calling ReversePInvoke_MarshalStructInnerArraySequentialByVal_StdCall..."); - Assert.IsTrue(DoCallBack_MarshalStructInnerArraySequentialByVal_StdCall( + Assert.True(DoCallBack_MarshalStructInnerArraySequentialByVal_StdCall( new InnerArraySequentialByValStdCallcaller(TestMethodForStructInnerArraySequential_ReversePInvokeByVal_StdCall))); break; case StructID.CharSetAnsiSequentialId: Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetAnsiSequentialByVal_StdCall..."); - Assert.IsTrue(DoCallBack_MarshalStructCharSetAnsiSequentialByVal_StdCall( + Assert.True(DoCallBack_MarshalStructCharSetAnsiSequentialByVal_StdCall( new CharSetAnsiSequentialByValStdCallcaller(TestMethodForStructCharSetAnsiSequential_ReversePInvokeByVal_StdCall))); break; case StructID.CharSetUnicodeSequentialId: Console.WriteLine("Calling ReversePInvoke_MarshalStructCharSetUnicodeSequentialByVal_StdCall..."); - Assert.IsTrue(DoCallBack_MarshalStructCharSetUnicodeSequentialByVal_StdCall( + Assert.True(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))); + Assert.True(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))); + Assert.True(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))); + Assert.True(DoCallBack_MarshalStructS5ByVal_StdCall(new S5ByValStdCallcaller(TestMethodForStructS5_ReversePInvokeByVal_StdCall))); break; case StructID.StringStructSequentialAnsiId: Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialAnsiByVal_StdCall..."); - Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialAnsiByVal_StdCall( + Assert.True(DoCallBack_MarshalStructStringStructSequentialAnsiByVal_StdCall( new StringStructSequentialAnsiByValStdCallcaller(TestMethodForStructStringStructSequentialAnsi_ReversePInvokeByVal_StdCall))); break; case StructID.StringStructSequentialUnicodeId: Console.WriteLine("Calling ReversePInvoke_MarshalStructStringStructSequentialUnicodeByVal_StdCall..."); - Assert.IsTrue(DoCallBack_MarshalStructStringStructSequentialUnicodeByVal_StdCall( + Assert.True(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))); + Assert.True(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))); + Assert.True(DoCallBack_MarshalStructS9ByVal_StdCall(new S9ByValStdCallcaller(TestMethodForStructS9_ReversePInvokeByVal_StdCall))); break; case StructID.IncludeOuterIntergerStructSequentialId: Console.WriteLine("Calling ReversePInvoke_MarshalStructIncludeOuterIntergerStructSequentialByVal_StdCall..."); - Assert.IsTrue(DoCallBack_MarshalStructIncludeOuterIntergerStructSequentialByVal_StdCall( + Assert.True(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))); + Assert.True(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( + Assert.True(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"); + Assert.True(false, "DoCallBack_MarshalStructByVal_StdCall:The structid (Managed Side) is wrong"); break; } } @@ -1829,13 +1829,13 @@ private static void Run_TestMethod_DoCallBack_MarshalStructByVal_StdCall() 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(); diff --git a/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionTest.cs b/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionTest.cs index b33941eade4726..5d11f2743244f1 100644 --- a/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionTest.cs +++ b/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionTest.cs @@ -6,7 +6,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe static class SuppressGCTransitionNative { @@ -115,7 +115,7 @@ private static int Inline_NoGCTransition(int expected) Console.WriteLine($"{nameof(Inline_NoGCTransition)} ({expected}) ..."); int n; int ret = SuppressGCTransitionNative.NextUInt_Inline_NoGCTransition(&n); - Assert.AreEqual(expected, n); + Assert.Equal(expected, n); CheckGCMode.Validate(transitionSuppressed: true, ret); return n + 1; } @@ -125,7 +125,7 @@ private static int Inline_GCTransition(int expected) Console.WriteLine($"{nameof(Inline_GCTransition)} ({expected}) ..."); int n; int ret = SuppressGCTransitionNative.NextUInt_Inline_GCTransition(&n); - Assert.AreEqual(expected, n); + Assert.Equal(expected, n); CheckGCMode.Validate(transitionSuppressed: false, ret); return n + 1; } @@ -135,7 +135,7 @@ private static int NoInline_NoGCTransition(int expected) Console.WriteLine($"{nameof(NoInline_NoGCTransition)} ({expected}) ..."); int n; bool ret = SuppressGCTransitionNative.NextUInt_NoInline_NoGCTransition(&n); - Assert.AreEqual(expected, n); + Assert.Equal(expected, n); CheckGCMode.Validate(transitionSuppressed: true, ret); return n + 1; } @@ -145,7 +145,7 @@ private static int NoInline_GCTransition(int expected) Console.WriteLine($"{nameof(NoInline_GCTransition)} ({expected}) ..."); int n; bool ret = SuppressGCTransitionNative.NextUInt_NoInline_GCTransition(&n); - Assert.AreEqual(expected, n); + Assert.Equal(expected, n); CheckGCMode.Validate(transitionSuppressed: false, ret); return n + 1; } @@ -157,18 +157,18 @@ private static int Mixed(int expected) { bool ret = SuppressGCTransitionNative.NextUInt_NoInline_GCTransition(&n); - Assert.AreEqual(expected++, n); + Assert.Equal(expected++, n); CheckGCMode.Validate(transitionSuppressed: false, ret); ret = SuppressGCTransitionNative.NextUInt_NoInline_NoGCTransition(&n); - Assert.AreEqual(expected++, n); + Assert.Equal(expected++, n); CheckGCMode.Validate(transitionSuppressed: true, ret); } { int ret = SuppressGCTransitionNative.NextUInt_Inline_GCTransition(&n); - Assert.AreEqual(expected++, n); + Assert.Equal(expected++, n); CheckGCMode.Validate(transitionSuppressed: false, ret); ret = SuppressGCTransitionNative.NextUInt_Inline_NoGCTransition(&n); - Assert.AreEqual(expected++, n); + Assert.Equal(expected++, n); CheckGCMode.Validate(transitionSuppressed: true, ret); } return n + 1; @@ -187,7 +187,7 @@ private static int Mixed_TightLoop(int expected) // Use the non-optimized version at the end so a GC poll is not // inserted here as well. SuppressGCTransitionNative.NextUInt_NoInline_GCTransition(&n); - Assert.AreEqual(expected + count, n); + Assert.Equal(expected + count, n); return n + 1; } [MethodImpl(MethodImplOptions.NoInlining)] @@ -196,7 +196,7 @@ private static int Inline_NoGCTransition_FunctionPointer(int expected) Console.WriteLine($"{nameof(Inline_NoGCTransition)} ({expected}) ..."); int n; int ret = SuppressGCTransitionNative.GetNextUIntFunctionPointer_Inline_NoGCTransition()(&n); - Assert.AreEqual(expected, n); + Assert.Equal(expected, n); CheckGCMode.Validate(transitionSuppressed: true, ret); return n + 1; } @@ -206,7 +206,7 @@ private static int Inline_GCTransition_FunctionPointer(int expected) Console.WriteLine($"{nameof(Inline_GCTransition)} ({expected}) ..."); int n; int ret = SuppressGCTransitionNative.GetNextUIntFunctionPointer_Inline_GCTransition()(&n); - Assert.AreEqual(expected, n); + Assert.Equal(expected, n); CheckGCMode.Validate(transitionSuppressed: false, ret); return n + 1; } @@ -216,7 +216,7 @@ private static int NoInline_NoGCTransition_FunctionPointer(int expected) Console.WriteLine($"{nameof(NoInline_NoGCTransition)} ({expected}) ..."); int n; bool ret = SuppressGCTransitionNative.GetNextUIntFunctionPointer_NoInline_NoGCTransition()(&n); - Assert.AreEqual(expected, n); + Assert.Equal(expected, n); CheckGCMode.Validate(transitionSuppressed: true, ret); return n + 1; } @@ -226,7 +226,7 @@ private static int NoInline_GCTransition_FunctionPointer(int expected) Console.WriteLine($"{nameof(NoInline_GCTransition)} ({expected}) ..."); int n; bool ret = SuppressGCTransitionNative.GetNextUIntFunctionPointer_NoInline_GCTransition()(&n); - Assert.AreEqual(expected, n); + Assert.Equal(expected, n); CheckGCMode.Validate(transitionSuppressed: false, ret); return n + 1; } @@ -244,7 +244,7 @@ private static int CallAsFunctionPointer(int expected) MethodInfo callNextUInt = typeof(FunctionPointer).GetMethod("Call_NextUInt"); int ret = (int)callNextUInt.Invoke(null, new object[] { fptr, boxedN }); - Assert.AreEqual(expected, n); + Assert.Equal(expected, n); CheckGCMode.Validate(transitionSuppressed: false, ret); return n + 1; } @@ -273,7 +273,7 @@ private static int ILStubCache_NoGCTransition_GCTransition(int expected) // Call function with same (blittable) signature, but without SuppressGCTransition. // IL stub should not be re-used, GC transition should occur, and callback should be invoked. SuppressGCTransitionNative.InvokeCallbackFuncPtr_Inline_GCTransition(&ReturnInt, &n); - Assert.AreEqual(expected++, n); + Assert.Equal(expected++, n); // Call function that has SuppressGCTransition SuppressGCTransitionNative.InvokeCallbackFuncPtr_NoInline_NoGCTransition(null, null); @@ -281,7 +281,7 @@ private static int ILStubCache_NoGCTransition_GCTransition(int expected) // Call function with same (non-blittable) signature, but without SuppressGCTransition // IL stub should not be re-used, GC transition should occur, and callback should be invoked. SuppressGCTransitionNative.InvokeCallbackFuncPtr_NoInline_GCTransition(&ReturnInt, &n); - Assert.AreEqual(expected++, n); + Assert.Equal(expected++, n); return n + 1; } @@ -301,22 +301,22 @@ private static int ILStubCache_GCTransition_NoGCTransition(int expected) // Call function that does not have SuppressGCTransition SuppressGCTransitionNative.InvokeCallbackVoidPtr_Inline_GCTransition(cb, &n); - Assert.AreEqual(expected++, n); + Assert.Equal(expected++, n); // Call function with same (blittable) signature, but with SuppressGCTransition. // IL stub should not be re-used, GC transition not should occur, and callback invocation should fail. SuppressGCTransitionNative.InvokeCallbackVoidPtr_Inline_NoGCTransition(cb, &n); - Assert.AreEqual(expected++, n); + Assert.Equal(expected++, n); // Call function that does not have SuppressGCTransition SuppressGCTransitionNative.InvokeCallbackVoidPtr_NoInline_GCTransition(cb, &n); - Assert.AreEqual(expected++, n); + Assert.Equal(expected++, n); // Call function with same (non-blittable) signature, but with SuppressGCTransition // IL stub should not be re-used, GC transition not should occur, and callback invocation should fail. expected = n + 1; SuppressGCTransitionNative.InvokeCallbackVoidPtr_NoInline_NoGCTransition(cb, &n); - Assert.AreEqual(expected++, n); + Assert.Equal(expected++, n); return n + 1; } diff --git a/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionUtil.ilproj b/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionUtil.ilproj index b108bf0349deaa..0be14a6d2c935a 100644 --- a/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionUtil.ilproj +++ b/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionUtil.ilproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/UnmanagedCallConv/PInvokesCS.cs b/src/tests/Interop/UnmanagedCallConv/PInvokesCS.cs index 60dcc10d955c66..52e1d47e4f7223 100644 --- a/src/tests/Interop/UnmanagedCallConv/PInvokesCS.cs +++ b/src/tests/Interop/UnmanagedCallConv/PInvokesCS.cs @@ -8,7 +8,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Threading; -using TestLibrary; +using Xunit; public unsafe static class PInvokesCS { diff --git a/src/tests/Interop/UnmanagedCallConv/PInvokesIL.ilproj b/src/tests/Interop/UnmanagedCallConv/PInvokesIL.ilproj index 329b583c8965fe..1dfc7be2e6ca3c 100644 --- a/src/tests/Interop/UnmanagedCallConv/PInvokesIL.ilproj +++ b/src/tests/Interop/UnmanagedCallConv/PInvokesIL.ilproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/UnmanagedCallConv/UnmanagedCallConvTest.cs b/src/tests/Interop/UnmanagedCallConv/UnmanagedCallConvTest.cs index d6e0b16095731f..ff95372851fb37 100644 --- a/src/tests/Interop/UnmanagedCallConv/UnmanagedCallConvTest.cs +++ b/src/tests/Interop/UnmanagedCallConv/UnmanagedCallConvTest.cs @@ -5,7 +5,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Threading; -using TestLibrary; +using Xunit; public unsafe class Program { @@ -24,19 +24,19 @@ private static void DefaultDllImport_Blittable() Console.WriteLine($" -- default: UnmanagedCallConv()"); int b; PInvokesCS.DefaultDllImport.Default.Blittable_Double_DefaultUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- cdecl: UnmanagedCallConv(cdecl)"); int b; PInvokesCS.DefaultDllImport.Cdecl.Blittable_Double_CdeclUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- stdcall: UnmanagedCallConv(stdcall)"); int b; PInvokesCS.DefaultDllImport.Stdcall.Blittable_Double_StdcallUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } if (ValidateMismatch) @@ -56,19 +56,19 @@ private static void DefaultDllImport_NotBlittable() Console.WriteLine($" -- default: UnmanagedCallConv()"); int b; PInvokesCS.DefaultDllImport.Default.NotBlittable_Double_DefaultUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- cdecl: UnmanagedCallConv(cdecl)"); int b; PInvokesCS.DefaultDllImport.Cdecl.NotBlittable_Double_CdeclUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- stdcall: UnmanagedCallConv(stdcall)"); int b; PInvokesCS.DefaultDllImport.Stdcall.NotBlittable_Double_StdcallUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } if (ValidateMismatch) @@ -88,19 +88,19 @@ private static void WinapiDllImport_Blittable() Console.WriteLine($" -- default: UnmanagedCallConv()"); int b; PInvokesCS.WinapiDllImport.Default.Blittable_Double_DefaultUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- cdecl: UnmanagedCallConv(cdecl)"); int b; PInvokesCS.WinapiDllImport.Cdecl.Blittable_Double_CdeclUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- stdcall: UnmanagedCallConv(stdcall)"); int b; PInvokesCS.WinapiDllImport.Stdcall.Blittable_Double_StdcallUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } if (ValidateMismatch) @@ -120,19 +120,19 @@ private static void WinapiDllImport_NotBlittable() Console.WriteLine($" -- default: UnmanagedCallConv()"); int b; PInvokesCS.WinapiDllImport.Default.NotBlittable_Double_DefaultUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- cdecl: UnmanagedCallConv(cdecl)"); int b; PInvokesCS.WinapiDllImport.Cdecl.NotBlittable_Double_CdeclUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- stdcall: UnmanagedCallConv(stdcall)"); int b; PInvokesCS.WinapiDllImport.Stdcall.NotBlittable_Double_StdcallUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } if (ValidateMismatch) @@ -152,19 +152,19 @@ private static void UnsetPInvokeImpl_Blittable() Console.WriteLine($" -- default: UnmanagedCallConv()"); int b; PInvokesIL.UnsetPInvokeImpl.Default.Blittable_Double_DefaultUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- cdecl: UnmanagedCallConv(cdecl)"); int b; PInvokesIL.UnsetPInvokeImpl.Cdecl.Blittable_Double_CdeclUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- stdcall: UnmanagedCallConv(stdcall)"); int b; PInvokesIL.UnsetPInvokeImpl.Stdcall.Blittable_Double_StdcallUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } if (ValidateMismatch) @@ -184,19 +184,19 @@ private static void UnsetPInvokeImpl_NotBlittable() Console.WriteLine($" -- default: UnmanagedCallConv()"); int b; PInvokesIL.UnsetPInvokeImpl.Default.NotBlittable_Double_DefaultUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- cdecl: UnmanagedCallConv(cdecl)"); int b; PInvokesIL.UnsetPInvokeImpl.Cdecl.NotBlittable_Double_CdeclUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- stdcall: UnmanagedCallConv(stdcall)"); int b; PInvokesIL.UnsetPInvokeImpl.Stdcall.NotBlittable_Double_StdcallUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } if (ValidateMismatch) @@ -216,42 +216,42 @@ private static void SuppressGCTransition_Blittable() Console.WriteLine($" -- default: SuppressGCTransition, UnmanagedCallConv()"); int b; int ret = PInvokesCS.SuppressGCTransition.Default.Blittable_Double_DefaultUnmanagedCallConv_SuppressGCAttr(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); CheckGCMode.Validate(transitionSuppressed: true, ret); } { Console.WriteLine($" -- default: UnmanagedCallConv(suppressgctransition)"); int b; int ret = PInvokesCS.SuppressGCTransition.Default.Blittable_Double_DefaultUnmanagedCallConv_SuppressGC(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); CheckGCMode.Validate(transitionSuppressed: true, ret); } { Console.WriteLine($" -- cdecl: SuppressGCTransition, UnmanagedCallConv(cdecl)"); int b; int ret = PInvokesCS.SuppressGCTransition.Cdecl.Blittable_Double_CdeclUnmanagedCallConv_SuppressGCAttr(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); CheckGCMode.Validate(transitionSuppressed: true, ret); } { Console.WriteLine($" -- cdecl: UnmanagedCallConv(cdecl, suppressgctransition)"); int b; int ret = PInvokesCS.SuppressGCTransition.Cdecl.Blittable_Double_CdeclUnmanagedCallConv_SuppressGC(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); CheckGCMode.Validate(transitionSuppressed: true, ret); } { Console.WriteLine($" -- stdcall: SuppressGCTransition, UnmanagedCallConv(stdcall)"); int b; int ret = PInvokesCS.SuppressGCTransition.Stdcall.Blittable_Double_StdcallUnmanagedCallConv_SuppressGCAttr(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); CheckGCMode.Validate(transitionSuppressed: true, ret); } { Console.WriteLine($" -- stdcall: UnmanagedCallConv(stdcall, suppressgctransition)"); int b; int ret = PInvokesCS.SuppressGCTransition.Stdcall.Blittable_Double_StdcallUnmanagedCallConv_SuppressGC(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); CheckGCMode.Validate(transitionSuppressed: true, ret); } } @@ -266,42 +266,42 @@ private static void SuppressGCTransition_NotBlittable() Console.WriteLine($" -- default: SuppressGCTransition, UnmanagedCallConv()"); int b; bool ret = PInvokesCS.SuppressGCTransition.Default.NotBlittable_Double_DefaultUnmanagedCallConv_SuppressGCAttr(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); CheckGCMode.Validate(transitionSuppressed: true, ret); } { Console.WriteLine($" -- default: UnmanagedCallConv(suppressgctransition)"); int b; bool ret = PInvokesCS.SuppressGCTransition.Default.NotBlittable_Double_DefaultUnmanagedCallConv_SuppressGC(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); CheckGCMode.Validate(transitionSuppressed: true, ret); } { Console.WriteLine($" -- cdecl: SuppressGCTransition, UnmanagedCallConv(cdecl)"); int b; bool ret = PInvokesCS.SuppressGCTransition.Cdecl.NotBlittable_Double_CdeclUnmanagedCallConv_SuppressGCAttr(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); CheckGCMode.Validate(transitionSuppressed: true, ret); } { Console.WriteLine($" -- cdecl: UnmanagedCallConv(cdecl, suppressgctransition)"); int b; bool ret = PInvokesCS.SuppressGCTransition.Cdecl.NotBlittable_Double_CdeclUnmanagedCallConv_SuppressGC(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); CheckGCMode.Validate(transitionSuppressed: true, ret); } { Console.WriteLine($" -- stdcall: SuppressGCTransition, UnmanagedCallConv(stdcall)"); int b; bool ret = PInvokesCS.SuppressGCTransition.Stdcall.NotBlittable_Double_StdcallUnmanagedCallConv_SuppressGCAttr(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); CheckGCMode.Validate(transitionSuppressed: true, ret); } { Console.WriteLine($" -- stdcall: UnmanagedCallConv(stdcall, suppressgctransition)"); int b; bool ret = PInvokesCS.SuppressGCTransition.Stdcall.NotBlittable_Double_StdcallUnmanagedCallConv_SuppressGC(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); CheckGCMode.Validate(transitionSuppressed: true, ret); } } @@ -318,14 +318,14 @@ private static void MatchingDllImport_Blittable() Console.WriteLine($" -- cdecl: UnmanagedCallConv(stdcall)"); int b; PInvokesCS.MatchingDllImport.Cdecl.Blittable_Double_StdcallUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { // Should not suppress GC transition Console.WriteLine($" -- cdecl: UnmanagedCallConv(suppressgctransition)"); int b; int ret = PInvokesCS.MatchingDllImport.Cdecl.Blittable_Double_SuppressGCUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); CheckGCMode.Validate(transitionSuppressed: false, ret); } { @@ -333,14 +333,14 @@ private static void MatchingDllImport_Blittable() Console.WriteLine($" -- stdcall: UnmanagedCallConv(cdecl)"); int b; PInvokesCS.MatchingDllImport.Stdcall.Blittable_Double_CdeclUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { // Should not suppress GC transition Console.WriteLine($" -- stdcall: UnmanagedCallConv(suppressgctransition)"); int b; int ret = PInvokesCS.MatchingDllImport.Stdcall.Blittable_Double_SuppressGCUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); CheckGCMode.Validate(transitionSuppressed: false, ret); } } @@ -357,14 +357,14 @@ private static void MatchingDllImport_NotBlittable() Console.WriteLine($" -- cdecl: UnmanagedCallConv(stdcall)"); int b; PInvokesCS.MatchingDllImport.Cdecl.NotBlittable_Double_StdcallUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { // Should not suppress GC transition Console.WriteLine($" -- cdecl: UnmanagedCallConv(suppressgctransition)"); int b; bool ret = PInvokesCS.MatchingDllImport.Cdecl.NotBlittable_Double_SuppressGCUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); CheckGCMode.Validate(transitionSuppressed: false, ret); } { @@ -372,14 +372,14 @@ private static void MatchingDllImport_NotBlittable() Console.WriteLine($" -- stdcall: UnmanagedCallConv(cdecl)"); int b; PInvokesCS.MatchingDllImport.Stdcall.NotBlittable_Double_CdeclUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { // Should not suppress GC transition Console.WriteLine($" -- stdcall: UnmanagedCallConv(suppressgctransition)"); int b; bool ret = PInvokesCS.MatchingDllImport.Stdcall.NotBlittable_Double_SuppressGCUnmanagedCallConv(a, &b); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); CheckGCMode.Validate(transitionSuppressed: false, ret); } } diff --git a/src/tests/Interop/UnmanagedCallersOnly/InvalidCSharp.ilproj b/src/tests/Interop/UnmanagedCallersOnly/InvalidCSharp.ilproj index b7b8b4d7665382..5c2e0cc6ca7eb0 100644 --- a/src/tests/Interop/UnmanagedCallersOnly/InvalidCSharp.ilproj +++ b/src/tests/Interop/UnmanagedCallersOnly/InvalidCSharp.ilproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs b/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs index fe10e63cbf6100..5911af405e3f79 100644 --- a/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs +++ b/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs @@ -8,7 +8,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Threading; -using TestLibrary; +using Xunit; using InvalidCSharp; public unsafe class Program @@ -86,19 +86,19 @@ private static int DoubleImpl(int n) public static void TestUnmanagedCallersOnlyValid() { Console.WriteLine($"Running {nameof(TestUnmanagedCallersOnlyValid)}..."); - + int n = 12345; int expected = DoubleImpl(n); - Assert.AreEqual(expected, UnmanagedCallersOnlyDll.CallManagedProc((IntPtr)(delegate* unmanaged)&ManagedDoubleCallback, n)); + Assert.Equal(expected, UnmanagedCallersOnlyDll.CallManagedProc((IntPtr)(delegate* unmanaged)&ManagedDoubleCallback, n)); } public static void TestUnmanagedCallersOnlyValid_OnNewNativeThread() { Console.WriteLine($"Running {nameof(TestUnmanagedCallersOnlyValid_OnNewNativeThread)}..."); - + int n = 12345; int expected = DoubleImpl(n); - Assert.AreEqual(expected, UnmanagedCallersOnlyDll.CallManagedProcOnNewThread((IntPtr)(delegate* unmanaged)&ManagedDoubleCallback, n)); + Assert.Equal(expected, UnmanagedCallersOnlyDll.CallManagedProcOnNewThread((IntPtr)(delegate* unmanaged)&ManagedDoubleCallback, n)); } [UnmanagedCallersOnly] @@ -147,7 +147,7 @@ public static void TestUnmanagedCallersOnlyMultipleTimesValid() { expected += DoubleImpl(n); } - Assert.AreEqual(expected, UnmanagedCallersOnlyDll.CallManagedProcMultipleTimes(callCount, (IntPtr)(delegate* unmanaged)&ManagedDoubleInNativeCallback, n)); + Assert.Equal(expected, UnmanagedCallersOnlyDll.CallManagedProcMultipleTimes(callCount, (IntPtr)(delegate* unmanaged)&ManagedDoubleInNativeCallback, n)); } private const int CallbackThrowsErrorCode = 27; @@ -164,7 +164,7 @@ public static void TestUnmanagedCallersOnlyValid_ThrowException() int n = 12345; // Method should have thrown and caught an exception. - Assert.AreEqual(-1, UnmanagedCallersOnlyDll.CallManagedProcCatchException((IntPtr)(delegate* unmanaged)&CallbackThrows, n)); + Assert.Equal(-1, UnmanagedCallersOnlyDll.CallManagedProcCatchException((IntPtr)(delegate* unmanaged)&CallbackThrows, n)); } public static void NegativeTest_ViaDelegate() @@ -194,7 +194,7 @@ public static void NegativeTest_NonStaticMethod() [UnmanagedCallersOnly] public static int CallbackMethodNonBlittable(bool x1) { - Assert.Fail($"Functions with attribute {nameof(UnmanagedCallersOnlyAttribute)} cannot have non-blittable arguments"); + Assert.True(false, $"Functions with attribute {nameof(UnmanagedCallersOnlyAttribute)} cannot have non-blittable arguments"); return -1; } @@ -210,7 +210,7 @@ public static void NegativeTest_NonBlittable() public static void NegativeTest_InstantiatedGenericArguments() { Console.WriteLine($"Running {nameof(NegativeTest_InstantiatedGenericArguments)}..."); - + int n = 12345; // Try invoking method Assert.Throws(() => { UnmanagedCallersOnlyDll.CallManagedProc((IntPtr)(delegate* unmanaged)&Callbacks.CallbackMethodGeneric, n); }); @@ -228,7 +228,7 @@ public static void NegativeTest_FromInstantiatedGenericClass() [UnmanagedCallersOnly] public static void CallbackViaCalli(int val) { - Assert.Fail($"Functions with attribute {nameof(UnmanagedCallersOnlyAttribute)} cannot be called via calli"); + Assert.True(false, $"Functions with attribute {nameof(UnmanagedCallersOnlyAttribute)} cannot be called via calli"); } public static void NegativeTest_ViaCalli() @@ -259,7 +259,7 @@ public static void TestUnmanagedCallersOnlyViaUnmanagedCalli() int n = 1234; int expected = DoubleImpl(n); delegate* unmanaged[Stdcall] nativeMethod = &CallbackViaUnmanagedCalli; - Assert.AreEqual(expected, nativeMethod(n)); + Assert.Equal(expected, nativeMethod(n)); } [UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })] @@ -278,11 +278,11 @@ public static void TestUnmanagedCallersOnlyViaUnmanagedCalli_ThrowException() try { testNativeMethod(n); - Assert.Fail($"Function {nameof(CallbackViaUnmanagedCalliThrows)} should throw"); + Assert.True(false, $"Function {nameof(CallbackViaUnmanagedCalliThrows)} should throw"); } catch (Exception e) { - Assert.AreEqual(CallbackThrowsErrorCode, e.HResult); + Assert.Equal(CallbackThrowsErrorCode, e.HResult); } } diff --git a/src/tests/Interop/WinRT/Program.cs b/src/tests/Interop/WinRT/Program.cs index 9e03629e24302e..663f3c217a0766 100644 --- a/src/tests/Interop/WinRT/Program.cs +++ b/src/tests/Interop/WinRT/Program.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices.WindowsRuntime; -using TestLibrary; +using Xunit; namespace WinRT { diff --git a/src/tests/Interop/common/CheckGCMode.cs b/src/tests/Interop/common/CheckGCMode.cs index e3c6da3518aa33..b2e6c509726ccf 100644 --- a/src/tests/Interop/common/CheckGCMode.cs +++ b/src/tests/Interop/common/CheckGCMode.cs @@ -5,7 +5,7 @@ using System.Reflection; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe internal class CheckGCMode { @@ -29,7 +29,7 @@ internal static void Validate(bool transitionSuppressed, bool inCooperativeMode) if (!Enabled) return; - Assert.AreEqual(transitionSuppressed, inCooperativeMode, $"GC transition should{(transitionSuppressed ? "" : " not")} have been suppressed"); + Assert.Equal(transitionSuppressed, inCooperativeMode); } internal static void Validate(bool transitionSuppressed, int inCooperativeMode) diff --git a/src/tests/JIT/BBT/Scenario4/Not-Int32.il b/src/tests/JIT/BBT/Scenario4/Not-Int32.il index e21d6ab56c5e36..57aeda77878c80 100644 --- a/src/tests/JIT/BBT/Scenario4/Not-Int32.il +++ b/src/tests/JIT/BBT/Scenario4/Not-Int32.il @@ -3,6 +3,7 @@ // NOT Int32 Example in IL .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -15,6 +16,9 @@ { .method public static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 2 .locals init (int32 ReturnValue) diff --git a/src/tests/JIT/Directed/Convert/implicitConv.il b/src/tests/JIT/Directed/Convert/implicitConv.il index c4e810e0cad6ef..4c5f3f08267afd 100644 --- a/src/tests/JIT/Directed/Convert/implicitConv.il +++ b/src/tests/JIT/Directed/Convert/implicitConv.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly ILGEN_0xc60e022c {} .assembly extern mscorlib{auto} @@ -22,6 +23,9 @@ ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 15 diff --git a/src/tests/JIT/Directed/Convert/ldind_conv.il b/src/tests/JIT/Directed/Convert/ldind_conv.il index 3c19bb3b7c0cdb..d4b74a707c39e0 100644 --- a/src/tests/JIT/Directed/Convert/ldind_conv.il +++ b/src/tests/JIT/Directed/Convert/ldind_conv.il @@ -3,6 +3,7 @@ .assembly extern mscorlib { auto } +.assembly extern xunit.core {} .assembly extern System.Console { auto } .assembly extern System.Runtime { auto } @@ -20,6 +21,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 diff --git a/src/tests/JIT/Directed/Convert/minopts_convu1.il b/src/tests/JIT/Directed/Convert/minopts_convu1.il index 324f3e351c269a..38d0371754797a 100644 --- a/src/tests/JIT/Directed/Convert/minopts_convu1.il +++ b/src/tests/JIT/Directed/Convert/minopts_convu1.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly ILGEN_0xb0847955 {} .assembly extern mscorlib{auto} @@ -24,6 +25,9 @@ } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 23 diff --git a/src/tests/JIT/Directed/Convert/signed_overflow_conversions_are_not_treated_as_unsigned.il b/src/tests/JIT/Directed/Convert/signed_overflow_conversions_are_not_treated_as_unsigned.il index e79603733bb77d..6036a85b733a19 100644 --- a/src/tests/JIT/Directed/Convert/signed_overflow_conversions_are_not_treated_as_unsigned.il +++ b/src/tests/JIT/Directed/Convert/signed_overflow_conversions_are_not_treated_as_unsigned.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { auto } +.assembly extern xunit.core {} .assembly extern System.Runtime { auto } .assembly SignedOverflowConversionsAreNotTreatedAsUnsigned { } @@ -16,6 +17,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init ( diff --git a/src/tests/JIT/Directed/ExcepFilters/excepobj/excepobj.il b/src/tests/JIT/Directed/ExcepFilters/excepobj/excepobj.il index 8e06872edb657e..5a4c2092b7a0b2 100644 --- a/src/tests/JIT/Directed/ExcepFilters/excepobj/excepobj.il +++ b/src/tests/JIT/Directed/ExcepFilters/excepobj/excepobj.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -18,6 +19,9 @@ { .method public static int32 Main(class [mscorlib]System.String[] args) il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals (int32 V_0) diff --git a/src/tests/JIT/Directed/ExcepFilters/fault/fault.il b/src/tests/JIT/Directed/ExcepFilters/fault/fault.il index e53ccef69f3311..f1371d7af894cd 100644 --- a/src/tests/JIT/Directed/ExcepFilters/fault/fault.il +++ b/src/tests/JIT/Directed/ExcepFilters/fault/fault.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -16,6 +17,9 @@ { .method public static int32 Main(class [mscorlib]System.String[] args) il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 63 (0x3f) .maxstack 3 diff --git a/src/tests/JIT/Directed/ExcepFilters/mixed/mixed.il b/src/tests/JIT/Directed/ExcepFilters/mixed/mixed.il index c83b5b752a1fe8..80b3317272b99d 100644 --- a/src/tests/JIT/Directed/ExcepFilters/mixed/mixed.il +++ b/src/tests/JIT/Directed/ExcepFilters/mixed/mixed.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -51,6 +52,9 @@ { .method public static int32 Main(class [mscorlib]System.String[] args) il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 63 (0x3f) .maxstack 3 diff --git a/src/tests/JIT/Directed/ExcepFilters/mixed3/mixed3.il b/src/tests/JIT/Directed/ExcepFilters/mixed3/mixed3.il index 891fd2997f360f..33c3a76544c417 100644 --- a/src/tests/JIT/Directed/ExcepFilters/mixed3/mixed3.il +++ b/src/tests/JIT/Directed/ExcepFilters/mixed3/mixed3.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern legacy library mscorlib {} .assembly mixed3 @@ -19,6 +20,9 @@ .field public static int32 exitcode .method public static int32 Main(string[] args) il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 diff --git a/src/tests/JIT/Directed/FaultHandlers/CallOrder/CallOrder.il b/src/tests/JIT/Directed/FaultHandlers/CallOrder/CallOrder.il index e38fa0f5eb5423..a22fd8ceb87bbf 100644 --- a/src/tests/JIT/Directed/FaultHandlers/CallOrder/CallOrder.il +++ b/src/tests/JIT/Directed/FaultHandlers/CallOrder/CallOrder.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -110,6 +111,9 @@ .method public static int32 Main(class [mscorlib]System.String[]) il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals (int32) diff --git a/src/tests/JIT/Directed/FaultHandlers/Nesting/Nesting.il b/src/tests/JIT/Directed/FaultHandlers/Nesting/Nesting.il index be5735f954c9f0..c0b96691a33cf3 100644 --- a/src/tests/JIT/Directed/FaultHandlers/Nesting/Nesting.il +++ b/src/tests/JIT/Directed/FaultHandlers/Nesting/Nesting.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -25,6 +26,9 @@ { .method public static int32 Main(class [mscorlib]System.String[]) il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint //-------- BEGIN AUTO GENERATED CODE ----------// try_0: diff --git a/src/tests/JIT/Directed/FaultHandlers/Simple/simple.il b/src/tests/JIT/Directed/FaultHandlers/Simple/simple.il index 26368a9b602823..3b27e041c8be8b 100644 --- a/src/tests/JIT/Directed/FaultHandlers/Simple/simple.il +++ b/src/tests/JIT/Directed/FaultHandlers/Simple/simple.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -88,6 +89,9 @@ .method public static int32 Main(class [mscorlib]System.String[]) il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals (int32) diff --git a/src/tests/JIT/Directed/IL/Tailcall/ExplicitTailCallNoSO.il b/src/tests/JIT/Directed/IL/Tailcall/ExplicitTailCallNoSO.il index 203a08bfdfc202..c645cb7b1de126 100644 --- a/src/tests/JIT/Directed/IL/Tailcall/ExplicitTailCallNoSO.il +++ b/src/tests/JIT/Directed/IL/Tailcall/ExplicitTailCallNoSO.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: .ver 4:2:1:0 } +.assembly extern xunit.core {} .assembly ExplicitTailCallNoSO { } @@ -15,6 +16,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 44 (0x2c) .maxstack 2 diff --git a/src/tests/JIT/Directed/IL/Tailcall/Jittailcall2.il b/src/tests/JIT/Directed/IL/Tailcall/Jittailcall2.il index fd08a8eb35e5d8..2249a55d754513 100644 --- a/src/tests/JIT/Directed/IL/Tailcall/Jittailcall2.il +++ b/src/tests/JIT/Directed/IL/Tailcall/Jittailcall2.il @@ -5,12 +5,13 @@ .module 'aaa.exe' .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly 'aaa'// as "aaa.exe" +.assembly 'aaa'// as "aaa" { @@ -169,6 +170,9 @@ .method public static int32 Main(class [mscorlib]System.String[] Args) il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 117 (0x75) .maxstack 4 diff --git a/src/tests/JIT/Directed/LoopAlignment/LoopsToProcess.cs b/src/tests/JIT/Directed/LoopAlignment/LoopsToProcess.cs new file mode 100644 index 00000000000000..981e310f1a9b8d --- /dev/null +++ b/src/tests/JIT/Directed/LoopAlignment/LoopsToProcess.cs @@ -0,0 +1,141 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// Note: This test case is found by Antigen. It catches a scenario where we were not accounting +// for total loop candidates to align. +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +public class TestClass_Loops +{ + public struct S1 + { + public struct S1_D1_F1 + { + public decimal decimal_0; + } + public long long_1; + } + public struct S2 + { + public decimal decimal_2; + } + static byte s_byte_4 = 1; + static decimal s_decimal_6 = 5.1428571428571428571428571429m; + static short s_short_8 = 5; + static sbyte s_sbyte_11 = -1; + static ulong s_ulong_16 = 2; + static S1.S1_D1_F1 s_s1_s1_d1_f1_17 = new S1.S1_D1_F1(); + static S1 s_s1_18 = new S1(); + static S2 s_s2_19 = new S2(); + byte byte_21 = 5; + decimal decimal_23 = -1.987654320987654320987654321m; + short short_25 = 0; + long long_27 = 5; + float float_29 = -0.9423077f; + S1 s1_35 = new S1(); + S2 s2_36 = new S2(); + + [MethodImpl(MethodImplOptions.NoInlining)] + public decimal LeafMethod3() + { + return 0.5m; + } + + public float LeafMethod9() + { + return 0.5f; + } + + public uint LeafMethod12() + { + return 1; + } + + public ulong Method18(S2 p_s2_492, ref decimal p_decimal_493, out uint p_uint_494, ref float p_float_495, ref int p_int_496, short p_short_497, out uint p_uint_498, ref S1 p_s1_499) + { + p_uint_498 = (uint)10; + p_uint_494=0; + return 5; + } + + public float Method21(ref S1 p_s1_565, ref byte p_byte_566, S2 p_s2_567, ref S1 p_s1_568, ref S1.S1_D1_F1 p_s1_s1_d1_f1_569, S1 p_s1_570, out S1.S1_D1_F1 p_s1_s1_d1_f1_571, ref S2 p_s2_572) + { + p_s1_s1_d1_f1_571 = s_s1_s1_d1_f1_17; + return -4.928571f; + } + + public S2 Method35(ref S1 p_s1_952, ref sbyte p_sbyte_953, ref S1.S1_D1_F1 p_s1_s1_d1_f1_954) + { + unchecked + { + S2 s2_971 = new S2(); + return s2_36; + } + } + + public S1 Method60(ref decimal p_decimal_1639, out float p_float_1640, ref byte p_byte_1641, out S2 p_s2_1642, S1.S1_D1_F1 p_s1_s1_d1_f1_1643, ref S1 p_s1_1644, out S2 p_s2_1645, S2 p_s2_1646, ref ulong p_ulong_1647, out ulong p_ulong_1648, ref S2 p_s2_1649, out S2 p_s2_1650) + { + unchecked + { + char char_1653 = '5'; + decimal decimal_1654 = 5.0333333333333333333333333333m; + double double_1655 = 1; + short short_1656 = 1; + int int_1657 = -1; + float float_1660 = 5.090909f; + uint uint_1663 = 5; + S1.S1_D1_F1 s1_s1_d1_f1_1665 = new S1.S1_D1_F1(); + S1 s1_1666 = new S1(); + S2 s2_1667 = new S2(); + S2 s2_1668 = s2_1667; + p_float_1640 = ((float)(((float)(float_1660 /= ((float)((((float)(float_29 - ((float)(LeafMethod9() * float_1660))))) + 89)))) % ((float)((Method21(ref s1_35, ref s_byte_4, s_s2_19, ref s1_35, ref p_s1_s1_d1_f1_1643, s_s1_18, out s_s1_s1_d1_f1_17, ref s2_1667)) + 45)))); + p_s2_1642 = s2_36; + p_s2_1645 = s_s2_19; + p_ulong_1648 = Method18(s2_36, ref decimal_23, out uint_1663, ref p_float_1640, ref int_1657, ((short)(short_1656 % ((short)((((short)(short_25 - s_short_8))) + 35)))), out uint_1663, ref s_s1_18); + p_s2_1650 = s2_36; + switch (((char)(char_1653 = 'M'))) + { + case 'Y': + { + S1 s1_1669 = s_s1_18; + break; + } + case 'I': + { + break; + } + case 'J': + { + long_27 >>= int_1657; + s1_s1_d1_f1_1665.decimal_0 %= ((decimal)((((decimal)(((decimal)(s_s2_19.decimal_2 += ((decimal)(((decimal)(decimal_1654 - -1.9841269841269841269841269841m)) + ((decimal)(s_decimal_6 *= s2_1668.decimal_2)))))) * ((decimal)(s_s2_19.decimal_2 *= ((decimal)(s2_36.decimal_2 += ((decimal)(LeafMethod3() + LeafMethod3()))))))))) + 40)); + break; + } + default: + { + Method35(ref s1_35, ref s_sbyte_11, ref s_s1_s1_d1_f1_17); + break; + } + } + return p_s1_1644; + } + } + + public void Method0() + { + unchecked + { + ulong ulong_2733 = 37; + S1.S1_D1_F1 s1_s1_d1_f1_2734 = new S1.S1_D1_F1(); + S1 s1_2735 = new S1(); + S1 s1_2736 = s1_2735; + S2 s2_2737 = new S2(); + s_s1_18 = Method60(ref s2_2737.decimal_2, out float_29, ref byte_21, out s_s2_19, s1_s1_d1_f1_2734, ref s_s1_18, out s_s2_19, s2_2737, ref ulong_2733, out s_ulong_16, ref s2_2737, out s2_2737); + return; + } + } + public static void Main(string[] args) + { + new TestClass_Loops().Method0(); + } +} \ No newline at end of file diff --git a/src/tests/JIT/Directed/LoopAlignment/LoopsToProcess.csproj b/src/tests/JIT/Directed/LoopAlignment/LoopsToProcess.csproj new file mode 100644 index 00000000000000..827af187c65710 --- /dev/null +++ b/src/tests/JIT/Directed/LoopAlignment/LoopsToProcess.csproj @@ -0,0 +1,22 @@ + + + Exe + 1 + + + True + + + + + + + + + diff --git a/src/tests/JIT/Directed/PREFIX/unaligned/1/arglist.il b/src/tests/JIT/Directed/PREFIX/unaligned/1/arglist.il index 7559a8c6cfc179..99ddad161eb97b 100644 --- a/src/tests/JIT/Directed/PREFIX/unaligned/1/arglist.il +++ b/src/tests/JIT/Directed/PREFIX/unaligned/1/arglist.il @@ -19,7 +19,7 @@ arg1==arg4, arg2==arg5, arg3==arg6. */ .assembly extern legacy library mscorlib {} -.assembly arglist.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly 'arglist'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/unaligned/1/arglist64.il b/src/tests/JIT/Directed/PREFIX/unaligned/1/arglist64.il index 4b328281e2863b..74ad14baf0e67a 100644 --- a/src/tests/JIT/Directed/PREFIX/unaligned/1/arglist64.il +++ b/src/tests/JIT/Directed/PREFIX/unaligned/1/arglist64.il @@ -19,7 +19,7 @@ arg1==arg4, arg2==arg5, arg3==arg6. */ .assembly extern legacy library mscorlib {} -.assembly arglist.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly 'arglist'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/unaligned/1/arglistARM.il b/src/tests/JIT/Directed/PREFIX/unaligned/1/arglistARM.il index 3778c5d9f9aed9..055e6f6f78fcd1 100644 --- a/src/tests/JIT/Directed/PREFIX/unaligned/1/arglistARM.il +++ b/src/tests/JIT/Directed/PREFIX/unaligned/1/arglistARM.il @@ -28,7 +28,7 @@ ARM is closer to the native ABI: */ .assembly extern legacy library mscorlib {} -.assembly arglist.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly 'arglist'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/unaligned/1/initblk.il b/src/tests/JIT/Directed/PREFIX/unaligned/1/initblk.il index f0728d8e9e1a40..6eb564c3db932c 100644 --- a/src/tests/JIT/Directed/PREFIX/unaligned/1/initblk.il +++ b/src/tests/JIT/Directed/PREFIX/unaligned/1/initblk.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly initblk.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly 'initblk'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/unaligned/1/initobj.il b/src/tests/JIT/Directed/PREFIX/unaligned/1/initobj.il index 3d4b21b555205b..8cb42f524984aa 100644 --- a/src/tests/JIT/Directed/PREFIX/unaligned/1/initobj.il +++ b/src/tests/JIT/Directed/PREFIX/unaligned/1/initobj.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly initobj.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly 'initobj'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/unaligned/1/ldind_stind.il b/src/tests/JIT/Directed/PREFIX/unaligned/1/ldind_stind.il index f8aed3eae64ffc..11e0f5efd3c2b5 100644 --- a/src/tests/JIT/Directed/PREFIX/unaligned/1/ldind_stind.il +++ b/src/tests/JIT/Directed/PREFIX/unaligned/1/ldind_stind.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly ldind_stind.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly ldind_stind{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/unaligned/2/arglist.il b/src/tests/JIT/Directed/PREFIX/unaligned/2/arglist.il index 18a653b9cdda16..9fc39834409849 100644 --- a/src/tests/JIT/Directed/PREFIX/unaligned/2/arglist.il +++ b/src/tests/JIT/Directed/PREFIX/unaligned/2/arglist.il @@ -19,7 +19,7 @@ arg1==arg4, arg2==arg5, arg3==arg6. */ .assembly extern legacy library mscorlib {} -.assembly arglist.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly 'arglist'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/unaligned/2/arglist64.il b/src/tests/JIT/Directed/PREFIX/unaligned/2/arglist64.il index ab5fafadacd21c..751f86b0e53a2d 100644 --- a/src/tests/JIT/Directed/PREFIX/unaligned/2/arglist64.il +++ b/src/tests/JIT/Directed/PREFIX/unaligned/2/arglist64.il @@ -19,7 +19,7 @@ arg1==arg4, arg2==arg5, arg3==arg6. */ .assembly extern legacy library mscorlib {} -.assembly arglist.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly 'arglist'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/unaligned/2/arglistARM.il b/src/tests/JIT/Directed/PREFIX/unaligned/2/arglistARM.il index 06d1017e036a6f..f3eed6072f9cd5 100644 --- a/src/tests/JIT/Directed/PREFIX/unaligned/2/arglistARM.il +++ b/src/tests/JIT/Directed/PREFIX/unaligned/2/arglistARM.il @@ -27,7 +27,7 @@ ARM is closer to the native ABI: */ .assembly extern legacy library mscorlib {} -.assembly arglist.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly 'arglist'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/unaligned/2/initblk.il b/src/tests/JIT/Directed/PREFIX/unaligned/2/initblk.il index d7d123e144216a..82a080901ba74d 100644 --- a/src/tests/JIT/Directed/PREFIX/unaligned/2/initblk.il +++ b/src/tests/JIT/Directed/PREFIX/unaligned/2/initblk.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly initblk.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly 'initblk'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/unaligned/2/initobj.il b/src/tests/JIT/Directed/PREFIX/unaligned/2/initobj.il index 26d402b5bb42d5..5157b22a05a425 100644 --- a/src/tests/JIT/Directed/PREFIX/unaligned/2/initobj.il +++ b/src/tests/JIT/Directed/PREFIX/unaligned/2/initobj.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly initobj.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly 'initobj'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/unaligned/2/ldind_stind.il b/src/tests/JIT/Directed/PREFIX/unaligned/2/ldind_stind.il index 44976df3d5c852..4269313f23a942 100644 --- a/src/tests/JIT/Directed/PREFIX/unaligned/2/ldind_stind.il +++ b/src/tests/JIT/Directed/PREFIX/unaligned/2/ldind_stind.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly ldind_stind.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly ldind_stind{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/unaligned/4/arglist.il b/src/tests/JIT/Directed/PREFIX/unaligned/4/arglist.il index cea7f3686214b2..f7cb305d9d707f 100644 --- a/src/tests/JIT/Directed/PREFIX/unaligned/4/arglist.il +++ b/src/tests/JIT/Directed/PREFIX/unaligned/4/arglist.il @@ -19,7 +19,7 @@ arg1==arg4, arg2==arg5, arg3==arg6. */ .assembly extern legacy library mscorlib {} -.assembly arglist.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly 'arglist'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/unaligned/4/arglist64.il b/src/tests/JIT/Directed/PREFIX/unaligned/4/arglist64.il index 8d947cf8dc3679..635623f76a71da 100644 --- a/src/tests/JIT/Directed/PREFIX/unaligned/4/arglist64.il +++ b/src/tests/JIT/Directed/PREFIX/unaligned/4/arglist64.il @@ -19,7 +19,7 @@ arg1==arg4, arg2==arg5, arg3==arg6. */ .assembly extern legacy library mscorlib {} -.assembly arglist.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly 'arglist'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/unaligned/4/arglistARM.il b/src/tests/JIT/Directed/PREFIX/unaligned/4/arglistARM.il index 1dbd16ca018703..85626d71e7cd02 100644 --- a/src/tests/JIT/Directed/PREFIX/unaligned/4/arglistARM.il +++ b/src/tests/JIT/Directed/PREFIX/unaligned/4/arglistARM.il @@ -27,7 +27,7 @@ ARM is closer to the native ABI: */ .assembly extern legacy library mscorlib {} -.assembly arglist.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly 'arglist'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/unaligned/4/initblk.il b/src/tests/JIT/Directed/PREFIX/unaligned/4/initblk.il index 00ee567afa142c..652925eb3ba152 100644 --- a/src/tests/JIT/Directed/PREFIX/unaligned/4/initblk.il +++ b/src/tests/JIT/Directed/PREFIX/unaligned/4/initblk.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly initblk.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly 'initblk'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/unaligned/4/initobj.il b/src/tests/JIT/Directed/PREFIX/unaligned/4/initobj.il index dc05f3873a801a..3b8be322827376 100644 --- a/src/tests/JIT/Directed/PREFIX/unaligned/4/initobj.il +++ b/src/tests/JIT/Directed/PREFIX/unaligned/4/initobj.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly initobj.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly 'initobj'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/unaligned/4/ldind_stind.il b/src/tests/JIT/Directed/PREFIX/unaligned/4/ldind_stind.il index f3952f94b53042..3c84384f863af5 100644 --- a/src/tests/JIT/Directed/PREFIX/unaligned/4/ldind_stind.il +++ b/src/tests/JIT/Directed/PREFIX/unaligned/4/ldind_stind.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly ldind_stind.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly ldind_stind{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/volatile/1/arglist.il b/src/tests/JIT/Directed/PREFIX/volatile/1/arglist.il index bd712a96b40d3c..782151eb003ee8 100644 --- a/src/tests/JIT/Directed/PREFIX/volatile/1/arglist.il +++ b/src/tests/JIT/Directed/PREFIX/volatile/1/arglist.il @@ -19,7 +19,7 @@ arg1==arg4, arg2==arg5, arg3==arg6. */ .assembly extern legacy library mscorlib {} -.assembly arglist.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly 'arglist'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/volatile/1/arglist64.il b/src/tests/JIT/Directed/PREFIX/volatile/1/arglist64.il index 263d6b16ca77dc..5a5b3517aa0198 100644 --- a/src/tests/JIT/Directed/PREFIX/volatile/1/arglist64.il +++ b/src/tests/JIT/Directed/PREFIX/volatile/1/arglist64.il @@ -19,7 +19,7 @@ arg1==arg4, arg2==arg5, arg3==arg6. */ .assembly extern legacy library mscorlib {} -.assembly arglist.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly 'arglist'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/volatile/1/arglistARM.il b/src/tests/JIT/Directed/PREFIX/volatile/1/arglistARM.il index 2588f24b5f98e9..cd9e5017aa84f9 100644 --- a/src/tests/JIT/Directed/PREFIX/volatile/1/arglistARM.il +++ b/src/tests/JIT/Directed/PREFIX/volatile/1/arglistARM.il @@ -27,7 +27,7 @@ ARM is closer to the native ABI: */ .assembly extern legacy library mscorlib {} -.assembly arglist.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly 'arglist'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/volatile/1/initblk.il b/src/tests/JIT/Directed/PREFIX/volatile/1/initblk.il index c77e74c2ebb098..fdf40da118bd0e 100644 --- a/src/tests/JIT/Directed/PREFIX/volatile/1/initblk.il +++ b/src/tests/JIT/Directed/PREFIX/volatile/1/initblk.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly initblk.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly 'initblk'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/volatile/1/initobj.il b/src/tests/JIT/Directed/PREFIX/volatile/1/initobj.il index 35ad51df1646a5..59235c30b590fa 100644 --- a/src/tests/JIT/Directed/PREFIX/volatile/1/initobj.il +++ b/src/tests/JIT/Directed/PREFIX/volatile/1/initobj.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly initobj.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly 'initobj'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/PREFIX/volatile/1/ldind_stind.il b/src/tests/JIT/Directed/PREFIX/volatile/1/ldind_stind.il index 65389c0f53dce5..20ac7afc91ba94 100644 --- a/src/tests/JIT/Directed/PREFIX/volatile/1/ldind_stind.il +++ b/src/tests/JIT/Directed/PREFIX/volatile/1/ldind_stind.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly ldind_stind.exe{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: +.assembly ldind_stind{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/Directed/RVAInit/extended.il b/src/tests/JIT/Directed/RVAInit/extended.il index cb28ba87da6fc7..ecc018d9be3b17 100644 --- a/src/tests/JIT/Directed/RVAInit/extended.il +++ b/src/tests/JIT/Directed/RVAInit/extended.il @@ -10,6 +10,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib { } @@ -122,6 +123,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals (int32 V_0) diff --git a/src/tests/JIT/Directed/RVAInit/gcref1.il b/src/tests/JIT/Directed/RVAInit/gcref1.il index 37ff4c787ea232..aee3b7e859b406 100644 --- a/src/tests/JIT/Directed/RVAInit/gcref1.il +++ b/src/tests/JIT/Directed/RVAInit/gcref1.il @@ -10,6 +10,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib { @@ -290,6 +291,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0) diff --git a/src/tests/JIT/Directed/RVAInit/gcref2.il b/src/tests/JIT/Directed/RVAInit/gcref2.il index b246d5d1c4961a..5c5d3c2c00ef19 100644 --- a/src/tests/JIT/Directed/RVAInit/gcref2.il +++ b/src/tests/JIT/Directed/RVAInit/gcref2.il @@ -10,6 +10,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib { @@ -290,6 +291,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0) diff --git a/src/tests/JIT/Directed/RVAInit/nested.il b/src/tests/JIT/Directed/RVAInit/nested.il index 18dca62f525cca..c177c47dc5179c 100644 --- a/src/tests/JIT/Directed/RVAInit/nested.il +++ b/src/tests/JIT/Directed/RVAInit/nested.il @@ -10,6 +10,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib { @@ -231,6 +232,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0) diff --git a/src/tests/JIT/Directed/RVAInit/oddsize.il b/src/tests/JIT/Directed/RVAInit/oddsize.il index de227553e2e8d4..0b2a43a8ebc337 100644 --- a/src/tests/JIT/Directed/RVAInit/oddsize.il +++ b/src/tests/JIT/Directed/RVAInit/oddsize.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -34,6 +35,9 @@ } .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0) diff --git a/src/tests/JIT/Directed/RVAInit/overlap.il b/src/tests/JIT/Directed/RVAInit/overlap.il index 64d6e86e8cb4c1..5b87cd461cdc30 100644 --- a/src/tests/JIT/Directed/RVAInit/overlap.il +++ b/src/tests/JIT/Directed/RVAInit/overlap.il @@ -10,6 +10,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib { } @@ -225,6 +226,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0) diff --git a/src/tests/JIT/Directed/RVAInit/simple.il b/src/tests/JIT/Directed/RVAInit/simple.il index 3fbd363825dc8a..07d30446ab94e0 100644 --- a/src/tests/JIT/Directed/RVAInit/simple.il +++ b/src/tests/JIT/Directed/RVAInit/simple.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib { } .assembly simple @@ -215,6 +216,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0) diff --git a/src/tests/JIT/Directed/RVAInit/simplearg.il b/src/tests/JIT/Directed/RVAInit/simplearg.il index fe01ac88c3144a..b85763c6d801d6 100644 --- a/src/tests/JIT/Directed/RVAInit/simplearg.il +++ b/src/tests/JIT/Directed/RVAInit/simplearg.il @@ -10,6 +10,7 @@ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly repro2 { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) @@ -103,6 +104,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 59 (0x3b) .maxstack 2 diff --git a/src/tests/JIT/Directed/StructABI/structreturn.cs b/src/tests/JIT/Directed/StructABI/structreturn.cs index cbcdd70a1e2184..16704453f35f45 100644 --- a/src/tests/JIT/Directed/StructABI/structreturn.cs +++ b/src/tests/JIT/Directed/StructABI/structreturn.cs @@ -831,7 +831,7 @@ public ReturnStruct(int a) } } - static ReturnStruct TestConstPropogation(int a) + static ReturnStruct TestConstPropagation(int a) { if (a == 0) { @@ -860,9 +860,9 @@ static ReturnStruct TestConstPropogation(int a) } [MethodImpl(MethodImplOptions.NoInlining)] - static void TestConstPropogation() + static void TestConstPropagation() { - TestConstPropogation(5); + TestConstPropagation(5); } @@ -883,7 +883,7 @@ public StructWithOverlaps(int v) } [MethodImpl(MethodImplOptions.NoInlining)] - static ReturnStruct TestNoFieldSeqPropogation(int a) + static ReturnStruct TestNoFieldSeqPropagation(int a) { StructWithOverlaps s = new StructWithOverlaps(); if (a == 0) @@ -913,16 +913,16 @@ static ReturnStruct TestNoFieldSeqPropogation(int a) } [MethodImpl(MethodImplOptions.NoInlining)] - static void TestNoFieldSeqPropogation() + static void TestNoFieldSeqPropagation() { - TestNoFieldSeqPropogation(5); + TestNoFieldSeqPropagation(5); } public static void Test() { - TestConstPropogation(); - TestNoFieldSeqPropogation(); + TestConstPropagation(); + TestNoFieldSeqPropagation(); } } #endregion diff --git a/src/tests/JIT/Directed/UnrollLoop/loop3.il b/src/tests/JIT/Directed/UnrollLoop/loop3.il index 28ebd94cfdccb9..629704fd2c48e6 100644 --- a/src/tests/JIT/Directed/UnrollLoop/loop3.il +++ b/src/tests/JIT/Directed/UnrollLoop/loop3.il @@ -3,6 +3,7 @@ //different ways to invoke method inside a loop (no tail. call or jmp/jmpi since they require empty stack) .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -1769,6 +1770,9 @@ .method public hidebysig static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 1003 (0x3eb) .maxstack 2 diff --git a/src/tests/JIT/Directed/array-il/complex3.il b/src/tests/JIT/Directed/array-il/complex3.il index 91e0dcb18c8877..8d6f45070ece82 100644 --- a/src/tests/JIT/Directed/array-il/complex3.il +++ b/src/tests/JIT/Directed/array-il/complex3.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern legacy library mscorlib {} .assembly complex3 @@ -69,6 +70,9 @@ .method public static int32 Main(string[] args) il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 9 .locals (int32 SIZE, diff --git a/src/tests/JIT/Directed/array-il/simple3.il b/src/tests/JIT/Directed/array-il/simple3.il index 5824f97f7c94e7..7084dbb72c6747 100644 --- a/src/tests/JIT/Directed/array-il/simple3.il +++ b/src/tests/JIT/Directed/array-il/simple3.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -34,6 +35,9 @@ .method public static int32 Main(class [mscorlib]System.String[] args) il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Method begins at RVA 0x1090 // Code size 230 (0xe6) diff --git a/src/tests/JIT/Directed/callconv/CdeclMemberFunction/CdeclMemberFunctionTest.cs b/src/tests/JIT/Directed/callconv/CdeclMemberFunction/CdeclMemberFunctionTest.cs index 746150b0a10bd3..3563947d60d37a 100644 --- a/src/tests/JIT/Directed/callconv/CdeclMemberFunction/CdeclMemberFunctionTest.cs +++ b/src/tests/JIT/Directed/callconv/CdeclMemberFunction/CdeclMemberFunctionTest.cs @@ -4,7 +4,7 @@ using System; using System.Reflection; using System.Text; -using TestLibrary; +using Xunit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -95,36 +95,36 @@ private static void Test8ByteHFA(CdeclMemberFunctionNative.C* instance) { CdeclMemberFunctionNative.SizeF result = instance->vtable->getSize(instance, 1234); - Assert.AreEqual(instance->width, result.width); - Assert.AreEqual(instance->height, result.height); + Assert.Equal(instance->width, result.width); + Assert.Equal(instance->height, result.height); } private static void Test4ByteHFA(CdeclMemberFunctionNative.C* instance) { CdeclMemberFunctionNative.Width result = instance->vtable->getWidth(instance); - Assert.AreEqual(instance->width, result.width); + Assert.Equal(instance->width, result.width); } private static void Test4ByteNonHFA(CdeclMemberFunctionNative.C* instance) { CdeclMemberFunctionNative.IntWrapper result = instance->vtable->getHeightAsInt(instance); - Assert.AreEqual((int)instance->height, result.i); + Assert.Equal((int)instance->height, result.i); } private static void TestEnum(CdeclMemberFunctionNative.C* instance) { CdeclMemberFunctionNative.E result = instance->vtable->getE(instance); - Assert.AreEqual(instance->dummy, result); + Assert.Equal(instance->dummy, result); } private static void TestCLong(CdeclMemberFunctionNative.C* instance) { CLong result = instance->vtable->getWidthAsLong(instance); - Assert.AreEqual((nint)instance->width, result.Value); + Assert.Equal((nint)instance->width, result.Value); } private static void Test8ByteHFAUnmanagedCallersOnly() @@ -132,8 +132,8 @@ private static void Test8ByteHFAUnmanagedCallersOnly() CdeclMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); CdeclMemberFunctionNative.SizeF result = CdeclMemberFunctionNative.GetSizeFromManaged(&c); - Assert.AreEqual(c.width, result.width); - Assert.AreEqual(c.height, result.height); + Assert.Equal(c.width, result.width); + Assert.Equal(c.height, result.height); } private static void Test4ByteHFAUnmanagedCallersOnly() @@ -141,7 +141,7 @@ private static void Test4ByteHFAUnmanagedCallersOnly() CdeclMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); CdeclMemberFunctionNative.Width result = CdeclMemberFunctionNative.GetWidthFromManaged(&c); - Assert.AreEqual(c.width, result.width); + Assert.Equal(c.width, result.width); } private static void Test4ByteNonHFAUnmanagedCallersOnly() @@ -149,7 +149,7 @@ private static void Test4ByteNonHFAUnmanagedCallersOnly() CdeclMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); CdeclMemberFunctionNative.IntWrapper result = CdeclMemberFunctionNative.GetHeightAsIntFromManaged(&c); - Assert.AreEqual((int)c.height, result.i); + Assert.Equal((int)c.height, result.i); } private static void TestEnumUnmanagedCallersOnly() @@ -157,7 +157,7 @@ private static void TestEnumUnmanagedCallersOnly() CdeclMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); CdeclMemberFunctionNative.E result = CdeclMemberFunctionNative.GetEFromManaged(&c); - Assert.AreEqual(c.dummy, result); + Assert.Equal(c.dummy, result); } private static void TestCLongUnmanagedCallersOnly() @@ -165,7 +165,7 @@ private static void TestCLongUnmanagedCallersOnly() CdeclMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); CLong result = CdeclMemberFunctionNative.GetWidthAsLongFromManaged(&c); - Assert.AreEqual((nint)c.width, result.Value); + Assert.Equal((nint)c.width, result.Value); } private static CdeclMemberFunctionNative.C CreateCWithUnmanagedCallersOnlyVTable(float width, float height) diff --git a/src/tests/JIT/Directed/callconv/PlatformDefaultMemberFunction/PlatformDefaultMemberFunctionTest.cs b/src/tests/JIT/Directed/callconv/PlatformDefaultMemberFunction/PlatformDefaultMemberFunctionTest.cs index bb1429adef1d2f..3afe617e668aef 100644 --- a/src/tests/JIT/Directed/callconv/PlatformDefaultMemberFunction/PlatformDefaultMemberFunctionTest.cs +++ b/src/tests/JIT/Directed/callconv/PlatformDefaultMemberFunction/PlatformDefaultMemberFunctionTest.cs @@ -4,7 +4,7 @@ using System; using System.Reflection; using System.Text; -using TestLibrary; +using Xunit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -95,36 +95,36 @@ private static void Test8ByteHFA(PlatformDefaultMemberFunctionNative.C* instance { PlatformDefaultMemberFunctionNative.SizeF result = instance->vtable->getSize(instance, 1234); - Assert.AreEqual(instance->width, result.width); - Assert.AreEqual(instance->height, result.height); + Assert.Equal(instance->width, result.width); + Assert.Equal(instance->height, result.height); } private static void Test4ByteHFA(PlatformDefaultMemberFunctionNative.C* instance) { PlatformDefaultMemberFunctionNative.Width result = instance->vtable->getWidth(instance); - Assert.AreEqual(instance->width, result.width); + Assert.Equal(instance->width, result.width); } private static void Test4ByteNonHFA(PlatformDefaultMemberFunctionNative.C* instance) { PlatformDefaultMemberFunctionNative.IntWrapper result = instance->vtable->getHeightAsInt(instance); - Assert.AreEqual((int)instance->height, result.i); + Assert.Equal((int)instance->height, result.i); } private static void TestEnum(PlatformDefaultMemberFunctionNative.C* instance) { PlatformDefaultMemberFunctionNative.E result = instance->vtable->getE(instance); - Assert.AreEqual(instance->dummy, result); + Assert.Equal(instance->dummy, result); } private static void TestCLong(PlatformDefaultMemberFunctionNative.C* instance) { CLong result = instance->vtable->getWidthAsLong(instance); - Assert.AreEqual((nint)instance->width, result.Value); + Assert.Equal((nint)instance->width, result.Value); } private static void Test8ByteHFAUnmanagedCallersOnly() @@ -132,8 +132,8 @@ private static void Test8ByteHFAUnmanagedCallersOnly() PlatformDefaultMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); PlatformDefaultMemberFunctionNative.SizeF result = PlatformDefaultMemberFunctionNative.GetSizeFromManaged(&c); - Assert.AreEqual(c.width, result.width); - Assert.AreEqual(c.height, result.height); + Assert.Equal(c.width, result.width); + Assert.Equal(c.height, result.height); } private static void Test4ByteHFAUnmanagedCallersOnly() @@ -141,7 +141,7 @@ private static void Test4ByteHFAUnmanagedCallersOnly() PlatformDefaultMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); PlatformDefaultMemberFunctionNative.Width result = PlatformDefaultMemberFunctionNative.GetWidthFromManaged(&c); - Assert.AreEqual(c.width, result.width); + Assert.Equal(c.width, result.width); } private static void Test4ByteNonHFAUnmanagedCallersOnly() @@ -149,7 +149,7 @@ private static void Test4ByteNonHFAUnmanagedCallersOnly() PlatformDefaultMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); PlatformDefaultMemberFunctionNative.IntWrapper result = PlatformDefaultMemberFunctionNative.GetHeightAsIntFromManaged(&c); - Assert.AreEqual((int)c.height, result.i); + Assert.Equal((int)c.height, result.i); } private static void TestEnumUnmanagedCallersOnly() @@ -157,7 +157,7 @@ private static void TestEnumUnmanagedCallersOnly() PlatformDefaultMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); PlatformDefaultMemberFunctionNative.E result = PlatformDefaultMemberFunctionNative.GetEFromManaged(&c); - Assert.AreEqual(c.dummy, result); + Assert.Equal(c.dummy, result); } private static void TestCLongUnmanagedCallersOnly() @@ -165,7 +165,7 @@ private static void TestCLongUnmanagedCallersOnly() PlatformDefaultMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); CLong result = PlatformDefaultMemberFunctionNative.GetWidthAsLongFromManaged(&c); - Assert.AreEqual((nint)c.width, result.Value); + Assert.Equal((nint)c.width, result.Value); } private static PlatformDefaultMemberFunctionNative.C CreateCWithUnmanagedCallersOnlyVTable(float width, float height) diff --git a/src/tests/JIT/Directed/callconv/StdCallMemberFunction/StdCallMemberFunctionTest.cs b/src/tests/JIT/Directed/callconv/StdCallMemberFunction/StdCallMemberFunctionTest.cs index f3480f04470ee2..fc9a9c8da1c498 100644 --- a/src/tests/JIT/Directed/callconv/StdCallMemberFunction/StdCallMemberFunctionTest.cs +++ b/src/tests/JIT/Directed/callconv/StdCallMemberFunction/StdCallMemberFunctionTest.cs @@ -4,7 +4,7 @@ using System; using System.Reflection; using System.Text; -using TestLibrary; +using Xunit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -95,44 +95,44 @@ private static void Test8ByteHFA(StdCallMemberFunctionNative.C* instance) { StdCallMemberFunctionNative.SizeF result = instance->vtable->getSize(instance, 1234); - Assert.AreEqual(instance->width, result.width); - Assert.AreEqual(instance->height, result.height); + Assert.Equal(instance->width, result.width); + Assert.Equal(instance->height, result.height); } private static void Test4ByteHFA(StdCallMemberFunctionNative.C* instance) { StdCallMemberFunctionNative.Width result = instance->vtable->getWidth(instance); - Assert.AreEqual(instance->width, result.width); + Assert.Equal(instance->width, result.width); } private static void Test4ByteNonHFA(StdCallMemberFunctionNative.C* instance) { StdCallMemberFunctionNative.IntWrapper result = instance->vtable->getHeightAsInt(instance); - Assert.AreEqual((int)instance->height, result.i); + Assert.Equal((int)instance->height, result.i); } private static void TestEnum(StdCallMemberFunctionNative.C* instance) { StdCallMemberFunctionNative.E result = instance->vtable->getE(instance); - Assert.AreEqual(instance->dummy, result); + Assert.Equal(instance->dummy, result); } private static void TestCLong(StdCallMemberFunctionNative.C* instance) { CLong result = instance->vtable->getWidthAsLong(instance); - Assert.AreEqual((nint)instance->width, result.Value); + Assert.Equal((nint)instance->width, result.Value); } private static void Test8ByteHFAUnmanagedCallersOnly() { StdCallMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); StdCallMemberFunctionNative.SizeF result = StdCallMemberFunctionNative.GetSizeFromManaged(&c); - Assert.AreEqual(c.width, result.width); - Assert.AreEqual(c.height, result.height); + Assert.Equal(c.width, result.width); + Assert.Equal(c.height, result.height); } private static void Test4ByteHFAUnmanagedCallersOnly() @@ -140,7 +140,7 @@ private static void Test4ByteHFAUnmanagedCallersOnly() StdCallMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); StdCallMemberFunctionNative.Width result = StdCallMemberFunctionNative.GetWidthFromManaged(&c); - Assert.AreEqual(c.width, result.width); + Assert.Equal(c.width, result.width); } private static void Test4ByteNonHFAUnmanagedCallersOnly() @@ -148,7 +148,7 @@ private static void Test4ByteNonHFAUnmanagedCallersOnly() StdCallMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); StdCallMemberFunctionNative.IntWrapper result = StdCallMemberFunctionNative.GetHeightAsIntFromManaged(&c); - Assert.AreEqual((int)c.height, result.i); + Assert.Equal((int)c.height, result.i); } private static void TestEnumUnmanagedCallersOnly() @@ -156,7 +156,7 @@ private static void TestEnumUnmanagedCallersOnly() StdCallMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); StdCallMemberFunctionNative.E result = StdCallMemberFunctionNative.GetEFromManaged(&c); - Assert.AreEqual(c.dummy, result); + Assert.Equal(c.dummy, result); } private static void TestCLongUnmanagedCallersOnly() @@ -164,7 +164,7 @@ private static void TestCLongUnmanagedCallersOnly() StdCallMemberFunctionNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); CLong result = StdCallMemberFunctionNative.GetWidthAsLongFromManaged(&c); - Assert.AreEqual((nint)c.width, result.Value); + Assert.Equal((nint)c.width, result.Value); } private static StdCallMemberFunctionNative.C CreateCWithUnmanagedCallersOnlyVTable(float width, float height) diff --git a/src/tests/JIT/Directed/callconv/ThisCall/ThisCallTest.cs b/src/tests/JIT/Directed/callconv/ThisCall/ThisCallTest.cs index 16ef813a0dc1bc..51563e3ea166ad 100644 --- a/src/tests/JIT/Directed/callconv/ThisCall/ThisCallTest.cs +++ b/src/tests/JIT/Directed/callconv/ThisCall/ThisCallTest.cs @@ -4,7 +4,7 @@ using System; using System.Reflection; using System.Text; -using TestLibrary; +using Xunit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -115,8 +115,8 @@ private static void Test8ByteHFA(ThisCallNative.C* instance) ThisCallNative.SizeF result = callback(instance, 1234); - Assert.AreEqual(instance->width, result.width); - Assert.AreEqual(instance->height, result.height); + Assert.Equal(instance->width, result.width); + Assert.Equal(instance->height, result.height); } private static void Test4ByteHFA(ThisCallNative.C* instance) @@ -125,7 +125,7 @@ private static void Test4ByteHFA(ThisCallNative.C* instance) ThisCallNative.Width result = callback(instance); - Assert.AreEqual(instance->width, result.width); + Assert.Equal(instance->width, result.width); } private static void Test4ByteNonHFA(ThisCallNative.C* instance) @@ -134,7 +134,7 @@ private static void Test4ByteNonHFA(ThisCallNative.C* instance) ThisCallNative.IntWrapper result = callback(instance); - Assert.AreEqual((int)instance->height, result.i); + Assert.Equal((int)instance->height, result.i); } private static void TestEnum(ThisCallNative.C* instance) @@ -143,7 +143,7 @@ private static void TestEnum(ThisCallNative.C* instance) ThisCallNative.E result = callback(instance); - Assert.AreEqual(instance->dummy, result); + Assert.Equal(instance->dummy, result); } private static void TestCLong(ThisCallNative.C* instance) @@ -152,7 +152,7 @@ private static void TestCLong(ThisCallNative.C* instance) CLong result = callback(instance); - Assert.AreEqual((nint)instance->width, result.Value); + Assert.Equal((nint)instance->width, result.Value); } private static void Test8ByteHFAReverse() @@ -160,8 +160,8 @@ private static void Test8ByteHFAReverse() ThisCallNative.C c = CreateCWithManagedVTable(2.0f, 3.0f); ThisCallNative.SizeF result = ThisCallNative.GetSizeFromManaged(&c); - Assert.AreEqual(c.width, result.width); - Assert.AreEqual(c.height, result.height); + Assert.Equal(c.width, result.width); + Assert.Equal(c.height, result.height); } private static void Test4ByteHFAReverse() @@ -169,7 +169,7 @@ private static void Test4ByteHFAReverse() ThisCallNative.C c = CreateCWithManagedVTable(2.0f, 3.0f); ThisCallNative.Width result = ThisCallNative.GetWidthFromManaged(&c); - Assert.AreEqual(c.width, result.width); + Assert.Equal(c.width, result.width); } private static void Test4ByteNonHFAReverse() @@ -177,7 +177,7 @@ private static void Test4ByteNonHFAReverse() ThisCallNative.C c = CreateCWithManagedVTable(2.0f, 3.0f); ThisCallNative.IntWrapper result = ThisCallNative.GetHeightAsIntFromManaged(&c); - Assert.AreEqual((int)c.height, result.i); + Assert.Equal((int)c.height, result.i); } private static void TestEnumReverse() @@ -185,7 +185,7 @@ private static void TestEnumReverse() ThisCallNative.C c = CreateCWithManagedVTable(2.0f, 3.0f); ThisCallNative.E result = ThisCallNative.GetEFromManaged(&c); - Assert.AreEqual(c.dummy, result); + Assert.Equal(c.dummy, result); } private static void TestCLongReverse() @@ -193,7 +193,7 @@ private static void TestCLongReverse() ThisCallNative.C c = CreateCWithManagedVTable(2.0f, 3.0f); CLong result = ThisCallNative.GetWidthAsLongFromManaged(&c); - Assert.AreEqual((nint)c.width, result.Value); + Assert.Equal((nint)c.width, result.Value); } private static void Test8ByteHFAUnmanagedCallersOnly() @@ -201,8 +201,8 @@ private static void Test8ByteHFAUnmanagedCallersOnly() ThisCallNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); ThisCallNative.SizeF result = ThisCallNative.GetSizeFromManaged(&c); - Assert.AreEqual(c.width, result.width); - Assert.AreEqual(c.height, result.height); + Assert.Equal(c.width, result.width); + Assert.Equal(c.height, result.height); } private static void Test4ByteHFAUnmanagedCallersOnly() @@ -210,7 +210,7 @@ private static void Test4ByteHFAUnmanagedCallersOnly() ThisCallNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); ThisCallNative.Width result = ThisCallNative.GetWidthFromManaged(&c); - Assert.AreEqual(c.width, result.width); + Assert.Equal(c.width, result.width); } private static void Test4ByteNonHFAUnmanagedCallersOnly() @@ -218,7 +218,7 @@ private static void Test4ByteNonHFAUnmanagedCallersOnly() ThisCallNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); ThisCallNative.IntWrapper result = ThisCallNative.GetHeightAsIntFromManaged(&c); - Assert.AreEqual((int)c.height, result.i); + Assert.Equal((int)c.height, result.i); } private static void TestEnumUnmanagedCallersOnly() @@ -226,7 +226,7 @@ private static void TestEnumUnmanagedCallersOnly() ThisCallNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); ThisCallNative.E result = ThisCallNative.GetEFromManaged(&c); - Assert.AreEqual(c.dummy, result); + Assert.Equal(c.dummy, result); } private static void TestCLongUnmanagedCallersOnly() @@ -234,7 +234,7 @@ private static void TestCLongUnmanagedCallersOnly() ThisCallNative.C c = CreateCWithUnmanagedCallersOnlyVTable(2.0f, 3.0f); CLong result = ThisCallNative.GetWidthAsLongFromManaged(&c); - Assert.AreEqual((nint)c.width, result.Value); + Assert.Equal((nint)c.width, result.Value); } private static ThisCallNative.C CreateCWithManagedVTable(float width, float height) diff --git a/src/tests/JIT/Directed/coverage/importer/Desktop/badldsfld.il b/src/tests/JIT/Directed/coverage/importer/Desktop/badldsfld.il index 8380763c5dca03..ced1a9eed4a280 100644 --- a/src/tests/JIT/Directed/coverage/importer/Desktop/badldsfld.il +++ b/src/tests/JIT/Directed/coverage/importer/Desktop/badldsfld.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly badldslfd { } .class Test_badldsfld extends [mscorlib]System.Object { @@ -13,6 +14,9 @@ ret } .method public static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .try { diff --git a/src/tests/JIT/Directed/coverage/importer/Desktop/calli2.il b/src/tests/JIT/Directed/coverage/importer/Desktop/calli2.il index 7c9c56b229cd47..fdda1a03f372be 100644 --- a/src/tests/JIT/Directed/coverage/importer/Desktop/calli2.il +++ b/src/tests/JIT/Directed/coverage/importer/Desktop/calli2.il @@ -1,4 +1,5 @@ .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly legacy library calli2 { } .class private auto ansi beforefieldinit calli2 extends [mscorlib]System.Object @@ -17,6 +18,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (int32 V_0, @@ -43,4 +47,4 @@ add IL_001e: ret } -} \ No newline at end of file +} diff --git a/src/tests/JIT/Directed/coverage/importer/Desktop/ldelemnullarr2.il b/src/tests/JIT/Directed/coverage/importer/Desktop/ldelemnullarr2.il index 148521201b2aa9..5e5d75a841d5dd 100644 --- a/src/tests/JIT/Directed/coverage/importer/Desktop/ldelemnullarr2.il +++ b/src/tests/JIT/Directed/coverage/importer/Desktop/ldelemnullarr2.il @@ -8,6 +8,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern legacy library mscorlib {} .assembly legacy library ldelemnullarr2 { } .class private auto ansi beforefieldinit ldelemnullarr2 @@ -26,6 +27,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (int32 V_0) diff --git a/src/tests/JIT/Directed/coverage/importer/Desktop/ldfldr4.il b/src/tests/JIT/Directed/coverage/importer/Desktop/ldfldr4.il index e2b9ac312c7e54..d23b06edd0f378 100644 --- a/src/tests/JIT/Directed/coverage/importer/Desktop/ldfldr4.il +++ b/src/tests/JIT/Directed/coverage/importer/Desktop/ldfldr4.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern legacy library mscorlib {} .assembly legacy library ldfldr4 { } @@ -16,6 +17,9 @@ .field private initonly static float32 b .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (class Test_ldfldr4 V_0, diff --git a/src/tests/JIT/Directed/coverage/importer/Desktop/ldfldstatic1.il b/src/tests/JIT/Directed/coverage/importer/Desktop/ldfldstatic1.il index ce5aabc9e847a4..0fcae53685c333 100644 --- a/src/tests/JIT/Directed/coverage/importer/Desktop/ldfldstatic1.il +++ b/src/tests/JIT/Directed/coverage/importer/Desktop/ldfldstatic1.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern legacy library mscorlib {} .assembly legacy library ldfldstatic1 { } @@ -29,6 +30,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (class ldfldstatic1 V_0, diff --git a/src/tests/JIT/Directed/coverage/importer/Desktop/ldfldunboxedvt.il b/src/tests/JIT/Directed/coverage/importer/Desktop/ldfldunboxedvt.il index 6ecb74a3eb8333..4fd81c4f78c1fb 100644 --- a/src/tests/JIT/Directed/coverage/importer/Desktop/ldfldunboxedvt.il +++ b/src/tests/JIT/Directed/coverage/importer/Desktop/ldfldunboxedvt.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern legacy library mscorlib {} .assembly legacy library ldfldunboxedvt { } .class public sequential ansi sealed beforefieldinit VT @@ -32,6 +33,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 .try diff --git a/src/tests/JIT/Directed/coverage/importer/Desktop/nullsdarr.il b/src/tests/JIT/Directed/coverage/importer/Desktop/nullsdarr.il index a2b2379554a5d5..502523cb02ff6a 100644 --- a/src/tests/JIT/Directed/coverage/importer/Desktop/nullsdarr.il +++ b/src/tests/JIT/Directed/coverage/importer/Desktop/nullsdarr.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern legacy library mscorlib {} .assembly legacy library arrlen { } .class private auto ansi beforefieldinit nullsdarr @@ -23,6 +24,9 @@ } .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 .try diff --git a/src/tests/JIT/Directed/coverage/importer/Desktop/stfldstatic1.il b/src/tests/JIT/Directed/coverage/importer/Desktop/stfldstatic1.il index c017191ce009a9..d81771a0ca28dd 100644 --- a/src/tests/JIT/Directed/coverage/importer/Desktop/stfldstatic1.il +++ b/src/tests/JIT/Directed/coverage/importer/Desktop/stfldstatic1.il @@ -8,6 +8,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern legacy library mscorlib {} .assembly legacy library stfldstatic1 { } @@ -30,6 +31,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 .locals init (class stfldstatic1 V_0, diff --git a/src/tests/JIT/Directed/coverage/importer/calli2.il b/src/tests/JIT/Directed/coverage/importer/calli2.il index 7852f873d82e61..ead260abddfef9 100644 --- a/src/tests/JIT/Directed/coverage/importer/calli2.il +++ b/src/tests/JIT/Directed/coverage/importer/calli2.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -25,6 +26,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 31 (0x1f) .maxstack 2 diff --git a/src/tests/JIT/Directed/coverage/importer/ldelemnullarr2.il b/src/tests/JIT/Directed/coverage/importer/ldelemnullarr2.il index 5ceffa99047450..2db8e9d868b435 100644 --- a/src/tests/JIT/Directed/coverage/importer/ldelemnullarr2.il +++ b/src/tests/JIT/Directed/coverage/importer/ldelemnullarr2.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -25,6 +26,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 59 (0x3b) .maxstack 1 diff --git a/src/tests/JIT/Directed/coverage/importer/ldfldstatic1.il b/src/tests/JIT/Directed/coverage/importer/ldfldstatic1.il index aeb4edc559d53d..ce242d362866ee 100644 --- a/src/tests/JIT/Directed/coverage/importer/ldfldstatic1.il +++ b/src/tests/JIT/Directed/coverage/importer/ldfldstatic1.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -28,6 +29,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 23 (0x17) .maxstack 1 diff --git a/src/tests/JIT/Directed/coverage/importer/ldfldunboxedvt.il b/src/tests/JIT/Directed/coverage/importer/ldfldunboxedvt.il index f62d78dfad4d13..316e177d7d32ae 100644 --- a/src/tests/JIT/Directed/coverage/importer/ldfldunboxedvt.il +++ b/src/tests/JIT/Directed/coverage/importer/ldfldunboxedvt.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -32,6 +33,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 .try diff --git a/src/tests/JIT/Directed/coverage/importer/nullsdarr.il b/src/tests/JIT/Directed/coverage/importer/nullsdarr.il index d8534c7dcaa796..0e0f78b791fa93 100644 --- a/src/tests/JIT/Directed/coverage/importer/nullsdarr.il +++ b/src/tests/JIT/Directed/coverage/importer/nullsdarr.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -22,6 +23,9 @@ } .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 .try diff --git a/src/tests/JIT/Directed/coverage/importer/stfldstatic1.il b/src/tests/JIT/Directed/coverage/importer/stfldstatic1.il index 988ec1da676f56..6e9d334bfcd0de 100644 --- a/src/tests/JIT/Directed/coverage/importer/stfldstatic1.il +++ b/src/tests/JIT/Directed/coverage/importer/stfldstatic1.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -28,6 +29,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 23 (0x17) .maxstack 5 diff --git a/src/tests/JIT/Directed/coverage/oldtests/arrgetlen.il b/src/tests/JIT/Directed/coverage/oldtests/arrgetlen.il index 180b338653bf23..d7d5bd9630877e 100644 --- a/src/tests/JIT/Directed/coverage/oldtests/arrgetlen.il +++ b/src/tests/JIT/Directed/coverage/oldtests/arrgetlen.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -36,6 +37,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (class [mscorlib]System.Array V_0, diff --git a/src/tests/JIT/Directed/coverage/oldtests/ldfldstatic.il b/src/tests/JIT/Directed/coverage/oldtests/ldfldstatic.il index 8431fd71055e4f..7443055eb2eb0b 100644 --- a/src/tests/JIT/Directed/coverage/oldtests/ldfldstatic.il +++ b/src/tests/JIT/Directed/coverage/oldtests/ldfldstatic.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern legacy library mscorlib {} .assembly ldflds {} .module ldfldstatic.exe @@ -28,6 +29,9 @@ .method public hidebysig static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals (bool V_0, diff --git a/src/tests/JIT/Directed/coverage/oldtests/ldsshrstsfld.il b/src/tests/JIT/Directed/coverage/oldtests/ldsshrstsfld.il index 2a6fac45b4324d..a4748829f24e15 100644 --- a/src/tests/JIT/Directed/coverage/oldtests/ldsshrstsfld.il +++ b/src/tests/JIT/Directed/coverage/oldtests/ldsshrstsfld.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -52,6 +53,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint call void ldsshrstsfld::f1() call void ldsshrstsfld::f2() diff --git a/src/tests/JIT/Directed/coverage/oldtests/ldvirtftncalli.il b/src/tests/JIT/Directed/coverage/oldtests/ldvirtftncalli.il index 874ea9ddaa651e..96b2f342330227 100644 --- a/src/tests/JIT/Directed/coverage/oldtests/ldvirtftncalli.il +++ b/src/tests/JIT/Directed/coverage/oldtests/ldvirtftncalli.il @@ -3,6 +3,7 @@ //Testing inliner on a small func that contains ldvirtftn and calli .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -321,6 +322,9 @@ .method public hidebysig static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 279 (0x117) .maxstack 20 diff --git a/src/tests/JIT/Directed/coverage/oldtests/ovfldiv1.il b/src/tests/JIT/Directed/coverage/oldtests/ovfldiv1.il index 78b0f88b29e113..14d0bc34d024d8 100644 --- a/src/tests/JIT/Directed/coverage/oldtests/ovfldiv1.il +++ b/src/tests/JIT/Directed/coverage/oldtests/ovfldiv1.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly ovfldiv1 {} .class private auto ansi beforefieldinit ovfldiv1 @@ -13,6 +14,9 @@ { .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 diff --git a/src/tests/JIT/Directed/coverage/oldtests/ovfldiv2.il b/src/tests/JIT/Directed/coverage/oldtests/ovfldiv2.il index 4190be400753e9..bece0c12cccec7 100644 --- a/src/tests/JIT/Directed/coverage/oldtests/ovfldiv2.il +++ b/src/tests/JIT/Directed/coverage/oldtests/ovfldiv2.il @@ -3,6 +3,7 @@ .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -14,6 +15,9 @@ { .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 diff --git a/src/tests/JIT/Directed/coverage/oldtests/ovflrem1.il b/src/tests/JIT/Directed/coverage/oldtests/ovflrem1.il index 97dcd589fcfb1a..3e0dd51a637096 100644 --- a/src/tests/JIT/Directed/coverage/oldtests/ovflrem1.il +++ b/src/tests/JIT/Directed/coverage/oldtests/ovflrem1.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly ovflrem1 {} .class private auto ansi beforefieldinit ovflrem1 @@ -13,6 +14,9 @@ { .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 diff --git a/src/tests/JIT/Directed/coverage/oldtests/ovflrem2.il b/src/tests/JIT/Directed/coverage/oldtests/ovflrem2.il index d6f48536b31d93..c8ea27b458bcbe 100644 --- a/src/tests/JIT/Directed/coverage/oldtests/ovflrem2.il +++ b/src/tests/JIT/Directed/coverage/oldtests/ovflrem2.il @@ -3,6 +3,7 @@ .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -14,6 +15,9 @@ { .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 diff --git a/src/tests/JIT/Directed/coverage/oldtests/stfldstatic1.il b/src/tests/JIT/Directed/coverage/oldtests/stfldstatic1.il index 59c4332c2a78f6..34c410261ee0ba 100644 --- a/src/tests/JIT/Directed/coverage/oldtests/stfldstatic1.il +++ b/src/tests/JIT/Directed/coverage/oldtests/stfldstatic1.il @@ -3,6 +3,7 @@ // stfld on static .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -26,6 +27,9 @@ .field private int32 a .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 196 (0xc4) .maxstack 7 diff --git a/src/tests/JIT/Directed/coverage/oldtests/stfldstatic2.il b/src/tests/JIT/Directed/coverage/oldtests/stfldstatic2.il index 3943591e2f7f8c..b6e1fffc31cb69 100644 --- a/src/tests/JIT/Directed/coverage/oldtests/stfldstatic2.il +++ b/src/tests/JIT/Directed/coverage/oldtests/stfldstatic2.il @@ -3,6 +3,7 @@ // volatile. stfld on static field .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -26,6 +27,9 @@ .field private int32 a .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 196 (0xc4) .maxstack 7 diff --git a/src/tests/JIT/Directed/coverage/oldtests/switchdefaultonly1.il b/src/tests/JIT/Directed/coverage/oldtests/switchdefaultonly1.il index 1cf874edb2b54e..84febf17680c12 100644 --- a/src/tests/JIT/Directed/coverage/oldtests/switchdefaultonly1.il +++ b/src/tests/JIT/Directed/coverage/oldtests/switchdefaultonly1.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -13,6 +14,9 @@ { .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 49 (0x31) .maxstack 2 diff --git a/src/tests/JIT/Directed/coverage/oldtests/switchdefaultonly2.il b/src/tests/JIT/Directed/coverage/oldtests/switchdefaultonly2.il index df2042d654f1fa..2fe97a97014523 100644 --- a/src/tests/JIT/Directed/coverage/oldtests/switchdefaultonly2.il +++ b/src/tests/JIT/Directed/coverage/oldtests/switchdefaultonly2.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -13,6 +14,9 @@ { .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 49 (0x31) .maxstack 2 diff --git a/src/tests/JIT/Directed/coverage/oldtests/switchdefaultonly3.il b/src/tests/JIT/Directed/coverage/oldtests/switchdefaultonly3.il index 67bb6dc5a199e4..8a03aadc3eca48 100644 --- a/src/tests/JIT/Directed/coverage/oldtests/switchdefaultonly3.il +++ b/src/tests/JIT/Directed/coverage/oldtests/switchdefaultonly3.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -13,6 +14,9 @@ { .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 49 (0x31) .maxstack 2 diff --git a/src/tests/JIT/Directed/coverage/oldtests/tlstest.il b/src/tests/JIT/Directed/coverage/oldtests/tlstest.il index 7cabc7a33bdab6..b3d705dc85bf3d 100644 --- a/src/tests/JIT/Directed/coverage/oldtests/tlstest.il +++ b/src/tests/JIT/Directed/coverage/oldtests/tlstest.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly extern tls1 {} @@ -37,6 +38,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals (uint8& pinned V_0) diff --git a/src/tests/JIT/Directed/coverage/oldtests/volatilecpobj.il b/src/tests/JIT/Directed/coverage/oldtests/volatilecpobj.il index 7ab2007b4d18ab..3a2c2de5eaedcd 100644 --- a/src/tests/JIT/Directed/coverage/oldtests/volatilecpobj.il +++ b/src/tests/JIT/Directed/coverage/oldtests/volatilecpobj.il @@ -3,6 +3,7 @@ // volatilecpobj.il .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -159,6 +160,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0) diff --git a/src/tests/JIT/Directed/coverage/oldtests/zeroinit.il b/src/tests/JIT/Directed/coverage/oldtests/zeroinit.il index 7be45e74b88426..ac3e75e2cd5df1 100644 --- a/src/tests/JIT/Directed/coverage/oldtests/zeroinit.il +++ b/src/tests/JIT/Directed/coverage/oldtests/zeroinit.il @@ -3,6 +3,7 @@ //testing .zeroinit .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -35,6 +36,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .zeroinit // Code size 569 (0x239) diff --git a/src/tests/JIT/Directed/debugging/debuginfo/README.txt b/src/tests/JIT/Directed/debugging/debuginfo/README.txt new file mode 100644 index 00000000000000..5f617336c94ae1 --- /dev/null +++ b/src/tests/JIT/Directed/debugging/debuginfo/README.txt @@ -0,0 +1,24 @@ +This directory contains tests for debugging information generated by the JIT. +The tests are written in IL inside the tests.il file by creating a method in the +DebugInfoMethods class and marking them with the ExpectedILMappings attribute. +In that attribute, the IL offsets at which mappings are expected to be generated +can be specified for both debug (DebuggableAttribute with +DisableOptimizations) and optimized builds. + +To debug these tests, run the 'tester' project, which will JIT all methods in +tests.il in both debug and release (you may need to turn off tiered +compilation). + +* attribute.cs/csproj: Project containing ExpectedILMappingsAttribute, to avoid + circular dependencies + +* tests.il: File containing the tests marked with ExpectedILMappings + +* tests_d.ilproj/tests_r.ilproj: Both these projects just add tests.il, the only + difference is that the former has DebuggableAttribute with + DisableOptimizations and the latter does not. + +* tester.cs/csproj: The orchestrator of the tests, references tests_d and + tests_r and jits the test methods using RuntimeHelpers.PrepareMethod, collects + the IL mappings emitted using runtime events, and validates that the mappings + match the data in ExpectedILMappings. diff --git a/src/tests/JIT/Directed/debugging/debuginfo/attribute.cs b/src/tests/JIT/Directed/debugging/debuginfo/attribute.cs new file mode 100644 index 00000000000000..a1eb62d17c805f --- /dev/null +++ b/src/tests/JIT/Directed/debugging/debuginfo/attribute.cs @@ -0,0 +1,11 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; + +[AttributeUsage(AttributeTargets.Method)] +public class ExpectedILMappings : Attribute +{ + public int[] Debug { get; set; } + public int[] Opts { get; set; } +} diff --git a/src/tests/JIT/Directed/debugging/debuginfo/attribute.csproj b/src/tests/JIT/Directed/debugging/debuginfo/attribute.csproj new file mode 100644 index 00000000000000..46f3565c362fea --- /dev/null +++ b/src/tests/JIT/Directed/debugging/debuginfo/attribute.csproj @@ -0,0 +1,10 @@ + + + Library + false + BuildOnly + + + + + diff --git a/src/tests/JIT/Directed/debugging/debuginfo/isdebug.il b/src/tests/JIT/Directed/debugging/debuginfo/isdebug.il new file mode 100644 index 00000000000000..2998979d1ad194 --- /dev/null +++ b/src/tests/JIT/Directed/debugging/debuginfo/isdebug.il @@ -0,0 +1 @@ +#define DEBUG \ No newline at end of file diff --git a/src/tests/JIT/Directed/debugging/debuginfo/tester.cs b/src/tests/JIT/Directed/debugging/debuginfo/tester.cs new file mode 100644 index 00000000000000..6f501c96f0020b --- /dev/null +++ b/src/tests/JIT/Directed/debugging/debuginfo/tester.cs @@ -0,0 +1,149 @@ +extern alias tests_d; +extern alias tests_r; + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Diagnostics.Tracing; +using System.Linq; +using System.Reflection; +using System.Runtime.CompilerServices; +using Microsoft.Diagnostics.Tools.RuntimeClient; +using Microsoft.Diagnostics.Tracing; +using Microsoft.Diagnostics.Tracing.Parsers; +using Microsoft.Diagnostics.Tracing.Parsers.Clr; +using Tracing.Tests.Common; +using DebugInfoMethodsD = tests_d::DebugInfoMethods; +using DebugInfoMethodsR = tests_r::DebugInfoMethods; + +public unsafe class DebugInfoTest +{ + public static unsafe int Main() + { + var keywords = + ClrTraceEventParser.Keywords.Jit | ClrTraceEventParser.Keywords.JittedMethodILToNativeMap; + + var dotnetRuntimeProvider = new List + { + new Provider("Microsoft-Windows-DotNETRuntime", eventLevel: EventLevel.Verbose, keywords: (ulong)keywords) + }; + + var config = new SessionConfiguration(1024, EventPipeSerializationFormat.NetTrace, dotnetRuntimeProvider); + + return + IpcTraceTest.RunAndValidateEventCounts( + new Dictionary(), + JitMethods, + config, + ValidateMappings); + } + + private static void JitMethods() + { + ProcessType(typeof(DebugInfoMethodsD)); + ProcessType(typeof(DebugInfoMethodsR)); + } + + private static void ProcessType(Type t) + { + foreach (MethodInfo mi in t.GetMethods()) + { + if (mi.GetCustomAttribute() != null) + { + RuntimeHelpers.PrepareMethod(mi.MethodHandle); + } + } + } + + private static Func ValidateMappings(EventPipeEventSource source) + { + List<(long MethodID, OptimizationTier Tier, (int ILOffset, int NativeOffset)[] Mappings)> methodsWithMappings = new(); + Dictionary methodTier = new(); + + source.Clr.MethodLoad += e => methodTier[e.MethodID] = e.OptimizationTier; + source.Clr.MethodLoadVerbose += e => methodTier[e.MethodID] = e.OptimizationTier; + source.Clr.MethodILToNativeMap += e => + { + var mappings = new (int, int)[e.CountOfMapEntries]; + for (int i = 0; i < mappings.Length; i++) + mappings[i] = (e.ILOffset(i), e.NativeOffset(i)); + + if (!methodTier.TryGetValue(e.MethodID, out OptimizationTier tier)) + tier = OptimizationTier.Unknown; + + methodsWithMappings.Add((e.MethodID, tier, mappings)); + }; + + return () => + { + int result = 100; + foreach ((long methodID, OptimizationTier tier, (int ILOffset, int NativeOffset)[] mappings) in methodsWithMappings) + { + MethodBase meth = s_getMethodBaseByHandle(null, (IntPtr)(void*)methodID); + ExpectedILMappings attrib = meth.GetCustomAttribute(); + if (attrib == null) + { + continue; + } + + string name = $"[{meth.DeclaringType.Assembly.GetName().Name}]{meth.DeclaringType.FullName}.{meth.Name}"; + + // If DebuggableAttribute is saying that the assembly must be debuggable, then verify debug mappings. + // Otherwise verify release mappings. + // This may seem a little strange since we do not use the tier at all -- however, we expect debug + // to never tier and in release, we expect the release mappings to be the "least common denominator", + // i.e. tier0 and tier1 mappings should both be a superset. + // Note that tier0 and MinOptJitted differs in mappings generated exactly due to DebuggableAttribute. + DebuggableAttribute debuggableAttrib = meth.DeclaringType.Assembly.GetCustomAttribute(); + bool debuggableMappings = debuggableAttrib != null && debuggableAttrib.IsJITOptimizerDisabled; + + Console.WriteLine("{0}: Validate mappings for {1} codegen (tier: {2})", name, debuggableMappings ? "debuggable" : "optimized", tier); + + int[] expected = debuggableMappings ? attrib.Debug : attrib.Opts; + if (expected == null) + { + continue; + } + + if (!ValidateSingle(expected, mappings)) + { + Console.WriteLine(" Validation failed: expected mappings at IL offsets {0}", string.Join(", ", expected.Select(il => $"{il:x3}"))); + Console.WriteLine(" Actual (IL <-> native):"); + foreach ((int ilOffset, int nativeOffset) in mappings) + { + string ilOffsetName = Enum.IsDefined((SpecialILOffset)ilOffset) ? ((SpecialILOffset)ilOffset).ToString() : $"{ilOffset:x3}"; + Console.WriteLine(" {0:x3} <-> {1:x3}", ilOffsetName, nativeOffset); + } + + result = -1; + } + } + + return result; + }; + } + + // Validate that all IL offsets we expected had mappings generated for them. + private static bool ValidateSingle(int[] expected, (int ILOffset, int NativeOffset)[] mappings) + { + return expected.All(il => mappings.Any(t => t.ILOffset == il)); + } + + private enum SpecialILOffset + { + NoMapping = -1, + Prolog = -2, + Epilog = -3, + } + + static DebugInfoTest() + { + Type runtimeMethodHandleInternalType = typeof(RuntimeMethodHandle).Assembly.GetType("System.RuntimeMethodHandleInternal"); + Type runtimeTypeType = typeof(RuntimeMethodHandle).Assembly.GetType("System.RuntimeType"); + MethodInfo getMethodBaseMethod = runtimeTypeType.GetMethod("GetMethodBase", BindingFlags.NonPublic | BindingFlags.Static, new[] { runtimeTypeType, runtimeMethodHandleInternalType }); + s_getMethodBaseByHandle = (delegate*)getMethodBaseMethod.MethodHandle .GetFunctionPointer(); + } + + // Needed to go from MethodID -> MethodBase + private static readonly delegate* s_getMethodBaseByHandle; +} diff --git a/src/tests/JIT/Directed/debugging/debuginfo/tester.csproj b/src/tests/JIT/Directed/debugging/debuginfo/tester.csproj new file mode 100644 index 00000000000000..f3501e7c79878d --- /dev/null +++ b/src/tests/JIT/Directed/debugging/debuginfo/tester.csproj @@ -0,0 +1,15 @@ + + + Exe + PdbOnly + True + True + + + + + + + + + diff --git a/src/tests/JIT/Directed/debugging/debuginfo/tests.il b/src/tests/JIT/Directed/debugging/debuginfo/tests.il new file mode 100644 index 00000000000000..9f6dbfa8a5821c --- /dev/null +++ b/src/tests/JIT/Directed/debugging/debuginfo/tests.il @@ -0,0 +1,258 @@ + +// Metadata version: v4.0.30319 +.assembly extern System.Runtime +{ + .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: + .ver 7:0:0:0 +} +.assembly extern attribute +{ + .ver 0:0:0:0 +} +.assembly extern System.Console +{ + .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: + .ver 7:0:0:0 +} +#ifdef DEBUG +.module tests_d.dll +.assembly tests_d +#else +.module tests_r.dll +.assembly tests_r +#endif +{ + .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 + .ver 0:0:0:0 +} +// MVID: {D4625784-B5B9-4F12-8B8C-0423DDB744AA} +.imagebase 0x10000000 +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 // WINDOWS_CUI +.corflags 0x00000001 // ILONLY + +.class public auto ansi beforefieldinit DebugInfoMethods + extends [System.Runtime]System.Object +{ + .method public hidebysig static void TestUninlined() cil managed + { + .custom instance void [attribute]ExpectedILMappings::.ctor() = { + property int32[] Debug = int32[2]( 0 6 ) + property int32[] Opts = int32[2]( 0 6 ) + } + .maxstack 8 + IL_0000: call int32 DebugInfoMethods::NeverInlined() + IL_0005: pop + IL_0006: call int32 DebugInfoMethods::NeverInlined() + IL_000b: pop + IL_000c: ret + } + + .method public hidebysig static int32 TestLateFailingInlineCandidate() cil managed + { + .custom instance void [attribute]ExpectedILMappings::.ctor() = { + property int32[] Debug = int32[2]( 0 6 ) + property int32[] Opts = int32[2]( 0 6 ) + } + .maxstack 2 + .locals init (int32 V_0) + IL_0000: call int32 DebugInfoMethods::NeverInlined() + IL_0005: pop + IL_0006: call int32 DebugInfoMethods::NotInlinedByAnalysis() + IL_000b: ldc.i4.5 + IL_000c: add + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: ret + } + + .method public hidebysig static int32 TestSucceedingInlineCandidate() cil managed + { + // We still expect a mapping where the call was inlined. + .custom instance void [attribute]ExpectedILMappings::.ctor() = { + property int32[] Debug = int32[2]( 0 6 ) + property int32[] Opts = int32[2]( 0 6 ) + } + .maxstack 2 + .locals init (int32 V_0) + IL_0000: call int32 DebugInfoMethods::NeverInlined() + IL_0005: pop + IL_0006: call int32 DebugInfoMethods::AggressivelyInlined() + IL_000b: ldc.i4.5 + IL_000c: add + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: ret + } + + .method public hidebysig static int32 TestControlFlow(int32 arg) cil managed + { + .custom instance void [attribute]ExpectedILMappings::.ctor() = { + // Note: We really would want to validate that we are generating mappings for every call instruction in debug, + // as this is used for the managed-ret-val feature, but the debugger filters out these mappings and does not + // report them in the ETW event. We should probably change this, those mappings should be useful in any case. + property int32[] Debug = int32[10]( 0x0 0x6 0xe 0x12 0x1a 0x1c 0x24 0x28 0x2c 0x34 ) + property int32[] Opts = int32[5]( 0x0 0x6 0x12 0x1c 0x2c ) + } + .maxstack 2 + .locals init (int32 V_0) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldarg.0 + IL_0003: ldc.i4.0 + IL_0004: ble.s IL_001c + + IL_0006: ldloc.0 + IL_0007: call int32 DebugInfoMethods::NeverInlined() + IL_000c: add + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: stloc.0 + IL_0012: ldloc.0 + IL_0013: call int32 DebugInfoMethods::NotInlinedByAnalysis() + IL_0018: add + IL_0019: stloc.0 + IL_001a: br.s IL_0034 + + IL_001c: ldloc.0 + IL_001d: call int32 DebugInfoMethods::NeverInlined() + IL_0022: add + IL_0023: stloc.0 + IL_0024: ldloc.0 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.0 + IL_0028: ldloc.0 + IL_0029: ldc.i4.3 + IL_002a: add + IL_002b: stloc.0 + IL_002c: ldloc.0 + IL_002d: call int32 DebugInfoMethods::NotInlinedByAnalysis() + IL_0032: add + IL_0033: stloc.0 + IL_0034: ldloc.0 + IL_0035: ret + } + + + .method private hidebysig static int32 NeverInlined() cil managed noinlining + { + .maxstack 8 + IL_0000: ldc.i4.5 + IL_0001: ret + } + + .method private hidebysig static int32 NotInlinedByAnalysis() cil managed + { + .maxstack 5 + .locals init (int32 V_0, + int32 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: br.s IL_006f + + IL_0004: ldc.i4.0 + IL_0005: stloc.1 + IL_0006: br.s IL_0062 + + IL_0008: ldc.i4.0 + IL_0009: stloc.2 + IL_000a: br.s IL_0055 + + IL_000c: ldc.i4.0 + IL_000d: stloc.3 + IL_000e: br.s IL_0048 + + IL_0010: ldstr "{0} {1} {2} {3}" + IL_0015: ldc.i4.4 + IL_0016: newarr [System.Runtime]System.Object + IL_001b: dup + IL_001c: ldc.i4.0 + IL_001d: ldloc.0 + IL_001e: box [System.Runtime]System.Int32 + IL_0023: stelem.ref + IL_0024: dup + IL_0025: ldc.i4.1 + IL_0026: ldloc.1 + IL_0027: box [System.Runtime]System.Int32 + IL_002c: stelem.ref + IL_002d: dup + IL_002e: ldc.i4.2 + IL_002f: ldloc.2 + IL_0030: box [System.Runtime]System.Int32 + IL_0035: stelem.ref + IL_0036: dup + IL_0037: ldc.i4.3 + IL_0038: ldloc.3 + IL_0039: box [System.Runtime]System.Int32 + IL_003e: stelem.ref + IL_003f: call void [System.Console]System.Console::WriteLine(string, + object[]) + IL_0044: ldloc.3 + IL_0045: ldc.i4.1 + IL_0046: add + IL_0047: stloc.3 + IL_0048: ldloc.3 + IL_0049: call int32 [System.Runtime]System.Environment::get_TickCount() + IL_004e: neg + IL_004f: blt.s IL_0010 + + IL_0051: ldloc.2 + IL_0052: ldc.i4.1 + IL_0053: add + IL_0054: stloc.2 + IL_0055: ldloc.2 + IL_0056: call int32 [System.Runtime]System.Environment::get_TickCount() + IL_005b: neg + IL_005c: blt.s IL_000c + + IL_005e: ldloc.1 + IL_005f: ldc.i4.1 + IL_0060: add + IL_0061: stloc.1 + IL_0062: ldloc.1 + IL_0063: call int32 [System.Runtime]System.Environment::get_TickCount() + IL_0068: neg + IL_0069: blt.s IL_0008 + + IL_006b: ldloc.0 + IL_006c: ldc.i4.1 + IL_006d: add + IL_006e: stloc.0 + IL_006f: ldloc.0 + IL_0070: call int32 [System.Runtime]System.Environment::get_TickCount() + IL_0075: neg + IL_0076: blt.s IL_0004 + + IL_0078: ldc.i4.5 + IL_0079: ret + } + + .method private hidebysig static int32 AggressivelyInlined() cil managed aggressiveinlining + { + call int32 DebugInfoMethods::NeverInlined() + pop + call int32 DebugInfoMethods::NeverInlined() + ret + } + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [System.Runtime]System.Object::.ctor() + IL_0006: ret + } + +} \ No newline at end of file diff --git a/src/tests/JIT/Directed/debugging/debuginfo/tests_d.ilproj b/src/tests/JIT/Directed/debugging/debuginfo/tests_d.ilproj new file mode 100644 index 00000000000000..ef6b20b8008737 --- /dev/null +++ b/src/tests/JIT/Directed/debugging/debuginfo/tests_d.ilproj @@ -0,0 +1,12 @@ + + + library + $(IlasmFlags) -DEBUG=IMPL + BuildOnly + + + + + + + diff --git a/src/tests/JIT/Directed/debugging/debuginfo/tests_r.ilproj b/src/tests/JIT/Directed/debugging/debuginfo/tests_r.ilproj new file mode 100644 index 00000000000000..0efd259b28c5ca --- /dev/null +++ b/src/tests/JIT/Directed/debugging/debuginfo/tests_r.ilproj @@ -0,0 +1,11 @@ + + + library + $(IlasmFlags) -DEBUG=OPT + BuildOnly + + + + + + diff --git a/src/tests/JIT/Directed/debugging/poison.cs b/src/tests/JIT/Directed/debugging/poisoning/poison.cs similarity index 67% rename from src/tests/JIT/Directed/debugging/poison.cs rename to src/tests/JIT/Directed/debugging/poisoning/poison.cs index 463894a4e6a35d..9cb366119ccbdb 100644 --- a/src/tests/JIT/Directed/debugging/poison.cs +++ b/src/tests/JIT/Directed/debugging/poisoning/poison.cs @@ -19,6 +19,22 @@ public static unsafe int Main() WithoutGCRef poisoned2; Unsafe.SkipInit(out poisoned2); result &= VerifyPoison(&poisoned2, sizeof(WithoutGCRef)); + + Massive poisoned3; + Unsafe.SkipInit(out poisoned3); + result &= VerifyPoison(&poisoned3, sizeof(Massive)); + + WithoutGCRef poisoned4; + Unsafe.SkipInit(out poisoned4); + result &= VerifyPoison(&poisoned4, sizeof(WithoutGCRef)); + + Massive poisoned5; + Unsafe.SkipInit(out poisoned5); + result &= VerifyPoison(&poisoned5, sizeof(Massive)); + + GCRef zeroed2; + Unsafe.SkipInit(out zeroed2); + result &= VerifyZero(Unsafe.AsPointer(ref zeroed2), Unsafe.SizeOf()); return result ? 100 : 101; } @@ -53,4 +69,9 @@ private struct WithoutGCRef public int ANumber; public float AFloat; } + + private unsafe struct Massive + { + public fixed byte Bytes[0x10008]; + } } diff --git a/src/tests/JIT/Directed/debugging/poison.csproj b/src/tests/JIT/Directed/debugging/poisoning/poison.csproj similarity index 100% rename from src/tests/JIT/Directed/debugging/poison.csproj rename to src/tests/JIT/Directed/debugging/poisoning/poison.csproj diff --git a/src/tests/JIT/Directed/forceinlining/AttributeConflict.il b/src/tests/JIT/Directed/forceinlining/AttributeConflict.il index 5f9ec7098740c5..77d652a488022b 100644 --- a/src/tests/JIT/Directed/forceinlining/AttributeConflict.il +++ b/src/tests/JIT/Directed/forceinlining/AttributeConflict.il @@ -6,6 +6,7 @@ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern System.Console { @@ -650,6 +651,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 190 (0xbe) .maxstack 4 diff --git a/src/tests/JIT/Directed/forceinlining/NegativeCases.il b/src/tests/JIT/Directed/forceinlining/NegativeCases.il index 707cd0783d106f..a4e8f8eb264f90 100644 --- a/src/tests/JIT/Directed/forceinlining/NegativeCases.il +++ b/src/tests/JIT/Directed/forceinlining/NegativeCases.il @@ -6,6 +6,7 @@ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern System.Console { @@ -67,6 +68,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 71 (0x47) .maxstack 2 diff --git a/src/tests/JIT/Directed/forceinlining/PositiveCases.il b/src/tests/JIT/Directed/forceinlining/PositiveCases.il index 7d74bb1bc13973..02537d0464358f 100644 --- a/src/tests/JIT/Directed/forceinlining/PositiveCases.il +++ b/src/tests/JIT/Directed/forceinlining/PositiveCases.il @@ -6,6 +6,7 @@ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern System.Console { @@ -398,6 +399,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 314 (0x13a) .maxstack 3 diff --git a/src/tests/JIT/Directed/intrinsic/interlocked/rva_rvaStatic1.il b/src/tests/JIT/Directed/intrinsic/interlocked/rva_rvaStatic1.il index 9633a2c5f6f86d..cfc557b9c23978 100644 --- a/src/tests/JIT/Directed/intrinsic/interlocked/rva_rvaStatic1.il +++ b/src/tests/JIT/Directed/intrinsic/interlocked/rva_rvaStatic1.il @@ -8,6 +8,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) @@ -12023,6 +12024,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 IL_0000: call bool IntrinsicTest::MainTest() diff --git a/src/tests/JIT/Directed/intrinsic/interlocked/rva_rvaStatic2.il b/src/tests/JIT/Directed/intrinsic/interlocked/rva_rvaStatic2.il index adae4ef7641d0f..5ef9b79d8bb96f 100644 --- a/src/tests/JIT/Directed/intrinsic/interlocked/rva_rvaStatic2.il +++ b/src/tests/JIT/Directed/intrinsic/interlocked/rva_rvaStatic2.il @@ -8,6 +8,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) @@ -12009,6 +12010,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 IL_0000: call bool IntrinsicTest::MainTest() diff --git a/src/tests/JIT/Directed/intrinsic/interlocked/rva_rvaStatic3.il b/src/tests/JIT/Directed/intrinsic/interlocked/rva_rvaStatic3.il index aca149dd826441..3b2209584a3dcb 100644 --- a/src/tests/JIT/Directed/intrinsic/interlocked/rva_rvaStatic3.il +++ b/src/tests/JIT/Directed/intrinsic/interlocked/rva_rvaStatic3.il @@ -8,6 +8,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) @@ -1099,6 +1100,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 IL_0000: call bool IntrinsicTest::MainTest() diff --git a/src/tests/JIT/Directed/intrinsic/interlocked/rva_rvaStatic4.il b/src/tests/JIT/Directed/intrinsic/interlocked/rva_rvaStatic4.il index 7b2f5a74b3ea41..7859bb1d04f4b1 100644 --- a/src/tests/JIT/Directed/intrinsic/interlocked/rva_rvaStatic4.il +++ b/src/tests/JIT/Directed/intrinsic/interlocked/rva_rvaStatic4.il @@ -8,6 +8,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) @@ -1098,6 +1099,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 IL_0000: call bool IntrinsicTest::MainTest() diff --git a/src/tests/JIT/Directed/leave/catch1.il b/src/tests/JIT/Directed/leave/catch1.il index f8e365e3ac0180..2219c41298420a 100644 --- a/src/tests/JIT/Directed/leave/catch1.il +++ b/src/tests/JIT/Directed/leave/catch1.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -1226,6 +1227,9 @@ start_try14: .method public static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 156 (0x9c) .maxstack 20 diff --git a/src/tests/JIT/Directed/leave/catch2.il b/src/tests/JIT/Directed/leave/catch2.il index 7eb14bcddb0501..bad14490a2a9b3 100644 --- a/src/tests/JIT/Directed/leave/catch2.il +++ b/src/tests/JIT/Directed/leave/catch2.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -1001,6 +1002,9 @@ .method public static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 81 (0x51) .maxstack 30 diff --git a/src/tests/JIT/Directed/leave/catch3.il b/src/tests/JIT/Directed/leave/catch3.il index c74ecd9559f670..fa10779ab8415a 100644 --- a/src/tests/JIT/Directed/leave/catch3.il +++ b/src/tests/JIT/Directed/leave/catch3.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -831,6 +832,9 @@ .method public hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 76 (0x4c) .maxstack 4 diff --git a/src/tests/JIT/Directed/leave/filter1.il b/src/tests/JIT/Directed/leave/filter1.il index b49f883cfa5450..19bb70087f82e3 100644 --- a/src/tests/JIT/Directed/leave/filter1.il +++ b/src/tests/JIT/Directed/leave/filter1.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -1641,6 +1642,9 @@ .method public static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 156 (0x9c) .maxstack 20 diff --git a/src/tests/JIT/Directed/leave/filter2.il b/src/tests/JIT/Directed/leave/filter2.il index 10420a0cee4425..475e505220ad4b 100644 --- a/src/tests/JIT/Directed/leave/filter2.il +++ b/src/tests/JIT/Directed/leave/filter2.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -1213,6 +1214,9 @@ .method public static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 81 (0x51) .maxstack 30 diff --git a/src/tests/JIT/Directed/leave/filter3.il b/src/tests/JIT/Directed/leave/filter3.il index d87a659510cbfa..aa30362476c05f 100644 --- a/src/tests/JIT/Directed/leave/filter3.il +++ b/src/tests/JIT/Directed/leave/filter3.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -1004,6 +1005,9 @@ .method public hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 76 (0x4c) .maxstack 4 diff --git a/src/tests/JIT/Directed/leave/try1.il b/src/tests/JIT/Directed/leave/try1.il index 2c5867ca014f72..8fc2879bf00aa6 100644 --- a/src/tests/JIT/Directed/leave/try1.il +++ b/src/tests/JIT/Directed/leave/try1.il @@ -4,6 +4,7 @@ //different datatype in try block // .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -1124,6 +1125,9 @@ .method public static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 156 (0x9c) .maxstack 20 diff --git a/src/tests/JIT/Directed/leave/try2.il b/src/tests/JIT/Directed/leave/try2.il index 4419a23b31a02d..c2906e820189c7 100644 --- a/src/tests/JIT/Directed/leave/try2.il +++ b/src/tests/JIT/Directed/leave/try2.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -890,6 +891,9 @@ .method public static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 81 (0x51) .maxstack 30 diff --git a/src/tests/JIT/Directed/leave/try3.il b/src/tests/JIT/Directed/leave/try3.il index 121947d1b29fac..209c6478163e85 100644 --- a/src/tests/JIT/Directed/leave/try3.il +++ b/src/tests/JIT/Directed/leave/try3.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -613,6 +614,9 @@ .method public static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 76 (0x4c) .maxstack 4 diff --git a/src/tests/JIT/Directed/nullabletypes/gettype.cs b/src/tests/JIT/Directed/nullabletypes/gettype.cs new file mode 100644 index 00000000000000..15bbef729d26f9 --- /dev/null +++ b/src/tests/JIT/Directed/nullabletypes/gettype.cs @@ -0,0 +1,48 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Linq; +using System.Collections.Generic; + +class C +{ + public IEnumerable Data { get; set; } + + public C() { } + + public bool Check() + { + return Data.ElementAt(0).GetType() == typeof(bool); + } +} + +public class P +{ + public static int Main() + { + C c = new(); + + // Try a nullable with value + c.Data = new List { true }; + if(!c.Check()) + return 666; + + // Try a nullable without value. Should throw NRE + c.Data = new List { new Nullable() }; + + bool thrown = false; + try + { + c.Check(); + } + catch(NullReferenceException) + { + thrown = true; + } + if(!thrown) + return 667; + return 100; + } +} + diff --git a/src/tests/JIT/Directed/nullabletypes/gettype_d.csproj b/src/tests/JIT/Directed/nullabletypes/gettype_d.csproj new file mode 100644 index 00000000000000..749b1f23c89758 --- /dev/null +++ b/src/tests/JIT/Directed/nullabletypes/gettype_d.csproj @@ -0,0 +1,13 @@ + + + Exe + 1 + + + Full + False + + + + + diff --git a/src/tests/JIT/Directed/nullabletypes/gettype_do.csproj b/src/tests/JIT/Directed/nullabletypes/gettype_do.csproj new file mode 100644 index 00000000000000..34744812c89277 --- /dev/null +++ b/src/tests/JIT/Directed/nullabletypes/gettype_do.csproj @@ -0,0 +1,13 @@ + + + Exe + 1 + + + Full + True + + + + + diff --git a/src/tests/JIT/Directed/nullabletypes/gettype_r.csproj b/src/tests/JIT/Directed/nullabletypes/gettype_r.csproj new file mode 100644 index 00000000000000..fea75d031b0ed3 --- /dev/null +++ b/src/tests/JIT/Directed/nullabletypes/gettype_r.csproj @@ -0,0 +1,13 @@ + + + Exe + 1 + + + None + False + + + + + diff --git a/src/tests/JIT/Directed/nullabletypes/gettype_ro.csproj b/src/tests/JIT/Directed/nullabletypes/gettype_ro.csproj new file mode 100644 index 00000000000000..f51b4298ce4d6e --- /dev/null +++ b/src/tests/JIT/Directed/nullabletypes/gettype_ro.csproj @@ -0,0 +1,13 @@ + + + Exe + 1 + + + None + True + + + + + diff --git a/src/tests/JIT/Directed/perffix/primitivevt/callconv3.il b/src/tests/JIT/Directed/perffix/primitivevt/callconv3.il index d8bc624acefaaf..0ede6779c6b66c 100644 --- a/src/tests/JIT/Directed/perffix/primitivevt/callconv3.il +++ b/src/tests/JIT/Directed/perffix/primitivevt/callconv3.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly extern helper {} .assembly callconv3 {} @@ -265,6 +266,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 6 .locals init (int32 V_0, diff --git a/src/tests/JIT/Directed/perffix/primitivevt/identity3.il b/src/tests/JIT/Directed/perffix/primitivevt/identity3.il index e3b9f024f79a3b..9e9a6c2ac367b0 100644 --- a/src/tests/JIT/Directed/perffix/primitivevt/identity3.il +++ b/src/tests/JIT/Directed/perffix/primitivevt/identity3.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly extern nativeinthelper {} .assembly identity3 {} @@ -20,6 +21,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 .locals (native int V_0, diff --git a/src/tests/JIT/Directed/pinning/object-pin/Object-Pin.il b/src/tests/JIT/Directed/pinning/object-pin/Object-Pin.il index b3a54f21cfe1c1..58622d4213227e 100644 --- a/src/tests/JIT/Directed/pinning/object-pin/Object-Pin.il +++ b/src/tests/JIT/Directed/pinning/object-pin/Object-Pin.il @@ -4,6 +4,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern legacy library mscorlib {} .assembly objectpin { @@ -89,6 +90,9 @@ LOOP1: .method public static pinvokeimpl("mirror" winapi) void Set_Val(void*,int32 c) il managed preservesig { } .method public static int32 Main(class [mscorlib]System.String[] args) il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 400 ldstr "Calling Not_Pinned() to assure that GC actually moves things" diff --git a/src/tests/JIT/Directed/pinvoke/calli_excep.il b/src/tests/JIT/Directed/pinvoke/calli_excep.il index c6975762c2c1c8..9cb52b3cf30533 100644 --- a/src/tests/JIT/Directed/pinvoke/calli_excep.il +++ b/src/tests/JIT/Directed/pinvoke/calli_excep.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib { } .assembly calli_excep { } @@ -24,6 +25,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .custom instance void [mscorlib]System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptionsAttribute::.ctor() = ( 01 00 00 00 ) .custom instance void [mscorlib]System.Security.SecurityCriticalAttribute::.ctor() = ( 01 00 00 00 ) diff --git a/src/tests/JIT/Directed/pinvoke/jump.il b/src/tests/JIT/Directed/pinvoke/jump.il index 07e505d5cbb6b5..cc5ce795fa8dfc 100644 --- a/src/tests/JIT/Directed/pinvoke/jump.il +++ b/src/tests/JIT/Directed/pinvoke/jump.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -37,6 +38,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 83 (0x53) .maxstack 3 diff --git a/src/tests/JIT/Directed/pinvoke/preemptive_cooperative.il b/src/tests/JIT/Directed/pinvoke/preemptive_cooperative.il index 7a23573734afdf..24d2542dff82de 100644 --- a/src/tests/JIT/Directed/pinvoke/preemptive_cooperative.il +++ b/src/tests/JIT/Directed/pinvoke/preemptive_cooperative.il @@ -4,6 +4,7 @@ .module extern kernel32.dll .assembly extern System.Console { auto } +.assembly extern xunit.core {} .assembly extern System.Threading.Thread { auto } .assembly extern mscorlib { auto } @@ -167,6 +168,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals init (class [System.Threading.Thread]System.Threading.Thread V_0, diff --git a/src/tests/JIT/Directed/pinvoke/sysinfo.il b/src/tests/JIT/Directed/pinvoke/sysinfo.il index 10e245863cc6e7..a3dd590d18c9fb 100644 --- a/src/tests/JIT/Directed/pinvoke/sysinfo.il +++ b/src/tests/JIT/Directed/pinvoke/sysinfo.il @@ -3,6 +3,7 @@ .module extern kernel32 .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -32,6 +33,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 83 (0x53) .maxstack 3 diff --git a/src/tests/JIT/Directed/pinvoke/tail.il b/src/tests/JIT/Directed/pinvoke/tail.il index b3e082a802231d..cd377c77b6b391 100644 --- a/src/tests/JIT/Directed/pinvoke/tail.il +++ b/src/tests/JIT/Directed/pinvoke/tail.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib { } .assembly menus { } @@ -96,6 +97,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 .locals (native uint V_0, diff --git a/src/tests/JIT/Directed/rvastatics/RVAOrderingTest.il b/src/tests/JIT/Directed/rvastatics/RVAOrderingTest.il index 1971e7969af66a..067ce4cc281c76 100644 --- a/src/tests/JIT/Directed/rvastatics/RVAOrderingTest.il +++ b/src/tests/JIT/Directed/rvastatics/RVAOrderingTest.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Runtime { } +.assembly extern xunit.core {} .assembly extern System.Runtime.Extensions { } .assembly extern System.Console { } .assembly RVAOrderingTest { } @@ -16,6 +17,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 106 (0x6a) .maxstack 2 diff --git a/src/tests/JIT/Directed/rvastatics/rvastatic1.il b/src/tests/JIT/Directed/rvastatics/rvastatic1.il index 5b08db37aeba9b..32ec484df74f7f 100644 --- a/src/tests/JIT/Directed/rvastatics/rvastatic1.il +++ b/src/tests/JIT/Directed/rvastatics/rvastatic1.il @@ -1,4 +1,5 @@ .assembly extern mscorlib{} +.assembly extern xunit.core {} .assembly rvastatic1{} .class public A{ .method static native int Call1(int64) {.maxstack 50 @@ -7074,6 +7075,9 @@ a010126: a010127: ret} .method static int32 Main(string[] args){.entrypoint .maxstack 5 + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) call void [rvastatic1]A::V1() call void [rvastatic1]A::V2() call void [rvastatic1]A::V3() diff --git a/src/tests/JIT/Directed/rvastatics/rvastatic2.il b/src/tests/JIT/Directed/rvastatics/rvastatic2.il index 08538a6f91d082..323589685773bd 100644 --- a/src/tests/JIT/Directed/rvastatics/rvastatic2.il +++ b/src/tests/JIT/Directed/rvastatics/rvastatic2.il @@ -1,4 +1,5 @@ .assembly extern mscorlib{} +.assembly extern xunit.core {} .assembly rvastatic2{} .class public A{ .method static native int Call1(int64) {.maxstack 50 @@ -7087,6 +7088,9 @@ a010126: a010127: ret} .method static int32 Main(string[] args){.entrypoint .maxstack 5 + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) call void [rvastatic2]A::V1() call void [rvastatic2]A::V2() call void [rvastatic2]A::V3() diff --git a/src/tests/JIT/Directed/rvastatics/rvastatic3.il b/src/tests/JIT/Directed/rvastatics/rvastatic3.il index 2ce179ad271ba0..9feb1889c137f6 100644 --- a/src/tests/JIT/Directed/rvastatics/rvastatic3.il +++ b/src/tests/JIT/Directed/rvastatics/rvastatic3.il @@ -1,4 +1,5 @@ .assembly extern mscorlib{} +.assembly extern xunit.core {} .assembly rvastatic3{} .class public A{ .method static native int Call1(int64) {.maxstack 50 @@ -7089,6 +7090,9 @@ a010126: a010127: ret} .method static int32 Main(string[] args){.entrypoint .maxstack 5 + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) call void [rvastatic3]A::V1() call void [rvastatic3]A::V2() call void [rvastatic3]A::V3() diff --git a/src/tests/JIT/Directed/rvastatics/rvastatic4.il b/src/tests/JIT/Directed/rvastatics/rvastatic4.il index 7ace1b6ee5d184..bc4b7ccedc9c30 100644 --- a/src/tests/JIT/Directed/rvastatics/rvastatic4.il +++ b/src/tests/JIT/Directed/rvastatics/rvastatic4.il @@ -1,4 +1,5 @@ .assembly extern mscorlib{} +.assembly extern xunit.core {} .assembly rvastatic4{} .class public A{ .method static native int Call1(int64) {.maxstack 50 @@ -7082,6 +7083,9 @@ a010126: a010127: ret} .method static int32 Main(string[] args){.entrypoint .maxstack 5 + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) call void [rvastatic4]A::V1() call void [rvastatic4]A::V2() call void [rvastatic4]A::V3() diff --git a/src/tests/JIT/Directed/rvastatics/rvastatic5.il b/src/tests/JIT/Directed/rvastatics/rvastatic5.il index 2ac6a7c244e19e..e9490132678128 100644 --- a/src/tests/JIT/Directed/rvastatics/rvastatic5.il +++ b/src/tests/JIT/Directed/rvastatics/rvastatic5.il @@ -1,4 +1,5 @@ .assembly extern mscorlib{} +.assembly extern xunit.core {} .assembly rvastatic5{} .class public A{ .method static native int Call1(int64) {.maxstack 50 @@ -7066,6 +7067,9 @@ a010126: a010127: ret} .method static int32 Main(string[] args){.entrypoint .maxstack 5 + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) call void [rvastatic5]A::V1() call void [rvastatic5]A::V2() call void [rvastatic5]A::V3() diff --git a/src/tests/JIT/Directed/shift/int8.il b/src/tests/JIT/Directed/shift/int8.il index 7a5db06b02ab0a..913ab2dc5ba6d7 100644 --- a/src/tests/JIT/Directed/shift/int8.il +++ b/src/tests/JIT/Directed/shift/int8.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} @@ -135,6 +136,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 839 (0x347) .maxstack 4 diff --git a/src/tests/JIT/Directed/shift/nativeint.il b/src/tests/JIT/Directed/shift/nativeint.il index 389637e2a3cd29..4b1e84a8ffa4b8 100644 --- a/src/tests/JIT/Directed/shift/nativeint.il +++ b/src/tests/JIT/Directed/shift/nativeint.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} @@ -135,6 +136,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 839 (0x347) .maxstack 4 diff --git a/src/tests/JIT/Directed/shift/nativeuint.il b/src/tests/JIT/Directed/shift/nativeuint.il index b98274053bb788..f2aecf73a64fbf 100644 --- a/src/tests/JIT/Directed/shift/nativeuint.il +++ b/src/tests/JIT/Directed/shift/nativeuint.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} @@ -135,6 +136,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 839 (0x347) .maxstack 4 diff --git a/src/tests/JIT/Directed/tailcall/more_tailcalls.il b/src/tests/JIT/Directed/tailcall/more_tailcalls.il index 84be13bab3cbda..3dae96347c7d93 100644 --- a/src/tests/JIT/Directed/tailcall/more_tailcalls.il +++ b/src/tests/JIT/Directed/tailcall/more_tailcalls.il @@ -10,6 +10,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: .ver 5:0:0:0 } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: @@ -949,6 +950,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 1835 (0x72b) .maxstack 4 diff --git a/src/tests/JIT/Directed/tailcall/tailcall.il b/src/tests/JIT/Directed/tailcall/tailcall.il index f94c43ebae1c04..0a0cec99a0b31a 100644 --- a/src/tests/JIT/Directed/tailcall/tailcall.il +++ b/src/tests/JIT/Directed/tailcall/tailcall.il @@ -3,6 +3,7 @@ .assembly extern System.Console { auto } +.assembly extern xunit.core {} .assembly extern System.Runtime.Extensions { auto } .assembly extern mscorlib { auto } @@ -254,6 +255,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals init (class Class1 V_0, diff --git a/src/tests/JIT/Directed/throwbox/fault.il b/src/tests/JIT/Directed/throwbox/fault.il index 81f398dad72202..6973caff7ce614 100644 --- a/src/tests/JIT/Directed/throwbox/fault.il +++ b/src/tests/JIT/Directed/throwbox/fault.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -16,6 +17,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 115 (0x73) .maxstack 2 diff --git a/src/tests/JIT/Directed/throwbox/filter.il b/src/tests/JIT/Directed/throwbox/filter.il index e277706ffb3afc..e9b737e4c0be71 100644 --- a/src/tests/JIT/Directed/throwbox/filter.il +++ b/src/tests/JIT/Directed/throwbox/filter.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -16,6 +17,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 120 (0x78) .maxstack 2 diff --git a/src/tests/JIT/Directed/throwbox/finally.il b/src/tests/JIT/Directed/throwbox/finally.il index 6822a205c2edd9..93698e1b4a0ea1 100644 --- a/src/tests/JIT/Directed/throwbox/finally.il +++ b/src/tests/JIT/Directed/throwbox/finally.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -16,6 +17,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 115 (0x73) .maxstack 2 diff --git a/src/tests/JIT/Directed/throwbox/rethrow.il b/src/tests/JIT/Directed/throwbox/rethrow.il index f45ba04b4da915..35ae886c50e784 100644 --- a/src/tests/JIT/Directed/throwbox/rethrow.il +++ b/src/tests/JIT/Directed/throwbox/rethrow.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -16,6 +17,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 120 (0x78) .maxstack 2 diff --git a/src/tests/JIT/Directed/zeroinit/Dev10_863995.il b/src/tests/JIT/Directed/zeroinit/Dev10_863995.il index bb169c8e0dc835..27cde55a025e0e 100644 --- a/src/tests/JIT/Directed/zeroinit/Dev10_863995.il +++ b/src/tests/JIT/Directed/zeroinit/Dev10_863995.il @@ -5,6 +5,7 @@ // Metadata version: v4.0.21104 .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -85,6 +86,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // .maxstack 17 diff --git a/src/tests/JIT/Directed/zeroinit/init_byte.il b/src/tests/JIT/Directed/zeroinit/init_byte.il index 23d6e4efab31fe..2a721820b2b5d5 100644 --- a/src/tests/JIT/Directed/zeroinit/init_byte.il +++ b/src/tests/JIT/Directed/zeroinit/init_byte.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -430,6 +431,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 709 (0x2c5) .maxstack 4 diff --git a/src/tests/JIT/Directed/zeroinit/init_int32.il b/src/tests/JIT/Directed/zeroinit/init_int32.il index a30dbc8a71ace2..f9be1f5c637a3b 100644 --- a/src/tests/JIT/Directed/zeroinit/init_int32.il +++ b/src/tests/JIT/Directed/zeroinit/init_int32.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -417,6 +418,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 709 (0x2c5) .maxstack 4 diff --git a/src/tests/JIT/Directed/zeroinit/init_int64.il b/src/tests/JIT/Directed/zeroinit/init_int64.il index 5f931b40c832a8..124e01d68373d1 100644 --- a/src/tests/JIT/Directed/zeroinit/init_int64.il +++ b/src/tests/JIT/Directed/zeroinit/init_int64.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -430,6 +431,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 709 (0x2c5) .maxstack 4 diff --git a/src/tests/JIT/Directed/zeroinit/init_struct.il b/src/tests/JIT/Directed/zeroinit/init_struct.il index bce5a1e560c9a5..da55918580a8b2 100644 --- a/src/tests/JIT/Directed/zeroinit/init_struct.il +++ b/src/tests/JIT/Directed/zeroinit/init_struct.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -477,6 +478,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 740 (0x2e4) .maxstack 4 diff --git a/src/tests/JIT/Directed/zeroinit/init_uint32.il b/src/tests/JIT/Directed/zeroinit/init_uint32.il index 52a1cee97587e8..4fb204c4af0e40 100644 --- a/src/tests/JIT/Directed/zeroinit/init_uint32.il +++ b/src/tests/JIT/Directed/zeroinit/init_uint32.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -417,6 +418,9 @@ .method private hidebysig static unsigned int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 709 (0x2c5) .maxstack 4 diff --git a/src/tests/JIT/Directed/zeroinit/init_uint64.il b/src/tests/JIT/Directed/zeroinit/init_uint64.il index 679bd19fce706f..c3b2e2a9f75409 100644 --- a/src/tests/JIT/Directed/zeroinit/init_uint64.il +++ b/src/tests/JIT/Directed/zeroinit/init_uint64.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -430,6 +431,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 709 (0x2c5) .maxstack 4 diff --git a/src/tests/JIT/Directed/zeroinit/tail.il b/src/tests/JIT/Directed/zeroinit/tail.il index 6c430155ea47c7..df7547e6a43571 100644 --- a/src/tests/JIT/Directed/zeroinit/tail.il +++ b/src/tests/JIT/Directed/zeroinit/tail.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -66,6 +67,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 81 (0x51) .maxstack 2 diff --git a/src/tests/JIT/Generics/ConstrainedCall/class1.il b/src/tests/JIT/Generics/ConstrainedCall/class1.il index 044b77c628cba5..35ce0a76762dca 100644 --- a/src/tests/JIT/Generics/ConstrainedCall/class1.il +++ b/src/tests/JIT/Generics/ConstrainedCall/class1.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly class1 {} .class interface private abstract auto ansi IncrDecr @@ -245,6 +246,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals init (class MyCounter V_0, diff --git a/src/tests/JIT/Generics/ConstrainedCall/class2.il b/src/tests/JIT/Generics/ConstrainedCall/class2.il index e16cec3d8b41a5..fea004ef58a016 100644 --- a/src/tests/JIT/Generics/ConstrainedCall/class2.il +++ b/src/tests/JIT/Generics/ConstrainedCall/class2.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly class2 {} .class interface private abstract auto ansi IncrDecr @@ -310,6 +311,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals init (class MyCounter V_0, diff --git a/src/tests/JIT/Generics/ConstrainedCall/vt1.il b/src/tests/JIT/Generics/ConstrainedCall/vt1.il index 9a6060de979593..b5802835364047 100644 --- a/src/tests/JIT/Generics/ConstrainedCall/vt1.il +++ b/src/tests/JIT/Generics/ConstrainedCall/vt1.il @@ -6,6 +6,7 @@ // Increment: constrained, Decrement: box .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -232,6 +233,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 361 (0x169) .maxstack 3 diff --git a/src/tests/JIT/Generics/ConstrainedCall/vt2.il b/src/tests/JIT/Generics/ConstrainedCall/vt2.il index 5c6d293d8bb018..f537653f1d7c13 100644 --- a/src/tests/JIT/Generics/ConstrainedCall/vt2.il +++ b/src/tests/JIT/Generics/ConstrainedCall/vt2.il @@ -6,6 +6,7 @@ // Val*A: constrained, Val*B: box .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -184,6 +185,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 218 (0xda) .maxstack 4 diff --git a/src/tests/JIT/Generics/ConstrainedCall/vt3.il b/src/tests/JIT/Generics/ConstrainedCall/vt3.il index 61eaec9638209b..007f1f17ba45c1 100644 --- a/src/tests/JIT/Generics/ConstrainedCall/vt3.il +++ b/src/tests/JIT/Generics/ConstrainedCall/vt3.il @@ -6,6 +6,7 @@ // Val*A: constrained, Val*B: box .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -201,6 +202,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 218 (0xda) .maxstack 4 diff --git a/src/tests/JIT/Generics/ConstrainedCall/vt4.il b/src/tests/JIT/Generics/ConstrainedCall/vt4.il index d78179c8cd08fb..73b5be192103f4 100644 --- a/src/tests/JIT/Generics/ConstrainedCall/vt4.il +++ b/src/tests/JIT/Generics/ConstrainedCall/vt4.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly vt4 {} .class interface private abstract auto ansi IncrDecr @@ -300,6 +301,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals init (class MyCounter V_0, diff --git a/src/tests/JIT/Generics/regression/DDB148379/ddb148379.il b/src/tests/JIT/Generics/regression/DDB148379/ddb148379.il index 1258de5130d59d..daadbbeba9b145 100644 --- a/src/tests/JIT/Generics/regression/DDB148379/ddb148379.il +++ b/src/tests/JIT/Generics/regression/DDB148379/ddb148379.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} @@ -115,6 +116,9 @@ { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 35 (0x23) .maxstack 8 diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/ArmBase/Yield.cs b/src/tests/JIT/HardwareIntrinsics/Arm/ArmBase/Yield.cs new file mode 100644 index 00000000000000..51f0ded9d94536 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/ArmBase/Yield.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. +// + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.Arm; + +namespace JIT.HardwareIntrinsics.Arm +{ + class Program + { + const int Pass = 100; + const int Fail = 0; + + static unsafe int Main(string[] args) + { + int testResult = ArmBase.IsSupported ? Pass : Fail; + + try + { + ArmBase.Yield(); + } + catch (Exception e) + { + testResult = (ArmBase.IsSupported || (e is not PlatformNotSupportedException)) ? Fail : Pass; + } + + return testResult; + } + } +} diff --git a/src/tests/baseservices/visibility/Target.csproj b/src/tests/JIT/HardwareIntrinsics/Arm/ArmBase/Yield_r.csproj similarity index 50% rename from src/tests/baseservices/visibility/Target.csproj rename to src/tests/JIT/HardwareIntrinsics/Arm/ArmBase/Yield_r.csproj index 0806e62828ffd9..168f77656f101b 100644 --- a/src/tests/baseservices/visibility/Target.csproj +++ b/src/tests/JIT/HardwareIntrinsics/Arm/ArmBase/Yield_r.csproj @@ -1,11 +1,13 @@ - Library + Exe true - SharedLibrary - 1 + + + Embedded + - + diff --git a/src/tests/JIT/HardwareIntrinsics/Arm/ArmBase/Yield_ro.csproj b/src/tests/JIT/HardwareIntrinsics/Arm/ArmBase/Yield_ro.csproj new file mode 100644 index 00000000000000..ac75e1bac6ed05 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/Arm/ArmBase/Yield_ro.csproj @@ -0,0 +1,13 @@ + + + Exe + true + + + Embedded + True + + + + + diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Add.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Add.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Add.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Add.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Add.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Add.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Add.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Add.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/AddSubtract.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/AddSubtract.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/AddSubtract.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/AddSubtract.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/AddSubtract.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/AddSubtract.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/AddSubtract.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/AddSubtract.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/And.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/And.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/And.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/And.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/And.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/And.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/And.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/And.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/AndNot.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/AndNot.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/AndNot.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/AndNot.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/AndNot.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/AndNot.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/AndNot.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/AndNot.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Avx_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Avx_r.csproj similarity index 99% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Avx_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Avx_r.csproj index 4e5e4f001a6929..e3787a57523edf 100644 --- a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Avx_r.csproj +++ b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Avx_r.csproj @@ -156,7 +156,7 @@ - + diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Avx_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Avx_ro.csproj similarity index 99% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Avx_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Avx_ro.csproj index c00588835b6c01..f232c1c7fc691a 100644 --- a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Avx_ro.csproj +++ b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Avx_ro.csproj @@ -154,7 +154,7 @@ - + diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Blend.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Blend.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Blend.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Blend.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/BlendVariable.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/BlendVariable.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/BlendVariable.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/BlendVariable.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/BlendVariable.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/BlendVariable.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/BlendVariable.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/BlendVariable.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Blend_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Blend_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Blend_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Blend_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Blend_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Blend_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Blend_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Blend_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/BroadcastScalarToVector128.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/BroadcastScalarToVector128.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/BroadcastScalarToVector128.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/BroadcastScalarToVector128.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/BroadcastScalarToVector256.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/BroadcastScalarToVector256.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/BroadcastScalarToVector256.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/BroadcastScalarToVector256.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/BroadcastScalarToVector256.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/BroadcastScalarToVector256.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/BroadcastScalarToVector256.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/BroadcastScalarToVector256.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/BroadcastVector128ToVector256.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/BroadcastVector128ToVector256.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/BroadcastVector128ToVector256.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/BroadcastVector128ToVector256.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/BroadcastVector128ToVector256.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/BroadcastVector128ToVector256.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/BroadcastVector128ToVector256.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/BroadcastVector128ToVector256.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Ceiling.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Ceiling.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Ceiling.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Ceiling.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Ceiling.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Ceiling.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Ceiling.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Ceiling.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Compare.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Compare.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Compare.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Compare.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareEqual.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareEqual.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareEqual.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareEqual.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareEqual.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareEqual.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareGreaterThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareGreaterThan.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareGreaterThan.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareGreaterThan.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareGreaterThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareGreaterThan.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareGreaterThan.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareGreaterThan.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareGreaterThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareGreaterThanOrEqual.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareGreaterThanOrEqual.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareGreaterThanOrEqual.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareGreaterThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareGreaterThanOrEqual.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareGreaterThanOrEqual.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareGreaterThanOrEqual.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareLessThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareLessThan.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareLessThan.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareLessThan.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareLessThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareLessThan.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareLessThan.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareLessThan.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareLessThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareLessThanOrEqual.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareLessThanOrEqual.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareLessThanOrEqual.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareLessThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareLessThanOrEqual.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareLessThanOrEqual.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareLessThanOrEqual.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareNotEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareNotEqual.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareNotEqual.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareNotEqual.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareNotEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareNotEqual.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareNotEqual.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareNotEqual.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareNotGreaterThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareNotGreaterThan.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareNotGreaterThan.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareNotGreaterThan.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareNotGreaterThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareNotGreaterThan.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareNotGreaterThan.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareNotGreaterThan.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareNotGreaterThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareNotGreaterThanOrEqual.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareNotGreaterThanOrEqual.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareNotGreaterThanOrEqual.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareNotGreaterThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareNotGreaterThanOrEqual.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareNotGreaterThanOrEqual.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareNotGreaterThanOrEqual.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareNotLessThan.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareNotLessThan.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareNotLessThan.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareNotLessThan.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareNotLessThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareNotLessThan.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareNotLessThan.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareNotLessThan.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareNotLessThanOrEqual.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareNotLessThanOrEqual.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareNotLessThanOrEqual.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareNotLessThanOrEqual.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareNotLessThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareNotLessThanOrEqual.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareNotLessThanOrEqual.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareNotLessThanOrEqual.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareOrdered.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareOrdered.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareOrdered.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareOrdered.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareOrdered.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareOrdered.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareOrdered.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareOrdered.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareScalar.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareScalar.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareScalar.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareScalar.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareScalar_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareScalar_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareScalar_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareScalar_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareScalar_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareScalar_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareScalar_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareScalar_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareUnordered.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareUnordered.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareUnordered.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareUnordered.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareUnordered.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareUnordered.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/CompareUnordered.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/CompareUnordered.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Compare_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Compare_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Compare_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Compare_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Compare_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Compare_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Compare_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Compare_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ConvertToVector128Int32.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ConvertToVector128Int32.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ConvertToVector128Int32.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ConvertToVector128Int32.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ConvertToVector128Int32WithTruncation.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ConvertToVector128Int32WithTruncation.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ConvertToVector128Int32WithTruncation.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ConvertToVector128Int32WithTruncation.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ConvertToVector128Single.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ConvertToVector128Single.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ConvertToVector128Single.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ConvertToVector128Single.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ConvertToVector256Double.Int32.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ConvertToVector256Double.Int32.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ConvertToVector256Double.Int32.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ConvertToVector256Double.Int32.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ConvertToVector256Double.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ConvertToVector256Double.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ConvertToVector256Double.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ConvertToVector256Double.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ConvertToVector256Int32.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ConvertToVector256Int32.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ConvertToVector256Int32.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ConvertToVector256Int32.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ConvertToVector256Int32WithTruncation.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ConvertToVector256Int32WithTruncation.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ConvertToVector256Int32WithTruncation.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ConvertToVector256Int32WithTruncation.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ConvertToVector256Single.Int32.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ConvertToVector256Single.Int32.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ConvertToVector256Single.Int32.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ConvertToVector256Single.Int32.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ConvertToVector_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ConvertToVector_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ConvertToVector_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ConvertToVector_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ConvertToVector_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ConvertToVector_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ConvertToVector_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ConvertToVector_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Divide.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Divide.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Divide.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Divide.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Divide.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Divide.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Divide.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Divide.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/DotProduct.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/DotProduct.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/DotProduct.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/DotProduct.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/DotProduct_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/DotProduct_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/DotProduct_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/DotProduct_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/DotProduct_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/DotProduct_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/DotProduct_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/DotProduct_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/DuplicateEvenIndexed.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/DuplicateEvenIndexed.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/DuplicateEvenIndexed.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/DuplicateEvenIndexed.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/DuplicateEvenIndexed.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/DuplicateEvenIndexed.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/DuplicateEvenIndexed.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/DuplicateEvenIndexed.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/DuplicateOddIndexed.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/DuplicateOddIndexed.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/DuplicateOddIndexed.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/DuplicateOddIndexed.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.Byte.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtendToVector256.Byte.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.Byte.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtendToVector256.Byte.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtendToVector256.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtendToVector256.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.Int16.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtendToVector256.Int16.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.Int16.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtendToVector256.Int16.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.Int32.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtendToVector256.Int32.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.Int32.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtendToVector256.Int32.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.Int64.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtendToVector256.Int64.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.Int64.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtendToVector256.Int64.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.SByte.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtendToVector256.SByte.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.SByte.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtendToVector256.SByte.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtendToVector256.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtendToVector256.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtendToVector256.UInt16.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.UInt16.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtendToVector256.UInt16.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtendToVector256.UInt32.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.UInt32.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtendToVector256.UInt32.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtendToVector256.UInt64.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.UInt64.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtendToVector256.UInt64.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtractVector128.Byte.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtractVector128.Byte.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtractVector128.Byte.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtractVector128.Byte.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtractVector128.Double.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtractVector128.Double.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtractVector128.Double.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtractVector128.Double.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtractVector128.Int16.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtractVector128.Int16.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtractVector128.Int16.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtractVector128.Int16.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtractVector128.Int32.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtractVector128.Int32.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtractVector128.Int32.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtractVector128.Int32.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtractVector128.Int64.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtractVector128.Int64.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtractVector128.Int64.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtractVector128.Int64.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtractVector128.SByte.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtractVector128.SByte.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtractVector128.SByte.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtractVector128.SByte.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtractVector128.Single.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtractVector128.Single.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtractVector128.Single.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtractVector128.Single.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtractVector128.UInt16.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtractVector128.UInt16.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtractVector128.UInt16.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtractVector128.UInt16.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtractVector128.UInt32.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtractVector128.UInt32.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtractVector128.UInt32.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtractVector128.UInt32.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtractVector128.UInt64.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtractVector128.UInt64.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/ExtractVector128.UInt64.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/ExtractVector128.UInt64.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Floor.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Floor.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Floor.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Floor.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Floor.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Floor.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Floor.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Floor.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/HorizontalAdd.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/HorizontalAdd.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/HorizontalAdd.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/HorizontalAdd.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/HorizontalAdd_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/HorizontalAdd_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/HorizontalAdd_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/HorizontalAdd_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/HorizontalAdd_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/HorizontalAdd_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/HorizontalAdd_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/HorizontalAdd_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/HorizontalSubtract.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/HorizontalSubtract.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/HorizontalSubtract.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/HorizontalSubtract.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/HorizontalSubtract_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/HorizontalSubtract_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/HorizontalSubtract_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/HorizontalSubtract_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/HorizontalSubtract_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/HorizontalSubtract_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/HorizontalSubtract_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/HorizontalSubtract_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/InsertVector128.Byte.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/InsertVector128.Byte.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/InsertVector128.Byte.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/InsertVector128.Byte.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/InsertVector128.Double.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/InsertVector128.Double.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/InsertVector128.Double.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/InsertVector128.Double.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/InsertVector128.Int16.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/InsertVector128.Int16.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/InsertVector128.Int16.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/InsertVector128.Int16.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/InsertVector128.Int32.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/InsertVector128.Int32.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/InsertVector128.Int32.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/InsertVector128.Int32.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/InsertVector128.Int64.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/InsertVector128.Int64.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/InsertVector128.Int64.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/InsertVector128.Int64.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/InsertVector128.SByte.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/InsertVector128.SByte.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/InsertVector128.SByte.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/InsertVector128.SByte.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/InsertVector128.Single.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/InsertVector128.Single.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/InsertVector128.Single.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/InsertVector128.Single.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/InsertVector128.UInt16.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/InsertVector128.UInt16.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/InsertVector128.UInt16.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/InsertVector128.UInt16.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/InsertVector128.UInt32.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/InsertVector128.UInt32.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/InsertVector128.UInt32.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/InsertVector128.UInt32.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/InsertVector128.UInt64.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/InsertVector128.UInt64.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/InsertVector128.UInt64.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/InsertVector128.UInt64.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadAlignedVector256.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadAlignedVector256.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadAlignedVector256.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadAlignedVector256.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadAlignedVector256_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadAlignedVector256_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadAlignedVector256_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadAlignedVector256_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadAlignedVector256_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadAlignedVector256_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadAlignedVector256_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadAlignedVector256_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadDquVector256.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadDquVector256.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadDquVector256.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadDquVector256.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadDquVector256_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadDquVector256_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadDquVector256_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadDquVector256_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadDquVector256_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadDquVector256_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadDquVector256_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadDquVector256_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadVector256.Byte.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadVector256.Byte.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadVector256.Byte.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadVector256.Byte.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadVector256.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadVector256.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadVector256.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadVector256.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadVector256.Int16.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadVector256.Int16.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadVector256.Int16.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadVector256.Int16.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadVector256.Int32.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadVector256.Int32.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadVector256.Int32.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadVector256.Int32.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadVector256.Int64.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadVector256.Int64.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadVector256.Int64.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadVector256.Int64.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadVector256.SByte.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadVector256.SByte.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadVector256.SByte.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadVector256.SByte.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadVector256.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadVector256.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadVector256.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadVector256.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadVector256.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadVector256.UInt16.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadVector256.UInt16.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadVector256.UInt16.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadVector256.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadVector256.UInt32.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadVector256.UInt32.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadVector256.UInt32.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadVector256.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadVector256.UInt64.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/LoadVector256.UInt64.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/LoadVector256.UInt64.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/MaskLoad.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/MaskLoad.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/MaskLoad.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/MaskLoad.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/MaskLoad.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/MaskLoad.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/MaskLoad.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/MaskLoad.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/MaskStore.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/MaskStore.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/MaskStore.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/MaskStore.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/MaskStore.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/MaskStore.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/MaskStore.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/MaskStore.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Max.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Max.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Max.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Max.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Max.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Max.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Max.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Max.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Min.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Min.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Min.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Min.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Min.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Min.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Min.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Min.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/MoveMask.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/MoveMask.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/MoveMask.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/MoveMask.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/MoveMask_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/MoveMask_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/MoveMask_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/MoveMask_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/MoveMask_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/MoveMask_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/MoveMask_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/MoveMask_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Multiply.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Multiply.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Multiply.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Multiply.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Multiply.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Multiply.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Multiply.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Or.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Or.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Or.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Or.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Or.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Or.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Or.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Or.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute.Double.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute.Double.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute.Double.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute.Double.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute.Double.2.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute.Double.2.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute.Double.2.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute.Double.2.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute.Single.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute.Single.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute.Single.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute.Single.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute.Single.2.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute.Single.2.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute.Single.2.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute.Single.2.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute2x128.Byte.2.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute2x128.Byte.2.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute2x128.Byte.2.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute2x128.Byte.2.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute2x128.Double.2.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute2x128.Double.2.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute2x128.Double.2.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute2x128.Double.2.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute2x128.Int16.2.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute2x128.Int16.2.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute2x128.Int16.2.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute2x128.Int16.2.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute2x128.Int32.2.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute2x128.Int32.2.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute2x128.Int32.2.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute2x128.Int32.2.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute2x128.Int64.2.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute2x128.Int64.2.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute2x128.Int64.2.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute2x128.Int64.2.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute2x128.SByte.2.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute2x128.SByte.2.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute2x128.SByte.2.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute2x128.SByte.2.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute2x128.Single.2.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute2x128.Single.2.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute2x128.Single.2.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute2x128.Single.2.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute2x128.UInt16.2.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute2x128.UInt16.2.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute2x128.UInt16.2.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute2x128.UInt16.2.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute2x128.UInt32.2.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute2x128.UInt32.2.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute2x128.UInt32.2.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute2x128.UInt32.2.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute2x128.UInt64.2.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute2x128.UInt64.2.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Permute2x128.UInt64.2.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Permute2x128.UInt64.2.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/PermuteVar.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/PermuteVar.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/PermuteVar.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/PermuteVar.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/PermuteVar.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/PermuteVar.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/PermuteVar.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/PermuteVar.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Program.Avx.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Program.Avx1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Program.Avx.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Program.Avx1.cs index 6c81d17b93d2ad..1a02a937542d14 100644 --- a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Program.Avx.cs +++ b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Program.Avx1.cs @@ -26,6 +26,8 @@ static Program() ["BroadcastScalarToVector256.Double"] = BroadcastScalarToVector256Double, ["BroadcastVector128ToVector256.Single"] = BroadcastVector128ToVector256Single, ["BroadcastVector128ToVector256.Double"] = BroadcastVector128ToVector256Double, + ["Ceiling.Double"] = CeilingDouble, + ["Ceiling.Single"] = CeilingSingle, ["CompareEqual.Single"] = CompareEqualSingle, ["CompareEqual.Double"] = CompareEqualDouble, ["CompareGreaterThan.Single"] = CompareGreaterThanSingle, @@ -50,8 +52,6 @@ static Program() ["CompareOrdered.Double"] = CompareOrderedDouble, ["CompareUnordered.Single"] = CompareUnorderedSingle, ["CompareUnordered.Double"] = CompareUnorderedDouble, - ["Ceiling.Double"] = CeilingDouble, - ["Ceiling.Single"] = CeilingSingle, ["Divide.Double"] = DivideDouble, ["Divide.Single"] = DivideSingle, ["DuplicateEvenIndexed.Double"] = DuplicateEvenIndexedDouble, diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Program.ConvertToVector.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Program.ConvertToVector.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Program.ConvertToVector.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Program.ConvertToVector.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/RoundCurrentDirection.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/RoundCurrentDirection.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/RoundCurrentDirection.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/RoundCurrentDirection.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/RoundCurrentDirection.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/RoundCurrentDirection.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/RoundCurrentDirection.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/RoundCurrentDirection.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/RoundToNearestInteger.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/RoundToNearestInteger.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/RoundToNearestInteger.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/RoundToNearestInteger.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/RoundToNearestInteger.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/RoundToNearestInteger.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/RoundToNearestInteger.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/RoundToNearestInteger.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/RoundToNegativeInfinity.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/RoundToNegativeInfinity.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/RoundToNegativeInfinity.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/RoundToNegativeInfinity.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/RoundToNegativeInfinity.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/RoundToNegativeInfinity.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/RoundToNegativeInfinity.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/RoundToNegativeInfinity.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/RoundToPositiveInfinity.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/RoundToPositiveInfinity.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/RoundToPositiveInfinity.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/RoundToPositiveInfinity.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/RoundToPositiveInfinity.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/RoundToPositiveInfinity.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/RoundToPositiveInfinity.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/RoundToPositiveInfinity.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/RoundToZero.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/RoundToZero.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/RoundToZero.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/RoundToZero.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/RoundToZero.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/RoundToZero.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/RoundToZero.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/RoundToZero.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Shuffle.Double.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Shuffle.Double.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Shuffle.Double.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Shuffle.Double.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Shuffle.Single.1.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Shuffle.Single.1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Shuffle.Single.1.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Shuffle.Single.1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Sqrt.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Sqrt.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Sqrt.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Sqrt.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Sqrt_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Sqrt_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Sqrt_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Sqrt_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Sqrt_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Sqrt_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Sqrt_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Sqrt_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Store.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Store.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Store.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Store.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/StoreAligned.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/StoreAligned.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/StoreAligned.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/StoreAligned.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/StoreAlignedNonTemporal.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/StoreAlignedNonTemporal.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/StoreAlignedNonTemporal.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/StoreAlignedNonTemporal.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/StoreAlignedNonTemporal_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/StoreAlignedNonTemporal_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/StoreAlignedNonTemporal_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/StoreAlignedNonTemporal_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/StoreAlignedNonTemporal_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/StoreAlignedNonTemporal_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/StoreAlignedNonTemporal_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/StoreAlignedNonTemporal_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/StoreAligned_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/StoreAligned_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/StoreAligned_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/StoreAligned_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/StoreAligned_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/StoreAligned_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/StoreAligned_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/StoreAligned_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Store_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Store_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Store_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Store_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Store_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Store_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Store_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Store_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Subtract.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Subtract.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Subtract.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Subtract.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Subtract.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Subtract.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Subtract.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Subtract.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestC.Byte.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestC.Byte.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestC.Byte.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestC.Byte.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestC.Int16.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestC.Int16.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestC.Int16.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestC.Int16.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestC.Int32.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestC.Int32.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestC.Int32.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestC.Int32.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestC.Int64.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestC.Int64.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestC.Int64.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestC.Int64.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestC.SByte.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestC.SByte.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestC.SByte.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestC.SByte.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestC.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestC.UInt16.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestC.UInt16.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestC.UInt16.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestC.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestC.UInt32.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestC.UInt32.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestC.UInt32.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestC.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestC.UInt64.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestC.UInt64.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestC.UInt64.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestNotZAndNotC.Byte.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestNotZAndNotC.Byte.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestNotZAndNotC.Byte.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestNotZAndNotC.Byte.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestNotZAndNotC.Int16.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestNotZAndNotC.Int16.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestNotZAndNotC.Int16.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestNotZAndNotC.Int16.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestNotZAndNotC.Int32.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestNotZAndNotC.Int32.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestNotZAndNotC.Int32.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestNotZAndNotC.Int32.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestNotZAndNotC.Int64.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestNotZAndNotC.Int64.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestNotZAndNotC.Int64.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestNotZAndNotC.Int64.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestNotZAndNotC.SByte.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestNotZAndNotC.SByte.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestNotZAndNotC.SByte.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestNotZAndNotC.SByte.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestNotZAndNotC.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestNotZAndNotC.UInt16.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestNotZAndNotC.UInt16.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestNotZAndNotC.UInt16.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestNotZAndNotC.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestNotZAndNotC.UInt32.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestNotZAndNotC.UInt32.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestNotZAndNotC.UInt32.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestNotZAndNotC.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestNotZAndNotC.UInt64.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestNotZAndNotC.UInt64.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestNotZAndNotC.UInt64.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestZ.Byte.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestZ.Byte.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestZ.Byte.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestZ.Byte.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestZ.Int16.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestZ.Int16.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestZ.Int16.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestZ.Int16.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestZ.Int32.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestZ.Int32.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestZ.Int32.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestZ.Int32.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestZ.Int64.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestZ.Int64.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestZ.Int64.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestZ.Int64.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestZ.SByte.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestZ.SByte.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestZ.SByte.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestZ.SByte.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestZ.UInt16.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestZ.UInt16.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestZ.UInt16.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestZ.UInt16.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestZ.UInt32.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestZ.UInt32.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestZ.UInt32.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestZ.UInt32.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/TestZ.UInt64.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestZ.UInt64.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/TestZ.UInt64.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/TestZ.UInt64.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/UnpackHigh.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/UnpackHigh.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/UnpackHigh.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/UnpackHigh.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/UnpackHigh_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/UnpackHigh_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/UnpackHigh_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/UnpackHigh_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/UnpackHigh_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/UnpackHigh_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/UnpackHigh_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/UnpackHigh_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/UnpackLow.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/UnpackLow.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/UnpackLow.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/UnpackLow.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/UnpackLow_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/UnpackLow_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/UnpackLow_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/UnpackLow_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/UnpackLow_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/UnpackLow_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/UnpackLow_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/UnpackLow_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Xor.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Xor.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Xor.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Xor.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx/Xor.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1/Xor.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx/Xor.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1/Xor.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx_Vector128/Avx_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1_Vector128/Avx_r.csproj similarity index 92% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx_Vector128/Avx_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1_Vector128/Avx_r.csproj index b47ea55de19b6e..93a4e46d49efa1 100644 --- a/src/tests/JIT/HardwareIntrinsics/X86/Avx_Vector128/Avx_r.csproj +++ b/src/tests/JIT/HardwareIntrinsics/X86/Avx1_Vector128/Avx_r.csproj @@ -14,7 +14,7 @@ - + diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx_Vector128/Avx_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Avx1_Vector128/Avx_ro.csproj similarity index 92% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx_Vector128/Avx_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1_Vector128/Avx_ro.csproj index d086be6f5756ca..16f2381c330131 100644 --- a/src/tests/JIT/HardwareIntrinsics/X86/Avx_Vector128/Avx_ro.csproj +++ b/src/tests/JIT/HardwareIntrinsics/X86/Avx1_Vector128/Avx_ro.csproj @@ -14,7 +14,7 @@ - + diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx_Vector128/MaskLoad.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1_Vector128/MaskLoad.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx_Vector128/MaskLoad.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1_Vector128/MaskLoad.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx_Vector128/MaskLoad.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1_Vector128/MaskLoad.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx_Vector128/MaskLoad.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1_Vector128/MaskLoad.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx_Vector128/MaskStore.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1_Vector128/MaskStore.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx_Vector128/MaskStore.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1_Vector128/MaskStore.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx_Vector128/MaskStore.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1_Vector128/MaskStore.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx_Vector128/MaskStore.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1_Vector128/MaskStore.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx_Vector128/PermuteVar.Double.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1_Vector128/PermuteVar.Double.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx_Vector128/PermuteVar.Double.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1_Vector128/PermuteVar.Double.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx_Vector128/PermuteVar.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1_Vector128/PermuteVar.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx_Vector128/PermuteVar.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1_Vector128/PermuteVar.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Avx_Vector128/Program.Avx_Vector128.cs b/src/tests/JIT/HardwareIntrinsics/X86/Avx1_Vector128/Program.Avx1_Vector128.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Avx_Vector128/Program.Avx_Vector128.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Avx1_Vector128/Program.Avx1_Vector128.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Shared/GenerateTests.csx b/src/tests/JIT/HardwareIntrinsics/X86/Shared/GenerateTests.csx index d5be9e1c667e42..50b7e0b0cdbe21 100644 --- a/src/tests/JIT/HardwareIntrinsics/X86/Shared/GenerateTests.csx +++ b/src/tests/JIT/HardwareIntrinsics/X86/Shared/GenerateTests.csx @@ -116,7 +116,7 @@ private static readonly (string templateFileName, string outputTemplateName, Dic ("_UnaryOpTestTemplate.template", "SimpleUnOpTest.template", new Dictionary { ["TemplateName"] = "Simple", ["TemplateValidationLogic"] = SimpleOpTest_ValidationLogic }), }; -private static readonly (string templateFileName, Dictionary templateData)[] SseInputs = new [] +private static readonly (string templateFileName, Dictionary templateData)[] Sse1Inputs = new [] { ("SimpleBinOpTest.template", new Dictionary { ["Isa"] = "Sse", ["LoadIsa"] = "Sse", ["Method"] = "Add", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(left[0] + right[0]) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(left[i] + right[i]) != BitConverter.SingleToInt32Bits(result[i])"}), ("SimpleBinOpTest.template", new Dictionary { ["Isa"] = "Sse", ["LoadIsa"] = "Sse", ["Method"] = "AddScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(left[0] + right[0]) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(left[i]) != BitConverter.SingleToInt32Bits(result[i])"}), @@ -175,7 +175,7 @@ private static readonly (string templateFileName, Dictionary tem ("SimpleBinOpTest.template", new Dictionary { ["Isa"] = "Sse", ["LoadIsa"] = "Sse", ["Method"] = "Xor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "(BitConverter.SingleToInt32Bits(left[0]) ^ BitConverter.SingleToInt32Bits(right[0])) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "(BitConverter.SingleToInt32Bits(left[0]) ^ BitConverter.SingleToInt32Bits(right[0])) != BitConverter.SingleToInt32Bits(result[0])"}), }; -private static readonly (string templateFileName, Dictionary templateData)[] SseX64Inputs = new [] +private static readonly (string templateFileName, Dictionary templateData)[] Sse1X64Inputs = new [] { ("SimdScalarUnOpConvTest.template", new Dictionary { ["Isa"] = "Sse.X64", ["LoadIsa"] = "Sse", ["Method"] = "ConvertToInt64", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "(long)Math.Round(firstOp[0]) != result"}), ("SimdScalarUnOpConvTest.template", new Dictionary { ["Isa"] = "Sse.X64", ["LoadIsa"] = "Sse", ["Method"] = "ConvertToInt64WithTruncation", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "(long) firstOp[0] != result"}), @@ -628,7 +628,7 @@ private static readonly (string templateFileName, Dictionary tem ("SimpleBinOpTest.template", new Dictionary { ["Isa"] = "Sse42", ["LoadIsa"] = "Sse2", ["Method"] = "CompareGreaterThan", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetInt64()", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateFirstResult"] = "result[0] != ((left[0] > right[0]) ? unchecked((long)(-1)) : 0)", ["ValidateRemainingResults"] = "result[i] != ((left[i] > right[i]) ? unchecked((long)(-1)) : 0)"}), }; -private static readonly (string templateFileName, Dictionary templateData)[] AvxInputs = new [] +private static readonly (string templateFileName, Dictionary templateData)[] Avx1Inputs = new [] { ("SimpleBinOpTest.template", new Dictionary { ["Isa"] = "Avx", ["LoadIsa"] = "Avx", ["Method"] = "Add", ["RetVectorType"] = "Vector256", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector256", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector256", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(left[0] + right[0]) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(left[i] + right[i]) != BitConverter.DoubleToInt64Bits(result[i])"}), ("SimpleBinOpTest.template", new Dictionary { ["Isa"] = "Avx", ["LoadIsa"] = "Avx", ["Method"] = "Add", ["RetVectorType"] = "Vector256", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector256", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector256", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(left[0] + right[0]) != BitConverter.SingleToInt32Bits(result[0])", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(left[i] + right[i]) != BitConverter.SingleToInt32Bits(result[i])"}), @@ -778,7 +778,7 @@ private static readonly (string templateFileName, Dictionary tem ("SimpleBinOpTest.template", new Dictionary { ["Isa"] = "Avx", ["LoadIsa"] = "Avx", ["Method"] = "Xor", ["RetVectorType"] = "Vector256", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector256", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector256", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "(BitConverter.DoubleToInt64Bits(left[0]) ^ BitConverter.DoubleToInt64Bits(right[0])) != BitConverter.DoubleToInt64Bits(result[0])", ["ValidateRemainingResults"] = "(BitConverter.DoubleToInt64Bits(left[i]) ^ BitConverter.DoubleToInt64Bits(right[i])) != BitConverter.DoubleToInt64Bits(result[i])"}), }; -private static readonly (string templateFileName, Dictionary templateData)[] Avx_Vector128Inputs = new [] +private static readonly (string templateFileName, Dictionary templateData)[] Avx1_Vector128Inputs = new [] { ("LoadBinOpTest.template", new Dictionary { ["Isa"] = "Avx", ["LoadIsa"] = "Avx", ["Method"] = "MaskLoad", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetDouble()", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits((BitConverter.DoubleToInt64Bits(right[0]) < 0) ? left[0] : 0)", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits((BitConverter.DoubleToInt64Bits(right[i]) < 0) ? left[i] : 0)"}), ("LoadBinOpTest.template", new Dictionary { ["Isa"] = "Avx", ["LoadIsa"] = "Avx", ["Method"] = "MaskLoad", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits((BitConverter.SingleToInt32Bits(right[0]) < 0) ? left[0] : 0)", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits((BitConverter.SingleToInt32Bits(right[i]) < 0) ? left[i] : 0)"}), @@ -1378,8 +1378,8 @@ private static void ProcessInput(StreamWriter testListFile, string groupName, (s File.WriteAllText(testFileName, template); } -ProcessInputs("Sse", SseInputs); -ProcessInputs("Sse.X64", SseX64Inputs); +ProcessInputs("Sse1", Sse1Inputs); +ProcessInputs("Sse1.X64", Sse1X64Inputs); ProcessInputs("Sse2", Sse2Inputs); ProcessInputs("Sse2.X64", Sse2X64Inputs); ProcessInputs("Sse3", Sse3Inputs); @@ -1388,8 +1388,8 @@ ProcessInputs("Sse41", Sse41Inputs); ProcessInputs("Sse41_Overloaded", Sse41_OverloadedInputs); ProcessInputs("Sse41.X64", Sse41X64Inputs); ProcessInputs("Sse42", Sse42Inputs); -ProcessInputs("Avx", AvxInputs); -ProcessInputs("Avx_Vector128", Avx_Vector128Inputs); +ProcessInputs("Avx1", Avx1Inputs); +ProcessInputs("Avx1_Vector128", Avx1_Vector128Inputs); ProcessInputs("Avx2", Avx2Inputs); ProcessInputs("Avx2_Vector128", Avx2_Vector128Inputs); ProcessInputs("Fma_Vector128", Fma_Vector128Inputs); diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse.X64/ConvertScalarToVector128Single.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1.X64/ConvertScalarToVector128Single.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse.X64/ConvertScalarToVector128Single.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1.X64/ConvertScalarToVector128Single.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse.X64/ConvertToInt64.Vector128Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1.X64/ConvertToInt64.Vector128Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse.X64/ConvertToInt64.Vector128Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1.X64/ConvertToInt64.Vector128Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse.X64/ConvertToInt64WithTruncation.Vector128Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1.X64/ConvertToInt64WithTruncation.Vector128Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse.X64/ConvertToInt64WithTruncation.Vector128Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1.X64/ConvertToInt64WithTruncation.Vector128Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse.X64/Program.Sse.X64.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1.X64/Program.Sse1.X64.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse.X64/Program.Sse.X64.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1.X64/Program.Sse1.X64.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse.X64/Sse.X64_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1.X64/Sse.X64_r.csproj similarity index 93% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse.X64/Sse.X64_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1.X64/Sse.X64_r.csproj index 4109f20cc11b4b..80aa8507e10ad6 100644 --- a/src/tests/JIT/HardwareIntrinsics/X86/Sse.X64/Sse.X64_r.csproj +++ b/src/tests/JIT/HardwareIntrinsics/X86/Sse1.X64/Sse.X64_r.csproj @@ -14,6 +14,6 @@ - + diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse.X64/Sse.X64_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1.X64/Sse.X64_ro.csproj similarity index 93% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse.X64/Sse.X64_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1.X64/Sse.X64_ro.csproj index 06ec6d184787c4..cd7ea7ea55bfbc 100644 --- a/src/tests/JIT/HardwareIntrinsics/X86/Sse.X64/Sse.X64_ro.csproj +++ b/src/tests/JIT/HardwareIntrinsics/X86/Sse1.X64/Sse.X64_ro.csproj @@ -14,6 +14,6 @@ - + diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Add.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Add.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Add.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Add.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/AddScalar.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/AddScalar.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/AddScalar.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/AddScalar.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/And.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/And.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/And.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/And.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/AndNot.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/AndNot.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/AndNot.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/AndNot.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareEqual.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareEqual.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareEqual.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareGreaterThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareGreaterThan.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareGreaterThan.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareGreaterThan.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareGreaterThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareGreaterThanOrEqual.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareGreaterThanOrEqual.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareGreaterThanOrEqual.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareLessThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareLessThan.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareLessThan.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareLessThan.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareLessThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareLessThanOrEqual.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareLessThanOrEqual.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareLessThanOrEqual.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareNotEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareNotEqual.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareNotEqual.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareNotEqual.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareNotGreaterThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareNotGreaterThan.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareNotGreaterThan.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareNotGreaterThan.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareNotGreaterThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareNotGreaterThanOrEqual.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareNotGreaterThanOrEqual.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareNotGreaterThanOrEqual.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareNotLessThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareNotLessThan.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareNotLessThan.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareNotLessThan.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareNotLessThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareNotLessThanOrEqual.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareNotLessThanOrEqual.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareNotLessThanOrEqual.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareOrdered.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareOrdered.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareOrdered.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareOrdered.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarEqual.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarEqual.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarEqual.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarGreaterThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarGreaterThan.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarGreaterThan.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarGreaterThan.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarGreaterThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarGreaterThanOrEqual.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarGreaterThanOrEqual.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarGreaterThanOrEqual.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarLessThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarLessThan.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarLessThan.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarLessThan.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarLessThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarLessThanOrEqual.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarLessThanOrEqual.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarLessThanOrEqual.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarNotEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarNotEqual.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarNotEqual.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarNotEqual.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarNotGreaterThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarNotGreaterThan.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarNotGreaterThan.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarNotGreaterThan.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarNotGreaterThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarNotGreaterThanOrEqual.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarNotGreaterThanOrEqual.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarNotGreaterThanOrEqual.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarNotLessThan.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarNotLessThan.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarNotLessThan.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarNotLessThan.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarNotLessThanOrEqual.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarNotLessThanOrEqual.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarNotLessThanOrEqual.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarNotLessThanOrEqual.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarOrdered.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarOrdered.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarOrdered.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarOrdered.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarOrderedEqual.Boolean.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarOrderedEqual.Boolean.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarOrderedEqual.Boolean.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarOrderedEqual.Boolean.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarOrderedGreaterThan.Boolean.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarOrderedGreaterThan.Boolean.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarOrderedGreaterThan.Boolean.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarOrderedGreaterThan.Boolean.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarOrderedGreaterThanOrEqual.Boolean.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarOrderedGreaterThanOrEqual.Boolean.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarOrderedGreaterThanOrEqual.Boolean.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarOrderedGreaterThanOrEqual.Boolean.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarOrderedLessThan.Boolean.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarOrderedLessThan.Boolean.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarOrderedLessThan.Boolean.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarOrderedLessThan.Boolean.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarOrderedLessThanOrEqual.Boolean.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarOrderedLessThanOrEqual.Boolean.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarOrderedLessThanOrEqual.Boolean.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarOrderedLessThanOrEqual.Boolean.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarOrderedNotEqual.Boolean.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarOrderedNotEqual.Boolean.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarOrderedNotEqual.Boolean.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarOrderedNotEqual.Boolean.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarUnordered.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarUnordered.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarUnordered.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarUnordered.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarUnorderedEqual.Boolean.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarUnorderedEqual.Boolean.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarUnorderedEqual.Boolean.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarUnorderedEqual.Boolean.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarUnorderedGreaterThan.Boolean.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarUnorderedGreaterThan.Boolean.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarUnorderedGreaterThan.Boolean.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarUnorderedGreaterThan.Boolean.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarUnorderedGreaterThanOrEqual.Boolean.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarUnorderedGreaterThanOrEqual.Boolean.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarUnorderedGreaterThanOrEqual.Boolean.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarUnorderedGreaterThanOrEqual.Boolean.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarUnorderedLessThan.Boolean.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarUnorderedLessThan.Boolean.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarUnorderedLessThan.Boolean.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarUnorderedLessThan.Boolean.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarUnorderedLessThanOrEqual.Boolean.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarUnorderedLessThanOrEqual.Boolean.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarUnorderedLessThanOrEqual.Boolean.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarUnorderedLessThanOrEqual.Boolean.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarUnorderedNotEqual.Boolean.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarUnorderedNotEqual.Boolean.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareScalarUnorderedNotEqual.Boolean.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareScalarUnorderedNotEqual.Boolean.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareUnordered.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareUnordered.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/CompareUnordered.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/CompareUnordered.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/ConvertScalarToVector128Single.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/ConvertScalarToVector128Single.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/ConvertScalarToVector128Single.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/ConvertScalarToVector128Single.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/ConvertToInt32.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/ConvertToInt32.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/ConvertToInt32.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/ConvertToInt32.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/ConvertToInt32WithTruncation.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/ConvertToInt32WithTruncation.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/ConvertToInt32WithTruncation.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/ConvertToInt32WithTruncation.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/ConvertToInt32WithTruncation_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/ConvertToInt32WithTruncation_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/ConvertToInt32WithTruncation_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/ConvertToInt32WithTruncation_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/ConvertToInt32WithTruncation_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/ConvertToInt32WithTruncation_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/ConvertToInt32WithTruncation_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/ConvertToInt32WithTruncation_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/ConvertToInt32_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/ConvertToInt32_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/ConvertToInt32_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/ConvertToInt32_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/ConvertToInt32_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/ConvertToInt32_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/ConvertToInt32_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/ConvertToInt32_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Divide.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Divide.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Divide.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Divide.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/DivideScalar.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/DivideScalar.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/DivideScalar.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/DivideScalar.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadAlignedVector128.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadAlignedVector128.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadAlignedVector128.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadAlignedVector128.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadAlignedVector128_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadAlignedVector128_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadAlignedVector128_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadAlignedVector128_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadAlignedVector128_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadAlignedVector128_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadAlignedVector128_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadAlignedVector128_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadHigh.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadHigh.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadHigh.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadHigh.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadHigh_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadHigh_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadHigh_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadHigh_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadHigh_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadHigh_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadHigh_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadHigh_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadLow.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadLow.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadLow.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadLow.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadLow_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadLow_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadLow_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadLow_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadLow_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadLow_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadLow_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadLow_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadScalarVector128.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadScalarVector128.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadScalarVector128.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadScalarVector128.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadVector128.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadVector128.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/LoadVector128.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/LoadVector128.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Max.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Max.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Max.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Max.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/MaxScalar.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/MaxScalar.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/MaxScalar.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/MaxScalar.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Min.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Min.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Min.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Min.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/MinScalar.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/MinScalar.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/MinScalar.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/MinScalar.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveHighToLow.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveHighToLow.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveHighToLow.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveHighToLow.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveHighToLow_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveHighToLow_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveHighToLow_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveHighToLow_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveHighToLow_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveHighToLow_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveHighToLow_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveHighToLow_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveLowToHigh.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveLowToHigh.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveLowToHigh.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveLowToHigh.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveLowToHigh_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveLowToHigh_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveLowToHigh_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveLowToHigh_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveLowToHigh_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveLowToHigh_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveLowToHigh_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveLowToHigh_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveMask.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveMask.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveMask.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveMask.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveMask_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveMask_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveMask_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveMask_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveMask_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveMask_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveMask_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveMask_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveScalar.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveScalar.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveScalar.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveScalar.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveScalar_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveScalar_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveScalar_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveScalar_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveScalar_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveScalar_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/MoveScalar_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/MoveScalar_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Multiply.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Multiply.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Multiply.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Multiply.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/MultiplyScalar.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/MultiplyScalar.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/MultiplyScalar.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/MultiplyScalar.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Or.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Or.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Or.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Or.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Prefetch.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Prefetch.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Prefetch.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Prefetch.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Prefetch_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Prefetch_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Prefetch_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Prefetch_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Prefetch_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Prefetch_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Prefetch_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Prefetch_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Program.Sse.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Program.Sse1.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Program.Sse.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Program.Sse1.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Reciprocal.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Reciprocal.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Reciprocal.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Reciprocal.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/ReciprocalScalar.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/ReciprocalScalar.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/ReciprocalScalar.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/ReciprocalScalar.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/ReciprocalScalar_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/ReciprocalScalar_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/ReciprocalScalar_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/ReciprocalScalar_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/ReciprocalScalar_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/ReciprocalScalar_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/ReciprocalScalar_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/ReciprocalScalar_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/ReciprocalSqrt.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/ReciprocalSqrt.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/ReciprocalSqrt.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/ReciprocalSqrt.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/ReciprocalSqrtScalar.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/ReciprocalSqrtScalar.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/ReciprocalSqrtScalar.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/ReciprocalSqrtScalar.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/ReciprocalSqrtScalar_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/ReciprocalSqrtScalar_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/ReciprocalSqrtScalar_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/ReciprocalSqrtScalar_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/ReciprocalSqrtScalar_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/ReciprocalSqrtScalar_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/ReciprocalSqrtScalar_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/ReciprocalSqrtScalar_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/ReciprocalSqrt_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/ReciprocalSqrt_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/ReciprocalSqrt_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/ReciprocalSqrt_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/ReciprocalSqrt_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/ReciprocalSqrt_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/ReciprocalSqrt_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/ReciprocalSqrt_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Reciprocal_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Reciprocal_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Reciprocal_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Reciprocal_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Reciprocal_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Reciprocal_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Reciprocal_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Reciprocal_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Shuffle.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Shuffle.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Shuffle.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Shuffle.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Shuffle_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Shuffle_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Shuffle_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Shuffle_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Shuffle_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Shuffle_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Shuffle_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Shuffle_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Sqrt.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Sqrt.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Sqrt.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Sqrt.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/SqrtScalar.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/SqrtScalar.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/SqrtScalar.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/SqrtScalar.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/SqrtScalar_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/SqrtScalar_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/SqrtScalar_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/SqrtScalar_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/SqrtScalar_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/SqrtScalar_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/SqrtScalar_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/SqrtScalar_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Sqrt_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Sqrt_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Sqrt_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Sqrt_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Sqrt_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Sqrt_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Sqrt_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Sqrt_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Sse_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Sse_r.csproj similarity index 98% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Sse_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Sse_r.csproj index 111c837d1270c7..3681840cefdc48 100644 --- a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Sse_r.csproj +++ b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Sse_r.csproj @@ -63,7 +63,7 @@ - + diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Sse_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Sse_ro.csproj similarity index 98% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Sse_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Sse_ro.csproj index cb08f53e3b831d..3a8cb1a5d23f61 100644 --- a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Sse_ro.csproj +++ b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Sse_ro.csproj @@ -63,7 +63,7 @@ - + diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Store.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Store.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Store.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Store.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreAligned.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreAligned.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreAligned.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreAligned.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreAlignedNonTemporal.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreAlignedNonTemporal.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreAlignedNonTemporal.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreAlignedNonTemporal.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreAlignedNonTemporal_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreAlignedNonTemporal_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreAlignedNonTemporal_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreAlignedNonTemporal_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreAlignedNonTemporal_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreAlignedNonTemporal_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreAlignedNonTemporal_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreAlignedNonTemporal_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreAligned_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreAligned_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreAligned_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreAligned_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreAligned_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreAligned_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreAligned_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreAligned_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreFence.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreFence.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreFence.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreFence.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreFence_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreFence_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreFence_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreFence_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreFence_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreFence_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreFence_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreFence_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreHigh.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreHigh.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreHigh.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreHigh.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreHigh_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreHigh_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreHigh_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreHigh_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreHigh_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreHigh_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreHigh_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreHigh_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreLow.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreLow.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreLow.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreLow.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreLow_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreLow_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreLow_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreLow_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreLow_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreLow_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreLow_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreLow_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreScalar.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreScalar.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreScalar.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreScalar.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreScalar_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreScalar_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreScalar_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreScalar_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreScalar_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreScalar_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/StoreScalar_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/StoreScalar_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Store_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Store_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Store_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Store_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Store_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Store_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Store_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Store_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Subtract.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Subtract.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Subtract.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Subtract.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/SubtractScalar.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/SubtractScalar.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/SubtractScalar.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/SubtractScalar.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/UnpackHigh.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/UnpackHigh.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/UnpackHigh.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/UnpackHigh.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/UnpackHigh_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/UnpackHigh_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/UnpackHigh_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/UnpackHigh_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/UnpackHigh_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/UnpackHigh_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/UnpackHigh_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/UnpackHigh_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/UnpackLow.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/UnpackLow.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/UnpackLow.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/UnpackLow.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/UnpackLow_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/UnpackLow_r.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/UnpackLow_r.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/UnpackLow_r.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/UnpackLow_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/UnpackLow_ro.csproj similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/UnpackLow_ro.csproj rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/UnpackLow_ro.csproj diff --git a/src/tests/JIT/HardwareIntrinsics/X86/Sse/Xor.Single.cs b/src/tests/JIT/HardwareIntrinsics/X86/Sse1/Xor.Single.cs similarity index 100% rename from src/tests/JIT/HardwareIntrinsics/X86/Sse/Xor.Single.cs rename to src/tests/JIT/HardwareIntrinsics/X86/Sse1/Xor.Single.cs diff --git a/src/tests/JIT/HardwareIntrinsics/X86/X86Base/Pause.cs b/src/tests/JIT/HardwareIntrinsics/X86/X86Base/Pause.cs new file mode 100644 index 00000000000000..54223b04e66e89 --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/X86/X86Base/Pause.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. +// + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.X86; + +namespace IntelHardwareIntrinsicTest +{ + class Program + { + const int Pass = 100; + const int Fail = 0; + + static unsafe int Main(string[] args) + { + int testResult = X86Base.IsSupported ? Pass : Fail; + + try + { + X86Base.Pause(); + } + catch (Exception e) + { + testResult = (X86Base.IsSupported || (e is not PlatformNotSupportedException)) ? Fail : Pass; + } + + return testResult; + } + } +} diff --git a/src/tests/JIT/HardwareIntrinsics/X86/X86Base/Pause_r.csproj b/src/tests/JIT/HardwareIntrinsics/X86/X86Base/Pause_r.csproj new file mode 100644 index 00000000000000..9b005d1608375e --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/X86/X86Base/Pause_r.csproj @@ -0,0 +1,13 @@ + + + Exe + true + + + Embedded + + + + + + diff --git a/src/tests/JIT/HardwareIntrinsics/X86/X86Base/Pause_ro.csproj b/src/tests/JIT/HardwareIntrinsics/X86/X86Base/Pause_ro.csproj new file mode 100644 index 00000000000000..8943a9d7d3ebac --- /dev/null +++ b/src/tests/JIT/HardwareIntrinsics/X86/X86Base/Pause_ro.csproj @@ -0,0 +1,13 @@ + + + Exe + true + + + Embedded + True + + + + + diff --git a/src/tests/JIT/IL_Conformance/Old/Base/add.il b/src/tests/JIT/IL_Conformance/Old/Base/add.il index 9dfe91a50261b0..2c4e8fef7af3a1 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/add.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/add.il @@ -17,7 +17,7 @@ //----------------------------------------------------- -.assembly add.exe{ +.assembly 'add'{ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } diff --git a/src/tests/JIT/IL_Conformance/Old/Base/add_ovf.il b/src/tests/JIT/IL_Conformance/Old/Base/add_ovf.il index 292a50772456cd..cf8380e32c2ff5 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/add_ovf.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/add_ovf.il @@ -4,7 +4,7 @@ .assembly extern legacy library mscorlib {} -.assembly add_ovf.exe{} +.assembly add_ovf{} .class public add_ovf { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/and.il b/src/tests/JIT/IL_Conformance/Old/Base/and.il index 36378247fb843c..e5a71647024f4f 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/and.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/and.il @@ -4,7 +4,7 @@ .assembly extern legacy library mscorlib {} -.assembly and.exe{} +.assembly 'and'{} .class public _and { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/beq.il b/src/tests/JIT/IL_Conformance/Old/Base/beq.il index 531b9e515fb238..b24c4c247af241 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/beq.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/beq.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly beq.exe{} +.assembly 'beq'{} .method public static int32 main(class [mscorlib]System.String[]) { .locals (class [mscorlib]System.String) diff --git a/src/tests/JIT/IL_Conformance/Old/Base/beq_s.il b/src/tests/JIT/IL_Conformance/Old/Base/beq_s.il index 66eda3868963ad..b0f751a3e695db 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/beq_s.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/beq_s.il @@ -55,5 +55,5 @@ end: } -.assembly beq_s.exe {} +.assembly beq_s {} diff --git a/src/tests/JIT/IL_Conformance/Old/Base/bge.il b/src/tests/JIT/IL_Conformance/Old/Base/bge.il index 9385223481cb2c..589e6f318d56ea 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/bge.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/bge.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly bge.exe{} +.assembly 'bge'{} .method public static int32 main(class [mscorlib]System.String[]) { .locals (class [mscorlib]System.String) diff --git a/src/tests/JIT/IL_Conformance/Old/Base/bge_s.il b/src/tests/JIT/IL_Conformance/Old/Base/bge_s.il index 2cc1fb8675c486..a227914e92910a 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/bge_s.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/bge_s.il @@ -78,5 +78,5 @@ end: } -.assembly bge_s.exe {} +.assembly bge_s {} diff --git a/src/tests/JIT/IL_Conformance/Old/Base/bgt.il b/src/tests/JIT/IL_Conformance/Old/Base/bgt.il index 000140926595d3..1b323d8259592e 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/bgt.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/bgt.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly bgt.exe{} +.assembly 'bgt'{} .method public static int32 main(class [mscorlib]System.String[]) { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/bgt_s.il b/src/tests/JIT/IL_Conformance/Old/Base/bgt_s.il index 44ccd502f4529a..5733b277808641 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/bgt_s.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/bgt_s.il @@ -80,5 +80,5 @@ end: } -.assembly bgt_s.exe {} +.assembly bgt_s {} diff --git a/src/tests/JIT/IL_Conformance/Old/Base/ble.il b/src/tests/JIT/IL_Conformance/Old/Base/ble.il index d3845de3796ffd..cfcf6d05549c5c 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/ble.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/ble.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ble.exe{} +.assembly 'ble'{} .method public static int32 main(class [mscorlib]System.String[]) { .locals (class [mscorlib]System.String) diff --git a/src/tests/JIT/IL_Conformance/Old/Base/ble_s.il b/src/tests/JIT/IL_Conformance/Old/Base/ble_s.il index a52f287efe7d94..d6ee5cce30fcdb 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/ble_s.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/ble_s.il @@ -79,5 +79,5 @@ end: } -.assembly ble_s.exe {} +.assembly ble_s {} diff --git a/src/tests/JIT/IL_Conformance/Old/Base/blt.il b/src/tests/JIT/IL_Conformance/Old/Base/blt.il index a367c7f192bda1..5a51ab2fdee895 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/blt.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/blt.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly blt.exe{} +.assembly 'blt'{} .method public static int32 main(class [mscorlib]System.String[]) { .locals (class [mscorlib]System.String) diff --git a/src/tests/JIT/IL_Conformance/Old/Base/blt_s.il b/src/tests/JIT/IL_Conformance/Old/Base/blt_s.il index 77e48aadb3138e..fa3cf86c78e551 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/blt_s.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/blt_s.il @@ -79,5 +79,5 @@ end: } -.assembly blt_s.exe {} +.assembly blt_s {} diff --git a/src/tests/JIT/IL_Conformance/Old/Base/bne.il b/src/tests/JIT/IL_Conformance/Old/Base/bne.il index 42671bd8f423a3..0efff3a8b3a68e 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/bne.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/bne.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly bne.exe{} +.assembly bne{} .method public static int32 main(class [mscorlib]System.String[]) { .locals (class [mscorlib]System.String) diff --git a/src/tests/JIT/IL_Conformance/Old/Base/bne_s.il b/src/tests/JIT/IL_Conformance/Old/Base/bne_s.il index b3028e9ee7cb37..bfb97a56b181c4 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/bne_s.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/bne_s.il @@ -79,5 +79,5 @@ end: } -.assembly bne_s.exe {} +.assembly bne_s {} diff --git a/src/tests/JIT/IL_Conformance/Old/Base/br.il b/src/tests/JIT/IL_Conformance/Old/Base/br.il index 922adb53f7bc20..d70a9c9cfe9b27 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/br.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/br.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly br.exe{} +.assembly 'br'{} .class public _br { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/br_s.il b/src/tests/JIT/IL_Conformance/Old/Base/br_s.il index 4e4df5de05645e..bcc90fbd8d6a37 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/br_s.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/br_s.il @@ -26,4 +26,4 @@ PASS: } } -.assembly br_s.exe {} +.assembly br_s {} diff --git a/src/tests/JIT/IL_Conformance/Old/Base/brfalse.il b/src/tests/JIT/IL_Conformance/Old/Base/brfalse.il index 26bd6beb0bcfd4..9703dd6f5f87e3 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/brfalse.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/brfalse.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly brfalse.exe{} +.assembly 'brfalse'{} .class public _brfalse { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/brfalse_s.il b/src/tests/JIT/IL_Conformance/Old/Base/brfalse_s.il index e59f9413ab2b6d..0a2238982aae70 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/brfalse_s.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/brfalse_s.il @@ -21,4 +21,4 @@ PASS: } } -.assembly brfalse_s.exe {} +.assembly brfalse_s {} diff --git a/src/tests/JIT/IL_Conformance/Old/Base/brtrue.il b/src/tests/JIT/IL_Conformance/Old/Base/brtrue.il index a6bfc343295231..52f2edb48bc70c 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/brtrue.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/brtrue.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly brtrue.exe{} +.assembly 'brtrue'{} .class public _brtrue { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/brtrue_s.il b/src/tests/JIT/IL_Conformance/Old/Base/brtrue_s.il index 71a508a8359de9..2ad50440016328 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/brtrue_s.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/brtrue_s.il @@ -20,4 +20,4 @@ PASS: } } -.assembly brtrue_s.exe {} +.assembly brtrue_s {} diff --git a/src/tests/JIT/IL_Conformance/Old/Base/call.il b/src/tests/JIT/IL_Conformance/Old/Base/call.il index 5ce6d09058595f..f2095563e284cb 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/call.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/call.il @@ -5,7 +5,7 @@ -.assembly call.exe{} +.assembly 'call'{} .method public public static int32 test() { ldc.i4 0xFF diff --git a/src/tests/JIT/IL_Conformance/Old/Base/ceq.il b/src/tests/JIT/IL_Conformance/Old/Base/ceq.il index 22d99f768e61ca..ca90608f776114 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/ceq.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/ceq.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ceq.exe{} +.assembly 'ceq'{} .class public _ceq { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/cgt.il b/src/tests/JIT/IL_Conformance/Old/Base/cgt.il index e038a440a0d47b..b6d68dc1f5403e 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/cgt.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/cgt.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly cgt.exe{} +.assembly 'cgt'{} .class public _cgt { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/ckfinite.il b/src/tests/JIT/IL_Conformance/Old/Base/ckfinite.il index 9ee1badb5238a4..96d81177b0818d 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/ckfinite.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/ckfinite.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ckfinite.exe{} +.assembly 'ckfinite'{} .class public _ckfinite { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/clt.il b/src/tests/JIT/IL_Conformance/Old/Base/clt.il index d3e36a3cdb7155..c54969d73eb069 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/clt.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/clt.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly clt.exe{ +.assembly 'clt'{ } .class public _clt { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/conv.il b/src/tests/JIT/IL_Conformance/Old/Base/conv.il index dacc820f90289f..eabca38ca7f43c 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/conv.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/conv.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly conv.exe{} +.assembly conv{} .class public conv { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/conv_ovf.il b/src/tests/JIT/IL_Conformance/Old/Base/conv_ovf.il index a6403200605cad..ce5e3d05f3f3d1 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/conv_ovf.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/conv_ovf.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly conv_ovf.exe{} +.assembly conv_ovf{} .class public conv_ovf { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/cpblk.il b/src/tests/JIT/IL_Conformance/Old/Base/cpblk.il index a70683c43993a0..c2e5f649ee10a1 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/cpblk.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/cpblk.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly cpblk.exe{ +.assembly 'cpblk'{ } .class public _cpblk { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/div.il b/src/tests/JIT/IL_Conformance/Old/Base/div.il index 0a12a553082c96..5e626d3e95098a 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/div.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/div.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly div.exe{} +.assembly 'div'{} .class public _div { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/dup.il b/src/tests/JIT/IL_Conformance/Old/Base/dup.il index 2fdeb4d64b1586..6627bd4056292a 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/dup.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/dup.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly dup.exe{ +.assembly 'dup'{ } .class public _dup { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/initblk.il b/src/tests/JIT/IL_Conformance/Old/Base/initblk.il index 3d6d38b5cea52f..cf898744d0b67a 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/initblk.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/initblk.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly initblk.exe{ +.assembly 'initblk'{ } .class public _initblk { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/jmp.il b/src/tests/JIT/IL_Conformance/Old/Base/jmp.il index 767b0c73915546..4f48e4cc9995e6 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/jmp.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/jmp.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly jmp.exe{ +.assembly 'jmp'{ } .method public static int32 main(class [mscorlib]System.String[]) { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/ldarg_n.il b/src/tests/JIT/IL_Conformance/Old/Base/ldarg_n.il index 72cfe7842da81b..ed0a1fa050d7fd 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/ldarg_n.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/ldarg_n.il @@ -395,5 +395,5 @@ FAIL: } } -.assembly ldarg_n.exe {} +.assembly ldarg_n {} diff --git a/src/tests/JIT/IL_Conformance/Old/Base/ldarg_starg.il b/src/tests/JIT/IL_Conformance/Old/Base/ldarg_starg.il index 46e88423ad5397..d9dd7dcf39fbbf 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/ldarg_starg.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/ldarg_starg.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldarg_starg.exe{ +.assembly ldarg_starg{ } .class public ldarg_starg { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/ldargs_stargs.il b/src/tests/JIT/IL_Conformance/Old/Base/ldargs_stargs.il index a42363e7837c69..06b9d357990ad5 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/ldargs_stargs.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/ldargs_stargs.il @@ -110,4 +110,4 @@ FAIL: } } -.assembly ldargs_stargs.exe {} +.assembly ldargs_stargs {} diff --git a/src/tests/JIT/IL_Conformance/Old/Base/ldc.il b/src/tests/JIT/IL_Conformance/Old/Base/ldc.il index 0f5b3da8b4da58..b83dcf7be0e889 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/ldc.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/ldc.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldc.exe{} +.assembly ldc{} .class public ldc { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/ldc_i4_n.il b/src/tests/JIT/IL_Conformance/Old/Base/ldc_i4_n.il index 945f30b5b02ee8..bdaa6b320cce11 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/ldc_i4_n.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/ldc_i4_n.il @@ -70,5 +70,5 @@ FAIL: } } -.assembly ldc_i4_n.exe {} +.assembly ldc_i4_n {} diff --git a/src/tests/JIT/IL_Conformance/Old/Base/ldftn_calli.il b/src/tests/JIT/IL_Conformance/Old/Base/ldftn_calli.il index 2fcd161c551ab0..083a4a38c2f883 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/ldftn_calli.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/ldftn_calli.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldftn_calli.exe{} +.assembly ldftn_calli{} .method public public static int32 test() { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/ldind_stind.il b/src/tests/JIT/IL_Conformance/Old/Base/ldind_stind.il index 470be079f911f5..78a0a9e4d67c15 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/ldind_stind.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/ldind_stind.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldind_stind.exe{} +.assembly ldind_stind{} .class public ldind_stind { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/ldloc_stloc.il b/src/tests/JIT/IL_Conformance/Old/Base/ldloc_stloc.il index 341e97408fe083..84d33f5b3cf94b 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/ldloc_stloc.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/ldloc_stloc.il @@ -5,7 +5,7 @@ -.assembly ldloc_stloc.exe{ +.assembly ldloc_stloc{ } .class public value sealed vclass{ diff --git a/src/tests/JIT/IL_Conformance/Old/Base/ldloca.il b/src/tests/JIT/IL_Conformance/Old/Base/ldloca.il index 22707100495c49..d70a68364be041 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/ldloca.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/ldloca.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldloca.exe{ +.assembly 'ldloca'{ } .class public _ldloca { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/ldnull.il b/src/tests/JIT/IL_Conformance/Old/Base/ldnull.il index 661bec5a469c0f..6b11ab3dba3662 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/ldnull.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/ldnull.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldnull.exe{} +.assembly 'ldnull'{} .class public _ldnull { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/mul.il b/src/tests/JIT/IL_Conformance/Old/Base/mul.il index d2342ad684b9fb..20cf98dee29ce3 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/mul.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/mul.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly mul.exe{} +.assembly 'mul'{} .class public _mul { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/mul_ovf.il b/src/tests/JIT/IL_Conformance/Old/Base/mul_ovf.il index 7cfe254af98333..9c7c4c05d2c59b 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/mul_ovf.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/mul_ovf.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly mul_ovf.exe{} +.assembly mul_ovf{} .class public mul_ovf { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/neg.il b/src/tests/JIT/IL_Conformance/Old/Base/neg.il index c987590695b2ac..499557a4e5abee 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/neg.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/neg.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly neg.exe{} +.assembly 'neg'{} .class public _neg { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/nop.il b/src/tests/JIT/IL_Conformance/Old/Base/nop.il index ca3f6790b49637..9e5bd26c5a135d 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/nop.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/nop.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly nop.exe{} +.assembly 'nop'{} .class public _nop { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/not.il b/src/tests/JIT/IL_Conformance/Old/Base/not.il index a3642d7fa3e15c..872fb942b0fc74 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/not.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/not.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly not.exe{} +.assembly 'not'{} .class public _not { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/or.il b/src/tests/JIT/IL_Conformance/Old/Base/or.il index 9af0e5d56f4a78..44919e8aa49e99 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/or.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/or.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly or.exe{} +.assembly 'or'{} .class public _or { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/pop.il b/src/tests/JIT/IL_Conformance/Old/Base/pop.il index b2afd00abc90c6..2b88d63a21e0f2 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/pop.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/pop.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly pop.exe{} +.assembly 'pop'{} .class public _pop { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/rem.il b/src/tests/JIT/IL_Conformance/Old/Base/rem.il index 2eaf56eb12198c..d9f460bc1a12ea 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/rem.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/rem.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly rem.exe{} +.assembly 'rem'{} .class public _rem { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/ret.il b/src/tests/JIT/IL_Conformance/Old/Base/ret.il index 375fbd47282a16..3978c54036cc7b 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/ret.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/ret.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ret.exe{} +.assembly 'ret'{} .class public _ret { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/shl.il b/src/tests/JIT/IL_Conformance/Old/Base/shl.il index d66247476c6932..31eabab9165fbe 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/shl.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/shl.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly shl.exe{} +.assembly 'shl'{} .class public _shl { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/shr.il b/src/tests/JIT/IL_Conformance/Old/Base/shr.il index 300cf2aea66642..cdbf9d3e448325 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/shr.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/shr.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly shr.exe{} +.assembly 'shr'{} .class public _shr { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/sub.il b/src/tests/JIT/IL_Conformance/Old/Base/sub.il index 5e16f8ba2e659d..d55144072d9b69 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/sub.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/sub.il @@ -4,7 +4,7 @@ .assembly extern legacy library mscorlib {} .assembly extern mscorlib {} .assembly extern legacy library mscorlib {} -.assembly sub.exe{} +.assembly 'sub'{} .class public _sub { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/sub_ovf.il b/src/tests/JIT/IL_Conformance/Old/Base/sub_ovf.il index ad56b1c7e5bcba..58fe0fb98eb651 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/sub_ovf.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/sub_ovf.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly sub_ovf.exe{} +.assembly sub_ovf{} .class public sub_ovf { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/switch.il b/src/tests/JIT/IL_Conformance/Old/Base/switch.il index bc87c1c695816e..bf604abd347940 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/switch.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/switch.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly switch.exe{} +.assembly 'switch'{} .class public _switch { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/tailcall.il b/src/tests/JIT/IL_Conformance/Old/Base/tailcall.il index 5504e3732554e3..4cf2d331335048 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/tailcall.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/tailcall.il @@ -6,7 +6,7 @@ .assembly extern legacy library mscorlib { auto } -.assembly tailcall.exe{} +.assembly tailcall{} .method public static int32 main(string[]) { .locals (class [mscorlib]System.IO.TextWriter,class _tailcall) diff --git a/src/tests/JIT/IL_Conformance/Old/Base/unaligned.il b/src/tests/JIT/IL_Conformance/Old/Base/unaligned.il index 301fdbee41372a..edcaca9a4d1f98 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/unaligned.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/unaligned.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly unaligned.exe{ +.assembly unaligned{ } .method public static int32 main(class [mscorlib]System.String[]) { diff --git a/src/tests/JIT/IL_Conformance/Old/Base/volatile.il b/src/tests/JIT/IL_Conformance/Old/Base/volatile.il index aabb8fda1deb67..934c696ec69c64 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/volatile.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/volatile.il @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} -.assembly volatile.exe{} +.assembly volatile{} .class public _volatile { .field public static native int PTR diff --git a/src/tests/JIT/IL_Conformance/Old/Base/xor.il b/src/tests/JIT/IL_Conformance/Old/Base/xor.il index cbd60598762fa4..b6a0dd9bee914f 100644 --- a/src/tests/JIT/IL_Conformance/Old/Base/xor.il +++ b/src/tests/JIT/IL_Conformance/Old/Base/xor.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly xor.exe{} +.assembly 'xor'{} .class public _xor { diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/Conv_I4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/Conv_I4.il index 66c7c6c34469ff..17b59c524d6154 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/Conv_I4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/Conv_I4.il @@ -701,4 +701,4 @@ END: } } -.assembly Conv_I4.exe{} +.assembly Conv_I4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/Conv_I8-64.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/Conv_I8-64.il index 6957d00a283665..afb32986e2a27f 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/Conv_I8-64.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/Conv_I8-64.il @@ -590,4 +590,4 @@ END: } } -.assembly Conv_I8.exe{} +.assembly Conv_I8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/Conv_R4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/Conv_R4.il index 000f2cb1c2b69d..888505ac3089ec 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/Conv_R4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/Conv_R4.il @@ -586,4 +586,4 @@ END: } } -.assembly Conv_R4.exe{} +.assembly Conv_R4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_I4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_I4.il index 587a7e59f84b4c..e130c00d835c80 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_I4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_I4.il @@ -275,4 +275,4 @@ FAIL: ret } } -.assembly add_I4.exe{} +.assembly add_I4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_i.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_i.il index 1c8717ec2bf3f5..1ee212adde1db8 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_i.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_i.il @@ -40,4 +40,4 @@ FAIL: ret } } -.assembly add_i.exe{} +.assembly add_i{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_i8.il index 642a8e8c9538c5..b2db47d81dc244 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_i8.il @@ -277,4 +277,4 @@ FAIL: ret } } -.assembly add_i8.exe{} +.assembly add_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_i1.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_i1.il index 89dced523ba377..de3fbe6eb1c2d4 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_i1.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_i1.il @@ -416,4 +416,4 @@ END: -.assembly add_ovf_i1.exe{} +.assembly add_ovf_i1{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_i2.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_i2.il index d9b34528d53271..f244e3c24f05df 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_i2.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_i2.il @@ -415,4 +415,4 @@ END: -.assembly add_ovf_i2.exe{} +.assembly add_ovf_i2{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_i4.il index 662ebc36f7b4b5..3e057e5e2ecbe3 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_i4.il @@ -414,4 +414,4 @@ END: } -.assembly add_ovf_i4.exe{} +.assembly add_ovf_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_i8.il index f7ae9da9d31c9a..1937a243dad499 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_i8.il @@ -414,4 +414,4 @@ END: } -.assembly add_ovf_i8.exe{} +.assembly add_ovf_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_u1.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_u1.il index 85a77139a2f4d3..9cbcdd389f1dca 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_u1.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_u1.il @@ -320,4 +320,4 @@ END: } -.assembly add_ovf_u1.exe{} +.assembly add_ovf_u1{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_u2.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_u2.il index 679165a905ed14..5b5c9163517379 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_u2.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_u2.il @@ -319,4 +319,4 @@ END: } } -.assembly add_ovf_u2.exe{} +.assembly add_ovf_u2{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_u4.il index c664c2bae0dd52..7f8fe0565d4551 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_u4.il @@ -318,4 +318,4 @@ END: } } -.assembly add_ovf_u4.exe{} +.assembly add_ovf_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_u8.il index 35819e49bd55f0..2ffa7768c7161c 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_ovf_u8.il @@ -318,4 +318,4 @@ END: } } -.assembly add_ovf_u8.exe{} +.assembly add_ovf_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_r4.il index 8133f39737c5c4..fccd86c0722d82 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_r4.il @@ -498,4 +498,4 @@ FAIL: ret } } -.assembly add_r4.exe{} +.assembly add_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_r8.il index 8b2eabb81351c3..7428ab5a8eea44 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/add_r8.il @@ -500,4 +500,4 @@ FAIL: ret } } -.assembly add_r8.exe{} +.assembly add_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/and_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/and_u4.il index 6567fb0ce1a824..1239062bc6304a 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/and_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/and_u4.il @@ -108,4 +108,4 @@ FAIL: ret } } -.assembly and_u4.exe{} +.assembly and_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/and_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/and_u8.il index cb0d9dcad22ab1..40766e28246c27 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/and_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/and_u8.il @@ -108,4 +108,4 @@ FAIL: ret } } -.assembly and_u8.exe{} +.assembly and_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_i.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_i.il index e3eecf01ae4e6d..6f28c6fcf88571 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_i.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_i.il @@ -43,4 +43,4 @@ FAIL: ret } } -.assembly beq_i.exe{} +.assembly beq_i{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_i4.il index 27fb2f1fdf552d..809b836c6e032c 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_i4.il @@ -265,4 +265,4 @@ FAIL: ret } } -.assembly beq_i4.exe{} +.assembly beq_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_i8.il index 0a274eb1278b73..1d5c8309c7a232 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_i8.il @@ -265,4 +265,4 @@ FAIL: ret } } -.assembly beq_i8.exe{} +.assembly beq_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_r4.il index 3a19785237968c..8033300accac13 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_r4.il @@ -540,4 +540,4 @@ FAIL: ret } -.assembly beq_r4.exe{} +.assembly beq_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_r8.il index 0e162d47aa7fec..c001b191276578 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/beq_r8.il @@ -542,4 +542,4 @@ FAIL: ret } -.assembly beq_r8.exe{} +.assembly beq_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_i4.il index 63b09e4c8e6e2b..dd8a96b1b3c58c 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_i4.il @@ -307,4 +307,4 @@ FAIL: ret } } -.assembly bge_i4.exe{} +.assembly bge_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_i8.il index 4168c45044c79e..bce07ae7c39837 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_i8.il @@ -306,4 +306,4 @@ FAIL: ret } } -.assembly bge_i8.exe{} +.assembly bge_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_r4.il index eb35e62379408c..aaf63721e013aa 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_r4.il @@ -596,4 +596,4 @@ FAIL: ret } -.assembly bge_r4.exe{} +.assembly bge_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_r8.il index 99d7b6007ed431..c3960a929518fa 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_r8.il @@ -598,4 +598,4 @@ FAIL: ret } -.assembly bge_r8.exe{} +.assembly bge_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_u.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_u.il index 6b4f2fca1cc676..536a2fb601ada8 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_u.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_u.il @@ -45,4 +45,4 @@ FAIL: ret } } -.assembly bge_u.exe{} +.assembly bge_u{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_un_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_un_i4.il index f5cd419c864259..399491e13a1c58 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_un_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_un_i4.il @@ -127,4 +127,4 @@ FAIL: ret } } -.assembly bge_un_i4.exe{} +.assembly bge_un_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_un_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_un_i8.il index f2186f9e4cf197..f7fd81865a329d 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_un_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_un_i8.il @@ -127,4 +127,4 @@ FAIL: ret } } -.assembly bge_un_i8.exe{} +.assembly bge_un_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_un_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_un_r4.il index c652ab6766c755..446cd67c8535f3 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_un_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_un_r4.il @@ -1085,4 +1085,4 @@ FAIL: ret } -.assembly bge_un_r4.exe{} +.assembly bge_un_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_un_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_un_r8.il index 0a4f995fd95e68..92c230619c0d2b 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_un_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bge_un_r8.il @@ -1085,4 +1085,4 @@ FAIL: ret } -.assembly bge_un_r8.exe{} +.assembly bge_un_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_i4.il index 888bf068f1f0a0..62e5557e91a995 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_i4.il @@ -299,4 +299,4 @@ FAIL: ret } } -.assembly bgt_i4.exe{} +.assembly bgt_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_i8.il index 611a2bea749e77..32acdd7a1240c9 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_i8.il @@ -299,4 +299,4 @@ FAIL: ret } } -.assembly bgt_i8.exe{} +.assembly bgt_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_r4.il index 246c39a9466786..27ec28fceac797 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_r4.il @@ -439,4 +439,4 @@ FAIL: ret } } -.assembly bgt_r4.exe{} +.assembly bgt_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_r8.il index a4bf075b7de7a8..84f2ad86c0e7c6 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_r8.il @@ -439,4 +439,4 @@ FAIL: ret } } -.assembly bgt_r8.exe{} +.assembly bgt_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_u.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_u.il index 7e493ebc4eba9c..922253f3ee268f 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_u.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_u.il @@ -51,4 +51,4 @@ FAIL: ret } } -.assembly bgt_u.exe{} +.assembly bgt_u{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_u4.il index 28b917a8c4828d..1cb8b404286091 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_u4.il @@ -120,4 +120,4 @@ FAIL: ret } } -.assembly bgt_u4.exe{} +.assembly bgt_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_u8.il index 785eb79801b146..5e4b4f61f67626 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_u8.il @@ -120,4 +120,4 @@ FAIL: ret } } -.assembly bgt_u8.exe{} +.assembly bgt_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_un_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_un_r4.il index 4b5eed4d97dbff..8216501a26b7c8 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_un_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_un_r4.il @@ -894,4 +894,4 @@ FAIL: ret } } -.assembly bgt_un_r4.exe{} +.assembly bgt_un_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_un_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_un_r8.il index e3f46e8509a006..8e597262ad69e5 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_un_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bgt_un_r8.il @@ -894,4 +894,4 @@ FAIL: ret } } -.assembly bgt_un_r8.exe{} +.assembly bgt_un_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_i4.il index 9dfd1b8ac40165..05b932d2066417 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_i4.il @@ -311,4 +311,4 @@ FAIL: ret } } -.assembly ble_i4.exe{} +.assembly ble_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_i8.il index 515e012b9d85f7..4c26ba0fad8204 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_i8.il @@ -311,4 +311,4 @@ FAIL: ret } } -.assembly ble_i8.exe{} +.assembly ble_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_r4.il index c7053cf8e5b21f..c76bd2b9025499 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_r4.il @@ -475,4 +475,4 @@ FAIL: ret } } -.assembly ble_r4.exe{} +.assembly ble_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_r8.il index 4403a1fb6bbf39..135c2c60c49ce6 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_r8.il @@ -475,4 +475,4 @@ FAIL: ret } } -.assembly ble_r8.exe{} +.assembly ble_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_u.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_u.il index ac746efe57f8ae..ebc02ad0c571c0 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_u.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_u.il @@ -45,4 +45,4 @@ FAIL: ret } } -.assembly ble_u.exe{} +.assembly ble_u{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_u4.il index 3dc5ad97d5b517..ee975b1ec35631 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_u4.il @@ -127,4 +127,4 @@ FAIL: ret } } -.assembly ble_u4.exe{} +.assembly ble_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_u8.il index 2488e64419ed05..038331a1a01218 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_u8.il @@ -127,4 +127,4 @@ FAIL: ret } } -.assembly ble_u8.exe{} +.assembly ble_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_un_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_un_r4.il index 82eb0f6c47dfcb..75939de4c972f5 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_un_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_un_r4.il @@ -934,4 +934,4 @@ FAIL: ret } } -.assembly ble_un_r4.exe{} +.assembly ble_un_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_un_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_un_r8.il index 8f83e4de49d8be..f637c9d67d4754 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_un_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ble_un_r8.il @@ -934,4 +934,4 @@ FAIL: ret } } -.assembly ble_un_r8.exe{} +.assembly ble_un_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_i4.il index 748aac387c9630..8a8ef5d844c3be 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_i4.il @@ -305,4 +305,4 @@ FAIL: ret } } -.assembly blt_i4.exe{} +.assembly blt_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_i8.il index e3b6214de3043b..71f38dba26f132 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_i8.il @@ -305,4 +305,4 @@ FAIL: ret } } -.assembly blt_i8.exe{} +.assembly blt_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_r4.il index 47cb5979f0c212..502c10f52de10d 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_r4.il @@ -464,4 +464,4 @@ FAIL: ret } } -.assembly blt_r4.exe{} +.assembly blt_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_r8.il index 071ec2ab79fd64..5be61768d71f45 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_r8.il @@ -464,4 +464,4 @@ FAIL: ret } } -.assembly blt_r8.exe{} +.assembly blt_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_u.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_u.il index 3b7c62f88178e3..7390d5d1537962 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_u.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_u.il @@ -43,4 +43,4 @@ FAIL: ret } } -.assembly blt_u.exe{} +.assembly blt_u{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_u4.il index b4d049f825019e..73707d167372d2 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_u4.il @@ -124,4 +124,4 @@ FAIL: ret } } -.assembly blt_u4.exe{} +.assembly blt_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_u8.il index a09212935ba6fe..1a735a042547ac 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_u8.il @@ -124,4 +124,4 @@ FAIL: ret } } -.assembly blt_u8.exe{} +.assembly blt_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_un_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_un_r4.il index 158ef20b8bbb2d..a9392345033803 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_un_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_un_r4.il @@ -904,4 +904,4 @@ FAIL: ret } } -.assembly blt_un_r4.exe{} +.assembly blt_un_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_un_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_un_r8.il index 514e66222ef4d7..a2147ad0c16da7 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_un_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/blt_un_r8.il @@ -904,4 +904,4 @@ FAIL: ret } } -.assembly blt_un_r8.exe{} +.assembly blt_un_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_u.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_u.il index 795cc50aaa1a77..d62bc21b0dec11 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_u.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_u.il @@ -44,4 +44,4 @@ FAIL: ret } } -.assembly bne_u.exe{} +.assembly bne_u{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_u4.il index 3a7c95d35e5be0..72e076a7e549b4 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_u4.il @@ -128,4 +128,4 @@ FAIL: ret } } -.assembly bne_u4.exe{} +.assembly bne_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_u8.il index 49e36ab035de3f..f8112f39f71190 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_u8.il @@ -129,4 +129,4 @@ FAIL: ret } } -.assembly bne_u8.exe{} +.assembly bne_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_un_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_un_r4.il index 3e5d97c61d3df8..ea2a8116338790 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_un_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_un_r4.il @@ -1000,4 +1000,4 @@ FAIL: ret } } -.assembly bne_un_r4.exe{} +.assembly bne_un_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_un_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_un_r8.il index 1f0c535d102b6f..21878fc218354e 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_un_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/bne_un_r8.il @@ -1000,4 +1000,4 @@ FAIL: ret } } -.assembly bne_un_r8.exe{} +.assembly bne_un_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/br.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/br.il index 030611824a7c85..0d418137523ec9 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/br.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/br.il @@ -91,4 +91,4 @@ FAIL: ret } } -.assembly br.exe{} +.assembly 'br'{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/brfalse.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/brfalse.il index 820b8b4d49b0c5..4109c4f0e7d4ff 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/brfalse.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/brfalse.il @@ -137,4 +137,4 @@ FAIL: } } -.assembly brfalse.exe{} +.assembly 'brfalse'{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/brtrue.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/brtrue.il index 440bd8b43975ab..2273ee54016fbf 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/brtrue.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/brtrue.il @@ -145,4 +145,4 @@ FAIL: } } -.assembly brtrue.exe{} +.assembly 'brtrue'{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_br.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_br.il index 68a72ed261e12c..fe79a88893ecbf 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_br.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_br.il @@ -93,4 +93,4 @@ FAIL: ret } } -.assembly c_br.exe {} +.assembly c_br {} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_brfalse.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_brfalse.il index 9aa6605e35dbd9..e4e83d4084f46e 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_brfalse.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_brfalse.il @@ -139,4 +139,4 @@ FAIL: } } -.assembly c_brfalse.exe {} +.assembly c_brfalse {} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_brtrue.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_brtrue.il index 69173398e9015f..46ca634ee96c9e 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_brtrue.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_brtrue.il @@ -147,4 +147,4 @@ FAIL: } } -.assembly c_brtrue.exe {} +.assembly c_brtrue {} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_call.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_call.il index 68f359a47530cc..7268c77a9703fd 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_call.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_call.il @@ -28,6 +28,6 @@ FAIL: } -.assembly c_call.exe{} +.assembly c_call{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_cpblk.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_cpblk.il index b8f2a94048eed9..5de65a906ca63c 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_cpblk.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_cpblk.il @@ -78,5 +78,5 @@ END: } -.assembly c_cpblk.exe {} +.assembly c_cpblk {} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_initblk.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_initblk.il index 9d61ee79a13bf3..521e636d024be6 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_initblk.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_initblk.il @@ -44,5 +44,5 @@ END: } -.assembly c_initblk.exe {} +.assembly c_initblk {} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_ldvirtftn.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_ldvirtftn.il index 7d022962c1a59e..b5fd70de208dbf 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_ldvirtftn.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_ldvirtftn.il @@ -23,4 +23,4 @@ FAIL: ret } } -.assembly c_ldvirtftn.exe {} +.assembly c_ldvirtftn {} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_localloc.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_localloc.il index 0e19d23ce6828e..b76ebced02aca8 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_localloc.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_localloc.il @@ -110,4 +110,4 @@ FAIL: } } -.assembly c_localloc.exe {} +.assembly c_localloc {} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_nop.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_nop.il index 7e4bc0e3a2ae3d..0ff4997012e673 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_nop.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_nop.il @@ -68,5 +68,5 @@ END: } -.assembly c_nop.exe {} +.assembly c_nop {} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_ret.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_ret.il index 757e53c5181c3e..60c33975885d4f 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_ret.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_ret.il @@ -44,5 +44,5 @@ END: } -.assembly c_ret.exe {} +.assembly c_ret {} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_switch.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_switch.il index 173d01dd5fa03c..5e52c8b3067083 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_switch.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/c_switch.il @@ -75,5 +75,5 @@ END: } -.assembly c_switch.exe {} +.assembly c_switch {} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/call.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/call.il index 907eec03fd7a7c..6b8627efed0db6 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/call.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/call.il @@ -29,4 +29,4 @@ FAIL: -.assembly call.exe{} +.assembly 'call'{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ceq_i.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ceq_i.il index 68703efde59200..b496358943f25c 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ceq_i.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ceq_i.il @@ -44,4 +44,4 @@ FAIL: ret } } -.assembly ceq_i.exe{} +.assembly ceq_i{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ceq_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ceq_i4.il index 503ab4ec1e71ca..dae8ee7b2780c6 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ceq_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ceq_i4.il @@ -295,4 +295,4 @@ FAIL: ret } } -.assembly ceq_i4.exe{} +.assembly ceq_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ceq_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ceq_i8.il index bd8ab1677a2b4f..b9608bbfbbd329 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ceq_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ceq_i8.il @@ -296,4 +296,4 @@ FAIL: ret } } -.assembly ceq_i8.exe{} +.assembly ceq_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ceq_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ceq_r4.il index 85afd75d76ec35..a4b56d869a7835 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ceq_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ceq_r4.il @@ -454,4 +454,4 @@ FAIL: } } -.assembly ceq_r4.exe{} +.assembly ceq_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ceq_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ceq_r8.il index b7c2558336d4b6..3a3229085a7280 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ceq_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ceq_r8.il @@ -453,4 +453,4 @@ FAIL: ret } } -.assembly ceq_r8.exe{} +.assembly ceq_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_i4.il index 4b6de4d97b6f0b..8499cf3a0cc592 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_i4.il @@ -295,4 +295,4 @@ FAIL: ret } } -.assembly cgt_i4.exe{} +.assembly cgt_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_i8.il index 219ce1b30a311f..3df1c56f9579e1 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_i8.il @@ -293,4 +293,4 @@ FAIL: ret } } -.assembly cgt_i8.exe{} +.assembly cgt_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_r4.il index d6dbe06847802a..63f2c19edf5206 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_r4.il @@ -453,4 +453,4 @@ FAIL: ret } } -.assembly cgt_r4.exe{} +.assembly cgt_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_r8.il index 42cb35f968f707..4cf3d457fd47e4 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_r8.il @@ -452,4 +452,4 @@ FAIL: ret } } -.assembly cgt_r8.exe{} +.assembly cgt_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_u.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_u.il index fb85e8d1b50f2a..b25026594555cd 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_u.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_u.il @@ -44,4 +44,4 @@ FAIL: ret } } -.assembly cgt_u.exe{} +.assembly cgt_u{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_u4.il index c1b0ac663f00a4..872819737c0021 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_u4.il @@ -113,4 +113,4 @@ FAIL: ret } } -.assembly cgt_u4.exe{} +.assembly cgt_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_u8.il index 73e67336a2c322..1fafa254280f26 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_u8.il @@ -113,4 +113,4 @@ FAIL: ret } } -.assembly cgt_u8.exe{} +.assembly cgt_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_un_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_un_r4.il index 1551d49e11749b..03c0392f1b9221 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_un_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_un_r4.il @@ -869,4 +869,4 @@ FAIL: ret } } -.assembly cgt_un_r4.exe{} +.assembly cgt_un_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_un_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_un_r8.il index fa5d1b315a574d..ba0653164221f7 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_un_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cgt_un_r8.il @@ -870,4 +870,4 @@ FAIL: ret } } -.assembly cgt_un_r8.exe{} +.assembly cgt_un_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ckfinite_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ckfinite_r4.il index a7acb3a9d40128..61c3ba1813a247 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ckfinite_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ckfinite_r4.il @@ -108,4 +108,4 @@ END: } } -.assembly ckfinite_r4.exe{} +.assembly ckfinite_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ckfinite_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ckfinite_r8.il index 83d57611c69e2e..31deedab008113 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ckfinite_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ckfinite_r8.il @@ -109,4 +109,4 @@ END: } } -.assembly ckfinite_r8.exe{} +.assembly ckfinite_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_i4.il index 1087ab07aad134..5edec385d4cb95 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_i4.il @@ -295,4 +295,4 @@ FAIL: ret } } -.assembly clt_i4.exe{} +.assembly clt_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_i8.il index bb23cf3a648968..677eab292f4e25 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_i8.il @@ -294,4 +294,4 @@ FAIL: ret } } -.assembly clt_i8.exe{} +.assembly clt_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_r4.il index 4521767704d784..a80c4b544731db 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_r4.il @@ -451,4 +451,4 @@ FAIL: ret } } -.assembly clt_r4.exe{} +.assembly clt_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_r8.il index 00cd5713dde817..cde223f9e91155 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_r8.il @@ -449,4 +449,4 @@ FAIL: ret } } -.assembly clt_r8.exe{} +.assembly clt_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_u.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_u.il index 9204dd53d42649..917abe74364571 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_u.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_u.il @@ -43,4 +43,4 @@ FAIL: ret } } -.assembly clt_u.exe{} +.assembly clt_u{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_u4.il index 6fa44f8fd61acb..95cce5349068e4 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_u4.il @@ -110,4 +110,4 @@ FAIL: ret } } -.assembly clt_u4.exe{} +.assembly clt_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_u8.il index 05c3dff53ed741..cbd920209bd567 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_u8.il @@ -111,4 +111,4 @@ FAIL: ret } } -.assembly clt_u8.exe{} +.assembly clt_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_un_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_un_r4.il index 91b57cc74d2810..bcc35afa65e61b 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_un_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_un_r4.il @@ -868,4 +868,4 @@ FAIL: ret } } -.assembly clt_un_r4.exe{} +.assembly clt_un_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_un_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_un_r8.il index 9187df14d7f5d4..10e93b98995a04 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_un_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/clt_un_r8.il @@ -862,4 +862,4 @@ FAIL: ret } } -.assembly clt_un_r8.exe{} +.assembly clt_un_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i1_un.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i1_un.il index 140817efd7b0df..b6eab5cdcc11fa 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i1_un.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i1_un.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} //Constant Prop phase was not checking for overflow when propagating through a conv.ovf. //Correct behavior expects the code within the try block to throw an exception. @@ -15,6 +16,9 @@ .assembly extern mscorlib{auto} .class Class_test { .method static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i4_i1.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i4_i1.il index e031f518fef7e8..ef8a3bebde94df 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i4_i1.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i4_i1.il @@ -208,4 +208,4 @@ END: -.assembly conv_ovf_i4_i1.exe{} +.assembly conv_ovf_i4_i1{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i4_i2.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i4_i2.il index e78ce2470b461f..c87f5eca9c0c5a 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i4_i2.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i4_i2.il @@ -199,4 +199,4 @@ END: -.assembly conv_ovf_i4_i2.exe{} +.assembly conv_ovf_i4_i2{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i4_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i4_u4.il index 386b0f48521be4..8eefbaa89a527a 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i4_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i4_u4.il @@ -166,4 +166,4 @@ END: } } -.assembly conv_ovf_i4_u4.exe{} +.assembly conv_ovf_i4_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i8_i.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i8_i.il index ba0f2c1ed9c1db..67759e9c24aef4 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i8_i.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i8_i.il @@ -212,4 +212,4 @@ END: -.assembly conv_ovf_i8_i.exe{} +.assembly conv_ovf_i8_i{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i8_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i8_i4.il index a75254f8707551..06037620e65a35 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i8_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i8_i4.il @@ -200,4 +200,4 @@ END: -.assembly conv_ovf_i8_i4.exe{} +.assembly conv_ovf_i8_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i8_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i8_u8.il index 2ae12ad9178a17..fe7bc1810312f5 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i8_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_i8_u8.il @@ -165,4 +165,4 @@ END: } } -.assembly conv_ovf_i8_u8.exe{} +.assembly conv_ovf_i8_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_r8_i.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_r8_i.il index 43910c8da394dd..031cd717af798c 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_r8_i.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_r8_i.il @@ -232,4 +232,4 @@ END: } -.assembly conv_ovf_r8_i.exe{} +.assembly conv_ovf_r8_i{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_r8_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_r8_i4.il index 9b3ca53ec313e2..17ac8c7bfd8eeb 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_r8_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_r8_i4.il @@ -232,4 +232,4 @@ END: } -.assembly conv_ovf_r8_i4.exe{} +.assembly conv_ovf_r8_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_r8_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_r8_i8.il index 9658c033b272e4..7057d5e3e1dfab 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_r8_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_r8_i8.il @@ -228,4 +228,4 @@ END: } } -.assembly conv_ovf_r8_i8.exe{} +.assembly conv_ovf_r8_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u4_i.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u4_i.il index 52317186be8055..de332f73dd82f9 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u4_i.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u4_i.il @@ -167,4 +167,4 @@ END: } } -.assembly conv_ovf_u4_i.exe{} +.assembly conv_ovf_u4_i{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u4_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u4_i4.il index 53fb2e640339b7..eea6ee5e1bb0fb 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u4_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u4_i4.il @@ -167,4 +167,4 @@ END: } } -.assembly conv_ovf_u4_i4.exe{} +.assembly conv_ovf_u4_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u4_u1.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u4_u1.il index bacbf2c7ead7c1..783d8714d50293 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u4_u1.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u4_u1.il @@ -150,4 +150,4 @@ END: -.assembly conv_ovf_u4_u1.exe{} +.assembly conv_ovf_u4_u1{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u4_u2.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u4_u2.il index 2a85eb66b88d71..3382a22f7c4a3d 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u4_u2.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u4_u2.il @@ -148,4 +148,4 @@ END: } } -.assembly conv_ovf_u4_u2.exe{} +.assembly conv_ovf_u4_u2{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u8_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u8_i8.il index dc5caf1bddf39f..6cc437db3a263b 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u8_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u8_i8.il @@ -177,4 +177,4 @@ END: } } -.assembly conv_ovf_u8_i8.exe{} +.assembly conv_ovf_u8_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u8_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u8_u4.il index f2d0944abbbb97..7d4054de26bdd0 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u8_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/conv_ovf_u8_u4.il @@ -159,4 +159,4 @@ END: } } -.assembly conv_ovf_u8_u4.exe{} +.assembly conv_ovf_u8_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cpblk.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cpblk.il index 8deb42886e0ac6..522b3dadf50854 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cpblk.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/cpblk.il @@ -78,4 +78,4 @@ END: -.assembly cpblk.exe{} +.assembly 'cpblk'{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_i4.il index f93fe9badd807f..39c10cf707efae 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_i4.il @@ -356,4 +356,4 @@ FAIL: ret } } -.assembly div_i4.exe{} +.assembly div_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_i8.il index 6a12cb443c3311..04ab7b10c797d7 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_i8.il @@ -356,4 +356,4 @@ FAIL: ret } } -.assembly div_i8.exe{} +.assembly div_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_r4.il index 6d4b405b970f95..3b1a9c85999a17 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_r4.il @@ -600,4 +600,4 @@ FAIL: ret } } -.assembly div_r4.exe{} +.assembly div_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_r8.il index dca91a23ddb897..bbdea0fad0a20a 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_r8.il @@ -604,4 +604,4 @@ FAIL: ret } } -.assembly div_r8.exe{} +.assembly div_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_u4.il index da36bdcd9fc366..201d2e22f7180f 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_u4.il @@ -266,4 +266,4 @@ FAIL: ret } } -.assembly div_u4.exe{} +.assembly div_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_u8.il index f67a35dfbe9f9e..e83c5fb85ac2c8 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/div_u8.il @@ -266,4 +266,4 @@ FAIL: ret } } -.assembly div_u8.exe{} +.assembly div_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/dup4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/dup4.il index 2ff393bfb4a693..f5129d1fbf23b5 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/dup4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/dup4.il @@ -53,4 +53,4 @@ FAIL: ret } } -.assembly dup4.exe{} +.assembly dup4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/dup8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/dup8.il index 4079d4787d6542..1694af97208c68 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/dup8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/dup8.il @@ -52,4 +52,4 @@ FAIL: ret } } -.assembly dup8.exe{} +.assembly dup8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/dupi.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/dupi.il index 8c80618e7c0b47..7cb49334a71801 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/dupi.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/dupi.il @@ -25,4 +25,4 @@ FAIL: ret } } -.assembly dupi.exe{} +.assembly dupi{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/initblk.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/initblk.il index 14ebe7dd1e5430..a08617a801eab8 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/initblk.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/initblk.il @@ -43,4 +43,4 @@ END: -.assembly initblk.exe{} +.assembly 'initblk'{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_i.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_i.il index 5f5f4a7a5134ed..d3e71465ac9134 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_i.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_i.il @@ -37,4 +37,4 @@ FAIL: ret } } -.assembly ldarg_i.exe{} +.assembly ldarg_i{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_i4.il index 656968a7b00b26..354e96e101b822 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_i4.il @@ -56,4 +56,4 @@ FAIL: ret } } -.assembly ldarg_i4.exe{} +.assembly ldarg_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_i8.il index 4a20edbac5d32f..d942f2922d7e0c 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_i8.il @@ -56,4 +56,4 @@ FAIL: ret } } -.assembly ldarg_i8.exe{} +.assembly ldarg_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_r4.il index dd4299016969b9..59e546cca4e17b 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_r4.il @@ -66,4 +66,4 @@ FAIL: ret } } -.assembly ldarg_r4.exe{} +.assembly ldarg_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_r8.il index 5fdd33a1ccf907..35108d5fe19f83 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_r8.il @@ -67,4 +67,4 @@ FAIL: ret } } -.assembly ldarg_r8.exe{} +.assembly ldarg_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_ref.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_ref.il index e201e707d87ecb..6f9bb379548eeb 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_ref.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarg_ref.il @@ -40,4 +40,4 @@ FAIL: } } -.assembly ldarg_ref.exe{} +.assembly ldarg_ref{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_i.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_i.il index a67f2ebddf685d..f386d4c1968210 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_i.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_i.il @@ -39,4 +39,4 @@ FAIL: ret } } -.assembly ldarga_i.exe{} +.assembly ldarga_i{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_i4.il index 00e0d6e9bc6c02..225edaa4a957c9 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_i4.il @@ -57,4 +57,4 @@ FAIL: ret } } -.assembly ldarga_i4.exe{} +.assembly ldarga_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_i8.il index e928f610506128..be57713bc04f43 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_i8.il @@ -57,4 +57,4 @@ FAIL: ret } } -.assembly ldarga_i8.exe{} +.assembly ldarga_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_r4.il index 91b562262f6a89..d7fbc317c428c5 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_r4.il @@ -68,4 +68,4 @@ FAIL: ret } } -.assembly ldarga_r4.exe{} +.assembly ldarga_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_r8.il index 3f2db7a6ac88d0..809bb7e5732203 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_r8.il @@ -69,4 +69,4 @@ FAIL: ret } } -.assembly ldarga_r8.exe{} +.assembly ldarga_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_ref.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_ref.il index d3b0d588df2f00..495d1a87c80995 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_ref.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldarga_ref.il @@ -40,4 +40,4 @@ FAIL: } } -.assembly ldarga_ref.exe{} +.assembly ldarga_ref{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_i1.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_i1.il index 7409bcaac59f02..d7366bf261d772 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_i1.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_i1.il @@ -2124,5 +2124,5 @@ END: -.assembly ldc_add_ovf_i1.exe{} +.assembly ldc_add_ovf_i1{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_i2.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_i2.il index 920d66e2e81f54..530728b03b05ad 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_i2.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_i2.il @@ -2123,5 +2123,5 @@ END: -.assembly ldc_add_ovf_i2.exe{} +.assembly ldc_add_ovf_i2{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_i4.il index b09a1098590540..5b249ceef5449a 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_i4.il @@ -2122,5 +2122,5 @@ END: } -.assembly ldc_add_ovf_i4.exe{} +.assembly ldc_add_ovf_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_i8.il index 95f5143ec5ff88..6bd3a706a67992 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_i8.il @@ -2122,5 +2122,5 @@ END: } -.assembly ldc_add_ovf_i8.exe{} +.assembly ldc_add_ovf_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_u1.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_u1.il index aba34891aad438..3efa33a71fb6f0 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_u1.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_u1.il @@ -1572,5 +1572,5 @@ END: } -.assembly ldc_add_ovf_u1.exe{} +.assembly ldc_add_ovf_u1{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_u2.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_u2.il index 457987df67df8e..b3eab39b7e3b33 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_u2.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_u2.il @@ -1571,5 +1571,5 @@ END: //---- EOF ------------------ } -.assembly ldc_add_ovf_u2.exe{} +.assembly ldc_add_ovf_u2{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_u4.il index 0cf2f157c3f731..cf4cece8590393 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_u4.il @@ -1535,5 +1535,5 @@ END: //---- EOF ------------------ } -.assembly ldc_add_ovf_u4.exe{} +.assembly ldc_add_ovf_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_u8.il index 380c845e1be3e0..dabcc80cdfef8b 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_add_ovf_u8.il @@ -1571,5 +1571,5 @@ END: //---- EOF ------------------ } -.assembly ldc_add_ovf_u8.exe{} +.assembly ldc_add_ovf_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_c_cpblk.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_c_cpblk.il index 75ddc66e5b8293..813cd7e3d440da 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_c_cpblk.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_c_cpblk.il @@ -103,6 +103,6 @@ END: } -.assembly ldc_c_cpblk.exe {} +.assembly ldc_c_cpblk {} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_c_initblk.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_c_initblk.il index e6949725ec391b..5f166afd5381eb 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_c_initblk.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_c_initblk.il @@ -64,6 +64,6 @@ END: } -.assembly ldc_c_initblk.exe {} +.assembly ldc_c_initblk {} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_c_nop.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_c_nop.il index fc8d96efd65e61..d0a1745046e6d9 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_c_nop.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_c_nop.il @@ -91,6 +91,6 @@ END: } -.assembly ldc_c_nop.exe {} +.assembly ldc_c_nop {} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_c_ret.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_c_ret.il index fa5cebb562c2d4..b563463aaf58e0 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_c_ret.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_c_ret.il @@ -93,6 +93,6 @@ END: } -.assembly ldc_c_ret.exe {} +.assembly ldc_c_ret {} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_c_switch.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_c_switch.il index 9538a8f3905502..e12457f028fc0a 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_c_switch.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_c_switch.il @@ -115,6 +115,6 @@ END: } -.assembly ldc_c_switch.exe {} +.assembly ldc_c_switch {} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ckfinite_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ckfinite_r4.il index 2f2f94b711e66b..987ff785fb49af 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ckfinite_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ckfinite_r4.il @@ -404,5 +404,5 @@ END: //---- EOF ------------------ } -.assembly ldc_ckfinite_r4.exe{} +.assembly ldc_ckfinite_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ckfinite_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ckfinite_r8.il index 707e75ad89cd6f..43f42b11e5e6e3 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ckfinite_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ckfinite_r8.il @@ -422,5 +422,5 @@ END: //---- EOF ------------------ } -.assembly ldc_ckfinite_r8.exe{} +.assembly ldc_ckfinite_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i4_i1.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i4_i1.il index 70eaff93e77803..984f925e4c4511 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i4_i1.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i4_i1.il @@ -1679,5 +1679,5 @@ END: -.assembly ldc_conv_ovf_i4_i1.exe{} +.assembly ldc_conv_ovf_i4_i1{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i4_i2.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i4_i2.il index fddd00064dc4e0..d8d1c2bde3d2c0 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i4_i2.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i4_i2.il @@ -1600,5 +1600,5 @@ END: -.assembly ldc_conv_ovf_i4_i2.exe{} +.assembly ldc_conv_ovf_i4_i2{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i4_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i4_u4.il index ac9ebd628d78d0..521b685e3591b2 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i4_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i4_u4.il @@ -1161,5 +1161,5 @@ END: //---- EOF ------------------ } -.assembly ldc_conv_ovf_i4_u4.exe{} +.assembly ldc_conv_ovf_i4_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i8_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i8_i4.il index 60633572b57903..296454da880e13 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i8_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i8_i4.il @@ -1639,5 +1639,5 @@ END: -.assembly ldc_conv_ovf_i8_i4.exe{} +.assembly ldc_conv_ovf_i8_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i8_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i8_u8.il index e4d27570d3da92..8cf31a078be24e 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i8_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i8_u8.il @@ -1135,5 +1135,5 @@ END: //---- EOF ------------------ } -.assembly ldc_conv_ovf_i8_u8.exe{} +.assembly ldc_conv_ovf_i8_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_r8_i.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_r8_i.il index 3b16ee175c100c..63883afdfac4ea 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_r8_i.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_r8_i.il @@ -2115,5 +2115,5 @@ END: } -.assembly ldc_conv_ovf_r8_i.exe{} +.assembly ldc_conv_ovf_r8_i{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_r8_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_r8_i4.il index 1084ff304b0540..9189ab3efd4710 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_r8_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_r8_i4.il @@ -2115,5 +2115,5 @@ END: } -.assembly ldc_conv_ovf_r8_i4.exe{} +.assembly ldc_conv_ovf_r8_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_r8_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_r8_i8.il index 78cade08735255..e16bcf5e59db3d 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_r8_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_r8_i8.il @@ -2073,5 +2073,5 @@ END: //---- EOF ------------------ } -.assembly ldc_conv_ovf_r8_i8.exe{} +.assembly ldc_conv_ovf_r8_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u4_i.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u4_i.il index edeae291984fab..141d17891aa175 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u4_i.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u4_i.il @@ -1242,5 +1242,5 @@ END: //---- EOF ------------------ } -.assembly ldc_conv_ovf_u4_i.exe{} +.assembly ldc_conv_ovf_u4_i{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u4_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u4_i4.il index 4bfdd3d7eb3b85..bb6dd2b216c846 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u4_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u4_i4.il @@ -1242,5 +1242,5 @@ END: //---- EOF ------------------ } -.assembly ldc_conv_ovf_u4_i4.exe{} +.assembly ldc_conv_ovf_u4_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u4_u1.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u4_u1.il index 58ddf8692fb508..e131abc2167c0f 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u4_u1.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u4_u1.il @@ -675,5 +675,5 @@ END: -.assembly ldc_conv_ovf_u4_u1.exe{} +.assembly ldc_conv_ovf_u4_u1{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u4_u2.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u4_u2.il index 0ff5820b430f79..beee7b396a538d 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u4_u2.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u4_u2.il @@ -673,5 +673,5 @@ END: //---- EOF ------------------ } -.assembly ldc_conv_ovf_u4_u2.exe{} +.assembly ldc_conv_ovf_u4_u2{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u8_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u8_i8.il index f3f21db2252171..067ec892a39b1e 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u8_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u8_i8.il @@ -1294,5 +1294,5 @@ END: //---- EOF ------------------ } -.assembly ldc_conv_ovf_u8_i8.exe{} +.assembly ldc_conv_ovf_u8_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u8_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u8_u4.il index b4b45f0ff07e95..681511668880c1 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u8_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_u8_u4.il @@ -826,5 +826,5 @@ END: //---- EOF ------------------ } -.assembly ldc_conv_ovf_u8_u4.exe{} +.assembly ldc_conv_ovf_u8_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_i4.il index 25c3f8e7e8e8a2..00ea4df24f2ceb 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_i4.il @@ -64,4 +64,4 @@ FAIL: ret } } -.assembly ldc_i4.exe{} +.assembly ldc_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_i8.il index 99da9a4b9ac812..4c5115be3dbb56 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_i8.il @@ -67,4 +67,4 @@ FAIL: ret } } -.assembly ldc_i8.exe{} +.assembly ldc_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_i1.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_i1.il index f29812347d7415..4e9b5bb29a1ae5 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_i1.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_i1.il @@ -2047,5 +2047,5 @@ END: -.assembly ldc_mul_ovf_i1.exe{} +.assembly ldc_mul_ovf_i1{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_i2.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_i2.il index feac23a08dc1cc..e1c4dfd524a6f8 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_i2.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_i2.il @@ -1878,5 +1878,5 @@ END: } -.assembly ldc_mul_ovf_i2.exe{} +.assembly ldc_mul_ovf_i2{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_i4.il index 010542fb8c87d8..4ceb07aeb7992e 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_i4.il @@ -1877,5 +1877,5 @@ END: //---- EOF ------------------ } -.assembly ldc_mul_ovf_i4.exe{} +.assembly ldc_mul_ovf_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_i8.il index 9f41516f800a85..260260fef2269c 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_i8.il @@ -1877,5 +1877,5 @@ END: //---- EOF ------------------ } -.assembly ldc_mul_ovf_i8.exe{} +.assembly ldc_mul_ovf_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_u1.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_u1.il index 3769be4bd60c22..62daf408248cc4 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_u1.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_u1.il @@ -1392,5 +1392,5 @@ END: } -.assembly ldc_mul_ovf_u1.exe{} +.assembly ldc_mul_ovf_u1{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_u2.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_u2.il index ef0e007f8f3a7d..8aec6f19fb1fd8 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_u2.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_u2.il @@ -1391,5 +1391,5 @@ END: //---- EOF ------------------ } -.assembly ldc_mul_ovf_u2.exe{} +.assembly ldc_mul_ovf_u2{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_u4.il index be88d0e1c3d4a2..9cb97759671154 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_u4.il @@ -1391,5 +1391,5 @@ END: //---- EOF ------------------ } -.assembly ldc_mul_ovf_u4.exe{} +.assembly ldc_mul_ovf_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_u8.il index 68f0283a131dde..754167a39abd06 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_mul_ovf_u8.il @@ -1391,5 +1391,5 @@ END: //---- EOF ------------------ } -.assembly ldc_mul_ovf_u8.exe{} +.assembly ldc_mul_ovf_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_neg_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_neg_i4.il index 92897825a6890b..99b1c4f3190b42 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_neg_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_neg_i4.il @@ -183,5 +183,5 @@ END: -.assembly ldc_neg_i4.exe{} +.assembly ldc_neg_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_neg_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_neg_i8.il index cac0b83fab3ffc..71eaee1cf39e1b 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_neg_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_neg_i8.il @@ -181,5 +181,5 @@ END: //---- EOF ------------------ } -.assembly ldc_neg_i8.exe{} +.assembly ldc_neg_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_r4.il index 535f812855c5a9..c9132d8dbf9fb8 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_r4.il @@ -60,4 +60,4 @@ FAIL: ret } } -.assembly ldc_r4.exe{} +.assembly ldc_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_r8.il index 417663e839be2c..648a0c37b91c08 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_r8.il @@ -58,4 +58,4 @@ FAIL: ret } } -.assembly ldc_r8.exe{} +.assembly ldc_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_i.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_i.il index 672391543751f7..193e6f68cdee90 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_i.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_i.il @@ -68,5 +68,5 @@ END: -.assembly ldc_ret_i.exe{} +.assembly ldc_ret_i{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_i4.il index 9beb8ab5207d33..563d07e86ee144 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_i4.il @@ -150,5 +150,5 @@ END: -.assembly ldc_ret_i4.exe{} +.assembly ldc_ret_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_i8.il index c4aa499721b942..a64961699efc21 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_i8.il @@ -148,5 +148,5 @@ END: //---- EOF ------------------ } -.assembly ldc_ret_i8.exe{} +.assembly ldc_ret_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_r4.il index 716e1fce4a4617..3eb10380067c14 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_r4.il @@ -176,5 +176,5 @@ END: //---- EOF ------------------ } -.assembly ldc_ret_r4.exe{} +.assembly ldc_ret_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_r8.il index 3548d9eb25a5b4..296d48008d6b4b 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_r8.il @@ -177,5 +177,5 @@ END: //---- EOF ------------------ } -.assembly ldc_ret_r8.exe{} +.assembly ldc_ret_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_ref.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_ref.il index 3d33f92f2b0b3a..1aa958d1593031 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_ref.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_ret_ref.il @@ -128,5 +128,5 @@ END: -.assembly ldc_ret_ref.exe{} +.assembly ldc_ret_ref{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_i.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_i.il index ccdea51bc64234..08a2a8642d092e 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_i.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_i.il @@ -59,5 +59,5 @@ END: -.assembly ldc_sub_i.exe{} +.assembly ldc_sub_i{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_i1.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_i1.il index cf031d7d481327..337ab90dbefc25 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_i1.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_i1.il @@ -2023,5 +2023,5 @@ END: //---- EOF ------------------ } -.assembly ldc_sub_ovf_i1.exe{} +.assembly ldc_sub_ovf_i1{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_i2.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_i2.il index 652fb4eeb5548a..67fa23b3cee9d2 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_i2.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_i2.il @@ -2024,5 +2024,5 @@ END: //---- EOF ------------------ } -.assembly ldc_sub_ovf_i2.exe{} +.assembly ldc_sub_ovf_i2{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_i4.il index f1fa4b0ebf07c4..038072b12285d6 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_i4.il @@ -2024,5 +2024,5 @@ END: } -.assembly ldc_sub_ovf_i4.exe{} +.assembly ldc_sub_ovf_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_i8.il index 79b7475f9bbc63..ba2e538727574e 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_i8.il @@ -2023,5 +2023,5 @@ END: //---- EOF ------------------ } -.assembly ldc_sub_ovf_i8.exe{} +.assembly ldc_sub_ovf_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_u1.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_u1.il index 6c688d6c266f02..2934fbf6877e01 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_u1.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_u1.il @@ -1501,5 +1501,5 @@ END: //---- EOF ------------------ } -.assembly ldc_sub_ovf_u1.exe{} +.assembly ldc_sub_ovf_u1{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_u2.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_u2.il index 50bed0d62b26a1..16d0f45dafd1dd 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_u2.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_u2.il @@ -1501,5 +1501,5 @@ END: //---- EOF ------------------ } -.assembly ldc_sub_ovf_u2.exe{} +.assembly ldc_sub_ovf_u2{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_u4.il index 0a7180a9d9116b..440acc70f2f279 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_u4.il @@ -1500,5 +1500,5 @@ END: //---- EOF ------------------ } -.assembly ldc_sub_ovf_u4.exe{} +.assembly ldc_sub_ovf_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_u8.il index 46a5d5709dec77..a80274e1946bd3 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_u8.il @@ -1501,5 +1501,5 @@ END: //---- EOF ------------------ } -.assembly ldc_sub_ovf_u8.exe{} +.assembly ldc_sub_ovf_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldftn.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldftn.il index aa8e2b68810aa0..95ae741603a81b 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldftn.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldftn.il @@ -45,4 +45,4 @@ FAIL: ret } } -.assembly ldftn.exe{} +.assembly 'ldftn'{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_i.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_i.il index ebbb597779ef53..e69dcec8bc267b 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_i.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_i.il @@ -79,4 +79,4 @@ FAIL: ret } } -.assembly ldind_i.exe{} +.assembly ldind_i{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_i1.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_i1.il index 696d492cf71edf..3a1eb06112ef73 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_i1.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_i1.il @@ -54,4 +54,4 @@ FAIL: ret } } -.assembly ldind_i1.exe{} +.assembly ldind_i1{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_i2.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_i2.il index 3a005c20178015..b841a8d7550268 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_i2.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_i2.il @@ -54,4 +54,4 @@ FAIL: ret } } -.assembly ldind_i2.exe{} +.assembly ldind_i2{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_i4.il index 6777e39628c547..111014fae797fe 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_i4.il @@ -60,4 +60,4 @@ FAIL: ret } } -.assembly ldind_i4.exe{} +.assembly ldind_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_i8.il index 53b649d18e122a..c982b260fe5a5c 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_i8.il @@ -74,4 +74,4 @@ FAIL: ret } } -.assembly ldind_i8.exe{} +.assembly ldind_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_r4.il index 2e353640ec2758..b07d7e0931f2c3 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_r4.il @@ -75,4 +75,4 @@ FAIL: } } -.assembly ldind_r4.exe{} +.assembly ldind_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_r8.il index 66707d04e3c9d6..925a4bcb01e1a8 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_r8.il @@ -77,4 +77,4 @@ FAIL: } } -.assembly ldind_r8.exe{} +.assembly ldind_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_ref.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_ref.il index 8049a84d09d33b..f023314e7e1d62 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_ref.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_ref.il @@ -28,4 +28,4 @@ FAIL: ret } } -.assembly ldind_ref.exe{} +.assembly ldind_ref{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_u1.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_u1.il index 46d4ace65264de..a04505b493ba1f 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_u1.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_u1.il @@ -54,4 +54,4 @@ FAIL: ret } } -.assembly ldind_u1.exe{} +.assembly ldind_u1{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_u2.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_u2.il index 4f7bda53609878..f2e06b9f2a1396 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_u2.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_u2.il @@ -55,4 +55,4 @@ FAIL: ret } } -.assembly ldind_u2.exe{} +.assembly ldind_u2{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_u4.il index ae29a238414431..3be34a3c4c9fe6 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldind_u4.il @@ -58,4 +58,4 @@ FAIL: ret } } -.assembly ldind_u4.exe{} +.assembly ldind_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_i.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_i.il index b180cb7c12ab96..fee7a4769260db 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_i.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_i.il @@ -27,4 +27,4 @@ FAIL: ret } } -.assembly ldloc_i.exe{} +.assembly ldloc_i{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_i4.il index 8af5afcd431429..cc3cf972e3a4ee 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_i4.il @@ -77,4 +77,4 @@ FAIL: ret } } -.assembly ldloc_i4.exe{} +.assembly ldloc_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_i8.il index 5aefe29570f707..682bd19e47c9b0 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_i8.il @@ -74,4 +74,4 @@ FAIL: ret } } -.assembly ldloc_i8.exe{} +.assembly ldloc_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_r4.il index 3a800c29fff13f..e5b876c47a9cb8 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_r4.il @@ -53,4 +53,4 @@ FAIL: ret } } -.assembly ldloc_r4.exe{} +.assembly ldloc_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_r8.il index d44ca9466b877e..b8e58c09eb8376 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_r8.il @@ -56,4 +56,4 @@ FAIL: ret } } -.assembly ldloc_r8.exe{} +.assembly ldloc_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_ref.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_ref.il index abc313672e08ab..e2996b13acc6de 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_ref.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldloc_ref.il @@ -27,4 +27,4 @@ FAIL: ret } } -.assembly ldloc_ref.exe{} +.assembly ldloc_ref{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldnull_i.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldnull_i.il index 7bf162f1c5a5fc..fe237b90be2bc6 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldnull_i.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldnull_i.il @@ -17,4 +17,4 @@ FAIL: ret } } -.assembly ldnull_i.exe{} +.assembly ldnull_i{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldnull_ref.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldnull_ref.il index ca4952f8538bb7..941680233920e8 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldnull_ref.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldnull_ref.il @@ -26,4 +26,4 @@ FAIL: ret } } -.assembly ldnull_ref.exe{} +.assembly ldnull_ref{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldvirtftn.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldvirtftn.il index 322e6b111775f7..9c7cd469c1fd1a 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldvirtftn.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldvirtftn.il @@ -22,4 +22,4 @@ FAIL: ret } } -.assembly ldvirtftn.exe{} +.assembly 'ldvirtftn'{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/localloc.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/localloc.il index d075e0e26171e7..a7943ef2008b08 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/localloc.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/localloc.il @@ -108,4 +108,4 @@ FAIL: } } -.assembly localloc.exe{} +.assembly 'localloc'{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_i4.il index b24522bcdb6675..143d4d4b7be76b 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_i4.il @@ -276,4 +276,4 @@ FAIL: ret } } -.assembly mul_i4.exe{} +.assembly mul_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_i8.il index 1a4ba03f4d665f..5b81f1c2cfd71f 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_i8.il @@ -276,4 +276,4 @@ FAIL: ret } } -.assembly mul_i8.exe{} +.assembly mul_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_i1.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_i1.il index beeb4b0cf39d61..8c3a4c33d82f13 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_i1.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_i1.il @@ -525,4 +525,4 @@ END: -.assembly mul_ovf_i1.exe{} +.assembly mul_ovf_i1{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_i2.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_i2.il index 3a9c52c48a0a5f..d6cab0117cda5c 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_i2.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_i2.il @@ -362,4 +362,4 @@ END: } -.assembly mul_ovf_i2.exe{} +.assembly mul_ovf_i2{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_i4.il index a9958813d97cf1..0d70d01f680b8a 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_i4.il @@ -360,4 +360,4 @@ END: } } -.assembly mul_ovf_i4.exe{} +.assembly mul_ovf_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_i8.il index e3dad8fb5714e5..0b972239bc9f53 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_i8.il @@ -360,4 +360,4 @@ END: } } -.assembly mul_ovf_i8.exe{} +.assembly mul_ovf_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_u1.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_u1.il index f2a6b6d31e4d4f..15bfd4163ae567 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_u1.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_u1.il @@ -280,4 +280,4 @@ END: } -.assembly mul_ovf_u1.exe{} +.assembly mul_ovf_u1{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_u2.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_u2.il index ebf9bdb77a9ccd..dc97608e7739c3 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_u2.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_u2.il @@ -279,4 +279,4 @@ END: } } -.assembly mul_ovf_u2.exe{} +.assembly mul_ovf_u2{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_u4.il index 300d7eb616218c..45096ba92f1470 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_u4.il @@ -278,4 +278,4 @@ END: } } -.assembly mul_ovf_u4.exe{} +.assembly mul_ovf_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_u8.il index 663b568e650550..2431c4e1663d16 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_ovf_u8.il @@ -278,4 +278,4 @@ END: } } -.assembly mul_ovf_u8.exe{} +.assembly mul_ovf_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_r4.il index 9ed1faee0671d7..76c8ef744992b4 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_r4.il @@ -589,4 +589,4 @@ FAIL: ret } } -.assembly mul_r4.exe{} +.assembly mul_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_r8.il index 93e92b6d31cd15..b03e8517308a84 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/mul_r8.il @@ -590,4 +590,4 @@ FAIL: ret } } -.assembly mul_r8.exe{} +.assembly mul_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/neg_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/neg_i4.il index e4c7940a23fadf..7764da506cf930 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/neg_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/neg_i4.il @@ -81,4 +81,4 @@ END: -.assembly neg_i4.exe{} +.assembly neg_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/neg_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/neg_i8.il index a30d70531350a2..dacfb76f54262b 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/neg_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/neg_i8.il @@ -79,4 +79,4 @@ END: } } -.assembly neg_i8.exe{} +.assembly neg_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/nop.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/nop.il index b6f9ed6a55468e..047c7f0d108659 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/nop.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/nop.il @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} -.assembly nop.exe{} +.assembly 'nop'{} .class public _nop { diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/not_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/not_u4.il index 0b567a1b5dae36..5ab5ba02124ea3 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/not_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/not_u4.il @@ -60,4 +60,4 @@ FAIL: ret } } -.assembly not_u4.exe{} +.assembly not_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/not_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/not_u8.il index 61985328ea113b..aa89c09deba757 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/not_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/not_u8.il @@ -60,4 +60,4 @@ FAIL: ret } } -.assembly not_u8.exe{} +.assembly not_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/or_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/or_u4.il index 0453cf3b4ebe7d..48ea53d24c49af 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/or_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/or_u4.il @@ -240,4 +240,4 @@ FAIL: ret } } -.assembly or_u4.exe{} +.assembly or_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/or_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/or_u8.il index 4f9ade07b0ffa7..2dff8fc39660fe 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/or_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/or_u8.il @@ -240,4 +240,4 @@ FAIL: ret } } -.assembly or_u8.exe{} +.assembly or_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/pop4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/pop4.il index 8406f3cdfdfb04..62bbe7a23c5d6a 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/pop4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/pop4.il @@ -45,4 +45,4 @@ FAIL: ret } } -.assembly pop4.exe{} +.assembly pop4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/pop8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/pop8.il index b76391f85a5e8f..a4cd34d740256b 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/pop8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/pop8.il @@ -44,4 +44,4 @@ FAIL: ret } } -.assembly pop8.exe{} +.assembly pop8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/popi.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/popi.il index 5f3a3712b80b94..25f4f2363fa59d 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/popi.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/popi.il @@ -24,4 +24,4 @@ FAIL: ret } } -.assembly popi.exe{} +.assembly popi{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/refs.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/refs.il index 9080838def7595..b1db1dca02b776 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/refs.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/refs.il @@ -60,4 +60,4 @@ FAIL: } -.assembly refs.exe{} +.assembly refs{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_i4.il index 15887c8dc5c196..2802459d30649c 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_i4.il @@ -353,4 +353,4 @@ FAIL: ret } } -.assembly rem_i4.exe{} +.assembly rem_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_i8.il index d316f64b7b7d14..37df93ea3d2c01 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_i8.il @@ -353,4 +353,4 @@ FAIL: ret } } -.assembly rem_i8.exe{} +.assembly rem_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_r4.il index 836324064975ab..7ee8254698f716 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_r4.il @@ -871,4 +871,4 @@ FAIL: } // ---------------------------------- -.assembly rem_r4.exe{} +.assembly rem_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_r8.il index be94156fb5fbfc..392658cdec9a49 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_r8.il @@ -650,4 +650,4 @@ FAIL1: } } -.assembly rem_r8.exe{} +.assembly rem_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_u4.il index af18b1f5a209c7..c7633777f3900e 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_u4.il @@ -265,4 +265,4 @@ FAIL: ret } } -.assembly rem_u4.exe{} +.assembly rem_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_u8.il index ec396dc93c58b4..57c8266e79d19b 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/rem_u8.il @@ -265,4 +265,4 @@ FAIL: ret } } -.assembly rem_u8.exe{} +.assembly rem_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret.il index b75cbc93b32573..ae3f1409bc1fbd 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret.il @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} -.assembly ret.exe{} +.assembly 'ret'{} .class public _ret { diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_i.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_i.il index ab0a4f5f8bf3b0..fde6b3650036a8 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_i.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_i.il @@ -47,4 +47,4 @@ END: -.assembly ret_i.exe{} +.assembly ret_i{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_i4.il index 827605acbe76ae..96ddcdf1e3fbed 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_i4.il @@ -79,4 +79,4 @@ END: -.assembly ret_i4.exe{} +.assembly ret_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_i8.il index 609fcfd0be6604..eb18ede48593d6 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_i8.il @@ -77,4 +77,4 @@ END: } } -.assembly ret_i8.exe{} +.assembly ret_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_r4.il index f3237d485342d9..2f30794776ac8a 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_r4.il @@ -89,4 +89,4 @@ END: } } -.assembly ret_r4.exe{} +.assembly ret_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_r8.il index 4f35ad848b49dc..a7b827167d4c3d 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_r8.il @@ -90,4 +90,4 @@ END: } } -.assembly ret_r8.exe{} +.assembly ret_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_ref.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_ref.il index 9506762afd8eed..0c92e0e491cf45 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_ref.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/ret_ref.il @@ -77,4 +77,4 @@ END: -.assembly ret_ref.exe{} +.assembly ret_ref{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shl_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shl_u4.il index f019c89cede215..ed26ae54714a12 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shl_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shl_u4.il @@ -135,4 +135,4 @@ FAIL: .try TRY_START to TRY_END catch [mscorlib]System.Exception handler HANDLER to END_HANDLER } } -.assembly shl_u4.exe{} +.assembly shl_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shl_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shl_u8.il index 59a8c50bae67f4..e6d74a7bd510d2 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shl_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shl_u8.il @@ -137,4 +137,4 @@ FAIL: .try TRY_START to TRY_END catch [mscorlib]System.Exception handler HANDLER to END_HANDLER } } -.assembly shl_u8.exe{} +.assembly shl_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shr_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shr_i4.il index 55da891fe32ea8..1ed1efbf39e9cb 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shr_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shr_i4.il @@ -220,4 +220,4 @@ FAIL: .try TRY_START to TRY_END catch [mscorlib]System.Exception handler HANDLER to END_HANDLER } } -.assembly shr_i4.exe{} +.assembly shr_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shr_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shr_i8.il index 08ff518143463a..b8b7aa3dfe1bdf 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shr_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shr_i8.il @@ -234,4 +234,4 @@ FAIL: .try TRY_START to TRY_END catch [mscorlib]System.Exception handler HANDLER to END_HANDLER } } -.assembly shr_i8.exe{} +.assembly shr_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shr_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shr_u4.il index 6a314a150f9419..569ee4efe45b0a 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shr_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shr_u4.il @@ -134,4 +134,4 @@ FAIL: .try TRY_START to TRY_END catch [mscorlib]System.Exception handler HANDLER to END_HANDLER } } -.assembly shr_u4.exe{} +.assembly shr_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shr_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shr_u8.il index 23ad9a36d6d188..dbf82c1e9e6171 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shr_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/shr_u8.il @@ -135,4 +135,4 @@ FAIL: .try TRY_START to TRY_END catch [mscorlib]System.Exception handler HANDLER to END_HANDLER } } -.assembly shr_u8.exe{} +.assembly shr_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sizeof.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sizeof.il index 88149707b11e1a..15995697093af0 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sizeof.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sizeof.il @@ -53,4 +53,4 @@ FAIL: ret } } -.assembly sizeof.exe{} +.assembly 'sizeof'{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_i.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_i.il index 2dfd51f020c8d3..4f31ef9b1933f8 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_i.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_i.il @@ -47,4 +47,4 @@ FAIL: ret } } -.assembly starg_i.exe{} +.assembly starg_i{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_i4.il index b3fd11cc15328e..98041bb8d60d4d 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_i4.il @@ -63,4 +63,4 @@ FAIL: ret } } -.assembly starg_i4.exe{} +.assembly starg_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_i8.il index f6c9a56532da90..48431ae82f3e5c 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_i8.il @@ -63,4 +63,4 @@ FAIL: ret } } -.assembly starg_i8.exe{} +.assembly starg_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_r4.il index 3a16738e50094a..1a38fcdb21bcb5 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_r4.il @@ -78,4 +78,4 @@ FAIL: ret } } -.assembly starg_r4.exe{} +.assembly starg_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_r8.il index 03489d548b5b04..1342641e5caf30 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_r8.il @@ -80,4 +80,4 @@ FAIL: ret } } -.assembly starg_r8.exe{} +.assembly starg_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_ref.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_ref.il index 5b7d83d54c4e4f..51f078c9d3cc8f 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_ref.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/starg_ref.il @@ -29,4 +29,4 @@ FAIL: ret } } -.assembly starg_ref.exe{} +.assembly starg_ref{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_i1.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_i1.il index 0eaf53cda3b87f..6c847af30469ce 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_i1.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_i1.il @@ -45,4 +45,4 @@ FAIL: ret } } -.assembly stind_i1.exe{} +.assembly stind_i1{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_i2.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_i2.il index 2c3d84bf53ed3f..a2443c1fb2c591 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_i2.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_i2.il @@ -46,4 +46,4 @@ FAIL: ret } } -.assembly stind_i2.exe{} +.assembly stind_i2{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_i4.il index e69cfaf373b2c1..5b21cbaa673fb4 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_i4.il @@ -56,4 +56,4 @@ FAIL: ret } } -.assembly stind_i4.exe{} +.assembly stind_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_i8.il index 11e611c91bb7ec..a13f61b10023a6 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_i8.il @@ -74,4 +74,4 @@ FAIL: ret } } -.assembly stind_i8.exe{} +.assembly stind_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_r8.il index 8571a521c22290..5b270b16985d8f 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_r8.il @@ -79,4 +79,4 @@ FAIL: } } -.assembly stind_r8.exe{} +.assembly stind_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_ref.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_ref.il index 8ebe21b9274fc5..64eb63f4f092db 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_ref.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stind_ref.il @@ -28,4 +28,4 @@ FAIL: } } -.assembly stind_ref.exe{} +.assembly stind_ref{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_i.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_i.il index 64069de5cd8fe9..0bd5e8866ee864 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_i.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_i.il @@ -29,4 +29,4 @@ FAIL: ret } } -.assembly stloc_i.exe{} +.assembly stloc_i{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_i4.il index 418457708445ce..fec52c1ad2f2ea 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_i4.il @@ -78,4 +78,4 @@ FAIL: ret } } -.assembly stloc_i4.exe{} +.assembly stloc_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_i8.il index bccea762badbbb..0736b87a9ca9a7 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_i8.il @@ -77,4 +77,4 @@ FAIL: ret } } -.assembly stloc_i8.exe{} +.assembly stloc_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_r4.il index a28f03125e78fd..f13b291298af6a 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_r4.il @@ -57,4 +57,4 @@ FAIL: ret } } -.assembly stloc_r4.exe{} +.assembly stloc_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_r8.il index 033ea8bddbc087..02f982b2ba327a 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_r8.il @@ -59,4 +59,4 @@ FAIL: ret } } -.assembly stloc_r8.exe{} +.assembly stloc_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_ref.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_ref.il index d9c31b98c3d596..9cd5d4ab3503c3 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_ref.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/stloc_ref.il @@ -29,4 +29,4 @@ FAIL: ret } } -.assembly stloc_ref.exe{} +.assembly stloc_ref{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_i.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_i.il index d105ff88ef72ed..d6118efa3ce0ed 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_i.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_i.il @@ -39,4 +39,4 @@ END: -.assembly sub_i.exe{} +.assembly sub_i{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_i4.il index 4d428004ba8858..75be517144f61c 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_i4.il @@ -322,4 +322,4 @@ FAIL: ret } } -.assembly sub_i4.exe{} +.assembly sub_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_i8.il index dfe5bac5f2d468..13c0c8799feda0 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_i8.il @@ -323,4 +323,4 @@ FAIL: ret } } -.assembly sub_i8.exe{} +.assembly sub_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_i1.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_i1.il index 1947b5db4c9855..293f31797eee48 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_i1.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_i1.il @@ -315,4 +315,4 @@ END: } } -.assembly sub_ovf_i1.exe{} +.assembly sub_ovf_i1{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_i2.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_i2.il index 13dee7e3834988..d7f922d35072f2 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_i2.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_i2.il @@ -316,4 +316,4 @@ END: } } -.assembly sub_ovf_i2.exe{} +.assembly sub_ovf_i2{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_i4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_i4.il index c0d6e48fb0ef61..bbd3688703b151 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_i4.il @@ -315,4 +315,4 @@ END: } -.assembly sub_ovf_i4.exe{} +.assembly sub_ovf_i4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_i8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_i8.il index ac12317979ecc1..fe903619024359 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_i8.il @@ -314,4 +314,4 @@ END: } } -.assembly sub_ovf_i8.exe{} +.assembly sub_ovf_i8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_u1.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_u1.il index ad0eeb22bc4c10..a4fff793655f4c 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_u1.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_u1.il @@ -249,4 +249,4 @@ END: } } -.assembly sub_ovf_u1.exe{} +.assembly sub_ovf_u1{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_u2.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_u2.il index 1cb2960e2cbe47..26e59ec78ac5fb 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_u2.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_u2.il @@ -249,4 +249,4 @@ END: } } -.assembly sub_ovf_u2.exe{} +.assembly sub_ovf_u2{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_u4.il index 3aa1e37042a8c7..51dfbd2acc5247 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_u4.il @@ -247,4 +247,4 @@ END: } } -.assembly sub_ovf_u4.exe{} +.assembly sub_ovf_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_u8.il index 18baf018bb0020..f1d324366e97f7 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_ovf_u8.il @@ -248,4 +248,4 @@ END: } } -.assembly sub_ovf_u8.exe{} +.assembly sub_ovf_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_r4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_r4.il index d1b4dfcc0b4688..29f60ded351c1c 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_r4.il @@ -583,4 +583,4 @@ END: ret } } -.assembly sub_r4.exe{} +.assembly sub_r4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_r8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_r8.il index 4d1c2fd55afab7..c98fd829559c44 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/sub_r8.il @@ -584,4 +584,4 @@ END: ret } } -.assembly sub_r8.exe{} +.assembly sub_r8{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/switch.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/switch.il index 82123558a377ac..729fb53c18a720 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/switch.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/switch.il @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} -.assembly switch.exe{} +.assembly 'switch'{} .class public _switch { diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/xor_u4.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/xor_u4.il index 62200ac59dd2f5..670507927e306c 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/xor_u4.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/xor_u4.il @@ -240,4 +240,4 @@ FAIL: ret } } -.assembly xor_u4.exe{} +.assembly xor_u4{} diff --git a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/xor_u8.il b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/xor_u8.il index 5630ab5a6a9450..6c5a250cd783e2 100644 --- a/src/tests/JIT/IL_Conformance/Old/Conformance_Base/xor_u8.il +++ b/src/tests/JIT/IL_Conformance/Old/Conformance_Base/xor_u8.il @@ -240,4 +240,4 @@ FAIL: ret } } -.assembly xor_u8.exe{} +.assembly xor_u8{} diff --git a/src/tests/JIT/IL_Conformance/Old/directed/AutoInit.il b/src/tests/JIT/IL_Conformance/Old/directed/AutoInit.il index a60181e284e638..609fb1276213fa 100644 --- a/src/tests/JIT/IL_Conformance/Old/directed/AutoInit.il +++ b/src/tests/JIT/IL_Conformance/Old/directed/AutoInit.il @@ -3,11 +3,21 @@ .assembly extern legacy library mscorlib {} -.assembly autoinit.exe{} +.assembly AutoInit {} +.assembly extern xunit.core +{ + .publickeytoken = ( + 8d 05 b1 bb 7a 6f db 6c + ) + .ver 2:4:2:0 +} .class public auto_init { -.method public static int32 main(class [mscorlib]System.String[]) { +.method public static int32 main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .zeroinit .entrypoint .locals (int32,int32,int32,int32,int32,int32,int32,int32,int32,int32,int32,int32,int32,int32,int32,int32) diff --git a/src/tests/JIT/IL_Conformance/Old/directed/heap_ovf.il b/src/tests/JIT/IL_Conformance/Old/directed/heap_ovf.il index ae62636387523c..0391dc0d0c275c 100644 --- a/src/tests/JIT/IL_Conformance/Old/directed/heap_ovf.il +++ b/src/tests/JIT/IL_Conformance/Old/directed/heap_ovf.il @@ -10,7 +10,7 @@ } .assembly extern legacy library mscorlib {} -.assembly heap_ovf.exe{ +.assembly heap_ovf{ } .class public heap_ovf { diff --git a/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_i1.il b/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_i1.il index d62c6e5065e8de..ff8fcdd32e944b 100644 --- a/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_i1.il +++ b/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_i1.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldarg_s_i1.exe {} +.assembly ldarg_s_i1 {} .class ldarg_s_i1 { .method public static int32 test_int8() diff --git a/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_i2.il b/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_i2.il index 5c2c92df65b45d..1b1436d1e69a11 100644 --- a/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_i2.il +++ b/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_i2.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldarg_s_i2.exe {} +.assembly ldarg_s_i2 {} .class ldarg_s_i2 { .method public static int32 test_int16() diff --git a/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_i4.il b/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_i4.il index ee572ce509ee74..66766049892972 100644 --- a/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_i4.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldarg_s_i4.exe {} +.assembly ldarg_s_i4 {} .class ldarg_s_i4 { .method public static int32 test_int32() diff --git a/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_i8.il b/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_i8.il index fb1c781be9152e..58e99e0f82838f 100644 --- a/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_i8.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldarg_s_i8.exe {} +.assembly ldarg_s_i8 {} .class ldarg_s_i8 { .method public static int32 test_int64() diff --git a/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_r4.il b/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_r4.il index 7d850362e98b27..4d690e74de7bf4 100644 --- a/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_r4.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldarg_s_r4.exe {} +.assembly ldarg_s_r4 {} .class ldarg_s_r4 { .method public static int32 test_float32() diff --git a/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_r8.il b/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_r8.il index a4e652081c712f..fa4f50078193ed 100644 --- a/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/directed/ldarg_s_r8.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldarg_s_r8.exe {} +.assembly ldarg_s_r8 {} .class ldarg_s_r8 { .method public static int32 test_float64() diff --git a/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_i1.il b/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_i1.il index bd820a99bd33fa..cc5072321c686a 100644 --- a/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_i1.il +++ b/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_i1.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldloc_s_i1.exe {} +.assembly ldloc_s_i1 {} .class ldloc_s_i1 { .method public static int32 test_int8() diff --git a/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_i2.il b/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_i2.il index 69c7821c8a3824..bdcfbc6e06c25b 100644 --- a/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_i2.il +++ b/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_i2.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldloc_s_i2.exe {} +.assembly ldloc_s_i2 {} .class ldloc_s_i2 { .method public static int32 test_int16() diff --git a/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_i4.il b/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_i4.il index c9f86e787e7e21..ea5a23a6530be9 100644 --- a/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_i4.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldloc_s_i4.exe {} +.assembly ldloc_s_i4 {} .class ldloc_s_i4 { .method public static int32 test_int32() diff --git a/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_i8.il b/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_i8.il index fde6811d3511b6..4ddba093ed934d 100644 --- a/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_i8.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldloc_s_i8.exe {} +.assembly ldloc_s_i8 {} .class ldloc_s_i8 { .method public static int32 test_int64() diff --git a/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_r4.il b/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_r4.il index feacbd7ac17141..35907b87250ee1 100644 --- a/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_r4.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldloc_s_r4.exe {} +.assembly ldloc_s_r4 {} .class ldloc_s_r4 { .method public static int32 test_float32() diff --git a/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_r8.il b/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_r8.il index 95a5a73f182476..2e8867fb586d2d 100644 --- a/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/directed/ldloc_s_r8.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldloc_s_r8.exe {} +.assembly ldloc_s_r8 {} .class ldloc_s_r8 { .method public static int32 test_float64() diff --git a/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_i1.il b/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_i1.il index eccdab79cac402..6cfbb3e99f4ee0 100644 --- a/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_i1.il +++ b/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_i1.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldloca_s_i1.exe {} +.assembly ldloca_s_i1 {} .class ldloca_s_i1 { .method public static int32 test_int8() diff --git a/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_i2.il b/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_i2.il index dffdd535230795..8f6676b2fd079a 100644 --- a/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_i2.il +++ b/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_i2.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldloca_s_i2.exe {} +.assembly ldloca_s_i2 {} .class ldloca_s_i2 { .method public static int32 test_int16() diff --git a/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_i4.il b/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_i4.il index 2d008863285a89..b0c81cc7253a4b 100644 --- a/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_i4.il +++ b/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_i4.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldloca_s_i4.exe {} +.assembly ldloca_s_i4 {} .class ldloca_s_i4 { .method public static int32 test_int32() diff --git a/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_i8.il b/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_i8.il index 8bb32c75015b84..21a27bf718f89f 100644 --- a/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_i8.il +++ b/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_i8.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldloca_s_i8.exe {} +.assembly ldloca_s_i8 {} .class ldloca_s_i8 { .method public static int32 test_int64() diff --git a/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_r4.il b/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_r4.il index e5809536dbe9da..a2986935dc6550 100644 --- a/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_r4.il +++ b/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_r4.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldloca_s_r4.exe {} +.assembly ldloca_s_r4 {} .class ldloca_s_r4 { .method public static int32 test_float32() diff --git a/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_r8.il b/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_r8.il index 10d3728a2812d2..21c4545c60f88a 100644 --- a/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_r8.il +++ b/src/tests/JIT/IL_Conformance/Old/directed/ldloca_s_r8.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldloca_s_r8.exe {} +.assembly ldloca_s_r8 {} .class ldloca_s_r8 { .method public static int32 test_float64() diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/Box_Unbox.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/Box_Unbox.il index 2dc79576581fb7..7ba1052f14af63 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/Box_Unbox.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/Box_Unbox.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly box_unbox.exe{} +.assembly box_unbox{} .class public value sealed valClass { .field public int32 Field1 diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/array_tests.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/array_tests.il index c3121b0bb18197..d55defad6e96e0 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/array_tests.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/array_tests.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly array_tests.exe{} +.assembly array_tests{} .class public value sealed valClass { .field public int32 Field diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/callintf.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/callintf.il index 0ce1ba1ca098fd..2e446a6aa69633 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/callintf.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/callintf.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly callintf.exe{} +.assembly callintf{} diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/callnonvirt.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/callnonvirt.il index c367e23ae86715..b2ba284c4b327d 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/callnonvirt.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/callnonvirt.il @@ -4,7 +4,7 @@ .assembly extern legacy library mscorlib {} -.assembly callnonvirt.exe{} +.assembly callnonvirt{} .class public TestClass { diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/callstatic.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/callstatic.il index bd6ec1b36ac615..33e972f0f9b689 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/callstatic.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/callstatic.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly callstatic.exe{} +.assembly callstatic{} .class public TestStatic { diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/callsuper.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/callsuper.il index 3412a9cb2a67c9..66bf02e3bc18e5 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/callsuper.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/callsuper.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly callsuper.exe{} +.assembly callsuper{} .class public Super { diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/callvirt.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/callvirt.il index 2570f18c4b5d3c..8629c9b4e9ea84 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/callvirt.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/callvirt.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly callvirt.exe{} +.assembly 'callvirt'{} .class public TestClass { diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/castclass.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/castclass.il index 89e57d94893a04..3df2fb2c4420a9 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/castclass.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/castclass.il @@ -4,7 +4,7 @@ .assembly extern legacy library mscorlib {} -.assembly castclass.exe{} +.assembly 'castclass'{} .class public Super { diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/cpobj.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/cpobj.il index 7487b5bf294d45..17daff7de7d865 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/cpobj.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/cpobj.il @@ -9,7 +9,7 @@ } .assembly extern legacy library mscorlib {} -.assembly cpobj.exe{} +.assembly 'cpobj'{} .class public _cpobj { diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/field_tests.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/field_tests.il index 6089a3402423a7..ada1346d641ea1 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/field_tests.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/field_tests.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly field_tests.exe{} +.assembly field_tests{} .class public field_tests { diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/fielda_tests.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/fielda_tests.il index dd83dbeecab22a..9bdcb85ddf13ab 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/fielda_tests.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/fielda_tests.il @@ -4,7 +4,7 @@ .assembly extern legacy library mscorlib {} -.assembly fielda_tests.exe{} +.assembly fielda_tests{} .class public field_tests { diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/initobj.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/initobj.il index 2d230a5d74f645..999ecc2bbdcb2a 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/initobj.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/initobj.il @@ -4,7 +4,7 @@ .assembly extern legacy library mscorlib {} -.assembly initobj.exe{ +.assembly 'initobj'{ } .class public value sealed valClass{ diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/isinst.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/isinst.il index 7315341821eed8..a9734e9530cde3 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/isinst.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/isinst.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly isinst.exe{} +.assembly 'isinst'{} .class public Super { diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/ldlen.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/ldlen.il index 786d8703655fb2..d07c7a6a5c3d05 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/ldlen.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/ldlen.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldlen.exe{} +.assembly 'ldlen'{} .class public _ldlen { diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/ldobj.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/ldobj.il index 359f8bc3cb68ca..a86c1b590dd272 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/ldobj.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/ldobj.il @@ -9,7 +9,7 @@ } .assembly extern legacy library mscorlib {} -.assembly ldobj.exe{ +.assembly 'ldobj'{ } .class public _ldobj { diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/ldstr.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/ldstr.il index 54e38a13bd2188..7f29b86a133b78 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/ldstr.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/ldstr.il @@ -9,7 +9,7 @@ } .assembly extern legacy library mscorlib {} -.assembly ldstr.exe{} +.assembly 'ldstr'{} .class public _ldstr { diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/ldtoken.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/ldtoken.il index 469ad6e91282d3..37f451d90e7fae 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/ldtoken.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/ldtoken.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldtoken.exe{} +.assembly 'ldtoken'{} diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/ldvirtftn.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/ldvirtftn.il index 60935028b20b89..edab503aa02ed5 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/ldvirtftn.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/ldvirtftn.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly ldvirtftn.exe{ +.assembly 'ldvirtftn'{ } .method public static int32 main(class System.String[]) { diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/localloc.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/localloc.il index c1604aecb7016e..be0c6e533f6de9 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/localloc.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/localloc.il @@ -9,7 +9,7 @@ } .assembly extern legacy library mscorlib {} -.assembly localloc.exe{ +.assembly 'localloc'{ } .class public _localloc { diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/newobj.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/newobj.il index b726c360a2c654..1183c2791ea70f 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/newobj.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/newobj.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly newobj.exe{} +.assembly 'newobj'{} .class public Test { diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/seh_tests.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/seh_tests.il index 100bcb5a8f6c14..ce44b4a4983c5d 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/seh_tests.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/seh_tests.il @@ -9,7 +9,7 @@ } .assembly extern legacy library mscorlib {} -.assembly seh_tests.exe{} +.assembly seh_tests{} .class public seh { diff --git a/src/tests/JIT/IL_Conformance/Old/objectmodel/throw.il b/src/tests/JIT/IL_Conformance/Old/objectmodel/throw.il index f1ddcebf6a6994..bcad383359716f 100644 --- a/src/tests/JIT/IL_Conformance/Old/objectmodel/throw.il +++ b/src/tests/JIT/IL_Conformance/Old/objectmodel/throw.il @@ -3,7 +3,7 @@ .assembly extern legacy library mscorlib {} -.assembly throw.exe{} +.assembly 'throw'{} .class public _throw { diff --git a/src/tests/JIT/Intrinsics/CreateSpan_il.il b/src/tests/JIT/Intrinsics/CreateSpan_il.il new file mode 100644 index 00000000000000..61421a584392c7 --- /dev/null +++ b/src/tests/JIT/Intrinsics/CreateSpan_il.il @@ -0,0 +1,117 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// + +// This test covers creation and use of a ReadOnlySpan which points at constant data +// using the CreateSpan api. + +// Metadata version: v4.0.30319 +.assembly extern System.Runtime +{ + .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: + .ver 7:0:0:0 +} +.assembly CreateSpan_ro +{ + .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. + + // --- The following custom attribute is added automatically, do not uncomment ------- + // .custom instance void [System.Runtime]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 02 00 00 00 00 00 ) + + .permissionset reqmin + = {[System.Runtime]System.Security.Permissions.SecurityPermissionAttribute = {property bool 'SkipVerification' = bool(true)}} + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module CreateSpan_ro.dll +// MVID: {E6E30CA2-CC29-4014-B26A-79C94A13BF58} +.custom instance void [System.Runtime]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) +.imagebase 0x00400000 +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 // WINDOWS_CUI +.corflags 0x00000001 // ILONLY +// Image base: 0x000001ADF9680000 + + +// =============== CLASS MEMBERS DECLARATION =================== + +.class private auto ansi beforefieldinit CreateSpanTest + extends [System.Runtime]System.Object +{ + .method private hidebysig static int32 + Main() cil managed + { + .entrypoint + // Code size 47 (0x2f) + .maxstack 2 + .locals init (int32 V_0, + valuetype [System.Runtime]System.ReadOnlySpan`1 V_1, + int32 V_2, + int32 V_3) + IL_0000: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=16' ''::'8A4C0D07C79596FFAE679AE1790CCA491B4E0D51EE259857EC635CA222073650' + IL_0005: call valuetype [System.Runtime]System.ReadOnlySpan`1 [System.Runtime]System.Runtime.CompilerServices.RuntimeHelpers::CreateSpan(valuetype [System.Runtime]System.RuntimeFieldHandle) + IL_000a: ldc.i4.0 + IL_000b: stloc.0 + IL_000c: stloc.1 + IL_000d: ldc.i4.0 + IL_000e: stloc.2 + IL_000f: br.s IL_0023 + + IL_0011: ldloca.s V_1 + IL_0013: ldloc.2 + IL_0014: call instance !0& modreq([System.Runtime]System.Runtime.InteropServices.InAttribute) valuetype [System.Runtime]System.ReadOnlySpan`1::get_Item(int32) + IL_0019: ldind.i4 + IL_001a: stloc.3 + IL_001b: ldloc.0 + IL_001c: ldloc.3 + IL_001d: add + IL_001e: stloc.0 + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.2 + IL_0024: ldloca.s V_1 + IL_0026: call instance int32 valuetype [System.Runtime]System.ReadOnlySpan`1::get_Length() + IL_002b: blt.s IL_0011 + + IL_002d: ldloc.0 + IL_002e: ret + } // end of method CreateSpanTest::Main + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [System.Runtime]System.Object::.ctor() + IL_0006: ret + } // end of method CreateSpanTest::.ctor + +} // end of class CreateSpanTest + +.class private auto ansi sealed '' + extends [System.Runtime]System.Object +{ + .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .class explicit ansi sealed nested private '__StaticArrayInitTypeSize=16' + extends [System.Runtime]System.ValueType + { + .pack 1 + .size 16 + } // end of class '__StaticArrayInitTypeSize=16' + + .field static assembly initonly valuetype ''/'__StaticArrayInitTypeSize=16' '8A4C0D07C79596FFAE679AE1790CCA491B4E0D51EE259857EC635CA222073650' at I_000026F8 +} // end of class '' + + +// ============================================================= + +.data cil I_000026F8 = bytearray ( + 19 00 00 00 0F 00 00 00 23 00 00 00 19 00 00 00) // ........#....... +// *********** DISASSEMBLY COMPLETE *********************** +// WARNING: Created Win32 resource file CreateSpan_il.res diff --git a/src/tests/JIT/Intrinsics/CreateSpan_il.ilproj b/src/tests/JIT/Intrinsics/CreateSpan_il.ilproj new file mode 100644 index 00000000000000..403e74dc751563 --- /dev/null +++ b/src/tests/JIT/Intrinsics/CreateSpan_il.ilproj @@ -0,0 +1,12 @@ + + + Exe + + + PdbOnly + True + + + + + diff --git a/src/tests/JIT/Intrinsics/TypeIntrinsics_il.il b/src/tests/JIT/Intrinsics/TypeIntrinsics_il.il index a55a9b84d67e63..5d467fdf116c08 100644 --- a/src/tests/JIT/Intrinsics/TypeIntrinsics_il.il +++ b/src/tests/JIT/Intrinsics/TypeIntrinsics_il.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { auto } +.assembly extern xunit.core {} .assembly extern System.Runtime { auto } .assembly TypeIntrinsicsTests { } @@ -11,6 +12,9 @@ { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 // it's not currently possible to produce `ldtoken [type]&` in C# diff --git a/src/tests/JIT/Methodical/Arrays/huge/huge_b.il b/src/tests/JIT/Methodical/Arrays/huge/huge_b.il index cc67c12a518eab..db81e19c9ace58 100644 --- a/src/tests/JIT/Methodical/Arrays/huge/huge_b.il +++ b/src/tests/JIT/Methodical/Arrays/huge/huge_b.il @@ -26,6 +26,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -35,6 +36,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 70 .locals (bool[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,] matrix, diff --git a/src/tests/JIT/Methodical/Arrays/huge/huge_i4.il b/src/tests/JIT/Methodical/Arrays/huge/huge_i4.il index 7cd2f32080f214..dba6e8bc32cfe1 100644 --- a/src/tests/JIT/Methodical/Arrays/huge/huge_i4.il +++ b/src/tests/JIT/Methodical/Arrays/huge/huge_i4.il @@ -26,6 +26,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -35,6 +36,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 70 .locals (int32[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,] matrix, diff --git a/src/tests/JIT/Methodical/Arrays/huge/huge_objref.il b/src/tests/JIT/Methodical/Arrays/huge/huge_objref.il index ea7d4224423c2b..2e35a08a50ad1f 100644 --- a/src/tests/JIT/Methodical/Arrays/huge/huge_objref.il +++ b/src/tests/JIT/Methodical/Arrays/huge/huge_objref.il @@ -18,6 +18,7 @@ .assembly 'test' { } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -48,6 +49,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 70 .locals (class JitTest.TestClass[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,] matrix, diff --git a/src/tests/JIT/Methodical/Arrays/huge/huge_r4.il b/src/tests/JIT/Methodical/Arrays/huge/huge_r4.il index f25e5af20fc6d5..c48622b05a92e1 100644 --- a/src/tests/JIT/Methodical/Arrays/huge/huge_r4.il +++ b/src/tests/JIT/Methodical/Arrays/huge/huge_r4.il @@ -26,6 +26,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -35,6 +36,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 70 .locals (float32[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,] matrix, diff --git a/src/tests/JIT/Methodical/Arrays/huge/huge_r8.il b/src/tests/JIT/Methodical/Arrays/huge/huge_r8.il index b2bbeb592a19a7..83eae794fbd1f0 100644 --- a/src/tests/JIT/Methodical/Arrays/huge/huge_r8.il +++ b/src/tests/JIT/Methodical/Arrays/huge/huge_r8.il @@ -26,6 +26,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -35,6 +36,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 70 .locals (float64[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,] matrix, diff --git a/src/tests/JIT/Methodical/Arrays/huge/huge_struct.il b/src/tests/JIT/Methodical/Arrays/huge/huge_struct.il index 6fdbe14f7872e6..8fb1ba9942ec39 100644 --- a/src/tests/JIT/Methodical/Arrays/huge/huge_struct.il +++ b/src/tests/JIT/Methodical/Arrays/huge/huge_struct.il @@ -26,6 +26,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -43,6 +44,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 70 .locals (value class JitTest.TestStruct[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,] matrix, diff --git a/src/tests/JIT/Methodical/Arrays/huge/huge_u8.il b/src/tests/JIT/Methodical/Arrays/huge/huge_u8.il index dff07510b3c12a..d8e0d98d4453e2 100644 --- a/src/tests/JIT/Methodical/Arrays/huge/huge_u8.il +++ b/src/tests/JIT/Methodical/Arrays/huge/huge_u8.il @@ -26,6 +26,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -35,6 +36,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 70 .locals (unsigned int64[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,] matrix, diff --git a/src/tests/JIT/Methodical/Arrays/huge_struct.il b/src/tests/JIT/Methodical/Arrays/huge_struct.il index bee72a73f7d628..7fa2cab056b309 100644 --- a/src/tests/JIT/Methodical/Arrays/huge_struct.il +++ b/src/tests/JIT/Methodical/Arrays/huge_struct.il @@ -20,6 +20,7 @@ } +.assembly extern xunit.core {} .module 'huge_strcut.exe' // MVID: {23E3D49B-6CFD-4DA0-8C9D-A611CE0BA103} .namespace JitTest @@ -38,6 +39,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 38 (0x26) .maxstack 70 diff --git a/src/tests/JIT/Methodical/Arrays/lcs/lcs_ldlen.il b/src/tests/JIT/Methodical/Arrays/lcs/lcs_ldlen.il index ee66c462ced8d4..1eb997d87f3b45 100644 --- a/src/tests/JIT/Methodical/Arrays/lcs/lcs_ldlen.il +++ b/src/tests/JIT/Methodical/Arrays/lcs/lcs_ldlen.il @@ -21,6 +21,7 @@ } +.assembly extern xunit.core {} .module 'lcs.exe' // MVID: {52ED7FCA-78F1-42F6-8DE5-7388302AFAA6} .namespace JitTest @@ -603,6 +604,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 227 (0xe3) .maxstack 5 diff --git a/src/tests/JIT/Methodical/Arrays/misc/address.il b/src/tests/JIT/Methodical/Arrays/misc/address.il index b4bb950641bfe4..f61177f5180591 100644 --- a/src/tests/JIT/Methodical/Arrays/misc/address.il +++ b/src/tests/JIT/Methodical/Arrays/misc/address.il @@ -19,6 +19,7 @@ .assembly 'test' { } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -102,6 +103,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32[10000...10005] V_0, diff --git a/src/tests/JIT/Methodical/Arrays/misc/arrres.il b/src/tests/JIT/Methodical/Arrays/misc/arrres.il index 2185460915ef9b..f92613763b9f28 100644 --- a/src/tests/JIT/Methodical/Arrays/misc/arrres.il +++ b/src/tests/JIT/Methodical/Arrays/misc/arrres.il @@ -19,6 +19,7 @@ .assembly 'arrres'// as "arrres" { } +.assembly extern xunit.core {} .module 'arrres.exe' .namespace GCTest { @@ -151,6 +152,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32 V_0, diff --git a/src/tests/JIT/Methodical/Arrays/misc/gcarr.il b/src/tests/JIT/Methodical/Arrays/misc/gcarr.il index c0773d119cc7ed..f4636f2ccb39ee 100644 --- a/src/tests/JIT/Methodical/Arrays/misc/gcarr.il +++ b/src/tests/JIT/Methodical/Arrays/misc/gcarr.il @@ -19,6 +19,7 @@ .assembly 'gcarr'// as "gcarr" { } +.assembly extern xunit.core {} .module 'gcarr.exe' .namespace GCTest { @@ -43,6 +44,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals (class GCTest.Test[-10...10] V_0, diff --git a/src/tests/JIT/Methodical/Arrays/misc/initializearray.il b/src/tests/JIT/Methodical/Arrays/misc/initializearray.il index 256c2bece9aea8..2f01b499490648 100644 --- a/src/tests/JIT/Methodical/Arrays/misc/initializearray.il +++ b/src/tests/JIT/Methodical/Arrays/misc/initializearray.il @@ -11,6 +11,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module initializearray.exe .imagebase 0x00400000 .file alignment 0x00000200 @@ -22,6 +23,9 @@ { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 diff --git a/src/tests/JIT/Methodical/Arrays/misc/initializearray_enum.il b/src/tests/JIT/Methodical/Arrays/misc/initializearray_enum.il index 2ffe3950597cb2..cc44e1fbd0c47a 100644 --- a/src/tests/JIT/Methodical/Arrays/misc/initializearray_enum.il +++ b/src/tests/JIT/Methodical/Arrays/misc/initializearray_enum.il @@ -75,6 +75,7 @@ class My { .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module initializearray_enum.exe // MVID: {88A311DA-3D49-42AC-8FA7-6DB1266177BC} .imagebase 0x00400000 @@ -130,6 +131,9 @@ class My { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 47 (0x2f) .maxstack 8 diff --git a/src/tests/JIT/Methodical/Arrays/misc/ldelem_get.il b/src/tests/JIT/Methodical/Arrays/misc/ldelem_get.il index 4e7de7a19482db..6e524525d680f1 100644 --- a/src/tests/JIT/Methodical/Arrays/misc/ldelem_get.il +++ b/src/tests/JIT/Methodical/Arrays/misc/ldelem_get.il @@ -28,6 +28,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -96,6 +97,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (float64[10000...10005] V_0, diff --git a/src/tests/JIT/Methodical/Arrays/misc/length0.il b/src/tests/JIT/Methodical/Arrays/misc/length0.il index b29f0aac4466bd..261dbf113b8f38 100644 --- a/src/tests/JIT/Methodical/Arrays/misc/length0.il +++ b/src/tests/JIT/Methodical/Arrays/misc/length0.il @@ -27,6 +27,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -95,6 +96,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32[0...] V_0, int32 V_1, int32 V_2) diff --git a/src/tests/JIT/Methodical/Arrays/misc/lengthm2.il b/src/tests/JIT/Methodical/Arrays/misc/lengthm2.il index db84556f8e9b2d..ce5398798ed6c7 100644 --- a/src/tests/JIT/Methodical/Arrays/misc/lengthm2.il +++ b/src/tests/JIT/Methodical/Arrays/misc/lengthm2.il @@ -21,6 +21,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' // MVID: {23E3D49B-6CFD-4DA0-8C9D-A611CE0BA103} .namespace JitTest @@ -31,6 +32,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 38 (0x26) .maxstack 4 diff --git a/src/tests/JIT/Methodical/Arrays/misc/selfref.il b/src/tests/JIT/Methodical/Arrays/misc/selfref.il index 72fa052c2f2478..a720ba9de5492e 100644 --- a/src/tests/JIT/Methodical/Arrays/misc/selfref.il +++ b/src/tests/JIT/Methodical/Arrays/misc/selfref.il @@ -21,6 +21,7 @@ } +.assembly extern xunit.core {} .module 'selfref.exe' // MVID: {57800D71-6F51-4ACF-BC86-8F3D2FBAC8E1} .namespace GCTest @@ -31,6 +32,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 157 (0x9d) .maxstack 3 diff --git a/src/tests/JIT/Methodical/Arrays/range/float64_range1.il b/src/tests/JIT/Methodical/Arrays/range/float64_range1.il index a8472942b8b2f2..592e259cd39eda 100644 --- a/src/tests/JIT/Methodical/Arrays/range/float64_range1.il +++ b/src/tests/JIT/Methodical/Arrays/range/float64_range1.il @@ -28,6 +28,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -98,6 +99,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (float64[10000...10005] V_0, diff --git a/src/tests/JIT/Methodical/Arrays/range/float64_range2.il b/src/tests/JIT/Methodical/Arrays/range/float64_range2.il index 9d7d5d91eca523..3e48be20777dba 100644 --- a/src/tests/JIT/Methodical/Arrays/range/float64_range2.il +++ b/src/tests/JIT/Methodical/Arrays/range/float64_range2.il @@ -28,6 +28,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -97,6 +98,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (float64[10000...10005] V_0, diff --git a/src/tests/JIT/Methodical/Arrays/range/int32_0.il b/src/tests/JIT/Methodical/Arrays/range/int32_0.il index fc60b7a3771dc2..c9c5c1c31a8e21 100644 --- a/src/tests/JIT/Methodical/Arrays/range/int32_0.il +++ b/src/tests/JIT/Methodical/Arrays/range/int32_0.il @@ -27,6 +27,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -95,6 +96,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32[0...] V_0, diff --git a/src/tests/JIT/Methodical/Arrays/range/int32_0_5a.il b/src/tests/JIT/Methodical/Arrays/range/int32_0_5a.il index 2b48862369e47a..adc559d52dc267 100644 --- a/src/tests/JIT/Methodical/Arrays/range/int32_0_5a.il +++ b/src/tests/JIT/Methodical/Arrays/range/int32_0_5a.il @@ -27,6 +27,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -95,6 +96,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32[0...5] V_0, diff --git a/src/tests/JIT/Methodical/Arrays/range/int32_0_5b.il b/src/tests/JIT/Methodical/Arrays/range/int32_0_5b.il index 2b48862369e47a..adc559d52dc267 100644 --- a/src/tests/JIT/Methodical/Arrays/range/int32_0_5b.il +++ b/src/tests/JIT/Methodical/Arrays/range/int32_0_5b.il @@ -27,6 +27,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -95,6 +96,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32[0...5] V_0, diff --git a/src/tests/JIT/Methodical/Arrays/range/int32_1.il b/src/tests/JIT/Methodical/Arrays/range/int32_1.il index c867ce1c021d47..fec49174d3d5c9 100644 --- a/src/tests/JIT/Methodical/Arrays/range/int32_1.il +++ b/src/tests/JIT/Methodical/Arrays/range/int32_1.il @@ -27,6 +27,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -95,6 +96,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32[1...] V_0, diff --git a/src/tests/JIT/Methodical/Arrays/range/int32_m1.il b/src/tests/JIT/Methodical/Arrays/range/int32_m1.il index 837021088d468f..043b36436d06d3 100644 --- a/src/tests/JIT/Methodical/Arrays/range/int32_m1.il +++ b/src/tests/JIT/Methodical/Arrays/range/int32_m1.il @@ -27,6 +27,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -95,6 +96,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32[-5...] V_0, diff --git a/src/tests/JIT/Methodical/Arrays/range/int32_neg_range.il b/src/tests/JIT/Methodical/Arrays/range/int32_neg_range.il index e76559c547cdc5..0a1a52f5276ec5 100644 --- a/src/tests/JIT/Methodical/Arrays/range/int32_neg_range.il +++ b/src/tests/JIT/Methodical/Arrays/range/int32_neg_range.il @@ -27,6 +27,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -95,6 +96,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32[-80005...-80000] V_0, diff --git a/src/tests/JIT/Methodical/Arrays/range/int32_range1.il b/src/tests/JIT/Methodical/Arrays/range/int32_range1.il index fb732100fbe204..990833bd6ae738 100644 --- a/src/tests/JIT/Methodical/Arrays/range/int32_range1.il +++ b/src/tests/JIT/Methodical/Arrays/range/int32_range1.il @@ -28,6 +28,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -96,6 +97,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32[10000...10005] V_0, diff --git a/src/tests/JIT/Methodical/Arrays/range/int32_range2.il b/src/tests/JIT/Methodical/Arrays/range/int32_range2.il index a9c038188c7be7..a22bb294cdf1c1 100644 --- a/src/tests/JIT/Methodical/Arrays/range/int32_range2.il +++ b/src/tests/JIT/Methodical/Arrays/range/int32_range2.il @@ -28,6 +28,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -95,6 +96,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32[10000...10005] V_0, diff --git a/src/tests/JIT/Methodical/Arrays/range/negIndexRngChkElim.il b/src/tests/JIT/Methodical/Arrays/range/negIndexRngChkElim.il index 83433d06b132ca..9dfbbd6ffd58c3 100644 --- a/src/tests/JIT/Methodical/Arrays/range/negIndexRngChkElim.il +++ b/src/tests/JIT/Methodical/Arrays/range/negIndexRngChkElim.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly ILGEN_0x1d013582 {} +.assembly extern xunit.core {} .assembly extern mscorlib{auto} .class ILGEN_0x1d013582 { @@ -1451,6 +1452,9 @@ End_Orphan_b_106: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 1 diff --git a/src/tests/JIT/Methodical/Boxing/boxunbox/array.il b/src/tests/JIT/Methodical/Boxing/boxunbox/array.il index ac1cfc06a76ef2..b6fd3e93f75e2a 100644 --- a/src/tests/JIT/Methodical/Boxing/boxunbox/array.il +++ b/src/tests/JIT/Methodical/Boxing/boxunbox/array.il @@ -8,11 +8,15 @@ .ver 4:0:0:0 } .assembly 'array' { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test extends [mscorlib]System.Object { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 32 .locals (unsigned int8[] ARR_u1, diff --git a/src/tests/JIT/Methodical/Boxing/boxunbox/chain.il b/src/tests/JIT/Methodical/Boxing/boxunbox/chain.il index 2b4343e429ec4e..f5c13d7df74b82 100644 --- a/src/tests/JIT/Methodical/Boxing/boxunbox/chain.il +++ b/src/tests/JIT/Methodical/Boxing/boxunbox/chain.il @@ -8,11 +8,15 @@ .ver 4:0:0:0 } .assembly 'chain' { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test extends [mscorlib]System.Object { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 32 ldc.i8 13 diff --git a/src/tests/JIT/Methodical/Boxing/boxunbox/finally.il b/src/tests/JIT/Methodical/Boxing/boxunbox/finally.il index 87785b4bc549b1..00724e62a9efca 100644 --- a/src/tests/JIT/Methodical/Boxing/boxunbox/finally.il +++ b/src/tests/JIT/Methodical/Boxing/boxunbox/finally.il @@ -9,6 +9,7 @@ .assembly extern mscorlib { } .assembly 'finally' { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit App @@ -184,6 +185,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/Boxing/boxunbox/huge_filter.il b/src/tests/JIT/Methodical/Boxing/boxunbox/huge_filter.il index 4bf59f27095aba..ba9c6cfab177d3 100644 --- a/src/tests/JIT/Methodical/Boxing/boxunbox/huge_filter.il +++ b/src/tests/JIT/Methodical/Boxing/boxunbox/huge_filter.il @@ -9,6 +9,7 @@ .assembly extern mscorlib { } .assembly 'huge_filter' { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit App @@ -181,6 +182,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/Boxing/boxunbox/jump.il b/src/tests/JIT/Methodical/Boxing/boxunbox/jump.il index b1f78069170d20..0541f08a632ea1 100644 --- a/src/tests/JIT/Methodical/Boxing/boxunbox/jump.il +++ b/src/tests/JIT/Methodical/Boxing/boxunbox/jump.il @@ -9,6 +9,7 @@ .assembly extern mscorlib { } .assembly 'jump' { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit App @@ -184,6 +185,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/Boxing/boxunbox/local.il b/src/tests/JIT/Methodical/Boxing/boxunbox/local.il index 996d2e84e5ca8a..ca0b40bc80a9f4 100644 --- a/src/tests/JIT/Methodical/Boxing/boxunbox/local.il +++ b/src/tests/JIT/Methodical/Boxing/boxunbox/local.il @@ -8,11 +8,15 @@ .ver 4:0:0:0 } .assembly 'local' { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test extends [mscorlib]System.Object { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 32 .locals (unsigned int8 VAR_u1, diff --git a/src/tests/JIT/Methodical/Boxing/boxunbox/localloc.il b/src/tests/JIT/Methodical/Boxing/boxunbox/localloc.il index 6679b202179a8d..1ec278e049dbbb 100644 --- a/src/tests/JIT/Methodical/Boxing/boxunbox/localloc.il +++ b/src/tests/JIT/Methodical/Boxing/boxunbox/localloc.il @@ -9,6 +9,7 @@ .assembly extern mscorlib { } .assembly 'localloc' { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit App @@ -179,6 +180,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/Boxing/boxunbox/simple.il b/src/tests/JIT/Methodical/Boxing/boxunbox/simple.il index b372d50e2c6961..2a5fb5129550e6 100644 --- a/src/tests/JIT/Methodical/Boxing/boxunbox/simple.il +++ b/src/tests/JIT/Methodical/Boxing/boxunbox/simple.il @@ -9,6 +9,7 @@ .assembly extern mscorlib { } .assembly 'simple' { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit App @@ -174,6 +175,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/Boxing/boxunbox/tailcall.il b/src/tests/JIT/Methodical/Boxing/boxunbox/tailcall.il index fa668cbe8be196..f11876ffb74a4b 100644 --- a/src/tests/JIT/Methodical/Boxing/boxunbox/tailcall.il +++ b/src/tests/JIT/Methodical/Boxing/boxunbox/tailcall.il @@ -6,6 +6,7 @@ .assembly extern mscorlib { auto } .assembly 'tailcall' { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit App @@ -178,6 +179,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/Boxing/boxunbox/try.il b/src/tests/JIT/Methodical/Boxing/boxunbox/try.il index fcae3ad277e431..3c9a436711620a 100644 --- a/src/tests/JIT/Methodical/Boxing/boxunbox/try.il +++ b/src/tests/JIT/Methodical/Boxing/boxunbox/try.il @@ -9,6 +9,7 @@ .assembly extern mscorlib { } .assembly 'try' { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit App @@ -181,6 +182,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/Boxing/callconv/instance.il b/src/tests/JIT/Methodical/Boxing/callconv/instance.il index 572f7d335fbbf7..0d6d53a562aa8d 100644 --- a/src/tests/JIT/Methodical/Boxing/callconv/instance.il +++ b/src/tests/JIT/Methodical/Boxing/callconv/instance.il @@ -13,6 +13,7 @@ .assembly 'instance'// as "instance" { } +.assembly extern xunit.core {} .namespace BoxTest { .class abstract auto ansi BaseTest extends [mscorlib]System.Object @@ -176,6 +177,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals ([0] class BoxTest.Test test, diff --git a/src/tests/JIT/Methodical/Boxing/functional/fibo.il b/src/tests/JIT/Methodical/Boxing/functional/fibo.il index a69adbc37ce4ad..bee24ee1f971ab 100644 --- a/src/tests/JIT/Methodical/Boxing/functional/fibo.il +++ b/src/tests/JIT/Methodical/Boxing/functional/fibo.il @@ -9,6 +9,7 @@ .assembly extern mscorlib { } .assembly 'fibo' { } +.assembly extern xunit.core {} .namespace BoxTest { .class auto ansi Test extends [mscorlib]System.Object @@ -129,6 +130,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals ([0] int32 V_0, diff --git a/src/tests/JIT/Methodical/Boxing/functional/sin.il b/src/tests/JIT/Methodical/Boxing/functional/sin.il index 889379e3a252a3..a0a11fa921b8e2 100644 --- a/src/tests/JIT/Methodical/Boxing/functional/sin.il +++ b/src/tests/JIT/Methodical/Boxing/functional/sin.il @@ -12,6 +12,7 @@ .assembly sin { } +.assembly extern xunit.core {} .module sin_il.exe .namespace SinCalc { @@ -222,6 +223,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals (object V_0, diff --git a/src/tests/JIT/Methodical/Boxing/misc/concurgc.il b/src/tests/JIT/Methodical/Boxing/misc/concurgc.il index 51281e91ff3b82..0afbb1b0c3d54a 100644 --- a/src/tests/JIT/Methodical/Boxing/misc/concurgc.il +++ b/src/tests/JIT/Methodical/Boxing/misc/concurgc.il @@ -9,6 +9,7 @@ .assembly 'concur'// as "concur" { } +.assembly extern xunit.core {} .namespace Test { .class auto ansi App extends [mscorlib]System.Object @@ -31,6 +32,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals ([0] class Test.App app, diff --git a/src/tests/JIT/Methodical/Boxing/misc/enum.il b/src/tests/JIT/Methodical/Boxing/misc/enum.il index ba867822b4643f..bedbe2006ee3c9 100644 --- a/src/tests/JIT/Methodical/Boxing/misc/enum.il +++ b/src/tests/JIT/Methodical/Boxing/misc/enum.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly 'enum' { } +.assembly extern xunit.core {} .namespace BoxTest { .class value auto ansi serializable sealed ToPrintOrNotToPrint extends [mscorlib]System.Enum @@ -135,6 +136,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 47 (0x2f) .maxstack 3 diff --git a/src/tests/JIT/Methodical/Boxing/misc/nestval.il b/src/tests/JIT/Methodical/Boxing/misc/nestval.il index 32660f80cd5b98..d06cd338b0b394 100644 --- a/src/tests/JIT/Methodical/Boxing/misc/nestval.il +++ b/src/tests/JIT/Methodical/Boxing/misc/nestval.il @@ -9,6 +9,7 @@ .assembly extern mscorlib { } .assembly 'nestval' { } +.assembly extern xunit.core {} .namespace BoxTest { .class value auto ansi sealed MyBool extends [mscorlib]System.ValueType @@ -197,6 +198,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals ([0] value class BoxTest.ArgInfo args) diff --git a/src/tests/JIT/Methodical/Boxing/misc/tailjump.il b/src/tests/JIT/Methodical/Boxing/misc/tailjump.il index f6d2b87be22a37..57130ac19aca4a 100644 --- a/src/tests/JIT/Methodical/Boxing/misc/tailjump.il +++ b/src/tests/JIT/Methodical/Boxing/misc/tailjump.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly 'test' { } +.assembly extern xunit.core {} .namespace BoxTest { .class auto ansi Test extends [mscorlib]System.Object @@ -119,6 +120,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 47 (0x2f) .maxstack 3 diff --git a/src/tests/JIT/Methodical/Boxing/misc/typedref.il b/src/tests/JIT/Methodical/Boxing/misc/typedref.il index f238181c52d1eb..6ccc23d5a81725 100644 --- a/src/tests/JIT/Methodical/Boxing/misc/typedref.il +++ b/src/tests/JIT/Methodical/Boxing/misc/typedref.il @@ -9,6 +9,7 @@ .assembly extern mscorlib { } .assembly 'typedref' { } +.assembly extern xunit.core {} .namespace BoxTest { .class auto ansi Test extends [mscorlib]System.Object @@ -148,6 +149,9 @@ equal_types: .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals ([0] int32 V_0, diff --git a/src/tests/JIT/Methodical/Boxing/morph/sin3double.il b/src/tests/JIT/Methodical/Boxing/morph/sin3double.il index eb41a116353b0d..f6da010122d6e7 100644 --- a/src/tests/JIT/Methodical/Boxing/morph/sin3double.il +++ b/src/tests/JIT/Methodical/Boxing/morph/sin3double.il @@ -12,6 +12,7 @@ .assembly sin3double { } +.assembly extern xunit.core {} .class private sequential ansi sealed beforefieldinit VV extends [mscorlib]System.ValueType { @@ -196,6 +197,9 @@ .method static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals (int32 V_0, float64 V_1, diff --git a/src/tests/JIT/Methodical/Boxing/seh/fault.il b/src/tests/JIT/Methodical/Boxing/seh/fault.il index 69c71a8204e232..ff5e4bfe46e498 100644 --- a/src/tests/JIT/Methodical/Boxing/seh/fault.il +++ b/src/tests/JIT/Methodical/Boxing/seh/fault.il @@ -13,6 +13,7 @@ .assembly 'try'// as "try" { } +.assembly extern xunit.core {} .namespace SinCalc { .class auto ansi MistakeException extends [mscorlib]System.Exception @@ -269,6 +270,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 .locals ([0] class System.Object i, diff --git a/src/tests/JIT/Methodical/Boxing/seh/filter.il b/src/tests/JIT/Methodical/Boxing/seh/filter.il index badea4a3e62b35..366cf0aeea95f0 100644 --- a/src/tests/JIT/Methodical/Boxing/seh/filter.il +++ b/src/tests/JIT/Methodical/Boxing/seh/filter.il @@ -9,6 +9,7 @@ .assembly extern mscorlib { } .assembly 'filter' { } +.assembly extern xunit.core {} .namespace SinCalc { .class auto ansi MistakeException extends [mscorlib]System.Exception @@ -265,6 +266,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 .locals ([0] class System.Object i, diff --git a/src/tests/JIT/Methodical/Boxing/seh/try.il b/src/tests/JIT/Methodical/Boxing/seh/try.il index 3355859172f282..cd04429395d2c1 100644 --- a/src/tests/JIT/Methodical/Boxing/seh/try.il +++ b/src/tests/JIT/Methodical/Boxing/seh/try.il @@ -9,6 +9,7 @@ .assembly extern mscorlib { } .assembly 'try' { } +.assembly extern xunit.core {} .namespace SinCalc { .class auto ansi MistakeException extends [mscorlib]System.Exception @@ -265,6 +266,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 .locals ([0] class System.Object i, diff --git a/src/tests/JIT/Methodical/Boxing/xlang/sin_cs.il b/src/tests/JIT/Methodical/Boxing/xlang/sin_cs.il index 134937faef4375..c0f5310000ad3c 100644 --- a/src/tests/JIT/Methodical/Boxing/xlang/sin_cs.il +++ b/src/tests/JIT/Methodical/Boxing/xlang/sin_cs.il @@ -9,6 +9,7 @@ } .assembly extern legacy library mscorlib { auto } .assembly 'sin_il_cs' {} +.assembly extern xunit.core {} .assembly extern sinlib_cs { } @@ -19,6 +20,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals (class System.Object V_0, diff --git a/src/tests/JIT/Methodical/Boxing/xlang/sin_il.il b/src/tests/JIT/Methodical/Boxing/xlang/sin_il.il index 3e0ff2dbad3ad2..b1eda3d5ea863c 100644 --- a/src/tests/JIT/Methodical/Boxing/xlang/sin_il.il +++ b/src/tests/JIT/Methodical/Boxing/xlang/sin_il.il @@ -9,6 +9,7 @@ } .assembly extern legacy library mscorlib { auto } .assembly 'sin_il_il' {} +.assembly extern xunit.core {} .assembly extern sinlib_il { } @@ -19,6 +20,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals (class System.Object V_0, diff --git a/src/tests/JIT/Methodical/Coverage/arglist_pos.il b/src/tests/JIT/Methodical/Coverage/arglist_pos.il index 443de1481ecabd..a4304da439a1ed 100644 --- a/src/tests/JIT/Methodical/Coverage/arglist_pos.il +++ b/src/tests/JIT/Methodical/Coverage/arglist_pos.il @@ -14,6 +14,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module arglist_pos.exe .class public auto ansi arglist_pos extends [mscorlib]System.Object @@ -33,6 +34,9 @@ .method public hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try { diff --git a/src/tests/JIT/Methodical/Coverage/b39946.il b/src/tests/JIT/Methodical/Coverage/b39946.il index 44a6e64258ea86..d9277a2b8c6824 100644 --- a/src/tests/JIT/Methodical/Coverage/b39946.il +++ b/src/tests/JIT/Methodical/Coverage/b39946.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b39946 {} +.assembly extern xunit.core {} .class ILGEN_0x5c383c7 { @@ -297,6 +298,9 @@ End_Orphan_44: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Methodical/Coverage/copy_prop_byref_to_native_int.il b/src/tests/JIT/Methodical/Coverage/copy_prop_byref_to_native_int.il index 412a725815497b..f637184467a781 100644 --- a/src/tests/JIT/Methodical/Coverage/copy_prop_byref_to_native_int.il +++ b/src/tests/JIT/Methodical/Coverage/copy_prop_byref_to_native_int.il @@ -5,6 +5,7 @@ .assembly extern System.Runtime { auto } .assembly CopyPropByrefToNativeInt { } +.assembly extern xunit.core {} .typedef [System.Runtime]System.WeakReference as WeakRef .typedef [System.Runtime]System.GC as GC @@ -16,6 +17,9 @@ .method private static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals ( [0] int32 result, [1] int32[] arr ) diff --git a/src/tests/JIT/Methodical/Coverage/hole.il b/src/tests/JIT/Methodical/Coverage/hole.il index e1f7eb46e8818e..9ebf0969e6a534 100644 --- a/src/tests/JIT/Methodical/Coverage/hole.il +++ b/src/tests/JIT/Methodical/Coverage/hole.il @@ -13,6 +13,7 @@ .ver 4:0:0:0 } .assembly hole {} +.assembly extern xunit.core {} .module hole.exe // MVID: {972ABF67-C385-44E6-B525-571BCCECC13C} .imagebase 0x00400000 @@ -30,6 +31,9 @@ .field public static int32 x .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 115 (0x73) .maxstack 10 diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/conv_i8_i.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/conv_i8_i.il index 06fa6bee1d8ce7..ec19ddbd50768b 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/conv_i8_i.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/conv_i8_i.il @@ -11,10 +11,14 @@ } .assembly 'test' { } +.assembly extern xunit.core {} .class private auto ansi Test_conv_i8_i extends [mscorlib]System.Object { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 48 (0x30) .maxstack 5 diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/conv_i8_u.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/conv_i8_u.il index bf87eb66028a1d..690573ad7bd894 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/conv_i8_u.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/conv_i8_u.il @@ -11,10 +11,14 @@ } .assembly 'test' { } +.assembly extern xunit.core {} .class private auto ansi Test_conv_i8_u extends [mscorlib]System.Object { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 48 (0x30) .maxstack 5 diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/convovf_i8_i.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/convovf_i8_i.il index 46899b10eb2c25..523547eb5b9c84 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/convovf_i8_i.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/convovf_i8_i.il @@ -11,10 +11,14 @@ } .assembly 'test' { } +.assembly extern xunit.core {} .class private auto ansi Test_convovf_i8_i extends [mscorlib]System.Object { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 48 (0x30) .maxstack 5 diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/convovf_i8_u-ia64.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/convovf_i8_u-ia64.il index d9553fd6665446..3efc6feaeec906 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/convovf_i8_u-ia64.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/convovf_i8_u-ia64.il @@ -11,10 +11,14 @@ } .assembly 'test' { } +.assembly extern xunit.core {} .class private auto ansi Test_convovf_i8_u_ia64 extends [mscorlib]System.Object { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 48 (0x30) .maxstack 5 diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_array_merge-i386.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_array_merge-i386.il index 8cc0a204ad0e32..398a64744a14d7 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_array_merge-i386.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_array_merge-i386.il @@ -11,10 +11,14 @@ { } .assembly 'test' { } +.assembly extern xunit.core {} .class private auto ansi Test_i_array_merge_i386 extends [mscorlib]System.Object { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (int32[0...], native int[0...], native int, native int) diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_array_merge-ia64.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_array_merge-ia64.il index 9c7edda8fe1a0f..6c75fc15e4d7ab 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_array_merge-ia64.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_array_merge-ia64.il @@ -11,10 +11,14 @@ { } .assembly 'test' { } +.assembly extern xunit.core {} .class private auto ansi Test_i_array_merge_ia64 extends [mscorlib]System.Object { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (int64[0...], native int[0...], native int, native int) diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_box.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_box.il index 5bb094dac13cce..0aa7706e959949 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_box.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_box.il @@ -19,6 +19,7 @@ .assembly 'avg'// as "avg" { } +.assembly extern xunit.core {} .module 'avg.exe' .namespace BoxTest { @@ -47,6 +48,9 @@ } .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 .locals (native int) diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_conv.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_conv.il index f81f1b4ee6d8ea..a7e5838c437afd 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_conv.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_conv.il @@ -11,6 +11,7 @@ } .assembly 'test' { } +.assembly extern xunit.core {} .class private auto ansi Test_i_conv extends [mscorlib]System.Object { .method private hidebysig static native int to_native(int32) il managed @@ -21,6 +22,9 @@ } .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 //------------------------ diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_fld.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_fld.il index ca1adf5e0fa752..0ac560dfaa769c 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_fld.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_fld.il @@ -11,6 +11,7 @@ } .assembly 'qsort'// as "qsort" { } +.assembly extern xunit.core {} .module 'qsort.exe' .namespace Test { @@ -22,6 +23,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (class Test.AA pinned, native int[0...], native int, int32, native int[0...] pinned) diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_flood.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_flood.il index a0befda38eea3e..d1a2c207bfe1ed 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_flood.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_flood.il @@ -16,11 +16,15 @@ .assembly 'avg'// as "avg" { } +.assembly extern xunit.core {} .module 'avg.exe' // MVID: {BCA6096F-DF11-4FA3-BF16-EEDA01729535} .namespace AvgTest { .class private auto ansi Test extends [mscorlib]System.Object { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals(native int, native int) diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_flow.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_flow.il index 3d62d437457be1..9a2d0b356c4b0c 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_flow.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_flow.il @@ -16,6 +16,7 @@ .assembly 'qsort'// as "qsort" { } +.assembly extern xunit.core {} .module 'qsort.exe' // MVID: {3433C0F8-3BEA-4168-AB0C-C275EF054928} .namespace Test @@ -27,6 +28,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 134 (0x86) .maxstack 8 diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_prop.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_prop.il index a392ebe812db8d..a3fc294254ad40 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_prop.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_prop.il @@ -11,6 +11,7 @@ } .assembly 'qsort'// as "qsort" { } +.assembly extern xunit.core {} .module 'qsort.exe' .namespace Test { @@ -18,6 +19,9 @@ { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (class Test.AA) diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_qsort1.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_qsort1.il index 5ce9a06f908253..c3189031bb03ca 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_qsort1.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_qsort1.il @@ -16,6 +16,7 @@ .assembly 'qsort'// as "qsort" { } +.assembly extern xunit.core {} .module 'qsort.exe' // MVID: {D2333E3D-2CA6-4703-8D46-E41A46BDF801} .namespace QSortTest @@ -196,6 +197,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 134 (0x86) .maxstack 4 diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_qsort2.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_qsort2.il index f60e0448546a54..770bc72c164405 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_qsort2.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_qsort2.il @@ -16,6 +16,7 @@ .assembly 'qsort'// as "qsort" { } +.assembly extern xunit.core {} .module 'qsort.exe' // MVID: {D2333E3D-2CA6-4703-8D46-E41A46BDF801} .namespace QSortTest @@ -196,6 +197,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 134 (0x86) .maxstack 4 diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_ref.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_ref.il index 4f1d6abc6f84e2..1d14a7ee138df6 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_ref.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_ref.il @@ -16,6 +16,7 @@ .assembly 'avg'// as "avg" { } +.assembly extern xunit.core {} .module 'avg.exe' // MVID: {BCA6096F-DF11-4FA3-BF16-EEDA01729535} .namespace AvgTest @@ -25,6 +26,9 @@ { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 48 (0x30) .maxstack 5 diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_seq.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_seq.il index 44eee1e4cdb9b4..5a74e9f73dfa98 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_seq.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_seq.il @@ -11,6 +11,7 @@ } .assembly 'test' { } +.assembly extern xunit.core {} .class private auto ansi Test_i_seq extends [mscorlib]System.Object { .method private hidebysig static native int calc(native int, native int) il managed @@ -46,6 +47,9 @@ stop: .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 ldc.i4.s 6 diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_vfld.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_vfld.il index c78b4b36de6f72..e7a67870955f73 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_vfld.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_vfld.il @@ -11,6 +11,7 @@ } .assembly 'qsort'// as "qsort" { } +.assembly extern xunit.core {} .module 'qsort.exe' .namespace Test { @@ -22,6 +23,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (value class Test.AA pinned, native int[0...], native int, int32, native int[0...] pinned) diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/qperm.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/qperm.il index 87d0be8fabea57..0b0b82398b3171 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/qperm.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/qperm.il @@ -16,6 +16,7 @@ .assembly 'qsort'// as "qsort" { } +.assembly extern xunit.core {} .module 'qsort.exe' // MVID: {D2333E3D-2CA6-4703-8D46-E41A46BDF801} .namespace QSortTest @@ -199,6 +200,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 134 (0x86) .maxstack 4 diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/sizeof-i386.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/sizeof-i386.il index eaa1230047ca01..5c3209409c78cd 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/sizeof-i386.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/sizeof-i386.il @@ -16,6 +16,7 @@ .assembly 'avg'// as "avg" { } +.assembly extern xunit.core {} .module 'avg.exe' // MVID: {BCA6096F-DF11-4FA3-BF16-EEDA01729535} .namespace AvgTest @@ -25,6 +26,9 @@ { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 48 (0x30) .maxstack 5 diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/sizeof-ia64.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/sizeof-ia64.il index 8570210dd1dbc7..2d4392c2b098c0 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/sizeof-ia64.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/sizeof-ia64.il @@ -16,6 +16,7 @@ .assembly 'avg'// as "avg" { } +.assembly extern xunit.core {} .module 'avg.exe' // MVID: {BCA6096F-DF11-4FA3-BF16-EEDA01729535} .namespace AvgTest @@ -25,6 +26,9 @@ { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 48 (0x30) .maxstack 5 diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_array_merge-i386.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_array_merge-i386.il index e031fe4d4051f6..02c38e5d459150 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_array_merge-i386.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_array_merge-i386.il @@ -11,10 +11,14 @@ { } .assembly 'test' { } +.assembly extern xunit.core {} .class private auto ansi Test_u_array_merge_i386 extends [mscorlib]System.Object { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (unsigned int32[0...], native unsigned int[0...], native unsigned int, native unsigned int) diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_array_merge-ia64.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_array_merge-ia64.il index 7208f20f9ed116..a29f8bea872aa2 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_array_merge-ia64.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_array_merge-ia64.il @@ -11,10 +11,14 @@ { } .assembly 'test' { } +.assembly extern xunit.core {} .class private auto ansi Test_u_array_merge_ia64 extends [mscorlib]System.Object { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (unsigned int64[0...], native unsigned int[0...], native unsigned int, native unsigned int) diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_box.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_box.il index 5a3159882b635e..ddd03aa82410e2 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_box.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_box.il @@ -19,6 +19,7 @@ .assembly 'avg'// as "avg" { } +.assembly extern xunit.core {} .module 'avg.exe' .namespace BoxTest { @@ -47,6 +48,9 @@ } .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 .locals (native unsigned int) diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_conv.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_conv.il index c983a8d52a5b09..b3a82dba147bfc 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_conv.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_conv.il @@ -11,6 +11,7 @@ } .assembly 'test' { } +.assembly extern xunit.core {} .class private auto ansi Test_u_conv extends [mscorlib]System.Object { .method private hidebysig static native unsigned int to_native(int32) il managed @@ -21,6 +22,9 @@ } .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 //------------------------ diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_fld.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_fld.il index 321bb19365b9e8..6c47c64602080d 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_fld.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_fld.il @@ -11,6 +11,7 @@ } .assembly 'qsort'// as "qsort" { } +.assembly extern xunit.core {} .module 'qsort.exe' .namespace Test { @@ -22,6 +23,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (class Test.AA pinned, native unsigned int[0...], native unsigned int, int32, native unsigned int[0...] pinned) diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_flood.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_flood.il index fb36a19686b976..9864c6f4c12ece 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_flood.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_flood.il @@ -16,11 +16,15 @@ .assembly 'avg'// as "avg" { } +.assembly extern xunit.core {} .module 'avg.exe' // MVID: {BCA6096F-DF11-4FA3-BF16-EEDA01729535} .namespace AvgTest { .class private auto ansi Test extends [mscorlib]System.Object { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals(native unsigned int) diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_flow.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_flow.il index 37c661ef4564ba..3232a26e18ac12 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_flow.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_flow.il @@ -16,6 +16,7 @@ .assembly 'qsort'// as "qsort" { } +.assembly extern xunit.core {} .module 'qsort.exe' // MVID: {3433C0F8-3BEA-4168-AB0C-C275EF054928} .namespace Test @@ -27,6 +28,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 134 (0x86) .maxstack 8 diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_prop.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_prop.il index 9d71f2d6f30d35..f835e59a04fb2f 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_prop.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_prop.il @@ -11,6 +11,7 @@ } .assembly 'qsort'// as "qsort" { } +.assembly extern xunit.core {} .module 'qsort.exe' .namespace Test { @@ -18,6 +19,9 @@ { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (class Test.AA) diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_qsort1.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_qsort1.il index 792d8d878db034..caf3ca4d4d02d4 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_qsort1.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_qsort1.il @@ -16,6 +16,7 @@ .assembly 'qsort'// as "qsort" { } +.assembly extern xunit.core {} .module 'qsort.exe' // MVID: {D2333E3D-2CA6-4703-8D46-E41A46BDF801} .namespace QSortTest @@ -196,6 +197,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 134 (0x86) .maxstack 4 diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_qsort2.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_qsort2.il index 384010549d83da..e88514d22873d5 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_qsort2.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_qsort2.il @@ -16,6 +16,7 @@ .assembly 'qsort'// as "qsort" { } +.assembly extern xunit.core {} .module 'qsort.exe' // MVID: {D2333E3D-2CA6-4703-8D46-E41A46BDF801} .namespace QSortTest @@ -196,6 +197,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 134 (0x86) .maxstack 4 diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_ref.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_ref.il index e89495c743fdc7..6b42d6e0fcb041 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_ref.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_ref.il @@ -16,6 +16,7 @@ .assembly 'avg'// as "avg" { } +.assembly extern xunit.core {} .module 'avg.exe' // MVID: {BCA6096F-DF11-4FA3-BF16-EEDA01729535} .namespace AvgTest @@ -24,6 +25,9 @@ { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 48 (0x30) .maxstack 5 diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_seq.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_seq.il index 52806809a11e45..804b9e58de1401 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_seq.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_seq.il @@ -11,6 +11,7 @@ } .assembly 'test' { } +.assembly extern xunit.core {} .class private auto ansi Test_u_seq extends [mscorlib]System.Object { .method private hidebysig static native unsigned int calc(native unsigned int, native unsigned int) il managed @@ -47,6 +48,9 @@ stop: .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 ldc.i4.s 6 diff --git a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_vfld.il b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_vfld.il index ff342ec881971f..4a98ec61cfe835 100644 --- a/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_vfld.il +++ b/src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_vfld.il @@ -11,6 +11,7 @@ } .assembly 'qsort'// as "qsort" { } +.assembly extern xunit.core {} .module 'qsort.exe' .namespace Test { @@ -22,6 +23,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (value class Test.AA pinned, native unsigned int[0...], native unsigned int, int32, native unsigned int[0...] pinned) diff --git a/src/tests/JIT/Methodical/FPtrunc/convX.il b/src/tests/JIT/Methodical/FPtrunc/convX.il index 217fc1b66f30cf..eab24953d3c129 100644 --- a/src/tests/JIT/Methodical/FPtrunc/convX.il +++ b/src/tests/JIT/Methodical/FPtrunc/convX.il @@ -8,12 +8,16 @@ } .assembly extern mscorlib {} .assembly convX {} +.assembly extern xunit.core {} .module convX.exe .class private auto ansi beforefieldinit convX extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 diff --git a/src/tests/JIT/Methodical/FPtrunc/convr4d.il b/src/tests/JIT/Methodical/FPtrunc/convr4d.il index ce7eab6427144c..d735bb4dc929f5 100644 --- a/src/tests/JIT/Methodical/FPtrunc/convr4d.il +++ b/src/tests/JIT/Methodical/FPtrunc/convr4d.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly convr4a {} +.assembly extern xunit.core {} .class public sealed VT extends [mscorlib]System.ValueType { .field public float32 f @@ -205,6 +206,9 @@ .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 1155 (0x483) .maxstack 5 diff --git a/src/tests/JIT/Methodical/FPtrunc/convr8d.il b/src/tests/JIT/Methodical/FPtrunc/convr8d.il index 5234ac6c9561db..4905a0539f8c32 100644 --- a/src/tests/JIT/Methodical/FPtrunc/convr8d.il +++ b/src/tests/JIT/Methodical/FPtrunc/convr8d.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly convr8d {} +.assembly extern xunit.core {} .class public sealed VT extends [mscorlib]System.ValueType { .field public float64 f @@ -205,6 +206,9 @@ .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 1155 (0x483) .maxstack 5 diff --git a/src/tests/JIT/Methodical/Invoke/25params/25param1b.il b/src/tests/JIT/Methodical/Invoke/25params/25param1b.il index a87f3cde457bf6..ce71f5223cfb65 100644 --- a/src/tests/JIT/Methodical/Invoke/25params/25param1b.il +++ b/src/tests/JIT/Methodical/Invoke/25params/25param1b.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly '20param2a'{} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit test extends [mscorlib]System.Object { @@ -216,6 +217,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 67 (0x43) .maxstack 25 diff --git a/src/tests/JIT/Methodical/Invoke/25params/25param1c.il b/src/tests/JIT/Methodical/Invoke/25params/25param1c.il index 7f68d3279d2020..641e42e08eaa57 100644 --- a/src/tests/JIT/Methodical/Invoke/25params/25param1c.il +++ b/src/tests/JIT/Methodical/Invoke/25params/25param1c.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly '20param3a'{} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit test extends [mscorlib]System.Object { @@ -242,6 +243,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 67 (0x43) .maxstack 25 diff --git a/src/tests/JIT/Methodical/Invoke/25params/25param2b.il b/src/tests/JIT/Methodical/Invoke/25params/25param2b.il index bbbd2966188d3e..3a2c753ae09d37 100644 --- a/src/tests/JIT/Methodical/Invoke/25params/25param2b.il +++ b/src/tests/JIT/Methodical/Invoke/25params/25param2b.il @@ -8,6 +8,7 @@ } .assembly extern mscorlib {} .assembly '20param2b'{} +.assembly extern xunit.core {} .class private sequential ansi sealed beforefieldinit VT extends [mscorlib]System.ValueType { @@ -273,6 +274,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 25 .locals init ([0] valuetype VT vt, diff --git a/src/tests/JIT/Methodical/Invoke/25params/25param2c.il b/src/tests/JIT/Methodical/Invoke/25params/25param2c.il index 689385584ad9e7..30ba388ee31297 100644 --- a/src/tests/JIT/Methodical/Invoke/25params/25param2c.il +++ b/src/tests/JIT/Methodical/Invoke/25params/25param2c.il @@ -8,6 +8,7 @@ } .assembly extern mscorlib {} .assembly '20param1b' {} +.assembly extern xunit.core {} .class private sequential ansi sealed beforefieldinit VT extends [mscorlib]System.ValueType { @@ -299,6 +300,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 25 .locals init ([0] valuetype VT vt, diff --git a/src/tests/JIT/Methodical/Invoke/25params/25param3b.il b/src/tests/JIT/Methodical/Invoke/25params/25param3b.il index 1ff0d48ac43f63..7cca3514d4691b 100644 --- a/src/tests/JIT/Methodical/Invoke/25params/25param3b.il +++ b/src/tests/JIT/Methodical/Invoke/25params/25param3b.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly '20param3c' {} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit test extends [mscorlib]System.Object { @@ -1635,6 +1636,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 83 (0x53) .maxstack 25 diff --git a/src/tests/JIT/Methodical/Invoke/25params/25param3c.il b/src/tests/JIT/Methodical/Invoke/25params/25param3c.il index 0332142e45a0ce..a2cd67fbbda603 100644 --- a/src/tests/JIT/Methodical/Invoke/25params/25param3c.il +++ b/src/tests/JIT/Methodical/Invoke/25params/25param3c.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly '20param3c' {} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit test extends [mscorlib]System.Object { @@ -2259,6 +2260,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 83 (0x53) .maxstack 25 diff --git a/src/tests/JIT/Methodical/Invoke/25params/25paramMixed.il b/src/tests/JIT/Methodical/Invoke/25params/25paramMixed.il index 62ec1084057b6f..07ac1b11bd9f5b 100644 --- a/src/tests/JIT/Methodical/Invoke/25params/25paramMixed.il +++ b/src/tests/JIT/Methodical/Invoke/25params/25paramMixed.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly '20param3c' {} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit test extends [mscorlib]System.Object { @@ -1986,6 +1987,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 83 (0x53) .maxstack 25 diff --git a/src/tests/JIT/Methodical/Invoke/SEH/catchfault.il b/src/tests/JIT/Methodical/Invoke/SEH/catchfault.il index 29ee9f84d5077a..53ca5a97fbcd24 100644 --- a/src/tests/JIT/Methodical/Invoke/SEH/catchfault.il +++ b/src/tests/JIT/Methodical/Invoke/SEH/catchfault.il @@ -14,6 +14,7 @@ .assembly 'catchfault'// as "catchfault" { } +.assembly extern xunit.core {} .module 'catchfault.exe' // MVID: {FCE369B5-E876-4E32-B744-1740582FF3B2} .namespace JitTest @@ -155,6 +156,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 97 (0x61) .maxstack 1 diff --git a/src/tests/JIT/Methodical/Invoke/SEH/catchfault_jmp.il b/src/tests/JIT/Methodical/Invoke/SEH/catchfault_jmp.il index 15f936ea8184a7..2a14bff01faf40 100644 --- a/src/tests/JIT/Methodical/Invoke/SEH/catchfault_jmp.il +++ b/src/tests/JIT/Methodical/Invoke/SEH/catchfault_jmp.il @@ -14,6 +14,7 @@ .assembly 'catchfault_tail'// as "catchfault_tail" { } +.assembly extern xunit.core {} .module 'catchfault_tail.exe' // MVID: {7D0BA0DB-DCB6-4997-83C9-9F31894A25EF} .namespace JitTest @@ -174,6 +175,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 97 (0x61) .maxstack 1 diff --git a/src/tests/JIT/Methodical/Invoke/SEH/catchfault_tail.il b/src/tests/JIT/Methodical/Invoke/SEH/catchfault_tail.il index e465d99c4ed584..8cc3af497fdf99 100644 --- a/src/tests/JIT/Methodical/Invoke/SEH/catchfault_tail.il +++ b/src/tests/JIT/Methodical/Invoke/SEH/catchfault_tail.il @@ -14,6 +14,7 @@ .assembly 'catchfault_tail'// as "catchfault_tail" { } +.assembly extern xunit.core {} .module 'catchfault_tail.exe' // MVID: {7D0BA0DB-DCB6-4997-83C9-9F31894A25EF} .namespace JitTest @@ -178,6 +179,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 97 (0x61) .maxstack 1 diff --git a/src/tests/JIT/Methodical/Invoke/SEH/catchfinally_ind.il b/src/tests/JIT/Methodical/Invoke/SEH/catchfinally_ind.il index f0f1fafffcd1a9..b15528cd677b59 100644 --- a/src/tests/JIT/Methodical/Invoke/SEH/catchfinally_ind.il +++ b/src/tests/JIT/Methodical/Invoke/SEH/catchfinally_ind.il @@ -14,6 +14,7 @@ .assembly 'catchfinally'// as "catchfinally" { } +.assembly extern xunit.core {} .module 'catchfinally.exe' // MVID: {15FE650F-7944-4B46-86D7-2ECCFDC924C2} .namespace JitTest @@ -183,6 +184,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 97 (0x61) .maxstack 1 diff --git a/src/tests/JIT/Methodical/Invoke/SEH/catchfinally_jmp.il b/src/tests/JIT/Methodical/Invoke/SEH/catchfinally_jmp.il index ad5a4bdd1afc61..9ccf3243fc144a 100644 --- a/src/tests/JIT/Methodical/Invoke/SEH/catchfinally_jmp.il +++ b/src/tests/JIT/Methodical/Invoke/SEH/catchfinally_jmp.il @@ -14,6 +14,7 @@ .assembly 'catchfinally_tail'// as "catchfinally_tail" { } +.assembly extern xunit.core {} .module 'catchfinally_tail.exe' // MVID: {CCB52291-4072-427C-8C14-2780C164EB2B} .namespace JitTest @@ -180,6 +181,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 97 (0x61) .maxstack 1 diff --git a/src/tests/JIT/Methodical/Invoke/SEH/catchfinally_jmpind.il b/src/tests/JIT/Methodical/Invoke/SEH/catchfinally_jmpind.il index 7eb20cd317abc9..49c616c8a1b0d3 100644 --- a/src/tests/JIT/Methodical/Invoke/SEH/catchfinally_jmpind.il +++ b/src/tests/JIT/Methodical/Invoke/SEH/catchfinally_jmpind.il @@ -14,6 +14,7 @@ .assembly 'catchfinally_tail'// as "catchfinally_tail" { } +.assembly extern xunit.core {} .module 'catchfinally_tail.exe' // MVID: {CCB52291-4072-427C-8C14-2780C164EB2B} .namespace JitTest @@ -181,6 +182,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 97 (0x61) .maxstack 1 diff --git a/src/tests/JIT/Methodical/Invoke/SEH/catchfinally_tail.il b/src/tests/JIT/Methodical/Invoke/SEH/catchfinally_tail.il index 299e258fe97b69..e3adcf8fe6ad7c 100644 --- a/src/tests/JIT/Methodical/Invoke/SEH/catchfinally_tail.il +++ b/src/tests/JIT/Methodical/Invoke/SEH/catchfinally_tail.il @@ -14,6 +14,7 @@ .assembly 'catchfinally_tail'// as "catchfinally_tail" { } +.assembly extern xunit.core {} .module 'catchfinally_tail.exe' // MVID: {CCB52291-4072-427C-8C14-2780C164EB2B} .namespace JitTest @@ -186,6 +187,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 97 (0x61) .maxstack 1 diff --git a/src/tests/JIT/Methodical/Invoke/callvirt/test1.il b/src/tests/JIT/Methodical/Invoke/callvirt/test1.il index c90ffaf2f3a910..2500e6eb68d860 100644 --- a/src/tests/JIT/Methodical/Invoke/callvirt/test1.il +++ b/src/tests/JIT/Methodical/Invoke/callvirt/test1.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'test1.exe' // MVID: {0D28B100-FF93-4AA9-8EDA-33F3D5D2A136} .namespace Test @@ -133,6 +134,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 99 (0x63) .maxstack 2 diff --git a/src/tests/JIT/Methodical/Invoke/callvirt/test2.il b/src/tests/JIT/Methodical/Invoke/callvirt/test2.il index ed8e5056206d61..df9c3b2c3b82f3 100644 --- a/src/tests/JIT/Methodical/Invoke/callvirt/test2.il +++ b/src/tests/JIT/Methodical/Invoke/callvirt/test2.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'test1.exe' // MVID: {A1B2C1C6-25C2-4DB7-AE55-41CA3A00F290} .namespace Test @@ -133,6 +134,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 99 (0x63) .maxstack 2 diff --git a/src/tests/JIT/Methodical/Invoke/callvirt/test3.il b/src/tests/JIT/Methodical/Invoke/callvirt/test3.il index 8afcc1b78b2877..c8093ef294b6f3 100644 --- a/src/tests/JIT/Methodical/Invoke/callvirt/test3.il +++ b/src/tests/JIT/Methodical/Invoke/callvirt/test3.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'test3.exe' // MVID: {D9CB467A-BD94-4D87-BB6B-ABB1D4B12E50} .namespace Test @@ -79,6 +80,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 65 (0x41) .maxstack 2 diff --git a/src/tests/JIT/Methodical/Invoke/ctor/val_cctor.il b/src/tests/JIT/Methodical/Invoke/ctor/val_cctor.il index ee8ea1ade7a686..28e7d1d2231c79 100644 --- a/src/tests/JIT/Methodical/Invoke/ctor/val_cctor.il +++ b/src/tests/JIT/Methodical/Invoke/ctor/val_cctor.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'val_cctor.exe' // MVID: {1C70E5EE-C023-4741-BFC0-A85E3927FB65} .namespace JitTest @@ -59,6 +60,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 66 (0x42) .maxstack 2 diff --git a/src/tests/JIT/Methodical/Invoke/ctor/val_ctor_newobj.il b/src/tests/JIT/Methodical/Invoke/ctor/val_ctor_newobj.il index eb2806b961705e..4804985c9753f1 100644 --- a/src/tests/JIT/Methodical/Invoke/ctor/val_ctor_newobj.il +++ b/src/tests/JIT/Methodical/Invoke/ctor/val_ctor_newobj.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'ctor.exe' // MVID: {B57C6031-B1F4-4BAC-A5DE-7943EA8B199E} .namespace JitTest @@ -59,6 +60,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 66 (0x42) .maxstack 3 diff --git a/src/tests/JIT/Methodical/Invoke/deep/deep1.il b/src/tests/JIT/Methodical/Invoke/deep/deep1.il index 887d14ba8b0a72..ef4d3ecc426fbf 100644 --- a/src/tests/JIT/Methodical/Invoke/deep/deep1.il +++ b/src/tests/JIT/Methodical/Invoke/deep/deep1.il @@ -14,6 +14,7 @@ .assembly 'deep'// as "deep" { } +.assembly extern xunit.core {} .module 'deep.exe' // MVID: {AA806490-3696-4693-BEEE-68E449C58639} .namespace JitTest @@ -231,6 +232,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 958 (0x3be) .maxstack 46 diff --git a/src/tests/JIT/Methodical/Invoke/deep/deep2.il b/src/tests/JIT/Methodical/Invoke/deep/deep2.il index 367f261a5c2a71..c8e3a65338175d 100644 --- a/src/tests/JIT/Methodical/Invoke/deep/deep2.il +++ b/src/tests/JIT/Methodical/Invoke/deep/deep2.il @@ -14,6 +14,7 @@ .assembly 'deep'// as "deep" { } +.assembly extern xunit.core {} .module 'deep.exe' // MVID: {AA806490-3696-4693-BEEE-68E449C58639} .namespace JitTest @@ -234,6 +235,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 958 (0x3be) .maxstack 45 diff --git a/src/tests/JIT/Methodical/Invoke/fptr/ftn_t.il b/src/tests/JIT/Methodical/Invoke/fptr/ftn_t.il index fcdcc31c7118bf..96ee4867635635 100644 --- a/src/tests/JIT/Methodical/Invoke/fptr/ftn_t.il +++ b/src/tests/JIT/Methodical/Invoke/fptr/ftn_t.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'bug.exe' // MVID: {90803FD0-8E18-44C9-A242-98463ADD450D} .namespace JitTest @@ -65,6 +66,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 ldftn void JitTest.Test::TestMain() diff --git a/src/tests/JIT/Methodical/Invoke/fptr/instftn.il b/src/tests/JIT/Methodical/Invoke/fptr/instftn.il index be26ffa424f54f..759335806ad4d1 100644 --- a/src/tests/JIT/Methodical/Invoke/fptr/instftn.il +++ b/src/tests/JIT/Methodical/Invoke/fptr/instftn.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'bug.exe' // MVID: {90803FD0-8E18-44C9-A242-98463ADD450D} .namespace JitTest @@ -56,6 +57,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 6 .locals (int32 V_0, int32) diff --git a/src/tests/JIT/Methodical/Invoke/fptr/instftn_t.il b/src/tests/JIT/Methodical/Invoke/fptr/instftn_t.il index a4c91aca61f291..c684d7eb007f65 100644 --- a/src/tests/JIT/Methodical/Invoke/fptr/instftn_t.il +++ b/src/tests/JIT/Methodical/Invoke/fptr/instftn_t.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'bug.exe' // MVID: {90803FD0-8E18-44C9-A242-98463ADD450D} .namespace JitTest @@ -76,6 +77,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 6 ldftn int32 JitTest.Test::TestMain() diff --git a/src/tests/JIT/Methodical/Invoke/fptr/recurse_calli.il b/src/tests/JIT/Methodical/Invoke/fptr/recurse_calli.il index 8034946c8f197c..0ecddeee4114e9 100644 --- a/src/tests/JIT/Methodical/Invoke/fptr/recurse_calli.il +++ b/src/tests/JIT/Methodical/Invoke/fptr/recurse_calli.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'recurse.exe' // MVID: {885F4995-E80A-480B-BB9B-30139BED90E1} .namespace TestCase @@ -66,6 +67,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 72 (0x48) .maxstack 2 diff --git a/src/tests/JIT/Methodical/Invoke/fptr/recurse_jmp.il b/src/tests/JIT/Methodical/Invoke/fptr/recurse_jmp.il index b9457ded190c96..f9164dbb8421c8 100644 --- a/src/tests/JIT/Methodical/Invoke/fptr/recurse_jmp.il +++ b/src/tests/JIT/Methodical/Invoke/fptr/recurse_jmp.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'recurse.exe' // MVID: {885F4995-E80A-480B-BB9B-30139BED90E1} .namespace TestCase @@ -64,6 +65,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 72 (0x48) .maxstack 2 diff --git a/src/tests/JIT/Methodical/Invoke/fptr/recurse_jmpi.il b/src/tests/JIT/Methodical/Invoke/fptr/recurse_jmpi.il index ff20c680e17d5f..fe789903ce3cbc 100644 --- a/src/tests/JIT/Methodical/Invoke/fptr/recurse_jmpi.il +++ b/src/tests/JIT/Methodical/Invoke/fptr/recurse_jmpi.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'recurse.exe' // MVID: {885F4995-E80A-480B-BB9B-30139BED90E1} .namespace TestCase @@ -64,6 +65,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 72 (0x48) .maxstack 2 diff --git a/src/tests/JIT/Methodical/Invoke/fptr/recurse_tail_call.il b/src/tests/JIT/Methodical/Invoke/fptr/recurse_tail_call.il index 9a70c58078324b..cb00712b3571ab 100644 --- a/src/tests/JIT/Methodical/Invoke/fptr/recurse_tail_call.il +++ b/src/tests/JIT/Methodical/Invoke/fptr/recurse_tail_call.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'recurse.exe' // MVID: {885F4995-E80A-480B-BB9B-30139BED90E1} .namespace TestCase @@ -65,6 +66,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 72 (0x48) .maxstack 2 diff --git a/src/tests/JIT/Methodical/Invoke/fptr/recurse_tail_calli.il b/src/tests/JIT/Methodical/Invoke/fptr/recurse_tail_calli.il index 7b4eb5ec36f87f..8dd4c5cb7de39f 100644 --- a/src/tests/JIT/Methodical/Invoke/fptr/recurse_tail_calli.il +++ b/src/tests/JIT/Methodical/Invoke/fptr/recurse_tail_calli.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'recurse.exe' // MVID: {885F4995-E80A-480B-BB9B-30139BED90E1} .namespace TestCase @@ -66,6 +67,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 72 (0x48) .maxstack 2 diff --git a/src/tests/JIT/Methodical/Invoke/fptr/valftn.il b/src/tests/JIT/Methodical/Invoke/fptr/valftn.il index 31a3ff63fe85bd..d756cc665ab518 100644 --- a/src/tests/JIT/Methodical/Invoke/fptr/valftn.il +++ b/src/tests/JIT/Methodical/Invoke/fptr/valftn.il @@ -10,6 +10,7 @@ .assembly 'bug' { } +.assembly extern xunit.core {} .module 'bug.exe' // MVID: {90803FD0-8E18-44C9-A242-98463ADD450D} .namespace JitTest @@ -49,6 +50,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 .locals (int32 V_0, value class JitTest.Test v) diff --git a/src/tests/JIT/Methodical/Invoke/fptr/valftn_t.il b/src/tests/JIT/Methodical/Invoke/fptr/valftn_t.il index eff2839dfce87b..7414bfac01a3e9 100644 --- a/src/tests/JIT/Methodical/Invoke/fptr/valftn_t.il +++ b/src/tests/JIT/Methodical/Invoke/fptr/valftn_t.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'bug.exe' // MVID: {90803FD0-8E18-44C9-A242-98463ADD450D} .namespace JitTest @@ -81,6 +82,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 ldftn int32 JitTest.Test::TestMain() diff --git a/src/tests/JIT/Methodical/Invoke/fptr/virtftn.il b/src/tests/JIT/Methodical/Invoke/fptr/virtftn.il index 208fa5a4145f7d..018a62e7b6199f 100644 --- a/src/tests/JIT/Methodical/Invoke/fptr/virtftn.il +++ b/src/tests/JIT/Methodical/Invoke/fptr/virtftn.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'bug.exe' // MVID: {90803FD0-8E18-44C9-A242-98463ADD450D} .namespace JitTest @@ -57,6 +58,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (class JitTest.Test, int32) diff --git a/src/tests/JIT/Methodical/Invoke/fptr/virtftn_t.il b/src/tests/JIT/Methodical/Invoke/fptr/virtftn_t.il index 7f170955b3e725..d77634e909749c 100644 --- a/src/tests/JIT/Methodical/Invoke/fptr/virtftn_t.il +++ b/src/tests/JIT/Methodical/Invoke/fptr/virtftn_t.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'bug.exe' // MVID: {90803FD0-8E18-44C9-A242-98463ADD450D} .namespace JitTest @@ -83,6 +84,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 ldftn int32 JitTest.Test::TestMain() diff --git a/src/tests/JIT/Methodical/Invoke/implicit/fr4.il b/src/tests/JIT/Methodical/Invoke/implicit/fr4.il index 6641a08152ed58..2a10a0ac4855bf 100644 --- a/src/tests/JIT/Methodical/Invoke/implicit/fr4.il +++ b/src/tests/JIT/Methodical/Invoke/implicit/fr4.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'fr4.exe' // MVID: {B1A03CB5-0762-4E9F-BA39-E5C10C9A69AE} .namespace JitTest @@ -59,6 +60,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 58 (0x3a) .maxstack 4 diff --git a/src/tests/JIT/Methodical/Invoke/implicit/fr8.il b/src/tests/JIT/Methodical/Invoke/implicit/fr8.il index c87fc8bd7f8d92..8dc075caf660b4 100644 --- a/src/tests/JIT/Methodical/Invoke/implicit/fr8.il +++ b/src/tests/JIT/Methodical/Invoke/implicit/fr8.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'fr4.exe' // MVID: {B1A03CB5-0762-4E9F-BA39-E5C10C9A69AE} .namespace JitTest @@ -59,6 +60,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 58 (0x3a) .maxstack 4 diff --git a/src/tests/JIT/Methodical/Invoke/implicit/i4i1.il b/src/tests/JIT/Methodical/Invoke/implicit/i4i1.il index cfcb81f9250859..3ced4ea671e388 100644 --- a/src/tests/JIT/Methodical/Invoke/implicit/i4i1.il +++ b/src/tests/JIT/Methodical/Invoke/implicit/i4i1.il @@ -23,6 +23,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace TestCase { @@ -83,6 +84,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/Invoke/implicit/i4i2.il b/src/tests/JIT/Methodical/Invoke/implicit/i4i2.il index e72bf3cb1135ed..2ce13c45b89e89 100644 --- a/src/tests/JIT/Methodical/Invoke/implicit/i4i2.il +++ b/src/tests/JIT/Methodical/Invoke/implicit/i4i2.il @@ -23,6 +23,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace TestCase { @@ -83,6 +84,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/Invoke/implicit/i4u1.il b/src/tests/JIT/Methodical/Invoke/implicit/i4u1.il index 276253ba136a1e..65cec42a9d991b 100644 --- a/src/tests/JIT/Methodical/Invoke/implicit/i4u1.il +++ b/src/tests/JIT/Methodical/Invoke/implicit/i4u1.il @@ -23,6 +23,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace TestCase { @@ -77,6 +78,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/Invoke/implicit/i4u2.il b/src/tests/JIT/Methodical/Invoke/implicit/i4u2.il index fb6555c01082ce..2b971f04c488f4 100644 --- a/src/tests/JIT/Methodical/Invoke/implicit/i4u2.il +++ b/src/tests/JIT/Methodical/Invoke/implicit/i4u2.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' // MVID: {37F05BF1-E8CC-42FA-A268-D866F07CFFF8} .namespace TestCase @@ -60,6 +61,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 39 (0x27) .maxstack 2 diff --git a/src/tests/JIT/Methodical/Invoke/implicit/i4u4.il b/src/tests/JIT/Methodical/Invoke/implicit/i4u4.il index 56e3af4b4ceb9e..5b3704c291bd4a 100644 --- a/src/tests/JIT/Methodical/Invoke/implicit/i4u4.il +++ b/src/tests/JIT/Methodical/Invoke/implicit/i4u4.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' // MVID: {B4ADAE94-5F38-493D-A41E-0ED51F697371} .namespace TestCase @@ -60,6 +61,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 40 (0x28) .maxstack 2 diff --git a/src/tests/JIT/Methodical/Invoke/implicit/i8u8.il b/src/tests/JIT/Methodical/Invoke/implicit/i8u8.il index 9448aab078013a..37688fc9e38d15 100644 --- a/src/tests/JIT/Methodical/Invoke/implicit/i8u8.il +++ b/src/tests/JIT/Methodical/Invoke/implicit/i8u8.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' // MVID: {FBE787B7-6007-478A-AA78-9465C2020C0C} .namespace TestCase @@ -60,6 +61,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 42 (0x2a) .maxstack 2 diff --git a/src/tests/JIT/Methodical/Invoke/implicit/ii1.il b/src/tests/JIT/Methodical/Invoke/implicit/ii1.il index f8680f0f11d5fe..29aacf4c500387 100644 --- a/src/tests/JIT/Methodical/Invoke/implicit/ii1.il +++ b/src/tests/JIT/Methodical/Invoke/implicit/ii1.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' // MVID: {37F05BF1-E8CC-42FA-A268-D866F07CFFF8} .namespace TestCase @@ -81,6 +82,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 39 (0x27) .maxstack 2 diff --git a/src/tests/JIT/Methodical/Invoke/implicit/ii2.il b/src/tests/JIT/Methodical/Invoke/implicit/ii2.il index 7e2a9f753b600a..5fa3c40232d33c 100644 --- a/src/tests/JIT/Methodical/Invoke/implicit/ii2.il +++ b/src/tests/JIT/Methodical/Invoke/implicit/ii2.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' // MVID: {37F05BF1-E8CC-42FA-A268-D866F07CFFF8} .namespace TestCase @@ -81,6 +82,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 39 (0x27) .maxstack 2 diff --git a/src/tests/JIT/Methodical/Invoke/implicit/ii4.il b/src/tests/JIT/Methodical/Invoke/implicit/ii4.il index 2f940d44efe374..e8097341616204 100644 --- a/src/tests/JIT/Methodical/Invoke/implicit/ii4.il +++ b/src/tests/JIT/Methodical/Invoke/implicit/ii4.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' // MVID: {B4ADAE94-5F38-493D-A41E-0ED51F697371} .namespace TestCase @@ -69,6 +70,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 40 (0x28) .maxstack 2 diff --git a/src/tests/JIT/Methodical/Invoke/implicit/iu1.il b/src/tests/JIT/Methodical/Invoke/implicit/iu1.il index fd6dc0711df309..11151237391b49 100644 --- a/src/tests/JIT/Methodical/Invoke/implicit/iu1.il +++ b/src/tests/JIT/Methodical/Invoke/implicit/iu1.il @@ -23,6 +23,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace TestCase { @@ -78,6 +79,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/Invoke/implicit/iu2.il b/src/tests/JIT/Methodical/Invoke/implicit/iu2.il index 9c4b9dbbd5c0e7..b6a389343ef922 100644 --- a/src/tests/JIT/Methodical/Invoke/implicit/iu2.il +++ b/src/tests/JIT/Methodical/Invoke/implicit/iu2.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' // MVID: {37F05BF1-E8CC-42FA-A268-D866F07CFFF8} .namespace TestCase @@ -60,6 +61,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 39 (0x27) .maxstack 3 diff --git a/src/tests/JIT/Methodical/Invoke/implicit/iu4.il b/src/tests/JIT/Methodical/Invoke/implicit/iu4.il index 052d29768ea3f9..610c9c9c8f99f3 100644 --- a/src/tests/JIT/Methodical/Invoke/implicit/iu4.il +++ b/src/tests/JIT/Methodical/Invoke/implicit/iu4.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' // MVID: {B4ADAE94-5F38-493D-A41E-0ED51F697371} .namespace TestCase @@ -60,6 +61,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 40 (0x28) .maxstack 2 diff --git a/src/tests/JIT/Methodical/Invoke/implicit/objref.il b/src/tests/JIT/Methodical/Invoke/implicit/objref.il index dbf7ae9a00f2a4..2a5d5b0a762dd5 100644 --- a/src/tests/JIT/Methodical/Invoke/implicit/objref.il +++ b/src/tests/JIT/Methodical/Invoke/implicit/objref.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'objref.exe' // MVID: {4F6CDA4F-13A9-40C8-ADF8-98FBBEF21260} .namespace JitTest @@ -90,6 +91,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 59 (0x3b) .maxstack 1 diff --git a/src/tests/JIT/Methodical/Invoke/thiscall/thisnull.il b/src/tests/JIT/Methodical/Invoke/thiscall/thisnull.il index 397ab8af4369b6..56dccef0ca7c7d 100644 --- a/src/tests/JIT/Methodical/Invoke/thiscall/thisnull.il +++ b/src/tests/JIT/Methodical/Invoke/thiscall/thisnull.il @@ -10,6 +10,7 @@ .assembly thisnull { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit App @@ -63,6 +64,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 95 (0x5f) .maxstack 2 diff --git a/src/tests/JIT/Methodical/NaN/comp32.il b/src/tests/JIT/Methodical/NaN/comp32.il index b0681058e194cf..65dbd9908b4482 100644 --- a/src/tests/JIT/Methodical/NaN/comp32.il +++ b/src/tests/JIT/Methodical/NaN/comp32.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly comp32 { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test extends [mscorlib]System.Object { @@ -663,6 +664,9 @@ IL_THROW: .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/NaN/comp64.il b/src/tests/JIT/Methodical/NaN/comp64.il index 0b8ba6ca955608..af41601192f9ba 100644 --- a/src/tests/JIT/Methodical/NaN/comp64.il +++ b/src/tests/JIT/Methodical/NaN/comp64.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly comp64 { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test extends [mscorlib]System.Object { @@ -663,6 +664,9 @@ IL_THROW: .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/NaN/cond32.il b/src/tests/JIT/Methodical/NaN/cond32.il index f616fa64be5b35..31c83a19acb883 100644 --- a/src/tests/JIT/Methodical/NaN/cond32.il +++ b/src/tests/JIT/Methodical/NaN/cond32.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly cond32 { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test extends [mscorlib]System.Object { @@ -1303,6 +1304,9 @@ IL_THROW: .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/NaN/cond64.il b/src/tests/JIT/Methodical/NaN/cond64.il index af3783d38adcce..8b477637b4cc8e 100644 --- a/src/tests/JIT/Methodical/NaN/cond64.il +++ b/src/tests/JIT/Methodical/NaN/cond64.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly cond64 { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test extends [mscorlib]System.Object { @@ -1303,6 +1304,9 @@ IL_THROW: .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/NaN/intrinsic_nonf.il b/src/tests/JIT/Methodical/NaN/intrinsic_nonf.il index 49f060b39a52cc..df881f9ed3292b 100644 --- a/src/tests/JIT/Methodical/NaN/intrinsic_nonf.il +++ b/src/tests/JIT/Methodical/NaN/intrinsic_nonf.il @@ -15,6 +15,7 @@ .assembly intrinsic_nonf { } +.assembly extern xunit.core {} .module NaN.exe @@ -2493,6 +2494,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals (class [mscorlib]System.Exception V_0, diff --git a/src/tests/JIT/Methodical/NaN/r4NaNconv.il b/src/tests/JIT/Methodical/NaN/r4NaNconv.il index 7700250ba012be..21c6368b9b488a 100644 --- a/src/tests/JIT/Methodical/NaN/r4NaNconv.il +++ b/src/tests/JIT/Methodical/NaN/r4NaNconv.il @@ -11,6 +11,7 @@ { } .assembly conv {} +.assembly extern xunit.core {} .module conv.exe .class private auto ansi beforefieldinit ConvTest extends [mscorlib]System.Object @@ -412,6 +413,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 50 .locals init ([0] bool passed ) diff --git a/src/tests/JIT/Methodical/NaN/r8NaNconv.il b/src/tests/JIT/Methodical/NaN/r8NaNconv.il index 44281937905965..bf9430d987d2c0 100644 --- a/src/tests/JIT/Methodical/NaN/r8NaNconv.il +++ b/src/tests/JIT/Methodical/NaN/r8NaNconv.il @@ -11,6 +11,7 @@ { } .assembly conv {} +.assembly extern xunit.core {} .module conv.exe .class private auto ansi beforefieldinit ConvTest extends [mscorlib]System.Object @@ -412,6 +413,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 50 .locals init ([0] bool passed ) diff --git a/src/tests/JIT/Methodical/VT/callconv/aa.il b/src/tests/JIT/Methodical/VT/callconv/aa.il index ea859c6a501716..3ec1cee11f2164 100644 --- a/src/tests/JIT/Methodical/VT/callconv/aa.il +++ b/src/tests/JIT/Methodical/VT/callconv/aa.il @@ -15,6 +15,7 @@ } +.assembly extern xunit.core {} .module call.exe // MVID: {CF1D567F-C985-45B8-8028-219BDC43D791} .namespace JitTest @@ -249,6 +250,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 227 (0xe3) .maxstack 4 diff --git a/src/tests/JIT/Methodical/VT/callconv/calli.il b/src/tests/JIT/Methodical/VT/callconv/calli.il index 04139e9120c589..f78899d8c988de 100644 --- a/src/tests/JIT/Methodical/VT/callconv/calli.il +++ b/src/tests/JIT/Methodical/VT/callconv/calli.il @@ -15,6 +15,7 @@ .assembly 'call' // as "call" { } +.assembly extern xunit.core {} .module call.exe // MVID: {CF1D567F-C985-45B8-8028-219BDC43D791} .namespace JitTest @@ -259,6 +260,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 227 (0xe3) .maxstack 8 diff --git a/src/tests/JIT/Methodical/VT/callconv/dd.il b/src/tests/JIT/Methodical/VT/callconv/dd.il index 90ad4d5bea9f36..d490d61986152f 100644 --- a/src/tests/JIT/Methodical/VT/callconv/dd.il +++ b/src/tests/JIT/Methodical/VT/callconv/dd.il @@ -15,6 +15,7 @@ .assembly 'call' // as "call" { } +.assembly extern xunit.core {} .module call.exe // MVID: {CF1D567F-C985-45B8-8028-219BDC43D791} .namespace JitTest @@ -249,6 +250,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 227 (0xe3) .maxstack 4 diff --git a/src/tests/JIT/Methodical/VT/callconv/ee.il b/src/tests/JIT/Methodical/VT/callconv/ee.il index 8b63740e2d02a1..6e301f8c955416 100644 --- a/src/tests/JIT/Methodical/VT/callconv/ee.il +++ b/src/tests/JIT/Methodical/VT/callconv/ee.il @@ -15,6 +15,7 @@ .assembly 'call' // as "call" { } +.assembly extern xunit.core {} .module call.exe // MVID: {CF1D567F-C985-45B8-8028-219BDC43D791} .namespace JitTest @@ -249,6 +250,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 227 (0xe3) .maxstack 4 diff --git a/src/tests/JIT/Methodical/VT/callconv/jumper1.il b/src/tests/JIT/Methodical/VT/callconv/jumper1.il index d5d327de598155..d3957e4ed879cc 100644 --- a/src/tests/JIT/Methodical/VT/callconv/jumper1.il +++ b/src/tests/JIT/Methodical/VT/callconv/jumper1.il @@ -15,6 +15,7 @@ .assembly jumper // as "jumper" { } +.assembly extern xunit.core {} .module jumper.exe // MVID: {2E4A2D77-5614-4325-A9DC-CBB90842669E} .namespace MS @@ -76,6 +77,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 96 (0x60) .maxstack 2 diff --git a/src/tests/JIT/Methodical/VT/callconv/jumper2.il b/src/tests/JIT/Methodical/VT/callconv/jumper2.il index 84a07e1bc9549b..4f456278cf3bbb 100644 --- a/src/tests/JIT/Methodical/VT/callconv/jumper2.il +++ b/src/tests/JIT/Methodical/VT/callconv/jumper2.il @@ -15,6 +15,7 @@ .assembly jumper // as "jumper" { } +.assembly extern xunit.core {} .module jumper.exe // MVID: {2E4A2D77-5614-4325-A9DC-CBB90842669E} .namespace MS @@ -75,6 +76,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 96 (0x60) .maxstack 2 diff --git a/src/tests/JIT/Methodical/VT/callconv/jumper3.il b/src/tests/JIT/Methodical/VT/callconv/jumper3.il index 4d348e90cff2b5..e443da783f300c 100644 --- a/src/tests/JIT/Methodical/VT/callconv/jumper3.il +++ b/src/tests/JIT/Methodical/VT/callconv/jumper3.il @@ -20,6 +20,7 @@ } +.assembly extern xunit.core {} .module jumper.exe // MVID: {2E4A2D77-5614-4325-A9DC-CBB90842669E} .namespace MS @@ -81,6 +82,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 96 (0x60) .maxstack 2 diff --git a/src/tests/JIT/Methodical/VT/callconv/jumper4.il b/src/tests/JIT/Methodical/VT/callconv/jumper4.il index 9842d163e84441..db4719d1d28d4a 100644 --- a/src/tests/JIT/Methodical/VT/callconv/jumper4.il +++ b/src/tests/JIT/Methodical/VT/callconv/jumper4.il @@ -17,6 +17,7 @@ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } +.assembly extern xunit.core {} .module jumper.exe // MVID: {2E4A2D77-5614-4325-A9DC-CBB90842669E} .namespace MS @@ -74,6 +75,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 96 (0x60) .maxstack 2 diff --git a/src/tests/JIT/Methodical/VT/callconv/jumper5.il b/src/tests/JIT/Methodical/VT/callconv/jumper5.il index 584b4ef6500fef..3923314d3143c7 100644 --- a/src/tests/JIT/Methodical/VT/callconv/jumper5.il +++ b/src/tests/JIT/Methodical/VT/callconv/jumper5.il @@ -17,6 +17,7 @@ //This byte field requests that this assembly not be verified at run time and corresponds to this C# declaration: //[assembly:System.Security.Permissions.SecurityPermissionAttribute( [mscorlib]System.Security.Permissions.SecurityAction.RequestMinimum, Flags=System.Security.Permissions.SecurityPermissionFlag.SkipVerification )] } +.assembly extern xunit.core {} .module jumper.exe // MVID: {2E4A2D77-5614-4325-A9DC-CBB90842669E} .namespace MS @@ -79,6 +80,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 96 (0x60) .maxstack 2 diff --git a/src/tests/JIT/Methodical/VT/callconv/jumps1.il b/src/tests/JIT/Methodical/VT/callconv/jumps1.il index 49e792d589da09..dac997a6ddcf2f 100644 --- a/src/tests/JIT/Methodical/VT/callconv/jumps1.il +++ b/src/tests/JIT/Methodical/VT/callconv/jumps1.il @@ -18,6 +18,7 @@ .assembly jumps // as "jumps" { } +.assembly extern xunit.core {} .module jumps.exe .namespace MS { @@ -265,6 +266,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0, diff --git a/src/tests/JIT/Methodical/VT/callconv/jumps2.il b/src/tests/JIT/Methodical/VT/callconv/jumps2.il index 9660d6216e58e2..73d7cc40cc2691 100644 --- a/src/tests/JIT/Methodical/VT/callconv/jumps2.il +++ b/src/tests/JIT/Methodical/VT/callconv/jumps2.il @@ -19,6 +19,7 @@ .assembly jumps // as "jumps" { } +.assembly extern xunit.core {} .module jumps.exe .namespace MS { @@ -270,6 +271,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0, diff --git a/src/tests/JIT/Methodical/VT/callconv/jumps3.il b/src/tests/JIT/Methodical/VT/callconv/jumps3.il index 37c4ad83a3d553..e9eea06fd4e829 100644 --- a/src/tests/JIT/Methodical/VT/callconv/jumps3.il +++ b/src/tests/JIT/Methodical/VT/callconv/jumps3.il @@ -18,6 +18,7 @@ .assembly jumps // as "jumps" { } +.assembly extern xunit.core {} .module jumps.exe .namespace MS { @@ -273,6 +274,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0, diff --git a/src/tests/JIT/Methodical/VT/callconv/jumps4.il b/src/tests/JIT/Methodical/VT/callconv/jumps4.il index bc115f8f79fbc1..e32e12f23283b5 100644 --- a/src/tests/JIT/Methodical/VT/callconv/jumps4.il +++ b/src/tests/JIT/Methodical/VT/callconv/jumps4.il @@ -13,6 +13,7 @@ .assembly jumps // as "jumps" { } +.assembly extern xunit.core {} .module jumps.exe .namespace MS { @@ -282,6 +283,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0, diff --git a/src/tests/JIT/Methodical/VT/callconv/jumps5.il b/src/tests/JIT/Methodical/VT/callconv/jumps5.il index 60d7ae9be8ffcf..6138454e24b114 100644 --- a/src/tests/JIT/Methodical/VT/callconv/jumps5.il +++ b/src/tests/JIT/Methodical/VT/callconv/jumps5.il @@ -19,6 +19,7 @@ { } +.assembly extern xunit.core {} .module jumps.exe .namespace MS { @@ -267,6 +268,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0, diff --git a/src/tests/JIT/Methodical/VT/callconv/vtret.il b/src/tests/JIT/Methodical/VT/callconv/vtret.il index 5a67d027fa2448..20236f655d3241 100644 --- a/src/tests/JIT/Methodical/VT/callconv/vtret.il +++ b/src/tests/JIT/Methodical/VT/callconv/vtret.il @@ -15,6 +15,7 @@ .assembly vtret // as "vtret" { } +.assembly extern xunit.core {} .module vtret.exe // MVID: {DAD31C3D-EF49-47EA-945E-72055ACE0D58} .namespace MS @@ -76,6 +77,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 46 (0x2e) .maxstack 2 diff --git a/src/tests/JIT/Methodical/VT/callconv/vtret2.il b/src/tests/JIT/Methodical/VT/callconv/vtret2.il index 850551a7e7d63f..bf13e8fb7561db 100644 --- a/src/tests/JIT/Methodical/VT/callconv/vtret2.il +++ b/src/tests/JIT/Methodical/VT/callconv/vtret2.il @@ -15,6 +15,7 @@ .assembly vtret // as "vtret" { } +.assembly extern xunit.core {} .module vtret.exe // MVID: {DAD31C3D-EF49-47EA-945E-72055ACE0D58} .namespace MS @@ -77,6 +78,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 46 (0x2e) .maxstack 2 diff --git a/src/tests/JIT/Methodical/VT/etc/han3.il b/src/tests/JIT/Methodical/VT/etc/han3.il index 6fe3e31458f0ff..495f0193da9625 100644 --- a/src/tests/JIT/Methodical/VT/etc/han3.il +++ b/src/tests/JIT/Methodical/VT/etc/han3.il @@ -12,6 +12,7 @@ .assembly han3 // as "han3" { } +.assembly extern xunit.core {} .module han3.exe .namespace JitTest { @@ -238,6 +239,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (value class JitTest.Column V_X) diff --git a/src/tests/JIT/Methodical/VT/etc/han3_ctor.il b/src/tests/JIT/Methodical/VT/etc/han3_ctor.il index 66b0704658f867..a2260a3965f38c 100644 --- a/src/tests/JIT/Methodical/VT/etc/han3_ctor.il +++ b/src/tests/JIT/Methodical/VT/etc/han3_ctor.il @@ -12,6 +12,7 @@ .assembly han3_ctor // as "han3_ctor" { } +.assembly extern xunit.core {} .module han3_ctor.exe .namespace JitTest { @@ -239,6 +240,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 ldc.i4.s 17 diff --git a/src/tests/JIT/Methodical/VT/etc/han3_ref.il b/src/tests/JIT/Methodical/VT/etc/han3_ref.il index de302e1612d3eb..44ee15e87938ec 100644 --- a/src/tests/JIT/Methodical/VT/etc/han3_ref.il +++ b/src/tests/JIT/Methodical/VT/etc/han3_ref.il @@ -12,6 +12,7 @@ .assembly han3_ref // as "han3_ref" { } +.assembly extern xunit.core {} .module han3_ref.exe .namespace JitTest { @@ -244,6 +245,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (value class JitTest.Column V_0, diff --git a/src/tests/JIT/Methodical/VT/etc/hanoi.il b/src/tests/JIT/Methodical/VT/etc/hanoi.il index 10024d2d22f0ad..3dfca631e9b0ba 100644 --- a/src/tests/JIT/Methodical/VT/etc/hanoi.il +++ b/src/tests/JIT/Methodical/VT/etc/hanoi.il @@ -12,6 +12,7 @@ .assembly hanoi // as "hanoi" { } +.assembly extern xunit.core {} .module hanoi.exe .namespace JitTest { @@ -206,6 +207,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .zeroinit diff --git a/src/tests/JIT/Methodical/VT/etc/hanoi2.il b/src/tests/JIT/Methodical/VT/etc/hanoi2.il index ac1d3acfca2f8c..a721786ac79569 100644 --- a/src/tests/JIT/Methodical/VT/etc/hanoi2.il +++ b/src/tests/JIT/Methodical/VT/etc/hanoi2.il @@ -12,6 +12,7 @@ .assembly hanoi // as "hanoi" { } +.assembly extern xunit.core {} .module hanoi.exe .namespace JitTest { @@ -196,6 +197,9 @@ IL_001d: .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32 V_0, diff --git a/src/tests/JIT/Methodical/VT/etc/knight.il b/src/tests/JIT/Methodical/VT/etc/knight.il index 9e7d3b05d2802a..bc3688ce93ea66 100644 --- a/src/tests/JIT/Methodical/VT/etc/knight.il +++ b/src/tests/JIT/Methodical/VT/etc/knight.il @@ -15,6 +15,7 @@ .assembly knight { } +.assembly extern xunit.core {} .module knight.exe .file alignment 512 @@ -36,6 +37,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (valuetype KnightMove.SQ[0...,0...] V_0, diff --git a/src/tests/JIT/Methodical/VT/etc/nested.il b/src/tests/JIT/Methodical/VT/etc/nested.il index 21e07002170002..fd969c844de563 100644 --- a/src/tests/JIT/Methodical/VT/etc/nested.il +++ b/src/tests/JIT/Methodical/VT/etc/nested.il @@ -11,6 +11,7 @@ .assembly 'nested' // as "nested" { } +.assembly extern xunit.core {} .module nested.exe .namespace JitTest { @@ -78,6 +79,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (value class JitTest.Struct1 V_0, diff --git a/src/tests/JIT/Methodical/VT/identity/accum.il b/src/tests/JIT/Methodical/VT/identity/accum.il index 2c6c239629bed6..98a9eca7a46010 100644 --- a/src/tests/JIT/Methodical/VT/identity/accum.il +++ b/src/tests/JIT/Methodical/VT/identity/accum.il @@ -15,6 +15,7 @@ .assembly accum // as "accum" { } +.assembly extern xunit.core {} .module accum.exe // MVID: {2D7E75FB-9B3C-4E6C-BB98-C8ADCFF67713} .namespace JitTest @@ -52,6 +53,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 27 (0x1b) .maxstack 8 diff --git a/src/tests/JIT/Methodical/VT/identity/livecall.il b/src/tests/JIT/Methodical/VT/identity/livecall.il index 32cbd13d3b958a..559ceaacfc4fd9 100644 --- a/src/tests/JIT/Methodical/VT/identity/livecall.il +++ b/src/tests/JIT/Methodical/VT/identity/livecall.il @@ -15,6 +15,7 @@ .assembly livecall // as "livecall" { } +.assembly extern xunit.core {} .module livecall.exe // MVID: {6300FB9B-B24E-45DA-9A61-2556746FEEEF} .namespace MS @@ -37,6 +38,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 74 (0x4a) .maxstack 2 diff --git a/src/tests/JIT/Methodical/VT/identity/volatile.il b/src/tests/JIT/Methodical/VT/identity/volatile.il index 77733154d6b973..8099d912e8ee2e 100644 --- a/src/tests/JIT/Methodical/VT/identity/volatile.il +++ b/src/tests/JIT/Methodical/VT/identity/volatile.il @@ -14,6 +14,7 @@ .assembly bug // // as "bug" { } +.assembly extern xunit.core {} .module bug.exe // MVID: {A29CDE84-6701-43B3-B56A-DE8480CE7421} .namespace JitTest @@ -23,6 +24,9 @@ .field public int32 m_n .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (value class JitTest.VT src, value class JitTest.VT dst) diff --git a/src/tests/JIT/Methodical/VT/port/huge_gcref.il b/src/tests/JIT/Methodical/VT/port/huge_gcref.il index 6c61d339225a4a..77e6a6b1af3752 100644 --- a/src/tests/JIT/Methodical/VT/port/huge_gcref.il +++ b/src/tests/JIT/Methodical/VT/port/huge_gcref.il @@ -24,6 +24,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' .namespace JitTest { @@ -42,6 +43,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 70 .locals (value class JitTest.TestStruct[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,] matrix, diff --git a/src/tests/JIT/Methodical/acceptance/Boxing/boxing001.il b/src/tests/JIT/Methodical/acceptance/Boxing/boxing001.il index 060cc95600d46e..43244b9f09a209 100644 --- a/src/tests/JIT/Methodical/acceptance/Boxing/boxing001.il +++ b/src/tests/JIT/Methodical/acceptance/Boxing/boxing001.il @@ -12,6 +12,7 @@ .assembly boxing001 { } +.assembly extern xunit.core {} .class private sequential ansi sealed beforefieldinit V extends [mscorlib] System.ValueType { @@ -48,6 +49,9 @@ .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals (int32 V_0, object V1, diff --git a/src/tests/JIT/Methodical/casts/SEH/castclass_catch.il b/src/tests/JIT/Methodical/casts/SEH/castclass_catch.il index c81110d3b92f11..6b0430c73f3c11 100644 --- a/src/tests/JIT/Methodical/casts/SEH/castclass_catch.il +++ b/src/tests/JIT/Methodical/casts/SEH/castclass_catch.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly castclass_catch { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -16,6 +17,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals (int32 V_0, diff --git a/src/tests/JIT/Methodical/casts/SEH/castclass_catch_neg.il b/src/tests/JIT/Methodical/casts/SEH/castclass_catch_neg.il index 58aa67324cfee5..250242d3fb351a 100644 --- a/src/tests/JIT/Methodical/casts/SEH/castclass_catch_neg.il +++ b/src/tests/JIT/Methodical/casts/SEH/castclass_catch_neg.il @@ -9,6 +9,7 @@ .ver 4:0:0:0 } .assembly castclass_catch_neg { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -17,6 +18,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals (int32 V_0, diff --git a/src/tests/JIT/Methodical/casts/SEH/isinst_catch.il b/src/tests/JIT/Methodical/casts/SEH/isinst_catch.il index b7a06f309a52bc..78952e9bd8a319 100644 --- a/src/tests/JIT/Methodical/casts/SEH/isinst_catch.il +++ b/src/tests/JIT/Methodical/casts/SEH/isinst_catch.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly isinst_catch { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -16,6 +17,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals (int32 V_0, diff --git a/src/tests/JIT/Methodical/casts/SEH/isinst_catch_neg.il b/src/tests/JIT/Methodical/casts/SEH/isinst_catch_neg.il index e7b215628e78af..dc73c21fe561f7 100644 --- a/src/tests/JIT/Methodical/casts/SEH/isinst_catch_neg.il +++ b/src/tests/JIT/Methodical/casts/SEH/isinst_catch_neg.il @@ -9,6 +9,7 @@ .ver 4:0:0:0 } .assembly isinst_catch_neg { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -17,6 +18,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals (int32 V_0, diff --git a/src/tests/JIT/Methodical/casts/array/castclass_ldlen.il b/src/tests/JIT/Methodical/casts/array/castclass_ldlen.il index df5abf3a4fc1a8..1532e2ab80bf99 100644 --- a/src/tests/JIT/Methodical/casts/array/castclass_ldlen.il +++ b/src/tests/JIT/Methodical/casts/array/castclass_ldlen.il @@ -13,6 +13,7 @@ } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -21,6 +22,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (class [mscorlib]System.Array) diff --git a/src/tests/JIT/Methodical/casts/array/isinst_ldlen.il b/src/tests/JIT/Methodical/casts/array/isinst_ldlen.il index e0357fdd689c1f..bb0dc6ed65c3e1 100644 --- a/src/tests/JIT/Methodical/casts/array/isinst_ldlen.il +++ b/src/tests/JIT/Methodical/casts/array/isinst_ldlen.il @@ -13,6 +13,7 @@ } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -21,6 +22,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (class [mscorlib]System.Array) diff --git a/src/tests/JIT/Methodical/casts/coverage/castclass_call.il b/src/tests/JIT/Methodical/casts/coverage/castclass_call.il index 275e2c837afb51..d93ece5536ed51 100644 --- a/src/tests/JIT/Methodical/casts/coverage/castclass_call.il +++ b/src/tests/JIT/Methodical/casts/coverage/castclass_call.il @@ -10,6 +10,7 @@ .assembly castclass_call { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit BaseClass @@ -128,6 +129,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 134 (0x86) .maxstack 3 diff --git a/src/tests/JIT/Methodical/casts/coverage/castclass_calli.il b/src/tests/JIT/Methodical/casts/coverage/castclass_calli.il index d636037058b265..6609d22c4763e7 100644 --- a/src/tests/JIT/Methodical/casts/coverage/castclass_calli.il +++ b/src/tests/JIT/Methodical/casts/coverage/castclass_calli.il @@ -10,6 +10,7 @@ .assembly castclass_calli { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit BaseClass @@ -133,6 +134,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 134 (0x86) .maxstack 3 diff --git a/src/tests/JIT/Methodical/casts/coverage/castclass_ldarg.il b/src/tests/JIT/Methodical/casts/coverage/castclass_ldarg.il index a7f489916ae0e3..4f4ec337aa3ce5 100644 --- a/src/tests/JIT/Methodical/casts/coverage/castclass_ldarg.il +++ b/src/tests/JIT/Methodical/casts/coverage/castclass_ldarg.il @@ -10,6 +10,7 @@ .assembly castclass_ldarg { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit BaseClass @@ -89,6 +90,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 139 (0x8b) .maxstack 2 diff --git a/src/tests/JIT/Methodical/casts/coverage/castclass_ldloc.il b/src/tests/JIT/Methodical/casts/coverage/castclass_ldloc.il index 29e232a7ddb33d..3da9e4d7edde5f 100644 --- a/src/tests/JIT/Methodical/casts/coverage/castclass_ldloc.il +++ b/src/tests/JIT/Methodical/casts/coverage/castclass_ldloc.il @@ -10,6 +10,7 @@ .assembly castclass_ldloc { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit BaseClass @@ -92,6 +93,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 139 (0x8b) .maxstack 2 diff --git a/src/tests/JIT/Methodical/casts/coverage/isinst_call.il b/src/tests/JIT/Methodical/casts/coverage/isinst_call.il index 57ad39ff60d0f4..ccb1b7c7ea8b85 100644 --- a/src/tests/JIT/Methodical/casts/coverage/isinst_call.il +++ b/src/tests/JIT/Methodical/casts/coverage/isinst_call.il @@ -10,6 +10,7 @@ .assembly isinst_call { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit BaseClass @@ -113,6 +114,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 123 (0x7b) .maxstack 2 diff --git a/src/tests/JIT/Methodical/casts/coverage/isinst_calli.il b/src/tests/JIT/Methodical/casts/coverage/isinst_calli.il index 6b2461d2bb305a..18e56ffae9d554 100644 --- a/src/tests/JIT/Methodical/casts/coverage/isinst_calli.il +++ b/src/tests/JIT/Methodical/casts/coverage/isinst_calli.il @@ -10,6 +10,7 @@ .assembly isinst_calli { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit BaseClass @@ -117,6 +118,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 123 (0x7b) .maxstack 2 diff --git a/src/tests/JIT/Methodical/casts/coverage/isinst_ldarg.il b/src/tests/JIT/Methodical/casts/coverage/isinst_ldarg.il index 525c036ee6bd0e..4d9f98d65814d1 100644 --- a/src/tests/JIT/Methodical/casts/coverage/isinst_ldarg.il +++ b/src/tests/JIT/Methodical/casts/coverage/isinst_ldarg.il @@ -10,6 +10,7 @@ .assembly isinst_ldarg { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit BaseClass @@ -79,6 +80,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 139 (0x8b) .maxstack 2 diff --git a/src/tests/JIT/Methodical/casts/coverage/isinst_ldloc.il b/src/tests/JIT/Methodical/casts/coverage/isinst_ldloc.il index f7952cc5925911..d9f9338f77aa2c 100644 --- a/src/tests/JIT/Methodical/casts/coverage/isinst_ldloc.il +++ b/src/tests/JIT/Methodical/casts/coverage/isinst_ldloc.il @@ -10,6 +10,7 @@ .assembly isinst_ldloc { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit BaseClass @@ -82,6 +83,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 139 (0x8b) .maxstack 2 diff --git a/src/tests/JIT/Methodical/casts/coverage/ldnull.il b/src/tests/JIT/Methodical/casts/coverage/ldnull.il index 47ae0e127c1b16..930858a953909e 100644 --- a/src/tests/JIT/Methodical/casts/coverage/ldnull.il +++ b/src/tests/JIT/Methodical/casts/coverage/ldnull.il @@ -10,6 +10,7 @@ .assembly 'ldnull' { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit TestClass @@ -18,6 +19,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 36 (0x24) .maxstack 2 diff --git a/src/tests/JIT/Methodical/casts/iface/iface2.il b/src/tests/JIT/Methodical/casts/iface/iface2.il index 5fbe95196c164c..8cac136a5335e6 100644 --- a/src/tests/JIT/Methodical/casts/iface/iface2.il +++ b/src/tests/JIT/Methodical/casts/iface/iface2.il @@ -9,6 +9,7 @@ .ver 4:0:0:0 } .assembly iface2 { } +.assembly extern xunit.core {} .namespace JitTest { .class interface private abstract auto ansi Iface1 @@ -208,6 +209,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals ([0] class JitTest.CoClass co, diff --git a/src/tests/JIT/Methodical/cctor/misc/deadlock.il b/src/tests/JIT/Methodical/cctor/misc/deadlock.il index fb37cc09b69bbc..d3b6e4bc2468f0 100644 --- a/src/tests/JIT/Methodical/cctor/misc/deadlock.il +++ b/src/tests/JIT/Methodical/cctor/misc/deadlock.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly deadlock {} +.assembly extern xunit.core {} .class public A extends [mscorlib]System.Object { .field static public class A a @@ -38,6 +39,9 @@ ret .method public static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint ldsfld class B A::b pop diff --git a/src/tests/JIT/Methodical/cctor/simple/Desktop/prefldinit3.il b/src/tests/JIT/Methodical/cctor/simple/Desktop/prefldinit3.il index f9a6986491b476..dd9b407605d34b 100644 --- a/src/tests/JIT/Methodical/cctor/simple/Desktop/prefldinit3.il +++ b/src/tests/JIT/Methodical/cctor/simple/Desktop/prefldinit3.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly precise3 {} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit measure extends [mscorlib]System.Object { @@ -175,6 +176,9 @@ IL_0054: beq.s IL_0078 IL_0056: ldstr "in Main() after f(ref b), measure.a is {0}" + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) IL_005b: ldsfld int32 measure::a IL_0060: box [mscorlib]System.Int32 IL_0065: call void [System.Console]System.Console::WriteLine(string, diff --git a/src/tests/JIT/Methodical/cctor/simple/prefldinit1.il b/src/tests/JIT/Methodical/cctor/simple/prefldinit1.il index be3401ab46e80d..24b894cc50223e 100644 --- a/src/tests/JIT/Methodical/cctor/simple/prefldinit1.il +++ b/src/tests/JIT/Methodical/cctor/simple/prefldinit1.il @@ -20,6 +20,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module precise1.exe // MVID: {D664E737-135B-4517-AFBA-875EBEA1C810} .imagebase 0x00400000 @@ -201,6 +202,9 @@ IL_0061: beq.s IL_0085 IL_0063: ldstr "in Main() after f(ref b), measure.a is {0}" + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) IL_0068: ldsfld int32 measure::a IL_006d: box [mscorlib]System.Int32 IL_0072: call void [System.Console]System.Console::WriteLine(string, diff --git a/src/tests/JIT/Methodical/cctor/simple/prefldinit2.il b/src/tests/JIT/Methodical/cctor/simple/prefldinit2.il index d83599666effa2..fded84e23b593f 100644 --- a/src/tests/JIT/Methodical/cctor/simple/prefldinit2.il +++ b/src/tests/JIT/Methodical/cctor/simple/prefldinit2.il @@ -20,6 +20,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module precise2.exe // MVID: {C486E388-5E60-42FA-B093-89857CB047D8} .imagebase 0x00400000 @@ -192,6 +193,9 @@ IL_005d: beq.s IL_0081 IL_005f: ldstr "in Main() after new test(), measure.a is {0}" + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) IL_0064: ldsfld int32 measure::a IL_0069: box [mscorlib]System.Int32 IL_006e: call void [System.Console]System.Console::WriteLine(string, diff --git a/src/tests/JIT/Methodical/cctor/simple/prefldinit4.il b/src/tests/JIT/Methodical/cctor/simple/prefldinit4.il index f9196dc2912101..71aee3cfa78126 100644 --- a/src/tests/JIT/Methodical/cctor/simple/prefldinit4.il +++ b/src/tests/JIT/Methodical/cctor/simple/prefldinit4.il @@ -20,6 +20,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module precise4.exe // MVID: {623817A9-BEA6-4892-A378-D2135E123200} .imagebase 0x00400000 @@ -194,6 +195,9 @@ IL_0062: beq.s IL_0086 IL_0064: ldstr "in Main() after f(ref b), measure.a is {0}" + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) IL_0069: ldsfld int32 measure::a IL_006e: box [mscorlib]System.Int32 IL_0073: call void [System.Console]System.Console::WriteLine(string, diff --git a/src/tests/JIT/Methodical/delegate/oddpower.il b/src/tests/JIT/Methodical/delegate/oddpower.il index 0af2ff9c6b2298..9741aa5d69a94c 100644 --- a/src/tests/JIT/Methodical/delegate/oddpower.il +++ b/src/tests/JIT/Methodical/delegate/oddpower.il @@ -9,6 +9,7 @@ } .assembly extern mscorlib {} .assembly oddpower {} +.assembly extern xunit.core {} .class interface private abstract auto ansi Power { .method public hidebysig newslot abstract virtual @@ -387,6 +388,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals init (class OddPower V_0, diff --git a/src/tests/JIT/Methodical/eh/basics/emptyfinally.il b/src/tests/JIT/Methodical/eh/basics/emptyfinally.il index 502640bd515366..96ce199d9693ac 100644 --- a/src/tests/JIT/Methodical/eh/basics/emptyfinally.il +++ b/src/tests/JIT/Methodical/eh/basics/emptyfinally.il @@ -11,6 +11,7 @@ .assembly extern mscorlib {} .assembly extern common {} .assembly tryfinally {} +.assembly extern xunit.core {} .module tryfinally.exe .namespace hello @@ -50,6 +51,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 diff --git a/src/tests/JIT/Methodical/eh/basics/throwisfirstinstruction.il b/src/tests/JIT/Methodical/eh/basics/throwisfirstinstruction.il index ee2e2f7b404d63..da72c32c4729a6 100644 --- a/src/tests/JIT/Methodical/eh/basics/throwisfirstinstruction.il +++ b/src/tests/JIT/Methodical/eh/basics/throwisfirstinstruction.il @@ -11,6 +11,7 @@ .assembly extern mscorlib {} .assembly extern common {} .assembly test {} +.assembly extern xunit.core {} .module throw.exe .class private auto ansi beforefieldinit test @@ -39,6 +40,9 @@ .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint ldsfld class [common]TestUtil.TestLog test::testLog diff --git a/src/tests/JIT/Methodical/eh/basics/tryfinallywith2endfinally.il b/src/tests/JIT/Methodical/eh/basics/tryfinallywith2endfinally.il index 44718675be2da2..20505adeade55b 100644 --- a/src/tests/JIT/Methodical/eh/basics/tryfinallywith2endfinally.il +++ b/src/tests/JIT/Methodical/eh/basics/tryfinallywith2endfinally.il @@ -11,6 +11,7 @@ .assembly extern mscorlib {} .assembly extern common {} .assembly tryfinally {} +.assembly extern xunit.core {} .module tryfinally.exe .namespace hello @@ -40,6 +41,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 diff --git a/src/tests/JIT/Methodical/eh/basics/tryfinallywith2reachableendfinally.il b/src/tests/JIT/Methodical/eh/basics/tryfinallywith2reachableendfinally.il index 3cbc464cf79157..66309b0b0f3915 100644 --- a/src/tests/JIT/Methodical/eh/basics/tryfinallywith2reachableendfinally.il +++ b/src/tests/JIT/Methodical/eh/basics/tryfinallywith2reachableendfinally.il @@ -11,6 +11,7 @@ .assembly extern mscorlib {} .assembly extern common {} .assembly tryfinally {} +.assembly extern xunit.core {} .module tryfinally.exe .namespace hello @@ -46,6 +47,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (int32 V_0) diff --git a/src/tests/JIT/Methodical/eh/deadcode/badcodeaftercatch.il b/src/tests/JIT/Methodical/eh/deadcode/badcodeaftercatch.il index 8cc56e199060d5..9438936956da53 100644 --- a/src/tests/JIT/Methodical/eh/deadcode/badcodeaftercatch.il +++ b/src/tests/JIT/Methodical/eh/deadcode/badcodeaftercatch.il @@ -15,6 +15,7 @@ { .ver 0:0:0:0 } +.assembly extern xunit.core {} .module badcodeaftercatch.exe @@ -55,6 +56,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (object V_0, class [mscorlib]System.IO.StringWriter expectedOut, diff --git a/src/tests/JIT/Methodical/eh/deadcode/badcodeafterfault.il b/src/tests/JIT/Methodical/eh/deadcode/badcodeafterfault.il index 402ef9a09c295b..ff7fe0381757f9 100644 --- a/src/tests/JIT/Methodical/eh/deadcode/badcodeafterfault.il +++ b/src/tests/JIT/Methodical/eh/deadcode/badcodeafterfault.il @@ -15,6 +15,7 @@ { .ver 0:0:0:0 } +.assembly extern xunit.core {} .module baddcodeafterfault.exe @@ -51,6 +52,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (object V_0, class [mscorlib]System.IO.StringWriter expectedOut, diff --git a/src/tests/JIT/Methodical/eh/deadcode/badcodeafterfilter.il b/src/tests/JIT/Methodical/eh/deadcode/badcodeafterfilter.il index 525b8462a01c82..2cfbff642ba939 100644 --- a/src/tests/JIT/Methodical/eh/deadcode/badcodeafterfilter.il +++ b/src/tests/JIT/Methodical/eh/deadcode/badcodeafterfilter.il @@ -15,6 +15,7 @@ { .ver 0:0:0:0 } +.assembly extern xunit.core {} .module badcodeafterfilter.exe @@ -54,6 +55,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (object V_0, class [mscorlib]System.IO.StringWriter expectedOut, diff --git a/src/tests/JIT/Methodical/eh/deadcode/badcodeafterfinally.il b/src/tests/JIT/Methodical/eh/deadcode/badcodeafterfinally.il index 87659e9eb56aad..d716ea8807b876 100644 --- a/src/tests/JIT/Methodical/eh/deadcode/badcodeafterfinally.il +++ b/src/tests/JIT/Methodical/eh/deadcode/badcodeafterfinally.il @@ -15,6 +15,7 @@ { .ver 0:0:0:0 } +.assembly extern xunit.core {} .module badcodeafterfinally.exe @@ -60,6 +61,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (object V_0, class [mscorlib]System.IO.StringWriter expectedOut, diff --git a/src/tests/JIT/Methodical/eh/deadcode/badcodeaftertry.il b/src/tests/JIT/Methodical/eh/deadcode/badcodeaftertry.il index 53de4e270809c3..7e14d8518414c1 100644 --- a/src/tests/JIT/Methodical/eh/deadcode/badcodeaftertry.il +++ b/src/tests/JIT/Methodical/eh/deadcode/badcodeaftertry.il @@ -15,6 +15,7 @@ { .ver 0:0:0:0 } +.assembly extern xunit.core {} .module badcodeaftertry.exe @@ -51,6 +52,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (object V_0, class [mscorlib]System.IO.StringWriter expectedOut, diff --git a/src/tests/JIT/Methodical/eh/deadcode/badcodeinsidefinally.il b/src/tests/JIT/Methodical/eh/deadcode/badcodeinsidefinally.il index 600662c1eb8b32..ba3c6c4d4c0b51 100644 --- a/src/tests/JIT/Methodical/eh/deadcode/badcodeinsidefinally.il +++ b/src/tests/JIT/Methodical/eh/deadcode/badcodeinsidefinally.il @@ -15,6 +15,7 @@ { .ver 0:0:0:0 } +.assembly extern xunit.core {} .module badcodeinsidefinally.exe @@ -67,6 +68,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (object V_0, class [mscorlib]System.IO.StringWriter expectedOut, diff --git a/src/tests/JIT/Methodical/eh/deadcode/branchoverendfinally.il b/src/tests/JIT/Methodical/eh/deadcode/branchoverendfinally.il index 9e5ca769428710..0d6c445f7f823d 100644 --- a/src/tests/JIT/Methodical/eh/deadcode/branchoverendfinally.il +++ b/src/tests/JIT/Methodical/eh/deadcode/branchoverendfinally.il @@ -9,6 +9,7 @@ .assembly extern mscorlib {} .assembly extern common {} .assembly badtest {} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit foo extends [mscorlib]System.Object @@ -42,6 +43,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 diff --git a/src/tests/JIT/Methodical/eh/deadcode/deadEHregionacrossBB.il b/src/tests/JIT/Methodical/eh/deadcode/deadEHregionacrossBB.il index 336b3618d2da10..73ba61b6569f71 100644 --- a/src/tests/JIT/Methodical/eh/deadcode/deadEHregionacrossBB.il +++ b/src/tests/JIT/Methodical/eh/deadcode/deadEHregionacrossBB.il @@ -18,6 +18,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module test.exe .imagebase 0x00400000 .subsystem 0x00000003 @@ -49,6 +50,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (int32 V_0) diff --git a/src/tests/JIT/Methodical/eh/deadcode/deadcodeincatch.il b/src/tests/JIT/Methodical/eh/deadcode/deadcodeincatch.il index a48fe492d8852b..a2e1147f621171 100644 --- a/src/tests/JIT/Methodical/eh/deadcode/deadcodeincatch.il +++ b/src/tests/JIT/Methodical/eh/deadcode/deadcodeincatch.il @@ -18,6 +18,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module trycatch.exe // MVID: {3B8B6D1B-A317-4591-BD66-1D1000E3767F} .imagebase 0x00400000 @@ -115,6 +116,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 ldstr "hello" diff --git a/src/tests/JIT/Methodical/eh/deadcode/deadoponerror.il b/src/tests/JIT/Methodical/eh/deadcode/deadoponerror.il index e9df2aab46b4a2..3e68fbc0a9b3dd 100644 --- a/src/tests/JIT/Methodical/eh/deadcode/deadoponerror.il +++ b/src/tests/JIT/Methodical/eh/deadcode/deadoponerror.il @@ -7,10 +7,14 @@ .assembly extern common {} .assembly 'test' { } +.assembly extern xunit.core {} .class private auto ansi Test_deadoponerror extends [mscorlib]System.Object { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals init ( diff --git a/src/tests/JIT/Methodical/eh/deadcode/deadoponerrorinfunclet.il b/src/tests/JIT/Methodical/eh/deadcode/deadoponerrorinfunclet.il index bac6eb7349a6f5..1a2340564f1961 100644 --- a/src/tests/JIT/Methodical/eh/deadcode/deadoponerrorinfunclet.il +++ b/src/tests/JIT/Methodical/eh/deadcode/deadoponerrorinfunclet.il @@ -17,6 +17,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module oponerror.exe .imagebase 0x00400000 .subsystem 0x00000003 @@ -68,6 +69,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (int32 V_0, diff --git a/src/tests/JIT/Methodical/eh/deadcode/endfinallyinloop.il b/src/tests/JIT/Methodical/eh/deadcode/endfinallyinloop.il index 5f610e5ccc192c..95f33182e6ce03 100644 --- a/src/tests/JIT/Methodical/eh/deadcode/endfinallyinloop.il +++ b/src/tests/JIT/Methodical/eh/deadcode/endfinallyinloop.il @@ -20,6 +20,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module badtest.exe .imagebase 0x00400000 .subsystem 0x00000003 @@ -32,6 +33,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init ( diff --git a/src/tests/JIT/Methodical/eh/finallyexec/catchrettoinnertry.il b/src/tests/JIT/Methodical/eh/finallyexec/catchrettoinnertry.il index ed77e4cebc788f..288f6cb1919b04 100644 --- a/src/tests/JIT/Methodical/eh/finallyexec/catchrettoinnertry.il +++ b/src/tests/JIT/Methodical/eh/finallyexec/catchrettoinnertry.il @@ -17,6 +17,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module catchrettoinnertry.exe .imagebase 0x00400000 .subsystem 0x00000003 @@ -68,6 +69,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 diff --git a/src/tests/JIT/Methodical/eh/finallyexec/nestedfinallycall.il b/src/tests/JIT/Methodical/eh/finallyexec/nestedfinallycall.il index 78863ce6ae1030..e29d90c8972ae8 100644 --- a/src/tests/JIT/Methodical/eh/finallyexec/nestedfinallycall.il +++ b/src/tests/JIT/Methodical/eh/finallyexec/nestedfinallycall.il @@ -11,6 +11,7 @@ .assembly extern System {} .assembly extern common{} .assembly EHTest {} +.assembly extern xunit.core {} .class public EHTest { .field private static class [common]TestUtil.TestLog testLog @@ -125,6 +126,9 @@ .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint ldsfld class [common]TestUtil.TestLog EHTest::testLog diff --git a/src/tests/JIT/Methodical/eh/finallyexec/nonlocalexittonestedsibling.il b/src/tests/JIT/Methodical/eh/finallyexec/nonlocalexittonestedsibling.il index 2febf87f8bad6d..8386381bf161b3 100644 --- a/src/tests/JIT/Methodical/eh/finallyexec/nonlocalexittonestedsibling.il +++ b/src/tests/JIT/Methodical/eh/finallyexec/nonlocalexittonestedsibling.il @@ -11,6 +11,7 @@ .assembly extern mscorlib {} .assembly extern common{} .assembly test {} +.assembly extern xunit.core {} .namespace hello @@ -57,6 +58,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals init (int32 V_0, diff --git a/src/tests/JIT/Methodical/eh/interactions/throw1dimarray.il b/src/tests/JIT/Methodical/eh/interactions/throw1dimarray.il index ff428e81d58973..d611404f327942 100644 --- a/src/tests/JIT/Methodical/eh/interactions/throw1dimarray.il +++ b/src/tests/JIT/Methodical/eh/interactions/throw1dimarray.il @@ -23,6 +23,7 @@ { .ver 0:0:0:0 } +.assembly extern xunit.core {} .module Except.EXE .imagebase 0x00400000 .subsystem 0x00000003 @@ -41,6 +42,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 diff --git a/src/tests/JIT/Methodical/eh/interactions/throw2dimarray.il b/src/tests/JIT/Methodical/eh/interactions/throw2dimarray.il index 8b192f6a648a0f..e51b312abce925 100644 --- a/src/tests/JIT/Methodical/eh/interactions/throw2dimarray.il +++ b/src/tests/JIT/Methodical/eh/interactions/throw2dimarray.il @@ -22,6 +22,7 @@ { .ver 0:0:0:0 } +.assembly extern xunit.core {} .module Except.EXE .imagebase 0x00400000 .subsystem 0x00000003 @@ -40,6 +41,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals init (int32[,] V_0, diff --git a/src/tests/JIT/Methodical/eh/leaves/2branchesoutoftry.il b/src/tests/JIT/Methodical/eh/leaves/2branchesoutoftry.il index 80e4f3c954bd4b..4123fdeeeaa02a 100644 --- a/src/tests/JIT/Methodical/eh/leaves/2branchesoutoftry.il +++ b/src/tests/JIT/Methodical/eh/leaves/2branchesoutoftry.il @@ -18,6 +18,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module testit.exe .imagebase 0x00400000 .subsystem 0x00000003 @@ -40,6 +41,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init ( diff --git a/src/tests/JIT/Methodical/eh/leaves/backwardleaveincatch.il b/src/tests/JIT/Methodical/eh/leaves/backwardleaveincatch.il index 54d1c7a0f88ff9..558cc9ef9a8deb 100644 --- a/src/tests/JIT/Methodical/eh/leaves/backwardleaveincatch.il +++ b/src/tests/JIT/Methodical/eh/leaves/backwardleaveincatch.il @@ -18,6 +18,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module branchbackwardswithfinally.exe .imagebase 0x00400000 .subsystem 0x00000003 @@ -77,6 +78,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (int32 V_0, diff --git a/src/tests/JIT/Methodical/eh/leaves/branchbackwardswithcatch.il b/src/tests/JIT/Methodical/eh/leaves/branchbackwardswithcatch.il index 7ac5cf44e6be20..e4fd8da7868032 100644 --- a/src/tests/JIT/Methodical/eh/leaves/branchbackwardswithcatch.il +++ b/src/tests/JIT/Methodical/eh/leaves/branchbackwardswithcatch.il @@ -18,6 +18,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module branchbackwardswithfinally.exe .imagebase 0x00400000 .subsystem 0x00000003 @@ -76,6 +77,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (int32 V_0, diff --git a/src/tests/JIT/Methodical/eh/leaves/branchbackwardswithfinally.il b/src/tests/JIT/Methodical/eh/leaves/branchbackwardswithfinally.il index c0b01ffa1ef3ef..fdf07c184cbb17 100644 --- a/src/tests/JIT/Methodical/eh/leaves/branchbackwardswithfinally.il +++ b/src/tests/JIT/Methodical/eh/leaves/branchbackwardswithfinally.il @@ -18,6 +18,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module branchbackwardswithfinally.exe .imagebase 0x00400000 .subsystem 0x00000003 @@ -76,6 +77,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (int32 V_0, diff --git a/src/tests/JIT/Methodical/eh/leaves/branchoutofnestedtryfinally.il b/src/tests/JIT/Methodical/eh/leaves/branchoutofnestedtryfinally.il index 46bb57a61f866d..95cee7bd15997f 100644 --- a/src/tests/JIT/Methodical/eh/leaves/branchoutofnestedtryfinally.il +++ b/src/tests/JIT/Methodical/eh/leaves/branchoutofnestedtryfinally.il @@ -18,6 +18,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module testit.exe .imagebase 0x00400000 .subsystem 0x00000003 @@ -85,6 +86,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init ( diff --git a/src/tests/JIT/Methodical/eh/leaves/branchoutoftryfinally.il b/src/tests/JIT/Methodical/eh/leaves/branchoutoftryfinally.il index 76bd763d345e38..3a606ed1e15c35 100644 --- a/src/tests/JIT/Methodical/eh/leaves/branchoutoftryfinally.il +++ b/src/tests/JIT/Methodical/eh/leaves/branchoutoftryfinally.il @@ -19,6 +19,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module testit.exe .imagebase 0x00400000 .subsystem 0x00000003 @@ -41,6 +42,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init ( diff --git a/src/tests/JIT/Methodical/eh/leaves/forwardleaveincatch.il b/src/tests/JIT/Methodical/eh/leaves/forwardleaveincatch.il index 18fbbfd766bb6b..f11e7850042344 100644 --- a/src/tests/JIT/Methodical/eh/leaves/forwardleaveincatch.il +++ b/src/tests/JIT/Methodical/eh/leaves/forwardleaveincatch.il @@ -18,6 +18,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module branchbackwardswithfinally.exe .imagebase 0x00400000 .subsystem 0x00000003 @@ -76,6 +77,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (int32 V_0, diff --git a/src/tests/JIT/Methodical/eh/leaves/labelbeforefinally.il b/src/tests/JIT/Methodical/eh/leaves/labelbeforefinally.il index d23289733ed971..cbe71265a8b588 100644 --- a/src/tests/JIT/Methodical/eh/leaves/labelbeforefinally.il +++ b/src/tests/JIT/Methodical/eh/leaves/labelbeforefinally.il @@ -17,6 +17,7 @@ .hash algorithm 0x00008004 .ver 1:0:3018:0 } +.assembly extern xunit.core {} .module b30630.exe .imagebase 0x00400000 .subsystem 0x00000003 @@ -39,6 +40,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (bool V_0, diff --git a/src/tests/JIT/Methodical/eh/leaves/labelbeginningfinally.il b/src/tests/JIT/Methodical/eh/leaves/labelbeginningfinally.il index fb08f8e17b99e9..2a2ba885cfea28 100644 --- a/src/tests/JIT/Methodical/eh/leaves/labelbeginningfinally.il +++ b/src/tests/JIT/Methodical/eh/leaves/labelbeginningfinally.il @@ -18,6 +18,7 @@ .hash algorithm 0x00008004 .ver 1:0:3018:0 } +.assembly extern xunit.core {} .module b30630.exe .imagebase 0x00400000 .subsystem 0x00000003 @@ -40,6 +41,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (bool V_0, diff --git a/src/tests/JIT/Methodical/eh/leaves/leaveinsameregion.il b/src/tests/JIT/Methodical/eh/leaves/leaveinsameregion.il index 9d14c6388f9ae4..ff08d9da349dcc 100644 --- a/src/tests/JIT/Methodical/eh/leaves/leaveinsameregion.il +++ b/src/tests/JIT/Methodical/eh/leaves/leaveinsameregion.il @@ -18,6 +18,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module trycatch.exe .imagebase 0x00400000 .subsystem 0x00000003 @@ -65,6 +66,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (class [mscorlib]System.Exception V_0, diff --git a/src/tests/JIT/Methodical/eh/leaves/leaveintotrybody.il b/src/tests/JIT/Methodical/eh/leaves/leaveintotrybody.il index 965f766e91522a..0d6428b4113671 100644 --- a/src/tests/JIT/Methodical/eh/leaves/leaveintotrybody.il +++ b/src/tests/JIT/Methodical/eh/leaves/leaveintotrybody.il @@ -18,6 +18,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module trycatch.exe .imagebase 0x00400000 .subsystem 0x00000003 @@ -57,6 +58,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (int32 V_0, diff --git a/src/tests/JIT/Methodical/eh/leaves/tryfinallyintrycatchwithleaveintotry.il b/src/tests/JIT/Methodical/eh/leaves/tryfinallyintrycatchwithleaveintotry.il index b81d14a494d6ec..2977d60a1f458a 100644 --- a/src/tests/JIT/Methodical/eh/leaves/tryfinallyintrycatchwithleaveintotry.il +++ b/src/tests/JIT/Methodical/eh/leaves/tryfinallyintrycatchwithleaveintotry.il @@ -19,6 +19,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module trycatch.exe .imagebase 0x00400000 .subsystem 0x00000003 @@ -58,6 +59,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals init (int32 V_0, diff --git a/src/tests/JIT/Methodical/eh/mixedhandler/catchfiltercatch.il b/src/tests/JIT/Methodical/eh/mixedhandler/catchfiltercatch.il index e6e5a94c484845..78fc7e329b61a8 100644 --- a/src/tests/JIT/Methodical/eh/mixedhandler/catchfiltercatch.il +++ b/src/tests/JIT/Methodical/eh/mixedhandler/catchfiltercatch.il @@ -21,6 +21,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module testmultihandler.exe .imagebase 0x00400000 .subsystem 0x00000003 @@ -56,6 +57,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (class [mscorlib]System.DivideByZeroException V_0, diff --git a/src/tests/JIT/Methodical/eh/mixedhandler/filterfiltercatchcatch.il b/src/tests/JIT/Methodical/eh/mixedhandler/filterfiltercatchcatch.il index fbfd8cb61e0bbd..a603d87120c8e3 100644 --- a/src/tests/JIT/Methodical/eh/mixedhandler/filterfiltercatchcatch.il +++ b/src/tests/JIT/Methodical/eh/mixedhandler/filterfiltercatchcatch.il @@ -21,6 +21,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module testmultihandler.exe .imagebase 0x00400000 .subsystem 0x00000003 @@ -56,6 +57,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (class [mscorlib]System.DivideByZeroException V_0, diff --git a/src/tests/JIT/Methodical/eh/nested/general/throwinnestedcatch.il b/src/tests/JIT/Methodical/eh/nested/general/throwinnestedcatch.il index 819250be51b44b..bd2d4fbdf2fb6f 100644 --- a/src/tests/JIT/Methodical/eh/nested/general/throwinnestedcatch.il +++ b/src/tests/JIT/Methodical/eh/nested/general/throwinnestedcatch.il @@ -11,6 +11,7 @@ .assembly extern mscorlib {} .assembly extern common {} .assembly test {} +.assembly extern xunit.core {} .module throwinnestedcatch.exe @@ -45,6 +46,9 @@ .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint ldsfld class [common]TestUtil.TestLog test::testLog diff --git a/src/tests/JIT/Methodical/eh/rethrow/rethrowinfinallyinsidecatch.il b/src/tests/JIT/Methodical/eh/rethrow/rethrowinfinallyinsidecatch.il index aa0596e562c69d..6bfe1320dcfcbf 100644 --- a/src/tests/JIT/Methodical/eh/rethrow/rethrowinfinallyinsidecatch.il +++ b/src/tests/JIT/Methodical/eh/rethrow/rethrowinfinallyinsidecatch.il @@ -9,6 +9,7 @@ .assembly extern mscorlib {} .assembly extern common {} .assembly rethrowinfinallyaftercatch {} +.assembly extern xunit.core {} .module rethrowinfinallyaftercatch.exe @@ -56,6 +57,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals init (class [mscorlib]System.Exception eo, diff --git a/src/tests/JIT/Methodical/explicit/basic/refarg_c.il b/src/tests/JIT/Methodical/explicit/basic/refarg_c.il index 65679283977ec7..f1eef50a594a5c 100644 --- a/src/tests/JIT/Methodical/explicit/basic/refarg_c.il +++ b/src/tests/JIT/Methodical/explicit/basic/refarg_c.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'refarg_c.exe' // MVID: {E2604B1E-0A0A-41BB-B225-61A4B5873CA3} .namespace Test @@ -151,6 +152,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 32 (0x20) .maxstack 1 diff --git a/src/tests/JIT/Methodical/explicit/basic/refarg_f4.il b/src/tests/JIT/Methodical/explicit/basic/refarg_f4.il index 2ae537a7a8b880..4c8de543290b71 100644 --- a/src/tests/JIT/Methodical/explicit/basic/refarg_f4.il +++ b/src/tests/JIT/Methodical/explicit/basic/refarg_f4.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'refarg_f4.exe' // MVID: {32D92914-4A90-441D-BAD9-DD653D751832} .namespace Test @@ -182,6 +183,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 32 (0x20) .maxstack 1 diff --git a/src/tests/JIT/Methodical/explicit/basic/refarg_f8.il b/src/tests/JIT/Methodical/explicit/basic/refarg_f8.il index a5a7fb4c331239..f3dfdc8b2eae17 100644 --- a/src/tests/JIT/Methodical/explicit/basic/refarg_f8.il +++ b/src/tests/JIT/Methodical/explicit/basic/refarg_f8.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'refarg_f8.exe' // MVID: {37A8EE05-2AD1-417E-ABC1-6C1463EFE15F} .namespace Test @@ -182,6 +183,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 32 (0x20) .maxstack 1 diff --git a/src/tests/JIT/Methodical/explicit/basic/refarg_i1.il b/src/tests/JIT/Methodical/explicit/basic/refarg_i1.il index bcdb3eddec6335..ed3023109a969d 100644 --- a/src/tests/JIT/Methodical/explicit/basic/refarg_i1.il +++ b/src/tests/JIT/Methodical/explicit/basic/refarg_i1.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'refarg_i1.exe' // MVID: {6CD6F89D-FAE4-46E5-B4D6-684A3371C90D} .namespace Test @@ -166,6 +167,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 32 (0x20) .maxstack 1 diff --git a/src/tests/JIT/Methodical/explicit/basic/refarg_i2.il b/src/tests/JIT/Methodical/explicit/basic/refarg_i2.il index 19dec712902229..8035ff6fb02421 100644 --- a/src/tests/JIT/Methodical/explicit/basic/refarg_i2.il +++ b/src/tests/JIT/Methodical/explicit/basic/refarg_i2.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'refarg_i2.exe' // MVID: {DB5DE5DC-5255-410E-B565-E88E6CF43E3E} .namespace Test @@ -148,6 +149,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 47 (0x2f) .maxstack 2 diff --git a/src/tests/JIT/Methodical/explicit/basic/refarg_i4.il b/src/tests/JIT/Methodical/explicit/basic/refarg_i4.il index 40ed7b1f52f99f..c4c674f05a13ab 100644 --- a/src/tests/JIT/Methodical/explicit/basic/refarg_i4.il +++ b/src/tests/JIT/Methodical/explicit/basic/refarg_i4.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'refarg_i4.exe' // MVID: {0D4BD404-2598-466F-9449-2F343E513C7B} .namespace Test @@ -211,6 +212,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 32 (0x20) .maxstack 1 diff --git a/src/tests/JIT/Methodical/explicit/basic/refarg_o.il b/src/tests/JIT/Methodical/explicit/basic/refarg_o.il index d7e59a6505721a..f1370ad78b6234 100644 --- a/src/tests/JIT/Methodical/explicit/basic/refarg_o.il +++ b/src/tests/JIT/Methodical/explicit/basic/refarg_o.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'refarg_o.exe' // MVID: {98C433B3-3689-48CF-A0CC-1320952F1424} .namespace Test @@ -154,6 +155,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 32 (0x20) .maxstack 1 diff --git a/src/tests/JIT/Methodical/explicit/basic/refarg_s.il b/src/tests/JIT/Methodical/explicit/basic/refarg_s.il index a730e6cd8d4ff9..8edcc440add276 100644 --- a/src/tests/JIT/Methodical/explicit/basic/refarg_s.il +++ b/src/tests/JIT/Methodical/explicit/basic/refarg_s.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'refarg_s.exe' // MVID: {003C53D6-66A7-45B4-8632-F678BD70244A} .namespace Test @@ -157,6 +158,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 32 (0x20) .maxstack 1 diff --git a/src/tests/JIT/Methodical/explicit/basic/refloc_c.il b/src/tests/JIT/Methodical/explicit/basic/refloc_c.il index a08e2d01d7938b..6ce3909c5fe7b9 100644 --- a/src/tests/JIT/Methodical/explicit/basic/refloc_c.il +++ b/src/tests/JIT/Methodical/explicit/basic/refloc_c.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'refloc_c.exe' // MVID: {79AF88AB-FAAC-4FD1-BE7F-0957B4D34D71} .namespace Test @@ -111,6 +112,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 64 (0x40) .maxstack 2 diff --git a/src/tests/JIT/Methodical/explicit/basic/refloc_i1.il b/src/tests/JIT/Methodical/explicit/basic/refloc_i1.il index 206fe24546fb52..41d21ad26faa43 100644 --- a/src/tests/JIT/Methodical/explicit/basic/refloc_i1.il +++ b/src/tests/JIT/Methodical/explicit/basic/refloc_i1.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'refloc_i1.exe' // MVID: {3752C643-F767-47EB-BDBF-8588A1A0B6B3} .namespace Test @@ -111,6 +112,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 64 (0x40) .maxstack 2 diff --git a/src/tests/JIT/Methodical/explicit/basic/refloc_i2.il b/src/tests/JIT/Methodical/explicit/basic/refloc_i2.il index 1c6b1121147516..36c0cf7a74216f 100644 --- a/src/tests/JIT/Methodical/explicit/basic/refloc_i2.il +++ b/src/tests/JIT/Methodical/explicit/basic/refloc_i2.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'refloc_i2.exe' // MVID: {310C7C47-EDC8-46C9-A5AD-A4054CE0204A} .namespace Test @@ -111,6 +112,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 64 (0x40) .maxstack 2 diff --git a/src/tests/JIT/Methodical/explicit/basic/refloc_i4.il b/src/tests/JIT/Methodical/explicit/basic/refloc_i4.il index a5cce38f6a41d7..7d513f15b0627c 100644 --- a/src/tests/JIT/Methodical/explicit/basic/refloc_i4.il +++ b/src/tests/JIT/Methodical/explicit/basic/refloc_i4.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'refloc_i4.exe' // MVID: {D12582D0-C0F0-40C6-B4E1-807EE328456C} .namespace Test @@ -111,6 +112,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 64 (0x40) .maxstack 2 diff --git a/src/tests/JIT/Methodical/explicit/basic/refloc_o.il b/src/tests/JIT/Methodical/explicit/basic/refloc_o.il index 124fc8a1fa20be..920d8b2beccc62 100644 --- a/src/tests/JIT/Methodical/explicit/basic/refloc_o.il +++ b/src/tests/JIT/Methodical/explicit/basic/refloc_o.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'refloc_o.exe' // MVID: {3CF0A869-1266-4091-97CF-DEFA0C36E038} .namespace Test @@ -118,6 +119,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 72 (0x48) .maxstack 2 diff --git a/src/tests/JIT/Methodical/explicit/basic/refloc_o2.il b/src/tests/JIT/Methodical/explicit/basic/refloc_o2.il index 98421a578ee80b..c22983b45f17c9 100644 --- a/src/tests/JIT/Methodical/explicit/basic/refloc_o2.il +++ b/src/tests/JIT/Methodical/explicit/basic/refloc_o2.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'refloc_o.exe' // MVID: {3CF0A869-1266-4091-97CF-DEFA0C36E038} .namespace Test @@ -119,6 +120,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 72 (0x48) .maxstack 2 diff --git a/src/tests/JIT/Methodical/explicit/basic/refloc_r4.il b/src/tests/JIT/Methodical/explicit/basic/refloc_r4.il index dd284918cfebcf..f4b8c0aa978d21 100644 --- a/src/tests/JIT/Methodical/explicit/basic/refloc_r4.il +++ b/src/tests/JIT/Methodical/explicit/basic/refloc_r4.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'refloc_f4.exe' // MVID: {759403EF-2C74-4EEF-AB3C-166B1C468873} .namespace Test @@ -118,6 +119,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 67 (0x43) .maxstack 2 diff --git a/src/tests/JIT/Methodical/explicit/basic/refloc_r8.il b/src/tests/JIT/Methodical/explicit/basic/refloc_r8.il index 470d43bc59a7ae..0fc2b444ebbf1c 100644 --- a/src/tests/JIT/Methodical/explicit/basic/refloc_r8.il +++ b/src/tests/JIT/Methodical/explicit/basic/refloc_r8.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'refloc_f8.exe' // MVID: {6A5E4D09-08FF-4E91-A37B-252AB7E08397} .namespace Test @@ -111,6 +112,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 71 (0x47) .maxstack 2 diff --git a/src/tests/JIT/Methodical/explicit/basic/refloc_u2.il b/src/tests/JIT/Methodical/explicit/basic/refloc_u2.il index 25d18d158220c7..0e27da5953768e 100644 --- a/src/tests/JIT/Methodical/explicit/basic/refloc_u2.il +++ b/src/tests/JIT/Methodical/explicit/basic/refloc_u2.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'refloc_u2.exe' // MVID: {ADBCF0C8-A2B9-4481-BF63-32F2CB11E46E} .namespace Test @@ -112,6 +113,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 65 (0x41) .maxstack 2 diff --git a/src/tests/JIT/Methodical/explicit/funcptr/expl_funcptr_gc.il b/src/tests/JIT/Methodical/explicit/funcptr/expl_funcptr_gc.il index 7166f6f3f9ee3d..2c90d986717644 100644 --- a/src/tests/JIT/Methodical/explicit/funcptr/expl_funcptr_gc.il +++ b/src/tests/JIT/Methodical/explicit/funcptr/expl_funcptr_gc.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module test.exe // MVID: {CF23CD68-3FF2-4D1F-B49B-866DA656D91D} @@ -62,6 +63,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 31 (0x1f) .maxstack 3 diff --git a/src/tests/JIT/Methodical/explicit/funcptr/expl_funcptr_val.il b/src/tests/JIT/Methodical/explicit/funcptr/expl_funcptr_val.il index 799adcfda696c4..9fca41f99db49c 100644 --- a/src/tests/JIT/Methodical/explicit/funcptr/expl_funcptr_val.il +++ b/src/tests/JIT/Methodical/explicit/funcptr/expl_funcptr_val.il @@ -18,6 +18,7 @@ } +.assembly extern xunit.core {} .module test.exe // MVID: {CF23CD68-3FF2-4D1F-B49B-866DA656D91D} @@ -49,6 +50,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 31 (0x1f) .maxstack 3 diff --git a/src/tests/JIT/Methodical/explicit/funcptr/seq_funcptr_gc.il b/src/tests/JIT/Methodical/explicit/funcptr/seq_funcptr_gc.il index 1c650924b5de44..957f1644a1e0dd 100644 --- a/src/tests/JIT/Methodical/explicit/funcptr/seq_funcptr_gc.il +++ b/src/tests/JIT/Methodical/explicit/funcptr/seq_funcptr_gc.il @@ -15,6 +15,7 @@ { } +.assembly extern xunit.core {} .module test.exe // MVID: {CF23CD68-3FF2-4D1F-B49B-866DA656D91D} @@ -58,6 +59,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 31 (0x1f) .maxstack 3 diff --git a/src/tests/JIT/Methodical/explicit/funcptr/seq_funcptr_val.il b/src/tests/JIT/Methodical/explicit/funcptr/seq_funcptr_val.il index 2525d63a0c5d81..dced59c0acf2a2 100644 --- a/src/tests/JIT/Methodical/explicit/funcptr/seq_funcptr_val.il +++ b/src/tests/JIT/Methodical/explicit/funcptr/seq_funcptr_val.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module test.exe // MVID: {CF23CD68-3FF2-4D1F-B49B-866DA656D91D} @@ -64,6 +65,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 31 (0x1f) .maxstack 3 diff --git a/src/tests/JIT/Methodical/explicit/misc/refarg_box_f8.il b/src/tests/JIT/Methodical/explicit/misc/refarg_box_f8.il index 1d793c32839583..6d63b873adfa6e 100644 --- a/src/tests/JIT/Methodical/explicit/misc/refarg_box_f8.il +++ b/src/tests/JIT/Methodical/explicit/misc/refarg_box_f8.il @@ -11,6 +11,7 @@ .assembly 'refarg_box_f8' { } +.assembly extern xunit.core {} .module 'refarg_box_f8.exe' .namespace Test { @@ -80,6 +81,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (float64 ZZZZ, diff --git a/src/tests/JIT/Methodical/explicit/misc/refarg_box_val.il b/src/tests/JIT/Methodical/explicit/misc/refarg_box_val.il index 02289bf967d982..f7db1b8ab1c7f6 100644 --- a/src/tests/JIT/Methodical/explicit/misc/refarg_box_val.il +++ b/src/tests/JIT/Methodical/explicit/misc/refarg_box_val.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'refarg_box_val.exe' // MVID: {27E0B251-2BC1-4652-9A1C-3EFA7F79CFC4} .namespace Test @@ -120,6 +121,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 32 (0x20) .maxstack 2 diff --git a/src/tests/JIT/Methodical/explicit/rotate/rotarg_double.il b/src/tests/JIT/Methodical/explicit/rotate/rotarg_double.il index 5f5eb40c570d4a..7bb446b7435bd5 100644 --- a/src/tests/JIT/Methodical/explicit/rotate/rotarg_double.il +++ b/src/tests/JIT/Methodical/explicit/rotate/rotarg_double.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'rotarg_double.exe' // MVID: {645882BF-F31B-417A-A923-D4914C5C82B7} .namespace Rotate @@ -311,6 +312,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 47 (0x2f) .maxstack 3 diff --git a/src/tests/JIT/Methodical/explicit/rotate/rotarg_float.il b/src/tests/JIT/Methodical/explicit/rotate/rotarg_float.il index 21b10420124dc4..2f6f9faab3c8c4 100644 --- a/src/tests/JIT/Methodical/explicit/rotate/rotarg_float.il +++ b/src/tests/JIT/Methodical/explicit/rotate/rotarg_float.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'rotarg_float.exe' // MVID: {7ECA5CD0-D623-475E-8C8F-8781756FD492} .namespace Rotate @@ -311,6 +312,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 47 (0x2f) .maxstack 3 diff --git a/src/tests/JIT/Methodical/explicit/rotate/rotarg_objref.il b/src/tests/JIT/Methodical/explicit/rotate/rotarg_objref.il index 43566a30899620..2237c78c4f4bb8 100644 --- a/src/tests/JIT/Methodical/explicit/rotate/rotarg_objref.il +++ b/src/tests/JIT/Methodical/explicit/rotate/rotarg_objref.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'rotarg_objref.exe' // MVID: {163DF86C-2BE3-4ACE-B98C-6AF0382DBFD1} .namespace Rotate @@ -329,6 +330,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 47 (0x2f) .maxstack 3 diff --git a/src/tests/JIT/Methodical/explicit/rotate/rotarg_valref.il b/src/tests/JIT/Methodical/explicit/rotate/rotarg_valref.il index a7b1a802bdc73f..0c2c1abc2ccf14 100644 --- a/src/tests/JIT/Methodical/explicit/rotate/rotarg_valref.il +++ b/src/tests/JIT/Methodical/explicit/rotate/rotarg_valref.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'rotarg_valref.exe' // MVID: {674E1F39-687D-4762-9954-BB9254236385} .namespace Rotate @@ -343,6 +344,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 47 (0x2f) .maxstack 3 diff --git a/src/tests/JIT/Methodical/explicit/rotate/rotate_i4.il b/src/tests/JIT/Methodical/explicit/rotate/rotate_i4.il index 0aa25597d47e12..86544e40ab834d 100644 --- a/src/tests/JIT/Methodical/explicit/rotate/rotate_i4.il +++ b/src/tests/JIT/Methodical/explicit/rotate/rotate_i4.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'rotate_i4.exe' // MVID: {A112EBC7-3218-46C8-939E-D43B5ED4DE98} .namespace Rotate @@ -205,6 +206,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 20 (0x14) .maxstack 2 diff --git a/src/tests/JIT/Methodical/explicit/rotate/rotate_u2.il b/src/tests/JIT/Methodical/explicit/rotate/rotate_u2.il index 3dab9081d4bcfe..206fe4d30ff834 100644 --- a/src/tests/JIT/Methodical/explicit/rotate/rotate_u2.il +++ b/src/tests/JIT/Methodical/explicit/rotate/rotate_u2.il @@ -17,6 +17,7 @@ } +.assembly extern xunit.core {} .module 'rotate_u2.exe' // MVID: {D13C2D0A-FC17-423E-926F-6A239416DD1C} .namespace Rotate @@ -221,6 +222,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 20 (0x14) .maxstack 2 diff --git a/src/tests/JIT/Methodical/flowgraph/bug619534/ILStackAllocRepro.il b/src/tests/JIT/Methodical/flowgraph/bug619534/ILStackAllocRepro.il index 1ba15d40121098..fbd3d2fd3b9058 100644 --- a/src/tests/JIT/Methodical/flowgraph/bug619534/ILStackAllocRepro.il +++ b/src/tests/JIT/Methodical/flowgraph/bug619534/ILStackAllocRepro.il @@ -9,6 +9,7 @@ .assembly ILStackAllocRepro {} +.assembly extern xunit.core {} .assembly extern mscorlib{auto} .class private auto ansi beforefieldinit Foo @@ -17,6 +18,9 @@ .field private static int32* buffer .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 20 (0x14) .maxstack 2 diff --git a/src/tests/JIT/Methodical/flowgraph/bug619534/twoEndFinallys.il b/src/tests/JIT/Methodical/flowgraph/bug619534/twoEndFinallys.il index 4775be2aebd328..536a326baddad4 100644 --- a/src/tests/JIT/Methodical/flowgraph/bug619534/twoEndFinallys.il +++ b/src/tests/JIT/Methodical/flowgraph/bug619534/twoEndFinallys.il @@ -19,6 +19,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module dev10_745765.exe // MVID: {932CB6F6-63A8-4E1D-B39F-197DFCB35D3E} .imagebase 0x00400000 @@ -52,6 +53,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 23 (0x17) .maxstack 2 diff --git a/src/tests/JIT/Methodical/flowgraph/dev10_bug642944/GCMaskForGSCookie.il b/src/tests/JIT/Methodical/flowgraph/dev10_bug642944/GCMaskForGSCookie.il index 63b70981db1aff..2388b1e1c95b15 100644 --- a/src/tests/JIT/Methodical/flowgraph/dev10_bug642944/GCMaskForGSCookie.il +++ b/src/tests/JIT/Methodical/flowgraph/dev10_bug642944/GCMaskForGSCookie.il @@ -17,6 +17,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module repro.exe // =============== CLASS MEMBERS DECLARATION =================== @@ -47,6 +48,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 20 (0x14) .maxstack 1 diff --git a/src/tests/JIT/Methodical/flowgraph/dev10_bug675304/loopIV_init.il b/src/tests/JIT/Methodical/flowgraph/dev10_bug675304/loopIV_init.il index a649b5b116fd5d..e7b00aad8da09f 100644 --- a/src/tests/JIT/Methodical/flowgraph/dev10_bug675304/loopIV_init.il +++ b/src/tests/JIT/Methodical/flowgraph/dev10_bug675304/loopIV_init.il @@ -17,6 +17,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module loopIV_init.exe .custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) .imagebase 0x00400000 @@ -56,6 +57,9 @@ { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals init (valuetype V V_0, diff --git a/src/tests/JIT/Methodical/flowgraph/dev10_bug679008/dependentLifetimes.il b/src/tests/JIT/Methodical/flowgraph/dev10_bug679008/dependentLifetimes.il index a936fb60623d68..c20b22ea5565d4 100644 --- a/src/tests/JIT/Methodical/flowgraph/dev10_bug679008/dependentLifetimes.il +++ b/src/tests/JIT/Methodical/flowgraph/dev10_bug679008/dependentLifetimes.il @@ -18,6 +18,7 @@ { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) } +.assembly extern xunit.core {} .class private auto ansi beforefieldinit BugRepro @@ -25,6 +26,9 @@ { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (object V_0, diff --git a/src/tests/JIT/Methodical/flowgraph/dev10_bug679008/ehDescriptorPtrUpdate.il b/src/tests/JIT/Methodical/flowgraph/dev10_bug679008/ehDescriptorPtrUpdate.il index 84645765c104af..1b06d0ae65352c 100644 --- a/src/tests/JIT/Methodical/flowgraph/dev10_bug679008/ehDescriptorPtrUpdate.il +++ b/src/tests/JIT/Methodical/flowgraph/dev10_bug679008/ehDescriptorPtrUpdate.il @@ -10,6 +10,7 @@ .assembly extern mscorlib { auto } .assembly extern System { auto } .assembly EHTest {} +.assembly extern xunit.core {} .class public EHTest { @@ -181,6 +182,9 @@ ret } .method public static int32 Main() cil managed { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 500 .maxstack 500 diff --git a/src/tests/JIT/Methodical/flowgraph/dev10_bug679008/fgloop.il b/src/tests/JIT/Methodical/flowgraph/dev10_bug679008/fgloop.il index 3c151b2eb30368..f0a2646f645029 100644 --- a/src/tests/JIT/Methodical/flowgraph/dev10_bug679008/fgloop.il +++ b/src/tests/JIT/Methodical/flowgraph/dev10_bug679008/fgloop.il @@ -9,6 +9,7 @@ .assembly extern mscorlib { auto } .assembly extern System { auto } .assembly EHTest {} +.assembly extern xunit.core {} .class public EHTest { .field private static int64 fld0 @@ -958,6 +959,9 @@ ret } .method public static int32 Main() cil managed { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 500 .maxstack 500 diff --git a/src/tests/JIT/Methodical/flowgraph/dev10_bug679008/fgloop2.il b/src/tests/JIT/Methodical/flowgraph/dev10_bug679008/fgloop2.il index d6453e1f641fe4..bcf4e7d26bcddc 100644 --- a/src/tests/JIT/Methodical/flowgraph/dev10_bug679008/fgloop2.il +++ b/src/tests/JIT/Methodical/flowgraph/dev10_bug679008/fgloop2.il @@ -10,6 +10,7 @@ .assembly extern mscorlib { auto } .assembly extern System { auto } .assembly EHTest {} +.assembly extern xunit.core {} .class public EHTest { .field private static int64 fld0 @@ -877,6 +878,9 @@ ret } .method public static int32 Main() cil managed { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 500 .maxstack 500 diff --git a/src/tests/JIT/Methodical/flowgraph/dev10_bug679053/cpblkInt32.il b/src/tests/JIT/Methodical/flowgraph/dev10_bug679053/cpblkInt32.il index f25083cfe0c5bf..c4dd8c332da9dc 100644 --- a/src/tests/JIT/Methodical/flowgraph/dev10_bug679053/cpblkInt32.il +++ b/src/tests/JIT/Methodical/flowgraph/dev10_bug679053/cpblkInt32.il @@ -3,6 +3,7 @@ .assembly ILGEN_0xb8816d7d {} +.assembly extern xunit.core {} .assembly extern mscorlib{auto} .class ILGEN_0xb8816d7d { @@ -163,6 +164,9 @@ End_Orphan_b_12: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 13 ldc.r4 float32(0x177ad9a4) diff --git a/src/tests/JIT/Methodical/flowgraph/dev10_bug679053/flowgraph.il b/src/tests/JIT/Methodical/flowgraph/dev10_bug679053/flowgraph.il index 8c4c0543121f68..051f036c819595 100644 --- a/src/tests/JIT/Methodical/flowgraph/dev10_bug679053/flowgraph.il +++ b/src/tests/JIT/Methodical/flowgraph/dev10_bug679053/flowgraph.il @@ -4,6 +4,7 @@ .assembly ILGEN_0x97f1b6bf {} +.assembly extern xunit.core {} .assembly extern mscorlib{auto} .class ILGEN_0x97f1b6bf { @@ -270,6 +271,9 @@ conv.u2 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 100 diff --git a/src/tests/JIT/Methodical/flowgraph/dev10_bug679053/regionLive.il b/src/tests/JIT/Methodical/flowgraph/dev10_bug679053/regionLive.il index 0aad5b27c502d2..0bf5eec07704f9 100644 --- a/src/tests/JIT/Methodical/flowgraph/dev10_bug679053/regionLive.il +++ b/src/tests/JIT/Methodical/flowgraph/dev10_bug679053/regionLive.il @@ -10,6 +10,7 @@ .assembly extern mscorlib { auto } .assembly extern System { auto } .assembly EHTest {} +.assembly extern xunit.core {} .class public EHTest { .field private static int32 fld0 @@ -584,6 +585,9 @@ ret } .method public static int32 Main() cil managed { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 500 .maxstack 500 diff --git a/src/tests/JIT/Methodical/flowgraph/dev10_bug679955/indexMinusOne.il b/src/tests/JIT/Methodical/flowgraph/dev10_bug679955/indexMinusOne.il index 9b72a9c798f48c..ab42a324199c6f 100644 --- a/src/tests/JIT/Methodical/flowgraph/dev10_bug679955/indexMinusOne.il +++ b/src/tests/JIT/Methodical/flowgraph/dev10_bug679955/indexMinusOne.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly ILGEN_0x52ea038a {} +.assembly extern xunit.core {} .assembly extern mscorlib{auto} .class ILGEN_0x52ea038a { @@ -2517,6 +2518,9 @@ ldelem.i4 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 21 .try diff --git a/src/tests/JIT/Methodical/flowgraph/dev10_bug679955/volatileLocal1.il b/src/tests/JIT/Methodical/flowgraph/dev10_bug679955/volatileLocal1.il index 1f9a8f9d6df162..fb6d49571c4619 100644 --- a/src/tests/JIT/Methodical/flowgraph/dev10_bug679955/volatileLocal1.il +++ b/src/tests/JIT/Methodical/flowgraph/dev10_bug679955/volatileLocal1.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly ILGEN_0xd01d9fe9 {} +.assembly extern xunit.core {} .assembly extern mscorlib{auto} .class ILGEN_0xd01d9fe9 { @@ -295,6 +296,9 @@ neg ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 29 ldc.i4 0x72960b5e diff --git a/src/tests/JIT/Methodical/flowgraph/dev10_bug679955/volatileLocal2.il b/src/tests/JIT/Methodical/flowgraph/dev10_bug679955/volatileLocal2.il index 6c1a9800f586e4..2625179487cc1e 100644 --- a/src/tests/JIT/Methodical/flowgraph/dev10_bug679955/volatileLocal2.il +++ b/src/tests/JIT/Methodical/flowgraph/dev10_bug679955/volatileLocal2.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly ILGEN_0x537f7b0 {} +.assembly extern xunit.core {} .assembly extern mscorlib{auto} .class ILGEN_0x537f7b0 { @@ -1224,6 +1225,9 @@ conv.r.un ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 31 .try { diff --git a/src/tests/JIT/Methodical/inlining/dev10_bug719093/variancesmall.il b/src/tests/JIT/Methodical/inlining/dev10_bug719093/variancesmall.il index 929d8afe128a14..022bbab52d5faa 100644 --- a/src/tests/JIT/Methodical/inlining/dev10_bug719093/variancesmall.il +++ b/src/tests/JIT/Methodical/inlining/dev10_bug719093/variancesmall.il @@ -22,6 +22,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module Variance1.exe .imagebase 0x00400000 .file alignment 0x00000200 @@ -292,6 +293,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 6 .locals init (int32 V_0, diff --git a/src/tests/JIT/Methodical/int64/arrays/hugedim.il b/src/tests/JIT/Methodical/int64/arrays/hugedim.il index c4a92faa5f601f..fe001976b72020 100644 --- a/src/tests/JIT/Methodical/int64/arrays/hugedim.il +++ b/src/tests/JIT/Methodical/int64/arrays/hugedim.il @@ -20,6 +20,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' // MVID: {23E3D49B-6CFD-4DA0-8C9D-A611CE0BA103} .namespace JitTest @@ -30,6 +31,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 38 (0x26) .maxstack 70 diff --git a/src/tests/JIT/Methodical/int64/arrays/lcs_long.il b/src/tests/JIT/Methodical/int64/arrays/lcs_long.il index 4f3d3139dcd7ce..56c70ff46e3a9a 100644 --- a/src/tests/JIT/Methodical/int64/arrays/lcs_long.il +++ b/src/tests/JIT/Methodical/int64/arrays/lcs_long.il @@ -16,6 +16,7 @@ .assembly 'lcs_long'// as "lcs_long" { } +.assembly extern xunit.core {} .module 'lcs_long.exe' // MVID: {856A09FD-A814-4ED7-B594-E4AFD3850D67} .namespace JitTest @@ -608,6 +609,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 266 (0x10a) .maxstack 5 diff --git a/src/tests/JIT/Methodical/int64/arrays/lcs_ulong.il b/src/tests/JIT/Methodical/int64/arrays/lcs_ulong.il index 9e3e09891dbbf1..909201615c916f 100644 --- a/src/tests/JIT/Methodical/int64/arrays/lcs_ulong.il +++ b/src/tests/JIT/Methodical/int64/arrays/lcs_ulong.il @@ -16,6 +16,7 @@ .assembly 'lcs_ulong'// as "lcs_ulong" { } +.assembly extern xunit.core {} .module 'lcs_ulong.exe' // MVID: {4FECC02C-D871-4196-A531-897C5458F477} .namespace JitTest @@ -623,6 +624,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 266 (0x10a) .maxstack 5 diff --git a/src/tests/JIT/Methodical/int64/misc/binop.il b/src/tests/JIT/Methodical/int64/misc/binop.il index 1b103ff14a5405..17a4ceeb644603 100644 --- a/src/tests/JIT/Methodical/int64/misc/binop.il +++ b/src/tests/JIT/Methodical/int64/misc/binop.il @@ -16,6 +16,7 @@ .assembly 'binop'// as "binop" { } +.assembly extern xunit.core {} .module 'binop.exe' // MVID: {E24B38CB-1AB3-45BA-AA54-5C10DD72CDBA} .namespace JitTest @@ -26,6 +27,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 196 (0xc4) .maxstack 2 diff --git a/src/tests/JIT/Methodical/int64/misc/box.il b/src/tests/JIT/Methodical/int64/misc/box.il index 9fb4149842b1bc..5058cef9a26412 100644 --- a/src/tests/JIT/Methodical/int64/misc/box.il +++ b/src/tests/JIT/Methodical/int64/misc/box.il @@ -16,6 +16,7 @@ .assembly 'box'// as "box" { } +.assembly extern xunit.core {} .module 'box.exe' // MVID: {8CBD3D83-F5B6-41AC-9D7A-099A59884AC4} .namespace JitTest @@ -26,6 +27,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 159 (0x9f) .maxstack 2 diff --git a/src/tests/JIT/Methodical/int64/misc/longmul.il b/src/tests/JIT/Methodical/int64/misc/longmul.il index 03d2a47e309175..ec46cd426cec66 100644 --- a/src/tests/JIT/Methodical/int64/misc/longmul.il +++ b/src/tests/JIT/Methodical/int64/misc/longmul.il @@ -4,6 +4,7 @@ .assembly extern System.Console { auto } .assembly extern System.Runtime { auto } .assembly LongMulOn32BitTest { } +.assembly extern xunit.core {} .class auto LongMulOn32BitTest extends [System.Runtime]System.Object { @@ -27,6 +28,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals ( int64 result ) diff --git a/src/tests/JIT/Methodical/int64/signed/s_addsub.il b/src/tests/JIT/Methodical/int64/signed/s_addsub.il index a4652a610a8c7b..b351cd69ee24b2 100644 --- a/src/tests/JIT/Methodical/int64/signed/s_addsub.il +++ b/src/tests/JIT/Methodical/int64/signed/s_addsub.il @@ -16,6 +16,7 @@ .assembly 'addsub'// as "addsub" { } +.assembly extern xunit.core {} .module 'addsub.exe' // MVID: {1BE54EA1-760A-4C23-A736-FE6F3A427E3E} .namespace JitTest @@ -178,6 +179,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 5045 (0x13b5) .maxstack 2 diff --git a/src/tests/JIT/Methodical/int64/signed/s_ldc_div.il b/src/tests/JIT/Methodical/int64/signed/s_ldc_div.il index 2de90378f79135..232f46ec00f6c9 100644 --- a/src/tests/JIT/Methodical/int64/signed/s_ldc_div.il +++ b/src/tests/JIT/Methodical/int64/signed/s_ldc_div.il @@ -16,6 +16,7 @@ .assembly 'ldc_div'// as "ldc_div" { } +.assembly extern xunit.core {} .module 'ldc_div.exe' // MVID: {907922FB-D56B-4407-A016-0118205F2F38} .namespace JitTest @@ -77,6 +78,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 271 (0x10f) .maxstack 4 diff --git a/src/tests/JIT/Methodical/int64/signed/s_ldc_mul.il b/src/tests/JIT/Methodical/int64/signed/s_ldc_mul.il index 7d4cdf517088d3..c89277872f7a97 100644 --- a/src/tests/JIT/Methodical/int64/signed/s_ldc_mul.il +++ b/src/tests/JIT/Methodical/int64/signed/s_ldc_mul.il @@ -16,6 +16,7 @@ .assembly 'ldc_mul'// as "ldc_mul" { } +.assembly extern xunit.core {} .module 'ldc_mul.exe' // MVID: {DD9661FF-93A5-4664-8EAA-E345054EF8F6} .namespace JitTest @@ -77,6 +78,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 242 (0xf2) .maxstack 4 diff --git a/src/tests/JIT/Methodical/int64/signed/s_ldc_mulovf.il b/src/tests/JIT/Methodical/int64/signed/s_ldc_mulovf.il index 86795ffa176997..0db4d30ebc70a5 100644 --- a/src/tests/JIT/Methodical/int64/signed/s_ldc_mulovf.il +++ b/src/tests/JIT/Methodical/int64/signed/s_ldc_mulovf.il @@ -16,6 +16,7 @@ .assembly 'ldc_mulovf'// as "ldc_mulovf" { } +.assembly extern xunit.core {} .module 'ldc_mulovf.exe' // MVID: {2BC63DAA-17AC-498E-A6E0-2E0A01266D5E} .namespace JitTest @@ -77,6 +78,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 242 (0xf2) .maxstack 4 diff --git a/src/tests/JIT/Methodical/int64/signed/s_ldfld_mul.il b/src/tests/JIT/Methodical/int64/signed/s_ldfld_mul.il index 66c0a4687a6553..2288f54a5332b5 100644 --- a/src/tests/JIT/Methodical/int64/signed/s_ldfld_mul.il +++ b/src/tests/JIT/Methodical/int64/signed/s_ldfld_mul.il @@ -16,6 +16,7 @@ .assembly 'ldfld_mul'// as "ldfld_mul" { } +.assembly extern xunit.core {} .module 'ldfld_mul.exe' // MVID: {1194CBFB-CC76-4762-A87D-5001A75D57A4} .namespace JitTest @@ -81,6 +82,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 425 (0x1a9) .maxstack 3 diff --git a/src/tests/JIT/Methodical/int64/signed/s_ldfld_mulovf.il b/src/tests/JIT/Methodical/int64/signed/s_ldfld_mulovf.il index c600fd72b541c4..6351f96f7eae4e 100644 --- a/src/tests/JIT/Methodical/int64/signed/s_ldfld_mulovf.il +++ b/src/tests/JIT/Methodical/int64/signed/s_ldfld_mulovf.il @@ -16,6 +16,7 @@ .assembly 'ldfld_mulovf'// as "ldfld_mulovf" { } +.assembly extern xunit.core {} .module 'ldfld_mulovf.exe' // MVID: {8D78994E-61A5-4A50-98EF-B8CD04CD82A0} .namespace JitTest @@ -81,6 +82,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 424 (0x1a8) .maxstack 3 diff --git a/src/tests/JIT/Methodical/int64/signed/s_ldsfld_mul.il b/src/tests/JIT/Methodical/int64/signed/s_ldsfld_mul.il index 065979aab8a783..e60d2f1113d184 100644 --- a/src/tests/JIT/Methodical/int64/signed/s_ldsfld_mul.il +++ b/src/tests/JIT/Methodical/int64/signed/s_ldsfld_mul.il @@ -16,6 +16,7 @@ .assembly 'ldsfld_mul'// as "ldsfld_mul" { } +.assembly extern xunit.core {} .module 'ldsfld_mul.exe' // MVID: {72B54BA1-0DAB-469F-8753-50AD9A199FE2} .namespace JitTest @@ -77,6 +78,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 389 (0x185) .maxstack 2 diff --git a/src/tests/JIT/Methodical/int64/signed/s_ldsfld_mulovf.il b/src/tests/JIT/Methodical/int64/signed/s_ldsfld_mulovf.il index 27bc6a1de6bddb..b246ae090668b2 100644 --- a/src/tests/JIT/Methodical/int64/signed/s_ldsfld_mulovf.il +++ b/src/tests/JIT/Methodical/int64/signed/s_ldsfld_mulovf.il @@ -16,6 +16,7 @@ .assembly 'ldsfld_mulovf'// as "ldsfld_mulovf" { } +.assembly extern xunit.core {} .module 'ldsfld_mulovf.exe' // MVID: {54816B74-C516-4067-93B9-A895F5F3D4AA} .namespace JitTest @@ -77,6 +78,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 388 (0x184) .maxstack 2 diff --git a/src/tests/JIT/Methodical/int64/signed/s_muldiv.il b/src/tests/JIT/Methodical/int64/signed/s_muldiv.il index b5796ff0250b13..dec6a7e664fec2 100644 --- a/src/tests/JIT/Methodical/int64/signed/s_muldiv.il +++ b/src/tests/JIT/Methodical/int64/signed/s_muldiv.il @@ -16,6 +16,7 @@ .assembly 'muldiv'// as "muldiv" { } +.assembly extern xunit.core {} .module 'muldiv.exe' // MVID: {BF2F71BF-B5EC-4C96-8B9A-70A2AFBE37F8} .namespace JitTest @@ -249,6 +250,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 5045 (0x13b5) .maxstack 2 diff --git a/src/tests/JIT/Methodical/int64/superlong/superlong.il b/src/tests/JIT/Methodical/int64/superlong/superlong.il index 49ea339354fe0e..91f141beee9eee 100644 --- a/src/tests/JIT/Methodical/int64/superlong/superlong.il +++ b/src/tests/JIT/Methodical/int64/superlong/superlong.il @@ -16,6 +16,7 @@ .assembly 'superlong'// as "superlong" { } +.assembly extern xunit.core {} .module 'superlong.exe' // MVID: {571950B7-63D3-4968-948F-25114244E0B8} .namespace JitTest @@ -100,6 +101,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 305 (0x131) .maxstack 2 diff --git a/src/tests/JIT/Methodical/int64/unsigned/addsub.il b/src/tests/JIT/Methodical/int64/unsigned/addsub.il index cc3eeb9c76bce3..8885f8e6611d13 100644 --- a/src/tests/JIT/Methodical/int64/unsigned/addsub.il +++ b/src/tests/JIT/Methodical/int64/unsigned/addsub.il @@ -16,6 +16,7 @@ .assembly 'addsub' { } +.assembly extern xunit.core {} .module 'addsub.exe' // MVID: {964B45BB-9F5B-4A2B-9ECD-E062E2FE8E23} .namespace JitTest @@ -148,6 +149,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 5045 (0x13b5) .maxstack 2 diff --git a/src/tests/JIT/Methodical/int64/unsigned/ldc_mul.il b/src/tests/JIT/Methodical/int64/unsigned/ldc_mul.il index 5e58743ebbf9be..8c4829781c892a 100644 --- a/src/tests/JIT/Methodical/int64/unsigned/ldc_mul.il +++ b/src/tests/JIT/Methodical/int64/unsigned/ldc_mul.il @@ -16,6 +16,7 @@ .assembly 'ldc_mul'// as "ldc_mul" { } +.assembly extern xunit.core {} .module 'ldc_mul.exe' // MVID: {A15E1196-BF43-4EB9-B2C7-D32EC8A9CA8F} .namespace JitTest @@ -77,6 +78,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 197 (0xc5) .maxstack 4 diff --git a/src/tests/JIT/Methodical/int64/unsigned/ldc_mulovf.il b/src/tests/JIT/Methodical/int64/unsigned/ldc_mulovf.il index f136923527bc9e..223643f8a21ecb 100644 --- a/src/tests/JIT/Methodical/int64/unsigned/ldc_mulovf.il +++ b/src/tests/JIT/Methodical/int64/unsigned/ldc_mulovf.il @@ -16,6 +16,7 @@ .assembly 'ldc_mulovf'// as "ldc_mulovf" { } +.assembly extern xunit.core {} .module 'ldc_mulovf.exe' // MVID: {C6227192-F885-4DCA-9BE0-1B2B2204AB9E} .namespace JitTest @@ -77,6 +78,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 197 (0xc5) .maxstack 4 diff --git a/src/tests/JIT/Methodical/int64/unsigned/ldfld_mul.il b/src/tests/JIT/Methodical/int64/unsigned/ldfld_mul.il index 8e404e7c97b9a0..9925c70b870165 100644 --- a/src/tests/JIT/Methodical/int64/unsigned/ldfld_mul.il +++ b/src/tests/JIT/Methodical/int64/unsigned/ldfld_mul.il @@ -16,6 +16,7 @@ .assembly 'ldfld_mul'// as "ldfld_mul" { } +.assembly extern xunit.core {} .module 'ldfld_mul.exe' // MVID: {11B90F3C-E0C0-43E5-9E78-65FA3DCAAEF2} .namespace JitTest @@ -81,6 +82,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 287 (0x11f) .maxstack 3 diff --git a/src/tests/JIT/Methodical/int64/unsigned/ldfld_mulovf.il b/src/tests/JIT/Methodical/int64/unsigned/ldfld_mulovf.il index 850f9e22d0cf87..99706dd0780b69 100644 --- a/src/tests/JIT/Methodical/int64/unsigned/ldfld_mulovf.il +++ b/src/tests/JIT/Methodical/int64/unsigned/ldfld_mulovf.il @@ -15,6 +15,7 @@ .assembly 'ldfld_mulovf'// as "ldfld_mulovf" { } +.assembly extern xunit.core {} .module 'ldfld_mulovf.exe' // MVID: {5E7A07A8-98C6-40F0-BD60-5BEF6B39E28B} .namespace JitTest @@ -80,6 +81,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 287 (0x11f) .maxstack 3 diff --git a/src/tests/JIT/Methodical/int64/unsigned/ldsfld_mul.il b/src/tests/JIT/Methodical/int64/unsigned/ldsfld_mul.il index 2cd58731c0cc87..e8edabd5e17597 100644 --- a/src/tests/JIT/Methodical/int64/unsigned/ldsfld_mul.il +++ b/src/tests/JIT/Methodical/int64/unsigned/ldsfld_mul.il @@ -14,6 +14,7 @@ .assembly 'ldsfld_mul'// as "ldsfld_mul" { } +.assembly extern xunit.core {} .module 'ldsfld_mul.exe' // MVID: {B9439553-5220-4D6F-B7AA-E7754C5633EC} .namespace JitTest @@ -75,6 +76,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 260 (0x104) .maxstack 2 diff --git a/src/tests/JIT/Methodical/int64/unsigned/ldsfld_mulovf.il b/src/tests/JIT/Methodical/int64/unsigned/ldsfld_mulovf.il index d44b9b960a0d92..6acc3fcffcd726 100644 --- a/src/tests/JIT/Methodical/int64/unsigned/ldsfld_mulovf.il +++ b/src/tests/JIT/Methodical/int64/unsigned/ldsfld_mulovf.il @@ -14,6 +14,7 @@ .assembly 'ldsfld_mulovf'// as "ldsfld_mulovf" { } +.assembly extern xunit.core {} .module 'ldsfld_mulovf.exe' // MVID: {F167E31C-7032-4D75-B802-EE8B8384CBD2} .namespace JitTest @@ -75,6 +76,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 260 (0x104) .maxstack 2 diff --git a/src/tests/JIT/Methodical/int64/unsigned/muldiv.il b/src/tests/JIT/Methodical/int64/unsigned/muldiv.il index 915e1abfbdce9e..e7654e10f7ec8c 100644 --- a/src/tests/JIT/Methodical/int64/unsigned/muldiv.il +++ b/src/tests/JIT/Methodical/int64/unsigned/muldiv.il @@ -14,6 +14,7 @@ .assembly 'muldiv'// as "muldiv" { } +.assembly extern xunit.core {} .module 'muldiv.exe' // MVID: {621361D3-6C15-4D03-BB44-4DCF8A6B7FA1} .namespace JitTest @@ -197,6 +198,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 5045 (0x13b5) .maxstack 2 diff --git a/src/tests/JIT/Methodical/ldtoken/ldtoken.il b/src/tests/JIT/Methodical/ldtoken/ldtoken.il index 89008da2e5905d..c4fa7c51749c2a 100644 --- a/src/tests/JIT/Methodical/ldtoken/ldtoken.il +++ b/src/tests/JIT/Methodical/ldtoken/ldtoken.il @@ -13,6 +13,7 @@ } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit TestClass @@ -56,6 +57,9 @@ } .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (int32 V_0, diff --git a/src/tests/JIT/Methodical/ldtoken/ldtokena.il b/src/tests/JIT/Methodical/ldtoken/ldtokena.il index 340a21677f8beb..c859b62562ec8e 100644 --- a/src/tests/JIT/Methodical/ldtoken/ldtokena.il +++ b/src/tests/JIT/Methodical/ldtoken/ldtokena.il @@ -13,6 +13,7 @@ } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit TestClass @@ -56,6 +57,9 @@ } .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (int32 V_0, diff --git a/src/tests/JIT/Methodical/ldtoken/ptr_types.il b/src/tests/JIT/Methodical/ldtoken/ptr_types.il index c1d17e06e6271c..3bfa955fef758a 100644 --- a/src/tests/JIT/Methodical/ldtoken/ptr_types.il +++ b/src/tests/JIT/Methodical/ldtoken/ptr_types.il @@ -9,6 +9,7 @@ .ver 4:0:0:0 } .assembly ptr_types { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -28,6 +29,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 ldtoken int8* diff --git a/src/tests/JIT/Methodical/ldtoken/types.il b/src/tests/JIT/Methodical/ldtoken/types.il index decf7d77109efd..1504f0e2f7bdda 100644 --- a/src/tests/JIT/Methodical/ldtoken/types.il +++ b/src/tests/JIT/Methodical/ldtoken/types.il @@ -7,6 +7,7 @@ .assembly extern mscorlib { auto } .assembly types { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -39,6 +40,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 ldc.i4.1 diff --git a/src/tests/JIT/Methodical/localloc/verify/verify01_dynamic.il b/src/tests/JIT/Methodical/localloc/verify/verify01_dynamic.il index 65f3a49f7b5c18..d658e7533c504c 100644 --- a/src/tests/JIT/Methodical/localloc/verify/verify01_dynamic.il +++ b/src/tests/JIT/Methodical/localloc/verify/verify01_dynamic.il @@ -10,6 +10,7 @@ .ver 4:0:0:0 } .assembly eh01{} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit LocallocTest extends [mscorlib]System.Object @@ -17,6 +18,9 @@ .field public static int32 stackAllocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 39 (0x27) .maxstack 1 diff --git a/src/tests/JIT/Methodical/localloc/verify/verify01_large.il b/src/tests/JIT/Methodical/localloc/verify/verify01_large.il index 165d173d62c421..6275ca03cb427a 100644 --- a/src/tests/JIT/Methodical/localloc/verify/verify01_large.il +++ b/src/tests/JIT/Methodical/localloc/verify/verify01_large.il @@ -10,12 +10,16 @@ .ver 4:0:0:0 } .assembly eh01{} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit LocallocTest extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 39 (0x27) .maxstack 1 diff --git a/src/tests/JIT/Methodical/localloc/verify/verify01_small.il b/src/tests/JIT/Methodical/localloc/verify/verify01_small.il index f7e9e5838bdf50..580880fd254b7b 100644 --- a/src/tests/JIT/Methodical/localloc/verify/verify01_small.il +++ b/src/tests/JIT/Methodical/localloc/verify/verify01_small.il @@ -10,12 +10,16 @@ .ver 4:0:0:0 } .assembly eh01{} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit LocallocTest extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 39 (0x27) .maxstack 1 diff --git a/src/tests/JIT/Methodical/localloc/zeroinit/zeroinit01_large.il b/src/tests/JIT/Methodical/localloc/zeroinit/zeroinit01_large.il index 5784cc97259938..64c118a3714a37 100644 --- a/src/tests/JIT/Methodical/localloc/zeroinit/zeroinit01_large.il +++ b/src/tests/JIT/Methodical/localloc/zeroinit/zeroinit01_large.il @@ -9,6 +9,7 @@ .ver 4:0:0:0 } .assembly zeroinit01{} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit T extends [mscorlib]System.Object @@ -16,6 +17,9 @@ .field public static int32 size_to_test .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 79 (0x4f) .maxstack 3 diff --git a/src/tests/JIT/Methodical/localloc/zeroinit/zeroinit01_small.il b/src/tests/JIT/Methodical/localloc/zeroinit/zeroinit01_small.il index adb36e309a9046..10104ae91ac208 100644 --- a/src/tests/JIT/Methodical/localloc/zeroinit/zeroinit01_small.il +++ b/src/tests/JIT/Methodical/localloc/zeroinit/zeroinit01_small.il @@ -9,6 +9,7 @@ .ver 4:0:0:0 } .assembly zeroinit01{} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit T extends [mscorlib]System.Object @@ -16,6 +17,9 @@ .field public static int32 size_to_test .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 79 (0x4f) .maxstack 3 diff --git a/src/tests/JIT/Methodical/nonvirtualcall/classic.il b/src/tests/JIT/Methodical/nonvirtualcall/classic.il index 0f356586b61946..2e105e2a94bbf5 100644 --- a/src/tests/JIT/Methodical/nonvirtualcall/classic.il +++ b/src/tests/JIT/Methodical/nonvirtualcall/classic.il @@ -22,6 +22,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module program.exe .imagebase 0x00400000 .file alignment 0x00000200 @@ -683,6 +684,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (class [mscorlib]System.Exception V_0, diff --git a/src/tests/JIT/Methodical/nonvirtualcall/delegate.il b/src/tests/JIT/Methodical/nonvirtualcall/delegate.il index 5554ff213cb927..bea1770121ac12 100644 --- a/src/tests/JIT/Methodical/nonvirtualcall/delegate.il +++ b/src/tests/JIT/Methodical/nonvirtualcall/delegate.il @@ -22,6 +22,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module delegate.exe .imagebase 0x00400000 .file alignment 0x00000200 @@ -568,6 +569,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (class [mscorlib]System.Exception V_0, diff --git a/src/tests/JIT/Methodical/nonvirtualcall/generics.il b/src/tests/JIT/Methodical/nonvirtualcall/generics.il index af3690d4153126..6f987630c4959d 100644 --- a/src/tests/JIT/Methodical/nonvirtualcall/generics.il +++ b/src/tests/JIT/Methodical/nonvirtualcall/generics.il @@ -22,6 +22,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module nonvirtualcalls_generics.exe .imagebase 0x00400000 .file alignment 0x00000200 @@ -695,6 +696,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (class [mscorlib]System.Exception V_0, diff --git a/src/tests/JIT/Methodical/nonvirtualcall/generics2.il b/src/tests/JIT/Methodical/nonvirtualcall/generics2.il index ab670e43d87d73..b0618b35b3f50d 100644 --- a/src/tests/JIT/Methodical/nonvirtualcall/generics2.il +++ b/src/tests/JIT/Methodical/nonvirtualcall/generics2.il @@ -23,6 +23,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module nonvirtualcalls_generics2.exe // MVID: {5D0110E9-A5F8-484A-97F5-D5C79C5A9A77} .imagebase 0x00400000 @@ -729,6 +730,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 64 (0x40) .maxstack 1 diff --git a/src/tests/JIT/Methodical/nonvirtualcall/tailcall.il b/src/tests/JIT/Methodical/nonvirtualcall/tailcall.il index b5f49e8756cbf2..547e26390c40c3 100644 --- a/src/tests/JIT/Methodical/nonvirtualcall/tailcall.il +++ b/src/tests/JIT/Methodical/nonvirtualcall/tailcall.il @@ -12,6 +12,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module nonvirtualcalls_tailcall.exe // MVID: {EC3860F1-6469-489C-86D2-A81D88AE196E} .imagebase 0x00400000 @@ -602,6 +603,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 52 (0x34) .maxstack 1 diff --git a/src/tests/JIT/Methodical/nonvirtualcall/valuetype.il b/src/tests/JIT/Methodical/nonvirtualcall/valuetype.il index d2fdb41716eff9..f3e243490fea65 100644 --- a/src/tests/JIT/Methodical/nonvirtualcall/valuetype.il +++ b/src/tests/JIT/Methodical/nonvirtualcall/valuetype.il @@ -23,6 +23,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module valuetype.exe // MVID: {AF04A73C-C896-4A00-97F2-959EE06A9394} .imagebase 0x00400000 @@ -116,6 +117,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 52 (0x34) .maxstack 1 diff --git a/src/tests/JIT/Methodical/refany/array1.il b/src/tests/JIT/Methodical/refany/array1.il index a7a6e3e9fe3532..d4d7820e294f8f 100644 --- a/src/tests/JIT/Methodical/refany/array1.il +++ b/src/tests/JIT/Methodical/refany/array1.il @@ -14,6 +14,7 @@ .assembly array1// as "array1" { } +.assembly extern xunit.core {} .module array1.exe // MVID: {F8BFB824-C7D0-485F-A06E-07B6D1F1151B} .namespace JitTest @@ -211,6 +212,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 438 (0x1b6) .maxstack 5 diff --git a/src/tests/JIT/Methodical/refany/array2.il b/src/tests/JIT/Methodical/refany/array2.il index 7c3558237b6026..531cfeda61c7d5 100644 --- a/src/tests/JIT/Methodical/refany/array2.il +++ b/src/tests/JIT/Methodical/refany/array2.il @@ -14,6 +14,7 @@ .assembly array2// as "array2" { } +.assembly extern xunit.core {} .module array2.exe // MVID: {1781A471-82F3-4159-8D0F-B3B5A9FF1BB6} .namespace JitTest @@ -122,6 +123,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 150 (0x96) .maxstack 4 diff --git a/src/tests/JIT/Methodical/refany/array3.il b/src/tests/JIT/Methodical/refany/array3.il index 8777ba58b079dd..331d440f402136 100644 --- a/src/tests/JIT/Methodical/refany/array3.il +++ b/src/tests/JIT/Methodical/refany/array3.il @@ -14,6 +14,7 @@ .assembly array2// as "array2" { } +.assembly extern xunit.core {} .module array2.exe // MVID: {1781A471-82F3-4159-8D0F-B3B5A9FF1BB6} .namespace JitTest @@ -124,6 +125,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 150 (0x96) .maxstack 4 diff --git a/src/tests/JIT/Methodical/refany/format.il b/src/tests/JIT/Methodical/refany/format.il index 2c477bc91e709d..257d7c8e44fe75 100644 --- a/src/tests/JIT/Methodical/refany/format.il +++ b/src/tests/JIT/Methodical/refany/format.il @@ -13,6 +13,7 @@ .assembly format// as "format" { } +.assembly extern xunit.core {} .module format.exe .namespace JitTest { @@ -1121,6 +1122,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 IL_0000: call void JitTest.TestClass::TestLocals() diff --git a/src/tests/JIT/Methodical/refany/indcall.il b/src/tests/JIT/Methodical/refany/indcall.il index 3284c7d0368055..c7b7f17215388c 100644 --- a/src/tests/JIT/Methodical/refany/indcall.il +++ b/src/tests/JIT/Methodical/refany/indcall.il @@ -13,6 +13,7 @@ } +.assembly extern xunit.core {} .module 'bug.exe' .namespace JitTest { @@ -56,6 +57,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 6 .locals (int32 V_0, int32) diff --git a/src/tests/JIT/Methodical/refany/lcs.il b/src/tests/JIT/Methodical/refany/lcs.il index a28e4ab9a0b221..4107c24c67aafd 100644 --- a/src/tests/JIT/Methodical/refany/lcs.il +++ b/src/tests/JIT/Methodical/refany/lcs.il @@ -17,6 +17,7 @@ .assembly lcs// as "lcs" { } +.assembly extern xunit.core {} .module lcs.exe .namespace JitTest { @@ -588,6 +589,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 .locals (string[] V_0, diff --git a/src/tests/JIT/Methodical/refany/longsig.il b/src/tests/JIT/Methodical/refany/longsig.il index 5dd3e8c0b67cc3..2a3bee82139c41 100644 --- a/src/tests/JIT/Methodical/refany/longsig.il +++ b/src/tests/JIT/Methodical/refany/longsig.il @@ -13,6 +13,7 @@ .assembly format// as "format" { } +.assembly extern xunit.core {} .module format.exe .namespace JitTest { @@ -1121,6 +1122,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 IL_0000: call void JitTest.TestClass::TestLocals() diff --git a/src/tests/JIT/Methodical/refany/native.il b/src/tests/JIT/Methodical/refany/native.il index e8dd544325111f..50a9f7ef7c1c70 100644 --- a/src/tests/JIT/Methodical/refany/native.il +++ b/src/tests/JIT/Methodical/refany/native.il @@ -14,6 +14,7 @@ .assembly 'native'// as "native" { } +.assembly extern xunit.core {} .module native.exe // MVID: {C18F1061-8239-420B-AC69-D4CB0BB38F2B} .namespace JitTest @@ -24,6 +25,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 92 (0x5c) .maxstack 2 diff --git a/src/tests/JIT/Methodical/refany/seq.il b/src/tests/JIT/Methodical/refany/seq.il index 9dca180b8e1d18..5925ecdde73b2b 100644 --- a/src/tests/JIT/Methodical/refany/seq.il +++ b/src/tests/JIT/Methodical/refany/seq.il @@ -14,6 +14,7 @@ .assembly 'native'// as "native" { } +.assembly extern xunit.core {} .module native.exe // MVID: {C18F1061-8239-420B-AC69-D4CB0BB38F2B} .namespace JitTest @@ -114,6 +115,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (unsigned int64) diff --git a/src/tests/JIT/Methodical/refany/shortsig.il b/src/tests/JIT/Methodical/refany/shortsig.il index 3e6b71970f9b70..01b6d714b126d0 100644 --- a/src/tests/JIT/Methodical/refany/shortsig.il +++ b/src/tests/JIT/Methodical/refany/shortsig.il @@ -13,6 +13,7 @@ .assembly format// as "format" { } +.assembly extern xunit.core {} .namespace JitTest { .class public auto ansi sealed PlatformID @@ -1120,6 +1121,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 IL_0000: call void JitTest.TestClass::TestLocals() diff --git a/src/tests/JIT/Methodical/refany/stress2.il b/src/tests/JIT/Methodical/refany/stress2.il index cf317d5f52c3a9..d954dee0076081 100644 --- a/src/tests/JIT/Methodical/refany/stress2.il +++ b/src/tests/JIT/Methodical/refany/stress2.il @@ -14,6 +14,7 @@ .assembly stress2// as "stress2" { } +.assembly extern xunit.core {} .module stress2.exe // MVID: {5A1483AA-BABB-44FA-9E05-6A081C8BFE56} .namespace JitTest @@ -24,6 +25,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 28 (0x1c) .maxstack 1 diff --git a/src/tests/JIT/Methodical/refany/u_native.il b/src/tests/JIT/Methodical/refany/u_native.il index e7d3add4ccaa7d..303c0c4564ee43 100644 --- a/src/tests/JIT/Methodical/refany/u_native.il +++ b/src/tests/JIT/Methodical/refany/u_native.il @@ -14,6 +14,7 @@ .assembly 'native'// as "native" { } +.assembly extern xunit.core {} .module native.exe // MVID: {C18F1061-8239-420B-AC69-D4CB0BB38F2B} .namespace JitTest @@ -24,6 +25,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 92 (0x5c) .maxstack 2 diff --git a/src/tests/JIT/Methodical/switch/switch1.il b/src/tests/JIT/Methodical/switch/switch1.il index 20daed5f9d4622..c255dbb91ec912 100644 --- a/src/tests/JIT/Methodical/switch/switch1.il +++ b/src/tests/JIT/Methodical/switch/switch1.il @@ -11,6 +11,7 @@ } +.assembly extern xunit.core {} .module 'switch1.exe' @@ -50,6 +51,9 @@ .method public hidebysig static void Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 IL_0000: ldc.i4.1 diff --git a/src/tests/JIT/Methodical/switch/switch10.il b/src/tests/JIT/Methodical/switch/switch10.il index 9c15de5916c378..ffbaf70eea935a 100644 --- a/src/tests/JIT/Methodical/switch/switch10.il +++ b/src/tests/JIT/Methodical/switch/switch10.il @@ -11,6 +11,7 @@ } +.assembly extern xunit.core {} .module 'switch10.exe' @@ -73,6 +74,9 @@ .method public hidebysig static void Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 IL_0000: ldc.i4.1 diff --git a/src/tests/JIT/Methodical/switch/switch11.il b/src/tests/JIT/Methodical/switch/switch11.il index 005e805ec1861b..b689131a600bb1 100644 --- a/src/tests/JIT/Methodical/switch/switch11.il +++ b/src/tests/JIT/Methodical/switch/switch11.il @@ -11,6 +11,7 @@ } +.assembly extern xunit.core {} .module 'switch11.exe' @@ -19,6 +20,9 @@ { .method public hidebysig static void Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 ldc.i4.5 diff --git a/src/tests/JIT/Methodical/switch/switch2.il b/src/tests/JIT/Methodical/switch/switch2.il index cf756727f1d714..e4f80e44d5fd8e 100644 --- a/src/tests/JIT/Methodical/switch/switch2.il +++ b/src/tests/JIT/Methodical/switch/switch2.il @@ -11,6 +11,7 @@ } +.assembly extern xunit.core {} .module 'switch2.exe' .class public auto ansi Test_switch2 @@ -76,6 +77,9 @@ .method public hidebysig static void Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 IL_0000: ldc.i4.1 diff --git a/src/tests/JIT/Methodical/switch/switch3.il b/src/tests/JIT/Methodical/switch/switch3.il index 21653c9aea32f5..db5c3a0cf2a1e9 100644 --- a/src/tests/JIT/Methodical/switch/switch3.il +++ b/src/tests/JIT/Methodical/switch/switch3.il @@ -11,6 +11,7 @@ } +.assembly extern xunit.core {} .module 'switch3.exe' @@ -50,6 +51,9 @@ .method public hidebysig static void Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 IL_0000: ldc.i4.1 diff --git a/src/tests/JIT/Methodical/switch/switch4.il b/src/tests/JIT/Methodical/switch/switch4.il index 179b7d06e5c6fc..e365a0c4c9bc6f 100644 --- a/src/tests/JIT/Methodical/switch/switch4.il +++ b/src/tests/JIT/Methodical/switch/switch4.il @@ -11,6 +11,7 @@ } +.assembly extern xunit.core {} .module 'switch4.exe' @@ -72,6 +73,9 @@ .method public hidebysig static void Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 IL_0000: ldc.i4.1 diff --git a/src/tests/JIT/Methodical/switch/switch5.il b/src/tests/JIT/Methodical/switch/switch5.il index 39219ac2c99c20..f4f60cafdc1e63 100644 --- a/src/tests/JIT/Methodical/switch/switch5.il +++ b/src/tests/JIT/Methodical/switch/switch5.il @@ -11,6 +11,7 @@ } +.assembly extern xunit.core {} .module 'switch5.exe' @@ -141,6 +142,9 @@ { .method public hidebysig static void Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals (class TestStack V_0) diff --git a/src/tests/JIT/Methodical/switch/switch6.il b/src/tests/JIT/Methodical/switch/switch6.il index 5b3cbcd771917f..6482f1e08b17f8 100644 --- a/src/tests/JIT/Methodical/switch/switch6.il +++ b/src/tests/JIT/Methodical/switch/switch6.il @@ -12,6 +12,7 @@ } +.assembly extern xunit.core {} .module 'switch6.exe' @@ -82,6 +83,9 @@ .method public hidebysig static void Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 IL_0000: ldc.i4.1 diff --git a/src/tests/JIT/Methodical/switch/switch7.il b/src/tests/JIT/Methodical/switch/switch7.il index 224ecdef3b4adb..848df2ae9bd237 100644 --- a/src/tests/JIT/Methodical/switch/switch7.il +++ b/src/tests/JIT/Methodical/switch/switch7.il @@ -11,6 +11,7 @@ } +.assembly extern xunit.core {} .module 'switch7.exe' @@ -58,6 +59,9 @@ .method public hidebysig static void Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/switch/switch8.il b/src/tests/JIT/Methodical/switch/switch8.il index 548b3a55bcf446..47107b388e0813 100644 --- a/src/tests/JIT/Methodical/switch/switch8.il +++ b/src/tests/JIT/Methodical/switch/switch8.il @@ -11,6 +11,7 @@ } +.assembly extern xunit.core {} .module 'switch8.exe' @@ -52,6 +53,9 @@ .method public hidebysig static void Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 IL_0000: ldc.i4.2 diff --git a/src/tests/JIT/Methodical/switch/switch9.il b/src/tests/JIT/Methodical/switch/switch9.il index ca2296d29bede4..d7fdcc75aa9d27 100644 --- a/src/tests/JIT/Methodical/switch/switch9.il +++ b/src/tests/JIT/Methodical/switch/switch9.il @@ -11,6 +11,7 @@ } +.assembly extern xunit.core {} .module 'switch9.exe' @@ -79,6 +80,9 @@ .method public hidebysig static void Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 IL_0000: ldc.i4.1 diff --git a/src/tests/JIT/Methodical/tailcall/compat_enum.il b/src/tests/JIT/Methodical/tailcall/compat_enum.il index 7b973c89c78770..9b5b7765e1cb41 100644 --- a/src/tests/JIT/Methodical/tailcall/compat_enum.il +++ b/src/tests/JIT/Methodical/tailcall/compat_enum.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly compat_enum { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi serializable sealed TestEnum extends [mscorlib]System.Enum @@ -38,6 +39,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 40 (0x28) .maxstack 2 diff --git a/src/tests/JIT/Methodical/tailcall/compat_i2_bool.il b/src/tests/JIT/Methodical/tailcall/compat_i2_bool.il index f52f51b2f3264f..a676a17a8a5fee 100644 --- a/src/tests/JIT/Methodical/tailcall/compat_i2_bool.il +++ b/src/tests/JIT/Methodical/tailcall/compat_i2_bool.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly compat_i2_bool { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -71,6 +72,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 40 (0x28) .maxstack 2 diff --git a/src/tests/JIT/Methodical/tailcall/compat_i4_i1.il b/src/tests/JIT/Methodical/tailcall/compat_i4_i1.il index f2df547b9c0ddf..ebff8f0dd5d299 100644 --- a/src/tests/JIT/Methodical/tailcall/compat_i4_i1.il +++ b/src/tests/JIT/Methodical/tailcall/compat_i4_i1.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly compat_i4_i1 { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -71,6 +72,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 40 (0x28) .maxstack 2 diff --git a/src/tests/JIT/Methodical/tailcall/compat_i4_u.il b/src/tests/JIT/Methodical/tailcall/compat_i4_u.il index a9738da9a7aed3..44ae12d0004b58 100644 --- a/src/tests/JIT/Methodical/tailcall/compat_i4_u.il +++ b/src/tests/JIT/Methodical/tailcall/compat_i4_u.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly compat_i4_u { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -71,6 +72,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 40 (0x28) .maxstack 2 diff --git a/src/tests/JIT/Methodical/tailcall/compat_i_u2.il b/src/tests/JIT/Methodical/tailcall/compat_i_u2.il index 2101954f7b6810..afbd9218d3ad18 100644 --- a/src/tests/JIT/Methodical/tailcall/compat_i_u2.il +++ b/src/tests/JIT/Methodical/tailcall/compat_i_u2.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly compat_i_u2 { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -71,6 +72,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 40 (0x28) .maxstack 2 diff --git a/src/tests/JIT/Methodical/tailcall/compat_obj.il b/src/tests/JIT/Methodical/tailcall/compat_obj.il index 98a4c1ff041d7a..e9ecbc9ab720b7 100644 --- a/src/tests/JIT/Methodical/tailcall/compat_obj.il +++ b/src/tests/JIT/Methodical/tailcall/compat_obj.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly compat_obj { } +.assembly extern xunit.core {} .namespace JitTest { .class public auto ansi beforefieldinit BaseClass @@ -56,6 +57,9 @@ .method public hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 39 (0x27) .maxstack 1 diff --git a/src/tests/JIT/Methodical/tailcall/compat_r4_r8.il b/src/tests/JIT/Methodical/tailcall/compat_r4_r8.il index 56a2e947c59e6e..113da60a5228be 100644 --- a/src/tests/JIT/Methodical/tailcall/compat_r4_r8.il +++ b/src/tests/JIT/Methodical/tailcall/compat_r4_r8.il @@ -8,6 +8,7 @@ } .assembly extern mscorlib { } .assembly compat_r4_r8 { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -69,6 +70,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/tailcall/compat_r4_r8_inl.il b/src/tests/JIT/Methodical/tailcall/compat_r4_r8_inl.il index 0b9632a7e29975..0d36ae9a6500a0 100644 --- a/src/tests/JIT/Methodical/tailcall/compat_r4_r8_inl.il +++ b/src/tests/JIT/Methodical/tailcall/compat_r4_r8_inl.il @@ -8,6 +8,7 @@ } .assembly extern mscorlib { } .assembly compat_r4_r8_inl { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -33,6 +34,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/tailcall/compat_r8_r4.il b/src/tests/JIT/Methodical/tailcall/compat_r8_r4.il index cd303618a22447..46ae0478b84be1 100644 --- a/src/tests/JIT/Methodical/tailcall/compat_r8_r4.il +++ b/src/tests/JIT/Methodical/tailcall/compat_r8_r4.il @@ -8,6 +8,7 @@ } .assembly extern mscorlib { } .assembly compat_r8_r4 { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -69,6 +70,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/tailcall/compat_r8_r4_inl.il b/src/tests/JIT/Methodical/tailcall/compat_r8_r4_inl.il index 5a0d42a1255911..6c4a9c8975c458 100644 --- a/src/tests/JIT/Methodical/tailcall/compat_r8_r4_inl.il +++ b/src/tests/JIT/Methodical/tailcall/compat_r8_r4_inl.il @@ -8,6 +8,7 @@ } .assembly extern mscorlib { } .assembly compat_r8_r4_inl { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -33,6 +34,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/tailcall/compat_v.il b/src/tests/JIT/Methodical/tailcall/compat_v.il index b30d052a712e2c..4fe9553bd2393f 100644 --- a/src/tests/JIT/Methodical/tailcall/compat_v.il +++ b/src/tests/JIT/Methodical/tailcall/compat_v.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly compat_v { } +.assembly extern xunit.core {} .namespace JitTest { .class public sequential ansi sealed beforefieldinit BaseStruct @@ -57,6 +58,9 @@ .method public hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 55 (0x37) .maxstack 1 diff --git a/src/tests/JIT/Methodical/tailcall/deep_array.il b/src/tests/JIT/Methodical/tailcall/deep_array.il index ab0fc88da0e4ad..f239ac926c6f07 100644 --- a/src/tests/JIT/Methodical/tailcall/deep_array.il +++ b/src/tests/JIT/Methodical/tailcall/deep_array.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly deep_array { } +.assembly extern xunit.core {} .namespace JitTest { .class public auto ansi beforefieldinit TestClass extends [mscorlib]System.Object @@ -875,6 +876,9 @@ REM: .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 78 (0x4e) .maxstack 8 diff --git a/src/tests/JIT/Methodical/tailcall/deep_array_nz.il b/src/tests/JIT/Methodical/tailcall/deep_array_nz.il index e1cc4825254d67..f50e2c7cfd3170 100644 --- a/src/tests/JIT/Methodical/tailcall/deep_array_nz.il +++ b/src/tests/JIT/Methodical/tailcall/deep_array_nz.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly deep_array_nz { } +.assembly extern xunit.core {} .namespace JitTest { .class public auto ansi beforefieldinit TestClass extends [mscorlib]System.Object @@ -875,6 +876,9 @@ REM: .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 78 (0x4e) .maxstack 8 diff --git a/src/tests/JIT/Methodical/tailcall/deep_gc.il b/src/tests/JIT/Methodical/tailcall/deep_gc.il index 1dde75f2d65bd7..ceb84e3b36816e 100644 --- a/src/tests/JIT/Methodical/tailcall/deep_gc.il +++ b/src/tests/JIT/Methodical/tailcall/deep_gc.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly deep_gc { } +.assembly extern xunit.core {} .namespace JitTest { .class public auto ansi beforefieldinit TestClass @@ -1151,6 +1152,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 78 (0x4e) .maxstack 8 diff --git a/src/tests/JIT/Methodical/tailcall/deep_inst.il b/src/tests/JIT/Methodical/tailcall/deep_inst.il index a73d179f634835..6f23d5e23dd190 100644 --- a/src/tests/JIT/Methodical/tailcall/deep_inst.il +++ b/src/tests/JIT/Methodical/tailcall/deep_inst.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly deep_inst { } +.assembly extern xunit.core {} .namespace JitTest { .class public auto ansi beforefieldinit TestClass @@ -1151,6 +1152,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 78 (0x4e) .maxstack 8 diff --git a/src/tests/JIT/Methodical/tailcall/deep_value.il b/src/tests/JIT/Methodical/tailcall/deep_value.il index a900f4d04c47d2..12915076e1bd15 100644 --- a/src/tests/JIT/Methodical/tailcall/deep_value.il +++ b/src/tests/JIT/Methodical/tailcall/deep_value.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly deep_value { } +.assembly extern xunit.core {} .namespace JitTest { .class public auto ansi sealed ValueClass @@ -1231,6 +1232,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 93 (0x5d) .maxstack 8 diff --git a/src/tests/JIT/Methodical/tailcall/deep_virt.il b/src/tests/JIT/Methodical/tailcall/deep_virt.il index 6393282c740134..67703b5970d006 100644 --- a/src/tests/JIT/Methodical/tailcall/deep_virt.il +++ b/src/tests/JIT/Methodical/tailcall/deep_virt.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly deep_virt { } +.assembly extern xunit.core {} .namespace JitTest { .class public auto ansi beforefieldinit TestClass @@ -1151,6 +1152,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 78 (0x4e) .maxstack 8 diff --git a/src/tests/JIT/Methodical/tailcall/gcval.il b/src/tests/JIT/Methodical/tailcall/gcval.il index 5632492e96bbc1..ef433314e27367 100644 --- a/src/tests/JIT/Methodical/tailcall/gcval.il +++ b/src/tests/JIT/Methodical/tailcall/gcval.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly gcval { } +.assembly extern xunit.core {} .namespace JitTest { .class private sequential ansi sealed beforefieldinit LargeVT @@ -47,6 +48,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 46 (0x2e) .maxstack 2 diff --git a/src/tests/JIT/Methodical/tailcall/gcval_nested.il b/src/tests/JIT/Methodical/tailcall/gcval_nested.il index 547856c114f31a..11c75ca49d36f7 100644 --- a/src/tests/JIT/Methodical/tailcall/gcval_nested.il +++ b/src/tests/JIT/Methodical/tailcall/gcval_nested.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly gcval { } +.assembly extern xunit.core {} .namespace JitTest { .class private sequential ansi sealed beforefieldinit LargeVT @@ -59,6 +60,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 46 (0x2e) .maxstack 2 diff --git a/src/tests/JIT/Methodical/tailcall/gcval_sideeffect.il b/src/tests/JIT/Methodical/tailcall/gcval_sideeffect.il index f22a0182302417..def9ef7ef0b0cc 100644 --- a/src/tests/JIT/Methodical/tailcall/gcval_sideeffect.il +++ b/src/tests/JIT/Methodical/tailcall/gcval_sideeffect.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly gcval_sideeffect { } +.assembly extern xunit.core {} .namespace JitTest { .class private sequential ansi sealed beforefieldinit LargeVT @@ -50,6 +51,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 46 (0x2e) .maxstack 2 diff --git a/src/tests/JIT/Methodical/tailcall/recurse_ep.il b/src/tests/JIT/Methodical/tailcall/recurse_ep.il index 1a7262f10368cd..604888c9cdf97d 100644 --- a/src/tests/JIT/Methodical/tailcall/recurse_ep.il +++ b/src/tests/JIT/Methodical/tailcall/recurse_ep.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly recurse_ep { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -18,6 +19,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 93 (0x5d) .maxstack 4 diff --git a/src/tests/JIT/Methodical/tailcall/recurse_ep_void.il b/src/tests/JIT/Methodical/tailcall/recurse_ep_void.il index 047e510383a18c..02eb788946b8dc 100644 --- a/src/tests/JIT/Methodical/tailcall/recurse_ep_void.il +++ b/src/tests/JIT/Methodical/tailcall/recurse_ep_void.il @@ -7,6 +7,7 @@ .assembly extern mscorlib { auto } .assembly recurse_ep_void { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -17,6 +18,9 @@ .method private hidebysig static void Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/tailcall/test_2a.il b/src/tests/JIT/Methodical/tailcall/test_2a.il index a75b6543a8b2b4..737a281e6f2964 100644 --- a/src/tests/JIT/Methodical/tailcall/test_2a.il +++ b/src/tests/JIT/Methodical/tailcall/test_2a.il @@ -7,6 +7,7 @@ .assembly extern mscorlib { auto } .assembly test_2a { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -16,6 +17,9 @@ .field private static int32 n .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/tailcall/test_2b.il b/src/tests/JIT/Methodical/tailcall/test_2b.il index 070f6c0e3429fc..ef25fad1688c23 100644 --- a/src/tests/JIT/Methodical/tailcall/test_2b.il +++ b/src/tests/JIT/Methodical/tailcall/test_2b.il @@ -8,6 +8,7 @@ .assembly extern System.Console { auto } .assembly test_2b { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -17,6 +18,9 @@ .field private static int32 n .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/tailcall/test_2c.il b/src/tests/JIT/Methodical/tailcall/test_2c.il index 78189c2a41cf41..3f830ca5d8fb8f 100644 --- a/src/tests/JIT/Methodical/tailcall/test_2c.il +++ b/src/tests/JIT/Methodical/tailcall/test_2c.il @@ -7,6 +7,7 @@ .assembly extern mscorlib { auto } .assembly test_2c { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -16,6 +17,9 @@ .field private static int32 n .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/tailcall/test_3b.il b/src/tests/JIT/Methodical/tailcall/test_3b.il index e4b70e332e31cf..b08f5d2b604dde 100644 --- a/src/tests/JIT/Methodical/tailcall/test_3b.il +++ b/src/tests/JIT/Methodical/tailcall/test_3b.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly test_3b { } +.assembly extern xunit.core {} .namespace JitTest { .class private value sealed ansi beforefieldinit ValueClass @@ -50,6 +51,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 38 (0x26) .maxstack 1 diff --git a/src/tests/JIT/Methodical/tailcall/test_implicit.il b/src/tests/JIT/Methodical/tailcall/test_implicit.il index a0c757c65cc323..aa48fc77869fa1 100644 --- a/src/tests/JIT/Methodical/tailcall/test_implicit.il +++ b/src/tests/JIT/Methodical/tailcall/test_implicit.il @@ -14,6 +14,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module tailcall.exe .imagebase 0x00400000 .file alignment 0x00000200 @@ -270,6 +271,9 @@ ret .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals init (class Class1 V_0, diff --git a/src/tests/JIT/Methodical/tailcall/test_mutual_rec.il b/src/tests/JIT/Methodical/tailcall/test_mutual_rec.il index d1c81a6224d3c0..378d6b5aa84c07 100644 --- a/src/tests/JIT/Methodical/tailcall/test_mutual_rec.il +++ b/src/tests/JIT/Methodical/tailcall/test_mutual_rec.il @@ -7,6 +7,7 @@ .assembly extern mscorlib { auto } .assembly test_mutual_rec { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -16,6 +17,9 @@ .field private static int32 n .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/tailcall/test_switch.il b/src/tests/JIT/Methodical/tailcall/test_switch.il index 7617103224da2f..92917b40c46695 100644 --- a/src/tests/JIT/Methodical/tailcall/test_switch.il +++ b/src/tests/JIT/Methodical/tailcall/test_switch.il @@ -7,6 +7,7 @@ .assembly extern mscorlib { auto } .assembly test_switch { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -34,6 +35,9 @@ } .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/tailcall/test_virt.il b/src/tests/JIT/Methodical/tailcall/test_virt.il index ffc4eaf028eb1c..6cf8067e7b5271 100644 --- a/src/tests/JIT/Methodical/tailcall/test_virt.il +++ b/src/tests/JIT/Methodical/tailcall/test_virt.il @@ -7,6 +7,7 @@ .assembly extern mscorlib { auto } .assembly test_virt { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit TestClass extends [mscorlib]System.Object @@ -15,6 +16,9 @@ .field private static int32 n .method private hidebysig virtual instance int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .maxstack 4 .locals (int32 V_0) ldc.i4.1 diff --git a/src/tests/JIT/Methodical/tailcall/test_void.il b/src/tests/JIT/Methodical/tailcall/test_void.il index bc5a15fde8580b..52b6821860a550 100644 --- a/src/tests/JIT/Methodical/tailcall/test_void.il +++ b/src/tests/JIT/Methodical/tailcall/test_void.il @@ -7,6 +7,7 @@ .assembly extern mscorlib { auto } .assembly test_void { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test extends [mscorlib]System.Object @@ -15,6 +16,9 @@ .field private static int32 n .method private hidebysig static void Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/tailcall_v4/delegateTail.il b/src/tests/JIT/Methodical/tailcall_v4/delegateTail.il index 82f033f96841ae..0c8b2c52cb9ed9 100644 --- a/src/tests/JIT/Methodical/tailcall_v4/delegateTail.il +++ b/src/tests/JIT/Methodical/tailcall_v4/delegateTail.il @@ -21,6 +21,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module repro.exe .imagebase 0x00400000 .file alignment 0x00000200 @@ -126,6 +127,9 @@ { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 .locals init (class [System.Runtime]System.Func`10 V_0, diff --git a/src/tests/JIT/Methodical/tailcall_v4/hijacking.il b/src/tests/JIT/Methodical/tailcall_v4/hijacking.il index 4be82b1720b5b6..0a8c24dad235c7 100644 --- a/src/tests/JIT/Methodical/tailcall_v4/hijacking.il +++ b/src/tests/JIT/Methodical/tailcall_v4/hijacking.il @@ -33,6 +33,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module hijacking.exe // MVID: {7A6D7819-76F7-4311-967C-7CC804775914} .custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -232,6 +233,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 300 (0x12c) .maxstack 5 diff --git a/src/tests/JIT/Methodical/tailcall_v4/smallFrame.il b/src/tests/JIT/Methodical/tailcall_v4/smallFrame.il index e9a48512d9cd7b..cc7966e01f508e 100644 --- a/src/tests/JIT/Methodical/tailcall_v4/smallFrame.il +++ b/src/tests/JIT/Methodical/tailcall_v4/smallFrame.il @@ -29,6 +29,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module retbuf_bug.exe // MVID: {FD923469-B98F-4B21-ABCA-4105B0A8ED94} .imagebase 0x00400000 @@ -62,6 +63,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 408 (0x198) .maxstack 2 diff --git a/src/tests/JIT/Methodical/xxblk/dynblk.il b/src/tests/JIT/Methodical/xxblk/dynblk.il index f0ab590d15ee45..71b69ac6b23f2c 100644 --- a/src/tests/JIT/Methodical/xxblk/dynblk.il +++ b/src/tests/JIT/Methodical/xxblk/dynblk.il @@ -12,6 +12,7 @@ } .assembly dynblk {} +.assembly extern xunit.core {} .class public sequential ansi sealed beforefieldinit S8 extends [mscorlib]System.ValueType @@ -37,6 +38,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (valuetype S8 S, int32 retVal, int32 size) ldloca.s S diff --git a/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_I.il b/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_I.il index 9fb409b6d7b6c3..06a591be4b9025 100644 --- a/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_I.il +++ b/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_I.il @@ -9,6 +9,7 @@ .ver 4:0:0:0 } .assembly ldobj_I { } +.assembly extern xunit.core {} .namespace JitTest { .class public auto ansi beforefieldinit Test @@ -1154,6 +1155,9 @@ ret .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 diff --git a/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_I8.il b/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_I8.il index 393a63bc154166..24b248af565fbe 100644 --- a/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_I8.il +++ b/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_I8.il @@ -9,6 +9,7 @@ .ver 4:0:0:0 } .assembly ldobj_I8 { } +.assembly extern xunit.core {} .namespace JitTest { .class public auto ansi beforefieldinit Test @@ -1154,6 +1155,9 @@ ret .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 diff --git a/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_R4.il b/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_R4.il index c069aaac317beb..ef99bd44b330fa 100644 --- a/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_R4.il +++ b/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_R4.il @@ -9,6 +9,7 @@ .ver 4:0:0:0 } .assembly ldobj_R4 { } +.assembly extern xunit.core {} .namespace JitTest { .class public auto ansi beforefieldinit Test @@ -1154,6 +1155,9 @@ ret .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 diff --git a/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_R8.il b/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_R8.il index ac83b481d0d886..246f929f61b56e 100644 --- a/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_R8.il +++ b/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_R8.il @@ -9,6 +9,7 @@ .ver 4:0:0:0 } .assembly ldobj_R8 { } +.assembly extern xunit.core {} .namespace JitTest { .class public auto ansi beforefieldinit Test @@ -1154,6 +1155,9 @@ ret .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 diff --git a/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_U2.il b/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_U2.il index 7939437142c293..db705d274f0913 100644 --- a/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_U2.il +++ b/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_U2.il @@ -9,6 +9,7 @@ .ver 4:0:0:0 } .assembly ldobj_U2 { } +.assembly extern xunit.core {} .namespace JitTest { .class public auto ansi beforefieldinit Test @@ -1154,6 +1155,9 @@ ret .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 diff --git a/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_V.il b/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_V.il index f180312affc0ba..29f63457106391 100644 --- a/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_V.il +++ b/src/tests/JIT/Methodical/xxobj/ldobj/ldobj_V.il @@ -9,6 +9,7 @@ .ver 4:0:0:0 } .assembly ldobj_V { } +.assembly extern xunit.core {} .namespace JitTest { .class public sequential ansi sealed beforefieldinit ValueClass @@ -905,6 +906,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (valuetype JitTest.ValueClass V) diff --git a/src/tests/JIT/Methodical/xxobj/operand/const.il b/src/tests/JIT/Methodical/xxobj/operand/const.il index 520afcd192d7d3..6cd407b4d3f7f7 100644 --- a/src/tests/JIT/Methodical/xxobj/operand/const.il +++ b/src/tests/JIT/Methodical/xxobj/operand/const.il @@ -11,6 +11,7 @@ .assembly 'const' { } +.assembly extern xunit.core {} .namespace JitTest { .class private sequential ansi sealed beforefieldinit Test @@ -57,6 +58,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0, int8 V_1) diff --git a/src/tests/JIT/Methodical/xxobj/operand/ldelema.il b/src/tests/JIT/Methodical/xxobj/operand/ldelema.il index 6915362c355c60..b95ae101843b67 100644 --- a/src/tests/JIT/Methodical/xxobj/operand/ldelema.il +++ b/src/tests/JIT/Methodical/xxobj/operand/ldelema.il @@ -9,6 +9,7 @@ .ver 4:0:0:0 } .assembly mdarray { } +.assembly extern xunit.core {} .namespace JitTest { .class private sequential ansi sealed beforefieldinit Test @@ -158,6 +159,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/xxobj/operand/localloc.il b/src/tests/JIT/Methodical/xxobj/operand/localloc.il index 863e140ee3c5af..3bd9b9a0540f66 100644 --- a/src/tests/JIT/Methodical/xxobj/operand/localloc.il +++ b/src/tests/JIT/Methodical/xxobj/operand/localloc.il @@ -9,6 +9,7 @@ .assembly extern mscorlib { } .assembly 'localloc' { } +.assembly extern xunit.core {} .namespace JitTest { .class private sequential ansi sealed beforefieldinit Test @@ -174,6 +175,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/xxobj/operand/mdarray.il b/src/tests/JIT/Methodical/xxobj/operand/mdarray.il index 1eea79a00fae70..e93967783f2c40 100644 --- a/src/tests/JIT/Methodical/xxobj/operand/mdarray.il +++ b/src/tests/JIT/Methodical/xxobj/operand/mdarray.il @@ -9,6 +9,7 @@ .ver 4:0:0:0 } .assembly mdarray { } +.assembly extern xunit.core {} .namespace JitTest { .class private sequential ansi sealed beforefieldinit Test @@ -159,6 +160,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/xxobj/operand/refanyval.il b/src/tests/JIT/Methodical/xxobj/operand/refanyval.il index cbb9fd91896564..97e23eca9ce8e6 100644 --- a/src/tests/JIT/Methodical/xxobj/operand/refanyval.il +++ b/src/tests/JIT/Methodical/xxobj/operand/refanyval.il @@ -13,6 +13,7 @@ } +.assembly extern xunit.core {} .namespace JitTest { .class private sequential ansi sealed beforefieldinit Test @@ -132,6 +133,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (object V_0, diff --git a/src/tests/JIT/Methodical/xxobj/operand/unbox.il b/src/tests/JIT/Methodical/xxobj/operand/unbox.il index 8758380ff701c2..47f3ebacb7ae14 100644 --- a/src/tests/JIT/Methodical/xxobj/operand/unbox.il +++ b/src/tests/JIT/Methodical/xxobj/operand/unbox.il @@ -13,6 +13,7 @@ } +.assembly extern xunit.core {} .namespace JitTest { .class private sequential ansi sealed beforefieldinit Test @@ -155,6 +156,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/xxobj/sizeof/64sizeof.il b/src/tests/JIT/Methodical/xxobj/sizeof/64sizeof.il index 6884fadf3d7b9f..74cb91312299fe 100644 --- a/src/tests/JIT/Methodical/xxobj/sizeof/64sizeof.il +++ b/src/tests/JIT/Methodical/xxobj/sizeof/64sizeof.il @@ -11,6 +11,7 @@ .assembly 'sizeof' { } +.assembly extern xunit.core {} .custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) .namespace JitTest { @@ -77,6 +78,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/xxobj/sizeof/64sizeof32.il b/src/tests/JIT/Methodical/xxobj/sizeof/64sizeof32.il index eb2f2401af36f4..9706760e509727 100644 --- a/src/tests/JIT/Methodical/xxobj/sizeof/64sizeof32.il +++ b/src/tests/JIT/Methodical/xxobj/sizeof/64sizeof32.il @@ -3,6 +3,7 @@ .assembly extern mscorlib { } .assembly sizeof32 { } +.assembly extern xunit.core {} .custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) .namespace JitTest { @@ -34,6 +35,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32 V_0, diff --git a/src/tests/JIT/Methodical/xxobj/sizeof/64sizeof64.il b/src/tests/JIT/Methodical/xxobj/sizeof/64sizeof64.il index 07fe692effddc0..08c96f35719ff7 100644 --- a/src/tests/JIT/Methodical/xxobj/sizeof/64sizeof64.il +++ b/src/tests/JIT/Methodical/xxobj/sizeof/64sizeof64.il @@ -3,6 +3,7 @@ .assembly extern mscorlib { } .assembly sizeof64 { } +.assembly extern xunit.core {} .custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) .namespace JitTest { @@ -35,6 +36,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int64 V_0, diff --git a/src/tests/JIT/Methodical/xxobj/sizeof/sizeof.il b/src/tests/JIT/Methodical/xxobj/sizeof/sizeof.il index e901a52bca0c3d..93f41fdf01f7b1 100644 --- a/src/tests/JIT/Methodical/xxobj/sizeof/sizeof.il +++ b/src/tests/JIT/Methodical/xxobj/sizeof/sizeof.il @@ -11,6 +11,7 @@ .assembly 'sizeof' { } +.assembly extern xunit.core {} .custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) .namespace JitTest { @@ -77,6 +78,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals (int32 V_0) diff --git a/src/tests/JIT/Methodical/xxobj/sizeof/sizeof32.il b/src/tests/JIT/Methodical/xxobj/sizeof/sizeof32.il index e43e4e563e991d..6bde46d8d53250 100644 --- a/src/tests/JIT/Methodical/xxobj/sizeof/sizeof32.il +++ b/src/tests/JIT/Methodical/xxobj/sizeof/sizeof32.il @@ -4,6 +4,7 @@ // sizeof32.il .assembly extern mscorlib { } .assembly sizeof32 { } +.assembly extern xunit.core {} .custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) .namespace JitTest { @@ -35,6 +36,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32 V_0, diff --git a/src/tests/JIT/Methodical/xxobj/sizeof/sizeof64.il b/src/tests/JIT/Methodical/xxobj/sizeof/sizeof64.il index 9797ad7bbc232e..e215feca291733 100644 --- a/src/tests/JIT/Methodical/xxobj/sizeof/sizeof64.il +++ b/src/tests/JIT/Methodical/xxobj/sizeof/sizeof64.il @@ -4,6 +4,7 @@ // sizeof64.il .assembly extern mscorlib { } .assembly sizeof64 { } +.assembly extern xunit.core {} .custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) .namespace JitTest { @@ -36,6 +37,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int64 V_0, diff --git a/src/tests/JIT/Performance/CodeQuality/Benchstones/MDBenchI/MDGeneralArray/MDGeneralArray.cs b/src/tests/JIT/Performance/CodeQuality/Benchstones/MDBenchI/MDGeneralArray/MDGeneralArray.cs index a89a1f6429412b..c26db421224efe 100644 --- a/src/tests/JIT/Performance/CodeQuality/Benchstones/MDBenchI/MDGeneralArray/MDGeneralArray.cs +++ b/src/tests/JIT/Performance/CodeQuality/Benchstones/MDBenchI/MDGeneralArray/MDGeneralArray.cs @@ -1,7 +1,5 @@ // Licensed to the .NET Foundation under one or more 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; @@ -38,7 +36,7 @@ static bool VerifyCopy(int[,,] s, int[,,] d) { return true; } - + [MethodImpl(MethodImplOptions.NoInlining)] static bool Bench(int loop, int[,,] s, int[,,] d) { diff --git a/src/tests/JIT/Regression/CLR-x86-EJIT/V1-M11-Beta1/b44018/b44018.il b/src/tests/JIT/Regression/CLR-x86-EJIT/V1-M11-Beta1/b44018/b44018.il index 1cd63b32103d66..365c842588f6a7 100644 --- a/src/tests/JIT/Regression/CLR-x86-EJIT/V1-M11-Beta1/b44018/b44018.il +++ b/src/tests/JIT/Regression/CLR-x86-EJIT/V1-M11-Beta1/b44018/b44018.il @@ -11,6 +11,7 @@ } .assembly 'c'// as "c" { } +.assembly extern xunit.core {} .module 'c.exe' .namespace JitTest { @@ -19,6 +20,9 @@ { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 30 .locals (int32 V_0) diff --git a/src/tests/JIT/Regression/CLR-x86-EJIT/V1-M11-Beta1/b45046/b45046.il b/src/tests/JIT/Regression/CLR-x86-EJIT/V1-M11-Beta1/b45046/b45046.il index e8613199d6d116..6a5de9810c6b77 100644 --- a/src/tests/JIT/Regression/CLR-x86-EJIT/V1-M11-Beta1/b45046/b45046.il +++ b/src/tests/JIT/Regression/CLR-x86-EJIT/V1-M11-Beta1/b45046/b45046.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'b.exe' // MVID: {0573B9C2-3980-4A83-9B01-889CCC1D6FBC} .namespace Test @@ -29,6 +30,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 31 (0x1f) .maxstack 6 diff --git a/src/tests/JIT/Regression/CLR-x86-EJIT/V1-M12-Beta2/b26323/b26323.il b/src/tests/JIT/Regression/CLR-x86-EJIT/V1-M12-Beta2/b26323/b26323.il index 068b1c0c74efc7..a4b39e3ee49d99 100644 --- a/src/tests/JIT/Regression/CLR-x86-EJIT/V1-M12-Beta2/b26323/b26323.il +++ b/src/tests/JIT/Regression/CLR-x86-EJIT/V1-M12-Beta2/b26323/b26323.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b26323 { } +.assembly extern xunit.core {} .namespace Test { .class auto ansi App extends [mscorlib]System.Object @@ -28,6 +29,9 @@ .method private static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals ([0] class Test.App app) diff --git a/src/tests/JIT/Regression/CLR-x86-EJIT/V1-M12-Beta2/b35455/b35455.il b/src/tests/JIT/Regression/CLR-x86-EJIT/V1-M12-Beta2/b35455/b35455.il index 7e4736780c6ec3..2bdb79abfd1863 100644 --- a/src/tests/JIT/Regression/CLR-x86-EJIT/V1-M12-Beta2/b35455/b35455.il +++ b/src/tests/JIT/Regression/CLR-x86-EJIT/V1-M12-Beta2/b35455/b35455.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0x917e8626 {} +.assembly extern xunit.core {} .class ILGEN_0x917e8626 { .method static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 20 ldc.i4 0xFFFFFFF diff --git a/src/tests/JIT/Regression/CLR-x86-EJIT/V1-M12-Beta2/b47392/b47392.il b/src/tests/JIT/Regression/CLR-x86-EJIT/V1-M12-Beta2/b47392/b47392.il index f20d9031c7a5e7..da31e46eb4890c 100644 --- a/src/tests/JIT/Regression/CLR-x86-EJIT/V1-M12-Beta2/b47392/b47392.il +++ b/src/tests/JIT/Regression/CLR-x86-EJIT/V1-M12-Beta2/b47392/b47392.il @@ -3,6 +3,7 @@ .assembly extern legacy library mscorlib {} .assembly b47392 { } +.assembly extern xunit.core {} .namespace Test { .class private auto ansi AA extends [mscorlib]System.Object @@ -12,6 +13,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (class Test.AA, int32 i) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b15244/b15244.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b15244/b15244.il index a91b348b20ef44..b85a1db8379c30 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b15244/b15244.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b15244/b15244.il @@ -10,6 +10,7 @@ .assembly b15244 { } +.assembly extern xunit.core {} .class public auto ansi AA extends [mscorlib]System.Object { @@ -25,6 +26,9 @@ { .method static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b16039/b16039.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b16039/b16039.il index 9d848ae4d63a63..8302e0d6b82717 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b16039/b16039.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b16039/b16039.il @@ -10,6 +10,7 @@ .assembly bug { } +.assembly extern xunit.core {} .class public auto ansi AA extends [mscorlib]System.Object { @@ -63,6 +64,9 @@ { .method static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (int32) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b26324/b26324a.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b26324/b26324a.il index 697400a8a68be6..734d9b74e1e8f6 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b26324/b26324a.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b26324/b26324a.il @@ -13,6 +13,7 @@ } +.assembly extern xunit.core {} .namespace Test { .class public auto ansi FormatSpecException extends [mscorlib]System.Exception @@ -126,6 +127,9 @@ .field private static initonly class [mscorlib]System.String expResult .method private static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 12 .locals ([0] class Test.GCClass inst) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b26324/b26324b.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b26324/b26324b.il index c92efb34351417..a9747a2f5b3b32 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b26324/b26324b.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b26324/b26324b.il @@ -13,6 +13,7 @@ } +.assembly extern xunit.core {} .namespace Test { .class public auto ansi FormatSpecException extends [mscorlib]System.Exception @@ -126,6 +127,9 @@ .field private static initonly class [mscorlib]System.String expResult .method private static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 12 .locals ([0] class Test.GCClass inst) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b29583/b29583.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b29583/b29583.il index ed9f125a53df22..6ab86566c2f262 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b29583/b29583.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b29583/b29583.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly 'box' { } +.assembly extern xunit.core {} .namespace BoxTest { @@ -15,6 +16,9 @@ { .method private static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals (class [mscorlib]System.Object obj, float64 F) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30125/b30125.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30125/b30125.il index c4e45f8ebe36c8..f19c6645891e89 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30125/b30125.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30125/b30125.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x5a59b03c {} +.assembly extern xunit.core {} .class ILGEN_0x5a59b03c { .method static int32 Method_0x1001() { .maxstack 3 @@ -20,6 +21,9 @@ ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 2 call int32 ILGEN_0x5a59b03c::Method_0x1001() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30862/b30862.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30862/b30862.il index 707c90cb931d71..0ffb0475dc58fe 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30862/b30862.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30862/b30862.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xe741640 {} +.assembly extern xunit.core {} .class ILGEN_0xe741640 { .field static int64 field_0x1 .field static float32[] field_0x4 @@ -80,6 +81,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 2 call int32 ILGEN_0xe741640::Method_0x6401() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30864/b30864.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30864/b30864.il index 9604ac078052d4..29c8a35f99f415 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30864/b30864.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30864/b30864.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly 'typedref' { } +.assembly extern xunit.core {} .namespace BoxTest { .class auto ansi Test extends [mscorlib]System.Object @@ -139,6 +140,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 67 (0x43) .maxstack 3 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30892/b30892.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30892/b30892.il index 45d3ae022dc8c1..35ab19fbdc03ff 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30892/b30892.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30892/b30892.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xedada940 {} +.assembly extern xunit.core {} .class ILGEN_0xedada940 { .method static int32 Method_0x7f75() { .maxstack 17 @@ -85,6 +86,9 @@ End_Orphan_12: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 2 call int32 ILGEN_0xedada940::Method_0x7f75() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b31102/b31102.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b31102/b31102.il index 1e584df7934f4b..a60f50847c6aa0 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b31102/b31102.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b31102/b31102.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xed342785 {} +.assembly extern xunit.core {} .class ILGEN_0xed342785 { .method static int32 Method_0x287e() { .maxstack 13 @@ -34,6 +35,9 @@ End_Orphan_9: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 2 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b31273/b31273.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b31273/b31273.il index 93200b1f70b617..66c8b7d5f369c7 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b31273/b31273.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b31273/b31273.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xf0dc526d {} +.assembly extern xunit.core {} .class ILGEN_0xf0dc526d { .method static int32 Method_0x1672(int64 Arg_0x5) { .maxstack 13 @@ -30,6 +31,9 @@ End_Orphan_6: } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b31321/b31321.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b31321/b31321.il index a3436f876c2202..4158d2fe7801b6 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b31321/b31321.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b31321/b31321.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x3e7ab88c {} +.assembly extern xunit.core {} .class ILGEN_0x3e7ab88c { .method static int32 Method_0x32f7(int64 Arg_0x1) { @@ -28,6 +29,9 @@ End_Orphan_3: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b31343/b31343.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b31343/b31343.il index f41b825f4b70f3..cda2ce1d169c24 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b31343/b31343.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b31343/b31343.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x9dd65b7c {} +.assembly extern xunit.core {} .class ILGEN_0x9dd65b7c { .method static int32 Method_0x479() { .maxstack 13 @@ -30,6 +31,9 @@ End_Orphan_a: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b31448/b31448.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b31448/b31448.il index 2c8d25d5a68a2e..2e61d8a55045c6 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b31448/b31448.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b31448/b31448.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x213510c0 {} +.assembly extern xunit.core {} .class ILGEN_0x213510c0 { .method static int32 Method_0x6556(unsigned int32 Arg_0x2) { @@ -51,6 +52,9 @@ End_Orphan_e: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b32093/b32093.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b32093/b32093.il index 3a082009658d55..0675ba35c4bf4b 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b32093/b32093.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b32093/b32093.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x126afdc7 {} +.assembly extern xunit.core {} .class ILGEN_0x126afdc7 { .field static int32 field_0x2 .method static void Method_0x10e7() { @@ -24,6 +25,9 @@ ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b32374/b32374.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b32374/b32374.il index ced1091972cd3f..44adb1cafe5181 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b32374/b32374.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b32374/b32374.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly 'bug' { } +.assembly extern xunit.core {} .namespace Test { .class auto ansi BB extends [mscorlib]System.Object @@ -51,6 +52,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 97 (0x61) .maxstack 6 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b34423/b34423.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b34423/b34423.il index 3c0a8bacfc9dde..dea3a9bfece3bf 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b34423/b34423.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b34423/b34423.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x474a9f71 {} +.assembly extern xunit.core {} .class ILGEN_0x474a9f71 { @@ -18,6 +19,9 @@ ldc.i4 55 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i8 0x12482f5215abd14 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b29351/b29351.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b29351/b29351.il index c73a2b566ff5f6..6ccf83306ff50b 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b29351/b29351.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b29351/b29351.il @@ -7,17 +7,21 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly 'bug'// as "bug.exe" +.assembly 'bug'// as "bug" { } +.assembly extern xunit.core {} .namespace BoxTest { .class auto ansi App extends [mscorlib]System.Object { .method private static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 newobj instance void BoxTest.App::.ctor() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b33759/b33759.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b33759/b33759.il index e37bf3e548566b..b45396b6e505d4 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b33759/b33759.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b33759/b33759.il @@ -10,6 +10,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1aecfae6 {} +.assembly extern xunit.core {} .class ILGEN_0x1aecfae6 { //BEGIN STATIC FIELDS @@ -90,6 +91,9 @@ End_Orphan_2: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b33792/b33792.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b33792/b33792.il index eb1c1c7a71ec36..8ff04b9f2a652a 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b33792/b33792.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b33792/b33792.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xcdff6a8e {} +.assembly extern xunit.core {} .class ILGEN_0xcdff6a8e { .method static int32 Method_0x1e5a(){ @@ -41,6 +42,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b33888/b33888.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b33888/b33888.il index 15f0f522212b48..30154b7fad436e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b33888/b33888.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b33888/b33888.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x25b2a016 {} +.assembly extern xunit.core {} .class ILGEN_0x25b2a016 { .field static int64 field_0x0 @@ -40,6 +41,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b33922/b33922.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b33922/b33922.il index 93b9fd2afcd3e7..0d858ffe75d26f 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b33922/b33922.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b33922/b33922.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xe32b9f8 {} +.assembly extern xunit.core {} .class ILGEN_0xe32b9f8 { .method static int32 Method_0x5af1(int16 Arg_0x0) { @@ -33,6 +34,9 @@ ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b33928/b33928.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b33928/b33928.il index beb21a00e6c659..2f232ee697c777 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b33928/b33928.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b33928/b33928.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x34e68074 {} +.assembly extern xunit.core {} .class ILGEN_0x34e68074 { .method static int32 Method_0x1f01(float32 Arg_0x0) { .maxstack 11 @@ -26,6 +27,9 @@ conv.i4 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.r4 5.5996447e+030 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b35784/b35784.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b35784/b35784.il index ebab395fdebe52..3d39b646419ce3 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b35784/b35784.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b35784/b35784.il @@ -10,6 +10,7 @@ .assembly 'typedref'// as "typedref" { } +.assembly extern xunit.core {} .namespace BoxTest { .class auto ansi Test extends [mscorlib]System.Object @@ -141,6 +142,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 67 (0x43) .maxstack 3 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b36030/b36030.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b36030/b36030.il index 1ef354396fd030..03d5b7d212aa3e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b36030/b36030.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b36030/b36030.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x68f5b414 {} +.assembly extern xunit.core {} .class ILGEN_0x68f5b414 { .field static float64[] field_0x0 @@ -38,6 +39,9 @@ End_Orphan_10: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i8 0x1dc3638c3d8a55be diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b39381/b39381.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b39381/b39381.il index 3109d825b74ee7..f4a601f248f7e0 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b39381/b39381.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b39381/b39381.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0xcb543741 {} +.assembly extern xunit.core {} .class ILGEN_0xcb543741 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b39397/b39397.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b39397/b39397.il index 091054e06bb4cb..2046329ff5a762 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b39397/b39397.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b39397/b39397.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xcbda6722 {} +.assembly extern xunit.core {} .class ILGEN_0xcbda6722 { .method static float32 Method_0x796a(int64 Arg_0x0) { .maxstack 17 @@ -22,6 +23,9 @@ ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i8 0x36cd60286b4444a9 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b39417/b39417.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b39417/b39417.il index 692f859f58fe1e..62205d0a5feac4 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b39417/b39417.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b39417/b39417.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xa39a4fa9 {} +.assembly extern xunit.core {} .class ILGEN_0xa39a4fa9 { .field static unsigned int32[] field_0x4 @@ -69,6 +70,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b39455/b39455.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b39455/b39455.il index 90c2beb0265b87..67cee77ba8dc02 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b39455/b39455.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b39455/b39455.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0x98f62282 {} +.assembly extern xunit.core {} .class ILGEN_0x98f62282 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .locals (unsigned int64 local_0x0) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b39946/b39946.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b39946/b39946.il index e7150e9fc17525..663c951c50d54a 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b39946/b39946.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b39946/b39946.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x5c383c7 {} +.assembly extern xunit.core {} .class ILGEN_0x5c383c7 { @@ -298,6 +299,9 @@ End_Orphan_44: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40174/b40174.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40174/b40174.il index e625ef2883b89f..407086ecd57d8b 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40174/b40174.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40174/b40174.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0x587ddc1e {} +.assembly extern xunit.core {} .class ILGEN_0x587ddc1e { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .locals (int32) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40199/b40199.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40199/b40199.il index c77796e2b80ab3..d72b825f05cc8e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40199/b40199.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40199/b40199.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x44f8f663 {} +.assembly extern xunit.core {} .class ILGEN_0x44f8f663 { .method static int32 Method_0x2e75f3b4(int8 Arg_0x0, unsigned int64 Arg_0x1, int16 Arg_0x2) { .maxstack 15 @@ -173,6 +174,9 @@ End_Orphan_23: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40269/b40269.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40269/b40269.il index c46bbbc872e856..e99aeee815cfec 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40269/b40269.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40269/b40269.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x689f8929 {} +.assembly extern xunit.core {} .class ILGEN_0x689f8929 { .method static int32 Method_0xbc6f9e41(unsigned int32 Arg_0x1, int64 Arg_0x2) { @@ -54,6 +55,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i4 0x33071faf diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40347/b40347.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40347/b40347.il index 3e88a473014701..91626cfb80cf65 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40347/b40347.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40347/b40347.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly 'SignExpand'// as "SignExpand.exe" +.assembly 'SignExpand'// as "SignExpand" { } diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40380/b40380.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40380/b40380.il index 9988fd55b33095..394f70a8ec1509 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40380/b40380.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40380/b40380.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x37ae0554 {} +.assembly extern xunit.core {} .class ILGEN_0x37ae0554 { .method static int32 Method_0xb77ea7c1(int16 Arg_0x0, int16 Arg_0x1) { .maxstack 17 @@ -52,6 +53,9 @@ End_Orphan_48: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40411/b40411.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40411/b40411.il index f3a05f1ec1238e..ae76d9e369bec3 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40411/b40411.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40411/b40411.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1a182c40 {} +.assembly extern xunit.core {} .class ILGEN_0x1a182c40 { .method static int32 Method_0x36cdd4e(float64 Arg_0x9) { .maxstack 15 @@ -45,6 +46,9 @@ ldc.i4 55 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.r8 float64(0x94188556b24089e8b90c9c61f9f3088) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40721/b40721.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40721/b40721.il index 938b465c10c3fd..61b37929bebdbe 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40721/b40721.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40721/b40721.il @@ -9,6 +9,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x322fc2ad {} +.assembly extern xunit.core {} .class ILGEN_0x322fc2ad { .field static unsigned int8 field_0x0 .field static float64[] field_0x1 @@ -297,6 +298,9 @@ ldc.i4 55 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40725/b40725.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40725/b40725.il index 869d7d758c3a3c..d5adb06a23b20c 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40725/b40725.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b40725/b40725.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' // MVID: {37F05BF1-E8CC-42FA-A268-D866F07CFFF8} .namespace TestCase @@ -28,6 +29,9 @@ { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 39 (0x27) .maxstack 5 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41002/b41002.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41002/b41002.il index fa8d6a95a9edc8..aeb802b72571e4 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41002/b41002.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41002/b41002.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x9e8a1a89 {} +.assembly extern xunit.core {} .class ILGEN_0x9e8a1a89 { .method static int32 Method_0xa837be5e(float64 Arg_0x0, unsigned int64 Arg_0x4, unsigned int64 Arg_0x5, unsigned int16 Arg_0x6) { @@ -71,6 +72,9 @@ Branch_0x5: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41126/b41126.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41126/b41126.il index 84cab362666adc..8d205a3657e0e1 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41126/b41126.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41126/b41126.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x3a878f9 {} +.assembly extern xunit.core {} .class ILGEN_0x3a878f9 { .method static int32 Method_0x96dc6834(unsigned int64 Arg_0x1, int64 Arg_0x3, float32 Arg_0x4) { .maxstack 19 @@ -51,6 +52,9 @@ End_Orphan_66: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41129/b41129.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41129/b41129.il index 777c562096e19f..f7fcccedf076dd 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41129/b41129.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41129/b41129.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x7971e09f {} +.assembly extern xunit.core {} .class ILGEN_0x7971e09f { .field static unsigned int16[] field_0x1 .field static int64[] field_0x2 @@ -126,6 +127,9 @@ ldc.i4 55 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41149/b41149.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41149/b41149.il index 469f96d4c83e4d..39620eb0d7e6ad 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41149/b41149.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41149/b41149.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x243bc9d5 {} +.assembly extern xunit.core {} .class ILGEN_0x243bc9d5 { .method static int32 Method_0xab68837a(unsigned int64 Arg_0x1) { @@ -40,6 +41,9 @@ End_Orphan_3: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i8 0x432d7dff7e4e94b56adbd9362d85e958 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41164/b41164.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41164/b41164.il index 6dd8de9578418f..00eff1f1a44d51 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41164/b41164.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41164/b41164.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x81ba964 {} +.assembly extern xunit.core {} .class ILGEN_0x81ba964 { .field static unsigned int8[] field_0x0 .method static int32 Method_0x444e1c4(int8 Arg_0x0, unsigned int16 Arg_0x1, int64 Arg_0x2) { @@ -63,6 +64,9 @@ ldc.i4 99 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41278/b41278.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41278/b41278.il index bc300cf93fa026..ab6219cc82097e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41278/b41278.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41278/b41278.il @@ -8,9 +8,13 @@ .ver 4:0:0:0 } .assembly ILGEN_0x233972d {} +.assembly extern xunit.core {} .class ILGEN_0x233972d { .field static unsigned int8 field_0x2 .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41627/b41627.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41627/b41627.il index 21d053d9fdfebd..c8867f29ec37d3 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41627/b41627.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b41627/b41627.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1a8938c {} +.assembly extern xunit.core {} .class ILGEN_0x1a8938c { .field static unsigned int16 field_0x2 @@ -31,6 +32,9 @@ Branch_0x9: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b42387/b42387.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b42387/b42387.il index 0e2874661d1201..4f1c00828380b3 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b42387/b42387.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b42387/b42387.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'test.exe' // MVID: {23E3D49B-6CFD-4DA0-8C9D-A611CE0BA103} .namespace JitTest @@ -75,6 +76,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 38 (0x26) .maxstack 2 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b42732/b42732.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b42732/b42732.il index 171cb810ec4871..9346e1f79a37d3 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b42732/b42732.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b42732/b42732.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly 'callvirt-bug'// as "callvirt-bug.exe" +.assembly 'callvirt-bug'// as "callvirt-bug" { } diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43033/b43033.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43033/b43033.il index 8cfcf413e560ec..e9c9f033022d71 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43033/b43033.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43033/b43033.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x64be9170 {} +.assembly extern xunit.core {} .class ILGEN_0x64be9170 { .method static int32 Method_0xe55ca458(int64 Arg_0x0) { .maxstack 9 @@ -52,6 +53,9 @@ End_Orphan_f: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43040/b43040.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43040/b43040.il index 0167c8c5ecf58a..0f0e23d66c09a4 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43040/b43040.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43040/b43040.il @@ -8,9 +8,13 @@ .ver 4:0:0:0 } .assembly ILGEN_0xd8633b24 {} +.assembly extern xunit.core {} .class ILGEN_0xd8633b24 { .field static unsigned int8[] field_0x5 .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43069/b43069.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43069/b43069.il index e2dd0f226bbb0c..76eb7a489a2884 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43069/b43069.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43069/b43069.il @@ -11,6 +11,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x16802ac7 {} +.assembly extern xunit.core {} .class ILGEN_0x16802ac7 { //BEGIN STATIC FIELDS @@ -80,6 +81,9 @@ End_Orphan_2: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43115/b43115.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43115/b43115.il index 5854f4c92f381f..cb2e2c8e544d46 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43115/b43115.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43115/b43115.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1be1aaf4 {} +.assembly extern xunit.core {} .class ILGEN_0x1be1aaf4 { .field static unsigned int64 field_0x0 .field static int8[] field_0x1 @@ -181,6 +182,9 @@ End_Orphan_5d: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43121/b43121.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43121/b43121.il index b625c0e038d5ba..db9a63fbcbb779 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43121/b43121.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43121/b43121.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1495dac4 {} +.assembly extern xunit.core {} .class ILGEN_0x1495dac4 { .field static float64 field_0x0 @@ -223,6 +224,9 @@ End_Orphan_20: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43160/b43160.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43160/b43160.il index ebc905d0d07267..1ab6fc1b66289d 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43160/b43160.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43160/b43160.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x19b572e2 {} +.assembly extern xunit.core {} .class ILGEN_0x19b572e2 { .field static int16 field_0x0 @@ -147,6 +148,9 @@ End_Orphan_d: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43378/b43378.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43378/b43378.il index 9880c8031376c5..1078bedd1c5467 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43378/b43378.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43378/b43378.il @@ -8,9 +8,13 @@ .ver 4:0:0:0 } .assembly ILGEN_0x144897ef {} +.assembly extern xunit.core {} .class ILGEN_0x144897ef { .field static unsigned int8 field_0x4 .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43714/b43714.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43714/b43714.il index 8d4bd092f76405..1f37776ac5535f 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43714/b43714.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43714/b43714.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1f290143 {} +.assembly extern xunit.core {} .class ILGEN_0x1f290143 { .method static int32 Method_0x8252f06e(float64 Arg_0x0, unsigned int16 Arg_0x1, unsigned int32 Arg_0x2, unsigned int8 Arg_0x3, float32 Arg_0x4, unsigned int64 Arg_0x5, int32 Arg_0x6, unsigned int64 Arg_0x7) { @@ -48,6 +49,9 @@ End_Orphan_9: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43963/b43963.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43963/b43963.il index 4cea95e080dd06..d2815ef690ac26 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43963/b43963.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43963/b43963.il @@ -11,6 +11,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1dd8d826 {} +.assembly extern xunit.core {} .class ILGEN_0x1dd8d826 { //BEGIN STATIC FIELDS @@ -680,6 +681,9 @@ End_Orphan_61: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43994/b43994.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43994/b43994.il index a9e038ecfbb053..e87c590a17eaf7 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43994/b43994.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b43994/b43994.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1ad812c2 {} +.assembly extern xunit.core {} .class ILGEN_0x1ad812c2 { .method static int32 Method_0xf621eda6(unsigned int16 Arg_0x0, int64 Arg_0x1) { .maxstack 9 @@ -112,6 +113,9 @@ End_Orphan_7: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i4 0x28e5ef35 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44020/b44020.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44020/b44020.il index c7bdef6ca6441a..3bf99503757ac3 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44020/b44020.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44020/b44020.il @@ -11,6 +11,7 @@ } .assembly 'c'// as "c" { } +.assembly extern xunit.core {} .module 'c.exe' .namespace JitTest { @@ -19,6 +20,9 @@ { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 30 .locals (int32 V_0) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44204/b44204.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44204/b44204.il index f02367200754e7..d723a7545f7a4c 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44204/b44204.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44204/b44204.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1915effd {} +.assembly extern xunit.core {} .class ILGEN_0x1915effd { .method static int32 Method_0x85e39eed() { .maxstack 17 @@ -64,6 +65,9 @@ ldc.i4 00 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44224/b44224.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44224/b44224.il index 0a270487c8f9e3..8a48b9ac55a54e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44224/b44224.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44224/b44224.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1d9cf497 {} +.assembly extern xunit.core {} .class ILGEN_0x1d9cf497 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44657/b44657.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44657/b44657.il index 8d53ff676627c8..95985d8f11491d 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44657/b44657.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44657/b44657.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1957992d {} +.assembly extern xunit.core {} .class ILGEN_0x1957992d { .field static unsigned int32 field_0x0 @@ -150,6 +151,9 @@ End_Orphan_21: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44723/b44723.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44723/b44723.il index d615d0ab2b95ac..5073146b0dfe5e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44723/b44723.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44723/b44723.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0xa4f49b04 {} +.assembly extern xunit.core {} .class ILGEN_0xa4f49b04 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .locals (unsigned int8[] local_0x6) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44724/b44724.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44724/b44724.il index 8bf57896372933..3f0fd8f36f873d 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44724/b44724.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44724/b44724.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0xbf04a0ad {} +.assembly extern xunit.core {} .class ILGEN_0xbf04a0ad { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .locals (int16 local_0x6) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44861/b44861.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44861/b44861.il index 5c766139fc9207..5d18dc63157658 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44861/b44861.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44861/b44861.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'b.exe' // MVID: {0573B9C2-3980-4A83-9B01-889CCC1D6FBC} .namespace Test @@ -29,6 +30,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 31 (0x1f) .maxstack 6 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44879/b44879.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44879/b44879.il index fac03a7b67414e..8b5047ec961c6c 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44879/b44879.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44879/b44879.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x152f1077 {} +.assembly extern xunit.core {} .class ILGEN_0x152f1077 { .method static int32 Method_0x2763af56(int64 Arg_0x0) { @@ -168,6 +169,9 @@ End_Orphan_31: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44946/b44946.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44946/b44946.il index 5e7c01f03c64fb..b491b28115e919 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44946/b44946.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44946/b44946.il @@ -19,6 +19,7 @@ } +.assembly extern xunit.core {} .module 'b.exe' // MVID: {0573B9C2-3980-4A83-9B01-889CCC1D6FBC} .namespace Test @@ -27,6 +28,9 @@ { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 6 ldc.i4.0 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44983/b44983.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44983/b44983.il index 255eeb02d2ea95..019decc49c1e3a 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44983/b44983.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44983/b44983.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xeb5027d {} +.assembly extern xunit.core {} .class ILGEN_0xeb5027d { .field static int64 field_0x0 .field static int32[] field_0x1 @@ -129,6 +130,9 @@ End_Orphan_7: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i4 0x2f4b1550 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44984/b44984.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44984/b44984.il index 51d58cf0cf3be1..328d21552068f0 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44984/b44984.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44984/b44984.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xd135fd7 {} +.assembly extern xunit.core {} .class ILGEN_0xd135fd7 { .method static int32 Method_0x96745647(int8 Arg_0x0, unsigned int8 Arg_0x1, unsigned int32 Arg_0x2, int16 Arg_0x3, unsigned int8 Arg_0x4, unsigned int32 Arg_0x5, int8 Arg_0x6, int64 Arg_0x7, float64 Arg_0x8) { .maxstack 7 @@ -83,6 +84,9 @@ stloc local_0x3 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44985/b44985.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44985/b44985.il index 7f3be1ec9c1d1f..1dbb18e2fb32ac 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44985/b44985.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b44985/b44985.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x2e384c7a {} +.assembly extern xunit.core {} .class ILGEN_0x2e384c7a { .method static int32 Method_0x5f927ae5(int16 Arg_0x0, int8 Arg_0x1, int32 Arg_0x2, int16 Arg_0x3, unsigned int32 Arg_0x4, float32 Arg_0x5, unsigned int32 Arg_0x6, float32 Arg_0x7, int8 Arg_0x8) { @@ -106,6 +107,9 @@ End_Orphan_3: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i4 0x249ba163 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b45439/b45439.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b45439/b45439.il index e85179186d7ec0..5dd4ccf1f9834c 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b45439/b45439.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b45439/b45439.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1c02a9a5 {} +.assembly extern xunit.core {} .class ILGEN_0x1c02a9a5 { .field static unsigned int64[] field_0x0 .field static unsigned int8[] field_0x1 @@ -78,6 +79,9 @@ End_Orphan_9: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b45541/b45541.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b45541/b45541.il index 73be3f3777d565..8f9f357a41320a 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b45541/b45541.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b45541/b45541.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x2985f7b9 {} +.assembly extern xunit.core {} .class ILGEN_0x2985f7b9 { .field static unsigned int32[] field_0x1 .field static float32 field_0x4 @@ -152,6 +153,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b45956/b45956.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b45956/b45956.il index ef0325115c6bea..2c0195553ee1fe 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b45956/b45956.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b45956/b45956.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x11c02e62 {} +.assembly extern xunit.core {} .class ILGEN_0x11c02e62 { .method static int32 Method_0x7f2e741b(unsigned int8 Arg_0x0, unsigned int8 Arg_0x1, float32 Arg_0x2, float32 Arg_0x3, unsigned int32 Arg_0x4) { .maxstack 15 @@ -130,6 +131,9 @@ End_Orphan_12: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b45984/b45984.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b45984/b45984.il index 7f4a803a720ea4..30cc280e9d2c83 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b45984/b45984.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b45984/b45984.il @@ -9,6 +9,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x496bb0b {} +.assembly extern xunit.core {} .class ILGEN_0x496bb0b { .field static int32[] field_0x1 @@ -100,6 +101,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i8 0xe3b349bbc6880fff diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b45985/b45985.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b45985/b45985.il index 0d3bd2e3c70fbd..f807210122499e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b45985/b45985.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b45985/b45985.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x23dc78ef {} +.assembly extern xunit.core {} .class ILGEN_0x23dc78ef { .method static int32 Method_0x24e1ee4b(float32 Arg_0x0) { .maxstack 11 @@ -29,6 +30,9 @@ ldc.i4.0 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.r4 float32(0xdf09543a) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b46292/b46292.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b46292/b46292.il index 943d79406fd97d..7005c0f13afbb4 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b46292/b46292.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b46292/b46292.il @@ -17,6 +17,7 @@ .assembly 'test' { } +.assembly extern xunit.core {} .module 'test.exe' // MVID: {74C704CE-5E25-4072-A5C7-A9DD14614D82} .class private auto ansi Mod1 @@ -24,6 +25,9 @@ { .method public static void Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) // Code size 26 (0x1a) .maxstack 1 .locals init (class c1 V_0) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b46569/b46569.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b46569/b46569.il index 3ad4752b3908d3..4083d97b008492 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b46569/b46569.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b46569/b46569.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x5db0aa0 {} +.assembly extern xunit.core {} .class ILGEN_0x5db0aa0 { .method static int32 Method_0x14ca58b7(int64 Arg_0x0, float32 Arg_0x1, float32 Arg_0x2, int16 Arg_0x3, unsigned int16 Arg_0x4, float32 Arg_0x5, int32 Arg_0x6, int32 Arg_0x7, float64 Arg_0x8) { @@ -305,6 +306,9 @@ ldc.i4 55 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b46576/b46576.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b46576/b46576.il index 1d3d902f757557..2dadfc9cbb19ff 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b46576/b46576.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b46576/b46576.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x153960c7 {} +.assembly extern xunit.core {} .class ILGEN_0x153960c7 { .field static int32[] field_0x0 @@ -144,6 +145,9 @@ ldc.i4 55 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b46583/b46583.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b46583/b46583.il index 60f0a597fb485b..238834d1cd91f8 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b46583/b46583.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b46583/b46583.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x305f0007 {} +.assembly extern xunit.core {} .class ILGEN_0x305f0007 { .field static unsigned int32 field_0x0 @@ -134,6 +135,9 @@ End_Orphan_24: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b46897/b46897.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b46897/b46897.il index 9c7f8eba73a6ab..3d3264c5af2226 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b46897/b46897.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b46897/b46897.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x6322da7 {} +.assembly extern xunit.core {} .class ILGEN_0x6322da7 { .field static unsigned int16 field_0x2 @@ -78,6 +79,9 @@ End_Orphan_9: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47022/b47022.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47022/b47022.il index fb9f4a84a9085e..b97c5233fe930e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47022/b47022.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47022/b47022.il @@ -8,9 +8,13 @@ .ver 4:0:0:0 } .assembly ILGEN_0xb7fdb3b {} +.assembly extern xunit.core {} .class ILGEN_0xb7fdb3b { .field static unsigned int8 field_0x2 .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .locals (unsigned int8[] local_0x4,float32[] local_0x5,unsigned int64[] local_0x6,int32 local_0x7) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47080/b47080-ia64.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47080/b47080-ia64.il index 4916e0662c9e24..2c6520031e2102 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47080/b47080-ia64.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47080/b47080-ia64.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x2be45b24 {} +.assembly extern xunit.core {} .class ILGEN_0x2be45b24 { .field static int8 field_0x0 @@ -187,6 +188,9 @@ End_Orphan_4f: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47093/b47093.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47093/b47093.il index 555acb94a52e20..c76329705bfec3 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47093/b47093.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47093/b47093.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x57cc69ce {} +.assembly extern xunit.core {} .class ILGEN_0x57cc69ce { .field static unsigned int8 field_0x0 .field static int32 field_0x1 @@ -432,6 +433,9 @@ End_Orphan_3b: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47610/b47610.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47610/b47610.il index 8ba94345888a4f..1966dfe40b81f2 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47610/b47610.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47610/b47610.il @@ -14,11 +14,15 @@ .assembly 'avg'// as "avg" { } +.assembly extern xunit.core {} .module 'avg.exe' // MVID: {BCA6096F-DF11-4FA3-BF16-EEDA01729535} .namespace AvgTest { .class private auto ansi Test extends ['mscorlib']System.Object { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 ldc.i4.0 dup dup dup dup dup dup dup diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47885/b47885.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47885/b47885.il index a959bc6962a8ac..dd31a77580bc0e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47885/b47885.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47885/b47885.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1245f15f {} +.assembly extern xunit.core {} .class ILGEN_0x1245f15f { .method static int32 Method_0x5753b424(int16 Arg_0x0, int8 Arg_0x1, unsigned int16 Arg_0x2, int32 Arg_0x3, int16 Arg_0x4, float32 Arg_0x5, unsigned int16 Arg_0x6) { .maxstack 7 @@ -75,6 +76,9 @@ ldc.i4 55 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i4 0x715aa05a diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47906/b47906.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47906/b47906.il index e3eca2d54f842a..67d8f6c80f37dd 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47906/b47906.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b47906/b47906.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0x50013a8e {} +.assembly extern xunit.core {} .class ILGEN_0x50013a8e { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .locals (float64[] local_0x6,float64[] local_0x7,unsigned int16[] local_0x8,int8 local_0xd) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b48350/b48350.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b48350/b48350.il index 30223b4ea3eece..5423536c70c147 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b48350/b48350.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b48350/b48350.il @@ -8,10 +8,14 @@ .ver 4:0:0:0 } .assembly ILGEN_0x60721d0a {} +.assembly extern xunit.core {} .class ILGEN_0x60721d0a { .field static unsigned int32 field_0x0 .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b48614/b48614.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b48614/b48614.il index 4ae495ceb8185e..5f1debba21fd9c 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b48614/b48614.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b48614/b48614.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x670a8598 {} +.assembly extern xunit.core {} .class ILGEN_0x670a8598 { .field static unsigned int64 field_0x0 @@ -393,6 +394,9 @@ End_Orphan_1c: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b49101/b49101.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b49101/b49101.il index fa7c5b131b13bb..11703c996868aa 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b49101/b49101.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b49101/b49101.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x6a2f58fb {} +.assembly extern xunit.core {} .class ILGEN_0x6a2f58fb { .method static int32 Method_0x89b7ef42(int32 Arg_0x2,float32 Arg_0x4) { @@ -59,6 +60,9 @@ ldc.i4 55 EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i4 0xeaec0788 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b49984/b49984.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b49984/b49984.il index 121a6d3a3b2cfe..309f8733945634 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b49984/b49984.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M11-Beta1/b49984/b49984.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0x693bdfcb {} +.assembly extern xunit.core {} .class ILGEN_0x693bdfcb { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b30868/b30868.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b30868/b30868.il index 18ec73cc12032c..2256c251092a95 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b30868/b30868.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b30868/b30868.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xac0ba7f2 {} +.assembly extern xunit.core {} .class ILGEN_0xac0ba7f2 { .method static int32 Method_0x7949() { .maxstack 19 @@ -34,6 +35,9 @@ ldc.i4 55 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 2 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31283/b31283.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31283/b31283.il index cf145a0e4531c5..4e73d23eee685e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31283/b31283.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31283/b31283.il @@ -10,6 +10,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xdba5be7f {} +.assembly extern xunit.core {} .class ILGEN_0xdba5be7f { //BEGIN STATIC FIELDS @@ -256,6 +257,9 @@ End_Orphan_1f: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 2 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31289/b31289.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31289/b31289.il index 0ca2eb1e4f5ed7..54d9d05abb0eb4 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31289/b31289.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31289/b31289.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x59e058c0 {} +.assembly extern xunit.core {} .class ILGEN_0x59e058c0 { .field static unsigned int16 field_0x0 @@ -60,6 +61,9 @@ End_Orphan_a: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31292/b31292.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31292/b31292.il index 7e31b02dee0795..9c0440d3396aa2 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31292/b31292.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31292/b31292.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x59e058c0 {} +.assembly extern xunit.core {} .class ILGEN_0x59e058c0 { .method static int32 Method_0x2dd7( unsigned int64 Arg_0x3) { @@ -32,6 +33,9 @@ End_Orphan_a: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31423/b31423.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31423/b31423.il index 17cf11369e8099..87d3e25738e025 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31423/b31423.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31423/b31423.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x498e48f6 {} +.assembly extern xunit.core {} .class ILGEN_0x498e48f6 { .method static int32 Method_0x1eae(unsigned int64 Arg_0x0) { @@ -35,6 +36,9 @@ End_Orphan_b: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31452/b31452.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31452/b31452.il index 7332713f200613..438d26812d2109 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31452/b31452.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31452/b31452.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xc2f3d0c8 {} +.assembly extern xunit.core {} .class ILGEN_0xc2f3d0c8 { .field static float64 field_0x0 @@ -36,6 +37,9 @@ ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31493/b31493.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31493/b31493.il index 1f450cdc4b6ded..a3c03ebb6ca719 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31493/b31493.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31493/b31493.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xb9cf1080 {} +.assembly extern xunit.core {} .class ILGEN_0xb9cf1080 { .field static int8 field_0x2 .method static int32 Method_0x7d15() { @@ -30,6 +31,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31547/b31547.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31547/b31547.il index 123fdbbc3c54e8..991a7dd80ab7d2 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31547/b31547.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31547/b31547.il @@ -10,6 +10,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xc2d6ebd8 {} +.assembly extern xunit.core {} .class ILGEN_0xc2d6ebd8 { //BEGIN STATIC FIELDS @@ -179,6 +180,9 @@ End_Orphan_32: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31780/b31780.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31780/b31780.il index 582cce0f518f15..3ba0b1d3e606ce 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31780/b31780.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31780/b31780.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xc5f46dbe {} +.assembly extern xunit.core {} .class ILGEN_0xc5f46dbe { .method static int32 Method_0x3179() { @@ -32,6 +33,9 @@ ldc.i4 0 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31784/b31784.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31784/b31784.il index cf36e7d66dfcd8..18c030377952d1 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31784/b31784.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b31784/b31784.il @@ -10,6 +10,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x9d6df124 {} +.assembly extern xunit.core {} .class ILGEN_0x9d6df124 { //BEGIN STATIC FIELDS @@ -151,6 +152,9 @@ End_Orphan_28: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b32613/b32613.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b32613/b32613.il index 5c4f61296fda7e..dddbe69db978be 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b32613/b32613.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b32613/b32613.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b32613 { } +.assembly extern xunit.core {} .class ILGEN_0x59749830 { .field static int8[] field_0x0 @@ -133,6 +134,9 @@ End_Orphan_64: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b32614/b32614.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b32614/b32614.il index 90af5b536a434d..6b88dce792c3c3 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b32614/b32614.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b32614/b32614.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x64f58bd0 {} +.assembly extern xunit.core {} .class ILGEN_0x64f58bd0 { .field static unsigned int8 field_0x4 @@ -57,6 +58,9 @@ End_Orphan_e: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .locals (int32) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33125/b33125.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33125/b33125.il index 2aef16119f58d0..40b626421bb0b9 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33125/b33125.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33125/b33125.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xbb363761 {} +.assembly extern xunit.core {} .class ILGEN_0xbb363761 { //BEGIN STATIC FIELDS @@ -263,6 +264,9 @@ End_Orphan_29: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33131/b33131.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33131/b33131.il index 2dee7e62f18812..9a922fcfadee0f 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33131/b33131.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33131/b33131.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x5350b1c3 {} +.assembly extern xunit.core {} .class ILGEN_0x5350b1c3 { .field static unsigned int16 field_0x0 @@ -57,6 +58,9 @@ stsfld unsigned int16 ILGEN_0x5350b1c3::field_0x0 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i8 0x48a05eba100c2471 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33135/b33135.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33135/b33135.il index 52ecd61e19ff47..2ba5a5b155095b 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33135/b33135.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33135/b33135.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xf1d71bcb {} +.assembly extern xunit.core {} .class ILGEN_0xf1d71bcb { .method static int32 Method_0x766c(float64 Arg_0x0, int64 Arg_0x1, int64 Arg_0x2, unsigned int16 Arg_0x3, int16 Arg_0x4) { @@ -65,6 +66,9 @@ End_Orphan_1a: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33335/b33335.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33335/b33335.il index 10b6f84ee264d3..5d866972333585 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33335/b33335.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33335/b33335.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x8c7852d1 {} +.assembly extern xunit.core {} .class ILGEN_0x8c7852d1 { .field static int64 field_0x1 @@ -50,6 +51,9 @@ Branch_0x7: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33361/b33361.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33361/b33361.il index c6c70eeeb8dfdf..6598058904b1d9 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33361/b33361.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33361/b33361.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x8b849bfe {} +.assembly extern xunit.core {} .class ILGEN_0x8b849bfe { .field static unsigned int8 field_0x3 @@ -38,6 +39,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33362/b33362.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33362/b33362.il index da5cd3ecdd95e7..feeb4ab2d6ec74 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33362/b33362.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33362/b33362.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x2e4e98c {} +.assembly extern xunit.core {} .class ILGEN_0x2e4e98c { .field static int32 field_0x1 @@ -95,6 +96,9 @@ stsfld int32 ILGEN_0x2e4e98c::field_0x1 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i8 0x22e0501f452a3596 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33388/b33388.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33388/b33388.il index f6854b949cbe25..f4d1d1e509145c 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33388/b33388.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33388/b33388.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xf81ec410 {} +.assembly extern xunit.core {} .class ILGEN_0xf81ec410 { .method static float32 Method_0x3676() { @@ -52,6 +53,9 @@ stloc local_0x0 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33585/b33585.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33585/b33585.il index 935c6e1b2a3a5b..a93e0ef6686323 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33585/b33585.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33585/b33585.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x689aad70 {} +.assembly extern xunit.core {} .class ILGEN_0x689aad70 { .field static int16 field_0x0 .field static float64 field_0x1 @@ -55,6 +56,9 @@ End_Orphan_2: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.r4 float32(0x2543433) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33586/b33586.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33586/b33586.il index eaee787e48c2d7..43a1496258630e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33586/b33586.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b33586/b33586.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x3b5fce00 {} +.assembly extern xunit.core {} .class ILGEN_0x3b5fce00 { .method static int32 Method_0x21de(unsigned int32 Arg_0x0, int16 Arg_0x1, float32 Arg_0x2, unsigned int64 Arg_0x3, int32 Arg_0x4) { @@ -23,6 +24,9 @@ ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i4 0x14612d4a diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b34951/b34951.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b34951/b34951.il index ebd71a8084884a..94f29d2da98863 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b34951/b34951.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b34951/b34951.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xe8c74ae0 {} +.assembly extern xunit.core {} .class ILGEN_0xe8c74ae0 { @@ -154,6 +155,9 @@ End_Orphan_12: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b34952/b34952.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b34952/b34952.il index 680cfc1617ebfd..7fa6a73d85c95f 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b34952/b34952.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b34952/b34952.il @@ -10,6 +10,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x2a6b42a0 {} +.assembly extern xunit.core {} .class ILGEN_0x2a6b42a0 { //BEGIN STATIC FIELDS @@ -332,6 +333,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b34953/b34953.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b34953/b34953.il index 668239a1c01d2a..72fdc58df30626 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b34953/b34953.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b34953/b34953.il @@ -10,6 +10,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xbd98be78 {} +.assembly extern xunit.core {} .class ILGEN_0xbd98be78 { //BEGIN STATIC FIELDS @@ -326,6 +327,9 @@ End_Orphan_26: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35315/b35315.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35315/b35315.il index 066c2e76f3a239..6cdd68da92b1d7 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35315/b35315.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35315/b35315.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0xcd02950a {} +.assembly extern xunit.core {} .class ILGEN_0xcd02950a { .method static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 20 .locals (unsigned int32 local_0x0) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35344/b35344.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35344/b35344.il index 308348fc5a5b48..f91656bfe2e7de 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35344/b35344.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35344/b35344.il @@ -8,11 +8,15 @@ .ver 4:0:0:0 } .assembly ILGEN_0xdc3a83a8 {} +.assembly extern xunit.core {} .class ILGEN_0xdc3a83a8 { .field static int16[] field_0x0 .field static int64[] field_0x2 .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35348/b35348.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35348/b35348.il index 0f313b46d472f1..832229e7f88ab0 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35348/b35348.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35348/b35348.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x7c08a1ce {} +.assembly extern xunit.core {} .class ILGEN_0x7c08a1ce { .method static int32 Method_0x4406(unsigned int32 Arg_0x0){ @@ -20,6 +21,9 @@ ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35351/b35351.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35351/b35351.il index 47356f1abdf2ee..6d019c362be22c 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35351/b35351.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35351/b35351.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0xa276db72 {} +.assembly extern xunit.core {} .class ILGEN_0xa276db72 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35354/b35354.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35354/b35354.il index bb47125c7bb2f7..69fa05bf39df70 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35354/b35354.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35354/b35354.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x58f32e86 {} +.assembly extern xunit.core {} .class ILGEN_0x58f32e86 { .method static int32 Method_0x5d38(unsigned int32 Arg_0x0) { @@ -126,6 +127,9 @@ End_Orphan_2a: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35366/b35366.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35366/b35366.il index fe2134365ecc27..8bca68b4c22ad4 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35366/b35366.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35366/b35366.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x449c7d9 {} +.assembly extern xunit.core {} .class ILGEN_0x449c7d9 { .method static int32 Method_0x13da(unsigned int32 Arg_0x0) { @@ -39,6 +40,9 @@ End_Orphan_4: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i4 0x14c07bb9 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35486/b35486.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35486/b35486.il index b159e76cc77489..5a46287979fbca 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35486/b35486.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35486/b35486.il @@ -9,6 +9,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xc53351bb {} +.assembly extern xunit.core {} .class ILGEN_0xc53351bb { .field static int16 field_0x2 @@ -310,6 +311,9 @@ ldc.r4 44.0 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i4 0x20c94c5a diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35635/b35635.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35635/b35635.il index 01a32b0aedb94c..9e3a10871ac835 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35635/b35635.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35635/b35635.il @@ -8,9 +8,13 @@ .ver 4:0:0:0 } .assembly ILGEN_0x77e9b0c3 {} +.assembly extern xunit.core {} .class ILGEN_0x77e9b0c3 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.r4 4.0 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35779/b35779.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35779/b35779.il index b0bd53550e7e50..0769c372957c66 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35779/b35779.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b35779/b35779.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0x77e65197 {} +.assembly extern xunit.core {} .class ILGEN_0x77e65197 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .locals (float64 local_0x2) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b36301/b36301.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b36301/b36301.il index d5b368a7b21c2f..5fc23b44c7f2df 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b36301/b36301.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b36301/b36301.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x7ff68940 {} +.assembly extern xunit.core {} .class ILGEN_0x7ff68940 { .method static float32 Method_0x2784() { @@ -21,6 +22,9 @@ ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b36302/b36302.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b36302/b36302.il index da5e5fc7e8010d..c5935e741a0a04 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b36302/b36302.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b36302/b36302.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x7ff55ade {} +.assembly extern xunit.core {} .class ILGEN_0x7ff55ade { .method static float32 Method_0x39f2(int64 Arg_0x0, float64 Arg_0x1, int8 Arg_0x2) @@ -35,6 +36,9 @@ ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b36304/b36304.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b36304/b36304.il index 1f62ebf2266945..9780425612850c 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b36304/b36304.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b36304/b36304.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x7ff151ef {} +.assembly extern xunit.core {} .class ILGEN_0x7ff151ef { .method static float32 Method_0x53ea(float64 Arg_0x0, unsigned int64 Arg_0x5) { .maxstack 15 @@ -38,6 +39,9 @@ End_Orphan_8: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .locals (int32) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b36975/b36975.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b36975/b36975.il index 0db5cfadf75377..ffadb96162a8a9 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b36975/b36975.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b36975/b36975.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x7fec790f {} +.assembly extern xunit.core {} .class ILGEN_0x7fec790f { .field static unsigned int16 field_0x7 @@ -36,6 +37,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 call float32 ILGEN_0x7fec790f::Method_0x4945() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37214/b37214.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37214/b37214.il index 7f652c74bb2a1e..e765a2bac91af5 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37214/b37214.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37214/b37214.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x68eb9462 {} +.assembly extern xunit.core {} .class ILGEN_0x68eb9462 { .method static float32 Method_0x42ed(unsigned int8 Arg_0x0, unsigned int64 Arg_0x1, unsigned int32 Arg_0x2, float32 Arg_0x3, int8 Arg_0x4, unsigned int8 Arg_0x5, int32 Arg_0x6) { @@ -39,6 +40,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37215/b37215.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37215/b37215.il index 6635290e1b93de..59e3d78ac70e54 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37215/b37215.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37215/b37215.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x68eb95f0 {} +.assembly extern xunit.core {} .class ILGEN_0x68eb95f0 { .field static float32[] field_0x8 @@ -51,6 +52,9 @@ End_Orphan_34: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37238/b37238.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37238/b37238.il index f82bb9cc9c77a3..53a87225820e0b 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37238/b37238.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37238/b37238.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x7fee1ca2 {} +.assembly extern xunit.core {} .class ILGEN_0x7fee1ca2 { .method static float32 Method_0x54eb(int64 Arg_0x0, int16 Arg_0x1, unsigned int32 Arg_0x2, unsigned int16 Arg_0x3, int8 Arg_0x4, int16 Arg_0x5, int8 Arg_0x6) { .maxstack 15 @@ -45,6 +46,9 @@ End_Orphan_5: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37256/b37256.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37256/b37256.il index 487028a437184f..5f2ab32be0438e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37256/b37256.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37256/b37256.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xe08350d0 {} +.assembly extern xunit.core {} .class ILGEN_0xe08350d0 { .method static float32 Method_0x4d9a(float32 Arg_0x0, int64 Arg_0x1) { .maxstack 7 @@ -45,6 +46,9 @@ ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.r4 float32(0xfc46528) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37578/b37578.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37578/b37578.il index 465f70027ce7a1..8ed32c4cb36eb5 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37578/b37578.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37578/b37578.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x68ef9cc3 {} +.assembly extern xunit.core {} .class ILGEN_0x68ef9cc3 { .field static unsigned int64[] field_0x7 @@ -51,6 +52,9 @@ End_Orphan_56: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37830/b37830.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37830/b37830.il index c3f8f81b525fe1..febb86a7200b0e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37830/b37830.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b37830/b37830.il @@ -8,9 +8,13 @@ .ver 4:0:0:0 } .assembly ILGEN_0xe012a579 {} +.assembly extern xunit.core {} .class ILGEN_0xe012a579 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b40006/b40006.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b40006/b40006.il index 0c5c8d3a02a3f9..751cc671d60a5b 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b40006/b40006.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b40006/b40006.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x56afce22 {} +.assembly extern xunit.core {} .class ILGEN_0x56afce22 { @@ -29,6 +30,9 @@ End_Orphan_6: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i8 0x96a180a0 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b43693/b43693.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b43693/b43693.il index d61f0ca5259b44..555a8c7a7e76be 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b43693/b43693.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b43693/b43693.il @@ -11,10 +11,14 @@ { } +.assembly extern xunit.core {} .class M { .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 .locals (float32 f) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b43694/b43694.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b43694/b43694.il index 86011640d8b1e6..f8293955f7771f 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b43694/b43694.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b43694/b43694.il @@ -11,10 +11,14 @@ { } +.assembly extern xunit.core {} .class M { .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 .locals (float32 f) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b46566/b46566.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b46566/b46566.il index fdf2d93acad308..f8cb7321a23fbb 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b46566/b46566.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b46566/b46566.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b46566 {} +.assembly extern xunit.core {} .class ILGEN_0x2a312d7 { .field static int64 field_0x4 .method static int32 Method_0x838bffa6(float32 Arg_0x5) { @@ -53,6 +54,9 @@ ldc.i4 55 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b47471/b47471.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b47471/b47471.il index 7325f7005610c3..9eff169b12468e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b47471/b47471.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b47471/b47471.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x2e3bca41 {} +.assembly extern xunit.core {} .class ILGEN_0x2e3bca41 { .method static int32 Method_0x76a09634() { .maxstack 1 @@ -15,6 +16,9 @@ ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 call int32 ILGEN_0x2e3bca41::Method_0x76a09634() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b47886/b47886.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b47886/b47886.il index 7bd8945f6d6f37..6abd8bdb1c3bfa 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b47886/b47886.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b47886/b47886.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xce8ea34 {} +.assembly extern xunit.core {} .class ILGEN_0xce8ea34 { .field static unsigned int32 field_0x3 .field static int8 field_0x5 @@ -322,6 +323,9 @@ End_Orphan_12: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b49104/b49104.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b49104/b49104.il index 96c7b63198a6ff..7ec1e6b167b25d 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b49104/b49104.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b49104/b49104.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x5fc83106 {} +.assembly extern xunit.core {} .class ILGEN_0x5fc83106 { .method static int32 Method_0x959f4c04(unsigned int8 Arg_0x0, int32 Arg_0x1, unsigned int16 Arg_0x2, float64 Arg_0x3, int8 Arg_0x4, unsigned int64 Arg_0x5) { @@ -110,6 +111,9 @@ End_Orphan_0: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b49335/b49335.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b49335/b49335.il index 9745e45ad2dce5..12e16819500d28 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b49335/b49335.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b49335/b49335.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x8384f4c4 {} +.assembly extern xunit.core {} .class ILGEN_0x8384f4c4 { .field static unsigned int64 field_0x0 .method static int32 Method_0x3d8c15be(int64 Arg_0x0, float32 Arg_0x1) { @@ -43,6 +44,9 @@ End_Orphan_3c: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b49435/b49435-ia64.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b49435/b49435-ia64.il index 8d8a27cf45d84c..433e24f9a9101c 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b49435/b49435-ia64.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b49435/b49435-ia64.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xa691ee4d {} +.assembly extern xunit.core {} .class ILGEN_0xa691ee4d { .field static int32[] field_0x0 .field static float64[] field_0x1 @@ -635,6 +636,9 @@ End_Orphan_54: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b50026/b50026.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b50026/b50026.il index e8d59cd3c4a7a2..2add1ebc769e9e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b50026/b50026.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b50026/b50026.il @@ -8,9 +8,13 @@ .ver 4:0:0:0 } .assembly ILGEN_0x22bcffe4 {} +.assembly extern xunit.core {} .class ILGEN_0x22bcffe4 { .field static unsigned int16[] field_0x0 .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i4 255 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b50027/b50027.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b50027/b50027.il index 70222dabde1aca..a6eababc21c32a 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b50027/b50027.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b50027/b50027.il @@ -10,6 +10,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x13e5362e {} +.assembly extern xunit.core {} .class ILGEN_0x13e5362e { //BEGIN STATIC FIELDS @@ -661,6 +662,9 @@ End_Orphan_7a: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b50033/b50033.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b50033/b50033.il index 55a6c133244348..43bb74513ab26a 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b50033/b50033.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b50033/b50033.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xa83217d {} +.assembly extern xunit.core {} .class ILGEN_0xa83217d { .field static int8 field_0x0 @@ -136,6 +137,9 @@ End_Orphan_8: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b51420/b51420.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b51420/b51420.il index 6f7497c9f4351d..dbea34dd225a17 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b51420/b51420.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b51420/b51420.il @@ -10,6 +10,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xbc077bd {} +.assembly extern xunit.core {} .class ILGEN_0xbc077bd { //BEGIN STATIC FIELDS @@ -493,6 +494,9 @@ End_Orphan_38: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b51515/b51515.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b51515/b51515.il index 9db6133e88d3c9..108af5d6e3eb5d 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b51515/b51515.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b51515/b51515.il @@ -8,9 +8,13 @@ .ver 4:0:0:0 } .assembly ILGEN_0x24fde2d6 {} +.assembly extern xunit.core {} .class ILGEN_0x24fde2d6 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .maxstack 13 .entrypoint ldc.r8 float64(0x1b376e25972ab43) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b51575/b51575.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b51575/b51575.il index ef7b9a2908e7b5..6cc32652c18fa4 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b51575/b51575.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b51575/b51575.il @@ -8,12 +8,16 @@ .ver 4:0:0:0 } .assembly 'native' { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi Test extends [mscorlib]System.Object { .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (unsigned int64 LOC) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53650/b53650.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53650/b53650.il index adfb49c9dc67f2..d68eb5e5f8b279 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53650/b53650.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53650/b53650.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0x4f1d560c {} +.assembly extern xunit.core {} .class ILGEN_0x4f1d560c { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .locals (float64 local_0x0) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53662/b53662.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53662/b53662.il index 3b4506ac340b72..70449bc0b37251 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53662/b53662.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53662/b53662.il @@ -3,12 +3,16 @@ .assembly extern mscorlib{} .assembly Recurse1 {} +.assembly extern xunit.core {} .namespace Recurse1 { .class public Recurse1 { .method public static int32 Main(class System.String[] A_0) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (int32 V_0) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53878/b53878.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53878/b53878.il index 09e395df207db5..65c6e30f94322a 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53878/b53878.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53878/b53878.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0xab09d49 {} +.assembly extern xunit.core {} .class ILGEN_0xab09d49 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53884/b53884.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53884/b53884.il index dfc352f07a874f..d75ccc786ef5da 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53884/b53884.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53884/b53884.il @@ -10,6 +10,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x3c109d11 {} +.assembly extern xunit.core {} .class ILGEN_0x3c109d11 { //BEGIN STATIC FIELDS @@ -267,6 +268,9 @@ End_Orphan_2d: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53942/b53942a.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53942/b53942a.il index 76fe0e2a0105e7..545ff0447f207b 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53942/b53942a.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53942/b53942a.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b53942a {} +.assembly extern xunit.core {} .class ILGEN_0x7d76169 { @@ -115,6 +116,9 @@ ldc.i4 255 EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53942/b53942b.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53942/b53942b.il index b6136aa10f6eff..9b1981ce228847 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53942/b53942b.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53942/b53942b.il @@ -10,6 +10,7 @@ .ver 4:0:0:0 } .assembly b53942b {} +.assembly extern xunit.core {} .class ILGEN_0x198bde61 { //BEGIN STATIC FIELDS @@ -144,6 +145,9 @@ ldc.i4 55 EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53958/b53958.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53958/b53958.il index 18abdfe0a9c6b2..aa09f40ccc8447 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53958/b53958.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53958/b53958.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x12f85afc {} +.assembly extern xunit.core {} .class ILGEN_0x12f85afc { .method static int32 Method_0x7e13e3a1(native int Arg_0x3) { .maxstack 7 @@ -35,6 +36,9 @@ ldc.i4 0xf3d3f215 conv.i EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53977/b53977.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53977/b53977.il index dc3a20f409f29a..7d008fc9e2e708 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53977/b53977.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53977/b53977.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1c24c9c8 {} +.assembly extern xunit.core {} .class ILGEN_0x1c24c9c8 { .field static int64 field_0x0 .field static int8[] field_0x1 @@ -147,6 +148,9 @@ End_Orphan_4: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53980/b53980.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53980/b53980.il index 0529c6245221f1..7fd897f3105354 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53980/b53980.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53980/b53980.il @@ -10,6 +10,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x12984aee {} +.assembly extern xunit.core {} .class ILGEN_0x12984aee { //BEGIN STATIC FIELDS @@ -765,6 +766,9 @@ End_Orphan_82: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53994/b53994.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53994/b53994.il index 2fc77d29410c7f..b35e1acf66054c 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53994/b53994.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53994/b53994.il @@ -10,6 +10,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1759e5bf {} +.assembly extern xunit.core {} .class ILGEN_0x1759e5bf { //BEGIN STATIC FIELDS @@ -390,6 +391,9 @@ End_Orphan_28: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53995/b53995.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53995/b53995.il index fd85bd9289db6f..9f1d58170e7c48 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53995/b53995.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b53995/b53995.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1c45e3d8 {} +.assembly extern xunit.core {} .class ILGEN_0x1c45e3d8 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .locals (unsigned int64 local_0x5) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54006/b54006.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54006/b54006.il index d17e0c9aeb8395..feddfc917afae5 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54006/b54006.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54006/b54006.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1ef13d7d {} +.assembly extern xunit.core {} .class ILGEN_0x1ef13d7d { .field static unsigned int64 field_0x0 @@ -181,6 +182,9 @@ End_Orphan_9: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.r8 float64(0x64820c6a7ba2c73a2bb61987b87c8cb) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54565/b54565.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54565/b54565.il index c5ea12e5183847..f64f29c87acf98 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54565/b54565.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54565/b54565.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x127c25 {} +.assembly extern xunit.core {} .class ILGEN_0x127c25 { .field static int16 field_0x0 @@ -151,6 +152,9 @@ End_Orphan_0: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54566/b54566.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54566/b54566.il index 8fb7e173eca247..4c71fd512b7247 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54566/b54566.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54566/b54566.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1ad7535f {} +.assembly extern xunit.core {} .class ILGEN_0x1ad7535f { .field static float64[] field_0x0 @@ -217,6 +218,9 @@ End_Orphan_0: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54611/b54611.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54611/b54611.il index 971ec33ec50065..44bf475a8df1a3 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54611/b54611.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54611/b54611.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x142726a2 {} +.assembly extern xunit.core {} .class ILGEN_0x142726a2 { @@ -394,6 +395,9 @@ End_Orphan_28: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54971/b54971.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54971/b54971.il index 9d048e8119f62e..53384910dee73a 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54971/b54971.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b54971/b54971.il @@ -10,6 +10,7 @@ .assembly bug { } +.assembly extern xunit.core {} .namespace JitTest { .class value private auto ansi sealed VT extends [mscorlib]System.ValueType @@ -17,6 +18,9 @@ .field public int32 m_n .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (value class JitTest.VT src, value class JitTest.VT dst) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b55923/b55923.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b55923/b55923.il index f7fcf9928bf46d..7cf351e7334d1b 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b55923/b55923.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b55923/b55923.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0x3194e02a {} +.assembly extern xunit.core {} .class ILGEN_0x3194e02a { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 9 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b56066/b56066.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b56066/b56066.il index aa3c9a91b323bf..d21ae30b236565 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b56066/b56066.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b56066/b56066.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x3e559786 {} +.assembly extern xunit.core {} .class ILGEN_0x3e559786 { .method static int32 Method_0x17d83b09(float32 Arg_0x4, int16 Arg_0x5) { .maxstack 15 @@ -36,6 +37,9 @@ End_Orphan_0: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.r4 float32(0x49605a96) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b56068/b56068.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b56068/b56068.il index be18bc2d408d1e..1c3625610328fe 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b56068/b56068.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b56068/b56068.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x14dd78f4 {} +.assembly extern xunit.core {} .class ILGEN_0x14dd78f4 { .field static unsigned int8 field_0x0 .field static unsigned int64 field_0x1 @@ -269,6 +270,9 @@ ldc.i4 55 EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b56174/b56174.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b56174/b56174.il index b97cb901592af2..47d5d71d4222cd 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b56174/b56174.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b56174/b56174.il @@ -10,12 +10,16 @@ .assembly b56174 { } +.assembly extern xunit.core {} .class public auto ansi TestClass extends ['mscorlib']System.Object { .field static value class [mscorlib]System.RuntimeTypeHandle args .method public hidebysig static int32 Main(class [mscorlib]System.String[]) il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .maxstack 8 .entrypoint ldtoken int32 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b56349/b56349.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b56349/b56349.il index 0d19faaf85be24..59f88e4ce9010d 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b56349/b56349.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b56349/b56349.il @@ -8,12 +8,16 @@ .ver 4:0:0:0 } .assembly ILGEN_0xd62c9aaa {} +.assembly extern xunit.core {} .class ILGEN_0xd62c9aaa { .field static int64[] field_0x0 .field static int32 field_0x1 .field static unsigned int64[] field_0x2 .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 13 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b57492/b57492.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b57492/b57492.il index ad8c4254ff22d4..41947d51f14ec9 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b57492/b57492.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b57492/b57492.il @@ -8,9 +8,13 @@ .ver 4:0:0:0 } .assembly ILGEN_0x2019eaf2 {} +.assembly extern xunit.core {} .class ILGEN_0x2019eaf2 { .field static unsigned int64 field_0x4 .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b57493/b57493.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b57493/b57493.il index 2c646285f00f4c..183c1688e8c7c4 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b57493/b57493.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b57493/b57493.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1125a118 {} +.assembly extern xunit.core {} .class ILGEN_0x1125a118 { .field static float32 field_0x0 @@ -481,6 +482,9 @@ End_Orphan_4b: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b57516/b57516.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b57516/b57516.il index 5e591760472a35..5b3ead686c304c 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b57516/b57516.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b57516/b57516.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0xad3990e {} +.assembly extern xunit.core {} .class ILGEN_0xad3990e { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b57518/b57518.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b57518/b57518.il index b59b2b4c094c72..e4ce83e963a8d6 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b57518/b57518.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b57518/b57518.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0xa4d819be {} +.assembly extern xunit.core {} .class ILGEN_0xa4d819be { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b57952/b57952.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b57952/b57952.il index d83fe5671c20f1..8b8c95a642467b 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b57952/b57952.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b57952/b57952.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly test_3b { } +.assembly extern xunit.core {} .namespace Test2A { .class private auto ansi beforefieldinit TestClass @@ -44,6 +45,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 38 (0x26) .maxstack 1 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b58358/b58358.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b58358/b58358.il index 9ffbab3a2a80ef..1586c747511cd4 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b58358/b58358.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b58358/b58358.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x493230e7 {} +.assembly extern xunit.core {} .class ILGEN_0x493230e7 { .method static int32 Method_0x2d7c921() { .maxstack 11 @@ -35,6 +36,9 @@ Branch_0x1: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b58360/b58360.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b58360/b58360.il index c46a7a42e159a8..08d93415bdd0db 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b58360/b58360.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b58360/b58360.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0xa2afe952 {} +.assembly extern xunit.core {} .class ILGEN_0xa2afe952 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 11 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b58689/b58689.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b58689/b58689.il index 20228a0629ec87..d20930b3ead7d1 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b58689/b58689.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b58689/b58689.il @@ -8,10 +8,14 @@ .ver 4:0:0:0 } .assembly ILGEN_0x24fde2d6 {} +.assembly extern xunit.core {} .class ILGEN_0x24fde2d6 { .field static unsigned int8 field_0x2 .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b58690/b58690.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b58690/b58690.il index 1b97850a312269..8944acf98e73c6 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b58690/b58690.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b58690/b58690.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x78389777 {} +.assembly extern xunit.core {} .class ILGEN_0x78389777 { .field static native int[] field_0x4 .method static int32 Method_0x440f1192(int16 Arg_0x0, unsigned int8 Arg_0x2) { @@ -38,6 +39,9 @@ ldc.i4 55 EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i4 0xbe258710 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b58866/b58866.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b58866/b58866.il index 7e61d4f6f33aa2..9d08020a05a6c4 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b58866/b58866.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b58866/b58866.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x3155fdf {} +.assembly extern xunit.core {} .class ILGEN_0x3155fdf { .method static int32 Method_0xcfd10851(int64 Arg_0x2, int8 Arg_0x3, unsigned int64 Arg_0x5, int8 Arg_0x6) { .maxstack 11 @@ -51,6 +52,9 @@ Branch_0x1: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i8 11 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59319/b59319.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59319/b59319.il index 350bd945d8f0c4..753305d11a5a40 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59319/b59319.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59319/b59319.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0x46d17ff0 {} +.assembly extern xunit.core {} .class ILGEN_0x46d17ff0 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 9 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59320/b59320.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59320/b59320.il index c6730617b0eb40..5e09b941cf8f2a 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59320/b59320.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59320/b59320.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x77856409 {} +.assembly extern xunit.core {} .class ILGEN_0x77856409 { .field static unsigned int64 field_0x3 .field static unsigned int16 field_0x4 @@ -117,6 +118,9 @@ End_Orphan_4a: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59337/b59337.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59337/b59337.il index 144621fb2ba980..d755b61a5f45b7 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59337/b59337.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59337/b59337.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x7a129ee8 {} +.assembly extern xunit.core {} .class ILGEN_0x7a129ee8 { .method static int32 Method_0x63d7449b() { .maxstack 17 @@ -27,6 +28,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 call int32 ILGEN_0x7a129ee8::Method_0x63d7449b() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59477/b59477.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59477/b59477.il index 70722c9e384a8e..a5dcbc712b0030 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59477/b59477.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59477/b59477.il @@ -8,9 +8,13 @@ .ver 4:0:0:0 } .assembly ILGEN_0x346ef95 {} +.assembly extern xunit.core {} .class ILGEN_0x346ef95 { .field static float32[] field_0x1 .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 9 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59478/b59478.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59478/b59478.il index 7ad40a6414b607..38b030575d014f 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59478/b59478.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59478/b59478.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xa09c7ca6 {} +.assembly extern xunit.core {} .class ILGEN_0xa09c7ca6 { .method static int32 Method_0x1ff34cdc(int64 Arg_0x1) { .maxstack 9 @@ -62,6 +63,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i8 0x22b82bcf59019229 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59508/b59508.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59508/b59508.il index f283506c115190..c03dba17a95094 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59508/b59508.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59508/b59508.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x486ae288 {} +.assembly extern xunit.core {} .class ILGEN_0x486ae288 { .method static int32 Method_0x317f3e0e(int32 Arg_0x2) { .maxstack 9 @@ -42,6 +43,9 @@ Branch_0x1: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i4 0x5c842a99 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59546/b59546.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59546/b59546.il index 9f8bc13417a9d2..d57a4f3d22285b 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59546/b59546.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59546/b59546.il @@ -8,6 +8,7 @@ } .assembly extern legacy library mscorlib {} .assembly bug {} +.assembly extern xunit.core {} .class public bug { .method public static void f1() cil managed @@ -58,6 +59,9 @@ .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59554/b59554.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59554/b59554.il index 9c7d07802d8316..7c84731fa020da 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59554/b59554.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59554/b59554.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x942c2798 {} +.assembly extern xunit.core {} .class ILGEN_0x942c2798 { .field static float32 field_0x2 @@ -62,6 +63,9 @@ ldc.i4 55 EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59647/b59647.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59647/b59647.il index aa1168bfdf4b57..c503eb66825e68 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59647/b59647.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59647/b59647.il @@ -8,9 +8,13 @@ .ver 4:0:0:0 } .assembly ILGEN_0x3052ecd2 {} +.assembly extern xunit.core {} .class ILGEN_0x3052ecd2 { .field static unsigned int8 field_0x4 .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 5 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59678/b59678.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59678/b59678.il index 7683acd60b4fde..63bdd3699e9d8a 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59678/b59678.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59678/b59678.il @@ -8,10 +8,14 @@ } .assembly extern legacy library mscorlib {} .assembly convr4a {} +.assembly extern xunit.core {} .class public bug1 extends [mscorlib]System.Object { .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 .locals ( bool V_0, diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59782/b59782.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59782/b59782.il index 6eb27c5c802cfa..216d77efbd9c15 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59782/b59782.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59782/b59782.il @@ -10,6 +10,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x372a9ae6 {} +.assembly extern xunit.core {} .class ILGEN_0x372a9ae6 { //BEGIN STATIC FIELDS @@ -7966,6 +7967,9 @@ End_Orphan_1d6: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59822/b59822.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59822/b59822.il index 0dbf996783a4ab..f92e5f3e5817d0 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59822/b59822.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59822/b59822.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1db2cfa3 {} +.assembly extern xunit.core {} .class ILGEN_0x1db2cfa3 { .field static int16[] field_0x0 @@ -345,6 +346,9 @@ End_Orphan_9: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59947/b59947.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59947/b59947.il index 20c7ed37361279..c064be1f767f59 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59947/b59947.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59947/b59947.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xf2c69f5c {} +.assembly extern xunit.core {} .class ILGEN_0xf2c69f5c { .field static unsigned int16[] field_0x1 @@ -121,6 +122,9 @@ ldc.r4 float32(0xeaeed99b) EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i4 0xc4d19849 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59948/b59948.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59948/b59948.il index e968b615df7c30..dd2c1f02734231 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59948/b59948.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59948/b59948.il @@ -13,6 +13,7 @@ { } +.assembly extern xunit.core {} .module '1' // MVID: {9A90DFD6-02B6-45EC-9CEF-25C2CAF3BF19} @@ -130,6 +131,9 @@ .method private static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 34 (0x22) .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59949/b59949.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59949/b59949.il index e3a76c3e850aa0..671aaf5dd7e816 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59949/b59949.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59949/b59949.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xdd840404 {} +.assembly extern xunit.core {} .class ILGEN_0xdd840404 { .field static unsigned int32 field_0x0 @@ -123,6 +124,9 @@ End_Orphan_6: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59952/b59952.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59952/b59952.il index 2735ec8066c459..7fb998626e7b4f 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59952/b59952.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59952/b59952.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xd4820a77 {} +.assembly extern xunit.core {} .class ILGEN_0xd4820a77 { .field static unsigned int64[] field_0x0 @@ -331,6 +332,9 @@ End_Orphan_d: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59953/b59953.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59953/b59953.il index f63945817feae7..faadf9bb2dec2f 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59953/b59953.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b59953/b59953.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x4601be46 {} +.assembly extern xunit.core {} .class ILGEN_0x4601be46 { .field static int64 field_0x0 @@ -120,6 +121,9 @@ End_Orphan_c: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i8 0xb62352d6af44571c diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b60127/b60127.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b60127/b60127.il index 71812db927e71b..7a1831c990f6ba 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b60127/b60127.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b60127/b60127.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x68501543 {} +.assembly extern xunit.core {} .class ILGEN_0x68501543 { .method static int32 Method_0xfcb53e4a(float32 Arg_0x4) { .maxstack 9 @@ -26,6 +27,9 @@ Branch_0x1: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.r4 3.3 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b60142/b60142.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b60142/b60142.il index 692c0699b1c9c8..2bebfec3778968 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b60142/b60142.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b60142/b60142.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x8fd0798a {} +.assembly extern xunit.core {} .class ILGEN_0x8fd0798a { .field static unsigned int64 field_0x0 @@ -2207,6 +2208,9 @@ ldc.i4 55 EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b60194/b60194.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b60194/b60194.il index b2349684e55ca4..044f0ee56bd541 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b60194/b60194.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b60194/b60194.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x6bcd7c1d {} +.assembly extern xunit.core {} .class ILGEN_0x6bcd7c1d { .method static int32 Method_0xda4a4950(unsigned int16 Arg_0x1) { .maxstack 9 @@ -33,6 +34,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i4 0x99045c3e diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b61025/b61025.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b61025/b61025.il index 89448b49b4e918..11158ddb361ee2 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b61025/b61025.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b61025/b61025.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0x2806523a {} +.assembly extern xunit.core {} .class ILGEN_0x2806523a { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 11 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b61185/b61185.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b61185/b61185.il index ab2220b1d70371..51c8523f873554 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b61185/b61185.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b61185/b61185.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xe71156b4 {} +.assembly extern xunit.core {} .class ILGEN_0xe71156b4 { .field static unsigned int64 field_0x0 @@ -110,6 +111,9 @@ ldc.i4.5 EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b61215/b61215.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b61215/b61215.il index b33f6f2959a60d..39a030948cdbd7 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b61215/b61215.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b61215/b61215.il @@ -8,9 +8,13 @@ .ver 4:0:0:0 } .assembly ILGEN_0x947e98be {} +.assembly extern xunit.core {} .class ILGEN_0x947e98be { .field static native int field_0x0 .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 13 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b62145/b62145.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b62145/b62145.il index 9831353036a036..9381a45c92225c 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b62145/b62145.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b62145/b62145.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xa00c093a {} +.assembly extern xunit.core {} .class ILGEN_0xa00c093a { .method static int32 Method_0x8839aba4(int16 Arg_0x0,native int Arg_0x7, native int Arg_0x8) { .maxstack 5 @@ -32,6 +33,9 @@ Branch_0x1: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i4 0x3c95b9ed diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63552/b63552.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63552/b63552.il index da6ff58ab729de..5e788339df98b9 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63552/b63552.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63552/b63552.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xa967417e {} +.assembly extern xunit.core {} .class ILGEN_0xa967417e { .method static int32 Method_0xdb3affb(unsigned int16 Arg_0x0, int64 Arg_0x1, native int Arg_0x2) { .maxstack 3 @@ -17,6 +18,9 @@ clt ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 6 ldc.i4 0xb1eb25b3 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63725/b63725.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63725/b63725.il index d4421df832660a..ab20cfca4c4bc6 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63725/b63725.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63725/b63725.il @@ -8,9 +8,13 @@ .ver 4:0:0:0 } .assembly ILGEN_0xb372dbdf {} +.assembly extern xunit.core {} .class ILGEN_0xb372dbdf { .field static int64 field_0xc .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .locals (float32 LOCAL_0x4,int16[] LOCAL_0x5,int64 LOCAL_0x6,native int LOCAL_0x7,int64 LOCAL_0x8,unsigned int32 LOCAL_0x9,native int[] LOCAL_0xa) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63726/b63726.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63726/b63726.il index f2961de38ad3ce..b90505356a403d 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63726/b63726.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63726/b63726.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xd73e17d6 {} +.assembly extern xunit.core {} .class ILGEN_0xd73e17d6 { //BEGIN STATIC FIELDS @@ -8592,6 +8593,9 @@ End_Orphan_246: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63730/b63730.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63730/b63730.il index 23e031d854d9c2..09c27c91b660a8 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63730/b63730.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63730/b63730.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x200e1753 {} +.assembly extern xunit.core {} .class ILGEN_0x200e1753 { .method static int32 Method_0xae74a560(unsigned int64 Arg_0x0, int32 Arg_0x1, unsigned int8 Arg_0x2) { .maxstack 9 @@ -41,6 +42,9 @@ Branch_0xb: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63732/b63732.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63732/b63732.il index d78317e832d706..4f1f4a21664892 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63732/b63732.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63732/b63732.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x3180c570 {} +.assembly extern xunit.core {} .class ILGEN_0x3180c570 { .method static int32 Method_0xa3b20838(unsigned int8 Arg_0x0, unsigned int16 Arg_0x2, float32 Arg_0x3) { .maxstack 9 @@ -28,6 +29,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63743/b63743.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63743/b63743.il index 45f3973d534b37..89904822558d90 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63743/b63743.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63743/b63743.il @@ -8,8 +8,12 @@ } .assembly extern mscorlib {} .assembly ILGEN_0x9461697d {} +.assembly extern xunit.core {} .class ILGEN_0x9461697d { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 2 ldc.r8 1.2e+309 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63823/b63823.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63823/b63823.il index 3623830d75582a..09b2ce40fd8459 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63823/b63823.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b63823/b63823.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0x12b94a25 {} +.assembly extern xunit.core {} .class ILGEN_0x12b94a25 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 2 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b64026/b64026.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b64026/b64026.il index 0111b27187bbab..104b8d2ed9b798 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b64026/b64026.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b64026/b64026.il @@ -11,6 +11,7 @@ .assembly 'ldvirtftncalli' { } +.assembly extern xunit.core {} .class private auto ansi beforefieldinit A extends [mscorlib]System.Object { @@ -70,6 +71,9 @@ .method public hidebysig static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 279 (0x117) .maxstack 2 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b64560/b64560.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b64560/b64560.il index 5f3f9adb315872..5f80ccdefc8105 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b64560/b64560.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b64560/b64560.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly test1 {} +.assembly extern xunit.core {} .class public test1 { .method public static void f1() @@ -25,6 +26,9 @@ } .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 20 IL_0002: call void test1::f1() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b65087/b65087.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b65087/b65087.il index 6829be85010cec..e1f878213ab036 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b65087/b65087.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b65087/b65087.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x6d8b44b0 {} +.assembly extern xunit.core {} .class ILGEN_0x6d8b44b0 { .method static int32 Method_0xcc3db83d(native int Arg_0x0, int8 Arg_0x1, native int Arg_0x2, unsigned int8 Arg_0x3) { .maxstack 7 @@ -33,6 +34,9 @@ Branch_0x0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b65176/b65176.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b65176/b65176.il index e35398617b4837..9af96e25d88583 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b65176/b65176.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b65176/b65176.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0x8ecc201e {} +.assembly extern xunit.core {} .class ILGEN_0x8ecc201e { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 9 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b65407/b65407.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b65407/b65407.il index 8965372b24a8f0..f1c81d713b2df5 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b65407/b65407.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b65407/b65407.il @@ -12,6 +12,7 @@ .assembly sample { } +.assembly extern xunit.core {} .module sample.exe // MVID: {EAE7CF60-60E9-49D2-84F9-F450B7E26DE4} @@ -23,6 +24,9 @@ { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 62 (0x3e) .maxstack 1 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b65423/b65423.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b65423/b65423.il index 7a07a5ac89bb1d..b8feb6f35ae1bd 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b65423/b65423.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b65423/b65423.il @@ -9,6 +9,7 @@ .assembly 'b1904' { } +.assembly extern xunit.core {} .module 'b1904.exe' .class private auto ansi b1904 extends ['mscorlib']System.Object { @@ -222,6 +223,9 @@ .method public static void Main() il managed forwardref { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (int32 V_0, diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66226/b66226.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66226/b66226.il index 23de6af0879a36..799f983a33d2d3 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66226/b66226.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66226/b66226.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x9b859686 {} +.assembly extern xunit.core {} .class ILGEN_0x9b859686 { .method static int32 Method_0xbe0b5ad5() { .maxstack 9 @@ -31,6 +32,9 @@ Branch_0x21: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66425/b66425.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66425/b66425.il index 99bfb55dc26c5d..55bab2486bec13 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66425/b66425.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66425/b66425.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly test_21_try {} +.assembly extern xunit.core {} .class TestClass{ @@ -56,6 +57,9 @@ lbl_21_exitSEH: .method public static int32 Main(class ['mscorlib']System.String[] arg) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) call void TestClass::test_21_try() .entrypoint ldc.i4 100 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66583/b66583.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66583/b66583.il index fe2828059e39f8..d965b97c9074d9 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66583/b66583.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66583/b66583.il @@ -12,6 +12,7 @@ .assembly qsort { } +.assembly extern xunit.core {} .module qsort.exe // MVID: {BEFEC472-D5C8-4747-807D-713417E95FBD} @@ -35,6 +36,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 134 (0x86) .maxstack 4 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66620/b66620.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66620/b66620.il index 996f915fabfcc5..2d7b4f1e790ea9 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66620/b66620.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66620/b66620.il @@ -13,6 +13,7 @@ .ver 4:0:0:0 } .assembly ctor_merge2 { } +.assembly extern xunit.core {} .class public auto ansi beforefieldinit TestClass extends [mscorlib]System.Object { @@ -54,6 +55,9 @@ } .method public hidebysig static int32 Main(class System.String[] args) il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 newobj instance void TestClass::.ctor() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66679/b66679.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66679/b66679.il index 14cfbdbbf3c1d5..ad1031e2b5d007 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66679/b66679.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b66679/b66679.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xb15094d8 {} +.assembly extern xunit.core {} .class ILGEN_0xb15094d8 { .method static int32 Method_0xddc6a26d() { .maxstack 7 @@ -42,6 +43,9 @@ Branch_0x1: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b67351/b67351.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b67351/b67351.il index 285b43e986f8df..486a65acb67d6d 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b67351/b67351.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b67351/b67351.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xe4b49040 {} +.assembly extern xunit.core {} .class ILGEN_0xe4b49040 { .method static int32 Method_0x11ee88a1(native int Arg_0xb) { .maxstack 9 @@ -25,6 +26,9 @@ pop ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 28 ldc.i4 0x2b153640 conv.i diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b67744/b67744.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b67744/b67744.il index 6c0abf722a4495..32251439d4c6ac 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b67744/b67744.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b67744/b67744.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xc881452f {} +.assembly extern xunit.core {} .class ILGEN_0xc881452f { .field static native int field_0x5 .method static int32 Method_0x34c75948() { @@ -31,6 +32,9 @@ Branch_0x1: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 2 call int32 ILGEN_0xc881452f::Method_0x34c75948() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b67819/b67819.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b67819/b67819.il index d382965360206a..5ba68d8f0086f2 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b67819/b67819.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b67819/b67819.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x8fe33afa {} +.assembly extern xunit.core {} .class ILGEN_0x8fe33afa { .field static unsigned int16[] field_0x0 .method static int32 Method_0x6c046099(int32 Arg_0x0, unsigned int64 Arg_0x1, unsigned int8 Arg_0x2, unsigned int32 Arg_0x3) { @@ -36,6 +37,9 @@ End_Orphan_2: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b67987/b67987.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b67987/b67987.il index f400efa126d36e..9f7527afefc2cf 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b67987/b67987.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b67987/b67987.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x48eb9718 {} +.assembly extern xunit.core {} .class ILGEN_0x48eb9718 { .field static unsigned int8 field_0x1 .method static int32 Method_0xb80cd6ff() { @@ -64,6 +65,9 @@ Branch_0x1: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68028/b68028.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68028/b68028.il index 4b21c35ef99386..e3f2bbafd4c6dd 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68028/b68028.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68028/b68028.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x2706a1c4 {} +.assembly extern xunit.core {} .class ILGEN_0x2706a1c4 { .method static void Method_0x7d1b2a40(int32 Arg_0x3) { .maxstack 7 @@ -20,6 +21,9 @@ ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68045/b68045.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68045/b68045.il index 70fcd151163823..82a5cb7270cdea 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68045/b68045.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68045/b68045.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x2693d3a2 {} +.assembly extern xunit.core {} .class ILGEN_0x2693d3a2 { .method static int32 Method_1(int32 Arg_0x0) { .maxstack 7 @@ -30,6 +31,9 @@ ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i4 0x6b0f7b31 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68757/b68757.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68757/b68757.il index e80660c21e857d..c3621ae135004a 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68757/b68757.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68757/b68757.il @@ -8,6 +8,7 @@ } .assembly extern legacy library mscorlib {} .assembly bug1 {} +.assembly extern xunit.core {} .class private bug1 { .class auto ansi nested public beforefieldinit CL1 @@ -29,6 +30,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals ([0] class bug1/CL1 cl1) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68872/b68872.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68872/b68872.il index e878449d60f962..66734ff2956da7 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68872/b68872.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68872/b68872.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly 'filter' { } +.assembly extern xunit.core {} .namespace JitTest { .class private auto ansi beforefieldinit Test @@ -16,6 +17,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 120 (0x78) .maxstack 2 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b69225/b69225.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b69225/b69225.il index 22d40b8ba76feb..575d95839d1ba8 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b69225/b69225.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b69225/b69225.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x2193e4b5 {} +.assembly extern xunit.core {} .class ILGEN_0x2193e4b5 { .field static unsigned int64 field_0x0 .field static unsigned int8 field_0x1 @@ -844,6 +845,9 @@ End_Orphan_3c: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b69227/b69227.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b69227/b69227.il index fe64627a5cb561..c1ae2144a8dde1 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b69227/b69227.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b69227/b69227.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x7af9ed84 {} +.assembly extern xunit.core {} .class ILGEN_0x7af9ed84 { .field static unsigned int32[] field_0x0 @@ -789,6 +790,9 @@ ldc.i4.7 EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b69512/b69512.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b69512/b69512.il index 4a5556296dd0e6..2ca78c0537229d 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b69512/b69512.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b69512/b69512.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x6af2431f {} +.assembly extern xunit.core {} .class ILGEN_0x6af2431f { .method static unsigned int16 Method_0x4ce0d6c6() { .maxstack 7 @@ -33,6 +34,9 @@ clt.un ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 13 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b69528/b69528.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b69528/b69528.il index f24cfe277c7292..26f61ad2a417e6 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b69528/b69528.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b69528/b69528.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xa8b0959c {} +.assembly extern xunit.core {} .class ILGEN_0xa8b0959c { .field static float32 field_0x2 .method static int32 Method_0xc0d2787() { @@ -35,6 +36,9 @@ ldc.i4 15 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 11 call int32 ILGEN_0xa8b0959c::Method_0xc0d2787() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b69848/b69848.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b69848/b69848.il index c675b2fd91eab1..4cb9325f64ea0b 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b69848/b69848.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b69848/b69848.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xbffa35b3 {} +.assembly extern xunit.core {} .class ILGEN_0xbffa35b3 { .field static unsigned int8[] field_0x0 .field static unsigned int8[] field_0x1 @@ -53,6 +54,9 @@ Branch_0x3: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 11 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70267/b70267.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70267/b70267.il index 7c95a1621e8126..194da004bd4041 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70267/b70267.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70267/b70267.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x4cf11307 {} +.assembly extern xunit.core {} .class ILGEN_0x4cf11307 { .field static unsigned int64 field_0x0 .method static int32 Method_0x3417140a() { @@ -29,6 +30,9 @@ Branch_0x3: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 call int32 ILGEN_0x4cf11307::Method_0x3417140a() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70289/b70289.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70289/b70289.il index d127dd18f50617..2c9051cd7dd691 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70289/b70289.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70289/b70289.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0x8d1cfa06 {} +.assembly extern xunit.core {} .class ILGEN_0x8d1cfa06 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70335/b70335.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70335/b70335.il index 6bbda4b0144d1c..eec40a57b15480 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70335/b70335.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70335/b70335.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x68de21f5 {} +.assembly extern xunit.core {} .class ILGEN_0x68de21f5 { .method static int32 Method_0xe207be7a() { .maxstack 7 @@ -24,6 +25,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70808/b70808.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70808/b70808.il index 6f88d1c06e717f..4937ad2c39a9e5 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70808/b70808.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70808/b70808.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x499af240 {} +.assembly extern xunit.core {} .class ILGEN_0x499af240 { .field static float64 field_0x5 .field static unsigned int32 field_0x6 @@ -28,6 +29,9 @@ ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 5 call unsigned int8 ILGEN_0x499af240::Method_0x48382bfd() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70964/b70964.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70964/b70964.il index 86404c2e999740..c82f8dd7353c9b 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70964/b70964.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70964/b70964.il @@ -10,6 +10,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x977f9ed2 {} +.assembly extern xunit.core {} .class ILGEN_0x977f9ed2 { //BEGIN STATIC FIELDS @@ -1473,6 +1474,9 @@ End_Orphan_d0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 1 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70967/b70967.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70967/b70967.il index 94b54dd589df2b..893cc0b0faf89e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70967/b70967.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70967/b70967.il @@ -12,6 +12,7 @@ .assembly bug { } +.assembly extern xunit.core {} .module bug.exe // MVID: {E3F734BC-107A-4058-AF49-D8BBB8B75D93} @@ -24,6 +25,9 @@ { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (int32 V_0) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70992/b70992.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70992/b70992.il index f419824620f2f7..2714fa81e316c0 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70992/b70992.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70992/b70992.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0xa483b94d {} +.assembly extern xunit.core {} .class ILGEN_0xa483b94d { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 13 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70994/b70994.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70994/b70994.il index 23623d9989704f..a3d8078f5b61e8 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70994/b70994.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b70994/b70994.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x44a8fb5b {} +.assembly extern xunit.core {} .class ILGEN_0x44a8fb5b { .method static unsigned int64 Method_0x18dabcc4( int32 Arg_0x3) { .maxstack 5 @@ -25,6 +26,9 @@ Branch_0x1: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 15 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71003/b71003.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71003/b71003.il index 139a6ed42cf5a7..9ffa444d6746cf 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71003/b71003.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71003/b71003.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x5c49cb7e {} +.assembly extern xunit.core {} .class ILGEN_0x5c49cb7e { .method static float32 Method_0x19bd6d70(native int Arg_0x0) { .maxstack 15 @@ -23,6 +24,9 @@ conv.r8 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 7 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71179/b71179.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71179/b71179.il index e9285be678da34..c7ed17de125072 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71179/b71179.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71179/b71179.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x13230206 {} +.assembly extern xunit.core {} .class ILGEN_0x13230206 { //BEGIN STATIC FIELDS @@ -536,6 +537,9 @@ End_Orphan_4c: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71722/b71722.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71722/b71722.il index ed6145f326025e..eee1fd78bcac30 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71722/b71722.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71722/b71722.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xee5a2e00 {} +.assembly extern xunit.core {} .class ILGEN_0xee5a2e00 { .method static unsigned int64 Method_0x28374f71(native int Arg_0x0) { .maxstack 5 @@ -31,6 +32,9 @@ Branch_0x3: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 3 ldc.i4 0x0 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71831/b71831.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71831/b71831.il index 93c5adfc801480..b7a594b8a9a0d1 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71831/b71831.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71831/b71831.il @@ -10,6 +10,7 @@ .ver 4:0:0:0 } .assembly b71831 { } +.assembly extern xunit.core {} .class ILGEN_0x42acd912 { //BEGIN STATIC FIELDS @@ -225,6 +226,9 @@ ldelem.i4 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 3 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71869/b71869.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71869/b71869.il index eb2f4dcf8d2f4e..4404ac2b7b5fb4 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71869/b71869.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71869/b71869.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly b71869 { } +.assembly extern xunit.core {} .class I { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 9 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71999/b71999.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71999/b71999.il index 77569999da597a..d5d78893eb31ce 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71999/b71999.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b71999/b71999.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xaca96c86 {} +.assembly extern xunit.core {} .class ILGEN_0xaca96c86 { .method static float64 Method_0x88567f92(native int Arg_0x0, float32 Arg_0x1) { .maxstack 3 @@ -19,6 +20,9 @@ conv.r4 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 5 ldc.i4 0x11e97b18 conv.i diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72160/b72160.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72160/b72160.il index 2cb4e06afd0555..725ef897c2146b 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72160/b72160.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72160/b72160.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b72160 { } +.assembly extern xunit.core {} .class ILGEN_0xace3f910 { //BEGIN STATIC FIELDS @@ -128,6 +129,9 @@ conv.r8 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 19 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72161/b72161.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72161/b72161.il index c8d939fcd18a22..9ccc721e3efc5f 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72161/b72161.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72161/b72161.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b72161 { } +.assembly extern xunit.core {} .class ILGEN_0x27d73bb9 { .field static int64[] field_0x0 .field static int64 field_0x1 @@ -49,6 +50,9 @@ mul ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 27 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72518/b72518.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72518/b72518.il index 2da408c7d85d3e..74278d40f874d8 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72518/b72518.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72518/b72518.il @@ -7,7 +7,8 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly ILGEN_0xb37e58f3.exe {} +.assembly ILGEN_0xb37e58f3 {} +.assembly extern xunit.core {} .class ILGEN_0xb37e58f3 { .method static int8 Method_0xf9cacde1() { .maxstack 9 @@ -37,6 +38,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 1 call int8 ILGEN_0xb37e58f3::Method_0xf9cacde1() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72522/b72522.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72522/b72522.il index 696aa3554a7107..26a21556a24135 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72522/b72522.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72522/b72522.il @@ -7,7 +7,8 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly ILGEN_0x2dda4eb5.exe {} +.assembly ILGEN_0x2dda4eb5 {} +.assembly extern xunit.core {} .class ILGEN_0x2dda4eb5 { .method static unsigned int16 Method_0xa084659a() { .maxstack 13 @@ -40,6 +41,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 1 call unsigned int16 ILGEN_0x2dda4eb5::Method_0xa084659a() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72699/b72699.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72699/b72699.il index b87112803b73d4..7529727f36a5f8 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72699/b72699.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72699/b72699.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly test_3b { } +.assembly extern xunit.core {} .namespace JitTest { .class private value sealed ansi beforefieldinit ValueClass @@ -50,6 +51,9 @@ .method private hidebysig static int32 Main() il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 38 (0x26) .maxstack 2 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72828/b72828.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72828/b72828.il index 73591db02cb91b..24059de4d88bd4 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72828/b72828.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b72828/b72828.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b72828 { } +.assembly extern xunit.core {} .class ILGEN_0x3531e7ef { .method static int16 Method_0xac3c20e0() { .maxstack 3 @@ -22,6 +23,9 @@ ldind.i1 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 5 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b73079/b73079.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b73079/b73079.il index 101eb8808143c1..29406d9fb2ce1e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b73079/b73079.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b73079/b73079.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xd1507ca {} +.assembly extern xunit.core {} .class ILGEN_0xd1507ca { .field static native int field_0x2 .method static int32 Method_0xee92d415(float32 Arg_0x0) { @@ -31,6 +32,9 @@ Branch_0x3: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 3 ldc.r4 float32(0x2794165b) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b73207/b73207.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b73207/b73207.il index 6002f82b00846e..7bf489819f86fc 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b73207/b73207.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b73207/b73207.il @@ -10,6 +10,7 @@ .ver 4:0:0:0 } .assembly b73207 { } +.assembly extern xunit.core {} .class ILGEN_0x2c1d0308 { //BEGIN STATIC FIELDS @@ -672,6 +673,9 @@ End_Orphan_54: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b73283/b73283.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b73283/b73283.il index c43b1541734374..236ca89ca9ce36 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b73283/b73283.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b73283/b73283.il @@ -7,9 +7,13 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly ILGEN_0x1f0f388d.exe {} +.assembly ILGEN_0x1f0f388d {} +.assembly extern xunit.core {} .class ILGEN_0x1f0f388d { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 9 .locals (float64 LOCAL_0x3,float32[] LOCAL_0x5) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b73786/b73786.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b73786/b73786.il index f647789d37ecee..434270735c9b57 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b73786/b73786.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b73786/b73786.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b73786 { } +.assembly extern xunit.core {} .class ILGEN_0x4a792db4 { .field static unsigned int64 field_0x0 .method static int32 Method_0x2a166130(int64 Arg_0x0, unsigned int16 Arg_0x1, unsigned int8 Arg_0x2, float64 Arg_0x3, unsigned int8 Arg_0x4, unsigned int32 Arg_0x5, int64 Arg_0x6) { @@ -51,6 +52,9 @@ End_Orphan_2d: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 15 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b74608/b74608.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b74608/b74608.il index 7e6a1975941bee..8c52bba5605ea2 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b74608/b74608.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b74608/b74608.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b74608 { } +.assembly extern xunit.core {} .class ILGEN_0x68ef7b55 { .method static int32 Method_0x98671696(int16 Arg_0x2) { .maxstack 19 @@ -29,6 +30,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 7 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b74937/b74937.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b74937/b74937.il index fd6bd8c2c6c86f..ef1e50d13cd4e6 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b74937/b74937.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b74937/b74937.il @@ -7,7 +7,8 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly ILGEN_0x845850e7.exe {} +.assembly ILGEN_0x845850e7 {} +.assembly extern xunit.core {} .class ILGEN_0x845850e7 { .method static float64 Method_0x498875e6(int64 Arg_0x0, float32 Arg_0x4) { .maxstack 15 @@ -49,6 +50,9 @@ Branch_0x1: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 15 ldc.i8 0x60def450d87d153c diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b74939/b74939.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b74939/b74939.il index e81a26572adeb5..65ce54cd01f322 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b74939/b74939.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b74939/b74939.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b74939 { } +.assembly extern xunit.core {} .class ILGEN_0xd191b6a { .field static int8 field_0x0 .field static int16[] field_0x4 @@ -48,6 +49,9 @@ ldc.i4 55 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 1 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b75888/b75888.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b75888/b75888.il index 3dd5732c32a3ac..16afc47fe4de37 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b75888/b75888.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b75888/b75888.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b75888 { } +.assembly extern xunit.core {} .class ILGEN_0x981b6a55 { .field static int32 field_0x2 @@ -87,6 +88,9 @@ Branch_0x1: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 1 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b75890/b75890.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b75890/b75890.il index 116fbaabf89c62..3112b6e1b17af1 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b75890/b75890.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b75890/b75890.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b75890 { } +.assembly extern xunit.core {} .class ILGEN_0xc40344d2 { .field static int64[] field_0x0 .field static native int field_0x1 @@ -65,6 +66,9 @@ Branch_0x1: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 17 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b75944/b75944.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b75944/b75944.il index 1c03e8090d1e44..267e2f1fa6dc1a 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b75944/b75944.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b75944/b75944.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b75944 { } +.assembly extern xunit.core {} .class ILGEN_0x32b4c023 { .method static native int Method_0xbc5d3052(int16 Arg_0x0, native int Arg_0x1) { .maxstack 7 @@ -33,6 +34,9 @@ Branch_0x3: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 5 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b75945/b75945.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b75945/b75945.il index a75e2f6a98544f..fcbfa00fdc3b9d 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b75945/b75945.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b75945/b75945.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xb12e836e {} +.assembly extern xunit.core {} .class ILGEN_0xb12e836e { .field static int8 field_0x1 .method static unsigned int16 Method_0x1be573ce() { @@ -21,6 +22,9 @@ ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 9 call unsigned int16 ILGEN_0xb12e836e::Method_0x1be573ce() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b75988/b75988.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b75988/b75988.il index 1d1d1da926a8c9..c49cd9b9c146d2 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b75988/b75988.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b75988/b75988.il @@ -8,11 +8,15 @@ } .assembly extern mscorlib { } .assembly 'ldfld' { } +.assembly extern xunit.core {} .class public auto ansi beforefieldinit Test_b75988 extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals (int64) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b77304/b77304.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b77304/b77304.il index dd76b6fd2d66e5..bdc0c4ed889ec8 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b77304/b77304.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b77304/b77304.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b77304 { } +.assembly extern xunit.core {} .class ILGEN_0x65088b5c { //BEGIN STATIC FIELDS @@ -202,6 +203,9 @@ ldc.i8 44 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 15 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b77806/b77806.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b77806/b77806.il index ff915d498f0896..ae65059525640f 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b77806/b77806.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b77806/b77806.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x14772b62 {} +.assembly extern xunit.core {} .class ILGEN_0x14772b62 { .method static float32 Method_0xc234ea4d(native int Arg_0x0) { .maxstack 15 @@ -37,6 +38,9 @@ End_Orphan_0: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 9 ldc.i4 0xae2b4a1c conv.i diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b77950/b77950.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b77950/b77950.il index e1e8298286093c..5bfd381450fd90 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b77950/b77950.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b77950/b77950.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b77950 { } +.assembly extern xunit.core {} .class ILGEN_0x1bd95bae { //BEGIN STATIC FIELDS @@ -331,6 +332,9 @@ conv.ovf.u2.un ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 17 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b79250/b79250.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b79250/b79250.il index 4d923889d039a8..fd6cb6f1b254db 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b79250/b79250.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b79250/b79250.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b79250 {} +.assembly extern xunit.core {} .class ILGEN_0xdea951c0 { //BEGIN STATIC FIELDS @@ -1529,6 +1530,9 @@ ldc.r8 4.4 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 19 .locals (int32) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80043/b80043.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80043/b80043.il index 4442a66eb8fddc..8aa21a25853975 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80043/b80043.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80043/b80043.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b80043 { } +.assembly extern xunit.core {} .class ILGEN_0x7a14cd08 { .field static unsigned int32 field_0x0 .method static float64 Method_0xe36037f1(unsigned int16 Arg_0x0, int32 Arg_0x1, int16 Arg_0x2, float32 Arg_0x3, float32 Arg_0x4) { @@ -29,6 +30,9 @@ End_Orphan_8: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 11 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80824/b80824.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80824/b80824.il index 256f8610bcf28d..eaf9f18f3095b3 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80824/b80824.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b80824/b80824.il @@ -10,6 +10,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x8485715d {} +.assembly extern xunit.core {} .class ILGEN_0x8485715d { //BEGIN STATIC FIELDS @@ -54,6 +55,9 @@ conv.ovf.u2 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 27 ldc.i4 0x37232c8a conv.i diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b82160/b82160.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b82160/b82160.il index 0eeaaf2f79b108..5becfd7a73ab29 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b82160/b82160.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b82160/b82160.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xb45a7d8a {} +.assembly extern xunit.core {} .class ILGEN_0xb45a7d8a { .field static native int field_0x0 .field static unsigned int64 field_0x1 @@ -77,6 +78,9 @@ cgt.un ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 1 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b82247/b82247.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b82247/b82247.il index c6eb0703348711..dd411d55c75b4d 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b82247/b82247.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b82247/b82247.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x8259d717 {} +.assembly extern xunit.core {} .class ILGEN_0x8259d717 { .field static unsigned int32[] field_0x0 @@ -259,6 +260,9 @@ ceq ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 1 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b82249/b82249.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b82249/b82249.il index 89510e4689c5dc..3baf5427c0228b 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b82249/b82249.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b82249/b82249.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xf9a34ac1 {} +.assembly extern xunit.core {} .class ILGEN_0xf9a34ac1 { //BEGIN STATIC FIELDS @@ -172,6 +173,9 @@ add ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 5 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b82715/b82715.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b82715/b82715.il index f420379173149c..7bbaedd109c90a 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b82715/b82715.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b82715/b82715.il @@ -9,6 +9,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x3ab555a7 {} +.assembly extern xunit.core {} .class ILGEN_0x3ab555a7 { //BEGIN STATIC FIELDS @@ -119,6 +120,9 @@ ldc.i4 55 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 9 ldc.i4 0xdb4fdfdd diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b84909/b84909.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b84909/b84909.il index 67c6c40258f404..9e6113b86e4f02 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b84909/b84909.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b84909/b84909.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x9e05cbcc {} +.assembly extern xunit.core {} .class ILGEN_0x9e05cbcc { .field static native int field_0x5 .method static unsigned int8 Method_0xa3eeac4e(unsigned int64 Arg_0x0, unsigned int16 Arg_0x1, int16 Arg_0x2, int8 Arg_0x3, float32 Arg_0x4, unsigned int32 Arg_0x5, float32 Arg_0x6, int32 Arg_0x7) { @@ -38,6 +39,9 @@ pop ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 17 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b84916/b84916.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b84916/b84916.il index 0df9a5437eb84a..69bb360cabdb59 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b84916/b84916.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b84916/b84916.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xcfefefe5 {} +.assembly extern xunit.core {} .class ILGEN_0xcfefefe5 { //BEGIN STATIC FIELDS @@ -176,6 +177,9 @@ conv.i8 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 27 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b84971/b84971.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b84971/b84971.il index ad61548fde5f24..0351398c59588c 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b84971/b84971.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b84971/b84971.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly EHTest {} +.assembly extern xunit.core {} .class public EHTest { .method public static void f1() cil managed @@ -58,6 +59,9 @@ leave OUT .method public static int32 Main() cil managed { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b85316/b85316.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b85316/b85316.il index 8f3a8a6d42cc0a..528b1207ad5dd1 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b85316/b85316.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b85316/b85316.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly n.exe{} +.assembly n{} .class public _n { .method public static int32 main(class [mscorlib]System.String[]) { .entrypoint diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b85477/b85477.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b85477/b85477.il index 639e5aa97d7dee..29b032dcb87551 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b85477/b85477.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b85477/b85477.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly test {} +.assembly extern xunit.core {} .class public test { .method public static void f1() cil managed @@ -45,6 +46,9 @@ leave OUT .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b86139/b86139.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b86139/b86139.il index 0a7d067bcfd99e..2a33985c479bc5 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b86139/b86139.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b86139/b86139.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x9e05cbcc {} +.assembly extern xunit.core {} .class ILGEN_0x9e05cbcc { .field static native int field_0x5 .method static unsigned int8 Method_0xa3eeac4e(unsigned int64 Arg_0x0, unsigned int16 Arg_0x1, int16 Arg_0x2, int8 Arg_0x3, float32 Arg_0x4, unsigned int32 Arg_0x5, float32 Arg_0x6, int32 Arg_0x7) { @@ -38,6 +39,9 @@ pop ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 17 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b89409/b89409.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b89409/b89409.il index 552d9d5aaff378..5e61faa0fa5ff2 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b89409/b89409.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b89409/b89409.il @@ -10,6 +10,7 @@ .assembly test { } +.assembly extern xunit.core {} .module test.exe // MVID: {A814820F-7F5B-4AEC-98B2-8CA067CCDA19} @@ -53,6 +54,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 23 (0x17) .maxstack 2 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b89546/b89546.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b89546/b89546.il index 0f1c2f6c2d5815..30b6e42f6abf88 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b89546/b89546.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b89546/b89546.il @@ -10,6 +10,7 @@ .assembly test { } +.assembly extern xunit.core {} .module test.exe // MVID: {611FA85E-B08F-4BA6-A5ED-1EFCE48EC6D9} @@ -50,6 +51,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 33 (0x21) .maxstack 2 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b91021/b91021.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b91021/b91021.il index 945830dddec403..b1f68104596cf4 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b91021/b91021.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b91021/b91021.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0x85bc9d9b {} +.assembly extern xunit.core {} .class ILGEN_0x85bc9d9b { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 9 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b91203/b91203.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b91203/b91203.il index 8ad6f5ef6dad1e..9e3cf48e4dc3e0 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b91203/b91203.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b91203/b91203.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x386672e7 {} +.assembly extern xunit.core {} .class ILGEN_0x386672e7 { .field static native int field_0x5 .method static unsigned int8 Method_0x2fe8d57(native int Arg_0x3) { @@ -28,6 +29,9 @@ ldc.i4.8 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 19 ldc.i4 0x6db71d0c conv.i diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b91223/b91223.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b91223/b91223.il index 0c8d0d4b55e5ea..01304b8170900e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b91223/b91223.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b91223/b91223.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x9c0b37ec {} +.assembly extern xunit.core {} .class ILGEN_0x9c0b37ec { .field static unsigned int16[] field_0x0 @@ -604,6 +605,9 @@ conv.u1 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 15 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b91359/b91359.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b91359/b91359.il index ad1193d9eb0072..753c03796f9c8b 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b91359/b91359.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b91359/b91359.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0xbbdad33b {} +.assembly extern xunit.core {} .class ILGEN_0xbbdad33b { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 5 .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b92066/b92066.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b92066/b92066.il index 3e1f84575e88bd..b0782d17eabf89 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b92066/b92066.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b92066/b92066.il @@ -9,6 +9,7 @@ .assembly extern mscorlib {} .assembly extern System {} .assembly EHTest {} +.assembly extern xunit.core {} .class public EHTest { .method public static void f2() cil managed synchronized @@ -88,6 +89,9 @@ .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b92073/b92073.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b92073/b92073.il index b151d26b90ad11..be93ad1834f80f 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b92073/b92073.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b92073/b92073.il @@ -9,6 +9,7 @@ .assembly extern mscorlib {} .assembly extern System {} .assembly EHTest {} +.assembly extern xunit.core {} .class public EHTest { .method public static void f2() cil managed synchronized @@ -79,6 +80,9 @@ .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b92289/b92289.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b92289/b92289.il index fa5dba9c3a380e..2a61879541c20c 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b92289/b92289.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b92289/b92289.il @@ -9,6 +9,7 @@ .assembly extern mscorlib {} .assembly extern System {} .assembly EHTest {} +.assembly extern xunit.core {} .class public EHTest { .method public static void f2() cil managed synchronized @@ -76,6 +77,9 @@ } .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b92736/b92736.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b92736/b92736.il index 589b2c24b510cb..b8eec3a0cbb600 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b92736/b92736.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b92736/b92736.il @@ -7,7 +7,8 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly ILGEN_0x50a9a77.exe {} +.assembly ILGEN_0x50a9a77 {} +.assembly extern xunit.core {} .class ILGEN_0x50a9a77 { .field static unsigned int16 field_0x5 .field static int64 field_0x6 @@ -33,6 +34,9 @@ End_Orphan_5a: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 ldc.i4 0xdab10162 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b93635/b93635.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b93635/b93635.il index fe46ae963948ae..37a3c2aafa7647 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b93635/b93635.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b93635/b93635.il @@ -9,6 +9,7 @@ .assembly extern mscorlib {} .assembly extern System {} .assembly EHTest {} +.assembly extern xunit.core {} .class public EHTest { .method public static void f2() cil managed @@ -68,6 +69,9 @@ .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b94306/b94306.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b94306/b94306.il index d568b10cfe6ddc..a31a5de281267e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b94306/b94306.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b94306/b94306.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly EHTest {} +.assembly extern xunit.core {} .class public EHTest { .method public static void f2() cil managed @@ -101,6 +102,9 @@ .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b98958/b98958.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b98958/b98958.il index 2122bebf1b6033..dea9b0f31dbe4e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b98958/b98958.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b98958/b98958.il @@ -9,6 +9,7 @@ .assembly extern mscorlib {} .assembly extern System {} .assembly EHTest {} +.assembly extern xunit.core {} .class public EHTest { @@ -110,6 +111,9 @@ leave OUT .method public static int32 Main() cil managed { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M15-SP2/b124443/b124443_il.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M15-SP2/b124443/b124443_il.il index a3ed89bb6c4bd9..83e3f9769d3f88 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M15-SP2/b124443/b124443_il.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M15-SP2/b124443/b124443_il.il @@ -10,6 +10,7 @@ .assembly b124443_il {} +.assembly extern xunit.core {} .module b124443_il.exe @@ -581,6 +582,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 397 (0x18d) .maxstack 2 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/params-mixed.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/params-mixed.il index e1e3b9f71ea360..5cb77e6b424507 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/params-mixed.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/params-mixed.il @@ -18,12 +18,16 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .class public auto ansi beforefieldinit Test_params_mixed extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 83 (0x53) .maxstack 5 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/params-none.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/params-none.il index 185e0958a54baa..b9e67543951ceb 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/params-none.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/params-none.il @@ -18,6 +18,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .class public auto ansi beforefieldinit Test_params_none extends [mscorlib]System.Object @@ -55,6 +56,9 @@ .method public hidebysig static int32 Main() cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 78 (0x4e) .maxstack 2 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/params-object.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/params-object.il index 1d3a71be3e3ca6..694890d808688b 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/params-object.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/params-object.il @@ -18,12 +18,16 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .class public auto ansi beforefieldinit Test_params_object extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 74 (0x4a) .maxstack 10 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/params-value.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/params-value.il index 2ee4c6e9c0d27d..4ad29fe6bcdee3 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/params-value.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/params-value.il @@ -19,12 +19,16 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .class public auto ansi beforefieldinit Test_params_value extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 68 (0x44) .maxstack 10 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/params-varargs.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/params-varargs.il index d43ed61022dc57..f08bfc3fa05e4a 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/params-varargs.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/params-varargs.il @@ -18,12 +18,16 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .class public auto ansi beforefieldinit Test_params_varargs extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 161 (0xa1) .maxstack 4 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/static-mixed.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/static-mixed.il index ea3c7703f7bd46..0d69ef184b2065 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/static-mixed.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/static-mixed.il @@ -18,12 +18,16 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .class public auto ansi beforefieldinit Test_static_mixed extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 143 (0x8f) .maxstack 10 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/static-none.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/static-none.il index bd95baf9b4521e..10414baecbdfa4 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/static-none.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/static-none.il @@ -12,12 +12,16 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .class public auto ansi beforefieldinit Test_static_none extends [mscorlib]System.Object { .method public hidebysig static int32 Main(string[] args) cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals init (bool V_0, diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/static-object.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/static-object.il index a3c41ee9675d8f..5056a1709a0b75 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/static-object.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/static-object.il @@ -23,6 +23,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module template.exe // MVID: {01E12E66-85BE-40B5-9C1D-CEDDD038DB2C} .imagebase 0x00400000 @@ -40,6 +41,9 @@ { .method public hidebysig static int32 Main(string[] args) cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 90 (0x5a) .maxstack 3 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/static-ref.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/static-ref.il index d3adadc704dc6d..61b5e000e0d01f 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/static-ref.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-QFE/b151440/static-ref.il @@ -17,12 +17,16 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .class public auto ansi beforefieldinit Test_static_ref extends [mscorlib]System.Object { .method public hidebysig static int32 Main(string[] args) cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 .locals init (int32 V_0, diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b139895/b139895.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b139895/b139895.il index 392ec4cb95b641..f1f3387c5222ae 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b139895/b139895.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b139895/b139895.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x492430 {} +.assembly extern xunit.core {} .class ILGEN_0x4924301 { .method static int32 Method_0x7ec05129() { .maxstack 13 @@ -45,6 +46,9 @@ ldc.i4 44 EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 call int32 ILGEN_0x4924301::Method_0x7ec05129() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b140118/b140118.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b140118/b140118.il index 177aa4da5ea678..a58194653a988b 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b140118/b140118.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b140118/b140118.il @@ -7,7 +7,8 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly ILGEN_0x1c9344b9.exe {} +.assembly ILGEN_0x1c9344b9 {} +.assembly extern xunit.core {} .class ILGEN_0x1c9344b9 { .field static int16[] field_0x0 .method static int32 Method_0xcf54fbcb() { @@ -65,6 +66,9 @@ ldc.i4 55 EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 call int32 ILGEN_0x1c9344b9::Method_0xcf54fbcb() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b143840/b143840.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b143840/b143840.il index 2886acf699d87e..71e168e5288a13 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b143840/b143840.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b143840/b143840.il @@ -8,6 +8,7 @@ .assembly extern legacy library mscorlib { auto } .assembly ExternalException {} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit ExternalClass extends [mscorlib]System.Object { @@ -40,6 +41,9 @@ { .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals init (class [System.Threading.Thread]System.Threading.Thread V_0, diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b147147/samabo.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b147147/samabo.il index fde3f700924029..721dc948d8ea23 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b147147/samabo.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b147147/samabo.il @@ -10,6 +10,7 @@ .assembly samabo { } +.assembly extern xunit.core {} .class public sequential ansi sealed beforefieldinit MyStruct @@ -27,6 +28,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 19 (0x13) .maxstack 2 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b180381/constrained2.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b180381/constrained2.il index e33cb5ecacbf01..03b9bce8ec4e31 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b180381/constrained2.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b180381/constrained2.il @@ -10,6 +10,7 @@ .assembly constrained { } +.assembly extern xunit.core {} .class public auto ansi beforefieldinit Test_constrained2 extends [mscorlib]System.Object { @@ -29,6 +30,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 17 (0x11) .maxstack 8 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b213516/exe-219037.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b213516/exe-219037.il index 72f6b4fb80de83..fc9ea3fdfaccce 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b213516/exe-219037.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b213516/exe-219037.il @@ -16,6 +16,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .class public auto ansi beforefieldinit ClientType extends [mscorlib]System.Object { @@ -31,6 +32,9 @@ .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 100 IL_0000: ldstr "Main..." diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b220968/1.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b220968/1.il index 6a76b2e4f0c446..471953254d285d 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b220968/1.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b220968/1.il @@ -2,9 +2,13 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly ILGEN_0x5c19e96e {} +.assembly extern xunit.core {} .assembly extern mscorlib{auto} .class ILGEN_0x5c19e96e { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b223924/bug2.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b223924/bug2.il index 826eeb385058fe..820a19cdfad141 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b223924/bug2.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b223924/bug2.il @@ -8,6 +8,7 @@ } .assembly ILGEN_0xef3a9aea {} +.assembly extern xunit.core {} .assembly extern mscorlib{auto} .class ILGEN_0xef3a9aea { @@ -38,6 +39,9 @@ ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 27 .try diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b223932/bug3.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b223932/bug3.il index 61d33314a4452a..e94a0f4d0a82a3 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b223932/bug3.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b223932/bug3.il @@ -2,9 +2,13 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly ILGEN_0xb6f84258 {} +.assembly extern xunit.core {} .assembly extern mscorlib{auto} .class ILGEN_0xb6f84258 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 17 ldc.r4 float32(0x7e43bd25) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b223936/bug4.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b223936/bug4.il index 9f8ebbe452a633..7406d83f9ba98b 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b223936/bug4.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-Beta1/b223936/bug4.il @@ -8,6 +8,7 @@ } .assembly ILGEN_0xca498c54 {} +.assembly extern xunit.core {} .assembly extern mscorlib{auto} .class ILGEN_0xca498c54 { .method static unsigned int64 Method_0x570110b9(float64 Arg_0x0, float32 Arg_0x1, unsigned int32 Arg_0x2, int8 Arg_0x3, int8 Arg_0x4, int64 Arg_0x5, unsigned int16 Arg_0x6, int64 Arg_0x7, unsigned int64 Arg_0x8, int8 Arg_0x9, int8 Arg_0xa, int8 Arg_0xb, float32 Arg_0xc, int8 Arg_0xd) { @@ -19,6 +20,9 @@ ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 29 .try diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b00722/b00722.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b00722/b00722.il index 7e751e5f4bea58..a432f1aa4e47a6 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b00722/b00722.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b00722/b00722.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x195e59cd {} +.assembly extern xunit.core {} .class ILGEN_0x195e59cd { .field static int16[] field_0x0 .field static int64 field_0x1 @@ -96,6 +97,9 @@ End_Orphan_20: EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b04319/b04319.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b04319/b04319.il index 80d682eb1a794c..68276e1e6e038e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b04319/b04319.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b04319/b04319.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x2d277f5e{} +.assembly extern xunit.core {} .class ILGEN_0x2d277f5e { .field static unsigned int32[] field_0x0 .field static unsigned int8 field_0x5 @@ -84,6 +85,9 @@ End_Orphan_65: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b06020/b06020.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b06020/b06020.il index fe0849861fc56c..ed648d7923e9e4 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b06020/b06020.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b06020/b06020.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b06020 {} +.assembly extern xunit.core {} .class public auto ansi sealed jb extends [mscorlib]System.Object { @@ -131,6 +132,9 @@ .field static privatescope class x aO$PST0400000B .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 14 (0xe) .maxstack 4 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b07369/b07369.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b07369/b07369.il index 5d68364f3326ca..65a8add7bff6b3 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b07369/b07369.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b07369/b07369.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b07369 {} +.assembly extern xunit.core {} .class ILGEN_0x1c9344b9 { .field static int16[] field_0x0 .method static int32 Method_0xcf54fbcb() { @@ -61,6 +62,9 @@ ldc.i4 55 EOM: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 .try diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b07383/b07383.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b07383/b07383.il index e740d71ae6f3b9..43c90316f95448 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b07383/b07383.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b07383/b07383.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xfe8f9a4a {} +.assembly extern xunit.core {} .class ILGEN_0xfe8f9a4a { .field static unsigned int8 field_0x8 .method static int8 Method_0xe6c0a898() { @@ -24,6 +25,9 @@ ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 1 call int8 ILGEN_0xfe8f9a4a::Method_0xe6c0a898() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b07947/b07947.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b07947/b07947.il index 7c6a5990897bec..08859dc8b0f713 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b07947/b07947.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b07947/b07947.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly b07947 {} +.assembly extern xunit.core {} .class public repro { @@ -53,6 +54,9 @@ .method static int32 Main(class System.String[]) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 .locals init (unsigned int16 i) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b08046/SyncGCHole.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b08046/SyncGCHole.il index d3227ad3765eac..0e4490c7342393 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b08046/SyncGCHole.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b08046/SyncGCHole.il @@ -8,6 +8,7 @@ .assembly extern legacy library mscorlib { auto } .assembly ExternalException {} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit ExternalClass extends [mscorlib]System.Object { @@ -40,6 +41,9 @@ { .method public hidebysig static void Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals init (class [System.Threading.Thread]System.Threading.Thread V_0, diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b13452/b13452.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b13452/b13452.il index edbaf1725b5930..5ab8013829985e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b13452/b13452.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b13452/b13452.il @@ -3,6 +3,7 @@ .assembly extern mscorlib{} .assembly b13452{} +.assembly extern xunit.core {} .module b13452.exe .class public auto ansi beforefieldinit test extends [mscorlib]System.Object @@ -15,6 +16,9 @@ } .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b14617/b14617.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b14617/b14617.il index 4678bcc3b60480..f34ded7f9d8032 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b14617/b14617.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b14617/b14617.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x1b57e965 {} +.assembly extern xunit.core {} .class ILGEN_0x1b57e965 { .field static int8[] field_0x0 .method static float64 Method_0xe5b0e4a3(float64 Arg_0x0) { @@ -39,6 +40,9 @@ End_Orphan_a: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 3 ldc.r8 float64(0xb4e4b4787f7ef458) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b16382/bbFlags.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b16382/bbFlags.il index f85e4d406350d1..aa969b78fa002f 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b16382/bbFlags.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b16382/bbFlags.il @@ -3,6 +3,7 @@ .assembly extern mscorlib {} .assembly extern System {} .assembly bbFlags {} +.assembly extern xunit.core {} .class public bbFlags { .method public static int32 f() cil managed @@ -45,6 +46,9 @@ leave OUT .method public static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .maxstack 5 .entrypoint .try diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b16473/ebdTryEnd.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b16473/ebdTryEnd.il index 1375adcc9a64a6..9a73a4fc637f61 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b16473/ebdTryEnd.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b16473/ebdTryEnd.il @@ -9,6 +9,7 @@ .assembly extern mscorlib {} .assembly extern System {} .assembly EHTest {} +.assembly extern xunit.core {} .class public EHTest { .field private static int32 fld0 @@ -1068,6 +1069,9 @@ ret } .method public static int32 Main() cil managed { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 500 .maxstack 500 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M02/b118260/b118260.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M02/b118260/b118260.il index 916a886b545698..f564130c7e1d5c 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M02/b118260/b118260.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M02/b118260/b118260.il @@ -8,12 +8,16 @@ .ver 4:0:0:0 } .assembly b118260 {} +.assembly extern xunit.core {} .namespace Test { .class public auto ansi Test extends [mscorlib]System.Object { .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint LoadStr: diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M02/b138117/ldsfldainitonlyvt.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M02/b138117/ldsfldainitonlyvt.il index 5d1cdd924e67b8..49fd7c0d7c2ce5 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M02/b138117/ldsfldainitonlyvt.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M02/b138117/ldsfldainitonlyvt.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ldsfldainitonlyvt {} +.assembly extern xunit.core {} .class public sequential ansi sealed beforefieldinit VT extends [mscorlib]System.ValueType { @@ -32,6 +33,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 39 (0x27) .maxstack 2 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b091942/nullref.il b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b091942/nullref.il index d4982ae21fda4c..937f8507b6c0eb 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b091942/nullref.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b091942/nullref.il @@ -14,6 +14,7 @@ .assembly d { } +.assembly extern xunit.core {} .module d.exe .class public explicit ansi beforefieldinit BigClass @@ -49,6 +50,9 @@ .method public hidebysig static int32 Main(string [] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (int32 retValue) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b125091/eh.il b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b125091/eh.il index 0a8d75ac2e65c3..b8cf94ac633c6a 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b125091/eh.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b125091/eh.il @@ -9,6 +9,7 @@ .assembly extern mscorlib {} .assembly extern System {} .assembly EHTest {} +.assembly extern xunit.core {} .class public EHTest { .field private static int64 fld0 @@ -135,6 +136,9 @@ ret .method public static int32 Main() cil managed { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 500 .maxstack 500 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b309555/x86-test-1084346006.il b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b309555/x86-test-1084346006.il index 29aa197e4a3dea..e0d1d66a29a272 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b309555/x86-test-1084346006.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b309555/x86-test-1084346006.il @@ -10,6 +10,7 @@ } .assembly ILGEN_0x1a02e09e {} +.assembly extern xunit.core {} .class ILGEN_0x1a02e09e { //BEGIN STATIC FIELDS @@ -45,6 +46,9 @@ stloc local_0xc ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b323557/1087985874.il b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b323557/1087985874.il index e945624689fa3c..de48ab4f9b25ed 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b323557/1087985874.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b323557/1087985874.il @@ -8,6 +8,7 @@ } .assembly Test1 {} +.assembly extern xunit.core {} .assembly extern mscorlib{auto} .class FullProof { @@ -40,6 +41,9 @@ IL_57: shr.un // 2 1 0 0 1 .method public static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 3 ldc.r4 1 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b359564/1093488365.il b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b359564/1093488365.il index 93f70f954cff96..08e5cff28aa685 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b359564/1093488365.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b359564/1093488365.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly Test1 {} +.assembly extern xunit.core {} .assembly extern System.Console { @@ -22,6 +23,9 @@ .method public static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 3 .try diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b374944/helper.il b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b374944/helper.il index 570bcc4e651312..17f19f4da7dca8 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b374944/helper.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b374944/helper.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly helper {} +.assembly extern xunit.core {} .module helper.exe @@ -26,6 +27,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (native int v_0, int32 v_1) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b409617/b409617.il b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b409617/b409617.il index 5061425f39fe53..09a43ba6888caf 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b409617/b409617.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b409617/b409617.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly asm1{} +.assembly extern xunit.core {} .data LONG_DATA = int64(0x0000000100000002) @@ -72,6 +73,9 @@ .method public static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init(class asm1 obj, int32 i, valuetype S s) .maxstack 8 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b415164/b415164.il b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b415164/b415164.il index 502e2118e0d579..f474d6567dc9de 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b415164/b415164.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b415164/b415164.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ctor_null1 { } +.assembly extern xunit.core {} .class private auto ansi sealed MyDelegate extends [mscorlib]System.MulticastDelegate @@ -38,6 +39,9 @@ } .method public hidebysig static int32 Main(class System.String[] args) il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals init (class MyDelegate V_0) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b426654/b426654.il b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b426654/b426654.il index 3767e1f380dc6f..ac98093b98d134 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b426654/b426654.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b426654/b426654.il @@ -14,6 +14,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module cs1.exe .imagebase 0x00400000 .file alignment 0x00000200 @@ -208,6 +209,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 .locals init (class cs1 V_0, diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b441487/b441487.il b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b441487/b441487.il index de87248f2b100a..f8a9b0380176cf 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b441487/b441487.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b441487/b441487.il @@ -21,6 +21,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module b441487.exe .imagebase 0x00400000 .file alignment 0x00000200 @@ -230,6 +231,9 @@ starg 0 { .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (int32 V_0, diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b471305/b471305.il b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b471305/b471305.il index e9a3484f3860ca..64e4cdc3cda88e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b471305/b471305.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b471305/b471305.il @@ -15,6 +15,7 @@ // This makes JIT to compile the debuggable code. .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 ) } +.assembly extern xunit.core {} .module b471305.exe .class sealed Program @@ -50,6 +51,9 @@ .method static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (int32 V_0) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b487364/b487364.il b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b487364/b487364.il index 361860523622c8..f5667ab24e8d7f 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b487364/b487364.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b487364/b487364.il @@ -9,6 +9,7 @@ .assembly extern mscorlib {} .assembly extern System {} .assembly EHTest {} +.assembly extern xunit.core {} .class public EHTest { .field private static int32 fld0 @@ -668,6 +669,9 @@ ret } .method public static int32 Main() cil managed { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 500 .maxstack 500 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b487372/b487372.il b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b487372/b487372.il index 7b20ee05316e69..6473bdf2f3f1f8 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b487372/b487372.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b487372/b487372.il @@ -9,6 +9,7 @@ .assembly extern mscorlib {} .assembly extern System {} .assembly EHTest {} +.assembly extern xunit.core {} .class public EHTest { .field private static int64 fld0 @@ -335,6 +336,9 @@ ret } .method public static int32 Main() cil managed { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 500 .maxstack 500 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b489329/b489329.il b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b489329/b489329.il index 6010e56eb6ad51..d2993e5759f4b7 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b489329/b489329.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b489329/b489329.il @@ -8,6 +8,7 @@ } .assembly Test1 {} +.assembly extern xunit.core {} .assembly extern mscorlib{auto} .class FullProof { @@ -45,6 +46,9 @@ IL_80: ret // .method public static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 3 call int32 FullProof::Test() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b530694/b530694.il b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b530694/b530694.il index 416254e92d8d40..46a3aeab0981a0 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b530694/b530694.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b530694/b530694.il @@ -9,6 +9,7 @@ .assembly extern mscorlib {} .assembly extern System {} .assembly EHTest {} +.assembly extern xunit.core {} .class public EHTest { .field private static int32 fld0 @@ -1078,6 +1079,9 @@ ret } .method public static int32 Main() cil managed { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 500 .maxstack 500 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b598031/test.il b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b598031/test.il index 52e28b3e68e916..9b19f17c1f93a5 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b598031/test.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b598031/test.il @@ -9,6 +9,7 @@ .ver 4:0:0:0 } .assembly test {} +.assembly extern xunit.core {} .module test.exe .class private auto ansi beforefieldinit Program @@ -55,6 +56,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 46 (0x2e) .maxstack 1 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b598031/test2.il b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b598031/test2.il index 84ac650edddafb..83bad4964b2b8c 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b598031/test2.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-RTM/b598031/test2.il @@ -9,6 +9,7 @@ .ver 4:0:0:0 } .assembly switchdefaultonly1 {} +.assembly extern xunit.core {} .module switchdefaultonly3_il_d.exe .class private auto ansi beforefieldinit switchdefaultonly1 @@ -17,6 +18,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 44 (0x2c) .maxstack 2 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/dev10/b404051/b404051.il b/src/tests/JIT/Regression/CLR-x86-JIT/dev10/b404051/b404051.il index e7cb94220070c7..86ac4f3ad09662 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/dev10/b404051/b404051.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/dev10/b404051/b404051.il @@ -17,6 +17,7 @@ .assembly b404051 { } +.assembly extern xunit.core {} .class private auto ansi beforefieldinit BadHandles @@ -25,6 +26,9 @@ .field private static object Pass .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 IL_0000: newobj instance void [mscorlib]System.Object::.ctor() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/dev10/b440158/b440158.il b/src/tests/JIT/Regression/CLR-x86-JIT/dev10/b440158/b440158.il index d19f9cf1df8e1e..5d33c52b436440 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/dev10/b440158/b440158.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/dev10/b440158/b440158.il @@ -17,6 +17,7 @@ .hash algorithm 0x00008004 .ver 2:0:30414:3 } +.assembly extern xunit.core {} .module Contains.exe .imagebase 0x00400000 .file alignment 0x00000200 @@ -287,6 +288,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 .locals init (class Driver`2,class RefX1`1> V_0) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/dev10/b464149/b464149.il b/src/tests/JIT/Regression/CLR-x86-JIT/dev10/b464149/b464149.il index deecd5eb196f1f..68e878442e58e0 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/dev10/b464149/b464149.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/dev10/b464149/b464149.il @@ -17,6 +17,7 @@ { .ver 0:0:0:0 } +.assembly extern xunit.core {} .module repro.exe // =============== CLASS MEMBERS DECLARATION =================== @@ -86,6 +87,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 288 (0x120) .maxstack 10 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/DDB/B168384/LdfldaHack.il b/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/DDB/B168384/LdfldaHack.il index f7886af0b2df99..0bf104bed6d53c 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/DDB/B168384/LdfldaHack.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/DDB/B168384/LdfldaHack.il @@ -25,6 +25,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module LdfldaHack.exe // MVID: {61DBCACC-D02C-4722-BA4E-7206DE5BD656} .imagebase 0x00400000 @@ -1613,6 +1614,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 23 (0x17) .maxstack 8 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b170362/b170362.il b/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b170362/b170362.il index 81cc91c8800dad..cbebfaa29cf2ab 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b170362/b170362.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b170362/b170362.il @@ -25,6 +25,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module b170362_new.exe // MVID: {5699A10B-EE3A-4BFF-B847-74894515E3AE} .imagebase 0x00400000 @@ -50,6 +51,9 @@ .field private static uint8 s .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 74 (0x4a) .maxstack 3 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b174294/spill.il b/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b174294/spill.il index 8cdb253753e106..d8547f94cf919c 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b174294/spill.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b174294/spill.il @@ -25,6 +25,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module spill.exe // MVID: {7C50D91F-9C85-49FE-8B5A-900DF6F8E2CD} .imagebase 0x00400000 @@ -53,6 +54,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 44 (0x2c) .maxstack 3 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b175679/b175679.il b/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b175679/b175679.il index d624b772dab260..86e3808e5d55db 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b175679/b175679.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b175679/b175679.il @@ -16,12 +16,16 @@ .assembly nan { } +.assembly extern xunit.core {} .class private abstract auto ansi sealed beforefieldinit NaN extends [mscorlib]System.Object { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 .locals init (float64 nnan, float64 pnan, float64 pzero, float64 nzero, int32 returnValue) diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b176032/b176032.il b/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b176032/b176032.il index b050bedaa65634..a4c886c99a2e60 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b176032/b176032.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/DDB/b176032/b176032.il @@ -23,6 +23,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module FastPropertyAccessor.exe // MVID: {67428BBB-6A8A-45FA-BAF9-F8CACEC55247} .imagebase 0x00400000 @@ -75,6 +76,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 41 (0x29) .maxstack 3 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/b173313/b173313.il b/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/b173313/b173313.il index a53e5694033bd9..f40b4bd8833809 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/b173313/b173313.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/b173313/b173313.il @@ -17,6 +17,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module a.exe // MVID: {36FD279A-AF08-423E-A45C-4915EAB873CD} .imagebase 0x00400000 @@ -86,6 +87,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 10 (0xa) .maxstack 8 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/b193264/b193264.il b/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/b193264/b193264.il index 3530016b411c35..872ee21d0979f7 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/b193264/b193264.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/b193264/b193264.il @@ -25,6 +25,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module pinned.exe // MVID: {D6DF3AAB-BC31-4E88-8EC0-2E585288A52B} .imagebase 0x00400000 @@ -65,6 +66,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 76 (0x4c) .maxstack 2 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/b609988/Desktop/b609988.il b/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/b609988/Desktop/b609988.il index c508bb6d48f3ca..6068a383ce383b 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/b609988/Desktop/b609988.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/b609988/Desktop/b609988.il @@ -24,6 +24,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module ddb609988.exe .imagebase 0x00400000 .file alignment 0x00000200 @@ -1225,6 +1226,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 IL_0000: call void Program::Test1() diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/b609988/b609988.il b/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/b609988/b609988.il index b12bd001306663..c6f7ec4d68b98a 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/b609988/b609988.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/v2.1/b609988/b609988.il @@ -23,6 +23,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module ddb609988.exe .imagebase 0x00400000 .file alignment 0x00000200 @@ -1224,6 +1225,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 IL_0000: call void Program::Test1() diff --git a/src/tests/JIT/Regression/Dev11/Dev11_468598/Test_HndIndex_10_Reordered.il b/src/tests/JIT/Regression/Dev11/Dev11_468598/Test_HndIndex_10_Reordered.il index d87aea92804233..7f57ee0c0e857e 100644 --- a/src/tests/JIT/Regression/Dev11/Dev11_468598/Test_HndIndex_10_Reordered.il +++ b/src/tests/JIT/Regression/Dev11/Dev11_468598/Test_HndIndex_10_Reordered.il @@ -21,6 +21,7 @@ .custom instance void [mscorlib]System.Security.SecurityTransparentAttribute::.ctor() = ( 01 00 00 00 ) .ver 0:0:0:0 } +.assembly extern xunit.core {} .module Test_HndIndex_10_Reordered.exe // MVID: {68AEE7ED-2AC8-4330-9EC7-4EBFD6BD74E0} .imagebase 0x00400000 @@ -39,6 +40,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 106 (0x6a) .maxstack 8 diff --git a/src/tests/JIT/Regression/Dev11/Dev11_b473131/b473131.il b/src/tests/JIT/Regression/Dev11/Dev11_b473131/b473131.il index e4231e5af5f8a2..d1fb497458cba0 100644 --- a/src/tests/JIT/Regression/Dev11/Dev11_b473131/b473131.il +++ b/src/tests/JIT/Regression/Dev11/Dev11_b473131/b473131.il @@ -25,6 +25,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module t.exe // MVID: {0BE09AE7-5603-4318-A13B-9A8950F8ED14} .imagebase 0x00400000 @@ -65,6 +66,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 16 (0x10) .maxstack 1 diff --git a/src/tests/JIT/Regression/Dev11/Dev11_b473131/b473131_byte.il b/src/tests/JIT/Regression/Dev11/Dev11_b473131/b473131_byte.il index 1fbf5a0d2f8e8d..609747203aa837 100644 --- a/src/tests/JIT/Regression/Dev11/Dev11_b473131/b473131_byte.il +++ b/src/tests/JIT/Regression/Dev11/Dev11_b473131/b473131_byte.il @@ -274,6 +274,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module b473131_byte.exe // MVID: {93C4C3CC-5A75-464C-A0F3-61562010094F} .imagebase 0x00400000 @@ -320,6 +321,9 @@ int32 Main() cil managed // SIG: 00 00 01 { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Method begins at RVA 0x2064 // Code size 11 (0xb) diff --git a/src/tests/JIT/Regression/Dev11/Dev11_b473131/b473131_fld.il b/src/tests/JIT/Regression/Dev11/Dev11_b473131/b473131_fld.il index 37afd96f5b02e0..1eeb6391a168bb 100644 --- a/src/tests/JIT/Regression/Dev11/Dev11_b473131/b473131_fld.il +++ b/src/tests/JIT/Regression/Dev11/Dev11_b473131/b473131_fld.il @@ -273,6 +273,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module b473131_byte.exe // MVID: {93C4C3CC-5A75-464C-A0F3-61562010094F} .imagebase 0x00400000 @@ -319,6 +320,9 @@ int32 Main() cil managed // SIG: 00 00 01 { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Method begins at RVA 0x2064 // Code size 11 (0xb) diff --git a/src/tests/JIT/Regression/Dev11/Dev11_b473131/b473131_intptr.il b/src/tests/JIT/Regression/Dev11/Dev11_b473131/b473131_intptr.il index a985aac1e9c24c..119f1e5ef4cb50 100644 --- a/src/tests/JIT/Regression/Dev11/Dev11_b473131/b473131_intptr.il +++ b/src/tests/JIT/Regression/Dev11/Dev11_b473131/b473131_intptr.il @@ -273,6 +273,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module b473131_byte.exe // MVID: {93C4C3CC-5A75-464C-A0F3-61562010094F} .imagebase 0x00400000 @@ -319,6 +320,9 @@ int32 Main() cil managed // SIG: 00 00 01 { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Method begins at RVA 0x2064 // Code size 11 (0xb) diff --git a/src/tests/JIT/Regression/Dev11/Dev11_b473131/b473131_struct.il b/src/tests/JIT/Regression/Dev11/Dev11_b473131/b473131_struct.il index a306c1a573d532..632e063df8264b 100644 --- a/src/tests/JIT/Regression/Dev11/Dev11_b473131/b473131_struct.il +++ b/src/tests/JIT/Regression/Dev11/Dev11_b473131/b473131_struct.il @@ -272,6 +272,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module b473131_struct.exe // MVID: {A0B36922-A9AF-463E-9F32-9FBF144F14C7} .imagebase 0x00400000 @@ -319,6 +320,9 @@ ldind.u1 int32 Main() cil managed // SIG: 00 00 01 { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Method begins at RVA 0x2070 // Code size 25 (0x19) diff --git a/src/tests/JIT/Regression/Dev11/DevDiv2_11321/DevDiv2_11321.il b/src/tests/JIT/Regression/Dev11/DevDiv2_11321/DevDiv2_11321.il index 06419d9290aa0b..4c3ddbf3fe3f72 100644 --- a/src/tests/JIT/Regression/Dev11/DevDiv2_11321/DevDiv2_11321.il +++ b/src/tests/JIT/Regression/Dev11/DevDiv2_11321/DevDiv2_11321.il @@ -12,11 +12,15 @@ .hash algorithm 0x00008004 .ver 1:0:0:0 } +.assembly extern xunit.core {} .class private auto ansi beforefieldinit CrashTest.Program { .method assembly hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 diff --git a/src/tests/JIT/Regression/Dev11/External/Dev11_14131/VectorForwarder.il b/src/tests/JIT/Regression/Dev11/External/Dev11_14131/VectorForwarder.il index ecd9be31b2a3a9..fc347fb770c259 100644 --- a/src/tests/JIT/Regression/Dev11/External/Dev11_14131/VectorForwarder.il +++ b/src/tests/JIT/Regression/Dev11/External/Dev11_14131/VectorForwarder.il @@ -29,6 +29,7 @@ .hash algorithm 0x00008004 .ver 4:0:30513:0 } +.assembly extern xunit.core {} .module VectorForwarder.exe // MVID: {040B5898-B7A8-44DE-A50F-3465CCB7870F} .imagebase 0x00400000 @@ -245,6 +246,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 72 (0x48) .maxstack 3 diff --git a/src/tests/JIT/Regression/Dev11/External/Dev11_90434/UseUnalignedDouble.il b/src/tests/JIT/Regression/Dev11/External/Dev11_90434/UseUnalignedDouble.il index f2342363f8f4df..89c5ebca299c72 100644 --- a/src/tests/JIT/Regression/Dev11/External/Dev11_90434/UseUnalignedDouble.il +++ b/src/tests/JIT/Regression/Dev11/External/Dev11_90434/UseUnalignedDouble.il @@ -19,6 +19,7 @@ .hash algorithm 0x00008004 .ver 4:0:30319:16507 } +.assembly extern xunit.core {} .module UnalignedDouble1.exe .imagebase 0x00400000 @@ -127,6 +128,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 6 (0x6) .maxstack 8 diff --git a/src/tests/JIT/Regression/Dev11/External/dev11_13748/ReflectOnField.il b/src/tests/JIT/Regression/Dev11/External/dev11_13748/ReflectOnField.il index c58bfa64b6a2d6..deada66f2e6315 100644 --- a/src/tests/JIT/Regression/Dev11/External/dev11_13748/ReflectOnField.il +++ b/src/tests/JIT/Regression/Dev11/External/dev11_13748/ReflectOnField.il @@ -25,6 +25,7 @@ .hash algorithm 0x00008004 .ver 4:0:30513:0 } +.assembly extern xunit.core {} .module ReflectOnField.exe .imagebase 0x00400000 .file alignment 0x00000200 @@ -45,6 +46,9 @@ { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals init (class [mscorlib]System.Reflection.FieldInfo[] V_0) diff --git a/src/tests/JIT/Regression/Dev11/dev10_865840/dev10_865840.il b/src/tests/JIT/Regression/Dev11/dev10_865840/dev10_865840.il index d7a7d3d0a14b8c..d5e46b3c7b632b 100644 --- a/src/tests/JIT/Regression/Dev11/dev10_865840/dev10_865840.il +++ b/src/tests/JIT/Regression/Dev11/dev10_865840/dev10_865840.il @@ -16,6 +16,7 @@ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) .ver 0:0:0:0 } +.assembly extern xunit.core {} .module dev10_865840.exe .imagebase 0x00400000 .file alignment 0x00000200 @@ -37,6 +38,9 @@ .field private static class [mscorlib]System.Security.Permissions.SecurityPermission _unmanagedCodePermission .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 IL_0000: call void DifRepro.Program::Test() diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_150586/DevDiv_150586.il b/src/tests/JIT/Regression/JitBlue/DevDiv_150586/DevDiv_150586.il index 6db52be8cb881b..d4e9d3937188ae 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_150586/DevDiv_150586.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_150586/DevDiv_150586.il @@ -19,6 +19,7 @@ .assembly DevDiv_150586 { } +.assembly extern xunit.core {} .class private auto ansi beforefieldinit Bug.Program @@ -66,6 +67,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 39 (0x27) .maxstack 1 diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_205323/starg0.il b/src/tests/JIT/Regression/JitBlue/DevDiv_205323/starg0.il index d363fa06d5d03d..6163832fb25700 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_205323/starg0.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_205323/starg0.il @@ -6,6 +6,7 @@ .assembly extern mscorlib {} .assembly starg0 {} +.assembly extern xunit.core {} .module starg0.exe .class public F @@ -36,6 +37,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint ldc.i4 -100 newobj instance void F::.ctor(int32) diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_206786/handleMath.il b/src/tests/JIT/Regression/JitBlue/DevDiv_206786/handleMath.il index f7d841d88401b1..293573ddac3920 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_206786/handleMath.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_206786/handleMath.il @@ -6,6 +6,7 @@ .assembly extern mscorlib {} .assembly handleMath {} +.assembly extern xunit.core {} .module handleMath.exe .class public F @@ -52,6 +53,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint ldc.i4 -100 newobj instance void F::.ctor(int32) diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_255263/DevDiv_255263.il b/src/tests/JIT/Regression/JitBlue/DevDiv_255263/DevDiv_255263.il index 414aaf47ad0178..f60c4ee7e42771 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_255263/DevDiv_255263.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_255263/DevDiv_255263.il @@ -7,7 +7,8 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly initblk.exe{} +.assembly 'initblk'{} +.assembly extern xunit.core {} .class public sealed Foo extends [mscorlib]System.ValueType @@ -30,6 +31,9 @@ //------------------------- .method static int32 Main(class [mscorlib]System.String[]) { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 10 .locals init (class [mscorlib]System.Random V_0, diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_278369/DevDiv_278369.il b/src/tests/JIT/Regression/JitBlue/DevDiv_278369/DevDiv_278369.il index c2b492cfaeb48d..5c9d3f0145233c 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_278369/DevDiv_278369.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_278369/DevDiv_278369.il @@ -13,6 +13,7 @@ .assembly extern mscorlib {} .assembly r {} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit C extends [mscorlib]System.Object { @@ -41,6 +42,9 @@ label: .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_278371/DevDiv_278371.il b/src/tests/JIT/Regression/JitBlue/DevDiv_278371/DevDiv_278371.il index 53990924e979a6..f002d536c81dad 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_278371/DevDiv_278371.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_278371/DevDiv_278371.il @@ -12,6 +12,7 @@ } .assembly DevDiv_278371 {} +.assembly extern xunit.core {} .class public sequential ansi sealed beforefieldinit S extends [mscorlib]System.ValueType @@ -36,6 +37,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (valuetype S V_0, bool V_1, diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_278372/DevDiv_278372.il b/src/tests/JIT/Regression/JitBlue/DevDiv_278372/DevDiv_278372.il index 2d10e82ec2a769..f787498dc3e545 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_278372/DevDiv_278372.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_278372/DevDiv_278372.il @@ -30,6 +30,7 @@ .assembly DevDiv_278372 { } +.assembly extern xunit.core {} // =============== CLASS MEMBERS DECLARATION =================== @@ -121,6 +122,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 16 (0x10) .maxstack 8 diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_278523/DevDiv_278523_32.il b/src/tests/JIT/Regression/JitBlue/DevDiv_278523/DevDiv_278523_32.il index 9660cf16efb5e5..15f21508fab722 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_278523/DevDiv_278523_32.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_278523/DevDiv_278523_32.il @@ -3,6 +3,7 @@ .assembly extern mscorlib {} .assembly a {} +.assembly extern xunit.core {} .module a.exe // This test originally triggered an assert when computing the value number for a block assignment. In particular, the @@ -60,6 +61,9 @@ .method private static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (int32 V_0) diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_278523/DevDiv_278523_64.il b/src/tests/JIT/Regression/JitBlue/DevDiv_278523/DevDiv_278523_64.il index 7f86d6f6a17ab8..45d97a640962fd 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_278523/DevDiv_278523_64.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_278523/DevDiv_278523_64.il @@ -3,6 +3,7 @@ .assembly extern mscorlib {} .assembly a {} +.assembly extern xunit.core {} .module a.exe // This test originally triggered an assert when computing the value number for a block assignment. In particular, the @@ -62,6 +63,9 @@ .method private static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (int32 V_0) diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_279396/DevDiv_279396.il b/src/tests/JIT/Regression/JitBlue/DevDiv_279396/DevDiv_279396.il index 2dfaf0e29d0286..dc9eda4dc3d706 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_279396/DevDiv_279396.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_279396/DevDiv_279396.il @@ -3,6 +3,7 @@ .assembly extern mscorlib {} .assembly DevDiv_279396 {} +.assembly extern xunit.core {} .module DevDiv_279396.exe // This test originally triggered an assertion in the emitter that ensured that no lclVar or lclFld access exceeded the @@ -20,6 +21,9 @@ .method private static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint ldc.i4 100 diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_279829/DevDiv_279829.il b/src/tests/JIT/Regression/JitBlue/DevDiv_279829/DevDiv_279829.il index 16fadf9e150870..effd277d54f6ab 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_279829/DevDiv_279829.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_279829/DevDiv_279829.il @@ -3,7 +3,8 @@ .assembly extern mscorlib {} -.assembly DevDiv_279829.exe {} +.assembly DevDiv_279829 {} +.assembly extern xunit.core {} .class public Test_DevDiv_279829 { @@ -25,6 +26,9 @@ .method private static int32 Main(class [mscorlib]System.String[]) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_359733/DevDiv_359733.il b/src/tests/JIT/Regression/JitBlue/DevDiv_359733/DevDiv_359733.il index 41e77dbef844b0..ec674fe77ed4b9 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_359733/DevDiv_359733.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_359733/DevDiv_359733.il @@ -10,6 +10,7 @@ .assembly extern mscorlib {} .assembly DevDiv_1359733 {} +.assembly extern xunit.core {} .class private C extends [mscorlib]System.Object { @@ -40,6 +41,9 @@ .method private static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_359734/DevDiv_359734.il b/src/tests/JIT/Regression/JitBlue/DevDiv_359734/DevDiv_359734.il index 921936b0237e6f..9dd923a452f9b8 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_359734/DevDiv_359734.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_359734/DevDiv_359734.il @@ -14,6 +14,7 @@ .assembly extern mscorlib{} .assembly ILGEN_MODULE{} +.assembly extern xunit.core {} .class ILGEN_CLASS { .method static char ILGEN_METHOD(bool, char, int16, int32) @@ -93,6 +94,9 @@ .method static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_359737/DevDiv_359737.il b/src/tests/JIT/Regression/JitBlue/DevDiv_359737/DevDiv_359737.il index c97cb94ffe68b9..0b662883d07ac3 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_359737/DevDiv_359737.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_359737/DevDiv_359737.il @@ -3,6 +3,7 @@ .assembly extern mscorlib {} .assembly DevDiv_359737 {} +.assembly extern xunit.core {} // This test originally repro'd a bug in morph that transformed modulus by a constant into division and subtraction // while re-morphing as part of CSE. @@ -20,6 +21,9 @@ .method static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_362706/DevDiv_362706.il b/src/tests/JIT/Regression/JitBlue/DevDiv_362706/DevDiv_362706.il index a5b7a6dbb6bad3..648ed5e7be1b8c 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_362706/DevDiv_362706.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_362706/DevDiv_362706.il @@ -2,6 +2,7 @@ // ProcessName - 'ILGEN' .assembly extern mscorlib{} .assembly DevDiv_362706{} +.assembly extern xunit.core {} .class C extends [mscorlib]System.Object { .method static unsigned int64 M(float32, int32) cil managed noinlining @@ -138,6 +139,9 @@ IL_011a: .method static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_367099/DevDiv_367099.il b/src/tests/JIT/Regression/JitBlue/DevDiv_367099/DevDiv_367099.il index 358d9f0f1d4181..06e58888b0d079 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_367099/DevDiv_367099.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_367099/DevDiv_367099.il @@ -4,12 +4,16 @@ .assembly extern legacy library mscorlib {} .assembly devdiv_367099 {} +.assembly extern xunit.core {} .class public auto ansi beforefieldinit P extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 14 (0xe) .maxstack 1 diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_370233/DevDiv_370233.il b/src/tests/JIT/Regression/JitBlue/DevDiv_370233/DevDiv_370233.il index 3da4b639538001..6289519c8465cc 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_370233/DevDiv_370233.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_370233/DevDiv_370233.il @@ -1,5 +1,6 @@ .assembly extern mscorlib{} .assembly DevDiv_370233{} +.assembly extern xunit.core {} .class C extends [mscorlib]System.Object { .method static unsigned int32 M(bool, bool) @@ -112,6 +113,9 @@ .method static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_377155/DevDiv_377155.il b/src/tests/JIT/Regression/JitBlue/DevDiv_377155/DevDiv_377155.il index 4c1ab4a125602a..4fbea27c3892c3 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_377155/DevDiv_377155.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_377155/DevDiv_377155.il @@ -1,6 +1,7 @@ // ProcessName - 'ILGEN' .assembly extern mscorlib{} .assembly DevDiv_377155{} +.assembly extern xunit.core {} .class C extends [mscorlib]System.Object { .method static float32 M() cil managed noinlining @@ -52,6 +53,9 @@ IL_0052: .method static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_397793/DevDiv_397793.il b/src/tests/JIT/Regression/JitBlue/DevDiv_397793/DevDiv_397793.il index 6965aa2823b28a..325d776513e8e4 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_397793/DevDiv_397793.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_397793/DevDiv_397793.il @@ -3,6 +3,7 @@ .assembly extern mscorlib{} .assembly ILGEN_MODULE{} +.assembly extern xunit.core {} // This test originally failed compilation during CSE due to value numbers that were discarded during remorphing. // The arguments to and return value from `ILGEN_METHOD` are not meaningful; it is enough that this function @@ -120,6 +121,9 @@ .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_405852/DevDiv_405852.il b/src/tests/JIT/Regression/JitBlue/DevDiv_405852/DevDiv_405852.il index 02c11869bd3622..baf22dae93edd5 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_405852/DevDiv_405852.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_405852/DevDiv_405852.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly rem_r4.exe{} +.assembly rem_r4{} .class public _rem { //-- diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_406156/DevDiv_406156.il b/src/tests/JIT/Regression/JitBlue/DevDiv_406156/DevDiv_406156.il index 861f260f0219e1..098c7f8b300ced 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_406156/DevDiv_406156.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_406156/DevDiv_406156.il @@ -3,6 +3,7 @@ .assembly extern mscorlib{} .assembly ILGEN_MODULE{} +.assembly extern xunit.core {} .class ILGEN_CLASS { @@ -104,6 +105,9 @@ .method static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try @@ -142,6 +146,13 @@ // ProcessName - 'ILGEN' .assembly extern mscorlib{} .assembly ILGEN_MODULE{} +.assembly extern xunit.core +{ + .publickeytoken = ( + 8d 05 b1 bb 7a 6f db 6c + ) + .ver 2:4:2:0 +} .class ILGEN_CLASS { } diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_406158/DevDiv_406158.il b/src/tests/JIT/Regression/JitBlue/DevDiv_406158/DevDiv_406158.il index 233c05768c766e..fbf7df47382588 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_406158/DevDiv_406158.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_406158/DevDiv_406158.il @@ -3,6 +3,7 @@ .assembly extern mscorlib{} .assembly ILGEN_MODULE{} +.assembly extern xunit.core {} .class ILGEN_CLASS { .method static unsigned int8 ILGEN_METHOD(int32) @@ -26,6 +27,9 @@ .method static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_406160/DevDiv_406160.il b/src/tests/JIT/Regression/JitBlue/DevDiv_406160/DevDiv_406160.il index d7c7005b5f8a9e..33aaacd4fb9227 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_406160/DevDiv_406160.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_406160/DevDiv_406160.il @@ -16,6 +16,7 @@ .assembly DevDiv_406160 { } +.assembly extern xunit.core {} .class private auto ansi beforefieldinit Bug.Program extends [System.Runtime]System.Object @@ -55,6 +56,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 22 (0x16) .maxstack 8 diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_462269/DevDiv_462269.il b/src/tests/JIT/Regression/JitBlue/DevDiv_462269/DevDiv_462269.il index 77413e4ae608c6..e6550faf2a517e 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_462269/DevDiv_462269.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_462269/DevDiv_462269.il @@ -3,6 +3,7 @@ .assembly extern mscorlib{} .assembly ILGEN_MODULE{} +.assembly extern xunit.core {} .class ILGEN_CLASS { .method static int64 ILGEN_METHOD(unsigned int32, float32, unsigned int8, char, int64, float64) @@ -115,6 +116,9 @@ .method static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_462274/DevDiv_462274.il b/src/tests/JIT/Regression/JitBlue/DevDiv_462274/DevDiv_462274.il index d5c603c23fcd6b..c7b6702ef159e1 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_462274/DevDiv_462274.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_462274/DevDiv_462274.il @@ -3,6 +3,7 @@ .assembly extern mscorlib{} .assembly ILGEN_MODULE{} +.assembly extern xunit.core {} .class ILGEN_CLASS { .method static int64 ILGEN_METHOD(unsigned int32, float32, unsigned int8, char, int64, float64) @@ -50,6 +51,9 @@ skip: .method static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_471670/DevDiv_471670.il b/src/tests/JIT/Regression/JitBlue/DevDiv_471670/DevDiv_471670.il index e35405618f10fc..62d82cac58a9bc 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_471670/DevDiv_471670.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_471670/DevDiv_471670.il @@ -3,6 +3,7 @@ .assembly extern mscorlib{} .assembly ILGEN_MODULE{} +.assembly extern xunit.core {} .class ILGEN_CLASS { .method static bool ILGEN_METHOD(float64, char, unsigned int32) @@ -83,6 +84,9 @@ .method static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_487699/DevDiv_487699.il b/src/tests/JIT/Regression/JitBlue/DevDiv_487699/DevDiv_487699.il index 4b8da8bf2d4bfc..909acd85586503 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_487699/DevDiv_487699.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_487699/DevDiv_487699.il @@ -3,6 +3,7 @@ .assembly extern mscorlib {} .assembly a {} +.assembly extern xunit.core {} .module a.exe // This test originally triggered an error, that we do not reload shift index, if it was spilled to rcx. @@ -107,6 +108,9 @@ .method private static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_487701/DevDiv_487701.il b/src/tests/JIT/Regression/JitBlue/DevDiv_487701/DevDiv_487701.il index d45ec7601fc4a0..d434791ac747eb 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_487701/DevDiv_487701.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_487701/DevDiv_487701.il @@ -3,6 +3,7 @@ .assembly extern mscorlib {} .assembly ILGEN_MODULE {} +.assembly extern xunit.core {} .class ILGEN_CLASS { @@ -92,6 +93,9 @@ IL_0055: .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_487702/DevDiv_487702.il b/src/tests/JIT/Regression/JitBlue/DevDiv_487702/DevDiv_487702.il index 60f15592408488..ff069bc3c4c89a 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_487702/DevDiv_487702.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_487702/DevDiv_487702.il @@ -3,6 +3,7 @@ .assembly extern mscorlib {} .assembly ILGEN_MODULE {} +.assembly extern xunit.core {} .class ILGEN_CLASS { @@ -90,6 +91,9 @@ IL_005d: } .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_487703/DevDiv_487703.il b/src/tests/JIT/Regression/JitBlue/DevDiv_487703/DevDiv_487703.il index 5484884ebc3143..2d00052870fc56 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_487703/DevDiv_487703.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_487703/DevDiv_487703.il @@ -3,6 +3,7 @@ .assembly extern mscorlib {} .assembly ILGEN_MODULE {} +.assembly extern xunit.core {} .class ILGEN_CLASS { @@ -74,6 +75,9 @@ IL_00a1: .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_491206/DevDiv_491206.il b/src/tests/JIT/Regression/JitBlue/DevDiv_491206/DevDiv_491206.il index 6f18fc2c0b7f66..74a9c7f50e9813 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_491206/DevDiv_491206.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_491206/DevDiv_491206.il @@ -3,10 +3,11 @@ .assembly extern mscorlib {} .assembly a {} +.assembly extern xunit.core {} .module a.exe // This test originally triggered an assert Extra_flags_on_tree, because fgMorphCast did not reset an asignment flag, when -// its children was optimized in the assertion propogation. +// its children was optimized in the assertion propagation. .class ILGEN_CLASS { @@ -56,9 +57,12 @@ IL_006a: conv.i8 IL_006b: ret } // end of method DoubleToInt64 - + .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint ldc.r8 9.2233720368547758e+018 call int64 ILGEN_CLASS::DoubleToInt64(float64) diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_491211/DevDiv_491211.il b/src/tests/JIT/Regression/JitBlue/DevDiv_491211/DevDiv_491211.il index d4d125cbc40470..9ad78cb54284bf 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_491211/DevDiv_491211.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_491211/DevDiv_491211.il @@ -3,6 +3,7 @@ .assembly extern mscorlib {} .assembly ILGEN_MODULE {} +.assembly extern xunit.core {} .class ILGEN_CLASS { @@ -90,6 +91,9 @@ IL_005c: .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_495792/DevDiv_495792.il b/src/tests/JIT/Regression/JitBlue/DevDiv_495792/DevDiv_495792.il index 9e467ec862fc9c..0038bc763324b0 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_495792/DevDiv_495792.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_495792/DevDiv_495792.il @@ -3,10 +3,11 @@ .assembly extern mscorlib {} .assembly a {} +.assembly extern xunit.core {} .module a.exe // This test originally triggered an assert Extra_flags_on_tree, because fgMorphCast did not reset an asignment flag, when -// its children was optimized in the assertion propogation. +// its children was optimized in the assertion propagation. .class ILGEN_CLASS { @@ -68,7 +69,7 @@ IL_0064: starg 0x0001 IL_0068: neg IL_0069: nop - IL_006a: bgt + IL_006a: bgt IL_0074 IL_006f: ldarg 0x0000 IL_0073: pop @@ -99,11 +100,14 @@ IL_00a9: conv.u4 IL_00aa: div.un IL_00ab: pop - IL_00ac: ret + IL_00ac: ret } - + .method private static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals init ([0] class [mscorlib]System.OverflowException e, @@ -123,7 +127,7 @@ IL_000c: nop IL_000d: leave.s IL_0014 } // end .try - catch [mscorlib]System.OverflowException + catch [mscorlib]System.OverflowException { IL_000f: stloc.0 IL_0010: nop diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_524309/DevDiv_524309.il b/src/tests/JIT/Regression/JitBlue/DevDiv_524309/DevDiv_524309.il index e8f92310c1882c..06e9f48e8275a0 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_524309/DevDiv_524309.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_524309/DevDiv_524309.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime {auto} .assembly DevDiv_524309 {} +.assembly extern xunit.core {} // The test showed problem with x86 long decomposition of unused values, // DecomposeShift did not set unused on the removed shift's children. @@ -57,6 +58,9 @@ .method private static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 39 (0x27) .maxstack 2 diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_524312/DevDiv_524312.il b/src/tests/JIT/Regression/JitBlue/DevDiv_524312/DevDiv_524312.il index d69be2b35abfbc..16ce5ad9450f42 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_524312/DevDiv_524312.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_524312/DevDiv_524312.il @@ -6,11 +6,15 @@ .assembly extern mscorlib{} .assembly ILGEN_MODULE{} +.assembly extern xunit.core {} .class ILGEN_CLASS { .method static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 19 (0x13) .maxstack 8 diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_534476/DevDiv_534476.il b/src/tests/JIT/Regression/JitBlue/DevDiv_534476/DevDiv_534476.il index e6993a7bc12398..159b26cd3ca32d 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_534476/DevDiv_534476.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_534476/DevDiv_534476.il @@ -4,6 +4,7 @@ .assembly extern System.Runtime {auto} .assembly extern System.Console {auto} .assembly DevDiv_534476 {} +.assembly extern xunit.core {} // The test showed a problem with stack level calculations during morph phase // that did not reflect code movements in the later phases. @@ -36,6 +37,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 30 (0x1e) .maxstack 6 diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_541648/DevDiv_541648.il b/src/tests/JIT/Regression/JitBlue/DevDiv_541648/DevDiv_541648.il index 13137fe7d86911..088d0b9c791da6 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_541648/DevDiv_541648.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_541648/DevDiv_541648.il @@ -6,6 +6,7 @@ .assembly extern System.Console { auto } .assembly DevDiv_541648 { } +.assembly extern xunit.core {} // The test originally hit a bug in the handling of an addressing mode (LEA) under a block // store, which must not be contained. This was created because the address used as the source @@ -85,6 +86,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 59 (0x3b) .maxstack 2 diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_544983/DevDiv_544983.il b/src/tests/JIT/Regression/JitBlue/DevDiv_544983/DevDiv_544983.il index cf231b418f6bc2..c7d2f34830f4aa 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_544983/DevDiv_544983.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_544983/DevDiv_544983.il @@ -10,6 +10,7 @@ .assembly extern System.Console { auto } .assembly DevDiv_544983 { } +.assembly extern xunit.core {} .class public auto ansi beforefieldinit DevDiv_544983 extends [System.Runtime]System.Object @@ -76,6 +77,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init ([0] int32 retVal, [1] int32 testResult) diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_544985/DevDiv_544985.il b/src/tests/JIT/Regression/JitBlue/DevDiv_544985/DevDiv_544985.il index 03fc6ce01b5528..e6369159b69c4e 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_544985/DevDiv_544985.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_544985/DevDiv_544985.il @@ -6,6 +6,7 @@ .assembly extern System.Console { auto } .assembly DevDiv_544985 { } +.assembly extern xunit.core {} .class public auto ansi beforefieldinit DevDiv_544985 extends [System.Runtime]System.Object @@ -137,6 +138,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init ([0] int32 retVal, [1] int32 testResult) diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_545497/DevDiv_545497.il b/src/tests/JIT/Regression/JitBlue/DevDiv_545497/DevDiv_545497.il index bb12cc7b336d6e..40b8b7b63d9a5b 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_545497/DevDiv_545497.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_545497/DevDiv_545497.il @@ -6,6 +6,7 @@ .assembly extern System.Runtime { auto } .assembly DevDiv_524309 {} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit DevDiv_545497 extends [System.Runtime]System.Object @@ -66,6 +67,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 31 (0x1f) .maxstack 3 diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_545500/DevDiv_545500.il b/src/tests/JIT/Regression/JitBlue/DevDiv_545500/DevDiv_545500.il index 99f944c17996aa..060e02d8c26118 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_545500/DevDiv_545500.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_545500/DevDiv_545500.il @@ -11,6 +11,7 @@ .assembly extern System.Console { auto } .assembly DevDiv_545500 { } +.assembly extern xunit.core {} .class public auto ansi beforefieldinit DevDiv_545500 extends [System.Runtime]System.Object @@ -130,6 +131,9 @@ L1: ldarg.s 0x1 .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init ([0] int32 retVal, [1] int32 testResult) diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_578214/DevDiv_578214.il b/src/tests/JIT/Regression/JitBlue/DevDiv_578214/DevDiv_578214.il index 325fa74ae686b6..980de2535b8226 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_578214/DevDiv_578214.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_578214/DevDiv_578214.il @@ -7,6 +7,7 @@ // Metadata version: v4.0.30319 .assembly extern System.Runtime { auto } .assembly DevDiv_578214 {} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit DevDiv_578214.Program extends [System.Runtime]System.Object @@ -109,6 +110,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 34 (0x22) .maxstack 7 diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_578217/DevDiv_578217.il b/src/tests/JIT/Regression/JitBlue/DevDiv_578217/DevDiv_578217.il index e2b9c8e09ce763..3d942ee5c07df4 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_578217/DevDiv_578217.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_578217/DevDiv_578217.il @@ -9,6 +9,7 @@ // Metadata version: v4.0.30319 .assembly extern System.Runtime { auto } .assembly DevDiv_524309 {} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit DevDiv_578217.Program extends [System.Runtime]System.Object @@ -82,6 +83,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 34 (0x22) .maxstack 7 diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_590771/DevDiv_590771.il b/src/tests/JIT/Regression/JitBlue/DevDiv_590771/DevDiv_590771.il index 168558c1017fb3..5d461ff5683985 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_590771/DevDiv_590771.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_590771/DevDiv_590771.il @@ -6,6 +6,7 @@ .assembly extern System.Console { auto } .assembly DevDiv_590771 { } +.assembly extern xunit.core {} .class public auto ansi beforefieldinit DevDiv_590771 extends [System.Runtime]System.Object @@ -97,6 +98,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 36 (0x24) .maxstack 6 diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_590772/DevDiv_590772.il b/src/tests/JIT/Regression/JitBlue/DevDiv_590772/DevDiv_590772.il index fd886bda9bb9b8..9c9ae42677c49b 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_590772/DevDiv_590772.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_590772/DevDiv_590772.il @@ -6,6 +6,7 @@ .assembly extern System.Console { auto } .assembly DevDiv_590772 { } +.assembly extern xunit.core {} .class public auto ansi beforefieldinit DevDiv_590772 extends [System.Runtime]System.Object @@ -120,6 +121,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 34 (0x22) .maxstack 7 diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_591210/DevDiv_591210.il b/src/tests/JIT/Regression/JitBlue/DevDiv_591210/DevDiv_591210.il index a1fbace5c4b5fc..7b608d4ce5c8f9 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_591210/DevDiv_591210.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_591210/DevDiv_591210.il @@ -5,6 +5,7 @@ .assembly extern System.Runtime { auto } .assembly DevDiv_591210 {} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit DevDiv_591210 extends [System.Runtime]System.Object @@ -135,6 +136,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 30 (0x1e) .maxstack 4 diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_605447/DevDiv_605447.il b/src/tests/JIT/Regression/JitBlue/DevDiv_605447/DevDiv_605447.il index 9d499887648a8a..b02c9d3c06769f 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_605447/DevDiv_605447.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_605447/DevDiv_605447.il @@ -6,6 +6,7 @@ .assembly extern System.Console { auto } .assembly DevDiv_605447 { } +.assembly extern xunit.core {} .class private auto ansi beforefieldinit DevDiv_605447 extends [System.Runtime]System.Object @@ -120,6 +121,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 33 (0x21) .maxstack 5 diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_710234/DevDiv_710234.il b/src/tests/JIT/Regression/JitBlue/DevDiv_710234/DevDiv_710234.il index 254aadfa9234dc..c74eb9d5e68bbf 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_710234/DevDiv_710234.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_710234/DevDiv_710234.il @@ -6,6 +6,7 @@ .assembly extern System.Console { auto } .assembly DevDiv_710234 { } +.assembly extern xunit.core {} .class private auto ansi beforefieldinit DevDiv_710234 extends [System.Runtime]System.Object @@ -101,6 +102,9 @@ } .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (int32 returnValue, int64 TestResult) nop diff --git a/src/tests/JIT/Regression/JitBlue/DevDiv_754566/DevDiv_754566.il b/src/tests/JIT/Regression/JitBlue/DevDiv_754566/DevDiv_754566.il index fd1e6c28937950..58d778ab3e911c 100644 --- a/src/tests/JIT/Regression/JitBlue/DevDiv_754566/DevDiv_754566.il +++ b/src/tests/JIT/Regression/JitBlue/DevDiv_754566/DevDiv_754566.il @@ -16,6 +16,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module test.exe // MVID: {A80A87C4-1DDB-4F93-AB31-444266FDFA55} .imagebase 0x00400000 @@ -49,6 +50,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 73 (0x49) .maxstack 2 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_10215/GitHub_10215.cs b/src/tests/JIT/Regression/JitBlue/GitHub_10215/GitHub_10215.cs index 1fc60de83ad968..a2e57fee7a3987 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_10215/GitHub_10215.cs +++ b/src/tests/JIT/Regression/JitBlue/GitHub_10215/GitHub_10215.cs @@ -3,10 +3,9 @@ using System; -using System.Runtime.CompilerServices; +using Xunit; - -// This test represent deep execution tree that could case C stack overflow +// This test represent deep execution tree that could case C stack overflow // in recursive tree walkers. It should work if the compiler spills deep tree periodically or // recursive walkers are replaced with non-recursive versions. class GitHub_10215 @@ -461,6 +460,10 @@ private static int CalcBigExpressionWithoutStores() } + // Use the [Fact] attribute directly on Main like an IL test since we can't run the generator on this project. + // The above expression creates a deep enough syntax tree that running a tree traversal of the syntax causes a stack overflow. + // As a result, running any generator on this project causes the compilation to crash. + [Fact] public static int Main() { if (CalcBigExpressionWithoutStores() == 100) diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_10215/GitHub_10215.csproj b/src/tests/JIT/Regression/JitBlue/GitHub_10215/GitHub_10215.csproj index 656bedde102452..742e20eb6e5ad4 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_10215/GitHub_10215.csproj +++ b/src/tests/JIT/Regression/JitBlue/GitHub_10215/GitHub_10215.csproj @@ -2,6 +2,8 @@ Exe 1 + + false diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_11804/GitHub_11804.il b/src/tests/JIT/Regression/JitBlue/GitHub_11804/GitHub_11804.il index 282d0e4c2174a2..7210a644cf9312 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_11804/GitHub_11804.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_11804/GitHub_11804.il @@ -16,6 +16,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module GitHub_11804.exe // MVID: {9CC2AC15-DDA3-4ADF-9566-89AB25A8CF63} .imagebase 0x00400000 @@ -62,6 +63,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 20 (0x14) .maxstack 8 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_12761/GitHub_12761.il b/src/tests/JIT/Regression/JitBlue/GitHub_12761/GitHub_12761.il index 2cd4178d8b05b4..eccabb89851134 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_12761/GitHub_12761.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_12761/GitHub_12761.il @@ -6,6 +6,7 @@ .assembly GitHub_12761 { } +.assembly extern xunit.core {} // =============== CLASS MEMBERS DECLARATION =================== @@ -25,6 +26,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 ldc.i4.0 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_13404/GitHub_13404.il b/src/tests/JIT/Regression/JitBlue/GitHub_13404/GitHub_13404.il index 15ec7fd038e901..6083b47d6543bc 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_13404/GitHub_13404.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_13404/GitHub_13404.il @@ -4,6 +4,7 @@ .assembly extern mscorlib {auto} .assembly extern System.Console {auto} .assembly GitHub_13404 {} +.assembly extern xunit.core {} .class Program { @@ -19,6 +20,9 @@ .method static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_13501/GitHub_13501.il b/src/tests/JIT/Regression/JitBlue/GitHub_13501/GitHub_13501.il index 3d3c84926fc9d5..4a09685c9d8210 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_13501/GitHub_13501.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_13501/GitHub_13501.il @@ -6,11 +6,15 @@ .assembly extern mscorlib { auto } .assembly GitHub_13501 { } +.assembly extern xunit.core {} .class private Program extends [mscorlib]System.Object { .method hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_13822/GitHub_13822.il b/src/tests/JIT/Regression/JitBlue/GitHub_13822/GitHub_13822.il index 0e3e73928e85c4..ee8a8446a80c44 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_13822/GitHub_13822.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_13822/GitHub_13822.il @@ -8,6 +8,7 @@ .assembly GitHub_13822 { } +.assembly extern xunit.core {} // =============== CLASS MEMBERS DECLARATION =================== @@ -47,6 +48,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 ldc.i4.0 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_14116/GitHub_14116.il b/src/tests/JIT/Regression/JitBlue/GitHub_14116/GitHub_14116.il index c4ab6797e9340e..1eb356dfd00ab2 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_14116/GitHub_14116.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_14116/GitHub_14116.il @@ -4,6 +4,7 @@ .assembly extern mscorlib {auto} .assembly extern System.Console {auto} .assembly GitHub_14116 {} +.assembly extern xunit.core {} .class Program { @@ -27,6 +28,9 @@ .method static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_14321/GitHub_14321.il b/src/tests/JIT/Regression/JitBlue/GitHub_14321/GitHub_14321.il index 40c7cc42eb31ff..45fb0564273cb8 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_14321/GitHub_14321.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_14321/GitHub_14321.il @@ -4,6 +4,7 @@ .assembly extern mscorlib {auto} .assembly extern System.Console {auto} .assembly GitHub_14321 {} +.assembly extern xunit.core {} .class Program { @@ -33,6 +34,9 @@ .method static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_14455/GitHub_14455.il b/src/tests/JIT/Regression/JitBlue/GitHub_14455/GitHub_14455.il index 2898a14370feca..8b91c1a0b1151e 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_14455/GitHub_14455.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_14455/GitHub_14455.il @@ -11,6 +11,7 @@ .assembly extern System.Runtime {auto} .assembly GitHub_14455 {} +.assembly extern xunit.core {} .class public auto ansi beforefieldinit Rotate.Node extends [System.Runtime]System.Object @@ -91,6 +92,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 14 (0xe) .maxstack 8 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_15291/GitHub_15291.il b/src/tests/JIT/Regression/JitBlue/GitHub_15291/GitHub_15291.il index 5abc01140e3e99..220e1b5e0b60a4 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_15291/GitHub_15291.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_15291/GitHub_15291.il @@ -11,6 +11,7 @@ .assembly extern mscorlib { auto } .assembly GitHub_15219 {} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit P extends [mscorlib]System.Object @@ -101,6 +102,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals init ([0] uint32 r64, diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_15319/GitHub_15319_1.il b/src/tests/JIT/Regression/JitBlue/GitHub_15319/GitHub_15319_1.il index 118fd2044ea20d..88852bef1259b5 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_15319/GitHub_15319_1.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_15319/GitHub_15319_1.il @@ -7,6 +7,7 @@ .assembly extern mscorlib { auto } .assembly GitHub_15319_1 {} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit Q extends [System.Runtime]System.Object @@ -24,6 +25,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint ldc.i4.s 100 conv.i8 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_15949/GitHub_15949.il b/src/tests/JIT/Regression/JitBlue/GitHub_15949/GitHub_15949.il index 9c893edd4ab7de..7294822f71b7c3 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_15949/GitHub_15949.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_15949/GitHub_15949.il @@ -4,6 +4,7 @@ .assembly extern mscorlib { auto } .assembly extern System.Console { auto } .assembly GitHub_15949 { } +.assembly extern xunit.core {} // Ensure that shifting a 64 bit value by 64 bits produces the same value. The ECMA spec doesn't specify // what should happen in this case but it would be preferable to have the same behavior for all shift @@ -17,6 +18,9 @@ { .method static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 .locals(int64) diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_16041/GitHub_16041.il b/src/tests/JIT/Regression/JitBlue/GitHub_16041/GitHub_16041.il index e063151fccc229..87a44e000003a5 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_16041/GitHub_16041.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_16041/GitHub_16041.il @@ -3,6 +3,7 @@ .assembly extern mscorlib { auto } .assembly GitHub_16041 { } +.assembly extern xunit.core {} // The test originally hit a problem with "Extra flags on tree" on amd64, // because "fgMorphBlockOperand" did not set flags when morphing comma for addr exposed lcl_Var. @@ -14,6 +15,9 @@ { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 10 (0xa) .maxstack 8 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_17585/GitHub_17585.il b/src/tests/JIT/Regression/JitBlue/GitHub_17585/GitHub_17585.il index 4b4c1c48565863..40a5fba5bb6947 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_17585/GitHub_17585.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_17585/GitHub_17585.il @@ -22,6 +22,7 @@ .assembly GitHub_17585 { } +.assembly extern xunit.core {} // =============== CLASS MEMBERS DECLARATION =================== @@ -107,6 +108,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 35 (0x23) .maxstack 1 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_18176/GitHub_18176.il b/src/tests/JIT/Regression/JitBlue/GitHub_18176/GitHub_18176.il index 75f0ad2b187f71..e9f8590b6c4266 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_18176/GitHub_18176.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_18176/GitHub_18176.il @@ -3,6 +3,7 @@ .assembly extern mscorlib { auto } .assembly GitHub_18176 { } +.assembly extern xunit.core {} // Ensure the jit is not tripped up by a foldable zero-length localloc @@ -16,6 +17,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (int32* V_0) diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_18291/GitHub_18291.il b/src/tests/JIT/Regression/JitBlue/GitHub_18291/GitHub_18291.il index 1c07e50a5b3715..0799d3dd15a204 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_18291/GitHub_18291.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_18291/GitHub_18291.il @@ -16,6 +16,7 @@ .assembly GitHub_18291 { } +.assembly extern xunit.core {} .class private auto ansi beforefieldinit GitHub_18291 extends [System.Runtime]System.Object @@ -138,6 +139,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 27 (0x1b) .maxstack 3 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_18295/GitHub_18295.il b/src/tests/JIT/Regression/JitBlue/GitHub_18295/GitHub_18295.il index 05c5dd9c413862..3ca3541f162c34 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_18295/GitHub_18295.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_18295/GitHub_18295.il @@ -4,6 +4,7 @@ .assembly extern mscorlib { auto } .assembly extern System.Console {auto} .assembly UnusedValueBug { } +.assembly extern xunit.core {} // This bug was found on desktop CLR using ILGEN. // The expression ending in the 'mul' below is all dead, but not all the dead code @@ -36,6 +37,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .vtentry 11 : 1 // Code size 131 (0x83) diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_20625/GitHub_20625.il b/src/tests/JIT/Regression/JitBlue/GitHub_20625/GitHub_20625.il index c8b8c5a177317c..4aa5d45fd40e06 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_20625/GitHub_20625.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_20625/GitHub_20625.il @@ -17,6 +17,7 @@ .assembly GitHub_20625 { } +.assembly extern xunit.core {} .class private abstract auto ansi beforefieldinit Base extends [System.Runtime]System.Object @@ -123,6 +124,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_20799/GitHub_20799.il b/src/tests/JIT/Regression/JitBlue/GitHub_20799/GitHub_20799.il index e9b0df8314f0c0..aa7310d88b1ed8 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_20799/GitHub_20799.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_20799/GitHub_20799.il @@ -4,6 +4,7 @@ .assembly extern System.Runtime { } .assembly extern System.Console { } .assembly GitHub_20799 { } +.assembly extern xunit.core {} .module GitHub_20799.exe // GitHub 20799: a bug is reproduced when @@ -362,6 +363,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 16 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_21761/GitHub_21761.il b/src/tests/JIT/Regression/JitBlue/GitHub_21761/GitHub_21761.il index ee360573093f79..cd818b0521f47b 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_21761/GitHub_21761.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_21761/GitHub_21761.il @@ -4,6 +4,7 @@ .assembly extern System.Runtime { } .assembly extern System.Numerics.Vectors { } .assembly GitHub_21761 { } +.assembly extern xunit.core {} // Some basic tests to ensure that the JIT handles non-zero // initialization correctly. @@ -277,6 +278,9 @@ FAIL: .method hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (valuetype Point a) diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_22583/base.csproj b/src/tests/JIT/Regression/JitBlue/GitHub_22583/base.csproj index 020cbd644307b0..03e2fc027748c9 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_22583/base.csproj +++ b/src/tests/JIT/Regression/JitBlue/GitHub_22583/base.csproj @@ -1,7 +1,7 @@ Library - false + SharedLibrary diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_22583/lib.csproj b/src/tests/JIT/Regression/JitBlue/GitHub_22583/lib.csproj index 6abc7113422a91..019f625f06346c 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_22583/lib.csproj +++ b/src/tests/JIT/Regression/JitBlue/GitHub_22583/lib.csproj @@ -1,7 +1,7 @@ Library - false + SharedLibrary diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_23039/GitHub_23039.il b/src/tests/JIT/Regression/JitBlue/GitHub_23039/GitHub_23039.il index 1671b2ed683589..5b790b82fc4c05 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_23039/GitHub_23039.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_23039/GitHub_23039.il @@ -8,6 +8,7 @@ .assembly GitHub_23039 { } +.assembly extern xunit.core {} // Bug where assertion prop was tripped up because morph swapped arg // order on an isinst helper call that fed into a conditional jump, @@ -32,6 +33,9 @@ IS: ldc.i4 -1 { .method public static hidebysig int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint call int32 class X`1::F() ret diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_23147/GitHub_23147.il b/src/tests/JIT/Regression/JitBlue/GitHub_23147/GitHub_23147.il index a5060df4dfdd18..0b37055eb656f0 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_23147/GitHub_23147.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_23147/GitHub_23147.il @@ -6,6 +6,7 @@ .assembly GitHub_23147 { } +.assembly extern xunit.core {} .module GitHub_23147.exe .class private sequential ansi sealed beforefieldinit Test_GitHub_23147.HFA_f2 @@ -507,6 +508,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 579 (0x243) .maxstack 2 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_23411/GitHub_23411.il b/src/tests/JIT/Regression/JitBlue/GitHub_23411/GitHub_23411.il index 4a3b078cc557ec..5ef139260ffcb7 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_23411/GitHub_23411.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_23411/GitHub_23411.il @@ -7,6 +7,7 @@ .assembly GitHub_23411 { } +.assembly extern xunit.core {} .module GitHub_23411.exe .class public auto ansi beforefieldinit GitHub_23411 @@ -196,6 +197,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 59 (0x3b) .maxstack 8 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_23792/GitHub_23792.il b/src/tests/JIT/Regression/JitBlue/GitHub_23792/GitHub_23792.il index 68c619308b09a9..70755752f1025f 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_23792/GitHub_23792.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_23792/GitHub_23792.il @@ -16,6 +16,7 @@ .assembly extern mscorlib{} .assembly extern System.Console{} .assembly a {} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit Test_GitHub_23792 extends [mscorlib]System.Object @@ -45,6 +46,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 119 (0x77) .maxstack 3 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_24185/GitHub_24185.cs b/src/tests/JIT/Regression/JitBlue/GitHub_24185/GitHub_24185.cs index d66e2919cd0416..4bd3d50cafbf44 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_24185/GitHub_24185.cs +++ b/src/tests/JIT/Regression/JitBlue/GitHub_24185/GitHub_24185.cs @@ -5,7 +5,7 @@ using System.Threading; using System.Threading.Tasks; -// The test shows recursive assertion propogation in one statement. +// The test shows recursive assertion propagation in one statement. namespace GitHub_24185 { @@ -20,9 +20,9 @@ static int Main(string[] args) catch (Exception e) { // Each expression in this condition checks that `e` is not null and checks its type. - // This information should be calculated once and propogated by assertion propogation. - if (!(e is AggregateException) || - !((((AggregateException)e).InnerExceptions[0] is ArgumentException) + // This information should be calculated once and propagated by assertion propagation. + if (!(e is AggregateException) || + !((((AggregateException)e).InnerExceptions[0] is ArgumentException) || ((AggregateException)e).InnerExceptions[0] is AggregateException)) { return 100; diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_24278/GitHub_24278.il b/src/tests/JIT/Regression/JitBlue/GitHub_24278/GitHub_24278.il index b6e8088a8ed67f..8ea9e1f8f017ac 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_24278/GitHub_24278.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_24278/GitHub_24278.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime { } .assembly GitHub_24278 { } +.assembly extern xunit.core {} .module GitHub_24278.exe // GitHub 24278: a bug is reproduced when @@ -56,6 +57,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 8 (0x8) .maxstack 8 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_25027/GitHub_25027.il b/src/tests/JIT/Regression/JitBlue/GitHub_25027/GitHub_25027.il index 5d7c69234f580f..55f2bc8e138eec 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_25027/GitHub_25027.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_25027/GitHub_25027.il @@ -7,12 +7,16 @@ .assembly extern System.Runtime { auto } .assembly extern mscorlib { auto } .assembly GitHub_25027 {} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit X extends [System.Runtime]System.Object { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init ([0] int32 result) ldc.i4.m1 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_26311/GitHub_26311.il b/src/tests/JIT/Regression/JitBlue/GitHub_26311/GitHub_26311.il index 67dc7b96678690..56b2a68258c31e 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_26311/GitHub_26311.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_26311/GitHub_26311.il @@ -8,6 +8,7 @@ .assembly extern System.Diagnostics.Debug {} .assembly extern System.Console {} .assembly GitHub_26311 {} +.assembly extern xunit.core {} @@ -244,6 +245,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 26 (0x1a) .maxstack 8 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_26491/GitHub_26491.il b/src/tests/JIT/Regression/JitBlue/GitHub_26491/GitHub_26491.il index fc415b2fbd63de..dcd167711e9edb 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_26491/GitHub_26491.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_26491/GitHub_26491.il @@ -20,6 +20,10 @@ // During the merge gtNewTempAssign does not expect the source value of TYP_SIMD16 // and the destination value of TYP_STRUCT. +.assembly extern System.Console +{ +} + .assembly extern System.Runtime { } @@ -31,6 +35,7 @@ .assembly GitHub_26491 { } +.assembly extern xunit.core {} .class private auto ansi beforefieldinit GitHub_26491 extends [System.Runtime]System.Object { @@ -95,34 +100,68 @@ IL_0009: ret } - .method public hidebysig static int32 Main(string[] args) cil managed + .method public hidebysig static int32 MultipleReturns() cil managed { - .entrypoint - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: ldstr "MultipleReturns" - IL_0006: call int32 [System.Runtime]System.Array::IndexOf(!!0[], !!0) - IL_000b: ldc.i4.m1 - IL_000c: beq.s IL_001b - + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) IL_000e: ldc.i4 0x677b IL_0013: call valuetype GitHub_26491/ReturnType GitHub_26491::MultipleReturns(int32) IL_0018: pop - IL_0019: br.s IL_0037 - - IL_001b: ldarg.0 - IL_001c: ldstr "SingleReturnSynchronized" - IL_0021: call int32 [System.Runtime]System.Array::IndexOf(!!0[], !!0) - IL_0026: ldc.i4.m1 - IL_0027: beq.s IL_0031 + IL_0037: ldc.i4.s 100 + IL_0039: ret + } + .method public hidebysig static int32 SingleReturnSynchronized() cil managed + { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) IL_0029: call valuetype GitHub_26491/ReturnType GitHub_26491::SingleReturnSynchronized() IL_002e: pop - IL_002f: br.s IL_0037 + IL_0037: ldc.i4.s 100 + IL_0039: ret + } + .method public hidebysig static int32 SingleReturn() cil managed + { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) IL_0031: call valuetype GitHub_26491/ReturnType GitHub_26491::SingleReturn() IL_0036: pop IL_0037: ldc.i4.s 100 IL_0039: ret } + + .method public hidebysig static int32 Main() cil managed + { + .entrypoint + .maxstack 8 + + ldstr "MultipleReturns" + call void [System.Console]System.Console::WriteLine(string) + call int32 GitHub_26491::MultipleReturns() + ldc.i4 100 + bne.un FAIL + + ldstr "SingleReturnSynchronized" + call void [System.Console]System.Console::WriteLine(string) + call int32 GitHub_26491::SingleReturnSynchronized() + ldc.i4 100 + bne.un FAIL + + ldstr "SingleReturn" + call void [System.Console]System.Console::WriteLine(string) + call int32 GitHub_26491::SingleReturn() + ldc.i4 100 + bne.un FAIL + + ldc.i4 100 + ret + + FAIL: + ldc.i4 101 + ret + } } diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_26491/GitHub_26491_MultipleReturns.ilproj b/src/tests/JIT/Regression/JitBlue/GitHub_26491/GitHub_26491.ilproj similarity index 71% rename from src/tests/JIT/Regression/JitBlue/GitHub_26491/GitHub_26491_MultipleReturns.ilproj rename to src/tests/JIT/Regression/JitBlue/GitHub_26491/GitHub_26491.ilproj index a0deaef877eb7d..6dc13af8eef7bb 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_26491/GitHub_26491_MultipleReturns.ilproj +++ b/src/tests/JIT/Regression/JitBlue/GitHub_26491/GitHub_26491.ilproj @@ -1,7 +1,6 @@ Exe - MultipleReturns diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_26491/GitHub_26491_SingleReturnSynchronized.ilproj b/src/tests/JIT/Regression/JitBlue/GitHub_26491/GitHub_26491_SingleReturnSynchronized.ilproj deleted file mode 100644 index b7b6b8e50f537d..00000000000000 --- a/src/tests/JIT/Regression/JitBlue/GitHub_26491/GitHub_26491_SingleReturnSynchronized.ilproj +++ /dev/null @@ -1,9 +0,0 @@ - - - RunOnly - GitHub_26491_MultipleReturns.ilproj - SingleReturnSynchronized - - true - - diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_27169/GitHub_27169.il b/src/tests/JIT/Regression/JitBlue/GitHub_27169/GitHub_27169.il index 3b8ef29e5424d4..c7fdc64d9caae7 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_27169/GitHub_27169.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_27169/GitHub_27169.il @@ -5,6 +5,7 @@ .assembly extern System.Runtime {} .assembly GitHub_27169 {} +.assembly extern xunit.core {} .class public auto beforefieldinit Program extends [System.Runtime]System.Object @@ -25,6 +26,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 32 .locals init (valuetype Program/Block b) diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_27678/GitHub_27678.il b/src/tests/JIT/Regression/JitBlue/GitHub_27678/GitHub_27678.il index b6a32f6445d22b..6eaaa683b502e9 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_27678/GitHub_27678.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_27678/GitHub_27678.il @@ -21,6 +21,7 @@ .assembly extern System.Runtime {} .assembly extern System.Diagnostics.Debug {} .assembly GitHub_27678 {} +.assembly extern xunit.core {} .class private sequential ansi sealed beforefieldinit AStruct extends [System.Runtime]System.ValueType @@ -166,6 +167,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 62 (0x3e) .maxstack 3 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_35384/GitHub_35384.il b/src/tests/JIT/Regression/JitBlue/GitHub_35384/GitHub_35384.il index a0890edcea0948..31348ecfbc901c 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_35384/GitHub_35384.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_35384/GitHub_35384.il @@ -5,6 +5,7 @@ .assembly extern System.Runtime {} .assembly GitHub_35384 {} +.assembly extern xunit.core {} .class private sequential ansi sealed beforefieldinit Struct extends [System.Runtime]System.ValueType @@ -39,6 +40,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 call string Program::ValueTypeExplicitThisInstanceMethodCalli() diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_35821/GitHub_35821.il b/src/tests/JIT/Regression/JitBlue/GitHub_35821/GitHub_35821.il index 58cc56eebb06f3..19a1f1a1397a2e 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_35821/GitHub_35821.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_35821/GitHub_35821.il @@ -12,6 +12,7 @@ .ver 5:0:0:0 } .assembly projs { } +.assembly extern xunit.core {} .module projs.dll // MVID: {379016DB-73C2-41D4-9E5F-5B727BC70E2C} .custom instance void [System.Runtime]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) @@ -34,6 +35,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 48 (0x30) .maxstack 8 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_5164/GitHub_5164.il b/src/tests/JIT/Regression/JitBlue/GitHub_5164/GitHub_5164.il index b0561320d25b7e..e9115676645689 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_5164/GitHub_5164.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_5164/GitHub_5164.il @@ -13,6 +13,7 @@ .assembly extern mscorlib { } .assembly GitHub_5164 { } +.assembly extern xunit.core {} .class public sequential ansi sealed beforefieldinit LargeStruct extends [mscorlib]System.ValueType @@ -41,6 +42,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 48 (0x30) .maxstack 3 diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_9651/GitHub_9651.il b/src/tests/JIT/Regression/JitBlue/GitHub_9651/GitHub_9651.il index 055fb231a16ba2..900049fbe86e55 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_9651/GitHub_9651.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_9651/GitHub_9651.il @@ -3,6 +3,7 @@ .assembly extern mscorlib {} .assembly a {} +.assembly extern xunit.core {} .module a.exe // Test case triggers reimportation of a leave, @@ -12,6 +13,9 @@ { .method static int32 Main(class [mscorlib]System.String[]) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (int32 V0, native int V1) .try diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_CoreRT_2073/GitHub_CoreRT_2073.il b/src/tests/JIT/Regression/JitBlue/GitHub_CoreRT_2073/GitHub_CoreRT_2073.il index 55cc7b1056e257..1f2d8840efd200 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_CoreRT_2073/GitHub_CoreRT_2073.il +++ b/src/tests/JIT/Regression/JitBlue/GitHub_CoreRT_2073/GitHub_CoreRT_2073.il @@ -8,7 +8,8 @@ .assembly extern mscorlib {} -.assembly GitHub_CoreRT_2073.exe {} +.assembly GitHub_CoreRT_2073 {} +.assembly extern xunit.core {} .class public Test_GitHub_CoreRT_2073 { @@ -40,6 +41,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 14 (0xe) .maxstack 8 diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_32059/Runtime_32059.il b/src/tests/JIT/Regression/JitBlue/Runtime_32059/Runtime_32059.il index 596507ea385e1b..81808908361f56 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_32059/Runtime_32059.il +++ b/src/tests/JIT/Regression/JitBlue/Runtime_32059/Runtime_32059.il @@ -4,12 +4,16 @@ .assembly extern System.Runtime {} .assembly Runtime_32059 {} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit Runtime_32059 extends [System.Runtime]System.Object { .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (valuetype [System.Runtime]System.DateTime V_0) .maxstack 12 diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_33529/Runtime_33529.il b/src/tests/JIT/Regression/JitBlue/Runtime_33529/Runtime_33529.il index 680903b9d5ba6d..33be7d603fdd4c 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_33529/Runtime_33529.il +++ b/src/tests/JIT/Regression/JitBlue/Runtime_33529/Runtime_33529.il @@ -3,6 +3,7 @@ .assembly extern mscorlib {} .assembly Runtime_33529 {} +.assembly extern xunit.core {} // Test case where the jit finds a tail call to loop opportunity after // suppressing zero initialization for a struct. @@ -111,6 +112,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 78 (0x4e) .maxstack 4 diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_39424/Runtime_39424.il b/src/tests/JIT/Regression/JitBlue/Runtime_39424/Runtime_39424.il index ab35b013505e20..c1d5a686aae348 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_39424/Runtime_39424.il +++ b/src/tests/JIT/Regression/JitBlue/Runtime_39424/Runtime_39424.il @@ -11,7 +11,8 @@ .assembly extern System.Numerics.Extensions {} .assembly extern System.Runtime.CompilerServices.Unsafe {} -.assembly Runtime_39424.exe {} +.assembly Runtime_39424 {} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit Runtime_39424 extends [System.Runtime]System.Object @@ -164,6 +165,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 18 (0x12) .maxstack 8 @@ -193,4 +197,4 @@ IL_0006: ret } // end of method Runtime_39424::.ctor -} // end of class Runtime_39424 \ No newline at end of file +} // end of class Runtime_39424 diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_39581/Runtime_39581.il b/src/tests/JIT/Regression/JitBlue/Runtime_39581/Runtime_39581.il index 5288e150809573..e962e582625d27 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_39581/Runtime_39581.il +++ b/src/tests/JIT/Regression/JitBlue/Runtime_39581/Runtime_39581.il @@ -37,6 +37,7 @@ .assembly Runtime_39581 { } +.assembly extern xunit.core {} .class private sequential ansi sealed beforefieldinit int32x8 extends [System.Runtime]System.ValueType @@ -101,6 +102,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 6 .locals init (valuetype int32x8 V_0) diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_40607/Runtime_40607.il b/src/tests/JIT/Regression/JitBlue/Runtime_40607/Runtime_40607.il index ca0106255f1f4b..a8c21251263b24 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_40607/Runtime_40607.il +++ b/src/tests/JIT/Regression/JitBlue/Runtime_40607/Runtime_40607.il @@ -10,6 +10,7 @@ .assembly Runtime_40607 { } +.assembly extern xunit.core {} .module Runtime_40607.dll .class private auto ansi beforefieldinit Runtime_40607.Program extends [System.Runtime]System.Object @@ -372,6 +373,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (int32 V_0) diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_41073/Runtime_41073.il b/src/tests/JIT/Regression/JitBlue/Runtime_41073/Runtime_41073.il index 4d89afb88d9c1b..0b85096cda1057 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_41073/Runtime_41073.il +++ b/src/tests/JIT/Regression/JitBlue/Runtime_41073/Runtime_41073.il @@ -17,6 +17,7 @@ .assembly Runtime_41073 { } +.assembly extern xunit.core {} .class private auto ansi beforefieldinit Runtime_41073 extends [System.Runtime]System.Object @@ -38,6 +39,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 27 (0x1b) .maxstack 1 diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_41100/Runtime_41100.cs b/src/tests/JIT/Regression/JitBlue/Runtime_41100/Runtime_41100.cs index c4ddf22babb6d9..ad6df21e420f87 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_41100/Runtime_41100.cs +++ b/src/tests/JIT/Regression/JitBlue/Runtime_41100/Runtime_41100.cs @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// The test was showing a wrong copy propogation when a struct field was rewritten by +// The test was showing a wrong copy propagation when a struct field was rewritten by // a call assignment to the parent struct but that assignment was not supported by copyprop. using System; @@ -20,7 +20,7 @@ public static void E(ImmutableArray a) {} public static ImmutableArray H() { string[] a = new string[100]; - + for (int i = 0; i < a.Length; i++) { a[i] = "hello"; @@ -29,7 +29,7 @@ public static ImmutableArray H() return ImmutableArray.Create(a); } - [MethodImpl(MethodImplOptions.NoInlining)] + [MethodImpl(MethodImplOptions.NoInlining)] public static int F() { var a = H(); @@ -49,7 +49,7 @@ public static int F() { if (s.Equals("hello")) r--; } - + aa = G(); foreach (var s in a) diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_43130/Runtime_43130.il b/src/tests/JIT/Regression/JitBlue/Runtime_43130/Runtime_43130.il index d4a3a9a5895bef..c2195f1f28fe51 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_43130/Runtime_43130.il +++ b/src/tests/JIT/Regression/JitBlue/Runtime_43130/Runtime_43130.il @@ -14,6 +14,7 @@ .assembly Runtime_43130 { } +.assembly extern xunit.core {} .module Runtime_43130.dll .class private auto ansi beforefieldinit Runtime_43130 @@ -157,6 +158,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 29 (0x1d) .maxstack 1 diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_45250/Runtime_45250.il b/src/tests/JIT/Regression/JitBlue/Runtime_45250/Runtime_45250.il index 88cb0a35d339c9..149dcc590f1369 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_45250/Runtime_45250.il +++ b/src/tests/JIT/Regression/JitBlue/Runtime_45250/Runtime_45250.il @@ -7,6 +7,7 @@ .assembly Runtime_45250 { } +.assembly extern xunit.core {} .module Runtime_45250.dll .class private auto ansi beforefieldinit Runtime_45250.Program @@ -77,6 +78,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 IL_0000: newobj instance void Runtime_45250.Program/FuncGetter::.ctor() diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_47308/Runtime_47308.il b/src/tests/JIT/Regression/JitBlue/Runtime_47308/Runtime_47308.il index 66fefe66f22345..f94c820ac078a7 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_47308/Runtime_47308.il +++ b/src/tests/JIT/Regression/JitBlue/Runtime_47308/Runtime_47308.il @@ -10,6 +10,7 @@ .assembly extern System.Console {} .assembly Test1 {} +.assembly extern xunit.core {} .assembly extern mscorlib{auto} .class FullProof { .method static void Test() { @@ -49,6 +50,9 @@ IL_500: ret .method public static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 3 .try diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_61037/Runtime_61037.cs b/src/tests/JIT/Regression/JitBlue/Runtime_61037/Runtime_61037.cs new file mode 100644 index 00000000000000..e96ea042f39583 --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_61037/Runtime_61037.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. + +// Generated by Fuzzlyn v1.5 on 2021-11-03 12:55:21 +// Run on Arm64 Windows +// Seed: 951014135056301943 +// Reduced from 152.5 KiB to 0.3 KiB in 00:01:22 +// Hits JIT assert in Release: +// Assertion failed 'ins == INS_add' in 'Program:Main(Fuzzlyn.ExecutionServer.IRuntime)' during 'Generate code' (IL size 28) +// +// File: D:\a\_work\3\s\src\coreclr\jit\emitarm64.cpp Line: 13602 +// +public class C0 +{ +} + +public class Runtime_61037 +{ + public static int Main() + { + if (0 == (27452 + (-2147483647 * M1()))) + { + var vr3 = new C0(); + } + + return 100; + } + + public static long M1() + { + var vr1 = new C0[,] { { new C0() } }; + return 0; + } +} \ No newline at end of file diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_61037/Runtime_61037.csproj b/src/tests/JIT/Regression/JitBlue/Runtime_61037/Runtime_61037.csproj new file mode 100644 index 00000000000000..1100f420532dc8 --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_61037/Runtime_61037.csproj @@ -0,0 +1,10 @@ + + + Exe + None + True + + + + + diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_61045/Runtime_61045.cs b/src/tests/JIT/Regression/JitBlue/Runtime_61045/Runtime_61045.cs new file mode 100644 index 00000000000000..b9c83b498d6cd7 --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_61045/Runtime_61045.cs @@ -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. + +// Generated by Fuzzlyn v1.5 on 2021-11-04 18:29:11 +// Run on Arm64 Linux +// Seed: 1922924939431163374 +// Reduced from 261.1 KiB to 0.2 KiB in 00:05:39 +// Hits JIT assert in Release: +// Assertion failed 'isValidImmShift(lsb, size)' in 'Program:M4():int' during 'Generate code' (IL size 26) +// +// File: /__w/1/s/src/coreclr/jit/emitarm64.cpp Line: 7052 +// + +using System; +using System.Runtime.CompilerServices; + +public class Runtime_61045 +{ + public static byte[] s_1; + public static int Main() + { + try + { + Test(); + } + catch (NullReferenceException) + { + return 100; + } + return 101; + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static uint Test() + { + return (uint)((ushort)~s_1[0] << (0 >> s_1[0])); + } +} diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_61045/Runtime_61045.csproj b/src/tests/JIT/Regression/JitBlue/Runtime_61045/Runtime_61045.csproj new file mode 100644 index 00000000000000..6946bed81bfd5b --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_61045/Runtime_61045.csproj @@ -0,0 +1,9 @@ + + + Exe + True + + + + + diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_61510/Runtime_61510.cs b/src/tests/JIT/Regression/JitBlue/Runtime_61510/Runtime_61510.cs new file mode 100644 index 00000000000000..fc40b9b1d775fd --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_61510/Runtime_61510.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; + +unsafe class Runtime_61510 +{ + [FixedAddressValueType] + private static byte s_field; + + public static int Main() + { + ref byte result = ref AddZeroByrefToNativeInt((nint)Unsafe.AsPointer(ref s_field)); + + return Unsafe.AreSame(ref s_field, ref result) ? 100 : 101; + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private static ref byte AddZeroByrefToNativeInt(nint addr) + { + return ref Unsafe.Add(ref Unsafe.NullRef(), addr); + } +} diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_61510/Runtime_61510.csproj b/src/tests/JIT/Regression/JitBlue/Runtime_61510/Runtime_61510.csproj new file mode 100644 index 00000000000000..cf94135633b19a --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_61510/Runtime_61510.csproj @@ -0,0 +1,10 @@ + + + Exe + True + true + + + + + \ No newline at end of file diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_61629/Runtime_61629.cs b/src/tests/JIT/Regression/JitBlue/Runtime_61629/Runtime_61629.cs new file mode 100644 index 00000000000000..a14b10b0657cda --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_61629/Runtime_61629.cs @@ -0,0 +1,17 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.CompilerServices; + +public class Runtime_61629 +{ + public static int Main() => + Test(100, 200.0) + Test(Math.PI, Math.PI) - 72; + + [MethodImpl(MethodImplOptions.NoInlining)] + static int Test(double a, double b) + { + return (int)a ^ (int)b >> 32; + } +} diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_61629/Runtime_61629.csproj b/src/tests/JIT/Regression/JitBlue/Runtime_61629/Runtime_61629.csproj new file mode 100644 index 00000000000000..f492aeac9d056b --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_61629/Runtime_61629.csproj @@ -0,0 +1,9 @@ + + + Exe + True + + + + + \ No newline at end of file diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_61908/Runtime_61908.cs b/src/tests/JIT/Regression/JitBlue/Runtime_61908/Runtime_61908.cs new file mode 100644 index 00000000000000..a626e35809191f --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_61908/Runtime_61908.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +public class Runtime_61908 +{ + public static bool s_3; + public static int Main() + { + var vr6 = M3(s_3); + if (M3(vr6)) + { + return -1; + } + + return 100; + } + + public static bool M3(bool arg0) + { + arg0 = !arg0; + return arg0; + } +} diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_61908/Runtime_61908.csproj b/src/tests/JIT/Regression/JitBlue/Runtime_61908/Runtime_61908.csproj new file mode 100644 index 00000000000000..f492aeac9d056b --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_61908/Runtime_61908.csproj @@ -0,0 +1,9 @@ + + + Exe + True + + + + + \ No newline at end of file diff --git a/src/tests/JIT/Regression/JitBlue/WPF_3226/ILRepro/WPF_3226.il b/src/tests/JIT/Regression/JitBlue/WPF_3226/ILRepro/WPF_3226.il index d321fe5ae41834..2ffd21d5e8dddb 100644 --- a/src/tests/JIT/Regression/JitBlue/WPF_3226/ILRepro/WPF_3226.il +++ b/src/tests/JIT/Regression/JitBlue/WPF_3226/ILRepro/WPF_3226.il @@ -14,6 +14,7 @@ .assembly extern System.Diagnostics.Debug {} .assembly WPF_3226 {} +.assembly extern xunit.core {} // =============== CLASS MEMBERS DECLARATION =================== @@ -55,6 +56,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 56 (0x38) .maxstack 2 diff --git a/src/tests/JIT/Regression/JitBlue/devdiv_815941/DevDiv_815941.il b/src/tests/JIT/Regression/JitBlue/devdiv_815941/DevDiv_815941.il index f28ead0a6bdb57..7e794ad146248c 100644 --- a/src/tests/JIT/Regression/JitBlue/devdiv_815941/DevDiv_815941.il +++ b/src/tests/JIT/Regression/JitBlue/devdiv_815941/DevDiv_815941.il @@ -8,12 +8,16 @@ } .assembly extern mscorlib { } .assembly DevDiv_815941 { } +.assembly extern xunit.core {} .module DevDiv_815941.exe .class Repro { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) // This testcase declares a union of two fields: double and long // We ensure that if a non-zero value is stored in the double field // the value returned for the long field is also non-zero diff --git a/src/tests/JIT/Regression/JitBlue/devdiv_815942/DevDiv_815942.il b/src/tests/JIT/Regression/JitBlue/devdiv_815942/DevDiv_815942.il index 2bbf7a1e8e4826..f64eee564486f7 100644 --- a/src/tests/JIT/Regression/JitBlue/devdiv_815942/DevDiv_815942.il +++ b/src/tests/JIT/Regression/JitBlue/devdiv_815942/DevDiv_815942.il @@ -8,12 +8,16 @@ } .assembly extern mscorlib { } .assembly DevDiv_815942 {} +.assembly extern xunit.core {} .module DevDiv_815942.exe .class Repro { .method static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) // This testcase ensures that we correctly compare a double local // against a float const by converting the float const to double // instead of converting the local to float and losing precision diff --git a/src/tests/JIT/Regression/JitBlue/devdiv_902271/DevDiv_902271.il b/src/tests/JIT/Regression/JitBlue/devdiv_902271/DevDiv_902271.il index 8168f3e5564eda..5c31c67b280571 100644 --- a/src/tests/JIT/Regression/JitBlue/devdiv_902271/DevDiv_902271.il +++ b/src/tests/JIT/Regression/JitBlue/devdiv_902271/DevDiv_902271.il @@ -9,6 +9,7 @@ .assembly extern mscorlib {} .assembly test {} +.assembly extern xunit.core {} .module test.exe .class Repro @@ -64,6 +65,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 ldnull diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b102759/b102759.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b102759/b102759.il index e59444974a6a6f..65faac282c13f5 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b102759/b102759.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b102759/b102759.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0x4d97cd70 {} +.assembly extern xunit.core {} .class ILGEN_0x4d97cd70 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 2 // ldc.i8 0x1fffff diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b102870/b102870.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b102870/b102870.il index dcb00d984b3f5a..578641630ac3e6 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b102870/b102870.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b102870/b102870.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0xc96205c9 {} +.assembly extern xunit.core {} .class ILGEN_0xc96205c9 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 3 ldc.i4.1 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b106158/branchoutoftry.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b106158/branchoutoftry.il index 48dde7553fa1c7..92bbd09a0bf065 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b106158/branchoutoftry.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b106158/branchoutoftry.il @@ -20,6 +20,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module testit.exe // MVID: {55BD0E59-8783-4990-A94D-348582FD2ED5} .imagebase 0x00400000 @@ -39,6 +40,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 44 (0x2c) .maxstack 2 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b108366/bug.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b108366/bug.il index 7788044df51ef1..5127900567ef21 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b108366/bug.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b108366/bug.il @@ -8,7 +8,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly div_r8.exe{} +.assembly div_r8{} .class public _div { //-- diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b108908/b108908.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b108908/b108908.il index bf2d775ed3b368..854a08b53ed61a 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b108908/b108908.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b108908/b108908.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0x45f9b5e5 {} +.assembly extern xunit.core {} .class ILGEN_0x45f9b5e5 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 9 ldc.i4 1 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b109721/bug.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b109721/bug.il index 519d7298375177..0f740cca00ac63 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b109721/bug.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b109721/bug.il @@ -8,7 +8,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly div_i4.exe{} +.assembly div_i4{} .class public _div { // diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b109878/rem_r4.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b109878/rem_r4.il index 981546815a6e8d..0cdabbbeb28d7e 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b109878/rem_r4.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b109878/rem_r4.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly rem_r4.exe{} +.assembly rem_r4{} .class public _rem { //-- diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b112348/length0.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b112348/length0.il index abc4b381e20361..5e763faa5206bf 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b112348/length0.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b112348/length0.il @@ -18,6 +18,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module test.exe .imagebase 0x00400000 .file alignment 0x00000200 @@ -87,6 +88,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (int32[0...] V_0, diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b112982/exceptobj.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b112982/exceptobj.il index 666d0db25cfc0c..6f190d0945e250 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b112982/exceptobj.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b112982/exceptobj.il @@ -10,6 +10,7 @@ .assembly excepobj { } +.assembly extern xunit.core {} // This test ensures that valid exception object is on the stack in the filter .namespace DD @@ -18,6 +19,9 @@ { .method public static int32 Main(class [mscorlib]System.String[] args) il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals (int32 V_0) diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b115103/b115103.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b115103/b115103.il index bf09d09a02f22c..948ea0d84f3f59 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b115103/b115103.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b115103/b115103.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly Test_b115103 {} +.assembly extern xunit.core {} .class Test_b115103 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 8 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b141062/ericswitch.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b141062/ericswitch.il index 6460f739e9ef1c..c527ea53e5d2ec 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b141062/ericswitch.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b141062/ericswitch.il @@ -24,6 +24,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module ericswitch.exe // MVID: {392F7FED-ADA8-4853-8A34-B9F492F92525} .imagebase 0x00400000 @@ -394,6 +395,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 13 (0xd) .maxstack 1 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b79852/b79852.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b79852/b79852.il index b291b24b9fada6..c7a0c2e071ba31 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b79852/b79852.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b79852/b79852.il @@ -10,6 +10,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xdbcacf66 {} +.assembly extern xunit.core {} .class ILGEN_0xdbcacf66 { //BEGIN STATIC FIELDS @@ -102,6 +103,9 @@ xor ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 2 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b79858/b79858.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b79858/b79858.il index 7fea398b80a4d7..535565b401d9b7 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b79858/b79858.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b79858/b79858.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x8275b048 {} +.assembly extern xunit.core {} .class ILGEN_0x8275b048 { .method static void Method_0x98c7d74e() { .maxstack 11 @@ -19,6 +20,9 @@ ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 3 call void ILGEN_0x8275b048::Method_0x98c7d74e() diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b80365/b80365-ia64.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b80365/b80365-ia64.il index 5d05c1ce90d605..22f67e2702a035 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b80365/b80365-ia64.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b80365/b80365-ia64.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0x71d10697 {} +.assembly extern xunit.core {} .class ILGEN_0x71d10697 { .method static unsigned int64 Method_0x77f6a2f8() { .maxstack 21 @@ -135,6 +136,9 @@ not ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 2 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b80373/b80373.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b80373/b80373.il index fa63f7f6112040..787769bd1fba8d 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b80373/b80373.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b80373/b80373.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xe2ce7565 {} +.assembly extern xunit.core {} .class ILGEN_0xe2ce7565 { .method static unsigned int8 Method_0xe8a4bb67(int64 Arg_0x0, unsigned int16 Arg_0x1, unsigned int64 Arg_0x2, unsigned int16 Arg_0x3, int32 Arg_0x4) { .maxstack 11 @@ -78,6 +79,9 @@ clt.un ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 11 ldc.i8 0xe2849c60674245ac diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b80737/fbug5.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b80737/fbug5.il index 4ac6e1b88b9fb7..a2c29c6408e1ad 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b80737/fbug5.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b80737/fbug5.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xca1e3399 {} +.assembly extern xunit.core {} .class ILGEN_0xca1e3399 { .method static unsigned int32 Method_0x8f2f764c() { .maxstack 21 @@ -524,6 +525,9 @@ cgt ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 2 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b80738/fbug6.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b80738/fbug6.il index 17d64158b3e7ea..6c2758ce89468f 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b80738/fbug6.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b80738/fbug6.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly ILGEN_0xfa70290a {} +.assembly extern xunit.core {} .class ILGEN_0xfa70290a { .method static unsigned int8 Method_0x8f046f0b(unsigned int16 Arg_0x0, int8 Arg_0x1, int8 Arg_0x2, native int Arg_0x3, unsigned int64 Arg_0x4) { .maxstack 11 @@ -108,6 +109,9 @@ cgt.un ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 11 ldc.i4 0x1ebe67ca diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b81766/b81766.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b81766/b81766.il index fa6f7e0a349384..d8336466520c4c 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b81766/b81766.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b81766/b81766.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly l.exe{} +.assembly l{} .method public public static int32 t() { ldc.i4 100 ret diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84128/b84128.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84128/b84128.il index 81899c7473e482..ee701495c8371c 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84128/b84128.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84128/b84128.il @@ -8,7 +8,7 @@ .ver 4:0:0:0 } .assembly extern legacy library mscorlib {} -.assembly ldobj.exe{ +.assembly 'ldobj'{ } diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84129/b84129.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84129/b84129.il index 68b7f134329a14..3565e17df48c4c 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84129/b84129.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84129/b84129.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly box_unbox.exe{} +.assembly box_unbox{} .class public value sealed valClass { .field public int32 Field1 } diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84131/b84131.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84131/b84131.il index b054e3e649d474..409b0afbc6e29f 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84131/b84131.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84131/b84131.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly bge.exe{} +.assembly 'bge'{} .method public static int32 main() { .entrypoint ldc.r4 1.0 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84136/b84136.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84136/b84136.il index 22d8bb6e7aa298..55177f08a02e9d 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84136/b84136.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84136/b84136.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly conv.exe{} +.assembly conv{} .class public conv { .method public static float32 r4(float32) { .maxstack 2 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84586/b84586.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84586/b84586.il index 2e5162b3c511a6..4b6b1999d2390e 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84586/b84586.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84586/b84586.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly tailcall.exe{} +.assembly tailcall{} .method public static int32 main(class [mscorlib]System.String[]) { .entrypoint diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84590/b84590.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84590/b84590.il index a307e1a03b41d7..23e0e63ddcb608 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84590/b84590.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84590/b84590.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly bge2.exe{} +.assembly bge2{} .method public static int32 main() { .entrypoint // r4 real >= unordered diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84592/b84592.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84592/b84592.il index 18bbd58084e466..f9ba79f6f2468d 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84592/b84592.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84592/b84592.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly initblk.exe{} +.assembly 'initblk'{} .class public _initblk { .field public static int32 DATA diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84957/b84957.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84957/b84957.il index 1c15116b8eee4e..1ba8e90cfcfaff 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84957/b84957.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84957/b84957.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly ble.exe{} +.assembly 'ble'{} .method public static int32 main(class [mscorlib]System.String[]) { .locals (class [mscorlib]System.String) .entrypoint diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84958/b84958.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84958/b84958.il index 9defc55ce978c1..b398fb5d8e43ad 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84958/b84958.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84958/b84958.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly ldloc_stloc.exe{} +.assembly ldloc_stloc{} .class public ldloc_stloc { .method public static int32 main(class [mscorlib]System.String[]) { .entrypoint diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84961/b84961.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84961/b84961.il index 196bf7feaf8dcf..5717d87a062c83 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84961/b84961.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84961/b84961.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly mul.exe{} +.assembly 'mul'{} .class public _mul { .method public static int32 I4(int32,int32,int32) { diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84962/b84962.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84962/b84962.il index b09ba37bc20ddc..353591d51a4c1e 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84962/b84962.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b84962/b84962.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly ret.exe{} +.assembly 'ret'{} .class public _ret { .field public static native int PTR .method public static int32 retI(int32*) { diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85314/b85314.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85314/b85314.il index be50584786319f..236856991ada19 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85314/b85314.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85314/b85314.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly s.exe{} +.assembly s{} .class public s { .method public static int32 main(class [mscorlib]System.String[]) { .entrypoint diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85315/b85315.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85315/b85315.il index d51a109e1d083a..dae97717c53d92 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85315/b85315.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85315/b85315.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly shl.exe{} +.assembly 'shl'{} .class public _shl { .method public static int32 main(class [mscorlib]System.String[]) { .entrypoint diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85316/f2.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85316/f2.il index 8f3a8a6d42cc0a..528b1207ad5dd1 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85316/f2.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85316/f2.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly n.exe{} +.assembly n{} .class public _n { .method public static int32 main(class [mscorlib]System.String[]) { .entrypoint diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85317/b85317.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85317/b85317.il index 678a6aabd47454..8a69b9613225cd 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85317/b85317.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85317/b85317.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0xddaef29d {} +.assembly extern xunit.core {} .class ILGEN_0xddaef29d { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 2 ldc.i8 0x1f65d516e9665e42 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85564/b85564.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85564/b85564.il index abb3c74fd35389..6428ac2db4eb3b 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85564/b85564.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85564/b85564.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly rem.exe{} +.assembly 'rem'{} .class public _rem { .method public static int32 main(class [mscorlib]System.String[]) { diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85565/b85565.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85565/b85565.il index 67bd1436d135cb..d45bb28c373ea3 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85565/b85565.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85565/b85565.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly s.exe{} +.assembly s{} .class public s { .method public static int32 return(int32) { .maxstack 2 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85566/b85566.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85566/b85566.il index 29d030c22f5c2a..370568ef913530 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85566/b85566.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b85566/b85566.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly s.exe{} +.assembly s{} .class public s { .method static int32 main(class System.String[]) { .entrypoint diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b92713/b92713.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b92713/b92713.il index d506b7864fe7ea..1b9c6b2119703c 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b92713/b92713.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b92713/b92713.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly div_i4.exe{} +.assembly div_i4{} .class public _div { // diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b92726/b92726.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b92726/b92726.il index 40759441ea1911..e3cec01d786981 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b92726/b92726.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b92726/b92726.il @@ -7,7 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } -.assembly rem_r4.exe{} +.assembly rem_r4{} .class public _rem { //-- diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b98431/ConsoleApplication2.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b98431/ConsoleApplication2.il index c642dee8836133..d745a1bb8c2b0c 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b98431/ConsoleApplication2.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b98431/ConsoleApplication2.il @@ -30,6 +30,7 @@ .hash algorithm 0x00008004 .ver 1:0:583:22480 } +.assembly extern xunit.core {} .module ConsoleApplication2.exe .imagebase 0x11000000 .file alignment 0x00000200 @@ -45,6 +46,9 @@ { .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (bool V_0, diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b99403/cbyte7a.il b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b99403/cbyte7a.il index fff30432d8ed43..16c63cb0c4adf9 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/M00/b99403/cbyte7a.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/M00/b99403/cbyte7a.il @@ -30,6 +30,7 @@ .hash algorithm 0x00008004 .ver 1:0:585:20133 } +.assembly extern xunit.core {} .module CByte7a.exe .imagebase 0x11000000 .file alignment 0x00000200 @@ -45,6 +46,9 @@ { .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (bool V_0, diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b126221/cs_il.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b126221/cs_il.il index fc5015b687c28e..3e40d16e358dba 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b126221/cs_il.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b126221/cs_il.il @@ -14,6 +14,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module cs_test_01.exe .custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) .imagebase 0x00400000 @@ -38,6 +39,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals (valuetype big V_0, diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b142473/loop_06_24_02.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b142473/loop_06_24_02.il index 3c9096e50f54d2..6a68bc663beb46 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b142473/loop_06_24_02.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b142473/loop_06_24_02.il @@ -18,6 +18,7 @@ { .ver 0:0:0:0 } +.assembly extern xunit.core {} .module hello.exe .imagebase 0x00400000 .file alignment 0x00000200 @@ -32,6 +33,9 @@ { .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 16 .locals init (int64 V_0, diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b223862/bug1.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b223862/bug1.il index 47761279faada4..51ac95e9eda215 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b223862/bug1.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b223862/bug1.il @@ -2,9 +2,13 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly ILGEN_0xc766623d {} +.assembly extern xunit.core {} .assembly extern mscorlib{auto} .class ILGEN_0xc766623d { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 5 ldc.i4.4 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b91953/2.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b91953/2.il index 22477ff0ca8a63..cc08c7cc93e6a1 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b91953/2.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-Beta1/b91953/2.il @@ -8,10 +8,14 @@ .ver 4:0:0:0 } .assembly ILGEN_0xb8267005 {} +.assembly extern xunit.core {} .class ILGEN_0xb8267005 { .field static float64 field_0x2 .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 19 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b10802/repro.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b10802/repro.il index f37ef9086ff7e4..9281bcc5bdc316 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b10802/repro.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b10802/repro.il @@ -25,6 +25,7 @@ .ver 0:0:0:0 } +.assembly extern xunit.core {} .module convovf_i8_u.exe // MVID: {8F1AC63C-507C-42CD-B9EC-7E585802DBD0} .imagebase 0x00400000 @@ -41,6 +42,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 1283 (0x503) .maxstack 5 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b10841/repro_good.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b10841/repro_good.il index 94ebe57069bf4d..e60550734c8832 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b10841/repro_good.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b10841/repro_good.il @@ -24,6 +24,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module main.exe // MVID: {8652F29E-ADDD-4F29-9B4B-0D71E9CFC6D1} .imagebase 0x00400000 @@ -39,6 +40,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 72 (0x48) .maxstack 2 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b10852/test3.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b10852/test3.il index 7ef8b8d0ea89b2..ac92a3d38eeb65 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b10852/test3.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b10852/test3.il @@ -20,6 +20,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module test3.exe .custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) .imagebase 0x00400000 @@ -34,6 +35,9 @@ .field public static int32 size_to_test .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals init (bool V_0, diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b11131/bug2.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b11131/bug2.il index 4a36d02a5992df..708e1e015f355e 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b11131/bug2.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b11131/bug2.il @@ -19,6 +19,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module switch.exe // MVID: {663074E2-0B73-434A-85B1-7077AA61100B} .imagebase 0x00400000 @@ -34,6 +35,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 67 (0x43) .maxstack 1 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b11878/test_07.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b11878/test_07.il index 97a01146500f79..9ff1264337da9e 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b11878/test_07.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b11878/test_07.il @@ -3,12 +3,16 @@ .assembly extern mscorlib{} .assembly delegate26{} +.assembly extern xunit.core {} .module delegate26.exe .class public auto ansi beforefieldinit Client extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (int32) diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b12022/test_10.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b12022/test_10.il index f01fcc9eec1c3c..d5a590f9752907 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b12022/test_10.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b12022/test_10.il @@ -3,6 +3,7 @@ .assembly extern mscorlib{} .assembly base017{} +.assembly extern xunit.core {} .module base017.exe @@ -20,6 +21,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (valuetype base017) ldloca 0 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b12263/nullref.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b12263/nullref.il index 89d49b17056231..ef494412570819 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b12263/nullref.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b12263/nullref.il @@ -3,6 +3,7 @@ .assembly extern mscorlib{} .assembly field017{} +.assembly extern xunit.core {} .module field017.exe .class private auto ansi beforefieldinit MyTest @@ -50,6 +51,9 @@ .method public hidebysig static void Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .locals init (int32 V_0, class MyClass V_1, int32 V_2, diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b12343/test_04a.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b12343/test_04a.il index 60105713282934..12193238b5fb7c 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b12343/test_04a.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b12343/test_04a.il @@ -11,12 +11,16 @@ .ver 4:0:0:0 } .assembly test {} +.assembly extern xunit.core {} .module test_04a.exe .class private auto ansi beforefieldinit test extends [mscorlib]System.Object { .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try { diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b12390/test_04a.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b12390/test_04a.il index 24f810c73226a6..a68bc273626359 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b12390/test_04a.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b12390/test_04a.il @@ -3,6 +3,7 @@ .assembly extern mscorlib{} .assembly test_08{} +.assembly extern xunit.core {} .module test_08.exe .class public auto ansi beforefieldinit repro @@ -10,6 +11,9 @@ { .method public hidebysig static int32 Main(string[] argv) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try { diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b12425/test_17.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b12425/test_17.il index ed2a50e4bd19c8..648b559e9b16cd 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b12425/test_17.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b12425/test_17.il @@ -3,6 +3,7 @@ .assembly extern mscorlib{} .assembly test_17{} +.assembly extern xunit.core {} .module test_17.exe .class interface public abstract auto ansi ITrees @@ -40,6 +41,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint ldtoken Garden diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b13691/init_byte.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b13691/init_byte.il index 3702e222598d7c..f97e68f1a10f63 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b13691/init_byte.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b13691/init_byte.il @@ -25,6 +25,7 @@ .ver 0:0:0:0 } +.assembly extern xunit.core {} .module init_byte.exe // MVID: {FDCD7B4C-5230-4304-82F7-A3D10057533E} .imagebase 0x00400000 @@ -454,6 +455,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 842 (0x34a) .maxstack 4 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b14324/repro.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b14324/repro.il index adc00caa3935e7..ce590a360454c9 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b14324/repro.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b14324/repro.il @@ -3,6 +3,7 @@ .assembly extern common{} .assembly extern legacy library mscorlib {} .assembly call06{} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit LocallocTest extends [mscorlib]System.Object @@ -10,6 +11,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 11 .locals (int32* intArray1, diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b102518/hole.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b102518/hole.il index e1f7eb46e8818e..9ebf0969e6a534 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b102518/hole.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b102518/hole.il @@ -13,6 +13,7 @@ .ver 4:0:0:0 } .assembly hole {} +.assembly extern xunit.core {} .module hole.exe // MVID: {972ABF67-C385-44E6-B525-571BCCECC13C} .imagebase 0x00400000 @@ -30,6 +31,9 @@ .field public static int32 x .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 115 (0x73) .maxstack 10 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b102844/tailcallcalli.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b102844/tailcallcalli.il index 5f16cb5d660490..458cee9fae1677 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b102844/tailcallcalli.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b102844/tailcallcalli.il @@ -20,6 +20,7 @@ { .ver 0:0:0:0 } +.assembly extern xunit.core {} .module bug.exe // MVID: {643CA244-98FB-40AF-A64C-CDBA1F121F03} .imagebase 0x00400000 @@ -86,6 +87,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 17 (0x11) .maxstack 4 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b12011/test_08.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b12011/test_08.il index 47b1af83ced2e9..823bdd4dc0ccf2 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b12011/test_08.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b12011/test_08.il @@ -3,6 +3,7 @@ .assembly extern mscorlib{} .assembly attrib014_2{} +.assembly extern xunit.core {} .module attrib014_2.exe .class private auto ansi import beforefieldinit ShellApplication @@ -18,6 +19,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b14355/call01.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b14355/call01.il index 6508b691ae79fb..36aa6bafd64cec 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b14355/call01.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b14355/call01.il @@ -24,6 +24,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module call01.exe .custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) .imagebase 0x00400000 @@ -38,6 +39,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 .locals (uint64 V_0, diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b14366/bug2.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b14366/bug2.il index 2d905fcc400546..0c6433cc71afac 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b14366/bug2.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b14366/bug2.il @@ -8,10 +8,14 @@ .ver 4:0:0:0 } .assembly ILGEN_0xf14ee849 {} +.assembly extern xunit.core {} .class ILGEN_0xf14ee849 { .method static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 9 ldc.i8 15 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b14369/bug5.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b14369/bug5.il index 91f14397274994..03dc81fc6cff2f 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b14369/bug5.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b14369/bug5.il @@ -8,9 +8,13 @@ .ver 4:0:0:0 } .assembly ILGEN_0xa2df15de {} +.assembly extern xunit.core {} .class ILGEN_0xa2df15de { .field static native int[] field_0x0 .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .locals init (native int[] LOCAL_0x2,float32 LOCAL_0x17,object LOCAL_0x19) diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b16198/decm010.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b16198/decm010.il index d42f5ff5ddf4bd..4c5ae7f2d8c21d 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b16198/decm010.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b16198/decm010.il @@ -8,11 +8,15 @@ .ver 4:0:0:0 } .assembly decm010 {} +.assembly extern xunit.core {} .class public auto ansi beforefieldinit MyClass extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 47 (0x2f) .maxstack 6 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b16224/test_25.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b16224/test_25.il index 25277245fa5696..766dcb6550a529 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b16224/test_25.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b16224/test_25.il @@ -3,6 +3,7 @@ .assembly extern mscorlib{} .assembly jumper{} +.assembly extern xunit.core {} .class private sequential ansi sealed beforefieldinit VT extends [mscorlib]System.ValueType @@ -12,6 +13,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint ldc.i4 100 ret diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b17023/test1a.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b17023/test1a.il index 7463e18d4ed331..5b4ba3aed018a8 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b17023/test1a.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b17023/test1a.il @@ -25,6 +25,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module test.exe // MVID: {268B9244-26E3-4F41-AE49-5311347AFB4B} .imagebase 0x00400000 @@ -67,6 +68,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init( valuetype Struct1 MYSTRUCT) // Code size 18 (0x12) diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b17751/bug4.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b17751/bug4.il index 79469aaedbd010..b2eadf1fc46002 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b17751/bug4.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b17751/bug4.il @@ -8,10 +8,14 @@ .ver 4:0:0:0 } .assembly ILGEN_0xd3a45436 {} +.assembly extern xunit.core {} .class ILGEN_0xd3a45436 { .method static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 17 ldc.i4.4 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b17904/test.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b17904/test.il index 3f1e109d63063d..e69373341be5f3 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b17904/test.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b17904/test.il @@ -25,6 +25,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module test.exe // MVID: {268B9244-26E3-4F41-AE49-5311347AFB4B} .imagebase 0x00400000 @@ -74,6 +75,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 18 (0x12) .maxstack 2 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b19101/test_01.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b19101/test_01.il index 66b2b279faf4c2..f8c7e53130cdae 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b19101/test_01.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b19101/test_01.il @@ -8,11 +8,15 @@ } .assembly extern mscorlib{} .assembly double_ulong_e_1{} +.assembly extern xunit.core {} .class public auto ansi beforefieldinit Driver extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint ldc.r8 1. diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b19289/test_09.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b19289/test_09.il index d72b7ce9127f93..b9dddadef53f66 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b19289/test_09.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b19289/test_09.il @@ -8,12 +8,16 @@ } .assembly extern mscorlib{} .assembly decm014{} +.assembly extern xunit.core {} .class public auto ansi beforefieldinit MyClass extends [mscorlib]System.Object { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (float32) ldc.r4 7.9999996e+028 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b22521/branch_06.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b22521/branch_06.il index f5b7a1badb32c8..8abf433f3ef3ec 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b22521/branch_06.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b22521/branch_06.il @@ -3,12 +3,16 @@ .assembly extern mscorlib{} .assembly test{} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit test extends [mscorlib]System.Object { .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b22680/1.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b22680/1.il index dcb75be79aff5f..04ce939528a85c 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b22680/1.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b22680/1.il @@ -8,8 +8,12 @@ .ver 4:0:0:0 } .assembly ILGEN_0x5f95bcd2 {} +.assembly extern xunit.core {} .class ILGEN_0x5f95bcd2 { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 21 .zeroinit diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b27077/Negative001.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b27077/Negative001.il index bfd0a08b426415..7c5ee09188ede6 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b27077/Negative001.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b27077/Negative001.il @@ -8,6 +8,7 @@ } .assembly extern mscorlib {} .assembly Negative001 {} +.assembly extern xunit.core {} .class public auto ansi beforefieldinit GenBase<([mscorlib]System.Object) T> extends [mscorlib]System.Object { @@ -171,6 +172,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (int32 V_0) diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b28158/test.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b28158/test.il index dd9a1364aafd50..155559ef00737b 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b28158/test.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b28158/test.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly test {} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit test @@ -15,6 +16,9 @@ { .method public static int32 Main() cil managed { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .try diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b28158/test64.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b28158/test64.il index 9ac3ff6e7ffccb..3db875af5f3393 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b28158/test64.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b28158/test64.il @@ -8,6 +8,7 @@ .ver 4:0:0:0 } .assembly test {} +.assembly extern xunit.core {} .class private auto ansi beforefieldinit test @@ -15,6 +16,9 @@ { .method public static int32 Main() cil managed { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .try diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b29727/2.il b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b29727/2.il index 4d0fa3e8ce48f3..f5b6c21959397e 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b29727/2.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b29727/2.il @@ -8,10 +8,14 @@ .ver 4:0:0:0 } .assembly ILGEN_0xb8267005 {} +.assembly extern xunit.core {} .class ILGEN_0xb8267005 { .field static float64 field_0x2 .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 19 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b309576/bug2.il b/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b309576/bug2.il index 1f6be9d912aa7a..a4cb71fd14db4f 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b309576/bug2.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b309576/bug2.il @@ -8,6 +8,7 @@ } .assembly Test1 {} +.assembly extern xunit.core {} .assembly extern mscorlib{auto} .class FullProof { .method static int32 Test() { @@ -516,6 +517,9 @@ IL_500: ret // .method public static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 3 .try diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b333008/b333008.il b/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b333008/b333008.il index 836d2250b410fc..8e770bab452336 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b333008/b333008.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b333008/b333008.il @@ -23,6 +23,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module foo.exe // MVID: {71EBFD38-3F6F-4607-8A53-CC82B4C15BE3} .imagebase 0x00400000 @@ -41,6 +42,9 @@ .field public static int32 x .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 11 (0xb) .maxstack 2 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b356258/b356258.il b/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b356258/b356258.il index 1b6c2f18a114c6..f71bb24a619887 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b356258/b356258.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b356258/b356258.il @@ -23,6 +23,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module foo.exe // MVID: {3C4B1460-B1C6-4337-8B12-587C5269CE8D} .imagebase 0x00400000 @@ -40,6 +41,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 7 (0x7) .maxstack 8 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b410474/b410474.il b/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b410474/b410474.il index 8afdb7c773ec07..5d627ebed7ea3a 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b410474/b410474.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b410474/b410474.il @@ -8,6 +8,7 @@ } .assembly extern mscorlib{} .assembly b410474{} +.assembly extern xunit.core {} .class public A{.method static void V1() {.maxstack 50 ldsfld int8 [b410474]A::a0100 ldc.i4 0 @@ -241,6 +242,9 @@ throw a0104: ret} .method static int32 Main(string[] args){.entrypoint .maxstack 5 +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) call void [b410474]A::V1() call void [b410474]A::V2() call void [b410474]A::V3() diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b431098/b431098.il b/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b431098/b431098.il index 029dffa91a7684..aaae03d8dc61ed 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b431098/b431098.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b431098/b431098.il @@ -11,12 +11,16 @@ { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) } +.assembly extern xunit.core {} .class private auto ansi beforefieldinit Test_b431098 extends [mscorlib]System.Object { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-RTM/b460385/b460385.il b/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-RTM/b460385/b460385.il index ab8e327610e5fa..f5bcff056f687d 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-RTM/b460385/b460385.il +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V2.0-RTM/b460385/b460385.il @@ -9,6 +9,7 @@ .assembly Test1 {} +.assembly extern xunit.core {} .assembly extern mscorlib{auto} .class FullProof { @@ -69,6 +70,9 @@ IL_47: ret // .method public static int32 Main() {.entrypoint +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .maxstack 3 call int32 FullProof::Test() diff --git a/src/tests/JIT/Regression/clr-x64-JIT/v2.1/b173569/b173569.il b/src/tests/JIT/Regression/clr-x64-JIT/v2.1/b173569/b173569.il index 2fb9f91b5ffab0..5f2ac9b0f46eb0 100644 --- a/src/tests/JIT/Regression/clr-x64-JIT/v2.1/b173569/b173569.il +++ b/src/tests/JIT/Regression/clr-x64-JIT/v2.1/b173569/b173569.il @@ -27,6 +27,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module ddb173569.exe // MVID: {0019E28F-AD1E-40AC-B6B2-5554D213CAAE} .imagebase 0x00400000 @@ -76,6 +77,9 @@ } .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 27 (0x1b) .maxstack 3 diff --git a/src/tests/JIT/Regression/clr-x64-JIT/v4.0/b602182/b602182.il b/src/tests/JIT/Regression/clr-x64-JIT/v4.0/b602182/b602182.il index 7f28e4b5e0b446..3f34ad40ccac63 100644 --- a/src/tests/JIT/Regression/clr-x64-JIT/v4.0/b602182/b602182.il +++ b/src/tests/JIT/Regression/clr-x64-JIT/v4.0/b602182/b602182.il @@ -6,6 +6,7 @@ .assembly ILGEN_0xad4651aa {} +.assembly extern xunit.core {} .assembly extern mscorlib{auto} .class ILGEN_0xad4651aa { @@ -902,6 +903,9 @@ conv.i1 ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 27 ldc.r8 float64(0x875047a061a1b7f) diff --git a/src/tests/JIT/Regression/v4/dev10_804810/dev10_804810.il b/src/tests/JIT/Regression/v4/dev10_804810/dev10_804810.il index b83325b785a03a..6ff191b3742bab 100644 --- a/src/tests/JIT/Regression/v4/dev10_804810/dev10_804810.il +++ b/src/tests/JIT/Regression/v4/dev10_804810/dev10_804810.il @@ -22,6 +22,7 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } +.assembly extern xunit.core {} .module TestCase.exe // MVID: {3357017E-FF15-4114-B1F9-AB857327E8CC} .imagebase 0x00400000 @@ -173,6 +174,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 44 (0x2c) .maxstack 4 diff --git a/src/tests/JIT/SIMD/Vector3TestNative.cpp b/src/tests/JIT/SIMD/Vector3TestNative.cpp index bad17072320ba7..2a41c39da4e005 100644 --- a/src/tests/JIT/SIMD/Vector3TestNative.cpp +++ b/src/tests/JIT/SIMD/Vector3TestNative.cpp @@ -3,6 +3,7 @@ #include #include +#include #if defined(__GNUC__) #define EXPORT(type) extern "C" __attribute__((visibility("default"))) type @@ -20,30 +21,26 @@ #endif // !__i386__ #endif // !defined(_MSC_VER) -#ifndef _countof -#define _countof(_array) (sizeof(_array)/sizeof(_array[0])) -#endif - #ifdef _MSC_VER #define CALLBACK __stdcall #else // _MSC_VER #define CALLBACK #endif // !_MSC_VER -typedef struct _Vector3 +typedef struct _Vector3 { float x; float y; - float z; + float z; } Vector3; -typedef struct _DT +typedef struct _DT { Vector3 a; Vector3 b; -} DT; +} DT; -typedef struct _ComplexDT +typedef struct _ComplexDT { int iv; DT vecs; @@ -55,7 +52,7 @@ typedef struct _ComplexDT // PInvoke native call for Vector3 size check // -EXPORT(int) __stdcall nativeCall_PInvoke_CheckVector3Size() +EXPORT(int) __stdcall nativeCall_PInvoke_CheckVector3Size() { printf("nativeCall_PInvoke_CheckVector3Size: sizeof(Vector3) == %d\n", (int)sizeof(Vector3)); fflush(stdout); @@ -66,7 +63,7 @@ EXPORT(int) __stdcall nativeCall_PInvoke_CheckVector3Size() // PInvoke native call for Vector3 argument // -EXPORT(float) __stdcall nativeCall_PInvoke_Vector3Arg(int i, Vector3 v1, char* s, Vector3 v2) +EXPORT(float) __stdcall nativeCall_PInvoke_Vector3Arg(int i, Vector3 v1, char* s, Vector3 v2) { float sum0 = v1.x + v1.y + v1.z; float sum1 = v2.x + v2.y + v2.z; @@ -78,7 +75,7 @@ EXPORT(float) __stdcall nativeCall_PInvoke_Vector3Arg(int i, Vector3 v1, char* s fflush(stdout); if ((strncmp(s, "abcdefg", strnlen(s, 32)) != 0) || i != 123) { return 0; - } + } return sum0 + sum1; } @@ -86,7 +83,7 @@ EXPORT(float) __stdcall nativeCall_PInvoke_Vector3Arg(int i, Vector3 v1, char* s // PInvoke native call for Vector3 argument // EXPORT(float) __stdcall nativeCall_PInvoke_Vector3Arg_Unix( - Vector3 v3f32_xmm0, + Vector3 v3f32_xmm0, float f32_xmm2, float f32_xmm3, float f32_xmm4, @@ -105,28 +102,28 @@ EXPORT(float) __stdcall nativeCall_PInvoke_Vector3Arg_Unix( printf(" f32_mem0: %f\n", f32_mem0); printf(" v3f32_mem1: %f %f %f\n", v3f32_mem1.x, v3f32_mem1.y, v3f32_mem1.z); printf(" f32_mem2-3: %f %f\n", f32_mem2, f32_mem3); - + // sum = 1 + 2 + 3 - // + 100 + 101 + 102 + 103 + 104 + 105 + 106 + // + 100 + 101 + 102 + 103 + 104 + 105 + 106 // + 10 + 20 + 30 // + 107 + 108 // = 1002 float sum = v3f32_xmm0.x + v3f32_xmm0.y + v3f32_xmm0.z - + f32_xmm2 + f32_xmm3 + f32_xmm4 + f32_xmm5 + f32_xmm6 + f32_xmm7 + f32_mem0 + + + f32_xmm2 + f32_xmm3 + f32_xmm4 + f32_xmm5 + f32_xmm6 + f32_xmm7 + f32_mem0 + + v3f32_mem1.x + v3f32_mem1.y + v3f32_mem1.z + f32_mem2 + f32_mem3; - + printf(" sum = %f\n", sum); - + return sum; -} +} // // PInvoke native call for Vector3 argument // EXPORT(float) __stdcall nativeCall_PInvoke_Vector3Arg_Unix2( - Vector3 v3f32_xmm0, + Vector3 v3f32_xmm0, float f32_xmm2, float f32_xmm3, float f32_xmm4, @@ -142,39 +139,39 @@ EXPORT(float) __stdcall nativeCall_PInvoke_Vector3Arg_Unix2( { printf("nativeCall_PInvoke_Vector3Arg_Unix2:\n"); printf(" v3f32_xmm0: %f %f %f\n", v3f32_xmm0.x, v3f32_xmm0.y, v3f32_xmm0.z); - printf(" f32_xmm2 - f32_xmm7: %f %f %f %f %f %f\n", + printf(" f32_xmm2 - f32_xmm7: %f %f %f %f %f %f\n", f32_xmm2, f32_xmm3, f32_xmm4, f32_xmm5, f32_xmm6, f32_xmm7); printf(" f32_mem0: %f\n", f32_mem0); printf(" v3f32_mem1: %f %f %f\n", v3f32_mem1.x, v3f32_mem1.y, v3f32_mem1.z); printf(" f32_mem2-3: %f %f\n", f32_mem2, f32_mem3); printf(" v3f32_mem4: %f %f %f\n", v3f32_mem4.x, v3f32_mem4.y, v3f32_mem4.z); printf(" f32_mem5: %f\n", f32_mem5); - - // sum = 1 + 2 + 3 + - // + 100 + 101 + 102 + 103 + 104 + 105 + 106 + + // sum = 1 + 2 + 3 + + // + 100 + 101 + 102 + 103 + 104 + 105 + 106 // + 4 + 5 + 6 // + 107 + 108 // + 7 + 8 + 9 // + 109 // = 6 + 15 + 24 + 1045 = 1090 float sum = v3f32_xmm0.x + v3f32_xmm0.y + v3f32_xmm0.z - + f32_xmm2 + f32_xmm3 + f32_xmm4 + f32_xmm5 + f32_xmm6 + f32_xmm7 + f32_mem0 + + + f32_xmm2 + f32_xmm3 + f32_xmm4 + f32_xmm5 + f32_xmm6 + f32_xmm7 + f32_mem0 + + v3f32_mem1.x + v3f32_mem1.y + v3f32_mem1.z + f32_mem2 + f32_mem3 + v3f32_mem4.x + v3f32_mem4.y + v3f32_mem4.z + f32_mem5; - + printf(" sum = %f\n", sum); - + return sum; -} +} // // PInvoke native call for Vector3 argument // -EXPORT(Vector3) __stdcall nativeCall_PInvoke_Vector3Ret() +EXPORT(Vector3) __stdcall nativeCall_PInvoke_Vector3Ret() { Vector3 ret; ret.x = 1; @@ -192,11 +189,11 @@ EXPORT(Vector3) __stdcall nativeCall_PInvoke_Vector3Ret() // PInvoke native call for Vector3 array // -EXPORT(float) __stdcall nativeCall_PInvoke_Vector3Array(Vector3* arr) +EXPORT(float) __stdcall nativeCall_PInvoke_Vector3Array(Vector3* arr) { float sum = 0.0; printf("nativeCall_PInvoke_Vector3Array\n"); - for (unsigned i = 0; i < 2; ++i) + for (unsigned i = 0; i < 2; ++i) { Vector3* e = &arr[i]; printf(" arrEle[%d]: %f %f %f\n", i, e->x, e->y, e->z); @@ -211,7 +208,7 @@ EXPORT(float) __stdcall nativeCall_PInvoke_Vector3Array(Vector3* arr) // PInvoke native call for Vector3 in struct // -EXPORT(DT) __stdcall nativeCall_PInvoke_Vector3InStruct(DT data) +EXPORT(DT) __stdcall nativeCall_PInvoke_Vector3InStruct(DT data) { printf("nativeCall_PInvoke_Vector3InStruct\n"); DT ret; @@ -221,9 +218,9 @@ EXPORT(DT) __stdcall nativeCall_PInvoke_Vector3InStruct(DT data) ret.b.x = data.b.x + 1; ret.b.y = data.b.y + 1; ret.b.z = data.b.z + 1; - printf(" First struct memeber: (%f %f %f) -> (%f %f %f)\n", + printf(" First struct memeber: (%f %f %f) -> (%f %f %f)\n", data.a.x, data.a.y, data.a.z, ret.a.x, ret.a.y, ret.a.z); - printf(" Second struct member: (%f %f %f) -> (%f %f %f)\n", + printf(" Second struct member: (%f %f %f) -> (%f %f %f)\n", data.b.x, data.b.y, data.b.z, ret.b.x, ret.b.y, ret.b.z); float sum = ret.a.x + ret.a.y + ret.a.z + ret.b.x + ret.b.y + ret.b.z; printf(" Sum of all return scalar values = %f\n", sum); @@ -235,14 +232,14 @@ EXPORT(DT) __stdcall nativeCall_PInvoke_Vector3InStruct(DT data) // PInvoke native call for Vector3 in complex struct // -EXPORT(void) __stdcall nativeCall_PInvoke_Vector3InComplexStruct(ComplexDT* arg) +EXPORT(void) __stdcall nativeCall_PInvoke_Vector3InComplexStruct(ComplexDT* arg) { printf("nativeCall_PInvoke_Vector3InComplexStruct\n"); printf(" Arg ival: %d\n", arg->iv); printf(" Arg Vector3 v1: (%f %f %f)\n", arg->vecs.a.x, arg->vecs.a.y, arg->vecs.a.z); printf(" Arg Vector3 v2: (%f %f %f)\n", arg->vecs.b.x, arg->vecs.b.y, arg->vecs.b.z); printf(" Arg Vector3 v3: (%f %f %f)\n", arg->v3.x, arg->v3.y, arg->v3.z); - printf(" Arg string arg: %s\n", arg->str); + printf(" Arg string arg: %s\n", arg->str); arg->vecs.a.x = arg->vecs.a.x + 1; arg->vecs.a.y = arg->vecs.a.y + 1; @@ -252,22 +249,22 @@ EXPORT(void) __stdcall nativeCall_PInvoke_Vector3InComplexStruct(ComplexDT* arg) arg->vecs.b.z = arg->vecs.b.z + 1; arg->v3.x = arg->v3.x + 1; arg->v3.y = arg->v3.y + 1; - arg->v3.z = arg->v3.z + 1; + arg->v3.z = arg->v3.z + 1; arg->iv = arg->iv + 1; - snprintf(arg->str, _countof(arg->str), "%s", "ret_string"); - + snprintf(arg->str, ARRAY_SIZE(arg->str), "%s", "ret_string"); + printf(" Return ival: %d\n", arg->iv); printf(" Return Vector3 v1: (%f %f %f)\n", arg->vecs.a.x, arg->vecs.a.y, arg->vecs.a.z); printf(" Return Vector3 v2: (%f %f %f)\n", arg->vecs.b.x, arg->vecs.b.y, arg->vecs.b.z); printf(" Return Vector3 v3: (%f %f %f)\n", arg->v3.x, arg->v3.y, arg->v3.z); - printf(" Return string arg: %s\n", arg->str); - float sum = arg->vecs.a.x + arg->vecs.a.y + arg->vecs.a.z + printf(" Return string arg: %s\n", arg->str); + float sum = arg->vecs.a.x + arg->vecs.a.y + arg->vecs.a.z + arg->vecs.b.x + arg->vecs.b.y + arg->vecs.b.z + arg->v3.x + arg->v3.y + arg->v3.z; printf(" Sum of all return float scalar values = %f\n", sum); - fflush(stdout); + fflush(stdout); } - + // // RPInvoke native call for Vector3 argument // @@ -277,13 +274,13 @@ typedef void (CALLBACK *CallBack_RPInvoke_Vector3Arg)(int i, Vector3 v1, char* s EXPORT(void) __stdcall nativeCall_RPInvoke_Vector3Arg( CallBack_RPInvoke_Vector3Arg notify) { - int i = 123; + int i = 123; const static char* str = "abcdefg"; Vector3 v1, v2; v1.x = 1; v1.y = 2; v1.z = 3; v2.x = 10; v2.y = 20; v2.z = 30; notify(i, v1, (char*)str, v2); -} +} @@ -291,7 +288,7 @@ EXPORT(void) __stdcall nativeCall_RPInvoke_Vector3Arg( // RPInvoke native call for Vector3 argument // typedef void (CALLBACK *CallBack_RPInvoke_Vector3Arg_Unix)( - Vector3 v3f32_xmm0, + Vector3 v3f32_xmm0, float f32_xmm2, float f32_xmm3, float f32_xmm4, @@ -312,12 +309,12 @@ EXPORT(void) __stdcall nativeCall_RPInvoke_Vector3Arg_Unix( v2.x = 10; v2.y = 20; v2.z = 30; float f0 = 100, f1 = 101, f2 = 102, f3 = 103, f4 = 104, f5 = 105, f6 = 106, f7 = 107, f8 = 108; notify( - v1, + v1, f0, f1, f2, f3, f4, f5, f6, // mapped onto stack - v2, + v2, f7, f8); -} +} @@ -325,7 +322,7 @@ EXPORT(void) __stdcall nativeCall_RPInvoke_Vector3Arg_Unix( // RPInvoke native call for Vector3 argument // typedef void (CALLBACK *CallBack_RPInvoke_Vector3Arg_Unix2)( - Vector3 v3f32_xmm0, + Vector3 v3f32_xmm0, float f32_xmm2, float f32_xmm3, float f32_xmm4, @@ -349,14 +346,14 @@ EXPORT(void) __stdcall nativeCall_RPInvoke_Vector3Arg_Unix2( v3.x = 7; v3.y = 8; v3.z = 9; float f0 = 100, f1 = 101, f2 = 102, f3 = 103, f4 = 104, f5 = 105, f6 = 106, f7 = 107, f8 = 108, f9 = 109; notify( - v1, + v1, f0, f1, f2, f3, f4, f5, f6, // mapped onto stack - v2, + v2, f7, f8, v3, f9); -} +} // @@ -376,7 +373,7 @@ EXPORT(bool) __stdcall nativeCall_RPInvoke_Vector3Ret( return true; } return false; -} +} // // RPInvoke native call for Vector3 array @@ -387,7 +384,7 @@ typedef void (CALLBACK *CallBack_RPInvoke_Vector3Array)(Vector3* v, int size); static Vector3 arr[2]; EXPORT(void) __stdcall nativeCall_RPInvoke_Vector3Array( - CallBack_RPInvoke_Vector3Array notify, + CallBack_RPInvoke_Vector3Array notify, int a) { arr[0].x = a + 1.0f; @@ -397,7 +394,7 @@ EXPORT(void) __stdcall nativeCall_RPInvoke_Vector3Array( arr[1].y = a + 20.0f; arr[1].z = a + 30.0f; notify(arr, 2); -} +} // // RPInvoke native call for Vector3-in-struct test @@ -408,7 +405,7 @@ typedef void (CALLBACK *CallBack_RPInvoke_Vector3InStruct)(DT v); static DT v; EXPORT(void) __stdcall nativeCall_RPInvoke_Vector3InStruct( - CallBack_RPInvoke_Vector3InStruct notify, + CallBack_RPInvoke_Vector3InStruct notify, int a) { v.a.x = a + 1.0f; @@ -431,28 +428,28 @@ EXPORT(bool) __stdcall nativeCall_RPInvoke_Vector3InComplexStruct( { static ComplexDT cdt; cdt.iv = 99; - snprintf(cdt.str, _countof("arg_string"), "%s", "arg_string"); + snprintf(cdt.str, ARRAY_SIZE("arg_string"), "%s", "arg_string"); cdt.vecs.a.x = 1; cdt.vecs.a.y = 2; cdt.vecs.a.z = 3; cdt.vecs.b.x = 5; cdt.vecs.b.y = 6; cdt.vecs.b.z = 7; - cdt.v3.x = 10; cdt.v3.y = 20; cdt.v3.z = 30; - + cdt.v3.x = 10; cdt.v3.y = 20; cdt.v3.z = 30; + notify(&cdt); - + printf(" Native ival: %d\n", cdt.iv); printf(" Native Vector3 v1: (%f %f %f)\n", cdt.vecs.a.x, cdt.vecs.a.y, cdt.vecs.a.z); printf(" Native Vector3 v2: (%f %f %f)\n", cdt.vecs.b.x, cdt.vecs.b.y, cdt.vecs.b.z); printf(" Native Vector3 v3: (%f %f %f)\n", cdt.v3.x, cdt.v3.y, cdt.v3.z); - printf(" Native string arg: %s\n", cdt.str); + printf(" Native string arg: %s\n", cdt.str); fflush(stdout); - + // Expected return value = 2 + 3 + 4 + 6 + 7 + 8 + 11 + 12 + 13 = 93 float sum = cdt.vecs.a.x + cdt.vecs.a.y + cdt.vecs.a.z - + cdt.vecs.b.x + cdt.vecs.b.y + cdt.vecs.b.z + + cdt.vecs.b.x + cdt.vecs.b.y + cdt.vecs.b.z + cdt.v3.x + cdt.v3.y + cdt.v3.z; - + if ((sum != 93) || (cdt.iv != 100) || (strcmp(cdt.str, "ret_string")!=0) ) { - return false; - } + return false; + } return true; } diff --git a/src/tests/JIT/jit64/eh/basics/throwisfirstinstruction.il b/src/tests/JIT/jit64/eh/basics/throwisfirstinstruction.il index 7f1bb7eefea194..e1138aa44e7737 100644 --- a/src/tests/JIT/jit64/eh/basics/throwisfirstinstruction.il +++ b/src/tests/JIT/jit64/eh/basics/throwisfirstinstruction.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly extern common {} .assembly test {} @@ -38,6 +39,9 @@ .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint ldsfld class [common]TestUtil.TestLog test::testLog diff --git a/src/tests/JIT/jit64/localloc/call/call05_dynamic.il b/src/tests/JIT/jit64/localloc/call/call05_dynamic.il index 38c4596b9de3a6..c255270b2bddfb 100644 --- a/src/tests/JIT/jit64/localloc/call/call05_dynamic.il +++ b/src/tests/JIT/jit64/localloc/call/call05_dynamic.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly call05{} @@ -17,6 +18,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 11 .locals (int32* intArray1, diff --git a/src/tests/JIT/jit64/localloc/call/call05_large.il b/src/tests/JIT/jit64/localloc/call/call05_large.il index cafc142b08294f..19fc4e65c39460 100644 --- a/src/tests/JIT/jit64/localloc/call/call05_large.il +++ b/src/tests/JIT/jit64/localloc/call/call05_large.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly call05{} @@ -16,6 +17,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 11 .locals (int32* intArray1, diff --git a/src/tests/JIT/jit64/localloc/call/call05_small.il b/src/tests/JIT/jit64/localloc/call/call05_small.il index a1b211c6bf98dd..d80856db385dff 100644 --- a/src/tests/JIT/jit64/localloc/call/call05_small.il +++ b/src/tests/JIT/jit64/localloc/call/call05_small.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly call05{} @@ -16,6 +17,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 11 .locals (int32* intArray1, diff --git a/src/tests/JIT/jit64/localloc/call/call07_dynamic.il b/src/tests/JIT/jit64/localloc/call/call07_dynamic.il index 32fb99b3095e74..1d7f16f1b2e0bd 100644 --- a/src/tests/JIT/jit64/localloc/call/call07_dynamic.il +++ b/src/tests/JIT/jit64/localloc/call/call07_dynamic.il @@ -5,6 +5,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly call07{} @@ -15,6 +16,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 .locals (unsigned int64 local1, diff --git a/src/tests/JIT/jit64/localloc/call/call07_small.il b/src/tests/JIT/jit64/localloc/call/call07_small.il index e1ea33e1ebcdaf..b7d5ab5223ac0b 100644 --- a/src/tests/JIT/jit64/localloc/call/call07_small.il +++ b/src/tests/JIT/jit64/localloc/call/call07_small.il @@ -5,6 +5,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly call07{} @@ -15,6 +16,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 .locals (unsigned int64 local1, diff --git a/src/tests/JIT/jit64/localloc/eh/eh03_dynamic.il b/src/tests/JIT/jit64/localloc/eh/eh03_dynamic.il index 64eeefaeb4953b..9daa299698651f 100644 --- a/src/tests/JIT/jit64/localloc/eh/eh03_dynamic.il +++ b/src/tests/JIT/jit64/localloc/eh/eh03_dynamic.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common {} .assembly eh03{} @@ -17,6 +18,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (bool testPassed, diff --git a/src/tests/JIT/jit64/localloc/eh/eh03_large.il b/src/tests/JIT/jit64/localloc/eh/eh03_large.il index e364873e3a64d7..773951577a4b3f 100644 --- a/src/tests/JIT/jit64/localloc/eh/eh03_large.il +++ b/src/tests/JIT/jit64/localloc/eh/eh03_large.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common {} .assembly eh03{} @@ -17,6 +18,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (bool testPassed, diff --git a/src/tests/JIT/jit64/localloc/eh/eh03_small.il b/src/tests/JIT/jit64/localloc/eh/eh03_small.il index 2c3b05ce65ed7b..150e3d0cc47f23 100644 --- a/src/tests/JIT/jit64/localloc/eh/eh03_small.il +++ b/src/tests/JIT/jit64/localloc/eh/eh03_small.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common {} .assembly eh03{} @@ -17,6 +18,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (bool testPassed, diff --git a/src/tests/JIT/jit64/localloc/eh/eh04_dynamic.il b/src/tests/JIT/jit64/localloc/eh/eh04_dynamic.il index 30e47e430ae67f..f2b0f8456477f7 100644 --- a/src/tests/JIT/jit64/localloc/eh/eh04_dynamic.il +++ b/src/tests/JIT/jit64/localloc/eh/eh04_dynamic.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly eh03{} @@ -16,6 +17,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (bool testPassed, diff --git a/src/tests/JIT/jit64/localloc/eh/eh04_large.il b/src/tests/JIT/jit64/localloc/eh/eh04_large.il index cf96d23ff93036..584f4db66bd77a 100644 --- a/src/tests/JIT/jit64/localloc/eh/eh04_large.il +++ b/src/tests/JIT/jit64/localloc/eh/eh04_large.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly eh03{} @@ -16,6 +17,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (bool testPassed, diff --git a/src/tests/JIT/jit64/localloc/eh/eh04_small.il b/src/tests/JIT/jit64/localloc/eh/eh04_small.il index 4330db5744a9fd..d33598b21742cd 100644 --- a/src/tests/JIT/jit64/localloc/eh/eh04_small.il +++ b/src/tests/JIT/jit64/localloc/eh/eh04_small.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly eh03{} @@ -16,6 +17,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (bool testPassed, diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh05_dynamic.il b/src/tests/JIT/jit64/localloc/ehverify/eh05_dynamic.il index 115a60494c1114..0db6ea3f45ec91 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh05_dynamic.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh05_dynamic.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} @@ -41,6 +42,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (int32 retValue) diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh05_large.il b/src/tests/JIT/jit64/localloc/ehverify/eh05_large.il index 23df4797f384c2..b0daafa3cfe59c 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh05_large.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh05_large.il @@ -5,6 +5,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly eh05{} @@ -39,6 +40,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (int32 retValue) diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh05_small.il b/src/tests/JIT/jit64/localloc/ehverify/eh05_small.il index 390fff924a363d..01aa29f90b4ae4 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh05_small.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh05_small.il @@ -5,6 +5,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly eh05{} @@ -39,6 +40,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (int32 retValue) diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh06_dynamic.il b/src/tests/JIT/jit64/localloc/ehverify/eh06_dynamic.il index 23735c62e5cafd..548edf5d40d8d7 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh06_dynamic.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh06_dynamic.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} @@ -37,6 +38,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (int32 retValue) diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh06_large.il b/src/tests/JIT/jit64/localloc/ehverify/eh06_large.il index c84af2e9037f7f..e8194f277a15c7 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh06_large.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh06_large.il @@ -5,6 +5,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly eh05{} @@ -35,6 +36,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (int32 retValue) diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh06_small.il b/src/tests/JIT/jit64/localloc/ehverify/eh06_small.il index b90b2154355d4c..cf0f2cef6a18e8 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh06_small.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh06_small.il @@ -5,6 +5,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly eh05{} @@ -35,6 +36,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (int32 retValue) diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh07_dynamic.il b/src/tests/JIT/jit64/localloc/ehverify/eh07_dynamic.il index dcc12ae5defc47..ab15798ce21821 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh07_dynamic.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh07_dynamic.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} @@ -43,6 +44,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (int32 retValue) diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh07_large.il b/src/tests/JIT/jit64/localloc/ehverify/eh07_large.il index 86a280556d702b..b097e5614c3ec7 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh07_large.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh07_large.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} @@ -44,6 +45,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (int32 retValue) diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh07_small.il b/src/tests/JIT/jit64/localloc/ehverify/eh07_small.il index 8328bc557025ea..0bde1fd0678138 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh07_small.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh07_small.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} @@ -41,6 +42,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (int32 retValue) diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh08_dynamic.il b/src/tests/JIT/jit64/localloc/ehverify/eh08_dynamic.il index fb1ecc253384e5..c323b96db2c77e 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh08_dynamic.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh08_dynamic.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} @@ -37,6 +38,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (int32 retValue) diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh08_large.il b/src/tests/JIT/jit64/localloc/ehverify/eh08_large.il index 3c2635bd7acadf..9cc01277ab1028 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh08_large.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh08_large.il @@ -5,6 +5,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly eh05{} @@ -35,6 +36,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (int32 retValue) diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh08_small.il b/src/tests/JIT/jit64/localloc/ehverify/eh08_small.il index 45f41c522f981e..6113ead2f81a10 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh08_small.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh08_small.il @@ -5,6 +5,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly eh05{} @@ -33,6 +34,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init (int32 retValue) diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh11_dynamic.il b/src/tests/JIT/jit64/localloc/ehverify/eh11_dynamic.il index 645e4969cae650..4d7729de437701 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh11_dynamic.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh11_dynamic.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} @@ -17,6 +18,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (bool testPassed, diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh11_large.il b/src/tests/JIT/jit64/localloc/ehverify/eh11_large.il index feb82d8be82ead..18bb06752a6209 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh11_large.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh11_large.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} @@ -17,6 +18,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (bool testPassed, diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh11_small.il b/src/tests/JIT/jit64/localloc/ehverify/eh11_small.il index eff30b3b2753d3..678910f046d3e1 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh11_small.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh11_small.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} @@ -17,6 +18,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (bool testPassed, diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh12_dynamic.il b/src/tests/JIT/jit64/localloc/ehverify/eh12_dynamic.il index 8f5549cffb555a..b29c0441d4ca41 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh12_dynamic.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh12_dynamic.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} @@ -17,6 +18,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (unsigned int64 local1, diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh12_large.il b/src/tests/JIT/jit64/localloc/ehverify/eh12_large.il index a98db00f65d8cb..5ae5fb2063b805 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh12_large.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh12_large.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} @@ -17,6 +18,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (unsigned int64 local1, diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh12_small.il b/src/tests/JIT/jit64/localloc/ehverify/eh12_small.il index 6b6d00f8da9a3d..acc726908f3073 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh12_small.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh12_small.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} @@ -17,6 +18,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (unsigned int64 local1, diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh13_dynamic.il b/src/tests/JIT/jit64/localloc/ehverify/eh13_dynamic.il index f8260c940990f5..756daf24e0ece1 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh13_dynamic.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh13_dynamic.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} @@ -17,6 +18,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (unsigned int64 local1, diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh13_large.il b/src/tests/JIT/jit64/localloc/ehverify/eh13_large.il index 99dd8739184c66..290193803c0308 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh13_large.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh13_large.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} @@ -17,6 +18,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (unsigned int64 local1, diff --git a/src/tests/JIT/jit64/localloc/ehverify/eh13_small.il b/src/tests/JIT/jit64/localloc/ehverify/eh13_small.il index 79ae7d73d7695b..907ede2426bbcb 100644 --- a/src/tests/JIT/jit64/localloc/ehverify/eh13_small.il +++ b/src/tests/JIT/jit64/localloc/ehverify/eh13_small.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} @@ -17,6 +18,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (unsigned int64 local1, diff --git a/src/tests/JIT/jit64/localloc/unwind/unwind04_dynamic.il b/src/tests/JIT/jit64/localloc/unwind/unwind04_dynamic.il index 48c8bd3c7e01e0..3e047e2dac9256 100644 --- a/src/tests/JIT/jit64/localloc/unwind/unwind04_dynamic.il +++ b/src/tests/JIT/jit64/localloc/unwind/unwind04_dynamic.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly unwind03{} @@ -18,6 +19,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (unsigned int64 local1, diff --git a/src/tests/JIT/jit64/localloc/unwind/unwind04_large.il b/src/tests/JIT/jit64/localloc/unwind/unwind04_large.il index 23ca1d74a13c04..26073ea6ed7ebe 100644 --- a/src/tests/JIT/jit64/localloc/unwind/unwind04_large.il +++ b/src/tests/JIT/jit64/localloc/unwind/unwind04_large.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly unwind03{} @@ -18,6 +19,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (unsigned int64 local1, diff --git a/src/tests/JIT/jit64/localloc/unwind/unwind04_small.il b/src/tests/JIT/jit64/localloc/unwind/unwind04_small.il index e5a72db87ca24f..8b11d9fa022db9 100644 --- a/src/tests/JIT/jit64/localloc/unwind/unwind04_small.il +++ b/src/tests/JIT/jit64/localloc/unwind/unwind04_small.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly unwind03{} @@ -18,6 +19,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (unsigned int64 local1, diff --git a/src/tests/JIT/jit64/localloc/unwind/unwind05_dynamic.il b/src/tests/JIT/jit64/localloc/unwind/unwind05_dynamic.il index 9bd3316bf4cff2..138491cc7b8bc0 100644 --- a/src/tests/JIT/jit64/localloc/unwind/unwind05_dynamic.il +++ b/src/tests/JIT/jit64/localloc/unwind/unwind05_dynamic.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly unwind02{} @@ -17,6 +18,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (unsigned int64 local1, diff --git a/src/tests/JIT/jit64/localloc/unwind/unwind05_large.il b/src/tests/JIT/jit64/localloc/unwind/unwind05_large.il index f009b320e9e623..a05b4931b595f1 100644 --- a/src/tests/JIT/jit64/localloc/unwind/unwind05_large.il +++ b/src/tests/JIT/jit64/localloc/unwind/unwind05_large.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly unwind02{} @@ -17,6 +18,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (unsigned int64 local1, diff --git a/src/tests/JIT/jit64/localloc/unwind/unwind05_small.il b/src/tests/JIT/jit64/localloc/unwind/unwind05_small.il index 55f372d900f48f..f261372fe8be9c 100644 --- a/src/tests/JIT/jit64/localloc/unwind/unwind05_small.il +++ b/src/tests/JIT/jit64/localloc/unwind/unwind05_small.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly unwind02{} @@ -17,6 +18,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (unsigned int64 local1, diff --git a/src/tests/JIT/jit64/localloc/unwind/unwind06_dynamic.il b/src/tests/JIT/jit64/localloc/unwind/unwind06_dynamic.il index a1641586ba1c53..039e0032f761af 100644 --- a/src/tests/JIT/jit64/localloc/unwind/unwind06_dynamic.il +++ b/src/tests/JIT/jit64/localloc/unwind/unwind06_dynamic.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly unwind06{} @@ -17,6 +18,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (unsigned int64 local1, diff --git a/src/tests/JIT/jit64/localloc/unwind/unwind06_large.il b/src/tests/JIT/jit64/localloc/unwind/unwind06_large.il index 57c9a928823100..a9957832b14b33 100644 --- a/src/tests/JIT/jit64/localloc/unwind/unwind06_large.il +++ b/src/tests/JIT/jit64/localloc/unwind/unwind06_large.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly unwind06{} @@ -17,6 +18,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (unsigned int64 local1, diff --git a/src/tests/JIT/jit64/localloc/unwind/unwind06_small.il b/src/tests/JIT/jit64/localloc/unwind/unwind06_small.il index 4f60eec33af7c7..8597aea7abd658 100644 --- a/src/tests/JIT/jit64/localloc/unwind/unwind06_small.il +++ b/src/tests/JIT/jit64/localloc/unwind/unwind06_small.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly extern common{} .assembly unwind06{} @@ -17,6 +18,9 @@ .field private static int32 locallocSize .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals (unsigned int64 local1, diff --git a/src/tests/JIT/jit64/localloc/zeroinit/zeroinit01_large.il b/src/tests/JIT/jit64/localloc/zeroinit/zeroinit01_large.il index 67bee9ca9cb1c3..7254f9b8c2c894 100644 --- a/src/tests/JIT/jit64/localloc/zeroinit/zeroinit01_large.il +++ b/src/tests/JIT/jit64/localloc/zeroinit/zeroinit01_large.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} // Test zero initialization of localloc .assembly extern mscorlib{} @@ -17,6 +18,9 @@ .field public static int32 size_to_test .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 79 (0x4f) .maxstack 3 diff --git a/src/tests/JIT/jit64/localloc/zeroinit/zeroinit01_small.il b/src/tests/JIT/jit64/localloc/zeroinit/zeroinit01_small.il index 34666e7a5c7532..c39c8f76c846e6 100644 --- a/src/tests/JIT/jit64/localloc/zeroinit/zeroinit01_small.il +++ b/src/tests/JIT/jit64/localloc/zeroinit/zeroinit01_small.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} // Test zero initialization of localloc .assembly extern mscorlib{} @@ -17,6 +18,9 @@ .field public static int32 size_to_test .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 79 (0x4f) .maxstack 3 diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i00.il b/src/tests/JIT/jit64/mcc/interop/mcc_i00.il index e0a27e55eb78c3..56f2c9574cb290 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i00.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i00.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -19,6 +20,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i01.il b/src/tests/JIT/jit64/mcc/interop/mcc_i01.il index 921c619ceb21bd..47c1ed5fd8409c 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i01.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i01.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -19,6 +20,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i02.il b/src/tests/JIT/jit64/mcc/interop/mcc_i02.il index ef223ed4515fc8..54a186aa924f42 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i02.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i02.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -61,6 +62,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i03.il b/src/tests/JIT/jit64/mcc/interop/mcc_i03.il index 9382602ad77cc5..5caa0c42870fd3 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i03.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i03.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -65,6 +66,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i04.il b/src/tests/JIT/jit64/mcc/interop/mcc_i04.il index 65caa0193f4ef7..b7b8b693b2c8dc 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i04.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i04.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -19,6 +20,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i05.il b/src/tests/JIT/jit64/mcc/interop/mcc_i05.il index f9432a1d66ec59..fddce8de2564aa 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i05.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i05.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -19,6 +20,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i06.il b/src/tests/JIT/jit64/mcc/interop/mcc_i06.il index 11b397f0ea1d62..4b359f32a15a9d 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i06.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i06.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -58,6 +59,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i07.il b/src/tests/JIT/jit64/mcc/interop/mcc_i07.il index ecdc9f046868b1..98501e02310366 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i07.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i07.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -62,6 +63,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i10.il b/src/tests/JIT/jit64/mcc/interop/mcc_i10.il index 12a0bef9c0386a..9219f22ac0adfc 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i10.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i10.il @@ -3,6 +3,7 @@ .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly MCCTest {} .module mcc_i10.exe @@ -17,6 +18,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i11.il b/src/tests/JIT/jit64/mcc/interop/mcc_i11.il index 87642efb5d99a9..80ed3d431d7f79 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i11.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i11.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -19,6 +20,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i12.il b/src/tests/JIT/jit64/mcc/interop/mcc_i12.il index 11cbffaf97ac6f..550bff4f503353 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i12.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i12.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -61,6 +62,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i13.il b/src/tests/JIT/jit64/mcc/interop/mcc_i13.il index 77c0b622b14113..5e28b3306892ab 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i13.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i13.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -65,6 +66,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i14.il b/src/tests/JIT/jit64/mcc/interop/mcc_i14.il index 674bcc18d93cac..ae7d29a82b0105 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i14.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i14.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -19,6 +20,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i15.il b/src/tests/JIT/jit64/mcc/interop/mcc_i15.il index 92ea974f7c4815..f3e35badc39909 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i15.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i15.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -19,6 +20,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i16.il b/src/tests/JIT/jit64/mcc/interop/mcc_i16.il index 60a2cc21d91f73..c2c04dc29ad9f9 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i16.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i16.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -58,6 +59,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i17.il b/src/tests/JIT/jit64/mcc/interop/mcc_i17.il index 6cf8c9dad6ab4a..edf636f268f2b8 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i17.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i17.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -62,6 +63,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i30.il b/src/tests/JIT/jit64/mcc/interop/mcc_i30.il index eabf8c3d705fdc..94d0739ef0df1a 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i30.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i30.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -19,6 +20,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i31.il b/src/tests/JIT/jit64/mcc/interop/mcc_i31.il index b1a5b86d3e27e9..7c5e5d08fb1078 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i31.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i31.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -19,6 +20,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i32.il b/src/tests/JIT/jit64/mcc/interop/mcc_i32.il index d55fe1b7f97604..d5a90ff50c6769 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i32.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i32.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -107,6 +108,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i33.il b/src/tests/JIT/jit64/mcc/interop/mcc_i33.il index 7058532bd4014d..90667335c2a086 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i33.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i33.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -111,6 +112,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i34.il b/src/tests/JIT/jit64/mcc/interop/mcc_i34.il index 02805a92afb94e..abe748c37b526f 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i34.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i34.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -22,6 +23,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i35.il b/src/tests/JIT/jit64/mcc/interop/mcc_i35.il index f9c3fb533eccbd..ba985fe5b41961 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i35.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i35.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -22,6 +23,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i36.il b/src/tests/JIT/jit64/mcc/interop/mcc_i36.il index 5f668dd84a7017..f753508e53fea2 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i36.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i36.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -116,6 +117,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i37.il b/src/tests/JIT/jit64/mcc/interop/mcc_i37.il index 9ff6a1579f3436..11ab5b8fd62511 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i37.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i37.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -126,6 +127,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i50.il b/src/tests/JIT/jit64/mcc/interop/mcc_i50.il index 0d8f010aadf8bd..f01fb0d63aaea2 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i50.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i50.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -19,6 +20,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i51.il b/src/tests/JIT/jit64/mcc/interop/mcc_i51.il index bf201f65909618..ff557cc1a3c438 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i51.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i51.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -19,6 +20,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i52.il b/src/tests/JIT/jit64/mcc/interop/mcc_i52.il index c7ccca96f64268..6c7306a081ce75 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i52.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i52.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -107,6 +108,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i53.il b/src/tests/JIT/jit64/mcc/interop/mcc_i53.il index e35dd531e19ff3..f6ff300b292b7c 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i53.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i53.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -111,6 +112,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i54.il b/src/tests/JIT/jit64/mcc/interop/mcc_i54.il index bde19ac5ecd8ee..081e6481c164ee 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i54.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i54.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -22,6 +23,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i55.il b/src/tests/JIT/jit64/mcc/interop/mcc_i55.il index 7b17fbee4c719c..9c0fc7b17c0290 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i55.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i55.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -22,6 +23,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i56.il b/src/tests/JIT/jit64/mcc/interop/mcc_i56.il index b6db97b0f1d227..33d8208ec46da9 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i56.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i56.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -116,6 +117,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i57.il b/src/tests/JIT/jit64/mcc/interop/mcc_i57.il index d6db39a9197589..7ff97612180228 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i57.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i57.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -126,6 +127,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i60.il b/src/tests/JIT/jit64/mcc/interop/mcc_i60.il index bc662df3ecb239..e16791d0663b96 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i60.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i60.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -19,6 +20,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i61.il b/src/tests/JIT/jit64/mcc/interop/mcc_i61.il index a3ebd09f1c70d8..132edc42205ae2 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i61.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i61.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -19,6 +20,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i62.il b/src/tests/JIT/jit64/mcc/interop/mcc_i62.il index 9dbb6e429310d6..221b383a29600d 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i62.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i62.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -107,6 +108,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i63.il b/src/tests/JIT/jit64/mcc/interop/mcc_i63.il index 91700af7a57446..9142d8ad03093a 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i63.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i63.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -111,6 +112,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i64.il b/src/tests/JIT/jit64/mcc/interop/mcc_i64.il index fe0dc2a85e414f..5d7bf057cc147e 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i64.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i64.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -22,6 +23,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i65.il b/src/tests/JIT/jit64/mcc/interop/mcc_i65.il index c04fc1cfdf5b5f..9c6af51be7baa8 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i65.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i65.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -22,6 +23,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i66.il b/src/tests/JIT/jit64/mcc/interop/mcc_i66.il index 9a98de2f517348..2f51c689ac1bdb 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i66.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i66.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -116,6 +117,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i67.il b/src/tests/JIT/jit64/mcc/interop/mcc_i67.il index d700c19dbe5c3e..f557eef41a3e62 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i67.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i67.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -126,6 +127,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i70.il b/src/tests/JIT/jit64/mcc/interop/mcc_i70.il index 0e60e3483861c3..75c7bc6b25089a 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i70.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i70.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -19,6 +20,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i71.il b/src/tests/JIT/jit64/mcc/interop/mcc_i71.il index 2e9eb03cbeb9e9..9ed1e4f3c624a8 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i71.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i71.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -19,6 +20,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i72.il b/src/tests/JIT/jit64/mcc/interop/mcc_i72.il index 28d4774152c6ef..183103b44d7477 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i72.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i72.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -107,6 +108,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i73.il b/src/tests/JIT/jit64/mcc/interop/mcc_i73.il index 1131f1f4df1d8c..6c644c0d78a0ac 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i73.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i73.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -111,6 +112,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i74.il b/src/tests/JIT/jit64/mcc/interop/mcc_i74.il index 5a8f5363174224..01e18527134b1e 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i74.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i74.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -22,6 +23,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i75.il b/src/tests/JIT/jit64/mcc/interop/mcc_i75.il index 2ee425d8f2c5c6..66aebab7c884ec 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i75.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i75.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -22,6 +23,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i76.il b/src/tests/JIT/jit64/mcc/interop/mcc_i76.il index d27c0f208dc4ba..59eb8539e6410d 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i76.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i76.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -116,6 +117,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i77.il b/src/tests/JIT/jit64/mcc/interop/mcc_i77.il index afe7eb2ba23dc5..59dde5add424c3 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i77.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i77.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -126,6 +127,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i80.il b/src/tests/JIT/jit64/mcc/interop/mcc_i80.il index bb5868ebd3b3ca..96ed924f92587a 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i80.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i80.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -19,6 +20,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i81.il b/src/tests/JIT/jit64/mcc/interop/mcc_i81.il index e7bc913529e4a8..907fca6e9f2340 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i81.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i81.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -19,6 +20,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i82.il b/src/tests/JIT/jit64/mcc/interop/mcc_i82.il index f454801170759a..c48d71f0c9b629 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i82.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i82.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -107,6 +108,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i83.il b/src/tests/JIT/jit64/mcc/interop/mcc_i83.il index d859410e3c10bf..f2e194ad3729ae 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i83.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i83.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -111,6 +112,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i84.il b/src/tests/JIT/jit64/mcc/interop/mcc_i84.il index ef769dd8f8c30e..2883eb41d8d365 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i84.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i84.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -22,6 +23,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i85.il b/src/tests/JIT/jit64/mcc/interop/mcc_i85.il index 0a75eaf66cdb2d..39e997a6a45130 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i85.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i85.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -22,6 +23,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i86.il b/src/tests/JIT/jit64/mcc/interop/mcc_i86.il index efdd7a13ab1ad0..a243df62541b16 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i86.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i86.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -116,6 +117,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/mcc/interop/mcc_i87.il b/src/tests/JIT/jit64/mcc/interop/mcc_i87.il index 9d900cd54063e8..65ee210f372231 100644 --- a/src/tests/JIT/jit64/mcc/interop/mcc_i87.il +++ b/src/tests/JIT/jit64/mcc/interop/mcc_i87.il @@ -3,6 +3,7 @@ .assembly extern System.Runtime.Extensions { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } .assembly MCCTest {} @@ -126,6 +127,9 @@ .method private static int32 Main(string[] args) { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 64 .locals init ( diff --git a/src/tests/JIT/jit64/opt/cprop/Dev10_844071.il b/src/tests/JIT/jit64/opt/cprop/Dev10_844071.il index a95f03141c6fa0..20af1f1f859cd8 100644 --- a/src/tests/JIT/jit64/opt/cprop/Dev10_844071.il +++ b/src/tests/JIT/jit64/opt/cprop/Dev10_844071.il @@ -8,6 +8,7 @@ // Metadata version: v4.0.21218 .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -359,6 +360,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 60 (0x3c) .maxstack 2 diff --git a/src/tests/JIT/jit64/opt/cprop/Dev10_884217_IL.il b/src/tests/JIT/jit64/opt/cprop/Dev10_884217_IL.il index 09d2e59a8a7484..ca3330df74d8c6 100644 --- a/src/tests/JIT/jit64/opt/cprop/Dev10_884217_IL.il +++ b/src/tests/JIT/jit64/opt/cprop/Dev10_884217_IL.il @@ -6,6 +6,7 @@ // Metadata version: v4.0.20926 .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -59,6 +60,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 81 (0x51) .maxstack 3 diff --git a/src/tests/JIT/jit64/opt/cprop/cprop002.il b/src/tests/JIT/jit64/opt/cprop/cprop002.il index ade9ae6b20ccd1..b045feb17a0a36 100644 --- a/src/tests/JIT/jit64/opt/cprop/cprop002.il +++ b/src/tests/JIT/jit64/opt/cprop/cprop002.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -15,6 +16,9 @@ .field public static bool b .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals (uint32 V_0, int32 V_1) diff --git a/src/tests/JIT/jit64/opt/inl/inl001.il b/src/tests/JIT/jit64/opt/inl/inl001.il index 39eb40de0b2610..d1803a13f50489 100644 --- a/src/tests/JIT/jit64/opt/inl/inl001.il +++ b/src/tests/JIT/jit64/opt/inl/inl001.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -32,6 +33,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 45 (0x2d) .maxstack 2 diff --git a/src/tests/JIT/jit64/opt/lim/lim_001.il b/src/tests/JIT/jit64/opt/lim/lim_001.il index c845ebdc2a7f21..407392937dd214 100644 --- a/src/tests/JIT/jit64/opt/lim/lim_001.il +++ b/src/tests/JIT/jit64/opt/lim/lim_001.il @@ -6,6 +6,7 @@ .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -20,6 +21,9 @@ .field public static int32 k .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .locals init (int32, int32, int32) .entrypoint diff --git a/src/tests/JIT/jit64/opt/osr/osr015.il b/src/tests/JIT/jit64/opt/osr/osr015.il index 80c4a5de77386c..4e1af6f51f702d 100644 --- a/src/tests/JIT/jit64/opt/osr/osr015.il +++ b/src/tests/JIT/jit64/opt/osr/osr015.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -16,6 +17,9 @@ .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (int32) diff --git a/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/bne.il b/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/bne.il index 34a9ff73725abe..e0f4f9edd135a0 100644 --- a/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/bne.il +++ b/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/bne.il @@ -6,11 +6,15 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly cprop_test {} .assembly extern mscorlib{auto} .class cprop_test { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 5 diff --git a/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/conv.il b/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/conv.il index fcb440d49fad0b..33b10b5992c338 100644 --- a/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/conv.il +++ b/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/conv.il @@ -6,11 +6,15 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly Class_test {} .assembly extern mscorlib{auto} .class Class_test { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 5 diff --git a/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/div.il b/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/div.il index a6b1587b0a75fb..9e51374e893eac 100644 --- a/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/div.il +++ b/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/div.il @@ -6,11 +6,15 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly cprop_test {} .assembly extern mscorlib{auto} .class cprop_test { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 5 ldc.i4.7 diff --git a/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/mul1.il b/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/mul1.il index 29ac8deeefae1d..787916f41abc8d 100644 --- a/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/mul1.il +++ b/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/mul1.il @@ -6,11 +6,15 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly cprop_test {} .assembly extern mscorlib{auto} .class cprop_test { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 5 diff --git a/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/mul_exception.il b/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/mul_exception.il index f313e6b6def0da..cf8ff91c20f221 100644 --- a/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/mul_exception.il +++ b/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/mul_exception.il @@ -6,11 +6,15 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly cprop_test {} .assembly extern mscorlib{auto} .class cprop_test { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 5 diff --git a/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/rem.il b/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/rem.il index 42ed64983a4d71..e58708b364829c 100644 --- a/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/rem.il +++ b/src/tests/JIT/jit64/opt/regress/vswhidbey/223862/rem.il @@ -6,11 +6,15 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly cprop_test {} .assembly extern mscorlib{auto} .class cprop_test { .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 5 ldc.i4.7 diff --git a/src/tests/JIT/jit64/opt/regress/vswhidbey/228572/conv.il b/src/tests/JIT/jit64/opt/regress/vswhidbey/228572/conv.il index 58bb0ee1d406ab..7d6b190ab49963 100644 --- a/src/tests/JIT/jit64/opt/regress/vswhidbey/228572/conv.il +++ b/src/tests/JIT/jit64/opt/regress/vswhidbey/228572/conv.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly Conv_test {} .assembly extern mscorlib{auto} @@ -38,6 +39,9 @@ IL_01: ret } .method static int32 Main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .maxstack 5 .try diff --git a/src/tests/JIT/jit64/opt/regress/vswhidbey/481244/foo.il b/src/tests/JIT/jit64/opt/regress/vswhidbey/481244/foo.il index 8ad4d10b2ef342..6aa0207cc28298 100644 --- a/src/tests/JIT/jit64/opt/regress/vswhidbey/481244/foo.il +++ b/src/tests/JIT/jit64/opt/regress/vswhidbey/481244/foo.il @@ -10,6 +10,7 @@ { .ver 2:0:0:0 } +.assembly extern xunit.core {} .assembly foo { } @@ -47,6 +48,9 @@ .method privatescope static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/jit64/opt/regress/vswhidbey/481244/foo2.il b/src/tests/JIT/jit64/opt/regress/vswhidbey/481244/foo2.il index fabd511f95bd6d..21fdb04053d639 100644 --- a/src/tests/JIT/jit64/opt/regress/vswhidbey/481244/foo2.il +++ b/src/tests/JIT/jit64/opt/regress/vswhidbey/481244/foo2.il @@ -10,6 +10,7 @@ { .ver 2:0:0:0 } +.assembly extern xunit.core {} .assembly foo { } @@ -46,6 +47,9 @@ .method privatescope static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 20 diff --git a/src/tests/JIT/jit64/regress/ddb/118414/118414.il b/src/tests/JIT/jit64/regress/ddb/118414/118414.il index 73d82352a6f74a..f9c767841ec186 100644 --- a/src/tests/JIT/jit64/regress/ddb/118414/118414.il +++ b/src/tests/JIT/jit64/regress/ddb/118414/118414.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly ILGEN_0x3243f637 {} +.assembly extern xunit.core {} .assembly extern mscorlib{auto} .class ILGEN_0x3243f637 { @@ -38,6 +39,9 @@ Loop_0x0: } .method static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 diff --git a/src/tests/JIT/jit64/regress/phoenix/62322/test.il b/src/tests/JIT/jit64/regress/phoenix/62322/test.il index 7d29c494b89db7..c18a6476343890 100644 --- a/src/tests/JIT/jit64/regress/phoenix/62322/test.il +++ b/src/tests/JIT/jit64/regress/phoenix/62322/test.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} @@ -78,6 +79,9 @@ { .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 51 (0x33) .maxstack 2 diff --git a/src/tests/JIT/jit64/regress/vsw/102754/test1.il b/src/tests/JIT/jit64/regress/vsw/102754/test1.il index d91fc2a533fc18..37a0c94fc389e9 100644 --- a/src/tests/JIT/jit64/regress/vsw/102754/test1.il +++ b/src/tests/JIT/jit64/regress/vsw/102754/test1.il @@ -11,6 +11,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern legacy library mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) @@ -43,6 +44,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals (int64* V_0, diff --git a/src/tests/JIT/jit64/regress/vsw/102974/test.il b/src/tests/JIT/jit64/regress/vsw/102974/test.il index f50deea4142a71..ee7b9f9ab2ab0d 100644 --- a/src/tests/JIT/jit64/regress/vsw/102974/test.il +++ b/src/tests/JIT/jit64/regress/vsw/102974/test.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} // This test was failing due to a bug that existed when we were first bringing up GC on amd64. Probably won't fail // anytime soon, but a good case to have. @@ -73,6 +74,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class Test/Dummy V_0) diff --git a/src/tests/JIT/jit64/regress/vsw/266693/test.il b/src/tests/JIT/jit64/regress/vsw/266693/test.il index 8eed7229bcc0b0..d82de8d6dfd4b3 100644 --- a/src/tests/JIT/jit64/regress/vsw/266693/test.il +++ b/src/tests/JIT/jit64/regress/vsw/266693/test.il @@ -5,6 +5,7 @@ // when we are prevented from inlining something. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -70,6 +71,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class Test_test V_0) ldc.i4 10 diff --git a/src/tests/JIT/jit64/regress/vsw/333007/test1.il b/src/tests/JIT/jit64/regress/vsw/333007/test1.il index 96da675912bac3..4b3949f6106acc 100644 --- a/src/tests/JIT/jit64/regress/vsw/333007/test1.il +++ b/src/tests/JIT/jit64/regress/vsw/333007/test1.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} @@ -46,6 +47,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 22 (0x16) .maxstack 8 diff --git a/src/tests/JIT/jit64/regress/vsw/373472/test.il b/src/tests/JIT/jit64/regress/vsw/373472/test.il index addb7e948e9850..73f538ab6a85d6 100644 --- a/src/tests/JIT/jit64/regress/vsw/373472/test.il +++ b/src/tests/JIT/jit64/regress/vsw/373472/test.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} @@ -41,6 +42,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 40 (0x28) .maxstack 2 diff --git a/src/tests/JIT/jit64/regress/vsw/404708/test.il b/src/tests/JIT/jit64/regress/vsw/404708/test.il index fc150cc3f1d446..009c093c3077ea 100644 --- a/src/tests/JIT/jit64/regress/vsw/404708/test.il +++ b/src/tests/JIT/jit64/regress/vsw/404708/test.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -49,6 +50,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 diff --git a/src/tests/JIT/jit64/regress/vsw/460412/test.il b/src/tests/JIT/jit64/regress/vsw/460412/test.il index 89e38697280711..1f535fe81f3eed 100644 --- a/src/tests/JIT/jit64/regress/vsw/460412/test.il +++ b/src/tests/JIT/jit64/regress/vsw/460412/test.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} @@ -71,6 +72,9 @@ starg 0 { .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 87 (0x57) .maxstack 2 diff --git a/src/tests/JIT/jit64/regress/vsw/543645/test.il b/src/tests/JIT/jit64/regress/vsw/543645/test.il index c438b898641e2c..61da8f6d3a19c7 100644 --- a/src/tests/JIT/jit64/regress/vsw/543645/test.il +++ b/src/tests/JIT/jit64/regress/vsw/543645/test.il @@ -10,6 +10,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib { .ver 0:0:0:0 @@ -33,6 +34,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (int32 r) diff --git a/src/tests/JIT/jit64/regress/vsw/552940/test.il b/src/tests/JIT/jit64/regress/vsw/552940/test.il index b3e3584b50a12d..cbc03a5a194c22 100644 --- a/src/tests/JIT/jit64/regress/vsw/552940/test.il +++ b/src/tests/JIT/jit64/regress/vsw/552940/test.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly extern common {} .assembly test {} @@ -77,6 +78,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (int32 V_0) diff --git a/src/tests/JIT/jit64/regress/vsw/606733/Bug606733.il b/src/tests/JIT/jit64/regress/vsw/606733/Bug606733.il index 26fbefcec54fbc..4a5cc028bec6ff 100644 --- a/src/tests/JIT/jit64/regress/vsw/606733/Bug606733.il +++ b/src/tests/JIT/jit64/regress/vsw/606733/Bug606733.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -49,6 +50,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 54 (0x36) .maxstack 2 diff --git a/src/tests/JIT/jit64/regress/vsw/607586/607586.il b/src/tests/JIT/jit64/regress/vsw/607586/607586.il index 779dd789063342..3a67a9fabb813c 100644 --- a/src/tests/JIT/jit64/regress/vsw/607586/607586.il +++ b/src/tests/JIT/jit64/regress/vsw/607586/607586.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern mscorlib { @@ -31,6 +32,9 @@ { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 5 .locals init ([0] int32 CS$1$0000) diff --git a/src/tests/JIT/jit64/verif/sniff/fg/ver_fg_13.il b/src/tests/JIT/jit64/verif/sniff/fg/ver_fg_13.il index 179f34b37e5938..55f3996f2c7dce 100644 --- a/src/tests/JIT/jit64/verif/sniff/fg/ver_fg_13.il +++ b/src/tests/JIT/jit64/verif/sniff/fg/ver_fg_13.il @@ -5,6 +5,7 @@ // expect throw System.InvalidProgramException .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -19,6 +20,9 @@ { .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (int32 retval) .try diff --git a/src/tests/JIT/opt/AssertionPropagation/CPropOverflow.il b/src/tests/JIT/opt/AssertionPropagation/CPropOverflow.il index d166431728dec1..ba3efe43d4b5e6 100644 --- a/src/tests/JIT/opt/AssertionPropagation/CPropOverflow.il +++ b/src/tests/JIT/opt/AssertionPropagation/CPropOverflow.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} @@ -66,6 +67,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 103 (0x67) .maxstack 2 diff --git a/src/tests/JIT/opt/Devirtualization/GenericArrayOverride.il b/src/tests/JIT/opt/Devirtualization/GenericArrayOverride.il index 7349f2e5b7b977..27374f568a1256 100644 --- a/src/tests/JIT/opt/Devirtualization/GenericArrayOverride.il +++ b/src/tests/JIT/opt/Devirtualization/GenericArrayOverride.il @@ -9,6 +9,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: .ver 5:0:0:0 } +.assembly extern xunit.core {} .assembly extern System.Collections { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: @@ -209,6 +210,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 120 (0x78) .maxstack 5 diff --git a/src/tests/JIT/opt/Devirtualization/GitHub_9945_2.il b/src/tests/JIT/opt/Devirtualization/GitHub_9945_2.il index e90b30b7d05fca..816d776f9558ec 100644 --- a/src/tests/JIT/opt/Devirtualization/GitHub_9945_2.il +++ b/src/tests/JIT/opt/Devirtualization/GitHub_9945_2.il @@ -4,6 +4,7 @@ .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly GitHub_9945_2 { @@ -36,6 +37,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .locals (object) .entrypoint // Store ref in supertyped local to "forget" type diff --git a/src/tests/JIT/opt/Devirtualization/override.il b/src/tests/JIT/opt/Devirtualization/override.il index 830d03d55d9c67..3046144bbc99de 100644 --- a/src/tests/JIT/opt/Devirtualization/override.il +++ b/src/tests/JIT/opt/Devirtualization/override.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // MyBar is an abstract class which declares an abstract method MyBar::DoBar(). // MyBar also DoSelfBar() that explicitly overrides DoBar(). // BarImpl extends MyBar and also overrides DoBar(). @@ -84,6 +85,9 @@ { .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 66 (0x42) .maxstack 2 diff --git a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/BBCnt1.il b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/BBCnt1.il index 36a8f1120b17f2..36adec8a81ca5a 100644 --- a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/BBCnt1.il +++ b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/BBCnt1.il @@ -5,6 +5,7 @@ // New Basic Block BB2001 created. // OPTIONS: opts.MinOpts() == true .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -16,6 +17,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 11955 (0x2eb3) .maxstack 3 diff --git a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/CodeSize1.il b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/CodeSize1.il index 8e85028ef6b6d6..62d2f492b5cc1d 100644 --- a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/CodeSize1.il +++ b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/CodeSize1.il @@ -5,6 +5,7 @@ // Code size 60001 (0xea61) // OPTIONS: opts.MinOpts() == true .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -16,6 +17,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals init (int32 V_0, diff --git a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/InstrCnt1.il b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/InstrCnt1.il index f8b1420e74d5cc..da075a15f17c5c 100644 --- a/src/tests/JIT/opt/DumpDisasm/JitMinOpts/InstrCnt1.il +++ b/src/tests/JIT/opt/DumpDisasm/JitMinOpts/InstrCnt1.il @@ -4,6 +4,7 @@ // DEFAULT_MIN_OPTS_INSTR_COUNT 20000 // OPTIONS: opts.MinOpts() == true .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -15,6 +16,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 4 .locals init (class [mscorlib]System.Random V_0, diff --git a/src/tests/JIT/opt/ETW/TailCallCases.il b/src/tests/JIT/opt/ETW/TailCallCases.il index d2d0be85599d70..75d743e39568ef 100644 --- a/src/tests/JIT/opt/ETW/TailCallCases.il +++ b/src/tests/JIT/opt/ETW/TailCallCases.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} @@ -225,6 +226,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 103 (0x67) .maxstack 4 diff --git a/src/tests/JIT/opt/Inline/regression/badcallee/badcallee.il b/src/tests/JIT/opt/Inline/regression/badcallee/badcallee.il index 869f2bab4b1720..774ac55c179732 100644 --- a/src/tests/JIT/opt/Inline/regression/badcallee/badcallee.il +++ b/src/tests/JIT/opt/Inline/regression/badcallee/badcallee.il @@ -6,6 +6,7 @@ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern System.Console { @@ -34,6 +35,9 @@ .method public hidebysig static int32 Main(string[] x) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint ldarg.0 ldlen diff --git a/src/tests/JIT/opt/Inline/regression/mismatch32/mismatch32.il b/src/tests/JIT/opt/Inline/regression/mismatch32/mismatch32.il index 9cc64c3d37e943..72e58775c13d28 100644 --- a/src/tests/JIT/opt/Inline/regression/mismatch32/mismatch32.il +++ b/src/tests/JIT/opt/Inline/regression/mismatch32/mismatch32.il @@ -8,6 +8,7 @@ // .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console {} .assembly extern System.Runtime {} .assembly main {} @@ -41,6 +42,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (int32 v_0) // Code size 28 (0x1c) diff --git a/src/tests/JIT/opt/Inline/regression/mismatch64/mismatch64.il b/src/tests/JIT/opt/Inline/regression/mismatch64/mismatch64.il index 53b2c0e7b8ae99..61dc0efff146da 100644 --- a/src/tests/JIT/opt/Inline/regression/mismatch64/mismatch64.il +++ b/src/tests/JIT/opt/Inline/regression/mismatch64/mismatch64.il @@ -8,6 +8,7 @@ // .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console {} .assembly extern System.Runtime {} .assembly main {} @@ -41,6 +42,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (int32 v_0) // Code size 28 (0x1c) diff --git a/src/tests/JIT/opt/Inline/tests/calli.il b/src/tests/JIT/opt/Inline/tests/calli.il index c239f4658d8902..97e94ceecd0e38 100644 --- a/src/tests/JIT/opt/Inline/tests/calli.il +++ b/src/tests/JIT/opt/Inline/tests/calli.il @@ -4,6 +4,7 @@ // Test that inliner can now inline g1 and g2 .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly legacy library calli_inline {} .class private auto ansi beforefieldinit calli_test @@ -35,6 +36,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 call int32 calli_test::g1() diff --git a/src/tests/JIT/opt/InstructionCombining/UbfizSbfiz.cs b/src/tests/JIT/opt/InstructionCombining/UbfizSbfiz.cs new file mode 100644 index 00000000000000..33cba49a0ab4a1 --- /dev/null +++ b/src/tests/JIT/opt/InstructionCombining/UbfizSbfiz.cs @@ -0,0 +1,722 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.CompilerServices; + +public class Program +{ + public const int ShiftBy = 5; + + [MethodImpl(MethodImplOptions.NoInlining)] + public static T ToVar(T t) => t; + + public static void AssertTrue(bool cond, [CallerLineNumber] int line = 0) + { + if (!cond) + throw new InvalidOperationException($"Test failed at line {line}."); + } + + // Tests for https://github.com/dotnet/runtime/pull/61045 optimization + public static int Main() + { + unchecked + { + long[] testData = + { + -1, -2, -3, -8, -128, -129, -254, -255, -256, + 0, 1, 2, 3, 8, 128, 129, 254, 255, 256, + short.MinValue + 1, short.MinValue, short.MinValue + 1, + short.MaxValue + 1, short.MaxValue, short.MaxValue + 1, + int.MinValue + 1, int.MinValue, int.MinValue + 1, + int.MaxValue + 1, int.MaxValue, int.MaxValue + 1, + long.MinValue + 1, long.MinValue, long.MinValue + 1, + long.MaxValue + 1, long.MaxValue, long.MaxValue + 1, + ushort.MaxValue, uint.MaxValue, (long)ulong.MaxValue + }; + + foreach (long t in testData) + { + AssertTrue(Tests_byte.Test_byte_to_byte((byte)t)); + AssertTrue(Tests_byte.Test_byte_to_sbyte((byte)t)); + AssertTrue(Tests_byte.Test_byte_to_ushort((byte)t)); + AssertTrue(Tests_byte.Test_byte_to_short((byte)t)); + AssertTrue(Tests_byte.Test_byte_to_uint((byte)t)); + AssertTrue(Tests_byte.Test_byte_to_int((byte)t)); + AssertTrue(Tests_byte.Test_byte_to_ulong((byte)t)); + AssertTrue(Tests_byte.Test_byte_to_long((byte)t)); + + AssertTrue(Tests_sbyte.Test_sbyte_to_byte((sbyte)t)); + AssertTrue(Tests_sbyte.Test_sbyte_to_sbyte((sbyte)t)); + AssertTrue(Tests_sbyte.Test_sbyte_to_ushort((sbyte)t)); + AssertTrue(Tests_sbyte.Test_sbyte_to_short((sbyte)t)); + AssertTrue(Tests_sbyte.Test_sbyte_to_uint((sbyte)t)); + AssertTrue(Tests_sbyte.Test_sbyte_to_int((sbyte)t)); + AssertTrue(Tests_sbyte.Test_sbyte_to_ulong((sbyte)t)); + AssertTrue(Tests_sbyte.Test_sbyte_to_long((sbyte)t)); + + AssertTrue(Tests_ushort.Test_ushort_to_byte((ushort)t)); + AssertTrue(Tests_ushort.Test_ushort_to_sbyte((ushort)t)); + AssertTrue(Tests_ushort.Test_ushort_to_ushort((ushort)t)); + AssertTrue(Tests_ushort.Test_ushort_to_short((ushort)t)); + AssertTrue(Tests_ushort.Test_ushort_to_uint((ushort)t)); + AssertTrue(Tests_ushort.Test_ushort_to_int((ushort)t)); + AssertTrue(Tests_ushort.Test_ushort_to_ulong((ushort)t)); + AssertTrue(Tests_ushort.Test_ushort_to_long((ushort)t)); + + AssertTrue(Tests_short.Test_short_to_byte((short)t)); + AssertTrue(Tests_short.Test_short_to_sbyte((short)t)); + AssertTrue(Tests_short.Test_short_to_ushort((short)t)); + AssertTrue(Tests_short.Test_short_to_short((short)t)); + AssertTrue(Tests_short.Test_short_to_uint((short)t)); + AssertTrue(Tests_short.Test_short_to_int((short)t)); + AssertTrue(Tests_short.Test_short_to_ulong((short)t)); + AssertTrue(Tests_short.Test_short_to_long((short)t)); + + AssertTrue(Tests_uint.Test_uint_to_byte((uint)t)); + AssertTrue(Tests_uint.Test_uint_to_sbyte((uint)t)); + AssertTrue(Tests_uint.Test_uint_to_ushort((uint)t)); + AssertTrue(Tests_uint.Test_uint_to_short((uint)t)); + AssertTrue(Tests_uint.Test_uint_to_uint((uint)t)); + AssertTrue(Tests_uint.Test_uint_to_int((uint)t)); + AssertTrue(Tests_uint.Test_uint_to_ulong((uint)t)); + AssertTrue(Tests_uint.Test_uint_to_long((uint)t)); + + AssertTrue(Tests_int.Test_int_to_byte((int)t)); + AssertTrue(Tests_int.Test_int_to_sbyte((int)t)); + AssertTrue(Tests_int.Test_int_to_ushort((int)t)); + AssertTrue(Tests_int.Test_int_to_short((int)t)); + AssertTrue(Tests_int.Test_int_to_uint((int)t)); + AssertTrue(Tests_int.Test_int_to_int((int)t)); + AssertTrue(Tests_int.Test_int_to_ulong((int)t)); + AssertTrue(Tests_int.Test_int_to_long((int)t)); + + AssertTrue(Tests_ulong.Test_ulong_to_byte((ulong)t)); + AssertTrue(Tests_ulong.Test_ulong_to_sbyte((ulong)t)); + AssertTrue(Tests_ulong.Test_ulong_to_ushort((ulong)t)); + AssertTrue(Tests_ulong.Test_ulong_to_short((ulong)t)); + AssertTrue(Tests_ulong.Test_ulong_to_uint((ulong)t)); + AssertTrue(Tests_ulong.Test_ulong_to_int((ulong)t)); + AssertTrue(Tests_ulong.Test_ulong_to_ulong((ulong)t)); + AssertTrue(Tests_ulong.Test_ulong_to_long((ulong)t)); + + AssertTrue(Tests_long.Test_long_to_byte(t)); + AssertTrue(Tests_long.Test_long_to_sbyte(t)); + AssertTrue(Tests_long.Test_long_to_ushort(t)); + AssertTrue(Tests_long.Test_long_to_short(t)); + AssertTrue(Tests_long.Test_long_to_uint(t)); + AssertTrue(Tests_long.Test_long_to_int(t)); + AssertTrue(Tests_long.Test_long_to_ulong(t)); + AssertTrue(Tests_long.Test_long_to_long(t)); + } + } + return 100; + } +} + +public class Tests_byte +{ + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_byte_to_byte(byte x) + { + unchecked + { + return (byte)(x << Program.ShiftBy) == + (byte)(Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_byte_to_sbyte(byte x) + { + unchecked + { + return (sbyte)((sbyte)x << Program.ShiftBy) == + (sbyte)((sbyte)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_byte_to_ushort(byte x) + { + unchecked + { + return (ushort)(x << Program.ShiftBy) == + (ushort)(Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_byte_to_short(byte x) + { + unchecked + { + return (short)(x << Program.ShiftBy) == + (short)(Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_byte_to_uint(byte x) + { + return (uint)x << Program.ShiftBy == + (uint)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_byte_to_int(byte x) + { + return x << Program.ShiftBy == + Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_byte_to_ulong(byte x) + { + return (ulong)x << Program.ShiftBy == + (ulong)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_byte_to_long(byte x) + { + return (long)x << Program.ShiftBy == + (long)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } +} + +public class Tests_sbyte +{ + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_sbyte_to_byte(sbyte x) + { + unchecked + { + return (byte)((byte)x << Program.ShiftBy) == + (byte)((byte)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_sbyte_to_sbyte(sbyte x) + { + unchecked + { + return (sbyte)(x << Program.ShiftBy) == + (sbyte)(Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_sbyte_to_ushort(sbyte x) + { + unchecked + { + return (ushort)((ushort)x << Program.ShiftBy) == + (ushort)((ushort)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_sbyte_to_short(sbyte x) + { + unchecked + { + return (short)(x << Program.ShiftBy) == + (short)(Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_sbyte_to_uint(sbyte x) + { + unchecked + { + return (uint)x << Program.ShiftBy == + (uint)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_sbyte_to_int(sbyte x) + { + return x << Program.ShiftBy == + Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_sbyte_to_ulong(sbyte x) + { + unchecked + { + return (ulong)x << Program.ShiftBy == + (ulong)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_sbyte_to_long(sbyte x) + { + return (long)x << Program.ShiftBy == + (long)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } +} + +public class Tests_ushort +{ + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_ushort_to_byte(ushort x) + { + unchecked + { + return (byte)((byte)x << Program.ShiftBy) == + (byte)((byte)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_ushort_to_sbyte(ushort x) + { + unchecked + { + return (sbyte)((sbyte)x << Program.ShiftBy) == + (sbyte)((sbyte)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_ushort_to_ushort(ushort x) + { + unchecked + { + return (ushort)(x << Program.ShiftBy) == + (ushort)(Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_ushort_to_short(ushort x) + { + unchecked + { + return (short)((short)x << Program.ShiftBy) == + (short)((short)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_ushort_to_uint(ushort x) + { + return (uint)x << Program.ShiftBy == + (uint)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_ushort_to_int(ushort x) + { + return x << Program.ShiftBy == + Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_ushort_to_ulong(ushort x) + { + return (ulong)x << Program.ShiftBy == + (ulong)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_ushort_to_long(ushort x) + { + return (long)x << Program.ShiftBy == + (long)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } +} + +public class Tests_short +{ + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_short_to_byte(short x) + { + unchecked + { + return (byte)((byte)x << Program.ShiftBy) == + (byte)((byte)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_short_to_sbyte(short x) + { + unchecked + { + return (sbyte)((sbyte)x << Program.ShiftBy) == + (sbyte)((sbyte)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_short_to_ushort(short x) + { + unchecked + { + return (ushort)((ushort)x << Program.ShiftBy) == + (ushort)((ushort)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_short_to_short(short x) + { + unchecked + { + return (short)(x << Program.ShiftBy) == + (short)(Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_short_to_uint(short x) + { + unchecked + { + return (uint)x << Program.ShiftBy == + (uint)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_short_to_int(short x) + { + return x << Program.ShiftBy == + Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_short_to_ulong(short x) + { + unchecked + { + return (ulong)x << Program.ShiftBy == + (ulong)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_short_to_long(short x) + { + return (long)x << Program.ShiftBy == + (long)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } +} + +public class Tests_uint +{ + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_uint_to_byte(uint x) + { + unchecked + { + return (byte)((byte)x << Program.ShiftBy) == + (byte)((byte)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_uint_to_sbyte(uint x) + { + unchecked + { + return (sbyte)((sbyte)x << Program.ShiftBy) == + (sbyte)((sbyte)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_uint_to_ushort(uint x) + { + unchecked + { + return (ushort)((ushort)x << Program.ShiftBy) == + (ushort)((ushort)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_uint_to_short(uint x) + { + unchecked + { + return (short)((short)x << Program.ShiftBy) == + (short)((short)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_uint_to_uint(uint x) + { + return x << Program.ShiftBy == + Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_uint_to_int(uint x) + { + unchecked + { + return (int)x << Program.ShiftBy == + (int)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_uint_to_ulong(uint x) + { + return (ulong)x << Program.ShiftBy == + (ulong)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_uint_to_long(uint x) + { + return (long)x << Program.ShiftBy == + (long)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } +} + +public class Tests_int +{ + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_int_to_byte(int x) + { + unchecked + { + return (byte)((byte)x << Program.ShiftBy) == + (byte)((byte)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_int_to_sbyte(int x) + { + unchecked + { + return (sbyte)((sbyte)x << Program.ShiftBy) == + (sbyte)((sbyte)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_int_to_ushort(int x) + { + unchecked + { + return (ushort)((ushort)x << Program.ShiftBy) == + (ushort)((ushort)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_int_to_short(int x) + { + unchecked + { + return (short)((short)x << Program.ShiftBy) == + (short)((short)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_int_to_uint(int x) + { + unchecked + { + return (uint)x << Program.ShiftBy == + (uint)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_int_to_int(int x) + { + return x << Program.ShiftBy == + Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_int_to_ulong(int x) + { + unchecked + { + return (ulong)x << Program.ShiftBy == + (ulong)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_int_to_long(int x) + { + return (long)x << Program.ShiftBy == + (long)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } +} + +public class Tests_ulong +{ + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_ulong_to_byte(ulong x) + { + unchecked + { + return (byte)((byte)x << Program.ShiftBy) == + (byte)((byte)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_ulong_to_sbyte(ulong x) + { + unchecked + { + return (sbyte)((sbyte)x << Program.ShiftBy) == + (sbyte)((sbyte)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_ulong_to_ushort(ulong x) + { + unchecked + { + return (ushort)((ushort)x << Program.ShiftBy) == + (ushort)((ushort)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_ulong_to_short(ulong x) + { + unchecked + { + return (short)((short)x << Program.ShiftBy) == + (short)((short)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_ulong_to_uint(ulong x) + { + unchecked + { + return (uint)x << Program.ShiftBy == + (uint)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_ulong_to_int(ulong x) + { + unchecked + { + return (int)x << Program.ShiftBy == + (int)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_ulong_to_ulong(ulong x) + { + return x << Program.ShiftBy == + Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_ulong_to_long(ulong x) + { + unchecked + { + return (long)x << Program.ShiftBy == + (long)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + } +} + +public class Tests_long +{ + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_long_to_byte(long x) + { + unchecked + { + return (byte)((byte)x << Program.ShiftBy) == + (byte)((byte)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_long_to_sbyte(long x) + { + unchecked + { + return (sbyte)((sbyte)x << Program.ShiftBy) == + (sbyte)((sbyte)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_long_to_ushort(long x) + { + unchecked + { + return (ushort)((ushort)x << Program.ShiftBy) == + (ushort)((ushort)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_long_to_short(long x) + { + unchecked + { + return (short)((short)x << Program.ShiftBy) == + (short)((short)Program.ToVar(x) << Program.ToVar(Program.ShiftBy)); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_long_to_uint(long x) + { + unchecked + { + return (uint)x << Program.ShiftBy == + (uint)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_long_to_int(long x) + { + unchecked + { + return (int)x << Program.ShiftBy == + (int)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_long_to_ulong(long x) + { + unchecked + { + return (ulong)x << Program.ShiftBy == + (ulong)Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static bool Test_long_to_long(long x) + { + return x << Program.ShiftBy == + Program.ToVar(x) << Program.ToVar(Program.ShiftBy); + } +} \ No newline at end of file diff --git a/src/tests/JIT/opt/InstructionCombining/UbfizSbfiz.csproj b/src/tests/JIT/opt/InstructionCombining/UbfizSbfiz.csproj new file mode 100644 index 00000000000000..ae422e19fd3972 --- /dev/null +++ b/src/tests/JIT/opt/InstructionCombining/UbfizSbfiz.csproj @@ -0,0 +1,12 @@ + + + Exe + + + None + True + + + + + diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt0.il b/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt0.il index 6967e7c8297f36..36c6b8b5f3bf91 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt0.il +++ b/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt0.il @@ -5,6 +5,7 @@ // New Basic Block BB2000 created. // OPTIONS: opts.MinOpts() == false .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -16,6 +17,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 11955 (0x2eb3) .maxstack 3 diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt1.il b/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt1.il index a4ed1fe406198c..63b387f60a3e7f 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt1.il +++ b/src/tests/JIT/opt/JitMinOpts/Perf/BBCnt1.il @@ -5,6 +5,7 @@ // New Basic Block BB2001 created. // OPTIONS: opts.MinOpts() == true .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -16,6 +17,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 11955 (0x2eb3) .maxstack 3 diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize0.il b/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize0.il index 6c3aee6151cd03..b5dd58657a8ae7 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize0.il +++ b/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize0.il @@ -6,6 +6,7 @@ // TID 934: IL Code Size,Instr 59998,15513, Basic Block count 722, Local Variable Num,Ref count 17,5326 for method CodeSize0.Main():int .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -18,6 +19,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 59998 (0xea5e) .maxstack 3 diff --git a/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize1.il b/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize1.il index bb08f13a878f57..1b53ce5a160881 100644 --- a/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize1.il +++ b/src/tests/JIT/opt/JitMinOpts/Perf/CodeSize1.il @@ -7,6 +7,7 @@ // TID abc: IL Code Size,Instr 60002,15515, Basic Block count 722, Local Variable Num,Ref count 17,5328 for method CodeSize1.Main():int .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -19,6 +20,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 60003 (0xea63) .maxstack 3 diff --git a/src/tests/JIT/opt/Loops/LoopSideEffectsForHwiStores.cs b/src/tests/JIT/opt/Loops/LoopSideEffectsForHwiStores.cs new file mode 100644 index 00000000000000..b07f347e6c124a --- /dev/null +++ b/src/tests/JIT/opt/Loops/LoopSideEffectsForHwiStores.cs @@ -0,0 +1,73 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.X86; +using System.Runtime.Intrinsics.Arm; + +unsafe class LoopSideEffectsForHwiStores +{ + public static int Main() + { + static bool VerifyExpectedVtor(Vector128 a) => a.Equals(Vector128.Create(4)); + + var a = new ClassWithVtor(); + + fixed (Vector128* p = &a.VtorField) + { + if (Sse2.IsSupported && !VerifyExpectedVtor(ProblemWithSse2(a, (byte*)p))) + { + System.Console.WriteLine("ProblemWithSse2 failed!"); + return 101; + } + + if (AdvSimd.IsSupported && !VerifyExpectedVtor(ProblemWithAdvSimd(a, (byte*)p))) + { + System.Console.WriteLine("ProblemWithAdvSimd failed!"); + return 101; + } + } + + return 100; + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static unsafe Vector128 ProblemWithSse2(ClassWithVtor a, byte* p) + { + Vector128 vtor = Vector128.Zero; + + a.VtorField = Vector128.Create(1); + a.VtorField = Sse2.Add(a.VtorField, a.VtorField); + + for (int i = 0; i < 10; i++) + { + vtor = Sse2.Add(vtor, Sse2.Add(a.VtorField, a.VtorField)); + Sse2.Store(p, Vector128.Zero); + } + + return vtor; + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static unsafe Vector128 ProblemWithAdvSimd(ClassWithVtor a, byte* p) + { + Vector128 vtor = Vector128.Zero; + + a.VtorField = Vector128.Create(1); + a.VtorField = AdvSimd.Add(a.VtorField, a.VtorField); + + for (int i = 0; i < 10; i++) + { + vtor = AdvSimd.Add(vtor, AdvSimd.Add(a.VtorField, a.VtorField)); + AdvSimd.Store(p, Vector128.Zero); + } + + return vtor; + } + + class ClassWithVtor + { + public Vector128 VtorField; + } +} diff --git a/src/tests/baseservices/exceptions/regressions/whidbeym3.3/293674/ReproTrusted.csproj b/src/tests/JIT/opt/Loops/LoopSideEffectsForHwiStores.csproj similarity index 51% rename from src/tests/baseservices/exceptions/regressions/whidbeym3.3/293674/ReproTrusted.csproj rename to src/tests/JIT/opt/Loops/LoopSideEffectsForHwiStores.csproj index 52243f8f506a7c..7e343802d9e7a3 100644 --- a/src/tests/baseservices/exceptions/regressions/whidbeym3.3/293674/ReproTrusted.csproj +++ b/src/tests/JIT/opt/Loops/LoopSideEffectsForHwiStores.csproj @@ -1,11 +1,14 @@ - Library + Exe true - SharedLibrary 1 + + PdbOnly + True + - + diff --git a/src/tests/JIT/opt/OSR/handlerloop.cs b/src/tests/JIT/opt/OSR/handlerloop.cs new file mode 100644 index 00000000000000..01429b553c139d --- /dev/null +++ b/src/tests/JIT/opt/OSR/handlerloop.cs @@ -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. + +using System; + +// OSR can't bail us out of a loop in a handler +// +class OSRHandlerLoop +{ + public static int Main() + { + int result = 0; + int expected = 0; + try + { + result++; + expected = 704982705; + } + finally + { + for (int i = 0; i < 100_000; i++) + { + result += i; + } + } + + Console.WriteLine($"{result} expected {expected}"); + + return (result == expected) ? 100 : -1; + } +} diff --git a/src/tests/JIT/opt/OSR/handlerloop.csproj b/src/tests/JIT/opt/OSR/handlerloop.csproj new file mode 100644 index 00000000000000..9620f75474a935 --- /dev/null +++ b/src/tests/JIT/opt/OSR/handlerloop.csproj @@ -0,0 +1,24 @@ + + + Exe + + True + + + + + + + + + diff --git a/src/tests/JIT/opt/OSR/synchronized.cs b/src/tests/JIT/opt/OSR/synchronized.cs new file mode 100644 index 00000000000000..4a0b8629d49aa2 --- /dev/null +++ b/src/tests/JIT/opt/OSR/synchronized.cs @@ -0,0 +1,83 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Runtime.CompilerServices; +using System.Threading; + +struct S +{ + public long y; + public int x; +} + +class Z +{ + virtual public S F() + { + S s = new S(); + s.x = 100; + s.y = -1; + return s; + } +} + +class X +{ + Z z; + + [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.Synchronized)] + public S G() + { + S s = new S(); + + for (int i = 0; i < 100_000; i++) + { + if (!Monitor.IsEntered(this)) + { + throw new Exception(); + } + s = z.F(); + } + + return s; + } + + public static int Main() + { + int result = -1; + try + { + result = Test(); + } + catch (Exception) + { + Console.WriteLine("EXCEPTION"); + } + + if (result == 100) + { + Console.WriteLine("SUCCESS"); + } + else + { + Console.WriteLine("FAILURE"); + } + return result; + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static int Test() + { + var x = new X(); + x.z = new Z(); + + for (int i = 0; i < 100; i++) + { + _ = x.G(); + Thread.Sleep(15); + } + + return x.G().x; + } +} diff --git a/src/tests/JIT/opt/OSR/synchronized.csproj b/src/tests/JIT/opt/OSR/synchronized.csproj new file mode 100644 index 00000000000000..9620f75474a935 --- /dev/null +++ b/src/tests/JIT/opt/OSR/synchronized.csproj @@ -0,0 +1,24 @@ + + + Exe + + True + + + + + + + + + diff --git a/src/tests/JIT/opt/Tailcall/TailcallVerifyWithPrefix.il b/src/tests/JIT/opt/Tailcall/TailcallVerifyWithPrefix.il index 2aa7e723559b4f..db6e6a4c30252d 100644 --- a/src/tests/JIT/opt/Tailcall/TailcallVerifyWithPrefix.il +++ b/src/tests/JIT/opt/Tailcall/TailcallVerifyWithPrefix.il @@ -8,6 +8,7 @@ .module extern libc .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -2253,6 +2254,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 diff --git a/src/tests/JIT/superpmi/collect_alltests.sh b/src/tests/JIT/superpmi/collect_alltests.sh index 581b1e45b05721..72a839b1849eb8 100644 --- a/src/tests/JIT/superpmi/collect_alltests.sh +++ b/src/tests/JIT/superpmi/collect_alltests.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash CORECLRROOT=~/src/coreclr TESTROOT=~/test diff --git a/src/tests/JIT/superpmi/runtests.sh b/src/tests/JIT/superpmi/runtests.sh index 35cb82432cc7f8..81ea1713e6f9a4 100644 --- a/src/tests/JIT/superpmi/runtests.sh +++ b/src/tests/JIT/superpmi/runtests.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Run CoreCLR OSS tests on Linux or Mac # Use the instructions here: diff --git a/src/tests/JIT/superpmi/superpmicollect.csproj b/src/tests/JIT/superpmi/superpmicollect.csproj index c3c7fae8808fc8..86ddca45522001 100644 --- a/src/tests/JIT/superpmi/superpmicollect.csproj +++ b/src/tests/JIT/superpmi/superpmicollect.csproj @@ -25,17 +25,14 @@ <_SpmiTestProjects Include="..\Performance\CodeQuality\Bytemark\Bytemark.csproj" /> <_SpmiTestProjects Include="..\Methodical\fp\exgen\10w5d_cs_do.csproj" /> - <_SpmiTestProjects Update="@(_SpmiTestProjects)"> - OutputPath=$(OutputPath)\%(FileName) - + + Build + _SpmiTest + %(FileName) + false + - - - - - <_SpmiTestNamesFile>$(IntermediateOutputPath)\SpmiTestNames.txt @@ -55,4 +52,14 @@ SpmiTestNames + + + + + + + + + diff --git a/src/tests/JIT/superpmi/superpmicollect.csproj.targets b/src/tests/JIT/superpmi/superpmicollect.csproj.targets deleted file mode 100644 index ca98b9666a04a4..00000000000000 --- a/src/tests/JIT/superpmi/superpmicollect.csproj.targets +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/src/tests/Loader/AssemblyDependencyResolver/AssemblyDependencyResolverTests/AssemblyDependencyResolverTests.cs b/src/tests/Loader/AssemblyDependencyResolver/AssemblyDependencyResolverTests/AssemblyDependencyResolverTests.cs index 98279fb6653788..bc991d0bce1f19 100644 --- a/src/tests/Loader/AssemblyDependencyResolver/AssemblyDependencyResolverTests/AssemblyDependencyResolverTests.cs +++ b/src/tests/Loader/AssemblyDependencyResolver/AssemblyDependencyResolverTests/AssemblyDependencyResolverTests.cs @@ -7,8 +7,6 @@ using TestLibrary; using Xunit; -using Assert = Xunit.Assert; - namespace AssemblyDependencyResolverTests { class AssemblyDependencyResolverTests : TestBase @@ -37,10 +35,10 @@ public void TestComponentLoadFailure() const string errorMessageFirstLine = "First line: failure"; const string errorMessageSecondLine = "Second line: value"; - using (HostPolicyMock.MockValues_corehost_set_error_writer errorWriterMock = + using (HostPolicyMock.MockValues_corehost_set_error_writer errorWriterMock = HostPolicyMock.Mock_corehost_set_error_writer()) { - using (HostPolicyMock.MockValues_corehost_resolve_component_dependencies resolverMock = + using (HostPolicyMock.MockValues_corehost_resolve_component_dependencies resolverMock = HostPolicyMock.Mock_corehost_resolve_component_dependencies( 134, "", @@ -76,7 +74,7 @@ public void TestComponentLoadFailure() public void TestComponentLoadFailureWithPreviousErrorWriter() { IntPtr previousWriter = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate( - (HostPolicyMock.ErrorWriterDelegate)((string _) => { Assert.True(false, "Should never get here"); })); + (HostPolicyMock.ErrorWriterDelegate)((string _) => { Assert.True(false); })); using (HostPolicyMock.MockValues_corehost_set_error_writer errorWriterMock = HostPolicyMock.Mock_corehost_set_error_writer(previousWriter)) @@ -105,7 +103,7 @@ public void TestAssembly() string assemblyDependencyPath = CreateMockAssembly("AssemblyDependency.dll"); IntPtr previousWriter = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate( - (HostPolicyMock.ErrorWriterDelegate)((string _) => { Assert.True(false, "Should never get here"); })); + (HostPolicyMock.ErrorWriterDelegate)((string _) => { Assert.True(false); })); using (HostPolicyMock.MockValues_corehost_set_error_writer errorWriterMock = HostPolicyMock.Mock_corehost_set_error_writer(previousWriter)) diff --git a/src/tests/Loader/AssemblyDependencyResolver/AssemblyDependencyResolverTests/NativeDependencyTests.cs b/src/tests/Loader/AssemblyDependencyResolver/AssemblyDependencyResolverTests/NativeDependencyTests.cs index bce770fd2222ec..b49516e33bcd84 100644 --- a/src/tests/Loader/AssemblyDependencyResolver/AssemblyDependencyResolverTests/NativeDependencyTests.cs +++ b/src/tests/Loader/AssemblyDependencyResolver/AssemblyDependencyResolverTests/NativeDependencyTests.cs @@ -7,8 +7,6 @@ using TestLibrary; using Xunit; -using Assert = Xunit.Assert; - namespace AssemblyDependencyResolverTests { class NativeDependencyTests : TestBase diff --git a/src/tests/Loader/AssemblyDependencyResolver/MissingHostPolicyTests/InvalidHostingTest.cs b/src/tests/Loader/AssemblyDependencyResolver/MissingHostPolicyTests/InvalidHostingTest.cs index 48a436e0354c26..828a555369f5e7 100644 --- a/src/tests/Loader/AssemblyDependencyResolver/MissingHostPolicyTests/InvalidHostingTest.cs +++ b/src/tests/Loader/AssemblyDependencyResolver/MissingHostPolicyTests/InvalidHostingTest.cs @@ -3,15 +3,12 @@ using System; using System.IO; using System.Runtime.Loader; -using TestLibrary; using Xunit; -using Assert = Xunit.Assert; - namespace AssemblyDependencyResolverTests { class InvalidHostingTest - { + { public static int Main(string [] args) { try @@ -22,7 +19,7 @@ public static int Main(string [] args) Directory.CreateDirectory(componentDirectory); string componentAssemblyPath = Path.Combine(componentDirectory, "InvalidHostingComponent.dll"); File.WriteAllText(componentAssemblyPath, "Mock assembly"); - + object innerException = Assert.Throws(() => { AssemblyDependencyResolver resolver = new AssemblyDependencyResolver( diff --git a/src/tests/Loader/ContextualReflection/ContextualReflection.cs b/src/tests/Loader/ContextualReflection/ContextualReflection.cs index de52a7721629e2..3ac42f5f44c1fa 100644 --- a/src/tests/Loader/ContextualReflection/ContextualReflection.cs +++ b/src/tests/Loader/ContextualReflection/ContextualReflection.cs @@ -10,7 +10,7 @@ using System.Runtime.Loader; using System.Runtime.Remoting; using System.Threading.Tasks; -using TestLibrary; +using Xunit; namespace ContextualReflectionTest { @@ -60,7 +60,7 @@ public void InitializeIsolation(bool isolated) defaultAssembly = Assembly.GetExecutingAssembly(); alcAssembly = alc.LoadFromAssemblyPath(defaultAssembly.Location); - Assert.AreEqual(alcAssembly, alc.LoadFromAssemblyName(alcAssembly.GetName())); + Assert.Equal(alcAssembly, alc.LoadFromAssemblyName(alcAssembly.GetName())); alcProgramType = alcAssembly.GetType("ContextualReflectionTest.Program"); @@ -82,39 +82,39 @@ public void InitializeIsolation(bool isolated) void VerifyIsolationDefault() { VerifyIsolation(); - Assert.AreEqual(defaultAssembly, Assembly.GetExecutingAssembly()); - Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly())); - Assert.AreNotEqual(alcProgramType, typeof(Program)); - Assert.AreNotEqual((object)alcProgramInstance, (object)this); + Assert.Equal(defaultAssembly, Assembly.GetExecutingAssembly()); + Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly())); + Assert.NotEqual(alcProgramType, typeof(Program)); + Assert.NotEqual((object)alcProgramInstance, (object)this); } void VerifyIsolationAlc() { VerifyIsolation(); - Assert.AreEqual(alcAssembly, Assembly.GetExecutingAssembly()); - Assert.AreEqual(alc, AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly())); - Assert.AreEqual(alcProgramType, typeof(Program)); - Assert.AreEqual((object)alcProgramInstance, (object)this); + Assert.Equal(alcAssembly, Assembly.GetExecutingAssembly()); + Assert.Equal(alc, AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly())); + Assert.Equal(alcProgramType, typeof(Program)); + Assert.Equal((object)alcProgramInstance, (object)this); } void VerifyIsolation() { - Assert.AreEqual("Default", AssemblyLoadContext.Default.Name); + Assert.Equal("Default", AssemblyLoadContext.Default.Name); - Assert.IsNotNull(alc); - Assert.IsNotNull(alcAssembly); - Assert.IsNotNull(alcProgramType); - Assert.IsNotNull(alcProgramInstance); + Assert.NotNull(alc); + Assert.NotNull(alcAssembly); + Assert.NotNull(alcProgramType); + Assert.NotNull(alcProgramInstance); - Assert.AreEqual("Isolated", alc.Name); + Assert.Equal("Isolated", alc.Name); - Assert.AreNotEqual(defaultAssembly, alcAssembly); - Assert.AreNotEqual(alc, AssemblyLoadContext.Default); + Assert.NotEqual(defaultAssembly, alcAssembly); + Assert.NotEqual(alc, AssemblyLoadContext.Default); - Assert.AreEqual(alc, AssemblyLoadContext.GetLoadContext(alcProgramInstance.alcAssembly)); - Assert.AreEqual(alcAssembly, alcProgramInstance.alcAssembly); - Assert.AreEqual(alcProgramType, alcProgramInstance.alcProgramType); - Assert.AreEqual(alcProgramInstance, alcProgramInstance.alcProgramInstance); + Assert.Equal(alc, AssemblyLoadContext.GetLoadContext(alcProgramInstance.alcAssembly)); + Assert.Equal(alcAssembly, alcProgramInstance.alcAssembly); + Assert.Equal(alcProgramType, alcProgramInstance.alcProgramType); + Assert.Equal(alcProgramInstance, alcProgramInstance.alcProgramInstance); } void VerifyTestResolve() @@ -133,160 +133,160 @@ void VerifyTestResolve() void VerifyContextualReflectionProxy() { - Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext); using (alc.EnterContextualReflection()) { - Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext); using (AssemblyLoadContext.Default.EnterContextualReflection()) { - Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext); using (AssemblyLoadContext.EnterContextualReflection(null)) { - Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext); using (AssemblyLoadContext.EnterContextualReflection(alcAssembly)) { - Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext); } - Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext); } - Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext); } - Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext); } - Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext); } void VerifyUsingStatementContextualReflectionUsage() { - Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext); { using IDisposable alcScope = alc.EnterContextualReflection(); - Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext); } - Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext); { using IDisposable alcScope = alc.EnterContextualReflection(); - Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext); alcScope.Dispose(); - Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext); } - Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext); { using IDisposable alcScope = alc.EnterContextualReflection(); - Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext); alcScope.Dispose(); - Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext); alcScope.Dispose(); } - Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext); { using IDisposable alcScope = alc.EnterContextualReflection(); - Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext); { using IDisposable defaultScope = AssemblyLoadContext.Default.EnterContextualReflection(); - Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext); } - Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext); } - Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext); { using IDisposable alcScope = alc.EnterContextualReflection(); - Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext); try { using IDisposable defaultScope = AssemblyLoadContext.Default.EnterContextualReflection(); - Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext); throw new InvalidOperationException(); } catch { } - Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext); } - Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext); { using IDisposable alcScope = alc.EnterContextualReflection(); - Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext); using IDisposable defaultScope = AssemblyLoadContext.Default.EnterContextualReflection(); - Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext); defaultScope.Dispose(); - Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext); alcScope.Dispose(); } - Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext); } void VerifyBadContextualReflectionUsage() { - Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext); { IDisposable alcScope = alc.EnterContextualReflection(); - Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext); alcScope.Dispose(); } - Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext); { IDisposable alcScope = alc.EnterContextualReflection(); - Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext); alcScope.Dispose(); alcScope.Dispose(); } - Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext); { IDisposable alcScope = alc.EnterContextualReflection(); - Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext); IDisposable defaultScope = AssemblyLoadContext.Default.EnterContextualReflection(); - Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext); defaultScope.Dispose(); - Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext); alcScope.Dispose(); } - Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext); { IDisposable alcScope = alc.EnterContextualReflection(); - Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext); IDisposable defaultScope = AssemblyLoadContext.Default.EnterContextualReflection(); - Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.CurrentContextualReflectionContext); alcScope.Dispose(); - Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext); defaultScope.Dispose(); - Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext); alcScope.Dispose(); } - Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext); { IDisposable alcScope = alc.EnterContextualReflection(); - Assert.AreEqual(alc, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(alc, AssemblyLoadContext.CurrentContextualReflectionContext); try { IDisposable defaultScope = AssemblyLoadContext.EnterContextualReflection(null); - Assert.AreEqual(null, AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Equal(null, AssemblyLoadContext.CurrentContextualReflectionContext); throw new InvalidOperationException(); } @@ -295,7 +295,7 @@ void VerifyBadContextualReflectionUsage() } } - Assert.IsNull(AssemblyLoadContext.CurrentContextualReflectionContext); + Assert.Null(AssemblyLoadContext.CurrentContextualReflectionContext); } void TestResolveMissingAssembly(bool isolated, Action action, bool skipNullIsolated = false) @@ -335,31 +335,31 @@ void TestAssemblyLoad(bool isolated, Func assemblyLoad) { Assembly assembly = assemblyLoad("ContextualReflection"); - Assert.AreEqual(isolated ? alc : AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(assembly)); + Assert.Equal(isolated ? alc : AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(assembly)); Assembly depends = assemblyLoad("ContextualReflectionDependency"); - Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(depends)); + Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(depends)); } using (AssemblyLoadContext.Default.EnterContextualReflection()) { Assembly assembly = assemblyLoad("ContextualReflection"); - Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(assembly)); + Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(assembly)); Assembly depends = assemblyLoad("ContextualReflectionDependency"); - Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(depends)); + Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(depends)); } using (alc.EnterContextualReflection()) { Assembly assembly = assemblyLoad("ContextualReflection"); - Assert.AreEqual(alc, AssemblyLoadContext.GetLoadContext(assembly)); + Assert.Equal(alc, AssemblyLoadContext.GetLoadContext(assembly)); Assembly depends = assemblyLoad("ContextualReflectionDependency"); - Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(depends)); + Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(depends)); } } @@ -384,29 +384,29 @@ void TestTypeGetType(bool isolated, Func typeGetType) Assembly expectedAssembly = Assembly.GetExecutingAssembly(); - Assert.IsNotNull(p); - Assert.AreEqual(expectedAssembly, p.Assembly); - Assert.AreEqual(typeof (Program), p); + Assert.NotNull(p); + Assert.Equal(expectedAssembly, p.Assembly); + Assert.Equal(typeof (Program), p); } { Type p = typeGetType("ContextualReflectionTest.Program, ContextualReflection"); Assembly expectedAssembly = Assembly.GetExecutingAssembly(); - Assert.IsNotNull(p); - Assert.AreEqual(expectedAssembly, p.Assembly); - Assert.AreEqual(typeof (Program), p); + Assert.NotNull(p); + Assert.Equal(expectedAssembly, p.Assembly); + Assert.Equal(typeof (Program), p); } { Type g = typeGetType("ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]], ContextualReflection"); Assembly expectedAssembly = Assembly.GetExecutingAssembly(); - Assert.IsNotNull(g); - Assert.AreEqual(expectedAssembly, g.Assembly); - Assert.AreEqual(expectedAssembly, g.GenericTypeArguments[0].Assembly); - Assert.AreEqual(typeof (Program), g.GenericTypeArguments[0]); - Assert.AreEqual(isolated ? alc : AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(g.GenericTypeArguments[0].Assembly)); + Assert.NotNull(g); + Assert.Equal(expectedAssembly, g.Assembly); + Assert.Equal(expectedAssembly, g.GenericTypeArguments[0].Assembly); + Assert.Equal(typeof (Program), g.GenericTypeArguments[0]); + Assert.Equal(isolated ? alc : AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(g.GenericTypeArguments[0].Assembly)); } } using (AssemblyLoadContext.Default.EnterContextualReflection()) @@ -416,29 +416,29 @@ void TestTypeGetType(bool isolated, Func typeGetType) Assembly expectedAssembly = Assembly.GetExecutingAssembly(); - Assert.IsNotNull(p); - Assert.AreEqual(expectedAssembly, p.Assembly); - Assert.AreEqual(typeof (Program), p); + Assert.NotNull(p); + Assert.Equal(expectedAssembly, p.Assembly); + Assert.Equal(typeof (Program), p); } { Type p = typeGetType("ContextualReflectionTest.Program, ContextualReflection"); Assembly expectedAssembly = defaultAssembly; - Assert.IsNotNull(p); - Assert.AreEqual(expectedAssembly, p.Assembly); - Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(p.Assembly)); + Assert.NotNull(p); + Assert.Equal(expectedAssembly, p.Assembly); + Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(p.Assembly)); } { Type g = typeGetType("ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]], ContextualReflection"); Assembly expectedAssembly = defaultAssembly; - Assert.IsNotNull(g); - Assert.AreEqual(expectedAssembly, g.Assembly); - Assert.AreEqual(expectedAssembly, g.GenericTypeArguments[0].Assembly); - Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(g.Assembly)); - Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(g.GenericTypeArguments[0].Assembly)); + Assert.NotNull(g); + Assert.Equal(expectedAssembly, g.Assembly); + Assert.Equal(expectedAssembly, g.GenericTypeArguments[0].Assembly); + Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(g.Assembly)); + Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(g.GenericTypeArguments[0].Assembly)); } } using (alc.EnterContextualReflection()) @@ -448,29 +448,29 @@ void TestTypeGetType(bool isolated, Func typeGetType) Assembly expectedAssembly = Assembly.GetExecutingAssembly(); - Assert.IsNotNull(p); - Assert.AreEqual(expectedAssembly, p.Assembly); - Assert.AreEqual(typeof (Program), p); + Assert.NotNull(p); + Assert.Equal(expectedAssembly, p.Assembly); + Assert.Equal(typeof (Program), p); } { Type p = typeGetType("ContextualReflectionTest.Program, ContextualReflection"); Assembly expectedAssembly = alcAssembly; - Assert.IsNotNull(p); - Assert.AreEqual(expectedAssembly, p.Assembly); - Assert.AreEqual(alc, AssemblyLoadContext.GetLoadContext(p.Assembly)); + Assert.NotNull(p); + Assert.Equal(expectedAssembly, p.Assembly); + Assert.Equal(alc, AssemblyLoadContext.GetLoadContext(p.Assembly)); } { Type g = typeGetType("ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]], ContextualReflection"); Assembly expectedAssembly = alcAssembly; - Assert.IsNotNull(g); - Assert.AreEqual(expectedAssembly, g.Assembly); - Assert.AreEqual(expectedAssembly, g.GenericTypeArguments[0].Assembly); - Assert.AreEqual(alc, AssemblyLoadContext.GetLoadContext(g.Assembly)); - Assert.AreEqual(alc, AssemblyLoadContext.GetLoadContext(g.GenericTypeArguments[0].Assembly)); + Assert.NotNull(g); + Assert.Equal(expectedAssembly, g.Assembly); + Assert.Equal(expectedAssembly, g.GenericTypeArguments[0].Assembly); + Assert.Equal(alc, AssemblyLoadContext.GetLoadContext(g.Assembly)); + Assert.Equal(alc, AssemblyLoadContext.GetLoadContext(g.GenericTypeArguments[0].Assembly)); } } } @@ -486,20 +486,20 @@ void TestAssemblyGetType(bool isolated) { Type g = assembly.GetType("ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program]]", throwOnError : false); - Assert.IsNotNull(g); - Assert.AreEqual(assembly, g.Assembly); - Assert.AreEqual(assembly, g.GenericTypeArguments[0].Assembly); - Assert.AreEqual(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly); - Assert.AreEqual(typeof (Program), g.GenericTypeArguments[0]); + Assert.NotNull(g); + Assert.Equal(assembly, g.Assembly); + Assert.Equal(assembly, g.GenericTypeArguments[0].Assembly); + Assert.Equal(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly); + Assert.Equal(typeof (Program), g.GenericTypeArguments[0]); } { Type g = assembly.GetType("ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]]", throwOnError : false); - Assert.IsNotNull(g); - Assert.AreEqual(assembly, g.Assembly); - Assert.AreEqual(assembly, g.GenericTypeArguments[0].Assembly); - Assert.AreEqual(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly); - Assert.AreEqual(typeof (Program), g.GenericTypeArguments[0]); + Assert.NotNull(g); + Assert.Equal(assembly, g.Assembly); + Assert.Equal(assembly, g.GenericTypeArguments[0].Assembly); + Assert.Equal(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly); + Assert.Equal(typeof (Program), g.GenericTypeArguments[0]); } { Assembly mscorlib = typeof (System.Collections.Generic.List).Assembly; @@ -508,9 +508,9 @@ void TestAssemblyGetType(bool isolated) Assembly expectedAssembly = mscorlib; - Assert.IsNotNull(m); - Assert.AreEqual(expectedAssembly, m.Assembly); - Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly)); + Assert.NotNull(m); + Assert.Equal(expectedAssembly, m.Assembly); + Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly)); } } using (AssemblyLoadContext.Default.EnterContextualReflection()) @@ -518,20 +518,20 @@ void TestAssemblyGetType(bool isolated) { Type g = assembly.GetType("ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program]]", throwOnError : false); - Assert.IsNotNull(g); - Assert.AreEqual(assembly, g.Assembly); - Assert.AreEqual(assembly, g.GenericTypeArguments[0].Assembly); - Assert.AreEqual(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly); - Assert.AreEqual(typeof (Program), g.GenericTypeArguments[0]); + Assert.NotNull(g); + Assert.Equal(assembly, g.Assembly); + Assert.Equal(assembly, g.GenericTypeArguments[0].Assembly); + Assert.Equal(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly); + Assert.Equal(typeof (Program), g.GenericTypeArguments[0]); } { Type g = assembly.GetType("ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]]", throwOnError : false); Assembly expectedAssembly = defaultAssembly; - Assert.IsNotNull(g); - Assert.AreEqual(assembly, g.Assembly); - Assert.AreEqual(expectedAssembly, g.GenericTypeArguments[0].Assembly); + Assert.NotNull(g); + Assert.Equal(assembly, g.Assembly); + Assert.Equal(expectedAssembly, g.GenericTypeArguments[0].Assembly); } { Assembly mscorlib = typeof (System.Collections.Generic.List).Assembly; @@ -540,9 +540,9 @@ void TestAssemblyGetType(bool isolated) Assembly expectedAssembly = mscorlib; - Assert.IsNotNull(m); - Assert.AreEqual(expectedAssembly, m.Assembly); - Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly)); + Assert.NotNull(m); + Assert.Equal(expectedAssembly, m.Assembly); + Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly)); } } using (alc.EnterContextualReflection()) @@ -550,20 +550,20 @@ void TestAssemblyGetType(bool isolated) { Type g = assembly.GetType("ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program]]", throwOnError : false); - Assert.IsNotNull(g); - Assert.AreEqual(assembly, g.Assembly); - Assert.AreEqual(assembly, g.GenericTypeArguments[0].Assembly); - Assert.AreEqual(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly); - Assert.AreEqual(typeof (Program), g.GenericTypeArguments[0]); + Assert.NotNull(g); + Assert.Equal(assembly, g.Assembly); + Assert.Equal(assembly, g.GenericTypeArguments[0].Assembly); + Assert.Equal(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly); + Assert.Equal(typeof (Program), g.GenericTypeArguments[0]); } { Type g = assembly.GetType("ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]]", throwOnError : false); Assembly expectedAssembly = alcAssembly; - Assert.IsNotNull(g); - Assert.AreEqual(assembly, g.Assembly); - Assert.AreEqual(expectedAssembly, g.GenericTypeArguments[0].Assembly); + Assert.NotNull(g); + Assert.Equal(assembly, g.Assembly); + Assert.Equal(expectedAssembly, g.GenericTypeArguments[0].Assembly); } { Assembly mscorlib = typeof (System.Collections.Generic.List).Assembly; @@ -572,9 +572,9 @@ void TestAssemblyGetType(bool isolated) Assembly expectedAssembly = mscorlib; - Assert.IsNotNull(m); - Assert.AreEqual(expectedAssembly, m.Assembly); - Assert.AreEqual(alc, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly)); + Assert.NotNull(m); + Assert.Equal(expectedAssembly, m.Assembly); + Assert.Equal(alc, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly)); } } } @@ -597,21 +597,21 @@ void TestActivatorCreateInstance(bool isolated) ObjectHandle objectHandle = Activator.CreateInstance(null, "ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program]]"); Type g = objectHandle.Unwrap().GetType(); - Assert.IsNotNull(g); - Assert.AreEqual(assembly, g.Assembly); - Assert.AreEqual(assembly, g.GenericTypeArguments[0].Assembly); - Assert.AreEqual(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly); - Assert.AreEqual(typeof (Program), g.GenericTypeArguments[0]); + Assert.NotNull(g); + Assert.Equal(assembly, g.Assembly); + Assert.Equal(assembly, g.GenericTypeArguments[0].Assembly); + Assert.Equal(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly); + Assert.Equal(typeof (Program), g.GenericTypeArguments[0]); } { ObjectHandle objectHandle = Activator.CreateInstance(null, "ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]]"); Type g = objectHandle.Unwrap().GetType(); - Assert.IsNotNull(g); - Assert.AreEqual(assembly, g.Assembly); - Assert.AreEqual(assembly, g.GenericTypeArguments[0].Assembly); - Assert.AreEqual(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly); - Assert.AreEqual(typeof (Program), g.GenericTypeArguments[0]); + Assert.NotNull(g); + Assert.Equal(assembly, g.Assembly); + Assert.Equal(assembly, g.GenericTypeArguments[0].Assembly); + Assert.Equal(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly); + Assert.Equal(typeof (Program), g.GenericTypeArguments[0]); } { ObjectHandle objectHandle = Activator.CreateInstance("ContextualReflection" , "ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]]"); @@ -619,9 +619,9 @@ void TestActivatorCreateInstance(bool isolated) Assembly expectedAssembly = assembly; - Assert.IsNotNull(g); - Assert.AreEqual(expectedAssembly, g.Assembly); - Assert.AreEqual(expectedAssembly, g.GenericTypeArguments[0].Assembly); + Assert.NotNull(g); + Assert.Equal(expectedAssembly, g.Assembly); + Assert.Equal(expectedAssembly, g.GenericTypeArguments[0].Assembly); } { Assembly expectedAssembly = alcAssembly; @@ -631,9 +631,9 @@ void TestActivatorCreateInstance(bool isolated) ObjectHandle objectHandle = Activator.CreateInstance(mscorlib.GetName().Name, "System.Collections.Generic.List`1[[ContextualReflectionTest.Program, ContextualReflection]]"); Type m = objectHandle.Unwrap().GetType(); - Assert.IsNotNull(m); - Assert.AreEqual(mscorlib, m.Assembly); - Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly)); + Assert.NotNull(m); + Assert.Equal(mscorlib, m.Assembly); + Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly)); } } using (AssemblyLoadContext.Default.EnterContextualReflection()) @@ -642,11 +642,11 @@ void TestActivatorCreateInstance(bool isolated) ObjectHandle objectHandle = Activator.CreateInstance(null, "ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program]]"); Type g = objectHandle.Unwrap().GetType(); - Assert.IsNotNull(g); - Assert.AreEqual(assembly, g.Assembly); - Assert.AreEqual(assembly, g.GenericTypeArguments[0].Assembly); - Assert.AreEqual(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly); - Assert.AreEqual(typeof (Program), g.GenericTypeArguments[0]); + Assert.NotNull(g); + Assert.Equal(assembly, g.Assembly); + Assert.Equal(assembly, g.GenericTypeArguments[0].Assembly); + Assert.Equal(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly); + Assert.Equal(typeof (Program), g.GenericTypeArguments[0]); } { ObjectHandle objectHandle = Activator.CreateInstance(null, "ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]]"); @@ -654,9 +654,9 @@ void TestActivatorCreateInstance(bool isolated) Assembly expectedAssembly = defaultAssembly; - Assert.IsNotNull(g); - Assert.AreEqual(assembly, g.Assembly); - Assert.AreEqual(expectedAssembly, g.GenericTypeArguments[0].Assembly); + Assert.NotNull(g); + Assert.Equal(assembly, g.Assembly); + Assert.Equal(expectedAssembly, g.GenericTypeArguments[0].Assembly); } { ObjectHandle objectHandle = Activator.CreateInstance("ContextualReflection" , "ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]]"); @@ -664,9 +664,9 @@ void TestActivatorCreateInstance(bool isolated) Assembly expectedAssembly = defaultAssembly; - Assert.IsNotNull(g); - Assert.AreEqual(expectedAssembly, g.Assembly); - Assert.AreEqual(expectedAssembly, g.GenericTypeArguments[0].Assembly); + Assert.NotNull(g); + Assert.Equal(expectedAssembly, g.Assembly); + Assert.Equal(expectedAssembly, g.GenericTypeArguments[0].Assembly); } { Assembly mscorlib = typeof (System.Collections.Generic.List).Assembly; @@ -676,9 +676,9 @@ void TestActivatorCreateInstance(bool isolated) Assembly expectedAssembly = mscorlib; - Assert.IsNotNull(m); - Assert.AreEqual(expectedAssembly, m.Assembly); - Assert.AreEqual(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly)); + Assert.NotNull(m); + Assert.Equal(expectedAssembly, m.Assembly); + Assert.Equal(AssemblyLoadContext.Default, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly)); } } using (alc.EnterContextualReflection()) @@ -687,11 +687,11 @@ void TestActivatorCreateInstance(bool isolated) ObjectHandle objectHandle = Activator.CreateInstance(null, "ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program]]"); Type g = objectHandle.Unwrap().GetType(); - Assert.IsNotNull(g); - Assert.AreEqual(assembly, g.Assembly); - Assert.AreEqual(assembly, g.GenericTypeArguments[0].Assembly); - Assert.AreEqual(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly); - Assert.AreEqual(typeof (Program), g.GenericTypeArguments[0]); + Assert.NotNull(g); + Assert.Equal(assembly, g.Assembly); + Assert.Equal(assembly, g.GenericTypeArguments[0].Assembly); + Assert.Equal(Assembly.GetExecutingAssembly(), g.GenericTypeArguments[0].Assembly); + Assert.Equal(typeof (Program), g.GenericTypeArguments[0]); } { ObjectHandle objectHandle = Activator.CreateInstance(null, "ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]]"); @@ -699,9 +699,9 @@ void TestActivatorCreateInstance(bool isolated) Assembly expectedAssembly = alcAssembly; - Assert.IsNotNull(g); - Assert.AreEqual(assembly, g.Assembly); - Assert.AreEqual(expectedAssembly, g.GenericTypeArguments[0].Assembly); + Assert.NotNull(g); + Assert.Equal(assembly, g.Assembly); + Assert.Equal(expectedAssembly, g.GenericTypeArguments[0].Assembly); } { ObjectHandle objectHandle = Activator.CreateInstance("ContextualReflection" , "ContextualReflectionTest.AGenericClass`1[[ContextualReflectionTest.Program, ContextualReflection]]"); @@ -709,9 +709,9 @@ void TestActivatorCreateInstance(bool isolated) Assembly expectedAssembly = alcAssembly; - Assert.IsNotNull(g); - Assert.AreEqual(expectedAssembly, g.Assembly); - Assert.AreEqual(expectedAssembly, g.GenericTypeArguments[0].Assembly); + Assert.NotNull(g); + Assert.Equal(expectedAssembly, g.Assembly); + Assert.Equal(expectedAssembly, g.GenericTypeArguments[0].Assembly); } { Assembly mscorlib = typeof (System.Collections.Generic.List).Assembly; @@ -719,9 +719,9 @@ void TestActivatorCreateInstance(bool isolated) ObjectHandle objectHandle = Activator.CreateInstance(mscorlib.GetName().Name, "System.Collections.Generic.List`1[[ContextualReflectionTest.Program, ContextualReflection]]"); Type m = objectHandle.Unwrap().GetType(); - Assert.IsNotNull(m); - Assert.AreEqual(mscorlib, m.Assembly); - Assert.AreEqual(alc, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly)); + Assert.NotNull(m); + Assert.Equal(mscorlib, m.Assembly); + Assert.Equal(alc, AssemblyLoadContext.GetLoadContext(m.GenericTypeArguments[0].Assembly)); } } } @@ -737,13 +737,13 @@ void TestDefineDynamicAssembly(bool collectibleContext, AssemblyBuilderAccess as } AssemblyLoadContext context = AssemblyLoadContext.GetLoadContext(assemblyBuilder); - Assert.AreEqual(assemblyLoadContext, context); - Assert.IsTrue(assemblyLoadContext.Assemblies.Any(a => AssemblyName.ReferenceMatchesDefinition(a.GetName(), assemblyBuilder.GetName()))); + Assert.Equal(assemblyLoadContext, context); + Assert.True(assemblyLoadContext.Assemblies.Any(a => AssemblyName.ReferenceMatchesDefinition(a.GetName(), assemblyBuilder.GetName()))); } void TestMockAssemblyThrows() { - Exception e = Assert.ThrowsArgumentException("activating", () => AssemblyLoadContext.EnterContextualReflection(new MockAssembly())); + Exception e = AssertExtensions.ThrowsArgumentException("activating", () => AssemblyLoadContext.EnterContextualReflection(new MockAssembly())); } public void RunTests() diff --git a/src/tests/Loader/ContextualReflection/ContextualReflectionDependency.cs b/src/tests/Loader/ContextualReflection/ContextualReflectionDependency.cs index dd44f3c334584a..f23c41ba6f1f38 100644 --- a/src/tests/Loader/ContextualReflection/ContextualReflectionDependency.cs +++ b/src/tests/Loader/ContextualReflection/ContextualReflectionDependency.cs @@ -58,7 +58,7 @@ static public void Assert(ResolveEvents expected, Action action) } finally { - TestLibrary.Assert.AreEqual(expected, ResolveEvent); + Xunit.Assert.Equal(expected, ResolveEvent); } } } diff --git a/src/tests/Loader/binding/tracing/BinderEventListener.cs b/src/tests/Loader/binding/tracing/BinderEventListener.cs index 9696ad25199c17..56395b8283b300 100644 --- a/src/tests/Loader/binding/tracing/BinderEventListener.cs +++ b/src/tests/Loader/binding/tracing/BinderEventListener.cs @@ -8,7 +8,7 @@ using System.Threading; using System.Reflection; -using TestLibrary; +using Xunit; namespace BinderTracingTests { @@ -171,7 +171,7 @@ public BinderEventListener(string[] loadsToTrack, bool log = false) public BindOperation[] WaitAndGetEventsForAssembly(AssemblyName assemblyName) { - Assert.IsTrue(IsLoadToTrack(assemblyName.Name), $"Waiting for load for untracked name: {assemblyName.Name}. Tracking loads for: {string.Join(", ", loadsToTrack)}"); + Assert.True(IsLoadToTrack(assemblyName.Name), $"Waiting for load for untracked name: {assemblyName.Name}. Tracking loads for: {string.Join(", ", loadsToTrack)}"); const int waitIntervalInMs = 50; int waitTimeoutInMs = Environment.GetEnvironmentVariable("COMPlus_GCStress") == null @@ -232,7 +232,7 @@ object GetData(string name) lock (eventsLock) { - Assert.IsTrue(!bindOperations.ContainsKey(data.ActivityId), "AssemblyLoadStart should not exist for same activity ID "); + Assert.True(!bindOperations.ContainsKey(data.ActivityId), "AssemblyLoadStart should not exist for same activity ID "); bindOperation.Nested = bindOperations.ContainsKey(data.RelatedActivityId); bindOperations.Add(data.ActivityId, bindOperation); if (bindOperation.Nested) @@ -253,7 +253,7 @@ object GetData(string name) lock (eventsLock) { if (!bindOperations.ContainsKey(data.ActivityId)) - Assert.Fail(GetMissingAssemblyBindStartMessage(data, $"Success={success}, Name={resultName}")); + Assert.True(false, GetMissingAssemblyBindStartMessage(data, $"Success={success}, Name={resultName}")); BindOperation bind = bindOperations[data.ActivityId]; bind.Success = success; @@ -276,7 +276,7 @@ object GetData(string name) lock (eventsLock) { if (!bindOperations.ContainsKey(data.ActivityId)) - Assert.Fail(GetMissingAssemblyBindStartMessage(data, attempt.ToString())); + Assert.True(false, GetMissingAssemblyBindStartMessage(data, attempt.ToString())); BindOperation bind = bindOperations[data.ActivityId]; bind.ResolutionAttempts.Add(attempt); @@ -292,7 +292,7 @@ object GetData(string name) lock (eventsLock) { if (!bindOperations.ContainsKey(data.ActivityId)) - Assert.Fail(GetMissingAssemblyBindStartMessage(data, handlerInvocation.ToString())); + Assert.True(false, GetMissingAssemblyBindStartMessage(data, handlerInvocation.ToString())); BindOperation bind = bindOperations[data.ActivityId]; bind.AssemblyLoadContextResolvingHandlers.Add(handlerInvocation); @@ -308,7 +308,7 @@ object GetData(string name) lock (eventsLock) { if (!bindOperations.ContainsKey(data.ActivityId)) - Assert.Fail(GetMissingAssemblyBindStartMessage(data, handlerInvocation.ToString())); + Assert.True(false, GetMissingAssemblyBindStartMessage(data, handlerInvocation.ToString())); BindOperation bind = bindOperations[data.ActivityId]; bind.AppDomainAssemblyResolveHandlers.Add(handlerInvocation); @@ -324,7 +324,7 @@ object GetData(string name) lock (eventsLock) { if (!bindOperations.ContainsKey(data.ActivityId)) - Assert.Fail(GetMissingAssemblyBindStartMessage(data, loadFrom.ToString())); + Assert.True(false, GetMissingAssemblyBindStartMessage(data, loadFrom.ToString())); BindOperation bind = bindOperations[data.ActivityId]; bind.AssemblyLoadFromHandler = loadFrom; @@ -341,7 +341,7 @@ object GetData(string name) lock (eventsLock) { if (!bindOperations.ContainsKey(data.ActivityId)) - Assert.Fail(GetMissingAssemblyBindStartMessage(data, probedPath.ToString())); + Assert.True(false, GetMissingAssemblyBindStartMessage(data, probedPath.ToString())); BindOperation bind = bindOperations[data.ActivityId]; bind.ProbedPaths.Add(probedPath); diff --git a/src/tests/Loader/binding/tracing/BinderTracingTest.Basic.cs b/src/tests/Loader/binding/tracing/BinderTracingTest.Basic.cs index d50d8810f0bd9f..7a894458185c2c 100644 --- a/src/tests/Loader/binding/tracing/BinderTracingTest.Basic.cs +++ b/src/tests/Loader/binding/tracing/BinderTracingTest.Basic.cs @@ -9,7 +9,7 @@ using System.Reflection; using System.Runtime.Loader; -using TestLibrary; +using Xunit; namespace BinderTracingTests { diff --git a/src/tests/Loader/binding/tracing/BinderTracingTest.DefaultProbing.cs b/src/tests/Loader/binding/tracing/BinderTracingTest.DefaultProbing.cs index 2777609a7aa827..6a3ef071ab7468 100644 --- a/src/tests/Loader/binding/tracing/BinderTracingTest.DefaultProbing.cs +++ b/src/tests/Loader/binding/tracing/BinderTracingTest.DefaultProbing.cs @@ -11,7 +11,7 @@ using System.Runtime.Loader; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; namespace BinderTracingTests { diff --git a/src/tests/Loader/binding/tracing/BinderTracingTest.EventHandlers.cs b/src/tests/Loader/binding/tracing/BinderTracingTest.EventHandlers.cs index 89a809a2035baf..9596b84510f507 100644 --- a/src/tests/Loader/binding/tracing/BinderTracingTest.EventHandlers.cs +++ b/src/tests/Loader/binding/tracing/BinderTracingTest.EventHandlers.cs @@ -9,7 +9,7 @@ using System.Reflection; using System.Runtime.Loader; -using TestLibrary; +using Xunit; namespace BinderTracingTests { @@ -37,8 +37,8 @@ public static BindOperation AssemblyLoadContextResolving_ReturnNull() } catch { } - Assert.AreEqual(1, handlers.Invocations.Count); - Assert.AreEqual(0, handlers.Binds.Count); + Assert.Equal(1, handlers.Invocations.Count); + Assert.Equal(0, handlers.Binds.Count); return new BindOperation() { AssemblyName = assemblyName, @@ -62,8 +62,8 @@ public static BindOperation AssemblyLoadContextResolving_LoadAssembly() { Assembly asm = alc.LoadFromAssemblyName(assemblyName); - Assert.AreEqual(1, handlers.Invocations.Count); - Assert.AreEqual(1, handlers.Binds.Count); + Assert.Equal(1, handlers.Invocations.Count); + Assert.Equal(1, handlers.Binds.Count); return new BindOperation() { AssemblyName = assemblyName, @@ -87,8 +87,8 @@ public static BindOperation AssemblyLoadContextResolving_NameMismatch() { Assert.Throws(() => alc.LoadFromAssemblyName(assemblyName)); - Assert.AreEqual(1, handlers.Invocations.Count); - Assert.AreEqual(1, handlers.Binds.Count); + Assert.Equal(1, handlers.Invocations.Count); + Assert.Equal(1, handlers.Binds.Count); return new BindOperation() { AssemblyName = assemblyName, @@ -111,10 +111,10 @@ public static BindOperation AssemblyLoadContextResolving_MultipleHandlers() { Assembly asm = alc.LoadFromAssemblyName(assemblyName); - Assert.AreEqual(1, handlerNull.Invocations.Count); - Assert.AreEqual(0, handlerNull.Binds.Count); - Assert.AreEqual(1, handlerLoad.Invocations.Count); - Assert.AreEqual(1, handlerLoad.Binds.Count); + Assert.Equal(1, handlerNull.Invocations.Count); + Assert.Equal(0, handlerNull.Binds.Count); + Assert.Equal(1, handlerLoad.Invocations.Count); + Assert.Equal(1, handlerLoad.Binds.Count); return new BindOperation() { AssemblyName = assemblyName, @@ -141,8 +141,8 @@ public static BindOperation AppDomainAssemblyResolve_ReturnNull() } catch { } - Assert.AreEqual(1, handlers.Invocations.Count); - Assert.AreEqual(0, handlers.Binds.Count); + Assert.Equal(1, handlers.Invocations.Count); + Assert.Equal(0, handlers.Binds.Count); return new BindOperation() { AssemblyName = assemblyName, @@ -166,8 +166,8 @@ public static BindOperation AppDomainAssemblyResolve_LoadAssembly() { Assembly asm = alc.LoadFromAssemblyName(assemblyName); - Assert.AreEqual(1, handlers.Invocations.Count); - Assert.AreEqual(1, handlers.Binds.Count); + Assert.Equal(1, handlers.Invocations.Count); + Assert.Equal(1, handlers.Binds.Count); return new BindOperation() { AssemblyName = assemblyName, @@ -192,8 +192,8 @@ public static BindOperation AppDomainAssemblyResolve_NameMismatch() // Result of AssemblyResolve event does not get checked for name mismatch Assembly asm = alc.LoadFromAssemblyName(assemblyName); - Assert.AreEqual(1, handlers.Invocations.Count); - Assert.AreEqual(1, handlers.Binds.Count); + Assert.Equal(1, handlers.Invocations.Count); + Assert.Equal(1, handlers.Binds.Count); return new BindOperation() { AssemblyName = assemblyName, @@ -218,10 +218,10 @@ public static BindOperation AppDomainAssemblyResolve_MultipleHandlers() { Assembly asm = alc.LoadFromAssemblyName(assemblyName); - Assert.AreEqual(1, handlerNull.Invocations.Count); - Assert.AreEqual(0, handlerNull.Binds.Count); - Assert.AreEqual(1, handlerLoad.Invocations.Count); - Assert.AreEqual(1, handlerLoad.Binds.Count); + Assert.Equal(1, handlerNull.Invocations.Count); + Assert.Equal(0, handlerNull.Binds.Count); + Assert.Equal(1, handlerLoad.Invocations.Count); + Assert.Equal(1, handlerLoad.Binds.Count); return new BindOperation() { AssemblyName = assemblyName, @@ -283,7 +283,7 @@ public static BindOperation AssemblyLoadFromResolveHandler_MissingDependency() Assembly asm = Assembly.LoadFrom(assemblyPath); Type t = asm.GetType(DependentAssemblyTypeName); MethodInfo method = t.GetMethod("UseDependentAssembly", BindingFlags.Public | BindingFlags.Static); - Assert.Throws(() => method.Invoke(null, new object[0])); + AssertExtensions.ThrowsWithInnerException(() => method.Invoke(null, new object[0])); var assemblyName = new AssemblyName(asm.FullName); assemblyName.Name = "AssemblyToLoadDependency"; diff --git a/src/tests/Loader/binding/tracing/BinderTracingTest.ResolutionFlow.cs b/src/tests/Loader/binding/tracing/BinderTracingTest.ResolutionFlow.cs index 4ab8fc377300b8..780162821f5081 100644 --- a/src/tests/Loader/binding/tracing/BinderTracingTest.ResolutionFlow.cs +++ b/src/tests/Loader/binding/tracing/BinderTracingTest.ResolutionFlow.cs @@ -7,7 +7,7 @@ using System.Reflection; using System.Runtime.Loader; -using TestLibrary; +using Xunit; using ResolutionStage = BinderTracingTests.ResolutionAttempt.ResolutionStage; using ResolutionResult = BinderTracingTests.ResolutionAttempt.ResolutionResult; @@ -250,7 +250,7 @@ public static BindOperation AssemblyLoadContextLoad_Exception() var assemblyPath = Helpers.GetAssemblyInSubdirectoryPath(assemblyName.Name); CustomALC alc = new CustomALC(nameof(AssemblyLoadContextLoad), true /*throwOnLoad*/); - Assert.Throws(() => alc.LoadFromAssemblyName(assemblyName)); + AssertExtensions.ThrowsWithInnerException(() => alc.LoadFromAssemblyName(assemblyName)); return new BindOperation() { @@ -412,7 +412,7 @@ public static BindOperation AssemblyLoadContextResolvingEvent_CustomALC_Exceptio CustomALC alc = new CustomALC(nameof(AssemblyLoadContextResolvingEvent_CustomALC_Exception)); using (var handlers = new Handlers(HandlerReturn.Exception, alc)) { - Assert.Throws(() => alc.LoadFromAssemblyName(assemblyName)); + AssertExtensions.ThrowsWithInnerException(() => alc.LoadFromAssemblyName(assemblyName)); return new BindOperation() { @@ -444,7 +444,7 @@ public static BindOperation AssemblyLoadContextResolvingEvent_DefaultALC_Excepti var assemblyName = new AssemblyName(SubdirectoryAssemblyName); using (var handlers = new Handlers(HandlerReturn.Exception, AssemblyLoadContext.Default)) { - Assert.Throws(() => AssemblyLoadContext.Default.LoadFromAssemblyName(assemblyName)); + AssertExtensions.ThrowsWithInnerException(() => AssemblyLoadContext.Default.LoadFromAssemblyName(assemblyName)); return new BindOperation() { @@ -551,7 +551,7 @@ public static BindOperation AppDomainAssemblyResolveEvent_Exception() CustomALC alc = new CustomALC(nameof(AppDomainAssemblyResolveEvent_Exception)); using (var handlers = new Handlers(HandlerReturn.Exception)) { - Assert.Throws(() => alc.LoadFromAssemblyName(assemblyName)); + AssertExtensions.ThrowsWithInnerException(() => alc.LoadFromAssemblyName(assemblyName)); return new BindOperation() { @@ -585,7 +585,7 @@ public static BindOperation LoadFromAssemblyPath_FoundInAppPath() Assembly asm = AssemblyLoadContext.Default.LoadFromAssemblyPath(assemblyPath); - Assert.AreNotEqual(assemblyPath, asm.Location); + Assert.NotEqual(assemblyPath, asm.Location); return new BindOperation() { AssemblyName = asm.GetName(), diff --git a/src/tests/Loader/binding/tracing/BinderTracingTest.cs b/src/tests/Loader/binding/tracing/BinderTracingTest.cs index 8eb4c93e99a14e..d3f1fd8eee3db7 100644 --- a/src/tests/Loader/binding/tracing/BinderTracingTest.cs +++ b/src/tests/Loader/binding/tracing/BinderTracingTest.cs @@ -10,7 +10,7 @@ using System.Reflection; using System.Runtime.Loader; -using TestLibrary; +using Xunit; namespace BinderTracingTests { @@ -110,7 +110,7 @@ public static int Main(string[] args) // Run specific test - first argument should be the test method name MethodInfo method = typeof(BinderTracingTest) .GetMethod(args[0], BindingFlags.Public | BindingFlags.Static); - Assert.IsTrue(method != null && method.GetCustomAttribute() != null && method.ReturnType == typeof(BindOperation), "Invalid test method specified"); + Assert.True(method != null && method.GetCustomAttribute() != null && method.ReturnType == typeof(BindOperation)); success = RunSingleTest(method); } } @@ -150,7 +150,7 @@ private static bool RunSingleTest(MethodInfo method) { MethodInfo setupMethod = method.DeclaringType .GetMethod(attribute.TestSetup, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static); - Assert.IsTrue(setupMethod != null); + Assert.True(setupMethod != null); setupMethod.Invoke(null, new object[0]); } @@ -209,7 +209,7 @@ private static bool RunTestInSeparateProcess(MethodInfo method) private static void ValidateSingleBind(BinderEventListener listener, AssemblyName assemblyName, BindOperation expected) { BindOperation[] binds = listener.WaitAndGetEventsForAssembly(assemblyName); - Assert.IsTrue(binds.Length == 1, $"Bind event count for {assemblyName} - expected: 1, actual: {binds.Length}"); + Assert.True(binds.Length == 1, $"Bind event count for {assemblyName} - expected: 1, actual: {binds.Length}"); BindOperation actual = binds[0]; Helpers.ValidateBindOperation(expected, actual); diff --git a/src/tests/Loader/binding/tracing/Helpers.cs b/src/tests/Loader/binding/tracing/Helpers.cs index caebad92ce28ee..aee1dc18919608 100644 --- a/src/tests/Loader/binding/tracing/Helpers.cs +++ b/src/tests/Loader/binding/tracing/Helpers.cs @@ -9,7 +9,7 @@ using System.Reflection; using System.Runtime.Loader; -using TestLibrary; +using Xunit; namespace BinderTracingTests { @@ -18,14 +18,14 @@ internal class Helpers public static void ValidateBindOperation(BindOperation expected, BindOperation actual) { ValidateAssemblyName(expected.AssemblyName, actual.AssemblyName, nameof(BindOperation.AssemblyName)); - Assert.AreEqual(expected.AssemblyPath ?? string.Empty, actual.AssemblyPath, $"Unexpected value for {nameof(BindOperation.AssemblyPath)} on event"); - Assert.AreEqual(expected.AssemblyLoadContext, actual.AssemblyLoadContext, $"Unexpected value for {nameof(BindOperation.AssemblyLoadContext)} on event"); - Assert.AreEqual(expected.RequestingAssemblyLoadContext ?? string.Empty, actual.RequestingAssemblyLoadContext, $"Unexpected value for {nameof(BindOperation.RequestingAssemblyLoadContext)} on event"); + Assert.Equal(expected.AssemblyPath ?? string.Empty, actual.AssemblyPath); + Assert.Equal(expected.AssemblyLoadContext, actual.AssemblyLoadContext); + Assert.Equal(expected.RequestingAssemblyLoadContext ?? string.Empty, actual.RequestingAssemblyLoadContext); ValidateAssemblyName(expected.RequestingAssembly, actual.RequestingAssembly, nameof(BindOperation.RequestingAssembly)); - Assert.AreEqual(expected.Success, actual.Success, $"Unexpected value for {nameof(BindOperation.Success)} on event"); - Assert.AreEqual(expected.ResultAssemblyPath ?? string.Empty, actual.ResultAssemblyPath, $"Unexpected value for {nameof(BindOperation.ResultAssemblyPath)} on event"); - Assert.AreEqual(expected.Cached, actual.Cached, $"Unexpected value for {nameof(BindOperation.Cached)} on event"); + Assert.Equal(expected.Success, actual.Success); + Assert.Equal(expected.ResultAssemblyPath ?? string.Empty, actual.ResultAssemblyPath); + Assert.Equal(expected.Cached, actual.Cached); ValidateAssemblyName(expected.ResultAssemblyName, actual.ResultAssemblyName, nameof(BindOperation.ResultAssemblyName)); ValidateResolutionAttempts(expected.ResolutionAttempts, actual.ResolutionAttempts); @@ -101,14 +101,13 @@ public static bool AssemblyNamesMatch(AssemblyName name1, AssemblyName name2) private static void ValidateAssemblyName(AssemblyName expected, AssemblyName actual, string propertyName) { - Assert.IsTrue(AssemblyNamesMatch(expected, actual), $"Unexpected value for {propertyName} on event - expected: {expected}, actual: {actual}"); + Assert.True(AssemblyNamesMatch(expected, actual), $"Unexpected value for {propertyName} on event - expected: {expected}, actual: {actual}"); } private static void ValidateResolutionAttempts(List expected, List actual) { if (expected.Count > 0) - Assert.AreEqual(expected.Count, actual.Count, - $"Unexpected resolution attempt count. Actual events:{Environment.NewLine}{string.Join(Environment.NewLine, actual.Select(a => a.ToString()))}"); + Assert.Equal(expected.Count, actual.Count); for (var i = 0; i < expected.Count; i++) { @@ -117,18 +116,18 @@ private static void ValidateResolutionAttempts(List expected, string expectedActualMessage = $"{Environment.NewLine}Expected resolution attempt:{Environment.NewLine}{e.ToString()}{Environment.NewLine}Actual resolution attempt:{Environment.NewLine}{a.ToString()}"; ValidateAssemblyName(e.AssemblyName, a.AssemblyName, nameof(ResolutionAttempt.AssemblyName)); - Assert.AreEqual(e.Stage, a.Stage, $"Unexpected value for {nameof(ResolutionAttempt.Stage)} {expectedActualMessage}"); - Assert.AreEqual(e.AssemblyLoadContext, a.AssemblyLoadContext, $"Unexpected value for {nameof(ResolutionAttempt.AssemblyLoadContext)} {expectedActualMessage}"); - Assert.AreEqual(e.Result, a.Result, $"Unexpected value for {nameof(ResolutionAttempt.Result)} {expectedActualMessage}"); + Assert.Equal(e.Stage, a.Stage); + Assert.Equal(e.AssemblyLoadContext, a.AssemblyLoadContext); + Assert.Equal(e.Result, a.Result); ValidateAssemblyName(e.ResultAssemblyName, a.ResultAssemblyName, nameof(ResolutionAttempt.ResultAssemblyName)); - Assert.AreEqual(e.ResultAssemblyPath ?? string.Empty, a.ResultAssemblyPath, $"Unexpected value for {nameof(ResolutionAttempt.ResultAssemblyPath)} {expectedActualMessage}"); - Assert.AreEqual(e.ErrorMessage ?? string.Empty, a.ErrorMessage, $"Unexpected value for {nameof(ResolutionAttempt.ErrorMessage)} {expectedActualMessage}"); + Assert.Equal(e.ResultAssemblyPath ?? string.Empty, a.ResultAssemblyPath); + Assert.Equal(e.ErrorMessage ?? string.Empty, a.ErrorMessage); } } private static void ValidateHandlerInvocations(List expected, List actual, string eventName) { - Assert.AreEqual(expected.Count, actual.Count, $"Unexpected handler invocation count for {eventName}"); + Assert.Equal(expected.Count, actual.Count); foreach (var match in expected) { @@ -138,7 +137,7 @@ private static void ValidateHandlerInvocations(List expected, && h.AssemblyLoadContext == match.AssemblyLoadContext && AssemblyNamesMatch(h.ResultAssemblyName, match.ResultAssemblyName) && (h.ResultAssemblyPath == match.ResultAssemblyPath || h.ResultAssemblyPath == "NULL" && match.ResultAssemblyPath == null); - Assert.IsTrue(actual.Exists(pred), $"Handler invocation not found: {match.ToString()}"); + Assert.True(actual.Exists(pred), $"Handler invocation not found: {match.ToString()}"); } } @@ -146,22 +145,22 @@ private static void ValidateLoadFromHandlerInvocation(LoadFromHandlerInvocation { if (expected == null || actual == null) { - Assert.IsNull(expected); - Assert.IsNull(actual); + Assert.Null(expected); + Assert.Null(actual); return; } ValidateAssemblyName(expected.AssemblyName, actual.AssemblyName, nameof(LoadFromHandlerInvocation.AssemblyName)); - Assert.AreEqual(expected.IsTrackedLoad, actual.IsTrackedLoad, $"Unexpected value for {nameof(LoadFromHandlerInvocation.IsTrackedLoad)} on event"); - Assert.AreEqual(expected.RequestingAssemblyPath, actual.RequestingAssemblyPath, $"Unexpected value for {nameof(LoadFromHandlerInvocation.RequestingAssemblyPath)} on event"); + Assert.Equal(expected.IsTrackedLoad, actual.IsTrackedLoad); + Assert.Equal(expected.RequestingAssemblyPath, actual.RequestingAssemblyPath); if (expected.ComputedRequestedAssemblyPath == null) { - Assert.AreEqual("NULL", actual.ComputedRequestedAssemblyPath, $"Unexpected value for {nameof(LoadFromHandlerInvocation.ComputedRequestedAssemblyPath)} on event"); + Assert.Equal("NULL", actual.ComputedRequestedAssemblyPath); } else { - Assert.AreEqual(expected.ComputedRequestedAssemblyPath, actual.ComputedRequestedAssemblyPath, $"Unexpected value for {nameof(LoadFromHandlerInvocation.ComputedRequestedAssemblyPath)} on event"); + Assert.Equal(expected.ComputedRequestedAssemblyPath, actual.ComputedRequestedAssemblyPath); } } @@ -172,7 +171,7 @@ private static void ValidateProbedPaths(List expected, List pred = p => p.FilePath == match.FilePath && p.Source == match.Source && p.Result == match.Result; - Assert.IsTrue(actual.Exists(pred), $"Probed path not found: {match.ToString()}"); + Assert.True(actual.Exists(pred), $"Probed path not found: {match.ToString()}"); } } @@ -182,7 +181,7 @@ private static bool BindOperationsMatch(BindOperation bind1, BindOperation bind2 { ValidateBindOperation(bind1, bind2); } - catch (AssertTestException e) + catch (Xunit.Sdk.XunitException e) { return false; } @@ -195,7 +194,7 @@ private static void ValidateNestedBinds(List expected, List pred = b => BindOperationsMatch(match, b); - Assert.IsTrue(actual.Exists(pred), $"Nested bind operation not found: {match.ToString()}"); + Assert.True(actual.Exists(pred), $"Nested bind operation not found: {match.ToString()}"); } } } diff --git a/src/tests/Loader/classloader/Casting/castclasspointer.il b/src/tests/Loader/classloader/Casting/castclasspointer.il index ccbdd132ce45f4..484edd480ff181 100644 --- a/src/tests/Loader/classloader/Casting/castclasspointer.il +++ b/src/tests/Loader/classloader/Casting/castclasspointer.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly castclasspointer { } +.assembly extern xunit.core {} .assembly extern mscorlib { } .class value MyGen`1 @@ -43,6 +44,9 @@ OK: .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint ldnull diff --git a/src/tests/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrained2.il b/src/tests/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrained2.il index 75bf58c9b68ad8..4fc29cc28189c4 100644 --- a/src/tests/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrained2.il +++ b/src/tests/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrained2.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly constrained2 { } .class interface private abstract auto ansi IAdder`1 @@ -82,6 +83,9 @@ .method public hidebysig static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init ( diff --git a/src/tests/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrained2_gm.il b/src/tests/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrained2_gm.il index 21f224e954a77e..ae609ae15397ae 100644 --- a/src/tests/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrained2_gm.il +++ b/src/tests/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrained2_gm.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly constrained2_gm { } .class interface private abstract auto ansi IAdder`1 @@ -82,6 +83,9 @@ .method public hidebysig static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init ( diff --git a/src/tests/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrained3.il b/src/tests/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrained3.il index 50f0b6fa8a79c4..a21660740efcf2 100644 --- a/src/tests/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrained3.il +++ b/src/tests/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrained3.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly constrained3 { } .class interface private abstract auto ansi IFrobber`1 @@ -46,6 +47,9 @@ .method public hidebysig static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init ( diff --git a/src/tests/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrained3_gm.il b/src/tests/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrained3_gm.il index 70b3084873eb1b..1ca2bf93a74157 100644 --- a/src/tests/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrained3_gm.il +++ b/src/tests/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrained3_gm.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly constrained3_gm { } .class interface private abstract auto ansi IFrobber`1 @@ -46,6 +47,9 @@ .method public hidebysig static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init ( diff --git a/src/tests/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrainedcall.il b/src/tests/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrainedcall.il index c8388043d372e5..319e6afdf08174 100644 --- a/src/tests/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrainedcall.il +++ b/src/tests/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrainedcall.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly constrainedcall { } .class interface private abstract auto ansi IAdder`1 @@ -78,6 +79,9 @@ .method public hidebysig static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init ( diff --git a/src/tests/Loader/classloader/DefaultInterfaceMethods/diamondshape/diamondshape.il b/src/tests/Loader/classloader/DefaultInterfaceMethods/diamondshape/diamondshape.il index a96ad865be6f14..24ee8bb3a5e897 100644 --- a/src/tests/Loader/classloader/DefaultInterfaceMethods/diamondshape/diamondshape.il +++ b/src/tests/Loader/classloader/DefaultInterfaceMethods/diamondshape/diamondshape.il @@ -12,6 +12,7 @@ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. .ver 4:0:0:0 } +.assembly extern xunit.core {} // TODO: use the contract once this is exposed from contracts .assembly extern System.Runtime { } @@ -833,6 +834,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 23 (0x17) .maxstack 1 diff --git a/src/tests/Loader/classloader/DefaultInterfaceMethods/genericmethods/genericmethods.il b/src/tests/Loader/classloader/DefaultInterfaceMethods/genericmethods/genericmethods.il index 599829d973e140..78b571b1647902 100644 --- a/src/tests/Loader/classloader/DefaultInterfaceMethods/genericmethods/genericmethods.il +++ b/src/tests/Loader/classloader/DefaultInterfaceMethods/genericmethods/genericmethods.il @@ -12,6 +12,7 @@ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly genericmethods { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) @@ -165,6 +166,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 223 (0xdf) .maxstack 3 diff --git a/src/tests/Loader/classloader/DefaultInterfaceMethods/methodimpl/methodimpl.il b/src/tests/Loader/classloader/DefaultInterfaceMethods/methodimpl/methodimpl.il index f3ead578ecab11..d54b5be16e9586 100644 --- a/src/tests/Loader/classloader/DefaultInterfaceMethods/methodimpl/methodimpl.il +++ b/src/tests/Loader/classloader/DefaultInterfaceMethods/methodimpl/methodimpl.il @@ -12,6 +12,7 @@ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly methodimpl { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) @@ -955,6 +956,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 23 (0x17) .maxstack 1 diff --git a/src/tests/Loader/classloader/DefaultInterfaceMethods/reabstraction/reabstraction.il b/src/tests/Loader/classloader/DefaultInterfaceMethods/reabstraction/reabstraction.il index 7cb6747f206fb8..55b6ea4775b237 100644 --- a/src/tests/Loader/classloader/DefaultInterfaceMethods/reabstraction/reabstraction.il +++ b/src/tests/Loader/classloader/DefaultInterfaceMethods/reabstraction/reabstraction.il @@ -3,6 +3,7 @@ // .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Runtime { } .assembly reabstraction { } @@ -139,6 +140,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try diff --git a/src/tests/Loader/classloader/DefaultInterfaceMethods/sharedgenerics/non_virtual_calls_to_instance_methods.il b/src/tests/Loader/classloader/DefaultInterfaceMethods/sharedgenerics/non_virtual_calls_to_instance_methods.il index 7faea8d7c5185a..5883ab07cac3cf 100644 --- a/src/tests/Loader/classloader/DefaultInterfaceMethods/sharedgenerics/non_virtual_calls_to_instance_methods.il +++ b/src/tests/Loader/classloader/DefaultInterfaceMethods/sharedgenerics/non_virtual_calls_to_instance_methods.il @@ -11,6 +11,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: .ver 4:2:1:0 } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: @@ -111,6 +112,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 56 (0x38) .maxstack 1 diff --git a/src/tests/Loader/classloader/DefaultInterfaceMethods/sharedgenerics/sharedgenerics.il b/src/tests/Loader/classloader/DefaultInterfaceMethods/sharedgenerics/sharedgenerics.il index 2671ed5a6a7db8..a23a4d1618e043 100644 --- a/src/tests/Loader/classloader/DefaultInterfaceMethods/sharedgenerics/sharedgenerics.il +++ b/src/tests/Loader/classloader/DefaultInterfaceMethods/sharedgenerics/sharedgenerics.il @@ -12,6 +12,7 @@ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly sharedgenerics { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) @@ -121,6 +122,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 126 (0x7e) .maxstack 5 diff --git a/src/tests/Loader/classloader/DefaultInterfaceMethods/simple/simple.il b/src/tests/Loader/classloader/DefaultInterfaceMethods/simple/simple.il index 85d64dbbc377fb..c36bf3c8559384 100644 --- a/src/tests/Loader/classloader/DefaultInterfaceMethods/simple/simple.il +++ b/src/tests/Loader/classloader/DefaultInterfaceMethods/simple/simple.il @@ -12,6 +12,7 @@ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly simple { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) @@ -224,6 +225,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 158 (0x9e) .maxstack 2 diff --git a/src/tests/Loader/classloader/DefaultInterfaceMethods/valuetypes/valuetypes.il b/src/tests/Loader/classloader/DefaultInterfaceMethods/valuetypes/valuetypes.il index ff51b0ab33f79d..40c1daaea4d263 100644 --- a/src/tests/Loader/classloader/DefaultInterfaceMethods/valuetypes/valuetypes.il +++ b/src/tests/Loader/classloader/DefaultInterfaceMethods/valuetypes/valuetypes.il @@ -12,6 +12,7 @@ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly valuetypes { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) @@ -116,6 +117,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (valuetype FooBarStruct V_0, diff --git a/src/tests/Loader/classloader/DictionaryExpansion/DictionaryExpansion.cs b/src/tests/Loader/classloader/DictionaryExpansion/DictionaryExpansion.cs index cf51edf703d68a..00809607847741 100644 --- a/src/tests/Loader/classloader/DictionaryExpansion/DictionaryExpansion.cs +++ b/src/tests/Loader/classloader/DictionaryExpansion/DictionaryExpansion.cs @@ -8,7 +8,7 @@ using System.Collections.Generic; using System.Reflection.Emit; using System.Runtime.CompilerServices; -using TestLibrary; +using Xunit; class TestType1 { } class TestType2 { } @@ -116,19 +116,19 @@ static void DoTest_Inner(int max, GenClass o1, GenClass o2, Ge { Console.WriteLine("TEST: FuncOnGenClass<{0}>", typeof(T1).Name); for (int i = 0; i < max; i++) - Assert.AreEqual(o1.FuncOnGenClass(i).ToString(), i == 0 ? $"{typeof(T1)}" : $"TestType{i}`1[{typeof(T1)}]"); + Assert.Equal(o1.FuncOnGenClass(i).ToString(), i == 0 ? $"{typeof(T1)}" : $"TestType{i}`1[{typeof(T1)}]"); Console.WriteLine("TEST: FuncOnGenClass<{0}>", typeof(T2).Name); for (int i = 0; i < max; i++) - Assert.AreEqual(o2.FuncOnGenClass(i).ToString(), i == 0 ? $"{typeof(T2)}" : $"TestType{i}`1[{typeof(T2)}]"); + Assert.Equal(o2.FuncOnGenClass(i).ToString(), i == 0 ? $"{typeof(T2)}" : $"TestType{i}`1[{typeof(T2)}]"); Console.WriteLine("TEST: FuncOnGenClass2<{0}>", typeof(T2).Name); for (int i = 0; i < max; i++) - Assert.AreEqual(o2.FuncOnGenClass2(i).ToString(), i == 0 ? $"{typeof(T2)}" : $"TestType{i}`1[{typeof(T2)}]"); + Assert.Equal(o2.FuncOnGenClass2(i).ToString(), i == 0 ? $"{typeof(T2)}" : $"TestType{i}`1[{typeof(T2)}]"); Console.WriteLine("TEST: FuncOnGenClass<{0}>", typeof(T3).Name); for (int i = 0; i < max; i++) - Assert.AreEqual(o3.FuncOnGenClass(i).ToString(), i == 0 ? $"{typeof(T3)}" : $"TestType{i}`1[{typeof(T3)}]"); + Assert.Equal(o3.FuncOnGenClass(i).ToString(), i == 0 ? $"{typeof(T3)}" : $"TestType{i}`1[{typeof(T3)}]"); } public static void DoTest_GenClass(int max) @@ -167,8 +167,8 @@ public static void DoTest_GenDerived3(int max) [MethodImpl(MethodImplOptions.NoInlining)] public override void VFunc() { - Assert.AreEqual(typeof(KeyValuePair).ToString(), "System.Collections.Generic.KeyValuePair`2[System.Object,System.String]"); - Assert.AreEqual(typeof(KeyValuePair).ToString(), "System.Collections.Generic.KeyValuePair`2[System.Object,System.String]"); + Assert.Equal(typeof(KeyValuePair).ToString(), "System.Collections.Generic.KeyValuePair`2[System.Object,System.String]"); + Assert.Equal(typeof(KeyValuePair).ToString(), "System.Collections.Generic.KeyValuePair`2[System.Object,System.String]"); } } @@ -223,7 +223,7 @@ public static Type GFunc(int level) case 25: default: return typeof(TestType25); } } - + [MethodImpl(MethodImplOptions.NoInlining)] public static Type GFunc2(int level) { @@ -263,25 +263,25 @@ public static void DoTest(int max) { Console.WriteLine("TEST: GFunc"); for(int i = 0; i < max; i++) - Assert.AreEqual(GFunc(i).ToString(), i == 0 ? "System.String" : $"TestType{i}`1[System.String]"); + Assert.Equal(GFunc(i).ToString(), i == 0 ? "System.String" : $"TestType{i}`1[System.String]"); Console.WriteLine("TEST: GFunc(i)"); for (int i = 0; i < max; i++) - Assert.AreEqual(GFunc(i).ToString(), i == 0 ? "System.Object" : $"TestType{i}`1[System.Object]"); + Assert.Equal(GFunc(i).ToString(), i == 0 ? "System.Object" : $"TestType{i}`1[System.Object]"); Console.WriteLine("TEST: GFunc2(i)"); for (int i = 0; i < max; i++) - Assert.AreEqual(GFunc2(i).ToString(), i == 0 ? "System.Object" : $"TestType{i}`1[System.Object]"); + Assert.Equal(GFunc2(i).ToString(), i == 0 ? "System.Object" : $"TestType{i}`1[System.Object]"); Console.WriteLine("TEST: GFunc(i)"); for (int i = 0; i < max; i++) - Assert.AreEqual(GFunc(i).ToString(), i == 0 ? "Test_DictionaryExpansion" : $"TestType{i}`1[Test_DictionaryExpansion]"); + Assert.Equal(GFunc(i).ToString(), i == 0 ? "Test_DictionaryExpansion" : $"TestType{i}`1[Test_DictionaryExpansion]"); } - + public static int Main() { GenBase deriv4 = new GenDerived4(); - + for(int i = 5; i <= 25; i += 5) { // Test for generic classes @@ -304,7 +304,7 @@ public static int Main() // Test for generic methods DoTest(i); - + { AssemblyBuilder ab = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("CollectibleAsm"+i), AssemblyBuilderAccess.RunAndCollect); var tb = ab.DefineDynamicModule("CollectibleMod" + i).DefineType("CollectibleGenDerived"+i, TypeAttributes.Public, typeof(GenDerived2)); @@ -323,7 +323,7 @@ public static int Main() } } } - + // After all expansions to existing dictionaries, use GenDerived4. GenDerived4 was allocated before any of its // base type dictionaries were expanded. for(int i = 0; i < 5; i++) diff --git a/src/tests/Loader/classloader/InterfaceFolding/Ambiguous.il b/src/tests/Loader/classloader/InterfaceFolding/Ambiguous.il index 1e732480211e48..9bf4939ac54017 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Ambiguous.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Ambiguous.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 2.0.50727.4926 // Copyright (c) Microsoft Corporation. All rights reserved. @@ -126,6 +127,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 96 (0x60) .maxstack 2 diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase0.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase0.il index f7ba311903f7e0..f11ff9f80e68a8 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase0.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase0.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase0 {} @@ -80,6 +81,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase1.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase1.il index a52403639b0abd..e3c5a6ceca6283 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase1.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase1.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase1 {} @@ -63,6 +64,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase2.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase2.il index c2026d19c500e6..c226ef5cd564a3 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase2.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase2.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase2 {} @@ -63,6 +64,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase3.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase3.il index b30e09d848156f..d8d8005618feb4 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase3.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase3.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase3 {} @@ -63,6 +64,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase4.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase4.il index bf27c6544d701a..3aaa5848a0e579 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase4.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase4.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase4 {} @@ -63,6 +64,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase5.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase5.il index 3b0903c3dd81e9..993fe9f2ad3678 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase5.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase5.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase5 {} @@ -63,6 +64,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase6.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase6.il index 28353f88abc2ad..e0ce563ddcc720 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase6.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_I/TestCase6.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase6 {} @@ -63,6 +64,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase0.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase0.il index d7b460e0f06d7a..b161e10ccf53be 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase0.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase0.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase0 {} @@ -80,6 +81,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase1.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase1.il index 5a14ef53b8b4b4..574b95c3beb0db 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase1.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase1.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase1 {} @@ -63,6 +64,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase2.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase2.il index 8ed07b6f751de9..9cab4a6ad004bb 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase2.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase2.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase2 {} @@ -63,6 +64,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase3.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase3.il index 35614b38092536..59d64bb05b69f8 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase3.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase3.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase3 {} @@ -63,6 +64,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase4.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase4.il index 814a7f0279d191..6f51f6eefd04e1 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase4.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase4.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase4 {} @@ -63,6 +64,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase5.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase5.il index 5401147e5fdf26..d2aaae57daaab2 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase5.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase5.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase5 {} @@ -64,6 +65,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase6.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase6.il index f1becb00447729..cbca459ee3b0f6 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase6.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_I_Nested_J/TestCase6.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase6 {} @@ -63,6 +64,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase0.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase0.il index 0b4f28a8b8a1de..24a22ac792b6a9 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase0.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase0.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase0 {} @@ -80,6 +81,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase1.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase1.il index 9adc42bbb35b1e..0b9c73cd4cd431 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase1.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase1.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase1 {} @@ -62,6 +63,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase2.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase2.il index 5b312f07c5887e..44c196099168ee 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase2.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase2.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase2 {} @@ -62,6 +63,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase3.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase3.il index a4b83b59b72d4c..cb2b0105b4f3f7 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase3.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase3.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase3 {} @@ -62,6 +63,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase4.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase4.il index f3e44f9f433fd5..952045ba8c653c 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase4.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase4.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase4 {} @@ -62,6 +63,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase5.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase5.il index 606bb11b9eef0f..e314bcf3413710 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase5.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase5.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase5 {} @@ -62,6 +63,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase6.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase6.il index 678d9d5c93eaab..017c0fd2881c83 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase6.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_J/TestCase6.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase6 {} @@ -62,6 +63,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase0.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase0.il index b6deaebb9e4edc..b3d249302d773a 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase0.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase0.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase0 {} @@ -78,6 +79,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase1.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase1.il index da6369eea0dc30..5ef3be8e9c5a1c 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase1.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase1.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase1 {} @@ -61,6 +62,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase2.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase2.il index da7298c05d84a5..c54bfcc7b3f258 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase2.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase2.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase2 {} @@ -61,6 +62,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase3.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase3.il index 3a02e7757a40bf..ee345825e07b78 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase3.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase3.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase3 {} @@ -61,6 +62,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase4.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase4.il index 01f95d0b24ae9d..3243bacf63e196 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase4.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase4.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase4 {} @@ -61,6 +62,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase5.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase5.il index a3707b1958296b..98c9cfb5c4c946 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase5.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase5.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase5 {} @@ -61,6 +62,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase6.il b/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase6.il index 2538586cf5ecdc..9eee4c174d8083 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase6.il +++ b/src/tests/Loader/classloader/InterfaceFolding/Nested_J_Nested_I/TestCase6.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib {} +.assembly extern xunit.core {} .assembly TestCase6 {} @@ -61,6 +62,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/TestCase0.il b/src/tests/Loader/classloader/InterfaceFolding/TestCase0.il index 4d607623419abf..876b50fc573a4c 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/TestCase0.il +++ b/src/tests/Loader/classloader/InterfaceFolding/TestCase0.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly TestCase0 {} @@ -77,6 +78,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/TestCase1.il b/src/tests/Loader/classloader/InterfaceFolding/TestCase1.il index 99171238e3a097..f2e2e86f050b09 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/TestCase1.il +++ b/src/tests/Loader/classloader/InterfaceFolding/TestCase1.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly TestCase1 {} @@ -64,6 +65,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/TestCase2.il b/src/tests/Loader/classloader/InterfaceFolding/TestCase2.il index 6079121937f2d6..4ab800db493dba 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/TestCase2.il +++ b/src/tests/Loader/classloader/InterfaceFolding/TestCase2.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly TestCase2 {} @@ -64,6 +65,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/TestCase3.il b/src/tests/Loader/classloader/InterfaceFolding/TestCase3.il index ae854193b33a67..0b145237da57c4 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/TestCase3.il +++ b/src/tests/Loader/classloader/InterfaceFolding/TestCase3.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly TestCase3 {} @@ -64,6 +65,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/TestCase4.il b/src/tests/Loader/classloader/InterfaceFolding/TestCase4.il index afd503685a7e0d..aff8e532332ba1 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/TestCase4.il +++ b/src/tests/Loader/classloader/InterfaceFolding/TestCase4.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly TestCase4 {} @@ -64,6 +65,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/TestCase5.il b/src/tests/Loader/classloader/InterfaceFolding/TestCase5.il index 8bed1df35601a2..446f1eeb33547a 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/TestCase5.il +++ b/src/tests/Loader/classloader/InterfaceFolding/TestCase5.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly TestCase5 {} @@ -64,6 +65,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/TestCase6.il b/src/tests/Loader/classloader/InterfaceFolding/TestCase6.il index 90fe9ffc0de64c..032daf5e6fd9c2 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/TestCase6.il +++ b/src/tests/Loader/classloader/InterfaceFolding/TestCase6.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly TestCase6 {} @@ -64,6 +65,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/InterfaceFolding/TestCase7.il b/src/tests/Loader/classloader/InterfaceFolding/TestCase7.il index ed90b3796be3ff..dd8ff6235fcfc4 100644 --- a/src/tests/Loader/classloader/InterfaceFolding/TestCase7.il +++ b/src/tests/Loader/classloader/InterfaceFolding/TestCase7.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly TestCase0 {} @@ -82,6 +83,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void C::.ctor() diff --git a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/Interfaces/UnitTest.il b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/Interfaces/UnitTest.il index 4ba6b206411031..eb263f608b678c 100644 --- a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/Interfaces/UnitTest.il +++ b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/Interfaces/UnitTest.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern System.Runtime { } .assembly extern mscorlib { } .assembly UnitTest { } @@ -1137,6 +1138,9 @@ .method public hidebysig static int32 Main( string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init ( bool result ) diff --git a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/Interfaces/UnsupportedScenario1.il b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/Interfaces/UnsupportedScenario1.il index 52e67a0a87f284..2c9cef445df23c 100644 --- a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/Interfaces/UnsupportedScenario1.il +++ b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/Interfaces/UnsupportedScenario1.il @@ -6,6 +6,7 @@ // implemented by classes .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib { } .assembly UnsupportedScenario2 { } @@ -196,6 +197,9 @@ .method public hidebysig static int32 Main( string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (bool V_0) diff --git a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/Interfaces/UnsupportedScenario2.il b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/Interfaces/UnsupportedScenario2.il index 2e4c21dc424925..33413f02e6978b 100644 --- a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/Interfaces/UnsupportedScenario2.il +++ b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/Interfaces/UnsupportedScenario2.il @@ -5,6 +5,7 @@ // Scenario being tested here: covariant returns on default interface methods. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern System.Runtime { } .assembly extern mscorlib { } .assembly UnsupportedScenario2 { } @@ -196,6 +197,9 @@ .method public hidebysig static int32 Main( string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (bool V_0) diff --git a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/Interfaces/UnsupportedScenario3.il b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/Interfaces/UnsupportedScenario3.il index 5575857b2ac99f..2f6d99655091ce 100644 --- a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/Interfaces/UnsupportedScenario3.il +++ b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/Interfaces/UnsupportedScenario3.il @@ -6,6 +6,7 @@ // implemented by structs .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib { } .assembly UnsupportedScenario3 { } @@ -223,6 +224,9 @@ .method public hidebysig static int32 Main( string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (bool V_0) diff --git a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/ReturnTypeValidation/ImplicitOverrideSameSigAsDecl.il b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/ReturnTypeValidation/ImplicitOverrideSameSigAsDecl.il index b217bffb1e24ab..2d8ed43645a7e8 100644 --- a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/ReturnTypeValidation/ImplicitOverrideSameSigAsDecl.il +++ b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/ReturnTypeValidation/ImplicitOverrideSameSigAsDecl.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern System.Runtime { } .assembly extern mscorlib { } .assembly ImplicitOverrideSameSigAsDecl { } @@ -311,6 +312,9 @@ .method public hidebysig static int32 Main( string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (bool V_0) diff --git a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/ReturnTypeValidation/OverrideSameSigAsDecl.il b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/ReturnTypeValidation/OverrideSameSigAsDecl.il index 1f069ef5d6c450..2064a845e5f0e7 100644 --- a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/ReturnTypeValidation/OverrideSameSigAsDecl.il +++ b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/ReturnTypeValidation/OverrideSameSigAsDecl.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern System.Runtime { } .assembly extern mscorlib { } .assembly OverrideSameSigAsDecl { } @@ -343,6 +344,9 @@ .method public hidebysig static int32 Main( string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (bool V_0) diff --git a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/Structs/IncompatibleOverride.il b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/Structs/IncompatibleOverride.il index 036a7c58e3143d..39c67576567e98 100644 --- a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/Structs/IncompatibleOverride.il +++ b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/Structs/IncompatibleOverride.il @@ -8,6 +8,7 @@ // .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib { } .assembly IncompatibleOverride { } @@ -202,6 +203,9 @@ .method public hidebysig static int32 Main( string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init (bool V_0) diff --git a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/AttributeTesting.il b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/AttributeTesting.il index 652feec3fb5d11..6c0a9ceae4444b 100644 --- a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/AttributeTesting.il +++ b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/AttributeTesting.il @@ -42,6 +42,7 @@ // .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern System.Runtime { } .assembly extern mscorlib { } .assembly AttributeTesting { } @@ -1127,6 +1128,9 @@ .method public hidebysig static int32 Main( string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init ( bool result ) diff --git a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/CompatibleWithTest.il b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/CompatibleWithTest.il index 75e580398676bb..9af1b72756ed13 100644 --- a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/CompatibleWithTest.il +++ b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/CompatibleWithTest.il @@ -1,4 +1,5 @@ .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern System.Collections { } .assembly extern System.Runtime { } .assembly extern mscorlib { } @@ -784,6 +785,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init ( bool result ) diff --git a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/OverrideMoreDerivedReturn.il b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/OverrideMoreDerivedReturn.il index 9914558c7d9b2d..5a3f94b6a9b786 100644 --- a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/OverrideMoreDerivedReturn.il +++ b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/OverrideMoreDerivedReturn.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern System.Runtime { } .assembly extern mscorlib { } .assembly ReOverrideMoreDerivedReturn { } @@ -611,6 +612,9 @@ .method public hidebysig static int32 Main( string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init ( bool result ) diff --git a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/UnitTest.il b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/UnitTest.il index ea028e507b19c3..1f91183ae7ff85 100644 --- a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/UnitTest.il +++ b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/UnitTest.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern System.Runtime { } .assembly extern mscorlib { } .assembly UnitTest { } @@ -1215,6 +1216,9 @@ .method public hidebysig static int32 Main( string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init ( bool result ) diff --git a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/UnitTestDelegates.il b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/UnitTestDelegates.il index 592f398d418344..5ee3b7f6b850ac 100644 --- a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/UnitTestDelegates.il +++ b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/UnitTestDelegates.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern System.Runtime { } .assembly UnitTestDelegates { } @@ -1102,6 +1103,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init ( bool result ) diff --git a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/UnitTestMultiModule.il b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/UnitTestMultiModule.il index 2a135021243141..a17d1166512506 100644 --- a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/UnitTestMultiModule.il +++ b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/UnitTestMultiModule.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern System.Runtime { } .assembly extern mscorlib { } @@ -172,6 +173,9 @@ .method public hidebysig static int32 Main( string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init ( bool result ) diff --git a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/UnitTest_GVM.il b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/UnitTest_GVM.il index 367009658d39d0..67e5b8f185b656 100644 --- a/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/UnitTest_GVM.il +++ b/src/tests/Loader/classloader/MethodImpl/CovariantReturns/UnitTest/UnitTest_GVM.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern System.Runtime { } .assembly extern mscorlib { } .assembly UnitTest_GVM { } @@ -734,6 +735,9 @@ // ===================================================================================== // .method public hidebysig static int32 Main( string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 .locals init ( bool result ) diff --git a/src/tests/Loader/classloader/MethodImpl/Desktop/self_override2.il b/src/tests/Loader/classloader/MethodImpl/Desktop/self_override2.il index 0d6f7d48508c3f..4e0ac204d4632e 100644 --- a/src/tests/Loader/classloader/MethodImpl/Desktop/self_override2.il +++ b/src/tests/Loader/classloader/MethodImpl/Desktop/self_override2.il @@ -7,6 +7,7 @@ // b.DoBar() will invoke MyBar::DoSelfBar(). .assembly extern mscorlib{} +.assembly extern xunit.core {} .assembly self_override2{} .class public auto ansi beforefieldinit MyBar @@ -61,6 +62,9 @@ { .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 43 (0x2b) .maxstack 2 diff --git a/src/tests/Loader/classloader/MethodImpl/Desktop/self_override5.il b/src/tests/Loader/classloader/MethodImpl/Desktop/self_override5.il index 21e9d0468da775..b35cba6c868ae8 100644 --- a/src/tests/Loader/classloader/MethodImpl/Desktop/self_override5.il +++ b/src/tests/Loader/classloader/MethodImpl/Desktop/self_override5.il @@ -19,6 +19,7 @@ // - dmilirud .assembly extern mscorlib{} +.assembly extern xunit.core {} .assembly self_override5{} .class public MyBar extends [mscorlib]System.Object @@ -72,6 +73,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (bool V_0, diff --git a/src/tests/Loader/classloader/MethodImpl/generics_override1.il b/src/tests/Loader/classloader/MethodImpl/generics_override1.il index a0234b60831721..3037f18c30bf39 100644 --- a/src/tests/Loader/classloader/MethodImpl/generics_override1.il +++ b/src/tests/Loader/classloader/MethodImpl/generics_override1.il @@ -13,6 +13,7 @@ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly Program { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) @@ -1013,6 +1014,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 174 (0xae) .maxstack 3 diff --git a/src/tests/Loader/classloader/MethodImpl/override_override1.il b/src/tests/Loader/classloader/MethodImpl/override_override1.il index 3af566e687c92e..8b92de84911b90 100644 --- a/src/tests/Loader/classloader/MethodImpl/override_override1.il +++ b/src/tests/Loader/classloader/MethodImpl/override_override1.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // MyFoo is a normal reference type with virtual method DoFoo() // MyBar is a normal reference type that extends MyFoo. // MyBar::DoBar explicitly overrides MyFoo::DoFoo @@ -98,6 +99,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 43 (0x2b) .maxstack 2 diff --git a/src/tests/Loader/classloader/MethodImpl/self_override1.il b/src/tests/Loader/classloader/MethodImpl/self_override1.il index 16f4207ad3ca1a..0df6b8c228a598 100644 --- a/src/tests/Loader/classloader/MethodImpl/self_override1.il +++ b/src/tests/Loader/classloader/MethodImpl/self_override1.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // MyBar is an abstract class which declares an abstract method MyBar::DoBar(). // MyBar also DoSelfBar() that explicitly overrides DoBar(). // BarImpl extends MyBar and also overrides DoBar(). @@ -84,6 +85,9 @@ { .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 66 (0x42) .maxstack 2 diff --git a/src/tests/Loader/classloader/MethodImpl/self_override3.il b/src/tests/Loader/classloader/MethodImpl/self_override3.il index f7843f83752141..f01b4f43f2bfa4 100644 --- a/src/tests/Loader/classloader/MethodImpl/self_override3.il +++ b/src/tests/Loader/classloader/MethodImpl/self_override3.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // MyBar is a normal reference type. // MyBar::DoSelfBar explicitly overrides MyBar::DoBar // DoSelfBar has a different signature than DoBar. @@ -73,6 +74,9 @@ .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 43 (0x2b) .maxstack 2 diff --git a/src/tests/Loader/classloader/PrivateInterfaceImpl/Test6_ImplementingClass.il b/src/tests/Loader/classloader/PrivateInterfaceImpl/Test6_ImplementingClass.il index 004bb130a9104a..4e0c98fb20ed89 100644 --- a/src/tests/Loader/classloader/PrivateInterfaceImpl/Test6_ImplementingClass.il +++ b/src/tests/Loader/classloader/PrivateInterfaceImpl/Test6_ImplementingClass.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 2.0.40922.00 // Copyright (C) Microsoft Corporation. All rights reserved. @@ -71,6 +72,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 130 (0x82) .maxstack 2 diff --git a/src/tests/Loader/classloader/SequentialLayout/Regress/217070/t1.il b/src/tests/Loader/classloader/SequentialLayout/Regress/217070/t1.il index 5d86a21a31272b..ffc1a3d33fdaca 100644 --- a/src/tests/Loader/classloader/SequentialLayout/Regress/217070/t1.il +++ b/src/tests/Loader/classloader/SequentialLayout/Regress/217070/t1.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib { } .assembly typeload { } @@ -16,6 +17,9 @@ .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (valuetype main/NumberNode[] V_0, class [mscorlib]System.Exception V_1, diff --git a/src/tests/Loader/classloader/SequentialLayout/Regress/217070/t2.il b/src/tests/Loader/classloader/SequentialLayout/Regress/217070/t2.il index 2d349fc7d3b2b7..cf1d04ec87e55b 100644 --- a/src/tests/Loader/classloader/SequentialLayout/Regress/217070/t2.il +++ b/src/tests/Loader/classloader/SequentialLayout/Regress/217070/t2.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib { } .assembly typeload { } .class sequential sealed public NumberNode @@ -16,6 +17,9 @@ .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (valuetype NumberNode[] V_0, class [mscorlib]System.Exception V_1, diff --git a/src/tests/Loader/classloader/StaticVirtualMethods/GenericContext/GenericContextTest.il b/src/tests/Loader/classloader/StaticVirtualMethods/GenericContext/GenericContextTest.il index 4ae58ee32cbd43..4deeb6fd9a0985 100644 --- a/src/tests/Loader/classloader/StaticVirtualMethods/GenericContext/GenericContextTest.il +++ b/src/tests/Loader/classloader/StaticVirtualMethods/GenericContext/GenericContextTest.il @@ -3,6 +3,7 @@ // THIS FILE IS AUTOGENERATED EDIT Generator/Program.cs instead and rerun the generator .assembly extern System.Console {} +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly extern System.Runtime {} .assembly extern GenericContextCommonCs {} @@ -19965,6 +19966,9 @@ } // end of method Test_CreateDelegate_GenericOverTypeParameterGenericValuetype_GenericOverString_CuriouslyRecurringGeneric_GenericMethodOverTypeParameter .method public static int32 Main() cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class [System.Runtime]System.Exception V_0) .try { diff --git a/src/tests/Loader/classloader/StaticVirtualMethods/InterfaceVariance/InterfaceVariance.il b/src/tests/Loader/classloader/StaticVirtualMethods/InterfaceVariance/InterfaceVariance.il index 63eeb79f937ab9..a4c4e9e1965669 100644 --- a/src/tests/Loader/classloader/StaticVirtualMethods/InterfaceVariance/InterfaceVariance.il +++ b/src/tests/Loader/classloader/StaticVirtualMethods/InterfaceVariance/InterfaceVariance.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console {} +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly extern System.Runtime {} .assembly extern TypeHierarchyCommonCs {} @@ -134,6 +135,9 @@ .method public static int32 Main() cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class [System.Runtime]System.Exception V_0) diff --git a/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/CuriouslyRecurringGenericWithUnimplementedMethod.il b/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/CuriouslyRecurringGenericWithUnimplementedMethod.il index e4a952e1c13e9b..0ff093a38286ea 100644 --- a/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/CuriouslyRecurringGenericWithUnimplementedMethod.il +++ b/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/CuriouslyRecurringGenericWithUnimplementedMethod.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console {} +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly extern System.Runtime {} .assembly extern TypeHierarchyCommonCs {} @@ -30,6 +31,9 @@ } // end of method Test_Scenario1 .method public static int32 Main() cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class [System.Runtime]System.Exception V_0) .try { diff --git a/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/MethodBodyOnUnrelatedType.il b/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/MethodBodyOnUnrelatedType.il index 309d0b5ae6d6c2..f6a8d0aebe619b 100644 --- a/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/MethodBodyOnUnrelatedType.il +++ b/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/MethodBodyOnUnrelatedType.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console {} +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly extern System.Runtime {} .assembly extern TypeHierarchyCommonCs {} @@ -50,6 +51,9 @@ } // end of method Test_Scenario1 .method public static int32 Main() cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class [System.Runtime]System.Exception V_0) .try { diff --git a/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/MethodConstraintMismatch.il b/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/MethodConstraintMismatch.il index bc957e1ff4d9d3..f4356c3a7753b5 100644 --- a/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/MethodConstraintMismatch.il +++ b/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/MethodConstraintMismatch.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console {} +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly extern System.Runtime {} .assembly extern TypeHierarchyCommonCs {} @@ -39,6 +40,9 @@ } // end of method Test_Scenario1 .method public static int32 Main() cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class [System.Runtime]System.Exception V_0) .try { diff --git a/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/MethodFlags.il b/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/MethodFlags.il index 187b4ca8054364..33d55dba2fd562 100644 --- a/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/MethodFlags.il +++ b/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/MethodFlags.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console {} +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly extern System.Runtime {} .assembly extern TypeHierarchyCommonCs {} @@ -67,6 +68,9 @@ .method public static int32 Main() cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class [System.Runtime]System.Exception V_0) .try { diff --git a/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/MultipleMethodImplRecordsSameMethodDecl.il b/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/MultipleMethodImplRecordsSameMethodDecl.il index 4c8fa8acd56005..fb5397704a5357 100644 --- a/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/MultipleMethodImplRecordsSameMethodDecl.il +++ b/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/MultipleMethodImplRecordsSameMethodDecl.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console {} +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly extern System.Runtime {} .assembly extern TypeHierarchyCommonCs {} @@ -53,6 +54,9 @@ } // end of method Test_Scenario1 .method public static int32 Main() cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class [System.Runtime]System.Exception V_0) .try { diff --git a/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/UnimplementedAbstractMethodOnAbstractClass.il b/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/UnimplementedAbstractMethodOnAbstractClass.il index a4109f46a74704..4f328e0761394d 100644 --- a/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/UnimplementedAbstractMethodOnAbstractClass.il +++ b/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/UnimplementedAbstractMethodOnAbstractClass.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console {} +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly extern System.Runtime {} .assembly extern TypeHierarchyCommonCs {} @@ -91,6 +92,9 @@ .method public static int32 Main() cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class [System.Runtime]System.Exception V_0) diff --git a/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/UnimplementedAbstractMethodOnConcreteClass.il b/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/UnimplementedAbstractMethodOnConcreteClass.il index f861c8dd32a956..7155a29cbdd606 100644 --- a/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/UnimplementedAbstractMethodOnConcreteClass.il +++ b/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/UnimplementedAbstractMethodOnConcreteClass.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console {} +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly extern System.Runtime {} .assembly extern TypeHierarchyCommonCs {} @@ -30,6 +31,9 @@ } // end of method Test_Scenario1 .method public static int32 Main() cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class [System.Runtime]System.Exception V_0) .try { diff --git a/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/VarianceSafety.il b/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/VarianceSafety.il index c58f1033f80ede..2c6666f926462f 100644 --- a/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/VarianceSafety.il +++ b/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/VarianceSafety.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console {} +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly extern System.Runtime {} .assembly extern TypeHierarchyCommonCs {} @@ -42,6 +43,9 @@ .method public static int32 Main() cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class [System.Runtime]System.Exception V_0) .try { diff --git a/src/tests/Loader/classloader/StaticVirtualMethods/TypeHierarchy/TypeHierarchyTest.il b/src/tests/Loader/classloader/StaticVirtualMethods/TypeHierarchy/TypeHierarchyTest.il index 57a99245aa0683..a2b6e991993ba5 100644 --- a/src/tests/Loader/classloader/StaticVirtualMethods/TypeHierarchy/TypeHierarchyTest.il +++ b/src/tests/Loader/classloader/StaticVirtualMethods/TypeHierarchy/TypeHierarchyTest.il @@ -3,6 +3,7 @@ // THIS FILE IS AUTOGENERATED EDIT Generator/Program.cs instead and rerun the generator .assembly extern System.Console {} +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly extern System.Runtime {} .assembly extern TypeHierarchyCommonCs {} @@ -9580,6 +9581,9 @@ } // end of method Test_Scenario276 .method public static int32 Main() cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class [System.Runtime]System.Exception V_0) .try { diff --git a/src/tests/Loader/classloader/StaticVirtualMethods/TypeHierarchy/TypeHierarchyTest_minimal.il b/src/tests/Loader/classloader/StaticVirtualMethods/TypeHierarchy/TypeHierarchyTest_minimal.il index bae6f2efba9d15..2124789165b9b1 100644 --- a/src/tests/Loader/classloader/StaticVirtualMethods/TypeHierarchy/TypeHierarchyTest_minimal.il +++ b/src/tests/Loader/classloader/StaticVirtualMethods/TypeHierarchy/TypeHierarchyTest_minimal.il @@ -3,6 +3,7 @@ // THIS FILE IS AUTOGENERATED EDIT Generator/Program.cs instead and rerun the generator .assembly extern System.Console {} +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly extern System.Runtime {} .assembly extern TypeHierarchyCommonCs {} @@ -46,6 +47,9 @@ } // end of method Test_Scenario1 .method public static int32 Main() cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class [System.Runtime]System.Exception V_0) .try { diff --git a/src/tests/Loader/classloader/Statics/Misc/LiteralStatic.il b/src/tests/Loader/classloader/Statics/Misc/LiteralStatic.il index e4c08c17f6a231..5a700b1dfd0a9a 100644 --- a/src/tests/Loader/classloader/Statics/Misc/LiteralStatic.il +++ b/src/tests/Loader/classloader/Statics/Misc/LiteralStatic.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // test that LDSFLD of a literal static field throws a MissingFieldException .assembly extern mscorlib {} @@ -23,6 +24,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 34 (0x22) .maxstack 8 diff --git a/src/tests/Loader/classloader/Statics/Regressions/484837/Enum_ValueField.il b/src/tests/Loader/classloader/Statics/Regressions/484837/Enum_ValueField.il index 831236eb7a8c54..f8d241a58ceb03 100644 --- a/src/tests/Loader/classloader/Statics/Regressions/484837/Enum_ValueField.il +++ b/src/tests/Loader/classloader/Statics/Regressions/484837/Enum_ValueField.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // This is regression test for VSW 484837 // In this case, value__ is the last field as seen below (C# always generates value__ as the very first field.). // Because of a bug in the code, Module::ParseMetadataForStaticsIsTypeDefEnum() just looked at the very first // field and took it to be value. @@ -28,6 +29,9 @@ .method public hidebysig static int32 Main() cil managed { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .entrypoint .locals init (valuetype MyEnum V_0) diff --git a/src/tests/Loader/classloader/TSAmbiguities/CollapsedInterfaces/HelloWorld.il b/src/tests/Loader/classloader/TSAmbiguities/CollapsedInterfaces/HelloWorld.il index 1e478185281002..f1b6b78154eb19 100644 --- a/src/tests/Loader/classloader/TSAmbiguities/CollapsedInterfaces/HelloWorld.il +++ b/src/tests/Loader/classloader/TSAmbiguities/CollapsedInterfaces/HelloWorld.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 4.0.20512.0 // Copyright (c) Microsoft Corporation. All rights reserved. @@ -40,6 +41,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 337 (0x151) .maxstack 3 diff --git a/src/tests/Loader/classloader/TSAmbiguities/CollapsedMethods/InterfaceDefinition/HelloWorld.il b/src/tests/Loader/classloader/TSAmbiguities/CollapsedMethods/InterfaceDefinition/HelloWorld.il index f9ce013f6f0d1a..8ce41af8303149 100644 --- a/src/tests/Loader/classloader/TSAmbiguities/CollapsedMethods/InterfaceDefinition/HelloWorld.il +++ b/src/tests/Loader/classloader/TSAmbiguities/CollapsedMethods/InterfaceDefinition/HelloWorld.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 4.0.20508.0 // Copyright (c) Microsoft Corporation. All rights reserved. @@ -61,6 +62,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 450 (0x1c2) .maxstack 3 diff --git a/src/tests/Loader/classloader/TSAmbiguities/CollapsedMethods/Override/HelloWorld.il b/src/tests/Loader/classloader/TSAmbiguities/CollapsedMethods/Override/HelloWorld.il index ebee6f2452c1cf..17ab4d737cc744 100644 --- a/src/tests/Loader/classloader/TSAmbiguities/CollapsedMethods/Override/HelloWorld.il +++ b/src/tests/Loader/classloader/TSAmbiguities/CollapsedMethods/Override/HelloWorld.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 4.0.20508.0 // Copyright (c) Microsoft Corporation. All rights reserved. @@ -40,6 +41,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 313 (0x139) .maxstack 2 diff --git a/src/tests/Loader/classloader/TSAmbiguities/SameMethodImpl/CollapsedInterfaces/HelloWorld.il b/src/tests/Loader/classloader/TSAmbiguities/SameMethodImpl/CollapsedInterfaces/HelloWorld.il index 146503ce52d119..f0f4c3321f3597 100644 --- a/src/tests/Loader/classloader/TSAmbiguities/SameMethodImpl/CollapsedInterfaces/HelloWorld.il +++ b/src/tests/Loader/classloader/TSAmbiguities/SameMethodImpl/CollapsedInterfaces/HelloWorld.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 4.0.20512.0 // Copyright (c) Microsoft Corporation. All rights reserved. @@ -40,6 +41,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 382 (0x17e) .maxstack 2 diff --git a/src/tests/Loader/classloader/TSAmbiguities/SameMethodImpl/Override/HelloWorld.il b/src/tests/Loader/classloader/TSAmbiguities/SameMethodImpl/Override/HelloWorld.il index 4ccca2bd690826..be0feb6dbf296d 100644 --- a/src/tests/Loader/classloader/TSAmbiguities/SameMethodImpl/Override/HelloWorld.il +++ b/src/tests/Loader/classloader/TSAmbiguities/SameMethodImpl/Override/HelloWorld.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 4.0.20512.0 // Copyright (c) Microsoft Corporation. All rights reserved. @@ -40,6 +41,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 171 (0xab) .maxstack 3 diff --git a/src/tests/Loader/classloader/TSAmbiguities/Variance/Covariant_CollapsedInterfaces/HelloWorld.il b/src/tests/Loader/classloader/TSAmbiguities/Variance/Covariant_CollapsedInterfaces/HelloWorld.il index 7bd1a19b4d6d31..a8bff78363a5de 100644 --- a/src/tests/Loader/classloader/TSAmbiguities/Variance/Covariant_CollapsedInterfaces/HelloWorld.il +++ b/src/tests/Loader/classloader/TSAmbiguities/Variance/Covariant_CollapsedInterfaces/HelloWorld.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 4.0.20512.0 // Copyright (c) Microsoft Corporation. All rights reserved. @@ -40,6 +41,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 72 (0x48) .maxstack 2 diff --git a/src/tests/Loader/classloader/TSAmbiguities/Variance/Covariant_InherittedCollision/HelloWorld.il b/src/tests/Loader/classloader/TSAmbiguities/Variance/Covariant_InherittedCollision/HelloWorld.il index f7b28601e9a3b7..2c852bf3eac210 100644 --- a/src/tests/Loader/classloader/TSAmbiguities/Variance/Covariant_InherittedCollision/HelloWorld.il +++ b/src/tests/Loader/classloader/TSAmbiguities/Variance/Covariant_InherittedCollision/HelloWorld.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 4.0.20512.0 // Copyright (c) Microsoft Corporation. All rights reserved. @@ -40,6 +41,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 129 (0x81) .maxstack 2 diff --git a/src/tests/Loader/classloader/TSAmbiguities/Variance/Variant_CollapsedInterfaces/HelloWorld.il b/src/tests/Loader/classloader/TSAmbiguities/Variance/Variant_CollapsedInterfaces/HelloWorld.il index 54ce4a4d83df7d..fac0d2e9cf3fed 100644 --- a/src/tests/Loader/classloader/TSAmbiguities/Variance/Variant_CollapsedInterfaces/HelloWorld.il +++ b/src/tests/Loader/classloader/TSAmbiguities/Variance/Variant_CollapsedInterfaces/HelloWorld.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 4.0.20512.0 // Copyright (c) Microsoft Corporation. All rights reserved. @@ -40,6 +41,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 72 (0x48) .maxstack 2 diff --git a/src/tests/Loader/classloader/TSAmbiguities/Variance/Variant_InherittedCollision/HelloWorld.il b/src/tests/Loader/classloader/TSAmbiguities/Variance/Variant_InherittedCollision/HelloWorld.il index 95b54e00978de7..70c6178d3fc524 100644 --- a/src/tests/Loader/classloader/TSAmbiguities/Variance/Variant_InherittedCollision/HelloWorld.il +++ b/src/tests/Loader/classloader/TSAmbiguities/Variance/Variant_InherittedCollision/HelloWorld.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 4.0.20512.0 // Copyright (c) Microsoft Corporation. All rights reserved. @@ -40,6 +41,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 129 (0x81) .maxstack 2 diff --git a/src/tests/Loader/classloader/TypeForwarding/UnitTest/UnitTest.il b/src/tests/Loader/classloader/TypeForwarding/UnitTest/UnitTest.il index d7e62b89b14376..e913f0c22e367d 100644 --- a/src/tests/Loader/classloader/TypeForwarding/UnitTest/UnitTest.il +++ b/src/tests/Loader/classloader/TypeForwarding/UnitTest/UnitTest.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern MyDep { @@ -17,6 +18,9 @@ { .method public hidebysig static int32 Main(string[] args) cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 410 (0x19a) .maxstack 3 diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest0/Generated0.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest0/Generated0.il index 6ced8765825c27..d4af1260021768 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest0/Generated0.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest0/Generated0.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated0 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -213,6 +214,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated0::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1/Generated1.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1/Generated1.il index 34d6f1220c99b6..f06096b37dd62f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1/Generated1.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1/Generated1.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -702,6 +703,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest10/Generated10.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest10/Generated10.il index f67a44f4dc5279..015941b19f74e8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest10/Generated10.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest10/Generated10.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated10 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -587,6 +588,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated10::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest100/Generated100.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest100/Generated100.il index c32d4132415d87..33605044ff25e6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest100/Generated100.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest100/Generated100.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated100 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -694,6 +695,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated100::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1000/Generated1000.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1000/Generated1000.il index 36ce3665a04ebb..bf8dab7595d50a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1000/Generated1000.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1000/Generated1000.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1000 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4372,6 +4373,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1000::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1001/Generated1001.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1001/Generated1001.il index 4835b88a676306..8dc9d7922fd968 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1001/Generated1001.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1001/Generated1001.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1001 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4281,6 +4282,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1001::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1002/Generated1002.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1002/Generated1002.il index 04ef45475809f5..f13a48997a48e7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1002/Generated1002.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1002/Generated1002.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1002 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4340,6 +4341,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1002::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1003/Generated1003.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1003/Generated1003.il index fcb3e7790fc00f..420d491fee4bdf 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1003/Generated1003.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1003/Generated1003.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1003 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4704,6 +4705,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1003::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1004/Generated1004.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1004/Generated1004.il index 1846cb4a645baf..2932690d535f9e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1004/Generated1004.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1004/Generated1004.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1004 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4736,6 +4737,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1004::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1005/Generated1005.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1005/Generated1005.il index 3412470059a020..2871242adf6f17 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1005/Generated1005.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1005/Generated1005.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1005 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4849,6 +4850,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1005::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1006/Generated1006.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1006/Generated1006.il index 2ef97972e71cff..28d358819595f0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1006/Generated1006.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1006/Generated1006.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1006 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4834,6 +4835,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1006::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1007/Generated1007.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1007/Generated1007.il index 1c96ef27855d7e..4afd756d10f890 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1007/Generated1007.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1007/Generated1007.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1007 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3461,6 +3462,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1007::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1008/Generated1008.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1008/Generated1008.il index c8f6cfba5d756d..6150c821841d92 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1008/Generated1008.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1008/Generated1008.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1008 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4253,6 +4254,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1008::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1009/Generated1009.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1009/Generated1009.il index 7cbd7a53208590..762b4f65aee71a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1009/Generated1009.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1009/Generated1009.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1009 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4270,6 +4271,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1009::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest101/Generated101.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest101/Generated101.il index d1c7eb64f9a20c..9ccc04948b54a8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest101/Generated101.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest101/Generated101.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated101 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -757,6 +758,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated101::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1010/Generated1010.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1010/Generated1010.il index fc85df007bb1aa..7a03a27e3508c8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1010/Generated1010.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1010/Generated1010.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1010 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5590,6 +5591,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1010::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1011/Generated1011.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1011/Generated1011.il index 040bab816f5930..7abc9347e3e9c4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1011/Generated1011.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1011/Generated1011.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1011 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5499,6 +5500,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1011::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1012/Generated1012.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1012/Generated1012.il index a884cae3682992..3d5e735cbc3c99 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1012/Generated1012.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1012/Generated1012.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1012 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4534,6 +4535,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1012::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1013/Generated1013.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1013/Generated1013.il index 63f29c3796b1b6..393cb0d19ee80d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1013/Generated1013.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1013/Generated1013.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1013 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4793,6 +4794,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1013::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1014/Generated1014.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1014/Generated1014.il index cbe305573ea146..c3c0ba3cb89dd9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1014/Generated1014.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1014/Generated1014.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1014 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4802,6 +4803,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1014::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1015/Generated1015.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1015/Generated1015.il index ca6ad43167820a..d09a74a2c00ba7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1015/Generated1015.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1015/Generated1015.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1015 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3466,6 +3467,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1015::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1016/Generated1016.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1016/Generated1016.il index 2e1bd09c171357..d70671dab130df 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1016/Generated1016.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1016/Generated1016.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1016 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3071,6 +3072,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1016::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1017/Generated1017.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1017/Generated1017.il index ae65f78c8f4c5c..097eb14e07fd37 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1017/Generated1017.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1017/Generated1017.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1017 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3086,6 +3087,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1017::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1018/Generated1018.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1018/Generated1018.il index 367222ef8d0548..e6cc7f7a73ef9c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1018/Generated1018.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1018/Generated1018.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1018 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2773,6 +2774,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1018::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1019/Generated1019.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1019/Generated1019.il index f371d24ee7c36f..13120fba89239e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1019/Generated1019.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1019/Generated1019.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1019 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4336,6 +4337,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1019::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest102/Generated102.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest102/Generated102.il index 99b6038d1297d7..8da1a0cc24dd5c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest102/Generated102.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest102/Generated102.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated102 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -729,6 +730,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated102::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1020/Generated1020.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1020/Generated1020.il index ae1be4f7e85bf7..d74bd8a2e73e18 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1020/Generated1020.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1020/Generated1020.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1020 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4750,6 +4751,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1020::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1021/Generated1021.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1021/Generated1021.il index 2aac16f671dfd0..b4d3377a13ccae 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1021/Generated1021.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1021/Generated1021.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1021 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4654,6 +4655,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1021::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1022/Generated1022.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1022/Generated1022.il index 4ff78cbf4f7580..5fc9530ae2a8c0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1022/Generated1022.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1022/Generated1022.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1022 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4691,6 +4692,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1022::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1023/Generated1023.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1023/Generated1023.il index b5dbcdc46b068e..adbd6573a73e2b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1023/Generated1023.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1023/Generated1023.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1023 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4505,6 +4506,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1023::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1024/Generated1024.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1024/Generated1024.il index 7ae01150211d72..fe7fce0b5b0747 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1024/Generated1024.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1024/Generated1024.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1024 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4796,6 +4797,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1024::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1025/Generated1025.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1025/Generated1025.il index 935580f0d9e90f..ba72b8936cadfb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1025/Generated1025.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1025/Generated1025.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1025 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3192,6 +3193,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1025::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1026/Generated1026.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1026/Generated1026.il index febe5d3e47e460..35667c8fcdae6f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1026/Generated1026.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1026/Generated1026.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1026 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4961,6 +4962,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1026::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1027/Generated1027.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1027/Generated1027.il index 324bed4ea6984a..19b9d0a009ca2b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1027/Generated1027.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1027/Generated1027.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1027 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5030,6 +5031,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1027::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1028/Generated1028.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1028/Generated1028.il index 1770df99ac9176..4b7e77b0224f0d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1028/Generated1028.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1028/Generated1028.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1028 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4869,6 +4870,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1028::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1029/Generated1029.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1029/Generated1029.il index 861d9003680945..e56e5ff8f59d00 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1029/Generated1029.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1029/Generated1029.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1029 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3012,6 +3013,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1029::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest103/Generated103.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest103/Generated103.il index 7daa9062eb82b4..3f135c89181883 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest103/Generated103.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest103/Generated103.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated103 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -558,6 +559,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated103::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1030/Generated1030.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1030/Generated1030.il index 1b2aa24792a4d6..9069f42788a449 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1030/Generated1030.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1030/Generated1030.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1030 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5928,6 +5929,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1030::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1031/Generated1031.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1031/Generated1031.il index b0c01b133f2c71..d266441fcb53c7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1031/Generated1031.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1031/Generated1031.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1031 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5900,6 +5901,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1031::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1032/Generated1032.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1032/Generated1032.il index 0607e3cbd50994..303c75e9eadca5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1032/Generated1032.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1032/Generated1032.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1032 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5672,6 +5673,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1032::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1033/Generated1033.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1033/Generated1033.il index eed3ab99c5124a..83718de04647c5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1033/Generated1033.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1033/Generated1033.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1033 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4306,6 +4307,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1033::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1034/Generated1034.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1034/Generated1034.il index eace1b6ba9d2cc..e73304c012098a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1034/Generated1034.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1034/Generated1034.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1034 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5220,6 +5221,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1034::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1035/Generated1035.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1035/Generated1035.il index 006c704fee5e2b..d8129b04b07735 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1035/Generated1035.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1035/Generated1035.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1035 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5287,6 +5288,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1035::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1036/Generated1036.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1036/Generated1036.il index 44077140becb85..5f165096f6e9bf 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1036/Generated1036.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1036/Generated1036.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1036 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5479,6 +5480,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1036::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1037/Generated1037.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1037/Generated1037.il index 90858a231fe375..81b10f10d3f821 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1037/Generated1037.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1037/Generated1037.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1037 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5697,6 +5698,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1037::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1038/Generated1038.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1038/Generated1038.il index a536d1e0c19807..c44890cbe60b3d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1038/Generated1038.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1038/Generated1038.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1038 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5570,6 +5571,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1038::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1039/Generated1039.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1039/Generated1039.il index c6d3a9b14a03eb..a4fc9e3777acee 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1039/Generated1039.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1039/Generated1039.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1039 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5563,6 +5564,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1039::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest104/Generated104.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest104/Generated104.il index 39aaada8620d2d..9d6c269317bf48 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest104/Generated104.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest104/Generated104.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated104 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -627,6 +628,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated104::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1040/Generated1040.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1040/Generated1040.il index 7b5f4692ee6364..405594a04b53dc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1040/Generated1040.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1040/Generated1040.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1040 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3931,6 +3932,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1040::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1041/Generated1041.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1041/Generated1041.il index 2b5673b316fe1c..1cbf40e20506c7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1041/Generated1041.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1041/Generated1041.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1041 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3951,6 +3952,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1041::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1042/Generated1042.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1042/Generated1042.il index 1c1364eadfa482..494b7120429492 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1042/Generated1042.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1042/Generated1042.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1042 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4174,6 +4175,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1042::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1043/Generated1043.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1043/Generated1043.il index 112b6f44131769..612f55391c9d43 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1043/Generated1043.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1043/Generated1043.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1043 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4453,6 +4454,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1043::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1044/Generated1044.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1044/Generated1044.il index 4117b73342c33a..c69abb3e67482c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1044/Generated1044.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1044/Generated1044.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1044 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5727,6 +5728,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1044::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1045/Generated1045.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1045/Generated1045.il index 10c9d28a199e9e..5fe5c32e726a2f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1045/Generated1045.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1045/Generated1045.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1045 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5717,6 +5718,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1045::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1046/Generated1046.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1046/Generated1046.il index 9bb897552699a3..54df9c00e349da 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1046/Generated1046.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1046/Generated1046.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1046 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5687,6 +5688,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1046::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1047/Generated1047.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1047/Generated1047.il index e6dc93b1451f4b..083e9d363128b1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1047/Generated1047.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1047/Generated1047.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1047 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6002,6 +6003,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1047::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1048/Generated1048.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1048/Generated1048.il index 59e12a0fcb62a8..84b7882af83cc6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1048/Generated1048.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1048/Generated1048.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1048 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3695,6 +3696,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1048::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1049/Generated1049.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1049/Generated1049.il index 56cfe611885c17..ee6b2eafbe74e7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1049/Generated1049.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1049/Generated1049.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1049 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5656,6 +5657,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1049::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest105/Generated105.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest105/Generated105.il index 8d64f47d2b8e5e..219d5918605491 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest105/Generated105.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest105/Generated105.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated105 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -519,6 +520,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated105::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1050/Generated1050.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1050/Generated1050.il index 54005e2ad8fc08..0335aed9f47e4d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1050/Generated1050.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1050/Generated1050.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1050 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5728,6 +5729,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1050::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1051/Generated1051.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1051/Generated1051.il index a55ed3b98c1886..0fe7d153653398 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1051/Generated1051.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1051/Generated1051.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1051 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4126,6 +4127,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1051::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1052/Generated1052.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1052/Generated1052.il index e00af6d637ce18..f6fca522c570aa 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1052/Generated1052.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1052/Generated1052.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1052 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4088,6 +4089,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1052::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1053/Generated1053.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1053/Generated1053.il index fecaac2d07174c..808b5f2501b3d2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1053/Generated1053.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1053/Generated1053.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1053 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5649,6 +5650,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1053::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1054/Generated1054.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1054/Generated1054.il index 4b165d80118a81..361ea9b530b1d9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1054/Generated1054.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1054/Generated1054.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1054 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5565,6 +5566,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1054::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1055/Generated1055.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1055/Generated1055.il index d425142067e8a5..ccd2086da52a6e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1055/Generated1055.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1055/Generated1055.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1055 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6611,6 +6612,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1055::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1056/Generated1056.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1056/Generated1056.il index 0e24d7fa497706..2e7c6486699301 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1056/Generated1056.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1056/Generated1056.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1056 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5492,6 +5493,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1056::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1057/Generated1057.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1057/Generated1057.il index b228c85d4b9bb4..b059c0616d6e30 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1057/Generated1057.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1057/Generated1057.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1057 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5419,6 +5420,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1057::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1058/Generated1058.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1058/Generated1058.il index b968a0c6237b7d..0a5d3f1696f30f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1058/Generated1058.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1058/Generated1058.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1058 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5471,6 +5472,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1058::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1059/Generated1059.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1059/Generated1059.il index fcc6757fe1ca0b..13a74c912670f6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1059/Generated1059.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1059/Generated1059.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1059 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5616,6 +5617,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1059::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest106/Generated106.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest106/Generated106.il index 14da7fb761541c..c9ce1b95410401 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest106/Generated106.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest106/Generated106.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated106 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -667,6 +668,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated106::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1060/Generated1060.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1060/Generated1060.il index 9a48f77de722b2..6c6f25ec614da2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1060/Generated1060.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1060/Generated1060.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1060 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5393,6 +5394,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1060::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1061/Generated1061.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1061/Generated1061.il index 07501f453184e5..1de2f730fbadb0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1061/Generated1061.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1061/Generated1061.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1061 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5778,6 +5779,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1061::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1062/Generated1062.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1062/Generated1062.il index 4a7d026e3351e6..2faad1d1680942 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1062/Generated1062.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1062/Generated1062.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1062 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5705,6 +5706,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1062::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1063/Generated1063.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1063/Generated1063.il index da93ffd32539d9..4adb1b4622da5d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1063/Generated1063.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1063/Generated1063.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1063 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5413,6 +5414,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1063::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1064/Generated1064.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1064/Generated1064.il index 004d2c5abeba6b..d4656c4a48b566 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1064/Generated1064.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1064/Generated1064.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1064 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6340,6 +6341,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1064::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1065/Generated1065.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1065/Generated1065.il index f1356c25f7c0f6..82f574a15474c4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1065/Generated1065.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1065/Generated1065.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1065 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6253,6 +6254,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1065::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1066/Generated1066.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1066/Generated1066.il index acec2e2d259163..7d488b5c601d8e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1066/Generated1066.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1066/Generated1066.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1066 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5397,6 +5398,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1066::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1067/Generated1067.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1067/Generated1067.il index 477a44821c2c65..cb6be09c92bf88 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1067/Generated1067.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1067/Generated1067.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1067 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5416,6 +5417,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1067::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1068/Generated1068.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1068/Generated1068.il index 471d7a19085734..bf3a0891fdf993 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1068/Generated1068.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1068/Generated1068.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1068 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5242,6 +5243,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1068::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1069/Generated1069.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1069/Generated1069.il index a1d89296183577..3c079e3930886e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1069/Generated1069.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1069/Generated1069.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1069 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3831,6 +3832,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1069::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest107/Generated107.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest107/Generated107.il index efce2b1ad41491..1ab23c198d37b2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest107/Generated107.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest107/Generated107.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated107 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -474,6 +475,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated107::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1070/Generated1070.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1070/Generated1070.il index 1c6d2b10231e11..844611e4b675a9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1070/Generated1070.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1070/Generated1070.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1070 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3602,6 +3603,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1070::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1071/Generated1071.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1071/Generated1071.il index 2f0a5dbfa0b400..acac5d6c28d844 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1071/Generated1071.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1071/Generated1071.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1071 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3642,6 +3643,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1071::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1072/Generated1072.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1072/Generated1072.il index 84151e667c8b84..8797f0d822d3bd 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1072/Generated1072.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1072/Generated1072.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1072 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4197,6 +4198,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1072::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1073/Generated1073.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1073/Generated1073.il index c494fb4fc1177a..ca97ac6c0db7d9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1073/Generated1073.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1073/Generated1073.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1073 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5357,6 +5358,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1073::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1074/Generated1074.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1074/Generated1074.il index fd0f076e8abb43..eee4cb407d1750 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1074/Generated1074.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1074/Generated1074.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1074 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6569,6 +6570,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1074::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1075/Generated1075.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1075/Generated1075.il index 59b9975d008f9c..9ab96bcf3265e9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1075/Generated1075.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1075/Generated1075.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1075 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6587,6 +6588,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1075::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1076/Generated1076.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1076/Generated1076.il index fc77d880de1b56..fe23e73cf66a0d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1076/Generated1076.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1076/Generated1076.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1076 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6654,6 +6655,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1076::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1077/Generated1077.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1077/Generated1077.il index 6a9ae744aff531..078c7380d7fab1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1077/Generated1077.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1077/Generated1077.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1077 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5549,6 +5550,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1077::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1078/Generated1078.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1078/Generated1078.il index 79785a12b4858f..c411b16450f482 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1078/Generated1078.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1078/Generated1078.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1078 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5668,6 +5669,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1078::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1079/Generated1079.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1079/Generated1079.il index aace1e78b848ae..3aeb90f6cf76f8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1079/Generated1079.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1079/Generated1079.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1079 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3751,6 +3752,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1079::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest108/Generated108.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest108/Generated108.il index f23a70178fc9f4..82f9c2e4bb3b74 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest108/Generated108.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest108/Generated108.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated108 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -815,6 +816,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated108::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1080/Generated1080.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1080/Generated1080.il index db921bbabbdefd..7ea1e2bbdcd18c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1080/Generated1080.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1080/Generated1080.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1080 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3860,6 +3861,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1080::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1081/Generated1081.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1081/Generated1081.il index c21ace71b833ed..cad6ecf72b1533 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1081/Generated1081.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1081/Generated1081.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1081 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3863,6 +3864,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1081::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1082/Generated1082.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1082/Generated1082.il index 1de28b2b6d87c3..6f0b2a7fa96b89 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1082/Generated1082.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1082/Generated1082.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1082 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5930,6 +5931,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1082::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1083/Generated1083.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1083/Generated1083.il index ccace8a75ba969..2a56cfbdd0a799 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1083/Generated1083.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1083/Generated1083.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1083 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5755,6 +5756,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1083::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1084/Generated1084.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1084/Generated1084.il index 4d822d3127a70f..5e937925d25f7a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1084/Generated1084.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1084/Generated1084.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1084 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5587,6 +5588,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1084::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1085/Generated1085.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1085/Generated1085.il index e9e1515af6a82b..294dd0b6ef4e28 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1085/Generated1085.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1085/Generated1085.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1085 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6204,6 +6205,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1085::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1086/Generated1086.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1086/Generated1086.il index 1af92360c01a0b..de0c9ca4d0d6fd 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1086/Generated1086.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1086/Generated1086.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1086 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4848,6 +4849,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1086::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1087/Generated1087.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1087/Generated1087.il index 9710d069d7da85..98060ec5d33faf 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1087/Generated1087.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1087/Generated1087.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1087 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4810,6 +4811,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1087::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1088/Generated1088.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1088/Generated1088.il index 6d67768da60f0f..442e9eee6884d9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1088/Generated1088.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1088/Generated1088.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1088 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4824,6 +4825,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1088::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1089/Generated1089.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1089/Generated1089.il index 5d74d05f022446..341c5b8043115a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1089/Generated1089.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1089/Generated1089.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1089 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4870,6 +4871,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1089::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest109/Generated109.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest109/Generated109.il index e5c4976baf3bb8..9baa8b5f5bf77b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest109/Generated109.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest109/Generated109.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated109 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -667,6 +668,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated109::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1090/Generated1090.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1090/Generated1090.il index 12a06e836a8552..8d5cb61cbde895 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1090/Generated1090.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1090/Generated1090.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1090 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3147,6 +3148,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1090::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1091/Generated1091.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1091/Generated1091.il index a5348c8933dcfc..148aef7f50d260 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1091/Generated1091.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1091/Generated1091.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1091 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3238,6 +3239,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1091::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1092/Generated1092.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1092/Generated1092.il index 76f26d3a03b96b..83772fa34ee7fa 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1092/Generated1092.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1092/Generated1092.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1092 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4994,6 +4995,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1092::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1093/Generated1093.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1093/Generated1093.il index 111945f2c06a3e..dbda2d4e10b66b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1093/Generated1093.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1093/Generated1093.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1093 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5092,6 +5093,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1093::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1094/Generated1094.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1094/Generated1094.il index 09816e17ef8909..e79d38c537579d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1094/Generated1094.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1094/Generated1094.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1094 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5232,6 +5233,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1094::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1095/Generated1095.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1095/Generated1095.il index d82de5a0a4e7eb..3dd4465964ba66 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1095/Generated1095.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1095/Generated1095.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1095 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4882,6 +4883,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1095::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1096/Generated1096.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1096/Generated1096.il index 020e34bbe1a652..dba8bfa79b6d8f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1096/Generated1096.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1096/Generated1096.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1096 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4602,6 +4603,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1096::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1097/Generated1097.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1097/Generated1097.il index c031cc11c9d0aa..cf22646bb4d36f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1097/Generated1097.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1097/Generated1097.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1097 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4463,6 +4464,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1097::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1098/Generated1098.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1098/Generated1098.il index 0a50d84c12ad28..922917fb55b73b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1098/Generated1098.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1098/Generated1098.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1098 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4784,6 +4785,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1098::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1099/Generated1099.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1099/Generated1099.il index 3582da9107010d..8903e44a41f99e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1099/Generated1099.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1099/Generated1099.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1099 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5183,6 +5184,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1099::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest11/Generated11.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest11/Generated11.il index b613d3b16500f0..d66e0d24b7d673 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest11/Generated11.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest11/Generated11.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated11 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -587,6 +588,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated11::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest110/Generated110.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest110/Generated110.il index fa2a31f88716a5..de0b2ab896c1a4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest110/Generated110.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest110/Generated110.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated110 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -725,6 +726,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated110::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1100/Generated1100.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1100/Generated1100.il index 473d9371d349b4..aab32cb94b7756 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1100/Generated1100.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1100/Generated1100.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1100 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5053,6 +5054,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1100::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1101/Generated1101.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1101/Generated1101.il index d978c0c63a5961..c4fc58ad9745fc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1101/Generated1101.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1101/Generated1101.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1101 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4963,6 +4964,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1101::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1102/Generated1102.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1102/Generated1102.il index 1ea4c6fd7cb79e..84e937706c795f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1102/Generated1102.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1102/Generated1102.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1102 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4709,6 +4710,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1102::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1103/Generated1103.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1103/Generated1103.il index cbde1742acb704..a97ac84868f5e5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1103/Generated1103.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1103/Generated1103.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1103 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4707,6 +4708,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1103::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1104/Generated1104.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1104/Generated1104.il index 8402e2a62558c1..e5ff0f6f0134db 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1104/Generated1104.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1104/Generated1104.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1104 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4592,6 +4593,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1104::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1105/Generated1105.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1105/Generated1105.il index 912cc32a57795f..0d767e54f9d008 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1105/Generated1105.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1105/Generated1105.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1105 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3270,6 +3271,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1105::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1106/Generated1106.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1106/Generated1106.il index 368c7390c92052..976493a4bae1db 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1106/Generated1106.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1106/Generated1106.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1106 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5645,6 +5646,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1106::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1107/Generated1107.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1107/Generated1107.il index 6f60f8ac60946b..3be34c8dbd40f4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1107/Generated1107.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1107/Generated1107.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1107 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5141,6 +5142,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1107::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1108/Generated1108.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1108/Generated1108.il index 72771ba3454035..796e8f0a968865 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1108/Generated1108.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1108/Generated1108.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1108 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3703,6 +3704,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1108::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1109/Generated1109.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1109/Generated1109.il index a474ffbeed0191..d856b04cfef117 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1109/Generated1109.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1109/Generated1109.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1109 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3304,6 +3305,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1109::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest111/Generated111.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest111/Generated111.il index baedb56a584a74..7dc70892a7f5e6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest111/Generated111.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest111/Generated111.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated111 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -673,6 +674,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated111::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1110/Generated1110.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1110/Generated1110.il index ab4eb66096dbf6..6cb0a331eadc25 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1110/Generated1110.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1110/Generated1110.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1110 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3382,6 +3383,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1110::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1111/Generated1111.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1111/Generated1111.il index 6123191e6a58bb..68b7e4b55d3b45 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1111/Generated1111.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1111/Generated1111.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1111 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4918,6 +4919,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1111::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1112/Generated1112.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1112/Generated1112.il index d9be518bf7bb34..028113feb8a627 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1112/Generated1112.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1112/Generated1112.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1112 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5302,6 +5303,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1112::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1113/Generated1113.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1113/Generated1113.il index ca572497f23245..1ea8acccdbddb7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1113/Generated1113.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1113/Generated1113.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1113 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4722,6 +4723,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1113::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1114/Generated1114.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1114/Generated1114.il index b956636bc2be34..52e68a587b5889 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1114/Generated1114.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1114/Generated1114.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1114 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4986,6 +4987,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1114::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1115/Generated1115.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1115/Generated1115.il index 2b4f686b183a10..867443e50cdbab 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1115/Generated1115.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1115/Generated1115.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1115 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4841,6 +4842,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1115::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1116/Generated1116.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1116/Generated1116.il index 97d57c323ee246..1b87d663c05687 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1116/Generated1116.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1116/Generated1116.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1116 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4867,6 +4868,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1116::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1117/Generated1117.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1117/Generated1117.il index b650f851793fd4..ba01fc1ae3a9a6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1117/Generated1117.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1117/Generated1117.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1117 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4834,6 +4835,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1117::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1118/Generated1118.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1118/Generated1118.il index 7c5a673c002af7..d8d7b1457ac53e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1118/Generated1118.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1118/Generated1118.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1118 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5516,6 +5517,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1118::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1119/Generated1119.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1119/Generated1119.il index 92afdc0775760d..d29309ac95533c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1119/Generated1119.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1119/Generated1119.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1119 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5643,6 +5644,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1119::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest112/Generated112.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest112/Generated112.il index 04f73ee61f4f59..a6df81e3ef9fac 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest112/Generated112.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest112/Generated112.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated112 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -500,6 +501,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated112::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1120/Generated1120.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1120/Generated1120.il index ff38e5a7c17c53..b3750aec2bf748 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1120/Generated1120.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1120/Generated1120.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1120 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3658,6 +3659,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1120::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1121/Generated1121.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1121/Generated1121.il index 1645f62186483c..1683b98f88abd4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1121/Generated1121.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1121/Generated1121.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1121 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4871,6 +4872,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1121::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1122/Generated1122.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1122/Generated1122.il index 0b17e1b86fc360..54abdd7885e023 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1122/Generated1122.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1122/Generated1122.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1122 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4984,6 +4985,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1122::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1123/Generated1123.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1123/Generated1123.il index 1da472c01c6c95..057ea29ebd7e9a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1123/Generated1123.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1123/Generated1123.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1123 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4961,6 +4962,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1123::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1124/Generated1124.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1124/Generated1124.il index cac01cbe1bed8a..fdf875a9d1c06d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1124/Generated1124.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1124/Generated1124.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1124 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4647,6 +4648,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1124::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1125/Generated1125.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1125/Generated1125.il index b0bbbe048704f2..73eada2591a731 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1125/Generated1125.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1125/Generated1125.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1125 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4797,6 +4798,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1125::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1126/Generated1126.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1126/Generated1126.il index 31b53bf8f64e5b..731d1affc34d87 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1126/Generated1126.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1126/Generated1126.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1126 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4900,6 +4901,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1126::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1127/Generated1127.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1127/Generated1127.il index 5e70542b9b3ac1..9a6b1e06601915 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1127/Generated1127.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1127/Generated1127.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1127 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6017,6 +6018,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1127::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1128/Generated1128.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1128/Generated1128.il index 8d6dabca4509a4..d35af8bacf8259 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1128/Generated1128.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1128/Generated1128.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1128 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5992,6 +5993,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1128::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1129/Generated1129.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1129/Generated1129.il index b91a89bc308ddf..2bb8fd0aab6f15 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1129/Generated1129.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1129/Generated1129.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1129 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5001,6 +5002,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1129::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest113/Generated113.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest113/Generated113.il index 76cc4c5143e81c..919b90b4e0f5ba 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest113/Generated113.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest113/Generated113.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated113 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -593,6 +594,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated113::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1130/Generated1130.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1130/Generated1130.il index 4e6f87d1160678..dcf0bf0c9fd4f0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1130/Generated1130.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1130/Generated1130.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1130 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4899,6 +4900,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1130::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1131/Generated1131.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1131/Generated1131.il index 2314f8089ffd16..3a4220f3e92c54 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1131/Generated1131.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1131/Generated1131.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1131 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3662,6 +3663,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1131::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1132/Generated1132.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1132/Generated1132.il index a09543d473b8f4..740676de2f520e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1132/Generated1132.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1132/Generated1132.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1132 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5606,6 +5607,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1132::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1133/Generated1133.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1133/Generated1133.il index 50017b94ebc68f..35cd0ba9235135 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1133/Generated1133.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1133/Generated1133.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1133 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5602,6 +5603,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1133::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1134/Generated1134.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1134/Generated1134.il index 226d7229cf7950..5fbe6ae822e8ab 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1134/Generated1134.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1134/Generated1134.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1134 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4387,6 +4388,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1134::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1135/Generated1135.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1135/Generated1135.il index fa827837bcb710..a25459cc1ac838 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1135/Generated1135.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1135/Generated1135.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1135 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4852,6 +4853,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1135::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1136/Generated1136.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1136/Generated1136.il index 72b70aacdfebf0..82fd8188383ecc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1136/Generated1136.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1136/Generated1136.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1136 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4930,6 +4931,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1136::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1137/Generated1137.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1137/Generated1137.il index 4b3cc3deaa76ce..8c022455efd02d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1137/Generated1137.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1137/Generated1137.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1137 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4978,6 +4979,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1137::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1138/Generated1138.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1138/Generated1138.il index 3c9c895e4ee992..a278222cf1be30 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1138/Generated1138.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1138/Generated1138.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1138 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4919,6 +4920,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1138::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1139/Generated1139.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1139/Generated1139.il index 1cb05649f1eac7..572bdfb10894c2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1139/Generated1139.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1139/Generated1139.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1139 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5714,6 +5715,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1139::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest114/Generated114.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest114/Generated114.il index 00ae6e26619d91..fef16c2f31ba5d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest114/Generated114.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest114/Generated114.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated114 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -464,6 +465,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated114::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1140/Generated1140.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1140/Generated1140.il index 0d14aa71b52307..4b06bad0610048 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1140/Generated1140.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1140/Generated1140.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1140 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5611,6 +5612,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1140::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1141/Generated1141.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1141/Generated1141.il index cc308d2d4cdca4..4ac82e83852764 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1141/Generated1141.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1141/Generated1141.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1141 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5006,6 +5007,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1141::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1142/Generated1142.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1142/Generated1142.il index 77be38204ed191..7e64dca552503c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1142/Generated1142.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1142/Generated1142.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1142 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4915,6 +4916,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1142::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1143/Generated1143.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1143/Generated1143.il index ea1670bef3257a..f2f4eb044592c1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1143/Generated1143.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1143/Generated1143.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1143 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4765,6 +4766,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1143::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1144/Generated1144.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1144/Generated1144.il index e87609013fc5d8..fd822569fbbcd6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1144/Generated1144.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1144/Generated1144.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1144 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4800,6 +4801,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1144::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1145/Generated1145.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1145/Generated1145.il index e85c595520f52f..489d1800860467 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1145/Generated1145.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1145/Generated1145.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1145 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4753,6 +4754,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1145::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1146/Generated1146.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1146/Generated1146.il index d16e6e6363ed27..aea6886a4b156e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1146/Generated1146.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1146/Generated1146.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1146 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4533,6 +4534,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1146::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1147/Generated1147.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1147/Generated1147.il index cfdc19410b1f24..43be7b6a471304 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1147/Generated1147.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1147/Generated1147.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1147 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4584,6 +4585,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1147::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1148/Generated1148.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1148/Generated1148.il index bf1b54b53fad53..e577f3bb476256 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1148/Generated1148.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1148/Generated1148.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1148 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5110,6 +5111,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1148::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1149/Generated1149.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1149/Generated1149.il index 7b1a4b1c279820..bc527d02d22529 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1149/Generated1149.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1149/Generated1149.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1149 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5004,6 +5005,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1149::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest115/Generated115.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest115/Generated115.il index 40bc29ce3d3382..6e4568c83f75cf 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest115/Generated115.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest115/Generated115.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated115 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -500,6 +501,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated115::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1150/Generated1150.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1150/Generated1150.il index eb574824e3feb7..f1b3d33c179c1a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1150/Generated1150.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1150/Generated1150.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1150 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5014,6 +5015,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1150::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1151/Generated1151.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1151/Generated1151.il index e1e7e3cf2dfd95..e168f1eec191f3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1151/Generated1151.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1151/Generated1151.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1151 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4953,6 +4954,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1151::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1152/Generated1152.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1152/Generated1152.il index d3a522a1c99137..6240969990172d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1152/Generated1152.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1152/Generated1152.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1152 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4957,6 +4958,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1152::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1153/Generated1153.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1153/Generated1153.il index 23e096d4a22237..9bd1e627bb7d8a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1153/Generated1153.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1153/Generated1153.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1153 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5874,6 +5875,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1153::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1154/Generated1154.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1154/Generated1154.il index fd861711be7f91..c0599a709f7135 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1154/Generated1154.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1154/Generated1154.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1154 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5616,6 +5617,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1154::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1155/Generated1155.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1155/Generated1155.il index e71a90a49db57f..6fd8bbe0295044 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1155/Generated1155.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1155/Generated1155.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1155 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5115,6 +5116,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1155::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1156/Generated1156.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1156/Generated1156.il index 05aea67c9d0f92..754651438e6532 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1156/Generated1156.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1156/Generated1156.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1156 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3117,6 +3118,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1156::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1157/Generated1157.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1157/Generated1157.il index 7ccdd6e3295d89..645006554a3a16 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1157/Generated1157.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1157/Generated1157.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1157 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5192,6 +5193,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1157::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1158/Generated1158.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1158/Generated1158.il index b0a740b57b1eea..69354b4d894ef2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1158/Generated1158.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1158/Generated1158.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1158 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4443,6 +4444,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1158::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1159/Generated1159.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1159/Generated1159.il index 026e2110ceeb1f..8ea78cb50b7e5f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1159/Generated1159.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1159/Generated1159.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1159 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4864,6 +4865,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1159::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest116/Generated116.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest116/Generated116.il index 214bc7fc00e2de..dcc913b330a61e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest116/Generated116.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest116/Generated116.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated116 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -773,6 +774,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated116::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1160/Generated1160.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1160/Generated1160.il index fd6c4c64ab9b64..899a84088065dc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1160/Generated1160.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1160/Generated1160.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1160 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5048,6 +5049,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1160::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1161/Generated1161.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1161/Generated1161.il index 343889385390d9..1021a6be76af3e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1161/Generated1161.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1161/Generated1161.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1161 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5025,6 +5026,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1161::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1162/Generated1162.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1162/Generated1162.il index 273cde41d852ad..02a9a63f9d36f9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1162/Generated1162.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1162/Generated1162.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1162 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4909,6 +4910,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1162::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1163/Generated1163.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1163/Generated1163.il index 506a46f320590d..402f530e5cc655 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1163/Generated1163.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1163/Generated1163.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1163 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3771,6 +3772,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1163::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1164/Generated1164.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1164/Generated1164.il index 2f5e6f0bd37338..706d69b506f057 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1164/Generated1164.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1164/Generated1164.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1164 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3259,6 +3260,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1164::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1165/Generated1165.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1165/Generated1165.il index 1d853c7e943f8e..92ef68ccc54f57 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1165/Generated1165.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1165/Generated1165.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1165 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3195,6 +3196,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1165::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1166/Generated1166.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1166/Generated1166.il index f0e37c50295d2b..517216847d7183 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1166/Generated1166.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1166/Generated1166.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1166 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3429,6 +3430,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1166::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1167/Generated1167.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1167/Generated1167.il index 2736bea89fd833..b92bcb86d1b150 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1167/Generated1167.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1167/Generated1167.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1167 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3651,6 +3652,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1167::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1168/Generated1168.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1168/Generated1168.il index 504d0192edc2b9..6df9277df17425 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1168/Generated1168.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1168/Generated1168.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1168 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3495,6 +3496,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1168::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1169/Generated1169.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1169/Generated1169.il index 8e18b219bf4bf5..a83bc8aeb42c4c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1169/Generated1169.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1169/Generated1169.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1169 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5377,6 +5378,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1169::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest117/Generated117.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest117/Generated117.il index 631f2882be4e15..88a97449fff07a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest117/Generated117.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest117/Generated117.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated117 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -612,6 +613,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated117::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1170/Generated1170.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1170/Generated1170.il index 7b972a2af2a409..f67a73b50340ca 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1170/Generated1170.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1170/Generated1170.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1170 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3099,6 +3100,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1170::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1171/Generated1171.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1171/Generated1171.il index b4ca0273332c5f..29d0edf2feca8b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1171/Generated1171.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1171/Generated1171.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1171 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3055,6 +3056,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1171::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1172/Generated1172.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1172/Generated1172.il index 06c6029c783dd7..15467bc56ad28a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1172/Generated1172.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1172/Generated1172.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1172 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4659,6 +4660,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1172::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1173/Generated1173.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1173/Generated1173.il index 99a12e3e9373fb..dd1e993a5d1a02 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1173/Generated1173.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1173/Generated1173.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1173 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4489,6 +4490,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1173::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1174/Generated1174.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1174/Generated1174.il index 78087d4f04a0ab..35f1f8642288a2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1174/Generated1174.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1174/Generated1174.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1174 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4632,6 +4633,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1174::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1175/Generated1175.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1175/Generated1175.il index 5c7ceb97ce097a..2f8425333705a0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1175/Generated1175.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1175/Generated1175.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1175 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5927,6 +5928,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1175::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1176/Generated1176.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1176/Generated1176.il index 6a662e9cc413af..a860220a0fc978 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1176/Generated1176.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1176/Generated1176.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1176 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5772,6 +5773,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1176::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1177/Generated1177.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1177/Generated1177.il index 622b3ee63c4030..51b71f0266d956 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1177/Generated1177.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1177/Generated1177.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1177 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3634,6 +3635,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1177::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1178/Generated1178.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1178/Generated1178.il index 42098d94768239..371103fc369ff5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1178/Generated1178.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1178/Generated1178.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1178 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3275,6 +3276,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1178::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1179/Generated1179.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1179/Generated1179.il index 747f2302ba1525..9ff6b8bb264886 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1179/Generated1179.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1179/Generated1179.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1179 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3460,6 +3461,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1179::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest118/Generated118.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest118/Generated118.il index 3e36b86811fa65..0c185358a88807 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest118/Generated118.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest118/Generated118.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated118 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -693,6 +694,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated118::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1180/Generated1180.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1180/Generated1180.il index f5ad8350f992f7..47f82943658217 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1180/Generated1180.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1180/Generated1180.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1180 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3258,6 +3259,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1180::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1181/Generated1181.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1181/Generated1181.il index c789fa2b05db50..c172eb9c38c22c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1181/Generated1181.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1181/Generated1181.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1181 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3366,6 +3367,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1181::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1182/Generated1182.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1182/Generated1182.il index 8af7d8a5814e66..924b006660216a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1182/Generated1182.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1182/Generated1182.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1182 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3330,6 +3331,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1182::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1183/Generated1183.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1183/Generated1183.il index bd3ece22f6da31..c86340731e8392 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1183/Generated1183.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1183/Generated1183.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1183 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3462,6 +3463,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1183::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1184/Generated1184.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1184/Generated1184.il index e13c271544e85d..9c6d1eec54b196 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1184/Generated1184.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1184/Generated1184.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1184 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4999,6 +5000,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1184::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1185/Generated1185.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1185/Generated1185.il index d49c5eb1fcfed1..46d695b7422aa8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1185/Generated1185.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1185/Generated1185.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1185 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5019,6 +5020,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1185::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1186/Generated1186.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1186/Generated1186.il index c6465216ae1ce2..2f568e58808584 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1186/Generated1186.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1186/Generated1186.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1186 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4818,6 +4819,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1186::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1187/Generated1187.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1187/Generated1187.il index a86e2b992c4c4f..a93684bba6919f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1187/Generated1187.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1187/Generated1187.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1187 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3181,6 +3182,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1187::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1188/Generated1188.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1188/Generated1188.il index a56b9417129c10..b888f17a516971 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1188/Generated1188.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1188/Generated1188.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1188 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3086,6 +3087,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1188::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1189/Generated1189.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1189/Generated1189.il index a3cef266cd15bd..748b19f7558dbe 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1189/Generated1189.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1189/Generated1189.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1189 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3405,6 +3406,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1189::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest119/Generated119.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest119/Generated119.il index 1958e441b60f82..1e30ae45e41d57 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest119/Generated119.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest119/Generated119.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated119 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -486,6 +487,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated119::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1190/Generated1190.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1190/Generated1190.il index cce1725706ce9e..81028d08bba40b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1190/Generated1190.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1190/Generated1190.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1190 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3457,6 +3458,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1190::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1191/Generated1191.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1191/Generated1191.il index 3ee8384d8af406..e77635bd260409 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1191/Generated1191.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1191/Generated1191.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1191 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3334,6 +3335,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1191::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1192/Generated1192.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1192/Generated1192.il index 753d25ae7610d0..5f1f41eccd05c5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1192/Generated1192.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1192/Generated1192.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1192 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3288,6 +3289,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1192::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1193/Generated1193.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1193/Generated1193.il index 8bedd116d7fa5d..4fb8206b9987e5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1193/Generated1193.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1193/Generated1193.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1193 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3308,6 +3309,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1193::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1194/Generated1194.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1194/Generated1194.il index 674246685810a7..a48d8d96fbd38e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1194/Generated1194.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1194/Generated1194.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1194 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3343,6 +3344,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1194::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1195/Generated1195.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1195/Generated1195.il index 375c05d86de535..c135925c222bde 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1195/Generated1195.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1195/Generated1195.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1195 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5045,6 +5046,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1195::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1196/Generated1196.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1196/Generated1196.il index 70e4aaaaecae2b..b1e61beed9777b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1196/Generated1196.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1196/Generated1196.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1196 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4742,6 +4743,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1196::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1197/Generated1197.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1197/Generated1197.il index 873e170a55c1b2..4662499927df14 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1197/Generated1197.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1197/Generated1197.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1197 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4677,6 +4678,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1197::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1198/Generated1198.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1198/Generated1198.il index 945fdf370dcc7a..a3f0dcaa54e7a8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1198/Generated1198.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1198/Generated1198.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1198 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4938,6 +4939,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1198::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1199/Generated1199.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1199/Generated1199.il index 248c283d5bd7c9..2cdfd9f474fa38 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1199/Generated1199.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1199/Generated1199.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1199 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4835,6 +4836,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1199::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest12/Generated12.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest12/Generated12.il index 36785fa72963bc..e68b3159f18270 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest12/Generated12.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest12/Generated12.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated12 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -601,6 +602,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated12::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest120/Generated120.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest120/Generated120.il index 367aba0a3bf292..748d0cfac9b464 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest120/Generated120.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest120/Generated120.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated120 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -583,6 +584,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated120::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1200/Generated1200.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1200/Generated1200.il index c29da3bed7ab20..49f9b51f2a5727 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1200/Generated1200.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1200/Generated1200.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1200 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5346,6 +5347,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1200::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1201/Generated1201.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1201/Generated1201.il index 095856f0e0e49e..4542cb8ad0657b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1201/Generated1201.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1201/Generated1201.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1201 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5330,6 +5331,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1201::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1202/Generated1202.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1202/Generated1202.il index 01c67d0b5c3329..5339130221373a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1202/Generated1202.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1202/Generated1202.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1202 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5792,6 +5793,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1202::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1203/Generated1203.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1203/Generated1203.il index 1dbf63bc8647e5..408e921a65d483 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1203/Generated1203.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1203/Generated1203.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1203 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5456,6 +5457,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1203::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1204/Generated1204.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1204/Generated1204.il index c2064e5d4df3d7..f7d7ce3501b876 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1204/Generated1204.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1204/Generated1204.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1204 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4711,6 +4712,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1204::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1205/Generated1205.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1205/Generated1205.il index d5f9ed50569d9c..ba05fb84120b73 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1205/Generated1205.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1205/Generated1205.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1205 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5308,6 +5309,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1205::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1206/Generated1206.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1206/Generated1206.il index 7ee235a8d8ea71..7725e2d2bf136d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1206/Generated1206.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1206/Generated1206.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1206 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3014,6 +3015,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1206::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1207/Generated1207.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1207/Generated1207.il index 9b85f8333d810d..2ee035e1986437 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1207/Generated1207.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1207/Generated1207.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1207 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3077,6 +3078,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1207::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1208/Generated1208.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1208/Generated1208.il index 2a81ca3d11a63f..963ddacf4e210c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1208/Generated1208.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1208/Generated1208.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1208 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3105,6 +3106,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1208::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1209/Generated1209.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1209/Generated1209.il index c35994dc9b304a..d73beeb9c37ffc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1209/Generated1209.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1209/Generated1209.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1209 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3346,6 +3347,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1209::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest121/Generated121.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest121/Generated121.il index 5bfbdb3da6305e..ca3fe642d0f458 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest121/Generated121.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest121/Generated121.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated121 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -428,6 +429,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated121::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1210/Generated1210.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1210/Generated1210.il index 19affba77caf79..cc2f4382dbea3f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1210/Generated1210.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1210/Generated1210.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1210 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3165,6 +3166,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1210::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1211/Generated1211.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1211/Generated1211.il index b864f5355ab2db..225df5eb3fdc38 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1211/Generated1211.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1211/Generated1211.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1211 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4614,6 +4615,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1211::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1212/Generated1212.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1212/Generated1212.il index 32d95b49072627..885c489cbc1f91 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1212/Generated1212.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1212/Generated1212.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1212 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4619,6 +4620,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1212::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1213/Generated1213.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1213/Generated1213.il index c85ccd44f7730e..35cf4e8c6c1e86 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1213/Generated1213.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1213/Generated1213.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1213 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4576,6 +4577,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1213::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1214/Generated1214.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1214/Generated1214.il index 6b00f8d9947381..0e8b16145b2c37 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1214/Generated1214.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1214/Generated1214.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1214 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4594,6 +4595,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1214::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1215/Generated1215.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1215/Generated1215.il index d31abad44cb5c8..50708561064fd9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1215/Generated1215.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1215/Generated1215.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1215 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4303,6 +4304,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1215::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1216/Generated1216.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1216/Generated1216.il index c6d2be5e040484..c67fe4251f8613 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1216/Generated1216.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1216/Generated1216.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1216 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4531,6 +4532,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1216::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1217/Generated1217.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1217/Generated1217.il index 38038cf90b79b0..7ff11bbcb7e46c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1217/Generated1217.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1217/Generated1217.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1217 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4590,6 +4591,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1217::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1218/Generated1218.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1218/Generated1218.il index 8499c0c877884c..7dfe5c602a3229 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1218/Generated1218.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1218/Generated1218.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1218 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4512,6 +4513,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1218::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1219/Generated1219.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1219/Generated1219.il index 10fddf5e82a51e..e431660427f546 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1219/Generated1219.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1219/Generated1219.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1219 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5092,6 +5093,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1219::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest122/Generated122.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest122/Generated122.il index 93d147cd438f19..dbd20f95b19b3b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest122/Generated122.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest122/Generated122.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated122 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -746,6 +747,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated122::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1220/Generated1220.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1220/Generated1220.il index babcaef0e0bfdf..1474164db62baa 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1220/Generated1220.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1220/Generated1220.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1220 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6014,6 +6015,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1220::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1221/Generated1221.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1221/Generated1221.il index f10de5d874106d..977b60d79309d8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1221/Generated1221.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1221/Generated1221.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1221 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6222,6 +6223,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1221::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1222/Generated1222.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1222/Generated1222.il index 069a8fca14ab12..92b0f7cdd5563f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1222/Generated1222.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1222/Generated1222.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1222 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5832,6 +5833,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1222::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1223/Generated1223.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1223/Generated1223.il index 9843561c0d6b04..14abd24d622331 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1223/Generated1223.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1223/Generated1223.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1223 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5742,6 +5743,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1223::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1224/Generated1224.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1224/Generated1224.il index b68c9610c236fc..5f6d91abbe6da6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1224/Generated1224.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1224/Generated1224.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1224 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5551,6 +5552,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1224::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1225/Generated1225.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1225/Generated1225.il index cc0ed27f87261a..1eed0b3b8742f3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1225/Generated1225.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1225/Generated1225.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1225 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5610,6 +5611,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1225::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1226/Generated1226.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1226/Generated1226.il index c51f5fa44912b2..cb18c4503a9cd1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1226/Generated1226.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1226/Generated1226.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1226 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5848,6 +5849,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1226::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1227/Generated1227.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1227/Generated1227.il index 9d0489046bb063..fc50ec1467c8dc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1227/Generated1227.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1227/Generated1227.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1227 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3416,6 +3417,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1227::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1228/Generated1228.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1228/Generated1228.il index 8f42766066da0a..6137c2aae08370 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1228/Generated1228.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1228/Generated1228.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1228 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4921,6 +4922,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1228::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1229/Generated1229.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1229/Generated1229.il index b276735defc4c0..010f0cf1f501a5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1229/Generated1229.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1229/Generated1229.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1229 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4975,6 +4976,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1229::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest123/Generated123.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest123/Generated123.il index dd0dcb1618d09c..44ee99b8e13236 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest123/Generated123.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest123/Generated123.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated123 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -721,6 +722,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated123::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1230/Generated1230.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1230/Generated1230.il index 940cbd2c87d86a..84c4586338f329 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1230/Generated1230.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1230/Generated1230.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1230 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5030,6 +5031,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1230::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1231/Generated1231.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1231/Generated1231.il index 8802794c6eb4a4..a06fe92f117229 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1231/Generated1231.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1231/Generated1231.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1231 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4768,6 +4769,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1231::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1232/Generated1232.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1232/Generated1232.il index fb876c4f4c3e28..b2eff3a639ece5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1232/Generated1232.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1232/Generated1232.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1232 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3100,6 +3101,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1232::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1233/Generated1233.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1233/Generated1233.il index f7be9df6e30865..7339366b388c4e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1233/Generated1233.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1233/Generated1233.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1233 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3040,6 +3041,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1233::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1234/Generated1234.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1234/Generated1234.il index 40d9bd830e18c7..207052f8cdff94 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1234/Generated1234.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1234/Generated1234.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1234 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4240,6 +4241,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1234::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1235/Generated1235.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1235/Generated1235.il index 4d5f9079b5ad3f..3639db2b340e32 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1235/Generated1235.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1235/Generated1235.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1235 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4040,6 +4041,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1235::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1236/Generated1236.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1236/Generated1236.il index 62e7ec830b6391..b660dbca7ac5fc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1236/Generated1236.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1236/Generated1236.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1236 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3966,6 +3967,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1236::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1237/Generated1237.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1237/Generated1237.il index 8f317d1d1c899d..5225b151dad000 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1237/Generated1237.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1237/Generated1237.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1237 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4507,6 +4508,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1237::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1238/Generated1238.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1238/Generated1238.il index 70ecd1578f7947..2f0c9f790a94de 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1238/Generated1238.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1238/Generated1238.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1238 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4526,6 +4527,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1238::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1239/Generated1239.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1239/Generated1239.il index b600fa9de5066d..ca75ee6274c228 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1239/Generated1239.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1239/Generated1239.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1239 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4613,6 +4614,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1239::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest124/Generated124.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest124/Generated124.il index 19b4c281bea5a9..e43049a5892e59 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest124/Generated124.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest124/Generated124.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated124 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -778,6 +779,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated124::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1240/Generated1240.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1240/Generated1240.il index e21f6cb08aac99..508e76e2341724 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1240/Generated1240.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1240/Generated1240.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1240 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3091,6 +3092,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1240::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1241/Generated1241.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1241/Generated1241.il index 85ae99c9c022f2..446ffdad65e2c8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1241/Generated1241.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1241/Generated1241.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1241 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3174,6 +3175,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1241::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1242/Generated1242.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1242/Generated1242.il index ee36f3cbeb4d0c..7a67469dc4c34a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1242/Generated1242.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1242/Generated1242.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1242 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4665,6 +4666,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1242::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1243/Generated1243.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1243/Generated1243.il index 1da28eab88e095..15637847135797 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1243/Generated1243.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1243/Generated1243.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1243 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5980,6 +5981,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1243::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1244/Generated1244.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1244/Generated1244.il index 6cc2e5690d9060..b9bd621751c190 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1244/Generated1244.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1244/Generated1244.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1244 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3094,6 +3095,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1244::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1245/Generated1245.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1245/Generated1245.il index 871d049034b6bc..292bd636c83a3c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1245/Generated1245.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1245/Generated1245.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1245 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3007,6 +3008,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1245::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1246/Generated1246.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1246/Generated1246.il index c362e0b2fb1213..a614c8424d750b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1246/Generated1246.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1246/Generated1246.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1246 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3134,6 +3135,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1246::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1247/Generated1247.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1247/Generated1247.il index b1aa4ca80e4030..358f96d8bc8234 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1247/Generated1247.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1247/Generated1247.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1247 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3073,6 +3074,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1247::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1248/Generated1248.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1248/Generated1248.il index 8a9f2458da9c02..f2e8260e762d58 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1248/Generated1248.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1248/Generated1248.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1248 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4274,6 +4275,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1248::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1249/Generated1249.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1249/Generated1249.il index 0cc2684afcea6f..6f42dc0f623a17 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1249/Generated1249.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1249/Generated1249.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1249 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3572,6 +3573,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1249::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest125/Generated125.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest125/Generated125.il index aec39874a1ae23..9e0fea6e41060d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest125/Generated125.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest125/Generated125.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated125 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -714,6 +715,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated125::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1250/Generated1250.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1250/Generated1250.il index f736308baa9179..0efecd7c642ba8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1250/Generated1250.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1250/Generated1250.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1250 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3741,6 +3742,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1250::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1251/Generated1251.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1251/Generated1251.il index 114ff27d97a55a..870ae168bde0a9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1251/Generated1251.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1251/Generated1251.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1251 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3951,6 +3952,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1251::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1252/Generated1252.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1252/Generated1252.il index 4539c5ee6de7bd..5f34f0248f37b7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1252/Generated1252.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1252/Generated1252.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1252 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3620,6 +3621,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1252::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1253/Generated1253.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1253/Generated1253.il index 5b7165a1adf042..e6c1c2f7ca0074 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1253/Generated1253.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1253/Generated1253.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1253 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3630,6 +3631,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1253::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1254/Generated1254.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1254/Generated1254.il index e28e1573e8b7a4..c53fbc862e3f8d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1254/Generated1254.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1254/Generated1254.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1254 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5098,6 +5099,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1254::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1255/Generated1255.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1255/Generated1255.il index 0842cf42ef0c90..5ed69ae1d3bd6d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1255/Generated1255.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1255/Generated1255.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1255 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5214,6 +5215,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1255::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1256/Generated1256.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1256/Generated1256.il index 66d8c429354f8f..f8cce63a4a1b62 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1256/Generated1256.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1256/Generated1256.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1256 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4342,6 +4343,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1256::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1257/Generated1257.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1257/Generated1257.il index 45516cc698a1d8..7444ae6a495f73 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1257/Generated1257.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1257/Generated1257.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1257 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4360,6 +4361,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1257::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1258/Generated1258.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1258/Generated1258.il index 6622d7c36a14e3..334171ef58b720 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1258/Generated1258.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1258/Generated1258.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1258 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4025,6 +4026,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1258::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1259/Generated1259.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1259/Generated1259.il index 21a666533b196f..8a5989d516741e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1259/Generated1259.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1259/Generated1259.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1259 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2832,6 +2833,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1259::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest126/Generated126.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest126/Generated126.il index be8f8895ec4777..10e94ffbde29ee 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest126/Generated126.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest126/Generated126.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated126 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -509,6 +510,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated126::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1260/Generated1260.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1260/Generated1260.il index 66b1c6bca711ed..14224471c411ec 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1260/Generated1260.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1260/Generated1260.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1260 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5229,6 +5230,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1260::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1261/Generated1261.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1261/Generated1261.il index a1e4598bea1802..c56fb1bc66854c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1261/Generated1261.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1261/Generated1261.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1261 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5327,6 +5328,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1261::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1262/Generated1262.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1262/Generated1262.il index 67e735dec85edf..4ee3fa7958bc9b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1262/Generated1262.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1262/Generated1262.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1262 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2314,6 +2315,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1262::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1263/Generated1263.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1263/Generated1263.il index eef94cd5cf5fde..dc6b5403a14e3a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1263/Generated1263.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1263/Generated1263.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1263 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2296,6 +2297,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1263::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1264/Generated1264.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1264/Generated1264.il index a9f3dcdf2ddac2..83795ec87fc43d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1264/Generated1264.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1264/Generated1264.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1264 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2296,6 +2297,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1264::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1265/Generated1265.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1265/Generated1265.il index a4677764ad4dbd..71b02bb5834d03 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1265/Generated1265.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1265/Generated1265.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1265 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3579,6 +3580,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1265::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1266/Generated1266.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1266/Generated1266.il index ea2a64c3c86c85..e8d717e56e28a1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1266/Generated1266.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1266/Generated1266.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1266 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3617,6 +3618,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1266::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1267/Generated1267.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1267/Generated1267.il index 9cef461a6ac518..226588dd6bad34 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1267/Generated1267.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1267/Generated1267.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1267 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3622,6 +3623,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1267::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1268/Generated1268.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1268/Generated1268.il index a0e4e06307ed3e..3bbc20ce897e60 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1268/Generated1268.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1268/Generated1268.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1268 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5587,6 +5588,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1268::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1269/Generated1269.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1269/Generated1269.il index 4828e46e30511f..c238001e9bf4ee 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1269/Generated1269.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1269/Generated1269.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1269 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5526,6 +5527,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1269::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest127/Generated127.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest127/Generated127.il index c0f17f3b4bd7c3..386ab04c6abdde 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest127/Generated127.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest127/Generated127.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated127 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -512,6 +513,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated127::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1270/Generated1270.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1270/Generated1270.il index e7e11b902f4b1f..ccfaee26cccc21 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1270/Generated1270.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1270/Generated1270.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1270 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5652,6 +5653,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1270::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1271/Generated1271.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1271/Generated1271.il index d358a01b751174..8a14ae26747a2b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1271/Generated1271.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1271/Generated1271.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1271 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4255,6 +4256,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1271::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1272/Generated1272.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1272/Generated1272.il index b882ab694646c7..d104d14e38e67b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1272/Generated1272.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1272/Generated1272.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1272 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4221,6 +4222,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1272::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1273/Generated1273.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1273/Generated1273.il index 858c2362af3077..7558d35154232b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1273/Generated1273.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1273/Generated1273.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1273 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4357,6 +4358,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1273::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1274/Generated1274.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1274/Generated1274.il index b3a68ea87947b0..03a32bc0e52098 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1274/Generated1274.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1274/Generated1274.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1274 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5451,6 +5452,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1274::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1275/Generated1275.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1275/Generated1275.il index 4962652f9a1bfb..e10f0727672936 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1275/Generated1275.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1275/Generated1275.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1275 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5370,6 +5371,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1275::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1276/Generated1276.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1276/Generated1276.il index ef4152d020b691..962bdb1a2aec7c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1276/Generated1276.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1276/Generated1276.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1276 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4041,6 +4042,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1276::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1277/Generated1277.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1277/Generated1277.il index 7a7c389c8e8864..9924eb723fccd5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1277/Generated1277.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1277/Generated1277.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1277 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4402,6 +4403,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1277::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1278/Generated1278.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1278/Generated1278.il index 3059582d031856..da0a8aff46c831 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1278/Generated1278.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1278/Generated1278.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1278 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3999,6 +4000,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1278::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1279/Generated1279.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1279/Generated1279.il index 1f18e0fbc5d130..3f892aca2a3187 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1279/Generated1279.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1279/Generated1279.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1279 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3881,6 +3882,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1279::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest128/Generated128.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest128/Generated128.il index be5884166e743e..54eee436da5990 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest128/Generated128.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest128/Generated128.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated128 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -773,6 +774,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated128::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1280/Generated1280.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1280/Generated1280.il index 10ae5ea5f77e14..593f9de34b2074 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1280/Generated1280.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1280/Generated1280.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1280 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5471,6 +5472,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1280::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1281/Generated1281.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1281/Generated1281.il index 25992364288fd2..c2cfe607cb609f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1281/Generated1281.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1281/Generated1281.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1281 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5419,6 +5420,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1281::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1282/Generated1282.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1282/Generated1282.il index 63b5d6e88cd1ba..274891e78c59fd 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1282/Generated1282.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1282/Generated1282.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1282 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5435,6 +5436,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1282::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1283/Generated1283.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1283/Generated1283.il index 48ef77d909033f..0e5560bbe2cc28 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1283/Generated1283.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1283/Generated1283.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1283 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4767,6 +4768,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1283::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1284/Generated1284.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1284/Generated1284.il index cc6042cf26b08d..03c7adb399cef4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1284/Generated1284.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1284/Generated1284.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1284 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2804,6 +2805,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1284::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1285/Generated1285.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1285/Generated1285.il index c9f84d34ded419..1321ff522dc14b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1285/Generated1285.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1285/Generated1285.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1285 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2576,6 +2577,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1285::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1286/Generated1286.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1286/Generated1286.il index e95928b21a98f3..0aebfec87f35e5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1286/Generated1286.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1286/Generated1286.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1286 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3515,6 +3516,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1286::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1287/Generated1287.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1287/Generated1287.il index 9fb79b4d7df28d..1b45ed8fe8f55c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1287/Generated1287.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1287/Generated1287.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1287 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2851,6 +2852,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1287::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1288/Generated1288.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1288/Generated1288.il index cb52d98dd5707d..4faf8fa3a84a54 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1288/Generated1288.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1288/Generated1288.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1288 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2929,6 +2930,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1288::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1289/Generated1289.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1289/Generated1289.il index 71fa60f903a657..3c0ce50128388f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1289/Generated1289.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1289/Generated1289.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1289 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3030,6 +3031,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1289::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest129/Generated129.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest129/Generated129.il index 90f6861909375e..0efc21e18cfb8f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest129/Generated129.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest129/Generated129.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated129 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -778,6 +779,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated129::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1290/Generated1290.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1290/Generated1290.il index 16ece42703012d..8e6c3c94315bd2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1290/Generated1290.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1290/Generated1290.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1290 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2872,6 +2873,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1290::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1291/Generated1291.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1291/Generated1291.il index b229cdaff8ab2b..30747bb01895f1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1291/Generated1291.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1291/Generated1291.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1291 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2971,6 +2972,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1291::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1292/Generated1292.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1292/Generated1292.il index d1e27486aa5906..c2324902dc1807 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1292/Generated1292.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1292/Generated1292.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1292 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2890,6 +2891,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1292::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1293/Generated1293.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1293/Generated1293.il index e1de5b8aabc5f5..6081b050648a10 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1293/Generated1293.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1293/Generated1293.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1293 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2630,6 +2631,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1293::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1294/Generated1294.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1294/Generated1294.il index 634e9342e57b99..f737d9e14a1c51 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1294/Generated1294.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1294/Generated1294.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1294 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4208,6 +4209,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1294::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1295/Generated1295.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1295/Generated1295.il index fb7d4d4988cf30..fad30ca9b284ef 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1295/Generated1295.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1295/Generated1295.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1295 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4384,6 +4385,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1295::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1296/Generated1296.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1296/Generated1296.il index 691d8b4590b01b..702cf537f85a08 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1296/Generated1296.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1296/Generated1296.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1296 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4244,6 +4245,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1296::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1297/Generated1297.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1297/Generated1297.il index 9cca9abcb139d3..3555fc69a02bd5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1297/Generated1297.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1297/Generated1297.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1297 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4380,6 +4381,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1297::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1298/Generated1298.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1298/Generated1298.il index 6d2a196a851701..e5ca59f6b77a22 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1298/Generated1298.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1298/Generated1298.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1298 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4350,6 +4351,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1298::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1299/Generated1299.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1299/Generated1299.il index 51820694dc91a4..153c326a0833d7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1299/Generated1299.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1299/Generated1299.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1299 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5486,6 +5487,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1299::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest13/Generated13.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest13/Generated13.il index 655e34fea44530..c0af24238a0d8e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest13/Generated13.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest13/Generated13.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated13 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -566,6 +567,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated13::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest130/Generated130.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest130/Generated130.il index 29a71aaa3db471..aaf2e304909c83 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest130/Generated130.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest130/Generated130.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated130 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -656,6 +657,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated130::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1300/Generated1300.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1300/Generated1300.il index e68154c3d79cba..5f0dc672a0c8ec 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1300/Generated1300.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1300/Generated1300.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1300 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5636,6 +5637,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1300::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1301/Generated1301.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1301/Generated1301.il index ac39f276461cbe..31e26a6b265123 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1301/Generated1301.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1301/Generated1301.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1301 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4200,6 +4201,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1301::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1302/Generated1302.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1302/Generated1302.il index f15979163d4b27..54088c75067680 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1302/Generated1302.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1302/Generated1302.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1302 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4596,6 +4597,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1302::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1303/Generated1303.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1303/Generated1303.il index f1963ebc9002c8..fd551114de45f0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1303/Generated1303.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1303/Generated1303.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1303 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4375,6 +4376,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1303::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1304/Generated1304.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1304/Generated1304.il index 328c765438231e..2b0a68582dbbee 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1304/Generated1304.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1304/Generated1304.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1304 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4212,6 +4213,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1304::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1305/Generated1305.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1305/Generated1305.il index 3703d4be5b0730..56180dee7254e4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1305/Generated1305.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1305/Generated1305.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1305 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2823,6 +2824,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1305::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1306/Generated1306.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1306/Generated1306.il index c941bd8a64ef9a..1ede1d893046d4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1306/Generated1306.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1306/Generated1306.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1306 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3784,6 +3785,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1306::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1307/Generated1307.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1307/Generated1307.il index caa5a591955e08..02448ad541f054 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1307/Generated1307.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1307/Generated1307.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1307 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3834,6 +3835,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1307::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1308/Generated1308.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1308/Generated1308.il index 1f2fd4e3bf8ea7..c173b0e841d562 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1308/Generated1308.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1308/Generated1308.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1308 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3791,6 +3792,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1308::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1309/Generated1309.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1309/Generated1309.il index 64fbf5878fc38d..ea8dec93867e5a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1309/Generated1309.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1309/Generated1309.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1309 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4426,6 +4427,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1309::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest131/Generated131.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest131/Generated131.il index 9cae7d62e0ee5f..73aa5335c4d920 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest131/Generated131.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest131/Generated131.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated131 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -667,6 +668,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated131::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1310/Generated1310.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1310/Generated1310.il index 470c2bf67cc232..831d791a9cd183 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1310/Generated1310.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1310/Generated1310.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1310 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4188,6 +4189,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1310::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1311/Generated1311.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1311/Generated1311.il index 7e0da647a3928a..8634f9dbab4305 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1311/Generated1311.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1311/Generated1311.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1311 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4055,6 +4056,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1311::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1312/Generated1312.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1312/Generated1312.il index ec63643823693b..65f95b96977162 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1312/Generated1312.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1312/Generated1312.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1312 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5153,6 +5154,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1312::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1313/Generated1313.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1313/Generated1313.il index 629378f1d5078b..65e6abb3e36f60 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1313/Generated1313.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1313/Generated1313.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1313 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5177,6 +5178,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1313::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1314/Generated1314.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1314/Generated1314.il index e1d32ad2835504..170c4416b13a75 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1314/Generated1314.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1314/Generated1314.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1314 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3943,6 +3944,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1314::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1315/Generated1315.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1315/Generated1315.il index df27fbdf9f5341..668c6f0022cd5b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1315/Generated1315.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1315/Generated1315.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1315 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2625,6 +2626,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1315::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1316/Generated1316.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1316/Generated1316.il index 76e962b8f43f76..819dbf6f20411a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1316/Generated1316.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1316/Generated1316.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1316 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5576,6 +5577,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1316::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1317/Generated1317.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1317/Generated1317.il index c0e867b88da435..79f7914cf66886 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1317/Generated1317.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1317/Generated1317.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1317 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5681,6 +5682,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1317::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1318/Generated1318.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1318/Generated1318.il index f75a6868bd4d28..70faf2ff00fe5c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1318/Generated1318.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1318/Generated1318.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1318 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4742,6 +4743,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1318::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1319/Generated1319.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1319/Generated1319.il index 1ca64a7705b71c..5d7193df47886b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1319/Generated1319.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1319/Generated1319.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1319 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4716,6 +4717,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1319::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest132/Generated132.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest132/Generated132.il index aa9196735311fc..86b8003a53b569 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest132/Generated132.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest132/Generated132.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated132 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -649,6 +650,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated132::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1320/Generated1320.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1320/Generated1320.il index 3b1c16744d1065..9bf693ec6fb007 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1320/Generated1320.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1320/Generated1320.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1320 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4330,6 +4331,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1320::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1321/Generated1321.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1321/Generated1321.il index bc97b38b8347d5..de7dc1a2fd9de0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1321/Generated1321.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1321/Generated1321.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1321 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3495,6 +3496,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1321::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1322/Generated1322.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1322/Generated1322.il index 2650e09cc4d497..dd10674cbc928b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1322/Generated1322.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1322/Generated1322.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1322 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3523,6 +3524,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1322::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1323/Generated1323.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1323/Generated1323.il index 322ceeb74ceeb4..0e555286ae8a0a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1323/Generated1323.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1323/Generated1323.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1323 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3362,6 +3363,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1323::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1324/Generated1324.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1324/Generated1324.il index 6634228123e561..0cba334479f9c2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1324/Generated1324.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1324/Generated1324.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1324 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5751,6 +5752,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1324::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1325/Generated1325.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1325/Generated1325.il index 8f3e005ce49d7b..a71891f683cf9b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1325/Generated1325.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1325/Generated1325.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1325 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5614,6 +5615,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1325::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1326/Generated1326.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1326/Generated1326.il index cce6ae6626ec65..50aa4d9fabff6b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1326/Generated1326.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1326/Generated1326.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1326 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4977,6 +4978,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1326::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1327/Generated1327.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1327/Generated1327.il index a86276d1fe4b2f..3d9a50a722b707 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1327/Generated1327.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1327/Generated1327.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1327 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3357,6 +3358,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1327::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1328/Generated1328.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1328/Generated1328.il index 0bc0f04d0b244d..bc55189ccf149a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1328/Generated1328.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1328/Generated1328.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1328 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3415,6 +3416,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1328::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1329/Generated1329.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1329/Generated1329.il index 340c7ea6a4f2d1..d66b537057deff 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1329/Generated1329.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1329/Generated1329.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1329 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3430,6 +3431,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1329::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest133/Generated133.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest133/Generated133.il index 2323d08e8a6185..f5d4210e616254 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest133/Generated133.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest133/Generated133.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated133 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -726,6 +727,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated133::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1330/Generated1330.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1330/Generated1330.il index 60e1253ee29fc6..e8156627371384 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1330/Generated1330.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1330/Generated1330.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1330 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5099,6 +5100,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1330::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1331/Generated1331.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1331/Generated1331.il index 6eab7f1827a38b..b118d7f55d3eb5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1331/Generated1331.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1331/Generated1331.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1331 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4798,6 +4799,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1331::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1332/Generated1332.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1332/Generated1332.il index 2eb70d2be934db..4c833555770718 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1332/Generated1332.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1332/Generated1332.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1332 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4924,6 +4925,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1332::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1333/Generated1333.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1333/Generated1333.il index 70a02c21f4dcf3..34e729e74b7ce2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1333/Generated1333.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1333/Generated1333.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1333 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4801,6 +4802,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1333::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1334/Generated1334.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1334/Generated1334.il index 6a44d2af0296d7..dd4fffe7869698 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1334/Generated1334.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1334/Generated1334.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1334 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4839,6 +4840,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1334::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1335/Generated1335.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1335/Generated1335.il index dbe427b3420fbe..c769e026c7718d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1335/Generated1335.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1335/Generated1335.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1335 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5053,6 +5054,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1335::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1336/Generated1336.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1336/Generated1336.il index e22768c206adc7..3622c233ff979f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1336/Generated1336.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1336/Generated1336.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1336 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5070,6 +5071,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1336::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1337/Generated1337.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1337/Generated1337.il index bc2eee82358374..9a15d5987d86ae 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1337/Generated1337.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1337/Generated1337.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1337 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4912,6 +4913,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1337::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1338/Generated1338.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1338/Generated1338.il index 9e09d4fe915beb..be2141d4d86619 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1338/Generated1338.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1338/Generated1338.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1338 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4739,6 +4740,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1338::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1339/Generated1339.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1339/Generated1339.il index 5a6b29ee011609..217e6aeb9f1ed6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1339/Generated1339.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1339/Generated1339.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1339 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4949,6 +4950,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1339::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest134/Generated134.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest134/Generated134.il index b354fdc93b68a2..98cb101704c4ff 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest134/Generated134.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest134/Generated134.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated134 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -550,6 +551,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated134::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1340/Generated1340.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1340/Generated1340.il index a6719ba729ca7f..5ab8f2fcabe0ba 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1340/Generated1340.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1340/Generated1340.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1340 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5036,6 +5037,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1340::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1341/Generated1341.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1341/Generated1341.il index 2d8d76f1fd247b..faae7feb6d740a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1341/Generated1341.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1341/Generated1341.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1341 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4970,6 +4971,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1341::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1342/Generated1342.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1342/Generated1342.il index c3d14e819b5c05..983d116337b6f5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1342/Generated1342.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1342/Generated1342.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1342 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3499,6 +3500,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1342::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1343/Generated1343.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1343/Generated1343.il index b110f8b01278ef..2637cbed59cc35 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1343/Generated1343.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1343/Generated1343.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1343 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3782,6 +3783,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1343::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1344/Generated1344.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1344/Generated1344.il index 7bd0ebe01cb064..9a3ca4cb9e8f25 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1344/Generated1344.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1344/Generated1344.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1344 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3662,6 +3663,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1344::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1345/Generated1345.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1345/Generated1345.il index 6d2665ff128161..39196d48920472 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1345/Generated1345.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1345/Generated1345.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1345 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5113,6 +5114,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1345::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1346/Generated1346.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1346/Generated1346.il index e07d5537e8ab9a..053ab8bdbb330e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1346/Generated1346.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1346/Generated1346.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1346 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5088,6 +5089,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1346::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1347/Generated1347.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1347/Generated1347.il index 56499cf589dd8e..2c766dcdaa63b4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1347/Generated1347.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1347/Generated1347.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1347 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5000,6 +5001,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1347::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1348/Generated1348.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1348/Generated1348.il index 71eadd1e6e8330..43083e6b783d70 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1348/Generated1348.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1348/Generated1348.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1348 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5189,6 +5190,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1348::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1349/Generated1349.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1349/Generated1349.il index e087fcc52d9ec4..3eadcc9060401e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1349/Generated1349.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1349/Generated1349.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1349 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4405,6 +4406,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1349::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest135/Generated135.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest135/Generated135.il index c11a1b3a3a88b1..f7a3159a31e87e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest135/Generated135.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest135/Generated135.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated135 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -786,6 +787,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated135::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1350/Generated1350.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1350/Generated1350.il index 0daddfeffffda1..44ccc6223796c1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1350/Generated1350.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1350/Generated1350.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1350 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4173,6 +4174,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1350::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1351/Generated1351.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1351/Generated1351.il index a4f970899a02c0..641b597bc0ec81 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1351/Generated1351.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1351/Generated1351.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1351 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4356,6 +4357,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1351::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1352/Generated1352.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1352/Generated1352.il index a702e743a83cbb..9556697e7b02de 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1352/Generated1352.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1352/Generated1352.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1352 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4949,6 +4950,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1352::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1353/Generated1353.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1353/Generated1353.il index 2fabfd6684f3ef..a9c846f5f5e512 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1353/Generated1353.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1353/Generated1353.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1353 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5170,6 +5171,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1353::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1354/Generated1354.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1354/Generated1354.il index 78cbc506d2ab2b..83d929eb48cae1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1354/Generated1354.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1354/Generated1354.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1354 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5189,6 +5190,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1354::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1355/Generated1355.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1355/Generated1355.il index 514b91427cad86..0b06a021956d7b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1355/Generated1355.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1355/Generated1355.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1355 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5524,6 +5525,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1355::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1356/Generated1356.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1356/Generated1356.il index 7728c3e79fb74c..7e5b6a7f93951c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1356/Generated1356.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1356/Generated1356.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1356 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5300,6 +5301,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1356::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1357/Generated1357.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1357/Generated1357.il index 03f24dc002f634..cb3070774df56b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1357/Generated1357.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1357/Generated1357.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1357 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4635,6 +4636,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1357::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1358/Generated1358.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1358/Generated1358.il index db2774adecb6cf..922574adcf2ddb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1358/Generated1358.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1358/Generated1358.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1358 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4942,6 +4943,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1358::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1359/Generated1359.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1359/Generated1359.il index caf287d7354cb5..79c0b20ea62617 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1359/Generated1359.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1359/Generated1359.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1359 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3321,6 +3322,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1359::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest136/Generated136.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest136/Generated136.il index 81332697d15922..553802d5f8088e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest136/Generated136.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest136/Generated136.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated136 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -464,6 +465,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated136::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1360/Generated1360.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1360/Generated1360.il index e626e9806edb34..479bff03ed8d3b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1360/Generated1360.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1360/Generated1360.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1360 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3210,6 +3211,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1360::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1361/Generated1361.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1361/Generated1361.il index d4061294f850d6..c1ad6664770fac 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1361/Generated1361.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1361/Generated1361.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1361 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5564,6 +5565,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1361::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1362/Generated1362.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1362/Generated1362.il index ac8b03e4f81b9d..92b4b4c29220ef 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1362/Generated1362.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1362/Generated1362.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1362 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5596,6 +5597,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1362::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1363/Generated1363.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1363/Generated1363.il index 6e9c7b03da3482..7400e130ff658d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1363/Generated1363.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1363/Generated1363.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1363 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5953,6 +5954,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1363::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1364/Generated1364.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1364/Generated1364.il index ba9fe73a4ce99e..2c5a9c22cb4008 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1364/Generated1364.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1364/Generated1364.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1364 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5154,6 +5155,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1364::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1365/Generated1365.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1365/Generated1365.il index 43a20065f861c8..e1d57aa9c81714 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1365/Generated1365.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1365/Generated1365.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1365 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5128,6 +5129,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1365::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1366/Generated1366.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1366/Generated1366.il index 1b1b710d196e28..d2238ffd5ec222 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1366/Generated1366.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1366/Generated1366.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1366 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5139,6 +5140,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1366::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1367/Generated1367.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1367/Generated1367.il index 0f713d92c04643..bfca02844ad788 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1367/Generated1367.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1367/Generated1367.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1367 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5349,6 +5350,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1367::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1368/Generated1368.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1368/Generated1368.il index 402782831c722c..7a169f7863ad4b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1368/Generated1368.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1368/Generated1368.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1368 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3471,6 +3472,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1368::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1369/Generated1369.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1369/Generated1369.il index d834269c9c0111..a59a9f3a691a38 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1369/Generated1369.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1369/Generated1369.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1369 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3429,6 +3430,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1369::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest137/Generated137.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest137/Generated137.il index 248ba5d003e605..cd2f8140dd5ef4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest137/Generated137.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest137/Generated137.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated137 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -447,6 +448,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated137::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1370/Generated1370.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1370/Generated1370.il index c0cb4708156558..7d7ee471503818 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1370/Generated1370.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1370/Generated1370.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1370 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5018,6 +5019,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1370::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1371/Generated1371.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1371/Generated1371.il index 07c08c9338a748..81375315440b52 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1371/Generated1371.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1371/Generated1371.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1371 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4688,6 +4689,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1371::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1372/Generated1372.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1372/Generated1372.il index 810f6cc85c147f..dbbebdc7e0f244 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1372/Generated1372.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1372/Generated1372.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1372 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4606,6 +4607,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1372::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1373/Generated1373.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1373/Generated1373.il index 427e62530f9f0d..f3cad15c7f09f6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1373/Generated1373.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1373/Generated1373.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1373 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4124,6 +4125,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1373::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1374/Generated1374.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1374/Generated1374.il index a5281c2757b33c..5a74d5d26af93d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1374/Generated1374.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1374/Generated1374.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1374 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5380,6 +5381,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1374::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1375/Generated1375.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1375/Generated1375.il index c8649b85d3e914..1568560cfac3c5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1375/Generated1375.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1375/Generated1375.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1375 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5500,6 +5501,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1375::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1376/Generated1376.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1376/Generated1376.il index bbb4630ca8a836..b33569a059e91c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1376/Generated1376.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1376/Generated1376.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1376 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4694,6 +4695,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1376::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1377/Generated1377.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1377/Generated1377.il index b9f27c709e8dd9..9600dc9cb316d6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1377/Generated1377.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1377/Generated1377.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1377 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5259,6 +5260,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1377::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1378/Generated1378.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1378/Generated1378.il index 87f22a7ec146fa..f633fd5e4bbc69 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1378/Generated1378.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1378/Generated1378.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1378 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5015,6 +5016,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1378::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1379/Generated1379.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1379/Generated1379.il index 26c07f3fb9fa63..cae5432afc6b02 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1379/Generated1379.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1379/Generated1379.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1379 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4818,6 +4819,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1379::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest138/Generated138.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest138/Generated138.il index 906dd6678141bc..4b34380866bfbe 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest138/Generated138.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest138/Generated138.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated138 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -712,6 +713,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated138::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1380/Generated1380.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1380/Generated1380.il index bdb5eabb234741..3bcd71b295793e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1380/Generated1380.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1380/Generated1380.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1380 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4622,6 +4623,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1380::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1381/Generated1381.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1381/Generated1381.il index 627acd2ae89a00..2b30e30557ef0b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1381/Generated1381.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1381/Generated1381.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1381 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4635,6 +4636,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1381::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1382/Generated1382.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1382/Generated1382.il index 5f017634c03583..706a20121fc784 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1382/Generated1382.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1382/Generated1382.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1382 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4810,6 +4811,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1382::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1383/Generated1383.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1383/Generated1383.il index bae9580ee3e84f..87e09d671d1caa 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1383/Generated1383.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1383/Generated1383.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1383 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4894,6 +4895,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1383::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1384/Generated1384.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1384/Generated1384.il index 905a6846ee8005..6871b7425a1dd6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1384/Generated1384.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1384/Generated1384.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1384 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6030,6 +6031,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1384::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1385/Generated1385.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1385/Generated1385.il index fc573f2cf51c30..fdbc4e8ed71424 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1385/Generated1385.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1385/Generated1385.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1385 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5002,6 +5003,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1385::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1386/Generated1386.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1386/Generated1386.il index c59215a4afd44b..7514193deebad7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1386/Generated1386.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1386/Generated1386.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1386 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4970,6 +4971,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1386::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1387/Generated1387.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1387/Generated1387.il index 9f15141ed7efdb..26735533c96a1f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1387/Generated1387.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1387/Generated1387.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1387 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5080,6 +5081,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1387::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1388/Generated1388.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1388/Generated1388.il index 87a34d3f39de0f..c1c9edbe92e9ea 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1388/Generated1388.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1388/Generated1388.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1388 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5018,6 +5019,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1388::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1389/Generated1389.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1389/Generated1389.il index 4e00ab98f611a6..be977b18d0b471 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1389/Generated1389.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1389/Generated1389.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1389 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4704,6 +4705,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1389::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest139/Generated139.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest139/Generated139.il index 3df5ec82ce2f96..aff1a237602bc7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest139/Generated139.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest139/Generated139.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated139 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -720,6 +721,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated139::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1390/Generated1390.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1390/Generated1390.il index 410ecf23e154b9..3b521e7b348e3c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1390/Generated1390.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1390/Generated1390.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1390 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6016,6 +6017,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1390::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1391/Generated1391.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1391/Generated1391.il index f87ef28bfe0817..047ef0721d9a5e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1391/Generated1391.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1391/Generated1391.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1391 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4884,6 +4885,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1391::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1392/Generated1392.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1392/Generated1392.il index fd53a46574259c..9556b013c3905e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1392/Generated1392.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1392/Generated1392.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1392 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6150,6 +6151,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1392::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1393/Generated1393.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1393/Generated1393.il index ee8db7bdda4c9d..cf69405b8d311d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1393/Generated1393.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1393/Generated1393.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1393 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6186,6 +6187,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1393::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1394/Generated1394.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1394/Generated1394.il index a619d3eaffe9c5..33318b6a8ea6b5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1394/Generated1394.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1394/Generated1394.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1394 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6228,6 +6229,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1394::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1395/Generated1395.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1395/Generated1395.il index 28409348942278..5f233ab4b86e6f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1395/Generated1395.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1395/Generated1395.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1395 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4098,6 +4099,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1395::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1396/Generated1396.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1396/Generated1396.il index c07d409a48d139..43a6908d74ebec 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1396/Generated1396.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1396/Generated1396.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1396 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2011,6 +2012,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1396::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1397/Generated1397.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1397/Generated1397.il index 50a23ec0ded74b..87dca6eb377736 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1397/Generated1397.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1397/Generated1397.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1397 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2276,6 +2277,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1397::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1398/Generated1398.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1398/Generated1398.il index cd6bece873a663..ba4942474acfc9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1398/Generated1398.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1398/Generated1398.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1398 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2985,6 +2986,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1398::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1399/Generated1399.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1399/Generated1399.il index 62d1d8240f9fb1..832066fb95e008 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1399/Generated1399.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1399/Generated1399.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1399 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2901,6 +2902,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1399::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest14/Generated14.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest14/Generated14.il index b19be7cfca19d1..6465ebbcf5bcad 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest14/Generated14.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest14/Generated14.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated14 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1163,6 +1164,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated14::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest140/Generated140.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest140/Generated140.il index ffd489178e7791..818930161ed33e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest140/Generated140.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest140/Generated140.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated140 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -683,6 +684,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated140::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1400/Generated1400.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1400/Generated1400.il index 564917135f4ed3..c8acb28a0ba043 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1400/Generated1400.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1400/Generated1400.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1400 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2794,6 +2795,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1400::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1401/Generated1401.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1401/Generated1401.il index f05a0f9e5724cd..7358d4d7fc08a4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1401/Generated1401.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1401/Generated1401.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1401 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3312,6 +3313,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1401::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1402/Generated1402.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1402/Generated1402.il index 68d11cf7cc69d6..15fe728ce3db13 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1402/Generated1402.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1402/Generated1402.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1402 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2811,6 +2812,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1402::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1403/Generated1403.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1403/Generated1403.il index 470a0af905712e..7593348f8f1a76 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1403/Generated1403.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1403/Generated1403.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1403 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4213,6 +4214,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1403::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1404/Generated1404.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1404/Generated1404.il index 4b3a300c9dca54..e7d0a3556abd4d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1404/Generated1404.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1404/Generated1404.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1404 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4201,6 +4202,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1404::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1405/Generated1405.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1405/Generated1405.il index b6b21f4c0a3770..94622735064ef5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1405/Generated1405.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1405/Generated1405.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1405 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4280,6 +4281,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1405::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1406/Generated1406.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1406/Generated1406.il index 7c9ca217227718..8ee0251651323b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1406/Generated1406.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1406/Generated1406.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1406 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4184,6 +4185,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1406::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1407/Generated1407.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1407/Generated1407.il index ff15014a432998..11a015be69d9ec 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1407/Generated1407.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1407/Generated1407.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1407 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4262,6 +4263,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1407::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1408/Generated1408.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1408/Generated1408.il index 84e12ad20fb7b3..377ab305031ee5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1408/Generated1408.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1408/Generated1408.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1408 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2213,6 +2214,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1408::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1409/Generated1409.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1409/Generated1409.il index d46fc17520c27d..fa9ad1a2882481 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1409/Generated1409.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1409/Generated1409.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1409 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2341,6 +2342,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1409::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest141/Generated141.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest141/Generated141.il index 2598f49d230eda..408869e6f7796c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest141/Generated141.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest141/Generated141.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated141 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -486,6 +487,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated141::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1410/Generated1410.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1410/Generated1410.il index 546a68adef9281..2e5bcc2b5c59e3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1410/Generated1410.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1410/Generated1410.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1410 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3720,6 +3721,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1410::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1411/Generated1411.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1411/Generated1411.il index c9da57e9d43312..0dd958e380dcad 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1411/Generated1411.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1411/Generated1411.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1411 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3698,6 +3699,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1411::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1412/Generated1412.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1412/Generated1412.il index 8bdefb212f93f5..7dad91d3ade523 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1412/Generated1412.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1412/Generated1412.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1412 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3708,6 +3709,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1412::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1413/Generated1413.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1413/Generated1413.il index 4cba0c09569f6e..d9c877e467b824 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1413/Generated1413.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1413/Generated1413.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1413 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3936,6 +3937,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1413::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1414/Generated1414.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1414/Generated1414.il index c6831adca0ec1d..1a4cf0bf7ed12f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1414/Generated1414.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1414/Generated1414.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1414 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2126,6 +2127,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1414::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1415/Generated1415.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1415/Generated1415.il index 2d070c2e75c977..899a7b85f148c1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1415/Generated1415.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1415/Generated1415.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1415 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2117,6 +2118,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1415::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1416/Generated1416.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1416/Generated1416.il index d4690116a59dd6..1570bd62b12500 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1416/Generated1416.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1416/Generated1416.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1416 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2072,6 +2073,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1416::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1417/Generated1417.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1417/Generated1417.il index f107558a502a95..32766b497b0c01 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1417/Generated1417.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1417/Generated1417.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1417 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1922,6 +1923,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1417::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1418/Generated1418.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1418/Generated1418.il index a05d44b2614f28..2675449eb8e4de 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1418/Generated1418.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1418/Generated1418.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1418 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1981,6 +1982,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1418::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1419/Generated1419.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1419/Generated1419.il index e05fea787d0a9f..c6ea2610b880ed 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1419/Generated1419.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1419/Generated1419.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1419 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3096,6 +3097,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1419::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest142/Generated142.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest142/Generated142.il index 4afa3f5bf8b00a..57bd7357d7d31e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest142/Generated142.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest142/Generated142.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated142 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -550,6 +551,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated142::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1420/Generated1420.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1420/Generated1420.il index cc6d07924be9d5..9cb28af6712307 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1420/Generated1420.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1420/Generated1420.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1420 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3254,6 +3255,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1420::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1421/Generated1421.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1421/Generated1421.il index da20384f9f243c..698b4d214dbd6a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1421/Generated1421.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1421/Generated1421.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1421 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3066,6 +3067,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1421::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1422/Generated1422.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1422/Generated1422.il index e93644cf0a6a06..9306d4a47a359c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1422/Generated1422.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1422/Generated1422.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1422 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3138,6 +3139,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1422::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1423/Generated1423.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1423/Generated1423.il index 7544664f31ba5e..5c414ddb618ed6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1423/Generated1423.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1423/Generated1423.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1423 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4243,6 +4244,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1423::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1424/Generated1424.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1424/Generated1424.il index 802f7e422c3899..ae795cfbc177d2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1424/Generated1424.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1424/Generated1424.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1424 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4023,6 +4024,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1424::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1425/Generated1425.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1425/Generated1425.il index ca19e30be2e6b4..7caf12eaff27e6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1425/Generated1425.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1425/Generated1425.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1425 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3215,6 +3216,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1425::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1426/Generated1426.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1426/Generated1426.il index dad4e05f3bb973..17af88917f42b4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1426/Generated1426.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1426/Generated1426.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1426 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3309,6 +3310,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1426::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1427/Generated1427.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1427/Generated1427.il index 2904cddc7cfb7e..4026138bb14fa8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1427/Generated1427.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1427/Generated1427.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1427 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3674,6 +3675,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1427::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1428/Generated1428.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1428/Generated1428.il index 39e4d7b465663f..a0f808b2bba851 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1428/Generated1428.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1428/Generated1428.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1428 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2641,6 +2642,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1428::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1429/Generated1429.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1429/Generated1429.il index 87235b7b5f75ff..fcfba68eccba39 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1429/Generated1429.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1429/Generated1429.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1429 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2749,6 +2750,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1429::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest143/Generated143.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest143/Generated143.il index 9355963ab1d2f2..9aea9b6df43da8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest143/Generated143.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest143/Generated143.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated143 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -677,6 +678,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated143::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1430/Generated1430.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1430/Generated1430.il index fb60f753b44233..7cac4fb9337691 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1430/Generated1430.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1430/Generated1430.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1430 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4419,6 +4420,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1430::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1431/Generated1431.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1431/Generated1431.il index f345c4e42715af..be38df7acb92a7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1431/Generated1431.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1431/Generated1431.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1431 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3277,6 +3278,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1431::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1432/Generated1432.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1432/Generated1432.il index 2bc9acca3fa37f..9be082f70b2c94 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1432/Generated1432.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1432/Generated1432.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1432 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2086,6 +2087,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1432::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1433/Generated1433.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1433/Generated1433.il index 573028d5eb00bc..51e3b9d492a9a0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1433/Generated1433.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1433/Generated1433.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1433 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2019,6 +2020,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1433::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1434/Generated1434.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1434/Generated1434.il index 75d06d990cb8fc..4e089f12e83614 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1434/Generated1434.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1434/Generated1434.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1434 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2572,6 +2573,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1434::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1435/Generated1435.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1435/Generated1435.il index b3e676fa2e6ef6..bb1a87576632a6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1435/Generated1435.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1435/Generated1435.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1435 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3268,6 +3269,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1435::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1436/Generated1436.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1436/Generated1436.il index df8ba93fb1153a..f957fbae1451e8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1436/Generated1436.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1436/Generated1436.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1436 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3268,6 +3269,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1436::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1437/Generated1437.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1437/Generated1437.il index d9cfe4c67dcf51..8a2ee87e3b98c8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1437/Generated1437.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1437/Generated1437.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1437 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3930,6 +3931,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1437::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1438/Generated1438.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1438/Generated1438.il index 766798f6111ab7..dde2492a4b9d4a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1438/Generated1438.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1438/Generated1438.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1438 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3549,6 +3550,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1438::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1439/Generated1439.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1439/Generated1439.il index e163c931b479a7..fcd1297d5dffd0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1439/Generated1439.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1439/Generated1439.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1439 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3599,6 +3600,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1439::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest144/Generated144.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest144/Generated144.il index 0f1de192e998f0..10440749536f85 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest144/Generated144.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest144/Generated144.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated144 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -512,6 +513,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated144::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1440/Generated1440.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1440/Generated1440.il index bd504af0343547..6d227bcd2f4431 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1440/Generated1440.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1440/Generated1440.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1440 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3593,6 +3594,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1440::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1441/Generated1441.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1441/Generated1441.il index c1f8f23086c154..8bdbef840c8107 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1441/Generated1441.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1441/Generated1441.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1441 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3532,6 +3533,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1441::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1442/Generated1442.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1442/Generated1442.il index 82a12494ee4e27..4279da2ec573d1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1442/Generated1442.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1442/Generated1442.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1442 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3468,6 +3469,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1442::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1443/Generated1443.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1443/Generated1443.il index adf5cd7a869733..91d3cb3d3f7dd2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1443/Generated1443.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1443/Generated1443.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1443 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3565,6 +3566,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1443::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1444/Generated1444.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1444/Generated1444.il index c03f3c0c43666a..f389010093d5ef 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1444/Generated1444.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1444/Generated1444.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1444 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3638,6 +3639,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1444::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1445/Generated1445.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1445/Generated1445.il index 3fb476a4a747a8..763f56adad7258 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1445/Generated1445.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1445/Generated1445.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1445 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3439,6 +3440,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1445::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1446/Generated1446.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1446/Generated1446.il index 064e5784116816..b6b2ba56946c62 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1446/Generated1446.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1446/Generated1446.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1446 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3048,6 +3049,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1446::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1447/Generated1447.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1447/Generated1447.il index b4ae2aa66ac86c..190d439445c177 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1447/Generated1447.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1447/Generated1447.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1447 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3274,6 +3275,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1447::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1448/Generated1448.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1448/Generated1448.il index 928f62528f4ca3..26f0f9f55aa598 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1448/Generated1448.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1448/Generated1448.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1448 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3230,6 +3231,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1448::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1449/Generated1449.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1449/Generated1449.il index 06bf929001e829..716aacccd85cec 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1449/Generated1449.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1449/Generated1449.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1449 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2893,6 +2894,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1449::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest145/Generated145.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest145/Generated145.il index 27a701f03d285d..03bc86deb8124f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest145/Generated145.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest145/Generated145.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated145 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -512,6 +513,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated145::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1450/Generated1450.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1450/Generated1450.il index 911b0c6181e411..06f5c49bca7dea 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1450/Generated1450.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1450/Generated1450.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1450 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3603,6 +3604,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1450::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1451/Generated1451.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1451/Generated1451.il index 86a231dd54f829..97d1ad3a28554a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1451/Generated1451.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1451/Generated1451.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1451 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3580,6 +3581,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1451::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1452/Generated1452.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1452/Generated1452.il index 732626b52e91cc..63c2076f3c16d2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1452/Generated1452.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1452/Generated1452.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1452 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2686,6 +2687,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1452::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1453/Generated1453.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1453/Generated1453.il index 046273c6f5a893..adc50f6dcd12ce 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1453/Generated1453.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1453/Generated1453.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1453 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3350,6 +3351,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1453::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1454/Generated1454.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1454/Generated1454.il index 57b9fd5156a860..b5e49405002e1c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1454/Generated1454.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1454/Generated1454.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1454 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3447,6 +3448,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1454::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1455/Generated1455.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1455/Generated1455.il index a33834141b4ae2..04b7c85845c004 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1455/Generated1455.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1455/Generated1455.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1455 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3323,6 +3324,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1455::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1456/Generated1456.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1456/Generated1456.il index ed397efdd13e78..c7fc127ae47a22 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1456/Generated1456.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1456/Generated1456.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1456 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3318,6 +3319,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1456::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1457/Generated1457.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1457/Generated1457.il index 741853f7d58957..10844dbf8c91f3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1457/Generated1457.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1457/Generated1457.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1457 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3556,6 +3557,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1457::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1458/Generated1458.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1458/Generated1458.il index 990e964c8e76c3..8b5bcd6a51b1b4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1458/Generated1458.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1458/Generated1458.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1458 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3565,6 +3566,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1458::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1459/Generated1459.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1459/Generated1459.il index 1aec0ad828e423..c06942e1e6331c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1459/Generated1459.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1459/Generated1459.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1459 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3374,6 +3375,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1459::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest146/Generated146.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest146/Generated146.il index 69f07df67905bc..bed59451ca9724 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest146/Generated146.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest146/Generated146.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated146 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -502,6 +503,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated146::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1460/Generated1460.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1460/Generated1460.il index afb0c183cd75d8..524f1c2de2b7ea 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1460/Generated1460.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1460/Generated1460.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1460 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3097,6 +3098,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1460::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1461/Generated1461.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1461/Generated1461.il index 0d2f5aa30a9639..e0f53ea0c8d0f5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1461/Generated1461.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1461/Generated1461.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1461 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2914,6 +2915,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1461::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1462/Generated1462.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1462/Generated1462.il index a822db29ea8882..27c39f3bf4d205 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1462/Generated1462.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1462/Generated1462.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1462 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3061,6 +3062,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1462::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1463/Generated1463.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1463/Generated1463.il index afef93ec1507b8..88c3b5c7c8dc92 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1463/Generated1463.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1463/Generated1463.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1463 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2939,6 +2940,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1463::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1464/Generated1464.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1464/Generated1464.il index dd26863fb5de29..4fc10e0fd1e505 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1464/Generated1464.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1464/Generated1464.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1464 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3258,6 +3259,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1464::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1465/Generated1465.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1465/Generated1465.il index c8a0a9260a6e5d..8160fe4e27963d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1465/Generated1465.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1465/Generated1465.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1465 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3198,6 +3199,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1465::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1466/Generated1466.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1466/Generated1466.il index f66cd1586948eb..a9c707dfbeef2e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1466/Generated1466.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1466/Generated1466.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1466 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3088,6 +3089,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1466::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1467/Generated1467.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1467/Generated1467.il index b67c753e27dfa4..2b1726cb43603f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1467/Generated1467.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1467/Generated1467.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1467 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3307,6 +3308,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1467::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1468/Generated1468.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1468/Generated1468.il index a7351cefd435a2..21c4932575d9c2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1468/Generated1468.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1468/Generated1468.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1468 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3234,6 +3235,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1468::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1469/Generated1469.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1469/Generated1469.il index 84d144979c51d3..81b0a34206544b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1469/Generated1469.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1469/Generated1469.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1469 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3234,6 +3235,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1469::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest147/Generated147.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest147/Generated147.il index 4d97fddb8f6523..eb63cfa47b6cff 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest147/Generated147.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest147/Generated147.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated147 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -609,6 +610,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated147::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1470/Generated1470.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1470/Generated1470.il index 326b6068bd15d1..aab2a22af9a337 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1470/Generated1470.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1470/Generated1470.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1470 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3216,6 +3217,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1470::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1471/Generated1471.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1471/Generated1471.il index 7d0c69ccf2f778..6e654fdf9dacfa 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1471/Generated1471.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1471/Generated1471.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1471 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3238,6 +3239,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1471::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1472/Generated1472.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1472/Generated1472.il index 55f4adfa1bc6d1..4062cadbf7c84e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1472/Generated1472.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1472/Generated1472.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1472 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3150,6 +3151,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1472::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1473/Generated1473.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1473/Generated1473.il index 3f6632973a88bd..85e9f70a950b5d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1473/Generated1473.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1473/Generated1473.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1473 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2841,6 +2842,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1473::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1474/Generated1474.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1474/Generated1474.il index 94460b06205f98..30db8a84591e56 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1474/Generated1474.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1474/Generated1474.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1474 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1959,6 +1960,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1474::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1475/Generated1475.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1475/Generated1475.il index 75981adf684dc8..fd489c9303fd25 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1475/Generated1475.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1475/Generated1475.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1475 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2004,6 +2005,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1475::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1476/Generated1476.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1476/Generated1476.il index 6dc91b09045a34..d285cf1429646e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1476/Generated1476.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1476/Generated1476.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1476 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1990,6 +1991,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1476::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1477/Generated1477.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1477/Generated1477.il index cbd4bbc46ef84a..a82795ee57531b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1477/Generated1477.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1477/Generated1477.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1477 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2013,6 +2014,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1477::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1478/Generated1478.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1478/Generated1478.il index a2f86e997a9e60..b5e166ce0b9ebc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1478/Generated1478.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1478/Generated1478.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1478 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2288,6 +2289,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1478::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1479/Generated1479.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1479/Generated1479.il index e45f0038ab081b..fba22fc9d511d1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1479/Generated1479.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1479/Generated1479.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1479 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2600,6 +2601,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1479::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest148/Generated148.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest148/Generated148.il index d22c159fd2c414..71399410c6e73d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest148/Generated148.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest148/Generated148.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated148 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -486,6 +487,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated148::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1480/Generated1480.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1480/Generated1480.il index 2052b2303753ef..a72577a6a34c9d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1480/Generated1480.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1480/Generated1480.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1480 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2164,6 +2165,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1480::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1481/Generated1481.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1481/Generated1481.il index e5c98825a23274..a9273180fb436d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1481/Generated1481.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1481/Generated1481.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1481 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2152,6 +2153,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1481::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1482/Generated1482.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1482/Generated1482.il index 41cf29c928ae66..063c99f429e932 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1482/Generated1482.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1482/Generated1482.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1482 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2291,6 +2292,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1482::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1483/Generated1483.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1483/Generated1483.il index 5448fc2b407ded..e4d5a5dee577c5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1483/Generated1483.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1483/Generated1483.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1483 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3791,6 +3792,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1483::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1484/Generated1484.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1484/Generated1484.il index 278fc1278893ff..b6bc13b3b0f3d0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1484/Generated1484.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1484/Generated1484.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1484 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2846,6 +2847,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1484::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1485/Generated1485.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1485/Generated1485.il index 8b02255d270c21..8a62710920bd7c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1485/Generated1485.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1485/Generated1485.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1485 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2787,6 +2788,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1485::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1486/Generated1486.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1486/Generated1486.il index 86a5fc44111271..e5aa8ed63da1cd 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1486/Generated1486.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1486/Generated1486.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1486 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3225,6 +3226,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1486::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1487/Generated1487.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1487/Generated1487.il index 698a00ec171be1..8b983f93d73590 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1487/Generated1487.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1487/Generated1487.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1487 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2981,6 +2982,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1487::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1488/Generated1488.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1488/Generated1488.il index 25b0112197b6ea..93f2b62f333180 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1488/Generated1488.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1488/Generated1488.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1488 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2010,6 +2011,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1488::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1489/Generated1489.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1489/Generated1489.il index 57455efb2abf5a..dc252823ecb020 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1489/Generated1489.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1489/Generated1489.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1489 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1958,6 +1959,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1489::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest149/Generated149.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest149/Generated149.il index 7aac458e744762..54901040bd7a65 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest149/Generated149.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest149/Generated149.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated149 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -504,6 +505,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated149::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1490/Generated1490.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1490/Generated1490.il index 764ced2af1ac2e..e8d83a0482e159 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1490/Generated1490.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1490/Generated1490.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1490 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1971,6 +1972,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1490::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1491/Generated1491.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1491/Generated1491.il index 97d304dc61601e..422f781b34251d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1491/Generated1491.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1491/Generated1491.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1491 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1898,6 +1899,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1491::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1492/Generated1492.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1492/Generated1492.il index 78e0a3a2a5eca8..c37e8ef2ca1bc9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1492/Generated1492.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1492/Generated1492.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1492 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3239,6 +3240,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1492::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1493/Generated1493.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1493/Generated1493.il index 0801357abde2ec..4378e73d5b97c9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1493/Generated1493.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1493/Generated1493.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1493 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3135,6 +3136,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1493::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1494/Generated1494.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1494/Generated1494.il index f96754b80ae676..cc47c608024f09 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1494/Generated1494.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1494/Generated1494.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1494 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3984,6 +3985,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1494::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1495/Generated1495.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1495/Generated1495.il index 9382e938d1ec36..5a586cc129ba05 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1495/Generated1495.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1495/Generated1495.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1495 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4223,6 +4224,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1495::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1496/Generated1496.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1496/Generated1496.il index f7ed9d5af8b764..767df9572e3156 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1496/Generated1496.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1496/Generated1496.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1496 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3036,6 +3037,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1496::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1497/Generated1497.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1497/Generated1497.il index c0641bed987e53..4dbf026eac4a72 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1497/Generated1497.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1497/Generated1497.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1497 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3704,6 +3705,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1497::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1498/Generated1498.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1498/Generated1498.il index 68246a225211bf..73b1d227b8d537 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1498/Generated1498.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1498/Generated1498.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1498 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2712,6 +2713,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1498::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1499/Generated1499.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1499/Generated1499.il index f731cc34c378dd..1403a4766904b3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1499/Generated1499.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1499/Generated1499.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1499 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4455,6 +4456,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1499::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest15/Generated15.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest15/Generated15.il index 8248639197c722..b5ae99b4b6667d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest15/Generated15.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest15/Generated15.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated15 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1239,6 +1240,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated15::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest150/Generated150.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest150/Generated150.il index 68874be0bf5eea..da72ec01ccf933 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest150/Generated150.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest150/Generated150.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated150 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -670,6 +671,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated150::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1500/Generated1500.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1500/Generated1500.il index 753fc67c7e7ad1..da2217a74d7d8e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1500/Generated1500.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1500/Generated1500.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated1500 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3011,6 +3012,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated1500::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest151/Generated151.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest151/Generated151.il index b77af72fc10b8d..dcd3338b358718 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest151/Generated151.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest151/Generated151.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated151 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -741,6 +742,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated151::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest152/Generated152.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest152/Generated152.il index 8b4b4b8e578af5..10597219ade894 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest152/Generated152.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest152/Generated152.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated152 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -725,6 +726,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated152::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest153/Generated153.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest153/Generated153.il index ff0b42150fd426..79309bf0d35d10 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest153/Generated153.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest153/Generated153.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated153 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -527,6 +528,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated153::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest154/Generated154.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest154/Generated154.il index 5d38d96efd146b..8ad9b6a16498ed 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest154/Generated154.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest154/Generated154.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated154 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -691,6 +692,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated154::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest155/Generated155.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest155/Generated155.il index 994ee9b9686aad..1fb3bd65188317 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest155/Generated155.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest155/Generated155.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated155 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -500,6 +501,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated155::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest156/Generated156.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest156/Generated156.il index b2d9bc44b881c0..76f151f704e7a8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest156/Generated156.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest156/Generated156.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated156 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -561,6 +562,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated156::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest157/Generated157.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest157/Generated157.il index 29764c3e8afd80..ae3fa09384949a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest157/Generated157.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest157/Generated157.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated157 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -709,6 +710,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated157::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest158/Generated158.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest158/Generated158.il index b6b8298928ba4c..5a6dd8c8d36bcf 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest158/Generated158.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest158/Generated158.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated158 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -492,6 +493,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated158::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest159/Generated159.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest159/Generated159.il index bf4be81f72089c..55b2e33b89efd3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest159/Generated159.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest159/Generated159.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated159 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -532,6 +533,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated159::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest16/Generated16.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest16/Generated16.il index 5c9c833584453c..8c58a5bd7078bc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest16/Generated16.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest16/Generated16.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated16 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1058,6 +1059,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated16::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest160/Generated160.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest160/Generated160.il index 6bfed094afba24..fc56824d953944 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest160/Generated160.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest160/Generated160.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated160 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -673,6 +674,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated160::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest161/Generated161.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest161/Generated161.il index 14746412412432..efd35bb7c5cd19 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest161/Generated161.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest161/Generated161.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated161 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -464,6 +465,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated161::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest162/Generated162.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest162/Generated162.il index 41a648b9ad72be..e9013174be3266 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest162/Generated162.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest162/Generated162.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated162 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -447,6 +448,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated162::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest163/Generated163.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest163/Generated163.il index c7a8663c3cee4f..aa52f9a9ad067f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest163/Generated163.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest163/Generated163.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated163 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -593,6 +594,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated163::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest164/Generated164.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest164/Generated164.il index 71a86092b0db08..741f880bd0a4a9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest164/Generated164.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest164/Generated164.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated164 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -454,6 +455,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated164::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest165/Generated165.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest165/Generated165.il index 97e54288d27baa..41f27f063df239 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest165/Generated165.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest165/Generated165.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated165 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -763,6 +764,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated165::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest166/Generated166.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest166/Generated166.il index 159c1af8f15a6f..96067c6ae9181f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest166/Generated166.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest166/Generated166.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated166 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -447,6 +448,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated166::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest167/Generated167.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest167/Generated167.il index 37d53c78245a83..89d82d7e13ab76 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest167/Generated167.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest167/Generated167.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated167 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -558,6 +559,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated167::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest168/Generated168.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest168/Generated168.il index 448507ddce7891..c78823e2c34e27 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest168/Generated168.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest168/Generated168.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated168 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -558,6 +559,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated168::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest169/Generated169.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest169/Generated169.il index 27fbd3eadc8275..482ab983e491c2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest169/Generated169.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest169/Generated169.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated169 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -510,6 +511,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated169::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest17/Generated17.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest17/Generated17.il index bc51a444d500e5..616180c075e059 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest17/Generated17.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest17/Generated17.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated17 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -935,6 +936,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated17::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest170/Generated170.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest170/Generated170.il index 0717cbb6270750..b006371f2a02c4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest170/Generated170.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest170/Generated170.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated170 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -380,6 +381,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated170::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest171/Generated171.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest171/Generated171.il index e193579952a51a..9d7991528e9060 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest171/Generated171.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest171/Generated171.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated171 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1247,6 +1248,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated171::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest172/Generated172.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest172/Generated172.il index cee47a82985c5f..f4b7c19665ec62 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest172/Generated172.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest172/Generated172.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated172 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1198,6 +1199,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated172::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest173/Generated173.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest173/Generated173.il index 6cfdd3380a8d96..f8f61f558dae93 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest173/Generated173.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest173/Generated173.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated173 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1335,6 +1336,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated173::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest174/Generated174.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest174/Generated174.il index 96505cb82af81c..59e7a981cea0e6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest174/Generated174.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest174/Generated174.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated174 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1239,6 +1240,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated174::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest175/Generated175.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest175/Generated175.il index 1178b410842bf7..4014cc3a7eaec8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest175/Generated175.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest175/Generated175.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated175 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1364,6 +1365,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated175::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest176/Generated176.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest176/Generated176.il index abc49384d3a33f..7ecefe52c679b2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest176/Generated176.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest176/Generated176.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated176 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -893,6 +894,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated176::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest177/Generated177.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest177/Generated177.il index 1a3bb1601987a2..7c53ffe9991436 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest177/Generated177.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest177/Generated177.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated177 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -902,6 +903,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated177::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest178/Generated178.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest178/Generated178.il index 6dbf78ab10169c..ac3b0eb483a456 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest178/Generated178.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest178/Generated178.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated178 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1015,6 +1016,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated178::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest179/Generated179.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest179/Generated179.il index 37ee300121b851..68b8f0237b800d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest179/Generated179.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest179/Generated179.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated179 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -765,6 +766,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated179::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest18/Generated18.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest18/Generated18.il index 186973f4f16648..eb2da122029f3a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest18/Generated18.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest18/Generated18.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated18 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -993,6 +994,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated18::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest180/Generated180.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest180/Generated180.il index d1f2fb1932ff51..28cee8045e46d6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest180/Generated180.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest180/Generated180.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated180 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1065,6 +1066,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated180::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest181/Generated181.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest181/Generated181.il index 1a2c8e633d775a..f243e00c96b4c6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest181/Generated181.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest181/Generated181.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated181 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -833,6 +834,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated181::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest182/Generated182.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest182/Generated182.il index 3ef0918d306f2a..224c0c7098e4e7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest182/Generated182.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest182/Generated182.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated182 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1199,6 +1200,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated182::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest183/Generated183.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest183/Generated183.il index f12b51e147457a..cb80a4bdfd60a1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest183/Generated183.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest183/Generated183.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated183 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1079,6 +1080,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated183::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest184/Generated184.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest184/Generated184.il index 48e7e0a0542661..ae411c62caf4c6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest184/Generated184.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest184/Generated184.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated184 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1199,6 +1200,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated184::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest185/Generated185.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest185/Generated185.il index bb0dd6d7cc1198..6b127d0d387fa0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest185/Generated185.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest185/Generated185.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated185 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -835,6 +836,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated185::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest186/Generated186.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest186/Generated186.il index dc4a68e912cbcc..5dbfdb68cef5cd 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest186/Generated186.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest186/Generated186.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated186 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1018,6 +1019,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated186::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest187/Generated187.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest187/Generated187.il index 41dc6f23a1bf70..7c761ab444ae09 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest187/Generated187.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest187/Generated187.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated187 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -992,6 +993,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated187::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest188/Generated188.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest188/Generated188.il index c79d6253e66737..c2557e551c40bc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest188/Generated188.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest188/Generated188.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated188 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1059,6 +1060,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated188::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest189/Generated189.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest189/Generated189.il index 40871fea68f7f7..926d8c7742b3e4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest189/Generated189.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest189/Generated189.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated189 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -775,6 +776,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated189::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest19/Generated19.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest19/Generated19.il index 473b7f6019d4d3..171bd16639e0e8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest19/Generated19.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest19/Generated19.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated19 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -975,6 +976,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated19::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest190/Generated190.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest190/Generated190.il index 61f54aebb2e2fb..0afd37c175496b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest190/Generated190.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest190/Generated190.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated190 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1052,6 +1053,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated190::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest191/Generated191.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest191/Generated191.il index e9421d4680ed51..7cfa2799152e9d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest191/Generated191.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest191/Generated191.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated191 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -893,6 +894,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated191::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest192/Generated192.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest192/Generated192.il index a7729169eb1323..870a5be4ac1890 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest192/Generated192.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest192/Generated192.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated192 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1910,6 +1911,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated192::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest193/Generated193.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest193/Generated193.il index 9b1e5ab267f089..6debde3e34a995 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest193/Generated193.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest193/Generated193.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated193 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2127,6 +2128,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated193::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest194/Generated194.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest194/Generated194.il index 7cd37f340f1bfa..fb3df31e5a78ac 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest194/Generated194.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest194/Generated194.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated194 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2081,6 +2082,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated194::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest195/Generated195.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest195/Generated195.il index a0d537c9d53bd1..9b570c9a1941f9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest195/Generated195.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest195/Generated195.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated195 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1966,6 +1967,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated195::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest196/Generated196.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest196/Generated196.il index 0013d482141f2b..1c43fa9de5b1ab 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest196/Generated196.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest196/Generated196.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated196 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1855,6 +1856,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated196::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest197/Generated197.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest197/Generated197.il index d790d075e98be0..c62b9737012adf 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest197/Generated197.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest197/Generated197.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated197 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1554,6 +1555,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated197::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest198/Generated198.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest198/Generated198.il index 619cc6d03c1f91..f0345ef0757fc7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest198/Generated198.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest198/Generated198.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated198 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1682,6 +1683,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated198::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest199/Generated199.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest199/Generated199.il index f24d2ff6b69c5c..0e13e6a1c81cdb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest199/Generated199.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest199/Generated199.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated199 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1737,6 +1738,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated199::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest2/Generated2.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest2/Generated2.il index d5b1668d1f3631..08993d05c551e4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest2/Generated2.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest2/Generated2.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated2 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -673,6 +674,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated2::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest20/Generated20.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest20/Generated20.il index f1d192a2e934e5..22e62117e56d3a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest20/Generated20.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest20/Generated20.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated20 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1145,6 +1146,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated20::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest200/Generated200.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest200/Generated200.il index 8175eb34da8b51..12b54d9ff6c183 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest200/Generated200.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest200/Generated200.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated200 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1972,6 +1973,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated200::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest201/Generated201.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest201/Generated201.il index d4cce180d7c8ef..9f6c841703f9c1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest201/Generated201.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest201/Generated201.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated201 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1690,6 +1691,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated201::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest202/Generated202.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest202/Generated202.il index a03d3a1d0642b6..be1a9fcd4f0e46 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest202/Generated202.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest202/Generated202.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated202 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1776,6 +1777,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated202::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest203/Generated203.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest203/Generated203.il index 153729155aab62..774b57edd5c968 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest203/Generated203.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest203/Generated203.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated203 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1916,6 +1917,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated203::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest204/Generated204.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest204/Generated204.il index 006fe01cf6c27b..0575da217b0086 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest204/Generated204.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest204/Generated204.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated204 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1846,6 +1847,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated204::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest205/Generated205.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest205/Generated205.il index 68bd106e57dff4..f10a00768b3535 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest205/Generated205.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest205/Generated205.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated205 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1677,6 +1678,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated205::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest206/Generated206.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest206/Generated206.il index 99239007220279..afe4c298ee8d33 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest206/Generated206.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest206/Generated206.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated206 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1615,6 +1616,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated206::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest207/Generated207.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest207/Generated207.il index 08aa3576bd083b..63ba83e77cb9b8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest207/Generated207.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest207/Generated207.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated207 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1889,6 +1890,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated207::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest208/Generated208.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest208/Generated208.il index 75f60a7419d570..3c5d1e86245fe0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest208/Generated208.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest208/Generated208.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated208 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1791,6 +1792,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated208::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest209/Generated209.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest209/Generated209.il index ab1e77747d23c8..f3c9d525dd6169 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest209/Generated209.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest209/Generated209.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated209 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1682,6 +1683,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated209::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest21/Generated21.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest21/Generated21.il index 1ecc0650d5278a..7a4c6778c9ca42 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest21/Generated21.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest21/Generated21.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated21 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1046,6 +1047,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated21::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest210/Generated210.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest210/Generated210.il index 010df4deafd284..f61c81d0c020e2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest210/Generated210.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest210/Generated210.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated210 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1764,6 +1765,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated210::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest211/Generated211.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest211/Generated211.il index c4fce7ce2bb1c4..c795a8511cf750 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest211/Generated211.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest211/Generated211.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated211 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1800,6 +1801,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated211::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest212/Generated212.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest212/Generated212.il index e372f8daef9f92..570715bfe423cd 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest212/Generated212.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest212/Generated212.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated212 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2040,6 +2041,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated212::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest213/Generated213.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest213/Generated213.il index 52261bef79c8ad..587990e3880eca 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest213/Generated213.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest213/Generated213.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated213 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2052,6 +2053,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated213::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest214/Generated214.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest214/Generated214.il index 236dc2d8ba7195..6ef00e098444ef 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest214/Generated214.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest214/Generated214.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated214 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2026,6 +2027,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated214::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest215/Generated215.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest215/Generated215.il index 448d67973b6f0b..d4856a27ccc37a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest215/Generated215.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest215/Generated215.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated215 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2026,6 +2027,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated215::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest216/Generated216.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest216/Generated216.il index b296df62c1be5f..3a661db2432c2a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest216/Generated216.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest216/Generated216.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated216 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1537,6 +1538,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated216::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest217/Generated217.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest217/Generated217.il index ec204ea26b2db3..9b61fe4e468ec1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest217/Generated217.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest217/Generated217.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated217 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -880,6 +881,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated217::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest218/Generated218.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest218/Generated218.il index 44242543afc643..2b779c0fb67ec7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest218/Generated218.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest218/Generated218.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated218 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -907,6 +908,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated218::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest219/Generated219.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest219/Generated219.il index 77ebc8bc52ae19..164da77496484a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest219/Generated219.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest219/Generated219.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated219 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1577,6 +1578,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated219::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest22/Generated22.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest22/Generated22.il index 379d482c0931c6..9e18c5f4ce9f24 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest22/Generated22.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest22/Generated22.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated22 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1040,6 +1041,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated22::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest220/Generated220.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest220/Generated220.il index 863ae2f6429794..43f06fab1119bc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest220/Generated220.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest220/Generated220.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated220 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -981,6 +982,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated220::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest221/Generated221.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest221/Generated221.il index 73f5d2a9c5f206..a3f340521bbe21 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest221/Generated221.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest221/Generated221.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated221 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -892,6 +893,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated221::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest222/Generated222.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest222/Generated222.il index 6ee4b47201d0b4..a5883c002c7fb9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest222/Generated222.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest222/Generated222.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated222 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -848,6 +849,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated222::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest223/Generated223.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest223/Generated223.il index bf71684d649e66..1aa3e81fdcfd46 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest223/Generated223.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest223/Generated223.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated223 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -875,6 +876,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated223::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest224/Generated224.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest224/Generated224.il index b2f478b1f49bf3..bcfb2927afef98 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest224/Generated224.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest224/Generated224.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated224 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -892,6 +893,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated224::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest225/Generated225.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest225/Generated225.il index 0ad7477fd84602..c767ef69ed0acc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest225/Generated225.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest225/Generated225.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated225 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1013,6 +1014,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated225::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest226/Generated226.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest226/Generated226.il index f6d66e84e6a820..331f33f034cae8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest226/Generated226.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest226/Generated226.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated226 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -998,6 +999,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated226::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest227/Generated227.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest227/Generated227.il index e994f10261df2e..1f9997e40d173f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest227/Generated227.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest227/Generated227.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated227 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -924,6 +925,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated227::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest228/Generated228.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest228/Generated228.il index 3a97596612cbe4..7646f29ba7af50 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest228/Generated228.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest228/Generated228.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated228 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1556,6 +1557,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated228::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest229/Generated229.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest229/Generated229.il index da82b343808adb..ec3e54e4a3669c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest229/Generated229.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest229/Generated229.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated229 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1440,6 +1441,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated229::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest23/Generated23.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest23/Generated23.il index 020bfca0f5ec3c..a465ce0f8de482 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest23/Generated23.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest23/Generated23.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated23 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1082,6 +1083,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated23::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest230/Generated230.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest230/Generated230.il index c00c1f27df81d8..31036ed98a8c71 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest230/Generated230.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest230/Generated230.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated230 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1568,6 +1569,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated230::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest231/Generated231.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest231/Generated231.il index 79a2151478e7d6..0df4cf47441feb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest231/Generated231.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest231/Generated231.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated231 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1443,6 +1444,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated231::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest232/Generated232.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest232/Generated232.il index 9e23521bcc09f3..3d26e660707d42 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest232/Generated232.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest232/Generated232.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated232 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1733,6 +1734,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated232::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest233/Generated233.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest233/Generated233.il index 9dfab63300422f..a8ce70dcb10eed 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest233/Generated233.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest233/Generated233.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated233 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1631,6 +1632,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated233::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest234/Generated234.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest234/Generated234.il index be4d15dfef6a84..f75abb80874326 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest234/Generated234.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest234/Generated234.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated234 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1812,6 +1813,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated234::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest235/Generated235.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest235/Generated235.il index 54f60444502a3a..20451712d6dc23 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest235/Generated235.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest235/Generated235.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated235 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1687,6 +1688,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated235::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest236/Generated236.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest236/Generated236.il index a0042acf37d329..000ee1e3b233a8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest236/Generated236.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest236/Generated236.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated236 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1742,6 +1743,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated236::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest237/Generated237.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest237/Generated237.il index 5da6d63055e487..7722b56fc3f2b9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest237/Generated237.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest237/Generated237.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated237 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1608,6 +1609,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated237::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest238/Generated238.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest238/Generated238.il index 848004bc2bd50d..8cb596800ccb98 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest238/Generated238.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest238/Generated238.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated238 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1611,6 +1612,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated238::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest239/Generated239.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest239/Generated239.il index 43708444ca9a4c..166c596fb15e18 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest239/Generated239.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest239/Generated239.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated239 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1730,6 +1731,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated239::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest24/Generated24.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest24/Generated24.il index 03974a99a761cd..aa05c9b7e0223c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest24/Generated24.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest24/Generated24.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated24 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -943,6 +944,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated24::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest240/Generated240.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest240/Generated240.il index a82afcccb2da5f..d823dcabbcc9e8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest240/Generated240.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest240/Generated240.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated240 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1737,6 +1738,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated240::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest241/Generated241.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest241/Generated241.il index cf761b81a3765e..2ae477420d0419 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest241/Generated241.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest241/Generated241.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated241 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1453,6 +1454,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated241::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest242/Generated242.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest242/Generated242.il index 1e51b6821ddacc..f41a4198f93df0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest242/Generated242.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest242/Generated242.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated242 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1790,6 +1791,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated242::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest243/Generated243.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest243/Generated243.il index 989b656fe2b428..593ca1da585ac8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest243/Generated243.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest243/Generated243.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated243 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1631,6 +1632,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated243::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest244/Generated244.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest244/Generated244.il index 75c4e9c050462c..b0659e65db9a64 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest244/Generated244.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest244/Generated244.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated244 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1838,6 +1839,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated244::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest245/Generated245.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest245/Generated245.il index d920fa0c2e57b4..f39e2039454c2b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest245/Generated245.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest245/Generated245.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated245 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1722,6 +1723,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated245::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest246/Generated246.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest246/Generated246.il index 4586cfb191f855..c9690bf85997a7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest246/Generated246.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest246/Generated246.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated246 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1730,6 +1731,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated246::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest247/Generated247.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest247/Generated247.il index 2a62415272886a..6ec2a234f88f82 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest247/Generated247.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest247/Generated247.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated247 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1835,6 +1836,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated247::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest248/Generated248.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest248/Generated248.il index 5530107bbd2f24..2072aa1ce66566 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest248/Generated248.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest248/Generated248.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated248 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2075,6 +2076,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated248::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest249/Generated249.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest249/Generated249.il index a495b9bab34a4c..03d6ac73fe12db 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest249/Generated249.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest249/Generated249.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated249 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1773,6 +1774,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated249::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest25/Generated25.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest25/Generated25.il index 89570b73fe1f76..8c3be3064d7ed6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest25/Generated25.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest25/Generated25.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated25 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -945,6 +946,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated25::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest250/Generated250.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest250/Generated250.il index 118c7bd6e574e5..d359d6c2619983 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest250/Generated250.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest250/Generated250.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated250 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2009,6 +2010,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated250::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest251/Generated251.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest251/Generated251.il index 96ef591171e20d..032f2795b48908 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest251/Generated251.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest251/Generated251.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated251 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1829,6 +1830,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated251::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest252/Generated252.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest252/Generated252.il index 5f3c175224080f..51433d2ca3875a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest252/Generated252.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest252/Generated252.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated252 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1889,6 +1890,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated252::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest253/Generated253.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest253/Generated253.il index 1a379a1de8f789..82081294d57fe7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest253/Generated253.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest253/Generated253.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated253 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1705,6 +1706,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated253::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest254/Generated254.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest254/Generated254.il index 4b551559893ce3..f611648ddcd671 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest254/Generated254.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest254/Generated254.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated254 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1823,6 +1824,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated254::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest255/Generated255.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest255/Generated255.il index 30681c5b89da22..9555dbef498efb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest255/Generated255.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest255/Generated255.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated255 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1937,6 +1938,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated255::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest256/Generated256.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest256/Generated256.il index 15eb1442509926..58598176503bdd 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest256/Generated256.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest256/Generated256.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated256 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1959,6 +1960,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated256::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest257/Generated257.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest257/Generated257.il index 8df269b5ed34d0..7f7e49d2014512 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest257/Generated257.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest257/Generated257.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated257 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1850,6 +1851,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated257::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest258/Generated258.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest258/Generated258.il index 9eea4c56a5aad7..ccabbb69eec3f1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest258/Generated258.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest258/Generated258.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated258 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1927,6 +1928,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated258::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest259/Generated259.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest259/Generated259.il index 328e5fa2648cd0..0ebf02b8f16cfe 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest259/Generated259.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest259/Generated259.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated259 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1843,6 +1844,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated259::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest26/Generated26.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest26/Generated26.il index 01103677bd856f..c3f4f177d8defa 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest26/Generated26.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest26/Generated26.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated26 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1074,6 +1075,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated26::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest260/Generated260.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest260/Generated260.il index fe607bc0bdf2d0..eff24601d49b5d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest260/Generated260.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest260/Generated260.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated260 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1862,6 +1863,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated260::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest261/Generated261.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest261/Generated261.il index 7d041ff50a2931..237e61688c7666 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest261/Generated261.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest261/Generated261.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated261 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1601,6 +1602,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated261::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest262/Generated262.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest262/Generated262.il index d5d3973f0f0dc7..17842983d8e798 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest262/Generated262.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest262/Generated262.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated262 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1679,6 +1680,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated262::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest263/Generated263.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest263/Generated263.il index 97d85f60abf987..aa75b6c3560e7a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest263/Generated263.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest263/Generated263.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated263 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1739,6 +1740,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated263::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest264/Generated264.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest264/Generated264.il index 931739fad94704..b307609ceb443d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest264/Generated264.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest264/Generated264.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated264 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1979,6 +1980,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated264::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest265/Generated265.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest265/Generated265.il index 67578f1785793f..157ed2167a95f5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest265/Generated265.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest265/Generated265.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated265 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1617,6 +1618,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated265::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest266/Generated266.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest266/Generated266.il index c358d92865d92f..903c33b20ba639 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest266/Generated266.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest266/Generated266.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated266 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1973,6 +1974,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated266::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest267/Generated267.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest267/Generated267.il index ecaf95b42fc656..6dbfb8dc235e99 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest267/Generated267.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest267/Generated267.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated267 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1843,6 +1844,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated267::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest268/Generated268.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest268/Generated268.il index 9b1ad0ebfd9de9..d893a83fe8d273 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest268/Generated268.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest268/Generated268.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated268 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1798,6 +1799,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated268::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest269/Generated269.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest269/Generated269.il index 192751262c5fca..fbe5a3fe76cea0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest269/Generated269.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest269/Generated269.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated269 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1679,6 +1680,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated269::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest27/Generated27.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest27/Generated27.il index 207cac649597e4..d58f7252dbe416 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest27/Generated27.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest27/Generated27.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated27 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1153,6 +1154,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated27::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest270/Generated270.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest270/Generated270.il index 0e97a010022ba9..96fe8ccf6d02db 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest270/Generated270.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest270/Generated270.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated270 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1747,6 +1748,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated270::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest271/Generated271.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest271/Generated271.il index fcb7c773b1aa6f..24afdfe935896d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest271/Generated271.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest271/Generated271.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated271 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1706,6 +1707,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated271::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest272/Generated272.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest272/Generated272.il index 108211db3d4a14..e68f2a24bb9a2a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest272/Generated272.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest272/Generated272.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated272 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1858,6 +1859,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated272::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest273/Generated273.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest273/Generated273.il index 6a70e2751150ed..9f4a9cb773db4c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest273/Generated273.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest273/Generated273.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated273 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1679,6 +1680,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated273::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest274/Generated274.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest274/Generated274.il index 94777efeed3db1..14948c20bf56f3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest274/Generated274.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest274/Generated274.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated274 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1636,6 +1637,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated274::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest275/Generated275.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest275/Generated275.il index 0ee6b611e5d8c7..304f86e45e5212 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest275/Generated275.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest275/Generated275.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated275 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1852,6 +1853,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated275::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest276/Generated276.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest276/Generated276.il index 9b0db0fe59a152..0054ed4887ae69 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest276/Generated276.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest276/Generated276.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated276 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1617,6 +1618,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated276::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest277/Generated277.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest277/Generated277.il index 41c62dc172e748..ffb19c2bbba2fc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest277/Generated277.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest277/Generated277.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated277 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1561,6 +1562,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated277::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest278/Generated278.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest278/Generated278.il index 98f2db9547b03b..c5c031de49766e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest278/Generated278.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest278/Generated278.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated278 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1714,6 +1715,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated278::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest279/Generated279.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest279/Generated279.il index d88e36b3bef38a..d80392b58592b1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest279/Generated279.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest279/Generated279.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated279 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1679,6 +1680,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated279::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest28/Generated28.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest28/Generated28.il index 1c6c3f831b7027..22a87ec69bf90b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest28/Generated28.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest28/Generated28.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated28 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1105,6 +1106,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated28::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest280/Generated280.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest280/Generated280.il index e43b7e5ea8bf9a..c96eb6d2db16dc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest280/Generated280.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest280/Generated280.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated280 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1974,6 +1975,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated280::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest281/Generated281.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest281/Generated281.il index 2732e2d7d77da7..941ac8e93c8682 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest281/Generated281.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest281/Generated281.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated281 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1657,6 +1658,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated281::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest282/Generated282.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest282/Generated282.il index d04e2cc9761422..c8db52cfa4ee3a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest282/Generated282.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest282/Generated282.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated282 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1778,6 +1779,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated282::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest283/Generated283.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest283/Generated283.il index 98f3e6cab38638..216ddd2396d034 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest283/Generated283.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest283/Generated283.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated283 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1708,6 +1709,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated283::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest284/Generated284.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest284/Generated284.il index f26e705887f0f3..6769e11708eee8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest284/Generated284.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest284/Generated284.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated284 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1858,6 +1859,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated284::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest285/Generated285.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest285/Generated285.il index b6acd006d43cdb..9500cf637468ef 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest285/Generated285.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest285/Generated285.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated285 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1679,6 +1680,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated285::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest286/Generated286.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest286/Generated286.il index 4a9adbb8973a22..2456f1de6685d0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest286/Generated286.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest286/Generated286.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated286 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1677,6 +1678,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated286::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest287/Generated287.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest287/Generated287.il index d3cb9ba0645245..459cd5b8531958 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest287/Generated287.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest287/Generated287.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated287 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1756,6 +1757,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated287::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest288/Generated288.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest288/Generated288.il index 065f50c371101e..b0a9a338f01422 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest288/Generated288.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest288/Generated288.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated288 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1908,6 +1909,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated288::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest289/Generated289.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest289/Generated289.il index 3ef0e36c92d083..a21e982f0365a1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest289/Generated289.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest289/Generated289.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated289 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1604,6 +1605,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated289::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest29/Generated29.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest29/Generated29.il index f8dca27fc53812..9b5dd5846bfe18 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest29/Generated29.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest29/Generated29.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated29 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -855,6 +856,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated29::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest290/Generated290.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest290/Generated290.il index 3168626fc77ffe..484bd68b07f332 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest290/Generated290.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest290/Generated290.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated290 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1826,6 +1827,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated290::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest291/Generated291.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest291/Generated291.il index e18e49a1baa6e1..24716c989d0ca1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest291/Generated291.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest291/Generated291.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated291 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1862,6 +1863,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated291::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest292/Generated292.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest292/Generated292.il index acf7deec06c944..48ea7f7ca75e3e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest292/Generated292.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest292/Generated292.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated292 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1795,6 +1796,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated292::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest293/Generated293.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest293/Generated293.il index 6e931dd7300148..959014f8e20bfb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest293/Generated293.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest293/Generated293.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated293 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1694,6 +1695,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated293::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest294/Generated294.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest294/Generated294.il index 53307639d05d0f..d06d6d23901c4d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest294/Generated294.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest294/Generated294.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated294 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1697,6 +1698,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated294::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest295/Generated295.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest295/Generated295.il index bce0eb07004422..095dbfe8aea5c4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest295/Generated295.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest295/Generated295.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated295 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1682,6 +1683,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated295::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest296/Generated296.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest296/Generated296.il index ea2a26001125bb..4b509bd504f38e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest296/Generated296.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest296/Generated296.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated296 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2027,6 +2028,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated296::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest297/Generated297.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest297/Generated297.il index 5139e912c1b74f..a3e210ce9f88c7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest297/Generated297.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest297/Generated297.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated297 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1605,6 +1606,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated297::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest298/Generated298.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest298/Generated298.il index 9fff2ac199f5d6..8af796674fed45 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest298/Generated298.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest298/Generated298.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated298 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1841,6 +1842,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated298::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest299/Generated299.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest299/Generated299.il index 9e6c1fe6948ca4..e9bc104d3ec55a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest299/Generated299.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest299/Generated299.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated299 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1776,6 +1777,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated299::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest3/Generated3.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest3/Generated3.il index 2a88b3f317e853..829ad8cee8dc00 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest3/Generated3.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest3/Generated3.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated3 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -801,6 +802,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated3::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest30/Generated30.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest30/Generated30.il index 98300402e8cd13..5a8e163f4e8171 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest30/Generated30.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest30/Generated30.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated30 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -558,6 +559,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated30::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest300/Generated300.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest300/Generated300.il index 8398abf31b5d83..a2d9cab8f946a9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest300/Generated300.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest300/Generated300.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated300 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1861,6 +1862,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated300::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest301/Generated301.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest301/Generated301.il index b935536e38166b..f8ab74eea2edaf 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest301/Generated301.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest301/Generated301.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated301 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1607,6 +1608,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated301::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest302/Generated302.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest302/Generated302.il index 44449570a85164..ec2b6b529cebb7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest302/Generated302.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest302/Generated302.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated302 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1690,6 +1691,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated302::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest303/Generated303.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest303/Generated303.il index 844b5fc637d768..c55e2f76e2272d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest303/Generated303.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest303/Generated303.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated303 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1709,6 +1710,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated303::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest304/Generated304.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest304/Generated304.il index 217259b6db46ee..1a52677d9364ee 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest304/Generated304.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest304/Generated304.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated304 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1781,6 +1782,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated304::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest305/Generated305.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest305/Generated305.il index 3b91d556de0d34..bd0df0c48bb5e5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest305/Generated305.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest305/Generated305.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated305 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1692,6 +1693,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated305::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest306/Generated306.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest306/Generated306.il index 087555be3524e8..2568303f8404dd 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest306/Generated306.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest306/Generated306.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated306 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1654,6 +1655,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated306::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest307/Generated307.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest307/Generated307.il index 49721875b90fd7..7e0cad1d1de0a0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest307/Generated307.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest307/Generated307.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated307 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1730,6 +1731,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated307::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest308/Generated308.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest308/Generated308.il index 56c9bb39153f7d..deb181ca0be7b2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest308/Generated308.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest308/Generated308.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated308 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1751,6 +1752,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated308::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest309/Generated309.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest309/Generated309.il index d5cf09544e9cad..fa69ac14552fb9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest309/Generated309.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest309/Generated309.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated309 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1833,6 +1834,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated309::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest31/Generated31.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest31/Generated31.il index f76039dde04c09..f253e699ee70b0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest31/Generated31.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest31/Generated31.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated31 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -776,6 +777,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated31::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest310/Generated310.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest310/Generated310.il index 2e408fd8befe28..f2a839ab9475a4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest310/Generated310.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest310/Generated310.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated310 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1852,6 +1853,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated310::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest311/Generated311.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest311/Generated311.il index bdfd89659c7ed3..7d284d818ad2ea 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest311/Generated311.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest311/Generated311.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated311 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1672,6 +1673,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated311::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest312/Generated312.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest312/Generated312.il index a24308ba5ffdd5..9e363809f1d0e1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest312/Generated312.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest312/Generated312.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated312 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1515,6 +1516,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated312::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest313/Generated313.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest313/Generated313.il index a0f4e28bb09d70..97bcbac3cd62a0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest313/Generated313.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest313/Generated313.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated313 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1712,6 +1713,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated313::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest314/Generated314.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest314/Generated314.il index bedfd3e312c086..467a1ce9dd74c6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest314/Generated314.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest314/Generated314.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated314 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1741,6 +1742,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated314::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest315/Generated315.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest315/Generated315.il index cb2070a3817245..df1412d3ae756c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest315/Generated315.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest315/Generated315.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated315 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1631,6 +1632,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated315::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest316/Generated316.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest316/Generated316.il index e0703e195e5621..ec6dd885710ed7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest316/Generated316.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest316/Generated316.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated316 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1448,6 +1449,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated316::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest317/Generated317.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest317/Generated317.il index a957574dd169b4..502ed50c427246 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest317/Generated317.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest317/Generated317.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated317 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1780,6 +1781,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated317::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest318/Generated318.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest318/Generated318.il index 55af82d2ac8595..c034ae66b39026 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest318/Generated318.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest318/Generated318.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated318 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1794,6 +1795,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated318::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest319/Generated319.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest319/Generated319.il index 28f984030ec682..580a19147570e9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest319/Generated319.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest319/Generated319.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated319 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1614,6 +1615,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated319::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest32/Generated32.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest32/Generated32.il index 6de173ee8c62fc..de6c14ec11db1f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest32/Generated32.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest32/Generated32.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated32 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -581,6 +582,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated32::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest320/Generated320.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest320/Generated320.il index d14b93738e3d57..116130b2769b7a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest320/Generated320.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest320/Generated320.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated320 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1503,6 +1504,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated320::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest321/Generated321.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest321/Generated321.il index f444ec7d5acf82..534fe086a8a3aa 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest321/Generated321.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest321/Generated321.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated321 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1715,6 +1716,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated321::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest322/Generated322.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest322/Generated322.il index fd3c9fb6b8e4bd..a6a0a1699c7c04 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest322/Generated322.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest322/Generated322.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated322 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1659,6 +1660,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated322::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest323/Generated323.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest323/Generated323.il index 7ff084fc05d533..ca66f815819203 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest323/Generated323.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest323/Generated323.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated323 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1609,6 +1610,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated323::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest324/Generated324.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest324/Generated324.il index e7b2e56470f739..9de1aa80596dfe 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest324/Generated324.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest324/Generated324.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated324 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1858,6 +1859,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated324::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest325/Generated325.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest325/Generated325.il index 4c130f1b78a8e2..efd3f0c8a759f0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest325/Generated325.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest325/Generated325.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated325 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2065,6 +2066,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated325::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest326/Generated326.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest326/Generated326.il index 3d40cb2912f25a..2c3095696ac862 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest326/Generated326.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest326/Generated326.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated326 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1904,6 +1905,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated326::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest327/Generated327.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest327/Generated327.il index 98f51386195468..cef64e1b71794f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest327/Generated327.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest327/Generated327.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated327 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2029,6 +2030,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated327::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest328/Generated328.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest328/Generated328.il index 90433e6ee175ab..b47a4e18d46a75 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest328/Generated328.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest328/Generated328.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated328 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1686,6 +1687,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated328::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest329/Generated329.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest329/Generated329.il index 0d708d21b8c83a..0c7888ed9c13d3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest329/Generated329.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest329/Generated329.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated329 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1828,6 +1829,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated329::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest33/Generated33.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest33/Generated33.il index f77a421891ce83..caf986a9db5ed7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest33/Generated33.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest33/Generated33.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated33 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -609,6 +610,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated33::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest330/Generated330.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest330/Generated330.il index 72c73b14f90f63..2bf9438c3893b3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest330/Generated330.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest330/Generated330.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated330 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1602,6 +1603,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated330::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest331/Generated331.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest331/Generated331.il index 8918e3b24f4365..392f520f174e1a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest331/Generated331.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest331/Generated331.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated331 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1737,6 +1738,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated331::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest332/Generated332.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest332/Generated332.il index fd955996b890f2..cc0ad24df5bce0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest332/Generated332.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest332/Generated332.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated332 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1612,6 +1613,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated332::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest333/Generated333.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest333/Generated333.il index 635e675cf8753e..860d99d1d63018 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest333/Generated333.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest333/Generated333.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated333 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2024,6 +2025,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated333::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest334/Generated334.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest334/Generated334.il index dee85d2a86b72b..69917448d20bc1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest334/Generated334.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest334/Generated334.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated334 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1838,6 +1839,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated334::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest335/Generated335.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest335/Generated335.il index 87fc381de3d4fe..56fdd1b6c65e39 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest335/Generated335.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest335/Generated335.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated335 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1853,6 +1854,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated335::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest336/Generated336.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest336/Generated336.il index 781c29f83f3608..986f7aa2d2ca05 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest336/Generated336.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest336/Generated336.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated336 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1687,6 +1688,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated336::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest337/Generated337.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest337/Generated337.il index ec25a1463ad003..75fb4b72cd6dd2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest337/Generated337.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest337/Generated337.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated337 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1824,6 +1825,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated337::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest338/Generated338.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest338/Generated338.il index ec657adadf913b..5280b1c4a2d84e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest338/Generated338.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest338/Generated338.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated338 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1903,6 +1904,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated338::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest339/Generated339.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest339/Generated339.il index 46859dd8fd2428..d74d248e3b4bba 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest339/Generated339.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest339/Generated339.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated339 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1918,6 +1919,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated339::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest34/Generated34.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest34/Generated34.il index 45da65473d39d2..2a959d62e5cffc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest34/Generated34.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest34/Generated34.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated34 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -535,6 +536,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated34::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest340/Generated340.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest340/Generated340.il index 61963122306c8d..0efb7ba7a14d2d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest340/Generated340.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest340/Generated340.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated340 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1817,6 +1818,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated340::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest341/Generated341.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest341/Generated341.il index b1ac2a3f8d888a..1dd5ccf2f43a34 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest341/Generated341.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest341/Generated341.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated341 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1894,6 +1895,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated341::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest342/Generated342.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest342/Generated342.il index 5c1bf73848415e..9f0327cf5d7fd4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest342/Generated342.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest342/Generated342.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated342 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1963,6 +1964,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated342::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest343/Generated343.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest343/Generated343.il index 41cc77165abc49..e19e2b0745e593 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest343/Generated343.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest343/Generated343.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated343 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1853,6 +1854,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated343::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest344/Generated344.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest344/Generated344.il index f867179a3106ac..036261c40e873c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest344/Generated344.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest344/Generated344.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated344 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1563,6 +1564,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated344::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest345/Generated345.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest345/Generated345.il index 28235aa9d8660b..2f572eef69056e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest345/Generated345.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest345/Generated345.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated345 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1855,6 +1856,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated345::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest346/Generated346.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest346/Generated346.il index d128e770b35601..0c6ec9282654f4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest346/Generated346.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest346/Generated346.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated346 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1674,6 +1675,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated346::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest347/Generated347.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest347/Generated347.il index 7ac2562040d4d9..da9158c02a2e5c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest347/Generated347.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest347/Generated347.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated347 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1724,6 +1725,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated347::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest348/Generated348.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest348/Generated348.il index 5c7e041c6e9c0e..04fde36ee9c259 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest348/Generated348.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest348/Generated348.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated348 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1566,6 +1567,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated348::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest349/Generated349.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest349/Generated349.il index a68aec8fb7803a..ccdbb6a6c579d3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest349/Generated349.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest349/Generated349.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated349 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1783,6 +1784,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated349::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest35/Generated35.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest35/Generated35.il index 8822876b8b0c63..ea66a2a381c7b2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest35/Generated35.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest35/Generated35.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated35 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -953,6 +954,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated35::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest350/Generated350.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest350/Generated350.il index 9cf82115098035..c0befc6e081d99 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest350/Generated350.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest350/Generated350.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated350 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1722,6 +1723,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated350::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest351/Generated351.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest351/Generated351.il index 3f1f4fc091ae8e..bc69ce67bec156 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest351/Generated351.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest351/Generated351.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated351 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1712,6 +1713,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated351::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest352/Generated352.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest352/Generated352.il index 0a5ca0629aa986..f3e8fe0b49b969 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest352/Generated352.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest352/Generated352.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated352 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1525,6 +1526,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated352::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest353/Generated353.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest353/Generated353.il index 34b1537ed512e3..f15857362e2401 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest353/Generated353.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest353/Generated353.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated353 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2002,6 +2003,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated353::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest354/Generated354.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest354/Generated354.il index 7ee70e861eeb77..138990f751ce90 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest354/Generated354.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest354/Generated354.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated354 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1831,6 +1832,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated354::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest355/Generated355.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest355/Generated355.il index ba81d76b18d646..b01b860beed13e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest355/Generated355.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest355/Generated355.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated355 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1826,6 +1827,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated355::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest356/Generated356.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest356/Generated356.il index 17299e1c6c2a0c..e81ee0083fa8f2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest356/Generated356.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest356/Generated356.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated356 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1607,6 +1608,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated356::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest357/Generated357.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest357/Generated357.il index a2b781003b62f4..0983695584729e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest357/Generated357.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest357/Generated357.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated357 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1904,6 +1905,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated357::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest358/Generated358.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest358/Generated358.il index 7990a41b01cf9f..b14182b3a55181 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest358/Generated358.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest358/Generated358.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated358 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1783,6 +1784,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated358::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest359/Generated359.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest359/Generated359.il index 4d2523d729c336..da2e6dec795410 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest359/Generated359.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest359/Generated359.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated359 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1918,6 +1919,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated359::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest36/Generated36.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest36/Generated36.il index dac7d2e060fc36..6175e52338b058 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest36/Generated36.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest36/Generated36.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated36 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -917,6 +918,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated36::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest360/Generated360.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest360/Generated360.il index 9fecf27f158bf1..551dde3febc6ea 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest360/Generated360.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest360/Generated360.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated360 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1568,6 +1569,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated360::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest361/Generated361.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest361/Generated361.il index 41e74c0c962098..736fc93b0f0779 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest361/Generated361.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest361/Generated361.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated361 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1900,6 +1901,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated361::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest362/Generated362.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest362/Generated362.il index f77462c3cf66db..8aef9ce006aac5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest362/Generated362.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest362/Generated362.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated362 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1684,6 +1685,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated362::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest363/Generated363.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest363/Generated363.il index 79bcdd9a805fa4..91a28c99625ac0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest363/Generated363.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest363/Generated363.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated363 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1679,6 +1680,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated363::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest364/Generated364.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest364/Generated364.il index 61e60d91ccb366..af7496950d428f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest364/Generated364.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest364/Generated364.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated364 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1715,6 +1716,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated364::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest365/Generated365.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest365/Generated365.il index fb298c6adca9b7..125babc6f8df49 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest365/Generated365.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest365/Generated365.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated365 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1812,6 +1813,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated365::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest366/Generated366.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest366/Generated366.il index 0b97e3c8b43ece..6ae0b46633b1d8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest366/Generated366.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest366/Generated366.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated366 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1831,6 +1832,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated366::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest367/Generated367.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest367/Generated367.il index 3b0c891719aa9e..a445201bacfd14 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest367/Generated367.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest367/Generated367.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated367 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1896,6 +1897,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated367::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest368/Generated368.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest368/Generated368.il index 081d923d615485..b0fd21c2b623a7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest368/Generated368.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest368/Generated368.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated368 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1701,6 +1702,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated368::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest369/Generated369.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest369/Generated369.il index 96aec8ddd24879..91b0c190e9412c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest369/Generated369.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest369/Generated369.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated369 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1848,6 +1849,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated369::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest37/Generated37.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest37/Generated37.il index bc7ea3d42f8ca2..c61a3f749f25db 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest37/Generated37.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest37/Generated37.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated37 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -877,6 +878,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated37::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest370/Generated370.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest370/Generated370.il index 944aae360178c8..b81beccca32681 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest370/Generated370.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest370/Generated370.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated370 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1612,6 +1613,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated370::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest371/Generated371.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest371/Generated371.il index 44e396cde47241..255783aff141bd 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest371/Generated371.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest371/Generated371.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated371 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1722,6 +1723,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated371::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest372/Generated372.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest372/Generated372.il index 869ba2cd9edb7a..3b9c17527fd58c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest372/Generated372.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest372/Generated372.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated372 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -947,6 +948,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated372::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest373/Generated373.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest373/Generated373.il index 487fde0c38c4eb..0ef9d04219b656 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest373/Generated373.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest373/Generated373.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated373 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -633,6 +634,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated373::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest374/Generated374.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest374/Generated374.il index fbb512998bbb4a..af6c66a3e2d4ae 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest374/Generated374.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest374/Generated374.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated374 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -749,6 +750,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated374::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest375/Generated375.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest375/Generated375.il index d7818188258d4f..7ea7345d02e8b6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest375/Generated375.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest375/Generated375.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated375 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1359,6 +1360,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated375::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest376/Generated376.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest376/Generated376.il index ae5e7e0f4096c2..dcb2f9e07c5aa6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest376/Generated376.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest376/Generated376.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated376 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -993,6 +994,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated376::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest377/Generated377.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest377/Generated377.il index 628a2e4a80772f..995b18372422f2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest377/Generated377.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest377/Generated377.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated377 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1261,6 +1262,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated377::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest378/Generated378.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest378/Generated378.il index 7ee16326d66db9..980b50c3bd7e15 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest378/Generated378.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest378/Generated378.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated378 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1136,6 +1137,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated378::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest379/Generated379.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest379/Generated379.il index 1c36edbf1ddf50..ae46434fcf5ee9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest379/Generated379.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest379/Generated379.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated379 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -749,6 +750,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated379::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest38/Generated38.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest38/Generated38.il index 4a2651d5a3b813..39458c88b3e9b9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest38/Generated38.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest38/Generated38.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated38 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1106,6 +1107,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated38::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest380/Generated380.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest380/Generated380.il index e02e83c1983d0b..9c31a15dadfb91 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest380/Generated380.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest380/Generated380.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated380 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1085,6 +1086,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated380::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest381/Generated381.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest381/Generated381.il index 29632d00106726..61a60ccc420a4b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest381/Generated381.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest381/Generated381.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated381 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -728,6 +729,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated381::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest382/Generated382.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest382/Generated382.il index 09f9e0ea48a844..500f862fcea9b2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest382/Generated382.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest382/Generated382.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated382 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -989,6 +990,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated382::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest383/Generated383.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest383/Generated383.il index 906626959ebdac..48e05acc87bba4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest383/Generated383.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest383/Generated383.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated383 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -801,6 +802,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated383::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest384/Generated384.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest384/Generated384.il index 0854f28909cdc2..2560dcf5fc175b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest384/Generated384.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest384/Generated384.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated384 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1070,6 +1071,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated384::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest385/Generated385.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest385/Generated385.il index 3363427955548a..86b6cc0a36ee69 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest385/Generated385.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest385/Generated385.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated385 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -948,6 +949,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated385::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest386/Generated386.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest386/Generated386.il index 5123f43b20f9ac..e10a53a900d3c8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest386/Generated386.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest386/Generated386.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated386 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -770,6 +771,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated386::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest387/Generated387.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest387/Generated387.il index 4b67b717e10924..f1245a3188f570 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest387/Generated387.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest387/Generated387.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated387 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1027,6 +1028,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated387::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest388/Generated388.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest388/Generated388.il index 278c43215d3c35..5b6242acfd8fb1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest388/Generated388.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest388/Generated388.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated388 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -650,6 +651,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated388::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest389/Generated389.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest389/Generated389.il index 6a827fa446e4d6..ad89e42b6f88c8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest389/Generated389.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest389/Generated389.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated389 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -695,6 +696,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated389::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest39/Generated39.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest39/Generated39.il index 0d1c7691f5d4d5..c0f36659984a87 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest39/Generated39.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest39/Generated39.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated39 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -975,6 +976,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated39::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest390/Generated390.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest390/Generated390.il index 1b3f461d6a54ab..4bbb2f6af561bb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest390/Generated390.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest390/Generated390.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated390 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1189,6 +1190,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated390::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest391/Generated391.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest391/Generated391.il index 2979b48ac7ced1..11cce15101ae31 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest391/Generated391.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest391/Generated391.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated391 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1012,6 +1013,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated391::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest392/Generated392.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest392/Generated392.il index dbde88b4563552..4a66ea911de257 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest392/Generated392.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest392/Generated392.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated392 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1053,6 +1054,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated392::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest393/Generated393.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest393/Generated393.il index b145f3d7b057ef..e6ea4c0b75a5eb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest393/Generated393.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest393/Generated393.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated393 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1133,6 +1134,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated393::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest394/Generated394.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest394/Generated394.il index 926780c64c0a5b..6afb29e324117c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest394/Generated394.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest394/Generated394.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated394 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1253,6 +1254,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated394::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest395/Generated395.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest395/Generated395.il index 5f86bd72a91c82..3521165d68cd25 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest395/Generated395.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest395/Generated395.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated395 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -702,6 +703,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated395::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest396/Generated396.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest396/Generated396.il index a61574c5544433..29bbc3175f1649 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest396/Generated396.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest396/Generated396.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated396 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1082,6 +1083,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated396::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest397/Generated397.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest397/Generated397.il index fdbe10d603a76d..9ac5a9b25beb95 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest397/Generated397.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest397/Generated397.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated397 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -863,6 +864,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated397::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest398/Generated398.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest398/Generated398.il index c448cbe8a54774..a14fb7dfe3a2e9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest398/Generated398.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest398/Generated398.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated398 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1143,6 +1144,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated398::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest399/Generated399.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest399/Generated399.il index 5de68abe3ba397..ab0da39b55a406 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest399/Generated399.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest399/Generated399.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated399 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -685,6 +686,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated399::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest4/Generated4.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest4/Generated4.il index 521e2b161ac24e..5e79992e43427b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest4/Generated4.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest4/Generated4.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated4 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -716,6 +717,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated4::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest40/Generated40.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest40/Generated40.il index 0f7f18500ee407..49b07874379abf 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest40/Generated40.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest40/Generated40.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated40 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1043,6 +1044,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated40::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest400/Generated400.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest400/Generated400.il index 35fa7905b3de7c..8f5206716aaf2f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest400/Generated400.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest400/Generated400.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated400 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -955,6 +956,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated400::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest401/Generated401.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest401/Generated401.il index 2844afeb467568..420a6a140a1d32 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest401/Generated401.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest401/Generated401.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated401 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -957,6 +958,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated401::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest402/Generated402.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest402/Generated402.il index 523e3b468d18b8..89267ff1c7bba0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest402/Generated402.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest402/Generated402.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated402 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -702,6 +703,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated402::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest403/Generated403.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest403/Generated403.il index b5c330f27671f4..54b77e67b509f9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest403/Generated403.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest403/Generated403.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated403 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -650,6 +651,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated403::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest404/Generated404.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest404/Generated404.il index 5c26dabf60f6df..a3776c41cb4513 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest404/Generated404.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest404/Generated404.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated404 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -611,6 +612,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated404::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest405/Generated405.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest405/Generated405.il index 9838813be7bf96..0bb92b321416d4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest405/Generated405.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest405/Generated405.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated405 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1319,6 +1320,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated405::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest406/Generated406.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest406/Generated406.il index 7bdd2b67e4da9b..3710fef150a668 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest406/Generated406.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest406/Generated406.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated406 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1000,6 +1001,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated406::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest407/Generated407.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest407/Generated407.il index 0f1b2b04b41c42..6c67c886c9b1c3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest407/Generated407.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest407/Generated407.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated407 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1013,6 +1014,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated407::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest408/Generated408.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest408/Generated408.il index feba40982fffcd..0268d050d3e766 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest408/Generated408.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest408/Generated408.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated408 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1102,6 +1103,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated408::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest409/Generated409.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest409/Generated409.il index f815d79e4b4e00..2ea3c2399600df 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest409/Generated409.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest409/Generated409.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated409 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -749,6 +750,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated409::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest41/Generated41.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest41/Generated41.il index 8df3b7577ec5a4..eccd88da980447 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest41/Generated41.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest41/Generated41.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated41 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1075,6 +1076,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated41::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest410/Generated410.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest410/Generated410.il index 3769e9e8152055..54b605bd3446f8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest410/Generated410.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest410/Generated410.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated410 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1027,6 +1028,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated410::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest411/Generated411.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest411/Generated411.il index 6804b040969929..c2e867cd5e7d97 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest411/Generated411.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest411/Generated411.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated411 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -623,6 +624,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated411::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest412/Generated412.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest412/Generated412.il index 1e18d30a4906c0..09f82f8223d175 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest412/Generated412.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest412/Generated412.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated412 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -858,6 +859,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated412::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest413/Generated413.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest413/Generated413.il index 5a118f1b205b25..72eae7f0489ccb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest413/Generated413.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest413/Generated413.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated413 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -911,6 +912,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated413::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest414/Generated414.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest414/Generated414.il index a4453232c85103..e8e4e46d01fc14 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest414/Generated414.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest414/Generated414.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated414 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -982,6 +983,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated414::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest415/Generated415.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest415/Generated415.il index 7ab5520cb5579c..86f7aaba5f096b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest415/Generated415.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest415/Generated415.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated415 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -738,6 +739,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated415::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest416/Generated416.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest416/Generated416.il index 1c947c2b2b8fe0..d87fdb2cb84b46 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest416/Generated416.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest416/Generated416.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated416 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -931,6 +932,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated416::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest417/Generated417.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest417/Generated417.il index 6db5bcd7848bc5..6a7c15515a571c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest417/Generated417.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest417/Generated417.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated417 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -658,6 +659,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated417::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest418/Generated418.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest418/Generated418.il index 859f96c10cc4f3..2d6b13c02a015b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest418/Generated418.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest418/Generated418.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated418 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -653,6 +654,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated418::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest419/Generated419.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest419/Generated419.il index 9960e9c4bb652e..cea2eb006e47e7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest419/Generated419.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest419/Generated419.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated419 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -759,6 +760,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated419::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest42/Generated42.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest42/Generated42.il index 29df307e7603c0..bb37d9d88b7f3d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest42/Generated42.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest42/Generated42.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated42 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -931,6 +932,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated42::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest420/Generated420.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest420/Generated420.il index dd866682c08c92..1a22a3ad7a2f5f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest420/Generated420.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest420/Generated420.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated420 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1249,6 +1250,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated420::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest421/Generated421.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest421/Generated421.il index e09360ae8f0f55..59ab3d448264b1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest421/Generated421.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest421/Generated421.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated421 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1010,6 +1011,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated421::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest422/Generated422.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest422/Generated422.il index c8a32f3f85f15e..241fbdc30f17ea 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest422/Generated422.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest422/Generated422.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated422 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1157,6 +1158,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated422::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest423/Generated423.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest423/Generated423.il index e06976173d6a2a..f2607282d1326d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest423/Generated423.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest423/Generated423.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated423 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1133,6 +1134,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated423::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest424/Generated424.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest424/Generated424.il index d448d3a31b2bbb..141b544edcc88f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest424/Generated424.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest424/Generated424.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated424 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1023,6 +1024,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated424::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest425/Generated425.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest425/Generated425.il index c6969d359a1583..b41b13f94f42f6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest425/Generated425.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest425/Generated425.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated425 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -824,6 +825,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated425::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest426/Generated426.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest426/Generated426.il index c0280951f9fb22..a5a2140d7767bb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest426/Generated426.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest426/Generated426.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated426 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -788,6 +789,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated426::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest427/Generated427.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest427/Generated427.il index fc9ea11d643134..22d5ea65fc6507 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest427/Generated427.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest427/Generated427.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated427 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -691,6 +692,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated427::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest428/Generated428.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest428/Generated428.il index 987543d747fbb0..94d5c46d8697c9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest428/Generated428.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest428/Generated428.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated428 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -818,6 +819,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated428::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest429/Generated429.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest429/Generated429.il index 0aef4e45512b50..4989a23ab578d8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest429/Generated429.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest429/Generated429.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated429 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1002,6 +1003,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated429::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest43/Generated43.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest43/Generated43.il index 5ba6b45b87883a..cb3a23df81944f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest43/Generated43.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest43/Generated43.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated43 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1059,6 +1060,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated43::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest430/Generated430.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest430/Generated430.il index 2b648b7ac2c25e..88449ddfc871d4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest430/Generated430.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest430/Generated430.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated430 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -797,6 +798,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated430::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest431/Generated431.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest431/Generated431.il index 6f110e4e89c1c3..deea4fde671eeb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest431/Generated431.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest431/Generated431.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated431 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -749,6 +750,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated431::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest432/Generated432.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest432/Generated432.il index 0485454cedee61..195cae2d73f673 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest432/Generated432.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest432/Generated432.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated432 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1319,6 +1320,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated432::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest433/Generated433.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest433/Generated433.il index 1c7e8ee79563d2..440379ac1c8694 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest433/Generated433.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest433/Generated433.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated433 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1359,6 +1360,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated433::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest434/Generated434.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest434/Generated434.il index ca4f544971c57c..e3f5dbf6cc4fcc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest434/Generated434.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest434/Generated434.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated434 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1379,6 +1380,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated434::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest435/Generated435.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest435/Generated435.il index 7c5c39835f4a58..c0b3f0ff6f4ab0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest435/Generated435.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest435/Generated435.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated435 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1249,6 +1250,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated435::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest436/Generated436.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest436/Generated436.il index c4d2a77f58616e..6a114e9e1995e7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest436/Generated436.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest436/Generated436.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated436 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1244,6 +1245,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated436::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest437/Generated437.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest437/Generated437.il index 5710ca2d90e6bf..7038e4e0a5df86 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest437/Generated437.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest437/Generated437.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated437 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -712,6 +713,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated437::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest438/Generated438.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest438/Generated438.il index dd982a6c761678..902b87017aa0c4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest438/Generated438.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest438/Generated438.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated438 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -769,6 +770,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated438::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest439/Generated439.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest439/Generated439.il index 0c52cde686f2cf..3bdb3b53e55307 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest439/Generated439.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest439/Generated439.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated439 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -813,6 +814,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated439::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest44/Generated44.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest44/Generated44.il index ced5e5f4c3d9e1..5b74b11a1cc208 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest44/Generated44.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest44/Generated44.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated44 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1123,6 +1124,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated44::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest440/Generated440.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest440/Generated440.il index 3745e535bb5671..3d1a56c1e91370 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest440/Generated440.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest440/Generated440.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated440 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1239,6 +1240,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated440::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest441/Generated441.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest441/Generated441.il index 73c87505e23d30..ea7c349380715b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest441/Generated441.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest441/Generated441.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated441 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1194,6 +1195,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated441::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest442/Generated442.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest442/Generated442.il index cc0f6bc4e51213..2f3fa57b665b17 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest442/Generated442.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest442/Generated442.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated442 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -974,6 +975,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated442::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest443/Generated443.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest443/Generated443.il index c301ef48473f8b..fd93e6eed3749d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest443/Generated443.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest443/Generated443.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated443 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -875,6 +876,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated443::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest444/Generated444.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest444/Generated444.il index 672676a5085892..765f74af59dd93 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest444/Generated444.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest444/Generated444.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated444 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1239,6 +1240,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated444::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest445/Generated445.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest445/Generated445.il index 9eddbf69849146..a0b6eddce2f296 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest445/Generated445.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest445/Generated445.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated445 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1127,6 +1128,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated445::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest446/Generated446.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest446/Generated446.il index 54a2b7db973b34..72b5de504979bd 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest446/Generated446.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest446/Generated446.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated446 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1249,6 +1250,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated446::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest447/Generated447.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest447/Generated447.il index e8b2755013987e..7e7cdec51bffd5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest447/Generated447.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest447/Generated447.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated447 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1198,6 +1199,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated447::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest448/Generated448.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest448/Generated448.il index ab9bbfeb35a35c..46fe8dee15a019 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest448/Generated448.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest448/Generated448.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated448 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -957,6 +958,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated448::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest449/Generated449.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest449/Generated449.il index e9b31884dc9d4c..b00a507eef3e49 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest449/Generated449.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest449/Generated449.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated449 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1080,6 +1081,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated449::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest45/Generated45.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest45/Generated45.il index 5a206ce9e18397..b233ebd9e744ec 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest45/Generated45.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest45/Generated45.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated45 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -969,6 +970,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated45::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest450/Generated450.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest450/Generated450.il index e653a740bc3e3e..575950881a5b50 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest450/Generated450.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest450/Generated450.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated450 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1195,6 +1196,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated450::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest451/Generated451.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest451/Generated451.il index 3bfa31cee7d6ae..0cf165ebab866c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest451/Generated451.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest451/Generated451.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated451 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1319,6 +1320,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated451::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest452/Generated452.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest452/Generated452.il index 09c9c1ee9eab54..98a9bded968326 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest452/Generated452.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest452/Generated452.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated452 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -702,6 +703,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated452::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest453/Generated453.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest453/Generated453.il index 5b2e6d5080d8b8..200e9941be6f28 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest453/Generated453.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest453/Generated453.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated453 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -806,6 +807,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated453::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest454/Generated454.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest454/Generated454.il index 2714c68371c32b..c842757c5915f2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest454/Generated454.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest454/Generated454.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated454 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1136,6 +1137,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated454::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest455/Generated455.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest455/Generated455.il index 22ef0acac75c22..1bcddd37132214 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest455/Generated455.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest455/Generated455.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated455 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -596,6 +597,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated455::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest456/Generated456.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest456/Generated456.il index e7ef2e2873185e..926bbe172b5763 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest456/Generated456.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest456/Generated456.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated456 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -755,6 +756,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated456::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest457/Generated457.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest457/Generated457.il index 73b533a09346f7..322d0dd031df94 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest457/Generated457.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest457/Generated457.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated457 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -943,6 +944,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated457::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest458/Generated458.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest458/Generated458.il index 45afa197bee3b9..8f0cc3d2b55a17 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest458/Generated458.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest458/Generated458.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated458 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1321,6 +1322,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated458::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest459/Generated459.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest459/Generated459.il index c8742a3f60c909..f19bde246597ba 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest459/Generated459.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest459/Generated459.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated459 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -621,6 +622,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated459::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest46/Generated46.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest46/Generated46.il index 8e2fcf1ac6330d..a1803c3bbb2a40 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest46/Generated46.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest46/Generated46.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated46 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1057,6 +1058,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated46::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest460/Generated460.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest460/Generated460.il index 646f48b8ef5684..9d302b991f56da 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest460/Generated460.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest460/Generated460.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated460 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -989,6 +990,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated460::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest461/Generated461.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest461/Generated461.il index f0aa42ae811643..6c099be0818d6b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest461/Generated461.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest461/Generated461.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated461 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -723,6 +724,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated461::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest462/Generated462.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest462/Generated462.il index 8c7a2f56e0dd6d..05582d05e319f5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest462/Generated462.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest462/Generated462.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated462 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1256,6 +1257,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated462::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest463/Generated463.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest463/Generated463.il index a99f452cc27749..ca1b548dbed879 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest463/Generated463.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest463/Generated463.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated463 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1203,6 +1204,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated463::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest464/Generated464.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest464/Generated464.il index fdba94fbc8b752..4f9850013ef49a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest464/Generated464.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest464/Generated464.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated464 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1068,6 +1069,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated464::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest465/Generated465.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest465/Generated465.il index 790f6315ae1615..d18dbaf8de184b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest465/Generated465.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest465/Generated465.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated465 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1282,6 +1283,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated465::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest466/Generated466.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest466/Generated466.il index 2be883141801ca..966ec3dc93c189 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest466/Generated466.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest466/Generated466.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated466 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -734,6 +735,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated466::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest467/Generated467.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest467/Generated467.il index 2a53e1a95ad577..7aef42e4ee7456 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest467/Generated467.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest467/Generated467.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated467 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -818,6 +819,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated467::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest468/Generated468.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest468/Generated468.il index 87e6cb03ee7606..83a8370ba69d29 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest468/Generated468.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest468/Generated468.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated468 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -717,6 +718,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated468::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest469/Generated469.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest469/Generated469.il index 3a222a7e022a27..ce8fff06b599a6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest469/Generated469.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest469/Generated469.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated469 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1194,6 +1195,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated469::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest47/Generated47.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest47/Generated47.il index 2f48d2c6533dbb..51d54ba05b965d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest47/Generated47.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest47/Generated47.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated47 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1175,6 +1176,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated47::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest470/Generated470.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest470/Generated470.il index dc4396d41281d5..da52612006417f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest470/Generated470.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest470/Generated470.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated470 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -793,6 +794,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated470::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest471/Generated471.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest471/Generated471.il index 004264f5333097..59f5147a1c1cfd 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest471/Generated471.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest471/Generated471.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated471 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -813,6 +814,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated471::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest472/Generated472.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest472/Generated472.il index e4d8e0f8acc3d3..4dbed3af1f37e7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest472/Generated472.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest472/Generated472.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated472 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1071,6 +1072,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated472::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest473/Generated473.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest473/Generated473.il index 6b67c937596704..462e5671961672 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest473/Generated473.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest473/Generated473.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated473 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1006,6 +1007,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated473::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest474/Generated474.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest474/Generated474.il index d9022b1ff6c62d..e83b7dbebd991e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest474/Generated474.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest474/Generated474.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated474 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1059,6 +1060,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated474::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest475/Generated475.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest475/Generated475.il index e2fa3588d1c802..a601292dc1c46f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest475/Generated475.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest475/Generated475.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated475 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -743,6 +744,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated475::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest476/Generated476.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest476/Generated476.il index d42fff2626aad4..68ac50b1623a99 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest476/Generated476.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest476/Generated476.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated476 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1047,6 +1048,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated476::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest477/Generated477.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest477/Generated477.il index 1792e9049751bb..c161789c64d4c9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest477/Generated477.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest477/Generated477.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated477 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1311,6 +1312,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated477::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest478/Generated478.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest478/Generated478.il index c951788fcfebbf..df8ac6b0cc69c3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest478/Generated478.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest478/Generated478.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated478 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1063,6 +1064,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated478::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest479/Generated479.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest479/Generated479.il index 99326e74698009..5cc55cf260f33f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest479/Generated479.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest479/Generated479.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated479 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1082,6 +1083,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated479::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest48/Generated48.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest48/Generated48.il index 25845a61091d00..fe8095c77acbcf 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest48/Generated48.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest48/Generated48.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated48 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1108,6 +1109,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated48::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest480/Generated480.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest480/Generated480.il index 873a0039b8f231..a4421b2d06e614 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest480/Generated480.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest480/Generated480.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated480 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1123,6 +1124,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated480::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest481/Generated481.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest481/Generated481.il index 8abe4cd20ad0cf..a0d8b2dd09b48e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest481/Generated481.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest481/Generated481.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated481 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -806,6 +807,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated481::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest482/Generated482.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest482/Generated482.il index dc5571f73b8822..5b5b4c253bf600 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest482/Generated482.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest482/Generated482.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated482 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -811,6 +812,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated482::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest483/Generated483.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest483/Generated483.il index d625fe5578ea82..d7e0bd7d2d2b24 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest483/Generated483.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest483/Generated483.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated483 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -828,6 +829,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated483::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest484/Generated484.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest484/Generated484.il index bb7cddf335f136..59426955257552 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest484/Generated484.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest484/Generated484.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated484 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1052,6 +1053,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated484::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest485/Generated485.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest485/Generated485.il index e77715dca4599e..74b7f3253960b4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest485/Generated485.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest485/Generated485.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated485 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1069,6 +1070,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated485::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest486/Generated486.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest486/Generated486.il index 556b65bf675d89..651be37d31cace 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest486/Generated486.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest486/Generated486.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated486 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1006,6 +1007,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated486::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest487/Generated487.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest487/Generated487.il index b636e97a23ba92..2fb635b99036ba 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest487/Generated487.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest487/Generated487.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated487 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -745,6 +746,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated487::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest488/Generated488.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest488/Generated488.il index d985837c7a0039..ce7cdc1b831fbe 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest488/Generated488.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest488/Generated488.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated488 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1169,6 +1170,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated488::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest489/Generated489.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest489/Generated489.il index bdbbd0d5f3dc7f..dfffa07488bf64 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest489/Generated489.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest489/Generated489.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated489 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -727,6 +728,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated489::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest49/Generated49.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest49/Generated49.il index 0c72dc600dbebc..5dc85a32821c87 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest49/Generated49.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest49/Generated49.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated49 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1181,6 +1182,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated49::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest490/Generated490.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest490/Generated490.il index 519b594dd8e730..3b7490a31127d0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest490/Generated490.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest490/Generated490.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated490 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1076,6 +1077,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated490::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest491/Generated491.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest491/Generated491.il index d0ba0e3c62a652..a57e0a687502b0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest491/Generated491.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest491/Generated491.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated491 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -727,6 +728,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated491::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest492/Generated492.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest492/Generated492.il index 524923f1d7aed0..4a8d695aeb2b40 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest492/Generated492.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest492/Generated492.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated492 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -771,6 +772,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated492::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest493/Generated493.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest493/Generated493.il index 57cc59d90dc7e8..6902c651146925 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest493/Generated493.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest493/Generated493.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated493 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1138,6 +1139,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated493::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest494/Generated494.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest494/Generated494.il index 1a50941ea4ded1..80a01cb2413671 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest494/Generated494.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest494/Generated494.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated494 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -744,6 +745,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated494::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest495/Generated495.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest495/Generated495.il index 752eaedf3d8f02..04c4cd4136ff1d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest495/Generated495.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest495/Generated495.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated495 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -947,6 +948,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated495::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest496/Generated496.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest496/Generated496.il index 547ee7b7502ce4..81bbce6d258e27 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest496/Generated496.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest496/Generated496.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated496 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -786,6 +787,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated496::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest497/Generated497.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest497/Generated497.il index 5075d3ed4be03a..e71322675527f7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest497/Generated497.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest497/Generated497.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated497 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1196,6 +1197,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated497::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest498/Generated498.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest498/Generated498.il index 52a61e2d054351..5ebb3b834ac86b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest498/Generated498.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest498/Generated498.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated498 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1379,6 +1380,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated498::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest499/Generated499.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest499/Generated499.il index 59e4d3cea7979f..739f9a293e7576 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest499/Generated499.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest499/Generated499.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated499 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -955,6 +956,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated499::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest5/Generated5.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest5/Generated5.il index 9e5c1668c051f1..8f6627b9072ea1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest5/Generated5.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest5/Generated5.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated5 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -598,6 +599,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated5::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest50/Generated50.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest50/Generated50.il index ba06164bb2e828..8ff59f6539dcee 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest50/Generated50.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest50/Generated50.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated50 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1218,6 +1219,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated50::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest500/Generated500.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest500/Generated500.il index a7fa06711742c9..57e331b6a3886c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest500/Generated500.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest500/Generated500.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated500 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1253,6 +1254,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated500::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest501/Generated501.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest501/Generated501.il index f5cd7d59e5738d..9f267af31b54d1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest501/Generated501.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest501/Generated501.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated501 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -729,6 +730,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated501::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest502/Generated502.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest502/Generated502.il index 548e3417c74450..2353d482eac7fa 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest502/Generated502.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest502/Generated502.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated502 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -711,6 +712,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated502::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest503/Generated503.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest503/Generated503.il index 3f26b4a683c4a2..d39d5ccdbb79d9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest503/Generated503.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest503/Generated503.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated503 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -796,6 +797,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated503::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest504/Generated504.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest504/Generated504.il index 51f6fdb3b7a4b7..79dc7fb36bf55c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest504/Generated504.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest504/Generated504.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated504 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1217,6 +1218,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated504::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest505/Generated505.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest505/Generated505.il index 2d946538a5f8eb..060a9b74e24d09 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest505/Generated505.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest505/Generated505.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated505 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -959,6 +960,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated505::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest506/Generated506.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest506/Generated506.il index f1b3c3a363ade4..4459f6fcc5af4f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest506/Generated506.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest506/Generated506.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated506 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -991,6 +992,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated506::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest507/Generated507.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest507/Generated507.il index c96b98f545e79c..ff57f948aa03a9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest507/Generated507.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest507/Generated507.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated507 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1205,6 +1206,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated507::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest508/Generated508.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest508/Generated508.il index e0c17211f34fd9..cec27e5006d663 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest508/Generated508.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest508/Generated508.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated508 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -655,6 +656,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated508::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest509/Generated509.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest509/Generated509.il index 45738e9dd202b4..25db42081116be 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest509/Generated509.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest509/Generated509.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated509 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1082,6 +1083,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated509::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest51/Generated51.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest51/Generated51.il index 0bcf0edbc60e69..a0cb3160dfa76e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest51/Generated51.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest51/Generated51.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated51 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1025,6 +1026,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated51::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest510/Generated510.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest510/Generated510.il index fa734932119a08..42d0e8ffd85afb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest510/Generated510.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest510/Generated510.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated510 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -829,6 +830,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated510::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest511/Generated511.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest511/Generated511.il index 371756a30ff5f0..db99a439a976f3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest511/Generated511.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest511/Generated511.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated511 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1194,6 +1195,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated511::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest512/Generated512.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest512/Generated512.il index 5a4af327a0b3ad..b346b1ca7fb37a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest512/Generated512.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest512/Generated512.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated512 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -628,6 +629,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated512::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest513/Generated513.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest513/Generated513.il index 41f45397bfc97c..ac0b61feb0bbde 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest513/Generated513.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest513/Generated513.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated513 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -771,6 +772,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated513::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest514/Generated514.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest514/Generated514.il index 8a1b9a59fcd6bd..529768608bfd5e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest514/Generated514.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest514/Generated514.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated514 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1069,6 +1070,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated514::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest515/Generated515.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest515/Generated515.il index 5faa0dba374ae0..b3d9c1810fdd2d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest515/Generated515.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest515/Generated515.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated515 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1128,6 +1129,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated515::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest516/Generated516.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest516/Generated516.il index 2f0fcaf3951ae9..3e1aff207d41bf 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest516/Generated516.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest516/Generated516.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated516 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -670,6 +671,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated516::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest517/Generated517.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest517/Generated517.il index 33558d9e20c7e9..44bbdb34acc6b4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest517/Generated517.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest517/Generated517.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated517 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -738,6 +739,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated517::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest518/Generated518.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest518/Generated518.il index 28d823727db8b6..da8ef7a50f0bf5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest518/Generated518.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest518/Generated518.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated518 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1022,6 +1023,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated518::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest519/Generated519.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest519/Generated519.il index 0e9b276e34b9a3..9c215b0b43acde 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest519/Generated519.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest519/Generated519.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated519 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -675,6 +676,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated519::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest52/Generated52.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest52/Generated52.il index 95f48a62a3920f..0f75d2894890f5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest52/Generated52.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest52/Generated52.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated52 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1054,6 +1055,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated52::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest520/Generated520.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest520/Generated520.il index 977da741b49ba4..2eda48bab79b68 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest520/Generated520.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest520/Generated520.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated520 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -909,6 +910,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated520::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest521/Generated521.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest521/Generated521.il index cd9b28ef2b5a9c..0d1b20d1cd7b96 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest521/Generated521.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest521/Generated521.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated521 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -936,6 +937,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated521::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest522/Generated522.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest522/Generated522.il index c9efb4002f1f75..f504969569e0d2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest522/Generated522.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest522/Generated522.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated522 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -708,6 +709,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated522::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest523/Generated523.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest523/Generated523.il index 08c5c5e27ee2a5..bd1ec7b5a054d5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest523/Generated523.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest523/Generated523.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated523 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1017,6 +1018,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated523::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest524/Generated524.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest524/Generated524.il index e3078e44b7470f..e43968e41bcb3b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest524/Generated524.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest524/Generated524.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated524 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -628,6 +629,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated524::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest525/Generated525.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest525/Generated525.il index 396386c0db02c5..cc59c35b3eb885 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest525/Generated525.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest525/Generated525.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated525 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -921,6 +922,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated525::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest526/Generated526.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest526/Generated526.il index cfcd124952d8d7..9eaf6b1d403a8b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest526/Generated526.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest526/Generated526.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated526 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1119,6 +1120,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated526::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest527/Generated527.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest527/Generated527.il index b5bceddc95e26f..9e25e444aa28ca 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest527/Generated527.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest527/Generated527.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated527 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -681,6 +682,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated527::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest528/Generated528.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest528/Generated528.il index 90ad618a560ba9..6eb261925ab6d3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest528/Generated528.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest528/Generated528.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated528 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -850,6 +851,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated528::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest529/Generated529.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest529/Generated529.il index af130bfadef7c6..8cb46422d73667 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest529/Generated529.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest529/Generated529.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated529 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1027,6 +1028,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated529::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest53/Generated53.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest53/Generated53.il index bb64141c889674..2c88911dab515b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest53/Generated53.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest53/Generated53.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated53 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1102,6 +1103,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated53::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest530/Generated530.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest530/Generated530.il index 1ee1851a50c6be..18bd6271807797 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest530/Generated530.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest530/Generated530.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated530 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -724,6 +725,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated530::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest531/Generated531.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest531/Generated531.il index 776ba15e733100..0a482f63fd368e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest531/Generated531.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest531/Generated531.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated531 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -687,6 +688,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated531::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest532/Generated532.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest532/Generated532.il index fd7aa6ac0afe48..14025d169e80e7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest532/Generated532.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest532/Generated532.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated532 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -711,6 +712,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated532::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest533/Generated533.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest533/Generated533.il index 486ed13251e85f..062a5b422c0ba3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest533/Generated533.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest533/Generated533.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated533 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1006,6 +1007,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated533::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest534/Generated534.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest534/Generated534.il index 387599a98535d5..a9eec9edb69b87 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest534/Generated534.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest534/Generated534.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated534 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -926,6 +927,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated534::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest535/Generated535.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest535/Generated535.il index c636c7482b8719..c8d585d94f0bed 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest535/Generated535.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest535/Generated535.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated535 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -711,6 +712,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated535::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest536/Generated536.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest536/Generated536.il index f0a34c474237c2..4108b5654d39d8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest536/Generated536.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest536/Generated536.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated536 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -711,6 +712,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated536::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest537/Generated537.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest537/Generated537.il index 4073f540f67616..20f3056b8c1d91 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest537/Generated537.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest537/Generated537.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated537 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -948,6 +949,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated537::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest538/Generated538.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest538/Generated538.il index 34943bca59f5e9..084748ae367228 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest538/Generated538.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest538/Generated538.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated538 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1001,6 +1002,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated538::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest539/Generated539.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest539/Generated539.il index 69ed102b15695e..cf7516abb6d03e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest539/Generated539.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest539/Generated539.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated539 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -960,6 +961,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated539::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest54/Generated54.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest54/Generated54.il index 0f9a3f44722fc2..6fc09bbbf4c682 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest54/Generated54.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest54/Generated54.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated54 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -938,6 +939,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated54::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest540/Generated540.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest540/Generated540.il index 76c4362ba02ec7..bfc25131df556f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest540/Generated540.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest540/Generated540.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated540 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -708,6 +709,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated540::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest541/Generated541.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest541/Generated541.il index 1e239bb7e6e1f1..26d38b91bb6820 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest541/Generated541.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest541/Generated541.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated541 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1076,6 +1077,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated541::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest542/Generated542.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest542/Generated542.il index 3acacd27423489..0687b1ed3fe6ab 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest542/Generated542.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest542/Generated542.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated542 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -846,6 +847,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated542::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest543/Generated543.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest543/Generated543.il index e01585b857128c..d707010a813f68 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest543/Generated543.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest543/Generated543.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated543 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1020,6 +1021,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated543::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest544/Generated544.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest544/Generated544.il index c6360927c4e230..80ac8fada420e4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest544/Generated544.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest544/Generated544.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated544 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -782,6 +783,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated544::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest545/Generated545.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest545/Generated545.il index d356cd2b7c9b00..05cdf998b2ea93 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest545/Generated545.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest545/Generated545.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated545 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -701,6 +702,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated545::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest546/Generated546.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest546/Generated546.il index 3a2f3d588926a1..cff93d09b25c3e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest546/Generated546.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest546/Generated546.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated546 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -711,6 +712,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated546::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest547/Generated547.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest547/Generated547.il index e08c9c9acccd70..baae15d542fe09 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest547/Generated547.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest547/Generated547.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated547 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -743,6 +744,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated547::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest548/Generated548.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest548/Generated548.il index 4b15dfdf1dd07d..1d025b60b15cc2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest548/Generated548.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest548/Generated548.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated548 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -979,6 +980,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated548::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest549/Generated549.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest549/Generated549.il index ce5a86c89e80fb..0b74d10402a34a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest549/Generated549.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest549/Generated549.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated549 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -858,6 +859,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated549::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest55/Generated55.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest55/Generated55.il index cad568369b30a2..bdcc698c7dd0c9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest55/Generated55.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest55/Generated55.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated55 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1009,6 +1010,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated55::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest550/Generated550.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest550/Generated550.il index 235d8cd9399f53..581f241bae1ea2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest550/Generated550.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest550/Generated550.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated550 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -811,6 +812,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated550::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest551/Generated551.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest551/Generated551.il index e05e2b66d80e27..1ab77b32e1f8bc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest551/Generated551.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest551/Generated551.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated551 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -711,6 +712,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated551::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest552/Generated552.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest552/Generated552.il index fc6cb3cc899795..639b7cfacb2443 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest552/Generated552.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest552/Generated552.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated552 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -769,6 +770,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated552::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest553/Generated553.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest553/Generated553.il index fc79742ed9ccef..7aaf298783d42d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest553/Generated553.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest553/Generated553.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated553 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1188,6 +1189,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated553::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest554/Generated554.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest554/Generated554.il index 199a4c84d75224..e10cf202bb2e91 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest554/Generated554.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest554/Generated554.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated554 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -967,6 +968,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated554::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest555/Generated555.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest555/Generated555.il index 112f7e85b84a9e..fec7ce0f58963d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest555/Generated555.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest555/Generated555.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated555 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -838,6 +839,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated555::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest556/Generated556.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest556/Generated556.il index 1cee1ad7167732..77f87f7e46308a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest556/Generated556.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest556/Generated556.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated556 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -838,6 +839,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated556::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest557/Generated557.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest557/Generated557.il index 39cc7a58e6a9d8..d46edcb933588e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest557/Generated557.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest557/Generated557.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated557 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1196,6 +1197,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated557::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest558/Generated558.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest558/Generated558.il index df1525cdac48ca..1b57fab1698d40 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest558/Generated558.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest558/Generated558.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated558 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -955,6 +956,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated558::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest559/Generated559.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest559/Generated559.il index a69f0737685943..c526dc0b266e57 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest559/Generated559.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest559/Generated559.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated559 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1249,6 +1250,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated559::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest56/Generated56.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest56/Generated56.il index 2b6eac8c5780c6..57b1b74811a456 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest56/Generated56.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest56/Generated56.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated56 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1208,6 +1209,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated56::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest560/Generated560.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest560/Generated560.il index facac08e50cd23..a739e96f278aa0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest560/Generated560.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest560/Generated560.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated560 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -833,6 +834,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated560::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest561/Generated561.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest561/Generated561.il index 806c1926915439..a450f4e269304e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest561/Generated561.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest561/Generated561.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated561 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1227,6 +1228,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated561::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest562/Generated562.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest562/Generated562.il index 4fb49c314d9f0e..a6d06147c95c72 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest562/Generated562.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest562/Generated562.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated562 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1088,6 +1089,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated562::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest563/Generated563.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest563/Generated563.il index 69065d56245967..08fca7f28fa064 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest563/Generated563.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest563/Generated563.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated563 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -974,6 +975,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated563::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest564/Generated564.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest564/Generated564.il index f0804c3558ea62..78bf02fcedaa97 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest564/Generated564.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest564/Generated564.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated564 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1133,6 +1134,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated564::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest565/Generated565.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest565/Generated565.il index 3d00dd8526bcd7..5182b47fdfb073 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest565/Generated565.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest565/Generated565.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated565 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -676,6 +677,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated565::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest566/Generated566.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest566/Generated566.il index a9800c7f925a4b..561cb2d9877c5e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest566/Generated566.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest566/Generated566.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated566 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -764,6 +765,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated566::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest567/Generated567.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest567/Generated567.il index 210ae1847cbb5f..553648a40e3cbb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest567/Generated567.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest567/Generated567.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated567 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1010,6 +1011,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated567::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest568/Generated568.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest568/Generated568.il index acabf85f2772fc..bfde21626e4d5f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest568/Generated568.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest568/Generated568.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated568 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -717,6 +718,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated568::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest569/Generated569.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest569/Generated569.il index 7252e3778ec588..93124c8c6034e3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest569/Generated569.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest569/Generated569.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated569 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -885,6 +886,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated569::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest57/Generated57.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest57/Generated57.il index c91987d4bbd871..b1e0c8ee2f2cc7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest57/Generated57.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest57/Generated57.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated57 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1070,6 +1071,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated57::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest570/Generated570.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest570/Generated570.il index f50d7ee1c62b67..436756b952840e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest570/Generated570.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest570/Generated570.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated570 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1022,6 +1023,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated570::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest571/Generated571.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest571/Generated571.il index d01bf4041abf0a..8cf15db5d49905 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest571/Generated571.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest571/Generated571.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated571 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1259,6 +1260,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated571::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest572/Generated572.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest572/Generated572.il index a4526568cf15c6..c1624477bc29d6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest572/Generated572.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest572/Generated572.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated572 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -675,6 +676,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated572::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest573/Generated573.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest573/Generated573.il index 7de0aa705bc8ba..bff1607f9357ff 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest573/Generated573.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest573/Generated573.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated573 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -977,6 +978,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated573::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest574/Generated574.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest574/Generated574.il index 5da4e9785bfcb7..c90af2ae5d96ee 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest574/Generated574.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest574/Generated574.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated574 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -828,6 +829,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated574::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest575/Generated575.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest575/Generated575.il index 3040a6adfb7f6e..1d4621437e033b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest575/Generated575.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest575/Generated575.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated575 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1292,6 +1293,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated575::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest576/Generated576.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest576/Generated576.il index 95c05f93e42bf2..9bc706927e1bda 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest576/Generated576.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest576/Generated576.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated576 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -621,6 +622,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated576::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest577/Generated577.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest577/Generated577.il index fe51559be1e8f4..90c88aa2207740 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest577/Generated577.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest577/Generated577.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated577 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -839,6 +840,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated577::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest578/Generated578.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest578/Generated578.il index 5200bac8ee5512..55f53a09442d9b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest578/Generated578.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest578/Generated578.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated578 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1001,6 +1002,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated578::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest579/Generated579.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest579/Generated579.il index 125d6cb96c4546..ea972bf8000135 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest579/Generated579.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest579/Generated579.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated579 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1133,6 +1134,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated579::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest58/Generated58.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest58/Generated58.il index 7f6005625882a4..b68cf04d0c550d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest58/Generated58.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest58/Generated58.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated58 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1138,6 +1139,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated58::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest580/Generated580.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest580/Generated580.il index e37baccc422ea2..20e4d4164af37d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest580/Generated580.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest580/Generated580.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated580 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -691,6 +692,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated580::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest581/Generated581.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest581/Generated581.il index d18ce50eb15baa..5b5b5e1f7c5bc0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest581/Generated581.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest581/Generated581.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated581 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -675,6 +676,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated581::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest582/Generated582.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest582/Generated582.il index 0a8f6e36f01843..0b70c4f601c938 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest582/Generated582.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest582/Generated582.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated582 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -882,6 +883,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated582::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest583/Generated583.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest583/Generated583.il index 607c99288bb7c5..2512af9ba74e74 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest583/Generated583.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest583/Generated583.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated583 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1001,6 +1002,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated583::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest584/Generated584.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest584/Generated584.il index 7d4ed91bb64340..591fe4ce874d67 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest584/Generated584.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest584/Generated584.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated584 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -743,6 +744,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated584::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest585/Generated585.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest585/Generated585.il index 9d5d50ae2f691d..48126975e31be2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest585/Generated585.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest585/Generated585.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated585 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -807,6 +808,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated585::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest586/Generated586.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest586/Generated586.il index 628960d0c35e00..95f02f264628fc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest586/Generated586.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest586/Generated586.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated586 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1025,6 +1026,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated586::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest587/Generated587.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest587/Generated587.il index abcb5d33a4fb63..0883d21f2b07d1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest587/Generated587.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest587/Generated587.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated587 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -892,6 +893,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated587::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest588/Generated588.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest588/Generated588.il index 36e0deb3b000ee..54670dfc414804 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest588/Generated588.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest588/Generated588.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated588 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -738,6 +739,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated588::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest589/Generated589.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest589/Generated589.il index 2537f0724f5a22..119dfc290535c5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest589/Generated589.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest589/Generated589.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated589 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -974,6 +975,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated589::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest59/Generated59.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest59/Generated59.il index dd802ab72c966b..93f6ac560f200a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest59/Generated59.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest59/Generated59.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated59 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1049,6 +1050,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated59::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest590/Generated590.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest590/Generated590.il index e47e88942ddf8b..69ea487cc9713f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest590/Generated590.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest590/Generated590.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated590 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1025,6 +1026,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated590::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest591/Generated591.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest591/Generated591.il index c984bd0f6fd6a5..b5785c5094904e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest591/Generated591.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest591/Generated591.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated591 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1011,6 +1012,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated591::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest592/Generated592.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest592/Generated592.il index ca65a220d429c1..824355b4c989de 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest592/Generated592.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest592/Generated592.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated592 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -679,6 +680,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated592::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest593/Generated593.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest593/Generated593.il index 8553f7635daa90..6f13841bdc753e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest593/Generated593.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest593/Generated593.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated593 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -823,6 +824,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated593::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest594/Generated594.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest594/Generated594.il index 48342de0f06193..f6d0878f7c5d0d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest594/Generated594.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest594/Generated594.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated594 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -750,6 +751,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated594::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest595/Generated595.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest595/Generated595.il index 7531091868b74e..4f44e54643a179 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest595/Generated595.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest595/Generated595.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated595 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -718,6 +719,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated595::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest596/Generated596.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest596/Generated596.il index 4abe242eb60d52..f04bdf05291691 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest596/Generated596.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest596/Generated596.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated596 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -706,6 +707,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated596::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest597/Generated597.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest597/Generated597.il index 3dc2e8ee11a949..4180c04bfc15be 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest597/Generated597.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest597/Generated597.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated597 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -679,6 +680,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated597::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest598/Generated598.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest598/Generated598.il index 95243bbf1b27e7..ae3769b0ec6cfc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest598/Generated598.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest598/Generated598.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated598 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1022,6 +1023,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated598::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest599/Generated599.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest599/Generated599.il index dd51e19b2fa856..11bc1507e02b4d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest599/Generated599.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest599/Generated599.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated599 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -972,6 +973,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated599::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest6/Generated6.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest6/Generated6.il index 603917f6f343a0..9e091db42321bd 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest6/Generated6.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest6/Generated6.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated6 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -503,6 +504,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated6::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest60/Generated60.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest60/Generated60.il index 1bf15bdff23638..ef16e8893023c6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest60/Generated60.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest60/Generated60.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated60 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -920,6 +921,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated60::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest600/Generated600.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest600/Generated600.il index 864b4d693e18d9..70a4d6b0012304 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest600/Generated600.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest600/Generated600.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated600 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -648,6 +649,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated600::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest601/Generated601.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest601/Generated601.il index 6210f1a57e7bed..9629dd2f95cb44 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest601/Generated601.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest601/Generated601.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated601 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1174,6 +1175,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated601::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest602/Generated602.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest602/Generated602.il index a327f1a17888f3..55a9a1347545ee 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest602/Generated602.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest602/Generated602.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated602 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -797,6 +798,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated602::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest603/Generated603.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest603/Generated603.il index b1aabae86edd9a..8303bb0e647620 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest603/Generated603.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest603/Generated603.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated603 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1098,6 +1099,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated603::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest604/Generated604.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest604/Generated604.il index 8c26107fc78d0b..ad1ba5ba7c6e7a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest604/Generated604.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest604/Generated604.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated604 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -865,6 +866,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated604::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest605/Generated605.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest605/Generated605.il index 36e8e00f84314c..c78639a8c594a1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest605/Generated605.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest605/Generated605.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated605 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1037,6 +1038,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated605::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest606/Generated606.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest606/Generated606.il index 1c1551e0a3644a..63fd2f4ba5c3d5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest606/Generated606.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest606/Generated606.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated606 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -778,6 +779,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated606::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest607/Generated607.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest607/Generated607.il index 0cc889a429af00..af9511ce4b0c15 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest607/Generated607.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest607/Generated607.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated607 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -733,6 +734,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated607::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest608/Generated608.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest608/Generated608.il index 3cb192d0567824..8313b8a8ac811f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest608/Generated608.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest608/Generated608.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated608 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -701,6 +702,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated608::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest609/Generated609.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest609/Generated609.il index 372d050cd43fb7..1e0d79b0706e06 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest609/Generated609.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest609/Generated609.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated609 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -759,6 +760,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated609::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest61/Generated61.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest61/Generated61.il index f768fe93d71b89..273f77df9bcb7f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest61/Generated61.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest61/Generated61.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated61 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -986,6 +987,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated61::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest610/Generated610.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest610/Generated610.il index 9068af7a8f6076..35d5b190f2c8f6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest610/Generated610.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest610/Generated610.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated610 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -658,6 +659,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated610::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest611/Generated611.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest611/Generated611.il index 160ed713291df5..534b782e9f3311 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest611/Generated611.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest611/Generated611.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated611 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -738,6 +739,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated611::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest612/Generated612.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest612/Generated612.il index 8f33016baee24e..a69f6f3859269d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest612/Generated612.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest612/Generated612.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated612 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2747,6 +2748,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated612::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest613/Generated613.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest613/Generated613.il index 7694a06679f629..80f60447eb5ed3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest613/Generated613.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest613/Generated613.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated613 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3351,6 +3352,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated613::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest614/Generated614.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest614/Generated614.il index 7681e4dbcd63f4..8ca74c82379ff2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest614/Generated614.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest614/Generated614.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated614 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2809,6 +2810,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated614::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest615/Generated615.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest615/Generated615.il index 4f571ec5b9f923..7a5068b5d96dd0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest615/Generated615.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest615/Generated615.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated615 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3646,6 +3647,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated615::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest616/Generated616.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest616/Generated616.il index c5cbbd8b984152..6278ccd5140d41 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest616/Generated616.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest616/Generated616.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated616 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3641,6 +3642,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated616::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest617/Generated617.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest617/Generated617.il index b6a2f0f097253c..6171597f9b951b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest617/Generated617.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest617/Generated617.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated617 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3050,6 +3051,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated617::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest618/Generated618.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest618/Generated618.il index ec27605bd46fc4..ac00f09974c0db 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest618/Generated618.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest618/Generated618.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated618 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3041,6 +3042,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated618::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest619/Generated619.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest619/Generated619.il index 08d9f25309b30e..be127b3e0b7d6c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest619/Generated619.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest619/Generated619.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated619 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2376,6 +2377,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated619::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest62/Generated62.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest62/Generated62.il index cd9f72acd63bae..f089077ce407f1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest62/Generated62.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest62/Generated62.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated62 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1019,6 +1020,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated62::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest620/Generated620.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest620/Generated620.il index cb5490627eeaef..338624c8abdb04 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest620/Generated620.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest620/Generated620.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated620 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3140,6 +3141,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated620::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest621/Generated621.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest621/Generated621.il index 21c7e41b221116..fa6e4ad793cabb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest621/Generated621.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest621/Generated621.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated621 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3315,6 +3316,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated621::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest622/Generated622.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest622/Generated622.il index d067943882358f..35942da96abdf9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest622/Generated622.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest622/Generated622.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated622 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3122,6 +3123,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated622::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest623/Generated623.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest623/Generated623.il index 1ece71e375aefa..02e6eae7c67266 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest623/Generated623.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest623/Generated623.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated623 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4025,6 +4026,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated623::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest624/Generated624.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest624/Generated624.il index a9c907045ced3c..7614b235b09e72 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest624/Generated624.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest624/Generated624.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated624 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3828,6 +3829,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated624::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest625/Generated625.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest625/Generated625.il index 5097bb8d79592b..2c7f614a1a05e3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest625/Generated625.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest625/Generated625.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated625 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3894,6 +3895,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated625::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest626/Generated626.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest626/Generated626.il index 352dbeab99d47f..d4b1d75aad5e4c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest626/Generated626.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest626/Generated626.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated626 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3416,6 +3417,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated626::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest627/Generated627.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest627/Generated627.il index 599139328f7d86..aceceb825465f1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest627/Generated627.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest627/Generated627.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated627 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3420,6 +3421,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated627::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest628/Generated628.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest628/Generated628.il index 27a6669d1e4280..55e9b761704ab5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest628/Generated628.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest628/Generated628.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated628 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4132,6 +4133,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated628::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest629/Generated629.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest629/Generated629.il index 8f5d1c5122137d..97a580e1e91180 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest629/Generated629.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest629/Generated629.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated629 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5280,6 +5281,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated629::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest63/Generated63.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest63/Generated63.il index 88519b2839610a..07ab6932d42d92 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest63/Generated63.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest63/Generated63.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated63 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -882,6 +883,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated63::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest630/Generated630.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest630/Generated630.il index 6b87b2c379a794..f72946f07414ba 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest630/Generated630.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest630/Generated630.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated630 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3584,6 +3585,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated630::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest631/Generated631.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest631/Generated631.il index 496eff233221d3..3e6757c57331d5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest631/Generated631.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest631/Generated631.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated631 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5040,6 +5041,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated631::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest632/Generated632.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest632/Generated632.il index 2b45146a66206d..b3f1b20351cd21 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest632/Generated632.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest632/Generated632.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated632 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3618,6 +3619,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated632::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest633/Generated633.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest633/Generated633.il index 523754df215c11..abb39b4641e34d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest633/Generated633.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest633/Generated633.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated633 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3032,6 +3033,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated633::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest634/Generated634.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest634/Generated634.il index ed053516f0741c..09f1869d765725 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest634/Generated634.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest634/Generated634.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated634 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4008,6 +4009,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated634::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest635/Generated635.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest635/Generated635.il index eda2a801130a37..872a358d24e79b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest635/Generated635.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest635/Generated635.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated635 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3612,6 +3613,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated635::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest636/Generated636.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest636/Generated636.il index 5e9dc3def1cc2b..8fa964442794c2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest636/Generated636.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest636/Generated636.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated636 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3081,6 +3082,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated636::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest637/Generated637.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest637/Generated637.il index c594a69f9cb5e5..e8c3ce7638fcc9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest637/Generated637.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest637/Generated637.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated637 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2899,6 +2900,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated637::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest638/Generated638.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest638/Generated638.il index cae1d779469e05..ab8278d26f595e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest638/Generated638.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest638/Generated638.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated638 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3606,6 +3607,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated638::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest639/Generated639.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest639/Generated639.il index 85d52a0cbca095..aa107def13c764 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest639/Generated639.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest639/Generated639.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated639 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3303,6 +3304,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated639::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest64/Generated64.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest64/Generated64.il index 8db434938603e9..a5ef833d161a4f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest64/Generated64.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest64/Generated64.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated64 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1022,6 +1023,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated64::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest640/Generated640.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest640/Generated640.il index a1bcc7c7c0c1ea..506088683a375c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest640/Generated640.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest640/Generated640.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated640 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4253,6 +4254,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated640::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest641/Generated641.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest641/Generated641.il index 19bdc36779e7f9..ffc6c7e8feb3ed 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest641/Generated641.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest641/Generated641.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated641 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4376,6 +4377,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated641::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest642/Generated642.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest642/Generated642.il index 578177062afdb2..9d09770318dd3b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest642/Generated642.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest642/Generated642.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated642 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4230,6 +4231,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated642::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest643/Generated643.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest643/Generated643.il index aedf61a8e1054b..ede4bd94acda72 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest643/Generated643.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest643/Generated643.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated643 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4240,6 +4241,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated643::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest644/Generated644.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest644/Generated644.il index da0c067fe17be5..93a246d23d2c33 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest644/Generated644.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest644/Generated644.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated644 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5104,6 +5105,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated644::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest645/Generated645.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest645/Generated645.il index 17737e567c33ab..bd56a7a63a3fe7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest645/Generated645.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest645/Generated645.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated645 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4619,6 +4620,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated645::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest646/Generated646.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest646/Generated646.il index af1cb95592f96e..1b90f35e981e30 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest646/Generated646.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest646/Generated646.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated646 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5149,6 +5150,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated646::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest647/Generated647.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest647/Generated647.il index e281c3c8ca5506..5b9d648f5e0326 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest647/Generated647.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest647/Generated647.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated647 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4165,6 +4166,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated647::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest648/Generated648.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest648/Generated648.il index 826fd602c6aab8..d4131e738d0bfd 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest648/Generated648.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest648/Generated648.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated648 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3665,6 +3666,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated648::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest649/Generated649.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest649/Generated649.il index 3ecc44bb6fe244..48cc0d34209be2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest649/Generated649.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest649/Generated649.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated649 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3687,6 +3688,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated649::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest65/Generated65.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest65/Generated65.il index 807e3d9a15427e..67743638ae7778 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest65/Generated65.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest65/Generated65.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated65 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1162,6 +1163,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated65::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest650/Generated650.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest650/Generated650.il index 996cc212744885..ccd77276fc4aed 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest650/Generated650.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest650/Generated650.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated650 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4321,6 +4322,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated650::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest651/Generated651.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest651/Generated651.il index 52113c55af2577..9f3d174d066081 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest651/Generated651.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest651/Generated651.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated651 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4026,6 +4027,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated651::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest652/Generated652.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest652/Generated652.il index eddb9ca3e42468..573b8995718415 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest652/Generated652.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest652/Generated652.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated652 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3510,6 +3511,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated652::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest653/Generated653.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest653/Generated653.il index 6a25e91bb716f5..824470e00dd162 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest653/Generated653.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest653/Generated653.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated653 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4024,6 +4025,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated653::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest654/Generated654.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest654/Generated654.il index 5b7aeeabd0e85e..9cb863d1e2d442 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest654/Generated654.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest654/Generated654.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated654 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3583,6 +3584,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated654::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest655/Generated655.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest655/Generated655.il index 2bef094fab8e57..a10e77dbeba604 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest655/Generated655.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest655/Generated655.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated655 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3791,6 +3792,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated655::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest656/Generated656.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest656/Generated656.il index 0348cfeff5c328..2c9571909f6fc8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest656/Generated656.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest656/Generated656.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated656 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3826,6 +3827,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated656::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest657/Generated657.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest657/Generated657.il index 8838415b02557e..bbce812a008916 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest657/Generated657.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest657/Generated657.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated657 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2914,6 +2915,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated657::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest658/Generated658.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest658/Generated658.il index c886878f8cd36f..18bdae028d546a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest658/Generated658.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest658/Generated658.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated658 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3618,6 +3619,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated658::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest659/Generated659.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest659/Generated659.il index 4caefcecd8492b..b9b699f084e270 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest659/Generated659.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest659/Generated659.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated659 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3492,6 +3493,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated659::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest66/Generated66.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest66/Generated66.il index cb0314741e092c..28b0246f2934f6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest66/Generated66.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest66/Generated66.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated66 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1024,6 +1025,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated66::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest660/Generated660.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest660/Generated660.il index 5bde0c396362c2..243fce04639794 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest660/Generated660.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest660/Generated660.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated660 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3100,6 +3101,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated660::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest661/Generated661.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest661/Generated661.il index 092e831206691d..1e70e90a6ca43c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest661/Generated661.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest661/Generated661.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated661 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3072,6 +3073,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated661::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest662/Generated662.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest662/Generated662.il index de88e20b41c602..40bb1fa019e546 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest662/Generated662.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest662/Generated662.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated662 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2931,6 +2932,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated662::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest663/Generated663.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest663/Generated663.il index ca31675863283c..38bd72e92c0e11 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest663/Generated663.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest663/Generated663.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated663 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2424,6 +2425,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated663::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest664/Generated664.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest664/Generated664.il index 0cc25dcb687583..d5c9f56ca222a8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest664/Generated664.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest664/Generated664.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated664 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3333,6 +3334,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated664::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest665/Generated665.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest665/Generated665.il index ad35e15e40fc56..42538afeaed1e2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest665/Generated665.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest665/Generated665.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated665 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2795,6 +2796,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated665::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest666/Generated666.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest666/Generated666.il index 23dcbfac3e5f0a..cfc5ccc487f4cf 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest666/Generated666.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest666/Generated666.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated666 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2750,6 +2751,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated666::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest667/Generated667.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest667/Generated667.il index d563163d4017ac..88df5ae07e52f2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest667/Generated667.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest667/Generated667.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated667 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2466,6 +2467,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated667::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest668/Generated668.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest668/Generated668.il index db547646ef9602..1ffce6a7abea92 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest668/Generated668.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest668/Generated668.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated668 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2593,6 +2594,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated668::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest669/Generated669.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest669/Generated669.il index 79d8ac8342bcbb..a7e3f20e3e2989 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest669/Generated669.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest669/Generated669.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated669 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3933,6 +3934,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated669::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest67/Generated67.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest67/Generated67.il index 78e4074ddf3c25..6d5c71111a04cb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest67/Generated67.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest67/Generated67.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated67 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1077,6 +1078,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated67::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest670/Generated670.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest670/Generated670.il index 887a2098ad4040..a518381dc37b99 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest670/Generated670.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest670/Generated670.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated670 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3244,6 +3245,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated670::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest671/Generated671.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest671/Generated671.il index 31c6d5190b26ee..07bfb0030db296 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest671/Generated671.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest671/Generated671.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated671 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4327,6 +4328,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated671::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest672/Generated672.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest672/Generated672.il index 3c6863e64fd266..21c9960f9275d1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest672/Generated672.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest672/Generated672.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated672 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3591,6 +3592,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated672::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest673/Generated673.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest673/Generated673.il index c41ab62e56a454..61fbf6163181ce 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest673/Generated673.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest673/Generated673.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated673 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4580,6 +4581,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated673::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest674/Generated674.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest674/Generated674.il index 2c7d4aa4892a1a..835eba8a4e5993 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest674/Generated674.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest674/Generated674.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated674 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3812,6 +3813,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated674::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest675/Generated675.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest675/Generated675.il index 567372516de96f..12aaa326480738 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest675/Generated675.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest675/Generated675.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated675 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4258,6 +4259,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated675::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest676/Generated676.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest676/Generated676.il index 03eb37f8c25872..40f6d0428345f1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest676/Generated676.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest676/Generated676.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated676 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4554,6 +4555,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated676::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest677/Generated677.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest677/Generated677.il index fac8927002cb4d..36076b9fe8413d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest677/Generated677.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest677/Generated677.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated677 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2520,6 +2521,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated677::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest678/Generated678.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest678/Generated678.il index ec383bd6e9bbaa..8a1024586c4ec7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest678/Generated678.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest678/Generated678.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated678 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3000,6 +3001,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated678::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest679/Generated679.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest679/Generated679.il index f8a6b4f21b08c9..5f7aafcf0e9bd1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest679/Generated679.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest679/Generated679.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated679 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2736,6 +2737,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated679::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest68/Generated68.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest68/Generated68.il index 8b3ac4339cf8a3..8e4f2fdc9e272a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest68/Generated68.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest68/Generated68.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated68 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1082,6 +1083,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated68::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest680/Generated680.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest680/Generated680.il index 5551fabb0ad638..c77b4daa77151e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest680/Generated680.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest680/Generated680.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated680 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1616,6 +1617,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated680::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest681/Generated681.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest681/Generated681.il index 8ad11b5243423f..2dd98ee45c47c2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest681/Generated681.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest681/Generated681.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated681 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3105,6 +3106,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated681::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest682/Generated682.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest682/Generated682.il index 0dba2d87f846d5..cba7b1c4629e97 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest682/Generated682.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest682/Generated682.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated682 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3150,6 +3151,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated682::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest683/Generated683.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest683/Generated683.il index 1e1978b44aec18..fd28650d707aed 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest683/Generated683.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest683/Generated683.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated683 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3107,6 +3108,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated683::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest684/Generated684.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest684/Generated684.il index 1470ae3ec25833..05d345ab6e5903 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest684/Generated684.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest684/Generated684.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated684 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3329,6 +3330,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated684::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest685/Generated685.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest685/Generated685.il index 0a02da197f56f8..6f3eb8ca699593 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest685/Generated685.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest685/Generated685.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated685 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2735,6 +2736,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated685::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest686/Generated686.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest686/Generated686.il index 47170492ad1176..014a49625aa264 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest686/Generated686.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest686/Generated686.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated686 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2845,6 +2846,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated686::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest687/Generated687.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest687/Generated687.il index a31ee58055a974..f5422ab88dd2c9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest687/Generated687.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest687/Generated687.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated687 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3954,6 +3955,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated687::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest688/Generated688.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest688/Generated688.il index d1eadce171cc1a..0dda432c76f16a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest688/Generated688.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest688/Generated688.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated688 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3202,6 +3203,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated688::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest689/Generated689.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest689/Generated689.il index c028896c2a53cf..4283e690d797ba 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest689/Generated689.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest689/Generated689.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated689 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3062,6 +3063,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated689::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest69/Generated69.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest69/Generated69.il index 329b4417a611b1..b4adb7d5c03cf6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest69/Generated69.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest69/Generated69.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated69 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1064,6 +1065,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated69::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest690/Generated690.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest690/Generated690.il index abd5dde163dd84..a35af5f8fc250e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest690/Generated690.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest690/Generated690.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated690 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3686,6 +3687,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated690::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest691/Generated691.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest691/Generated691.il index 3812e267686bc3..c342db39755db3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest691/Generated691.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest691/Generated691.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated691 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2644,6 +2645,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated691::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest692/Generated692.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest692/Generated692.il index 636f2fc7cddf70..bd8cbdda5fd56c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest692/Generated692.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest692/Generated692.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated692 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3715,6 +3716,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated692::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest693/Generated693.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest693/Generated693.il index 04b8a7c0c10ebd..c2c12e37f4969c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest693/Generated693.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest693/Generated693.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated693 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3186,6 +3187,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated693::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest694/Generated694.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest694/Generated694.il index 41adc30464f9c5..ccc8854c31099b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest694/Generated694.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest694/Generated694.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated694 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3052,6 +3053,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated694::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest695/Generated695.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest695/Generated695.il index af9b33dea69df5..648954e0cf0d3e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest695/Generated695.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest695/Generated695.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated695 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3499,6 +3500,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated695::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest696/Generated696.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest696/Generated696.il index 1418170810975b..90567c7d9b27fa 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest696/Generated696.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest696/Generated696.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated696 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2456,6 +2457,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated696::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest697/Generated697.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest697/Generated697.il index 1c88ad71489bb0..ebe81db23d7498 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest697/Generated697.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest697/Generated697.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated697 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3739,6 +3740,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated697::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest698/Generated698.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest698/Generated698.il index fd19a6b6fe9c2c..6d6ac851385188 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest698/Generated698.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest698/Generated698.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated698 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3651,6 +3652,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated698::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest699/Generated699.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest699/Generated699.il index 8e20c63c9bea5a..2243c1fb4fa1cc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest699/Generated699.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest699/Generated699.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated699 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4052,6 +4053,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated699::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest7/Generated7.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest7/Generated7.il index 1604126857a686..e13a2da4dedc3d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest7/Generated7.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest7/Generated7.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated7 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -596,6 +597,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated7::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest70/Generated70.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest70/Generated70.il index 1ce4b93963c03f..6ed3a8a2733e6a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest70/Generated70.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest70/Generated70.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated70 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1019,6 +1020,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated70::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest700/Generated700.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest700/Generated700.il index 555ca0d0954160..221319577b443c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest700/Generated700.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest700/Generated700.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated700 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3978,6 +3979,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated700::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest701/Generated701.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest701/Generated701.il index 63c508ef158b4d..1082b795b7e088 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest701/Generated701.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest701/Generated701.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated701 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3999,6 +4000,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated701::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest702/Generated702.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest702/Generated702.il index 7e6d6ac8d81542..e1192dab0fc936 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest702/Generated702.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest702/Generated702.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated702 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4040,6 +4041,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated702::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest703/Generated703.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest703/Generated703.il index 24e630d2154377..bce1895e605a35 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest703/Generated703.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest703/Generated703.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated703 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4500,6 +4501,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated703::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest704/Generated704.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest704/Generated704.il index c40bd62b821b99..a253e987fe6edb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest704/Generated704.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest704/Generated704.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated704 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4081,6 +4082,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated704::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest705/Generated705.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest705/Generated705.il index 1bdcb2590b6d5f..48ed3644ee7ae6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest705/Generated705.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest705/Generated705.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated705 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3916,6 +3917,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated705::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest706/Generated706.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest706/Generated706.il index cd64c3f010c3d7..eb877fe45eff41 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest706/Generated706.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest706/Generated706.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated706 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5038,6 +5039,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated706::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest707/Generated707.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest707/Generated707.il index a63d19ad485449..0b932d4b8d3fd9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest707/Generated707.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest707/Generated707.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated707 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4125,6 +4126,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated707::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest708/Generated708.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest708/Generated708.il index f380eeb7862a10..dcd75965a197e4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest708/Generated708.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest708/Generated708.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated708 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4531,6 +4532,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated708::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest709/Generated709.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest709/Generated709.il index 7f1c1524a28e90..31b1b86510a373 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest709/Generated709.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest709/Generated709.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated709 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5493,6 +5494,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated709::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest71/Generated71.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest71/Generated71.il index 14e7a248466176..8dd980bb00ddfd 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest71/Generated71.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest71/Generated71.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated71 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1022,6 +1023,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated71::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest710/Generated710.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest710/Generated710.il index 435e3437a7a976..c13d0f24c1974c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest710/Generated710.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest710/Generated710.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated710 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4428,6 +4429,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated710::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest711/Generated711.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest711/Generated711.il index 239bcc9ea2109b..b474d2cd6bc701 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest711/Generated711.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest711/Generated711.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated711 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4704,6 +4705,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated711::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest712/Generated712.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest712/Generated712.il index 19fc14fa44c3e9..5c1d532444ffbd 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest712/Generated712.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest712/Generated712.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated712 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4337,6 +4338,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated712::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest713/Generated713.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest713/Generated713.il index 5f5500149f4b97..0fe9abc74ce46e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest713/Generated713.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest713/Generated713.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated713 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4319,6 +4320,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated713::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest714/Generated714.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest714/Generated714.il index cf666f61883f4b..871b246a81468d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest714/Generated714.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest714/Generated714.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated714 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2861,6 +2862,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated714::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest715/Generated715.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest715/Generated715.il index 08ec704479b5f2..5208ce154ab690 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest715/Generated715.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest715/Generated715.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated715 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4164,6 +4165,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated715::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest716/Generated716.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest716/Generated716.il index 972d5ac435069a..597def11d2acd9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest716/Generated716.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest716/Generated716.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated716 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4964,6 +4965,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated716::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest717/Generated717.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest717/Generated717.il index b25ea1668548fa..ad49d155478d35 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest717/Generated717.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest717/Generated717.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated717 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5758,6 +5759,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated717::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest718/Generated718.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest718/Generated718.il index 5ae445163042a5..0dec2afe70e2d7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest718/Generated718.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest718/Generated718.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated718 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5775,6 +5776,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated718::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest719/Generated719.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest719/Generated719.il index 8eb762394088d4..7f1e2c88f886ac 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest719/Generated719.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest719/Generated719.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated719 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5658,6 +5659,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated719::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest72/Generated72.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest72/Generated72.il index d2e336d42209ac..d094b3d053f4f5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest72/Generated72.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest72/Generated72.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated72 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1091,6 +1092,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated72::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest720/Generated720.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest720/Generated720.il index 58879aeea1f606..e81a58f0ee69cd 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest720/Generated720.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest720/Generated720.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated720 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5532,6 +5533,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated720::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest721/Generated721.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest721/Generated721.il index 93c55ca7dea1ea..a41851d56dc10f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest721/Generated721.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest721/Generated721.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated721 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4866,6 +4867,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated721::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest722/Generated722.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest722/Generated722.il index bea20e31a660ac..3e2efadf4f8d5a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest722/Generated722.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest722/Generated722.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated722 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5067,6 +5068,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated722::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest723/Generated723.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest723/Generated723.il index 6cd49010346188..0198c68bd229c6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest723/Generated723.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest723/Generated723.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated723 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5105,6 +5106,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated723::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest724/Generated724.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest724/Generated724.il index de9d71d6add7a8..4063cbdbced796 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest724/Generated724.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest724/Generated724.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated724 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4492,6 +4493,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated724::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest725/Generated725.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest725/Generated725.il index 2feb1524e8f224..18b5c4a168e965 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest725/Generated725.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest725/Generated725.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated725 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4656,6 +4657,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated725::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest726/Generated726.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest726/Generated726.il index 0e1bfdb7fcfd4a..d6c08b75ab2b48 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest726/Generated726.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest726/Generated726.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated726 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3459,6 +3460,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated726::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest727/Generated727.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest727/Generated727.il index 721667471c1204..88801c4e64ef59 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest727/Generated727.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest727/Generated727.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated727 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3280,6 +3281,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated727::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest728/Generated728.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest728/Generated728.il index d569f750bef4f0..ce3d4cce0e37a2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest728/Generated728.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest728/Generated728.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated728 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5185,6 +5186,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated728::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest729/Generated729.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest729/Generated729.il index 990fe99b87a48a..b193bbaaa68478 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest729/Generated729.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest729/Generated729.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated729 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3144,6 +3145,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated729::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest73/Generated73.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest73/Generated73.il index 42471e08e0ef6d..3c563b3715abbb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest73/Generated73.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest73/Generated73.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated73 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1011,6 +1012,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated73::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest730/Generated730.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest730/Generated730.il index fb13279946181c..a47ed8242c5a9b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest730/Generated730.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest730/Generated730.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated730 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2992,6 +2993,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated730::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest731/Generated731.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest731/Generated731.il index f0eb2cb09b9cdc..4b336af3e5f01d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest731/Generated731.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest731/Generated731.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated731 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3209,6 +3210,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated731::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest732/Generated732.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest732/Generated732.il index 37aecc32de022e..e7998e574a8d1d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest732/Generated732.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest732/Generated732.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated732 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3240,6 +3241,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated732::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest733/Generated733.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest733/Generated733.il index cf2ea737f41429..8c096c15715d4b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest733/Generated733.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest733/Generated733.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated733 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3264,6 +3265,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated733::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest734/Generated734.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest734/Generated734.il index ed351ff8303d11..560aa5b85cd811 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest734/Generated734.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest734/Generated734.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated734 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3144,6 +3145,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated734::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest735/Generated735.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest735/Generated735.il index 1a25393520e5bc..4d5a279381f9bc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest735/Generated735.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest735/Generated735.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated735 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4690,6 +4691,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated735::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest736/Generated736.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest736/Generated736.il index 9cd767adb245d9..ce49b9d2211bbc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest736/Generated736.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest736/Generated736.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated736 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4611,6 +4612,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated736::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest737/Generated737.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest737/Generated737.il index b6127bf426b659..a73636894d9c15 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest737/Generated737.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest737/Generated737.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated737 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4634,6 +4635,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated737::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest738/Generated738.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest738/Generated738.il index 75d25b8ec767ad..7d0ba4cfddc7dd 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest738/Generated738.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest738/Generated738.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated738 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4022,6 +4023,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated738::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest739/Generated739.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest739/Generated739.il index fc586aee9c2347..25ed6883c25848 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest739/Generated739.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest739/Generated739.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated739 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3986,6 +3987,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated739::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest74/Generated74.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest74/Generated74.il index 62795152c8b8c1..0d72545a4c9539 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest74/Generated74.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest74/Generated74.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated74 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -932,6 +933,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated74::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest740/Generated740.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest740/Generated740.il index 7e5a2285b437cc..a63052f03c66c1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest740/Generated740.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest740/Generated740.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated740 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3848,6 +3849,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated740::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest741/Generated741.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest741/Generated741.il index f4b16f8e2f1375..6074830252e997 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest741/Generated741.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest741/Generated741.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated741 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3809,6 +3810,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated741::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest742/Generated742.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest742/Generated742.il index 1532755d2b474d..a36c4a6a624e9f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest742/Generated742.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest742/Generated742.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated742 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4431,6 +4432,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated742::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest743/Generated743.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest743/Generated743.il index 2a38e072be3f2d..2bd708380a80bc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest743/Generated743.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest743/Generated743.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated743 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3847,6 +3848,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated743::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest744/Generated744.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest744/Generated744.il index 266775cd891827..c3ed833851858f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest744/Generated744.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest744/Generated744.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated744 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3829,6 +3830,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated744::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest745/Generated745.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest745/Generated745.il index 55d69be7d55460..35f9abc346827d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest745/Generated745.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest745/Generated745.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated745 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4172,6 +4173,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated745::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest746/Generated746.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest746/Generated746.il index b7f7f4ac9af5b7..98c1bd3b69553e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest746/Generated746.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest746/Generated746.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated746 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3177,6 +3178,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated746::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest747/Generated747.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest747/Generated747.il index fcbf094241707c..bda53a4be63eb9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest747/Generated747.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest747/Generated747.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated747 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3067,6 +3068,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated747::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest748/Generated748.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest748/Generated748.il index a1f81ac81a8e5c..83a1be657be193 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest748/Generated748.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest748/Generated748.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated748 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3047,6 +3048,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated748::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest749/Generated749.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest749/Generated749.il index 121c69e7cc0f48..5cb9a5df50ac22 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest749/Generated749.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest749/Generated749.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated749 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4360,6 +4361,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated749::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest75/Generated75.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest75/Generated75.il index c20a5348fdea51..14736ed012d1cb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest75/Generated75.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest75/Generated75.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated75 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -969,6 +970,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated75::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest750/Generated750.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest750/Generated750.il index 42e4cc291bb09f..4859d230125888 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest750/Generated750.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest750/Generated750.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated750 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3922,6 +3923,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated750::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest751/Generated751.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest751/Generated751.il index 0107274ec93b83..4da40bca7db69c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest751/Generated751.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest751/Generated751.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated751 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4042,6 +4043,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated751::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest752/Generated752.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest752/Generated752.il index a27735edee5831..3f8ef922617882 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest752/Generated752.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest752/Generated752.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated752 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3687,6 +3688,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated752::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest753/Generated753.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest753/Generated753.il index 3232b2bd4f73ee..4422e8569f7afe 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest753/Generated753.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest753/Generated753.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated753 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4016,6 +4017,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated753::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest754/Generated754.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest754/Generated754.il index 5cf4839bd89757..f9c0b3a7d68661 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest754/Generated754.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest754/Generated754.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated754 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2972,6 +2973,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated754::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest755/Generated755.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest755/Generated755.il index 030427f4427bda..cdf20c001b983a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest755/Generated755.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest755/Generated755.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated755 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2614,6 +2615,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated755::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest756/Generated756.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest756/Generated756.il index 3245a5cf8e596c..1d0b7248136db2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest756/Generated756.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest756/Generated756.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated756 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2454,6 +2455,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated756::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest757/Generated757.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest757/Generated757.il index b56aa19e10dba1..9d31b56f7d56c5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest757/Generated757.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest757/Generated757.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated757 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2513,6 +2514,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated757::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest758/Generated758.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest758/Generated758.il index 756f55b8e766fa..4d8d3d1aa7c530 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest758/Generated758.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest758/Generated758.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated758 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2571,6 +2572,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated758::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest759/Generated759.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest759/Generated759.il index f77714b5442f1f..e755779ebc1d2a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest759/Generated759.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest759/Generated759.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated759 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2787,6 +2788,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated759::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest76/Generated76.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest76/Generated76.il index 1d3688d0cfdc76..ae39fd31b86294 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest76/Generated76.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest76/Generated76.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated76 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -943,6 +944,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated76::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest760/Generated760.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest760/Generated760.il index ebd1e431aefaed..aa147afbbce7c1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest760/Generated760.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest760/Generated760.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated760 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3199,6 +3200,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated760::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest761/Generated761.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest761/Generated761.il index 7d986f1feb0e2a..fdf567ae24b528 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest761/Generated761.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest761/Generated761.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated761 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4097,6 +4098,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated761::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest762/Generated762.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest762/Generated762.il index 830b0ee3a469b4..77a80768de6ac0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest762/Generated762.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest762/Generated762.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated762 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3745,6 +3746,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated762::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest763/Generated763.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest763/Generated763.il index 86921c64a96038..b37db85d7bd739 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest763/Generated763.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest763/Generated763.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated763 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3746,6 +3747,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated763::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest764/Generated764.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest764/Generated764.il index 0d0c71ae80ff29..0311bfcd69bf4d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest764/Generated764.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest764/Generated764.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated764 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4484,6 +4485,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated764::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest765/Generated765.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest765/Generated765.il index 5fa4061ed5ecde..245671d8d326ca 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest765/Generated765.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest765/Generated765.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated765 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3775,6 +3776,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated765::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest766/Generated766.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest766/Generated766.il index 44e6b3421144ce..0072d875713315 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest766/Generated766.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest766/Generated766.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated766 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3454,6 +3455,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated766::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest767/Generated767.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest767/Generated767.il index 803e5cfc7590ed..dfc51dc4a5b77a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest767/Generated767.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest767/Generated767.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated767 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4099,6 +4100,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated767::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest768/Generated768.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest768/Generated768.il index b9715d52b9f9ba..0be97be6f2944b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest768/Generated768.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest768/Generated768.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated768 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3975,6 +3976,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated768::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest769/Generated769.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest769/Generated769.il index c59925fd182a10..7aab723beb9205 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest769/Generated769.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest769/Generated769.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated769 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2832,6 +2833,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated769::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest77/Generated77.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest77/Generated77.il index 5dfa9b5f3f5f9c..6c63eb41ff027c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest77/Generated77.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest77/Generated77.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated77 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -941,6 +942,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated77::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest770/Generated770.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest770/Generated770.il index c9ee001e52c9e3..5ca0070adebdcb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest770/Generated770.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest770/Generated770.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated770 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2864,6 +2865,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated770::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest771/Generated771.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest771/Generated771.il index 8efb2ac562cb83..395dc5ee79a5aa 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest771/Generated771.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest771/Generated771.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated771 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2690,6 +2691,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated771::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest772/Generated772.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest772/Generated772.il index c461183eb1323a..2ddaa87f0ceee1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest772/Generated772.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest772/Generated772.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated772 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3128,6 +3129,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated772::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest773/Generated773.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest773/Generated773.il index e856e1f121f717..642e53a7ebb5d7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest773/Generated773.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest773/Generated773.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated773 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2901,6 +2902,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated773::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest774/Generated774.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest774/Generated774.il index 0db7ae41e0f39d..912e44545c0765 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest774/Generated774.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest774/Generated774.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated774 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3831,6 +3832,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated774::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest775/Generated775.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest775/Generated775.il index 512f8dc9492d96..ac3079af3b0ba2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest775/Generated775.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest775/Generated775.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated775 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2231,6 +2232,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated775::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest776/Generated776.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest776/Generated776.il index d7c6e787b04cbd..8ecb539208ea14 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest776/Generated776.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest776/Generated776.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated776 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2640,6 +2641,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated776::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest777/Generated777.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest777/Generated777.il index 7593c782e70cb9..cf0bd482ac063e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest777/Generated777.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest777/Generated777.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated777 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2925,6 +2926,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated777::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest778/Generated778.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest778/Generated778.il index 1286196c88fba3..706f73f141a976 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest778/Generated778.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest778/Generated778.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated778 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4093,6 +4094,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated778::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest779/Generated779.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest779/Generated779.il index 4692cfdbcee384..5b19cda3eea7a0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest779/Generated779.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest779/Generated779.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated779 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4047,6 +4048,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated779::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest78/Generated78.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest78/Generated78.il index c6bfde36c0db87..2d8ac454016419 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest78/Generated78.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest78/Generated78.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated78 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1052,6 +1053,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated78::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest780/Generated780.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest780/Generated780.il index c160d12d3eca96..8e16e1f52047b7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest780/Generated780.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest780/Generated780.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated780 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4111,6 +4112,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated780::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest781/Generated781.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest781/Generated781.il index 1b7ad68346341c..ad4dffb85da030 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest781/Generated781.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest781/Generated781.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated781 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3674,6 +3675,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated781::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest782/Generated782.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest782/Generated782.il index 91289fa917397d..ba68cdf0c77484 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest782/Generated782.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest782/Generated782.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated782 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2981,6 +2982,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated782::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest783/Generated783.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest783/Generated783.il index e45b9e7143f787..6926d77a030312 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest783/Generated783.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest783/Generated783.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated783 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2939,6 +2940,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated783::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest784/Generated784.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest784/Generated784.il index af921a386900a9..239df628907c21 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest784/Generated784.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest784/Generated784.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated784 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3781,6 +3782,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated784::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest785/Generated785.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest785/Generated785.il index 57a754531ecabe..1c0513bb116976 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest785/Generated785.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest785/Generated785.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated785 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4430,6 +4431,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated785::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest786/Generated786.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest786/Generated786.il index 3c22526cc01278..679238fb2363da 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest786/Generated786.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest786/Generated786.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated786 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4005,6 +4006,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated786::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest787/Generated787.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest787/Generated787.il index de59cefcb461bc..a44533f46259c5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest787/Generated787.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest787/Generated787.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated787 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4060,6 +4061,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated787::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest788/Generated788.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest788/Generated788.il index 4c32430792871f..c9198337a2f36f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest788/Generated788.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest788/Generated788.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated788 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3259,6 +3260,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated788::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest789/Generated789.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest789/Generated789.il index 3adf90ce1ee84a..1b76c3b7f5b3c4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest789/Generated789.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest789/Generated789.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated789 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3089,6 +3090,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated789::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest79/Generated79.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest79/Generated79.il index 6c2259610c1f75..fb28b1dbd8c4be 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest79/Generated79.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest79/Generated79.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated79 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -994,6 +995,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated79::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest790/Generated790.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest790/Generated790.il index 8e07585d25c861..e915e18d6dea1b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest790/Generated790.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest790/Generated790.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated790 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2763,6 +2764,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated790::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest791/Generated791.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest791/Generated791.il index 4a109630606b0a..2aa627db7d2cfa 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest791/Generated791.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest791/Generated791.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated791 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4314,6 +4315,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated791::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest792/Generated792.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest792/Generated792.il index 94bbcb442cf61b..d4953c615c381f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest792/Generated792.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest792/Generated792.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated792 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4627,6 +4628,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated792::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest793/Generated793.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest793/Generated793.il index d7324ecb60f964..623e647e6d6e94 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest793/Generated793.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest793/Generated793.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated793 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3377,6 +3378,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated793::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest794/Generated794.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest794/Generated794.il index 000bb84bb8abfc..add35c38db00c8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest794/Generated794.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest794/Generated794.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated794 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3409,6 +3410,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated794::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest795/Generated795.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest795/Generated795.il index 4adff4c072c329..43d49d8a818cdb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest795/Generated795.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest795/Generated795.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated795 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2887,6 +2888,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated795::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest796/Generated796.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest796/Generated796.il index 68b5ccf88031ca..5214c08a0ddbee 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest796/Generated796.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest796/Generated796.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated796 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3302,6 +3303,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated796::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest797/Generated797.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest797/Generated797.il index 68dd1019a47ced..ed7fac950cea81 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest797/Generated797.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest797/Generated797.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated797 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2881,6 +2882,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated797::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest798/Generated798.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest798/Generated798.il index 8e09241adf4b72..04aa787250e4e8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest798/Generated798.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest798/Generated798.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated798 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3806,6 +3807,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated798::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest799/Generated799.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest799/Generated799.il index 4bdb64d5801599..c11fde72853fbe 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest799/Generated799.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest799/Generated799.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated799 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3850,6 +3851,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated799::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest8/Generated8.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest8/Generated8.il index e59b069b3f5e0c..fde316f50fcfa9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest8/Generated8.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest8/Generated8.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated8 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -709,6 +710,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated8::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest80/Generated80.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest80/Generated80.il index a1694e904b0c28..359e1e0b3067ef 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest80/Generated80.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest80/Generated80.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated80 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1059,6 +1060,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated80::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest800/Generated800.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest800/Generated800.il index 3c4a1621114365..bd3000998077f1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest800/Generated800.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest800/Generated800.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated800 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3804,6 +3805,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated800::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest801/Generated801.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest801/Generated801.il index cf9ac94fb61663..d26ac932d038c8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest801/Generated801.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest801/Generated801.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated801 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4038,6 +4039,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated801::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest802/Generated802.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest802/Generated802.il index 71f6e49c7fd5a3..e3d80bf9ac53d9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest802/Generated802.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest802/Generated802.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated802 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3817,6 +3818,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated802::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest803/Generated803.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest803/Generated803.il index 637934a47dc946..e715abd1730e57 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest803/Generated803.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest803/Generated803.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated803 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2864,6 +2865,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated803::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest804/Generated804.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest804/Generated804.il index f53be9c9dba7c0..78886184342e46 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest804/Generated804.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest804/Generated804.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated804 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2440,6 +2441,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated804::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest805/Generated805.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest805/Generated805.il index 335a2b6e3fa4b7..0da42aaa15bb12 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest805/Generated805.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest805/Generated805.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated805 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4809,6 +4810,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated805::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest806/Generated806.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest806/Generated806.il index 9957fddf2b6562..5aff32511ac2b8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest806/Generated806.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest806/Generated806.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated806 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4462,6 +4463,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated806::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest807/Generated807.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest807/Generated807.il index 27b5693b0969fb..99ac6b97c7a9e9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest807/Generated807.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest807/Generated807.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated807 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4535,6 +4536,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated807::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest808/Generated808.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest808/Generated808.il index 9c06784a50e69a..1ed174642dc6e2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest808/Generated808.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest808/Generated808.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated808 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5141,6 +5142,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated808::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest809/Generated809.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest809/Generated809.il index f496b3e2b694c3..8dff035cdd7f4e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest809/Generated809.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest809/Generated809.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated809 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4992,6 +4993,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated809::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest81/Generated81.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest81/Generated81.il index c656a950fff8e5..1389c60907c5ad 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest81/Generated81.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest81/Generated81.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated81 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1239,6 +1240,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated81::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest810/Generated810.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest810/Generated810.il index 6ce88ac685dd75..b2ace9f402ffe5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest810/Generated810.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest810/Generated810.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated810 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4985,6 +4986,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated810::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest811/Generated811.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest811/Generated811.il index 09d4dbfc76189e..c16e21e5c3bf21 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest811/Generated811.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest811/Generated811.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated811 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4935,6 +4936,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated811::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest812/Generated812.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest812/Generated812.il index 0108cf3b7d3fbd..a77f965db34afa 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest812/Generated812.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest812/Generated812.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated812 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2709,6 +2710,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated812::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest813/Generated813.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest813/Generated813.il index 8bedc30e2346b8..4427756350d57b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest813/Generated813.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest813/Generated813.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated813 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2707,6 +2708,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated813::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest814/Generated814.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest814/Generated814.il index 6570829db63de2..90c37f30dd4c94 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest814/Generated814.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest814/Generated814.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated814 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2667,6 +2668,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated814::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest815/Generated815.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest815/Generated815.il index 6b6277a2932743..97c60f4487ecb6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest815/Generated815.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest815/Generated815.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated815 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5846,6 +5847,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated815::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest816/Generated816.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest816/Generated816.il index 69a201cf2c5f66..b4526d570670be 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest816/Generated816.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest816/Generated816.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated816 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5858,6 +5859,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated816::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest817/Generated817.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest817/Generated817.il index 657133a6d51c3b..d62879418e6380 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest817/Generated817.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest817/Generated817.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated817 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5723,6 +5724,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated817::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest818/Generated818.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest818/Generated818.il index bdf0d48e059f72..2c819c0141e690 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest818/Generated818.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest818/Generated818.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated818 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4696,6 +4697,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated818::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest819/Generated819.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest819/Generated819.il index a5d76a335b954b..e386add735d786 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest819/Generated819.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest819/Generated819.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated819 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4789,6 +4790,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated819::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest82/Generated82.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest82/Generated82.il index b774efdf69330e..3e721a432f17bc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest82/Generated82.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest82/Generated82.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated82 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1144,6 +1145,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated82::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest820/Generated820.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest820/Generated820.il index 6d728003b9b1fc..96cf95d28980d4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest820/Generated820.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest820/Generated820.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated820 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4864,6 +4865,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated820::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest821/Generated821.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest821/Generated821.il index 7ad14b633c5d4b..55c037fe737ad6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest821/Generated821.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest821/Generated821.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated821 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5677,6 +5678,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated821::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest822/Generated822.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest822/Generated822.il index cf879bcedab899..e1a4b351f1b020 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest822/Generated822.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest822/Generated822.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated822 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3959,6 +3960,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated822::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest823/Generated823.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest823/Generated823.il index 55b847a5c8ff3b..814084539eb269 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest823/Generated823.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest823/Generated823.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated823 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4427,6 +4428,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated823::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest824/Generated824.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest824/Generated824.il index e9d7104e3893f2..2ca7edb6cfc785 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest824/Generated824.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest824/Generated824.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated824 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4327,6 +4328,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated824::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest825/Generated825.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest825/Generated825.il index 7013b97f9d44cd..58b9f2a96ecae2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest825/Generated825.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest825/Generated825.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated825 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4468,6 +4469,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated825::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest826/Generated826.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest826/Generated826.il index 2b397b9aa10b8c..9fd8b5434e7432 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest826/Generated826.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest826/Generated826.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated826 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4769,6 +4770,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated826::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest827/Generated827.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest827/Generated827.il index 348ccf317a9c4d..33804cbb0be6bc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest827/Generated827.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest827/Generated827.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated827 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4859,6 +4860,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated827::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest828/Generated828.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest828/Generated828.il index e26d76ab53ffbf..a585ac4a43080a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest828/Generated828.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest828/Generated828.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated828 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4901,6 +4902,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated828::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest829/Generated829.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest829/Generated829.il index b5aff84517a939..90104ba199331d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest829/Generated829.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest829/Generated829.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated829 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4837,6 +4838,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated829::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest83/Generated83.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest83/Generated83.il index c7db510885a551..511da377581f03 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest83/Generated83.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest83/Generated83.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated83 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -916,6 +917,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated83::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest830/Generated830.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest830/Generated830.il index 863c8828aa4556..3dad0c37828626 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest830/Generated830.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest830/Generated830.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated830 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5215,6 +5216,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated830::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest831/Generated831.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest831/Generated831.il index d0e1f7192243cb..9e67ffa4d16795 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest831/Generated831.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest831/Generated831.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated831 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4563,6 +4564,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated831::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest832/Generated832.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest832/Generated832.il index 0efa29880223b0..b76c51213c2719 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest832/Generated832.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest832/Generated832.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated832 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4955,6 +4956,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated832::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest833/Generated833.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest833/Generated833.il index d3d0c9313ef59e..443ac146780443 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest833/Generated833.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest833/Generated833.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated833 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4669,6 +4670,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated833::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest834/Generated834.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest834/Generated834.il index 45a39929ed09f3..bec2b3fc332bbf 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest834/Generated834.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest834/Generated834.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated834 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4824,6 +4825,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated834::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest835/Generated835.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest835/Generated835.il index 336b27702c63d8..86e967a61eff87 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest835/Generated835.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest835/Generated835.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated835 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4723,6 +4724,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated835::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest836/Generated836.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest836/Generated836.il index 44cc34e2ade025..06156738be9ed3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest836/Generated836.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest836/Generated836.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated836 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4331,6 +4332,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated836::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest837/Generated837.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest837/Generated837.il index e03cd2ddbf0f60..a137d41eee1973 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest837/Generated837.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest837/Generated837.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated837 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5015,6 +5016,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated837::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest838/Generated838.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest838/Generated838.il index b397648e659601..2395b4c4d5ee78 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest838/Generated838.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest838/Generated838.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated838 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5176,6 +5177,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated838::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest839/Generated839.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest839/Generated839.il index 1be14d404a4a33..932e47593861a3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest839/Generated839.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest839/Generated839.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated839 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4324,6 +4325,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated839::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest84/Generated84.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest84/Generated84.il index 654021712785b1..932ae313b9b300 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest84/Generated84.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest84/Generated84.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated84 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1160,6 +1161,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated84::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest840/Generated840.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest840/Generated840.il index 16b54298d98650..6ff4b0d1239e3e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest840/Generated840.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest840/Generated840.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated840 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4476,6 +4477,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated840::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest841/Generated841.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest841/Generated841.il index 3821c829bbf4ec..e1820c606bdbb9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest841/Generated841.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest841/Generated841.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated841 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4576,6 +4577,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated841::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest842/Generated842.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest842/Generated842.il index ff95a158e99c80..ce4e7865d67fc9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest842/Generated842.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest842/Generated842.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated842 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4472,6 +4473,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated842::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest843/Generated843.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest843/Generated843.il index 21db29bb990484..10e7c1ac7bf04a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest843/Generated843.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest843/Generated843.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated843 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5047,6 +5048,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated843::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest844/Generated844.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest844/Generated844.il index c36331b9465f1f..cb5ef1a5d36ab7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest844/Generated844.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest844/Generated844.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated844 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4975,6 +4976,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated844::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest845/Generated845.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest845/Generated845.il index 8f2e8a3d6f5b36..aea32d075436b3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest845/Generated845.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest845/Generated845.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated845 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5420,6 +5421,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated845::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest846/Generated846.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest846/Generated846.il index 4d7287d17b4876..bbeb2b40d212fe 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest846/Generated846.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest846/Generated846.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated846 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4905,6 +4906,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated846::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest847/Generated847.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest847/Generated847.il index e62653e98bc99f..1bb12133fa249e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest847/Generated847.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest847/Generated847.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated847 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4947,6 +4948,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated847::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest848/Generated848.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest848/Generated848.il index 9041fa00678348..4598185235ca53 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest848/Generated848.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest848/Generated848.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated848 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4429,6 +4430,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated848::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest849/Generated849.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest849/Generated849.il index b39d9d01ff3657..c573bfafd72579 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest849/Generated849.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest849/Generated849.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated849 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4681,6 +4682,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated849::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest85/Generated85.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest85/Generated85.il index e4db2d4e4f9720..e5a323db4cc366 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest85/Generated85.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest85/Generated85.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated85 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1070,6 +1071,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated85::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest850/Generated850.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest850/Generated850.il index 6a3502b090aa1e..97e6552b4cb93b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest850/Generated850.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest850/Generated850.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated850 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4513,6 +4514,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated850::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest851/Generated851.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest851/Generated851.il index d4069dad00721d..13aa9c5ec4204a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest851/Generated851.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest851/Generated851.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated851 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5753,6 +5754,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated851::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest852/Generated852.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest852/Generated852.il index 098234fc5d8821..0efbc3c366cac4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest852/Generated852.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest852/Generated852.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated852 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4533,6 +4534,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated852::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest853/Generated853.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest853/Generated853.il index 48a5f9adedf218..294f47d0070d46 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest853/Generated853.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest853/Generated853.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated853 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4693,6 +4694,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated853::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest854/Generated854.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest854/Generated854.il index 30f9f5f1669d5c..290a1bd6143c6d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest854/Generated854.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest854/Generated854.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated854 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5415,6 +5416,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated854::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest855/Generated855.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest855/Generated855.il index 5d8e2a7c7045a2..9e117090d13531 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest855/Generated855.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest855/Generated855.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated855 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5354,6 +5355,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated855::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest856/Generated856.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest856/Generated856.il index 07c75613efb2db..aace79c572deff 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest856/Generated856.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest856/Generated856.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated856 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5218,6 +5219,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated856::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest857/Generated857.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest857/Generated857.il index a3848ee309f8ea..7aa6aea7d6a018 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest857/Generated857.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest857/Generated857.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated857 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5763,6 +5764,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated857::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest858/Generated858.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest858/Generated858.il index b190c8e6656d9d..a31dc428f04790 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest858/Generated858.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest858/Generated858.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated858 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4333,6 +4334,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated858::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest859/Generated859.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest859/Generated859.il index 399d9d6a4c4dbd..01e2f689cc2540 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest859/Generated859.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest859/Generated859.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated859 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4421,6 +4422,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated859::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest86/Generated86.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest86/Generated86.il index a0ff1ef3661ab6..512cb5128cea02 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest86/Generated86.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest86/Generated86.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated86 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1028,6 +1029,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated86::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest860/Generated860.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest860/Generated860.il index ce34282c27ac1b..2e15c039352f09 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest860/Generated860.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest860/Generated860.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated860 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3216,6 +3217,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated860::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest861/Generated861.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest861/Generated861.il index 219ba22c4b85fc..3bd2b6700db0ac 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest861/Generated861.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest861/Generated861.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated861 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4960,6 +4961,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated861::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest862/Generated862.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest862/Generated862.il index 36a68932d10e63..056d578c764e7b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest862/Generated862.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest862/Generated862.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated862 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4827,6 +4828,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated862::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest863/Generated863.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest863/Generated863.il index 5eb43d35c13dbe..793343dd157e86 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest863/Generated863.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest863/Generated863.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated863 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4324,6 +4325,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated863::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest864/Generated864.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest864/Generated864.il index bbfa1847afb914..6bca5c7b900717 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest864/Generated864.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest864/Generated864.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated864 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5061,6 +5062,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated864::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest865/Generated865.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest865/Generated865.il index d5329fa20409ab..d1141911208cab 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest865/Generated865.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest865/Generated865.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated865 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3035,6 +3036,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated865::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest866/Generated866.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest866/Generated866.il index 1ccd12f13927b2..503b6ceb0e8f66 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest866/Generated866.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest866/Generated866.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated866 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4560,6 +4561,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated866::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest867/Generated867.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest867/Generated867.il index 9b83fe42992351..8b60a255bdabae 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest867/Generated867.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest867/Generated867.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated867 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4404,6 +4405,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated867::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest868/Generated868.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest868/Generated868.il index 6664af7c8ebfb5..a887d3ff283e43 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest868/Generated868.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest868/Generated868.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated868 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4904,6 +4905,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated868::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest869/Generated869.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest869/Generated869.il index ad277a7faf433c..d228ef0495e110 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest869/Generated869.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest869/Generated869.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated869 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5093,6 +5094,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated869::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest87/Generated87.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest87/Generated87.il index 47f245c5957da9..686821024894ea 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest87/Generated87.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest87/Generated87.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated87 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1139,6 +1140,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated87::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest870/Generated870.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest870/Generated870.il index 4298082e19e2e4..bf7260bf11ecd3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest870/Generated870.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest870/Generated870.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated870 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5067,6 +5068,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated870::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest871/Generated871.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest871/Generated871.il index 88cef93624f6e3..5cbbe9a08ff826 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest871/Generated871.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest871/Generated871.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated871 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5036,6 +5037,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated871::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest872/Generated872.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest872/Generated872.il index 4967107e0fb30a..21f68b849ba414 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest872/Generated872.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest872/Generated872.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated872 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4926,6 +4927,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated872::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest873/Generated873.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest873/Generated873.il index 1787d525392627..708ec218b727ed 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest873/Generated873.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest873/Generated873.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated873 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4975,6 +4976,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated873::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest874/Generated874.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest874/Generated874.il index 41fbf585d03003..68bded9630e781 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest874/Generated874.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest874/Generated874.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated874 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4948,6 +4949,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated874::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest875/Generated875.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest875/Generated875.il index 52846f6081c701..7ebec592e98a14 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest875/Generated875.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest875/Generated875.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated875 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4849,6 +4850,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated875::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest876/Generated876.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest876/Generated876.il index 2c1d5cf0e15787..c29ebc8541e005 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest876/Generated876.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest876/Generated876.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated876 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4586,6 +4587,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated876::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest877/Generated877.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest877/Generated877.il index 504076f00f4920..d596ac3c5683cb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest877/Generated877.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest877/Generated877.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated877 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4468,6 +4469,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated877::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest878/Generated878.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest878/Generated878.il index c1198fbdcce8d2..acc0e1de0506da 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest878/Generated878.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest878/Generated878.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated878 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4632,6 +4633,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated878::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest879/Generated879.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest879/Generated879.il index b249fd0e32308a..d477f46502aa07 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest879/Generated879.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest879/Generated879.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated879 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4714,6 +4715,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated879::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest88/Generated88.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest88/Generated88.il index 14bea0beb9ab82..94c6125bfd9979 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest88/Generated88.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest88/Generated88.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated88 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1091,6 +1092,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated88::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest880/Generated880.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest880/Generated880.il index f411b374f21e1a..6aafc284394825 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest880/Generated880.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest880/Generated880.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated880 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4393,6 +4394,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated880::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest881/Generated881.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest881/Generated881.il index dc90296fcb9a7b..de24a024a21054 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest881/Generated881.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest881/Generated881.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated881 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4376,6 +4377,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated881::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest882/Generated882.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest882/Generated882.il index 3e2da001856919..53b049af440147 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest882/Generated882.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest882/Generated882.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated882 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4789,6 +4790,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated882::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest883/Generated883.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest883/Generated883.il index 6ccee3e7ec0fb2..8cd9ec4483f7d9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest883/Generated883.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest883/Generated883.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated883 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4331,6 +4332,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated883::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest884/Generated884.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest884/Generated884.il index 97b3f2f60a0239..975f25bcb043db 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest884/Generated884.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest884/Generated884.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated884 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4287,6 +4288,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated884::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest885/Generated885.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest885/Generated885.il index 485682def6f03e..c4b53327a2c659 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest885/Generated885.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest885/Generated885.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated885 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4781,6 +4782,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated885::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest886/Generated886.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest886/Generated886.il index db5d3f62586ea7..6a3934fe576f71 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest886/Generated886.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest886/Generated886.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated886 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4736,6 +4737,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated886::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest887/Generated887.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest887/Generated887.il index 1f67f095217349..58185dff1555d7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest887/Generated887.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest887/Generated887.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated887 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5033,6 +5034,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated887::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest888/Generated888.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest888/Generated888.il index f70461fb9d0b4d..f7c4be5e78e45c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest888/Generated888.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest888/Generated888.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated888 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5410,6 +5411,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated888::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest889/Generated889.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest889/Generated889.il index 10a915769c188a..17ab990fb81df5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest889/Generated889.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest889/Generated889.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated889 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5468,6 +5469,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated889::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest89/Generated89.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest89/Generated89.il index 210d20b9449ab7..126820eed29dfa 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest89/Generated89.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest89/Generated89.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated89 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1102,6 +1103,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated89::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest890/Generated890.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest890/Generated890.il index b6cc6b184a4466..ba244c2d612289 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest890/Generated890.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest890/Generated890.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated890 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2989,6 +2990,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated890::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest891/Generated891.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest891/Generated891.il index 82028424cf3e71..63dde14dc652ab 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest891/Generated891.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest891/Generated891.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated891 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4845,6 +4846,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated891::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest892/Generated892.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest892/Generated892.il index 509d135279a3bb..e226ad00c2eba6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest892/Generated892.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest892/Generated892.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated892 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4724,6 +4725,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated892::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest893/Generated893.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest893/Generated893.il index fcb99717335d06..3e317b2bde5e6b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest893/Generated893.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest893/Generated893.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated893 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4824,6 +4825,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated893::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest894/Generated894.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest894/Generated894.il index 2525274072ac3a..7b3c9a2a6d6cd1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest894/Generated894.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest894/Generated894.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated894 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5628,6 +5629,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated894::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest895/Generated895.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest895/Generated895.il index 8c1d76bd4e7230..68476ced459dff 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest895/Generated895.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest895/Generated895.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated895 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5421,6 +5422,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated895::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest896/Generated896.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest896/Generated896.il index 99851500382acd..f5f044db0b182b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest896/Generated896.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest896/Generated896.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated896 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3086,6 +3087,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated896::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest897/Generated897.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest897/Generated897.il index d2fe5fb502890e..059e6274c9d26d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest897/Generated897.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest897/Generated897.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated897 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4750,6 +4751,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated897::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest898/Generated898.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest898/Generated898.il index 5dc0f78629badf..1e214c9abba12e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest898/Generated898.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest898/Generated898.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated898 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5897,6 +5898,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated898::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest899/Generated899.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest899/Generated899.il index 86e74f1c0e3706..7b79656b4bb2ba 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest899/Generated899.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest899/Generated899.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated899 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5987,6 +5988,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated899::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest9/Generated9.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest9/Generated9.il index 7d955d1d2bf7d4..4c5f4e11066dd4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest9/Generated9.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest9/Generated9.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated9 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -598,6 +599,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated9::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest90/Generated90.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest90/Generated90.il index 6e08d71f43ec1e..c21c6fc6fe986c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest90/Generated90.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest90/Generated90.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated90 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1149,6 +1150,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated90::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest900/Generated900.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest900/Generated900.il index 84df91aa9f17e2..6d3976b8c0985d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest900/Generated900.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest900/Generated900.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated900 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6716,6 +6717,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated900::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest901/Generated901.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest901/Generated901.il index 4e9ea2b144dec0..8421422626aa11 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest901/Generated901.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest901/Generated901.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated901 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4427,6 +4428,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated901::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest902/Generated902.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest902/Generated902.il index 948bf4cef6fb09..afd89b358b27d2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest902/Generated902.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest902/Generated902.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated902 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6973,6 +6974,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated902::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest903/Generated903.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest903/Generated903.il index 4876bc347012d9..38bb664d3f4f15 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest903/Generated903.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest903/Generated903.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated903 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6840,6 +6841,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated903::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest904/Generated904.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest904/Generated904.il index 25a795763641e3..d11df67c9092aa 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest904/Generated904.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest904/Generated904.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated904 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6895,6 +6896,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated904::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest905/Generated905.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest905/Generated905.il index c2dbe7bfc5947c..1f232b0ad131b0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest905/Generated905.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest905/Generated905.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated905 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6806,6 +6807,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated905::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest906/Generated906.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest906/Generated906.il index 56160996222935..518a7bb14b476e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest906/Generated906.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest906/Generated906.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated906 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6748,6 +6749,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated906::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest907/Generated907.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest907/Generated907.il index 9b6a5e0808f200..6270bafd35afa4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest907/Generated907.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest907/Generated907.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated907 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6733,6 +6734,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated907::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest908/Generated908.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest908/Generated908.il index 619eb937e46afd..f531f2f31834e3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest908/Generated908.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest908/Generated908.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated908 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6967,6 +6968,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated908::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest909/Generated909.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest909/Generated909.il index 50c35f2d4f860a..805fb69e3561a4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest909/Generated909.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest909/Generated909.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated909 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3935,6 +3936,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated909::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest91/Generated91.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest91/Generated91.il index f87efff86e5f8d..efaf5e4b9f965e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest91/Generated91.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest91/Generated91.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated91 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1128,6 +1129,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated91::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest910/Generated910.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest910/Generated910.il index d23c9c61e2f1f3..3cea4ed4957bea 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest910/Generated910.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest910/Generated910.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated910 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3810,6 +3811,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated910::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest911/Generated911.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest911/Generated911.il index 37023bfaff7648..551070751f0bcc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest911/Generated911.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest911/Generated911.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated911 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5718,6 +5719,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated911::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest912/Generated912.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest912/Generated912.il index 69b3b3f48e9c69..c21680ae11bd1b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest912/Generated912.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest912/Generated912.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated912 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5813,6 +5814,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated912::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest913/Generated913.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest913/Generated913.il index 8e4f8d9ab04eec..57a62129c5d0f5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest913/Generated913.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest913/Generated913.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated913 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4387,6 +4388,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated913::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest914/Generated914.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest914/Generated914.il index 8854ffca1732fe..f01e476d73d97f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest914/Generated914.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest914/Generated914.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated914 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4162,6 +4163,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated914::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest915/Generated915.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest915/Generated915.il index 0ea261b2eea435..2334259881a232 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest915/Generated915.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest915/Generated915.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated915 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4307,6 +4308,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated915::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest916/Generated916.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest916/Generated916.il index 2d2a3372a9e5d1..e8c98013aa1cc6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest916/Generated916.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest916/Generated916.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated916 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4573,6 +4574,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated916::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest917/Generated917.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest917/Generated917.il index 2dde8fc46f1605..481ec258f53728 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest917/Generated917.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest917/Generated917.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated917 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4285,6 +4286,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated917::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest918/Generated918.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest918/Generated918.il index 1be9798b9f2806..cde6ef896e5f9e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest918/Generated918.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest918/Generated918.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated918 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6914,6 +6915,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated918::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest919/Generated919.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest919/Generated919.il index 0d680e2c9402e5..a7b6b707ab1ad8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest919/Generated919.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest919/Generated919.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated919 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4525,6 +4526,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated919::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest92/Generated92.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest92/Generated92.il index e5178d813d9709..9d0d02421c9ba6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest92/Generated92.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest92/Generated92.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated92 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -909,6 +910,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated92::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest920/Generated920.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest920/Generated920.il index fe3197fde6f438..7958cf34da6f30 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest920/Generated920.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest920/Generated920.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated920 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -7196,6 +7197,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated920::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest921/Generated921.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest921/Generated921.il index 9aaa41ca564a75..8aba4cbb5a3604 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest921/Generated921.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest921/Generated921.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated921 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5520,6 +5521,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated921::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest922/Generated922.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest922/Generated922.il index a4b2a56bac2953..a1cd9836258a6f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest922/Generated922.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest922/Generated922.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated922 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5469,6 +5470,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated922::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest923/Generated923.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest923/Generated923.il index 286e76ce03cb09..c9eae830b63425 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest923/Generated923.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest923/Generated923.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated923 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4901,6 +4902,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated923::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest924/Generated924.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest924/Generated924.il index aecc001cd9b074..468214dac414cc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest924/Generated924.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest924/Generated924.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated924 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5454,6 +5455,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated924::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest925/Generated925.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest925/Generated925.il index 258501e5f45c02..4aff8b2321246f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest925/Generated925.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest925/Generated925.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated925 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6852,6 +6853,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated925::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest926/Generated926.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest926/Generated926.il index 1651f4dc6ea7ca..612cec6d78a2c8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest926/Generated926.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest926/Generated926.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated926 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6740,6 +6741,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated926::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest927/Generated927.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest927/Generated927.il index 0cfb8cdc9dd03f..5d25e152e136bf 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest927/Generated927.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest927/Generated927.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated927 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6368,6 +6369,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated927::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest928/Generated928.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest928/Generated928.il index 8622ba90ccea9d..19fe0329f88257 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest928/Generated928.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest928/Generated928.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated928 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6365,6 +6366,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated928::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest929/Generated929.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest929/Generated929.il index 7a835ce70d3968..de7d6c45792c20 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest929/Generated929.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest929/Generated929.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated929 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6466,6 +6467,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated929::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest93/Generated93.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest93/Generated93.il index e4700108aab14d..818c58824b6bd1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest93/Generated93.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest93/Generated93.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated93 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1052,6 +1053,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated93::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest930/Generated930.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest930/Generated930.il index 03dc1064cdf35d..c7b931b1178f92 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest930/Generated930.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest930/Generated930.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated930 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6480,6 +6481,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated930::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest931/Generated931.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest931/Generated931.il index b4206c68cd8a58..f12c2c1ce0373e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest931/Generated931.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest931/Generated931.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated931 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6664,6 +6665,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated931::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest932/Generated932.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest932/Generated932.il index 195b250d061943..81e45f96b9dcd5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest932/Generated932.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest932/Generated932.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated932 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4682,6 +4683,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated932::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest933/Generated933.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest933/Generated933.il index 5416f2f8b7d2c2..6f71c816c1d7f6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest933/Generated933.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest933/Generated933.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated933 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4653,6 +4654,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated933::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest934/Generated934.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest934/Generated934.il index a06ac4706973c0..b6c25b43bf2f2e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest934/Generated934.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest934/Generated934.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated934 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -7254,6 +7255,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated934::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest935/Generated935.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest935/Generated935.il index e7e0a48a391a49..81b20f57f1d9ef 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest935/Generated935.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest935/Generated935.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated935 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5872,6 +5873,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated935::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest936/Generated936.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest936/Generated936.il index 64fe05a209b253..7dced474b7de0b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest936/Generated936.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest936/Generated936.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated936 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5812,6 +5813,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated936::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest937/Generated937.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest937/Generated937.il index 25f91cf32b38db..811520097352bf 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest937/Generated937.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest937/Generated937.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated937 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6802,6 +6803,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated937::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest938/Generated938.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest938/Generated938.il index 54e10b8fb7848a..c2c0d56e756ebb 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest938/Generated938.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest938/Generated938.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated938 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6659,6 +6660,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated938::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest939/Generated939.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest939/Generated939.il index 444a139c56ea96..9a4df59aa7f58c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest939/Generated939.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest939/Generated939.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated939 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6848,6 +6849,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated939::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest94/Generated94.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest94/Generated94.il index 0977b416f104e6..f69f576e3c0341 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest94/Generated94.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest94/Generated94.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated94 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -982,6 +983,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated94::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest940/Generated940.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest940/Generated940.il index d639165fe5dd96..c2fc4629d1afc9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest940/Generated940.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest940/Generated940.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated940 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6844,6 +6845,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated940::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest941/Generated941.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest941/Generated941.il index a256c49c02532f..4a276a2a0876f0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest941/Generated941.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest941/Generated941.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated941 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4459,6 +4460,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated941::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest942/Generated942.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest942/Generated942.il index 6a01313b97adca..113f332f18209b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest942/Generated942.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest942/Generated942.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated942 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4475,6 +4476,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated942::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest943/Generated943.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest943/Generated943.il index 8eb911a824e1df..14e4d53df1d79e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest943/Generated943.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest943/Generated943.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated943 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4298,6 +4299,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated943::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest944/Generated944.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest944/Generated944.il index 7d1395aab08a16..b1a9ecb4e71554 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest944/Generated944.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest944/Generated944.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated944 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5541,6 +5542,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated944::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest945/Generated945.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest945/Generated945.il index e7a25c86dcd55f..690a26b23eb9ab 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest945/Generated945.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest945/Generated945.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated945 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6784,6 +6785,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated945::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest946/Generated946.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest946/Generated946.il index ccbdeafc8a56ae..f23705cc0d6494 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest946/Generated946.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest946/Generated946.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated946 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6901,6 +6902,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated946::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest947/Generated947.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest947/Generated947.il index 5748c4b93b48be..c5d40c57da5c3e 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest947/Generated947.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest947/Generated947.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated947 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4664,6 +4665,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated947::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest948/Generated948.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest948/Generated948.il index 6b98371618da07..f1d5b546bb1ad7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest948/Generated948.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest948/Generated948.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated948 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4601,6 +4602,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated948::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest949/Generated949.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest949/Generated949.il index 40c78252a612c2..b66a563c1ac9b9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest949/Generated949.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest949/Generated949.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated949 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4618,6 +4619,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated949::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest95/Generated95.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest95/Generated95.il index 9db7bbacc037b4..cab1f9adabff52 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest95/Generated95.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest95/Generated95.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated95 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -948,6 +949,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated95::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest950/Generated950.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest950/Generated950.il index 4183a4a32fbbcd..6652395e79d01b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest950/Generated950.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest950/Generated950.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated950 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4788,6 +4789,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated950::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest951/Generated951.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest951/Generated951.il index c07841bb28e04f..87f7c31dad79cf 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest951/Generated951.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest951/Generated951.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated951 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6678,6 +6679,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated951::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest952/Generated952.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest952/Generated952.il index 3a1aa58468478b..7ddb67c870cf20 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest952/Generated952.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest952/Generated952.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated952 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -7046,6 +7047,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated952::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest953/Generated953.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest953/Generated953.il index 704641aff5d253..a7e784da19e250 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest953/Generated953.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest953/Generated953.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated953 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4444,6 +4445,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated953::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest954/Generated954.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest954/Generated954.il index 730959494f5dac..9f661cbb511cc9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest954/Generated954.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest954/Generated954.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated954 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4557,6 +4558,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated954::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest955/Generated955.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest955/Generated955.il index 0b16b657cf1cc3..5a9d31861abcc4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest955/Generated955.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest955/Generated955.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated955 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5650,6 +5651,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated955::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest956/Generated956.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest956/Generated956.il index 45116ac7b2e52a..ca9a9f82b86f70 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest956/Generated956.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest956/Generated956.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated956 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5628,6 +5629,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated956::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest957/Generated957.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest957/Generated957.il index 3253d776e428b2..f25643de1357fc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest957/Generated957.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest957/Generated957.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated957 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6815,6 +6816,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated957::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest958/Generated958.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest958/Generated958.il index 0ac776cb155ba3..44ffb0088cdb22 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest958/Generated958.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest958/Generated958.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated958 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4503,6 +4504,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated958::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest959/Generated959.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest959/Generated959.il index 6cfda3a683769e..f7c2ae537301f1 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest959/Generated959.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest959/Generated959.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated959 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -7083,6 +7084,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated959::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest96/Generated96.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest96/Generated96.il index abf2425aecec63..add3a7643377bf 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest96/Generated96.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest96/Generated96.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated96 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1054,6 +1055,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated96::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest960/Generated960.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest960/Generated960.il index dffdb00b849def..a0c9d69a9ab658 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest960/Generated960.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest960/Generated960.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated960 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -7172,6 +7173,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated960::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest961/Generated961.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest961/Generated961.il index 2e340020c66e68..df330affa0dbaa 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest961/Generated961.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest961/Generated961.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated961 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4254,6 +4255,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated961::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest962/Generated962.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest962/Generated962.il index c8f7208bda030b..d0bd974c2434f9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest962/Generated962.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest962/Generated962.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated962 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6936,6 +6937,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated962::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest963/Generated963.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest963/Generated963.il index a33a1913205660..25f31a420db4f4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest963/Generated963.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest963/Generated963.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated963 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -6836,6 +6837,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated963::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest964/Generated964.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest964/Generated964.il index a71c3b7beff411..fce4a70cad9f74 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest964/Generated964.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest964/Generated964.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated964 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2851,6 +2852,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated964::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest965/Generated965.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest965/Generated965.il index 723be73a3c942d..ec39fd393591f5 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest965/Generated965.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest965/Generated965.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated965 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4838,6 +4839,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated965::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest966/Generated966.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest966/Generated966.il index 7206f2ae649699..43f55d093250a7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest966/Generated966.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest966/Generated966.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated966 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4921,6 +4922,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated966::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest967/Generated967.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest967/Generated967.il index 23cafa73b74f91..eca5a898ed7383 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest967/Generated967.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest967/Generated967.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated967 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4949,6 +4950,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated967::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest968/Generated968.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest968/Generated968.il index cd5655b75a684e..ca4e7294787b33 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest968/Generated968.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest968/Generated968.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated968 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4934,6 +4935,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated968::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest969/Generated969.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest969/Generated969.il index 6d8269273ec25d..0040faa43b9ddc 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest969/Generated969.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest969/Generated969.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated969 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4401,6 +4402,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated969::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest97/Generated97.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest97/Generated97.il index 7a50d8426aaa4e..f03ff22fa50639 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest97/Generated97.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest97/Generated97.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated97 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -1038,6 +1039,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated97::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest970/Generated970.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest970/Generated970.il index 119a0f32650d6b..93a82f4558c88d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest970/Generated970.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest970/Generated970.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated970 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4319,6 +4320,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated970::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest971/Generated971.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest971/Generated971.il index d6556cb73cd1e3..4c730bf6894357 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest971/Generated971.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest971/Generated971.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated971 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4351,6 +4352,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated971::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest972/Generated972.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest972/Generated972.il index a78a27f87bc377..6852096264eff4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest972/Generated972.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest972/Generated972.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated972 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5294,6 +5295,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated972::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest973/Generated973.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest973/Generated973.il index dd3de55ba09416..d3450f24d7f822 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest973/Generated973.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest973/Generated973.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated973 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5386,6 +5387,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated973::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest974/Generated974.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest974/Generated974.il index 29541ab766ca0f..400c4bbf5f2da6 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest974/Generated974.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest974/Generated974.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated974 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2888,6 +2889,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated974::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest975/Generated975.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest975/Generated975.il index 2d4771905a9081..fe472f78ee5eb0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest975/Generated975.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest975/Generated975.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated975 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2922,6 +2923,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated975::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest976/Generated976.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest976/Generated976.il index 8848f6fa5ef2fe..147428dffaab0a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest976/Generated976.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest976/Generated976.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated976 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2909,6 +2910,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated976::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest977/Generated977.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest977/Generated977.il index c0f7a61c445006..8095dd8a9f8bfd 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest977/Generated977.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest977/Generated977.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated977 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5315,6 +5316,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated977::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest978/Generated978.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest978/Generated978.il index 044a95db3d2503..effec41d721e77 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest978/Generated978.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest978/Generated978.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated978 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5385,6 +5386,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated978::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest979/Generated979.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest979/Generated979.il index 8fc155991ace62..d7225abac74ab7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest979/Generated979.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest979/Generated979.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated979 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -5487,6 +5488,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated979::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest98/Generated98.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest98/Generated98.il index 1c8566854b04c0..45c2ed36bbf0b7 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest98/Generated98.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest98/Generated98.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated98 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -605,6 +606,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated98::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest980/Generated980.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest980/Generated980.il index bb5a7daa5fda81..1ebf5c5bb7b5ba 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest980/Generated980.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest980/Generated980.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated980 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4416,6 +4417,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated980::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest981/Generated981.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest981/Generated981.il index 031576fe76d289..c465fd59362a70 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest981/Generated981.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest981/Generated981.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated981 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2611,6 +2612,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated981::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest982/Generated982.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest982/Generated982.il index 9cebe96f3a7328..cfcb26c47e0ba9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest982/Generated982.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest982/Generated982.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated982 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2576,6 +2577,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated982::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest983/Generated983.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest983/Generated983.il index 8186ca87d4f161..c31677fa37353c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest983/Generated983.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest983/Generated983.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated983 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2655,6 +2656,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated983::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest984/Generated984.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest984/Generated984.il index b066eb14980c59..52653a552f3ec2 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest984/Generated984.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest984/Generated984.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated984 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -2614,6 +2615,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated984::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest985/Generated985.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest985/Generated985.il index 1a28782d98e440..ce1c69bd23b595 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest985/Generated985.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest985/Generated985.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated985 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4436,6 +4437,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated985::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest986/Generated986.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest986/Generated986.il index 92d9dd717b4542..64023cbef2125b 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest986/Generated986.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest986/Generated986.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated986 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4437,6 +4438,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated986::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest987/Generated987.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest987/Generated987.il index 096b74177b6274..49cdb677f934c3 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest987/Generated987.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest987/Generated987.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated987 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4367,6 +4368,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated987::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest988/Generated988.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest988/Generated988.il index e4e9288a105107..57b70701d1037a 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest988/Generated988.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest988/Generated988.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated988 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4611,6 +4612,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated988::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest989/Generated989.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest989/Generated989.il index d1bfb093fc90c0..bf28a71ca9da52 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest989/Generated989.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest989/Generated989.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated989 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3647,6 +3648,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated989::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest99/Generated99.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest99/Generated99.il index b910f110ea141c..c49abe68162380 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest99/Generated99.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest99/Generated99.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated99 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -451,6 +452,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated99::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest990/Generated990.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest990/Generated990.il index d15aa1824d1b57..d2c6b80a4c6aaa 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest990/Generated990.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest990/Generated990.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated990 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3655,6 +3656,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated990::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest991/Generated991.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest991/Generated991.il index 5d23d15de9ce83..026435731cdca8 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest991/Generated991.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest991/Generated991.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated991 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4511,6 +4512,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated991::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest992/Generated992.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest992/Generated992.il index b0e8df3405d9f3..471ccce39ccee0 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest992/Generated992.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest992/Generated992.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated992 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4580,6 +4581,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated992::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest993/Generated993.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest993/Generated993.il index e97ba9c4a6492a..30659fccc4c8ef 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest993/Generated993.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest993/Generated993.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated993 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4330,6 +4331,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated993::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest994/Generated994.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest994/Generated994.il index 6fe35aa7d10ad9..7ac6610c2d55fe 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest994/Generated994.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest994/Generated994.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated994 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4293,6 +4294,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated994::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest995/Generated995.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest995/Generated995.il index 87152859a149d3..3bac8763a9239f 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest995/Generated995.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest995/Generated995.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated995 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -4239,6 +4240,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated995::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest996/Generated996.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest996/Generated996.il index dd9cda450433f8..6a71d8ea5092a9 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest996/Generated996.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest996/Generated996.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated996 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3312,6 +3313,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated996::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest997/Generated997.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest997/Generated997.il index 103550ef023220..def287fad91a7d 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest997/Generated997.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest997/Generated997.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated997 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3183,6 +3184,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated997::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest998/Generated998.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest998/Generated998.il index bb0f9aef14806b..8ee274bdf22bd4 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest998/Generated998.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest998/Generated998.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated998 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3347,6 +3348,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated998::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest999/Generated999.il b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest999/Generated999.il index e901d853f8f7f3..a105d0cc59a57c 100644 --- a/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest999/Generated999.il +++ b/src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest999/Generated999.il @@ -8,6 +8,7 @@ //TEST ASSEMBLY: .assembly Generated999 { .hash algorithm 0x00008004 } +.assembly extern xunit.core {} .class public BaseClass0 { @@ -3434,6 +3435,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 call void Generated999::MethodCallingTest() diff --git a/src/tests/Loader/classloader/TypeInitialization/CctorsWithSideEffects/CctorThrowLDFTNStaticMethod.il b/src/tests/Loader/classloader/TypeInitialization/CctorsWithSideEffects/CctorThrowLDFTNStaticMethod.il index ebc6a7ffb8167a..364b7cdc518145 100644 --- a/src/tests/Loader/classloader/TypeInitialization/CctorsWithSideEffects/CctorThrowLDFTNStaticMethod.il +++ b/src/tests/Loader/classloader/TypeInitialization/CctorsWithSideEffects/CctorThrowLDFTNStaticMethod.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // A .cctor has only one chance to run in any appdomain. // If it fails, the 2nd time we try to access a static field we check if .cctor has been run. // And it has, but failed so we fail again. @@ -105,6 +106,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 279 (0x117) .maxstack 2 diff --git a/src/tests/Loader/classloader/TypeInitialization/CctorsWithSideEffects/CctorThrowStaticFieldBFI.il b/src/tests/Loader/classloader/TypeInitialization/CctorsWithSideEffects/CctorThrowStaticFieldBFI.il index 43303a27e03cec..5d49fe5459bad6 100644 --- a/src/tests/Loader/classloader/TypeInitialization/CctorsWithSideEffects/CctorThrowStaticFieldBFI.il +++ b/src/tests/Loader/classloader/TypeInitialization/CctorsWithSideEffects/CctorThrowStaticFieldBFI.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 2.0.50103.00 // Copyright (C) Microsoft Corporation. All rights reserved. @@ -91,6 +92,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 405 (0x195) .maxstack 2 diff --git a/src/tests/Loader/classloader/TypeInitialization/CctorsWithSideEffects/ResetGlobalFields.il b/src/tests/Loader/classloader/TypeInitialization/CctorsWithSideEffects/ResetGlobalFields.il index 7130d78cc05c3a..94f81707ce320f 100644 --- a/src/tests/Loader/classloader/TypeInitialization/CctorsWithSideEffects/ResetGlobalFields.il +++ b/src/tests/Loader/classloader/TypeInitialization/CctorsWithSideEffects/ResetGlobalFields.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 2.0.50110.00 // Copyright (C) Microsoft Corporation. All rights reserved. @@ -64,6 +65,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 61 (0x3d) .maxstack 2 diff --git a/src/tests/Loader/classloader/TypeInitialization/CctorsWithSideEffects/TypeLoadInitExcepBFI.il b/src/tests/Loader/classloader/TypeInitialization/CctorsWithSideEffects/TypeLoadInitExcepBFI.il index a0bdeffb4e305c..c6d2657ab997f2 100644 --- a/src/tests/Loader/classloader/TypeInitialization/CctorsWithSideEffects/TypeLoadInitExcepBFI.il +++ b/src/tests/Loader/classloader/TypeInitialization/CctorsWithSideEffects/TypeLoadInitExcepBFI.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 2.0.50103.00 // Copyright (C) Microsoft Corporation. All rights reserved. @@ -91,6 +92,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 405 (0x195) .maxstack 2 diff --git a/src/tests/Loader/classloader/TypeInitialization/CctorsWithSideEffects/UntrustedCodeBFI.il b/src/tests/Loader/classloader/TypeInitialization/CctorsWithSideEffects/UntrustedCodeBFI.il index 80b03be0496bab..fbcf179ff8db02 100644 --- a/src/tests/Loader/classloader/TypeInitialization/CctorsWithSideEffects/UntrustedCodeBFI.il +++ b/src/tests/Loader/classloader/TypeInitialization/CctorsWithSideEffects/UntrustedCodeBFI.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib {} @@ -89,6 +90,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 98 (0x62) .maxstack 2 diff --git a/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorFourThreadsBFI.il b/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorFourThreadsBFI.il index a42069a053ac29..a0af39fdc089b5 100644 --- a/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorFourThreadsBFI.il +++ b/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorFourThreadsBFI.il @@ -5,6 +5,7 @@ // Microsoft (R) .NET Framework IL Disassembler. Version 2.0.50103.00 // Copyright (C) Microsoft Corporation. All rights reserved. .assembly extern System.Console { auto } +.assembly extern xunit.core {} .assembly extern System.Threading.Thread { auto } // Metadata version: v2.0.50103 .assembly extern mscorlib { auto } @@ -307,6 +308,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 302 (0x12e) .maxstack 3 diff --git a/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorThreeThreads01BFI.il b/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorThreeThreads01BFI.il index 71a54148c8b75c..3b2745be079fd2 100644 --- a/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorThreeThreads01BFI.il +++ b/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorThreeThreads01BFI.il @@ -5,6 +5,7 @@ // Microsoft (R) .NET Framework IL Disassembler. Version 2.0.50103.00 // Copyright (C) Microsoft Corporation. All rights reserved. .assembly extern System.Console { auto } +.assembly extern xunit.core {} .assembly extern System.Threading.Thread { auto } // Metadata version: v2.0.50103 .assembly extern mscorlib { auto } @@ -312,6 +313,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 244 (0xf4) .maxstack 3 diff --git a/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorThreeThreads02BFI.il b/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorThreeThreads02BFI.il index 7a908131f5b02e..c360039d1ca285 100644 --- a/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorThreeThreads02BFI.il +++ b/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorThreeThreads02BFI.il @@ -5,6 +5,7 @@ // Microsoft (R) .NET Framework IL Disassembler. Version 2.0.50103.00 // Copyright (C) Microsoft Corporation. All rights reserved. .assembly extern System.Console { auto } +.assembly extern xunit.core {} .assembly extern System.Threading.Thread { auto } // Metadata version: v2.0.50103 .assembly extern mscorlib { auto } @@ -315,6 +316,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 244 (0xf4) .maxstack 3 diff --git a/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorThreeThreads03BFI.il b/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorThreeThreads03BFI.il index 4c653e7c95d3ea..870f9029b71ffb 100644 --- a/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorThreeThreads03BFI.il +++ b/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorThreeThreads03BFI.il @@ -5,6 +5,7 @@ // Microsoft (R) .NET Framework IL Disassembler. Version 2.0.50103.00 // Copyright (C) Microsoft Corporation. All rights reserved. .assembly extern System.Console { auto } +.assembly extern xunit.core {} .assembly extern System.Threading.Thread { auto } // Metadata version: v2.0.50103 .assembly extern mscorlib { auto } @@ -318,6 +319,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 244 (0xf4) .maxstack 3 diff --git a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test10.il b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test10.il index 879306a9bd1169..708e1121afd623 100644 --- a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test10.il +++ b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test10.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // non-blittable by objref field, large offset .assembly test10{} .assembly extern mscorlib{} @@ -21,6 +22,9 @@ } .method public static int32 Main(){ + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init(class Class1 c1) diff --git a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test11.il b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test11.il index d1be2c8fedee6d..a563af7cf517a4 100644 --- a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test11.il +++ b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test11.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // non-blittable by objref field, really large offset, and force GC collect .assembly test10{} .assembly extern mscorlib{} @@ -21,6 +22,9 @@ } .method public static int32 Main(){ + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init(class Class1 c1) diff --git a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test13.il b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test13.il index c44c2aeef8a74a..6e3811b48ced02 100644 --- a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test13.il +++ b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test13.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // non-blittable by objref field, large offset, large field size .assembly test13{} .assembly extern mscorlib{} @@ -26,6 +27,9 @@ } .method public static int32 Main(){ + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init(class Class1 c1) diff --git a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test14.il b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test14.il index ec0c69c3ea7f29..81b41d390f8d0b 100644 --- a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test14.il +++ b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test14.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // non-blittable by objref field, small offset, large field size .assembly test14{} .assembly extern mscorlib{} @@ -25,6 +26,9 @@ } .method public static int32 Main(){ + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init(class Class1 c1) diff --git a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test15.il b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test15.il index 31a020f29b7205..c11a96093babe6 100644 --- a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test15.il +++ b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test15.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // blittable, small offset, large field size .assembly test15{} .assembly extern mscorlib{} @@ -25,6 +26,9 @@ } .method public static int32 Main(){ + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init(class Class1 c1) diff --git a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test16.il b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test16.il index bf26dac6fd8aa8..be2ce0a40a6a44 100644 --- a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test16.il +++ b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test16.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // non-blittable by objref field, small offset, large field size, overlapping objref field .assembly test16{} .assembly extern mscorlib{} @@ -26,6 +27,9 @@ } .method public static int32 Main(){ + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class [mscorlib]System.Exception e2) diff --git a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test2.il b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test2.il index f9a6715c72b70f..37a0ab1ed38fbd 100644 --- a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test2.il +++ b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test2.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // blittable, large field offset. // this case never caused a stack overflow. // this test simply ensures continued correct behavior. @@ -20,6 +21,9 @@ } .method public static int32 Main(){ + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init(class Class1 c1) diff --git a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test21.il b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test21.il index 8369787aee92b1..9172c231033134 100644 --- a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test21.il +++ b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test21.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // valuetype non-blittable by objref field, large offset, small field size, overlapped objref .assembly test21{} .assembly extern mscorlib{} @@ -14,6 +15,9 @@ } .method public static int32 Main(){ + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class [mscorlib]System.Exception e2) diff --git a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test23.il b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test23.il index 02462e15ba8f7c..7f6d28b7830b58 100644 --- a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test23.il +++ b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test23.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // non-blittable by objref field, large offset, large field size, // one field is a valuetype that has an objref member field // (this is to hit EEClass::CheckValueClassLayout()) @@ -29,6 +30,9 @@ } .method public static int32 Main(){ + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init(class Class1 c1) diff --git a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test24.il b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test24.il index 08235ba16aa780..1e555a0f0611b5 100644 --- a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test24.il +++ b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test24.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // sequential, non-blittable by objref field, large offset, large field size .assembly test24{} .assembly extern mscorlib{} @@ -26,6 +27,9 @@ } .method public static int32 Main(){ + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init(class Class1 c1) diff --git a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test3.il b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test3.il index 0791bff8b0211a..0875d37283a2cb 100644 --- a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test3.il +++ b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test3.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // blittable, absurdly large field offset, expect TypeLoadException .assembly test3{} .assembly extern mscorlib{} @@ -20,6 +21,9 @@ .method public static int32 Main(){ + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class [mscorlib]System.Exception e2) diff --git a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test9.il b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test9.il index f0e9d7ad68d40e..cb905948d54c0d 100644 --- a/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test9.il +++ b/src/tests/Loader/classloader/explicitlayout/Regressions/ASURT/ASURT150271/test9.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // non-blittable by objref field, objref overlaps int32, large offset .assembly test9{} .assembly extern mscorlib{} @@ -21,6 +22,9 @@ } .method public static int32 Main(){ + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class [mscorlib]System.Exception e2) diff --git a/src/tests/Loader/classloader/generics/GenericMethods/arity01.il b/src/tests/Loader/classloader/generics/GenericMethods/arity01.il index bdc5c16d1feaf6..c41114d9b28317 100644 --- a/src/tests/Loader/classloader/generics/GenericMethods/arity01.il +++ b/src/tests/Loader/classloader/generics/GenericMethods/arity01.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 1.1.2019.0 // Copyright (C) Microsoft Corporation 1998-2002. All rights reserved. @@ -168,6 +169,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 478 (0x1de) .maxstack 4 diff --git a/src/tests/Loader/classloader/generics/GenericMethods/method014.il b/src/tests/Loader/classloader/generics/GenericMethods/method014.il index fbd9d9cb36f6be..541596f01b631c 100644 --- a/src/tests/Loader/classloader/generics/GenericMethods/method014.il +++ b/src/tests/Loader/classloader/generics/GenericMethods/method014.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 1.2.2204.0 // Copyright (C) Microsoft Corporation 1998-2002. All rights reserved. @@ -161,6 +162,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 142 (0x8e) .maxstack 2 diff --git a/src/tests/Loader/classloader/generics/GenericMethods/method016.il b/src/tests/Loader/classloader/generics/GenericMethods/method016.il index 726bd41f91a296..4039a7538b7adf 100644 --- a/src/tests/Loader/classloader/generics/GenericMethods/method016.il +++ b/src/tests/Loader/classloader/generics/GenericMethods/method016.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 1.2.2204.0 // Copyright (C) Microsoft Corporation 1998-2002. All rights reserved. @@ -198,6 +199,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 142 (0x8e) .maxstack 2 diff --git a/src/tests/Loader/classloader/generics/Instantiation/Negative/Type_ofT_Inherit_FromT.il b/src/tests/Loader/classloader/generics/Instantiation/Negative/Type_ofT_Inherit_FromT.il index 22d98577cee6d5..3e2e3b5359bcf8 100644 --- a/src/tests/Loader/classloader/generics/Instantiation/Negative/Type_ofT_Inherit_FromT.il +++ b/src/tests/Loader/classloader/generics/Instantiation/Negative/Type_ofT_Inherit_FromT.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // this test makes sure a generic type of form X can't inherit from T // class X_ofT extends T @@ -139,6 +140,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 239 (0xef) .maxstack 2 diff --git a/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract01.il b/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract01.il index 91d7ae351ab93b..6072fae34d5553 100644 --- a/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract01.il +++ b/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract01.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 1.1.2019.0 // Copyright (C) Microsoft Corporation 1998-2002. All rights reserved. @@ -175,6 +176,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 113 (0x71) .maxstack 1 diff --git a/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract02.il b/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract02.il index e6882cfca5bb19..d5ed3e2d7a9d66 100644 --- a/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract02.il +++ b/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract02.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly abstract02{.custom instance void [mscorlib]System.Security.SecurityRulesAttribute::.ctor(valuetype [mscorlib]System.Security.SecurityRuleSet) = ( 01 00 02 00 00 ) .custom instance void [mscorlib]System.Security.SecurityTransparentAttribute::.ctor() = ( 01 00 00 00 )} @@ -157,6 +158,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 113 (0x71) .maxstack 1 diff --git a/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract03.il b/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract03.il index 847f46e5fae057..b829c77d82de88 100644 --- a/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract03.il +++ b/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract03.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly abstract03{} @@ -130,6 +131,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 53 (0x35) .maxstack 1 diff --git a/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract04.il b/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract04.il index cafb4e2bae7495..5f77e945d88ffb 100644 --- a/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract04.il +++ b/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract04.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib{} .assembly abstract04{} @@ -139,6 +140,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 113 (0x71) .maxstack 1 diff --git a/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract05.il b/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract05.il index 789d770e0cc113..e242c7368e8eac 100644 --- a/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract05.il +++ b/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract05.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // DESCRIPTION: // // This tests that a generic class that implements an abstract interface cannot @@ -183,6 +184,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 113 (0x71) .maxstack 1 diff --git a/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract06.il b/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract06.il index 12199343db2951..03e2831eb896d7 100644 --- a/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract06.il +++ b/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract06.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // DESCRIPTION: // // This tests that a non-generic class that implements a generic abstract interface cannot @@ -182,6 +183,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 53 (0x35) .maxstack 1 diff --git a/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract07.il b/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract07.il index 21bcbe840c292f..783ba97cccc6c4 100644 --- a/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract07.il +++ b/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract07.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // DESCRIPTION: // // This tests that a generic class that implements a non-generic abstract interface cannot @@ -182,6 +183,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 113 (0x71) .maxstack 1 diff --git a/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract08.il b/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract08.il index ee58cc5dd3ea42..3387b48a8855ed 100644 --- a/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract08.il +++ b/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract08.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // DESCRIPTION: // // This tests that a generic struct that implements a generic abstract interface cannot @@ -174,6 +175,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 113 (0x71) .maxstack 1 diff --git a/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract09.il b/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract09.il index a1db8b1a3f631a..812c55cd64eb56 100644 --- a/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract09.il +++ b/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract09.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // DESCRIPTION: // // This tests that a non-generic struct that implements a generic abstract interface cannot @@ -147,6 +148,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 53 (0x35) .maxstack 1 diff --git a/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract10.il b/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract10.il index 624dd438022115..482437c096dacc 100644 --- a/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract10.il +++ b/src/tests/Loader/classloader/generics/Instantiation/Negative/abstract10.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // DESCRIPTION: // // This tests that a generic struct that implements a non-generic abstract interface cannot @@ -177,6 +178,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 113 (0x71) .maxstack 1 diff --git a/src/tests/Loader/classloader/generics/Instantiation/Negative/param01.il b/src/tests/Loader/classloader/generics/Instantiation/Negative/param01.il index 50d534c50ba917..bf2a24a804c1b1 100644 --- a/src/tests/Loader/classloader/generics/Instantiation/Negative/param01.il +++ b/src/tests/Loader/classloader/generics/Instantiation/Negative/param01.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // DESCRIPTION: // This tests that a MissingMethodException is thrown when a constructor // of a generic class is invoked via newobj without a type parameter. @@ -182,6 +183,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 113 (0x71) .maxstack 1 diff --git a/src/tests/Loader/classloader/generics/Instantiation/Negative/param02.il b/src/tests/Loader/classloader/generics/Instantiation/Negative/param02.il index e069eb9ba59fbf..2e528c4ce01fdc 100644 --- a/src/tests/Loader/classloader/generics/Instantiation/Negative/param02.il +++ b/src/tests/Loader/classloader/generics/Instantiation/Negative/param02.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // DESCRIPTION: // This tests that a TypeLoadException is thrown when a constructor // of a generic class with one formal type parameter is invoked via newobj @@ -182,6 +183,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 113 (0x71) .maxstack 1 diff --git a/src/tests/Loader/classloader/generics/Instantiation/Negative/param03.il b/src/tests/Loader/classloader/generics/Instantiation/Negative/param03.il index f632c7bbc7c083..052d7ff4e5cd42 100644 --- a/src/tests/Loader/classloader/generics/Instantiation/Negative/param03.il +++ b/src/tests/Loader/classloader/generics/Instantiation/Negative/param03.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // DESCRIPTION: // This tests that a MissingMethodException is thrown when an instance method // of a generic class with one formal type parameter is invoked via the call @@ -172,6 +173,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 113 (0x71) .maxstack 1 diff --git a/src/tests/Loader/classloader/generics/Instantiation/Negative/param04.il b/src/tests/Loader/classloader/generics/Instantiation/Negative/param04.il index cf0acfee2e4536..c350d7a81aa90b 100644 --- a/src/tests/Loader/classloader/generics/Instantiation/Negative/param04.il +++ b/src/tests/Loader/classloader/generics/Instantiation/Negative/param04.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // DESCRIPTION: // This tests that a TypeLoadException is thrown when an instance method // of a generic class with one formal type parameter is invoked via the call @@ -172,6 +173,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 113 (0x71) .maxstack 1 diff --git a/src/tests/Loader/classloader/generics/Instantiation/Negative/param05.il b/src/tests/Loader/classloader/generics/Instantiation/Negative/param05.il index d6bd3227eccf7f..9b491f567577fe 100644 --- a/src/tests/Loader/classloader/generics/Instantiation/Negative/param05.il +++ b/src/tests/Loader/classloader/generics/Instantiation/Negative/param05.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 1.1.2019.0 // Copyright (C) Microsoft Corporation 1998-2002. All rights reserved. @@ -166,6 +167,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 113 (0x71) .maxstack 1 diff --git a/src/tests/Loader/classloader/generics/Instantiation/Negative/param06.il b/src/tests/Loader/classloader/generics/Instantiation/Negative/param06.il index ff4fd51779f849..5909932eb6bcb1 100644 --- a/src/tests/Loader/classloader/generics/Instantiation/Negative/param06.il +++ b/src/tests/Loader/classloader/generics/Instantiation/Negative/param06.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 1.1.2019.0 // Copyright (C) Microsoft Corporation 1998-2002. All rights reserved. @@ -166,6 +167,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 113 (0x71) .maxstack 1 diff --git a/src/tests/Loader/classloader/generics/Instantiation/Negative/param07.il b/src/tests/Loader/classloader/generics/Instantiation/Negative/param07.il index 04b7ca266ed6c7..417193c7b0a1e2 100644 --- a/src/tests/Loader/classloader/generics/Instantiation/Negative/param07.il +++ b/src/tests/Loader/classloader/generics/Instantiation/Negative/param07.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 1.1.2019.0 // Copyright (C) Microsoft Corporation 1998-2002. All rights reserved. @@ -163,6 +164,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 113 (0x71) .maxstack 1 diff --git a/src/tests/Loader/classloader/generics/Instantiation/Negative/param08.il b/src/tests/Loader/classloader/generics/Instantiation/Negative/param08.il index ed762cd32a6a1c..86c795810f81d2 100644 --- a/src/tests/Loader/classloader/generics/Instantiation/Negative/param08.il +++ b/src/tests/Loader/classloader/generics/Instantiation/Negative/param08.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 1.1.2019.0 // Copyright (C) Microsoft Corporation 1998-2002. All rights reserved. @@ -163,6 +164,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 113 (0x71) .maxstack 1 diff --git a/src/tests/Loader/classloader/generics/VSD/Class_ExplicitOverrideVirtualNewslot.il b/src/tests/Loader/classloader/generics/VSD/Class_ExplicitOverrideVirtualNewslot.il index 713d1313501dbf..4e6e19ca9efb32 100644 --- a/src/tests/Loader/classloader/generics/VSD/Class_ExplicitOverrideVirtualNewslot.il +++ b/src/tests/Loader/classloader/generics/VSD/Class_ExplicitOverrideVirtualNewslot.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // This test is the same as ExplicitOverrideVirtualNewslotFinal.cs // The difference is that here the virtual methods are 'virtual newslot' as opposed to // 'virtual newslot final' @@ -816,6 +817,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 73 (0x49) .maxstack 2 diff --git a/src/tests/Loader/classloader/generics/VSD/Struct_ExplicitOverrideVirtualNewslot.il b/src/tests/Loader/classloader/generics/VSD/Struct_ExplicitOverrideVirtualNewslot.il index 042e5fa99392b6..7f5c25acddde19 100644 --- a/src/tests/Loader/classloader/generics/VSD/Struct_ExplicitOverrideVirtualNewslot.il +++ b/src/tests/Loader/classloader/generics/VSD/Struct_ExplicitOverrideVirtualNewslot.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // this test is the same as Struct_ExplicitOverrideVirtualNewslotFinal.cs only for 'virtual newslot' instead of // 'virtual newslot final' @@ -803,6 +804,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 73 (0x49) .maxstack 2 diff --git a/src/tests/Loader/classloader/generics/VSD/Struct_ImplicitOverrideVirtualNewslot.il b/src/tests/Loader/classloader/generics/VSD/Struct_ImplicitOverrideVirtualNewslot.il index 6d200c5d052fde..cb456154ae07b6 100644 --- a/src/tests/Loader/classloader/generics/VSD/Struct_ImplicitOverrideVirtualNewslot.il +++ b/src/tests/Loader/classloader/generics/VSD/Struct_ImplicitOverrideVirtualNewslot.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // this test is the equivalent of Class_ImplicitOverrideVirtualNewslot.cs for structs. // The reason we are using IL is because C# doesn't allow struct to have virtual methods with 'virtual' keyword. // Methods that implement interface methods are by default virtual (which translates to 'virtual newslot final' in IL. @@ -795,6 +796,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 73 (0x49) .maxstack 2 diff --git a/src/tests/Loader/classloader/generics/Variance/Interfaces/NoVarianceCheckForStaticMethods.il b/src/tests/Loader/classloader/generics/Variance/Interfaces/NoVarianceCheckForStaticMethods.il index fdb11f2401ec8a..bd362ecb534c58 100644 --- a/src/tests/Loader/classloader/generics/Variance/Interfaces/NoVarianceCheckForStaticMethods.il +++ b/src/tests/Loader/classloader/generics/Variance/Interfaces/NoVarianceCheckForStaticMethods.il @@ -7,6 +7,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: .ver 4:2:2:0 } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: @@ -41,6 +42,9 @@ { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 34 (0x22) .maxstack 8 @@ -92,4 +96,4 @@ // ============================================================= -// *********** DISASSEMBLY COMPLETE *********************** \ No newline at end of file +// *********** DISASSEMBLY COMPLETE *********************** diff --git a/src/tests/Loader/classloader/generics/Variance/Regressions/dev10_468712/dev10_468712.il b/src/tests/Loader/classloader/generics/Variance/Regressions/dev10_468712/dev10_468712.il index 18e10d7e12ef0b..b0007d5517f8e8 100644 --- a/src/tests/Loader/classloader/generics/Variance/Regressions/dev10_468712/dev10_468712.il +++ b/src/tests/Loader/classloader/generics/Variance/Regressions/dev10_468712/dev10_468712.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 4.0.10707.0 // Copyright (c) Microsoft Corporation. All rights reserved. @@ -74,6 +75,9 @@ { .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init ([0] class ConsoleApplicationVB.ICovariant`1 y) diff --git a/src/tests/Loader/classloader/generics/regressions/109968/test.il b/src/tests/Loader/classloader/generics/regressions/109968/test.il index 62ca9d1b5f853b..a76c987a03df12 100644 --- a/src/tests/Loader/classloader/generics/regressions/109968/test.il +++ b/src/tests/Loader/classloader/generics/regressions/109968/test.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly test {} @@ -113,6 +114,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 60 (0x3c) .maxstack 3 diff --git a/src/tests/Loader/classloader/generics/regressions/dev10_393447/dev10_393447.il b/src/tests/Loader/classloader/generics/regressions/dev10_393447/dev10_393447.il index 81f3e7f39d7e23..90dc47a2a5d0f4 100644 --- a/src/tests/Loader/classloader/generics/regressions/dev10_393447/dev10_393447.il +++ b/src/tests/Loader/classloader/generics/regressions/dev10_393447/dev10_393447.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} /* using System; @@ -180,6 +181,9 @@ class Program .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 51 (0x33) .maxstack 8 diff --git a/src/tests/Loader/classloader/generics/regressions/dev10_531793/dev10_531793.il b/src/tests/Loader/classloader/generics/regressions/dev10_531793/dev10_531793.il index 5c4c4604d38c22..aaa2ad9212d9ac 100644 --- a/src/tests/Loader/classloader/generics/regressions/dev10_531793/dev10_531793.il +++ b/src/tests/Loader/classloader/generics/regressions/dev10_531793/dev10_531793.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. @@ -49,6 +50,9 @@ { .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 .locals init ([0] class T1 t, [1] class N`1 v, int32) diff --git a/src/tests/Loader/classloader/generics/regressions/vsw395780/testExplicitOverride2.il b/src/tests/Loader/classloader/generics/regressions/vsw395780/testExplicitOverride2.il index ffb08c13e399cd..f563b787af04d8 100644 --- a/src/tests/Loader/classloader/generics/regressions/vsw395780/testExplicitOverride2.il +++ b/src/tests/Loader/classloader/generics/regressions/vsw395780/testExplicitOverride2.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // this test is also regression test for VSW 395780. The difference is that // .override directive in this case is in the class scope, whereas in testExplicitOverride // .override directive is in method scope. @@ -83,6 +84,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 105 (0x69) .maxstack 2 diff --git a/src/tests/Loader/classloader/nesting/Tests/nesting4.il b/src/tests/Loader/classloader/nesting/Tests/nesting4.il index f42ba93898379a..5abe69683e580a 100644 --- a/src/tests/Loader/classloader/nesting/Tests/nesting4.il +++ b/src/tests/Loader/classloader/nesting/Tests/nesting4.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // model revision #2 // To compile: ilasm nesting4.il @@ -42,6 +43,9 @@ .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class [mscorlib]System.Exception V_0, int32 V_1) diff --git a/src/tests/Loader/classloader/nesting/Tests/nesting63.il b/src/tests/Loader/classloader/nesting/Tests/nesting63.il index 0153c358e24649..d140e57f1272d7 100644 --- a/src/tests/Loader/classloader/nesting/Tests/nesting63.il +++ b/src/tests/Loader/classloader/nesting/Tests/nesting63.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // model revision #2 // To compile: ilasm nesting63.il @@ -61,6 +62,9 @@ .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class [mscorlib]System.Exception V_0, int32 V_1) diff --git a/src/tests/Loader/classloader/nesting/Tests/nesting7.il b/src/tests/Loader/classloader/nesting/Tests/nesting7.il index d90a182ce43ac6..52317caa010941 100644 --- a/src/tests/Loader/classloader/nesting/Tests/nesting7.il +++ b/src/tests/Loader/classloader/nesting/Tests/nesting7.il @@ -3,6 +3,7 @@ .assembly extern System.Console { auto } +.assembly extern xunit.core {} .assembly extern mscorlib { auto } // model revision #2 @@ -109,6 +110,9 @@ .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class [mscorlib]System.Exception V_0, int32 V_1) diff --git a/src/tests/Loader/classloader/nesting/coreclr/exec3.il b/src/tests/Loader/classloader/nesting/coreclr/exec3.il index 84b296707234e5..0a7072b7119706 100644 --- a/src/tests/Loader/classloader/nesting/coreclr/exec3.il +++ b/src/tests/Loader/classloader/nesting/coreclr/exec3.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // model revision #2 // To compile: ilasm exec3.il @@ -17,6 +18,9 @@ .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class [mscorlib]System.Exception V_0, int32 V_1) diff --git a/src/tests/Loader/classloader/nesting/coreclr/nesting18.il b/src/tests/Loader/classloader/nesting/coreclr/nesting18.il index a73148b9a17727..5e4d133a264a39 100644 --- a/src/tests/Loader/classloader/nesting/coreclr/nesting18.il +++ b/src/tests/Loader/classloader/nesting/coreclr/nesting18.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // model revision #1 // to compile: ilasm nesting18.il @@ -42,6 +43,9 @@ // entry point location: nested type .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class Client V_0, diff --git a/src/tests/Loader/classloader/nesting/coreclr/nesting31.il b/src/tests/Loader/classloader/nesting/coreclr/nesting31.il index 9b85c06b8d6c3f..42fdabd7a590e7 100644 --- a/src/tests/Loader/classloader/nesting/coreclr/nesting31.il +++ b/src/tests/Loader/classloader/nesting/coreclr/nesting31.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // model revision #1 // to compile: ilasm nesting31.il @@ -53,6 +54,9 @@ // entrypoint location: Enclosing type .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class Client V_0, diff --git a/src/tests/Loader/classloader/regressions/139056/Foo.il b/src/tests/Loader/classloader/regressions/139056/Foo.il index 81e40efe7fd7f2..885baddfd3da8f 100644 --- a/src/tests/Loader/classloader/regressions/139056/Foo.il +++ b/src/tests/Loader/classloader/regressions/139056/Foo.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 1.2.30612.00 // Copyright (C) Microsoft Corporation 1998-2003. All rights reserved. @@ -106,6 +107,9 @@ .method public static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class Bar V_0, class Foo V_1, diff --git a/src/tests/Loader/classloader/regressions/181424/test5.il b/src/tests/Loader/classloader/regressions/181424/test5.il index 49ac50b1b05389..f3fbfb0f877c35 100644 --- a/src/tests/Loader/classloader/regressions/181424/test5.il +++ b/src/tests/Loader/classloader/regressions/181424/test5.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly test5{} .assembly extern test5{} .assembly extern mscorlib{} @@ -48,6 +49,9 @@ } .method public static int32 Main(){ + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init(int32 retVal) // there's no way to get to Foo through TypeRef diff --git a/src/tests/Loader/classloader/regressions/226741/test3.il b/src/tests/Loader/classloader/regressions/226741/test3.il index cfb35508987c2d..2b61c2ffd4ccc4 100644 --- a/src/tests/Loader/classloader/regressions/226741/test3.il +++ b/src/tests/Loader/classloader/regressions/226741/test3.il @@ -2,11 +2,15 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly test3{} .assembly extern mscorlib{} .class public CMain{ .method public static int32 Main(){ + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint call int32 IFoo::Foo() ret diff --git a/src/tests/Loader/classloader/regressions/421439/Test.il b/src/tests/Loader/classloader/regressions/421439/Test.il index 616970895fb078..12c0d745b9b127 100644 --- a/src/tests/Loader/classloader/regressions/421439/Test.il +++ b/src/tests/Loader/classloader/regressions/421439/Test.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly extern RefX1 {} .assembly extern ValX1 {} @@ -34,6 +35,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 nop diff --git a/src/tests/Loader/classloader/regressions/429802/CMain.il b/src/tests/Loader/classloader/regressions/429802/CMain.il index ddc933cf17b263..00363ba266de8d 100644 --- a/src/tests/Loader/classloader/regressions/429802/CMain.il +++ b/src/tests/Loader/classloader/regressions/429802/CMain.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 2.0.41217.00 // Copyright (C) Microsoft Corporation. All rights reserved. @@ -48,6 +49,9 @@ { .method public hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 106 (0x6a) .maxstack 2 diff --git a/src/tests/Loader/classloader/regressions/440935/Test.il b/src/tests/Loader/classloader/regressions/440935/Test.il index 0e58968346c2fb..68cc307f71b44b 100644 --- a/src/tests/Loader/classloader/regressions/440935/Test.il +++ b/src/tests/Loader/classloader/regressions/440935/Test.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 2.0.50117.00 // Copyright (C) Microsoft Corporation. All rights reserved. @@ -45,6 +46,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 8 (0x8) .maxstack 8 diff --git a/src/tests/Loader/classloader/regressions/452707/b452707.il b/src/tests/Loader/classloader/regressions/452707/b452707.il index 1d701c137cebe7..144f738517ed7a 100644 --- a/src/tests/Loader/classloader/regressions/452707/b452707.il +++ b/src/tests/Loader/classloader/regressions/452707/b452707.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // this is regression test for VSW 452707 // Overriding MyS.ToString caused an AV since we were attempting to create precode // before the slot that the method desc points to has been filled in. @@ -35,6 +36,9 @@ { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 diff --git a/src/tests/Loader/classloader/regressions/GitHub_11371/Negative_ByRefLikeType.il b/src/tests/Loader/classloader/regressions/GitHub_11371/Negative_ByRefLikeType.il index 6a42a9ec0ee14d..fa3197175abdfa 100644 --- a/src/tests/Loader/classloader/regressions/GitHub_11371/Negative_ByRefLikeType.il +++ b/src/tests/Loader/classloader/regressions/GitHub_11371/Negative_ByRefLikeType.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern System.Runtime { } .assembly Negative_ByRefLikeType { } @@ -85,6 +86,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 1 diff --git a/src/tests/Loader/classloader/regressions/GitHub_41571/GitHub_41571.il b/src/tests/Loader/classloader/regressions/GitHub_41571/GitHub_41571.il index 24cc588ca03cb5..040d506c6b72c9 100644 --- a/src/tests/Loader/classloader/regressions/GitHub_41571/GitHub_41571.il +++ b/src/tests/Loader/classloader/regressions/GitHub_41571/GitHub_41571.il @@ -8,6 +8,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: .ver 5:0:0:0 } +.assembly extern xunit.core {} .assembly '41571' { .custom instance void [System.Runtime]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) @@ -48,6 +49,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 19 (0x13) .maxstack 1 diff --git a/src/tests/Loader/classloader/regressions/dev10_403582/dev10_403582.il b/src/tests/Loader/classloader/regressions/dev10_403582/dev10_403582.il index 4c35e56221065f..fcc0ea0c355c0a 100644 --- a/src/tests/Loader/classloader/regressions/dev10_403582/dev10_403582.il +++ b/src/tests/Loader/classloader/regressions/dev10_403582/dev10_403582.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} //DDB187632: generic types and generic methods with more than 0xFFFF generic arguments should throw a TypeLoadException .assembly extern mscorlib @@ -102,6 +103,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 155 (0x9b) .maxstack 2 diff --git a/src/tests/Loader/classloader/regressions/dev10_443322/dev10_443322.il b/src/tests/Loader/classloader/regressions/dev10_443322/dev10_443322.il index 83669b2b2100cb..b8f0544c0c53c7 100644 --- a/src/tests/Loader/classloader/regressions/dev10_443322/dev10_443322.il +++ b/src/tests/Loader/classloader/regressions/dev10_443322/dev10_443322.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // // Non-virtual call of System.Type.TypeHandle on result of ldtoken should not trigger typeof(XXX).TypeHandle optimization // @@ -65,6 +66,9 @@ static int Main() { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 62 (0x3e) .maxstack 1 diff --git a/src/tests/Loader/classloader/regressions/dev10_493135/dev10_493135.il b/src/tests/Loader/classloader/regressions/dev10_493135/dev10_493135.il index f394faebb891c3..2793090e7a4a3d 100644 --- a/src/tests/Loader/classloader/regressions/dev10_493135/dev10_493135.il +++ b/src/tests/Loader/classloader/regressions/dev10_493135/dev10_493135.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30829.00 // Copyright (c) Microsoft Corporation. All rights reserved. @@ -66,6 +67,9 @@ { .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 15 (0xf) .maxstack 1 diff --git a/src/tests/Loader/classloader/regressions/dev10_568786/4_Misc/MethodCalls.il b/src/tests/Loader/classloader/regressions/dev10_568786/4_Misc/MethodCalls.il index 735c168208059e..d4164c196a9d82 100644 --- a/src/tests/Loader/classloader/regressions/dev10_568786/4_Misc/MethodCalls.il +++ b/src/tests/Loader/classloader/regressions/dev10_568786/4_Misc/MethodCalls.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 4.0.20529.0 // Copyright (c) Microsoft Corporation. All rights reserved. @@ -356,6 +357,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 375 (0x177) .maxstack 2 diff --git a/src/tests/Loader/classloader/regressions/dev10_568786/4_Misc/RecursiveGen.il b/src/tests/Loader/classloader/regressions/dev10_568786/4_Misc/RecursiveGen.il index 42d8a6eea2bd22..dd1f6baaf3e292 100644 --- a/src/tests/Loader/classloader/regressions/dev10_568786/4_Misc/RecursiveGen.il +++ b/src/tests/Loader/classloader/regressions/dev10_568786/4_Misc/RecursiveGen.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 4.0.20618.0 // Copyright (c) Microsoft Corporation. All rights reserved. @@ -215,6 +216,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 206 (0xce) .maxstack 2 diff --git a/src/tests/Loader/classloader/regressions/dev10_568786/4_Misc/SealedTypes.il b/src/tests/Loader/classloader/regressions/dev10_568786/4_Misc/SealedTypes.il index 0b00f496c0b830..2d8798ef059425 100644 --- a/src/tests/Loader/classloader/regressions/dev10_568786/4_Misc/SealedTypes.il +++ b/src/tests/Loader/classloader/regressions/dev10_568786/4_Misc/SealedTypes.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 4.0.20528.0 // Copyright (c) Microsoft Corporation. All rights reserved. @@ -859,6 +860,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 882 (0x372) .maxstack 6 diff --git a/src/tests/Loader/classloader/regressions/dev10_568786/4_Misc/Variance1.il b/src/tests/Loader/classloader/regressions/dev10_568786/4_Misc/Variance1.il index 1a8c44f89234db..4683ad354d9a80 100644 --- a/src/tests/Loader/classloader/regressions/dev10_568786/4_Misc/Variance1.il +++ b/src/tests/Loader/classloader/regressions/dev10_568786/4_Misc/Variance1.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 4.0.20528.0 // Copyright (c) Microsoft Corporation. All rights reserved. @@ -562,6 +563,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 898 (0x382) .maxstack 6 diff --git a/src/tests/Loader/classloader/regressions/dev10_568786/4_Misc/Variance2.il b/src/tests/Loader/classloader/regressions/dev10_568786/4_Misc/Variance2.il index 609705054d45fe..dca99bd67e643c 100644 --- a/src/tests/Loader/classloader/regressions/dev10_568786/4_Misc/Variance2.il +++ b/src/tests/Loader/classloader/regressions/dev10_568786/4_Misc/Variance2.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 4.0.20528.0 // Copyright (c) Microsoft Corporation. All rights reserved. @@ -790,6 +791,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 898 (0x382) .maxstack 6 diff --git a/src/tests/Loader/classloader/regressions/dev10_710121/dev10_710121.il b/src/tests/Loader/classloader/regressions/dev10_710121/dev10_710121.il index b379d2f662fc91..3f95ba2a650f60 100644 --- a/src/tests/Loader/classloader/regressions/dev10_710121/dev10_710121.il +++ b/src/tests/Loader/classloader/regressions/dev10_710121/dev10_710121.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} /*BUG: Assert: Precondition failure: FAILED: !ContainsGenericVariables() (vm\method.cpp, Line: 1781) The bug related to populating MethodDesc slots in generic dictionaries at runtime. @@ -86,6 +87,9 @@ The bug related to populating MethodDesc slots in generic dictionaries at runtim } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 diff --git a/src/tests/Loader/classloader/regressions/dev10_715437/dev10_715437.il b/src/tests/Loader/classloader/regressions/dev10_715437/dev10_715437.il index de846e7fccc274..7a8cf4ac9706d6 100644 --- a/src/tests/Loader/classloader/regressions/dev10_715437/dev10_715437.il +++ b/src/tests/Loader/classloader/regressions/dev10_715437/dev10_715437.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} /* if there are 3 classes A,B and C, and B inherits from A and C inherits from B, and classes A and B have a public virtual newslot method M(), calling C::M() @@ -85,6 +86,9 @@ function call DerivedDerived::Method() since the method is not defined on this t .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 diff --git a/src/tests/Loader/classloader/regressions/dev10_720779/dev10_720779.il b/src/tests/Loader/classloader/regressions/dev10_720779/dev10_720779.il index 830655c6bd1b69..da4d2520673d44 100644 --- a/src/tests/Loader/classloader/regressions/dev10_720779/dev10_720779.il +++ b/src/tests/Loader/classloader/regressions/dev10_720779/dev10_720779.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} /* We basically have an interface I, class Base that implements I and class Derived that inherits from Base, and implements I. I has a method string Method(). @@ -109,6 +110,9 @@ where MyClosedDel is: } // end of method Test::CheckResult .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 .locals init (object V_0) diff --git a/src/tests/Loader/classloader/regressions/dev10_788724/dev10_788724.il b/src/tests/Loader/classloader/regressions/dev10_788724/dev10_788724.il index 3ac5701667ef5a..0126124a2f2cb9 100644 --- a/src/tests/Loader/classloader/regressions/dev10_788724/dev10_788724.il +++ b/src/tests/Loader/classloader/regressions/dev10_788724/dev10_788724.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib {} .assembly Generated0 {} .module Generated0.exe @@ -188,6 +189,9 @@ } .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 10 diff --git a/src/tests/Loader/classloader/regressions/vsw188290/vsw188290.il b/src/tests/Loader/classloader/regressions/vsw188290/vsw188290.il index d529c8cda5600a..a09708f82940f6 100644 --- a/src/tests/Loader/classloader/regressions/vsw188290/vsw188290.il +++ b/src/tests/Loader/classloader/regressions/vsw188290/vsw188290.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} // Microsoft (R) .NET Framework IL Disassembler. Version 2.0.31013.0 // Copyright (C) Microsoft Corporation 1998-2003. All rights reserved. @@ -95,6 +96,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 247 (0xf7) .maxstack 5 diff --git a/src/tests/Loader/classloader/regressions/vsw305955/GenericAssert.il b/src/tests/Loader/classloader/regressions/vsw305955/GenericAssert.il index 3acf4038147d53..f2b447a7d0444b 100644 --- a/src/tests/Loader/classloader/regressions/vsw305955/GenericAssert.il +++ b/src/tests/Loader/classloader/regressions/vsw305955/GenericAssert.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly extern mscorlib { } .assembly GenericAssert { @@ -34,6 +35,9 @@ { .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 diff --git a/src/tests/Loader/classloader/rmv/il/RMV-2-15-12b.il b/src/tests/Loader/classloader/rmv/il/RMV-2-15-12b.il index fef1fe07f0fa84..165e55f3e2007b 100644 --- a/src/tests/Loader/classloader/rmv/il/RMV-2-15-12b.il +++ b/src/tests/Loader/classloader/rmv/il/RMV-2-15-12b.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { } +.assembly extern xunit.core {} .assembly 'RMV-2-15-12'{} .assembly extern mscorlib {} @@ -47,6 +48,9 @@ ret } .method public static int32 Main(){ + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try{ call void CMain::DeferJitIndirect() diff --git a/src/tests/Loader/regressions/polyrec/Polyrec.csproj b/src/tests/Loader/regressions/polyrec/Polyrec.csproj index 794524e4dc9f0c..f3f7177188e83e 100644 --- a/src/tests/Loader/regressions/polyrec/Polyrec.csproj +++ b/src/tests/Loader/regressions/polyrec/Polyrec.csproj @@ -1,7 +1,5 @@ - Exe - 4 50 1 true diff --git a/src/tests/Loader/regressions/polyrec/polyrec.cs b/src/tests/Loader/regressions/polyrec/polyrec.cs index 12d8e1ae421b64..7b2b512bd7f89f 100644 --- a/src/tests/Loader/regressions/polyrec/polyrec.cs +++ b/src/tests/Loader/regressions/polyrec/polyrec.cs @@ -8,6 +8,7 @@ // and niters it the number of type/method instantiations to create each thread using System; using System.Threading; +using Xunit; // Spice things up a bit with some mutual recursion between instantiations class C @@ -63,24 +64,24 @@ public static void Start2() genmeth2(ninsts); } - public static int Main(String[] args) + public static void Test(int threads, int insts) { - if (args.Length < 2) - { - Console.WriteLine("Usage: polyrec "); - return 99; - } - - nthreads = Int32.Parse(args[0]); - ninsts = Int32.Parse(args[1]); + nthreads = threads; + ninsts = insts; for (int i = 0; i < nthreads; i++) - { + { Thread t = new Thread(i % 2 == 0 ? new ThreadStart(Start) : new ThreadStart(Start2)); t.Name = "Thread " + i; t.Start(); } - Console.WriteLine("Main thread exited"); - return 100; + + Console.WriteLine("Main thread exited"); + } + + [Fact] + public static void Test_4_50() + { + Test(4, 50); } } diff --git a/src/tests/Regressions/coreclr/15241/genericcontext.il b/src/tests/Regressions/coreclr/15241/genericcontext.il index 15290161cae2df..80ce038f4810fb 100644 --- a/src/tests/Regressions/coreclr/15241/genericcontext.il +++ b/src/tests/Regressions/coreclr/15241/genericcontext.il @@ -1,4 +1,5 @@ .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Runtime { } @@ -58,6 +59,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint ldstr "DefaultImplementationsOfInterfaces" diff --git a/src/tests/Regressions/coreclr/15647/interfacestatics.il b/src/tests/Regressions/coreclr/15647/interfacestatics.il index 0ba2f1f6387408..971096939739d2 100644 --- a/src/tests/Regressions/coreclr/15647/interfacestatics.il +++ b/src/tests/Regressions/coreclr/15647/interfacestatics.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly interfacestatics { } +.assembly extern xunit.core {} .assembly extern System.Runtime { } @@ -40,6 +41,9 @@ .method static hidebysig int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint ldsfld class [System.Runtime]System.Type class IFoo::O diff --git a/src/tests/Regressions/coreclr/15650/interfacecctor.il b/src/tests/Regressions/coreclr/15650/interfacecctor.il index 4778f369640194..e732f9f121106e 100644 --- a/src/tests/Regressions/coreclr/15650/interfacecctor.il +++ b/src/tests/Regressions/coreclr/15650/interfacecctor.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly interfacecctor { } .class interface private abstract auto ansi IFoo @@ -42,6 +43,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 8 newobj instance void Fooer::.ctor() diff --git a/src/tests/Regressions/coreclr/15827/nonvirtualcall.il b/src/tests/Regressions/coreclr/15827/nonvirtualcall.il index efaa1de9548d5a..b10cfbcfc1cf2b 100644 --- a/src/tests/Regressions/coreclr/15827/nonvirtualcall.il +++ b/src/tests/Regressions/coreclr/15827/nonvirtualcall.il @@ -7,6 +7,7 @@ // .assembly extern System.Runtime { } +.assembly extern xunit.core {} .assembly nonvirtualcall { } @@ -55,6 +56,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint ldstr "DefaultImplementationsOfInterfaces" diff --git a/src/tests/Regressions/coreclr/16064/methodimpl.il b/src/tests/Regressions/coreclr/16064/methodimpl.il index 67d79d6b1c21fb..9e7376b44de644 100644 --- a/src/tests/Regressions/coreclr/16064/methodimpl.il +++ b/src/tests/Regressions/coreclr/16064/methodimpl.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Runtime { } +.assembly extern xunit.core {} .assembly methodimpl { } @@ -43,6 +44,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint ldstr "DefaultImplementationsOfInterfaces" call bool [System.Runtime]System.Runtime.CompilerServices.RuntimeFeature::IsSupported(string) diff --git a/src/tests/Regressions/coreclr/16123/ambiguousconstraint.il b/src/tests/Regressions/coreclr/16123/ambiguousconstraint.il index b50fa0dfd86a8a..62a2f81ec6a424 100644 --- a/src/tests/Regressions/coreclr/16123/ambiguousconstraint.il +++ b/src/tests/Regressions/coreclr/16123/ambiguousconstraint.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Runtime { } +.assembly extern xunit.core {} // TODO: use the contract once this is exposed from contracts .assembly extern System.Runtime { } @@ -69,6 +70,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (valuetype Fooer) ldloc.0 diff --git a/src/tests/Regressions/coreclr/16354/notimplemented.il b/src/tests/Regressions/coreclr/16354/notimplemented.il index 7bf524bb9fc589..25697fd90761e6 100644 --- a/src/tests/Regressions/coreclr/16354/notimplemented.il +++ b/src/tests/Regressions/coreclr/16354/notimplemented.il @@ -6,6 +6,7 @@ // (but it actually doesn't) will not be loadable. .assembly extern System.Runtime { } +.assembly extern xunit.core {} .assembly notimplemented { } @@ -48,6 +49,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try diff --git a/src/tests/Regressions/coreclr/16355/boring.il b/src/tests/Regressions/coreclr/16355/boring.il index b0e0bceb04935c..aadb0069930ac2 100644 --- a/src/tests/Regressions/coreclr/16355/boring.il +++ b/src/tests/Regressions/coreclr/16355/boring.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Runtime { } +.assembly extern xunit.core {} .assembly boring { } @@ -68,6 +69,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void class Fooer::.ctor() diff --git a/src/tests/Regressions/coreclr/16355/variance.il b/src/tests/Regressions/coreclr/16355/variance.il index c2f9f712fb485a..47483c6c9860ad 100644 --- a/src/tests/Regressions/coreclr/16355/variance.il +++ b/src/tests/Regressions/coreclr/16355/variance.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Runtime { } +.assembly extern xunit.core {} .assembly variance { } @@ -39,6 +40,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals (valuetype [System.Runtime]System.RuntimeTypeHandle) newobj instance void class Fooer::.ctor() diff --git a/src/tests/Regressions/coreclr/16775/sharedinterfacemethod.il b/src/tests/Regressions/coreclr/16775/sharedinterfacemethod.il index 308ead9a37ebf6..f0d52771a526e4 100644 --- a/src/tests/Regressions/coreclr/16775/sharedinterfacemethod.il +++ b/src/tests/Regressions/coreclr/16775/sharedinterfacemethod.il @@ -1,4 +1,5 @@ .assembly extern System.Runtime { } +.assembly extern xunit.core {} .assembly sharedinterfacemethod { } @@ -28,6 +29,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Callvirt to a shared interface method diff --git a/src/tests/Regressions/coreclr/22021/consumer.il b/src/tests/Regressions/coreclr/22021/consumer.il index 6ee84ed5e19e7a..592db8ae3c45cd 100644 --- a/src/tests/Regressions/coreclr/22021/consumer.il +++ b/src/tests/Regressions/coreclr/22021/consumer.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Runtime { } +.assembly extern xunit.core {} .assembly extern provider { } @@ -18,6 +19,9 @@ { .method private hidebysig static int32 Main() { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class Test1) newobj instance void Test1::.ctor() diff --git a/src/tests/Regressions/coreclr/22021/provider.ilproj b/src/tests/Regressions/coreclr/22021/provider.ilproj index a10e6d25b0e4fb..38ea2d326750d2 100644 --- a/src/tests/Regressions/coreclr/22021/provider.ilproj +++ b/src/tests/Regressions/coreclr/22021/provider.ilproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/Regressions/coreclr/22386/debug3.il b/src/tests/Regressions/coreclr/22386/debug3.il index 7cec9609b5cdb4..74890d63bc558d 100644 --- a/src/tests/Regressions/coreclr/22386/debug3.il +++ b/src/tests/Regressions/coreclr/22386/debug3.il @@ -3,6 +3,7 @@ // .assembly extern System.Runtime { } +.assembly extern xunit.core {} .assembly extern System.Console { } .assembly debug3 { } @@ -97,6 +98,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (class I1 V_0, valuetype Test1 V_1, diff --git a/src/tests/Regressions/coreclr/22407/abstractcalls.il b/src/tests/Regressions/coreclr/22407/abstractcalls.il index afda4619f9379a..af73050f379d60 100644 --- a/src/tests/Regressions/coreclr/22407/abstractcalls.il +++ b/src/tests/Regressions/coreclr/22407/abstractcalls.il @@ -3,6 +3,7 @@ // .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly abstractcalls { } @@ -79,6 +80,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try diff --git a/src/tests/Regressions/coreclr/22728/createdelegate.il b/src/tests/Regressions/coreclr/22728/createdelegate.il index 16a2a7994080c5..2c14cc039dc9c3 100644 --- a/src/tests/Regressions/coreclr/22728/createdelegate.il +++ b/src/tests/Regressions/coreclr/22728/createdelegate.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Runtime { } +.assembly extern xunit.core {} .assembly extern System.Console { } .assembly createdelegate { } @@ -59,6 +60,9 @@ A_F1_OK: .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void A::.ctor() call instance int32 A::Test() diff --git a/src/tests/Regressions/coreclr/22728/debug15.il b/src/tests/Regressions/coreclr/22728/debug15.il index bcc36d3f68182d..e6b7cc87e1b6df 100644 --- a/src/tests/Regressions/coreclr/22728/debug15.il +++ b/src/tests/Regressions/coreclr/22728/debug15.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Runtime { } +.assembly extern xunit.core {} .assembly extern System.Console { } .assembly debug15 { } @@ -89,6 +90,9 @@ A_F1_OK: .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint newobj instance void A::.ctor() call instance int32 A::Test() diff --git a/src/tests/Regressions/coreclr/GitHub_41674/genericldtoken.il b/src/tests/Regressions/coreclr/GitHub_41674/genericldtoken.il index 245d8b3f973821..79c3f27c37e8d0 100644 --- a/src/tests/Regressions/coreclr/GitHub_41674/genericldtoken.il +++ b/src/tests/Regressions/coreclr/GitHub_41674/genericldtoken.il @@ -1,4 +1,5 @@ .assembly extern System.Runtime { } +.assembly extern xunit.core {} .assembly genericldtoken { } @@ -24,6 +25,9 @@ .method private hidebysig static int32 Main(string[] args) cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 124 (0x7c) .maxstack 5 diff --git a/src/tests/baseservices/RuntimeConfiguration/TestConfig.cs b/src/tests/baseservices/RuntimeConfiguration/TestConfig.cs new file mode 100644 index 00000000000000..383a5d08f466d3 --- /dev/null +++ b/src/tests/baseservices/RuntimeConfiguration/TestConfig.cs @@ -0,0 +1,159 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Reflection; +using System.Runtime; + +using Xunit; + +class TestConfig +{ + const int Success = 100; + const int Fail = 101; + + [Fact] + [EnvVar("DOTNET_gcServer", "1")] + static int Verify_ServerGC_Env_Enable(string[] _) + { + return GCSettings.IsServerGC + ? Success + : Fail; + } + + [Fact] + [ConfigProperty("DOTNET_gcServer", "0")] + static int Verify_ServerGC_Env_Disable(string[] _) + { + return GCSettings.IsServerGC + ? Fail + : Success; + } + + [Fact] + [ConfigProperty("System.GC.Server", "true")] + static int Verify_ServerGC_Prop_Enable(string[] _) + { + return GCSettings.IsServerGC + ? Success + : Fail; + } + + [Fact] + [ConfigProperty("System.GC.Server", "false")] + static int Verify_ServerGC_Prop_Disable(string[] _) + { + return GCSettings.IsServerGC + ? Fail + : Success; + } + + [Fact] + [EnvVar("DOTNET_gcServer", "0")] + [ConfigProperty("System.GC.Server", "true")] + static int Verify_ServerGC_Env_Override_Prop(string[] _) + { + return GCSettings.IsServerGC + ? Fail + : Success; + } + + static int Main(string[] args) + { + if (args.Length == 0) + { + return RunTests(); + } + + MethodInfo infos = typeof(TestConfig).GetMethod(args[0], BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public); + if (infos is null) + { + return Fail; + } + return (int)infos.Invoke(null, new object[] { args[1..] }); + } + + [AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)] + class EnvVarAttribute : Attribute + { + public EnvVarAttribute(string name, string value) { Name = name; Value = value; } + public string Name { get; init; } + public string Value { get; init; } + } + + [AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)] + class ConfigPropertyAttribute : Attribute + { + public ConfigPropertyAttribute(string name, string value) { Name = name; Value = value; } + public string Name { get; init; } + public string Value { get; init; } + } + + static int RunTests() + { + string corerunPath = GetCorerunPath(); + MethodInfo[] infos = typeof(TestConfig).GetMethods(BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public); + foreach (var mi in infos) + { + var factMaybe = mi.GetCustomAttributes(typeof(FactAttribute)); + if (!factMaybe.Any()) + { + continue; + } + + using Process process = new(); + + StringBuilder arguments = new(); + var configProperties = mi.GetCustomAttributes(typeof(ConfigPropertyAttribute)); + + foreach (Attribute cp in configProperties) + { + ConfigPropertyAttribute configProp = (ConfigPropertyAttribute)cp; + arguments.Append($"-p {configProp.Name}={configProp.Value} "); + } + + arguments.Append($"\"{System.Reflection.Assembly.GetExecutingAssembly().Location}\" {mi.Name}"); + + process.StartInfo.FileName = corerunPath; + process.StartInfo.Arguments = arguments.ToString(); + + var envVariables = mi.GetCustomAttributes(typeof(EnvVarAttribute)); + foreach (string key in Environment.GetEnvironmentVariables().Keys) + { + process.StartInfo.EnvironmentVariables[key] = Environment.GetEnvironmentVariable(key); + } + + Console.WriteLine($"Running: {process.StartInfo.Arguments}"); + foreach (Attribute ev in envVariables) + { + EnvVarAttribute envVar = (EnvVarAttribute)ev; + process.StartInfo.EnvironmentVariables[envVar.Name] = envVar.Value; + Console.WriteLine($" set {envVar.Name}={envVar.Value}"); + } + + process.Start(); + process.WaitForExit(); + if (process.ExitCode != Success) + { + Console.WriteLine($"Failed: {mi.Name}"); + return process.ExitCode; + } + } + + return Success; + } + + static string GetCorerunPath() + { + string corerunName = "corerun"; + if (TestLibrary.Utilities.IsWindows) + { + corerunName += ".exe"; + } + return Path.Combine(Environment.GetEnvironmentVariable("CORE_ROOT"), corerunName); + } +} \ No newline at end of file diff --git a/src/tests/baseservices/RuntimeConfiguration/TestConfig.csproj b/src/tests/baseservices/RuntimeConfiguration/TestConfig.csproj new file mode 100644 index 00000000000000..efba9444477cd8 --- /dev/null +++ b/src/tests/baseservices/RuntimeConfiguration/TestConfig.csproj @@ -0,0 +1,15 @@ + + + Exe + + true + true + true + + + + + + + + \ No newline at end of file diff --git a/src/tests/baseservices/callconvs/CallFunctionPointers.ilproj b/src/tests/baseservices/callconvs/CallFunctionPointers.ilproj index b2aad8af6d976e..a64f2eb5f3a450 100644 --- a/src/tests/baseservices/callconvs/CallFunctionPointers.ilproj +++ b/src/tests/baseservices/callconvs/CallFunctionPointers.ilproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/baseservices/callconvs/TestCallingConventions.cs b/src/tests/baseservices/callconvs/TestCallingConventions.cs index 6ad86cf135a51f..b624c5a00bbb3f 100644 --- a/src/tests/baseservices/callconvs/TestCallingConventions.cs +++ b/src/tests/baseservices/callconvs/TestCallingConventions.cs @@ -6,7 +6,7 @@ using System.Reflection; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; unsafe class Program { @@ -52,65 +52,64 @@ static void BlittableFunctionPointers() // No modopt Console.WriteLine($" -- unmanaged"); int b = CallFunctionPointers.CallUnmanagedIntInt(cbDefault, a); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- unmanaged cdecl"); int b = CallFunctionPointers.CallUnmanagedCdeclIntInt(cbCdecl, a); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- unmanaged stdcall"); int b = CallFunctionPointers.CallUnmanagedStdcallIntInt(cbStdcall, a); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- unmanaged modopt(cdecl)"); int b = CallFunctionPointers.CallUnmanagedIntInt_ModOptCdecl(cbCdecl, a); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- unmanaged modopt(stdcall)"); int b = CallFunctionPointers.CallUnmanagedIntInt_ModOptStdcall(cbStdcall, a); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { // Value in modopt is not a recognized calling convention Console.WriteLine($" -- unmanaged modopt unrecognized"); int b = CallFunctionPointers.CallUnmanagedIntInt_ModOptUnknown(cbDefault, a); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { // Multiple modopts with calling conventions Console.WriteLine($" -- unmanaged modopt(stdcall) modopt(cdecl)"); var ex = Assert.Throws( - () => CallFunctionPointers.CallUnmanagedIntInt_ModOptStdcall_ModOptCdecl(cbCdecl, a), - "Multiple modopts with calling conventions should fail"); - Assert.AreEqual("Multiple unmanaged calling conventions are specified. Only a single calling convention is supported.", ex.Message); + () => CallFunctionPointers.CallUnmanagedIntInt_ModOptStdcall_ModOptCdecl(cbCdecl, a)); + Assert.Equal("Multiple unmanaged calling conventions are specified. Only a single calling convention is supported.", ex.Message); } { Console.WriteLine($" -- unmanaged modopt(stdcall) modopt(unrecognized)"); int b = CallFunctionPointers.CallUnmanagedIntInt_ModOptStdcall_ModOptUnknown(cbStdcall, a); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- unmanaged cdecl modopt(stdcall)"); int b = CallFunctionPointers.CallUnmanagedCdeclIntInt_ModOptStdcall(cbCdecl, a); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- unmanaged stdcall modopt(cdecl)"); int b = CallFunctionPointers.CallUnmanagedStdcallIntInt_ModOptCdecl(cbStdcall, a); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } } @@ -130,65 +129,64 @@ static void NonblittableFunctionPointers() // No modopt Console.WriteLine($" -- unmanaged"); var b = CallFunctionPointers.CallUnmanagedCharChar(cbDefault, a); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- unmanaged cdecl"); var b = CallFunctionPointers.CallUnmanagedCdeclCharChar(cbCdecl, a); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- unmanaged stdcall"); var b = CallFunctionPointers.CallUnmanagedStdcallCharChar(cbStdcall, a); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- unmanaged modopt(cdecl)"); var b = CallFunctionPointers.CallUnmanagedCharChar_ModOptCdecl(cbCdecl, a); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- unmanaged modopt(stdcall)"); var b = CallFunctionPointers.CallUnmanagedCharChar_ModOptStdcall(cbStdcall, a); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { // Value in modopt is not a recognized calling convention Console.WriteLine($" -- unmanaged modopt(unrecognized)"); var b = CallFunctionPointers.CallUnmanagedCharChar_ModOptUnknown(cbDefault, a); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { // Multiple modopts with calling conventions Console.WriteLine($" -- unmanaged modopt(stdcall) modopt(cdecl)"); var ex = Assert.Throws( - () => CallFunctionPointers.CallUnmanagedCharChar_ModOptStdcall_ModOptCdecl(cbCdecl, a), - "Multiple modopts with calling conventions should fail"); - Assert.AreEqual("Multiple unmanaged calling conventions are specified. Only a single calling convention is supported.", ex.Message); + () => CallFunctionPointers.CallUnmanagedCharChar_ModOptStdcall_ModOptCdecl(cbCdecl, a)); + Assert.Equal("Multiple unmanaged calling conventions are specified. Only a single calling convention is supported.", ex.Message); } { Console.WriteLine($" -- unmanaged modopt(stdcall) modopt(unrecognized)"); var b = CallFunctionPointers.CallUnmanagedCharChar_ModOptStdcall_ModOptUnknown(cbStdcall, a); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- unmanaged cdecl modopt(stdcall)"); var b = CallFunctionPointers.CallUnmanagedCdeclCharChar_ModOptStdcall(cbCdecl, a); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } { Console.WriteLine($" -- unmanaged stdcall modopt(cdecl)"); var b = CallFunctionPointers.CallUnmanagedStdcallCharChar_ModOptCdecl(cbStdcall, a); - Assert.AreEqual(expected, b); + Assert.Equal(expected, b); } } diff --git a/src/tests/baseservices/compilerservices/RuntimeFeature/DefaultImplementationsOfInterfaces.il b/src/tests/baseservices/compilerservices/RuntimeFeature/DefaultImplementationsOfInterfaces.il index f5f2e7476eaca8..69d58572e5f3e1 100644 --- a/src/tests/baseservices/compilerservices/RuntimeFeature/DefaultImplementationsOfInterfaces.il +++ b/src/tests/baseservices/compilerservices/RuntimeFeature/DefaultImplementationsOfInterfaces.il @@ -7,6 +7,7 @@ // This needs to succeed no matter whether default interfaces are supported. // .assembly extern mscorlib { auto } +.assembly extern xunit.core {} .assembly extern System.Runtime { auto } .assembly DefaultImplementationsOfInterfaces{} @@ -58,6 +59,9 @@ .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 ldstr "DefaultImplementationsOfInterfaces" diff --git a/src/tests/baseservices/compilerservices/RuntimeWrappedException/StringThrower.ilproj b/src/tests/baseservices/compilerservices/RuntimeWrappedException/StringThrower.ilproj index d16d855aa32b91..aafab759a16941 100644 --- a/src/tests/baseservices/compilerservices/RuntimeWrappedException/StringThrower.ilproj +++ b/src/tests/baseservices/compilerservices/RuntimeWrappedException/StringThrower.ilproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/baseservices/compilerservices/modulector/moduleCctor.ilproj b/src/tests/baseservices/compilerservices/modulector/moduleCctor.ilproj index 9b614c7ab4e4c3..9bb4f0e74e37d8 100644 --- a/src/tests/baseservices/compilerservices/modulector/moduleCctor.ilproj +++ b/src/tests/baseservices/compilerservices/modulector/moduleCctor.ilproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/baseservices/exceptions/generics/try-fault-struct01.il b/src/tests/baseservices/exceptions/generics/try-fault-struct01.il index 5df821f7ec5893..b9860e063ac201 100644 --- a/src/tests/baseservices/exceptions/generics/try-fault-struct01.il +++ b/src/tests/baseservices/exceptions/generics/try-fault-struct01.il @@ -8,6 +8,7 @@ // Metadata version: v1.1.2211 .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -323,6 +324,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 1032 (0x408) .maxstack 2 diff --git a/src/tests/baseservices/exceptions/generics/try-fault-struct02.il b/src/tests/baseservices/exceptions/generics/try-fault-struct02.il index 1fd09ec725a767..4aafe06763cb16 100644 --- a/src/tests/baseservices/exceptions/generics/try-fault-struct02.il +++ b/src/tests/baseservices/exceptions/generics/try-fault-struct02.il @@ -8,6 +8,7 @@ // Metadata version: v1.1.2211 .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -324,6 +325,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 1032 (0x408) .maxstack 2 diff --git a/src/tests/baseservices/exceptions/generics/try-fault-struct03.il b/src/tests/baseservices/exceptions/generics/try-fault-struct03.il index 86cd71825427cb..ec986e352cf582 100644 --- a/src/tests/baseservices/exceptions/generics/try-fault-struct03.il +++ b/src/tests/baseservices/exceptions/generics/try-fault-struct03.il @@ -8,6 +8,7 @@ // Metadata version: v1.1.2211 .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -325,6 +326,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 1032 (0x408) .maxstack 2 diff --git a/src/tests/baseservices/exceptions/generics/try-fault01.il b/src/tests/baseservices/exceptions/generics/try-fault01.il index 82f8a63f1284d0..1b56de0dc13f0a 100644 --- a/src/tests/baseservices/exceptions/generics/try-fault01.il +++ b/src/tests/baseservices/exceptions/generics/try-fault01.il @@ -8,6 +8,7 @@ // Metadata version: v1.1.2211 .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -334,6 +335,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 588 (0x24c) .maxstack 2 diff --git a/src/tests/baseservices/exceptions/generics/try-fault02.il b/src/tests/baseservices/exceptions/generics/try-fault02.il index 8dfc42559a12f1..e172492d344df8 100644 --- a/src/tests/baseservices/exceptions/generics/try-fault02.il +++ b/src/tests/baseservices/exceptions/generics/try-fault02.il @@ -8,6 +8,7 @@ // Metadata version: v1.1.2211 .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -334,6 +335,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 588 (0x24c) .maxstack 2 diff --git a/src/tests/baseservices/exceptions/generics/try-fault03.il b/src/tests/baseservices/exceptions/generics/try-fault03.il index 36d7b8867a1839..3db16eb608b4c0 100644 --- a/src/tests/baseservices/exceptions/generics/try-fault03.il +++ b/src/tests/baseservices/exceptions/generics/try-fault03.il @@ -8,6 +8,7 @@ // Metadata version: v1.1.2211 .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -335,6 +336,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 588 (0x24c) .maxstack 2 diff --git a/src/tests/baseservices/exceptions/generics/try-filter-finally01.il b/src/tests/baseservices/exceptions/generics/try-filter-finally01.il index 4144496a6094cd..dfc1c5b07b8fd3 100644 --- a/src/tests/baseservices/exceptions/generics/try-filter-finally01.il +++ b/src/tests/baseservices/exceptions/generics/try-filter-finally01.il @@ -8,6 +8,7 @@ // Metadata version: v1.1.2211 .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -354,6 +355,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 588 (0x24c) .maxstack 2 diff --git a/src/tests/baseservices/exceptions/generics/try-filter-finally02.il b/src/tests/baseservices/exceptions/generics/try-filter-finally02.il index 2c296a022cb4fc..fea9c60403281b 100644 --- a/src/tests/baseservices/exceptions/generics/try-filter-finally02.il +++ b/src/tests/baseservices/exceptions/generics/try-filter-finally02.il @@ -8,6 +8,7 @@ // Metadata version: v1.1.2211 .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -364,6 +365,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 588 (0x24c) .maxstack 2 diff --git a/src/tests/baseservices/exceptions/generics/try-filter-struct02.il b/src/tests/baseservices/exceptions/generics/try-filter-struct02.il index e2f438e2122796..8e11b47853c727 100644 --- a/src/tests/baseservices/exceptions/generics/try-filter-struct02.il +++ b/src/tests/baseservices/exceptions/generics/try-filter-struct02.il @@ -8,6 +8,7 @@ // Metadata version: v1.1.2211 .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -336,6 +337,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 1032 (0x408) .maxstack 2 diff --git a/src/tests/baseservices/exceptions/generics/try-filter02.il b/src/tests/baseservices/exceptions/generics/try-filter02.il index b846a28890f60e..ce505dc643cabb 100644 --- a/src/tests/baseservices/exceptions/generics/try-filter02.il +++ b/src/tests/baseservices/exceptions/generics/try-filter02.il @@ -8,6 +8,7 @@ // Metadata version: v1.1.2211 .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -348,6 +349,9 @@ .method public hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 588 (0x24c) .maxstack 2 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Except.il b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Except.il index b23ce35bc8b356..0193146f4b7f45 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Except.il +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Except.il @@ -13,7 +13,7 @@ .ver 4:0:0:0 } -.assembly Except.exe{} +.assembly Except{} .class Except { diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/FiltCatch.il b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/FiltCatch.il index 1d9ce41279778d..87a654624b6b2f 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/FiltCatch.il +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/FiltCatch.il @@ -15,7 +15,7 @@ .ver 4:0:0:0 } -.assembly FiltCatch.exe{} +.assembly FiltCatch{} .class FiltCatch { diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Filter.il b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Filter.il index e555bb5a639891..a14fddf1a77f36 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Filter.il +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Filter.il @@ -13,7 +13,7 @@ .ver 4:0:0:0 } -.assembly Filter.exe{} +.assembly Filter{} .class Filter { diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Finally.il b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Finally.il index b62aca7922be02..2f57c02fcc4955 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Finally.il +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Finally.il @@ -13,7 +13,7 @@ .ver 4:0:0:0 } -.assembly Finally.exe{} +.assembly Finally{} .class Finally { diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedExcept.il b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedExcept.il index 663ca2281640b2..04051ccb630951 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedExcept.il +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedExcept.il @@ -14,7 +14,7 @@ .ver 4:0:0:0 } -.assembly NestedExcept.exe{} +.assembly NestedExcept{} .class NestedExcept { diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedFilt.il b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedFilt.il index 115d70a4991a3b..a244d57dc98eb6 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedFilt.il +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedFilt.il @@ -13,7 +13,7 @@ .ver 4:0:0:0 } -.assembly NestedFilt.exe{} +.assembly NestedFilt{} .class NestedFilt { diff --git a/src/tests/baseservices/exceptions/regressions/v1.0/15266.il b/src/tests/baseservices/exceptions/regressions/v1.0/15266.il index bca20e446bf4ed..74ac7d015abe89 100644 --- a/src/tests/baseservices/exceptions/regressions/v1.0/15266.il +++ b/src/tests/baseservices/exceptions/regressions/v1.0/15266.il @@ -5,6 +5,7 @@ // expect throw System.Security.VerificationException .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -18,6 +19,9 @@ { .method public static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .try diff --git a/src/tests/baseservices/exceptions/regressions/whidbeym3.3/293674/securedispatcher.cs b/src/tests/baseservices/exceptions/regressions/whidbeym3.3/293674/securedispatcher.cs deleted file mode 100644 index 5117eb96526171..00000000000000 --- a/src/tests/baseservices/exceptions/regressions/whidbeym3.3/293674/securedispatcher.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -using System; - -namespace Avalon.Secure -{ - - public class Foo - { - - static public void FooMethod(object sender, EventArgs e) - { - bar.BarEvent -= new EventHandler(Foo.FooMethod); - bar.OnBarEvent(); - } - - - /// - /// - static public Bar bar = null; - - } - - - - - public class Bar - { - public Bar(){} - - public event EventHandler BarEvent; - - public void OnBarEvent() - { - if (BarEvent != null) - BarEvent(this, EventArgs.Empty); - } - - - } - - -} - diff --git a/src/tests/baseservices/exceptions/sharedexceptions/emptystacktrace/OOMException01.csproj b/src/tests/baseservices/exceptions/sharedexceptions/emptystacktrace/OOMException01.csproj index 10b82a8c057e44..7b6f354e794845 100644 --- a/src/tests/baseservices/exceptions/sharedexceptions/emptystacktrace/OOMException01.csproj +++ b/src/tests/baseservices/exceptions/sharedexceptions/emptystacktrace/OOMException01.csproj @@ -3,7 +3,6 @@ Exe true 1 - -trustedexe diff --git a/src/tests/baseservices/exceptions/simple/fault.il b/src/tests/baseservices/exceptions/simple/fault.il index 9613d6819b3162..3f3331990c3520 100644 --- a/src/tests/baseservices/exceptions/simple/fault.il +++ b/src/tests/baseservices/exceptions/simple/fault.il @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -14,6 +15,9 @@ { .method public static int32 Main(class [mscorlib]System.String[] args) il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .locals init (int32 V_0) ldc.i4 3 diff --git a/src/tests/baseservices/threading/regressions/beta1/347011.csproj b/src/tests/baseservices/threading/regressions/beta1/347011.csproj index 9f75b2cba55f16..c351bcc1ad95e4 100644 --- a/src/tests/baseservices/threading/regressions/beta1/347011.csproj +++ b/src/tests/baseservices/threading/regressions/beta1/347011.csproj @@ -2,7 +2,6 @@ Exe 1 - 240 diff --git a/src/tests/baseservices/typeequivalence/contracts/TypeContracts.csproj b/src/tests/baseservices/typeequivalence/contracts/TypeContracts.csproj index 306758e5a5b85f..4895e31531df2e 100644 --- a/src/tests/baseservices/typeequivalence/contracts/TypeContracts.csproj +++ b/src/tests/baseservices/typeequivalence/contracts/TypeContracts.csproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/baseservices/typeequivalence/impl/TypeImpl.csproj b/src/tests/baseservices/typeequivalence/impl/TypeImpl.csproj index b916b70076098c..619f5a0bdac2a6 100644 --- a/src/tests/baseservices/typeequivalence/impl/TypeImpl.csproj +++ b/src/tests/baseservices/typeequivalence/impl/TypeImpl.csproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/baseservices/typeequivalence/simple/Simple.cs b/src/tests/baseservices/typeequivalence/simple/Simple.cs index a65866e58059fc..047aa5de783fec 100644 --- a/src/tests/baseservices/typeequivalence/simple/Simple.cs +++ b/src/tests/baseservices/typeequivalence/simple/Simple.cs @@ -7,7 +7,7 @@ using System.Reflection; using System.Runtime.InteropServices; -using TestLibrary; +using Xunit; using TypeEquivalenceTypes; public class Simple @@ -33,7 +33,7 @@ private static void InterfaceTypesFromDifferentAssembliesAreEquivalent() void AreNotSameObject(IEmptyType a, IEmptyType b) { - Assert.AreNotEqual(a, b); + Assert.NotEqual(a, b); } } @@ -47,22 +47,22 @@ private static void ValidateTypeInstanceEquality() Type otherAsmInterfaceType = otherAsm.GetType().GetInterface(nameof(IEmptyType)); // Sanity checks - Assert.IsTrue(inAsmInterfaceType == inAsmInterfaceType); - Assert.IsTrue(inAsmInterfaceType.IsEquivalentTo(inAsmInterfaceType)); - Assert.IsFalse(inAsmInterfaceType.IsEquivalentTo(inAsm.GetType())); - Assert.IsTrue(otherAsmInterfaceType == otherAsmInterfaceType); - Assert.IsTrue(otherAsmInterfaceType.IsEquivalentTo(otherAsmInterfaceType)); - Assert.IsFalse(otherAsmInterfaceType.IsEquivalentTo(otherAsm.GetType())); + Assert.True(inAsmInterfaceType == inAsmInterfaceType); + Assert.True(inAsmInterfaceType.IsEquivalentTo(inAsmInterfaceType)); + Assert.False(inAsmInterfaceType.IsEquivalentTo(inAsm.GetType())); + Assert.True(otherAsmInterfaceType == otherAsmInterfaceType); + Assert.True(otherAsmInterfaceType.IsEquivalentTo(otherAsmInterfaceType)); + Assert.False(otherAsmInterfaceType.IsEquivalentTo(otherAsm.GetType())); // The intrinsic equality operations should fail - Assert.IsFalse(inAsmInterfaceType == otherAsmInterfaceType); - Assert.IsFalse(inAsmInterfaceType.Equals(otherAsmInterfaceType)); - Assert.IsFalse(otherAsmInterfaceType == inAsmInterfaceType); - Assert.IsFalse(otherAsmInterfaceType.Equals(inAsmInterfaceType)); + Assert.False(inAsmInterfaceType == otherAsmInterfaceType); + Assert.False(inAsmInterfaceType.Equals(otherAsmInterfaceType)); + Assert.False(otherAsmInterfaceType == inAsmInterfaceType); + Assert.False(otherAsmInterfaceType.Equals(inAsmInterfaceType)); // Determination of equal types requires API call - Assert.IsTrue(inAsmInterfaceType.IsEquivalentTo(otherAsmInterfaceType)); - Assert.IsTrue(otherAsmInterfaceType.IsEquivalentTo(inAsmInterfaceType)); + Assert.True(inAsmInterfaceType.IsEquivalentTo(otherAsmInterfaceType)); + Assert.True(otherAsmInterfaceType.IsEquivalentTo(inAsmInterfaceType)); } private class MethodTestDerived : MethodTestBase @@ -120,8 +120,8 @@ private static void InterfaceTypesMethodOperations() int expectedBaseValue = input * baseScale; int expectedDerivedValue = expectedBaseValue * derivedScale; - Assert.AreEqual(expectedBaseValue, baseInterface.ScaleInt(input)); - Assert.AreEqual(expectedDerivedValue, derivedBase.ScaleInt(input)); + Assert.Equal(expectedBaseValue, baseInterface.ScaleInt(input)); + Assert.Equal(expectedDerivedValue, derivedBase.ScaleInt(input)); } { @@ -129,8 +129,8 @@ private static void InterfaceTypesMethodOperations() string expectedBaseValue = string.Concat(Enumerable.Repeat(input, baseScale)); string expectedDerivedValue = string.Concat(Enumerable.Repeat(expectedBaseValue, derivedScale)); - Assert.AreEqual(expectedBaseValue, baseInterface.ScaleString(input)); - Assert.AreEqual(expectedDerivedValue, derivedBase.ScaleString(input)); + Assert.Equal(expectedBaseValue, baseInterface.ScaleString(input)); + Assert.Equal(expectedDerivedValue, derivedBase.ScaleString(input)); } } @@ -139,14 +139,14 @@ private static void CallSparseInterface() Console.WriteLine($"{nameof(CallSparseInterface)}"); int sparseTypeMethodCount = typeof(ISparseType).GetMethods(BindingFlags.Public | BindingFlags.Instance).Length; - Assert.AreEqual(2, sparseTypeMethodCount, "Should have limited method metadata"); + Assert.Equal(2, sparseTypeMethodCount); var sparseType = (ISparseType)SparseTest.Create(); - Assert.AreEqual(20, SparseTest.GetSparseInterfaceMethodCount(), "Should have all method metadata"); + Assert.Equal(20, SparseTest.GetSparseInterfaceMethodCount()); int input = 63; - Assert.AreEqual(input * 7, sparseType.MultiplyBy7(input)); - Assert.AreEqual(input * 18, sparseType.MultiplyBy18(input)); + Assert.Equal(input * 7, sparseType.MultiplyBy7(input)); + Assert.Equal(input * 18, sparseType.MultiplyBy18(input)); } private static void TestArrayEquivalence() @@ -158,12 +158,12 @@ private static void TestArrayEquivalence() Type inAsmInterfaceType = inAsm.GetType().GetInterface(nameof(IEmptyType)); Type otherAsmInterfaceType = otherAsm.GetType().GetInterface(nameof(IEmptyType)); - Assert.IsTrue(inAsmInterfaceType.MakeArrayType().IsEquivalentTo(otherAsmInterfaceType.MakeArrayType())); - Assert.IsTrue(inAsmInterfaceType.MakeArrayType(1).IsEquivalentTo(otherAsmInterfaceType.MakeArrayType(1))); - Assert.IsTrue(inAsmInterfaceType.MakeArrayType(2).IsEquivalentTo(otherAsmInterfaceType.MakeArrayType(2))); + Assert.True(inAsmInterfaceType.MakeArrayType().IsEquivalentTo(otherAsmInterfaceType.MakeArrayType())); + Assert.True(inAsmInterfaceType.MakeArrayType(1).IsEquivalentTo(otherAsmInterfaceType.MakeArrayType(1))); + Assert.True(inAsmInterfaceType.MakeArrayType(2).IsEquivalentTo(otherAsmInterfaceType.MakeArrayType(2))); - Assert.IsFalse(inAsmInterfaceType.MakeArrayType().IsEquivalentTo(otherAsmInterfaceType.MakeArrayType(1))); - Assert.IsFalse(inAsmInterfaceType.MakeArrayType(1).IsEquivalentTo(otherAsmInterfaceType.MakeArrayType(2))); + Assert.False(inAsmInterfaceType.MakeArrayType().IsEquivalentTo(otherAsmInterfaceType.MakeArrayType(1))); + Assert.False(inAsmInterfaceType.MakeArrayType(1).IsEquivalentTo(otherAsmInterfaceType.MakeArrayType(2))); } private static void TestByRefEquivalence() @@ -175,7 +175,7 @@ private static void TestByRefEquivalence() Type inAsmInterfaceType = inAsm.GetType().GetInterface(nameof(IEmptyType)); Type otherAsmInterfaceType = otherAsm.GetType().GetInterface(nameof(IEmptyType)); - Assert.IsTrue(inAsmInterfaceType.MakeByRefType().IsEquivalentTo(otherAsmInterfaceType.MakeByRefType())); + Assert.True(inAsmInterfaceType.MakeByRefType().IsEquivalentTo(otherAsmInterfaceType.MakeByRefType())); } interface IGeneric @@ -199,7 +199,7 @@ private static void TestGenericClassNonEquivalence() Type inAsmInterfaceType = inAsm.GetType().GetInterface(nameof(IEmptyType)); Type otherAsmInterfaceType = otherAsm.GetType().GetInterface(nameof(IEmptyType)); - Assert.IsFalse(typeof(Generic<>).MakeGenericType(inAsmInterfaceType).IsEquivalentTo(typeof(Generic<>).MakeGenericType(otherAsmInterfaceType))); + Assert.False(typeof(Generic<>).MakeGenericType(inAsmInterfaceType).IsEquivalentTo(typeof(Generic<>).MakeGenericType(otherAsmInterfaceType))); } private static void TestGenericInterfaceEquivalence() @@ -211,7 +211,7 @@ private static void TestGenericInterfaceEquivalence() Type inAsmInterfaceType = inAsm.GetType().GetInterface(nameof(IEmptyType)); Type otherAsmInterfaceType = otherAsm.GetType().GetInterface(nameof(IEmptyType)); - Assert.IsTrue(typeof(IGeneric<>).MakeGenericType(inAsmInterfaceType).IsEquivalentTo(typeof(IGeneric<>).MakeGenericType(otherAsmInterfaceType))); + Assert.True(typeof(IGeneric<>).MakeGenericType(inAsmInterfaceType).IsEquivalentTo(typeof(IGeneric<>).MakeGenericType(otherAsmInterfaceType))); } public static int Main(string[] noArgs) diff --git a/src/tests/baseservices/varargs/varargsupport.il b/src/tests/baseservices/varargs/varargsupport.il index a6a7c4c3940ada..f9eb43b7ad5e84 100644 --- a/src/tests/baseservices/varargs/varargsupport.il +++ b/src/tests/baseservices/varargs/varargsupport.il @@ -6,6 +6,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern legacy library mscorlib {} .assembly 'vafilt' { @@ -61,6 +62,9 @@ .method public static int32 Main(class System.String[] args) il managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 3 .locals ([0] int32 zero) diff --git a/src/tests/baseservices/visibility/target.cs b/src/tests/baseservices/visibility/target.cs deleted file mode 100644 index 99698384eb6c14..00000000000000 --- a/src/tests/baseservices/visibility/target.cs +++ /dev/null @@ -1,519 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Runtime.CompilerServices; -using System.Security; - -[assembly: InternalsVisibleTo("ClassFriend, PublicKey=00240000048000009400000006020000002400005253413100040000010001000fc5993e0f511ad5e16e8b226553493e09067afc41039f70daeb94a968d664f40e69a46b617d15d3d5328be7dbedd059eb98495a3b03cb4ea4ba127444671c3c84cbc1fdc393d7e10b5ee3f31f5a29f005e5eed7e3c9c8af74f413f0004f0c2cabb22f9dd4f75a6f599784e1bab70985ef8174ca6c684278be82ce055a03ebaf")] -[assembly: InternalsVisibleTo("StaticClassFriend, PublicKey=00240000048000009400000006020000002400005253413100040000010001000fc5993e0f511ad5e16e8b226553493e09067afc41039f70daeb94a968d664f40e69a46b617d15d3d5328be7dbedd059eb98495a3b03cb4ea4ba127444671c3c84cbc1fdc393d7e10b5ee3f31f5a29f005e5eed7e3c9c8af74f413f0004f0c2cabb22f9dd4f75a6f599784e1bab70985ef8174ca6c684278be82ce055a03ebaf")] -[assembly: InternalsVisibleTo("StructFriend, PublicKey=00240000048000009400000006020000002400005253413100040000010001000fc5993e0f511ad5e16e8b226553493e09067afc41039f70daeb94a968d664f40e69a46b617d15d3d5328be7dbedd059eb98495a3b03cb4ea4ba127444671c3c84cbc1fdc393d7e10b5ee3f31f5a29f005e5eed7e3c9c8af74f413f0004f0c2cabb22f9dd4f75a6f599784e1bab70985ef8174ca6c684278be82ce055a03ebaf")] - - -// -// This file can be compiled in two ways: ALL public (ALL_PUB), or Restricted. -// The intention of the ALL public (ALL_PUB) is to allow a C# caller to build. -// The restricted version is intended to be used at runtime, causing some -// calls to fail. -// - -// -// Enum -// -#if ALL_PUB -public -#endif - enum DefaultEnum { VALUE1, VALUE3 } -public enum PublicEnum { VALUE1, VALUE3 } - -#if ALL_PUB -public enum InternalEnum { VALUE1, VALUE3 } -#else -internal enum InternalEnum { VALUE1, VALUE3 } -#endif - - - -// -// Class -// -#if ALL_PUB - public -#endif - class DefaultClass -{ -} - -public class PublicClass -{ - // - // Ctors - // - public PublicClass() {} -#if ALL_PUB - public -#endif - PublicClass(int i1) {} - public PublicClass(int i1, int i2) {} -#if ALL_PUB - public PublicClass(int i1, int i2, int i3) {} - public PublicClass(int i1, int i2, int i3, int i4) {} - public PublicClass(int i1, int i2, int i3, int i4, int i5) {} - public PublicClass(int i1, int i2, int i3, int i4, int i5, int i6) {} -#else - protected PublicClass(int i1, int i2, int i3) {} - internal PublicClass(int i1, int i2, int i3, int i4) {} - protected internal PublicClass(int i1, int i2, int i3, int i4, int i5) {} - private PublicClass(int i1, int i2, int i3, int i4, int i5, int i6) {} -#endif - - - // - // static fields - // -#pragma warning disable 169 -#if ALL_PUB - public -#endif - static int defaultStaticField; - public static int publicStaticField = 0; -#if ALL_PUB - public static int protectedStaticField = 0; - public static int internalStaticField = 0; - public static int protectedInternalStaticField = 0; - public static int privateStaticField; -#else - protected static int protectedStaticField = 0; - internal static int internalStaticField = 0; - protected internal static int protectedInternalStaticField = 0; - private static int privateStaticField; -#endif - - - // - // instance fields - // -#if ALL_PUB - public -#endif - int defaultField; - public int publicField; -#if ALL_PUB - public int protectedField; - public int internalField; - public int protectedInternalField; - public int privateField; -#else - protected int protectedField; - internal int internalField; - protected internal int protectedInternalField; - private int privateField; -#endif - -#pragma warning restore 169 - // - // static Properties - // -#if ALL_PUB - public -#endif - static int DefaultStaticProperty - { - get { return 0; } - set { ; } - } - public static int PublicStaticProperty - { - get { return 0; } - set { ; } - } -#if ALL_PUB - public static int ProtectedStaticProperty - { - get { return 0; } - set { ; } - } - public static int InternalStaticProperty - { - get { return 0; } - set { ; } - } - public static int ProtectedInternalStaticProperty - { - get { return 0; } - set { ; } - } - public static int PrivateStaticProperty - { - get { return 0; } - set { ; } - } -#else - protected static int ProtectedStaticProperty - { - get { return 0; } - set { ; } - } - internal static int InternalStaticProperty - { - get { return 0; } - set { ; } - } - protected internal static int ProtectedInternalStaticProperty - { - get { return 0; } - set { ; } - } - private static int PrivateStaticProperty - { - get { return 0; } - set { ; } - } -#endif - - // - // instance Properties - // -#if ALL_PUB - public -#endif - int DefaultProperty - { - get { return 0; } - set { ; } - } - public int PublicProperty - { - get { return 0; } - set { ; } - } -#if ALL_PUB - public int ProtectedProperty - { - get { return 0; } - set { ; } - } - public int InternalProperty - { - get { return 0; } - set { ; } - } - public int ProtectedInternalProperty - { - get { return 0; } - set { ; } - } - public int PrivateProperty - { - get { return 0; } - set { ; } - } -#else - protected int ProtectedProperty - { - get { return 0; } - set { ; } - } - internal int InternalProperty - { - get { return 0; } - set { ; } - } - protected internal int ProtectedInternalProperty - { - get { return 0; } - set { ; } - } - private int PrivateProperty - { - get { return 0; } - set { ; } - } -#endif - - - // - // static Methods - // -#if ALL_PUB - public -#endif - static int DefaultStaticMethod() { return 1; } - public static int PublicStaticMethod() { return 1; } -#if ALL_PUB - public static int ProtectedStaticMethod() { return 1; } - public static int InternalStaticMethod() { return 1; } - public static int ProtectedInternalStaticMethod() { return 1; } - public static int PrivateStaticMethod() { return 1; } -#else - protected static int ProtectedStaticMethod() { return 1; } - internal static int InternalStaticMethod() { return 1; } - protected internal static int ProtectedInternalStaticMethod() { return 1; } - private static int PrivateStaticMethod() { return 1; } -#endif - - - // - // instance Methods - // -#if ALL_PUB - public -#endif - int DefaultMethod() { return 1; } - public int PublicMethod() { return 1; } -#if ALL_PUB - public int ProtectedMethod() { return 1; } - public int InternalMethod() { return 1; } - public int ProtectedInternalMethod() { return 1; } - public int PrivateMethod() { return 1; } -#else - protected int ProtectedMethod() { return 1; } - internal int InternalMethod() { return 1; } - protected internal int ProtectedInternalMethod() { return 1; } - private int PrivateMethod() { return 1; } -#endif -} - -#if ALL_PUB -public class InternalClass -#else -internal class InternalClass -#endif -{ -} - - -// -// Static Class -// -#if ALL_PUB -public -#endif - static class DefaultStaticClass -{ - public static int field = 0; -} - -public static class PublicStaticClass -{ - public static int field = 0; -} - -#if ALL_PUB -public static class InternalStaticClass -#else -internal static class InternalStaticClass -#endif -{ - public static int field = 0; -} - - -// -// Interface -// -#if ALL_PUB -public -#endif - interface DefaultInterface -{ - bool Foo(); -} - - -public interface PublicInterface -{ - bool Foo(); -} - -#if ALL_PUB -public interface InternalInterface -#else -internal interface InternalInterface -#endif -{ - bool Foo(); -} - - -// -// Struct -// -#if ALL_PUB - public -#endif - struct DefaultStruct {} -public struct PublicStruct -{ - // - // Ctors - // -#if ALL_PUB - public -#endif - PublicStruct(int i1) {defaultField=publicField=internalField=privateField=0;} - public PublicStruct(int i1, int i2) {defaultField=publicField=internalField=privateField=0;} -#if ALL_PUB - public PublicStruct(int i1, int i2, int i3) {defaultField=publicField=internalField=privateField=0;} - public PublicStruct(int i1, int i2, int i3, int i4) {defaultField=publicField=internalField=privateField=0;} -#else - internal PublicStruct(int i1, int i2, int i3) {defaultField=publicField=internalField=privateField=0;} - private PublicStruct(int i1, int i2, int i3, int i4) {defaultField=publicField=internalField=privateField=0;} -#endif - -#pragma warning disable 414 - // - // static fields - // -#if ALL_PUB - public -#endif - static int defaultStaticField = 0; - public static int publicStaticField = 0; -#if ALL_PUB - public static int internalStaticField = 0; - public static int privateStaticField = 0; -#else - internal static int internalStaticField = 0; - private static int privateStaticField = 0; -#endif - - - // - // instance fields - // -#if ALL_PUB - public -#endif - int defaultField; - public int publicField; -#if ALL_PUB - public int internalField; - public int privateField; -#else - internal int internalField; - private int privateField; -#endif - -#pragma warning restore 414 - // - // static Properties - // -#if ALL_PUB - public -#endif - static int DefaultStaticProperty - { - get { return 0; } - set { ; } - } - public static int PublicStaticProperty - { - get { return 0; } - set { ; } - } -#if ALL_PUB - public static int InternalStaticProperty - { - get { return 0; } - set { ; } - } - public static int PrivateStaticProperty - { - get { return 0; } - set { ; } - } -#else - internal static int InternalStaticProperty - { - get { return 0; } - set { ; } - } - private static int PrivateStaticProperty - { - get { return 0; } - set { ; } - } -#endif - - // - // instance Properties - // -#if ALL_PUB - public -#endif - int DefaultProperty - { - get { return 0; } - set { ; } - } - public int PublicProperty - { - get { return 0; } - set { ; } - } -#if ALL_PUB - public int InternalProperty - { - get { return 0; } - set { ; } - } - public int PrivateProperty - { - get { return 0; } - set { ; } - } -#else - internal int InternalProperty - { - get { return 0; } - set { ; } - } - private int PrivateProperty - { - get { return 0; } - set { ; } - } -#endif - - - // - // static Methods - // -#if ALL_PUB - public -#endif - static int DefaultStaticMethod() { return 1; } - public static int PublicStaticMethod() { return 1; } -#if ALL_PUB - public static int InternalStaticMethod() { return 1; } - public static int PrivateStaticMethod() { return 1; } -#else - internal static int InternalStaticMethod() { return 1; } - private static int PrivateStaticMethod() { return 1; } -#endif - - - // - // instance Methods - // -#if ALL_PUB - public -#endif - int DefaultMethod() { return 1; } - public int PublicMethod() { return 1; } -#if ALL_PUB - public int InternalMethod() { return 1; } - public int PrivateMethod() { return 1; } -#else - internal int InternalMethod() { return 1; } - private int PrivateMethod() { return 1; } -#endif -} - -#if ALL_PUB -public struct InternalStruct {}; -#else -internal struct InternalStruct {}; -#endif - - diff --git a/src/tests/build.cmd b/src/tests/build.cmd index 46e5ea5eb3079f..18dd4ee6266e6d 100644 --- a/src/tests/build.cmd +++ b/src/tests/build.cmd @@ -53,7 +53,6 @@ set __SkipManaged= set __SkipTestWrappers= set __BuildTestWrappersOnly= set __SkipNative= -set __DoCrossgen2= set __CompositeBuildMode= set __TestBuildMode= set __CreatePdb= @@ -115,8 +114,8 @@ if /i "%1" == "buildtestwrappersonly" (set __SkipNative=1&set __SkipManaged=1&se if /i "%1" == "-cmakeargs" (set __CMakeArgs="%2=%3" %__CMakeArgs%&set "processedArgs=!processedArgs! %1 %2=%3"&shift&shift&goto Arg_Loop) if /i "%1" == "-msbuild" (set __Ninja=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "buildagainstpackages" (echo error: Remove /BuildAgainstPackages switch&&exit /b1) -if /i "%1" == "crossgen2" (set __DoCrossgen2=1&set __TestBuildMode=crossgen2&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) -if /i "%1" == "composite" (set __CompositeBuildMode=1&set __DoCrossgen2=1&set __TestBuildMode=crossgen2&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) +if /i "%1" == "crossgen2" (set __TestBuildMode=crossgen2&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) +if /i "%1" == "composite" (set __CompositeBuildMode=1&set __TestBuildMode=crossgen2&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "pdb" (set __CreatePdb=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "perfmap" (set __CreatePerfmap=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "Exclude" (set __Exclude=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop) @@ -147,8 +146,10 @@ set "__TestBinDir=%__TestRootDir%\%__OSPlatformConfig%" set "__TestIntermediatesDir=%__TestRootDir%\obj\%__OSPlatformConfig%" if "%__RebuildTests%" == "1" ( - echo Removing tests build dir^: !__TestBinDir! + echo Removing test build dir^: !__TestBinDir! rmdir /s /q !__TestBinDir! + echo Removing test intermediate dir^: !__TestIntermediatesDir! + rmdir /s /q !__TestIntermediatesDir! ) REM We have different managed and native intermediate dirs because the managed bits will include diff --git a/src/tests/build.proj b/src/tests/build.proj index f8f67ff905e33d..0a7d6f2b16d9e9 100644 --- a/src/tests/build.proj +++ b/src/tests/build.proj @@ -25,6 +25,8 @@ + + @@ -215,6 +217,7 @@ + + + + @@ -310,6 +318,10 @@ + + @@ -382,8 +394,6 @@ - @@ -439,6 +449,7 @@ $(GroupBuildCmd) "/p:Configuration=$(Configuration)" $(GroupBuildCmd) "/p:LibrariesConfiguration=$(LibrariesConfiguration)" $(GroupBuildCmd) "/p:TargetOS=$(TargetOS)" + $(GroupBuildCmd) "/p:RuntimeOS=$(RuntimeOS)" $(GroupBuildCmd) "/p:RuntimeFlavor=$(RuntimeFlavor)" $(GroupBuildCmd) "/p:RuntimeVariant=$(RuntimeVariant)" $(GroupBuildCmd) "/p:CLRTestBuildAllTargets=$(CLRTestBuildAllTargets)" @@ -446,6 +457,7 @@ $(GroupBuildCmd) "/p:__SkipRestorePackages=1" $(GroupBuildCmd) /nodeReuse:false $(GroupBuildCmd) /maxcpucount + $(GroupBuildCmd) /bl:$(ArtifactsDir)/log/$(Configuration)/InnerManagedTestBuild.$(__TestGroupToBuild).binlog @@ -478,7 +490,7 @@ + Condition="'$(__BuildTestWrappersOnly)' != '1' and '$(__CopyNativeTestBinaries)' != '1' and '$(__TestBuildMode)' == 'crossgen2' and !$(MonoAot) and !$(MonoFullAot)" > $(__BinDir) diff --git a/src/tests/build.sh b/src/tests/build.sh index 67117ba14727a1..35a309242f26a2 100755 --- a/src/tests/build.sh +++ b/src/tests/build.sh @@ -5,11 +5,10 @@ build_Tests() echo "${__MsgPrefix}Building Tests..." __ProjectFilesDir="$__TestDir" - __TestBinDir="$__TestWorkingDir" __Exclude="$__RepoRootDir/src/tests/issues.targets" - if [[ -f "${__TestWorkingDir}/build_info.json" ]]; then - rm "${__TestWorkingDir}/build_info.json" + if [[ -f "${__TestBinDir}/build_info.json" ]]; then + rm "${__TestBinDir}/build_info.json" fi if [[ "$__RebuildTests" -ne 0 ]]; then @@ -99,7 +98,6 @@ build_Tests() export __CopyNativeProjectsAfterCombinedTestBuild export __CopyNativeTestBinaries export __Priority - export __DoCrossgen2 export __CreatePerfmap export __CompositeBuildMode export __BuildTestWrappersOnly @@ -188,13 +186,11 @@ handle_arguments_local() { ;; crossgen2|-crossgen2) - __DoCrossgen2=1 __TestBuildMode=crossgen2 ;; composite|-composite) __CompositeBuildMode=1 - __DoCrossgen2=1 __TestBuildMode=crossgen2 ;; @@ -294,7 +290,6 @@ __CopyNativeProjectsAfterCombinedTestBuild=true __CopyNativeTestBinaries=0 __CrossBuild=0 __DistroRid="" -__DoCrossgen2= __CompositeBuildMode= __CreatePerfmap= __TestBuildMode= @@ -367,7 +362,7 @@ __OSPlatformConfig="$__TargetOS.$__BuildArch.$__BuildType" __BinDir="$__RootBinDir/bin/coreclr/$__OSPlatformConfig" __PackagesBinDir="$__BinDir/.nuget" __TestDir="$__RepoRootDir/src/tests" -__TestWorkingDir="$__RootBinDir/tests/coreclr/$__OSPlatformConfig" +__TestBinDir="$__RootBinDir/tests/coreclr/$__OSPlatformConfig" __IntermediatesDir="$__RootBinDir/obj/coreclr/$__OSPlatformConfig" __TestIntermediatesDir="$__RootBinDir/tests/coreclr/obj/$__OSPlatformConfig" __CrossCompIntermediatesDir="$__IntermediatesDir/crossgen" @@ -386,10 +381,10 @@ if [[ -z "$HOME" ]]; then fi if [[ "$__RebuildTests" -ne 0 ]]; then - if [[ -d "${__TestWorkingDir}" ]]; then - echo "Removing tests build dir: ${__TestWorkingDir}" - rm -rf "${__TestWorkingDir}" - fi + echo "Removing test build dir: ${__TestBinDir}" + rm -rf "${__TestBinDir}" + echo "Removing test intermediate dir: ${__TestIntermediatesDir}" + rm -rf "${__TestIntermediatesDir}" fi build_Tests diff --git a/src/tests/ilasm/PortablePdb/IlasmPortablePdbTester.cs b/src/tests/ilasm/PortablePdb/IlasmPortablePdbTester.cs index 5b697d5802759a..d804dd63a0f4ca 100644 --- a/src/tests/ilasm/PortablePdb/IlasmPortablePdbTester.cs +++ b/src/tests/ilasm/PortablePdb/IlasmPortablePdbTester.cs @@ -9,7 +9,7 @@ namespace IlasmPortablePdbTests { - public class IlasmPortablePdbTester : XunitBase + public class IlasmPortablePdbTester : IDisposable { private const string CoreRoot = "CORE_ROOT"; private const string IlasmFileName = "ilasm"; @@ -36,7 +36,7 @@ public void TestPortablePdbDebugDirectory(string ilSource) { var ilasm = IlasmPortablePdbTesterCommon.GetIlasmFullPath(CoreRootVar, IlasmFile); IlasmPortablePdbTesterCommon.Assemble(ilasm, ilSource, TestDir, out string dll, out string pdb); - + using (var peStream = new FileStream(dll, FileMode.Open, FileAccess.Read)) { using (var peReader = new PEReader(peStream)) @@ -102,7 +102,7 @@ public void TestPortablePdbDocuments() var portablePdbMdReader = pdbReaderProvider.GetMetadataReader(); Assert.NotNull(portablePdbMdReader); Assert.Equal(expected.Count, portablePdbMdReader.Documents.Count); - + int i = 0; foreach (var documentHandle in portablePdbMdReader.Documents) { @@ -246,7 +246,7 @@ public void TestPortablePdbLocalScope(string ilSource) Assert.Equal(expected[i].Length, localScope.Length); var variableHandles = localScope.GetLocalVariables(); Assert.Equal(expected[i].Variables.Count, variableHandles.Count); - + int j = 0; foreach (var variableHandle in localScope.GetLocalVariables()) { @@ -255,7 +255,7 @@ public void TestPortablePdbLocalScope(string ilSource) var variableName = portablePdbMdReader.GetString(variable.Name); Assert.Equal(expected[i].Variables[j].Name, variableName); Assert.Equal(expected[i].Variables[j].Index, variable.Index); - Assert.Equal(expected[i].Variables[j].IsDebuggerHidden, + Assert.Equal(expected[i].Variables[j].IsDebuggerHidden, variable.Attributes == LocalVariableAttributes.DebuggerHidden); j++; } @@ -268,10 +268,7 @@ public void TestPortablePdbLocalScope(string ilSource) } } } - - public static int Main(string[] args) - { - return new IlasmPortablePdbTester().RunTests(); - } + + public void Dispose() {} } } diff --git a/src/tests/ilasm/PortablePdb/IlasmPortablePdbTests.csproj b/src/tests/ilasm/PortablePdb/IlasmPortablePdbTests.csproj index d5759248ef8ee4..b490324b35c166 100644 --- a/src/tests/ilasm/PortablePdb/IlasmPortablePdbTests.csproj +++ b/src/tests/ilasm/PortablePdb/IlasmPortablePdbTests.csproj @@ -6,7 +6,6 @@ - diff --git a/src/tests/ilverify/ILMethodTester.cs b/src/tests/ilverify/ILMethodTester.cs index 83865a982c0d84..1dea2366dcb5d7 100644 --- a/src/tests/ilverify/ILMethodTester.cs +++ b/src/tests/ilverify/ILMethodTester.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Collections.Generic; using System.Linq; using System.Reflection.Metadata; @@ -16,7 +17,7 @@ public class ILMethodTester [Theory(DisplayName = "")] [MemberData(nameof(TestDataLoader.GetMethodsWithValidIL), MemberType = typeof(TestDataLoader))] [Trait("", "Valid IL Tests")] - void TestMethodsWithValidIL(ValidILTestCase validIL) + public static void TestMethodsWithValidIL(ValidILTestCase validIL) { var results = Verify(validIL); Assert.Empty(results); @@ -25,7 +26,7 @@ void TestMethodsWithValidIL(ValidILTestCase validIL) [Theory(DisplayName = "")] [MemberData(nameof(TestDataLoader.GetMethodsWithInvalidIL), MemberType = typeof(TestDataLoader))] [Trait("", "Invalid IL Tests")] - void TestMethodsWithInvalidIL(InvalidILTestCase invalidIL) + public static void TestMethodsWithInvalidIL(InvalidILTestCase invalidIL) { IEnumerable results = null; diff --git a/src/tests/ilverify/ILTests/ILTests.targets b/src/tests/ilverify/ILTests/ILTests.targets index 73e7592dd3e5ee..cf461072441c97 100644 --- a/src/tests/ilverify/ILTests/ILTests.targets +++ b/src/tests/ilverify/ILTests/ILTests.targets @@ -1,6 +1,7 @@ Library + SharedLibrary $(MSBuildProjectName) $(BaseOutputPathWithConfig)ilverify\Tests diff --git a/src/tests/ilverify/ILTypeVerificationTester.cs b/src/tests/ilverify/ILTypeVerificationTester.cs index 902e612ff76129..2e35b6f63ebb29 100644 --- a/src/tests/ilverify/ILTypeVerificationTester.cs +++ b/src/tests/ilverify/ILTypeVerificationTester.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Collections.Generic; using System.Linq; using System.Reflection.Metadata; @@ -11,12 +12,12 @@ namespace ILVerification.Tests { - public class ILTypeVerificationTester : XunitBase + public class ILTypeVerificationTester { [Theory(DisplayName = "")] [MemberData(nameof(TestDataLoader.GetTypesWithValidType), MemberType = typeof(TestDataLoader))] [Trait("", "Valid type implementation tests")] - private void TestValidTypes(ValidTypeTestCase validType) + public static void TestValidTypes(ValidTypeTestCase validType) { IEnumerable results = Verify(validType); Assert.Empty(results); @@ -25,7 +26,7 @@ private void TestValidTypes(ValidTypeTestCase validType) [Theory(DisplayName = "")] [MemberData(nameof(TestDataLoader.GetTypesWithInvalidType), MemberType = typeof(TestDataLoader))] [Trait("", "Invalid type implementation tests")] - private void TestInvalidTypes(InvalidTypeTestCase invalidType) + public static void TestInvalidTypes(InvalidTypeTestCase invalidType) { IEnumerable results = null; @@ -65,10 +66,5 @@ private static IEnumerable Verify(TestCase testCase) }); return verifier.Verify(module.PEReader, typeHandle); } - - public static int Main(string[] args) - { - return new ILTypeVerificationTester().RunTests(); - } } } diff --git a/src/tests/ilverify/ILVerification.Tests.csproj b/src/tests/ilverify/ILVerificationTests.csproj similarity index 89% rename from src/tests/ilverify/ILVerification.Tests.csproj rename to src/tests/ilverify/ILVerificationTests.csproj index 779ef5ed4e5b27..049390bad80f48 100644 --- a/src/tests/ilverify/ILVerification.Tests.csproj +++ b/src/tests/ilverify/ILVerificationTests.csproj @@ -12,13 +12,11 @@ - - diff --git a/src/tests/ilverify/TestDataLoader.cs b/src/tests/ilverify/TestDataLoader.cs index 52231124b307e1..7823215c221f22 100644 --- a/src/tests/ilverify/TestDataLoader.cs +++ b/src/tests/ilverify/TestDataLoader.cs @@ -289,7 +289,7 @@ protected override PEReader ResolveCore(string simpleName) } } - abstract class TestCase : IXunitSerializable + public abstract class TestCase : IXunitSerializable { public string TestName { get; set; } public string TypeName { get; set; } @@ -324,12 +324,12 @@ public override string ToString() /// /// Describes a test case with a method that contains valid IL /// - class ValidILTestCase : TestCase { } + public class ValidILTestCase : TestCase { } /// /// Describes a test case with a method that contains invalid IL with the expected VerifierErrors /// - class InvalidILTestCase : TestCase + public class InvalidILTestCase : TestCase { public List ExpectedVerifierErrors { get; set; } @@ -369,9 +369,9 @@ private static string GetErrorsString(List errors) } } - class ValidTypeTestCase : TestCase { } + public class ValidTypeTestCase : TestCase { } - class InvalidTypeTestCase : TestCase + public class InvalidTypeTestCase : TestCase { public List ExpectedVerifierErrors { get; set; } diff --git a/src/tests/issues.targets b/src/tests/issues.targets index 645fdf8bb1731c..3ba7703b5f1c95 100644 --- a/src/tests/issues.targets +++ b/src/tests/issues.targets @@ -186,6 +186,9 @@ TraceEvent can't parse unaligned floats on arm32 + + TraceEvent can't parse unaligned floats on arm32 + Allocates large contiguous array that is not consistently available on 32-bit platforms @@ -482,6 +485,9 @@ Allocates large contiguous array that is not consistently available on 32-bit platforms + + https://github.com/dotnet/runtime/issues/60152 + @@ -508,6 +514,9 @@ + + https://github.com/dotnet/runtime/issues/57621 + https://github.com/dotnet/runtime/issues/10478 @@ -820,7 +829,7 @@ https://github.com/dotnet/runtime/issues/53560 - + https://github.com/dotnet/runtime/issues/56148 @@ -837,6 +846,9 @@ + + https://github.com/dotnet/runtime/issues/61693 + https://github.com/dotnet/runtime/issues/56887 @@ -867,6 +879,9 @@ Tests features specific to coreclr + + Tests features specific to coreclr + https://github.com/dotnet/runtime/issues/40394 @@ -1504,9 +1519,12 @@ needs triage - + Tests coreclr JIT's debug poisoning of address taken variables + + Tests coreclr JIT's debug info generation + @@ -1805,9 +1823,6 @@ https://github.com/dotnet/runtime/issues/54375 - - https://github.com/dotnet/runtime/issues/54374 - needs triage diff --git a/src/tests/profiler/unittest/unloadlibrary.csproj b/src/tests/profiler/unittest/unloadlibrary.csproj index 51b3e4b5ee60b3..dacc2154522e04 100644 --- a/src/tests/profiler/unittest/unloadlibrary.csproj +++ b/src/tests/profiler/unittest/unloadlibrary.csproj @@ -2,6 +2,7 @@ .NETCoreApp Library + SharedLibrary true diff --git a/src/tests/readytorun/r2rdump/FrameworkTests/R2RDumpTester.cs b/src/tests/readytorun/r2rdump/FrameworkTests/R2RDumpTester.cs index 155fd38a78662e..674c6652515478 100644 --- a/src/tests/readytorun/r2rdump/FrameworkTests/R2RDumpTester.cs +++ b/src/tests/readytorun/r2rdump/FrameworkTests/R2RDumpTester.cs @@ -6,13 +6,13 @@ namespace R2RDumpTests { - public class R2RDumpTester : XunitBase + public class R2RDumpTester { private const string CoreRoot = "CORE_ROOT"; private const string R2RDumpRelativePath = "R2RDump"; private const string R2RDumpFile = "R2RDump.dll"; private const string CoreRunFileName = "corerun"; - + public static string FindExePath(string exe) { if (OperatingSystem.IsWindows()) @@ -37,7 +37,8 @@ public static string FindExePath(string exe) } [Fact] - public void DumpCoreLib() + [SkipOnMono("Ready-To-Run is a CoreCLR-only feature", TestPlatforms.Any)] + public static void DumpCoreLib() { string CoreRootVar = Environment.GetEnvironmentVariable(CoreRoot); bool IsUnix = !OperatingSystem.IsWindows(); @@ -73,10 +74,5 @@ public void DumpCoreLib() Assert.True(!failed); } } - - public static int Main(string[] args) - { - return new R2RDumpTester().RunTests(); - } } -} \ No newline at end of file +} diff --git a/src/tests/readytorun/r2rdump/FrameworkTests/R2RDumpTests.csproj b/src/tests/readytorun/r2rdump/FrameworkTests/R2RDumpTests.csproj index 539d8bcf9029b3..dc513e6d2b63cd 100644 --- a/src/tests/readytorun/r2rdump/FrameworkTests/R2RDumpTests.csproj +++ b/src/tests/readytorun/r2rdump/FrameworkTests/R2RDumpTests.csproj @@ -9,14 +9,10 @@ - - - - diff --git a/src/tests/reflection/DefaultInterfaceMethods/GetInterfaceMapProvider.ilproj b/src/tests/reflection/DefaultInterfaceMethods/GetInterfaceMapProvider.ilproj index f09b53bac686f5..bc2066caba27ff 100644 --- a/src/tests/reflection/DefaultInterfaceMethods/GetInterfaceMapProvider.ilproj +++ b/src/tests/reflection/DefaultInterfaceMethods/GetInterfaceMapProvider.ilproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/reflection/DefaultInterfaceMethods/InvokeProvider.ilproj b/src/tests/reflection/DefaultInterfaceMethods/InvokeProvider.ilproj index 019f8ee4d532c7..826921c74bc116 100644 --- a/src/tests/reflection/DefaultInterfaceMethods/InvokeProvider.ilproj +++ b/src/tests/reflection/DefaultInterfaceMethods/InvokeProvider.ilproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/reflection/RefEmit/Dependency.csproj b/src/tests/reflection/RefEmit/Dependency.csproj index 809291c86bd6b1..d12b0d15ac3c04 100644 --- a/src/tests/reflection/RefEmit/Dependency.csproj +++ b/src/tests/reflection/RefEmit/Dependency.csproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/reflection/StaticInterfaceMembers/provider.ilproj b/src/tests/reflection/StaticInterfaceMembers/provider.ilproj index a10e6d25b0e4fb..38ea2d326750d2 100644 --- a/src/tests/reflection/StaticInterfaceMembers/provider.ilproj +++ b/src/tests/reflection/StaticInterfaceMembers/provider.ilproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/reflection/ldtoken/byrefs.il b/src/tests/reflection/ldtoken/byrefs.il index 666f34edac81c3..6f6d2ba0c9c5af 100644 --- a/src/tests/reflection/ldtoken/byrefs.il +++ b/src/tests/reflection/ldtoken/byrefs.il @@ -8,6 +8,7 @@ // .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -23,6 +24,9 @@ { .method private hidebysig static int32 Main() cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint .maxstack 2 diff --git a/src/tests/run.sh b/src/tests/run.sh index 3a97727f4dea44..575e6a4ff77c56 100755 --- a/src/tests/run.sh +++ b/src/tests/run.sh @@ -17,7 +17,7 @@ function print_usage { echo ' --testRootDir= : Root directory of the test build (e.g. runtime/artifacts/tests/windows.x64.Debug).' echo ' --disableEventLogging : Disable the events logged by both VM and Managed Code' echo ' --sequential : Run tests sequentially (default is to run in parallel).' - echo ' --runcrossgen2tests : Runs the ReadyToRun tests compiled with Crossgen2' + echo ' --runcrossgen2tests : Runs the ReadyToRun tests compiled with Crossgen2' echo ' --jitstress= : Runs the tests with COMPlus_JitStress=n' echo ' --jitstressregs= : Runs the tests with COMPlus_JitStressRegs=n' echo ' --jitminopts : Runs the tests with COMPlus_JITMinOpts=1' @@ -181,10 +181,10 @@ do ;; --test-env=*) testEnv=${i#*=} - ;; + ;; --gcstresslevel=*) export COMPlus_GCStress=${i#*=} - ;; + ;; --gcname=*) export COMPlus_GCName=${i#*=} ;; @@ -236,30 +236,30 @@ fi if [ "$buildOS" = "Android" ]; then runtestPyArguments+=("-os" "Android") fi - -if [ ! -z "$testRootDir" ]; then + +if [[ -n "$testRootDir" ]]; then runtestPyArguments+=("-test_location" "$testRootDir") echo "Test Location : ${testRootDir}" fi -if [ ! -z "${testEnv}" ]; then +if [[ -n "${testEnv}" ]]; then runtestPyArguments+=("-test_env" "${testEnv}") echo "Test Env : ${testEnv}" fi echo "" -if [ ! -z "$longgc" ]; then +if [[ -n "$longgc" ]]; then echo "Running Long GC tests" runtestPyArguments+=("--long_gc") fi -if [ ! -z "$gcsimulator" ]; then +if [[ -n "$gcsimulator" ]]; then echo "Running GC simulator tests" runtestPyArguments+=("--gcsimulator") fi -if [ ! -z "$ilasmroundtrip" ]; then +if [[ -n "$ilasmroundtrip" ]]; then echo "Running Ilasm round trip" runtestPyArguments+=("--ilasmroundtrip") fi @@ -268,29 +268,29 @@ if (($verbose!=0)); then runtestPyArguments+=("--verbose") fi -if [ ! "$runSequential" -eq 0 ]; then +if [ "$runSequential" -ne 0 ]; then echo "Run tests sequentially." runtestPyArguments+=("--sequential") fi -if [ ! -z "$printLastResultsOnly" ]; then +if [[ -n "$printLastResultsOnly" ]]; then runtestPyArguments+=("--analyze_results_only") fi -if [ ! -z "$RunCrossGen2" ]; then +if [[ -n "$RunCrossGen2" ]]; then runtestPyArguments+=("--run_crossgen2_tests") fi -if [ "$limitedCoreDumps" == "ON" ]; then +if [[ "$limitedCoreDumps" == "ON" ]]; then runtestPyArguments+=("--limited_core_dumps") fi -if [[ ! "$runincontext" -eq 0 ]]; then +if [[ "$runincontext" -ne 0 ]]; then echo "Running in an unloadable AssemblyLoadContext" runtestPyArguments+=("--run_in_context") fi -if [[ ! "$tieringtest" -eq 0 ]]; then +if [[ "$tieringtest" -ne 0 ]]; then echo "Running to encourage tier1 rejitting" runtestPyArguments+=("--tieringtest") fi diff --git a/src/tests/runparallel.sh b/src/tests/runparallel.sh index 0949d4a519466a..0c0112f8baf4da 100755 --- a/src/tests/runparallel.sh +++ b/src/tests/runparallel.sh @@ -156,7 +156,7 @@ if [ ! -d "$testRootDir" ]; then exit $EXIT_CODE_EXCEPTION fi -if [ ! -z "$testEnv" ] && [ ! -e "$testEnv" ]; then +if [[ -n "$testEnv" && ! -e "$testEnv" ]]; then echo "File specified by --playlist does not exist: $testEnv" exit $EXIT_CODE_EXCEPTION fi